{"version":3,"file":"SocialAuthOverride.CUbHDUTI.mjs","names":[],"sources":["https:/framerusercontent.com/modules/sxAvsVcZ58Rl3LOCwKP1/9wGqVCouLwpALKIrlzUq/SocialAuthOverride.js"],"sourcesContent":["// Code overrides for \"continue with Apple / Facebook / Google\". Put\n// each one on its Frame; a click starts Supabase OAuth for that\n// provider, which creates the account (or signs in if it already\n// exists) and comes back to your site.\n//\n// In Framer: Assets panel → Code → \"+\" → New code file → CODE (not\n// COMPONENT) → name it \"SocialAuthOverrides\". Requires the \"Supabase\"\n// code file.\n//\n//   withAppleSignIn     → on the Apple frame\n//   withFacebookSignIn  → on the Facebook frame\n//   withGoogleSignIn    → on the Google frame\n//\n// IMPORTANT — this only works once each provider is set up in Supabase:\n//   Supabase → Authentication → Providers → enable Apple / Facebook /\n//   Google and paste the Client ID + Secret from each provider's own\n//   developer console. Then Authentication → URL Configuration → add\n//   your site URL to Redirect URLs (e.g. https://tame-biscuits-260896\n//   .framer.app/**). Without that, clicking returns a provider error.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{RenderTarget}from\"framer\";import{supabase}from\"https://framerusercontent.com/modules/gNAOusK2oyA5xvs0YqKO/3TRer8xIhIzryQo4Y97x/Supabase.js\";// Where the visitor lands after the provider sends them back. Must be on\n// Supabase's Redirect URLs allowlist. Empty = back to the current page.\nconst OAUTH_REDIRECT=\"\";// Shared wrapper. Each override below is its own named function taking a\n// Component — Framer only lists exports it can see take a component, so\n// they must be written out explicitly (not returned from a factory).\nfunction withOAuth(Component,provider){return props=>{const onCanvas=RenderTarget.current()===RenderTarget.canvas;return /*#__PURE__*/_jsx(Component,{...props,onClick:async event=>{// The frame is usually wrapped in a link; don't let\n// it navigate before OAuth kicks in.\nevent?.preventDefault?.();event?.stopPropagation?.();if(onCanvas)return;const redirectTo=OAUTH_REDIRECT||(typeof window!==\"undefined\"?window.location.origin:undefined);const{error}=await supabase.auth.signInWithOAuth({provider,options:{redirectTo}});if(error){console.error(`${provider} sign-in failed:`,error.message);}},style:{...props.style,cursor:\"pointer\"}});};}export function withAppleSignIn(Component){return withOAuth(Component,\"apple\");}export function withFacebookSignIn(Component){return withOAuth(Component,\"facebook\");}export function withGoogleSignIn(Component){return withOAuth(Component,\"google\");}\nexport const __FramerMetadata__ = {\"exports\":{\"withFacebookSignIn\":{\"type\":\"reactHoc\",\"name\":\"withFacebookSignIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAppleSignIn\":{\"type\":\"reactHoc\",\"name\":\"withAppleSignIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoogleSignIn\":{\"type\":\"reactHoc\",\"name\":\"withGoogleSignIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SocialAuthOverride.map"],"mappings":"sNAwBA,SAAS,EAAU,EAAU,EAAS,CAAC,MAAO,IAAO,CAAC,IAAM,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAO,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,KAAM,IAAO,CAE/H,GAArD,GAAO,iBAAiB,EAAE,GAAO,kBAAkB,EAAK,EAAS,OAAO,IAAM,EAAmC,IAAS,OAAmC,IAAA,GAAvB,EAAO,SAAS,OAAuB,CAAC,SAAO,MAAM,EAAS,KAAK,gBAAgB,CAAC,WAAS,QAAQ,CAAC,YAAU,CAAC,CAAC,EAAK,GAAO,QAAQ,MAAM,GAAG,EAAS,kBAAkB,EAAM,OAAO,CAAG,EAAE,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,SAAS,CAAC,CAAC,CAAE,CAAE,CAAuK,SAAgB,EAAiB,EAAU,CAAC,OAAO,EAAU,EAAU,QAAQ,CAAE,qBAP5jB,IAAiC,IAAkH"}