PageSourceSearch

https://mydreamteam.ai/chunk-DoOVUVcA.js

js mydreamteam.ai collected 2026-10-05 12:16:41 UTC 10,243 bytes, 1 lines download raw bytes

1import"./chunk-DcxQp08X.js";import{An as dl,At as TE,Er as mD,Ft as Ue,I as Gw,Ir as ow,Qr as td,Wn as fw,an as _E,bt as Qh,j as FI,jr as nd,mi as wh,pt as Nh,ur as ji,v as Dh,x as E,xi as zD,xn as ce,yt as QD}from"./chunk-DlP8Xg9n.js";import{b as rn}from"./chunk-Blt3Logn.js";import{D as Mr,Q as We,Wt as xy,Yt as ze,Z as W0,qt as z0}from"./chunk-DEIs0iw7.js";import{I as Vs,S as Jr,ct as ho,lt as io,pt as kt,w as Kr,z as Xr}from"./chunk-C_Zbz4Gf.js";import{a as ye$1,i as oe}from"./chunk-GuZRUyDF.js";import{l as nn}from"./chunk-RnRAlTNd.js";import{F as Pt,G as Yi,I as Rl,W as Wl,_t as pr,d as Ct,f as Dl,j as Nr,k as Ls,lt as lo,m as Ge,s as Bi,z as Ul}from"./main-DWD2LOUC.js";import{a as Mr$1,c as Pn,h as zn,i as Ln,l as Vn,m as ze$1,o as Nr$1,r as Kn,s as On,t as Er,u as _}from"./chunk-ckhKV91m.js";function he(t,h){t&1&&(ji(0,`div`,0),wh(1,`p-progress-spinner`,2),dl())}function fe(t,h){if(t&1&&(ji(0,`div`,7),wh(1,`i`,11),ji(2,`span`,12),Gw(3),dl()()),t&2){let e=fw(2);FI(3),Qh(e.errorMessage())}}function we(t,h){t&1&&(ji(0,`div`,8),wh(1,`i`,13),ji(2,`span`,14),Gw(3,`Your password is now set!`),dl()())}function be(t,h){if(t&1){let e=ow();ji(0,`button`,24),Nh(`click`,function(){td(e);return nd(fw(3).onSubmit())}),wh(1,`i`,25),Gw(2,` Update Password`),dl()}}function ve(t,h){t&1&&wh(0,`p-progress-spinner`,23)}function Se(t,h){if(t&1&&(ji(0,`div`,9)(1,`div`,15)(2,`p-floatlabel`,16)(3,`label`,17),Gw(4,`New Password`),dl(),ji(5,`app-form-field`),wh(6,`input`,18),TE(),dl()()(),ji(7,`div`,15)(8,`p-floatlabel`,16)(9,`label`,19),Gw(10,`Repeat Password`),dl(),ji(11,`app-form-field`),wh(12,`input`,20),TE(),dl()()(),ji(13,`div`,21),zD(14,be,3,0,`button`,22),zD(15,ve,1,0,`p-progress-spinner`,23),dl()()),t&2){let e=fw(2);FI(6),Dh(`formField`,e.resetPasswordForm.password),_E(),FI(6),Dh(`formField`,e.resetPasswordForm.password2),_E(),FI(2),QD(e.processingRequest()?-1:14),FI(),QD(e.processingRequest()?15:-1)}}function ye(t,h){if(t&1&&(ji(0,`div`,1)(1,`div`,3)(2,`div`,4)(3,`div`,5),Gw(4,`Reset Your Password`),dl(),ji(5,`span`,6),Gw(6,`Please set a new password for your account`),dl()(),zD(7,fe,4,1,`div`,7),zD(8,we,4,0,`div`,8),zD(9,Se,16,4,`div`,9),dl(),wh(10,`div`,10),dl()),t&2){let e=fw();FI(7),QD(e.errorFlag()?7:-1),FI(),QD(e.processedFlag()?8:-1),FI(),QD(e.resetPasswordForm()?9:-1)}}var et=(()=>{class t{constructor(){this.userHashId=null,this.tempHashId=null,this.errorMessage=Ue(``),this.errorFlag=Ue(!1),this.processedFlag=Ue(!1),this.processingRequest=Ue(!1),this.isLoading=Ue(!0),this.resetPasswordModel=Ue(ho),this.logger=E(Pt),this.authService=E(Bi),this.authStore=E(Vs),this.communityService=E(Yi),this.databaseService=E(kt),this.securityService=E(Ul),this.general=E(nn),this.router=E(We),this.route=E(ze),this.notification=E(Wl),this.userStoreService=E(Ge),this.cookie=E(Ct),this.destroyRef=E(ce),this.resetPasswordFormSchema=Er(e=>{Pn(e,{when:o=>o.state.submitting()}),Kn(e.password,`blur`),Ln(e.password,{message:`Password is required`}),On(e.password,5,{message:`Password must be at least 5 characters long`}),Vn(e.password,/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/,{message:`Your password must contain at least one uppercase, one lowercase and one number.`}),Kn(e.password2,`blur`),Ln(e.password2,{message:`Password confirmation is required`}),_(e.password2,o=>{let s=o.value(),a=o.valueOf(e.password);if(s&&a!==s)return{kind:`password-mismatch`,message:`Passwords do not match`}})}),this.resetPasswordForm=Nr$1(this.resetPasswordModel,this.resetPasswordFormSchema)}signOut(){console.log(`Signing out`),this.processingRequest.set(!1),this.cookie.deleteCookie(),this.userStoreService.resetUserState(),console.log(`Broadcasting Logout in resetpassword`),Nr.postMessage(`Logout`)}routeResetPasswordRequest(){let e=new URLSearchParams(window.location.search),o=e.get(`h1`),s=e.get(`h2`),a=this.general.getSubdomainUrl(this.communityService.community().subdomain,`/signin`),u=this.general.getAuthUrl(`/resetpassword?h1=${o}&h2=${s}&returnUrl=${encodeURIComponent(a)}&sd=${this.authStore.communitySubdomain()}`);console.log(`*** Routing to auth subdomain for password reset: `,u),window.location.href=u}ngOnInit(){if(console.log(`* Routing to Auth check - isAuthMode:`,this.authStore.isAuthMode(),`isCommunityMode:`,this.communityService.isCommunityMode(),`subdomain:`,this.communityService.community().subdomain),!this.authStore.isAuthMode()&&this.communityService.isCommunityMode()){console.log(`*** Routing to auth subdomain for B2B community`),this.routeResetPasswordRequest();return}console.log(`*** Processing reset password in current subdomain (B2C or already in auth)`),this.signOut(),this.processedFlag.set(!1),this.route.queryParams.pipe(io(this.destroyRef)).subscribe(e=>{this.userHashId=e.h1||null,this.tempHashId=e.h2||null,this.userHashId&&this.tempHashId?(console.log(`*** Valid params found, calling VerifyResetRequest in 1 second`),setTimeout(()=>
1{this.VerifyResetRequest()},1e3)):(console.log(`*** Invalid params, redirecting to home`),this.isLoading.set(!1),this.router.navigate([`/home`]))})}VerifyResetRequest(){console.log(`*** VerifyResetRequest called with h1:`,this.userHashId),this.databaseService.runQuery(`getUserByHashId`,{userHashId:this.userHashId}).subscribe({next:e=>{if(e){let o=e.Community?.subdomain||``;console.log(`*** Extracted user subdomain:`,o),this.authStore.communitySubdomain.set(o);let s=new Date(this.general.getNowGMT()),a=new Date(e.resetPasswordExp);console.log(`*** Checking password hash match and expiration. today:`,s,`expDate:`,a),e.password!=this.tempHashId?(console.log(`*** Password hash mismatch`),this.errorMessage.set(`The link you used to get here is invalid`),this.errorFlag.set(!0)):s>a?(console.log(`*** Link expired`),this.errorMessage.set(`The link you used to get here has expired. Please goto the Sign-In page and request a new password reset by clicking on the Forgot Password link`),this.errorFlag.set(!0)):(console.log(`*** Verification successful, userId:`,e.id),this.userId=e.id)}else console.log(`*** No result from getUserByHashId`),this.errorMessage.set(`The link you used to get here is invalid`),this.errorFlag.set(!0);console.log(`*** Setting isLoading to false`),this.isLoading.set(!1)},error:e=>{console.error(`*** Error executing password reset page getUserByHashId:`,e),this.isLoading.set(!1)}})}onSubmit(){Mr$1(this.resetPasswordForm,async()=>await this.startResetPasswordWorkflow())}async startResetPasswordWorkflow(){if(this.errorFlag())return{kind:`error-flag`,message:this.errorMessage()};try{this.processedFlag.set(!1);let e=this.resetPasswordForm.password().value();await this.processNewPassword(e);return}catch(e){return console.error(`Reset password workflow error:`,e),this.notification.error(`Error`,`An error occurred during password reset`),{kind:`error`,message:`An error occurred during password reset`}}}processNewPassword(e){this.processingRequest.set(!0);let o=this.general.getNowGMT();return new Promise((s,a)=>{this.securityService.hashPassword(e)?.pipe(io(this.destroyRef)).subscribe({next:u=>{this.databaseService.runQuery(`updateUserForgotPassword`,{id:this.userId,tempHash:u,resetPasswordExp:o}).subscribe({next:w=>{w?(this.logger.log({categoryId:Xr.USER,eventCode:Jr.PASSWORD_RESET_COMPLETED,sourceId:this.userId,severity:Kr.INFO,data:`Forgot password process completed`}),this.processedFlag.set(!0),this.notification.success(`Password Updated`,`Successfully updated your password. Please sign-in`),setTimeout(()=>{this.processingRequest.set(!1),this.routeBackToSignin()},3e3),s()):(console.log(`Error updating the DB from processNewPassword`),this.processingRequest.set(!1),this.notification.error(`Ooooops`,`Failed to update your password. Please try again`,!0),a(new Error(`Failed to update password in database`)))},error:w=>{console.error(`Error executing updateUserForgotPassword query in resetpassword page:`,w),this.processingRequest.set(!1),this.notification.error(`Ooooops`,`Failed to update your password. Please try again`,!0),a(w)}})},error:u=>{console.error(`Error calling hashPassword in processNewPassword function in resetpasssword page:`,u),this.processingRequest.set(!1),this.notification.error(`Ooooops`,`Failed to update your password. Please try again`,!0),a(u)}})})}routeBackToSignin(){let s=new URLSearchParams(window.location.search).get(`returnUrl`)||this.general.getSubdomainUrl(this.authStore.communitySubdomain()||``);console.log(`*** Routing to auth subdomain signin with returnUrl:`,s),this.general.redirectToAuthSubdomain(s,`signin`)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=mD({type:t,selectors:[[`app-resetpassword`]],decls:2,vars:1,consts:[[1,`flex`,`align-items-center`,`justify-content-center`,2,`min-height`,`100vh`],[1,`flex`],[`strokeWidth`,`6`,`ariaLabel`,`Loading`,1,`w-4rem`,`h-4rem`],[1,`surface-200`,`w-full`,`md:w-6`,`p-6`,`md:p-8`],[1,`mb-5`],[1,`text-900`,`text-3xl`,`font-medium`,`mb-3`],[1,`text-600`,`font-medium`,`mr-2`],[1,`error-message`,`bg-red-100`,`p-2`,`border-2`,`border-red-600`,`mb-2`],[1,`processed-message`,`bg-green-100`,`p-2`,`border-2`,`border-green-600`,`mb-2`],[1,`validations-form`],[1,`hidden`,`md:block`,`w-6`,`bg-no-repeat`,`bg-cover`,2,`background-image`,`url('/assets/images/signin.jpg')`],[1,`pi`,`pi-times-circle`,`text-red-600`],[1,`ml-2`,`text-red-600`],[1,`pi`,`pi-check-circle`,`text-green-600`],[1,`ml-2`,`text-green-600`],[1,`field`,`mb-4`],[`variant`,`on`],[`for`,`password`,1,`font-medium`],[`autofocus`,``,`id`,`password`,`type`,`password`,`pInputText`,``,`placeholder`,`New password`,1,`w-full`,`p-3`,3,`formField`],[`for`,`password2`,1,`font-medium`],[`id`,`password2`,`type`,`password`,`pInputText`,``,`placeholder`,`Repeat password`,1,`w-full`,`p-3`,3,`formField`],[1,`flex`,`justify-content-center`],[`type`,`button`,`id`,`submitButton`,`pButton`,``,`pRipple`,``,1,`w-full`,`p-3`],[`strokeWidth`,`6`,`ariaLabel`,`Progressbar spinning`,1,`w-2rem`,`h-2rem`],[`type`,`button`,`id`,`submitButton`,`pButton`,``,`pRipple`,``,1,`w-full`,`p-3`,3,`click`],[1,`pi`,`pi-lock`]],template:function(o,s){o&1&&zD(0,he,2,0,`div`,0)(1,ye,11,3,`div`,1),o&2&&QD(s.isLoading()?0:1)},dependencies:[rn,Dl,Ls,lo,W0,z0,xy,Mr,ye$1,oe,ze$1,zn,Rl,pr],encapsulation:2})}}return t})();export{et as ResetpasswordComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.