1import{_ as B}from"./AuthPageLayout-WULjz0SV.js";import{C as m,c as l,a as s,o as e,_ as S,O as V,v as F,Y as A,q as z,m as I,r as U,b as r,w as c,h as E,Z,e as k,t as T,F as x,f as G,k as u,i as Q,s as C,u as R,z as w}from"./app-CNcGIC74.js";import{_ as Y}from"./linkedin-DwDqMWpa.js";const j={viewBox:"0 0 1792 1664",width:"1.3em",height:"1.2em"};function J(i,t){return e(),l("svg",j,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M1086 0v1536l-272 128q-228-20-414-102t-293-208.5T0 1081q0-140 100.5-263.5t275-205.5T767 504v172q-217 38-356.5 150T271 1081q0 152 154.5 267T814 1493V133zm669 582l37 390l-525-114l147-83q-119-70-280-99V504q277 33 481 157z"},null,-1)])])}const K=m({name:"fa-openid",render:J}),X={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function t1(i,t){return e(),l("svg",X,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M25.7 7.1Q23 5.9 20 5.3h-.1c-.2.4-.5 1-.7 1.5c-2.2-.3-4.3-.3-6.4 0c-.2-.5-.5-1-.7-1.5H12q-3 .45-5.7 1.8C2.7 12.5 1.7 17.8 2.2 23v.1c2.4 1.8 4.7 2.8 7 3.5h.1c.5-.7 1-1.5 1.4-2.3v-.1c-.8-.3-1.5-.6-2.2-1c-.1 0-.1-.1 0-.1c.1-.1.3-.2.4-.3H9c4.6 2.1 9.5 2.1 14.1 0h.1c.1.1.3.2.4.3c.1 0 0 .1 0 .1c-.7.4-1.4.8-2.2 1c0 0-.1.1 0 .1c.4.8.9 1.6 1.4 2.3h.1c2.3-.7 4.6-1.8 7-3.5V23c.6-6-1-11.2-4.2-15.9M11.4 19.9c-1.4 0-2.5-1.3-2.5-2.8s1.1-2.8 2.5-2.8s2.5 1.3 2.5 2.8s-1.1 2.8-2.5 2.8m9.3 0c-1.4 0-2.5-1.3-2.5-2.8s1.1-2.8 2.5-2.8s2.5 1.3 2.5 2.8s-1.1 2.8-2.5 2.8"},null,-1)])])}const e1=m({name:"carbon-logo-discord",render:t1}),o1={viewBox:"0 0 1408 1664",width:"1.02em",height:"1.2em"};function n1(i,t){return e(),l("svg",o1,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M1393 1215q-39 125-123 250q-129 196-257 196q-49 0-140-32q-86-32-151-32q-61 0-142 33q-81 34-132 34q-152 0-301-259Q0 1144 0 902q0-228 113-374q113-144 284-144q72 0 177 30q104 30 138 30q45 0 143-34q102-34 173-34q119 0 213 65q52 36 104 100q-79 67-114 118q-65 94-65 207q0 124 69 223t158 126M1017 42q0 61-29 136q-30 75-93 138q-54 54-108 72q-37 11-104 17q3-149 78-257Q835 41 1011 0q1 3 2.5 11t2.5 11q0 4 .5 10t.5 10"},null,-1)])])}const s1=m({name:"fa-apple",render:n1}),a1={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l1(i,t){return e(),l("svg",a1,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M2 3h9v9H2zm9 19H2v-9h9zM21 3v9h-9V3zm0 19h-9v-9h9z"},null,-1)])])}const i1=m({name:"mdi-microsoft",render:l1}),r1={viewBox:"0 0 1600 1280",width:"1.5em",height:"1.2em"};function c1(i,t){return e(),l("svg",r1,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M1588 152q-67 98-162 167q1 14 1 42q0 130-38 259.5T1273.5 869T1089 1079.5t-258 146t-323 54.5q-271 0-496-145q35 4 78 4q225 0 401-138q-105-2-188-64.5T189 777q33 5 61 5q43 0 85-11q-112-23-185.5-111.5T76 454v-4q68 38 146 41q-66-44-105-115T78 222q0-88 44-163q121 149 294.5 238.5T788 397q-8-38-8-74q0-134 94.5-228.5T1103 0q140 0 236 102q109-21 205-78q-37 115-142 178q93-10 186-50"},null,-1)])])}const u1=m({name:"fa-twitter",render:c1}),m1={viewBox:"0 0 896 1664",width:"0.65em",height:"1.2em"};function d1(i,t){return e(),l("svg",m1,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M895 12v264H738q-86 0-116 36t-30 108v189h293l-39 296H592v759H286V905H31V609h255V391q0-186 104-288.5T667 0q147 0 228 12"},null,-1)])])}const _1=m({name:"fa-facebook",render:d1}),q1={viewBox:"0 0 1536 1504",width:"1.24em",height:"1.2em"};function h1(i,t){return e(),l("svg",q1,[...t[0]||(t[0]=[s("path",{fill:"currentColor",d:"M768 0q209 0 385.5 103T1433 382.5T1536 768q0 251-146.5 451.5T1011 1497q-27 5-40-7t-13-30q0-3 .5-76.5t.5-134.5q0-97-52-142q57-6 102.5-18t94-39t81-66.5t53-105T1258 728q0-119-79-206q37-91-8-204q-28-9-81 11t-92 44l-38 24q-93-26-192-26t-192 26q-16-11-42.5-27T450 331.5T365 318q-45 113-8 204q-79 87-79 206q0 85 20.5 150T351 983t80.5 67t94 39t102.5 18q-39 36-49 103q-21 10-45 15t-57 5t-65.5-21.5T356 1146q-19-32-48.5-52t-49.5-24l-20-3q-21 0-29 4.5t-5 11.5t9 14t13 12l7 5q22 10 43.5 38t31.5 51l10 23q13 38 44 61.5t67 30t69.5 7t55.5-3.5l23-4q0 38 .5 88.5t.5 54.5q0 18-13 30t-40 7q-232-77-378.5-277.5T0 768q0-209 103-385.5T382.5 103T768 0M291 1103q3-7-7-12q-10-3-13 2q-3 7 7 12q9 6 13-2m31 34q7-5-2-16q-10-9-16-3q-7 5 2 16q10 10 16 3m30 45q9-7 0-19q-8-13-17-6q-9 5 0 18t17 7m42 42q8-8-4-19q-12-12-20-3q-9 8 4 19q12 12 20 3m57 25q3-11-13-16q-15-4-19 7t13 15q15 6 19-6m63 5q0-13-17-11q-16 0-16 11q0 13 17 11q16 0 16-11m58-10q
1-2-11-18-9q-16 3-14 15t18 8t14-14"},null,-1)])])}const p1=m({name:"fa-github",render:h1}),g1={components:{AuthPageLayout:B,BForm:I,BFormGroup:z,BFormInput:A,BButton:F,BTooltip:V},setup(){const i=w(""),t=w(""),b=w([]),a=w(""),d=C("pocketbase"),_=C("router"),g=C("emitter");return R(async()=>{try{const o=await d.collection("users").listAuthMethods();b.value.push(...o.oauth2.providers)}catch(o){console.error("Failed to fetch auth methods:",o)}}),{email:i,password:t,oauthProviders:b,errorMessage:a,login:async()=>{a.value="";try{await d.collection("users").authWithPassword(i.value,t.value,{expand:"roles"});const o=_.currentRoute.value.query.redirect;_.push(typeof o=="string"?o:"/")}catch(o){console.error("Login failed:",o),a.value=(o==null?void 0:o.status)===400?"Incorrect email or password.":"Could not log in. Please try again."}},loginWithOAuth:async o=>{var f;a.value="";try{const q=`${window.location.origin}/api/oauth2-redirect`,h=await d.collection("users").authWithOAuth2({provider:o,redirectUrl:q,createData:{consents:{emailConsent:!1,consents:{}}}});try{const p=h.record.meta||{};await d.collection("users").update(h.record.id,{meta:{...p,[o]:(f=h.meta)==null?void 0:f.rawUser}})}catch(p){console.warn("Could not store OAuth profile meta:",p)}g.emit("toast",{title:"Logged in with "+o,variant:"success"});const v=_.currentRoute.value.query.redirect;_.push(typeof v=="string"?v:"/")}catch(q){console.error(`OAuth login failed for ${o}:`,q),a.value="Could not log in with "+o+". Please try again."}}}}},f1={class:"login-page"},v1={key:0,class:"oauth-section"},w1={class:"oauth-buttons"},b1={class:"gsi-material-button-content-wrapper"},y1={class:"gsi-material-button-icon"},k1={version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",style:{display:"block"}},T1={key:1},C1={class:"oauth-icon-btn__label"};function M1(i,t,b,a,d,_){const g=A,y=z,M=I,o=Z,f=p1,q=_1,h=u1,v=Y,p=i1,$=s1,H=e1,L=K,P=F,O=V,N=U("router-link"),W=B;return e(),l("div",f1,[r(W,{title:"Log in"},{default:c(()=>[r(M,{onSubmit:E(a.login,["prevent"])},{default:c(()=>[r(y,{class:"form-group",label:"Email","label-for":"email","label-class":"form-label"},{default:c(()=>[r(g,{id:"email",modelValue:a.email,"onUpdate:modelValue":t[0]||(t[0]=n=>a.email=n),type:"email",required:""},null,8,["modelValue"])]),_:1}),r(y,{class:"form-group",label:"Password","label-for":"password"},{default:c(()=>[r(g,{id:"password",modelValue:a.password,"onUpdate:modelValue":t[1]||(t[1]=n=>a.password=n),type:"password",required:""},null,8,["modelValue"])]),_:1}),t[3]||(t[3]=s("button",{type:"submit",class:"ih-btn-primary login-submit"},"Login",-1))]),_:1},8,["onSubmit"]),r(o,{"model-value":!!a.errorMessage,variant:"danger",class:"mt-3"},{default:c(()=>[k(T(a.errorMessage),1)]),_:1},8,["model-value"]),a.oauthProviders.length?(e(),l("div",v1,[s("div",w1,[(e(!0),l(x,null,G(a.oauthProviders,n=>(e(),l(x,{key:n.name},[n.name==="google"?(e(),l("button",{key:0,type:"button",class:"gsi-material-button",onClick:t[2]||(t[2]=D=>a.loginWithOAuth("google"))},[t[6]||(t[6]=s("div",{class:"gsi-material-button-state"},null,-1)),s("div",b1,[s("div",y1,[(e(),l("svg",k1,[...t[4]||(t[4]=[s("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"},null,-1),s("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"},null,-1),s("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"},null,-1),s("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"},null,-1),s("path",{fill:"none",d:"M0 0h48v48H0z"},null,-1)])]))]),t[5]||(t[5]=s("span",{class:"gsi-material-button-contents"},"Sign in with Google",-1))])])):(e(),l("div",T1,[r(P,{id:"btn-"+n.name,class:"ih-btn-outline oauth-icon-btn",onClick:D=>a.loginWithOAuth(n.name)},{default:c(()=>[n.name==="github"?(e(),u(f,{key:0})):n.name==="facebook"?(e(),u(q,{key:1})):n.name==="twitter"?(e(),u(h,{key:2})):n.name==="linkedin"?(e(),u(v,{key:3})):n.name==="microsoft"?(e(),u(p,{key:4})):n.name==="apple"?(e(),u($,{key:5})):n.name==="discord"?(e(),u(H,{key:6})):(e(),u(L,{key:7})),s("span",C1,T(n.displayName||n.name),1)]),_:2},1032,["id","onClick"]),r(O,{target:"btn-"+n.name,triggers:"hover"},{default:c(()=>[k(T(n.displayName),1)]),_:2},1032,["target"])]))],64))),128))])])):Q("",!0),r(N,{class:"signup-link",to:"/signup"},{default:c(()=>[...t[7]||(t[7]=[k("Don't have an account? Sign up here",-1)])]),_:1})]),_:1})])}const F1=S(g1,[["render",M1],["__scopeId","data-v-f2a9bc95"]]);export{F1 as default};
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.