-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
2 lines (2 loc) · 126 KB
/
app.js
1
2
"use strict";(()=>{var _t,T,tn,da,Ce,Xr,rn,Cr,nn,Fr,Rr,Sr,sn,je={},an=[],pa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Kr=Array.isArray;function ge(t,e){for(var r in e)t[r]=e[r];return t}function Ar(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function on(t,e,r){var n,s,i,o={};for(i in e)i=="key"?n=e[i]:i=="ref"?s=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?_t.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return Vt(t,o,n,s,null)}function Vt(t,e,r,n,s){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++tn,__i:-1,__u:0};return s==null&&T.vnode!=null&&T.vnode(i),i}function ne(t){return t.children}function Pt(t,e){this.props=t,this.context=e}function Ke(t,e){if(e==null)return t.__?Ke(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Ke(t):null}function ln(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return ln(t)}}function kr(t){(!t.__d&&(t.__d=!0)&&Ce.push(t)&&!Tt.__r++||Xr!==T.debounceRendering)&&((Xr=T.debounceRendering)||rn)(Tt)}function Tt(){var t,e,r,n,s,i,o,l;for(Ce.sort(Cr);t=Ce.shift();)t.__d&&(e=Ce.length,n=void 0,i=(s=(r=t).__v).__e,o=[],l=[],r.__P&&((n=ge({},s)).__v=s.__v+1,T.vnode&&T.vnode(n),Nr(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,o,i??Ke(s),!!(32&s.__u),l),n.__v=s.__v,n.__.__k[n.__i]=n,pn(o,n,l),n.__e!=i&&ln(n)),Ce.length>e&&Ce.sort(Cr));Tt.__r=0}function cn(t,e,r,n,s,i,o,l,p,u,m){var c,g,x,R,w,S,V=n&&n.__k||an,P=e.length;for(p=ua(r,e,V,p,P),c=0;c<P;c++)(x=r.__k[c])!=null&&(g=x.__i===-1?je:V[x.__i]||je,x.__i=c,S=Nr(t,x,g,s,i,o,l,p,u,m),R=x.__e,x.ref&&g.ref!=x.ref&&(g.ref&&Er(g.ref,null,x),m.push(x.ref,x.__c||R,x)),w==null&&R!=null&&(w=R),4&x.__u||g.__k===x.__k?p=dn(x,p,t):typeof x.type=="function"&&S!==void 0?p=S:R&&(p=R.nextSibling),x.__u&=-7);return r.__e=w,p}function ua(t,e,r,n,s){var i,o,l,p,u,m=r.length,c=m,g=0;for(t.__k=new Array(s),i=0;i<s;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(p=i+g,(o=t.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Vt(null,o,null,null,null):Kr(o)?Vt(ne,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Vt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,l=null,(u=o.__i=ga(o,r,p,c))!==-1&&(c--,(l=r[u])&&(l.__u|=2)),l==null||l.__v===null?(u==-1&&g--,typeof o.type!="function"&&(o.__u|=4)):u!=p&&(u==p-1?g--:u==p+1?g++:(u>p?g--:g++,o.__u|=4))):t.__k[i]=null;if(c)for(i=0;i<m;i++)(l=r[i])!=null&&!(2&l.__u)&&(l.__e==n&&(n=Ke(l)),un(l,l));return n}function dn(t,e,r){var n,s;if(typeof t.type=="function"){for(n=t.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=t,e=dn(n[s],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Ke(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ga(t,e,r,n){var s,i,o=t.key,l=t.type,p=e[r];if(p===null||p&&o==p.key&&l===p.type&&!(2&p.__u))return r;if(n>(p!=null&&!(2&p.__u)?1:0))for(s=r-1,i=r+1;s>=0||i<e.length;){if(s>=0){if((p=e[s])&&!(2&p.__u)&&o==p.key&&l===p.type)return s;s--}if(i<e.length){if((p=e[i])&&!(2&p.__u)&&o==p.key&&l===p.type)return i;i++}}return-1}function Qr(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||pa.test(e)?r:r+"px"}function wt(t,e,r,n,s){var i;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Qr(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||Qr(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(nn,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r.u=n.u:(r.u=Fr,t.addEventListener(e,i?Sr:Rr,i)):t.removeEventListener(e,i?Sr:Rr,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function en(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Fr++;else if(e.t<r.u)return;return r(T.event?T.event(e):e)}}}function Nr(t,e,r,n,s,i,o,l,p,u){var m,c,g,x,R,w,S,V,P,Ue,ue,xt,Ye,qr,bt,Tr,_r,re=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(p=!!(32&r.__u),i=[l=e.__e=r.__e]),(m=T.__b)&&m(e);e:if(typeof re=="function")try{if(V=e.props,P="prototype"in re&&re.prototype.render,Ue=(m=re.contextType)&&n[m.__c],ue=m?Ue?Ue.props.value:m.__:n,r.__c?S=(c=e.__c=r.__c).__=c.__E:(P?e.__c=c=new re(V,ue):(e.__c=c=new Pt(V,ue),c.constructor=re,c.render=fa),Ue&&Ue.sub(c),c.props=V,c.state||(c.state={}),c.context=ue,c.__n=n,g=c.__d=!0,c.__h=[],c._sb=[]),P&&c.__s==null&&(c.__s=c.state),P&&re.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ge({},c.__s)),ge(c.__s,re.getDerivedStateFromProps(V,c.__s))),x=c.props,R=c.state,c.__v=e,g)P&&re.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),P&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(P&&re.getDerivedStateFromProps==null&&V!==x&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(V,ue),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(V,c.__s,ue)===!1||e.__v==r.__v)){for(e.__v!=r.__v&&(c.props=V,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(Ze){Ze&&(Ze.__=e)}),xt=0;xt<c._sb.length;xt++)c.__h.push(c._sb[xt]);c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(V,c.__s,ue),P&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(x,R,w)})}if(c.context=ue,c.props=V,c.__P=t,c.__e=!1,Ye=T.__r,qr=0,P){for(c.state=c.__s,c.__d=!1,Ye&&Ye(e),m=c.render(c.props,c.state,c.context),bt=0;bt<c._sb.length;bt++)c.__h.push(c._sb[bt]);c._sb=[]}else do c.__d=!1,Ye&&Ye(e),m=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++qr<25);c.state=c.__s,c.getChildContext!=null&&(n=ge(ge({},n),c.getChildContext())),P&&!g&&c.getSnapshotBeforeUpdate!=null&&(w=c.getSnapshotBeforeUpdate(x,R)),l=cn(t,Kr(Tr=m!=null&&m.type===ne&&m.key==null?m.props.children:m)?Tr:[Tr],e,r,n,s,i,o,l,p,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),S&&(c.__E=c.__=null)}catch(Ze){if(e.__v=null,p||i!=null)if(Ze.then){for(e.__u|=p?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else for(_r=i.length;_r--;)Ar(i[_r]);else e.__e=r.__e,e.__k=r.__k;T.__e(Ze,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):l=e.__e=ma(r.__e,e,r,n,s,i,o,p,u);return(m=T.diffed)&&m(e),128&e.__u?void 0:l}function pn(t,e,r){for(var n=0;n<r.length;n++)Er(r[n],r[++n],r[++n]);T.__c&&T.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){T.__e(i,s.__v)}})}function ma(t,e,r,n,s,i,o,l,p){var u,m,c,g,x,R,w,S=r.props,V=e.props,P=e.type;if(P=="svg"?s="http://www.w3.org/2000/svg":P=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((x=i[u])&&"setAttribute"in x==!!P&&(P?x.localName==P:x.nodeType==3)){t=x,i[u]=null;break}}if(t==null){if(P==null)return document.createTextNode(V);t=document.createElementNS(s,P,V.is&&V),l&&(T.__m&&T.__m(e,i),l=!1),i=null}if(P===null)S===V||l&&t.data===V||(t.data=V);else{if(i=i&&_t.call(t.childNodes),S=r.props||je,!l&&i!=null)for(S={},u=0;u<t.attributes.length;u++)S[(x=t.attributes[u]).name]=x.value;for(u in S)if(x=S[u],u!="children"){if(u=="dangerouslySetInnerHTML")c=x;else if(!(u in V)){if(u=="value"&&"defaultValue"in V||u=="checked"&&"defaultChecked"in V)continue;wt(t,u,null,x,s)}}for(u in V)x=V[u],u=="children"?g=x:u=="dangerouslySetInnerHTML"?m=x:u=="value"?R=x:u=="checked"?w=x:l&&typeof x!="function"||S[u]===x||wt(t,u,x,S[u],s);if(m)l||c&&(m.__html===c.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),e.__k=[];else if(c&&(t.innerHTML=""),cn(t,Kr(g)?g:[g],e,r,n,P=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&Ke(r,0),l,p),i!=null)for(u=i.length;u--;)Ar(i[u]);l||(u="value",P=="progress"&&R==null?t.removeAttribute("value"):R!==void 0&&(R!==t[u]||P=="progress"&&!R||P=="option"&&R!==S[u])&&wt(t,u,R,S[u],s),u="checked",w!==void 0&&w!==t[u]&&wt(t,u,w,S[u],s))}return t}function Er(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(s){T.__e(s,r)}}function un(t,e,r){var n,s;if(T.unmount&&T.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Er(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){T.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(s=0;s<n.length;s++)n[s]&&un(n[s],e,r||typeof t.type!="function");r||Ar(t.__e),t.__c=t.__=t.__e=void 0}function fa(t,e,r){return this.constructor(t,r)}function me(t,e,r){var n,s,i,o;e==document&&(e=document.documentElement),T.__&&T.__(t,e),s=(n=typeof r=="function")?null:r&&r.__k||e.__k,i=[],o=[],Nr(e,t=(!n&&r||e).__k=on(ne,null,[t]),s||je,je,e.namespaceURI,!n&&r?[r]:s?null:e.firstChild?_t.call(e.childNodes):null,i,!n&&r?r:s?s.__e:e.firstChild,n,o),pn(i,t,o)}function gn(t,e){var r={__c:e="__cC"+sn++,__:t,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=new Set,(i={})[e]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&s.forEach(function(l){l.__e=!0,kr(l)})},this.sub=function(o){s.add(o);var l=o.componentWillUnmount;o.componentWillUnmount=function(){s&&s.delete(o),l&&l.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}_t=an.slice,T={__e:function(t,e,r,n){for(var s,i,o;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,n||{}),o=s.__d),o)return s.__E=s}catch(l){t=l}throw t}},tn=0,da=function(t){return t!=null&&t.constructor==null},Pt.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ge({},this.state),typeof t=="function"&&(t=t(ge({},r),this.props)),t&&ge(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),kr(this))},Pt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),kr(this))},Pt.prototype.render=ne,Ce=[],rn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cr=function(t,e){return t.__v.__b-e.__v.__b},Tt.__r=0,nn=/(PointerCapture)$|Capture$/i,Fr=0,Rr=en(!1),Sr=en(!0),sn=0;function Ct(t){return`id-${t}`}function q(t){return`cl-${t}`}function Ae(t){return`data-${t}`}var Rt=typeof document>"u"?void 0:document,Lr=Rt?.querySelector.bind(Rt),ha=Rt?.querySelectorAll.bind(Rt),le=t=>Lr(`#${Ct(t)}`)??void 0,z=t=>ha(`.${q(t)}`),Je=(t,e)=>t?.getAttribute(Ae(e))??void 0;function B(t){return{onClick:e=>{e.stopPropagation(),t(e)},onKeyDown:e=>{e.stopPropagation(),e.key==="Enter"&&(e.preventDefault(),t(e))}}}function se(t,e,r,n){if(t||console.warn("missing target",{type:e,listener:r,opt:n}),t?.addEventListener(e,r,n),t)return()=>ya(t,e,r,n)}function ya(t,e,r,n){t||console.warn("missing target",{type:e,listener:r,opt:n}),t?.removeEventListener(e,r,n)}function mn(t,e){return t||console.warn("missing target",e),t?.dispatchEvent(e)}function fn(t,e,r={bubbles:!0,composed:!0,cancelable:void 0}){return new CustomEvent(t,{detail:e,...r})}function Re(t){return e=>{e.target&&"tagName"in e.target&&t(e.target,e)}}var fe="!n",Ne="!t",Ee="!f",Le="(",De="!(",ae=")",Me=":",he=",",qe="string",St="number";var ee={quote:()=>(t,e)=>{if(!t.startsWith("'",e))return null;let r=e;for(;;){if(t.length<=++r)throw new SyntaxError("Unexpected end of Rison input");switch(t[r]){case"!":r++;continue;case"'":return{kind:qe,value:t.slice(e,r+1)}}}},string:t=>(e,r)=>e.startsWith(t,r)?{kind:t,value:t}:null,regexp:(t,e)=>(r,n)=>{let s=e.exec(r.slice(n));return s?{kind:t,value:s[0]}:null}},va=[ee.quote(),ee.string(Le),ee.string(De),ee.string(ae),ee.string(fe),ee.string(Ne),ee.string(Ee),ee.string(Me),ee.string(he),ee.regexp(qe,/^[^0-9- '!:(),*@$][^ '!:(),*@$]*/),ee.regexp(St,/^-?([1-9][0-9]*|[0-9])(\.[0-9]+)?(e-?[0-9]+)?/)],kt=class{source;pos=0;constructor(e){this.source=e}position(){return this.pos}length(){return this.source.length}nextToken(){if(this.pos>=this.source.length)return null;for(let e of va){let r=e(this.source,this.pos);if(r!==null)return this.pos+=r.value.length,r}throw new SyntaxError(`Unexpected token ${this.source[this.pos]} in Rison at position ${this.pos}`)}syntaxError(e){let r=this.pos-e.value.length;return new SyntaxError(`Unexpected token ${this.source[r]} in Rison at position ${r}`)}};var Ft=class{lexer;constructor(e){this.lexer=e}readAsAny(){let e=this.asAny(this.nextToken());if(this.lexer.position()<this.lexer.length())throw this.lexer.syntaxError(this.nextToken());return e}asAny(e){switch(e.kind){case fe:return null;case Ne:return!0;case Ee:return!1;case qe:return this.asString(e);case St:return Number(e.value);case Le:return this.readAsObject();case De:return this.readAsArray();default:throw this.lexer.syntaxError(e)}}asString(e){return e.value[0]==="'"?e.value.replace(/!./g,r=>r[1]).slice(1,-1):e.value}readAsObject(){let e={},r=this.nextToken();for(;r.kind!==ae;){let n=this.asString(r);this.expectToken(Me);let s=this.asAny(this.nextToken());if(e[n]=s,r=this.nextToken(),r.kind===ae)break;if(r.kind!==he)throw this.lexer.syntaxError(r);r=this.nextToken()}return e}readAsArray(){let e=[],r=this.nextToken();for(;r.kind!==ae&&(e.push(this.asAny(r)),r=this.nextToken(),r.kind!==ae);){if(r.kind!==he)throw this.lexer.syntaxError(r);r=this.nextToken()}return e}expectToken(e){let r=this.nextToken();if(r.kind!==e)throw this.lexer.syntaxError(r)}nextToken(){let e=this.lexer.nextToken();if(!e)throw new SyntaxError("Unexpected end of Rison input");return e}};var xa=/^[^0-9- '!:(),*@$][^ '!:(),*@$]*$/,Kt=class{value(e){if(e!==void 0){if(e===null)return fe;switch(typeof e){case"object":return Array.isArray(e)?`${De}${this.array(e)}${ae}`:`${Le}${this.object(e)}${ae}`;case"boolean":return this.boolean(e);case"number":return this.number(e);case"string":return this.string(e);case"bigint":throw new TypeError("Do not known how to serialize a BigInt");default:return}}}object(e){return Object.entries(e).reduce((r,[n,s])=>{let i=this.value(s);if(i===void 0)return r;let o=`${this.string(n)}${Me}${i}`;return r.length>0?`${r}${he}${o}`:o},"")}array(e){return e.reduce((r,n)=>{let s=this.value(n)||fe;return r.length>0?`${r}${he}${s}`:s},"")}boolean(e){return e?Ne:Ee}number(e){return Number.isFinite(e)?e.toString().replace("+",""):fe}string(e){return xa.test(e)?e:`'${e.replace(/[!']/g,r=>`!${r}`)}'`}};var ie={parse:t=>{let e=new kt(t);return new Ft(e).readAsAny()},stringify:t=>new Kt().value(t)};var Va=/^[-A-Za-z0-9~!*()_.',:@$/]*$/,hn=t=>Va.test(t)?t:encodeURIComponent(t).replace(/%2C/g,",").replace(/%3A/g,":").replace(/%40/g,"@").replace(/%24/g,"$").replace(/%2F/g,"/").replace(/%20/g,"+"),yn=t=>decodeURIComponent(t.replace(/\+/g,"%20")),vn={parse:t=>ie.parse(yn(t)),stringify:t=>hn(ie.stringify(t))};var Ei=vn.parse,Li=vn.stringify;var Gi=ie.parse,Ii=ie.stringify;var _=(t,e)=>e(t),Ge=(t,e)=>(e(t),t);function xn(t){for(let e in t)if(Object.hasOwn(t,e))return!1;return!0}var Xe=typeof window>"u"?void 0:window;function At(t){if(!t)return"";if(t instanceof URL||t instanceof Location)return t.hash.slice(1);let e=t.indexOf("#");return e!==-1?t.slice(e+1):t}var A=class extends EventTarget{#e=Xe.location.hash.slice(1);#t;#r;static deserialize(e=Xe.location.hash){try{let r=e.slice(e.indexOf("#")+1).trim();if(r.length>2&&r.startsWith("(")&&r.endsWith(")"))return ie.parse(r)}catch(r){console.warn("Failed to parse RISON:",e,r)}}static serialize(e){try{return xn(e)?void 0:ie.stringify(e)}catch(r){console.error("Failed to serialize data",r)}}bind(){return this.destroy(),this.#r=this.#s.bind(this),Xe.addEventListener("hashchange",this.#r),this}destroy(){this.#r&&(Xe.removeEventListener("hashchange",this.#r),this.#r=void 0)}get fragment(){return this.#e}get previous(){return this.#t}#s({newURL:e,oldURL:r}){let n=At(e);n!==this.#e&&(this.#t=At(r),this.#e=n,this.dispatchEvent(this.#n(wn)),this.dispatchEvent(this.#n(bn)))}pushState(e){let r=At(e);r!==this.#e&&(this.#t=this.#e,this.#e=r,history.pushState(null,"",`#${r}`),this.dispatchEvent(this.#n(bn)))}update(e){Xe.location.hash=At(e)}onUserChange(e){return se(this,wn,e)}#n(e){return new Dr(e,{fragment:this.#e,previous:this.#t})}},bn="fragmentchange",wn="fragmentuserchange",Dr=class extends CustomEvent{constructor(e,r,n={bubbles:!0,cancelable:void 0,composed:!0}){super(e,{...n,detail:r})}get fragment(){return this.detail.fragment}get previous(){return this.detail.previous}get deserFrag(){return A.deserialize(this.detail.fragment)}get deserPrev(){let{previous:e}=this.detail;return e?A.deserialize(e):void 0}};var Ie,k,Mr,Vn,Et=0,Fn=[],E=T,Pn=E.__b,Tn=E.__r,_n=E.diffed,Cn=E.__c,Rn=E.unmount,Sn=E.__;function Lt(t,e){E.__h&&E.__h(k,t,Et||e),Et=0;var r=k.__H||(k.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ye(t){return Et=1,Ta(An,t)}function Ta(t,e,r){var n=Lt(Ie++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):An(void 0,e),function(l){var p=n.__N?n.__N[0]:n.__[0],u=n.t(p,l);p!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=k,!k.u)){var s=function(l,p,u){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(g){return!!g.__c});if(m.every(function(g){return!g.__N}))return!i||i.call(this,l,p,u);var c=n.__c.props!==l;return m.forEach(function(g){if(g.__N){var x=g.__[0];g.__=g.__N,g.__N=void 0,x!==g.__[0]&&(c=!0)}}),i&&i.call(this,l,p,u)||c};k.u=!0;var i=k.shouldComponentUpdate,o=k.componentWillUpdate;k.componentWillUpdate=function(l,p,u){if(this.__e){var m=i;i=void 0,s(l,p,u),i=m}o&&o.call(this,l,p,u)},k.shouldComponentUpdate=s}return n.__N||n.__}function $(t,e){var r=Lt(Ie++,3);!E.__s&&Kn(r.__H,e)&&(r.__=t,r.i=e,k.__H.__h.push(r))}function U(t){return Et=5,_a(function(){return{current:t}},[])}function _a(t,e){var r=Lt(Ie++,7);return Kn(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function X(t){var e=k.context[t.__c],r=Lt(Ie++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(k)),e.props.value):t.__}function Ca(){for(var t;t=Fn.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Nt),t.__H.__h.forEach(Gr),t.__H.__h=[]}catch(e){t.__H.__h=[],E.__e(e,t.__v)}}E.__b=function(t){k=null,Pn&&Pn(t)},E.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Sn&&Sn(t,e)},E.__r=function(t){Tn&&Tn(t),Ie=0;var e=(k=t.__c).__H;e&&(Mr===k?(e.__h=[],k.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(Nt),e.__h.forEach(Gr),e.__h=[],Ie=0)),Mr=k},E.diffed=function(t){_n&&_n(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Fn.push(e)!==1&&Vn===E.requestAnimationFrame||((Vn=E.requestAnimationFrame)||Ra)(Ca)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Mr=k=null},E.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Nt),r.__h=r.__h.filter(function(n){return!n.__||Gr(n)})}catch(n){e.some(function(s){s.__h&&(s.__h=[])}),e=[],E.__e(n,r.__v)}}),Cn&&Cn(t,e)},E.unmount=function(t){Rn&&Rn(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Nt(n)}catch(s){e=s}}),r.__H=void 0,e&&E.__e(e,r.__v))};var kn=typeof requestAnimationFrame=="function";function Ra(t){var e,r=function(){clearTimeout(n),kn&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);kn&&(e=requestAnimationFrame(r))}function Nt(t){var e=k,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),k=e}function Gr(t){var e=k;t.__c=t.__(),k=e}function Kn(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function An(t,e){return typeof e=="function"?e(t):e}var Y=class{constructor(e){this.data=e}dispatcher;clone(){let e=this.constructor,r=new e(this.data);return r.dispatcher=this.dispatcher,r}dispatch(){return this.dispatcher?.(this.clone()),this}};function F(t){let[e,r]=ye(t);return e.dispatcher=r,e}function Dt(t){let e=U();return $(()=>{let r=e.current?.parentElement;r&&t&&(r.state=t)},[t]),e}var ve="hover:bg-hiliteb/75 hover:text-hilitef cursor-pointer",Mt="rounded p-1 hover:text-hiliteb hover:ring-1 hover:ring-primary",Oe="rounded-2xl hover:bg-background/20 hover:text-hiliteb";var W="bg-background text-foreground placeholder:text-foreground/50",Qe="prose dark:prose-invert sm:prose-sm lg:prose-lg xl:prose-xl",Xi=`${Qe} max-w-[80ch] mx-auto`,xe="overflow-hidden overflow-y-auto";function d(...t){return t.flat(5).filter(e=>typeof e=="string"&&!/^;|;$/.test(e)).join(" ")}var Sa=0,to=Array.isArray;function a(t,e,r,n,s,i){e||(e={});var o,l,p=e;"ref"in e&&(o=e.ref,delete e.ref);var u={type:t,props:p,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Sa,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)p[l]===void 0&&(p[l]=o[l]);return T.vnode&&T.vnode(u),u}var M="fill-current size-[1.5rem]",Nn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Alphabetic"}),a("path",{d:"M3.0805,8.3675,2.31,10.878c-.028.091-.0705.122-.154.122H.756c-.0845,0-.1125-.0455-.1-.15L3.5425,1.9285A2.51436,2.51436,0,0,0,3.669,1.107c0-.0615.028-.107.084-.107H5.7c.0705,0,.084.015.1.0915L9.0355,10.863c.0145.0915,0,.137-.084.137H7.381a.14051.14051,0,0,1-.1405-.0915L6.428,8.3675Zm2.9-1.6595c-.294-1.005-.9525-3.12-1.233-4.1855h-.014c-.224,1.02-.785,2.8-1.2045,4.1855Z"}),a("path",{d:"M9.613,17c-.0565,0-.1125-.015-.1125-.122v-1.02a.346.346,0,0,1,.042-.1825l4.861-7.032H9.711c-.0705,0-.1125-.0145-.1-.106l.21-1.4155C9.835,7.031,9.877,7,9.9465,7H16.463c.069,0,.084.031.084.0915v1.096a.3265.3265,0,0,1-.0705.213L11.7,15.3415h5.015c.069,0,.1.0455.069.137l-.2235,1.4c-.0135.091-.042.122-.126.122Z"})]}),En=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Add"}),a("path",{d:"M14.5,8H10V3.5A.5.5,0,0,0,9.5,3h-1a.5.5,0,0,0-.5.5V8H3.5a.5.5,0,0,0-.5.5v1a.5.5,0,0,0,.5.5H8v4.5a.5.5,0,0,0,.5.5h1a.5.5,0,0,0,.5-.5V10h4.5a.5.5,0,0,0,.5-.5v-1A.5.5,0,0,0,14.5,8Z"})]}),Ln=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Ranking"}),a("path",{d:"M14.259,7.6a2.3635,2.3635,0,0,0,1.6805-2.2255c0-1.521-1.0885-2.625-3.0895-2.625a5.365,5.365,0,0,0-2.561.6245.13949.13949,0,0,0-.064.144V4.542c0,.064.0165.0795.0965.05A4.33146,4.33146,0,0,1,12.626,3.95c1.4085,0,2,.688,2,1.584,0,1.0245-.8645,1.569-2.273,1.569h-.591c-.08,0-.096.05-.096.112V8.223c0,.064.032.096.112.096h.672c1.5845,0,2.641.5765,2.641,1.857,0,1.009-.704,1.8725-2.4325,1.8725a7.11785,7.11785,0,0,1-2.497-.654,3.79252,3.79252,0,0,0,.3305-1.54,3.01569,3.01569,0,0,0-3.224-3.192A6.30249,6.30249,0,0,0,4.5,7.392V1.625a.375.375,0,0,0-.375-.375H3.379a.3735.3735,0,0,0-.3.15L1.65,2.545a.747.747,0,0,0-.15.45v.124a.375.375,0,0,0,.375.375H3v7.125a.375.375,0,0,0,.375.375h.75a.375.375,0,0,0,.375-.375V8.7775a5.26947,5.26947,0,0,1,2.516-.754c1.2735,0,2.05.6225,2.05,1.8765,0,.9625-.4695,1.8975-1.9,3.4775A24.53582,24.53582,0,0,1,4.6,15.897a.25.25,0,0,0-.0845.2095v.709c0,.161.106.1845.169.1845H10.575c.1185,0,.156-.0425.2-.15l.235-.9755a.135.135,0,0,0-.0175-.1215.17851.17851,0,0,0-.15-.05H8.669c-1.209,0-1.457,0-1.932.031a15.25015,15.25015,0,0,0,1.859-2.0125c.3735-.4585.6955-.874.9695-1.275a8.3231,8.3231,0,0,0,3.1085.805c2.161,0,3.7775-1.104,3.7775-3.073A2.611,2.611,0,0,0,14.259,7.6Z"})]});var Dn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Sun"}),a("path",{d:"m9,5.05c2.18152,0,3.95,1.76848,3.95,3.95s-1.76848,3.95-3.95,3.95-3.95-1.76848-3.95-3.95,1.76848-3.95,3.95-3.95Zm-.9-4.8v2.5c0,.13807.11193.25.25.25h1.3c.13807,0,.25-.11193.25-.25V.25c0-.13807-.11193-.25-.25-.25h-1.3c-.13807,0-.25.11193-.25.25Zm0,15v2.5c0,.13807.11193.25.25.25h1.3c.13807,0,.25-.11193.25-.25v-2.5c0-.13807-.11193-.25-.25-.25h-1.3c-.13807,0-.25.11193-.25.25ZM0,8.35v1.3c0,.13807.11193.25.25.25h2.5c.13807,0,.25-.11193.25-.25v-1.3c0-.13807-.11193-.25-.25-.25H.25c-.13807,0-.25.11193-.25.25Zm15,0v1.3c0,.13807.11193.25.25.25h2.5c.13807,0,.25-.11193.25-.25v-1.3c0-.13807-.11193-.25-.25-.25h-2.5c-.13807,0-.25.11193-.25.25Zm-2.01021-4.23913l.91924.91924c.09763.09763.25592.09763.35355,0l1.76777-1.76777c.09763-.09763.09763-.25592,0-.35355l-.91924-.91924c-.09763-.09763-.25592-.09763-.35355,0l-1.76777,1.76777c-.09763.09763-.09763.25592,0,.35355ZM1.98978,15.11121l.91924.91924c.09763.09763.25592.09763.35355,0l1.76777-1.76777c.09763-.09763.09763-.25592,0-.35355l-.91924-.91924c-.09763-.09763-.25592-.09763-.35355,0l-1.76777,1.76777c-.09763.09763-.09763.25592,0,.35355Zm-.01031-11.8587l1.76777,1.76777c.09763.09763.25592.09763.35355,0l.91924-.91924c.09763-.09763.09763-.25592,0-.35355l-1.76777-1.76777c-.09763-.09763-.25592-.09763-.35355,0l-.91924.91924c-.09763.09763-.09763.25592,0,.35355Zm10.9902,10.99001l1.76777,1.76777c.09763.09763.25592.09763.35355,0l.91924-.91924c.09763-.09763.09763-.25592,0-.35355l-1.76777-1.76777c-.09763-.09763-.25592-.09763-.35355,0l-.91924.91924c-.09763.09763-.09763.25592,0,.35355Z"})]}),Mn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Moon"}),a("path",{d:"M9,1a8,8,0,1,0,8,8A8,8,0,0,0,9,1Zm.5,14.982c-.165.0115-.332.018-.5.018A7,7,0,0,1,9,2c.168,0,.335.0065.5.018A11,11,0,0,0,9.5,15.982Z"})]}),Gn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Menu"}),a("rect",{height:"2",rx:"0.5",width:"14",x:"2",y:"8"}),a("rect",{height:"2",rx:"0.5",width:"14",x:"2",y:"3"}),a("rect",{height:"2",rx:"0.5",width:"14",x:"2",y:"13"})]}),Gt=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Close"}),a("path",{d:"M13.2425,3.343,9,7.586,4.7575,3.343a.5.5,0,0,0-.707,0L3.343,4.05a.5.5,0,0,0,0,.707L7.586,9,3.343,13.2425a.5.5,0,0,0,0,.707l.707.7075a.5.5,0,0,0,.707,0L9,10.414l4.2425,4.243a.5.5,0,0,0,.707,0l.7075-.707a.5.5,0,0,0,0-.707L10.414,9l4.243-4.2425a.5.5,0,0,0,0-.707L13.95,3.343a.5.5,0,0,0-.70711-.00039Z"})]});var In=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Filter Edit"}),a("path",{d:"M17.8925,10.8605,16.14,9.1075A.36952.36952,0,0,0,15.8765,9H15.865a.41651.41651,0,0,0-.282.1235l-5.411,5.411a.304.304,0,0,0-.0765.128l-1.0135,3c-.0345.1145.1395.2585.238.2585a.15858.15858,0,0,0,.0185,0c.084-.0195,2.5615-.882,3-1.014a.3.3,0,0,0,.126-.0755l5.412-5.4145A.41749.41749,0,0,0,18,11.15.37152.37152,0,0,0,17.8925,10.8605Zm-5.8,5.4815c-.657.1975-1.65.6145-2.215.784l.78-2.2155Z"}),a("path",{d:"M15.473,1H1.527a.5.5,0,0,0-.3935.8085L7,9.2945V15a.496.496,0,0,0,.84.4125L9.83,13.336a.61.61,0,0,0,.17-.4225V9.2945l5.8665-7.486A.5.5,0,0,0,15.473,1Z"})]});var On=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Boolean"}),a("path",{d:"M12,4.25a4.75,4.75,0,0,1,0,9.5H6a4.75,4.75,0,0,1,0-9.5ZM12,3H6A6,6,0,0,0,6,15h6A6,6,0,0,0,12,3Zm0,3A3,3,0,1,1,9,9,3,3,0,0,1,12,6Z"})]});var We=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Reset Selection"}),a("path",{d:"m2,9h1v3h-1v-3Zm1,6v-1h-1v1.5555c0,.24549.19901.4445.4445.4445h1.5555v-1h-1Zm3,1h3v-1h-3v1Zm9-7h1v-3h-1v3Zm.5555-7h-1.5555v1h1v1h1v-1.5555c0-.24549-.19901-.4445-.4445-.4445Zm-6.5555,1h3v-1h-3v1ZM1.10295,1.97065l14.92632,14.92632c.15973.15973.41869.15972.57841,0l.28956-.28956c.15972-.15972.15973-.41869,0-.57841L1.97092,1.10268c-.15972-.15972-.41869-.15972-.57841,0l-.28956.28956c-.15972.15972-.15972.41869,0,.57841Zm14.89705,11.74835v-2.719h-1v1.719l1,1Zm-3.282,1.281h-1.718v1h2.718l-1-1ZM2,4.281v2.719h1v-1.719l-1-1Zm3.281-1.281h1.719v-1h-2.719l1,1Z"})]});var It=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Sort Down"}),a("rect",{id:"Canvas",fill:"#ff13dc",opacity:"0",width:"18",height:"18"}),a("rect",{height:"2",rx:"0.5",width:"6",x:"1",y:"12"}),a("rect",{height:"2",rx:"0.5",width:"8",x:"1",y:"8"}),a("rect",{height:"2",rx:"0.5",width:"10",x:"1",y:"4"}),a("path",{d:"M16,12H14.9965V4.5a.494.494,0,0,0-.488-.5L14.503,4h-.496a.5.5,0,0,0-.5.5L13.5035,12H12.5a.25.25,0,0,0-.25.25.245.245,0,0,0,.0735.175l1.7685,2.0165a.25.25,0,0,0,.316,0l1.7685-2.0165a.245.245,0,0,0,.0735-.175A.25.25,0,0,0,16,12Z"})]}),Ot=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Sort Up"}),a("rect",{height:"2",rx:"0.5",width:"6",x:"1",y:"4"}),a("rect",{height:"2",rx:"0.5",width:"8",x:"1",y:"8"}),a("rect",{height:"2",rx:"0.5",width:"10",x:"1",y:"12"}),a("path",{d:"M15.99951,6H14.99634v7.5a.49378.49378,0,0,1-.49317.5h-.49633a.5.5,0,0,1-.5-.49951L13.50366,6H12.50049A.24984.24984,0,0,1,12.25,5.74823a.24439.24439,0,0,1,.07373-.175L14.0918,3.5564a.25007.25007,0,0,1,.3164,0l1.76807,2.01684a.24439.24439,0,0,1,.07373.175A.24984.24984,0,0,1,15.99951,6Z"})]});var Wn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",class:M,children:[a("title",{children:"Languish Language Rankings"}),a("path",{d:"M16.5465,3.0305l-4.07,5.687L10.45,4.6605a.25.25,0,0,0-.4585.0265l-2.725,7.496L5.226,10.1425a.25.25,0,0,0-.337-.0155L1.09,13.2895a.25.25,0,0,0-.09.192v2.094a.25.25,0,0,0,.4145.188l3.524-3.0785,2.854,2.854a.25.25,0,0,0,.4115-.0915l2.274-6.255L12,12.2405a.25.25,0,0,0,.4285.0315L16.955,5.808A.25.25,0,0,0,17,5.665V3.176a.25.25,0,0,0-.4535-.1455Z"})]});var Bn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 16 480 384",class:M,children:[a("title",{children:"Github"}),a("path",{d:"M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"})]}),$n=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 32 512 448",class:M,children:[a("title",{children:"Reddit"}),a("path",{d:"M373 138.6c-25.2 0-46.3-17.5-51.9-41l0 0c-30.6 4.3-54.2 30.7-54.2 62.4l0 .2c47.4 1.8 90.6 15.1 124.9 36.3c12.6-9.7 28.4-15.5 45.5-15.5c41.3 0 74.7 33.4 74.7 74.7c0 29.8-17.4 55.5-42.7 67.5c-2.4 86.8-97 156.6-213.2 156.6S45.5 410.1 43 323.4C17.6 311.5 0 285.7 0 255.7c0-41.3 33.4-74.7 74.7-74.7c17.2 0 33 5.8 45.7 15.6c34-21.1 76.8-34.4 123.7-36.4l0-.3c0-44.3 33.7-80.9 76.8-85.5C325.8 50.2 347.2 32 373 32c29.4 0 53.3 23.9 53.3 53.3s-23.9 53.3-53.3 53.3zM157.5 255.3c-20.9 0-38.9 20.8-40.2 47.9s17.1 38.1 38 38.1s36.6-9.8 37.8-36.9s-14.7-49.1-35.7-49.1zM395 303.1c-1.2-27.1-19.2-47.9-40.2-47.9s-36.9 22-35.7 49.1c1.2 27.1 16.9 36.9 37.8 36.9s39.3-11 38-38.1zm-60.1 70.8c1.5-3.6-1-7.7-4.9-8.1c-23-2.3-47.9-3.6-73.8-3.6s-50.8 1.3-73.8 3.6c-3.9 .4-6.4 4.5-4.9 8.1c12.9 30.8 43.3 52.4 78.7 52.4s65.8-21.6 78.7-52.4z"})]}),Hn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 413",class:M,children:[a("title",{children:"Wikipedia"}),a("path",{d:"M640 51.2l-.3 12.2c-28.1 .8-45 15.8-55.8 40.3-25 57.8-103.3 240-155.3 358.6H415l-81.9-193.1c-32.5 63.6-68.3 130-99.2 193.1-.3 .3-15 0-15-.3C172 352.3 122.8 243.4 75.8 133.4 64.4 106.7 26.4 63.4 .2 63.7c0-3.1-.3-10-.3-14.2h161.9v13.9c-19.2 1.1-52.8 13.3-43.3 34.2 21.9 49.7 103.6 240.3 125.6 288.6 15-29.7 57.8-109.2 75.3-142.8-13.9-28.3-58.6-133.9-72.8-160-9.7-17.8-36.1-19.4-55.8-19.7V49.8l142.5 .3v13.1c-19.4 .6-38.1 7.8-29.4 26.1 18.9 40 30.6 68.1 48.1 104.7 5.6-10.8 34.7-69.4 48.1-100.8 8.9-20.6-3.9-28.6-38.6-29.4 .3-3.6 0-10.3 .3-13.6 44.4-.3 111.1-.3 123.1-.6v13.6c-22.5 .8-45.8 12.8-58.1 31.7l-59.2 122.8c6.4 16.1 63.3 142.8 69.2 156.7L559.2 91.8c-8.6-23.1-36.4-28.1-47.2-28.3V49.6l127.8 1.1 .2 .5z"})]}),zn=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"3 32 379 448",class:M,children:[a("title",{children:"Stack Overflow"}),a("path",{d:"M290.7 311L95 269.7 86.8 309l195.7 41zm51-87L188.2 95.7l-25.5 30.8 153.5 128.3zm-31.2 39.7L129.2 179l-16.7 36.5L293.7 300zM262 32l-32 24 119.3 160.3 32-24zm20.5 328h-200v39.7h200zm39.7 80H42.7V320h-40v160h359.5V320h-40z"})]}),Ir=a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:M,children:[a("title",{children:"External Link"}),a("path",{d:"M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"})]});var Wt=typeof localStorage>"u"?void 0:localStorage,Un=typeof document>"u"?void 0:document,C=t=>new Or(t),Wr=()=>(Un?Un.body.dataset.page:void 0)??"_any_page_",Se=()=>C(Wr()),Or=class{constructor(e){this.page=e}update(e,r){let n=this.fullKey(e);Wt?.setItem(n,JSON.stringify(r))}load(e){let r=this.fullKey(e),n=Wt?.getItem(r);if(n)try{return JSON.parse(n)}catch(s){console.error("Failed to load data from localStorage",{key:r,jsonString:n,e:s}),Wt?.removeItem(r)}}remove(e){Wt?.removeItem(this.fullKey(e))}fullKey(e){return`plangs-${this.page}-${e}`}};function jn({action:t,disabled:e,initial:r}){if(t==="lights")return F(()=>et.initial(e));if(t==="hamburger")return F(()=>tt.initial(e));if(t==="facets")return F(()=>rt.initial(e));if(t==="allAny")return F(()=>Br.initial(r,e));if(t==="clearFacets")return F(()=>$r.initial(e));if(t==="gridOrder")return F(()=>Hr.initial(e));console.error(`Unknown action: ${t}`)}var be=class extends Y{get disabled(){return this.data.disabled}set disabled(e){this.data.disabled=e}get value(){let{disabled:e,...r}=this.data;return r}get hidden(){return!1}get hilight(){return!1}},Bt=C("_any_page_"),et=class t extends be{static initial(e=!1){let r=Bt.load("theme");return new t({mode:r==="light"?"light":"dark",disabled:e})}get isDark(){return this.data.mode==="dark"}get icon(){return this.isDark?Dn:Mn}doAction(){this.data.mode=this.isDark?"light":"dark"}runEffects(){document.body.classList.toggle("dark",this.isDark),Bt.update("theme",this.data.mode)}},tt=class t extends be{static initial(e=!1){let r=Bt.load("hamburger-menu");return new t({mode:r==="hide"?"hide":"show",disabled:e})}get hilight(){return!this.hide}get hide(){return this.data.mode==="hide"}get icon(){return Gn}doAction(){this.data.mode=this.hide?"show":"hide"}runEffects(){le("mainNav")?.classList.toggle("hidden",this.hide),Bt.update("hamburger-menu",this.data.mode)}},rt=class t extends be{static initial(e=!1){let r=Se().load("facets-browser");return new t({mode:r==="show"?"show":"hide",disabled:e})}get hilight(){return this.show}get show(){return this.data.mode==="show"}get icon(){return In}doAction(){this.data.mode=this.show?"hide":"show"}runEffects(){let e=z("facetsMain");e.length>0&&e[0].classList.toggle("hidden",!this.show),Se().update("facets-browser",this.data.mode)}},Br=class t extends be{static initial(e,r=!1){return new t({mode:e==="all"?"all":"any",disabled:r})}get mode(){return this.data.mode}get icon(){let e=this.data.disabled,r=e||this.mode==="any",n=e||this.mode==="all";return a("span",{class:d("px-1","flex flex-row gap-1","items-center","align-middle"),children:[a("span",{class:d(r&&"opacity-50","whitespace-nowrap"),children:"All"}),a("span",{class:d("inline-block","mt-[1px] px-1","scale-85",this.mode==="all"&&"rotate-180",!e&&Oe),children:On}),a("span",{class:d(n&&"opacity-50","whitespace-nowrap"),children:"Any"})]})}doAction(){this.data.mode=this.mode==="all"?"any":"all"}runEffects(){}},$r=class t extends be{static initial(e=!1){return new t({disabled:e,mode:""})}doAction(){this.data.mode=""}doToggleMode(e){this.data.mode=e,this.dispatch()}get icon(){return We}get hidden(){return this.data.mode===""}runEffects(){for(let e of z("facetsMain"))e.state?.doResetAll()}},Hr=class t extends be{static initial(e=!1){return new t({disabled:e,mode:"alpha"})}get mode(){return this.data.mode}get icon(){return this.mode==="alpha"?Nn:Ln}doAction(){this.data.mode=this.mode==="alpha"?"ranking":"alpha"}runEffects(){let e=le("vertexGrid");if(!e)return;let r=[...z("vertexThumbn")].sort(Fa[this.mode]);for(let n of r)e.appendChild(n)}},ka=Number.MAX_SAFE_INTEGER,Yn=t=>{let e=Je(t,"vertex-ranking");return e?Number.parseInt(e):ka},Zn=t=>t.dataset.vertexKey??"",Fa={ranking:(t,e)=>Yn(t)-Yn(e),alpha:(t,e)=>Zn(t).localeCompare(Zn(e))};function ce({action:t,disabled:e,initial:r}){let n=jn({action:t,disabled:e,initial:r}),s=Dt(n);return $(()=>{if(!n)return;let o=e===void 0?!1:e;o!==n.disabled&&(n.disabled=o,n.dispatch())},[e]),a("div",{ref:s,tabIndex:e?void 0:0,...B(()=>{!n||n.disabled||(n.doAction(),n.runEffects(),n.dispatch(),mn(s.current,fn("icon-button",n.value)))}),class:d("group",e?"cursor-auto opacity-50":"cursor-pointer","border-1 border-dotted",n?.hilight?"border-primary":"border-transparent",t!=="allAny"&&Mt,n?.hidden&&"invisible"),children:n?.icon})}function Jn(){for(let t of z("iconButton"))if(t.dataset.action){let e=t.dataset.action;me(a(ce,{action:e}),t)}else console.error("Missing prop for IconButton component.")}function Be({children:t,title:e,class:r}){return a("div",{...e?{title:e}:{},class:d("max-w-full","mr-4 mb-3 px-2","outline-1 outline-primary/50","rounded-tl-lg rounded-br-lg","bg-secondary/75 text-foreground/85","truncate",r),children:t})}function qn(t){let e=Object.entries(t).filter(([,r])=>typeof r=="boolean"?r:typeof r=="string"?!!r:typeof r=="number"?r:!1).map(([r,n])=>[Ae(r),`${n}`]);return Object.fromEntries(e)}var Xn=new Set(["plangs","tools","apps","libraries","subsystems","communities","learning"]);var Qn="/images/placeholder.png";function es({detail:t,onlyImg:e,class:r}){return a("div",{vocab:"https://schema.org/",typeof:t.schemaType,...qn({"vertex-key":t.key,"vertex-name":t.vertexName,"vertex-ranking":t.ranking}),class:d(q("vertexThumbn"),"group",!e&&"cursor-pointer",r),children:[a("meta",{property:"identifier",content:t.key}),!e&&a("div",{class:"truncate pb-0.5 text-center",children:a("a",{property:"name",class:"prefetch text-foreground underline group-hover:text-primary",href:t.href,children:t.name})}),a("div",{class:d("relative","aspect-square overflow-hidden","flex items-center justify-center","bg-thumbnails","ring-1 ring-primary/50","shadow-background shadow-lg group-hover:shadow-md group-hover:shadow-primary"),children:[a("img",{loading:"lazy",alt:t.name,"data-src":t.thumbUrl??"",src:e?t.thumbUrl??Qn:Qn,class:d(q("vertexThumbnImg"),"max-h-full max-w-full p-1"),width:128,height:128}),"ranking"in t&&t.ranking&&a("div",{title:`Languish Ranking: ${t.ranking}`,class:d("absolute","-bottom-1 right-0","p-1 text-primary text-xs","rounded opacity-50",ve,"hover:opacity-100"),children:t.ranking})]})]})}function rs({detail:t,open:e,page:r}){let n=U(null),s=Xn.has(r),i=Se(),o=()=>{let g=n.current?.querySelector("details");g&&i.update("vertex-detail-open",!g.open)};$(()=>{if(!n.current)return;n.current.querySelector("h2")?.scrollIntoView({behavior:"smooth",block:"end"});let g=n.current.querySelectorAll(`.${q("externalLink")}`);if(g.length!==0)for(let[x,R]of g.entries())R.classList.add("scale-0"),setTimeout(()=>R.classList.remove("scale-0"),50+(x+1)*50)});let l=t&&a("div",{class:"flex flex-row flex-nowrap items-center gap-2 align-middle",children:[_(t.urlHome,g=>g&&a($e,{href:g,icon:Ir})),_(t.urlLanguish,g=>g&&a($e,{href:g,icon:Wn,title:`#${t.ranking} on Languish`})),_(t.urlGithub,g=>g&&a($e,{href:g,icon:Bn})),_(t.urlWikipedia,g=>g&&a($e,{href:g,icon:Hn})),_(t.urlStackov,g=>g&&a($e,{href:g,icon:zn})),_(t.urlReddit,g=>g&&a($e,{href:g,icon:$n}))]}),p=a("header",{class:"flex flex-wrap",children:[a("h2",{class:d("m-0!","truncate"),children:t?a("a",{class:"prefetch pr-2",href:t.href,children:t.name}):"Information"}),a("div",{class:"flex-1"}),l]}),u=t?a("div",{class:d("hidden py-4 sm:block landscape-short:hidden"),children:[!s&&t.thumbUrl&&a(es,{detail:t,onlyImg:!0,class:"float-right m-1 ml-6 size-24"}),a("div",{class:"hyphens-auto text-justify",children:s?t.shortDesc:t.description})]}):a("p",{children:[a("strong",{class:"text-primary",children:"Click"})," a thumbnail for more info."]}),m=1,c=t&&t.relations.length>0&&a("details",{class:d(s&&"hidden sm:block landscape-short:hidden","overflow-hidden"),open:e,children:[a("summary",{class:"cursor-pointer pb-4 text-primary",...B(o),children:"Details"}),a("div",{class:d("flex flex-col"),children:[t.general.length>0&&a(ts,{title:"General",class:d(m++%2===0?"bg-primary/6":"bg-primary/12"),children:t.general.map(g=>a(Be,{title:g.title,children:g.kind==="text"?a("span",{children:g.value}):a("a",{href:g.href,class:d("inline-flex"),children:[a("span",{children:g.value}),a("span",{class:"scale-50",children:Ir})]})},g))}),t.relations.map(([g,x])=>a(ts,{title:g,class:d(m++%2===0?"bg-primary/6":"bg-primary/12"),children:x.map(R=>a(Be,{children:a("a",{href:R.href,children:R.name})},R.name))},g))]})]});return a("div",{ref:n,class:d(xe,d(Qe,"max-w-[unset]"),s&&"px-2 pt-1 sm:p-4",s&&"border-primary/50 landscape-narrow:border-t-1"),children:[p,u,c]})}function $e({href:t,icon:e,title:r}){return a("a",{...r?{title:r}:{},href:t,class:d(q("externalLink"),"inline-block aspect-square","transition-transform","p-1"),children:a("div",{class:d("inline-block",Mt),children:e})})}function ts({title:t,children:e,class:r}){return a("div",{class:d("hover:bg-hiliteb/10",r),children:[a("header",{class:"mb-2 p-2 text-foreground text-sm uppercase",children:t}),a("div",{class:"ml-2 flex flex-row flex-wrap",children:e})]},t)}function zr(t){let e=Wr(),r=Se();for(let n of z("vertexInfo")){let s=t?.detail,i=n.dataset.open==="true";s?(r.update("vertex-detail",s),r.update("vertex-detail-open",i)):(i=r.load("vertex-detail-open")??i??!0,s=r.load("vertex-detail")),me(a(rs,{detail:s,page:e,open:i}),n)}}function de(t,e,r=(s,i)=>s===i,n){for(let s of e){let i=t.find(o=>r(o,s));i?n?.(i,s):t.push(s)}}var Q=class t{array;constructor(e){this.array=Array.isArray(e)?e:e?[...e]:void 0}filter(e){return this.array?this.array.filter(e):[]}map(e){return new t(this.array?this.array.map(e):[])}reduce(e,r){return this.array?this.array.reduce(e,r):r}sort(e){return this.array?[...this.array].sort(e):[]}join(e){return this.array?this.array.join(e):""}includes(e){return this.array?this.array.includes(e):!1}some(e){return this.array?this.array.some(e):!1}find(e){return this.array?.find(e)}tap(e){if(this.array&&this.array.length>0)return e(this.array)}get(e){return this.array?this.array[e]:void 0}get isEmpty(){return this.array?this.array.length===0:!0}get size(){return this.array?this.array.length:0}get length(){return this.size}get existing(){return this.filter(e=>e!=null&&(typeof e!="string"||e.length>0))}get reverse(){return new t(this.array?[...this.array].reverse():void 0)}get first(){return this.array&&this.array.length>0?this.array[0]:void 0}get last(){return this.array&&this.array.length>0?this.array[this.array.length-1]:void 0}[Symbol.iterator](){return this.array?this.array[Symbol.iterator]():[].values()}};var $t=class{constructor(e){this.key=e}data={};merge(e){return Object.assign(this.data,e),this}clearData(){let e=this.data;for(let r in Object.keys(e))delete e[r];return this}get plainKey(){return this.key.replace(/^[a-z]+\+/,"")}get classifier(){let e=this.plainKey;return/^[a-z]/i.test(e)?e[0].toLowerCase():Aa}toJSON(){return this.data}toString(){return this.key}},Aa="-",G=class{constructor(e,r,n){this.name=e;this.kind=r;this.factory=n}map=new Map;set(e,r={}){let n=this.factory(e).merge(r);return this.map.set(e,n),n}get(e){return this.map.get(e)}has(e){return this.map.has(e)}delete(e){return this.map.delete(e)}clear(){this.map.clear()}get keys(){return this.map.keys()}get values(){return this.map.values()}get entries(){return this.map.entries()}toJSON(){return Object.fromEntries([...this.map].map(([e,r])=>[e,r.toJSON()]))}},f=class{constructor(e,r,n,s){this.fromSource=e;this.toSource=r;this.descDirect=n;this.descInverse=s}#e=new Map;#t=new Map;add(e,...r){let n=this.#e.get(e);n||this.#e.set(e,n=new Set);for(let s of r){n.add(s);let i=this.#t.get(s);i||this.#t.set(s,i=new Set),i.add(e)}return this}get(e,r){return[this.fromSource.get(e),this.toSource.get(r)]}addGet(e,r){return this.add(e,r).get(e,r)}delete(e,r){let n=this.#e.get(e)?.delete(r)??!1,s=this.#t.get(r)?.delete(e)??!1;return n||s}forward(e){return this.#e.get(e)??new Set}backward(e){return this.#t.get(e)??new Set}has(e,r){return this.#e.get(e)?.has(r)??!1}get entriesForward(){return[...this.#e].map(([e,r])=>[e,r])}get entriesBackward(){return[...this.#t].map(([e,r])=>[e,r])}get vertices(){let e=[];for(let[r,n]of this.entriesForward){let s=this.fromSource.get(r);for(let i of n)e.push([r,s,i,this.toSource.get(i)])}return e}get size(){let e=0;for(let r of this.#e.values())e+=r.size;return e}toJSON(){return Object.fromEntries(this.entriesForward.map(([e,r])=>[e,[...r]]))}},h=class{constructor(e,r){this.from=e;this.edges=r}get edgeDesc(){return this.edges.descDirect}get targetVertices(){return this.edges.toSource}add(...e){return this.edges.add(this.from.key,...e),this.from}maybeAdd(e){let r=e.filter(n=>this.edges.toSource.has(n));return this.add(...r)}remove(...e){for(let r of e)this.edges.delete(this.from.key,r);return this.from}has(e){return this.edges.has(this.from.key,e)}get keys(){return this.edges.forward(this.from.key)}get values(){return[...this.keys].map(e=>this.edges.toSource.get(e)).filter(e=>e)}get size(){return this.keys.size}toString(){return`RelFrom(${this.from}, ${this.edgeDesc})`}},y=class{constructor(e,r){this.to=e;this.edges=r}get edgeDesc(){return this.edges.descInverse}get targetVertices(){return this.edges.fromSource}add(...e){for(let r of e)this.edges.add(r,this.to.key);return this.to}maybeAdd(e){let r=e.filter(n=>this.edges.fromSource.has(n));return this.add(...r)}remove(...e){for(let r of e)this.edges.delete(r,this.to.key);return this.to}has(e){return this.edges.has(e,this.to.key)}get keys(){return this.edges.backward(this.to.key)}get values(){return[...this.keys].map(e=>this.edges.fromSource.get(e)).filter(e=>e)}get size(){return this.keys.size}toString(){return`RelTo(${this.to}, ${this.edgeDesc})`}};var ns=t=>t>=1940&&t<=2100,ss=t=>t>=1&&t<=12,Na=t=>t>=1&&t<=31;function as(t){if(!t||t.length<4||t.length>10)return;let[e,r,n]=t.split(/\D/,3),[s,i,o]=[Number.parseInt(e),Number.parseInt(r),Number.parseInt(n)];if(ns(s))return ss(i)?Na(o)?`${s}-${`${i}`.padStart(2,"0")}-${`${o}`.padStart(2,"0")}`:`${s}-${`${i}`.padStart(2,"0")}`:`${s}`}function Ur(t){if(!t||t.length<4||t.length>10)return;let e=Number.parseInt(t.split(/\D/,3)[0],10);if(ns(e))return e}function Yr(t){if(!t||t.length<4||t.length>10)return;let e=Number.parseInt(t.split(/\D/,3)[1],10);if(ss(e))return e}function is(t,e){return t===e?0:t?e?t.localeCompare(e):1:-1}function Zr(t,e){return t?t>=e:!1}function oe(t,e){let r=new Date;return e==="y"?r.setFullYear(r.getFullYear()-t):r.setMonth(r.getMonth()-t),`${r.getFullYear()}-${`${r.getMonth()+1}`.padStart(2,"0")}`}var jr=class{constructor(e){this.release=e}get version(){return this.release.version}get date(){return this.release.date}get year(){return Ur(this.release.date)}get month(){return Yr(this.release.date)}get yearMonth(){let{year:e,month:r}=this;return e&&r?`${r.toString().padStart(2,"0")}/${e}`:e}isRecent(e){return Zr(this.date,e)}compareDate(e){return is(this.date,e.date)}},we=class{constructor(e){this.vertex=e}get all(){return new Q(this.vertex.data.releases).map(e=>new jr(e))}get last(){let e=this.all;if(e.size!==0)return e.size===1?e.get(0):e.sort((r,n)=>n.compareDate(r))[0]}},Ht=class{constructor(e,r){this.key=e;this.vertex=r}get value(){return this.vertex.data[this.key]}get year(){return Ur(this.value)}get strYear(){return this.value?.slice(0,4)}get month(){return Yr(this.value)}isRecent(e){return Zr(this.value,e)}},Ve=class{constructor(e){this.vertex=e}get stars(){return this.vertex.data.githubStars??-1}get path(){return this.vertex.data.extGithubPath}get url(){return this.path?`https://github.com/${this.path}`:void 0}};var Ea={app:"SoftwareApplication",author:"Person",bundle:"Collection",community:"Organization",learning:"CreativeWork",library:"SoftwareLibrary",license:"CreativeWork",paradigm:"CreativeWork",plang:"ComputerLanguage",platform:"CreativeWork",post:"BlogPosting",subsystem:"SoftwareApplication",tag:"DefinedTerm",tool:"SoftwareApplication",typeSystem:"CreativeWork"},I=class extends $t{constructor(r,n){super(n);this.graph=r}get schemaType(){return Ea[this.vertexName]}get detail(){let r=[],n=this;for(let i of n.relations.values()){let o=i.values.filter(l=>l.key!==n.key);o.length!==0&&r.push([i.edgeDesc,o.map(({name:l,href:p})=>({name:l,href:p}))])}let s=[];n instanceof te&&(Ge(n.created.year,i=>i&&s.push({kind:"text",value:`Appeared ${n.created.year}`})),Ge(n.isPopular,i=>i&&s.push({kind:"text",value:"Popular",title:"Languish's Rank <= #25 or popular on Github."})),Ge(n.isTranspiler,i=>i&&s.push({kind:"text",value:"Transpiler",title:"a.k.a. Source-to-Source Compiler."})),Ge(n.releases.last,i=>i&&s.push({kind:"text",value:`Released ${i.yearMonth??i.version}`,title:"Last Release we know about."})),Ge([n.urlLanguish,n.ranking&&`#${n.ranking} on Languish`],([i,o])=>i&&o&&s.push({kind:"link",href:i,value:o,title:o})));for(let i of n.links??[])s.push({kind:"link",href:i.url,value:i.title??"Link"});return{description:n.description,href:n.href,key:n.key,name:n.name,ranking:n.ranking,shortDesc:n.shortDesc,thumbUrl:n.thumbUrl,urlGithub:n.urlGithub,urlHome:n.urlHome,urlReddit:n.urlReddit,urlStackov:n.urlStackov,urlWikipedia:n.urlWikipedia,urlLanguish:n.urlLanguish,vertexDesc:n.vertexDesc,vertexKind:n.vertexKind,vertexName:n.vertexName,schemaType:n.schemaType,general:s,relations:r}}get href(){return this.vertexName==="plang"?`/${this.plainKey}`:this.vertexName==="post"?`/blog/${this.plainKey}`:`/${this.vertexName.toLowerCase()}/${this.plainKey}`}get ranking(){}get name(){return this.data.name?this.data.name:this.plainKey}#e;get lcName(){return this.#e||(this.#e=this.name.toLowerCase()),this.#e}get created(){return new Ht("created",this)}get description(){return this.data.description||this.name}get shortDesc(){if(this.data.shortDesc)return this.data.shortDesc;let r=this.description;return r.length>100?`${r.slice(0,80)} ...`:r}get urlHome(){return this.data.extHomeURL}get urlGithub(){return"github"in this?this.github.url:void 0}get urlStackov(){return this.data.stackovTags?`https://stackoverflow.com/questions/tagged/${this.data.stackovTags.join("+")}`:void 0}get urlReddit(){return this.data.extRedditPath?`https://reddit.com/r/${this.data.extRedditPath}`:void 0}get urlWikipedia(){return this.data.extWikipediaPath?`https://en.wikipedia.org/wiki/${this.data.extWikipediaPath}`:void 0}get urlLanguish(){if(!(!(this instanceof te)||!this.data.languishRanking))return`https://tjpalmer.github.io/languish/#names=${encodeURIComponent(this.name.toLowerCase())}`}get links(){return new Q(this.data.links)}get images(){return new Q(this.data.images)}get keywords(){return new Q(this.data.keywords)}get keywordsRegexp(){let{keywords:r}=this.data;if(!r)return;let n=r.map(s=>s.replaceAll(/[- ]/g,"\\s*.?\\s*"));return new RegExp(`\\b(${n.join("|")})\\b`,"i")}get thumbUrl(){return(this.images.find(({kind:r})=>r==="logo")??this.images.first)?.url}addImages(r){return de(this.data.images??=[],r,(n,s)=>n.url===s.url),this}addKeywords(r){return de(this.data.keywords??=[],r),this}addLinks(r){return de(this.data.links??=[],r,(n,s)=>n.url===s.url),this}addStackovTags(r){return de(this.data.stackovTags??=[],r),this}merge(r){let{keywords:n,images:s,links:i,stackovTags:o,...l}=r;return s&&this.addImages(s),n&&this.addKeywords(n),i&&this.addLinks(i),o&&this.addStackovTags(o),super.merge(l)}};var He=class t{static relConfig(e,r){let n=t.vertexClass(e),{edgeName:s,direction:i}=n.relConfig[r];return{kind:"rel",edgeName:s,direction:i}}static propConfig(e,r){return{kind:"prop",vertexName:e,vertexProp:r}}static vertexClass(e){if(e==="app")return nt;if(e==="author")return st;if(e==="bundle")return at;if(e==="community")return it;if(e==="learning")return ot;if(e==="library")return lt;if(e==="license")return Pe;if(e==="paradigm")return ct;if(e==="plang")return te;if(e==="platform")return dt;if(e==="post")return ft;if(e==="subsystem")return mt;if(e==="tag")return pt;if(e==="tool")return ut;if(e==="typeSystem")return gt}static vertexKind=new Map([["app","app"],["author","author"],["bundle","bun"],["community","comm"],["learning","learn"],["library","lib"],["license","lic"],["paradigm","para"],["plang","pl"],["platform","plat"],["post","post"],["subsystem","sys"],["tag","tag"],["tool","tool"],["typeSystem","tsys"]]);static vertexNameByKind=new Map(Array.from(t.vertexKind.entries()).map(([e,r])=>[r,e]));getVertex(e){let r=e.split("+",2)[0],n=t.vertexNameByKind.get(r);if(n)return this.vertices[n]?.get(e)}app=new G("app","app",e=>new nt(this,e));author=new G("author","author",e=>new st(this,e));bundle=new G("bundle","bun",e=>new at(this,e));community=new G("community","comm",e=>new it(this,e));learning=new G("learning","learn",e=>new ot(this,e));library=new G("library","lib",e=>new lt(this,e));license=new G("license","lic",e=>new Pe(this,e));paradigm=new G("paradigm","para",e=>new ct(this,e));plang=new G("plang","pl",e=>new te(this,e));platform=new G("platform","plat",e=>new dt(this,e));post=new G("post","post",e=>new ft(this,e));subsystem=new G("subsystem","sys",e=>new mt(this,e));tag=new G("tag","tag",e=>new pt(this,e));tool=new G("tool","tool",e=>new ut(this,e));typeSystem=new G("typeSystem","tsys",e=>new gt(this,e));vertices={app:this.app,author:this.author,bundle:this.bundle,community:this.community,learning:this.learning,library:this.library,license:this.license,paradigm:this.paradigm,plang:this.plang,platform:this.platform,post:this.post,subsystem:this.subsystem,tag:this.tag,tool:this.tool,typeSystem:this.typeSystem};edges={appRelPlatforms:new f(this.app,this.platform,"Platforms","Apps"),appRelWrittenWith:new f(this.app,this.plang,"Plangs","Apps"),authorRelCommunites:new f(this.author,this.community,"Communites","Members"),bundleRelPlangs:new f(this.bundle,this.plang,"Plangs","Bundles"),bundleRelTools:new f(this.bundle,this.tool,"Tools","Bundles"),communityRelApps:new f(this.community,this.app,"Apps","Communities"),communityRelLibraries:new f(this.community,this.library,"Libraries","Communities"),communityRelPlangs:new f(this.community,this.plang,"Plangs","Communities"),communityRelSubsystems:new f(this.community,this.subsystem,"Subsystems","Communities"),communityRelTools:new f(this.community,this.tool,"Tools","Communities"),learningRelApps:new f(this.learning,this.app,"Apps","Learning Resources"),learningRelCommunities:new f(this.learning,this.community,"Communities","Learning Resources"),learningRelLibraries:new f(this.learning,this.library,"Libraries","Learning Resources"),learningRelPlangs:new f(this.learning,this.plang,"Plangs","Learning Resources"),learningRelSubsystems:new f(this.learning,this.subsystem,"Subsystems","Learning Resources"),learningRelTools:new f(this.learning,this.tool,"Tools","Learning Resources"),libraryRelPlangs:new f(this.library,this.plang,"Plangs","Libraries"),libraryRelPlatforms:new f(this.library,this.platform,"Platforms","Libraries"),libraryRelWrittenWith:new f(this.library,this.plang,"Written With","Used for Libraries"),licenseRelApps:new f(this.license,this.app,"Apps","Licenses"),licenseRelLibraries:new f(this.license,this.library,"Libraries","Licenses"),licenseRelPlangs:new f(this.license,this.plang,"Plangs","Licenses"),licenseRelSubsystems:new f(this.license,this.subsystem,"Subsystems","Licenses"),licenseRelTools:new f(this.license,this.tool,"Tools","Licenses"),plangRelCompilesTo:new f(this.plang,this.plang,"Compiles To","Target Of"),plangRelDialectOf:new f(this.plang,this.plang,"Dialect of","Dialects"),plangRelImplements:new f(this.plang,this.plang,"Implements","Implemented By"),plangRelInfluencedBy:new f(this.plang,this.plang,"Influenced By","Influenced"),plangRelParadigms:new f(this.plang,this.paradigm,"Paradigms","Plangs"),plangRelPlatforms:new f(this.plang,this.platform,"Platforms","Plangs"),plangRelTools:new f(this.plang,this.tool,"Tools","Plangs"),plangRelTypeSystems:new f(this.plang,this.typeSystem,"Type Systems","Plangs"),plangRelWrittenWith:new f(this.plang,this.plang,"Written With","Used to Write"),postRelApps:new f(this.post,this.app,"Apps","Posts"),postRelAuthors:new f(this.post,this.author,"Authors","Posts"),postRelCommunities:new f(this.post,this.community,"Communities","Posts"),postRelLearning:new f(this.post,this.learning,"Learning Resources","Posts"),postRelLibraries:new f(this.post,this.library,"Libraries","Posts"),postRelPlangs:new f(this.post,this.plang,"Plangs","Posts"),postRelSubsystems:new f(this.post,this.subsystem,"Subsystems","Posts"),postRelTools:new f(this.post,this.tool,"Tools","Posts"),subsystemRelPlatforms:new f(this.subsystem,this.platform,"Platforms","Subsystems"),subsystemRelWrittenWith:new f(this.subsystem,this.plang,"Plangs","Subsystems"),tagRelApps:new f(this.tag,this.app,"Apps tagged","Tags"),tagRelCommunities:new f(this.tag,this.community,"Communities","Tags"),tagRelLearning:new f(this.tag,this.learning,"Learning Resources","Tags"),tagRelLibraries:new f(this.tag,this.library,"Libraries","Tags"),tagRelPlangs:new f(this.tag,this.plang,"Plangs","Tags"),tagRelSubsystems:new f(this.tag,this.subsystem,"Subsystems","Tags"),tagRelTools:new f(this.tag,this.tool,"Tools","Tags"),toolRelPlatforms:new f(this.tool,this.platform,"Platforms","Tools"),toolRelWrittenWith:new f(this.tool,this.plang,"Implemented With","Tool Plang")};toJSON(){return{vertices:Object.fromEntries(Object.entries(this.vertices).map(([e,r])=>[e,r.toJSON()])),edges:Object.fromEntries(Object.entries(this.edges).map(([e,r])=>[e,r.toJSON()]))}}loadJSON(e){for(let[r,n]of Object.entries(e.vertices)){let s=this.vertices[r];for(let[i,o]of Object.entries(n))s.set(i,o)}for(let[r,n]of Object.entries(e.edges)){let s=this.edges[r];for(let[i,o]of Object.entries(n))s.add(i,...o)}return this}},zt=class t extends I{static vertexKind="app";static vertexName="app";static vertexDesc="Software Application";static relConfig={relCommunities:{edgeName:"communityRelApps",direction:"inverse",gen:!1},relLearning:{edgeName:"learningRelApps",direction:"inverse",gen:!1},relLicenses:{edgeName:"licenseRelApps",direction:"inverse",gen:!0},relPlatforms:{edgeName:"appRelPlatforms",direction:"direct",gen:!0},relPosts:{edgeName:"postRelApps",direction:"inverse",gen:!1},relTags:{edgeName:"tagRelApps",direction:"inverse",gen:!0},relWrittenWith:{edgeName:"appRelWrittenWith",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relCommunities(){return new y(this,this.graph.edges.communityRelApps)}get relLearning(){return new y(this,this.graph.edges.learningRelApps)}get relLicenses(){return new y(this,this.graph.edges.licenseRelApps)}get relPlatforms(){return new h(this,this.graph.edges.appRelPlatforms)}get relPosts(){return new y(this,this.graph.edges.postRelApps)}get relTags(){return new y(this,this.graph.edges.tagRelApps)}get relWrittenWith(){return new h(this,this.graph.edges.appRelWrittenWith)}},Ut=class t extends I{static vertexKind="author";static vertexName="author";static vertexDesc="Author";static relConfig={relCommunites:{edgeName:"authorRelCommunites",direction:"direct",gen:!0},relPosts:{edgeName:"postRelAuthors",direction:"inverse",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relCommunites(){return new h(this,this.graph.edges.authorRelCommunites)}get relPosts(){return new y(this,this.graph.edges.postRelAuthors)}},Yt=class t extends I{static vertexKind="bun";static vertexName="bundle";static vertexDesc="Bundle of Tools";static relConfig={relPlangs:{edgeName:"bundleRelPlangs",direction:"direct",gen:!1},relTools:{edgeName:"bundleRelTools",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relPlangs(){return new h(this,this.graph.edges.bundleRelPlangs)}get relTools(){return new h(this,this.graph.edges.bundleRelTools)}},Zt=class t extends I{static vertexKind="comm";static vertexName="community";static vertexDesc="Community";static relConfig={relApps:{edgeName:"communityRelApps",direction:"direct",gen:!0},relLearning:{edgeName:"learningRelCommunities",direction:"inverse",gen:!1},relLibraries:{edgeName:"communityRelLibraries",direction:"direct",gen:!0},relMembers:{edgeName:"authorRelCommunites",direction:"inverse",gen:!1},relPlangs:{edgeName:"communityRelPlangs",direction:"direct",gen:!0},relPosts:{edgeName:"postRelCommunities",direction:"inverse",gen:!1},relSubsystems:{edgeName:"communityRelSubsystems",direction:"direct",gen:!0},relTags:{edgeName:"tagRelCommunities",direction:"inverse",gen:!0},relTools:{edgeName:"communityRelTools",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new h(this,this.graph.edges.communityRelApps)}get relLearning(){return new y(this,this.graph.edges.learningRelCommunities)}get relLibraries(){return new h(this,this.graph.edges.communityRelLibraries)}get relMembers(){return new y(this,this.graph.edges.authorRelCommunites)}get relPlangs(){return new h(this,this.graph.edges.communityRelPlangs)}get relPosts(){return new y(this,this.graph.edges.postRelCommunities)}get relSubsystems(){return new h(this,this.graph.edges.communityRelSubsystems)}get relTags(){return new y(this,this.graph.edges.tagRelCommunities)}get relTools(){return new h(this,this.graph.edges.communityRelTools)}},jt=class t extends I{static vertexKind="learn";static vertexName="learning";static vertexDesc="Learning Resource";static relConfig={relApps:{edgeName:"learningRelApps",direction:"direct",gen:!0},relCommunities:{edgeName:"learningRelCommunities",direction:"direct",gen:!0},relLibraries:{edgeName:"learningRelLibraries",direction:"direct",gen:!0},relPlangs:{edgeName:"learningRelPlangs",direction:"direct",gen:!0},relPosts:{edgeName:"postRelLearning",direction:"inverse",gen:!1},relSubsystems:{edgeName:"learningRelSubsystems",direction:"direct",gen:!0},relTags:{edgeName:"tagRelLearning",direction:"inverse",gen:!0},relTools:{edgeName:"learningRelTools",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new h(this,this.graph.edges.learningRelApps)}get relCommunities(){return new h(this,this.graph.edges.learningRelCommunities)}get relLibraries(){return new h(this,this.graph.edges.learningRelLibraries)}get relPlangs(){return new h(this,this.graph.edges.learningRelPlangs)}get relPosts(){return new y(this,this.graph.edges.postRelLearning)}get relSubsystems(){return new h(this,this.graph.edges.learningRelSubsystems)}get relTags(){return new y(this,this.graph.edges.tagRelLearning)}get relTools(){return new h(this,this.graph.edges.learningRelTools)}},Jt=class t extends I{static vertexKind="lib";static vertexName="library";static vertexDesc="Software Library";static relConfig={relCommunities:{edgeName:"communityRelLibraries",direction:"inverse",gen:!1},relLearning:{edgeName:"learningRelLibraries",direction:"inverse",gen:!1},relLicenses:{edgeName:"licenseRelLibraries",direction:"inverse",gen:!0},relPlangs:{edgeName:"libraryRelPlangs",direction:"direct",gen:!0},relPlatforms:{edgeName:"libraryRelPlatforms",direction:"direct",gen:!0},relPosts:{edgeName:"postRelLibraries",direction:"inverse",gen:!1},relTags:{edgeName:"tagRelLibraries",direction:"inverse",gen:!0},relWrittenWith:{edgeName:"libraryRelWrittenWith",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relCommunities(){return new y(this,this.graph.edges.communityRelLibraries)}get relLearning(){return new y(this,this.graph.edges.learningRelLibraries)}get relLicenses(){return new y(this,this.graph.edges.licenseRelLibraries)}get relPlangs(){return new h(this,this.graph.edges.libraryRelPlangs)}get relPlatforms(){return new h(this,this.graph.edges.libraryRelPlatforms)}get relPosts(){return new y(this,this.graph.edges.postRelLibraries)}get relTags(){return new y(this,this.graph.edges.tagRelLibraries)}get relWrittenWith(){return new h(this,this.graph.edges.libraryRelWrittenWith)}},qt=class t extends I{static vertexKind="lic";static vertexName="license";static vertexDesc="Software License";static relConfig={relApps:{edgeName:"licenseRelApps",direction:"direct",gen:!1},relLibraries:{edgeName:"licenseRelLibraries",direction:"direct",gen:!1},relPlangs:{edgeName:"licenseRelPlangs",direction:"direct",gen:!1},relSubsystems:{edgeName:"licenseRelSubsystems",direction:"direct",gen:!1},relTools:{edgeName:"licenseRelTools",direction:"direct",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new h(this,this.graph.edges.licenseRelApps)}get relLibraries(){return new h(this,this.graph.edges.licenseRelLibraries)}get relPlangs(){return new h(this,this.graph.edges.licenseRelPlangs)}get relSubsystems(){return new h(this,this.graph.edges.licenseRelSubsystems)}get relTools(){return new h(this,this.graph.edges.licenseRelTools)}},Xt=class t extends I{static vertexKind="para";static vertexName="paradigm";static vertexDesc="Programming Language Paradigm";static relConfig={relPlangs:{edgeName:"plangRelParadigms",direction:"inverse",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relPlangs(){return new y(this,this.graph.edges.plangRelParadigms)}},Qt=class t extends I{static vertexKind="pl";static vertexName="plang";static vertexDesc="Programming Language";static relConfig={relApps:{edgeName:"appRelWrittenWith",direction:"inverse",gen:!1},relBundles:{edgeName:"bundleRelPlangs",direction:"inverse",gen:!1},relCommunities:{edgeName:"communityRelPlangs",direction:"inverse",gen:!1},relCompilesTo:{edgeName:"plangRelCompilesTo",direction:"direct",gen:!0},relDialectOf:{edgeName:"plangRelDialectOf",direction:"direct",gen:!0},relDialects:{edgeName:"plangRelDialectOf",direction:"inverse",gen:!1},relImplementedBy:{edgeName:"plangRelImplements",direction:"inverse",gen:!1},relImplements:{edgeName:"plangRelImplements",direction:"direct",gen:!0},relInfluenced:{edgeName:"plangRelInfluencedBy",direction:"inverse",gen:!1},relInfluencedBy:{edgeName:"plangRelInfluencedBy",direction:"direct",gen:!0},relLearning:{edgeName:"learningRelPlangs",direction:"inverse",gen:!1},relLibraries:{edgeName:"libraryRelPlangs",direction:"inverse",gen:!1},relLicenses:{edgeName:"licenseRelPlangs",direction:"inverse",gen:!0},relParadigms:{edgeName:"plangRelParadigms",direction:"direct",gen:!0},relPlatforms:{edgeName:"plangRelPlatforms",direction:"direct",gen:!0},relPosts:{edgeName:"postRelPlangs",direction:"inverse",gen:!1},relSubsystems:{edgeName:"subsystemRelWrittenWith",direction:"inverse",gen:!1},relTags:{edgeName:"tagRelPlangs",direction:"inverse",gen:!0},relTargetOf:{edgeName:"plangRelCompilesTo",direction:"inverse",gen:!1},relTools:{edgeName:"plangRelTools",direction:"direct",gen:!1},relToolsUsing:{edgeName:"toolRelWrittenWith",direction:"inverse",gen:!1},relTypeSystems:{edgeName:"plangRelTypeSystems",direction:"direct",gen:!0},relUsedInLibrary:{edgeName:"libraryRelWrittenWith",direction:"inverse",gen:!1},relUsedToWrite:{edgeName:"plangRelWrittenWith",direction:"inverse",gen:!1},relWrittenWith:{edgeName:"plangRelWrittenWith",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new y(this,this.graph.edges.appRelWrittenWith)}get relBundles(){return new y(this,this.graph.edges.bundleRelPlangs)}get relCommunities(){return new y(this,this.graph.edges.communityRelPlangs)}get relCompilesTo(){return new h(this,this.graph.edges.plangRelCompilesTo)}get relDialectOf(){return new h(this,this.graph.edges.plangRelDialectOf)}get relDialects(){return new y(this,this.graph.edges.plangRelDialectOf)}get relImplementedBy(){return new y(this,this.graph.edges.plangRelImplements)}get relImplements(){return new h(this,this.graph.edges.plangRelImplements)}get relInfluenced(){return new y(this,this.graph.edges.plangRelInfluencedBy)}get relInfluencedBy(){return new h(this,this.graph.edges.plangRelInfluencedBy)}get relLearning(){return new y(this,this.graph.edges.learningRelPlangs)}get relLibraries(){return new y(this,this.graph.edges.libraryRelPlangs)}get relLicenses(){return new y(this,this.graph.edges.licenseRelPlangs)}get relParadigms(){return new h(this,this.graph.edges.plangRelParadigms)}get relPlatforms(){return new h(this,this.graph.edges.plangRelPlatforms)}get relPosts(){return new y(this,this.graph.edges.postRelPlangs)}get relSubsystems(){return new y(this,this.graph.edges.subsystemRelWrittenWith)}get relTags(){return new y(this,this.graph.edges.tagRelPlangs)}get relTargetOf(){return new y(this,this.graph.edges.plangRelCompilesTo)}get relTools(){return new h(this,this.graph.edges.plangRelTools)}get relToolsUsing(){return new y(this,this.graph.edges.toolRelWrittenWith)}get relTypeSystems(){return new h(this,this.graph.edges.plangRelTypeSystems)}get relUsedInLibrary(){return new y(this,this.graph.edges.libraryRelWrittenWith)}get relUsedToWrite(){return new y(this,this.graph.edges.plangRelWrittenWith)}get relWrittenWith(){return new h(this,this.graph.edges.plangRelWrittenWith)}},er=class t extends I{static vertexKind="plat";static vertexName="platform";static vertexDesc="Platform where Software runs";static relConfig={relApps:{edgeName:"appRelPlatforms",direction:"inverse",gen:!1},relLibraries:{edgeName:"libraryRelPlatforms",direction:"inverse",gen:!1},relPlangs:{edgeName:"plangRelPlatforms",direction:"inverse",gen:!1},relSubsystems:{edgeName:"subsystemRelPlatforms",direction:"inverse",gen:!1},relTools:{edgeName:"toolRelPlatforms",direction:"inverse",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new y(this,this.graph.edges.appRelPlatforms)}get relLibraries(){return new y(this,this.graph.edges.libraryRelPlatforms)}get relPlangs(){return new y(this,this.graph.edges.plangRelPlatforms)}get relSubsystems(){return new y(this,this.graph.edges.subsystemRelPlatforms)}get relTools(){return new y(this,this.graph.edges.toolRelPlatforms)}},tr=class t extends I{static vertexKind="post";static vertexName="post";static vertexDesc="Blog Post";static relConfig={relApps:{edgeName:"postRelApps",direction:"direct",gen:!1},relAuthors:{edgeName:"postRelAuthors",direction:"direct",gen:!1},relCommunities:{edgeName:"postRelCommunities",direction:"direct",gen:!1},relLearning:{edgeName:"postRelLearning",direction:"direct",gen:!1},relLibraries:{edgeName:"postRelLibraries",direction:"direct",gen:!1},relPlangs:{edgeName:"postRelPlangs",direction:"direct",gen:!1},relSubsystems:{edgeName:"postRelSubsystems",direction:"direct",gen:!1},relTools:{edgeName:"postRelTools",direction:"direct",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new h(this,this.graph.edges.postRelApps)}get relAuthors(){return new h(this,this.graph.edges.postRelAuthors)}get relCommunities(){return new h(this,this.graph.edges.postRelCommunities)}get relLearning(){return new h(this,this.graph.edges.postRelLearning)}get relLibraries(){return new h(this,this.graph.edges.postRelLibraries)}get relPlangs(){return new h(this,this.graph.edges.postRelPlangs)}get relSubsystems(){return new h(this,this.graph.edges.postRelSubsystems)}get relTools(){return new h(this,this.graph.edges.postRelTools)}},rr=class t extends I{static vertexKind="sys";static vertexName="subsystem";static vertexDesc="Subsystem";static relConfig={relCommunities:{edgeName:"communityRelSubsystems",direction:"inverse",gen:!1},relLearning:{edgeName:"learningRelSubsystems",direction:"inverse",gen:!1},relLicenses:{edgeName:"licenseRelSubsystems",direction:"inverse",gen:!0},relPlatforms:{edgeName:"subsystemRelPlatforms",direction:"direct",gen:!0},relPosts:{edgeName:"postRelSubsystems",direction:"inverse",gen:!1},relTags:{edgeName:"tagRelSubsystems",direction:"inverse",gen:!0},relWrittenWith:{edgeName:"subsystemRelWrittenWith",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relCommunities(){return new y(this,this.graph.edges.communityRelSubsystems)}get relLearning(){return new y(this,this.graph.edges.learningRelSubsystems)}get relLicenses(){return new y(this,this.graph.edges.licenseRelSubsystems)}get relPlatforms(){return new h(this,this.graph.edges.subsystemRelPlatforms)}get relPosts(){return new y(this,this.graph.edges.postRelSubsystems)}get relTags(){return new y(this,this.graph.edges.tagRelSubsystems)}get relWrittenWith(){return new h(this,this.graph.edges.subsystemRelWrittenWith)}},nr=class t extends I{static vertexKind="tag";static vertexName="tag";static vertexDesc="Tag";static relConfig={relApps:{edgeName:"tagRelApps",direction:"direct",gen:!1},relCommunities:{edgeName:"tagRelCommunities",direction:"direct",gen:!1},relLearning:{edgeName:"tagRelLearning",direction:"direct",gen:!1},relLibraries:{edgeName:"tagRelLibraries",direction:"direct",gen:!1},relPlangs:{edgeName:"tagRelPlangs",direction:"direct",gen:!1},relSubsystems:{edgeName:"tagRelSubsystems",direction:"direct",gen:!1},relTools:{edgeName:"tagRelTools",direction:"direct",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relApps(){return new h(this,this.graph.edges.tagRelApps)}get relCommunities(){return new h(this,this.graph.edges.tagRelCommunities)}get relLearning(){return new h(this,this.graph.edges.tagRelLearning)}get relLibraries(){return new h(this,this.graph.edges.tagRelLibraries)}get relPlangs(){return new h(this,this.graph.edges.tagRelPlangs)}get relSubsystems(){return new h(this,this.graph.edges.tagRelSubsystems)}get relTools(){return new h(this,this.graph.edges.tagRelTools)}},sr=class t extends I{static vertexKind="tool";static vertexName="tool";static vertexDesc="Programming Tool";static relConfig={relBundles:{edgeName:"bundleRelTools",direction:"inverse",gen:!1},relCommunities:{edgeName:"communityRelTools",direction:"inverse",gen:!1},relLearning:{edgeName:"learningRelTools",direction:"inverse",gen:!1},relLicenses:{edgeName:"licenseRelTools",direction:"inverse",gen:!0},relPlangs:{edgeName:"plangRelTools",direction:"inverse",gen:!0},relPlatforms:{edgeName:"toolRelPlatforms",direction:"direct",gen:!0},relPosts:{edgeName:"postRelTools",direction:"inverse",gen:!1},relTags:{edgeName:"tagRelTools",direction:"inverse",gen:!0},relWrittenWith:{edgeName:"toolRelWrittenWith",direction:"direct",gen:!0}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relBundles(){return new y(this,this.graph.edges.bundleRelTools)}get relCommunities(){return new y(this,this.graph.edges.communityRelTools)}get relLearning(){return new y(this,this.graph.edges.learningRelTools)}get relLicenses(){return new y(this,this.graph.edges.licenseRelTools)}get relPlangs(){return new y(this,this.graph.edges.plangRelTools)}get relPlatforms(){return new h(this,this.graph.edges.toolRelPlatforms)}get relPosts(){return new y(this,this.graph.edges.postRelTools)}get relTags(){return new y(this,this.graph.edges.tagRelTools)}get relWrittenWith(){return new h(this,this.graph.edges.toolRelWrittenWith)}},ar=class t extends I{static vertexKind="tsys";static vertexName="typeSystem";static vertexDesc="Type System";static relConfig={relPlangs:{edgeName:"plangRelTypeSystems",direction:"inverse",gen:!1}};vertexKind=t.vertexKind;vertexDesc=t.vertexDesc;vertexName=t.vertexName;relConfig=t.relConfig;get relations(){return new Map(Object.keys(t.relConfig).map(e=>[e,this[e]]))}get relPlangs(){return new y(this,this.graph.edges.plangRelTypeSystems)}};var b=He.relConfig,Z=He.propConfig,ze=class extends He{materialize(){for(let e of this.bundle.values)for(let r of e.relTools.values)e.relPlangs.add(...r.relPlangs.keys);for(let e of this.plang.values)!e.isTranspiler&&e.relCompilesTo.size>0&&(e.data.isTranspiler=!0);return this}},nt=class extends zt{get github(){return new Ve(this)}get releases(){return new we(this)}},st=class extends Ut{},at=class extends Yt{},it=class extends Zt{},ot=class extends jt{},lt=class extends Jt{get github(){return new Ve(this)}get releases(){return new we(this)}},Pe=class extends qt{get spdx(){return this.data.spdx}get isFSFLibre(){return this.data.isFSFLibre===!0}get isOSIApproved(){return this.data.isOSIApproved===!0}},ct=class extends Xt{},te=class extends Qt{addExtensions(e){return de(this.data.extensions??=[],e),this}addFilenames(e){return de(this.data.filenames??=[],e),this}addReleases(e){return de(this.data.releases??=[],e,(r,n)=>r.version===n.version),this}merge(e){let{extensions:r,filenames:n,releases:s,...i}=e;return r&&this.addExtensions(r),n&&this.addFilenames(n),s&&this.addReleases(s),super.merge(i)}get extensions(){return new Q(this.data.extensions)}get filenames(){return new Q(this.data.filenames)}get github(){return new Ve(this)}get isPopular(){let{githubPopular:e,languishRanking:r}=this.data;return!!e||typeof r=="number"&&r<=25}get isTranspiler(){return this.data.isTranspiler===!0}get ranking(){return this.data.languishRanking}get releases(){return new we(this)}get stackovTags(){return new Q(this.data.stackovTags)}family(e={compilesTo:!0,dialectOf:!0,implements:!0}){let r=new Set([]);if(e.compilesTo)for(let n of this.relCompilesTo.values)r.add(n);if(e.dialectOf)for(let n of this.relDialectOf.values)r.add(n);if(e.implements)for(let n of this.relImplements.values)r.add(n);return r}},dt=class extends er{},pt=class extends nr{},ut=class extends sr{get github(){return new Ve(this)}get releases(){return new we(this)}},gt=class extends ar{},mt=class extends rr{get github(){return new Ve(this)}get releases(){return new we(this)}},ft=class extends tr{set path(e){this.data.path=e}get author(){return this.data.author}get date(){return this.data.date}get path(){return this.data.path}get title(){return this.name}};function ht(t){if(!t)return"Cannot be empty."}function os(t){if(!as(t??""))return"Invalid date format. Use YYYY-MM-DD."}function yt(t,e){if(!t)return;if(!t.split(",").every(n=>e.test(n)))return`Invalid format. Should match RegExp: ${e.source}`}function ls(t){let e;try{e=new URL(`${t??""}`)}catch{}if(!e||!e.hostname||!e.protocol)return"Invalid URL format."}function ir(t,e){if(t&&!e.test(t||""))return`Invalid format. Should match RegExp: ${e.source}`}function cs(t,e){if(!t)return;let r=Number.parseInt(`${t??""}`);if(Number.isNaN(r)||!e(r))return"Invalid number."}var or=/[a-zA-Z0-9\-\_]+/,Ma=/^\.[a-zA-Z0-9\-\_]+/,Ga=/[a-zA-Z0-9\-\_]+\/[a-zA-Z0-9\-\_]+/,Ia=/[a-zA-Z0-9\_\(\)\-]+$/,lr=class t extends Y{static create(e){return new t({vertex:e,fields:t.fields(e),values:t.values(e)})}static fields(e){let r={name:{kind:"string",label:"Name",validator:ht,saver:n=>e.data.name=n},description:{kind:"text",label:"Description",validator:ht,saver:n=>e.data.description=n},shortDesc:{kind:"text",label:"Short Description",validator:ht,saver:n=>e.data.shortDesc=n},created:{kind:"string",label:"Created",validator:os,saver:n=>e.data.created=n},keywords:{kind:"string",label:"Keywords",desc:"Comma-separated list of keywords.",validator:n=>yt(n,or),saver:n=>n&&e.addKeywords(n.split(","))},urlHome:{kind:"string",label:"Home URL",desc:"URL including protocol (http, https).",validator:ls,saver:n=>e.data.extHomeURL=n},extRedditPath:{kind:"string",label:"Reddit Path",desc:"Path to subreddit. Example: Python for https://www.reddit.com/r/Python/",validator:n=>ir(n,or),saver:n=>e.data.extRedditPath=n},extWikipediaPath:{kind:"string",label:"Wikipedia Path",desc:"Path to wikipedia. Example: Python_(programming_language) for https://en.wikipedia.org/wiki/Python_(programming_language)",validator:n=>ir(n,Ia),saver:n=>e.data.extWikipediaPath=n},stackovTags:{kind:"string",label:"Stack Overflow Tags",desc:"Comma-separated list of tags.",validator:n=>yt(n,or),saver:n=>n&&e.addStackovTags(n.split(","))}};return e instanceof te&&(r.extensions={kind:"string",label:"Extensions",desc:"Comma-separated list of extensions. Example: .py,.pyc",validator:n=>yt(n,Ma),saver:n=>n&&e.addExtensions(n.split(","))},r.filenames={kind:"string",label:"Filenames",desc:"Comma-separated list of files associated. Example: Makefile",validator:n=>yt(n,or),saver:n=>n&&e.addFilenames(n.split(","))},r.isTranspiler={kind:"bool",label:"Is Transpiler",desc:"Compiles to any other language.",validator:()=>{},saver:n=>e.data.isTranspiler=n}),e instanceof Pe&&(r.spdx={kind:"string",label:"SPDX",validator:ht,saver:n=>e.data.spdx=n},r.isFSFLibre={kind:"bool",label:"FSF Libre?",validator:()=>{},saver:n=>e.data.isFSFLibre=n},r.isOSIApproved={kind:"bool",label:"OSI Approved?",validator:()=>{},saver:n=>e.data.isOSIApproved=n}),"github"in e&&(r.extGithubPath={kind:"string",label:"Github Path",desc:"Example: EmmanuelOga/plangs2 for github.com/emmanueloga/plangs2",validator:n=>ir(n,Ga),saver:n=>e.data.extGithubPath=n},r.githubStars={kind:"string",label:"Github Stars",validator:n=>cs(n,s=>s>0),saver:n=>e.data.githubStars=Number.parseInt(n)}),r}static values(e){let r={description:e.description,name:e.name,shortDesc:e.data.shortDesc,created:e.created.value,keywords:e.keywords.join(","),urlHome:e.urlHome,extRedditPath:e.data.extRedditPath,extWikipediaPath:e.data.extWikipediaPath,stackovTags:e.data.stackovTags?.join(",")};return e instanceof te&&(r.extensions=e.extensions.join(","),r.filenames=e.filenames.join(","),r.isTranspiler=e.isTranspiler),e instanceof Pe&&(r.spdx=e.spdx,r.isFSFLibre=e.isFSFLibre,r.isOSIApproved=e.isOSIApproved),"github"in e&&(r.extGithubPath=e.data.extGithubPath,r.githubStars=e.data.githubStars),r}get vertex(){return this.data.vertex}get values(){return this.data.values}get fields(){return this.data.fields}get status(){return this.data.status}set status(e){this.data.status=e,this.dispatch()}doUpdate(e,r){this.values[e]=r,this.dispatch()}doReload(){this.data.values=t.values(this.data.vertex),this.dispatch()}doSave(){let e=[],r=0;for(let[s,i]of Object.entries(this.values)){let{validator:o,saver:l}=this.fields[s];o?.(i)?e.push(s):(l?.(i),r++)}r>0&&Te(this.vertex.graph.toJSON());let n=[`${new Date().toLocaleTimeString()} update: saved ${r} fields.`];e.length&&n.push(`Fields with errors: ${e.join(", ")}.`),this.status=n.join(" "),this.dispatch()}validate(e){return this.fields[e]?.validator?.(this.values[e])}};function ds({vertex:t}){let e=F(()=>lr.create(t));return a("div",{class:d("flex flex-col gap-4 justify-self-center","min-w-[50%] max-w-[160ch]","bg-secondary/25"),children:[a("header",{class:d("px-4 py-2","flex flex-row gap-4","justify-end","bg-secondary/50","text-center text-xl"),children:[H({label:"Reload",onClick:()=>e.doReload()}),H({label:"Save",onClick:()=>e.doSave()})]}),a("div",{class:"text-center",children:e.status}),a("div",{class:"overflow-hidden overflow-y-auto",children:[...Object.entries(e.fields)].map(([r,n])=>Oa(e,r,n))})]})}function Oa(t,e,r){let{label:n,kind:s,desc:i,validator:o}=r,l=`field-${n}`,p=t.values[e],u=o(p);return a("div",{class:"px-4",children:[a("label",{class:"block",for:l,children:n}),i&&a("div",{class:"text-foreground/80 text-sm italic",children:i}),a("div",{class:"py-2",children:[s==="bool"&&a("input",{id:l,type:"checkbox",checked:!!p,onInput:({target:m})=>t.doUpdate(e,m.checked)}),s==="string"&&a("input",{id:l,type:"text",class:d(W,"w-full"),value:p??"",onInput:({target:m})=>t.doUpdate(e,m.value)}),s==="text"&&a("textarea",{id:l,value:p?`${p}`:"",class:d(W,"text-xl","w-full","min-h-[10rem]"),style:"font-family: monospace;",onInput:({target:m})=>t.doUpdate(e,m.value)})]}),a("div",{class:d("mb-4 p-1","text-gray-800",u&&"bg-linear-to-b from-red-200 to-red-300"),children:u??""})]})}var cr=class extends Y{doSetCurrentKind(e){this.data.currentKind=e,this.dispatch()}doSetCurrentVertex(e){if(this.data.currentVertex=e,this.currentRel?.[0]){let[r]=this.currentRel,n=e.relations;if(n.has(r)){let s=n.get(r);this.data.currentRel=[r,s]}else this.data.currentRel=void 0}this.dispatch()}doSetFilter(e){this.data.filter=e,this.dispatch()}doSetTab(e){this.data.tab=e,this.dispatch()}doSetRel(e){this.data.currentRel=e,this.dispatch()}get currentKind(){return this.data.currentKind}get currentVertices(){let e=[...this.data.pg.vertices[this.data.currentKind].values];return this.data.filter?e.filter(r=>r.key.includes(this.data.filter)):e}get currentVertex(){return this.data.currentVertex}get currentRel(){return this.data.currentRel}get filter(){return this.data.filter}get tab(){return this.data.tab}get vertexNames(){return Object.keys(this.data.pg.vertices).filter(e=>e!=="post")}};function ps({pg:t}){let e=U(null),r=F(()=>new cr({pg:t,currentKind:"plang",filter:"",tab:"relations"}));return $(()=>{e.current?.querySelectorAll("button.current")[1]?.scrollIntoView({block:"nearest"})}),a("div",{ref:e,class:d("p-2","flex-1","flex flex-row gap-8","overflow-hidden"),children:[a("div",{class:d("w-[11.5rem] pr-2","flex flex-col gap-4"),children:[a("select",{class:d(W,"py-0 text-black/85"),onChange:n=>r.doSetCurrentKind(n.currentTarget.value),children:r.vertexNames.map(n=>a("option",{value:n,selected:r.currentKind===n,children:n},n))}),a("input",{"aria-label":"Filter Key",placeholder:"Filter",value:r.filter,onInput:n=>r.doSetFilter(n.target.value),class:d(W,"px-2 py-1")}),a("div",{class:d("w-[11.5rem] pr-2","flex flex-col gap-4",xe),children:r.currentVertices.map(n=>H({label:n.key,isCurrent:()=>r.currentVertex?.key===n.key,onClick:()=>r.doSetCurrentVertex(n)}))})]}),r.currentVertex?a("div",{class:d("flex-1","flex flex-col gap-4","bg-secondary/10","overflow-hidden"),children:[a("header",{class:"border-1 border-primary bg-secondary/75 py-2 text-center text-xl",children:[r.currentVertex.vertexName,": ",r.currentVertex.key,": ",r.currentVertex.name]}),a("div",{class:"flex flex-row gap-4",children:[a(H,{label:"FORM",isCurrent:()=>r.tab==="form",onClick:()=>r.doSetTab("form")}),a(H,{label:"RELATIONS",isCurrent:()=>r.tab==="relations",onClick:()=>r.doSetTab("relations")}),a(H,{label:"JSON",isCurrent:()=>r.tab==="json",onClick:()=>r.doSetTab("json")})]}),a("div",{class:"flex flex-1 justify-center overflow-hidden",children:r.tab==="form"?a(ds,{vertex:r.currentVertex},r.currentVertex.key):r.tab==="relations"?a(Ba,{state:r},r.currentVertex.key):a(Wa,{vertex:r.currentVertex},r.currentVertex.key)})]}):a("div",{class:"flex-1 bg-secondary/25 p-4",children:"Select a vertex to edit."})]})}function H({label:t,isCurrent:e,onClick:r,class:n}){return a("button",{type:"button",class:d("inline-flex items-start align-middle","cursor-pointer","hover:bg-hiliteb hover:text-hilitef","m-0.5 ring-1 ring-primary",e?.()&&"current bg-secondary",n),onClick:r,children:a("span",{class:d("mx-1 px-1 py-0.5","inline-block w-full","truncate"),children:t})})}function Wa({vertex:t}){let e=()=>JSON.stringify(t.data,null,2),r=U(null),[n,s]=ye(""),i=()=>{r.current&&(r.current.value=e()),s(`Reloadad at ${new Date().toLocaleTimeString()}`)},o=()=>{try{let l=JSON.parse(r.current?.value??"");Object.assign(t.clearData().data,l),Te(t.graph.toJSON()),s(`Saved at ${new Date().toLocaleTimeString()}`)}catch(l){s(`Error: ${l}`)}};return $(()=>{r.current&&(r.current.value=e())},[]),a("div",{class:d("w-full","flex flex-col gap-4 justify-self-center","bg-secondary/25"),children:[a("header",{class:d("px-4 py-2","flex flex-row gap-4","justify-end","bg-secondary/50","text-center text-xl"),children:[a(H,{label:"Reload",onClick:i}),a(H,{label:"Save",onClick:o})]}),a("div",{class:"text-center",children:n}),a("textarea",{ref:r,class:d(W,"text-xl","flex-1 overflow-hidden overflow-y-auto"),style:"font-family: monospace;"})]})}function Ba({state:t}){let e=t.currentVertex;return a("div",{class:"flex flex-1 flex-row gap-4 overflow-hidden",children:[a("div",{class:d("flex flex-col gap-4",xe,"pr-4","max-w-[10rem]"),children:[...e.relations.entries()].filter(([r])=>r!=="relPosts"&&r!=="relAuthors").map(([r,n])=>a(H,{label:n.edgeDesc,isCurrent:()=>t.currentRel?.[0]===r,onClick:()=>t.doSetRel([r,n])},`${e.key}-${r}`))}),t.currentRel?a($a,{state:t,vertex:e,relKey:t.currentRel[0],rel:t.currentRel[1]},`${e.key}-${t.currentRel[1]}`):a("div",{class:"p-4",children:"Select a Relation."})]},e.key)}function $a({state:t,vertex:e,relKey:r,rel:n}){let s=[],i=[];for(let p of n.targetVertices.values)n.has(p.key)?s.push(p):i.push(p);function o(p){n.remove(p.key),Te(e.graph.toJSON()),t.dispatch()}function l(p){n.add(p.key),Te(e.graph.toJSON()),t.dispatch()}return a("div",{class:d("p-4","flex-1","flex flex-col gap-4","bg-primary/10","overflow-hidden overflow-y-scroll"),children:[a("header",{class:"text-2xl",children:[e.name," ",n.edgeDesc]}),a("div",{class:"flex flex-row flex-wrap gap-1",children:[a("h2",{class:"w-full pb-2",children:"Connected"}),s.map(p=>a(Be,{class:"group cursor-pointer hover:bg-primary/25",children:a("button",{type:"button",class:"inline-flex items-center gap-1",onClick:()=>o(p),children:[p.name,a("div",{class:d("inline-block","group-hover:text-hiliteb"),children:Gt})]})},`${e.key}-${r}-${p.key}`))]}),a("div",{class:"flex flex-row flex-wrap gap-1",children:[a("h2",{class:"w-full pb-2",children:"Unconnected"}),i.map(p=>a(Be,{class:"group hover:bg-primary/25",children:a("button",{type:"button",class:"inline-flex cursor-pointer items-center gap-1",onClick:()=>l(p),children:[p.name,a("div",{class:d("inline-block","group-hover:text-hiliteb"),children:En})]})},`${e.key}-${r}-${p.key}`))]})]})}function us({pg:t}){let[e,r]=ye("status"),n=C("_any_page_"),s=n.load("local-edits");s||(s=t.toJSON(),n.update("local-edits",s));let i=new ze().loadJSON(s);return a("div",{class:d("p-4","flex-1","flex flex-col gap-4","overflow-hidden"),children:[a("div",{class:d("p-2","flex flex-row gap-4","bg-secondary/25 text-primary","border-secondary border-b-1","shadow-secondary/25 shadow-sm"),children:[a(H,{class:"w-[8rem]",label:"STATUS",isCurrent:()=>e==="status",onClick:()=>r("status")}),a(H,{class:"w-[8rem]",label:"EDIT",isCurrent:()=>e==="edit",onClick:()=>r("edit")})]}),e==="status"&&a(Ha,{}),e==="edit"&&a(ps,{pg:i})]})}function Ha(){let t=C("_any_page_"),[e,r]=ye(),[n,s]=ye();return a("div",{class:d(Qe,"p-2","overflow-y-auto"),children:[a("h3",{class:"mt-0!",children:"Local Edits"}),a("p",{children:"Local edits are saved to localStorage, and can be used locally for testing."}),a("div",{class:"flex flex-row gap-4",children:[a("label",{class:"flex flex-row items-center",children:[a("input",{type:"checkbox",checked:!!t.load("enable-local-edits"),onChange:({target:i})=>{gs(i.checked),r(`${new Date().toLocaleTimeString()}: mode updated.`)}}),a("span",{class:"ml-2",children:"Use localStorage data site-wide."})]}),e&&a("div",{class:"text-primary",children:e})]}),a("h3",{children:"Reset"}),a("p",{children:"Go back to a clean slate: you will lose your edits."}),a("div",{class:"flex flex-row gap-4",children:[a(H,{label:"Reset and Erase Edits",onClick:()=>{Te(""),s(`${new Date().toLocaleTimeString()}: Local edits erased.`)}}),n&&a("div",{class:"text-primary",children:n})]}),a("h3",{children:"Exports and Contributions"}),a("p",{children:"Adding any edits back to the project requires a pull request. For now, this process involves a few steps:"}),a("ol",{children:[a("li",{children:a(H,{label:"Export Local Data",onClick:()=>za(t.load("local-edits"))})}),a("li",{children:["Fork ",a("a",{href:"https://github.com/emmanueloga/plangs2",children:"Plangs! source repository"}),"."]}),a("li",{children:["Regenerate the TypeScript definitions through the command:",a("br",{}),a("code",{children:"$ bun regenerate path/to/plangs.json"}),a("br",{})]})]}),a("p",{children:"Now you should be ready to send a pull request. Thanks in advance!."})]})}function za(t){if(!t){alert("No data to export.");return}let e=new Blob([JSON.stringify(t)],{type:"application/json"}),r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download="plangs.json",n.click(),URL.revokeObjectURL(r)}function ms(t){let e=le("plangsEditor");e&&me(a(us,{pg:t}),e)}var Ua=["plangs","tools","apps","libraries","subsystems","learning","communities"];function gs(t){C("_any_page_").update("enable-local-edits",t),fs()}function Te(t){C("_any_page_").update("local-edits",t),fs()}function fs(){for(let t of Ua)C(t).remove("vertex-detail")}var pe=class t{constructor(e="any",r=new Set){this.mode=e;this.values=r}get isEmpty(){return this.values.size===0}add(...e){for(let r of e)this.values.add(r);return this}delete(e){return this.values.delete(e)}has(e){return this.values.has(e)}clear(){this.values.clear()}get size(){return this.values.size}matches(e){return this.mode==="all"?this.all(e):this.any(e)}all(e){for(let r of this.values)if(!e(r))return!1;return!0}any(e){for(let r of this.values)if(e(r))return!0;return!1}get value(){return this}get isPresent(){return!this.isEmpty}equalTo(e){if(!e||!(e instanceof t)||this.mode!==e.mode||this.values.size!==e.values.size)return!1;for(let r of this.values)if(!e.values.has(r))return!1;return!0}clone(){return new t(this.mode,new Set(this.values))}toJSON(){return{mode:this.mode,values:[...this.values]}}serializable(){return this.isEmpty?void 0:this.toJSON()}static isSerialized(e){return!!e&&typeof e=="object"&&"mode"in e&&(e.mode==="all"||e.mode==="any")&&"values"in e&&Array.isArray(e.values)}toString(){return`Filter(${this.mode}: ${JSON.stringify([...this.values]).slice(1,-1)})`}};var _e=class{constructor(e){this.value=e}get isNil(){return this.value===void 0||this.value===null}get isPresent(){return!this.isNil}serializable(){return this.isPresent?this.value:void 0}},L=class t extends _e{constructor(e=void 0){super(e)}equalTo(e){return e instanceof t}},D=class t extends _e{equalTo(e){return e instanceof t&&this.value===e.value}},vt=class t extends _e{get isPresent(){return!this.isNil&&this.value===!0}equalTo(e){return e instanceof t&&this.value===e.value}},ke=class t extends _e{get isPresent(){return!this.isNil&&this.value.length>0&&!/^\s*$/.test(this.value)}equalTo(e){return e instanceof t&&this.value===e.value}},dr=class t extends _e{get isPresent(){return!this.isNil&&this.value.size>0}equalTo(e){if(!(e instanceof t))return!1;if(this.value===e.value)return!0;if(this.value.size!==e.value.size)return!1;for(let r of this.value)if(!e.value.has(r))return!1;return!0}serializable(){return this.isPresent?["Set",[...this.value]]:void 0}static isSerialized(e){return Array.isArray(e)&&e[0]==="Set"&&Array.isArray(e[1])}},Ya=/(?:)/,pr=class t extends _e{get isPresent(){return!this.isNil&&this.value.source!==Ya.source}equalTo(e){return e instanceof t&&this.value.source===e.value.source}serializable(){let{value:e}=this;return this.isPresent?e.flags?["RegExp",e.source,e.flags]:["RegExp",e.source]:void 0}static isSerialized(e){return Array.isArray(e)&&e[0]==="RegExp"&&typeof e[1]=="string"&&(e[2]===void 0||typeof e[2]=="string")}};function hs(t){if(t==null)return new L(t);switch(typeof t){case"number":return new D(t);case"boolean":return new vt(t);case"string":return new ke(t)}if(pr.isSerialized(t))return new pr(new RegExp(t[1],t[2]));if(dr.isSerialized(t))return new dr(new Set(t[1]));if(pe.isSerialized(t))return new pe(t.mode,new Set(t.values));console.log("Attempt to deserialize an unrecognized value shape:",t)}function Fe(t,e){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...n),e)}}var ur=class t{#e=new Map;has(e,r){return this.#e.get(e)?.has(r)??!1}set(e,r,n){let s=this.#e.get(e);return s||(s=new Map,this.#e.set(e,s)),s.set(r,n),this}getOrSet(e,r,n){let s=this.get(e,r);return s===void 0&&this.set(e,r,s=n()),s}delete(e,r){return this.#e.get(e)?.delete(r)??!1}delete1(e){let r=this.#e.get(e);return r?(this.#e.delete(e),r.size>0):!1}clear(){this.#e.clear()}get(e,r){return this.#e.get(e)?.get(r)}getMap(e){return this.#e.get(e)}getMap2(){let e=new Map;for(let[r,n]of this.#e)for(let[s,i]of n)e.set(s,i);return e}get size(){let e=0;for(let r of this.#e.values())e+=r.size;return e}get isEmpty(){for(let e of this.#e.values())if(e.size>0)return!1;return!0}size2(e){return this.#e.get(e)?.size??0}keys(){return[...this.#e.keys()].filter(e=>(this.#e.get(e)?.size??0)>0)}keys2(e){let r=[],n=this.#e.get(e);if(n)for(let s of n.keys())r.push(s);return r}entries(){return[...this.#e.entries()].filter(([e,r])=>r.size>0)}flatEntries(){let e=[];for(let[r,n]of this.#e)for(let[s,i]of n)e.push([r,s,i]);return e}filter(e){let r=new t;for(let[n,s]of this.#e)for(let[i,o]of s)e(n,i,o)&&r.set(n,i,o);return r}values(){return[...this.#e.values()].flatMap(e=>[...e.values()])}values2(e){let r=this.#e.get(e);return r?[...r.values()]:[]}toString(){let e=[...this.flatEntries()].map(([r,n,s])=>`(${r}, ${n}) => ${s}`);return`Map2(size: ${this.size})${e.length>0?` { ${e.join(", ")} }`:""}`}};var ys={createdRecently:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),ghStars:(t,e)=>t.github.stars>e.value,licenses:(t,e)=>e.matches(r=>t.relLicenses.has(r)),name:(t,e)=>t.lcName.includes(e.value),platforms:(t,e)=>e.matches(r=>t.relPlatforms.has(r)),releasedRecently:(t,e)=>_(t.releases.last,r=>r?.isRecent(e.value)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),writtenWith:(t,e)=>e.matches(r=>t.relWrittenWith.has(r))};var vs={apps:(t,e)=>e.matches(r=>t.relApps.has(r)),createdRecently:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),libraries:(t,e)=>e.matches(r=>t.relLibraries.has(r)),name:(t,e)=>t.lcName.includes(e.value),plangs:(t,e)=>e.matches(r=>t.relPlangs.has(r)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),tools:(t,e)=>e.matches(r=>t.relTools.has(r))};var xs={apps:(t,e)=>e.matches(r=>t.relApps.has(r)),createdRecently:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),libraries:(t,e)=>e.matches(r=>t.relLibraries.has(r)),name:(t,e)=>t.lcName.includes(e.value),plangs:(t,e)=>e.matches(r=>t.relPlangs.has(r)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),tools:(t,e)=>e.matches(r=>t.relTools.has(r))};var bs={createdRecently:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),ghStars:(t,e)=>t.github.stars>e.value,licenses:(t,e)=>e.matches(r=>t.relLicenses.has(r)),name:(t,e)=>t.lcName.includes(e.value),platforms:(t,e)=>e.matches(r=>t.relPlatforms.has(r)),releasedRecently:(t,e)=>_(t.releases.last,r=>r?.isRecent(e.value)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),writtenFor:(t,e)=>e.matches(r=>t.relPlangs.has(r)),writtenWith:(t,e)=>e.matches(r=>t.relWrittenWith.has(r))};var ws={compilesTo:(t,e)=>e.matches(r=>t.relCompilesTo.has(r)),created:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),dialectOf:(t,e)=>e.matches(r=>t.key===r||t.relDialectOf.has(r)),extensions:(t,e)=>e.matches(r=>t.extensions.includes(r)),hasLogo:(t,e)=>e.value===t.images.some(r=>r.kind==="logo"),hasWikipedia:(t,e)=>e.value===!!t.data.extWikipediaPath,implements:(t,e)=>e.matches(r=>r===t.key||t.relImplements.has(r)),influenced:(t,e)=>e.matches(r=>t.relInfluenced.has(r)),influencedBy:(t,e)=>e.matches(r=>t.relInfluencedBy.has(r)),isPopular:(t,e)=>e.value===t.isPopular,isTranspiler:(t,e)=>e.value===t.isTranspiler,licenses:(t,e)=>e.matches(r=>t.relLicenses.has(r)),name:(t,e)=>t.lcName.includes(e.value),paradigms:(t,e)=>e.matches(r=>t.relParadigms.has(r)),platforms:(t,e)=>e.matches(r=>t.relPlatforms.has(r)),released:(t,e)=>_(t.releases.last,r=>r?.isRecent(e.value)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),typeSystems:(t,e)=>e.matches(r=>t.relTypeSystems.has(r)),writtenWith:(t,e)=>e.matches(r=>t.relWrittenWith.has(r))};var Vs={createdRecently:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),ghStars:(t,e)=>t.github.stars>e.value,licenses:(t,e)=>e.matches(r=>t.relLicenses.has(r)),name:(t,e)=>t.lcName.includes(e.value),platforms:(t,e)=>e.matches(r=>t.relPlatforms.has(r)),releasedRecently:(t,e)=>_(t.releases.last,r=>r?.isRecent(e.value)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),writtenWith:(t,e)=>e.matches(r=>t.relWrittenWith.has(r))};var Ps={createdRecently:(t,e)=>t.created.isRecent(e.value),creationYear:(t,e)=>_(t.created.strYear,r=>e.matches(n=>r===n)),ghStars:(t,e)=>t.github.stars>e.value,licenses:(t,e)=>e.matches(r=>t.relLicenses.has(r)),name:(t,e)=>t.lcName.includes(e.value),platforms:(t,e)=>e.matches(r=>t.relPlatforms.has(r)),releasedRecently:(t,e)=>_(t.releases.last,r=>r?.isRecent(e.value)),tags:(t,e)=>e.matches(r=>t.relTags.has(r)),writtenFor:(t,e)=>e.matches(r=>t.relPlangs.has(r)),writtenWith:(t,e)=>e.matches(r=>t.relWrittenWith.has(r))};function Za(t,e,r,n="any"){let s=!1;for(let[i,o]of r){if(!o.isPresent)continue;s=!0;let l=e[i];if(!l){console.error(`No predicate found for key: ${i}`);continue}let p=l(t,o);if(n==="all"&&!p)return!1;if(n==="any"&&p)return!0}return s?n==="all":!0}function ja(t,e,r="all"){let n=Ja(t.name);return n?new Set([...t.values].filter(s=>Za(s,n,e,r)).map(s=>s.key)):(console.warn(`No predicates found for vertex name: ${t.name}`),new Set(t.keys))}function Ts(t,e,r="any"){let n=r==="all"?new Set(t.keys):new Set;for(let[s,i]of e.entries()){let o=ja(t,i,"all");if(r==="all"){if(o.size===0)return new Set;if(n=n.intersection(o),n.size===0)return n}else n=n.union(o)}return n}function Ja(t){switch(t){case"app":return ys;case"community":return vs;case"learning":return xs;case"library":return bs;case"plang":return ws;case"tool":return Ps;case"subsystem":return Vs}}var K=class t extends Y{static deserialize(e,r){let n=new ur,s={mode:"any"};if(!r)return[s,n];for(let[i,o]of Object.entries(r)){if(i==="mode"&&(o==="all"||o==="any")){s.mode=o;continue}let l=e.get(i);if(!l){console.error("missing group for facet",i);continue}let p=hs(o);p?.isPresent?n.set(l,i,p):console.error("failed to deserialize value",i,o)}return[s,n]}doSetCurrentGroup(e){this.data.currentGroupKey=e,C(this.page).update("facets-last-group",e),this.dispatch()}doResetGroup(e){this.values.delete1(e),this.dispatch()}doResetAll(e){if(e){let[{mode:r},n]=t.deserialize(this.gkByFk,e);this.data.values=n,this.data.mode=r}else this.values.clear();this.doSetCurrentGroup(this.nav.default)}doSetValue(e,r,n){let{values:s}=this.data,i;return n.isPresent?!s.has(e,r)||!n.equalTo(s.get(e,r))?(s.set(e,r,n),i="changed"):i="unchanged":i=s.delete(e,r)?"changed":"unchanged",this.dispatch(),i}doSetMode(e){this.data.mode=e,this.dispatch()}get pg(){return this.data.pg}get values(){return this.data.values}get mode(){return this.data.mode}get serialized(){let e={mode:this.data.mode};for(let[r,n,s]of this.values.flatEntries())s.isPresent&&(e[n]=s.serializable());return e}get currentGroupKey(){return this.data.currentGroupKey}groupHasValues(e){for(let r of this.values.getMap(e)?.values()??[])if(r.isPresent)return!0;return!1}get anyValues(){return this.values.values().some(e=>e.isPresent)}groupTitle(e){return this.groupsConfig.get(e)?.title??e}_updateThumbs(){let e=this.values.filter((n,s,i)=>i.isPresent),r=e.isEmpty?void 0:Ts(this.pg[this.vertexName],e,this.data.mode);for(let n of z("vertexThumbn")){let s=n.dataset.vertexKey;if(!s)continue;let i=r===void 0||r.has(s);n.classList.toggle("hidden",!i)}}updateThumbns=Fe(this._updateThumbs.bind(this),30);runEffects(e=""){if(e==="persist"){let r=this.serialized;this.pushState(r),C(this.page).update("facet-value",r)}return this.updateThumbns(),this.updateClearFacets(),this}updateClearFacets(){let e=Lr("#icon-button-clearFacets");return e?.state?(e.state.doToggleMode(this.anyValues?"clearFacets":""),this):this}pushState=Fe((e=>{window.fragment.pushState(A.serialize(e))}).bind(this),50);dispatch(){try{super.dispatch(),this.runEffects("persist")}catch(e){console.error(e)}return this}};var gr=class extends Y{doSetValue(e){let{main:r,data:n}=this;return r.doSetValue(n.groupKey,n.facetKey,e)}doAdd(e){if(!e)return!1;let{value:r}=this;return r.has(e)?!1:(r.add(e),this.doSetValue(r)==="changed")}doRemove(e){if(!e)return!1;let{value:r}=this;return r.has(e)?(r.delete(e),this.doSetValue(r)==="changed"):!1}doSetMode(e){let{value:r}=this;r.mode!==e&&(this.value.mode=e==="all"?"all":"any",this.doSetValue(r))}get main(){return this.data.main}get value(){let{main:e,groupKey:r,facetKey:n}=this.data;return e.values.getOrSet(r,n,()=>new pe("any"))}};function _s({active:t,facetKey:e,groupKey:r,label:n}){let s=U(),i=U(),o=X(j),l=F(()=>new gr({main:o,groupKey:r,facetKey:e}));$(()=>se(s?.current,"icon-button",w=>{w.stopPropagation(),l.doSetMode(w.detail.mode)}));let p=w=>s.current?.querySelector(`button[data-value="${w}"]`)?.scrollIntoView({behavior:"smooth",block:"nearest"}),u=Re((w,S)=>{if(S.stopPropagation(),S.key!=="Enter")return;let V=w.value.startsWith(".")?w.value:`.${w.value}`;l.doAdd(V)&&setTimeout(()=>p(V),100),w.value=""}),m=Fe(()=>{for(let w of s.current?.querySelectorAll(".quick-pulse")??[])w.classList.remove("quick-pulse")},150),c=w=>s.current?.querySelector(`li:nth-child(${w})>button`),g=w=>Re((S,V)=>{V.stopPropagation(),l.doRemove(S.dataset.value)&&setTimeout(()=>{let P=c(w+1)??c(w);(P??i.current)?.focus(),P&&(P.classList.add("quick-pulse"),setTimeout(()=>m(),150))},10)});function x(w){return Array.from([...l.value.values].entries()).map(w)}let R=()=>a(ne,{children:[a("input",{type:"text",name:e,ref:i,placeholder:n,class:d(W,"m-2"),onKeyDown:u}),a("span",{class:d(l.value.size===0&&"hidden",l.value.size<2?"text-foreground/50":"text-foreground","pl-2"),children:a(ce,{action:"allAny",disabled:l.value.size<2,initial:"any"})}),a("ul",{children:x(([w,S])=>a("li",{children:a("button",{type:"button","data-value":S,class:d("inline-flex flex-row","p-2","w-full text-left","cursor-pointer",ve),...B(g(w)),children:[a("div",{class:"-mt-[2px] inline-block scale-75 text-red-500",children:Gt}),S]})},S))})]});return a("div",{ref:s,class:d("flex flex-col"),children:t?R():null})}function Cs(t,e){if(e.kind==="rel"){let{edgeName:r,direction:n,minEntries:s}=e,i=t.edges[r];if(!i)return console.error("No edges found for:",r,n),[];let o=n==="direct"?i.entriesBackward:i.entriesForward,l=n==="direct"?i.toSource:i.fromSource,p=[...o].map(([u,m])=>{let c=l.get(u)?.name??u;return{value:u,label:c,count:m.size}});return typeof s=="number"?p.filter(u=>u.count>=s):p}if(e.kind==="prop"){let r=new Map;for(let{created:n}of t[e.vertexName].values){if(!n.year)continue;let s=`${n.year}`;r.set(s,(r.get(s)??0)+1)}return[...r.entries()].map(([n,s])=>{let i=`${n}`;return{value:n,label:i,count:s}})}return console.error("Unknown config kind",e),[]}function Rs(t,e){return t==="facet"&&e.kind==="rel"?"Name":t==="facet"&&e.kind==="prop"?"Value":t}function Ss(t,e){return t==="facet"?e==="facet-asc"&&Ot||e==="facet-desc"&&It:t==="count"?e==="count-asc"&&Ot||e==="count-desc"&&It:e==="sel-asc"&&Ot||e==="sel-desc"&&It}function ks(t,e){return t==="facet"?e==="facet-asc"?"facet-desc":"facet-asc":t==="count"?e==="count-desc"?"count-asc":"count-desc":e==="sel-desc"?"sel-asc":"sel-desc"}var qa={"facet-asc":(t,e)=>t.label.localeCompare(e.label),"facet-desc":(t,e)=>e.label.localeCompare(t.label),"count-asc":(t,e)=>t.count-e.count,"count-desc":(t,e)=>e.count-t.count,"sel-asc":(t,e,r)=>r?Number(r(t))-Number(r(e)):0,"sel-desc":(t,e,r)=>r?Number(r(e))-Number(r(t)):0};function mr(t,e,r){let n=qa[e];return t.sort((s,i)=>n(s,i,r))}function fr({action:t,class:e,col:r,config:n,order:s}){return a("button",{type:"button",class:d(ve,"flex flex-row gap-1 px-2 py-1","items-center justify-between","italic","underline decoration-1 decoration-dotted","cursor-pointer",e),...B(t),children:[a("span",{children:Rs(r,n)}),a("span",{class:d("scale-75"),children:Ss(r,s)}),a("span",{class:"flex-1"})]})}var hr=class extends Y{doSetValue(e){let{main:r,data:n}=this;return r.doSetValue(n.groupKey,n.facetKey,e)}doToggle(e){let{value:r}=this;r.has(e)?r.delete(e):r.add(e),this.doSetValue(r)}doSetMode(e){let{value:r}=this;r.mode!==e&&(this.value.mode=e==="all"?"all":"any",this.doSetValue(r))}doToggleOrder(e){let{order:r}=this.data;this.data.order=ks(e,r),mr(this.data.entries,this.data.order,n=>this.value.has(n.value)),this.dispatch()}doResetSelection(){this.value.clear(),this.doSetValue(this.value)}doSetFilter(e){this.data.filter=e,this.dispatch()}get main(){return this.data.main}get filter(){return this.data.filter}get value(){let{main:e,groupKey:r,facetKey:n}=this.data;return e.values.getOrSet(r,n,()=>new pe("any"))}get filteredEntries(){if(this.filter==="")return this.data.entries;let e=this.filter.toLowerCase();return this.data.entries.filter(r=>r.label.toLowerCase().includes(e))}get order(){return this.data.order}get hasSelection(){return this.value.size>0}};function Fs({groupKey:t,facetKey:e,config:r,active:n}){let s=U(),i=X(j),o=F(()=>{let m=r.kind==="prop"?"facet-desc":"facet-asc",c=mr(Cs(i.pg,r),m);return new hr({config:r,entries:c,facetKey:e,groupKey:t,main:i,order:m,filter:""})});$(()=>se(s?.current,"icon-button",m=>{m.stopPropagation(),o.doSetMode(m.detail.mode==="all"?"all":"any")}));let l=d("col-span-3","grid grid-cols-subgrid"),p=d(l,d("border-b-1","border-foreground/25 border-dotted")),u=()=>a("div",{class:d("grid grid-cols-[1fr_auto_auto]","overflow-hidden"),children:[a("div",{class:d(p,"bg-secondary text-foreground"),children:[a("div",{class:d("col-span-3","flex flex-row","items-center justify-between"),children:[a("input",{class:d(W,"m-1 block h-8 w-[100%]"),placeholder:"Filter...",value:o.filter,onInput:m=>o.doSetFilter(m.currentTarget.value)}),a(ce,{action:"allAny",initial:o.value.mode,disabled:o.value.size<2}),a("div",{class:d("scale-75 p-1",o.hasSelection?d("hover:text-hiliteb",Oe):"opacity-25"),...B(()=>o.doResetSelection()),children:We})]}),a(fr,{class:"text-left",action:()=>o.doToggleOrder("facet"),col:"facet",config:r,order:o.order}),a(fr,{class:"text-center",action:()=>o.doToggleOrder("count"),col:"count",config:r,order:o.order}),a(fr,{class:"text-right",action:()=>o.doToggleOrder("sel"),col:"sel",config:r,order:o.order})]}),a("div",{class:d(p,"overflow-hidden","overflow-y-scroll"),children:o.filteredEntries.map(m=>_(B(()=>o.doToggle(m.value)),c=>a("div",{class:d(p,ve,o.value.has(m.value)&&"bg-secondary/20"),...c,children:[a("div",{class:d("p-2","text-left","overflow-hidden text-ellipsis","line-clamp-3"),children:m.label}),a("div",{class:d("p-2","text-center"),children:m.count}),a("div",{class:d("p-2","text-right"),children:a("input",{type:"checkbox",checked:o.value.has(m.value),...c})})]},m.value)))})]});return a("div",{ref:s,class:d("flex flex-col","size-full overflow-hidden"),children:n?u():null})}function Ks({groupKey:t,facetKey:e,label:r,valueMapper:n=s=>new vt(s)}){let s=U(),i=X(j),o=Re(l=>{i.doSetValue(t,e,n(l.checked))});return a("label",{for:e,class:d("inline-flex items-center gap-2","mx-2"),children:[a("input",{id:e,name:e,type:"checkbox",placeholder:r,...B(o),checked:!!i.values.get(t,e)?.isPresent,ref:s}),r]})}function As({groupKey:t,facetKey:e,options:r,label:n}){let s=X(j),i=s.values.get(t,e)?.value??"";return a("label",{class:d("m-2","flex","items-center","gap-2"),children:[a("span",{class:"inline-block min-w-[5rem]",children:n}),a("select",{class:d(W,"flex-1"),onChange:o=>{let l=o.target;s.doSetValue(t,e,new ke(l.value))},value:i,children:r.map(({label:o,value:l})=>a("option",{value:l,selected:l===i,class:"text-pink-400",children:o},l))})]})}function Ns({groupKey:t,facetKey:e,label:r}){let n=X(j),s=Fe(Re(o=>{n.doSetValue(t,e,new ke(o.value.toLowerCase()))}),50),i=n.values.get(t,e)?.value??"";return a("input",{type:"search",onInput:s,placeholder:r,class:d("m-2",W),value:i})}function Es(t){return({currentFacetGroup:e})=>a(ne,{children:[...t.entries()].map(([r,{title:n,facets:s}])=>a(Xa,{groupKey:r,label:n,active:e===r,children:s.map(i=>{let{kind:o,label:l,facetKey:p}=i,u={groupKey:r,facetKey:p,label:l,active:e===r};switch(o){case"bool":return a(Ks,{...u,valueMapper:i.valueMapper});case"multi":return a(_s,{...u});case"table":return a(Fs,{...u,config:i.config});case"text":return a(Ns,{...u});case"select":return a(As,{...u,options:i.options});default:console.error("Facet not found",p)}})},r))})}function Xa({active:t,children:e}){let r=X(j);return a("div",{class:d("relative",!t&&"hidden","flex-1 pt-1","self-center","size-full overflow-hidden overflow-y-auto","flex flex-col gap-2"),children:e})}function N(t,e,r){return{kind:"bool",facetKey:t,label:e,valueMapper:r}}function Ls(t,e){return{kind:"multi",facetKey:t,label:e}}function v(t,e,r){return{kind:"table",facetKey:t,label:e,config:r}}function O(t,e){return{kind:"text",facetKey:t,label:e}}function Jr(t,e,r=Qa()){return{kind:"select",label:e,facetKey:t,options:r}}function Qa(){return[{label:"Any time",value:""},{label:"Past 3 months",value:oe(3,"m")},{label:"Past 6 months",value:oe(6,"m")},{label:"Past year",value:oe(1,"y")},{label:"Past 2 years",value:oe(2,"y")},{label:"Past 3 years",value:oe(3,"y")},{label:"Past 4 years",value:oe(4,"y")},{label:"Past 5 years",value:oe(5,"y")},{label:"Past 7 years",value:oe(7,"y")},{label:"Past 10 years",value:oe(10,"y")}]}function J(t){let e=new Map(Object.entries(t)),r=new Map;for(let[s,{facets:i}]of Object.entries(t))for(let o of i)r.set(o.facetKey,s);let n=Es(e);return[e,r,n]}var[ei,Ds,ti]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("app","created"))]},general:{title:"General",facets:[O("name","App Name"),N("createdRecently","Created Recently",t=>t?new D(new Date().getFullYear()-5):new L),N("releasedRecently","Released Recently",t=>t?new D(new Date().getFullYear()-1):new L),O("ghStars","GitHub Stars")]},licenses:{title:"Licenses",facets:[v("licenses","Licenses",b("app","relLicenses"))]},platforms:{title:"Platforms",facets:[v("platforms","Platforms",b("app","relPlatforms"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("app","relTags"))]},writtenWith:{title:"Written With",facets:[v("writtenWith","Written With",b("app","relWrittenWith"))]}}),Ms="apps",Gs={groupKeys:[["general"],["writtenWith"],["tags","creationYear","licenses"],["platforms"]],default:"general"},yr=class t extends K{nav=Gs;page=Ms;vertexName="app";gkByFk=Ds;groupsConfig=ei;groupsComponent=ti;static initial(e){let r=C(Ms),n=r.load("facets-last-group")??Gs.default,[{mode:s},i]=K.deserialize(Ds,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var[ri,Is,ni]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("community","created"))]},general:{title:"General",facets:[O("name","Community Name"),N("createdRecently","Created Recently",t=>t?new D(new Date().getFullYear()-5):new L)]},apps:{title:"Licenses",facets:[v("apps","Apps",b("community","relApps"))]},libraries:{title:"Platforms",facets:[v("libraries","libraries",b("community","relLibraries"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("community","relTags"))]},plangs:{title:"Written For",facets:[v("plangs","Plangs",b("community","relPlangs"))]},tools:{title:"Written With",facets:[v("tools","Tools",b("community","relTools"))]}}),Os="communities",Ws={groupKeys:[["general"],["plangs","libraries"],["apps","tools"],["tags"]],default:"general"},vr=class t extends K{nav=Ws;page=Os;vertexName="community";gkByFk=Is;groupsConfig=ri;groupsComponent=ni;static initial(e){let r=C(Os),n=r.load("facets-last-group")??Ws.default,[{mode:s},i]=K.deserialize(Is,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var[si,Bs,ai]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("learning","created"))]},general:{title:"General",facets:[O("name","Learning Name"),N("createdRecently","Created Recently",t=>t?new D(new Date().getFullYear()-5):new L)]},apps:{title:"Apps",facets:[v("apps","Apps",b("learning","relApps"))]},libraries:{title:"Libraries",facets:[v("libraries","libraries",b("learning","relLibraries"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("learning","relTags"))]},plangs:{title:"Plangs",facets:[v("plangs","Plangs",b("learning","relPlangs"))]},tools:{title:"Tools",facets:[v("tools","Tools",b("learning","relTools"))]}}),$s="learning",Hs={groupKeys:[["general"],["plangs","libraries"],["apps","tools"],["tags"]],default:"general"},xr=class t extends K{nav=Hs;page=$s;vertexName="learning";gkByFk=Bs;groupsConfig=si;groupsComponent=ai;static initial(e){let r=C($s),n=r.load("facets-last-group")??Hs.default,[{mode:s},i]=K.deserialize(Bs,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var[ii,zs,oi]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("library","created"))]},general:{title:"General",facets:[O("name","Library Name"),N("createdRecently","Created Recently",t=>t?new D(new Date().getFullYear()-5):new L),N("releasedRecently","Released Recently",t=>t?new D(new Date().getFullYear()-1):new L),O("ghStars","GitHub Stars")]},licenses:{title:"Licenses",facets:[v("licenses","Licenses",b("library","relLicenses"))]},platforms:{title:"Platforms",facets:[v("platforms","Platforms",b("library","relPlatforms"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("library","relTags"))]},writtenWith:{title:"Written With ",facets:[v("writtenWith","Written With",b("library","relWrittenWith"))]},writtenFor:{title:"Written For",facets:[v("writtenFor","Written For",b("tool","relPlangs"))]}}),Us="libraries",Ys={groupKeys:[["general"],["writtenWith","writtenFor"],["tags","creationYear","licenses"],["platforms"]],default:"general"},br=class t extends K{nav=Ys;page=Us;vertexName="library";gkByFk=zs;groupsConfig=ii;groupsComponent=oi;static initial(e){let r=C(Us),n=r.load("facets-last-group")??Ys.default,[{mode:s},i]=K.deserialize(zs,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var[li,Zs,ci]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("plang","created"))]},dialectOf:{title:"Dialect Of",facets:[v("dialectOf","Dialect Of",b("plang","relDialectOf"))]},general:{title:"General",facets:[O("name","Plang Name"),Ls("extensions","Extensions"),Jr("created","Created"),Jr("released","Released"),N("isPopular","Is Popular"),N("hasLogo","Has Logo"),N("hasWikipedia","Has Wikipedia")]},implements:{title:"Implements",facets:[v("implements","Implements",{...b("plang","relImplements"),minEntries:2})]},influenced:{title:"Influenced",facets:[v("influenced","Influenced",b("plang","relInfluenced"))]},influencedBy:{title:"Influenced By",facets:[v("influencedBy","Influenced By",b("plang","relInfluencedBy"))]},licenses:{title:"Licenses",facets:[v("licenses","Licenses",b("plang","relLicenses"))]},paradigms:{title:"Paradigms",facets:[v("paradigms","Paradigms",b("plang","relParadigms"))]},platforms:{title:"Platforms",facets:[v("platforms","Platforms",b("plang","relPlatforms"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("plang","relTags"))]},transpiler:{title:"Transpiler",facets:[N("isTranspiler","Transpiler to Anything"),v("compilesTo","Compiles To",b("plang","relCompilesTo"))]},typeSystems:{title:"Type Systems",facets:[v("typeSystems","Type Systems",b("plang","relTypeSystems"))]},writtenWith:{title:"Written With",facets:[v("writtenWith","Written With",b("plang","relWrittenWith"))]}}),js="plangs",Js={groupKeys:[["general"],["platforms","paradigms","typeSystems"],["writtenWith","transpiler","dialectOf","implements","influencedBy","influenced"],["tags","creationYear","licenses"]],default:"general"},wr=class t extends K{nav=Js;page=js;vertexName="plang";gkByFk=Zs;groupsConfig=li;groupsComponent=ci;static initial(e){let r=C(js),n=r.load("facets-last-group")??Js.default,[{mode:s},i]=K.deserialize(Zs,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var[di,qs,pi]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("subsystem","created"))]},general:{title:"General",facets:[O("name","Subsystem Name"),N("createdRecently","Created Recently",t=>t?new D(new Date().getFullYear()-5):new L),N("releasedRecently","Released Recently",t=>t?new D(new Date().getFullYear()-1):new L),O("ghStars","GitHub Stars")]},licenses:{title:"Licenses",facets:[v("licenses","Licenses",b("subsystem","relLicenses"))]},platforms:{title:"Platforms",facets:[v("platforms","Platforms",b("subsystem","relPlatforms"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("subsystem","relTags"))]},writtenWith:{title:"Written With",facets:[v("writtenWith","Written With",b("subsystem","relWrittenWith"))]}}),Xs="subsystems",Qs={groupKeys:[["general"],["writtenWith"],["tags","creationYear","licenses"],["platforms"]],default:"general"},Vr=class t extends K{nav=Qs;page=Xs;vertexName="subsystem";gkByFk=qs;groupsConfig=di;groupsComponent=pi;static initial(e){let r=C(Xs),n=r.load("facets-last-group")??Qs.default,[{mode:s},i]=K.deserialize(qs,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var[ui,ea,gi]=J({creationYear:{title:"Creation Year",facets:[v("creationYear","Creation Year",Z("tool","created"))]},general:{title:"General",facets:[O("name","Tool Name"),N("createdRecently","Created Recently",t=>t?new D(new Date().getFullYear()-5):new L),N("releasedRecently","Released Recently",t=>t?new D(new Date().getFullYear()-1):new L),O("ghStars","GitHub Stars")]},licenses:{title:"Licenses",facets:[v("licenses","Licenses",b("tool","relLicenses"))]},platforms:{title:"Platforms",facets:[v("platforms","Platforms",b("tool","relPlatforms"))]},tags:{title:"Tags",facets:[v("tags","Tags",b("tool","relTags"))]},writtenFor:{title:"Written For",facets:[v("writtenFor","Written For",b("tool","relPlangs"))]},writtenWith:{title:"Written With",facets:[v("writtenWith","Written With",b("tool","relWrittenWith"))]}}),ta="tools",ra={groupKeys:[["general"],["writtenWith","writtenFor"],["tags","creationYear","licenses"],["platforms"]],default:"general"},Pr=class t extends K{nav=ra;page=ta;vertexName="tool";gkByFk=ea;groupsConfig=ui;groupsComponent=gi;static initial(e){let r=C(ta),n=r.load("facets-last-group")??ra.default,[{mode:s},i]=K.deserialize(ea,A.deserialize()??r.load("facet-value"));return new t({pg:e,currentGroupKey:n,values:i,mode:s})}};var j=gn(void 0);function na(t,e){let r;if(t==="apps"&&(r=F(()=>yr.initial(e))),t==="communities"&&(r=F(()=>vr.initial(e))),t==="learning"&&(r=F(()=>xr.initial(e))),t==="libraries"&&(r=F(()=>br.initial(e))),t==="plangs"&&(r=F(()=>wr.initial(e))),t==="subsystems"&&(r=F(()=>Vr.initial(e))),t==="tools"&&(r=F(()=>Pr.initial(e))),!r){console.error("Unknown page",t);return}return r.runEffects()}var sa=d("col-span-2","grid grid-cols-subgrid","items-center","grow-0");function aa({page:t,pg:e}){let r=na(t,e),n=Dt(r);$(()=>window.fragment.onUserChange(i=>r?.doResetAll(i.deserFrag))),$(()=>se(n?.current,"icon-button",i=>{i.stopPropagation(),r?.doSetMode(i.detail.mode==="all"?"all":"any")}));let s=i=>a(j.Provider,{value:i,children:[a(mi,{page:t,state:i,class:q("facetsBar")}),a("div",{class:d(q("facetsSelect"),"flex-row items-center gap-2 bg-primary/85 p-2"),children:[a("select",{class:d(W,"block h-8 w-full flex-1 py-0 text-black/85"),onChange:o=>i.doSetCurrentGroup(o.currentTarget.value),children:i.nav.groupKeys.map(o=>a("optgroup",{children:o.map(l=>a("option",{value:l,selected:i.currentGroupKey===l,children:[i.groupTitle(l),i.groupHasValues(l)?" \u2611":""]},l))},o.join("-")))}),a("span",{class:"text-background",title:"Match either All or Any of the categories.",children:a(ce,{action:"allAny",initial:i.mode},i.mode)})]}),a("div",{class:d("w-full ","flex flex-col","overflow-hidden","bg-linear-to-b to-primary/25","relative"),children:a(i.groupsComponent,{currentFacetGroup:i.currentGroupKey})})]});return a("aside",{ref:n,class:d(q("facetsWrapper"),"flex","size-full overflow-hidden","border-1 border-primary/25 border-t-0"),children:r&&s(r)})}function mi({state:t,page:e,class:r}){let n=(s,i,o)=>i.map(l=>o(l,s.currentGroupKey===l,s.groupHasValues(l)));return a("aside",{class:d("h-full min-w-[12rem] sm:pt-2",xe,"bg-linear-to-r from-primary/25 to-transparent",r),children:a("div",{class:d("grid grid-cols-[1fr_auto]","ml-2"),children:[a("header",{class:d("text-primary uppercase","col-span-2 pt-2"),children:["Filter ",e]}),a("div",{class:"flex flex-row px-3 pt-1 pb-4",title:"Match either All or Any of the categories.",children:a(ce,{action:"allAny",initial:t.mode},t.mode)}),t.nav.groupKeys.map(s=>a("nav",{class:d("md:mb-6",sa),children:n(t,s,(i,o,l)=>a("div",{class:d(sa,o?d(d("border-secondary border-dotted","border-l-1"),"bg-primary/85 text-background"):"hover:bg-primary/25"),style:`${l?"font-weight: bold":""}`,children:[a("button",{...B(()=>t.doSetCurrentGroup(i)),class:d("block w-full","truncate text-left","px-4 py-1.5","cursor-pointer",o&&"text-background/85"),children:t.groupTitle(i)}),a("div",{...B(()=>t.doResetGroup(i)),class:d("p-1","scale-75","cursor-pointer",t.groupHasValues(i)?d("hover:text-hiliteb",Oe):"hidden"),children:We})]},i))},s.join("-")))]})})}function ia(t){for(let e of z("facetsMain"))if(t&&e.dataset.page)try{me(a(aa,{pg:t,page:e.dataset.page}),e)}catch(r){console.error("Error rendering FacetsMain component:",r)}else console.error("Missing prop for FacetsMain component.")}async function oa(t){return fetch("/plangs.json").then(async e=>{console.info("Using remote data."),t.loadJSON(await e.json()),t.materialize()})}async function la(t){let e=C("_any_page_");if(!e.load("enable-local-edits"))return oa(t);let r=e.load("local-edits");if(r)console.info("Using local edits."),document.addEventListener("DOMContentLoaded",()=>le("localEditWarning")?.classList.remove("hidden")),t.loadJSON(r),t.materialize();else return oa(t)}function ca(t,e){let r=e.closest(`[${Ae("vertex-key")}]`),n=Je(r,"vertex-key"),s=Je(r,"vertex-name"),i=n&&s&&t[s];if(i)return i.get(n)}window.fragment=new A().bind();window.restoreFilters=()=>rt.initial().runEffects();window.restoreHamburguer=()=>tt.initial().runEffects();window.restoreLightMode=()=>et.initial().runEffects();window.restoreVertexInfo=()=>zr();document.addEventListener("mouseover",t=>{let e=t.target,r=e.getAttribute("href");if(!r||e?.tagName!=="A"||!e.classList.contains("prefetch"))return;e.classList.remove("prefetch");let n=document.createElement("link");n.rel="prefetch",n.href=r,document.head.appendChild(n)});async function fi(){let t=new ze,e=la(t);document.addEventListener("DOMContentLoaded",()=>{Jn(),e.then(()=>{ia(t),ms(t);let r=le("vertexGrid");if(r){se(r,"pointerdown",({target:n})=>{let s=ca(t,n);zr(s)});for(let n of z("vertexThumbnImg")){let s=n.dataset.src;s&&n.setAttribute("src",s)}}})})}try{fi()}catch(t){console.error(t)}})();
//# sourceMappingURL=app.js.map