PageSourceSearch

https://meetcoffee.ai/_next/static/chunks/24wakdo7ti34a.js

js meetcoffee.ai collected 2026-09-24 14:08:26 UTC 30,792 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,952357,e=>{"use strict";var r=e.i(271645);e.s(["useAuthFormAttempt",0,e=>{let t=(0,r.useRef)({key:e}),a=(0,r.useRef)(null),o=(0,r.useRef)({mounted:!1});return(0,r.useLayoutEffect)(()=>{t.current.key!==e&&(t.current={key:e})},[e]),(0,r.useLayoutEffect)(()=>{let e=o.current;return e.mounted=!0,()=>{e.mounted=!1}},[]),(0,r.useMemo)(()=>({start:()=>{if(a.current)return!1;let e=t.current,r=o.current,i=globalThis.location.href,s=globalThis.document.body?.dataset.userHash;return a.current=()=>r.mounted&&t.current===e&&globalThis.location.href===i&&globalThis.document.body?.dataset.userHash===s,!0},isCurrent:()=>a.current?.()===!0,isPending:()=>null!==a.current,finish:()=>{a.current=null}}),[])}])},178700,e=>{"use strict";var r=e.i(271645),t=e.i(119716),a=e.i(304825);let o=[0,100,500,1500,3e3],i=()=>{if(void 0===globalThis.window)return 0;let e=Number(globalThis.document?.documentElement?.dataset.coffeeSplashStartedAt||globalThis.__COFFEE_MOBILE_SPLASH_STARTED_AT__||0);return Number.isFinite(e)?e:0};e.s(["useStableInitialFocus",0,(e,s=!0)=>{let[n,l]=(0,r.useState)(()=>!(()=>{if(void 0===globalThis.window||globalThis.__COFFEE_NATIVE_SPLASH_HIDDEN__)return!1;let e=i();if(e<=0)return!1;let r=Date.now()-e;return r>=0&&r<12500})());return(0,r.useEffect)(()=>{let e;if(!s||void 0===globalThis.window||n)return;let r=()=>{l(!0)},a=globalThis.setTimeout(r,(e=i())<=0?0:Math.max(0,12500-(Date.now()-e)));return globalThis.addEventListener(t.NATIVE_SPLASH_HIDDEN_EVENT,r,{once:!0}),()=>{globalThis.clearTimeout(a),globalThis.removeEventListener(t.NATIVE_SPLASH_HIDDEN_EVENT,r)}},[s,n]),(0,r.useEffect)(()=>{if(!s||!n||void 0===globalThis.window)return;let r=()=>{let r,t=e.current;t&&((r=document.activeElement)===t||(0,a.canClaimFocusFrom)(r))&&t.focus({preventScroll:!0})};r();let t=o.map(e=>globalThis.setTimeout(r,e));return()=>{t.forEach(e=>{globalThis.clearTimeout(e)})}},[s,n,e]),s&&n}])},615539,365476,622949,e=>{"use strict";var r=e.i(843476),t=e.i(271645),a=e.i(949445),o=e.i(357534),i=e.i(329751),s=e.i(985902),n=e.i(80686),l=e.i(332944),c=e.i(741524),u=e.i(501890),h=e.i(669596),d=e.i(491375),p=e.i(104073),g=e.i(44753);let _=new Set(["localhost","127.0.0.1","::1"]),A={access_denied:"cancelled",oauth_identity_mismatch:"identity-mismatch",oauth_link_requires_signin:"link-signin-required",oauth_provider_error:"failed",oauth_signup_restart_required:"signup-restart-required"},f=e=>"string"==typeof e?A[e]:void 0,m=e=>f(e.error)?Object.fromEntries(Object.entries(e).filter(([e])=>"error"!==e)):e;e.s(["classifyOAuthCallbackFailure",0,f,"getOAuthCallbackFailureCleanUrl",0,e=>{try{let r=new URL(e,"https://coffee.local");if(!f(r.searchParams.get("error")))return;return r.searchParams.delete("error"),`${r.pathname}${r.search}${r.hash}`}catch{return}},"removeOAuthCallbackFailureParam",0,m],365476);var E=e.i(187471),v=e.i(206624),b=e.i(242588),P=e.i(119716),w=e.i(882558),L=e.i(701253),y=e.i(218062),C=e.i(435443),T=e.i(311942),U=e.i(27634),R=e.i(60147),N=e.i(152088),H=e.i(297355),O=e.i(952357),S=e.i(381029);let k=o.apiRoutes.oauth,Y=(0,u.authCopy)("continueApple"),D=new Set(["bridge_unavailable","google_credential_unsupported","google_exchange_failed","google_no_credential","google_signin_failed","google_signin_unavailable","invalid_google_signin_request","unknown_method"]),x=e=>e?"relative size-[3.25rem] min-w-[3.25rem] cursor-pointer overflow-hidden rounded-lg border border-[var(--color-google-button-border)] bg-[var(--color-fixed-light-background)] p-0 text-[var(--color-google-button-text)] shadow-xs transition-[color,background-color,border-color,box-shadow] hover:border-[var(--color-google-button-border)] hover:bg-[var(--color-fixed-light-background)]":"relative h-11 w-full min-w-[140px] cursor-pointer gap-2 overflow-hidden rounded-md border border-[color:color-mix(in_srgb,var(--color-text-primary)_16%,var(--color-border))] bg-background px-4 font-normal text-base text-[var(--color-text-primary)] shadow-none transition-[color,background-color,border-color,box-shadow] hover:border-[color:color-mix(in_srgb,var(--color-text-primary)_32%,var(--color-border))] hover:bg-[var(--color-surface-hover)] hover:shadow-xs",K=(e,r)=>{(0,T.reportClientIssue)(e,{source:`auth.oauth.nativeOpen.${r}`,level:"warning",dedupeKey:`auth.oauth.nativeOpen.${r}`})},I=()=>
1globalThis.window.webkit?.messageHandlers?.coffeeAppleSignIn,j=e=>{if(!e||"object"!=typeof e||Array.isArray(e)||1!==Object.keys(e).length)return;let r=e.response;if(!(!r||"object"!=typeof r||Array.isArray(r))&&!(2!==Object.keys(r).length||"number"!=typeof r.status||!Number.isInteger(r.status)||r.status<200||r.status>599||!r.payload||"object"!=typeof r.payload||Array.isArray(r.payload)))return{payload:r.payload,status:r.status}},F=e=>!!(e&&"object"==typeof e&&!Array.isArray(e)&&1===Object.keys(e).length&&!0===e.cancelled),B=(e,r,t)=>{let a=new URL(e),o=a.searchParams.getAll("guest");if(a.username||a.password||a.hash||a.pathname!==l.routeNames.auth.appAuthCallback||1!==o.length||"true"!==o[0]&&"false"!==o[0]||!c.APP_AUTH_STATE_PATTERN.test(r)||!c.APP_AUTH_CODE_CHALLENGE_PATTERN.test(t))throw Error("Native OAuth callback is not canonical.");let i=o[0];return a.search="",a.searchParams.set(c.APP_AUTH_QUERY_KEY,"true"),a.searchParams.set(c.APP_AUTH_HANDLER_QUERY_KEY,(0,c.getAppAuthHandler)()),a.searchParams.set(c.APP_AUTH_PKCE_QUERY_KEY,"1"),a.searchParams.set(c.APP_AUTH_CODE_CHALLENGE_QUERY_KEY,t),a.searchParams.set(c.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY,"S256"),a.searchParams.set("redirectURL",l.routeNames.auth.appAuthCallback),a.searchParams.set("guest",i),a.searchParams.set("state",r),a.toString()};class G extends Error{status;constructor(e,r){super(e),this.status=r}get shouldFallBackToBrowser(){return this.status>=500}}let Q=({attempt:e,expectedRedirectUrl:r,payload:t,providerLabel:a,status:o})=>{if(!(o>=200&&o<300)||!0!==t.success){let e=!1===t.success?t.errors?.[0]?.message:void 0;if(e)throw new G(e,o);throw Error(`Coffee could not complete ${a}.`)}if(t.data.isExists&&t.data.login_data?.redirect_url){let o=(0,E.resolveNativeAppleLoginRedirect)({expectedCodeChallenge:e.codeChallenge,expectedRedirectUrl:r,expectedState:e.state,rawRedirectUrl:t.data.login_data.redirect_url});if(!o)throw Error(`Coffee returned an invalid ${a} destination.`);globalThis.location.assign(o);return}if(!t.data.isExists&&t.data.signup_data){var i,s,n;let o,u,h,d,p;
1if(!(0,E.isExactNativeAppleSignupRedirect)({expectedCodeChallenge:e.codeChallenge,expectedRedirectUrl:r,expectedState:e.state,rawRedirectUrl:t.data.signup_data.redirect_url}))throw Error(`Coffee returned an invalid ${a} signup destination.`);globalThis.location.assign((i=t.data.signup_data,s=e.state,n=e.codeChallenge,o=new URL(i.redirect_url),u={email:i.email,first_name:i.first_name,last_name:i.last_name,origin:i.origin,type:"oauth",app:"true",app_handler:(0,c.getAppAuthHandler)(),[c.APP_AUTH_PKCE_QUERY_KEY]:"1",[c.APP_AUTH_CODE_CHALLENGE_QUERY_KEY]:n,[c.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY]:"S256",redirectURL:o.pathname,state:s},h=new URL(l.routeNames.auth.signUp,o).toString(),d=H.default.stringify(u),p=H.default.stringify({...u,t:i.t}),`${h}?${d}#${l.routeNames.auth.signUp}?${p}`));return}throw Error(`Coffee received an incomplete ${a} response.`)},$=async e=>{let r=globalThis.window.Capacitor?.Plugins?.AppLauncher;if("function"!=typeof r?.openUrl)return!1;try{let t=await r.openUrl({url:e});return t?.completed!==!1}catch(e){return K(e,"appLauncher"),!1}},M=async(e,r)=>!!(0,c.isCapacitorNative)()&&(!!await (0,y.openNativeOAuthBrowser)({authState:r,options:{url:e,toolbarColor:a.COFFEE_NATIVE_SPLASH_COLOR,presentationStyle:"fullscreen"},onFinished:()=>{globalThis.dispatchEvent(new Event(P.APP_AUTH_BROWSER_FINISHED_EVENT))}})||$(e)),V=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.OAuthProviderIcon,{provider:"Apple"}),(0,r.jsx)("span",{className:"truncate",children:Y})]}),q=async({oauthOrigin:e,onPreparingChange:r,isCurrent:t,query:a})=>{let o;r(!0);try{let i=a?.redirect_url;if(!a||!i)throw Error("Google sign-in redirect is unavailable.");let s=await (0,w.prepareAppAuthLaunch)({browserHandoff:!1});if(o=s.state,!t())return(0,w.clearAppAuthLaunch)(s.state),r(!1),!0;let n=B(i,s.state,s.codeChallenge),l=await (0,L.requestCoffeeNative)("auth.googleSignIn",(({attempt:e,boundRedirectUrl:r,oauthOrigin:t,query:a})=>({endpoint:new URL(k.googleNative,t).toString(),nonce:e.state,redirectUrl:r,...void 0===a.isGuest?{}:{isGuest:a.isGuest},...a.subdomain?{subdomain:a.subdomain}:{}}))({attempt:s,boundRedirectUrl:n,oauthOrigin:e,query:a}));if(!t())return(0,w.clearAppAuthLaunch)(s.state),r(!1),!0;if(void 0===l)return(0,w.clearAppAuthLaunch)(s.state),!1;if(F(l))return(0,w.clearAppAuthLaunch)(s.state),r(!1),!0;let c=j(l);if(!c)throw Error("Coffee received an incomplete Google sign-in response.");if("boolean"!=typeof c.payload.success)return(0,w.clearAppAuthLaunch)(s.state),K(Error(`Google native exchange returned a non-Coffee response (HTTP ${c.status}).`),"googleFallback"),!1;return Q({attempt:s,expectedRedirectUrl:n,payload:c.payload,providerLabel:"Google sign-in",status:c.status}),!0}catch(e){var s;if(!t())return o&&(0,w.clearAppAuthLaunch)(o),r(!1),!0;return((s=o)&&(0,w.clearAppAuthLaunch)(s),e instanceof L.CoffeeNativeBridgeError&&"google_signin_busy"===e.code)?(r(!1),!0):e instanceof L.CoffeeNativeBridgeError&&D.has(e.code)||e instanceof G&&e.shouldFallBackToBrowser?(K(e,"googleFallback"),!1):(K(e,"google"),(0,i.showErrorToast)(e instanceof G?e.message:(0,u.authCopy)("googleSignIn")),r(!1),!0)}},W=async({href:e,onPreparingChange:r,isCurrent:t})=>{let a;try{let o=await (0,w.prepareAppAuthLaunch)();if(a=o.state,!t())return(0,w.clearAppAuthLaunch)(o.state),r(!1),null;return{href:((e,r)=>{let t=new URL(e);t.searchParams.set("state",r.state);let a=t.searchParams.get("redirect_url");if(!a)throw Error("Native OAuth redirect is missing.");return t.searchParams.set("redirect_url",B(a,r.state,r.codeChallenge)),t.toString()})(e,o),nativeAttemptState:a}}catch(e){if(a&&((0,w.clearAppAuthLaunch)(a),globalThis.dispatchEvent(new Event(P.APP_AUTH_LAUNCH_CANCELLED_EVENT))),!t())return null;return K(e,"preparePkce"),(0,i.showErrorToast)((0,u.authCopy)("startSecureSignIn")),r(!1),null}},z=async({browserAppAuthBinding:e,href:r,isAppLoginFlow:t=!1,onPreparingChange:a,isCurrent:o,secureNativeHandoff:s})=>{if(s)return await W({href:r,onPreparingChange:a,isCurrent:o});if(e)try{return{href:((e,r)=>{let t=new URL(e);t.searchParams.set("state",r.state);let a=t.searchParams.get("redirect_url");
1if(!a)throw Error("Native OAuth redirect is missing.");let o=new URL(a),i=o.searchParams.getAll("guest");if(o.username||o.password||o.hash||o.pathname!==l.routeNames.auth.appAuthCallback||1!==i.length||"true"!==i[0]&&"false"!==i[0])throw Error("Native OAuth callback is not canonical.");let s=i[0];return o.search="",o.searchParams.set(c.APP_AUTH_QUERY_KEY,"true"),o.searchParams.set(c.APP_AUTH_HANDLER_QUERY_KEY,r.app_handler),o.searchParams.set(c.APP_AUTH_PKCE_QUERY_KEY,"1"),o.searchParams.set(c.APP_AUTH_CODE_CHALLENGE_QUERY_KEY,r.code_challenge),o.searchParams.set(c.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY,"S256"),o.searchParams.set("redirectURL",l.routeNames.auth.appAuthCallback),o.searchParams.set("guest",s),o.searchParams.set("state",r.state),r.refresh_delivery_challenge&&(o.searchParams.set(c.APP_AUTH_REFRESH_DELIVERY_CHALLENGE_QUERY_KEY,r.refresh_delivery_challenge),o.searchParams.set(c.APP_AUTH_REFRESH_DELIVERY_CHALLENGE_METHOD_QUERY_KEY,"S256")),t.searchParams.set("redirect_url",o.toString()),t.toString()})(r,e)}}catch(e){return K(e,"browserAppAuthBinding"),(0,i.showErrorToast)((0,u.authCopy)("startSecureSignIn")),a(!1),null}return t?(K(Error("Browser app-auth launch has no PKCE binding."),"missingBrowserBinding"),(0,i.showErrorToast)((0,u.authCopy)("startSecureSignIn")),a(!1),null):{href:r}},Z=async({browserAppAuthBinding:e,href:r,isAppLoginFlow:t=!1,onPreparingChange:a,isCurrent:o,secureNativeHandoff:s})=>{if(!o())return;if(a(!0),(0,U.isElectron)()&&!e&&(0,C.requestDesktopWorkspaceLogin)())return void a(!1);let n=await z({browserAppAuthBinding:e,href:r,isAppLoginFlow:t,onPreparingChange:a,isCurrent:o,secureNativeHandoff:s});if(!n||!o())return;let{href:l,nativeAttemptState:h}=n;try{if((0,U.isElectron)())window.open(l,"_blank"),a(!1);else if(await M(l,h))a(!1);else if(s||(0,c.isCapacitorNative)())throw Error("The system sign-in browser is unavailable.");else globalThis.location.href=l}catch(e){if(s&&((0,w.clearAppAuthLaunch)(h),globalThis.dispatchEvent(new Event(P.APP_AUTH_LAUNCH_CANCELLED_EVENT))),!o())return;K(e,"handoff"),(0,i.showErrorToast)((0,u.authCopy)("openSignIn")),a(!1)}},J=({authOption:e,browserAppAuthBinding:t,disabled:a,iconOnly:o,isAppLoginFlow:i,nativeSignIn:n,onSelect:l,onPreparingChange:c,isCurrent:u,secureNativeHandoff:h})=>{let d;d=o?(0,r.jsx)(S.OAuthProviderIcon,{provider:e.label}):"Apple"===e.label?(0,r.jsx)(V,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.OAuthProviderIcon,{provider:e.label}),(0,r.jsx)("span",{className:"truncate",children:e.actionLabel})]});let p=async()=>{void 0===globalThis.window||!u()||n&&await n()||u()&&await Z({browserAppAuthBinding:t,href:e.href,isAppLoginFlow:i,onPreparingChange:c,isCurrent:u,secureNativeHandoff:h})};return(0,r.jsx)(s.Button,{type:"button",variant:"unstyled",size:"unstyled",className:x(o),disabled:e.disabled||a,"aria-label":e.actionLabel,title:o?e.actionLabel:void 0,onClick:()=>{l?.()!==!1&&p()},children:d})},X=({browserAppAuthBinding:e,browserHref:t,disabled:a,iconOnly:o,isAppLoginFlow:n,oauthOrigin:l,onSelect:c,onPreparingChange:u,isCurrent:h,query:d,secureNativeHandoff:p})=>{let g=async()=>{let r;if(void 0!==globalThis.window){u(!0);try{let e=I();if(!e)throw Error("Native Sign in with Apple is unavailable.");let t=d?.redirect_url;if(!d||!t)throw Error("Sign in with Apple redirect is unavailable.");let a=await (0,w.prepareAppAuthLaunch)({browserHandoff:!1});if(r=a.state,!h()){(0,w.clearAppAuthLaunch)(a.state),u(!1);return}let o=B(t,a.state,a.codeChallenge),i=await e.postMessage((({endpoint:e,isGuest:r,nonce:t,redirectUrl:a,subdomain:o})=>({nonce:t,request:{endpoint:e,redirectUrl:a,...void 0===r?{}:{isGuest:r},...o?{subdomain:o}:{}}}))({endpoint:new URL(k.appleNative,l).toString(),isGuest:d.isGuest,nonce:a.state,redirectUrl:o,subdomain:d.subdomain}));if(!h()||F(i)){(0,w.clearAppAuthLaunch)(a.state),u(!1);return}let s=j(i);if(s)return void Q({attempt:a,expectedRedirectUrl:o,payload:s.payload,providerLabel:"Sign in with Apple",status:s.status});throw Error("Apple returned an incomplete native exchange response.")}catch(a){if((r&&(0,w.clearAppAuthLaunch)(r),!h()||a instanceof Error&&"apple_signin_busy"===a.message)?(u(!1),!0):a instanceof G&&!a.shouldFallBackToBrowser&&((a.status<400||a.status>=500)&&K(a,"apple"),(0,i.showErrorToast)(a.message),u(!1),!0))return;K(a,"appleFallback"),await Z({browserAppAuthBinding:e,href:t,isAppLoginFlow:n,onPreparingChange:u,isCurrent:h,secureNativeHandoff:p})}}};return(0,r.jsx)(s.Button,{variant:"unstyled",size:"unstyled",type:"button",className:x(o),disabled:a,"aria-label":Y,title:o?Y:void 0,onClick:()=>{c?.()!==!1&&g()},children:o?(0,r.jsx)(S.OAuthProviderIcon,{provider:"Apple"}):(0,r.jsx)(V,{})})};e.s(["NewAuthSocialLinks",0,({children:e,guest:a=!1,disabled:i=!1,compact:s=!1,layout:A="full",lastUsedLabel:f="Last used",onPreparingChange:E})=>{let{data:P}=(0,n.useApp)(),w=(0,R.useLocation)(),y=(({backendBaseUrl:e,isDevelopment:r=!1,pageOrigin:t,productRoot:a,workspace:o})=>
1{let i=(0,g.resolveWorkspaceNavDomain)(o),s=i?(0,g.normalizeWorkspaceSubdomain)(o?.subdomain):void 0,n=(({backendBaseUrl:e,isDevelopment:r,pageOrigin:t})=>{if(r&&e&&t)try{let r=new URL(t),a=new URL(e),o=(0,p.getAuthControlledRootDomainForHostname)(a.hostname),i=r.origin===t,s=a.origin===e,n=i&&_.has(r.hostname.toLowerCase().replace(/^\[|\]$/gu,""))&&("http:"===r.protocol||"https:"===r.protocol),l=s&&"https:"===a.protocol&&(!a.port||"443"===a.port)&&"meetcoffee.dev"===o;return n&&l?{redirectOrigin:r.origin,rootDomain:o}:void 0}catch{return}})({backendBaseUrl:e,isDevelopment:r,pageOrigin:t}),l=i??n?.rootDomain??(0,p.getAuthControlledRootDomainForProductRoot)(a??(0,p.getCurrentRootDomain)()),c=s?`${s}.`:"",u=(e=>{if(e)try{let r=new URL(e);return"https:"!==r.protocol||r.origin!==e||r.username||r.password||r.port&&"443"!==r.port?void 0:r}catch{return}})(t),h=(e=>{let r=e?.trim().toLowerCase().replace(/^https?:\/\//iu,"").replace(/\/$/u,"");if(!(!r||/[/@?#:]/u.test(r)))try{let e=new URL(`https://${r}`);return e.hostname===r&&e.origin===`https://${r}`?r:void 0}catch{return}})(o?.custom_domain),d=u&&h===u.hostname.toLowerCase()?u.origin:void 0,A=d??((e,r)=>{if(!e||(0,p.getKnownRootDomainForHostname)(e.hostname))return;if(!r)return e.origin;let t=r.trim().toLowerCase();if((0,p.getKnownRootDomainForHostname)(t)!==t)return;let a=e.hostname.toLowerCase();return a===t||a.endsWith(`.${t}`)?void 0:e.origin})(u,a),f=d??(l===n?.rootDomain?n.redirectOrigin:A);return{origin:`https://${c}${l}`,...f?{redirectOrigin:f}:{},...A?{startOrigin:A}:{},...s?{subdomain:s}:{}}})({backendBaseUrl:"https://meetcoffee.ai",isDevelopment:!1,pageOrigin:void 0===globalThis.window?void 0:globalThis.location.origin,productRoot:P?.console_project?.domain,workspace:P?.workspace}),C=y.redirectOrigin??y.origin,T=y.startOrigin??((e,r)=>{try{let r=e?new URL(e):void 0;if(r?.protocol==="https:"&&r.origin===e?.replace(/\/$/u,"")&&(0,p.isCanonicalCoffeeAuthAuthorityHostname)(r.hostname))return r.origin}catch{}try{let e=new URL(r),t=(0,p.getAuthControlledRootDomainForHostname)(e.hostname);return t?`https://${t}`:r}catch{return r}})("https://meetcoffee.ai",y.origin),S=y.subdomain,D=(0,U.isElectron)(),x=(0,c.isCapacitorNative)()||(0,c.isAppAuthFlow)(w.searchObj),K=(0,c.isCapacitorNative)(),j=(0,c.readBrowserAppAuthBinding)(w.searchObj),F=(0,O.useAuthFormAttempt)(JSON.stringify([w.pathname,w.searchObj,T])),[B,G]=(0,t.useState)(!1),[Q,$]=(0,t.useState)(!1),[M,V]=(0,t.useState)(),W=(0,t.useCallback)(e=>{if(!F.isCurrent()){e||F.finish();return}G(e),E?.(e),e||F.finish()},[F,E]),z=Q&&(0,c.isNativeIosApp)(),Z=Q&&(0,c.isNativeAndroidApp)(),ee=Q&&"function"==typeof I()?.postMessage,er=(({hasMounted:e,hasNativeHandler:r,isNativeIos:t})=>e?t&&r?"native":"oauth":"deferred")({hasMounted:Q,hasNativeHandler:ee,isNativeIos:z}),et=(({hasMounted:e,hasNativeBridge:r,isNativeAndroid:t,nativeVersion:a})=>e?t&&r&&1===a?"native":"oauth":"deferred")({hasMounted:Q,hasNativeBridge:Q&&(0,L.hasCoffeeNativeMessageBridge)(),isNativeAndroid:Z,nativeVersion:Q?(()=>{try{return globalThis.window?.__COFFEE_NATIVE_GOOGLE_SIGN_IN_VERSION__}catch{return}})():void 0});(0,t.useEffect)(()=>{$(!0),V((0,h.readLastUsedOAuthProvider)())},[]);let ea=(0,t.useCallback)(e=>!!F.start()&&((0,h.stampPendingOAuthProvider)(e),!0),[F]),eo=(0,t.useMemo)(()=>{let e,r=!!S,t=r?l.routeNames.panel.dashboard:l.routeNames.workspace.select,i=!(0,d.isNotImportantLocation)(w.pathname)&&(r||(0,o.isPreservableOAuthRedirectPath)(w.pathname)),s=i?w.pathname:t,n=x?l.routeNames.auth.appAuthCallback:s,{safeSearchRedirect:u,searchWithoutRedirect:h}=(e=>{let{redirectURL:r,...t}=m((0,v.removeOAuthTransientParams)(void 0===globalThis.window?{}:H.default.parse(globalThis.location.search))),a={};for(let[e,r]of Object.entries(t))"string"==typeof r||null===r?a[e]=r:Array.isArray(r)&&r.every(e=>"string"==typeof e||null===e)&&(a[e]=r);return{safeSearchRedirect:"string"==typeof r?(0,b.sanitizeInternalRedirect)(r,{currentPath:e+(void 0===globalThis.window?"":`${globalThis.location.search}${globalThis.location.hash}`)}):void 0,searchWithoutRedirect:a}})(w.pathname),p=(e=(e=>{if(e)try{return new URL(e,"https://coffee.local").pathname}catch{return}})(u))&&(0,o.isPreservableOAuthRedirectPath)(e)?u:void 0,g=H.default.stringifyUrl({url:w.pathname,query:h}),_=(({appHandler:e,isAppLoginFlow:r,nestedRedirectUrl:t,pathname:a,searchObj:o,shouldPreserveCurrentPath:i})=>{if(r){let r=e??(0,c.getAppAuthHandler)(o);if(!r)throw Error("Native OAuth requires an explicit callback handler.");return{[c.APP_AUTH_QUERY_KEY]:"true",[c.APP_AUTH_HANDLER_QUERY_KEY]:r,redirectURL:l.routeNames.auth.appAuthCallback}}return i?{redirectURL:a}:t?{redirectURL:t}:{}})({appHandler:D?c.DESKTOP_APP_AUTH_HANDLER:K?c.MOBILE_APP_AUTH_HANDLER:void 0,isAppLoginFlow:x,nestedRedirectUrl:p,pathname:g,searchObj:w.searchObj,shouldPreserveCurrentPath:i}),A=H.default.stringifyUrl({url:C?C+n:"",query:{...x?{}:h,..._,...!x&&n===l.routeNames.workspace.select?{redirectToFirstAccount:!0}:{},guest:a}});return{isGuest:a,redirect_url:A,...S?{subdomain:S}:{}}},[a,x,D,w.pathname,w.searchObj,C,K,S]),ei=[{label:"Apple",actionLabel:Y,href:k.apple},{label:"Google",actionLabel:(0,u.authCopy)("continueGoogle"),href:k.google},{label:"Microsoft",actionLabel:(0,u.authCopy)("continueMicrosoft"),href:k.microsoft}].map(e=>
1{let r=void 0===globalThis.window?"":new URL(e.href,globalThis.location.origin).toString();return{...e,href:H.default.stringifyUrl({url:T?new URL(e.href,T).toString():r,...void 0===eo?{}:{query:eo}})}}),es=ei.find(e=>"Apple"===e.label)?.href,en="icons"===A,el=(e,t)=>en?(0,r.jsxs)("div",{className:"grid w-[3.25rem] grid-rows-[3.25rem_1rem] justify-items-center gap-y-1.5",children:[t,(0,r.jsx)("span",{className:"whitespace-nowrap text-2xs text-muted-foreground leading-4",children:M===e?f:""})]},e):t;return(0,r.jsxs)("div",{className:(0,N.cn)(en?"flex items-start justify-center gap-3.5":"grid grid-cols-1 gap-3",s&&"gap-2"),"data-social-login-layout":A,"aria-busy":B||void 0,children:["native"===er&&es&&el("Apple",(0,r.jsx)(X,{browserAppAuthBinding:j,browserHref:es,disabled:i||B,iconOnly:en,isAppLoginFlow:x,oauthOrigin:T,onSelect:()=>ea("Apple"),onPreparingChange:W,isCurrent:F.isCurrent,query:eo,secureNativeHandoff:K})),ei.filter(e=>{let r;return"Apple"!==e.label||(r=!!es,"native"!==er||!r)}).map(e=>el(e.label,(0,r.jsx)(J,{browserAppAuthBinding:j,disabled:i||B||!Q,authOption:e,iconOnly:en,isAppLoginFlow:x,nativeSignIn:"Google"===e.label&&"native"===et?()=>q({oauthOrigin:T,onPreparingChange:W,isCurrent:F.isCurrent,query:eo}):void 0,onSelect:()=>ea(e.label),onPreparingChange:W,isCurrent:F.isCurrent,secureNativeHandoff:K},e.label))),e]})}],615539);var ee=e.i(151895),er=e.i(362314),et=e.i(733103),ea=e.i(487174);let eo=e=>{let r=Error(e[0]?.message??"Check email failed"),t=Object.assign(e,{name:"CheckEmailError",message:r.message});return r.stack&&(t.stack=r.stack),t};e.s(["useCheckEmailAPI",0,e=>(0,er.useMutation)(async e=>{try{return await (0,et.callContractDataFlat)(ee.checkEmailContract,e)}catch(e){var r;return Array.isArray(r=(0,ea.getApiErrors)(e)??e)?Promise.reject(eo(r)):Promise.reject(r instanceof Error?r:eo([]))}},e)],622949)},381029,e=>{"use strict";var r=e.i(843476),t=e.i(152088);let a={Apple:{src:"/assets/svg/brands/reicon/apple.svg",className:"size-5 invert"},Google:{src:"/assets/svg/brands/reicon/google.svg",className:"size-[18px]"},Microsoft:{src:"/assets/svg/brands/reicon/microsoft.svg",className:"size-5"}},o=({provider:e,className:o})=>{let i=a[e];return(0,r.jsx)("img",{alt:"","aria-hidden":"true",className:(0,t.cn)(i.className,o),draggable:!1,src:i.src})};e.s(["OAuthProviderIcon",0,({provider:e})=>(0,r.jsx)("span",{className:"flex h-full w-[31px] shrink-0 items-center justify-center","aria-hidden":"true",children:(0,r.jsx)(o,{provider:e})}),"OAuthProviderMark",0,o])},669596,e=>{"use strict";let r="coffee:oauth-provider-attempt",t="coffee:last-oauth-provider",a=e=>"Apple"===e||"Google"===e||"Microsoft"===e;e.s(["clearPendingOAuthProvider",0,()=>{try{globalThis.sessionStorage.removeItem(r)}catch{}},"promotePendingOAuthProvider",0,()=>{try{let e=globalThis.sessionStorage.getItem(r);if(!a(e))return;globalThis.sessionStorage.removeItem(r),globalThis.localStorage.setItem(t,e)}catch{}},"readLastUsedOAuthProvider",0,()=>{try{let e=globalThis.localStorage.getItem(t);return a(e)?e:void 0}catch{return}},"stampPendingOAuthProvider",0,e=>{try{globalThis.sessionStorage.setItem(r,e)}catch{}}])},187471,e=>{"use strict";var r=e.i(357534),t=e.i(741524);let a=/^[A-Za-z0-9_-]{48}$/u,o=[t.APP_AUTH_QUERY_KEY,t.APP_AUTH_HANDLER_QUERY_KEY,t.APP_AUTH_PKCE_QUERY_KEY,t.APP_AUTH_CODE_CHALLENGE_QUERY_KEY,t.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY,"redirectURL","guest","state"],i=new Set([t.APP_AUTH_QUERY_KEY,t.APP_AUTH_HANDLER_QUERY_KEY,t.APP_AUTH_PKCE_QUERY_KEY,t.APP_AUTH_CODE_CHALLENGE_QUERY_KEY,t.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY,"refresh_delivery_challenge","refresh_delivery_challenge_method","redirectURL","state"]),s=new Set([t.APP_AUTH_PKCE_QUERY_KEY,t.APP_AUTH_CODE_CHALLENGE_QUERY_KEY,t.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY,"refresh_delivery_challenge","refresh_delivery_challenge_method","state"]),n=e=>{if(!e)return new URLSearchParams;let r=new Set;for(let t of e.split("&")){let e=t.indexOf("="),a=-1===e?t:t.slice(0,e);if(!/^[A-Za-z]\w*$/u.test(a)||r.has(a))return;r.add(a)}let t=new URLSearchParams(e);return Array.from(t.keys()).length===r.size?t:void 0},l=(e,r)=>{let t=Array.from(e.entries()).sort(([e],[r])=>e.localeCompare(r)),a=Array.from(r.entries()).sort(([e],[r])=>e.localeCompare(r));return t.length===a.length&&t.every(([e,r],t)=>e===a[t]?.[0]&&r===a[t]?.[1])},c=(e,r,a)=>{let i=n(e.search.startsWith("?")?e.search.slice(1):e.search),s=i?Array.from(i.keys()).sort((e,r)=>e.localeCompare(r)):[],l=[...o].sort((e,r)=>e.localeCompare(r));return!!(i&&s.length===l.length&&s.every((e,r)=>e===l[r])&&!e.username&&!e.password&&!e.hash&&"/app-auth-callback"===e.pathname&&"true"===i.get(t.APP_AUTH_QUERY_KEY)&&i.get(t.APP_AUTH_HANDLER_QUERY_KEY)===t.MOBILE_APP_AUTH_HANDLER&&"1"===i.get(t.APP_AUTH_PKCE_QUERY_KEY)&&i.get(t.APP_AUTH_CODE_CHALLENGE_QUERY_KEY)===a&&"S256"===i.get(t.APP_AUTH_CODE_CHALLENGE_METHOD_QUERY_KEY)&&"/app-auth-callback"===i.get("redirectURL")&&("true"===i.get("guest")||"false"===i.get("guest"))&&i.get("state")===r&&t.APP_AUTH_STATE_PATTERN.test(r)&&t.APP_AUTH_CODE_CHALLENGE_PATTERN.test(a))},u=new Set(["access_token","app_auth_code","oauth_totp_code","refresh_token","token","user_hash","userhash"]);e.s(["isExactNativeAppleSignupRedirect",0,({expectedCodeChallenge:e,expectedRedirectUrl:r,expectedState:t,rawRedirectUrl:a})=>{try{let o=new URL(r),i=new URL(a),s=n(o.search.startsWith("?")?o.search.slice(1):o.search),u=n(i.search.startsWith("?")?i.search.slice(1):i.search);return!!(s&&u&&("https:"===o.protocol||"http:"===o.protocol)&&i.protocol===o.protocol&&i.origin===o.origin&&!i.username&&!i.password&&!i.hash&&c(o,t,e)&&c(i,t,e)&&l(u,s))}catch{return!1}},"resolveNativeAppleLoginRedirect",0,({expectedCodeChallenge:e,expectedRedirectUrl:r,expectedState:o,rawRedirectUrl:u})=>{let h,d;try{h=new URL(r),d=new URL(u)}catch{return}if("https:"!==h.protocol&&"http:"!==h.protocol||d.protocol!==h.protocol||d.origin!==h.origin||d.username||d.password||!c(h,o,e))return;let p=n(d.search.startsWith("?")?d.search.slice(1):d.search),g=n(d.hash.startsWith("#")?d.hash.slice(1):d.hash);if(!p||!g)return;let _=new URLSearchParams(h.search);if("/app-auth-callback"===d.pathname){for(let e of s)_.delete(e);
1if(!l(p,_)||"app_auth_code,app_pkce,state"!==Array.from(g.keys()).sort((e,r)=>e.localeCompare(r)).join(",")||!t.APP_AUTH_CALLBACK_CODE_PATTERN.test(g.get("app_auth_code")??"")||"1"!==g.get("app_pkce")||g.get("state")!==o)return;return d.toString()}if("/confirm"===d.pathname){let e=new URLSearchParams;if(_.forEach((r,t)=>{i.has(t)&&e.set(t,r)}),!l(p,e)||"oauth_totp_code"!==Array.from(g.keys()).join(",")||!a.test(g.get("oauth_totp_code")??"")||p.get("state")!==o)return;return d.toString()}},"resolveOAuthTotpCompletionRedirect",0,({currentOrigin:e,expectedRedirectUrl:t,rawRedirectUrl:a})=>{let o,i,s,c;try{o=new URL(e),i=new URL(t),s=new URL(a)}catch{return}if(o.origin!==e||"https:"!==o.protocol&&"http:"!==o.protocol||i.origin!==o.origin||s.origin!==o.origin||i.protocol!==o.protocol||s.protocol!==o.protocol||i.username||i.password||s.username||s.password||(c=i.pathname,!((0,r.isPreservableOAuthRedirectPath)(c)||r.OAUTH_COMPLETION_CHOOSER_PATHS.some(e=>c===e||c.startsWith(`${e}/`))))||s.pathname!==i.pathname||i.hash||s.hash)return;let h=n(i.search.startsWith("?")?i.search.slice(1):i.search),d=n(s.search.startsWith("?")?s.search.slice(1):s.search);if(!(!h||!d||!l(d,h)||1!==h.getAll("state").length||!h.get("state")||1!==h.getAll("user").length||!h.get("user")||Array.from(h.keys()).some(e=>u.has(e))))return s.toString()}])},218062,e=>{"use strict";let r,t;var a=e.i(741524),o=e.i(311942);let i=(e,r)=>{(0,o.reportClientIssue)(e,{source:`capacitor.nativeOAuthBrowser.${r}`,level:"warning",dedupeKey:`capacitor.nativeOAuthBrowser.${r}`})},s=()=>void 0,n=()=>{try{let e;if(!(0,a.isCapacitorNative)()||!((e=globalThis.window?.Capacitor)&&("function"!=typeof e.isPluginAvailable||e.isPluginAvailable("Browser"))))return Promise.resolve(void 0)}catch(e){return i(e,"nativeDetection"),Promise.resolve(void 0)}return r??=e.A(875192).then(e=>{let r;return r=e.Browser,{addFinishedListener:e=>r.addListener("browserFinished",e).then(e=>({remove:()=>Promise.resolve(e.remove()).then(s)})),close:()=>Promise.resolve(r.close()).then(s),open:e=>Promise.resolve(r.open(e)).then(s)}}).catch(e=>{r=void 0,i(e,"load")})},l=Promise.resolve(),c=e=>{let r=l.then(e);return l=r.then(s,s),r},u=async e=>{try{await e.close()}catch(r){let e=r instanceof Error?r.message:String(r);if(!e.includes("No active window to close")&&!/["']?Browser["']? plugin is not implemented on (?:ios|android)|Browser plugin is unavailable/i.test(e))throw r}},h=async(e,r)=>{let t=e.listener;if(e.listener=void 0,t)try{await t.remove()}catch(e){i(e,r)}};e.s(["closeNativeOAuthBrowser",0,e=>{let r=t;return void 0!==e&&r&&r.authState!==e?Promise.resolve():(t=void 0,c(async()=>{r&&await h(r,"successfulCallbackListenerCleanup");let e=await n();if(e)try{await u(e)}catch(e){i(e,"close")}}))},"openNativeOAuthBrowser",0,({authState:e,onFinished:r,options:a})=>{let o=t,s={authState:e};return t=s,c(async()=>{try{if(o&&await h(o,"replaceListener"),t!==s)return!0;let e=await n();if(t!==s)return!0;if(!e)return t=void 0,!1;if(o&&await u(e),t!==s)return!0;let l=await e.addFinishedListener(()=>{if(t===s){t=void 0;try{r()}catch(e){i(e,"finishedCallback")}h(s,"finishedListenerCleanup")}});if(s.listener=l,t!==s)return await h(s,"supersededListenerCleanup"),!0;return await e.open(a),!0}catch(r){let e=t!==s;return e||(t=void 0),await h(s,"failedOpenListenerCleanup"),i(r,"open"),e}})}])},531140,e=>{"use strict";var r=e.i(151895),t=e.i(362314),a=e.i(733103),o=e.i(487174);e.s(["useGenerateOTPAPI",0,e=>(0,t.useMutation)(async e=>{try{return await (0,a.callContractData)(r.generateOTPContract,{body:{email:e.email,cause:e.cause,temp_token:e.temp_token},config:{timeout:15e3}})}catch(e){return(0,o.rejectQueryError)(e)}},e)])}]);

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.