/home/ivoiecob/email.hirewise-va.com/static/js/ActivityHistory.app.6f787238cad3d9ebf0cb.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[5636],{"FZR+":(t,e,i)=>{var o=i("a7T2"),s=i("M4cL"),r=i("p09A"),n=i("uQaC"),a=i("yU9o");function h(t,e){this.bShown=!1,this.currentPage=r.observable(1),this.count=r.observable(t),this.perPage=r.observable(e),this.firstPage=r.observable(1),this.lastPage=r.observable(1),this.pagesCount=r.computed(function(){var t=this.perPage()>0?Math.ceil(this.count()/this.perPage()):0;return t>0?t:1},this),r.computed(function(){var t=20,e=4,i=this.pagesCount(),o=this.currentPage(),s=o,r=o;if(i>1)for(;t--,1<s&&(s--,e--),0!==e&&(i>r&&(r++,e--),0!==e)&&0!==t;);this.firstPage(s),this.lastPage(r)},this),this.visibleFirst=r.computed(function(){return this.firstPage()>1},this),this.visibleLast=r.computed(function(){return this.lastPage()<this.pagesCount()},this),this.clickPage=o.bind(this.clickPage,this),this.pages=r.computed(function(){var t=this.firstPage(),e=[];if(this.firstPage()<this.lastPage())for(;t<=this.lastPage();t++)e.push({number:t,current:t===this.currentPage(),clickFunc:this.clickPage});return e},this),a.isMobile()||this.hotKeysBind()}h.prototype.ViewTemplate="CoreWebclient_PageSwitcherView",h.prototype.hotKeysBind=function(){s(document).on("keydown",s.proxy(function(t){if(this.bShown&&!n.isTextFieldFocused()){var e=t.keyCode;t.ctrlKey&&e===Enums.Key.Left?this.clickPreviousPage():t.ctrlKey&&e===Enums.Key.Right&&this.clickNextPage()}},this))},h.prototype.hide=function(){this.bShown=!1},h.prototype.show=function(){this.bShown=!0},h.prototype.clear=function(){this.currentPage(1),this.count(0)},h.prototype.setCount=function(t){this.count(t),this.currentPage()>this.pagesCount()&&this.currentPage(this.pagesCount())},h.prototype.setPage=function(t,e){this.perPage(e),t>this.pagesCount()?this.currentPage(this.pagesCount()):this.currentPage(t)},h.prototype.clickPage=function(t){var e=t.number;e<1&&(e=1),e>this.pagesCount()&&(e=this.pagesCount()),this.currentPage(e)},h.prototype.clickFirstPage=function(){this.currentPage(1)},h.prototype.clickPreviousPage=function(){var t=this.currentPage()-1;t<1&&(t=1),this.currentPage(t)},h.prototype.clickNextPage=function(){var t=this.currentPage()+1;t>this.pagesCount()&&(t=this.pagesCount()),this.currentPage(t)},h.prototype.clickLastPage=function(){this.currentPage(this.pagesCount())},t.exports=h},HcBs:(t,e,i)=>{var o=i("a7T2"),s=i("p09A"),r=i("LKDt"),n=i("8QQh"),a=i("Z9uT"),h=i("69av"),u=i("ebd4"),c=i("FZR+"),p=i("D2Gh"),g=i("PMEU"),m=i("MYiO");function f(){h.call(this),this.popupHeading=s.observable(""),this.item=null,this.historyItems=s.observableArray([]),this.isLoading=s.observable(!0),this.isEmptyHistory=s.computed(function(){return!this.isLoading()&&0===this.historyItems().length},this),this.iEventsPerPage=10,this.oPageSwitcher=new c(0,this.iEventsPerPage),this.oPageSwitcher.currentPage.subscribe(function(){this.requestEvents()},this),this.iCurrentPage=0}o.extendOwn(f.prototype,h.prototype),f.prototype.PopupTemplate="ActivityHistory_ShowHistoryPopup",f.prototype.onOpen=function(t,e){this.item=e,this.popupHeading(t),this.historyItems([]),this.isLoading(!0),this.oPageSwitcher.setPage(1,this.iEventsPerPage),this.requestEvents()},f.prototype.requestEvents=function(){n.send("ActivityHistory","GetList",{ResourceType:"file",ResourceId:this.item.storageType()+this.item.fullPath(),Offset:(this.oPageSwitcher.currentPage()-1)*this.iEventsPerPage,Limit:this.iEventsPerPage},this.onGetActivityHistory,this)},f.prototype.onGetActivityHistory=function(t,e){if(t.Result&&o.isArray(t.Result.Items)){var i=[];o.each(t.Result.Items,function(t){var e=new u;e.parse(t.Timestamp),i.push({time:e.getFullDate(),action:t.Action,userPublicId:t.GuestPublicId,ip:t.IpAddress})}),this.historyItems(i),this.oPageSwitcher.setCount(t.Result.Count)}else a.showErrorByCode(t,r.i18n("ACTIVITYHISTORY/ERROR_GET_HISTORY"));this.isLoading(!1)},f.prototype.confirmClearHistory=function(){g.showPopup(m,[r.i18n("ACTIVITYHISTORY/CONFIRM_CLEAR_HISTORY"),o.bind(function(t){t&&this.clearHistory()},this),"",r.i18n("ACTIVITYHISTORY/ACTION_CLEAR_HISTORY")])},f.prototype.clearHistory=function(){n.send("ActivityHistory","Delete",{ResourceType:"file",ResourceId:this.item.storageType()+this.item.fullPath()},this.onDeleteActivityHistory,this)},f.prototype.onDeleteActivityHistory=function(t,e){t.Result?(this.historyItems([]),this.oPageSwitcher.setCount(0),p.showReport(r.i18n("ACTIVITYHISTORY/REPORT_CLEAR_HISTORY"))):a.showErrorByCode(t,r.i18n("ACTIVITYHISTORY/ERROR_CLEAR_HISTORY")),this.isLoading(!1)},t.exports=new f},ebd4:(t,e,i)=>{var o=i("sdEb"),s=i("LKDt"),r=i("uQaC"),n=i("KIwC");function a(){this.iTimeStampInUTC=0,this.oMoment=null}a.prototype.parse=function(t){this.iTimeStampInUTC=t,this.oMoment=o.unix(this.iTimeStampInUTC)},a.prototype.setDate=function(t,e,i){this.oMoment=o([t,e,i])},a.prototype.getTimeFormat=function(){return n.timeFormat()===window.Enums.TimeFormat.F24?"HH:mm":"hh:mm A"},a.prototype.getFullDate=function(){return this.getDate()+" "+this.getTime()},a.prototype.getMidDate=function(){return this.getShortDate(!0)},a.prototype.getShortDate=function(t){var e="",i=null;return this.oMoment&&((i=o()).format("L")===this.oMoment.format("L")?e=this.oMoment.format(this.getTimeFormat()):(e=i.clone().subtract(1,"days").format("L")===this.oMoment.format("L")?s.i18n("COREWEBCLIENT/LABEL_YESTERDAY"):n.UserSelectsDateFormat?this.oMoment.format(r.getDateFormatForMoment(n.dateFormat())):i.year()===this.oMoment.year()?this.oMoment.format("MMM D"):this.oMoment.format("MMM D, YYYY"),t&&(e+=", "+this.oMoment.format(this.getTimeFormat())))),e},a.prototype.getDate=function(){var t="ddd, MMM D, YYYY";return n.UserSelectsDateFormat&&(t="ddd, "+r.getDateFormatForMoment(n.dateFormat())),this.oMoment?this.oMoment.format(t):""},a.prototype.getTime=function(){return this.oMoment?this.oMoment.format(this.getTimeFormat()):""},a.prototype.getTimeStampInUTC=function(){return this.iTimeStampInUTC},t.exports=a},"pV+z":(t,e,i)=>{t.exports=function(t){return{getShowHistoryPopup:function(){return i("HcBs")}}}}}]);