import{V as e}from"./lz-string-CMojKG3P.js";import{mn as t}from"./src-DTHkTkyy-Ce1TZuRw.js";import{t as n}from"./connect.config-Cuh0hj_Q-DrP71hlD.js";import{n as r}from"./toast-DnODOv28-DJtc4rMD.js";import{t as i}from"./useTranslation-D1YdOuD6.js";import{a}from"./module-D-kY811l.js";import{n as o}from"./reactor-Nm3jOev1-Cl_iEnvO.js";import{n as s}from"./pglite-seed-BtXWFpHf-BZ6di5-I.js";import{t as c}from"./package-CY2rgDg1-OzOXjC3D.js";import{setUser as l}from"./esm-XIQFb1x2.js";import{createElement as u,useEffect as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=()=>{let{t:e}=i();return p(`div`,{children:[f(`p`,{className:`font-medium`,children:e(`notifications.reloadApp`)}),p(`button`,{onClick:()=>location.reload(),className:`underline decoration-solid underline-offset-2`,children:[e(`common.reloadConnect`),` 🔄`]})]})},h=()=>{async function t(){let t=await y();if(t!==null){if(t.isLatest||t.currentVersion.includes(`-`))return!0;n.studioMode||!n.warnOutdatedApp?e.warn(`Connect is outdated: 
Current: @currentVersion
Latest: @latestVersion`,t.currentVersion,t.latestVersion):r(u(m),{type:`connect-warning`,toastId:`outdated-app`,autoClose:!1})}}d(()=>{t().catch(console.error)},[])};window.navigator.appVersion.includes(`Mac`);var g={"staging/makerdao":`deployments/staging/makerdao`,"staging/arbitrum":`arb-ltip`,"staging/powerhouse":`staging`,makerdao:`deployments/makerdao`,arbitrum:`deployments/arbitrum`,arbgrants:`deployments/arbitrum`,localhost:`develop`},_=()=>{let e=window.location.href,t=Object.keys(g).find(t=>e.includes(t)),n=t?g[t]:void 0;if(n)return`https://raw.githubusercontent.com/powerhouse-inc/connect/${n}/package.json`},v=async()=>{let e=_();if(!e)return;let{version:t}=await(await fetch(e)).json();return t},y=async()=>{let e=c.version,t=await v();return t?{isLatest:t===e,currentVersion:e,latestVersion:t}:null};function b(){let e=t();d(()=>{let t=null;if(e){let{credential:n,...r}=e;t={id:r.did,username:r.ens?.name,...r}}l(t)},[e])}async function x(e){return await s(),await a(),await o(e),{default:({children:e})=>(b(),h(),e)}}export{x as loadComponent};
//# sourceMappingURL=load-CK80UjSU-B39sDA_T.js.map