@sockethub/examples 1.0.0-alpha.11 → 1.0.0-alpha.13
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.
- package/README.md +36 -148
- package/build/_app/immutable/assets/0.GKlhshq0.css +1 -0
- package/build/_app/immutable/chunks/{Cf7Xaqef.js → B5Mgq-ia.js} +1 -1
- package/build/_app/immutable/chunks/{DJd_9GSN.js → BAMCB3hl.js} +1 -1
- package/build/_app/immutable/chunks/{P3PHXZz3.js → BB3nrZKK.js} +2 -2
- package/build/_app/immutable/chunks/{B-2myMF5.js → BPmfLl8P.js} +1 -1
- package/build/_app/immutable/chunks/Bh9jqwq3.js +2 -0
- package/build/_app/immutable/chunks/CE_Br0Li.js +36 -0
- package/build/_app/immutable/chunks/{CARmnL8B.js → CF0IgWN3.js} +1 -1
- package/build/_app/immutable/chunks/{CC-fhLYv.js → CLc0OQ-M.js} +1 -1
- package/build/_app/immutable/chunks/CLcl1K30.js +1 -0
- package/build/_app/immutable/chunks/{D_xw8KSE.js → CPsRFLIg.js} +1 -1
- package/build/_app/immutable/chunks/DTPsrcK7.js +4 -0
- package/build/_app/immutable/chunks/{Ciq9INsC.js → DT_OQU4t.js} +1 -1
- package/build/_app/immutable/chunks/{DvzjJQ_P.js → De6kqrZW.js} +1 -1
- package/build/_app/immutable/chunks/{DxLbbUVu.js → DhU_U-a9.js} +1 -1
- package/build/_app/immutable/chunks/Dm-WrFn1.js +1 -0
- package/build/_app/immutable/chunks/aGNzqrdP.js +1 -0
- package/build/_app/immutable/entry/{app.24uSP5jR.js → app.44tyicEj.js} +2 -2
- package/build/_app/immutable/entry/start.D_PJ6UtD.js +1 -0
- package/build/_app/immutable/nodes/{0.CRxtfUZO.js → 0.COBjogKI.js} +1 -1
- package/build/_app/immutable/nodes/{1.CjzaWbdc.js → 1.ZmYfbvuo.js} +1 -1
- package/build/_app/immutable/nodes/{2.Dzi-FWBZ.js → 2.B-c8MtqI.js} +3 -3
- package/build/_app/immutable/nodes/3.DKOfQDif.js +2 -0
- package/build/_app/immutable/nodes/4.PE7b6wi8.js +1 -0
- package/build/_app/immutable/nodes/5.Cc6bNRTx.js +1 -0
- package/build/_app/immutable/nodes/6.D0DWXXhX.js +1 -0
- package/build/_app/immutable/nodes/7.CFhuHlBr.js +1 -0
- package/build/_app/version.json +1 -1
- package/build/dummy.html +12 -12
- package/build/feeds.html +12 -12
- package/build/index.html +12 -12
- package/build/irc.html +12 -12
- package/build/metadata-test.html +16 -0
- package/build/metadata.html +12 -12
- package/build/sockethub-logo.svg +11 -9
- package/build/xmpp.html +12 -12
- package/package.json +5 -4
- package/build/_app/immutable/assets/0.JUA-HkH6.css +0 -1
- package/build/_app/immutable/chunks/B48xiOwQ.js +0 -1
- package/build/_app/immutable/chunks/BnKTx64M.js +0 -1
- package/build/_app/immutable/chunks/D34JQ8ay.js +0 -4
- package/build/_app/immutable/chunks/DRqIvF0-.js +0 -1
- package/build/_app/immutable/chunks/DqdrLdzV.js +0 -2
- package/build/_app/immutable/chunks/Duf23zEt.js +0 -23
- package/build/_app/immutable/entry/start.odGQGxrg.js +0 -1
- package/build/_app/immutable/nodes/3.WM6k04_L.js +0 -1
- package/build/_app/immutable/nodes/4.C0mUcLdq.js +0 -1
- package/build/_app/immutable/nodes/5.JU4p_B8j.js +0 -1
- package/build/_app/immutable/nodes/6.BjGCqlQt.js +0 -1
- package/build/_app/immutable/nodes/7.HL4NrxY9.js +0 -1
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var vr=Object.defineProperty;var _r=(n,e,t)=>e in n?vr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Je=(n,e,t)=>_r(n,typeof e!="symbol"?e+"":e,t);import{j as Wn,k as br,f as ie,a as F,s as fe,c as Te,t as fs,d as hs}from"./DqdrLdzV.js";import"./BnKTx64M.js";import{y as xt,L as ds,R as et,A as be,aQ as $e,M as Tt,g as K,a1 as mr,O as wr,P as Er,Q as Yn,S as ft,B as ze,ay as mn,b2 as xr,aJ as Xn,q as kr,b4 as Ne,z as rn,D as Or,X as Gn,V as ps,b0 as wn,ae as Sr,b5 as Ar,b6 as Rr,b7 as Tr,v as gs,x as ys,b8 as Gt,aY as Nt,a$ as Nr,w as Cr,b9 as vs,ai as Mr,ba as Br,t as de,W as Lr,bb as Ir,b3 as Pr,aZ as Dr,bc as jr,p as Pe,s as W,c as B,r as R,n as _s,a as De,f as pe,bd as Ur,be as Hr,b as Ke,m as Jt,e as qr,d as bt,u as Ve,ag as Jn}from"./Ciq9INsC.js";import{w as En,g as Fr,c as Vr,a as Kr}from"./CARmnL8B.js";import{i as bs}from"./B-2myMF5.js";import{b as zr,s as Wr,i as ge,l as Ct,p as We,d as Yr}from"./Cf7Xaqef.js";import{s as Xr,a as xn,d as Gr,C as Jr}from"./P3PHXZz3.js";function on(n,e){return e}function Qr(n,e,t){for(var s=[],i=e.length,o,a=e.length,f=0;f<i;f++){let d=e[f];ys(d,()=>{if(o){if(o.pending.delete(d),o.done.add(d),o.pending.size===0){var b=n.outrogroups;an(wn(o.done)),b.delete(o),b.size===0&&(n.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=s.length===0&&t!==null;if(c){var p=t,u=p.parentNode;Nr(u),u.append(p),n.items.clear()}an(e,!c)}else o={pending:new Set(e),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(o)}function an(n,e=!0){for(var t=0;t<n.length;t++)Cr(n[t],e)}var Qn;function cn(n,e,t,s,i,o=null){var a=n,f=new Map,c=(e&vs)!==0;if(c){var p=n;a=be?et($e(p)):p.appendChild(xt())}be&&Tt();var u=null,d=mr(()=>{var g=t();return Sr(g)?g:g==null?[]:wn(g)}),b,k=!0;function T(){_.fallback=u,$r(_,b,a,e,s),u!==null&&(b.length===0?(u.f&Ne)===0?gs(u):(u.f^=Ne,lt(u,null,a)):ys(u,()=>{u=null}))}var O=ds(()=>{b=K(d);var g=b.length;let z=!1;if(be){var Y=wr(a)===Er;Y!==(g===0)&&(a=Yn(),et(a),ft(!1),z=!0)}for(var N=new Set,Z=kr,ee=Or(),J=0;J<g;J+=1){be&&ze.nodeType===mn&&ze.data===xr&&(a=ze,z=!0,ft(!1));var I=b[J],q=s(I,J),A=k?null:f.get(q);A?(A.v&&Xn(A.v,I),A.i&&Xn(A.i,J),ee&&Z.skipped_effects.delete(A.e)):(A=Zr(f,k?a:Qn??(Qn=xt()),I,q,J,i,e,t),k||(A.e.f|=Ne),f.set(q,A)),N.add(q)}if(g===0&&o&&!u&&(k?u=rn(()=>o(a)):(u=rn(()=>o(Qn??(Qn=xt()))),u.f|=Ne)),be&&g>0&&et(Yn()),!k)if(ee){for(const[P,D]of f)N.has(P)||Z.skipped_effects.add(D.e);Z.oncommit(T),Z.ondiscard(()=>{})}else T();z&&ft(!0),K(d)}),_={effect:O,items:f,outrogroups:null,fallback:u};k=!1,be&&(a=ze)}function $r(n,e,t,s,i){var A,P,D,j,se,_e,ye,oe,ae;var o=(s&Br)!==0,a=e.length,f=n.items,c=n.effect.first,p,u=null,d,b=[],k=[],T,O,_,g;if(o)for(g=0;g<a;g+=1)T=e[g],O=i(T,g),_=f.get(O).e,(_.f&Ne)===0&&((P=(A=_.nodes)==null?void 0:A.a)==null||P.measure(),(d??(d=new Set)).add(_));for(g=0;g<a;g+=1){if(T=e[g],O=i(T,g),_=f.get(O).e,n.outrogroups!==null)for(const ce of n.outrogroups)ce.pending.delete(_),ce.done.delete(_);if((_.f&Ne)!==0)if(_.f^=Ne,_===c)lt(_,null,t);else{var z=u?u.next:c;_===n.effect.last&&(n.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Le(n,u,_),Le(n,_,z),lt(_,z,t),u=_,b=[],k=[],c=u.next;continue}if((_.f&Gt)!==0&&(gs(_),o&&((j=(D=_.nodes)==null?void 0:D.a)==null||j.unfix(),(d??(d=new Set)).delete(_))),_!==c){if(p!==void 0&&p.has(_)){if(b.length<k.length){var Y=k[0],N;u=Y.prev;var Z=b[0],ee=b[b.length-1];for(N=0;N<b.length;N+=1)lt(b[N],Y,t);for(N=0;N<k.length;N+=1)p.delete(k[N]);Le(n,Z.prev,ee.next),Le(n,u,Z),Le(n,ee,Y),c=Y,u=ee,g-=1,b=[],k=[]}else p.delete(_),lt(_,c,t),Le(n,_.prev,_.next),Le(n,_,u===null?n.effect.first:u.next),Le(n,u,_),u=_;continue}for(b=[],k=[];c!==null&&c!==_;)(p??(p=new Set)).add(c),k.push(c),c=c.next;if(c===null)continue}(_.f&Ne)===0&&b.push(_),u=_,c=_.next}if(n.outrogroups!==null){for(const ce of n.outrogroups)ce.pending.size===0&&(an(wn(ce.done)),(se=n.outrogroups)==null||se.delete(ce));n.outrogroups.size===0&&(n.outrogroups=null)}if(c!==null||p!==void 0){var J=[];if(p!==void 0)for(_ of p)(_.f&Gt)===0&&J.push(_);for(;c!==null;)(c.f&Gt)===0&&c!==n.fallback&&J.push(c),c=c.next;var I=J.length;if(I>0){var q=(s&vs)!==0&&a===0?t:null;if(o){for(g=0;g<I;g+=1)(ye=(_e=J[g].nodes)==null?void 0:_e.a)==null||ye.measure();for(g=0;g<I;g+=1)(ae=(oe=J[g].nodes)==null?void 0:oe.a)==null||ae.fix()}Qr(n,J,q)}}o&&Mr(()=>{var ce,Ye;if(d!==void 0)for(_ of d)(Ye=(ce=_.nodes)==null?void 0:ce.a)==null||Ye.apply()})}function Zr(n,e,t,s,i,o,a,f){var c=(a&Ar)!==0?(a&Rr)===0?ps(t,!1,!1):Gn(t):null,p=(a&Tr)!==0?Gn(i):null;return{v:c,i:p,e:rn(()=>(o(e,c??t,p??i,f),()=>{n.delete(s)}))}}function lt(n,e,t){if(n.nodes)for(var s=n.nodes.start,i=n.nodes.end,o=e&&(e.f&Ne)===0?e.nodes.start:t;s!==null;){var a=Nt(s);if(o.before(s),s===i)return;s=a}}function Le(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}function ms(n,e,t=!1,s=!1,i=!1){var o=n,a="";de(()=>{var f=Lr;if(a===(a=e()??"")){be&&Tt();return}if(f.nodes!==null&&(Ir(f.nodes.start,f.nodes.end),f.nodes=null),a!==""){if(be){ze.data;for(var c=Tt(),p=c;c!==null&&(c.nodeType!==mn||c.data!=="");)p=c,c=Nt(c);if(c===null)throw Pr(),Dr;Wn(ze,p),o=et(c);return}var u=a+"";t?u=`<svg>${u}</svg>`:s&&(u=`<math>${u}</math>`);var d=br(u);if((t||s)&&(d=$e(d)),Wn($e(d),d.lastChild),t||s)for(;$e(d);)o.before($e(d));else o.before(d)}})}function ei(n,e,t,s,i){var f;be&&Tt();var o=(f=e.$$slots)==null?void 0:f[t],a=!1;o===!0&&(o=e.children,a=!0),o===void 0?i!==null&&i(n):o(n,a?()=>s:s)}function ti(n,e){let t=null,s=be;var i;if(be){t=ze;for(var o=$e(document.head);o!==null&&(o.nodeType!==mn||o.data!==n);)o=Nt(o);if(o===null)ft(!1);else{var a=Nt(o);o.remove(),et(a)}}be||(i=document.head.appendChild(xt()));try{ds(()=>e(i),jr)}finally{s&&(ft(!0),et(t))}}const ln=En([]),mt=new Map;function ws(n,e=!1){var t,s,i;if(console.log("displayMessage called:",{type:n.type,context:n.context,isResponse:e,actor:n.actor,content:(t=n.object)==null?void 0:t.content}),n.type==="send"&&((s=n.object)==null?void 0:s.type)==="message"){const o=typeof n.actor=="string"?n.actor:((i=n.actor)==null?void 0:i.name)||"",a=n.object.content||"",f=`${o}:${a}`,c=Date.now(),p=mt.get(f);if(p&&c-p<2e3){console.log("Skipping duplicate message:",f);return}mt.set(f,c);for(const[u,d]of mt)c-d>5e3&&mt.delete(u);ln.set([...Fr(ln),[o,a]]),console.log("Message displayed:",{actorName:o,content:a,isResponse:e,context:n.context})}}var ni=ie("<li> </li>"),si=ie('<div><label for="incomingMessagesContainer" class="text-gray-900 font-bold">Incoming Messages</label> <div id="incomingMessagesContainer" class="incoming-messages-container w-full"><ui class="incoming-messages"></ui> <div class="incoming-messages-anchor"></div></div></div>');function Yo(n,e){Pe(e,!1);const t=()=>zr(ln,"$messages",s),[s,i]=Wr();bs();var o=si(),a=W(B(o),2),f=B(a);cn(f,5,t,on,(c,p)=>{var u=ni(),d=B(u);R(u),de(()=>fe(d,`${K(p)[0]??""}: ${K(p)[1]??""}`)),F(c,u)}),R(f),_s(2),R(a),R(o),F(n,o),De(),i()}var ri=ie("<span> </span>");function kn(n,e){Pe(e,!0);var t=ri(),s=B(t);R(t),de(()=>fe(s,`[${e.entry.context??""}:${e.entry.type??""}]`)),F(n,t),De()}var ii=ie("<!> <span> </span> <span> </span>",1);function oi(n,e){Pe(e,!0);var t=ii(),s=pe(t);kn(s,{get entry(){return e.entry}});var i=W(s,2),o=B(i);R(i);var a=W(i,2),f=B(a,!0);R(a),de(()=>{var c,p,u;fe(o,`#${e.id??""}
|
|
2
|
-
${(typeof e.entry.actor=="string"?e.entry.actor:((c=e.entry.actor)==null?void 0:c.name)||((p=e.entry.actor)==null?void 0:p.id))??""}:`),fe(f,((u=e.entry.object)==null?void 0:u.content)||"")}),F(n,t),De()}var ai=ie('<span class="font-medium">📰 Fetched feed:</span> <span> </span> <span class="text-gray-500"> </span>',1),ci=ie("<span> </span>"),li=ie('<span class="text-gray-500 text-xs italic"> </span>'),ui=ie('<span class="text-gray-500"> </span> <!> <span><a rel="noreferrer" target="_blank" class="text-blue-600 hover:text-blue-800 underline"><!></a></span> <!>',1),fi=ie("<!> <!>",1);function hi(n,e){var u,d,b;Pe(e,!0);const t=e.entry.totalItems!==void 0,s=t?e.entry.summary:(u=e.entry.object)==null?void 0:u.url,i=typeof e.entry.actor=="string"?e.entry.actor:((d=e.entry.actor)==null?void 0:d.name)||((b=e.entry.actor)==null?void 0:b.id);var o=fi(),a=pe(o);kn(a,{get entry(){return e.entry}});var f=W(a,2);{var c=k=>{var T=ai(),O=W(pe(T),2),_=B(O,!0);R(O);var g=W(O,2),z=B(g);R(g),de(()=>{fe(_,s),fe(z,`(${e.entry.totalItems??""} ${e.entry.totalItems===1?"item":"items"})`)}),F(k,T)},p=k=>{var T=ui(),O=pe(T),_=B(O);R(O);var g=W(O,2);{var z=A=>{var P=ci(),D=B(P);R(P),de(()=>fe(D,`${i??""}:`)),F(A,P)};ge(g,A=>{i&&A(z)})}var Y=W(g,2),N=B(Y),Z=B(N);{var ee=A=>{var P=Te(),D=pe(P);ms(D,()=>{var j;return(j=e.entry.object)==null?void 0:j.title}),F(A,P)},J=A=>{var P=fs();de(()=>{var D,j;return fe(P,(D=e.entry.object)!=null&&D.title||typeof e.entry.target=="string"?e.entry.target:(j=e.entry.target)==null?void 0:j.id)}),F(A,P)};ge(Z,A=>{var P;((P=e.entry.object)==null?void 0:P.contentType)==="html"?A(ee):A(J,!1)})}R(N),R(Y);var I=W(Y,2);{var q=A=>{var P=li(),D=B(P,!0);R(P),de(j=>fe(D,j),[()=>{var j;return(j=e.entry.object)==null?void 0:j.published.split("T")[0]}]),F(A,P)};ge(I,A=>{var P;(P=e.entry.object)!=null&&P.published&&A(q)})}de(()=>{var A;fe(_,`#${e.id??""}`),Xr(N,"href",(A=e.entry.object)==null?void 0:A.url)}),F(k,T)};ge(f,k=>{t?k(c):k(p,!1)})}F(n,o),De()}var di=ie("<!> <span> </span>",1);function pi(n,e){Pe(e,!0);var t=di(),s=pe(t);kn(s,{get entry(){return e.entry}});var i=W(s,2),o=B(i);R(i),de(()=>{var a,f;return fe(o,`#${e.id??""}
|
|
3
|
-
${(typeof e.entry.actor=="string"?e.entry.actor:((a=e.entry.actor)==null?void 0:a.name)||((f=e.entry.actor)==null?void 0:f.id))??""}`)}),F(n,t),De()}var gi=ie('<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full"> </span>'),yi=ie('<span class="px-2 py-1 bg-purple-100 text-purple-800 text-xs font-medium rounded-full"> </span>'),vi=ie('<div class="mt-2 p-3 bg-red-50 border border-red-200 rounded-lg"><div class="flex items-center space-x-2"><svg class="w-4 h-4 text-red-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="text-red-800 font-medium text-sm">Error:</span> <span class="text-red-700 text-sm"> </span></div></div>'),_i=ie('<li class="p-4 hover:bg-gray-50 transition-colors"><div class="flex items-start space-x-3"><div class="flex flex-col items-center space-y-1 mt-1"><div></div> <div class="text-xs text-gray-400 font-mono"> </div></div> <div class="flex-1 min-w-0"><div class="flex items-center justify-between mb-2"><div class="flex items-center space-x-2"><span class="text-sm font-semibold text-gray-700"> </span> <!> <!></div> <button class="px-3 py-1 text-xs font-medium text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded-md transition-colors flex items-center space-x-1"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg> <span>View Details</span></button></div> <div class="text-sm text-gray-600"><!></div> <!></div></div></li>');function Qt(n,e){Pe(e,!0);var t=_i(),s=B(t),i=B(s),o=B(i),a=W(o,2),f=B(a);R(a),R(i);var c=W(i,2),p=B(c),u=B(p),d=B(u),b=B(d,!0);R(d);var k=W(d,2);{var T=I=>{var q=gi(),A=B(q,!0);R(q),de(P=>fe(A,P),[()=>e.entry.context.toUpperCase()]),F(I,q)};ge(k,I=>{e.entry.context&&I(T)})}var O=W(k,2);{var _=I=>{var q=yi(),A=B(q,!0);R(q),de(()=>fe(A,e.entry.type)),F(I,q)};ge(O,I=>{e.entry.type&&I(_)})}R(u);var g=W(u,2);g.__click=function(...I){var q;(q=e.buttonAction)==null||q.apply(this,I)},R(p);var z=W(p,2),Y=B(z);{var N=I=>{oi(I,{get id(){return e.id},get entry(){return e.entry}})},Z=I=>{var q=Te(),A=pe(q);{var P=j=>{hi(j,{get id(){return e.id},get entry(){return e.entry}})},D=j=>{pi(j,{get id(){return e.id},get entry(){return e.entry}})};ge(A,j=>{e.entry.context==="feeds"?j(P):j(D,!1)},!0)}F(I,q)};ge(Y,I=>{e.entry.context==="dummy"?I(N):I(Z,!1)})}R(z);var ee=W(z,2);{var J=I=>{var q=vi(),A=B(q),P=W(B(A),4),D=B(P,!0);R(P),R(A),R(q),de(()=>fe(D,e.entry.error)),F(I,q)};ge(ee,I=>{e.entry.error&&I(J)})}R(c),R(s),R(t),de(()=>{xn(o,1,`w-3 h-3 ${e.response?"bg-green-500":"bg-orange-400"} rounded-full`),fe(f,`#${e.id??""}`),fe(b,e.response?"📥 Response":"📤 Sent")}),F(n,t),De()}hs(["click"]);function bi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $t,$n;function mi(){if($n)return $t;$n=1;function n(r){return r instanceof Map?r.clear=r.delete=r.set=function(){throw new Error("map is read-only")}:r instanceof Set&&(r.add=r.clear=r.delete=function(){throw new Error("set is read-only")}),Object.freeze(r),Object.getOwnPropertyNames(r).forEach(l=>{const y=r[l],C=typeof y;(C==="object"||C==="function")&&!Object.isFrozen(y)&&n(y)}),r}class e{constructor(l){l.data===void 0&&(l.data={}),this.data=l.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(r,...l){const y=Object.create(null);for(const C in r)y[C]=r[C];return l.forEach(function(C){for(const Q in C)y[Q]=C[Q]}),y}const i="</span>",o=r=>!!r.scope,a=(r,{prefix:l})=>{if(r.startsWith("language:"))return r.replace("language:","language-");if(r.includes(".")){const y=r.split(".");return[`${l}${y.shift()}`,...y.map((C,Q)=>`${C}${"_".repeat(Q+1)}`)].join(" ")}return`${l}${r}`};class f{constructor(l,y){this.buffer="",this.classPrefix=y.classPrefix,l.walk(this)}addText(l){this.buffer+=t(l)}openNode(l){if(!o(l))return;const y=a(l.scope,{prefix:this.classPrefix});this.span(y)}closeNode(l){o(l)&&(this.buffer+=i)}value(){return this.buffer}span(l){this.buffer+=`<span class="${l}">`}}const c=(r={})=>{const l={children:[]};return Object.assign(l,r),l};class p{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(l){this.top.children.push(l)}openNode(l){const y=c({scope:l});this.add(y),this.stack.push(y)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(l){return this.constructor._walk(l,this.rootNode)}static _walk(l,y){return typeof y=="string"?l.addText(y):y.children&&(l.openNode(y),y.children.forEach(C=>this._walk(l,C)),l.closeNode(y)),l}static _collapse(l){typeof l!="string"&&l.children&&(l.children.every(y=>typeof y=="string")?l.children=[l.children.join("")]:l.children.forEach(y=>{p._collapse(y)}))}}class u extends p{constructor(l){super(),this.options=l}addText(l){l!==""&&this.add(l)}startScope(l){this.openNode(l)}endScope(){this.closeNode()}__addSublanguage(l,y){const C=l.root;y&&(C.scope=`language:${y}`),this.add(C)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(r){return r?typeof r=="string"?r:r.source:null}function b(r){return O("(?=",r,")")}function k(r){return O("(?:",r,")*")}function T(r){return O("(?:",r,")?")}function O(...r){return r.map(y=>d(y)).join("")}function _(r){const l=r[r.length-1];return typeof l=="object"&&l.constructor===Object?(r.splice(r.length-1,1),l):{}}function g(...r){return"("+(_(r).capture?"":"?:")+r.map(C=>d(C)).join("|")+")"}function z(r){return new RegExp(r.toString()+"|").exec("").length-1}function Y(r,l){const y=r&&r.exec(l);return y&&y.index===0}const N=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Z(r,{joinWith:l}){let y=0;return r.map(C=>{y+=1;const Q=y;let $=d(C),w="";for(;$.length>0;){const m=N.exec($);if(!m){w+=$;break}w+=$.substring(0,m.index),$=$.substring(m.index+m[0].length),m[0][0]==="\\"&&m[1]?w+="\\"+String(Number(m[1])+Q):(w+=m[0],m[0]==="("&&y++)}return w}).map(C=>`(${C})`).join(l)}const ee=/\b\B/,J="[a-zA-Z]\\w*",I="[a-zA-Z_]\\w*",q="\\b\\d+(\\.\\d+)?",A="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",D="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(r={})=>{const l=/^#![ ]*\//;return r.binary&&(r.begin=O(l,/.*\b/,r.binary,/\b.*/)),s({scope:"meta",begin:l,end:/$/,relevance:0,"on:begin":(y,C)=>{y.index!==0&&C.ignoreMatch()}},r)},se={begin:"\\\\[\\s\\S]",relevance:0},_e={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[se]},ye={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[se]},oe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ae=function(r,l,y={}){const C=s({scope:"comment",begin:r,end:l,contains:[]},y);C.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Q=g("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return C.contains.push({begin:O(/[ ]+/,"(",Q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),C},ce=ae("//","$"),Ye=ae("/\\*","\\*/"),It=ae("#","$"),Pt={scope:"number",begin:q,relevance:0},Ce={scope:"number",begin:A,relevance:0},je={scope:"number",begin:P,relevance:0},st={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[se,{begin:/\[/,end:/\]/,relevance:0,contains:[se]}]},rt={scope:"title",begin:J,relevance:0},it={scope:"title",begin:I,relevance:0},we={begin:"\\.\\s*"+I,relevance:0};var He=Object.freeze({__proto__:null,APOS_STRING_MODE:_e,BACKSLASH_ESCAPE:se,BINARY_NUMBER_MODE:je,BINARY_NUMBER_RE:P,COMMENT:ae,C_BLOCK_COMMENT_MODE:Ye,C_LINE_COMMENT_MODE:ce,C_NUMBER_MODE:Ce,C_NUMBER_RE:A,END_SAME_AS_BEGIN:function(r){return Object.assign(r,{"on:begin":(l,y)=>{y.data._beginMatch=l[1]},"on:end":(l,y)=>{y.data._beginMatch!==l[1]&&y.ignoreMatch()}})},HASH_COMMENT_MODE:It,IDENT_RE:J,MATCH_NOTHING_RE:ee,METHOD_GUARD:we,NUMBER_MODE:Pt,NUMBER_RE:q,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:ye,REGEXP_MODE:st,RE_STARTERS_RE:D,SHEBANG:j,TITLE_MODE:rt,UNDERSCORE_IDENT_RE:I,UNDERSCORE_TITLE_MODE:it});function ht(r,l){r.input[r.index-1]==="."&&l.ignoreMatch()}function Dt(r,l){r.className!==void 0&&(r.scope=r.className,delete r.className)}function jt(r,l){l&&r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",r.__beforeBegin=ht,r.keywords=r.keywords||r.beginKeywords,delete r.beginKeywords,r.relevance===void 0&&(r.relevance=0))}function ot(r,l){Array.isArray(r.illegal)&&(r.illegal=g(...r.illegal))}function Ut(r,l){if(r.match){if(r.begin||r.end)throw new Error("begin & end are not supported with match");r.begin=r.match,delete r.match}}function Ht(r,l){r.relevance===void 0&&(r.relevance=1)}const qt=(r,l)=>{if(!r.beforeMatch)return;if(r.starts)throw new Error("beforeMatch cannot be used with starts");const y=Object.assign({},r);Object.keys(r).forEach(C=>{delete r[C]}),r.keywords=y.keywords,r.begin=O(y.beforeMatch,b(y.begin)),r.starts={relevance:0,contains:[Object.assign(y,{endsParent:!0})]},r.relevance=0,delete y.beforeMatch},Hs=["of","and","for","in","not","or","if","then","parent","list","value"],qs="keyword";function Nn(r,l,y=qs){const C=Object.create(null);return typeof r=="string"?Q(y,r.split(" ")):Array.isArray(r)?Q(y,r):Object.keys(r).forEach(function($){Object.assign(C,Nn(r[$],l,$))}),C;function Q($,w){l&&(w=w.map(m=>m.toLowerCase())),w.forEach(function(m){const S=m.split("|");C[S[0]]=[$,Fs(S[0],S[1])]})}}function Fs(r,l){return l?Number(l):Vs(r)?0:1}function Vs(r){return Hs.includes(r.toLowerCase())}const Cn={},qe=r=>{console.error(r)},Mn=(r,...l)=>{console.log(`WARN: ${r}`,...l)},Xe=(r,l)=>{Cn[`${r}/${l}`]||(console.log(`Deprecated as of ${r}. ${l}`),Cn[`${r}/${l}`]=!0)},dt=new Error;function Bn(r,l,{key:y}){let C=0;const Q=r[y],$={},w={};for(let m=1;m<=l.length;m++)w[m+C]=Q[m],$[m+C]=!0,C+=z(l[m-1]);r[y]=w,r[y]._emit=$,r[y]._multi=!0}function Ks(r){if(Array.isArray(r.begin)){if(r.skip||r.excludeBegin||r.returnBegin)throw qe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),dt;if(typeof r.beginScope!="object"||r.beginScope===null)throw qe("beginScope must be object"),dt;Bn(r,r.begin,{key:"beginScope"}),r.begin=Z(r.begin,{joinWith:""})}}function zs(r){if(Array.isArray(r.end)){if(r.skip||r.excludeEnd||r.returnEnd)throw qe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),dt;if(typeof r.endScope!="object"||r.endScope===null)throw qe("endScope must be object"),dt;Bn(r,r.end,{key:"endScope"}),r.end=Z(r.end,{joinWith:""})}}function Ws(r){r.scope&&typeof r.scope=="object"&&r.scope!==null&&(r.beginScope=r.scope,delete r.scope)}function Ys(r){Ws(r),typeof r.beginScope=="string"&&(r.beginScope={_wrap:r.beginScope}),typeof r.endScope=="string"&&(r.endScope={_wrap:r.endScope}),Ks(r),zs(r)}function Xs(r){function l(w,m){return new RegExp(d(w),"m"+(r.case_insensitive?"i":"")+(r.unicodeRegex?"u":"")+(m?"g":""))}class y{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(m,S){S.position=this.position++,this.matchIndexes[this.matchAt]=S,this.regexes.push([S,m]),this.matchAt+=z(m)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const m=this.regexes.map(S=>S[1]);this.matcherRe=l(Z(m,{joinWith:"|"}),!0),this.lastIndex=0}exec(m){this.matcherRe.lastIndex=this.lastIndex;const S=this.matcherRe.exec(m);if(!S)return null;const le=S.findIndex((at,Vt)=>Vt>0&&at!==void 0),te=this.matchIndexes[le];return S.splice(0,le),Object.assign(S,te)}}class C{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(m){if(this.multiRegexes[m])return this.multiRegexes[m];const S=new y;return this.rules.slice(m).forEach(([le,te])=>S.addRule(le,te)),S.compile(),this.multiRegexes[m]=S,S}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(m,S){this.rules.push([m,S]),S.type==="begin"&&this.count++}exec(m){const S=this.getMatcher(this.regexIndex);S.lastIndex=this.lastIndex;let le=S.exec(m);if(this.resumingScanAtSamePosition()&&!(le&&le.index===this.lastIndex)){const te=this.getMatcher(0);te.lastIndex=this.lastIndex+1,le=te.exec(m)}return le&&(this.regexIndex+=le.position+1,this.regexIndex===this.count&&this.considerAll()),le}}function Q(w){const m=new C;return w.contains.forEach(S=>m.addRule(S.begin,{rule:S,type:"begin"})),w.terminatorEnd&&m.addRule(w.terminatorEnd,{type:"end"}),w.illegal&&m.addRule(w.illegal,{type:"illegal"}),m}function $(w,m){const S=w;if(w.isCompiled)return S;[Dt,Ut,Ys,qt].forEach(te=>te(w,m)),r.compilerExtensions.forEach(te=>te(w,m)),w.__beforeBegin=null,[jt,ot,Ht].forEach(te=>te(w,m)),w.isCompiled=!0;let le=null;return typeof w.keywords=="object"&&w.keywords.$pattern&&(w.keywords=Object.assign({},w.keywords),le=w.keywords.$pattern,delete w.keywords.$pattern),le=le||/\w+/,w.keywords&&(w.keywords=Nn(w.keywords,r.case_insensitive)),S.keywordPatternRe=l(le,!0),m&&(w.begin||(w.begin=/\B|\b/),S.beginRe=l(S.begin),!w.end&&!w.endsWithParent&&(w.end=/\B|\b/),w.end&&(S.endRe=l(S.end)),S.terminatorEnd=d(S.end)||"",w.endsWithParent&&m.terminatorEnd&&(S.terminatorEnd+=(w.end?"|":"")+m.terminatorEnd)),w.illegal&&(S.illegalRe=l(w.illegal)),w.contains||(w.contains=[]),w.contains=[].concat(...w.contains.map(function(te){return Gs(te==="self"?w:te)})),w.contains.forEach(function(te){$(te,S)}),w.starts&&$(w.starts,m),S.matcher=Q(S),S}if(r.compilerExtensions||(r.compilerExtensions=[]),r.contains&&r.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return r.classNameAliases=s(r.classNameAliases||{}),$(r)}function Ln(r){return r?r.endsWithParent||Ln(r.starts):!1}function Gs(r){return r.variants&&!r.cachedVariants&&(r.cachedVariants=r.variants.map(function(l){return s(r,{variants:null},l)})),r.cachedVariants?r.cachedVariants:Ln(r)?s(r,{starts:r.starts?s(r.starts):null}):Object.isFrozen(r)?s(r):r}var Js="11.11.1";class Qs extends Error{constructor(l,y){super(l),this.name="HTMLInjectionError",this.html=y}}const Ft=t,In=s,Pn=Symbol("nomatch"),$s=7,Dn=function(r){const l=Object.create(null),y=Object.create(null),C=[];let Q=!0;const $="Could not find the language '{}', did you forget to load/include a language module?",w={disableAutodetect:!0,name:"Plain text",contains:[]};let m={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function S(h){return m.noHighlightRe.test(h)}function le(h){let x=h.className+" ";x+=h.parentNode?h.parentNode.className:"";const U=m.languageDetectRe.exec(x);if(U){const X=Me(U[1]);return X||(Mn($.replace("{}",U[1])),Mn("Falling back to no-highlight mode for this block.",h)),X?U[1]:"no-highlight"}return x.split(/\s+/).find(X=>S(X)||Me(X))}function te(h,x,U){let X="",re="";typeof x=="object"?(X=h,U=x.ignoreIllegals,re=x.language):(Xe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Xe("10.7.0",`Please use highlight(code, options) instead.
|
|
4
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),re=h,X=x),U===void 0&&(U=!0);const Ee={code:X,language:re};gt("before:highlight",Ee);const Be=Ee.result?Ee.result:at(Ee.language,Ee.code,U);return Be.code=Ee.code,gt("after:highlight",Be),Be}function at(h,x,U,X){const re=Object.create(null);function Ee(v,E){return v.keywords[E]}function Be(){if(!M.keywords){ue.addText(G);return}let v=0;M.keywordPatternRe.lastIndex=0;let E=M.keywordPatternRe.exec(G),L="";for(;E;){L+=G.substring(v,E.index);const V=Oe.case_insensitive?E[0].toLowerCase():E[0],he=Ee(M,V);if(he){const[Re,gr]=he;if(ue.addText(L),L="",re[V]=(re[V]||0)+1,re[V]<=$s&&(_t+=gr),Re.startsWith("_"))L+=E[0];else{const yr=Oe.classNameAliases[Re]||Re;ke(E[0],yr)}}else L+=E[0];v=M.keywordPatternRe.lastIndex,E=M.keywordPatternRe.exec(G)}L+=G.substring(v),ue.addText(L)}function yt(){if(G==="")return;let v=null;if(typeof M.subLanguage=="string"){if(!l[M.subLanguage]){ue.addText(G);return}v=at(M.subLanguage,G,!0,zn[M.subLanguage]),zn[M.subLanguage]=v._top}else v=Kt(G,M.subLanguage.length?M.subLanguage:null);M.relevance>0&&(_t+=v.relevance),ue.__addSublanguage(v._emitter,v.language)}function ve(){M.subLanguage!=null?yt():Be(),G=""}function ke(v,E){v!==""&&(ue.startScope(E),ue.addText(v),ue.endScope())}function qn(v,E){let L=1;const V=E.length-1;for(;L<=V;){if(!v._emit[L]){L++;continue}const he=Oe.classNameAliases[v[L]]||v[L],Re=E[L];he?ke(Re,he):(G=Re,Be(),G=""),L++}}function Fn(v,E){return v.scope&&typeof v.scope=="string"&&ue.openNode(Oe.classNameAliases[v.scope]||v.scope),v.beginScope&&(v.beginScope._wrap?(ke(G,Oe.classNameAliases[v.beginScope._wrap]||v.beginScope._wrap),G=""):v.beginScope._multi&&(qn(v.beginScope,E),G="")),M=Object.create(v,{parent:{value:M}}),M}function Vn(v,E,L){let V=Y(v.endRe,L);if(V){if(v["on:end"]){const he=new e(v);v["on:end"](E,he),he.isMatchIgnored&&(V=!1)}if(V){for(;v.endsParent&&v.parent;)v=v.parent;return v}}if(v.endsWithParent)return Vn(v.parent,E,L)}function ur(v){return M.matcher.regexIndex===0?(G+=v[0],1):(Xt=!0,0)}function fr(v){const E=v[0],L=v.rule,V=new e(L),he=[L.__beforeBegin,L["on:begin"]];for(const Re of he)if(Re&&(Re(v,V),V.isMatchIgnored))return ur(E);return L.skip?G+=E:(L.excludeBegin&&(G+=E),ve(),!L.returnBegin&&!L.excludeBegin&&(G=E)),Fn(L,v),L.returnBegin?0:E.length}function hr(v){const E=v[0],L=x.substring(v.index),V=Vn(M,v,L);if(!V)return Pn;const he=M;M.endScope&&M.endScope._wrap?(ve(),ke(E,M.endScope._wrap)):M.endScope&&M.endScope._multi?(ve(),qn(M.endScope,v)):he.skip?G+=E:(he.returnEnd||he.excludeEnd||(G+=E),ve(),he.excludeEnd&&(G=E));do M.scope&&ue.closeNode(),!M.skip&&!M.subLanguage&&(_t+=M.relevance),M=M.parent;while(M!==V.parent);return V.starts&&Fn(V.starts,v),he.returnEnd?0:E.length}function dr(){const v=[];for(let E=M;E!==Oe;E=E.parent)E.scope&&v.unshift(E.scope);v.forEach(E=>ue.openNode(E))}let vt={};function Kn(v,E){const L=E&&E[0];if(G+=v,L==null)return ve(),0;if(vt.type==="begin"&&E.type==="end"&&vt.index===E.index&&L===""){if(G+=x.slice(E.index,E.index+1),!Q){const V=new Error(`0 width match regex (${h})`);throw V.languageName=h,V.badRule=vt.rule,V}return 1}if(vt=E,E.type==="begin")return fr(E);if(E.type==="illegal"&&!U){const V=new Error('Illegal lexeme "'+L+'" for mode "'+(M.scope||"<unnamed>")+'"');throw V.mode=M,V}else if(E.type==="end"){const V=hr(E);if(V!==Pn)return V}if(E.type==="illegal"&&L==="")return G+=`
|
|
5
|
-
`,1;if(Yt>1e5&&Yt>E.index*3)throw new Error("potential infinite loop, way more iterations than matches");return G+=L,L.length}const Oe=Me(h);if(!Oe)throw qe($.replace("{}",h)),new Error('Unknown language: "'+h+'"');const pr=Xs(Oe);let Wt="",M=X||pr;const zn={},ue=new m.__emitter(m);dr();let G="",_t=0,Fe=0,Yt=0,Xt=!1;try{if(Oe.__emitTokens)Oe.__emitTokens(x,ue);else{for(M.matcher.considerAll();;){Yt++,Xt?Xt=!1:M.matcher.considerAll(),M.matcher.lastIndex=Fe;const v=M.matcher.exec(x);if(!v)break;const E=x.substring(Fe,v.index),L=Kn(E,v);Fe=v.index+L}Kn(x.substring(Fe))}return ue.finalize(),Wt=ue.toHTML(),{language:h,value:Wt,relevance:_t,illegal:!1,_emitter:ue,_top:M}}catch(v){if(v.message&&v.message.includes("Illegal"))return{language:h,value:Ft(x),illegal:!0,relevance:0,_illegalBy:{message:v.message,index:Fe,context:x.slice(Fe-100,Fe+100),mode:v.mode,resultSoFar:Wt},_emitter:ue};if(Q)return{language:h,value:Ft(x),illegal:!1,relevance:0,errorRaised:v,_emitter:ue,_top:M};throw v}}function Vt(h){const x={value:Ft(h),illegal:!1,relevance:0,_top:w,_emitter:new m.__emitter(m)};return x._emitter.addText(h),x}function Kt(h,x){x=x||m.languages||Object.keys(l);const U=Vt(h),X=x.filter(Me).filter(Hn).map(ve=>at(ve,h,!1));X.unshift(U);const re=X.sort((ve,ke)=>{if(ve.relevance!==ke.relevance)return ke.relevance-ve.relevance;if(ve.language&&ke.language){if(Me(ve.language).supersetOf===ke.language)return 1;if(Me(ke.language).supersetOf===ve.language)return-1}return 0}),[Ee,Be]=re,yt=Ee;return yt.secondBest=Be,yt}function Zs(h,x,U){const X=x&&y[x]||U;h.classList.add("hljs"),h.classList.add(`language-${X}`)}function zt(h){let x=null;const U=le(h);if(S(U))return;if(gt("before:highlightElement",{el:h,language:U}),h.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",h);return}if(h.children.length>0&&(m.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(h)),m.throwUnescapedHTML))throw new Qs("One of your code blocks includes unescaped HTML.",h.innerHTML);x=h;const X=x.textContent,re=U?te(X,{language:U,ignoreIllegals:!0}):Kt(X);h.innerHTML=re.value,h.dataset.highlighted="yes",Zs(h,U,re.language),h.result={language:re.language,re:re.relevance,relevance:re.relevance},re.secondBest&&(h.secondBest={language:re.secondBest.language,relevance:re.secondBest.relevance}),gt("after:highlightElement",{el:h,result:re,text:X})}function er(h){m=In(m,h)}const tr=()=>{pt(),Xe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function nr(){pt(),Xe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let jn=!1;function pt(){function h(){pt()}if(document.readyState==="loading"){jn||window.addEventListener("DOMContentLoaded",h,!1),jn=!0;return}document.querySelectorAll(m.cssSelector).forEach(zt)}function sr(h,x){let U=null;try{U=x(r)}catch(X){if(qe("Language definition for '{}' could not be registered.".replace("{}",h)),Q)qe(X);else throw X;U=w}U.name||(U.name=h),l[h]=U,U.rawDefinition=x.bind(null,r),U.aliases&&Un(U.aliases,{languageName:h})}function rr(h){delete l[h];for(const x of Object.keys(y))y[x]===h&&delete y[x]}function ir(){return Object.keys(l)}function Me(h){return h=(h||"").toLowerCase(),l[h]||l[y[h]]}function Un(h,{languageName:x}){typeof h=="string"&&(h=[h]),h.forEach(U=>{y[U.toLowerCase()]=x})}function Hn(h){const x=Me(h);return x&&!x.disableAutodetect}function or(h){h["before:highlightBlock"]&&!h["before:highlightElement"]&&(h["before:highlightElement"]=x=>{h["before:highlightBlock"](Object.assign({block:x.el},x))}),h["after:highlightBlock"]&&!h["after:highlightElement"]&&(h["after:highlightElement"]=x=>{h["after:highlightBlock"](Object.assign({block:x.el},x))})}function ar(h){or(h),C.push(h)}function cr(h){const x=C.indexOf(h);x!==-1&&C.splice(x,1)}function gt(h,x){const U=h;C.forEach(function(X){X[U]&&X[U](x)})}function lr(h){return Xe("10.7.0","highlightBlock will be removed entirely in v12.0"),Xe("10.7.0","Please use highlightElement now."),zt(h)}Object.assign(r,{highlight:te,highlightAuto:Kt,highlightAll:pt,highlightElement:zt,highlightBlock:lr,configure:er,initHighlighting:tr,initHighlightingOnLoad:nr,registerLanguage:sr,unregisterLanguage:rr,listLanguages:ir,getLanguage:Me,registerAliases:Un,autoDetection:Hn,inherit:In,addPlugin:ar,removePlugin:cr}),r.debugMode=function(){Q=!1},r.safeMode=function(){Q=!0},r.versionString=Js,r.regex={concat:O,lookahead:b,either:g,optional:T,anyNumberOfTimes:k};for(const h in He)typeof He[h]=="object"&&n(He[h]);return Object.assign(r,He),r},Ge=Dn({});return Ge.newInstance=()=>Dn({}),$t=Ge,Ge.HighlightJS=Ge,Ge.default=Ge,$t}var wi=mi();const Zn=bi(wi);var Ei=ie("<pre><code><!></code></pre>");function xi(n,e){const t=Ct(e,["children","$$slots","$$events","$$legacy"]),s=Ct(t,["code","highlighted","languageName","langtag"]);let i=We(e,"code",8),o=We(e,"highlighted",8),a=We(e,"languageName",8,"plaintext"),f=We(e,"langtag",8,!1);var c=Ei();Gr(c,()=>({"data-language":a(),...s,[Jr]:{langtag:f()}}),void 0,void 0,void 0,"svelte-4jgeki");var p=B(c);xn(p,1,"",null,{},{hljs:!0});var u=B(p);{var d=k=>{var T=Te(),O=pe(T);ms(O,o),F(k,T)},b=k=>{var T=fs();de(()=>fe(T,i())),F(k,T)};ge(u,k=>{o()?k(d):k(b,!1)})}R(p),R(c),F(n,c)}function es(n,e){const t=Ct(e,["children","$$slots","$$events","$$legacy"]),s=Ct(t,["language","code","langtag"]);Pe(e,!1);let i=We(e,"language",8),o=We(e,"code",8),a=We(e,"langtag",8,!1);const f=Vr();let c=ps("");Kr(()=>{K(c)&&f("highlight",{highlighted:K(c)})}),Ur(()=>(Jt(i()),Jt(o())),()=>{Zn.registerLanguage(i().name,i().register),Ke(c,Zn.highlight(o(),{language:i().name}).value)}),Hr(),bs();var p=Te(),u=pe(p);ei(u,e,"default",{get highlighted(){return K(c)}},d=>{xi(d,Yr(()=>s,{get languageName(){return Jt(i()),qr(()=>i().name)},get langtag(){return a()},get highlighted(){return K(c)},get code(){return o()}}))}),F(n,p),De()}function ki(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],i={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[e,t,n.QUOTE_STRING_MODE,i,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const ts={name:"json",register:ki},Es=En({});let ns=0;function Zt(n,e,t=!1){let s;return e.id?s=e.id:s=`${++ns}`,e.id=s,t&&(s=`${s}-${++ns}`),Es.update(i=>{if(!i[s])n==="SEND"?i[s]=[e,{}]:i[s]=[{},e];else{const o=n==="SEND"?0:1;i[s][o]=e}return i}),e}var Oi=ie(`<style>body {
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
}</style>`),Si=ie('<div class="p-8 text-center text-gray-500"><div class="text-4xl mb-2">📭</div> <p class="font-medium">No activity yet</p> <p class="text-sm">Activity will appear here when you interact with Sockethub</p></div>'),Ai=ie('<ul class="divide-y divide-gray-100"></ul>'),Ri=ie(`<div class="bg-gradient-to-r from-slate-50 to-gray-50 border border-gray-200 rounded-xl p-6 shadow-sm"><div class="flex items-center justify-between mb-4"><div><h3 class="text-xl font-bold text-gray-900 flex items-center"><span class="mr-2">📡</span> Sockethub Activity Log</h3> <p class="text-gray-600 text-sm mt-1">Real-time communication between your browser and Sockethub server</p></div> <div class="flex items-center space-x-4 text-xs"><div class="flex items-center space-x-1"><div class="w-3 h-3 bg-orange-400 rounded-full"></div> <span class="text-gray-600">Outgoing</span></div> <div class="flex items-center space-x-1"><div class="w-3 h-3 bg-green-500 rounded-full"></div> <span class="text-gray-600">Response</span></div></div></div> <div class="bg-white rounded-lg border border-gray-200 shadow-sm"><div class="p-4 border-b border-gray-200 bg-gray-50 rounded-t-lg"><p class="text-sm text-gray-700">💡 <strong>How to read this log:</strong> Each entry shows messages sent to and received from Sockethub.
|
|
8
|
-
Click "View Details" to see the full JSON data being exchanged.</p></div> <div id="messages" class="max-h-96 overflow-y-auto"><!></div></div></div> <div><div class="bg-white rounded-xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col"><div class="bg-gradient-to-r from-indigo-50 to-purple-50 px-6 py-4 border-b border-gray-200"><div class="flex items-center justify-between"><h3 class="text-lg font-bold text-gray-900 flex items-center"><span class="mr-2">🔍</span> ActivityStreams Data Exchange</h3> <button class="text-gray-400 hover:text-gray-600 transition-colors"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <p class="text-gray-600 text-sm mt-1">Raw JSON data showing the ActivityStreams message exchange with Sockethub</p></div> <div class="flex-1 overflow-auto p-6 space-y-6"><div class="bg-gradient-to-r from-blue-50 to-cyan-50 border border-blue-200 rounded-lg p-4"><h4 class="font-semibold text-blue-900 mb-3 flex items-center"><span class="mr-2">📤</span> Sent to Sockethub</h4> <div class="bg-white rounded border border-blue-200 overflow-hidden"><!></div></div> <div class="bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-lg p-4"><h4 class="font-semibold text-green-900 mb-3 flex items-center"><span class="mr-2">📥</span> Response from Sockethub</h4> <div class="bg-white rounded border border-green-200 overflow-hidden"><!></div></div></div> <div class="bg-gray-50 px-6 py-4 border-t border-gray-200 flex justify-end"><button class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors font-medium">Close</button></div></div></div>`,1);function Xo(n,e){Pe(e,!0);let t=bt(void 0),s=bt(!1),i=bt(""),o=bt("");Es.subscribe(D=>{Ke(t,D,!0)});function a(D){return()=>{let j=D,se=D;D.includes("-")&&(j=D.split("-")[0]),console.log(`indexSend:${j} indexResp:${se}`),console.log("logs: ",K(t)),Ke(s,!0),Ke(i,JSON.stringify(K(t)[j][0],null,2),!0),Ke(o,JSON.stringify(K(t)[se][1]||{},null,2),!0)}}var f=Ri();ti("asm1x0",D=>{var j=Te(),se=pe(j);{var _e=ye=>{var oe=Oi();F(ye,oe)};ge(se,ye=>{K(s)&&ye(_e)})}F(D,j)});var c=pe(f),p=W(B(c),2),u=W(B(p),2),d=B(u);{var b=D=>{var j=Si();F(D,j)},k=D=>{var j=Ai();cn(j,21,()=>Object.entries(K(t)).sort((se,_e)=>{let ye=se[0],oe,ae=_e[0],ce;return se[0].includes("-")&&([ye,oe]=se[0].split("-")),_e[0].includes("-")&&([ae,ce]=_e[0].split("-")),oe&&ce?parseInt(oe)>=parseInt(ce)?-1:1:parseInt(ye)>=parseInt(ae)?-1:1}),on,(se,_e)=>{var ye=Ve(()=>Jn(K(_e),2));let oe=()=>K(ye)[0],ae=()=>K(ye)[1];var ce=Te(),Ye=pe(ce);{var It=Ce=>{var je=Te(),st=pe(je);cn(st,17,()=>Object.entries(ae()[ae().length-1]),on,(rt,it)=>{var we=Ve(()=>Jn(K(it),2));let Ue=()=>K(we)[0],He=()=>K(we)[1];var ht=Te(),Dt=pe(ht);{var jt=ot=>{{let Ut=Ve(()=>a(`${oe()}-${Ue()}`)),Ht=Ve(()=>typeof K(t)[oe()][1]<"u"),qt=Ve(()=>`${oe()}-${Ue()}`);Qt(ot,{get buttonAction(){return K(Ut)},get response(){return K(Ht)},get id(){return K(qt)},get entry(){return He()}})}};ge(Dt,ot=>{He()&&ot(jt)})}F(rt,ht)}),F(Ce,je)},Pt=Ce=>{var je=Te(),st=pe(je);{var rt=we=>{{let Ue=Ve(()=>a(oe()));Qt(we,{get buttonAction(){return K(Ue)},get id(){return oe()},response:!0,get entry(){return ae()[1]}})}},it=we=>{{let Ue=Ve(()=>a(oe()));Qt(we,{get buttonAction(){return K(Ue)},get id(){return oe()},response:!1,get entry(){return ae()[0]}})}};ge(st,we=>{Object.prototype.hasOwnProperty.call(ae()[1],"context")?we(rt):we(it,!1)},!0)}F(Ce,je)};ge(Ye,Ce=>{Array.isArray(ae()[ae().length-1])?Ce(It):Ce(Pt,!1)})}F(se,ce)}),R(j),F(D,j)};ge(d,D=>{Object.keys(K(t)).length===0?D(b):D(k,!1)})}R(u),R(p),R(c);var T=W(c,2),O=B(T),_=B(O),g=B(_),z=W(B(g),2);z.__click=()=>Ke(s,!1),R(g),_s(2),R(_);var Y=W(_,2),N=B(Y),Z=W(B(N),2),ee=B(Z);es(ee,{get language(){return ts},get code(){return K(i)}}),R(Z),R(N);var J=W(N,2),I=W(B(J),2),q=B(I);es(q,{get language(){return ts},get code(){return K(o)}}),R(I),R(J),R(Y);var A=W(Y,2),P=B(A);P.__click=()=>Ke(s,!1),R(A),R(O),R(T),de(()=>xn(T,1,`${K(s)?"flex items-center justify-center":"hidden"} bg-black bg-opacity-50 fixed top-0 left-0 w-full h-full z-50 p-4`)),F(n,f),De()}hs(["click"]);var Ti=Object.create,Ni=Object.getPrototypeOf,ss=Object.defineProperty,Ci=Object.getOwnPropertyNames,Mi=Object.prototype.hasOwnProperty,Bi=(n,e,t)=>{t=n!=null?Ti(Ni(n)):{};const s=ss(t,"default",{value:n,enumerable:!0});for(let i of Ci(n))Mi.call(s,i)||ss(s,i,{get:()=>n[i],enumerable:!0});return s},Li=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Ii=Li((n,e)=>{var t=Object.prototype.hasOwnProperty,s="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(s=!1));function o(p,u,d){this.fn=p,this.context=u,this.once=d||!1}function a(p,u,d,b,k){if(typeof d!="function")throw new TypeError("The listener must be a function");var T=new o(d,b||p,k),O=s?s+u:u;return p._events[O]?p._events[O].fn?p._events[O]=[p._events[O],T]:p._events[O].push(T):(p._events[O]=T,p._eventsCount++),p}function f(p,u){--p._eventsCount===0?p._events=new i:delete p._events[u]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],d,b;if(this._eventsCount===0)return u;for(b in d=this._events)t.call(d,b)&&u.push(s?b.slice(1):b);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},c.prototype.listeners=function(u){var d=s?s+u:u,b=this._events[d];if(!b)return[];if(b.fn)return[b.fn];for(var k=0,T=b.length,O=new Array(T);k<T;k++)O[k]=b[k].fn;return O},c.prototype.listenerCount=function(u){var d=s?s+u:u,b=this._events[d];return b?b.fn?1:b.length:0},c.prototype.emit=function(u,d,b,k,T,O){var _=s?s+u:u;if(!this._events[_])return!1;var g=this._events[_],z=arguments.length,Y,N;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),z){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,b),!0;case 4:return g.fn.call(g.context,d,b,k),!0;case 5:return g.fn.call(g.context,d,b,k,T),!0;case 6:return g.fn.call(g.context,d,b,k,T,O),!0}for(N=1,Y=new Array(z-1);N<z;N++)Y[N-1]=arguments[N];g.fn.apply(g.context,Y)}else{var Z=g.length,ee;for(N=0;N<Z;N++)switch(g[N].once&&this.removeListener(u,g[N].fn,void 0,!0),z){case 1:g[N].fn.call(g[N].context);break;case 2:g[N].fn.call(g[N].context,d);break;case 3:g[N].fn.call(g[N].context,d,b);break;case 4:g[N].fn.call(g[N].context,d,b,k);break;default:if(!Y)for(ee=1,Y=new Array(z-1);ee<z;ee++)Y[ee-1]=arguments[ee];g[N].fn.apply(g[N].context,Y)}}return!0},c.prototype.on=function(u,d,b){return a(this,u,d,b,!1)},c.prototype.once=function(u,d,b){return a(this,u,d,b,!0)},c.prototype.removeListener=function(u,d,b,k){var T=s?s+u:u;if(!this._events[T])return this;if(!d)return f(this,T),this;var O=this._events[T];if(O.fn)O.fn===d&&(!k||O.once)&&(!b||O.context===b)&&f(this,T);else{for(var _=0,g=[],z=O.length;_<z;_++)(O[_].fn!==d||k&&!O[_].once||b&&O[_].context!==b)&&g.push(O[_]);g.length?this._events[T]=g.length===1?g[0]:g:f(this,T)}return this},c.prototype.removeAllListeners=function(u){var d;return u?(d=s?s+u:u,this._events[d]&&f(this,d)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=s,c.EventEmitter=c,typeof e<"u"&&(e.exports=c)}),Pi=Bi(Ii()),xs=Pi.default;/*!
|
|
9
|
-
* activity-streams
|
|
10
|
-
* https://github.com/silverbucket/activity-streams
|
|
11
|
-
*
|
|
12
|
-
* Developed and Maintained by:
|
|
13
|
-
* Nick Jennings <nick@silverbucket.net>
|
|
14
|
-
*
|
|
15
|
-
* activity-streams is released under the MIT (see LICENSE).
|
|
16
|
-
*
|
|
17
|
-
* You don't have to do anything special to choose one license or the other
|
|
18
|
-
* and you don't have to notify anyone which license you are using.
|
|
19
|
-
* Please see the corresponding license file for details of these licenses.
|
|
20
|
-
* You are free to use, modify and distribute this software, but all copyright
|
|
21
|
-
* information must remain.
|
|
22
|
-
*
|
|
23
|
-
*/var tt=new xs,kt={stream:["id","type","actor","target","object","context","context","published","error"],object:["id","type","context","alias","attachedTo","attachment","attributedTo","attributedWith","condition","content","contentMap","context","contextOf","name","endTime","generator","generatorOf","group","icon","image","inReplyTo","members","memberOf","message","location","locationOf","objectOf","originOf","presence","preview","previewOf","provider","providerOf","published","rating","relationship","resultOf","replies","role","scope","scopeOf","startTime","status","summary","topic","tag","tagOf","targetOf","title","titleMap","updated","url","xmpp:stanza-id"]},ks={"@id":"id","@type":"type",verb:"type",displayName:"name",objectType:"type",platform:"context"},rs={actor:{primary:"id",props:kt},target:{primary:"id",props:kt},object:{primary:"content",props:kt}},Ze=new Map,un={},fn=!1,hn=!0,Os=[];function Di(n,e){return!!(un[n]instanceof Object&&un[n].includes(e))}function ji(n,e){return n[ks[e]]=n[e],delete n[e],n}function dn(n,e,t=!1){if(e===null)throw new Error(`ActivityStreams validation failed: the "${n}" property is null. Example: { id: "user@example.com", type: "person" }`);if(e===void 0)throw new Error(`ActivityStreams validation failed: the "${n}" property is undefined. Example: { id: "user@example.com", type: "person" }`);if(typeof e=="string")throw new Error(`ActivityStreams validation failed: the "${n}" property received string "${e}" but expected an object. Use: { id: "${e}", type: "person" }`);if(typeof e!="object"||Array.isArray(e)){const o=Array.isArray(e)?"array":typeof e,a=String(e);throw new Error(`ActivityStreams validation failed: the "${n}" property must be an object, received ${o} (${a}). Example: { id: "user@example.com", type: "person" }`)}if(t&&!e.id)throw new Error(`ActivityStreams validation failed: the "${n}" property requires an 'id' property. Example: { id: "user@example.com", type: "person" }`);const i=Object.keys(e).filter(o=>!kt[n].includes(o));for(const o of i){let a=e;if(ks[o]){a=ji(a,o);continue}if(!Di(a.type,o)&&!Os.includes(a.type)){console.log(a);const f=typeof a[o]=="string"?`"${a[o]}"`:String(a[o]),c=`ActivityStreams validation failed: property "${o}" with value ${f} is not allowed on the "${n}" object of type "${a.type}".`;if(fn)throw new Error(c);hn&&console.warn(c)}}}function Ui(n){const e={};for(const t of Object.keys(n))if(typeof n[t]=="string")e[t]=Ze.get(n[t])||n[t];else if(Array.isArray(n[t])){e[t]=[];for(const s of n[t])typeof s=="string"&&e[t].push(Ze.get(s)||s)}else e[t]=n[t];for(const t of Object.keys(rs))if(typeof e[t]=="string"){const s=rs[t].primary,i={};i[s]=e[t],e[t]=i}return e}function Hi(n){dn("stream",n),typeof n.object=="object"&&dn("object",n.object);const e=Ui(n);return tt.emit("activity-stream",e),e}var qi={create:n=>{dn("object",n,!0);const e=n;return Ze.set(e.id,e),tt.emit("activity-object-create",e),e},delete:n=>{const e=Ze.delete(n);return e&&tt.emit("activity-object-delete",n),e},get:(n,e)=>{let t=Ze.get(n);if(!t){if(!e)return n;t={id:n}}return t},list:()=>Ze.keys()};function Ss(n={}){Os=(n==null?void 0:n.specialObjs)||[],fn=typeof n.failOnUnknownObjectProperties=="boolean"?n.failOnUnknownObjectProperties:fn,hn=typeof n.warnOnUnknownObjectProperties=="boolean"?n.warnOnUnknownObjectProperties:hn;for(const e of Object.keys(n.customProps||{}))typeof n.customProps[e]=="object"&&(un[e]=n.customProps[e]);return{Stream:Hi,Object:qi,on:(e,t)=>tt.on(e,t),once:(e,t)=>tt.once(e,t),off:(e,t)=>tt.off(e,t)}}(n=>{n.ASFactor=Ss})(typeof window=="object"?window:{});class Mt{constructor(e){Je(this,"events",{credentials:new Map,"activity-object":new Map,connect:new Map,join:new Map});Je(this,"_socket");Je(this,"ActivityStreams");Je(this,"socket");Je(this,"debug",!0);if(!e)throw new Error("SockethubClient requires a socket.io instance");this._socket=e,this.socket=this.createPublicEmitter(),this.registerSocketIOHandlers(),this.initActivityStreams(),this.ActivityStreams.on("activity-object-create",t=>{e.emit("activity-object",t,s=>{s?console.error("failed to create activity-object ",s):this.eventActivityObject(t)})}),e.on("activity-object",t=>{this.ActivityStreams.Object.create(t)})}initActivityStreams(){this.ActivityStreams=Ss({specialObjs:["credentials"]})}clearCredentials(){this.events.credentials.clear()}createPublicEmitter(){const e=new xs;return e._emit=e.emit,e.emit=(t,s,i)=>{t==="credentials"?this.eventCredentials(s):t==="activity-object"?this.eventActivityObject(s):t==="message"&&this.eventMessage(s),this._socket.emit(t,s,i)},e.connected=!1,e.disconnect=()=>{this._socket.disconnect()},e.connect=()=>{this._socket.connect()},e}eventActivityObject(e){e.id&&this.events["activity-object"].set(e.id,e)}eventCredentials(e){if(e.object&&e.object.type==="credentials"){const t=e.actor.id||e.actor;this.events.credentials.set(t,e)}}eventMessage(e){if(!this._socket.connected)return;const t=Mt.getKey(e);e.type==="join"||e.type==="connect"?this.events[e.type].set(t,e):e.type==="leave"?this.events.join.delete(t):e.type==="disconnect"&&this.events.connect.delete(t)}static getKey(e){var i;const t=((i=e.actor)==null?void 0:i.id)||e.actor;if(!t)throw new Error(`actor property not present for message type: ${e==null?void 0:e.type}`);const s=e.target?e.target.id||e.target:"";return`${t}-${s}`}log(e,t){this.debug&&console.log(e,t)}registerSocketIOHandlers(){const e=t=>async s=>{t==="connect"?(this.socket.id=this._socket.id,this.socket.connected=!0,this.replay("activity-object",this.events["activity-object"]),this.replay("credentials",this.events.credentials),this.replay("message",this.events.connect),this.replay("message",this.events.join)):t==="disconnect"&&(this.socket.connected=!1),this.socket._emit(t,s)};this._socket.on("connect",e("connect")),this._socket.on("connect_error",e("connect_error")),this._socket.on("disconnect",e("disconnect")),this._socket.on("message",t=>{this.socket._emit("message",this.ActivityStreams.Stream(t))})}hasActorId(e){return"actor"in e&&e.actor!==null&&typeof e.actor=="object"&&"id"in e.actor&&typeof e.actor.id=="string"}replay(e,t){for(const s of t.values()){const i=e==="activity-object",o=i?s:this.ActivityStreams.Stream(s);let a=o==null?void 0:o.id;if(!i&&this.hasActorId(o)){const f=o.actor;a=typeof f=="string"?f:f.id}this.log(`replaying ${e} for ${a}`),this._socket.emit(e,o)}}}(n=>{n.SockethubClient=Mt})(typeof window=="object"?window:{});const Ae=Object.create(null);Ae.open="0";Ae.close="1";Ae.ping="2";Ae.pong="3";Ae.message="4";Ae.upgrade="5";Ae.noop="6";const Ot=Object.create(null);Object.keys(Ae).forEach(n=>{Ot[Ae[n]]=n});const pn={type:"error",data:"parser error"},As=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Rs=typeof ArrayBuffer=="function",Ts=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,On=({type:n,data:e},t,s)=>As&&e instanceof Blob?t?s(e):is(e,s):Rs&&(e instanceof ArrayBuffer||Ts(e))?t?s(e):is(new Blob([e]),s):s(Ae[n]+(e||"")),is=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function os(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let en;function Fi(n,e){if(As&&n.data instanceof Blob)return n.data.arrayBuffer().then(os).then(e);if(Rs&&(n.data instanceof ArrayBuffer||Ts(n.data)))return e(os(n.data));On(n,!1,t=>{en||(en=new TextEncoder),e(en.encode(t))})}const as="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ut=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<as.length;n++)ut[as.charCodeAt(n)]=n;const Vi=n=>{let e=n.length*.75,t=n.length,s,i=0,o,a,f,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const p=new ArrayBuffer(e),u=new Uint8Array(p);for(s=0;s<t;s+=4)o=ut[n.charCodeAt(s)],a=ut[n.charCodeAt(s+1)],f=ut[n.charCodeAt(s+2)],c=ut[n.charCodeAt(s+3)],u[i++]=o<<2|a>>4,u[i++]=(a&15)<<4|f>>2,u[i++]=(f&3)<<6|c&63;return p},Ki=typeof ArrayBuffer=="function",Sn=(n,e)=>{if(typeof n!="string")return{type:"message",data:Ns(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:zi(n.substring(1),e)}:Ot[t]?n.length>1?{type:Ot[t],data:n.substring(1)}:{type:Ot[t]}:pn},zi=(n,e)=>{if(Ki){const t=Vi(n);return Ns(t,e)}else return{base64:!0,data:n}},Ns=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},Cs="",Wi=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((o,a)=>{On(o,!1,f=>{s[a]=f,++i===t&&e(s.join(Cs))})})},Yi=(n,e)=>{const t=n.split(Cs),s=[];for(let i=0;i<t.length;i++){const o=Sn(t[i],e);if(s.push(o),o.type==="error")break}return s};function Xi(){return new TransformStream({transform(n,e){Fi(n,t=>{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,s)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let tn;function wt(n){return n.reduce((e,t)=>e+t.length,0)}function Et(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;i<e;i++)t[i]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function Gi(n,e){tn||(tn=new TextDecoder);const t=[];let s=0,i=-1,o=!1;return new TransformStream({transform(a,f){for(t.push(a);;){if(s===0){if(wt(t)<1)break;const c=Et(t,1);o=(c[0]&128)===128,i=c[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(wt(t)<2)break;const c=Et(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(wt(t)<8)break;const c=Et(t,8),p=new DataView(c.buffer,c.byteOffset,c.length),u=p.getUint32(0);if(u>Math.pow(2,21)-1){f.enqueue(pn);break}i=u*Math.pow(2,32)+p.getUint32(4),s=3}else{if(wt(t)<i)break;const c=Et(t,i);f.enqueue(Sn(o?c:tn.decode(c),e)),s=0}if(i===0||i>n){f.enqueue(pn);break}}}})}const Ms=4;function ne(n){if(n)return Ji(n)}function Ji(n){for(var e in ne.prototype)n[e]=ne.prototype[e];return n}ne.prototype.on=ne.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};ne.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};ne.prototype.off=ne.prototype.removeListener=ne.prototype.removeAllListeners=ne.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+n],this};ne.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};ne.prototype.emitReserved=ne.prototype.emit;ne.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};ne.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Bt=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),me=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Qi="arraybuffer";function Bs(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const $i=me.setTimeout,Zi=me.clearTimeout;function Lt(n,e){e.useNativeTimers?(n.setTimeoutFn=$i.bind(me),n.clearTimeoutFn=Zi.bind(me)):(n.setTimeoutFn=me.setTimeout.bind(me),n.clearTimeoutFn=me.clearTimeout.bind(me))}const eo=1.33;function to(n){return typeof n=="string"?no(n):Math.ceil((n.byteLength||n.size)*eo)}function no(n){let e=0,t=0;for(let s=0,i=n.length;s<i;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function Ls(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function so(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function ro(n){let e={},t=n.split("&");for(let s=0,i=t.length;s<i;s++){let o=t[s].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class io extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class An extends ne{constructor(e){super(),this.writable=!1,Lt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new io(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Sn(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=so(e);return t.length?"?"+t:""}}class oo extends An{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Yi(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Wi(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Ls()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let Is=!1;try{Is=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ao=Is;function co(){}class lo extends oo{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class Se extends ne{constructor(e,t,s){super(),this.createRequest=e,Lt(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=Bs(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Se.requestsCount++,Se.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=co,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Se.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Se.requestsCount=0;Se.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cs);else if(typeof addEventListener=="function"){const n="onpagehide"in me?"pagehide":"unload";addEventListener(n,cs,!1)}}function cs(){for(let n in Se.requests)Se.requests.hasOwnProperty(n)&&Se.requests[n].abort()}const uo=function(){const n=Ps({xdomain:!1});return n&&n.responseType!==null}();class fo extends lo{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=uo&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Se(Ps,this.uri(),e)}}function Ps(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||ao))return new XMLHttpRequest}catch{}if(!e)try{return new me[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ds=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ho extends An{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=Ds?{}:Bs(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;On(s,this.supportsBinary,o=>{try{this.doWrite(s,o)}catch{}i&&Bt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ls()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const nn=me.WebSocket||me.MozWebSocket;class po extends ho{createSocket(e,t,s){return Ds?new nn(e,t,s):t?new nn(e,t):new nn(e)}doWrite(e,t){this.ws.send(t)}}class go extends An{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Gi(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Xi();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{s.read().then(({done:f,value:c})=>{f||(this.onPacket(c),o())}).catch(f=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&Bt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const yo={websocket:po,webtransport:go,polling:fo},vo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,_o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function gn(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=vo.exec(n||""),o={},a=14;for(;a--;)o[_o[a]]=i[a]||"";return t!=-1&&s!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=bo(o,o.path),o.queryKey=mo(o,o.query),o}function bo(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function mo(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,o){i&&(t[i]=o)}),t}const yn=typeof addEventListener=="function"&&typeof removeEventListener=="function",St=[];yn&&addEventListener("offline",()=>{St.forEach(n=>n())},!1);class Ie extends ne{constructor(e,t){if(super(),this.binaryType=Qi,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=gn(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=gn(t.host).host);Lt(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ro(this.opts.query)),yn&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},St.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Ms,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Ie.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Ie.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(t+=to(i)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Bt(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const o={type:e,data:t,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(Ie.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),yn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=St.indexOf(this._offlineEventListener);s!==-1&&St.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}Ie.protocol=Ms;class wo extends Ie{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;Ie.priorWebsocketSuccess=!1;const i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",d=>{if(!s)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Ie.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=t.name,this.emitReserved("upgradeError",b)}}))};function o(){s||(s=!0,u(),t.close(),t=null)}const a=d=>{const b=new Error("probe error: "+d);b.transport=t.name,o(),this.emitReserved("upgradeError",b)};function f(){a("transport closed")}function c(){a("socket closed")}function p(d){t&&d.name!==t.name&&o()}const u=()=>{t.removeListener("open",i),t.removeListener("error",a),t.removeListener("close",f),this.off("close",c),this.off("upgrading",p)};t.once("open",i),t.once("error",a),t.once("close",f),this.once("close",c),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let Eo=class extends wo{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>yo[i]).filter(i=>!!i)),super(e,s)}};function xo(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=gn(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+e,s.href=s.protocol+"://"+o+(t&&t.port===s.port?"":":"+s.port),s}const ko=typeof ArrayBuffer=="function",Oo=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,js=Object.prototype.toString,So=typeof Blob=="function"||typeof Blob<"u"&&js.call(Blob)==="[object BlobConstructor]",Ao=typeof File=="function"||typeof File<"u"&&js.call(File)==="[object FileConstructor]";function Rn(n){return ko&&(n instanceof ArrayBuffer||Oo(n))||So&&n instanceof Blob||Ao&&n instanceof File}function At(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(At(n[t]))return!0;return!1}if(Rn(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return At(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&At(n[t]))return!0;return!1}function Ro(n){const e=[],t=n.data,s=n;return s.data=vn(t,e),s.attachments=e.length,{packet:s,buffers:e}}function vn(n,e){if(!n)return n;if(Rn(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=vn(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=vn(n[s],e));return t}return n}function To(n,e){return n.data=_n(n.data,e),delete n.attachments,n}function _n(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=_n(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=_n(n[t],e));return n}const No=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Co=5;var H;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(H||(H={}));class Mo{constructor(e){this.replacer=e}encode(e){return(e.type===H.EVENT||e.type===H.ACK)&&At(e)?this.encodeAsBinary({type:e.type===H.EVENT?H.BINARY_EVENT:H.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===H.BINARY_EVENT||e.type===H.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Ro(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}}function ls(n){return Object.prototype.toString.call(n)==="[object Object]"}class Tn extends ne{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===H.BINARY_EVENT;s||t.type===H.BINARY_ACK?(t.type=s?H.EVENT:H.ACK,this.reconstructor=new Bo(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Rn(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(H[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===H.BINARY_EVENT||s.type===H.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const a=e.substring(o,t);if(a!=Number(a)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(a)}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(o,t)}else s.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const o=t+1;for(;++t;){const a=e.charAt(t);if(a==null||Number(a)!=a){--t;break}if(t===e.length)break}s.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(Tn.isPayloadValid(s.type,o))s.data=o;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case H.CONNECT:return ls(t);case H.DISCONNECT:return t===void 0;case H.CONNECT_ERROR:return typeof t=="string"||ls(t);case H.EVENT:case H.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&No.indexOf(t[0])===-1);case H.ACK:case H.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Bo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=To(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Lo=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Tn,Encoder:Mo,get PacketType(){return H},protocol:Co},Symbol.toStringTag,{value:"Module"}));function xe(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const Io=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Us extends ne{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[xe(e,"open",this.onopen.bind(this)),xe(e,"packet",this.onpacket.bind(this)),xe(e,"error",this.onerror.bind(this)),xe(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,o;if(Io.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const a={type:H.EVENT,data:t};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const u=this.ids++,d=t.pop();this._registerAckCallback(u,d),a.id=u}const f=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!f||(c?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,t){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===e&&this.sendBuffer.splice(f,1);t.call(this,new Error("operation has timed out"))},i),a=(...f)=>{this.io.clearTimeoutFn(o),t.apply(this,f)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...t){return new Promise((s,i)=>{const o=(a,f)=>a?i(a):s(f);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:H.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case H.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case H.EVENT:case H.BINARY_EVENT:this.onevent(e);break;case H.ACK:case H.BINARY_ACK:this.onack(e);break;case H.DISCONNECT:this.ondisconnect();break;case H.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:H.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:H.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}function nt(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}nt.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};nt.prototype.reset=function(){this.attempts=0};nt.prototype.setMin=function(n){this.ms=n};nt.prototype.setMax=function(n){this.max=n};nt.prototype.setJitter=function(n){this.jitter=n};class bn extends ne{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Lt(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new nt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Lo;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Eo(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=xe(t,"open",function(){s.onopen(),e&&e()}),o=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),e?e(f):this.maybeReconnectOnOpen()},a=xe(t,"error",o);if(this._timeout!==!1){const f=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},f);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(xe(e,"ping",this.onping.bind(this)),xe(e,"data",this.ondata.bind(this)),xe(e,"error",this.onerror.bind(this)),xe(e,"close",this.onclose.bind(this)),xe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Bt(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new Us(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ct={};function Rt(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=xo(n,e.path||"/socket.io"),s=t.source,i=t.id,o=t.path,a=ct[i]&&o in ct[i].nsps,f=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let c;return f?c=new bn(s,e):(ct[i]||(ct[i]=new bn(s,e)),c=ct[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(Rt,{Manager:bn,Socket:Us,io:Rt,connect:Rt});let Qe;const Po=En(!1),Do={sockethub:{port:10550,host:"localhost",path:"/sockethub"},public:{protocol:"http",host:"localhost",port:10550,path:"/"}};async function Jo(n){return console.log("sending ->",n),new Promise((e,t)=>{Qe.socket.emit("message",Zt("SEND",n),s=>{if(console.log("received <-",s),Zt("RESP",s),s.totalItems&&s.items)for(const i of s.items.reverse())Zt("RESP",i,!0);ws(s,!0),s.error?t(s.error):e(s)})})}function sn(n){return e=>{const t=n==="connect";Po.update(()=>t),console.log(`sockethub ${n} [connected: ${t}]`,e||"")}}function jo(n){console.log("handle incoming: ",n),ws(n,!1)}function us(n=Do){Qe=new Mt(Rt(`${n.public.protocol}://${n.public.host}:${n.public.port}`,{path:n.sockethub.path})),Qe.socket.on("connect",sn("connect")),Qe.socket.on("error",sn("error")),Qe.socket.on("disconnect",sn("disconnect")),Qe.socket.on("message",jo)}typeof window=="object"&&(console.log("connecting to sockethub"),fetch("/config.json").then(async n=>{const e=await n.json();us(e)}).catch(()=>{us()}));export{Yo as I,Xo as L,Qe as a,ms as b,Po as c,cn as e,ti as h,on as i,Jo as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/DJd_9GSN.js";export{o as load_css,r as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as y,a as C}from"../chunks/DqdrLdzV.js";import{p as ee,a as te,s as e,f as re,c as n,g as o,u as q,r as d,b as l,d as S,e as a}from"../chunks/Ciq9INsC.js";import{s as se,a as oe,m as ae,b as z,i as ne,c as v}from"../chunks/Cf7Xaqef.js";import{A as de}from"../chunks/D34JQ8ay.js";import{A as ce,C as ie,P as le,R as ve,S as me}from"../chunks/DRqIvF0-.js";import{B as ue}from"../chunks/DxLbbUVu.js";import{F as N}from"../chunks/DvzjJQ_P.js";import{I as ge,s as pe}from"../chunks/Duf23zEt.js";import{w as Y}from"../chunks/CARmnL8B.js";var fe=y('<div class="bg-gradient-to-r from-emerald-50 to-green-50 border border-emerald-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-emerald-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-emerald-600 text-white rounded-full flex items-center justify-center text-sm font-bold">4</span> Join Channel and Chat</h4> <div class="space-y-6"><!> <!> <!></div></div>'),be=y('<div class="bg-gradient-to-r from-gray-50 to-slate-50 border border-gray-200 rounded-xl p-6 text-center shadow-sm"><div class="flex items-center justify-center mb-3"><span class="w-8 h-8 bg-gray-400 text-white rounded-full flex items-center justify-center text-sm font-bold">4</span></div> <p class="text-gray-600 font-medium">Connect to the IRC server to access chat features</p> <p class="text-gray-500 text-sm mt-1">Complete steps 1-3 above to unlock this section</p></div>'),he=y('<div class="bg-orange-50 border-l-4 border-orange-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-orange-800 mb-2">💬 IRC Connection Process</h3> <p class="text-orange-700 text-sm mb-3">IRC (Internet Relay Chat) requires several steps to get connected and chatting.</p> <div class="text-orange-700 text-sm space-y-1"><div><strong>1. 🎭 Set Actor:</strong> Choose your IRC nickname</div> <div><strong>2. 🔐 Set Credentials:</strong> Provide server connection details</div> <div><strong>3. 🔌 Connect:</strong> Establish connection to IRC server</div> <div><strong>4. 🏠 Join Room:</strong> Enter a channel to start chatting</div> <div><strong>5. 💬 Send Messages:</strong> Chat with other users</div></div></div> <div class="space-y-6"><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-3 w-8 h-8 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold">1</span> Choose Your IRC Nickname</h4> <div class="space-y-4"><!> <!></div></div> <div class="bg-gradient-to-r from-blue-50 to-sky-50 border border-blue-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-blue-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-bold">2</span> Configure Server Connection</h4> <div class="space-y-4"><div class="grid md:grid-cols-2 gap-4"><!> <!></div> <div class="bg-blue-100 border border-blue-200 rounded-lg p-3"><p class="text-blue-800 text-sm">💡 <strong>Popular IRC networks:</strong> irc.libera.chat, irc.oftc.net, irc.rizon.net</p></div> <!></div></div> <div class="bg-gradient-to-r from-purple-50 to-violet-50 border border-purple-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-purple-900 mb-4 flex items-center"><span class="mr-3 w-8 h-8 bg-purple-600 text-white rounded-full flex items-center justify-center text-sm font-bold">3</span> Connect to Server</h4> <!></div> <!></div>',1);function $e(D,G){ee(G,!0);const c=()=>z(I,"$actorIdStore",w),r=()=>z(s,"$sockethubState",w),[w,H]=se(),I=Y(`sh-${(Math.random()+1).toString(36).substring(7)}`);let g=S("chat.freenode.net"),p=S(6697),k="#sh-random",m=S(!1);const s=Y({actorSet:!1,credentialsSet:!1,connected:!1,joined:!1});let u=q(()=>({id:c(),type:"person",name:c()})),K=q(()=>({type:"credentials",nick:c(),server:o(g),port:o(p),secure:!0}));function R(){v(s,a(r).actorSet=!1,a(r)),v(s,a(r).credentialsSet=!1,a(r)),v(s,a(r).connected=!1,a(r)),v(s,a(r).joined=!1,a(r)),l(m,!1)}async function L(){l(m,!0),await pe({context:"irc",type:"connect",actor:c()}).catch(()=>{R()}).then(()=>{v(s,a(r).connected=!0,a(r)),l(m,!1)},f=>{console.error(f),R()})}ue(D,{title:"IRC Platform Example",description:"Connect to IRC servers, join channels, and send messages using Sockethub's IRC platform.",children:(f,xe)=>{var j=he(),$=e(re(j),2),b=n($),P=e(n(b),2),A=n(P);ce(A,{get value(){return ae(),c()},set value(t){oe(I,t)}});var O=e(A,2);de(O,{get actor(){return o(u)},get sockethubState(){return s}}),d(P),d(b);var h=e(b,2),E=e(n(h),2),x=n(E),F=n(x);N(F,{label:"IRC Server",id:"server",placeholder:"irc.libera.chat",get value(){return o(g)},set value(t){l(g,t,!0)}});var Q=e(F,2);N(Q,{label:"Port",id:"port",type:"number",placeholder:"6697",get value(){return o(p)},set value(t){l(p,t,!0)}}),d(x);var T=e(x,4);ie(T,{context:"irc",get credentials(){return o(K)},get actor(){return o(u)},get sockethubState(){return s}}),d(E),d(h);var _=e(h,2),U=e(n(_),2);le(U,{get sockethubState(){return s},get connecting(){return o(m)},onConnect:L}),d(_);var V=e(_,2);{var W=t=>{var i=fe(),M=e(n(i),2),B=n(M);ve(B,{get actor(){return o(u)},get sockethubState(){return s},room:k,context:"irc"});var J=e(B,2);ge(J,{});var Z=e(J,2);me(Z,{context:"irc",get actor(){return o(u)},get sockethubState(){return s},room:k}),d(M),d(i),C(t,i)},X=t=>{var i=be();C(t,i)};ne(V,t=>{r().connected?t(W):t(X,!1)})}d($),C(f,j)}}),te(),H()}export{$e as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as y,t as w,a as f}from"../chunks/DqdrLdzV.js";import{p as k,a as A,s as o,f as F,c as p,b as R,d as _,g as e,u as T,n as O,r as m}from"../chunks/Ciq9INsC.js";import{w as L}from"../chunks/CARmnL8B.js";import{A as P}from"../chunks/D34JQ8ay.js";import{B as U,S as $}from"../chunks/DxLbbUVu.js";import{F as M}from"../chunks/DvzjJQ_P.js";import{s as j}from"../chunks/Duf23zEt.js";var B=y('<div class="bg-green-50 border-l-4 border-green-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-green-800 mb-2">📰 How Feed Processing Works</h3> <p class="text-green-700 text-sm mb-3">This example shows how Sockethub can fetch and parse RSS/ATOM feeds from any website.</p> <div class="text-green-700 text-sm space-y-1"><div><strong>🌐 Fetching:</strong> Sockethub downloads the feed content from the URL</div> <div><strong>🔍 Parsing:</strong> Content is parsed from RSS/ATOM format</div> <div><strong>📝 Converting:</strong> Each feed entry becomes an ActivityStreams object</div> <div><strong>📊 Results:</strong> You receive an array of structured feed entries</div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ Try different RSS/ATOM feeds: news sites, blogs, podcasts, etc.</p> <!> <div class="bg-blue-50 border border-blue-200 p-3 rounded-lg"><p class="text-blue-700 text-sm"><strong>💡 What happens when you click Fetch:</strong><br/> The feed URL becomes the "actor" (like a website identity), and Sockethub sends a "fetch" activity to download and parse the feed content.</p></div> <div class="w-full text-right"><!></div></div>',1);function I(h,g){k(g,!0);const v=L({actorSet:!1});let t=_("https://sockethub.org/feed.xml");const a=T(()=>({type:"website",id:e(t)}));function u(s){return{context:"feeds",type:s,actor:e(a)}}async function b(){j(u("fetch"))}U(h,{title:"Feeds Platform Example",description:"The feeds platform takes an RSS/ATOM feed URL, fetches and parses it, and returns an array of Activity Objects for each entry.",children:(s,E)=>{var n=B(),d=o(F(n),2),i=p(d);M(i,{label:"Feed URL",id:"URL",placeholder:"https://example.com/feed.xml",get value(){return e(t)},set value(r){R(t,r,!0)}});var c=o(i,4);P(c,{get actor(){return e(a)},get sockethubState(){return v}});var l=o(c,4),x=p(l);$(x,{buttonAction:b,children:(r,C)=>{O();var S=w("Fetch Feed");f(r,S)}}),m(l),m(d),f(s,n)}}),A()}export{I as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as P,a as f}from"../chunks/DqdrLdzV.js";import{p as L,a as N,s as r,f as O,c as n,g as o,u as x,r as c,n as Q,d as T,b as E,e as s}from"../chunks/Ciq9INsC.js";import{s as V,a as W,m as Z,b as I,i as ee,c as d}from"../chunks/Cf7Xaqef.js";import{A as te}from"../chunks/D34JQ8ay.js";import{A as re,C as se,P as oe,R as ae,S as ne}from"../chunks/DRqIvF0-.js";import{B as ce}from"../chunks/DxLbbUVu.js";import{I as ie,s as de}from"../chunks/Duf23zEt.js";import{w as j}from"../chunks/CARmnL8B.js";var le=P('<div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 4 & 5: Join Room and Chat</h4> <div class="space-y-4"><!> <!> <!></div></div>'),ge=P('<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 text-center"><p class="text-gray-500">Connect to the XMPP server to access chat features</p></div>'),me=P('<div class="bg-indigo-50 border-l-4 border-indigo-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-indigo-800 mb-2">📨 XMPP Connection Process</h3> <p class="text-indigo-700 text-sm mb-3">XMPP (Extensible Messaging and Presence Protocol) is a real-time communication protocol used by services like Jabber.</p> <div class="text-indigo-700 text-sm space-y-1"><div><strong>1. 🎭 Set Actor:</strong> Your XMPP address (e.g., user@jabber.org)</div> <div><strong>2. 🔐 Set Credentials:</strong> Your XMPP login and password</div> <div><strong>3. 🔌 Connect:</strong> Establish connection to XMPP server</div> <div><strong>4. 🏠 Join Room:</strong> Enter a multi-user chat room</div> <div><strong>5. 💬 Send Messages:</strong> Chat with other users in real-time</div></div></div> <div class="space-y-6"><div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 1: Set Your XMPP Address</h4> <!> <p class="text-gray-600 text-sm mt-2">💡 Format: username@server.com (e.g., user@jabber.org, alice@conversations.im)</p> <!></div> <div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 2: Set Your Credentials</h4> <!> <p class="text-gray-600 text-sm mt-2">🔐 Use your actual XMPP account credentials to connect</p></div> <div class="bg-white border border-gray-200 rounded-lg p-4"><h4 class="font-semibold text-gray-800 mb-3">Step 3: Connect to XMPP Server</h4> <!></div> <!></div>',1);function _e(J,R){L(R,!0);const g=()=>I(_,"$actorIdStore",S),e=()=>I(t,"$sockethubState",S),[S,Y]=V(),_=j("user@jabber.org");let m=T(!1),u=x(()=>`${g()}/SockethubExample`);const y="kosmos-random@kosmos.chat",t=j({actorSet:!1,credentialsSet:!1,connected:!1,joined:!1});let l=x(()=>({id:o(u),type:"person",name:o(u)})),B=x(()=>({type:"credentials",userAddress:g(),password:"123456",resource:"SockethubExample"}));function k(){d(t,s(e).actorSet=!1,s(e)),d(t,s(e).credentialsSet=!1,s(e)),d(t,s(e).connected=!1,s(e)),d(t,s(e).joined=!1,s(e)),E(m,!1)}async function F(){return E(m,!0),await de({context:"xmpp",type:"connect",actor:o(u)}).then(()=>{d(t,s(e).connected=!0,s(e))},v=>{console.error(v),k()}).catch(()=>{k()})}ce(J,{title:"XMPP Platform Example",description:"Connect to XMPP servers (Jabber), join multi-user chats, and exchange messages using Sockethub's XMPP platform.",children:(v,ue)=>{var M=me(),C=r(O(M),2),p=n(C),X=r(n(p),2);re(X,{get value(){return Z(),g()},set value(a){W(_,a)}});var U=r(X,4);te(U,{get actor(){return o(l)},get sockethubState(){return t}}),c(p);var b=r(p,2),q=r(n(b),2);se(q,{context:"xmpp",get credentials(){return o(B)},get actor(){return o(l)},get sockethubState(){return t}}),Q(2),c(b);var h=r(b,2),z=r(n(h),2);oe(z,{get sockethubState(){return t},get connecting(){return o(m)},onConnect:F}),c(h);var D=r(h,2);{var G=a=>{var i=le(),w=r(n(i),2),$=n(w);ae($,{get actor(){return o(l)},get sockethubState(){return t},room:y,context:"xmpp"});var A=r($,2);ie(A,{});var K=r(A,2);ne(K,{context:"xmpp",get actor(){return o(l)},get sockethubState(){return t},room:y}),c(w),c(i),f(a,i)},H=a=>{var i=ge();f(a,i)};ee(D,a=>{e().connected?a(G):a(H,!1)})}c(C),f(v,M)}}),N(),Y()}export{_e as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as S,t as k,a as p}from"../chunks/DqdrLdzV.js";import{p as y,a as _,s as r,f as F,c as m,b as A,d as E,g as t,u as L,n as P,r as u}from"../chunks/Ciq9INsC.js";import{w as R}from"../chunks/CARmnL8B.js";import{A as $}from"../chunks/D34JQ8ay.js";import{B as T,S as U}from"../chunks/DxLbbUVu.js";import{F as B}from"../chunks/DvzjJQ_P.js";import{s as M}from"../chunks/Duf23zEt.js";var O=S('<div class="bg-purple-50 border-l-4 border-purple-400 p-4 rounded-r-lg mb-6"><h3 class="text-lg font-semibold text-purple-800 mb-2">🔍 How Metadata Extraction Works</h3> <p class="text-purple-700 text-sm mb-3">This example shows how Sockethub can extract structured metadata from any web page.</p> <div class="text-purple-700 text-sm space-y-1"><div><strong>🌐 Fetching:</strong> Sockethub downloads the web page content</div> <div><strong>🔍 Scanning:</strong> Searches for Open Graph, Twitter Cards, JSON-LD, and meta tags</div> <div><strong>📊 Extracting:</strong> Pulls out titles, descriptions, images, and other metadata</div> <div><strong>📋 Returning:</strong> Provides structured data about the page</div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ Try different websites: news articles, social media posts, product pages, etc.</p> <!> <div class="bg-blue-50 border border-blue-200 p-3 rounded-lg"><p class="text-blue-700 text-sm"><strong>💡 What happens when you click Fetch:</strong><br/> The website URL becomes the "actor", and Sockethub sends a "fetch" activity to download the page and extract all available metadata like page titles, descriptions, and social media preview data.</p></div> <div class="w-full text-right"><!></div></div>',1);function z(h,g){y(g,!0);const b=R({actorSet:!1});let e=E("https://sockethub.org"),o=L(()=>({id:t(e),type:"website"}));function v(a){return{context:"metadata",type:a,actor:t(o)}}async function f(){M(v("fetch"))}T(h,{title:"Metadata Platform Example",description:"Sockethub's metadata platform takes a URL, fetches and parses it for any metadata.",children:(a,W)=>{var i=O(),d=r(F(i),2),n=m(d);B(n,{label:"Website URL",id:"URL",placeholder:"https://example.com",get value(){return t(e)},set value(s){A(e,s,!0)}});var c=r(n,4);$(c,{get actor(){return t(o)},get sockethubState(){return b}});var l=r(c,4),x=m(l);U(x,{buttonAction:f,children:(s,j)=>{P();var w=k("Extract Metadata");p(s,w)}}),u(l),u(d),p(a,i)}}),_()}export{z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as L,t as o,a as r}from"../chunks/DqdrLdzV.js";import{p as M,a as O,s,f as W,c as e,b as z,d as J,g as E,n as l,r as t}from"../chunks/Ciq9INsC.js";import{s as n}from"../chunks/Duf23zEt.js";import{B as K,S as c}from"../chunks/DxLbbUVu.js";import{F as N}from"../chunks/DvzjJQ_P.js";var Q=L(`<div class="bg-gradient-to-r from-blue-50 to-blue-100 border border-blue-200 rounded-xl p-6 shadow-sm"><h3 class="text-xl font-bold text-blue-900 mb-3 flex items-center"><span class="mr-2">💡</span> What You'll Learn</h3> <p class="text-blue-800 mb-4 leading-relaxed">This example demonstrates the core Sockethub workflow with a test platform that doesn't require external connections.</p> <div class="grid md:grid-cols-2 gap-3 text-blue-800"><div class="flex items-start space-x-2"><span class="text-lg">📤</span> <div><div class="font-semibold">Sending</div> <div class="text-sm text-blue-700">How to create and send ActivityStreams messages</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">📥</span> <div><div class="font-semibold">Receiving</div> <div class="text-sm text-blue-700">How Sockethub responds with results or errors</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">🎯</span> <div><div class="font-semibold">Actor</div> <div class="text-sm text-blue-700">How your identity is represented</div></div></div> <div class="flex items-start space-x-2"><span class="text-lg">🔄</span> <div><div class="font-semibold">Types</div> <div class="text-sm text-blue-700">Different activity types (echo, greet, fail, throw)</div></div></div></div></div> <div class="space-y-4"><!> <p class="text-gray-600 text-sm">⬆️ This text will be included in the <code>object.content</code> field of your ActivityStreams message.</p> <div class="bg-gradient-to-r from-amber-50 to-yellow-50 border border-amber-200 rounded-xl p-6 shadow-sm"><h4 class="text-lg font-bold text-amber-900 mb-3 flex items-center"><span class="mr-2">🚀</span> Try Different Activity Types</h4> <p class="text-amber-800 mb-4 leading-relaxed">Each button sends the same basic message structure but with a different <code class="bg-amber-100 px-1 rounded text-sm">type</code> field:</p> <div class="grid md:grid-cols-2 gap-4"><div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Echo</div> <p class="text-amber-700 text-sm">Returns your message back unchanged</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Greet</div> <p class="text-amber-700 text-sm">Returns a friendly greeting</p></div> <!></div></div></div> <div class="space-y-4"><div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Fail</div> <p class="text-amber-700 text-sm">Returns an error message (for testing error handling)</p></div> <!></div></div> <div class="bg-white rounded-lg p-4 border border-amber-200"><div class="flex items-center justify-between"><div class="flex-1"><div class="font-semibold text-amber-900 mb-1">Throw</div> <p class="text-amber-700 text-sm">Throws an exception (for testing exception handling)</p></div> <!></div></div></div></div></div></div>`,1);function se(F,P){M(P,!0);const H="https://sockethub.org/examples/dummy";let v=J("");function d(m){return{context:"dummy",type:m,actor:{type:"person",id:H},object:{type:"message",content:E(v)}}}async function R(){n(d("echo"))}async function B(){n(d("fail"))}async function D(){n(d("throw"))}async function G(){n(d("greet"))}K(F,{title:"Dummy Platform Example",description:"The dummy platform is the most basic test to communicate via Sockethub to a platform, and receive a response back. You can use either the echo or fail types on your Activity Stream object.",children:(m,U)=>{var f=Q(),h=s(W(f),2),g=e(h);N(g,{label:"Message Content",id:"objectContent",placeholder:"Hello from Sockethub",get value(){return E(v)},set value(a){z(v,a,!0)}});var y=s(g,4),w=s(e(y),4),b=e(w),p=e(b),_=e(p),C=s(e(_),2);c(C,{buttonAction:R,children:(a,u)=>{l();var i=o("Echo");r(a,i)}}),t(_),t(p);var S=s(p,2),$=e(S),Y=s(e($),2);c(Y,{buttonAction:G,children:(a,u)=>{l();var i=o("Greet");r(a,i)}}),t($),t(S),t(b);var A=s(b,2),x=e(A),T=e(x),q=s(e(T),2);c(q,{buttonAction:B,children:(a,u)=>{l();var i=o("Fail");r(a,i)}}),t(T),t(x);var j=s(x,2),k=e(j),I=s(e(k),2);c(I,{buttonAction:D,children:(a,u)=>{l();var i=o("Throw");r(a,i)}}),t(k),t(j),t(A),t(w),t(y),t(h),r(m,f)}}),O()}export{se as component};
|