675 lines
537 KiB
HTML
675 lines
537 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta name="author" content="npub18ug6hvhzxhdz6nw6t4k7ktcjx9e5w6n5tg7226y458g0vv4y9aqq3r20ex">
|
|
<meta name="block:articles" content="2-grid">
|
|
<meta name="block:articles" content="4-list">
|
|
<meta name="block:notes" content="2-board">
|
|
<meta name="block:notes" content="10-slide">
|
|
<meta name="block:images" content="10-grid">
|
|
<meta name="comments" content="yes">
|
|
<meta name="topics" content="music,basspistol,doodle,graffiti">
|
|
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title></title>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script>
|
|
window.wnjParams = {
|
|
position: 'bottom',
|
|
accent: 'neutral',
|
|
startHidden: true,
|
|
compactMode: true,
|
|
};
|
|
</script>
|
|
<script>
|
|
(function () {
|
|
function getMetaTheme() {
|
|
var meta = document.querySelector('meta[name="force-theme"]');
|
|
if (!meta) return null;
|
|
var value = (meta.getAttribute('content') || '').toLowerCase();
|
|
if (value === 'dark' || value === 'light') return value;
|
|
return null;
|
|
}
|
|
function isDarkTheme() {
|
|
if (localStorage.getItem('theme') === 'dark') return true;
|
|
if (localStorage.getItem('theme') === 'light') return false;
|
|
var metaTheme = getMetaTheme();
|
|
if (metaTheme) return metaTheme === 'dark';
|
|
var darkSetting = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
localStorage.setItem('systemTheme', darkSetting ? 'dark' : 'light');
|
|
return darkSetting;
|
|
}
|
|
if (isDarkTheme()) {
|
|
document.documentElement.classList.add('dark');
|
|
}
|
|
})();
|
|
</script>
|
|
<script>
|
|
"use strict";(()=>{var C_=Object.create;var ul=Object.defineProperty;var P_=Object.getOwnPropertyDescriptor;var I_=Object.getOwnPropertyNames;var N_=Object.getPrototypeOf,O_=Object.prototype.hasOwnProperty;var R_=(e,t)=>()=>(e&&(t=e(e=0)),t);var qp=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),U_=(e,t)=>{for(var n in t)ul(e,n,{get:t[n],enumerable:!0})},z_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of I_(t))!O_.call(e,o)&&o!==n&&ul(e,o,{get:()=>t[o],enumerable:!(r=P_(t,o))||r.enumerable});return e};var ll=(e,t,n)=>(n=e!=null?C_(N_(e)):{},z_(t||!e||!e.__esModule?ul(n,"default",{value:e,enumerable:!0}):n,e));var Al=qp((yA,ig)=>{"use strict";var X_=function(){function e(n,r){if(typeof n!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+n+"."));this._batchLoadFn=n,this._maxBatchSize=r2(r),this._batchScheduleFn=o2(r),this._cacheKeyFn=i2(r),this._cacheMap=s2(r),this._batch=null,this.name=a2(r)}var t=e.prototype;return t.load=function(r){if(r==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(r)+"."));var o=t2(this),i=this._cacheMap,a;if(i){a=this._cacheKeyFn(r);var u=i.get(a);if(u){var d=o.cacheHits||(o.cacheHits=[]);return new Promise(function(m){d.push(function(){m(u)})})}}o.keys.push(r);var h=new Promise(function(m,b){o.callbacks.push({resolve:m,reject:b})});return i&&i.set(a,h),h},t.loadMany=function(r){if(!og(r))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+r+"."));for(var o=[],i=0;i<r.length;i++)o.push(this.load(r[i]).catch(function(a){return a}));return Promise.all(o)},t.clear=function(r){var o=this._cacheMap;if(o){var i=this._cacheKeyFn(r);o.delete(i)}return this},t.clearAll=function(){var r=this._cacheMap;return r&&r.clear(),this},t.prime=function(r,o){var i=this._cacheMap;if(i){var a=this._cacheKeyFn(r);if(i.get(a)===void 0){var u;o instanceof Error?(u=Promise.reject(o),u.catch(function(){})):u=Promise.resolve(o),i.set(a,u)}}return this},e}(),e2=typeof process=="object"&&typeof process.nextTick=="function"?function(e){xl||(xl=Promise.resolve()),xl.then(function(){process.nextTick(e)})}:typeof setImmediate=="function"?function(e){setImmediate(e)}:function(e){setTimeout(e)},xl;function t2(e){var t=e._batch;if(t!==null&&!t.hasDispatched&&t.keys.length<e._maxBatchSize)return t;var n={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=n,e._batchScheduleFn(function(){n2(e,n)}),n}function n2(e,t){if(t.hasDispatched=!0,t.keys.length===0){Sl(t);return}var n;try{n=e._batchLoadFn(t.keys)}catch(r){return kl(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(r)+".")))}if(!n||typeof n.then!="function")return kl(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(n)+".")));n.then(function(r){if(!og(r))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(r)+"."));if(r.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
|
|
|
|
Keys:
|
|
`+String(t.keys))+(`
|
|
|
|
Values:
|
|
`+String(r)));Sl(t);for(var o=0;o<t.callbacks.length;o++){var i=r[o];i instanceof Error?t.callbacks[o].reject(i):t.callbacks[o].resolve(i)}}).catch(function(r){kl(e,t,r)})}function kl(e,t,n){Sl(t);for(var r=0;r<t.keys.length;r++)e.clear(t.keys[r]),t.callbacks[r].reject(n)}function Sl(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function r2(e){var t=!e||e.batch!==!1;if(!t)return 1;var n=e&&e.maxBatchSize;if(n===void 0)return 1/0;if(typeof n!="number"||n<1)throw new TypeError("maxBatchSize must be a positive number: "+n);return n}function o2(e){var t=e&&e.batchScheduleFn;if(t===void 0)return e2;if(typeof t!="function")throw new TypeError("batchScheduleFn must be a function: "+t);return t}function i2(e){var t=e&&e.cacheKeyFn;if(t===void 0)return function(n){return n};if(typeof t!="function")throw new TypeError("cacheKeyFn must be a function: "+t);return t}function s2(e){var t=!e||e.cache!==!1;if(!t)return null;var n=e&&e.cacheMap;if(n===void 0)return new Map;if(n!==null){var r=["get","set","delete","clear"],o=r.filter(function(i){return n&&typeof n[i]!="function"});if(o.length!==0)throw new TypeError("Custom cacheMap missing methods: "+o.join(", "))}return n}function a2(e){return e&&e.name?e.name:null}function og(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&(e.length===0||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}ig.exports=X_});var hm=qp((fm,Xa)=>{(function(){function e(f){"use strict";var p={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(f===!1)return JSON.parse(JSON.stringify(p));var w={};for(var v in p)p.hasOwnProperty(v)&&(w[v]=p[v].defaultValue);return w}function t(){"use strict";var f=e(!0),p={};for(var w in f)f.hasOwnProperty(w)&&(p[w]=!0);return p}var n={},r={},o={},i=e(!0),a="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:t()};n.helper={},n.extensions={},n.setOption=function(f,p){"use strict";return i[f]=p,this},n.getOption=function(f){"use strict";return i[f]},n.getOptions=function(){"use strict";return i},n.resetOptions=function(){"use strict";i=e(!0)},n.setFlavor=function(f){"use strict";if(!u.hasOwnProperty(f))throw Error(f+" flavor was not found");n.resetOptions();var p=u[f];a=f;for(var w in p)p.hasOwnProperty(w)&&(i[w]=p[w])},n.getFlavor=function(){"use strict";return a},n.getFlavorOptions=function(f){"use strict";if(u.hasOwnProperty(f))return u[f]},n.getDefaultOptions=function(f){"use strict";return e(f)},n.subParser=function(f,p){"use strict";if(n.helper.isString(f))if(typeof p<"u")r[f]=p;else{if(r.hasOwnProperty(f))return r[f];throw Error("SubParser named "+f+" not registered!")}},n.extension=function(f,p){"use strict";if(!n.helper.isString(f))throw Error("Extension 'name' must be a string");if(f=n.helper.stdExtName(f),n.helper.isUndefined(p)){if(!o.hasOwnProperty(f))throw Error("Extension named "+f+" is not registered!");return o[f]}else{typeof p=="function"&&(p=p()),n.helper.isArray(p)||(p=[p]);var w=d(p,f);if(w.valid)o[f]=p;else throw Error(w.error)}},n.getAllExtensions=function(){"use strict";return o},n.removeExtension=function(f){"use strict";delete o[f]},n.resetExtensions=function(){"use strict";o={}};function d(f,p){"use strict";var w=p?"Error in "+p+" extension->":"Error in unnamed extension",v={valid:!0,error:""};n.helper.isArray(f)||(f=[f]);for(var S=0;S<f.length;++S){var $=w+" sub-extension "+S+": ",P=f[S];if(typeof P!="object")return v.valid=!1,v.error=$+"must be an object, but "+typeof P+" given",v;if(!n.helper.isString(P.type))return v.valid=!1,v.error=$+'property "type" must be a string, but '+typeof P.type+" given",v;var M=P.type=P.type.toLowerCase();if(M==="language"&&(M=P.type="lang"),M==="html"&&(M=P.type="output"),M!=="lang"&&M!=="output"&&M!=="listener")return v.valid=!1,v.error=$+"type "+M+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',v;if(M==="listener"){if(n.helper.isUndefined(P.listeners))return v.valid=!1,v.error=$+'. Extensions of type "listener" must have a property called "listeners"',v}else if(n.helper.isUndefined(P.filter)&&n.helper.isUndefined(P.regex))return v.valid=!1,v.error=$+M+' extensions must define either a "regex" property or a "filter" method',v;if(P.listeners){if(typeof P.listeners!="object")return v.valid=!1,v.error=$+'"listeners" property must be an object but '+typeof P.listeners+" given",v;for(var N in P.listeners)if(P.listeners.hasOwnProperty(N)&&typeof P.listeners[N]!="function")return v.valid=!1,v.error=$+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+N+" must be a function but "+typeof P.listeners[N]+" given",v}if(P.filter){if(typeof P.filter!="function")return v.valid=!1,v.error=$+'"filter" must be a function, but '+typeof P.filter+" given",v}else if(P.regex){if(n.helper.isString(P.regex)&&(P.regex=new RegExp(P.regex,"g")),!(P.regex instanceof RegExp))return v.valid=!1,v.error=$+'"regex" property must either be a string or a RegExp object, but '+typeof P.regex+" given",v;if(n.helper.isUndefined(P.replace))return v.valid=!1,v.error=$+'"regex" extensions must implement a replace string or function',v}}return v}n.validateExtension=function(f){"use strict";var p=d(f,null);return p.valid?!0:(console.warn(p.error),!1)},n.hasOwnProperty("helper")||(n.helper={}),n.helper.isString=function(f){"use strict";return typeof f=="string"||f instanceof String},n.helper.isFunction=function(f){"use strict";var p={};return f&&p.toString.call(f)==="[object Function]"},n.helper.isArray=function(f){"use strict";return Array.isArray(f)},n.helper.isUndefined=function(f){"use strict";return typeof f>"u"},n.helper.forEach=function(f,p){"use strict";if(n.helper.isUndefined(f))throw new Error("obj param is required");if(n.helper.isUndefined(p))throw new Error("callback param is required");if(!n.helper.isFunction(p))throw new Error("callback param must be a function/closure");if(typeof f.forEach=="function")f.forEach(p);else if(n.helper.isArray(f))for(var w=0;w<f.length;w++)p(f[w],w,f);else if(typeof f=="object")for(var v in f)f.hasOwnProperty(v)&&p(f[v],v,f);else throw new Error("obj does not seem to be an array or an iterable object")},n.helper.stdExtName=function(f){"use strict";return f.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function h(f,p){"use strict";var w=p.charCodeAt(0);return"\xA8E"+w+"E"}n.helper.escapeCharactersCallback=h,n.helper.escapeCharacters=function(f,p,w){"use strict";var v="(["+p.replace(/([\[\]\\])/g,"\\$1")+"])";w&&(v="\\\\"+v);var S=new RegExp(v,"g");return f=f.replace(S,h),f},n.helper.unescapeHTMLEntities=function(f){"use strict";return f.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var m=function(f,p,w,v){"use strict";var S=v||"",$=S.indexOf("g")>-1,P=new RegExp(p+"|"+w,"g"+S.replace(/g/g,"")),M=new RegExp(p,S.replace(/g/g,"")),N=[],B,F,q,x,z;do for(B=0;q=P.exec(f);)if(M.test(q[0]))B++||(F=P.lastIndex,x=F-q[0].length);else if(B&&!--B){z=q.index+q[0].length;var V={left:{start:x,end:F},match:{start:F,end:q.index},right:{start:q.index,end:z},wholeMatch:{start:x,end:z}};if(N.push(V),!$)return N}while(B&&(P.lastIndex=F));return N};n.helper.matchRecursiveRegExp=function(f,p,w,v){"use strict";for(var S=m(f,p,w,v),$=[],P=0;P<S.length;++P)$.push([f.slice(S[P].wholeMatch.start,S[P].wholeMatch.end),f.slice(S[P].match.start,S[P].match.end),f.slice(S[P].left.start,S[P].left.end),f.slice(S[P].right.start,S[P].right.end)]);return $},n.helper.replaceRecursiveRegExp=function(f,p,w,v,S){"use strict";if(!n.helper.isFunction(p)){var $=p;p=function(){return $}}var P=m(f,w,v,S),M=f,N=P.length;if(N>0){var B=[];P[0].wholeMatch.start!==0&&B.push(f.slice(0,P[0].wholeMatch.start));for(var F=0;F<N;++F)B.push(p(f.slice(P[F].wholeMatch.start,P[F].wholeMatch.end),f.slice(P[F].match.start,P[F].match.end),f.slice(P[F].left.start,P[F].left.end),f.slice(P[F].right.start,P[F].right.end))),F<N-1&&B.push(f.slice(P[F].wholeMatch.end,P[F+1].wholeMatch.start));P[N-1].wholeMatch.end<f.length&&B.push(f.slice(P[N-1].wholeMatch.end)),M=B.join("")}return M},n.helper.regexIndexOf=function(f,p,w){"use strict";if(!n.helper.isString(f))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(!(p instanceof RegExp))throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var v=f.substring(w||0).search(p);return v>=0?v+(w||0):v},n.helper.splitAtIndex=function(f,p){"use strict";if(!n.helper.isString(f))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[f.substring(0,p),f.substring(p)]},n.helper.encodeEmailAddress=function(f){"use strict";var p=[function(w){return"&#"+w.charCodeAt(0)+";"},function(w){return"&#x"+w.charCodeAt(0).toString(16)+";"},function(w){return w}];return f=f.replace(/./g,function(w){if(w==="@")w=p[Math.floor(Math.random()*2)](w);else{var v=Math.random();w=v>.9?p[2](w):v>.45?p[1](w):p[0](w)}return w}),f},n.helper.padEnd=function(p,w,v){"use strict";return w=w>>0,v=String(v||" "),p.length>w?String(p):(w=w-p.length,w>v.length&&(v+=v.repeat(w/v.length)),String(p)+v.slice(0,w))},typeof console>"u"&&(console={warn:function(f){"use strict";alert(f)},log:function(f){"use strict";alert(f)},error:function(f){"use strict";throw f}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"\u{1F44D}","-1":"\u{1F44E}",100:"\u{1F4AF}",1234:"\u{1F522}","1st_place_medal":"\u{1F947}","2nd_place_medal":"\u{1F948}","3rd_place_medal":"\u{1F949}","8ball":"\u{1F3B1}",a:"\u{1F170}\uFE0F",ab:"\u{1F18E}",abc:"\u{1F524}",abcd:"\u{1F521}",accept:"\u{1F251}",aerial_tramway:"\u{1F6A1}",airplane:"\u2708\uFE0F",alarm_clock:"\u23F0",alembic:"\u2697\uFE0F",alien:"\u{1F47D}",ambulance:"\u{1F691}",amphora:"\u{1F3FA}",anchor:"\u2693\uFE0F",angel:"\u{1F47C}",anger:"\u{1F4A2}",angry:"\u{1F620}",anguished:"\u{1F627}",ant:"\u{1F41C}",apple:"\u{1F34E}",aquarius:"\u2652\uFE0F",aries:"\u2648\uFE0F",arrow_backward:"\u25C0\uFE0F",arrow_double_down:"\u23EC",arrow_double_up:"\u23EB",arrow_down:"\u2B07\uFE0F",arrow_down_small:"\u{1F53D}",arrow_forward:"\u25B6\uFE0F",arrow_heading_down:"\u2935\uFE0F",arrow_heading_up:"\u2934\uFE0F",arrow_left:"\u2B05\uFE0F",arrow_lower_left:"\u2199\uFE0F",arrow_lower_right:"\u2198\uFE0F",arrow_right:"\u27A1\uFE0F",arrow_right_hook:"\u21AA\uFE0F",arrow_up:"\u2B06\uFE0F",arrow_up_down:"\u2195\uFE0F",arrow_up_small:"\u{1F53C}",arrow_upper_left:"\u2196\uFE0F",arrow_upper_right:"\u2197\uFE0F",arrows_clockwise:"\u{1F503}",arrows_counterclockwise:"\u{1F504}",art:"\u{1F3A8}",articulated_lorry:"\u{1F69B}",artificial_satellite:"\u{1F6F0}",astonished:"\u{1F632}",athletic_shoe:"\u{1F45F}",atm:"\u{1F3E7}",atom_symbol:"\u269B\uFE0F",avocado:"\u{1F951}",b:"\u{1F171}\uFE0F",baby:"\u{1F476}",baby_bottle:"\u{1F37C}",baby_chick:"\u{1F424}",baby_symbol:"\u{1F6BC}",back:"\u{1F519}",bacon:"\u{1F953}",badminton:"\u{1F3F8}",baggage_claim:"\u{1F6C4}",baguette_bread:"\u{1F956}",balance_scale:"\u2696\uFE0F",balloon:"\u{1F388}",ballot_box:"\u{1F5F3}",ballot_box_with_check:"\u2611\uFE0F",bamboo:"\u{1F38D}",banana:"\u{1F34C}",bangbang:"\u203C\uFE0F",bank:"\u{1F3E6}",bar_chart:"\u{1F4CA}",barber:"\u{1F488}",baseball:"\u26BE\uFE0F",basketball:"\u{1F3C0}",basketball_man:"\u26F9\uFE0F",basketball_woman:"\u26F9\uFE0F‍\u2640\uFE0F",bat:"\u{1F987}",bath:"\u{1F6C0}",bathtub:"\u{1F6C1}",battery:"\u{1F50B}",beach_umbrella:"\u{1F3D6}",bear:"\u{1F43B}",bed:"\u{1F6CF}",bee:"\u{1F41D}",beer:"\u{1F37A}",beers:"\u{1F37B}",beetle:"\u{1F41E}",beginner:"\u{1F530}",bell:"\u{1F514}",bellhop_bell:"\u{1F6CE}",bento:"\u{1F371}",biking_man:"\u{1F6B4}",bike:"\u{1F6B2}",biking_woman:"\u{1F6B4}‍\u2640\uFE0F",bikini:"\u{1F459}",biohazard:"\u2623\uFE0F",bird:"\u{1F426}",birthday:"\u{1F382}",black_circle:"\u26AB\uFE0F",black_flag:"\u{1F3F4}",black_heart:"\u{1F5A4}",black_joker:"\u{1F0CF}",black_large_square:"\u2B1B\uFE0F",black_medium_small_square:"\u25FE\uFE0F",black_medium_square:"\u25FC\uFE0F",black_nib:"\u2712\uFE0F",black_small_square:"\u25AA\uFE0F",black_square_button:"\u{1F532}",blonde_man:"\u{1F471}",blonde_woman:"\u{1F471}‍\u2640\uFE0F",blossom:"\u{1F33C}",blowfish:"\u{1F421}",blue_book:"\u{1F4D8}",blue_car:"\u{1F699}",blue_heart:"\u{1F499}",blush:"\u{1F60A}",boar:"\u{1F417}",boat:"\u26F5\uFE0F",bomb:"\u{1F4A3}",book:"\u{1F4D6}",bookmark:"\u{1F516}",bookmark_tabs:"\u{1F4D1}",books:"\u{1F4DA}",boom:"\u{1F4A5}",boot:"\u{1F462}",bouquet:"\u{1F490}",bowing_man:"\u{1F647}",bow_and_arrow:"\u{1F3F9}",bowing_woman:"\u{1F647}‍\u2640\uFE0F",bowling:"\u{1F3B3}",boxing_glove:"\u{1F94A}",boy:"\u{1F466}",bread:"\u{1F35E}",bride_with_veil:"\u{1F470}",bridge_at_night:"\u{1F309}",briefcase:"\u{1F4BC}",broken_heart:"\u{1F494}",bug:"\u{1F41B}",building_construction:"\u{1F3D7}",bulb:"\u{1F4A1}",bullettrain_front:"\u{1F685}",bullettrain_side:"\u{1F684}",burrito:"\u{1F32F}",bus:"\u{1F68C}",business_suit_levitating:"\u{1F574}",busstop:"\u{1F68F}",bust_in_silhouette:"\u{1F464}",busts_in_silhouette:"\u{1F465}",butterfly:"\u{1F98B}",cactus:"\u{1F335}",cake:"\u{1F370}",calendar:"\u{1F4C6}",call_me_hand:"\u{1F919}",calling:"\u{1F4F2}",camel:"\u{1F42B}",camera:"\u{1F4F7}",camera_flash:"\u{1F4F8}",camping:"\u{1F3D5}",cancer:"\u264B\uFE0F",candle:"\u{1F56F}",candy:"\u{1F36C}",canoe:"\u{1F6F6}",capital_abcd:"\u{1F520}",capricorn:"\u2651\uFE0F",car:"\u{1F697}",card_file_box:"\u{1F5C3}",card_index:"\u{1F4C7}",card_index_dividers:"\u{1F5C2}",carousel_horse:"\u{1F3A0}",carrot:"\u{1F955}",cat:"\u{1F431}",cat2:"\u{1F408}",cd:"\u{1F4BF}",chains:"\u26D3",champagne:"\u{1F37E}",chart:"\u{1F4B9}",chart_with_downwards_trend:"\u{1F4C9}",chart_with_upwards_trend:"\u{1F4C8}",checkered_flag:"\u{1F3C1}",cheese:"\u{1F9C0}",cherries:"\u{1F352}",cherry_blossom:"\u{1F338}",chestnut:"\u{1F330}",chicken:"\u{1F414}",children_crossing:"\u{1F6B8}",chipmunk:"\u{1F43F}",chocolate_bar:"\u{1F36B}",christmas_tree:"\u{1F384}",church:"\u26EA\uFE0F",cinema:"\u{1F3A6}",circus_tent:"\u{1F3AA}",city_sunrise:"\u{1F307}",city_sunset:"\u{1F306}",cityscape:"\u{1F3D9}",cl:"\u{1F191}",clamp:"\u{1F5DC}",clap:"\u{1F44F}",clapper:"\u{1F3AC}",classical_building:"\u{1F3DB}",clinking_glasses:"\u{1F942}",clipboard:"\u{1F4CB}",clock1:"\u{1F550}",clock10:"\u{1F559}",clock1030:"\u{1F565}",clock11:"\u{1F55A}",clock1130:"\u{1F566}",clock12:"\u{1F55B}",clock1230:"\u{1F567}",clock130:"\u{1F55C}",clock2:"\u{1F551}",clock230:"\u{1F55D}",clock3:"\u{1F552}",clock330:"\u{1F55E}",clock4:"\u{1F553}",clock430:"\u{1F55F}",clock5:"\u{1F554}",clock530:"\u{1F560}",clock6:"\u{1F555}",clock630:"\u{1F561}",clock7:"\u{1F556}",clock730:"\u{1F562}",clock8:"\u{1F557}",clock830:"\u{1F563}",clock9:"\u{1F558}",clock930:"\u{1F564}",closed_book:"\u{1F4D5}",closed_lock_with_key:"\u{1F510}",closed_umbrella:"\u{1F302}",cloud:"\u2601\uFE0F",cloud_with_lightning:"\u{1F329}",cloud_with_lightning_and_rain:"\u26C8",cloud_with_rain:"\u{1F327}",cloud_with_snow:"\u{1F328}",clown_face:"\u{1F921}",clubs:"\u2663\uFE0F",cocktail:"\u{1F378}",coffee:"\u2615\uFE0F",coffin:"\u26B0\uFE0F",cold_sweat:"\u{1F630}",comet:"\u2604\uFE0F",computer:"\u{1F4BB}",computer_mouse:"\u{1F5B1}",confetti_ball:"\u{1F38A}",confounded:"\u{1F616}",confused:"\u{1F615}",congratulations:"\u3297\uFE0F",construction:"\u{1F6A7}",construction_worker_man:"\u{1F477}",construction_worker_woman:"\u{1F477}‍\u2640\uFE0F",control_knobs:"\u{1F39B}",convenience_store:"\u{1F3EA}",cookie:"\u{1F36A}",cool:"\u{1F192}",policeman:"\u{1F46E}",copyright:"\xA9\uFE0F",corn:"\u{1F33D}",couch_and_lamp:"\u{1F6CB}",couple:"\u{1F46B}",couple_with_heart_woman_man:"\u{1F491}",couple_with_heart_man_man:"\u{1F468}‍\u2764\uFE0F‍\u{1F468}",couple_with_heart_woman_woman:"\u{1F469}‍\u2764\uFE0F‍\u{1F469}",couplekiss_man_man:"\u{1F468}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F468}",couplekiss_man_woman:"\u{1F48F}",couplekiss_woman_woman:"\u{1F469}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F469}",cow:"\u{1F42E}",cow2:"\u{1F404}",cowboy_hat_face:"\u{1F920}",crab:"\u{1F980}",crayon:"\u{1F58D}",credit_card:"\u{1F4B3}",crescent_moon:"\u{1F319}",cricket:"\u{1F3CF}",crocodile:"\u{1F40A}",croissant:"\u{1F950}",crossed_fingers:"\u{1F91E}",crossed_flags:"\u{1F38C}",crossed_swords:"\u2694\uFE0F",crown:"\u{1F451}",cry:"\u{1F622}",crying_cat_face:"\u{1F63F}",crystal_ball:"\u{1F52E}",cucumber:"\u{1F952}",cupid:"\u{1F498}",curly_loop:"\u27B0",currency_exchange:"\u{1F4B1}",curry:"\u{1F35B}",custard:"\u{1F36E}",customs:"\u{1F6C3}",cyclone:"\u{1F300}",dagger:"\u{1F5E1}",dancer:"\u{1F483}",dancing_women:"\u{1F46F}",dancing_men:"\u{1F46F}‍\u2642\uFE0F",dango:"\u{1F361}",dark_sunglasses:"\u{1F576}",dart:"\u{1F3AF}",dash:"\u{1F4A8}",date:"\u{1F4C5}",deciduous_tree:"\u{1F333}",deer:"\u{1F98C}",department_store:"\u{1F3EC}",derelict_house:"\u{1F3DA}",desert:"\u{1F3DC}",desert_island:"\u{1F3DD}",desktop_computer:"\u{1F5A5}",male_detective:"\u{1F575}\uFE0F",diamond_shape_with_a_dot_inside:"\u{1F4A0}",diamonds:"\u2666\uFE0F",disappointed:"\u{1F61E}",disappointed_relieved:"\u{1F625}",dizzy:"\u{1F4AB}",dizzy_face:"\u{1F635}",do_not_litter:"\u{1F6AF}",dog:"\u{1F436}",dog2:"\u{1F415}",dollar:"\u{1F4B5}",dolls:"\u{1F38E}",dolphin:"\u{1F42C}",door:"\u{1F6AA}",doughnut:"\u{1F369}",dove:"\u{1F54A}",dragon:"\u{1F409}",dragon_face:"\u{1F432}",dress:"\u{1F457}",dromedary_camel:"\u{1F42A}",drooling_face:"\u{1F924}",droplet:"\u{1F4A7}",drum:"\u{1F941}",duck:"\u{1F986}",dvd:"\u{1F4C0}","e-mail":"\u{1F4E7}",eagle:"\u{1F985}",ear:"\u{1F442}",ear_of_rice:"\u{1F33E}",earth_africa:"\u{1F30D}",earth_americas:"\u{1F30E}",earth_asia:"\u{1F30F}",egg:"\u{1F95A}",eggplant:"\u{1F346}",eight_pointed_black_star:"\u2734\uFE0F",eight_spoked_asterisk:"\u2733\uFE0F",electric_plug:"\u{1F50C}",elephant:"\u{1F418}",email:"\u2709\uFE0F",end:"\u{1F51A}",envelope_with_arrow:"\u{1F4E9}",euro:"\u{1F4B6}",european_castle:"\u{1F3F0}",european_post_office:"\u{1F3E4}",evergreen_tree:"\u{1F332}",exclamation:"\u2757\uFE0F",expressionless:"\u{1F611}",eye:"\u{1F441}",eye_speech_bubble:"\u{1F441}‍\u{1F5E8}",eyeglasses:"\u{1F453}",eyes:"\u{1F440}",face_with_head_bandage:"\u{1F915}",face_with_thermometer:"\u{1F912}",fist_oncoming:"\u{1F44A}",factory:"\u{1F3ED}",fallen_leaf:"\u{1F342}",family_man_woman_boy:"\u{1F46A}",family_man_boy:"\u{1F468}‍\u{1F466}",family_man_boy_boy:"\u{1F468}‍\u{1F466}‍\u{1F466}",family_man_girl:"\u{1F468}‍\u{1F467}",family_man_girl_boy:"\u{1F468}‍\u{1F467}‍\u{1F466}",family_man_girl_girl:"\u{1F468}‍\u{1F467}‍\u{1F467}",family_man_man_boy:"\u{1F468}‍\u{1F468}‍\u{1F466}",family_man_man_boy_boy:"\u{1F468}‍\u{1F468}‍\u{1F466}‍\u{1F466}",family_man_man_girl:"\u{1F468}‍\u{1F468}‍\u{1F467}",family_man_man_girl_boy:"\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F466}",family_man_man_girl_girl:"\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F467}",family_man_woman_boy_boy:"\u{1F468}‍\u{1F469}‍\u{1F466}‍\u{1F466}",family_man_woman_girl:"\u{1F468}‍\u{1F469}‍\u{1F467}",family_man_woman_girl_boy:"\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F466}",family_man_woman_girl_girl:"\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F467}",family_woman_boy:"\u{1F469}‍\u{1F466}",family_woman_boy_boy:"\u{1F469}‍\u{1F466}‍\u{1F466}",family_woman_girl:"\u{1F469}‍\u{1F467}",family_woman_girl_boy:"\u{1F469}‍\u{1F467}‍\u{1F466}",family_woman_girl_girl:"\u{1F469}‍\u{1F467}‍\u{1F467}",family_woman_woman_boy:"\u{1F469}‍\u{1F469}‍\u{1F466}",family_woman_woman_boy_boy:"\u{1F469}‍\u{1F469}‍\u{1F466}‍\u{1F466}",family_woman_woman_girl:"\u{1F469}‍\u{1F469}‍\u{1F467}",family_woman_woman_girl_boy:"\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F466}",family_woman_woman_girl_girl:"\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F467}",fast_forward:"\u23E9",fax:"\u{1F4E0}",fearful:"\u{1F628}",feet:"\u{1F43E}",female_detective:"\u{1F575}\uFE0F‍\u2640\uFE0F",ferris_wheel:"\u{1F3A1}",ferry:"\u26F4",field_hockey:"\u{1F3D1}",file_cabinet:"\u{1F5C4}",file_folder:"\u{1F4C1}",film_projector:"\u{1F4FD}",film_strip:"\u{1F39E}",fire:"\u{1F525}",fire_engine:"\u{1F692}",fireworks:"\u{1F386}",first_quarter_moon:"\u{1F313}",first_quarter_moon_with_face:"\u{1F31B}",fish:"\u{1F41F}",fish_cake:"\u{1F365}",fishing_pole_and_fish:"\u{1F3A3}",fist_raised:"\u270A",fist_left:"\u{1F91B}",fist_right:"\u{1F91C}",flags:"\u{1F38F}",flashlight:"\u{1F526}",fleur_de_lis:"\u269C\uFE0F",flight_arrival:"\u{1F6EC}",flight_departure:"\u{1F6EB}",floppy_disk:"\u{1F4BE}",flower_playing_cards:"\u{1F3B4}",flushed:"\u{1F633}",fog:"\u{1F32B}",foggy:"\u{1F301}",football:"\u{1F3C8}",footprints:"\u{1F463}",fork_and_knife:"\u{1F374}",fountain:"\u26F2\uFE0F",fountain_pen:"\u{1F58B}",four_leaf_clover:"\u{1F340}",fox_face:"\u{1F98A}",framed_picture:"\u{1F5BC}",free:"\u{1F193}",fried_egg:"\u{1F373}",fried_shrimp:"\u{1F364}",fries:"\u{1F35F}",frog:"\u{1F438}",frowning:"\u{1F626}",frowning_face:"\u2639\uFE0F",frowning_man:"\u{1F64D}‍\u2642\uFE0F",frowning_woman:"\u{1F64D}",middle_finger:"\u{1F595}",fuelpump:"\u26FD\uFE0F",full_moon:"\u{1F315}",full_moon_with_face:"\u{1F31D}",funeral_urn:"\u26B1\uFE0F",game_die:"\u{1F3B2}",gear:"\u2699\uFE0F",gem:"\u{1F48E}",gemini:"\u264A\uFE0F",ghost:"\u{1F47B}",gift:"\u{1F381}",gift_heart:"\u{1F49D}",girl:"\u{1F467}",globe_with_meridians:"\u{1F310}",goal_net:"\u{1F945}",goat:"\u{1F410}",golf:"\u26F3\uFE0F",golfing_man:"\u{1F3CC}\uFE0F",golfing_woman:"\u{1F3CC}\uFE0F‍\u2640\uFE0F",gorilla:"\u{1F98D}",grapes:"\u{1F347}",green_apple:"\u{1F34F}",green_book:"\u{1F4D7}",green_heart:"\u{1F49A}",green_salad:"\u{1F957}",grey_exclamation:"\u2755",grey_question:"\u2754",grimacing:"\u{1F62C}",grin:"\u{1F601}",grinning:"\u{1F600}",guardsman:"\u{1F482}",guardswoman:"\u{1F482}‍\u2640\uFE0F",guitar:"\u{1F3B8}",gun:"\u{1F52B}",haircut_woman:"\u{1F487}",haircut_man:"\u{1F487}‍\u2642\uFE0F",hamburger:"\u{1F354}",hammer:"\u{1F528}",hammer_and_pick:"\u2692",hammer_and_wrench:"\u{1F6E0}",hamster:"\u{1F439}",hand:"\u270B",handbag:"\u{1F45C}",handshake:"\u{1F91D}",hankey:"\u{1F4A9}",hatched_chick:"\u{1F425}",hatching_chick:"\u{1F423}",headphones:"\u{1F3A7}",hear_no_evil:"\u{1F649}",heart:"\u2764\uFE0F",heart_decoration:"\u{1F49F}",heart_eyes:"\u{1F60D}",heart_eyes_cat:"\u{1F63B}",heartbeat:"\u{1F493}",heartpulse:"\u{1F497}",hearts:"\u2665\uFE0F",heavy_check_mark:"\u2714\uFE0F",heavy_division_sign:"\u2797",heavy_dollar_sign:"\u{1F4B2}",heavy_heart_exclamation:"\u2763\uFE0F",heavy_minus_sign:"\u2796",heavy_multiplication_x:"\u2716\uFE0F",heavy_plus_sign:"\u2795",helicopter:"\u{1F681}",herb:"\u{1F33F}",hibiscus:"\u{1F33A}",high_brightness:"\u{1F506}",high_heel:"\u{1F460}",hocho:"\u{1F52A}",hole:"\u{1F573}",honey_pot:"\u{1F36F}",horse:"\u{1F434}",horse_racing:"\u{1F3C7}",hospital:"\u{1F3E5}",hot_pepper:"\u{1F336}",hotdog:"\u{1F32D}",hotel:"\u{1F3E8}",hotsprings:"\u2668\uFE0F",hourglass:"\u231B\uFE0F",hourglass_flowing_sand:"\u23F3",house:"\u{1F3E0}",house_with_garden:"\u{1F3E1}",houses:"\u{1F3D8}",hugs:"\u{1F917}",hushed:"\u{1F62F}",ice_cream:"\u{1F368}",ice_hockey:"\u{1F3D2}",ice_skate:"\u26F8",icecream:"\u{1F366}",id:"\u{1F194}",ideograph_advantage:"\u{1F250}",imp:"\u{1F47F}",inbox_tray:"\u{1F4E5}",incoming_envelope:"\u{1F4E8}",tipping_hand_woman:"\u{1F481}",information_source:"\u2139\uFE0F",innocent:"\u{1F607}",interrobang:"\u2049\uFE0F",iphone:"\u{1F4F1}",izakaya_lantern:"\u{1F3EE}",jack_o_lantern:"\u{1F383}",japan:"\u{1F5FE}",japanese_castle:"\u{1F3EF}",japanese_goblin:"\u{1F47A}",japanese_ogre:"\u{1F479}",jeans:"\u{1F456}",joy:"\u{1F602}",joy_cat:"\u{1F639}",joystick:"\u{1F579}",kaaba:"\u{1F54B}",key:"\u{1F511}",keyboard:"\u2328\uFE0F",keycap_ten:"\u{1F51F}",kick_scooter:"\u{1F6F4}",kimono:"\u{1F458}",kiss:"\u{1F48B}",kissing:"\u{1F617}",kissing_cat:"\u{1F63D}",kissing_closed_eyes:"\u{1F61A}",kissing_heart:"\u{1F618}",kissing_smiling_eyes:"\u{1F619}",kiwi_fruit:"\u{1F95D}",koala:"\u{1F428}",koko:"\u{1F201}",label:"\u{1F3F7}",large_blue_circle:"\u{1F535}",large_blue_diamond:"\u{1F537}",large_orange_diamond:"\u{1F536}",last_quarter_moon:"\u{1F317}",last_quarter_moon_with_face:"\u{1F31C}",latin_cross:"\u271D\uFE0F",laughing:"\u{1F606}",leaves:"\u{1F343}",ledger:"\u{1F4D2}",left_luggage:"\u{1F6C5}",left_right_arrow:"\u2194\uFE0F",leftwards_arrow_with_hook:"\u21A9\uFE0F",lemon:"\u{1F34B}",leo:"\u264C\uFE0F",leopard:"\u{1F406}",level_slider:"\u{1F39A}",libra:"\u264E\uFE0F",light_rail:"\u{1F688}",link:"\u{1F517}",lion:"\u{1F981}",lips:"\u{1F444}",lipstick:"\u{1F484}",lizard:"\u{1F98E}",lock:"\u{1F512}",lock_with_ink_pen:"\u{1F50F}",lollipop:"\u{1F36D}",loop:"\u27BF",loud_sound:"\u{1F50A}",loudspeaker:"\u{1F4E2}",love_hotel:"\u{1F3E9}",love_letter:"\u{1F48C}",low_brightness:"\u{1F505}",lying_face:"\u{1F925}",m:"\u24C2\uFE0F",mag:"\u{1F50D}",mag_right:"\u{1F50E}",mahjong:"\u{1F004}\uFE0F",mailbox:"\u{1F4EB}",mailbox_closed:"\u{1F4EA}",mailbox_with_mail:"\u{1F4EC}",mailbox_with_no_mail:"\u{1F4ED}",man:"\u{1F468}",man_artist:"\u{1F468}‍\u{1F3A8}",man_astronaut:"\u{1F468}‍\u{1F680}",man_cartwheeling:"\u{1F938}‍\u2642\uFE0F",man_cook:"\u{1F468}‍\u{1F373}",man_dancing:"\u{1F57A}",man_facepalming:"\u{1F926}‍\u2642\uFE0F",man_factory_worker:"\u{1F468}‍\u{1F3ED}",man_farmer:"\u{1F468}‍\u{1F33E}",man_firefighter:"\u{1F468}‍\u{1F692}",man_health_worker:"\u{1F468}‍\u2695\uFE0F",man_in_tuxedo:"\u{1F935}",man_judge:"\u{1F468}‍\u2696\uFE0F",man_juggling:"\u{1F939}‍\u2642\uFE0F",man_mechanic:"\u{1F468}‍\u{1F527}",man_office_worker:"\u{1F468}‍\u{1F4BC}",man_pilot:"\u{1F468}‍\u2708\uFE0F",man_playing_handball:"\u{1F93E}‍\u2642\uFE0F",man_playing_water_polo:"\u{1F93D}‍\u2642\uFE0F",man_scientist:"\u{1F468}‍\u{1F52C}",man_shrugging:"\u{1F937}‍\u2642\uFE0F",man_singer:"\u{1F468}‍\u{1F3A4}",man_student:"\u{1F468}‍\u{1F393}",man_teacher:"\u{1F468}‍\u{1F3EB}",man_technologist:"\u{1F468}‍\u{1F4BB}",man_with_gua_pi_mao:"\u{1F472}",man_with_turban:"\u{1F473}",tangerine:"\u{1F34A}",mans_shoe:"\u{1F45E}",mantelpiece_clock:"\u{1F570}",maple_leaf:"\u{1F341}",martial_arts_uniform:"\u{1F94B}",mask:"\u{1F637}",massage_woman:"\u{1F486}",massage_man:"\u{1F486}‍\u2642\uFE0F",meat_on_bone:"\u{1F356}",medal_military:"\u{1F396}",medal_sports:"\u{1F3C5}",mega:"\u{1F4E3}",melon:"\u{1F348}",memo:"\u{1F4DD}",men_wrestling:"\u{1F93C}‍\u2642\uFE0F",menorah:"\u{1F54E}",mens:"\u{1F6B9}",metal:"\u{1F918}",metro:"\u{1F687}",microphone:"\u{1F3A4}",microscope:"\u{1F52C}",milk_glass:"\u{1F95B}",milky_way:"\u{1F30C}",minibus:"\u{1F690}",minidisc:"\u{1F4BD}",mobile_phone_off:"\u{1F4F4}",money_mouth_face:"\u{1F911}",money_with_wings:"\u{1F4B8}",moneybag:"\u{1F4B0}",monkey:"\u{1F412}",monkey_face:"\u{1F435}",monorail:"\u{1F69D}",moon:"\u{1F314}",mortar_board:"\u{1F393}",mosque:"\u{1F54C}",motor_boat:"\u{1F6E5}",motor_scooter:"\u{1F6F5}",motorcycle:"\u{1F3CD}",motorway:"\u{1F6E3}",mount_fuji:"\u{1F5FB}",mountain:"\u26F0",mountain_biking_man:"\u{1F6B5}",mountain_biking_woman:"\u{1F6B5}‍\u2640\uFE0F",mountain_cableway:"\u{1F6A0}",mountain_railway:"\u{1F69E}",mountain_snow:"\u{1F3D4}",mouse:"\u{1F42D}",mouse2:"\u{1F401}",movie_camera:"\u{1F3A5}",moyai:"\u{1F5FF}",mrs_claus:"\u{1F936}",muscle:"\u{1F4AA}",mushroom:"\u{1F344}",musical_keyboard:"\u{1F3B9}",musical_note:"\u{1F3B5}",musical_score:"\u{1F3BC}",mute:"\u{1F507}",nail_care:"\u{1F485}",name_badge:"\u{1F4DB}",national_park:"\u{1F3DE}",nauseated_face:"\u{1F922}",necktie:"\u{1F454}",negative_squared_cross_mark:"\u274E",nerd_face:"\u{1F913}",neutral_face:"\u{1F610}",new:"\u{1F195}",new_moon:"\u{1F311}",new_moon_with_face:"\u{1F31A}",newspaper:"\u{1F4F0}",newspaper_roll:"\u{1F5DE}",next_track_button:"\u23ED",ng:"\u{1F196}",no_good_man:"\u{1F645}‍\u2642\uFE0F",no_good_woman:"\u{1F645}",night_with_stars:"\u{1F303}",no_bell:"\u{1F515}",no_bicycles:"\u{1F6B3}",no_entry:"\u26D4\uFE0F",no_entry_sign:"\u{1F6AB}",no_mobile_phones:"\u{1F4F5}",no_mouth:"\u{1F636}",no_pedestrians:"\u{1F6B7}",no_smoking:"\u{1F6AD}","non-potable_water":"\u{1F6B1}",nose:"\u{1F443}",notebook:"\u{1F4D3}",notebook_with_decorative_cover:"\u{1F4D4}",notes:"\u{1F3B6}",nut_and_bolt:"\u{1F529}",o:"\u2B55\uFE0F",o2:"\u{1F17E}\uFE0F",ocean:"\u{1F30A}",octopus:"\u{1F419}",oden:"\u{1F362}",office:"\u{1F3E2}",oil_drum:"\u{1F6E2}",ok:"\u{1F197}",ok_hand:"\u{1F44C}",ok_man:"\u{1F646}‍\u2642\uFE0F",ok_woman:"\u{1F646}",old_key:"\u{1F5DD}",older_man:"\u{1F474}",older_woman:"\u{1F475}",om:"\u{1F549}",on:"\u{1F51B}",oncoming_automobile:"\u{1F698}",oncoming_bus:"\u{1F68D}",oncoming_police_car:"\u{1F694}",oncoming_taxi:"\u{1F696}",open_file_folder:"\u{1F4C2}",open_hands:"\u{1F450}",open_mouth:"\u{1F62E}",open_umbrella:"\u2602\uFE0F",ophiuchus:"\u26CE",orange_book:"\u{1F4D9}",orthodox_cross:"\u2626\uFE0F",outbox_tray:"\u{1F4E4}",owl:"\u{1F989}",ox:"\u{1F402}",package:"\u{1F4E6}",page_facing_up:"\u{1F4C4}",page_with_curl:"\u{1F4C3}",pager:"\u{1F4DF}",paintbrush:"\u{1F58C}",palm_tree:"\u{1F334}",pancakes:"\u{1F95E}",panda_face:"\u{1F43C}",paperclip:"\u{1F4CE}",paperclips:"\u{1F587}",parasol_on_ground:"\u26F1",parking:"\u{1F17F}\uFE0F",part_alternation_mark:"\u303D\uFE0F",partly_sunny:"\u26C5\uFE0F",passenger_ship:"\u{1F6F3}",passport_control:"\u{1F6C2}",pause_button:"\u23F8",peace_symbol:"\u262E\uFE0F",peach:"\u{1F351}",peanuts:"\u{1F95C}",pear:"\u{1F350}",pen:"\u{1F58A}",pencil2:"\u270F\uFE0F",penguin:"\u{1F427}",pensive:"\u{1F614}",performing_arts:"\u{1F3AD}",persevere:"\u{1F623}",person_fencing:"\u{1F93A}",pouting_woman:"\u{1F64E}",phone:"\u260E\uFE0F",pick:"\u26CF",pig:"\u{1F437}",pig2:"\u{1F416}",pig_nose:"\u{1F43D}",pill:"\u{1F48A}",pineapple:"\u{1F34D}",ping_pong:"\u{1F3D3}",pisces:"\u2653\uFE0F",pizza:"\u{1F355}",place_of_worship:"\u{1F6D0}",plate_with_cutlery:"\u{1F37D}",play_or_pause_button:"\u23EF",point_down:"\u{1F447}",point_left:"\u{1F448}",point_right:"\u{1F449}",point_up:"\u261D\uFE0F",point_up_2:"\u{1F446}",police_car:"\u{1F693}",policewoman:"\u{1F46E}‍\u2640\uFE0F",poodle:"\u{1F429}",popcorn:"\u{1F37F}",post_office:"\u{1F3E3}",postal_horn:"\u{1F4EF}",postbox:"\u{1F4EE}",potable_water:"\u{1F6B0}",potato:"\u{1F954}",pouch:"\u{1F45D}",poultry_leg:"\u{1F357}",pound:"\u{1F4B7}",rage:"\u{1F621}",pouting_cat:"\u{1F63E}",pouting_man:"\u{1F64E}‍\u2642\uFE0F",pray:"\u{1F64F}",prayer_beads:"\u{1F4FF}",pregnant_woman:"\u{1F930}",previous_track_button:"\u23EE",prince:"\u{1F934}",princess:"\u{1F478}",printer:"\u{1F5A8}",purple_heart:"\u{1F49C}",purse:"\u{1F45B}",pushpin:"\u{1F4CC}",put_litter_in_its_place:"\u{1F6AE}",question:"\u2753",rabbit:"\u{1F430}",rabbit2:"\u{1F407}",racehorse:"\u{1F40E}",racing_car:"\u{1F3CE}",radio:"\u{1F4FB}",radio_button:"\u{1F518}",radioactive:"\u2622\uFE0F",railway_car:"\u{1F683}",railway_track:"\u{1F6E4}",rainbow:"\u{1F308}",rainbow_flag:"\u{1F3F3}\uFE0F‍\u{1F308}",raised_back_of_hand:"\u{1F91A}",raised_hand_with_fingers_splayed:"\u{1F590}",raised_hands:"\u{1F64C}",raising_hand_woman:"\u{1F64B}",raising_hand_man:"\u{1F64B}‍\u2642\uFE0F",ram:"\u{1F40F}",ramen:"\u{1F35C}",rat:"\u{1F400}",record_button:"\u23FA",recycle:"\u267B\uFE0F",red_circle:"\u{1F534}",registered:"\xAE\uFE0F",relaxed:"\u263A\uFE0F",relieved:"\u{1F60C}",reminder_ribbon:"\u{1F397}",repeat:"\u{1F501}",repeat_one:"\u{1F502}",rescue_worker_helmet:"\u26D1",restroom:"\u{1F6BB}",revolving_hearts:"\u{1F49E}",rewind:"\u23EA",rhinoceros:"\u{1F98F}",ribbon:"\u{1F380}",rice:"\u{1F35A}",rice_ball:"\u{1F359}",rice_cracker:"\u{1F358}",rice_scene:"\u{1F391}",right_anger_bubble:"\u{1F5EF}",ring:"\u{1F48D}",robot:"\u{1F916}",rocket:"\u{1F680}",rofl:"\u{1F923}",roll_eyes:"\u{1F644}",roller_coaster:"\u{1F3A2}",rooster:"\u{1F413}",rose:"\u{1F339}",rosette:"\u{1F3F5}",rotating_light:"\u{1F6A8}",round_pushpin:"\u{1F4CD}",rowing_man:"\u{1F6A3}",rowing_woman:"\u{1F6A3}‍\u2640\uFE0F",rugby_football:"\u{1F3C9}",running_man:"\u{1F3C3}",running_shirt_with_sash:"\u{1F3BD}",running_woman:"\u{1F3C3}‍\u2640\uFE0F",sa:"\u{1F202}\uFE0F",sagittarius:"\u2650\uFE0F",sake:"\u{1F376}",sandal:"\u{1F461}",santa:"\u{1F385}",satellite:"\u{1F4E1}",saxophone:"\u{1F3B7}",school:"\u{1F3EB}",school_satchel:"\u{1F392}",scissors:"\u2702\uFE0F",scorpion:"\u{1F982}",scorpius:"\u264F\uFE0F",scream:"\u{1F631}",scream_cat:"\u{1F640}",scroll:"\u{1F4DC}",seat:"\u{1F4BA}",secret:"\u3299\uFE0F",see_no_evil:"\u{1F648}",seedling:"\u{1F331}",selfie:"\u{1F933}",shallow_pan_of_food:"\u{1F958}",shamrock:"\u2618\uFE0F",shark:"\u{1F988}",shaved_ice:"\u{1F367}",sheep:"\u{1F411}",shell:"\u{1F41A}",shield:"\u{1F6E1}",shinto_shrine:"\u26E9",ship:"\u{1F6A2}",shirt:"\u{1F455}",shopping:"\u{1F6CD}",shopping_cart:"\u{1F6D2}",shower:"\u{1F6BF}",shrimp:"\u{1F990}",signal_strength:"\u{1F4F6}",six_pointed_star:"\u{1F52F}",ski:"\u{1F3BF}",skier:"\u26F7",skull:"\u{1F480}",skull_and_crossbones:"\u2620\uFE0F",sleeping:"\u{1F634}",sleeping_bed:"\u{1F6CC}",sleepy:"\u{1F62A}",slightly_frowning_face:"\u{1F641}",slightly_smiling_face:"\u{1F642}",slot_machine:"\u{1F3B0}",small_airplane:"\u{1F6E9}",small_blue_diamond:"\u{1F539}",small_orange_diamond:"\u{1F538}",small_red_triangle:"\u{1F53A}",small_red_triangle_down:"\u{1F53B}",smile:"\u{1F604}",smile_cat:"\u{1F638}",smiley:"\u{1F603}",smiley_cat:"\u{1F63A}",smiling_imp:"\u{1F608}",smirk:"\u{1F60F}",smirk_cat:"\u{1F63C}",smoking:"\u{1F6AC}",snail:"\u{1F40C}",snake:"\u{1F40D}",sneezing_face:"\u{1F927}",snowboarder:"\u{1F3C2}",snowflake:"\u2744\uFE0F",snowman:"\u26C4\uFE0F",snowman_with_snow:"\u2603\uFE0F",sob:"\u{1F62D}",soccer:"\u26BD\uFE0F",soon:"\u{1F51C}",sos:"\u{1F198}",sound:"\u{1F509}",space_invader:"\u{1F47E}",spades:"\u2660\uFE0F",spaghetti:"\u{1F35D}",sparkle:"\u2747\uFE0F",sparkler:"\u{1F387}",sparkles:"\u2728",sparkling_heart:"\u{1F496}",speak_no_evil:"\u{1F64A}",speaker:"\u{1F508}",speaking_head:"\u{1F5E3}",speech_balloon:"\u{1F4AC}",speedboat:"\u{1F6A4}",spider:"\u{1F577}",spider_web:"\u{1F578}",spiral_calendar:"\u{1F5D3}",spiral_notepad:"\u{1F5D2}",spoon:"\u{1F944}",squid:"\u{1F991}",stadium:"\u{1F3DF}",star:"\u2B50\uFE0F",star2:"\u{1F31F}",star_and_crescent:"\u262A\uFE0F",star_of_david:"\u2721\uFE0F",stars:"\u{1F320}",station:"\u{1F689}",statue_of_liberty:"\u{1F5FD}",steam_locomotive:"\u{1F682}",stew:"\u{1F372}",stop_button:"\u23F9",stop_sign:"\u{1F6D1}",stopwatch:"\u23F1",straight_ruler:"\u{1F4CF}",strawberry:"\u{1F353}",stuck_out_tongue:"\u{1F61B}",stuck_out_tongue_closed_eyes:"\u{1F61D}",stuck_out_tongue_winking_eye:"\u{1F61C}",studio_microphone:"\u{1F399}",stuffed_flatbread:"\u{1F959}",sun_behind_large_cloud:"\u{1F325}",sun_behind_rain_cloud:"\u{1F326}",sun_behind_small_cloud:"\u{1F324}",sun_with_face:"\u{1F31E}",sunflower:"\u{1F33B}",sunglasses:"\u{1F60E}",sunny:"\u2600\uFE0F",sunrise:"\u{1F305}",sunrise_over_mountains:"\u{1F304}",surfing_man:"\u{1F3C4}",surfing_woman:"\u{1F3C4}‍\u2640\uFE0F",sushi:"\u{1F363}",suspension_railway:"\u{1F69F}",sweat:"\u{1F613}",sweat_drops:"\u{1F4A6}",sweat_smile:"\u{1F605}",sweet_potato:"\u{1F360}",swimming_man:"\u{1F3CA}",swimming_woman:"\u{1F3CA}‍\u2640\uFE0F",symbols:"\u{1F523}",synagogue:"\u{1F54D}",syringe:"\u{1F489}",taco:"\u{1F32E}",tada:"\u{1F389}",tanabata_tree:"\u{1F38B}",taurus:"\u2649\uFE0F",taxi:"\u{1F695}",tea:"\u{1F375}",telephone_receiver:"\u{1F4DE}",telescope:"\u{1F52D}",tennis:"\u{1F3BE}",tent:"\u26FA\uFE0F",thermometer:"\u{1F321}",thinking:"\u{1F914}",thought_balloon:"\u{1F4AD}",ticket:"\u{1F3AB}",tickets:"\u{1F39F}",tiger:"\u{1F42F}",tiger2:"\u{1F405}",timer_clock:"\u23F2",tipping_hand_man:"\u{1F481}‍\u2642\uFE0F",tired_face:"\u{1F62B}",tm:"\u2122\uFE0F",toilet:"\u{1F6BD}",tokyo_tower:"\u{1F5FC}",tomato:"\u{1F345}",tongue:"\u{1F445}",top:"\u{1F51D}",tophat:"\u{1F3A9}",tornado:"\u{1F32A}",trackball:"\u{1F5B2}",tractor:"\u{1F69C}",traffic_light:"\u{1F6A5}",train:"\u{1F68B}",train2:"\u{1F686}",tram:"\u{1F68A}",triangular_flag_on_post:"\u{1F6A9}",triangular_ruler:"\u{1F4D0}",trident:"\u{1F531}",triumph:"\u{1F624}",trolleybus:"\u{1F68E}",trophy:"\u{1F3C6}",tropical_drink:"\u{1F379}",tropical_fish:"\u{1F420}",truck:"\u{1F69A}",trumpet:"\u{1F3BA}",tulip:"\u{1F337}",tumbler_glass:"\u{1F943}",turkey:"\u{1F983}",turtle:"\u{1F422}",tv:"\u{1F4FA}",twisted_rightwards_arrows:"\u{1F500}",two_hearts:"\u{1F495}",two_men_holding_hands:"\u{1F46C}",two_women_holding_hands:"\u{1F46D}",u5272:"\u{1F239}",u5408:"\u{1F234}",u55b6:"\u{1F23A}",u6307:"\u{1F22F}\uFE0F",u6708:"\u{1F237}\uFE0F",u6709:"\u{1F236}",u6e80:"\u{1F235}",u7121:"\u{1F21A}\uFE0F",u7533:"\u{1F238}",u7981:"\u{1F232}",u7a7a:"\u{1F233}",umbrella:"\u2614\uFE0F",unamused:"\u{1F612}",underage:"\u{1F51E}",unicorn:"\u{1F984}",unlock:"\u{1F513}",up:"\u{1F199}",upside_down_face:"\u{1F643}",v:"\u270C\uFE0F",vertical_traffic_light:"\u{1F6A6}",vhs:"\u{1F4FC}",vibration_mode:"\u{1F4F3}",video_camera:"\u{1F4F9}",video_game:"\u{1F3AE}",violin:"\u{1F3BB}",virgo:"\u264D\uFE0F",volcano:"\u{1F30B}",volleyball:"\u{1F3D0}",vs:"\u{1F19A}",vulcan_salute:"\u{1F596}",walking_man:"\u{1F6B6}",walking_woman:"\u{1F6B6}‍\u2640\uFE0F",waning_crescent_moon:"\u{1F318}",waning_gibbous_moon:"\u{1F316}",warning:"\u26A0\uFE0F",wastebasket:"\u{1F5D1}",watch:"\u231A\uFE0F",water_buffalo:"\u{1F403}",watermelon:"\u{1F349}",wave:"\u{1F44B}",wavy_dash:"\u3030\uFE0F",waxing_crescent_moon:"\u{1F312}",wc:"\u{1F6BE}",weary:"\u{1F629}",wedding:"\u{1F492}",weight_lifting_man:"\u{1F3CB}\uFE0F",weight_lifting_woman:"\u{1F3CB}\uFE0F‍\u2640\uFE0F",whale:"\u{1F433}",whale2:"\u{1F40B}",wheel_of_dharma:"\u2638\uFE0F",wheelchair:"\u267F\uFE0F",white_check_mark:"\u2705",white_circle:"\u26AA\uFE0F",white_flag:"\u{1F3F3}\uFE0F",white_flower:"\u{1F4AE}",white_large_square:"\u2B1C\uFE0F",white_medium_small_square:"\u25FD\uFE0F",white_medium_square:"\u25FB\uFE0F",white_small_square:"\u25AB\uFE0F",white_square_button:"\u{1F533}",wilted_flower:"\u{1F940}",wind_chime:"\u{1F390}",wind_face:"\u{1F32C}",wine_glass:"\u{1F377}",wink:"\u{1F609}",wolf:"\u{1F43A}",woman:"\u{1F469}",woman_artist:"\u{1F469}‍\u{1F3A8}",woman_astronaut:"\u{1F469}‍\u{1F680}",woman_cartwheeling:"\u{1F938}‍\u2640\uFE0F",woman_cook:"\u{1F469}‍\u{1F373}",woman_facepalming:"\u{1F926}‍\u2640\uFE0F",woman_factory_worker:"\u{1F469}‍\u{1F3ED}",woman_farmer:"\u{1F469}‍\u{1F33E}",woman_firefighter:"\u{1F469}‍\u{1F692}",woman_health_worker:"\u{1F469}‍\u2695\uFE0F",woman_judge:"\u{1F469}‍\u2696\uFE0F",woman_juggling:"\u{1F939}‍\u2640\uFE0F",woman_mechanic:"\u{1F469}‍\u{1F527}",woman_office_worker:"\u{1F469}‍\u{1F4BC}",woman_pilot:"\u{1F469}‍\u2708\uFE0F",woman_playing_handball:"\u{1F93E}‍\u2640\uFE0F",woman_playing_water_polo:"\u{1F93D}‍\u2640\uFE0F",woman_scientist:"\u{1F469}‍\u{1F52C}",woman_shrugging:"\u{1F937}‍\u2640\uFE0F",woman_singer:"\u{1F469}‍\u{1F3A4}",woman_student:"\u{1F469}‍\u{1F393}",woman_teacher:"\u{1F469}‍\u{1F3EB}",woman_technologist:"\u{1F469}‍\u{1F4BB}",woman_with_turban:"\u{1F473}‍\u2640\uFE0F",womans_clothes:"\u{1F45A}",womans_hat:"\u{1F452}",women_wrestling:"\u{1F93C}‍\u2640\uFE0F",womens:"\u{1F6BA}",world_map:"\u{1F5FA}",worried:"\u{1F61F}",wrench:"\u{1F527}",writing_hand:"\u270D\uFE0F",x:"\u274C",yellow_heart:"\u{1F49B}",yen:"\u{1F4B4}",yin_yang:"\u262F\uFE0F",yum:"\u{1F60B}",zap:"\u26A1\uFE0F",zipper_mouth_face:"\u{1F910}",zzz:"\u{1F4A4}",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:`<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`},n.Converter=function(f){"use strict";var p={},w=[],v=[],S={},$=a,P={parsed:{},raw:"",format:""};M();function M(){f=f||{};for(var x in i)i.hasOwnProperty(x)&&(p[x]=i[x]);if(typeof f=="object")for(var z in f)f.hasOwnProperty(z)&&(p[z]=f[z]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof f+" was passed instead.");p.extensions&&n.helper.forEach(p.extensions,N)}function N(x,z){if(z=z||null,n.helper.isString(x))if(x=n.helper.stdExtName(x),z=x,n.extensions[x]){console.warn("DEPRECATION WARNING: "+x+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),B(n.extensions[x],x);return}else if(!n.helper.isUndefined(o[x]))x=o[x];else throw Error('Extension "'+x+'" could not be loaded. It was either not found or is not a valid extension.');typeof x=="function"&&(x=x()),n.helper.isArray(x)||(x=[x]);var V=d(x,z);if(!V.valid)throw Error(V.error);for(var K=0;K<x.length;++K){switch(x[K].type){case"lang":w.push(x[K]);break;case"output":v.push(x[K]);break}if(x[K].hasOwnProperty("listeners"))for(var Z in x[K].listeners)x[K].listeners.hasOwnProperty(Z)&&F(Z,x[K].listeners[Z])}}function B(x,z){typeof x=="function"&&(x=x(new n.Converter)),n.helper.isArray(x)||(x=[x]);var V=d(x,z);if(!V.valid)throw Error(V.error);for(var K=0;K<x.length;++K)switch(x[K].type){case"lang":w.push(x[K]);break;case"output":v.push(x[K]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}function F(x,z){if(!n.helper.isString(x))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof x+" given");if(typeof z!="function")throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof z+" given");S.hasOwnProperty(x)||(S[x]=[]),S[x].push(z)}function q(x){var z=x.match(/^\s*/)[0].length,V=new RegExp("^\\s{0,"+z+"}","gm");return x.replace(V,"")}this._dispatch=function(z,V,K,Z){if(S.hasOwnProperty(z))for(var W=0;W<S[z].length;++W){var J=S[z][W](z,V,this,K,Z);J&&typeof J<"u"&&(V=J)}return V},this.listen=function(x,z){return F(x,z),this},this.makeHtml=function(x){if(!x)return x;var z={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:w,outputModifiers:v,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return x=x.replace(/¨/g,"\xA8T"),x=x.replace(/\$/g,"\xA8D"),x=x.replace(/\r\n/g,`
|
|
`),x=x.replace(/\r/g,`
|
|
`),x=x.replace(/\u00A0/g," "),p.smartIndentationFix&&(x=q(x)),x=`
|
|
|
|
`+x+`
|
|
|
|
`,x=n.subParser("detab")(x,p,z),x=x.replace(/^[ \t]+$/mg,""),n.helper.forEach(w,function(V){x=n.subParser("runExtension")(V,x,p,z)}),x=n.subParser("metadata")(x,p,z),x=n.subParser("hashPreCodeTags")(x,p,z),x=n.subParser("githubCodeBlocks")(x,p,z),x=n.subParser("hashHTMLBlocks")(x,p,z),x=n.subParser("hashCodeTags")(x,p,z),x=n.subParser("stripLinkDefinitions")(x,p,z),x=n.subParser("blockGamut")(x,p,z),x=n.subParser("unhashHTMLSpans")(x,p,z),x=n.subParser("unescapeSpecialChars")(x,p,z),x=x.replace(/¨D/g,"$$"),x=x.replace(/¨T/g,"\xA8"),x=n.subParser("completeHTMLDocument")(x,p,z),n.helper.forEach(v,function(V){x=n.subParser("runExtension")(V,x,p,z)}),P=z.metadata,x},this.makeMarkdown=this.makeMd=function(x,z){if(x=x.replace(/\r\n/g,`
|
|
`),x=x.replace(/\r/g,`
|
|
`),x=x.replace(/>[ \t]+</,">\xA8NBSP;<"),!z)if(window&&window.document)z=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var V=z.createElement("div");V.innerHTML=x;var K={preList:_e(V)};de(V);for(var Z=V.childNodes,W="",J=0;J<Z.length;J++)W+=n.subParser("makeMarkdown.node")(Z[J],K);function de(ve){for(var Pe=0;Pe<ve.childNodes.length;++Pe){var ie=ve.childNodes[Pe];ie.nodeType===3?!/\S/.test(ie.nodeValue)&&!/^[ ]+$/.test(ie.nodeValue)?(ve.removeChild(ie),--Pe):(ie.nodeValue=ie.nodeValue.split(`
|
|
`).join(" "),ie.nodeValue=ie.nodeValue.replace(/(\s)+/g,"$1")):ie.nodeType===1&&de(ie)}}function _e(ve){for(var Pe=ve.querySelectorAll("pre"),ie=[],Se=0;Se<Pe.length;++Se)if(Pe[Se].childElementCount===1&&Pe[Se].firstChild.tagName.toLowerCase()==="code"){var Ve=Pe[Se].firstChild.innerHTML.trim(),Re=Pe[Se].firstChild.getAttribute("data-language")||"";if(Re==="")for(var je=Pe[Se].firstChild.className.split(" "),Et=0;Et<je.length;++Et){var Qe=je[Et].match(/^language-(.+)$/);if(Qe!==null){Re=Qe[1];break}}Ve=n.helper.unescapeHTMLEntities(Ve),ie.push(Ve),Pe[Se].outerHTML='<precode language="'+Re+'" precodenum="'+Se.toString()+'"></precode>'}else ie.push(Pe[Se].innerHTML),Pe[Se].innerHTML="",Pe[Se].setAttribute("prenum",Se.toString());return ie}return W},this.setOption=function(x,z){p[x]=z},this.getOption=function(x){return p[x]},this.getOptions=function(){return p},this.addExtension=function(x,z){z=z||null,N(x,z)},this.useExtension=function(x){N(x)},this.setFlavor=function(x){if(!u.hasOwnProperty(x))throw Error(x+" flavor was not found");var z=u[x];$=x;for(var V in z)z.hasOwnProperty(V)&&(p[V]=z[V])},this.getFlavor=function(){return $},this.removeExtension=function(x){n.helper.isArray(x)||(x=[x]);for(var z=0;z<x.length;++z){for(var V=x[z],K=0;K<w.length;++K)w[K]===V&&w.splice(K,1);for(var Z=0;Z<v.length;++Z)v[Z]===V&&v.splice(Z,1)}},this.getAllExtensions=function(){return{language:w,output:v}},this.getMetadata=function(x){return x?P.raw:P.parsed},this.getMetadataFormat=function(){return P.format},this._setMetadataPair=function(x,z){P.parsed[x]=z},this._setMetadataFormat=function(x){P.format=x},this._setMetadataRaw=function(x){P.raw=x}},n.subParser("anchors",function(f,p,w){"use strict";f=w.converter._dispatch("anchors.before",f,p,w);var v=function(S,$,P,M,N,B,F){if(n.helper.isUndefined(F)&&(F=""),P=P.toLowerCase(),S.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)M="";else if(!M)if(P||(P=$.toLowerCase().replace(/ ?\n/g," ")),M="#"+P,!n.helper.isUndefined(w.gUrls[P]))M=w.gUrls[P],n.helper.isUndefined(w.gTitles[P])||(F=w.gTitles[P]);else return S;M=M.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var q='<a href="'+M+'"';return F!==""&&F!==null&&(F=F.replace(/"/g,"""),F=F.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),q+=' title="'+F+'"'),p.openLinksInNewWindow&&!/^#/.test(M)&&(q+=' rel="noopener noreferrer" target="\xA8E95Eblank"'),q+=">"+$+"</a>",q};return f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,v),f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,v),f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,v),f=f.replace(/\[([^\[\]]+)]()()()()()/g,v),p.ghMentions&&(f=f.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(S,$,P,M,N){if(P==="\\")return $+M;if(!n.helper.isString(p.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var B=p.ghMentionsLink.replace(/\{u}/g,N),F="";return p.openLinksInNewWindow&&(F=' rel="noopener noreferrer" target="\xA8E95Eblank"'),$+'<a href="'+B+'"'+F+">"+M+"</a>"})),f=w.converter._dispatch("anchors.after",f,p,w),f});var b=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,_=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,T=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,A=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,k=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,I=function(f){"use strict";return function(p,w,v,S,$,P,M){v=v.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var N=v,B="",F="",q=w||"",x=M||"";return/^www\./i.test(v)&&(v=v.replace(/^www\./i,"http://www.")),f.excludeTrailingPunctuationFromURLs&&P&&(B=P),f.openLinksInNewWindow&&(F=' rel="noopener noreferrer" target="\xA8E95Eblank"'),q+'<a href="'+v+'"'+F+">"+N+"</a>"+B+x}},O=function(f,p){"use strict";return function(w,v,S){var $="mailto:";return v=v||"",S=n.subParser("unescapeSpecialChars")(S,f,p),f.encodeEmails?($=n.helper.encodeEmailAddress($+S),S=n.helper.encodeEmailAddress(S)):$=$+S,v+'<a href="'+$+'">'+S+"</a>"}};n.subParser("autoLinks",function(f,p,w){"use strict";return f=w.converter._dispatch("autoLinks.before",f,p,w),f=f.replace(T,I(p)),f=f.replace(k,O(p,w)),f=w.converter._dispatch("autoLinks.after",f,p,w),f}),n.subParser("simplifiedAutoLinks",function(f,p,w){"use strict";return p.simplifiedAutoLink&&(f=w.converter._dispatch("simplifiedAutoLinks.before",f,p,w),p.excludeTrailingPunctuationFromURLs?f=f.replace(_,I(p)):f=f.replace(b,I(p)),f=f.replace(A,O(p,w)),f=w.converter._dispatch("simplifiedAutoLinks.after",f,p,w)),f}),n.subParser("blockGamut",function(f,p,w){"use strict";return f=w.converter._dispatch("blockGamut.before",f,p,w),f=n.subParser("blockQuotes")(f,p,w),f=n.subParser("headers")(f,p,w),f=n.subParser("horizontalRule")(f,p,w),f=n.subParser("lists")(f,p,w),f=n.subParser("codeBlocks")(f,p,w),f=n.subParser("tables")(f,p,w),f=n.subParser("hashHTMLBlocks")(f,p,w),f=n.subParser("paragraphs")(f,p,w),f=w.converter._dispatch("blockGamut.after",f,p,w),f}),n.subParser("blockQuotes",function(f,p,w){"use strict";f=w.converter._dispatch("blockQuotes.before",f,p,w),f=f+`
|
|
|
|
`;var v=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return p.splitAdjacentBlockquotes&&(v=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),f=f.replace(v,function(S){return S=S.replace(/^[ \t]*>[ \t]?/gm,""),S=S.replace(/¨0/g,""),S=S.replace(/^[ \t]+$/gm,""),S=n.subParser("githubCodeBlocks")(S,p,w),S=n.subParser("blockGamut")(S,p,w),S=S.replace(/(^|\n)/g,"$1 "),S=S.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function($,P){var M=P;return M=M.replace(/^ /mg,"\xA80"),M=M.replace(/¨0/g,""),M}),n.subParser("hashBlock")(`<blockquote>
|
|
`+S+`
|
|
</blockquote>`,p,w)}),f=w.converter._dispatch("blockQuotes.after",f,p,w),f}),n.subParser("codeBlocks",function(f,p,w){"use strict";f=w.converter._dispatch("codeBlocks.before",f,p,w),f+="\xA80";var v=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return f=f.replace(v,function(S,$,P){var M=$,N=P,B=`
|
|
`;return M=n.subParser("outdent")(M,p,w),M=n.subParser("encodeCode")(M,p,w),M=n.subParser("detab")(M,p,w),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),p.omitExtraWLInCodeBlocks&&(B=""),M="<pre><code>"+M+B+"</code></pre>",n.subParser("hashBlock")(M,p,w)+N}),f=f.replace(/¨0/,""),f=w.converter._dispatch("codeBlocks.after",f,p,w),f}),n.subParser("codeSpans",function(f,p,w){"use strict";return f=w.converter._dispatch("codeSpans.before",f,p,w),typeof f>"u"&&(f=""),f=f.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(v,S,$,P){var M=P;return M=M.replace(/^([ \t]*)/g,""),M=M.replace(/[ \t]*$/g,""),M=n.subParser("encodeCode")(M,p,w),M=S+"<code>"+M+"</code>",M=n.subParser("hashHTMLSpans")(M,p,w),M}),f=w.converter._dispatch("codeSpans.after",f,p,w),f}),n.subParser("completeHTMLDocument",function(f,p,w){"use strict";if(!p.completeHTMLDocument)return f;f=w.converter._dispatch("completeHTMLDocument.before",f,p,w);var v="html",S=`<!DOCTYPE HTML>
|
|
`,$="",P=`<meta charset="utf-8">
|
|
`,M="",N="";typeof w.metadata.parsed.doctype<"u"&&(S="<!DOCTYPE "+w.metadata.parsed.doctype+`>
|
|
`,v=w.metadata.parsed.doctype.toString().toLowerCase(),(v==="html"||v==="html5")&&(P='<meta charset="utf-8">'));for(var B in w.metadata.parsed)if(w.metadata.parsed.hasOwnProperty(B))switch(B.toLowerCase()){case"doctype":break;case"title":$="<title>"+w.metadata.parsed.title+`</title>
|
|
`;break;case"charset":v==="html"||v==="html5"?P='<meta charset="'+w.metadata.parsed.charset+`">
|
|
`:P='<meta name="charset" content="'+w.metadata.parsed.charset+`">
|
|
`;break;case"language":case"lang":M=' lang="'+w.metadata.parsed[B]+'"',N+='<meta name="'+B+'" content="'+w.metadata.parsed[B]+`">
|
|
`;break;default:N+='<meta name="'+B+'" content="'+w.metadata.parsed[B]+`">
|
|
`}return f=S+"<html"+M+`>
|
|
<head>
|
|
`+$+P+N+`</head>
|
|
<body>
|
|
`+f.trim()+`
|
|
</body>
|
|
</html>`,f=w.converter._dispatch("completeHTMLDocument.after",f,p,w),f}),n.subParser("detab",function(f,p,w){"use strict";return f=w.converter._dispatch("detab.before",f,p,w),f=f.replace(/\t(?=\t)/g," "),f=f.replace(/\t/g,"\xA8A\xA8B"),f=f.replace(/¨B(.+?)¨A/g,function(v,S){for(var $=S,P=4-$.length%4,M=0;M<P;M++)$+=" ";return $}),f=f.replace(/¨A/g," "),f=f.replace(/¨B/g,""),f=w.converter._dispatch("detab.after",f,p,w),f}),n.subParser("ellipsis",function(f,p,w){"use strict";return p.ellipsis&&(f=w.converter._dispatch("ellipsis.before",f,p,w),f=f.replace(/\.\.\./g,"\u2026"),f=w.converter._dispatch("ellipsis.after",f,p,w)),f}),n.subParser("emoji",function(f,p,w){"use strict";if(!p.emoji)return f;f=w.converter._dispatch("emoji.before",f,p,w);var v=/:([\S]+?):/g;return f=f.replace(v,function(S,$){return n.helper.emojis.hasOwnProperty($)?n.helper.emojis[$]:S}),f=w.converter._dispatch("emoji.after",f,p,w),f}),n.subParser("encodeAmpsAndAngles",function(f,p,w){"use strict";return f=w.converter._dispatch("encodeAmpsAndAngles.before",f,p,w),f=f.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),f=f.replace(/<(?![a-z\/?$!])/gi,"<"),f=f.replace(/</g,"<"),f=f.replace(/>/g,">"),f=w.converter._dispatch("encodeAmpsAndAngles.after",f,p,w),f}),n.subParser("encodeBackslashEscapes",function(f,p,w){"use strict";return f=w.converter._dispatch("encodeBackslashEscapes.before",f,p,w),f=f.replace(/\\(\\)/g,n.helper.escapeCharactersCallback),f=f.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,n.helper.escapeCharactersCallback),f=w.converter._dispatch("encodeBackslashEscapes.after",f,p,w),f}),n.subParser("encodeCode",function(f,p,w){"use strict";return f=w.converter._dispatch("encodeCode.before",f,p,w),f=f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),f=w.converter._dispatch("encodeCode.after",f,p,w),f}),n.subParser("escapeSpecialCharsWithinTagAttributes",function(f,p,w){"use strict";f=w.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",f,p,w);var v=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,S=/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return f=f.replace(v,function($){return $.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),f=f.replace(S,function($){return $.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),f=w.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",f,p,w),f}),n.subParser("githubCodeBlocks",function(f,p,w){"use strict";return p.ghCodeBlocks?(f=w.converter._dispatch("githubCodeBlocks.before",f,p,w),f+="\xA80",f=f.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(v,S,$,P){var M=p.omitExtraWLInCodeBlocks?"":`
|
|
`;return P=n.subParser("encodeCode")(P,p,w),P=n.subParser("detab")(P,p,w),P=P.replace(/^\n+/g,""),P=P.replace(/\n+$/g,""),P="<pre><code"+($?' class="'+$+" language-"+$+'"':"")+">"+P+M+"</code></pre>",P=n.subParser("hashBlock")(P,p,w),`
|
|
|
|
\xA8G`+(w.ghCodeBlocks.push({text:v,codeblock:P})-1)+`G
|
|
|
|
`}),f=f.replace(/¨0/,""),w.converter._dispatch("githubCodeBlocks.after",f,p,w)):f}),n.subParser("hashBlock",function(f,p,w){"use strict";return f=w.converter._dispatch("hashBlock.before",f,p,w),f=f.replace(/(^\n+|\n+$)/g,""),f=`
|
|
|
|
\xA8K`+(w.gHtmlBlocks.push(f)-1)+`K
|
|
|
|
`,f=w.converter._dispatch("hashBlock.after",f,p,w),f}),n.subParser("hashCodeTags",function(f,p,w){"use strict";f=w.converter._dispatch("hashCodeTags.before",f,p,w);var v=function(S,$,P,M){var N=P+n.subParser("encodeCode")($,p,w)+M;return"\xA8C"+(w.gHtmlSpans.push(N)-1)+"C"};return f=n.helper.replaceRecursiveRegExp(f,v,"<code\\b[^>]*>","</code>","gim"),f=w.converter._dispatch("hashCodeTags.after",f,p,w),f}),n.subParser("hashElement",function(f,p,w){"use strict";return function(v,S){var $=S;return $=$.replace(/\n\n/g,`
|
|
`),$=$.replace(/^\n/,""),$=$.replace(/\n+$/g,""),$=`
|
|
|
|
\xA8K`+(w.gHtmlBlocks.push($)-1)+`K
|
|
|
|
`,$}}),n.subParser("hashHTMLBlocks",function(f,p,w){"use strict";f=w.converter._dispatch("hashHTMLBlocks.before",f,p,w);var v=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],S=function(x,z,V,K){var Z=x;return V.search(/\bmarkdown\b/)!==-1&&(Z=V+w.converter.makeHtml(z)+K),`
|
|
|
|
\xA8K`+(w.gHtmlBlocks.push(Z)-1)+`K
|
|
|
|
`};p.backslashEscapesHTMLTags&&(f=f.replace(/\\<(\/?[^>]+?)>/g,function(x,z){return"<"+z+">"}));for(var $=0;$<v.length;++$)for(var P,M=new RegExp("^ {0,3}(<"+v[$]+"\\b[^>]*>)","im"),N="<"+v[$]+"\\b[^>]*>",B="</"+v[$]+">";(P=n.helper.regexIndexOf(f,M))!==-1;){var F=n.helper.splitAtIndex(f,P),q=n.helper.replaceRecursiveRegExp(F[1],S,N,B,"im");if(q===F[1])break;f=F[0].concat(q)}return f=f.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(f,p,w)),f=n.helper.replaceRecursiveRegExp(f,function(x){return`
|
|
|
|
\xA8K`+(w.gHtmlBlocks.push(x)-1)+`K
|
|
|
|
`},"^ {0,3}<!--","-->","gm"),f=f.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(f,p,w)),f=w.converter._dispatch("hashHTMLBlocks.after",f,p,w),f}),n.subParser("hashHTMLSpans",function(f,p,w){"use strict";f=w.converter._dispatch("hashHTMLSpans.before",f,p,w);function v(S){return"\xA8C"+(w.gHtmlSpans.push(S)-1)+"C"}return f=f.replace(/<[^>]+?\/>/gi,function(S){return v(S)}),f=f.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(S){return v(S)}),f=f.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(S){return v(S)}),f=f.replace(/<[^>]+?>/gi,function(S){return v(S)}),f=w.converter._dispatch("hashHTMLSpans.after",f,p,w),f}),n.subParser("unhashHTMLSpans",function(f,p,w){"use strict";f=w.converter._dispatch("unhashHTMLSpans.before",f,p,w);for(var v=0;v<w.gHtmlSpans.length;++v){for(var S=w.gHtmlSpans[v],$=0;/¨C(\d+)C/.test(S);){var P=RegExp.$1;if(S=S.replace("\xA8C"+P+"C",w.gHtmlSpans[P]),$===10){console.error("maximum nesting of 10 spans reached!!!");break}++$}f=f.replace("\xA8C"+v+"C",S)}return f=w.converter._dispatch("unhashHTMLSpans.after",f,p,w),f}),n.subParser("hashPreCodeTags",function(f,p,w){"use strict";f=w.converter._dispatch("hashPreCodeTags.before",f,p,w);var v=function(S,$,P,M){var N=P+n.subParser("encodeCode")($,p,w)+M;return`
|
|
|
|
\xA8G`+(w.ghCodeBlocks.push({text:S,codeblock:N})-1)+`G
|
|
|
|
`};return f=n.helper.replaceRecursiveRegExp(f,v,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),f=w.converter._dispatch("hashPreCodeTags.after",f,p,w),f}),n.subParser("headers",function(f,p,w){"use strict";f=w.converter._dispatch("headers.before",f,p,w);var v=isNaN(parseInt(p.headerLevelStart))?1:parseInt(p.headerLevelStart),S=p.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,$=p.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;f=f.replace(S,function(N,B){var F=n.subParser("spanGamut")(B,p,w),q=p.noHeaderId?"":' id="'+M(B)+'"',x=v,z="<h"+x+q+">"+F+"</h"+x+">";return n.subParser("hashBlock")(z,p,w)}),f=f.replace($,function(N,B){var F=n.subParser("spanGamut")(B,p,w),q=p.noHeaderId?"":' id="'+M(B)+'"',x=v+1,z="<h"+x+q+">"+F+"</h"+x+">";return n.subParser("hashBlock")(z,p,w)});var P=p.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;f=f.replace(P,function(N,B,F){var q=F;p.customizedHeaderId&&(q=F.replace(/\s?\{([^{]+?)}\s*$/,""));var x=n.subParser("spanGamut")(q,p,w),z=p.noHeaderId?"":' id="'+M(F)+'"',V=v-1+B.length,K="<h"+V+z+">"+x+"</h"+V+">";return n.subParser("hashBlock")(K,p,w)});function M(N){var B,F;if(p.customizedHeaderId){var q=N.match(/\{([^{]+?)}\s*$/);q&&q[1]&&(N=q[1])}return B=N,n.helper.isString(p.prefixHeaderId)?F=p.prefixHeaderId:p.prefixHeaderId===!0?F="section-":F="",p.rawPrefixHeaderId||(B=F+B),p.ghCompatibleHeaderId?B=B.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():p.rawHeaderId?B=B.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"\xA8").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():B=B.replace(/[^\w]/g,"").toLowerCase(),p.rawPrefixHeaderId&&(B=F+B),w.hashLinkCounts[B]?B=B+"-"+w.hashLinkCounts[B]++:w.hashLinkCounts[B]=1,B}return f=w.converter._dispatch("headers.after",f,p,w),f}),n.subParser("horizontalRule",function(f,p,w){"use strict";f=w.converter._dispatch("horizontalRule.before",f,p,w);var v=n.subParser("hashBlock")("<hr />",p,w);return f=f.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,v),f=f.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,v),f=f.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,v),f=w.converter._dispatch("horizontalRule.after",f,p,w),f}),n.subParser("images",function(f,p,w){"use strict";f=w.converter._dispatch("images.before",f,p,w);var v=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,S=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,$=/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,P=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,M=/!\[([^\[\]]+)]()()()()()/g;function N(F,q,x,z,V,K,Z,W){return z=z.replace(/\s/g,""),B(F,q,x,z,V,K,Z,W)}function B(F,q,x,z,V,K,Z,W){var J=w.gUrls,de=w.gTitles,_e=w.gDimensions;if(x=x.toLowerCase(),W||(W=""),F.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)z="";else if(z===""||z===null)if((x===""||x===null)&&(x=q.toLowerCase().replace(/ ?\n/g," ")),z="#"+x,!n.helper.isUndefined(J[x]))z=J[x],n.helper.isUndefined(de[x])||(W=de[x]),n.helper.isUndefined(_e[x])||(V=_e[x].width,K=_e[x].height);else return F;q=q.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),z=z.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var ve='<img src="'+z+'" alt="'+q+'"';return W&&n.helper.isString(W)&&(W=W.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),ve+=' title="'+W+'"'),V&&K&&(V=V==="*"?"auto":V,K=K==="*"?"auto":K,ve+=' width="'+V+'"',ve+=' height="'+K+'"'),ve+=" />",ve}return f=f.replace(P,B),f=f.replace($,N),f=f.replace(S,B),f=f.replace(v,B),f=f.replace(M,B),f=w.converter._dispatch("images.after",f,p,w),f}),n.subParser("italicsAndBold",function(f,p,w){"use strict";f=w.converter._dispatch("italicsAndBold.before",f,p,w);function v(S,$,P){return $+S+P}return p.literalMidWordUnderscores?(f=f.replace(/\b___(\S[\s\S]*?)___\b/g,function(S,$){return v($,"<strong><em>","</em></strong>")}),f=f.replace(/\b__(\S[\s\S]*?)__\b/g,function(S,$){return v($,"<strong>","</strong>")}),f=f.replace(/\b_(\S[\s\S]*?)_\b/g,function(S,$){return v($,"<em>","</em>")})):(f=f.replace(/___(\S[\s\S]*?)___/g,function(S,$){return/\S$/.test($)?v($,"<strong><em>","</em></strong>"):S}),f=f.replace(/__(\S[\s\S]*?)__/g,function(S,$){return/\S$/.test($)?v($,"<strong>","</strong>"):S}),f=f.replace(/_([^\s_][\s\S]*?)_/g,function(S,$){return/\S$/.test($)?v($,"<em>","</em>"):S})),p.literalMidWordAsterisks?(f=f.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(S,$,P){return v(P,$+"<strong><em>","</em></strong>")}),f=f.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(S,$,P){return v(P,$+"<strong>","</strong>")}),f=f.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(S,$,P){return v(P,$+"<em>","</em>")})):(f=f.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(S,$){return/\S$/.test($)?v($,"<strong><em>","</em></strong>"):S}),f=f.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(S,$){return/\S$/.test($)?v($,"<strong>","</strong>"):S}),f=f.replace(/\*([^\s*][\s\S]*?)\*/g,function(S,$){return/\S$/.test($)?v($,"<em>","</em>"):S})),f=w.converter._dispatch("italicsAndBold.after",f,p,w),f}),n.subParser("lists",function(f,p,w){"use strict";function v(P,M){w.gListLevel++,P=P.replace(/\n{2,}$/,`
|
|
`),P+="\xA80";var N=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,B=/\n[ \t]*\n(?!¨0)/.test(P);return p.disableForced4SpacesIndentedSublists&&(N=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),P=P.replace(N,function(F,q,x,z,V,K,Z){Z=Z&&Z.trim()!=="";var W=n.subParser("outdent")(V,p,w),J="";return K&&p.tasklists&&(J=' class="task-list-item" style="list-style-type: none;"',W=W.replace(/^[ \t]*\[(x|X| )?]/m,function(){var de='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return Z&&(de+=" checked"),de+=">",de})),W=W.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(de){return"\xA8A"+de}),q||W.search(/\n{2,}/)>-1?(W=n.subParser("githubCodeBlocks")(W,p,w),W=n.subParser("blockGamut")(W,p,w)):(W=n.subParser("lists")(W,p,w),W=W.replace(/\n$/,""),W=n.subParser("hashHTMLBlocks")(W,p,w),W=W.replace(/\n\n+/g,`
|
|
|
|
`),B?W=n.subParser("paragraphs")(W,p,w):W=n.subParser("spanGamut")(W,p,w)),W=W.replace("\xA8A",""),W="<li"+J+">"+W+`</li>
|
|
`,W}),P=P.replace(/¨0/g,""),w.gListLevel--,M&&(P=P.replace(/\s+$/,"")),P}function S(P,M){if(M==="ol"){var N=P.match(/^ *(\d+)\./);if(N&&N[1]!=="1")return' start="'+N[1]+'"'}return""}function $(P,M,N){var B=p.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,F=p.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,q=M==="ul"?B:F,x="";if(P.search(q)!==-1)(function V(K){var Z=K.search(q),W=S(P,M);Z!==-1?(x+=`
|
|
|
|
<`+M+W+`>
|
|
`+v(K.slice(0,Z),!!N)+"</"+M+`>
|
|
`,M=M==="ul"?"ol":"ul",q=M==="ul"?B:F,V(K.slice(Z))):x+=`
|
|
|
|
<`+M+W+`>
|
|
`+v(K,!!N)+"</"+M+`>
|
|
`})(P);else{var z=S(P,M);x=`
|
|
|
|
<`+M+z+`>
|
|
`+v(P,!!N)+"</"+M+`>
|
|
`}return x}return f=w.converter._dispatch("lists.before",f,p,w),f+="\xA80",w.gListLevel?f=f.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(P,M,N){var B=N.search(/[*+-]/g)>-1?"ul":"ol";return $(M,B,!0)}):f=f.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(P,M,N,B){var F=B.search(/[*+-]/g)>-1?"ul":"ol";return $(N,F,!1)}),f=f.replace(/¨0/,""),f=w.converter._dispatch("lists.after",f,p,w),f}),n.subParser("metadata",function(f,p,w){"use strict";if(!p.metadata)return f;f=w.converter._dispatch("metadata.before",f,p,w);function v(S){w.metadata.raw=S,S=S.replace(/&/g,"&").replace(/"/g,"""),S=S.replace(/\n {4}/g," "),S.replace(/^([\S ]+): +([\s\S]+?)$/gm,function($,P,M){return w.metadata.parsed[P]=M,""})}return f=f.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(S,$,P){return v(P),"\xA8M"}),f=f.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(S,$,P){return $&&(w.metadata.format=$),v(P),"\xA8M"}),f=f.replace(/¨M/g,""),f=w.converter._dispatch("metadata.after",f,p,w),f}),n.subParser("outdent",function(f,p,w){"use strict";return f=w.converter._dispatch("outdent.before",f,p,w),f=f.replace(/^(\t|[ ]{1,4})/gm,"\xA80"),f=f.replace(/¨0/g,""),f=w.converter._dispatch("outdent.after",f,p,w),f}),n.subParser("paragraphs",function(f,p,w){"use strict";f=w.converter._dispatch("paragraphs.before",f,p,w),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,"");for(var v=f.split(/\n{2,}/g),S=[],$=v.length,P=0;P<$;P++){var M=v[P];M.search(/¨(K|G)(\d+)\1/g)>=0?S.push(M):M.search(/\S/)>=0&&(M=n.subParser("spanGamut")(M,p,w),M=M.replace(/^([ \t]*)/g,"<p>"),M+="</p>",S.push(M))}for($=S.length,P=0;P<$;P++){for(var N="",B=S[P],F=!1;/¨(K|G)(\d+)\1/.test(B);){var q=RegExp.$1,x=RegExp.$2;q==="K"?N=w.gHtmlBlocks[x]:F?N=n.subParser("encodeCode")(w.ghCodeBlocks[x].text,p,w):N=w.ghCodeBlocks[x].codeblock,N=N.replace(/\$/g,"$$$$"),B=B.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,N),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(B)&&(F=!0)}S[P]=B}return f=S.join(`
|
|
`),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,""),w.converter._dispatch("paragraphs.after",f,p,w)}),n.subParser("runExtension",function(f,p,w,v){"use strict";if(f.filter)p=f.filter(p,v.converter,w);else if(f.regex){var S=f.regex;S instanceof RegExp||(S=new RegExp(S,"g")),p=p.replace(S,f.replace)}return p}),n.subParser("spanGamut",function(f,p,w){"use strict";return f=w.converter._dispatch("spanGamut.before",f,p,w),f=n.subParser("codeSpans")(f,p,w),f=n.subParser("escapeSpecialCharsWithinTagAttributes")(f,p,w),f=n.subParser("encodeBackslashEscapes")(f,p,w),f=n.subParser("images")(f,p,w),f=n.subParser("anchors")(f,p,w),f=n.subParser("autoLinks")(f,p,w),f=n.subParser("simplifiedAutoLinks")(f,p,w),f=n.subParser("emoji")(f,p,w),f=n.subParser("underline")(f,p,w),f=n.subParser("italicsAndBold")(f,p,w),f=n.subParser("strikethrough")(f,p,w),f=n.subParser("ellipsis")(f,p,w),f=n.subParser("hashHTMLSpans")(f,p,w),f=n.subParser("encodeAmpsAndAngles")(f,p,w),p.simpleLineBreaks?/\n\n¨K/.test(f)||(f=f.replace(/\n+/g,`<br />
|
|
`)):f=f.replace(/ +\n/g,`<br />
|
|
`),f=w.converter._dispatch("spanGamut.after",f,p,w),f}),n.subParser("strikethrough",function(f,p,w){"use strict";function v(S){return p.simplifiedAutoLink&&(S=n.subParser("simplifiedAutoLinks")(S,p,w)),"<del>"+S+"</del>"}return p.strikethrough&&(f=w.converter._dispatch("strikethrough.before",f,p,w),f=f.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(S,$){return v($)}),f=w.converter._dispatch("strikethrough.after",f,p,w)),f}),n.subParser("stripLinkDefinitions",function(f,p,w){"use strict";var v=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,S=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;f+="\xA80";var $=function(P,M,N,B,F,q,x){return M=M.toLowerCase(),f.toLowerCase().split(M).length-1<2?P:(N.match(/^data:.+?\/.+?;base64,/)?w.gUrls[M]=N.replace(/\s/g,""):w.gUrls[M]=n.subParser("encodeAmpsAndAngles")(N,p,w),q?q+x:(x&&(w.gTitles[M]=x.replace(/"|'/g,""")),p.parseImgDimensions&&B&&F&&(w.gDimensions[M]={width:B,height:F}),""))};return f=f.replace(S,$),f=f.replace(v,$),f=f.replace(/¨0/,""),f}),n.subParser("tables",function(f,p,w){"use strict";if(!p.tables)return f;var v=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,S=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function $(F){return/^:[ \t]*--*$/.test(F)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(F)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(F)?' style="text-align:center;"':""}function P(F,q){var x="";return F=F.trim(),(p.tablesHeaderId||p.tableHeaderId)&&(x=' id="'+F.replace(/ /g,"_").toLowerCase()+'"'),F=n.subParser("spanGamut")(F,p,w),"<th"+x+q+">"+F+`</th>
|
|
`}function M(F,q){var x=n.subParser("spanGamut")(F,p,w);return"<td"+q+">"+x+`</td>
|
|
`}function N(F,q){for(var x=`<table>
|
|
<thead>
|
|
<tr>
|
|
`,z=F.length,V=0;V<z;++V)x+=F[V];for(x+=`</tr>
|
|
</thead>
|
|
<tbody>
|
|
`,V=0;V<q.length;++V){x+=`<tr>
|
|
`;for(var K=0;K<z;++K)x+=q[V][K];x+=`</tr>
|
|
`}return x+=`</tbody>
|
|
</table>
|
|
`,x}function B(F){var q,x=F.split(`
|
|
`);for(q=0;q<x.length;++q)/^ {0,3}\|/.test(x[q])&&(x[q]=x[q].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(x[q])&&(x[q]=x[q].replace(/\|[ \t]*$/,"")),x[q]=n.subParser("codeSpans")(x[q],p,w);var z=x[0].split("|").map(function(ve){return ve.trim()}),V=x[1].split("|").map(function(ve){return ve.trim()}),K=[],Z=[],W=[],J=[];for(x.shift(),x.shift(),q=0;q<x.length;++q)x[q].trim()!==""&&K.push(x[q].split("|").map(function(ve){return ve.trim()}));if(z.length<V.length)return F;for(q=0;q<V.length;++q)W.push($(V[q]));for(q=0;q<z.length;++q)n.helper.isUndefined(W[q])&&(W[q]=""),Z.push(P(z[q],W[q]));for(q=0;q<K.length;++q){for(var de=[],_e=0;_e<Z.length;++_e)n.helper.isUndefined(K[q][_e]),de.push(M(K[q][_e],W[_e]));J.push(de)}return N(Z,J)}return f=w.converter._dispatch("tables.before",f,p,w),f=f.replace(/\\(\|)/g,n.helper.escapeCharactersCallback),f=f.replace(v,B),f=f.replace(S,B),f=w.converter._dispatch("tables.after",f,p,w),f}),n.subParser("underline",function(f,p,w){"use strict";return p.underline&&(f=w.converter._dispatch("underline.before",f,p,w),p.literalMidWordUnderscores?(f=f.replace(/\b___(\S[\s\S]*?)___\b/g,function(v,S){return"<u>"+S+"</u>"}),f=f.replace(/\b__(\S[\s\S]*?)__\b/g,function(v,S){return"<u>"+S+"</u>"})):(f=f.replace(/___(\S[\s\S]*?)___/g,function(v,S){return/\S$/.test(S)?"<u>"+S+"</u>":v}),f=f.replace(/__(\S[\s\S]*?)__/g,function(v,S){return/\S$/.test(S)?"<u>"+S+"</u>":v})),f=f.replace(/(_)/g,n.helper.escapeCharactersCallback),f=w.converter._dispatch("underline.after",f,p,w)),f}),n.subParser("unescapeSpecialChars",function(f,p,w){"use strict";return f=w.converter._dispatch("unescapeSpecialChars.before",f,p,w),f=f.replace(/¨E(\d+)E/g,function(v,S){var $=parseInt(S);return String.fromCharCode($)}),f=w.converter._dispatch("unescapeSpecialChars.after",f,p,w),f}),n.subParser("makeMarkdown.blockquote",function(f,p){"use strict";var w="";if(f.hasChildNodes())for(var v=f.childNodes,S=v.length,$=0;$<S;++$){var P=n.subParser("makeMarkdown.node")(v[$],p);P!==""&&(w+=P)}return w=w.trim(),w="> "+w.split(`
|
|
`).join(`
|
|
> `),w}),n.subParser("makeMarkdown.codeBlock",function(f,p){"use strict";var w=f.getAttribute("language"),v=f.getAttribute("precodenum");return"```"+w+`
|
|
`+p.preList[v]+"\n```"}),n.subParser("makeMarkdown.codeSpan",function(f){"use strict";return"`"+f.innerHTML+"`"}),n.subParser("makeMarkdown.emphasis",function(f,p){"use strict";var w="";if(f.hasChildNodes()){w+="*";for(var v=f.childNodes,S=v.length,$=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p);w+="*"}return w}),n.subParser("makeMarkdown.header",function(f,p,w){"use strict";var v=new Array(w+1).join("#"),S="";if(f.hasChildNodes()){S=v+" ";for(var $=f.childNodes,P=$.length,M=0;M<P;++M)S+=n.subParser("makeMarkdown.node")($[M],p)}return S}),n.subParser("makeMarkdown.hr",function(){"use strict";return"---"}),n.subParser("makeMarkdown.image",function(f){"use strict";var p="";return f.hasAttribute("src")&&(p+="+">",f.hasAttribute("width")&&f.hasAttribute("height")&&(p+=" ="+f.getAttribute("width")+"x"+f.getAttribute("height")),f.hasAttribute("title")&&(p+=' "'+f.getAttribute("title")+'"'),p+=")"),p}),n.subParser("makeMarkdown.links",function(f,p){"use strict";var w="";if(f.hasChildNodes()&&f.hasAttribute("href")){var v=f.childNodes,S=v.length;w="[";for(var $=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p);w+="](",w+="<"+f.getAttribute("href")+">",f.hasAttribute("title")&&(w+=' "'+f.getAttribute("title")+'"'),w+=")"}return w}),n.subParser("makeMarkdown.list",function(f,p,w){"use strict";var v="";if(!f.hasChildNodes())return"";for(var S=f.childNodes,$=S.length,P=f.getAttribute("start")||1,M=0;M<$;++M)if(!(typeof S[M].tagName>"u"||S[M].tagName.toLowerCase()!=="li")){var N="";w==="ol"?N=P.toString()+". ":N="- ",v+=N+n.subParser("makeMarkdown.listItem")(S[M],p),++P}return v+=`
|
|
<!-- -->
|
|
`,v.trim()}),n.subParser("makeMarkdown.listItem",function(f,p){"use strict";for(var w="",v=f.childNodes,S=v.length,$=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p);return/\n$/.test(w)?w=w.split(`
|
|
`).join(`
|
|
`).replace(/^ {4}$/gm,"").replace(/\n\n+/g,`
|
|
|
|
`):w+=`
|
|
`,w}),n.subParser("makeMarkdown.node",function(f,p,w){"use strict";w=w||!1;var v="";if(f.nodeType===3)return n.subParser("makeMarkdown.txt")(f,p);if(f.nodeType===8)return"<!--"+f.data+`-->
|
|
|
|
`;if(f.nodeType!==1)return"";var S=f.tagName.toLowerCase();switch(S){case"h1":w||(v=n.subParser("makeMarkdown.header")(f,p,1)+`
|
|
|
|
`);break;case"h2":w||(v=n.subParser("makeMarkdown.header")(f,p,2)+`
|
|
|
|
`);break;case"h3":w||(v=n.subParser("makeMarkdown.header")(f,p,3)+`
|
|
|
|
`);break;case"h4":w||(v=n.subParser("makeMarkdown.header")(f,p,4)+`
|
|
|
|
`);break;case"h5":w||(v=n.subParser("makeMarkdown.header")(f,p,5)+`
|
|
|
|
`);break;case"h6":w||(v=n.subParser("makeMarkdown.header")(f,p,6)+`
|
|
|
|
`);break;case"p":w||(v=n.subParser("makeMarkdown.paragraph")(f,p)+`
|
|
|
|
`);break;case"blockquote":w||(v=n.subParser("makeMarkdown.blockquote")(f,p)+`
|
|
|
|
`);break;case"hr":w||(v=n.subParser("makeMarkdown.hr")(f,p)+`
|
|
|
|
`);break;case"ol":w||(v=n.subParser("makeMarkdown.list")(f,p,"ol")+`
|
|
|
|
`);break;case"ul":w||(v=n.subParser("makeMarkdown.list")(f,p,"ul")+`
|
|
|
|
`);break;case"precode":w||(v=n.subParser("makeMarkdown.codeBlock")(f,p)+`
|
|
|
|
`);break;case"pre":w||(v=n.subParser("makeMarkdown.pre")(f,p)+`
|
|
|
|
`);break;case"table":w||(v=n.subParser("makeMarkdown.table")(f,p)+`
|
|
|
|
`);break;case"code":v=n.subParser("makeMarkdown.codeSpan")(f,p);break;case"em":case"i":v=n.subParser("makeMarkdown.emphasis")(f,p);break;case"strong":case"b":v=n.subParser("makeMarkdown.strong")(f,p);break;case"del":v=n.subParser("makeMarkdown.strikethrough")(f,p);break;case"a":v=n.subParser("makeMarkdown.links")(f,p);break;case"img":v=n.subParser("makeMarkdown.image")(f,p);break;default:v=f.outerHTML+`
|
|
|
|
`}return v}),n.subParser("makeMarkdown.paragraph",function(f,p){"use strict";var w="";if(f.hasChildNodes())for(var v=f.childNodes,S=v.length,$=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p);return w=w.trim(),w}),n.subParser("makeMarkdown.pre",function(f,p){"use strict";var w=f.getAttribute("prenum");return"<pre>"+p.preList[w]+"</pre>"}),n.subParser("makeMarkdown.strikethrough",function(f,p){"use strict";var w="";if(f.hasChildNodes()){w+="~~";for(var v=f.childNodes,S=v.length,$=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p);w+="~~"}return w}),n.subParser("makeMarkdown.strong",function(f,p){"use strict";var w="";if(f.hasChildNodes()){w+="**";for(var v=f.childNodes,S=v.length,$=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p);w+="**"}return w}),n.subParser("makeMarkdown.table",function(f,p){"use strict";var w="",v=[[],[]],S=f.querySelectorAll("thead>tr>th"),$=f.querySelectorAll("tbody>tr"),P,M;for(P=0;P<S.length;++P){var N=n.subParser("makeMarkdown.tableCell")(S[P],p),B="---";if(S[P].hasAttribute("style")){var F=S[P].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(F){case"text-align:left;":B=":---";break;case"text-align:right;":B="---:";break;case"text-align:center;":B=":---:";break}}v[0][P]=N.trim(),v[1][P]=B}for(P=0;P<$.length;++P){var q=v.push([])-1,x=$[P].getElementsByTagName("td");for(M=0;M<S.length;++M){var z=" ";typeof x[M]<"u"&&(z=n.subParser("makeMarkdown.tableCell")(x[M],p)),v[q].push(z)}}var V=3;for(P=0;P<v.length;++P)for(M=0;M<v[P].length;++M){var K=v[P][M].length;K>V&&(V=K)}for(P=0;P<v.length;++P){for(M=0;M<v[P].length;++M)P===1?v[P][M].slice(-1)===":"?v[P][M]=n.helper.padEnd(v[P][M].slice(-1),V-1,"-")+":":v[P][M]=n.helper.padEnd(v[P][M],V,"-"):v[P][M]=n.helper.padEnd(v[P][M],V);w+="| "+v[P].join(" | ")+` |
|
|
`}return w.trim()}),n.subParser("makeMarkdown.tableCell",function(f,p){"use strict";var w="";if(!f.hasChildNodes())return"";for(var v=f.childNodes,S=v.length,$=0;$<S;++$)w+=n.subParser("makeMarkdown.node")(v[$],p,!0);return w.trim()}),n.subParser("makeMarkdown.txt",function(f){"use strict";var p=f.nodeValue;return p=p.replace(/ +/g," "),p=p.replace(/¨NBSP;/g," "),p=n.helper.unescapeHTMLEntities(p),p=p.replace(/([*_~|`])/g,"\\$1"),p=p.replace(/^(\s*)>/g,"\\$1>"),p=p.replace(/^#/gm,"\\#"),p=p.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),p=p.replace(/^( {0,3}\d+)\./gm,"$1\\."),p=p.replace(/^( {0,3})([+-])/gm,"$1\\$2"),p=p.replace(/]([\s]*)\(/g,"\\]$1\\("),p=p.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),p});var L=this;typeof define=="function"&&define.amd?define(function(){"use strict";return n}):typeof Xa<"u"&&Xa.exports?Xa.exports=n:L.showdown=n}).call(fm)});var E5={};var v5,_5,ue,Mw=R_(()=>{v5=Object.defineProperty,_5=(e,t,n)=>t in e?v5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ue=(e,t,n)=>(_5(e,typeof t!="symbol"?t+"":t,n),n);(function(){"use strict";var e,t,n,r,o;let i='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.absolute{position:absolute}.bottom-1{bottom:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-10{height:2.5rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.w-10{width:2.5rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-full{width:100%}.max-w-56{max-width:14rem}@keyframes moveIn{0%{transform:translateY(-10px)}to{transform:translateY(0)}}.animate-fadein{animation:fadeIn 1s ease-in-out,moveIn 1s ease-in-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-show{animation:fadeIn .2s ease-in-out}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.border-0{border-width:0px}.border-2{border-width:2px}.border-solid{border-style:solid}.border-transparent{border-color:transparent}.bg-cyan-700{--tw-bg-opacity: 1;background-color:rgb(14 116 144 / var(--tw-bg-opacity))}.bg-cyan-800{--tw-bg-opacity: 1;background-color:rgb(21 94 117 / var(--tw-bg-opacity))}.bg-cyan-900{--tw-bg-opacity: 1;background-color:rgb(22 78 99 / var(--tw-bg-opacity))}.bg-cyan-950{--tw-bg-opacity: 1;background-color:rgb(8 51 68 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.bg-green-800{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.bg-green-900{--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity))}.bg-green-950{--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity))}.bg-neutral-700{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity))}.bg-neutral-950{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity))}.bg-orange-700{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity))}.bg-orange-800{--tw-bg-opacity: 1;background-color:rgb(154 52 18 / var(--tw-bg-opacity))}.bg-orange-900{--tw-bg-opacity: 1;background-color:rgb(124 45 18 / var(--tw-bg-opacity))}.bg-orange-950{--tw-bg-opacity: 1;background-color:rgb(67 20 7 / var(--tw-bg-opacity))}.bg-purple-700{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity))}.bg-purple-800{--tw-bg-opacity: 1;background-color:rgb(107 33 168 / var(--tw-bg-opacity))}.bg-purple-900{--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity))}.bg-purple-950{--tw-bg-opacity: 1;background-color:rgb(59 7 100 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.bg-red-800{--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity))}.bg-red-900{--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.bg-red-950{--tw-bg-opacity: 1;background-color:rgb(69 10 10 / var(--tw-bg-opacity))}.bg-stone-700{--tw-bg-opacity: 1;background-color:rgb(68 64 60 / var(--tw-bg-opacity))}.bg-stone-800{--tw-bg-opacity: 1;background-color:rgb(41 37 36 / var(--tw-bg-opacity))}.bg-stone-900{--tw-bg-opacity: 1;background-color:rgb(28 25 23 / var(--tw-bg-opacity))}.bg-stone-950{--tw-bg-opacity: 1;background-color:rgb(12 10 9 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-cyan-900{--tw-gradient-from: #164e63 var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 78 99 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-900{--tw-gradient-from: #14532d var(--tw-gradient-from-position);--tw-gradient-to: rgb(20 83 45 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-900{--tw-gradient-from: #171717 var(--tw-gradient-from-position);--tw-gradient-to: rgb(23 23 23 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-900{--tw-gradient-from: #7c2d12 var(--tw-gradient-from-position);--tw-gradient-to: rgb(124 45 18 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-900{--tw-gradient-from: #581c87 var(--tw-gradient-from-position);--tw-gradient-to: rgb(88 28 135 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-900{--tw-gradient-from: #7f1d1d var(--tw-gradient-from-position);--tw-gradient-to: rgb(127 29 29 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-stone-900{--tw-gradient-from: #1c1917 var(--tw-gradient-from-position);--tw-gradient-to: rgb(28 25 23 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-cyan-700{--tw-gradient-to: #0e7490 var(--tw-gradient-to-position)}.to-green-700{--tw-gradient-to: #15803d var(--tw-gradient-to-position)}.to-neutral-700{--tw-gradient-to: #404040 var(--tw-gradient-to-position)}.to-orange-700{--tw-gradient-to: #c2410c var(--tw-gradient-to-position)}.to-purple-700{--tw-gradient-to: #7e22ce var(--tw-gradient-to-position)}.to-red-700{--tw-gradient-to: #b91c1c var(--tw-gradient-to-position)}.to-stone-700{--tw-gradient-to: #44403c var(--tw-gradient-to-position)}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.leading-3{line-height:.75rem}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.text-cyan-600{--tw-text-opacity: 1;color:rgb(8 145 178 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-neutral-600{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity))}.text-neutral-800{--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-stone-600{--tw-text-opacity: 1;color:rgb(87 83 78 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.decoration-2{text-decoration-thickness:2px}.underline-offset-4{text-underline-offset:4px}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-\\[0_0px_10px_0px_rgba\\(0\\,0\\,0\\,0\\.3\\)\\]{--tw-shadow: 0 0px 10px 0px rgba(0,0,0,.3);--tw-shadow-colored: 0 0px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_0px_30px_0px_rgba\\(0\\,0\\,0\\,0\\.6\\)\\]{--tw-shadow: 0 0px 30px 0px rgba(0,0,0,.6);--tw-shadow-colored: 0 0px 30px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline-dashed{outline-style:dashed}.outline-1{outline-width:1px}.outline-offset-4{outline-offset:4px}.outline-cyan-500{outline-color:#06b6d4}.outline-green-500{outline-color:#22c55e}.outline-neutral-500{outline-color:#737373}.outline-orange-500{outline-color:#f97316}.outline-purple-500{outline-color:#a855f7}.outline-red-500{outline-color:#ef4444}.outline-stone-500{outline-color:#78716c}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.hover\\:bg-cyan-700:hover{--tw-bg-opacity: 1;background-color:rgb(14 116 144 / var(--tw-bg-opacity))}.hover\\:bg-cyan-800:hover{--tw-bg-opacity: 1;background-color:rgb(21 94 117 / var(--tw-bg-opacity))}.hover\\:bg-cyan-900:hover{--tw-bg-opacity: 1;background-color:rgb(22 78 99 / var(--tw-bg-opacity))}.hover\\:bg-cyan-950:hover{--tw-bg-opacity: 1;background-color:rgb(8 51 68 / var(--tw-bg-opacity))}.hover\\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.hover\\:bg-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.hover\\:bg-green-900:hover{--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity))}.hover\\:bg-green-950:hover{--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity))}.hover\\:bg-neutral-700:hover{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity))}.hover\\:bg-neutral-800:hover{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity))}.hover\\:bg-neutral-900:hover{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity))}.hover\\:bg-neutral-950:hover{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity))}.hover\\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity))}.hover\\:bg-orange-800:hover{--tw-bg-opacity: 1;background-color:rgb(154 52 18 / var(--tw-bg-opacity))}.hover\\:bg-orange-900:hover{--tw-bg-opacity: 1;background-color:rgb(124 45 18 / var(--tw-bg-opacity))}.hover\\:bg-orange-950:hover{--tw-bg-opacity: 1;background-color:rgb(67 20 7 / var(--tw-bg-opacity))}.hover\\:bg-purple-700:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity))}.hover\\:bg-purple-800:hover{--tw-bg-opacity: 1;background-color:rgb(107 33 168 / var(--tw-bg-opacity))}.hover\\:bg-purple-900:hover{--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity))}.hover\\:bg-purple-950:hover{--tw-bg-opacity: 1;background-color:rgb(59 7 100 / var(--tw-bg-opacity))}.hover\\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.hover\\:bg-red-800:hover{--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity))}.hover\\:bg-red-900:hover{--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.hover\\:bg-red-950:hover{--tw-bg-opacity: 1;background-color:rgb(69 10 10 / var(--tw-bg-opacity))}.hover\\:bg-stone-700:hover{--tw-bg-opacity: 1;background-color:rgb(68 64 60 / var(--tw-bg-opacity))}.hover\\:bg-stone-800:hover{--tw-bg-opacity: 1;background-color:rgb(41 37 36 / var(--tw-bg-opacity))}.hover\\:bg-stone-900:hover{--tw-bg-opacity: 1;background-color:rgb(28 25 23 / var(--tw-bg-opacity))}.hover\\:bg-stone-950:hover{--tw-bg-opacity: 1;background-color:rgb(12 10 9 / var(--tw-bg-opacity))}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:bg-neutral-400:disabled{--tw-bg-opacity: 1;background-color:rgb(163 163 163 / var(--tw-bg-opacity))}.disabled\\:text-neutral-200:disabled{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity))}.group:hover .group-hover\\:underline{text-decoration-line:underline}@media (min-width: 640px){.sm\\:w-96{width:24rem}}';function a(){}function u(s){return s()}function d(){return Object.create(null)}function h(s){s.forEach(u)}function m(s){return typeof s=="function"}function b(s,c){return s!=s?c==c:s!==c||s&&typeof s=="object"||typeof s=="function"}let _;function T(s,c){return s===c?!0:(_||(_=document.createElement("a")),_.href=c,s===_.href)}function A(s){return Object.keys(s).length===0}function k(s,...c){if(s==null){for(let g of c)g(void 0);return a}let l=s.subscribe(...c);return l.unsubscribe?()=>l.unsubscribe():l}function I(s,c,l){s.$$.on_destroy.push(k(c,l))}let O=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function L(s,c){s.appendChild(c)}function f(s,c,l){s.insertBefore(c,l||null)}function p(s){s.parentNode&&s.parentNode.removeChild(s)}function w(s,c){for(let l=0;l<s.length;l+=1)s[l]&&s[l].d(c)}function v(s){return document.createElement(s)}function S(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function $(s){return document.createTextNode(s)}function P(){return $(" ")}function M(){return $("")}function N(s,c,l,g){return s.addEventListener(c,l,g),()=>s.removeEventListener(c,l,g)}function B(s,c,l){l==null?s.removeAttribute(c):s.getAttribute(c)!==l&&s.setAttribute(c,l)}function F(s){return Array.from(s.childNodes)}function q(s,c){c=""+c,s.data!==c&&(s.data=c)}function x(s,c){s.value=c??""}function z(s,c,l){for(let g=0;g<s.options.length;g+=1){let y=s.options[g];if(y.__value===c){y.selected=!0;return}}(!l||c!==void 0)&&(s.selectedIndex=-1)}function V(s){let c=s.querySelector(":checked");return c&&c.__value}function K(s,c,l){s.classList.toggle(c,!!l)}let Z;function W(s){Z=s}function J(){if(!Z)throw new Error("Function called outside component initialization");return Z}function de(s){J().$$.on_mount.push(s)}let _e=[],ve=[],Pe=[],ie=[],Se=Promise.resolve(),Ve=!1;function Re(){Ve||(Ve=!0,Se.then(he))}function je(s){Pe.push(s)}let Et=new Set,Qe=0;function he(){if(Qe!==0)return;let s=Z;do{try{for(;Qe<_e.length;){let c=_e[Qe];Qe++,W(c),Me(c.$$)}}catch(c){throw _e.length=0,Qe=0,c}for(W(null),_e.length=0,Qe=0;ve.length;)ve.pop()();for(let c=0;c<Pe.length;c+=1){let l=Pe[c];Et.has(l)||(Et.add(l),l())}Pe.length=0}while(_e.length);for(;ie.length;)ie.pop()();Ve=!1,Et.clear(),W(s)}function Me(s){if(s.fragment!==null){s.update(),h(s.before_update);let c=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,c),s.after_update.forEach(je)}}function Ce(s){let c=[],l=[];Pe.forEach(g=>s.indexOf(g)===-1?c.push(g):l.push(g)),l.forEach(g=>g()),Pe=c}let Ie=new Set,qe;function Ct(){qe={r:0,c:[],p:qe}}function qt(){qe.r||h(qe.c),qe=qe.p}function Mt(s,c){s&&s.i&&(Ie.delete(s),s.i(c))}function un(s,c,l,g){if(s&&s.o){if(Ie.has(s))return;Ie.add(s),qe.c.push(()=>{Ie.delete(s),g&&(l&&s.d(1),g())}),s.o(c)}else g&&g()}function hh(s){return s?.length!==void 0?s:Array.from(s)}function ph(s){s&&s.c()}function mu(s,c,l){let{fragment:g,after_update:y}=s.$$;g&&g.m(c,l),je(()=>{let E=s.$$.on_mount.map(u).filter(m);s.$$.on_destroy?s.$$.on_destroy.push(...E):h(E),s.$$.on_mount=[]}),y.forEach(je)}function bu(s,c){let l=s.$$;l.fragment!==null&&(Ce(l.after_update),h(l.on_destroy),l.fragment&&l.fragment.d(c),l.on_destroy=l.fragment=null,l.ctx=[])}function Qw(s,c){s.$$.dirty[0]===-1&&(_e.push(s),Re(),s.$$.dirty.fill(0)),s.$$.dirty[c/31|0]|=1<<c%31}function gh(s,c,l,g,y,E,C=null,U=[-1]){let R=Z;W(s);let D=s.$$={fragment:null,ctx:[],props:E,update:a,not_equal:y,bound:d(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c.context||(R?R.$$.context:[])),callbacks:d(),dirty:U,skip_bound:!1,root:c.target||R.$$.root};C&&C(D.root);let H=!1;if(D.ctx=l?l(s,c.props||{},(j,Y,...G)=>{let ee=G.length?G[0]:Y;return D.ctx&&y(D.ctx[j],D.ctx[j]=ee)&&(!D.skip_bound&&D.bound[j]&&D.bound[j](ee),H&&Qw(s,j)),Y}):[],D.update(),H=!0,h(D.before_update),D.fragment=g?g(D.ctx):!1,c.target){if(c.hydrate){let j=F(c.target);D.fragment&&D.fragment.l(j),j.forEach(p)}else D.fragment&&D.fragment.c();c.intro&&Mt(s.$$.fragment),mu(s,c.target,c.anchor),he()}W(R)}class mh{constructor(){ue(this,"$$"),ue(this,"$$set")}$destroy(){bu(this,1),this.$destroy=a}$on(c,l){if(!m(l))return a;let g=this.$$.callbacks[c]||(this.$$.callbacks[c]=[]);return g.push(l),()=>{let y=g.indexOf(l);y!==-1&&g.splice(y,1)}}$set(c){this.$$set&&!A(c)&&(this.$$.skip_bound=!0,this.$$set(c),this.$$.skip_bound=!1)}}let Kw="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Kw);function Gw(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var wu={exports:{}};function bh(s,c=100,l={}){if(typeof s!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof s}\`.`);if(c<0)throw new RangeError("`wait` must not be negative.");let{immediate:g}=typeof l=="boolean"?{immediate:l}:l,y,E,C,U,R;function D(){let j=Date.now()-U;if(j<c&&j>=0)C=setTimeout(D,c-j);else if(C=void 0,!g){let Y=y,G=E;y=void 0,E=void 0,R=s.apply(Y,G)}}let H=function(...j){if(y&&this!==y)throw new Error("Debounced method called with different contexts.");y=this,E=j,U=Date.now();let Y=g&&!C;if(C||(C=setTimeout(D,c)),Y){let G=y,ee=E;y=void 0,E=void 0,R=s.apply(G,ee)}return R};return H.clear=()=>{C&&(clearTimeout(C),C=void 0)},H.flush=()=>{if(!C)return;let j=y,Y=E;y=void 0,E=void 0,R=s.apply(j,Y),clearTimeout(C),C=void 0},H}wu.exports.debounce=bh,wu.exports=bh;var Zw=wu.exports;let wh=Gw(Zw),yu=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;let yh=s=>s instanceof Uint8Array,vu=s=>new DataView(s.buffer,s.byteOffset,s.byteLength),zn=(s,c)=>s<<32-c|s>>>c;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw new Error("Non little-endian hardware is not supported");let Yw=Array.from({length:256},(s,c)=>c.toString(16).padStart(2,"0"));function Wt(s){if(!yh(s))throw new Error("Uint8Array expected");let c="";for(let l=0;l<s.length;l++)c+=Yw[s[l]];return c}function _u(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);let c=s.length;if(c%2)throw new Error("padded hex string expected, got unpadded hex of length "+c);let l=new Uint8Array(c/2);for(let g=0;g<l.length;g++){let y=g*2,E=s.slice(y,y+2),C=Number.parseInt(E,16);if(Number.isNaN(C)||C<0)throw new Error("Invalid byte sequence");l[g]=C}return l}function Jw(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function vh(s){if(typeof s=="string"&&(s=Jw(s)),!yh(s))throw new Error(`expected Uint8Array, got ${typeof s}`);return s}let Xw=class{clone(){return this._cloneInto()}};function _h(s){let c=g=>s().update(vh(g)).digest(),l=s();return c.outputLen=l.outputLen,c.blockLen=l.blockLen,c.create=()=>s(),c}function ey(s=32){if(yu&&typeof yu.getRandomValues=="function")return yu.getRandomValues(new Uint8Array(s));throw new Error("crypto.getRandomValues must be defined")}function Eh(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}function xh(s,...c){if(!(s instanceof Uint8Array))throw new Error("Expected Uint8Array");if(c.length>0&&!c.includes(s.length))throw new Error(`Expected Uint8Array of length ${c}, not of length=${s.length}`)}function ty(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Eh(s.outputLen),Eh(s.blockLen)}function Ys(s,c=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(c&&s.finished)throw new Error("Hash#digest() has already been called")}function ny(s,c){xh(s);let l=c.outputLen;if(s.length<l)throw new Error(`digestInto() expects output buffer of length at least ${l}`)}let Eu=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;let kh=s=>s instanceof Uint8Array,xu=s=>new DataView(s.buffer,s.byteOffset,s.byteLength),Mn=(s,c)=>s<<32-c|s>>>c;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw new Error("Non little-endian hardware is not supported");function ry(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function ku(s){if(typeof s=="string"&&(s=ry(s)),!kh(s))throw new Error(`expected Uint8Array, got ${typeof s}`);return s}function oy(...s){let c=new Uint8Array(s.reduce((g,y)=>g+y.length,0)),l=0;return s.forEach(g=>{if(!kh(g))throw new Error("Uint8Array expected");c.set(g,l),l+=g.length}),c}class Sh{clone(){return this._cloneInto()}}function iy(s){let c=g=>s().update(ku(g)).digest(),l=s();return c.outputLen=l.outputLen,c.blockLen=l.blockLen,c.create=()=>s(),c}function Ah(s=32){if(Eu&&typeof Eu.getRandomValues=="function")return Eu.getRandomValues(new Uint8Array(s));throw new Error("crypto.getRandomValues must be defined")}function sy(s,c,l,g){if(typeof s.setBigUint64=="function")return s.setBigUint64(c,l,g);let y=BigInt(32),E=BigInt(4294967295),C=Number(l>>y&E),U=Number(l&E),R=g?4:0,D=g?0:4;s.setUint32(c+R,C,g),s.setUint32(c+D,U,g)}let ay=class extends Sh{constructor(s,c,l,g){super(),this.blockLen=s,this.outputLen=c,this.padOffset=l,this.isLE=g,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(s),this.view=xu(this.buffer)}update(s){Ys(this);let{view:c,buffer:l,blockLen:g}=this;s=ku(s);let y=s.length;for(let E=0;E<y;){let C=Math.min(g-this.pos,y-E);if(C===g){let U=xu(s);for(;g<=y-E;E+=g)this.process(U,E);continue}l.set(s.subarray(E,E+C),this.pos),this.pos+=C,E+=C,this.pos===g&&(this.process(c,0),this.pos=0)}return this.length+=s.length,this.roundClean(),this}digestInto(s){Ys(this),ny(s,this),this.finished=!0;let{buffer:c,view:l,blockLen:g,isLE:y}=this,{pos:E}=this;c[E++]=128,this.buffer.subarray(E).fill(0),this.padOffset>g-E&&(this.process(l,0),E=0);for(let H=E;H<g;H++)c[H]=0;sy(l,g-8,BigInt(this.length*8),y),this.process(l,0);let C=xu(s),U=this.outputLen;if(U%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let R=U/4,D=this.get();if(R>D.length)throw new Error("_sha2: outputLen bigger than state");for(let H=0;H<R;H++)C.setUint32(4*H,D[H],y)}digest(){let{buffer:s,outputLen:c}=this;this.digestInto(s);let l=s.slice(0,c);return this.destroy(),l}_cloneInto(s){s||(s=new this.constructor),s.set(...this.get());let{blockLen:c,buffer:l,length:g,finished:y,destroyed:E,pos:C}=this;return s.length=g,s.pos=C,s.finished=y,s.destroyed=E,g%c&&s.buffer.set(l),s}},cy=(s,c,l)=>s&c^~s&l,uy=(s,c,l)=>s&c^s&l^c&l,ly=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Cr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pr=new Uint32Array(64),dy=class extends ay{constructor(){super(64,32,8,!1),this.A=Cr[0]|0,this.B=Cr[1]|0,this.C=Cr[2]|0,this.D=Cr[3]|0,this.E=Cr[4]|0,this.F=Cr[5]|0,this.G=Cr[6]|0,this.H=Cr[7]|0}get(){let{A:s,B:c,C:l,D:g,E:y,F:E,G:C,H:U}=this;return[s,c,l,g,y,E,C,U]}set(s,c,l,g,y,E,C,U){this.A=s|0,this.B=c|0,this.C=l|0,this.D=g|0,this.E=y|0,this.F=E|0,this.G=C|0,this.H=U|0}process(s,c){for(let H=0;H<16;H++,c+=4)Pr[H]=s.getUint32(c,!1);for(let H=16;H<64;H++){let j=Pr[H-15],Y=Pr[H-2],G=Mn(j,7)^Mn(j,18)^j>>>3,ee=Mn(Y,17)^Mn(Y,19)^Y>>>10;Pr[H]=ee+Pr[H-7]+G+Pr[H-16]|0}let{A:l,B:g,C:y,D:E,E:C,F:U,G:R,H:D}=this;for(let H=0;H<64;H++){let j=Mn(C,6)^Mn(C,11)^Mn(C,25),Y=D+j+cy(C,U,R)+ly[H]+Pr[H]|0,G=(Mn(l,2)^Mn(l,13)^Mn(l,22))+uy(l,g,y)|0;D=R,R=U,U=C,C=E+Y|0,E=y,y=g,g=l,l=Y+G|0}l=l+this.A|0,g=g+this.B|0,y=y+this.C|0,E=E+this.D|0,C=C+this.E|0,U=U+this.F|0,R=R+this.G|0,D=D+this.H|0,this.set(l,g,y,E,C,U,R,D)}roundClean(){Pr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Su=iy(()=>new dy);let Th=BigInt(0),Js=BigInt(1),fy=BigInt(2),Xs=s=>s instanceof Uint8Array,hy=Array.from({length:256},(s,c)=>c.toString(16).padStart(2,"0"));function Yo(s){if(!Xs(s))throw new Error("Uint8Array expected");let c="";for(let l=0;l<s.length;l++)c+=hy[s[l]];return c}function $h(s){let c=s.toString(16);return c.length&1?`0${c}`:c}function Au(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);return BigInt(s===""?"0":`0x${s}`)}function Jo(s){if(typeof s!="string")throw new Error("hex string expected, got "+typeof s);let c=s.length;if(c%2)throw new Error("padded hex string expected, got unpadded hex of length "+c);let l=new Uint8Array(c/2);for(let g=0;g<l.length;g++){let y=g*2,E=s.slice(y,y+2),C=Number.parseInt(E,16);if(Number.isNaN(C)||C<0)throw new Error("Invalid byte sequence");l[g]=C}return l}function Zt(s){return Au(Yo(s))}function Tu(s){if(!Xs(s))throw new Error("Uint8Array expected");return Au(Yo(Uint8Array.from(s).reverse()))}function Ir(s,c){return Jo(s.toString(16).padStart(c*2,"0"))}function $u(s,c){return Ir(s,c).reverse()}function py(s){return Jo($h(s))}function Dt(s,c,l){let g;if(typeof c=="string")try{g=Jo(c)}catch(E){throw new Error(`${s} must be valid hex string, got "${c}". Cause: ${E}`)}else if(Xs(c))g=Uint8Array.from(c);else throw new Error(`${s} must be hex string or Uint8Array`);let y=g.length;if(typeof l=="number"&&y!==l)throw new Error(`${s} expected ${l} bytes, got ${y}`);return g}function mo(...s){let c=new Uint8Array(s.reduce((g,y)=>g+y.length,0)),l=0;return s.forEach(g=>{if(!Xs(g))throw new Error("Uint8Array expected");c.set(g,l),l+=g.length}),c}function gy(s,c){if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}function my(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function by(s){let c;for(c=0;s>Th;s>>=Js,c+=1);return c}function wy(s,c){return s>>BigInt(c)&Js}let yy=(s,c,l)=>s|(l?Js:Th)<<BigInt(c),Bu=s=>(fy<<BigInt(s-1))-Js,Lu=s=>new Uint8Array(s),Bh=s=>Uint8Array.from(s);function Lh(s,c,l){if(typeof s!="number"||s<2)throw new Error("hashLen must be a number");if(typeof c!="number"||c<2)throw new Error("qByteLen must be a number");if(typeof l!="function")throw new Error("hmacFn must be a function");let g=Lu(s),y=Lu(s),E=0,C=()=>{g.fill(1),y.fill(0),E=0},U=(...H)=>l(y,g,...H),R=(H=Lu())=>{y=U(Bh([0]),H),g=U(),H.length!==0&&(y=U(Bh([1]),H),g=U())},D=()=>{if(E++>=1e3)throw new Error("drbg: tried 1000 values");let H=0,j=[];for(;H<c;){g=U();let Y=g.slice();j.push(Y),H+=g.length}return mo(...j)};return(H,j)=>{C(),R(H);let Y;for(;!(Y=j(D()));)R();return C(),Y}}let vy={bigint:s=>typeof s=="bigint",function:s=>typeof s=="function",boolean:s=>typeof s=="boolean",string:s=>typeof s=="string",stringOrUint8Array:s=>typeof s=="string"||s instanceof Uint8Array,isSafeInteger:s=>Number.isSafeInteger(s),array:s=>Array.isArray(s),field:(s,c)=>c.Fp.isValid(s),hash:s=>typeof s=="function"&&Number.isSafeInteger(s.outputLen)};function Hi(s,c,l={}){let g=(y,E,C)=>{let U=vy[E];if(typeof U!="function")throw new Error(`Invalid validator "${E}", expected function`);let R=s[y];if(!(C&&R===void 0)&&!U(R,s))throw new Error(`Invalid param ${String(y)}=${R} (${typeof R}), expected ${E}`)};for(let[y,E]of Object.entries(c))g(y,E,!1);for(let[y,E]of Object.entries(l))g(y,E,!0);return s}let _y=Object.freeze(Object.defineProperty({__proto__:null,bitGet:wy,bitLen:by,bitMask:Bu,bitSet:yy,bytesToHex:Yo,bytesToNumberBE:Zt,bytesToNumberLE:Tu,concatBytes:mo,createHmacDrbg:Lh,ensureBytes:Dt,equalBytes:gy,hexToBytes:Jo,hexToNumber:Au,numberToBytesBE:Ir,numberToBytesLE:$u,numberToHexUnpadded:$h,numberToVarBytesBE:py,utf8ToBytes:my,validateObject:Hi},Symbol.toStringTag,{value:"Module"}));let Tt=BigInt(0),lt=BigInt(1),bo=BigInt(2),Ey=BigInt(3),Cu=BigInt(4),Ch=BigInt(5),Ph=BigInt(8);BigInt(9),BigInt(16);function Pt(s,c){let l=s%c;return l>=Tt?l:c+l}function xy(s,c,l){if(l<=Tt||c<Tt)throw new Error("Expected power/modulo > 0");if(l===lt)return Tt;let g=lt;for(;c>Tt;)c<&&(g=g*s%l),s=s*s%l,c>>=lt;return g}function ln(s,c,l){let g=s;for(;c-- >Tt;)g*=g,g%=l;return g}function Pu(s,c){if(s===Tt||c<=Tt)throw new Error(`invert: expected positive integers, got n=${s} mod=${c}`);let l=Pt(s,c),g=c,y=Tt,E=lt;for(;l!==Tt;){let C=g/l,U=g%l,R=y-E*C;g=l,l=U,y=E,E=R}if(g!==lt)throw new Error("invert: does not exist");return Pt(y,c)}function ky(s){let c=(s-lt)/bo,l,g,y;for(l=s-lt,g=0;l%bo===Tt;l/=bo,g++);for(y=bo;y<s&&xy(y,c,s)!==s-lt;y++);if(g===1){let C=(s+lt)/Cu;return function(U,R){let D=U.pow(R,C);if(!U.eql(U.sqr(D),R))throw new Error("Cannot find square root");return D}}let E=(l+lt)/bo;return function(C,U){if(C.pow(U,c)===C.neg(C.ONE))throw new Error("Cannot find square root");let R=g,D=C.pow(C.mul(C.ONE,y),l),H=C.pow(U,E),j=C.pow(U,l);for(;!C.eql(j,C.ONE);){if(C.eql(j,C.ZERO))return C.ZERO;let Y=1;for(let ee=C.sqr(j);Y<R&&!C.eql(ee,C.ONE);Y++)ee=C.sqr(ee);let G=C.pow(D,lt<<BigInt(R-Y-1));D=C.sqr(G),H=C.mul(H,G),j=C.mul(j,D),R=Y}return H}}function Sy(s){if(s%Cu===Ey){let c=(s+lt)/Cu;return function(l,g){let y=l.pow(g,c);if(!l.eql(l.sqr(y),g))throw new Error("Cannot find square root");return y}}if(s%Ph===Ch){let c=(s-Ch)/Ph;return function(l,g){let y=l.mul(g,bo),E=l.pow(y,c),C=l.mul(g,E),U=l.mul(l.mul(C,bo),E),R=l.mul(C,l.sub(U,l.ONE));if(!l.eql(l.sqr(R),g))throw new Error("Cannot find square root");return R}}return ky(s)}let Ay=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ty(s){let c={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},l=Ay.reduce((g,y)=>(g[y]="function",g),c);return Hi(s,l)}function $y(s,c,l){if(l<Tt)throw new Error("Expected power > 0");if(l===Tt)return s.ONE;if(l===lt)return c;let g=s.ONE,y=c;for(;l>Tt;)l<&&(g=s.mul(g,y)),y=s.sqr(y),l>>=lt;return g}function By(s,c){let l=new Array(c.length),g=c.reduce((E,C,U)=>s.is0(C)?E:(l[U]=E,s.mul(E,C)),s.ONE),y=s.inv(g);return c.reduceRight((E,C,U)=>s.is0(C)?E:(l[U]=s.mul(E,l[U]),s.mul(E,C)),y),l}function Ih(s,c){let l=c!==void 0?c:s.toString(2).length,g=Math.ceil(l/8);return{nBitLength:l,nByteLength:g}}function Ly(s,c,l=!1,g={}){if(s<=Tt)throw new Error(`Expected Field ORDER > 0, got ${s}`);let{nBitLength:y,nByteLength:E}=Ih(s,c);if(E>2048)throw new Error("Field lengths over 2048 bytes are not supported");let C=Sy(s),U=Object.freeze({ORDER:s,BITS:y,BYTES:E,MASK:Bu(y),ZERO:Tt,ONE:lt,create:R=>Pt(R,s),isValid:R=>{if(typeof R!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof R}`);return Tt<=R&&R<s},is0:R=>R===Tt,isOdd:R=>(R<)===lt,neg:R=>Pt(-R,s),eql:(R,D)=>R===D,sqr:R=>Pt(R*R,s),add:(R,D)=>Pt(R+D,s),sub:(R,D)=>Pt(R-D,s),mul:(R,D)=>Pt(R*D,s),pow:(R,D)=>$y(U,R,D),div:(R,D)=>Pt(R*Pu(D,s),s),sqrN:R=>R*R,addN:(R,D)=>R+D,subN:(R,D)=>R-D,mulN:(R,D)=>R*D,inv:R=>Pu(R,s),sqrt:g.sqrt||(R=>C(U,R)),invertBatch:R=>By(U,R),cmov:(R,D,H)=>H?D:R,toBytes:R=>l?$u(R,E):Ir(R,E),fromBytes:R=>{if(R.length!==E)throw new Error(`Fp.fromBytes: expected ${E}, got ${R.length}`);return l?Tu(R):Zt(R)}});return Object.freeze(U)}function Nh(s){if(typeof s!="bigint")throw new Error("field order must be bigint");let c=s.toString(2).length;return Math.ceil(c/8)}function Oh(s){let c=Nh(s);return c+Math.ceil(c/2)}function Cy(s,c,l=!1){let g=s.length,y=Nh(c),E=Oh(c);if(g<16||g<E||g>1024)throw new Error(`expected ${E}-1024 bytes of input, got ${g}`);let C=l?Zt(s):Tu(s),U=Pt(C,c-lt)+lt;return l?$u(U,y):Ir(U,y)}let Py=BigInt(0),Iu=BigInt(1);function Iy(s,c){let l=(y,E)=>{let C=E.negate();return y?C:E},g=y=>{let E=Math.ceil(c/y)+1,C=2**(y-1);return{windows:E,windowSize:C}};return{constTimeNegate:l,unsafeLadder(y,E){let C=s.ZERO,U=y;for(;E>Py;)E&Iu&&(C=C.add(U)),U=U.double(),E>>=Iu;return C},precomputeWindow(y,E){let{windows:C,windowSize:U}=g(E),R=[],D=y,H=D;for(let j=0;j<C;j++){H=D,R.push(H);for(let Y=1;Y<U;Y++)H=H.add(D),R.push(H);D=H.double()}return R},wNAF(y,E,C){let{windows:U,windowSize:R}=g(y),D=s.ZERO,H=s.BASE,j=BigInt(2**y-1),Y=2**y,G=BigInt(y);for(let ee=0;ee<U;ee++){let Q=ee*R,te=Number(C&j);C>>=G,te>R&&(te-=Y,C+=Iu);let re=Q,X=Q+Math.abs(te)-1,pe=ee%2!==0,Ae=te<0;te===0?H=H.add(l(pe,E[re])):D=D.add(l(Ae,E[X]))}return{p:D,f:H}},wNAFCached(y,E,C,U){let R=y._WINDOW_SIZE||1,D=E.get(y);return D||(D=this.precomputeWindow(y,R),R!==1&&E.set(y,U(D))),this.wNAF(R,D,C)}}}function Rh(s){return Ty(s.Fp),Hi(s,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ih(s.n,s.nBitLength),...s,p:s.Fp.ORDER})}function Ny(s){let c=Rh(s);Hi(c,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:l,Fp:g,a:y}=c;if(l){if(!g.eql(y,g.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof l!="object"||typeof l.beta!="bigint"||typeof l.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...c})}let{bytesToNumberBE:Oy,hexToBytes:Ry}=_y,wo={Err:class extends Error{constructor(s=""){super(s)}},_parseInt(s){let{Err:c}=wo;if(s.length<2||s[0]!==2)throw new c("Invalid signature integer tag");let l=s[1],g=s.subarray(2,l+2);if(!l||g.length!==l)throw new c("Invalid signature integer: wrong length");if(g[0]&128)throw new c("Invalid signature integer: negative");if(g[0]===0&&!(g[1]&128))throw new c("Invalid signature integer: unnecessary leading zero");return{d:Oy(g),l:s.subarray(l+2)}},toSig(s){let{Err:c}=wo,l=typeof s=="string"?Ry(s):s;if(!(l instanceof Uint8Array))throw new Error("ui8a expected");let g=l.length;if(g<2||l[0]!=48)throw new c("Invalid signature tag");if(l[1]!==g-2)throw new c("Invalid signature: incorrect length");let{d:y,l:E}=wo._parseInt(l.subarray(2)),{d:C,l:U}=wo._parseInt(E);if(U.length)throw new c("Invalid signature: left bytes after parsing");return{r:y,s:C}},hexFromSig(s){let c=D=>Number.parseInt(D[0],16)&8?"00"+D:D,l=D=>{let H=D.toString(16);return H.length&1?`0${H}`:H},g=c(l(s.s)),y=c(l(s.r)),E=g.length/2,C=y.length/2,U=l(E),R=l(C);return`30${l(C+E+4)}02${R}${y}02${U}${g}`}},er=BigInt(0),dn=BigInt(1);BigInt(2);let Uh=BigInt(3);BigInt(4);function Uy(s){let c=Ny(s),{Fp:l}=c,g=c.toBytes||((ee,Q,te)=>{let re=Q.toAffine();return mo(Uint8Array.from([4]),l.toBytes(re.x),l.toBytes(re.y))}),y=c.fromBytes||(ee=>{let Q=ee.subarray(1),te=l.fromBytes(Q.subarray(0,l.BYTES)),re=l.fromBytes(Q.subarray(l.BYTES,2*l.BYTES));return{x:te,y:re}});function E(ee){let{a:Q,b:te}=c,re=l.sqr(ee),X=l.mul(re,ee);return l.add(l.add(X,l.mul(ee,Q)),te)}if(!l.eql(l.sqr(c.Gy),E(c.Gx)))throw new Error("bad generator point: equation left != right");function C(ee){return typeof ee=="bigint"&&er<ee&&ee<c.n}function U(ee){if(!C(ee))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function R(ee){let{allowedPrivateKeyLengths:Q,nByteLength:te,wrapPrivateKey:re,n:X}=c;if(Q&&typeof ee!="bigint"){if(ee instanceof Uint8Array&&(ee=Yo(ee)),typeof ee!="string"||!Q.includes(ee.length))throw new Error("Invalid key");ee=ee.padStart(te*2,"0")}let pe;try{pe=typeof ee=="bigint"?ee:Zt(Dt("private key",ee,te))}catch{throw new Error(`private key must be ${te} bytes, hex or bigint, not ${typeof ee}`)}return re&&(pe=Pt(pe,X)),U(pe),pe}let D=new Map;function H(ee){if(!(ee instanceof j))throw new Error("ProjectivePoint expected")}class j{constructor(Q,te,re){if(this.px=Q,this.py=te,this.pz=re,Q==null||!l.isValid(Q))throw new Error("x required");if(te==null||!l.isValid(te))throw new Error("y required");if(re==null||!l.isValid(re))throw new Error("z required")}static fromAffine(Q){let{x:te,y:re}=Q||{};if(!Q||!l.isValid(te)||!l.isValid(re))throw new Error("invalid affine point");if(Q instanceof j)throw new Error("projective point not allowed");let X=pe=>l.eql(pe,l.ZERO);return X(te)&&X(re)?j.ZERO:new j(te,re,l.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(Q){let te=l.invertBatch(Q.map(re=>re.pz));return Q.map((re,X)=>re.toAffine(te[X])).map(j.fromAffine)}static fromHex(Q){let te=j.fromAffine(y(Dt("pointHex",Q)));return te.assertValidity(),te}static fromPrivateKey(Q){return j.BASE.multiply(R(Q))}_setWindowSize(Q){this._WINDOW_SIZE=Q,D.delete(this)}assertValidity(){if(this.is0()){if(c.allowInfinityPoint&&!l.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:Q,y:te}=this.toAffine();if(!l.isValid(Q)||!l.isValid(te))throw new Error("bad point: x or y not FE");let re=l.sqr(te),X=E(Q);if(!l.eql(re,X))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:Q}=this.toAffine();if(l.isOdd)return!l.isOdd(Q);throw new Error("Field doesn't support isOdd")}equals(Q){H(Q);let{px:te,py:re,pz:X}=this,{px:pe,py:Ae,pz:$e}=Q,ge=l.eql(l.mul(te,$e),l.mul(pe,X)),fe=l.eql(l.mul(re,$e),l.mul(Ae,X));return ge&&fe}negate(){return new j(this.px,l.neg(this.py),this.pz)}double(){let{a:Q,b:te}=c,re=l.mul(te,Uh),{px:X,py:pe,pz:Ae}=this,$e=l.ZERO,ge=l.ZERO,fe=l.ZERO,se=l.mul(X,X),be=l.mul(pe,pe),Be=l.mul(Ae,Ae),Oe=l.mul(X,pe);return Oe=l.add(Oe,Oe),fe=l.mul(X,Ae),fe=l.add(fe,fe),$e=l.mul(Q,fe),ge=l.mul(re,Be),ge=l.add($e,ge),$e=l.sub(be,ge),ge=l.add(be,ge),ge=l.mul($e,ge),$e=l.mul(Oe,$e),fe=l.mul(re,fe),Be=l.mul(Q,Be),Oe=l.sub(se,Be),Oe=l.mul(Q,Oe),Oe=l.add(Oe,fe),fe=l.add(se,se),se=l.add(fe,se),se=l.add(se,Be),se=l.mul(se,Oe),ge=l.add(ge,se),Be=l.mul(pe,Ae),Be=l.add(Be,Be),se=l.mul(Be,Oe),$e=l.sub($e,se),fe=l.mul(Be,be),fe=l.add(fe,fe),fe=l.add(fe,fe),new j($e,ge,fe)}add(Q){H(Q);let{px:te,py:re,pz:X}=this,{px:pe,py:Ae,pz:$e}=Q,ge=l.ZERO,fe=l.ZERO,se=l.ZERO,be=c.a,Be=l.mul(c.b,Uh),Oe=l.mul(te,pe),gt=l.mul(re,Ae),mt=l.mul(X,$e),bt=l.add(te,re),me=l.add(pe,Ae);bt=l.mul(bt,me),me=l.add(Oe,gt),bt=l.sub(bt,me),me=l.add(te,X);let ke=l.add(pe,$e);return me=l.mul(me,ke),ke=l.add(Oe,mt),me=l.sub(me,ke),ke=l.add(re,X),ge=l.add(Ae,$e),ke=l.mul(ke,ge),ge=l.add(gt,mt),ke=l.sub(ke,ge),se=l.mul(be,me),ge=l.mul(Be,mt),se=l.add(ge,se),ge=l.sub(gt,se),se=l.add(gt,se),fe=l.mul(ge,se),gt=l.add(Oe,Oe),gt=l.add(gt,Oe),mt=l.mul(be,mt),me=l.mul(Be,me),gt=l.add(gt,mt),mt=l.sub(Oe,mt),mt=l.mul(be,mt),me=l.add(me,mt),Oe=l.mul(gt,me),fe=l.add(fe,Oe),Oe=l.mul(ke,me),ge=l.mul(bt,ge),ge=l.sub(ge,Oe),Oe=l.mul(bt,gt),se=l.mul(ke,se),se=l.add(se,Oe),new j(ge,fe,se)}subtract(Q){return this.add(Q.negate())}is0(){return this.equals(j.ZERO)}wNAF(Q){return G.wNAFCached(this,D,Q,te=>{let re=l.invertBatch(te.map(X=>X.pz));return te.map((X,pe)=>X.toAffine(re[pe])).map(j.fromAffine)})}multiplyUnsafe(Q){let te=j.ZERO;if(Q===er)return te;if(U(Q),Q===dn)return this;let{endo:re}=c;if(!re)return G.unsafeLadder(this,Q);let{k1neg:X,k1:pe,k2neg:Ae,k2:$e}=re.splitScalar(Q),ge=te,fe=te,se=this;for(;pe>er||$e>er;)pe&dn&&(ge=ge.add(se)),$e&dn&&(fe=fe.add(se)),se=se.double(),pe>>=dn,$e>>=dn;return X&&(ge=ge.negate()),Ae&&(fe=fe.negate()),fe=new j(l.mul(fe.px,re.beta),fe.py,fe.pz),ge.add(fe)}multiply(Q){U(Q);let te=Q,re,X,{endo:pe}=c;if(pe){let{k1neg:Ae,k1:$e,k2neg:ge,k2:fe}=pe.splitScalar(te),{p:se,f:be}=this.wNAF($e),{p:Be,f:Oe}=this.wNAF(fe);se=G.constTimeNegate(Ae,se),Be=G.constTimeNegate(ge,Be),Be=new j(l.mul(Be.px,pe.beta),Be.py,Be.pz),re=se.add(Be),X=be.add(Oe)}else{let{p:Ae,f:$e}=this.wNAF(te);re=Ae,X=$e}return j.normalizeZ([re,X])[0]}multiplyAndAddUnsafe(Q,te,re){let X=j.BASE,pe=($e,ge)=>ge===er||ge===dn||!$e.equals(X)?$e.multiplyUnsafe(ge):$e.multiply(ge),Ae=pe(this,te).add(pe(Q,re));return Ae.is0()?void 0:Ae}toAffine(Q){let{px:te,py:re,pz:X}=this,pe=this.is0();Q==null&&(Q=pe?l.ONE:l.inv(X));let Ae=l.mul(te,Q),$e=l.mul(re,Q),ge=l.mul(X,Q);if(pe)return{x:l.ZERO,y:l.ZERO};if(!l.eql(ge,l.ONE))throw new Error("invZ was invalid");return{x:Ae,y:$e}}isTorsionFree(){let{h:Q,isTorsionFree:te}=c;if(Q===dn)return!0;if(te)return te(j,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:Q,clearCofactor:te}=c;return Q===dn?this:te?te(j,this):this.multiplyUnsafe(c.h)}toRawBytes(Q=!0){return this.assertValidity(),g(j,this,Q)}toHex(Q=!0){return Yo(this.toRawBytes(Q))}}j.BASE=new j(c.Gx,c.Gy,l.ONE),j.ZERO=new j(l.ZERO,l.ONE,l.ZERO);let Y=c.nBitLength,G=Iy(j,c.endo?Math.ceil(Y/2):Y);return{CURVE:c,ProjectivePoint:j,normPrivateKeyToScalar:R,weierstrassEquation:E,isWithinCurveOrder:C}}function zy(s){let c=Rh(s);return Hi(c,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...c})}function My(s){let c=zy(s),{Fp:l,n:g}=c,y=l.BYTES+1,E=2*l.BYTES+1;function C(me){return er<me&&me<l.ORDER}function U(me){return Pt(me,g)}function R(me){return Pu(me,g)}let{ProjectivePoint:D,normPrivateKeyToScalar:H,weierstrassEquation:j,isWithinCurveOrder:Y}=Uy({...c,toBytes(me,ke,Ue){let Ge=ke.toAffine(),Ye=l.toBytes(Ge.x),Ke=mo;return Ue?Ke(Uint8Array.from([ke.hasEvenY()?2:3]),Ye):Ke(Uint8Array.from([4]),Ye,l.toBytes(Ge.y))},fromBytes(me){let ke=me.length,Ue=me[0],Ge=me.subarray(1);if(ke===y&&(Ue===2||Ue===3)){let Ye=Zt(Ge);if(!C(Ye))throw new Error("Point is not on curve");let Ke=j(Ye),Ft=l.sqrt(Ke),It=(Ft&dn)===dn;return(Ue&1)===1!==It&&(Ft=l.neg(Ft)),{x:Ye,y:Ft}}else if(ke===E&&Ue===4){let Ye=l.fromBytes(Ge.subarray(0,l.BYTES)),Ke=l.fromBytes(Ge.subarray(l.BYTES,2*l.BYTES));return{x:Ye,y:Ke}}else throw new Error(`Point of length ${ke} was invalid. Expected ${y} compressed bytes or ${E} uncompressed bytes`)}}),G=me=>Yo(Ir(me,c.nByteLength));function ee(me){let ke=g>>dn;return me>ke}function Q(me){return ee(me)?U(-me):me}let te=(me,ke,Ue)=>Zt(me.slice(ke,Ue));class re{constructor(ke,Ue,Ge){this.r=ke,this.s=Ue,this.recovery=Ge,this.assertValidity()}static fromCompact(ke){let Ue=c.nByteLength;return ke=Dt("compactSignature",ke,Ue*2),new re(te(ke,0,Ue),te(ke,Ue,2*Ue))}static fromDER(ke){let{r:Ue,s:Ge}=wo.toSig(Dt("DER",ke));return new re(Ue,Ge)}assertValidity(){if(!Y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!Y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ke){return new re(this.r,this.s,ke)}recoverPublicKey(ke){let{r:Ue,s:Ge,recovery:Ye}=this,Ke=fe(Dt("msgHash",ke));if(Ye==null||![0,1,2,3].includes(Ye))throw new Error("recovery id invalid");let Ft=Ye===2||Ye===3?Ue+c.n:Ue;if(Ft>=l.ORDER)throw new Error("recovery id 2 or 3 invalid");let It=Ye&1?"03":"02",Yt=D.fromHex(It+G(Ft)),wt=R(Ft),hn=U(-Ke*wt),Sn=U(Ge*wt),jn=D.BASE.multiplyAndAddUnsafe(Yt,hn,Sn);if(!jn)throw new Error("point at infinify");return jn.assertValidity(),jn}hasHighS(){return ee(this.s)}normalizeS(){return this.hasHighS()?new re(this.r,U(-this.s),this.recovery):this}toDERRawBytes(){return Jo(this.toDERHex())}toDERHex(){return wo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Jo(this.toCompactHex())}toCompactHex(){return G(this.r)+G(this.s)}}let X={isValidPrivateKey(me){try{return H(me),!0}catch{return!1}},normPrivateKeyToScalar:H,randomPrivateKey:()=>{let me=Oh(c.n);return Cy(c.randomBytes(me),c.n)},precompute(me=8,ke=D.BASE){return ke._setWindowSize(me),ke.multiply(BigInt(3)),ke}};function pe(me,ke=!0){return D.fromPrivateKey(me).toRawBytes(ke)}function Ae(me){let ke=me instanceof Uint8Array,Ue=typeof me=="string",Ge=(ke||Ue)&&me.length;return ke?Ge===y||Ge===E:Ue?Ge===2*y||Ge===2*E:me instanceof D}function $e(me,ke,Ue=!0){if(Ae(me))throw new Error("first arg must be private key");if(!Ae(ke))throw new Error("second arg must be public key");return D.fromHex(ke).multiply(H(me)).toRawBytes(Ue)}let ge=c.bits2int||function(me){let ke=Zt(me),Ue=me.length*8-c.nBitLength;return Ue>0?ke>>BigInt(Ue):ke},fe=c.bits2int_modN||function(me){return U(ge(me))},se=Bu(c.nBitLength);function be(me){if(typeof me!="bigint")throw new Error("bigint expected");if(!(er<=me&&me<se))throw new Error(`bigint expected < 2^${c.nBitLength}`);return Ir(me,c.nByteLength)}function Be(me,ke,Ue=Oe){if(["recovered","canonical"].some(sn=>sn in Ue))throw new Error("sign() legacy options not supported");let{hash:Ge,randomBytes:Ye}=c,{lowS:Ke,prehash:Ft,extraEntropy:It}=Ue;Ke==null&&(Ke=!0),me=Dt("msgHash",me),Ft&&(me=Dt("prehashed msgHash",Ge(me)));let Yt=fe(me),wt=H(ke),hn=[be(wt),be(Yt)];if(It!=null){let sn=It===!0?Ye(l.BYTES):It;hn.push(Dt("extraEntropy",sn))}let Sn=mo(...hn),jn=Yt;function Dr(sn){let Fr=ge(sn);if(!Y(Fr))return;let Eo=R(Fr),an=D.BASE.multiply(Fr).toAffine(),ir=U(an.x);if(ir===er)return;let xo=U(Eo*U(jn+ir*wt));if(xo===er)return;let ko=(an.x===ir?0:2)|Number(an.y&dn),jr=xo;return Ke&&ee(xo)&&(jr=Q(xo),ko^=1),new re(ir,jr,ko)}return{seed:Sn,k2sig:Dr}}let Oe={lowS:c.lowS,prehash:!1},gt={lowS:c.lowS,prehash:!1};function mt(me,ke,Ue=Oe){let{seed:Ge,k2sig:Ye}=Be(me,ke,Ue),Ke=c;return Lh(Ke.hash.outputLen,Ke.nByteLength,Ke.hmac)(Ge,Ye)}D.BASE._setWindowSize(8);function bt(me,ke,Ue,Ge=gt){var Ye;let Ke=me;if(ke=Dt("msgHash",ke),Ue=Dt("publicKey",Ue),"strict"in Ge)throw new Error("options.strict was renamed to lowS");let{lowS:Ft,prehash:It}=Ge,Yt,wt;try{if(typeof Ke=="string"||Ke instanceof Uint8Array)try{Yt=re.fromDER(Ke)}catch(an){if(!(an instanceof wo.Err))throw an;Yt=re.fromCompact(Ke)}else if(typeof Ke=="object"&&typeof Ke.r=="bigint"&&typeof Ke.s=="bigint"){let{r:an,s:ir}=Ke;Yt=new re(an,ir)}else throw new Error("PARSE");wt=D.fromHex(Ue)}catch(an){if(an.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ft&&Yt.hasHighS())return!1;It&&(ke=c.hash(ke));let{r:hn,s:Sn}=Yt,jn=fe(ke),Dr=R(Sn),sn=U(jn*Dr),Fr=U(hn*Dr),Eo=(Ye=D.BASE.multiplyAndAddUnsafe(wt,sn,Fr))==null?void 0:Ye.toAffine();return Eo?U(Eo.x)===hn:!1}return{CURVE:c,getPublicKey:pe,getSharedSecret:$e,sign:mt,verify:bt,ProjectivePoint:D,Signature:re,utils:X}}class zh extends Sh{constructor(c,l){super(),this.finished=!1,this.destroyed=!1,ty(c);let g=ku(l);if(this.iHash=c.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let y=this.blockLen,E=new Uint8Array(y);E.set(g.length>y?c.create().update(g).digest():g);for(let C=0;C<E.length;C++)E[C]^=54;this.iHash.update(E),this.oHash=c.create();for(let C=0;C<E.length;C++)E[C]^=106;this.oHash.update(E),E.fill(0)}update(c){return Ys(this),this.iHash.update(c),this}digestInto(c){Ys(this),xh(c,this.outputLen),this.finished=!0,this.iHash.digestInto(c),this.oHash.update(c),this.oHash.digestInto(c),this.destroy()}digest(){let c=new Uint8Array(this.oHash.outputLen);return this.digestInto(c),c}_cloneInto(c){c||(c=Object.create(Object.getPrototypeOf(this),{}));let{oHash:l,iHash:g,finished:y,destroyed:E,blockLen:C,outputLen:U}=this;return c=c,c.finished=y,c.destroyed=E,c.blockLen=C,c.outputLen=U,c.oHash=l._cloneInto(c.oHash),c.iHash=g._cloneInto(c.iHash),c}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let Mh=(s,c,l)=>new zh(s,c).update(l).digest();Mh.create=(s,c)=>new zh(s,c);function Dy(s){return{hash:s,hmac:(c,...l)=>Mh(s,c,oy(...l)),randomBytes:Ah}}function Fy(s,c){let l=g=>My({...s,...Dy(g)});return Object.freeze({...l(c),create:l})}let ea=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ta=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Dh=BigInt(1),na=BigInt(2),Fh=(s,c)=>(s+c/na)/c;function jh(s){let c=ea,l=BigInt(3),g=BigInt(6),y=BigInt(11),E=BigInt(22),C=BigInt(23),U=BigInt(44),R=BigInt(88),D=s*s*s%c,H=D*D*s%c,j=ln(H,l,c)*H%c,Y=ln(j,l,c)*H%c,G=ln(Y,na,c)*D%c,ee=ln(G,y,c)*G%c,Q=ln(ee,E,c)*ee%c,te=ln(Q,U,c)*Q%c,re=ln(te,R,c)*te%c,X=ln(re,U,c)*Q%c,pe=ln(X,l,c)*H%c,Ae=ln(pe,C,c)*ee%c,$e=ln(Ae,g,c)*D%c,ge=ln($e,na,c);if(!Nu.eql(Nu.sqr(ge),s))throw new Error("Cannot find square root");return ge}let Nu=Ly(ea,void 0,void 0,{sqrt:jh}),Vi=Fy({a:BigInt(0),b:BigInt(7),Fp:Nu,n:ta,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:s=>{let c=ta,l=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),g=-Dh*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),y=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),E=l,C=BigInt("0x100000000000000000000000000000000"),U=Fh(E*s,c),R=Fh(-g*s,c),D=Pt(s-U*l-R*y,c),H=Pt(-U*g-R*E,c),j=D>C,Y=H>C;if(j&&(D=c-D),Y&&(H=c-H),D>C||H>C)throw new Error("splitScalar: Endomorphism failed, k="+s);return{k1neg:j,k1:D,k2neg:Y,k2:H}}}},Su),ra=BigInt(0),Hh=s=>typeof s=="bigint"&&ra<s&&s<ea,jy=s=>typeof s=="bigint"&&ra<s&&s<ta,Vh={};function oa(s,...c){let l=Vh[s];if(l===void 0){let g=Su(Uint8Array.from(s,y=>y.charCodeAt(0)));l=mo(g,g),Vh[s]=l}return Su(mo(l,...c))}let Ou=s=>s.toRawBytes(!0).slice(1),Ru=s=>Ir(s,32),Uu=s=>Pt(s,ea),qi=s=>Pt(s,ta),zu=Vi.ProjectivePoint,Hy=(s,c,l)=>zu.BASE.multiplyAndAddUnsafe(s,c,l);function Mu(s){let c=Vi.utils.normPrivateKeyToScalar(s),l=zu.fromPrivateKey(c);return{scalar:l.hasEvenY()?c:qi(-c),bytes:Ou(l)}}function qh(s){if(!Hh(s))throw new Error("bad x: need 0 < x < p");let c=Uu(s*s),l=Uu(c*s+BigInt(7)),g=jh(l);g%na!==ra&&(g=Uu(-g));let y=new zu(s,g,Dh);return y.assertValidity(),y}function Wh(...s){return qi(Zt(oa("BIP0340/challenge",...s)))}function Vy(s){return Mu(s).bytes}function qy(s,c,l=Ah(32)){let g=Dt("message",s),{bytes:y,scalar:E}=Mu(c),C=Dt("auxRand",l,32),U=Ru(E^Zt(oa("BIP0340/aux",C))),R=oa("BIP0340/nonce",U,y,g),D=qi(Zt(R));if(D===ra)throw new Error("sign failed: k is zero");let{bytes:H,scalar:j}=Mu(D),Y=Wh(H,y,g),G=new Uint8Array(64);if(G.set(H,0),G.set(Ru(qi(j+Y*E)),32),!Qh(G,g,y))throw new Error("sign: Invalid signature produced");return G}function Qh(s,c,l){let g=Dt("signature",s,64),y=Dt("message",c),E=Dt("publicKey",l,32);try{let C=qh(Zt(E)),U=Zt(g.subarray(0,32));if(!Hh(U))return!1;let R=Zt(g.subarray(32,64));if(!jy(R))return!1;let D=Wh(Ru(U),Ou(C),y),H=Hy(C,R,qi(-D));return!(!H||!H.hasEvenY()||H.toAffine().x!==U)}catch{return!1}}let Qt={getPublicKey:Vy,sign:qy,verify:Qh,utils:{randomPrivateKey:Vi.utils.randomPrivateKey,lift_x:qh,pointToBytes:Ou,numberToBytesBE:Ir,bytesToNumberBE:Zt,taggedHash:oa,mod:Pt}};function Du(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}function Wy(s){if(typeof s!="boolean")throw new Error(`Expected boolean, not ${s}`)}function Kh(s,...c){if(!(s instanceof Uint8Array))throw new Error("Expected Uint8Array");if(c.length>0&&!c.includes(s.length))throw new Error(`Expected Uint8Array of length ${c}, not of length=${s.length}`)}function Qy(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Du(s.outputLen),Du(s.blockLen)}function Ky(s,c=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(c&&s.finished)throw new Error("Hash#digest() has already been called")}function Gy(s,c){Kh(s);let l=c.outputLen;if(s.length<l)throw new Error(`digestInto() expects output buffer of length at least ${l}`)}let Fu={number:Du,bool:Wy,bytes:Kh,hash:Qy,exists:Ky,output:Gy};function Zy(s,c,l,g){if(typeof s.setBigUint64=="function")return s.setBigUint64(c,l,g);let y=BigInt(32),E=BigInt(4294967295),C=Number(l>>y&E),U=Number(l&E),R=g?4:0,D=g?0:4;s.setUint32(c+R,C,g),s.setUint32(c+D,U,g)}class Yy extends Xw{constructor(c,l,g,y){super(),this.blockLen=c,this.outputLen=l,this.padOffset=g,this.isLE=y,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(c),this.view=vu(this.buffer)}update(c){Fu.exists(this);let{view:l,buffer:g,blockLen:y}=this;c=vh(c);let E=c.length;for(let C=0;C<E;){let U=Math.min(y-this.pos,E-C);if(U===y){let R=vu(c);for(;y<=E-C;C+=y)this.process(R,C);continue}g.set(c.subarray(C,C+U),this.pos),this.pos+=U,C+=U,this.pos===y&&(this.process(l,0),this.pos=0)}return this.length+=c.length,this.roundClean(),this}digestInto(c){Fu.exists(this),Fu.output(c,this),this.finished=!0;let{buffer:l,view:g,blockLen:y,isLE:E}=this,{pos:C}=this;l[C++]=128,this.buffer.subarray(C).fill(0),this.padOffset>y-C&&(this.process(g,0),C=0);for(let j=C;j<y;j++)l[j]=0;Zy(g,y-8,BigInt(this.length*8),E),this.process(g,0);let U=vu(c),R=this.outputLen;if(R%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let D=R/4,H=this.get();if(D>H.length)throw new Error("_sha2: outputLen bigger than state");for(let j=0;j<D;j++)U.setUint32(4*j,H[j],E)}digest(){let{buffer:c,outputLen:l}=this;this.digestInto(c);let g=c.slice(0,l);return this.destroy(),g}_cloneInto(c){c||(c=new this.constructor),c.set(...this.get());let{blockLen:l,buffer:g,length:y,finished:E,destroyed:C,pos:U}=this;return c.length=y,c.pos=U,c.finished=E,c.destroyed=C,y%l&&c.buffer.set(g),c}}let Jy=(s,c,l)=>s&c^~s&l,Xy=(s,c,l)=>s&c^s&l^c&l,e1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Nr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Or=new Uint32Array(64);class Gh extends Yy{constructor(){super(64,32,8,!1),this.A=Nr[0]|0,this.B=Nr[1]|0,this.C=Nr[2]|0,this.D=Nr[3]|0,this.E=Nr[4]|0,this.F=Nr[5]|0,this.G=Nr[6]|0,this.H=Nr[7]|0}get(){let{A:c,B:l,C:g,D:y,E,F:C,G:U,H:R}=this;return[c,l,g,y,E,C,U,R]}set(c,l,g,y,E,C,U,R){this.A=c|0,this.B=l|0,this.C=g|0,this.D=y|0,this.E=E|0,this.F=C|0,this.G=U|0,this.H=R|0}process(c,l){for(let j=0;j<16;j++,l+=4)Or[j]=c.getUint32(l,!1);for(let j=16;j<64;j++){let Y=Or[j-15],G=Or[j-2],ee=zn(Y,7)^zn(Y,18)^Y>>>3,Q=zn(G,17)^zn(G,19)^G>>>10;Or[j]=Q+Or[j-7]+ee+Or[j-16]|0}let{A:g,B:y,C:E,D:C,E:U,F:R,G:D,H}=this;for(let j=0;j<64;j++){let Y=zn(U,6)^zn(U,11)^zn(U,25),G=H+Y+Jy(U,R,D)+e1[j]+Or[j]|0,ee=(zn(g,2)^zn(g,13)^zn(g,22))+Xy(g,y,E)|0;H=D,D=R,R=U,U=C+G|0,C=E,E=y,y=g,g=G+ee|0}g=g+this.A|0,y=y+this.B|0,E=E+this.C|0,C=C+this.D|0,U=U+this.E|0,R=R+this.F|0,D=D+this.G|0,H=H+this.H|0,this.set(g,y,E,C,U,R,D,H)}roundClean(){Or.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class t1 extends Gh{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}let ju=_h(()=>new Gh);_h(()=>new t1);var Xo=Symbol("verified"),n1=s=>s instanceof Object;function r1(s){if(!n1(s)||typeof s.kind!="number"||typeof s.content!="string"||typeof s.created_at!="number"||typeof s.pubkey!="string"||!s.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(s.tags))return!1;for(let c=0;c<s.tags.length;c++){let l=s.tags[c];if(!Array.isArray(l))return!1;for(let g=0;g<l.length;g++)if(typeof l[g]=="object")return!1}return!0}new TextDecoder("utf-8");var o1=new TextEncoder,i1=class{generateSecretKey(){return Qt.utils.randomPrivateKey()}getPublicKey(s){return Wt(Qt.getPublicKey(s))}finalizeEvent(s,c){let l=s;return l.pubkey=Wt(Qt.getPublicKey(c)),l.id=Hu(l),l.sig=Wt(Qt.sign(Hu(l),c)),l[Xo]=!0,l}verifyEvent(s){if(typeof s[Xo]=="boolean")return s[Xo];let c=Hu(s);if(c!==s.id)return s[Xo]=!1,!1;try{let l=Qt.verify(s.sig,c,s.pubkey);return s[Xo]=l,l}catch{return s[Xo]=!1,!1}}};function s1(s){if(!r1(s))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,s.pubkey,s.created_at,s.kind,s.tags,s.content])}function Hu(s){let c=ju(o1.encode(s1(s)));return Wt(c)}var ia=new i1,a1=ia.generateSecretKey,Zh=ia.getPublicKey;ia.finalizeEvent,ia.verifyEvent;var yo=Symbol("verified"),c1=s=>s instanceof Object;function u1(s){if(!c1(s)||typeof s.kind!="number"||typeof s.content!="string"||typeof s.created_at!="number"||typeof s.pubkey!="string"||!s.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(s.tags))return!1;for(let c=0;c<s.tags.length;c++){let l=s.tags[c];if(!Array.isArray(l))return!1;for(let g=0;g<l.length;g++)if(typeof l[g]=="object")return!1}return!0}new TextDecoder("utf-8");var l1=new TextEncoder;function Wi(s){s.indexOf("://")===-1&&(s="wss://"+s);let c=new URL(s);return c.pathname=c.pathname.replace(/\/+/g,"/"),c.pathname.endsWith("/")&&(c.pathname=c.pathname.slice(0,-1)),(c.port==="80"&&c.protocol==="ws:"||c.port==="443"&&c.protocol==="wss:")&&(c.port=""),c.searchParams.sort(),c.hash="",c.toString()}var d1=class{constructor(s){ue(this,"value"),ue(this,"next",null),ue(this,"prev",null),this.value=s}},f1=class{constructor(){ue(this,"first"),ue(this,"last"),this.first=null,this.last=null}enqueue(s){let c=new d1(s);return this.last?this.last===this.first?(this.last=c,this.last.prev=this.first,this.first.next=c):(c.prev=this.last,this.last.next=c,this.last=c):(this.first=c,this.last=c),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){let c=this.first;return this.first=null,this.last=null,c.value}let s=this.first;return this.first=s.next,s.value}},h1=class{generateSecretKey(){return Qt.utils.randomPrivateKey()}getPublicKey(s){return Wt(Qt.getPublicKey(s))}finalizeEvent(s,c){let l=s;return l.pubkey=Wt(Qt.getPublicKey(c)),l.id=Vu(l),l.sig=Wt(Qt.sign(Vu(l),c)),l[yo]=!0,l}verifyEvent(s){if(typeof s[yo]=="boolean")return s[yo];let c=Vu(s);if(c!==s.id)return s[yo]=!1,!1;try{let l=Qt.verify(s.sig,c,s.pubkey);return s[yo]=l,l}catch{return s[yo]=!1,!1}}};function p1(s){if(!u1(s))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,s.pubkey,s.created_at,s.kind,s.tags,s.content])}function Vu(s){let c=ju(l1.encode(p1(s)));return Wt(c)}var sa=new h1;sa.generateSecretKey,sa.getPublicKey,sa.finalizeEvent;var g1=sa.verifyEvent,m1=22242;function b1(s,c){if(s.ids&&s.ids.indexOf(c.id)===-1&&!s.ids.some(l=>c.id.startsWith(l))||s.kinds&&s.kinds.indexOf(c.kind)===-1||s.authors&&s.authors.indexOf(c.pubkey)===-1&&!s.authors.some(l=>c.pubkey.startsWith(l)))return!1;for(let l in s)if(l[0]==="#"){let g=l.slice(1),y=s[`#${g}`];if(y&&!c.tags.find(([E,C])=>E===l.slice(1)&&y.indexOf(C)!==-1))return!1}return!(s.since&&c.created_at<s.since||s.until&&c.created_at>s.until)}function w1(s,c){for(let l=0;l<s.length;l++)if(b1(s[l],c))return!0;return!1}function y1(s,c){let l=c.length+3,g=s.indexOf(`"${c}":`)+l,y=s.slice(g).indexOf('"')+g+1;return s.slice(y,y+64)}function v1(s){let c=s.slice(0,22).indexOf('"EVENT"');if(c===-1)return null;let l=s.slice(c+7+1).indexOf('"');if(l===-1)return null;let g=c+7+1+l,y=s.slice(g+1,80).indexOf('"');if(y===-1)return null;let E=g+1+y;return s.slice(g+1,E)}function _1(s,c){return{kind:m1,created_at:Math.floor(Date.now()/1e3),tags:[["relay",s],["challenge",c]],content:""}}async function E1(){return new Promise(s=>{let c=new MessageChannel,l=()=>{c.port1.removeEventListener("message",l),s()};c.port1.addEventListener("message",l),c.port2.postMessage(0),c.port1.start()})}var x1=s=>(s[yo]=!0,!0),Yh;try{Yh=WebSocket}catch{}var Jh=class{constructor(s,c){ue(this,"url"),ue(this,"_connected",!1),ue(this,"onclose",null),ue(this,"onnotice",l=>console.debug(`NOTICE from ${this.url}: ${l}`)),ue(this,"_onauth",null),ue(this,"baseEoseTimeout",4400),ue(this,"connectionTimeout",4400),ue(this,"openSubs",new Map),ue(this,"connectionTimeoutHandle"),ue(this,"connectionPromise"),ue(this,"openCountRequests",new Map),ue(this,"openEventPublishes",new Map),ue(this,"ws"),ue(this,"incomingMessageQueue",new f1),ue(this,"queueRunning",!1),ue(this,"challenge"),ue(this,"serial",0),ue(this,"verifyEvent"),this.url=Wi(s),this.verifyEvent=c.verifyEvent}static async connect(s,c){let l=new Jh(s,c);return await l.connect(),l}closeAllSubscriptions(s){for(let[c,l]of this.openSubs)l.close(s);this.openSubs.clear();for(let[c,l]of this.openEventPublishes)l.reject(new Error(s));this.openEventPublishes.clear();for(let[c,l]of this.openCountRequests)l.reject(new Error(s));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.connectionPromise=new Promise((s,c)=>{this.connectionTimeoutHandle=setTimeout(()=>{var l;c("connection timed out"),this.connectionPromise=void 0,(l=this.onclose)==null||l.call(this),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new Yh(this.url)}catch(l){c(l);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,s()},this.ws.onerror=l=>{var g;c(l.message),this._connected&&(this._connected=!1,this.connectionPromise=void 0,(g=this.onclose)==null||g.call(this),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{var l;this._connected&&(this._connected=!1,this.connectionPromise=void 0,(l=this.onclose)==null||l.call(this),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await E1();this.queueRunning=!1}handleNext(){var s,c,l;let g=this.incomingMessageQueue.dequeue();if(!g)return!1;let y=v1(g);if(y){let E=this.openSubs.get(y);if(!E)return;let C=y1(g,"id"),U=(s=E.alreadyHaveEvent)==null?void 0:s.call(E,C);if((c=E.receivedEvent)==null||c.call(E,this,C),U)return}try{let E=JSON.parse(g);switch(E[0]){case"EVENT":{let C=this.openSubs.get(E[1]),U=E[2];this.verifyEvent(U)&&w1(C.filters,U)&&C.onevent(U);return}case"COUNT":{let C=E[1],U=E[2],R=this.openCountRequests.get(C);R&&(R.resolve(U.count),this.openCountRequests.delete(C));return}case"EOSE":{let C=this.openSubs.get(E[1]);if(!C)return;C.receivedEose();return}case"OK":{let C=E[1],U=E[2],R=E[3],D=this.openEventPublishes.get(C);U?D.resolve(R):D.reject(new Error(R)),this.openEventPublishes.delete(C);return}case"CLOSED":{let C=E[1],U=this.openSubs.get(C);if(!U)return;U.closed=!0,U.close(E[2]);return}case"NOTICE":this.onnotice(E[1]);return;case"AUTH":{this.challenge=E[1],(l=this._onauth)==null||l.call(this,E[1]);return}}}catch{return}}async send(s){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{var c;(c=this.ws)==null||c.send(s)})}async auth(s){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");let c=await s(_1(this.url,this.challenge)),l=new Promise((g,y)=>{this.openEventPublishes.set(c.id,{resolve:g,reject:y})});return this.send('["AUTH",'+JSON.stringify(c)+"]"),l}async publish(s){let c=new Promise((l,g)=>{this.openEventPublishes.set(s.id,{resolve:l,reject:g})});return this.send('["EVENT",'+JSON.stringify(s)+"]"),c}async count(s,c){this.serial++;let l=c?.id||"count:"+this.serial,g=new Promise((y,E)=>{this.openCountRequests.set(l,{resolve:y,reject:E})});return this.send('["COUNT","'+l+'",'+JSON.stringify(s)+"]"),g}subscribe(s,c){let l=this.prepareSubscription(s,c);return l.fire(),l}prepareSubscription(s,c){this.serial++;let l=c.id||"sub:"+this.serial,g=new k1(this,l,s,c);return this.openSubs.set(l,g),g}close(){var s;this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,(s=this.ws)==null||s.close()}_onmessage(s){this.incomingMessageQueue.enqueue(s.data),this.queueRunning||this.runQueue()}},k1=class{constructor(s,c,l,g){ue(this,"relay"),ue(this,"id"),ue(this,"closed",!1),ue(this,"eosed",!1),ue(this,"filters"),ue(this,"alreadyHaveEvent"),ue(this,"receivedEvent"),ue(this,"onevent"),ue(this,"oneose"),ue(this,"onclose"),ue(this,"eoseTimeout"),ue(this,"eoseTimeoutHandle"),this.relay=s,this.filters=l,this.id=c,this.alreadyHaveEvent=g.alreadyHaveEvent,this.receivedEvent=g.receivedEvent,this.eoseTimeout=g.eoseTimeout||s.baseEoseTimeout,this.oneose=g.oneose,this.onclose=g.onclose,this.onevent=g.onevent||(y=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,y)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){var s;this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,(s=this.oneose)==null||s.call(this))}close(s="closed by caller"){var c;!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),(c=this.onclose)==null||c.call(this,s)}},S1=class{constructor(s){ue(this,"relays",new Map),ue(this,"seenOn",new Map),ue(this,"trackRelays",!1),ue(this,"verifyEvent"),ue(this,"trustedRelayURLs",new Set),this.verifyEvent=s.verifyEvent}async ensureRelay(s,c){s=Wi(s);let l=this.relays.get(s);return l||(l=new Jh(s,{verifyEvent:this.trustedRelayURLs.has(s)?x1:this.verifyEvent}),c!=null&&c.connectionTimeout&&(l.connectionTimeout=c.connectionTimeout),this.relays.set(s,l)),await l.connect(),l}close(s){s.map(Wi).forEach(c=>{var l;(l=this.relays.get(c))==null||l.close()})}subscribeMany(s,c,l){return this.subscribeManyMap(Object.fromEntries(s.map(g=>[g,c])),l)}subscribeManyMap(s,c){this.trackRelays&&(c.receivedEvent=(j,Y)=>{let G=this.seenOn.get(Y);G||(G=new Set,this.seenOn.set(Y,G)),G.add(j)});let l=new Set,g=[],y=Object.keys(s).length,E=[],C=j=>{var Y;E[j]=!0,E.filter(G=>G).length===y&&((Y=c.oneose)==null||Y.call(c),C=()=>{})},U=[],R=(j,Y)=>{var G;C(j),U[j]=Y,U.filter(ee=>ee).length===y&&((G=c.onclose)==null||G.call(c,U),R=()=>{})},D=j=>{var Y;if((Y=c.alreadyHaveEvent)!=null&&Y.call(c,j))return!0;let G=l.has(j);return l.add(j),G},H=Promise.all(Object.entries(s).map(async(j,Y,G)=>{if(G.indexOf(j)!==Y){R(Y,"duplicate url");return}let[ee,Q]=j;ee=Wi(ee);let te;try{te=await this.ensureRelay(ee,{connectionTimeout:c.maxWait?Math.max(c.maxWait*.8,c.maxWait-1e3):void 0})}catch(X){R(Y,X?.message||String(X));return}let re=te.subscribe(Q,{...c,oneose:()=>C(Y),onclose:X=>R(Y,X),alreadyHaveEvent:D,eoseTimeout:c.maxWait});g.push(re)}));return{async close(){await H,g.forEach(j=>{j.close()})}}}subscribeManyEose(s,c,l){let g=this.subscribeMany(s,c,{...l,oneose(){g.close()}});return g}async querySync(s,c,l){return new Promise(async g=>{let y=[];this.subscribeManyEose(s,[c],{...l,onevent(E){y.push(E)},onclose(E){g(y)}})})}async get(s,c,l){c.limit=1;let g=await this.querySync(s,c,l);return g.sort((y,E)=>E.created_at-y.created_at),g[0]||null}publish(s,c){return s.map(Wi).map(async(l,g,y)=>y.indexOf(l)!==g?Promise.reject("duplicate url"):(await this.ensureRelay(l)).publish(c))}},A1=class extends S1{constructor(){super({verifyEvent:g1})}};function Xh(s){return s instanceof Uint8Array||s!=null&&typeof s=="object"&&s.constructor.name==="Uint8Array"}function vo(s,...c){if(!Xh(s))throw new Error("Uint8Array expected");if(c.length>0&&!c.includes(s.length))throw new Error(`Uint8Array expected of length ${c}, not of length=${s.length}`)}function aa(s,c=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(c&&s.finished)throw new Error("Hash#digest() has already been called")}function ep(s,c){vo(s);let l=c.outputLen;if(s.length<l)throw new Error(`digestInto() expects output buffer of length at least ${l}`)}let on=s=>new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)),T1=s=>new DataView(s.buffer,s.byteOffset,s.byteLength);if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw new Error("Non little-endian hardware is not supported");function $1(s){if(typeof s!="string")throw new Error(`string expected, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function Qi(s){if(typeof s=="string")s=$1(s);else if(Xh(s))s=s.slice();else throw new Error(`Uint8Array expected, got ${typeof s}`);return s}let B1=(s,c)=>(Object.assign(c,s),c),tr=16,qu=new Uint8Array(16),Dn=on(qu),L1=225,C1=(s,c,l,g)=>{let y=g&1;return{s3:l<<31|g>>>1,s2:c<<31|l>>>1,s1:s<<31|c>>>1,s0:s>>>1^L1<<24&-(y&1)}},fn=s=>(s>>>0&255)<<24|(s>>>8&255)<<16|(s>>>16&255)<<8|s>>>24&255|0;function P1(s){s.reverse();let c=s[15]&1,l=0;for(let g=0;g<s.length;g++){let y=s[g];s[g]=y>>>1|l,l=(y&1)<<7}return s[0]^=-c&225,s}let I1=s=>s>64*1024?8:s>1024?4:2;class tp{constructor(c,l){this.blockLen=tr,this.outputLen=tr,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,c=Qi(c),vo(c,16);let g=T1(c),y=g.getUint32(0,!1),E=g.getUint32(4,!1),C=g.getUint32(8,!1),U=g.getUint32(12,!1),R=[];for(let G=0;G<128;G++)R.push({s0:fn(y),s1:fn(E),s2:fn(C),s3:fn(U)}),{s0:y,s1:E,s2:C,s3:U}=C1(y,E,C,U);let D=I1(l||1024);if(![1,2,4,8].includes(D))throw new Error(`ghash: wrong window size=${D}, should be 2, 4 or 8`);this.W=D;let H=128/D,j=this.windowSize=2**D,Y=[];for(let G=0;G<H;G++)for(let ee=0;ee<j;ee++){let Q=0,te=0,re=0,X=0;for(let pe=0;pe<D;pe++){if(!(ee>>>D-pe-1&1))continue;let{s0:Ae,s1:$e,s2:ge,s3:fe}=R[D*G+pe];Q^=Ae,te^=$e,re^=ge,X^=fe}Y.push({s0:Q,s1:te,s2:re,s3:X})}this.t=Y}_updateBlock(c,l,g,y){c^=this.s0,l^=this.s1,g^=this.s2,y^=this.s3;let{W:E,t:C,windowSize:U}=this,R=0,D=0,H=0,j=0,Y=(1<<E)-1,G=0;for(let ee of[c,l,g,y])for(let Q=0;Q<4;Q++){let te=ee>>>8*Q&255;for(let re=8/E-1;re>=0;re--){let X=te>>>E*re&Y,{s0:pe,s1:Ae,s2:$e,s3:ge}=C[G*U+X];R^=pe,D^=Ae,H^=$e,j^=ge,G+=1}}this.s0=R,this.s1=D,this.s2=H,this.s3=j}update(c){c=Qi(c),aa(this);let l=on(c),g=Math.floor(c.length/tr),y=c.length%tr;for(let E=0;E<g;E++)this._updateBlock(l[E*4+0],l[E*4+1],l[E*4+2],l[E*4+3]);return y&&(qu.set(c.subarray(g*tr)),this._updateBlock(Dn[0],Dn[1],Dn[2],Dn[3]),Dn.fill(0)),this}destroy(){let{t:c}=this;for(let l of c)l.s0=0,l.s1=0,l.s2=0,l.s3=0}digestInto(c){aa(this),ep(c,this),this.finished=!0;let{s0:l,s1:g,s2:y,s3:E}=this,C=on(c);return C[0]=l,C[1]=g,C[2]=y,C[3]=E,c}digest(){let c=new Uint8Array(tr);return this.digestInto(c),this.destroy(),c}}class N1 extends tp{constructor(c,l){c=Qi(c);let g=P1(c.slice());super(g,l),g.fill(0)}update(c){c=Qi(c),aa(this);let l=on(c),g=c.length%tr,y=Math.floor(c.length/tr);for(let E=0;E<y;E++)this._updateBlock(fn(l[E*4+3]),fn(l[E*4+2]),fn(l[E*4+1]),fn(l[E*4+0]));return g&&(qu.set(c.subarray(y*tr)),this._updateBlock(fn(Dn[3]),fn(Dn[2]),fn(Dn[1]),fn(Dn[0])),Dn.fill(0)),this}digestInto(c){aa(this),ep(c,this),this.finished=!0;let{s0:l,s1:g,s2:y,s3:E}=this,C=on(c);return C[0]=l,C[1]=g,C[2]=y,C[3]=E,c.reverse()}}function np(s){let c=(g,y)=>s(y,g.length).update(Qi(g)).digest(),l=s(new Uint8Array(16),0);return c.outputLen=l.outputLen,c.blockLen=l.blockLen,c.create=(g,y)=>s(g,y),c}np((s,c)=>new tp(s,c)),np((s,c)=>new N1(s,c));let Rr=16,O1=283;function Wu(s){return s<<1^O1&-(s>>7)}function ei(s,c){let l=0;for(;c>0;c>>=1)l^=s&-(c&1),s=Wu(s);return l}let Qu=(()=>{let s=new Uint8Array(256);for(let l=0,g=1;l<256;l++,g^=Wu(g))s[l]=g;let c=new Uint8Array(256);c[0]=99;for(let l=0;l<255;l++){let g=s[255-l];g|=g<<8,c[s[l]]=(g^g>>4^g>>5^g>>6^g>>7^99)&255}return c})(),R1=Qu.map((s,c)=>Qu.indexOf(c)),U1=s=>s<<24|s>>>8,Ku=s=>s<<8|s>>>24;function rp(s,c){if(s.length!==256)throw new Error("Wrong sbox length");let l=new Uint32Array(256).map((D,H)=>c(s[H])),g=l.map(Ku),y=g.map(Ku),E=y.map(Ku),C=new Uint32Array(256*256),U=new Uint32Array(256*256),R=new Uint16Array(256*256);for(let D=0;D<256;D++)for(let H=0;H<256;H++){let j=D*256+H;C[j]=l[D]^g[H],U[j]=y[D]^E[H],R[j]=s[D]<<8|s[H]}return{sbox:s,sbox2:R,T0:l,T1:g,T2:y,T3:E,T01:C,T23:U}}let Gu=rp(Qu,s=>ei(s,3)<<24|s<<16|s<<8|ei(s,2)),op=rp(R1,s=>ei(s,11)<<24|ei(s,13)<<16|ei(s,9)<<8|ei(s,14)),z1=(()=>{let s=new Uint8Array(16);for(let c=0,l=1;c<16;c++,l=Wu(l))s[c]=l;return s})();function ip(s){vo(s);let c=s.length;if(![16,24,32].includes(c))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${c}`);let{sbox2:l}=Gu,g=on(s),y=g.length,E=U=>Fn(l,U,U,U,U),C=new Uint32Array(c+28);C.set(g);for(let U=y;U<C.length;U++){let R=C[U-1];U%y===0?R=E(U1(R))^z1[U/y-1]:y>6&&U%y===4&&(R=E(R)),C[U]=C[U-y]^R}return C}function M1(s){let c=ip(s),l=c.slice(),g=c.length,{sbox2:y}=Gu,{T0:E,T1:C,T2:U,T3:R}=op;for(let D=0;D<g;D+=4)for(let H=0;H<4;H++)l[D+H]=c[g-D-4+H];c.fill(0);for(let D=4;D<g-4;D++){let H=l[D],j=Fn(y,H,H,H,H);l[D]=E[j&255]^C[j>>>8&255]^U[j>>>16&255]^R[j>>>24]}return l}function Ur(s,c,l,g,y,E){return s[l<<8&65280|g>>>8&255]^c[y>>>8&65280|E>>>24&255]}function Fn(s,c,l,g,y){return s[c&255|l&65280]|s[g>>>16&255|y>>>16&65280]<<16}function sp(s,c,l,g,y){let{sbox2:E,T01:C,T23:U}=Gu,R=0;c^=s[R++],l^=s[R++],g^=s[R++],y^=s[R++];let D=s.length/4-2;for(let ee=0;ee<D;ee++){let Q=s[R++]^Ur(C,U,c,l,g,y),te=s[R++]^Ur(C,U,l,g,y,c),re=s[R++]^Ur(C,U,g,y,c,l),X=s[R++]^Ur(C,U,y,c,l,g);c=Q,l=te,g=re,y=X}let H=s[R++]^Fn(E,c,l,g,y),j=s[R++]^Fn(E,l,g,y,c),Y=s[R++]^Fn(E,g,y,c,l),G=s[R++]^Fn(E,y,c,l,g);return{s0:H,s1:j,s2:Y,s3:G}}function D1(s,c,l,g,y){let{sbox2:E,T01:C,T23:U}=op,R=0;c^=s[R++],l^=s[R++],g^=s[R++],y^=s[R++];let D=s.length/4-2;for(let ee=0;ee<D;ee++){let Q=s[R++]^Ur(C,U,c,y,g,l),te=s[R++]^Ur(C,U,l,c,y,g),re=s[R++]^Ur(C,U,g,l,c,y),X=s[R++]^Ur(C,U,y,g,l,c);c=Q,l=te,g=re,y=X}let H=s[R++]^Fn(E,c,y,g,l),j=s[R++]^Fn(E,l,c,y,g),Y=s[R++]^Fn(E,g,l,c,y),G=s[R++]^Fn(E,y,g,l,c);return{s0:H,s1:j,s2:Y,s3:G}}function ap(s,c){if(!c)return new Uint8Array(s);if(vo(c),c.length<s)throw new Error(`aes: wrong destination length, expected at least ${s}, got: ${c.length}`);return c}function F1(s){if(vo(s),s.length%Rr!==0)throw new Error(`aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size ${Rr}`)}function j1(s,c,l){let g=s.length,y=g%Rr;if(!c&&y!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");let E=on(s);if(c){let R=Rr-y;R||(R=Rr),g=g+R}let C=ap(g,l),U=on(C);return{b:E,o:U,out:C}}function H1(s,c){if(!c)return s;let l=s.length;if(!l)throw new Error("aes/pcks5: empty ciphertext not allowed");let g=s[l-1];if(g<=0||g>16)throw new Error(`aes/pcks5: wrong padding byte: ${g}`);let y=s.subarray(0,-g);for(let E=0;E<g;E++)if(s[l-E-1]!==g)throw new Error("aes/pcks5: wrong padding");return y}function V1(s){let c=new Uint8Array(16),l=on(c);c.set(s);let g=Rr-s.length;for(let y=Rr-g;y<Rr;y++)c[y]=g;return l}let cp=B1({blockSize:16,nonceLength:16},function(s,c,l={}){vo(s),vo(c,16);let g=!l.disablePadding;return{encrypt:(y,E)=>{let C=ip(s),{b:U,o:R,out:D}=j1(y,g,E),H=on(c),j=H[0],Y=H[1],G=H[2],ee=H[3],Q=0;for(;Q+4<=U.length;)j^=U[Q+0],Y^=U[Q+1],G^=U[Q+2],ee^=U[Q+3],{s0:j,s1:Y,s2:G,s3:ee}=sp(C,j,Y,G,ee),R[Q++]=j,R[Q++]=Y,R[Q++]=G,R[Q++]=ee;if(g){let te=V1(y.subarray(Q*4));j^=te[0],Y^=te[1],G^=te[2],ee^=te[3],{s0:j,s1:Y,s2:G,s3:ee}=sp(C,j,Y,G,ee),R[Q++]=j,R[Q++]=Y,R[Q++]=G,R[Q++]=ee}return C.fill(0),D},decrypt:(y,E)=>{F1(y);let C=M1(s),U=on(c),R=ap(y.length,E),D=on(y),H=on(R),j=U[0],Y=U[1],G=U[2],ee=U[3];for(let Q=0;Q+4<=D.length;){let te=j,re=Y,X=G,pe=ee;j=D[Q+0],Y=D[Q+1],G=D[Q+2],ee=D[Q+3];let{s0:Ae,s1:$e,s2:ge,s3:fe}=D1(C,j,Y,G,ee);H[Q++]=Ae^te,H[Q++]=$e^re,H[Q++]=ge^X,H[Q++]=fe^pe}return C.fill(0),H1(R,g)}}});function ti(s){if(!Number.isSafeInteger(s))throw new Error(`Wrong integer: ${s}`)}function nr(...s){let c=(y,E)=>C=>y(E(C)),l=Array.from(s).reverse().reduce((y,E)=>y?c(y,E.encode):E.encode,void 0),g=s.reduce((y,E)=>y?c(y,E.decode):E.decode,void 0);return{encode:l,decode:g}}function rr(s){return{encode:c=>{if(!Array.isArray(c)||c.length&&typeof c[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return c.map(l=>{if(ti(l),l<0||l>=s.length)throw new Error(`Digit index outside alphabet: ${l} (alphabet: ${s.length})`);return s[l]})},decode:c=>{if(!Array.isArray(c)||c.length&&typeof c[0]!="string")throw new Error("alphabet.decode input should be array of strings");return c.map(l=>{if(typeof l!="string")throw new Error(`alphabet.decode: not string element=${l}`);let g=s.indexOf(l);if(g===-1)throw new Error(`Unknown letter: "${l}". Allowed: ${s}`);return g})}}}function or(s=""){if(typeof s!="string")throw new Error("join separator should be string");return{encode:c=>{if(!Array.isArray(c)||c.length&&typeof c[0]!="string")throw new Error("join.encode input should be array of strings");for(let l of c)if(typeof l!="string")throw new Error(`join.encode: non-string input=${l}`);return c.join(s)},decode:c=>{if(typeof c!="string")throw new Error("join.decode input should be string");return c.split(s)}}}function ca(s,c="="){if(ti(s),typeof c!="string")throw new Error("padding chr should be string");return{encode(l){if(!Array.isArray(l)||l.length&&typeof l[0]!="string")throw new Error("padding.encode input should be array of strings");for(let g of l)if(typeof g!="string")throw new Error(`padding.encode: non-string input=${g}`);for(;l.length*s%8;)l.push(c);return l},decode(l){if(!Array.isArray(l)||l.length&&typeof l[0]!="string")throw new Error("padding.encode input should be array of strings");for(let y of l)if(typeof y!="string")throw new Error(`padding.decode: non-string input=${y}`);let g=l.length;if(g*s%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;g>0&&l[g-1]===c;g--)if(!((g-1)*s%8))throw new Error("Invalid padding: string has too much padding");return l.slice(0,g)}}}function up(s){if(typeof s!="function")throw new Error("normalize fn should be function");return{encode:c=>c,decode:c=>s(c)}}function lp(s,c,l){if(c<2)throw new Error(`convertRadix: wrong from=${c}, base cannot be less than 2`);if(l<2)throw new Error(`convertRadix: wrong to=${l}, base cannot be less than 2`);if(!Array.isArray(s))throw new Error("convertRadix: data should be array");if(!s.length)return[];let g=0,y=[],E=Array.from(s);for(E.forEach(C=>{if(ti(C),C<0||C>=c)throw new Error(`Wrong integer: ${C}`)});;){let C=0,U=!0;for(let R=g;R<E.length;R++){let D=E[R],H=c*C+D;if(!Number.isSafeInteger(H)||c*C/c!==C||H-D!==c*C)throw new Error("convertRadix: carry overflow");if(C=H%l,E[R]=Math.floor(H/l),!Number.isSafeInteger(E[R])||E[R]*l+C!==H)throw new Error("convertRadix: carry overflow");if(U)E[R]?U=!1:g=R;else continue}if(y.push(C),U)break}for(let C=0;C<s.length-1&&s[C]===0;C++)y.push(0);return y.reverse()}let dp=(s,c)=>c?dp(c,s%c):s,ua=(s,c)=>s+(c-dp(s,c));function Zu(s,c,l,g){if(!Array.isArray(s))throw new Error("convertRadix2: data should be array");if(c<=0||c>32)throw new Error(`convertRadix2: wrong from=${c}`);if(l<=0||l>32)throw new Error(`convertRadix2: wrong to=${l}`);if(ua(c,l)>32)throw new Error(`convertRadix2: carry overflow from=${c} to=${l} carryBits=${ua(c,l)}`);let y=0,E=0,C=2**l-1,U=[];for(let R of s){if(ti(R),R>=2**c)throw new Error(`convertRadix2: invalid data word=${R} from=${c}`);if(y=y<<c|R,E+c>32)throw new Error(`convertRadix2: carry overflow pos=${E} from=${c}`);for(E+=c;E>=l;E-=l)U.push((y>>E-l&C)>>>0);y&=2**E-1}if(y=y<<l-E&C,!g&&E>=c)throw new Error("Excess padding");if(!g&&y)throw new Error(`Non-zero padding: ${y}`);return g&&E>0&&U.push(y>>>0),U}function q1(s){return ti(s),{encode:c=>{if(!(c instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return lp(Array.from(c),2**8,s)},decode:c=>{if(!Array.isArray(c)||c.length&&typeof c[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(lp(c,s,2**8))}}}function zr(s,c=!1){if(ti(s),s<=0||s>32)throw new Error("radix2: bits should be in (0..32]");if(ua(8,s)>32||ua(s,8)>32)throw new Error("radix2: carry overflow");return{encode:l=>{if(!(l instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Zu(Array.from(l),8,s,!c)},decode:l=>{if(!Array.isArray(l)||l.length&&typeof l[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Zu(l,s,8,c))}}}function fp(s){if(typeof s!="function")throw new Error("unsafeWrapper fn should be function");return function(...c){try{return s.apply(null,c)}catch{}}}let W1=nr(zr(4),rr("0123456789ABCDEF"),or("")),Q1=nr(zr(5),rr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),ca(5),or(""));nr(zr(5),rr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),ca(5),or("")),nr(zr(5),rr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),or(""),up(s=>s.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));let Ki=nr(zr(6),rr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),ca(6),or("")),K1=nr(zr(6),rr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),ca(6),or("")),Yu=s=>nr(q1(58),rr(s),or("")),Ju=Yu("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Yu("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Yu("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");let hp=[0,2,3,5,6,7,9,10,11],G1={encode(s){let c="";for(let l=0;l<s.length;l+=8){let g=s.subarray(l,l+8);c+=Ju.encode(g).padStart(hp[g.length],"1")}return c},decode(s){let c=[];for(let l=0;l<s.length;l+=11){let g=s.slice(l,l+11),y=hp.indexOf(g.length),E=Ju.decode(g);for(let C=0;C<E.length-y;C++)if(E[C]!==0)throw new Error("base58xmr: wrong padding");c=c.concat(Array.from(E.slice(E.length-y)))}return Uint8Array.from(c)}},Xu=nr(rr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),or("")),pp=[996825010,642813549,513874426,1027748829,705979059];function Gi(s){let c=s>>25,l=(s&33554431)<<5;for(let g=0;g<pp.length;g++)(c>>g&1)===1&&(l^=pp[g]);return l}function gp(s,c,l=1){let g=s.length,y=1;for(let E=0;E<g;E++){let C=s.charCodeAt(E);if(C<33||C>126)throw new Error(`Invalid prefix (${s})`);y=Gi(y)^C>>5}y=Gi(y);for(let E=0;E<g;E++)y=Gi(y)^s.charCodeAt(E)&31;for(let E of c)y=Gi(y)^E;for(let E=0;E<6;E++)y=Gi(y);return y^=l,Xu.encode(Zu([y%2**30],30,5,!1))}function mp(s){let c=s==="bech32"?1:734539939,l=zr(5),g=l.decode,y=l.encode,E=fp(g);function C(H,j,Y=90){if(typeof H!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof H}`);if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof j}`);let G=H.length+7+j.length;if(Y!==!1&&G>Y)throw new TypeError(`Length ${G} exceeds limit ${Y}`);return H=H.toLowerCase(),`${H}1${Xu.encode(j)}${gp(H,j,c)}`}function U(H,j=90){if(typeof H!="string")throw new Error(`bech32.decode input should be string, not ${typeof H}`);if(H.length<8||j!==!1&&H.length>j)throw new TypeError(`Wrong string length: ${H.length} (${H}). Expected (8..${j})`);let Y=H.toLowerCase();if(H!==Y&&H!==H.toUpperCase())throw new Error("String must be lowercase or uppercase");H=Y;let G=H.lastIndexOf("1");if(G===0||G===-1)throw new Error('Letter "1" must be present between prefix and data only');let ee=H.slice(0,G),Q=H.slice(G+1);if(Q.length<6)throw new Error("Data must be at least 6 characters long");let te=Xu.decode(Q).slice(0,-6),re=gp(ee,te,c);if(!Q.endsWith(re))throw new Error(`Invalid checksum in ${H}: expected "${re}"`);return{prefix:ee,words:te}}let R=fp(U);function D(H){let{prefix:j,words:Y}=U(H,!1);return{prefix:j,words:Y,bytes:g(Y)}}return{encode:C,decode:U,decodeToBytes:D,decodeUnsafe:R,fromWords:g,fromWordsUnsafe:E,toWords:y}}let bp=mp("bech32");mp("bech32m");let Z1={encode:s=>new TextDecoder().decode(s),decode:s=>new TextEncoder().encode(s)},Y1=nr(zr(4),rr("0123456789abcdef"),or(""),up(s=>{if(typeof s!="string"||s.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);return s.toLowerCase()}));`${Object.keys({utf8:Z1,hex:Y1,base16:W1,base32:Q1,base64:Ki,base64url:K1,base58:Ju,base58xmr:G1}).join(", ")}`;var _o=Symbol("verified"),J1=s=>s instanceof Object;function X1(s){if(!J1(s)||typeof s.kind!="number"||typeof s.content!="string"||typeof s.created_at!="number"||typeof s.pubkey!="string"||!s.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(s.tags))return!1;for(let c=0;c<s.tags.length;c++){let l=s.tags[c];if(!Array.isArray(l))return!1;for(let g=0;g<l.length;g++)if(typeof l[g]=="object")return!1}return!0}var ev=new TextDecoder("utf-8"),wp=new TextEncoder;function Zi(s){s.indexOf("://")===-1&&(s="wss://"+s);let c=new URL(s);return c.pathname=c.pathname.replace(/\/+/g,"/"),c.pathname.endsWith("/")&&(c.pathname=c.pathname.slice(0,-1)),(c.port==="80"&&c.protocol==="ws:"||c.port==="443"&&c.protocol==="wss:")&&(c.port=""),c.searchParams.sort(),c.hash="",c.toString()}var tv=class{constructor(s){ue(this,"value"),ue(this,"next",null),ue(this,"prev",null),this.value=s}},nv=class{constructor(){ue(this,"first"),ue(this,"last"),this.first=null,this.last=null}enqueue(s){let c=new tv(s);return this.last?this.last===this.first?(this.last=c,this.last.prev=this.first,this.first.next=c):(c.prev=this.last,this.last.next=c,this.last=c):(this.first=c,this.last=c),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){let c=this.first;return this.first=null,this.last=null,c.value}let s=this.first;return this.first=s.next,s.value}},rv=class{generateSecretKey(){return Qt.utils.randomPrivateKey()}getPublicKey(s){return Wt(Qt.getPublicKey(s))}finalizeEvent(s,c){let l=s;return l.pubkey=Wt(Qt.getPublicKey(c)),l.id=el(l),l.sig=Wt(Qt.sign(el(l),c)),l[_o]=!0,l}verifyEvent(s){if(typeof s[_o]=="boolean")return s[_o];let c=el(s);if(c!==s.id)return s[_o]=!1,!1;try{let l=Qt.verify(s.sig,c,s.pubkey);return s[_o]=l,l}catch{return s[_o]=!1,!1}}};function ov(s){if(!X1(s))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,s.pubkey,s.created_at,s.kind,s.tags,s.content])}function el(s){let c=ju(wp.encode(ov(s)));return Wt(c)}var la=new rv,iv=la.generateSecretKey,sv=la.getPublicKey,av=la.finalizeEvent,yp=la.verifyEvent;async function cv(s,c,l){let g=s instanceof Uint8Array?Wt(s):s,y=Vi.getSharedSecret(g,"02"+c),E=vp(y),C=Uint8Array.from(ey(16)),U=wp.encode(l),R=cp(E,C).encrypt(U),D=Ki.encode(new Uint8Array(R)),H=Ki.encode(new Uint8Array(C.buffer));return`${D}?iv=${H}`}async function uv(s,c,l){let g=s instanceof Uint8Array?Wt(s):s,[y,E]=l.split("?iv="),C=Vi.getSharedSecret(g,"02"+c),U=vp(C),R=Ki.decode(E),D=Ki.decode(y),H=cp(U,R).decrypt(D);return ev.decode(H)}function vp(s){return s.slice(1,33)}var lv=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,dv;try{dv=fetch}catch{}var fv=22242,tl=24133,hv=31990;function pv(s,c){if(s.ids&&s.ids.indexOf(c.id)===-1&&!s.ids.some(l=>c.id.startsWith(l))||s.kinds&&s.kinds.indexOf(c.kind)===-1||s.authors&&s.authors.indexOf(c.pubkey)===-1&&!s.authors.some(l=>c.pubkey.startsWith(l)))return!1;for(let l in s)if(l[0]==="#"){let g=l.slice(1),y=s[`#${g}`];if(y&&!c.tags.find(([E,C])=>E===l.slice(1)&&y.indexOf(C)!==-1))return!1}return!(s.since&&c.created_at<s.since||s.until&&c.created_at>s.until)}function gv(s,c){for(let l=0;l<s.length;l++)if(pv(s[l],c))return!0;return!1}function mv(s,c){let l=c.length+3,g=s.indexOf(`"${c}":`)+l,y=s.slice(g).indexOf('"')+g+1;return s.slice(y,y+64)}function bv(s){let c=s.slice(0,22).indexOf('"EVENT"');if(c===-1)return null;let l=s.slice(c+7+1).indexOf('"');if(l===-1)return null;let g=c+7+1+l,y=s.slice(g+1,80).indexOf('"');if(y===-1)return null;let E=g+1+y;return s.slice(g+1,E)}function wv(s,c){return{kind:fv,created_at:Math.floor(Date.now()/1e3),tags:[["relay",s],["challenge",c]],content:""}}async function yv(){return new Promise(s=>{let c=new MessageChannel,l=()=>{c.port1.removeEventListener("message",l),s()};c.port1.addEventListener("message",l),c.port2.postMessage(0),c.port1.start()})}var vv=s=>(s[_o]=!0,!0),_p;try{_p=WebSocket}catch{}var Ep=class{constructor(s,c){ue(this,"url"),ue(this,"_connected",!1),ue(this,"onclose",null),ue(this,"onnotice",l=>console.debug(`NOTICE from ${this.url}: ${l}`)),ue(this,"_onauth",null),ue(this,"baseEoseTimeout",4400),ue(this,"connectionTimeout",4400),ue(this,"openSubs",new Map),ue(this,"connectionTimeoutHandle"),ue(this,"connectionPromise"),ue(this,"openCountRequests",new Map),ue(this,"openEventPublishes",new Map),ue(this,"ws"),ue(this,"incomingMessageQueue",new nv),ue(this,"queueRunning",!1),ue(this,"challenge"),ue(this,"serial",0),ue(this,"verifyEvent"),this.url=Zi(s),this.verifyEvent=c.verifyEvent}static async connect(s,c){let l=new Ep(s,c);return await l.connect(),l}closeAllSubscriptions(s){for(let[c,l]of this.openSubs)l.close(s);this.openSubs.clear();for(let[c,l]of this.openEventPublishes)l.reject(new Error(s));this.openEventPublishes.clear();for(let[c,l]of this.openCountRequests)l.reject(new Error(s));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.connectionPromise=new Promise((s,c)=>{this.connectionTimeoutHandle=setTimeout(()=>{var l;c("connection timed out"),this.connectionPromise=void 0,(l=this.onclose)==null||l.call(this),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new _p(this.url)}catch(l){c(l);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,s()},this.ws.onerror=l=>{var g;c(l.message),this._connected&&(this._connected=!1,this.connectionPromise=void 0,(g=this.onclose)==null||g.call(this),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{var l;this._connected&&(this._connected=!1,this.connectionPromise=void 0,(l=this.onclose)==null||l.call(this),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await yv();this.queueRunning=!1}handleNext(){var s,c,l;let g=this.incomingMessageQueue.dequeue();if(!g)return!1;let y=bv(g);if(y){let E=this.openSubs.get(y);if(!E)return;let C=mv(g,"id"),U=(s=E.alreadyHaveEvent)==null?void 0:s.call(E,C);if((c=E.receivedEvent)==null||c.call(E,this,C),U)return}try{let E=JSON.parse(g);switch(E[0]){case"EVENT":{let C=this.openSubs.get(E[1]),U=E[2];this.verifyEvent(U)&&gv(C.filters,U)&&C.onevent(U);return}case"COUNT":{let C=E[1],U=E[2],R=this.openCountRequests.get(C);R&&(R.resolve(U.count),this.openCountRequests.delete(C));return}case"EOSE":{let C=this.openSubs.get(E[1]);if(!C)return;C.receivedEose();return}case"OK":{let C=E[1],U=E[2],R=E[3],D=this.openEventPublishes.get(C);U?D.resolve(R):D.reject(new Error(R)),this.openEventPublishes.delete(C);return}case"CLOSED":{let C=E[1],U=this.openSubs.get(C);if(!U)return;U.closed=!0,U.close(E[2]);return}case"NOTICE":this.onnotice(E[1]);return;case"AUTH":{this.challenge=E[1],(l=this._onauth)==null||l.call(this,E[1]);return}}}catch{return}}async send(s){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{var c;(c=this.ws)==null||c.send(s)})}async auth(s){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");let c=await s(wv(this.url,this.challenge)),l=new Promise((g,y)=>{this.openEventPublishes.set(c.id,{resolve:g,reject:y})});return this.send('["AUTH",'+JSON.stringify(c)+"]"),l}async publish(s){let c=new Promise((l,g)=>{this.openEventPublishes.set(s.id,{resolve:l,reject:g})});return this.send('["EVENT",'+JSON.stringify(s)+"]"),c}async count(s,c){this.serial++;let l=c?.id||"count:"+this.serial,g=new Promise((y,E)=>{this.openCountRequests.set(l,{resolve:y,reject:E})});return this.send('["COUNT","'+l+'",'+JSON.stringify(s)+"]"),g}subscribe(s,c){let l=this.prepareSubscription(s,c);return l.fire(),l}prepareSubscription(s,c){this.serial++;let l=c.id||"sub:"+this.serial,g=new _v(this,l,s,c);return this.openSubs.set(l,g),g}close(){var s;this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,(s=this.ws)==null||s.close()}_onmessage(s){this.incomingMessageQueue.enqueue(s.data),this.queueRunning||this.runQueue()}},_v=class{constructor(s,c,l,g){ue(this,"relay"),ue(this,"id"),ue(this,"closed",!1),ue(this,"eosed",!1),ue(this,"filters"),ue(this,"alreadyHaveEvent"),ue(this,"receivedEvent"),ue(this,"onevent"),ue(this,"oneose"),ue(this,"onclose"),ue(this,"eoseTimeout"),ue(this,"eoseTimeoutHandle"),this.relay=s,this.filters=l,this.id=c,this.alreadyHaveEvent=g.alreadyHaveEvent,this.receivedEvent=g.receivedEvent,this.eoseTimeout=g.eoseTimeout||s.baseEoseTimeout,this.oneose=g.oneose,this.onclose=g.onclose,this.onevent=g.onevent||(y=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,y)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){var s;this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,(s=this.oneose)==null||s.call(this))}close(s="closed by caller"){var c;!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),(c=this.onclose)==null||c.call(this,s)}},Ev=class{constructor(s){ue(this,"relays",new Map),ue(this,"seenOn",new Map),ue(this,"trackRelays",!1),ue(this,"verifyEvent"),ue(this,"trustedRelayURLs",new Set),this.verifyEvent=s.verifyEvent}async ensureRelay(s,c){s=Zi(s);let l=this.relays.get(s);return l||(l=new Ep(s,{verifyEvent:this.trustedRelayURLs.has(s)?vv:this.verifyEvent}),c!=null&&c.connectionTimeout&&(l.connectionTimeout=c.connectionTimeout),this.relays.set(s,l)),await l.connect(),l}close(s){s.map(Zi).forEach(c=>{var l;(l=this.relays.get(c))==null||l.close()})}subscribeMany(s,c,l){return this.subscribeManyMap(Object.fromEntries(s.map(g=>[g,c])),l)}subscribeManyMap(s,c){this.trackRelays&&(c.receivedEvent=(j,Y)=>{let G=this.seenOn.get(Y);G||(G=new Set,this.seenOn.set(Y,G)),G.add(j)});let l=new Set,g=[],y=Object.keys(s).length,E=[],C=j=>{var Y;E[j]=!0,E.filter(G=>G).length===y&&((Y=c.oneose)==null||Y.call(c),C=()=>{})},U=[],R=(j,Y)=>{var G;C(j),U[j]=Y,U.filter(ee=>ee).length===y&&((G=c.onclose)==null||G.call(c,U),R=()=>{})},D=j=>{var Y;if((Y=c.alreadyHaveEvent)!=null&&Y.call(c,j))return!0;let G=l.has(j);return l.add(j),G},H=Promise.all(Object.entries(s).map(async(j,Y,G)=>{if(G.indexOf(j)!==Y){R(Y,"duplicate url");return}let[ee,Q]=j;ee=Zi(ee);let te;try{te=await this.ensureRelay(ee,{connectionTimeout:c.maxWait?Math.max(c.maxWait*.8,c.maxWait-1e3):void 0})}catch(X){R(Y,X?.message||String(X));return}let re=te.subscribe(Q,{...c,oneose:()=>C(Y),onclose:X=>R(Y,X),alreadyHaveEvent:D,eoseTimeout:c.maxWait});g.push(re)}));return{async close(){await H,g.forEach(j=>{j.close()})}}}subscribeManyEose(s,c,l){let g=this.subscribeMany(s,c,{...l,oneose(){g.close()}});return g}async querySync(s,c,l){return new Promise(async g=>{let y=[];this.subscribeManyEose(s,[c],{...l,onevent(E){y.push(E)},onclose(E){g(y)}})})}async get(s,c,l){c.limit=1;let g=await this.querySync(s,c,l);return g.sort((y,E)=>E.created_at-y.created_at),g[0]||null}publish(s,c){return s.map(Zi).map(async(l,g,y)=>y.indexOf(l)!==g?Promise.reject("duplicate url"):(await this.ensureRelay(l)).publish(c))}},xv=class extends Ev{constructor(){super({verifyEvent:yp})}},xp;try{xp=fetch}catch{}var da=/^bunker:\/\/([0-9a-f]{64})\??([?\/\w:.=&%]*)$/,kv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;async function Sv(s){let c=s.match(da);if(c)try{let l=c[1],g=new URLSearchParams(c[2]);return{pubkey:l,relays:g.getAll("relay"),secret:g.get("secret")}}catch{}return kp(s)}async function kp(s){let c=s.match(lv);if(!c)return null;let[l,g="_",y]=c;try{let E=`https://${y}/.well-known/nostr.json?name=${g}`,C=await(await xp(E,{redirect:"error"})).json(),U=C.names[g],R=C.nip46[U]||[];return{pubkey:U,relays:R,secret:null}}catch{return null}}var Sp=class{constructor(s,c,l={}){if(ue(this,"pool"),ue(this,"subCloser"),ue(this,"isOpen"),ue(this,"serial"),ue(this,"idPrefix"),ue(this,"listeners"),ue(this,"waitingForAuth"),ue(this,"secretKey"),ue(this,"bp"),c.relays.length===0)throw new Error("no relays are specified for this bunker");this.pool=l.pool||new xv,this.secretKey=s,this.bp=c,this.isOpen=!1,this.idPrefix=Math.random().toString(36).substring(7),this.serial=0,this.listeners={},this.waitingForAuth={};let g=this.listeners,y=this.waitingForAuth;this.subCloser=this.pool.subscribeMany(this.bp.relays,[{kinds:[tl],"#p":[sv(this.secretKey)]}],{async onevent(E){let{id:C,result:U,error:R}=JSON.parse(await uv(s,E.pubkey,E.content));if(U==="auth_url"&&y[C]){delete y[C],l.onauth?l.onauth(R):console.warn(`nostr-tools/nip46: remote signer ${c.pubkey} tried to send an "auth_url"='${R}' but there was no onauth() callback configured.`);return}let D=g[C];D&&(R?D.reject(R):U&&D.resolve(U),delete g[C])}}),this.isOpen=!0}async close(){this.isOpen=!1,this.subCloser.close()}async sendRequest(s,c){return new Promise(async(l,g)=>{try{if(!this.isOpen)throw new Error("this signer is not open anymore, create a new one");this.serial++;let y=`${this.idPrefix}-${this.serial}`,E=await cv(this.secretKey,this.bp.pubkey,JSON.stringify({id:y,method:s,params:c})),C=av({kind:tl,tags:[["p",this.bp.pubkey]],content:E,created_at:Math.floor(Date.now()/1e3)},this.secretKey);this.listeners[y]={resolve:l,reject:g},this.waitingForAuth[y]=!0,await Promise.any(this.pool.publish(this.bp.relays,C))}catch(y){g(y)}})}async ping(){let s=await this.sendRequest("ping",[]);if(s!=="pong")throw new Error(`result is not pong: ${s}`)}async connect(){await this.sendRequest("connect",[this.bp.pubkey,this.bp.secret||""])}async getPublicKey(){return this.bp.pubkey}async getRelays(){return JSON.parse(await this.sendRequest("get_relays",[]))}async signEvent(s){let c=await this.sendRequest("sign_event",[JSON.stringify(s)]),l=JSON.parse(c);if(l.pubkey===this.bp.pubkey&&yp(l))return l;throw new Error(`event returned from bunker is improperly signed: ${JSON.stringify(l)}`)}async nip04Encrypt(s,c){return await this.sendRequest("nip04_encrypt",[s,c])}async nip04Decrypt(s,c){return await this.sendRequest("nip04_decrypt",[s,c])}async nip44GetKey(s){let c=await this.sendRequest("nip44_get_key",[s]);return _u(c)}async nip44Encrypt(s,c){return await this.sendRequest("nip44_encrypt",[s,c])}async nip44Decrypt(s,c){return await this.sendRequest("nip44_encrypt",[s,c])}};async function Av(s,c,l,g,y){if(y&&!kv.test(y))throw new Error("Invalid email");let E=iv(),C=new Sp(E,s.bunkerPointer,c),U=await C.sendRequest("create_account",[l,g,y||""]);return C.bp.pubkey=U,await C.connect(),C}async function Tv(s,c){let l=await s.querySync(c,{kinds:[hv],"#k":[tl.toString()]});return l.sort((g,y)=>y.created_at-g.created_at),(await Promise.all(l.map(async(g,y)=>{try{let E=JSON.parse(g.content);try{if(l.findIndex(U=>JSON.parse(U.content).nip05===E.nip05)!==y)return}catch{}let C=await kp(E.nip05);if(C&&C.pubkey===g.pubkey&&C.relays.length)return{bunkerPointer:C,nip05:E.nip05,domain:E.nip05.split("@")[1],name:E.name||E.display_name,picture:E.picture,about:E.about,website:E.website,local:!1}}catch{return}}))).filter(g=>g!==void 0)}var Ap=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,Tp;try{Tp=fetch}catch{}async function $v(s){var c;let l=s.match(Ap);if(!l)return null;let[g,y="_",E]=l;try{let C=`https://${E}/.well-known/nostr.json?name=${y}`,U=await(await Tp(C,{redirect:"error"})).json(),R=U.names[y];return R?{pubkey:R,relays:(c=U.relays)==null?void 0:c[R]}:null}catch{return null}}new TextDecoder("utf-8"),new TextEncoder;var Bv=5e3;function Lv(s){return Pv("npub",_u(s))}function Cv(s,c){let l=bp.toWords(c);return bp.encode(s,l,Bv)}function Pv(s,c){return Cv(s,c)}let ni=[];function Iv(s,c=a){let l,g=new Set;function y(U){if(b(s,U)&&(s=U,l)){let R=!ni.length;for(let D of g)D[1](),ni.push(D,s);if(R){for(let D=0;D<ni.length;D+=2)ni[D][0](ni[D+1]);ni.length=0}}}function E(U){y(U(s))}function C(U,R=a){let D=[U,R];return g.add(D),g.size===1&&(l=c(y,E)||a),U(s),()=>{g.delete(D),g.size===0&&l&&(l(),l=null)}}return{set:y,update:E,subscribe:C}}let Nv=s=>{let{subscribe:c,set:l}=Iv(void 0,()=>{let g=window.matchMedia(s);l(g.matches);let y=()=>l(g.matches);return"addEventListener"in g?g.addEventListener("change",y):g.addListener(y),()=>{"removeEventListener"in g?g.removeEventListener("change",y):g.removeListener(y)}});return{subscribe:c}};function Ov(s){let c,l,g;return{c(){c=S("svg"),l=S("circle"),g=S("path"),B(l,"class","opacity-25"),B(l,"cx","12"),B(l,"cy","12"),B(l,"r","10"),B(l,"stroke","currentColor"),B(l,"stroke-width","4"),B(g,"class","opacity-75"),B(g,"fill","currentColor"),B(g,"d","M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"),B(c,"class","ml-2 h-5 w-5 animate-spin text-white"),B(c,"xmlns","http://www.w3.org/2000/svg"),B(c,"fill","none"),B(c,"viewBox","0 0 24 24")},m(y,E){f(y,c,E),L(c,l),L(c,g)},p:a,i:a,o:a,d(y){y&&p(c)}}}class $p extends mh{constructor(c){super(),gh(this,c,null,Ov,b,{})}}let{window:nl}=O;function Bp(s,c,l){let g=s.slice();return g[78]=c[l],g}function Rv(s){let c,l,g,y,E,C,U,R,D,H,j,Y,G=!s[20]&&!s[13]&&!s[14]&&!s[15]&&Lp(s),ee=[qv,Vv,Hv,jv,Fv,Dv,Mv],Q=[];function te(re,X){return re[13]?0:re[14]?1:re[15]?2:re[20]?3:re[17]?4:re[21]?6:5}return U=te(s),R=Q[U]=ee[U](s),{c(){c=v("div"),l=v("button"),g=$("\u292B"),E=P(),G&&G.c(),C=P(),R.c(),B(l,"class",y="absolute right-2 top-0 cursor-pointer bg-transparent text-3xl text-"+s[0]+"-600"),B(c,"class",D="animate-show rounded-md bg-gradient-to-b px-8 py-8 shadow-[0_0px_30px_0px_rgba(0,0,0,0.6)] transition-all sm:w-96 from-"+s[0]+"-900 to-"+s[0]+"-700 "+s[27])},m(re,X){f(re,c,X),L(c,l),L(l,g),L(c,E),G&&G.m(c,null),L(c,C),Q[U].m(c,null),H=!0,j||(Y=N(l,"click",function(){m(s[20]?s[32]:s[30])&&(s[20]?s[32]:s[30]).apply(this,arguments)}),j=!0)},p(re,X){s=re,(!H||X[0]&1&&y!==(y="absolute right-2 top-0 cursor-pointer bg-transparent text-3xl text-"+s[0]+"-600"))&&B(l,"class",y),!s[20]&&!s[13]&&!s[14]&&!s[15]?G?G.p(s,X):(G=Lp(s),G.c(),G.m(c,C)):G&&(G.d(1),G=null);let pe=U;U=te(s),U===pe?Q[U].p(s,X):(Ct(),un(Q[pe],1,1,()=>{Q[pe]=null}),qt(),R=Q[U],R?R.p(s,X):(R=Q[U]=ee[U](s),R.c()),Mt(R,1),R.m(c,null)),(!H||X[0]&134217729&&D!==(D="animate-show rounded-md bg-gradient-to-b px-8 py-8 shadow-[0_0px_30px_0px_rgba(0,0,0,0.6)] transition-all sm:w-96 from-"+s[0]+"-900 to-"+s[0]+"-700 "+s[27]))&&B(c,"class",D)},i(re){H||(Mt(R),H=!0)},o(re){un(R),H=!1},d(re){re&&p(c),G&&G.d(),Q[U].d(),j=!1,Y()}}}function Uv(s){let c,l,g,y,E,C=[Jv,Yv,Zv,Gv,Kv],U=[];function R(D,H){return D[12]?0:!D[21]&&!D[2]?1:!D[21]&&D[2]?2:D[2]?4:3}return l=R(s),g=U[l]=C[l](s),{c(){c=v("div"),g.c(),B(c,"class",y="rounded px-2 py-2 shadow-[0_0px_10px_0px_rgba(0,0,0,0.3)] transition-all duration-200 bg-"+s[0]+"-700 hover:bg-"+s[0]+"-800 "+s[27])},m(D,H){f(D,c,H),U[l].m(c,null),E=!0},p(D,H){let j=l;l=R(D),l===j?U[l].p(D,H):(Ct(),un(U[j],1,1,()=>{U[j]=null}),qt(),g=U[l],g?g.p(D,H):(g=U[l]=C[l](D),g.c()),Mt(g,1),g.m(c,null)),(!E||H[0]&134217729&&y!==(y="rounded px-2 py-2 shadow-[0_0px_10px_0px_rgba(0,0,0,0.3)] transition-all duration-200 bg-"+D[0]+"-700 hover:bg-"+D[0]+"-800 "+D[27]))&&B(c,"class",y)},i(D){E||(Mt(g),E=!0)},o(D){un(g),E=!1},d(D){D&&p(c),U[l].d()}}}function zv(s){return{c:a,m:a,p:a,i:a,o:a,d:a}}function Lp(s){let c,l,g,y,E;return{c(){c=v("button"),l=$("?"),B(c,"class",g="absolute bottom-1 right-3 cursor-pointer bg-transparent text-xl text-"+s[0]+"-600")},m(C,U){f(C,c,U),L(c,l),y||(E=N(c,"click",s[31]),y=!0)},p(C,U){U[0]&1&&g!==(g="absolute bottom-1 right-3 cursor-pointer bg-transparent text-xl text-"+C[0]+"-600")&&B(c,"class",g)},d(C){C&&p(c),y=!1,E()}}}function Mv(s){let c,l,g,y,E,C,U=s[21].npub+"",R,D,H,j,Y,G,ee,Q,te,re,X,pe=Zh(s[11])+"",Ae,$e,ge,fe=(s[21].picture||s[21].name)&&Cp(s);return{c(){c=v("div"),l=v("div"),l.textContent="You are connected to Nostr as",g=P(),y=v("a"),fe&&fe.c(),E=P(),C=v("div"),R=$(U),H=P(),j=v("button"),Y=$("Disconnect"),ee=P(),Q=v("div"),te=$("This webpage is using the public key:"),re=v("br"),X=P(),Ae=$(pe),B(l,"class","mb-4 text-sm"),B(C,"class","block break-all"),B(y,"target","_blank"),B(y,"href",D="https://nosta.me/"+s[21].npub),B(y,"class","group text-white no-underline"),B(c,"class","text-center"),B(j,"class",G="my-2 mt-6 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white bg-"+s[0]+"-900 hover:bg-"+s[0]+"-950"),B(Q,"class","mt-6 block break-all text-center text-sm")},m(se,be){f(se,c,be),L(c,l),L(c,g),L(c,y),fe&&fe.m(y,null),L(y,E),L(y,C),L(C,R),f(se,H,be),f(se,j,be),L(j,Y),f(se,ee,be),f(se,Q,be),L(Q,te),L(Q,re),L(Q,X),L(Q,Ae),$e||(ge=N(j,"click",s[34]),$e=!0)},p(se,be){se[21].picture||se[21].name?fe?fe.p(se,be):(fe=Cp(se),fe.c(),fe.m(y,E)):fe&&(fe.d(1),fe=null),be[0]&2097152&&U!==(U=se[21].npub+"")&&q(R,U),be[0]&2097152&&D!==(D="https://nosta.me/"+se[21].npub)&&B(y,"href",D),be[0]&1&&G!==(G="my-2 mt-6 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white bg-"+se[0]+"-900 hover:bg-"+se[0]+"-950")&&B(j,"class",G),be[0]&2048&&pe!==(pe=Zh(se[11])+"")&&q(Ae,pe)},i:a,o:a,d(se){se&&(p(c),p(H),p(j),p(ee),p(Q)),fe&&fe.d(),$e=!1,ge()}}}function Dv(s){let c,l,g,y,E,C,U,R,D,H,j,Y,G,ee,Q,te,re,X=s[19]&&Np(s),pe=[Qv,Wv],Ae=[];function $e(se,be){return se[12]?0:1}R=$e(s),D=Ae[R]=pe[R](s);let ge=s[12]&&s[16]&&Op(s),fe=!s[12]&&Rp(s);return{c(){c=v("div"),c.textContent="How do you want to connect to Nostr?",l=P(),g=v("form"),y=v("input"),E=P(),X&&X.c(),C=P(),U=v("button"),D.c(),Y=P(),ge&&ge.c(),G=P(),fe&&fe.c(),ee=M(),B(c,"class","text-center text-lg"),B(y,"class","box-border w-full rounded px-2 py-1 text-lg text-neutral-800 outline-none"),B(y,"placeholder","user@provider or bunker://..."),y.autofocus=!0,y.disabled=s[12],B(y,"autocapitalize","none"),B(U,"class",H="mt-4 flex w-full cursor-pointer items-center justify-center rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+s[0]+"-900 hover:bg-"+s[0]+"-950"),U.disabled=j=!s[26]||s[12],B(g,"class","mb-1 mt-4 flex flex-col")},m(se,be){f(se,c,be),f(se,l,be),f(se,g,be),L(g,y),s[52](y),x(y,s[4]),L(g,E),X&&X.m(g,null),L(g,C),L(g,U),Ae[R].m(U,null),L(g,Y),ge&&ge.m(g,null),f(se,G,be),fe&&fe.m(se,be),f(se,ee,be),Q=!0,y.focus(),te||(re=[N(y,"input",s[53]),N(g,"submit",s[33])],te=!0)},p(se,be){(!Q||be[0]&4096)&&(y.disabled=se[12]),be[0]&16&&y.value!==se[4]&&x(y,se[4]),se[19]?X?X.p(se,be):(X=Np(se),X.c(),X.m(g,C)):X&&(X.d(1),X=null);let Be=R;R=$e(se),R!==Be&&(Ct(),un(Ae[Be],1,1,()=>{Ae[Be]=null}),qt(),D=Ae[R],D||(D=Ae[R]=pe[R](se),D.c()),Mt(D,1),D.m(U,null)),(!Q||be[0]&1&&H!==(H="mt-4 flex w-full cursor-pointer items-center justify-center rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+se[0]+"-900 hover:bg-"+se[0]+"-950"))&&B(U,"class",H),(!Q||be[0]&67112960&&j!==(j=!se[26]||se[12]))&&(U.disabled=j),se[12]&&se[16]?ge?ge.p(se,be):(ge=Op(se),ge.c(),ge.m(g,null)):ge&&(ge.d(1),ge=null),se[12]?fe&&(fe.d(1),fe=null):fe?fe.p(se,be):(fe=Rp(se),fe.c(),fe.m(ee.parentNode,ee))},i(se){Q||(Mt(D),Q=!0)},o(se){un(D),Q=!1},d(se){se&&(p(c),p(l),p(g),p(G),p(ee)),s[52](null),X&&X.d(),Ae[R].d(),ge&&ge.d(),fe&&fe.d(se),te=!1,h(re)}}}function Fv(s){let c,l,g,y,E,C,U,R,D,H,j,Y,G,ee,Q,te,re,X,pe,Ae,$e,ge,fe=hh(s[22]),se=[];for(let be=0;be<fe.length;be+=1)se[be]=Up(Bp(s,fe,be));return{c(){c=v("div"),c.textContent="Create a Nostr account",l=P(),g=v("form"),y=v("div"),E=v("input"),C=P(),U=v("div"),U.textContent="@",R=P(),D=v("select");for(let be=0;be<se.length;be+=1)se[be].c();H=P(),j=v("button"),Y=$("Continue \xBB"),Q=P(),te=v("div"),re=$("Do you already have a Nostr address?"),X=v("br"),pe=P(),Ae=v("button"),Ae.textContent="Login now",B(c,"class","text-center text-lg"),B(E,"class","box-border w-40 rounded px-2 py-1 text-lg text-neutral-800 outline-none"),B(E,"placeholder","bob"),E.autofocus=!0,B(E,"autocapitalize","none"),B(U,"class","mx-2 text-2xl"),B(D,"class","box-border w-full rounded px-2 py-1 text-lg text-neutral-800 outline-none"),s[10]===void 0&&je(()=>s[51].call(D)),B(y,"class","flex flex-row"),B(j,"class",G="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+s[0]+"-900 hover:bg-"+s[0]+"-950"),j.disabled=ee=!s[10]||!s[9]||s[18],B(g,"class","mb-1 mt-4"),B(Ae,"class","cursor-pointer border-0 bg-transparent text-sm text-white underline"),B(te,"class","mt-6 text-center text-sm leading-3")},m(be,Be){f(be,c,Be),f(be,l,Be),f(be,g,Be),L(g,y),L(y,E),s[49](E),x(E,s[9]),L(y,C),L(y,U),L(y,R),L(y,D);for(let Oe=0;Oe<se.length;Oe+=1)se[Oe]&&se[Oe].m(D,null);z(D,s[10],!0),L(g,H),L(g,j),L(j,Y),f(be,Q,Be),f(be,te,Be),L(te,re),L(te,X),L(te,pe),L(te,Ae),E.focus(),$e||(ge=[N(E,"input",s[50]),N(E,"input",s[38]),N(D,"change",s[51]),N(g,"submit",s[37]),N(Ae,"click",s[36])],$e=!0)},p(be,Be){if(Be[0]&512&&E.value!==be[9]&&x(E,be[9]),Be[0]&4194304){fe=hh(be[22]);let Oe;for(Oe=0;Oe<fe.length;Oe+=1){let gt=Bp(be,fe,Oe);se[Oe]?se[Oe].p(gt,Be):(se[Oe]=Up(gt),se[Oe].c(),se[Oe].m(D,null))}for(;Oe<se.length;Oe+=1)se[Oe].d(1);se.length=fe.length}Be[0]&4195328&&z(D,be[10]),Be[0]&1&&G!==(G="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+be[0]+"-900 hover:bg-"+be[0]+"-950")&&B(j,"class",G),Be[0]&4457984&&ee!==(ee=!be[10]||!be[9]||be[18])&&(j.disabled=ee)},i:a,o:a,d(be){be&&(p(c),p(l),p(g),p(Q),p(te)),s[49](null),w(se,be),$e=!1,h(ge)}}}function jv(s){let c,l,g;return{c(){c=v("div"),c.textContent="What is that?",l=P(),g=v("div"),g.innerHTML=`<p class="mb mt-4">This widget is created with <i>window.nostr.js</i>, a small script
|
|
you can drop in any page that already uses NIP-07 and make it also
|
|
work with NIP-46 automatically when the user doesn't have an
|
|
extension installed.
|
|
<br/>
|
|
It adds a small floating button on the side of the window that users
|
|
can use to create Nostr accuonts or connect to their NIP-46 bunkers.</p> <p class="mt-4">This tool is opensource, get the code from the <a target="_blank" class="underline" href="https://github.com/fiatjaf/window.nostr.js">project's page</a>.</p> <p class="mt-4">You don't know what Nostr is?
|
|
<a target="_blank" class="underline" href="https://www.nostr.com">Learn more</a>.</p>`,B(c,"class","text-center text-lg"),B(g,"class","text-base leading-5")},m(y,E){f(y,c,E),f(y,l,E),f(y,g,E)},p:a,i:a,o:a,d(y){y&&(p(c),p(l),p(g))}}}function Hv(s){let c,l,g,y,E,C,U=new URL(s[15]).host+"",R,D,H,j,Y,G,ee,Q,te,re;return{c(){c=v("div"),l=v("div"),l.textContent="An action requires your confirmation",g=P(),y=v("div"),E=$("Now you a new window will bring you to "),C=v("strong"),R=$(U),D=$(" where you can approve the current action. If nothing happens check that if your browser is blocking popups, pleaase."),H=v("br"),j=$(`
|
|
After that you will be returned to this page.`),Y=P(),G=v("button"),ee=$("Confirm action \xBB"),B(l,"class","text-center text-lg"),B(y,"class","mt-4 text-center text-sm leading-4"),B(G,"class",Q="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+s[0]+"-900 hover:bg-"+s[0]+"-950"),B(c,"class","m-auto w-full")},m(X,pe){f(X,c,pe),L(c,l),L(c,g),L(c,y),L(y,E),L(y,C),L(C,R),L(y,D),L(y,H),L(y,j),L(c,Y),L(c,G),L(G,ee),te||(re=N(G,"click",s[48]),te=!0)},p(X,pe){pe[0]&32768&&U!==(U=new URL(X[15]).host+"")&&q(R,U),pe[0]&1&&Q!==(Q="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+X[0]+"-900 hover:bg-"+X[0]+"-950")&&B(G,"class",Q)},i:a,o:a,d(X){X&&p(c),te=!1,re()}}}function Vv(s){let c,l,g,y,E,C,U=new URL(s[14]).host+"",R,D,H,j,Y,G,ee,Q,te,re;return{c(){c=v("div"),l=v("div"),l.textContent="Login into a Nostr account",g=P(),y=v("div"),E=$("Now you a new window will bring you to "),C=v("strong"),R=$(U),D=$(" where you can login and approve the permissions. If nothing happens check that if your browser is blocking popups, pleaase."),H=v("br"),j=$(`
|
|
After that you will be returned to this page.`),Y=P(),G=v("button"),ee=$("Login now \xBB"),B(l,"class","text-center text-lg"),B(y,"class","mt-4 text-center text-sm leading-4"),B(G,"class",Q="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+s[0]+"-900 hover:bg-"+s[0]+"-950"),B(c,"class","m-auto w-full")},m(X,pe){f(X,c,pe),L(c,l),L(c,g),L(c,y),L(y,E),L(y,C),L(C,R),L(y,D),L(y,H),L(y,j),L(c,Y),L(c,G),L(G,ee),te||(re=N(G,"click",s[47]),te=!0)},p(X,pe){pe[0]&16384&&U!==(U=new URL(X[14]).host+"")&&q(R,U),pe[0]&1&&Q!==(Q="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+X[0]+"-900 hover:bg-"+X[0]+"-950")&&B(G,"class",Q)},i:a,o:a,d(X){X&&p(c),te=!1,re()}}}function qv(s){let c,l,g,y,E,C,U=new URL(s[13]).host+"",R,D,H,j,Y,G,ee,Q,te,re;return{c(){c=v("div"),l=v("div"),l.textContent="Create a Nostr account",g=P(),y=v("div"),E=$("Now you a new window will bring you to "),C=v("strong"),R=$(U),D=$(" where the account creation will take place. If nothing happens check that if your browser is blocking popups, pleaase."),H=v("br"),j=$(`
|
|
After that you will be returned to this page.`),Y=P(),G=v("button"),ee=$("Start account creation \xBB"),B(l,"class","text-center text-lg"),B(y,"class","mt-4 text-center text-sm leading-4"),B(G,"class",Q="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+s[0]+"-900 hover:bg-"+s[0]+"-950"),B(c,"class","m-auto w-full")},m(X,pe){f(X,c,pe),L(c,l),L(c,g),L(c,y),L(y,E),L(y,C),L(C,R),L(y,D),L(y,H),L(y,j),L(c,Y),L(c,G),L(G,ee),te||(re=N(G,"click",s[46]),te=!0)},p(X,pe){pe[0]&8192&&U!==(U=new URL(X[13]).host+"")&&q(R,U),pe[0]&1&&Q!==(Q="mt-4 block w-full cursor-pointer rounded border-0 px-2 py-1 text-lg text-white disabled:cursor-default disabled:bg-neutral-400 disabled:text-neutral-200 bg-"+X[0]+"-900 hover:bg-"+X[0]+"-950")&&B(G,"class",Q)},i:a,o:a,d(X){X&&p(c),te=!1,re()}}}function Cp(s){let c,l,g=s[21].picture&&Pp(s),y=s[21].name&&Ip(s);return{c(){c=v("div"),g&&g.c(),l=P(),y&&y.c(),B(c,"class","mb-2 flex items-center justify-center gap-2")},m(E,C){f(E,c,C),g&&g.m(c,null),L(c,l),y&&y.m(c,null)},p(E,C){E[21].picture?g?g.p(E,C):(g=Pp(E),g.c(),g.m(c,l)):g&&(g.d(1),g=null),E[21].name?y?y.p(E,C):(y=Ip(E),y.c(),y.m(c,null)):y&&(y.d(1),y=null)},d(E){E&&p(c),g&&g.d(),y&&y.d()}}}function Pp(s){let c,l,g;return{c(){c=v("img"),T(c.src,l=s[21].picture)||B(c,"src",l),B(c,"alt",""),B(c,"class",g="h-10 w-10 rounded-full border-2 border-solid border-transparent group-hover:border-"+s[0]+"-100")},m(y,E){f(y,c,E)},p(y,E){E[0]&2097152&&!T(c.src,l=y[21].picture)&&B(c,"src",l),E[0]&1&&g!==(g="h-10 w-10 rounded-full border-2 border-solid border-transparent group-hover:border-"+y[0]+"-100")&&B(c,"class",g)},d(y){y&&p(c)}}}function Ip(s){let c,l=s[21].name+"",g;return{c(){c=v("div"),g=$(l),B(c,"class","text-3xl decoration-2 underline-offset-4 group-hover:underline")},m(y,E){f(y,c,E),L(c,g)},p(y,E){E[0]&2097152&&l!==(l=y[21].name+"")&&q(g,l)},d(y){y&&p(c)}}}function Np(s){let c,l;return{c(){c=v("div"),l=$(s[19]),B(c,"class","my-2 rounded bg-yellow-100 p-2 text-center text-sm leading-4 text-red-400")},m(g,y){f(g,c,y),L(c,l)},p(g,y){y[0]&524288&&q(l,g[19])},d(g){g&&p(c)}}}function Wv(s){let c;return{c(){c=$("Connect \xBB")},m(l,g){f(l,c,g)},i:a,o:a,d(l){l&&p(c)}}}function Qv(s){let c,l,g;return l=new $p({}),{c(){c=$(`Connecting to bunker
|
|
`),ph(l.$$.fragment)},m(y,E){f(y,c,E),mu(l,y,E),g=!0},i(y){g||(Mt(l.$$.fragment,y),g=!0)},o(y){un(l.$$.fragment,y),g=!1},d(y){y&&p(c),bu(l,y)}}}function Op(s){let c,l,g,y,E;return{c(){c=v("div"),l=$(`Waiting too much?
|
|
`),g=v("button"),g.textContent="Cancel the connection",B(g,"class","cursor-pointer border-0 bg-transparent text-sm text-white underline"),B(c,"class","mt-6 text-center text-sm leading-3")},m(C,U){f(C,c,U),L(c,l),L(c,g),y||(E=N(g,"click",s[39]),y=!0)},p:a,d(C){C&&p(c),y=!1,E()}}}function Rp(s){let c,l,g,y,E,C,U;return{c(){c=v("div"),l=$("Do you need a Nostr account?"),g=v("br"),y=P(),E=v("button"),E.textContent="Sign up now",B(E,"class","cursor-pointer border-0 bg-transparent text-sm text-white underline"),B(c,"class","mt-6 text-center text-sm leading-3")},m(R,D){f(R,c,D),L(c,l),L(c,g),L(c,y),L(c,E),C||(U=N(E,"click",s[35]),C=!0)},p:a,d(R){R&&p(c),C=!1,U()}}}function Up(s){let c,l,g;return{c(){c=v("option"),B(c,"label",l=s[78].domain),c.__value=g=s[78],x(c,c.__value),B(c,"class","px-2 py-1 text-lg")},m(y,E){f(y,c,E)},p(y,E){E[0]&4194304&&l!==(l=y[78].domain)&&B(c,"label",l),E[0]&4194304&&g!==(g=y[78])&&(c.__value=g,x(c,c.__value))},d(y){y&&p(c)}}}function Kv(s){let c,l;return{c(){c=v("img"),T(c.src,l=s[21].picture)||B(c,"src",l),B(c,"alt",""),B(c,"class","h-6 w-6 rounded-full")},m(g,y){f(g,c,y)},p(g,y){y[0]&2097152&&!T(c.src,l=g[21].picture)&&B(c,"src",l)},i:a,o:a,d(g){g&&p(c)}}}function Gv(s){let c,l,g,y=(s[21].name||s[21].npub.slice(0,7)+"\u2026"+s[21].npub.slice(-4))+"",E;function C(D,H){return D[21].picture?e_:Xv}let U=C(s),R=U(s);return{c(){c=v("div"),R.c(),l=P(),g=v("div"),E=$(y),B(g,"class","max-w-56 overflow-hidden whitespace-nowrap overflow-ellipsis inline-block"),B(c,"class","flex px-2 items-center")},m(D,H){f(D,c,H),R.m(c,null),L(c,l),L(c,g),L(g,E)},p(D,H){U===(U=C(D))&&R?R.p(D,H):(R.d(1),R=U(D),R&&(R.c(),R.m(c,l))),H[0]&2097152&&y!==(y=(D[21].name||D[21].npub.slice(0,7)+"\u2026"+D[21].npub.slice(-4))+"")&&q(E,y)},i:a,o:a,d(D){D&&p(c),R.d()}}}function Zv(s){let c;return{c(){c=v("div"),c.textContent="N",B(c,"class","w-6 text-center")},m(l,g){f(l,c,g)},p:a,i:a,o:a,d(l){l&&p(c)}}}function Yv(s){let c;return{c(){c=v("div"),c.textContent="Connect with Nostr",B(c,"class","flex px-2 items-center")},m(l,g){f(l,c,g)},p:a,i:a,o:a,d(l){l&&p(c)}}}function Jv(s){let c,l,g,y;return g=new $p({}),{c(){c=v("div"),l=$(`Connecting to bunker
|
|
`),ph(g.$$.fragment),B(c,"class","flex px-2 items-center")},m(E,C){f(E,c,C),L(c,l),mu(g,c,null),y=!0},p:a,i(E){y||(Mt(g.$$.fragment,E),y=!0)},o(E){un(g.$$.fragment,E),y=!1},d(E){E&&p(c),bu(g)}}}function Xv(s){let c;return{c(){c=$("\u2609")},m(l,g){f(l,c,g)},p:a,d(l){l&&p(c)}}}function e_(s){let c,l;return{c(){c=v("img"),T(c.src,l=s[21].picture)||B(c,"src",l),B(c,"alt",""),B(c,"class","mr-2 h-5 w-5 rounded-full")},m(g,y){f(g,c,y)},p(g,y){y[0]&2097152&&!T(c.src,l=g[21].picture)&&B(c,"src",l)},d(g){g&&p(c)}}}function t_(s){let c,l,g,y,E,C,U,R=[zv,Uv,Rv],D=[];function H(j,Y){return!j[25]&&!j[21]&&j[1]?0:j[25]?2:1}return l=H(s),g=D[l]=R[l](s),{c(){c=v("div"),g.c(),B(c,"class","draggable animate-fadein font-sans text-white"),B(c,"style",y="position: fixed; "+(s[25]&&s[5]?"width: 100vw;":"")+"; right: "+(s[25]&&s[5]?"0":s[3])+"px; user-select: none; "+(s[25]&&s[5]?"bottom: 0px":s[24]+":"+s[23]+"px")),K(c,"cursor-pointer",!s[21]&&!s[25])},m(j,Y){f(j,c,Y),D[l].m(c,null),s[54](c),E=!0,C||(U=[N(nl,"click",s[29]),N(nl,"mouseup",s[42]),N(nl,"mousemove",s[41]),N(c,"mousedown",s[40])],C=!0)},p(j,Y){let G=l;l=H(j),l===G?D[l].p(j,Y):(Ct(),un(D[G],1,1,()=>{D[G]=null}),qt(),g=D[l],g?g.p(j,Y):(g=D[l]=R[l](j),g.c()),Mt(g,1),g.m(c,null)),(!E||Y[0]&58720296&&y!==(y="position: fixed; "+(j[25]&&j[5]?"width: 100vw;":"")+"; right: "+(j[25]&&j[5]?"0":j[3])+"px; user-select: none; "+(j[25]&&j[5]?"bottom: 0px":j[24]+":"+j[23]+"px")))&&B(c,"style",y),(!E||Y[0]&35651584)&&K(c,"cursor-pointer",!j[21]&&!j[25])},i(j){E||(Mt(g),E=!0)},o(j){un(g),E=!1},d(j){j&&p(c),D[l].d(),s[54](null),C=!1,h(U)}}}let zp="We could not connect to a NIP-46 bunker with that url, are you sure it is set up correctly?",Mp="We were not able to connect using this address. For it to work it has to come from a NIP-46 provider.",Mr=20;function rl(s){return window.open(s,"window.nostr","width=600,height=800,popup=yes")}function n_(s,c,l){let g,y,E,C,U,R,D=Nv("only screen and (max-width: 640px)");I(s,D,ye=>l(5,R=ye));let H={ORIGIN:"wnj:origin",CLIENT_SECRET:"wnj:clientSecret",Y_POS:"wnj:ypos",CALLBACK_TOKEN:"wnj:callbackToken",BUNKER_POINTER:"wnj:bunkerPointer"},j,{accent:Y}=c,{position:G="top"}=c,{startHidden:ee}=c,{compactMode:Q}=c,te=window,re=new A1,X,pe,Ae,$e,ge,fe,se=localStorage.getItem(H.CLIENT_SECRET);se?fe=_u(se):(fe=a1(),localStorage.setItem(H.CLIENT_SECRET,Wt(fe)));let be="closed",Be,Oe,gt,mt,bt,me,ke=null,Ue=null,Ge=null,Ye=!1,Ke,Ft,It,Yt=!1,wt,hn,Sn=[],{right:jn=20}=c,Dr=!1,sn=!1,Fr,Eo,an,ir={pool:re,onauth(ye){Ke?l(13,ke=ye):wt?(l(15,Ge=ye),l(25,E=!0)):l(14,Ue=ye)}},xo=wh(()=>{switch(be){case"justopened":l(44,be="opened");break;case"justclosed":l(44,be="closed");break}},500);function ko(){l(44,be="justopened"),xo()}function jr(){l(44,be="justclosed"),xo()}function fa(){if(Be&&!me){al();return}ko()}sl();let Hp={isWnj:!0,async getPublicKey(){return Be?Be.pubkey:(!bt&&!me&&ko(),(await mt).bp.pubkey)},async signEvent(ye){try{return!bt&&!me&&fa(),await(await mt).signEvent(ye)}finally{l(15,Ge=null),jr()}},async getRelays(){return!bt&&!me&&fa(),(await mt).getRelays()},nip04:{async encrypt(ye,dt){return!bt&&!me&&fa(),(await mt).nip04Encrypt(ye,dt)},async decrypt(ye,dt){return!bt&&!me&&fa(),(await mt).nip04Decrypt(ye,dt)}}};function sl(){jr(),Be=null,mt=new Promise((ye,dt)=>{Oe=ye,gt=dt}),l(21,wt=null),l(12,bt=!1),l(16,Ye=!1),l(17,Ke=!1),me=!1,hn=null,l(19,It="")}de(()=>{if(!Be){let ye=localStorage.getItem(H.BUNKER_POINTER);ye&&(Be=JSON.parse(ye),cl())}if(te.nostr&&!te.nostr.isWnj){te.destroyWnj();return}else Object.defineProperty(window,"nostr",{get(){return Hp},set(ye){Hp=ye,ye.isWnj||te.destroyWnj()},configurable:!0});return()=>{hn&&hn.close()}});function s_(ye){Math.abs(y-Eo)>6||Date.now()-an>600||be==="justopened"||be==="justclosed"||(ye.composedPath().find(dt=>dt.id==="wnj")?ko():jr())}function a_(ye){jr(),l(17,Ke=!1),l(13,ke=null),l(14,Ue=null),l(15,Ge=null),ye.stopPropagation()}function c_(ye){l(20,Yt=!0),ye.stopPropagation()}function u_(ye){l(20,Yt=!1),ye.stopPropagation()}async function l_(ye){ye.preventDefault();try{if(Be=await Sv(X.value),!Be){X.value.match(da)?l(19,It=zp):l(19,It=Mp);return}X.setCustomValidity(""),l(19,It=""),await al(),cl()}catch{X.value.match(da)?l(19,It=zp):l(19,It=Mp),l(12,bt=!1)}}async function d_(ye){ye.preventDefault(),localStorage.removeItem(H.BUNKER_POINTER),sl()}async function f_(ye){ye.preventDefault(),l(17,Ke=!0),Sn.length===0&&(l(22,Sn=await Tv(re,["wss://relay.nostr.band","wss://nos.lol","wss://nostr-pub.wellorder.net"])),l(10,ge=Sn[0]))}function h_(ye){l(17,Ke=!1)}async function p_(ye){if(ye.preventDefault(),!ge)return;l(18,Ft=!0);let dt=await Av(ge,ir,Ae.value,ge.domain,void 0);l(18,Ft=!1),ko(),l(17,Ke=!1),Be=dt.bp,cl(),al(dt)}let g_=wh(async()=>{ge&&Ae.value.length>0&&(await $v(Ae.value+"@"+ge.domain)?Ae.setCustomValidity(`'${Ae.value}' is already taken.`):Ae.setCustomValidity(""))},500);function m_(){l(16,Ye=!1),l(12,bt=!1),gt("connection aborted"),sl()}async function al(ye=void 0){ye=ye||new Sp(fe,Be,ir),l(12,bt=!0);let dt=setTimeout(()=>{l(16,Ye=!0),l(25,E=!0)},5e3);try{await ye.connect(),me=!0,localStorage.setItem(H.BUNKER_POINTER,JSON.stringify(Be)),jr(),Oe(ye)}catch(sr){gt(sr?.message||String(sr))}finally{clearTimeout(dt),l(12,bt=!1),l(16,Ye=!1),l(13,ke=null),l(14,Ue=null),l(15,Ge=null)}}function cl(ye=null){let dt=Be.pubkey;l(21,wt={pubkey:dt,npub:Lv(dt),event:null}),hn=re.subscribeMany(["wss://purplepag.es","wss://relay.snort.social","wss://relay.nos.social"],[{kinds:[0],authors:[dt]}],{onevent(sr){var Vp;if(!((((Vp=wt.event)==null?void 0:Vp.created_at)||0)>=sr.created_at))try{let{name:B_,picture:L_}=JSON.parse(sr.content);l(21,wt.event=sr,wt),l(21,wt.name=B_,wt),l(21,wt.picture=L_,wt),ye?.(),ye=null}catch{}}})}function b_(ye){if(E)return;Dr=!0;let dt=j.getBoundingClientRect();Fr=ye.clientY-dt.top,Eo=y,an=Date.now()}function w_(ye){Dr&&(g==="top"?l(23,y=ye.clientY):l(23,y=window.innerHeight-ye.clientY),l(23,y-=Fr),l(45,sn=!0),y<Mr&&l(23,y=Mr),y>window.innerHeight-Mr&&l(23,y=window.innerHeight-Mr))}function y_(){if(Dr=!1,setTimeout(()=>{l(45,sn=!1)},10),sn){let ye=j.getBoundingClientRect(),dt=window.innerHeight,sr=dt/2;ye.top<sr?(l(24,g="top"),l(23,y=ye.top)):(l(24,g="bottom"),l(23,y=dt-ye.bottom)),y<Mr&&l(23,y=Mr),localStorage.setItem(H.ORIGIN,g),localStorage.setItem(H.Y_POS,y.toString())}}let v_=()=>rl(ke),__=()=>rl(Ue),E_=()=>{rl(Ge)};function x_(ye){ve[ye?"unshift":"push"](()=>{Ae=ye,l(8,Ae)})}function k_(){$e=this.value,l(9,$e)}function S_(){ge=V(this),l(10,ge),l(22,Sn)}function A_(ye){ve[ye?"unshift":"push"](()=>{X=ye,l(7,X)})}function T_(){pe=this.value,l(4,pe)}function $_(ye){ve[ye?"unshift":"push"](()=>{j=ye,l(6,j)})}return s.$$set=ye=>{"accent"in ye&&l(0,Y=ye.accent),"position"in ye&&l(43,G=ye.position),"startHidden"in ye&&l(1,ee=ye.startHidden),"compactMode"in ye&&l(2,Q=ye.compactMode),"right"in ye&&l(3,jn=ye.right)},s.$$.update=()=>{s.$$.dirty[0]&32|s.$$.dirty[1]&4096&&l(24,g=R?"bottom":localStorage.getItem(H.ORIGIN)||G),s.$$.dirty[0]&32&&l(23,y=R?Mr:parseInt(localStorage.getItem(H.Y_POS)||"0")||Mr),s.$$.dirty[1]&8192&&l(25,E=be==="justopened"||be==="opened"),s.$$.dirty[0]&1|s.$$.dirty[1]&16384&&l(27,C=sn?"cursor-grabbing outline-dashed outline-"+Y+"-500 outline-1 outline-offset-4":"outline-none"),s.$$.dirty[0]&16&&l(26,U=pe&&(pe.match(da)||pe.match(Ap)))},[Y,ee,Q,jn,pe,R,j,X,Ae,$e,ge,fe,bt,ke,Ue,Ge,Ye,Ke,Ft,It,Yt,wt,Sn,y,g,E,U,C,D,s_,a_,c_,u_,l_,d_,f_,h_,p_,g_,m_,b_,w_,y_,G,be,sn,v_,__,E_,x_,k_,S_,A_,T_,$_]}class r_ extends mh{constructor(c){super(),gh(this,c,n_,t_,b,{accent:0,position:43,startHidden:1,compactMode:2,right:3},null,[-1,-1,-1])}}let ri=window;ri.destroyWnj=()=>{setTimeout(()=>{o_.$destroy()},1)};let ol=document.createElement("div");ol.style.zIndex="90000",document.body.appendChild(ol);let il=document.createElement("div");il.id="wnj";let Dp=document.createElement("style");Dp.innerHTML=i;let Fp=ol.attachShadow({mode:"open"});Fp.appendChild(il),Fp.appendChild(Dp);let o_=new r_({target:il,props:{accent:((e=ri.wnjParams)==null?void 0:e.accent)||"cyan",position:((t=ri.wnjParams)==null?void 0:t.position)==="bottom"?"bottom":"top",startHidden:!!((n=ri.wnjParams)!=null&&n.startHidden),compactMode:!!((r=ri.wnjParams)!=null&&r.compactMode)}});if(!((o=ri.wnjParams)!=null&&o.disableOverflowFix)){var jp=document.createElement("style"),i_=`
|
|
html, body {
|
|
overflow: auto;
|
|
height: 100%;
|
|
}
|
|
`;jp.innerHTML=i_,document.head.appendChild(jp)}})()});function De(){}function Nt(e,t){for(let n in t)e[n]=t[n];return e}function dl(e){return e()}function pa(){return Object.create(null)}function An(e){e.forEach(dl)}function Yi(e){return typeof e=="function"}function tt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}var ha;function Ot(e,t){return e===t?!0:(ha||(ha=document.createElement("a")),ha.href=t,e===ha.href)}function Wp(e){return Object.keys(e).length===0}function Qp(e,...t){if(e==null){for(let r of t)r(void 0);return De}let n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function fl(e,t,n){e.$$.on_destroy.push(Qp(t,n))}function So(e,t,n,r){if(e){let o=Kp(e,t,n,r);return e[0](o)}}function Kp(e,t,n,r){return e[1]&&r?Nt(n.ctx.slice(),e[1](r(t))):n.ctx}function Ao(e,t,n,r){if(e[2]&&r){let o=e[2](r(n));if(t.dirty===void 0)return o;if(typeof o=="object"){let i=[],a=Math.max(t.dirty.length,o.length);for(let u=0;u<a;u+=1)i[u]=t.dirty[u]|o[u];return i}return t.dirty|o}return t.dirty}function To(e,t,n,r,o,i){if(o){let a=Kp(t,n,r,i);e.p(a,o)}}function $o(e){if(e.ctx.length>32){let t=[],n=e.ctx.length/32;for(let r=0;r<n;r++)t[r]=-1;return t}return-1}function oi(e){let t={};for(let n in e)n[0]!=="$"&&(t[n]=e[n]);return t}function ar(e,t){let n={};t=new Set(t);for(let r in e)!t.has(r)&&r[0]!=="$"&&(n[r]=e[r]);return n}function hl(e){return e??""}var pl=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;var ga=class e{_listeners="WeakMap"in pl?new WeakMap:void 0;_observer=void 0;options;constructor(t){this.options=t}observe(t,n){return this._listeners.set(t,n),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(t=>{for(let n of t)e.entries.set(n.target,n),this._listeners.get(n.target)?.(n)}))}};ga.entries="WeakMap"in pl?new WeakMap:void 0;var Gp=!1;function Zp(){Gp=!0}function Yp(){Gp=!1}function ne(e,t){e.appendChild(t)}function le(e,t,n){e.insertBefore(t,n||null)}function ce(e){e.parentNode&&e.parentNode.removeChild(e)}function Jt(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function ae(e){return document.createElement(e)}function ze(e){return document.createTextNode(e)}function Ne(){return ze(" ")}function $t(){return ze("")}function Ji(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function oe(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}var F_=["width","height"];function cr(e,t){let n=Object.getOwnPropertyDescriptors(e.__proto__);for(let r in t)t[r]==null?e.removeAttribute(r):r==="style"?e.style.cssText=t[r]:r==="__value"?e.value=e[r]=t[r]:n[r]&&n[r].set&&F_.indexOf(r)===-1?e[r]=t[r]:oe(e,r,t[r])}function Xi(e,t,n){let r=t.toLowerCase();r in e?e[r]=typeof e[r]=="boolean"&&n===""?!0:n:t in e?e[t]=typeof e[t]=="boolean"&&n===""?!0:n:oe(e,t,n)}function Jp(e){return Array.from(e.childNodes)}function Ze(e,t){t=""+t,e.data!==t&&(e.data=t)}function Bo(e,t,n){e.classList.toggle(t,!!n)}function ma(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Xp(e){let t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}var Hr;function ur(e){Hr=e}function es(){if(!Hr)throw new Error("Function called outside component initialization");return Hr}function Bt(e){es().$$.on_mount.push(e)}function gl(e){es().$$.after_update.push(e)}function ml(e){es().$$.on_destroy.push(e)}function bl(){let e=es();return(t,n,{cancelable:r=!1}={})=>{let o=e.$$.callbacks[t];if(o){let i=ma(t,n,{cancelable:r});return o.slice().forEach(a=>{a.call(e,i)}),!i.defaultPrevented}return!0}}var Lo=[];var ai=[],si=[],eg=[],tg=Promise.resolve(),yl=!1;function vl(){yl||(yl=!0,tg.then(Tn))}function _l(){return vl(),tg}function ts(e){si.push(e)}var wl=new Set,ii=0;function Tn(){if(ii!==0)return;let e=Hr;do{try{for(;ii<Lo.length;){let t=Lo[ii];ii++,ur(t),Q_(t.$$)}}catch(t){throw Lo.length=0,ii=0,t}for(ur(null),Lo.length=0,ii=0;ai.length;)ai.pop()();for(let t=0;t<si.length;t+=1){let n=si[t];wl.has(n)||(wl.add(n),n())}si.length=0}while(Lo.length);for(;eg.length;)eg.pop()();yl=!1,wl.clear(),ur(e)}function Q_(e){if(e.fragment!==null){e.update(),An(e.before_update);let t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ts)}}function ng(e){let t=[],n=[];si.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),si=t}var ba=new Set,Co;function yt(){Co={r:0,c:[],p:Co}}function vt(){Co.r||An(Co.c),Co=Co.p}function Ee(e,t){e&&e.i&&(ba.delete(e),e.i(t))}function Te(e,t,n,r){if(e&&e.o){if(ba.has(e))return;ba.add(e),Co.c.push(()=>{ba.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function Je(e){return e?.length!==void 0?e:Array.from(e)}function Hn(e,t){let n={},r={},o={$$scope:1},i=e.length;for(;i--;){let a=e[i],u=t[i];if(u){for(let d in a)d in u||(r[d]=1);for(let d in u)o[d]||(n[d]=u[d],o[d]=1);e[i]=u}else for(let d in a)o[d]=1}for(let a in r)a in n||(n[a]=void 0);return n}function wa(e){return typeof e=="object"&&e!==null?e:{}}var K_=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],G_=new Set([...K_]);function ft(e){e&&e.c()}function st(e,t,n){let{fragment:r,after_update:o}=e.$$;r&&r.m(t,n),ts(()=>{let i=e.$$.on_mount.map(dl).filter(Yi);e.$$.on_destroy?e.$$.on_destroy.push(...i):An(i),e.$$.on_mount=[]}),o.forEach(ts)}function at(e,t){let n=e.$$;n.fragment!==null&&(ng(n.after_update),An(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y_(e,t){e.$$.dirty[0]===-1&&(Lo.push(e),vl(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ct(e,t,n,r,o,i,a=null,u=[-1]){let d=Hr;ur(e);let h=e.$$={fragment:null,ctx:[],props:i,update:De,not_equal:o,bound:pa(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(d?d.$$.context:[])),callbacks:pa(),dirty:u,skip_bound:!1,root:t.target||d.$$.root};a&&a(h.root);let m=!1;if(h.ctx=n?n(e,t.props||{},(b,_,...T)=>{let A=T.length?T[0]:_;return h.ctx&&o(h.ctx[b],h.ctx[b]=A)&&(!h.skip_bound&&h.bound[b]&&h.bound[b](A),m&&Y_(e,b)),_}):[],h.update(),m=!0,An(h.before_update),h.fragment=r?r(h.ctx):!1,t.target){if(t.hydrate){Zp();let b=Jp(t.target);h.fragment&&h.fragment.l(b),b.forEach(ce)}else h.fragment&&h.fragment.c();t.intro&&Ee(e.$$.fragment),st(e,t.target,t.anchor),Yp(),Tn()}ur(d)}var J_;typeof HTMLElement=="function"&&(J_=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return()=>{let i;return{c:function(){i=ae("slot"),o!=="default"&&oe(i,"name",o)},m:function(d,h){le(d,i,h)},d:function(d){d&&ce(i)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=Xp(this);for(let o of this.$$s)o in n&&(t[o]=[e(o)]);for(let o of this.attributes){let i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=El(i,o.value,this.$$p_d,"toProp"))}for(let o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});let r=()=>{this.$$r=!0;for(let o in this.$$p_d)if(this.$$d[o]=this.$$c.$$.ctx[this.$$c.$$.props[o]],this.$$p_d[o].reflect){let i=El(o,this.$$d[o],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,i)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(let o in this.$$l)for(let i of this.$$l[o]){let a=this.$$c.$on(o,i);this.$$l_u.set(i,a)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=El(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function El(e,t,n,r){let o=n[e]?.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}var nt=class{$$=void 0;$$set=void 0;$destroy(){at(this,1),this.$destroy=De}$on(t,n){if(!Yi(n))return De;let r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{let o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(t){this.$$set&&!Wp(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}};var rg="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(rg);var im=ll(Al(),1);var c2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Tl=e=>e instanceof Uint8Array;var va=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),$n=(e,t)=>e<<32-t|e>>>t,u2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!u2)throw new Error("Non little-endian hardware is not supported");var l2=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xt(e){if(!Tl(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=l2[e[n]];return t}function Po(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){let o=r*2,i=e.slice(o,o+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[r]=a}return n}function d2(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function $l(e){if(typeof e=="string"&&(e=d2(e)),!Tl(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Bl(...e){let t=new Uint8Array(e.reduce((r,o)=>r+o.length,0)),n=0;return e.forEach(r=>{if(!Tl(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}var ya=class{clone(){return this._cloneInto()}};function Ll(e){let t=r=>e().update($l(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ci(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function lr(...e){let t=(o,i)=>a=>o(i(a)),n=Array.from(e).reverse().reduce((o,i)=>o?t(o,i.encode):i.encode,void 0),r=e.reduce((o,i)=>o?t(o,i.decode):i.decode,void 0);return{encode:n,decode:r}}function dr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(ci(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);let r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function fr(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function Ea(e,t="="){if(ci(e),typeof t!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of n)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function dg(e){if(typeof e!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function sg(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0,o=[],i=Array.from(e);for(i.forEach(a=>{if(ci(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,u=!0;for(let d=r;d<i.length;d++){let h=i[d],m=t*a+h;if(!Number.isSafeInteger(m)||t*a/t!==a||m-h!==t*a)throw new Error("convertRadix: carry overflow");if(a=m%n,i[d]=Math.floor(m/n),!Number.isSafeInteger(i[d])||i[d]*n+a!==m)throw new Error("convertRadix: carry overflow");if(u)i[d]?u=!1:r=d;else continue}if(o.push(a),u)break}for(let a=0;a<e.length-1&&e[a]===0;a++)o.push(0);return o.reverse()}var fg=(e,t)=>t?fg(t,e%t):e,_a=(e,t)=>e+(t-fg(e,t));function Cl(e,t,n,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(_a(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${_a(t,n)}`);let o=0,i=0,a=2**n-1,u=[];for(let d of e){if(ci(d),d>=2**t)throw new Error(`convertRadix2: invalid data word=${d} from=${t}`);if(o=o<<t|d,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)u.push((o>>i-n&a)>>>0);o&=2**i-1}if(o=o<<n-i&a,!r&&i>=t)throw new Error("Excess padding");if(!r&&o)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&u.push(o>>>0),u}function f2(e){return ci(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return sg(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(sg(t,e,2**8))}}}function Vr(e,t=!1){if(ci(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(_a(8,e)>32||_a(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Cl(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Cl(n,e,8,t))}}}function ag(e){if(typeof e!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}var h2=lr(Vr(4),dr("0123456789ABCDEF"),fr("")),p2=lr(Vr(5),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ea(5),fr("")),xA=lr(Vr(5),dr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ea(5),fr("")),kA=lr(Vr(5),dr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),fr(""),dg(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),g2=lr(Vr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ea(6),fr("")),m2=lr(Vr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ea(6),fr("")),Nl=e=>lr(f2(58),dr(e),fr("")),Pl=Nl("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),SA=Nl("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),AA=Nl("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),cg=[0,2,3,5,6,7,9,10,11],b2={encode(e){let t="";for(let n=0;n<e.length;n+=8){let r=e.subarray(n,n+8);t+=Pl.encode(r).padStart(cg[r.length],"1")}return t},decode(e){let t=[];for(let n=0;n<e.length;n+=11){let r=e.slice(n,n+11),o=cg.indexOf(r.length),i=Pl.decode(r);for(let a=0;a<i.length-o;a++)if(i[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(i.slice(i.length-o)))}return Uint8Array.from(t)}};var Il=lr(dr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),fr("")),ug=[996825010,642813549,513874426,1027748829,705979059];function ns(e){let t=e>>25,n=(e&33554431)<<5;for(let r=0;r<ug.length;r++)(t>>r&1)===1&&(n^=ug[r]);return n}function lg(e,t,n=1){let r=e.length,o=1;for(let i=0;i<r;i++){let a=e.charCodeAt(i);if(a<33||a>126)throw new Error(`Invalid prefix (${e})`);o=ns(o)^a>>5}o=ns(o);for(let i=0;i<r;i++)o=ns(o)^e.charCodeAt(i)&31;for(let i of t)o=ns(o)^i;for(let i=0;i<6;i++)o=ns(o);return o^=n,Il.encode(Cl([o%2**30],30,5,!1))}function hg(e){let t=e==="bech32"?1:734539939,n=Vr(5),r=n.decode,o=n.encode,i=ag(r);function a(m,b,_=90){if(typeof m!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof m}`);if(!Array.isArray(b)||b.length&&typeof b[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof b}`);let T=m.length+7+b.length;if(_!==!1&&T>_)throw new TypeError(`Length ${T} exceeds limit ${_}`);return m=m.toLowerCase(),`${m}1${Il.encode(b)}${lg(m,b,t)}`}function u(m,b=90){if(typeof m!="string")throw new Error(`bech32.decode input should be string, not ${typeof m}`);if(m.length<8||b!==!1&&m.length>b)throw new TypeError(`Wrong string length: ${m.length} (${m}). Expected (8..${b})`);let _=m.toLowerCase();if(m!==_&&m!==m.toUpperCase())throw new Error("String must be lowercase or uppercase");m=_;let T=m.lastIndexOf("1");if(T===0||T===-1)throw new Error('Letter "1" must be present between prefix and data only');let A=m.slice(0,T),k=m.slice(T+1);if(k.length<6)throw new Error("Data must be at least 6 characters long");let I=Il.decode(k).slice(0,-6),O=lg(A,I,t);if(!k.endsWith(O))throw new Error(`Invalid checksum in ${m}: expected "${O}"`);return{prefix:A,words:I}}let d=ag(u);function h(m){let{prefix:b,words:_}=u(m,!1);return{prefix:b,words:_,bytes:r(_)}}return{encode:a,decode:u,decodeToBytes:h,decodeUnsafe:d,fromWords:r,fromWordsUnsafe:i,toWords:o}}var qr=hg("bech32"),TA=hg("bech32m"),w2={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},y2=lr(Vr(4),dr("0123456789abcdef"),fr(""),dg(e=>{if(typeof e!="string"||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),v2={utf8:w2,hex:y2,base16:h2,base32:p2,base64:g2,base64url:m2,base58:Pl,base58xmr:b2},$A=`Invalid encoding type. Available types: ${Object.keys(v2).join(", ")}`;var _2=new TextDecoder("utf-8"),Rl=new TextEncoder;function Wr(e){e.indexOf("://")===-1&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),(t.port==="80"&&t.protocol==="ws:"||t.port==="443"&&t.protocol==="wss:")&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}var Ol=class{value;next=null;prev=null;constructor(t){this.value=t}},xa=class{first;last;constructor(){this.first=null,this.last=null}enqueue(t){let n=new Ol(t);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){let n=this.first;return this.first=null,this.last=null,n.value}let t=this.first;return this.first=t.next,t.value}};var E2=5e3;function pg(e){return k2("npub",Po(e))}function x2(e,t){let n=qr.toWords(t);return qr.encode(e,n,E2)}function k2(e,t){return x2(e,t)}function zl(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function rs(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=zl(n);return(o,i)=>r.then(a=>i(a.transaction(t,o).objectStore(t)))}var Ul;function gg(){return Ul||(Ul=rs("keyval-store","keyval")),Ul}function ka(e,t=gg()){return t("readwrite",n=>(e.forEach(r=>n.put(r[1],r[0])),zl(n.transaction)))}function Sa(e,t=gg()){return t("readonly",n=>Promise.all(e.map(r=>zl(n.get(r)))))}var S2=Math.pow(2,8)-1,A2=Math.pow(2,16)-1,T2=Math.pow(2,32)-1,RA=Math.pow(2,7)-1,UA=Math.pow(2,15)-1,zA=Math.pow(2,31)-1;var mg=function(e){var t=e-1;if(t<=S2)return Uint8Array;if(t<=A2)return Uint16Array;if(t<=T2)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")};function Vn(e){if(this.capacity=e,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var t=mg(e);this.forward=new t(e),this.backward=new t(e),this.K=new Array(e),this.V=new Array(e),this.size=0,this.head=0,this.tail=0,this.items={}}Vn.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}};Vn.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this};Vn.prototype.set=function(e,t){var n=this.items[e];if(typeof n<"u"){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n};Vn.prototype.setpop=function(e,t){var n=null,r=null,o=this.items[e];return typeof o<"u"?(this.splayOnTop(o),n=this.V[o],this.V[o]=t,{evicted:!1,key:e,value:n}):(this.size<this.capacity?o=this.size++:(o=this.tail,this.tail=this.backward[o],n=this.V[o],r=this.K[o],delete this.items[r]),this.items[e]=o,this.K[o]=e,this.V[o]=t,this.forward[o]=this.head,this.backward[this.head]=o,this.head=o,r?{evicted:!0,key:r,value:n}:null)};Vn.prototype.has=function(e){return e in this.items};Vn.prototype.get=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.splayOnTop(t),this.V[t]};Vn.prototype.peek=function(e){var t=this.items[e];if(!(typeof t>"u"))return this.V[t]};function Aa(){let e=new Vn(2e3);return e.delete=t=>{},e}function bg(e){return!!e}function wg(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Ml(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function yg(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");wg(e.outputLen),wg(e.blockLen)}function ui(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function vg(e,t){Ml(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var Ta=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var _g=e=>e instanceof Uint8Array;var $a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Bn=(e,t)=>e<<32-t|e>>>t,B2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!B2)throw new Error("Non little-endian hardware is not supported");function L2(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function os(e){if(typeof e=="string"&&(e=L2(e)),!_g(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Eg(...e){let t=new Uint8Array(e.reduce((r,o)=>r+o.length,0)),n=0;return e.forEach(r=>{if(!_g(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}var li=class{clone(){return this._cloneInto()}},qA={}.toString;function xg(e){let t=r=>e().update(os(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Ba(e=32){if(Ta&&typeof Ta.getRandomValues=="function")return Ta.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function C2(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),u=Number(n&i),d=r?4:0,h=r?0:4;e.setUint32(t+d,a,r),e.setUint32(t+h,u,r)}var La=class extends li{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=$a(this.buffer)}update(t){ui(this);let{view:n,buffer:r,blockLen:o}=this;t=os(t);let i=t.length;for(let a=0;a<i;){let u=Math.min(o-this.pos,i-a);if(u===o){let d=$a(t);for(;o<=i-a;a+=o)this.process(d,a);continue}r.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ui(this),vg(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:i}=this,{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let b=a;b<o;b++)n[b]=0;C2(r,o-8,BigInt(this.length*8),i),this.process(r,0);let u=$a(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=d/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let b=0;b<h;b++)u.setUint32(4*b,m[b],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:r,length:o,finished:i,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=i,t.destroyed=a,o%n&&t.buffer.set(r),t}};var P2=(e,t,n)=>e&t^~e&n,I2=(e,t,n)=>e&t^e&n^t&n,N2=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Kr=new Uint32Array(64),Dl=class extends La{constructor(){super(64,32,8,!1),this.A=Qr[0]|0,this.B=Qr[1]|0,this.C=Qr[2]|0,this.D=Qr[3]|0,this.E=Qr[4]|0,this.F=Qr[5]|0,this.G=Qr[6]|0,this.H=Qr[7]|0}get(){let{A:t,B:n,C:r,D:o,E:i,F:a,G:u,H:d}=this;return[t,n,r,o,i,a,u,d]}set(t,n,r,o,i,a,u,d){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=u|0,this.H=d|0}process(t,n){for(let b=0;b<16;b++,n+=4)Kr[b]=t.getUint32(n,!1);for(let b=16;b<64;b++){let _=Kr[b-15],T=Kr[b-2],A=Bn(_,7)^Bn(_,18)^_>>>3,k=Bn(T,17)^Bn(T,19)^T>>>10;Kr[b]=k+Kr[b-7]+A+Kr[b-16]|0}let{A:r,B:o,C:i,D:a,E:u,F:d,G:h,H:m}=this;for(let b=0;b<64;b++){let _=Bn(u,6)^Bn(u,11)^Bn(u,25),T=m+_+P2(u,d,h)+N2[b]+Kr[b]|0,k=(Bn(r,2)^Bn(r,13)^Bn(r,22))+I2(r,o,i)|0;m=h,h=d,d=u,u=a+T|0,a=i,i=o,o=r,r=T+k|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,d=d+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(r,o,i,a,u,d,h,m)}roundClean(){Kr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Ca=xg(()=>new Dl);var Vl={};U_(Vl,{bitGet:()=>F2,bitLen:()=>D2,bitMask:()=>is,bitSet:()=>j2,bytesToHex:()=>Io,bytesToNumberBE:()=>Rt,bytesToNumberLE:()=>Na,concatBytes:()=>hr,createHmacDrbg:()=>Hl,ensureBytes:()=>kt,equalBytes:()=>z2,hexToBytes:()=>No,hexToNumber:()=>jl,numberToBytesBE:()=>Ln,numberToBytesLE:()=>Oa,numberToHexUnpadded:()=>Ag,numberToVarBytesBE:()=>U2,utf8ToBytes:()=>M2,validateObject:()=>Gr});var Sg=BigInt(0),Pa=BigInt(1),O2=BigInt(2),Ia=e=>e instanceof Uint8Array,R2=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Io(e){if(!Ia(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=R2[e[n]];return t}function Ag(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function jl(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function No(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){let o=r*2,i=e.slice(o,o+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[r]=a}return n}function Rt(e){return jl(Io(e))}function Na(e){if(!Ia(e))throw new Error("Uint8Array expected");return jl(Io(Uint8Array.from(e).reverse()))}function Ln(e,t){return No(e.toString(16).padStart(t*2,"0"))}function Oa(e,t){return Ln(e,t).reverse()}function U2(e){return No(Ag(e))}function kt(e,t,n){let r;if(typeof t=="string")try{r=No(t)}catch(i){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${i}`)}else if(Ia(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);let o=r.length;if(typeof n=="number"&&o!==n)throw new Error(`${e} expected ${n} bytes, got ${o}`);return r}function hr(...e){let t=new Uint8Array(e.reduce((r,o)=>r+o.length,0)),n=0;return e.forEach(r=>{if(!Ia(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function z2(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function M2(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function D2(e){let t;for(t=0;e>Sg;e>>=Pa,t+=1);return t}function F2(e,t){return e>>BigInt(t)&Pa}var j2=(e,t,n)=>e|(n?Pa:Sg)<<BigInt(t),is=e=>(O2<<BigInt(e-1))-Pa,Fl=e=>new Uint8Array(e),kg=e=>Uint8Array.from(e);function Hl(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Fl(e),o=Fl(e),i=0,a=()=>{r.fill(1),o.fill(0),i=0},u=(...b)=>n(o,r,...b),d=(b=Fl())=>{o=u(kg([0]),b),r=u(),b.length!==0&&(o=u(kg([1]),b),r=u())},h=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let b=0,_=[];for(;b<t;){r=u();let T=r.slice();_.push(T),b+=r.length}return hr(..._)};return(b,_)=>{a(),d(b);let T;for(;!(T=_(h()));)d();return a(),T}}var H2={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Gr(e,t,n={}){let r=(o,i,a)=>{let u=H2[i];if(typeof u!="function")throw new Error(`Invalid validator "${i}", expected function`);let d=e[o];if(!(a&&d===void 0)&&!u(d,e))throw new Error(`Invalid param ${String(o)}=${d} (${typeof d}), expected ${i}`)};for(let[o,i]of Object.entries(t))r(o,i,!1);for(let[o,i]of Object.entries(n))r(o,i,!0);return e}var At=BigInt(0),ut=BigInt(1),Oo=BigInt(2),V2=BigInt(3),ql=BigInt(4),Tg=BigInt(5),$g=BigInt(8),q2=BigInt(9),W2=BigInt(16);function St(e,t){let n=e%t;return n>=At?n:t+n}function Q2(e,t,n){if(n<=At||t<At)throw new Error("Expected power/modulo > 0");if(n===ut)return At;let r=ut;for(;t>At;)t&ut&&(r=r*e%n),e=e*e%n,t>>=ut;return r}function cn(e,t,n){let r=e;for(;t-- >At;)r*=r,r%=n;return r}function Ra(e,t){if(e===At||t<=At)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=St(e,t),r=t,o=At,i=ut,a=ut,u=At;for(;n!==At;){let h=r/n,m=r%n,b=o-a*h,_=i-u*h;r=n,n=m,o=a,i=u,a=b,u=_}if(r!==ut)throw new Error("invert: does not exist");return St(o,t)}function K2(e){let t=(e-ut)/Oo,n,r,o;for(n=e-ut,r=0;n%Oo===At;n/=Oo,r++);for(o=Oo;o<e&&Q2(o,t,e)!==e-ut;o++);if(r===1){let a=(e+ut)/ql;return function(d,h){let m=d.pow(h,a);if(!d.eql(d.sqr(m),h))throw new Error("Cannot find square root");return m}}let i=(n+ut)/Oo;return function(u,d){if(u.pow(d,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let h=r,m=u.pow(u.mul(u.ONE,o),n),b=u.pow(d,i),_=u.pow(d,n);for(;!u.eql(_,u.ONE);){if(u.eql(_,u.ZERO))return u.ZERO;let T=1;for(let k=u.sqr(_);T<h&&!u.eql(k,u.ONE);T++)k=u.sqr(k);let A=u.pow(m,ut<<BigInt(h-T-1));m=u.sqr(A),b=u.mul(b,A),_=u.mul(_,m),h=T}return b}}function G2(e){if(e%ql===V2){let t=(e+ut)/ql;return function(r,o){let i=r.pow(o,t);if(!r.eql(r.sqr(i),o))throw new Error("Cannot find square root");return i}}if(e%$g===Tg){let t=(e-Tg)/$g;return function(r,o){let i=r.mul(o,Oo),a=r.pow(i,t),u=r.mul(o,a),d=r.mul(r.mul(u,Oo),a),h=r.mul(u,r.sub(d,r.ONE));if(!r.eql(r.sqr(h),o))throw new Error("Cannot find square root");return h}}return e%W2,K2(e)}var Z2=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Wl(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Z2.reduce((r,o)=>(r[o]="function",r),t);return Gr(e,n)}function Y2(e,t,n){if(n<At)throw new Error("Expected power > 0");if(n===At)return e.ONE;if(n===ut)return t;let r=e.ONE,o=t;for(;n>At;)n&ut&&(r=e.mul(r,o)),o=e.sqr(o),n>>=ut;return r}function J2(e,t){let n=new Array(t.length),r=t.reduce((i,a,u)=>e.is0(a)?i:(n[u]=i,e.mul(i,a)),e.ONE),o=e.inv(r);return t.reduceRight((i,a,u)=>e.is0(a)?i:(n[u]=e.mul(i,n[u]),e.mul(i,a)),o),n}function Ql(e,t){let n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Bg(e,t,n=!1,r={}){if(e<=At)throw new Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:o,nByteLength:i}=Ql(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=G2(e),u=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:is(o),ZERO:At,ONE:ut,create:d=>St(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return At<=d&&d<e},is0:d=>d===At,isOdd:d=>(d&ut)===ut,neg:d=>St(-d,e),eql:(d,h)=>d===h,sqr:d=>St(d*d,e),add:(d,h)=>St(d+h,e),sub:(d,h)=>St(d-h,e),mul:(d,h)=>St(d*h,e),pow:(d,h)=>Y2(u,d,h),div:(d,h)=>St(d*Ra(h,e),e),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>Ra(d,e),sqrt:r.sqrt||(d=>a(u,d)),invertBatch:d=>J2(u,d),cmov:(d,h,m)=>m?h:d,toBytes:d=>n?Oa(d,i):Ln(d,i),fromBytes:d=>{if(d.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${d.length}`);return n?Na(d):Rt(d)}});return Object.freeze(u)}function Lg(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function Kl(e){let t=Lg(e);return t+Math.ceil(t/2)}function Cg(e,t,n=!1){let r=e.length,o=Lg(t),i=Kl(t);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);let a=n?Rt(e):Na(e),u=St(a,t-ut)+ut;return n?Oa(u,o):Ln(u,o)}var e3=BigInt(0),Gl=BigInt(1);function Pg(e,t){let n=(o,i)=>{let a=i.negate();return o?a:i},r=o=>{let i=Math.ceil(t/o)+1,a=2**(o-1);return{windows:i,windowSize:a}};return{constTimeNegate:n,unsafeLadder(o,i){let a=e.ZERO,u=o;for(;i>e3;)i&Gl&&(a=a.add(u)),u=u.double(),i>>=Gl;return a},precomputeWindow(o,i){let{windows:a,windowSize:u}=r(i),d=[],h=o,m=h;for(let b=0;b<a;b++){m=h,d.push(m);for(let _=1;_<u;_++)m=m.add(h),d.push(m);h=m.double()}return d},wNAF(o,i,a){let{windows:u,windowSize:d}=r(o),h=e.ZERO,m=e.BASE,b=BigInt(2**o-1),_=2**o,T=BigInt(o);for(let A=0;A<u;A++){let k=A*d,I=Number(a&b);a>>=T,I>d&&(I-=_,a+=Gl);let O=k,L=k+Math.abs(I)-1,f=A%2!==0,p=I<0;I===0?m=m.add(n(f,i[O])):h=h.add(n(p,i[L]))}return{p:h,f:m}},wNAFCached(o,i,a,u){let d=o._WINDOW_SIZE||1,h=i.get(o);return h||(h=this.precomputeWindow(o,d),d!==1&&i.set(o,u(h))),this.wNAF(d,h,a)}}}function Zl(e){return Wl(e.Fp),Gr(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ql(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function t3(e){let t=Zl(e);Gr(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:n3,hexToBytes:r3}=Vl,Ro={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){let{Err:t}=Ro;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");let n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:n3(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=Ro,n=typeof e=="string"?r3(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");let{d:o,l:i}=Ro._parseInt(n.subarray(2)),{d:a,l:u}=Ro._parseInt(i);if(u.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,n=h=>{let m=h.toString(16);return m.length&1?`0${m}`:m},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,a=o.length/2,u=n(i),d=n(a);return`30${n(a+i+4)}02${d}${o}02${u}${r}`}},pr=BigInt(0),pn=BigInt(1),s7=BigInt(2),Ig=BigInt(3),a7=BigInt(4);function o3(e){let t=t3(e),{Fp:n}=t,r=t.toBytes||((A,k,I)=>{let O=k.toAffine();return hr(Uint8Array.from([4]),n.toBytes(O.x),n.toBytes(O.y))}),o=t.fromBytes||(A=>{let k=A.subarray(1),I=n.fromBytes(k.subarray(0,n.BYTES)),O=n.fromBytes(k.subarray(n.BYTES,2*n.BYTES));return{x:I,y:O}});function i(A){let{a:k,b:I}=t,O=n.sqr(A),L=n.mul(O,A);return n.add(n.add(L,n.mul(A,k)),I)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(A){return typeof A=="bigint"&&pr<A&&A<t.n}function u(A){if(!a(A))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function d(A){let{allowedPrivateKeyLengths:k,nByteLength:I,wrapPrivateKey:O,n:L}=t;if(k&&typeof A!="bigint"){if(A instanceof Uint8Array&&(A=Io(A)),typeof A!="string"||!k.includes(A.length))throw new Error("Invalid key");A=A.padStart(I*2,"0")}let f;try{f=typeof A=="bigint"?A:Rt(kt("private key",A,I))}catch{throw new Error(`private key must be ${I} bytes, hex or bigint, not ${typeof A}`)}return O&&(f=St(f,L)),u(f),f}let h=new Map;function m(A){if(!(A instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(k,I,O){if(this.px=k,this.py=I,this.pz=O,k==null||!n.isValid(k))throw new Error("x required");if(I==null||!n.isValid(I))throw new Error("y required");if(O==null||!n.isValid(O))throw new Error("z required")}static fromAffine(k){let{x:I,y:O}=k||{};if(!k||!n.isValid(I)||!n.isValid(O))throw new Error("invalid affine point");if(k instanceof b)throw new Error("projective point not allowed");let L=f=>n.eql(f,n.ZERO);return L(I)&&L(O)?b.ZERO:new b(I,O,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(k){let I=n.invertBatch(k.map(O=>O.pz));return k.map((O,L)=>O.toAffine(I[L])).map(b.fromAffine)}static fromHex(k){let I=b.fromAffine(o(kt("pointHex",k)));return I.assertValidity(),I}static fromPrivateKey(k){return b.BASE.multiply(d(k))}_setWindowSize(k){this._WINDOW_SIZE=k,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:k,y:I}=this.toAffine();if(!n.isValid(k)||!n.isValid(I))throw new Error("bad point: x or y not FE");let O=n.sqr(I),L=i(k);if(!n.eql(O,L))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:k}=this.toAffine();if(n.isOdd)return!n.isOdd(k);throw new Error("Field doesn't support isOdd")}equals(k){m(k);let{px:I,py:O,pz:L}=this,{px:f,py:p,pz:w}=k,v=n.eql(n.mul(I,w),n.mul(f,L)),S=n.eql(n.mul(O,w),n.mul(p,L));return v&&S}negate(){return new b(this.px,n.neg(this.py),this.pz)}double(){let{a:k,b:I}=t,O=n.mul(I,Ig),{px:L,py:f,pz:p}=this,w=n.ZERO,v=n.ZERO,S=n.ZERO,$=n.mul(L,L),P=n.mul(f,f),M=n.mul(p,p),N=n.mul(L,f);return N=n.add(N,N),S=n.mul(L,p),S=n.add(S,S),w=n.mul(k,S),v=n.mul(O,M),v=n.add(w,v),w=n.sub(P,v),v=n.add(P,v),v=n.mul(w,v),w=n.mul(N,w),S=n.mul(O,S),M=n.mul(k,M),N=n.sub($,M),N=n.mul(k,N),N=n.add(N,S),S=n.add($,$),$=n.add(S,$),$=n.add($,M),$=n.mul($,N),v=n.add(v,$),M=n.mul(f,p),M=n.add(M,M),$=n.mul(M,N),w=n.sub(w,$),S=n.mul(M,P),S=n.add(S,S),S=n.add(S,S),new b(w,v,S)}add(k){m(k);let{px:I,py:O,pz:L}=this,{px:f,py:p,pz:w}=k,v=n.ZERO,S=n.ZERO,$=n.ZERO,P=t.a,M=n.mul(t.b,Ig),N=n.mul(I,f),B=n.mul(O,p),F=n.mul(L,w),q=n.add(I,O),x=n.add(f,p);q=n.mul(q,x),x=n.add(N,B),q=n.sub(q,x),x=n.add(I,L);let z=n.add(f,w);return x=n.mul(x,z),z=n.add(N,F),x=n.sub(x,z),z=n.add(O,L),v=n.add(p,w),z=n.mul(z,v),v=n.add(B,F),z=n.sub(z,v),$=n.mul(P,x),v=n.mul(M,F),$=n.add(v,$),v=n.sub(B,$),$=n.add(B,$),S=n.mul(v,$),B=n.add(N,N),B=n.add(B,N),F=n.mul(P,F),x=n.mul(M,x),B=n.add(B,F),F=n.sub(N,F),F=n.mul(P,F),x=n.add(x,F),N=n.mul(B,x),S=n.add(S,N),N=n.mul(z,x),v=n.mul(q,v),v=n.sub(v,N),N=n.mul(q,B),$=n.mul(z,$),$=n.add($,N),new b(v,S,$)}subtract(k){return this.add(k.negate())}is0(){return this.equals(b.ZERO)}wNAF(k){return T.wNAFCached(this,h,k,I=>{let O=n.invertBatch(I.map(L=>L.pz));return I.map((L,f)=>L.toAffine(O[f])).map(b.fromAffine)})}multiplyUnsafe(k){let I=b.ZERO;if(k===pr)return I;if(u(k),k===pn)return this;let{endo:O}=t;if(!O)return T.unsafeLadder(this,k);let{k1neg:L,k1:f,k2neg:p,k2:w}=O.splitScalar(k),v=I,S=I,$=this;for(;f>pr||w>pr;)f&pn&&(v=v.add($)),w&pn&&(S=S.add($)),$=$.double(),f>>=pn,w>>=pn;return L&&(v=v.negate()),p&&(S=S.negate()),S=new b(n.mul(S.px,O.beta),S.py,S.pz),v.add(S)}multiply(k){u(k);let I=k,O,L,{endo:f}=t;if(f){let{k1neg:p,k1:w,k2neg:v,k2:S}=f.splitScalar(I),{p:$,f:P}=this.wNAF(w),{p:M,f:N}=this.wNAF(S);$=T.constTimeNegate(p,$),M=T.constTimeNegate(v,M),M=new b(n.mul(M.px,f.beta),M.py,M.pz),O=$.add(M),L=P.add(N)}else{let{p,f:w}=this.wNAF(I);O=p,L=w}return b.normalizeZ([O,L])[0]}multiplyAndAddUnsafe(k,I,O){let L=b.BASE,f=(w,v)=>v===pr||v===pn||!w.equals(L)?w.multiplyUnsafe(v):w.multiply(v),p=f(this,I).add(f(k,O));return p.is0()?void 0:p}toAffine(k){let{px:I,py:O,pz:L}=this,f=this.is0();k==null&&(k=f?n.ONE:n.inv(L));let p=n.mul(I,k),w=n.mul(O,k),v=n.mul(L,k);if(f)return{x:n.ZERO,y:n.ZERO};if(!n.eql(v,n.ONE))throw new Error("invZ was invalid");return{x:p,y:w}}isTorsionFree(){let{h:k,isTorsionFree:I}=t;if(k===pn)return!0;if(I)return I(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:k,clearCofactor:I}=t;return k===pn?this:I?I(b,this):this.multiplyUnsafe(t.h)}toRawBytes(k=!0){return this.assertValidity(),r(b,this,k)}toHex(k=!0){return Io(this.toRawBytes(k))}}b.BASE=new b(t.Gx,t.Gy,n.ONE),b.ZERO=new b(n.ZERO,n.ONE,n.ZERO);let _=t.nBitLength,T=Pg(b,t.endo?Math.ceil(_/2):_);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:a}}function i3(e){let t=Zl(e);return Gr(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Ng(e){let t=i3(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(x){return pr<x&&x<n.ORDER}function u(x){return St(x,r)}function d(x){return Ra(x,r)}let{ProjectivePoint:h,normPrivateKeyToScalar:m,weierstrassEquation:b,isWithinCurveOrder:_}=o3({...t,toBytes(x,z,V){let K=z.toAffine(),Z=n.toBytes(K.x),W=hr;return V?W(Uint8Array.from([z.hasEvenY()?2:3]),Z):W(Uint8Array.from([4]),Z,n.toBytes(K.y))},fromBytes(x){let z=x.length,V=x[0],K=x.subarray(1);if(z===o&&(V===2||V===3)){let Z=Rt(K);if(!a(Z))throw new Error("Point is not on curve");let W=b(Z),J=n.sqrt(W),de=(J&pn)===pn;return(V&1)===1!==de&&(J=n.neg(J)),{x:Z,y:J}}else if(z===i&&V===4){let Z=n.fromBytes(K.subarray(0,n.BYTES)),W=n.fromBytes(K.subarray(n.BYTES,2*n.BYTES));return{x:Z,y:W}}else throw new Error(`Point of length ${z} was invalid. Expected ${o} compressed bytes or ${i} uncompressed bytes`)}}),T=x=>Io(Ln(x,t.nByteLength));function A(x){let z=r>>pn;return x>z}function k(x){return A(x)?u(-x):x}let I=(x,z,V)=>Rt(x.slice(z,V));class O{constructor(z,V,K){this.r=z,this.s=V,this.recovery=K,this.assertValidity()}static fromCompact(z){let V=t.nByteLength;return z=kt("compactSignature",z,V*2),new O(I(z,0,V),I(z,V,2*V))}static fromDER(z){let{r:V,s:K}=Ro.toSig(kt("DER",z));return new O(V,K)}assertValidity(){if(!_(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!_(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(z){return new O(this.r,this.s,z)}recoverPublicKey(z){let{r:V,s:K,recovery:Z}=this,W=S(kt("msgHash",z));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");let J=Z===2||Z===3?V+t.n:V;if(J>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");let de=(Z&1)===0?"02":"03",_e=h.fromHex(de+T(J)),ve=d(J),Pe=u(-W*ve),ie=u(K*ve),Se=h.BASE.multiplyAndAddUnsafe(_e,Pe,ie);if(!Se)throw new Error("point at infinify");return Se.assertValidity(),Se}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new O(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return No(this.toDERHex())}toDERHex(){return Ro.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return No(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}let L={isValidPrivateKey(x){try{return m(x),!0}catch{return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{let x=Kl(t.n);return Cg(t.randomBytes(x),t.n)},precompute(x=8,z=h.BASE){return z._setWindowSize(x),z.multiply(BigInt(3)),z}};function f(x,z=!0){return h.fromPrivateKey(x).toRawBytes(z)}function p(x){let z=x instanceof Uint8Array,V=typeof x=="string",K=(z||V)&&x.length;return z?K===o||K===i:V?K===2*o||K===2*i:x instanceof h}function w(x,z,V=!0){if(p(x))throw new Error("first arg must be private key");if(!p(z))throw new Error("second arg must be public key");return h.fromHex(z).multiply(m(x)).toRawBytes(V)}let v=t.bits2int||function(x){let z=Rt(x),V=x.length*8-t.nBitLength;return V>0?z>>BigInt(V):z},S=t.bits2int_modN||function(x){return u(v(x))},$=is(t.nBitLength);function P(x){if(typeof x!="bigint")throw new Error("bigint expected");if(!(pr<=x&&x<$))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Ln(x,t.nByteLength)}function M(x,z,V=N){if(["recovered","canonical"].some(Re=>Re in V))throw new Error("sign() legacy options not supported");let{hash:K,randomBytes:Z}=t,{lowS:W,prehash:J,extraEntropy:de}=V;W==null&&(W=!0),x=kt("msgHash",x),J&&(x=kt("prehashed msgHash",K(x)));let _e=S(x),ve=m(z),Pe=[P(ve),P(_e)];if(de!=null){let Re=de===!0?Z(n.BYTES):de;Pe.push(kt("extraEntropy",Re))}let ie=hr(...Pe),Se=_e;function Ve(Re){let je=v(Re);if(!_(je))return;let Et=d(je),Qe=h.BASE.multiply(je).toAffine(),he=u(Qe.x);if(he===pr)return;let Me=u(Et*u(Se+he*ve));if(Me===pr)return;let Ce=(Qe.x===he?0:2)|Number(Qe.y&pn),Ie=Me;return W&&A(Me)&&(Ie=k(Me),Ce^=1),new O(he,Ie,Ce)}return{seed:ie,k2sig:Ve}}let N={lowS:t.lowS,prehash:!1},B={lowS:t.lowS,prehash:!1};function F(x,z,V=N){let{seed:K,k2sig:Z}=M(x,z,V),W=t;return Hl(W.hash.outputLen,W.nByteLength,W.hmac)(K,Z)}h.BASE._setWindowSize(8);function q(x,z,V,K=B){let Z=x;if(z=kt("msgHash",z),V=kt("publicKey",V),"strict"in K)throw new Error("options.strict was renamed to lowS");let{lowS:W,prehash:J}=K,de,_e;try{if(typeof Z=="string"||Z instanceof Uint8Array)try{de=O.fromDER(Z)}catch(Qe){if(!(Qe instanceof Ro.Err))throw Qe;de=O.fromCompact(Z)}else if(typeof Z=="object"&&typeof Z.r=="bigint"&&typeof Z.s=="bigint"){let{r:Qe,s:he}=Z;de=new O(Qe,he)}else throw new Error("PARSE");_e=h.fromHex(V)}catch(Qe){if(Qe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(W&&de.hasHighS())return!1;J&&(z=t.hash(z));let{r:ve,s:Pe}=de,ie=S(z),Se=d(Pe),Ve=u(ie*Se),Re=u(ve*Se),je=h.BASE.multiplyAndAddUnsafe(_e,Ve,Re)?.toAffine();return je?u(je.x)===ve:!1}return{CURVE:t,getPublicKey:f,getSharedSecret:w,sign:F,verify:q,ProjectivePoint:h,Signature:O,utils:L}}var Ua=class extends li{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,yg(t);let r=os(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let a=0;a<i.length;a++)i[a]^=54;this.iHash.update(i),this.oHash=t.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),i.fill(0)}update(t){return ui(this),this.iHash.update(t),this}digestInto(t){ui(this),Ml(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:n,iHash:r,finished:o,destroyed:i,blockLen:a,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=i,t.blockLen=a,t.outputLen=u,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Yl=(e,t,n)=>new Ua(e,t).update(n).digest();Yl.create=(e,t)=>new Ua(e,t);function s3(e){return{hash:e,hmac:(t,...n)=>Yl(e,t,Eg(...n)),randomBytes:Ba}}function Og(e,t){let n=r=>Ng({...e,...s3(r)});return Object.freeze({...n(t),create:n})}var Fa=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),za=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),zg=BigInt(1),Ma=BigInt(2),Rg=(e,t)=>(e+t/Ma)/t;function Mg(e){let t=Fa,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),u=BigInt(44),d=BigInt(88),h=e*e*e%t,m=h*h*e%t,b=cn(m,n,t)*m%t,_=cn(b,n,t)*m%t,T=cn(_,Ma,t)*h%t,A=cn(T,o,t)*T%t,k=cn(A,i,t)*A%t,I=cn(k,u,t)*k%t,O=cn(I,d,t)*I%t,L=cn(O,u,t)*k%t,f=cn(L,n,t)*m%t,p=cn(f,a,t)*A%t,w=cn(p,r,t)*h%t,v=cn(w,Ma,t);if(!Xl.eql(Xl.sqr(v),e))throw new Error("Cannot find square root");return v}var Xl=Bg(Fa,void 0,void 0,{sqrt:Mg}),nd=Og({a:BigInt(0),b:BigInt(7),Fp:Xl,n:za,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=za,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-zg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),u=Rg(i*e,t),d=Rg(-r*e,t),h=St(e-u*n-d*o,t),m=St(-u*r-d*i,t),b=h>a,_=m>a;if(b&&(h=t-h),_&&(m=t-m),h>a||m>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:b,k1:h,k2neg:_,k2:m}}}},Ca),ja=BigInt(0),Dg=e=>typeof e=="bigint"&&ja<e&&e<Fa,a3=e=>typeof e=="bigint"&&ja<e&&e<za,Ug={};function Da(e,...t){let n=Ug[e];if(n===void 0){let r=Ca(Uint8Array.from(e,o=>o.charCodeAt(0)));n=hr(r,r),Ug[e]=n}return Ca(hr(n,...t))}var rd=e=>e.toRawBytes(!0).slice(1),ed=e=>Ln(e,32),Jl=e=>St(e,Fa),ss=e=>St(e,za),od=nd.ProjectivePoint,c3=(e,t,n)=>od.BASE.multiplyAndAddUnsafe(e,t,n);function td(e){let t=nd.utils.normPrivateKeyToScalar(e),n=od.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:ss(-t),bytes:rd(n)}}function Fg(e){if(!Dg(e))throw new Error("bad x: need 0 < x < p");let t=Jl(e*e),n=Jl(t*e+BigInt(7)),r=Mg(n);r%Ma!==ja&&(r=Jl(-r));let o=new od(e,r,zg);return o.assertValidity(),o}function jg(...e){return ss(Rt(Da("BIP0340/challenge",...e)))}function u3(e){return td(e).bytes}function l3(e,t,n=Ba(32)){let r=kt("message",e),{bytes:o,scalar:i}=td(t),a=kt("auxRand",n,32),u=ed(i^Rt(Da("BIP0340/aux",a))),d=Da("BIP0340/nonce",u,o,r),h=ss(Rt(d));if(h===ja)throw new Error("sign failed: k is zero");let{bytes:m,scalar:b}=td(h),_=jg(m,o,r),T=new Uint8Array(64);if(T.set(m,0),T.set(ed(ss(b+_*i)),32),!Hg(T,r,o))throw new Error("sign: Invalid signature produced");return T}function Hg(e,t,n){let r=kt("signature",e,64),o=kt("message",t),i=kt("publicKey",n,32);try{let a=Fg(Rt(i)),u=Rt(r.subarray(0,32));if(!Dg(u))return!1;let d=Rt(r.subarray(32,64));if(!a3(d))return!1;let h=jg(ed(u),rd(a),o),m=c3(a,d,ss(-h));return!(!m||!m.hasEvenY()||m.toAffine().x!==u)}catch{return!1}}var gn={getPublicKey:u3,sign:l3,verify:Hg,utils:{randomPrivateKey:nd.utils.randomPrivateKey,lift_x:Fg,pointToBytes:rd,numberToBytesBE:Ln,bytesToNumberBE:Rt,taggedHash:Da,mod:St}};var gr=Symbol("verified"),d3=e=>e instanceof Object;function id(e){if(!d3(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let r=0;r<n.length;r++)if(typeof n[r]=="object")return!1}return!0}function sd(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function f3(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function Vg(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function h3(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");sd(e.outputLen),sd(e.blockLen)}function p3(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function g3(e,t){Vg(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var m3={number:sd,bool:f3,bytes:Vg,hash:h3,exists:p3,output:g3},Ha=m3;function b3(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),u=Number(n&i),d=r?4:0,h=r?0:4;e.setUint32(t+d,a,r),e.setUint32(t+h,u,r)}var Va=class extends ya{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=va(this.buffer)}update(t){Ha.exists(this);let{view:n,buffer:r,blockLen:o}=this;t=$l(t);let i=t.length;for(let a=0;a<i;){let u=Math.min(o-this.pos,i-a);if(u===o){let d=va(t);for(;o<=i-a;a+=o)this.process(d,a);continue}r.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Ha.exists(this),Ha.output(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:i}=this,{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let b=a;b<o;b++)n[b]=0;b3(r,o-8,BigInt(this.length*8),i),this.process(r,0);let u=va(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=d/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let b=0;b<h;b++)u.setUint32(4*b,m[b],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:r,length:o,finished:i,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=i,t.destroyed=a,o%n&&t.buffer.set(r),t}};var w3=(e,t,n)=>e&t^~e&n,y3=(e,t,n)=>e&t^e&n^t&n,v3=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Yr=new Uint32Array(64),qa=class extends Va{constructor(){super(64,32,8,!1),this.A=Zr[0]|0,this.B=Zr[1]|0,this.C=Zr[2]|0,this.D=Zr[3]|0,this.E=Zr[4]|0,this.F=Zr[5]|0,this.G=Zr[6]|0,this.H=Zr[7]|0}get(){let{A:t,B:n,C:r,D:o,E:i,F:a,G:u,H:d}=this;return[t,n,r,o,i,a,u,d]}set(t,n,r,o,i,a,u,d){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=u|0,this.H=d|0}process(t,n){for(let b=0;b<16;b++,n+=4)Yr[b]=t.getUint32(n,!1);for(let b=16;b<64;b++){let _=Yr[b-15],T=Yr[b-2],A=$n(_,7)^$n(_,18)^_>>>3,k=$n(T,17)^$n(T,19)^T>>>10;Yr[b]=k+Yr[b-7]+A+Yr[b-16]|0}let{A:r,B:o,C:i,D:a,E:u,F:d,G:h,H:m}=this;for(let b=0;b<64;b++){let _=$n(u,6)^$n(u,11)^$n(u,25),T=m+_+w3(u,d,h)+v3[b]+Yr[b]|0,k=($n(r,2)^$n(r,13)^$n(r,22))+y3(r,o,i)|0;m=h,h=d,d=u,u=a+T|0,a=i,i=o,o=r,r=T+k|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,d=d+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(r,o,i,a,u,d,h,m)}roundClean(){Yr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},ad=class extends qa{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},Wa=Ll(()=>new qa),B7=Ll(()=>new ad);var ud=class{generateSecretKey(){return gn.utils.randomPrivateKey()}getPublicKey(t){return xt(gn.getPublicKey(t))}finalizeEvent(t,n){let r=t;return r.pubkey=xt(gn.getPublicKey(n)),r.id=cd(r),r.sig=xt(gn.sign(cd(r),n)),r[gr]=!0,r}verifyEvent(t){if(typeof t[gr]=="boolean")return t[gr];let n=cd(t);if(n!==t.id)return t[gr]=!1,!1;try{let r=gn.verify(t.sig,n,t.pubkey);return t[gr]=r,r}catch{return t[gr]=!1,!1}}};function _3(e){if(!id(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function cd(e){let t=Wa(Rl.encode(_3(e)));return xt(t)}var Qa=new ud,R7=Qa.generateSecretKey,U7=Qa.getPublicKey,z7=Qa.finalizeEvent,qg=Qa.verifyEvent;var Wg=22242;function E3(e,t){if(e.ids&&e.ids.indexOf(t.id)===-1||e.kinds&&e.kinds.indexOf(t.kind)===-1||e.authors&&e.authors.indexOf(t.pubkey)===-1)return!1;for(let n in e)if(n[0]==="#"){let r=n.slice(1),o=e[`#${r}`];if(o&&!t.tags.find(([i,a])=>i===n.slice(1)&&o.indexOf(a)!==-1))return!1}return!(e.since&&t.created_at<e.since||e.until&&t.created_at>e.until)}function Qg(e,t){for(let n=0;n<e.length;n++)if(E3(e[n],t))return!0;return!1}function Kg(e,t){let n=t.length+3,r=e.indexOf(`"${t}":`)+n,o=e.slice(r).indexOf('"')+r+1;return e.slice(o,o+64)}function Gg(e){let t=e.slice(0,22).indexOf('"EVENT"');if(t===-1)return null;let n=e.slice(t+7+1).indexOf('"');if(n===-1)return null;let r=t+7+1+n,o=e.slice(r+1,80).indexOf('"');if(o===-1)return null;let i=r+1+o;return e.slice(r+1,i)}function Zg(e,t){return{kind:Wg,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}async function Yg(){return new Promise(e=>{let t=new MessageChannel,n=()=>{t.port1.removeEventListener("message",n),e()};t.port1.addEventListener("message",n),t.port2.postMessage(0),t.port1.start()})}var Jg=e=>(e[gr]=!0,!0);var Ka=class e{url;_connected=!1;onclose=null;onnotice=t=>console.debug(`NOTICE from ${this.url}: ${t}`);_onauth=null;baseEoseTimeout=4400;connectionTimeout=4400;publishTimeout=4400;openSubs=new Map;connectionTimeoutHandle;connectionPromise;openCountRequests=new Map;openEventPublishes=new Map;ws;incomingMessageQueue=new xa;queueRunning=!1;challenge;authPromise;serial=0;verifyEvent;_WebSocket;constructor(t,n){this.url=Wr(t),this.verifyEvent=n.verifyEvent,this._WebSocket=n.websocketImplementation||WebSocket}static async connect(t,n){let r=new e(t,n);return await r.connect(),r}closeAllSubscriptions(t){for(let[n,r]of this.openSubs)r.close(t);this.openSubs.clear();for(let[n,r]of this.openEventPublishes)r.reject(new Error(t));this.openEventPublishes.clear();for(let[n,r]of this.openCountRequests)r.reject(new Error(t));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.authPromise=void 0,this.connectionPromise=new Promise((t,n)=>{this.connectionTimeoutHandle=setTimeout(()=>{n("connection timed out"),this.connectionPromise=void 0,this.onclose?.(),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new this._WebSocket(this.url)}catch(r){n(r);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,t()},this.ws.onerror=r=>{n(r.message||"websocket error"),this._connected&&(this._connected=!1,this.connectionPromise=void 0,this.onclose?.(),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{this._connected&&(this._connected=!1,this.connectionPromise=void 0,this.onclose?.(),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await Yg();this.queueRunning=!1}handleNext(){let t=this.incomingMessageQueue.dequeue();if(!t)return!1;let n=Gg(t);if(n){let r=this.openSubs.get(n);if(!r)return;let o=Kg(t,"id"),i=r.alreadyHaveEvent?.(o);if(r.receivedEvent?.(this,o),i)return}try{let r=JSON.parse(t);switch(r[0]){case"EVENT":{let o=this.openSubs.get(r[1]),i=r[2];this.verifyEvent(i)&&Qg(o.filters,i)&&o.onevent(i);return}case"COUNT":{let o=r[1],i=r[2],a=this.openCountRequests.get(o);a&&(a.resolve(i.count),this.openCountRequests.delete(o));return}case"EOSE":{let o=this.openSubs.get(r[1]);if(!o)return;o.receivedEose();return}case"OK":{let o=r[1],i=r[2],a=r[3],u=this.openEventPublishes.get(o);u&&(clearTimeout(u.timeout),i?u.resolve(a):u.reject(new Error(a)),this.openEventPublishes.delete(o));return}case"CLOSED":{let o=r[1],i=this.openSubs.get(o);if(!i)return;i.closed=!0,i.close(r[2]);return}case"NOTICE":this.onnotice(r[1]);return;case"AUTH":{this.challenge=r[1],this.authPromise=void 0,this._onauth?.(r[1]);return}}}catch{return}}async send(t){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{this.ws?.send(t)})}async auth(t){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");if(this.authPromise)return this.authPromise;let n=await t(Zg(this.url,this.challenge));return this.authPromise=new Promise((r,o)=>{let i=setTimeout(()=>{let a=this.openEventPublishes.get(n.id);a&&(a.reject(new Error("auth timed out")),this.openEventPublishes.delete(n.id))},this.publishTimeout);this.openEventPublishes.set(n.id,{resolve:r,reject:o,timeout:i})}),this.send('["AUTH",'+JSON.stringify(n)+"]"),this.authPromise}async publish(t){let n=new Promise((r,o)=>{let i=setTimeout(()=>{let a=this.openEventPublishes.get(t.id);a&&(a.reject(new Error("publish timed out")),this.openEventPublishes.delete(t.id))},this.publishTimeout);this.openEventPublishes.set(t.id,{resolve:r,reject:o,timeout:i})});return this.send('["EVENT",'+JSON.stringify(t)+"]"),n}async count(t,n){this.serial++;let r=n?.id||"count:"+this.serial,o=new Promise((i,a)=>{this.openCountRequests.set(r,{resolve:i,reject:a})});return this.send('["COUNT","'+r+'",'+JSON.stringify(t).substring(1)),o}subscribe(t,n){let r=this.prepareSubscription(t,n);return r.fire(),r}prepareSubscription(t,n){this.serial++;let r=n.id||(n.label?n.label+":":"sub:")+this.serial,o=new ld(this,r,t,n);return this.openSubs.set(r,o),o}close(){this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,this.ws?.close()}_onmessage(t){this.incomingMessageQueue.enqueue(t.data),this.queueRunning||this.runQueue()}},ld=class{relay;id;closed=!1;eosed=!1;filters;alreadyHaveEvent;receivedEvent;onevent;oneose;onclose;eoseTimeout;eoseTimeoutHandle;constructor(t,n,r,o){this.relay=t,this.filters=r,this.id=n,this.alreadyHaveEvent=o.alreadyHaveEvent,this.receivedEvent=o.receivedEvent,this.eoseTimeout=o.eoseTimeout||t.baseEoseTimeout,this.oneose=o.oneose,this.onclose=o.onclose,this.onevent=o.onevent||(i=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,i)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,this.oneose?.())}close(t="closed by caller"){!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),this.onclose?.(t)}};var Ga=class{relays=new Map;seenOn=new Map;trackRelays=!1;verifyEvent;trustedRelayURLs=new Set;_WebSocket;constructor(t){this.verifyEvent=t.verifyEvent,this._WebSocket=t.websocketImplementation}async ensureRelay(t,n){t=Wr(t);let r=this.relays.get(t);return r||(r=new Ka(t,{verifyEvent:this.trustedRelayURLs.has(t)?Jg:this.verifyEvent,websocketImplementation:this._WebSocket}),n?.connectionTimeout&&(r.connectionTimeout=n.connectionTimeout),this.relays.set(t,r)),await r.connect(),r}close(t){t.map(Wr).forEach(n=>{this.relays.get(n)?.close()})}subscribe(t,n,r){return this.subscribeMap(t.map(o=>({url:o,filter:n})),r)}subscribeMany(t,n,r){return this.subscribeMap(t.flatMap(o=>n.map(i=>({url:o,filter:i}))),r)}subscribeMap(t,n){this.trackRelays&&(n.receivedEvent=(b,_)=>{let T=this.seenOn.get(_);T||(T=new Set,this.seenOn.set(_,T)),T.add(b)});let r=new Set,o=[],i=[],a=b=>{i[b]||(i[b]=!0,i.filter(_=>_).length===t.length&&(n.oneose?.(),a=()=>{}))},u=[],d=(b,_)=>{u[b]||(a(b),u[b]=_,u.filter(T=>T).length===t.length&&(n.onclose?.(u),d=()=>{}))},h=b=>{if(n.alreadyHaveEvent?.(b))return!0;let _=r.has(b);return r.add(b),_},m=Promise.all(t.map(async({url:b,filter:_},T)=>{b=Wr(b);let A;try{A=await this.ensureRelay(b,{connectionTimeout:n.maxWait?Math.max(n.maxWait*.8,n.maxWait-1e3):void 0})}catch(I){d(T,I?.message||String(I));return}let k=A.subscribe([_],{...n,oneose:()=>a(T),onclose:I=>{I.startsWith("auth-required:")&&n.doauth?A.auth(n.doauth).then(()=>{A.subscribe([_],{...n,oneose:()=>a(T),onclose:O=>{d(T,O)},alreadyHaveEvent:h,eoseTimeout:n.maxWait})}).catch(O=>{d(T,`auth was required and attempted, but failed with: ${O}`)}):d(T,I)},alreadyHaveEvent:h,eoseTimeout:n.maxWait});o.push(k)}));return{async close(){await m,o.forEach(b=>{b.close()})}}}subscribeManyMap(t,n){this.trackRelays&&(n.receivedEvent=(_,T)=>{let A=this.seenOn.get(T);A||(A=new Set,this.seenOn.set(T,A)),A.add(_)});let r=new Set,o=[],i=Object.keys(t).length,a=[],u=_=>{a[_]||(a[_]=!0,a.filter(T=>T).length===i&&(n.oneose?.(),u=()=>{}))},d=[],h=(_,T)=>{d[_]||(u(_),d[_]=T,d.filter(A=>A).length===i&&(n.onclose?.(d),h=()=>{}))},m=_=>{if(n.alreadyHaveEvent?.(_))return!0;let T=r.has(_);return r.add(_),T},b=Promise.all(Object.entries(t).map(async(_,T,A)=>{if(A.indexOf(_)!==T){h(T,"duplicate url");return}let[k,I]=_;k=Wr(k);let O;try{O=await this.ensureRelay(k,{connectionTimeout:n.maxWait?Math.max(n.maxWait*.8,n.maxWait-1e3):void 0})}catch(f){h(T,f?.message||String(f));return}let L=O.subscribe(I,{...n,oneose:()=>u(T),onclose:f=>{f.startsWith("auth-required:")&&n.doauth?O.auth(n.doauth).then(()=>{O.subscribe(I,{...n,oneose:()=>u(T),onclose:p=>{h(T,p)},alreadyHaveEvent:m,eoseTimeout:n.maxWait})}).catch(p=>{h(T,`auth was required and attempted, but failed with: ${p}`)}):h(T,f)},alreadyHaveEvent:m,eoseTimeout:n.maxWait});o.push(L)}));return{async close(){await b,o.forEach(_=>{_.close()})}}}subscribeEose(t,n,r){let o=this.subscribe(t,n,{...r,oneose(){o.close()}});return o}subscribeManyEose(t,n,r){let o=this.subscribeMany(t,n,{...r,oneose(){o.close()}});return o}async querySync(t,n,r){return new Promise(async o=>{let i=[];this.subscribeEose(t,n,{...r,onevent(a){i.push(a)},onclose(a){o(i)}})})}async get(t,n,r){n.limit=1;let o=await this.querySync(t,n,r);return o.sort((i,a)=>a.created_at-i.created_at),o[0]||null}publish(t,n){return t.map(Wr).map(async(r,o,i)=>{if(i.indexOf(r)!==o)return Promise.reject("duplicate url");let a=await this.ensureRelay(r);return a.publish(n).then(u=>{if(this.trackRelays){let d=this.seenOn.get(n.id);d||(d=new Set,this.seenOn.set(n.id,d)),d.add(a)}return u})})}listConnectionStatus(){let t=new Map;return this.relays.forEach((n,r)=>t.set(r,n.connected)),t}destroy(){this.relays.forEach(t=>t.close()),this.relays=new Map}};var Xg;try{Xg=WebSocket}catch{}var Za=class extends Ga{constructor(){super({verifyEvent:qg,websocketImplementation:Xg})}};var tm=ll(Al(),1);var as=["wss://purplepag.es","wss://relay.nos.social","wss://user.kindpag.es"],em=["wss://purplepag.es","wss://relay.nos.social","wss://user.kindpag.es"];var x3=0,b9=fd(3,as,dd(e=>{if(e.length>=2&&e[0]==="p")return e[1]}),e=>[]),Uo=fd(10002,em,dd(e=>{if(e.length===2)return{url:e[1],read:!0,write:!0};if(e[2]==="read")return{url:e[1],read:!0,write:!1};if(e[2]==="write")return{url:e[1],read:!1,write:!0}}),e=>[{url:"wss://relay.damus.io",read:!0,write:!0},{url:"wss://nos.lol",read:!0,write:!0}]),w9=fd(1e4,[],dd(e=>{if(e.length>=2){switch(e[0]){case"p":return{label:"pubkey",value:e[1]};case"e":return{label:"thread",value:e[1]};case"t":return{label:"hashtag",value:e[1]};case"word":return{label:"word",value:e[1]}}return}}),e=>[]);function dd(e){return t=>t?t.tags.map(e).filter(bg):[]}function fd(e,t,n,r){let o=Aa(),i=rs(`@nostr/gadgets/list:${e}`,"cache"),a=new tm.default(u=>new Promise(async d=>{let h=[],m=Math.round(Date.now()/1e3),b=await Sa(u.map(T=>T.target),i).then(T=>T.map((A,k)=>{let I=u[k];return I.index=k,A?!A.lastAttempt||A.lastAttempt<m-60*60*24*2?(h.push(I),A):(A.event===null&&A.lastAttempt<Date.now()/1e3-60*60&&h.push(I),A):(h.push(I),{items:r(I.target),event:null})}));if(h.length===0){d(b);return}let _={};for(let T=0;T<h.length;T++){let A=h[T],k=A.relays.slice(0,Math.min(4,A.relays.length));do k.push(k3(t));while(k.length<3);for(let I=0;I<k.length;I++){let O=k[I],L=_[O];L||(L=[{kinds:[e],authors:[]}],_[O]=L),L[0]?.authors?.push(A.target)}}try{let T;T=mr.subscribeManyMap(_,{label:`kind:${e}:batch(${h.length})`,onevent(A){for(let k=0;k<h.length;k++){let I=h[k];if(I.target===A.pubkey){if(b[I.index]?.event?.created_at||0>A.created_at)return;b[I.index]={event:A,items:n(A)};return}}},oneose(){T?.close()},async onclose(){d(b),ka(h.map(A=>[A.target,{...b[A.index],lastAttempt:m}]),i)}})}catch(T){d(b.map(A=>T))}}),{cache:!0,cacheKeyFn:u=>u.target,cacheMap:o});return async function(u,d=[]){let h=d;if(e===10002)return await a.load({target:u,relays:h});{let m=await Uo(u,d);return h.push(...m.items.filter(({write:b})=>b).map(({url:b})=>b).slice(0,3)),await a.load({target:u,relays:h})}}}function k3(e){return e[x3++%e.length]}var Ya=class{relayBySerial=[];orderedRelaysByPubKey={};hasLoadedRelaysFor=new Set;export(){return JSON.stringify({relayBySerial:this.relayBySerial,orderedRelaysByPubKey:this.orderedRelaysByPubKey})}import(t){let{relayBySerial:n,orderedRelaysByPubKey:r}=JSON.parse(t);this.relayBySerial=n,this.orderedRelaysByPubKey=r}save(t,n,r,o){let i=this.relayBySerial.indexOf(n);i===-1&&(i=this.relayBySerial.length,this.relayBySerial.push(n));let a=this.orderedRelaysByPubKey[t];a||(a=[]);let u=a.findIndex(d=>d.serial===i);if(u===-1){let d=new hd(i);d.timestamps[r]=o,a.push(d)}else a[u].timestamps[r]<o&&(a[u].timestamps[r]=o);this.orderedRelaysByPubKey[t]=a}async topN(t,n){if(!this.hasLoadedRelaysFor.has(t)){try{let{event:i,items:a}=await Uo(t);i&&a.forEach(u=>{u.write&&this.save(t,u.url,qn.lastInRelayList,i.created_at)})}catch{}this.hasLoadedRelaysFor.add(t)}let r=[],o=this.orderedRelaysByPubKey[t];if(o){o.sort((i,a)=>a.sum()-i.sum());for(let i=0;i<n&&i<o.length;i++)r.push(this.relayBySerial[o[i].serial])}return r}printScores(){console.log("= print scores");for(let t in this.orderedRelaysByPubKey){let n=this.orderedRelaysByPubKey[t];console.log(`== relay scores for ${t}`);for(let r=0;r<n.entries.length;r++){let o=n[r];console.log(` ${r.toString().padStart(3)} :: ${this.relayBySerial[o.serial].padEnd(30)} (${o.serial}) ::> ${o.sum().toString().padStart(12)}`)}}}},hd=class{serial;timestamps=new Array(7).fill(0);constructor(t){this.serial=t}sum(){let t=Date.now()/1e3+86400,n=0;for(let r=0;r<this.timestamps.length;r++){if(this.timestamps[r]===0)continue;let o=S3[r]*1e10/Math.pow(Math.max(t-this.timestamps[r],1),1.3);n+=o}return n}},qn;(function(e){e[e.lastFetchAttempt=0]="lastFetchAttempt",e[e.mostRecentEventFetched=1]="mostRecentEventFetched",e[e.lastInRelayList=2]="lastInRelayList",e[e.lastInTag=3]="lastInTag",e[e.lastInNprofile=4]="lastInNprofile",e[e.lastInNevent=5]="lastInNevent",e[e.lastInNIP05=6]="lastInNIP05"})(qn||(qn={}));var S3={[qn.lastFetchAttempt]:-500,[qn.mostRecentEventFetched]:700,[qn.lastInRelayList]:350,[qn.lastInTag]:5,[qn.lastInNprofile]:22,[qn.lastInNevent]:8,[qn.lastInNIP05]:7};var mr=new Za;var k9=new Ya;var nm=0;var rm=rs("@nostr/gadgets/metadata","cache");function sm(e){return typeof e=="string"?om.load({pubkey:e}):om.load(e)}var om=new im.default(async e=>new Promise(async t=>{let n=[],r=Math.round(Date.now()/1e3),o=await Sa(e.map(a=>a.pubkey),rm).then(a=>a.map((u,d)=>{let h=e[d];if(u)return u.lastAttempt<r-60*60*24*2?(n.push(h),u.lastAttempt=r,u):(u.lastAttempt<r-60*60&&!u.metadata.name&&!u.metadata.picture&&!u.metadata.about&&(n.push(h),u.lastAttempt=Math.round(Date.now()/1e3)),u);{n.push(h);let m=A3(h.pubkey);return m.lastAttempt=r,m}}));if(n.length===0){t(o);return}let i={};await Promise.all(n.map(async({pubkey:a,relays:u=[]})=>{let d=new Set(u.slice(0,3));try{let{items:h}=await Uo(a),m=0;for(let b=0;b<h.length&&!(h[b].write&&(d.add(h[b].url),m++,m>=2));b++);}catch(h){console.error("Failed to load relay list for",a,h)}do d.add(as[nm%as.length]),nm++;while(d.size<2);i[a]=Array.from(d)}));try{let a={};for(let[d,h]of Object.entries(i))for(let m of h)a[m]||(a[m]=[{kinds:[0],authors:[]}]),a[m][0].authors.push(d);let u=mr.subscribeManyMap(a,{label:`metadata(${e.length})`,onevent(d){for(let h=0;h<e.length;h++)if(e[h].pubkey===d.pubkey){let m=o[h];if(m.lastUpdated>d.created_at)return;T3(m,d);return}},oneose(){t(o),u.close();let d=[];for(let h=0;h<o.length;h++){let m=o[h];m.pubkey&&d.push([m.pubkey,m])}ka(d,rm)}})}catch(a){for(let u=0;u<o.length;u++)o[u]=a;t(o)}}),{cacheKeyFn:e=>e.pubkey,cache:!0,cacheMap:Aa()});function A3(e){let t=pg(e);return{pubkey:e,npub:t,shortName:t.substring(0,8)+"\u2026"+t.substring(59),lastUpdated:0,metadata:{}}}function T3(e,t){let n={};try{n=JSON.parse(t.content)}catch{}e.metadata=n,e.shortName=n.name||n.display_name||n.nip05?.split("@")?.[0]||e.shortName,n.picture&&(e.image=n.picture)}var cs=new TextDecoder("utf-8"),di=new TextEncoder;var am=5e3;function $3(e){let t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=e&255,t}function fi(e){let{prefix:t,words:n}=qr.decode(e,am),r=new Uint8Array(qr.fromWords(n));switch(t){case"nprofile":{let o=pd(r);if(!o[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(o[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:xt(o[0][0]),relays:o[1]?o[1].map(i=>cs.decode(i)):[]}}}case"nevent":{let o=pd(r);if(!o[0]?.[0])throw new Error("missing TLV 0 for nevent");if(o[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(o[2]&&o[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(o[3]&&o[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:xt(o[0][0]),relays:o[1]?o[1].map(i=>cs.decode(i)):[],author:o[2]?.[0]?xt(o[2][0]):void 0,kind:o[3]?.[0]?parseInt(xt(o[3][0]),16):void 0}}}case"naddr":{let o=pd(r);if(!o[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!o[2]?.[0])throw new Error("missing TLV 2 for naddr");if(o[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!o[3]?.[0])throw new Error("missing TLV 3 for naddr");if(o[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:cs.decode(o[0][0]),pubkey:xt(o[2][0]),kind:parseInt(xt(o[3][0]),16),relays:o[1]?o[1].map(i=>cs.decode(i)):[]}}}case"nsec":return{type:t,data:r};case"npub":case"note":return{type:t,data:xt(r)};default:throw new Error(`unknown prefix ${t}`)}}function pd(e){let t={},n=e;for(;n.length>0;){let r=n[0],o=n[1],i=n.slice(2,2+o);if(n=n.slice(2+o),i.length<o)throw new Error(`not enough data to read on TLV ${r}`);t[r]=t[r]||[],t[r].push(i)}return t}function cm(e){return B3("npub",Po(e))}function gd(e,t){let n=qr.toWords(t);return qr.encode(e,n,am)}function B3(e,t){return gd(e,t)}function Ja(e){let t;e.kind!==void 0&&(t=$3(e.kind));let n=lm({0:[Po(e.id)],1:(e.relays||[]).map(r=>di.encode(r)),2:e.author?[Po(e.author)]:[],3:t?[new Uint8Array(t)]:[]});return gd("nevent",n)}function um(e){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,e.kind,!1);let n=lm({0:[di.encode(e.identifier)],1:(e.relays||[]).map(r=>di.encode(r)),2:[Po(e.pubkey)],3:[new Uint8Array(t)]});return gd("naddr",n)}function lm(e){let t=[];return Object.entries(e).reverse().forEach(([n,r])=>{r.forEach(o=>{let i=new Uint8Array(o.length+2);i.set([parseInt(n)],0),i.set([o.length],1),i.set(o,2),t.push(i)})}),Bl(...t)}async function dm(){let e=document.querySelector('meta[name="author"]'),t=document.querySelector('meta[name="relays"]'),n=document.querySelector('meta[name="topics"]'),r=document.querySelector('meta[name="comments"]'),o;e?o=e.getAttribute("content"):(console.warn("Missing meta tags for configuration, using hodlbod as a fallback"),o="npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn");let i=[],a=[],u=t?.getAttribute?.("content")?.split(",").map(T=>T.trim());if(u&&u.length>0)i=u,a=u;else{let T=(await Uo(fi(o).data)).items;a=T.filter(A=>A.write).map(A=>A.url).slice(0,5),i=T.filter(A=>A.read).map(A=>A.url)}let d=n?.getAttribute?.("content")?.split(",").map(T=>T.trim()).filter(T=>T!=="")||[],h=(r?.getAttribute?.("content")||"no")==="yes",m=[],b=document.querySelectorAll("meta"),_="block:";return b.forEach(T=>{let A=T.getAttribute("name");if(!A||!A.startsWith(_))return;let k=T.getAttribute("content"),I=k?k.split("-"):[],O,L=A.substring(_.length);switch(L){case"articles":O={count:2,minChars:10,style:"grid"};break;case"notes":O={count:10,minChars:0,style:"list"};break;case"images":O={count:10,minChars:0,style:"grid"};break;default:return}I.length>0&&!isNaN(Number(I[0]))&&(O.count=parseInt(I[0],10),I.shift());let f=I.findIndex(p=>["list","slide","grid","board","wall"].includes(p));f>=0&&(O.style=I[f],I.splice(f,1)),I.forEach(p=>{p.startsWith("m")&&!isNaN(Number(p.substring(1)))&&(O.minChars=parseInt(p.substring(1),10)),p.startsWith("i")&&(O.ids=O.ids||[],O.ids.push(p.substring(1)))}),m.push({type:L,config:O})}),m.length==0&&(m.push({type:"articles",config:{count:3,style:"grid",minChars:10}}),m.push({type:"notes",config:{count:10,style:"slide",minChars:400}}),m.push({type:"articles",config:{count:2,style:"grid",minChars:10}}),m.push({type:"images",config:{count:10,style:"grid",minChars:0}}),m.push({type:"articles",config:{count:10,style:"list",minChars:0}}),m.push({type:"articles",config:{count:2,style:"grid",minChars:0}}),m.push({type:"articles",config:{count:30,style:"list",minChars:0}})),{npub:o,readRelays:i,writeRelays:a,topics:d,comments:h,blocks:m}}var mm=ll(hm(),1);var zo=Symbol("verified"),C3=e=>e instanceof Object;function md(e){if(!C3(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let r=0;r<n.length;r++)if(typeof n[r]=="object")return!1}return!0}var P3=/\W/m,pm=/\W |\W$|$|,| /m;function*ec(e){let t=e.length,n=0,r=0;for(;r<t;){let o=e.indexOf(":",r);if(o===-1)break;if(e.substring(o-5,o)==="nostr"){let i=e.substring(o+60).match(P3),a=i?o+60+i.index:t;try{let u,{data:d,type:h}=fi(e.substring(o+1,a));switch(h){case"npub":u={pubkey:d};break;case"nsec":case"note":r=a+1;continue;default:u=d}n!==o-5&&(yield{type:"text",text:e.substring(n,o-5)}),yield{type:"reference",pointer:u},r=a,n=r;continue}catch{r=o+1;continue}}else if(e.substring(o-5,o)==="https"||e.substring(o-4,o)==="http"){let i=e.substring(o+4).match(pm),a=i?o+4+i.index:t,u=e[o-1]==="s"?5:4;try{let d=new URL(e.substring(o-u,a));if(d.hostname.indexOf(".")===-1)throw new Error("invalid url");if(n!==o-u&&(yield{type:"text",text:e.substring(n,o-u)}),d.pathname.endsWith(".png")||d.pathname.endsWith(".jpg")||d.pathname.endsWith(".jpeg")||d.pathname.endsWith(".gif")||d.pathname.endsWith(".webp")){yield{type:"image",url:d.toString()},r=a,n=r;continue}if(d.pathname.endsWith(".mp4")||d.pathname.endsWith(".avi")||d.pathname.endsWith(".webm")||d.pathname.endsWith(".mkv")){yield{type:"video",url:d.toString()},r=a,n=r;continue}if(d.pathname.endsWith(".mp3")||d.pathname.endsWith(".aac")||d.pathname.endsWith(".ogg")||d.pathname.endsWith(".opus")){yield{type:"audio",url:d.toString()},r=a,n=r;continue}yield{type:"url",url:d.toString()},r=a,n=r;continue}catch{r=a+1;continue}}else if(e.substring(o-3,o)==="wss"||e.substring(o-2,o)==="ws"){let i=e.substring(o+4).match(pm),a=i?o+4+i.index:t,u=e[o-1]==="s"?3:2;try{let d=new URL(e.substring(o-u,a));if(d.hostname.indexOf(".")===-1)throw new Error("invalid ws url");n!==o-u&&(yield{type:"text",text:e.substring(n,o-u)}),yield{type:"relay",url:d.toString()},r=a,n=r;continue}catch{r=a+1;continue}}else{r=o+1;continue}}n!==t&&(yield{type:"text",text:e.substring(n)})}function bm(e){for(let t of e.tags)if(t[0]==="e"&&(t[3]==="root"||t[3]==="reply"))return!1;return!0}var bd=new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"long",year:"numeric"});function us(e){let t,n,r=[],o,i=!1;if(e.kind===30023)t=e.tags.find(([a])=>a==="title")?.[1],t||(t="Article of "+bd.format(new Date(e.created_at*1e3)),i=!0),n=e.tags.find(([a])=>a==="summary")?.[1]||void 0,o=e.tags.find(([a])=>a==="image")?.[1]||void 0;else if(e.kind==20)t=e.tags.find(([a])=>a==="title")?.[1],t||(t="Photo of "+bd.format(new Date(e.created_at*1e3)),i=!0),n=e.content,e.tags.forEach(a=>{if(a[0]==="imeta"){let u=a[1].split(" ")[1];r.push(u)}}),o=r[0];else if(t=e.tags.find(([a])=>a==="subject")?.[1],t||(t="Note of "+bd.format(new Date(e.created_at*1e3)),i=!0),n=U3(e.content,504),n.length>503){for(n=n.substring(0,500);n.endsWith(".");)n=n?.substring(0,n.length-1);n.endsWith(" ")?n=n.trimEnd()+" (...)":n+="..."}return{id:e.id,kind:e.kind,created_at:e.created_at,title:t,autogeneratedTitle:i,image:o,images:r,summary:n,content:e.content}}async function I3(e){try{let t=e.match(/^([a-zA-Z0-9-_.]+)@([a-zA-Z0-9-.]+)$/);if(!t)return null;let[n,r,o]=t,i=`https://${o}/.well-known/nostr.json?name=${r}`,a=await fetch(i);if(!a.ok)return console.error(`Failed to fetch NIP-05 data: ${a.status}`),null;let u=await a.json();return u&&u.names&&u.names[r]?u.names[r]:null}catch(t){return console.error("Error resolving NIP-05 address:",t),null}}async function ls(e){let t,n=[];if(e.includes("@")){let r=await I3(e);if(r)t=r;else return console.error("Failed to resolve NIP-05 address"),null}else try{let r=fi(e);if(r.type==="npub")t=r.data;else if(r.type==="nprofile")t=r.data.pubkey,n=r.data.relays||[];else return console.error("author should be an npub"),null}catch(r){if(e.length===64)t=e;else return console.error("Failed to decode npub:",r),null}return sm({pubkey:t,relays:n})}async function N3(e){let t=/nostr:(npub1\w+|nprofile1\w+)/g,r=(e.match(t)||[]).map(async a=>{try{let u=await ls(a.slice(6));return u?{match:a,replacement:`<a href='https://njump.me/${a}'>${u.shortName}</a>`}:{match:a,replacement:a}}catch(u){return console.error("Failed to fetch profile:",u),{match:a,replacement:a}}}),o=await Promise.all(r),i=e;return o.forEach(({match:a,replacement:u})=>{i=i.replace(a,u)}),i}function O3(e){let t=/(^|\s|\n|\()(nevent1\w+|note1\w+|npub1\w+|nprofile1\w+)(?=\s|\n|\)|$)/gm;e=e.replace(t,(r,o,i)=>`${o}nostr:${i}`);let n=/(^|\s|\n)nostr:(nevent1\w+|note1\w+|npub1\w+|nprofile1\w+)(?=\s|\n|$)/gm;return e=e.replace(n,(r,o,i)=>{let a=i.slice(0,24);return`${o}<a href='https://njump.me/${i}'>${a}</a>`}),e}function R3(e){let t=/(?<![(])(?![^<]*>)(https?:\/\/\S+(?:(?!\.(?:png|jpg|jpeg|gif|bmp|mp4|webm|ogg|mov))\S*))/gi;return e.replace(t,r=>{let o=r.length>75?`${r.slice(0,72)}...`:r;return` <a href="${r}" target="_blank" rel="noopener noreferrer">${o}</a> `})}function U3(e,t){let n="";for(let r of ec(e)){switch(r.type){case"text":n+=r.text;break;case"url":case"image":case"video":case"audio":case"relay":n+=V3(r.url);break;case"reference":let o;"id"in r.pointer?o=Ja(r.pointer):"identifier"in r.pointer?o=um(r.pointer):o=cm(r.pointer.pubkey),n+=H3(o);break}if(n.length>t)break}return n}function z3(e){let t=/(?<![(])(https?:\/\/\S+\.(?:png|jpg|jpeg|gif|bmp))(?![\)])/g;return e.replace(t,(r,o)=>` <img src='${o}' /> `)}function M3(e){let t=/(?:https?:\/\/\S+\.(?:mp4|webm|ogg|mov))|(?:\!\[.*?\]\((https?:\/\/\S+\.(?:mp4|webm|ogg|mov))\))/gi;return e.replace(t,r=>{let o=r.match(/https?:\/\/\S+\.(?:mp4|webm|ogg|mov)/)?.[0]||r.match(/\((https?:\/\/\S+\.(?:mp4|webm|ogg|mov))\)/)?.[1];return o?` <video controls><source src="${o}" type="video/mp4"></video> `:r})}function D3(e){let t=/\s*(https?:\/\/\S+\.(?:mp3|wav|ogg|aac|flac|m4a|opus))(\s*|$)/gi;return e.replace(t,(r,o)=>` <audio controls src="${o}"></audio> `)}function F3(e){let t=[{regex:/<<|»/g,replacement:"«"},{regex:/>>|«/g,replacement:"»"},{regex:/\.\.\./g,replacement:"…"},{regex:/---/g,replacement:"—"},{regex:/--/g,replacement:"—"}],n=[],r=0,o=/(<pre[^>]*>[\s\S]*?<\/pre>|<code[^>]*>[\s\S]*?<\/code>)/gi,i;for(;(i=o.exec(e))!==null;)i.index>r&&n.push({text:e.slice(r,i.index),isProtected:!1}),n.push({text:i[0],isProtected:!0}),r=i.index+i[0].length;return r<e.length&&n.push({text:e.slice(r),isProtected:!1}),n.length===0&&n.push({text:e,isProtected:!1}),n.map(a=>{if(a.isProtected)return a.text;let u=a.text;return t.forEach(({regex:d,replacement:h})=>{u=u.replace(d,h)}),u}).join("")}async function wm(e){return e.renderedContent=await wd(e),e}function j3(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function wd(e){let t=e.content;return e.kind==1&&(t=j3(t)),t=await N3(t),t=O3(t),t=z3(t),t=M3(t),t=D3(t),e.kind==1&&(t=t.replace(/\n/g,`<br>
|
|
`),t=R3(t)),"title"in e&&(t=t.replace("# "+e.title,"")),e.kind===30023&&(t=new mm.default.Converter({simplifiedAutoLink:!0,tables:!0,strikethrough:!0}).makeHtml(t)),t=F3(t),t}function Xt(e,t=!1){let n=new Date(e*1e3),r={day:"2-digit",month:"long",year:"numeric"},o=new Intl.DateTimeFormat("en-US",r).formatToParts(n),i,a,u;o.forEach(h=>{h.type==="day"&&(i=h.value),h.type==="month"&&(a=h.value),h.type==="year"&&(u=h.value)});let d=`${i} ${a} ${u}`;if(t){let h={hour:"2-digit",minute:"2-digit",hourCycle:"h23"},b=new Intl.DateTimeFormat("en-US",h).format(n);d+=` - ${b}`}return d}async function yd(){try{console.log(window.location.href.split("#")[0]);let e=await fetch(window.location.href.split("?")[0].split("#")[0]+"?bundled=1",{method:"GET",headers:{Accept:"text/html"}});if(!e.ok)throw new Error("Network response was not ok");let t=await e.text(),n=new Blob([t],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="index.html",o.click(),URL.revokeObjectURL(r)}catch(e){console.error("Error downloading the original HTML:",e)}}function H3(e){let t=e.indexOf("1");return e.substring(0,t+3)+"\u2026"+e.substring(e.length-5)}function V3(e){if(e.length<=30)return e;try{let t=new URL(e);if(e.length<=40)return`${t.host}${t.pathname}${t.search.length?"?":""}${t.search}`;if(e.length<=50&&t.pathname.length<20)return`${t.host}${t.pathname}`;let n=t.pathname,r=t.pathname.split("/"),o=r[r.length-1];return o.length>10&&(o=`\u2026${o.substring(o.length-6)}`),r.length>2?n=`/\u2026/${o}`:n=`/${o}`,`${t.host}${n}`}catch{return e}}var hi=[];function ds(e,t=De){let n,r=new Set;function o(u){if(tt(e,u)&&(e=u,n)){let d=!hi.length;for(let h of r)h[1](),hi.push(h,e);if(d){for(let h=0;h<hi.length;h+=2)hi[h][0](hi[h+1]);hi.length=0}}}function i(u){o(u(e))}function a(u,d=De){let h=[u,d];return r.add(h),r.size===1&&(n=t(o,i)||De),u(e),()=>{r.delete(h),r.size===0&&n&&(n(),n=null)}}return{set:o,update:i,subscribe:a}}var pi=ds("");function q3(e){let t;return{c(){t=ae("div"),t.innerHTML='<div class="loader svelte-mae19q"></div>',oe(t,"class","loader-container svelte-mae19q")},m(n,r){le(n,t,r)},p:De,i:De,o:De,d(n){n&&ce(t)}}}var vd=class extends nt{constructor(t){super(),ct(this,t,null,q3,tt,{})}},ym=vd;function vm(e,t,n){let r=e.slice();return r[7]=t[n],r}function _m(e,t,n){let r=e.slice();return r[7]=t[n],r}function Em(e){let t;function n(i,a){if(i[0]==="grid")return Q3;if(i[0]==="list")return W3}let r=n(e,-1),o=r&&r(e);return{c(){t=ae("section"),o&&o.c(),oe(t,"class","block articles")},m(i,a){le(i,t,a),o&&o.m(t,null)},p(i,a){r===(r=n(i,a))&&o?o.p(i,a):(o&&o.d(1),o=r&&r(i),o&&(o.c(),o.m(t,null)))},d(i){i&&ce(t),o&&o.d()}}}function W3(e){let t,n,r=Je(e[2]),o=[];for(let i=0;i<r.length;i+=1)o[i]=km(vm(e,r,i));return{c(){t=ae("div"),n=ae("ul");for(let i=0;i<o.length;i+=1)o[i].c();oe(t,"class","list")},m(i,a){le(i,t,a),ne(t,n);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(n,null)},p(i,a){if(a&4){r=Je(i[2]);let u;for(u=0;u<r.length;u+=1){let d=vm(i,r,u);o[u]?o[u].p(d,a):(o[u]=km(d),o[u].c(),o[u].m(n,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=r.length}},d(i){i&&ce(t),Jt(o,i)}}}function Q3(e){let t,n,r=Je(e[2]),o=[];for(let i=0;i<r.length;i+=1)o[i]=$m(_m(e,r,i));return{c(){t=ae("div");for(let i=0;i<o.length;i+=1)o[i].c();oe(t,"class",n="grid "+(e[2].length%2!==0?"odd":""))},m(i,a){le(i,t,a);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(t,null)},p(i,a){if(a&6){r=Je(i[2]);let u;for(u=0;u<r.length;u+=1){let d=_m(i,r,u);o[u]?o[u].p(d,a):(o[u]=$m(d),o[u].c(),o[u].m(t,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=r.length}a&4&&n!==(n="grid "+(i[2].length%2!==0?"odd":""))&&oe(t,"class",n)},d(i){i&&ce(t),Jt(o,i)}}}function xm(e){let t,n=e[7].summary+"",r;return{c(){t=ae("div"),r=ze(n),oe(t,"class","summary")},m(o,i){le(o,t,i),ne(t,r)},p(o,i){i&4&&n!==(n=o[7].summary+"")&&Ze(r,n)},d(o){o&&ce(t)}}}function km(e){let t,n,r,o=e[7].title+"",i,a,u,d,h=e[7].summary&&xm(e);return{c(){t=ae("li"),n=ae("a"),r=ae("h2"),i=ze(o),a=Ne(),h&&h.c(),d=Ne(),oe(n,"href",u=`#${e[7].id}`)},m(m,b){le(m,t,b),ne(t,n),ne(n,r),ne(r,i),ne(n,a),h&&h.m(n,null),ne(t,d)},p(m,b){b&4&&o!==(o=m[7].title+"")&&Ze(i,o),m[7].summary?h?h.p(m,b):(h=xm(m),h.c(),h.m(n,null)):h&&(h.d(1),h=null),b&4&&u!==(u=`#${m[7].id}`)&&oe(n,"href",u)},d(m){m&&ce(t),h&&h.d()}}}function Sm(e){let t,n;return{c(){t=ae("img"),Ot(t.src,n=e[7].image)||oe(t,"src",n)},m(r,o){le(r,t,o)},p(r,o){o&4&&!Ot(t.src,n=r[7].image)&&oe(t,"src",n)},d(r){r&&ce(t)}}}function Am(e){let t,n=e[7].summary+"";return{c(){t=ae("div"),oe(t,"class","summary")},m(r,o){le(r,t,o),t.innerHTML=n},p(r,o){o&4&&n!==(n=r[7].summary+"")&&(t.innerHTML=n)},d(r){r&&ce(t)}}}function Tm(e){let t;return{c(){t=ae("span"),t.textContent="- \u{1F4CC} Pinned",oe(t,"class","pinned")},m(n,r){le(n,t,r)},d(n){n&&ce(t)}}}function $m(e){let t,n,r,o,i=e[7].title+"",a,u,d,h,m,b=Xt(e[7].created_at)+"",_,T,A=e[1]&&e[1].some(O),k,I;function O(...w){return e[6](e[7],...w)}let L=e[7].image&&Sm(e),f=e[7].summary&&Am(e),p=A&&Tm(e);return{c(){t=ae("div"),n=ae("a"),L&&L.c(),r=Ne(),o=ae("div"),a=ze(i),u=Ne(),f&&f.c(),d=Ne(),h=ae("div"),m=ae("span"),_=ze(b),T=Ne(),p&&p.c(),I=Ne(),oe(o,"class","title"),oe(m,"class","date"),oe(n,"href",k=`#${e[7].id}`),oe(t,"class","item")},m(w,v){le(w,t,v),ne(t,n),L&&L.m(n,null),ne(n,r),ne(n,o),ne(o,a),ne(n,u),f&&f.m(n,null),ne(n,d),ne(n,h),ne(h,m),ne(m,_),ne(h,T),p&&p.m(h,null),ne(t,I)},p(w,v){e=w,e[7].image?L?L.p(e,v):(L=Sm(e),L.c(),L.m(n,r)):L&&(L.d(1),L=null),v&4&&i!==(i=e[7].title+"")&&Ze(a,i),e[7].summary?f?f.p(e,v):(f=Am(e),f.c(),f.m(n,d)):f&&(f.d(1),f=null),v&4&&b!==(b=Xt(e[7].created_at)+"")&&Ze(_,b),v&6&&(A=e[1]&&e[1].some(O)),A?p||(p=Tm(e),p.c(),p.m(h,null)):p&&(p.d(1),p=null),v&4&&k!==(k=`#${e[7].id}`)&&oe(n,"href",k)},d(w){w&&ce(t),L&&L.d(),f&&f.d(),p&&p.d()}}}function K3(e){let t,n=e[2].length>0&&Em(e);return{c(){n&&n.c(),t=$t()},m(r,o){n&&n.m(r,o),le(r,t,o)},p(r,[o]){r[2].length>0?n?n.p(r,o):(n=Em(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:De,o:De,d(r){r&&ce(t),n&&n.d(r)}}}function G3(e,t,n){let{source:r}=t,{count:o}=t,{style:i}=t,{minChars:a}=t,{ids:u=void 0}=t,d=[];Bt(()=>{(async()=>u?(n(0,i="grid"),n(2,d=await r.fetchIds(u))):n(2,d=await r.pluck(o,a)))()});let h=(m,b)=>m.id.endsWith(b);return e.$$set=m=>{"source"in m&&n(3,r=m.source),"count"in m&&n(4,o=m.count),"style"in m&&n(0,i=m.style),"minChars"in m&&n(5,a=m.minChars),"ids"in m&&n(1,u=m.ids)},[i,u,d,r,o,a,h]}var _d=class extends nt{constructor(t){super(),ct(this,t,G3,K3,tt,{source:3,count:4,style:0,minChars:5,ids:1})}},Ed=_d;function Wn(...e){return e.filter(Boolean).join(" ")}function xd(e,t){if(e){let n=Object.keys(e);for(let r=0;r<n.length;r++){let o=n[r];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function tc(e){let t=e.Components.Elements?.list.children;return t&&Array.prototype.slice.call(t)||[]}function Mo(e){return e!==null&&typeof e=="object"}function fs(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!fs(n,t[r]));if(Mo(e)&&Mo(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!fs(e[o],t[o]))}return e===t}function kd(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function hs(e,t){let n=e;return xd(t,(r,o)=>{Array.isArray(r)?n[o]=r.slice():Mo(r)?n[o]=hs(Mo(n[o])?n[o]:{},r):n[o]=r}),n}function Bm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Z3(e,t,n){return t&&Bm(e.prototype,t),n&&Bm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Lm="(prefers-reduced-motion: reduce)",bi=1,Y3=2,vi=3,Ei=4,xs=5,rc=6,ac=7,J3={CREATED:bi,MOUNTED:Y3,IDLE:vi,MOVING:Ei,SCROLLING:xs,DRAGGING:rc,DESTROYED:ac};function _r(e){e.length=0}function to(e,t,n){return Array.prototype.slice.call(e,t,n)}function Xe(e){return e.bind.apply(e,[null].concat(to(arguments,1)))}var Vm=setTimeout,Bd=function(){};function Cm(e){return requestAnimationFrame(e)}function dc(e,t){return typeof t===e}function ms(e){return!Rd(e)&&dc("object",e)}var Od=Array.isArray,qm=Xe(dc,"function"),Xr=Xe(dc,"string"),ks=Xe(dc,"undefined");function Rd(e){return e===null}function Wm(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ss(e){return Od(e)?e:[e]}function wn(e,t){Ss(e).forEach(t)}function Ud(e,t){return e.indexOf(t)>-1}function oc(e,t){return e.push.apply(e,Ss(t)),e}function wr(e,t,n){e&&wn(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function Qn(e,t){wr(e,Xr(t)?t.split(" "):t,!0)}function As(e,t){wn(t,e.appendChild.bind(e))}function zd(e,t){wn(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function bs(e,t){return Wm(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Qm(e,t){var n=e?to(e.children):[];return t?n.filter(function(r){return bs(r,t)}):n}function Ts(e,t){return t?Qm(e,t)[0]:e.firstElementChild}var ws=Object.keys;function Fo(e,t,n){return e&&(n?ws(e).reverse():ws(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function ys(e){return to(arguments,1).forEach(function(t){Fo(t,function(n,r){e[r]=t[r]})}),e}function Jr(e){return to(arguments,1).forEach(function(t){Fo(t,function(n,r){Od(n)?e[r]=n.slice():ms(n)?e[r]=Jr({},ms(e[r])?e[r]:{},n):e[r]=n})}),e}function Pm(e,t){wn(t||ws(e),function(n){delete e[n]})}function Kn(e,t){wn(e,function(n){wn(t,function(r){n&&n.removeAttribute(r)})})}function Fe(e,t,n){ms(t)?Fo(t,function(r,o){Fe(e,o,r)}):wn(e,function(r){Rd(n)||n===""?Kn(r,t):r.setAttribute(t,String(n))})}function wi(e,t,n){var r=document.createElement(e);return t&&(Xr(t)?Qn(r,t):Fe(r,t)),n&&As(n,r),r}function Cn(e,t,n){if(ks(n))return getComputedStyle(e)[t];Rd(n)||(e.style[t]=""+n)}function vs(e,t){Cn(e,"display",t)}function Km(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Pn(e,t){return e.getAttribute(t)}function Im(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function jo(e){wn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Gm(e){return Ts(new DOMParser().parseFromString(e,"text/html").body)}function br(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Zm(e,t){return e&&e.querySelector(t)}function Md(e,t){return t?to(e.querySelectorAll(t)):[]}function yr(e,t){wr(e,t,!1)}function Ld(e){return e.timeStamp}function Do(e){return Xr(e)?e:e?e+"px":""}var $s="splide",Dd="data-"+$s;function ps(e,t){if(!e)throw new Error("["+$s+"] "+(t||""))}var eo=Math.min,cc=Math.max,uc=Math.floor,_s=Math.ceil,en=Math.abs;function Ym(e,t,n){return en(e-t)<n}function ic(e,t,n,r){var o=eo(t,n),i=cc(t,n);return r?o<e&&e<i:o<=e&&e<=i}function gi(e,t,n){var r=eo(t,n),o=cc(t,n);return eo(cc(r,e),o)}function Cd(e){return+(e>0)-+(e<0)}function Pd(e,t){return wn(t,function(n){e=e.replace("%s",""+n)}),e}function Fd(e){return e<10?"0"+e:""+e}var Nm={};function X3(e){return""+e+Fd(Nm[e]=(Nm[e]||0)+1)}function Jm(){var e=[];function t(a,u,d,h){o(a,u,function(m,b,_){var T="addEventListener"in m,A=T?m.removeEventListener.bind(m,b,d,h):m.removeListener.bind(m,d);T?m.addEventListener(b,d,h):m.addListener(d),e.push([m,b,_,d,A])})}function n(a,u,d){o(a,u,function(h,m,b){e=e.filter(function(_){return _[0]===h&&_[1]===m&&_[2]===b&&(!d||_[3]===d)?(_[4](),!1):!0})})}function r(a,u,d){var h,m=!0;return typeof CustomEvent=="function"?h=new CustomEvent(u,{bubbles:m,detail:d}):(h=document.createEvent("CustomEvent"),h.initCustomEvent(u,m,!1,d)),a.dispatchEvent(h),h}function o(a,u,d){wn(a,function(h){h&&wn(u,function(m){m.split(" ").forEach(function(b){var _=b.split(".");d(h,_[0],_[1])})})})}function i(){e.forEach(function(a){a[4]()}),_r(e)}return{bind:t,unbind:n,dispatch:r,destroy:i}}var Er="mounted",Om="ready",In="move",no="moved",Bs="click",fc="active",hc="inactive",pc="visible",gc="hidden",ht="refresh",Ut="updated",Ho="resize",Ls="resized",jd="drag",Hd="dragging",Vd="dragged",Cs="scroll",ro="scrolled",e8="overflow",mc="destroy",bc="arrows:mounted",wc="arrows:updated",yc="pagination:mounted",vc="pagination:updated",Ps="navigation:mounted",_c="autoplay:play",Ec="autoplay:playing",xc="autoplay:pause",Is="lazyload:loaded",Xm="sk",e0="sh",lc="ei";function rt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Jm();function r(i,a){n.bind(t,Ss(i).join(" "),function(u){a.apply(a,Od(u.detail)?u.detail:[])})}function o(i){n.dispatch(t,i,to(arguments,1))}return e&&e.event.on(mc,n.destroy),ys(n,{bus:t,on:r,off:Xe(n.unbind,t),emit:o})}function kc(e,t,n,r){var o=Date.now,i,a=0,u,d=!0,h=0;function m(){if(!d){if(a=e?eo((o()-i)/e,1):1,n&&n(a),a>=1&&(t(),i=o(),r&&++h>=r))return _();u=Cm(m)}}function b(O){O||A(),i=o()-(O?a*e:0),d=!1,u=Cm(m)}function _(){d=!0}function T(){i=o(),a=0,n&&n(a)}function A(){u&&cancelAnimationFrame(u),a=0,u=0,d=!0}function k(O){e=O}function I(){return d}return{start:b,rewind:T,pause:_,cancel:A,set:k,isPaused:I}}function t8(e){var t=e;function n(o){t=o}function r(o){return Ud(Ss(o),t)}return{set:n,is:r}}function n8(e,t){var n=kc(t||0,e,null,1);return function(){n.isPaused()&&n.start()}}function r8(e,t,n){var r=e.state,o=n.breakpoints||{},i=n.reducedMotion||{},a=Jm(),u=[];function d(){var A=n.mediaQuery==="min";ws(o).sort(function(k,I){return A?+k-+I:+I-+k}).forEach(function(k){m(o[k],"("+(A?"min":"max")+"-width:"+k+"px)")}),m(i,Lm),b()}function h(A){A&&a.destroy()}function m(A,k){var I=matchMedia(k);a.bind(I,"change",b),u.push([A,I])}function b(){var A=r.is(ac),k=n.direction,I=u.reduce(function(O,L){return Jr(O,L[1].matches?L[0]:{})},{});Pm(n),T(I),n.destroy?e.destroy(n.destroy==="completely"):A?(h(!0),e.mount()):k!==n.direction&&e.refresh()}function _(A){matchMedia(Lm).matches&&(A?Jr(n,i):Pm(n,ws(i)))}function T(A,k,I){Jr(n,A),k&&Jr(Object.getPrototypeOf(n),A),(I||!r.is(bi))&&e.emit(Ut,n)}return{setup:d,destroy:h,reduce:_,set:T}}var Sc="Arrow",Ac=Sc+"Left",Tc=Sc+"Right",t0=Sc+"Up",n0=Sc+"Down";var Rm="rtl",$c="ttb",Sd={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[t0,Tc],ArrowRight:[n0,Ac]};function o8(e,t,n){function r(i,a,u){u=u||n.direction;var d=u===Rm&&!a?1:u===$c?0:-1;return Sd[i]&&Sd[i][d]||i.replace(/width|left|right/i,function(h,m){var b=Sd[h.toLowerCase()][d]||h;return m>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(i){return i*(n.direction===Rm?1:-1)}return{resolve:r,orient:o}}var vr="role",yi="tabindex",i8="disabled",Nn="aria-",Ns=Nn+"controls",r0=Nn+"current",Um=Nn+"selected",bn=Nn+"label",qd=Nn+"labelledby",o0=Nn+"hidden",Wd=Nn+"orientation",Es=Nn+"roledescription",zm=Nn+"live",Mm=Nn+"busy",Dm=Nn+"atomic",Qd=[vr,yi,i8,Ns,r0,bn,qd,o0,Wd,Es],Gn=$s+"__",oo="is-",Ad=$s,Fm=Gn+"track",s8=Gn+"list",Bc=Gn+"slide",i0=Bc+"--clone",a8=Bc+"__container",Kd=Gn+"arrows",Lc=Gn+"arrow",s0=Lc+"--prev",a0=Lc+"--next",Cc=Gn+"pagination",c0=Cc+"__page",c8=Gn+"progress",u8=c8+"__bar",Gd=Gn+"toggle",TT=Gd+"__play",$T=Gd+"__pause",l8=Gn+"spinner",d8=Gn+"sr",f8=oo+"initialized",Vo=oo+"active",u0=oo+"prev",l0=oo+"next",Id=oo+"visible",Nd=oo+"loading",d0=oo+"focus-in",f0=oo+"overflow",h8=[Vo,Id,u0,l0,Nd,d0,f0],p8={slide:Bc,clone:i0,arrows:Kd,arrow:Lc,prev:s0,next:a0,pagination:Cc,page:c0,spinner:l8};function g8(e,t){if(qm(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!bs(n,t);)n=n.parentElement;return n}var m8=5,jm=200,h0="touchstart mousedown",Td="touchmove mousemove",$d="touchend touchcancel mouseup click";function b8(e,t,n){var r=rt(e),o=r.on,i=r.bind,a=e.root,u=n.i18n,d={},h=[],m=[],b=[],_,T,A;function k(){f(),p(),L()}function I(){o(ht,O),o(ht,k),o(Ut,L),i(document,h0+" keydown",function(S){A=S.type==="keydown"},{capture:!0}),i(a,"focusin",function(){wr(a,d0,!!A)})}function O(S){var $=Qd.concat("style");_r(h),yr(a,m),yr(_,b),Kn([_,T],$),Kn(a,S?$:["style",Es])}function L(){yr(a,m),yr(_,b),m=v(Ad),b=v(Fm),Qn(a,m),Qn(_,b),Fe(a,bn,n.label),Fe(a,qd,n.labelledby)}function f(){_=w("."+Fm),T=Ts(_,"."+s8),ps(_&&T,"A track/list element is missing."),oc(h,Qm(T,"."+Bc+":not(."+i0+")")),Fo({arrows:Kd,pagination:Cc,prev:s0,next:a0,bar:u8,toggle:Gd},function(S,$){d[$]=w("."+S)}),ys(d,{root:a,track:_,list:T,slides:h})}function p(){var S=a.id||X3($s),$=n.role;a.id=S,_.id=_.id||S+"-track",T.id=T.id||S+"-list",!Pn(a,vr)&&a.tagName!=="SECTION"&&$&&Fe(a,vr,$),Fe(a,Es,u.carousel),Fe(T,vr,"presentation")}function w(S){var $=Zm(a,S);return $&&g8($,"."+Ad)===a?$:void 0}function v(S){return[S+"--"+n.type,S+"--"+n.direction,n.drag&&S+"--draggable",n.isNavigation&&S+"--nav",S===Ad&&Vo]}return ys(d,{setup:k,mount:I,destroy:O})}var _i="slide",xi="loop",Os="fade";function w8(e,t,n,r){var o=rt(e),i=o.on,a=o.emit,u=o.bind,d=e.Components,h=e.root,m=e.options,b=m.isNavigation,_=m.updateOnMove,T=m.i18n,A=m.pagination,k=m.slideFocus,I=d.Direction.resolve,O=Pn(r,"style"),L=Pn(r,bn),f=n>-1,p=Ts(r,"."+a8),w;function v(){f||(r.id=h.id+"-slide"+Fd(t+1),Fe(r,vr,A?"tabpanel":"group"),Fe(r,Es,T.slide),Fe(r,bn,L||Pd(T.slideLabel,[t+1,e.length]))),S()}function S(){u(r,"click",Xe(a,Bs,K)),u(r,"keydown",Xe(a,Xm,K)),i([no,e0,ro],N),i(Ps,P),_&&i(In,M)}function $(){w=!0,o.destroy(),yr(r,h8),Kn(r,Qd),Fe(r,"style",O),Fe(r,bn,L||"")}function P(){var Z=e.splides.map(function(W){var J=W.splide.Components.Slides.getAt(t);return J?J.slide.id:""}).join(" ");Fe(r,bn,Pd(T.slideX,(f?n:t)+1)),Fe(r,Ns,Z),Fe(r,vr,k?"button":""),k&&Kn(r,Es)}function M(){w||N()}function N(){if(!w){var Z=e.index;B(),F(),wr(r,u0,t===Z-1),wr(r,l0,t===Z+1)}}function B(){var Z=x();Z!==Im(r,Vo)&&(wr(r,Vo,Z),Fe(r,r0,b&&Z||""),a(Z?fc:hc,K))}function F(){var Z=z(),W=!Z&&(!x()||f);if(e.state.is([Ei,xs])||Fe(r,o0,W||""),Fe(Md(r,m.focusableNodes||""),yi,W?-1:""),k&&Fe(r,yi,W?-1:0),Z!==Im(r,Id)&&(wr(r,Id,Z),a(Z?pc:gc,K)),!Z&&document.activeElement===r){var J=d.Slides.getAt(e.index);J&&Km(J.slide)}}function q(Z,W,J){Cn(J&&p||r,Z,W)}function x(){var Z=e.index;return Z===t||m.cloneStatus&&Z===n}function z(){if(e.is(Os))return x();var Z=mn(d.Elements.track),W=mn(r),J=I("left",!0),de=I("right",!0);return uc(Z[J])<=_s(W[J])&&uc(W[de])<=_s(Z[de])}function V(Z,W){var J=en(Z-t);return!f&&(m.rewind||e.is(xi))&&(J=eo(J,e.length-J)),J<=W}var K={index:t,slideIndex:n,slide:r,container:p,isClone:f,mount:v,destroy:$,update:N,style:q,isWithin:V};return K}function y8(e,t,n){var r=rt(e),o=r.on,i=r.emit,a=r.bind,u=t.Elements,d=u.slides,h=u.list,m=[];function b(){_(),o(ht,T),o(ht,_)}function _(){d.forEach(function(N,B){k(N,B,-1)})}function T(){w(function(N){N.destroy()}),_r(m)}function A(){w(function(N){N.update()})}function k(N,B,F){var q=w8(e,B,F,N);q.mount(),m.push(q),m.sort(function(x,z){return x.index-z.index})}function I(N){return N?v(function(B){return!B.isClone}):m}function O(N){var B=t.Controller,F=B.toIndex(N),q=B.hasFocus()?1:n.perPage;return v(function(x){return ic(x.index,F,F+q-1)})}function L(N){return v(N)[0]}function f(N,B){wn(N,function(F){if(Xr(F)&&(F=Gm(F)),Wm(F)){var q=d[B];q?zd(F,q):As(h,F),Qn(F,n.classes.slide),$(F,Xe(i,Ho))}}),i(ht)}function p(N){jo(v(N).map(function(B){return B.slide})),i(ht)}function w(N,B){I(B).forEach(N)}function v(N){return m.filter(qm(N)?N:function(B){return Xr(N)?bs(B.slide,N):Ud(Ss(N),B.index)})}function S(N,B,F){w(function(q){q.style(N,B,F)})}function $(N,B){var F=Md(N,"img"),q=F.length;q?F.forEach(function(x){a(x,"load error",function(){--q||B()})}):B()}function P(N){return N?d.length:m.length}function M(){return m.length>n.perPage}return{mount:b,destroy:T,update:A,register:k,get:I,getIn:O,getAt:L,add:f,remove:p,forEach:w,filter:v,style:S,getLength:P,isEnough:M}}function v8(e,t,n){var r=rt(e),o=r.on,i=r.bind,a=r.emit,u=t.Slides,d=t.Direction.resolve,h=t.Elements,m=h.root,b=h.track,_=h.list,T=u.getAt,A=u.style,k,I,O;function L(){f(),i(window,"resize load",n8(Xe(a,Ho))),o([Ut,ht],f),o(Ho,p)}function f(){k=n.direction===$c,Cn(m,"maxWidth",Do(n.width)),Cn(b,d("paddingLeft"),w(!1)),Cn(b,d("paddingRight"),w(!0)),p(!0)}function p(K){var Z=mn(m);(K||I.width!==Z.width||I.height!==Z.height)&&(Cn(b,"height",v()),A(d("marginRight"),Do(n.gap)),A("width",$()),A("height",P(),!0),I=Z,a(Ls),O!==(O=V())&&(wr(m,f0,O),a(e8,O)))}function w(K){var Z=n.padding,W=d(K?"right":"left");return Z&&Do(Z[W]||(ms(Z)?0:Z))||"0px"}function v(){var K="";return k&&(K=S(),ps(K,"height or heightRatio is missing."),K="calc("+K+" - "+w(!1)+" - "+w(!0)+")"),K}function S(){return Do(n.height||mn(_).width*n.heightRatio)}function $(){return n.autoWidth?null:Do(n.fixedWidth)||(k?"":M())}function P(){return Do(n.fixedHeight)||(k?n.autoHeight?null:M():S())}function M(){var K=Do(n.gap);return"calc((100%"+(K&&" + "+K)+")/"+(n.perPage||1)+(K&&" - "+K)+")"}function N(){return mn(_)[d("width")]}function B(K,Z){var W=T(K||0);return W?mn(W.slide)[d("width")]+(Z?0:x()):0}function F(K,Z){var W=T(K);if(W){var J=mn(W.slide)[d("right")],de=mn(_)[d("left")];return en(J-de)+(Z?0:x())}return 0}function q(K){return F(e.length-1)-F(0)+B(0,K)}function x(){var K=T(0);return K&&parseFloat(Cn(K.slide,d("marginRight")))||0}function z(K){return parseFloat(Cn(b,d("padding"+(K?"Right":"Left"))))||0}function V(){return e.is(Os)||q(!0)>N()}return{mount:L,resize:p,listSize:N,slideSize:B,sliderSize:q,totalSize:F,getPadding:z,isOverflow:V}}var _8=2;function E8(e,t,n){var r=rt(e),o=r.on,i=t.Elements,a=t.Slides,u=t.Direction.resolve,d=[],h;function m(){o(ht,b),o([Ut,Ho],T),(h=I())&&(A(h),t.Layout.resize(!0))}function b(){_(),m()}function _(){jo(d),_r(d),r.destroy()}function T(){var O=I();h!==O&&(h<O||!O)&&r.emit(ht)}function A(O){var L=a.get().slice(),f=L.length;if(f){for(;L.length<O;)oc(L,L);oc(L.slice(-O),L.slice(0,O)).forEach(function(p,w){var v=w<O,S=k(p.slide,w);v?zd(S,L[0].slide):As(i.list,S),oc(d,S),a.register(S,w-O+(v?0:f),p.index)})}}function k(O,L){var f=O.cloneNode(!0);return Qn(f,n.classes.clone),f.id=e.root.id+"-clone"+Fd(L+1),f}function I(){var O=n.clones;if(!e.is(xi))O=0;else if(ks(O)){var L=n[u("fixedWidth")]&&t.Layout.slideSize(0),f=L&&_s(mn(i.track)[u("width")]/L);O=f||n[u("autoWidth")]&&e.length||n.perPage*_8}return O}return{mount:m,destroy:_}}function x8(e,t,n){var r=rt(e),o=r.on,i=r.emit,a=e.state.set,u=t.Layout,d=u.slideSize,h=u.getPadding,m=u.totalSize,b=u.listSize,_=u.sliderSize,T=t.Direction,A=T.resolve,k=T.orient,I=t.Elements,O=I.list,L=I.track,f;function p(){f=t.Transition,o([Er,Ls,Ut,ht],w)}function w(){t.Controller.isBusy()||(t.Scroll.cancel(),S(e.index),t.Slides.update())}function v(W,J,de,_e){W!==J&&K(W>de)&&(N(),$(M(q(),W>de),!0)),a(Ei),i(In,J,de,W),f.start(J,function(){a(vi),i(no,J,de,W),_e&&_e()})}function S(W){$(F(W,!0))}function $(W,J){if(!e.is(Os)){var de=J?W:P(W);Cn(O,"transform","translate"+A("X")+"("+de+"px)"),W!==de&&i(e0)}}function P(W){if(e.is(xi)){var J=B(W),de=J>t.Controller.getEnd(),_e=J<0;(_e||de)&&(W=M(W,de))}return W}function M(W,J){var de=W-V(J),_e=_();return W-=k(_e*(_s(en(de)/_e)||1))*(J?1:-1),W}function N(){$(q(),!0),f.cancel()}function B(W){for(var J=t.Slides.get(),de=0,_e=1/0,ve=0;ve<J.length;ve++){var Pe=J[ve].index,ie=en(F(Pe,!0)-W);if(ie<=_e)_e=ie,de=Pe;else break}return de}function F(W,J){var de=k(m(W-1)-z(W));return J?x(de):de}function q(){var W=A("left");return mn(O)[W]-mn(L)[W]+k(h(!1))}function x(W){return n.trimSpace&&e.is(_i)&&(W=gi(W,0,k(_(!0)-b()))),W}function z(W){var J=n.focus;return J==="center"?(b()-d(W,!0))/2:+J*d(W)||0}function V(W){return F(W?t.Controller.getEnd():0,!!n.trimSpace)}function K(W){var J=k(M(q(),W));return W?J>=0:J<=O[A("scrollWidth")]-mn(L)[A("width")]}function Z(W,J){J=ks(J)?q():J;var de=W!==!0&&k(J)<k(V(!1)),_e=W!==!1&&k(J)>k(V(!0));return de||_e}return{mount:p,move:v,jump:S,translate:$,shift:M,cancel:N,toIndex:B,toPosition:F,getPosition:q,getLimit:V,exceededLimit:Z,reposition:w}}function k8(e,t,n){var r=rt(e),o=r.on,i=r.emit,a=t.Move,u=a.getPosition,d=a.getLimit,h=a.toPosition,m=t.Slides,b=m.isEnough,_=m.getLength,T=n.omitEnd,A=e.is(xi),k=e.is(_i),I=Xe(q,!1),O=Xe(q,!0),L=n.start||0,f,p=L,w,v,S;function $(){P(),o([Ut,ht,lc],P),o(Ls,M)}function P(){w=_(!0),v=n.perMove,S=n.perPage,f=K();var ie=gi(L,0,T?f:w-1);ie!==L&&(L=ie,a.reposition())}function M(){f!==K()&&i(lc)}function N(ie,Se,Ve){if(!Pe()){var Re=F(ie),je=V(Re);je>-1&&(Se||je!==L)&&(de(je),a.move(Re,je,p,Ve))}}function B(ie,Se,Ve,Re){t.Scroll.scroll(ie,Se,Ve,function(){var je=V(a.toIndex(u()));de(T?eo(je,f):je),Re&&Re()})}function F(ie){var Se=L;if(Xr(ie)){var Ve=ie.match(/([+\-<>])(\d+)?/)||[],Re=Ve[1],je=Ve[2];Re==="+"||Re==="-"?Se=x(L+ +(""+Re+(+je||1)),L):Re===">"?Se=je?Z(+je):I(!0):Re==="<"&&(Se=O(!0))}else Se=A?ie:gi(ie,0,f);return Se}function q(ie,Se){var Ve=v||(ve()?1:S),Re=x(L+Ve*(ie?-1:1),L,!(v||ve()));return Re===-1&&k&&!Ym(u(),d(!ie),1)?ie?0:f:Se?Re:V(Re)}function x(ie,Se,Ve){if(b()||ve()){var Re=z(ie);Re!==ie&&(Se=ie,ie=Re,Ve=!1),ie<0||ie>f?!v&&(ic(0,ie,Se,!0)||ic(f,Se,ie,!0))?ie=Z(W(ie)):A?ie=Ve?ie<0?-(w%S||S):w:ie:n.rewind?ie=ie<0?f:0:ie=-1:Ve&&ie!==Se&&(ie=Z(W(Se)+(ie<Se?-1:1)))}else ie=-1;return ie}function z(ie){if(k&&n.trimSpace==="move"&&ie!==L)for(var Se=u();Se===h(ie,!0)&&ic(ie,0,e.length-1,!n.rewind);)ie<L?--ie:++ie;return ie}function V(ie){return A?(ie+w)%w||0:ie}function K(){for(var ie=w-(ve()||A&&v?1:S);T&&ie-- >0;)if(h(w-1,!0)!==h(ie,!0)){ie++;break}return gi(ie,0,w-1)}function Z(ie){return gi(ve()?ie:S*ie,0,f)}function W(ie){return ve()?eo(ie,f):uc((ie>=f?w-1:ie)/S)}function J(ie){var Se=a.toIndex(ie);return k?gi(Se,0,f):Se}function de(ie){ie!==L&&(p=L,L=ie)}function _e(ie){return ie?p:L}function ve(){return!ks(n.focus)||n.isNavigation}function Pe(){return e.state.is([Ei,xs])&&!!n.waitForTransition}return{mount:$,go:N,scroll:B,getNext:I,getPrev:O,getAdjacent:q,getEnd:K,setIndex:de,getIndex:_e,toIndex:Z,toPage:W,toDest:J,hasFocus:ve,isBusy:Pe}}var S8="http://www.w3.org/2000/svg",A8="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",nc=40;function T8(e,t,n){var r=rt(e),o=r.on,i=r.bind,a=r.emit,u=n.classes,d=n.i18n,h=t.Elements,m=t.Controller,b=h.arrows,_=h.track,T=b,A=h.prev,k=h.next,I,O,L={};function f(){w(),o(Ut,p)}function p(){v(),f()}function w(){var B=n.arrows;B&&!(A&&k)&&P(),A&&k&&(ys(L,{prev:A,next:k}),vs(T,B?"":"none"),Qn(T,O=Kd+"--"+n.direction),B&&(S(),N(),Fe([A,k],Ns,_.id),a(bc,A,k)))}function v(){r.destroy(),yr(T,O),I?(jo(b?[A,k]:T),A=k=null):Kn([A,k],Qd)}function S(){o([Er,no,ht,ro,lc],N),i(k,"click",Xe($,">")),i(A,"click",Xe($,"<"))}function $(B){m.go(B,!0)}function P(){T=b||wi("div",u.arrows),A=M(!0),k=M(!1),I=!0,As(T,[A,k]),!b&&zd(T,_)}function M(B){var F='<button class="'+u.arrow+" "+(B?u.prev:u.next)+'" type="button"><svg xmlns="'+S8+'" viewBox="0 0 '+nc+" "+nc+'" width="'+nc+'" height="'+nc+'" focusable="false"><path d="'+(n.arrowPath||A8)+'" />';return Gm(F)}function N(){if(A&&k){var B=e.index,F=m.getPrev(),q=m.getNext(),x=F>-1&&B<F?d.last:d.prev,z=q>-1&&B>q?d.first:d.next;A.disabled=F<0,k.disabled=q<0,Fe(A,bn,x),Fe(k,bn,z),a(wc,A,k,F,q)}}return{arrows:L,mount:f,destroy:v,update:N}}var $8=Dd+"-interval";function B8(e,t,n){var r=rt(e),o=r.on,i=r.bind,a=r.emit,u=kc(n.interval,e.go.bind(e,">"),S),d=u.isPaused,h=t.Elements,m=t.Elements,b=m.root,_=m.toggle,T=n.autoplay,A,k,I=T==="pause";function O(){T&&(L(),_&&Fe(_,Ns,h.track.id),I||f(),v())}function L(){n.pauseOnHover&&i(b,"mouseenter mouseleave",function(P){A=P.type==="mouseenter",w()}),n.pauseOnFocus&&i(b,"focusin focusout",function(P){k=P.type==="focusin",w()}),_&&i(_,"click",function(){I?f():p(!0)}),o([In,Cs,ht],u.rewind),o(In,$)}function f(){d()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),k=A=I=!1,v(),a(_c))}function p(P){P===void 0&&(P=!0),I=!!P,v(),d()||(u.pause(),a(xc))}function w(){I||(A||k?p(!1):f())}function v(){_&&(wr(_,Vo,!I),Fe(_,bn,n.i18n[I?"play":"pause"]))}function S(P){var M=h.bar;M&&Cn(M,"width",P*100+"%"),a(Ec,P)}function $(P){var M=t.Slides.getAt(P);u.set(M&&+Pn(M.slide,$8)||n.interval)}return{mount:O,destroy:u.cancel,play:f,pause:p,isPaused:d}}function L8(e,t,n){var r=rt(e),o=r.on;function i(){n.cover&&(o(Is,Xe(u,!0)),o([Er,Ut,ht],Xe(a,!0)))}function a(d){t.Slides.forEach(function(h){var m=Ts(h.container||h.slide,"img");m&&m.src&&u(d,m,h)})}function u(d,h,m){m.style("background",d?'center/cover no-repeat url("'+h.src+'")':"",!0),vs(h,d?"none":"")}return{mount:i,destroy:Xe(a,!1)}}var C8=10,P8=600,I8=.6,N8=1.5,O8=800;function R8(e,t,n){var r=rt(e),o=r.on,i=r.emit,a=e.state.set,u=t.Move,d=u.getPosition,h=u.getLimit,m=u.exceededLimit,b=u.translate,_=e.is(_i),T,A,k=1;function I(){o(In,p),o([Ut,ht],w)}function O(S,$,P,M,N){var B=d();if(p(),P&&(!_||!m())){var F=t.Layout.sliderSize(),q=Cd(S)*F*uc(en(S)/F)||0;S=u.toPosition(t.Controller.toDest(S%F))+q}var x=Ym(B,S,1);k=1,$=x?0:$||cc(en(S-B)/N8,O8),A=M,T=kc($,L,Xe(f,B,S,N),1),a(xs),i(Cs),T.start()}function L(){a(vi),A&&A(),i(ro)}function f(S,$,P,M){var N=d(),B=S+($-S)*v(M),F=(B-N)*k;b(N+F),_&&!P&&m()&&(k*=I8,en(F)<C8&&O(h(m(!0)),P8,!1,A,!0))}function p(){T&&T.cancel()}function w(){T&&!T.isPaused()&&(p(),L())}function v(S){var $=n.easingFunc;return $?$(S):1-Math.pow(1-S,4)}return{mount:I,destroy:p,scroll:O,cancel:w}}var mi={passive:!1,capture:!0};function U8(e,t,n){var r=rt(e),o=r.on,i=r.emit,a=r.bind,u=r.unbind,d=e.state,h=t.Move,m=t.Scroll,b=t.Controller,_=t.Elements.track,T=t.Media.reduce,A=t.Direction,k=A.resolve,I=A.orient,O=h.getPosition,L=h.exceededLimit,f,p,w,v,S,$=!1,P,M,N;function B(){a(_,Td,Bd,mi),a(_,$d,Bd,mi),a(_,h0,q,mi),a(_,"click",V,{capture:!0}),a(_,"dragstart",br),o([Er,Ut],F)}function F(){var he=n.drag;Qe(!he),v=he==="free"}function q(he){if(P=!1,!M){var Me=je(he);Re(he.target)&&(Me||!he.button)&&(b.isBusy()?br(he,!0):(N=Me?_:window,S=d.is([Ei,xs]),w=null,a(N,Td,x,mi),a(N,$d,z,mi),h.cancel(),m.cancel(),K(he)))}}function x(he){if(d.is(rc)||(d.set(rc),i(jd)),he.cancelable)if(S){h.translate(f+Ve(ve(he)));var Me=Pe(he)>jm,Ce=$!==($=L());(Me||Ce)&&K(he),P=!0,i(Hd),br(he)}else J(he)&&(S=W(he),br(he))}function z(he){d.is(rc)&&(d.set(vi),i(Vd)),S&&(Z(he),br(he)),u(N,Td,x),u(N,$d,z),S=!1}function V(he){!M&&P&&br(he,!0)}function K(he){w=p,p=he,f=O()}function Z(he){var Me=de(he),Ce=_e(Me),Ie=n.rewind&&n.rewindByDrag;T(!1),v?b.scroll(Ce,0,n.snap):e.is(Os)?b.go(I(Cd(Me))<0?Ie?"<":"-":Ie?">":"+"):e.is(_i)&&$&&Ie?b.go(L(!0)?">":"<"):b.go(b.toDest(Ce),!0),T(!0)}function W(he){var Me=n.dragMinThreshold,Ce=ms(Me),Ie=Ce&&Me.mouse||0,qe=(Ce?Me.touch:+Me)||10;return en(ve(he))>(je(he)?qe:Ie)}function J(he){return en(ve(he))>en(ve(he,!0))}function de(he){if(e.is(xi)||!$){var Me=Pe(he);if(Me&&Me<jm)return ve(he)/Me}return 0}function _e(he){return O()+Cd(he)*eo(en(he)*(n.flickPower||600),v?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function ve(he,Me){return Se(he,Me)-Se(ie(he),Me)}function Pe(he){return Ld(he)-Ld(ie(he))}function ie(he){return p===he&&w||p}function Se(he,Me){return(je(he)?he.changedTouches[0]:he)["page"+k(Me?"Y":"X")]}function Ve(he){return he/($&&e.is(_i)?m8:1)}function Re(he){var Me=n.noDrag;return!bs(he,"."+c0+", ."+Lc)&&(!Me||!bs(he,Me))}function je(he){return typeof TouchEvent<"u"&&he instanceof TouchEvent}function Et(){return S}function Qe(he){M=he}return{mount:B,disable:Qe,isDragging:Et}}var z8={Spacebar:" ",Right:Tc,Left:Ac,Up:t0,Down:n0};function Zd(e){return e=Xr(e)?e:e.key,z8[e]||e}var Hm="keydown";function M8(e,t,n){var r=rt(e),o=r.on,i=r.bind,a=r.unbind,u=e.root,d=t.Direction.resolve,h,m;function b(){_(),o(Ut,T),o(Ut,_),o(In,k)}function _(){var O=n.keyboard;O&&(h=O==="global"?window:u,i(h,Hm,I))}function T(){a(h,Hm)}function A(O){m=O}function k(){var O=m;m=!0,Vm(function(){m=O})}function I(O){if(!m){var L=Zd(O);L===d(Ac)?e.go("<"):L===d(Tc)&&e.go(">")}}return{mount:b,destroy:T,disable:A}}var gs=Dd+"-lazy",sc=gs+"-srcset",D8="["+gs+"], ["+sc+"]";function F8(e,t,n){var r=rt(e),o=r.on,i=r.off,a=r.bind,u=r.emit,d=n.lazyLoad==="sequential",h=[no,ro],m=[];function b(){n.lazyLoad&&(_(),o(ht,_))}function _(){_r(m),T(),d?O():(i(h),o(h,A),A())}function T(){t.Slides.forEach(function(L){Md(L.slide,D8).forEach(function(f){var p=Pn(f,gs),w=Pn(f,sc);if(p!==f.src||w!==f.srcset){var v=n.classes.spinner,S=f.parentElement,$=Ts(S,"."+v)||wi("span",v,S);m.push([f,L,$]),f.src||vs(f,"none")}})})}function A(){m=m.filter(function(L){var f=n.perPage*((n.preloadPages||1)+1)-1;return L[1].isWithin(e.index,f)?k(L):!0}),m.length||i(h)}function k(L){var f=L[0];Qn(L[1].slide,Nd),a(f,"load error",Xe(I,L)),Fe(f,"src",Pn(f,gs)),Fe(f,"srcset",Pn(f,sc)),Kn(f,gs),Kn(f,sc)}function I(L,f){var p=L[0],w=L[1];yr(w.slide,Nd),f.type!=="error"&&(jo(L[2]),vs(p,""),u(Is,p,w),u(Ho)),d&&O()}function O(){m.length&&k(m.shift())}return{mount:b,destroy:Xe(_r,m),check:A}}function j8(e,t,n){var r=rt(e),o=r.on,i=r.emit,a=r.bind,u=t.Slides,d=t.Elements,h=t.Controller,m=h.hasFocus,b=h.getIndex,_=h.go,T=t.Direction.resolve,A=d.pagination,k=[],I,O;function L(){f(),o([Ut,ht,lc],L);var M=n.pagination;A&&vs(A,M?"":"none"),M&&(o([In,Cs,ro],P),p(),P(),i(yc,{list:I,items:k},$(e.index)))}function f(){I&&(jo(A?to(I.children):I),yr(I,O),_r(k),I=null),r.destroy()}function p(){var M=e.length,N=n.classes,B=n.i18n,F=n.perPage,q=m()?h.getEnd()+1:_s(M/F);I=A||wi("ul",N.pagination,d.track.parentElement),Qn(I,O=Cc+"--"+S()),Fe(I,vr,"tablist"),Fe(I,bn,B.select),Fe(I,Wd,S()===$c?"vertical":"");for(var x=0;x<q;x++){var z=wi("li",null,I),V=wi("button",{class:N.page,type:"button"},z),K=u.getIn(x).map(function(W){return W.slide.id}),Z=!m()&&F>1?B.pageX:B.slideX;a(V,"click",Xe(w,x)),n.paginationKeyboard&&a(V,"keydown",Xe(v,x)),Fe(z,vr,"presentation"),Fe(V,vr,"tab"),Fe(V,Ns,K.join(" ")),Fe(V,bn,Pd(Z,x+1)),Fe(V,yi,-1),k.push({li:z,button:V,page:x})}}function w(M){_(">"+M,!0)}function v(M,N){var B=k.length,F=Zd(N),q=S(),x=-1;F===T(Tc,!1,q)?x=++M%B:F===T(Ac,!1,q)?x=(--M+B)%B:F==="Home"?x=0:F==="End"&&(x=B-1);var z=k[x];z&&(Km(z.button),_(">"+x),br(N,!0))}function S(){return n.paginationDirection||n.direction}function $(M){return k[h.toPage(M)]}function P(){var M=$(b(!0)),N=$(b());if(M){var B=M.button;yr(B,Vo),Kn(B,Um),Fe(B,yi,-1)}if(N){var F=N.button;Qn(F,Vo),Fe(F,Um,!0),Fe(F,yi,"")}i(vc,{list:I,items:k},M,N)}return{items:k,mount:L,destroy:f,getAt:$,update:P}}var H8=[" ","Enter"];function V8(e,t,n){var r=n.isNavigation,o=n.slideFocus,i=[];function a(){e.splides.forEach(function(A){A.isParent||(h(e,A.splide),h(A.splide,e))}),r&&m()}function u(){i.forEach(function(A){A.destroy()}),_r(i)}function d(){u(),a()}function h(A,k){var I=rt(A);I.on(In,function(O,L,f){k.go(k.is(xi)?f:O)}),i.push(I)}function m(){var A=rt(e),k=A.on;k(Bs,_),k(Xm,T),k([Er,Ut],b),i.push(A),A.emit(Ps,e.splides)}function b(){Fe(t.Elements.list,Wd,n.direction===$c?"vertical":"")}function _(A){e.go(A.index)}function T(A,k){Ud(H8,Zd(k))&&(_(A),br(k))}return{setup:Xe(t.Media.set,{slideFocus:ks(o)?r:o},!0),mount:a,destroy:u,remount:d}}function q8(e,t,n){var r=rt(e),o=r.bind,i=0;function a(){n.wheel&&o(t.Elements.track,"wheel",u,mi)}function u(h){if(h.cancelable){var m=h.deltaY,b=m<0,_=Ld(h),T=n.wheelMinThreshold||0,A=n.wheelSleep||0;en(m)>T&&_-i>A&&(e.go(b?"<":">"),i=_),d(b)&&br(h)}}function d(h){return!n.releaseWheel||e.state.is(Ei)||t.Controller.getAdjacent(h)!==-1}return{mount:a}}var W8=90;function Q8(e,t,n){var r=rt(e),o=r.on,i=t.Elements.track,a=n.live&&!n.isNavigation,u=wi("span",d8),d=kc(W8,Xe(m,!1));function h(){a&&(_(!t.Autoplay.isPaused()),Fe(i,Dm,!0),u.textContent="\u2026",o(_c,Xe(_,!0)),o(xc,Xe(_,!1)),o([no,ro],Xe(m,!0)))}function m(T){Fe(i,Mm,T),T?(As(i,u),d.start()):(jo(u),d.cancel())}function b(){Kn(i,[zm,Dm,Mm]),jo(u)}function _(T){a&&Fe(i,zm,T?"off":"polite")}return{mount:h,disable:_,destroy:b}}var K8=Object.freeze({__proto__:null,Media:r8,Direction:o8,Elements:b8,Slides:y8,Layout:v8,Clones:E8,Move:x8,Controller:k8,Arrows:T8,Autoplay:B8,Cover:L8,Scroll:R8,Drag:U8,Keyboard:M8,LazyLoad:F8,Pagination:j8,Sync:V8,Wheel:q8,Live:Q8}),G8={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},Z8={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:p8,i18n:G8,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Y8(e,t,n){var r=t.Slides;function o(){rt(e).on([Er,ht],i)}function i(){r.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function a(u,d){r.style("transition","opacity "+n.speed+"ms "+n.easing),Vm(d)}return{mount:o,start:a,cancel:Bd}}function J8(e,t,n){var r=t.Move,o=t.Controller,i=t.Scroll,a=t.Elements.list,u=Xe(Cn,a,"transition"),d;function h(){rt(e).bind(a,"transitionend",function(T){T.target===a&&d&&(b(),d())})}function m(T,A){var k=r.toPosition(T,!0),I=r.getPosition(),O=_(T);en(k-I)>=1&&O>=1?n.useScroll?i.scroll(k,O,!1,A):(u("transform "+O+"ms "+n.easing),r.translate(k,!0),d=A):(r.jump(T),A())}function b(){u(""),i.cancel()}function _(T){var A=n.rewindSpeed;if(e.is(_i)&&A){var k=o.getIndex(!0),I=o.getEnd();if(k===0&&T>=I||k>=I&&T===0)return A}return n.speed}return{mount:h,start:m,cancel:b}}var X8=function(){function e(n,r){this.event=rt(),this.Components={},this.state=t8(bi),this.splides=[],this._o={},this._E={};var o=Xr(n)?Zm(document,n):n;ps(o,o+" is invalid."),this.root=o,r=Jr({label:Pn(o,bn)||"",labelledby:Pn(o,qd)||""},Z8,e.defaults,r||{});try{Jr(r,JSON.parse(Pn(o,Dd)))}catch{ps(!1,"Invalid JSON")}this._o=Object.create(Jr({},r))}var t=e.prototype;return t.mount=function(r,o){var i=this,a=this.state,u=this.Components;ps(a.is([bi,ac]),"Already mounted!"),a.set(bi),this._C=u,this._T=o||this._T||(this.is(Os)?Y8:J8),this._E=r||this._E;var d=ys({},K8,this._E,{Transition:this._T});return Fo(d,function(h,m){var b=h(i,u,i._o);u[m]=b,b.setup&&b.setup()}),Fo(u,function(h){h.mount&&h.mount()}),this.emit(Er),Qn(this.root,f8),a.set(vi),this.emit(Om),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(vi)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,o){return this.event.on(r,o),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var o;return(o=this.event).emit.apply(o,[r].concat(to(arguments,1))),this},t.add=function(r,o){return this._C.Slides.add(r,o),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(ht),this},t.destroy=function(r){r===void 0&&(r=!0);var o=this.event,i=this.state;return i.is(bi)?rt(this).on(Om,this.destroy.bind(this,r)):(Fo(this._C,function(a){a.destroy&&a.destroy(r)},!0),o.emit(mc),o.destroy(),r&&_r(this.splides),i.set(ac)),this},Z3(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e}(),Pc=X8;Pc.defaults={};Pc.STATES=J3;var eE=[Er,ht,Ho,Ls,jd,Hd,Vd,Cs,ro,mc,_c,xc];function p0(e,t){let n=(r,o={})=>{t(tE(r),{splide:e,...o})};e.on(Bs,(r,o)=>{n(Bs,{Slide:r,e:o})}),e.on(In,(r,o,i)=>{n(In,{index:r,prev:o,dest:i})}),e.on(no,(r,o,i)=>{n(no,{index:r,prev:o,dest:i})}),e.on(fc,r=>{n(fc,{Slide:r})}),e.on(hc,r=>{n(hc,{Slide:r})}),e.on(pc,r=>{n(pc,{Slide:r})}),e.on(gc,r=>{n(gc,{Slide:r})}),e.on(Ut,r=>{n(Ut,r)}),e.on(bc,(r,o)=>{n(bc,{prev:r,next:o})}),e.on(wc,(r,o)=>{n(wc,{prev:r,next:o})}),e.on(yc,(r,o)=>{n(yc,{data:r,item:o})}),e.on(vc,(r,o,i)=>{n(vc,{data:r,prev:o,curr:i})}),e.on(Ps,r=>{n(Ps,{splides:r})}),e.on(Ec,r=>{n(Ec,{rate:r})}),e.on(Is,(r,o)=>{n(Is,{img:r,Slide:o})}),eE.forEach(r=>{e.on(r,()=>{n(r)})})}function tE(e){return e.split(":").map((t,n)=>n>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("").replace("Lazyload","LazyLoad")}function nE(e){let t,n=e[11].default,r=So(n,e,e[13],null);return{c(){r&&r.c()},m(o,i){r&&r.m(o,i),t=!0},p(o,i){r&&r.p&&(!t||i&8192)&&To(r,n,o,o[13],t?Ao(n,o[13],i,null):$o(o[13]),null)},i(o){t||(Ee(r,o),t=!0)},o(o){Te(r,o),t=!1},d(o){r&&r.d(o)}}}function rE(e){let t,n;return t=new Jd({props:{$$slots:{default:[oE]},$$scope:{ctx:e}}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&8192&&(i.$$scope={dirty:o,ctx:r}),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function oE(e){let t,n=e[11].default,r=So(n,e,e[13],null);return{c(){r&&r.c()},m(o,i){r&&r.m(o,i),t=!0},p(o,i){r&&r.p&&(!t||i&8192)&&To(r,n,o,o[13],t?Ao(n,o[13],i,null):$o(o[13]),null)},i(o){t||(Ee(r,o),t=!0)},o(o){Te(r,o),t=!1},d(o){r&&r.d(o)}}}function iE(e){let t,n,r,o,i,a=[rE,nE],u=[];function d(b,_){return b[1]?0:1}n=d(e,-1),r=u[n]=a[n](e);let h=[{class:o=Wn("splide",e[0])},e[3]],m={};for(let b=0;b<h.length;b+=1)m=Nt(m,h[b]);return{c(){t=ae("div"),r.c(),cr(t,m)},m(b,_){le(b,t,_),u[n].m(t,null),e[12](t),i=!0},p(b,[_]){let T=n;n=d(b,_),n===T?u[n].p(b,_):(yt(),Te(u[T],1,1,()=>{u[T]=null}),vt(),r=u[n],r?r.p(b,_):(r=u[n]=a[n](b),r.c()),Ee(r,1),r.m(t,null)),cr(t,m=Hn(h,[(!i||_&1&&o!==(o=Wn("splide",b[0])))&&{class:o},_&8&&b[3]]))},i(b){i||(Ee(r),i=!0)},o(b){Te(r),i=!1},d(b){b&&ce(t),u[n].d(),e[12](null)}}}function sE(e,t,n){let r=["class","options","splide","extensions","transition","hasTrack","go","sync"],o=ar(t,r),{$$slots:i={},$$scope:a}=t,{class:u=void 0}=t,{options:d={}}=t,{splide:h=void 0}=t,{extensions:m=void 0}=t,{transition:b=void 0}=t,{hasTrack:_=!0}=t,T=bl(),A,k,I=hs({},d);Bt(()=>(n(4,h=new Pc(A,d)),p0(h,T),h.mount(m,b),k=tc(h),()=>h.destroy())),gl(()=>{if(h){let p=tc(h);kd(k,p)||(h.refresh(),k=p.slice())}});function O(p){h?.go(p)}function L(p){h?.sync(p)}function f(p){ai[p?"unshift":"push"](()=>{A=p,n(2,A)})}return e.$$set=p=>{t=Nt(Nt({},t),oi(p)),n(3,o=ar(t,r)),"class"in p&&n(0,u=p.class),"options"in p&&n(5,d=p.options),"splide"in p&&n(4,h=p.splide),"extensions"in p&&n(6,m=p.extensions),"transition"in p&&n(7,b=p.transition),"hasTrack"in p&&n(1,_=p.hasTrack),"$$scope"in p&&n(13,a=p.$$scope)},e.$$.update=()=>{e.$$.dirty&1072&&h&&!fs(I,d)&&(n(4,h.options=d,h),n(10,I=hs({},I)))},[u,_,A,o,h,d,m,b,O,L,I,i,f,a]}var Yd=class extends nt{constructor(t){super(),ct(this,t,sE,iE,tt,{class:0,options:5,splide:4,extensions:6,transition:7,hasTrack:1,go:8,sync:9})}get class(){return this.$$.ctx[0]}set class(t){this.$$set({class:t}),Tn()}get options(){return this.$$.ctx[5]}set options(t){this.$$set({options:t}),Tn()}get splide(){return this.$$.ctx[4]}set splide(t){this.$$set({splide:t}),Tn()}get extensions(){return this.$$.ctx[6]}set extensions(t){this.$$set({extensions:t}),Tn()}get transition(){return this.$$.ctx[7]}set transition(t){this.$$set({transition:t}),Tn()}get hasTrack(){return this.$$.ctx[1]}set hasTrack(t){this.$$set({hasTrack:t}),Tn()}get go(){return this.$$.ctx[8]}get sync(){return this.$$.ctx[9]}},Rs=Yd;function aE(e){let t,n,r,o,i=e[3].default,a=So(i,e,e[2],null),u=[{class:r=Wn("splide__track",e[0])},e[1]],d={};for(let h=0;h<u.length;h+=1)d=Nt(d,u[h]);return{c(){t=ae("div"),n=ae("ul"),a&&a.c(),oe(n,"class","splide__list"),cr(t,d)},m(h,m){le(h,t,m),ne(t,n),a&&a.m(n,null),o=!0},p(h,[m]){a&&a.p&&(!o||m&4)&&To(a,i,h,h[2],o?Ao(i,h[2],m,null):$o(h[2]),null),cr(t,d=Hn(u,[(!o||m&1&&r!==(r=Wn("splide__track",h[0])))&&{class:r},m&2&&h[1]]))},i(h){o||(Ee(a,h),o=!0)},o(h){Te(a,h),o=!1},d(h){h&&ce(t),a&&a.d(h)}}}function cE(e,t,n){let r=["class"],o=ar(t,r),{$$slots:i={},$$scope:a}=t,{class:u=void 0}=t;return e.$$set=d=>{t=Nt(Nt({},t),oi(d)),n(1,o=ar(t,r)),"class"in d&&n(0,u=d.class),"$$scope"in d&&n(2,a=d.$$scope)},[u,o,a,i]}var Xd=class extends nt{constructor(t){super(),ct(this,t,cE,aE,tt,{class:0})}},Jd=Xd;function uE(e){let t,n,r,o=e[3].default,i=So(o,e,e[2],null),a=[{class:n=Wn("splide__slide",e[0])},e[1]],u={};for(let d=0;d<a.length;d+=1)u=Nt(u,a[d]);return{c(){t=ae("li"),i&&i.c(),cr(t,u)},m(d,h){le(d,t,h),i&&i.m(t,null),r=!0},p(d,[h]){i&&i.p&&(!r||h&4)&&To(i,o,d,d[2],r?Ao(o,d[2],h,null):$o(d[2]),null),cr(t,u=Hn(a,[(!r||h&1&&n!==(n=Wn("splide__slide",d[0])))&&{class:n},h&2&&d[1]]))},i(d){r||(Ee(i,d),r=!0)},o(d){Te(i,d),r=!1},d(d){d&&ce(t),i&&i.d(d)}}}function lE(e,t,n){let r=["class"],o=ar(t,r),{$$slots:i={},$$scope:a}=t,{class:u=void 0}=t;return e.$$set=d=>{t=Nt(Nt({},t),oi(d)),n(1,o=ar(t,r)),"class"in d&&n(0,u=d.class),"$$scope"in d&&n(2,a=d.$$scope)},[u,o,a,i]}var ef=class extends nt{constructor(t){super(),ct(this,t,lE,uE,tt,{class:0})}},Us=ef;var nf=class{generateSecretKey(){return gn.utils.randomPrivateKey()}getPublicKey(t){return xt(gn.getPublicKey(t))}finalizeEvent(t,n){let r=t;return r.pubkey=xt(gn.getPublicKey(n)),r.id=tf(r),r.sig=xt(gn.sign(tf(r),n)),r[zo]=!0,r}verifyEvent(t){if(typeof t[zo]=="boolean")return t[zo];let n=tf(t);if(n!==t.id)return t[zo]=!1,!1;try{let r=gn.verify(t.sig,n,t.pubkey);return t[zo]=r,r}catch{return t[zo]=!1,!1}}};function dE(e){if(!md(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function tf(e){let t=Wa(di.encode(dE(e)));return xt(t)}var Ic=new nf,a$=Ic.generateSecretKey,c$=Ic.getPublicKey,u$=Ic.finalizeEvent,l$=Ic.verifyEvent;var fE=Object.defineProperty,hE=(e,t,n)=>t in e?fE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g0=(e,t,n)=>hE(e,typeof t!="symbol"?t+"":t,n),Nc=class{constructor(){g0(this,"_locking"),g0(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let t,n=new Promise(o=>t=()=>{this._locks-=1,o()}),r=this._locking.then(()=>t);return this._locking=this._locking.then(()=>n),r}};var zs=ds(!1),Oc=ds(0),ki=class{relays;filter;#e=[];#r=Math.round(Date.now()/1e3);#t;#n={};#o=new Nc;constructor(t,n){this.relays=t,this.filter=n,this.#t=n.kinds?.[0]||1}async pluck(t,n){let r=await this.#o.lock(),o=[],i=this.#e;for(this.#e=[];i.length>0||Object.keys(this.#n).length<this.relays.length;){if(i.length<t){let a=this.relays.filter(u=>!this.#n[u]).slice(0,2);if(a.length){let u=await mr.querySync(a,{...this.filter,until:this.#r,limit:Math.floor(t*(n>(this.#t===1?20:200)?n/(this.#t===1?20:200):1)*20)});u.length===0?a.forEach(d=>{this.#n[d]=!0}):(this.#t===1&&(u=u.filter(bm)),i.push(...u),i.sort((d,h)=>d.created_at-h.created_at),this.#r=i[0]?.created_at-1)}}for(let a=i.length-1;a>=0;a--){let u=i[a];if(n>0){if(u.kind===30023){if(u.content.length<n){this.#e.push(u),i.splice(a,1);continue}}else if(!pE(u,n)){this.#e.push(u),i.splice(a,1);continue}}if(i.splice(a,1),o.push(us(u)),o.length===t)return r(),this.#e.push(...i),this.#e.sort((d,h)=>d.created_at-h.created_at),Oc.update(d=>d+o.length),zs.set(!0),o}}return this.#e.sort((a,u)=>a.created_at-u.created_at),Oc.update(a=>a+o.length),zs.set(!0),o}async fetchIds(t){let n=await mr.querySync(this.relays.slice(0,5),{ids:t});return zs.set(!0),n.map(us)}};function pE(e,t){let n=0;for(let r of ec(e.content)){switch(r.type){case"text":n+=r.text.length;case"url":case"image":case"video":case"audio":case"reference":n+=14}if(n>=t)return!0}return!1}function m0(e,t,n){let r=e.slice();return r[11]=t[n],r}function b0(e,t,n){let r=e.slice();return r[11]=t[n],r}function w0(e,t,n){let r=e.slice();return r[11]=t[n],r}function y0(e){let t,n,r,o,i=[bE,mE,gE],a=[];function u(d,h){return d[0]==="grid"||d[0]==="board"?0:d[0]==="list"||d[0]==="wall"?1:d[0]==="slide"&&d[2]?2:-1}return~(n=u(e,-1))&&(r=a[n]=i[n](e)),{c(){t=ae("section"),r&&r.c(),oe(t,"class","block notes")},m(d,h){le(d,t,h),~n&&a[n].m(t,null),o=!0},p(d,h){let m=n;n=u(d,h),n===m?~n&&a[n].p(d,h):(r&&(yt(),Te(a[m],1,1,()=>{a[m]=null}),vt()),~n?(r=a[n],r?r.p(d,h):(r=a[n]=i[n](d),r.c()),Ee(r,1),r.m(t,null)):r=null)},i(d){o||(Ee(r),o=!0)},o(d){Te(r),o=!1},d(d){d&&ce(t),~n&&a[n].d()}}}function gE(e){let t,n;return t=new Rs({props:{class:"slide",options:{type:"loop",gap:"1rem",pagination:!1,perPage:3,breakpoints:{640:{perPage:2}},autoplay:!0},$$slots:{default:[yE]},$$scope:{ctx:e}}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&262152&&(i.$$scope={dirty:o,ctx:r}),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function mE(e){let t,n,r=Je(e[3]),o=[];for(let i=0;i<r.length;i+=1)o[i]=_0(b0(e,r,i));return{c(){t=ae("div"),n=ae("ul");for(let i=0;i<o.length;i+=1)o[i].c();oe(t,"class","list")},m(i,a){le(i,t,a),ne(t,n);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(n,null)},p(i,a){if(a&9){r=Je(i[3]);let u;for(u=0;u<r.length;u+=1){let d=b0(i,r,u);o[u]?o[u].p(d,a):(o[u]=_0(d),o[u].c(),o[u].m(n,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=r.length}},i:De,o:De,d(i){i&&ce(t),Jt(o,i)}}}function bE(e){let t,n,r=e[0]!=="board"&&E0(e);return{c(){t=ae("div"),r&&r.c(),oe(t,"class",n="grid "+(e[0]==="board"?"full-notes":""))},m(o,i){le(o,t,i),r&&r.m(t,null),e[9](t)},p(o,i){o[0]!=="board"?r?r.p(o,i):(r=E0(o),r.c(),r.m(t,null)):r&&(r.d(1),r=null),i&1&&n!==(n="grid "+(o[0]==="board"?"full-notes":""))&&oe(t,"class",n)},i:De,o:De,d(o){o&&ce(t),r&&r.d(),e[9](null)}}}function wE(e){let t,n,r=Xt(e[11].created_at,!0)+"",o,i,a,u=e[11].summary+"",d,h,m;return{c(){t=ae("a"),n=ae("div"),o=ze(r),i=Ne(),a=ae("div"),d=ze(u),m=Ne(),oe(n,"class","date"),oe(a,"class","summary"),oe(t,"href",h=`#${e[11].id}`)},m(b,_){le(b,t,_),ne(t,n),ne(n,o),ne(t,i),ne(t,a),ne(a,d),le(b,m,_)},p(b,_){_&8&&r!==(r=Xt(b[11].created_at,!0)+"")&&Ze(o,r),_&8&&u!==(u=b[11].summary+"")&&Ze(d,u),_&8&&h!==(h=`#${b[11].id}`)&&oe(t,"href",h)},d(b){b&&(ce(t),ce(m))}}}function v0(e){let t,n;return t=new Us({props:{$$slots:{default:[wE]},$$scope:{ctx:e}}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&262152&&(i.$$scope={dirty:o,ctx:r}),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function yE(e){let t,n,r=Je(e[3]),o=[];for(let a=0;a<r.length;a+=1)o[a]=v0(m0(e,r,a));let i=a=>Te(o[a],1,1,()=>{o[a]=null});return{c(){for(let a=0;a<o.length;a+=1)o[a].c();t=$t()},m(a,u){for(let d=0;d<o.length;d+=1)o[d]&&o[d].m(a,u);le(a,t,u),n=!0},p(a,u){if(u&8){r=Je(a[3]);let d;for(d=0;d<r.length;d+=1){let h=m0(a,r,d);o[d]?(o[d].p(h,u),Ee(o[d],1)):(o[d]=v0(h),o[d].c(),Ee(o[d],1),o[d].m(t.parentNode,t))}for(yt(),d=r.length;d<o.length;d+=1)i(d);vt()}},i(a){if(!n){for(let u=0;u<r.length;u+=1)Ee(o[u]);n=!0}},o(a){o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)Te(o[u]);n=!1},d(a){a&&ce(t),Jt(o,a)}}}function vE(e){let t,n=e[11].summary+"",r;return{c(){t=ae("div"),r=ze(n),oe(t,"class","summary")},m(o,i){le(o,t,i),ne(t,r)},p(o,i){i&8&&n!==(n=o[11].summary+"")&&Ze(r,n)},d(o){o&&ce(t)}}}function _E(e){let t,n=e[11].renderedContent+"";return{c(){t=ae("div"),oe(t,"class","content")},m(r,o){le(r,t,o),t.innerHTML=n},p(r,o){o&8&&n!==(n=r[11].renderedContent+"")&&(t.innerHTML=n)},d(r){r&&ce(t)}}}function _0(e){let t,n,r,o=e[11].title+"",i,a,u,d,h;function m(T,A){return T[0]==="wall"?_E:vE}let b=m(e,-1),_=b(e);return{c(){t=ae("li"),n=ae("a"),r=ae("h2"),i=ze(o),a=Ne(),_.c(),d=Ne(),oe(n,"href",u=`#${e[11].id}`),oe(t,"class",h=e[0]==="wall"?"fullNote":"")},m(T,A){le(T,t,A),ne(t,n),ne(n,r),ne(r,i),ne(n,a),_.m(n,null),ne(t,d)},p(T,A){A&8&&o!==(o=T[11].title+"")&&Ze(i,o),b===(b=m(T,A))&&_?_.p(T,A):(_.d(1),_=b(T),_&&(_.c(),_.m(n,null))),A&8&&u!==(u=`#${T[11].id}`)&&oe(n,"href",u),A&1&&h!==(h=T[0]==="wall"?"fullNote":"")&&oe(t,"class",h)},d(T){T&&ce(t),_.d()}}}function E0(e){let t,n=Je(e[3]),r=[];for(let o=0;o<n.length;o+=1)r[o]=S0(w0(e,n,o));return{c(){for(let o=0;o<r.length;o+=1)r[o].c();t=$t()},m(o,i){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(o,i);le(o,t,i)},p(o,i){if(i&10){n=Je(o[3]);let a;for(a=0;a<n.length;a+=1){let u=w0(o,n,a);r[a]?r[a].p(u,i):(r[a]=S0(u),r[a].c(),r[a].m(t.parentNode,t))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},d(o){o&&ce(t),Jt(r,o)}}}function x0(e){let t,n;return{c(){t=ae("img"),Ot(t.src,n=e[11].image)||oe(t,"src",n)},m(r,o){le(r,t,o)},p(r,o){o&8&&!Ot(t.src,n=r[11].image)&&oe(t,"src",n)},d(r){r&&ce(t)}}}function k0(e){let t;return{c(){t=ae("span"),t.textContent="- \u{1F4CC} Pinned",oe(t,"class","pinned")},m(n,r){le(n,t,r)},d(n){n&&ce(t)}}}function S0(e){let t,n,r,o,i=e[11].title+"",a,u,d,h=e[11].summary+"",m,b,_=e[1]&&e[1].some(k),T,A;function k(...L){return e[8](e[11],...L)}let I=e[11].image&&x0(e),O=_&&k0(e);return{c(){t=ae("div"),n=ae("a"),I&&I.c(),r=Ne(),o=ae("h2"),a=ze(i),u=Ne(),d=ae("div"),m=ze(h),b=Ne(),O&&O.c(),A=Ne(),oe(d,"class","summary"),oe(n,"href",T=`#${e[11].id}`),oe(t,"class","item")},m(L,f){le(L,t,f),ne(t,n),I&&I.m(n,null),ne(n,r),ne(n,o),ne(o,a),ne(n,u),ne(n,d),ne(d,m),ne(n,b),O&&O.m(n,null),ne(t,A)},p(L,f){e=L,e[11].image?I?I.p(e,f):(I=x0(e),I.c(),I.m(n,r)):I&&(I.d(1),I=null),f&8&&i!==(i=e[11].title+"")&&Ze(a,i),f&8&&h!==(h=e[11].summary+"")&&Ze(m,h),f&10&&(_=e[1]&&e[1].some(k)),_?O||(O=k0(e),O.c(),O.m(n,null)):O&&(O.d(1),O=null),f&8&&T!==(T=`#${e[11].id}`)&&oe(n,"href",T)},d(L){L&&ce(t),I&&I.d(),O&&O.d()}}}function EE(e){let t,n,r=e[3].length>0&&y0(e);return{c(){r&&r.c(),t=$t()},m(o,i){r&&r.m(o,i),le(o,t,i),n=!0},p(o,[i]){o[3].length>0?r?(r.p(o,i),i&8&&Ee(r,1)):(r=y0(o),r.c(),Ee(r,1),r.m(t.parentNode,t)):r&&(yt(),Te(r,1,1,()=>{r=null}),vt())},i(o){n||(Ee(r),n=!0)},o(o){Te(r),n=!1},d(o){o&&ce(t),r&&r.d(o)}}}function xE(e,t,n){let{source:r}=t,{count:o}=t,{style:i}=t,{minChars:a}=t,{ids:u=void 0}=t,{noMoreEvents:d=!1}=t,h=[];Bt(()=>{(async()=>{if(u)n(0,i="grid"),n(3,h=await r.fetchIds(u));else{n(3,h=await r.pluck(o,a));let A=[];if(i==="board"||i==="wall"){for(let k of h)A.push(await wm(k));n(3,h=A)}}})()});let m;async function b(){if(i!=="board"||!m)return;await _l(),n(4,m.innerHTML="",m);let A=[document.createElement("div"),document.createElement("div")];A.forEach((I,O)=>{I.classList.add("board-column"),m.appendChild(I)});let k=[0,0];h.forEach((I,O)=>{let L=document.createElement("div");L.classList.add("item");let f=document.createElement("a");if(f.href=`#${I.id}`,I.image){let P=document.createElement("img");P.src=I.image,f.appendChild(P)}let p=document.createElement("h2");p.textContent=I.title,f.appendChild(p);let w=document.createElement("div");w.classList.add("content"),w.innerHTML=I.renderedContent;let v=document.createElement("div");v.innerHTML=I.renderedContent,v.style.position="absolute",v.style.visibility="hidden",document.body.appendChild(v);let S=v.offsetHeight;if(document.body.removeChild(v),S>window.innerHeight*.8){w.classList.add("cropped"),w.style.maxHeight="80vh",w.style.position="relative",w.style.overflow="hidden";let P=document.createElement("div");P.classList.add("content-fade"),w.appendChild(P)}if(f.appendChild(w),u&&u.some(P=>I.id.endsWith(P))){let P=document.createElement("span");P.classList.add("pinned"),P.textContent="- \u{1F4CC} Pinned",f.appendChild(P)}L.appendChild(f);let $=k[0]<=k[1]?0:1;A[$].appendChild(L),k[$]+=400}),h.length%2!==0&&m.classList.add("odd")}Bt(()=>{let A=()=>{i=="board"&&b()};return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)});let _=(A,k)=>A.id.endsWith(k);function T(A){ai[A?"unshift":"push"](()=>{m=A,n(4,m)})}return e.$$set=A=>{"source"in A&&n(5,r=A.source),"count"in A&&n(6,o=A.count),"style"in A&&n(0,i=A.style),"minChars"in A&&n(7,a=A.minChars),"ids"in A&&n(1,u=A.ids),"noMoreEvents"in A&&n(2,d=A.noMoreEvents)},e.$$.update=()=>{e.$$.dirty&9&&h.length>0&&i=="board"&&b()},[i,u,d,h,m,r,o,a,_,T]}var rf=class extends nt{constructor(t){super(),ct(this,t,xE,EE,tt,{source:5,count:6,style:0,minChars:7,ids:1,noMoreEvents:2})}},of=rf;function A0(e,t,n){let r=e.slice();return r[7]=t[n],r}function T0(e,t,n){let r=e.slice();return r[7]=t[n],r}function $0(e,t,n){let r=e.slice();return r[7]=t[n],r}function B0(e){let t,n,r,o,i=[AE,SE,kE],a=[];function u(d,h){return d[0]==="grid"?0:d[0]==="list"?1:d[0]==="slide"?2:-1}return~(n=u(e,-1))&&(r=a[n]=i[n](e)),{c(){t=ae("section"),r&&r.c(),oe(t,"class","block images")},m(d,h){le(d,t,h),~n&&a[n].m(t,null),o=!0},p(d,h){let m=n;n=u(d,h),n===m?~n&&a[n].p(d,h):(r&&(yt(),Te(a[m],1,1,()=>{a[m]=null}),vt()),~n?(r=a[n],r?r.p(d,h):(r=a[n]=i[n](d),r.c()),Ee(r,1),r.m(t,null)):r=null)},i(d){o||(Ee(r),o=!0)},o(d){Te(r),o=!1},d(d){d&&ce(t),~n&&a[n].d()}}}function kE(e){let t,n;return t=new Rs({props:{class:"short-notes",options:{type:"loop",gap:"1rem",pagination:!1,perPage:3,breakpoints:{640:{perPage:2}},autoplay:!0},$$slots:{default:[$E]},$$scope:{ctx:e}}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&16388&&(i.$$scope={dirty:o,ctx:r}),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function SE(e){let t,n,r=Je(e[2]),o=[];for(let i=0;i<r.length;i+=1)o[i]=C0(T0(e,r,i));return{c(){t=ae("div"),n=ae("ul");for(let i=0;i<o.length;i+=1)o[i].c();oe(t,"class","list")},m(i,a){le(i,t,a),ne(t,n);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(n,null)},p(i,a){if(a&4){r=Je(i[2]);let u;for(u=0;u<r.length;u+=1){let d=T0(i,r,u);o[u]?o[u].p(d,a):(o[u]=C0(d),o[u].c(),o[u].m(n,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=r.length}},i:De,o:De,d(i){i&&ce(t),Jt(o,i)}}}function AE(e){let t,n,r=Je(e[2]),o=[];for(let i=0;i<r.length;i+=1)o[i]=N0($0(e,r,i));return{c(){t=ae("div");for(let i=0;i<o.length;i+=1)o[i].c();oe(t,"class",n="grid "+(e[2].length%2!==0?"odd":"")+" "+(e[2].length==1?"single":""))},m(i,a){le(i,t,a);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(t,null)},p(i,a){if(a&6){r=Je(i[2]);let u;for(u=0;u<r.length;u+=1){let d=$0(i,r,u);o[u]?o[u].p(d,a):(o[u]=N0(d),o[u].c(),o[u].m(t,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=r.length}a&4&&n!==(n="grid "+(i[2].length%2!==0?"odd":"")+" "+(i[2].length==1?"single":""))&&oe(t,"class",n)},i:De,o:De,d(i){i&&ce(t),Jt(o,i)}}}function TE(e){let t,n,r=Xt(e[7].created_at,!0)+"",o,i,a=e[7].summary+"",u,d,h;return{c(){t=ae("a"),n=ae("div"),o=ze(r),i=Ne(),u=ze(a),h=Ne(),oe(n,"class","date"),oe(t,"href",d=`#${e[7].id}`)},m(m,b){le(m,t,b),ne(t,n),ne(n,o),ne(t,i),ne(t,u),le(m,h,b)},p(m,b){b&4&&r!==(r=Xt(m[7].created_at,!0)+"")&&Ze(o,r),b&4&&a!==(a=m[7].summary+"")&&Ze(u,a),b&4&&d!==(d=`#${m[7].id}`)&&oe(t,"href",d)},d(m){m&&(ce(t),ce(h))}}}function L0(e){let t,n;return t=new Us({props:{$$slots:{default:[TE]},$$scope:{ctx:e}}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&16388&&(i.$$scope={dirty:o,ctx:r}),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function $E(e){let t,n,r=Je(e[2]),o=[];for(let a=0;a<r.length;a+=1)o[a]=L0(A0(e,r,a));let i=a=>Te(o[a],1,1,()=>{o[a]=null});return{c(){for(let a=0;a<o.length;a+=1)o[a].c();t=$t()},m(a,u){for(let d=0;d<o.length;d+=1)o[d]&&o[d].m(a,u);le(a,t,u),n=!0},p(a,u){if(u&4){r=Je(a[2]);let d;for(d=0;d<r.length;d+=1){let h=A0(a,r,d);o[d]?(o[d].p(h,u),Ee(o[d],1)):(o[d]=L0(h),o[d].c(),Ee(o[d],1),o[d].m(t.parentNode,t))}for(yt(),d=r.length;d<o.length;d+=1)i(d);vt()}},i(a){if(!n){for(let u=0;u<r.length;u+=1)Ee(o[u]);n=!0}},o(a){o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)Te(o[u]);n=!1},d(a){a&&ce(t),Jt(o,a)}}}function C0(e){let t,n,r,o=e[7].title+"",i,a,u,d,h=e[7].summary+"",m,b;return{c(){t=ae("li"),n=ae("h2"),r=ae("a"),i=ze(o),u=Ne(),d=ae("div"),m=ze(h),b=Ne(),oe(r,"href",a=`#${e[7].id}`),oe(d,"class","summary")},m(_,T){le(_,t,T),ne(t,n),ne(n,r),ne(r,i),ne(t,u),ne(t,d),ne(d,m),ne(t,b)},p(_,T){T&4&&o!==(o=_[7].title+"")&&Ze(i,o),T&4&&a!==(a=`#${_[7].id}`)&&oe(r,"href",a),T&4&&h!==(h=_[7].summary+"")&&Ze(m,h)},d(_){_&&ce(t)}}}function P0(e){let t,n=e[7].title+"",r;return{c(){t=ae("div"),r=ze(n),oe(t,"class","title")},m(o,i){le(o,t,i),ne(t,r)},p(o,i){i&4&&n!==(n=o[7].title+"")&&Ze(r,n)},d(o){o&&ce(t)}}}function I0(e){let t;return{c(){t=ae("span"),t.textContent="- \u{1F4CC} Pinned",oe(t,"class","pinned")},m(n,r){le(n,t,r)},d(n){n&&ce(t)}}}function N0(e){let t,n,r,o,i,a,u,d=Xt(e[7].created_at)+"",h,m,b=e[1]&&e[1].some(A),_,T;function A(...O){return e[6](e[7],...O)}let k=!e[7].autogeneratedTitle&&e[7].title&&P0(e),I=b&&I0(e);return{c(){t=ae("div"),n=ae("a"),r=ae("img"),i=Ne(),k&&k.c(),a=Ne(),u=ae("span"),h=ze(d),m=Ne(),I&&I.c(),T=Ne(),Ot(r.src,o=e[7].image)||oe(r,"src",o),oe(u,"class","date"),oe(n,"href",_=`#${e[7].id}`),oe(t,"class","item")},m(O,L){le(O,t,L),ne(t,n),ne(n,r),ne(n,i),k&&k.m(n,null),ne(n,a),ne(n,u),ne(u,h),ne(n,m),I&&I.m(n,null),ne(t,T)},p(O,L){e=O,L&4&&!Ot(r.src,o=e[7].image)&&oe(r,"src",o),!e[7].autogeneratedTitle&&e[7].title?k?k.p(e,L):(k=P0(e),k.c(),k.m(n,a)):k&&(k.d(1),k=null),L&4&&d!==(d=Xt(e[7].created_at)+"")&&Ze(h,d),L&6&&(b=e[1]&&e[1].some(A)),b?I||(I=I0(e),I.c(),I.m(n,null)):I&&(I.d(1),I=null),L&4&&_!==(_=`#${e[7].id}`)&&oe(n,"href",_)},d(O){O&&ce(t),k&&k.d(),I&&I.d()}}}function BE(e){let t,n,r=e[2].length>0&&B0(e);return{c(){r&&r.c(),t=$t()},m(o,i){r&&r.m(o,i),le(o,t,i),n=!0},p(o,[i]){o[2].length>0?r?(r.p(o,i),i&4&&Ee(r,1)):(r=B0(o),r.c(),Ee(r,1),r.m(t.parentNode,t)):r&&(yt(),Te(r,1,1,()=>{r=null}),vt())},i(o){n||(Ee(r),n=!0)},o(o){Te(r),n=!1},d(o){o&&ce(t),r&&r.d(o)}}}function LE(e,t,n){let{source:r}=t,{count:o}=t,{style:i}=t,{minChars:a}=t,{ids:u=void 0}=t,d=[];Bt(()=>{(async()=>u?(n(0,i="grid"),n(2,d=await r.fetchIds(u))):n(2,d=await r.pluck(o,a)))()});let h=(m,b)=>m.id.endsWith(b);return e.$$set=m=>{"source"in m&&n(3,r=m.source),"count"in m&&n(4,o=m.count),"style"in m&&n(0,i=m.style),"minChars"in m&&n(5,a=m.minChars),"ids"in m&&n(1,u=m.ids)},[i,u,d,r,o,a,h]}var sf=class extends nt{constructor(t){super(),ct(this,t,LE,BE,tt,{source:3,count:4,style:0,minChars:5,ids:1})}},af=sf;function O0(e,t,n){let r=e.slice();return r[11]=t[n],r}function R0(e,t,n){let r=e.slice();return r[14]=t[n],r}function U0(e){let t,n,r,o,i=e[2].slice(0,9)+"..."+e[2].slice(-5),a,u,d,h,m,b,_,T,A=e[1]?.shortName+"",k;return{c(){t=ae("div"),n=ae("div"),r=ze("Profile: "),o=ae("a"),a=ze(i),d=Ne(),h=ae("h1"),m=ae("div"),b=ae("img"),T=Ne(),k=ze(A),oe(o,"href",u="https://njump.me/"+e[2]),oe(n,"class","external-link"),Ot(b.src,_=e[1]?.image)||oe(b,"src",_),oe(m,"class","picture-container"),oe(t,"class","header home")},m(I,O){le(I,t,O),ne(t,n),ne(n,r),ne(n,o),ne(o,a),ne(t,d),ne(t,h),ne(h,m),ne(m,b),ne(h,T),ne(h,k)},p(I,O){O&4&&i!==(i=I[2].slice(0,9)+"..."+I[2].slice(-5))&&Ze(a,i),O&4&&u!==(u="https://njump.me/"+I[2])&&oe(o,"href",u),O&2&&!Ot(b.src,_=I[1]?.image)&&oe(b,"src",_),O&2&&A!==(A=I[1]?.shortName+"")&&Ze(k,A)},d(I){I&&ce(t)}}}function z0(e){let t,n,r,o,i,a,u=Je(e[3]),d=[];for(let h=0;h<u.length;h+=1)d[h]=M0(R0(e,u,h));return{c(){t=ae("div"),n=ae("div"),r=ae("a"),o=ze("Home"),a=Ne();for(let h=0;h<d.length;h+=1)d[h].c();oe(r,"href","#"),oe(r,"class",i=e[0]==""?"selected":""),oe(t,"class","topic-wrapper svelte-1ifx1we"),Bo(t,"hidden",!e[8])},m(h,m){le(h,t,m),ne(t,n),ne(n,r),ne(r,o),ne(t,a);for(let b=0;b<d.length;b+=1)d[b]&&d[b].m(t,null)},p(h,m){if(m&1&&i!==(i=h[0]==""?"selected":"")&&oe(r,"class",i),m&9){u=Je(h[3]);let b;for(b=0;b<u.length;b+=1){let _=R0(h,u,b);d[b]?d[b].p(_,m):(d[b]=M0(_),d[b].c(),d[b].m(t,null))}for(;b<d.length;b+=1)d[b].d(1);d.length=u.length}m&256&&Bo(t,"hidden",!h[8])},d(h){h&&ce(t),Jt(d,h)}}}function M0(e){let t,n,r,o=e[14]+"",i,a,u;return{c(){t=ae("div"),n=ae("a"),r=ze("#"),i=ze(o),oe(n,"href",a="#tags/"+e[14]),oe(n,"class",u=e[14]==e[0]?"selected":"")},m(d,h){le(d,t,h),ne(t,n),ne(n,r),ne(n,i)},p(d,h){h&8&&o!==(o=d[14]+"")&&Ze(i,o),h&8&&a!==(a="#tags/"+d[14])&&oe(n,"href",a),h&9&&u!==(u=d[14]==d[0]?"selected":"")&&oe(n,"class",u)},d(d){d&&ce(t)}}}function D0(e){let t,n,r=Je(e[4]),o=[];for(let a=0;a<r.length;a+=1)o[a]=F0(O0(e,r,a));let i=a=>Te(o[a],1,1,()=>{o[a]=null});return{c(){t=ae("div");for(let a=0;a<o.length;a+=1)o[a].c();oe(t,"class","svelte-1ifx1we"),Bo(t,"hidden",!e[8])},m(a,u){le(a,t,u);for(let d=0;d<o.length;d+=1)o[d]&&o[d].m(t,null);n=!0},p(a,u){if(u&496){r=Je(a[4]);let d;for(d=0;d<r.length;d+=1){let h=O0(a,r,d);o[d]?(o[d].p(h,u),Ee(o[d],1)):(o[d]=F0(h),o[d].c(),Ee(o[d],1),o[d].m(t,null))}for(yt(),d=r.length;d<o.length;d+=1)i(d);vt()}(!n||u&256)&&Bo(t,"hidden",!a[8])},i(a){if(!n){for(let u=0;u<r.length;u+=1)Ee(o[u]);n=!0}},o(a){o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)Te(o[u]);n=!1},d(a){a&&ce(t),Jt(o,a)}}}function CE(e){let t,n,r=[{source:e[6]},e[11].config],o={};for(let i=0;i<r.length;i+=1)o=Nt(o,r[i]);return t=new af({props:o}),{c(){ft(t.$$.fragment)},m(i,a){st(t,i,a),n=!0},p(i,a){let u=a&80?Hn(r,[a&64&&{source:i[6]},a&16&&wa(i[11].config)]):{};t.$set(u)},i(i){n||(Ee(t.$$.fragment,i),n=!0)},o(i){Te(t.$$.fragment,i),n=!1},d(i){at(t,i)}}}function PE(e){let t,n,r=[{source:e[5]},e[11].config,{noMoreEvents:e[8]}],o={};for(let i=0;i<r.length;i+=1)o=Nt(o,r[i]);return t=new of({props:o}),{c(){ft(t.$$.fragment)},m(i,a){st(t,i,a),n=!0},p(i,a){let u=a&304?Hn(r,[a&32&&{source:i[5]},a&16&&wa(i[11].config),a&256&&{noMoreEvents:i[8]}]):{};t.$set(u)},i(i){n||(Ee(t.$$.fragment,i),n=!0)},o(i){Te(t.$$.fragment,i),n=!1},d(i){at(t,i)}}}function IE(e){let t,n,r=[{source:e[7]},e[11].config],o={};for(let i=0;i<r.length;i+=1)o=Nt(o,r[i]);return t=new Ed({props:o}),{c(){ft(t.$$.fragment)},m(i,a){st(t,i,a),n=!0},p(i,a){let u=a&144?Hn(r,[a&128&&{source:i[7]},a&16&&wa(i[11].config)]):{};t.$set(u)},i(i){n||(Ee(t.$$.fragment,i),n=!0)},o(i){Te(t.$$.fragment,i),n=!1},d(i){at(t,i)}}}function F0(e){let t,n,r,o,i=[IE,PE,CE],a=[];function u(d,h){return d[11].type==="articles"?0:d[11].type==="notes"?1:d[11].type==="images"?2:-1}return~(t=u(e,-1))&&(n=a[t]=i[t](e)),{c(){n&&n.c(),r=$t()},m(d,h){~t&&a[t].m(d,h),le(d,r,h),o=!0},p(d,h){let m=t;t=u(d,h),t===m?~t&&a[t].p(d,h):(n&&(yt(),Te(a[m],1,1,()=>{a[m]=null}),vt()),~t?(n=a[t],n?n.p(d,h):(n=a[t]=i[t](d),n.c()),Ee(n,1),n.m(r.parentNode,r)):n=null)},i(d){o||(Ee(n),o=!0)},o(d){Te(n),o=!1},d(d){d&&ce(r),~t&&a[t].d(d)}}}function j0(e){let t,n,r,o,i,a;return t=new Ed({props:{source:e[7],minChars:10,count:40,style:"grid"}}),r=new af({props:{source:e[6],minChars:0,count:40,style:"grid"}}),i=new of({props:{source:e[5],minChars:0,count:40,style:"grid"}}),{c(){ft(t.$$.fragment),n=Ne(),ft(r.$$.fragment),o=Ne(),ft(i.$$.fragment)},m(u,d){st(t,u,d),le(u,n,d),st(r,u,d),le(u,o,d),st(i,u,d),a=!0},p(u,d){let h={};d&128&&(h.source=u[7]),t.$set(h);let m={};d&64&&(m.source=u[6]),r.$set(m);let b={};d&32&&(b.source=u[5]),i.$set(b)},i(u){a||(Ee(t.$$.fragment,u),Ee(r.$$.fragment,u),Ee(i.$$.fragment,u),a=!0)},o(u){Te(t.$$.fragment,u),Te(r.$$.fragment,u),Te(i.$$.fragment,u),a=!1},d(u){u&&(ce(n),ce(o)),at(t,u),at(r,u),at(i,u)}}}function NE(e){let t,n,r,o,i,a,u,d=e[1]&&U0(e),h=e[3].length>0&&z0(e),m=e[4]&&D0(e),b=e[0].length>0&&e[8]&&e[9]<12&&j0(e);return a=new ym({}),{c(){d&&d.c(),t=Ne(),h&&h.c(),n=Ne(),m&&m.c(),r=Ne(),b&&b.c(),o=Ne(),i=ae("div"),ft(a.$$.fragment),oe(i,"class","svelte-1ifx1we"),Bo(i,"hidden",e[8])},m(_,T){d&&d.m(_,T),le(_,t,T),h&&h.m(_,T),le(_,n,T),m&&m.m(_,T),le(_,r,T),b&&b.m(_,T),le(_,o,T),le(_,i,T),st(a,i,null),u=!0},p(_,[T]){_[1]?d?d.p(_,T):(d=U0(_),d.c(),d.m(t.parentNode,t)):d&&(d.d(1),d=null),_[3].length>0?h?h.p(_,T):(h=z0(_),h.c(),h.m(n.parentNode,n)):h&&(h.d(1),h=null),_[4]?m?(m.p(_,T),T&16&&Ee(m,1)):(m=D0(_),m.c(),Ee(m,1),m.m(r.parentNode,r)):m&&(yt(),Te(m,1,1,()=>{m=null}),vt()),_[0].length>0&&_[8]&&_[9]<12?b?(b.p(_,T),T&769&&Ee(b,1)):(b=j0(_),b.c(),Ee(b,1),b.m(o.parentNode,o)):b&&(yt(),Te(b,1,1,()=>{b=null}),vt()),(!u||T&256)&&Bo(i,"hidden",_[8])},i(_){u||(Ee(m),Ee(b),Ee(a.$$.fragment,_),u=!0)},o(_){Te(m),Te(b),Te(a.$$.fragment,_),u=!1},d(_){_&&(ce(t),ce(n),ce(r),ce(o),ce(i)),d&&d.d(_),h&&h.d(_),m&&m.d(_),b&&b.d(_),at(a)}}}function OE(e,t,n){let r,o;fl(e,zs,A=>n(8,r=A)),fl(e,Oc,A=>n(9,o=A));let i="",a=[],u,d,h,m,{tag:b}=t,{profile:_}=t,{config:T}=t;return Bt(()=>{if(!_)throw new Error("invalid npub");n(2,i=T.npub),n(3,a=T.topics),n(4,u=T.blocks),pi.set(_.shortName+" home, powered by Nostr");let A=b?{"#t":[b.substring(5)]}:{};n(5,d=new ki(T.writeRelays,{kinds:[1],authors:[_.pubkey],...A})),n(6,h=new ki(T.writeRelays,{kinds:[20],authors:[_.pubkey],...A})),n(7,m=new ki(T.writeRelays,{kinds:[30023],authors:[_.pubkey],...A}))}),e.$$set=A=>{"tag"in A&&n(0,b=A.tag),"profile"in A&&n(1,_=A.profile),"config"in A&&n(10,T=A.config)},pi.subscribe(A=>{document.title=A}),[b,_,i,a,u,d,h,m,r,o,T]}var cf=class extends nt{constructor(t){super(),ct(this,t,OE,NE,tt,{tag:0,profile:1,config:10})}},uf=cf;var RE=Object.defineProperty,UE=(e,t,n)=>t in e?RE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,we=(e,t,n)=>(UE(e,typeof t!="symbol"?t+"":t,n),n),zE=(e,t)=>e===t,nn=Symbol("solid-proxy"),Qs=Symbol("solid-track"),Hc={equals:zE},vb=Sb,Tr=1,Vc=2,_b={owned:null,cleanups:null,context:null,owner:null},lf={},it=null,df=null,ot=null,Vt=null,kr=null,ou=0;function $f(e,t){let n=ot,r=it,o=e.length===0,i=t===void 0?r:t,a=o?_b:{owned:null,cleanups:null,context:i?i.context:null,owner:i},u=o?e:()=>e(()=>kn(()=>su(a)));it=a,ot=null;try{return ho(u,!0)}finally{ot=n,it=r}}function _t(e,t){t=t?Object.assign({},Hc,t):Hc;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),kb(n,o));return[xb.bind(n),r]}function uo(e,t,n){let r=iu(e,t,!0,Tr);Fi(r)}function En(e,t,n){let r=iu(e,t,!1,Tr);Fi(r)}function Ni(e,t,n){vb=HE;let r=iu(e,t,!1,Tr),o=Bf&&DE(Bf);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),kr?kr.push(r):Fi(r)}function We(e,t,n){n=n?Object.assign({},Hc,n):Hc;let r=iu(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Fi(r),xb.bind(r)}function ME(e){return e&&typeof e=="object"&&"then"in e}function Eb(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let a=null,u=lf,d=!1,h="initialValue"in i,m=typeof r=="function"&&We(r),b=new Set,[_,T]=(i.storage||_t)(i.initialValue),[A,k]=_t(void 0),[I,O]=_t(void 0,{equals:!1}),[L,f]=_t(h?"ready":"unresolved");function p($,P,M,N){return a===$&&(a=null,N!==void 0&&(h=!0),($===u||P===u)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(N,{value:P})),u=lf,w(P,M)),P}function w($,P){ho(()=>{P===void 0&&T(()=>$),f(P!==void 0?"errored":h?"ready":"unresolved"),k(P);for(let M of b.keys())M.decrement();b.clear()},!1)}function v(){let $=Bf,P=_(),M=A();if(M!==void 0&&!a)throw M;return ot&&!ot.user&&$&&uo(()=>{I(),a&&($.resolved||b.has($)||($.increment(),b.add($)))}),P}function S($=!0){if($!==!1&&d)return;d=!1;let P=m?m():r;if(P==null||P===!1){p(a,kn(_));return}let M=u!==lf?u:kn(()=>o(P,{value:_(),refetching:$}));return ME(M)?(a=M,"value"in M?(M.status==="success"?p(a,M.value,void 0,P):p(a,void 0,void 0,P),M):(d=!0,queueMicrotask(()=>d=!1),ho(()=>{f(h?"refreshing":"pending"),O()},!1),M.then(N=>p(M,N,void 0,P),N=>p(M,void 0,Tb(N),P)))):(p(a,M,void 0,P),M)}return Object.defineProperties(v,{state:{get:()=>L()},error:{get:()=>A()},loading:{get(){let $=L();return $==="pending"||$==="refreshing"}},latest:{get(){if(!h)return v();let $=A();if($&&!a)throw $;return _()}}}),m?uo(()=>S(!1)):S(!1),[v,{refetch:S,mutate:T}]}function Bi(e){return ho(e,!1)}function kn(e){if(ot===null)return e();let t=ot;ot=null;try{return e()}finally{ot=t}}function lo(e,t,n){let r=Array.isArray(e),o,i=n&&n.defer;return a=>{let u;if(r){u=Array(e.length);for(let h=0;h<e.length;h++)u[h]=e[h]()}else u=e();if(i){i=!1;return}let d=kn(()=>t(u,o,a));return o=u,d}}function Li(e){return it===null||(it.cleanups===null?it.cleanups=[e]:it.cleanups.push(e)),e}function Oi(){return ot}function DE(e){return it&&it.context&&it.context[e.id]!==void 0?it.context[e.id]:e.defaultValue}var Bf;function xb(){if(this.sources&&this.state)if(this.state===Tr)Fi(this);else{let e=Vt;Vt=null,ho(()=>Wc(this),!1),Vt=e}if(ot){let e=this.observers?this.observers.length:0;ot.sources?(ot.sources.push(this),ot.sourceSlots.push(e)):(ot.sources=[this],ot.sourceSlots=[e]),this.observers?(this.observers.push(ot),this.observerSlots.push(ot.sources.length-1)):(this.observers=[ot],this.observerSlots=[ot.sources.length-1])}return this.value}function kb(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&ho(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],a=df&&df.running;a&&df.disposed.has(i),(a?!i.tState:!i.state)&&(i.pure?Vt.push(i):kr.push(i),i.observers&&Ab(i)),a||(i.state=Tr)}if(Vt.length>1e6)throw Vt=[],new Error},!1)),t}function Fi(e){if(!e.fn)return;su(e);let t=it,n=ot,r=ou;ot=it=e,FE(e,e.value,r),ot=n,it=t}function FE(e,t,n){let r;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=Tr,e.owned&&e.owned.forEach(su),e.owned=null),e.updatedAt=n+1,$b(o)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?kb(e,r):e.value=r,e.updatedAt=n)}function iu(e,t,n,r=Tr,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:it,context:it?it.context:null,pure:n};return it===null||it!==_b&&(it.owned?it.owned.push(i):it.owned=[i]),i}function qc(e){if(e.state===0)return;if(e.state===Vc)return Wc(e);if(e.suspense&&kn(e.suspense.inFallback))return e.suspense.effects.push(e);let t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ou);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Tr)Fi(e);else if(e.state===Vc){let r=Vt;Vt=null,ho(()=>Wc(e,t[0]),!1),Vt=r}}function ho(e,t){if(Vt)return e();let n=!1;t||(Vt=[]),kr?n=!0:kr=[],ou++;try{let r=e();return jE(n),r}catch(r){n||(kr=null),Vt=null,$b(r)}}function jE(e){if(Vt&&(Sb(Vt),Vt=null),e)return;let t=kr;kr=null,t.length&&ho(()=>vb(t),!1)}function Sb(e){for(let t=0;t<e.length;t++)qc(e[t])}function HE(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:qc(r)}for(t=0;t<n;t++)qc(e[t])}function Wc(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let r=e.sources[n];if(r.sources){let o=r.state;o===Tr?r!==t&&(!r.updatedAt||r.updatedAt<ou)&&qc(r):o===Vc&&Wc(r,t)}}}function Ab(e){for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t];n.state||(n.state=Vc,n.pure?Vt.push(n):kr.push(n),n.observers&&Ab(n))}}function su(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),a=n.observerSlots.pop();r<o.length&&(i.sourceSlots[a]=r,o[r]=i,n.observerSlots[r]=a)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)su(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Tb(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function $b(e,t=it){throw Tb(e)}var H0=Symbol("fallback");function V0(e){for(let t=0;t<e.length;t++)e[t]()}function VE(e,t,n={}){let r=[],o=[],i=[],a=[],u=0,d;return Li(()=>V0(i)),()=>{let h=e()||[];return h[Qs],kn(()=>{if(h.length===0)return u!==0&&(V0(i),i=[],r=[],o=[],u=0,a=[]),n.fallback&&(r=[H0],o[0]=$f(b=>(i[0]=b,n.fallback())),u=1),o;for(r[0]===H0&&(i[0](),i=[],r=[],o=[],u=0),d=0;d<h.length;d++)d<r.length&&r[d]!==h[d]?a[d](()=>h[d]):d>=r.length&&(o[d]=$f(m));for(;d<r.length;d++)i[d]();return u=a.length=i.length=h.length,r=h.slice(0),o=o.slice(0,u)});function m(b){i[d]=b;let[_,T]=_t(h[d]);return a[d]=T,t(_,d)}}}function Rn(e,t){return kn(()=>e(t||{}))}var qE=e=>`Stale read from <${e}>.`;function WE(e){let t="fallback"in e&&{fallback:()=>e.fallback};return We(VE(()=>e.each,e.children,t||void 0))}function Qc(e){let t=e.keyed,n=We(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return We(()=>{let r=n();if(r){let o=e.children;return typeof o=="function"&&o.length>0?kn(()=>o(t?r:()=>{if(!kn(n))throw qE("Show");return e.when})):o}return e.fallback},void 0,void 0)}function QE(e,t,n){let r=n.length,o=t.length,i=r,a=0,u=0,d=t[o-1].nextSibling,h=null;for(;a<o||u<i;){if(t[a]===n[u]){a++,u++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===a){let m=i<r?u?n[u-1].nextSibling:n[i-u]:d;for(;u<i;)e.insertBefore(n[u++],m)}else if(i===u)for(;a<o;)(!h||!h.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[i-1]&&n[u]===t[o-1]){let m=t[--o].nextSibling;e.insertBefore(n[u++],t[a++].nextSibling),e.insertBefore(n[--i],m),t[o]=n[i]}else{if(!h){h=new Map;let b=u;for(;b<i;)h.set(n[b],b++)}let m=h.get(t[a]);if(m!=null)if(u<m&&m<i){let b=a,_=1,T;for(;++b<o&&b<i&&!((T=h.get(t[b]))==null||T!==m+_);)_++;if(_>m-u){let A=t[a];for(;u<m;)e.insertBefore(n[u++],A)}else e.replaceChild(n[u++],t[a++])}else a++;else t[a++].remove()}}}var q0="_$DX_DELEGATE";function He(e,t,n){let r,o=()=>{let a=document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:a.content.firstChild},i=t?()=>kn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Kf(e,t=window.document){let n=t[q0]||(t[q0]=new Set);for(let r=0,o=e.length;r<o;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,ZE))}}function Ht(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function KE(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function GE(e,t,n){if(!t)return n?Ht(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Bb(e,t,n){return kn(()=>e(t,n))}function Le(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Kc(e,t,r,n);En(o=>Kc(e,t(),o,n),r)}function ZE(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n;){let r=n[t];if(r&&!n.disabled){let o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Kc(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),a){let u=n[0];u&&u.nodeType===3?u.data=t:u=document.createTextNode(t),n=Si(e,n,r,u)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=Si(e,n,r);else{if(i==="function")return En(()=>{let u=t();for(;typeof u=="function";)u=u();n=Kc(e,u,n,r)}),()=>n;if(Array.isArray(t)){let u=[],d=n&&Array.isArray(n);if(Lf(u,t,n,o))return En(()=>n=Kc(e,u,n,r,!0)),()=>n;if(u.length===0){if(n=Si(e,n,r),a)return n}else d?n.length===0?W0(e,u,r):QE(e,n,u):(n&&Si(e),W0(e,u));n=u}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Si(e,n,r,t);Si(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Lf(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let u=t[i],d=n&&n[i],h;if(!(u==null||u===!0||u===!1))if((h=typeof u)=="object"&&u.nodeType)e.push(u);else if(Array.isArray(u))o=Lf(e,u,d)||o;else if(h==="function")if(r){for(;typeof u=="function";)u=u();o=Lf(e,Array.isArray(u)?u:[u],Array.isArray(d)?d:[d])||o}else e.push(u),o=!0;else{let m=String(u);d&&d.nodeType===3&&d.data===m?e.push(d):e.push(document.createTextNode(m))}}return o}function W0(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Si(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=!1;for(let a=t.length-1;a>=0;a--){let u=t[a];if(o!==u){let d=u.parentNode===e;!i&&!a?d?e.replaceChild(o,u):e.insertBefore(o,n):d&&u.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function YE(e){return Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Object.assign({},o),Cb(o.value)&&!nx(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function JE(e){return e?Object.keys(e).reduce((n,r)=>{let o=e[r];return n[r]=Cb(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=tx(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function XE(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function ex(e,t){let n=YE(t);return Object.keys(t).forEach(o=>{let i=n[o],a=e.getAttribute(i.attribute),u=e[o];a&&(i.value=i.parse?Lb(a):a),u!=null&&(i.value=Array.isArray(u)?u.slice(0):u),i.reflect&&Q0(e,i.attribute,i.value),Object.defineProperty(e,o,{get(){return i.value},set(d){let h=i.value;i.value=d,i.reflect&&Q0(this,i.attribute,i.value);for(let m=0,b=this.__propertyChangedCallbacks.length;m<b;m++)this.__propertyChangedCallbacks[m](o,d,h)},enumerable:!0,configurable:!0})}),n}function Lb(e){if(e)try{return JSON.parse(e)}catch{return e}}function Q0(e,t,n){if(n==null||n===!1)return e.removeAttribute(t);let r=JSON.stringify(n);e.__updating[t]=!0,r==="true"&&(r=""),e.setAttribute(t,r),Promise.resolve().then(()=>delete e.__updating[t])}function tx(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Cb(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function nx(e){return Object.prototype.toString.call(e)==="[object Function]"}function rx(e){return typeof e=="function"&&e.toString().indexOf("class")===0}var ff;function ox(e,t){let n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=ex(this,t);let o=XE(this.props),i=this.Component,a=ff;try{ff=this,this.__initialized=!0,rx(i)?new i(o,{element:this}):i(o,{element:this})}finally{ff=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,a){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(a==null&&!this[o])return;this[o]=t[o].parse?Lb(a):a}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function ix(e,t={},n={}){let{BaseElement:r=HTMLElement,extension:o}=n;return i=>{if(!e)throw new Error("tag is required to register a Component");let a=customElements.get(e);return a?(a.prototype.Component=i,a):(a=ox(r,JE(t)),a.prototype.Component=i,a.prototype.registeredTag=e,customElements.define(e,a,o),a)}}function sx(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let[o,i]=_t(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(a){i(()=>a)}})}return n}function ax(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function cx(e){return(t,n)=>{let{element:r}=n;return $f(o=>{let i=sx(t);r.addPropertyChangedCallback((u,d)=>i[u]=d),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});let a=e(i,n);return Le(r.renderRoot,a)},ax(r))}}function ux(e,t,n){return arguments.length===2&&(n=t,t={}),ix(e,t)(cx(n))}var lx=`#ztr-content,
|
|
#ztr-content img {
|
|
max-width: 100%;
|
|
}
|
|
|
|
#ztr-root {
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: var(--ztr-font);
|
|
font-size: var(--ztr-font-size);
|
|
color: var(--ztr-text-color);
|
|
border: 1px solid transparent;
|
|
word-wrap: break-word;
|
|
/* removes margin collapse */
|
|
margin-top: 4em;
|
|
line-height: 1.2em;
|
|
}
|
|
|
|
#ztr-subtitle {
|
|
font-size: 1.2em;
|
|
color: #666;
|
|
}
|
|
|
|
a {
|
|
color: var(--ztr-link-color);
|
|
text-decoration: none;
|
|
}
|
|
|
|
/* Comment */
|
|
|
|
.ztr-comment {
|
|
position: relative;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.ztr-comment,
|
|
.ztr-reply-button {
|
|
background-color: var(--ztr-background-color, rgba(0, 0, 0, 0.03));
|
|
}
|
|
|
|
.ztr-comment-body {
|
|
padding: 1em;
|
|
}
|
|
|
|
.ztr-comment:first-child {
|
|
border-top-left-radius: 0.3em;
|
|
border-top-right-radius: 0.3em;
|
|
}
|
|
|
|
.ztr-comment:last-child {
|
|
border-bottom-left-radius: 0.3em;
|
|
border-bottom-right-radius: 0.3em;
|
|
}
|
|
|
|
.ztr-comment-info-wrapper {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.ztr-comment-info {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.ztr-comment-info-picture {
|
|
width: 3.5em;
|
|
}
|
|
|
|
ul.ztr-comment-info-items {
|
|
display: flex;
|
|
align-items: center;
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
ul.ztr-comment-info-items li {
|
|
display: inline-block;
|
|
cursor: default;
|
|
padding-right: 0.5em;
|
|
}
|
|
|
|
ul.ztr-comment-info-items li a {
|
|
font-weight: 600;
|
|
}
|
|
|
|
.ztr-comment-info-author a {
|
|
font-size: 1.2em;
|
|
padding-right: 0.2em;
|
|
}
|
|
|
|
.ztr-comment-info-dots {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ztr-comment-info-separator {
|
|
width: 0.5em;
|
|
}
|
|
|
|
.ztr-comment-info-picture img {
|
|
width: 2em;
|
|
height: 2em;
|
|
border-radius: 50%;
|
|
padding: 0.5em;
|
|
position: relative;
|
|
display: block;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.ztr-comment-text,
|
|
#ztr-content {
|
|
margin-bottom: 0.75em;
|
|
padding: 0 0.8em 0 3.5em;
|
|
line-height: 1.5em;
|
|
line-break: loose;
|
|
word-break: break-word;
|
|
overflow: hidden;
|
|
max-width: 750px;
|
|
}
|
|
|
|
.ztr-comment-text p {
|
|
margin: 0 0 0.5em 0;
|
|
}
|
|
|
|
.ztr-comment-text code {
|
|
font-size: 1.1em;
|
|
margin: 0 0.2em;
|
|
}
|
|
|
|
.ztr-comment-text pre,
|
|
.ztr-info-pane pre {
|
|
white-space: pre-wrap;
|
|
white-space: -moz-pre-wrap;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
.ztr-comment-text a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.ztr-comment-text img {
|
|
max-width: 100%;
|
|
}
|
|
|
|
.ztr-comment-text .warning {
|
|
margin-top: 0em;
|
|
font-size: 0.8em;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.ztr-comment-text .warning svg {
|
|
height: 1.2em;
|
|
fill: #e4984d;
|
|
padding-right: 0.7em;
|
|
}
|
|
|
|
.ztr-comment-replies {
|
|
margin-left: 2em;
|
|
}
|
|
|
|
.highlight p {
|
|
background: #F6AD55;
|
|
color: #2B2B2B;
|
|
display: inline;
|
|
padding: 0.2em;
|
|
}
|
|
|
|
/* Styling the reply to comment form */
|
|
|
|
.ztr-comment-expand {
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.ztr-comment-expand span {
|
|
margin: 1em 0 1em 0.35em;
|
|
cursor: pointer;
|
|
}
|
|
|
|
ul.ztr-comment-actions,
|
|
.ztr-comment-expand {
|
|
display: flex;
|
|
align-items: center;
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0 0 0 3.5em;
|
|
font-weight: 600;
|
|
user-select: none;
|
|
}
|
|
|
|
ul.ztr-comment-actions li {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
text-align: center;
|
|
padding: 0 2em 0 0;
|
|
cursor: pointer;
|
|
}
|
|
|
|
ul.ztr-comment-actions li span {
|
|
padding: 0.25em 0.25em 0 0.25em;
|
|
color: var(--ztr-icon-color, #3B3B3B);
|
|
}
|
|
|
|
svg {
|
|
fill: var(--ztr-icon-color, #3B3B3B);
|
|
width: 1.1em;
|
|
height: 1.1em;
|
|
}
|
|
|
|
.ztr-comment-action-reply:hover svg {
|
|
fill: #92379c;
|
|
}
|
|
|
|
.ztr-comment-action-reply:hover span {
|
|
color: #92379c;
|
|
}
|
|
|
|
.ztr-comment-action-zap:hover svg {
|
|
fill: #e4984d;
|
|
}
|
|
|
|
.ztr-comment-action-zap:hover span {
|
|
color: #e4984d;
|
|
}
|
|
|
|
.ztr-comment-action-like:hover svg {
|
|
fill: #e35428;
|
|
}
|
|
|
|
.ztr-comment-action-like:hover span {
|
|
color: #e35428;
|
|
}
|
|
|
|
.ztr-reply-form {
|
|
padding: 0 0.5em 0 3.5em;
|
|
}
|
|
|
|
.ztr-reply-form textarea {
|
|
font-family: var(--ztr-font);
|
|
font-size: 1.1em;
|
|
line-height: 1.4;
|
|
color: #2B2B2B;
|
|
background-color: #FDFDFD;
|
|
border: 1px solid #BBB;
|
|
outline: none;
|
|
width: calc(100% - 1.5em);
|
|
padding: 0.7em;
|
|
margin: 0.5em 0;
|
|
height: 4em;
|
|
border-radius: 0.2em;
|
|
min-height: 4em;
|
|
resize: vertical;
|
|
}
|
|
|
|
.ztr-reply-form:disabled {
|
|
opacity: 65%;
|
|
user-select: none;
|
|
}
|
|
|
|
.ztr-reply-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.ztr-reply-controls span {
|
|
font-weight: bold;
|
|
font-size: 0.85em;
|
|
margin-right: 1em;
|
|
user-select: none;
|
|
cursor: default;
|
|
}
|
|
|
|
.ztr-reply-error {
|
|
color: rgb(202, 23, 23);
|
|
}
|
|
|
|
.ztr-reply-controls button {
|
|
font-family: var(--ztr-font);
|
|
appearance: none;
|
|
border: none;
|
|
padding: 0.5em 1em;
|
|
border-radius: 0.2em;
|
|
font-size: 0.85em;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ztr-reply-login-button {
|
|
color: white;
|
|
background-color: var(--ztr-login-button-color, #2B2B2B);
|
|
margin-left: 1em;
|
|
}
|
|
|
|
.ztr-reply-button {
|
|
color: var(--ztr-text-color);
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.ztr-info-pane {
|
|
padding: 0 0.5em 1em 3.5em;
|
|
}
|
|
|
|
.ztr-info-pane pre {
|
|
font-size: 0.8em;
|
|
}
|
|
|
|
.ztr-spinner {
|
|
width: 1.2em;
|
|
height: 1.2em;
|
|
padding: 0.9em;
|
|
animation: rotate 4s linear infinite;
|
|
}
|
|
|
|
.ztr-reply-button:disabled {
|
|
opacity: 65%;
|
|
pointer-events: none;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
.ztr-spinner .path {
|
|
stroke: var(--ztr-text-color, #2B2B2B);
|
|
stroke-linecap: round;
|
|
animation: dash 1.5s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes rotate {
|
|
100% {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
@keyframes dash {
|
|
0% {
|
|
stroke-dasharray: 1, 150;
|
|
stroke-dashoffset: 0;
|
|
}
|
|
|
|
50% {
|
|
stroke-dasharray: 90, 150;
|
|
stroke-dashoffset: -35;
|
|
}
|
|
|
|
100% {
|
|
stroke-dasharray: 90, 150;
|
|
stroke-dashoffset: -124;
|
|
}
|
|
}
|
|
|
|
/* new */
|
|
|
|
.ztr-comment-new .ztr-reply-form {
|
|
margin: 0.5em 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.ztr-comment-new .ztr-comment-body {
|
|
padding: 0;
|
|
}
|
|
|
|
.ztr-comment-new .ztr-comment-actions {
|
|
font-size: 1.1em;
|
|
padding: 0;
|
|
}
|
|
|
|
/* Dark mode defaults */
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
.ztr-spinner .path {
|
|
stroke: var(--ztr-text-color, #DEDEDE);
|
|
}
|
|
|
|
.ztr-comment,
|
|
.ztr-reply-button {
|
|
background-color: var(--ztr-background-color, rgba(255, 255, 255, 0.06));
|
|
}
|
|
|
|
.ztr-reply-login-button {
|
|
color: #2B2B2B;
|
|
background-color: var(--ztr-login-button-color, #DEDEDE);
|
|
}
|
|
|
|
svg {
|
|
fill: var(--ztr-icon-color, #DEDEDE);
|
|
}
|
|
|
|
ul.ztr-comment-actions li span {
|
|
color: var(--ztr-icon-color);
|
|
}
|
|
|
|
.ztr-comment-action-reply:hover svg {
|
|
fill: #96609c;
|
|
}
|
|
|
|
.ztr-comment-action-reply:hover span {
|
|
color: #96609c;
|
|
}
|
|
}`;function K0(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Pb(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function dx(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");K0(e.outputLen),K0(e.blockLen)}function Gc(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function fx(e,t){Pb(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var hf=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Ib=e=>e instanceof Uint8Array,pf=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Zn=(e,t)=>e<<32-t|e>>>t,hx=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!hx)throw new Error("Non little-endian hardware is not supported");function px(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Gf(e){if(typeof e=="string"&&(e=px(e)),!Ib(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function gx(...e){let t=new Uint8Array(e.reduce((r,o)=>r+o.length,0)),n=0;return e.forEach(r=>{if(!Ib(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}var Nb=class{clone(){return this._cloneInto()}};function mx(e){let t=r=>e().update(Gf(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Ob(e=32){if(hf&&typeof hf.getRandomValues=="function")return hf.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function bx(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),u=Number(n&i),d=r?4:0,h=r?0:4;e.setUint32(t+d,a,r),e.setUint32(t+h,u,r)}var wx=class extends Nb{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=pf(this.buffer)}update(t){Gc(this);let{view:n,buffer:r,blockLen:o}=this;t=Gf(t);let i=t.length;for(let a=0;a<i;){let u=Math.min(o-this.pos,i-a);if(u===o){let d=pf(t);for(;o<=i-a;a+=o)this.process(d,a);continue}r.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Gc(this),fx(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:i}=this,{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let b=a;b<o;b++)n[b]=0;bx(r,o-8,BigInt(this.length*8),i),this.process(r,0);let u=pf(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=d/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let b=0;b<h;b++)u.setUint32(4*b,m[b],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:r,length:o,finished:i,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=i,t.destroyed=a,o%n&&t.buffer.set(r),t}},yx=(e,t,n)=>e&t^~e&n,vx=(e,t,n)=>e&t^e&n^t&n,_x=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),io=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),so=new Uint32Array(64),Ex=class extends wx{constructor(){super(64,32,8,!1),this.A=io[0]|0,this.B=io[1]|0,this.C=io[2]|0,this.D=io[3]|0,this.E=io[4]|0,this.F=io[5]|0,this.G=io[6]|0,this.H=io[7]|0}get(){let{A:t,B:n,C:r,D:o,E:i,F:a,G:u,H:d}=this;return[t,n,r,o,i,a,u,d]}set(t,n,r,o,i,a,u,d){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=u|0,this.H=d|0}process(t,n){for(let b=0;b<16;b++,n+=4)so[b]=t.getUint32(n,!1);for(let b=16;b<64;b++){let _=so[b-15],T=so[b-2],A=Zn(_,7)^Zn(_,18)^_>>>3,k=Zn(T,17)^Zn(T,19)^T>>>10;so[b]=k+so[b-7]+A+so[b-16]|0}let{A:r,B:o,C:i,D:a,E:u,F:d,G:h,H:m}=this;for(let b=0;b<64;b++){let _=Zn(u,6)^Zn(u,11)^Zn(u,25),T=m+_+yx(u,d,h)+_x[b]+so[b]|0,k=(Zn(r,2)^Zn(r,13)^Zn(r,22))+vx(r,o,i)|0;m=h,h=d,d=u,u=a+T|0,a=i,i=o,o=r,r=T+k|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,d=d+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(r,o,i,a,u,d,h,m)}roundClean(){so.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Cf=mx(()=>new Ex);var Rb=BigInt(0),au=BigInt(1),xx=BigInt(2),cu=e=>e instanceof Uint8Array,kx=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ri(e){if(!cu(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=kx[e[n]];return t}function Ub(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function Zf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function Ui(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){let o=r*2,i=e.slice(o,o+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[r]=a}return n}function rn(e){return Zf(Ri(e))}function Yf(e){if(!cu(e))throw new Error("Uint8Array expected");return Zf(Ri(Uint8Array.from(e).reverse()))}function po(e,t){return Ui(e.toString(16).padStart(t*2,"0"))}function Jf(e,t){return po(e,t).reverse()}function Sx(e){return Ui(Ub(e))}function jt(e,t,n){let r;if(typeof t=="string")try{r=Ui(t)}catch(i){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${i}`)}else if(cu(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);let o=r.length;if(typeof n=="number"&&o!==n)throw new Error(`${e} expected ${n} bytes, got ${o}`);return r}function Go(...e){let t=new Uint8Array(e.reduce((r,o)=>r+o.length,0)),n=0;return e.forEach(r=>{if(!cu(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function Ax(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Tx(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function $x(e){let t;for(t=0;e>Rb;e>>=au,t+=1);return t}function Bx(e,t){return e>>BigInt(t)&au}var Lx=(e,t,n)=>e|(n?au:Rb)<<BigInt(t),Xf=e=>(xx<<BigInt(e-1))-au,gf=e=>new Uint8Array(e),G0=e=>Uint8Array.from(e);function zb(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=gf(e),o=gf(e),i=0,a=()=>{r.fill(1),o.fill(0),i=0},u=(...b)=>n(o,r,...b),d=(b=gf())=>{o=u(G0([0]),b),r=u(),b.length!==0&&(o=u(G0([1]),b),r=u())},h=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let b=0,_=[];for(;b<t;){r=u();let T=r.slice();_.push(T),b+=r.length}return Go(..._)};return(b,_)=>{a(),d(b);let T;for(;!(T=_(h()));)d();return a(),T}}var Cx={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Zs(e,t,n={}){let r=(o,i,a)=>{let u=Cx[i];if(typeof u!="function")throw new Error(`Invalid validator "${i}", expected function`);let d=e[o];if(!(a&&d===void 0)&&!u(d,e))throw new Error(`Invalid param ${String(o)}=${d} (${typeof d}), expected ${i}`)};for(let[o,i]of Object.entries(t))r(o,i,!1);for(let[o,i]of Object.entries(n))r(o,i,!0);return e}var Px=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Bx,bitLen:$x,bitMask:Xf,bitSet:Lx,bytesToHex:Ri,bytesToNumberBE:rn,bytesToNumberLE:Yf,concatBytes:Go,createHmacDrbg:zb,ensureBytes:jt,equalBytes:Ax,hexToBytes:Ui,hexToNumber:Zf,numberToBytesBE:po,numberToBytesLE:Jf,numberToHexUnpadded:Ub,numberToVarBytesBE:Sx,utf8ToBytes:Tx,validateObject:Zs},Symbol.toStringTag,{value:"Module"}));var Lt=BigInt(0),pt=BigInt(1),Wo=BigInt(2),Ix=BigInt(3),Pf=BigInt(4),Z0=BigInt(5),Y0=BigInt(8);BigInt(9);BigInt(16);function zt(e,t){let n=e%t;return n>=Lt?n:t+n}function Nx(e,t,n){if(n<=Lt||t<Lt)throw new Error("Expected power/modulo > 0");if(n===pt)return Lt;let r=pt;for(;t>Lt;)t&pt&&(r=r*e%n),e=e*e%n,t>>=pt;return r}function yn(e,t,n){let r=e;for(;t-- >Lt;)r*=r,r%=n;return r}function If(e,t){if(e===Lt||t<=Lt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=zt(e,t),r=t,o=Lt,i=pt;for(;n!==Lt;){let u=r/n,d=r%n,h=o-i*u;r=n,n=d,o=i,i=h}if(r!==pt)throw new Error("invert: does not exist");return zt(o,t)}function Ox(e){let t=(e-pt)/Wo,n,r,o;for(n=e-pt,r=0;n%Wo===Lt;n/=Wo,r++);for(o=Wo;o<e&&Nx(o,t,e)!==e-pt;o++);if(r===1){let a=(e+pt)/Pf;return function(d,h){let m=d.pow(h,a);if(!d.eql(d.sqr(m),h))throw new Error("Cannot find square root");return m}}let i=(n+pt)/Wo;return function(u,d){if(u.pow(d,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let h=r,m=u.pow(u.mul(u.ONE,o),n),b=u.pow(d,i),_=u.pow(d,n);for(;!u.eql(_,u.ONE);){if(u.eql(_,u.ZERO))return u.ZERO;let T=1;for(let k=u.sqr(_);T<h&&!u.eql(k,u.ONE);T++)k=u.sqr(k);let A=u.pow(m,pt<<BigInt(h-T-1));m=u.sqr(A),b=u.mul(b,A),_=u.mul(_,m),h=T}return b}}function Rx(e){if(e%Pf===Ix){let t=(e+pt)/Pf;return function(r,o){let i=r.pow(o,t);if(!r.eql(r.sqr(i),o))throw new Error("Cannot find square root");return i}}if(e%Y0===Z0){let t=(e-Z0)/Y0;return function(r,o){let i=r.mul(o,Wo),a=r.pow(i,t),u=r.mul(o,a),d=r.mul(r.mul(u,Wo),a),h=r.mul(u,r.sub(d,r.ONE));if(!r.eql(r.sqr(h),o))throw new Error("Cannot find square root");return h}}return Ox(e)}var Ux=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zx(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Ux.reduce((r,o)=>(r[o]="function",r),t);return Zs(e,n)}function Mx(e,t,n){if(n<Lt)throw new Error("Expected power > 0");if(n===Lt)return e.ONE;if(n===pt)return t;let r=e.ONE,o=t;for(;n>Lt;)n&pt&&(r=e.mul(r,o)),o=e.sqr(o),n>>=pt;return r}function Dx(e,t){let n=new Array(t.length),r=t.reduce((i,a,u)=>e.is0(a)?i:(n[u]=i,e.mul(i,a)),e.ONE),o=e.inv(r);return t.reduceRight((i,a,u)=>e.is0(a)?i:(n[u]=e.mul(i,n[u]),e.mul(i,a)),o),n}function Mb(e,t){let n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Fx(e,t,n=!1,r={}){if(e<=Lt)throw new Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:o,nByteLength:i}=Mb(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=Rx(e),u=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:Xf(o),ZERO:Lt,ONE:pt,create:d=>zt(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return Lt<=d&&d<e},is0:d=>d===Lt,isOdd:d=>(d&pt)===pt,neg:d=>zt(-d,e),eql:(d,h)=>d===h,sqr:d=>zt(d*d,e),add:(d,h)=>zt(d+h,e),sub:(d,h)=>zt(d-h,e),mul:(d,h)=>zt(d*h,e),pow:(d,h)=>Mx(u,d,h),div:(d,h)=>zt(d*If(h,e),e),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>If(d,e),sqrt:r.sqrt||(d=>a(u,d)),invertBatch:d=>Dx(u,d),cmov:(d,h,m)=>m?h:d,toBytes:d=>n?Jf(d,i):po(d,i),fromBytes:d=>{if(d.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${d.length}`);return n?Yf(d):rn(d)}});return Object.freeze(u)}function Db(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function Fb(e){let t=Db(e);return t+Math.ceil(t/2)}function jx(e,t,n=!1){let r=e.length,o=Db(t),i=Fb(t);if(r<16||r<i||r>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);let a=n?rn(e):Yf(e),u=zt(a,t-pt)+pt;return n?Jf(u,o):po(u,o)}var Hx=BigInt(0),mf=BigInt(1);function Vx(e,t){let n=(o,i)=>{let a=i.negate();return o?a:i},r=o=>{let i=Math.ceil(t/o)+1,a=2**(o-1);return{windows:i,windowSize:a}};return{constTimeNegate:n,unsafeLadder(o,i){let a=e.ZERO,u=o;for(;i>Hx;)i&mf&&(a=a.add(u)),u=u.double(),i>>=mf;return a},precomputeWindow(o,i){let{windows:a,windowSize:u}=r(i),d=[],h=o,m=h;for(let b=0;b<a;b++){m=h,d.push(m);for(let _=1;_<u;_++)m=m.add(h),d.push(m);h=m.double()}return d},wNAF(o,i,a){let{windows:u,windowSize:d}=r(o),h=e.ZERO,m=e.BASE,b=BigInt(2**o-1),_=2**o,T=BigInt(o);for(let A=0;A<u;A++){let k=A*d,I=Number(a&b);a>>=T,I>d&&(I-=_,a+=mf);let O=k,L=k+Math.abs(I)-1,f=A%2!==0,p=I<0;I===0?m=m.add(n(f,i[O])):h=h.add(n(p,i[L]))}return{p:h,f:m}},wNAFCached(o,i,a,u){let d=o._WINDOW_SIZE||1,h=i.get(o);return h||(h=this.precomputeWindow(o,d),d!==1&&i.set(o,u(h))),this.wNAF(d,h,a)}}}function jb(e){return zx(e.Fp),Zs(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Mb(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function qx(e){let t=jb(e);Zs(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:Wx,hexToBytes:Qx}=Px,Ko={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){let{Err:t}=Ko;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");let n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Wx(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=Ko,n=typeof e=="string"?Qx(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");let{d:o,l:i}=Ko._parseInt(n.subarray(2)),{d:a,l:u}=Ko._parseInt(i);if(u.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,n=h=>{let m=h.toString(16);return m.length&1?`0${m}`:m},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,a=o.length/2,u=n(i),d=n(a);return`30${n(a+i+4)}02${d}${o}02${u}${r}`}},xr=BigInt(0),vn=BigInt(1);BigInt(2);var J0=BigInt(3);BigInt(4);function Kx(e){let t=qx(e),{Fp:n}=t,r=t.toBytes||((A,k,I)=>{let O=k.toAffine();return Go(Uint8Array.from([4]),n.toBytes(O.x),n.toBytes(O.y))}),o=t.fromBytes||(A=>{let k=A.subarray(1),I=n.fromBytes(k.subarray(0,n.BYTES)),O=n.fromBytes(k.subarray(n.BYTES,2*n.BYTES));return{x:I,y:O}});function i(A){let{a:k,b:I}=t,O=n.sqr(A),L=n.mul(O,A);return n.add(n.add(L,n.mul(A,k)),I)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(A){return typeof A=="bigint"&&xr<A&&A<t.n}function u(A){if(!a(A))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function d(A){let{allowedPrivateKeyLengths:k,nByteLength:I,wrapPrivateKey:O,n:L}=t;if(k&&typeof A!="bigint"){if(A instanceof Uint8Array&&(A=Ri(A)),typeof A!="string"||!k.includes(A.length))throw new Error("Invalid key");A=A.padStart(I*2,"0")}let f;try{f=typeof A=="bigint"?A:rn(jt("private key",A,I))}catch{throw new Error(`private key must be ${I} bytes, hex or bigint, not ${typeof A}`)}return O&&(f=zt(f,L)),u(f),f}let h=new Map;function m(A){if(!(A instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(k,I,O){if(this.px=k,this.py=I,this.pz=O,k==null||!n.isValid(k))throw new Error("x required");if(I==null||!n.isValid(I))throw new Error("y required");if(O==null||!n.isValid(O))throw new Error("z required")}static fromAffine(k){let{x:I,y:O}=k||{};if(!k||!n.isValid(I)||!n.isValid(O))throw new Error("invalid affine point");if(k instanceof b)throw new Error("projective point not allowed");let L=f=>n.eql(f,n.ZERO);return L(I)&&L(O)?b.ZERO:new b(I,O,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(k){let I=n.invertBatch(k.map(O=>O.pz));return k.map((O,L)=>O.toAffine(I[L])).map(b.fromAffine)}static fromHex(k){let I=b.fromAffine(o(jt("pointHex",k)));return I.assertValidity(),I}static fromPrivateKey(k){return b.BASE.multiply(d(k))}_setWindowSize(k){this._WINDOW_SIZE=k,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:k,y:I}=this.toAffine();if(!n.isValid(k)||!n.isValid(I))throw new Error("bad point: x or y not FE");let O=n.sqr(I),L=i(k);if(!n.eql(O,L))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:k}=this.toAffine();if(n.isOdd)return!n.isOdd(k);throw new Error("Field doesn't support isOdd")}equals(k){m(k);let{px:I,py:O,pz:L}=this,{px:f,py:p,pz:w}=k,v=n.eql(n.mul(I,w),n.mul(f,L)),S=n.eql(n.mul(O,w),n.mul(p,L));return v&&S}negate(){return new b(this.px,n.neg(this.py),this.pz)}double(){let{a:k,b:I}=t,O=n.mul(I,J0),{px:L,py:f,pz:p}=this,w=n.ZERO,v=n.ZERO,S=n.ZERO,$=n.mul(L,L),P=n.mul(f,f),M=n.mul(p,p),N=n.mul(L,f);return N=n.add(N,N),S=n.mul(L,p),S=n.add(S,S),w=n.mul(k,S),v=n.mul(O,M),v=n.add(w,v),w=n.sub(P,v),v=n.add(P,v),v=n.mul(w,v),w=n.mul(N,w),S=n.mul(O,S),M=n.mul(k,M),N=n.sub($,M),N=n.mul(k,N),N=n.add(N,S),S=n.add($,$),$=n.add(S,$),$=n.add($,M),$=n.mul($,N),v=n.add(v,$),M=n.mul(f,p),M=n.add(M,M),$=n.mul(M,N),w=n.sub(w,$),S=n.mul(M,P),S=n.add(S,S),S=n.add(S,S),new b(w,v,S)}add(k){m(k);let{px:I,py:O,pz:L}=this,{px:f,py:p,pz:w}=k,v=n.ZERO,S=n.ZERO,$=n.ZERO,P=t.a,M=n.mul(t.b,J0),N=n.mul(I,f),B=n.mul(O,p),F=n.mul(L,w),q=n.add(I,O),x=n.add(f,p);q=n.mul(q,x),x=n.add(N,B),q=n.sub(q,x),x=n.add(I,L);let z=n.add(f,w);return x=n.mul(x,z),z=n.add(N,F),x=n.sub(x,z),z=n.add(O,L),v=n.add(p,w),z=n.mul(z,v),v=n.add(B,F),z=n.sub(z,v),$=n.mul(P,x),v=n.mul(M,F),$=n.add(v,$),v=n.sub(B,$),$=n.add(B,$),S=n.mul(v,$),B=n.add(N,N),B=n.add(B,N),F=n.mul(P,F),x=n.mul(M,x),B=n.add(B,F),F=n.sub(N,F),F=n.mul(P,F),x=n.add(x,F),N=n.mul(B,x),S=n.add(S,N),N=n.mul(z,x),v=n.mul(q,v),v=n.sub(v,N),N=n.mul(q,B),$=n.mul(z,$),$=n.add($,N),new b(v,S,$)}subtract(k){return this.add(k.negate())}is0(){return this.equals(b.ZERO)}wNAF(k){return T.wNAFCached(this,h,k,I=>{let O=n.invertBatch(I.map(L=>L.pz));return I.map((L,f)=>L.toAffine(O[f])).map(b.fromAffine)})}multiplyUnsafe(k){let I=b.ZERO;if(k===xr)return I;if(u(k),k===vn)return this;let{endo:O}=t;if(!O)return T.unsafeLadder(this,k);let{k1neg:L,k1:f,k2neg:p,k2:w}=O.splitScalar(k),v=I,S=I,$=this;for(;f>xr||w>xr;)f&vn&&(v=v.add($)),w&vn&&(S=S.add($)),$=$.double(),f>>=vn,w>>=vn;return L&&(v=v.negate()),p&&(S=S.negate()),S=new b(n.mul(S.px,O.beta),S.py,S.pz),v.add(S)}multiply(k){u(k);let I=k,O,L,{endo:f}=t;if(f){let{k1neg:p,k1:w,k2neg:v,k2:S}=f.splitScalar(I),{p:$,f:P}=this.wNAF(w),{p:M,f:N}=this.wNAF(S);$=T.constTimeNegate(p,$),M=T.constTimeNegate(v,M),M=new b(n.mul(M.px,f.beta),M.py,M.pz),O=$.add(M),L=P.add(N)}else{let{p,f:w}=this.wNAF(I);O=p,L=w}return b.normalizeZ([O,L])[0]}multiplyAndAddUnsafe(k,I,O){let L=b.BASE,f=(w,v)=>v===xr||v===vn||!w.equals(L)?w.multiplyUnsafe(v):w.multiply(v),p=f(this,I).add(f(k,O));return p.is0()?void 0:p}toAffine(k){let{px:I,py:O,pz:L}=this,f=this.is0();k==null&&(k=f?n.ONE:n.inv(L));let p=n.mul(I,k),w=n.mul(O,k),v=n.mul(L,k);if(f)return{x:n.ZERO,y:n.ZERO};if(!n.eql(v,n.ONE))throw new Error("invZ was invalid");return{x:p,y:w}}isTorsionFree(){let{h:k,isTorsionFree:I}=t;if(k===vn)return!0;if(I)return I(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:k,clearCofactor:I}=t;return k===vn?this:I?I(b,this):this.multiplyUnsafe(t.h)}toRawBytes(k=!0){return this.assertValidity(),r(b,this,k)}toHex(k=!0){return Ri(this.toRawBytes(k))}}b.BASE=new b(t.Gx,t.Gy,n.ONE),b.ZERO=new b(n.ZERO,n.ONE,n.ZERO);let _=t.nBitLength,T=Vx(b,t.endo?Math.ceil(_/2):_);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:a}}function Gx(e){let t=jb(e);return Zs(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Zx(e){let t=Gx(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(x){return xr<x&&x<n.ORDER}function u(x){return zt(x,r)}function d(x){return If(x,r)}let{ProjectivePoint:h,normPrivateKeyToScalar:m,weierstrassEquation:b,isWithinCurveOrder:_}=Kx({...t,toBytes(x,z,V){let K=z.toAffine(),Z=n.toBytes(K.x),W=Go;return V?W(Uint8Array.from([z.hasEvenY()?2:3]),Z):W(Uint8Array.from([4]),Z,n.toBytes(K.y))},fromBytes(x){let z=x.length,V=x[0],K=x.subarray(1);if(z===o&&(V===2||V===3)){let Z=rn(K);if(!a(Z))throw new Error("Point is not on curve");let W=b(Z),J=n.sqrt(W),de=(J&vn)===vn;return(V&1)===1!==de&&(J=n.neg(J)),{x:Z,y:J}}else if(z===i&&V===4){let Z=n.fromBytes(K.subarray(0,n.BYTES)),W=n.fromBytes(K.subarray(n.BYTES,2*n.BYTES));return{x:Z,y:W}}else throw new Error(`Point of length ${z} was invalid. Expected ${o} compressed bytes or ${i} uncompressed bytes`)}}),T=x=>Ri(po(x,t.nByteLength));function A(x){let z=r>>vn;return x>z}function k(x){return A(x)?u(-x):x}let I=(x,z,V)=>rn(x.slice(z,V));class O{constructor(z,V,K){this.r=z,this.s=V,this.recovery=K,this.assertValidity()}static fromCompact(z){let V=t.nByteLength;return z=jt("compactSignature",z,V*2),new O(I(z,0,V),I(z,V,2*V))}static fromDER(z){let{r:V,s:K}=Ko.toSig(jt("DER",z));return new O(V,K)}assertValidity(){if(!_(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!_(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(z){return new O(this.r,this.s,z)}recoverPublicKey(z){let{r:V,s:K,recovery:Z}=this,W=S(jt("msgHash",z));if(Z==null||![0,1,2,3].includes(Z))throw new Error("recovery id invalid");let J=Z===2||Z===3?V+t.n:V;if(J>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");let de=(Z&1)===0?"02":"03",_e=h.fromHex(de+T(J)),ve=d(J),Pe=u(-W*ve),ie=u(K*ve),Se=h.BASE.multiplyAndAddUnsafe(_e,Pe,ie);if(!Se)throw new Error("point at infinify");return Se.assertValidity(),Se}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new O(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Ui(this.toDERHex())}toDERHex(){return Ko.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ui(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}let L={isValidPrivateKey(x){try{return m(x),!0}catch{return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{let x=Fb(t.n);return jx(t.randomBytes(x),t.n)},precompute(x=8,z=h.BASE){return z._setWindowSize(x),z.multiply(BigInt(3)),z}};function f(x,z=!0){return h.fromPrivateKey(x).toRawBytes(z)}function p(x){let z=x instanceof Uint8Array,V=typeof x=="string",K=(z||V)&&x.length;return z?K===o||K===i:V?K===2*o||K===2*i:x instanceof h}function w(x,z,V=!0){if(p(x))throw new Error("first arg must be private key");if(!p(z))throw new Error("second arg must be public key");return h.fromHex(z).multiply(m(x)).toRawBytes(V)}let v=t.bits2int||function(x){let z=rn(x),V=x.length*8-t.nBitLength;return V>0?z>>BigInt(V):z},S=t.bits2int_modN||function(x){return u(v(x))},$=Xf(t.nBitLength);function P(x){if(typeof x!="bigint")throw new Error("bigint expected");if(!(xr<=x&&x<$))throw new Error(`bigint expected < 2^${t.nBitLength}`);return po(x,t.nByteLength)}function M(x,z,V=N){if(["recovered","canonical"].some(Re=>Re in V))throw new Error("sign() legacy options not supported");let{hash:K,randomBytes:Z}=t,{lowS:W,prehash:J,extraEntropy:de}=V;W==null&&(W=!0),x=jt("msgHash",x),J&&(x=jt("prehashed msgHash",K(x)));let _e=S(x),ve=m(z),Pe=[P(ve),P(_e)];if(de!=null){let Re=de===!0?Z(n.BYTES):de;Pe.push(jt("extraEntropy",Re))}let ie=Go(...Pe),Se=_e;function Ve(Re){let je=v(Re);if(!_(je))return;let Et=d(je),Qe=h.BASE.multiply(je).toAffine(),he=u(Qe.x);if(he===xr)return;let Me=u(Et*u(Se+he*ve));if(Me===xr)return;let Ce=(Qe.x===he?0:2)|Number(Qe.y&vn),Ie=Me;return W&&A(Me)&&(Ie=k(Me),Ce^=1),new O(he,Ie,Ce)}return{seed:ie,k2sig:Ve}}let N={lowS:t.lowS,prehash:!1},B={lowS:t.lowS,prehash:!1};function F(x,z,V=N){let{seed:K,k2sig:Z}=M(x,z,V),W=t;return zb(W.hash.outputLen,W.nByteLength,W.hmac)(K,Z)}h.BASE._setWindowSize(8);function q(x,z,V,K=B){var Z;let W=x;if(z=jt("msgHash",z),V=jt("publicKey",V),"strict"in K)throw new Error("options.strict was renamed to lowS");let{lowS:J,prehash:de}=K,_e,ve;try{if(typeof W=="string"||W instanceof Uint8Array)try{_e=O.fromDER(W)}catch(he){if(!(he instanceof Ko.Err))throw he;_e=O.fromCompact(W)}else if(typeof W=="object"&&typeof W.r=="bigint"&&typeof W.s=="bigint"){let{r:he,s:Me}=W;_e=new O(he,Me)}else throw new Error("PARSE");ve=h.fromHex(V)}catch(he){if(he.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(J&&_e.hasHighS())return!1;de&&(z=t.hash(z));let{r:Pe,s:ie}=_e,Se=S(z),Ve=d(ie),Re=u(Se*Ve),je=u(Pe*Ve),Et=(Z=h.BASE.multiplyAndAddUnsafe(ve,Re,je))==null?void 0:Z.toAffine();return Et?u(Et.x)===Pe:!1}return{CURVE:t,getPublicKey:f,getSharedSecret:w,sign:F,verify:q,ProjectivePoint:h,Signature:O,utils:L}}var Zc=class extends Nb{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,dx(t);let r=Gf(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let a=0;a<i.length;a++)i[a]^=54;this.iHash.update(i),this.oHash=t.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),i.fill(0)}update(t){return Gc(this),this.iHash.update(t),this}digestInto(t){Gc(this),Pb(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:n,iHash:r,finished:o,destroyed:i,blockLen:a,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=i,t.blockLen=a,t.outputLen=u,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Hb=(e,t,n)=>new Zc(e,t).update(n).digest();Hb.create=(e,t)=>new Zc(e,t);function Yx(e){return{hash:e,hmac:(t,...n)=>Hb(e,t,gx(...n)),randomBytes:Ob}}function Jx(e,t){let n=r=>Zx({...e,...Yx(r)});return Object.freeze({...n(t),create:n})}var uu=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Yc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Vb=BigInt(1),Jc=BigInt(2),X0=(e,t)=>(e+t/Jc)/t;function qb(e){let t=uu,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),u=BigInt(44),d=BigInt(88),h=e*e*e%t,m=h*h*e%t,b=yn(m,n,t)*m%t,_=yn(b,n,t)*m%t,T=yn(_,Jc,t)*h%t,A=yn(T,o,t)*T%t,k=yn(A,i,t)*A%t,I=yn(k,u,t)*k%t,O=yn(I,d,t)*I%t,L=yn(O,u,t)*k%t,f=yn(L,n,t)*m%t,p=yn(f,a,t)*A%t,w=yn(p,r,t)*h%t,v=yn(w,Jc,t);if(!Nf.eql(Nf.sqr(v),e))throw new Error("Cannot find square root");return v}var Nf=Fx(uu,void 0,void 0,{sqrt:qb}),eh=Jx({a:BigInt(0),b:BigInt(7),Fp:Nf,n:Yc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=Yc,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Vb*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),u=X0(i*e,t),d=X0(-r*e,t),h=zt(e-u*n-d*o,t),m=zt(-u*r-d*i,t),b=h>a,_=m>a;if(b&&(h=t-h),_&&(m=t-m),h>a||m>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:b,k1:h,k2neg:_,k2:m}}}},Cf),lu=BigInt(0),Wb=e=>typeof e=="bigint"&&lu<e&&e<uu,Xx=e=>typeof e=="bigint"&&lu<e&&e<Yc,eb={};function Xc(e,...t){let n=eb[e];if(n===void 0){let r=Cf(Uint8Array.from(e,o=>o.charCodeAt(0)));n=Go(r,r),eb[e]=n}return Cf(Go(n,...t))}var th=e=>e.toRawBytes(!0).slice(1),Of=e=>po(e,32),bf=e=>zt(e,uu),Ks=e=>zt(e,Yc),nh=eh.ProjectivePoint,e4=(e,t,n)=>nh.BASE.multiplyAndAddUnsafe(e,t,n);function Rf(e){let t=eh.utils.normPrivateKeyToScalar(e),n=nh.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Ks(-t),bytes:th(n)}}function Qb(e){if(!Wb(e))throw new Error("bad x: need 0 < x < p");let t=bf(e*e),n=bf(t*e+BigInt(7)),r=qb(n);r%Jc!==lu&&(r=bf(-r));let o=new nh(e,r,Vb);return o.assertValidity(),o}function Kb(...e){return Ks(rn(Xc("BIP0340/challenge",...e)))}function t4(e){return Rf(e).bytes}function n4(e,t,n=Ob(32)){let r=jt("message",e),{bytes:o,scalar:i}=Rf(t),a=jt("auxRand",n,32),u=Of(i^rn(Xc("BIP0340/aux",a))),d=Xc("BIP0340/nonce",u,o,r),h=Ks(rn(d));if(h===lu)throw new Error("sign failed: k is zero");let{bytes:m,scalar:b}=Rf(h),_=Kb(m,o,r),T=new Uint8Array(64);if(T.set(m,0),T.set(Of(Ks(b+_*i)),32),!Gb(T,r,o))throw new Error("sign: Invalid signature produced");return T}function Gb(e,t,n){let r=jt("signature",e,64),o=jt("message",t),i=jt("publicKey",n,32);try{let a=Qb(rn(i)),u=rn(r.subarray(0,32));if(!Wb(u))return!1;let d=rn(r.subarray(32,64));if(!Xx(d))return!1;let h=Kb(Of(u),th(a),o),m=e4(a,d,Ks(-h));return!(!m||!m.hasEvenY()||m.toAffine().x!==u)}catch{return!1}}var Gt={getPublicKey:t4,sign:n4,verify:Gb,utils:{randomPrivateKey:eh.utils.randomPrivateKey,lift_x:Qb,pointToBytes:th,numberToBytesBE:po,bytesToNumberBE:rn,taggedHash:Xc,mod:zt}};var Zb=e=>e instanceof Uint8Array,wf=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Yn=(e,t)=>e<<32-t|e>>>t,r4=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!r4)throw new Error("Non little-endian hardware is not supported");var o4=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function et(e){if(!Zb(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=o4[e[n]];return t}function Yb(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){let o=r*2,i=e.slice(o,o+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[r]=a}return n}function i4(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Jb(e){if(typeof e=="string"&&(e=i4(e)),!Zb(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Uf=class{clone(){return this._cloneInto()}};function Xb(e){let t=r=>e().update(Jb(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function zf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function s4(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function ew(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function a4(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");zf(e.outputLen),zf(e.blockLen)}function c4(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u4(e,t){ew(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var yf={number:zf,bool:s4,bytes:ew,hash:a4,exists:c4,output:u4};function l4(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);let o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),u=Number(n&i),d=r?4:0,h=r?0:4;e.setUint32(t+d,a,r),e.setUint32(t+h,u,r)}var Mf=class extends Uf{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=wf(this.buffer)}update(t){yf.exists(this);let{view:n,buffer:r,blockLen:o}=this;t=Jb(t);let i=t.length;for(let a=0;a<i;){let u=Math.min(o-this.pos,i-a);if(u===o){let d=wf(t);for(;o<=i-a;a+=o)this.process(d,a);continue}r.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){yf.exists(this),yf.output(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:i}=this,{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let b=a;b<o;b++)n[b]=0;l4(r,o-8,BigInt(this.length*8),i),this.process(r,0);let u=wf(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=d/4,m=this.get();if(h>m.length)throw new Error("_sha2: outputLen bigger than state");for(let b=0;b<h;b++)u.setUint32(4*b,m[b],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:r,length:o,finished:i,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=i,t.destroyed=a,o%n&&t.buffer.set(r),t}},d4=(e,t,n)=>e&t^~e&n,f4=(e,t,n)=>e&t^e&n^t&n,h4=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ao=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),co=new Uint32Array(64),eu=class extends Mf{constructor(){super(64,32,8,!1),this.A=ao[0]|0,this.B=ao[1]|0,this.C=ao[2]|0,this.D=ao[3]|0,this.E=ao[4]|0,this.F=ao[5]|0,this.G=ao[6]|0,this.H=ao[7]|0}get(){let{A:t,B:n,C:r,D:o,E:i,F:a,G:u,H:d}=this;return[t,n,r,o,i,a,u,d]}set(t,n,r,o,i,a,u,d){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=u|0,this.H=d|0}process(t,n){for(let b=0;b<16;b++,n+=4)co[b]=t.getUint32(n,!1);for(let b=16;b<64;b++){let _=co[b-15],T=co[b-2],A=Yn(_,7)^Yn(_,18)^_>>>3,k=Yn(T,17)^Yn(T,19)^T>>>10;co[b]=k+co[b-7]+A+co[b-16]|0}let{A:r,B:o,C:i,D:a,E:u,F:d,G:h,H:m}=this;for(let b=0;b<64;b++){let _=Yn(u,6)^Yn(u,11)^Yn(u,25),T=m+_+d4(u,d,h)+h4[b]+co[b]|0,k=(Yn(r,2)^Yn(r,13)^Yn(r,22))+f4(r,o,i)|0;m=h,h=d,d=u,u=a+T|0,a=i,i=o,o=r,r=T+k|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,d=d+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(r,o,i,a,u,d,h,m)}roundClean(){co.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Df=class extends eu{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},rh=Xb(()=>new eu);Xb(()=>new Df);var qo=Symbol("verified"),p4=e=>e instanceof Object;function g4(e){if(!p4(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let r=0;r<n.length;r++)if(typeof n[r]=="object")return!1}return!0}new TextDecoder("utf-8");var m4=new TextEncoder;function js(e){e.indexOf("://")===-1&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),(t.port==="80"&&t.protocol==="ws:"||t.port==="443"&&t.protocol==="wss:")&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}var b4=class{constructor(t){we(this,"value"),we(this,"next",null),we(this,"prev",null),this.value=t}},w4=class{constructor(){we(this,"first"),we(this,"last"),this.first=null,this.last=null}enqueue(t){let n=new b4(t);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){let n=this.first;return this.first=null,this.last=null,n.value}let t=this.first;return this.first=t.next,t.value}},y4=class{generateSecretKey(){return Gt.utils.randomPrivateKey()}getPublicKey(t){return et(Gt.getPublicKey(t))}finalizeEvent(t,n){let r=t;return r.pubkey=et(Gt.getPublicKey(n)),r.id=vf(r),r.sig=et(Gt.sign(vf(r),n)),r[qo]=!0,r}verifyEvent(t){if(typeof t[qo]=="boolean")return t[qo];let n=vf(t);if(n!==t.id)return t[qo]=!1,!1;try{let r=Gt.verify(t.sig,n,t.pubkey);return t[qo]=r,r}catch{return t[qo]=!1,!1}}};function v4(e){if(!g4(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function vf(e){let t=rh(m4.encode(v4(e)));return et(t)}var du=new y4;du.generateSecretKey;du.getPublicKey;du.finalizeEvent;var _4=du.verifyEvent,E4=22242;function x4(e,t){if(e.ids&&e.ids.indexOf(t.id)===-1&&!e.ids.some(n=>t.id.startsWith(n))||e.kinds&&e.kinds.indexOf(t.kind)===-1||e.authors&&e.authors.indexOf(t.pubkey)===-1&&!e.authors.some(n=>t.pubkey.startsWith(n)))return!1;for(let n in e)if(n[0]==="#"){let r=n.slice(1),o=e[`#${r}`];if(o&&!t.tags.find(([i,a])=>i===n.slice(1)&&o.indexOf(a)!==-1))return!1}return!(e.since&&t.created_at<e.since||e.until&&t.created_at>e.until)}function k4(e,t){for(let n=0;n<e.length;n++)if(x4(e[n],t))return!0;return!1}function S4(e,t){let n=t.length+3,r=e.indexOf(`"${t}":`)+n,o=e.slice(r).indexOf('"')+r+1;return e.slice(o,o+64)}function A4(e){let t=e.slice(0,22).indexOf('"EVENT"');if(t===-1)return null;let n=e.slice(t+7+1).indexOf('"');if(n===-1)return null;let r=t+7+1+n,o=e.slice(r+1,80).indexOf('"');if(o===-1)return null;let i=r+1+o;return e.slice(r+1,i)}function T4(e,t){return{kind:E4,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}async function $4(){return new Promise(e=>{let t=new MessageChannel,n=()=>{t.port1.removeEventListener("message",n),e()};t.port1.addEventListener("message",n),t.port2.postMessage(0),t.port1.start()})}var B4=e=>(e[qo]=!0,!0),tw;try{tw=WebSocket}catch{}var nw=class{constructor(t,n){we(this,"url"),we(this,"_connected",!1),we(this,"onclose",null),we(this,"onnotice",r=>console.debug(`NOTICE from ${this.url}: ${r}`)),we(this,"_onauth",null),we(this,"baseEoseTimeout",4400),we(this,"connectionTimeout",4400),we(this,"openSubs",new Map),we(this,"connectionTimeoutHandle"),we(this,"connectionPromise"),we(this,"openCountRequests",new Map),we(this,"openEventPublishes",new Map),we(this,"ws"),we(this,"incomingMessageQueue",new w4),we(this,"queueRunning",!1),we(this,"challenge"),we(this,"serial",0),we(this,"verifyEvent"),this.url=js(t),this.verifyEvent=n.verifyEvent}static async connect(t,n){let r=new nw(t,n);return await r.connect(),r}closeAllSubscriptions(t){for(let[n,r]of this.openSubs)r.close(t);this.openSubs.clear();for(let[n,r]of this.openEventPublishes)r.reject(new Error(t));this.openEventPublishes.clear();for(let[n,r]of this.openCountRequests)r.reject(new Error(t));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.connectionPromise=new Promise((t,n)=>{this.connectionTimeoutHandle=setTimeout(()=>{var r;n("connection timed out"),this.connectionPromise=void 0,(r=this.onclose)==null||r.call(this),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new tw(this.url)}catch(r){n(r);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,t()},this.ws.onerror=r=>{var o;n(r.message),this._connected&&(this._connected=!1,this.connectionPromise=void 0,(o=this.onclose)==null||o.call(this),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{var r;this._connected&&(this._connected=!1,this.connectionPromise=void 0,(r=this.onclose)==null||r.call(this),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await $4();this.queueRunning=!1}handleNext(){var t,n,r;let o=this.incomingMessageQueue.dequeue();if(!o)return!1;let i=A4(o);if(i){let a=this.openSubs.get(i);if(!a)return;let u=S4(o,"id"),d=(t=a.alreadyHaveEvent)==null?void 0:t.call(a,u);if((n=a.receivedEvent)==null||n.call(a,this,u),d)return}try{let a=JSON.parse(o);switch(a[0]){case"EVENT":{let u=this.openSubs.get(a[1]),d=a[2];this.verifyEvent(d)&&k4(u.filters,d)&&u.onevent(d);return}case"COUNT":{let u=a[1],d=a[2],h=this.openCountRequests.get(u);h&&(h.resolve(d.count),this.openCountRequests.delete(u));return}case"EOSE":{let u=this.openSubs.get(a[1]);if(!u)return;u.receivedEose();return}case"OK":{let u=a[1],d=a[2],h=a[3],m=this.openEventPublishes.get(u);d?m.resolve(h):m.reject(new Error(h)),this.openEventPublishes.delete(u);return}case"CLOSED":{let u=a[1],d=this.openSubs.get(u);if(!d)return;d.closed=!0,d.close(a[2]);return}case"NOTICE":this.onnotice(a[1]);return;case"AUTH":{this.challenge=a[1],(r=this._onauth)==null||r.call(this,a[1]);return}}}catch{return}}async send(t){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{var n;(n=this.ws)==null||n.send(t)})}async auth(t){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");let n=await t(T4(this.url,this.challenge)),r=new Promise((o,i)=>{this.openEventPublishes.set(n.id,{resolve:o,reject:i})});return this.send('["AUTH",'+JSON.stringify(n)+"]"),r}async publish(t){let n=new Promise((r,o)=>{this.openEventPublishes.set(t.id,{resolve:r,reject:o})});return this.send('["EVENT",'+JSON.stringify(t)+"]"),n}async count(t,n){this.serial++;let r=n?.id||"count:"+this.serial,o=new Promise((i,a)=>{this.openCountRequests.set(r,{resolve:i,reject:a})});return this.send('["COUNT","'+r+'",'+JSON.stringify(t)+"]"),o}subscribe(t,n){let r=this.prepareSubscription(t,n);return r.fire(),r}prepareSubscription(t,n){this.serial++;let r=n.id||"sub:"+this.serial,o=new L4(this,r,t,n);return this.openSubs.set(r,o),o}close(){var t;this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,(t=this.ws)==null||t.close()}_onmessage(t){this.incomingMessageQueue.enqueue(t.data),this.queueRunning||this.runQueue()}},L4=class{constructor(t,n,r,o){we(this,"relay"),we(this,"id"),we(this,"closed",!1),we(this,"eosed",!1),we(this,"filters"),we(this,"alreadyHaveEvent"),we(this,"receivedEvent"),we(this,"onevent"),we(this,"oneose"),we(this,"onclose"),we(this,"eoseTimeout"),we(this,"eoseTimeoutHandle"),this.relay=t,this.filters=r,this.id=n,this.alreadyHaveEvent=o.alreadyHaveEvent,this.receivedEvent=o.receivedEvent,this.eoseTimeout=o.eoseTimeout||t.baseEoseTimeout,this.oneose=o.oneose,this.onclose=o.onclose,this.onevent=o.onevent||(i=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,i)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){var t;this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,(t=this.oneose)==null||t.call(this))}close(t="closed by caller"){var n;!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),(n=this.onclose)==null||n.call(this,t)}},C4=class{constructor(e){we(this,"relays",new Map),we(this,"seenOn",new Map),we(this,"trackRelays",!1),we(this,"verifyEvent"),we(this,"trustedRelayURLs",new Set),this.verifyEvent=e.verifyEvent}async ensureRelay(e,t){e=js(e);let n=this.relays.get(e);return n||(n=new nw(e,{verifyEvent:this.trustedRelayURLs.has(e)?B4:this.verifyEvent}),t?.connectionTimeout&&(n.connectionTimeout=t.connectionTimeout),this.relays.set(e,n)),await n.connect(),n}close(e){e.map(js).forEach(t=>{var n;(n=this.relays.get(t))==null||n.close()})}subscribeMany(e,t,n){this.trackRelays&&(n.receivedEvent=(b,_)=>{let T=this.seenOn.get(_);T||(T=new Set,this.seenOn.set(_,T)),T.add(b)});let r=new Set,o=[],i=[],a=b=>{var _;i[b]=!0,i.filter(T=>T).length===e.length&&((_=n.oneose)==null||_.call(n),a=()=>{})},u=[],d=(b,_)=>{var T;a(b),u[b]=_,u.filter(A=>A).length===e.length&&((T=n.onclose)==null||T.call(n,u),d=()=>{})},h=b=>{var _;if((_=n.alreadyHaveEvent)!=null&&_.call(n,b))return!0;let T=r.has(b);return r.add(b),T},m=Promise.all(e.map(js).map(async(b,_,T)=>{if(T.indexOf(b)!==_){d(_,"duplicate url");return}let A;try{A=await this.ensureRelay(b,{connectionTimeout:n.maxWait?Math.max(n.maxWait*.8,n.maxWait-1e3):void 0})}catch(I){d(_,I?.message||String(I));return}let k=A.subscribe(t,{...n,oneose:()=>a(_),onclose:I=>d(_,I),alreadyHaveEvent:h,eoseTimeout:n.maxWait});o.push(k)}));return{async close(){await m,o.forEach(b=>{b.close()})}}}subscribeManyEose(e,t,n){let r=this.subscribeMany(e,t,{...n,oneose(){r.close()}});return r}async querySync(e,t,n){return new Promise(async r=>{let o=[];this.subscribeManyEose(e,[t],{...n,onevent(i){o.push(i)},onclose(i){r(o)}})})}async get(e,t,n){t.limit=1;let r=await this.querySync(e,t,n);return r.sort((o,i)=>i.created_at-o.created_at),r[0]||null}publish(e,t){return e.map(js).map(async(n,r,o)=>o.indexOf(n)!==r?Promise.reject("duplicate url"):(await this.ensureRelay(n)).publish(t))}},P4=class extends C4{constructor(){super({verifyEvent:_4})}},Gs=Symbol("store-raw"),Xn=Symbol("store-node"),_n=Symbol("store-has"),rw=Symbol("store-self");function ow(e){let t=e[nn];if(!t&&(Object.defineProperty(e,nn,{value:t=new Proxy(e,N4)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){let a=n[o];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function Sr(e){let t;return e!=null&&typeof e=="object"&&(e[nn]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ar(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Gs])return n;if(!Sr(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,u=e.length;a<u;a++)o=e[a],(r=Ar(o,t))!==o&&(e[a]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let a=Object.keys(e),u=Object.getOwnPropertyDescriptors(e);for(let d=0,h=a.length;d<h;d++)i=a[d],!u[i].get&&(o=e[i],(r=Ar(o,t))!==o&&(e[i]=r))}return e}function zi(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Zo(e,t,n){if(e[t])return e[t];let[r,o]=_t(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function I4(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===nn||t===Xn||(delete n.value,delete n.writable,n.get=()=>e[nn][t]),n}function oh(e){Oi()&&Zo(zi(e,Xn),rw)()}function iw(e){return oh(e),Reflect.ownKeys(e)}var N4={get(e,t,n){if(t===Gs)return e;if(t===nn)return n;if(t===Qs)return oh(e),n;let r=zi(e,Xn),o=r[t],i=o?o():e[t];if(t===Xn||t===_n||t==="__proto__")return i;if(!o){let a=Object.getOwnPropertyDescriptor(e,t);Oi()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=Zo(r,t,i)())}return Sr(i)?ow(i):i},has(e,t){return t===Gs||t===nn||t===Qs||t===Xn||t===_n||t==="__proto__"?!0:(Oi()&&Zo(zi(e,_n),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:iw,getOwnPropertyDescriptor:I4};function tn(e,t,n,r=!1){if(!r&&e[t]===n)return;let o=e[t],i=e.length;n===void 0?(delete e[t],e[_n]&&e[_n][t]&&o!==void 0&&e[_n][t].$()):(e[t]=n,e[_n]&&e[_n][t]&&o===void 0&&e[_n][t].$());let a=zi(e,Xn),u;if((u=Zo(a,t,o))&&u.$(()=>n),Array.isArray(e)&&e.length!==i){for(let d=e.length;d<i;d++)(u=a[d])&&u.$();(u=Zo(a,"length",i))&&u.$(e.length)}(u=a[rw])&&u.$()}function sw(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];tn(e,o,t[o])}}function O4(e,t){if(typeof t=="function"&&(t=t(e)),t=Ar(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let o=t[n];e[n]!==o&&tn(e,n,o)}tn(e,"length",r)}else sw(e,t)}function Hs(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();let a=typeof r,u=Array.isArray(e);if(Array.isArray(r)){for(let d=0;d<r.length;d++)Hs(e,[r[d]].concat(t),n);return}else if(u&&a==="function"){for(let d=0;d<e.length;d++)r(e[d],d)&&Hs(e,[d].concat(t),n);return}else if(u&&a==="object"){let{from:d=0,to:h=e.length-1,by:m=1}=r;for(let b=d;b<=h;b+=m)Hs(e,[b].concat(t),n);return}else if(t.length>1){Hs(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Ar(i),r===void 0||Sr(o)&&Sr(i)&&!Array.isArray(i)?sw(o,i):tn(e,r,i))}function R4(...[e,t]){let n=Ar(e||{}),r=Array.isArray(n),o=ow(n);function i(...a){Bi(()=>{r&&a.length===1?O4(n,a[0]):Hs(n,a)})}return[o,i]}function U4(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||n.set||!n.configurable||t===nn||t===Xn||(delete n.value,delete n.writable,n.get=()=>e[nn][t],n.set=r=>e[nn][t]=r),n}var z4={get(e,t,n){if(t===Gs)return e;if(t===nn)return n;if(t===Qs)return oh(e),n;let r=zi(e,Xn),o=r[t],i=o?o():e[t];if(t===Xn||t===_n||t==="__proto__")return i;if(!o){let a=Object.getOwnPropertyDescriptor(e,t),u=typeof i=="function";if(Oi()&&(!u||e.hasOwnProperty(t))&&!(a&&a.get))i=Zo(r,t,i)();else if(i!=null&&u&&i===Array.prototype[t])return(...d)=>Bi(()=>Array.prototype[t].apply(n,d))}return Sr(i)?aw(i):i},has(e,t){return t===Gs||t===nn||t===Qs||t===Xn||t===_n||t==="__proto__"?!0:(Oi()&&Zo(zi(e,_n),t)(),t in e)},set(e,t,n){return Bi(()=>tn(e,t,Ar(n))),!0},deleteProperty(e,t){return Bi(()=>tn(e,t,void 0,!0)),!0},ownKeys:iw,getOwnPropertyDescriptor:U4};function aw(e){let t=e[nn];if(!t){Object.defineProperty(e,nn,{value:t=new Proxy(e,z4)});let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){let a=n[o];if(r[a].get){let u=r[a].get.bind(t);Object.defineProperty(e,a,{get:u})}if(r[a].set){let u=r[a].set;Object.defineProperty(e,a,{set:h=>Bi(()=>u.call(t,h))})}}}return t}function ih(e,t){let n=Ar(e||{});return aw(n)}var Ff=Symbol("store-root");function $i(e,t,n,r,o){let i=t[n];if(e===i)return;if(n!==Ff&&(!Sr(e)||!Sr(i)||o&&e[o]!==i[o])){tn(t,n,e);return}if(Array.isArray(e)){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let d,h,m,b,_,T,A,k;for(m=0,b=Math.min(i.length,e.length);m<b&&(i[m]===e[m]||o&&i[m]&&e[m]&&i[m][o]===e[m][o]);m++)$i(e[m],i,m,r,o);let I=new Array(e.length),O=new Map;for(b=i.length-1,_=e.length-1;b>=m&&_>=m&&(i[b]===e[_]||o&&i[m]&&e[m]&&i[b][o]===e[_][o]);b--,_--)I[_]=i[b];if(m>_||m>b){for(h=m;h<=_;h++)tn(i,h,e[h]);for(;h<e.length;h++)tn(i,h,I[h]),$i(e[h],i,h,r,o);i.length>e.length&&tn(i,"length",e.length);return}for(A=new Array(_+1),h=_;h>=m;h--)T=e[h],k=o&&T?T[o]:T,d=O.get(k),A[h]=d===void 0?-1:d,O.set(k,h);for(d=m;d<=b;d++)T=i[d],k=o&&T?T[o]:T,h=O.get(k),h!==void 0&&h!==-1&&(I[h]=i[d],h=A[h],O.set(k,h));for(h=m;h<e.length;h++)h in I?(tn(i,h,I[h]),$i(e[h],i,h,r,o)):tn(i,h,e[h])}else for(let d=0,h=e.length;d<h;d++)$i(e[d],i,d,r,o);i.length>e.length&&tn(i,"length",e.length);return}let a=Object.keys(e);for(let d=0,h=a.length;d<h;d++)$i(e[a[d]],i,a[d],r,o);let u=Object.keys(i);for(let d=0,h=u.length;d<h;d++)e[u[d]]===void 0&&tn(i,u[d],void 0)}function M4(e,t={}){let{merge:n,key:r="id"}=t,o=Ar(e);return i=>{if(!Sr(i)||!Sr(o))return o;let a=$i(o,{[Ff]:i},Ff,n,r);return a===void 0?i:a}}var Ci=new P4,xe=ih({rootEventIds:[],filter:{},profiles:()=>[]}),Kt=ih({}),D4=["reply","likes","zaps","publish","watch","replyAnonymously","hideContent"],F4=e=>D4.includes(e);function ji(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function $r(...e){let t=(o,i)=>a=>o(i(a)),n=Array.from(e).reverse().reduce((o,i)=>o?t(o,i.encode):i.encode,void 0),r=e.reduce((o,i)=>o?t(o,i.decode):i.decode,void 0);return{encode:n,decode:r}}function Br(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(ji(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);let r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function Lr(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function fu(e,t="="){if(ji(e),typeof t!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of n)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function cw(e){if(typeof e!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function tb(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0,o=[],i=Array.from(e);for(i.forEach(a=>{if(ji(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,u=!0;for(let d=r;d<i.length;d++){let h=i[d],m=t*a+h;if(!Number.isSafeInteger(m)||t*a/t!==a||m-h!==t*a)throw new Error("convertRadix: carry overflow");if(a=m%n,i[d]=Math.floor(m/n),!Number.isSafeInteger(i[d])||i[d]*n+a!==m)throw new Error("convertRadix: carry overflow");if(u)i[d]?u=!1:r=d;else continue}if(o.push(a),u)break}for(let a=0;a<e.length-1&&e[a]===0;a++)o.push(0);return o.reverse()}var uw=(e,t)=>t?uw(t,e%t):e,tu=(e,t)=>e+(t-uw(e,t));function jf(e,t,n,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(tu(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${tu(t,n)}`);let o=0,i=0,a=2**n-1,u=[];for(let d of e){if(ji(d),d>=2**t)throw new Error(`convertRadix2: invalid data word=${d} from=${t}`);if(o=o<<t|d,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)u.push((o>>i-n&a)>>>0);o&=2**i-1}if(o=o<<n-i&a,!r&&i>=t)throw new Error("Excess padding");if(!r&&o)throw new Error(`Non-zero padding: ${o}`);return r&&i>0&&u.push(o>>>0),u}function j4(e){return ji(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return tb(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(tb(t,e,2**8))}}}function go(e,t=!1){if(ji(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(tu(8,e)>32||tu(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return jf(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(jf(n,e,8,t))}}}function nb(e){if(typeof e!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}var H4=$r(go(4),Br("0123456789ABCDEF"),Lr("")),V4=$r(go(5),Br("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fu(5),Lr(""));$r(go(5),Br("0123456789ABCDEFGHIJKLMNOPQRSTUV"),fu(5),Lr(""));$r(go(5),Br("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Lr(""),cw(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));var q4=$r(go(6),Br("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),fu(6),Lr("")),W4=$r(go(6),Br("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),fu(6),Lr("")),sh=e=>$r(j4(58),Br(e),Lr("")),Hf=sh("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");sh("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");sh("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var rb=[0,2,3,5,6,7,9,10,11],Q4={encode(e){let t="";for(let n=0;n<e.length;n+=8){let r=e.subarray(n,n+8);t+=Hf.encode(r).padStart(rb[r.length],"1")}return t},decode(e){let t=[];for(let n=0;n<e.length;n+=11){let r=e.slice(n,n+11),o=rb.indexOf(r.length),i=Hf.decode(r);for(let a=0;a<i.length-o;a++)if(i[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(i.slice(i.length-o)))}return Uint8Array.from(t)}},Vf=$r(Br("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Lr("")),ob=[996825010,642813549,513874426,1027748829,705979059];function Ms(e){let t=e>>25,n=(e&33554431)<<5;for(let r=0;r<ob.length;r++)(t>>r&1)===1&&(n^=ob[r]);return n}function ib(e,t,n=1){let r=e.length,o=1;for(let i=0;i<r;i++){let a=e.charCodeAt(i);if(a<33||a>126)throw new Error(`Invalid prefix (${e})`);o=Ms(o)^a>>5}o=Ms(o);for(let i=0;i<r;i++)o=Ms(o)^e.charCodeAt(i)&31;for(let i of t)o=Ms(o)^i;for(let i=0;i<6;i++)o=Ms(o);return o^=n,Vf.encode(jf([o%2**30],30,5,!1))}function lw(e){let t=e==="bech32"?1:734539939,n=go(5),r=n.decode,o=n.encode,i=nb(r);function a(m,b,_=90){if(typeof m!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof m}`);if(!Array.isArray(b)||b.length&&typeof b[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof b}`);let T=m.length+7+b.length;if(_!==!1&&T>_)throw new TypeError(`Length ${T} exceeds limit ${_}`);return m=m.toLowerCase(),`${m}1${Vf.encode(b)}${ib(m,b,t)}`}function u(m,b=90){if(typeof m!="string")throw new Error(`bech32.decode input should be string, not ${typeof m}`);if(m.length<8||b!==!1&&m.length>b)throw new TypeError(`Wrong string length: ${m.length} (${m}). Expected (8..${b})`);let _=m.toLowerCase();if(m!==_&&m!==m.toUpperCase())throw new Error("String must be lowercase or uppercase");m=_;let T=m.lastIndexOf("1");if(T===0||T===-1)throw new Error('Letter "1" must be present between prefix and data only');let A=m.slice(0,T),k=m.slice(T+1);if(k.length<6)throw new Error("Data must be at least 6 characters long");let I=Vf.decode(k).slice(0,-6),O=ib(A,I,t);if(!k.endsWith(O))throw new Error(`Invalid checksum in ${m}: expected "${O}"`);return{prefix:A,words:I}}let d=nb(u);function h(m){let{prefix:b,words:_}=u(m,!1);return{prefix:b,words:_,bytes:r(_)}}return{encode:a,decode:u,decodeToBytes:h,decodeUnsafe:d,fromWords:r,fromWordsUnsafe:i,toWords:o}}var Mi=lw("bech32");lw("bech32m");var K4={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},G4=$r(go(4),Br("0123456789abcdef"),Lr(""),cw(e=>{if(typeof e!="string"||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),Z4={utf8:K4,hex:G4,base16:H4,base32:V4,base64:q4,base64url:W4,base58:Hf,base58xmr:Q4};`${Object.keys(Z4).join(", ")}`;var Ds=new TextDecoder("utf-8");new TextEncoder;var dw=5e3;function Dc(e){var t,n,r,o,i,a,u,d;let{prefix:h,words:m}=Mi.decode(e,dw),b=new Uint8Array(Mi.fromWords(m));switch(h){case"nprofile":{let _=Rc(b);if(!((t=_[0])!=null&&t[0]))throw new Error("missing TLV 0 for nprofile");if(_[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:et(_[0][0]),relays:_[1]?_[1].map(T=>Ds.decode(T)):[]}}}case"nevent":{let _=Rc(b);if(!((n=_[0])!=null&&n[0]))throw new Error("missing TLV 0 for nevent");if(_[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(_[2]&&_[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(_[3]&&_[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:et(_[0][0]),relays:_[1]?_[1].map(T=>Ds.decode(T)):[],author:(r=_[2])!=null&&r[0]?et(_[2][0]):void 0,kind:(o=_[3])!=null&&o[0]?parseInt(et(_[3][0]),16):void 0}}}case"naddr":{let _=Rc(b);if(!((i=_[0])!=null&&i[0]))throw new Error("missing TLV 0 for naddr");if(!((a=_[2])!=null&&a[0]))throw new Error("missing TLV 2 for naddr");if(_[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((u=_[3])!=null&&u[0]))throw new Error("missing TLV 3 for naddr");if(_[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:Ds.decode(_[0][0]),pubkey:et(_[2][0]),kind:parseInt(et(_[3][0]),16),relays:_[1]?_[1].map(T=>Ds.decode(T)):[]}}}case"nrelay":{let _=Rc(b);if(!((d=_[0])!=null&&d[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:Ds.decode(_[0][0])}}case"nsec":return{type:h,data:b};case"npub":case"note":return{type:h,data:et(b)};default:throw new Error(`unknown prefix ${h}`)}}function Rc(e){let t={},n=e;for(;n.length>0;){let r=n[0],o=n[1],i=n.slice(2,2+o);if(n=n.slice(2+o),i.length<o)throw new Error(`not enough data to read on TLV ${r}`);t[r]=t[r]||[],t[r].push(i)}return t}function fw(e){return hw("npub",Yb(e))}function sb(e){return hw("note",Yb(e))}function Y4(e,t){let n=Mi.toWords(t);return Mi.encode(e,n,dw)}function hw(e,t){return Y4(e,t)}var Fs=new TextDecoder("utf-8");new TextEncoder;var J4=5e3,X4=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function pw(e){var t,n,r,o,i,a,u,d;let{prefix:h,words:m}=Mi.decode(e,J4),b=new Uint8Array(Mi.fromWords(m));switch(h){case"nprofile":{let _=Uc(b);if(!((t=_[0])!=null&&t[0]))throw new Error("missing TLV 0 for nprofile");if(_[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:et(_[0][0]),relays:_[1]?_[1].map(T=>Fs.decode(T)):[]}}}case"nevent":{let _=Uc(b);if(!((n=_[0])!=null&&n[0]))throw new Error("missing TLV 0 for nevent");if(_[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(_[2]&&_[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(_[3]&&_[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:et(_[0][0]),relays:_[1]?_[1].map(T=>Fs.decode(T)):[],author:(r=_[2])!=null&&r[0]?et(_[2][0]):void 0,kind:(o=_[3])!=null&&o[0]?parseInt(et(_[3][0]),16):void 0}}}case"naddr":{let _=Uc(b);if(!((i=_[0])!=null&&i[0]))throw new Error("missing TLV 0 for naddr");if(!((a=_[2])!=null&&a[0]))throw new Error("missing TLV 2 for naddr");if(_[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((u=_[3])!=null&&u[0]))throw new Error("missing TLV 3 for naddr");if(_[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:Fs.decode(_[0][0]),pubkey:et(_[2][0]),kind:parseInt(et(_[3][0]),16),relays:_[1]?_[1].map(T=>Fs.decode(T)):[]}}}case"nrelay":{let _=Uc(b);if(!((d=_[0])!=null&&d[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:Fs.decode(_[0][0])}}case"nsec":return{type:h,data:b};case"npub":case"note":return{type:h,data:et(b)};default:throw new Error(`unknown prefix ${h}`)}}function Uc(e){let t={},n=e;for(;n.length>0;){let r=n[0],o=n[1],i=n.slice(2,2+o);if(n=n.slice(2+o),i.length<o)throw new Error(`not enough data to read on TLV ${r}`);t[r]=t[r]||[],t[r].push(i)}return t}var ek=new RegExp(`nostr:(${X4.source})`),gw=()=>new RegExp(`\\b${ek.source}\\b`,"g");function*tk(e){let t=e.matchAll(gw());for(let n of t)try{let[r,o]=n;yield{uri:r,value:o,decoded:pw(o),start:n.index,end:n.index+r.length}}catch{}}function nk(e,t){return e.replaceAll(gw(),(n,r)=>t({uri:n,value:r,decoded:pw(r)}))}var rk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ok(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(rk,function(){function n(u){return u.replace(/\\([(){}[\]#*+\-.!_\\])/g,function(d,h){return String.fromCharCode(1,o.indexOf(h)+i)}).replace(/(\*\*|__|~~)(\S(?:[\s\S]*?\S)?)\1/g,function(d,h,m){return h==="~~"?"<del>"+m+"</del>":"<b>"+m+"</b>"}).replace(/(\n|^|\W)([_\*])(\S(?:[\s\S]*?\S)?)\2(\W|$|\n)/g,function(d,h,m,b,_){return h+"<i>"+b+"</i>"+_}).replace(/(!?)\[([^\]<>]+)\]\((\+?)([^ \)<>]+)(?: "([^\(\)\"]+)")?\)/g,function(d,h,m,b,_,T){var A=T?' title="'+T+'"':"";return h?'<img src="'+a.href(_)+'" alt="'+m+'"'+A+"/>":(b&&(A+=' target="_blank"'),'<a href="'+a.href(_)+'"'+A+">"+m+"</a>")})}function r(u){return u.replace(/\x01([\x0f-\x1c])/g,function(d,h){return o.charAt(h.charCodeAt(0)-i)})}var o="\\[!]#{()}*+-._",i=16,a=function(u){return u.replace(/.+(?:\n.+)*/g,function(d){var h=/^\s{4}([^]*)$/.exec(d);if(h)return"<pre><code>"+h[1].replace(/\n /g,`
|
|
`)+"</code></pre>";for(var m,b=[],_=n(d).split(`
|
|
`),T=0,A=_.length;A>T;++T){var k=_[T],I=/^\s{0,3}(\#{1,6})\s+(.*?)\s*#*\s*$/.exec(k);if(I)b.push(m=[I[2],"h",I[1].length]);else{var O=/^(\s*)(?:[-*]|(\d[.)])) (.+)$/.exec(k);O?b.push(m=[O[3],O[2]?"ol":"ul",O[1].length]):/^\s{0,3}([-])(\s*\1){2,}\s*$/.test(k)?b.push(m=["","hr"]):m&&m[1]!=="hr"&&m[1]!=="h"?m[0]+=`
|
|
`+k:b.push(m=[k,"p",""])}}var L="",f=[];for(T=0,A=b.length;A>T;++T){m=b[T];var p=m[0],w=m[1],v=m[2];if(w==="ul"||w==="ol")!f.length||v>f[0][1]?(f.unshift([w,v]),L+="<"+f[0][0]+"><li>"+p):f.length>1&&v<=f[1][1]?(L+="</li></"+f.shift()[0]+">",--T):L+="</li><li>"+p;else{for(;f.length;)L+="</li></"+f.shift()[0]+">";L+=w==="hr"?"<hr/>":"<"+w+v+a.headAttrs(v,p)+">"+p+"</"+w+v+">"}}for(;f.length;)L+="</li></"+f.shift()[0]+">";return r(L)})};return a.href=function(u){return u},a.headAttrs=function(u,d){return""},a})})(mw);var ik=mw.exports,sk=ok(ik);function ak(e){return async()=>new Promise(t=>{setTimeout(t,e)})}function ck(e,{delay:t=void 0}={}){if(typeof t!="number"&&t!==void 0)throw new TypeError(`Expected \`interval\` to be of type \`number\` but received type \`${typeof t}\``);let n=t===void 0?async()=>{}:ak(t),r=[];return o=>{r.push(o),r.length===1&&(async()=>(await n(),e(r),r=[]))()}}var uk=(e,t)=>t.some(n=>e instanceof n),ab,cb;function lk(){return ab||(ab=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function dk(){return cb||(cb=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var bw=new WeakMap,qf=new WeakMap,ww=new WeakMap,_f=new WeakMap,ah=new WeakMap;function fk(e){let t=new Promise((n,r)=>{let o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{n(fo(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&bw.set(n,e)}).catch(()=>{}),ah.set(t,e),t}function hk(e){if(qf.has(e))return;let t=new Promise((n,r)=>{let o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)});qf.set(e,t)}var Wf={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return qf.get(e);if(t==="objectStoreNames")return e.objectStoreNames||ww.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return fo(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function pk(e){Wf=e(Wf)}function gk(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){let r=e.call(Ef(this),t,...n);return ww.set(r,t.sort?t.sort():[t]),fo(r)}:dk().includes(e)?function(...t){return e.apply(Ef(this),t),fo(bw.get(this))}:function(...t){return fo(e.apply(Ef(this),t))}}function mk(e){return typeof e=="function"?gk(e):(e instanceof IDBTransaction&&hk(e),uk(e,lk())?new Proxy(e,Wf):e)}function fo(e){if(e instanceof IDBRequest)return fk(e);if(_f.has(e))return _f.get(e);let t=mk(e);return t!==e&&(_f.set(e,t),ah.set(t,e)),t}var Ef=e=>ah.get(e);function bk(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){let a=indexedDB.open(e,t),u=fo(a);return r&&a.addEventListener("upgradeneeded",d=>{r(fo(a.result),d.oldVersion,d.newVersion,fo(a.transaction),d)}),n&&a.addEventListener("blocked",d=>n(d.oldVersion,d.newVersion,d)),u.then(d=>{i&&d.addEventListener("close",()=>i()),o&&d.addEventListener("versionchange",h=>o(h.oldVersion,h.newVersion,h))}).catch(()=>{}),u}var wk=["get","getKey","getAll","getAllKeys","count"],yk=["put","add","delete","clear"],xf=new Map;function ub(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(xf.get(t))return xf.get(t);let n=t.replace(/FromIndex$/,""),r=t!==n,o=yk.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||wk.includes(n)))return;let i=async function(a,...u){let d=this.transaction(a,o?"readwrite":"readonly"),h=d.store;return r&&(h=h.index(u.shift())),(await Promise.all([h[n](...u),o&&d.done]))[0]};return xf.set(t,i),i}pk(e=>({...e,get:(t,n,r)=>ub(t,n)||e.get(t,n,r),has:(t,n)=>!!ub(t,n)||e.has(t,n)}));function vk(e){let t={reply:void 0,root:void 0,mentions:[],profiles:[]},n=[];for(let r of e.tags)r[0]==="e"&&r[1]&&n.push(r),r[0]==="p"&&r[1]&&t.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;r<n.length;r++){let o=n[r],[i,a,u,d]=o,h={id:a,relays:u?[u]:[]},m=r===0,b=r===n.length-1;if(d==="root"){t.root=h;continue}if(d==="reply"){t.reply=h;continue}if(d==="mention"){t.mentions.push(h);continue}if(m){t.root=h;continue}if(b){t.reply=h;continue}t.mentions.push(h)}return t}var Vs={events:"id",aggregates:["eid","k"],profiles:["pk"],relays:["n","a"]},_k=async(e,t)=>{if(t<=1){let i=[...e.objectStoreNames];await Promise.all(i.map(a=>e.deleteObjectStore(a)))}let n=e.createObjectStore("events",{keyPath:Vs.events});n.createIndex("a","a"),n.createIndex("ro","ro"),n.createIndex("r","r"),n.createIndex("d","d"),n.createIndex("k","k"),e.createObjectStore("aggregates",{keyPath:Vs.aggregates}),e.createObjectStore("profiles",{keyPath:Vs.profiles}).createIndex("l","l"),e.createObjectStore("relays",{keyPath:Vs.relays}).createIndex("a","a")},nu=e=>{var t,n;let r=vk(e),o=e.tags.find(k=>k[0]==="a"),i=o&&o[1],a=o&&o[3]==="mention",u=e.tags.find(k=>k[0]==="r"),d=u&&u[1],h=e.tags.filter(k=>k[0]==="t"),m=[...new Set(h.map(k=>k[1]))],b=e.tags.find(k=>k[0]==="d"),_=b&&b[1],T=e.tags.find(k=>k[0]==="title"),A=T&&T[1];return{id:e.id??"",k:e.kind,c:e.content,ts:e.created_at,pk:e.pubkey,ro:(t=r.root)==null?void 0:t.id,re:(n=r.reply)==null?void 0:n.id,me:r.mentions.map(k=>k.id),p:r.profiles.map(k=>k.pubkey),a:i,am:a,r:d,t:m,d:_,tl:A}},Ek=()=>({}),Pi=Ek(),lb=!0,db,hu=async()=>{if(lb!==!1)try{return db||(db=await bk("zapthreads",2,{upgrade:_k}))}catch{lb=!1}},zc=e=>{let t=We(lo(e,()=>{let[n,r,o]=e(),i=()=>Di(n,r,o),[a,{mutate:u}]=Eb(()=>qs[n],i,{initialValue:[],storage:yw});return Di(n,r,o).then(u),a}));return()=>t()()},fb=e=>{let t=We(lo(e,()=>{let[n,r,o]=e(),i=()=>Ii(n,r,o),[a,{mutate:u}]=Eb(()=>qs[n],i,{initialValue:void 0,storage:yw});return Ii(n,r,o).then(u),a}));return()=>t()()},Di=async(e,t,n)=>{let r=await hu();if(!r){let o=Pi[e];if(o){if(n){let i=Array.isArray(t)?t:[t];return Object.values(o).filter(a=>i.includes(a[n.index]))}return Object.values(o)}return[]}if(t&&n){if(Array.isArray(t)){let o=t.map(a=>r.getAllFromIndex(e,n.index,a));return(await Promise.all(o)).flat()}return r.getAllFromIndex(e,n.index,t)}return r.getAll(e)},Ii=async(e,t,n)=>{let r=await hu();if(!r){let o=Pi[e];if(o){if(n)return Object.values(o).find(a=>a[n.index]===t);let i=(t.lower?t.lower:t).toString();return o[i]}return}return n?r.getFromIndex(e,n.index,t):r.get(e,t)},kf={},hb=(e,t)=>{Pi[e]??(Pi[e]={});for(let n of t){let r=Vs[e];r=Array.isArray(r)?r:[r];let o=r.map(i=>n[i]).join(",");Pi[e][o]=n}},xn=async(e,t,n={immediate:!1})=>{let r=await hu();if(n.immediate){r?r.put(e,t):hb(e,[t]),qs[e]=+new Date;return}kf[e]||(kf[e]=ck(async o=>{if(!r){hb(e,o),qs[e]=+new Date;return}let i=r.transaction(e,"readwrite");await Promise.all([...o.map(u=>i.store.put(u)),i.done])&&(qs[e]=+new Date)},{delay:96})),kf[e](t)},xk=async()=>{let e=await hu();if(!e){Pi={};return}let t=[...e.objectStoreNames];await Promise.all(t.map(n=>e.clear(n)))},qs=ih({});function yw(e){let[t,n]=R4({value:e});return[()=>t.value,r=>{let o=Ar(t.value);return typeof r=="function"&&(r=r(o)),n("value",M4(r)),t.value}]}var vw=async(e,t,n)=>{let r=+new Date,o=216e5,i=[...new Set(e)].filter(u=>{let d=n.find(h=>h.pk===u);return!(d?.l&&d.l>r-o)}).filter(u=>!!u);if(i.length===0)return;let a=await Ci.querySync(t,{kinds:[0],authors:i});for(let u of i){let d=a.find(h=>h.pubkey===u);if(d){let h=JSON.parse(d.content),m=d.pubkey,b={pk:m,ts:d.created_at,i:h.image||h.picture,n:h.displayName||h.display_name||h.name},_=n.find(T=>T.pk===m);!_||!_?.n||_.ts<b.ts?xn("profiles",{...b,l:r}):xn("profiles",{..._,l:r})}}},kk=async(e,t)=>{let r=(await Di("relays",e.value,{index:"a"})).filter(o=>t.includes(o.n)).map(o=>o.l);return r.length>0?Math.min(...r)+1:0},Sk=async(e,t)=>{let n={};for(let o of t){let i=Ci.seenOn.get(o.id);if(i)for(let a of i)o.ts>(n[a.url]||0)&&(n[a.url]=o.ts)}let r=await Di("relays",e.value,{index:"a"});for(let o in n){let i=r.find(a=>a.n===o);i?n[o]>i.l&&(i.l=n[o],xn("relays",i)):xn("relays",{n:o,a:e.value,l:n[o]})}},Ak=new RegExp("(?<=^|\\s)https?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&\\/\\/=]*)","gi"),Tk=/(\S*(?:png|jpg|jpeg|gif|webp))/gi,$k=new RegExp("(?<=^|\\s)@?((naddr|npub|nevent|note)[a-z0-9]{20,})","g"),Bk=/\`(.*?)\`/g,Lk=/\B\#([a-zA-Z0-9]+\b)(?!;)/g,_w=(e,t,n=[])=>{let r=e.c,o=t.urlPrefixes,i=t.profiles;r=r.replace(Ak,u=>u.match(Tk)?``:`[${u}](${u})`);let a=[...new Set(e.t)];if(a.length>0){let u=new RegExp(`(^|\\s)\\#(${a.join("|")})`,"gi");r=r.replaceAll(u,`$1[#$2](${o.tag}$2)`)}return r=r.replaceAll($k,"nostr:$1"),r=nk(r,({decoded:u,value:d})=>{switch(u.type){case"nprofile":let h=i().find(k=>k.pk===u.data.pubkey);return`[@${h?.n||Qo(d)}](${o.nprofile}${d})`;case"npub":let b=i().find(k=>k.pk===u.data);return`[@${b?.n||Qo(d)}](${o.npub}${d})`;case"note":return`[@${Qo(d)}](${o.note}${d})`;case"naddr":let T=u.data,A=n.find(k=>k.pk===T.pubkey&&k.d===T.identifier);return A&&A.tl?`[${A.tl}](${o.naddr}${d})`:`[@${Qo(d)}](${o.naddr}${d})`;case"nevent":return`[@${Qo(d)}](${o.nevent}${d})`;default:return d}}),r=r.replaceAll(Bk,"<code>$1</code>"),sk(r.trim())},Ck=e=>{let t=[],n=tk(e);for(let i of n){if(i.decoded.type==="npub"&&t.push(["p",i.decoded.data]),i.decoded.type==="naddr"){let a=i.decoded.data;t.push(["a",`${a.kind}:${a.pubkey}:${a.identifier}`,"","mention"])}i.decoded.type==="nevent"&&t.push(["e",i.decoded.data.id]),i.decoded.type==="note"&&t.push(["e",i.decoded.data])}let r=e.matchAll(Lk),o=new Set([...r].map(i=>i[1].toLowerCase()));for(let i of o)t.push(["t",i]);return t},Pk=(e="")=>{let t={naddr:"https://nostr.com/",npub:"https://nostr.com/",nprofile:"https://nostr.com/",nevent:"https://nostr.com/",note:"https://nostr.com/",tag:"https://snort.social/t/"};for(let n of e.split(",")){let[r,o]=n.split(":");o&&(t[r]=`https://${o}`)}return t},Qo=e=>e.substring(0,8)+"..."+e.substring(e.length-4),Fc=e=>e.sort((t,n)=>(t.ts||0)>=(n.ts||0)?-1:1),Un=20,jc='data:image/svg+xml;utf-8,<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><circle cx="512" cy="512" r="512" fill="%23333" fill-rule="evenodd" /></svg>',Ik=e=>{let t=new Date,n=Math.floor((t.getTime()-e)/1e3);if(n<60)return"now";if(n<3600){let r=Math.floor(n/60);return`${r} minute${r===1?"":"s"} ago`}if(n<=86400){let r=Math.floor(n/3600);return`${r} hour${r===1?"":"s"} ago`}if(n<=604800){let r=Math.floor(n/86400);return`${r} day${r===1?"":"s"} ago`}if(n>604800){let r=new Date(e),o=r.toLocaleDateString("en-us",{day:"numeric",month:"long"}),i=r.getFullYear()===t.getFullYear()?"":" "+r.getFullYear();return"on "+o+i}return""},Nk=e=>e<1e4?e.toString():e<1e6?Math.round(e/1e3)+"k":Math.round(e/1e6)+"M",ch=e=>e.children.reduce((t,n)=>t+ch(n),e.children.length),Ok=/\/+$/,Rk=(e,t=!0)=>{let n=new URL(e);return n.hash="",t&&(n.pathname=n.pathname.replace(Ok,"")),n.toString()},Ew=(e,t)=>{let n=e.map(o=>({...o,children:[]})),r=new Set(n.filter(o=>{if(t){let i=t.id===(o.re||o.ro);return i&&(o.parent=t),i}return!n.find(i=>i.id===(o.re||o.ro))}));n=n.filter(o=>!r.has(o));for(let o of r)o.children.push(...Ew(n,o));return[...r]},Ai=Symbol("verified"),Uk=e=>e instanceof Object;function zk(e){if(!Uk(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let r=0;r<n.length;r++)if(typeof n[r]=="object")return!1}return!0}new TextDecoder("utf-8");var Mk=new TextEncoder,Dk=class{generateSecretKey(){return Gt.utils.randomPrivateKey()}getPublicKey(t){return et(Gt.getPublicKey(t))}finalizeEvent(t,n){let r=t;return r.pubkey=et(Gt.getPublicKey(n)),r.id=Ws(r),r.sig=et(Gt.sign(Ws(r),n)),r[Ai]=!0,r}verifyEvent(t){if(typeof t[Ai]=="boolean")return t[Ai];let n=Ws(t);if(n!==t.id)return t[Ai]=!1,!1;try{let r=Gt.verify(t.sig,n,t.pubkey);return t[Ai]=r,r}catch{return t[Ai]=!1,!1}}};function Fk(e){if(!zk(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function Ws(e){let t=rh(Mk.encode(Fk(e)));return et(t)}var pu=new Dk,jk=pu.generateSecretKey,xw=pu.getPublicKey,kw=pu.finalizeEvent;pu.verifyEvent;var Hk=e=>{Ni(()=>{let t=e();t&&setTimeout(()=>t.focus())})},Ti=Symbol("verified"),Vk=e=>e instanceof Object;function qk(e){if(!Vk(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let r=0;r<n.length;r++)if(typeof n[r]=="object")return!1}return!0}new TextDecoder("utf-8");var Wk=new TextEncoder;function Qk(e){e.indexOf("://")===-1&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),(t.port==="80"&&t.protocol==="ws:"||t.port==="443"&&t.protocol==="wss:")&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}var Kk=class{constructor(e){we(this,"value"),we(this,"next",null),we(this,"prev",null),this.value=e}},Gk=class{constructor(){we(this,"first"),we(this,"last"),this.first=null,this.last=null}enqueue(e){let t=new Kk(e);return this.last?this.last===this.first?(this.last=t,this.last.prev=this.first,this.first.next=t):(t.prev=this.last,this.last.next=t,this.last=t):(this.first=t,this.last=t),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){let t=this.first;return this.first=null,this.last=null,t.value}let e=this.first;return this.first=e.next,e.value}},Zk=class{generateSecretKey(){return Gt.utils.randomPrivateKey()}getPublicKey(e){return et(Gt.getPublicKey(e))}finalizeEvent(e,t){let n=e;return n.pubkey=et(Gt.getPublicKey(t)),n.id=Sf(n),n.sig=et(Gt.sign(Sf(n),t)),n[Ti]=!0,n}verifyEvent(e){if(typeof e[Ti]=="boolean")return e[Ti];let t=Sf(e);if(t!==e.id)return e[Ti]=!1,!1;try{let n=Gt.verify(e.sig,t,e.pubkey);return e[Ti]=n,n}catch{return e[Ti]=!1,!1}}};function Yk(e){if(!qk(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function Sf(e){let t=rh(Wk.encode(Yk(e)));return et(t)}var gu=new Zk;gu.generateSecretKey;gu.getPublicKey;gu.finalizeEvent;var Jk=gu.verifyEvent,Xk=22242;function e6(e,t){if(e.ids&&e.ids.indexOf(t.id)===-1&&!e.ids.some(n=>t.id.startsWith(n))||e.kinds&&e.kinds.indexOf(t.kind)===-1||e.authors&&e.authors.indexOf(t.pubkey)===-1&&!e.authors.some(n=>t.pubkey.startsWith(n)))return!1;for(let n in e)if(n[0]==="#"){let r=n.slice(1),o=e[`#${r}`];if(o&&!t.tags.find(([i,a])=>i===n.slice(1)&&o.indexOf(a)!==-1))return!1}return!(e.since&&t.created_at<e.since||e.until&&t.created_at>e.until)}function t6(e,t){for(let n=0;n<e.length;n++)if(e6(e[n],t))return!0;return!1}function n6(e,t){let n=t.length+3,r=e.indexOf(`"${t}":`)+n,o=e.slice(r).indexOf('"')+r+1;return e.slice(o,o+64)}function r6(e){let t=e.slice(0,22).indexOf('"EVENT"');if(t===-1)return null;let n=e.slice(t+7+1).indexOf('"');if(n===-1)return null;let r=t+7+1+n,o=e.slice(r+1,80).indexOf('"');if(o===-1)return null;let i=r+1+o;return e.slice(r+1,i)}function o6(e,t){return{kind:Xk,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}async function i6(){return new Promise(e=>{let t=new MessageChannel,n=()=>{t.port1.removeEventListener("message",n),e()};t.port1.addEventListener("message",n),t.port2.postMessage(0),t.port1.start()})}var Sw;try{Sw=WebSocket}catch{}var Aw=class{constructor(e,t){we(this,"url"),we(this,"_connected",!1),we(this,"onclose",null),we(this,"onnotice",n=>console.debug(`NOTICE from ${this.url}: ${n}`)),we(this,"_onauth",null),we(this,"baseEoseTimeout",4400),we(this,"connectionTimeout",4400),we(this,"openSubs",new Map),we(this,"connectionTimeoutHandle"),we(this,"connectionPromise"),we(this,"openCountRequests",new Map),we(this,"openEventPublishes",new Map),we(this,"ws"),we(this,"incomingMessageQueue",new Gk),we(this,"queueRunning",!1),we(this,"challenge"),we(this,"serial",0),we(this,"verifyEvent"),this.url=Qk(e),this.verifyEvent=t.verifyEvent}static async connect(e,t){let n=new Aw(e,t);return await n.connect(),n}closeAllSubscriptions(e){for(let[t,n]of this.openSubs)n.close(e);this.openSubs.clear();for(let[t,n]of this.openEventPublishes)n.reject(new Error(e));this.openEventPublishes.clear();for(let[t,n]of this.openCountRequests)n.reject(new Error(e));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.connectionPromise=new Promise((e,t)=>{this.connectionTimeoutHandle=setTimeout(()=>{var n;t("connection timed out"),this.connectionPromise=void 0,(n=this.onclose)==null||n.call(this),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new Sw(this.url)}catch(n){t(n);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,e()},this.ws.onerror=n=>{var r;t(n.message),this._connected&&(this._connected=!1,this.connectionPromise=void 0,(r=this.onclose)==null||r.call(this),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{var n;this._connected&&(this._connected=!1,this.connectionPromise=void 0,(n=this.onclose)==null||n.call(this),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await i6();this.queueRunning=!1}handleNext(){var e,t,n;let r=this.incomingMessageQueue.dequeue();if(!r)return!1;let o=r6(r);if(o){let i=this.openSubs.get(o);if(!i)return;let a=n6(r,"id"),u=(e=i.alreadyHaveEvent)==null?void 0:e.call(i,a);if((t=i.receivedEvent)==null||t.call(i,this,a),u)return}try{let i=JSON.parse(r);switch(i[0]){case"EVENT":{let a=this.openSubs.get(i[1]),u=i[2];this.verifyEvent(u)&&t6(a.filters,u)&&a.onevent(u);return}case"COUNT":{let a=i[1],u=i[2],d=this.openCountRequests.get(a);d&&(d.resolve(u.count),this.openCountRequests.delete(a));return}case"EOSE":{let a=this.openSubs.get(i[1]);if(!a)return;a.receivedEose();return}case"OK":{let a=i[1],u=i[2],d=i[3],h=this.openEventPublishes.get(a);u?h.resolve(d):h.reject(new Error(d)),this.openEventPublishes.delete(a);return}case"CLOSED":{let a=i[1],u=this.openSubs.get(a);if(!u)return;u.closed=!0,u.close(i[2]);return}case"NOTICE":this.onnotice(i[1]);return;case"AUTH":{this.challenge=i[1],(n=this._onauth)==null||n.call(this,i[1]);return}}}catch{return}}async send(e){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{var t;(t=this.ws)==null||t.send(e)})}async auth(e){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");let t=await e(o6(this.url,this.challenge)),n=new Promise((r,o)=>{this.openEventPublishes.set(t.id,{resolve:r,reject:o})});return this.send('["AUTH",'+JSON.stringify(t)+"]"),n}async publish(e){let t=new Promise((n,r)=>{this.openEventPublishes.set(e.id,{resolve:n,reject:r})});return this.send('["EVENT",'+JSON.stringify(e)+"]"),t}async count(e,t){this.serial++;let n=t?.id||"count:"+this.serial,r=new Promise((o,i)=>{this.openCountRequests.set(n,{resolve:o,reject:i})});return this.send('["COUNT","'+n+'",'+JSON.stringify(e)+"]"),r}subscribe(e,t){let n=this.prepareSubscription(e,t);return n.fire(),n}prepareSubscription(e,t){this.serial++;let n=t.id||"sub:"+this.serial,r=new s6(this,n,e,t);return this.openSubs.set(n,r),r}close(){var e;this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,(e=this.ws)==null||e.close()}_onmessage(e){this.incomingMessageQueue.enqueue(e.data),this.queueRunning||this.runQueue()}},s6=class{constructor(e,t,n,r){we(this,"relay"),we(this,"id"),we(this,"closed",!1),we(this,"eosed",!1),we(this,"filters"),we(this,"alreadyHaveEvent"),we(this,"receivedEvent"),we(this,"onevent"),we(this,"oneose"),we(this,"onclose"),we(this,"eoseTimeout"),we(this,"eoseTimeoutHandle"),this.relay=e,this.filters=n,this.id=t,this.alreadyHaveEvent=r.alreadyHaveEvent,this.receivedEvent=r.receivedEvent,this.eoseTimeout=r.eoseTimeout||e.baseEoseTimeout,this.oneose=r.oneose,this.onclose=r.onclose,this.onevent=r.onevent||(o=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,o)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){var e;this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,(e=this.oneose)==null||e.call(this))}close(e="closed by caller"){var t;!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),(t=this.onclose)==null||t.call(this,e)}},Tw=class extends Aw{constructor(e){super(e,{verifyEvent:Jk})}static async connect(e){let t=new Tw(e);return await t.connect(),t}};new TextDecoder("utf-8");new TextEncoder;function a6(e){e.indexOf("://")===-1&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),(t.port==="80"&&t.protocol==="ws:"||t.port==="443"&&t.protocol==="wss:")&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}var c6=He("<div class=ztr-comment-info-picture><img>"),u6=He("<div class=ztr-reply-form><textarea></textarea><div class=ztr-reply-controls>"),l6=He("<span>Publishing is disabled"),d6=He("<span class=ztr-reply-error>Error: "),f6=He('<svg class=ztr-spinner viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none stroke-width=5>'),h6=He("<button class=ztr-reply-button>Reply as "),p6=He("<button class=ztr-reply-button>Reply anonymously"),g6=He("<button class=ztr-reply-login-button>Log in"),m6=He("<li class=ztr-comment-action-like><span> likes"),b6=He("<li class=ztr-comment-action-zap><span> sats"),w6=He("<div class=ztr-comment-new><div class=ztr-comment-body><ul class=ztr-comment-actions>"),$w=e=>{let[t,n]=_t(""),[r,o]=_t(!1),[i,a]=_t(),[u,d]=_t(""),h=()=>xe.anchor,m=xe.profiles,b=()=>xe.relays,_=async()=>{if(!window.nostr){A("Error: No NIP-07 extension!");return}let L=await window.nostr.getPublicKey();Kt.internal={pk:L,signEvent:async f=>window.nostr.signEvent(f)},d(""),Kt.active=Kt.internal};Ni(async()=>{if(Kt.active){let L=Kt.active.pk,f=m().find(p=>p.pk===L);f||(f={pk:L,l:0,ts:0},await xn("profiles",f)),a(f),vw([L],b(),m())}else a()});let T=async(L,f)=>{var p;o(!1),n(""),d(f??""),await xn("events",nu(L),{immediate:!0}),(p=e.onDone)==null||p.call(globalThis)},A=L=>{o(!1),d(`Error: ${L}`)},k=async L=>{let f;if(L)f=Kt.active;else{if(!Kt.anonymous){let P=jk();Kt.anonymous={pk:xw(P),signEvent:async M=>({sig:kw(M,P).sig})}}f=Kt.anonymous}if(!f?.signEvent){A("Error: User has no signer!");return}let p=t().trim();if(!p)return;let w={kind:1,created_at:Math.round(Date.now()/1e3),content:p,pubkey:f.pk,tags:Ck(p)};if(xe.anchorAuthor!==w.pubkey&&w.tags.push(["p",xe.anchorAuthor]),xe.externalAuthor)try{let P=Dc(xe.externalAuthor).data;w.tags.push(["p",P])}catch{}if(e.replyTo){let P=await Ii("events",IDBKeyRange.only(e.replyTo));P&&(w.tags.push(["e",P.ro,"","root"]),P.pk!==w.pubkey&&w.tags.push(["p",P.pk])),w.tags.push(["e",e.replyTo,"","reply"])}else{let P=xe.version||xe.rootEventIds[0];if(P)w.tags.push(["e",P,"","root"]);else if(h().type==="http"){let M=a6(h().value),N={pubkey:f.pk,created_at:Math.round(Date.now()/1e3),kind:8812,tags:[["r",M]],content:`Comments on ${M} \u21B4`},B={id:Ws(N),...N,...await f.signEvent(N)};xn("events",nu(B)),xe.disableFeatures.includes("publish")?console.log("Publishing root event disabled",B):Ci.publish(b(),B),xe.filter={"#e":[B.id]},w.tags.push(["e",B.id,"","root"])}}h().type==="naddr"&&w.tags.push(["a",h().value,"","root"]);let v=Ws(w),S=await f.signEvent(w),$={id:v,...w,...S};if(o(!0),console.log(JSON.stringify($,null,2)),xe.disableFeatures.includes("publish"))setTimeout(()=>T($),1e3);else{let P=[];for(let M of b())try{await(await Tw.connect(M)).publish($)}catch(N){console.error(N),P.push(M)}if(P.length===b().length)A("Error: Your comment was not published to any relay");else{let M=`Published to ${P.length}/${b().length} relays (see console for more info)`,N=P.length>0?M:void 0;T($,N)}P.length=0}},I=e.replyTo!==void 0,O;return Hk(()=>I&&O),(()=>{let L=u6(),f=L.firstChild,p=f.nextSibling;f.addEventListener("change",v=>n(v.target.value));let w=O;return typeof w=="function"?Bb(w,f):O=f,f.autofocus=I,Le(p,(()=>{let v=We(()=>!!xe.disableFeatures.includes("publish"));return()=>v()&&l6()})(),null),Le(p,(()=>{let v=We(()=>!!u());return()=>v()&&(()=>{let S=d6();return S.firstChild,Le(S,u,null),S})()})(),null),Le(p,Rn(Qc,{get when(){return!r()},get fallback(){return f6()},get children(){let v=c6(),S=v.firstChild;return En(()=>{var $;return Ht(S,"src",(($=i())==null?void 0:$.i)||jc)}),v}}),null),Le(p,(()=>{let v=We(()=>!!i());return()=>v()&&(()=>{let S=h6();return S.firstChild,S.$$click=()=>k(i()),Le(S,()=>i().n||Qo(fw(i().pk)),null),En(()=>S.disabled=r()),S})()})(),null),Le(p,(()=>{let v=We(()=>!i()&&!xe.disableFeatures.includes("replyAnonymously"));return()=>v()&&(()=>{let S=p6();return S.$$click=()=>k(),En(()=>S.disabled=r()),S})()})(),null),Le(p,(()=>{let v=We(()=>!i());return()=>v()&&(()=>{let S=g6();return S.$$click=()=>_(),S})()})(),null),En(v=>{let S=r(),$=xe.replyPlaceholder||"Add your comment...";return S!==v._v$&&(f.disabled=v._v$=S),$!==v._v$2&&Ht(f,"placeholder",v._v$2=$),v},{_v$:void 0,_v$2:void 0}),En(()=>f.value=t()),L})()},y6=()=>{let e=()=>xe.anchor,t=fb(()=>["aggregates",IDBKeyRange.only([e().value,9735])]),n=fb(()=>["aggregates",IDBKeyRange.only([e().value,7])]),r=()=>{var i;return((i=t())==null?void 0:i.sum)??0},o=()=>{var i;return((i=n())==null?void 0:i.ids.length)??0};return(()=>{let i=w6(),a=i.firstChild,u=a.firstChild;return Le(u,Rn(Qc,{get when(){return!xe.disableFeatures.includes("likes")},get children(){let d=m6(),h=d.firstChild,m=h.firstChild;return Le(d,q6,h),Le(h,o,m),d}}),null),Le(u,Rn(Qc,{get when(){return!xe.disableFeatures.includes("zaps")},get children(){let d=b6(),h=d.firstChild,m=h.firstChild;return Le(d,V6,h),Le(h,()=>Nk(r()),m),d}}),null),Le(a,Rn($w,{}),null),i})()};Kf(["click"]);function v6(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function pb(e,...t){return typeof e=="function"?e(...t):e}function _6(e){let t={...e},n={...e},r={},o=a=>{let u=r[a];if(!u){if(!Oi())return t[a];r[a]=u=_t(t[a],{internal:!0}),delete t[a]}return u[0]()};for(let a in e)Object.defineProperty(n,a,{get:()=>o(a),enumerable:!0});let i=(a,u)=>{let d=r[a];if(d)return d[1](u);a in t&&(t[a]=pb(u,[t[a]]))};return[n,(a,u)=>{if(v6(a)){let d=kn(()=>Object.entries(pb(a,n)));Bi(()=>{for(let[h,m]of d)i(h,()=>m)})}else i(a,u);return n}]}var Bw={width:null,height:null};function Af(e){if(!e)return{...Bw};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function E6(e){let t=typeof e=="function",[n,r]=_6(t?Bw:Af(e)),o=new ResizeObserver(([i])=>r(Af(i.target)));return Li(()=>o.disconnect()),t?Ni(()=>{let i=e();i&&(r(Af(i)),o.observe(i),Li(()=>o.unobserve(i)))}):(o.observe(e),Li(()=>o.unobserve(e))),n}var x6=He("<div class=ztr-thread>"),k6=He("<li class=ztr-comment-action-reply><span>"),S6=He("<div class=ztr-comment><div class=ztr-comment-body><div class=ztr-comment-info-wrapper><div class=ztr-comment-info><div class=ztr-comment-info-picture><img></div><ul class=ztr-comment-info-items><li class=ztr-comment-info-author><a target=_blank></a><span style=white-space:nowrap;><strong> <!>ed</strong> </span></li><li><a class=ztr-comment-info-dots></a></li></ul></div><ul class=ztr-comment-info-items></ul></div><div class=ztr-comment-text></div><div class=ztr-comment-text></div><ul class=ztr-comment-actions>"),A6=He("<li>\u25CF"),T6=He("<li> repl"),$6=He("<li><span>"),B6=He("<div class=ztr-info-pane><a target=_blank><small>Event data"),L6=He("<p class=warning><span>This is a <!> that referenced this article in <a>another thread"),C6=He("<p class=warning><span>Article contents may have changed since this <!> was made"),P6=He("<p class=warning><span>Article contents changed since this <!> was made"),I6=He("<div class=ztr-comment-expand><a></a><span>Show full comment"),N6=He("<div class=ztr-comment-replies>"),O6=He('<svg viewBox="0 -6 60 60"xmlns=http://www.w3.org/2000/svg><path d="M 12.6030 50.4905 C 13.3758 50.4905 13.9307 50.1140 14.8621 49.2421 L 20.6483 43.8720 C 19.5188 42.9803 18.6073 41.5733 18.6073 38.3433 L 18.6073 25.2052 C 18.6073 19.1217 22.3129 15.5152 28.3766 15.5152 L 42.2479 15.5152 L 42.2281 14.7622 C 41.9306 10.6999 39.2557 8.0643 34.7177 8.0643 L 7.5301 8.0643 C 2.9922 8.0643 0 10.7791 0 15.4954 L 0 34.9548 C 0 39.6710 2.9922 42.7028 7.5301 42.7028 L 10.8195 42.7028 L 10.8195 48.4693 C 10.8195 49.6979 11.4735 50.4905 12.6030 50.4905 Z M 44.6058 53.2450 C 45.7353 53.2450 46.3895 52.4325 46.3895 51.2237 L 46.3895 45.4374 L 48.4702 45.4374 C 53.0078 45.4374 56 42.4056 56 37.7092 L 56 25.6610 C 56 20.9250 53.0078 18.2300 48.4702 18.2300 L 28.8522 18.2300 C 24.1161 18.2300 21.3221 20.9250 21.3221 25.6610 L 21.3221 37.7092 C 21.3221 42.4056 24.1161 45.4374 28.8522 45.4374 L 35.1735 45.4374 L 42.3470 51.9767 C 43.2784 52.8487 43.8331 53.2450 44.6058 53.2450 Z">'),R6=He('<svg xmlns=http://www.w3.org/2000/svg viewBox="-120 -80 528 588"><path d="M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288H175.5L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H272.5L349.4 44.6z">'),U6=He('<svg viewBox="0 -16 180 180"xmlns=http://www.w3.org/2000/svg><path d="M60.732 29.7C41.107 29.7 22 39.7 22 67.41c0 27.29 45.274 67.29 74 94.89 28.744-27.6 74-67.6 74-94.89 0-27.71-19.092-37.71-38.695-37.71C116 29.7 104.325 41.575 96 54.066 87.638 41.516 76 29.7 60.732 29.7z">'),z6=He('<svg viewBox="0 0 576 512"><path d="M168 80c-13.3 0-24 10.7-24 24V408c0 8.4-1.4 16.5-4.1 24H440c13.3 0 24-10.7 24-24V104c0-13.3-10.7-24-24-24H168zM72 480c-39.8 0-72-32.2-72-72V112C0 98.7 10.7 88 24 88s24 10.7 24 24V408c0 13.3 10.7 24 24 24s24-10.7 24-24V104c0-39.8 32.2-72 72-72H440c39.8 0 72 32.2 72 72V408c0 39.8-32.2 72-72 72H72zM176 136c0-13.3 10.7-24 24-24h96c13.3 0 24 10.7 24 24v80c0 13.3-10.7 24-24 24H200c-13.3 0-24-10.7-24-24V136zm200-24h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H376c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 80h32c13.3 0 24 10.7 24 24s-10.7 24-24 24H376c-13.3 0-24-10.7-24-24s10.7-24 24-24zM200 272H408c13.3 0 24 10.7 24 24s-10.7 24-24 24H200c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 80H408c13.3 0 24 10.7 24 24s-10.7 24-24 24H200c-13.3 0-24-10.7-24-24s10.7-24 24-24z">'),M6=He('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 -200 560 640"><path d="M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z">'),D6=He('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 -50 256 512"><path d="M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z">'),F6=He('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 -50 320 512"><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z">'),j6=He('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512"><path d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z">'),Lw=e=>{let t=()=>xe.anchor,n=xe.profiles;return(()=>{let r=x6();return Le(r,Rn(WE,{get each(){return Fc(e.nestedEvents())},children:o=>{let[i,a]=_t(!1),[u,d]=_t(!1),[h,m]=_t(!1),[b,_]=_t(!1),T=500,[A,k]=_t(),I=E6(A),[O,L]=_t(jc),f=()=>o().pk,p=()=>fw(f()),w=()=>n().find(z=>z.pk===f());Ni(async()=>{var z;L(((z=w())==null?void 0:z.i)||jc)});let v,S=()=>Ik(o().ts*1e3),[$,P]=_t();Ni(()=>{P(S()),v=setInterval(()=>{P(S())},60*1e3)});let M=()=>o().a===t().value&&o().am,N=()=>o().k===9802?"highlight":M()?"mention":"comment",B=We(()=>ch(o())),F=()=>!o().parent&&!o().ro,q=()=>!o().parent&&o().ro&&!xe.rootEventIds.includes(o().ro),x=()=>!o().parent&&o().ro&&xe.rootEventIds.includes(o().ro)&&xe.version&&xe.version!==o().ro;return Li(()=>clearInterval(v)),(()=>{let z=S6(),V=z.firstChild,K=V.firstChild,Z=K.firstChild,W=Z.firstChild,J=W.firstChild,de=W.nextSibling,_e=de.firstChild,ve=_e.firstChild,Pe=ve.nextSibling,ie=Pe.firstChild,Se=ie.firstChild,Ve=Se.nextSibling;Ve.nextSibling,ie.nextSibling;let Re=_e.nextSibling,je=Re.firstChild,Et=Z.nextSibling,Qe=K.nextSibling,he=Qe.nextSibling,Me=he.nextSibling;return J.addEventListener("error",()=>L(jc)),Le(ve,()=>{var Ce;return((Ce=w())==null?void 0:Ce.n)||Qo(p())}),Le(ie,N,Ve),Le(Pe,$,null),Le(de,(()=>{let Ce=We(()=>B()>0&&I.width>600);return()=>Ce()&&[A6(),(()=>{let Ie=T6(),qe=Ie.firstChild;return Le(Ie,B,qe),Le(Ie,()=>B()>1?"ies":"y",null),Le(Ie,()=>h()?" (hidden)":"",null),Ie})()]})(),Re),je.$$click=()=>_(!b()),Le(je,Cw),Le(Et,(()=>{let Ce=We(()=>B()>0);return()=>Ce()&&(()=>{let Ie=$6(),qe=Ie.firstChild;return qe.$$click=()=>m(!h()),Le(qe,(()=>{let Ct=We(()=>!!h());return()=>Ct()?Q6():K6()})()),Ie})()})()),Le(V,(()=>{let Ce=We(()=>!!b());return()=>Ce()&&(()=>{let Ie=B6(),qe=Ie.firstChild;return En(()=>Ht(qe,"href",xe.urlPrefixes.note+sb(o().id))),Ie})()})(),Qe),Le(Qe,(()=>{let Ce=We(()=>!!q());return()=>Ce()&&(()=>{let Ie=L6(),qe=Ie.firstChild,Ct=qe.firstChild,qt=Ct.nextSibling,Mt=qt.nextSibling,un=Mt.nextSibling;return Le(Ie,Tf,qe),Le(qe,N,qt),En(()=>Ht(un,"href",xe.urlPrefixes.note+sb(o().ro))),Ie})()})(),null),Le(Qe,(()=>{let Ce=We(()=>!!F());return()=>Ce()&&(()=>{let Ie=C6(),qe=Ie.firstChild,Ct=qe.firstChild,qt=Ct.nextSibling;return qt.nextSibling,Le(Ie,Tf,qe),Le(qe,N,qt),Ie})()})(),null),Le(Qe,(()=>{let Ce=We(()=>!!x());return()=>Ce()&&(()=>{let Ie=P6(),qe=Ie.firstChild,Ct=qe.firstChild,qt=Ct.nextSibling;return qt.nextSibling,Le(Ie,Tf,qe),Le(qe,N,qt),Ie})()})(),null),Bb(k,he),Le(V,(()=>{let Ce=We(()=>!!(I.height&&I.height>=T&&!u()));return()=>Ce()&&(()=>{let Ie=I6(),qe=Ie.firstChild,Ct=qe.nextSibling;return`${Un}px`!=null?qe.style.setProperty("height",`${Un}px`):qe.style.removeProperty("height"),Le(qe,W6),Ct.$$click=()=>d(!0),Ie})()})(),Me),Le(Me,Rn(Qc,{get when(){return!xe.disableFeatures.includes("reply")},get children(){let Ce=k6(),Ie=Ce.firstChild;return Ce.$$click=()=>a(!i())&&_(!1),Le(Ce,H6,Ie),Le(Ie,()=>i()?"Cancel":"Reply"),Ce}})),Le(V,(()=>{let Ce=We(()=>!!i());return()=>Ce()&&Rn($w,{get replyTo(){return o().id},onDone:()=>a(!1)})})(),null),Le(z,(()=>{let Ce=We(()=>!h());return()=>Ce()&&(()=>{let Ie=N6();return Le(Ie,Rn(Lw,{nestedEvents:()=>o().children,get articles(){return e.articles}})),Ie})()})(),null),En(Ce=>{let Ie=O(),qe=xe.urlPrefixes.npub+p(),Ct=o().k==9802,qt=u()?{}:{"max-height":`${T}px`},Mt=_w(o(),xe,e.articles());return Ie!==Ce._v$&&Ht(J,"src",Ce._v$=Ie),qe!==Ce._v$2&&Ht(ve,"href",Ce._v$2=qe),Ct!==Ce._v$3&&he.classList.toggle("highlight",Ce._v$3=Ct),Ce._v$4=GE(he,qt,Ce._v$4),Mt!==Ce._v$5&&(he.innerHTML=Ce._v$5=Mt),Ce},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),z})()}})),r})()},H6=()=>(()=>{let e=O6();return Ht(e,"width",Un),Ht(e,"height",Un),e})(),V6=()=>(()=>{let e=R6();return Ht(e,"width",Un),Ht(e,"height",Un),e})(),q6=()=>(()=>{let e=U6();return Ht(e,"width",Un),Ht(e,"height",Un),e})(),W6=()=>(()=>{let e=z6();return Ht(e,"width",Un),Ht(e,"height",Un),e})(),Cw=()=>M6(),Q6=()=>D6(),K6=()=>F6(),Tf=()=>(()=>{let e=j6();return Ht(e,"height",Un),e})();Kf(["click"]);var Pw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(N){if(!Number.isSafeInteger(N))throw new Error(`Wrong integer: ${N}`)}e.assertNumber=t;function n(...N){let B=(x,z)=>V=>x(z(V)),F=Array.from(N).reverse().reduce((x,z)=>x?B(x,z.encode):z.encode,void 0),q=N.reduce((x,z)=>x?B(x,z.decode):z.decode,void 0);return{encode:F,decode:q}}function r(N){return{encode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return B.map(F=>{if(t(F),F<0||F>=N.length)throw new Error(`Digit index outside alphabet: ${F} (alphabet: ${N.length})`);return N[F]})},decode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="string")throw new Error("alphabet.decode input should be array of strings");return B.map(F=>{if(typeof F!="string")throw new Error(`alphabet.decode: not string element=${F}`);let q=N.indexOf(F);if(q===-1)throw new Error(`Unknown letter: "${F}". Allowed: ${N}`);return q})}}}function o(N=""){if(typeof N!="string")throw new Error("join separator should be string");return{encode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="string")throw new Error("join.encode input should be array of strings");for(let F of B)if(typeof F!="string")throw new Error(`join.encode: non-string input=${F}`);return B.join(N)},decode:B=>{if(typeof B!="string")throw new Error("join.decode input should be string");return B.split(N)}}}function i(N,B="="){if(t(N),typeof B!="string")throw new Error("padding chr should be string");return{encode(F){if(!Array.isArray(F)||F.length&&typeof F[0]!="string")throw new Error("padding.encode input should be array of strings");for(let q of F)if(typeof q!="string")throw new Error(`padding.encode: non-string input=${q}`);for(;F.length*N%8;)F.push(B);return F},decode(F){if(!Array.isArray(F)||F.length&&typeof F[0]!="string")throw new Error("padding.encode input should be array of strings");for(let x of F)if(typeof x!="string")throw new Error(`padding.decode: non-string input=${x}`);let q=F.length;if(q*N%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;q>0&&F[q-1]===B;q--)if(!((q-1)*N%8))throw new Error("Invalid padding: string has too much padding");return F.slice(0,q)}}}function a(N){if(typeof N!="function")throw new Error("normalize fn should be function");return{encode:B=>B,decode:B=>N(B)}}function u(N,B,F){if(B<2)throw new Error(`convertRadix: wrong from=${B}, base cannot be less than 2`);if(F<2)throw new Error(`convertRadix: wrong to=${F}, base cannot be less than 2`);if(!Array.isArray(N))throw new Error("convertRadix: data should be array");if(!N.length)return[];let q=0,x=[],z=Array.from(N);for(z.forEach(V=>{if(t(V),V<0||V>=B)throw new Error(`Wrong integer: ${V}`)});;){let V=0,K=!0;for(let Z=q;Z<z.length;Z++){let W=z[Z],J=B*V+W;if(!Number.isSafeInteger(J)||B*V/B!==V||J-W!==B*V)throw new Error("convertRadix: carry overflow");if(V=J%F,z[Z]=Math.floor(J/F),!Number.isSafeInteger(z[Z])||z[Z]*F+V!==J)throw new Error("convertRadix: carry overflow");if(K)z[Z]?K=!1:q=Z;else continue}if(x.push(V),K)break}for(let V=0;V<N.length-1&&N[V]===0;V++)x.push(0);return x.reverse()}let d=(N,B)=>B?d(B,N%B):N,h=(N,B)=>N+(B-d(N,B));function m(N,B,F,q){if(!Array.isArray(N))throw new Error("convertRadix2: data should be array");if(B<=0||B>32)throw new Error(`convertRadix2: wrong from=${B}`);if(F<=0||F>32)throw new Error(`convertRadix2: wrong to=${F}`);if(h(B,F)>32)throw new Error(`convertRadix2: carry overflow from=${B} to=${F} carryBits=${h(B,F)}`);let x=0,z=0,V=2**F-1,K=[];for(let Z of N){if(t(Z),Z>=2**B)throw new Error(`convertRadix2: invalid data word=${Z} from=${B}`);if(x=x<<B|Z,z+B>32)throw new Error(`convertRadix2: carry overflow pos=${z} from=${B}`);for(z+=B;z>=F;z-=F)K.push((x>>z-F&V)>>>0);x&=2**z-1}if(x=x<<F-z&V,!q&&z>=B)throw new Error("Excess padding");if(!q&&x)throw new Error(`Non-zero padding: ${x}`);return q&&z>0&&K.push(x>>>0),K}function b(N){return t(N),{encode:B=>{if(!(B instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return u(Array.from(B),2**8,N)},decode:B=>{if(!Array.isArray(B)||B.length&&typeof B[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(u(B,N,2**8))}}}function _(N,B=!1){if(t(N),N<=0||N>32)throw new Error("radix2: bits should be in (0..32]");if(h(8,N)>32||h(N,8)>32)throw new Error("radix2: carry overflow");return{encode:F=>{if(!(F instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return m(Array.from(F),8,N,!B)},decode:F=>{if(!Array.isArray(F)||F.length&&typeof F[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(m(F,N,8,B))}}}function T(N){if(typeof N!="function")throw new Error("unsafeWrapper fn should be function");return function(...B){try{return N.apply(null,B)}catch{}}}function A(N,B){if(t(N),typeof B!="function")throw new Error("checksum fn should be function");return{encode(F){if(!(F instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let q=B(F).slice(0,N),x=new Uint8Array(F.length+N);return x.set(F),x.set(q,F.length),x},decode(F){if(!(F instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let q=F.slice(0,-N),x=B(q).slice(0,N),z=F.slice(-N);for(let V=0;V<N;V++)if(x[V]!==z[V])throw new Error("Invalid checksum");return q}}}e.utils={alphabet:r,chain:n,checksum:A,radix:b,radix2:_,join:o,padding:i},e.base16=n(_(4),r("0123456789ABCDEF"),o("")),e.base32=n(_(5),r("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),i(5),o("")),e.base32hex=n(_(5),r("0123456789ABCDEFGHIJKLMNOPQRSTUV"),i(5),o("")),e.base32crockford=n(_(5),r("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),o(""),a(N=>N.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(_(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(_(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));let k=N=>n(b(58),r(N),o(""));e.base58=k("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=k("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=k("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");let I=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(N){let B="";for(let F=0;F<N.length;F+=8){let q=N.subarray(F,F+8);B+=e.base58.encode(q).padStart(I[q.length],"1")}return B},decode(N){let B=[];for(let F=0;F<N.length;F+=11){let q=N.slice(F,F+11),x=I.indexOf(q.length),z=e.base58.decode(q);for(let V=0;V<z.length-x;V++)if(z[V]!==0)throw new Error("base58xmr: wrong padding");B=B.concat(Array.from(z.slice(z.length-x)))}return Uint8Array.from(B)}};let O=N=>n(A(4,B=>N(N(B))),e.base58);e.base58check=O;let L=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),f=[996825010,642813549,513874426,1027748829,705979059];function p(N){let B=N>>25,F=(N&33554431)<<5;for(let q=0;q<f.length;q++)(B>>q&1)===1&&(F^=f[q]);return F}function w(N,B,F=1){let q=N.length,x=1;for(let z=0;z<q;z++){let V=N.charCodeAt(z);if(V<33||V>126)throw new Error(`Invalid prefix (${N})`);x=p(x)^V>>5}x=p(x);for(let z=0;z<q;z++)x=p(x)^N.charCodeAt(z)&31;for(let z of B)x=p(x)^z;for(let z=0;z<6;z++)x=p(x);return x^=F,L.encode(m([x%2**30],30,5,!1))}function v(N){let B=N==="bech32"?1:734539939,F=_(5),q=F.decode,x=F.encode,z=T(q);function V(J,de,_e=90){if(typeof J!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof J}`);if(!Array.isArray(de)||de.length&&typeof de[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof de}`);let ve=J.length+7+de.length;if(_e!==!1&&ve>_e)throw new TypeError(`Length ${ve} exceeds limit ${_e}`);return J=J.toLowerCase(),`${J}1${L.encode(de)}${w(J,de,B)}`}function K(J,de=90){if(typeof J!="string")throw new Error(`bech32.decode input should be string, not ${typeof J}`);if(J.length<8||de!==!1&&J.length>de)throw new TypeError(`Wrong string length: ${J.length} (${J}). Expected (8..${de})`);let _e=J.toLowerCase();if(J!==_e&&J!==J.toUpperCase())throw new Error("String must be lowercase or uppercase");J=_e;let ve=J.lastIndexOf("1");if(ve===0||ve===-1)throw new Error('Letter "1" must be present between prefix and data only');let Pe=J.slice(0,ve),ie=J.slice(ve+1);if(ie.length<6)throw new Error("Data must be at least 6 characters long");let Se=L.decode(ie).slice(0,-6),Ve=w(Pe,Se,B);if(!ie.endsWith(Ve))throw new Error(`Invalid checksum in ${J}: expected "${Ve}"`);return{prefix:Pe,words:Se}}let Z=T(K);function W(J){let{prefix:de,words:_e}=K(J,!1);return{prefix:de,words:_e,bytes:q(_e)}}return{encode:V,decode:K,decodeToBytes:W,decodeUnsafe:Z,fromWords:q,fromWordsUnsafe:z,toWords:x}}e.bech32=v("bech32"),e.bech32m=v("bech32m"),e.utf8={encode:N=>new TextDecoder().decode(N),decode:N=>new TextEncoder().encode(N)},e.hex=n(_(4),r("0123456789abcdef"),o(""),a(N=>{if(typeof N!="string"||N.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof N} with length ${N.length}`);return N.toLowerCase()}));let S={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},$=`Invalid encoding type. Available types: ${Object.keys(S).join(", ")}`,P=(N,B)=>{if(typeof N!="string"||!S.hasOwnProperty(N))throw new TypeError($);if(!(B instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return S[N].encode(B)};e.bytesToString=P,e.str=e.bytesToString;let M=(N,B)=>{if(!S.hasOwnProperty(N))throw new TypeError($);if(typeof B!="string")throw new TypeError("stringToBytes() expects string");return S[N].decode(B)};e.stringToBytes=M,e.bytes=e.stringToBytes})(Pw);var{bech32:Jn,hex:On,utf8:G6}=Pw,gb={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},mb={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},bb={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},wb={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},Mc=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],Z6={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},Y6=BigInt("2100000000000000000"),yb=BigInt(1e11),Qf={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},Iw={};for(let e=0,t=Object.keys(Qf);e<t.length;e++){let n=t[e],r=Qf[t[e]].toString();Iw[r]=n}var J6={1:e=>On.encode(Jn.fromWordsUnsafe(e)),16:e=>On.encode(Jn.fromWordsUnsafe(e)),13:e=>G6.encode(Jn.fromWordsUnsafe(e)),19:e=>On.encode(Jn.fromWordsUnsafe(e)),23:e=>On.encode(Jn.fromWordsUnsafe(e)),27:e=>On.encode(Jn.fromWordsUnsafe(e)),6:ru,24:ru,3:e5,5:t5};function X6(e){return t=>({tagCode:parseInt(e),words:Jn.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function ru(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function e5(e){let t=[],n,r,o,i,a,u=Jn.fromWordsUnsafe(e);for(;u.length>0;)n=On.encode(u.slice(0,33)),r=On.encode(u.slice(33,41)),o=parseInt(On.encode(u.slice(41,45)),16),i=parseInt(On.encode(u.slice(45,49)),16),a=parseInt(On.encode(u.slice(49,51)),16),u=u.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:a});return t}function t5(e){let t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length<Mc.length*2;)t.push(!1);let n={};Mc.forEach((o,i)=>{let a;t[i*2]?a="required":t[i*2+1]?a="supported":a="unsupported",n[o]=a});let r=t.slice(Mc.length*2);return n.extra_bits={start_bit:Mc.length*2,bits:r,has_required:r.reduce((o,i,a)=>a%2!==0?o||!1:o||i,!1)},n}function Nw(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");let o=BigInt(r),i=n?o*yb/Z6[n]:o*yb;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>Y6)throw new Error("Amount is outside of valid range");return t?i.toString():i}function n5(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");let n=[],r=Jn.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();let o=r.prefix,i=r.words,a=e.slice(o.length+1),u=i.slice(-104);i=i.slice(0,-104);let d=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(d&&!d[2]&&(d=o.match(/^ln(\S+)$/)),!d)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});let h=d[1],m;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");m=t}else switch(h){case gb.bech32:m=gb;break;case mb.bech32:m=mb;break;case bb.bech32:m=bb;break;case wb.bech32:m=wb;break}if(!m||m.bech32!==h)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:h,value:m});let b=d[2],_;if(b){let p=d[3];_=Nw(b+p,!0),n.push({name:"amount",letters:d[2]+d[3],value:_})}else _=null;n.push({name:"separator",letters:"1"});let T=ru(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:a.slice(0,7),value:T}),a=a.slice(7);let A,k,I,O;for(;i.length>0;){let p=i[0].toString();A=Iw[p]||"unknown_tag",k=J6[p]||X6(p),i=i.slice(1),I=ru(i.slice(0,2)),i=i.slice(2),O=i.slice(0,I),i=i.slice(I),n.push({name:A,tag:a[0],letters:a.slice(0,3+I),value:k(O)}),a=a.slice(3+I)}n.push({name:"signature",letters:a.slice(0,104),value:On.encode(Jn.fromWordsUnsafe(u))}),a=a.slice(104),n.push({name:"checksum",letters:a});let L={paymentRequest:e,sections:n,get expiry(){let p=n.find(w=>w.name==="expiry");if(p)return f("timestamp")+p.value},get route_hints(){return n.filter(p=>p.name==="route_hint").map(p=>p.value)}};for(let p in Qf)p!=="route_hint"&&Object.defineProperty(L,p,{get(){return f(p)}});return L;function f(p){let w=n.find(v=>v.name===p);return w?w.value:void 0}}var r5={decode:n5,hrpToMillisat:Nw},o5=He("<div id=ztr-root><style></style><div style=float:right;opacity:0.2;>"),i5=He("<div id=ztr-content>"),s5=He("<h1>Error!"),a5=He("<div class=ztr-comment-text><pre></pre><p>Only properly formed NIP-19 naddr, note and nevent encoded entities and URLs are supported."),c5=He("<h2 id=ztr-title>"),u5=He("<p>Powered by <a href=https://github.com/fr4nzap/zapthreads>zapthreads"),l5=He("<button>Clear cache"),d5=He("<p>Anchor version: "),f5=e=>{uo(()=>{xe.anchor=(()=>{let f=e.anchor.trim();try{if(f.startsWith("http")){let w=!e.legacyUrl;return{type:"http",value:Rk(f,w)}}let p=Dc(f);switch(p.type){case"nevent":return{type:"note",value:p.data.id};case"note":return{type:"note",value:p.data};case"naddr":let w=p.data;return{type:"naddr",value:`${w.kind}:${w.pubkey}:${w.identifier}`}}}catch(p){return console.error(p),{type:"error",value:`Malformed anchor: ${f}`}}})();let L="wss://relay.damus.io,wss://nos.lol";xe.relays=(e.relays||L).split(",").map(f=>new URL(f).toString()),(e.author||"").startsWith("npub")&&(xe.externalAuthor=e.author),xe.disableFeatures=e.disable.split(",").map(f=>f.trim()).filter(F4),xe.urlPrefixes=Pk(e.urls),xe.replyPlaceholder=e.replyPlaceholder});let t=()=>xe.anchor,n=()=>xe.relays,r=()=>xe.disableFeatures,o=()=>e.version;xe.profiles=zc(()=>["profiles"]);let i=()=>r().includes("watch");uo(lo([t],()=>{xe.version=o()})),uo(lo([t,n],async()=>{if(t().type==="error")return;let L,f;switch(t().type){case"http":f=await Di("events",t().value,{index:"r"}),xe.rootEventIds=Fc(f).map(N=>N.id),L={"#r":e.legacyUrl?[t().value]:[t().value,`${t().value}/`],kinds:[1,8812]};break;case"note":let S=await Ii("events",IDBKeyRange.only(t().value));if(S){f=[S],xe.rootEventIds=[S.id],xe.anchorAuthor=S.pk;return}else{f=[],L={ids:[t().value]};break}case"naddr":let[$,P,M]=t().value.split(":");f=(await Di("events",M,{index:"d"})).filter(N=>N.pk===P),f.length>0&&(xe.rootEventIds=Fc(f).map(N=>N.id),xe.anchorAuthor=f[0].pk),L={authors:[P],kinds:[parseInt($)],"#d":[M]};break;default:throw"error"}let w=(await Ci.querySync(n(),{...L})).map(nu);for(let v of w)t().type=="http"?(v.k==1&&v.c.includes("\u21B4")||v.k==8812)&&xn("events",v):xn("events",v);switch(t().type){case"http":case"naddr":let v=[...f,...w],S=Fc([...v]).map($=>$.id);(S.length>0&&S[0])!==xe.rootEventIds[0]&&(xe.rootEventIds=S);break;case"note":xe.rootEventIds=w.map($=>$.id);break}w.length>0&&(xe.anchorAuthor=w[0].pk)}));let a=()=>xe.rootEventIds;uo(lo([a,o],()=>{switch(t().type){case"http":case"note":(xe.filter["#e"]??[]).toString()!==a().toString()&&(xe.filter={"#e":a()});return;case"naddr":let L=xe.filter["#a"]&&xe.filter["#a"][0];t().value!==L&&(xe.filter={"#a":[t().value]}),xe.version=o()||a()[0];return}},{defer:!0}));let u=We(()=>xe.filter,{defer:!0}),d;Ni(lo([u],async()=>{let L=u(),f=n(),p=t(),w=T(),v=xe.profiles();if(Object.entries(L).length===0)return;d?.close(),d=null,Li(()=>{console.log("[zapthreads] unsubscribing and cleaning up",p.value),d?.close(),d=null});let S=[1,9802,7,9735];console.log("[zapthreads] subscribing to",p.value);let $=await kk(p,f),P=new Set,M={};d=Ci.subscribeMany(f,[{...L,kinds:S,since:$}],{onevent(N){if(N.kind===1||N.kind===9802)N.content.trim()&&xn("events",nu(N));else if(N.kind===7)P.add(N.id);else if(N.kind===9735){let B=N.tags.find(F=>F[0]==="bolt11");B&&B[1]&&(M[N.id]=B[1])}},oneose(){(async()=>{let N=await Ii("aggregates",IDBKeyRange.only([p.value,7]))??{eid:p.value,ids:[],k:7};N.ids=[...new Set([...N.ids,...P])],xn("aggregates",N);let B=await Ii("aggregates",IDBKeyRange.only([p.value,9735]))??{eid:p.value,ids:[],k:9735,sum:0};B.sum=Object.entries(M).reduce((F,q)=>{if(B.ids.includes(q[0]))return F;let z=r5.decode(q[1]).sections.find(K=>K.name==="amount"),V=Number(z.value)/1e3;return F+V},B.sum??0),B.ids=[...new Set([...B.ids,...Object.keys(M)])],xn("aggregates",B)})(),setTimeout(async()=>{await vw([...w.map(N=>N.pk)],f,v),Sk(p,w),i()&&(d?.close(),Ci.close(f))},96)}})},{defer:!0}));let h=()=>e.user;uo(lo(h,L=>{if(L){let f,p;L.startsWith("nsec")?(p=Dc(L).data,f=xw(p)):f=Dc(L).data,Kt.external={pk:f,signEvent:async w=>{if(p)return{sig:kw(w,p).sig};if(!window.nostr)throw alert("Please log in with a NIP-07 extension such as Alby or nos2x"),Kt.active=void 0,"No extension available";let v=await window.nostr.getPublicKey(),S=f;if(S!==v){let $=`ERROR: Event not signed. Supplied pubkey does not match extension pubkey. ${S} !== ${v}`;throw Kt.active=void 0,alert($),$}else return window.nostr.signEvent(w)}},Kt.active=Kt.external}})),uo(lo(h,L=>{L||(Kt.active=void 0)},{defer:!0}));let m=zc(()=>["events",30023,{index:"k"}]),b=We(()=>{if(xe.disableFeatures.includes("hideContent")&&t().type==="naddr"){let[L,f,p]=t().value.split(":"),w=m().find(v=>v.d===p&&v.pk===f);if(w){let v=`# ${w.tl}
|
|
${w.c}`;return _w({...w,c:v},xe,[])}}}),_=We(()=>{switch(t().type){case"http":case"note":return zc(()=>["events",xe.rootEventIds,{index:"ro"}]);case"naddr":return zc(()=>["events",t().value,{index:"a"}]);default:return()=>[]}}),T=()=>_()(),A=We(()=>xe.rootEventIds&&xe.rootEventIds.length?Ew(T()).filter(f=>!(f.k===9802&&f.children.length===0)):[]),k=()=>A().reduce((L,f)=>L+ch(f),A().length),[I,O]=_t(!1);return(()=>{let L=o5(),f=L.firstChild,p=f.nextSibling;return Le(f,lx),Le(L,(()=>{let w=We(()=>!!b());return()=>w()&&(()=>{let v=i5();return En(()=>v.innerHTML=b()),v})()})(),p),Le(L,(()=>{let w=We(()=>t().type==="error");return()=>w()&&[s5(),(()=>{let v=a5(),S=v.firstChild;return Le(S,()=>t().value),v})()]})(),p),Le(L,(()=>{let w=We(()=>t().type!=="error");return()=>w()&&[We((()=>{let v=We(()=>!xe.disableFeatures.includes("reply"));return()=>v()&&Rn(y6,{})})()),(()=>{let v=c5();return Le(v,(()=>{let S=We(()=>k()>0);return()=>S()&&`${k()} comment${k()==1?"":"s"}`})()),v})(),Rn(Lw,{nestedEvents:A,articles:m})]})(),p),p.$$click=()=>O(!I()),Le(p,Cw),Le(L,(()=>{let w=We(()=>!!I());return()=>w()&&[u5(),We((()=>{let v=We(()=>!!xe.version);return()=>v()&&(()=>{let S=d5();return S.firstChild,Le(S,()=>xe.version,null),S})()})()),(()=>{let v=l5();return KE(v,"click",xk,!0),v})()]})(),null),L})()};ux("zap-threads",{anchor:"",version:"",relays:"",user:"",author:"",disable:"",urls:"","reply-placeholder":"","legacy-url":""},e=>Rn(f5,{get anchor(){return e.anchor??""},get version(){return e.version??""},get relays(){return e.relays??""},get user(){return e.user??""},get author(){return e.author??""},get disable(){return e.disable??""},get urls(){return e.urls??""},get replyPlaceholder(){return e["reply-placeholder"]??""},get legacyUrl(){return e["legacy-url"]??""}}));Kf(["click"]);function h5(e){return{c:De,m:De,p:De,d:De}}function p5(e){let t,n,r=Xt(e[2].created_at,!0)+"",o,i,a,u=e[2].title+"",d,h,m,b,_,T,A=e[2].image&&Ow(e),k=e[4]&&Rw(e);return{c(){t=ae("div"),n=ae("div"),o=ze(r),i=Ne(),a=ae("h1"),d=ze(u),h=Ne(),A&&A.c(),m=Ne(),b=ae("div"),_=Ne(),k&&k.c(),T=$t(),oe(n,"class","date"),oe(b,"class","content"),oe(t,"class","event-wrapper")},m(I,O){le(I,t,O),ne(t,n),ne(n,o),ne(t,i),ne(t,a),ne(a,d),ne(t,h),A&&A.m(t,null),ne(t,m),ne(t,b),b.innerHTML=e[5],le(I,_,O),k&&k.m(I,O),le(I,T,O)},p(I,O){O&4&&r!==(r=Xt(I[2].created_at,!0)+"")&&Ze(o,r),O&4&&u!==(u=I[2].title+"")&&Ze(d,u),I[2].image?A?A.p(I,O):(A=Ow(I),A.c(),A.m(t,m)):A&&(A.d(1),A=null),O&32&&(b.innerHTML=I[5]),I[4]?k?k.p(I,O):(k=Rw(I),k.c(),k.m(T.parentNode,T)):k&&(k.d(1),k=null)},d(I){I&&(ce(t),ce(_),ce(T)),A&&A.d(),k&&k.d(I)}}}function Ow(e){let t,n,r;return{c(){t=ae("img"),oe(t,"class",n=e[2].image?"note-image":"note-banner"),Ot(t.src,r=e[2].image)||oe(t,"src",r)},m(o,i){le(o,t,i)},p(o,i){i&4&&n!==(n=o[2].image?"note-image":"note-banner")&&oe(t,"class",n),i&4&&!Ot(t.src,r=o[2].image)&&oe(t,"src",r)},d(o){o&&ce(t)}}}function Rw(e){let t,n;return{c(){t=ae("zap-threads"),Xi(t,"anchor",e[3]),Xi(t,"relays",n=e[1].join(","))},m(r,o){le(r,t,o)},p(r,o){o&8&&Xi(t,"anchor",r[3]),o&2&&n!==(n=r[1].join(","))&&Xi(t,"relays",n)},d(r){r&&ce(t)}}}function g5(e){let t,n,r,o,i=e[3].substring(0,12)+"..."+e[3].slice(-5),a,u,d,h,m,b,_,T,A,k=e[0]?.shortName+"",I,O,L,f,p;function w($,P){return P&4&&(f=null),f==null&&(f=!!($[2]&&Object.keys($[2]).length>0)),f?p5:h5}let v=w(e,-1),S=v(e);return{c(){t=ae("div"),n=ae("div"),r=ze("Note: "),o=ae("a"),a=ze(i),d=Ne(),h=ae("a"),m=ae("div"),b=ae("img"),T=Ne(),A=ae("span"),I=ze(k),O=ze(" homepage"),L=Ne(),S.c(),p=$t(),oe(o,"href",u="https://njump.me/"+e[3]),oe(n,"class","external-link"),Ot(b.src,_=e[0]?.image)||oe(b,"src",_),oe(m,"class","picture-container"),oe(h,"href","#"),oe(t,"class","header note")},m($,P){le($,t,P),ne(t,n),ne(n,r),ne(n,o),ne(o,a),ne(t,d),ne(t,h),ne(h,m),ne(m,b),ne(h,T),ne(h,A),ne(A,I),ne(A,O),le($,L,P),S.m($,P),le($,p,P)},p($,[P]){P&8&&i!==(i=$[3].substring(0,12)+"..."+$[3].slice(-5))&&Ze(a,i),P&8&&u!==(u="https://njump.me/"+$[3])&&oe(o,"href",u),P&1&&!Ot(b.src,_=$[0]?.image)&&oe(b,"src",_),P&1&&k!==(k=$[0]?.shortName+"")&&Ze(I,k),v===(v=w($,P))&&S?S.p($,P):(S.d(1),S=v($),S&&(S.c(),S.m(p.parentNode,p)))},i:De,o:De,d($){$&&(ce(t),ce(L),ce(p)),S.d($)}}}function m5(e,t,n){let r,o,i,a="",u="",d=!1,{id:h}=t,{profile:m}=t,{config:b}=t;return Bt(async()=>{if(!m)throw new Error("invalid npub");if(n(1,o=b.readRelays),n(0,m=await ls(b.npub)),!m)throw new Error("npub is invalid");n(3,u=Ja({id:h})),n(4,d=b.comments),mr.subscribeManyEose(b.writeRelays,[{ids:[h]}],{onevent:async _=>{console.log("Received event:",_),n(2,i=us(_)),pi.set(i.title),n(8,a=await wd(i))},onclose(){console.log("Finish, subscription closed.")}})}),e.$$set=_=>{"id"in _&&n(6,h=_.id),"profile"in _&&n(0,m=_.profile),"config"in _&&n(7,b=_.config)},e.$$.update=()=>{e.$$.dirty&256&&n(5,r=a)},pi.subscribe(_=>{document.title=_}),[m,o,i,u,d,r,h,b,a]}var uh=class extends nt{constructor(t){super(),ct(this,t,m5,g5,tt,{id:6,profile:0,config:7})}},Uw=uh;function b5(e){let t,n,r,o,i,a,u;return{c(){t=ae("div"),n=ae("input"),r=Ne(),o=ae("label"),n.checked=e[0],oe(n,"type","checkbox"),oe(n,"id","theme-toggle"),oe(n,"class","svelte-19brd9o"),oe(o,"for","theme-toggle"),oe(o,"class","svelte-19brd9o"),oe(t,"class",i=hl(e[1]?"visible":"hidden")+" svelte-19brd9o")},m(d,h){le(d,t,h),ne(t,n),ne(t,r),ne(t,o),a||(u=Ji(n,"change",e[2]),a=!0)},p(d,[h]){h&1&&(n.checked=d[0]),h&2&&i!==(i=hl(d[1]?"visible":"hidden")+" svelte-19brd9o")&&oe(t,"class",i)},i:De,o:De,d(d){d&&ce(t),a=!1,u()}}}function w5(){let e=document.querySelector('meta[name="force-theme"]');if(!e)return null;let t=(e.getAttribute("content")||"").toLowerCase();return t==="dark"||t==="light"?t:null}function lh(e){e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}function y5(e,t,n){let r=!1,o=!1,i=!1;function a(){n(0,r=!r),localStorage.getItem("systemTheme")=="dark"&&r||localStorage.getItem("systemTheme")=="light"&&!r?localStorage.removeItem("theme"):localStorage.setItem("theme",r?"dark":"light"),lh(r)}function u(){if(localStorage.getItem("theme")==="dark")return!0;if(localStorage.getItem("theme")==="light")return!1;let d=w5();if(d)return i=!0,d==="dark";let h=window.matchMedia("(prefers-color-scheme: dark)").matches;return localStorage.setItem("systemTheme",h?"dark":"light"),h}return Bt(()=>{n(0,r=u()),lh(r),n(1,o=!0);let d=window.matchMedia("(prefers-color-scheme: dark)"),h=m=>{localStorage.setItem("systemTheme",m.matches?"dark":"light"),!localStorage.getItem("theme")&&!i&&(n(0,r=m.matches),lh(r))};return d.addEventListener?d.addEventListener("change",h):d.addListener(h),()=>{d.removeEventListener?d.removeEventListener("change",h):d.removeListener(h)}}),[r,o,a]}var dh=class extends nt{constructor(t){super(),ct(this,t,y5,b5,tt,{})}},zw=dh;function Dw(e){let t;return{c(){t=ae("div"),t.innerHTML=`<h1>Oracolo</h1> <h2>Missing config!</h2> <p>You need to <a href="https://github.com/dtonon/oracolo?tab=readme-ov-file#configuration">configure your blog</a>
|
|
adding some meta tags inside this HTML file.<br/><br/>
|
|
Are you lazy? Use the handy web wizard at <a href="https://oracolo.me">oracolo.me</a>.</p>`,oe(t,"class","unfinished-setup")},m(n,r){le(n,t,r)},d(n){n&&ce(t)}}}function Fw(e){let t=e[0],n,r,o=jw(e);return{c(){o.c(),n=$t()},m(i,a){o.m(i,a),le(i,n,a),r=!0},p(i,a){a&1&&tt(t,t=i[0])?(yt(),Te(o,1,1,De),vt(),o=jw(i),o.c(),Ee(o,1),o.m(n.parentNode,n)):o.p(i,a)},i(i){r||(Ee(o),r=!0)},o(i){Te(o),r=!1},d(i){i&&ce(n),o.d(i)}}}function x5(e){let t,n;return t=new Uw({props:{id:e[0],profile:e[1],config:e[4]}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&1&&(i.id=r[0]),o&2&&(i.profile=r[1]),o&16&&(i.config=r[4]),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function k5(e){let t,n;return t=new uf({props:{tag:e[0],profile:e[1],config:e[4]}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&1&&(i.tag=r[0]),o&2&&(i.profile=r[1]),o&16&&(i.config=r[4]),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function S5(e){let t,n;return t=new uf({props:{tag:"",profile:e[1],config:e[4]}}),{c(){ft(t.$$.fragment)},m(r,o){st(t,r,o),n=!0},p(r,o){let i={};o&2&&(i.profile=r[1]),o&16&&(i.config=r[4]),t.$set(i)},i(r){n||(Ee(t.$$.fragment,r),n=!0)},o(r){Te(t.$$.fragment,r),n=!1},d(r){at(t,r)}}}function jw(e){let t,n,r,o,i,a=[S5,k5,x5],u=[];function d(h,m){return m&1&&(t=null),h[0]===""?0:(t==null&&(t=!!h[0].startsWith("tags/")),t?1:2)}return n=d(e,-1),r=u[n]=a[n](e),{c(){r.c(),o=$t()},m(h,m){u[n].m(h,m),le(h,o,m),i=!0},p(h,m){let b=n;n=d(h,m),n===b?u[n].p(h,m):(yt(),Te(u[b],1,1,()=>{u[b]=null}),vt(),r=u[n],r?r.p(h,m):(r=u[n]=a[n](h),r.c()),Ee(r,1),r.m(o.parentNode,o))},i(h){i||(Ee(r),i=!0)},o(h){Te(r),i=!1},d(h){h&&ce(o),u[n].d(h)}}}function Hw(e){let t,n,r,o,i,a,u,d,h,m=e[3].length>0&&Vw(e);return{c(){t=ze(`Would you like to host this website yourself? It's just one HTML file,
|
|
`),n=ae("button"),n.textContent="download it",r=ze("."),o=ae("br"),i=ae("br"),a=Ne(),m&&m.c(),u=$t(),oe(n,"class","link-button")},m(b,_){le(b,t,_),le(b,n,_),le(b,r,_),le(b,o,_),le(b,i,_),le(b,a,_),m&&m.m(b,_),le(b,u,_),d||(h=Ji(n,"click",e[5]),d=!0)},p(b,_){b[3].length>0?m?m.p(b,_):(m=Vw(b),m.c(),m.m(u.parentNode,u)):m&&(m.d(1),m=null)},d(b){b&&(ce(t),ce(n),ce(r),ce(o),ce(i),ce(a),ce(u)),m&&m.d(b),d=!1,h()}}}function Vw(e){let t,n=e[3].join(", ")+"",r;return{c(){t=ze("This page connects to some servers (Nostr relays) to retrieve data: "),r=ze(n)},m(o,i){le(o,t,i),le(o,r,i)},p(o,i){i&8&&n!==(n=o[3].join(", ")+"")&&Ze(r,n)},d(o){o&&(ce(t),ce(r))}}}function A5(e){let t,n=e[1]&&Object.keys(e[1]).length>0,r,o,i,a,u,d,h,m,b,_,T,A,k,I=e[2]&&Dw(e),O=n&&Fw(e),L=!e[2]&&Hw(e);return A=new zw({}),{c(){I&&I.c(),t=Ne(),O&&O.c(),r=Ne(),o=ae("div"),i=ze("This blog is powered by "),a=ae("a"),a.textContent="Oracolo",u=ze(` and Nostr.
|
|
`),d=ae("a"),d.textContent="Make your own",h=ze("."),m=ae("br"),b=ae("br"),_=Ne(),L&&L.c(),T=Ne(),ft(A.$$.fragment),oe(a,"href","https://github.com/dtonon/oracolo"),oe(d,"href","https://oracolo.me"),oe(o,"class","footer")},m(f,p){I&&I.m(f,p),le(f,t,p),O&&O.m(f,p),le(f,r,p),le(f,o,p),ne(o,i),ne(o,a),ne(o,u),ne(o,d),ne(o,h),ne(o,m),ne(o,b),ne(o,_),L&&L.m(o,null),le(f,T,p),st(A,f,p),k=!0},p(f,[p]){f[2]?I||(I=Dw(f),I.c(),I.m(t.parentNode,t)):I&&(I.d(1),I=null),p&2&&(n=f[1]&&Object.keys(f[1]).length>0),n?O?(O.p(f,p),p&2&&Ee(O,1)):(O=Fw(f),O.c(),Ee(O,1),O.m(r.parentNode,r)):O&&(yt(),Te(O,1,1,()=>{O=null}),vt()),f[2]?L&&(L.d(1),L=null):L?L.p(f,p):(L=Hw(f),L.c(),L.m(o,null))},i(f){k||(Ee(O),Ee(A.$$.fragment,f),k=!0)},o(f){Te(O),Te(A.$$.fragment,f),k=!1},d(f){f&&(ce(t),ce(r),ce(o),ce(T)),I&&I.d(f),O&&O.d(f),L&&L.d(),at(A,f)}}}function T5(e,t,n){let r="",o=null,i=!1,a="",u=null,d=[],h;Bt(()=>{let T=new URLSearchParams(window.location.search).get("download")==="true";dm().then(async A=>{if(A)n(4,h=A);else{n(2,i=!0);return}let{npub:k="",readRelays:I=[],writeRelays:O=[],comments:L=!1}=A;if(!k){n(2,i=!0);return}if(n(3,d=Array.from(new Set(I.concat(O)))),L)try{await Promise.resolve().then(()=>(Mw(),E5)),console.log("window.nostr.js has been successfully loaded")}catch(f){console.error("Failed to load window.nostr.js:",f)}if(m(),window.addEventListener("hashchange",m),n(1,o=await ls(k)),o)a=o.metadata.name||o.shortName,u=o.image||null,T&&yd();else{n(2,i=!0);return}}).catch(A=>{console.error("Error fetching config:",A),n(2,i=!0)})}),ml(()=>{window.removeEventListener("hashchange",m)});function m(){let _=window.location.hash.substring(1);_!==r&&n(0,r=_)}return[r,o,i,d,h,()=>yd()]}var fh=class extends nt{constructor(t){super(),ct(this,t,T5,A5,tt,{})}},qw=fh;console.log("running");var Ww=new qw({target:document.getElementById("app")}),_L=Ww;window.destroySvelteApp=()=>Ww.$destroy();})();
|
|
/*! Bundled license information:
|
|
|
|
showdown/dist/showdown.js:
|
|
(*! showdown v 2.1.0 - 21-04-2022 *)
|
|
|
|
window.nostr.js/dist/window.nostr.js:
|
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
|
|
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/hashes/esm/utils.js:
|
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@scure/base/lib/esm/index.js:
|
|
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/hashes/esm/utils.js:
|
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/curves/esm/abstract/utils.js:
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/curves/esm/abstract/modular.js:
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/curves/esm/abstract/curve.js:
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/curves/esm/abstract/weierstrass.js:
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/curves/esm/_shortw_utils.js:
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/curves/esm/secp256k1.js:
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@splidejs/splide/dist/js/splide.esm.js:
|
|
(*!
|
|
* Splide.js
|
|
* Version : 4.1.4
|
|
* License : MIT
|
|
* Copyright: 2022 Naotoshi Fujita
|
|
*)
|
|
|
|
zapthreads/dist/zapthreads.js:
|
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
*/
|
|
|
|
</script>
|
|
<style>
|
|
html{font-size:20px}@media only screen and (max-width: 768px){html{font-size:18px}}body{margin:0;padding:0}html.dark body{background-color:#242424;color:#cbcbcb}#app{box-sizing:border-box;width:80%;max-width:900px;margin:2rem auto;font-family:Arial,Helvetica,sans-serif;color:#242424}@media only screen and (max-width: 768px){#app{width:100%;padding:0 1rem;max-width:unset}}html.dark #app{background-color:#242424;color:#ebebeb}a,a:visited{color:#242424}html.dark a,html.dark a:visited{color:#f5f5f5}h1{font-size:2rem;line-height:.9;margin-top:0}@media only screen and (max-width: 768px){h1{font-size:1.6rem}}ol,ul{padding-left:1rem;margin:0}ol li,ul li{margin-bottom:1rem}blockquote{margin:0;padding-left:1rem;border-left:8px solid #ebebeb}code{font-size:.9rem;padding:0 .4rem;border-radius:.2rem;background-color:#f6f6f6}html.dark code{background-color:#3e3e3e}pre code{overflow:scroll;display:block;padding:1rem .5rem;border-radius:.2rem}.unfinished-setup{width:80%;margin:0 auto;text-align:center}.header.home h1{font-size:3rem}.header .external-link{text-align:right;margin-top:-1rem;font-size:.8em;color:#cbcbcb}@media only screen and (max-width: 768px){.header .external-link{margin-bottom:1rem;margin-right:2.5rem}}.header .external-link a{text-decoration:underline;color:#cbcbcb}.header .picture-container{position:relative;display:inline-block;width:2.5rem;height:2.5rem;overflow:hidden;border-radius:50%;margin-bottom:-.25rem}.header .picture-container img{position:absolute;top:50%;left:50%;width:100%;height:100%;object-fit:cover;transform:translate(-50%,-50%);clip-path:circle(50%)}.header.note{margin-bottom:2rem}.header.note .picture-container{width:1.5rem;height:1.5rem;margin-bottom:-.4rem}.header a{text-decoration:none}.header a span{text-decoration:underline}html.dark .header a:visited{color:#cbcbcb}html.dark .header .external-link,html.dark .header .external-link a{color:#747474}.topic-wrapper{margin-bottom:1.5rem;display:flex;flex-direction:row;flex-wrap:wrap;row-gap:1rem}.topic-wrapper div{display:inline-grid;margin-right:1rem}.topic-wrapper div a{padding:.4rem 1rem;background-color:#e0e0e0;text-decoration:none;border-radius:4px}.topic-wrapper div a:hover{background-color:#ebebeb}.topic-wrapper div a.selected{background-color:#242424;color:#f5f5f5}html.dark .topic-wrapper div a{background-color:#747474;color:#242424}html.dark .topic-wrapper div a:hover{background-color:#f5f5f5}html.dark .topic-wrapper div a.selected{background-color:#cbcbcb}.externalLink{display:block;text-align:right;margin-top:-1rem;font-size:.8em;color:#cbcbcb}.externalLink a{color:#cbcbcb}.link-button{background:none;border:none;text-decoration:underline;cursor:pointer;padding:0;font:inherit;color:inherit}.link-button:hover{text-decoration:none}.link-button:focus{outline:none}.about{margin-bottom:2rem;padding-bottom:1rem;border-bottom:8px solid #ebebeb}html.dark .about{border-bottom:8px solid #373737}.separator{margin-bottom:2rem;border-bottom:8px solid #ebebeb}html.dark .separator{border-bottom:8px solid #373737}.block{border-bottom:8px solid #f5f5f5;margin-bottom:1.5rem;padding-bottom:1.5rem;color:#747474}.block .summary{white-space:pre-wrap}.block .grid{display:grid;grid-template-columns:repeat(2,1fr);gap:2rem;width:100%}@media only screen and (max-width: 768px){.block .grid{grid-template-columns:1fr;gap:1rem}}.block .grid h2{font-size:1.1rem;border-bottom:4px solid #dadada;padding-bottom:8px}.block .grid.full-notes{display:grid;grid-template-columns:repeat(2,1fr);gap:2rem}.block .grid.full-notes .item{margin-bottom:2rem}@media only screen and (max-width: 768px){.block .grid.full-notes{grid-template-columns:1fr}}.block .grid .item{break-inside:avoid}.block .grid .item a{text-decoration:none}.block .grid .item a:hover img{transform:scale(1.02)}.block .grid .item img,.block .grid .item video{width:100%;object-fit:cover;margin-bottom:.5rem;border-radius:4px;transition:transform .3s ease}.block .grid .item .content img{margin:1rem 0}.block .grid .item .title{display:block;margin-bottom:.4rem;font-size:1.1rem;font-weight:bolder}.block .grid .item .summary,.block .grid .item .content{margin-bottom:.4rem;font-size:.9rem;word-break:break-word;color:#747474}.block .grid .item .content.cropped{position:relative;max-height:80vh;overflow:hidden}.block .grid .item .content .content-fade{position:absolute;bottom:0;left:0;right:0;height:60px;background:linear-gradient(transparent,#fff);pointer-events:none}.block .grid .item .date{font-size:.8rem;color:#a9a9a9;margin-top:.4rem}.block .grid .item .pinned{filter:grayscale(100%);font-size:.8rem;color:#494949;margin-top:.2rem}.block .grid.odd .item:first-child{grid-column:1/-1}.block.articles .grid .item img{height:240px}.block.articles .grid.odd .item:first-child img,.block.images .grid .item img{height:360px}.block.images .grid.odd .item:first-child img{height:auto}.block .list{margin-top:1rem}.block .list ul{list-style-type:none;padding:0;margin:0}.block .list ul li{margin-bottom:1rem}.block .list ul li:last-child{margin-bottom:0}.block .list ul li:hover{padding-left:12px;margin-left:-20px;border-left:8px solid #747474}.block .list ul li.fullNote:hover{padding-left:0;margin-left:0;border-left:0}.block .list ul li a{display:block;text-decoration:none}.block .list ul li a:hover .summary{color:#242424}.block .list ul li a h2{font-size:1.1rem;border-bottom:4px solid #dadada;padding-bottom:8px}.block .list ul li a .summary,.block .list ul li a .content{margin-bottom:.4rem;font-size:.9rem;overflow-wrap:break-word;color:#747474}.block .list ul li a .summary img,.block .list ul li a .summary video,.block .list ul li a .content img,.block .list ul li a .content video{display:block;max-width:100%;max-height:90vh;margin:1rem auto}.block .list ul li a .content{margin-bottom:2rem}.block .list ul li a .date{font-size:.8rem;color:#a9a9a9}.block .slide .splide__slide{font-size:.9rem;overflow-wrap:break-word}.block .slide .splide__slide a{text-decoration:none}.block .slide .splide__slide .date{font-size:.8rem;color:#a9a9a9;margin-bottom:.3rem}.block .slide .splide__arrow--prev{left:-3em}.block .slide .splide__arrow--next{right:-3em}@media only screen and (max-width: 768px){.block .slide .splide__arrow--prev,.block .slide .splide__arrow--next{display:none}}.block .slide .splide__arrow{background:none}.block .slide .splide__arrow svg{fill:#a9a9a9}html.dark .block{border-bottom:8px solid #373737}html.dark .block .grid{color:#cbcbcb}html.dark .block .grid .item .content .content-fade{background:linear-gradient(transparent,#242424)}html.dark .block .grid.full-notes .item .title{border-bottom:4px solid #777777}html.dark .block .grid .summary,html.dark .block .grid .content{color:#a6a6a6}html.dark .block .grid .date,html.dark .block .grid .pinned{color:#777}html.dark .block .list{color:#cbcbcb}html.dark .block .list.short-feed-full .summary{color:#fff}html.dark .block .list .summary{color:#a6a6a6}html.dark .block .list .date,html.dark .block .list .pinned{color:#777}html.dark .block .list a:hover{border-color:#747474}html.dark .block .list a:hover .summary{color:#f5f5f5}html.dark .block .slide a{color:#cbcbcb}.event-wrapper{position:relative;overflow-wrap:break-word}.event-wrapper h1,.event-wrapper h2,.event-wrapper h3{display:block;margin-top:1.4rem;margin-bottom:.6rem}.event-wrapper h1:first-of-type{margin-top:0rem}.event-wrapper .content{margin-top:1.5rem}.event-wrapper p{line-height:1.3rem;margin-top:0rem}.event-wrapper .date{display:block;margin-bottom:.5rem;font-size:.8rem;color:#a9a9a9}.event-wrapper img{display:block;margin:2rem auto;max-width:100%;border-radius:4px}.event-wrapper img.note-banner{margin:2.5rem auto 3.5rem;transform:scale(1.04);width:100%;object-fit:cover;max-height:50vh}.event-wrapper img.note-image{margin:0;margin-top:1.5rem;width:100%}.event-wrapper video{width:100%;margin:2rem auto}.event-wrapper audio{width:100%;margin:2rem auto}.footer{margin-top:4rem;padding-top:2rem;margin-bottom:2rem;border-top:8px solid #ebebeb;font-size:.8rem;text-align:center;color:#cbcbcb}.footer a{color:#cbcbcb}html.dark .footer{border-top:8px solid #373737;color:#747474}html.dark .footer a,html.dark .footer a:visited{color:#747474}zap-threads{font-size:.9rem}.loader-container.svelte-mae19q{display:flex;align-items:center;justify-content:center;height:80vh;background-color:#fafafa}html.dark .loader-container.svelte-mae19q{background-color:#2e2e2e}.loader.svelte-mae19q{display:inline-block;width:92px;height:92px;opacity:0;animation:svelte-mae19q-fade-in .5s .4s forwards,svelte-mae19q-loader-animation 2s linear infinite .4s}.loader.svelte-mae19q:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:6px solid #a9a9a9;border-color:#a9a9a9 transparent #a9a9a9 transparent;animation:svelte-mae19q-loader-animation 2s linear infinite}html.dark .loader.svelte-mae19q:after{border:6px solid #373737;border-color:#373737 transparent #373737 transparent}@keyframes svelte-mae19q-loader-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes svelte-mae19q-fade-in{to{opacity:1}}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;contain:strict;display:inline-block;height:20px;inset:0;margin:auto;position:absolute;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports (outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports (outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;inset:0 .5em 0 auto;padding:1em 0}.hidden.svelte-1ifx1we{display:none}.hidden.svelte-19brd9o.svelte-19brd9o{visibility:hidden}.visible.svelte-19brd9o.svelte-19brd9o{visibility:visible}#theme-toggle.svelte-19brd9o.svelte-19brd9o{display:none}#theme-toggle.svelte-19brd9o+label.svelte-19brd9o{display:inline-block;cursor:pointer;height:1rem;width:1rem;position:absolute;top:1rem;right:3rem;border-radius:9px;transition-duration:.3s;content:"";@media only screen and (max-width: 768px){right:1rem}}#theme-toggle.svelte-19brd9o:not(:checked)+label.svelte-19brd9o{background-color:#ccc}#theme-toggle.svelte-19brd9o:checked+label.svelte-19brd9o{background-color:transparent;box-shadow:inset -6px -6px 1px 1px #3f3f3f}
|
|
|
|
</style>
|
|
</body>
|
|
</html>
|