phanpy-cz/assets/useTitle-KlNTnsJV.js
2024-07-22 20:23:01 +02:00

39 lines
121 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./polyfill-force-g5zrZgQH.js","./index-cp67bciK.js","./compose-z10cLv8p.js","./fuse-eCqHk9H3.js","./tinyld-light-PxOyhYWY.js"])))=>i.map(i=>d[i]);
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();"AbortSignal"in window&&(AbortSignal.timeout=AbortSignal.timeout||(e=>{const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal}));"URL"in window&&typeof URL.parse!="function"&&(URL.parse=function(e,t){if(!e)return null;try{return t?new URL(e,t):new URL(e)}catch{return null}});var ut,k,Un,ya,Te,qr,Fn,Vt,hr,Yt,Gt,zn,ot={},qn=[],_a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Dt=Array.isArray;function me(e,t){for(var r in t)e[r]=t[r];return e}function Hn(e){var t=e.parentNode;t&&t.removeChild(e)}function H(e,t,r){var n,o,a,i={};for(a in t)a=="key"?n=t[a]:a=="ref"?o=t[a]:i[a]=t[a];if(arguments.length>2&&(i.children=arguments.length>3?ut.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]===void 0&&(i[a]=e.defaultProps[a]);return tt(e,i,n,o,null)}function tt(e,t,r,n,o){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++Un,__i:-1,__u:0};return o==null&&k.vnode!=null&&k.vnode(a),a}function Wn(){return{current:null}}function ce(e){return e.children}function ue(e,t){this.props=e,this.context=t}function Ne(e,t){if(t==null)return e.__?Ne(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ne(e):null}function Kn(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Kn(e)}}function Jt(e){(!e.__d&&(e.__d=!0)&&Te.push(e)&&!yt.__r++||qr!==k.debounceRendering)&&((qr=k.debounceRendering)||Fn)(yt)}function yt(){var e,t,r,n,o,a,i,s;for(Te.sort(Vt);e=Te.shift();)e.__d&&(t=Te.length,n=void 0,a=(o=(r=e).__v).__e,i=[],s=[],r.__P&&((n=me({},o)).__v=o.__v+1,k.vnode&&k.vnode(n),pr(r.__P,n,o,r.__n,r.__P.namespaceURI,32&o.__u?[a]:null,i,a??Ne(o),!!(32&o.__u),s),n.__v=o.__v,n.__.__k[n.__i]=n,Yn(i,n,s),n.__e!=a&&Kn(n)),Te.length>t&&Te.sort(Vt));yt.__r=0}function Bn(e,t,r,n,o,a,i,s,l,c,d){var u,f,h,m,y,w=n&&n.__k||qn,g=t.length;for(r.__d=l,wa(r,t,w),l=r.__d,u=0;u<g;u++)(h=r.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(f=h.__i===-1?ot:w[h.__i]||ot,h.__i=u,pr(e,h,f,o,a,i,s,l,c,d),m=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&mr(f.ref,null,h),d.push(h.ref,h.__c||m,h)),y==null&&m!=null&&(y=m),65536&h.__u||f.__k===h.__k?(l&&typeof h.type=="string"&&!e.contains(l)&&(l=Ne(f)),l=Vn(h,l,e)):typeof h.type=="function"&&h.__d!==void 0?l=h.__d:m&&(l=m.nextSibling),h.__d=void 0,h.__u&=-196609);r.__d=l,r.__e=y}function wa(e,t,r){var n,o,a,i,s,l=t.length,c=r.length,d=c,u=0;for(e.__k=[],n=0;n<l;n++)i=n+u,(o=e.__k[n]=(o=t[n])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?tt(null,o,null,null,null):Dt(o)?tt(ce,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?tt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=ba(o,r,i,d),o.__i=s,a=null,s!==-1&&(d--,(a=r[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&u--,typeof o.type!="function"&&(o.__u|=65536)):s!==i&&(s==i-1?u=s-i:s==i+1?u++:s>i?d>l-i?u+=s-i:u--:s<i&&u++,s!==n+u&&(o.__u|=65536))):(a=r[i])&&a.key==null&&a.__e&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=Ne(a)),Zt(a,a,!1),r[i]=null,d--);if(d)for(n=0;n<c;n++)(a=r[n])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=Ne(a)),Zt(a,a))}function Vn(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=Vn(n[o],t,r));return t}e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function ve(e,t){return t=t||[],e==null||typeof e=="boolean"||(Dt(e)?e.some(function(r){ve(r,t)}):t.push(e)),t}function ba(e,t,r,n){var o=e.key,a=e.type,i=r-1,s=r+1,l=t[r];if(l===null||l&&o==l.key&&a===l.type&&!(131072&l.__u))return r;if(n>(l!=null&&!(131072&l.__u)?1:0))for(;i>=0||s<t.length;){if(i>=0){if((l=t[i])&&!(131072&l.__u)&&o==l.key&&a===l.type)return i;i--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&a===l.type)return s;s++}}return-1}function Hr(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||_a.test(t)?r:r+"px"}function ht(e,t,r,n,o){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Hr(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Hr(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r.u=n.u:(r.u=hr,e.addEventListener(t,a?Gt:Yt,a)):e.removeEventListener(t,a?Gt:Yt,a);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Wr(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=hr++;else if(t.t<r.u)return;return r(k.event?k.event(t):t)}}}function pr(e,t,r,n,o,a,i,s,l,c){var d,u,f,h,m,y,w,g,C,x,W,V,X,oe,ee,O,D=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[s=t.__e=r.__e]),(d=k.__b)&&d(t);e:if(typeof D=="function")try{if(g=t.props,C="prototype"in D&&D.prototype.render,x=(d=D.contextType)&&n[d.__c],W=d?x?x.props.value:d.__:n,r.__c?w=(u=t.__c=r.__c).__=u.__E:(C?t.__c=u=new D(g,W):(t.__c=u=new ue(g,W),u.constructor=D,u.render=Sa),x&&x.sub(u),u.props=g,u.state||(u.state={}),u.context=W,u.__n=n,f=u.__d=!0,u.__h=[],u._sb=[]),C&&u.__s==null&&(u.__s=u.state),C&&D.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=me({},u.__s)),me(u.__s,D.getDerivedStateFromProps(g,u.__s))),h=u.props,m=u.state,u.__v=t,f)C&&D.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),C&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(C&&D.getDerivedStateFromProps==null&&g!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,W),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,W)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=g,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(_){_&&(_.__=t)}),V=0;V<u._sb.length;V++)u.__h.push(u._sb[V]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,W),C&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,m,y)})}if(u.context=W,u.props=g,u.__P=e,u.__e=!1,X=k.__r,oe=0,C){for(u.state=u.__s,u.__d=!1,X&&X(t),d=u.render(u.props,u.state,u.context),ee=0;ee<u._sb.length;ee++)u.__h.push(u._sb[ee]);u._sb=[]}else do u.__d=!1,X&&X(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++oe<25);u.state=u.__s,u.getChildContext!=null&&(n=me(me({},n),u.getChildContext())),C&&!f&&u.getSnapshotBeforeUpdate!=null&&(y=u.getSnapshotBeforeUpdate(h,m)),Bn(e,Dt(O=d!=null&&d.type===ce&&d.key==null?d.props.children:d)?O:[O],t,r,n,o,a,i,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),w&&(u.__E=u.__=null)}catch(_){t.__v=null,l||a!=null?(t.__e=s,t.__u|=l?160:32,a[a.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),k.__e(_,t,r)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Ea(r.__e,t,r,n,o,a,i,l,c);(d=k.diffed)&&d(t)}function Yn(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)mr(r[n],r[++n],r[++n]);k.__c&&k.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){k.__e(a,o.__v)}})}function Ea(e,t,r,n,o,a,i,s,l){var c,d,u,f,h,m,y,w=r.props,g=t.props,C=t.type;if(C==="svg"?o="http://www.w3.org/2000/svg":C==="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((h=a[c])&&"setAttribute"in h==!!C&&(C?h.localName===C:h.nodeType===3)){e=h,a[c]=null;break}}if(e==null){if(C===null)return document.createTextNode(g);e=document.createElementNS(o,C,g.is&&g),a=null,s=!1}if(C===null)w===g||s&&e.data===g||(e.data=g);else{if(a=a&&ut.call(e.childNodes),w=r.props||ot,!s&&a!=null)for(w={},c=0;c<e.attributes.length;c++)w[(h=e.attributes[c]).name]=h.value;for(c in w)if(h=w[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(c!=="key"&&!(c in g)){if(c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g)continue;ht(e,c,null,h,o)}}for(c in g)h=g[c],c=="children"?f=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?m=h:c=="checked"?y=h:c==="key"||s&&typeof h!="function"||w[c]===h||ht(e,c,h,w[c],o);if(d)s||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),Bn(e,Dt(f)?f:[f],t,r,n,C==="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,i,a?a[0]:r.__k&&Ne(r,0),s,l),a!=null)for(c=a.length;c--;)a[c]!=null&&Hn(a[c]);s||(c="value",m!==void 0&&(m!==e[c]||C==="progress"&&!m||C==="option"&&m!==w[c])&&ht(e,c,m,w[c],o),c="checked",y!==void 0&&y!==e[c]&&ht(e,c,y,w[c],o))}return e}function mr(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){k.__e(n,r)}}function Zt(e,t,r){var n,o;if(k.unmount&&k.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||mr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){k.__e(a,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&Zt(n[o],t,r||typeof e.type!="function");r||e.__e==null||Hn(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Sa(e,t,r){return this.constructor(e,r)}function at(e,t,r){var n,o,a,i;k.__&&k.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,a=[],i=[],pr(t,e=(!n&&r||t).__k=H(ce,null,[e]),o||ot,ot,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?ut.call(t.childNodes):null,a,!n&&r?r:o?o.__e:t.firstChild,n,i),Yn(a,e,i)}function Gn(e,t){at(e,t,Gn)}function Ca(e,t,r){var n,o,a,i,s=me({},e.props);for(a in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)a=="key"?n=t[a]:a=="ref"?o=t[a]:s[a]=t[a]===void 0&&i!==void 0?i[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?ut.call(arguments,2):r),tt(e.type,s,n||e.key,o||e.ref,null)}function Pe(e,t){var r={__c:t="__cC"+zn++,__:e,Consumer:function(n,o){return n.children(o)},Provider:function(n){var o,a;return this.getChildContext||(o=[],(a={})[t]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&o.some(function(s){s.__e=!0,Jt(s)})},this.sub=function(i){o.push(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){o&&o.splice(o.indexOf(i),1),s&&s.call(i)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}ut=qn.slice,k={__e:function(e,t,r,n){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),i=o.__d),i)return o.__E=o}catch(s){e=s}throw e}},Un=0,ya=function(e){return e!=null&&e.constructor==null},ue.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=me({},this.state),typeof e=="function"&&(e=e(me({},r),this.props)),e&&me(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Jt(this))},ue.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jt(this))},ue.prototype.render=ce,Te=[],Fn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vt=function(e,t){return e.__v.__b-t.__v.__b},yt.__r=0,hr=0,Yt=Wr(!1),Gt=Wr(!0),zn=0;var ge,K,Ut,Kr,We=0,Jn=[],B=k,Br=B.__b,Vr=B.__r,Yr=B.diffed,Gr=B.__c,Jr=B.unmount,Zr=B.__;function Ie(e,t){B.__h&&B.__h(K,e,We||t),We=0;var r=K.__H||(K.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function $e(e){return We=1,Lt(Zn,e)}function Lt(e,t,r){var n=Ie(ge++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Zn(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=K,!K.u)){var o=function(s,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!a||a.call(this,s,l,c);var u=!1;return d.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(u=!0)}}),!(!u&&n.__c.props===s)&&(!a||a.call(this,s,l,c))};K.u=!0;var a=K.shouldComponentUpdate,i=K.componentWillUpdate;K.componentWillUpdate=function(s,l,c){if(this.__e){var d=a;a=void 0,o(s,l,c),a=d}i&&i.call(this,s,l,c)},K.shouldComponentUpdate=o}return n.__N||n.__}function Ae(e,t){var r=Ie(ge++,3);!B.__s&&yr(r.__H,t)&&(r.__=e,r.i=t,K.__H.__h.push(r))}function Re(e,t){var r=Ie(ge++,4);!B.__s&&yr(r.__H,t)&&(r.__=e,r.i=t,K.__h.push(r))}function ye(e){return We=5,_e(function(){return{current:e}},[])}function vr(e,t,r){We=6,Re(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function _e(e,t){var r=Ie(ge++,7);return yr(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Be(e,t){return We=8,_e(function(){return e},t)}function re(e){var t=K.context[e.__c],r=Ie(ge++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(K)),t.props.value):e.__}function Nt(e,t){B.useDebugValue&&B.useDebugValue(t?t(e):e)}function Pa(e){var t=Ie(ge++,10),r=$e();return t.__=e,K.componentDidCatch||(K.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function gr(){var e=Ie(ge++,11);if(!e.__){for(var t=K.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Aa(){for(var e;e=Jn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(vt),e.__H.__h.forEach(Qt),e.__H.__h=[]}catch(t){e.__H.__h=[],B.__e(t,e.__v)}}B.__b=function(e){K=null,Br&&Br(e)},B.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Zr&&Zr(e,t)},B.__r=function(e){Vr&&Vr(e),ge=0;var t=(K=e.__c).__H;t&&(Ut===K?(t.__h=[],K.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(vt),t.__h.forEach(Qt),t.__h=[],ge=0)),Ut=K},B.diffed=function(e){Yr&&Yr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Jn.push(t)!==1&&Kr===B.requestAnimationFrame||((Kr=B.requestAnimationFrame)||Ra)(Aa)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Ut=K=null},B.__c=function(e,t){t.some(function(r){try{r.__h.forEach(vt),r.__h=r.__h.filter(function(n){return!n.__||Qt(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],B.__e(n,r.__v)}}),Gr&&Gr(e,t)},B.unmount=function(e){Jr&&Jr(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{vt(n)}catch(o){t=o}}),r.__H=void 0,t&&B.__e(t,r.__v))};var Qr=typeof requestAnimationFrame=="function";function Ra(e){var t,r=function(){clearTimeout(n),Qr&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Qr&&(t=requestAnimationFrame(r))}function vt(e){var t=K,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),K=t}function Qt(e){var t=K;e.__c=e.__(),K=t}function yr(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Zn(e,t){return typeof t=="function"?t(e):t}function Qn(e,t){for(var r in t)e[r]=t[r];return e}function Xt(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function _t(e,t){this.props=e,this.context=t}function Xn(e,t){function r(o){var a=this.props.ref,i=a==o.ref;return!i&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!i:Xt(this.props,o)}function n(o){return this.shouldComponentUpdate=r,H(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(_t.prototype=new ue).isPureReactComponent=!0,_t.prototype.shouldComponentUpdate=function(e,t){return Xt(this.props,e)||Xt(this.state,t)};var Xr=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Xr&&Xr(e)};var xa=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function eo(e){function t(r){var n=Qn({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=xa,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var en=function(e,t){return e==null?null:ve(ve(e).map(t))},_r={map:en,forEach:en,count:function(e){return e?ve(e).length:0},only:function(e){var t=ve(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ve},Oa=k.__e;k.__e=function(e,t,r,n){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Oa(e,t,r,n)};var tn=k.unmount;function to(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Qn({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return to(n,t,r)})),e}function ro(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return ro(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function rt(){this.__u=0,this.t=null,this.__b=null}function no(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function oo(e){var t,r,n;function o(a){if(t||(t=e()).then(function(i){r=i.default||i},function(i){n=i}),n)throw n;if(!r)throw t;return H(r,a)}return o.displayName="Lazy",o.__f=!0,o}function qe(){this.u=null,this.o=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),tn&&tn(e)},(rt.prototype=new ue).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=no(n.__v),a=!1,i=function(){a||(a=!0,r.__R=null,o?o(s):s())};r.__R=i;var s=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=ro(l,l.__c.__P,l.__c.__O)}var c;for(n.setState({__a:n.__b=null});c=n.t.pop();)c.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(i,i)},rt.prototype.componentWillUnmount=function(){this.t=[]},rt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=to(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&H(ce,null,e.fallback);return o&&(o.__u&=-33),[H(ce,null,t.__a?null:e.children),o]};var rn=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function Ta(e){return this.getChildContext=function(){return e.context},e.children}function Da(e){var t=this,r=e.i;t.componentWillUnmount=function(){at(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],contains:function(){return!0},appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:function(n,o){this.childNodes.push(n),t.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n)}}),at(H(Ta,{context:t.context},e.__v),t.l)}function ao(e,t){var r=H(Da,{__v:e,i:t});return r.containerInfo=t,r}(qe.prototype=new ue).__a=function(e){var t=this,r=no(t.__v),n=t.o.get(e);return n[0]++,function(o){var a=function(){t.props.revealOrder?(n.push(o),rn(t,e,n)):o()};r?r(a):a()}},qe.prototype.render=function(e){this.u=null,this.o=new Map;var t=ve(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},qe.prototype.componentDidUpdate=qe.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){rn(e,r,t)})};var io=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,La=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Na=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ma=/[A-Z0-9]/g,ja=typeof document<"u",Ia=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function so(e,t,r){return t.__k==null&&(t.textContent=""),at(e,t),typeof r=="function"&&r(),e?e.__c:null}function uo(e,t,r){return Gn(e,t),typeof r=="function"&&r(),e?e.__c:null}ue.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ue.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var nn=k.event;function $a(){}function ka(){return this.cancelBubble}function Ua(){return this.defaultPrevented}k.event=function(e){return nn&&(e=nn(e)),e.persist=$a,e.isPropagationStopped=ka,e.isDefaultPrevented=Ua,e.nativeEvent=e};var wr,Fa={enumerable:!1,configurable:!0,get:function(){return this.class}},on=k.vnode;k.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={};for(var a in r){var i=r[a];if(!(a==="value"&&"defaultValue"in r&&i==null||ja&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&i===!0?i="":s==="translate"&&i==="no"?i=!1:s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||Ia(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Na.test(a)?a=s:n.indexOf("-")===-1&&La.test(a)?a=a.replace(Ma,"-$&").toLowerCase():i===null&&(i=void 0):s=a="oninput",s==="oninput"&&o[a=s]&&(a="oninputCapture"),o[a]=i}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=ve(r.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=ve(r.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",Fa)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=io,on&&on(e)};var an=k.__r;k.__r=function(e){an&&an(e),wr=e.__c};var sn=k.diffed;k.diffed=function(e){sn&&sn(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),wr=null};var lo={ReactCurrentDispatcher:{current:{readContext:function(e){return wr.__n[e.__c].props.value},useCallback:Be,useContext:re,useDebugValue:Nt,useDeferredValue:Er,useEffect:Ae,useId:gr,useImperativeHandle:vr,useInsertionEffect:Cr,useLayoutEffect:Re,useMemo:_e,useReducer:Lt,useRef:ye,useState:$e,useSyncExternalStore:Pr,useTransition:Sr}}},za="17.0.2";function co(e){return H.bind(null,e)}function Ve(e){return!!e&&e.$$typeof===io}function fo(e){return Ve(e)&&e.type===ce}function ho(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function po(e){return Ve(e)?Ca.apply(null,arguments):e}function mo(e){return!!e.__k&&(at(null,e),!0)}function vo(e){return e&&(e.base||e.nodeType===1&&e)||null}var go=function(e,t){return e(t)},yo=function(e,t){return e(t)},_o=ce;function br(e){e()}function Er(e){return e}function Sr(){return[!1,br]}var Cr=Re,wo=Ve;function Pr(e,t){var r=t(),n=$e({h:{__:r,v:t}}),o=n[0].h,a=n[1];return Re(function(){o.__=r,o.v=t,Ft(o)&&a({h:o})},[e,r,t]),Ae(function(){return Ft(o)&&a({h:o}),e(function(){Ft(o)&&a({h:o})})},[e]),r}function Ft(e){var t,r,n=e.v,o=e.__;try{var a=n();return!((t=o)===(r=a)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}var bo={useState:$e,useId:gr,useReducer:Lt,useEffect:Ae,useLayoutEffect:Re,useInsertionEffect:Cr,useTransition:Sr,useDeferredValue:Er,useSyncExternalStore:Pr,startTransition:br,useRef:ye,useImperativeHandle:vr,useMemo:_e,useCallback:Be,useContext:re,useDebugValue:Nt,version:"17.0.2",Children:_r,render:so,hydrate:uo,unmountComponentAtNode:mo,createPortal:ao,createElement:H,createContext:Pe,createFactory:co,cloneElement:po,createRef:Wn,Fragment:ce,isValidElement:Ve,isElement:wo,isFragment:fo,isMemo:ho,findDOMNode:vo,Component:ue,PureComponent:_t,memo:Xn,forwardRef:eo,flushSync:yo,unstable_batchedUpdates:go,StrictMode:_o,Suspense:rt,SuspenseList:qe,lazy:oo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:lo};const wt=Object.freeze(Object.defineProperty({__proto__:null,Children:_r,Component:ue,Fragment:ce,PureComponent:_t,StrictMode:_o,Suspense:rt,SuspenseList:qe,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:lo,cloneElement:po,createContext:Pe,createElement:H,createFactory:co,createPortal:ao,createRef:Wn,default:bo,findDOMNode:vo,flushSync:yo,forwardRef:eo,hydrate:uo,isElement:wo,isFragment:fo,isMemo:ho,isValidElement:Ve,lazy:oo,memo:Xn,render:so,startTransition:br,unmountComponentAtNode:mo,unstable_batchedUpdates:go,useCallback:Be,useContext:re,useDebugValue:Nt,useDeferredValue:Er,useEffect:Ae,useErrorBoundary:Pa,useId:gr,useImperativeHandle:vr,useInsertionEffect:Cr,useLayoutEffect:Re,useMemo:_e,useReducer:Lt,useRef:ye,useState:$e,useSyncExternalStore:Pr,useTransition:Sr,version:za},Symbol.toStringTag,{value:"Module"}));/**
* @remix-run/router v1.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bt.apply(this,arguments)}var Ce;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ce||(Ce={}));const un="popstate";function qa(e){e===void 0&&(e={});function t(o,a){let{pathname:i="/",search:s="",hash:l=""}=ke(o.location.hash.substr(1));return er("",{pathname:i,search:s,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(o,a){let i=o.document.querySelector("base"),s="";if(i&&i.getAttribute("href")){let l=o.location.href,c=l.indexOf("#");s=c===-1?l:l.slice(0,c)}return s+"#"+(typeof a=="string"?a:Ar(a))}function n(o,a){Ha(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return Ba(t,r,n,e)}function Q(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ha(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Wa(){return Math.random().toString(36).substr(2,8)}function ln(e){return{usr:e.state,key:e.key}}function er(e,t,r,n){return r===void 0&&(r=null),bt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ke(t):t,{state:r,key:t&&t.key||n||Wa()})}function Ar(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ke(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ka(e){let t=typeof window<"u"&&typeof window.location<"u"&&window.location.origin!=="null"?window.location.origin:window.location.href,r=typeof e=="string"?e:Ar(e);return Q(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}function Ba(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,s=Ce.Pop,l=null;function c(){s=Ce.Pop,l&&l({action:s,location:f.location})}function d(h,m){s=Ce.Push;let y=er(f.location,h,m);r&&r(y,h);let w=ln(y),g=f.createHref(y);try{i.pushState(w,"",g)}catch{o.location.assign(g)}a&&l&&l({action:s,location:f.location})}function u(h,m){s=Ce.Replace;let y=er(f.location,h,m);r&&r(y,h);let w=ln(y),g=f.createHref(y);i.replaceState(w,"",g),a&&l&&l({action:s,location:f.location})}let f={get action(){return s},get location(){return e(o,i)},listen(h){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(un,c),l=h,()=>{o.removeEventListener(un,c),l=null}},createHref(h){return t(o,h)},encodeLocation(h){let m=Ka(typeof h=="string"?h:Ar(h));return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:u,go(h){return i.go(h)}};return f}var cn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(cn||(cn={}));function Va(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ke(t):t,o=Co(n.pathname||"/",r);if(o==null)return null;let a=Eo(e);Ya(a);let i=null;for(let s=0;i==null&&s<a.length;++s)i=ni(a[s],ai(o));return i}function Eo(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let o=(a,i,s)=>{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};l.relativePath.startsWith("/")&&(Q(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=De([n,l.relativePath]),d=r.concat(l);a.children&&a.children.length>0&&(Q(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Eo(a.children,t,d,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:ti(c,a.index),routesMeta:d})};return e.forEach((a,i)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))o(a,i);else for(let l of So(a.path))o(a,i,l)}),t}function So(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let i=So(n.join("/")),s=[];return s.push(...i.map(l=>l===""?a:[a,l].join("/"))),o&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Ya(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ri(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Ga=/^:\w+$/,Ja=3,Za=2,Qa=1,Xa=10,ei=-2,fn=e=>e==="*";function ti(e,t){let r=e.split("/"),n=r.length;return r.some(fn)&&(n+=ei),t&&(n+=Za),r.filter(o=>!fn(o)).reduce((o,a)=>o+(Ga.test(a)?Ja:a===""?Qa:Xa),n)}function ri(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function ni(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let i=0;i<r.length;++i){let s=r[i],l=i===r.length-1,c=o==="/"?t:t.slice(o.length)||"/",d=tr({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},c);if(!d)return null;Object.assign(n,d.params);let u=s.route;a.push({params:n,pathname:De([o,d.pathname]),pathnameBase:fi(De([o,d.pathnameBase])),route:u}),d.pathnameBase!=="/"&&(o=De([o,d.pathnameBase]))}return a}function tr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=oi(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:n.reduce((c,d,u)=>{if(d==="*"){let f=s[u]||"";i=a.slice(0,a.length-f.length).replace(/(.)\/+$/,"$1")}return c[d]=ii(s[u]||"",d),c},{}),pathname:a,pathnameBase:i,pattern:e}}function oi(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Rr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(i,s)=>(n.push(s),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function ai(e){try{return decodeURI(e)}catch(t){return Rr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ii(e,t){try{return decodeURIComponent(e)}catch(r){return Rr(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Co(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function Rr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function si(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?ke(e):e;return{pathname:r?r.startsWith("/")?r:ui(r,t):t,search:di(n),hash:hi(o)}}function ui(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function zt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function li(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ci(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=ke(e):(o=bt({},e),Q(!o.pathname||!o.pathname.includes("?"),zt("?","pathname","search",o)),Q(!o.pathname||!o.pathname.includes("#"),zt("#","pathname","hash",o)),Q(!o.search||!o.search.includes("#"),zt("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,s;if(n||i==null)s=r;else{let u=t.length-1;if(i.startsWith("..")){let f=i.split("/");for(;f[0]==="..";)f.shift(),u-=1;o.pathname=f.join("/")}s=u>=0?t[u]:"/"}let l=si(o,s),c=i&&i!=="/"&&i.endsWith("/"),d=(a||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const De=e=>e.join("/").replace(/\/\/+/g,"/"),fi=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),di=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hi=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class pi{constructor(t,r,n,o){o===void 0&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function mi(e){return e instanceof pi}const Po=["post","put","patch","delete"],Sl=new Set(Po),vi=["get",...Po],Cl=new Set(vi);const Pl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";/**
* React Router v6.6.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function rr(){return rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rr.apply(this,arguments)}function gi(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const yi=typeof Object.is=="function"?Object.is:gi,{useState:_i,useEffect:wi,useLayoutEffect:bi,useDebugValue:Ei}=wt;function Si(e,t,r){const n=t(),[{inst:o},a]=_i({inst:{value:n,getSnapshot:t}});return bi(()=>{o.value=n,o.getSnapshot=t,qt(o)&&a({inst:o})},[e,n,t]),wi(()=>(qt(o)&&a({inst:o}),e(()=>{qt(o)&&a({inst:o})})),[e]),Ei(n),n}function qt(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!yi(r,n)}catch{return!0}}function Ci(e,t,r){return t()}const Pi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ai=!Pi,Ri=Ai?Ci:Si,Al="useSyncExternalStore"in wt?(e=>e.useSyncExternalStore)(wt):Ri,Ao=Pe(null),Ro=Pe(null);const xr=Pe(null),Mt=Pe(null),Ye=Pe({outlet:null,matches:[]}),xo=Pe(null);function jt(){return re(Mt)!=null}function Or(){return jt()||Q(!1),re(Mt).location}function xi(){jt()||Q(!1);let{basename:e,navigator:t}=re(xr),{matches:r}=re(Ye),{pathname:n}=Or(),o=JSON.stringify(li(r).map(s=>s.pathnameBase)),a=ye(!1);return Ae(()=>{a.current=!0}),Be(function(s,l){if(l===void 0&&(l={}),!a.current)return;if(typeof s=="number"){t.go(s);return}let c=ci(s,JSON.parse(o),n,l.relative==="path");e!=="/"&&(c.pathname=c.pathname==="/"?e:De([e,c.pathname])),(l.replace?t.replace:t.push)(c,l.state,l)},[e,t,o,n])}function Rl(){let{matches:e}=re(Ye),t=e[e.length-1];return t?t.params:{}}function Oi(e,t){jt()||Q(!1);let{navigator:r}=re(xr),n=re(Ro),{matches:o}=re(Ye),a=o[o.length-1],i=a?a.params:{},s=a?a.pathname:"/",l=a?a.pathnameBase:"/",c=a&&a.route,d=Or(),u;if(t){var f;let g=typeof t=="string"?ke(t):t;l==="/"||(f=g.pathname)!=null&&f.startsWith(l)||Q(!1),u=g}else u=d;let h=u.pathname||"/",m=l==="/"?h:h.slice(l.length)||"/",y=Va(e,{pathname:m}),w=Ni(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},i,g.params),pathname:De([l,r.encodeLocation?r.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:De([l,r.encodeLocation?r.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n||void 0);return t&&w?H(Mt.Provider,{value:{location:rr({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Ce.Pop}},w):w}function Ti(){let e=$i(),t=mi(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n};return H(ce,null,H("h2",null,"Unhandled Thrown Error!"),H("h3",{style:{fontStyle:"italic"}},t),r?H("pre",{style:o},r):null,H("p",null,"💿 Hey developer 👋"),H("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",H("code",{style:a},"errorElement")," props on ",H("code",{style:a},"<Route>")))}class Di extends ue{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location?{error:t.error,location:t.location}:{error:t.error||r.error,location:r.location}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?H(Ye.Provider,{value:this.props.routeContext},H(xo.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Li(e){let{routeContext:t,match:r,children:n}=e,o=re(Ao);return o&&o.static&&o.staticContext&&r.route.errorElement&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),H(Ye.Provider,{value:t},n)}function Ni(e,t,r){if(t===void 0&&(t=[]),e==null)if(r!=null&&r.errors)e=r.matches;else return null;let n=e,o=r==null?void 0:r.errors;if(o!=null){let a=n.findIndex(i=>i.route.id&&(o==null?void 0:o[i.route.id]));a>=0||Q(!1),n=n.slice(0,Math.min(n.length,a+1))}return n.reduceRight((a,i,s)=>{let l=i.route.id?o==null?void 0:o[i.route.id]:null,c=r?i.route.errorElement||H(Ti,null):null,d=t.concat(n.slice(0,s+1)),u=()=>H(Li,{match:i,routeContext:{outlet:a,matches:d}},l?c:i.route.element!==void 0?i.route.element:a);return r&&(i.route.errorElement||s===0)?H(Di,{location:r.location,component:c,error:l,children:u(),routeContext:{outlet:null,matches:d}}):u()},null)}var dn;(function(e){e.UseRevalidator="useRevalidator"})(dn||(dn={}));var Et;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(Et||(Et={}));function Mi(e){let t=re(Ro);return t||Q(!1),t}function ji(e){let t=re(Ye);return t||Q(!1),t}function Ii(e){let t=ji(e),r=t.matches[t.matches.length-1];return r.route.id||Q(!1),r.route.id}function $i(){var e;let t=re(xo),r=Mi(Et.UseRouteError),n=Ii(Et.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function ki(e){Q(!1)}function Ui(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Ce.Pop,navigator:a,static:i=!1}=e;jt()&&Q(!1);let s=t.replace(/^\/*/,"/"),l=_e(()=>({basename:s,navigator:a,static:i}),[s,a,i]);typeof n=="string"&&(n=ke(n));let{pathname:c="/",search:d="",hash:u="",state:f=null,key:h="default"}=n,m=_e(()=>{let y=Co(c,s);return y==null?null:{pathname:y,search:d,hash:u,state:f,key:h}},[s,c,d,u,f,h]);return m==null?null:H(xr.Provider,{value:l},H(Mt.Provider,{children:r,value:{location:m,navigationType:o}}))}function xl(e){let{children:t,location:r}=e,n=re(Ao),o=n&&!t?n.router.routes:nr(t);return Oi(o,r)}var hn;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(hn||(hn={}));const Ol=new Promise(()=>{});function nr(e,t){t===void 0&&(t=[]);let r=[];return _r.forEach(e,(n,o)=>{if(!Ve(n))return;if(n.type===ce){r.push.apply(r,nr(n.props.children,t));return}n.type!==ki&&Q(!1),!n.props.index||!n.props.children||Q(!1);let a=[...t,o],i={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,hasErrorBoundary:n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle};n.props.children&&(i.children=nr(n.props.children,a)),r.push(i)}),r}/**
* React Router DOM v6.6.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function or(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Fi(e,t){let r=or(e);for(let n of t.keys())r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)});return r}function Tl(e){let{basename:t,children:r,window:n}=e,o=ye();o.current==null&&(o.current=qa({window:n,v5Compat:!0}));let a=o.current,[i,s]=$e({action:a.action,location:a.location});return Re(()=>a.listen(s),[a]),H(Ui,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:a})}var pn;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(pn||(pn={}));var mn;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mn||(mn={}));function Dl(e){let t=ye(or(e)),r=Or(),n=_e(()=>Fi(r.search,t.current),[r.search]),o=xi(),a=Be((i,s)=>{const l=or(typeof i=="function"?i(n):i);o("?"+l,s)},[o,n]);return[n,a]}const zi=Symbol(),Tr=Symbol(),Ze="a",nt="w";let qi=(e,t)=>new Proxy(e,t);const ar=Object.getPrototypeOf,ir=new WeakMap,Oo=e=>e&&(ir.has(e)?ir.get(e):ar(e)===Object.prototype||ar(e)===Array.prototype),St=e=>typeof e=="object"&&e!==null,Hi=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(r=>{r.configurable=!0}),Object.create(ar(e),t)},Dr=e=>e[Tr]||e,To=(e,t,r,n)=>{if(!Oo(e))return e;let o=n&&n.get(e);if(!o){const l=Dr(e);o=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(d=>!d.configurable&&!d.writable))(l)?[l,Hi(l)]:[l],n==null||n.set(e,o)}const[a,i]=o;let s=r&&r.get(a);return s&&s[1].f===!!i||(s=((l,c)=>{const d={f:c};let u=!1;const f=(m,y)=>{if(!u){let w=d[Ze].get(l);if(w||(w={},d[Ze].set(l,w)),m===nt)w[nt]=!0;else{let g=w[m];g||(g=new Set,w[m]=g),g.add(y)}}},h={get:(m,y)=>y===Tr?l:(f("k",y),To(Reflect.get(m,y),d[Ze],d.c,d.t)),has:(m,y)=>y===zi?(u=!0,d[Ze].delete(l),!0):(f("h",y),Reflect.has(m,y)),getOwnPropertyDescriptor:(m,y)=>(f("o",y),Reflect.getOwnPropertyDescriptor(m,y)),ownKeys:m=>(f(nt),Reflect.ownKeys(m))};return c&&(h.set=h.deleteProperty=()=>!1),[h,d]})(a,!!i),s[1].p=qi(i||a,s[0]),r&&r.set(a,s)),s[1][Ze]=t,s[1].c=r,s[1].t=n,s[1].p},Do=(e,t,r,n,o=Object.is)=>{if(o(e,t))return!1;if(!St(e)||!St(t))return!0;const a=r.get(Dr(e));if(!a)return!0;if(n){const s=n.get(e);if(s&&s.n===t)return s.g;n.set(e,{n:t,g:!1})}let i=null;try{for(const s of a.h||[])if(i=Reflect.has(e,s)!==Reflect.has(t,s),i)return i;if(a[nt]===!0){if(i=((s,l)=>{const c=Reflect.ownKeys(s),d=Reflect.ownKeys(l);return c.length!==d.length||c.some((u,f)=>u!==d[f])})(e,t),i)return i}else for(const s of a.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,s)!=!!Reflect.getOwnPropertyDescriptor(t,s),i)return i;for(const s of a.k||[])if(i=Do(e[s],t[s],r,n,o),i)return i;return i===null&&(i=!0),i}finally{n&&n.set(e,{n:t,g:i})}};const Wi=e=>Oo(e)&&e[Tr]||null,vn=(e,t=!0)=>{ir.set(e,t)},Ki=(e,t,r)=>{const n=[],o=new WeakSet,a=(i,s)=>{if(o.has(i))return;St(i)&&o.add(i);const l=St(i)&&t.get(Dr(i));if(l){var c,d;if((c=l.h)==null||c.forEach(f=>{const h=`:has(${String(f)})`;n.push(s?[...s,h]:[h])}),l[nt]===!0){const f=":ownKeys";n.push(s?[...s,f]:[f])}else{var u;(u=l.o)==null||u.forEach(f=>{const h=`:hasOwn(${String(f)})`;n.push(s?[...s,h]:[h])})}(d=l.k)==null||d.forEach(f=>{r&&!("value"in(Object.getOwnPropertyDescriptor(i,f)||{}))||a(i[f],s?[...s,f]:[f])})}else s&&n.push(s)};return a(e),n};var Ct={PHANPY_CLIENT_NAME:"Phanpy",PHANPY_WEBSITE:"https://phanpy.social",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",VITE_APP_ENV:"production",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ht=e=>typeof e=="object"&&e!==null,Ee=new WeakMap,pt=new WeakSet,Bi=(e=Object.is,t=(c,d)=>new Proxy(c,d),r=c=>Ht(c)&&!pt.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),n=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},o=new WeakMap,a=(c,d,u=n)=>{const f=o.get(c);if((f==null?void 0:f[0])===d)return f[1];const h=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return vn(h,!0),o.set(c,[d,h]),Reflect.ownKeys(c).forEach(m=>{if(Object.getOwnPropertyDescriptor(h,m))return;const y=Reflect.get(c,m),{enumerable:w}=Reflect.getOwnPropertyDescriptor(c,m),g={value:y,enumerable:w,configurable:!0};if(pt.has(y))vn(y,!1);else if(y instanceof Promise)delete g.value,g.get=()=>u(y);else if(Ee.has(y)){const[C,x]=Ee.get(y);g.value=a(C,x(),u)}Object.defineProperty(h,m,g)}),Object.preventExtensions(h)},i=new WeakMap,s=[1,1],l=c=>{if(!Ht(c))throw new Error("object required");const d=i.get(c);if(d)return d;let u=s[0];const f=new Set,h=(O,D=++s[0])=>{u!==D&&(u=D,f.forEach(_=>_(O,D)))};let m=s[1];const y=(O=++s[1])=>(m!==O&&!f.size&&(m=O,g.forEach(([D])=>{const _=D[1](O);_>u&&(u=_)})),u),w=O=>(D,_)=>{const A=[...D];A[1]=[O,...A[1]],h(A,_)},g=new Map,C=(O,D)=>{if((Ct?"production":void 0)!=="production"&&g.has(O))throw new Error("prop listener already exists");if(f.size){const _=D[3](w(O));g.set(O,[D,_])}else g.set(O,[D])},x=O=>{var D;const _=g.get(O);_&&(g.delete(O),(D=_[1])==null||D.call(_))},W=O=>(f.add(O),f.size===1&&g.forEach(([_,A],M)=>{if((Ct?"production":void 0)!=="production"&&A)throw new Error("remove already exists");const L=_[3](w(M));g.set(M,[_,L])}),()=>{f.delete(O),f.size===0&&g.forEach(([_,A],M)=>{A&&(A(),g.set(M,[_]))})}),V=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),oe=t(V,{deleteProperty(O,D){const _=Reflect.get(O,D);x(D);const A=Reflect.deleteProperty(O,D);return A&&h(["delete",[D],_]),A},set(O,D,_,A){const M=Reflect.has(O,D),L=Reflect.get(O,D,A);if(M&&(e(L,_)||i.has(_)&&e(L,i.get(_))))return!0;x(D),Ht(_)&&(_=Wi(_)||_);let T=_;if(_ instanceof Promise)_.then($=>{_.status="fulfilled",_.value=$,h(["resolve",[D],$])}).catch($=>{_.status="rejected",_.reason=$,h(["reject",[D],$])});else{!Ee.has(_)&&r(_)&&(T=l(_));const $=!pt.has(T)&&Ee.get(T);$&&C(D,$)}return Reflect.set(O,D,T,A),h(["set",[D],_,L]),!0}});i.set(c,oe);const ee=[V,y,a,W];return Ee.set(oe,ee),Reflect.ownKeys(c).forEach(O=>{const D=Object.getOwnPropertyDescriptor(c,O);"value"in D&&(oe[O]=c[O],delete D.value,delete D.writable),Object.defineProperty(V,O,D)}),oe})=>[l,Ee,pt,e,t,r,n,o,a,i,s],[Vi]=Bi();function Yi(e={}){return Vi(e)}function Lr(e,t,r){const n=Ee.get(e);(Ct?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let o;const a=[],i=n[3];let s=!1;const c=i(d=>{if(a.push(d),r){t(a.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,s&&t(a.splice(0))}))});return s=!0,()=>{s=!1,c()}}function sr(e,t){const r=Ee.get(e);(Ct?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,o,a]=r;return a(n,o(),t)}var Nr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Gi(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var Mr={exports:{}},No={};const Ji=Gi(wt);/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ke=Ji;function Zi(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qi=typeof Object.is=="function"?Object.is:Zi,Xi=Ke.useState,es=Ke.useEffect,ts=Ke.useLayoutEffect,rs=Ke.useDebugValue;function ns(e,t){var r=t(),n=Xi({inst:{value:r,getSnapshot:t}}),o=n[0].inst,a=n[1];return ts(function(){o.value=r,o.getSnapshot=t,Wt(o)&&a({inst:o})},[e,r,t]),es(function(){return Wt(o)&&a({inst:o}),e(function(){Wt(o)&&a({inst:o})})},[e]),rs(r),r}function Wt(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Qi(e,r)}catch{return!0}}function os(e,t){return t()}var as=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?os:ns,Ll=No.useSyncExternalStore=Ke.useSyncExternalStore!==void 0?Ke.useSyncExternalStore:as,Nl=Mr.exports;Mr.exports=No;var is=Mr.exports;const ss=Lo(is);var us={PHANPY_CLIENT_NAME:"Phanpy",PHANPY_WEBSITE:"https://phanpy.social",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",VITE_APP_ENV:"production",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{use:gn}=bo,{useSyncExternalStore:ls}=ss,cs=(e,t)=>{const r=ye();Ae(()=>{r.current=Ki(e,t,!0)}),Nt(r.current)},fs=new WeakMap;function Ml(e,t){const r=t==null?void 0:t.sync,n=ye(),o=ye();let a=!0;const i=ls(Be(c=>{const d=Lr(e,c,r);return c(),d},[e,r]),()=>{const c=sr(e,gn);try{if(!a&&n.current&&o.current&&!Do(n.current,c,o.current,new WeakMap))return n.current}catch{}return c},()=>sr(e,gn));a=!1;const s=new WeakMap;Ae(()=>{n.current=i,o.current=s}),(us?"production":void 0)!=="production"&&cs(i,s);const l=_e(()=>new WeakMap,[]);return To(i,s,l,fs)}var ds=0,jl=Array.isArray;function Pt(e,t,r,n,o,a){t||(t={});var i,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?i=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ds,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(s in i)l[s]===void 0&&(l[s]=i[s]);return k.vnode&&k.vnode(c),c}function hs(e,t){var r=Object.setPrototypeOf;r?r(e,t):e.__proto__=t}function ps(e,t){t===void 0&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}var ms=function(){var e=function(r,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(o[i]=a[i])},e(r,n)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ge=function(e){ms(t,e);function t(r,n){var o=this.constructor,a=e.call(this,r,n)||this;return Object.defineProperty(a,"name",{value:o.name,enumerable:!1,configurable:!0}),hs(a,o.prototype),ps(a),a}return t}(Error);var ze=null;typeof WebSocket<"u"?ze=WebSocket:typeof MozWebSocket<"u"?ze=MozWebSocket:typeof global<"u"?ze=global.WebSocket||global.MozWebSocket:typeof window<"u"?ze=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ze=self.WebSocket||self.MozWebSocket);const jr=ze;function vs(){let e,t;const r=new Promise((...n)=>[e,t]=n);return Object.freeze({resolve:e,reject:t,promise:r})}function gs(e,t){const r=[],n=[],o=e((...d)=>{const u=n.shift();u?u.resolve({value:d,done:!1}):r.push(d)}),a=t==null?void 0:t.signal;let i=!1,s=null;const l=()=>{s=new Error("Abort Error")},c=()=>{o==null||o(),a==null||a.removeEventListener("abort",l)};return a==null||a.addEventListener("abort",l,{once:!0}),{async next(){const d=r.shift();if(d)return{value:d,done:!1};if(i)return{value:void 0,done:!0};if(s)return Promise.reject(s);const u=vs();return n.push(u),u.promise},async return(){i=!0,c();for(const d of n)d.resolve({value:void 0,done:!0});return{value:void 0,done:!0}},async throw(d){return s=d,c(),{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}var ur=function(e,t){return ur=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},ur(e,t)};function ys(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ur(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Me=function(){return Me=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Me.apply(this,arguments)};function _s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function ws(e,t,r,n){var o=arguments.length,a=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function bs(e,t){return function(r,n){t(r,n,e)}}function Es(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Ss(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(d){try{c(n.next(d))}catch(u){i(u)}}function l(d){try{c(n.throw(d))}catch(u){i(u)}}function c(d){d.done?a(d.value):o(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}function Cs(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(a=c[0]&2?o.return:c[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;switch(o=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(d){c=[6,d],o=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var Ir=Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function Ps(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ir(t,e,r)}function lr(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function As(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Mo(arguments[t]));return e}function Rs(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)n[o]=a[i];return n}function xs(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function it(e){return this instanceof it?(this.v=e,this):new it(e)}function Os(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o;function i(f){n[f]&&(o[f]=function(h){return new Promise(function(m,y){a.push([f,h,m,y])>1||s(f,h)})})}function s(f,h){try{l(n[f](h))}catch(m){u(a[0][3],m)}}function l(f){f.value instanceof it?Promise.resolve(f.value.v).then(c,d):u(a[0][2],f)}function c(f){s("next",f)}function d(f){s("throw",f)}function u(f,h){f(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function Ts(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,a){t[o]=e[o]?function(i){return(r=!r)?{value:it(e[o](i)),done:o==="return"}:a?a(i):i}:a}}function Ds(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof lr=="function"?lr(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(s,l){i=e[a](i),o(s,l,i.done,i.value)})}}function o(a,i,s,l){Promise.resolve(l).then(function(c){a({value:c,done:s})},i)}}function Ls(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Ns=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Ms(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ir(t,e,r);return Ns(t,e),t}function js(e){return e&&e.__esModule?e:{default:e}}function Is(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function $s(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function ks(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}const Il=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Me},__asyncDelegator:Ts,__asyncGenerator:Os,__asyncValues:Ds,__await:it,__awaiter:Ss,__classPrivateFieldGet:Is,__classPrivateFieldIn:ks,__classPrivateFieldSet:$s,__createBinding:Ir,__decorate:ws,__exportStar:Ps,__extends:ys,__generator:Cs,__importDefault:js,__importStar:Ms,__makeTemplateObject:Ls,__metadata:Es,__param:bs,__read:Mo,__rest:_s,__spread:As,__spreadArray:xs,__spreadArrays:Rs,__values:lr},Symbol.toStringTag,{value:"Module"}));function Us(e){return e.toLowerCase()}var Fs=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],zs=/[^A-Z0-9]+/gi;function jo(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,n=r===void 0?Fs:r,o=t.stripRegexp,a=o===void 0?zs:o,i=t.transform,s=i===void 0?Us:i,l=t.delimiter,c=l===void 0?" ":l,d=yn(yn(e,n,"$1\0$2"),a,"\0"),u=0,f=d.length;d.charAt(u)==="\0";)u++;for(;d.charAt(f-1)==="\0";)f--;return d.slice(u,f).split("\0").map(s).join(c)}function yn(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(n,o){return n.replace(o,r)},e)}function Io(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function qs(e,t){return t===void 0&&(t={}),jo(e,Me({delimiter:"",transform:Io},t))}function Hs(e,t){return t===0?e.toLowerCase():Io(e,t)}function Ws(e,t){return t===void 0&&(t={}),qs(e,Me({transform:Hs},t))}function Ks(e,t){return t===void 0&&(t={}),jo(e,Me({delimiter:"."},t))}function $r(e,t){return t===void 0&&(t={}),Ks(e,Me({delimiter:"_"},t))}class je extends Ge{}class _n extends Ge{constructor(t,r,n,o){super(t,o),this.contentType=r,this.data=n}}class $o extends Ge{constructor(t,r){super(t.message,r),this.statusCode=t.statusCode,this.message=t.message,this.description=t.description,this.additionalProperties=t.additionalProperties,this.details=t.details}}class ko extends Ge{}class wn extends Ge{constructor(t,r){super(t,r),this.message=t}}function Uo(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function le(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(d){try{c(n.next(d))}catch(u){i(u)}}function l(d){try{c(n.throw(d))}catch(u){i(u)}}function c(d){d.done?a(d.value):o(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}function bn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function fe(e){return this instanceof fe?(this.v=e,this):new fe(e)}function Fo(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o;function i(f){n[f]&&(o[f]=function(h){return new Promise(function(m,y){a.push([f,h,m,y])>1||s(f,h)})})}function s(f,h){try{l(n[f](h))}catch(m){u(a[0][3],m)}}function l(f){f.value instanceof fe?Promise.resolve(f.value.v).then(c,d):u(a[0][2],f)}function c(f){s("next",f)}function d(f){s("throw",f)}function u(f,h){f(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function zo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof bn=="function"?bn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(s,l){i=e[a](i),o(s,l,i.done,i.value)})}}function o(a,i,s,l){Promise.resolve(l).then(function(c){a({value:c,done:s})},i)}}const qo=e=>new Promise(t=>setTimeout(()=>t(),e)),kr=e=>typeof e=="object"&&e!==null&&e.constructor.name==="Object";function Bs(){}class Vs extends Ge{constructor(t,r){super(`Maximum number of attempts reached: ${t}`,r)}}class Ys{constructor(t={}){this.props=t,this.attempts=0}sleep(){return le(this,void 0,void 0,function*(){if(this.attempts>=this.maxAttempts)throw new Vs(this.attempts);yield qo(this.timeout),this.attempts++})}clear(){this.attempts=0}get factor(){var t;return(t=this.props.factor)!==null&&t!==void 0?t:1e3}get base(){var t;return(t=this.props.base)!==null&&t!==void 0?t:2}get maxAttempts(){var t;return(t=this.props.maxAttempts)!==null&&t!==void 0?t:Number.POSITIVE_INFINITY}get timeout(){return this.factor*Math.pow(this.base,this.attempts)}}const Gs=()=>{let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}},Js=e=>{const t=new Map;for(const r of e.split(",")){const n=r.match(/<([^>]+)>;\s*rel="([^"]+)"/);n&&t.set(n[2],n[1])}return t};class At{constructor(t,r,n,o,a="next"){this.http=t,this.nextPath=r,this.nextParams=n,this.meta=o,this.direction=a}next(){return le(this,void 0,void 0,function*(){if(this.nextPath==null)return{done:!0,value:void 0};const t=yield this.http.request(Object.assign({method:"GET",path:this.nextPath,search:this.nextParams},this.meta)),r=this.getLink(t.headers.get("link"));return this.nextPath=r==null?void 0:r.pathname,this.nextParams=r==null?void 0:r.search.replace(/^\?/,""),{done:!1,value:yield t.data}})}return(t){return le(this,void 0,void 0,function*(){return this.clear(),{done:!0,value:yield t}})}throw(t){return le(this,void 0,void 0,function*(){throw this.clear(),t})}then(t=Promise.resolve.bind(Promise),r=Promise.reject.bind(Promise)){return this.next().then(n=>t(n.value),r)}values(){return this[Symbol.asyncIterator]()}getDirection(){return this.direction}setDirection(t){return new At(this.http,this.nextPath,this.nextParams,this.meta,t)}[Symbol.asyncIterator](){return this}getLink(t){if(t==null)return;const r=Js(t).get(this.direction);if(r!=null)return new URL(r)}clear(){this.nextPath=void 0,this.nextParams=void 0}clone(){return new At(this.http,this.nextPath,this.nextParams,this.meta,this.direction)}}class Zs{constructor(t,r){this.http=t,this.hook=r}dispatch(t){this.hook!=null&&(t=this.hook.beforeDispatch(t));let r=this.hook.dispatch(t);if(r!==!1)return r;switch(t.type){case"fetch":{r=this.http.get(t.path,t.data,t.meta);break}case"create":{r=this.http.post(t.path,t.data,t.meta);break}case"update":{r=this.http.put(t.path,t.data,t.meta);break}case"remove":{r=this.http.delete(t.path,t.data,t.meta);break}case"list":{r=new At(this.http,t.path,t.data);break}}return r instanceof Promise?r.then(n=>{var o;return(o=this.hook)===null||o===void 0?void 0:o.afterDispatch(t,n)}):this.hook.afterDispatch(t,r)}}function Qs(e){return e.readyState===jr.OPEN?Promise.resolve():new Promise((t,r)=>{const n=i=>{r(i)},o=()=>{r(new Error("WebSocket closed"))},a=()=>{t()};e.addEventListener("error",n,{once:!0}),e.addEventListener("close",o,{once:!0}),e.addEventListener("open",a,{once:!0})})}function Xs(e){return e.readyState===jr.CLOSED?Promise.resolve():new Promise(t=>{const r=()=>{t()};e.addEventListener("error",r,{once:!0}),e.addEventListener("close",r,{once:!0})})}class eu{constructor(t,r){this.props=t,this.logger=r,this.queue=[],this.closed=!1,this.initialized=!1,this.backoff=new Ys({maxAttempts:this.props.maxAttempts})}canAcquire(){return!this.closed}acquire(){return le(this,void 0,void 0,function*(){if(this.init(),this.ws!=null)return this.ws;const t=Gs();return this.queue.push(t),yield t.promise})}close(){var t;this.closed=!0,(t=this.ws)===null||t===void 0||t.close(),this.backoff.clear();for(const{reject:r}of this.queue)r(new wn("WebSocket closed"));this.queue=[]}init(){return le(this,void 0,void 0,function*(){var t,r,n,o,a,i;if(!this.initialized){for(this.initialized=!0;!this.closed;){(t=this.ws)===null||t===void 0||t.close();try{yield this.backoff.sleep()}catch{break}try{(r=this.logger)===null||r===void 0||r.log("info","Connecting to WebSocket...");{const s=(n=this.props.implementation)!==null&&n!==void 0?n:jr,l=new s(...this.props.constructorParameters);yield Qs(l),this.ws=l}(o=this.logger)===null||o===void 0||o.log("info","Connected to WebSocket");for(const{resolve:s}of this.queue)s(this.ws);this.queue=[],yield Xs(this.ws),(a=this.logger)===null||a===void 0||a.log("info","WebSocket closed"),this.backoff.clear()}catch(s){(i=this.logger)===null||i===void 0||i.log("error","WebSocket error:",s)}}for(const{reject:s}of this.queue)s(new wn(`Failed to connect to WebSocket after ${this.props.maxAttempts} attempts`));this.queue=[]}})}}function tu(e){return Fo(this,arguments,function*(){var r,n,o,a;const i=f=>le(this,void 0,void 0,function*(){if(l.return==null)throw new je("events.return is undefined");yield l.return(f)}),s=f=>le(this,void 0,void 0,function*(){if(l.return==null)throw new je("events.return is undefined");yield l.return(f)}),l=gs(f=>(e.addEventListener("message",f),e.addEventListener("error",s),e.addEventListener("close",i),()=>{e.removeEventListener("message",f),e.removeEventListener("error",s),e.removeEventListener("close",i)}));try{for(var c=!0,d=zo(l),u;u=yield fe(d.next()),r=u.done,!r;c=!0){a=u.value,c=!1;const[f]=a;yield yield fe(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=d.return)&&(yield fe(o.call(d)))}finally{if(n)throw n.error}}})}class ru{constructor(t,r,n,o,a){this.connector=t,this.serializer=r,this.stream=n,this.logger=o,this.params=a}values(){return Fo(this,arguments,function*(){var r,n,o,a,i,s,l;for((i=this.logger)===null||i===void 0||i.log("info","Subscribing to stream",this.stream);this.connector.canAcquire();){this.connection=yield fe(this.connector.acquire());const f=this.serializer.serialize("json",Object.assign({type:"subscribe",stream:this.stream},this.params));(s=this.logger)===null||s===void 0||s.log("debug","↑ WEBSOCKET",f),this.connection.send(f);const h=tu(this.connection);try{for(var c=!0,d=(n=void 0,zo(h)),u;u=yield fe(d.next()),r=u.done,!r;c=!0){a=u.value,c=!1;const m=a,y=yield fe(this.parseMessage(m.data));this.test(y)&&((l=this.logger)===null||l===void 0||l.log("debug","↓ WEBSOCKET",y),yield yield fe(y))}}catch(m){n={error:m}}finally{try{!c&&!r&&(o=d.return)&&(yield fe(o.call(d)))}finally{if(n)throw n.error}}}})}unsubscribe(){if(this.connection==null)return;const t=this.serializer.serialize("json",Object.assign({type:"unsubscribe",stream:this.stream},this.params));this.connection.send(t)}[Symbol.asyncIterator](){return this.values()}[Symbol.dispose](){this.unsubscribe()}test(t){var r;const n=(r=this.params)!==null&&r!==void 0?r:{},o=Object.values(n);return[this.stream,...o].every(i=>t.stream.includes(i))}parseMessage(t){return le(this,void 0,void 0,function*(){const r=this.serializer.deserialize("json",t);if("error"in r)throw new je(r.error);const n=r.event==="delete"||r.payload==null?r.payload:this.serializer.deserialize("json",r.payload);return{stream:r.stream,event:r.event,payload:n}})}}class nu{constructor(t,r,n){this.connector=t,this.serializer=r,this.logger=n}dispatch(t){var r;if(t.type==="close")return this.connector.close(),{};if(t.type==="prepare")return this.connector.acquire();if(t.type!=="subscribe")throw new je(`Unknown action type ${t.type}`);const n=(r=t.data)!==null&&r!==void 0?r:{},o=t.path.replace(/^\//,"").replaceAll("/",":");return new ru(this.connector,this.serializer,o,this.logger,Object.assign({},n))}[Symbol.dispose](){this.connector.close()}}const st=(e,t={})=>{const{context:r=[],applicable:n=!1}=t;let o={};const a={get:au(e,r)};return n&&(o=Bs,a.apply=iu(e,r)),new Proxy(o,a)},ou=new Set(["then","catch","finally","inspect","toString","valueOf","toJSON","constructor","prototype","length","name","caller","callee","arguments","bind","apply","call"]),au=(e,t)=>(r,n)=>{if(!(typeof n=="string"&&ou.has(n))){if(n===Symbol.dispose)return e[Symbol.dispose];if(typeof n!="symbol")return n.startsWith("$")?st(e,{context:[...t,n],applicable:!0}):st(e,{context:[...t,$r(n)],applicable:!0})}},iu=(e,t)=>(r,n,o)=>{const a=t.pop();if(a==null)throw new Error("No action specified");if(a==="$select")return st(e,{context:[...t,...o],applicable:!0});const i="/"+t.join("/"),[s,l]=o;return e.dispatch({type:a,path:i,data:s,meta:l})};function Ho(e){return["fetch","create","update","remove","list"].includes(e)}function su(e){if(Ho(e))return e;switch(e){case"lookup":case"verify_credentials":return"fetch";case"update_credentials":return"update";default:return"create"}}function uu(e,t){return e==="create"&&t==="/api/v1/accounts"||e==="update"&&t==="/api/v1/accounts/update_credentials"||e==="create"&&t==="/api/v1/email"||e==="create"&&t==="/api/v1/featured_tag"||e==="create"&&t==="/api/v1/media"||e==="create"&&t==="/api/v2/media"?"multipart-form":"json"}function lu(e,t,r){return le(this,void 0,void 0,function*(){let n;const o=AbortSignal.timeout(t);for(;n==null;){if(o.aborted)throw new ko(`Media processing timed out of ${t}ms`);try{yield qo(1e3);const a=yield r.get(`/api/v1/media/${e}`);a.url!=null&&(n=a)}catch(a){if(a instanceof $o&&a.statusCode===404)continue;throw a}}return n})}class cu{constructor(t,r=1e3*60){this.http=t,this.mediaTimeout=r}beforeDispatch(t){const r=su(t.type),n=Ho(t.type)?t.path:t.path+"/"+$r(t.type),o=uu(r,n),a=Object.assign(Object.assign({},t.meta),{encoding:o});return{type:r,path:n,data:t.data,meta:a}}dispatch(t){return t.type==="update"&&t.path==="/api/v1/accounts/update_credentials"?this.http.patch(t.path,t.data,t.meta):!1}afterDispatch(t,r){var n;if(t.type==="create"&&t.path==="/api/v2/media"){const o=r;return kr(t.data)&&((n=t.data)===null||n===void 0?void 0:n.skipPolling)===!0?o:lu(o.id,this.mediaTimeout,this.http)}return r}}const fu=e=>{const t=new AbortController;for(const r of e)r.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal},du=([e,...t])=>{const r=new Headers(e);for(const n of t)for(const[o,a]of new Headers(n).entries())r.set(o,a);return r};class hu{constructor(t,r){this.props=t,this.serializer=r}mergeRequestInitWithDefaults(t={}){const r=Object.assign({},this.props.requestInit);{const{headers:n,signal:o}=t,a=Uo(t,["headers","signal"]);Object.assign(r,a),r.headers=this.mergeHeadersWithDefaults(n),r.signal=this.mergeAbortSignalWithDefaults(o)}return r}resolvePath(t,r){const n=new URL(t,this.props.url);return typeof r=="string"?n.search=r:r!=null&&(n.search=this.serializer.serialize("querystring",r)),n}mergeHeadersWithDefaults(t={}){var r,n;const o=du([(n=(r=this.props.requestInit)===null||r===void 0?void 0:r.headers)!==null&&n!==void 0?n:{},t]),a=new Headers(o);return this.props.accessToken&&a.set("Authorization",`Bearer ${this.props.accessToken}`),new Headers(a)}mergeAbortSignalWithDefaults(t){var r;const n=[];return this.props.timeout!=null&&n.push(AbortSignal.timeout(this.props.timeout)),!((r=this.props.requestInit)===null||r===void 0)&&r.signal&&n.push(this.props.requestInit.signal),t!=null&&n.push(t),n.length===1?n[0]:fu(n)}}class pu{constructor(t,r){this.props=t,this.serializer=r}getProtocols(t=[]){return this.props.useInsecureAccessToken||this.props.accessToken==null?[...t]:[this.props.accessToken,...t]}resolvePath(t,r={}){const n=new URL(t,this.props.streamingApiUrl);return this.props.useInsecureAccessToken&&(r.accessToken=this.props.accessToken),n.search=this.serializer.serialize("querystring",r),n}getMaxAttempts(){return this.props.retry===!0||this.props.retry==null?Number.POSITIVE_INFINITY:this.props.retry===!1?1:this.props.retry}}class mu{get(t,r,n={}){return this.request(Object.assign({method:"GET",path:t,search:r},n)).then(o=>o.data)}post(t,r,n={}){return this.request(Object.assign({method:"POST",path:t,body:r},n)).then(o=>o.data)}delete(t,r,n={}){return this.request(Object.assign({method:"DELETE",path:t,body:r},n)).then(o=>o.data)}put(t,r,n={}){return this.request(Object.assign({method:"PUT",path:t,body:r},n)).then(o=>o.data)}patch(t,r,n={}){return this.request(Object.assign({method:"PATCH",path:t,body:r},n)).then(o=>o.data)}}const En=e=>{var t;const r=(t=e.get("Content-Type"))===null||t===void 0?void 0:t.replace(/\s*;.*$/,"");if(typeof r=="string")switch(r){case"application/json":return"json";case"multipart/form-data":return"multipart-form";default:return}};class vu extends mu{constructor(t,r,n){super(),this.serializer=t,this.config=r,this.logger=n}request(t){return le(this,void 0,void 0,function*(){var r,n,o,a,i;const s=this.createRequest(t);try{(r=this.logger)===null||r===void 0||r.log("info",`${s.method} ${s.url}`),(n=this.logger)===null||n===void 0||n.log("debug"," body",{encoding:t.encoding,body:t.body});const l=yield fetch(s);if(!l.ok)throw l;const c=yield l.text(),d=En(l.headers);if(d==null)throw new je("The server returned data with an unknown encoding.");const u=this.serializer.deserialize(d,c);return(o=this.logger)===null||o===void 0||o.log("info",`${s.method} ${s.url}`),(a=this.logger)===null||a===void 0||a.log("debug"," body",c),{headers:l.headers,data:u}}catch(l){throw(i=this.logger)===null||i===void 0||i.log("debug","HTTP failed",l),yield this.createError(l)}})}createRequest(t){const{method:r,path:n,search:o,encoding:a="json",requestInit:i={}}=t,s=this.config.resolvePath(n,o),l=this.serializer.serialize(a,t.body),c=this.config.mergeRequestInitWithDefaults(i),d=new Request(s,Object.assign({method:r,body:l},c));return typeof l=="string"&&a==="json"&&d.headers.set("Content-Type","application/json"),d}createError(t){return le(this,void 0,void 0,function*(){if(t instanceof Response){const r=En(t.headers);if(r==null)throw new je("The server returned data with an unknown encoding. The server may be down.");const n=this.serializer.deserialize(r,yield t.text()),{error:o,errorDescription:a,details:i}=n,s=Uo(n,["error","errorDescription","details"]);return new $o({statusCode:t.status,message:o,description:a,details:i,additionalProperties:s},{cause:t})}return t!=null&&t.name==="TimeoutError"?new ko("Request timed out",{cause:t}):t})}}class gu{constructor(t){this.level=t}log(t,r,n){if(!this.level.satisfies(t))return;const o=n==null?[r]:[r,n];switch(t){case"debug":{console.debug(...o);return}case"info":{console.info(...o);return}case"warn":{console.warn(...o);return}case"error":{console.error(...o);return}}}}const ae=Object.freeze({DEBUG:1,INFO:2,WARN:4,ERROR:8});class He{constructor(t){this.level=t}satisfies(t){switch(t){case"debug":return!!(this.level&ae.DEBUG);case"info":return!!(this.level&ae.INFO);case"warn":return!!(this.level&ae.WARN);case"error":return!!(this.level&ae.ERROR)}}static from(t){switch(t){case"debug":return new He(ae.DEBUG|ae.INFO|ae.WARN|ae.ERROR);case"info":return new He(ae.INFO|ae.WARN|ae.ERROR);case"warn":return new He(ae.WARN|ae.ERROR);case"error":return new He(ae.ERROR)}}}const Wo=e=>{const t=He.from(e??"warn");return new gu(t)},Ko=e=>{const t=(r,n="")=>Array.isArray(r)?r.flatMap((o,a)=>t(o,n==""?a.toString():e.onArray(n,a))):kr(r)?Object.entries(r).flatMap(([o,a])=>t(a,n===""?o:e.onObject(n,o))):[[n,r]];return t},yu=e=>{const t=Ko({onArray:(r,n)=>`${r}[${n}]`,onObject:(r,n)=>`${r}[${n}]`});return Object.fromEntries(t(e))},_u=e=>Ko({onArray:r=>`${r}[]`,onObject:(r,n)=>`${r}[${n}]`})(e).filter(([,r])=>r!=null).map(([r,n])=>`${r}=${encodeURIComponent(n)}`).join("&"),cr=(e,t)=>Array.isArray(e)?e.map(r=>cr(r,t)):kr(e)?Object.fromEntries(Object.entries(e).map(([r,n])=>[t(r),cr(n,t)])):e,Sn=(e,t)=>cr(e,n=>n.includes(":")||n.startsWith("_")?n:t(n));class Bo{serialize(t,r){const n=Sn(r,$r);switch(t){case"json":return JSON.stringify(n);case"multipart-form":{const o=new FormData;for(const[a,i]of Object.entries(yu(n)))o.append(a,i);return o}case"querystring":return _u(n);default:throw new je(`Unknown content type ${t} to serialize.`)}}deserialize(t,r){switch(t){case"json":try{return Sn(JSON.parse(r),Ws)}catch{throw new _n(`Malformed JSON ${r} returned from the server.`,t,r)}default:throw new _n(`Unknown content type ${t} returned from the server.`,t,r)}}}const wu=e=>{const t=new Bo,r=new hu(e,t),n=Wo(e.log),o=new vu(t,r,n),a=new cu(o),i=new Zs(o,a);return st(i,{context:["api"]})};function bu(e){const t=new Bo,r=new pu(e,t),n=Wo(e.log),o=new eu({constructorParameters:[r.resolvePath("/api/v1/streaming"),r.getProtocols()],implementation:e.implementation,maxAttempts:r.getMaxAttempts()},n),a=new nu(o,t,n);return st(a)}function Vo(e){const t=j.local.getJSON("accounts")||[];return e&&t.find(r=>r.info.id===e)||t[0]}function Eu(e){return(j.local.getJSON("accounts")||[]).find(r=>r.accessToken===e)}function Su(e){return(j.local.getJSON("accounts")||[]).find(r=>r.instanceURL===e)}const Yo=window.matchMedia("(display-mode: standalone)");function Cu(){try{const e=j.session.get("currentAccount");if(e)return e}catch{}if(Yo.matches)try{const e=j.local.get("currentAccount");if(e)return e}catch{}return null}function Go(e){try{j.session.set("currentAccount",e)}catch{}if(Yo.matches)try{j.local.set("currentAccount",e)}catch{}}function Ur(){window.__IGNORE_GET_ACCOUNT_ERROR__;const e=Cu();return Vo(e)}function Kt(){const e=Ur(),{instanceURL:t,info:{id:r}}=e;return`${r}@${t}`}function Pu(e){const t=j.local.getJSON("accounts")||[],r=t.find(n=>n.info.id===e.info.id);r?(r.info=e.info,r.instanceURL=e.instanceURL,r.accessToken=e.accessToken,r.vapidKey=e.vapidKey):t.push(e),j.local.setJSON("accounts",t),Go(e.info.id)}function $l(e){const t=j.local.getJSON("accounts")||[],r=t.find(n=>n.info.id===e.id);r&&(r.info.displayName!==e.displayName||r.info.avatar!==e.avatar||r.info.avatar_static!==e.avatar_static)&&(r.info={...r.info,...e},j.local.setJSON("accounts",t))}let Bt=null;function Jo(){if(Bt)return Bt;try{const e=Ur(),t=j.local.getJSON("instances"),r=e.instanceURL.toLowerCase();return Bt=t[r]}catch{return{}}}function Au(e){const{configuration:t,maxMediaAttachments:r,maxTootChars:n,pleroma:o,pollLimits:a}=e,i=(t==null?void 0:t.statuses)||{};r&&(i.maxMediaAttachments??(i.maxMediaAttachments=r)),n&&(i.maxCharacters??(i.maxCharacters=n));const s=(t==null?void 0:t.polls)||{};return a&&(s.maxCharactersPerOption??(s.maxCharactersPerOption=a.maxOptionChars),s.maxExpiration??(s.maxExpiration=a.maxExpiration),s.maxOptions??(s.maxOptions=a.maxOptions),s.minExpiration??(s.minExpiration=a.minExpiration)),{...t,statuses:i,polls:s}}function kl(){const e=Jo();return Au(e)}function Ul(){const e=Jo();return/pixelfed/i.test(e==null?void 0:e.version)}const Se={get:e=>{try{return localStorage.getItem(e)}catch{return null}},getJSON:e=>{try{return JSON.parse(Se.get(e))}catch{return null}},set:(e,t)=>{try{return localStorage.setItem(e,t)}catch{return null}},setJSON:(e,t)=>{try{return Se.set(e,JSON.stringify(t))}catch{return null}},del:e=>{try{return localStorage.removeItem(e)}catch{return null}}},fr={get:e=>{try{return sessionStorage.getItem(e)}catch{return null}},getJSON:e=>{try{return JSON.parse(fr.get(e))}catch{return null}},set:(e,t)=>{try{return sessionStorage.setItem(e,t)}catch{return null}},setJSON:(e,t)=>{try{return fr.set(e,JSON.stringify(t))}catch{return null}},del:e=>{try{return sessionStorage.removeItem(e)}catch{return null}}},Ru={get:e=>{try{return Se.getJSON(e)[Kt()]}catch{return null}},set:(e,t)=>{try{const r=Se.getJSON(e)||{};return r[Kt()]=t,Se.setJSON(e,r)}catch{return null}},del:e=>{try{const t=Se.getJSON(e)||{};return delete t[Kt()],Se.setJSON(e,t)}catch{return null}}},j={local:Se,session:fr,account:Ru},gt="mastodon.social",Rt={},ie={};window.__ACCOUNT_APIS__=ie;let J;function be({instance:e,accessToken:t}){/^https?:\/\//.test(e)&&(e=e.replace(/^https?:\/\//,"").replace(/\/+$/,"").toLowerCase());const r=e?`https://${e}`:`https://${gt}`,o={masto:wu({url:r,accessToken:t,timeout:3e4}),instance:e,accessToken:t};return Rt[e]=o,ie[e]||(ie[e]={}),t&&(ie[e][t]=o),o}async function Fl(e,t){const{masto:r,accessToken:n}=e;let o;try{o=await r.v2.instance.fetch()}catch{}if(!o)try{o=await r.v1.instance.fetch()}catch{}if(!o)return;const{uri:a,urls:{streamingApi:i}={},domain:s,configuration:{urls:{streaming:l}={}}={}}=o,c=j.local.getJSON("instances")||{};if((a||s)&&(c[(s||a).replace(/^https?:\/\//,"").replace(/\/+$/,"").toLowerCase()]=o),t&&(c[t.toLowerCase()]=o),j.local.setJSON("instances",c),"WebSocket"in window&&(i||l)){const u=bu({streamingApiUrl:l||i,accessToken:n,implementation:WebSocket});e.streaming=u}}async function zl(e,t,r,n){const{masto:o}=e,a=await o.v1.accounts.verifyCredentials();Go(a.id),Pu({info:a,instanceURL:t.toLowerCase(),accessToken:r,vapidKey:n})}async function ql(e){try{const{masto:t}=e,r=await t.v1.preferences.fetch();j.account.set("preferences",r)}catch{}}function xt({instance:e,accessToken:t,accountID:r,account:n}={}){var l,c,d,u,f;if(e&&(e=e.toLowerCase().trim()),e&&t){const h=((l=ie[e])==null?void 0:l[t])||be({instance:e,accessToken:t}),{masto:m,streaming:y}=h;return{masto:m,streaming:y,client:h,authenticated:!0,instance:e}}if(t)for(const h in ie)if(ie[h][t]){const m=ie[h][t],{masto:y,streaming:w}=m;return{masto:y,streaming:w,client:m,authenticated:!0,instance:h}}else{const m=Eu(t);if(m){const y=m.accessToken,w=m.instanceURL.toLowerCase().trim(),g=be({instance:w,accessToken:y}),{masto:C,streaming:x}=g;return{masto:C,streaming:x,client:g,authenticated:!0,instance:w}}else throw new Error("Access token not found")}if(n||r)if(n=n||Vo(r),n){const h=n.accessToken,m=n.instanceURL.toLowerCase().trim(),y=((c=ie[m])==null?void 0:c[h])||be({instance:m,accessToken:h}),{masto:w,streaming:g}=y;return{masto:w,streaming:g,client:y,authenticated:!0,instance:m}}else throw new Error(`Account ${r} not found`);const o=Ur();if(e){if((J==null?void 0:J.instance)===e)return{masto:J.masto,streaming:J.streaming,client:J,authenticated:!0,instance:e};if((o==null?void 0:o.instanceURL)===e){const{accessToken:C}=o;return J=((d=ie[e])==null?void 0:d[C])||be({instance:e,accessToken:C}),{masto:J.masto,streaming:J.streaming,client:J,authenticated:!0,instance:e}}const h=Su(e);if(h){const C=h.accessToken,x=((u=ie[e])==null?void 0:u[C])||be({instance:e,accessToken:C}),{masto:W,streaming:V}=x;return{masto:W,streaming:V,client:x,authenticated:!0,instance:e}}const m=Rt[e]||be({instance:e}),{masto:y,streaming:w,accessToken:g}=m;return{masto:y,streaming:w,client:m,authenticated:!!g,instance:e}}if(J)return{masto:J.masto,streaming:J.streaming,client:J,authenticated:!0,instance:J.instance};if(o){const{accessToken:h,instanceURL:m}=o;return J=((f=ie[m])==null?void 0:f[h])||be({instance:m,accessToken:h}),{masto:J.masto,streaming:J.streaming,client:J,authenticated:!0,instance:m}}const a=Rt[gt]||be({instance:gt}),{masto:i,streaming:s}=a;return{masto:i,streaming:s,client:a,authenticated:!1,instance:gt}}window.__API__={currentAccountApi:J,apis:Rt,accountApis:ie};var xu=Object.getOwnPropertyNames,Ou=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty;function Cn(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function mt(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);var a=o.cache,i=a.get(r),s=a.get(n);if(i&&s)return i===n&&s===r;a.set(r,n),a.set(n,r);var l=e(r,n,o);return a.delete(r),a.delete(n),l}}function Pn(e){return xu(e).concat(Ou(e))}var Zo=Object.hasOwn||function(e,t){return Tu.call(e,t)};function Je(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var Qo="_owner",An=Object.getOwnPropertyDescriptor,Rn=Object.keys;function Du(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Lu(e,t){return Je(e.getTime(),t.getTime())}function xn(e,t,r){if(e.size!==t.size)return!1;for(var n={},o=e.entries(),a=0,i,s;(i=o.next())&&!i.done;){for(var l=t.entries(),c=!1,d=0;(s=l.next())&&!s.done;){var u=i.value,f=u[0],h=u[1],m=s.value,y=m[0],w=m[1];!c&&!n[d]&&(c=r.equals(f,y,a,d,e,t,r)&&r.equals(h,w,f,y,e,t,r))&&(n[d]=!0),d++}if(!c)return!1;a++}return!0}function Nu(e,t,r){var n=Rn(e),o=n.length;if(Rn(t).length!==o)return!1;for(var a;o-- >0;)if(a=n[o],a===Qo&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Zo(t,a)||!r.equals(e[a],t[a],a,a,e,t,r))return!1;return!0}function Qe(e,t,r){var n=Pn(e),o=n.length;if(Pn(t).length!==o)return!1;for(var a,i,s;o-- >0;)if(a=n[o],a===Qo&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Zo(t,a)||!r.equals(e[a],t[a],a,a,e,t,r)||(i=An(e,a),s=An(t,a),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable)))return!1;return!0}function Mu(e,t){return Je(e.valueOf(),t.valueOf())}function ju(e,t){return e.source===t.source&&e.flags===t.flags}function On(e,t,r){if(e.size!==t.size)return!1;for(var n={},o=e.values(),a,i;(a=o.next())&&!a.done;){for(var s=t.values(),l=!1,c=0;(i=s.next())&&!i.done;)!l&&!n[c]&&(l=r.equals(a.value,i.value,a.value,i.value,e,t,r))&&(n[c]=!0),c++;if(!l)return!1}return!0}function Iu(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var $u="[object Arguments]",ku="[object Boolean]",Uu="[object Date]",Fu="[object Map]",zu="[object Number]",qu="[object Object]",Hu="[object RegExp]",Wu="[object Set]",Ku="[object String]",Bu=Array.isArray,Tn=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Dn=Object.assign,Vu=Object.prototype.toString.call.bind(Object.prototype.toString);function Yu(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,o=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,i=e.areRegExpsEqual,s=e.areSetsEqual,l=e.areTypedArraysEqual;return function(d,u,f){if(d===u)return!0;if(d==null||u==null||typeof d!="object"||typeof u!="object")return d!==d&&u!==u;var h=d.constructor;if(h!==u.constructor)return!1;if(h===Object)return o(d,u,f);if(Bu(d))return t(d,u,f);if(Tn!=null&&Tn(d))return l(d,u,f);if(h===Date)return r(d,u,f);if(h===RegExp)return i(d,u,f);if(h===Map)return n(d,u,f);if(h===Set)return s(d,u,f);var m=Vu(d);return m===Uu?r(d,u,f):m===Hu?i(d,u,f):m===Fu?n(d,u,f):m===Wu?s(d,u,f):m===qu?typeof d.then!="function"&&typeof u.then!="function"&&o(d,u,f):m===$u?o(d,u,f):m===ku||m===zu||m===Ku?a(d,u,f):!1}}function Gu(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?Qe:Du,areDatesEqual:Lu,areMapsEqual:n?Cn(xn,Qe):xn,areObjectsEqual:n?Qe:Nu,arePrimitiveWrappersEqual:Mu,areRegExpsEqual:ju,areSetsEqual:n?Cn(On,Qe):On,areTypedArraysEqual:n?Qe:Iu};if(r&&(o=Dn({},o,r(o))),t){var a=mt(o.areArraysEqual),i=mt(o.areMapsEqual),s=mt(o.areObjectsEqual),l=mt(o.areSetsEqual);o=Dn({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:s,areSetsEqual:l})}return o}function Ju(e){return function(t,r,n,o,a,i,s){return e(t,r,s)}}function Zu(e){var t=e.circular,r=e.comparator,n=e.createState,o=e.equals,a=e.strict;if(n)return function(l,c){var d=n(),u=d.cache,f=u===void 0?t?new WeakMap:void 0:u,h=d.meta;return r(l,c,{cache:f,equals:o,meta:h,strict:a})};if(t)return function(l,c){return r(l,c,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(l,c){return r(l,c,i)}}var Qu=xe(),Hl=xe({strict:!0}),Wl=xe({circular:!0}),Kl=xe({circular:!0,strict:!0}),Bl=xe({createInternalComparator:function(){return Je}}),Vl=xe({strict:!0,createInternalComparator:function(){return Je}}),Yl=xe({circular:!0,createInternalComparator:function(){return Je}}),Gl=xe({circular:!0,createInternalComparator:function(){return Je},strict:!0});function xe(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,o=e.createState,a=e.strict,i=a===void 0?!1:a,s=Gu(e),l=Yu(s),c=n?n(l):Ju(l);return Zu({circular:r,comparator:l,createState:o,equals:c,strict:i})}function Xo(e,t,r,n){let o=e[t];return Lr(e,()=>{const a=e[t];Object.is(o,a)||r(o=a)},n)}const Jl=Symbol();const Zl=Symbol();function Xu(e){try{const{pathname:t,hash:r,hostname:n}=URL.parse(e);return/^\/.*\/\d+$/i.test(t)||/^\/(@[^/]+|users\/[^/]+)\/(statuses|posts)\/\w+\/?$/i.test(t)||/^\/notes\/[a-z0-9]+$/i.test(t)||/^\/(notice|objects)\/[a-z0-9-]+$/i.test(t)||/^\/@[^/]+\/post\/[a-z0-9]+$/i.test(t)||/^\/@[^/]+\/[a-z0-9]+[a-z0-9\-]+[a-z0-9]+$/i.test(t)||n==="fed.brid.gy"&&t.startsWith("/r/http")||/#\/[^\/]+\.[^\/]+\/s\/.+/i.test(r)}catch{return!1}}var Ot={exports:{}},Xe={exports:{}},Ql=Xe.exports,Ln;function el(){return Ln||(Ln=1,function(e,t){(function(r,n){e.exports=n()})(Nr,function(){"use strict";var r={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},n=Array.prototype.slice;function o(u){var f=u.length;return f?f===1?[u[0]]:f===2?[u[0],u[1]]:f===3?[u[0],u[1],u[2]]:n.call(u,0):[]}function a(u){var f={};for(var h in u)r[h]||(f[h]=u[h]);return f}function i(u){return typeof u=="function"&&u.isMemoized}function s(u,f){return u===f||u!==u&&f!==f}function l(u,f){var h={};for(var m in u)h[m]=u[m];for(var m in f)h[m]=f[m];return h}var c=function(){function u(f){this.keys=[],this.values=[],this.options=f;var h=typeof f.isMatchingKey=="function";h?this.getKeyIndex=this._getKeyIndexFromMatchingKey:f.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey=typeof f.transformKey=="function",this.shouldCloneArguments=this.canTransformKey||h,this.shouldUpdateOnAdd=typeof f.onCacheAdd=="function",this.shouldUpdateOnChange=typeof f.onCacheChange=="function",this.shouldUpdateOnHit=typeof f.onCacheHit=="function"}return Object.defineProperty(u.prototype,"size",{get:function(){return this.keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"snapshot",{get:function(){return{keys:o(this.keys),size:this.size,values:o(this.values)}},enumerable:!1,configurable:!0}),u.prototype._getKeyIndexFromMatchingKey=function(f){var h=this.options,m=h.isMatchingKey,y=h.maxSize,w=this.keys,g=w.length;if(!g)return-1;if(m(w[0],f))return 0;if(y>1){for(var C=1;C<g;C++)if(m(w[C],f))return C}return-1},u.prototype._getKeyIndexForMany=function(f){var h=this.options.isEqual,m=this.keys,y=m.length;if(!y)return-1;if(y===1)return this._getKeyIndexForSingle(f);var w=f.length,g,C;if(w>1){for(var x=0;x<y;x++)if(g=m[x],g.length===w){for(C=0;C<w&&h(g[C],f[C]);C++);if(C===w)return x}}else for(var x=0;x<y;x++)if(g=m[x],g.length===w&&h(g[0],f[0]))return x;return-1},u.prototype._getKeyIndexForSingle=function(f){var h=this.keys;if(!h.length)return-1;var m=h[0],y=m.length;if(f.length!==y)return-1;var w=this.options.isEqual;if(y>1){for(var g=0;g<y;g++)if(!w(m[g],f[g]))return-1;return 0}return w(m[0],f[0])?0:-1},u.prototype.orderByLru=function(f,h,m){for(var y=this.keys,w=this.values,g=y.length,C=m;C--;)y[C+1]=y[C],w[C+1]=w[C];y[0]=f,w[0]=h;var x=this.options.maxSize;g===x&&m===g?(y.pop(),w.pop()):m>=x&&(y.length=w.length=x)},u.prototype.updateAsyncCache=function(f){var h=this,m=this.options,y=m.onCacheChange,w=m.onCacheHit,g=this.keys[0],C=this.values[0];this.values[0]=C.then(function(x){return h.shouldUpdateOnHit&&w(h,h.options,f),h.shouldUpdateOnChange&&y(h,h.options,f),x},function(x){var W=h.getKeyIndex(g);throw W!==-1&&(h.keys.splice(W,1),h.values.splice(W,1)),x})},u}();function d(u,f){if(f===void 0&&(f={}),i(u))return d(u.fn,l(u.options,f));if(typeof u!="function")throw new TypeError("You must pass a function to `memoize`.");var h=f.isEqual,m=h===void 0?s:h,y=f.isMatchingKey,w=f.isPromise,g=w===void 0?!1:w,C=f.maxSize,x=C===void 0?1:C,W=f.onCacheAdd,V=f.onCacheChange,X=f.onCacheHit,oe=f.transformKey,ee=l({isEqual:m,isMatchingKey:y,isPromise:g,maxSize:x,onCacheAdd:W,onCacheChange:V,onCacheHit:X,transformKey:oe},a(f)),O=new c(ee),D=O.keys,_=O.values,A=O.canTransformKey,M=O.shouldCloneArguments,L=O.shouldUpdateOnAdd,T=O.shouldUpdateOnChange,$=O.shouldUpdateOnHit,N=function(){var z=M?o(arguments):arguments;A&&(z=oe(z));var Y=D.length?O.getKeyIndex(z):-1;if(Y!==-1)$&&X(O,ee,N),Y&&(O.orderByLru(D[Y],_[Y],Y),T&&V(O,ee,N));else{var ne=u.apply(this,arguments),se=M?z:o(arguments);O.orderByLru(se,ne,D.length),g&&O.updateAsyncCache(N),L&&W(O,ee,N),T&&V(O,ee,N)}return _[0]};return N.cache=O,N.fn=u,N.isMemoized=!0,N.options=ee,N}return d})}(Xe,Xe.exports)),Xe.exports}var et={exports:{}},Xl=et.exports,Nn;function tl(){return Nn||(Nn=1,function(e,t){(function(r,n){n(t)})(Nr,function(r){"use strict";var n=typeof WeakMap=="function",o=Object.keys;function a(_,A){return _===A||_!==_&&A!==A}function i(_){return _.constructor===Object||_.constructor==null}function s(_){return!!_&&typeof _.then=="function"}function l(_){return!!(_&&_.$$typeof)}function c(){var _=[];return{delete:function(A){for(var M=0;M<_.length;++M)if(_[M][0]===A){_.splice(M,1);return}},get:function(A){for(var M=0;M<_.length;++M)if(_[M][0]===A)return _[M][1]},set:function(A,M){for(var L=0;L<_.length;++L)if(_[L][0]===A){_[L][1]=M;return}_.push([A,M])}}}var d=function(_){return _?function(){return new WeakMap}:c}(n);function u(_){return function(M){var L=_||M;return function($,N,z,Y,ne,se,te){te===void 0&&(te=d());var Oe=!!$&&typeof $=="object",lt=!!N&&typeof N=="object";if(Oe!==lt)return!1;if(!Oe&&!lt)return L($,N,te);var ct=te.get($);if(ct&&te.get(N))return ct===N;te.set($,N),te.set(N,$);var It=L($,N,te);return te.delete($),te.delete(N),It}}}function f(_,A,M,L){var T=_.length;if(A.length!==T)return!1;for(;T-- >0;)if(!M(_[T],A[T],T,T,_,A,L))return!1;return!0}function h(_,A,M,L){var T=_.size===A.size;if(T&&_.size){var $={},N=0;_.forEach(function(z,Y){if(T){var ne=!1,se=0;A.forEach(function(te,Oe){!ne&&!$[se]&&(ne=M(Y,Oe,N,se,_,A,L)&&M(z,te,Y,Oe,_,A,L),ne&&($[se]=!0)),se++}),N++,T=ne}})}return T}var m="_owner",y=Function.prototype.bind.call(Function.prototype.call,Object.prototype.hasOwnProperty);function w(_,A,M,L){var T=o(_),$=T.length;if(o(A).length!==$)return!1;if($)for(var N=void 0;$-- >0;){if(N=T[$],N===m){var z=l(_),Y=l(A);if((z||Y)&&z!==Y)return!1}if(!y(A,N)||!M(_[N],A[N],N,N,_,A,L))return!1}return!0}var g=function(){return/foo/g.flags==="g"?function(A,M){return A.source===M.source&&A.flags===M.flags}:function(A,M){return A.source===M.source&&A.global===M.global&&A.ignoreCase===M.ignoreCase&&A.multiline===M.multiline&&A.unicode===M.unicode&&A.sticky===M.sticky&&A.lastIndex===M.lastIndex}}();function C(_,A,M,L){var T=_.size===A.size;if(T&&_.size){var $={};_.forEach(function(N,z){if(T){var Y=!1,ne=0;A.forEach(function(se,te){!Y&&!$[ne]&&(Y=M(N,se,z,te,_,A,L),Y&&($[ne]=!0)),ne++}),T=Y}})}return T}var x=typeof Map=="function",W=typeof Set=="function",V=Object.prototype.valueOf;function X(_){var A=typeof _=="function"?_(M):function(L,T,$,N,z,Y,ne){return M(L,T,ne)};function M(L,T,$){if(L===T)return!0;if(L&&T&&typeof L=="object"&&typeof T=="object"){if(i(L)&&i(T))return w(L,T,A,$);var N=Array.isArray(L),z=Array.isArray(T);return N||z?N===z&&f(L,T,A,$):(N=L instanceof Date,z=T instanceof Date,N||z?N===z&&a(L.getTime(),T.getTime()):(N=L instanceof RegExp,z=T instanceof RegExp,N||z?N===z&&g(L,T):s(L)||s(T)?L===T:x&&(N=L instanceof Map,z=T instanceof Map,N||z)?N===z&&h(L,T,A,$):W&&(N=L instanceof Set,z=T instanceof Set,N||z)?N===z&&C(L,T,A,$):L.valueOf!==V||T.valueOf!==V?a(L.valueOf(),T.valueOf()):w(L,T,A,$)))}return L!==L&&T!==T}return M}var oe=X(),ee=X(function(){return a}),O=X(u()),D=X(u(a));r.circularDeepEqual=O,r.circularShallowEqual=D,r.createCustomEqual=X,r.deepEqual=oe,r.sameValueZeroEqual=a,r.shallowEqual=ee,Object.defineProperty(r,"__esModule",{value:!0})})}(et,et.exports)),et.exports}var ec=Ot.exports;(function(e,t){(function(r,n){e.exports=n(el(),tl())})(Nr,function(r,n){"use strict";function o(){return o=Object.assign?Object.assign.bind():function(p){for(var v=1;v<arguments.length;v++){var S=arguments[v];for(var b in S)Object.prototype.hasOwnProperty.call(S,b)&&(p[b]=S[b])}return p},o.apply(this,arguments)}function a(p,v){if(p==null)return{};var S={},b=Object.keys(p),P,E;for(E=0;E<b.length;E++)P=b[E],!(v.indexOf(P)>=0)&&(S[P]=p[P]);return S}var i={isDeepEqual:!1,isPromise:!1,isReact:!1,isSerialized:!1,isShallowEqual:!1,matchesArg:void 0,matchesKey:void 0,maxAge:void 0,maxArgs:void 0,maxSize:1,onExpire:void 0,profileName:void 0,serializer:void 0,updateCacheForKey:void 0,transformArgs:void 0,updateExpire:!1};function s(){for(var p=arguments.length,v=new Array(p),S=0;S<p;S++)v[S]=arguments[S];return v.reduce(function(b,P){if(typeof b=="function")return typeof P=="function"?function(){b.apply(this,arguments),P.apply(this,arguments)}:b;if(typeof P=="function")return P})}function l(){for(var p=arguments.length,v=new Array(p),S=0;S<p;S++)v[S]=arguments[S];return v.reduce(function(b,P){if(typeof b=="function")return typeof P=="function"?function(){return b(P.apply(this,arguments))}:b;if(typeof P=="function")return P})}function c(p,v){for(var S=0;S<p.length;S++)if(p[S].key===v)return S;return-1}function d(p,v){var S=typeof v=="function"?v:function(b,P){for(var E=0;E<P.length;E++)if(!p(b[E],P[E]))return!1;return!0};return function(b,P){for(var E=0;E<b.length;E++)if(b[E].length===P.length&&S(b[E],P))return E;return-1}}function u(p,v){return!v||v===i?p:o({},p,v,{onCacheAdd:s(p.onCacheAdd,v.onCacheAdd),onCacheChange:s(p.onCacheChange,v.onCacheChange),onCacheHit:s(p.onCacheHit,v.onCacheHit),transformArgs:l(p.transformArgs,v.transformArgs)})}function f(p){return typeof p=="function"&&p.isMoized}function h(p,v,S){try{var b=S||v||"anonymous";Object.defineProperty(p,"name",{configurable:!0,enumerable:!1,value:"moized("+b+")",writable:!0})}catch{}}function m(p,v,S){var b=c(p,v);b!==-1&&(clearTimeout(p[b].timeoutId),S&&p.splice(b,1))}function y(p,v){var S=setTimeout(p,v);return typeof S.unref=="function"&&S.unref(),S}function w(p,v,S,b){var P=v.maxAge;return function E(R,U,G){var q=R.keys[0];if(c(p,q)===-1){var Z=function(){var he=d(S,b),pe=he(R.keys,q),Ue=R.values[pe];~pe&&(R.keys.splice(pe,1),R.values.splice(pe,1),typeof v.onCacheChange=="function"&&v.onCacheChange(R,U,G)),m(p,q,!0),typeof v.onExpire=="function"&&v.onExpire(q)===!1&&(R.keys.unshift(q),R.values.unshift(Ue),E(R,U,G),typeof v.onCacheChange=="function"&&v.onCacheChange(R,U,G))};p.push({expirationMethod:Z,key:q,timeoutId:y(Z,P)})}}}function g(p,v){return function(b){var P=b.keys[0],E=c(p,P);~E&&(m(p,P,!1),p[E].timeoutId=y(p[E].expirationMethod,v.maxAge))}}function C(p,v,S,b){var P=typeof v.maxAge=="number"&&isFinite(v.maxAge)?w(p,v,S,b):void 0;return{onCacheAdd:P,onCacheHit:P&&v.updateExpire?g(p,v):void 0}}var x={anonymousProfileNameCounter:1,isCollectingStats:!1,profiles:{}},W=!1;function V(p){p?delete x.profiles[p]:x.profiles={}}function X(p){p===void 0&&(p=!0),x.isCollectingStats=p}function oe(p){var v=p.profileName;return function(){v&&!x.profiles[v]&&(x.profiles[v]={calls:0,hits:0}),x.profiles[v].calls++}}function ee(p){return function(){var v=x.profiles,S=p.profileName;v[S]||(v[S]={calls:0,hits:0}),v[S].calls++,v[S].hits++}}function O(p){return p.displayName||p.name||"Anonymous "+x.anonymousProfileNameCounter++}function D(p,v){return p?(v/p*100).toFixed(4)+"%":"0.0000%"}function _(p){!x.isCollectingStats&&!W&&(console.warn('Stats are not currently being collected, please run "collectStats" to enable them.'),W=!0);var v=x.profiles;if(p){if(!v[p])return{calls:0,hits:0,usage:"0.0000%"};var S=v[p];return o({},S,{usage:D(S.calls,S.hits)})}var b=Object.keys(x.profiles).reduce(function(P,E){return P.calls+=v[E].calls,P.hits+=v[E].hits,P},{calls:0,hits:0});return o({},b,{profiles:Object.keys(v).reduce(function(P,E){return P[E]=_(E),P},{}),usage:D(b.calls,b.hits)})}function A(p){return x.isCollectingStats?{onCacheAdd:oe(p),onCacheHit:ee(p)}:{}}var M={arguments:!0,callee:!0,caller:!0,constructor:!0,length:!0,name:!0,prototype:!0};function L(p,v,S){S===void 0&&(S=[]),Object.getOwnPropertyNames(p).forEach(function(b){if(!M[b]&&S.indexOf(b)===-1){var P=Object.getOwnPropertyDescriptor(p,b);P.get||P.set?Object.defineProperty(v,b,P):v[b]=p[b]}})}function T(p,v){var S=v.expirations,b=p.options,P=d(b.isEqual,b.isMatchingKey),E=p;E.clear=function(){var R=E._microMemoizeOptions.onCacheChange,U=E.cache;return U.keys.length=0,U.values.length=0,R&&R(U,E.options,E),!0},E.clearStats=function(){V(E.options.profileName)},E.get=function(R){var U=E._microMemoizeOptions.transformKey,G=E.cache,q=U?U(R):R,Z=P(G.keys,q);return Z!==-1?E.apply(this,R):void 0},E.getStats=function(){return _(E.options.profileName)},E.has=function(R){var U=E._microMemoizeOptions.transformKey,G=U?U(R):R;return P(E.cache.keys,G)!==-1},E.keys=function(){return E.cacheSnapshot.keys},E.remove=function(R){var U=E._microMemoizeOptions,G=U.onCacheChange,q=U.transformKey,Z=E.cache,de=P(Z.keys,q?q(R):R);if(de===-1)return!1;var he=Z.keys[de];return Z.keys.splice(de,1),Z.values.splice(de,1),G&&G(Z,E.options,E),m(S,he,!0),!0},E.set=function(R,U){var G=E._microMemoizeOptions,q=E.cache,Z=E.options,de=G.onCacheAdd,he=G.onCacheChange,pe=G.transformKey,Ue=pe?pe(R):R,we=P(q.keys,Ue);if(we===-1){var Fe=Z.maxSize-1;q.size>Fe&&(q.keys.length=Fe,q.values.length=Fe),q.keys.unshift(Ue),q.values.unshift(U),Z.isPromise&&q.updateAsyncCache(E),de&&de(q,Z,E),he&&he(q,Z,E)}else{var ft=q.keys[we];q.values[we]=U,we>0&&q.orderByLru(ft,U,we),Z.isPromise&&q.updateAsyncCache(E),typeof he=="function"&&he(q,Z,E)}},E.values=function(){return E.cacheSnapshot.values}}function $(p,v){var S=v.expirations,b=v.options,P=v.originalFunction,E=p.options;Object.defineProperties(p,{_microMemoizeOptions:{configurable:!0,get:function(){return E}},cacheSnapshot:{configurable:!0,get:function(){var G=p.cache;return{keys:G.keys.slice(0),size:G.size,values:G.values.slice(0)}}},expirations:{configurable:!0,get:function(){return S}},expirationsSnapshot:{configurable:!0,get:function(){return S.slice(0)}},isMoized:{configurable:!0,get:function(){return!0}},options:{configurable:!0,get:function(){return b}},originalFunction:{configurable:!0,get:function(){return P}}});var R=p;L(P,R)}function N(p,v){return T(p,v),$(p,v),p}var z=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Y(p,v,S){var b=p(o({maxArgs:2,isShallowEqual:!0},S,{isReact:!1}));v.displayName||(v.displayName=v.name||"Component");function P(E,R,U){this.props=E,this.context=R,this.updater=U,this.MoizedComponent=b(v)}return P.prototype.isReactComponent={},P.prototype.render=function(){return{$$typeof:z,type:this.MoizedComponent,props:this.props,ref:null,key:null,_owner:null}},L(v,P,["contextType","contextTypes"]),P.displayName="Moized("+(v.displayName||v.name||"Component")+")",h(P,v.name,S.profileName),P}function ne(p){return function(v){if(p>=v.length)return v;if(p===0)return[];if(p===1)return[v[0]];if(p===2)return[v[0],v[1]];if(p===3)return[v[0],v[1],v[2]];for(var S=[],b=0;b<p;b++)S[b]=v[b];return S}}function se(p,v){for(var S=p.length,b=0;b<S;++b)if(p[b]===v)return b+1;return 0}function te(){var p=[],v=[];return function(b,P){var E=typeof P;if(E==="function"||E==="symbol")return P.toString();if(typeof P=="object"){if(p.length){var R=se(p,this);R===0?p[p.length]=this:(p.splice(R),v.splice(R)),v[v.length]=b;var U=se(p,P);if(U!==0)return"[ref="+(v.slice(0,U).join(".")||".")+"]"}else p[0]=P,v[0]=b;return P}return""+P}}function Oe(p){var v=typeof p;return p&&(v==="object"||v==="function")?JSON.stringify(p,te()):p}function lt(p){for(var v="|",S=0;S<p.length;S++)v+=Oe(p[S])+"|";return[v]}function ct(p){return typeof p.serializer=="function"?p.serializer:lt}function It(p,v){return p[0]===v[0]}function $t(p){if(typeof p=="function")return function(v,S,b){return p(b.cache,b.options,b)}}function ia(p){return p.matchesArg||p.isDeepEqual&&n.deepEqual||p.isShallowEqual&&n.shallowEqual||n.sameValueZeroEqual}function sa(p){return p.matchesKey||p.isSerialized&&It||void 0}function ua(p){return l(p.isSerialized&&ct(p),typeof p.transformArgs=="function"&&p.transformArgs,typeof p.maxArgs=="number"&&ne(p.maxArgs))}function la(p){var v=p.options.updateCacheForKey,S=function(){for(var P=arguments.length,E=new Array(P),R=0;R<P;R++)E[R]=arguments[R];if(!v(E))return p.apply(this,E);var U=p.fn.apply(this,E);return p.set(E,U),U};return L(p,S),S}var ca=["matchesArg","isDeepEqual","isPromise","isReact","isSerialized","isShallowEqual","matchesKey","maxAge","maxArgs","maxSize","onCacheAdd","onCacheChange","onCacheHit","onExpire","profileName","serializer","updateCacheForKey","transformArgs","updateExpire"],I=function p(v,S){var b=S||i;if(f(v)){var P=v.originalFunction,E=u(v.options,b);return p(P,E)}if(typeof v=="object")return function(kt,ma){if(typeof kt=="function"){var va=u(v,ma);return p(kt,va)}var ga=u(v,kt);return p(ga)};if(b.isReact)return Y(p,v,b);var R=o({},i,b,{maxAge:typeof b.maxAge=="number"&&b.maxAge>=0?b.maxAge:i.maxAge,maxArgs:typeof b.maxArgs=="number"&&b.maxArgs>=0?b.maxArgs:i.maxArgs,maxSize:typeof b.maxSize=="number"&&b.maxSize>=0?b.maxSize:i.maxSize,profileName:b.profileName||O(v)}),U=[];R.matchesArg,R.isDeepEqual;var G=R.isPromise;R.isReact,R.isSerialized,R.isShallowEqual,R.matchesKey,R.maxAge,R.maxArgs;var q=R.maxSize,Z=R.onCacheAdd,de=R.onCacheChange,he=R.onCacheHit;R.onExpire,R.profileName,R.serializer;var pe=R.updateCacheForKey;R.transformArgs,R.updateExpire;var Ue=a(R,ca),we=ia(R),Fe=sa(R),ft=C(U,R,we,Fe),zr=A(R),da=ua(R),ha=o({},Ue,{isEqual:we,isMatchingKey:Fe,isPromise:G,maxSize:q,onCacheAdd:$t(s(Z,ft.onCacheAdd,zr.onCacheAdd)),onCacheChange:$t(de),onCacheHit:$t(s(he,ft.onCacheHit,zr.onCacheHit)),transformKey:da}),pa=r(v,ha),dt=N(pa,{expirations:U,options:R,originalFunction:v});return pe&&(dt=la(dt)),h(dt,v.name,b.profileName),dt};I.clearStats=V,I.collectStats=X,I.compose=function(){return l.apply(void 0,arguments)||I},I.deep=I({isDeepEqual:!0}),I.getStats=_,I.infinite=I({maxSize:1/0}),I.isCollectingStats=function(){return x.isCollectingStats},I.isMoized=function(v){return typeof v=="function"&&!!v.isMoized},I.matchesArg=function(p){return I({matchesArg:p})},I.matchesKey=function(p){return I({matchesKey:p})};function fa(p,v){if(v===!0)return I({maxAge:p,updateExpire:v});if(typeof v=="object"){var S=v.onExpire,b=v.updateExpire;return I({maxAge:p,onExpire:S,updateExpire:b})}return I(typeof v=="function"?{maxAge:p,onExpire:v,updateExpire:!0}:{maxAge:p})}return I.maxAge=fa,I.maxArgs=function(p){return I({maxArgs:p})},I.maxSize=function(p){return I({maxSize:p})},I.profile=function(p){return I({profileName:p})},I.promise=I({isPromise:!0,updateExpire:!0}),I.react=I({isReact:!0}),I.serialize=I({isSerialized:!0}),I.serializeWith=function(p){return I({isSerialized:!0,serializer:p})},I.shallow=I({isShallowEqual:!0}),I.transformArgs=function(p){return I({transformArgs:p})},I.updateCacheForKey=function(p){return I({updateCacheForKey:p})},Object.defineProperty(I,"default",{configurable:!1,enumerable:!1,value:I,writable:!1}),I})})(Ot,Ot.exports);var rl=Ot.exports;const ea=Lo(rl);window._moize=ea;function nl(e,t={}){return ea(e,{...t,maxSize:50,isDeepEqual:!0})}function ol(e,t={}){return nl(e,{isPromise:!0,...t})}function al(e,t){let r=[],n=!1;function o(){if(r.length===0){n=!1;return}r.shift()(),setTimeout(o,t)}return function(...a){const i=()=>e.apply(this,a);r.push(i),n||(n=!0,setTimeout(o,t))}}class il extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}}function sl({limit:e,interval:t,strict:r,onDelay:n}){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");const o=new Map;let a=0,i=0;function s(){const u=Date.now();return u-a>t?(i=1,a=u,0):(i<e?i++:(a+=t,i=1),a-u)}const l=[];function c(){const u=Date.now();if(l.length>0&&u-l.at(-1)>t&&(l.length=0),l.length<e)return l.push(u),0;const f=l[0]+t;return l.shift(),l.push(f),Math.max(0,f-u)}const d=r?c:s;return u=>{const f=function(...h){if(!f.isEnabled)return(async()=>u.apply(this,h))();let m;return new Promise((y,w)=>{const g=()=>{y(u.apply(this,h)),o.delete(m)},C=d();C>0?(m=setTimeout(g,C),o.set(m,w),n==null||n()):g()})};return f.abort=()=>{for(const h of o.keys())clearTimeout(h),o.get(h)(new il);o.clear(),l.splice(0,l.length)},f.isEnabled=!0,Object.defineProperty(f,"queueSize",{get(){return o.size}}),f}}const ul=sl({limit:1,interval:1e3}),Mn=[/\/@[^@\/]+@?[^\/]+?\/(\d+)$/i,/\/notice\/(\w+)$/i];function ll(e){var t;for(let r=0;r<Mn.length;r++){const n=(t=e.match(Mn[r]))==null?void 0:t[1];if(n)return n}return null}const cl=/(twitter|github)\.com/i,jn={};function fl(e,t){var m;const r=sr(Tt);if(cl.test(t)||jn[t])return;if(new RegExp(e+"/").test((m=r.unfurledLinks[t])==null?void 0:m.url))return Promise.resolve(r.unfurledLinks[t]);let o,a=t;/\/\/elk\.[^\/]+\/[^\/]+\.[^\/]+/i.test(a)&&(a=a.replace(/elk\.[^\/]+\//i,"")),/\/\/trunks\.[^\/]+\/status\/[^\/]+\.[^\/]+/i.test(a)&&(a=a.replace(/trunks\.[^\/]+\/status\//i,"")),/\/#\/[^\/]+\.[^\/]+\/s\/.+/i.test(a)&&(a=`https://${a.split("/#/")[1].replace(/\/s\//i,"/@fakeUsername/")}`);const i=URL.parse(a);if(!i)return;const s=i.hostname,l=i.pathname;let c=ll(l);if(c){const y=c,{masto:w}=xt({instance:s});o=w.v1.statuses.$select(y).fetch().then(g=>{if(g!=null&&g.id)return{status:g,instance:s};throw new Error("No results")})}const{masto:d}=xt({instance:e}),u=d.v2.search.fetch({q:a,type:"statuses",resolve:!0,limit:1}).then(y=>{const{statuses:w}=y;if(w.length>0){const g=w.filter(C=>{var x;return!((x=C.content)!=null&&x.toLowerCase().includes(a.toLowerCase()))});if(g.length===1)return{status:g[0],instance:e}}throw new Error("No results")});function f(y){const{status:w,instance:g}=y,{id:C}=w,x=`/${g}/s/${C}`,W={id:C,instance:g,url:x};return Tt.unfurledLinks[t]=W,ta(w,g,{skipThreading:!0}),W}function h(y){jn[t]=!0}return o?Promise.race([u,new Promise((w,g)=>setTimeout(g,3e3))]).catch(()=>o.catch(()=>u)).then(f).catch(h):u.then(f).catch(h)}const dl=ul(fl),F=Yi({appVersion:{},prevLocation:null,currentLocation:null,statuses:{},statusThreadNumber:{},home:[],homeNew:[],homeLast:null,homeLastFetchTime:null,notifications:[],notificationsLast:null,notificationsNew:[],notificationsShowNew:!1,notificationsLastFetchTime:null,reloadStatusPage:0,reloadGenericAccounts:{id:null,counter:0},spoilers:{},spoilersMedia:{},scrollPositions:{},unfurledLinks:{},statusQuotes:{},statusFollowedTags:{},statusReply:{},accounts:{},routeNotification:null,composerState:{},showCompose:!1,showSettings:!1,showAccount:!1,showAccounts:!1,showDrafts:!1,showMediaModal:!1,showShortcutsSettings:!1,showKeyboardShortcutsHelp:!1,showGenericAccounts:!1,showMediaAlt:!1,showEmbedModal:!1,showReportModal:!1,shortcuts:[],settings:{autoRefresh:!1,shortcutsViewMode:null,shortcutsColumnsMode:!1,boostsCarousel:!0,contentTranslation:!0,contentTranslationTargetLanguage:null,contentTranslationHideLanguages:[],contentTranslationAutoInline:!1,shortcutSettingsCloudImportExport:!1,mediaAltGenerator:!1,composerGIFPicker:!1,cloakMode:!1,groupedNotificationsAlpha:!1}}),Tt=F;function tc(){F.notificationsLast=j.account.get("notificationsLast")||null,F.shortcuts=j.account.get("shortcuts")??[],F.settings.autoRefresh=j.account.get("settings-autoRefresh")??!1,F.settings.shortcutsViewMode=j.account.get("settings-shortcutsViewMode")??null,j.account.get("settings-shortcutsColumnsMode")&&(F.settings.shortcutsColumnsMode=!0),F.settings.boostsCarousel=j.account.get("settings-boostsCarousel")??!0,F.settings.contentTranslation=j.account.get("settings-contentTranslation")??!0,F.settings.contentTranslationTargetLanguage=j.account.get("settings-contentTranslationTargetLanguage")||null,F.settings.contentTranslationHideLanguages=j.account.get("settings-contentTranslationHideLanguages")||[],F.settings.contentTranslationAutoInline=j.account.get("settings-contentTranslationAutoInline")??!1,F.settings.shortcutSettingsCloudImportExport=j.account.get("settings-shortcutSettingsCloudImportExport")??!1,F.settings.mediaAltGenerator=j.account.get("settings-mediaAltGenerator")??!1,F.settings.composerGIFPicker=j.account.get("settings-composerGIFPicker")??!1,F.settings.cloakMode=j.account.get("settings-cloakMode")??!1,F.settings.groupedNotificationsAlpha=j.account.get("settings-groupedNotificationsAlpha")??!1}Xo(F,"notificationsLast",e=>{j.account.set("notificationsLast",F.notificationsLast)});Lr(F,e=>{for(const[t,r,n,o]of e)r.join(".")==="settings.autoRefresh"&&j.account.set("settings-autoRefresh",!!n),r.join(".")==="settings.boostsCarousel"&&j.account.set("settings-boostsCarousel",!!n),r.join(".")==="settings.shortcutsViewMode"&&j.account.set("settings-shortcutsViewMode",n),r.join(".")==="settings.contentTranslation"&&j.account.set("settings-contentTranslation",!!n),r.join(".")==="settings.contentTranslationAutoInline"&&j.account.set("settings-contentTranslationAutoInline",!!n),r.join(".")==="settings.shortcutSettingsCloudImportExport"&&j.account.set("settings-shortcutSettingsCloudImportExport",!!n),r.join(".")==="settings.contentTranslationTargetLanguage"&&j.account.set("settings-contentTranslationTargetLanguage",n),/^settings\.contentTranslationHideLanguages/i.test(r.join("."))&&j.account.set("settings-contentTranslationHideLanguages",F.settings.contentTranslationHideLanguages),r.join(".")==="settings.mediaAltGenerator"&&j.account.set("settings-mediaAltGenerator",!!n),r.join(".")==="settings.composerGIFPicker"&&j.account.set("settings-composerGIFPicker",!!n),(r==null?void 0:r[0])==="shortcuts"&&j.account.set("shortcuts",F.shortcuts),r.join(".")==="settings.cloakMode"&&j.account.set("settings-cloakMode",!!n),r.join(".")==="settings.groupedNotificationsAlpha"&&j.account.set("settings-groupedNotificationsAlpha",!!n)});function Le(e,t){if(e)return t?`${t}/${e}`:e}function hl(e,t){if(t){const r=Le(e,t);return F.statuses[r]}return F.statuses[e]}function ta(e,t,r){typeof t=="object"&&(r=t,t=null);const{override:n=!0,skipThreading:o=!1,skipUnfurling:a=!1}=r||{};if(!e)return;const i=hl(e.id,t);!n&&i||Qu(e,i)||(queueMicrotask(()=>{var l,c;const s=Le(e.id,t);if(i!=null&&i._pinned&&(e._pinned=i._pinned),F.statuses[s]=e,(l=e.reblog)!=null&&l.id){const d=Le(e.reblog.id,t);F.statuses[d]=e.reblog}if((c=e.quote)!=null&&c.id){const d=Le(e.quote.id,t);F.statuses[d]=e.quote,F.statusQuotes[s]=[{id:e.quote.id,instance:t}]}}),o||queueMicrotask(()=>{ml(e.reblog||e,t)}),a||queueMicrotask(()=>{vl(e.reblog||e,t)}))}function pl(e,t){const{masto:r,instance:n}=xt({instance:t});let o=0;async function a(i,s=0){const{inReplyToId:l,inReplyToAccountId:c}=i;if(!l||c!==i.account.id)return[i];if(l&&c!==i.account.id)throw"Not a thread";const d=Le(l,n);let u=F.statuses[d];if(!u){if(o++>3)throw"Too many fetches for thread";await new Promise(f=>setTimeout(f,500*o)),u=await gl(l,r),ta(u,n,{skipThreading:!0})}return[...await a(u,++s),i]}return a(e).then(i=>{i.length>1&&i.forEach((s,l)=>{const c=Le(s.id,n);F.statusThreadNumber[c]=l+1})}).catch(i=>{})}const ml=al(pl,100),In=document.createElement("div");function vl(e,t){const{instance:r}=xt(),n=e==null?void 0:e.content;if(/<a/i.test(n)){const a=Le(e==null?void 0:e.id,t);In.innerHTML=n,[...In.querySelectorAll("a[href]:not(.u-url):not(.mention):not(.hashtag)")].filter(s=>{const l=s.href;return!(l===e.url||l===e.uri)&&Xu(l)}).forEach((s,l)=>{dl(r,s.href).then(c=>{c&&a&&(c==null?void 0:c.id)!==e.id&&(Array.isArray(F.statusQuotes[a])||(F.statusQuotes[a]=[]),F.statusQuotes[a][l]||F.statusQuotes[a].splice(l,0,c))})})}}const gl=ol((e,t)=>t.v1.statuses.$select(e).fetch()),yl="modulepreload",_l=function(e,t){return new URL(e,t).href},$n={},ra=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){const a=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),s=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.all(r.map(l=>{if(l=_l(l,n),l in $n)return;$n[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(!!n)for(let h=a.length-1;h>=0;h--){const m=a[h];if(m.href===l&&(!c||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":yl,c||(f.as="script",f.crossOrigin=""),f.href=l,s&&f.setAttribute("nonce",s),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}return o.then(()=>t()).catch(a=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a})};function wl({abrupt:e,hidden:t,...r}){return Pt("span",{...r,class:`loader-container ${e?"abrupt":""} ${t?"hidden":""}`,children:Pt("span",{class:"loader"})})}var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});var na=Fr.shouldPolyfill=void 0;function bl(){return!Intl.Segmenter}na=Fr.shouldPolyfill=bl;const oa=!na();function aa(){if(!oa)return ra(()=>import("./polyfill-force-g5zrZgQH.js").then(e=>e.p),__vite__mapDeps([0,1]),import.meta.url).catch(()=>{})}function dr(){return ra(()=>import("./compose-z10cLv8p.js"),__vite__mapDeps([2,3,4,1]),import.meta.url)}async function rc(){try{await aa(),dr()}catch{}}function nc(e){const[t,r]=$e(null);return Ae(()=>{(async()=>{try{if(oa){const n=await dr();r(n)}else{await aa();const n=await dr();r(n)}}catch{}})()},[]),t!=null&&t.default?Pt(t.default,{...e}):Pt(wl,{})}var El={PHANPY_CLIENT_NAME:"Phanpy",PHANPY_WEBSITE:"https://phanpy.social",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",VITE_APP_ENV:"production",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{PHANPY_CLIENT_NAME:kn}=El;function oc(e,t){function r(){const{currentLocation:n}=Tt,o=Array.isArray(t);let a=o?t:[];!o&&/:?\w+\?/.test(t)&&(a.push(t.replace(/(:\w+)\?/g,"$1")),a.push(t.replace(/\/?:\w+\?/g,"")));let i=!1;a.length?i=a.some(s=>tr(s,n)):t&&(i=tr(t,n)),i&&(document.title=e?`${e} / ${kn}`:kn)}Re(()=>{const n=Xo(Tt,"currentLocation",r);return r(),n},[e,t])}export{Nr as $,ye as A,Dl as B,nc as C,eo as D,re as E,vr as F,Ul as G,Rl as H,oc as I,hl as J,nl as K,wl as L,Xo as M,tr as N,ml as O,be as P,ql as Q,Fl as R,zl as S,_e as T,tc as U,xl as V,ki as W,Tl as X,at as Y,Pe as Z,Re as _,xt as a,ra as a0,ea as a1,ao as a2,go as a3,yo as a4,po as a5,Ca as a6,ue as a7,H as a8,sl as a9,ys as aa,Me as ab,Wn as ac,_r as ad,bo as ae,Xu as af,dl as ag,Bl as ah,xs as ai,Il as aj,Gi as ak,kl as al,Qu as am,ta as b,Pt as c,j as d,Go as e,Ur as f,Cu as g,$e as h,Or as i,ol as j,ce as k,$l as l,Kt as m,Jo as n,Lo as o,Lt as p,Be as q,Lr as r,Tt as s,xi as t,Ml as u,rc as v,Le as w,Xn as x,Ae as y,Eu as z};
//# sourceMappingURL=useTitle-KlNTnsJV.js.map