PageSourceSearch

https://seosignalx.com/assets/AuthContext-BfWRnHZp.js

js seosignalx.com collected 2026-09-24 14:00:22 UTC 1,930 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{n as t,r as n}from"./createLucideIcon-de5PRQ9U.js";import{o as r,t as i}from"./firebase-BARv7FmF.js";var a=e(n(),1),o={free:{id:`free`,label:`Free`},admin:{id:`admin`,label:`Admin`},professional:{id:`professional`,label:`Professional`},enterprise:{id:`enterprise`,label:`Enterprise`}};function s(e){let t=String(e||`free`).trim().toLowerCase();return t===`admin`?`admin`:t===`enterprise`?`enterprise`:[`professional`,`proffesional`,`pro`,`premium`].includes(t)?`professional`:`free`}function c(e){return o[s(e)].label}var l=t(),u=6e4,d=(0,a.createContext)({user:null,claims:{},loading:!0,isAdmin:!1,refreshClaims:async()=>({})});function f({children:e}){let[t,n]=(0,a.useState)(null),[o,c]=(0,a.useState)({}),[f,p]=(0,a.useState)(!0),m=(0,a.useRef)(null),h=(0,a.useCallback)(async(e=!0)=>{let t=i.currentUser;if(!t)return c({}),{};if(m.current?.uid===t.uid)return m.current.promise;let n=t.getIdTokenResult(e).then(e=>(i.currentUser?.uid===t.uid&&c(e.claims||{}),e.claims||{})).finally(()=>{m.current?.promise===n&&(m.current=null)});return m.current={uid:t.uid,promise:n},n},[]);(0,a.useEffect)(()=>r(i,async e=>{if(n(e),e)try{await h(!0)}catch{c({})}else c({});p(!1)}),[h]),(0,a.useEffect)(()=>{if(!t)return;let e=()=>{document.visibilityState===`visible`&&h(!0).catch(()=>{})},n=()=>{document.visibilityState===`visible`&&e()},r=window.setInterval(e,u);return window.addEventListener(`focus`,e),window.addEventListener(`online`,e),document.addEventListener(`visibilitychange`,n),()=>{window.clearInterval(r),window.removeEventListener(`focus`,e),window.removeEventListener(`online`,e),document.removeEventListener(`visibilitychange`,n)}},[h,t]);let g=!!(o.admin||s(o.level||o.plan)===`admin`);return(0,l.jsx)(d.Provider,{value:{user:t,claims:o,loading:f,isAdmin:g,refreshClaims:h},children:e})}function p(){return(0,a.useContext)(d)}export{s as i,p as n,c as r,f as t};

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.