var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var k=(e,t)=>{for(var s in t)a(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!S.call(e,n)&&n!==s&&a(e,n,{get:()=>t[n],enumerable:!(o=u(t,n))||o.enumerable});return e};var h=e=>g(a({},"__esModule",{value:!0}),e);var w={};k(w,{default:()=>C});module.exports=h(w);var O=require("react"),d=require("@stacks/connect-react");var r=require("react"),c=require("@stacks/connect"),l=()=>{let[e,t]=(0,r.useState)(""),s=new c.AppConfig(["store_write","publish_data"]),o=new c.UserSession({appConfig:s}),n=()=>{o.signUserOut(),t("")};return(0,r.useEffect)(()=>{if(o)try{let i=o.loadUserData();t(i.profile.stxAddress.testnet)}catch(i){}},[o]),{stacksAddress:e,userSession:o,disconnectStacks:n}},p=l;var m=require("react/jsx-runtime"),A=({children:e,clientConfig:t})=>{let{profile:s}=t,{userSession:o}=p();return(0,m.jsx)(d.Connect,{authOptions:{appDetails:{name:s==null?void 0:s.name,icon:s==null?void 0:s.profileImage},redirectTo:"/",onFinish:()=>{},userSession:o},children:e})},C=A;
