{"version":3,"file":"protectedRoute.WT77he59.mjs","names":["useState","user"],"sources":["https:/framerusercontent.com/modules/rsU5XsYJgHVcPD77x9eE/mnQQJ9xlQ6xTbvDHlges/protectedRoute.js"],"sourcesContent":["// ProtectedRoute.jsx\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{onAuthStateChanged}from\"firebase/auth\";import{auth}from\"https://framerusercontent.com/modules/5Do7gi7HT4qSffxtx2xx/4ZCPSVVohni969ethlWQ/firebaseConfig.js\";export default function ProtectedRoute({children}){const[loading,setLoading]=useState(true);const[user,setUser]=useState(null);useEffect(()=>{if(typeof window===\"undefined\")return;const isFramerEditor=window.location.hostname.includes(\"framer\")||window.location.pathname.includes(\"_Framer\")||window.self!==window.top// também detecta o preview/editor embutido\n;if(isFramerEditor){setUser({email:\"editor@framer.com\"})// simula usuário autenticado no editor\n;setLoading(false);return;}const unsubscribe=onAuthStateChanged(auth,user=>{if(!user){window.location.href=\"https://syforge.co/login\";}else{setUser(user);}setLoading(false);});return()=>unsubscribe();},[]);if(loading)return /*#__PURE__*/_jsx(\"div\",{children:\"Carregando...\"});if(!user)return null;return children;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProtectedRoute\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"uUACmP,SAAwB,EAAe,CAAC,YAAU,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,GAAK,CAAM,CAAC,EAAK,GAASA,EAAS,KAAK,CAExE,OAFyE,MAAc,CAAC,GAAU,IAAS,OAAY,OAC/Z,GAD2b,EAAO,SAAS,SAAS,SAAS,SAAS,EAAE,EAAO,SAAS,SAAS,SAAS,UAAU,EAAE,EAAO,OAAO,EAAO,IACzhB,CAAC,EAAQ,CAAC,MAAM,oBAAoB,CAAC,CACvD,EAAW,GAAM,CAAC,OAAQ,IAAM,EAAY,EAAmB,EAAK,GAAM,CAAKC,EAA4D,EAAQA,EAAK,CAAnE,EAAO,SAAS,KAAK,2BAAgD,EAAW,GAAM,EAAG,CAAC,UAAU,GAAa,EAAG,EAAE,CAAC,CAAI,EAA4B,EAAK,MAAM,CAAC,SAAS,gBAAgB,CAAC,CAAK,EAAwB,EAAZ,0BAFzP,IAAsC,IAA8C,IAAoH"}