(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{"++gc":function(e,t,n){"use strict";n.d(t,"a",function(){return y});var o=n("mrSG"),i=n("AytR"),r=n("2Vo4"),a=n("wd/R"),s=n("fXoL"),c=n("0IaG"),p=n("jtHE");const d=["target"];function l(e,t){}let b=(()=>{class e{constructor(e,t,n){this.dialogRef=e,this.resolver=t,this.data=n,this.dialogCallback$=new p.a,this.dialogCallback$$=this.dialogCallback$.asObservable(),this.dialogCallback$$.subscribe(e=>{this.dialogRef.close(e)})}ngOnInit(){const e=this.resolver.resolveComponentFactory(this.data.component);this.componentRef=this.vcRef.createComponent(e),this.componentRef.instance.data=Object.assign(Object.assign({},this.data.data),{callback:this.dialogCallback$})}ngOnDestroy(){this.componentRef&&this.componentRef.destroy()}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(c.g),s.Xb(s.l),s.Xb(c.a))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-component-dialog"]],viewQuery:function(e,t){if(1&e&&s.Wc(d,3,s.X),2&e){let e;s.Cc(e=s.lc())&&(t.vcRef=e.first)}},decls:3,vars:0,consts:[[1,"scrollable-content"],["target",""]],template:function(e,t){1&e&&(s.dc(0,"div",0),s.Pc(1,l,0,0,"ng-template",null,1,s.Qc),s.cc())},styles:[""]}),e})();var M=n("tk/3"),u=n("fyic"),z=n("6LcO"),h=n("6adi"),O=n("tyNb"),g=n("jhN1"),m=n("YOl1"),f=n("bkm/"),A=n("4pnn"),_=n("RYOh"),q=n("rj1t");let y=(()=>{class e{constructor(e,t,n,o,a,s,c,p,d,l,b,M,u){var z;this.http=e,this.companyService=t,this.bankService=n,this.notificationsService=o,this.router=a,this.domSanitizer=s,this.utilService=c,this.titleService=p,this.dashboardService=d,this.cookieService=l,this.interceptor=b,this._token=M,this.dialog=u,this.favIcon=document.querySelector("#appIcon"),this.languageMessages=[],this.unreadNotificationList=[],this.isLanguageChanged=!0,this.showFaqSlider=!1,this.selectedThemeCss="",this.selectedThemeImages="",this.currentPageUrl="",this.user_type="",this.designation="",this.allowStudentRole=!1,this.currentYear=(new Date).getFullYear(),this.callAutoReload=!1,this.isCompanySelected=!1,this.isCompanyActive=!1,this.initialProcessList=[],this.companyList=[],this.companyBankData={},this.selectedCompany={},this.zoneName="",this.selectedDomain="",this.selectedZoneFullName="",this.loginUserId="",this.parentRoleId="",this.allowedOtpDomain=[],this.maxAllowedUBO=4,this.showSideBar=!0,this.baseUrl=window.location.origin,this.domainName=this.baseUrl.split(".")[0].replace("https://","").replace("http://",""),this.licenseDetailUpdate=new r.a([]),this.companyManagementUpdate=new r.a(!1),this.employeeManagementUpdate=new r.a(!1),this.isVisaCounterEnabled=!1,this.reengineeringApplicable=!1,this.reengineeringApplicableZone=!1,this.isNewFeedbackModuleOn=!1,this.isBusinessActivityDisApply=!1,this.categoryDisData="",this.handleFeedbackModel$=new r.a(!1),this.handleFeedbackModel$$=this.handleFeedbackModel$.asObservable(),this.showFeedbackDialogLoading=!1,this.enforcementIsPaymentActive=!1,this.contactInfo=[],this.feedbackInfo={dialogType:"",feedbackEnabled:"",general_feedback_data:"",dynamic_feedback_data:"",feedback_id:"",selectedDialogType:""},this.flagStakeholderEmailValidation=!1,this.selectedLanguage$=new r.a("en"),this.selectedLanguage$$=this.selectedLanguage$.asObservable(),this.isSpcZone=!1,this.ssoCompleteStatus=new r.a(null),this.channel=new BroadcastChannel("my_channel"),this.isMeydanZone=!1,this.isGDRFAClicked=!1,this.isHelpSupportVisible=!1,this.isDateValueUpdate=new r.a({}),this.updateFinalVisaCount=new r.a({}),this.handleCopyPhoneNumber=new r.a({}),this.handleRestrictedUsers=new r.a(""),this.business_activity_link="";let h=localStorage.getItem(i.a.LOCAL_STORAGE.USER_PREFERENCES);h=this.interceptor.xyz(h),this.selectedLanguage=h.language?h.language:"EN",this.selectedTheme=h.theme?h.theme:"",this.selectedThemeCss="",this.selectedThemeImages="",this.languageMessages=localStorage.getItem(i.a.LOCAL_STORAGE.LANGUAGE_MESSAGES)?this.interceptor.xyz(localStorage.getItem(i.a.LOCAL_STORAGE.LANGUAGE_MESSAGES)):[],this.user_type=this.interceptor.xyz(localStorage.getItem(i.a.LOCAL_STORAGE.LOGIN_ROLE)),this.accessToken=this.interceptor.xyz(localStorage.getItem(i.a.LOCAL_STORAGE.ACCESS_TOKEN)),console.log("\ud83d\ude80 ~ CommonService ~ this.accessToken:",this.accessToken);let O=localStorage.getItem(i.a.LOCAL_STORAGE.SELECTED_COMPANY);O&&(this.selectedCompany=this.interceptor.xyz(O)),this.accessToken&&(this.getNotifications(),this.getInitialProcessRequest(),this.getCompany(),this.loginUserId=null===(z=this.accessToken)||void 0===z?void 0:z.id),this.parentRoleId=this.interceptor.xyz(localStorage.getItem(i.a.LOCAL_STORAGE.LOGIN_PARENT_ROLE)),this.selectedCompany&&this.selectedCompany.id&&(this.parentRoleId=this.selectedCompany.parent_consultant_id),this.loginRoleId=this.interceptor.xyz(localStorage.getItem(i.a.LOCAL_STORAGE.LOGIN_ROLE)),this.loadCommonJs(),this.loadDefaultPasswordAnimation();let g=window.location.href.split("/"),m=g[0]+"//"+g[2];(m.includes("spc")||m.includes("portal.spcfz"))&&(this.isSpcZone=!0),(m.includes("meydan")||m.includes("portal.meydan")||m.includes("localhost"))&&(this.isMeydanZone=!0)}encryptId(e){return e?this.interceptor.abcString(e):""}dencryptId(e){return e?this.interceptor.xyzString(e):""}translateMessage(e){if("mplus"==(null==e?void 0:e.toLowerCase()))return e;let t=[];return this.languageMessages.length>0&&(t=this.languageMessages.filter(t=>t.text_code===e)),this.isLanguageChanged=!1,0===t.length?e.replace(/_/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):t[0].message[this.selectedLanguage.toUpperCase()]}getInitialProcessRequest(){let e={status:i.a.STATUS.ACTIVE,jurisdiction_id:"1"===localStorage.getItem(i.a.LOCAL_STORAGE.IS_JURISDICTION)?localStorage.getItem(i.a.LOCAL_STORAGE.JURISDICTION_ID):1};this.dashboardService.getInitialProcessRequest(e).subscribe(e=>{200==e.status&&(this.initialProcessList=e.data)})}showToaster(e,t){let n;clearTimeout(this.toasterTimeout),$(".alert.toastr")&&$(".alert.toastr").remove(),"error"===e&&(n="
"),"success"===e&&(n="
");let o=$(n).appendTo(".toast-popup-wrapper");setTimeout(()=>{$(".toast-popup-wrapper").addClass("show")},10),setTimeout(()=>{$(".toast-popup-wrapper").addClass("active")},50),this.toasterTimeout=setTimeout(()=>{$(".toast-popup-wrapper").removeClass("show"),$(".toast-popup-wrapper").removeClass("active"),$(o).remove()},3e3)}getNotifications(){const e={user_id:!0,type:[i.a.NOTIFICATION_SUB_TYPE.CUSTOMER,i.a.NOTIFICATION_SUB_TYPE.ESCALATE_NOTIFICATION],mark_as:0};this.accessToken.role_id!==i.a.LOGIN_ROLE.CUSTOMER&&this.accessToken.role_id!==i.a.LOGIN_ROLE.CONSULTANT1&&this.accessToken.role_id!==i.a.LOGIN_ROLE.CONSULTANT2||(e.type=[i.a.NOTIFICATION_SUB_TYPE.CUSTOMER,i.a.NOTIFICATION_SUB_TYPE.ESCALATE_NOTIFICATION,i.a.NOTIFICATION_SUB_TYPE.FEEDBACK_NOTIFICATION]),this.notificationsService.getNotifications(e).subscribe(e=>{var t;200==e.status&&(this.unreadNotificationList=e.data,null===(t=this.unreadNotificationList)||void 0===t||t.map(e=>{e.comment.includes("feedbackLink")&&(e.comment=this.domSanitizer.bypassSecurityTrustHtml(e.comment))}))},e=>{this.showToaster("error","Something went wrong. Please try again.")})}handleClick(e){const t=e.target;if("A"===t.tagName&&(e.preventDefault(),t.getAttribute("href"))){const e=t.getAttribute("data-tag"),n=t.getAttribute("href");this.handleFeedbackModelOpen("dynamic","customer",n,e)}}getIPAddress(){return this.http.get("https://api.ipify.org")}getDefaultConfigurations(){const e=this;e.companyService.getDefaultConfigurations().subscribe(t=>{var n,o,r;if(200===t.status){let a=t.data.result.find(e=>"zone"===e.key);this.selectedDomain=null===(n=null==a?void 0:a.value)||void 0===n?void 0:n.domain,this.selectedZoneFullName=null===(o=null==a?void 0:a.value)||void 0===o?void 0:o.full_name;let s=t.data.result.find(e=>"visa_counter"===e.key);this.isVisaCounterEnabled=1==(null==s?void 0:s.value);let c=t.data.result.find(e=>"concierge_service_name"===e.key);localStorage.setItem(i.a.CONCIERGE_SERVICE_NAME,c?null==c?void 0:c.value:"Concierge Services");let p=t.data.result.filter(e=>"DEFAULT_LANGUAGE"===e.key);p.length>0&&p[0].value&&(this.selectedLanguage=p[0].value);let d=t.data.result.filter(e=>"Theme"===e.key);d.length>0&&d[0].value&&(this.selectedTheme=d[0].value),e.getDefaultTheme();let l=t.data.result.find(e=>"date_format"===e.key);e.dateFormatSettingObj=e.getDtFrForPicker(l.value),e.dateFormatForPatchVal=e.setDateFormatForPatchVal(l.value);let b=t.data.result.filter(e=>"HELP_SUPPORT"===e.key);e.isHelpSupportVisible=(null==b?void 0:b.length)>0&&"1"==(null===(r=b[0])||void 0===r?void 0:r.value)}},e=>{this.showToaster("error","Something went wrong. Please try again.")})}setDateFormatForPatchVal(e="DD-MM-YYYY"){let t="DD-MM-YYYY";if(e&&(e.includes("-")||e.includes("/"))){let n=e.includes("-")?"-":e.includes("/")?"/":"",o=e.split(n);if(o&&o.length>0){for(let e=0;e0){for(let e=0;e{if(200==e.status){let t=e.data.result.filter(e=>e.title===this.selectedTheme);t.length>0&&(t[0].css&&(this.selectedThemeCss=this.domSanitizer.bypassSecurityTrustResourceUrl(t[0].css)),this.selectedThemeImages=t[0].images,this.favIcon.href=this.selectedThemeImages+"/favicon.ico")}},e=>{this.showToaster("error","Something went wrong. Please try again.")})}logOut(e=!1){var t,n;let o=localStorage.getItem("auth-token");if(console.log("\ud83d\ude80 ~ CommonService ~ logOut ~ accessTokenData:",o),e||this._token.tokenKey&&!o){let e="login";this.user_type==i.a.LOGIN_ROLE.AGENT?e="login/agent":this.user_type==i.a.LOGIN_ROLE.CONSULTANT1?e="login/consultant1":this.user_type==i.a.LOGIN_ROLE.CONSULTANT2&&(e="login/consultant2");let o=localStorage.getItem(i.a.LOCAL_STORAGE.USER_CREDENTIALS);localStorage.clear(),this.companyList=[],this.selectedCompany={},this.designation=null,this.accessToken="",this.user_type="",this.parentRoleId="",this.loginUserId="",this.isCompanyActive=!1,this.getDefaultConfigurations(),localStorage.removeItem(i.a.is_show_banner),localStorage.removeItem(i.a.is_show_ads),localStorage.removeItem(i.a.CONCIERGE_SERVICE_NAME),localStorage.setItem(i.a.LOCAL_STORAGE.USER_CREDENTIALS,o),this.titleService.setTitle("Login | "+(null===(n=null===(t=this.accessToken)||void 0===t?void 0:t.zone)||void 0===n?void 0:n.full_name)),$(document).off("mousemove keyup keypress"),this.cookieService.remove("onlineUser"),this.router.navigate([e])}else console.log("\ud83d\ude80 ~ CommonService ~ logOut ~ this._token.tokenKey:",this._token.tokenKey)}loadDefaultSelectAnimation(){$("select").each(function(){$(this).val()?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")})}loadDefaultInputAnimation(){$(".material_input").each(function(){$(this).val()&&0!==$(this).val().length?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")})}loadDefaultPasswordAnimation(){$(document).off("click",".fa-eye-slash, .fa-eye"),$(document).on("click",".fa-eye-slash, .fa-eye",function(e){e.preventDefault(),$(this).hasClass("fa-eye-slash")?$(this).removeClass("fa-eye-slash").addClass("fa-eye"):$(this).hasClass("fa-eye")&&$(this).removeClass("fa-eye").addClass("fa-eye-slash"),"password"===$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type")?$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type","text"):"text"===$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type")&&$(this).parent().parents(".form-group").children(".material_input_block").children(".form-control").attr("type","password")})}loadCommonJs(){$(document).on("focus keyup blur",".material_input_block .material_input",function(){$(this).val()&&0!==$(this).val().length?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")}),$(document).on("change","select",function(){$(this).val()?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")}),$(document).on("change",".datepicker input",function(){$(this).val()?$(this).parents(".form-group").addClass("input-active"):$(this).parents(".form-group").removeClass("input-active")}),$(document).on("focus",".material_input.material_textarea",function(){$(this).parent(".material_input_block").addClass("focused")}),$(document).on("blur",".material_input.material_textarea",function(){$(this).parent(".material_input_block").removeClass("focused")}),$(document).on("wheel","input[type=number]",function(e){$(this).blur()}),$(document).on("click",".search-toggle",function(e){e.preventDefault(),$(this).parent(".head-search").children(".search-input").is(":visible")?$(this).parent(".head-search").children(".search-input").hide():$(this).parent(".head-search").children(".search-input").show()}),$(document).on("focus",".form-control, input",function(){$(this).parent().addClass("input")}),$(document).on("blur",".form-control, input",function(){$(this).parent().removeClass("input")}),$(document).on("focus",".phone-number",function(){$(this).parent().parent().parent().addClass("input")}),$(document).on("blur",".phone-number",function(){$(this).parent().parent().parent().removeClass("input")}),$(document).on("focus",".otp-input",function(){$(this).addClass("input")}),$(document).on("blur",".otp-input",function(){$(this).removeClass("input")}),$(document).on("focus",".select2-search__field",function(){$(this).parents(".form-group").addClass("input-active")}),$(document).on("blur",".select2-search__field",function(){(!$(this).parents(".select2-label").find("select").val()||$(this).parents(".select2-label").find("select").val()&&0===$(this).parents(".select2-label").find("select").val().length)&&$(this).parents(".form-group").removeClass("input-active")}),$(document).off("click",".accordion-title"),$(document).on("click",".accordion-title",function(){return $(this).next().slideToggle(),$(this).toggleClass("active"),$(":input:not(:hidden)").each(function(e){$(this).attr("tabindex",e+1)}),!1})}getCompany(){this.isCompanySelected=!(!this.selectedCompany||!this.selectedCompany.id),this.isCompanyActive=!(!this.selectedCompany||![1,6,7,8].includes(parseInt(this.selectedCompany.status)));var e={jurisdiction_id:"1"===localStorage.getItem(i.a.LOCAL_STORAGE.IS_JURISDICTION)?localStorage.getItem(i.a.LOCAL_STORAGE.JURISDICTION_ID):1,user_id:!0,email:!0};this.companyService.getCompany(e).subscribe(e=>{var t,n,o;if(200===e.status){if(this.companyList=null===(t=e.data)||void 0===t?void 0:t.map(e=>Object.assign(Object.assign({},e),{company_name:$("