1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))n(_);new MutationObserver(_=>{for(const o of _)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(_){const o={};return _.integrity&&(o.integrity=_.integrity),_.referrerPolicy&&(o.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?o.credentials="include":_.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(_){if(_.ep)return;_.ep=!0;const o=r(_);fetch(_.href,o)}})();var j,m,De,U,me,Ue,oe,Re,ue,ie,ce,Me,W={},Ae=[],Ze=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,V=Array.isArray;function H(t,e){for(var r in e)t[r]=e[r];return t}function ae(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function R(t,e,r){var n,_,o,c={};for(o in e)o=="key"?n=e[o]:o=="ref"?_=e[o]:c[o]=e[o];if(arguments.length>2&&(c.children=arguments.length>3?j.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)c[o]===void 0&&(c[o]=t.defaultProps[o]);return O(t,c,n,_,null)}function O(t,e,r,n,_){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++De,__i:-1,__u:0};return _==null&&m.vnode!=null&&m.vnode(o),o}function ee(t){return t.children}function Z(t,e){this.props=t,this.context=e}function F(t,e){if(e==null)return t.__?F(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"?F(t):null}function Fe(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 Fe(t)}}function le(t){(!t.__d&&(t.__d=!0)&&U.push(t)&&!Q.__r++||me!==m.debounceRendering)&&((me=m.debounceRendering)||Ue)(Q)}function Q(){var t,e,r,n,_,o,c,l;for(U.sort(oe);t=U.shift();)t.__d&&(e=U.length,n=void 0,o=(_=(r=t).__v).__e,c=[],l=[],r.__P&&((n=H({},_)).__v=_.__v+1,m.vnode&&m.vnode(n),fe(r.__P,n,_,r.__n,r.__P.namespaceURI,32&_.__u?[o]:null,c,o??F(_),!!(32&_.__u),l),n.__v=_.__v,n.__.__k[n.__i]=n,We(c,n,l),n.__e!=o&&Fe(n)),U.length>e&&U.sort(oe));Q.__r=0}function Ie(t,e,r,n,_,o,c,l,u,s,h){var i,a,f,g,w,y,p=n&&n.__k||Ae,v=e.length;for(u=Ye(r,e,p,u,v),i=0;i<v;i++)(f=r.__k[i])!=null&&(a=f.__i===-1?W:p[f.__i]||W,f.__i=i,y=fe(t,f,a,_,o,c,l,u,s,h),g=f.__e,f.ref&&a.ref!=f.ref&&(a.ref&&he(a.ref,null,f),h.push(f.ref,f.__c||g,f)),w==null&&g!=null&&(w=g),4&f.__u||a.__k===f.__k?u=Ne(f,u,t):typeof f.type=="function"&&y!==void 0?u=y:g&&(u=g.nextSibling),f.__u&=-7);return r.__e=w,u}function Ye(t,e,r,n,_){var o,c,l,u,s,h=r.length,i=h,a=0;for(t.__k=new Array(_),o=0;o<_;o++)(c=e[o])!=null&&typeof c!="boolean"&&typeof c!="function"?(u=o+a,(c=t.__k[o]=typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?O(null,c,null,null,null):V(c)?O(ee,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?O(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):c).__=t,c.__b=t.__b+1,l=null,(s=c.__i=Qe(c,r,u,i))!==-1&&(i--,(l=r[s])&&(l.__u|=2)),l==null||l.__v===null?(s==-1&&a--,typeof c.type!="function"&&(c.__u|=4)):s!=u&&(s==u-1?a--:s==u+1?a++:(s>u?a--:a++,c.__u|=4))):t.__k[o]=null;if(i)for(o=0;o<h;o++)(l=r[o])!=null&&!(2&l.__u)&&(l.__e==n&&(n=F(l)),je(l,l));return n}function Ne(t,e,r){var n,_;if(typeof t.type=="function"){for(n=t.__k,_=0;n&&_<n.length;_++)n[_]&&(n[_].__=t,e=Ne(n[_],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=F(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oe(t,e){return e=e||[],t==null||typeof t=="boolean"||(V(t)?t.some(function(r){Oe(r,e)}):e.push(t)),e}function Qe(t,e,r,n){var _,o,c=t.key,l=t.type,u=e[r];if(u===null||u&&c==u.key&&l===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(_=r-1,o=r+1;_>=0||o<e.length;){if(_>=0){if((u=e[_])&&!(2&u.__u)&&c==u.key&&l===u.type)return _;_--}if(o<e.length){if((u=e[o])&&!(2&u.__u)&&c==u.key&&l===u.type)return o;o++}}return-1}function ge(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||Ze.test(e)?r:r+"px"}function B(t,e,r,n,_){var o;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||ge(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||ge(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Re,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n?r.u=n.u:(r.u=ue,t.addEventListener(e,o?ce:ie,o)):t.removeEventListener(e,o?ce:ie,o);else{if(_=="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 ye(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=ue++;else if(e.t<r.u)return;return r(m.event?m.event(e):e)}}}function fe(t,e,r,n,_,o,c,l,u,s){var h,i,a,f,g,w,y,p,v,S,E,P,L,z,A,x,T,C=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[l=e.__e=r.__e]),(h=m.__b)&&h(e);e:if(typeof C=="function")try{if(p=e.props,v="prototype"in C&&C.prototype.render,S=(h=C.contextType)&&n[h.__c],E=h?S?S.props.value:h.__:n,r.__c?y=(i=e.__c=r.__c).__=i.__E:(v?e.__c=i=new C(p,E):(e.__c=i=new Z(p,E),i.constructor=C,i.render=Ve),S&&S.sub(i),i.props=p,i.state||(i.state={}),i.context=E,i.__n=n,a=i.__d=!0,i.__h=[],i._sb=[]),v&&i.__s==null&&(i.__s=i.state),v&&C.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=H({},i.__s)),H(i.__s,C.getDerivedStateFromProps(p,i.__s))),f=i.props,g=i.state,i.__v=e,a)v&&C.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),v&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(v&&C.getDerivedStateFromProps==null&&p!==f&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(p,E),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(p,i.__s,E)===!1||e.__v==r.__v)){for(e.__v!=r.__v&&(i.props=p,i.state=i.__s,i.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(I){I&&(I.__=e)}),P=0;P<i._sb.length;P++)i.__h.push(i._sb[P]);i._sb=[],i.__h.length&&c.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(p,i.__s,E),v&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(f,g,w)})}if(i.context=E,i.props=p,i.__P=t,i.__e=!1,L=m.__r,z=0,v){for(i.state=i.__s,i.__d=!1,L&&L(e),h=i.render(i.props,i.state,i.context),A=0;A<i._sb.length;A++)i.__h.push(i._sb[A]);i._sb=[]}else do i.__d=!1,L&&L(e),h=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++z<25);i.state=i.__s,i.getChildContext!=null&&(n=H(H({},n),i.getChildContext())),v&&!a&&i.getSnapshotBeforeUpdate!=null&&(w=i.getSnapshotBeforeUpdate(f,g)),l=Ie(t,V(x=h!=null&&h.type===ee&&h.key==null?h.props.children:h)?x:[x],e,r,n,_,o,c,l,u,s),i.base=e.__e,e.__u&=-161,i.__h.length&&c.push(i),y&&(i.__E=i.__=null)}catch(I){if(e.__v=null,u||o!=null)if(I.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,e.__e=l}else for(T=o.length;T--;)ae(o[T]);else e.__e=r.__e,e.__k=r.__k;m.__e(I,e,r)}else o==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):l=e.__e=Xe(r.__e,e,r,n,_,o,c,u,s);return(h=m.diffed)&&h(e),128&e.__u?void 0:l}function We(t,e,r){for(var n=0;n<r.length;n++)he(r[n],r[++n],r[++n]);m.__c&&m.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(o){o.call(_)})}catch(o){m.__e(o,_.__v)}})}function Xe(t,e,r,n,_,o,c,l,u){var s,h,i,a,f,g,w,y=r.props,p=e.props,v=e.type;if(v=="svg"?_="http://www.w3.org/2000/svg":v=="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((f=o[s])&&"setAttribute"in f==!!v&&(v?f.localName==v:f.nodeType==3)){t=f,o[s]=null;break}}if(t==null){if(v==null)return document.createTextNode(p);t=document.createElementNS(_,v,p.is&&p),l&&(m.__m&&m.__m(e,o),l=!1),o=null}if(v===null)y===p||l&&t.data===p||(t.data=p);else{if(o=o&&j.call(t.childNodes),y=r.props||W,!l&&o!=null)for(y={},s=0;s<t.attributes.length;s++)y[(f=t.attributes[s]).name]=f.value;for(s in y)if(f=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=f;else if(!(s in p)){if(s=="value"&&"defaultValue"in p||s=="checked"&&"defaultChecked"in p)continue;B(t,s,null,f,_)}}for(s in p)f=p[s],s=="children"?a=f:s=="dangerouslySetInnerHTML"?h=f:s=="value"?g=f:s=="checked"?w=f:l&&typeof f!="function"||y[s]===f||B(t,s,f,y[s],_);if(h)l||i&&(h.__html===i.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(i&&(t.innerHTML=""),Ie(t,V(a)?a:[a],e,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":_,o,c,o?o[0]:r.__k&&F(r,0),l,u),o!=null)for(s=o.length;s--;)ae(o[s]);l||(s="value",v=="progress"&&g==null?t.removeAttribute("value"):g!==void 0&&(g!==t[s]||v=="progress"&&!g||v=="option"&&g!==y[s])&&B(t,s,g,y[s],_),s="checked",w!==void 0&&w!==t[s]&&B(t,s,w,y[s],_))}return t}function he(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(_){m.__e(_,r)}}function je(t,e,r){var n,_;if(m.unmount&&m.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||he(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){m.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(_=0;_<n.length;_++)n[_]&&je(n[_],e,r||typeof t.type!="function");r||ae(t.__e),t.__c=t.__=t.__e=void 0}function Ve(t,e,r){return this.constructor(t,r)}function et(t,e,r){var n,_,o,c;e==document&&(e=document.documentElement),m.__&&m.__(t,e),_=(n=typeof r=="function")?null:e.__k,o=[],c=[],fe(e,t=e.__k=R(ee,null,[t]),_||W,W,e.namespaceURI,_?null:e.firstChild?j.call(e.childNodes):null,o,_?_.__e:e.firstChild,n,c),We(o,t,c)}function be(t,e,r){var n,_,o,c,l=H({},t.props);for(o in t.type&&t.type.defaultProps&&(c=t.type.defaultProps),e)o=="key"?n=e[o]:o=="ref"?_=e[o]:l[o]=e[o]===void 0&&c!==void 0?c[o]:e[o];return arguments.length>2&&(l.children=arguments.length>3?j.call(arguments,2):r),O(t.type,l,n||t.key,_||t.ref,null)}function qe(t,e){var r={__c:e="__cC"+Me++,__:t,Consumer:function(n,_){return n.children(_)},Provider:function(n){var _,o;return this.getChildContext||(_=new Set,(o={})[e]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){_=null},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&_.forEach(function(l){l.__e=!0,le(l)})},this.sub=function(c){_.add(c);var l=c.componentWillUnmount;c.componentWillUnmount=function(){_&&_.delete(c),l&&l.call(c)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}j=Ae.slice,m={__e:function(t,e,r,n){for(var _,o,c;e=e.__;)if((_=e.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(t)),c=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,n||{}),c=_.__d),c)return _.__E=_}catch(l){t=l}throw t}},De=0,Z.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=H({},this.state),typeof t=="function"&&(t=t(H({},r),this.props)),t&&H(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),le(this))},Z.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),le(this))},Z.prototype.render=ee,U=[],Ue=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,oe=function(t,e){return t.__v.__b-e.__v.__b},Q.__r=0,Re=/(PointerCapture)$|Capture$/i,ue=0,ie=ye(!1),ce=ye(!0),Me=0;var tt=0;function d(t,e,r,n,_,o){e||(e={});var c,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?c=e[l]:u[l]=e[l];var s={type:t,props:u,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tt,__i:-1,__u:0,__source:_,__self:o};if(typeof t=="function"&&(c=t.defaultProps))for(l in c)u[l]===void 0&&(u[l]=c[l]);return m.vnode&&m.vnode(s),s}var M,b,te,ke,X=0,Ke=[],k=m,xe=k.__b,we=k.__r,Ee=k.diffed,Ce=k.__c,Pe=k.unmount,Te=k.__;function q(t,e){k.__h&&k.__h(b,t,X||e),X=0;var r=b.__H||(b.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function re(t){return X=1,pe(Ge,t)}function pe(t,e,r){var n=q(M++,2);if(n.t=t,!n.__c&&(n.__=[Ge(void 0,e),function(l){var u=n.__N?n.__N[0]:n.__[0],s=n.t(u,l);u!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=b,!b.u)){var _=function(l,u,s){if(!n.__c.__H)return!0;var h=n.__c.__H.__.filter(function(a){return!!a.__c});if(h.every(function(a){return!a.__N}))return!o||o.call(this,l,u,s);var i=n.__c.props!==l;return h.forEach(function(a){if(a.__N){var f=a.__[0];a.__=a.__N,a.__N=void 0,f!==a.__[0]&&(i=!0)}}),o&&o.call(this,l,u,s)||i};b.u=!0;var o=b.shouldComponentUpdate,c=b.componentWillUpdate;b.componentWillUpdate=function(l,u,s){if(this.__e){var h=o;o=void 0,_(l,u,s),o=h}c&&c.call(this,l,u,s)},b.shouldComponentUpdate=_}return n.__N||n.__}function $e(t,e){var r=q(M++,3);!k.__s&&ve(r.__H,e)&&(r.__=t,r.i=e,b.__H.__h.push(r))}function ze(t,e){var r=q(M++,4);!k.__s&&ve(r.__H,e)&&(r.__=t,r.i=e,b.__h.push(r))}function $(t){return X=5,de(function(){return{current:t}},[])}function de(t,e){var r=q(M++,7);return ve(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Be(t){var e=b.context[t.__c],r=q(M++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(b)),e.props.value):t.__}function rt(){for(var t;t=Ke.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Y),t.__H.__h.forEach(se),t.__H.__h=[]}catch(e){t.__H.__h=[],k.__e(e,t.__v)}}k.__b=function(t){b=null,xe&&xe(t)},k.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},k.__r=function(t){we&&we(t),M=0;var e=(b=t.__c).__H;e&&(te===b?(e.__h=[],b.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(Y),e.__h.forEach(se),e.__h=[],M=0)),te=b},k.diffed=function(t){Ee&&Ee(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ke.push(e)!==1&&ke===k.requestAnimationFrame||((ke=k.requestAnimationFrame)||nt)(rt)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),te=b=null},k.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Y),r.__h=r.__h.filter(function(n){return!n.__||se(n)})}catch(n){e.some(function(_){_.__h&&(_.__h=[])}),e=[],k.__e(n,r.__v)}}),Ce&&Ce(t,e)},k.unmount=function(t){Pe&&Pe(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Y(n)}catch(_){e=_}}),r.__H=void 0,e&&k.__e(e,r.__v))};var He=typeof requestAnimationFrame=="function";function nt(t){var e,r=function(){clearTimeout(n),He&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);He&&(e=requestAnimationFrame(r))}function Y(t){var e=b,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),b=e}function se(t){var e=b;t.__c=t.__(),b=e}function ve(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Ge(t,e){return typeof e=="function"?e(t):e}let D,N;const _t=(t,e)=>{if(D=void 0,e&&e.type==="click"){if(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0)return t;const r=e.target.closest("a[href]"),n=r&&r.getAttribute("href");if(!r||r.origin!=location.origin||/^#/.test(n)||!/^(_?self)?$/i.test(r.target)||N&&(typeof N=="string"?!n.startsWith(N):!N.test(n)))return t;D=!0,e.preventDefault(),e=r.href.replace(location.origin,"")}else typeof e=="string"?D=!0:e&&e.url?(D=!e.replace,e=e.url):e=location.pathname+location.search;return D===!0?history.pushState(null,"",e):D===!1&&history.replaceState(null,"",e),e},ot=(t,e,r)=>{t=t.split("/").filter(Boolean),e=(e||"").split("/").filter(Boolean);for(let n=0,_,o;n<Math.max(t.length,e.length);n++){let[,c,l,u]=(e[n]||"").match(/^(:?)(.*?)([+*?]?)$/);if(_=t[n],!(!c&&l==_)){if(!c&&_&&u=="*"){r.rest="/"+t.slice(n).map(decodeURIComponent).join("/");break}if(!c||!_&&u!="?"&&u!="*")return;if(o=u=="+"||u=="*",o?_=t.slice(n).map(decodeURIComponent).join("/")||void 0:_&&(_=decodeURIComponent(_)),r.params[l]=_,l in r||(r[l]=_),o)break}}return r};function K(t){const[e,r]=pe(_t,t.url||location.pathname+location.search);t.scope&&(N=t.scope);const n=D===!0,_=de(()=>{const o=new URL(e,location.origin),c=o.pathname.replace(/\/+$/g,"")||"/";return{url:e,path:c,query:Object.fromEntries(o.searchParams),route:(l,u)=>r({url:l,replace:u}),wasPush:n}},[e]);return ze(()=>(addEventListener("click",r),addEventListener("popstate",r),()=>{removeEventListener("click",r),removeEventListener("popstate",r)}),[]),R(K.ctx.Provider,{value:_},t.children)}const it=Promise.resolve();function Je(t){const[e,r]=pe(x=>x+1,0),{url:n,query:_,wasPush:o,path:c}=ct(),{rest:l=c,params:u={}}=Be(Se),s=$(!1),h=$(c),i=$(0),a=$(),f=$(),g=$(),w=$(!1),y=$();y.current=!1;const p=$(!1);let v,S,E;Oe(t.children).some(x=>{if(ot(l,x.props.path,E={...x.props,path:l,query:_,params:u,rest:""}))return v=be(x,E);x.props.default&&(S=be(x,E))});let P=v||S;de(()=>{f.current=a.current;const x=f.current&&f.current.props.children;!x||!P||P.type!==x.type||P.props.component!==x.props.component?(this.__v&&this.__v.__k&&this.__v.__k.reverse(),i.current++,p.current=!0):p.current=!1},[n]);const L=a.current&&a.current.__u&G&&a.current.__u&J,z=a.current&&a.current.__h;a.current=R(Se.Provider,{value:E},P),L?(a.current.__u|=G,a.current.__u|=J):z&&(a.current.__h=!0);const A=f.current;return f.current=null,this.__c=(x,T)=>{y.current=!0,f.current=A,t.onLoadStart&&t.onLoadStart(n),s.current=!0;let C=i.current;x.then(()=>{C===i.current&&(f.current=null,a.current&&(T.__h&&(a.current.__h=T.__h),T.__u&J&&(a.current.__u|=J),T.__u&G&&(a.current.__u|=G)),it.then(r))})},ze(()=>{const x=this.__v&&this.__v.__e;if(y.current){!w.current&&!g.current&&(g.current=x);return}!w.current&&g.current&&(g.current!==x&&g.current.remove(),g.current=null),w.current=!0,h.current!==c&&(o&&scrollTo(0,0),t.onRouteChange&&t.onRouteChange(n),h.current=c),t.onLoadEnd&&s.current&&t.onLoadEnd(n),s.current=!1},[c,o,e]),p.current?[R(ne,{r:a}),R(ne,{r:f})]:R(ne,{r:a})}const G=32,J=128,ne=({r:t})=>t.current;Je.Provider=K;K.ctx=qe({});const Se=qe({}),_e=t=>R(t.component,t),ct=()=>Be(K.ctx),Le=m.__e;m.__e=(t,e,r)=>{if(t&&t.then){let n=e;for(;n=n.__;)if(n.__c&&n.__c.__c)return e.__e==null&&(e.__e=r.__e,e.__k=r.__k),e.__k||(e.__k=[]),n.__c.__c(t,e)}Le&&Le(t,e,r)};function lt(){return d("section",{children:[d("h1",{children:"404: Not Found"}),d("p",{children:"It's gone :("})]})}const st=()=>d("div",{class:"flex w-full h-full justify-center items-center",children:d("h1",{class:"font-bold text-red-500 text-2xl",children:"nice try."})}),ut=()=>{const[t,e]=re(""),[r,n]=re({err:!0,referral:"",key:""}),[_,o]=re("...");$e(()=>{console.log("Referral:",t)},[t]);const c=async()=>{let h=await fetch("http://localhost:8080/entry",{method:"GET",headers:{referral:t}});if(!h.ok){console.error("Error:",h.status);return}let i=await h.json();if(i.err){console.error("Error:",i.referral),window.location.href="/error";return}console.log("Entry:",i),n(i),e("")},l=new Date("2025-01-01T00:00:00Z"),u=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"}).format(l),s=h=>{const i=new Date,a=h.getTime()-i.getTime(),f=Math.floor(a/(1e3*60*60*24)),g=Math.floor(a/(1e3*60*60)%24),w=Math.floor(a/(1e3*60)%60),y=Math.floor(a/1e3%60);let p="";return f>0&&(p+=f+"d "),g>0&&(p+=g+"h "),w>0&&(p+=w+"m "),y>0&&(p+=y+"s"),p===""?p="the time is upon us.":p+=" remaining.",p};return $e(()=>{const h=setInterval(()=>{o(s(l))},1e3);return()=>clearInterval(h)},[]),d("div",{class:"flex flex-col gap-6 w-full h-full justify-center items-center",children:[d("h1",{class:"text-6xl font-bold animate-pulse",children:"???"}),d("p",{children:_}),d("span",{children:[d("p",{class:"opacity-100 hover:opacity-75 transition-opacity",children:"Referral:"}),d("div",{class:"flex gap-2",children:[d("input",{type:"text",value:t,onInput:h=>e(h.currentTarget.value),class:"bg-black text-green-500 border-green-500 border-2 px-2 hover:bg-green-500 hover:text-black active:bg-green-500 active:text-black transition-colors"}),d("button",{onClick:async()=>await c(),class:"bg-green-500 text-black hover:bg-black hover:text-green-500 transition-colors px-4",children:"Submit"})]})]}),r.err?d("div",{class:"w-2/3 text-center flex flex-col gap-2",children:[d("div",{children:[d("b",{children:"What is this?"}),d("p",{children:["At exactly ",u," (00:00 CET on 1 Jan), the system will choose a random entry. Their referral key shall be publicly displayed on this page. The person associated with this referral key shall contact us with their private key. They shall win a little prize. To have one's entry weigh more than the rest, one shall have to spread their referral key amongst people. Every referral shall increase their chance of getting selected."]})]}),d("div",{children:[d("b",{children:"How does one enter?"}),d("p",{children:"One needs a referral key to enter."})]})]}):d("div",{class:"flex flex-col gap-1.5 mt-3 justify-center items-center",children:[d("p",{class:"text-green-700",children:"tip: click to copy."}),d("h2",{onClick:()=>navigator.clipboard.writeText(r==null?void 0:r.key),children:["Key: ",d("code",{class:"cursor-pointer bg-green-800 hover:bg-green-900 active:bg-green-700 transition-colors py-1 px-2 rounded-lg text-white",children:r==null?void 0:r.key})]}),d("h2",{onClick:()=>navigator.clipboard.writeText(r==null?void 0:r.referral),children:["Referral: ",d("code",{class:"cursor-pointer bg-green-800 hover:bg-green-900 active:bg-green-700 transition-colors py-1 px-2 rounded-lg text-white",children:r==null?void 0:r.referral})]}),d("p",{class:"text-green-700",children:"good luck. keep note of these, if you lose them, you can't reroll."})]})]})};function at(){return d(K,{children:d("div",{class:"bg-black text-green-500 h-screen p-4",children:d(Je,{children:[d(_e,{path:"/",component:ut}),d(_e,{default:!0,component:lt}),d(_e,{path:"/error",component:st})]})})})}et(d(at,{}),document.getElementById("app"));
|