1/*! LICENSE: route-38eeb951c3e8.aefb1ae85c.js.LICENSE.txt */ 2"use strict";(globalThis.rspackChunkselfreason_website=globalThis.rspackChunkselfreason_website||[]).push([[781],{168(e,r,i){i.r(r),i.d(r,{default:()=>N});var t=i(4848),n=i(8453),s=i(4488),a=i(3602),o=i(3858),l=i(6404),u=i(1085),c=i(7957),d=i(6033),h=i(7193),m=i(3189),g=i(1418),p=i(6324),f=i(9396),x=i(6100),w=i(1037),v=i(2412),b=i(6540),j={root:"m_4081bf90"};let y={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},A=(0,f.V)((e,{grow:r,preventGrowOverflow:i,gap:t,align:n,justify:s,wrap:a},{childWidth:o})=>({root:{"--group-child-width":r&&i?o:void 0,"--group-gap":(0,p.GY)(t),"--group-align":n,"--group-justify":s,"--group-wrap":a}})),z=(0,v.P9)(e=>{let r=(0,x.Y)("Group",y,e),{classNames:i,className:n,style:s,styles:a,unstyled:l,children:u,gap:c,align:d,justify:h,wrap:m,grow:g,preventGrowOverflow:f,vars:v,variant:z,__size:S,mod:_,attributes:k,...C}=r,E=b.Children.toArray(u).filter(Boolean),R=E.length,M=(0,p.GY)(c??"md");return(0,t.jsx)(o.a,{...(0,w.I)({name:"Group",props:r,stylesCtx:{childWidth:`calc(${100/R}% - (${M} - ${M} / ${R}))`},className:n,style:s,classes:j,classNames:i,styles:a,unstyled:l,attributes:k,vars:v,varsResolver:A})("root"),variant:z,mod:[{grow:g},_],size:S,...C,children:E})});z.classes=j,z.varsResolver=A,z.displayName="@mantine/core/Group";var S=i(4227),_=i(4123),k=i(1573),C=i(7028);let E=(0,C.A)("outline","arrow-right","ArrowRight",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]]),R=(0,C.A)("outline","shield-check","ShieldCheck",[["path",{d:"M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]]);var M=i(6942);let B={openid:"Your account identity",email:"Your email address",profile:"Your basic profile information",phone:"Your phone number",offline_access:"Keep this connection active"};function F(){var e,r,i;let n=(0,b.useRef)(null),p=(0,b.useRef)(null),[f,x]=(0,b.useState)("loading"),[w,v]=(0,b.useState)(null),[j,y]=(0,b.useState)(""),[A,S]=(0,b.useState)(""),[C,F]=(0,b.useState)(""),T=(0,b.useCallback)(async function(e,r){let{data:i,error:t}=await e.auth.oauth.getAuthorizationDetails(r);if(t||!i){F((null==t?void 0:t.message)??"This authorization request is invalid or has expired."),x("error");return}i.redirect_url&&!i.authorization_id?window.location.assign(i.redirect_url):(v(i),x("consent"))},[]);async function G(e){e.preventDefault(),F("");let r=n.current,i=p.current;if(!r||!i){F("Account authorization is temporarily unavailable."),x("error");return}x("submitting");let{error:t}=await r.auth.signInWithPassword({email:j.trim(),password:A});if(t){F("Email or password is incorrect."),x("login");return}S(""),await T(r,i)}async function N(e){var r,i;let t=n.current,s=p.current;if(!t||!s)return;F(""),x("submitting");let a="approve"===e?await t.auth.oauth.approveAuthorization(s):await t.auth.oauth.denyAuthorization(s);if(a.error||!(null==(r=a.data)?void 0:r.redirect_url)){F((null==(i=a.error)?void 0:i.message)??"Unable to finish authorization."),x("consent");return}window.location.assign(a.data.redirect_url)}(0,b.useEffect)(()=>{let e=!0;return async function(){let r=new URLSearchParams(window.location.search).get("authorization_id");if(!r){e&&(F("Missing authorization request."),x("error"));return}p.current=r;let i=(0,_.U)("https://tobdvtrhzprjityzgopa.supabase.co","sb_publishable_pqkoTGxFBDF0Ynibu7fSGQ_4bfr_Igt",{auth:{detectSessionInUrl:!1,persistSession:!0}});n.current=i;let{data:t}=await i.auth.getSession();if(e){if(!t.session)return x("login");await T(i,r)}}(),()=>{e=!1}},[T]);let q=(null==w||null==(e=w.scope)?void 0:e.split(/\s+/).filter(Boolean))??[],P=(null==w||null==(i=w.client)||null==(r=i.name)?void 0:r.trim())||"This application",Y=function(e){if(!e)return null;try{return new URL(e).host}catch{return null}}(null==w?void 0:w.redirect_uri);return(0,t.jsx)("main",{className:M.A.page,children:(0,t.jsxs)(s.t,{className:M.A.card,radius:"xl",p:{base:"xl",sm:38},shadow:"xl",withBorder:!0,children:[(0,t.jsx)(a.M,{className:M.A.brand,href:"/",underline:"never",children:"HuBrowser Membership"}),(0,t.jsxs)(o.a,{mt:36,children:[(0,t.jsx)(l.E,{className:M.A.eyebrow,c:"dark.8",fw:800,size:"xs",children:"HuBrowser Membership"}),(0,t.jsx)(u.h,{order:1,mt:"sm",children:"login"!==f&&("submitting"!==f||w)?"error"===f?"Authorization unavailable":"Connect your account":"Sign in to continue"})]}),"loading"===f?(0,t.jsx)(l.E,{c:"dimmed",mt:"lg",children:"Loading authorization requestâ¦"}):null,"login"!==f&&("submitting"!==f||w)?null:(0,t.jsx)("form",{className:M.A.form,onSubmit:G,children:(0,t.jsxs)(c.B,{gap:"md",children:[(0,t.jsx)(l.E,{c:"dimmed",children:"Use your existing HuBrowser Membership account."}),C?(0,t.jsx)(d.F,{color:"red",variant:"light",radius:"md",icon:(0,t.jsx)(k.A,{size:18}),children:C}):null,(0,t.jsx)(h.k,{label:"Email address",type:"email",autoComplete:"email",value:j,onChange:e=>y(e.currentTarget.value),disabled:"submitting"===f,required:!0}),(0,t.jsx)(m.y,{label:"Password",autoComplete:"current-password",value:A,onChange:e=>S(e.currentTarget.value),disabled:"submitting"===f,required:!0}),(0,t.jsx)(g.$,{type:"submit",color:"dark",radius:"xl",size:"md",loading:"submitting"===f,rightSection:(0,t.jsx)(E,{size:18}),children:"Continue"}),(0,t.jsx)(a.M,{href:"/reset-password/",size:"sm",children:"Forgot your password?"})]})}),("consent"===f||"submitting"===f&&w)&&w?(0,t.jsxs)(c.B,{mt:"xl",gap:"lg",children:[(0,t.jsxs)(d.F,{color:"green",variant:"light",radius:"md",icon:(0,t.jsx)(R,{size:19}),children:[P," is requesting access to your HuBrowser Membership account."]}),(0,t.jsxs)("div",{className:M.A.meta,children:[(0,t.jsx)(l.E,{fw:700,children:"Access requested"}),(0,t.jsx)(l.E,{c:"dimmed",size:"sm",mt:4,children:"Review what Follow Anywhere can access before continuing."}),q.length?(0,t.jsx)("ul",{className:M.A.scopeList,children:q.map(e=>(0,t.jsx)("li",{children:B[e]??e},e))}):(0,t.jsx)(l.E,{c:"dimmed",mt:"xs",children:"Basic account identity"}),Y?(0,t.jsxs)(l.E,{c:"dimmed",size:"sm",mt:"md",children:["After approval, you will return to"," ",Y,"."]}):null]}),C?(0,t.jsx)(d.F,{color:"red",variant:"light",radius:"md",icon:(0,t.jsx)(k.A,{size:18}),children:C}):null,(0,t.jsxs)(z,{className:M.A.actions,grow:!0,children:[(0,t.jsx)(g.$,{variant:"default",radiu
2s:"xl",size:"md",disabled:"submitting"===f,onClick:()=>void N("deny"),children:"Deny"}),(0,t.jsx)(g.$,{color:"dark",radius:"xl",size:"md",loading:"submitting"===f,onClick:()=>void N("approve"),children:"Allow"})]})]}):null,"error"===f?(0,t.jsx)(d.F,{mt:"xl",color:"red",variant:"light",radius:"md",icon:(0,t.jsx)(k.A,{size:18}),children:C}):null]})})}function T(){return(0,t.jsx)(S.y,{defaultColorScheme:"light",theme:{primaryColor:"dark",fontFamily:"var(--selfreason-body-font)",headings:{fontFamily:"var(--selfreason-heading-font)",fontWeight:"800"}},children:(0,t.jsx)(F,{})})}function G(e){return(0,t.jsx)(T,{})}function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:r}={...(0,n.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(G,{...e})}):G(e)}N.__RSPRESS_PAGE_META={},N.__RSPRESS_PAGE_META["oauth%2Fconsent.mdx"]={toc:[],title:"Authorize access | SelfReason",headingTitle:"",frontmatter:{pageType:"custom",title:"Authorize access | SelfReason",description:"Review and authorize access to your SelfReason account.",robots:"noindex, nofollow",search:!1}}}}]);
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.