1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7564],{67564:function(e,t,n){n.d(t,{createClient:function(){return p}});var o=n(71809);let a=null,r=!1,l=!1,s=0;function i(){try{var e;return(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("lh_debug_auth"))==="1"}catch(e){return!1}}function c(){let e=window.location.hostname.split(".");if(e.length>=2){let t=e.slice(-2).join(".");return".".concat(t)}}function u(){let e=Date.now();if(l&&e-s<5e3)return i()&&console.log("[Supabase] Skipping storage clear - rate limited (already cleared recently)"),!1;l=!0,s=e;let t=[];for(let e=0;e<localStorage.length;e++){let n=localStorage.key(e);n&&(n.startsWith("sb-")||n.includes("supabase"))&&t.push(n)}t.forEach(e=>localStorage.removeItem(e));let n=[];for(let e=0;e<sessionStorage.length;e++){let t=sessionStorage.key(e);t&&(t.startsWith("sb-")||t.includes("supabase"))&&n.push(t)}for(let e of(n.forEach(e=>sessionStorage.removeItem(e)),document.cookie.split(";"))){let[t]=e.trim().split("=");if(t&&(t.startsWith("sb-")||t.includes("supabase")||t.includes("auth-token"))){document.cookie="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/");let e=c();e&&(document.cookie="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(e)),document.cookie="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(window.location.hostname)}}return i()&&console.log("[Supabase] Cleared all auth storage (localStorage, sessionStorage, cookies)"),!0}function h(e){var t;if(!e)return!1;let n=(null==e?void 0:null===(t=e.message)||void 0===t?void 0:t.toLowerCase())||"";return n.includes("invalid refresh token")||n.includes("refresh token not found")||n.includes("already used")}function d(e){var t;if(!e)return!1;let n=(null==e?void 0:null===(t=e.message)||void 0===t?void 0:t.toLowerCase())||"";return 429===((null==e?void 0:e.status)||(null==e?void 0:e.code))||n.includes("429")||n.includes("rate limit")||n.includes("too many requests")}let f=0,p=()=>{if(a)return a;(function(){let e=window.location.pathname;return"/login"===e||e.startsWith("/login?")})()&&function(){try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(t&&t.startsWith("sb-")&&t.includes("-auth-token"))return!0}for(let e=0;e<sessionStorage.length;e++){let t=sessionStorage.key(e);if(t&&t.startsWith("sb-")&&t.includes("-auth-token"))return!0}if(document.cookie.includes("sb-")&&document.cookie.includes("auth-token"))return!0;return!1}catch(e){return!1}}()?(console.log("[Supabase] Login page detected with stored auth - clearing preemptively to prevent stale token loop"),l=!1,s=0,u()):function(){try{let{keyBase:e,value:t}=function(){var e;let t=function(){if("undefined"==typeof document)return{};let e={};return(document.cookie||"").split(";").forEach(t=>{let n=t.trim();if(!n)return;let o=n.indexOf("=");if(-1===o)return;let a=n.slice(0,o),r=n.slice(o+1);e[a]=r}),e}(),n=Object.keys(t).filter(e=>e.startsWith("sb-")&&e.includes("-auth-token"));if(0===n.length)return{keyBase:null,value:null};let o=n.find(e=>!/\.\d+$/.test(e));if(o)return{keyBase:o,value:null!==(e=t[o])&&void 0!==e?e:null};let a=n[0].replace(/\.\d+$/,""),r=n.filter(e=>e.startsWith(a+".")).sort((e,t)=>parseInt(e.split(".").pop()||"0",10)-parseInt(t.split(".").pop()||"0",10)).map(e=>{var n;return null!==(n=t[e])&&void 0!==n?n:""}).join("");return{keyBase:a,value:r||null}}();if(t){let n=function(e){let t=[];try{t.push(decodeURIComponent(e))}catch(e){}for(let n of(t.push(e),t)){let e=n.trim();if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch(e){}let t=function(e){try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(4*Math.ceil(t.length/4),"=");return atob(n)}catch(e){return null}}(e);if(t)try{return JSON.parse(t)}catch(e){}}return null}(t);if(n){let e=null==n?void 0:n.access_token;if("string"==typeof e&&(e.match(/\./g)||[]).length<2)return!0}else i()&&console.warn("[Supabase][debug] auth cookie present but unparseable; skipping corruption verdict",{keyBase:e})}try{for(let e=0;e<sessionStorage.length;e++){let t=sessionStorage.key(e);if(!t||!t.startsWith("sb-")||!t.includes("-auth-token"))continue;let n=sessionStorage.getItem(t);if(n)try{let e=JSON.parse(n),t=null==e?void 0:e.access_token;if("string"==typeof t&&(t.match(/\./g)||[]).length<2)return!0}catch(e){return!0}}}catch(e){}for(let e=0;e<localStorage.length;e++){let t;let n=localStorage.key(e);if(!n||!n.startsWith("sb-")||!n.includes("-auth-token"))continue;let o=localStorage.getItem(n);if(!o)continue;try{t=JSON.parse(o)}catch(e){return!0}let a=null==t?void 0:t.access_token;if(null==t||t.refresh_token,"string"==typeof a&&(a.match(/\./g)||[]).length<2)return!0}}catch(e){}return!1}()&&(i()&&console.warn("[Supabase] Corrupt persisted session detected pre-init; clearing auth storage"),u());let e="https://gbmtinxwzygezpewxfjp.supabase.co",t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImdibXRpbnh3enlnZXpwZXd4ZmpwIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDg1NjM3OTIsImV4cCI6MjA2NDEzOTc5Mn0.vv4llmIW1EjLKcy0LoWoufqgs8nHEHu5AHA6nBs3d9s";if(!e||!t)throw Error("Missing Supabase environment variables");let n={auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0},realtime:{params:{eventsPerSecond:10}}};if(!function(){let e=window.location.hostname;return"localhost"===e||e.endsWith(".localhost")}()){let e=c();e&&(n.cookieOptions={domain:e,path:"/",sameSite:"lax",secure:!0})}if(!(a=(0,o.A)(e,t,n)))throw Error("Failed to create Supabase client");return r||(r=!0,a.auth.onAuthStateChange(async(e,t)=>{if("TOKEN_REFRESHED"!==e||t||(console.warn("[Supabase] Token refresh returned no session, clearing stale storage"),u()),"TOKEN_REFRESH_FAILED"===e){if(l&&Date.now()-s<5e3){i()&&console.log("[
1Supabase] TOKEN_REFRESH_FAILED - skipping, already handled recently");return}if(Date.now()<f){i()&&console.log("[Supabase] TOKEN_REFRESH_FAILED - skipping, in rate limit backoff");return}try{let{error:e}=await a.auth.getSession();if(e&&d(e)){console.warn("[Supabase] Rate limited on token refresh - backing off for 60 seconds"),f=Date.now()+6e4,u(),null==a||a.auth.signOut({scope:"local"}).catch(()=>{});return}e&&h(e)&&(console.warn("[Supabase] Token refresh failed due to stale refresh token, clearing storage"),u()&&await a.auth.signOut({scope:"local"}))}catch(e){if(d(e)){console.warn("[Supabase] Rate limited on token refresh - backing off for 60 seconds"),f=Date.now()+6e4,u(),null==a||a.auth.signOut({scope:"local"}).catch(()=>{});return}h(e)&&(console.warn("[Supabase] Token refresh failed (stale token), clearing storage"),u()&&(null==a||a.auth.signOut({scope:"local"}).catch(()=>{})))}}})),a}}}]);
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.