phanpy-cz/assets/main-v0c3KDmS.js

35 lines
288 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.

import{A as Y,y as se,h as L,s as A,a as ae,b as We,i as g,C as st,u as qe,c as e,T as u,d as be,g as wt,p as Mt,e as vn,f as z,j as Qe,k as $n,L as ao,l as _e,D as ro,m as lo,o as Yn,q as Gt,r as _t,t as ct,v as uo,w as Pe,x as yn,z as _i,_ as gt,B as cs,E as nd,F as as,G as rs,H as ho,I as fo,J as it,K as po,M as ei,N as ft,O as mo,P as go,Q as bo,R as ti,S as $t,U as Xe,V as ls,W as ds,X as vo,Y as tn,Z as yo,$ as wo,a0 as Dn,a1 as Nn,a2 as ko,a3 as Si,a4 as _o,a5 as So,a6 as Co,a7 as ni,a8 as Ve,a9 as Io,aa as To,ab as xo,ac as Ao}from"./useTitle-twbEvXzq.js";import{u as ii,s as ue,a as Be,o as Ci,b as Eo,I as S,M as Fe,A as dt,N as mt,c as at,d as ke,e as Ue,f as Ge,g as lt,L as he,l as It,h as us,t as Ii,i as Ze,R as Kt,p as sd,j as tt,k as Dt,m as rt,n as hs,q as jn,E as fs,r as Ke,v as ht,w as Ro,S as Tn,x as Ti,T as ps,y as ut,z as si,B as Ye,C as kt,D as Lo,F as Mo,G as Et,H as oi,J as ms,K as $o,O as Ht,P as Do,Q as No,U as gs,V as Po,W as Oo,X as bs,Y as zo,Z as Rt,_ as ci,$ as Bo,a0 as vs,a1 as Uo,a2 as ys,a3 as Fo,a4 as Ho,a5 as qo,a6 as xi,a7 as Yo,a8 as zt}from"./fuse-Iwa_1AAn.js";var ws=jo;function jo(t,n,i){var s=null,o=null,a=function(){s&&(clearTimeout(s),o=null,s=null)},h=function(){var c=o;a(),c&&c()},r=function(){if(!n)return t.apply(this,arguments);var c=this,l=arguments,p=i&&!s;if(a(),o=function(){t.apply(c,l)},s=setTimeout(function(){if(s=null,!p){var f=o;return o=null,f()}},n),p)return o()};return r.cancel=a,r.flush=h,r}/*!
* swiped-events.js - v@version@
* Pure JavaScript swipe events
* https://github.com/john-doherty/swiped-events
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
* @author John Doherty <www.johndoherty.info>
* @license MIT
*/(function(t,n){"use strict";typeof t.CustomEvent!="function"&&(t.CustomEvent=function(d,v){v=v||{bubbles:!1,cancelable:!1,detail:void 0};var b=n.createEvent("CustomEvent");return b.initCustomEvent(d,v.bubbles,v.cancelable,v.detail),b},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",p,!1),n.addEventListener("touchmove",f,!1),n.addEventListener("touchend",l,!1);var i=null,s=null,o=null,a=null,h=null,r=null,c=0;function l(d){if(r===d.target){var v=parseInt(m(r,"data-swipe-threshold","20"),10),b=m(r,"data-swipe-unit","px"),y=parseInt(m(r,"data-swipe-timeout","500"),10),w=Date.now()-h,k="",C=d.changedTouches||d.touches||[];if(b==="vh"&&(v=Math.round(v/100*n.documentElement.clientHeight)),b==="vw"&&(v=Math.round(v/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(a)?Math.abs(o)>v&&w<y&&(o>0?k="swiped-left":k="swiped-right"):Math.abs(a)>v&&w<y&&(a>0?k="swiped-up":k="swiped-down"),k!==""){var I={dir:k.replace(/swiped-/,""),touchType:(C[0]||{}).touchType||"direct",fingers:c,xStart:parseInt(i,10),xEnd:parseInt((C[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((C[0]||{}).clientY||-1,10)};r.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:I})),r.dispatchEvent(new CustomEvent(k,{bubbles:!0,cancelable:!0,detail:I}))}i=null,s=null,h=null}}function p(d){d.target.getAttribute("data-swipe-ignore")!=="true"&&(r=d.target,h=Date.now(),i=d.touches[0].clientX,s=d.touches[0].clientY,o=0,a=0,c=d.touches.length)}function f(d){if(!(!i||!s)){var v=d.touches[0].clientX,b=d.touches[0].clientY;o=i-v,a=s-b}}function m(d,v,b){for(;d&&d!==n.documentElement;){var y=d.getAttribute(v);if(y)return y;d=d.parentNode}return b}})(window,document);function qt(t=()=>{},n=[]){const i=Y(t);se(()=>{i.current=t},[n]),se(()=>{const s=()=>{const o=document.hidden||document.visibilityState==="hidden";i.current(!o)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const Vo=1e3*3,Ai=2e4,Go=st(function({isLoggedIn:n}){const[i,s]=L(!0),o=Y();qt(c=>{clearTimeout(o.current),c?s(!0):o.current=setTimeout(()=>{s(!1)},Ai)});const a=async(c,l,p)=>{var f;if(A.notificationsLast){const m=c.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:d}=await m.next();if(d!=null&&d.length)if(p)A.notificationsShowNew=!0;else{let v;try{const b=await c.v1.markers.fetch({timeline:"notifications"});v=(f=b==null?void 0:b.notifications)==null?void 0:f.lastReadId}catch{}v?A.notificationsShowNew=d[0].id!==v:A.notificationsShowNew=!0}}};se(()=>{let c,l,p;if(n&&i){const{masto:f,streaming:m,instance:d}=ae();(async()=>{await a(f,d);let v=!1;m&&(l=setTimeout(()=>{(async()=>{try{v=!0,c=m.user.notification.subscribe();for await(const b of c){if(!c||!i)break;b.event==="notification"&&We(b.payload,d,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{v=!1}v||(p=setInterval(()=>{a(f,d,!0)},Ai))})()},Vo))})()}return()=>{var f;(f=c==null?void 0:c.unsubscribe)==null||f.call(c),c=null,clearTimeout(l),clearInterval(p)}},[i,n]);const h=Y(),r=()=>{h.current=Date.now(),fetch("./version.json").then(c=>c.json()).then(c=>{c&&(A.appVersion=c)}).catch(c=>{})};return ii(r,i&&1e3*60*30),qt(c=>{c&&(h.current?Date.now()-h.current>1e3*60*60&&r():r())}),Be("shift+alt+k",()=>{const c=A.settings.cloakMode;A.settings.cloakMode=!c,ue({text:c?g._({id:"oguMwa"}):g._({id:"IXZLPs"})})}),null});function Ko(){const t=qe(A);function n(i){if(t.composerState.minimized){A.composerState.minimized=!1,Ci();return}i.shiftKey?Eo()||(A.showCompose=!0):(Ci(),A.showCompose=!0)}return Be("c, shift+c",n,{ignoreEventWhen:i=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:n,class:`${t.composerState.minimized?"min":""} ${t.composerState.publishing?"loading":""} ${t.composerState.publishingError?"error":""}`,children:e(S,{icon:"quill",size:"xl",alt:g._({id:"QOhkyl"})})})}const Wo=st(function(){const n=qe(A);function i(){A.showKeyboardShortcutsHelp=!1}return Be("?, shift+?, shift+slash",s=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:s=>!!document.querySelector("#modal-container > *")}),!!n.showKeyboardShortcutsHelp&&e(Fe,{onClose:i,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:i,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"77Emn0"})})}),e("main",{children:e("table",{children:e("tbody",{children:[{action:g._({id:"ulXSNi"}),keys:e("kbd",{children:"?"})},{action:g._({id:"Gy9P9T"}),keys:e("kbd",{children:"j"})},{action:g._({id:"6XYpYY"}),keys:e("kbd",{children:"k"})},{action:g._({id:"DYowFe"}),keys:e(u,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"S5ez7Y"}),keys:e(u,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:g._({id:"jsFF8C"}),keys:e(u,{id:"80sOCm",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:e(u,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:g._({id:"jAj8rv"}),keys:e(u,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"duF1lx"}),keys:e(u,{id:"nhpsIN",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"YrR3Co"}),keys:e("kbd",{children:"]"})},{action:g._({id:"noxAFR"}),keys:e("kbd",{children:"["})},{action:g._({id:"AIa/f7"}),keys:e("kbd",{children:"c"})},{action:g._({id:"snPx8X"}),className:"insignificant",keys:e(u,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"1pKapz"}),keys:e(u,{id:"py67WT",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{}),3:e("kbd",{})}})},{action:g._({id:"A1taO8"}),keys:e("kbd",{children:"/"})},{action:g._({id:"ImOQa9"}),keys:e("kbd",{children:"r"})},{action:g._({id:"KFs8c6"}),className:"insignificant",keys:e(u,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"cqi4Mx"}),keys:e(u,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"kulphB"}),keys:e(u,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:g._({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:g._({id:"C7ujRh"}),keys:e(u,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})}].map(({action:s,className:o,keys:a})=>e("tr",{children:[e("th",{class:o,children:s}),e("td",{children:a})]},s))})})})]})})}),ks=new Set,nt=new WeakMap,Yt=new WeakMap,Lt=new WeakMap,Vn=new WeakMap,Zo=new WeakMap,jt=new WeakMap,wn=new WeakMap,Qt=new WeakSet;let Tt,ai=0,ri=0;const vt="__aa_tgt",nn="__aa_del",kn="__aa_new",Xo=t=>{const n=ic(t);n&&n.forEach(i=>sc(i))},Jo=t=>{t.forEach(n=>{n.target===Tt&&ec(),nt.has(n.target)&&Nt(n.target)})};function Qo(t){const n=Vn.get(t);n==null||n.disconnect();let i=nt.get(t),s=0;const o=5;i||(i=Vt(t),nt.set(t,i));const{offsetWidth:a,offsetHeight:h}=Tt,c=[i.top-o,a-(i.left+o+i.width),h-(i.top+o+i.height),i.left-o].map(p=>`${-1*Math.floor(p)}px`).join(" "),l=new IntersectionObserver(()=>{++s>1&&Nt(t)},{root:Tt,threshold:1,rootMargin:c});l.observe(t),Vn.set(t,l)}function Nt(t){clearTimeout(wn.get(t));const n=xn(t),i=sn(n)?500:n.duration;wn.set(t,setTimeout(async()=>{const s=Lt.get(t);try{await(s==null?void 0:s.finished),nt.set(t,Vt(t)),Qo(t)}catch{}},i))}function ec(){clearTimeout(wn.get(Tt)),wn.set(Tt,setTimeout(()=>{ks.forEach(t=>Is(t,n=>_s(()=>Nt(n))))},100))}function tc(t){setTimeout(()=>{Zo.set(t,setInterval(()=>_s(Nt.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function _s(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let Gn,Ft;const nc=typeof window<"u"&&"ResizeObserver"in window;nc&&(Tt=document.documentElement,Gn=new MutationObserver(Xo),Ft=new ResizeObserver(Jo),window.addEventListener("scroll",()=>{ri=window.scrollY,ai=window.scrollX}),Ft.observe(Tt));function ic(t){return t.reduce((s,o)=>[...s,...Array.from(o.addedNodes),...Array.from(o.removedNodes)],[]).every(s=>s.nodeName==="#comment")?!1:t.reduce((s,o)=>{if(s===!1)return!1;if(o.target instanceof Element){if(Pn(o.target),!s.has(o.target)){s.add(o.target);for(let a=0;a<o.target.children.length;a++){const h=o.target.children.item(a);if(h){if(nn in h)return!1;Pn(o.target,h),s.add(h)}}}if(o.removedNodes.length)for(let a=0;a<o.removedNodes.length;a++){const h=o.removedNodes[a];if(nn in h)return!1;h instanceof Element&&(s.add(h),Pn(o.target,h),Yt.set(h,[o.previousSibling,o.nextSibling]))}}return s},new Set)}function Pn(t,n){!n&&!(vt in t)?Object.defineProperty(t,vt,{value:t}):n&&!(vt in n)&&Object.defineProperty(n,vt,{value:t})}function sc(t){var n;const i=t.isConnected,s=nt.has(t);i&&Yt.has(t)&&Yt.delete(t),Lt.has(t)&&((n=Lt.get(t))===null||n===void 0||n.cancel()),kn in t?Ei(t):s&&i?cc(t):s&&!i?ac(t):Ei(t)}function pt(t){return Number(t.replace(/[^0-9.\-]/g,""))}function oc(t){let n=t.parentElement;for(;n;){if(n.scrollLeft||n.scrollTop)return{x:n.scrollLeft,y:n.scrollTop};n=n.parentElement}return{x:0,y:0}}function Vt(t){const n=t.getBoundingClientRect(),{x:i,y:s}=oc(t);return{top:n.top+s,left:n.left+i,width:n.width,height:n.height}}function Ss(t,n,i){let s=n.width,o=n.height,a=i.width,h=i.height;const r=getComputedStyle(t);if(r.getPropertyValue("box-sizing")==="content-box"){const l=pt(r.paddingTop)+pt(r.paddingBottom)+pt(r.borderTopWidth)+pt(r.borderBottomWidth),p=pt(r.paddingLeft)+pt(r.paddingRight)+pt(r.borderRightWidth)+pt(r.borderLeftWidth);s-=p,a-=p,o-=l,h-=l}return[s,a,o,h].map(Math.round)}function xn(t){return vt in t&&jt.has(t[vt])?jt.get(t[vt]):{duration:250,easing:"ease-in-out"}}function Cs(t){if(vt in t)return t[vt]}function li(t){const n=Cs(t);return n?Qt.has(n):!1}function Is(t,...n){n.forEach(i=>i(t,jt.has(t)));for(let i=0;i<t.children.length;i++){const s=t.children.item(i);s&&n.forEach(o=>o(s,jt.has(s)))}}function di(t){return Array.isArray(t)?t:[t]}function sn(t){return typeof t=="function"}function cc(t){const n=nt.get(t),i=Vt(t);if(!li(t))return nt.set(t,i);let s;if(!n)return;const o=xn(t);if(typeof o!="function"){const a=n.left-i.left,h=n.top-i.top,[r,c,l,p]=Ss(t,n,i),f={transform:`translate(${a}px, ${h}px)`},m={transform:"translate(0, 0)"};r!==c&&(f.width=`${r}px`,m.width=`${c}px`),l!==p&&(f.height=`${l}px`,m.height=`${p}px`),s=t.animate([f,m],{duration:o.duration,easing:o.easing})}else{const[a]=di(o(t,"remain",n,i));s=new Animation(a),s.play()}Lt.set(t,s),nt.set(t,i),s.addEventListener("finish",Nt.bind(null,t))}function Ei(t){kn in t&&delete t[kn];const n=Vt(t);nt.set(t,n);const i=xn(t);if(!li(t))return;let s;if(typeof i!="function")s=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:i.duration*1.5,easing:"ease-in"});else{const[o]=di(i(t,"add",n));s=new Animation(o),s.play()}Lt.set(t,s),s.addEventListener("finish",Nt.bind(null,t))}function Ri(t,n){var i;t.remove(),nt.delete(t),Yt.delete(t),Lt.delete(t),(i=Vn.get(t))===null||i===void 0||i.disconnect(),setTimeout(()=>{if(nn in t&&delete t[nn],Object.defineProperty(t,kn,{value:!0,configurable:!0}),n&&t instanceof HTMLElement)for(const s in n)t.style[s]=""},0)}function ac(t){var n;if(!Yt.has(t)||!nt.has(t))return;const[i,s]=Yt.get(t);Object.defineProperty(t,nn,{value:!0,configurable:!0});const o=window.scrollX,a=window.scrollY;if(s&&s.parentNode&&s.parentNode instanceof Element?s.parentNode.insertBefore(t,s):i&&i.parentNode?i.parentNode.appendChild(t):(n=Cs(t))===null||n===void 0||n.appendChild(t),!li(t))return Ri(t);const[h,r,c,l]=lc(t),p=xn(t),f=nt.get(t);(o!==ai||a!==ri)&&rc(t,o,a,p);let m,d={position:"absolute",top:`${h}px`,left:`${r}px`,width:`${c}px`,height:`${l}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!sn(p))Object.assign(t.style,d),m=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:p.duration,easing:"ease-out"});else{const[v,b]=di(p(t,"remove",f));(b==null?void 0:b.styleReset)!==!1&&(d=(b==null?void 0:b.styleReset)||d,Object.assign(t.style,d)),m=new Animation(v),m.play()}Lt.set(t,m),m.addEventListener("finish",Ri.bind(null,t,d))}function rc(t,n,i,s){const o=ai-n,a=ri-i,h=document.documentElement.style.scrollBehavior;if(getComputedStyle(Tt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+o,window.scrollY+a),!t.parentElement)return;const c=t.parentElement;let l=c.clientHeight,p=c.clientWidth;const f=performance.now();function m(){requestAnimationFrame(()=>{if(!sn(s)){const d=l-c.clientHeight,v=p-c.clientWidth;f+s.duration>performance.now()?(window.scrollTo({left:window.scrollX-v,top:window.scrollY-d}),l=c.clientHeight,p=c.clientWidth,m()):document.documentElement.style.scrollBehavior=h}})}m()}function lc(t){const n=nt.get(t),[i,,s]=Ss(t,n,Vt(t));let o=t.parentElement;for(;o&&(getComputedStyle(o).position==="static"||o instanceof HTMLBodyElement);)o=o.parentElement;o||(o=document.body);const a=getComputedStyle(o),h=nt.get(o)||Vt(o),r=Math.round(n.top-h.top)-pt(a.borderTopWidth),c=Math.round(n.left-h.left)-pt(a.borderLeftWidth);return[r,c,i,s]}function Ts(t,n={}){return Gn&&Ft&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!sn(n)&&!n.disrespectUserMotionPreference||(Qt.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),Is(t,Nt,tc,o=>Ft==null?void 0:Ft.observe(o)),sn(n)?jt.set(t,n):jt.set(t,{duration:250,easing:"ease-in-out",...n}),Gn.observe(t,{childList:!0}),ks.add(t))),Object.freeze({parent:t,enable:()=>{Qt.add(t)},disable:()=>{Qt.delete(t)},isEnabled:()=>Qt.has(t)})}function ui(t){const n=Y(null),[i,s]=L(),o=a=>{i&&(a?i.enable():i.disable())};return se(()=>{n.current instanceof HTMLElement&&s(Ts(n.current,t||{}))},[]),[n,o]}const dc=window.matchMedia("(display-mode: standalone)").matches;function uc({onClose:t}){const{masto:n}=ae(),i=be.local.getJSON("accounts"),s=wt(),o=i.length>1,[a,h]=Mt(c=>c+1,0),[r]=ui();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(u,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:r,children:i.map((c,l)=>{const p=c.info.id===s,f=l===0;return e("li",{children:[e("div",{children:[o&&e("span",{class:`current ${p?"is-current":""}`,children:e(S,{icon:"check-circle",alt:g._({id:"Hp1l6f"})})}),e(dt,{url:c.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(p)try{const m=await n.v1.accounts.$select(c.info.id).fetch();c.info=m,be.local.setJSON("accounts",i),h()}catch{}}}),e(mt,{account:o?{...c.info,acct:/@/.test(c.info.acct)?c.info.acct:`${c.info.acct}@${c.instanceURL}`}:c.info,showAcct:!0,onClick:()=>{p?A.showAccount=`${c.info.username}@${c.instanceURL}`:(vn(c.info.id),location.reload())}})]}),e("div",{class:"actions",children:[f&&o&&e(z,{children:[e("span",{class:"tag",children:e(u,{id:"ovBPCi"})})," "]}),e(at,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(S,{icon:"more",size:"l",alt:g._({id:"2FYpfJ"})})}),children:[o&&e(z,{children:[e(ke,{disabled:p,onClick:()=>{vn(c.info.id),location.reload()},children:[e(S,{icon:"transfer"})," ",e(u,{id:"3t/Nrv"})]}),!dc&&!p&&e(Ue,{href:`./?account=${c.info.id}`,target:"_blank",children:[e(S,{icon:"external"}),e("span",{children:e(u,{id:"PZgZtY"})})]}),e(Ge,{})]}),e(ke,{onClick:()=>{A.showAccount=`${c.info.username}@${c.instanceURL}`},children:[e(S,{icon:"user"}),e("span",{children:e(u,{id:"40z2Fm"})})]}),e(Ge,{}),o&&e(ke,{disabled:f,onClick:()=>{i.splice(l,1),i.unshift(c),be.local.setJSON("accounts",i),h()},children:[e(S,{icon:"check-circle"}),e("span",{children:e(u,{id:"PPcets"})})]}),e(lt,{subMenu:!0,confirmLabel:e(z,{children:[e(S,{icon:"exit"}),e("span",{children:e(u,{id:"k08LxG",values:{0:c.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!p,menuItemClassName:"danger",onClick:()=>{i.splice(l,1),be.local.setJSON("accounts",i),location.href=location.pathname||"/"},children:[e(S,{icon:"exit"}),e("span",{children:e(u,{id:"CXk1bI"})})]})]})]})]},c.info.id)})}),e("p",{children:e(he,{to:"/login",class:"button plain2",onClick:t,children:[e(S,{icon:"plus"})," ",e("span",{children:e(u,{id:"Is7/PB"})})]})}),o&&e("p",{children:e("small",{children:e(u,{id:"52x24e",components:{0:e("i",{})}})})})]})})]})}const hi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='none'%20d='M0%200h63.994v63.994H0z'/%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e",hc={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function fi(){const{i18n:t}=Qe(),n=_e(()=>ao.map(i=>{var h,r;const s=hc[i]||i.replace(/-[a-z]+$/i,""),o=It({code:s,locale:i,fallback:(h=$n.find(c=>c.code===i))==null?void 0:h.nativeName}),a=It({code:s,locale:t.locale,fallback:(r=$n.find(c=>c.code===i))==null?void 0:r.name});return{code:i,regionlessCode:s,_common:a,native:o}}).sort((i,s)=>{const o=i._common.localeCompare(s._common,t.locale);return o!==0?o:i.code<s.code?-1:i.code>s.code?1:0}),[]);return e("label",{class:"lang-selector",children:["🌐"," ",e("select",{class:"small",value:t.locale||ro,onChange:i=>{be.local.set("lang",i.target.value),lo(i.target.value)},children:[n.map(({code:i,regionlessCode:s,native:o})=>{var r;const a=It({code:s,locale:t.locale,fallback:(r=$n.find(c=>c.code===i))==null?void 0:r.name});return e("option",{value:i,"data-regionless-code":s,children:!!a&&a!==o?`${o} - ${a}`:o},i)}),void 0]})]})}function Li(t){const{masto:n}=ae();return n.v1.push.subscription.create(t)}function fc(){const{masto:t}=ae();return t.v1.push.subscription.fetch()}function pc(t){const{masto:n}=ae();return n.v1.push.subscription.update(t)}function mc(){const{masto:t}=ae();return t.v1.push.subscription.remove()}function An(){return"serviceWorker"in navigator&&"PushManager"in window}function gc(){return navigator.serviceWorker.getRegistration()}async function pi(){const t=await gc(),n=t?await t.pushManager.getSubscription():void 0;return{registration:t,subscription:n}}function xs(t){const n="=".repeat((4-t.length%4)%4),i=`${t}${n}`.replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(i),o=new Uint8Array(s.length);for(let a=0;a<s.length;++a)o[a]=s.charCodeAt(a);return o}async function bc(){if(!An())return;const{subscription:t}=await pi();let n=null;try{n=await fc()}catch(i){if(!/(not found|unknown)/i.test(i.message))throw i}if(n&&t){const i=n.endpoint===t.endpoint,s=Yn(),o=n.serverKey===s;if(!i)throw new Error("Backend subscription endpoint changed");if(!o)throw new Error("Backend subscription key and vapid key changed")}if(t&&!n){const i=Yn();if(i){const{applicationServerKey:s}=t.options,o=xs(i).toString(),a=new Uint8Array(s).toString();if(!(o===a))throw await t.unsubscribe(),new Error("Subscription key and vapid key changed")}}return{subscription:t,backendSubscription:n}}async function Mi({data:t,policy:n}){if(!An())return;let{registration:i,subscription:s}=await pi(),o=null;if(s)try{o=await pc({data:t,policy:n})}catch{o=await Li({subscription:s,data:t,policy:n})}else{const a=Yn();if(!a)throw new Error("No server key found");s=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:xs(a)}),o=await Li({subscription:s,data:t,policy:n})}return{subscription:s,backendSubscription:o}}async function $i(){if(!An())return;const{subscription:t}=await pi();t&&(await mc(),await t.unsubscribe())}const vc={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",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",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},Di=16,At=[14,15,16,17,18,19,20],{PHANPY_WEBSITE:Ni,PHANPY_PRIVACY_POLICY_URL:yc,PHANPY_IMG_ALT_API_URL:wc,PHANPY_GIPHY_API_KEY:kc}=vc;function _c({onClose:t}){const n=qe(A),i=be.local.get("theme")||"auto",s=Y(),o=n.settings.contentTranslationTargetLanguage||null,a=us(),h=It(a),r=be.local.get("textSize")||Di,[c,l]=L(be.account.get("preferences")||{}),{masto:p,authenticated:f,instance:m}=ae();return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${r}px`},children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(u,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:s,onInput:d=>{d.preventDefault();const b=new FormData(s.current).get("theme"),y=document.documentElement;if(b==="auto"){y.classList.remove("is-light","is-dark");const w=document.querySelector('meta[data-theme-setting="manual"]');w&&(w.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(C=>{C.name="theme-color"})}else{y.classList.toggle("is-light",b==="light"),y.classList.toggle("is-dark",b==="dark");const w=document.querySelector('meta[data-theme-setting="manual"]');w&&(w.name="theme-color",w.content=b==="light"?w.dataset.themeLightColor:w.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(C=>{C.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",b==="auto"?"dark light":b),b==="auto"?be.local.del("theme"):be.local.set("theme",b)},children:e("div",{class:"radio-group",children:[e("label",{children:[e("input",{type:"radio",name:"theme",value:"light",defaultChecked:i==="light"}),e("span",{children:e(u,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:i==="dark"}),e("span",{children:e(u,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:i!=="light"&&i!=="dark"}),e("span",{children:e(u,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(u,{id:"7r6sCa"})})}),e("div",{class:"range-group",children:[e("span",{style:{fontSize:At[0]},children:e(u,{id:"J6ypuD"})})," ",e("input",{type:"range",min:At[0],max:At[At.length-1],step:"1",value:r,list:"sizes",onChange:d=>{const v=parseInt(d.target.value,10);document.documentElement.style.setProperty("--text-size",`${v}px`),v===Di?be.local.del("textSize"):be.local.set("textSize",d.target.value)}})," ",e("span",{style:{fontSize:At[At.length-1]},children:e(u,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:At.map(d=>e("option",{value:d}))})]})]}),e("li",{children:[e("span",{children:[e("label",{children:e(u,{id:"CeJHfb"})}),e("br",{}),e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener noreferrer",children:e(u,{id:"FFmj1D"})})})]}),e(fi,{})]})]})}),f&&e(z,{children:[e("h3",{children:e(u,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:e("li",{children:[e("div",{children:e("label",{for:"posting-privacy-field",children:[e(u,{id:"NAjVvt"})," ",e(S,{icon:"cloud",alt:g._({id:"N2FcBE"}),class:"synced-icon"})]})}),e("div",{children:e("select",{id:"posting-privacy-field",value:c["posting:default:visibility"]||"public",onChange:d=>{const{value:v}=d.target;(async()=>{try{await p.v1.accounts.updateCredentials({source:{privacy:v}}),l({...c,"posting:default:visibility":v}),be.account.set("preferences",{...c,"posting:default:visibility":v})}catch{alert(g._({id:"Oa+KBY"}))}})()},children:[e("option",{value:"public",children:e(u,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(u,{id:"WDcQq9"})}),e("option",{value:"private",children:e(u,{id:"o34OrG"})})]})})]})})}),e("p",{class:"section-postnote",children:[e(S,{icon:"cloud",alt:g._({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(u,{id:"xlsg7n",values:{instance:m},components:{0:e("a",{href:`https://${m}/`,target:"_blank",rel:"noopener noreferrer"})}})})]})]}),e("h3",{children:e(u,{id:"ivdhsq"})}),e("section",{children:e("ul",{children:[e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:n.settings.autoRefresh,onChange:d=>{A.settings.autoRefresh=d.target.checked}})," ",e(u,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:n.settings.boostsCarousel,onChange:d=>{A.settings.boostsCarousel=d.target.checked}})," ",e(u,{id:"TSbnoW"})]})}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.contentTranslation,onChange:d=>{const{checked:v}=d.target;A.settings.contentTranslation=v,v||(A.settings.contentTranslationTargetLanguage=null)}})," ",e(u,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${n.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(u,{id:"rJ8YHs"})," ",e("select",{value:o||"",disabled:!n.settings.contentTranslation,style:{width:"10em"},onChange:d=>{A.settings.contentTranslationTargetLanguage=d.target.value||null},children:[e("option",{value:"",children:e(u,{id:"jNCSyx",values:{systemTargetLanguageText:h}})}),e("option",{disabled:!0,children:"──────────"}),Ii.map(d=>{const v=It({code:d.code,fallback:d.name}),b=It({code:d.code,locale:d.code}),y=v!==b;return e("option",{value:d.code,children:y?`${b} - ${v}`:v})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(u,{id:"cc0NrU",values:{0:n.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:Ii.map(d=>{const v=It({code:d.code,fallback:d.name}),b=It({code:d.code,locale:d.code}),y=v!==b;return e("label",{children:[e("input",{type:"checkbox",checked:n.settings.contentTranslationHideLanguages.includes(d.code),onChange:w=>{const{checked:k}=w.target;k?A.settings.contentTranslationHideLanguages.push(d.code):A.settings.contentTranslationHideLanguages=n.settings.contentTranslationHideLanguages.filter(C=>C!==d.code)}})," ",y?e("span",{children:[b," ",e("span",{class:"insignificant",children:["- ",v]})]}):v]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"xpF+wU",components:{0:e("a",{href:"https://github.com/cheeaun/lingva-api",target:"_blank",rel:"noopener noreferrer"}),1:e("a",{href:"https://github.com/thedaviddelta/lingva-translate",target:"_blank",rel:"noopener noreferrer"})}})})}),e("hr",{}),e("div",{children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.contentTranslationAutoInline,disabled:!n.settings.contentTranslation,onChange:d=>{A.settings.contentTranslationAutoInline=d.target.checked}})," ",e(u,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!kc&&f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.composerGIFPicker,onChange:d=>{A.settings.composerGIFPicker=d.target.checked}})," ",e(u,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener noreferrer"})}})})})]}),!!wc&&f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.mediaAltGenerator,onChange:d=>{A.settings.mediaAltGenerator=d.target.checked}})," ",e(u,{id:"9q5uor"})," ",e(S,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener noreferrer"})}})})})]}),f&&Ze("@mastodon/grouped-notifications")&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.groupedNotificationsAlpha,onChange:d=>{A.settings.groupedNotificationsAlpha=d.target.checked}})," ",e(u,{id:"aGziA/"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"X17jCM"})})})]}),f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.shortcutSettingsCloudImportExport,onChange:d=>{A.settings.shortcutSettingsCloudImportExport=d.target.checked}})," ",e(u,{id:"570qTm"})," ",e(S,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"fHf1v/"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:n.settings.cloakMode,onChange:d=>{A.settings.cloakMode=d.target.checked}})," ",e(u,{id:"lxYe+I",components:{0:e("span",{class:"insignificant"}),1:e("samp",{}),2:e("samp",{})}})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"T/hglb"})})})]}),f&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{A.showDrafts=!0,A.showSettings=!1},children:e(u,{id:"krk5ws"})})})]})}),f&&e(Sc,{onClose:t}),e("h3",{children:e(u,{id:"uyJsf6"})}),e("section",{children:[e("div",{style:{display:"flex",flexWrap:"wrap",gap:8,lineHeight:1.25,alignItems:"center",marginTop:8},children:[e("img",{src:hi,alt:"",width:"64",height:"64",style:{aspectRatio:"1/1",verticalAlign:"middle",background:"#b7cdf9",borderRadius:12}}),e("div",{children:[e("b",{children:"Phanpy"})," ",e("a",{href:"https://hachyderm.io/@phanpy",rel:"noopener noreferrer",onClick:d=>{d.preventDefault(),A.showAccount="phanpy@hachyderm.io"},children:"@phanpy"}),e("br",{}),e(u,{id:"AZ2EoP",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank",rel:"noopener noreferrer"}),1:e("a",{href:"https://mastodon.social/@cheeaun",rel:"noopener noreferrer",onClick:d=>{d.preventDefault(),A.showAccount="cheeaun@mastodon.social"}})}})]})]}),e("p",{children:[e("a",{href:"https://github.com/sponsors/cheeaun",target:"_blank",rel:"noopener noreferrer",children:e(u,{id:"O4cLCR"})})," ","·"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener noreferrer",children:e(u,{id:"Ng063n"})})," ","·"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener noreferrer",children:"Patreon"})," ","·"," ",e("a",{href:yc,target:"_blank",rel:"noopener noreferrer",children:e(u,{id:"LcET2C"})})]}),e("p",{children:[Ni&&e(z,{children:[e(u,{id:"pFnMHn",values:{0:Ni.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(u,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/8f048af",target:"_blank",rel:"noopener noreferrer",children:e(Kt,{datetime:new Date("2024-11-22T08:34:51.379Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2024-11-22T08:34:51.379Z".slice(0,10).replace(/-/g,".")}.8f048af`,onClick:d=>{d.target.select();try{navigator.clipboard.writeText(d.target.value),ue(g._({id:"PiPfua"}))}catch{ue(g._({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function Sc({onClose:t}){if(!An())return null;const{instance:n}=ae(),[i,s]=L("default"),o=Y(),[a,h]=L(!1),[r,c]=L(!1),l=Y();se(()=>{(async()=>{s("loading");try{const{subscription:f,backendSubscription:m}=await bc();if(m!=null&&m.policy&&m.policy!=="none"){h(!0);const{alerts:d,policy:v}=m;l.current=v;const{elements:b}=o.current,y=b.namedItem("policy");y&&(y.value=v),Object.keys(d).forEach(w=>{const k=b.namedItem(w);(k==null?void 0:k.type)==="checkbox"&&(k.checked=!0)})}s("default")}catch(f){/outside.*authorized/i.test(f.message)?c(!0):alert((f==null?void 0:f.message)||f),s("error")}})()},[]);const p=i==="loading";return e("form",{ref:o,onChange:()=>{setTimeout(()=>{const f=Object.fromEntries(new FormData(o.current)),m=!!f["policy-allow"],d={data:{policy:f.policy,alerts:{mention:!!f.mention,favourite:!!f.favourite,reblog:!!f.reblog,follow:!!f.follow,follow_request:!!f.followRequest,poll:!!f.poll,update:!!f.update,status:!!f.status}}};let v=0;Object.keys(d.data.alerts).forEach(y=>{d.data.alerts[y]?v++:delete d.data.alerts[y]});const b=l.current!==d.data.policy;m&&v>0?b?$i().then(()=>{Mi(d)}).catch(y=>{alert(g._({id:"I6pdY3"}))}):Mi(d).catch(y=>{alert(g._({id:"I6pdY3"}))}):$i().catch(y=>{alert(g._({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(u,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:p||r,name:"policy-allow",checked:a,onChange:async f=>{const{checked:m}=f.target;if(m){const d=await Notification.requestPermission();d==="granted"?h(!0):(h(!1),d==="denied"&&alert(g._({id:"6LUsk7"})))}else h(!1)}})," ",e(u,{id:"qYNCa1",values:{0:[{value:"all",label:g._({id:"+niKJH"})},{value:"followed",label:g._({id:"x2NYtp"})},{value:"follower",label:g._({id:"PBFNgg"})}].map(f=>e("option",{value:f.value,children:f.label}))},components:{0:e("select",{name:"policy",disabled:p||r||!a})}})]}),e("div",{class:"shazam-container no-animation",style:{width:"100%"},hidden:!a,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"sub-section",children:e("ul",{children:[{value:"mention",label:g._({id:"/bZzdR"})},{value:"favourite",label:g._({id:"zZOZj7"})},{value:"reblog",label:g._({id:"puY2t0"})},{value:"follow",label:g._({id:"aaJhcT"})},{value:"followRequest",label:g._({id:"6Fs1Ba"})},{value:"poll",label:g._({id:"wNExRS"})},{value:"update",label:g._({id:"K/EtE6"})},{value:"status",label:g._({id:"2yr1/p"})}].map(f=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:f.value})," ",f.label]})}))})})})}),r&&e("div",{class:"sub-section",children:e("p",{children:e(u,{id:"8d0b8B",components:{0:e(he,{to:`/login?instance=${n}`,onClick:t}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(u,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const Kn=()=>{let t=setTimeout(()=>{var i,s;const n=document.getElementById("columns");if(n){const o=n.querySelector(".deck-container.focus");if(o)o.focus();else{const a=n.querySelectorAll(".deck-container").find(h=>h.getBoundingClientRect().left>=0);a?a.focus():(s=(i=n.querySelector(".deck-container"))==null?void 0:i.focus)==null||s.call(i)}}else{const o=document.querySelectorAll("#modal-container > *");if(o!=null&&o.length){const c=o[o.length-1],l=c.querySelector('[tabindex="-1"]')||c;if(l){l.focus();return}}if(document.querySelector(".deck-backdrop"))return;const h=document.querySelectorAll(".deck-container"),r=h[h.length-1];r&&r.tabIndex===-1&&r.focus()}},100);return()=>clearTimeout(t)};function As(t){if(!t)return;const n=Gt(),i=Y(n.pathname);se(()=>{i.current&&n.pathname!==i.current&&(t==null||t())},[n.pathname,t])}const Es=1e3*60,Cc=24*60*60*1e3,Wn=_t(async()=>{const{masto:t}=ae(),n=await t.v1.lists.list();return n.sort((i,s)=>i.title.localeCompare(s.title)),n.length&&setTimeout(()=>{be.account.set("lists",{lists:n,updatedAt:Date.now()})},1),n},{maxAge:Es});async function on(){try{const{lists:t,updatedAt:n}=be.account.get("lists")||{};return t!=null&&t.length?(Date.now()-n>Cc&&Wn(),t):await Wn()}catch{return[]}}const Ic=_t(t=>{const{masto:n}=ae();return n.v1.lists.$select(t).fetch()},{maxAge:Es});async function Rs(t){const{lists:n}=be.account.get("lists")||{};if(n!=null&&n.length){const i=n.find(s=>s.id===t);if(i)return i}try{return Ic(t)}catch{return null}}async function Tc(t){const n=await Rs(t);return(n==null?void 0:n.title)||""}function xc(t){const{lists:n}=be.account.get("lists")||{};n!=null&&n.length&&(n.push(t),n.sort((i,s)=>i.title.localeCompare(s.title)),be.account.set("lists",{lists:n,updatedAt:Date.now()}))}function Ac(t){const{lists:n}=be.account.get("lists")||{};if(n!=null&&n.length){const i=n.findIndex(s=>s.id===t.id);i!==-1&&(n[i]=t,n.sort((s,o)=>s.title.localeCompare(o.title)),be.account.set("lists",{lists:n,updatedAt:Date.now()}))}}function Ec(t){const{lists:n}=be.account.get("lists")||{};if(n!=null&&n.length){const i=n.findIndex(s=>s.id===t);i!==-1&&(n.splice(i,1),be.account.set("lists",{lists:n,updatedAt:Date.now()}))}}function mi({list:t,onClose:n}){const{masto:i}=ae(),[s,o]=L("default"),a=!!t,h=Y(),r=Y(),c=Y();se(()=>{a&&(h.current.value=t.title,r.current.value=t.repliesPolicy,c.current&&(c.current.checked=t.exclusive))},[a]);const l=Ze("@mastodon/list-exclusive")||Ze("@gotosocial/list-exclusive");return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})})," ",e("header",{children:e("h2",{children:a?g._({id:"tuhghE"}):g._({id:"Sb2gYF"})})}),e("main",{children:e("form",{class:"list-form",onSubmit:p=>{p.preventDefault();const f=new FormData(p.target),m=f.get("title"),d=f.get("replies_policy"),v=f.get("exclusive")==="on";o("loading"),(async()=>{try{let b;a?b=await i.v1.lists.$select(t.id).update({title:m,replies_policy:d,exclusive:v}):b=await i.v1.lists.create({title:m,replies_policy:d,exclusive:v}),o("default"),n==null||n({state:"success",list:b}),setTimeout(()=>{a?Ac(b):xc(b)},1)}catch{o("error"),alert(a?g._({id:"R7ep1i"}):g._({id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(u,{id:"6YtxFj"})," ",e("input",{ref:h,type:"text",id:"list-title",name:"title",required:!0,disabled:s==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:r,name:"replies_policy",required:!0,disabled:s==="loading",children:[e("option",{value:"list",children:e(u,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(u,{id:"Mr53YX"})}),e("option",{value:"none",children:e(u,{id:"PM7llw"})})]})}),l&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:c,type:"checkbox",name:"exclusive",disabled:s==="loading"})," ",e(u,{id:"jxxYp0"})]})}),e("div",{class:"list-form-footer",children:[e("button",{type:"submit",disabled:s==="loading",children:a?g._({id:"tfDRzk"}):g._({id:"hYgDIe"})}),a&&e(lt,{disabled:s==="loading",align:"end",menuItemClassName:"danger",confirmLabel:g._({id:"+kQ/cY"}),onClick:()=>{o("loading"),(async()=>{try{await i.v1.lists.$select(t.id).remove(),o("default"),n==null||n({state:"deleted"}),setTimeout(()=>{Ec(t.id)},1)}catch{o("error"),alert(g._({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:s==="loading",children:e(u,{id:"Jb6/SB"})})})]})]})})]})}const Rc=[60*5,60*30,60*60,60*60*6,60*60*24,60*60*24*3,60*60*24*7,60*60*24*30,0],Bt={0:{id:"9ZP9cc"},300:tt(5,"minute"),1800:tt(30,"minute"),3600:tt(1,"hour"),21600:tt(6,"hour"),86400:tt(1,"day"),259200:tt(3,"day"),604800:tt(1,"week"),2592e3:tt(30,"day")},Pi=80,Ls=1e3*60*10;function Lc(t,n){return n.v1.accounts.familiarFollowers.fetch({id:[t]})}const Mc=_t(Lc,{maxAge:Ls});async function $c(t,n){const i=n.v1.accounts.$select(t).statuses.list({limit:20}).next(),{value:s}=await i,o={total:s.length,originals:0,replies:0,boosts:0};return s.forEach(a=>{a.reblog?o.boosts++:a.inReplyToId&&a.inReplyToAccountId!==a.account.id?o.replies++:o.originals++}),s.length&&(o.daysSinceLastPost=Math.ceil((Date.now()-new Date(s[s.length-1].createdAt))/864e5)),o}const Dc=_t($c,{maxAge:Ls});function Ms({account:t,fetchAccount:n=()=>{},standalone:i,instance:s,authenticated:o}){const{i18n:a}=Qe(),{masto:h}=ae({instance:s}),{masto:r,instance:c}=ae(),[l,p]=L("default"),f=typeof t=="string",[m,d]=L(f?null:t),v=_e(()=>s===c,[s,c]);se(()=>{if(!f){d(t);return}p("loading"),(async()=>{try{const J=await n();A.accounts[`${J.id}@${s}`]=J,d(J),p("default")}catch{d(null),p("error")}})()},[f,t,n]);const{acct:b,avatar:y,avatarStatic:w,bot:k,createdAt:C,displayName:I,emojis:T,fields:_,followersCount:x,followingCount:$,group:N,id:D,lastStatusAt:V,locked:G,note:X,statusesCount:j,url:B,username:q,memorial:ie,moved:M,roles:F,hideCollections:U}=m||{};let K=!1,{header:de,headerStatic:te}=m||{};(!de||/missing\.png$/.test(de))&&y&&!/missing\.png$/.test(y)&&(de=y,K=!0,w&&!/missing\.png$/.test(w)&&(te=w));const fe=_e(()=>D===wt(),[D]);se(()=>{const J=!!(m!=null&&m.id&&(m!=null&&m.username)&&(m!=null&&m.acct)&&(m!=null&&m.avatar)&&(m!=null&&m.avatarStatic)&&(m!=null&&m.displayName)&&(m!=null&&m.url));if(fe&&s&&J){const Me=be.local.getJSON("accounts");let Oe=!1;Me.forEach(R=>{R.info.id===m.id&&R.instanceURL===s&&(R.info=m,Oe=!0)}),Oe&&be.local.setJSON("accounts",Me)}},[fe,m,s]);const ve=_e(()=>B?Dt.toUnicode(URL.parse(B).hostname):null,[B]),[H,ce]=L([]),Se=Y(),Ee=Y([]);async function Re(J){var Q;(J||!Se.current)&&(Se.current=h.v1.accounts.$select(D).followers.list({limit:Pi}));const Me=await Se.current.next();if(fe||!v)return Me;const{value:Oe}=Me;let R=[];if(J){let oe=[];try{oe=await h.v1.accounts.familiarFollowers.fetch({id:[D]})}catch{}Ee.current=((Q=oe==null?void 0:oe[0])==null?void 0:Q.accounts)||[],R=[...Ee.current,...Oe.filter(W=>!Ee.current.some(ne=>ne.id===W.id))]}else Oe!=null&&Oe.length&&(R=Oe.filter(oe=>!Ee.current.some(W=>W.id===oe.id)));return{...Me,value:R}}const Le=Y();async function Ne(J){return(J||!Le.current)&&(Le.current=h.v1.accounts.$select(D).following.list({limit:Pi})),await Le.current.next()}const ye=i?"div":he,ee=s?`/${s}/a/${D}`:`/a/${D}`,[ge,xe]=L([]),[le,Z]=L(),[me,P]=L("default"),E=!!(le!=null&&le.total),O=async J=>{try{const Me=await Mc(J,r);xe(Me[0].accounts.slice(0,Nc))}catch{}},re=async()=>{if(D){P("loading");try{const J=await Dc(D,h);Z(J),P("default")}catch{P("error")}}},we=ct(({relationship:J,currentID:Me})=>{J.following||(O(Me),!i&&j>0&&re())},[i,D,j]),Ie=ct(J=>{J.id===D&&(d(J),A.accounts[`${J.id}@${s}`]=J)},[D,s]);return e("div",{tabIndex:"-1",class:`account-container ${l==="loading"?"skeleton":""}`,style:{"--header-color-1":H[0],"--header-color-2":H[1],"--header-color-3":H[2],"--header-color-4":H[3]},children:[l==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(u,{id:"44hICK"})}),e("p",{children:e("a",{href:f?t:B,target:"_blank",rel:"noopener noreferrer",children:[e(u,{id:"Aadw0+"})," ",e(S,{icon:"external"})]})})]}),l==="loading"?e(z,{children:[e("header",{children:e(rt,{avatarSize:"xxxl",skeleton:!0})}),e("main",{children:[e("div",{class:"note",children:[e("p",{children:"███████ ████ ████"}),e("p",{children:"████ ████████ ██████ █████████ ████ ██"})]}),e("div",{class:"account-metadata-box",children:[e("div",{class:"profile-metadata",children:[e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"███"}),e("p",{children:"██████"})]}),e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"████"}),e("p",{children:"███████████"})]})]}),e("div",{class:"stats",children:[e("div",{children:[e("span",{children:"██"})," ",e(u,{id:"x5LEuB"})]}),e("div",{children:[e("span",{children:"██"})," ",e(u,{id:"following.stats"})]}),e("div",{children:[e("span",{children:"██"})," ",e(u,{id:"+owNNn"})]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain",disabled:!0,children:e(S,{icon:"more",size:"l",alt:a._({id:"2FYpfJ"})})})})]})]})]}):m&&e(z,{children:[!!M&&e("div",{class:"account-moved",children:[e("p",{children:e(u,{id:"C6cVP/",values:{displayName:I},components:{0:e("b",{})}})}),e(rt,{account:M,instance:s,onClick:J=>{J.stopPropagation(),A.showAccount=M}})]}),!!de&&!/missing\.png$/.test(de)&&e("img",{src:de,alt:"",class:`header-banner ${K?"header-is-avatar":""}`,onError:J=>{J.target.crossOrigin?J.target.src!==te?J.target.src=te:(J.target.removeAttribute("crossorigin"),J.target.src=de):J.target.src!==te?J.target.src=te:J.target.remove()},crossOrigin:"anonymous",onLoad:J=>{J.target.classList.add("loaded");try{const Me=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),Oe=Me.getContext("2d",{willReadFrequently:!0});Me.width=J.target.width,Me.height=J.target.height,Oe.imageSmoothingEnabled=!1,Oe.drawImage(J.target,0,0);const R=10,oe=[Oe.getImageData(0,0,R,R).data,Oe.getImageData(J.target.width-R,0,R,R).data,Oe.getImageData(0,J.target.height-R,R,R).data,Oe.getImageData(J.target.width-R,J.target.height-R,R,R).data].map(W=>{let ne=0,$e=0,Te=0,Ae=0;for(let He=0;He<W.length;He+=4)ne+=W[He],$e+=W[He+1],Te+=W[He+2],Ae+=W[He+3];const ze=W.length/4;return[ne/ze,$e/ze,Te/ze,Ae/ze]}).map(W=>{const[ne,$e,Te,Ae]=Oc(W);return`rgba(${ne}, ${$e}, ${Te}, ${Ae})`});ce(oe)}catch{}}}),e("header",{children:i?e(at,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(rt,{account:m,instance:s,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(Yc,{acct:b,instance:s})}),e(ke,{onClick:()=>{const J=b.includes("@")?`@${b}`:`@${b}@${s}`;try{navigator.clipboard.writeText(J),ue(a._({id:"zJoEwS"}))}catch{ue(a._({id:"BC0lSD"}))}},children:[e(S,{icon:"link"}),e("span",{children:e(u,{id:"27x6gl"})})]}),e(ke,{href:B,target:"_blank",children:[e(S,{icon:"external"}),e("span",{children:e(u,{id:"Bz5hLl"})})]}),e(Ge,{}),e(Ue,{href:m.avatar,target:"_blank",children:[e(S,{icon:"user"}),e("span",{children:e(u,{id:"7WYl2I"})})]}),e(Ue,{href:m.header,target:"_blank",children:[e(S,{icon:"media"}),e("span",{children:e(u,{id:"ZNme5R"})})]})]}):e(rt,{account:m,instance:s,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!ie&&e("span",{class:"tag",children:e(u,{id:"prdIOK"})}),!!k&&e("span",{class:"tag",children:[e(S,{icon:"bot"})," ",e(u,{id:"9Vdq+j"})]}),!!N&&e("span",{class:"tag",children:[e(S,{icon:"group"})," ",e(u,{id:"L8fEEm"})]}),F==null?void 0:F.map(J=>e("span",{class:"tag",children:[J.name,!!ve&&e(z,{children:[" ",e("span",{class:"more-insignificant",children:ve})]})]})),e("div",{class:"note",dir:"auto",onClick:hs({instance:c}),dangerouslySetInnerHTML:{__html:jn(X,{emojis:T})}}),e("div",{class:"account-metadata-box",children:[(_==null?void 0:_.length)>0&&e("div",{class:"profile-metadata",children:_.map(({name:J,value:Me,verifiedAt:Oe},R)=>e("div",{class:`profile-field ${Oe?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(fs,{text:J,emojis:T})," ",!!Oe&&e(S,{icon:"check-circle",size:"s",alt:a._({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:jn(Me,{emojis:T})}})]},J+R))}),e("div",{class:"stats",children:[e(ye,{tabIndex:0,to:ee,onClick:()=>{setTimeout(()=>{A.showGenericAccounts={id:"followers",heading:a._({id:"x5LEuB"}),fetchAccounts:Re,instance:s,excludeRelationshipAttrs:fe?["followedBy"]:[],blankCopy:U?a._({id:"BRV/wh"}):void 0}},0)},children:[!!ge.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:ge.map(J=>e(dt,{url:J.avatarStatic,size:"s",alt:`${J.displayName} @${J.acct}`,squircle:J==null?void 0:J.bot}))})}),e("span",{title:x,children:Ke(x)})," ",e(u,{id:"x5LEuB"})]}),e(ye,{class:"insignificant",tabIndex:0,to:ee,onClick:()=>{setTimeout(()=>{A.showGenericAccounts={heading:a._({id:"following.stats"}),fetchAccounts:Ne,instance:s,excludeRelationshipAttrs:fe?["following"]:[],blankCopy:U?a._({id:"BRV/wh"}):void 0}},0)},children:[e("span",{title:$,children:Ke($)})," ",e(u,{id:"following.stats"}),e("br",{})]}),e(ye,{class:"insignificant",to:ee,children:[e("span",{title:j,children:Ke(j)})," ",e(u,{id:"+owNNn"})]}),!!C&&e("div",{class:"insignificant",children:e(u,{id:"PCcEFZ",values:{0:ht(C,{hideTime:!0})},components:{0:e("time",{datetime:C})}})})]})]}),!!le&&e(ye,{to:ee,class:"account-metadata-box",children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:E?e("div",{class:"posting-stats",title:a._({id:"wiuWLe",values:{0:(le.originals/le.total).toLocaleString(a.locale||void 0,{style:"percent"}),1:(le.replies/le.total).toLocaleString(a.locale||void 0,{style:"percent"}),2:(le.boosts/le.total).toLocaleString(a.locale||void 0,{style:"percent"})}}),children:[e("div",{children:le.daysSinceLastPost<365?a._({id:"oZUtTk",values:{0:le.total,1:le.daysSinceLastPost,2:le.daysSinceLastPost,3:le.daysSinceLastPost,4:le.total,5:le.total,6:le.daysSinceLastPost}}):a._({id:"JvA7Mo",values:{0:le.total,1:le.total}})}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${le.originals/le.total*100}%`,"--replies-percentage":`${(le.originals+le.replies)/le.total*100}%`}}),e("div",{class:"posting-stats-legends",children:[e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-originals"})," ",e(u,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ",e(u,{id:"N8UzTV"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ",e(u,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(u,{id:"vl3XTJ"})})})})}),!M&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!le,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:me==="loading",onClick:()=>{re()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${me==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),e(u,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(Pc,{info:m,instance:s,standalone:i,authenticated:o,onRelationshipChange:we,onProfileUpdate:Ie})})]})]})}const Nc=3;function Pc({info:t,instance:n,standalone:i,authenticated:s,onRelationshipChange:o=()=>{},onProfileUpdate:a=()=>{}}){var le;if(!t)return null;const{_:h}=Qe(),{masto:r,instance:c,authenticated:l}=ae(),p=n===c,[f,m]=L("default"),[d,v]=L(null),{id:b,acct:y,url:w,username:k,locked:C,lastStatusAt:I,note:T,fields:_,moved:x}=t,$=Y(b),{following:N,showingReblogs:D,notifying:V,followedBy:G,blocking:X,blockedBy:j,muting:B,mutingNotifications:q,requested:ie,domainBlocking:M,endorsed:F,note:U}=d||{},[K,de]=L(null),[te,fe]=L(!1),ve=y.includes("@")?y:`${y}@${n}`;se(()=>{if(t){const Z=wt();let me;(async()=>{if(p&&s)me=b;else if(!p&&l){const E=t.acct.includes("@");try{const O=await r.v2.search.fetch({q:E?t.acct:`${t.username}@${n}`,type:"accounts",limit:1,resolve:!0});O.accounts.length&&(me=O.accounts[0].id,de(O.accounts[0]))}catch{}}if(!me)return;if(Z===me){fe(!0);return}$.current=me,m("loading");const P=r.v1.accounts.relationships.fetch({id:[me]});try{const E=await P;if(m("default"),E.length){const O=E[0];v(O),o({relationship:O,currentID:me})}}catch{m("error")}})()}},[t,s]),se(()=>{t&&te&&uo(t)},[t,te]);const H=f==="loading",[ce,Se]=L(!1),[Ee,Re]=L(!1),[Le,Ne]=L(!1),[ye,ee]=L(!1),[ge,xe]=L([]);return e(z,{children:[e("div",{class:"actions",children:[e("span",{children:[G?e("span",{class:"tag",children:e(u,{id:"p3UO/y"})}):I?e("small",{class:"insignificant",children:e(u,{id:"F3cM1G",values:{0:ht(I,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),B&&e("span",{class:"tag danger",children:e(u,{id:"+IJm1Z"})}),X&&e("span",{class:"tag danger",children:e(u,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!U&&e("button",{type:"button",class:"private-note-tag",title:g._({id:"zxFxcH"}),onClick:()=>{Ne(!0)},dir:"auto",children:e("span",{children:U})}),e(at,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",disabled:H,children:e(S,{icon:"more",size:"l",alt:g._({id:"2FYpfJ"})})}),onMenuChange:Z=>{N&&Z.open&&(async()=>{try{const me=await r.v1.accounts.$select($.current).lists.list();xe(me)}catch{}})()},children:[l&&!te&&e(z,{children:[e(ke,{onClick:()=>{Ro({draftStatus:{status:`@${(K==null?void 0:K.acct)||y} `}})},children:[e(S,{icon:"at"}),e("span",{children:e(u,{id:"3LkfZu",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(ke,{onClick:()=>{Se(!0)},children:[e(S,{icon:"translate"}),e("span",{children:e(u,{id:"R8mSiS"})})]}),Ze("@mastodon/profile-private-note")&&e(ke,{onClick:()=>{Ne(!0)},children:[e(S,{icon:"pencil"}),e("span",{children:U?g._({id:"U+Gokq"}):g._({id:"VcQzRi"})})]}),N&&!!d&&e(z,{children:[e(ke,{onClick:()=>{m("loading"),(async()=>{try{const Z=await r.v1.accounts.$select($.current).follow({notify:!V});Z&&v(Z),m("default"),ue(Z.notifying?g._({id:"jL3N0G",values:{username:k}}):g._({id:"WBugD/",values:{username:k}}))}catch(Z){alert(Z),m("error")}})()},children:[e(S,{icon:"notification"}),e("span",{children:V?g._({id:"osJmEN"}):g._({id:"I92Z+b"})})]}),e(ke,{onClick:()=>{m("loading"),(async()=>{try{const Z=await r.v1.accounts.$select($.current).follow({reblogs:!D});Z&&v(Z),m("default"),ue(Z.showingReblogs?g._({id:"0X2KC8",values:{username:k}}):g._({id:"cXWjH0",values:{username:k}}))}catch(Z){alert(Z),m("error")}})()},children:[e(S,{icon:"rocket"}),e("span",{children:D?g._({id:"GRUr8d"}):g._({id:"uREpT3"})})]})]}),N&&e(ke,{onClick:()=>{Re(!0)},children:[e(S,{icon:"list"}),ge.length?e(z,{children:[e("small",{class:"menu-grow",children:[e(u,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:ge.map(Z=>Z.title).join(", ")})]}),e("small",{class:"more-insignificant",children:ge.length})]}):e("span",{children:e(u,{id:"sJ2yQc"})})]}),e(Ge,{})]}),e(ke,{onClick:()=>{const Z=`@${(K==null?void 0:K.acct)||ve}`;try{navigator.clipboard.writeText(Z),ue(g._({id:"zJoEwS"}))}catch{ue(g._({id:"BC0lSD"}))}},children:[e(S,{icon:"copy"}),e("small",{children:[e(u,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",(K==null?void 0:K.acct)||ve]})]})]}),e(ke,{href:w,target:"_blank",children:[e(S,{icon:"external"}),e("small",{class:"menu-double-lines",children:zc(w)})]}),e("div",{class:"menu-horizontal",children:[e(ke,{onClick:()=>{try{navigator.clipboard.writeText(w),ue(g._({id:"edWbV6"}))}catch{ue(g._({id:"W1ewR0"}))}},children:[e(S,{icon:"link"}),e("span",{children:e(u,{id:"he3ygx"})})]}),(navigator==null?void 0:navigator.share)&&((le=navigator==null?void 0:navigator.canShare)==null?void 0:le.call(navigator,{url:w}))&&e(ke,{onClick:()=>{try{navigator.share({url:w})}catch{alert(g._({id:"TtG3Uh"}))}},children:[e(S,{icon:"share"}),e("span",{children:e(u,{id:"LFKLqp"})})]})]}),!!d&&e(z,{children:[e(Ge,{}),B?e(ke,{onClick:()=>{m("loading"),(async()=>{try{const Z=await r.v1.accounts.$select((K==null?void 0:K.id)||b).unmute();v(Z),m("default"),ue(g._({id:"B4Xkly",values:{username:k}})),A.reloadGenericAccounts.id="mute",A.reloadGenericAccounts.counter++}catch{m("error")}})()},children:[e(S,{icon:"unmute"}),e("span",{children:e(u,{id:"Q/HUhC",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(Tn,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(z,{children:[e(S,{icon:"mute"}),e("span",{class:"menu-grow",children:e(u,{id:"xhPEH3",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(S,{icon:"time"}),e(S,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:Rc.map(Z=>e(ke,{onClick:()=>{m("loading"),(async()=>{try{const me=await r.v1.accounts.$select((K==null?void 0:K.id)||b).mute({duration:Z});v(me),m("default"),ue(g._({id:"/plB9m",values:{0:typeof Bt[Z]=="function"?Bt[Z]():h(Bt[Z]),username:k}})),A.reloadGenericAccounts.id="mute",A.reloadGenericAccounts.counter++}catch{m("error"),ue(g._({id:"vWGBjT",values:{username:k}}))}})()},children:typeof Bt[Z]=="function"?Bt[Z]():h(Bt[Z])}))})}),G&&e(lt,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(z,{children:[e(S,{icon:"user-x"}),e("span",{children:e(u,{id:"unyq2W",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{m("loading"),(async()=>{try{const Z=await r.v1.accounts.$select((K==null?void 0:K.id)||b).removeFromFollowers();v(Z),m("default"),ue(g._({id:"AgkcM/",values:{username:k}})),A.reloadGenericAccounts.id="followers",A.reloadGenericAccounts.counter++}catch{m("error")}})()},children:[e(S,{icon:"user-x"}),e("span",{children:e(u,{id:"VCZ0OT"})})]}),e(lt,{subMenu:!0,confirm:!X,confirmLabel:e(z,{children:[e(S,{icon:"block"}),e("span",{children:e(u,{id:"aforS9",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{m("loading"),(async()=>{try{if(X){const Z=await r.v1.accounts.$select((K==null?void 0:K.id)||b).unblock();v(Z),m("default"),ue(g._({id:"sI9N29",values:{username:k}}))}else{const Z=await r.v1.accounts.$select((K==null?void 0:K.id)||b).block();v(Z),m("default"),ue(g._({id:"uYcYzu",values:{username:k}}))}A.reloadGenericAccounts.id="block",A.reloadGenericAccounts.counter++}catch{m("error"),X?ue(g._({id:"0tG4wG",values:{username:k}})):ue(g._({id:"pA+qEx",values:{username:k}}))}})()},children:X?e(z,{children:[e(S,{icon:"unblock"}),e("span",{children:e(u,{id:"/3LJfX",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(z,{children:[e(S,{icon:"block"}),e("span",{children:e(u,{id:"JRswkR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(ke,{className:"danger",onClick:()=>{A.showReportModal={account:K||t}},children:[e(S,{icon:"flag"}),e("span",{children:e(u,{id:"qTJgpR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),l&&te&&i&&Ze("@mastodon/profile-edit")&&e(z,{children:[e(Ge,{}),e(ke,{onClick:()=>{ee(!0)},children:[e(S,{icon:"pencil"}),e("span",{children:e(u,{id:"9OpVZg"})})]})]}),!1]}),!d&&f==="loading"&&e(Pe,{abrupt:!0}),!!d&&!x&&e(lt,{confirm:N||ie,confirmLabel:e("span",{children:ie?g._({id:"e7qQIH"}):g._({id:"eYsAQr",values:{0:t.acct||t.username}})}),menuItemClassName:"danger",align:"end",disabled:H,onClick:()=>{m("loading"),(async()=>{try{let Z;N||ie?Z=await r.v1.accounts.$select($.current).unfollow():Z=await r.v1.accounts.$select($.current).follow(),Z&&v(Z),m("default")}catch(Z){alert(Z),m("error")}})()},children:e("button",{type:"button",class:`${N||ie?"light swap":""}`,"data-swap-state":N||ie?"danger":"",disabled:H,children:N?e(z,{children:[e("span",{children:e(u,{id:"y6sq5j"})}),e("span",{children:e(u,{id:"HKrBPX"})})]}):ie?e(z,{children:[e("span",{children:e(u,{id:"Yx0Ud8"})}),e("span",{children:e(u,{id:"yTVtKs"})})]}):C?e(z,{children:[e(S,{icon:"lock"})," ",e("span",{children:e(u,{id:"MKEPCY"})})]}):g._({id:"MKEPCY"})})})]})]}),!!ce&&e(Fe,{onClose:()=>{Se(!1)},children:e(Bc,{note:T,fields:_,onClose:()=>Se(!1)})}),!!Ee&&e(Fe,{onClose:()=>{Re(!1)},children:e(Uc,{accountID:$.current,onClose:()=>Re(!1)})}),!!Le&&e(Fe,{onClose:()=>{Ne(!1)},children:e(Fc,{account:t,note:U,onRelationshipChange:Z=>{v(Z)},onClose:()=>Ne(!1)})}),!!ye&&e(Fe,{onClose:()=>{ee(!1)},children:e(Hc,{onClose:({state:Z,account:me}={})=>{ee(!1),Z==="success"&&me&&a(me)}})})]})}function Oc([t,n,i]){const s=.2126*t+.7152*n+.0722*i;let o;return s>=220?o=1:s<=50?o=.1:o=s/255,o=Math.min(1,o),[t,n,i,o]}function zc(t){if(!t)return;const n=URL.parse(t),{host:i,pathname:s}=n,o=s.replace(/\/$/,"").replace(/^\//,"");return e(z,{children:[e("span",{class:"more-insignificant",children:[Dt.toUnicode(i),"/"]}),e("wbr",{}),e("span",{children:o})]})}function Bc({note:t,fields:n,onClose:i}){const s=(n==null?void 0:n.map(({name:a,value:h})=>`${a}
${Ti(h)}`).join(`
`))||"",o=Ti(t)+(s?`
${s}`:"");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(ps,{forceTranslate:!0,text:o})]})]})}function Uc({accountID:t,onClose:n}){const{masto:i}=ae(),[s,o]=L("default"),[a,h]=L([]),[r,c]=L([]),[l,p]=Mt(d=>d+1,0);se(()=>{o("loading"),(async()=>{try{const d=await on();h(d);const v=await i.v1.accounts.$select(t).lists.list();c(v),o("default")}catch{o("error")}})()},[l]);const[f,m]=L(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"sJ2yQc"})})}),e("main",{children:[a.length>0?e("ul",{class:"list-add-remove",children:a.map(d=>{const v=r.some(b=>b.id===d.id);return e("li",{children:e("button",{type:"button",class:`light ${v?"checked":""}`,disabled:s==="loading",onClick:()=>{o("loading"),(async()=>{try{v?await i.v1.lists.$select(d.id).accounts.remove({accountIds:[t]}):await i.v1.lists.$select(d.id).accounts.create({accountIds:[t]}),p()}catch{o("error"),alert(v?g._({id:"7KnEYa"}):g._({id:"Tba8uO"}))}})()},children:[e(S,{icon:"check-circle",alt:"☑️"}),e("span",{children:d.title})]})})})}):s==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(u,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(u,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>m(!0),disabled:s!=="default",children:[e(S,{icon:"plus",size:"l"})," ",e("span",{children:e(u,{id:"Sb2gYF"})})]})]}),f&&e(Fe,{onClick:d=>{d.target===d.currentTarget&&m(!1)},children:e(mi,{list:f==null?void 0:f.list,onClose:d=>{d.state==="success"&&p(),m(!1)}})})]})}function Fc({account:t,note:n,onRelationshipChange:i=()=>{},onClose:s=()=>{}}){const{masto:o}=ae(),[a,h]=L("default"),r=Y(null);return se(()=>{let c;return r.current&&!n&&(c=setTimeout(()=>{var l,p;(p=(l=r.current).focus)==null||p.call(l)},100)),()=>{clearTimeout(c)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"DYqYm5",values:{0:(t==null?void 0:t.username)||(t==null?void 0:t.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:c=>{c.preventDefault();const p=new FormData(c.target).get("note");(p==null?void 0:p.trim())!==(n==null?void 0:n.trim())&&(h("loading"),(async()=>{try{const f=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:p});h("default"),i(f),s()}catch(f){h("error"),alert((f==null?void 0:f.message)||g._({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:r,name:"note",disabled:a==="loading",dir:"auto",children:n}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:a==="loading",onClick:()=>{s==null||s()},children:e(u,{id:"dEgA5A"})}),e("span",{children:[e(Pe,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:e(u,{id:"SrwrEj"})})]})]})]})})]})}function Hc({onClose:t=()=>{}}){const{masto:n}=ae(),[i,s]=L("loading"),[o,a]=L(null);se(()=>{(async()=>{try{const f=await n.v1.accounts.verifyCredentials();a(f),s("default")}catch{s("error")}})()},[]);const{displayName:h,source:r}=o||{},{note:c,fields:l}=r||{},p=Y(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"9OpVZg"})})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):e("form",{onSubmit:f=>{f.preventDefault();const m=new FormData(f.target),d=m.get("display_name"),v=m.get("note"),b=p.current.querySelectorAll('input[name^="fields_attributes"]'),y=[];b.forEach(w=>{const k=w.name,[C,I,T]=k.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],_=w.value?w.value.trim():"";I&&T&&_&&(y[I]||(y[I]={}),y[I][T]=_)}),y.forEach(w=>{w.name&&!w.value&&(w.value="")}),(async()=>{try{const w=await n.v1.accounts.updateCredentials({displayName:d,note:v,fieldsAttributes:y});t==null||t({state:"success",account:w})}catch(w){alert((w==null?void 0:w.message)||g._({id:"FwMMx0"}))}})()},children:[e("p",{children:e("label",{children:[e(u,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:h,maxLength:30,disabled:i==="loading",dir:"auto"})]})}),e("p",{children:e("label",{children:[e(u,{id:"E+oKCO"}),e("textarea",{defaultValue:c,name:"note",maxLength:500,rows:"5",disabled:i==="loading",dir:"auto"})]})}),e("p",{children:e(u,{id:"T4I119"})}),e("table",{ref:p,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(u,{id:"87a/t/"})}),e("th",{children:e(u,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,l.length)}).map((f,m)=>{const{name:d="",value:v=""}=l[m]||{};return e(qc,{name:d,value:v,index:m,disabled:i==="loading"},m)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:i==="loading",onClick:()=>{t==null||t()},children:e(u,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:i==="loading",children:e(u,{id:"tfDRzk"})})]})]})})]})}function qc({name:t,value:n,disabled:i,index:s}){const[o,a]=L(!!n);return e("tr",{children:[e("td",{children:e("input",{type:"text",name:`fields_attributes[${s}][name]`,defaultValue:t,disabled:i,maxLength:255,required:o,dir:"auto"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${s}][value]`,defaultValue:n,disabled:i,maxLength:255,onChange:h=>a(!!h.currentTarget.value),dir:"auto"})})]})}function Yc({acct:t,instance:n}){let[i,s]=t.split("@");s||(s=n);const o=Dt.toASCII(t);return e("div",{class:"handle-info",children:[e("span",{class:"handle-handle",title:o,children:[e("b",{class:"handle-username",children:i}),e("span",{class:"handle-at",children:"@"}),e("b",{class:"handle-server",children:s})]}),e("div",{class:"handle-legend",children:[e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon username"})," ",e(u,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(u,{id:"rZgCpJ"})]})]})]})}function jc({account:t,instance:n,onClose:i}){const{masto:s,instance:o,authenticated:a}=ae({instance:n}),h=typeof t=="string";return se(()=>{h||(A.accounts[`${t.id}@${o}`]=t)},[t]),As(i),e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close outer",onClick:i,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e(Ms,{instance:o,authenticated:a,account:t,fetchAccount:async()=>{if(h)try{return await s.v1.accounts.lookup({acct:t,skip_webfinger:!1})}catch{const c=await s.v2.search.fetch({q:t,type:"accounts",limit:1,resolve:a});if(c.accounts.length)return c.accounts[0];if(/https?:\/\/[^/]+\/@/.test(t)){const l=URL.parse(t),{hostname:p,pathname:f}=l,m=f.replace(/^\//,"").replace(/\/$/,"")+"@"+p,d=await s.v2.search.fetch({q:m,type:"accounts",limit:1,resolve:a});if(d.accounts.length)return d.accounts[0]}}else return t}})]})}function Vc({onClose:t}){const{masto:n}=ae(),[i,s]=L("default"),[o,a]=L([]),[h,r]=Mt(l=>l+1,0);se(()=>{s("loading"),(async()=>{try{const l=await ut.drafts.keys();if(l.length){const p=yn(),f=l.filter(m=>m.startsWith(p));if(f.length){const m=await ut.drafts.getMany(f);m.sort((d,v)=>new Date(v.updatedAt).getTime()-new Date(d.updatedAt).getTime()),a(m)}else a([])}else a([]);s("default")}catch{s("error")}})()},[h]);const c=(o==null?void 0:o.length)>0;return e("div",{class:"sheet",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(u,{id:"krk5ws"})," ",e(Pe,{abrupt:!0,hidden:i!=="loading"})]}),c&&e("div",{class:"insignificant",children:e(u,{id:"Ap/10+"})})]}),e("main",{children:c?e(z,{children:[e("ul",{class:"drafts-list",children:o.map(l=>{const{updatedAt:p,key:f,draftStatus:m,replyTo:d}=l,v=new Date(p);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(S,{icon:d?"reply":"quill",size:"s"})," ",e("time",{children:[!!d&&e(z,{children:[e("span",{class:"bidi-isolate",children:["@",d.account.acct]}),e("br",{})]}),ht(v)]})]}),e(lt,{confirmLabel:e("span",{children:e(u,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:i==="loading",onClick:()=>{(async()=>{try{await ut.drafts.del(f),r()}catch{alert(g._({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:i==="loading",children:e(u,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:i==="loading",class:"draft-item",onClick:async()=>{let b;if(d){s("loading");try{b=await n.v1.statuses.$select(d.id).fetch()}catch{alert(g._({id:"tMwimH"})),s("default");return}s("default")}window.__COMPOSE__={draftStatus:m,replyToStatus:b},A.showCompose=!0,A.showDrafts=!1},children:e(Gc,{draft:l})})]},p)})}),o.length>1&&e("p",{children:e(lt,{confirmLabel:e("span",{children:e(u,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:i==="loading",onClick:()=>{(async()=>{s("loading");try{await ut.drafts.delMany(o.map(l=>l.key)),s("default"),r()}catch{alert(g._({id:"0J4sZq"})),s("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:i==="loading",children:e(u,{id:"hOg+Mt"})})})})]}):e("p",{children:e(u,{id:"8iQ+jk"})})})]})}function Gc({draft:t}){var f;const{draftStatus:n,replyTo:i}=t,{status:s,spoilerText:o,poll:a,mediaAttachments:h}=n,r=((f=a==null?void 0:a.options)==null?void 0:f.length)>0,c=(h==null?void 0:h.length)>0,l=r||c,p=_e(()=>{if(!c)return;const m=h.find(b=>/image/.test(b.type));if(!m)return;const{file:d}=m;return URL.createObjectURL(d)},[c,h]);return e(z,{children:e("div",{class:"mini-draft",children:[l&&e("div",{class:`mini-draft-aside ${p?"has-image":""}`,style:p?{"--bg-image":`url(${p})`}:{},children:[r&&e(S,{icon:"poll",alt:g._({id:"4WUbF1"})}),c&&e("span",{children:[e(S,{icon:"attachment",alt:g._({id:"xYilR2"})})," ",e("small",{children:h==null?void 0:h.length})]})]}),e("div",{class:"mini-draft-main",children:[!!o&&e("div",{class:"mini-draft-spoiler",children:o}),!!s&&e("div",{class:"mini-draft-status",children:s})]})]})})}function Kc({html:t,url:n,width:i,height:s,onClose:o=()=>{}}){return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>o(),children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),n&&e("a",{href:n,target:"_blank",rel:"noopener noreferrer",class:"button plain",children:[e("span",{children:e(u,{id:"4/RpOy"})})," ",e(S,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:t},style:{"--width":i+"px","--height":s+"px","--aspect-ratio":`${i}/${s}`}})]})}function Wc({instance:t,excludeRelationshipAttrs:n=[],postID:i,onClose:s=()=>{},blankCopy:o=g._({id:"10OlfF"})}){const{masto:a,instance:h}=ae(),r=t?t===h:!0,c=qe(A),[l,p]=L("default"),[f,m]=L([]),[d,v]=L(!1);if(As(s),!c.showGenericAccounts)return null;const{id:b,heading:y,fetchAccounts:w,accounts:k,showReactions:C}=c.showGenericAccounts,[I,T]=L({}),_=async D=>{if(!(D!=null&&D.length)||!r)return;const V=await si(D,I);V&&T({...I,...V})},x=D=>{w&&(D&&m([]),p("loading"),(async()=>{try{const{done:V,value:G}=await w(D);if(Array.isArray(G)){if(D){const X=[];for(let j=0;j<G.length;j++){const B=G[j],q=X.find((ie,M)=>ie.id===B.id&&j!==M);q?q._types.push(...B._types):X.push({_types:[],...B})}m(X)}else m(X=>{const j=X;for(const B of G){const q=j.find(ie=>ie.id===B.id);q?q._types.push(...B._types):j.push(B)}return j});v(!V),_(G)}else v(!1);p("default")}catch{p("error")}})())},$=Y(!0);se(()=>{(k==null?void 0:k.length)>0?(m(k),_(k)):(x(!0),$.current=!1)},[k,w]),se(()=>{var D;$.current||((D=c.reloadGenericAccounts)==null?void 0:D.id)===b&&x(!0)},[c.reloadGenericAccounts.counter]);const N=A.statuses[i];return e("div",{id:"generic-accounts-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:y||g._({id:"bPwFdf"})})}),e("main",{children:[N&&e(he,{to:`/${t||h}/s/${N.id}`,class:"post-preview",children:e(Ye,{status:N,size:"s",readOnly:!0})}),f.length>0?e(z,{children:[e("ul",{class:"accounts-list",children:f.map(D=>{var X,j;const V=I[D.id],G=`${D.id}-${((X=D._types)==null?void 0:X.length)||""}`;return e("li",{children:[C&&((j=D._types)==null?void 0:j.length)>0&&e("div",{class:"reactions-block",children:D._types.map(B=>e(S,{icon:{reblog:"rocket",favourite:"heart"}[B],class:`${B}-icon`}))}),e("div",{class:"account-relationships",children:e(rt,{account:D,showStats:!0,relationship:V,excludeRelationshipAttrs:n})})]},G)})}),l==="default"?d?e(kt,{onChange:D=>{D&&x()},children:e("button",{type:"button",class:"plain block",onClick:()=>x(),children:e(u,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(u,{id:"2EYeAZ"})}):l==="loading"&&e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})})]}):l==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):l==="error"?e("p",{class:"ui-state",children:e(u,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:o})]})]})}function Zc({alt:t,lang:n,onClose:i}){const s=qe(A),[o,a]=L(!1),h=us(!0),r=s.settings.contentTranslationHideLanguages||[],c=!!n&&n!==h&&!_i([n],[h])&&!r.find(l=>n===l||_i([n],[l]));return e("div",{class:"sheet",tabindex:"-1",children:[!!i&&e("button",{type:"button",class:"sheet-close outer",onClick:i,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(u,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(at,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(S,{icon:"more",alt:g._({id:"2FYpfJ"}),size:"xl"})}),children:[e(ke,{disabled:o,onClick:()=>{a(!0)},children:[e(S,{icon:"translate"}),e("span",{children:e(u,{id:"pi8x/S"})})]}),Lo&&e(ke,{onClick:()=>{Mo(t,n)},children:[e(S,{icon:"speak"}),e("span",{children:e(u,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:n,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:t}),(c||o)&&e(ps,{forceTranslate:o,sourceLanguage:n,text:t})]})]})}const{min:od,max:cd}=Math;const $s={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])$s[`[object ${t}]`]=t.toLowerCase();function Xc(t){return $s[Object.prototype.toString.call(t)]||"object"}const Wt=(t,n=null)=>t.length>=3?Array.prototype.slice.call(t):Xc(t[0])=="object"&&n?n.split("").filter(i=>t[0][i]!==void 0).map(i=>t[0][i]):t[0].slice(0);const{PI:En,min:ad,max:rd}=Math;const ld=En*2,dd=En/3,Jc=En/180,Qc=180/En;function _n(t,n){let i=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(n[0])||(n=n.map(h=>[h]));let s=n[0].length,o=n[0].map((h,r)=>n.map(c=>c[r])),a=t.map(h=>o.map(r=>Array.isArray(h)?h.reduce((c,l,p)=>c+l*(r[p]||0),0):r.reduce((c,l)=>c+l*h,0)));return i===1&&(a=a[0]),s===1?a.map(h=>h[0]):a}const Ds={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}};const On=t=>{const n=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*n},ea=(t,n,i)=>{const{MtxAdaptMa:s,MtxAdaptMaI:o,MtxXYZ2RGB:a,RefWhiteRGB:h,Xn:r,Yn:c,Zn:l}=Ds,p=r*s.m00+c*s.m10+l*s.m20,f=r*s.m01+c*s.m11+l*s.m21,m=r*s.m02+c*s.m12+l*s.m22,d=h.X*s.m00+h.Y*s.m10+h.Z*s.m20,v=h.X*s.m01+h.Y*s.m11+h.Z*s.m21,b=h.X*s.m02+h.Y*s.m12+h.Z*s.m22,y=(t*s.m00+n*s.m10+i*s.m20)*(d/p),w=(t*s.m01+n*s.m11+i*s.m21)*(v/f),k=(t*s.m02+n*s.m12+i*s.m22)*(b/m),C=y*o.m00+w*o.m10+k*o.m20,I=y*o.m01+w*o.m11+k*o.m21,T=y*o.m02+w*o.m12+k*o.m22,_=On(C*a.m00+I*a.m10+T*a.m20),x=On(C*a.m01+I*a.m11+T*a.m21),$=On(C*a.m02+I*a.m12+T*a.m22);return[_*255,x*255,$*255]},gi=(...t)=>{t=Wt(t,"lab");const[n,i,s,...o]=t,[a,h,r]=ta([n,i,s]),[c,l,p]=ea(a,h,r);return[c,l,p,...o.length>0&&o[0]<1?[o[0]]:[]]};function ta(t){var n=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],i=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],s=_n(i,t);return _n(n,s.map(o=>o**3))}function zn(t){const n=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*n}const na=(t,n,i)=>{t=zn(t/255),n=zn(n/255),i=zn(i/255);const{MtxRGB2XYZ:s,MtxAdaptMa:o,MtxAdaptMaI:a,Xn:h,Yn:r,Zn:c,As:l,Bs:p,Cs:f}=Ds;let m=t*s.m00+n*s.m10+i*s.m20,d=t*s.m01+n*s.m11+i*s.m21,v=t*s.m02+n*s.m12+i*s.m22;const b=h*o.m00+r*o.m10+c*o.m20,y=h*o.m01+r*o.m11+c*o.m21,w=h*o.m02+r*o.m12+c*o.m22;let k=m*o.m00+d*o.m10+v*o.m20,C=m*o.m01+d*o.m11+v*o.m21,I=m*o.m02+d*o.m12+v*o.m22;return k*=b/l,C*=y/p,I*=w/f,m=k*a.m00+C*a.m10+I*a.m20,d=k*a.m01+C*a.m11+I*a.m21,v=k*a.m02+C*a.m12+I*a.m22,[m,d,v]},bi=(...t)=>{const[n,i,s,...o]=Wt(t,"rgb"),a=na(n,i,s);return[...ia(a),...o.length>0&&o[0]<1?[o[0]]:[]]};function ia(t){const n=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],i=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],s=_n(n,t);return _n(i,s.map(o=>Math.cbrt(o)))}const{sin:sa,cos:oa}=Math,ca=(...t)=>{let[n,i,s]=Wt(t,"lch");return isNaN(s)&&(s=0),s=s*Jc,[n,oa(s)*i,sa(s)*i]},Bn=(...t)=>{t=Wt(t,"lch");const[n,i,s,...o]=t,[a,h,r]=ca(n,i,s),[c,l,p]=gi(a,h,r);return[c,l,p,...o.length>0&&o[0]<1?[o[0]]:[]]},{sqrt:aa,atan2:ra,round:la}=Math,da=(...t)=>{const[n,i,s]=Wt(t,"lab"),o=aa(i*i+s*s);let a=(ra(s,i)*Qc+360)%360;return la(o*1e4)===0&&(a=Number.NaN),[n,o,a]},ua=(...t)=>{const[n,i,s,...o]=Wt(t,"rgb"),[a,h,r]=bi(n,i,s),[c,l,p]=da(a,h,r);return[c,l,p,...o.length>0&&o[0]<1?[o[0]]:[]]},ha={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",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",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:ud}=ha;function Ns({mediaAttachments:t,statusID:n,instance:i,lang:s,index:o=0,onClose:a=()=>{}}){var C,I;const[h,r]=L("default"),c=Y(null),[l,p]=L(o),f=Y(null);gt(()=>{var T;(T=f.current)==null||T.scrollIntoView()},[]);const m=Y(n);se(()=>{const T=o*c.current.clientWidth,_=m.current!==n;_&&(m.current=n),c.current.focus(),c.current.scrollTo({left:T*(Et()?-1:1),behavior:_?"auto":"smooth"})},[o,n]);const[d,v]=L(!0);se(()=>{let T=()=>{a()};return c.current&&c.current.addEventListener("swiped-down",T),()=>{c.current&&c.current.removeEventListener("swiped-down",T)}},[]),Be("esc",a,{ignoreEventWhen:T=>!!document.querySelector("#modal-container > *")},[a]),se(()=>{let T=()=>{const{clientWidth:_,scrollLeft:x}=c.current,$=Math.round(Math.abs(x)/_);p($)};return c.current&&c.current.addEventListener("scroll",T,{passive:!0}),()=>{c.current&&c.current.removeEventListener("scroll",T)}},[]),se(()=>{let T=setTimeout(()=>{var _,x;(x=(_=c.current)==null?void 0:_.focus)==null||x.call(_)},100);return()=>clearTimeout(T)},[]);const b=_e(()=>t==null?void 0:t.map(T=>{const{blurhash:_}=T;if(_){const x=oi(_);return ua(x)}return null}),[t]),y=_e(()=>b==null?void 0:b.map(T=>T?{light:Bn([.95,.01,T[2]]),dark:Bn([.35,.01,T[2]]),default:Bn([.6,T[1],T[2]])}:null)),w=_e(()=>{const _=100/y.length,x=y.map((D,V)=>{var j,B,q,ie;const G=V*_+5,X=(V+1)*_-5;return D!=null&&D.light&&(D!=null&&D.dark)?{light:`
rgb(${(j=D.light)==null?void 0:j.join(",")}) ${G}%,
rgb(${(B=D.light)==null?void 0:B.join(",")}) ${X}%
`,dark:`
rgb(${(q=D.dark)==null?void 0:q.join(",")}) ${G}%,
rgb(${(ie=D.dark)==null?void 0:ie.join(",")}) ${X}%
`}:{light:`
transparent ${G}%,
transparent ${X}%
`,dark:`
transparent ${G}%,
transparent ${X}%
`}}),$=x.map(D=>D.light).join(", "),N=x.map(D=>D.dark).join(", ");return{light:$,dark:N}},[y]);let k=Y(null);return se(()=>()=>{var T,_;(_=(T=k.current)==null?void 0:T.hideToast)==null||_.call(T)},[]),gt(()=>{const T=y[l];let _,x;if(T){const $=be.local.get("theme");if($){const N=`rgb(${T[$].join(",")})`;_=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),_&&(x=_.content,_.content=N)}else{const N=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",D=`rgb(${T[N].join(",")})`;_=document.querySelector(`meta[name="theme-color"][media*="${N}"]`),_&&(x=_.content,_.content=D)}}return()=>{_&&x&&(_.content=x)}},[l,y]),e("div",{class:`media-modal-container media-modal-count-${t==null?void 0:t.length}`,children:[e("div",{ref:c,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:T=>{(T.target.classList.contains("carousel-item")||T.target.classList.contains("media")||T.target.classList.contains("media-zoom"))&&a()},style:t.length>1?{backgroundAttachment:"local","--accent-gradient-light":w==null?void 0:w.light,"--accent-gradient-dark":w==null?void 0:w.dark}:{},children:t==null?void 0:t.map((T,_)=>{var $,N;const x=t.length===1?y[_]:null;return e("div",{class:"carousel-item",style:x?{"--accent-color":`rgb(${x.default.join(",")})`,"--accent-light-color":`rgb(${($=x.light)==null?void 0:$.join(",")})`,"--accent-dark-color":`rgb(${(N=x.dark)==null?void 0:N.join(",")})`,"--accent-alpha-color":`rgba(${x.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:_===l?f:null,onClick:D=>{D.target.classList.contains("media")||v(!d)},children:[!!T.description&&e("button",{type:"button",class:"media-alt",hidden:!d,onClick:()=>{A.showMediaAlt={alt:T.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:T.description})]}),e(ms,{media:T,showOriginal:!0,lang:s})]},T.id)})}),e("div",{class:"carousel-top-controls",hidden:!d,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((T,_)=>e("button",{type:"button",disabled:_===l,class:`carousel-dot ${_===l?"active":""}`,onClick:x=>{x.preventDefault(),x.stopPropagation();const $=c.current.clientWidth*_*(Et()?-1:1);c.current.focus(),c.current.scrollTo({left:$,behavior:"smooth"})},children:e(S,{icon:"round",size:"s",alt:"⸱"})},T.id))}):e("span",{}),e("span",{children:[e(at,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(S,{icon:"more",alt:g._({id:"2FYpfJ"})})}),children:[e(Ue,{href:((C=t[l])==null?void 0:C.remoteUrl)||((I=t[l])==null?void 0:I.url),class:"carousel-button",target:"_blank",title:g._({id:"5hXGws"}),children:[e(S,{icon:"popout"}),e("span",{children:e(u,{id:"aDr7Vc"})})]}),!1]})," ",e(he,{to:`${i?`/${i}`:""}/s/${n}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${l+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(u,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(t==null?void 0:t.length)>1&&e("div",{class:"carousel-controls",hidden:!d,children:[e("button",{type:"button",class:"carousel-button",hidden:l===0,onClick:T=>{T.preventDefault(),T.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l-1)*(Et()?-1:1),behavior:"smooth"})},children:e(S,{icon:"arrow-left",alt:g._({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:l===t.length-1,onClick:T=>{T.preventDefault(),T.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l+1)*(Et()?-1:1),behavior:"smooth"})},children:e(S,{icon:"arrow-right",alt:g._({id:"hXzOVo"})})})]})]})}const fa=[,"spam","legal","violation","other"],Zt={spam:{label:{id:"t8dIOP"},description:{id:"csQin/"}},legal:{label:{id:"IjKdHM"},description:{id:"e6tGFu"}},violation:{label:{id:"KPFHM2"},description:{id:"fpotTF"},stampLabel:{id:"iuLUuH"}},other:{label:{id:"/IX/7x"},description:{id:"kxiG8g"},excludeStamp:!0}};function pa({account:t,post:n,onClose:i}){const{_:s}=Qe(),{masto:o}=ae(),[a,h]=L("default"),[r,c]=t.acct.split("@"),[l,p]=_e(()=>{const{rules:k,domain:C}=cs();return[k||[],C]}),[f,m]=L(null),[d,v]=L(!1),b=Y(null),[y,w]=L(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:n?g._({id:"muLhL3"}):g._({id:"ACul2G",values:{username:r}})}),e("button",{type:"button",class:"plain4 small",disabled:a==="loading",onClick:()=>i(),children:e(S,{icon:"x",size:"xl",alt:g._({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:n?e(Ye,{status:n,size:"s",previewMode:!0}):e(rt,{account:t,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!f&&!Zt[f].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[s(Zt[f].stampLabel||s(Zt[f].label)),e("small",{children:e(u,{id:"2WtL62"})})]},f),e("form",{onSubmit:k=>{k.preventDefault();const C=new FormData(k.target),I=Object.fromEntries(C.entries());let{category:T,comment:_,forward:x}=I;_||(_=void 0),x==="on"&&(x=!0);const $=T==="violation"?Object.entries(I).filter(([D])=>D.startsWith("rule_ids")).map(([D,V])=>V):void 0,N={category:T,comment:_,forward:x,ruleIds:$};h("loading"),(async()=>{try{await o.v1.reports.create({accountId:t.id,statusIds:n!=null&&n.id?[n.id]:void 0,category:T,comment:_,ruleIds:$,forward:x}),h("success"),ue(n?g._({id:"y3ou+8"}):g._({id:"R9kjEL"})),i()}catch(D){h("error"),ue((D==null?void 0:D.message)||(n?g._({id:"+3FjPq"}):g._({id:"oEQq5w"})))}})()},children:[e("p",{children:n?g._({id:"L9fUm+"}):g._({id:"rSLkfe"})}),e("section",{class:"report-categories",children:fa.map(k=>k==="violation"&&!(l!=null&&l.length)?null:e(z,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:k,required:!0,disabled:a==="loading",onChange:C=>{m(C.target.value),v(C.target.value==="violation")}}),e("span",{children:[s(Zt[k].label),"  ",e("small",{class:"ib insignificant",children:s(Zt[k].description)})]})]}),k==="violation"&&!!(l!=null&&l.length)&&e("div",{class:"shazam-container no-animation",hidden:!d,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:b,children:l.map((C,I)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${I}]`,value:C.id,required:d&&!y,disabled:a==="loading",onChange:T=>{const{checked:_}=T.target;_?w(!0):b.current.querySelectorAll("input:checked").length||w(!1)}}),e("span",{children:C.text})]},C.id))})})})]},k))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(u,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:a==="loading",required:!n})]}),!!c&&c!==p&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:a==="loading"})," ",e("span",{children:e(u,{id:"cyjS8M",values:{domain:c},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:a==="loading",children:e(u,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:a==="loading",onClick:async()=>{try{await o.v1.accounts.$select(t.id).mute(),ue(g._({id:"/BGBeF",values:{username:r}}))}catch{ue(g._({id:"v02K7/",values:{username:r}}))}},children:e(u,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:a==="loading",onClick:async()=>{try{await o.v1.accounts.$select(t.id).block(),ue(g._({id:"kjUejn",values:{username:r}}))}catch{ue(g._({id:"pMcdDp",values:{username:r}}))}},children:e(u,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(Pe,{hidden:a!=="loading"})]})]})]})]})}var vi={exports:{}},hd=vi.exports;(function(t){var n=function(){var i=String.fromCharCode,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",a={};function h(c,l){if(!a[c]){a[c]={};for(var p=0;p<c.length;p++)a[c][c.charAt(p)]=p}return a[c][l]}var r={compressToBase64:function(c){if(c==null)return"";var l=r._compress(c,6,function(p){return s.charAt(p)});switch(l.length%4){default:case 0:return l;case 1:return l+"===";case 2:return l+"==";case 3:return l+"="}},decompressFromBase64:function(c){return c==null?"":c==""?null:r._decompress(c.length,32,function(l){return h(s,c.charAt(l))})},compressToUTF16:function(c){return c==null?"":r._compress(c,15,function(l){return i(l+32)})+" "},decompressFromUTF16:function(c){return c==null?"":c==""?null:r._decompress(c.length,16384,function(l){return c.charCodeAt(l)-32})},compressToUint8Array:function(c){for(var l=r.compress(c),p=new Uint8Array(l.length*2),f=0,m=l.length;f<m;f++){var d=l.charCodeAt(f);p[f*2]=d>>>8,p[f*2+1]=d%256}return p},decompressFromUint8Array:function(c){if(c==null)return r.decompress(c);for(var l=new Array(c.length/2),p=0,f=l.length;p<f;p++)l[p]=c[p*2]*256+c[p*2+1];var m=[];return l.forEach(function(d){m.push(i(d))}),r.decompress(m.join(""))},compressToEncodedURIComponent:function(c){return c==null?"":r._compress(c,6,function(l){return o.charAt(l)})},decompressFromEncodedURIComponent:function(c){return c==null?"":c==""?null:(c=c.replace(/ /g,"+"),r._decompress(c.length,32,function(l){return h(o,c.charAt(l))}))},compress:function(c){return r._compress(c,16,function(l){return i(l)})},_compress:function(c,l,p){if(c==null)return"";var f,m,d={},v={},b="",y="",w="",k=2,C=3,I=2,T=[],_=0,x=0,$;for($=0;$<c.length;$+=1)if(b=c.charAt($),Object.prototype.hasOwnProperty.call(d,b)||(d[b]=C++,v[b]=!0),y=w+b,Object.prototype.hasOwnProperty.call(d,y))w=y;else{if(Object.prototype.hasOwnProperty.call(v,w)){if(w.charCodeAt(0)<256){for(f=0;f<I;f++)_=_<<1,x==l-1?(x=0,T.push(p(_)),_=0):x++;for(m=w.charCodeAt(0),f=0;f<8;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1}else{for(m=1,f=0;f<I;f++)_=_<<1|m,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=0;for(m=w.charCodeAt(0),f=0;f<16;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1}k--,k==0&&(k=Math.pow(2,I),I++),delete v[w]}else for(m=d[w],f=0;f<I;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1;k--,k==0&&(k=Math.pow(2,I),I++),d[y]=C++,w=String(b)}if(w!==""){if(Object.prototype.hasOwnProperty.call(v,w)){if(w.charCodeAt(0)<256){for(f=0;f<I;f++)_=_<<1,x==l-1?(x=0,T.push(p(_)),_=0):x++;for(m=w.charCodeAt(0),f=0;f<8;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1}else{for(m=1,f=0;f<I;f++)_=_<<1|m,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=0;for(m=w.charCodeAt(0),f=0;f<16;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1}k--,k==0&&(k=Math.pow(2,I),I++),delete v[w]}else for(m=d[w],f=0;f<I;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1;k--,k==0&&(k=Math.pow(2,I),I++)}for(m=2,f=0;f<I;f++)_=_<<1|m&1,x==l-1?(x=0,T.push(p(_)),_=0):x++,m=m>>1;for(;;)if(_=_<<1,x==l-1){T.push(p(_));break}else x++;return T.join("")},decompress:function(c){return c==null?"":c==""?null:r._decompress(c.length,32768,function(l){return c.charCodeAt(l)})},_decompress:function(c,l,p){var f=[],m,d=4,v=4,b=3,y="",w=[],k,C,I,T,_,x,$,N={val:p(0),position:l,index:1};for(k=0;k<3;k+=1)f[k]=k;for(I=0,_=Math.pow(2,2),x=1;x!=_;)T=N.val&N.position,N.position>>=1,N.position==0&&(N.position=l,N.val=p(N.index++)),I|=(T>0?1:0)*x,x<<=1;switch(m=I){case 0:for(I=0,_=Math.pow(2,8),x=1;x!=_;)T=N.val&N.position,N.position>>=1,N.position==0&&(N.position=l,N.val=p(N.index++)),I|=(T>0?1:0)*x,x<<=1;$=i(I);break;case 1:for(I=0,_=Math.pow(2,16),x=1;x!=_;)T=N.val&N.position,N.position>>=1,N.position==0&&(N.position=l,N.val=p(N.index++)),I|=(T>0?1:0)*x,x<<=1;$=i(I);break;case 2:return""}for(f[3]=$,C=$,w.push($);;){if(N.index>c)return"";for(I=0,_=Math.pow(2,b),x=1;x!=_;)T=N.val&N.position,N.position>>=1,N.position==0&&(N.position=l,N.val=p(N.index++)),I|=(T>0?1:0)*x,x<<=1;switch($=I){case 0:for(I=0,_=Math.pow(2,8),x=1;x!=_;)T=N.val&N.position,N.position>>=1,N.position==0&&(N.position=l,N.val=p(N.index++)),I|=(T>0?1:0)*x,x<<=1;f[v++]=i(I),$=v-1,d--;break;case 1:for(I=0,_=Math.pow(2,16),x=1;x!=_;)T=N.val&N.position,N.position>>=1,N.position==0&&(N.position=l,N.val=p(N.index++)),I|=(T>0?1:0)*x,x<<=1;f[v++]=i(I),$=v-1,d--;break;case 2:return w.join("")}if(d==0&&(d=Math.pow(2,b),b++),f[$])y=f[$];else if($===v)y=C+C.charAt(0);else return null;w.push(y),f[v++]=C+y.charAt(0),d--,C=y,d==0&&(d=Math.pow(2,b),b++)}}};return r}();t!=null?t.exports=n:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return n})})(vi);var Oi=vi.exports;const ma="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e",ga="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e",ba="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e",va=200,ya=10;async function Sn(){const{masto:t}=ae(),n=t.v1.followedTags.list({limit:va}),i=[];let s=0;do{const{value:o,done:a}=await n.next();if(a||(o==null?void 0:o.length)===0)break;i.push(...o),s++}while(s<ya);return i.sort((o,a)=>o.name.localeCompare(a.name)),i.length&&setTimeout(()=>{be.account.set("followedTags",{tags:i,updatedAt:Date.now()})},1),i}const wa=24*60*60*1e3;async function ka(){try{const{tags:t,updatedAt:n}=be.account.get("followedTags")||{};return t!=null&&t.length?(Date.now()-n>wa&&Sn(),t):await Sn()}catch{return[]}}const zi=document.createElement("div"),_a=t=>{if(!t)return[];if(t.indexOf("#")===-1)return[];zi.innerHTML=t;const n=zi.querySelectorAll("a.hashtag");return n.length?Array.from(n).map(i=>i.innerText.trim().replace(/^[^#]*#+/,"")):[]};function fn({children:t}){if(typeof t=="string")return t;const[n,i]=L("");return se(()=>{Promise.resolve(t).then(i)},[t]),n}const yt=9,Sa=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],Ps={following:{id:"7ZJHdw"},notifications:{id:"iDNBZe"},list:{id:"h16FyT"},public:{id:"tXgQpk"},search:{id:"A1taO8"},"account-statuses":{id:"AeXO77"},bookmarks:{id:"7Ff7ia"},favourites:{id:"zZOZj7"},hashtag:{id:"GP8RLS"},trending:{id:"4/iCqx"},mentions:{id:"/bZzdR"}},pn={list:[{text:{id:"DUMt1y"},name:"id",notRequired:!0}],public:[{text:{id:"OgyJSr"},name:"local",type:"checkbox"},{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],trending:[{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],search:[{text:{id:"dmloPh"},name:"query",type:"text",placeholder:{id:"UHDQDE"},notRequired:!0}],"account-statuses":[{text:"@",name:"id",type:"text",placeholder:"cheeaun@mastodon.social"}],hashtag:[{text:"#",name:"hashtag",type:"text",placeholder:{id:"a6oTWs"},pattern:"[^#]+"},{text:{id:"eK4SL/"},name:"media",type:"checkbox"},{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}]},Ca=_t(async({id:t})=>{const n=await ae().masto.v1.accounts.$select(t).fetch();return n.username||n.acct||n.displayName}),Cn={following:{id:"home",title:(t,n)=>n===0?g._({id:"i0qMbr"}):g._({id:"following.title"}),path:"/",icon:"home"},mentions:{id:"mentions",title:{id:"/bZzdR"},path:"/mentions",icon:"at"},notifications:{id:"notifications",title:{id:"iDNBZe"},path:"/notifications",icon:"notification"},list:{id:({id:t})=>t?"list":"lists",title:({id:t})=>t?Tc(t):g._({id:"h16FyT"}),path:({id:t})=>t?`/l/${t}`:"/l",icon:"list",excludeViewMode:({id:t})=>t?[]:["multi-column"]},public:{id:"public",title:({local:t})=>t?g._({id:"d5zxa4"}):g._({id:"4ERYY7"}),subtitle:({instance:t})=>t||ae().instance,path:({local:t,instance:n})=>`/${n}/p${t?"/l":""}`,icon:({local:t})=>t?"building":"earth"},trending:{id:"trending",title:{id:"4/iCqx"},subtitle:({instance:t})=>t||ae().instance,path:({instance:t})=>`/${t}/trending`,icon:"chart"},search:{id:"search",title:({query:t})=>t?`${t}`:g._({id:"A1taO8"}),path:({query:t})=>t?`/search?q=${encodeURIComponent(t)}&type=statuses`:"/search",icon:"search",excludeViewMode:({query:t})=>t?[]:["multi-column"]},"account-statuses":{id:"account-statuses",title:Ca,path:({id:t})=>`/a/${t}`,icon:"user"},bookmarks:{id:"bookmarks",title:{id:"7Ff7ia"},path:"/b",icon:"bookmark"},favourites:{id:"favourites",title:{id:"zZOZj7"},path:"/f",icon:"heart"},hashtag:{id:"hashtag",title:({hashtag:t})=>t,subtitle:({instance:t})=>t||ae().instance,path:({hashtag:t,instance:n,media:i})=>`${n?`/${n}`:""}/t/${t.split(/\s+/).join("+")}${i?"?media=1":""}`,icon:"hashtag"}};function Ia({onClose:t}){const{_:n}=Qe(),i=qe(A),{shortcuts:s}=i,[o,a]=L(!1),[h,r]=L(!1),[c]=ui();return e("div",{id:"shortcuts-settings-container",class:"sheet",tabindex:"-1",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(S,{icon:"shortcut"})," ",e(u,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(u,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(u,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:g._({id:"qwdOim"}),imgURL:ma},{value:"tab-menu-bar",label:g._({id:"UxBoCm"}),imgURL:ba},{value:"multi-column",label:g._({id:"uvDfdW"}),imgURL:ga}].map(({value:l,label:p,imgURL:f})=>{const m=i.settings.shortcutsViewMode===l||l==="float-button"&&!i.settings.shortcutsViewMode;return e("label",{class:m?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:l,checked:m,onChange:d=>{A.settings.shortcutsViewMode=d.target.value}})," ",e("img",{src:f,alt:"",width:"80",height:"58"})," ",e("span",{children:p})]},l)})}),s.length>0?e(z,{children:[e("ol",{class:"shortcuts-list",ref:c,children:s.filter(Boolean).map((l,p)=>{const f=Object.values(l).join("-"),{type:m}=l;if(!Cn[m])return null;let{icon:d,title:v,subtitle:b,excludeViewMode:y}=Cn[m];typeof v=="function"?v=v(l,p):v=n(v),typeof b=="function"?b=b(l,p):b=n(b),typeof d=="function"&&(d=d(l,p)),typeof y=="function"&&(y=y(l,p));const w=y==null?void 0:y.includes(i.settings.shortcutsViewMode);return e("li",{children:[e(S,{icon:d}),e("span",{class:"shortcut-text",children:[e(fn,{children:v}),b&&e(z,{children:[" ",e("small",{class:"ib insignificant",children:b})]}),w&&e("span",{class:"tag",children:e(u,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:p===0,onClick:()=>{const k=Array.from(A.shortcuts);if(p>0){const C=A.shortcuts[p-1];k[p-1]=l,k[p]=C,A.shortcuts=k}},children:e(S,{icon:"arrow-up",alt:g._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:p===s.length-1,onClick:()=>{const k=Array.from(A.shortcuts);if(p<A.shortcuts.length-1){const C=A.shortcuts[p+1];k[p+1]=l,k[p]=C,A.shortcuts=k}},children:e(S,{icon:"arrow-down",alt:g._({id:"3Ib6FN"})})}),e("button",{type:"button",class:"plain small",onClick:()=>{a({shortcut:l,shortcutIndex:p})},children:e(S,{icon:"pencil",alt:g._({id:"ePK91l"})})})]})]},f)})}),s.length===1&&i.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(S,{icon:"info"})," ",e("small",{children:e(u,{id:"3Xq4Zi"})})]})]}):e("div",{class:"ui-state insignificant",children:[e("p",{children:i.settings.shortcutsViewMode==="multi-column"?g._({id:"3xIN+E"}):g._({id:"vLxvHT"})}),e("p",{children:e(u,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:l=>{l.preventDefault(),A.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:s.length>=yt&&(i.settings.shortcutsViewMode==="multi-column"?g._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:yt}}):g._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:yt}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>r(!0),children:e(u,{id:"bgVLbt"})}),e("button",{type:"button",disabled:s.length>=yt,onClick:()=>a(!0),children:[e(S,{icon:"plus"})," ",e("span",{children:i.settings.shortcutsViewMode==="multi-column"?g._({id:"Vh3ADI"}):g._({id:"9tmn6W"})})]})]})]}),o&&e(Fe,{onClick:l=>{l.target===l.currentTarget&&a(!1)},children:e(Ta,{shortcut:o.shortcut,shortcutIndex:o.shortcutIndex,onSubmit:({result:l,mode:p})=>{p==="edit"?A.shortcuts[o.shortcutIndex]=l:A.shortcuts.push(l)},onClose:()=>a(!1)})}),h&&e(Fe,{onClick:l=>{l.target===l.currentTarget&&r(!1)},children:e(xa,{shortcuts:s,onClose:()=>r(!1)})})]})}const Bi={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function Ta({onSubmit:t,disabled:n,shortcut:i,shortcutIndex:s,onClose:o}){var y,w;const{_:a}=Qe(),h=!!i,[r,c]=L((i==null?void 0:i.type)||null),[l,p]=L("default"),[f,m]=L([]),[d,v]=L([]);se(()=>{(async()=>{if(r==="list")try{p("loading");const k=await on();m(k),p("default")}catch{p("error")}})(),(async()=>{if(r==="hashtag")try{const k=await Sn();v(k)}catch{}})()},[r]);const b=Y();return se(()=>{if(h&&r&&pn[r]){const k=b.current;pn[r].forEach(({name:C,type:I})=>{const T=k.querySelector(`[name="${C}"]`);T&&i[C]&&(I==="checkbox"?T.checked=i[C]==="on":T.value=i[C])})}},[h,r]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:h?g._({id:"pe1jog"}):g._({id:"Lsxpe5"})})}),e("main",{tabindex:"-1",children:e("form",{ref:b,onSubmit:k=>{k.preventDefault();const C=new FormData(k.target),I={};C.forEach((T,_)=>{I[_]=T==null?void 0:T.trim(),_==="instance"&&(I[_]=I[_].replace(/^https?:\/\//,"").replace(/\/+$/,""),I[_]=I[_].replace(/^@?[^@]+@/,""))}),I.type&&(t({result:I,mode:h?"edit":"add"}),k.target.reset(),c(null),o==null||o())},children:[e("p",{children:e("label",{children:[e("span",{children:e(u,{id:"cklVjM"})}),e("select",{required:!0,disabled:n,onChange:k=>{c(k.target.value)},defaultValue:h?i.type:void 0,name:"type",dir:"auto",children:[e("option",{}),Sa.map(k=>e("option",{value:k,children:a(Ps[k])}))]})]})}),(w=(y=pn[r])==null?void 0:y.map)==null?void 0:w.call(y,({text:k,name:C,type:I,placeholder:T,pattern:_,notRequired:x})=>r==="list"?e("p",{children:e("label",{children:[e("span",{children:e(u,{id:"2BBAbc"})}),e("select",{name:"id",required:!x,disabled:n||l==="loading",defaultValue:h?i.id:void 0,dir:"auto",children:[e("option",{value:""}),f.map($=>e("option",{value:$.id,children:$.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:a(k)})," ",e("input",{type:I,switch:I==="checkbox"||void 0,name:C,placeholder:a(T),required:I==="text"&&!x,disabled:n,list:r==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:_,dir:"auto"}),r==="hashtag"&&d.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:d.map($=>e("option",{value:$.name}))})]})})),!!Bi[r]&&e("p",{class:"form-note insignificant",children:[e(S,{icon:"info"}),a(Bi[r])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:n||l==="loading",children:h?g._({id:"tfDRzk"}):g._({id:"m16xKo"})}),h&&e("button",{type:"button",class:"light danger",onClick:()=>{A.shortcuts.splice(s,1),o==null||o()},children:e(u,{id:"t/YqKh"})})]})]})})]})}function xa({shortcuts:t,onClose:n}){var m;const{_:i}=Qe(),{masto:s}=ae(),o=_e(()=>!t||!t.filter(Boolean).length?"":Oi.compressToEncodedURIComponent(JSON.stringify(t.filter(Boolean))),[t]),[a,h]=L(""),[r,c]=L("default"),l=_e(()=>{if(!a)return c("default"),null;try{const d=JSON.parse(Oi.decompressFromEncodedURIComponent(a));if(!Array.isArray(d))throw new Error("Not an array");return c("default"),d}catch{try{const v=JSON.parse(a);if(!Array.isArray(v))throw new Error("Not an array");return c("default"),v}catch{return c("error"),null}}},[a]),p=A.shortcuts.length>0,f=Y();return e("div",{id:"import-export-container",class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(S,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(u,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:f,type:"text",name:"import",placeholder:g._({id:"tBmklN"}),class:"block",onInput:d=>{h(d.target.value)},dir:"auto"}),A.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:r==="cloud-downloading",onClick:async()=>{c("cloud-downloading");const d=wt();ue(g._({id:"HLqLGx"}));try{const b=(await s.v1.accounts.relationships.fetch({id:[d]}))[0];if(b){const{note:y=""}=b;if(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(y)){const w=y.match(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/)[1],{v:k,dt:C,data:I}=JSON.parse(w);f.current.value=I,f.current.dispatchEvent(new Event("input"))}}c("default")}catch{c("error"),ue(g._({id:"gCDfX+"}))}},title:g._({id:"B6cG3J"}),children:[e(S,{icon:"cloud"}),e(S,{icon:"arrow-down"})]})]}),!!l&&Array.isArray(l)&&e(z,{children:[e("p",{children:[e("b",{children:l.length})," shortcut",l.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",a.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:l.map(d=>{var v,b;return e("li",{children:[e("span",{style:{opacity:t.some(y=>Object.keys(y).every(w=>y[w]===d[w]))?1:0},children:"*"}),e("span",{children:[i(Ps[d.type]),d.type==="list"&&" ⚠️"," ",(b=(v=pn[d.type])==null?void 0:v.map)==null?void 0:b.call(v,({text:y,name:w,type:k})=>d[w]?e(z,{children:[e("span",{class:"tag collapsed insignificant",children:[y,":"," ",k==="checkbox"?d[w]==="on"?"✅":"❌":d[w]]})," "]}):null)]})]})})}),e("p",{children:[e("small",{children:e(u,{id:"o6sElH"})}),e("br",{}),e("small",{children:["⚠️"," ",e(u,{id:"N4z4P/"})]})]})]}),r==="error"&&e("p",{class:"error",children:e("small",{children:["⚠️ ",e(u,{id:"ZhsPEb"})]})}),e("p",{children:[p&&e(z,{children:[e(lt,{confirmLabel:g._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(u,{id:"nl8sCE"})}),onClick:()=>{const d=l.filter(y=>!A.shortcuts.some(w=>Object.keys(w).every(k=>w[k]===y[k])));if(!d.length){ue(g._({id:"o6L30P"}));return}let v=[...A.shortcuts,...d];const b=v.length>yt;b&&(v=v.slice(0,yt)),A.shortcuts=v,ue(b?g._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:yt}}):g._({id:"QO9uTx"})),n==null||n()},children:e("button",{type:"button",class:"plain2",disabled:!l,children:e(u,{id:"c89gCv"})})})," "]}),e(lt,{confirmLabel:p?g._({id:"6ZjzWP"}):g._({id:"DWumLi"}),menuItemClassName:p?"danger":void 0,onClick:()=>{A.shortcuts=l,ue(g._({id:"QO9uTx"})),n==null||n()},children:e("button",{type:"button",class:"plain2",disabled:!l,children:p?g._({id:"uIp8WL"}):g._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(S,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(u,{id:"GS+Mus"})})]}),e("p",{children:e("input",{style:{width:"100%"},type:"text",value:o,readOnly:!0,onClick:d=>{if(d.target.value){d.target.select();try{navigator.clipboard.writeText(d.target.value),ue(g._({id:"cWtH+v"}))}catch{ue(g._({id:"yUWyHa"}))}}},dir:"auto"})}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!o,onClick:()=>{try{navigator.clipboard.writeText(o),ue(g._({id:"+Kq2vY"}))}catch{ue(g._({id:"tFvxZF"}))}},children:[e(S,{icon:"clipboard"})," ",e("span",{children:e(u,{id:"he3ygx"})})]})," ",(navigator==null?void 0:navigator.share)&&((m=navigator==null?void 0:navigator.canShare)==null?void 0:m.call(navigator,{text:o}))&&e("button",{type:"button",class:"plain2",disabled:!o,onClick:()=>{try{navigator.share({text:o})}catch{alert(g._({id:"TtG3Uh"}))}},children:[e(S,{icon:"share"})," ",e("span",{children:e(u,{id:"Z8lGw6"})})]})," ",A.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2",disabled:r==="cloud-uploading",onClick:async()=>{c("cloud-uploading");const d=wt();try{const b=(await s.v1.accounts.relationships.fetch({id:[d]}))[0];if(b){const{note:y=""}=b;let w="";const k=JSON.stringify({v:"1",dt:Date.now(),data:o});/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(y)?w=y.replace(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/,`<phanpy-shortcuts-settings>${k}</phanpy-shortcuts-settings>`):w=`${y}
<phanpy-shortcuts-settings>${k}</phanpy-shortcuts-settings>`,ue(g._({id:"9ZYiLz"})),await s.v1.accounts.$select(d).note.create({comment:w}),c("default"),ue(g._({id:"5w02SH"}))}}catch{c("error"),ue(g._({id:"aVsTYo"}))}},title:g._({id:"gWd6Cu"}),children:[e(S,{icon:"cloud"}),e(S,{icon:"arrow-up"})]})," ",o.length>0&&e("small",{class:"insignificant ib",children:e(u,{id:"IPXOXm",values:{0:o.length}})})]}),!!o&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(u,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(t.filter(Boolean),null,2)})]})]}),A.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(S,{icon:"cloud"})," ",e(u,{id:"C4T6O/"})]})})]})]})}as(A,t=>{for(const[n,i,s,o]of t)/^show/i.test(i)&&!s&&Kn()});function Aa(){var s,o,a,h,r,c,l,p;const t=qe(A),n=rs(),i=Gt();return se(()=>{setTimeout(ho,1e3)},[]),e(z,{children:[!!t.showCompose&&e(Fe,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(fo,{replyToStatus:typeof t.showCompose!="boolean"?t.showCompose.replyToStatus:((s=window.__COMPOSE__)==null?void 0:s.replyToStatus)||null,editStatus:((o=A.showCompose)==null?void 0:o.editStatus)||((a=window.__COMPOSE__)==null?void 0:a.editStatus)||null,draftStatus:((h=A.showCompose)==null?void 0:h.draftStatus)||((r=window.__COMPOSE__)==null?void 0:r.draftStatus)||null,onClose:f=>{const{newStatus:m,instance:d,type:v}=f||{};A.showCompose=!1,window.__COMPOSE__=null,m&&(A.reloadStatusPage++,ue({text:{post:g._({id:"aTyHBW"}),reply:g._({id:"lZdBKl"}),edit:g._({id:"a5BN7l"})}[v||"post"],delay:1e3,duration:1e4,onClick:b=>{b.hideToast(),A.prevLocation=i,n(d?`/${d}/s/${m.id}`:`/s/${m.id}`)}}))}})}),!!t.showSettings&&e(Fe,{onClose:()=>{A.showSettings=!1},children:e(_c,{onClose:()=>{A.showSettings=!1}})}),!!t.showAccounts&&e(Fe,{onClose:()=>{A.showAccounts=!1},children:e(uc,{onClose:()=>{A.showAccounts=!1}})}),!!t.showAccount&&e(Fe,{onClose:()=>{A.showAccount=!1},children:e(jc,{account:((c=t.showAccount)==null?void 0:c.account)||t.showAccount,instance:(l=t.showAccount)==null?void 0:l.instance,onClose:({destination:f}={})=>{A.showAccount=!1}})}),!!t.showDrafts&&e(Fe,{onClose:()=>{A.showDrafts=!1},children:e(Vc,{onClose:()=>A.showDrafts=!1})}),!!t.showMediaModal&&e(Fe,{onClick:f=>{(f.target===f.currentTarget||f.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(Ns,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(Fe,{onClose:()=>{A.showShortcutsSettings=!1},children:e(Ia,{onClose:()=>A.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Fe,{onClose:()=>{A.showGenericAccounts=!1},children:e(Wc,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(Fe,{onClose:f=>{A.showMediaAlt=!1},children:e(Zc,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(p=t.showMediaAlt)==null?void 0:p.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(Fe,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(Kc,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!t.showReportModal&&e(Fe,{onClose:()=>{A.showReportModal=!1},children:e(pa,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Zn({accountID:t,onChange:n}){const{masto:i}=ae(),[s,o]=L("default"),[a,h]=L(null),[r,c]=L(null),l=r!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||l,onClick:()=>{o("loading"),h("accept"),(async()=>{try{const p=await i.v1.followRequests.$select(t).authorize();if(!(p!=null&&p.followedBy))throw new Error("Follow request not accepted");c(p),n()}catch{}o("default")})()},children:e(u,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:s==="loading"||l,class:"light danger",onClick:()=>{o("loading"),h("reject"),(async()=>{try{const p=await i.v1.followRequests.$select(t).reject();if(p!=null&&p.followedBy)throw new Error("Follow request not rejected");c(p),n()}catch{o("default")}})()},children:e(u,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:l&&a?a==="accept"?e(S,{icon:"check-circle",alt:g._({id:"bzMKg7"}),class:"follow-accepted"}):e(S,{icon:"x-circle",alt:g._({id:"ekCRTP"}),class:"follow-rejected"}):e(Pe,{hidden:s!=="loading"})})]})}const Ui={mention:"comment",status:"notification",reblog:"rocket",follow:"follow",follow_request:"follow-add",favourite:"heart",poll:"poll",update:"pencil","admin.signup":"account-edit","admin.report":"account-warning",severed_relationships:"heart-break",moderation_warning:"alert",emoji_reaction:"emoji2","pleroma:emoji_reaction":"emoji2"};function Fi({account:t,emoji:n,emoji_url:i}){let s,o;typeof i=="string"?s=i:(s=i==null?void 0:i.url,o=i==null?void 0:i.staticUrl);const a=s?e($o,{url:s,staticUrl:o,alt:n}):n;return e(u,{id:"i5uN6K",values:{account:t,emojiObject:a}})}const Un={status:({account:t})=>e(u,{id:"idiIxW",values:{account:t}}),reblog:({count:t,account:n,postsCount:i,postType:s,components:{Subject:o}})=>e(u,{id:"jkt9P5",values:{0:Ke(t),1:Ke(t),count:t,postsCount:i,postType:s,account:n},components:{0:e(o,{clickable:t>1}),1:e("span",{title:t}),2:e(o,{clickable:t>1}),3:e("span",{title:t})}}),follow:({account:t,count:n,components:{Subject:i}})=>e(u,{id:"+71G9C",values:{0:Ke(n),count:n,account:t},components:{0:e(i,{clickable:n>1}),1:e("span",{title:n})}}),follow_request:({account:t})=>e(u,{id:"eh6NHW",values:{account:t}}),favourite:({account:t,count:n,postsCount:i,postType:s,components:{Subject:o}})=>e(u,{id:"RqX1mR",values:{0:Ke(n),1:Ke(n),count:n,postsCount:i,postType:s,account:t},components:{0:e(o,{clickable:n>1}),1:e("span",{title:n}),2:e(o,{clickable:n>1}),3:e("span",{title:n})}}),poll:()=>g._({id:"kIlJaS"}),"poll-self":()=>g._({id:"kpjzdN"}),"poll-voted":()=>g._({id:"moT7M8"}),update:()=>g._({id:"uzt17m"}),"favourite+reblog":({count:t,account:n,postsCount:i,postType:s,components:{Subject:o}})=>e(u,{id:"NunZZQ",values:{0:Ke(t),1:Ke(t),count:t,postsCount:i,postType:s,account:n},components:{0:e(o,{clickable:t>1}),1:e("span",{title:t}),2:e(o,{clickable:t>1}),3:e("span",{title:t})}}),"admin.sign_up":({account:t})=>e(u,{id:"fJCCpx",values:{account:t}}),"admin.report":({account:t,targetAccount:n})=>e(u,{id:"eNfCmq",values:{account:t,targetAccount:n}}),severed_relationships:({name:t})=>e(u,{id:"Xl9v6+",values:{name:t},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(u,{id:"YqffEv"})}),emoji_reaction:Fi,"pleroma:emoji_reaction":Fi},Ea={account_suspension:({from:t,targetName:n})=>e(u,{id:"uRkcgw",values:{from:t,targetName:n},components:{0:e("i",{}),1:e("i",{})}}),domain_block:({from:t,targetName:n,followersCount:i,followingCount:s})=>e(u,{id:"Q3yArs",values:{from:t,targetName:n,followersCount:i,followingCount:s},components:{0:e("i",{}),1:e("i",{})}}),user_domain_block:({targetName:t,followersCount:n,followingCount:i})=>e(u,{id:"RQKWUa",values:{targetName:t,followersCount:n,followingCount:i},components:{0:e("i",{})}})},Ra={none:{id:"ipnHrn"},disable:{id:"jw0eSZ"},mark_statuses_as_sensitive:{id:"v9jO+F"},delete_statuses:{id:"raUMBQ"},sensitive:{id:"w2OpMr"},silence:{id:"mlycBx"},suspend:{id:"Fz4lZ1"}},Fn=30;function La({notification:t,instance:n,isStatic:i,disableContextMenu:s}){var F,U,K,de,te,fe,ve;const{_:o}=Qe(),{masto:a}=ae(),{id:h,status:r,account:c,report:l,event:p,moderation_warning:f,_ids:m,_accounts:d,_statuses:v,_groupKeys:b,sampleAccounts:y,notificationsCount:w,groupKey:k}=t;let{type:C}=t;if(C==="mention"&&!r)return null;const I=(r==null?void 0:r.reblog)||r,T=I==null?void 0:I.id,_=wt(),x=_===(c==null?void 0:c.id),$=(F=r==null?void 0:r.poll)==null?void 0:F.voted,N=!!(r!=null&&r.inReplyToAccountId)&&(r==null?void 0:r.inReplyToAccountId)!==_&&((U=r==null?void 0:r.account)==null?void 0:U.id)===_;let D=0,V=0;if(C==="favourite+reblog"){if(d)for(const H of d)(K=H._types)!=null&&K.includes("favourite")&&D++,(de=H._types)!=null&&de.includes("reblog")&&V++;!V&&D&&(C="favourite"),!D&&V&&(C="reblog")}let G;C==="poll"?G=Un[x?"poll-self":$?"poll-voted":"poll"]:Un[C]?G=Un[C]:G=g._({id:"ODqZt1",values:{type:C}});const X=({clickable:H,...ce})=>H?e("b",{tabIndex:"0",onClick:q,...ce}):e("b",{...ce});if(typeof G=="function"){const H=(d==null?void 0:d.length)||(y==null?void 0:y.length)||(c?1:0),ce=(v==null?void 0:v.length)||(r?1:0);if(C==="admin.report"){const Se=l==null?void 0:l.targetAccount;Se&&(G=G({account:e(mt,{account:c,showAvatar:!0}),targetAccount:e(mt,{account:Se,showAvatar:!0})}))}else if(C==="severed_relationships"){const Se=p==null?void 0:p.targetName;Se&&(G=G({name:Se}))}else if((C==="emoji_reaction"||C==="pleroma:emoji_reaction")&&t.emoji){const Se=t.emoji_url||((fe=(te=r==null?void 0:r.emojis)==null?void 0:te.find)==null?void 0:fe.call(te,Ee=>(Ee==null?void 0:Ee.shortcode)===t.emoji.replace(/^:/,"").replace(/:$/,"")));G=G({account:e(mt,{account:c,showAvatar:!0}),emoji:t.emoji,emojiURL:Se})}else G=G({account:c?e(mt,{account:c,showAvatar:!0}):(y==null?void 0:y[0])&&e(mt,{account:y[0],showAvatar:!0}),count:H,postsCount:ce,postType:N?"reply":"post",components:{Subject:X}})}const j=t.createdAt&&new Date(t.createdAt).toLocaleString(),B={"favourite+reblog":g._({id:"+XOeb+"}),favourite:g._({id:"LQFF6J"}),reblog:g._({id:"phQpSa"}),follow:g._({id:"Ih01jh"})}[C]||g._({id:"bPwFdf"}),q=()=>{A.showGenericAccounts={heading:B,accounts:d,showReactions:C==="favourite+reblog",excludeRelationshipAttrs:C==="follow"?["followedBy"]:[],postID:it(T,n)}},M=w>0&&w>(y==null?void 0:y.length)?"remote":"local";if(r!=null&&r.filtered){const H=((ve=r==null?void 0:r.account)==null?void 0:ve.id)===_,ce=Ht(r.filtered,"notifications");if(!x&&!H&&(ce==null?void 0:ce.action)==="hide")return null}return e("div",{class:`notification notification-${C}`,"data-notification-id":m||h,"data-group-key":(b==null?void 0:b.join(" "))||k,tabIndex:"0",children:[e("div",{class:`notification-type notification-${C}`,title:j,children:C==="favourite+reblog"?e(z,{children:[e(S,{icon:"rocket",size:"xl",alt:C,class:"reblog-icon"}),e(S,{icon:"heart",size:"xl",alt:C,class:"favourite-icon"})]}):e(S,{icon:Ui[C]||"notification",size:"xl",alt:C})}),e("div",{class:"notification-content",children:[C!=="mention"&&e(z,{children:[e("p",{children:G}),C==="follow_request"&&e(Zn,{accountID:c.id}),C==="severed_relationships"&&e("div",{children:[Ea[p.type]({from:n,...p}),e("br",{}),e("a",{href:`https://${n}/severed_relationships`,target:"_blank",rel:"noopener noreferrer",children:e(u,{id:"YL6Y8P",components:{0:e(S,{icon:"external",size:"s"})}})}),"."]}),C==="moderation_warning"&&!!f&&e("div",{children:[o(Ra[f.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${f.id}`,target:"_blank",rel:"noopener noreferrer",children:e(u,{id:"YL6Y8P",components:{0:e(S,{icon:"external",size:"s"})}})})]})]}),(d==null?void 0:d.length)>1&&e("p",{class:"avatars-stack",children:[d.slice(0,Fn).map(H=>e(z,{children:[e("a",{href:H.url,rel:"noopener noreferrer",class:"account-avatar-stack",onClick:ce=>{ce.preventDefault(),A.showAccount=H},children:[e(dt,{url:H.avatarStatic,size:d.length<=10?"xxl":d.length<20?"xl":"l",alt:`${H.displayName} @${H.acct}`,squircle:H==null?void 0:H.bot},H.id),C==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:H._types.map(ce=>e(S,{icon:Ui[ce],size:"s",class:`${ce}-icon`}))})]},H.id)," "]},H.id)),C==="favourite+reblog"&&M==="remote"?e("button",{type:"button",class:"small plain","data-group-keys":b==null?void 0:b.join(" "),onClick:()=>{A.showGenericAccounts={heading:B,fetchAccounts:async()=>{const H=await Promise.allSettled(b.map(async Se=>{const Ee=a.v2.notifications.$select(Se).accounts.list();return[Se,(await Ee.next()).value]})),ce=[];for(const Se of H){const[Ee,Re]=Se.value,Le=/^favourite/.test(Ee)?"favourite":/^reblog/.test(Ee)?"reblog":null;if(Le)for(const Ne of Re){const ye=ce.find(ee=>ee.id===Ne.id);ye?ye._types.push(Le):(Ne._types=[Le],ce.push(Ne))}}return{done:!0,value:ce}},showReactions:!0,postID:it(T,n)}},children:e(S,{icon:"chevron-down"})}):e("button",{type:"button",class:"small plain",onClick:q,children:[d.length>Fn&&`+${d.length-Fn}`,e(S,{icon:"chevron-down"})]})]}),!(d!=null&&d.length)&&(y==null?void 0:y.length)>1&&e("p",{class:"avatars-stack",children:[y.map(H=>e(z,{children:[e("a",{href:H.url,rel:"noopener noreferrer",class:"account-avatar-stack",onClick:ce=>{ce.preventDefault(),A.showAccount=H},children:e(dt,{url:H.avatarStatic,size:"xxl",alt:`${H.displayName} @${H.acct}`,squircle:H==null?void 0:H.bot},H.id)},H.id)," "]},H.id)),w>y.length&&e(he,{to:n?`/${n}/s/${r.id}`:`/s/${r.id}`,class:"button small plain centered",children:["+",w-y.length,e(S,{icon:"chevron-right"})]})]}),(v==null?void 0:v.length)>1&&e("ul",{class:"notification-group-statuses",children:v.map(H=>e("li",{children:e(Hi,{class:`status-link status-type-${C}`,to:n?`/${n}/s/${H.id}`:`/s/${H.id}`,children:e(Ye,{status:H,size:"s",previewMode:!0,allowContextMenu:!0})})},H.id))}),r&&(!(v!=null&&v.length)||(v==null?void 0:v.length)<=1)&&e(Hi,{class:`status-link status-type-${C}`,to:n?`/${n}/s/${T}`:`/s/${T}`,onContextMenu:s?void 0:H=>{const ce=H.target.querySelector(".status");if(ce){if(H.metaKey)return;H.preventDefault(),ce.dispatchEvent(new MouseEvent("contextmenu",{clientX:H.clientX,clientY:H.clientY}))}},children:i?e(Ye,{status:I,size:"s",readOnly:!0,allowContextMenu:!0}):e(Ye,{statusID:T,size:"s",readOnly:!0,allowContextMenu:!0})})]})]})}function Hi(t){const n=Do();return e(he,{...t,"data-read-more":g._({id:"8fZueG"}),ref:n})}const Rn=st(La,(t,n)=>{var i,s;return((i=t.notification)==null?void 0:i.id)===((s=n.notification)==null?void 0:s.id)});"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",t=>{const{type:n,id:i,accessToken:s}=(t==null?void 0:t.data)||{};n==="notification"&&(A.routeNotification={id:i,accessToken:s})});const Ma=st(function(){if(!("serviceWorker"in navigator))return null;const n=qe(A),{routeNotification:i}=n,{id:s,accessToken:o}=i||{},[a,h]=L(!1);gt(()=>{if(!s||!o)return;const{instance:c}=ae(),{masto:l,instance:p}=ae({accessToken:o}),f=c===p,m=o?po(o):ei();(async()=>{const d=await l.v1.notifications.$select(s).fetch();if(d&&m){const v=m.instanceURL,{type:b,status:y,account:w}=d,k=!!document.querySelector("#modal-container > *"),C=b==="follow"&&!!(w!=null&&w.id),I=!!(w!=null&&w.id),T=!!(y!=null&&y.id);C&&f?A.showAccount={account:w,instance:v}:k||!f||I&&T?h({id:s,account:m,notification:d,sameInstance:f}):T?location.hash=`/${c}/s/${y.id}`:C?location.hash=`/${c}/a/${w.id}`:location.hash="/notifications"}})()},[s,o]),gt(()=>{navigator!=null&&navigator.clearAppBadge&&navigator.clearAppBadge()},[]),qt(c=>{c&&(navigator!=null&&navigator.clearAppBadge)&&navigator.clearAppBadge()});const r=()=>{h(!1),A.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(a){const{id:c,account:l,notification:p,sameInstance:f}=a;return e(Fe,{onClick:m=>{m.target===m.currentTarget&&r()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:r,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"5+87Pq"})})}),e("main",{children:[!f&&e("p",{children:e(u,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:m=>{const{target:d}=m;(m.target.tagName==="BUTTON"||m.target.tagName==="A")&&r()},children:e(Rn,{instance:l.instanceURL,notification:p,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(he,{to:"/notifications",class:"button light",onClick:r,children:[e("span",{children:e(u,{id:"/WA/tl"})})," ",e(S,{icon:"arrow-right"})]})})]})]})})}return null}),Os=go((t,n)=>{const{instance:i}=ae(),[s,o]=ft(),[a,h]=L(!1),[r,c]=L(s.get("q")||""),l=s.get("type"),p=Y(null),f=Y(null);return mo(n,()=>({setValue:m=>{c(m)},focus:()=>{f.current.focus()},select:()=>{f.current.select()},blur:()=>{f.current.blur()}})),e("form",{ref:p,class:"search-popover-container",onSubmit:m=>{var v;if(m.preventDefault(),/\/search/.test(location.hash))if(r){const b={q:r};l&&(b.type=l),o(b)}else o({});else r?location.hash=`/search?q=${encodeURIComponent(r)}${l?`&type=${l}`:""}`:location.hash="/search";(v=t==null?void 0:t.onSubmit)==null||v.call(t,m)},children:[e("input",{ref:f,value:r,name:"q",type:"search",placeholder:g._({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",onSearch:m=>{m.target.value||o({})},onInput:m=>{c(m.target.value),h(!0)},onFocus:()=>{var m,d;h(!0),(d=(m=p.current)==null?void 0:m.querySelector(".search-popover-item"))==null||d.classList.add("focus")},onBlur:()=>{var m,d;setTimeout(()=>{h(!1)},100),(d=(m=p.current)==null?void 0:m.querySelector(".search-popover-item.focus"))==null||d.classList.remove("focus")},onKeyDown:m=>{var v;const{key:d}=m;switch(d){case"Escape":h(!1);break;case"Down":case"ArrowDown":if(m.preventDefault(),a){const b=p.current.querySelector(".search-popover-item.focus");if(b){let y=b.nextElementSibling;for(;y&&y.hidden;)y=y.nextElementSibling;y&&(y.classList.add("focus"),Array.from(y.parentElement.children).filter(k=>k!==y).forEach(k=>{k.classList.remove("focus")}))}else{const y=p.current.querySelector(".search-popover-item");y&&y.classList.add("focus")}}break;case"Up":case"ArrowUp":if(m.preventDefault(),a){const b=document.querySelector(".search-popover-item.focus");if(b){let y=b.previousElementSibling;for(;y&&y.hidden;)y=y.previousElementSibling;y&&(y.classList.add("focus"),Array.from(y.parentElement.children).filter(k=>k!==y).forEach(k=>{k.classList.remove("focus")}))}else{const y=document.querySelector(".search-popover-item:last-child");y&&y.classList.add("focus")}}break;case"Enter":if(a){const b=document.querySelector(".search-popover-item.focus");b&&(m.preventDefault(),b.click()),h(!1),(v=t==null?void 0:t.onSubmit)==null||v.call(t,m)}break}}}),e("div",{class:"search-popover",hidden:!a||!r,children:!!r&&[{label:e(u,{id:"48oDit",values:{query:r},components:{0:e("small",{class:"insignificant"})}}),to:`/search?q=${encodeURIComponent(r)}`,top:!l&&!/\s/.test(r),hidden:!!l},{label:e(u,{id:"o1mMWT",values:{query:r},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(r)}&type=statuses`,hidden:/^https?:/.test(r),top:/\s/.test(r),icon:"document",queryType:"statuses"},{label:e(u,{id:"YAZw8D",values:{0:r.replace(/^#/,"")},components:{0:e("mark",{})}}),to:`/${i}/t/${r.replace(/^#/,"")}`,hidden:/^@/.test(r)||/^https?:/.test(r)||/\s/.test(r),top:/^#/.test(r),type:"link",icon:"hashtag",queryType:"hashtags"},{label:e(u,{id:"gEoOUj",values:{query:r},components:{0:e("mark",{})}}),to:`/${r}`,hidden:!/^https?:/.test(r),top:/^https?:/.test(r),type:"link"},{label:e(u,{id:"cDoNQr",values:{query:r},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(r)}&type=accounts`,icon:"group",queryType:"accounts"}].sort((m,d)=>{if(l){if(m.queryType===l)return-1;if(d.queryType===l)return 1}return m.top&&!d.top?-1:!m.top&&d.top?1:0}).filter(({hidden:m})=>!m).map(({label:m,to:d,icon:v,type:b},y)=>e(he,{to:d,class:`search-popover-item ${y===0?"focus":""}`,onClick:w=>{var k;(k=t==null?void 0:t.onSubmit)==null||k.call(t,w)},children:[e(S,{icon:v||(b==="link"?"arrow-right":"search"),class:"more-insignificant"}),e("span",{children:m})," "]}))})]})}),$a=st(function({onClose:n=()=>{}}){const[i,s]=L(!1),o=Y(null);Be(["Slash","/"],h=>{s(!0),setTimeout(()=>{var r,c,l,p;(c=(r=o.current)==null?void 0:r.focus)==null||c.call(r),(p=(l=o.current)==null?void 0:l.select)==null||p.call(l)},0)},{preventDefault:!0,ignoreEventWhen:h=>{const r=/\/search/.test(location.hash),c=!!document.querySelector("#modal-container > *");return r||c}});const a=()=>{s(!1),n()};return Be("esc",h=>{var r,c;(c=(r=o.current)==null?void 0:r.blur)==null||c.call(r),a()},{enabled:i,enableOnFormTags:!0,preventDefault:!0}),e("div",{id:"search-command-container",hidden:!i,onClick:h=>{h.target===h.currentTarget&&a()},children:e(Os,{ref:o,onSubmit:()=>{a()}})})});function Da(){const{_:t}=Qe(),{instance:n}=ae(),i=qe(A),{shortcuts:s,settings:o}=i;if(!s.length)return null;const a=o.shortcutsViewMode==="multi-column"||!o.shortcutsViewMode&&o.shortcutsColumnsMode;if(a)return null;const h=Y(),r=Y(!1),c=s.map((m,d)=>{const{type:v,...b}=m;if(!Cn[v])return null;let{id:y,path:w,title:k,subtitle:C,icon:I}=Cn[v];return typeof y=="function"&&(y=y(b,d)),typeof w=="function"&&(w=w({...b,instance:b.instance||n},d)),typeof k=="function"?k=k(b,d):k=t(k),typeof C=="function"?C=C(b,d):C=t(C),typeof I=="function"&&(I=I(b,d)),y==="lists"&&(r.current=!0),{id:y,path:w,title:k,subtitle:C,icon:I}}).filter(Boolean),l=rs();Be(["1","2","3","4","5","6","7","8","9"],(m,d)=>{var b,y;const v=parseInt(d.keys[0],10)-1;if(v<c.length){const{path:w}=c[v];w&&(l(w),(y=(b=h.current)==null?void 0:b.closeMenu)==null||y.call(b))}},{enabled:!a});const[p,f]=L([]);return e("div",{id:"shortcuts",children:i.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{class:"tab-bar",onContextMenu:m=>{m.preventDefault(),A.showShortcutsSettings=!0},children:e("ul",{children:c.map(({id:m,path:d,title:v,subtitle:b,icon:y},w)=>e("li",{children:e(he,{class:b?"has-subtitle":"",to:d,onClick:k=>{if(k.target.classList.contains("is-active")){k.preventDefault();const C=document.getElementById(`${m}-page`);if(C){C.scrollTop=0;const I=C.querySelector(".updates-button");I&&I.click()}}},children:[e(S,{icon:y,size:"xl",alt:v}),e("span",{children:[e(fn,{children:v}),b&&e(z,{children:[e("br",{}),e("small",{children:b})]})]})]})},`${w}-${m}-${v}-${b}-${d}`))})}):e(at,{instanceRef:h,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:m=>{m.open&&r.current&&on().then(f)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:m=>{m.preventDefault(),A.showShortcutsSettings=!0},onTransitionStart:m=>{var d,v;try{const{target:b}=m;getComputedStyle(b).pointerEvents==="none"&&((v=(d=h.current)==null?void 0:d.closeMenu)==null||v.call(d))}catch{}},children:e(S,{icon:"shortcut",size:"xl",alt:g._({id:"CTqTgr"})})}),children:c.map(({id:m,path:d,title:v,subtitle:b,icon:y},w)=>m==="lists"?e(Tn,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(z,{children:[e(S,{icon:y,size:"l"}),e("span",{class:"menu-grow",children:e(fn,{children:v})}),e(S,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),e(Ge,{}),p==null?void 0:p.map(k=>e(Ue,{to:`/l/${k.id}`,children:e("span",{children:k.title})},k.id))]}):e(Ue,{to:d,class:"glass-menu-item",children:[e(S,{icon:y,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(fn,{children:v})}),b&&e(z,{children:[" ",e("small",{class:"more-insignificant",children:b})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:w+1})]},`${w}-${m}-${v}-${b}-${d}`))})})}const Na=st(Da);function Pa(t){var o;let n=[],i=[],s=0;for(let a=0;a<t.length;a++){const h=t[a];h.reblog&&!((o=h.account)!=null&&o.group)?(i.push(h),s++):(n.push(h),s<3&&(s=0))}if(t.length>10&&(i.length>t.length/4||s>=3)){const a=i.map(h=>h.id);if(i.length>t.length*3/4)n=[...n,{id:a,items:i,type:"boosts"}];else{const h=Math.floor(n.length/2);n=[...n.slice(0,h),{id:a,items:i,type:"boosts"},...n.slice(h)]}return n}else return t}function qi(t,n){const i=be.account.get("boostedStatusIDs")||{},s=t.filter(a=>{if(!a.reblog)return!0;const h=`${n}-${a.reblog.id}`,r=i[h];return r&&r!==a.id?!1:(i[h]=a.id,!0)}),o=Object.keys(i);return o.length>50&&o.slice(0,o.length-50).forEach(a=>{delete i[a]}),be.account.set("boostedStatusIDs",i),s}function Oa(t,n){const i=[];let s=0;t.forEach(r=>{for(let l=0;l<i.length;l++){if(i[l].find(p=>p.id===r.id))return;if(i[l].find(p=>p.id===r.inReplyToId)||i[l].find(p=>p.inReplyToId===r.id)){i[l].push(r);return}}const c=t.find(l=>l.id===r.inReplyToId);c&&(i[s++]=[r,c])});for(let r=0;r<i.length;r++)for(let c=r+1;c<i.length;c++)i[r].find(p=>i[c].includes(p))&&(i[r]=[...i[r],...i[c]],i[r]=i[r].filter((p,f,m)=>m.findIndex(d=>d.id===p.id)===f),i.splice(c,1),c--);i.forEach(r=>{r.sort((c,l)=>!c.inReplyToId&&!l.inReplyToId?new Date(c.createdAt)-new Date(l.createdAt):c.inReplyToId===l.id?1:l.inReplyToId===c.id||!c.inReplyToId?-1:l.inReplyToId?new Date(c.createdAt)-new Date(l.createdAt):1)}),i.forEach(r=>{const c=r[0].account.id;r.forEach(l=>{l.account.id!==c&&(l._differentAuthor=!0)})}),i.length;const o=[],a=[],h=[];return t.forEach(r=>{if(r.reblog){o.push(r);return}for(let c=0;c<i.length;c++)if(i[c].find(l=>l.id===r.id)){if(a.includes(c))return;const l=i[c];l.sort((f,m)=>{const d=new Date(f.createdAt),v=new Date(m.createdAt);return d-v});const p=l[0].account.id;o.push({id:l.map(f=>f.id),items:l,type:l.every(f=>f.account.id===p)?"thread":"conversation"}),a.push(c);return}if(r.inReplyToId&&r.inReplyToAccountId!==r.account.id){const c=it(r.id,n);A.statusReply[c]||h.push({sKey:c,inReplyToId:r.inReplyToId})}o.push(r)}),h!=null&&h.length&&queueMicrotask(()=>{const{masto:r}=ae({instance:n});async function c(){for(let l=0;l<h.length;l++){const{sKey:p,inReplyToId:f}=h[l];try{const m=await za(f,r);We(m,n,{skipThreading:!0}),A.statusReply[p]={id:m.id,instance:n},await new Promise(d=>setTimeout(d,1e3))}catch{}}}if(Ze("@mastodon/fetch-multiple-statuses")){const l=h.map(({inReplyToId:p})=>p);(async()=>{var p;try{const f=await r.v1.statuses.list({id:l});if(f!=null&&f.length)for(const m of f){We(m,n,{skipThreading:!0});const d=(p=h.find(({inReplyToId:v})=>v===m.id))==null?void 0:p.sKey;d&&(A.statusReply[d]={id:m.id,instance:n})}else c()}catch{c()}})()}else c()}),o}const za=_t((t,n)=>n.v1.statuses.$select(t).fetch());async function zs(t,n){const i=await ka();if(!i.length)return;const{statusFollowedTags:s}=A,o=[];if(t.forEach(a=>{var m;if(a.reblog)return;const{id:h,content:r,tags:c=[]}=a,l=it(h,n);if((m=s[l])!=null&&m.length)return;const p=_a(r);if(!p.length&&!c.length)return;const f=i.reduce((d,v)=>((p.some(b=>b.toLowerCase()===v.name.toLowerCase())||c.some(b=>b.name.toLowerCase()===v.name.toLowerCase()))&&d.push(v.name),d),[]);f.length&&o.push({item:a,sKey:l,followedTags:f})}),o.length){const a=o.map(r=>r.item.account),h=await si(a);if(!h)return;o.forEach(r=>{const{item:c,sKey:l,followedTags:p}=r,f=h[c.account.id];f&&!f.following&&(s[l]=p)})}}function Ba(){A.statusFollowedTags={}}function Ua({scrollableRef:t,distanceFromStart:n=1,distanceFromEnd:i=1,scrollThresholdStart:s=10,scrollThresholdEnd:o=10,direction:a="vertical",distanceFromStartPx:h,distanceFromEndPx:r}={}){const[c,l]=L(null),[p,f]=L(!1),[m,d]=L(!1),[v,b]=L(!1),[y,w]=L(!1),k=a==="vertical";return gt(()=>{const C=t.current;if(!C)return{};let I=k?C.scrollTop:C.scrollLeft;function T(){const{scrollTop:_,scrollLeft:x,scrollHeight:$,scrollWidth:N,clientHeight:D,clientWidth:V}=C,G=k?_:x,X=k?$:N,j=k?D:V,B=Math.abs(G-I),q=h||Math.min(j*n,X,G),ie=r||Math.min(j*i,X,X-G-j);B>=(I<G?o:s)&&(l(I<G?"end":"start"),I=G),f(G<=0),d(G+j>=X),b(G<=q),w(G+j>=X-ie)}return C.addEventListener("scroll",T,{passive:!0}),()=>C.removeEventListener("scroll",T)},[n,i,s,o]),{scrollDirection:c,reachStart:p,reachEnd:m,nearReachStart:v,nearReachEnd:y,init:()=>{t.current&&t.current.dispatchEvent(new Event("scroll"))}}}function Fa({scrollableRef:t,distanceFromStart:n=1,distanceFromEnd:i=1,scrollThresholdStart:s=10,scrollThresholdEnd:o=10,direction:a="vertical",distanceFromStartPx:h,distanceFromEndPx:r,init:c}={},l,p){if(!l)return;const f=a==="vertical",m=Y(null),d=Y(null),v=No(()=>{let b=!1,y=!1,w=!1,k=!1;const C=t.current,{scrollTop:I,scrollLeft:T,scrollHeight:_,scrollWidth:x,clientHeight:$,clientWidth:N}=C,D=f?I:T,V=f?_:x,G=f?$:N,X=Math.abs(D-m.current),j=h||Math.min(G*n,V,D),B=r||Math.min(G*i,V,V-D-G);X>=(m.current<D?o:s)&&(d.current=m.current<D?"end":"start",m.current=D),b=D<=0,y=D+G>=V,w=D<=j,k=D+G>=V-B,l({scrollDirection:d.current,reachStart:b,reachEnd:y,nearReachStart:w,nearReachEnd:k})},500);gt(()=>{const b=t.current;return b?(m.current=b[f?"scrollTop":"scrollLeft"],b.addEventListener("scroll",v,{passive:!0}),()=>b.removeEventListener("scroll",v)):{}},[n,i,s,o,...p]),se(()=>{c&&t.current&&queueMicrotask(()=>{t.current.dispatchEvent(new Event("scroll"))})},[c])}function Ha({class:t,statusID:n,status:i,instance:s,parent:o,onMediaClick:a}){let h=it(n,s);const r=qe(A);if(i||(i=r.statuses[h]||r.statuses[n],h=it(i==null?void 0:i.id,s)),!i)return null;const{account:{acct:c,avatar:l,avatarStatic:p,id:f,url:m,displayName:d,username:v,emojis:b,bot:y,group:w},id:k,repliesCount:C,reblogged:I,reblogsCount:T,favourited:_,favouritesCount:x,bookmarked:$,poll:N,muted:D,sensitive:V,spoilerText:G,visibility:X,language:j,editedAt:B,filtered:q,card:ie,createdAt:M,inReplyToId:F,inReplyToAccountId:U,content:K,mentions:de,mediaAttachments:te,reblog:fe,uri:ve,url:H,emojis:ce,_deleted:Se,_pinned:Ee}=i;if(!(te!=null&&te.length))return null;const Re=me=>{me.shiftKey},Le=_e(()=>wt(),[]),Ne=_e(()=>Le&&Le===f,[f,Le]),ye=bo(gs),ee=!Ne&&Ht(q,ye);if((ee==null?void 0:ee.action)==="hide")return null;const ge=V,le=_e(()=>{var P;return((P=(be.account.get("preferences")||{})["reading:expand:media"])==null?void 0:P.toLowerCase())||"default"},[])==="show_all",Z=o||"div";return te.map((me,P)=>{const E=`${h}-${me.id}`,O=ee==null?void 0:ee.titlesStr;return e(Z,{"data-state-post-id":h,onMouseEnter:Re,"data-spoiler-text":G||(V?g._({id:"FKojeB"}):void 0),"data-filtered-text":ee?O?g._({id:"7FGvtQ",values:{filterTitleStr:O}}):g._({id:"03Qqf9"}):void 0,class:`
media-post
${ee?"filtered":""}
${ge?"has-spoiler":""}
${le?"show-media":""}
`,children:e(ms,{class:t,media:me,lang:j,to:`/${s}/s/${k}?media-only=${P+1}`,onClick:a?re=>a(re,P,me,i):void 0})},E)})}const Yi=st(Ha);function qa(t){var k,C,I,T,_;const n=qe(A),{masto:i,instance:s,authenticated:o}=ae(),[a,h]=_e(()=>{const x=be.local.getJSON("accounts")||[];return[x.find(N=>N.info.id===wt())||x[0],x.length>1]},[]),r=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(x=>x.type==="following"),c=Po(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),l=Y(),[p,f]=L(void 0),m=Oo([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),d=Y();async function v(x){return(x||!d.current)&&(d.current=i.v1.mutes.list({limit:80})),await d.current.next()}const b=Y();async function y(x){return(x||!b.current)&&(b.current=i.v1.blocks.list({limit:80})),await b.current.next()}const w=Y();return e(z,{children:[e("button",{ref:l,type:"button",class:`button plain nav-menu-button ${h?"with-avatar":""} ${p==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{w.current=Date.now(),f(x=>x?void 0:"open")},onContextMenu:x=>{x.preventDefault(),A.showAccounts=!0},...c(),children:[h&&e(dt,{url:((k=a==null?void 0:a.info)==null?void 0:k.avatar)||((C=a==null?void 0:a.info)==null?void 0:C.avatarStatic),size:"l",squircle:(I=a==null?void 0:a.info)==null?void 0:I.bot}),e(S,{icon:"menu",size:h?"s":"l",alt:g._({id:"zucql+"})})]}),e(bs,{menuClassName:"nav-menu",state:p,anchorRef:l,onClose:()=>{f(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-w.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:m,unmountOnClose:!0,children:[!!((T=n.appVersion)!=null&&T.commitHash)&&n.appVersion.commitHash!=="8f048af"&&e("div",{class:"top-menu",children:[e(ke,{onClick:()=>{confirm(g._({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(S,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(u,{id:"95IFnD"})})]}),e(Ge,{})]}),e("section",{children:[e(Ue,{to:"/",children:[e(S,{icon:"home",size:"l"})," ",e("span",{children:e(u,{id:"i0qMbr"})})]}),o?e(z,{children:[r&&e(Ue,{to:"/following",children:[e(S,{icon:"following",size:"l"})," ",e("span",{children:e(u,{id:"following.title"})})]}),e(Ue,{to:"/catchup",children:[e(S,{icon:"history2",size:"l"}),e("span",{children:e(u,{id:"xrl8fj"})})]}),Ze("@mastodon/mentions")&&e(Ue,{to:"/mentions",children:[e(S,{icon:"at",size:"l"})," ",e("span",{children:e(u,{id:"/bZzdR"})})]}),e(Ue,{to:"/notifications",children:[e(S,{icon:"notification",size:"l"})," ",e("span",{children:e(u,{id:"iDNBZe"})}),n.notificationsShowNew&&e("sup",{title:g._({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ge,{}),((_=a==null?void 0:a.info)==null?void 0:_.id)&&e(Ue,{to:`/${s}/a/${a.info.id}`,children:[e(S,{icon:"user",size:"l"})," ",e("span",{children:e(u,{id:"vERlcd"})})]}),e(Ya,{menuState:p}),e(Ue,{to:"/b",children:[e(S,{icon:"bookmark",size:"l"})," ",e("span",{children:e(u,{id:"7Ff7ia"})})]}),e(Tn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(z,{children:[e(S,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"24misb"})}),e(S,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/f",children:[e(S,{icon:"heart",size:"l"})," ",e("span",{children:e(u,{id:"zZOZj7"})})]}),e(Ue,{to:"/fh",children:[e(S,{icon:"hashtag",size:"l"})," ",e("span",{children:e(u,{id:"Xi1/bw"})})]}),e(Ge,{}),Ze("@mastodon/filters")&&e(Ue,{to:"/ft",children:[e(S,{icon:"filters",size:"l"})," ",e("span",{children:e(u,{id:"cSev+j"})})]}),e(ke,{onClick:()=>{A.showGenericAccounts={id:"mute",heading:g._({id:"sOKhEA"}),fetchAccounts:v,excludeRelationshipAttrs:["muting"]}},children:[e(S,{icon:"mute",size:"l"})," ",e("span",{children:e(u,{id:"n1sANU"})})]}),e(ke,{onClick:()=>{A.showGenericAccounts={id:"block",heading:g._({id:"nL8nlr"}),fetchAccounts:y,excludeRelationshipAttrs:["blocking"]}},children:[e(S,{icon:"block",size:"l"})," ",e("span",{children:e(u,{id:"r3RRWo"})})]})," "]}),e(Ge,{}),e(ke,{onClick:()=>{A.showAccounts=!0},children:[e(S,{icon:"group",size:"l"})," ",e("span",{children:e(u,{id:"7e0O8Z"})})]})]}):e(z,{children:[e(Ge,{}),e(Ue,{to:"/login",children:[e(S,{icon:"user",size:"l"})," ",e("span",{children:e(u,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(Ge,{}),e(Ue,{to:"/search",children:[e(S,{icon:"search",size:"l"})," ",e("span",{children:e(u,{id:"A1taO8"})})]}),e(Ue,{to:`/${s}/trending`,children:[e(S,{icon:"chart",size:"l"})," ",e("span",{children:e(u,{id:"4/iCqx"})})]}),e(Ue,{to:`/${s}/p/l`,children:[e(S,{icon:"building",size:"l"})," ",e("span",{children:e(u,{id:"d5zxa4"})})]}),e(Ue,{to:`/${s}/p`,children:[e(S,{icon:"earth",size:"l"})," ",e("span",{children:e(u,{id:"4ERYY7"})})]}),o?e(z,{children:[e(Ge,{className:"divider-grow"}),e(ke,{onClick:()=>{A.showKeyboardShortcutsHelp=!0},children:[e(S,{icon:"keyboard",size:"l"})," ",e("span",{children:e(u,{id:"77Emn0"})})]}),e(ke,{onClick:()=>{A.showShortcutsSettings=!0},children:[e(S,{icon:"shortcut",size:"l"})," ",e("span",{children:e(u,{id:"8Kudkr"})})]}),e(ke,{onClick:()=>{A.showSettings=!0},children:[e(S,{icon:"gear",size:"l"})," ",e("span",{children:e(u,{id:"uVbUP8"})})]})]}):e(z,{children:[e(Ge,{}),e(ke,{onClick:()=>{A.showSettings=!0},children:[e(S,{icon:"gear",size:"l"})," ",e("span",{children:e(u,{id:"uVbUP8"})})]})]})]})]})]})}function Ya({menuState:t}){const n=Ze("@mastodon/lists"),[i,s]=L([]);return se(()=>{n&&t==="open"&&on().then(s)},[t,n]),i.length>0?e(Tn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(z,{children:[e(S,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"h16FyT"})}),e(S,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),(i==null?void 0:i.length)>0&&e(z,{children:[e(Ge,{}),i.map(o=>e(Ue,{to:`/l/${o.id}`,children:e("span",{children:o.title})},o.id))]})]}):n&&e(Ue,{to:"/l",children:[e(S,{icon:"list",size:"l"}),e("span",{children:e(u,{id:"h16FyT"})})]})}const Pt=st(qa),an={block:"nearest",inline:"center",behavior:"smooth"};function St({title:t,titleComponent:n,id:i,instance:s,emptyText:o,errorText:a,useItemID:h,boostsCarousel:r,fetchItems:c=()=>{},checkForUpdates:l=()=>{},checkForUpdatesInterval:p=15e3,headerStart:f,headerEnd:m,timelineStart:d,refresh:v,view:b,filterContext:y,showFollowedTags:w,showReplyParent:k,clearWhenRefresh:C}){const I=qe(A),[T,_]=L([]),[x,$]=L("start"),[N,D]=L(!1),[V,G]=L(!1),[X,j]=L(!0),B=Y();__BENCHMARK.start(`timeline-${i}-load`);const q=_e(()=>ti(),[]),ie=b!=="media",M=Y(0),F=zo(ee=>{G(!1),$("loading"),(async()=>{try{const ge=M.current=Date.now();let{done:xe,value:le}=await c(ee);if(ge!==M.current)return;if(Array.isArray(le)){const[Z,me]=le.reduce((P,E)=>(E._pinned?P[0].push(E):P[1].push(E),P),[[],[]]);le=me,ie&&(r&&(le=Pa(le)),le=Oa(le,s)),Z.length&&(le=Z.concat(le)),_(ee?le:P=>[...P,...le]),le.length||(xe=!0),D(!xe)}else D(!1);$("default"),__BENCHMARK.end(`timeline-${i}-load`)}catch{$("error"),ee&&!T.length&&a&&ue(a)}finally{F.cancel()}})()},1e3,{leading:!0}),U=".timeline-item, .timeline-item-alt",K=Be("j, shift+j",(ee,ge)=>{const xe=document.activeElement.closest(U),le=xe==null?void 0:xe.getBoundingClientRect(),Z=Array.from(B.current.querySelectorAll(U));if(xe&&le.top<B.current.clientHeight&&le.bottom>0){const me=Z.indexOf(xe);let P=Z[me+1];ge.shift&&(P=Z.find((E,O)=>O>me&&!E.classList.contains("timeline-item-alt"))),P&&(P.focus(),P.scrollIntoView(an))}else{const me=Z.find(P=>{const E=P.getBoundingClientRect();return E.top>=44&&E.left>=0});me&&(me.focus(),me.scrollIntoView(an))}}),de=Be("k, shift+k",(ee,ge)=>{const xe=document.activeElement.closest(U),le=xe==null?void 0:xe.getBoundingClientRect(),Z=Array.from(B.current.querySelectorAll(U));if(xe&&le.top<B.current.clientHeight&&le.bottom>0){const me=Z.indexOf(xe);let P=Z[me-1];ge.shift&&(P=Z.findLast((E,O)=>O<me&&!E.classList.contains("timeline-item-alt"))),P&&(P.focus(),P.scrollIntoView(an))}else{const me=Z.find(P=>{const E=P.getBoundingClientRect();return E.top>=44&&E.left>=0});me&&(me.focus(),me.scrollIntoView(an))}}),te=Be(["enter","o"],()=>{const ee=document.activeElement;ee!=null&&ee.matches(U)&&ee.click()}),fe=T.length>0&&x!=="loading"&&V,ve=ct(()=>{var ee;fe&&F(!0),(ee=B.current)==null||ee.scrollTo({top:0,behavior:"smooth"})},[F,fe]),H=Be(".",ve),ce=Y(),[Se,Ee]=L(!1);Fa({scrollableRef:B,distanceFromEnd:2,scrollThresholdStart:44},({scrollDirection:ee,nearReachStart:ge,reachStart:xe})=>{if(ce.current){const le=ee==="end"&&!ge;ce.current.hidden=le}Ee(ge),xe&&F(!0)},[]),se(()=>{var ee;(ee=B.current)==null||ee.scrollTo({top:0}),F(!0)},[]);const Re=Y(!0);se(()=>{var ee;if(Re.current){Re.current=!1;return}C&&(T!=null&&T.length)&&((ee=F.cancel)==null||ee.call(F),_([])),F(!0)},[C,v]);const Le=Y(b);se(()=>{Le.current!==b&&(Le.current=b,_([]))},[b]);const Ne=ct(async({disableIdleCheck:ee=!1}={})=>{const ge=B.current?getComputedStyle(B.current).pointerEvents==="none":!1;I.settings.autoRefresh&&B.current.scrollTop<16&&(ee||window.__IDLE__)&&!Ka()&&!ge?F(!0):await l()&&G(!0)},[i,F,l,I.settings.autoRefresh]),ye=Y();return qt(ee=>{if(ee){const ge=Date.now()-ye.current;(!ye.current||ge>1e3*3)&&Ne({disableIdleCheck:!0})}else ye.current=Date.now();j(ee)},[l,Ne,I.settings.autoRefresh]),ii(Ne,X&&!V?p*(Se?1:2):null),e(gs.Provider,{value:y,children:e("div",{id:`${i}-page`,class:`deck-container ${q?"deck-container-media-first":""}`,ref:ee=>{B.current=ee,K(ee),de(ee),te(ee),H(ee)},tabIndex:"-1",onClick:ee=>{ce.current&&ee.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{ce.current.hidden=!1},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:ce,onClick:ee=>{var ge;ee.target.closest("a, button")||(ge=B.current)==null||ge.scrollTo({top:0,behavior:"smooth"})},onDblClick:ee=>{ee.target.closest("a, button")||F(!0)},class:x==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Pt,{}),f??e(he,{to:"/",class:"button plain home-button",children:e(S,{icon:"home",size:"l",alt:g._({id:"i0qMbr"})})})]}),t&&(n||e("h1",{children:t})),e("div",{class:"header-side",children:!!m&&m})]}),fe&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:ve,children:[e(S,{icon:"arrow-up"})," ",e(u,{id:"2yr1/p"})]})]}),!!d&&e("div",{class:`timeline-start ${x==="loading"?"loading":""}`,children:d}),T.length?e(z,{children:[e("ul",{class:`timeline ${b?`timeline-${b}`:""}`,children:[T.map(ee=>e(ja,{status:ee,instance:s,useItemID:h,filterContext:y,view:b,showFollowedTags:w,showReplyParent:k,mediaFirst:q},ee.id+(ee==null?void 0:ee._pinned)+b)),N&&x==="loading"&&(b==="media"?null:e(z,{children:[e("li",{style:{height:"20vh"},children:e(Ye,{skeleton:!0,mediaFirst:q})}),e("li",{style:{height:"25vh"},children:e(Ye,{skeleton:!0,mediaFirst:q})})]}))]}),x==="default"&&(N?e(kt,{root:B.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:ee=>{ee&&F()},children:e("button",{type:"button",class:"plain block",onClick:()=>F(),style:{marginBlockEnd:"6em"},children:e(u,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(u,{id:"2EYeAZ"})}))]}):x==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((ee,ge)=>b==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(Ye,{skeleton:!0,mediaFirst:q})},ge))}):x!=="error"&&x!=="start"&&e("p",{class:"ui-state",children:o}),x==="error"&&e("p",{class:"ui-state",children:[a,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>F(!T.length),children:e(u,{id:"KDw4GX"})})]})]})})})}const ja=st(({status:t,instance:n,useItemID:i,filterContext:s,view:o,showFollowedTags:a,showReplyParent:h,mediaFirst:r})=>{const{id:c,reblog:l,items:p,type:f,_pinned:m}=t;m&&(i=!1);const d=(l==null?void 0:l.id)||c,v=n?`/${n}/s/${d}`:`/s/${d}`;if(p){let y=Rt(p,s),w="";if(f==="boosts"?w=g._({id:"NuqppG",values:{0:y.length}}):f==="pinned"&&(w=g._({id:"GlfmCu"})),f==="boosts"||f==="pinned"){const I=new Set;if(y.sort((T,_)=>{const x=Ht(T.filtered,s),$=Ht(_.filtered,s);return x&&I.add(T.id),$&&I.add(_.id),x&&!$?1:!x&&$?-1:0}),I.size>=2){const _=[],x=[];y.forEach(N=>{I.has(N.id)?x.push(N):_.push(N)});const $=[];for(let N=0;N<x.length;N+=5)$.push({_grouped:!0,posts:x.slice(N,N+5)});y=_.concat($)}return e("li",{class:"timeline-item-carousel",children:e(Va,{title:w,class:`${f}-carousel`,children:y.map(T=>{const{id:_,reblog:x,_pinned:$,_grouped:N}=T;if(N)return e("li",{class:"timeline-item-carousel-group",children:T.posts.map(G=>{const{id:X,reblog:j,_pinned:B}=G,q=(j==null?void 0:j.id)||X,ie=n?`/${n}/s/${q}`:`/s/${q}`;return B&&(i=!1),e(he,{class:"status-carousel-link timeline-item-alt",to:ie,children:i?e(Ye,{statusID:X,instance:n,size:"s"}):e(Ye,{status:G,instance:n,size:"s"})})})},_);const D=(x==null?void 0:x.id)||_,V=n?`/${n}/s/${D}`:`/s/${D}`;return $&&(i=!1),e("li",{children:e(he,{class:"status-carousel-link timeline-item-alt",to:V,children:i?e(Ye,{statusID:_,instance:n,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:r}):e(Ye,{status:T,instance:n,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:r})})},_)})})},`timeline-${c}`)}const C=y.length>3;return y.map((I,T)=>{const{id:_,_differentAuthor:x}=I,$=n?`/${n}/s/${_}`:`/s/${_}`,N=T>0&&T<y.length-1,D=I.sensitive&&!!I.spoilerText,V=!x&&D&&T>0||C&&N&&(f==="thread"||f==="conversation"&&!x&&!y[T-1]._differentAuthor&&!y[T+1]._differentAuthor),G=T===0,X=T===y.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${f} timeline-item-container-${G?"start":X?"end":"middle"} ${x?"timeline-item-diff-author":""}`,children:e(he,{class:"status-link timeline-item",to:$,children:V?e(Ga,{status:I,instance:n,filterContext:s}):i?e(Ye,{statusID:_,instance:n,enableCommentHint:X,showFollowedTags:a}):e(Ye,{status:I,instance:n,enableCommentHint:X,showFollowedTags:a})})},`timeline-${_}`)})}const b=`timeline-${c+m}`;return o==="media"?i?e(Yi,{class:"timeline-item",parent:"li",statusID:c,instance:n},b):e(Yi,{class:"timeline-item",parent:"li",status:t,instance:n},b):e("li",{children:e(he,{class:"status-link timeline-item",to:v,children:i?e(Ye,{statusID:c,instance:n,enableCommentHint:!0,showFollowedTags:a,showReplyParent:h,mediaFirst:r}):e(Ye,{status:t,instance:n,enableCommentHint:!0,showFollowedTags:a,showReplyParent:h,mediaFirst:r})})},b)},(t,n)=>{var o,a;const i=(((o=t.status)==null?void 0:o.id)||"").toString(),s=(((a=n.status)==null?void 0:a.id)||"").toString();return i===s&&t.instance===n.instance&&t.view===n.view});function Va({title:t,class:n,children:i}){const s=Y(),o=Y(),a=Y(),[h,r]=L(!1);return se(()=>{setTimeout(()=>{r(!0)},1)},[]),e("div",{class:`status-carousel ${n}`,children:[e("header",{children:[e("h3",{children:t}),e("span",{children:[e("button",{ref:o,type:"button",class:"small plain2",onClick:()=>{var l,p;const c=Math.min(320,(l=s.current)==null?void 0:l.offsetWidth)*(Et()?1:-1);(p=s.current)==null||p.scrollBy({left:c,behavior:"smooth"})},children:e(S,{icon:"chevron-left",alt:g._({id:"DHhJ7s"})})})," ",e("button",{ref:a,type:"button",class:"small plain2",onClick:()=>{var l,p;const c=Math.min(320,(l=s.current)==null?void 0:l.offsetWidth)*(Et()?-1:1);(p=s.current)==null||p.scrollBy({left:c,behavior:"smooth"})},children:e(S,{icon:"chevron-right",alt:g._({id:"hXzOVo"})})})]})]}),e("ul",{ref:s,children:[e(kt,{class:"status-carousel-beacon",onChange:c=>{o.current&&(o.current.disabled=c)}}),i[0],h&&i.slice(1),e(kt,{class:"status-carousel-beacon",onChange:c=>{a.current&&(a.current.disabled=c)}})]})]})}function Ga({status:t,instance:n,filterContext:i}){const s=qe(A),{id:o,visibility:a,language:h}=t,r=ci(t),c=it(o,n),l=Ht(t.filtered,i);return e("article",{class:`status compact-thread ${a==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[s.statusThreadNumber[c]?e("div",{class:"status-thread-badge",children:[e(S,{icon:"thread",size:"s",alt:g._({id:"e66y2Z"})}),s.statusThreadNumber[c]?` ${s.statusThreadNumber[c]}/X`:""]}):e("div",{class:"status-thread-badge",children:e(S,{icon:"thread",size:"s",alt:g._({id:"e66y2Z"})})}),e("div",{class:"content-compact",title:r,lang:h,dir:"auto",children:l?e("b",{class:"status-filtered-badge badge-meta horizontal",title:(l==null?void 0:l.titlesStr)||"",children:l!=null&&l.titlesStr?e(u,{id:"sr6maL",values:{0:l.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(u,{id:"03Qqf9"})})}):e(z,{children:[r,t.sensitive&&t.spoilerText&&e(z,{children:[" ",e("span",{class:"spoiler-badge",children:e(S,{icon:"eye-close",size:"s",alt:g._({id:"gnKo7f"})})})]})]})})]})}function Ka(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const Ut=20,yi=1983,ji=`${yi}-01`,Wa=(()=>{try{const t=document.createElement("input");return t.setAttribute("type","month"),t.type==="month"}catch{return!1}})();async function Za(t){var s;const{masto:n}=ae({instance:t}),i=await n.v2.search.fetch({q:"from:me",type:"statuses",limit:1});return!!((s=i==null?void 0:i.statuses)!=null&&s.length)}const Xa=_t(Za);function Ja(){const t=qe(A),{id:n,...i}=$t(),[s,o]=ft(),a=s.get("month"),h=!s.get("replies"),r=!!s.get("boosts"),c=s.get("tagged"),l=!!s.get("media"),{masto:p,instance:f,authenticated:m}=ae({instance:i.instance}),{masto:d,instance:v}=ae(),b=Y(),y=[a,h,r,c,l],[w,k]=L(),C=Y(0);se(()=>{C.current=0},y);const I=_e(()=>ti(),[]),T=_e(()=>f===v,[f,v]),[_,x]=L(!1);se(()=>{T&&w!=null&&w.acct&&(async()=>{const te=await Xa(f);x(te)})()},[f,T,w==null?void 0:w.acct]);async function $(te){var Ee,Re,Le,Ne;const fe=/^\d{4}-[01]\d$/.test(a),ve=((Re=(Ee=a==null?void 0:a.split)==null?void 0:Ee.call(a,"-"))==null?void 0:Re[0])>=yi;if(fe&&ve){if(!w)return{value:[],done:!0};const[ye,ee]=a.split("-"),ge=parseInt(ee,10)-1,xe=new Date(ye,ge,0),le=`${xe.getFullYear()}-${(xe.getMonth()+1).toString().padStart(2,"0")}-${xe.getDate().toString().padStart(2,"0")}`,Z=new Date(ye,ge+1,1),me=`${Z.getFullYear()}-${(Z.getMonth()+1).toString().padStart(2,"0")}-${Z.getDate().toString().padStart(2,"0")}`;let P;te?(P=Ut+1,C.current=0):(P=Ut+C.current+1,C.current+=Ut);const E=await p.v2.search.fetch({q:`from:${w.acct} after:${le} before:${me}`,type:"statuses",limit:P,offset:C.current});if((Le=E==null?void 0:E.statuses)!=null&&Le.length){const O=E.statuses.slice(0,Ut);O.forEach(we=>{We(we,f)});const re=E.statuses.length<=Ut;return{value:O,done:re}}else return{value:[],done:!0}}let H=[];if(te){const{value:ye}=await p.v1.accounts.$select(n).statuses.list({pinned:!0}).next();if(ye!=null&&ye.length&&!c&&!l){const ee=ye.map(ge=>(We(ge,f),{...ge,_pinned:!0}));if(ee.length>=3){const ge=ee.map(xe=>xe.id);H.push({id:ge,items:ee,type:"pinned"})}else H.push(...ee)}}(te||!b.current)&&(b.current=p.v1.accounts.$select(n).statuses.list({limit:Ut,exclude_replies:h,exclude_reblogs:r,only_media:l||void 0,tagged:c}));const{value:ce,done:Se}=await b.current.next();if(ce!=null&&ce.length){if(H.length){let ye=[];((Ne=H[0])==null?void 0:Ne.type)==="pinned"?ye=H[0].id:ye=H.filter(ge=>ge._pinned).map(ge=>ge.id),ye.every(ge=>ce.some(xe=>xe.id===ge))&&(H=[])}H.push(...ce),ce.forEach(ye=>{We(ye,f)})}return{value:H,done:Se}}const[N,D]=L([]),{i18n:V}=Qe();let G=V._({id:"/cKnpj"});if(w!=null&&w.acct){const te=(/@/.test(w.acct)?"":"@")+w.acct,fe=w!=null&&w.displayName?`${w.displayName} (${te})`:`${te}`;if(!h)G=V._({id:"hS1Opy",values:{accountDisplay:fe}});else if(r)G=V._({id:"A/CX5F",values:{accountDisplay:fe}});else if(c)G=V._({id:"QQrO94",values:{accountDisplay:fe,tagged:c}});else if(l)G=V._({id:"NoG5wD",values:{accountDisplay:fe}});else if(a){const ve=new Date(a).toLocaleString(V.locale,{month:"long",year:"numeric"});G=V._({id:"8GjLvB",values:{accountDisplay:fe,monthYear:ve}})}else G=fe}Xe(G,"/:instance?/a/:id");const X=Y(),j=ct(()=>{const te=X.current||p.v1.accounts.$select(n).fetch();return X.current=te,te},[n,p]);se(()=>{(async()=>{try{const te=await j();k(te)}catch{}if(!I)try{const te=await p.v1.accounts.$select(n).featuredTags.list();D(te)}catch{}})()},[n,I]);const{displayName:B,acct:q,emojis:ie}=w||{},M=Y(),F=_e(()=>{const te=!h||r||c||l||!!a,fe=t.accounts[`${n}@${f}`];return e(z,{children:[e(Ms,{instance:f,account:fe||n,fetchAccount:j,authenticated:m,standalone:!0}),!I&&e("div",{class:"filter-bar",ref:M,style:{position:"relative"},children:[te?e(he,{to:`/${f}/a/${n}`,class:"insignificant filter-clear",title:V._({id:"u8JHrO"}),children:e(S,{icon:"x",size:"l",alt:V._({id:"xCJdfg"})})},"clear-filters"):e(S,{icon:"filter",class:"insignificant",size:"l",alt:V._({id:"cSev+j"})}),e(he,{to:`/${f}/a/${n}${h?"?replies=1":""}`,onClick:()=>{h&&ue(V._({id:"PIWNSQ"}))},class:h?"":"is-active",children:e(u,{id:"5BFynH"})}),e(he,{to:`/${f}/a/${n}${r?"":"?boosts=0"}`,onClick:()=>{r||ue(V._({id:"Qd13i0"}))},class:r?"is-active":"",children:e(u,{id:"usxQx0"})}),e(he,{to:`/${f}/a/${n}${l?"":"?media=1"}`,onClick:()=>{l||ue(V._({id:"rKpfPY"}))},class:l?"is-active":"",children:e(u,{id:"xYilR2"})}),N.map(ve=>e(he,{to:`/${f}/a/${n}${c===ve.name?"":`?tagged=${encodeURIComponent(ve.name)}`}`,onClick:()=>{c!==ve.name&&ue(V._({id:"L+HFfr",values:{0:ve.name}}))},class:c===ve.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),ve.name]})},ve.id)),_&&(Wa?e("label",{class:`filter-field ${a?"is-active":""}`,children:[e(S,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!(w!=null&&w.acct),value:a||"",min:ji,max:new Date().toISOString().slice(0,7),onInput:ve=>{const{value:H,validity:ce}=ve.currentTarget;if(!ce.valid)return;o(H?{month:H}:{});const[Se,Ee]=H.split("-"),Re=parseInt(Ee,10)-1,Le=new Date(Se,Re);ue(V._({id:"0WUFGD",values:{0:Le.toLocaleString(V.locale,{month:"long",year:"numeric"})}}))}})]}):e(Qa,{class:`filter-field ${a?"is-active":""}`,disabled:!(w!=null&&w.acct),value:a||"",min:ji,max:new Date().toISOString().slice(0,7),onInput:ve=>{const{value:H,validity:ce}=ve;ce.valid&&o(H?{month:H}:{})}}))]})]})},[n,f,m,N,j,_,...y]);se(()=>{var fe;const te=(fe=M.current)==null?void 0:fe.querySelector(".is-active");te&&M.current.scrollTo({behavior:"smooth",left:te.offsetLeft-(M.current.offsetWidth-te.offsetWidth)/2})},[N,_,...y]);const U=_e(()=>w!=null&&w.url?URL.parse(w.url).hostname:null,[w]),de=!!w&&!(f===U);return e(St,{title:`${w!=null&&w.acct?"@"+w.acct:V._({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(fs,{text:B,emojis:ie})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",q]})})]}),id:"account-statuses",instance:f,emptyText:V._({id:"+k97fV"}),errorText:V._({id:"scd9lw"}),fetchItems:$,useItemID:!0,view:l||I?"media":void 0,boostsCarousel:t.settings.boostsCarousel,timelineStart:F,refresh:[h,r,c,l,a+(w==null?void 0:w.acct)].toString(),headerEnd:e(at,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(S,{icon:"more",size:"l",alt:V._({id:"2FYpfJ"})})}),children:[e(ke,{disabled:!de,onClick:()=>{(async()=>{try{const{masto:te}=ae({instance:U}),fe=await te.v1.accounts.lookup({acct:w.acct}),{id:ve}=fe;location.hash=`/${U}/a/${ve}`}catch{alert(V._({id:"FgdLx0"}))}})()},children:[e(S,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"/JFxxT",values:{0:U?e(z,{children:[" ","(",e("b",{children:Dt.toUnicode(U)}),")"]}):null}})})]}),!T&&e(ke,{onClick:()=>{(async()=>{try{const te=await d.v1.accounts.lookup({acct:w.acct+"@"+f}),{id:fe}=te;location.hash=`/${v}/a/${fe}`}catch{alert(V._({id:"FgdLx0"}))}})()},children:[e(S,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"HkuyOu",values:{currentInstance:v},components:{0:e("b",{})}})})]})]})},n)}function Qa(t){const{i18n:n}=Qe(),{class:i,disabled:s,value:o,min:a,max:h,onInput:r=()=>{}}=t,[c,l]=(o==null?void 0:o.split("-"))||[],p=Y(),f=Y(),m=(d,v)=>{const[b,y]=(a==null?void 0:a.split("-"))||[],[w,k]=(h==null?void 0:h.split("-"))||[];return!(v<b||v>w||v===b&&d<y||v===w&&d>k)};return e("div",{class:i,children:[e(S,{icon:"month",size:"l"}),e("select",{ref:p,disabled:s,value:l||"",onInput:d=>{const{value:v}=d.currentTarget,b=f.current.value;if(!m(v,b))return{value:"",validity:{valid:!1}};r({value:v?`${b}-${v}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(u,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(d,v)=>e("option",{value:(v+1).toString().padStart(2,"0"),children:new Date(0,v).toLocaleString(n.locale,{month:"long"})},v))]})," ",e("input",{ref:f,type:"number",disabled:s,value:c||new Date().getFullYear(),min:(a==null?void 0:a.slice(0,4))||yi,max:(h==null?void 0:h.slice(0,4))||new Date().getFullYear(),onInput:d=>{const{value:v,validity:b}=d.currentTarget,y=p.current.value;if(!b.valid||!m(y,v))return{value:"",validity:{valid:!1}};r({value:v?`${v}-${y}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}const er=20;function Bs(){Xe(g._({id:"7Ff7ia"}),"/bookmarks");const{masto:t,instance:n}=ae(),i=Y();async function s(o){return(o||!i.current)&&(i.current=t.v1.bookmarks.list({limit:er})),await i.current.next()}return e(St,{title:g._({id:"7Ff7ia"}),id:"bookmarks",emptyText:g._({id:"8k2w6G"}),errorText:g._({id:"UoL+FC"}),instance:n,fetchItems:s})}const tr=""+new URL("catch-up-DuauQu-W.png",import.meta.url).href,nr="home",ot=[{label:{id:"Ov9hfp"},value:1},{label:{id:"tVE2wM"},value:2},{label:{id:"8+HOWa"},value:3},{label:{id:"1o+mEC"},value:4},{label:{id:"dZZ8oA"},value:5},{label:{id:"lpPucp"},value:6},{label:{id:"r9r5X6"},value:7},{label:{id:"I9uBFA"},value:8},{label:{id:"pBYFlb"},value:9},{label:{id:"wvL7OJ"},value:10},{label:{id:"7Vb+qD"},value:11},{label:{id:"VU1Pnd"},value:12},{label:{id:"vpc27K"},value:13}],ir={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},sr=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],or=[null,"account"],cr=ls(t=>new Intl.DateTimeFormat(t||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function ar(){const{i18n:t,_:n}=Qe(),i=cr(t.locale);Xe("Catch-up","/catchup");const{masto:s,instance:o}=ae(),[a,h]=ft(),r=a.get("id"),[c,l]=L("start"),[p,f]=L(!1),m=_e(()=>wt(),[]),d=R=>R===m,v=Ze("@pixelfed/home-include-reblogs");async function b({maxCreatedAt:R}){var ne,$e,Te;const Q=R?new Date(R):null,oe=[],W=s.v1.timelines.home.list({limit:40});e:for(;;)try{v&&W.nextParams&&(typeof W.nextParams=="string"?W.nextParams+="&include_reblogs=true":W.nextParams.include_reblogs=!0);const Ae=await W.next(),{value:ze}=Ae;if(ze!=null&&ze.length){await zs(ze,o);let He=!1;for(let pe=0;pe<ze.length;pe++){const De=ze[pe],Je=new Date(De.createdAt);if(!Q||Je>=Q){const je=!d((($e=(ne=De.reblog)==null?void 0:ne.account)==null?void 0:$e.id)||De.account.id)&&Ht(((Te=De.reblog)==null?void 0:Te.filtered)||De.filtered,nr);if((je==null?void 0:je.action)==="hide")continue;De._filtered=je;const bt=it(De.id,o);De._followedTags=A.statusFollowedTags[bt]?[...A.statusFollowedTags[bt]]:[],oe.push(De),He=!0}if(!He)break e}}else break e;await new Promise(He=>setTimeout(He,1e3))}catch{break e}return oe.forEach(Ae=>{if(Ae!=null&&Ae.inReplyToId){const ze=oe.find(He=>He.id===Ae.inReplyToId);ze&&!ze.inReplyToId&&(ze._thread=!0)}}),oe}const[y,w]=L([]),k=Y(),C=Y(),I=_e(()=>yn(),[]),T=ct(async({duration:R}={})=>{const Q=Date.now(),oe=R?Q-R:null;l("loading");const W=await b({maxCreatedAt:oe}),ne=`${I}-${Bo()}`;try{await ut.catchup.set(ne,{id:ne,posts:W,count:W.length,startAt:oe,endAt:Q}),h({id:ne})}catch{}},[]);se(()=>{r?(async()=>{const R=await ut.catchup.get(r);R&&(R.posts.sort((Q,oe)=>Q.createdAt>oe.createdAt?1:-1),w(R.posts),l("results"))})():c==="results"&&(w([]),l("start"))},[r]);const[_,x]=Mt(R=>R+1,0),[$,N]=L(null),[D,V]=L([]);se(()=>{(async()=>{try{const R=await ut.catchup.keys();if(R.length){const Q=yn(),oe=R.filter(W=>W.startsWith(`${Q}-`));if(oe.length){let W=await ut.catchup.getMany(oe);W.sort((Ae,ze)=>ze.endAt-Ae.endAt);let ne=W.slice(0,3),$e=W.slice(3);const Te=ne.map(Ae=>{const{id:ze,count:He,startAt:pe,endAt:De}=Ae;return{id:ze,count:He,startAt:pe,endAt:De}});V(Te),N(ne[0].endAt),W=null,ne=null,queueMicrotask(()=>{$e.length&&ut.catchup.delMany($e.map(Ae=>Ae.id)).then(()=>{$e=null}).catch(Ae=>{})});return}}}catch{}V([])})()},[_]),se(()=>{c==="start"&&x()},[c==="start"]);const[G,X]=_e(()=>{var ze,He,pe,De,Je;let R=0,Q=0,oe=0,W=0,ne=0,$e=0;const Te={};for(const Ce of y){Ce._filtered?(R++,Ce.__FILTER="filtered"):Ce.group?(Q++,Ce.__FILTER="groups"):Ce.reblog?(oe++,Ce.__FILTER="boosts"):(ze=Ce._followedTags)!=null&&ze.length?(ne++,Ce.__FILTER="followedTags"):Ce.inReplyToId&&Ce.inReplyToAccountId!==((He=Ce.account)==null?void 0:He.id)?(W++,Ce.__FILTER="replies"):($e++,Ce.__FILTER="original");const je=Ce.reblog||Ce;if(Ce.__FILTER!=="filtered"&&((pe=je.card)!=null&&pe.url)&&((De=je.card)!=null&&De.image)&&((Je=je.card)==null?void 0:Je.type)==="link"){const{card:bt,favouritesCount:cn,reblogsCount:xt}=je;let{url:et}=bt;if(et=et.replace(/\/$/,""),!Te[et])Te[et]={postID:je.id,card:bt,shared:1,sharers:[Ce.account],likes:cn,boosts:xt};else{if(Te[et].sharers.find(Ot=>Ot.id===Ce.account.id))continue;Te[et].shared++,Te[et].sharers.push(Ce.account),Te[et].postID!==je.id&&(Te[et].likes+=cn,Te[et].boosts+=xt)}}}let Ae=[];for(const Ce in Te)Ae.push({url:Ce,...Te[Ce]});if(Ae.sort((Ce,je)=>Ce.shared>je.shared?-1:Ce.shared<je.shared?1:Ce.boosts>je.boosts?-1:Ce.boosts<je.boosts?1:Ce.likes>je.likes?-1:Ce.likes<je.likes?1:0),Ae.length>10)e:for(let Ce=10;Ce<Ae.length;Ce++){const{shared:je}=Ae[Ce];if(je<=1){Ae=Ae.slice(0,Ce);break e}}return[{filtered:R,groups:Q,boosts:oe,replies:W,followedTags:ne,original:$e},Ae]},[y]),[j,B]=L("all"),[q,ie]=L(null),[M,F]=L(1),[U,K]=L("createdAt"),[de,te]=L("asc"),[fe,ve]=L(null),[H,ce,Se]=_e(()=>{const R={},Q=new Map;let oe=y.filter(ne=>{const $e=j==="all"||ne.__FILTER===j;return $e&&(R[ne.account.id]=ne.account,Q.set(ne.account.id,(Q.get(ne.account.id)||0)+1)),$e});const W={};return oe.forEach(ne=>{ne.reblog&&(W[ne.reblog.id]?(W[ne.reblog.id].__BOOSTERS?W[ne.reblog.id].__BOOSTERS.add(ne.account):W[ne.reblog.id].__BOOSTERS=new Set([ne.account]),ne.__HIDDEN=!0):W[ne.reblog.id]=ne)}),q&&Q.has(q)&&(oe=oe.filter(ne=>ne.account.id===q||[...ne.__BOOSTERS||[]].find($e=>$e.id===q))),[oe,R,Object.fromEntries(Q)]},[j,q,y]),Ee=_e(()=>{const R={};return H.forEach(Q=>{R[Q.id]=Q}),R},[H]),Re=_e(()=>Object.keys(Se).sort((R,Q)=>Se[Q]-Se[R]),[Se]),Le=_e(()=>{const R={};return Re.forEach((Q,oe)=>{R[Q]=oe}),H.filter(Q=>!Q.__HIDDEN).sort((Q,oe)=>{if(fe==="account"){const W=Q.account.id,ne=oe.account.id,$e=R[W],Te=R[ne],Ae=$e-Te;if(Ae!==0)return Ae}if(U!=="createdAt"&&(Q=Q.reblog||Q,oe=oe.reblog||oe,U!=="density"&&Q[U]===oe[U]))return Q.createdAt>oe.createdAt?1:-1;if(U==="density"){const W=Vi(Q),ne=Vi(oe);return de==="asc"?W>ne?1:-1:ne>W?1:-1}return de==="asc"?Q[U]>oe[U]?1:-1:oe[U]>Q[U]?1:-1})},[H,U,de,fe,Re]),Ne=Y(null),ye=Y(null),ee=Y(!1);se(()=>{y.length>100||ee.current||ye.current&&(Ts(ye.current,{duration:200}),ee.current=!0)},[y,ye]);const ge=y.length>160?"3d":"2d",xe=_e(()=>ge!=="2d"?null:y.map(R=>{const Q=Ee[R.id];return e("span",{class:`post-dot ${Q?"post-dot-highlight":""}`},R.id)}),[Ee]),le=_e(()=>ge!=="3d"||!(y!=null&&y.length)?null:pr(y,"createdAt",320).map((Q,oe)=>e("div",{class:"posts-bin",children:Q.map(W=>{const ne=Ee[W.id];return e("span",{class:`post-dot ${ne?"post-dot-highlight":""}`},W.id)})},oe)),[Ee]),Z=Y(null),me=_e(()=>$?(Date.now()-$)/1e3/60/60:null,[$,M]);se(()=>{if(c!=="results")return;const R=q&&ce[q]?ce[q].username:"",Q=de==="asc"?0:1,oe={account:"authors"};let W=ue({duration:5e3,text:t._({id:"TLYeLT",values:{selectedFilterCategory:j,sortBy:U,sortOrder:de,groupBy:fe}})});return()=>{var ne;(ne=W==null?void 0:W.hideToast)==null||ne.call(W)}},[c,j,q,U,de,fe,ce]),se(()=>{var R;if(q&&ce[q]){const Q=ye.current.querySelector(`[data-author="${q}"]`),oe=(R=ye.current)==null?void 0:R.getBoundingClientRect(),W=Q==null?void 0:Q.getBoundingClientRect();W.left<oe.left||W.right>oe.right?Q.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):W.top<0&&Q.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[q,ce]);const[P,E]=L(!1),O=".catchup-list > li > a",re=Be("j",()=>{const R=document.activeElement.closest(O),Q=R==null?void 0:R.getBoundingClientRect(),oe=Array.from(Z.current.querySelectorAll(O));if(R&&Q.top<Z.current.clientHeight&&Q.bottom>0){const W=oe.indexOf(R),ne=oe[W+1];ne&&(ne.focus(),ne.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const W=oe.find(ne=>ne.getBoundingClientRect().top>=0);W&&(W.focus(),W.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{preventDefault:!0,ignoreModifiers:!0}),we=Be("k",()=>{const R=document.activeElement.closest(O),Q=R==null?void 0:R.getBoundingClientRect(),oe=Array.from(Z.current.querySelectorAll(O));if(R&&Q.top<Z.current.clientHeight&&Q.bottom>0){const W=oe.indexOf(R);let ne=oe[W-1];ne&&(ne.focus(),ne.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const W=oe.find(ne=>{const $e=ne.getBoundingClientRect();return $e.top>=44&&$e.left>=0});W&&(W.focus(),W.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{preventDefault:!0,ignoreModifiers:!0}),Ie=Be("h, l",(R,Q)=>{var W,ne,$e;const oe=Q.keys[0];if(q){const Te=Re.indexOf(q);oe==="h"?Te>0&&Te<Re.length&&(ie(Re[Te-1]),(W=Z.current)==null||W.focus()):oe==="l"&&Te<Re.length-1&&Te>=0&&(ie(Re[Te+1]),(ne=Z.current)==null||ne.focus())}else oe==="l"&&(ie(Re[0]),($e=Z.current)==null||$e.focus())},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),J=Be("esc",()=>{var R;ie(null),(R=Z.current)==null||R.focus()},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Me=Be(".",()=>{var R;(R=Z.current)==null||R.scrollTo({top:0,behavior:"smooth"})},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Oe=ct(R=>{const Q=document.activeElement,oe=(Q==null?void 0:Q.tagName)==="INPUT"&&Q.type==="radio";if((R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="ArrowLeft"||R.key==="ArrowRight")&&oe){Q.blur();return}},[]);return e("div",{ref:R=>{Z.current=R,re(R),we(R),Ie(R),J(R)},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${c==="loading"?"loading":""}`,onClick:R=>{var Q;R.target.closest("a, button")||(Q=Z.current)==null||Q.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Pt,{}),c==="results"&&e(he,{to:"/catchup",class:"button plain",children:e(S,{icon:"history2",size:"l",alt:t._({id:"xrl8fj"})})}),c==="start"&&e(he,{to:"/",class:"button plain",children:e(S,{icon:"home",size:"l",alt:t._({id:"i0qMbr"})})})]}),e("h1",{children:c!=="start"&&e(u,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:c!=="start"&&c!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{E(!0)},children:e(u,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:Oe,children:[c==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(u,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(u,{id:"CxKPv6"})}),e("p",{children:e(u,{id:"YMU1CK"})}),e("img",{src:tr,width:"1200",height:"900",alt:t._({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:R=>{R.target.closest("details").open=!1},children:e(u,{id:"2jI8hh"})})})]}),e("p",{children:e(u,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(u,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:k,type:"range",value:M,min:ot[0].value,max:ot[ot.length-1].value,step:"1",list:"catchup-ranges",onChange:R=>F(+R.target.value)})," ",e("span",{style:{width:"8em"},children:[n(ot[M-1].label),e("br",{}),e("small",{class:"insignificant",children:M==ot[ot.length-1].value?t._({id:"NMNiaO"}):ht(new Date(Date.now()-M*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:ot.map(({label:R,value:Q})=>e("option",{value:Q,label:n(R)}))})," ",e("button",{type:"button",onClick:()=>{var R;if(M<ot[ot.length-1].value){let Q;M===ot[ot.length-1].value&&((R=C.current)!=null&&R.checked)?Q=Date.now()-$:Q=M*60*60*1e3,T({duration:Q})}else T()},children:e(u,{id:"R0yu2l"})})]}),me&&M>me?e("p",{class:"catchup-info",children:[e(S,{icon:"info"})," ",e(u,{id:"AGyV7s"})]}):M===ot[ot.length-1].value&&$?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:C})," ",e(u,{id:"dDJEHI",values:{0:i.format(new Date($))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"EAjFM0"})})}),!!(D!=null&&D.length)&&e("div",{class:"catchup-prev",children:[e("p",{children:e(u,{id:"Yfb9A8"})}),e("ul",{children:D.map(R=>e("li",{children:[e(he,{to:`/catchup?id=${R.id}`,children:[e(S,{icon:"history2"})," ",e("span",{children:R.startAt?i.formatRange(new Date(R.startAt),new Date(R.endAt)):`… – ${i.format(new Date(R.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(u,{id:"S6XZwv",values:{0:R.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{var oe;if(confirm(t._({id:"D9CmP2"}))){let W=ue(t._({id:"xJUo4P",values:{0:R.id}}));await ut.catchup.del(R.id),(oe=W==null?void 0:W.hideToast)==null||oe.call(W),ue(t._({id:"1dyGG/",values:{0:R.id}})),x()}},children:e(S,{icon:"x",alt:t._({id:"t/YqKh"})})})]})]},R.id))}),D.length>=3&&e("p",{children:e("small",{children:e(u,{id:"sXmrl4"})})})]})]}),c==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(Pe,{abrupt:!0}),e("p",{class:"insignificant",children:e(u,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(u,{id:"q9urQO"})})]}),c==="results"&&e(z,{children:[e("div",{class:"catchup-header",children:[y.length>0&&e("p",{children:e("b",{class:"ib",children:i.formatRange(new Date(y[0].createdAt),new Date(y[y.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:j==="all"&&!q&&U==="createdAt"&&de==="asc",type:"button",class:"plain4 small",onClick:()=>{B("all"),ie(null),K("createdAt"),ve(null),te("asc")},children:e(u,{id:"I9EnzM"})}),(X==null?void 0:X.length)>0&&e("button",{type:"button",class:"plain small",onClick:()=>f(!p),children:[e(u,{id:"EIZREX"})," ",e(S,{icon:"chevron-down",style:{transform:p?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!p,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:X.map(R=>{const{card:Q,shared:oe,sharers:W,likes:ne,boosts:$e}=R,{blurhash:Te,title:Ae,description:ze,url:He,image:pe,imageDescription:De,language:Je,width:Ce,height:je,publishedAt:bt}=Q,cn=Dt.toUnicode(URL.parse(He).hostname.replace(/^www\./,"").replace(/\/$/,""));let xt;if(Te){const et=oi(Te),Ot=bi(et);xt=gi([.6,Ot[1],Ot[2]])}return e("a",{href:He,target:"_blank",rel:"noopener noreferrer",class:"link-block",style:xt?{"--accent-color":`rgb(${xt.join(",")})`,"--accent-alpha-color":`rgba(${xt.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:pe,alt:De,width:Ce,height:je,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:cn})," ",!!bt&&e(z,{children:"· "}),!!bt&&e(z,{children:e(Kt,{datetime:bt,format:"micro"})})]}),!!Ae&&e("h1",{class:"title",lang:Je,dir:"auto",title:Ae,children:Ae})]}),!!ze&&e("p",{class:"description",lang:Je,dir:"auto",title:ze,children:ze}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(u,{id:"bfSr6z",values:{0:W.map(et=>{const{avatarStatic:Ot,displayName:oo}=et;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:ki=>{ki.preventDefault(),ki.stopPropagation();const{id:co}=et;ie(co),B("all")},children:e(dt,{url:Ot,size:"s",alt:oo})})})}})})]})]})},He)})})})}),y.length>=5&&(ge==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:le}):e("div",{class:"catchup-posts-viz-bar",children:xe})),y.length>=2&&e("div",{class:"catchup-filters",children:[e("label",{class:"filter-cat",children:[e("input",{type:"radio",name:"filter-cat",checked:j.toLowerCase()==="all",onChange:()=>{B("all")}}),e(u,{id:"N40H+G"})," ",e("span",{class:"count",children:y.length})]}),Object.entries(ir).map(([R,Q])=>!!G[R]&&e("label",{class:"filter-cat",title:(G[R]/y.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:j.toLowerCase()===R.toLowerCase(),onChange:()=>{B(R),R==="boosts"&&(K("reblogsCount"),te("desc"),ve(null))}}),n(Q)," ",e("span",{class:"count",children:G[R]})]},n(Q)))]}),y.length>=2&&!!Se&&e("div",{class:"catchup-filters authors-filters",ref:ye,children:[Re.map(R=>e("label",{class:"filter-author","data-author":R,children:[e("input",{type:"radio",name:"filter-author",checked:q===R,onChange:()=>{ie(R)},onClick:()=>{q===R&&ie(null)}}),e(dt,{url:ce[R].avatarStatic||ce[R].avatar,size:"xxl",alt:`${ce[R].displayName} (@${ce[R].acct})`})," ",e("span",{class:"count",children:Se[R]}),e("span",{class:"username",children:ce[R].username})]},`${R}-${Se[R]}`)),Re.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(u,{id:"HHtYi7",values:{0:Re.length}})},"authors-count")]}),y.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(u,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:sr.map(R=>e("label",{class:"filter-sort",onClick:Q=>{U===R&&(Q.preventDefault(),Q.stopPropagation(),te(de==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:U===R,onChange:()=>{K(R);const Q=/(replies|favourites|reblogs)/.test(R)?"desc":"asc";te(Q)}}),{createdAt:t._({id:"mYGY3B"}),repliesCount:t._({id:"N8UzTV"}),favouritesCount:t._({id:"zZOZj7"}),reblogsCount:t._({id:"puY2t0"}),density:t._({id:"0tQ7AD"})}[R],U===R&&(de==="asc"?" ↑":" ↓")]},R))}),e("span",{class:"filter-label",children:e(u,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:or.map(R=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:fe===R,onChange:()=>{ve(R)},disabled:R==="account"&&q}),{account:t._({id:"dpqPBg"})}[R]||t._({id:"EdQY6l"})]},R||"none"))}),q&&Re.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{ie(null)},style:{whiteSpace:"nowrap"},children:e(u,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${j||""} ${U?`catchup-sort-${U}`:""} ${q&&ce[q]?"catchup-selected-author":""} ${fe?`catchup-group-${fe}`:""}`,children:Le.map((R,Q)=>{var ne;const oe=((ne=R.reblog)==null?void 0:ne.id)||R.id;let W=!1;return fe==="account"&&(Ne.current&&R.account.id!==Ne.current&&Q>0&&(W=!0),Ne.current=R.account.id),e(z,{children:[W&&e("li",{class:"separator"}),e(lr,{to:`/${o}/s/${oe}`,post:R,root:Z.current})]},`${R.id}-${W}`)})}),e("footer",{children:H.length>5&&e("p",{children:[j==="boosts"?t._({id:"eVosYr"}):t._({id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{Z.current.scrollTop=0},children:e(u,{id:"0MgdN+"})}),"."]})})]})]})]}),P&&e(Fe,{onClose:()=>E(!1),children:e("div",{class:"sheet",id:"catchup-help-sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>E(!1),children:e(S,{icon:"x",alt:t._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(u,{id:"EIZREX"})}),e("dd",{children:e(u,{id:"YmGrIy"})}),e("dt",{children:e(u,{id:"coaNtr"})}),e("dd",{children:e(u,{id:"UUrqX1"})}),e("dt",{children:e(u,{id:"ScQBC/"})}),e("dd",{children:e(u,{id:"srocAr"})}),e("dt",{children:e(u,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(u,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const rr=st(function({post:t}){const{id:n,account:i,group:s,reblog:o,inReplyToId:a,inReplyToAccountId:h,_followedTags:r,_filtered:c,visibility:l,__BOOSTERS:p}=t,f=a&&h!==i.id,m=!!c,d=v=>{v.shiftKey};return e("article",{class:`post-line ${s?"group":o?"reblog":r!=null&&r.length?"followed-tags":""} ${f?"reply-to":""} ${m?"filtered":""} visibility-${l}`,onMouseEnter:d,children:[e("span",{class:"post-author",children:o?e("span",{class:"post-reblog-avatar",children:[e(dt,{url:i.avatarStatic||i.avatar,squircle:i.bot}),(p==null?void 0:p.size)>0?[...p].map(v=>e(dt,{url:v.avatarStatic||v.avatar,squircle:v.bot})):""," ",e(S,{icon:"rocket"})," ",e(mt,{account:o.account,showAvatar:!0})]}):e(mt,{account:i,showAvatar:!0})}),e(hr,{post:o||t,filterInfo:c}),e("span",{class:"post-meta",children:[e(fr,{post:o||t})," ",e(Kt,{datetime:new Date((o==null?void 0:o.createdAt)||t.createdAt),format:"micro"})]})]})},(t,n)=>{var i,s;return((i=t==null?void 0:t.post)==null?void 0:i.id)===((s=n==null?void 0:n.post)==null?void 0:s.id)}),lr=({root:t,to:n,...i})=>{const s=Y(),[o,a]=L(!1);return se(()=>{const h=new IntersectionObserver(r=>{r[0].isIntersecting&&(queueMicrotask(()=>a(!0)),h.unobserve(s.current))},{root:t,rootMargin:`${Math.max(320,screen.height*.75)}px`});return s.current&&h.observe(s.current),()=>{s.current&&h.unobserve(s.current)}},[]),o?e("li",{children:e(he,{to:n,children:e(rr,{...i})})}):e("li",{ref:s,style:{height:"4em"}})},dr=8,ur=8;function Vi(t){var c;const{spoilerText:n,content:i,poll:s,mediaAttachments:o,card:a}=t,h=(c=s==null?void 0:s.options)!=null&&c.length?s.options.reduce((l,p)=>l+p.title,""):"";return(n.length+vs(i)+h.length)/140+(o!=null&&o.length?dr*o.length:a!=null&&a.image?ur:0)}const Ct=48;function hr({post:t,filterInfo:n}){var k;const{spoilerText:i,sensitive:s,content:o,emojis:a,poll:h,mediaAttachments:r,card:c,inReplyToId:l,inReplyToAccountId:p,account:f,_thread:m}=t,d=l&&p===f.id||!!m,v=_e(()=>!!(be.account.get("preferences")||{})["reading:expand:spoilers"],[]),b=v||!i&&!s,y=o?ci(t):"",w=!i||v;return e("div",{class:"post-peek",title:i?"":y,children:[e("span",{class:"post-peek-content",children:[d&&!w&&e(z,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),n?e("span",{class:"post-peek-filtered",children:n!=null&&n.titlesStr?g._({id:"suKjh3",values:{0:n.titlesStr}}):g._({id:"03Qqf9"})}):e(z,{children:[!!i&&e("span",{class:"post-peek-spoiler",children:[e(S,{icon:`${v?"eye-open":"eye-close"}`})," ",i]}),w&&e("div",{class:"post-peek-html",children:[d&&e(z,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(u,{id:"e66y2Z"})})," "]}),!!o&&e("div",{dangerouslySetInnerHTML:{__html:Uo(o,a)}}),!!((k=h==null?void 0:h.options)!=null&&k.length)&&h.options.map(C=>e("div",{children:[h.multiple?"▪️":"•"," ",C.title]})),!o&&(r==null?void 0:r.length)===1&&r[0].description&&e(z,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:r[0].description})]})]})]})]}),!n&&e("span",{class:"post-peek-post-content",children:[!!h&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(S,{icon:"poll",size:"s"}),e(u,{id:"4WUbF1"})]}),r!=null&&r.length?r.map(C=>{var $,N,D,V,G,X,j,B,q,ie;const I=C.previewUrl||C.url,T=C.previewRemoteUrl||C.remoteUrl,_=($=C.meta)!=null&&$.original?C.meta.original.width:((D=(N=C.meta)==null?void 0:N.small)==null?void 0:D.width)||((G=(V=C.meta)==null?void 0:V.original)==null?void 0:G.width),x=(X=C.meta)!=null&&X.original?C.meta.original.height:((B=(j=C.meta)==null?void 0:j.small)==null?void 0:B.height)||((ie=(q=C.meta)==null?void 0:q.original)==null?void 0:ie.height);return e("span",{class:"post-peek-media",children:{image:(I||T)&&b?e("img",{src:I,width:Ct,height:Ct,alt:C.description,loading:"lazy",onError:M=>{const{src:F}=M.target;F===I&&(M.target.src=T)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(_,x)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🖼"}),gifv:(I||T)&&b?e("img",{src:I,width:Ct,height:Ct,alt:C.description,loading:"lazy",onError:M=>{const{src:F}=M.target;F===I&&(M.target.src=T)}}):e("span",{class:"post-peek-faux-media",children:"🎞️"}),video:(I||T)&&b?e("img",{src:I,width:Ct,height:Ct,alt:C.description,loading:"lazy",onError:M=>{const{src:F}=M.target;F===I&&(M.target.src=T)}}):e("span",{class:"post-peek-faux-media",children:"📹"}),audio:e("span",{class:"post-peek-faux-media",children:"🎵"})}[C.type]||null},C.id)}):!!c&&c.image&&b&&e("span",{class:`post-peek-media post-peek-card card-${c.type||""}`,children:c.image?e("img",{src:c.image,width:Ct,height:Ct,alt:c.title||c.description||c.imageDescription,loading:"lazy",style:{"--anim-duration":c.width&&c.height&&`${Math.min(Math.max(Math.max(c.width,c.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🔗"})})]})]})}function fr({post:t}){const{reblogsCount:n,repliesCount:i,favouritesCount:s}=t;return e("span",{class:"post-stats",children:[i>0&&e("span",{class:"post-stat-replies",children:[e(S,{icon:"comment2",size:"s",alt:g._({id:"N8UzTV"})})," ",Ke(i)]}),s>0&&e("span",{class:"post-stat-likes",children:[e(S,{icon:"heart",size:"s",alt:g._({id:"zZOZj7"})})," ",Ke(s)]}),n>0&&e("span",{class:"post-stat-boosts",children:[e(S,{icon:"rocket",size:"s",alt:g._({id:"puY2t0"})})," ",Ke(n)]})]})}function pr(t,n,i){const s=t.map(c=>new Date(c[n])),o=s.reduce((c,l)=>l<c?l:c,s[0]),h=s.reduce((c,l)=>l>c?l:c,s[0]).getTime()-o.getTime(),r=Array.from({length:i},()=>[]);return t.forEach(c=>{const p=(new Date(c[n]).getTime()-o.getTime())/h,f=Math.floor(p*(i-1));r[f].push(c)}),r}const mr=20;function Us(){Xe(g._({id:"zZOZj7"}),"/favourites");const{masto:t,instance:n}=ae(),i=Y();async function s(o){return(o||!i.current)&&(i.current=t.v1.favourites.list({limit:mr})),await i.current.next()}return e(St,{title:g._({id:"zZOZj7"}),id:"favourites",emptyText:g._({id:"PHIrMr"}),errorText:g._({id:"khVljG"}),instance:n,fetchItems:s})}const gr=["home","public","notifications","thread","account"],Gi=["notifications","thread","account"],br={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},vr=[0,30*60,60*60,6*60*60,12*60*60,60*60*24,60*60*24*7,60*60*24*30],Hn={0:{id:"qqeAJM"},1800:tt(30,"minute"),3600:tt(1,"hour"),21600:tt(6,"hour"),43200:tt(12,"hour"),86400:tt(24,"hour"),604800:tt(7,"day"),2592e3:tt(30,"day")};function yr(){const{masto:t}=ae();Xe(g._({id:"cSev+j"}),"/ft");const[n,i]=L("default"),[s,o]=L(!1),[a,h]=Mt(l=>l+1,0),[r,c]=L([]);return se(()=>{i("loading"),(async()=>{try{const l=await t.v2.filters.list();l.sort((p,f)=>p.title.localeCompare(f.title)),l.forEach(p=>{var f;(f=p.keywords)!=null&&f.length&&p.keywords.sort((m,d)=>m.id-d.id)}),c(l),i("default")}catch{i("error")}})()},[a]),e("div",{id:"filters-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Pt,{}),e(he,{to:"/",class:"button plain",children:e(S,{icon:"home",size:"l",alt:g._({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{o(!0)},children:e(S,{icon:"plus",size:"l",alt:g._({id:"yFfBdX"})})})})]})}),e("main",{children:r.length>0?e(z,{children:[e("ul",{class:"filters-list",children:r.map(l=>{const{id:p,title:f,expiresAt:m,keywords:d}=l;return e("li",{children:[e("div",{children:[e("h2",{children:f}),(d==null?void 0:d.length)>0&&e("div",{children:d.map(v=>e(z,{children:[e("span",{class:"tag collapsed insignificant",children:v.wholeWord?`${v.keyword}`:v.keyword})," "]}))}),e("small",{class:"insignificant",children:e(Fs,{expiresAt:m})})]}),e("button",{type:"button",class:"plain",onClick:()=>{o({filter:l})},children:e(S,{icon:"pencil",size:"l",alt:"Edit filter"})})]},p)})}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(u,{id:"5vzJxv",values:{0:r.length}})})})]}):n==="loading"?e("p",{class:"ui-state",children:e(Pe,{})}):n==="error"?e("p",{class:"ui-state",children:e(u,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(u,{id:"cWIHTt"})})})]}),!!s&&e(Fe,{title:g._({id:"vCSBPD"}),onClose:()=>{o(!1)},children:e(_r,{filter:s==null?void 0:s.filter,onClose:l=>{l.state==="success"&&h(),o(!1)}})})]})}let wr=1;const kr=()=>wr++;function _r({filter:t,onClose:n}){const{_:i}=Qe(),{masto:s}=ae(),[o,a]=L("default"),h=!!t,{context:r,expiresAt:c,id:l,keywords:p,title:f,filterAction:m}=t||{},d=!!c,v=d&&new Date(c),[b,y]=L(p||[]),w=Y(),[k,C]=L([]),[I,T]=L([]),_=b.filter(x=>!k.includes(x.id)&&!I.includes(x._id));return e("div",{class:"sheet",id:"filters-add-edit-modal",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:h?g._({id:"3mOee6"}):g._({id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:x=>{x.preventDefault();const $=new FormData(x.target),N=$.get("title"),D=$.getAll("keyword_attributes[][id]"),V=$.getAll("keyword_attributes[][keyword]"),G=[...w.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(ie=>ie.checked),X=V.map((ie,M)=>({id:D[M]||void 0,keyword:ie,wholeWord:G[M]}));h&&(k!=null&&k.length)&&k.forEach(ie=>{X.push({id:ie,_destroy:!0})});const j=$.getAll("context");let B=$.get("expires_in");const q=$.get("filter_action");!N||!(j!=null&&j.length)||(a("loading"),(async()=>{try{let ie;h?(B===""||B===null?d?B=Math.floor((v-new Date)/1e3):B=null:B==="0"||B===0?B=null:B=+B,ie=await s.v2.filters.$select(l).update({title:N,context:j,expiresIn:B,keywordsAttributes:X,filterAction:q})):(B=+B||null,ie=await s.v2.filters.create({title:N,context:j,expiresIn:B,keywordsAttributes:X,filterAction:q})),a("default"),n==null||n({state:"success",filter:ie})}catch{a("error"),alert(h?g._({id:"H8RP+h"}):g._({id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(u,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:f,disabled:o==="loading",dir:"auto",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:w,children:[_.length?e("ul",{class:"filter-keywords",children:_.map(x=>{const{id:$,keyword:N,wholeWord:D,_id:V}=x;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:$}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:N,disabled:o==="loading",required:!0,dir:"auto"}),e("div",{class:"filter-keyword-actions",children:[e("label",{children:[e("input",{name:"keyword_attributes[][whole_word]",type:"checkbox",value:$,defaultChecked:D,disabled:o==="loading"})," ",e(u,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:o==="loading",onClick:()=>{$?(k.push($),C([...k])):V&&(I.push(V),T([...I]))},children:e(S,{icon:"x",alt:g._({id:"t/YqKh"})})})]})]},`${$}-${V}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(u,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{y([...b,{_id:kr(),keyword:"",wholeWord:!0}]),setTimeout(()=>{var $,N;const x=w.current.querySelectorAll('input[type="text"]');(N=($=x[x.length-1])==null?void 0:$.focus)==null||N.call($)},10)},children:e(u,{id:"qn5Dbn"})})," ",(_==null?void 0:_.length)>1&&e("small",{class:"insignificant",children:e(u,{id:"1JZ175",values:{0:_.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(u,{id:"uqf7Yq"})})}),gr.map(x=>e("div",{children:[e("label",{class:Gi.includes(x)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:x,defaultChecked:r?r.includes(x):!0,disabled:o==="loading"})," ",i(br[x]),Gi.includes(x)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(u,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[h&&e(u,{id:"ucJk3m",components:{0:e("b",{}),1:e(Fs,{expiresAt:c,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:h?g._({id:"BcNdg+"}):g._({id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:o==="loading",defaultValue:h?void 0:0,children:[h&&e("option",{}),vr.map(x=>e("option",{value:x,children:typeof Hn[x]=="function"?Hn[x]():i(Hn[x])}))]})]}),e("p",{children:[e(u,{id:"blQMpa"}),e("br",{}),e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:m==="warn"||!h,disabled:o==="loading"})," ",e(u,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:m==="hide",disabled:o==="loading"})," ",e(u,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:o==="loading",children:h?g._({id:"tfDRzk"}):g._({id:"hYgDIe"})})," ",e(Pe,{abrupt:!0,hidden:o!=="loading"})]}),h&&e(lt,{disabled:o==="loading",align:"end",menuItemClassName:"danger",confirmLabel:g._({id:"BPjyR2"}),onClick:()=>{a("loading"),(async()=>{try{await s.v2.filters.$select(l).remove(),a("default"),n==null||n({state:"success"})}catch{a("error"),alert(g._({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:o==="loading",children:e(u,{id:"Jb6/SB"})})})]})]})})]})}function Fs({expiresAt:t,showNeverExpires:n}){const i=!!t,s=i&&new Date(t),o=i&&s<=new Date,[a,h]=Mt(r=>r+1,0);return ii(h,o||3e4),o?g._({id:"M1RnFv"}):i?e(u,{id:"urGtsw",components:{0:e(Kt,{datetime:s})}}):n&&g._({id:"O1Aswy"})}function Sr(){const{masto:t,instance:n}=ae();Xe(g._({id:"Xi1/bw"}),"/fh");const[i,s]=L("default"),[o,a]=L([]);return se(()=>{s("loading"),(async()=>{try{const h=await Sn();a(h),s("default")}catch{s("error")}})()},[]),e("div",{id:"followed-hashtags-page",class:"deck-container",tabIndex:"-1",children:e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Pt,{}),e(he,{to:"/",class:"button plain",children:e(S,{icon:"home",size:"l",alt:g._({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:o.length>0?e(z,{children:[e("ul",{class:"link-list",children:o.map(h=>e("li",{children:e(he,{to:n?`/${n}/t/${h.name}`:`/t/${h.name}`,children:[e(S,{icon:"hashtag",alt:"#"})," ",e("span",{children:h.name})]})}))}),o.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(u,{id:"2S/uvJ",values:{0:o.length}})})})]}):i==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):i==="error"?e("p",{class:"ui-state",children:e(u,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(u,{id:"vKsGhk"})})})]})})}const Cr=20;function wi({title:t,path:n,id:i,...s}){Xe(t||g._({id:"following.title"}),n||"/following");const{masto:o,streaming:a,instance:h}=ae(),r=qe(A),c=Y(),l=Y();__BENCHMARK.end("time-to-following");const p=Ze("@pixelfed/home-include-reblogs");async function f(d){var y;(d||!c.current)&&(__BENCHMARK.start("fetch-home-first"),c.current=o.v1.timelines.home.list({limit:Cr})),p&&((y=c.current)!=null&&y.nextParams)&&(typeof c.current.nextParams=="string"?c.current.nextParams+="&include_reblogs=true":c.current.nextParams.include_reblogs=!0);const v=await c.current.next();let{value:b}=v;if(b!=null&&b.length){let w=!1;d&&(b[0].id!==l.current&&(w=!0),l.current=b[0].id),b.forEach(k=>{We(k,h)}),b=qi(b,h),d&&w&&Ba(),zs(b,h),b.sort((k,C)=>{const I=new Date(k.createdAt);return new Date(C.createdAt)-I})}return __BENCHMARK.end("fetch-home-first"),{...v,value:b}}async function m(){var d;try{const v={limit:5,since_id:l.current};Ze("@pixelfed/home-include-reblogs")&&(v.include_reblogs=!0);const b=await o.v1.timelines.home.list(v).next();let{value:y}=b;const w=((d=y[0])==null?void 0:d.id)===l.current;return!!(y!=null&&y.length&&!w&&(l.current=y[0].id,y=qi(y,h),y=Rt(y,"home"),y.some(k=>!k.reblog)))}catch{return!1}}return se(()=>{let d;return(async()=>{if(a){d=a.user.subscribe();for await(const v of d){if(!d)break;if(v.event==="status.update"){const b=v.payload;We(b,h)}else if(v.event==="delete"){const b=v.payload,y=ds(b,h);y&&(y._deleted=!0)}}}})(),()=>{var v;(v=d==null?void 0:d.unsubscribe)==null||v.call(d),d=null}},[a]),e(St,{title:t||g._({id:"following.title"}),id:i||"following",emptyText:g._({id:"nJEKbY"}),errorText:g._({id:"7QSeK6"}),instance:h,fetchItems:f,checkForUpdates:m,useItemID:!0,boostsCarousel:r.settings.boostsCarousel,...s,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const Ir=20,Tr=4,Ki=Tr+1;function Hs({media:t,columnMode:n,...i}){let{hashtag:s,...o}=n?{}:$t();i.hashtag&&(s=i.hashtag);let a=s.trim().split(/[\s+]+/);a.sort(),s=a[0];const[h,r]=ft(),c=t||!!h.get("media"),l=c?"?media=1":"",{masto:p,instance:f,authenticated:m}=ae({instance:(i==null?void 0:i.instance)||o.instance}),{masto:d,instance:v,authenticated:b}=ae(),y=a.map(M=>`#${M}`).join(" "),w=f?c?g._({id:"kH0rA0",values:{hashtagTitle:y,instance:f}}):g._({id:"IK0zKi",values:{hashtagTitle:y,instance:f}}):c?g._({id:"hHSI3w",values:{hashtagTitle:y}}):g._({id:"+ZzjRY",values:{hashtagTitle:y}});Xe(w,"/:instance?/t/:hashtag");const k=Y(),C=_e(()=>ti(),[]),I=Y(void 0);async function T(M){const F=await p.v1.timelines.tag.$select(s).list({limit:Ir,any:a.slice(1),maxId:M?void 0:I.current,onlyMedia:c?!0:void 0}).next();let{value:U}=F;return U!=null&&U.length&&(M&&(k.current=U[0].id),U.forEach(K=>{We(K,f,{skipThreading:c||C})}),I.current=U[U.length-1].id),{...F,value:U}}async function _(){var M;try{const F=await p.v1.timelines.tag.$select(s).list({limit:1,any:a.slice(1),since_id:k.current,onlyMedia:c}).next();let{value:U}=F;const K=((M=U[0])==null?void 0:M.id)===k.current;return U!=null&&U.length&&!K?(U=Rt(U,"public"),!0):!1}catch{return!1}}const[x,$]=L("default"),[N,D]=L();se(()=>{(async()=>{try{const M=await p.v1.tags.$select(s).fetch();D(M)}catch{}})()},[s]);const V=a.length>=Ki,[G,X]=L("default"),[j,B]=L([]),[q,ie]=L(!1);return se(()=>{m&&(async()=>{try{const M=await p.v1.featuredTags.list();B(M),ie(M.some(F=>F.name.toLowerCase()===s.toLowerCase()))}catch{}})()},[]),e(St,{title:w,titleComponent:!!f&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:y}),e("div",{children:f})]}),id:"hashtag",instance:f,emptyText:g._({id:"CNSLAW"}),errorText:g._({id:"yjj6Ll"}),fetchItems:T,checkForUpdates:_,useItemID:!0,view:c||C?"media":void 0,refresh:c,filterContext:"public",headerEnd:e(at,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(S,{icon:"more",size:"l",alt:g._({id:"2FYpfJ"})})}),children:[!!N&&a.length===1&&e(z,{children:[e(lt,{subMenu:!0,confirm:N.following,confirmLabel:g._({id:"ctJi7k",values:{hashtag:s}}),disabled:x==="loading"||!m,onClick:()=>{$("loading"),N.following?p.v1.tags.$select(s).unfollow().then(()=>{D({...N,following:!1}),ue(g._({id:"doK/ij",values:{hashtag:s}}))}).catch(M=>{alert(M)}).finally(()=>{$("default")}):p.v1.tags.$select(s).follow().then(()=>{D({...N,following:!0}),ue(g._({id:"R9+aEN",values:{hashtag:s}}))}).catch(M=>{alert(M)}).finally(()=>{$("default")})},children:N.following?e(z,{children:[e(S,{icon:"check-circle"})," ",e("span",{children:e(u,{id:"HOSk7R"})})]}):e(z,{children:[e(S,{icon:"plus"})," ",e("span",{children:e(u,{id:"MKEPCY"})})]})}),e(ke,{type:"checkbox",checked:q,disabled:G==="loading"||!m,onClick:()=>{if(X("loading"),q){const M=j.find(F=>F.name.toLowerCase()===s.toLowerCase()).id;M?p.v1.featuredTags.$select(M).remove().then(()=>{ie(!1),ue(g._({id:"VH+Tf9"})),B(j.filter(F=>F.id!==M))}).catch(F=>{}).finally(()=>{X("default")}):ue(g._({id:"3OLv47"}))}else p.v1.featuredTags.create({name:s}).then(M=>{ie(!0),ue(g._({id:"9ra4hn"})),B(j.concat(M))}).catch(M=>{}).finally(()=>{X("default")})},children:q?e(z,{children:[e(S,{icon:"check-circle"}),e("span",{children:e(u,{id:"9ra4hn"})})]}):e(z,{children:[e(S,{icon:"check-circle"}),e("span",{children:e(u,{id:"UlJ3QN"})})]})}),e(Ge,{})]}),!C&&e(z,{children:[e(ys,{className:"plain",children:e(u,{id:"cSev+j"})}),e(ke,{type:"checkbox",checked:!!c,onClick:()=>{c?h.delete("media"):h.set("media","1"),r(h)},children:[e(S,{icon:"check-circle",alt:"☑️"})," ",e("span",{class:"menu-grow",children:e(u,{id:"eK4SL/"})})]}),e(Ge,{})]}),e(Fo,{className:"menu-field",disabled:V,children:({ref:M})=>e("form",{onSubmit:F=>{var K,de;F.preventDefault();const U=(de=(K=F.target[0].value)==null?void 0:K.trim)==null?void 0:de.call(K);U&&!a.some(te=>te.toLowerCase()===U.toLowerCase())&&(a.push(U),a.sort(),location.hash=f?`/${f}/t/${a.join("+")}`:`/t/${a.join("+")}${l}`)},children:[e(S,{icon:"hashtag"}),e("input",{ref:M,type:"text",placeholder:V?g._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:Ki}}):g._({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:V,dir:"auto"})]})}),e(Ho,{takeOverflow:!0,children:a.map((M,F)=>e(ke,{disabled:a.length===1,onClick:U=>{a.splice(F,1),a.sort(),location.hash=f?`/${f}/t/${a.join("+")}${l}`:`/t/${a.join("+")}${l}`},children:[e(S,{icon:"x",alt:g._({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),M]})]},M))}),e(Ge,{}),e(ke,{disabled:!b,onClick:()=>{if(A.shortcuts.length>=yt){alert(g._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:yt}}));return}const M={type:"hashtag",hashtag:a.join(" "),instance:f,media:c?"on":void 0};A.shortcuts.some(U=>U.type===M.type&&U.hashtag.split(/[\s+]+/).sort().join(" ")===M.hashtag.split(/[\s+]+/).sort().join(" ")&&(U.instance?U.instance===M.instance:!0)&&(U.media?!!U.media==!!M.media:!0))?alert(g._({id:"kfeQnS"})):(A.shortcuts.push(M),ue(g._({id:"MIhb91"})))},children:[e(S,{icon:"shortcut"})," ",e("span",{children:e(u,{id:"i02Lq/"})})]}),e(ke,{onClick:()=>{let M=prompt(g._({id:"2MQ2cd"}));if(!/\./.test(M)){M&&alert(g._({id:"7WddtO"}));return}M&&(M=M.toLowerCase().trim(),location.hash=`/${M}/t/${a.join("+")}${l}`)},children:[e(S,{icon:"bus"})," ",e("span",{children:e(u,{id:"Sq04Yc"})})]}),v!==f&&e(ke,{onClick:()=>{location.hash=`/${v}/t/${a.join("+")}${l}`},children:[e(S,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"iAzCp4",values:{currentInstance:v},components:{0:e("b",{})}})})]})]})},f+y)}const xr=20;function qs(t){var w;const n=qe(A),{masto:i,instance:s}=ae(),o=(t==null?void 0:t.id)||((w=$t())==null?void 0:w.id),a=Y(),h=Y();async function r(k){(k||!h.current)&&(h.current=i.v1.timelines.list.$select(o).list({limit:xr}));const C=await h.current.next();let{value:I}=C;return I!=null&&I.length&&(k&&(a.current=I[0].id),I.forEach(T=>{We(T,s)})),{...C,value:I}}async function c(){var k;try{const C=await i.v1.timelines.list.$select(o).list({limit:1,since_id:a.current});let{value:I}=C;const T=((k=I[0])==null?void 0:k.id)===a.current;return I!=null&&I.length&&!T?(I=Rt(I,"home"),!0):!1}catch{return!1}}const[l,p]=L([]);se(()=>{on().then(p)},[]);const[f,m]=L({title:"List"});Xe(f.title,"/l/:id"),se(()=>{(async()=>{try{const k=await Rs(o);m(k)}catch{}})()},[o]);const[d,v]=L(!1),[b,y]=L(!1);return e(z,{children:[e(St,{title:f.title,id:"list",emptyText:g._({id:"KkDhfU"}),errorText:g._({id:"7QSeK6"}),instance:s,fetchItems:r,checkForUpdates:c,useItemID:!0,boostsCarousel:n.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(at,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(S,{icon:"list",size:"l",alt:g._({id:"h16FyT"})}),e(S,{icon:"chevron-down",size:"s"})]}),children:[e(Ue,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),(l==null?void 0:l.length)>0&&e(z,{children:[e(Ge,{}),l.map(k=>e(Ue,{to:`/l/${k.id}`,children:e("span",{children:k.title})},k.id))]})]}),headerEnd:e(at,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(S,{icon:"more",size:"l",alt:g._({id:"2FYpfJ"})})}),children:[e(ke,{onClick:()=>v({list:f}),children:[e(S,{icon:"pencil",size:"l"}),e("span",{children:e(u,{id:"ePK91l"})})]}),e(ke,{onClick:()=>y(!0),children:[e(S,{icon:"group",size:"l"}),e("span",{children:e(u,{id:"hB02vO"})})]})]})},o),d&&e(Fe,{onClick:k=>{k.target===k.currentTarget&&v(!1)},children:e(mi,{list:d==null?void 0:d.list,onClose:k=>{k.state==="success"&&k.list?m(k.list):k.state==="deleted"&&(location.hash="/l"),v(!1)}})}),b&&e(Fe,{onClick:k=>{k.target===k.currentTarget&&y(!1)},children:e(Er,{listID:o,onClose:()=>y(!1)})})]})}const Ar=40;function Er({listID:t,onClose:n}){const{masto:i,instance:s}=ae(),[o,a]=L([]),[h,r]=L("default"),[c,l]=L(!1),p=Y();async function f(m){l(!1),r("loading"),(async()=>{try{(m||!p.current)&&(p.current=i.v1.lists.$select(t).accounts.list({limit:Ar}));const d=await p.current.next();let{done:v,value:b}=d;b!=null&&b.length?(a(m?b:o.concat(b)),l(!v)):l(!1),r("default")}catch{r("error")}})()}return se(()=>{f(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[o.map(m=>e("li",{children:[e(rt,{account:m,instance:s}),e(Rr,{account:m,listID:t})]},m.id)),c&&h==="default"&&e(kt,{as:"li",onChange:m=>m&&f(),children:e("button",{type:"button",class:"light block",onClick:f,children:e(u,{id:"uXRAkV"})})})]})})]})}function Rr({account:t,listID:n}){const{masto:i}=ae(),[s,o]=L("default"),[a,h]=L(!1);return e(lt,{confirm:!a,confirmLabel:e("span",{children:e(u,{id:"j5n9Ry",values:{0:t.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{a?(o("loading"),(async()=>{try{await i.v1.lists.$select(n).accounts.create({accountIds:[t.id]}),o("default"),h(!1)}catch{o("error")}})()):(o("loading"),(async()=>{try{await i.v1.lists.$select(n).accounts.remove({accountIds:[t.id]}),o("default"),h(!0)}catch{o("error")}})())},children:e("button",{type:"button",class:`light ${a?"":"danger"}`,disabled:s==="loading",children:a?g._({id:"m16xKo"}):g._({id:"MWIaew"})})})}const Lr={mention:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},Mr=["favourite","reblog","follow"],Ys=t=>Mr.includes(t);function js(t){return t.filter(n=>{const{type:i,id:s,createdAt:o}=n;if(!i)return!1;const a=Lr[i];return a!=null&&a.length?a.every(h=>!!n[h]):!0})}function Vs(t){if(t!=null&&t.notificationGroups){const{accounts:n=[],notificationGroups:i=[],statuses:s=[]}=t;return i.map(o=>{const{sampleAccountIds:a,statusId:h}=o,r=(a==null?void 0:a.map(l=>n.find(p=>p.id===l)))||[],c=(s==null?void 0:s.find(l=>l.id===h))||null;return{...o,sampleAccounts:r,status:c}})}return t}function $r(t){const n=t.map(h=>{const{latestPageNotificationAt:r,mostRecentNotificationId:c,sampleAccounts:l,notificationsCount:p}=h;return{id:""+c,createdAt:r,account:l[0],...h}}),i={},s=[];for(let h=0;h<n.length;h++){const r=n[h],{type:c,status:l,createdAt:p,notificationsCount:f,sampleAccounts:m,groupKey:d}=r,v=p?new Date(p).toLocaleDateString():"";let b=c;f>0&&(m==null||m.length),(c==="favourite"||c==="reblog")&&(b="favourite+reblog");const y=`${l==null?void 0:l.id}-${b}-${v}`,w=i[y];if(!Ys(c))s.push(r);else if(w)m.forEach(k=>{const C=w.sampleAccounts.find(I=>I.id===k.id);C?(C._types.push(c),C._types.sort().reverse()):w.sampleAccounts.push({...k,_types:[c]})}),w.notificationsCount=Math.min(w.notificationsCount,f),w._notificationsCount.push(f),w._accounts=w.sampleAccounts,w._groupKeys.push(d);else{const k=m.map(C=>({...C,_types:[c]}));i[y]={...r,sampleAccounts:k,type:b,_accounts:k,_groupKeys:d?[d]:[],_notificationsCount:[f]},s.push(i[y])}}const o={},a=[];for(let h=0;h<s.length;h++){const r=s[h],{type:c,account:l,_accounts:p,sampleAccounts:f,createdAt:m,groupKey:d}=r,v=m?new Date(m).toLocaleDateString():"",b=(f==null?void 0:f.length)===1||(p==null?void 0:p.length)===1;if((c==="favourite"||c==="reblog"||c==="favourite+reblog")&&b){const y=`${l==null?void 0:l.id}-${c}-${v}`,w=o[y];if(w)w._statuses.push(r.status),w._ids+=`-${r.id}`,w._groupKeys.push(d);else{let k=o[y]={...r,type:c,_ids:r.id,_statuses:[r.status],_groupKeys:d?[d]:[]};a.push(k)}}else a.push(r)}return a}function Dr(t){t=js(t);const n={},i=[];for(let a=0,h=0;a<t.length;a++){const r=t[a],{id:c,status:l,account:p,type:f,createdAt:m}=r,d=m?new Date(m).toLocaleDateString():"";let v=f;(f==="favourite"||f==="reblog")&&(v="favourite+reblog");const b=`${l==null?void 0:l.id}-${v}-${d}`,y=n[b];if(!Ys(f))i[h++]=r;else if(y!=null&&y.account){const w=y._accounts.find(k=>k.id===p.id);w?(w._types.push(f),w._types.sort().reverse(),y._ids+=`-${c}`):(p._types=[f],y._accounts.push(p),y._ids+=`-${c}`)}else{p&&(p._types=[f]);let w=n[b]={...r,type:v,_ids:c,_accounts:p?[p]:[]};i[h++]=w}}const s={},o=[];for(let a=0,h=0;a<i.length;a++){const r=i[a],{id:c,account:l,_accounts:p,type:f,createdAt:m}=r,d=m?new Date(m).toLocaleDateString():"";if(f==="favourite+reblog"&&l&&p.length===1){const v=`${l==null?void 0:l.id}-${f}-${d}`,b=s[v];if(b)b._statuses.push(r.status),b._ids+=`-${c}`;else{let y=s[v]={...r,type:f,_ids:c,_statuses:[r.status]};o[h++]=y}}else o[h++]=r}return o}const Wi=20,Nr=new URLSearchParams;function Gs({columnMode:t,...n}){const{masto:i,instance:s}=ae(),[o]=t?[Nr]:ft(),[a,h]=L(null),r=(n==null?void 0:n.type)||o.get("type")||a;Xe(r==="private"?g._({id:"2BApYc"}):g._({id:"/bZzdR"}),"/mentions");const c=Y(),l=Y();async function p(w){(w||!c.current)&&(c.current=i.v1.notifications.list({limit:Wi,types:["mention"]}));const k=await c.current.next();let{value:C}=k;return C!=null&&C.length&&(C=js(C),w&&(l.current=C[0].id),C.forEach(({status:I})=>{We(I,s)})),{...k,value:C==null?void 0:C.map(I=>I.status)}}const f=Y(),m=Y();async function d(w){(w||!f.current)&&(f.current=i.v1.conversations.list({limit:Wi}));const k=await f.current.next();let{value:C}=k;return C=C==null?void 0:C.filter(I=>I.lastStatus),C!=null&&C.length&&(w&&(m.current=C[0].lastStatus.id),C.forEach(({lastStatus:I})=>{We(I,s)})),{...k,value:C==null?void 0:C.map(I=>I.lastStatus)}}function v(...w){return r==="private"?d(...w):p(...w)}async function b(){var w;if(r==="private")try{const k=await i.v1.conversations.list({limit:1,since_id:m.current}).next();let{value:C}=k;const I=((w=C[0])==null?void 0:w.id)===m.current;return C!=null&&C.length&&!I?(m.current=C[0].lastStatus.id,!0):!1}catch{return!1}else try{const k=await i.v1.notifications.list({limit:1,types:["mention"],since_id:l.current}).next();let{value:C}=k;return C!=null&&C.length?(l.current=C[0].id,!0):!1}catch{return!1}}const y=_e(()=>e("div",{class:"filter-bar centered",children:[e(he,{to:"/mentions",class:r?"":"is-active",onClick:w=>{t&&(w.preventDefault(),h(null))},children:e(u,{id:"N40H+G"})}),e(he,{to:"/mentions?type=private",class:r==="private"?"is-active":"",onClick:w=>{t&&(w.preventDefault(),h("private"))},children:e(u,{id:"zwBp5t"})})]}),[r]);return e(St,{title:g._({id:"/bZzdR"}),id:"mentions",emptyText:g._({id:"03jFGT"}),errorText:g._({id:"pqR9KF"}),instance:s,fetchItems:v,checkForUpdates:b,useItemID:!0,timelineStart:y,refresh:r})}const Pr=80,Or=20,zr=new URLSearchParams,rn={block:"center",inline:"center",behavior:"smooth"},Ks=ls(()=>Ze("@mastodon/grouped-notifications"),{maxAge:1e3*60*5});function Ws(t={}){const{masto:n}=ae();return A.settings.groupedNotificationsAlpha&&Ks()?n.v2.notifications.list({limit:Or,...t}):n.v1.notifications.list({limit:Pr,...t})}function Zs(t){return A.settings.groupedNotificationsAlpha&&Ks()?$r(t):Dr(t)}const Br=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],Ur={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function Fr({columnMode:t}){var P;const{_:n}=Qe();Xe(g._({id:"iDNBZe"}),"/notifications");const{masto:i,instance:s}=ae(),o=qe(A),[a,h]=L("default"),[r]=t?[zr]:ft(),c=r.get("id"),l=r.get("access_token"),[p,f]=L(!1),[m,d]=L(!1),v=Y(),{nearReachEnd:b,scrollDirection:y,reachStart:w,nearReachStart:k}=Ua({scrollableRef:v}),C=y==="end"&&!k,[I,T]=L([]),[_,x]=L([]),$=Y();async function N(E){var we;if((E||!$.current)&&($.current=Ws({excludeTypes:["follow_request"]})),/max_id=($|&)/i.test((we=$.current)==null?void 0:we.nextParams))return{done:!0};const O=await $.current.next(),re=Vs(O.value);if(re!=null&&re.length){re.forEach(J=>{We(J.status,s,{skipThreading:!0})});const Ie=Zs(re);E?(A.notificationsLast=Ie[0],A.notifications=Ie,i.v1.markers.create({notifications:{lastReadId:Ie[0].id}}).catch(()=>{})):A.notifications.push(...Ie)}return A.notificationsShowNew=!1,A.notificationsLastFetchTime=Date.now(),O}async function D(){try{return await i.v1.followRequests.list({limit:80})}catch{return[]}}const V=()=>{h("loading"),(async()=>{try{const E=await D();T(E),h("default")}catch{h("error")}})()};async function G(){try{return await i.v1.announcements.list()}catch{return[]}}const X=Ze("@mastodon/filtered-notifications"),[j,B]=L(!1),[q,ie]=L({});function M(){return i.v2.notifications.policy.fetch().catch(()=>{})}function F(){M().then(E=>{ie(E)}).catch(()=>{})}const[U,K]=L(null);function de(){return i.v1.notifications.requests.list()}const te=E=>{ve(!1),h("loading"),(async()=>{try{const O=N(E);E&&(G().then(we=>{we.sort((Ie,J)=>{const Me=new Date(Ie.updatedAt||Ie.createdAt);return new Date(J.updatedAt||J.createdAt)-Me}),x(we)}).catch(()=>{}),D().then(we=>{T(we)}).catch(()=>{}),X&&F());const{done:re}=await O;f(!re),h("default")}catch{h("error")}})()};se(()=>{te(!0)},[]),se(()=>{w&&te(!0)},[w]);const[fe,ve]=L(!1),H=ct(({disableIdleCheck:E=!1}={})=>{var O;a!=="loading"&&o.settings.autoRefresh&&((O=v.current)==null?void 0:O.scrollTop)<16&&(E||window.__IDLE__)&&!Hr()&&te(!0)},[o.notificationsShowNew,o.settings.autoRefresh,a]),ce=Y();qt(E=>{if(E){const O=Date.now()-ce.current;!ce.current||O>1e3*3?H({disableIdleCheck:!0}):ce.current=Date.now()}});const Se=Y(!0);se(()=>{let E=vo(A,"notificationsShowNew",O=>{if(Se.current){Se.current=!1;return}a!=="loading"&&(O&&H(),ve(O))});return()=>E==null?void 0:E()},[]);const Ee=new Date,Re=new Date(Ee-24*60*60*1e3);let Le=new Date;const Ne=!o.notifications.some(E=>new Date(E.createdAt).toDateString()===Ee.toDateString()),ye=Y();se(()=>{c&&(A.routeNotification={id:c,accessToken:atob(l)})},[c,l]);const ee=".notification",ge=Be("j",()=>{const E=document.activeElement.closest(ee),O=E==null?void 0:E.getBoundingClientRect(),re=Array.from(v.current.querySelectorAll(ee));if(E&&O.top<v.current.clientHeight&&O.bottom>0){const we=re.indexOf(E);let Ie=re[we+1];Ie&&(Ie.focus(),Ie.scrollIntoView(rn))}else{const we=re.find(Ie=>{const J=Ie.getBoundingClientRect();return J.top>=44&&J.left>=0});we&&(we.focus(),we.scrollIntoView(rn))}}),xe=Be("k",()=>{const E=document.activeElement.closest(ee),O=E==null?void 0:E.getBoundingClientRect(),re=Array.from(v.current.querySelectorAll(ee));if(E&&O.top<v.current.clientHeight&&O.bottom>0){const we=re.indexOf(E);let Ie=re[we-1];Ie&&(Ie.focus(),Ie.scrollIntoView(rn))}else{const we=re.find(Ie=>{const J=Ie.getBoundingClientRect();return J.top>=44&&J.left>=0});we&&(we.focus(),we.scrollIntoView(rn))}}),le=Be(["enter","o"],()=>{const E=document.activeElement.closest(ee),O=E==null?void 0:E.querySelector(".status-link");O&&O.click()}),Z=new Date,me=_e(()=>ht(Z,{forceOpts:{weekday:"long"}}),[Z]);return e("div",{id:"notifications-page",class:"deck-container",ref:E=>{v.current=E,ge(E),xe(E),le(E)},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${m?"only-mentions":""}`,children:[e("header",{hidden:C,onClick:E=>{var O;E.target.closest("a, button")||(O=v.current)==null||O.scrollTo({top:0,behavior:"smooth"})},onDblClick:E=>{E.target.closest("a, button")||te(!0)},class:a==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Pt,{}),e(he,{to:"/",class:"button plain",children:e(S,{icon:"home",size:"l",alt:g._({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"iDNBZe"})}),e("div",{class:"header-side",children:X&&e("button",{type:"button",class:"button plain4",onClick:()=>{B(!0)},children:e(S,{icon:"settings",size:"l",alt:g._({id:"a/+arl"})})})})]}),fe&&a!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{var E;te(!0),(E=v.current)==null||E.scrollTo({top:0,behavior:"smooth"})},children:[e(S,{icon:"arrow-up"})," ",e(u,{id:"Jy9RU/"})]})]}),_.length>0&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("details",{class:"announcements",children:[e("summary",{children:[e("span",{children:[e(S,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(u,{id:"0whvLM",values:{0:_.length}})," ",e("small",{class:"insignificant",children:s})]}),_.length>1&&e("span",{class:"announcements-nav-buttons",children:_.map((E,O)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{var re;(re=ye.current)==null||re.children[O].scrollIntoView({behavior:"smooth",block:"nearest"})},children:O+1}))})]}),e("ul",{class:`announcements-list-${_.length>1?"multiple":"single"}`,ref:ye,children:_.map(E=>e("li",{children:e(qr,{announcement:E})}))})]})})}),I.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(u,{id:"6Fs1Ba"})}),I.length>5?e("details",{children:[e("summary",{children:e(u,{id:"7dHKu4",values:{0:I.length}})}),e("ul",{children:I.map(E=>e("li",{children:[e(rt,{account:E}),e(Zn,{accountID:E.id,onChange:()=>{}})]},E.id))})]}):e("ul",{children:I.map(E=>e("li",{children:[e(rt,{account:E}),e(Zn,{accountID:E.id,onChange:()=>{}})]},E.id))})]}),X&&((P=q==null?void 0:q.summary)==null?void 0:P.pendingRequestsCount)>0&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"filtered-notifications",children:e("details",{onToggle:async E=>{const{open:O}=E.target;if(O){const re=await de();K(re)}},children:[e("summary",{children:e(u,{id:"N3Bq0f",values:{0:q.summary.pendingRequestsCount}})}),U?(U==null?void 0:U.length)>0&&e("ul",{children:U.map(E=>{var O,re;return e("li",{children:[e("div",{class:"request-notifcations",children:[!((O=E.lastStatus)!=null&&O.id)&&e(rt,{useAvatarStatic:!0,showStats:!0,account:E.account}),((re=E.lastStatus)==null?void 0:re.id)&&e("div",{class:"last-post",children:e(he,{class:"status-link",to:`/${s}/s/${E.lastStatus.id}`,children:e(Ye,{status:E.lastStatus,size:"s",readOnly:!0})})}),e(jr,{request:E})]}),e(Vr,{request:E,onChange:()=>{te(!0)}})]},E.id)})}):e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})})]})})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:m,onChange:E=>{d(E.target.checked)}})," ",e(u,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(u,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:me})]}),Ne&&e("p",{class:"ui-state insignificant",children:a==="default"?g._({id:"KS7iJH"}):e(z,{children:"…"})}),o.notifications.length?e(z,{children:o.notifications.filter(E=>E.type!=="follow_request").map(E=>{if(m&&E.type!=="mention")return null;const O=new Date(E.createdAt),re=O.toDateString()!==Le.toDateString();re&&(Le=O);const we=O.toDateString()===Re.toDateString()?g._({id:"y/0uwd"}):ht(Le,{hideTime:!0}),Ie=ht(Le,{forceOpts:{weekday:"long"}});return e(z,{children:[re&&e("h2",{class:"timeline-header",children:[e("span",{children:we})," ",e("small",{class:"insignificant bidi-isolate",children:Ie})]}),e(Rn,{instance:s,notification:E},E._ids||E.id)]},E._ids||E.id)})}):e(z,{children:[a==="loading"&&e(z,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((E,O)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(S,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"███████████ ████"})})]}))})}),a==="error"&&e("p",{class:"ui-state",children:[e(u,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>te(!0),children:e(u,{id:"KDw4GX"})})]})]}),p&&e(kt,{onChange:E=>{E&&te()},children:e("button",{type:"button",class:"plain block",disabled:a==="loading",onClick:()=>te(),style:{marginBlockEnd:"6em"},children:a==="loading"?e(Pe,{abrupt:!0}):e(u,{id:"uXRAkV"})})})]}),X&&j&&e(Fe,{onClick:E=>{E.target===E.currentTarget&&B(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>B(!1),children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:E=>{E.preventDefault();const{forNotFollowing:O,forNotFollowers:re,forNewAccounts:we,forPrivateMentions:Ie,forLimitedAccounts:J}=E.target,Me={...q,forNotFollowing:O.value,forNotFollowers:re.value,forNewAccounts:we.value,forPrivateMentions:Ie.value,forLimitedAccounts:J.value};ie(Me),B(!1),(async()=>{try{await i.v2.notifications.policy.update(Me),ue(g._({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(u,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:Br.map(E=>{const O=q[E];return e("div",{children:e("label",{children:[n(Ur[E]),e("select",{name:E,defaultValue:O,class:"small",children:[e("option",{value:"accept",children:e(u,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(u,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(u,{id:"gbbkE7"})})]})]})},E)})}),e("p",{children:e("button",{type:"submit",children:e(u,{id:"tfDRzk"})})})]})})]})})]})}function Hr(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function qr({announcement:t}){const{instance:n}=ae(),{contact:i}=cs(),s=i==null?void 0:i.account,{id:o,content:a,startsAt:h,endsAt:r,published:c,allDay:l,publishedAt:p,updatedAt:f,read:m,mentions:d,statuses:v,tags:b,emojis:y,reactions:w}=t,k=new Date(p),C=ht(k),I=new Date(f),T=ht(I);return e("div",{class:"announcement-block",children:[e(rt,{account:s}),e("div",{class:"announcement-content",onClick:hs({mentions:d,instance:n}),dangerouslySetInnerHTML:{__html:jn(a,{emojis:y})}}),e("p",{class:"insignificant",children:[e("time",{datetime:k.toISOString(),children:ht(k)}),f&&T!==C&&e(z,{children:[" ","•"," ",e("span",{class:"ib",children:e(u,{id:"TbFrLc",values:{0:ht(I)},components:{0:e("time",{datetime:I.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:w.map(_=>{const{name:x,count:$,me:N,staticUrl:D,url:V}=_;return e("button",{type:"button",class:`plain4 small ${N?"reacted":""}`,children:[V||D?e("img",{src:V||D,alt:x,width:"16",height:"16"}):e("span",{children:x})," ",e("span",{class:"count",children:Ke($)})]})})})]})}function Yr(t){const{masto:n}=ae();return n.v1.notifications.list({accountID:t})}function jr({request:t}){var f;const{instance:n}=ae(),[i,s]=L("loading"),{account:o,lastStatus:a}=t,[h,r]=L(!1),[c,l]=L([]);function p(){r(!1)}return se(()=>{var m;(m=t==null?void 0:t.account)!=null&&m.id&&h&&(s("loading"),(async()=>{const d=await Yr(t.account.id);l(d||[]),s("default")})())},[h,(f=t==null?void 0:t.account)==null?void 0:f.id]),e(z,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{r(!0)},children:[e(S,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(u,{id:"H0wUNM",values:{0:o.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(S,{icon:"chevron-down"})]}),h&&e(Fe,{onClick:m=>{m.target===m.currentTarget&&p()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:p,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"MXOmPt",values:{0:o.username},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):c.map(m=>e("div",{class:"notification-peek",onClick:d=>{const{target:v}=d;(d.target.tagName==="BUTTON"||d.target.tagName==="A")&&p()},children:e(Rn,{instance:n,notification:m,isStatic:!0})}))})]})})]})}function Vr({request:t,onChange:n}){const{masto:i}=ae(),[s,o]=L("default"),[a,h]=L(null),r=a!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||r,onClick:()=>{o("loading"),(async()=>{try{await i.v1.notifications.requests.$select(t.id).accept(),h("accept"),o("default"),n({request:t,state:"accept"}),ue(g._({id:"ZtBMwU",values:{0:t.account.username}}))}catch{o("error"),ue(g._({id:"S92JKG"}))}})()},children:e(u,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:s==="loading"||r,class:"light danger",onClick:()=>{o("loading"),(async()=>{try{await i.v1.notifications.requests.$select(t.id).dismiss(),h("dismiss"),o("default"),n({request:t,state:"dismiss"}),ue(g._({id:"ibBDry",values:{0:t.account.username}}))}catch{o("error"),ue(g._({id:"S5aemF"}))}})()},children:e(u,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:s==="loading"?e(Pe,{abrupt:!0}):a==="accept"?e(S,{icon:"check-circle",alt:g._({id:"bzMKg7"}),class:"notification-accepted"}):a==="dismiss"&&e(S,{icon:"x-circle",alt:g._({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const Xs=st(Fr),Gr=20;function Xn({local:t,columnMode:n,...i}){const s=qe(A),o=!!t,a=n?{}:$t(),{masto:h,instance:r}=ae({instance:(i==null?void 0:i.instance)||a.instance}),{masto:c,instance:l}=ae(),p=o?g._({id:"u96B/B",values:{instance:r}}):g._({id:"PgVqvd",values:{instance:r}});Xe(p,o?"/:instance?/p/l":"/:instance?/p");const f=Y(),m=Y();async function d(b){if(b||!m.current){const k={limit:Gr,local:o||void 0};!o&&Ze("@pixelfed/global-feed")&&(k.remote=!0),m.current=h.v1.timelines.public.list(k)}const y=await m.current.next();let{value:w}=y;return w!=null&&w.length&&(b&&(f.current=w[0].id),w.forEach(k=>{We(k,r)})),{...y,value:w}}async function v(){var b;try{const y=await h.v1.timelines.public.list({limit:1,local:o,since_id:f.current}).next();let{value:w}=y;const k=((b=w[0])==null?void 0:b.id)===f.current;return w!=null&&w.length&&!k?(w=Rt(w,"public"),!0):!1}catch{return!1}}return e(St,{title:p,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:o?g._({id:"pJQgQV"}):g._({id:"cg0I+x"})}),e("div",{children:r})]}),id:"public",instance:r,emptyText:g._({id:"BiZJ6G"}),errorText:g._({id:"scd9lw"}),fetchItems:d,checkForUpdates:v,useItemID:!0,headerStart:e(z,{}),boostsCarousel:s.settings.boostsCarousel,filterContext:"public",headerEnd:e(at,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(S,{icon:"more",size:"l",alt:g._({id:"2FYpfJ"})})}),children:[e(ke,{href:o?`/#/${r}/p`:`/#/${r}/p/l`,children:o?e(z,{children:[e(S,{icon:"transfer"})," ",e("span",{children:e(u,{id:"dXMiUw"})})]}):e(z,{children:[e(S,{icon:"transfer"})," ",e("span",{children:e(u,{id:"t2B/we"})})]})}),e(Ge,{}),e(ke,{onClick:()=>{let b=prompt(g._({id:"2MQ2cd"}));if(!/\./.test(b)){b&&alert(g._({id:"7WddtO"}));return}b&&(b=b.toLowerCase().trim(),location.hash=o?`/${b}/p/l`:`/${b}/p`)},children:[e(S,{icon:"bus"})," ",e("span",{children:e(u,{id:"Sq04Yc"})})]}),l!==r&&e(ke,{onClick:()=>{location.hash=o?`/${l}/p/l`:`/${l}/p`},children:[e(S,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"iAzCp4",values:{currentInstance:l},components:{0:e("b",{})}})})]})]})},r+o)}const ln=5,qn=40,Kr=new URLSearchParams,dn={block:"nearest",inline:"center",behavior:"smooth"};function Js({columnMode:t,...n}){const i=t?{}:$t(),{masto:s,instance:o,authenticated:a}=ae({instance:i.instance}),[h,r]=L("default"),[c]=t?[Kr]:ft(),l=Y(),p=(n==null?void 0:n.query)||c.get("q"),f=t?"statuses":(n==null?void 0:n.type)||c.get("type");let m=g._({id:"A1taO8"});if(p)switch(f){case"statuses":m=g._({id:"6YeoAt",values:{q:p}});break;case"accounts":m=g._({id:"fpgumQ",values:{q:p}});break;case"hashtags":m=g._({id:"AuiMZZ",values:{q:p}});break;default:m=g._({id:"wr3GZI",values:{q:p}})}Xe(m,"/search");const[d,v]=L(!1),b=Y(0);se(()=>{b.current=0},[p,f]);const y=Y();gt(()=>{var M,F;(F=(M=y.current)==null?void 0:M.scrollTo)==null||F.call(M,0,0)},[p,f]);const[w,k]=L([]),[C,I]=L([]),[T,_]=L([]);se(()=>{k([]),I([]),_([])},[p]);const x={statuses:w,accounts:C,hashtags:T},$={statuses:k,accounts:I,hashtags:_},[N,D]=L({}),V=async M=>{if(!(M!=null&&M.length))return;const F=await si(M,N);F&&D({...N,...F})};function G(M){M&&(b.current=0),!(!M&&!a)&&(r("loading"),M&&!f&&(k(w.slice(0,ln)),I(C.slice(0,ln)),_(T.slice(0,ln))),(async()=>{var U,K,de,te,fe,ve;const F={q:p,resolve:a,limit:ln};f&&(F.limit=qn,F.type=f,a&&(F.offset=b.current));try{const H=await s.v2.search.fetch(F);if(f)if(M){$[f](H[f]);const ce=(U=H[f])==null?void 0:U.length;b.current=qn,v(!!ce)}else if(((de=(K=H[f])==null?void 0:K[0])==null?void 0:de.id)===((fe=(te=x[f])==null?void 0:te[0])==null?void 0:fe.id))v(!1);else{$[f](Se=>[...Se,...H[f]]);const ce=(ve=H[f])==null?void 0:ve.length;b.current=b.current+qn,v(!!ce)}else k(H.statuses||[]),I(H.accounts||[]),_(H.hashtags||[]),b.current=0,v(!1);V(H.accounts),r("default")}catch{r("error")}})())}const X=Y();qt(M=>{var U;const F=((U=y.current)==null?void 0:U.scrollTop)===0;if(M&&F){const K=Date.now()-X.current;!X.current||K>1e3*3?G(!0):X.current=Date.now()}}),se(()=>{var F,U;let M;return(U=(F=l.current)==null?void 0:F.setValue)==null||U.call(F,p||""),p?G(!0):M=setTimeout(()=>{var K,de;(de=(K=l.current)==null?void 0:K.focus)==null||de.call(K)},150),()=>clearTimeout(M)},[p,f,o]),Be(["/","Slash"],M=>{var F,U,K,de;(U=(F=l.current)==null?void 0:F.focus)==null||U.call(F),(de=(K=l.current)==null?void 0:K.select)==null||de.call(K)},{preventDefault:!0});const j=".timeline > li > a, .hashtag-list > li > a",B=Be("j",()=>{const M=document.activeElement.closest(j),F=M==null?void 0:M.getBoundingClientRect(),U=Array.from(y.current.querySelectorAll(j));if(M&&F.top<y.current.clientHeight&&F.bottom>0){const K=U.indexOf(M);let de=U[K+1];de&&(de.focus(),de.scrollIntoView(dn))}else{const K=U.find(de=>{const te=de.getBoundingClientRect();return te.top>=44&&te.left>=0});K&&(K.focus(),K.scrollIntoView(dn))}}),q=Be("k",()=>{const M=document.activeElement.closest(j),F=M==null?void 0:M.getBoundingClientRect(),U=Array.from(y.current.querySelectorAll(j));if(M&&F.top<y.current.clientHeight&&F.bottom>0){const K=U.indexOf(M);let de=U[K-1];de&&(de.focus(),de.scrollIntoView(dn))}else{const K=U.find(de=>{const te=de.getBoundingClientRect();return te.top>=44&&te.left>=0});K&&(K.focus(),K.scrollIntoView(dn))}}),[ie]=ui();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:M=>{y.current=M,B(M),q(M)},children:e("div",{class:"timeline-deck deck",children:[e("header",{class:h==="loading"?"loading":"",children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:e(Pt,{})}),e(Os,{ref:l}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{G(!0)},disabled:h==="loading",children:e(S,{icon:"search",size:"l",alt:g._({id:"A1taO8"})})})})]})}),e("main",{children:[!!p&&!t&&e("div",{ref:ie,class:`filter-bar ${h==="loading"?"loading":""}`,children:[!!f&&e(he,{to:`/search${p?`?q=${encodeURIComponent(p)}`:""}`,children:[e(S,{icon:"chevron-left"})," ",e(u,{id:"N40H+G"})]}),[{label:g._({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(p)}&type=accounts`},{label:g._({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(p)}&type=hashtags`},{label:g._({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(p)}&type=statuses`}].sort((M,F)=>M.type===f?-1:F.type===f?1:0).map(M=>e(he,{to:M.to,children:M.label},M.type))]}),p?e(z,{children:[(!f||f==="accounts")&&e(z,{children:[f!=="accounts"&&e("h2",{class:"timeline-header",children:[e(u,{id:"bPwFdf"})," ",e(he,{to:`/search?q=${encodeURIComponent(p)}&type=accounts`,children:e(S,{icon:"arrow-right",size:"l",alt:g._({id:"V1fa9u"})})})]}),C.length>0?e(z,{children:[e("ul",{class:"timeline flat accounts-list",children:C.map(M=>e("li",{children:e(rt,{account:M,instance:o,showStats:!0,relationship:N[M.id]})},M.id))}),f!=="accounts"&&e("div",{class:"ui-state",children:e(he,{class:"plain button",to:`/search?q=${encodeURIComponent(p)}&type=accounts`,children:[e(u,{id:"BMmtZ8"})," ",e(S,{icon:"arrow-right"})]})})]}):!f&&(h==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"YYB61U"})}))]}),(!f||f==="hashtags")&&e(z,{children:[f!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(u,{id:"VwUsHI"})," ",e(he,{to:`/search?q=${encodeURIComponent(p)}&type=hashtags`,children:e(S,{icon:"arrow-right",size:"l",alt:g._({id:"V1fa9u"})})})]}),T.length>0?e(z,{children:[e("ul",{class:"link-list hashtag-list",children:T.map(M=>{var de;const{name:F,history:U}=M,K=(de=U==null?void 0:U.reduce)==null?void 0:de.call(U,(te,fe)=>te+ +fe.uses,0);return e("li",{children:e(he,{to:o?`/${o}/t/${F}`:`/t/${F}`,children:[e(S,{icon:"hashtag",alt:"#"}),e("span",{children:F}),!!K&&e("span",{class:"count",children:Ke(K)})]})},`${F}-${K}`)})}),f!=="hashtags"&&e("div",{class:"ui-state",children:e(he,{class:"plain button",to:`/search?q=${encodeURIComponent(p)}&type=hashtags`,children:[e(u,{id:"Nc/W5J"})," ",e(S,{icon:"arrow-right"})]})})]}):!f&&(h==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"4MFM3P"})}))]}),(!f||f==="statuses")&&e(z,{children:[f!=="statuses"&&e("h2",{class:"timeline-header",children:[e(u,{id:"+owNNn"})," ",e(he,{to:`/search?q=${encodeURIComponent(p)}&type=statuses`,children:e(S,{icon:"arrow-right",size:"l",alt:g._({id:"V1fa9u"})})})]}),w.length>0?e(z,{children:[e("ul",{class:"timeline",children:w.map(M=>e("li",{children:e(he,{class:"status-link",to:o?`/${o}/s/${M.id}`:`/s/${M.id}`,children:e(Ye,{status:M})})},M.id))}),f!=="statuses"&&e("div",{class:"ui-state",children:e(he,{class:"plain button",to:`/search?q=${encodeURIComponent(p)}&type=statuses`,children:[e(u,{id:"LYCgej"})," ",e(S,{icon:"arrow-right"})]})})]}):!f&&(h==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"Hzi9AA"})}))]}),!!f&&(h==="default"?d?e(kt,{onChange:M=>{M&&G()},children:e("button",{type:"button",class:"plain block",onClick:()=>G(),style:{marginBlockEnd:"6em"},children:e(u,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(u,{id:"2EYeAZ"})}):h==="loading"&&e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}))]}):h==="loading"?e("p",{class:"ui-state",children:e(Pe,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"fGn1Hk"})})]})]})})}const Wr=20,Qs=10*60*1e3,Zr=_t(t=>t.v1.trends.links.list().next(),{maxAge:Qs}),Xr=_t(t=>t.v1.trends.tags.list().next(),{maxAge:Qs});function Jr(t){return Ze("@pixelfed/trending")?t.pixelfed.v2.discover.posts.trending.list({range:"daily"}):t.v1.trends.statuses.list({limit:Wr})}function Qr(t,n){return t.v1.timelines.link.list(n)}function eo({columnMode:t,...n}){const i=qe(A),s=t?{}:$t(),{masto:o,instance:a}=ae({instance:(n==null?void 0:n.instance)||s.instance}),{masto:h,instance:r}=ae(),c=g._({id:"cI3UEs",values:{instance:a}});Xe(c,"/:instance?/trending");const l=Y(),p=a===r,[f,m]=L([]),[d,v]=L([]),b=Y();async function y(X){var q;if(X||!b.current){if(b.current=Jr(o),Ze("@mastodon/trending-hashtags"))try{const{value:ie}=await Xr(o);ie!=null&&ie.length&&m(ie)}catch{}if(Ze("@mastodon/trending-links"))try{const{value:ie}=await Zr(o,a),M=(q=ie==null?void 0:ie.filter)==null?void 0:q.call(ie,F=>F.type==="link");M!=null&&M.length&&v(M)}catch{}}const j=await b.current.next();let{value:B}=j;return B!=null&&B.length&&(X&&(l.current=B[0].id),B.forEach(ie=>{We(ie,a)})),{...j,value:B}}const[w,k]=L(!1),C=Y(),[I,T]=L(null),_=!!I,x=Y(),$=p&&Ze("@mastodon/trending-link-posts");se(()=>{I&&x.current&&x.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[I]);const N=Y();async function D(X){(X||!C.current)&&(k(!0),C.current=Qr(o,{url:I})),N.current=I;const j=await C.current.next();let{value:B}=j;return B!=null&&B.length&&(B=Rt(B,"public"),B.forEach(q=>{We(q,a)})),N.current===I&&k(!1),{...j,value:B}}async function V(){try{const X=await o.v1.trends.statuses.list({limit:1}).next();let{value:j}=X;return j=Rt(j,"public"),j!=null&&j.length&&j[0].id!==l.current?(l.current=j[0].id,!0):!1}catch{return!1}}const G=_e(()=>e(z,{children:[!!f.length&&e("div",{class:"filter-bar expandable",children:[e(S,{icon:"chart",class:"insignificant",size:"l"}),f.map((X,j)=>{const{name:B,history:q}=X,ie=q.reduce((M,F)=>M+ +F.uses,0);return e(he,{to:`/${a}/t/${B}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),B]}),e("span",{class:"filter-count",children:Ke(ie)})]},B)})]}),!!d.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(u,{id:"9veeTb"})})}),d.map(X=>{var ee,ge;const{authors:j,authorName:B,authorUrl:q,blurhash:ie,description:M,height:F,image:U,imageDescription:K,language:de,providerName:te,providerUrl:fe,publishedAt:ve,title:H,url:ce,width:Se}=X,Ee=(ge=(ee=j==null?void 0:j[0])==null?void 0:ee.account)!=null&&ge.id?j[0].account:null,Re=H.length<30,Le=!!(B||Ee),Ne=Dt.toUnicode(URL.parse(ce).hostname.replace(/^www\./,"").replace(/\/$/,""));let ye;if(ie){const xe=oi(ie),le=bi(xe);ye=gi([.6,le[1],le[2]])}return e("div",{children:[e("a",{ref:I===ce?x:null,href:ce,target:"_blank",rel:"noopener noreferrer",class:`link-block ${_?I===ce?"active":"inactive":""}`,style:ye?{"--accent-color":`rgb(${ye.join(",")})`,"--accent-alpha-color":`rgba(${ye.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:U,alt:K,width:Se,height:F,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:Ne})," ",!!ve&&e(z,{children:"· "}),!!ve&&e(z,{children:e(Kt,{datetime:ve,format:"micro"})})]}),!!H&&e("h1",{class:"title",lang:de,dir:"auto",title:H,children:H})]}),!!M&&e("p",{class:`description ${Le&&!Re?"":"more-lines"}`,lang:de,dir:"auto",title:M,children:M}),Le&&e(z,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(u,{id:"aavdrC",values:{0:Ee?e(mt,{account:Ee,showAvatar:!0}):q?e("a",{href:q,target:"_blank",rel:"noopener noreferrer",children:B}):B}})})})]})]})]})}),$&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{T(ce)},disabled:ce===I,children:[e(S,{icon:"comment2"})," ",e("span",{children:e(u,{id:"/bZzdR"})})," ",e(S,{icon:"chevron-down"})]})]},ce)})]}),$&&!!d.length&&e("div",{class:`timeline-header-block ${_?"blended":""}`,children:_?e(z,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:w?e(Pe,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{T(null)},children:e(S,{icon:"x",alt:g._({id:"9Q/4xJ"})})})}),e("p",{children:e(u,{id:"BATCqf",values:{0:I.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(u,{id:"Vosm4k"})})})]}),[f,d,I,w]);return e(St,{title:c,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(u,{id:"4/iCqx"})}),e("div",{children:a})]}),id:"trending",instance:a,emptyText:g._({id:"6HA9+s"}),errorText:g._({id:"scd9lw"}),fetchItems:_?D:y,checkForUpdates:_?void 0:V,checkForUpdatesInterval:5*60*1e3,useItemID:!0,headerStart:e(z,{}),boostsCarousel:i.settings.boostsCarousel,filterContext:"public",timelineStart:G,refresh:I,clearWhenRefresh:!0,view:_?"link-mentions":void 0,headerEnd:e(at,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(S,{icon:"more",size:"l",alt:g._({id:"2FYpfJ"})})}),children:[e(ke,{onClick:()=>{let X=prompt(g._({id:"2MQ2cd"}));if(!/\./.test(X)){X&&alert(g._({id:"7WddtO"}));return}X&&(X=X.toLowerCase().trim(),location.hash=`/${X}/trending`)},children:[e(S,{icon:"bus"})," ",e("span",{children:e(u,{id:"Sq04Yc"})})]}),r!==a&&e(ke,{onClick:()=>{location.hash=`/${r}/trending`},children:[e(S,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"iAzCp4",values:{currentInstance:r},components:{0:e("b",{})}})})]})]})},a)}const Zi={block:"nearest",inline:"nearest",behavior:"smooth"};function el(){Xe(g._({id:"i0qMbr"}),"/");const t=qe(A),{shortcuts:n}=t,i=n.map(s=>{if(!s)return null;const{type:o,...a}=s,h={following:wi,notifications:Xs,list:qs,public:Xn,bookmarks:Bs,favourites:Us,hashtag:Hs,mentions:Gs,trending:eo,search:Js}[o];return!h||o==="search"&&!a.query||o==="list"&&!a.id?null:e(h,{...a,columnMode:!0},o+JSON.stringify(a))});return Be(["1","2","3","4","5","6","7","8","9"],(s,o)=>{try{const a=parseInt(o.keys[0],10)-1,h=document.querySelectorAll("#columns > *")[a];h&&(h.focus(),h.scrollIntoView(Zi))}catch{}}),Be(["[","]"],(s,o)=>{const a=o.keys[0],h=document.activeElement.closest("#columns > *"),r=Et(),c=r?"]":"[",l=r?"[":"]";let p;a===c?p=h?h.previousElementSibling:document.querySelectorAll("#columns > *")[0]:a===l&&(p=h?h.nextElementSibling:document.querySelectorAll("#columns > *")[1]),p&&(p.focus(),p.scrollIntoView(Zi))}),e("div",{id:"columns",onContextMenu:s=>{s.target.closest(".deck > header")&&!s.target.closest("a")&&!s.target.closest("button")&&(s.preventDefault(),A.showShortcutsSettings=!0)},onFocus:()=>{const s=document.activeElement.closest("#columns > *");s&&document.querySelectorAll("#columns > *").forEach(o=>{o.classList.toggle("focus",o===s)})},children:i})}function tl(){var i;const{_:t}=Qe(),n=qe(A);return __BENCHMARK.end("time-to-home"),se(()=>{(async()=>{const s=await ut.drafts.keys();if(s.length){const o=yn();s.filter(h=>h.startsWith(o)).length&&(A.showDrafts=!0)}})()},[]),e(z,{children:(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&((i=n.shortcuts)!=null&&i.length)?e(el,{}):e(wi,{title:t({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(nl,{})})})}function nl(){const t=qe(A),n=Y(),[i,s]=L(void 0);return e(z,{children:[e(he,{ref:n,to:"/notifications",class:`button plain notifications-button ${t.notificationsShowNew?"has-badge":""} ${i||""}`,onClick:o=>{o.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(o.preventDefault(),s(a=>a?void 0:"open"))},children:e(S,{icon:"notification",size:"l",alt:g._({id:"iDNBZe"})})}),e(sl,{state:i,anchorRef:n,onClose:()=>s(void 0)})]})}const il=5;function sl({anchorRef:t,state:n,onClose:i}){const{masto:s,instance:o}=ae(),a=qe(A),[h,r]=L("default"),c=Ws();async function l(){const b=await c.next(),y=Vs(b.value);if(y!=null&&y.length){y.forEach(k=>{We(k.status,o,{skipThreading:!0})});const w=Zs(y);A.notificationsLast=w[0],A.notifications=w,s.v1.markers.create({notifications:{lastReadId:w[0].id}}).catch(()=>{})}return A.notificationsShowNew=!1,A.notificationsLastFetchTime=Date.now(),b}const[p,f]=L(!1);function m(){return s.v1.followRequests.list({limit:1})}function d(){r("loading"),(async()=>{try{await l();const b=await m();f(!!(b!=null&&b.length)),r("default")}catch{r("error")}})()}se(()=>{n==="open"&&d()},[n]);const v=Y();return e(bs,{ref:v,menuClassName:"notifications-menu",state:n,anchorRef:t,onClose:i,portal:{target:document.body},containerProps:{onClick:()=>{var b,y;(y=(b=v.current)==null?void 0:b.closeMenu)==null||y.call(b)}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(u,{id:"iDNBZe"})})}),e("main",{children:a.notifications.length?e(z,{children:a.notifications.slice(0,il).map(b=>e(Rn,{instance:o,notification:b,disableContextMenu:!0},b._ids||b.id))}):h==="loading"?e("div",{class:"ui-state",children:e(Pe,{abrupt:!0})}):h==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(u,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:d,children:e(u,{id:"KDw4GX"})})})]})}),e("footer",{children:[e(he,{to:"/mentions",class:"button plain",children:[e(S,{icon:"at"})," ",e("span",{children:e(u,{id:"/bZzdR"})})]}),e(he,{to:"/notifications",class:"button plain2",children:[p?e(u,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(u,{id:"gukqfD"})})," ",e(S,{icon:"arrow-right"})]})]})]})}const ol=st(tl),cl=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function to(t){const{hostname:n,pathname:i}=URL.parse(t);for(const s of cl){const[,o]=i.match(s)||[];if(o)return{instance:n,id:o}}return{}}function al(t){const{instance:n,id:i}=to(t);return n&&i?`/${n}/s/${i}`:null}function rl(){const n=Gt().pathname.replace(/^\//,""),i=to(n),s=i!=null&&i.instance?`/${i.instance}/s/${i.id}`:null,[o,a]=L("loading");return gt(()=>{a("loading"),(async()=>{try{const{instance:h,id:r}=i;if(r){const{masto:c}=ae({instance:h});if(await c.v1.statuses.$select(r).fetch()){window.location.hash=s+"?view=full";return}}}catch{}{const{masto:h,instance:r}=ae(),c=await h.v2.search.fetch({q:n,limit:1,resolve:!0});if(c.statuses.length){const l=c.statuses[0];window.location.hash=`/${r}/s/${l.id}?view=full`}else if(c.accounts.length){const l=c.accounts[0];window.location.hash=`/${r}/a/${l.id}`}else s?window.location.hash=s+"?view=full":a("error")}})()},[s]),e("div",{class:"ui-state",tabIndex:"-1",children:[o==="loading"?e(z,{children:[e(Pe,{abrupt:!0}),e("h2",{children:e(u,{id:"RTAr/z"})}),e("p",{children:e("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:n})})]}):e(z,{children:[e("h2",{children:e(u,{id:"ufzZSJ"})}),e("p",{children:e("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:n})})]}),e("hr",{}),e("p",{children:e(he,{to:"/",children:e(u,{id:"iWpEwy"})})})]})}function ll(){Xe(g._({id:"h16FyT"}),"/l");const[t,n]=L("default"),[i,s]=Mt(c=>c+1,0),[o,a]=L([]);se(()=>{n("loading"),(async()=>{try{const c=await Wn();a(c),n("default")}catch{n("error")}})()},[i]);const[h,r]=L(!1);return e("div",{id:"lists-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Pt,{}),e(he,{to:"/",class:"button plain",children:e(S,{icon:"home",size:"l"})})]}),e("h1",{children:e(u,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>r(!0),children:e(S,{icon:"plus",size:"l",alt:g._({id:"Sb2gYF"})})})})]})}),e("main",{children:o.length>0?e(z,{children:[e("ul",{class:"link-list",children:o.map(c=>e("li",{children:e(he,{to:`/l/${c.id}`,children:e("span",{children:[e(S,{icon:"list"})," ",e("span",{children:c.title})]})})}))}),o.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(u,{id:"8prZNK",values:{0:o.length}})})})]}):t==="loading"?e("p",{class:"ui-state",children:e(Pe,{})}):t==="error"?e("p",{class:"ui-state",children:e(u,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(u,{id:"IvPikw"})})})]}),h&&e(Fe,{onClick:c=>{c.target===c.currentTarget&&r(!1)},children:e(mi,{list:h==null?void 0:h.list,onClose:c=>{c.state==="success"&&s(),r(!1)}})})]})}const dl=""+new URL("instances-CwO9tuGQ.json",import.meta.url).href;function ul(t){return("0"+t.toString(16)).slice(-2)}function hl(){var t=new Uint32Array(28);return window.crypto.getRandomValues(t),Array.from(t,ul).join("")}function fl(t){const i=new TextEncoder().encode(t);return window.crypto.subtle.digest("SHA-256",i)}function pl(t){let n="";const i=new Uint8Array(t),s=i.byteLength;for(var o=0;o<s;o++)n+=String.fromCharCode(i[o]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function no(t){const n=await fl(t);return pl(n)}async function ml({instanceURL:t}){var n;if(!t)return!1;try{const i=await fetch(`https://${t}/.well-known/oauth-authorization-server`);return!i.ok||i.status!==200?!1:!!((n=(await i.json()).code_challenge_methods_supported)!=null&&n.includes("S256"))}catch{return!1}}window.__generateCodeChallenge=no;const gl={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",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",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{DEV:bl,PHANPY_CLIENT_NAME:vl,PHANPY_WEBSITE:In}=gl,Ln="read write follow push",yl=In?In.toLowerCase().includes(location.hostname):!1,wl=location.origin+location.pathname,Mn=bl||!yl?wl:In;async function kl({instanceURL:t}){const n=new URLSearchParams({client_name:vl,redirect_uris:Mn,scopes:Ln,website:In});return await(await fetch(`https://${t}/api/v1/apps`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})).json()}async function _l({instanceURL:t,client_id:n}){const i=hl(),s=await no(i),o=new URLSearchParams({client_id:n,code_challenge_method:"S256",code_challenge:s,redirect_uri:Mn,response_type:"code",scope:Ln});return[`https://${t}/oauth/authorize?${o.toString()}`,i]}async function Sl({instanceURL:t,client_id:n}){const i=new URLSearchParams({client_id:n,scope:Ln,redirect_uri:Mn,response_type:"code"});return`https://${t}/oauth/authorize?${i.toString()}`}async function Cl({instanceURL:t,client_id:n,client_secret:i,code:s,code_verifier:o}){const a=new URLSearchParams({client_id:n,redirect_uri:Mn,grant_type:"authorization_code",code:s,scope:Ln});return i&&a.append("client_secret",i),o&&a.append("code_verifier",o),await(await fetch(`https://${t}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a.toString()})).json()}const Il={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",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",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Tl}=Il;function xl(){var k,C;Xe("Log in");const t=Y(),n=be.local.get("instanceURL"),[i,s]=L("default"),[o]=ft(),a=o.get("instance"),h=o.get("submit"),[r,c]=L(a||(n==null?void 0:n.toLowerCase())||""),[l,p]=L([]),f=Y();se(()=>{(async()=>{try{const T=await(await fetch(dl)).json();p(T),f.current=new qo(T)}catch{}})()},[]);const m=I=>{I&&(async()=>{try{const _=await(await fetch(`https://${I}/.well-known/host-meta`)).text(),D=new DOMParser().parseFromString(_,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),V=URL.parse(D),{host:G}=V;I!==G&&(I=G)}catch{}be.local.set("instanceURL",I),s("loading");try{const{client_id:T,client_secret:_,vapid_key:x}=await kl({instanceURL:I});if(await ml({instanceURL:I}))if(T&&_){be.sessionCookie.set("clientID",T),be.sessionCookie.set("clientSecret",_),be.sessionCookie.set("vapidKey",x);const[N,D]=await _l({instanceURL:I,client_id:T});be.sessionCookie.set("codeVerifier",D),location.href=N}else alert(g._({id:"ZP1FIA"}));else T&&_?(be.sessionCookie.set("clientID",T),be.sessionCookie.set("clientSecret",_),be.sessionCookie.set("vapidKey",x),location.href=await Sl({instanceURL:I,client_id:T})):alert(g._({id:"ZP1FIA"}));s("default")}catch{s("error")}})()},d=r?r.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,v=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(d)&&!/[\s\/\\@]/.test(d),b=d?(C=(k=f.current)==null?void 0:k.search(d,{limit:10}))==null?void 0:C.map(I=>I.item):[],y=v?d:b!=null&&b.length?b[0]:r?l.find(I=>I.includes(r)):null,w=I=>{I.preventDefault(),m(y)};return h&&se(()=>{m(a||y)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:w,children:[e("h1",{children:[e("img",{src:hi,alt:"",width:"80",height:"80"}),e("br",{}),e(u,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(u,{id:"kyAi7k"})}),e("input",{value:r,required:!0,type:"text",class:"large",id:"instanceURL",ref:t,disabled:i==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:g._({id:"u3gOdY"}),onInput:I=>{c(I.target.value)},dir:"auto"}),(b==null?void 0:b.length)>0?e("ul",{id:"instances-suggestions",children:b.map((I,T)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{m(I)},children:I})}))}):e("div",{id:"instances-eg",children:e(u,{id:"/OvbEC"})})]}),i==="error"&&e("p",{class:"error",children:e(u,{id:"rmBHZn"})}),e("div",{children:[e("button",{disabled:i==="loading"||!r||!y,children:y?g._({id:"2xahsi",values:{selectedInstanceText:y}}):g._({id:"xGVfLh"})})," "]}),e(Pe,{hidden:i!=="loading"}),e("hr",{}),!Tl&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(u,{id:"LcOiWS"})})}),e("p",{children:e(he,{to:"/",children:e(u,{id:"iWpEwy"})})}),e(fi,{})]})})}const Al={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",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",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Xi}=Al,un=40,El=10,Rl=5;let Jn={},mn={},gn={};function bn(t){delete mn[t],delete gn[t]}const Xt={block:"nearest",inline:"center",behavior:"smooth"},Ji=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",Qi=/\/s\//i;function Ll(t){var I;const{id:n}=t,{masto:i,instance:s}=ae({instance:t.instance}),o=qe(A),[a,h]=ft(),r=a.get("media"),c=a.get("media-only"),l=parseInt(r||c,10);let p=l>0;const f=a.get("mediaStatusID"),m=ds(f,s);f&&!m&&(p=!1);const d=p&&!!c,v=it(n,s),[b,y]=L(A.statuses[v]);se(()=>{A.statuses[v]&&y(A.statuses[v])},[v]);const w=_e(()=>{const{prevLocation:T}=A,_=((T==null?void 0:T.pathname)||"")+((T==null?void 0:T.search)||""),x=tn("/:instance/s/:id",_)||tn("/s/:id",_);return!_||x?"/":_},[]);se(()=>{!b&&p&&(async()=>{try{const T=await i.v1.statuses.$select(n).fetch();We(T,s),y(T)}catch{alert("Unable to load post."),location.hash=w}})()},[p]);const k=f?(I=o.statuses[it(f,s)])==null?void 0:I.mediaAttachments:b==null?void 0:b.mediaAttachments,C=ct(()=>{!window.matchMedia("(min-width: calc(40em + 350px))").matches&&o.prevLocation?history.back():d?location.hash=w:(a.delete("media"),a.delete("mediaStatusID"),h(a))},[d,w,o.prevLocation]);return se(()=>{let T=setTimeout(()=>{const _=document.querySelector(".carousel");_&&_.focus()},100);return()=>clearTimeout(T)},[d]),se(()=>{const T=document.querySelectorAll(".deck-container");return T.forEach(_=>{_.setAttribute("inert","")}),()=>{T.forEach(_=>{_.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[p?k!=null&&k.length?e(Ns,{mediaAttachments:k,statusID:f||n,instance:s,lang:b==null?void 0:b.language,index:l-1,onClose:C}):e("div",{class:"media-modal-container loading",children:e(Pe,{abrupt:!0})}):e(he,{to:w}),!d&&e($l,{id:n,instance:t.instance,closeLink:w})]})}function Ml(t){const{linkable:n,to:i,onClick:s,...o}=t;return n?e(he,{class:"status-link",to:i,onClick:s,...o}):e("div",{class:"status-focus",tabIndex:0,...o})}function es(t,n){return new Date(n.created_at)-new Date(t.created_at)}function $l({id:t,closeLink:n="/",instance:i}){var Z,me;const[s,o]=ft(),a=s.get("media"),h=s.get("mediaStatusID"),r=parseInt(a,10)>0,c=Y(!A.prevLocation&&(history.length===1||"navigation"in window&&((me=(Z=navigation==null?void 0:navigation.entries)==null?void 0:Z.call(navigation))==null?void 0:me.length)===1)),[l,p]=L(s.get("view")||c.current?"full":null),f=!!parseInt(s.get("translate")),{masto:m,instance:d}=ae({instance:i}),{masto:v,instance:b,authenticated:y}=ae(),w=d===b,k=qe(A),[C,I]=L([]),[T,_]=L("default"),x=Y(),$=it(t,d),N=Y(0),D=Y();se(()=>{var P;(P=D.current)==null||P.focus()},[]),se(()=>{var E;const P=ws(()=>{if(!D.current)return;const{scrollTop:O}=D.current;T!=="loading"&&(gn[t]=O)},50);return(E=D.current)==null||E.addEventListener("scroll",P,{passive:!0}),P(),()=>{var O;P.cancel(),(O=D.current)==null||O.removeEventListener("scroll",P)}},[t,T!=="loading"]);const V=Y(),G=Y(),X=({reloadHero:P}={})=>{_("loading");let E;const O=mn[t];if(O){const re=O.filter(we=>A.statuses[$]);I(re)}else I([{id:t}]);return(async()=>{var Me,Oe;const re=()=>xi(()=>m.v1.statuses.$select(t).fetch(),{retries:4}),we=xi(()=>m.v1.statuses.$select(t).context.fetch(),{retries:8}),Ie=!!k.statuses[$];let J=k.statuses[$];if(!(Ie&&!P))try{J=await re(),We(J,d),await new Promise(R=>{setTimeout(R,100)})}catch{_("error");return}try{let R=function(pe,De){const Je=De+1;return Je>Ae&&(Ae=De),pe==null?void 0:pe.map(Ce=>({id:Ce.id,account:Ce.account,repliesCount:Ce.repliesCount,content:Ce.content,weight:en(Ce),level:Je,replies:R(Ce.__replies,Je)}))};const Q=await we,{ancestors:oe,descendants:W}=Q;oe.sort(es),W.sort(es),N.current=(W==null?void 0:W.length)||0;const ne=new Set;oe.forEach(pe=>{We(pe,d,{skipThreading:!0}),pe.inReplyToId&&!oe.find(De=>De.id===pe.inReplyToId)&&ne.add(pe.inReplyToId)});const $e=oe.every(pe=>pe.account.id===J.account.id),Te=[];W.forEach(pe=>{if(We(pe,d,{skipThreading:!0}),pe.inReplyToId&&!W.find(De=>De.id===pe.inReplyToId)&&pe.inReplyToId!==J.id&&ne.add(pe.inReplyToId),pe.inReplyToAccountId===pe.account.id)Te.push(pe);else if(pe.inReplyToId===J.id)Te.push(pe);else if(!pe.inReplyToAccountId&&Te.find(De=>De.id===pe.inReplyToId&&De.account.id===J.account.id)&&pe.account.id===J.account.id)Te.push(pe);else{const De=W.find(Je=>Je.id===pe.inReplyToId);De&&(De.__replies||(De.__replies=[]),De.__replies.push(pe))}}),Te.sort((pe,De)=>{const Je=J.account.id;return pe.account.id===Je&&De.account.id!==Je?-1:De.account.id===Je&&pe.account.id!==Je?1:0}),ne.size;let Ae=1;const ze=[...oe.map(pe=>({id:pe.id,ancestor:!0,isThread:$e,accountID:pe.account.id,account:pe.account,repliesCount:pe.repliesCount,weight:en(pe)})),{id:t,accountID:J.account.id,weight:en(J)},...Te.map(pe=>({id:pe.id,account:pe.account,accountID:pe.account.id,descendant:!0,thread:pe.account.id===J.account.id,weight:en(pe),level:1,replies:R(pe.__replies,1)}))];_("default"),V.current={offsetTop:(Me=x.current)==null?void 0:Me.offsetTop,scrollTop:(Oe=D.current)==null?void 0:Oe.scrollTop};const He=oe.length||0;He>=K&&de(He+1),I(ze),mn[t]=ze,yo(J,d)}catch{_("error")}})(),G.current=Date.now(),()=>{clearTimeout(E)}};se(X,[t,m]);const[j,B]=L(!1);se(()=>{let P=setInterval(()=>{const E=Date.now();G.current&&E-G.current>=6e4&&B(!0)},6e4);return()=>{clearInterval(P)}},[]),gt(()=>{var E,O;if(!C.length)return;const P=gn[t];if(P)D.current.scrollTop=P;else if(V.current){const re={offsetTop:(E=x.current)==null?void 0:E.offsetTop,scrollTop:(O=D.current)==null?void 0:O.scrollTop},we=re.offsetTop-V.current.offsetTop+re.scrollTop;D.current.scrollTop=we}else C.length===1&&(D.current.scrollTop=0);V.current=null},[C]),se(()=>{k.reloadStatusPage<=0||(async()=>{try{const{instanceURL:P}=ei(),E=`https://${P}/api/v1/statuses/${t}/context`;return await(await caches.open("api")).delete(E,{ignoreVary:!0}),X({reloadHero:!0})}catch{}})()},[k.reloadStatusPage]),se(()=>()=>{gn={},A.reloadStatusPage=0,mn={},Jn={},Qn.clear()},[]);const q=k.statuses[$]||k.statuses[t],ie=_e(()=>{if(!q)return"";const{account:P}=q,E=document.createElement("div");return E.innerHTML=P.displayName,E.innerText.trim()},[q]),M=_e(()=>{if(!q)return"";let P=ci(q);return P.length>64&&(P=P.slice(0,64)+"…"),P},[q]);Xe(ie&&M?`${ie}: "${M}"`:g._({id:"post.title"}),"/:instance?/s/:id");const F=_e(()=>{if(!q)return;const{url:P}=q;if(P)return URL.parse(P).hostname},[q]),U=_e(()=>{if(F)return F===d},[F,d]),[K,de]=L(un),te=_e(()=>C.length-K,[C.length,K]),fe=C.some(P=>P.descendant),ve=C.filter(P=>P.ancestor),[H,ce]=L(!0),Se=_e(()=>{if(!x.current||H)return null;const{top:P}=x.current.getBoundingClientRect();return P>0?"down":"up"},[H]);Be("esc",()=>{location.hash=n},{enabled:!r,ignoreEventWhen:P=>!!document.querySelector("#modal-container > *")}),Be("backspace",()=>{location.hash=n}),Be("j",()=>{const P=document.activeElement.closest(".status-link, .status-focus"),E=P==null?void 0:P.getBoundingClientRect(),O=Array.from(D.current.querySelectorAll(Ji));if(P&&E.top<D.current.clientHeight&&E.bottom>0){const re=O.indexOf(P);let we=O[re+1];we&&(we.focus(),we.scrollIntoView(Xt))}else{const re=O.find(we=>{const Ie=we.getBoundingClientRect();return Ie.top>=44&&Ie.left>=0});re&&(re.focus(),re.scrollIntoView(Xt))}}),Be("k",()=>{const P=document.activeElement.closest(".status-link, .status-focus"),E=P==null?void 0:P.getBoundingClientRect(),O=Array.from(D.current.querySelectorAll(Ji));if(P&&E.top<D.current.clientHeight&&E.bottom>0){const re=O.indexOf(P);let we=O[re-1];we&&(we.focus(),we.scrollIntoView(Xt))}else{const re=O.find(we=>{const Ie=we.getBoundingClientRect();return Ie.top>=44&&Ie.left>=0});re&&(re.focus(),re.scrollIntoView(Xt))}}),Be("x",()=>{const P=document.activeElement.closest(".status-link, .status-focus");if(P){const E=P.nextElementSibling;E&&E.tagName.toLowerCase()==="details"&&(E.open=!E.open)}});const[Ee,Re]=L(!1),Le=Y(r?"media+status":"status"),Ne=ct((P,E,O,re)=>{P.preventDefault(),P.stopPropagation(),o({media:E+1,mediaStatusID:re.id})},[t]),ye=ct((P,E)=>{bn(E.id)},[]);se(()=>{let P;return h&&r&&(P=setTimeout(()=>{var O;const E=(O=D.current)==null?void 0:O.querySelector(`.status-link[href*="/${h}"]`);E&&E.scrollIntoView(Xt)},400)),()=>{clearTimeout(P)}},[h,r]);const ee=ct((P,E)=>{const{id:O,ancestor:re,isThread:we,descendant:Ie,thread:J,replies:Me,repliesCount:Oe,weight:R,level:Q}=P,oe=O===t;return e("li",{ref:oe?x:null,class:`${re?"ancestor":""} ${Ie?"descendant":""} ${J?"thread":""} ${oe?"hero":""}`,children:[oe?e(z,{children:[e(kt,{threshold:.1,onChange:ne=>{queueMicrotask(()=>{requestAnimationFrame(()=>{ce(ne)})})},class:"status-focus",tabIndex:0,children:e(Ye,{statusID:O,instance:d,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:f})}),T!=="loading"&&!y?e("div",{class:"post-status-banner",children:[e("p",{children:e(u,{id:"Vyeh4F"})}),e(he,{to:Xi?`/login?instance=${Xi}&submit=1`:"/login",class:"button",children:e(u,{id:"sQia9P"})})]}):!w&&e("div",{class:"post-status-banner",children:[e("p",{children:e(u,{id:"j5roNG",values:{instance:d},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:T==="loading",onClick:()=>{_("loading"),(async()=>{try{const ne=await v.v2.search.fetch({q:q.url,type:"statuses",resolve:!0,limit:1});if(ne.statuses.length){const $e=ne.statuses[0];location.hash=b?`/${b}/s/${$e.id}`:`/s/${$e.id}`}else throw new Error("No results")}catch(ne){_("default"),alert(g._({id:"DnepCE",values:{e:ne}}))}})()},children:[e(S,{icon:"transfer"})," ",e(u,{id:"ejAVrO"})]})]})]}):e(Ml,{linkable:we||re,to:d?`/${d}/s/${O}`:`/s/${O}`,onClick:()=>{bn(O)},children:[E===0&&re?e(kt,{threshold:.5,onChange:ne=>{queueMicrotask(()=>{requestAnimationFrame(()=>{Re(ne)})})},children:e(Ye,{statusID:O,instance:d,withinContext:!0,size:J||re?"m":"s",enableTranslate:!0,onMediaClick:Ne,onStatusLinkClick:ye})}):e(Ye,{statusID:O,instance:d,withinContext:!0,size:J||re?"m":"s",enableTranslate:!0,onMediaClick:Ne,onStatusLinkClick:ye,showActionsBar:!!Ie}),re&&Oe>1&&e("div",{class:"replies-link",children:[e(S,{icon:"comment2",alt:g._({id:"N8UzTV"})})," ",e("span",{title:Oe,children:Ke(Oe)})]})," "]}),Ie&&(Me==null?void 0:Me.length)>0&&e(io,{instance:d,replies:Me,hasParentThread:J,level:Q,accWeight:R,openAll:N.current<El,parentLink:{to:d?`/${d}/s/${O}`:`/s/${O}`,onClick:()=>bn(O)}}),T==="loading"&&oe&&!!(q!=null&&q.repliesCount)&&!fe&&e("div",{class:"status-loading",children:e(Pe,{abrupt:q.repliesCount>=3})}),T==="error"&&oe&&!!(q!=null&&q.repliesCount)&&!fe&&e("div",{class:"status-error",children:[e(u,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{A.reloadStatusPage++},children:e(u,{id:"KDw4GX"})})]})]},O)},[t,d,T,y,w,f,Ne,ye,fe]),ge=_e(()=>{var P;if("navigation"in window&&(navigation!=null&&navigation.entries)){const E=navigation.entries()[navigation.currentEntry.index-1];if(E!=null&&E.url)return Qi.test(E.url)}return Qi.test((P=A.prevLocation)==null?void 0:P.pathname)},[$]),xe=_e(()=>{if(!te)return[];const P=[];function E(O){P.push(O.id),O.replies&&O.replies.forEach(E)}return C.slice(K).forEach(E),P.map(O=>it(O,d))},[te,C,K,d]),le=_e(()=>C.slice(0,K).map(ee),[C,K,ee]);return se(()=>{let P=setTimeout(()=>{if(!x.current)return;const E=x.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");E&&E.click()},1e3);return()=>clearTimeout(P)},[t]),e("div",{tabIndex:"-1",ref:D,class:`status-deck deck contained ${C.length>1?"padded-bottom":""} ${Le.current==="status"&&!c.current?"slide-in":""} ${l?`deck-view-${l}`:""}`,onAnimationEnd:P=>{Le.current==="status"&&(Le.current=null)},children:[e("header",{class:`${T==="loading"?"loading":""}`,onDblClick:P=>{A.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[ge&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(S,{icon:"chevron-left",size:"xl",alt:g._({id:"iH8pgl"})})}),!H&&q&&T!=="loading"?e(z,{children:[e("span",{class:"hero-heading",children:[e(mt,{account:q.account,instance:d,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["•"," ",e(Kt,{datetime:q.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:P=>{P.preventDefault(),P.stopPropagation(),x.current.scrollIntoView({behavior:"smooth",block:"start"})},title:g._({id:"NCy+Nw"}),children:e(S,{icon:Se==="down"?"arrow-down":"arrow-up"})})]}):e(z,{children:[e(u,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:P=>{P.preventDefault(),P.stopPropagation(),D.current.scrollTo({top:0,behavior:"smooth"})},hidden:!ve.length||Ee,title:g._({id:"R8CUl0",values:{0:ve.length}}),children:[e(S,{icon:"arrow-up"}),ve.filter((P,E,O)=>O.findIndex(re=>re.accountID===P.accountID)===E).slice(0,3).map(P=>e(dt,{url:P.account.avatar,alt:P.account.displayName},P.account.id)),ve.length>3&&e(z,{children:[" ",e("span",{class:"insignificant",children:Ke(ve.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:l==="full"?"":"none"},onClick:()=>{p(null),s.delete("media"),s.delete("media-only"),s.delete("view"),o(s)},title:g._({id:"+/xYEI"}),children:e(S,{icon:"layout4",size:"l"})}),j&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{A.reloadStatusPage++,B(!1)},children:e(S,{icon:"refresh",size:"l",alt:g._({id:"lCF0wC"})})}),e(at,{align:"end",portal:{target:D.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(S,{icon:"more",alt:g._({id:"2FYpfJ"}),size:"xl"})}),children:[e(ke,{disabled:T==="loading",onClick:()=>{A.reloadStatusPage++},children:[e(S,{icon:"refresh"}),e("span",{children:e(u,{id:"lCF0wC"})})]}),e(ke,{className:"menu-switch-view",onClick:()=>{p(l==="full"?null:"full"),s.delete("media"),s.delete("media-only"),l==="full"?s.delete("view"):s.set("view","full"),o(s)},children:[e(S,{icon:{"":"layout5",full:"layout4"}[l||""]}),e("span",{children:l==="full"?g._({id:"+/xYEI"}):g._({id:"2LiWsE"})})]}),e(ke,{onClick:()=>{Array.from(D.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(E=>{E.click()})},children:[e(S,{icon:"eye-open"})," ",e("span",{children:e(u,{id:"8r8KmB"})})]}),e(Ge,{}),e(ys,{className:"plain",children:e(u,{id:"Rsjgm0"})}),e(ke,{disabled:!F||U,onClick:()=>{const P=al(q.url);P?location.hash=P:alert(g._({id:"9J6biQ"}))},children:[e(S,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:F?g._({id:"Kp9SAs",values:{0:Dt.toUnicode(F)}}):g._({id:"lb07+k"})})]})]}),e(he,{class:"button plain deck-close",to:n,children:e(S,{icon:"x",size:"xl",alt:g._({id:"yz7wBu"})})})]})]})}),C.length&&q?e("ul",{class:`timeline flat contextual grow ${T==="loading"?"loading":""}`,children:[le,te>0&&e("li",{children:e("button",{type:"button",class:"plain block show-more",disabled:T==="loading",onClick:()=>de(P=>P+un),style:{marginBlockEnd:"6em"},"data-state-post-ids":xe.join(" "),children:[e("div",{class:"ib avatars-bunch",children:C.slice(K,K+5).map(P=>e(dt,{url:P.account.avatarStatic},P.id))})," ",e("div",{class:"ib",children:[e(u,{id:"uXRAkV"})," ",e("span",{class:"tag",children:te>un?`${un}+`:te})]})]})})]}):e(z,{children:[T==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(Ye,{skeleton:!0,size:"l"})})}),T==="error"&&e("p",{class:"ui-state",children:[e(u,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{A.reloadStatusPage++},children:e(u,{id:"KDw4GX"})})]})]})]})}function io({replies:t,instance:n,hasParentThread:i,level:s,accWeight:o,openAll:a,parentLink:h}){const[r,c]=ft(),l=_=>_.reduce((x,$)=>{const{repliesCount:N,replies:D}=$,V=(D==null?void 0:D.length)||N;return x+V+l(D||[])},0),p=t.length+l(t),f=t.length===p,m=t.map(_=>_.account).filter((_,x,$)=>$.findIndex(N=>N.id===_.id)===x).slice(0,3),d=_e(()=>t==null?void 0:t.reduce((_,x)=>_+(x==null?void 0:x.weight),o),[o,t==null?void 0:t.length]);let v=!1;(a||d<=Rl||!i&&p===1&&en(t[0])<2)&&(v=!0);const b=Jn[t[0].id],y=ct((_,x,$,N)=>{_.preventDefault(),_.stopPropagation(),c({media:x+1,mediaStatusID:N.id})},[]),w=Y();gt(()=>{var x;function _($){$.target.dataset.scrollLeft=$.target.scrollLeft}return(x=w.current)==null||x.addEventListener("scroll",_,{passive:!0}),()=>{var $;($=w.current)==null||$.removeEventListener("scroll",_)}},[]);const[k,C]=L(b||v);se(()=>{let _;return!b&&!v&&(_=setTimeout(()=>C(!0),100)),()=>clearTimeout(_)},[b,v]);const I=v?"div":"details",T=I==="details";return e(I,{ref:w,class:"replies",open:T?b||v:void 0,onToggle:T?_=>{const{open:x}=_.target;Jn[t[0].id]=x}:void 0,style:{"--comments-level":s},"data-comments-level":s,"data-comments-level-overflow":s>4,children:[!v&&e("summary",{class:"replies-summary",hidden:v,children:[e("span",{class:"avatars",children:m.map(_=>e(dt,{url:_.avatarStatic,title:`${_.displayName} @${_.username}`,squircle:_==null?void 0:_.bot},_.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(u,{id:"DOQUen",values:{0:t.length,1:Ke(t.length)},components:{0:e("span",{title:t.length})}})}),!f&&p>1&&e(z,{children:[" ","·"," ",e("span",{children:e(u,{id:"qSQQSe",values:{0:Ke(p),totalComments:p},components:{0:e("span",{title:p})}})})]})]}),e(S,{icon:"chevron-down",class:"replies-summary-chevron"}),!!h&&e(he,{class:"replies-parent-link",to:h.to,onClick:h.onClick,title:g._({id:"ZlV82A"}),children:"»"})]}),k&&e("ul",{children:t.map(_=>{var x,$;return e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(Ye,{statusID:_.id,instance:n,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:y,showActionsBar:!0}),!((x=_.replies)!=null&&x.length)&&_.repliesCount>0&&e("div",{class:"replies-link",children:[e(S,{icon:"comment2",alt:g._({id:"N8UzTV"})})," ",e("span",{title:_.repliesCount,children:Ke(_.repliesCount)})]})]}),(($=_.replies)==null?void 0:$.length)&&e(io,{instance:n,replies:_.replies,level:_.level,accWeight:v?d:_.weight,openAll:a,parentLink:{to:n?`/${n}/s/${_.id}`:`/s/${_.id}`,onClick:()=>{bn(_.id)}}})]},_.id)})})]})}const Dl=140,Nl=35,Pl=70,Ol=140,Qn=new Map;function en(t){var d,v;const n=Qn.get(t.id);if(n)return n;const{spoilerText:i,content:s,mediaAttachments:o,poll:a,card:h}=t,r=vs(i+s),c=o!=null&&o.length?Dl:0,l=(((d=a==null?void 0:a.options)==null?void 0:d.length)||0)*Nl,p=h&&(o!=null&&o.length||(v=a==null?void 0:a.options)!=null&&v.length)?0:Pl,m=(r+c+l+p)/Ol;return Qn.set(t.id,m),m}const zl=st(Ll);function Bl(){const t=$t(),{id:n,instance:i}=t;return e(zl,{id:n,instance:i})}const Ul=""+new URL("boosts-carousel-YjmjXTE6.jpg",import.meta.url).href,Fl=""+new URL("grouped-notifications-xYMFVY91.jpg",import.meta.url).href,Hl=""+new URL("multi-column-ETnJNDVb.jpg",import.meta.url).href,ql=""+new URL("multi-hashtag-timeline-x-SDVR4g.jpg",import.meta.url).href,Yl=""+new URL("nested-comments-thread-Ib-fZGS3.jpg",import.meta.url).href,jl="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%20102%2028'%3e%3cpath%20fill='none'%20d='M0%200h101.5v27.5H0z'/%3e%3cg%20fill-rule='nonzero'%3e%3cpath%20fill='url(%23a)'%20d='M2.32%2021.85c1.4%200%202.21-.85%202.21-2.3v-4.64H8.5c4.45%200%207.54-2.9%207.54-7.24%200-4.35-2.98-7.24-7.32-7.24h-6.4C.93.43.11%201.28.11%202.73v16.82c0%201.45.82%202.3%202.21%202.3Zm2.21-10.4V3.94h3c2.54%200%204%201.34%204%203.75s-1.47%203.76-4%203.76h-3Z'/%3e%3cpath%20fill='url(%23b)'%20d='M20.52%2021.88c1.25%200%202.13-.76%202.13-2.23v-7.04c0-2.07%201.2-3.49%203.21-3.49%201.95%200%202.95%201.23%202.95%203.25v7.28c0%201.47.89%202.23%202.13%202.23%201.26%200%202.14-.76%202.14-2.23v-8.18c0-3.64-1.99-5.9-5.48-5.9-2.38%200-4.1%201.12-4.93%203.1h-.09V2.3c0-1.38-.78-2.2-2.1-2.2-1.31%200-2.1.82-2.1%202.2v17.34c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23c)'%20d='M40.45%2021.82c1.96%200%203.93-.98%204.8-2.65h.1v.8c.08%201.27.89%201.91%202.05%201.91%201.21%200%202.08-.73%202.08-2.15v-8.95c0-3.17-2.63-5.25-6.65-5.25-3.26%200-5.78%201.16-6.5%203.04-.15.32-.23.63-.23.96%200%20.97.75%201.64%201.79%201.64.69%200%201.23-.26%201.7-.79.95-1.23%201.74-1.65%203.04-1.65%201.62%200%202.64.85%202.64%202.31v1.04l-3.95.24c-3.93.23-6.13%201.88-6.13%204.74%200%202.83%202.27%204.76%205.26%204.76Zm1.4-3.09c-1.43%200-2.4-.73-2.4-1.9%200-1.12.91-1.83%202.51-1.95l3.31-.2v1.14c0%201.7-1.54%202.91-3.41%202.91Z'/%3e%3cpath%20fill='url(%23d)'%20d='M54.37%2021.88c1.26%200%202.14-.76%202.14-2.23v-7.09c0-2.03%201.21-3.44%203.13-3.44s2.89%201.17%202.89%203.22v7.31c0%201.47.88%202.23%202.14%202.23%201.24%200%202.13-.76%202.13-2.23v-8.2c0-3.68-1.96-5.87-5.45-5.87-2.41%200-4%201.07-4.83%203.01h-.09v-.87c0-1.35-.85-2.17-2.14-2.17-1.28%200-2.06.82-2.06%202.15v11.95c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23e)'%20d='M71.65%2027.17c1.26%200%202.14-.76%202.14-2.23v-6h.09a5.15%205.15%200%200%200%204.88%202.88c3.92%200%206.35-3.05%206.35-8.1%200-5.07-2.44-8.1-6.43-8.1a5.12%205.12%200%200%200-4.86%202.99h-.09v-.85c0-1.45-.88-2.21-2.1-2.21-1.24%200-2.11.76-2.11%202.2v17.2c0%201.46.89%202.22%202.13%202.22Zm5.6-8.8c-2.1%200-3.47-1.8-3.47-4.65%200-2.81%201.37-4.67%203.47-4.67%202.14%200%203.49%201.83%203.49%204.67%200%202.86-1.35%204.66-3.5%204.66Z'/%3e%3cpath%20fill='url(%23f)'%20d='M89.61%2027.39c3.44%200%205.26-1.5%206.73-5.55l4.81-13.1a4%204%200%200%200%20.24-1.26c0-1.13-.85-1.93-2.08-1.93-1.1%200-1.71.51-2.07%201.7l-3.4%2010.9h-.08L90.35%207.28c-.36-1.25-.94-1.73-2.07-1.73-1.26%200-2.21.83-2.21%201.99%200%20.35.09.82.25%201.26l5%2013.21-.21.56c-.52%201.1-1.32%201.42-2.07%201.42l-.75-.01c-.96%200-1.56.54-1.56%201.4%200%201.29%201%202%202.88%202Z'/%3e%3c/g%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='b'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='c'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='d'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e",Vl={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",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",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Jt,PHANPY_WEBSITE:ts,PHANPY_PRIVACY_POLICY_URL:Gl,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:ns}=Vl,is=ts?ts.replace(/https?:\/\//g,"").replace(/\/$/,""):null,ss=`${"2024-11-22T08:34:51.379Z".slice(0,10).replace(/-/g,".")}.8f048af`;function so(){return Xe(null,["/","/welcome"]),e("main",{id:"welcome",children:[e("div",{class:"hero-container",children:[e("div",{class:"hero-content",children:[e("h1",{children:[e("img",{src:hi,alt:"",width:"160",height:"160",style:{aspectRatio:"1/1",marginBlockEnd:-16}}),e("img",{src:jl,alt:"Phanpy",width:"200"})]}),e("p",{class:"desc",children:e(u,{id:"Ogtv0V"})}),e("p",{children:e(he,{to:Jt?`/login?instance=${Jt}&submit=1`:"/login",class:"button",children:Jt?g._({id:"sQia9P"}):g._({id:"ZLoGls"})})}),Jt&&ns&&e("p",{children:e("a",{href:ns,class:"button plain5",children:e(u,{id:"e+RpCP"})})}),!Jt&&e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"fvAsUK",components:{0:e("br",{})}})})})]}),(is||ss)&&e("p",{class:"app-site-version",children:e("small",{children:[is," ",ss]})}),e("p",{children:e(u,{id:"BskFI2",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank"}),1:e("a",{href:"https://mastodon.social/@cheeaun",target:"_blank",onClick:t=>{t.preventDefault(),A.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:Gl,target:"_blank"})}})}),e("div",{children:e(fi,{})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:Ul,alt:g._({id:"S5cYrQ"}),loading:"lazy"}),e("h4",{children:e(u,{id:"Tu+sCN"})}),e("p",{children:e(u,{id:"e2uVlo"})})]}),e("section",{children:[e("img",{src:Yl,alt:g._({id:"CGQ27z"}),loading:"lazy"}),e("h4",{children:e(u,{id:"cYE45+"})}),e("p",{children:e(u,{id:"Pc7QKh"})})]}),e("section",{children:[e("img",{src:Fl,alt:g._({id:"rnrM7k"}),loading:"lazy"}),e("h4",{children:e(u,{id:"4RRMre"})}),e("p",{children:e(u,{id:"8GMtDr"})})]}),e("section",{children:[e("img",{src:Hl,alt:g._({id:"VLKtvP"}),loading:"lazy"}),e("h4",{children:e(u,{id:"pEkad9"})}),e("p",{children:e(u,{id:"t7Py5R"})})]}),e("section",{children:[e("img",{src:ql,alt:g._({id:"wOax6E"}),loading:"lazy"}),e("h4",{children:e(u,{id:"Wi1Ov0"})}),e("p",{children:e(u,{id:"tS2i+h"})})]})]})})]})}const Kl=window.alert;window.__nativeAlert||(window.__nativeAlert=Kl);window.alert=function(t){t instanceof Error&&(t!=null&&t.message)&&(t=t.message),typeof t!="string"&&(t=JSON.stringify(t));const n=Yo({text:t,className:"alert",gravity:"top",position:"center",duration:1e4,offset:{y:48},onClick:()=>{n.hideToast()}});n.showToast()};window.__STATES__=A;window.__STATES_STATS__=()=>{const t=["statuses","accounts","spoilers","unfurledLinks","statusQuotes"],n={};t.forEach(o=>{n[o]=Object.keys(A[o]).length});const{statuses:i}=A,s=[];for(const o in i)document.querySelector(`[data-state-post-id~="${o}"], [data-state-post-ids~="${o}"]`)||s.push(o)};setInterval(()=>{if(!window.__IDLE__)return;const{statuses:t,unfurledLinks:n,notifications:i}=A;let s=0;const{instance:o}=ae();for(const a in t){if(!window.__IDLE__)break;try{const h=document.querySelector(`[data-state-post-id~="${a}"], [data-state-post-ids~="${a}"]`),r=i.some(c=>{var l;return a===it((l=c.status)==null?void 0:l.id,o)});if(!h&&!r){delete A.statuses[a],delete A.statusQuotes[a];for(const c in n){const l=n[c];if(it(l.id,l.instance)===a){delete A.unfurledLinks[c];break}}s++}}catch{}}},15*60*1e3);setTimeout(()=>{for(const t in zt)setTimeout(()=>{var n,i,s,o,a,h;Array.isArray(zt[t])?(i=(n=zt[t])[0])==null||i.call(n):typeof zt[t]=="object"?(o=(s=zt[t]).module)==null||o.call(s):(h=(a=zt)[t])==null||h.call(a)},1)},5e3);(()=>{window.__IDLE__=!0;const t=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],n=()=>{window.__IDLE__=!0},s=ws(n,3e3),o=()=>{window.__IDLE__=!1,s()};t.forEach(a=>{window.addEventListener(a,o,{passive:!0,capture:!0})}),window.addEventListener("blur",n,{passive:!0}),document.documentElement.addEventListener("mouseleave",a=>{!a.relatedTarget&&!a.toElement&&n()},{passive:!0})})();const Wl=/iPad|iPhone|iPod/.test(navigator.userAgent);Wl&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const n=be.local.get("theme");let i;if(n){if(i=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),i){const s=i.content,o=n==="light"?i.dataset.themeLightColorTemp:i.dataset.themeDarkColorTemp;i.content=o||"",setTimeout(()=>{i.content=s},10)}}else{const s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(i=document.querySelector(`meta[name="theme-color"][media*="${s}"]`),i){const o=i.dataset.content,a=i.dataset.contentTemp;i.content=a||"",setTimeout(()=>{i.content=o},10)}}}});{const t=be.local.get("theme");if(t){document.documentElement.classList.add(`is-${t}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",t||"dark light");const i=document.querySelector('meta[data-theme-setting="manual"]');i&&(i.name="theme-color",i.content=t==="light"?i.dataset.themeLightColor:i.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(o=>{o.name=""})}const n=be.local.get("textSize");n&&document.documentElement.style.setProperty("--text-size",`${n}px`)}as(A,t=>{var n;for(const[i,s,o,a]of t){if(s.join(".")==="settings.shortcutsViewMode"){const h=document.getElementById("app");h&&(h.dataset.shortcutsViewMode=(n=A.shortcuts)!=null&&n.length?o:"")}s.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",o)}});const hn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(t){},end(t){}};function Zl(){const[t,n]=L(!1),[i,s]=L("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),Qe(),se(()=>{const a=be.local.get("instanceURL"),h=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(h){window.history.replaceState({},document.title,window.location.pathname||"/");const r=be.sessionCookie.get("clientID"),c=be.sessionCookie.get("clientSecret"),l=be.sessionCookie.get("vapidKey"),p=be.sessionCookie.get("codeVerifier");(async()=>{s("loading");const{access_token:f}=await Cl({instanceURL:a,client_id:r,client_secret:c,code:h,code_verifier:p||void 0});if(f){const m=wo({instance:a,accessToken:f});await Promise.allSettled([Dn(m),Nn(m,a),ko(m,a,f,l)]),Si(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,n(!0),s("default")}else s("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const r=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let c;if(r&&(c=_o(r),c&&(vn(c.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),c||(c=ei()),c){vn(c.info.id);const{client:l}=ae({account:c}),{instance:p}=l;Si(),s("loading"),(async()=>{try{So()&&Co(p)?(Dn(l),Nn(l,p)):await Promise.allSettled([Dn(l),Nn(l,p)])}catch{}finally{n(!0),s("default"),__BENCHMARK.end("app-init")}})()}else s("default"),__BENCHMARK.end("app-init")}be.sessionCookie.del("clientID"),be.sessionCookie.del("clientSecret"),be.sessionCookie.del("codeVerifier")},[]);let o=Gt();return A.currentLocation=o.pathname,se(Kn,[o,t]),/\/https?:/.test(o.pathname)?e(rl,{}):i==="loading"?e(Pe,{id:"loader-root"}):e(z,{children:[e(Jl,{isLoggedIn:t}),e(Ql,{isLoggedIn:t}),e(ni,{children:e(Ve,{path:"/:instance?/s/:id",element:e(Bl,{})})}),t&&e(Ko,{}),t&&e(Na,{}),e(Aa,{}),t&&e(Ma,{}),e(Go,{isLoggedIn:t}),e($a,{onClose:Kn}),e(Wo,{})]})}function Xl({isLoggedIn:t}){return t&&__BENCHMARK.end("time-to-isLoggedIn"),t?e(ol,{}):e(so,{})}const Jl=st(({isLoggedIn:t})=>{const n=Gt(),i=_e(()=>{const{pathname:s}=n;return!/^\/(login|welcome)/i.test(s)},[n]);return e(ni,{location:i||n,children:[e(Ve,{path:"/",element:e(Xl,{isLoggedIn:t})}),e(Ve,{path:"/login",element:e(xl,{})}),e(Ve,{path:"/welcome",element:e(so,{})})]})});function os(){return A.prevLocation||null}function Ql({isLoggedIn:t}){const n=Gt(),i=Y(os());return _e(()=>tn("/:instance/s/:id",n.pathname)||tn("/s/:id",n.pathname),[n.pathname,tn])?i.current||(i.current=os()):i.current=null,e(ni,{location:i.current||n,children:[t&&e(z,{children:[e(Ve,{path:"/notifications",element:e(Xs,{})}),e(Ve,{path:"/mentions",element:e(Gs,{})}),e(Ve,{path:"/following",element:e(wi,{})}),e(Ve,{path:"/b",element:e(Bs,{})}),e(Ve,{path:"/f",element:e(Us,{})}),e(Ve,{path:"/l",children:[e(Ve,{index:!0,element:e(ll,{})}),e(Ve,{path:":id",element:e(qs,{})})]}),e(Ve,{path:"/fh",element:e(Sr,{})}),e(Ve,{path:"/ft",element:e(yr,{})}),e(Ve,{path:"/catchup",element:e(ar,{})})]}),e(Ve,{path:"/:instance?/t/:hashtag",element:e(Hs,{})}),e(Ve,{path:"/:instance?/a/:id",element:e(Ja,{})}),e(Ve,{path:"/:instance?/p",children:[e(Ve,{index:!0,element:e(Xn,{})}),e(Ve,{path:"l",element:e(Xn,{local:!0})})]}),e(Ve,{path:"/:instance?/trending",element:e(eo,{})}),e(Ve,{path:"/:instance?/search",element:e(Js,{})})]})}Io();Ao(e(To,{i18n:g,children:e(xo,{children:e(Zl,{})})}),document.getElementById("app"));setTimeout(()=>{try{Object.keys(localStorage).forEach(t=>{t.startsWith("iconify")&&localStorage.removeItem(t)}),Object.keys(sessionStorage).forEach(t=>{t.startsWith("iconify")&&sessionStorage.removeItem(t)}),localStorage.removeItem("settings:boostsCarousel")}catch{}},5e3);if("serviceWorker"in navigator&&typeof caches<"u"){const n=["icons"];let i=!1;const s=1e4,o=60*60*1e3;async function a(){if(window.__IDLE__)try{const h=await caches.keys();for(const r of h){if(n.includes(r))continue;const c=await caches.open(r),l=await c.keys();if(l.length>50){const p=l.slice(50);for(const f of p)await c.delete(f)}}i=!0}catch{}setTimeout(a,i?o:s)}setTimeout(a,s)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")};
//# sourceMappingURL=main-v0c3KDmS.js.map