@sockethub/examples 1.0.0-alpha.18 → 1.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/build/_app/immutable/chunks/{CMGJd5ye.js → B4QvvF9v.js} +1 -1
  2. package/build/_app/immutable/chunks/{CP3RYOsn.js → BJa-K1HI.js} +1 -1
  3. package/build/_app/immutable/chunks/{DmTdcgJE.js → BUnlO8zl.js} +1 -1
  4. package/build/_app/immutable/chunks/{DAI8Skzw.js → BWVzoQAP.js} +1 -1
  5. package/build/_app/immutable/chunks/D0ikSVuC.js +1 -0
  6. package/build/_app/immutable/chunks/{CtHan22X.js → DHN3DyXv.js} +1 -1
  7. package/build/_app/immutable/chunks/{Cg0jVkAC.js → Dd3sOYF9.js} +1 -1
  8. package/build/_app/immutable/entry/{app.B_vRxLYK.js → app.DfHa-4d4.js} +2 -2
  9. package/build/_app/immutable/entry/start.Bf_hVfxy.js +1 -0
  10. package/build/_app/immutable/nodes/{0.BtFjvn48.js → 0.Cd2_Nfba.js} +1 -1
  11. package/build/_app/immutable/nodes/{1.D-6IOJdS.js → 1.D3qZV2vo.js} +1 -1
  12. package/build/_app/immutable/nodes/{2.9I1exuqO.js → 2.BysUTzcv.js} +1 -1
  13. package/build/_app/immutable/nodes/{3.5bdBcHki.js → 3.DKJ83Cvw.js} +1 -1
  14. package/build/_app/immutable/nodes/{4.CbdjIqdp.js → 4.DB8UnEA8.js} +1 -1
  15. package/build/_app/immutable/nodes/{5.fGuqL79M.js → 5.Cj8bv369.js} +1 -1
  16. package/build/_app/immutable/nodes/{6.DjV4FiJS.js → 6.eKf13UwC.js} +1 -1
  17. package/build/_app/immutable/nodes/{7.BzU7RB4F.js → 7.Bi3xoTlo.js} +1 -1
  18. package/build/_app/immutable/nodes/{8.CxUYN2jc.js → 8.DQNerIii.js} +1 -1
  19. package/build/_app/version.json +1 -1
  20. package/build/caldav.html +7 -7
  21. package/build/dummy.html +7 -7
  22. package/build/feeds.html +7 -7
  23. package/build/index.html +7 -7
  24. package/build/irc.html +7 -7
  25. package/build/metadata.html +7 -7
  26. package/build/xmpp.html +7 -7
  27. package/package.json +3 -3
  28. package/build/_app/immutable/chunks/w4Fz4V5i.js +0 -1
  29. package/build/_app/immutable/entry/start.Bq-TCpu6.js +0 -1
@@ -1 +1 @@
1
- import{d as v,f as _,s as y,a as g}from"./Cfa_Aa1G.js";import{p as h,c as u,r as d,s as x,t as w,a as F}from"./sOXp0zzN.js";import{r as I,s as l,a as k}from"./CUJhLo5A.js";import{b as C}from"./DAI8Skzw.js";import{p as r}from"./BFggNCH_.js";var j=_('<div class="w-full space-y-2"><label class="block text-sm font-semibold text-gray-700"> </label> <input/></div>');function E(n,e){h(e,!0);let c=r(e,"type",3,"text"),f=r(e,"placeholder",3,""),o=r(e,"value",15),m=r(e,"class",3,"");var s=j(),t=u(s),p=u(t,!0);d(t);var a=x(t,2);I(a),a.__input=function(...b){var i;(i=e.onInput?()=>e.onInput(o()):void 0)==null||i.apply(this,b)},d(s),w(()=>{l(t,"for",e.id),y(p,e.label),l(a,"id",e.id),l(a,"type",c()),l(a,"placeholder",f()),k(a,1,`w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 text-gray-900 placeholder-gray-500 ${m()??""}`)}),C(a,o),g(n,s),F()}v(["input"]);export{E as F};
1
+ import{d as v,f as _,s as y,a as g}from"./Cfa_Aa1G.js";import{p as h,c as u,r as d,s as x,t as w,a as F}from"./sOXp0zzN.js";import{r as I,s as l,a as k}from"./CUJhLo5A.js";import{b as C}from"./BWVzoQAP.js";import{p as r}from"./BFggNCH_.js";var j=_('<div class="w-full space-y-2"><label class="block text-sm font-semibold text-gray-700"> </label> <input/></div>');function E(n,e){h(e,!0);let c=r(e,"type",3,"text"),f=r(e,"placeholder",3,""),o=r(e,"value",15),m=r(e,"class",3,"");var s=j(),t=u(s),p=u(t,!0);d(t);var a=x(t,2);I(a),a.__input=function(...b){var i;(i=e.onInput?()=>e.onInput(o()):void 0)==null||i.apply(this,b)},d(s),w(()=>{l(t,"for",e.id),y(p,e.label),l(a,"id",e.id),l(a,"type",c()),l(a,"placeholder",f()),k(a,1,`w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 text-gray-900 placeholder-gray-500 ${m()??""}`)}),C(a,o),g(n,s),F()}v(["input"]);export{E as F};
@@ -1 +1 @@
1
- import{f as c,a as o,c as R,d as te}from"./Cfa_Aa1G.js";import{p as L,s as j,c as h,r as p,t as se,a as D,g as r,u as V,e as _,f as J,k as ae,b as H,n as U,d as S}from"./sOXp0zzN.js";import{r as X,a as oe,d as re}from"./CUJhLo5A.js";import{b as Y,S as G}from"./DAI8Skzw.js";import{p as I,s as O,c as F,b as q,i as T}from"./BFggNCH_.js";import{T as ne}from"./CtHan22X.js";import{b as ie,a as K,c as Q,d as le,s as W}from"./DmTdcgJE.js";var ce=c('<div class="pb-4"><label for="actor-id-input" class="pr-3">Actor ID</label> <input id="actor-id-input" type="text"/></div>');function Ae(b,e){L(e,!0);let t=I(e,"value",15),w=I(e,"class",3,"bg-white border border-solid border-gray-300 rounded");var d=ce(),s=j(h(d),2);X(s),p(d),se(()=>oe(s,1,re(w()))),Y(s,t),o(b,d),D()}function ze(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();async function s(a){await ie();const v={"@context":await Q(e.context),type:"credentials",actor:K(e.actor),object:JSON.parse(a)};return new Promise((x,m)=>{le.socket.emit("credentials",v,u=>{if(u!=null&&u.error){m(new Error(u.error));return}F(e.sockethubState,_(t).credentialsSet=!0,_(t)),x()})})}{let a=V(()=>!t().actorSet||t().credentialsSet||!1);ne(b,{title:"Credentials",get obj(){return e.credentials},buttonText:"Set Credentials",submitData:s,get disabled(){return r(a)}})}D(),d()}var de=c('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span>Connecting...</span></div>'),ve=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4 text-green-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span>Connected</span></div>'),ue=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"></path></svg> <span>Connect</span></div>'),me=c('<div class="w-full flex justify-end"><!></div>');function Be(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();let s=I(e,"disabled",3,!1),a=V(()=>s()||!t().credentialsSet||t().connected||e.connecting);var v=me(),x=h(v);G(x,{get disabled(){return r(a)},buttonAction:async()=>{await e.onConnect()},children:(m,u)=>{var k=R(),y=J(k);{var M=i=>{var C=de();o(i,C)},n=i=>{var C=R(),B=J(C);{var A=g=>{var l=ve();o(g,l)},P=g=>{var l=ue();o(g,l)};T(B,g=>{t().connected?g(A):g(P,!1)},!0)}o(i,C)};T(y,i=>{e.connecting?i(M):i(n,!1)})}o(m,k)}}),p(v),o(b,v),D(),d()}var ge=c('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span>Joining...</span></div>'),fe=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span>Joined</span></div>'),he=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"></path></svg> <span>Join Room</span></div>'),pe=c('<div class="bg-gradient-to-r from-indigo-50 to-purple-50 border border-indigo-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-indigo-900 mb-4 flex items-center"><span class="mr-2">🏠</span> Join Chat Room</h4> <div class="space-y-4"><div class="w-full space-y-2"><label for="room" class="block text-sm font-semibold text-gray-700">Room/Channel</label> <input id="room" class="w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-colors duration-200 text-gray-900 placeholder-gray-500" placeholder="sockethub@irc.libera.chat, kosmos-random@kosmos.chat"/> <p class="text-gray-500 text-xs">💡 IRC: channel@server (e.g. sockethub@irc.libera.chat); include # in name when sending (e.g. #sockethub) | XMPP: room@server.com</p></div> <div class="flex justify-end"><!></div></div></div>');function Pe(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();let s=I(e,"room",15),a=H(!1),v=H("");ae(()=>{s()!==r(v)&&F(e.sockethubState,_(t).joined=!1,_(t))});async function x(){return S(a,!0),await W({"@context":await Q(e.context),type:"join",actor:K(e.actor),target:{id:s(),name:s(),type:"room"}}).catch(()=>{F(e.sockethubState,_(t).joined=!1,_(t)),S(a,!1)}).then(()=>{S(v,s(),!0),F(e.sockethubState,_(t).joined=!0,_(t)),S(a,!1)})}var m=pe(),u=j(h(m),2),k=h(u),y=j(h(k),2);X(y),U(2),p(k);var M=j(k,2),n=h(M);{let i=V(()=>!t().connected||t().joined||r(a));G(n,{get disabled(){return r(i)},buttonAction:x,children:(C,B)=>{var A=R(),P=J(A);{var g=f=>{var E=ge();o(f,E)},l=f=>{var E=R(),Z=J(E);{var $=z=>{var N=fe();o(z,N)},ee=z=>{var N=he();o(z,N)};T(Z,z=>{t().joined?z($):z(ee,!1)},!0)}o(f,E)};T(P,f=>{r(a)?f(g):f(l,!1)})}o(C,A)}})}p(M),p(u),p(m),Y(y,s),o(b,m),D(),d()}var be=c('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="hidden sm:inline">Sending...</span></div>'),we=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"></path></svg> <span class="hidden sm:inline">Send</span></div>'),xe=c('<div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-green-900 mb-4 flex items-center"><span class="mr-2">💬</span> Send Message</h4> <div class="space-y-4"><div class="w-full space-y-2"><label for="sendMessage" class="block text-sm font-semibold text-gray-700">Your Message</label> <div class="flex space-x-3"><input id="sendMessage" class="flex-1 px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors duration-200 text-gray-900 placeholder-gray-500" placeholder="Type your message here..."/> <!></div> <p class="text-gray-500 text-xs">💡 Press Enter to send quickly</p></div></div></div>');function Re(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();let s=H(""),a=H(!1);async function v(){if(!r(s).trim())return;S(a,!0);const n=r(s).trim();console.log("send message: ",n);try{await W({"@context":await Q(e.context),type:"send",actor:K(e.actor),object:{type:"message",content:n},target:{id:e.room,name:e.room,type:"room"}}),S(s,"")}catch(i){console.error("Failed to send message:",i)}finally{S(a,!1)}}var x=xe(),m=j(h(x),2),u=h(m),k=j(h(u),2),y=h(k);X(y),y.__keydown=n=>{n.key==="Enter"&&!r(a)&&t().connected&&v()};var M=j(y,2);{let n=V(()=>!t().connected||r(a)||!r(s).trim());G(M,{get disabled(){return r(n)},buttonAction:v,children:(i,C)=>{var B=R(),A=J(B);{var P=l=>{var f=be();o(l,f)},g=l=>{var f=we();o(l,f)};T(A,l=>{r(a)?l(P):l(g,!1)})}o(i,B)}})}p(k),U(2),p(u),p(m),p(x),Y(y,()=>r(s),n=>S(s,n)),o(b,x),D(),d()}te(["keydown"]);export{Ae as A,ze as C,Be as P,Pe as R,Re as S};
1
+ import{f as c,a as o,c as R,d as te}from"./Cfa_Aa1G.js";import{p as L,s as j,c as h,r as p,t as se,a as D,g as r,u as V,e as _,f as J,k as ae,b as H,n as U,d as S}from"./sOXp0zzN.js";import{r as X,a as oe,d as re}from"./CUJhLo5A.js";import{b as Y,S as G}from"./BWVzoQAP.js";import{p as I,s as O,c as F,b as q,i as T}from"./BFggNCH_.js";import{T as ne}from"./DHN3DyXv.js";import{b as ie,a as K,c as Q,d as le,s as W}from"./BUnlO8zl.js";var ce=c('<div class="pb-4"><label for="actor-id-input" class="pr-3">Actor ID</label> <input id="actor-id-input" type="text"/></div>');function Ae(b,e){L(e,!0);let t=I(e,"value",15),w=I(e,"class",3,"bg-white border border-solid border-gray-300 rounded");var d=ce(),s=j(h(d),2);X(s),p(d),se(()=>oe(s,1,re(w()))),Y(s,t),o(b,d),D()}function ze(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();async function s(a){await ie();const v={"@context":await Q(e.context),type:"credentials",actor:K(e.actor),object:JSON.parse(a)};return new Promise((x,m)=>{le.socket.emit("credentials",v,u=>{if(u!=null&&u.error){m(new Error(u.error));return}F(e.sockethubState,_(t).credentialsSet=!0,_(t)),x()})})}{let a=V(()=>!t().actorSet||t().credentialsSet||!1);ne(b,{title:"Credentials",get obj(){return e.credentials},buttonText:"Set Credentials",submitData:s,get disabled(){return r(a)}})}D(),d()}var de=c('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span>Connecting...</span></div>'),ve=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4 text-green-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span>Connected</span></div>'),ue=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"></path></svg> <span>Connect</span></div>'),me=c('<div class="w-full flex justify-end"><!></div>');function Be(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();let s=I(e,"disabled",3,!1),a=V(()=>s()||!t().credentialsSet||t().connected||e.connecting);var v=me(),x=h(v);G(x,{get disabled(){return r(a)},buttonAction:async()=>{await e.onConnect()},children:(m,u)=>{var k=R(),y=J(k);{var M=i=>{var C=de();o(i,C)},n=i=>{var C=R(),B=J(C);{var A=g=>{var l=ve();o(g,l)},P=g=>{var l=ue();o(g,l)};T(B,g=>{t().connected?g(A):g(P,!1)},!0)}o(i,C)};T(y,i=>{e.connecting?i(M):i(n,!1)})}o(m,k)}}),p(v),o(b,v),D(),d()}var ge=c('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span>Joining...</span></div>'),fe=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span>Joined</span></div>'),he=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"></path></svg> <span>Join Room</span></div>'),pe=c('<div class="bg-gradient-to-r from-indigo-50 to-purple-50 border border-indigo-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-indigo-900 mb-4 flex items-center"><span class="mr-2">🏠</span> Join Chat Room</h4> <div class="space-y-4"><div class="w-full space-y-2"><label for="room" class="block text-sm font-semibold text-gray-700">Room/Channel</label> <input id="room" class="w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-colors duration-200 text-gray-900 placeholder-gray-500" placeholder="sockethub@irc.libera.chat, kosmos-random@kosmos.chat"/> <p class="text-gray-500 text-xs">💡 IRC: channel@server (e.g. sockethub@irc.libera.chat); include # in name when sending (e.g. #sockethub) | XMPP: room@server.com</p></div> <div class="flex justify-end"><!></div></div></div>');function Pe(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();let s=I(e,"room",15),a=H(!1),v=H("");ae(()=>{s()!==r(v)&&F(e.sockethubState,_(t).joined=!1,_(t))});async function x(){return S(a,!0),await W({"@context":await Q(e.context),type:"join",actor:K(e.actor),target:{id:s(),name:s(),type:"room"}}).catch(()=>{F(e.sockethubState,_(t).joined=!1,_(t)),S(a,!1)}).then(()=>{S(v,s(),!0),F(e.sockethubState,_(t).joined=!0,_(t)),S(a,!1)})}var m=pe(),u=j(h(m),2),k=h(u),y=j(h(k),2);X(y),U(2),p(k);var M=j(k,2),n=h(M);{let i=V(()=>!t().connected||t().joined||r(a));G(n,{get disabled(){return r(i)},buttonAction:x,children:(C,B)=>{var A=R(),P=J(A);{var g=f=>{var E=ge();o(f,E)},l=f=>{var E=R(),Z=J(E);{var $=z=>{var N=fe();o(z,N)},ee=z=>{var N=he();o(z,N)};T(Z,z=>{t().joined?z($):z(ee,!1)},!0)}o(f,E)};T(P,f=>{r(a)?f(g):f(l,!1)})}o(C,A)}})}p(M),p(u),p(m),Y(y,s),o(b,m),D(),d()}var be=c('<div class="flex items-center space-x-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="hidden sm:inline">Sending...</span></div>'),we=c('<div class="flex items-center space-x-2"><svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"></path></svg> <span class="hidden sm:inline">Send</span></div>'),xe=c('<div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-green-900 mb-4 flex items-center"><span class="mr-2">💬</span> Send Message</h4> <div class="space-y-4"><div class="w-full space-y-2"><label for="sendMessage" class="block text-sm font-semibold text-gray-700">Your Message</label> <div class="flex space-x-3"><input id="sendMessage" class="flex-1 px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors duration-200 text-gray-900 placeholder-gray-500" placeholder="Type your message here..."/> <!></div> <p class="text-gray-500 text-xs">💡 Press Enter to send quickly</p></div></div></div>');function Re(b,e){L(e,!0);const t=()=>q(e.sockethubState,"$sockethubState",w),[w,d]=O();let s=H(""),a=H(!1);async function v(){if(!r(s).trim())return;S(a,!0);const n=r(s).trim();console.log("send message: ",n);try{await W({"@context":await Q(e.context),type:"send",actor:K(e.actor),object:{type:"message",content:n},target:{id:e.room,name:e.room,type:"room"}}),S(s,"")}catch(i){console.error("Failed to send message:",i)}finally{S(a,!1)}}var x=xe(),m=j(h(x),2),u=h(m),k=j(h(u),2),y=h(k);X(y),y.__keydown=n=>{n.key==="Enter"&&!r(a)&&t().connected&&v()};var M=j(y,2);{let n=V(()=>!t().connected||r(a)||!r(s).trim());G(M,{get disabled(){return r(n)},buttonAction:v,children:(i,C)=>{var B=R(),A=J(B);{var P=l=>{var f=be();o(l,f)},g=l=>{var f=we();o(l,f)};T(A,l=>{r(a)?l(P):l(g,!1)})}o(i,B)}})}p(k),U(2),p(u),p(m),p(x),Y(y,()=>r(s),n=>S(s,n)),o(b,x),D(),d()}te(["keydown"]);export{Ae as A,ze as C,Be as P,Pe as R,Re as S};