import{t as m}from"../chunks/BEJ5fU19.js";import"../chunks/CWj6FrbW.js";import{o as _}from"../chunks/x2n8lXq-.js";import{p as y,i as c,f as h,b as p,c as E,e as U,d as u,s as j,g as f,r as g,t as x}from"../chunks/DOPisAOl.js";import{a as $,s as L}from"../chunks/Xc3_nZLd.js";import{i as k}from"../chunks/DWnVehjo.js";import{s as C}from"../chunks/BhT-mCxl.js";import{p as R}from"../chunks/BiKOfkaT.js";import{g as i}from"../chunks/BxniC1kI.js";const S=async()=>({trpc:m,agents:await m.agents.list.query()}),H=Object.freeze(Object.defineProperty({__proto__:null,load:S},Symbol.toStringTag,{value:"Module"}));var T=h(`<div class="
				absolute bottom-0 right-0 m-4 rounded-sm border border-red-500 bg-red-50
				px-4 py-2 text-red-800 focus:outline-none focus:ring-0"> </div>`),A=h('<main class="h-screen overflow-hidden bg-gray-600"><!> <!></main>');function I(v,l){y(l,!0);let n=U("");C({onAgentSelect:e=>{const r=R.url.pathname.split("/")[1];r?r==="roleplay"?i(`/roleplay?agent=${encodeURIComponent(e)}`):i(`/${r}/${e}`):i(`/roleplay?agent=${encodeURIComponent(e)}`)},onError:a}),_(()=>{const e=o=>{var t;console.error(o),a(`Uncaught error: ${((t=o.error)==null?void 0:t.message)||o.message||"Unknown error"}`)},r=o=>{var t;console.error(o),a(`Unhandled promise rejection: ${((t=o.reason)==null?void 0:t.message)||o.reason||"Unknown error"}`)};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",r),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",r)}});function a(e){c(n,e,!0),setTimeout(()=>{c(n,"")},5e3),console.error(e)}var s=A(),d=u(s);$(d,()=>l.children);var b=j(d,2);{var w=e=>{var r=T(),o=u(r,!0);g(r),x(()=>L(o,f(n))),p(e,r)};k(b,e=>{f(n)&&e(w)})}g(s),p(v,s),E()}export{I as component,H as universal};
