PageSourceSearch

https://awo-care-dev.web.app/de/chunk-636QJQ5T.js

js awo-care-dev.web.app collected 2026-10-03 12:17:28 UTC 8,439 bytes, 2 lines download raw bytes

1import{Dc as f,Ec as b,Fc as y,Gc as E,Hc as I,Ic as R,Jc as P,Kc as T,Lc as A,Mc as S,Oc as k,Pc as N,Qc as x,Xc as F,Yc as C,a,b as m,kb as v,kc as l,mc as u,oc as d,q as c,sc as p,u as n,uc as L,vc as g}from"./chunk-6I2XRATP.js";var w={tier:"DEV",production:!1,useEmulators:!1,useFunctionsEmulatorOnly:!1,disableCookieBanner:!1,firebaseConfig:{apiKey:"AIzaSyC5nNvCydRYjsGRC3Ip_p7OWUZd-WNSrVA",authDomain:"awo-care-dev.firebaseapp.com",projectId:"awo-care-dev",storageBucket:"awo-care-dev.firebasestorage.app",messagingSenderId:"525164463275",appId:"1:525164463275:web:77ded45730bd8cd4e6a3ee",measurementId:void 0},appIds:{customerUi:"1:525164463275:web:77ded45730bd8cd4e6a3ee",employeeUi:"1:525164463275:web:1842996a95e42253e6a3ee",website:"1:525164463275:web:92c33e758e42f1ece6a3ee"},measurementIds:{customerUi:void 0,employeeUi:void 0,website:void 0},googleMapsAPIKey:"AIzaSyBB279QyhD5tHOFF90WRczfEQuA_BWhnJc",recaptchaSiteKey:"6LcSqMAqAAAAAL9XW3Mn4uhfXtRjdaiI6gpWkxXb",microsoftTenantId:"8ef6f487-81f8-449b-85ab-5ec65b8ad8de",enableAppCheck:!0,enablePerformance:!0,companyDomain:"awo-hs.org",appUrls:{website:"https://awo-care-dev.web.app",portal:"https://awo-care-dev-app.web.app"}};var h="awoCareLastLogin";function B(i){switch(i){case"google.com":return"google";case"apple.com":return"apple";case"microsoft.com":return"microsoft";case"phone":return"phone";case"password":return"email";default:return"email"}}function O(i){let e=i.providerData?.[0]?.providerId??"",t=B(e),r=i.email||i.phoneNumber||"";return{provider:t,displayName:i.displayName||r,email:r,photoURL:i.photoURL||void 0}}var W=class i{auth=n(k);firestore=n(N);functions=n(x);router=n(v);languageService=n(C,{optional:!0});attemptCount=new Map;createBaseUserData(e){return{id:e.uid,email:e.email||e.phoneNumber||"",emailVerified:e.emailVerified,isActive:!0,provider:e.providerData[0]?.providerId||"unknown",role:"customer",lastSignIn:d(),createdOn:d(),language:this.languageService?.currentLanguage()?.code??F().code,browserLocale:typeof navigator<"u"?navigator.language:""}}async validateToken(e){try{let t=this.auth.currentUser;if(!t)return!1;let r=await t.getIdToken(!0);return e===r}catch{return!1}}async refreshToken(){try{let e=this.auth.currentUser;return e?await e.getIdToken(!0):null}catch(e){return console.error("Token refresh failed:",e),await this.signOut(),null}}checkRateLimit(e){let t=Date.now(),r=this.attemptCount.get(e);if(r&&t-r.timestamp<36e5){if(r.count>=5)return!1;r.count++}else this.attemptCount.set(e,{count:1,timestamp:t});return!0}async loginWithProvider(e){try{let t=await A(this.auth,e);if(!t.user)throw new Error("No user data returned");return await this.processLogin(t.user),t.user}catch(t){switch(t.code){case"auth/popup-blocked":return await S(this.auth,e),null;case"auth/cancelled-popup-request":throw new Error("Login cancelled.");case"auth/account-exists-with-different-credential":throw new Error("Account exists with different login method.");default:throw t}}}async processLogin(e){if(!e?.uid||!e.email)throw new Error("Invalid user data");let t=this.createBaseUserData(e);await this.addFirebaseUser(e.uid,t),this.saveLastLogin(e)}saveLastLogin(e){try{let t=O(e);localStorage.setItem(h,JSON.stringify(t))}catch(t){console.error("Failed to save last login info:",t)}}getLastLogin(){try{let e=localStorage.getItem(h);return e?JSON.parse(e):null}catch{return null}}clearLastLogin(){try{localStorage.removeItem(h)}catch(e){console.error("Failed to clear last login info:",e)}}async getUserData(e){let t=u(this.firestore,this.userCollection,e),r=await p(t);return r.exists()?r.data():null}async getClientIP(){try{return(await(await fetch("https://api.ipify.org?format=json")).json()).ip}catch{return"unknown"}}async addFirebaseUser(e,t){if(!e)throw new Error("Cannot save user document: missing UID");try{let r=u(this.firestore,this.userCollection,e),o=await p(r);if(!o.exists())return await L(r,t),m(a({},t),{lastSignIn:l.now(),createdOn:l.now()});let s=o.data();return await g(r,a(a({lastSignIn:d(),email:t.email,emailVerified:t.emailVerified},t.browserLocale&&{browserLocale:t.browserLocale}),t.phoneNumber&&!s.phoneNumber&&{phoneNumber:t.phoneNumber,phoneVerified:t.phoneVerified})),m(a(a({},s),t),{lastSignIn:l.now()})}catch(r){let o=r;throw new Error(`Failed to add/update user: ${o.message}`)}}async reauthenticate(e,t){let r=this.auth.currentUser;if(!r)throw new Error("No authenticated user");let o=e?.trim()??"";if(!o.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))throw new Error("Invalid email format");if(!t||t.length<8)throw new Error("Password must be at least 8 characters");let s=b.credential(o,t);await y(r,s)}async emailLogin(e,t){let r=e?.trim()??"";if(!r.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))throw new Error("Invalid email format");if(!t||t.length<8)throw new Error("Password must be at least 8 characters");if(!this.checkRateLimit(r))throw new Error("Too many login attempts. Try again later.");let o=await P(this.auth,r,t);return await this.processLogin(o.user),o.user}async updateUser(e,t){try{let r=u(this.firestore,this.userCollection,e);await g(r,t)}catch(r){let o=r;throw new Error(`Failed to update user: ${o.message}`)}}async sendPasswordReset(e){try{let r=await f(this.functions,"sendPasswordResetEmail",{timeout:45e3})({email:e?.trim()??""});if(!r.data.success)throw new Error(r.data.error||"Failed to send password reset email");return!0}catch(t){throw t}}async createEmailAccount(e,t){let r=e?.trim()??"";if(!this.checkRateLimit(r))throw new Error("Too many attempts. Try again later.");return await R(this.auth,r,t)}async sendVerificationEmail(e){if(!e)throw new Error("No user provided");try{let r=window.location.pathname.match(/^\/(de|en)\//),o=r?r[1]:this.languageService?.currentLanguage()?.code||"de",U=await f(this.functions,"sendVerificationEmail",{timeout:45e3})({email:e.email||"",language:o});if(!U.data.success)throw new Error(U.data.error||"Failed to send verification email");return}catch(t){throw console.error("Error sending verification email:",t),t}}async handleVerifyEmail(e){try{if(await I(this.auth,e),!this.auth.currentUser)return;try{await this.auth.currentUser.reload()}catch(r){if(r.code==="auth/user-token-expired"){await this.auth.signOut();return}throw r}let t={emailVerified:!0};this.auth.currentUser.email&&(t.email=this.auth.currentUser.email),await this.updateUser(this.auth.currentUser.uid,t)}catch(t){throw await this.router.navigateByUrl("auth/login"),t}}async handlePasswordReset(e,t){try{return await E(this.auth,e,t)}catch(r){let o=r;throw new Error(`Failed to reset password: ${o.message}`)}}async changeEmail(e){try{let t=this.auth.currentUser;if(!t)throw new Error("No authenticated user");let r=e?.trim()??"";if(!r.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))throw new Error("Invalid email format");if(!this.checkRateLimit(r))throw new Error("Too many attempts. Try again later.");await T(t,r,{url:`${window.location.origin}/auth/verify`,handleCodeInApp:!0});return}catch(t){throw console.error("Email change failed:",t),t}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})};var _=class i{RETURN_URL_KEY="auth_return_url";constructor(){}getPortalUrl(){return w.appUrls.portal}getWebsiteUrl(){return w.appUrls.website}setReturnUrl(e){sessionStorage.setItem(this.RETURN_URL_KEY,e)}getReturnUrl(){let e=sessionStorage.getItem(this.RETURN_URL_KEY);return e&&sessionStorage.removeItem(this.RETURN_URL_KEY),e}redirectToPortal(e){let t=e||"/care";this.isOnPortal()?window.location.href=t:window.location.href=`${this.getPortalUrl()}${t}`}redirectToLogin(e){e&&this.setReturnUrl(e);let t=this.getWebsiteUrl();window.location.href=`${t}/auth/login`}redirectToWebsite(){let e=this.getWebsiteUrl();window.location.href=e}isPortalApp(){return this.isOnPortal()}isWebsiteApp(){return window.location.origin===this.getWebsiteUrl()}isOnPortal(){let e=window.location.origin,t=new URL(this.getPortalUrl()).origin,r=new URL(this.getWebsiteUrl()).origin;return e===t?!0:e!==r}getCurrentAppContext(){return this.isPortalApp()?"portal":"website"}handleLoginSuccess(){let e=this.getReturnUrl();this.redirectToPortal(e||"/care")}handleLogout(){sessionStorage.removeItem(this.RETURN_URL_KEY),this.redirectToWebsite()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})};export{w as a,_ as b};
2/**i18n:3908376470285256e694bc03bb1adf4ad1b20003d4d5ec4f633054cc7e58102a*/

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.