/home/ivoiecob/email.hirewise-va.com/static/js/IPAllowList.app.19b2c0d8381f104534d5.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[283],{B9Jc:(t,i,o)=>{var e=o("a7T2"),s=o("ERH9");t.exports={CurrentIP:"",init:function(t){var i=e.extend({},t[this.ServerModuleName]||{},t.IPAllowList||{});e.isEmpty(i)||(this.CurrentIP=s.pString(i.CurrentIP,this.CurrentIP))}}},"Kox+":(t,i,o)=>{var e=o("a7T2"),s=o("p09A"),n=o("LKDt"),l=o("8QQh"),r=o("Z9uT"),p=o("MYiO"),I=o("5D2l"),u=o("PMEU"),a=o("D2Gh"),h=I.run("SettingsWebclient","getAbstractSettingsFormViewClass"),A=o("X6JB"),P=o("B9Jc");function c(){h.call(this),this.ipAllowlist=s.observableArray([]),this.sCurrentIp=P.CurrentIP}e.extendOwn(c.prototype,h.prototype),c.prototype.ViewTemplate="IPAllowList_IPAllowListSettingsFormView",c.prototype.onShow=function(){this.clearAll()},c.prototype.clearAll=function(){this.populateIpAllowlist()},c.prototype.populateIpAllowlist=function(){l.send("IPAllowList","GetIpAllowlist",null,function(t){e.isObject(t&&t.Result)?this.ipAllowlist(e.map(t.Result,function(t,i){return{IP:i,Comment:t.Comment}})):r.showErrorByCode(t,n.i18n("IPALLOWLIST/ERROR_CANNOT_GET_IP_ALLOWLIST"))},this)},c.prototype.addIpToAllowlist=function(){var t=e.map(this.ipAllowlist(),function(t){return t.IP});u.showPopup(A,[t,this.populateIpAllowlist.bind(this)])},c.prototype.askRemoveIp=function(t){var i=t===this.sCurrentIp&&this.ipAllowlist().length>1?n.i18n("IPALLOWLIST/CONFIRM_REMOVE_CURRENT_IP"):n.i18n("IPALLOWLIST/CONFIRM_REMOVE_IP"),o=n.i18n("IPALLOWLIST/CONFIRM_HEADING_REMOVE_IP",{IP:t});u.showPopup(p,[i,e.bind(function(i){i&&this.removeIp(t)},this),o,n.i18n("IPALLOWLIST/ACTION_PROCEED")])},c.prototype.removeIp=function(t){var i={IP:t};l.send("IPAllowList","RemoveIpFromAllowlist",i,function(t){this.populateIpAllowlist(),t&&t.Result?a.showReport(n.i18n("IPALLOWLIST/REPORT_REMOVE_IP")):r.showErrorByCode(t,n.i18n("IPALLOWLIST/ERROR_REMOVE_IP"))},this)},t.exports=new c},X6JB:(t,i,o)=>{var e=o("a7T2"),s=o("p09A"),n=o("LKDt"),l=o("8QQh"),r=o("Z9uT"),p=o("69av"),I=o("MYiO"),u=o("PMEU"),a=o("B9Jc"),h=o("D2Gh");function A(){p.call(this),this.aAllowedIpAddresses=[],this.fCallback=null,this.ip=s.observable(""),this.ipFocus=s.observable(!0),this.comment=s.observable(""),this.inProgress=s.observable(!1)}e.extendOwn(A.prototype,p.prototype),A.prototype.PopupTemplate="IPAllowList_AddIpToAllowlistPopup",A.prototype.onOpen=function(t,i){this.aAllowedIpAddresses=t,this.fCallback=i,this.ip(""),this.ipFocus(!0),this.comment("")},A.prototype.validateAndAddIp=function(){if(""===this.ip())h.showError(n.i18n("IPALLOWLIST/ERROR_IP_EMPTY")),this.ipFocus(!0);else if(this.ip()!==a.CurrentIP&&-1===this.aAllowedIpAddresses.indexOf(a.CurrentIP)){var t=n.i18n("IPALLOWLIST/CONFIRM_NOT_CURRENT_IP",{CURRENTIP:a.CurrentIP});u.showPopup(I,[t,e.bind(function(t){t&&this.addIp()},this),"",n.i18n("IPALLOWLIST/ACTION_PROCEED")])}else this.addIp()},A.prototype.addIp=function(){var t={IP:this.ip(),Comment:this.comment()};this.inProgress(!0),l.send("IPAllowList","AddIpToAllowlist",t,this.onAddIpToAllowlistResponse,this)},A.prototype.onAddIpToAllowlistResponse=function(t){this.inProgress(!1),t&&t.Result?(h.showReport(n.i18n("IPALLOWLIST/REPORT_ADD_IP")),this.close(!0)):r.showErrorByCode(t,n.i18n("IPALLOWLIST/ERROR_ADD_IP"))},A.prototype.close=function(t){e.isFunction(this.fCallback)&&this.fCallback(!!t),this.closePopup()},t.exports=new A},XySv:(t,i,o)=>{var e=o("LKDt"),s=o("yU9o"),n=o("B9Jc");t.exports=function(t){return n.init(t),s.isUserNormalOrTenant()&&!s.isMobile()?{start:function(t){t.isModuleEnabled("SecuritySettingsWebclient")?t.run("SecuritySettingsWebclient","registerSecuritySettingsSection",[function(){var t=o("Kox+");return t.ViewTemplate="IPAllowList_IPAllowListSettingsSectionFormView",t},"IPAllowList"]):t.run("SettingsWebclient","registerSettingsTab",[function(){return o("Kox+")},"ip-allow-list",e.i18n("IPALLOWLIST/LABEL_SETTINGS_TAB")])}}:null}}}]);