PageSourceSearch

https://www.vicbug.app/_next/static/chunks/902-62bac7aa1d4e72c1.js

js vicbug.app collected 2026-09-24 13:56:16 UTC 12,371 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[902],{30902:(e,a,s)=>{s.d(a,{U:()=>f});var t=s(95155),l=s(12115),r=s(65229),i=s(35299),n=s(23664),o=s(81328),c=s(19708),d=s(40550);let u=(e,a)=>{let s=(null!=e?e:"").trim().replace(/\s+/g," ");if(!s){let e=(null!=a?a:"").trim()||"New";return"".concat(e," Rider")}return s.split(" ").length>=2?s:"".concat(s," Cyclist")},m=e=>e?{uid:e.uid,email:e.email,displayName:e.displayName,photoURL:e.photoURL}:null,x=async(e,a)=>{let s=(0,c.H9)(d.db,"users",e.uid),t=await (0,c.x7)(s);if(t.exists())await (0,c.updateDoc)(s,{lastLogin:(0,c.O5)(),photoURL:e.photoURL||t.data().photoURL});else{var l;let t=u(null!=(l=null==a?void 0:a.displayName)?l:e.displayName,null==a?void 0:a.firstName),r=t.split(" "),i=((null==a?void 0:a.firstName)||r[0]||"").trim(),n=((null==a?void 0:a.lastName)||r.slice(1).join(" ")||"").trim();await (0,c.BN)(s,{displayName:t,email:e.email||"",photoURL:e.photoURL||"",firstName:i,lastName:n,createdAt:(0,c.O5)(),updatedAt:(0,c.O5)()})}},h=async(e,a)=>m((await (0,o.x9)(d.j2,e,a)).user),p=async(e,a,s)=>{let t=await (0,o.eJ)(d.j2,e,a),l=u(s);return await (0,o.r7)(t.user,{displayName:l}),await x(t.user,{displayName:l}),m(t.user)},b=async()=>{let e=new o.HF,a=await (0,o.df)(d.j2,e);return await x(a.user),m(a.user)},g=async()=>{let e=new o.LD("apple.com");e.addScope("email"),e.addScope("name");let a=await (0,o.df)(d.j2,e);return await x(a.user),m(a.user)},y=async e=>{await (0,o.J1)(d.j2,e)};function f(e){let{isOpen:a,onClose:s,onSuccess:o,title:c="Sign in to AusBUG",subtitle:d="Join the AusBUG cycling community"}=e,[u,m]=(0,l.useState)("choice"),[x,f]=(0,l.useState)(!1),[w,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(null),[C,k]=(0,l.useState)(""),[A,S]=(0,l.useState)(""),[B,L]=(0,l.useState)(""),[F,D]=(0,l.useState)("");if(!a)return null;let E=()=>{m("choice"),j(null),v(null),k(""),S(""),L(""),D(""),s()},U=async()=>{f(!0),j(null);try{await b(),null==o||o(),E()}catch(e){j(e.message||"Failed to sign in with Google")}finally{f(!1)}},R=async()=>{f(!0),j(null);try{await g(),null==o||o(),E()}catch(e){j(e.message||"Failed to sign in with Apple")}finally{f(!1)}},I=async e=>{e.preventDefault(),f(!0),j(null);try{await h(C,A),null==o||o(),E()}catch(e){"auth/invalid-credential"===e.code?j("Invalid email or password"):"auth/user-not-found"===e.code?j("No account found with this email"):j(e.message||"Failed to sign in")}finally{f(!1)}},P=async e=>{if(e.preventDefault(),f(!0),j(null),A!==B){j("Passwords do not match"),f(!1);return}if(A.length<6){j("Password must be at least 6 characters"),f(!1);return}try{await p(C,A,F),null==o||o(),E()}catch(e){"auth/email-already-in-use"===e.code?j("An account with this email already exists"):"auth/weak-password"===e.code?j("Password is too weak"):j(e.message||"Failed to create account")}finally{f(!1)}},q=async e=>{e.preventDefault(),f(!0),j(null),v(null);try{await y(C),v("Password reset email sent! Check your inbox.")}catch(e){"auth/user-not-found"===e.code?j("No account found with this email"):j(e.message||"Failed to send reset email")}finally{f(!1)}};return(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:E}),(0,t.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-6 border-b border-gray-100",children:[(0,t.jsx)("button",{onClick:E,className:"absolute top-4 right-4 p-2 text-gray-400 hover:text-gray-600 rounded-full hover:bg-gray-100",children:(0,t.jsx)(r.A,{className:"w-5 h-5"})}),(0,t.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:c}),(0,t.jsx)("p",{className:"text-gray-600 mt-1",children:d})]}),(0,t.jsxs)("div",{className:"p-6",children:[w&&(0,t.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg",children:(0,t.jsx)("p",{className:"text-sm text-red-600",children:w})}),N&&(0,t.jsx)("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:(0,t.jsx)("p",{className:"text-sm text-green-600",children:N})}),"choice"===u&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:U,disabled:x,className:"w-full flex items-center justify-center gap-3 px-4 py-3 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50",children:[x?(0,t.jsx)(i.A,{className:"w-5 h-5 animate-spin"}):(0,t.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,t.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,t.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,t.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Continue with Google"})]}),(0,t.jsxs)("button",{onClick:R,disabled:x,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-black text-white rounded-lg hover:bg-gray-800 transition-colors disabled:opacity-50",children:[x?(0,t.jsx)(i.A,{className:"w-5 h-5 animate-spin"}):(0,t.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,t.jsx)("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),(0,t.jsx)("span",{className:"font-medium",children:"Continue with Apple"})]}),(0,t.jsxs)("div",{className:"relative my-6",children:[(0,t.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,t.jsx)("div",{className:"w-full border-t border-gray-200"})}),(0,t.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,t.jsx)("span",{className:"px-4 bg-white text-gray-500",children:"or"})})]}),(0,t.jsxs)("button",{onClick:()=>m("email-signin"),disabled:x,className:"w-full flex items-center justify-center gap-3 px-4 py-3 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50",children:[(0,t.jsx)(n.A,{className:"w-5 h-5 text-gray-600"}),(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Continue with Email"})]})]}),"email-signin"===u&&(0,t.jsxs)("form",{onSubmit:I,className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,t.jsx)("input",{type:"email",value:C,onChange:e=>k(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"[email protected]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),(0,t.jsx)("input",{type:"password",value:A,onChange:e=>S(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter your password"})]}),(0,t.jsxs)("button",{type:"submit",disabled:x,className:"w-full py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:[x&&(0,t.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Sign In"]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("button",{type:"button",onClick:()=>m("forgot-password"),className:"text-blue-600 hover:underline",children:"Forgot password?"}),(0,t.jsx)("button",{type:"button",onClick:()=>m("email-signup"),className:"text-blue-600 hover:underline",children:"Create account"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>m("choice"),className:"w-full py-2 text-gray-600 hover:text-gray-800 text-sm",children:"Back to sign in options"})]}),"email-signup"===u&&(0,t.jsxs)("form",{onSubmit:P,className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:F,onChange:e=>D(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"John Smith"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,t.jsx)("input",{type:"email",value:C,onChange:e=>k(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"[email protected]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),(0,t.jsx)("input",{type:"password",value:A,onChange:e=>S(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"At least 6 characters"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirm Password"}
1),(0,t.jsx)("input",{type:"password",value:B,onChange:e=>L(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Confirm your password"})]}),(0,t.jsxs)("button",{type:"submit",disabled:x,className:"w-full py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:[x&&(0,t.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Create Account"]}),(0,t.jsxs)("p",{className:"text-center text-sm text-gray-600",children:["Already have an account?"," ",(0,t.jsx)("button",{type:"button",onClick:()=>m("email-signin"),className:"text-blue-600 hover:underline",children:"Sign in"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>m("choice"),className:"w-full py-2 text-gray-600 hover:text-gray-800 text-sm",children:"Back to sign in options"})]}),"forgot-password"===u&&(0,t.jsxs)("form",{onSubmit:q,className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Enter your email address and we'll send you a link to reset your password."}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,t.jsx)("input",{type:"email",value:C,onChange:e=>k(e.target.value),required:!0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"[email protected]"})]}),(0,t.jsxs)("button",{type:"submit",disabled:x,className:"w-full py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:[x&&(0,t.jsx)(i.A,{className:"w-4 h-4 animate-spin"}),"Send Reset Link"]}),(0,t.jsx)("button",{type:"button",onClick:()=>m("email-signin"),className:"w-full py-2 text-gray-600 hover:text-gray-800 text-sm",children:"Back to sign in"})]})]})]})]})}},40550:(e,a,s)=>{let t;s.d(a,{IG:()=>u,db:()=>d,j2:()=>m});var l=s(52078),r=s(35336),i=s(19708),n=s(79996),o=s(81328);let c=0===(0,l.Dk)().length?(0,l.Wp)({apiKey:"AIzaSyAsij1EpdPpuhsfcClqAnBFshHfGd6WeJo",authDomain:"cyaroutes.firebaseapp.com",projectId:"cyaroutes",storageBucket:"cyaroutes.firebasestorage.app",messagingSenderId:"601003510442",appId:"1:601003510442:web:a91daf9016922656a89ed3"}):(0,l.Dk)()[0];if(!t)try{t=(0,r.Ay)(c,{provider:new r._u("6LdSFaQsAAAAA64DLCa7An8xoI9eVDnViMwBogY"),isTokenAutoRefreshEnabled:!0})}catch(e){}let d=["localhost","127.0.0.1"].includes(window.location.hostname)?(0,i._A)(c,{experimentalForceLongPolling:!0}):(0,i.aU)(c),u=(0,n.c7)(c),m=(0,o.xI)(c)}}]);

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.