ng-implementation/angular18/dist/easy-angular/360.79ccdba96c0b194f.js
2025-10-15 11:17:29 +02:00

1 line
No EOL
2.9 KiB
JavaScript

"use strict";(self.webpackChunkEasyAngular=self.webpackChunkEasyAngular||[]).push([[360],{1360:(A,l,n)=>{n.r(l),n.d(l,{ValidateAccountComponent:()=>h});var i=n(467),c=n(177),r=n(9417),u=n(9664),m=n(2767),t=n(4438),d=n(4550),p=n(1315),v=n(6825);const f=s=>({"is-invalid":s});function E(s,g){1&s&&(t.j41(0,"div",11),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&s&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"FIELD_REQUIRED")," "))}let h=(()=>{class s{constructor(e,o,a,_){this.router=e,this.storeService=o,this.activatedRoute=a,this.appService=_,this.tokenFromUrl="",this.initFormGroup()}ngOnInit(){var e=this;return(0,i.A)(function*(){e.activatedRoute.queryParams.subscribe(o=>{e.tokenFromUrl=o.token,m.c.production||console.log("ValidateAccountComponent : ngOnInit -> Token : ",e.tokenFromUrl)})})()}initFormGroup(){this.formGroup=new r.gE({password:new r.MJ({value:"",disabled:!1},{validators:[r.k0.required],nonNullable:!0})})}onClickSubmit(){var e=this;return(0,i.A)(function*(){e.tokenFromUrl&&(yield e.validateNewAccount())})()}validateNewAccount(){var e=this;return(0,i.A)(function*(){e.storeService.isLoading.set(!0);const o=e.formGroup.controls.password.getRawValue(),a=yield e.appService.validateAccount(e.tokenFromUrl,o);e.storeService.isLoading.set(!1),a&&e.router.navigate(["/home"])})()}static#t=this.\u0275fac=function(o){return new(o||s)(t.rXU(d.Ix),t.rXU(p.n),t.rXU(d.nX),t.rXU(v.d))};static#e=this.\u0275cmp=t.VBU({type:s,selectors:[["app-validate-account"]],standalone:!0,features:[t.aNF],decls:17,vars:15,consts:[[1,"text-center","text-primary","mb-4"],[1,"h2","fw-normal","mb-0"],[1,"d-flex","justify-content-center"],[1,"wrapper"],[3,"ngSubmit","formGroup"],[1,"mb-3"],["for","password",1,"form-label","text-start","w-100"],["type","password","id","password","formControlName","password",1,"form-control",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],[1,"text-center"],["type","submit",1,"btn","btn-primary","px-5",3,"disabled"],[1,"invalid-feedback"]],template:function(o,a){1&o&&(t.j41(0,"div",0)(1,"div",1),t.EFF(2),t.nI1(3,"translate"),t.k0s()(),t.j41(4,"div",2)(5,"div",3)(6,"form",4),t.bIt("ngSubmit",function(){return a.onClickSubmit()}),t.j41(7,"div",5)(8,"label",6),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.nrm(11,"input",7),t.DNE(12,E,3,3,"div",8),t.k0s(),t.j41(13,"div",9)(14,"button",10),t.EFF(15),t.nI1(16,"translate"),t.k0s()()()()()),2&o&&(t.R7$(2),t.JRh(t.bMT(3,7,"VALIDATE_ACCOUNT")),t.R7$(4),t.Y8G("formGroup",a.formGroup),t.R7$(3),t.JRh(t.bMT(10,9,"PASSWORD")),t.R7$(2),t.Y8G("ngClass",t.eq3(13,f,a.formGroup.controls.password.errors&&a.formGroup.controls.password.touched)),t.R7$(),t.Y8G("ngIf",a.formGroup.controls.password.hasError("required")),t.R7$(2),t.Y8G("disabled",!a.formGroup.valid),t.R7$(),t.SpI(" ",t.bMT(16,11,"VALIDATE")," "))},dependencies:[r.YN,r.qT,r.me,r.BC,r.cb,r.X1,r.j4,r.JD,c.YU,c.bT,u.h,u.D9],styles:[".wrapper[_ngcontent-%COMP%]{max-width:350px;width:100%}"]})}return s})()}}]);