Files
kapp/2170.0677f886e65d7b9c.js
T
2026-05-21 11:19:10 -03:00

1 line
13 KiB
JavaScript

(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2170],{82170:(C,I,s)=>{s.r(I),s.d(I,{IdentityInsertPasswordConfirmationPageModule:()=>N});var y=s(90944),d=s(24006),P=s(61380),p=s(90603),u=s(69270),v=s(15861),e=s(45449),a=s(47898),_=s(45944),O=s(33159),R=s(99826);const b=["pin"],E=function(g){return{"min-height":g,position:"relative"}},T=[{path:"",component:(()=>{class g{constructor(n,o,c,S,m,M,F,A,D,w,x,k,j,G,K,H,V,Y){var i=this;this.formBuilder=n,this.platform=o,this.notificatorService=c,this.activatedRoute=S,this.loadingService=m,this.keyboardService=M,this.cryptoService=F,this.storageService=A,this.authService=D,this.deviceInfoService=w,this.navigationService=x,this.lockService=k,this.logService=j,this.translateConfigService=G,this.saveFlowStorageResetKeyService=K,this.apiService=H,this.managertokenUaamobileService=V,this.initRegisterHasCompanyStorageService=Y,this.focusInput=()=>{this.pinInputElement.nativeElement.focus()},this.onPinChange=()=>{this.lockService.isLock("updating-pin-value")||(this.shouldSubmit()?setTimeout(this.onSubmit,250):this.lockService.unlock("updating-pin-value"))},this.shouldSubmit=()=>4===this.pinForm.controls.pin.value.length,this.resetPin=()=>{this.pinForm.controls.pin.setValue("")},this.onSubmit=()=>{const r=this.pinForm.controls.pin.value;if(this.validateInput(r)){let t=null;const h=()=>{t&&t.unsubscribe(),this.loadingService.show(this.translateConfigService.translate("LOADING_PROCESSING_DATA"),"on-set-password"),this.cryptoService.digest(r).then(this.onCryptoDigestSuccessResponse,this.onCryptoDigestErrorResponse)};t=this.keyboardService.onHideObservable?.subscribe(h),this.keyboardService.isVisible()?this.keyboardService.hide():h()}else{this.keyboardService.hide(),this.resetPin(),this.lockService.unlock("updating-pin-value");const t=this.translateConfigService.translate("PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_TOAST_INVALID_DATA_TITLE"),h=this.translateConfigService.translate("PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_TOAST_INVALID_DATA_MESSAGE");this.notificatorService.notify({title:t,message:h,type:"error"})}},this.validateInput=r=>r&&"string"==typeof r&&4===r.length&&r===this.confirmationPin,this.onCryptoDigestSuccessResponse=r=>{console.log("onCryptoDigestSuccessResponse"),this.resetPin(),this.lockService.unlock("updating-pin-value");const l=this.initRegisterHasCompanyStorageService.get();this.loadingService.hide(null,"on-set-password").then(()=>this.authService.register()).then(()=>this.authService.updateLastAccessAt()).then(()=>this.storageService.set("e2872ebbbf66ce5458a11804be66f215ef42d4ce",r)).then(()=>this.authService.setDocument(this.document||l?.document)).then(()=>this.authService.setForeigner(this.foreign||l?.foreign)).then(()=>this.authService.setAuthenticated()).then(()=>this.authService.setLogOff(!1)).then(()=>{}).catch(this.onCryptoDigestErrorResponse).finally((0,v.Z)(function*(){const t=yield i.saveFlowStorageResetKeyService.getDataResetKeyInit();yield i.managertokenUaamobileService.initStartGetTokenUaaMobile(),i.loadingService.show(i.translateConfigService.translate("LOADING_AUTHENTICATING"),"auth");try{if(t&&t?.obfuscatedEmail&&r){t.newHashedPin=r;const h={queryParams:{document:t.document,obfuscatedEmail:t.obfuscatedEmail,email:t.email,firstName:t.firstName,refId:t.refId,context:"forgot-pin",foreign:i.foreign}};yield i.saveFlowStorageResetKeyService.setDataResetKeyInit(t),i.initRegisterHasCompanyStorageService.set({document:t.document??l?.document,obfuscatedEmail:t.obfuscatedEmail,email:t.email,firstName:t.firstName,refId:t.refId,context:"forgot-pin",foreign:i.foreign}),i.navigationService.forward(["/identity-validator-code"],h)}else{const h={queryParams:{notResetSession:!0}};i.initRegisterHasCompanyStorageService.remove(),i.navigationService.root(["/home"],h)}}catch(h){i.logService.logError("http::getToken:IdentityAppFlow","",h)}finally{i.loadingService.hide(null,"auth")}}))},this.onCryptoDigestErrorResponse=r=>{console.log("onCryptoDigestErrorResponse"),console.log(r),this.logService.logError("user::onCryptoDigestErrorResponse","",r),this.loadingService.hide(null,"on-set-password").then(()=>{this.resetPin(),this.lockService.unlock("updating-pin-value");const l=this.translateConfigService.translate("PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_TOAST_ERROR_TITLE"),t=this.translateConfigService.translate("PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_TOAST_ERROR_MESSAGE");this.notificatorService.notify({title:l,message:t,type:"error"})})},this.goOneStepBack=()=>{this.navigationService.back(["/identity-insert-password"],{queryParams:{uuid:this.uuid,document:this.document}})},this.activatedRoute.queryParams.subscribe(function(){var r=(0,v.Z)(function*(l){let t=null;(yield i.storageService.ready())&&(t=yield i.authService.getUUID()),i.uuid=t||(l.uuid?l.uuid:""),i.confirmationPin=l.pin?l.pin:"",i.document=l.document?l.document:"",i.foreign="true"===l.foreign});return function(l){return r.apply(this,arguments)}}())}ngOnInit(){this.pinForm=this.formBuilder.group({pin:[""]})}ionViewDidEnter(){setTimeout(()=>{this.focusInput(),this.platform.is("android")&&this.keyboardService.show()},250)}resetPinForget(n,o){var c=this;return(0,v.Z)(function*(){let S=null;try{yield c.apiService.resetPinFinish({newHashedPin:n,resetKey:o}).toPromise(),c.navigationService.root(["/home"])}catch(m){S=m,c.handleErrorResetPinFinish(m),c.logService.log("httpError::resetPinFinsh","Error request http /pins/reset-finish",m)}finally{S||c.saveFlowStorageResetKeyService.clearAllDataResetKeyInit()}})()}handleErrorResetPinFinish(n){if(n?.error){this.translateConfigService.translate("TOAST_TITLE_ERROR");const c=this.translateConfigService.translate("PG_IDENTIFY_INSERT_CODE_INVALID");if("reset_key_not_found"===n.error.errorKey){const S={title:c,message:"",type:"error",timeout:1e4,action:{label:"Voltar!",customAction:this.onbackFix.bind(this)}};this.notificatorService.notify(S),this.logService.log("httpError::resetPinFinsh","reset_key_not_found",n)}else this.logService.log("httpError::resetPinFinsh","",n)}}onbackFix(){var n=this;return(0,v.Z)(function*(){const o=yield n.saveFlowStorageResetKeyService.getDataResetKeyInit();n.navigationService.back(["/identity-validator-code"],{queryParams:{uuid:n.uuid,document:o.document,context:"forgot-pin",foreign:!0,obfuscatedEmail:o.obfuscatedEmail,firstName:o.firstName}}),yield n.saveFlowStorageResetKeyService.setDataResetKeyInit(o)})()}}return g.\u0275fac=function(n){return new(n||g)(e.\u0275\u0275directiveInject(d.UntypedFormBuilder),e.\u0275\u0275directiveInject(p.Platform),e.\u0275\u0275directiveInject(a.V6),e.\u0275\u0275directiveInject(P.ActivatedRoute),e.\u0275\u0275directiveInject(a.bz),e.\u0275\u0275directiveInject(a.i8),e.\u0275\u0275directiveInject(a.$I),e.\u0275\u0275directiveInject(a.V1),e.\u0275\u0275directiveInject(a.e8),e.\u0275\u0275directiveInject(a.Hc),e.\u0275\u0275directiveInject(a.f5),e.\u0275\u0275directiveInject(a.We),e.\u0275\u0275directiveInject(a.$V),e.\u0275\u0275directiveInject(a.wK),e.\u0275\u0275directiveInject(a.RQ),e.\u0275\u0275directiveInject(a.sM),e.\u0275\u0275directiveInject(a.FB),e.\u0275\u0275directiveInject(_.K))},g.\u0275cmp=e.\u0275\u0275defineComponent({type:g,selectors:[["app-identity-insert-password-confirmation"]],viewQuery:function(n,o){if(1&n&&e.\u0275\u0275viewQuery(b,5),2&n){let c;e.\u0275\u0275queryRefresh(c=e.\u0275\u0275loadQuery())&&(o.pinInputElement=c.first)}},decls:22,vars:16,consts:[[1,"ion-no-border",2,"height","0"],[3,"ngStyle"],[1,"ion-margin-vertical"],[1,"flex-auto"],[1,"input-holder"],["for","pin","tabindex","0"],[3,"formGroup","ngSubmit"],["id","pin","type","password","formControlName","pin","maxlength","4","pattern","[0-9]*","inputmode","numeric",3,"placeholder","input"],["pin",""],[1,"button-holder"],["type","button",1,"back",3,"click"]],template:function(n,o){1&n&&(e.\u0275\u0275element(0,"ion-header",0),e.\u0275\u0275elementStart(1,"ion-content")(2,"ion-grid",1)(3,"ion-row")(4,"ion-col",2),e.\u0275\u0275element(5,"app-full-logo"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(6,"ion-row",3)(7,"ion-col",2)(8,"form")(9,"div",4)(10,"label",5),e.\u0275\u0275pipe(11,"translate"),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"form",6),e.\u0275\u0275listener("ngSubmit",function(){return o.onSubmit()}),e.\u0275\u0275elementStart(15,"input",7,8),e.\u0275\u0275listener("input",function(){return o.onPinChange()}),e.\u0275\u0275pipe(17,"translate"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(18,"div",9)(19,"button",10),e.\u0275\u0275listener("click",function(){return o.goOneStepBack()}),e.\u0275\u0275text(20),e.\u0275\u0275pipe(21,"translate"),e.\u0275\u0275elementEnd()()()()()()()),2&n&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(14,E,o.deviceInfoService.getDeviceHeight()+"px")),e.\u0275\u0275advance(8),e.\u0275\u0275attribute("aria-label",e.\u0275\u0275pipeBind1(11,6,"PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_TEXT")),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,8,"PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_TEXT")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("formGroup",o.pinForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(17,10,"PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_INPUT")),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(21,12,"PG_IDENTIFY_INSERT_PASSWORD_CONFIRMATION_BTN_CHANGE_PASS")," "))},dependencies:[y.NgStyle,p.IonCol,p.IonContent,p.IonGrid,p.IonHeader,p.IonRow,d.\u0275NgNoValidate,d.DefaultValueAccessor,d.NgControlStatus,d.NgControlStatusGroup,d.MaxLengthValidator,d.PatternValidator,d.FormGroupDirective,d.FormControlName,d.NgForm,O.R,R.X$],styles:[".input-holder[_ngcontent-%COMP%]{text-align:center;width:95%}.input-holder[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{height:0;width:0;padding:0;border:none}.input-holder[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{text-align:center}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%]{display:flex;justify-content:space-evenly;margin-top:36px}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%]{position:relative;width:70px;height:70px}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] .bullet[_ngcontent-%COMP%]{position:absolute;top:35px;left:35px;height:0;width:0;background-color:#fff;border-radius:70px;box-shadow:0 0 rgba(0,0,0,0);transition:top .25s ease,left .25s ease,height .25s ease,width .25s ease,box-shadow .25s ease}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] .bullet.valid[_ngcontent-%COMP%]{top:17px;left:17px;height:35px;width:35px;box-shadow:0 0 8px rgba(0,0,0,.3);transition:top .25s ease,left .25s ease,height .25s ease,width .25s ease,box-shadow .25s ease}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input[_ngcontent-%COMP%]{margin-top:0;width:70px;height:70px;border-radius:70px;padding:0;text-align:center;line-height:36px;font-size:1.75em;background-color:#eee;transition:background-color .25s ease;box-shadow:inset 0 0 8px rgba(122,122,122,.1);border:none;color:transparent;caret-color:transparent}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input[_ngcontent-%COMP%]:focus{outline:none}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input.current[_ngcontent-%COMP%]{animation-name:current-input;animation-duration:1.25s;animation-iteration-count:infinite}@keyframes current-input{0%{background-color:#eee}50%{background-color:#ccc}to{background-color:#eee}}.input-holder[_ngcontent-%COMP%] .lonely-inputs[_ngcontent-%COMP%] .lonely-input-holder[_ngcontent-%COMP%] input.lonely-input.valid[_ngcontent-%COMP%]{background-color:#0ec254;transition:background-color .25s ease}.button-holder[_ngcontent-%COMP%]{margin-top:48px;justify-content:center}"]}),g})()}];let N=(()=>{class g{}return g.\u0275fac=function(n){return new(n||g)},g.\u0275mod=e.\u0275\u0275defineNgModule({type:g}),g.\u0275inj=e.\u0275\u0275defineInjector({imports:[u.I,y.CommonModule,d.ReactiveFormsModule,d.FormsModule,p.IonicModule,P.RouterModule.forChild(T)]}),g})()},45944:(C,I,s)=>{s.d(I,{K:()=>p});var y=s(15861),d=s(45449);let P=(()=>{class u{constructor(){}set(e,a){localStorage.setItem(e,JSON.stringify(a))}get(e){return JSON.parse(localStorage.getItem(e))??null}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}}return u.\u0275fac=function(e){return new(e||u)},u.\u0275prov=d.\u0275\u0275defineInjectable({token:u,factory:u.\u0275fac,providedIn:"root"}),u})(),p=(()=>{class u{constructor(e){this.simpleStorageService=e,this.KEY="REGISTER_HAS_COMPANY",this.cache=null}set(e){this.simpleStorageService.set(this.KEY,e),this.cache=e}get(){const e=this.simpleStorageService.get(this.KEY);return this.cache=e,e}remove(){var e=this;return(0,y.Z)(function*(){e.simpleStorageService.remove(e.KEY),e.cache=null})()}}return u.\u0275fac=function(e){return new(e||u)(d.\u0275\u0275inject(P))},u.\u0275prov=d.\u0275\u0275defineInjectable({token:u,factory:u.\u0275fac,providedIn:"root"}),u})()}}]);