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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/build/_app/immutable/chunks/{CMGJd5ye.js → B4QvvF9v.js} +1 -1
  2. package/build/_app/immutable/chunks/{CP3RYOsn.js → BJa-K1HI.js} +1 -1
  3. package/build/_app/immutable/chunks/{DmTdcgJE.js → BUnlO8zl.js} +1 -1
  4. package/build/_app/immutable/chunks/{DAI8Skzw.js → BWVzoQAP.js} +1 -1
  5. package/build/_app/immutable/chunks/D0ikSVuC.js +1 -0
  6. package/build/_app/immutable/chunks/{CtHan22X.js → DHN3DyXv.js} +1 -1
  7. package/build/_app/immutable/chunks/{Cg0jVkAC.js → Dd3sOYF9.js} +1 -1
  8. package/build/_app/immutable/entry/{app.B_vRxLYK.js → app.DfHa-4d4.js} +2 -2
  9. package/build/_app/immutable/entry/start.Bf_hVfxy.js +1 -0
  10. package/build/_app/immutable/nodes/{0.BtFjvn48.js → 0.Cd2_Nfba.js} +1 -1
  11. package/build/_app/immutable/nodes/{1.D-6IOJdS.js → 1.D3qZV2vo.js} +1 -1
  12. package/build/_app/immutable/nodes/{2.9I1exuqO.js → 2.BysUTzcv.js} +1 -1
  13. package/build/_app/immutable/nodes/{3.5bdBcHki.js → 3.DKJ83Cvw.js} +1 -1
  14. package/build/_app/immutable/nodes/{4.CbdjIqdp.js → 4.DB8UnEA8.js} +1 -1
  15. package/build/_app/immutable/nodes/{5.fGuqL79M.js → 5.Cj8bv369.js} +1 -1
  16. package/build/_app/immutable/nodes/{6.DjV4FiJS.js → 6.eKf13UwC.js} +1 -1
  17. package/build/_app/immutable/nodes/{7.BzU7RB4F.js → 7.Bi3xoTlo.js} +1 -1
  18. package/build/_app/immutable/nodes/{8.CxUYN2jc.js → 8.DQNerIii.js} +1 -1
  19. package/build/_app/version.json +1 -1
  20. package/build/caldav.html +7 -7
  21. package/build/dummy.html +7 -7
  22. package/build/feeds.html +7 -7
  23. package/build/index.html +7 -7
  24. package/build/irc.html +7 -7
  25. package/build/metadata.html +7 -7
  26. package/build/xmpp.html +7 -7
  27. package/package.json +3 -3
  28. package/build/_app/immutable/chunks/w4Fz4V5i.js +0 -1
  29. package/build/_app/immutable/entry/start.Bq-TCpu6.js +0 -1
@@ -33,4 +33,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Qe=Z,Me=le),Se===void
33
33
  `)},u.prototype.displayStateStack=function(c,d){for(var w,P=0,b=0;b<c.length;b++){var E=c[b],m=E.rule.toString(E.dot);m===w?P++:(P>0&&d.push(" ^ "+P+" more lines identical to this"),P=0,d.push(" "+m)),w=m}},u.prototype.getSymbolDisplay=function(c){return i(c)},u.prototype.buildFirstStateStack=function(c,d){if(d.indexOf(c)!==-1)return null;if(c.wantedBy.length===0)return[c];var w=c.wantedBy[0],P=[c].concat(d),b=this.buildFirstStateStack(w,P);return b===null?null:[c].concat(b)},u.prototype.save=function(){var c=this.table[this.current];return c.lexerState=this.lexerState,c},u.prototype.restore=function(c){var d=c.index;this.current=d,this.table[d]=c,this.table.splice(d+1),this.lexerState=c.lexerState,this.results=this.finish()},u.prototype.rewind=function(c){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[c])},u.prototype.finish=function(){var c=[],d=this.grammar.start,w=this.table[this.table.length-1];return w.states.forEach(function(P){P.rule.name===d&&P.dot===P.rule.symbols.length&&P.reference===0&&P.data!==u.fail&&c.push(P)}),c.map(function(P){return P.data})};function i(c){var d=typeof c;if(d==="string")return c;if(d==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return"character matching "+c;if(c.type)return c.type+" token";if(c.test)return"token matching "+String(c.test);throw new Error("Unknown symbol type: "+c)}}function h(c){var d=typeof c;if(d==="string")return c;if(d==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return c.toString();if(c.type)return"%"+c.type;if(c.test)return"<"+String(c.test)+">";throw new Error("Unknown symbol type: "+c)}}return{Parser:u,Grammar:l,Rule:r}})}),Qc=B(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(l){return l[0]}var r=l=>[].concat(...l.map(a=>Array.isArray(a)?r(a):a));function n(l){return l?Array.isArray(l)?r(l).join(""):l:""}var s={Lexer:void 0,ParserRules:[{name:"Reverse_path",symbols:["Path"]},{name:"Reverse_path$string$1",symbols:[{literal:"<"},{literal:">"}],postprocess:l=>l.join("")},{name:"Reverse_path",symbols:["Reverse_path$string$1"]},{name:"Forward_path$subexpression$1$subexpression$1",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:"@"}],postprocess:function(l){return l.join("")}},{name:"Forward_path$subexpression$1",symbols:["Forward_path$subexpression$1$subexpression$1","Domain",{literal:">"}]},{name:"Forward_path",symbols:["Forward_path$subexpression$1"]},{name:"Forward_path$subexpression$2",symbols:[{literal:"<"},/[pP]/,/[oO]/,/[sS]/,/[tT]/,/[mM]/,/[aA]/,/[sS]/,/[tT]/,/[eE]/,/[rR]/,{literal:">"}],postprocess:function(l){return l.join("")}},{name:"Forward_path",symbols:["Forward_path$subexpression$2"]},{name:"Forward_path",symbols:["Path"]},{name:"Path$ebnf$1$subexpression$1",symbols:["A_d_l",{literal:":"}]},{name:"Path$ebnf$1",symbols:["Path$ebnf$1$subexpression$1"],postprocess:e},{name:"Path$ebnf$1",symbols:[],postprocess:()=>null},{name:"Path",symbols:[{literal:"<"},"Path$ebnf$1","Mailbox",{literal:">"}]},{name:"A_d_l$ebnf$1",symbols:[]},{name:"A_d_l$ebnf$1$subexpression$1",symbols:[{literal:","},"At_domain"]},{name:"A_d_l$ebnf$1",symbols:["A_d_l$ebnf$1","A_d_l$ebnf$1$subexpression$1"],postprocess:l=>l[0].concat([l[1]])},{name:"A_d_l",symbols:["At_domain","A_d_l$ebnf$1"]},{name:"At_domain",symbols:[{literal:"@"},"Domain"]},{name:"Domain$ebnf$1",symbols:[]},{name:"Domain$ebnf$1$subexpression$1",symbols:[{literal:"."},"sub_domain"]},{name:"Domain$ebnf$1",symbols:["Domain$ebnf$1","Domain$ebnf$1$subexpression$1"],postprocess:l=>l[0].concat([l[1]])},{name:"Domain",symbols:["sub_domain","Domain$ebnf$1"]},{name:"sub_domain",symbols:["U_label"]},{name:"Let_dig",symbols:["ALPHA_DIGIT"],postprocess:e},{name:"Ldh_str$ebnf$1",symbols:[]},{name:"Ldh_str$ebnf$1",symbols:["Ldh_str$ebnf$1","ALPHA_DIG_DASH"],postprocess:l=>l[0].concat([l[1]])},{name:"Ldh_str",symbols:["Ldh_str$ebnf$1","Let_dig"]},{name:"U_Let_dig",symbols:["ALPHA_DIGIT_U"],postprocess:e},{name:"U_Ldh_str$ebnf$1",symbols:[]},{name:"U_Ldh_str$ebnf$1",symbols:["U_Ldh_str$ebnf$1","ALPHA_DIG_DASH_U"],postprocess:l=>l[0].concat([l[1]])},{name:"U_Ldh_str",symbols:["U_Ldh_str$ebnf$1","U_Let_dig"]},{name:"U_label$ebnf$1$subexpression$1",symbols:["U_Ldh_str"]},{name:"U_label$ebnf$1",symbols:["U_label$ebnf$1$subexpression$1"],postprocess:e},{name:"U_label$ebnf$1",symbols:[],postprocess:()=>null},{name:"U_label",symbols:["U_Let_dig","U_label$ebnf$1"]},{name:"address_literal$subexpression$1",symbols:["IPv4_address_literal"]},{name:"address_literal$subexpression$1",symbols:["IPv6_address_literal"]},{name:"address_literal$subexpression$1",symbols:["General_address_literal"]},{name:"address_literal",symbols:[{literal:"["},"address_literal$subexpression$1",{literal:"]"}]},{name:"non_local_part",symbols:["Domain"],postprocess:function(l){return{DomainName:n(l[0])}}},{name:"non_local_part",symbols:["address_literal"],postprocess:function(l){return{AddressLiteral:n(l[0])}}},{name:"Mailbox",symbols:["Local_part",{literal:"@"},"non_local_part"],postprocess:function(l){return{localPart:n(l[0]),domainPart:n(l[2])}}},{name:"Local_part",symbols:["Dot_string"],postprocess:function(l){return{DotString:n(l[0])}}},{name:"Local_part",symbols:["Quoted_string"],postprocess:function(l){return{QuotedString:n(l[0])}}},{name:"Dot_string$ebnf$1",symbols:[]},{name:"Dot_string$ebnf$1$subexpression$1",symbols:[{literal:"."},"Atom"]},{name:"Dot_string$ebnf$1",symbols:["Dot_string$ebnf$1","Dot_string$ebnf$1$subexpression$1"],postprocess:l=>l[0].concat([l[1]])},{name:"Dot_string",symbols:["Atom","Dot_string$ebnf$1"]},{name:"Atom$ebnf$1",symbols:[/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/]},{name:"Atom$ebnf$1",symbols:["Atom$ebnf$1",/[0-9A-Za-z!#$%&'*+\-/=?^_`{|}~\u0080-\uFFFF/]/],postprocess:l=>l[0].concat([l[1]])},{name:"Atom",symbols:["Atom$ebnf$1"]},{name:"Quoted_string$ebnf$1",symbols:[]},{name:"Quoted_string$ebnf$1",symbols:["Quoted_string$ebnf$1","QcontentSMTP"],postprocess:l=>l[0].concat([l[1]])},{name:"Quoted_string",symbols:["DQUOTE","Quoted_string$ebnf$1","DQUOTE"]},{name:"QcontentSMTP",symbols:["qtextSMTP"]},{name:"QcontentSMTP",symbols:["quoted_pairSMTP"]},{name:"quoted_pairSMTP",symbols:[{literal:"\\"},/[\x20-\x7e]/]},{name:"qtextSMTP",symbols:[/[\x20-\x21\x23-\x5b\x5d-\x7e\u0080-\uFFFF]/],postprocess:e},{name:"IPv4_address_literal$macrocall$2",symbols:[{literal:"."},"Snum"]},{name:"IPv4_address_literal$macrocall$1",symbols:["IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2","IPv4_address_literal$macrocall$2"]},{name:"IPv4_address_literal",symbols:["Snum","IPv4_address_literal$macrocall$1"]},{name:"IPv6_address_literal$subexpression$1",symbols:[/[iI]/,/[pP]/,/[vV]/,{literal:"6"},{literal:":"}],postprocess:function(l){return l.join("")}},{name:"IPv6_address_literal",symbols:["IPv6_address_literal$subexpression$1","IPv6_addr"]},{name:"General_address_literal$ebnf$1",symbols:["dcontent"]},{name:"General_address_literal$ebnf$1",symbols:["General_address_literal$ebnf$1","dcontent"],postprocess:l=>l[0].concat([l[1]])},{name:"General_address_literal",symbols:["Standardized_tag",{literal:":"},"General_address_literal$ebnf$1"]},{name:"Standardized_tag",symbols:["Ldh_str"]},{name:"dcontent",symbols:[/[\x21-\x5a\x5e-\x7e]/],postprocess:e},{name:"Snum",symbols:["DIGIT"]},{name:"Snum$subexpression$1",symbols:[/[1-9]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$1"]},{name:"Snum$subexpression$2",symbols:[{literal:"1"},"DIGIT","DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$2"]},{name:"Snum$subexpression$3",symbols:[{literal:"2"},/[0-4]/,"DIGIT"]},{name:"Snum",symbols:["Snum$subexpression$3"]},{name:"Snum$subexpression$4",symbols:[{literal:"2"},{literal:"5"},/[0-5]/]},{name:"Snum",symbols:["Snum$subexpression$4"]},{name:"IPv6_addr",symbols:["IPv6_full"]},{name:"IPv6_addr",symbols:["IPv6_comp"]},{name:"IPv6_addr",symbols:["IPv6v4_full"]},{name:"IPv6_addr",symbols:["IPv6v4_comp"]},{name:"IPv6_hex",symbols:["HEXDIG"]},{name:"IPv6_hex$subexpression$1",symbols:["HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$1"]},{name:"IPv6_hex$subexpression$2",symbols:["HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$2"]},{name:"IPv6_hex$subexpression$3",symbols:["HEXDIG","HEXDIG","HEXDIG","HEXDIG"]},{name:"IPv6_hex",symbols:["IPv6_hex$subexpression$3"]},{name:"IPv6_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_full$macrocall$1",symbols:["IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2","IPv6_full$macrocall$2"]},{name:"IPv6_full",symbols:["IPv6_hex","IPv6_full$macrocall$1"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2","IPv6_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$1",symbols:["IPv6_comp$ebnf$1$subexpression$1"],postprocess:e},{name:"IPv6_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:l=>l.join("")},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2","IPv6_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6_comp$ebnf$2$subexpression$1$macrocall$1"]},{name:"IPv6_comp$ebnf$2",symbols:["IPv6_comp$ebnf$2$subexpression$1"],postprocess:e},{name:"IPv6_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6_comp",symbols:["IPv6_comp$ebnf$1","IPv6_comp$string$1","IPv6_comp$ebnf$2"]},{name:"IPv6v4_full$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_full$macrocall$1",symbols:["IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2","IPv6v4_full$macrocall$2"]},{name:"IPv6v4_full",symbols:["IPv6_hex","IPv6v4_full$macrocall$1",{literal:":"},"IPv4_address_literal"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$1$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$1$subexpression$1$macrocall$1"]},{name:"IPv6v4_comp$ebnf$1",symbols:["IPv6v4_comp$ebnf$1$subexpression$1"],postprocess:e},{name:"IPv6v4_comp$ebnf$1",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp$string$1",symbols:[{literal:":"},{literal:":"}],postprocess:l=>l.join("")},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2",symbols:[{literal:":"},"IPv6_hex"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",symbols:["IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$2"]},{name:"IPv6v4_comp$ebnf$2$subexpression$1",symbols:["IPv6_hex","IPv6v4_comp$ebnf$2$subexpression$1$macrocall$1",{literal:":"}]},{name:"IPv6v4_comp$ebnf$2",symbols:["IPv6v4_comp$ebnf$2$subexpression$1"],postprocess:e},{name:"IPv6v4_comp$ebnf$2",symbols:[],postprocess:()=>null},{name:"IPv6v4_comp",symbols:["IPv6v4_comp$ebnf$1","IPv6v4_comp$string$1","IPv6v4_comp$ebnf$2","IPv4_address_literal"]},{name:"DIGIT",symbols:[/[0-9]/],postprocess:e},{name:"ALPHA_DIGIT_U",symbols:[/[0-9A-Za-z\u0080-\uFFFF]/],postprocess:e},{name:"ALPHA_DIGIT",symbols:[/[0-9A-Za-z]/],postprocess:e},{name:"ALPHA_DIG_DASH",symbols:[/[-0-9A-Za-z]/],postprocess:e},{name:"ALPHA_DIG_DASH_U",symbols:[/[-0-9A-Za-z\u0080-\uFFFF]/],postprocess:e},{name:"HEXDIG",symbols:[/[0-9A-Fa-f]/],postprocess:e},{name:"DQUOTE",symbols:[{literal:'"'}],postprocess:e}],ParserStart:"Reverse_path"};t.default=s}),Kn=B(t=>{var e=t&&t.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(t,"__esModule",{value:!0}),t.canonicalize=t.canonicalize_quoted_string=t.normalize=t.normalize_dot_string=t.parse=void 0;var r=Jc(),n=e(Qc());n.default.ParserStart="Mailbox";var s=r.Grammar.fromCompiled(n.default);function l(c){if(c.length>986)throw new Error("address too long");const w=new r.Parser(s);if(w.feed(c),w.results.length!==1)throw new Error("address parsing failed: ambiguous grammar");const P=c.lastIndexOf("@"),b=c.substring(P+1);if(b[0]!=="["){if(b.length>253)throw new Error("domain too long");const E=b.split(".");if(E.length<2)throw new Error("domain not fully qualified");if(E[E.length-1].length<2)throw new Error("top level domain label too short");if(E.sort(function(m,o){return o.length-m.length}),E[0].length>63)throw new Error("domain label too long")}return w.results[0]}t.parse=l;function a(c){return function(){const P=c.indexOf("+");return P===-1?c:c.substr(0,P)}().replace(/\./g,"").toLowerCase()}t.normalize_dot_string=a;function u(c){var d,w;const P=l(c),b=(d=P.domainPart.AddressLiteral)!==null&&d!==void 0?d:P.domainPart.DomainName.toLowerCase();return`${(w=P.localPart.QuotedString)!==null&&w!==void 0?w:a(P.localPart.DotString)}@${b}`}t.normalize=u;function i(c){return`"${c.substr(1).substr(0,c.length-2).replace(/(?:\\(.))/g,"$1").replace(/(?:(["\\]))/g,"\\$1")}"`}t.canonicalize_quoted_string=i;function h(c){var d;const w=l(c),P=(d=w.domainPart.AddressLiteral)!==null&&d!==void 0?d:w.domainPart.DomainName.toLowerCase();return`${w.localPart.QuotedString?i(w.localPart.QuotedString):w.localPart.DotString}@${P}`}t.canonicalize=h}),Xc=B((t,e)=>{var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},u=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var w=r.call(d,"constructor"),P=d.constructor&&d.constructor.prototype&&r.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!w&&!P)return!1;var b;for(b in d);return typeof b>"u"||r.call(d,b)},i=function(d,w){s&&w.name==="__proto__"?s(d,w.name,{enumerable:!0,configurable:!0,value:w.newValue,writable:!0}):d[w.name]=w.newValue},h=function(d,w){if(w==="__proto__")if(r.call(d,w)){if(l)return l(d,w).value}else return;return d[w]};e.exports=function c(){var d,w,P,b,E,m,o=arguments[0],_=1,p=arguments.length,v=!1;for(typeof o=="boolean"&&(v=o,o=arguments[1]||{},_=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});_<p;++_)if(d=arguments[_],d!=null)for(w in d)P=h(o,w),b=h(d,w),o!==b&&(v&&b&&(u(b)||(E=a(b)))?(E?(E=!1,m=P&&a(P)?P:[]):m=P&&u(P)?P:{},i(o,{name:w,newValue:c(v,m,b)})):typeof b<"u"&&i(o,{name:w,newValue:b}));return o}}),Yc=B((t,e)=>{e.exports=[{scheme:"aaa",description:"Diameter Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6733"}]},{scheme:"aaas",description:"Diameter Protocol with Secure Transport",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6733"}]},{scheme:"about",description:"about",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6694"}]},{scheme:"acap",description:"application configuration access protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2244"}]},{scheme:"acct",description:"acct",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7565"}]},{scheme:"cap",description:"Calendar Access Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4324"}]},{scheme:"cid",description:"content identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2392"}]},{scheme:"coap",description:"coap",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7252"}]},{scheme:"coaps",description:"coaps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7252"}]},{scheme:"crid",description:"TV-Anytime Content Reference Identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4078"}]},{scheme:"data",description:"data",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2397"}]},{scheme:"dav",description:"dav",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4918"}]},{scheme:"dict",description:"dictionary service protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2229"}]},{scheme:"dns",description:"Domain Name System",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4501"}]},{scheme:"example",description:"example",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7595"}]},{scheme:"file",description:"Host-specific file names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"ftp",description:"File Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"geo",description:"Geographic Locations",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5870"}]},{scheme:"go",description:"go",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3368"}]},{scheme:"gopher",description:"The Gopher Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4266"}]},{scheme:"h323",description:"H.323",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3508"}]},{scheme:"http",description:"Hypertext Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7230"}]},{scheme:"https",description:"Hypertext Transfer Protocol Secure",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7230"}]},{scheme:"iax",description:"Inter-Asterisk eXchange Version 2",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5456"}]},{scheme:"icap",description:"Internet Content Adaptation Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3507"}]},{scheme:"im",description:"Instant Messaging",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3860"}]},{scheme:"imap",description:"internet message access protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5092"}]},{scheme:"info",description:`Information Assets with Identifiers in Public Namespaces.
34
34
  (section 3) defines an "info" registry
35
35
  of public namespaces, which is maintained by NISO and can be accessed
36
- from .`,reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4452"}]},{scheme:"ipp",description:"Internet Printing Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3510"}]},{scheme:"ipps",description:"Internet Printing Protocol over HTTPS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7472"}]},{scheme:"iris",description:"Internet Registry Information Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3981"}]},{scheme:"iris.beep",description:"iris.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3983"}]},{scheme:"iris.lwz",description:"iris.lwz",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4993"}]},{scheme:"iris.xpc",description:"iris.xpc",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"iris.xpcs",description:"iris.xpcs",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"jabber",description:"jabber",reference:[],template:"http://www.iana.org/assignments/uri-schemes/perm/jabber"},{scheme:"ldap",description:"Lightweight Directory Access Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4516"}]},{scheme:"mailto",description:"Electronic mail address",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6068"}]},{scheme:"mid",description:"message identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2392"}]},{scheme:"msrp",description:"Message Session Relay Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"msrps",description:"Message Session Relay Protocol Secure",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"mtqp",description:"Message Tracking Query Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3887"}]},{scheme:"mupdate",description:"Mailbox Update (MUPDATE) Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3656"}]},{scheme:"news",description:"USENET news",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"nfs",description:"network file system protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2224"}]},{scheme:"ni",description:"ni",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nih",description:"nih",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nntp",description:"USENET news using NNTP access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"opaquelocktoken",description:"opaquelocktokent",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4918"}]},{scheme:"pkcs11",description:"PKCS#11",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7512"}]},{scheme:"pop",description:"Post Office Protocol v3",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2384"}]},{scheme:"pres",description:"Presence",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3859"}]},{scheme:"reload",description:"reload",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6940"}]},{scheme:"rtsp",description:"Real-time Streaming Protocol (RTSP)",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtsps",description:"Real-time Streaming Protocol (RTSP) over TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtspu",description:"Real-time Streaming Protocol (RTSP) over unreliable datagram transport",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"}]},{scheme:"service",description:"service location",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2609"}]},{scheme:"session",description:"session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6787"}]},{scheme:"shttp",description:"Secure Hypertext Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2660"}]},{scheme:"sieve",description:"ManageSieve Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5804"}]},{scheme:"sip",description:"session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sips",description:"secure session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sms",description:"Short Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5724"}]},{scheme:"snmp",description:"Simple Network Management Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4088"}]},{scheme:"soap.beep",description:"soap.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"soap.beeps",description:"soap.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"stun",description:"stun",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"stuns",description:"stuns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"tag",description:"tag",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4151"}]},{scheme:"tel",description:"telephone",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"telnet",description:"Reference to interactive sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4248"}]},{scheme:"tftp",description:"Trivial File Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3617"}]},{scheme:"thismessage",description:"multipart/related relative reference resolution",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2557"}],template:"http://www.iana.org/assignments/uri-schemes/perm/thismessage"},{scheme:"tip",description:"Transaction Internet Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2371"}]},{scheme:"tn3270",description:"Interactive 3270 emulation sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6270"}]},{scheme:"turn",description:"turn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"turns",description:"turns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"tv",description:"TV Broadcasts",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2838"}]},{scheme:"urn",description:"Uniform Resource Names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2141"},{type:"registry",href:"http://www.iana.org/assignments/urn-namespaces"}]},{scheme:"vemmi",description:"versatile multimedia interface",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2122"}]},{scheme:"vnc",description:"Remote Framebuffer Protocol",reference:[{type:"draft",href:"http://www.iana.org/go/RFC-warden-appsawg-vnc-scheme-10"}]},{scheme:"ws",description:"WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"wss",description:"Encrypted WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"xcon",description:"xcon",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xcon-userid",description:"xcon-userid",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xmlrpc.beep",description:"xmlrpc.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmlrpc.beeps",description:"xmlrpc.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmpp",description:"Extensible Messaging and Presence Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5122"}]},{scheme:"z39.50r",description:"Z39.50 Retrieval",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]},{scheme:"z39.50s",description:"Z39.50 Session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),Zc=B((t,e)=>{e.exports=[{scheme:"acr",description:"acr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/acr"},{scheme:"adiumxtra",description:"adiumxtra",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/adiumxtra"},{scheme:"afp",description:"afp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/afp"},{scheme:"afs",description:"Andrew File System global file names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"aim",description:"aim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aim"},{scheme:"appdata",description:"appdata",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/appdata"},{scheme:"apt",description:"apt",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/apt"},{scheme:"attachment",description:"attachment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/attachment"},{scheme:"aw",description:"aw",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aw"},{scheme:"barion",description:"barion",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/barion"},{scheme:"beshare",description:"beshare",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/beshare"},{scheme:"bitcoin",description:"bitcoin",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bitcoin"},{scheme:"blob",description:"blob",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/blob"},{scheme:"bolo",description:"bolo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bolo"},{scheme:"callto",description:"callto",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/callto"},{scheme:"chrome",description:"chrome",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome"},{scheme:"chrome-extension",description:"chrome-extension",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome-extension"},{scheme:"com-eventbrite-attendee",description:"com-eventbrite-attendee",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/com-eventbrite-attendee"},{scheme:"content",description:"content",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/content"},{scheme:"cvs",description:"cvs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/cvs"},{scheme:"dis",description:"dis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dis"},{scheme:"dlna-playcontainer",description:"dlna-playcontainer",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playcontainer"},{scheme:"dlna-playsingle",description:"dlna-playsingle",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playsingle"},{scheme:"dntp",description:"dntp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dntp"},{scheme:"dtn",description:"DTNRG research and development",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5050"}]},{scheme:"dvb",description:"dvb",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mcroberts-uri-dvb"}]},{scheme:"ed2k",description:"ed2k",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ed2k"},{scheme:"facetime",description:"facetime",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/facetime"},{scheme:"feed",description:"feed",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feed"},{scheme:"feedready",description:"feedready",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feedready"},{scheme:"finger",description:"finger",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/finger"},{scheme:"fish",description:"fish",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/fish"},{scheme:"gg",description:"gg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gg"},{scheme:"git",description:"git",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/git"},{scheme:"gizmoproject",description:"gizmoproject",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gizmoproject"},{scheme:"gtalk",description:"gtalk",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gtalk"},{scheme:"ham",description:"ham",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7046"}]},{scheme:"hcp",description:"hcp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/hcp"},{scheme:"icon",description:"icon",reference:[{type:"draft",href:"http://www.iana.org/go/draft-lafayette-icon-uri-scheme"}]},{scheme:"iotdisco",description:"iotdisco",reference:[{type:"uri",href:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco.pdf"}],template:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco"},{scheme:"ipn",description:"ipn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6260"}]},{scheme:"irc",description:"irc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc"},{scheme:"irc6",description:"irc6",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc6"},{scheme:"ircs",description:"ircs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ircs"},{scheme:"isostore",description:"isostore",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/isostore"},{scheme:"itms",description:"itms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/itms"},{scheme:"jar",description:"jar",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/jar"},{scheme:"jms",description:"Java Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6167"}]},{scheme:"keyparc",description:"keyparc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/keyparc"},{scheme:"lastfm",description:"lastfm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/lastfm"},{scheme:"ldaps",description:"ldaps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ldaps"},{scheme:"magnet",description:"magnet",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/magnet"},{scheme:"maps",description:"maps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/maps"},{scheme:"market",description:"market",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/market"},{scheme:"message",description:"message",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/message"},{scheme:"mms",description:"mms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mms"},{scheme:"ms-access",description:"ms-access",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-access"},{scheme:"ms-drive-to",description:"ms-drive-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-drive-to"},{scheme:"ms-enrollment",description:"ms-enrollment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-enrollment"},{scheme:"ms-excel",description:"ms-excel",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-excel"},{scheme:"ms-getoffice",description:"ms-getoffice",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-getoffice"},{scheme:"ms-help",description:"ms-help",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-help"},{scheme:"ms-infopath",description:"ms-infopath",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-infopath"},{scheme:"ms-media-stream-id",description:"ms-media-stream-id",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-media-stream-id"},{scheme:"ms-powerpoint",description:"ms-powerpoint",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-powerpoint"},{scheme:"ms-project",description:"ms-project",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-project"},{scheme:"ms-publisher",description:"ms-publisher",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-publisher"},{scheme:"ms-search-repair",description:"ms-search-repair",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-search-repair"},{scheme:"ms-secondary-screen-controller",description:"ms-secondary-screen-controller",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-controller"},{scheme:"ms-secondary-screen-setup",description:"ms-secondary-screen-setup",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-setup"},{scheme:"ms-settings",description:"ms-settings",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings"},{scheme:"ms-settings-airplanemode",description:"ms-settings-airplanemode",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-airplanemode"},{scheme:"ms-settings-bluetooth",description:"ms-settings-bluetooth",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-bluetooth"},{scheme:"ms-settings-camera",description:"ms-settings-camera",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-camera"},{scheme:"ms-settings-cellular",description:"ms-settings-cellular",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cellular"},{scheme:"ms-settings-cloudstorage",description:"ms-settings-cloudstorage",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cloudstorage"},{scheme:"ms-settings-connectabledevices",description:"ms-settings-connectabledevices",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-connectabledevices"},{scheme:"ms-settings-displays-topology",description:"ms-settings-displays-topology",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-displays-topology"},{scheme:"ms-settings-emailandaccounts",description:"ms-settings-emailandaccounts",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-emailandaccounts"},{scheme:"ms-settings-language",description:"ms-settings-language",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-language"},{scheme:"ms-settings-location",description:"ms-settings-location",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-location"},{scheme:"ms-settings-lock",description:"ms-settings-lock",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-lock"},{scheme:"ms-settings-nfctransactions",description:"ms-settings-nfctransactions",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-nfctransactions"},{scheme:"ms-settings-notifications",description:"ms-settings-notifications",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-notifications"},{scheme:"ms-settings-power",description:"ms-settings-power",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-power"},{scheme:"ms-settings-privacy",description:"ms-settings-privacy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-privacy"},{scheme:"ms-settings-proximity",description:"ms-settings-proximity",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-proximity"},{scheme:"ms-settings-screenrotation",description:"ms-settings-screenrotation",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-screenrotation"},{scheme:"ms-settings-wifi",description:"ms-settings-wifi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-wifi"},{scheme:"ms-settings-workplace",description:"ms-settings-workplace",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-workplace"},{scheme:"ms-spd",description:"ms-spd",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-spd"},{scheme:"ms-transit-to",description:"ms-transit-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-transit-to"},{scheme:"ms-visio",description:"ms-visio",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-visio"},{scheme:"ms-walk-to",description:"ms-walk-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-walk-to"},{scheme:"ms-word",description:"ms-word",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-word"},{scheme:"msnim",description:"msnim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/msnim"},{scheme:"mumble",description:"mumble",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mumble"},{scheme:"mvn",description:"mvn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mvn"},{scheme:"notes",description:"notes",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/notes"},{scheme:"oid",description:"oid",reference:[{type:"draft",href:"http://www.iana.org/go/draft-larmouth-oid-iri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/oid"},{scheme:"palm",description:"palm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/palm"},{scheme:"paparazzi",description:"paparazzi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/paparazzi"},{scheme:"platform",description:"platform",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/platform"},{scheme:"proxy",description:"proxy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/proxy"},{scheme:"psyc",description:"psyc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/psyc"},{scheme:"query",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/query"},{scheme:"redis",description:"redis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/redis"},{scheme:"rediss",description:"rediss",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rediss"},{scheme:"res",description:"res",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/res"},{scheme:"resource",description:"resource",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/resource"},{scheme:"rmi",description:"rmi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rmi"},{scheme:"rsync",description:"rsync",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5781"}]},{scheme:"rtmfp",description:"rtmfp",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7425"}],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmfp"},{scheme:"rtmp",description:"rtmp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmp"},{scheme:"secondlife",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/secondlife"},{scheme:"sftp",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sftp"},{scheme:"sgn",description:"sgn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sgn"},{scheme:"skype",description:"skype",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/skype"},{scheme:"smb",description:"smb",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/smb"},{scheme:"smtp",description:"smtp",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/smtp"},{scheme:"soldat",description:"soldat",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/soldat"},{scheme:"spotify",description:"spotify",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/spotify"},{scheme:"ssh",description:"ssh",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ssh"},{scheme:"steam",description:"steam",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/steam"},{scheme:"submit",description:"submit",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/submit"},{scheme:"svn",description:"svn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/svn"},{scheme:"teamspeak",description:"teamspeak",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teamspeak"},{scheme:"teliaeid",description:"teliaeid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teliaeid"},{scheme:"things",description:"things",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/things"},{scheme:"tool",description:"tool",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/tool"},{scheme:"udp",description:"udp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/udp"},{scheme:"unreal",description:"unreal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/unreal"},{scheme:"ut2004",description:"ut2004",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ut2004"},{scheme:"v-event",description:"v-event",reference:[{type:"draft",href:"http://www.iana.org/go/draft-menderico-v-event-uri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/v-event"},{scheme:"ventrilo",description:"ventrilo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ventrilo"},{scheme:"view-source",description:"view-source",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/view-source"},{scheme:"webcal",description:"webcal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/webcal"},{scheme:"wpid",description:"wpid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wpid"},{scheme:"wtai",description:"wtai",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wtai"},{scheme:"wyciwyg",description:"wyciwyg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wyciwyg"},{scheme:"xfire",description:"xfire",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xfire"},{scheme:"xri",description:"xri",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xri"},{scheme:"ymsgr",description:"ymsgr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ymsgr"}]}),el=B((t,e)=>{e.exports=[{scheme:"fax",description:"fax",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"filesystem",description:"filesystem",reference:[],template:"http://www.iana.org/assignments/uri-schemes/historic/filesystem"},{scheme:"mailserver",description:"Access to data available from mail servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6196"}]},{scheme:"modem",description:"modem",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"pack",description:"pack",reference:[{type:"draft",href:"http://www.iana.org/go/draft-shur-pack-uri-scheme"}],template:"http://www.iana.org/assignments/uri-schemes/historic/pack"},{scheme:"prospero",description:"Prospero Directory Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4157"}]},{scheme:"snews",description:"NNTP over SSL/TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"videotex",description:"videotex",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mavrakis-videotex-url-spec"},{type:"rfc",href:"http://www.iana.org/go/rfc2122"},{type:"rfc",href:"http://www.iana.org/go/rfc3986"}],template:"http://www.iana.org/assignments/uri-schemes/historic/videotex"},{scheme:"wais",description:"Wide Area Information Servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4156"}]},{scheme:"z39.50",description:"Z39.50 information access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"},{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),tl=B((t,e)=>{e.exports=[{scheme:"android-app"},{scheme:"webpack"},{scheme:"s3",description:"Amazon Web Services S3 bucket"},{scheme:"gs",description:"Google Cloud Storage"},{scheme:"mqtt",description:"Message Queuing Telemetry Transport Protocol"},{scheme:"modbus+tcp",description:"Modbus over TCP"}]}),sa=B((t,e)=>{var r=Xc(),n={permanent:Yc(),provosional:Zc(),historical:el()},s={};Object.keys(n).forEach(function(l){n[l].forEach(function(a){s[a.scheme]=r(a,{type:l})})}),n.unofficial=tl().filter(function(l){return!s[l.scheme]}),n.unofficial.forEach(function(l){s[l.scheme]=r(l,{type:"unofficial"})}),e.exports=r(n,{allByName:s})}),rl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return!!(u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&s.allByName[u.scheme])}}),nl=B((t,e)=>{e.exports=/^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?W)?(\d+(?:\.\d+)?D)?(T(?=\d)(\d+(?:\.\d+)?H)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?S)?)?$/}),sl=B((t,e)=>{var{parse:r}=Kn();e.exports=n=>{try{return r(n),!0}catch{return!1}}}),aa={};oo(aa,{default:()=>la});function ia(t){return this[t]}function al(t,e){this[t]=ll.bind(null,e)}var oa,ca,vr,Gn,Wn,il=(t,e,r)=>{var n=Gn(e);for(let s of n)!Wn.call(t,s)&&s!=="default"&&vr(t,s,{get:ia.bind(e,s),enumerable:!0})},ol,ys=(t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var s=ol??(ol=new WeakMap),l=s.get(t);if(l)return l}r=t!=null?oa(ca(t)):{};let a=e||!t||!t.__esModule?vr(r,"default",{value:t,enumerable:!0}):r;for(let u of Gn(t))Wn.call(a,u)||vr(a,u,{get:ia.bind(t,u),enumerable:!0});return n&&s.set(t,a),a},cl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ll=t=>t,ul=(t,e)=>{for(var r in e)vr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:al.bind(e,r)})},mn,gn,vn,la,fl=co(()=>{oa=Object.create,{getPrototypeOf:ca,defineProperty:vr,getOwnPropertyNames:Gn}=Object,Wn=Object.prototype.hasOwnProperty,mn=cl((t,e)=>{var r=/^xn--/,n=/[^\0-\x7F]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,u=String.fromCharCode;function i($){throw RangeError(l[$])}function h($,y){let f=[],S=$.length;for(;S--;)f[S]=y($[S]);return f}function c($,y){let f=$.split("@"),S="";f.length>1&&(S=f[0]+"@",$=f[1]),$=$.replace(s,".");let O=$.split("."),j=h(O,y).join(".");return S+j}function d($){let y=[],f=0,S=$.length;for(;f<S;){let O=$.charCodeAt(f++);if(O>=55296&&O<=56319&&f<S){let j=$.charCodeAt(f++);(j&64512)==56320?y.push(((O&1023)<<10)+(j&1023)+65536):(y.push(O),f--)}else y.push(O)}return y}var w=$=>String.fromCodePoint(...$),P=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:36},b=function($,y){return $+22+75*($<26)-((y!=0)<<5)},E=function($,y,f){let S=0;for($=f?a($/700):$>>1,$+=a($/y);$>455;S+=36)$=a($/35);return a(S+36*$/($+38))},m=function($){let y=[],f=$.length,S=0,O=128,j=72,F=$.lastIndexOf("-");F<0&&(F=0);for(let U=0;U<F;++U)$.charCodeAt(U)>=128&&i("not-basic"),y.push($.charCodeAt(U));for(let U=F>0?F+1:0;U<f;){let X=S;for(let ee=1,fe=36;;fe+=36){U>=f&&i("invalid-input");let we=P($.charCodeAt(U++));we>=36&&i("invalid-input"),we>a((2147483647-S)/ee)&&i("overflow"),S+=we*ee;let Oe=fe<=j?1:fe>=j+26?26:fe-j;if(we<Oe)break;let se=36-Oe;ee>a(2147483647/se)&&i("overflow"),ee*=se}let G=y.length+1;j=E(S-X,G,X==0),a(S/G)>2147483647-O&&i("overflow"),O+=a(S/G),S%=G,y.splice(S++,0,O)}return String.fromCodePoint(...y)},o=function($){let y=[];$=d($);let f=$.length,S=128,O=0,j=72;for(let X of $)X<128&&y.push(u(X));let F=y.length,U=F;for(F&&y.push("-");U<f;){let X=2147483647;for(let ee of $)ee>=S&&ee<X&&(X=ee);let G=U+1;X-S>a((2147483647-O)/G)&&i("overflow"),O+=(X-S)*G,S=X;for(let ee of $)if(ee<S&&++O>2147483647&&i("overflow"),ee===S){let fe=O;for(let we=36;;we+=36){let Oe=we<=j?1:we>=j+26?26:we-j;if(fe<Oe)break;let se=fe-Oe,x=36-Oe;y.push(u(b(Oe+se%x,0))),fe=a(se/x)}y.push(u(b(fe,0))),j=E(O,G,U===F),O=0,++U}++O,++S}return y.join("")},_=function($){return c($,function(y){return r.test(y)?m(y.slice(4).toLowerCase()):y})},p=function($){return c($,function(y){return n.test(y)?"xn--"+o(y):y})},v={version:"2.3.1",ucs2:{decode:d,encode:w},decode:m,encode:o,toASCII:p,toUnicode:_};e.exports=v}),gn={},ul(gn,{default:()=>vn.default}),il(gn,ys(mn(),1)),vn=ys(mn(),1),la=vn.default}),dl=B((t,e)=>{var{toASCII:r}=(fl(),so(aa)),n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;e.exports=s=>{const l=r(s);return l.replace(/\.$/,"").length<=253&&n.test(l)}}),hl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&u.path!==void 0&&s.allByName[u.scheme]?!0:u.scheme&&!s.allByName[u.scheme]?!1:u.path!==void 0&&(u.reference==="relative"||u.reference==="same-document"||u.reference==="uri")}}),pl=B((t,e)=>{t.iri=rl(),t.duration=nl(),t["idn-email"]=sl(),t["idn-hostname"]=dl(),t["iri-reference"]=hl()}),ml=B((t,e)=>{var r=pl();e.exports=(n,s={})=>{const l=Object.keys(r);let a=l;if(s.formats){if(!Array.isArray(s.formats))throw new Error("options.formats must be an array");a=s.formats}return l.filter(u=>a.includes(u)).forEach(u=>{n.addFormat(u,r[u])}),n}}),gl=B((t,e)=>{var r=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function l(h,c,d){this.fn=h,this.context=c,this.once=d||!1}function a(h,c,d,w,P){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new l(d,w||h,P),E=n?n+c:c;return h._events[E]?h._events[E].fn?h._events[E]=[h._events[E],b]:h._events[E].push(b):(h._events[E]=b,h._eventsCount++),h}function u(h,c){--h._eventsCount===0?h._events=new s:delete h._events[c]}function i(){this._events=new s,this._eventsCount=0}i.prototype.eventNames=function(){var c=[],d,w;if(this._eventsCount===0)return c;for(w in d=this._events)r.call(d,w)&&c.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},i.prototype.listeners=function(c){var d=n?n+c:c,w=this._events[d];if(!w)return[];if(w.fn)return[w.fn];for(var P=0,b=w.length,E=new Array(b);P<b;P++)E[P]=w[P].fn;return E},i.prototype.listenerCount=function(c){var d=n?n+c:c,w=this._events[d];return w?w.fn?1:w.length:0},i.prototype.emit=function(c,d,w,P,b,E){var m=n?n+c:c;if(!this._events[m])return!1;var o=this._events[m],_=arguments.length,p,v;if(o.fn){switch(o.once&&this.removeListener(c,o.fn,void 0,!0),_){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,d),!0;case 3:return o.fn.call(o.context,d,w),!0;case 4:return o.fn.call(o.context,d,w,P),!0;case 5:return o.fn.call(o.context,d,w,P,b),!0;case 6:return o.fn.call(o.context,d,w,P,b,E),!0}for(v=1,p=new Array(_-1);v<_;v++)p[v-1]=arguments[v];o.fn.apply(o.context,p)}else{var $=o.length,y;for(v=0;v<$;v++)switch(o[v].once&&this.removeListener(c,o[v].fn,void 0,!0),_){case 1:o[v].fn.call(o[v].context);break;case 2:o[v].fn.call(o[v].context,d);break;case 3:o[v].fn.call(o[v].context,d,w);break;case 4:o[v].fn.call(o[v].context,d,w,P);break;default:if(!p)for(y=1,p=new Array(_-1);y<_;y++)p[y-1]=arguments[y];o[v].fn.apply(o[v].context,p)}}return!0},i.prototype.on=function(c,d,w){return a(this,c,d,w,!1)},i.prototype.once=function(c,d,w){return a(this,c,d,w,!0)},i.prototype.removeListener=function(c,d,w,P){var b=n?n+c:c;if(!this._events[b])return this;if(!d)return u(this,b),this;var E=this._events[b];if(E.fn)E.fn===d&&(!P||E.once)&&(!w||E.context===w)&&u(this,b);else{for(var m=0,o=[],_=E.length;m<_;m++)(E[m].fn!==d||P&&!E[m].once||w&&E[m].context!==w)&&o.push(E[m]);o.length?this._events[b]=o.length===1?o[0]:o:u(this,b)}return this},i.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&u(this,d)):(this._events=new s,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,typeof e<"u"&&(e.exports=i)}),vl="https://www.w3.org/ns/activitystreams",yl="https://sockethub.org/ns/context/v1.jsonld",_l="error",wl="https://sockethub.org/ns/context/platform/error/v1.jsonld",$l="sockethub:internal",bl="https://sockethub.org/ns/context/platform/sockethub:internal/v1.jsonld",Jn=new Map,ua=new Map,fa=new Map;function El(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Sl(t){return El(t["@context"])}function da(t,e,r,n){Jn.set(e,t),ua.set(e,r),fa.set(e,n)}function Qn(t){const r=Sl(t).filter(n=>Jn.has(n));return r.length!==1?null:r[0]}function Pl(t){return Jn.get(t)}function kl(t){return ua.get(t)}function Ol(t){return fa.get(t)}var ha={feed:{required:["id","type"],additionalProperties:!0,properties:{type:{enum:["feed"]},id:{type:"string",format:"iri"},name:{type:"string"},description:{type:"string"},author:{type:"string"},favicon:{type:"string"}}},person:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["person"]},name:{type:"string"}}},room:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["room"]},name:{type:"string"}}},service:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["service"]},name:{type:"string"}}},platform:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["platform"]},name:{type:"string"}}},website:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string",format:"iri"},type:{enum:["website"]},name:{type:"string"}}},address:{required:["type"],additionalProperties:!1,properties:{type:{enum:["address"]}}},calendar:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string",format:"iri"},type:{enum:["calendar"]},name:{type:"string"},components:{type:"array",items:{enum:["event","task"]}}}}},Nl=Object.keys(ha),pa=["person","room","service","feed","website","platform"],ma=["person","room","service","feed","website","platform","address","calendar"],Tl=pa.map(t=>({$ref:`#/definitions/type/${t}`})),Rl=ma.map(t=>({$ref:`#/definitions/type/${t}`})),Il={type:"array",minItems:3,maxItems:3,items:{type:"string"},allOf:[{contains:{const:vl}},{contains:{const:yl}}]},Cl={type:"string"},Al={$id:"https://sockethub.org/schemas/v/activity-stream.json",description:"Schema for Sockethub Activity Streams",type:"object",required:["@context","type","actor"],additionalProperties:!1,properties:{"@context":Il,id:{type:"string"},type:Cl,actor:{type:"object",oneOf:Tl},target:{type:"object",oneOf:Rl},object:{type:"object"},published:{type:"string",format:"date-time"}},definitions:{type:ha}},jl={version:"3.0.0-alpha.18"};function Ml(t,e){return t.replace("/v/",`/${e}/`)}var Dl={$id:"https://sockethub.org/schemas/v/sockethub-config.json"};Ml(Dl.$id,jl.version);var ql=Hr(tc()),Ll=Hr(Wc()),Ul=Hr(ml());function Vl(t){let e=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return t.keyword==="additionalProperties"?e+=`: ${t.params.additionalProperty}`:t.keyword==="enum"&&(e+=`: ${t.params.allowedValues.join(", ")}`),e}function dr(t){const e=[];t!=null&&t.type&&e.push(t.type);const r=t;for(const n in r){const s=r[n];s&&typeof s=="object"&&"type"in s&&e.push(...dr(s))}return e}function Fl(t){const e=t.schemaPath.match(/#\/\w+\/\w+\/([\w-]+)\//);return e?e[1]:void 0}function zl(t){const e=t.instancePath.match(/\/(\w+)/);return e?e[1]:void 0}function xl(t,e){const r=Fl(t),n=zl(t);if(!n)return-1;const s=e[n];return!s||!r||!s.includes(r)?-1:t.instancePath.split("/").length}function Bl(t){if(!Array.isArray(t["@context"]))return{actor:[],target:[],object:dr(t)};const e=t;return{actor:dr(e.actor),target:dr(e.target),object:e.object?dr(e.object):[]}}function Hl(t,e,r){const n=Bl(t);let s=0,l=-1;for(let a=0;a<e.length;a++){const u=xl(e[a],n);u>l&&(l=u,s=a)}return l>=0?Vl(e[s]):Gl(e[e.length-1],r)}function Kl(t,e){if(!(e!=null&&e.excludeTypes)||e.excludeTypes.length===0)return t;const r=new Set(e.excludeTypes);return t.filter(n=>!r.has(n))}function Gl(t,e){let r;if(t.keyword==="oneOf"){const n=t.instancePath.split("/")[1],s=n==="actor"?pa:n==="target"?ma:Nl,l=Kl(s,e),a=l.length>0?l:s;r=`${t.instancePath}: ${t.message}: ${a.join(", ")}`}else r=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return"additionalProperty"in t.params&&(r+=`: ${t.params.additionalProperty}`),r}var Mt=new ql.default({strictTypes:!1,allErrors:!0});Ll.default(Mt);Ul.default(Mt);var Dt="https://sockethub.org/schemas/v0",On={},Wl={},_s=!1;On[`${Dt}/activity-stream`]=Al;for(const t in On)Mt.addSchema(On[t],t);function ws(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`);const r=`${Dt}/context/${t}/messages`;Mt.getSchema(r)||Mt.addSchema({},r);const n=`${Dt}/context/${t}/credentials`;Mt.getSchema(n)||Mt.addSchema({},n)}function Jl(){_s||(ws(_l,wl),ws($l,bl),_s=!0)}Jl();function Br(t,e){const r=Mt.getSchema(t);if(!r)return`schema ${t} not found`;if(!r(e)){let s=Hl(e,r.errors,Wl);if(Array.isArray(e["@context"])){const l=Qn(e);if(l){const a=Pl(l);a&&(s=`[${a}] ${s}`)}}return s}return""}function Ql(t){const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"activity streams must have exactly one registered platform context URL in @context";const n=kl(r);return n?Br(n,t):`platform context URL ${r} does not have a registered message schema`}function Xl(t){if(!Array.isArray(t["@context"]))return"credential activity streams must have an @context set";if(t.type!=="credentials")return"credential activity streams must have credentials set as type";const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"credential activity streams must have exactly one registered platform context URL in @context";const n=Ol(r);return n?Br(n,t):`platform context URL ${r} does not have a registered credentials schema`}function $s(t,e){const r=`${Dt}/context/${e}`;Mt.getSchema(r)||Mt.addSchema(t,r)}function Yl(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`)}var bs={actor:"id",target:"id",object:"content"};function Zl(t,e){return typeof t=="string"?{[e]:t}:Array.isArray(t)?t.map(r=>typeof r=="string"?{id:r}:r):t}function yn(t){const e={...t};for(const r of Object.keys(bs))r in e&&(e[r]=Zl(e[r],bs[r]));return e}var eu=Hr(gl()),tu=eu.default;class en{constructor(e,r={}){nt(this,"events",{credentials:new Map,connect:new Map,join:new Map});nt(this,"_socket");nt(this,"socket");nt(this,"debug",!0);nt(this,"options");nt(this,"platformRegistry",new Map);nt(this,"asContextUrl");nt(this,"sockethubContextUrl");nt(this,"sockethubVersion");nt(this,"initState","idle");nt(this,"hasReadyOnce",!1);nt(this,"initCycle");nt(this,"initTokenCounter",0);nt(this,"initTimeoutTimer");nt(this,"waitingWarningTimer");nt(this,"waitingWarningIntervalMs",1e4);nt(this,"readyWaiters",[]);nt(this,"outboundQueue",[]);nt(this,"outboundSequence",0);nt(this,"registryFingerprint");nt(this,"latestReadyInfo");if(!e)throw new Error("SockethubClient requires a socket.io instance");this._socket=e,this.options={initTimeoutMs:r.initTimeoutMs??5e3,maxQueuedOutbound:r.maxQueuedOutbound??1e3,maxQueuedAgeMs:r.maxQueuedAgeMs??3e4},this.socket=this.createPublicEmitter(),this.registerSocketIOHandlers(),this._socket.connected&&(this.socket.connected=!0,this.socket.id=this._socket.id,this.socket._emit("connect"),this.startInitialization("initial-connect",!0))}clearCredentials(){this.events.credentials.clear()}getRegisteredPlatforms(){return Array.from(this.platformRegistry.values()).map(e=>({...e,types:[...e.types],schemas:{...e.schemas}}))}isSchemasReady(){return this.isReady()}isReady(){return this.initState==="ready"}getInitState(){return this.initState}getRegisteredBaseContexts(){if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");return{as:this.asContextUrl,sockethub:this.sockethubContextUrl}}getPlatformSchema(e,r="messages"){var s,l;const n=e==null?void 0:e.trim();if(n)return(l=(s=this.platformRegistry.get(n))==null?void 0:s.schemas)==null?void 0:l[r]}async waitForSchemas(e=2e3){return await this.ready(e),this.buildPlatformRegistryPayload()}ready(e=this.options.initTimeoutMs){return this.isReady()&&this.latestReadyInfo?Promise.resolve(this.latestReadyInfo):new Promise((r,n)=>{const s={resolve:r,reject:n};e>0&&(s.timer=setTimeout(()=>{this.readyWaiters=this.readyWaiters.filter(l=>l!==s),n(new Error(`SockethubClient ready() timed out after ${e}ms`))},e)),this.readyWaiters.push(s),this.socket.connected&&this.initState==="idle"&&this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)})}validateActivity(e){return e.type==="credentials"?Xl(e):Ql(e)}contextFor(e){if(typeof e!="string"||e.trim().length===0)throw new Error("SockethubClient.contextFor(platform) requires a non-empty platform string");if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");const r=e.trim(),n=this.platformRegistry.get(r);if(!n){const s=Array.from(this.platformRegistry.keys()).sort();throw new Error(`unknown platform '${r}'. Registered platforms: ${s.join(", ")}`)}return[this.asContextUrl,this.sockethubContextUrl,n.contextUrl]}createPublicEmitter(){const e=new tu;return e._emit=e.emit,e.emit=(r,n,s)=>{this.handlePublicEmit(r,n,s)},e.connected=!1,e.disconnect=()=>{this._socket.disconnect()},e.connect=()=>{this._socket.connect()},e}requestSchemaRegistry(){"io"in this._socket&&this._socket.emit("schemas",this.registryFingerprint,r=>{this.handleSchemasPayload(r)})}applyPlatformRegistry(e){var a,u,i,h;if(!e||typeof e!="object")return;const r=e,n=(a=r.contexts)==null?void 0:a.as,s=(u=r.contexts)==null?void 0:u.sockethub;if(typeof n!="string"||typeof s!="string"||!Array.isArray(r.platforms))return;this.sockethubVersion=typeof r.version=="string"?r.version:"unknown",this.asContextUrl=n,this.sockethubContextUrl=s,this.platformRegistry.clear();for(const c of r.platforms)if(!(!c||typeof c!="object"||typeof c.id!="string"||typeof c.version!="string"||typeof c.contextUrl!="string")){this.platformRegistry.set(c.id,{...c,version:c.version,types:Array.isArray(c.types)?c.types:[],schemas:c.schemas||{}}),Yl(c.id,c.contextUrl);try{const d=(i=c.schemas)==null?void 0:i.credentials;d&&typeof d=="object"&&!Array.isArray(d)&&$s(d,`${c.id}/credentials`);const w=(h=c.schemas)==null?void 0:h.messages;w&&typeof w=="object"&&!Array.isArray(w)&&$s(w,`${c.id}/messages`)}catch(d){const w=d instanceof Error?d.message:String(d);console.warn(`[SockethubClient] Failed to register schemas for platform ${c.id}: ${w}`)}}const l=this.buildPlatformRegistryPayload();return this.registryFingerprint=typeof r.fingerprint=="string"?r.fingerprint:void 0,this.socket._emit("schemas",l),l}eventCredentials(e){if(e.object&&e.object.type==="credentials"){const r=e.actor.id||e.actor;this.events.credentials.set(r,e)}}eventMessage(e){if(!this._socket.connected)return;const r=en.getKey(e);e.type==="join"||e.type==="connect"?this.events[e.type].set(r,e):e.type==="leave"?this.events.join.delete(r):e.type==="disconnect"&&this.events.connect.delete(r)}static getKey(e){var s;const r=((s=e.actor)==null?void 0:s.id)||e.actor;if(!r)throw new Error(`actor property not present for message type: ${e==null?void 0:e.type}`);const n=e.target?e.target.id||e.target:"";return`${r}-${n}`}buildPlatformRegistryPayload(){return{version:this.sockethubVersion,contexts:this.asContextUrl&&this.sockethubContextUrl?{as:this.asContextUrl,sockethub:this.sockethubContextUrl}:void 0,platforms:this.getRegisteredPlatforms()}}buildReadyInfo(e){if(!(!this.sockethubVersion||!this.asContextUrl||!this.sockethubContextUrl))return{state:"ready",reason:e,sockethubVersion:this.sockethubVersion,contexts:{as:this.asContextUrl,sockethub:this.sockethubContextUrl},platforms:this.getRegisteredPlatforms().map(r=>({id:r.id,version:r.version,contextUrl:r.contextUrl,contextVersion:r.contextVersion,schemaVersion:r.schemaVersion,types:[...r.types]}))}}resolveReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.resolve(e)}rejectReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.reject(e)}emitInitError(e,r,n){this.socket._emit("init_error",{error:e,phase:r,retrying:n})}emitClientError(e,r,n){if(typeof r=="function"){r({error:n});return}this.socket._emit("client_error",{event:e,error:n})}clearInitTimers(){this.initTimeoutTimer&&(clearTimeout(this.initTimeoutTimer),this.initTimeoutTimer=void 0),this.waitingWarningTimer&&(clearInterval(this.waitingWarningTimer),this.waitingWarningTimer=void 0)}startWaitingWarnings(){this.waitingWarningTimer||(this.waitingWarningTimer=setInterval(()=>{if(this.isReady()||this.initState==="closed"){this.clearInitTimers();return}const e=this.outboundQueue.length,r=this.outboundQueue[0],n=r?((Date.now()-r.enqueuedAt)/1e3).toFixed(1):"0.0";console.warn(`[SockethubClient] Still waiting for schemas; queued outbound messages: ${e}; oldest queued age: ${n}s.`)},this.waitingWarningIntervalMs))}startInitialization(e,r){if(!this.socket.connected||this.initState==="closed")return;const n=++this.initTokenCounter;this.initCycle={token:n,reason:e,startedAt:Date.now(),replayOnReady:r,timedOut:!1},this.initState="initializing",this.clearInitTimers(),this.initTimeoutTimer=setTimeout(()=>{if(!this.initCycle||this.initCycle.token!==n)return;this.initCycle.timedOut=!0,this.initState="init_error";const s=`Initialization timed out after ${this.options.initTimeoutMs}ms waiting for schemas`;console.warn(`[SockethubClient] ${s}; queued outbound messages: ${this.outboundQueue.length}. Waiting for schemas event from server.`),this.emitInitError(s,"timeout",!1),this.startWaitingWarnings()},this.options.initTimeoutMs);try{this.requestSchemaRegistry()}catch(s){this.initState="init_error";const l=s instanceof Error?s.message:String(s);this.emitInitError(l,"schemas-request",!1),this.startWaitingWarnings()}}markReady(e){const r=this.initCycle,n=!!(r!=null&&r.replayOnReady);this.initCycle=void 0,this.clearInitTimers(),this.initState="ready",this.hasReadyOnce=!0;const s=this.buildReadyInfo(e);if(!s){const l=new Error("Failed to build ready payload");this.initState="init_error",this.emitInitError(l.message,"schemas-apply",!0),this.rejectReadyWaiters(l);return}this.socket._emit("ready",s),this.latestReadyInfo=s,this.resolveReadyWaiters(s),n&&(this.replay("credentials",this.events.credentials),this.replay("message",this.events.connect),this.replay("message",this.events.join)),this.flushOutboundQueue()}handleSchemasPayload(e){if(!e||typeof e!="object")return;if(e.unchanged===!0&&typeof this.registryFingerprint=="string"&&this.platformRegistry.size>0){this.initCycle?this.markReady(this.initCycle.reason):this.initState!=="ready"&&this.markReady("schemas-update");return}const r=e.fingerprint;if(this.initState==="ready"&&!this.initCycle&&r&&r===this.registryFingerprint)return;if(this.initState==="ready"&&!this.initCycle&&(this.initState="initializing"),!this.applyPlatformRegistry(e)){this.initState="init_error",this.emitInitError("Received invalid schemas payload from server","schemas-apply",!0),this.startWaitingWarnings();return}if(this.initCycle){this.markReady(this.initCycle.reason);return}this.markReady("schemas-update")}handlePublicEmit(e,r,n){const s={event:e,content:r,callback:n,enqueuedAt:Date.now(),sequence:this.outboundSequence++};if(!this.isReady()){this.enqueueOutbound(s);return}this.sendOutbound(s)}enqueueOutbound(e){if(this.outboundQueue.push(e),this.outboundQueue.length<=this.options.maxQueuedOutbound)return;const r=this.outboundQueue.shift();r&&this.emitClientError(r.event,r.callback,"SockethubClient queue overflow before ready")}flushOutboundQueue(){if(!this.isReady()||this.outboundQueue.length===0)return;const e=Date.now(),r=this.outboundQueue.sort((n,s)=>n.sequence-s.sequence);this.outboundQueue=[];for(const n of r){if(e-n.enqueuedAt>this.options.maxQueuedAgeMs){this.emitClientError(n.event,n.callback,`SockethubClient queued message expired after ${this.options.maxQueuedAgeMs}ms before initialization`);continue}this.sendOutbound(n)}}sendOutbound(e){let r=e.content;try{if(e.event==="credentials"||e.event==="message"){if(r=yn(e.content),r&&typeof r=="object"){const n=r;e.event==="credentials"&&!n.type&&(n.type="credentials"),n.actor&&typeof n.actor=="object"&&!n.actor.type&&(n.actor.type="person")}if(this.platformRegistry.size>0){const n=this.validateActivity(r);if(n){this.emitClientError(e.event,e.callback,`SockethubClient validation failed: ${n}`);return}}}e.event==="credentials"?this.eventCredentials(r):e.event==="message"&&this.eventMessage(r),this._socket.emit(e.event,r,e.callback)}catch(n){const s=n instanceof Error?n.message:String(n);this.emitClientError(e.event,e.callback,s)}}log(e,r){this.debug&&console.log(e,r)}registerSocketIOHandlers(){this._socket.on("connect",()=>{this.socket.id=this._socket.id,this.socket.connected=!0,this.socket._emit("connect"),this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)}),this._socket.on("connect_error",e=>{this.socket._emit("connect_error",e)}),this._socket.on("disconnect",e=>{this.socket.connected=!1,this.initState!=="closed"&&(this.initState="idle"),this.clearInitTimers(),this.socket._emit("disconnect",e)}),this._socket.on("schemas",e=>{this.handleSchemasPayload(e)}),this._socket.on("message",e=>{this.socket._emit("message",yn(e))})}hasActorId(e){return"actor"in e&&e.actor!==null&&typeof e.actor=="object"&&"id"in e.actor&&typeof e.actor.id=="string"}replay(e,r){for(const n of r.values()){const s=yn(n);let l=s==null?void 0:s.id;if(this.hasActorId(s)){const a=s.actor;l=typeof a=="string"?a:a.id}this.log(`replaying ${e} for ${l}`),this._socket.emit(e,s)}}}(t=>{t.SockethubClient=en})(typeof globalThis=="object"?globalThis:{});const Lt=Object.create(null);Lt.open="0";Lt.close="1";Lt.ping="2";Lt.pong="3";Lt.message="4";Lt.upgrade="5";Lt.noop="6";const Ir=Object.create(null);Object.keys(Lt).forEach(t=>{Ir[Lt[t]]=t});const Nn={type:"error",data:"parser error"},ga=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",va=typeof ArrayBuffer=="function",ya=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Xn=({type:t,data:e},r,n)=>ga&&e instanceof Blob?r?n(e):Es(e,n):va&&(e instanceof ArrayBuffer||ya(e))?r?n(e):Es(new Blob([e]),n):n(Lt[t]+(e||"")),Es=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function Ss(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let _n;function ru(t,e){if(ga&&t.data instanceof Blob)return t.data.arrayBuffer().then(Ss).then(e);if(va&&(t.data instanceof ArrayBuffer||ya(t.data)))return e(Ss(t.data));Xn(t,!1,r=>{_n||(_n=new TextEncoder),e(_n.encode(r))})}const Ps="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Ps.length;t++)hr[Ps.charCodeAt(t)]=t;const nu=t=>{let e=t.length*.75,r=t.length,n,s=0,l,a,u,i;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const h=new ArrayBuffer(e),c=new Uint8Array(h);for(n=0;n<r;n+=4)l=hr[t.charCodeAt(n)],a=hr[t.charCodeAt(n+1)],u=hr[t.charCodeAt(n+2)],i=hr[t.charCodeAt(n+3)],c[s++]=l<<2|a>>4,c[s++]=(a&15)<<4|u>>2,c[s++]=(u&3)<<6|i&63;return h},su=typeof ArrayBuffer=="function",Yn=(t,e)=>{if(typeof t!="string")return{type:"message",data:_a(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:au(t.substring(1),e)}:Ir[r]?t.length>1?{type:Ir[r],data:t.substring(1)}:{type:Ir[r]}:Nn},au=(t,e)=>{if(su){const r=nu(t);return _a(r,e)}else return{base64:!0,data:t}},_a=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},wa="",iu=(t,e)=>{const r=t.length,n=new Array(r);let s=0;t.forEach((l,a)=>{Xn(l,!1,u=>{n[a]=u,++s===r&&e(n.join(wa))})})},ou=(t,e)=>{const r=t.split(wa),n=[];for(let s=0;s<r.length;s++){const l=Yn(r[s],e);if(n.push(l),l.type==="error")break}return n};function cu(){return new TransformStream({transform(t,e){ru(t,r=>{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const l=new DataView(s.buffer);l.setUint8(0,126),l.setUint16(1,n)}else{s=new Uint8Array(9);const l=new DataView(s.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(r)})}})}let wn;function Nr(t){return t.reduce((e,r)=>e+r.length,0)}function Tr(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let s=0;s<e;s++)r[s]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function lu(t,e){wn||(wn=new TextDecoder);const r=[];let n=0,s=-1,l=!1;return new TransformStream({transform(a,u){for(r.push(a);;){if(n===0){if(Nr(r)<1)break;const i=Tr(r,1);l=(i[0]&128)===128,s=i[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Nr(r)<2)break;const i=Tr(r,2);s=new DataView(i.buffer,i.byteOffset,i.length).getUint16(0),n=3}else if(n===2){if(Nr(r)<8)break;const i=Tr(r,8),h=new DataView(i.buffer,i.byteOffset,i.length),c=h.getUint32(0);if(c>Math.pow(2,21)-1){u.enqueue(Nn);break}s=c*Math.pow(2,32)+h.getUint32(4),n=3}else{if(Nr(r)<s)break;const i=Tr(r,s);u.enqueue(Yn(l?i:wn.decode(i),e)),n=0}if(s===0||s>t){u.enqueue(Nn);break}}}})}const $a=4;function ot(t){if(t)return uu(t)}function uu(t){for(var e in ot.prototype)t[e]=ot.prototype[e];return t}ot.prototype.on=ot.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};ot.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};ot.prototype.off=ot.prototype.removeListener=ot.prototype.removeAllListeners=ot.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,s=0;s<r.length;s++)if(n=r[s],n===e||n.fn===e){r.splice(s,1);break}return r.length===0&&delete this._callbacks["$"+t],this};ot.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,e)}return this};ot.prototype.emitReserved=ot.prototype.emit;ot.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ot.prototype.hasListeners=function(t){return!!this.listeners(t).length};const tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Ot=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fu="arraybuffer";function ba(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const du=Ot.setTimeout,hu=Ot.clearTimeout;function rn(t,e){e.useNativeTimers?(t.setTimeoutFn=du.bind(Ot),t.clearTimeoutFn=hu.bind(Ot)):(t.setTimeoutFn=Ot.setTimeout.bind(Ot),t.clearTimeoutFn=Ot.clearTimeout.bind(Ot))}const pu=1.33;function mu(t){return typeof t=="string"?gu(t):Math.ceil((t.byteLength||t.size)*pu)}function gu(t){let e=0,r=0;for(let n=0,s=t.length;n<s;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function Ea(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function vu(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function yu(t){let e={},r=t.split("&");for(let n=0,s=r.length;n<s;n++){let l=r[n].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}class _u extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class Zn extends ot{constructor(e){super(),this.writable=!1,rn(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,n){return super.emitReserved("error",new _u(e,r,n)),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 r=Yn(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_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 r=vu(e);return r.length?"?"+r:""}}class wu extends Zn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};ou(e,this.socket.binaryType).forEach(r),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,iu(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Ea()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}}let Sa=!1;try{Sa=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $u=Sa;function bu(){}class Eu extends wu{constructor(e){if(super(e),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(s,l)=>{this.onError("xhr post error",s,l)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class qt extends ot{constructor(e,r,n){super(),this.createRequest=e,rn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const r=ba(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=qt.requestsCount++,qt.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=bu,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete qt.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()}}qt.requestsCount=0;qt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ks);else if(typeof addEventListener=="function"){const t="onpagehide"in Ot?"pagehide":"unload";addEventListener(t,ks,!1)}}function ks(){for(let t in qt.requests)qt.requests.hasOwnProperty(t)&&qt.requests[t].abort()}const Su=function(){const t=Pa({xdomain:!1});return t&&t.responseType!==null}();class Pu extends Eu{constructor(e){super(e);const r=e&&e.forceBase64;this.supportsBinary=Su&&!r}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new qt(Pa,this.uri(),e)}}function Pa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||$u))return new XMLHttpRequest}catch{}if(!e)try{return new Ot[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ka=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ku extends Zn{get name(){return"websocket"}doOpen(){const e=this.uri(),r=this.opts.protocols,n=ka?{}:ba(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,n)}catch(s){return this.emitReserved("error",s)}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 r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;Xn(n,this.supportsBinary,l=>{try{this.doWrite(n,l)}catch{}s&&tn(()=>{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",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Ea()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}}const $n=Ot.WebSocket||Ot.MozWebSocket;class Ou extends ku{createSocket(e,r,n){return ka?new $n(e,r,n):r?new $n(e,r):new $n(e)}doWrite(e,r){this.ws.send(r)}}class Nu extends Zn{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 r=lu(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),s=cu();s.readable.pipeTo(e.writable),this._writer=s.writable.getWriter();const l=()=>{n.read().then(({done:u,value:i})=>{u||(this.onPacket(i),l())}).catch(u=>{})};l();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 r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;this._writer.write(n).then(()=>{s&&tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Tu={websocket:Ou,webtransport:Nu,polling:Pu},Ru=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Iu=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tn(t){if(t.length>8e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let s=Ru.exec(t||""),l={},a=14;for(;a--;)l[Iu[a]]=s[a]||"";return r!=-1&&n!=-1&&(l.source=e,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=Cu(l,l.path),l.queryKey=Au(l,l.query),l}function Cu(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Au(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,l){s&&(r[s]=l)}),r}const Rn=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cr=[];Rn&&addEventListener("offline",()=>{Cr.forEach(t=>t())},!1);class Jt extends ot{constructor(e,r){if(super(),this.binaryType=fu,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){const n=Tn(e);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Tn(r.host).host);rn(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const s=n.prototype.name;this.transports.push(s),this._transportsByName[s]=n}),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},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yu(this.opts.query)),Rn&&(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"})},Cr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=$a,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Jt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(e);r.open(),this.setTransport(r)}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",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Jt.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 r=new Error("server error");r.code=e.data,this._onError(r);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 r=1;for(let n=0;n<this.writeBuffer.length;n++){const s=this.writeBuffer[n].data;if(s&&(r+=mu(s)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,n){return this._sendPacket("message",e,r,n),this}send(e,r,n){return this._sendPacket("message",e,r,n),this}_sendPacket(e,r,n,s){if(typeof r=="function"&&(s=r,r=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const l={type:e,data:r,options:n};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Jt.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,r){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(),Rn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Cr.indexOf(this._offlineEventListener);n!==-1&&Cr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=$a;class ju extends Jt{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 r=this.createTransport(e),n=!1;Jt.priorWebsocketSuccess=!1;const s=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Jt.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(c(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function l(){n||(n=!0,c(),r.close(),r=null)}const a=d=>{const w=new Error("probe error: "+d);w.transport=r.name,l(),this.emitReserved("upgradeError",w)};function u(){a("transport closed")}function i(){a("socket closed")}function h(d){r&&d.name!==r.name&&l()}const c=()=>{r.removeListener("open",s),r.removeListener("error",a),r.removeListener("close",u),this.off("close",i),this.off("upgrading",h)};r.once("open",s),r.once("error",a),r.once("close",u),this.once("close",i),this.once("upgrading",h),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const r=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}}let Mu=class extends ju{constructor(e,r={}){const n=typeof e=="object"?e:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(s=>Tu[s]).filter(s=>!!s)),super(e,n)}};function Du(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=Tn(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const l=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+l+":"+n.port+e,n.href=n.protocol+"://"+l+(r&&r.port===n.port?"":":"+n.port),n}const qu=typeof ArrayBuffer=="function",Lu=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Oa=Object.prototype.toString,Uu=typeof Blob=="function"||typeof Blob<"u"&&Oa.call(Blob)==="[object BlobConstructor]",Vu=typeof File=="function"||typeof File<"u"&&Oa.call(File)==="[object FileConstructor]";function es(t){return qu&&(t instanceof ArrayBuffer||Lu(t))||Uu&&t instanceof Blob||Vu&&t instanceof File}function Ar(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(Ar(t[r]))return!0;return!1}if(es(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ar(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Ar(t[r]))return!0;return!1}function Fu(t){const e=[],r=t.data,n=t;return n.data=In(r,e),n.attachments=e.length,{packet:n,buffers:e}}function In(t,e){if(!t)return t;if(es(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=In(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=In(t[n],e));return r}return t}function zu(t,e){return t.data=Cn(t.data,e),delete t.attachments,t}function Cn(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Cn(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Cn(t[r],e));return t}const xu=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Bu=5;var De;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(De||(De={}));class Hu{constructor(e){this.replacer=e}encode(e){return(e.type===De.EVENT||e.type===De.ACK)&&Ar(e)?this.encodeAsBinary({type:e.type===De.EVENT?De.BINARY_EVENT:De.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===De.BINARY_EVENT||e.type===De.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=Fu(e),n=this.encodeAsString(r.packet),s=r.buffers;return s.unshift(n),s}}function Os(t){return Object.prototype.toString.call(t)==="[object Object]"}class ts extends ot{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===De.BINARY_EVENT;n||r.type===De.BINARY_ACK?(r.type=n?De.EVENT:De.ACK,this.reconstructor=new Ku(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(es(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(De[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===De.BINARY_EVENT||n.type===De.BINARY_ACK){const l=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const a=e.substring(l,r);if(a!=Number(a)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(r+1)==="/"){const l=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(l,r)}else n.nsp="/";const s=e.charAt(r+1);if(s!==""&&Number(s)==s){const l=r+1;for(;++r;){const a=e.charAt(r);if(a==null||Number(a)!=a){--r;break}if(r===e.length)break}n.id=Number(e.substring(l,r+1))}if(e.charAt(++r)){const l=this.tryParse(e.substr(r));if(ts.isPayloadValid(n.type,l))n.data=l;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case De.CONNECT:return Os(r);case De.DISCONNECT:return r===void 0;case De.CONNECT_ERROR:return typeof r=="string"||Os(r);case De.EVENT:case De.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&xu.indexOf(r[0])===-1);case De.ACK:case De.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ku{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=zu(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gu=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ts,Encoder:Hu,get PacketType(){return De},protocol:Bu},Symbol.toStringTag,{value:"Module"}));function Rt(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const Wu=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Na extends ot{constructor(e,r,n){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=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Rt(e,"open",this.onopen.bind(this)),Rt(e,"packet",this.onpacket.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(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,...r){var n,s,l;if(Wu.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const a={type:De.EVENT,data:r};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const c=this.ids++,d=r.pop();this._registerAckCallback(c,d),a.id=c}const u=(s=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||s===void 0?void 0:s.writable,i=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!u||(i?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,r){var n;const s=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(s===void 0){this.acks[e]=r;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===e&&this.sendBuffer.splice(u,1);r.call(this,new Error("operation has timed out"))},s),a=(...u)=>{this.io.clearTimeoutFn(l),r.apply(this,u)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...r){return new Promise((n,s)=>{const l=(a,u)=>a?s(a):n(u);l.withError=!0,r.push(l),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...l)=>(this._queue[0],s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(s)):(this._queue.shift(),r&&r(null,...l)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.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:De.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,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case De.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 De.EVENT:case De.BINARY_EVENT:this.onevent(e);break;case De.ACK:case De.BINARY_ACK:this.onack(e);break;case De.DISCONNECT:this.ondisconnect();break;case De.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.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 r=this;let n=!1;return function(...s){n||(n=!0,r.packet({type:De.ACK,id:e,data:s}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,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:De.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 r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,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 r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function ar(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ar.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0};ar.prototype.reset=function(){this.attempts=0};ar.prototype.setMin=function(t){this.ms=t};ar.prototype.setMax=function(t){this.max=t};ar.prototype.setJitter=function(t){this.jitter=t};class An extends ot{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,rn(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new ar({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const s=r.parser||Gu;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.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 r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.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 Mu(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=Rt(r,"open",function(){n.onopen(),e&&e()}),l=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},a=Rt(r,"error",l);if(this._timeout!==!1){const u=this._timeout,i=this.setTimeoutFn(()=>{s(),l(new Error("timeout")),r.close()},u);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(s),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(Rt(e,"ping",this.onping.bind(this)),Rt(e,"data",this.ondata.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(e,"close",this.onclose.bind(this)),Rt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){tn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Na(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],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,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),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 r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ur={};function jr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=Du(t,e.path||"/socket.io"),n=r.source,s=r.id,l=r.path,a=ur[s]&&l in ur[s].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let i;return u?i=new An(n,e):(ur[s]||(ur[s]=new An(n,e)),i=ur[s]),r.query&&!e.query&&(e.query=r.queryKey),i.socket(r.path,e)}Object.assign(jr,{Manager:An,Socket:Na,io:jr,connect:jr});let Pt;const Ju=yr(!1),Qu={sockethub:{port:10550,host:"localhost",path:"/sockethub"},public:{protocol:"http",host:"localhost",port:10550,path:"/"}};async function Ta(){if(!Pt)throw new Error("Sockethub client is not initialized yet");await Pt.ready()}async function uf(t){return await Ta(),Pt.contextFor(t)}function ff(t){return{id:t.id,type:t.type,name:t.name??t.id}}async function df(t){return await Ta(),console.log("sending ->",t),new Promise((e,r)=>{Pt.socket.emit("message",hn("SEND",t),n=>{if(console.log("received <-",n),hn("RESP",n),n.totalItems&&n.items)for(const s of n.items.reverse())hn("RESP",s,!0);Us(n,!0),n.error?r(n.error):e(n)})})}function bn(t){return e=>{const r=t==="connect";Ju.update(()=>r),console.log(`sockethub ${t} [connected: ${r}]`,e||"")}}function Xu(t){console.log("handle incoming: ",t),Us(t,!1)}function Ns(t=Qu){Pt=new en(jr(`${t.public.protocol}://${t.public.host}:${t.public.port}`,{path:t.sockethub.path}),{initTimeoutMs:1e4}),Pt.socket.on("connect",bn("connect")),Pt.socket.on("error",bn("error")),Pt.socket.on("disconnect",bn("disconnect")),Pt.socket.on("message",Xu),Pt.socket.on("schemas",e=>{console.log("schemas received:",e),pn("schemas",e)}),Pt.socket.on("ready",e=>{console.log("client ready:",e),pn("ready",e)}),Pt.socket.on("init_error",e=>{console.error("client init error:",e),pn("init_error",e)})}typeof globalThis=="object"&&"window"in globalThis&&(console.log("connecting to sockethub"),fetch("/config.json").then(async t=>{const e=await t.json();Ns(e)}).catch(()=>{Ns()}));export{of as I,cf as L,ff as a,Ta as b,uf as c,Pt as d,Pn as e,Ju as f,Ls as g,bi as h,qs as i,df as s};
36
+ from .`,reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4452"}]},{scheme:"ipp",description:"Internet Printing Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3510"}]},{scheme:"ipps",description:"Internet Printing Protocol over HTTPS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7472"}]},{scheme:"iris",description:"Internet Registry Information Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3981"}]},{scheme:"iris.beep",description:"iris.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3983"}]},{scheme:"iris.lwz",description:"iris.lwz",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4993"}]},{scheme:"iris.xpc",description:"iris.xpc",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"iris.xpcs",description:"iris.xpcs",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4992"}]},{scheme:"jabber",description:"jabber",reference:[],template:"http://www.iana.org/assignments/uri-schemes/perm/jabber"},{scheme:"ldap",description:"Lightweight Directory Access Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4516"}]},{scheme:"mailto",description:"Electronic mail address",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6068"}]},{scheme:"mid",description:"message identifier",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2392"}]},{scheme:"msrp",description:"Message Session Relay Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"msrps",description:"Message Session Relay Protocol Secure",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4975"}]},{scheme:"mtqp",description:"Message Tracking Query Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3887"}]},{scheme:"mupdate",description:"Mailbox Update (MUPDATE) Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3656"}]},{scheme:"news",description:"USENET news",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"nfs",description:"network file system protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2224"}]},{scheme:"ni",description:"ni",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nih",description:"nih",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6920"}]},{scheme:"nntp",description:"USENET news using NNTP access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"opaquelocktoken",description:"opaquelocktokent",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4918"}]},{scheme:"pkcs11",description:"PKCS#11",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7512"}]},{scheme:"pop",description:"Post Office Protocol v3",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2384"}]},{scheme:"pres",description:"Presence",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3859"}]},{scheme:"reload",description:"reload",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6940"}]},{scheme:"rtsp",description:"Real-time Streaming Protocol (RTSP)",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtsps",description:"Real-time Streaming Protocol (RTSP) over TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"},{type:"draft",href:"http://www.iana.org/go/RFC-ietf-mmusic-rfc2326bis-40"}]},{scheme:"rtspu",description:"Real-time Streaming Protocol (RTSP) over unreliable datagram transport",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2326"}]},{scheme:"service",description:"service location",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2609"}]},{scheme:"session",description:"session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6787"}]},{scheme:"shttp",description:"Secure Hypertext Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2660"}]},{scheme:"sieve",description:"ManageSieve Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5804"}]},{scheme:"sip",description:"session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sips",description:"secure session initiation protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3261"}]},{scheme:"sms",description:"Short Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5724"}]},{scheme:"snmp",description:"Simple Network Management Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4088"}]},{scheme:"soap.beep",description:"soap.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"soap.beeps",description:"soap.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4227"}]},{scheme:"stun",description:"stun",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"stuns",description:"stuns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7064"}]},{scheme:"tag",description:"tag",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4151"}]},{scheme:"tel",description:"telephone",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"telnet",description:"Reference to interactive sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4248"}]},{scheme:"tftp",description:"Trivial File Transfer Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3617"}]},{scheme:"thismessage",description:"multipart/related relative reference resolution",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2557"}],template:"http://www.iana.org/assignments/uri-schemes/perm/thismessage"},{scheme:"tip",description:"Transaction Internet Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2371"}]},{scheme:"tn3270",description:"Interactive 3270 emulation sessions",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6270"}]},{scheme:"turn",description:"turn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"turns",description:"turns",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7065"}]},{scheme:"tv",description:"TV Broadcasts",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2838"}]},{scheme:"urn",description:"Uniform Resource Names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2141"},{type:"registry",href:"http://www.iana.org/assignments/urn-namespaces"}]},{scheme:"vemmi",description:"versatile multimedia interface",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2122"}]},{scheme:"vnc",description:"Remote Framebuffer Protocol",reference:[{type:"draft",href:"http://www.iana.org/go/RFC-warden-appsawg-vnc-scheme-10"}]},{scheme:"ws",description:"WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"wss",description:"Encrypted WebSocket connections",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6455"}]},{scheme:"xcon",description:"xcon",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xcon-userid",description:"xcon-userid",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6501"}]},{scheme:"xmlrpc.beep",description:"xmlrpc.beep",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmlrpc.beeps",description:"xmlrpc.beeps",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc3529"}]},{scheme:"xmpp",description:"Extensible Messaging and Presence Protocol",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5122"}]},{scheme:"z39.50r",description:"Z39.50 Retrieval",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]},{scheme:"z39.50s",description:"Z39.50 Session",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),Zc=B((t,e)=>{e.exports=[{scheme:"acr",description:"acr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/acr"},{scheme:"adiumxtra",description:"adiumxtra",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/adiumxtra"},{scheme:"afp",description:"afp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/afp"},{scheme:"afs",description:"Andrew File System global file names",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"}]},{scheme:"aim",description:"aim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aim"},{scheme:"appdata",description:"appdata",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/appdata"},{scheme:"apt",description:"apt",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/apt"},{scheme:"attachment",description:"attachment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/attachment"},{scheme:"aw",description:"aw",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/aw"},{scheme:"barion",description:"barion",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/barion"},{scheme:"beshare",description:"beshare",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/beshare"},{scheme:"bitcoin",description:"bitcoin",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bitcoin"},{scheme:"blob",description:"blob",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/blob"},{scheme:"bolo",description:"bolo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/bolo"},{scheme:"callto",description:"callto",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/callto"},{scheme:"chrome",description:"chrome",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome"},{scheme:"chrome-extension",description:"chrome-extension",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/chrome-extension"},{scheme:"com-eventbrite-attendee",description:"com-eventbrite-attendee",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/com-eventbrite-attendee"},{scheme:"content",description:"content",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/content"},{scheme:"cvs",description:"cvs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/cvs"},{scheme:"dis",description:"dis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dis"},{scheme:"dlna-playcontainer",description:"dlna-playcontainer",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playcontainer"},{scheme:"dlna-playsingle",description:"dlna-playsingle",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dlna-playsingle"},{scheme:"dntp",description:"dntp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/dntp"},{scheme:"dtn",description:"DTNRG research and development",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5050"}]},{scheme:"dvb",description:"dvb",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mcroberts-uri-dvb"}]},{scheme:"ed2k",description:"ed2k",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ed2k"},{scheme:"facetime",description:"facetime",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/facetime"},{scheme:"feed",description:"feed",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feed"},{scheme:"feedready",description:"feedready",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/feedready"},{scheme:"finger",description:"finger",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/finger"},{scheme:"fish",description:"fish",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/fish"},{scheme:"gg",description:"gg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gg"},{scheme:"git",description:"git",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/git"},{scheme:"gizmoproject",description:"gizmoproject",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gizmoproject"},{scheme:"gtalk",description:"gtalk",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/gtalk"},{scheme:"ham",description:"ham",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7046"}]},{scheme:"hcp",description:"hcp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/hcp"},{scheme:"icon",description:"icon",reference:[{type:"draft",href:"http://www.iana.org/go/draft-lafayette-icon-uri-scheme"}]},{scheme:"iotdisco",description:"iotdisco",reference:[{type:"uri",href:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco.pdf"}],template:"http://www.iana.org/assignments/uri-schemes/prov/iotdisco"},{scheme:"ipn",description:"ipn",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6260"}]},{scheme:"irc",description:"irc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc"},{scheme:"irc6",description:"irc6",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/irc6"},{scheme:"ircs",description:"ircs",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ircs"},{scheme:"isostore",description:"isostore",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/isostore"},{scheme:"itms",description:"itms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/itms"},{scheme:"jar",description:"jar",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/jar"},{scheme:"jms",description:"Java Message Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6167"}]},{scheme:"keyparc",description:"keyparc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/keyparc"},{scheme:"lastfm",description:"lastfm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/lastfm"},{scheme:"ldaps",description:"ldaps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ldaps"},{scheme:"magnet",description:"magnet",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/magnet"},{scheme:"maps",description:"maps",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/maps"},{scheme:"market",description:"market",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/market"},{scheme:"message",description:"message",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/message"},{scheme:"mms",description:"mms",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mms"},{scheme:"ms-access",description:"ms-access",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-access"},{scheme:"ms-drive-to",description:"ms-drive-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-drive-to"},{scheme:"ms-enrollment",description:"ms-enrollment",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-enrollment"},{scheme:"ms-excel",description:"ms-excel",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-excel"},{scheme:"ms-getoffice",description:"ms-getoffice",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-getoffice"},{scheme:"ms-help",description:"ms-help",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-help"},{scheme:"ms-infopath",description:"ms-infopath",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-infopath"},{scheme:"ms-media-stream-id",description:"ms-media-stream-id",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-media-stream-id"},{scheme:"ms-powerpoint",description:"ms-powerpoint",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-powerpoint"},{scheme:"ms-project",description:"ms-project",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-project"},{scheme:"ms-publisher",description:"ms-publisher",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-publisher"},{scheme:"ms-search-repair",description:"ms-search-repair",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-search-repair"},{scheme:"ms-secondary-screen-controller",description:"ms-secondary-screen-controller",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-controller"},{scheme:"ms-secondary-screen-setup",description:"ms-secondary-screen-setup",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-secondary-screen-setup"},{scheme:"ms-settings",description:"ms-settings",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings"},{scheme:"ms-settings-airplanemode",description:"ms-settings-airplanemode",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-airplanemode"},{scheme:"ms-settings-bluetooth",description:"ms-settings-bluetooth",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-bluetooth"},{scheme:"ms-settings-camera",description:"ms-settings-camera",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-camera"},{scheme:"ms-settings-cellular",description:"ms-settings-cellular",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cellular"},{scheme:"ms-settings-cloudstorage",description:"ms-settings-cloudstorage",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-cloudstorage"},{scheme:"ms-settings-connectabledevices",description:"ms-settings-connectabledevices",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-connectabledevices"},{scheme:"ms-settings-displays-topology",description:"ms-settings-displays-topology",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-displays-topology"},{scheme:"ms-settings-emailandaccounts",description:"ms-settings-emailandaccounts",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-emailandaccounts"},{scheme:"ms-settings-language",description:"ms-settings-language",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-language"},{scheme:"ms-settings-location",description:"ms-settings-location",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-location"},{scheme:"ms-settings-lock",description:"ms-settings-lock",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-lock"},{scheme:"ms-settings-nfctransactions",description:"ms-settings-nfctransactions",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-nfctransactions"},{scheme:"ms-settings-notifications",description:"ms-settings-notifications",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-notifications"},{scheme:"ms-settings-power",description:"ms-settings-power",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-power"},{scheme:"ms-settings-privacy",description:"ms-settings-privacy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-privacy"},{scheme:"ms-settings-proximity",description:"ms-settings-proximity",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-proximity"},{scheme:"ms-settings-screenrotation",description:"ms-settings-screenrotation",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-screenrotation"},{scheme:"ms-settings-wifi",description:"ms-settings-wifi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-wifi"},{scheme:"ms-settings-workplace",description:"ms-settings-workplace",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-settings-workplace"},{scheme:"ms-spd",description:"ms-spd",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-spd"},{scheme:"ms-transit-to",description:"ms-transit-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-transit-to"},{scheme:"ms-visio",description:"ms-visio",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-visio"},{scheme:"ms-walk-to",description:"ms-walk-to",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-walk-to"},{scheme:"ms-word",description:"ms-word",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ms-word"},{scheme:"msnim",description:"msnim",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/msnim"},{scheme:"mumble",description:"mumble",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mumble"},{scheme:"mvn",description:"mvn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/mvn"},{scheme:"notes",description:"notes",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/notes"},{scheme:"oid",description:"oid",reference:[{type:"draft",href:"http://www.iana.org/go/draft-larmouth-oid-iri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/oid"},{scheme:"palm",description:"palm",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/palm"},{scheme:"paparazzi",description:"paparazzi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/paparazzi"},{scheme:"platform",description:"platform",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/platform"},{scheme:"proxy",description:"proxy",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/proxy"},{scheme:"psyc",description:"psyc",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/psyc"},{scheme:"query",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/query"},{scheme:"redis",description:"redis",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/redis"},{scheme:"rediss",description:"rediss",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rediss"},{scheme:"res",description:"res",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/res"},{scheme:"resource",description:"resource",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/resource"},{scheme:"rmi",description:"rmi",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rmi"},{scheme:"rsync",description:"rsync",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5781"}]},{scheme:"rtmfp",description:"rtmfp",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc7425"}],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmfp"},{scheme:"rtmp",description:"rtmp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/rtmp"},{scheme:"secondlife",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/secondlife"},{scheme:"sftp",description:"query",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sftp"},{scheme:"sgn",description:"sgn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/sgn"},{scheme:"skype",description:"skype",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/skype"},{scheme:"smb",description:"smb",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/smb"},{scheme:"smtp",description:"smtp",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/smtp"},{scheme:"soldat",description:"soldat",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/soldat"},{scheme:"spotify",description:"spotify",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/spotify"},{scheme:"ssh",description:"ssh",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ssh"},{scheme:"steam",description:"steam",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/steam"},{scheme:"submit",description:"submit",reference:[{type:"draft",href:"http://www.iana.org/go/draft-melnikov-smime-msa-to-mda"}],template:"http://www.iana.org/assignments/uri-schemes/prov/submit"},{scheme:"svn",description:"svn",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/svn"},{scheme:"teamspeak",description:"teamspeak",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teamspeak"},{scheme:"teliaeid",description:"teliaeid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/teliaeid"},{scheme:"things",description:"things",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/things"},{scheme:"tool",description:"tool",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/tool"},{scheme:"udp",description:"udp",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/udp"},{scheme:"unreal",description:"unreal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/unreal"},{scheme:"ut2004",description:"ut2004",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ut2004"},{scheme:"v-event",description:"v-event",reference:[{type:"draft",href:"http://www.iana.org/go/draft-menderico-v-event-uri"}],template:"http://www.iana.org/assignments/uri-schemes/prov/v-event"},{scheme:"ventrilo",description:"ventrilo",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ventrilo"},{scheme:"view-source",description:"view-source",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/view-source"},{scheme:"webcal",description:"webcal",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/webcal"},{scheme:"wpid",description:"wpid",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wpid"},{scheme:"wtai",description:"wtai",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wtai"},{scheme:"wyciwyg",description:"wyciwyg",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/wyciwyg"},{scheme:"xfire",description:"xfire",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xfire"},{scheme:"xri",description:"xri",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/xri"},{scheme:"ymsgr",description:"ymsgr",reference:[],template:"http://www.iana.org/assignments/uri-schemes/prov/ymsgr"}]}),el=B((t,e)=>{e.exports=[{scheme:"fax",description:"fax",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"filesystem",description:"filesystem",reference:[],template:"http://www.iana.org/assignments/uri-schemes/historic/filesystem"},{scheme:"mailserver",description:"Access to data available from mail servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc6196"}]},{scheme:"modem",description:"modem",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc2806"},{type:"rfc",href:"http://www.iana.org/go/rfc3966"}]},{scheme:"pack",description:"pack",reference:[{type:"draft",href:"http://www.iana.org/go/draft-shur-pack-uri-scheme"}],template:"http://www.iana.org/assignments/uri-schemes/historic/pack"},{scheme:"prospero",description:"Prospero Directory Service",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4157"}]},{scheme:"snews",description:"NNTP over SSL/TLS",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc5538"}]},{scheme:"videotex",description:"videotex",reference:[{type:"draft",href:"http://www.iana.org/go/draft-mavrakis-videotex-url-spec"},{type:"rfc",href:"http://www.iana.org/go/rfc2122"},{type:"rfc",href:"http://www.iana.org/go/rfc3986"}],template:"http://www.iana.org/assignments/uri-schemes/historic/videotex"},{scheme:"wais",description:"Wide Area Information Servers",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc4156"}]},{scheme:"z39.50",description:"Z39.50 information access",reference:[{type:"rfc",href:"http://www.iana.org/go/rfc1738"},{type:"rfc",href:"http://www.iana.org/go/rfc2056"}]}]}),tl=B((t,e)=>{e.exports=[{scheme:"android-app"},{scheme:"webpack"},{scheme:"s3",description:"Amazon Web Services S3 bucket"},{scheme:"gs",description:"Google Cloud Storage"},{scheme:"mqtt",description:"Message Queuing Telemetry Transport Protocol"},{scheme:"modbus+tcp",description:"Modbus over TCP"}]}),sa=B((t,e)=>{var r=Xc(),n={permanent:Yc(),provosional:Zc(),historical:el()},s={};Object.keys(n).forEach(function(l){n[l].forEach(function(a){s[a.scheme]=r(a,{type:l})})}),n.unofficial=tl().filter(function(l){return!s[l.scheme]}),n.unofficial.forEach(function(l){s[l.scheme]=r(l,{type:"unofficial"})}),e.exports=r(n,{allByName:s})}),rl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return!!(u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&s.allByName[u.scheme])}}),nl=B((t,e)=>{e.exports=/^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?W)?(\d+(?:\.\d+)?D)?(T(?=\d)(\d+(?:\.\d+)?H)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?S)?)?$/}),sl=B((t,e)=>{var{parse:r}=Kn();e.exports=n=>{try{return r(n),!0}catch{return!1}}}),aa={};oo(aa,{default:()=>la});function ia(t){return this[t]}function al(t,e){this[t]=ll.bind(null,e)}var oa,ca,vr,Gn,Wn,il=(t,e,r)=>{var n=Gn(e);for(let s of n)!Wn.call(t,s)&&s!=="default"&&vr(t,s,{get:ia.bind(e,s),enumerable:!0})},ol,ys=(t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var s=ol??(ol=new WeakMap),l=s.get(t);if(l)return l}r=t!=null?oa(ca(t)):{};let a=e||!t||!t.__esModule?vr(r,"default",{value:t,enumerable:!0}):r;for(let u of Gn(t))Wn.call(a,u)||vr(a,u,{get:ia.bind(t,u),enumerable:!0});return n&&s.set(t,a),a},cl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ll=t=>t,ul=(t,e)=>{for(var r in e)vr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:al.bind(e,r)})},mn,gn,vn,la,fl=co(()=>{oa=Object.create,{getPrototypeOf:ca,defineProperty:vr,getOwnPropertyNames:Gn}=Object,Wn=Object.prototype.hasOwnProperty,mn=cl((t,e)=>{var r=/^xn--/,n=/[^\0-\x7F]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},a=Math.floor,u=String.fromCharCode;function i($){throw RangeError(l[$])}function h($,y){let f=[],S=$.length;for(;S--;)f[S]=y($[S]);return f}function c($,y){let f=$.split("@"),S="";f.length>1&&(S=f[0]+"@",$=f[1]),$=$.replace(s,".");let O=$.split("."),j=h(O,y).join(".");return S+j}function d($){let y=[],f=0,S=$.length;for(;f<S;){let O=$.charCodeAt(f++);if(O>=55296&&O<=56319&&f<S){let j=$.charCodeAt(f++);(j&64512)==56320?y.push(((O&1023)<<10)+(j&1023)+65536):(y.push(O),f--)}else y.push(O)}return y}var w=$=>String.fromCodePoint(...$),P=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:36},b=function($,y){return $+22+75*($<26)-((y!=0)<<5)},E=function($,y,f){let S=0;for($=f?a($/700):$>>1,$+=a($/y);$>455;S+=36)$=a($/35);return a(S+36*$/($+38))},m=function($){let y=[],f=$.length,S=0,O=128,j=72,F=$.lastIndexOf("-");F<0&&(F=0);for(let U=0;U<F;++U)$.charCodeAt(U)>=128&&i("not-basic"),y.push($.charCodeAt(U));for(let U=F>0?F+1:0;U<f;){let X=S;for(let ee=1,fe=36;;fe+=36){U>=f&&i("invalid-input");let we=P($.charCodeAt(U++));we>=36&&i("invalid-input"),we>a((2147483647-S)/ee)&&i("overflow"),S+=we*ee;let Oe=fe<=j?1:fe>=j+26?26:fe-j;if(we<Oe)break;let se=36-Oe;ee>a(2147483647/se)&&i("overflow"),ee*=se}let G=y.length+1;j=E(S-X,G,X==0),a(S/G)>2147483647-O&&i("overflow"),O+=a(S/G),S%=G,y.splice(S++,0,O)}return String.fromCodePoint(...y)},o=function($){let y=[];$=d($);let f=$.length,S=128,O=0,j=72;for(let X of $)X<128&&y.push(u(X));let F=y.length,U=F;for(F&&y.push("-");U<f;){let X=2147483647;for(let ee of $)ee>=S&&ee<X&&(X=ee);let G=U+1;X-S>a((2147483647-O)/G)&&i("overflow"),O+=(X-S)*G,S=X;for(let ee of $)if(ee<S&&++O>2147483647&&i("overflow"),ee===S){let fe=O;for(let we=36;;we+=36){let Oe=we<=j?1:we>=j+26?26:we-j;if(fe<Oe)break;let se=fe-Oe,x=36-Oe;y.push(u(b(Oe+se%x,0))),fe=a(se/x)}y.push(u(b(fe,0))),j=E(O,G,U===F),O=0,++U}++O,++S}return y.join("")},_=function($){return c($,function(y){return r.test(y)?m(y.slice(4).toLowerCase()):y})},p=function($){return c($,function(y){return n.test(y)?"xn--"+o(y):y})},v={version:"2.3.1",ucs2:{decode:d,encode:w},decode:m,encode:o,toASCII:p,toUnicode:_};e.exports=v}),gn={},ul(gn,{default:()=>vn.default}),il(gn,ys(mn(),1)),vn=ys(mn(),1),la=vn.default}),dl=B((t,e)=>{var{toASCII:r}=(fl(),so(aa)),n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;e.exports=s=>{const l=r(s);return l.replace(/\.$/,"").length<=253&&n.test(l)}}),hl=B((t,e)=>{var{parse:r}=Bn(),{addressParser:n}=Kn(),s=sa();function l(a){try{return n(a),!0}catch{return!1}}e.exports=a=>{const u=r(a);return u.scheme==="mailto"&&u.to.every(l)||u.reference==="absolute"&&u.path!==void 0&&s.allByName[u.scheme]?!0:u.scheme&&!s.allByName[u.scheme]?!1:u.path!==void 0&&(u.reference==="relative"||u.reference==="same-document"||u.reference==="uri")}}),pl=B((t,e)=>{t.iri=rl(),t.duration=nl(),t["idn-email"]=sl(),t["idn-hostname"]=dl(),t["iri-reference"]=hl()}),ml=B((t,e)=>{var r=pl();e.exports=(n,s={})=>{const l=Object.keys(r);let a=l;if(s.formats){if(!Array.isArray(s.formats))throw new Error("options.formats must be an array");a=s.formats}return l.filter(u=>a.includes(u)).forEach(u=>{n.addFormat(u,r[u])}),n}}),gl=B((t,e)=>{var r=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function l(h,c,d){this.fn=h,this.context=c,this.once=d||!1}function a(h,c,d,w,P){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new l(d,w||h,P),E=n?n+c:c;return h._events[E]?h._events[E].fn?h._events[E]=[h._events[E],b]:h._events[E].push(b):(h._events[E]=b,h._eventsCount++),h}function u(h,c){--h._eventsCount===0?h._events=new s:delete h._events[c]}function i(){this._events=new s,this._eventsCount=0}i.prototype.eventNames=function(){var c=[],d,w;if(this._eventsCount===0)return c;for(w in d=this._events)r.call(d,w)&&c.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},i.prototype.listeners=function(c){var d=n?n+c:c,w=this._events[d];if(!w)return[];if(w.fn)return[w.fn];for(var P=0,b=w.length,E=new Array(b);P<b;P++)E[P]=w[P].fn;return E},i.prototype.listenerCount=function(c){var d=n?n+c:c,w=this._events[d];return w?w.fn?1:w.length:0},i.prototype.emit=function(c,d,w,P,b,E){var m=n?n+c:c;if(!this._events[m])return!1;var o=this._events[m],_=arguments.length,p,v;if(o.fn){switch(o.once&&this.removeListener(c,o.fn,void 0,!0),_){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,d),!0;case 3:return o.fn.call(o.context,d,w),!0;case 4:return o.fn.call(o.context,d,w,P),!0;case 5:return o.fn.call(o.context,d,w,P,b),!0;case 6:return o.fn.call(o.context,d,w,P,b,E),!0}for(v=1,p=new Array(_-1);v<_;v++)p[v-1]=arguments[v];o.fn.apply(o.context,p)}else{var $=o.length,y;for(v=0;v<$;v++)switch(o[v].once&&this.removeListener(c,o[v].fn,void 0,!0),_){case 1:o[v].fn.call(o[v].context);break;case 2:o[v].fn.call(o[v].context,d);break;case 3:o[v].fn.call(o[v].context,d,w);break;case 4:o[v].fn.call(o[v].context,d,w,P);break;default:if(!p)for(y=1,p=new Array(_-1);y<_;y++)p[y-1]=arguments[y];o[v].fn.apply(o[v].context,p)}}return!0},i.prototype.on=function(c,d,w){return a(this,c,d,w,!1)},i.prototype.once=function(c,d,w){return a(this,c,d,w,!0)},i.prototype.removeListener=function(c,d,w,P){var b=n?n+c:c;if(!this._events[b])return this;if(!d)return u(this,b),this;var E=this._events[b];if(E.fn)E.fn===d&&(!P||E.once)&&(!w||E.context===w)&&u(this,b);else{for(var m=0,o=[],_=E.length;m<_;m++)(E[m].fn!==d||P&&!E[m].once||w&&E[m].context!==w)&&o.push(E[m]);o.length?this._events[b]=o.length===1?o[0]:o:u(this,b)}return this},i.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&u(this,d)):(this._events=new s,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,typeof e<"u"&&(e.exports=i)}),vl="https://www.w3.org/ns/activitystreams",yl="https://sockethub.org/ns/context/v1.jsonld",_l="error",wl="https://sockethub.org/ns/context/platform/error/v1.jsonld",$l="sockethub:internal",bl="https://sockethub.org/ns/context/platform/sockethub:internal/v1.jsonld",Jn=new Map,ua=new Map,fa=new Map;function El(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Sl(t){return El(t["@context"])}function da(t,e,r,n){Jn.set(e,t),ua.set(e,r),fa.set(e,n)}function Qn(t){const r=Sl(t).filter(n=>Jn.has(n));return r.length!==1?null:r[0]}function Pl(t){return Jn.get(t)}function kl(t){return ua.get(t)}function Ol(t){return fa.get(t)}var ha={feed:{required:["id","type"],additionalProperties:!0,properties:{type:{enum:["feed"]},id:{type:"string",format:"iri"},name:{type:"string"},description:{type:"string"},author:{type:"string"},favicon:{type:"string"}}},person:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["person"]},name:{type:"string"}}},room:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["room"]},name:{type:"string"}}},service:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["service"]},name:{type:"string"}}},platform:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string"},type:{enum:["platform"]},name:{type:"string"}}},website:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string",format:"iri"},type:{enum:["website"]},name:{type:"string"}}},address:{required:["type"],additionalProperties:!1,properties:{type:{enum:["address"]}}},calendar:{required:["id","type"],additionalProperties:!0,properties:{id:{type:"string",format:"iri"},type:{enum:["calendar"]},name:{type:"string"},components:{type:"array",items:{enum:["event","task"]}}}}},Nl=Object.keys(ha),pa=["person","room","service","feed","website","platform"],ma=["person","room","service","feed","website","platform","address","calendar"],Tl=pa.map(t=>({$ref:`#/definitions/type/${t}`})),Rl=ma.map(t=>({$ref:`#/definitions/type/${t}`})),Il={type:"array",minItems:3,maxItems:3,items:{type:"string"},allOf:[{contains:{const:vl}},{contains:{const:yl}}]},Cl={type:"string"},Al={$id:"https://sockethub.org/schemas/v/activity-stream.json",description:"Schema for Sockethub Activity Streams",type:"object",required:["@context","type","actor"],additionalProperties:!1,properties:{"@context":Il,id:{type:"string"},type:Cl,actor:{type:"object",oneOf:Tl},target:{type:"object",oneOf:Rl},object:{type:"object"},published:{type:"string",format:"date-time"}},definitions:{type:ha}},jl={version:"3.0.0-alpha.19"};function Ml(t,e){return t.replace("/v/",`/${e}/`)}var Dl={$id:"https://sockethub.org/schemas/v/sockethub-config.json"};Ml(Dl.$id,jl.version);var ql=Hr(tc()),Ll=Hr(Wc()),Ul=Hr(ml());function Vl(t){let e=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return t.keyword==="additionalProperties"?e+=`: ${t.params.additionalProperty}`:t.keyword==="enum"&&(e+=`: ${t.params.allowedValues.join(", ")}`),e}function dr(t){const e=[];t!=null&&t.type&&e.push(t.type);const r=t;for(const n in r){const s=r[n];s&&typeof s=="object"&&"type"in s&&e.push(...dr(s))}return e}function Fl(t){const e=t.schemaPath.match(/#\/\w+\/\w+\/([\w-]+)\//);return e?e[1]:void 0}function zl(t){const e=t.instancePath.match(/\/(\w+)/);return e?e[1]:void 0}function xl(t,e){const r=Fl(t),n=zl(t);if(!n)return-1;const s=e[n];return!s||!r||!s.includes(r)?-1:t.instancePath.split("/").length}function Bl(t){if(!Array.isArray(t["@context"]))return{actor:[],target:[],object:dr(t)};const e=t;return{actor:dr(e.actor),target:dr(e.target),object:e.object?dr(e.object):[]}}function Hl(t,e,r){const n=Bl(t);let s=0,l=-1;for(let a=0;a<e.length;a++){const u=xl(e[a],n);u>l&&(l=u,s=a)}return l>=0?Vl(e[s]):Gl(e[e.length-1],r)}function Kl(t,e){if(!(e!=null&&e.excludeTypes)||e.excludeTypes.length===0)return t;const r=new Set(e.excludeTypes);return t.filter(n=>!r.has(n))}function Gl(t,e){let r;if(t.keyword==="oneOf"){const n=t.instancePath.split("/")[1],s=n==="actor"?pa:n==="target"?ma:Nl,l=Kl(s,e),a=l.length>0?l:s;r=`${t.instancePath}: ${t.message}: ${a.join(", ")}`}else r=`${t.instancePath?t.instancePath:"activity stream"}: ${t.message}`;return"additionalProperty"in t.params&&(r+=`: ${t.params.additionalProperty}`),r}var Mt=new ql.default({strictTypes:!1,allErrors:!0});Ll.default(Mt);Ul.default(Mt);var Dt="https://sockethub.org/schemas/v0",On={},Wl={},_s=!1;On[`${Dt}/activity-stream`]=Al;for(const t in On)Mt.addSchema(On[t],t);function ws(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`);const r=`${Dt}/context/${t}/messages`;Mt.getSchema(r)||Mt.addSchema({},r);const n=`${Dt}/context/${t}/credentials`;Mt.getSchema(n)||Mt.addSchema({},n)}function Jl(){_s||(ws(_l,wl),ws($l,bl),_s=!0)}Jl();function Br(t,e){const r=Mt.getSchema(t);if(!r)return`schema ${t} not found`;if(!r(e)){let s=Hl(e,r.errors,Wl);if(Array.isArray(e["@context"])){const l=Qn(e);if(l){const a=Pl(l);a&&(s=`[${a}] ${s}`)}}return s}return""}function Ql(t){const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"activity streams must have exactly one registered platform context URL in @context";const n=kl(r);return n?Br(n,t):`platform context URL ${r} does not have a registered message schema`}function Xl(t){if(!Array.isArray(t["@context"]))return"credential activity streams must have an @context set";if(t.type!=="credentials")return"credential activity streams must have credentials set as type";const e=Br(`${Dt}/activity-stream`,t);if(e)return e;const r=Qn(t);if(!r)return"credential activity streams must have exactly one registered platform context URL in @context";const n=Ol(r);return n?Br(n,t):`platform context URL ${r} does not have a registered credentials schema`}function $s(t,e){const r=`${Dt}/context/${e}`;Mt.getSchema(r)||Mt.addSchema(t,r)}function Yl(t,e){da(t,e,`${Dt}/context/${t}/messages`,`${Dt}/context/${t}/credentials`)}var bs={actor:"id",target:"id",object:"content"};function Zl(t,e){return typeof t=="string"?{[e]:t}:Array.isArray(t)?t.map(r=>typeof r=="string"?{id:r}:r):t}function yn(t){const e={...t};for(const r of Object.keys(bs))r in e&&(e[r]=Zl(e[r],bs[r]));return e}var eu=Hr(gl()),tu=eu.default;class en{constructor(e,r={}){nt(this,"events",{credentials:new Map,connect:new Map,join:new Map});nt(this,"_socket");nt(this,"socket");nt(this,"debug",!0);nt(this,"options");nt(this,"platformRegistry",new Map);nt(this,"asContextUrl");nt(this,"sockethubContextUrl");nt(this,"sockethubVersion");nt(this,"initState","idle");nt(this,"hasReadyOnce",!1);nt(this,"initCycle");nt(this,"initTokenCounter",0);nt(this,"initTimeoutTimer");nt(this,"waitingWarningTimer");nt(this,"waitingWarningIntervalMs",1e4);nt(this,"readyWaiters",[]);nt(this,"outboundQueue",[]);nt(this,"outboundSequence",0);nt(this,"registryFingerprint");nt(this,"latestReadyInfo");if(!e)throw new Error("SockethubClient requires a socket.io instance");this._socket=e,this.options={initTimeoutMs:r.initTimeoutMs??5e3,maxQueuedOutbound:r.maxQueuedOutbound??1e3,maxQueuedAgeMs:r.maxQueuedAgeMs??3e4},this.socket=this.createPublicEmitter(),this.registerSocketIOHandlers(),this._socket.connected&&(this.socket.connected=!0,this.socket.id=this._socket.id,this.socket._emit("connect"),this.startInitialization("initial-connect",!0))}clearCredentials(){this.events.credentials.clear()}getRegisteredPlatforms(){return Array.from(this.platformRegistry.values()).map(e=>({...e,types:[...e.types],schemas:{...e.schemas}}))}isSchemasReady(){return this.isReady()}isReady(){return this.initState==="ready"}getInitState(){return this.initState}getRegisteredBaseContexts(){if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");return{as:this.asContextUrl,sockethub:this.sockethubContextUrl}}getPlatformSchema(e,r="messages"){var s,l;const n=e==null?void 0:e.trim();if(n)return(l=(s=this.platformRegistry.get(n))==null?void 0:s.schemas)==null?void 0:l[r]}async waitForSchemas(e=2e3){return await this.ready(e),this.buildPlatformRegistryPayload()}ready(e=this.options.initTimeoutMs){return this.isReady()&&this.latestReadyInfo?Promise.resolve(this.latestReadyInfo):new Promise((r,n)=>{const s={resolve:r,reject:n};e>0&&(s.timer=setTimeout(()=>{this.readyWaiters=this.readyWaiters.filter(l=>l!==s),n(new Error(`SockethubClient ready() timed out after ${e}ms`))},e)),this.readyWaiters.push(s),this.socket.connected&&this.initState==="idle"&&this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)})}validateActivity(e){return e.type==="credentials"?Xl(e):Ql(e)}contextFor(e){if(typeof e!="string"||e.trim().length===0)throw new Error("SockethubClient.contextFor(platform) requires a non-empty platform string");if(!this.asContextUrl||!this.sockethubContextUrl)throw new Error("Schema registry not loaded yet. Wait for client ready state after connect.");const r=e.trim(),n=this.platformRegistry.get(r);if(!n){const s=Array.from(this.platformRegistry.keys()).sort();throw new Error(`unknown platform '${r}'. Registered platforms: ${s.join(", ")}`)}return[this.asContextUrl,this.sockethubContextUrl,n.contextUrl]}createPublicEmitter(){const e=new tu;return e._emit=e.emit,e.emit=(r,n,s)=>{this.handlePublicEmit(r,n,s)},e.connected=!1,e.disconnect=()=>{this._socket.disconnect()},e.connect=()=>{this._socket.connect()},e}requestSchemaRegistry(){"io"in this._socket&&this._socket.emit("schemas",this.registryFingerprint,r=>{this.handleSchemasPayload(r)})}applyPlatformRegistry(e){var a,u,i,h;if(!e||typeof e!="object")return;const r=e,n=(a=r.contexts)==null?void 0:a.as,s=(u=r.contexts)==null?void 0:u.sockethub;if(typeof n!="string"||typeof s!="string"||!Array.isArray(r.platforms))return;this.sockethubVersion=typeof r.version=="string"?r.version:"unknown",this.asContextUrl=n,this.sockethubContextUrl=s,this.platformRegistry.clear();for(const c of r.platforms)if(!(!c||typeof c!="object"||typeof c.id!="string"||typeof c.version!="string"||typeof c.contextUrl!="string")){this.platformRegistry.set(c.id,{...c,version:c.version,types:Array.isArray(c.types)?c.types:[],schemas:c.schemas||{}}),Yl(c.id,c.contextUrl);try{const d=(i=c.schemas)==null?void 0:i.credentials;d&&typeof d=="object"&&!Array.isArray(d)&&$s(d,`${c.id}/credentials`);const w=(h=c.schemas)==null?void 0:h.messages;w&&typeof w=="object"&&!Array.isArray(w)&&$s(w,`${c.id}/messages`)}catch(d){const w=d instanceof Error?d.message:String(d);console.warn(`[SockethubClient] Failed to register schemas for platform ${c.id}: ${w}`)}}const l=this.buildPlatformRegistryPayload();return this.registryFingerprint=typeof r.fingerprint=="string"?r.fingerprint:void 0,this.socket._emit("schemas",l),l}eventCredentials(e){if(e.object&&e.object.type==="credentials"){const r=e.actor.id||e.actor;this.events.credentials.set(r,e)}}eventMessage(e){if(!this._socket.connected)return;const r=en.getKey(e);e.type==="join"||e.type==="connect"?this.events[e.type].set(r,e):e.type==="leave"?this.events.join.delete(r):e.type==="disconnect"&&this.events.connect.delete(r)}static getKey(e){var s;const r=((s=e.actor)==null?void 0:s.id)||e.actor;if(!r)throw new Error(`actor property not present for message type: ${e==null?void 0:e.type}`);const n=e.target?e.target.id||e.target:"";return`${r}-${n}`}buildPlatformRegistryPayload(){return{version:this.sockethubVersion,contexts:this.asContextUrl&&this.sockethubContextUrl?{as:this.asContextUrl,sockethub:this.sockethubContextUrl}:void 0,platforms:this.getRegisteredPlatforms()}}buildReadyInfo(e){if(!(!this.sockethubVersion||!this.asContextUrl||!this.sockethubContextUrl))return{state:"ready",reason:e,sockethubVersion:this.sockethubVersion,contexts:{as:this.asContextUrl,sockethub:this.sockethubContextUrl},platforms:this.getRegisteredPlatforms().map(r=>({id:r.id,version:r.version,contextUrl:r.contextUrl,contextVersion:r.contextVersion,schemaVersion:r.schemaVersion,types:[...r.types]}))}}resolveReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.resolve(e)}rejectReadyWaiters(e){const r=this.readyWaiters;this.readyWaiters=[];for(const n of r)n.timer&&clearTimeout(n.timer),n.reject(e)}emitInitError(e,r,n){this.socket._emit("init_error",{error:e,phase:r,retrying:n})}emitClientError(e,r,n){if(typeof r=="function"){r({error:n});return}this.socket._emit("client_error",{event:e,error:n})}clearInitTimers(){this.initTimeoutTimer&&(clearTimeout(this.initTimeoutTimer),this.initTimeoutTimer=void 0),this.waitingWarningTimer&&(clearInterval(this.waitingWarningTimer),this.waitingWarningTimer=void 0)}startWaitingWarnings(){this.waitingWarningTimer||(this.waitingWarningTimer=setInterval(()=>{if(this.isReady()||this.initState==="closed"){this.clearInitTimers();return}const e=this.outboundQueue.length,r=this.outboundQueue[0],n=r?((Date.now()-r.enqueuedAt)/1e3).toFixed(1):"0.0";console.warn(`[SockethubClient] Still waiting for schemas; queued outbound messages: ${e}; oldest queued age: ${n}s.`)},this.waitingWarningIntervalMs))}startInitialization(e,r){if(!this.socket.connected||this.initState==="closed")return;const n=++this.initTokenCounter;this.initCycle={token:n,reason:e,startedAt:Date.now(),replayOnReady:r,timedOut:!1},this.initState="initializing",this.clearInitTimers(),this.initTimeoutTimer=setTimeout(()=>{if(!this.initCycle||this.initCycle.token!==n)return;this.initCycle.timedOut=!0,this.initState="init_error";const s=`Initialization timed out after ${this.options.initTimeoutMs}ms waiting for schemas`;console.warn(`[SockethubClient] ${s}; queued outbound messages: ${this.outboundQueue.length}. Waiting for schemas event from server.`),this.emitInitError(s,"timeout",!1),this.startWaitingWarnings()},this.options.initTimeoutMs);try{this.requestSchemaRegistry()}catch(s){this.initState="init_error";const l=s instanceof Error?s.message:String(s);this.emitInitError(l,"schemas-request",!1),this.startWaitingWarnings()}}markReady(e){const r=this.initCycle,n=!!(r!=null&&r.replayOnReady);this.initCycle=void 0,this.clearInitTimers(),this.initState="ready",this.hasReadyOnce=!0;const s=this.buildReadyInfo(e);if(!s){const l=new Error("Failed to build ready payload");this.initState="init_error",this.emitInitError(l.message,"schemas-apply",!0),this.rejectReadyWaiters(l);return}this.socket._emit("ready",s),this.latestReadyInfo=s,this.resolveReadyWaiters(s),n&&(this.replay("credentials",this.events.credentials),this.replay("message",this.events.connect),this.replay("message",this.events.join)),this.flushOutboundQueue()}handleSchemasPayload(e){if(!e||typeof e!="object")return;if(e.unchanged===!0&&typeof this.registryFingerprint=="string"&&this.platformRegistry.size>0){this.initCycle?this.markReady(this.initCycle.reason):this.initState!=="ready"&&this.markReady("schemas-update");return}const r=e.fingerprint;if(this.initState==="ready"&&!this.initCycle&&r&&r===this.registryFingerprint)return;if(this.initState==="ready"&&!this.initCycle&&(this.initState="initializing"),!this.applyPlatformRegistry(e)){this.initState="init_error",this.emitInitError("Received invalid schemas payload from server","schemas-apply",!0),this.startWaitingWarnings();return}if(this.initCycle){this.markReady(this.initCycle.reason);return}this.markReady("schemas-update")}handlePublicEmit(e,r,n){const s={event:e,content:r,callback:n,enqueuedAt:Date.now(),sequence:this.outboundSequence++};if(!this.isReady()){this.enqueueOutbound(s);return}this.sendOutbound(s)}enqueueOutbound(e){if(this.outboundQueue.push(e),this.outboundQueue.length<=this.options.maxQueuedOutbound)return;const r=this.outboundQueue.shift();r&&this.emitClientError(r.event,r.callback,"SockethubClient queue overflow before ready")}flushOutboundQueue(){if(!this.isReady()||this.outboundQueue.length===0)return;const e=Date.now(),r=this.outboundQueue.sort((n,s)=>n.sequence-s.sequence);this.outboundQueue=[];for(const n of r){if(e-n.enqueuedAt>this.options.maxQueuedAgeMs){this.emitClientError(n.event,n.callback,`SockethubClient queued message expired after ${this.options.maxQueuedAgeMs}ms before initialization`);continue}this.sendOutbound(n)}}sendOutbound(e){let r=e.content;try{if(e.event==="credentials"||e.event==="message"){if(r=yn(e.content),r&&typeof r=="object"){const n=r;e.event==="credentials"&&!n.type&&(n.type="credentials"),n.actor&&typeof n.actor=="object"&&!n.actor.type&&(n.actor.type="person")}if(this.platformRegistry.size>0){const n=this.validateActivity(r);if(n){this.emitClientError(e.event,e.callback,`SockethubClient validation failed: ${n}`);return}}}e.event==="credentials"?this.eventCredentials(r):e.event==="message"&&this.eventMessage(r),this._socket.emit(e.event,r,e.callback)}catch(n){const s=n instanceof Error?n.message:String(n);this.emitClientError(e.event,e.callback,s)}}log(e,r){this.debug&&console.log(e,r)}registerSocketIOHandlers(){this._socket.on("connect",()=>{this.socket.id=this._socket.id,this.socket.connected=!0,this.socket._emit("connect"),this.startInitialization(this.hasReadyOnce?"reconnect":"initial-connect",!0)}),this._socket.on("connect_error",e=>{this.socket._emit("connect_error",e)}),this._socket.on("disconnect",e=>{this.socket.connected=!1,this.initState!=="closed"&&(this.initState="idle"),this.clearInitTimers(),this.socket._emit("disconnect",e)}),this._socket.on("schemas",e=>{this.handleSchemasPayload(e)}),this._socket.on("message",e=>{this.socket._emit("message",yn(e))})}hasActorId(e){return"actor"in e&&e.actor!==null&&typeof e.actor=="object"&&"id"in e.actor&&typeof e.actor.id=="string"}replay(e,r){for(const n of r.values()){const s=yn(n);let l=s==null?void 0:s.id;if(this.hasActorId(s)){const a=s.actor;l=typeof a=="string"?a:a.id}this.log(`replaying ${e} for ${l}`),this._socket.emit(e,s)}}}(t=>{t.SockethubClient=en})(typeof globalThis=="object"?globalThis:{});const Lt=Object.create(null);Lt.open="0";Lt.close="1";Lt.ping="2";Lt.pong="3";Lt.message="4";Lt.upgrade="5";Lt.noop="6";const Ir=Object.create(null);Object.keys(Lt).forEach(t=>{Ir[Lt[t]]=t});const Nn={type:"error",data:"parser error"},ga=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",va=typeof ArrayBuffer=="function",ya=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Xn=({type:t,data:e},r,n)=>ga&&e instanceof Blob?r?n(e):Es(e,n):va&&(e instanceof ArrayBuffer||ya(e))?r?n(e):Es(new Blob([e]),n):n(Lt[t]+(e||"")),Es=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function Ss(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let _n;function ru(t,e){if(ga&&t.data instanceof Blob)return t.data.arrayBuffer().then(Ss).then(e);if(va&&(t.data instanceof ArrayBuffer||ya(t.data)))return e(Ss(t.data));Xn(t,!1,r=>{_n||(_n=new TextEncoder),e(_n.encode(r))})}const Ps="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Ps.length;t++)hr[Ps.charCodeAt(t)]=t;const nu=t=>{let e=t.length*.75,r=t.length,n,s=0,l,a,u,i;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const h=new ArrayBuffer(e),c=new Uint8Array(h);for(n=0;n<r;n+=4)l=hr[t.charCodeAt(n)],a=hr[t.charCodeAt(n+1)],u=hr[t.charCodeAt(n+2)],i=hr[t.charCodeAt(n+3)],c[s++]=l<<2|a>>4,c[s++]=(a&15)<<4|u>>2,c[s++]=(u&3)<<6|i&63;return h},su=typeof ArrayBuffer=="function",Yn=(t,e)=>{if(typeof t!="string")return{type:"message",data:_a(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:au(t.substring(1),e)}:Ir[r]?t.length>1?{type:Ir[r],data:t.substring(1)}:{type:Ir[r]}:Nn},au=(t,e)=>{if(su){const r=nu(t);return _a(r,e)}else return{base64:!0,data:t}},_a=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},wa="",iu=(t,e)=>{const r=t.length,n=new Array(r);let s=0;t.forEach((l,a)=>{Xn(l,!1,u=>{n[a]=u,++s===r&&e(n.join(wa))})})},ou=(t,e)=>{const r=t.split(wa),n=[];for(let s=0;s<r.length;s++){const l=Yn(r[s],e);if(n.push(l),l.type==="error")break}return n};function cu(){return new TransformStream({transform(t,e){ru(t,r=>{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const l=new DataView(s.buffer);l.setUint8(0,126),l.setUint16(1,n)}else{s=new Uint8Array(9);const l=new DataView(s.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(r)})}})}let wn;function Nr(t){return t.reduce((e,r)=>e+r.length,0)}function Tr(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let s=0;s<e;s++)r[s]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function lu(t,e){wn||(wn=new TextDecoder);const r=[];let n=0,s=-1,l=!1;return new TransformStream({transform(a,u){for(r.push(a);;){if(n===0){if(Nr(r)<1)break;const i=Tr(r,1);l=(i[0]&128)===128,s=i[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Nr(r)<2)break;const i=Tr(r,2);s=new DataView(i.buffer,i.byteOffset,i.length).getUint16(0),n=3}else if(n===2){if(Nr(r)<8)break;const i=Tr(r,8),h=new DataView(i.buffer,i.byteOffset,i.length),c=h.getUint32(0);if(c>Math.pow(2,21)-1){u.enqueue(Nn);break}s=c*Math.pow(2,32)+h.getUint32(4),n=3}else{if(Nr(r)<s)break;const i=Tr(r,s);u.enqueue(Yn(l?i:wn.decode(i),e)),n=0}if(s===0||s>t){u.enqueue(Nn);break}}}})}const $a=4;function ot(t){if(t)return uu(t)}function uu(t){for(var e in ot.prototype)t[e]=ot.prototype[e];return t}ot.prototype.on=ot.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};ot.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};ot.prototype.off=ot.prototype.removeListener=ot.prototype.removeAllListeners=ot.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,s=0;s<r.length;s++)if(n=r[s],n===e||n.fn===e){r.splice(s,1);break}return r.length===0&&delete this._callbacks["$"+t],this};ot.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,e)}return this};ot.prototype.emitReserved=ot.prototype.emit;ot.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ot.prototype.hasListeners=function(t){return!!this.listeners(t).length};const tn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Ot=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fu="arraybuffer";function ba(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const du=Ot.setTimeout,hu=Ot.clearTimeout;function rn(t,e){e.useNativeTimers?(t.setTimeoutFn=du.bind(Ot),t.clearTimeoutFn=hu.bind(Ot)):(t.setTimeoutFn=Ot.setTimeout.bind(Ot),t.clearTimeoutFn=Ot.clearTimeout.bind(Ot))}const pu=1.33;function mu(t){return typeof t=="string"?gu(t):Math.ceil((t.byteLength||t.size)*pu)}function gu(t){let e=0,r=0;for(let n=0,s=t.length;n<s;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function Ea(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function vu(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function yu(t){let e={},r=t.split("&");for(let n=0,s=r.length;n<s;n++){let l=r[n].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}class _u extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class Zn extends ot{constructor(e){super(),this.writable=!1,rn(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,r,n){return super.emitReserved("error",new _u(e,r,n)),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 r=Yn(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_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 r=vu(e);return r.length?"?"+r:""}}class wu extends Zn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};ou(e,this.socket.binaryType).forEach(r),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,iu(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Ea()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}}let Sa=!1;try{Sa=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $u=Sa;function bu(){}class Eu extends wu{constructor(e){if(super(e),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(s,l)=>{this.onError("xhr post error",s,l)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class qt extends ot{constructor(e,r,n){super(),this.createRequest=e,rn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const r=ba(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=qt.requestsCount++,qt.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=bu,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete qt.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()}}qt.requestsCount=0;qt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ks);else if(typeof addEventListener=="function"){const t="onpagehide"in Ot?"pagehide":"unload";addEventListener(t,ks,!1)}}function ks(){for(let t in qt.requests)qt.requests.hasOwnProperty(t)&&qt.requests[t].abort()}const Su=function(){const t=Pa({xdomain:!1});return t&&t.responseType!==null}();class Pu extends Eu{constructor(e){super(e);const r=e&&e.forceBase64;this.supportsBinary=Su&&!r}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new qt(Pa,this.uri(),e)}}function Pa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||$u))return new XMLHttpRequest}catch{}if(!e)try{return new Ot[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ka=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ku extends Zn{get name(){return"websocket"}doOpen(){const e=this.uri(),r=this.opts.protocols,n=ka?{}:ba(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,r,n)}catch(s){return this.emitReserved("error",s)}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 r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;Xn(n,this.supportsBinary,l=>{try{this.doWrite(n,l)}catch{}s&&tn(()=>{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",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Ea()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}}const $n=Ot.WebSocket||Ot.MozWebSocket;class Ou extends ku{createSocket(e,r,n){return ka?new $n(e,r,n):r?new $n(e,r):new $n(e)}doWrite(e,r){this.ws.send(r)}}class Nu extends Zn{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 r=lu(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),s=cu();s.readable.pipeTo(e.writable),this._writer=s.writable.getWriter();const l=()=>{n.read().then(({done:u,value:i})=>{u||(this.onPacket(i),l())}).catch(u=>{})};l();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 r=0;r<e.length;r++){const n=e[r],s=r===e.length-1;this._writer.write(n).then(()=>{s&&tn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Tu={websocket:Ou,webtransport:Nu,polling:Pu},Ru=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Iu=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tn(t){if(t.length>8e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let s=Ru.exec(t||""),l={},a=14;for(;a--;)l[Iu[a]]=s[a]||"";return r!=-1&&n!=-1&&(l.source=e,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=Cu(l,l.path),l.queryKey=Au(l,l.query),l}function Cu(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Au(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,l){s&&(r[s]=l)}),r}const Rn=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cr=[];Rn&&addEventListener("offline",()=>{Cr.forEach(t=>t())},!1);class Jt extends ot{constructor(e,r){if(super(),this.binaryType=fu,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(r=e,e=null),e){const n=Tn(e);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Tn(r.host).host);rn(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const s=n.prototype.name;this.transports.push(s),this._transportsByName[s]=n}),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},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yu(this.opts.query)),Rn&&(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"})},Cr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=$a,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Jt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(e);r.open(),this.setTransport(r)}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",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",Jt.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 r=new Error("server error");r.code=e.data,this._onError(r);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 r=1;for(let n=0;n<this.writeBuffer.length;n++){const s=this.writeBuffer[n].data;if(s&&(r+=mu(s)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,tn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,r,n){return this._sendPacket("message",e,r,n),this}send(e,r,n){return this._sendPacket("message",e,r,n),this}_sendPacket(e,r,n,s){if(typeof r=="function"&&(s=r,r=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const l={type:e,data:r,options:n};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Jt.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,r){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(),Rn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Cr.indexOf(this._offlineEventListener);n!==-1&&Cr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=$a;class ju extends Jt{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 r=this.createTransport(e),n=!1;Jt.priorWebsocketSuccess=!1;const s=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Jt.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(c(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function l(){n||(n=!0,c(),r.close(),r=null)}const a=d=>{const w=new Error("probe error: "+d);w.transport=r.name,l(),this.emitReserved("upgradeError",w)};function u(){a("transport closed")}function i(){a("socket closed")}function h(d){r&&d.name!==r.name&&l()}const c=()=>{r.removeListener("open",s),r.removeListener("error",a),r.removeListener("close",u),this.off("close",i),this.off("upgrading",h)};r.once("open",s),r.once("error",a),r.once("close",u),this.once("close",i),this.once("upgrading",h),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const r=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}}let Mu=class extends ju{constructor(e,r={}){const n=typeof e=="object"?e:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(s=>Tu[s]).filter(s=>!!s)),super(e,n)}};function Du(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=Tn(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const l=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+l+":"+n.port+e,n.href=n.protocol+"://"+l+(r&&r.port===n.port?"":":"+n.port),n}const qu=typeof ArrayBuffer=="function",Lu=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Oa=Object.prototype.toString,Uu=typeof Blob=="function"||typeof Blob<"u"&&Oa.call(Blob)==="[object BlobConstructor]",Vu=typeof File=="function"||typeof File<"u"&&Oa.call(File)==="[object FileConstructor]";function es(t){return qu&&(t instanceof ArrayBuffer||Lu(t))||Uu&&t instanceof Blob||Vu&&t instanceof File}function Ar(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(Ar(t[r]))return!0;return!1}if(es(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ar(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Ar(t[r]))return!0;return!1}function Fu(t){const e=[],r=t.data,n=t;return n.data=In(r,e),n.attachments=e.length,{packet:n,buffers:e}}function In(t,e){if(!t)return t;if(es(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=In(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=In(t[n],e));return r}return t}function zu(t,e){return t.data=Cn(t.data,e),delete t.attachments,t}function Cn(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Cn(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Cn(t[r],e));return t}const xu=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Bu=5;var De;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(De||(De={}));class Hu{constructor(e){this.replacer=e}encode(e){return(e.type===De.EVENT||e.type===De.ACK)&&Ar(e)?this.encodeAsBinary({type:e.type===De.EVENT?De.BINARY_EVENT:De.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===De.BINARY_EVENT||e.type===De.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=Fu(e),n=this.encodeAsString(r.packet),s=r.buffers;return s.unshift(n),s}}function Os(t){return Object.prototype.toString.call(t)==="[object Object]"}class ts extends ot{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===De.BINARY_EVENT;n||r.type===De.BINARY_ACK?(r.type=n?De.EVENT:De.ACK,this.reconstructor=new Ku(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(es(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(De[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===De.BINARY_EVENT||n.type===De.BINARY_ACK){const l=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const a=e.substring(l,r);if(a!=Number(a)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(r+1)==="/"){const l=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(l,r)}else n.nsp="/";const s=e.charAt(r+1);if(s!==""&&Number(s)==s){const l=r+1;for(;++r;){const a=e.charAt(r);if(a==null||Number(a)!=a){--r;break}if(r===e.length)break}n.id=Number(e.substring(l,r+1))}if(e.charAt(++r)){const l=this.tryParse(e.substr(r));if(ts.isPayloadValid(n.type,l))n.data=l;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case De.CONNECT:return Os(r);case De.DISCONNECT:return r===void 0;case De.CONNECT_ERROR:return typeof r=="string"||Os(r);case De.EVENT:case De.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&xu.indexOf(r[0])===-1);case De.ACK:case De.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ku{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=zu(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gu=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ts,Encoder:Hu,get PacketType(){return De},protocol:Bu},Symbol.toStringTag,{value:"Module"}));function Rt(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const Wu=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Na extends ot{constructor(e,r,n){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=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Rt(e,"open",this.onopen.bind(this)),Rt(e,"packet",this.onpacket.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(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,...r){var n,s,l;if(Wu.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const a={type:De.EVENT,data:r};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const c=this.ids++,d=r.pop();this._registerAckCallback(c,d),a.id=c}const u=(s=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||s===void 0?void 0:s.writable,i=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!u||(i?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,r){var n;const s=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(s===void 0){this.acks[e]=r;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===e&&this.sendBuffer.splice(u,1);r.call(this,new Error("operation has timed out"))},s),a=(...u)=>{this.io.clearTimeoutFn(l),r.apply(this,u)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...r){return new Promise((n,s)=>{const l=(a,u)=>a?s(a):n(u);l.withError=!0,r.push(l),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...l)=>(this._queue[0],s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(s)):(this._queue.shift(),r&&r(null,...l)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.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:De.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,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case De.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 De.EVENT:case De.BINARY_EVENT:this.onevent(e);break;case De.ACK:case De.BINARY_ACK:this.onack(e);break;case De.DISCONNECT:this.ondisconnect();break;case De.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.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 r=this;let n=!1;return function(...s){n||(n=!0,r.packet({type:De.ACK,id:e,data:s}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,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:De.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 r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,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 r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function ar(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ar.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0};ar.prototype.reset=function(){this.attempts=0};ar.prototype.setMin=function(t){this.ms=t};ar.prototype.setMax=function(t){this.max=t};ar.prototype.setJitter=function(t){this.jitter=t};class An extends ot{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,rn(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new ar({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const s=r.parser||Gu;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.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 r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.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 Mu(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=Rt(r,"open",function(){n.onopen(),e&&e()}),l=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},a=Rt(r,"error",l);if(this._timeout!==!1){const u=this._timeout,i=this.setTimeoutFn(()=>{s(),l(new Error("timeout")),r.close()},u);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(s),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(Rt(e,"ping",this.onping.bind(this)),Rt(e,"data",this.ondata.bind(this)),Rt(e,"error",this.onerror.bind(this)),Rt(e,"close",this.onclose.bind(this)),Rt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){tn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Na(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],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,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),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 r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ur={};function jr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=Du(t,e.path||"/socket.io"),n=r.source,s=r.id,l=r.path,a=ur[s]&&l in ur[s].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let i;return u?i=new An(n,e):(ur[s]||(ur[s]=new An(n,e)),i=ur[s]),r.query&&!e.query&&(e.query=r.queryKey),i.socket(r.path,e)}Object.assign(jr,{Manager:An,Socket:Na,io:jr,connect:jr});let Pt;const Ju=yr(!1),Qu={sockethub:{port:10550,host:"localhost",path:"/sockethub"},public:{protocol:"http",host:"localhost",port:10550,path:"/"}};async function Ta(){if(!Pt)throw new Error("Sockethub client is not initialized yet");await Pt.ready()}async function uf(t){return await Ta(),Pt.contextFor(t)}function ff(t){return{id:t.id,type:t.type,name:t.name??t.id}}async function df(t){return await Ta(),console.log("sending ->",t),new Promise((e,r)=>{Pt.socket.emit("message",hn("SEND",t),n=>{if(console.log("received <-",n),hn("RESP",n),n.totalItems&&n.items)for(const s of n.items.reverse())hn("RESP",s,!0);Us(n,!0),n.error?r(n.error):e(n)})})}function bn(t){return e=>{const r=t==="connect";Ju.update(()=>r),console.log(`sockethub ${t} [connected: ${r}]`,e||"")}}function Xu(t){console.log("handle incoming: ",t),Us(t,!1)}function Ns(t=Qu){Pt=new en(jr(`${t.public.protocol}://${t.public.host}:${t.public.port}`,{path:t.sockethub.path}),{initTimeoutMs:1e4}),Pt.socket.on("connect",bn("connect")),Pt.socket.on("error",bn("error")),Pt.socket.on("disconnect",bn("disconnect")),Pt.socket.on("message",Xu),Pt.socket.on("schemas",e=>{console.log("schemas received:",e),pn("schemas",e)}),Pt.socket.on("ready",e=>{console.log("client ready:",e),pn("ready",e)}),Pt.socket.on("init_error",e=>{console.error("client init error:",e),pn("init_error",e)})}typeof globalThis=="object"&&"window"in globalThis&&(console.log("connecting to sockethub"),fetch("/config.json").then(async t=>{const e=await t.json();Ns(e)}).catch(()=>{Ns()}));export{of as I,cf as L,ff as a,Ta as b,uf as c,Pt as d,Pn as e,Ju as f,Ls as g,bi as h,qs as i,df as s};