(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8706],{48706:(R,v,s)=>{s.r(v),s.d(v,{DeepPageModule:()=>M});var h=s(61380),P=s(69270),E=s(15861),t=s(45449),a=s(47898),C=s(90944),c=s(90603),m=s(99826);function O(n,p){1&n&&(t.\u0275\u0275elementStart(0,"div",12)(1,"div",13),t.\u0275\u0275text(2),t.\u0275\u0275pipe(3,"translate"),t.\u0275\u0275elementEnd()()),2&n&&(t.\u0275\u0275advance(2),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(3,1,"PG_DEEP_TEXT_EMPY_INVITES")))}function f(n,p){if(1&n){const o=t.\u0275\u0275getCurrentView();t.\u0275\u0275elementStart(0,"div",14)(1,"div",15)(2,"div",16)(3,"div",17),t.\u0275\u0275text(4),t.\u0275\u0275pipe(5,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(6,"div",18),t.\u0275\u0275text(7),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(8,"div",19)(9,"button",20),t.\u0275\u0275listener("click",function(){t.\u0275\u0275restoreView(o);const g=t.\u0275\u0275nextContext();return t.\u0275\u0275resetView(g.rejectInvite())}),t.\u0275\u0275text(10),t.\u0275\u0275pipe(11,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(12,"button",20),t.\u0275\u0275listener("click",function(){t.\u0275\u0275restoreView(o);const g=t.\u0275\u0275nextContext();return t.\u0275\u0275resetView(g.acceptInvite())}),t.\u0275\u0275text(13),t.\u0275\u0275pipe(14,"translate"),t.\u0275\u0275elementEnd()()()()}if(2&n){const o=t.\u0275\u0275nextContext();t.\u0275\u0275property("className","pendency"),t.\u0275\u0275advance(4),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(5,5,"PG_DEEP_TEXT_COMPANY_INVITE")),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(o.invite.company.name),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate1(" ",t.\u0275\u0275pipeBind1(11,7,"PG_DEEP_BTN_REFUSE")," "),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate1(" ",t.\u0275\u0275pipeBind1(14,9,"PG_DEEP_BTN_ACCEPT")," ")}}const u=[{path:"",component:(()=>{class n{constructor(o,l,g,d,I,S,T,x,y){var i=this;this.activatedRoute=o,this.apiService=l,this.loadingService=g,this.notificatorService=d,this.authService=I,this.navigationService=S,this.logService=T,this.translateConfigService=x,this.showToastModalErroCodeZero=y,this.notifyAboutBrokenLink=()=>{const e={title:this.translateConfigService.translate("PG_DEEP_TOAST_INVALID_LINK_TITLE"),message:this.translateConfigService.translate("PG_DEEP_TOAST_INVALID_LINK_MESSAGE"),type:"error",timeout:5e3};this.notificatorService.notify(e),this.goToHome()},this.validateLink=()=>{this.loadingService.show(this.translateConfigService.translate("PG_DEEP_LOADING_INVITE_VALIDATING"),"invite-validation");let e="";this.authService.getToken().then(r=>(e=r,this.authService.getForeigner())).then(r=>{this.apiService.validateInvite(this.locator,this.invitationKey,e,!!r).subscribe(this.processValidateInviteSuccessResponse,this.processValidateInviteErrorResponse)})},this.processValidateInviteSuccessResponse=e=>{this.loadingService.hide(null,"invite-validation").then(this.getInvite)},this.processValidateInviteErrorResponse=e=>{console.log("processValidateInviteErrorResponse"),console.log("response:",JSON.stringify(e)),this.silentlyRejectInvite(),this.loadingService.hide(null,"invite-validation").then(()=>{if(e&&e?.status){if(0===e?.status)return this.showToastModalErroCodeZero.showToast(),void this.logService.logError("http::processValidateInviteErrorResponse","Unknown error",e);if(400===e.status&&e.error&&"error.invitenotvalid"===e.error.message)return this.toastInvalidInvite();if(400===e.status&&e.error&&"error.accountnotfound"===e.error.message){const r={title:this.translateConfigService.translate("PG_DEEP_TOAST_ACCOUNT_NOTFOUND_TITLE"),message:this.translateConfigService.translate("PG_DEEP_TOAST_ACCOUNT_NOTFOUND_MESSAGE"),type:"error",timeout:5e3};return this.notificatorService.notify(r)}if(400===e.status&&e.error&&"error.invitenotmatched"===e.error.message){const r={title:this.translateConfigService.translate("PG_DEEP_TOAST_NO_MATCHED_INVITE_TITLE"),message:this.translateConfigService.translate("PG_DEEP_TOAST_NO_MATCHED_INVITE_MESSAGE"),type:"error",timeout:5e3};return this.notificatorService.notify(r)}return this.logService.logError("http::processValidateInviteErrorResponse:error.invitenotmatched","",e),this.toastNotificationError(e.status)}this.logService.logError("http::processValidateInviteErrorResponse","",e),this.toastNotificationError("NKNwN"),this.goToHome()})},this.getInvite=()=>{this.authService.getToken().then(e=>{this.apiService.getInvite(this.locator,this.invitationKey,e).subscribe(this.processGetInviteSuccessResponse,this.processGetInviteErrorResponse)})},this.processGetInviteSuccessResponse=e=>{console.log("processGetInviteSuccessResponse"),console.log("response:",e),this.invite=e},this.processGetInviteErrorResponse=e=>{if(console.log("processGetInviteErrorResponse"),console.log("response:",e),0===e?.status)return this.showToastModalErroCodeZero.showToast(),void this.logService.logError("http::processGetInviteErrorResponse","Unknown error",e);if(e&&e?.status)if(404===e.status){const r={title:this.translateConfigService.translate("PG_DEEP_TOAST_INVITE_NOTFOUND_TITLE"),message:this.translateConfigService.translate("PG_DEEP_TOAST_INVITE_NOTFOUND_MESSAGE"),type:"error",timeout:5e3};this.notificatorService.notify(r)}else this.logService.logError("http::processGetInviteErrorResponse","",e),this.toastNotificationError(e.status);else this.logService.logError("http::processGetInviteErrorResponse","",e),this.toastNotificationError("NKNwN");this.goToHome()},this.acceptInvite=()=>{this.loadingService.show(this.translateConfigService.translate("PG_DEEP_LOADING_INVITE_ACCEPTING"),"accept-invite"),this.authService.getToken().then(e=>{this.apiService.acceptInvite(this.locator,this.invitationKey,this.origin,e).subscribe(this.processAcceptInviteSuccessResponse,this.processAcceptInviteErrorResponse)})},this.processAcceptInviteSuccessResponse=e=>{console.log("processAcceptInviteSuccessResponse"),console.log("response:",e),this.loadingService.hide(null,"accept-invite").then(()=>{this.goToHome()})},this.processAcceptInviteErrorResponse=e=>{console.log("processAcceptInviteErrorResponse"),console.log("response:",e),this.loadingService.hide(null,"accept-invite").then((0,E.Z)(function*(){if(0===e.status)return i.showToastModalErroCodeZero.showToast(),void i.logService.logError("http::processAcceptInviteErrorResponse","Unknown error",e);if(e&&e?.status)if(400===e.status&&e.error&&"error.invitenotvalid"===e.error.message)i.toastInvalidInvite();else if("error.nomatchforeignflag"===e.error.message){i.logService.logError("http::accountActivateErrorResponseNoMatch","",e);const r={title:i.translateConfigService.translate("PG_DEEP_TOAST_NO_MATCH_FOREIGN_FLAG_TITLE"),message:i.translateConfigService.translate("PG_DEEP_TOAST_NO_MATCH_FOREIGN_FLAG_MESSAGE"),type:"error",timeout:5e3};i.notificatorService.notify(r)}else if(400===e.status&&e.error&&"error.invitenotmatched"===e.error.message){const r=yield i.authService.getForeigner(),_=i.translateConfigService.translate("PG_DEEP_TOAST_INVALID_NAME_MESSAGE_TEXT_FOREIGN"),N=`${i.translateConfigService.translate("PG_DEEP_TOAST_INVALID_NAME_MESSAGE")} ${r?_:"CPF"}.`,A={title:i.translateConfigService.translate("PG_DEEP_TOAST_INVALID_NAME_TITLE"),message:N,type:"error",timeout:12e3};i.notificatorService.notify(A)}else i.logService.logError("http::processAcceptInviteErrorResponse","",e),i.toastNotificationError(e.status);else i.logService.logError("http::processAcceptInviteErrorResponse","",e),i.toastNotificationError("NKNwN");i.goToHome()}))},this.silentlyRejectInvite=()=>{this.authService.getToken().then(e=>{this.apiService.rejectInvite(this.locator,this.invitationKey,this.origin,e).subscribe(()=>{},()=>{})})},this.rejectInvite=()=>{this.loadingService.show(this.translateConfigService.translate("PG_DEEP_LOADING_INVITE_REJECTING"),"reject-invite"),this.authService.getToken().then(e=>{this.apiService.rejectInvite(this.locator,this.invitationKey,this.origin,e).subscribe(this.processRejectInviteSuccessResponse,this.processRejectInviteErrorResponse)})},this.processRejectInviteSuccessResponse=e=>{console.log("processRejectInviteSuccessResponse"),console.log("response:",e),this.loadingService.hide(null,"reject-invite").then(()=>{const r={title:this.translateConfigService.translate("PG_DEEP_TOAST_INVITE_REJECT_TITLE"),message:this.translateConfigService.translate("PG_DEEP_TOAST_INVITE_REJECT_MESSAGE"),type:"success",timeout:5e3};this.notificatorService.notify(r),this.goToHome()})},this.processRejectInviteErrorResponse=e=>{console.log("processRejectInviteErrorResponse"),console.log("response:",e),this.loadingService.hide(null,"reject-invite").then(()=>{if(0===e?.status)return this.showToastModalErroCodeZero.showToast(),void this.logService.logError("http::processRejectInviteErrorResponse","Unknown error",e);e&&e?.status?400===e.status&&e.error&&"error.inviterejecterror"===e.error.message?this.toastInvalidInvite():(this.logService.logError("http::processRejectInviteErrorResponse::error.inviterejecterror","",e),this.toastNotificationError(e.status)):(this.logService.logError("http::processRejectInviteErrorResponse","",e),this.toastNotificationError("NKNwN")),this.goToHome()})},this.goToHome=()=>{this.navigationService.root(["/home"])},this.activatedRoute.queryParams.subscribe(e=>{this.locator=e.l?e.l:null,this.invitationKey=e.k?e.k:null,this.origin=e.origin,this.locator&&this.invitationKey?this.validateLink():this.notifyAboutBrokenLink()})}ngOnInit(){console.log("origin:",this.origin)}toastInvalidInvite(){const o={title:this.translateConfigService.translate("PG_DEEP_TOAST_INVALID_INVITE_TITLE"),message:this.translateConfigService.translate("PG_DEEP_TOAST_INVALID_INVITE_MESSAGE"),type:"error",timeout:5e3};this.notificatorService.notify(o)}toastNotificationError(o){const l=this.translateConfigService.translate("PG_DEEP_TOAST_SERVICE_ERROR_TITLE"),g=`${this.translateConfigService.translate("TOAST_SERVICE_TEMPORARILY_UNAVAILABLE_MESSAGE")} (cod. ${o})`;this.notificatorService.notify({title:l,message:g,type:"error",timeout:5e3})}}return n.\u0275fac=function(o){return new(o||n)(t.\u0275\u0275directiveInject(h.ActivatedRoute),t.\u0275\u0275directiveInject(a.sM),t.\u0275\u0275directiveInject(a.bz),t.\u0275\u0275directiveInject(a.V6),t.\u0275\u0275directiveInject(a.e8),t.\u0275\u0275directiveInject(a.f5),t.\u0275\u0275directiveInject(a.$V),t.\u0275\u0275directiveInject(a.wK),t.\u0275\u0275directiveInject(a.ME))},n.\u0275cmp=t.\u0275\u0275defineComponent({type:n,selectors:[["app-deep"]],decls:21,vars:8,consts:[["mode","ios"],["slot","start","margin-start","1"],["src","../../assets/toolbar-logo.png"],["slot","end","margin-end","1"],["auto-hide","false"],["slot","icon-only","mode","ios","name","menu"],[1,"page-title"],[1,"title"],[1,"sub-title"],[1,"pendencies"],["class","empty",4,"ngIf"],[3,"className",4,"ngIf"],[1,"empty"],[1,"text"],[3,"className"],[1,"bottom"],[1,"checkin-done-at"],[1,"label"],[1,"value"],[1,"actions"],["type","button",3,"click"]],template:function(o,l){1&o&&(t.\u0275\u0275elementStart(0,"ion-header",0)(1,"ion-toolbar",0)(2,"ion-buttons",1),t.\u0275\u0275element(3,"ion-img",2),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(4,"ion-title"),t.\u0275\u0275text(5," KeyAccesss "),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(6,"ion-buttons",3)(7,"ion-menu-toggle",4)(8,"ion-button"),t.\u0275\u0275element(9,"ion-icon",5),t.\u0275\u0275elementEnd()()()()(),t.\u0275\u0275elementStart(10,"ion-content")(11,"div",6)(12,"div",7),t.\u0275\u0275text(13),t.\u0275\u0275pipe(14,"translate"),t.\u0275\u0275elementEnd(),t.\u0275\u0275elementStart(15,"div",8),t.\u0275\u0275text(16),t.\u0275\u0275pipe(17,"translate"),t.\u0275\u0275elementEnd()(),t.\u0275\u0275elementStart(18,"div",9),t.\u0275\u0275template(19,O,4,3,"div",10),t.\u0275\u0275template(20,f,15,11,"div",11),t.\u0275\u0275elementEnd()()),2&o&&(t.\u0275\u0275advance(13),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(14,4,"PG_DEEP_TEXT_TITLE")),t.\u0275\u0275advance(3),t.\u0275\u0275textInterpolate(t.\u0275\u0275pipeBind1(17,6,"PG_DEEP_TEXT_SUBTITLE")),t.\u0275\u0275advance(3),t.\u0275\u0275property("ngIf",!l.invite),t.\u0275\u0275advance(1),t.\u0275\u0275property("ngIf",l.invite))},dependencies:[C.NgIf,c.IonButton,c.IonButtons,c.IonContent,c.IonHeader,c.IonIcon,c.IonImg,c.IonMenuToggle,c.IonTitle,c.IonToolbar,m.X$],styles:["ion-toolbar[_ngcontent-%COMP%]{font-family:Nunito,sans-serif;--background: #fff;padding-inline:16px}ion-toolbar[_ngcontent-%COMP%] ion-img[_ngcontent-%COMP%]{height:25px;width:25px}ion-toolbar[_ngcontent-%COMP%] ion-title[_ngcontent-%COMP%]{letter-spacing:1px}ion-toolbar[_ngcontent-%COMP%] ion-button[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:24px;padding:0;width:24px;margin:0;font-size:19px;color:#656768}ion-toolbar[_ngcontent-%COMP%] ion-button.hover[_ngcontent-%COMP%]{background:#fff}.page-title[_ngcontent-%COMP%]{width:85%;margin:24px auto 32px}.page-title[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:initial!important;font-weight:700;text-align:center}.page-title[_ngcontent-%COMP%] .sub-title[_ngcontent-%COMP%]{text-align:center;color:#656768;font-size:.9em;margin-top:4px}.pendencies[_ngcontent-%COMP%] .empty[_ngcontent-%COMP%], .pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:3em;color:#656768;font-size:.9em}.pendencies[_ngcontent-%COMP%] .empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%], .pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.pendencies[_ngcontent-%COMP%] .empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%], .pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;margin-top:1em}.pendencies[_ngcontent-%COMP%] .empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;border:1px solid #eee;padding:.25em .75em;border-radius:32px;margin-right:8px}.pendencies[_ngcontent-%COMP%] .empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%], .pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{margin-left:4px;color:#0ec254;margin-top:2px}.pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:1em;color:#656768;font-size:.9em;margin-bottom:2em}.pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{text-align:center}.pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;margin-top:0}.pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;border:1px solid #eee;padding:.25em .75em;border-radius:32px;margin-right:8px}.pendencies[_ngcontent-%COMP%] .not-empty[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] .pull-to-reload-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{margin-left:4px;color:#0ec254;margin-top:2px}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%]{border:1px solid #eee;box-shadow:2px 2px 8px rgba(67,60,98,.1);border-radius:8px;width:90%;margin:12px auto}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%]{display:flex;padding:16px;border-bottom:1px solid #eee}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .initials[_ngcontent-%COMP%]{height:38px;width:38px;border-radius:38px;text-align:center;display:flex;justify-content:center;align-items:center;background-color:#eee}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .initials[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{font-size:.9em}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .user-event-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .user-event-data[_ngcontent-%COMP%] .full-name[_ngcontent-%COMP%]{display:flex;align-items:center;margin-left:12px;font-size:.9em}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .user-event-data[_ngcontent-%COMP%] .full-name[_ngcontent-%COMP%] .last-name[_ngcontent-%COMP%]{margin-left:4px}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .top[_ngcontent-%COMP%] .user-event-data[_ngcontent-%COMP%] .event[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{margin-left:12px;font-size:.9em!important}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%]{display:flex;padding:16px;flex-direction:column}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .checkin-done-at[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:100%}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .checkin-done-at[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-size:.8em;color:#656768}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:24px}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{font-size:1em;color:#0ec254;background-color:#fff;padding:.5em 1.25em;border-radius:32px;border:1px solid #0ec254;transition:background-color .1s ease-out}.pendencies[_ngcontent-%COMP%] .pendency[_ngcontent-%COMP%] .bottom[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active{background-color:#0ec254;color:#fff;transition:background-color .1s ease-out}"]}),n})()}];let M=(()=>{class n{}return n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=t.\u0275\u0275defineNgModule({type:n}),n.\u0275inj=t.\u0275\u0275defineInjector({imports:[P.I,h.RouterModule.forChild(u)]}),n})()}}]);