phanpy-cz/assets/main-VxNg86V0.js
2025-04-27 07:42:34 +02:00

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

This file contains Unicode characters that might be confused with other characters. 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 ie,M as dt,u as de,d as E,s as x,a as ce,b as Qe,p as bt,c as Ve,q as ot,g as wt,e,k as U,T as h,f as ye,h as Et,i as Cn,j as Ce,L as bo,C as zn,D as yo,m as vo,n as Zn,o as ps,r as Zt,t as he,v as wo,w as Ue,x as _n,z as xi,_ as kt,B as ms,E as Cd,F as gs,G as bs,H as ko,I as So,J as rt,K as Co,N as ci,O as _o,P as yt,Q as Io,R as To,S as ai,U as Lt,V as tt,W as ys,X as vs,Y as Ao,Z as nn,$ as xo,a0 as Ro,a1 as Un,a2 as Bn,a3 as Eo,a4 as Ri,a5 as Lo,a6 as Mo,a7 as $o,a8 as ri,a9 as Ke,aa as No,ab as Po,ac as Do,ad as Oo}from"./useTitle-Bxi1QgwH.js";import{u as li,s as Fe,a as pe,o as Ei,b as zo,V as ws,c as ks,I as T,C as di,d as Ss,M as qe,e as Ge,S as an,f as ve,g as Ln,R as It,n as ct,h as He,A as pt,N as gt,i as lt,j as ht,L as ge,l as xt,k as Uo,m as Cs,p as et,q as Id,r as st,t as rn,v as ft,w as Wn,x as _s,E as Is,y as Je,z as Li,T as Ts,B as mt,D as ui,F as Ye,G as _t,H as Bo,J as Fo,K as Dt,O as hi,P as As,Q as Ho,U as Yt,W as qo,X as Yo,Y as Mn,Z as jo,_ as Ot,$ as Vo,a0 as xs,a1 as Rs,a2 as Ko,a3 as Es,a4 as Go,a5 as Zo,a6 as Wo,a7 as Xo,a8 as Jo,a9 as Mi,aa as Qo,ab as Bt}from"./ScheduledAtField-C3P_Zxj4.js";var Ls=ec;function ec(n,i,s){var o=null,c=null,r=function(){o&&(clearTimeout(o),c=null,o=null)},u=function(){var l=c;r(),l&&l()},d=function(){if(!i)return n.apply(this,arguments);var l=this,a=arguments,p=s&&!o;if(r(),c=function(){n.apply(l,a)},o=setTimeout(function(){if(o=null,!p){var y=c;return c=null,y()}},i),p)return c()};return d.cancel=r,d.flush=u,d}/*!
* 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(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(b,f){f=f||{bubbles:!1,cancelable:!1,detail:void 0};var g=i.createEvent("CustomEvent");return g.initCustomEvent(b,f.bubbles,f.cancelable,f.detail),g},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",p,!1),i.addEventListener("touchmove",y,!1),i.addEventListener("touchend",a,!1);var s=null,o=null,c=null,r=null,u=null,d=null,l=0;function a(b){if(d===b.target){var f=parseInt(m(d,"data-swipe-threshold","20"),10),g=m(d,"data-swipe-unit","px"),v=parseInt(m(d,"data-swipe-timeout","500"),10),w=Date.now()-u,C="",S=b.changedTouches||b.touches||[];if(g==="vh"&&(f=Math.round(f/100*i.documentElement.clientHeight)),g==="vw"&&(f=Math.round(f/100*i.documentElement.clientWidth)),Math.abs(c)>Math.abs(r)?Math.abs(c)>f&&w<v&&(c>0?C="swiped-left":C="swiped-right"):Math.abs(r)>f&&w<v&&(r>0?C="swiped-up":C="swiped-down"),C!==""){var k={dir:C.replace(/swiped-/,""),touchType:(S[0]||{}).touchType||"direct",fingers:l,xStart:parseInt(s,10),xEnd:parseInt((S[0]||{}).clientX||-1,10),yStart:parseInt(o,10),yEnd:parseInt((S[0]||{}).clientY||-1,10)};d.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:k})),d.dispatchEvent(new CustomEvent(C,{bubbles:!0,cancelable:!0,detail:k}))}s=null,o=null,u=null}}function p(b){b.target.getAttribute("data-swipe-ignore")!=="true"&&(d=b.target,u=Date.now(),s=b.touches[0].clientX,o=b.touches[0].clientY,c=0,r=0,l=b.touches.length)}function y(b){if(!(!s||!o)){var f=b.touches[0].clientX,g=b.touches[0].clientY;c=s-f,r=o-g}}function m(b,f,g){for(;b&&b!==i.documentElement;){var v=b.getAttribute(f);if(v)return v;b=b.parentNode}return g}})(window,document);function jt(n=()=>{},i=[]){const s=Y(n);ie(()=>{s.current=n},[i]),ie(()=>{const o=()=>{const c=document.hidden||document.visibilityState==="hidden";s.current(!c)};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[])}const tc=1e3*3,$i=2e4,nc=dt(function({isLoggedIn:i}){const{_:s}=de(),[o,c]=E(!0),r=Y();jt(a=>{clearTimeout(r.current),a?c(!0):r.current=setTimeout(()=>{c(!1)},$i)});const u=async(a,p,y)=>{var m;if(x.notificationsLast){const b=a.v1.notifications.list({limit:1,sinceId:x.notificationsLast.id}),{value:f}=await b.next();if(f!=null&&f.length)if(y)x.notificationsShowNew=!0;else{let g;try{const v=await a.v1.markers.fetch({timeline:"notifications"});g=(m=v==null?void 0:v.notifications)==null?void 0:m.lastReadId}catch{}g?x.notificationsShowNew=f[0].id!==g:x.notificationsShowNew=!0}}};ie(()=>{let a,p,y;if(i&&o){const{masto:m,streaming:b,instance:f}=ce();(async()=>{await u(m,f);let g=!1;b&&(p=setTimeout(()=>{(async()=>{try{g=!0,a=b.user.notification.subscribe();for await(const v of a){if(!a||!o)break;v.event==="notification"&&Qe(v.payload,f,{skipThreading:!0}),x.notificationsShowNew=!0}}catch{g=!1}g||(y=setInterval(()=>{u(m,f,!0)},$i))})()},tc))})()}return()=>{var m;(m=a==null?void 0:a.unsubscribe)==null||m.call(a),a=null,clearTimeout(p),clearInterval(y)}},[o,i]);const d=Y(),l=()=>{d.current=Date.now(),fetch("./version.json").then(a=>a.json()).then(a=>{a&&(x.appVersion=a)}).catch(a=>{})};return li(l,o&&1e3*60*30),jt(a=>{a&&(d.current?Date.now()-d.current>1e3*60*60&&l():l())}),Fe("shift+alt+k",a=>{if(!a.shiftKey||!a.altKey)return;const p=x.settings.cloakMode;x.settings.cloakMode=!p,pe({text:s(p?{id:"oguMwa"}:{id:"IXZLPs"})})},{useKey:!0}),null}),ic=bt(async(n,i)=>{const s=n.v1.accounts.$select(i).statuses.list({limit:3,exclude_replies:!0,exclude_reblogs:!0}),{value:o}=await s.next();return o||[]},{maxAge:6e4});function sc(){const{_:n}=de(),i=Ve(x),{masto:s}=ce(),[o,c]=E(!1),[r,u]=E([]),[d,l]=E(!1),a=Y(null),p=Y(null);function y(g){if(i.composerState.minimized){x.composerState.minimized=!1,Ei();return}g.shiftKey?zo()||(x.showCompose=!0):(Ei(),x.showCompose=!0)}Fe("c, shift+c",y,{ignoreEventWhen:g=>!!document.querySelector("#modal-container > *")},{useKey:!0});const m=ws(()=>{c(!0)},{threshold:600}),b=ot(async()=>{try{l(!0);const g=wt();if(!g)return;const v=await ic(s,g);u(v)}catch{}finally{l(!1)}},[s]),f=ot(g=>{ks({replyToStatus:g}),c(!1)},[]);return ie(()=>{o&&b()},[b,o]),e(U,{children:[e("button",{ref:a,type:"button",id:"compose-button",onClick:y,onContextMenu:g=>{g.preventDefault(),c(!0)},...m(),class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(T,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})}),e(di,{ref:p,state:o?"open":void 0,anchorRef:a,onClose:()=>c(!1),direction:"top",gap:8,unmountOnClose:!0,portal:{target:document.body},boundingBoxPadding:Ss(),containerProps:{style:{zIndex:19},onClick:()=>{var g,v;(v=(g=p.current)==null?void 0:g.closeMenu)==null||v.call(g)}},submenuOpenDelay:600,children:[e(qe,{to:"/sp",children:[e(T,{icon:"schedule"})," ",e("span",{children:e(h,{id:"+GkIdc"})})]}),e(Ge,{}),e(an,{align:"end",direction:"top",shift:-8,disabled:d||r.length===0,label:e(U,{children:[e(T,{icon:"comment"})," ",e("span",{className:"menu-grow",children:e(h,{id:"LwOr4P"})}),d?"…":e(T,{icon:"chevron-right"})]}),children:r.length>0&&r.map(g=>{const v=new Date(g.createdAt),w=new Date().getTime()-v.getTime()<864e5;return e(ve,{onClick:()=>f(g),children:e("small",{children:[e("div",{class:"menu-post-text",children:Ln(g)}),e("span",{className:"more-insignificant",children:[w&&e(U,{children:[e(It,{datetime:v,format:"micro"})," ",""," "]}),e("time",{className:"created",dateTime:v.toISOString(),title:v.toLocaleString(),children:ct(g.createdAt)})]})]})},g.id)})})]})]})}const oc=dt(function(){const{_:i}=de(),s=Ve(x);function o(){x.showKeyboardShortcutsHelp=!1}return Fe("?",()=>{x.showKeyboardShortcutsHelp=!0},{useKey:!0,ignoreEventWhen:c=>/\/catchup/i.test(location.hash)}),!!s.showKeyboardShortcutsHelp&&e(He,{onClose:o,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"77Emn0"})})}),e("main",{children:e("table",{children:e("tbody",{children:[{action:i({id:"ulXSNi"}),keys:e("kbd",{children:"?"})},{action:i({id:"Gy9P9T"}),keys:e("kbd",{children:"j"})},{action:i({id:"6XYpYY"}),keys:e("kbd",{children:"k"})},{action:i({id:"DYowFe"}),keys:e(h,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"S5ez7Y"}),keys:e(h,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:i({id:"jsFF8C"}),keys:e(h,{id:"80sOCm",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:e(h,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:i({id:"jAj8rv"}),keys:e(h,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"duF1lx"}),keys:e(h,{id:"nhpsIN",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"YrR3Co"}),keys:e("kbd",{children:"]"})},{action:i({id:"noxAFR"}),keys:e("kbd",{children:"["})},{action:i({id:"AIa/f7"}),keys:e("kbd",{children:"c"})},{action:i({id:"snPx8X"}),className:"insignificant",keys:e(h,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"1pKapz"}),keys:e(h,{id:"py67WT",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{}),3:e("kbd",{})}})},{action:i({id:"A1taO8"}),keys:e("kbd",{children:"/"})},{action:i({id:"ImOQa9"}),keys:e("kbd",{children:"r"})},{action:i({id:"KFs8c6"}),className:"insignificant",keys:e(h,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"cqi4Mx"}),keys:e(h,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"kulphB"}),keys:e(h,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:i({id:"C7ujRh"}),keys:e(h,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})}].map(({action:c,className:r,keys:u})=>e("tr",{children:[e("th",{class:r,children:c}),e("td",{children:u})]},c))})})})]})})}),Ms=new Set,at=new WeakMap,Vt=new WeakMap,zt=new WeakMap,Xn=new WeakMap,cc=new WeakMap,Kt=new WeakMap,In=new WeakMap,en=new WeakSet;let Rt,fi=0,pi=0;const St="__aa_tgt",sn="__aa_del",Tn="__aa_new",ac=n=>{const i=fc(n);i&&i.forEach(s=>pc(s))},rc=n=>{n.forEach(i=>{i.target===Rt&&dc(),at.has(i.target)&&Ut(i.target)})};function lc(n){const i=Xn.get(n);i==null||i.disconnect();let s=at.get(n),o=0;const c=5;s||(s=Gt(n),at.set(n,s));const{offsetWidth:r,offsetHeight:u}=Rt,l=[s.top-c,r-(s.left+c+s.width),u-(s.top+c+s.height),s.left-c].map(p=>`${-1*Math.floor(p)}px`).join(" "),a=new IntersectionObserver(()=>{++o>1&&Ut(n)},{root:Rt,threshold:1,rootMargin:l});a.observe(n),Xn.set(n,a)}function Ut(n){clearTimeout(In.get(n));const i=$n(n),s=on(i)?500:i.duration;In.set(n,setTimeout(async()=>{const o=zt.get(n);try{await(o==null?void 0:o.finished),at.set(n,Gt(n)),lc(n)}catch{}},s))}function dc(){clearTimeout(In.get(Rt)),In.set(Rt,setTimeout(()=>{Ms.forEach(n=>Ds(n,i=>$s(()=>Ut(i))))},100))}function uc(n){setTimeout(()=>{cc.set(n,setInterval(()=>$s(Ut.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function $s(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Jn,qt;const hc=typeof window<"u"&&"ResizeObserver"in window;hc&&(Rt=document.documentElement,Jn=new MutationObserver(ac),qt=new ResizeObserver(rc),window.addEventListener("scroll",()=>{pi=window.scrollY,fi=window.scrollX}),qt.observe(Rt));function fc(n){return n.reduce((o,c)=>[...o,...Array.from(c.addedNodes),...Array.from(c.removedNodes)],[]).every(o=>o.nodeName==="#comment")?!1:n.reduce((o,c)=>{if(o===!1)return!1;if(c.target instanceof Element){if(Fn(c.target),!o.has(c.target)){o.add(c.target);for(let r=0;r<c.target.children.length;r++){const u=c.target.children.item(r);if(u){if(sn in u)return!1;Fn(c.target,u),o.add(u)}}}if(c.removedNodes.length)for(let r=0;r<c.removedNodes.length;r++){const u=c.removedNodes[r];if(sn in u)return!1;u instanceof Element&&(o.add(u),Fn(c.target,u),Vt.set(u,[c.previousSibling,c.nextSibling]))}}return o},new Set)}function Fn(n,i){!i&&!(St in n)?Object.defineProperty(n,St,{value:n}):i&&!(St in i)&&Object.defineProperty(i,St,{value:n})}function pc(n){var i;const s=n.isConnected,o=at.has(n);s&&Vt.has(n)&&Vt.delete(n),zt.has(n)&&((i=zt.get(n))===null||i===void 0||i.cancel()),Tn in n?Ni(n):o&&s?gc(n):o&&!s?bc(n):Ni(n)}function vt(n){return Number(n.replace(/[^0-9.\-]/g,""))}function mc(n){let i=n.parentElement;for(;i;){if(i.scrollLeft||i.scrollTop)return{x:i.scrollLeft,y:i.scrollTop};i=i.parentElement}return{x:0,y:0}}function Gt(n){const i=n.getBoundingClientRect(),{x:s,y:o}=mc(n);return{top:i.top+o,left:i.left+s,width:i.width,height:i.height}}function Ns(n,i,s){let o=i.width,c=i.height,r=s.width,u=s.height;const d=getComputedStyle(n);if(d.getPropertyValue("box-sizing")==="content-box"){const a=vt(d.paddingTop)+vt(d.paddingBottom)+vt(d.borderTopWidth)+vt(d.borderBottomWidth),p=vt(d.paddingLeft)+vt(d.paddingRight)+vt(d.borderRightWidth)+vt(d.borderLeftWidth);o-=p,r-=p,c-=a,u-=a}return[o,r,c,u].map(Math.round)}function $n(n){return St in n&&Kt.has(n[St])?Kt.get(n[St]):{duration:250,easing:"ease-in-out"}}function Ps(n){if(St in n)return n[St]}function mi(n){const i=Ps(n);return i?en.has(i):!1}function Ds(n,...i){i.forEach(s=>s(n,Kt.has(n)));for(let s=0;s<n.children.length;s++){const o=n.children.item(s);o&&i.forEach(c=>c(o,Kt.has(o)))}}function gi(n){return Array.isArray(n)?n:[n]}function on(n){return typeof n=="function"}function gc(n){const i=at.get(n),s=Gt(n);if(!mi(n))return at.set(n,s);let o;if(!i)return;const c=$n(n);if(typeof c!="function"){const r=i.left-s.left,u=i.top-s.top,[d,l,a,p]=Ns(n,i,s),y={transform:`translate(${r}px, ${u}px)`},m={transform:"translate(0, 0)"};d!==l&&(y.width=`${d}px`,m.width=`${l}px`),a!==p&&(y.height=`${a}px`,m.height=`${p}px`),o=n.animate([y,m],{duration:c.duration,easing:c.easing})}else{const[r]=gi(c(n,"remain",i,s));o=new Animation(r),o.play()}zt.set(n,o),at.set(n,s),o.addEventListener("finish",Ut.bind(null,n))}function Ni(n){Tn in n&&delete n[Tn];const i=Gt(n);at.set(n,i);const s=$n(n);if(!mi(n))return;let o;if(typeof s!="function")o=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:s.duration*1.5,easing:"ease-in"});else{const[c]=gi(s(n,"add",i));o=new Animation(c),o.play()}zt.set(n,o),o.addEventListener("finish",Ut.bind(null,n))}function Pi(n,i){var s;n.remove(),at.delete(n),Vt.delete(n),zt.delete(n),(s=Xn.get(n))===null||s===void 0||s.disconnect(),setTimeout(()=>{if(sn in n&&delete n[sn],Object.defineProperty(n,Tn,{value:!0,configurable:!0}),i&&n instanceof HTMLElement)for(const o in i)n.style[o]=""},0)}function bc(n){var i;if(!Vt.has(n)||!at.has(n))return;const[s,o]=Vt.get(n);Object.defineProperty(n,sn,{value:!0,configurable:!0});const c=window.scrollX,r=window.scrollY;if(o&&o.parentNode&&o.parentNode instanceof Element?o.parentNode.insertBefore(n,o):s&&s.parentNode?s.parentNode.appendChild(n):(i=Ps(n))===null||i===void 0||i.appendChild(n),!mi(n))return Pi(n);const[u,d,l,a]=vc(n),p=$n(n),y=at.get(n);(c!==fi||r!==pi)&&yc(n,c,r,p);let m,b={position:"absolute",top:`${u}px`,left:`${d}px`,width:`${l}px`,height:`${a}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!on(p))Object.assign(n.style,b),m=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:p.duration,easing:"ease-out"});else{const[f,g]=gi(p(n,"remove",y));(g==null?void 0:g.styleReset)!==!1&&(b=(g==null?void 0:g.styleReset)||b,Object.assign(n.style,b)),m=new Animation(f),m.play()}zt.set(n,m),m.addEventListener("finish",Pi.bind(null,n,b))}function yc(n,i,s,o){const c=fi-i,r=pi-s,u=document.documentElement.style.scrollBehavior;if(getComputedStyle(Rt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+c,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let a=l.clientHeight,p=l.clientWidth;const y=performance.now();function m(){requestAnimationFrame(()=>{if(!on(o)){const b=a-l.clientHeight,f=p-l.clientWidth;y+o.duration>performance.now()?(window.scrollTo({left:window.scrollX-f,top:window.scrollY-b}),a=l.clientHeight,p=l.clientWidth,m()):document.documentElement.style.scrollBehavior=u}})}m()}function vc(n){const i=at.get(n),[s,,o]=Ns(n,i,Gt(n));let c=n.parentElement;for(;c&&(getComputedStyle(c).position==="static"||c instanceof HTMLBodyElement);)c=c.parentElement;c||(c=document.body);const r=getComputedStyle(c),u=at.get(c)||Gt(c),d=Math.round(i.top-u.top)-vt(r.borderTopWidth),l=Math.round(i.left-u.left)-vt(r.borderLeftWidth);return[d,l,s,o]}function Os(n,i={}){return Jn&&qt&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!on(i)&&!i.disrespectUserMotionPreference||(en.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),Ds(n,Ut,uc,c=>qt==null?void 0:qt.observe(c)),on(i)?Kt.set(n,i):Kt.set(n,{duration:250,easing:"ease-in-out",...i}),Jn.observe(n,{childList:!0}),Ms.add(n))),Object.freeze({parent:n,enable:()=>{en.add(n)},disable:()=>{en.delete(n)},isEnabled:()=>en.has(n)})}function bi(n){const i=Y(null),[s,o]=E(),c=r=>{s&&(r?s.enable():s.disable())};return ie(()=>{i.current instanceof HTMLElement&&o(Os(i.current,n||{}))},[]),[i,c]}const wc=window.matchMedia("(display-mode: standalone)").matches;function kc({onClose:n}){const{_:i}=de(),{masto:s}=ce(),o=ye.local.getJSON("accounts"),c=wt(),r=o.length>1,[u,d]=Et(a=>a+1,0),[l]=bi();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(h,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:l,children:o.map((a,p)=>{const y=a.info.id===c,m=p===0;return e("li",{children:[e("div",{children:[r&&e("span",{class:`current ${y?"is-current":""}`,children:e(T,{icon:"check-circle",alt:i({id:"Hp1l6f"})})}),e(pt,{url:a.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(y)try{const b=await s.v1.accounts.$select(a.info.id).fetch();a.info=b,ye.local.setJSON("accounts",o),d()}catch{}}}),e(gt,{account:r?{...a.info,acct:/@/.test(a.info.acct)?a.info.acct:`${a.info.acct}@${a.instanceURL}`}:a.info,showAcct:!0,onClick:()=>{y?x.showAccount=`${a.info.username}@${a.instanceURL}`:(Cn(a.info.id),location.reload())}})]}),e("div",{class:"actions",children:[m&&r&&e(U,{children:[e("span",{class:"tag",children:e(h,{id:"ovBPCi"})})," "]}),e(lt,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[r&&e(U,{children:[e(ve,{disabled:y,onClick:()=>{Cn(a.info.id),location.reload()},children:[e(T,{icon:"transfer"})," ",e(h,{id:"3t/Nrv"})]}),!wc&&!y&&e(qe,{href:`./?account=${a.info.id}`,target:"_blank",children:[e(T,{icon:"external"}),e("span",{children:e(h,{id:"PZgZtY"})})]}),e(Ge,{})]}),e(ve,{onClick:()=>{x.showAccount=`${a.info.username}@${a.instanceURL}`},children:[e(T,{icon:"user"}),e("span",{children:e(h,{id:"40z2Fm"})})]}),e(Ge,{}),r&&e(ve,{disabled:m,onClick:()=>{o.splice(p,1),o.unshift(a),ye.local.setJSON("accounts",o),d()},children:[e(T,{icon:"check-circle"}),e("span",{children:e(h,{id:"PPcets"})})]}),e(ht,{subMenu:!0,confirmLabel:e(U,{children:[e(T,{icon:"exit"}),e("span",{children:e(h,{id:"k08LxG",values:{0:a.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!y,menuItemClassName:"danger",onClick:()=>{o.splice(p,1),ye.local.setJSON("accounts",o),location.href=location.pathname||"/"},children:[e(T,{icon:"exit"}),e("span",{children:e(h,{id:"CXk1bI"})})]})]})]})]},a.info.id)})}),e("p",{children:e(ge,{to:"/login",class:"button plain2",onClick:n,children:[e(T,{icon:"plus"})," ",e("span",{children:e(h,{id:"Is7/PB"})})]})}),r&&e("p",{children:e("small",{children:e(h,{id:"52x24e",components:{0:e("i",{})}})})})]})})]})}const yi="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",Sc={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function vi(){const{i18n:n}=de(),i=Ce(()=>bo.map(s=>{var u,d;const o=Sc[s]||s.replace(/-[a-z]+$/i,""),c=xt({code:o,locale:s,fallback:(u=zn.find(l=>l.code===s))==null?void 0:u.nativeName}),r=xt({code:o,locale:n.locale,fallback:(d=zn.find(l=>l.code===s))==null?void 0:d.name});return{code:s,regionlessCode:o,_common:r,native:c}}).sort((s,o)=>{const c=s._common.localeCompare(o._common,n.locale);return c!==0?c:s.code<o.code?-1:s.code>o.code?1:0}),[]);return e("label",{class:"lang-selector",children:["🌐"," ",e("select",{class:"small",value:n.locale||yo,onChange:s=>{ye.local.set("lang",s.target.value),vo(s.target.value)},children:[i.map(({code:s,regionlessCode:o,native:c})=>{var d;const r=xt({code:o,locale:n.locale,fallback:(d=zn.find(l=>l.code===s))==null?void 0:d.name});return e("option",{value:s,"data-regionless-code":o,children:!!r&&r!==c?`${c} - ${r}`:c},s)}),void 0]})]})}function Di(n){const{masto:i}=ce();return i.v1.push.subscription.create(n)}function Cc(){const{masto:n}=ce();return n.v1.push.subscription.fetch()}function _c(n){const{masto:i}=ce();return i.v1.push.subscription.update(n)}function Ic(){const{masto:n}=ce();return n.v1.push.subscription.remove()}function Nn(){return"serviceWorker"in navigator&&"PushManager"in window}function Tc(){return navigator.serviceWorker.getRegistration()}async function wi(){const n=await Tc(),i=n?await n.pushManager.getSubscription():void 0;return{registration:n,subscription:i}}function zs(n){const i="=".repeat((4-n.length%4)%4),s=`${n}${i}`.replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(s),c=new Uint8Array(o.length);for(let r=0;r<o.length;++r)c[r]=o.charCodeAt(r);return c}async function Ac(){if(!Nn())return;const{subscription:n}=await wi();let i=null;try{i=await Cc()}catch(s){if(!/(not found|unknown)/i.test(s.message))throw s}if(i&&n){const s=i.endpoint===n.endpoint,o=Zn(),c=i.serverKey===o;if(!s)throw new Error("Backend subscription endpoint changed");if(!c)throw new Error("Backend subscription key and vapid key changed")}if(n&&!i){const s=Zn();if(s){const{applicationServerKey:o}=n.options,c=zs(s).toString(),r=new Uint8Array(o).toString();if(!(c===r))throw await n.unsubscribe(),new Error("Subscription key and vapid key changed")}}return{subscription:n,backendSubscription:i}}async function Oi({data:n,policy:i}){if(!Nn())return;let{registration:s,subscription:o}=await wi(),c=null;if(o)try{c=await _c({data:n,policy:i})}catch{c=await Di({subscription:o,data:n,policy:i})}else{const r=Zn();if(!r)throw new Error("No server key found");o=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:zs(r)}),c=await Di({subscription:o,data:n,policy:i})}return{subscription:o,backendSubscription:c}}async function zi(){if(!Nn())return;const{subscription:n}=await wi();n&&(await Ic(),await n.unsubscribe())}const xc={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_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},Ui=16,Pt=[14,15,16,17,18,19,20],{PHANPY_WEBSITE:Bi,PHANPY_PRIVACY_POLICY_URL:Rc,PHANPY_TRANSLANG_INSTANCES:Ec,PHANPY_IMG_ALT_API_URL:Lc,PHANPY_GIPHY_API_KEY:Mc}=xc,Fi=Object.entries(Uo.tl).map(([n,i])=>({code:n,name:i})),$c="TransLang API";function Nc({onClose:n}){var f;const{_:i}=de(),s=Ve(x),o=ye.local.get("theme")||"auto",c=Y(),r=s.settings.contentTranslationTargetLanguage||null,u=Cs(),d=xt(u),l=ye.local.get("textSize")||Ui,[a,p]=E(ye.account.get("preferences")||{}),{masto:y,authenticated:m,instance:b}=ce();return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${l}px`},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(h,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:c,onInput:g=>{g.preventDefault();const w=new FormData(c.current).get("theme"),C=document.documentElement;if(w==="auto"){C.classList.remove("is-light","is-dark");const S=document.querySelector('meta[data-theme-setting="manual"]');S&&(S.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(A=>{A.name="theme-color"})}else{C.classList.toggle("is-light",w==="light"),C.classList.toggle("is-dark",w==="dark");const S=document.querySelector('meta[data-theme-setting="manual"]');S&&(S.name="theme-color",S.content=w==="light"?S.dataset.themeLightColor:S.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(A=>{A.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",w==="auto"?"dark light":w),w==="auto"?ye.local.del("theme"):ye.local.set("theme",w)},children:e("div",{class:"radio-group",children:[e("label",{children:[e("input",{type:"radio",name:"theme",value:"light",defaultChecked:o==="light"}),e("span",{children:e(h,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:o==="dark"}),e("span",{children:e(h,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:o!=="light"&&o!=="dark"}),e("span",{children:e(h,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(h,{id:"7r6sCa"})})}),e("div",{class:"range-group",children:[e("span",{style:{fontSize:Pt[0]},children:e(h,{id:"J6ypuD"})})," ",e("input",{type:"range",min:Pt[0],max:Pt[Pt.length-1],step:"1",value:l,list:"sizes",onChange:g=>{const v=parseInt(g.target.value,10);document.documentElement.style.setProperty("--text-size",`${v}px`),v===Ui?ye.local.del("textSize"):ye.local.set("textSize",g.target.value)}})," ",e("span",{style:{fontSize:Pt[Pt.length-1]},children:e(h,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:Pt.map(g=>e("option",{value:g}))})]})]}),e("li",{children:[e("span",{children:[e("label",{children:e(h,{id:"CeJHfb"})}),e("br",{}),e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener",children:e(h,{id:"FFmj1D"})})})]}),e(vi,{})]})]})}),m&&e(U,{children:[e("h3",{children:e(h,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:e("li",{children:[e("div",{children:e("label",{for:"posting-privacy-field",children:[e(h,{id:"NAjVvt"})," ",e(T,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]})}),e("div",{children:e("select",{id:"posting-privacy-field",value:a["posting:default:visibility"]||"public",onChange:g=>{const{value:v}=g.target;(async()=>{try{await y.v1.accounts.updateCredentials({source:{privacy:v}}),p({...a,"posting:default:visibility":v}),ye.account.set("preferences",{...a,"posting:default:visibility":v})}catch{alert(i({id:"Oa+KBY"}))}})()},children:[e("option",{value:"public",children:e(h,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(h,{id:"WDcQq9"})}),e("option",{value:"private",children:e(h,{id:"o34OrG"})})]})})]})})}),e("p",{class:"section-postnote",children:[e(T,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(h,{id:"xlsg7n",values:{instance:b},components:{0:e("a",{href:`https://${b}/`,target:"_blank",rel:"noopener"})}})})]})]}),e("h3",{children:e(h,{id:"ivdhsq"})}),e("section",{children:e("ul",{children:[e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.autoRefresh,onChange:g=>{x.settings.autoRefresh=g.target.checked}})," ",e(h,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.boostsCarousel,onChange:g=>{x.settings.boostsCarousel=g.target.checked}})," ",e(h,{id:"TSbnoW"})]})}),!!Ec&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslation,onChange:g=>{const{checked:v}=g.target;x.settings.contentTranslation=v,v||(x.settings.contentTranslationTargetLanguage=null)}})," ",e(h,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${s.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(h,{id:"zXCa9e"})," ",e("select",{value:r||"",disabled:!s.settings.contentTranslation,style:{width:"10em"},onChange:g=>{x.settings.contentTranslationTargetLanguage=g.target.value||null},children:[e("option",{value:"",children:e(h,{id:"jNCSyx",values:{systemTargetLanguageText:d}})}),e("option",{disabled:!0,children:"──────────"}),Fi.map(g=>{const v=xt({code:g.code,fallback:g.name}),w=xt({code:g.code,locale:g.code}),C=w&&v!==w;return e("option",{value:g.code,children:C?`${w} - ${v}`:v})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(h,{id:"cc0NrU",values:{0:s.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:Fi.map(g=>{const v=xt({code:g.code,fallback:g.name}),w=xt({code:g.code,locale:g.code}),C=w&&v!==w;return e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationHideLanguages.includes(g.code),onChange:S=>{const{checked:k}=S.target;k?x.settings.contentTranslationHideLanguages.push(g.code):x.settings.contentTranslationHideLanguages=s.settings.contentTranslationHideLanguages.filter(A=>A!==g.code)}})," ",C?e("span",{children:[w," ",e("span",{class:"insignificant ib",children:["- ",v]})]}):v]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"7I3sDQ",values:{TRANSLATION_API_NAME:$c},components:{0:e("a",{href:"https://github.com/cheeaun/translang-api",target:"_blank",rel:"noopener"})}})})}),e("hr",{}),e("div",{children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationAutoInline,disabled:!s.settings.contentTranslation,onChange:g=>{x.settings.contentTranslationAutoInline=g.target.checked}})," ",e(h,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!Mc&&m&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.composerGIFPicker,onChange:g=>{x.settings.composerGIFPicker=g.target.checked}})," ",e(h,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener"})}})})})]}),!!Lc&&m&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.mediaAltGenerator,onChange:g=>{x.settings.mediaAltGenerator=g.target.checked}})," ",e(h,{id:"9q5uor"})," ",e(T,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener"})}})})})]}),m&&et("@mastodon/grouped-notifications")&&((f=ps())==null?void 0:f.mastodon)>=2&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.groupedNotificationsAlpha,onChange:g=>{x.settings.groupedNotificationsAlpha=g.target.checked}})," ",e(h,{id:"aGziA/"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"X17jCM"})})})]}),m&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.shortcutSettingsCloudImportExport,onChange:g=>{x.settings.shortcutSettingsCloudImportExport=g.target.checked}})," ",e(h,{id:"570qTm"})," ",e(T,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"fHf1v/"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.cloakMode,onChange:g=>{x.settings.cloakMode=g.target.checked}})," ",e(h,{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(h,{id:"T/hglb"})})})]}),m&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{x.showDrafts=!0,x.showSettings=!1},children:e(h,{id:"krk5ws"})})})]})}),m&&e(Pc,{onClose:n}),e("h3",{children:e(h,{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:yi,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",onClick:g=>{g.preventDefault(),x.showAccount="phanpy@hachyderm.io"},children:"@phanpy"}),e("br",{}),e(h,{id:"AZ2EoP",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank",rel:"noopener"}),1:e("a",{href:"https://mastodon.social/@cheeaun",rel:"noopener",onClick:g=>{g.preventDefault(),x.showAccount="cheeaun@mastodon.social"}})}})]})]}),e("p",{children:[e("a",{href:"https://github.com/sponsors/cheeaun",target:"_blank",rel:"noopener",children:e(h,{id:"O4cLCR"})})," ","·"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener",children:e(h,{id:"Ng063n"})})," ","·"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener",children:"Patreon"})," ","·"," ",e("a",{href:Rc,target:"_blank",rel:"noopener",children:e(h,{id:"LcET2C"})})]}),e("p",{children:[Bi&&e(U,{children:[e(h,{id:"pFnMHn",values:{0:Bi.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(h,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/0d0fa92",target:"_blank",rel:"noopener",children:e(It,{datetime:new Date("2025-04-26T09:46:35.214Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2025-04-26T09:46:35.214Z".slice(0,10).replace(/-/g,".")}.0d0fa92`,onClick:g=>{g.target.select();try{navigator.clipboard.writeText(g.target.value),pe(i({id:"PiPfua"}))}catch{pe(i({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function Pc({onClose:n}){const{_:i}=de();if(!Nn())return null;const{instance:s}=ce(),[o,c]=E("default"),r=Y(),[u,d]=E(!1),[l,a]=E(!1),p=Y();ie(()=>{(async()=>{c("loading");try{const{subscription:m,backendSubscription:b}=await Ac();if(b!=null&&b.policy&&b.policy!=="none"){d(!0);const{alerts:f,policy:g}=b;p.current=g;const{elements:v}=r.current,w=v.namedItem("policy");w&&(w.value=g),Object.entries(f).forEach(([C,S])=>{const k=v.namedItem(C);(k==null?void 0:k.type)==="checkbox"&&(k.checked=!!S)})}c("default")}catch(m){/outside.*authorized/i.test(m.message)?a(!0):alert((m==null?void 0:m.message)||m),c("error")}})()},[]);const y=o==="loading";return e("form",{ref:r,onChange:()=>{setTimeout(()=>{const m=Object.fromEntries(new FormData(r.current)),b=!!m["policy-allow"],f={data:{policy:m.policy,alerts:{mention:!!m.mention,favourite:!!m.favourite,reblog:!!m.reblog,follow:!!m.follow,follow_request:!!m.followRequest,poll:!!m.poll,update:!!m.update,status:!!m.status}}};let g=0;Object.keys(f.data.alerts).forEach(w=>{f.data.alerts[w]?g++:delete f.data.alerts[w]});const v=p.current!==f.data.policy;b&&g>0?v?zi().then(()=>{Oi(f)}).catch(w=>{alert(i({id:"I6pdY3"}))}):Oi(f).catch(w=>{alert(i({id:"I6pdY3"}))}):zi().catch(w=>{alert(i({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(h,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:y||l,name:"policy-allow",checked:u,onChange:async m=>{const{checked:b}=m.target;if(b){const f=await Notification.requestPermission();f==="granted"?d(!0):(d(!1),f==="denied"&&alert(i({id:"6LUsk7"})))}else d(!1)}})," ",e(h,{id:"qYNCa1",values:{0:[{value:"all",label:i({id:"+niKJH"})},{value:"followed",label:i({id:"x2NYtp"})},{value:"follower",label:i({id:"PBFNgg"})}].map(m=>e("option",{value:m.value,children:m.label}))},components:{0:e("select",{name:"policy",disabled:y||l||!u})}})]}),e("div",{class:"shazam-container no-animation",style:{width:"100%"},hidden:!u,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"sub-section",children:e("ul",{children:[{value:"mention",label:i({id:"/bZzdR"})},{value:"favourite",label:i({id:"zZOZj7"})},{value:"reblog",label:i({id:"puY2t0"})},{value:"follow",label:i({id:"aaJhcT"})},{value:"followRequest",label:i({id:"6Fs1Ba"})},{value:"poll",label:i({id:"wNExRS"})},{value:"update",label:i({id:"K/EtE6"})},{value:"status",label:i({id:"2yr1/p"})}].map(m=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:m.value})," ",m.label]})}))})})})}),l&&e("div",{class:"sub-section",children:e("p",{children:e(h,{id:"8d0b8B",components:{0:e(ge,{to:`/login?instance=${s}`,onClick:n}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(h,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const Qn=()=>{let n=setTimeout(()=>{var s,o;const i=document.getElementById("columns");if(i){const c=i.querySelector(".deck-container.focus");if(c)c.focus();else{const r=Array.from(i.querySelectorAll(".deck-container")).find(u=>u.getBoundingClientRect().left>=0);r?r.focus():(o=(s=i.querySelector(".deck-container"))==null?void 0:s.focus)==null||o.call(s)}}else{const c=document.querySelectorAll("#modal-container > *");if(c!=null&&c.length){const l=c[c.length-1],a=l.querySelector('[tabindex="-1"]')||l;if(a){a.focus();return}}if(document.querySelector(".deck-backdrop"))return;const u=document.querySelectorAll(".deck-container"),d=u[u.length-1];d&&d.tabIndex===-1&&d.focus()}},100);return()=>clearTimeout(n)};function Us(n){if(!n)return;const i=Zt(),s=Y(i.pathname);ie(()=>{s.current&&i.pathname!==s.current&&(n==null||n())},[i.pathname,n])}const Bs=1e3*60,Dc=24*60*60*1e3,ei=bt(async()=>{const{masto:n}=ce(),i=await n.v1.lists.list();return i.sort((s,o)=>s.title.localeCompare(o.title)),i.length&&setTimeout(()=>{ye.account.set("lists",{lists:i,updatedAt:Date.now()})},1),i},{maxAge:Bs});async function ln(){try{const{lists:n,updatedAt:i}=ye.account.get("lists")||{};return n!=null&&n.length?(Date.now()-i>Dc&&ei(),n):await ei()}catch{return[]}}const Oc=bt(n=>{const{masto:i}=ce();return i.v1.lists.$select(n).fetch()},{maxAge:Bs});async function Fs(n){const{lists:i}=ye.account.get("lists")||{};if(i!=null&&i.length){const s=i.find(o=>o.id===n);if(s)return s}try{return Oc(n)}catch{return null}}async function zc(n){const i=await Fs(n);return(i==null?void 0:i.title)||""}function Uc(n){const{lists:i}=ye.account.get("lists")||{};i!=null&&i.length&&(i.push(n),i.sort((s,o)=>s.title.localeCompare(o.title)),ye.account.set("lists",{lists:i,updatedAt:Date.now()}))}function Bc(n){const{lists:i}=ye.account.get("lists")||{};if(i!=null&&i.length){const s=i.findIndex(o=>o.id===n.id);s!==-1&&(i[s]=n,i.sort((o,c)=>o.title.localeCompare(c.title)),ye.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Fc(n){const{lists:i}=ye.account.get("lists")||{};if(i!=null&&i.length){const s=i.findIndex(o=>o.id===n);s!==-1&&(i.splice(s,1),ye.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function ki({list:n,onClose:i}){const{_:s}=de(),{masto:o}=ce(),[c,r]=E("default"),u=!!n,d=Y(),l=Y(),a=Y();ie(()=>{u&&(d.current.value=n.title,l.current.value=n.repliesPolicy,a.current&&(a.current.checked=n.exclusive))},[u]);const p=et("@mastodon/list-exclusive")||et("@gotosocial/list-exclusive");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})})," ",e("header",{children:e("h2",{children:s(u?{id:"tuhghE"}:{id:"Sb2gYF"})})}),e("main",{children:e("form",{class:"list-form",onSubmit:y=>{y.preventDefault();const m=new FormData(y.target),b=m.get("title"),f=m.get("replies_policy"),g=m.get("exclusive")==="on";r("loading"),(async()=>{try{let v;u?v=await o.v1.lists.$select(n.id).update({title:b,replies_policy:f,exclusive:g}):v=await o.v1.lists.create({title:b,replies_policy:f,exclusive:g}),r("default"),i==null||i({state:"success",list:v}),setTimeout(()=>{u?Bc(v):Uc(v)},1)}catch{r("error"),alert(s(u?{id:"R7ep1i"}:{id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(h,{id:"6YtxFj"})," ",e("input",{ref:d,type:"text",id:"list-title",name:"title",required:!0,disabled:c==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:l,name:"replies_policy",required:!0,disabled:c==="loading",children:[e("option",{value:"list",children:e(h,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(h,{id:"Mr53YX"})}),e("option",{value:"none",children:e(h,{id:"PM7llw"})})]})}),p&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:a,type:"checkbox",name:"exclusive",disabled:c==="loading"})," ",e(h,{id:"jxxYp0"})]})}),e("div",{class:"list-form-footer",children:[e("button",{type:"submit",disabled:c==="loading",children:s(u?{id:"tfDRzk"}:{id:"hYgDIe"})}),u&&e(ht,{disabled:c==="loading",align:"end",menuItemClassName:"danger",confirmLabel:s({id:"+kQ/cY"}),onClick:()=>{r("loading"),(async()=>{try{await o.v1.lists.$select(n.id).remove(),r("default"),i==null||i({state:"deleted"}),setTimeout(()=>{Fc(n.id)},1)}catch{r("error"),alert(s({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:c==="loading",children:e(h,{id:"Jb6/SB"})})})]})]})})]})}const Hc=[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],Ft={0:{id:"9ZP9cc"},300:st(5,"minute"),1800:st(30,"minute"),3600:st(1,"hour"),21600:st(6,"hour"),86400:st(1,"day"),259200:st(3,"day"),604800:st(1,"week"),2592e3:st(30,"day")},Hi=80,Hs=1e3*60*10;function qc(n,i){return i.v1.accounts.familiarFollowers.fetch({id:[n]})}const Yc=bt(qc,{maxAge:Hs});async function jc(n,i){const s=i.v1.accounts.$select(n).statuses.list({limit:20}).next(),{value:o}=await s,c={total:o.length,originals:0,replies:0,boosts:0};return o.forEach(r=>{r.reblog?c.boosts++:r.inReplyToId&&r.inReplyToAccountId!==r.account.id?c.replies++:c.originals++}),o.length&&(c.daysSinceLastPost=Math.ceil((Date.now()-new Date(o[o.length-1].createdAt))/864e5)),c}const Vc=bt(jc,{maxAge:Hs});function qs({account:n,fetchAccount:i=()=>{},standalone:s,instance:o,authenticated:c}){const{i18n:r,_:u}=de(),{masto:d,authenticated:l}=ce({instance:o}),{masto:a,instance:p}=ce(),[y,m]=E("default"),b=typeof n=="string",[f,g]=E(b?null:n),v=Ce(()=>o===p,[o,p]);ie(()=>{if(!b){g(n);return}m("loading"),(async()=>{try{const N=await i();x.accounts[`${N.id}@${o}`]=N,g(N),m("default")}catch{g(null),m("error")}})()},[b,n,i]);const{acct:w,avatar:C,avatarStatic:S,bot:k,createdAt:A,displayName:_,emojis:I,fields:R,followersCount:L,followingCount:B,group:P,id:q,lastStatusAt:Q,locked:te,note:J,statusesCount:G,url:z,username:ue,memorial:M,moved:F,roles:V,hideCollections:re}=f||{};let H=!1,{header:se,headerStatic:be}=f||{};(!se||/missing\.png$/.test(se))&&C&&!/missing\.png$/.test(C)&&(se=C,H=!0,S&&!/missing\.png$/.test(S)&&(be=S));const we=Ce(()=>q===wt(),[q]);ie(()=>{const N=!!(f!=null&&f.id&&(f!=null&&f.username)&&(f!=null&&f.acct)&&(f!=null&&f.avatar)&&(f!=null&&f.avatarStatic)&&(f!=null&&f.displayName)&&(f!=null&&f.url));if(we&&o&&N){const Z=ye.local.getJSON("accounts");let j=!1;Z.forEach(K=>{K.info.id===f.id&&K.instanceURL===o&&(K.info=f,j=!0)}),j&&ye.local.setJSON("accounts",Z)}},[we,f,o]);const W=Ce(()=>{var j;if(!z)return null;const N=(j=URL.parse(z))==null?void 0:j.hostname;return N?rn.toUnicode(N):null},[z]),[le,Ee]=E([]),$e=Y(),De=Y([]);async function ze(N){var Oe;(N||!$e.current)&&($e.current=d.v1.accounts.$select(q).followers.list({limit:Hi}));const Z=await $e.current.next();if(we||!v)return Z;const{value:j}=Z;let K=[];if(N){let Te=[];try{Te=await d.v1.accounts.familiarFollowers.fetch({id:[q]})}catch{}De.current=((Oe=Te==null?void 0:Te[0])==null?void 0:Oe.accounts)||[],K=[...De.current,...j.filter(_e=>!De.current.some(Be=>Be.id===_e.id))]}else j!=null&&j.length&&(K=j.filter(Te=>!De.current.some(_e=>_e.id===Te.id)));return{...Z,value:K}}const Le=Y();async function Ae(N){return(N||!Le.current)&&(Le.current=d.v1.accounts.$select(q).following.list({limit:Hi})),await Le.current.next()}const X=s?"div":ge,ke=o?`/${o}/a/${q}`:`/a/${q}`,[Ne,ne]=E([]),[oe,xe]=E(),[O,ee]=E("default"),fe=!!(oe!=null&&oe.total),D=async N=>{try{const Z=await Yc(N,a);ne(Z[0].accounts.slice(0,Kc))}catch{}},ae=async()=>{if(q){ee("loading");try{const N=await Vc(q,d);xe(N),ee("default")}catch{ee("error")}}},Ie=ot(({relationship:N,currentID:Z})=>{N.following||(D(Z),!s&&G>0&&ae())},[s,q,G]),Se=ot(N=>{N.id===q&&(g(N),x.accounts[`${N.id}@${o}`]=N)},[q,o]),Pe=b&&n&&/^https?:\/\//.test(n),[je,$]=E(!1);return e(U,{children:[e("div",{tabIndex:"-1",class:`account-container ${y==="loading"?"skeleton":""}`,style:{"--header-color-1":le[0],"--header-color-2":le[1],"--header-color-3":le[2],"--header-color-4":le[3]},children:[y==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(h,{id:"44hICK"})}),b?e("p",{children:Pe?e("a",{href:n,target:"_blank",rel:"noopener",children:n}):e("code",{class:"insignificant",children:n})}):e("p",{children:e("a",{href:z,target:"_blank",rel:"noopener",children:[e(h,{id:"Aadw0+"})," ",e(T,{icon:"external"})]})})]}),y==="loading"?e(U,{children:[e("header",{children:e(ft,{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(h,{id:"x5LEuB"})]}),e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"following.stats"})]}),e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"+owNNn"})]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain",disabled:!0,children:e(T,{icon:"more",size:"l",alt:u({id:"2FYpfJ"})})})})]})]})]}):f&&e(U,{children:[!!F&&e("div",{class:"account-moved",children:[e("p",{children:e(h,{id:"C6cVP/",values:{displayName:_},components:{0:e("b",{})}})}),e(ft,{account:F,instance:o,onClick:N=>{N.stopPropagation(),x.showAccount=F}})]}),!!se&&!/missing\.png$/.test(se)&&e("img",{src:se,alt:"",class:`header-banner ${H?"header-is-avatar":""}`,onError:N=>{N.target.crossOrigin?N.target.src!==be?N.target.src=be:(N.target.removeAttribute("crossorigin"),N.target.src=se):N.target.src!==be?N.target.src=be:N.target.remove()},crossOrigin:"anonymous",onLoad:N=>{N.target.classList.add("loaded");try{const Z=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),j=Z.getContext("2d",{willReadFrequently:!0});Z.width=N.target.width,Z.height=N.target.height,j.imageSmoothingEnabled=!1,j.drawImage(N.target,0,0);const K=10,Te=[j.getImageData(0,0,K,K).data,j.getImageData(N.target.width-K,0,K,K).data,j.getImageData(0,N.target.height-K,K,K).data,j.getImageData(N.target.width-K,N.target.height-K,K,K).data].map(_e=>{let Be=0,Ze=0,me=0,Me=0;for(let nt=0;nt<_e.length;nt+=4)Be+=_e[nt],Ze+=_e[nt+1],me+=_e[nt+2],Me+=_e[nt+3];const We=_e.length/4;return[Be/We,Ze/We,me/We,Me/We]}).map(_e=>{const[Be,Ze,me,Me]=Zc(_e);return`rgba(${Be}, ${Ze}, ${me}, ${Me})`});Ee(Te)}catch{}}}),e("header",{children:s?e(lt,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(ft,{account:f,instance:o,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(ia,{acct:w,instance:o})}),e(ve,{onClick:()=>{const N=w.includes("@")?`@${w}`:`@${w}@${o}`;try{navigator.clipboard.writeText(N),pe(u({id:"zJoEwS"}))}catch{pe(u({id:"BC0lSD"}))}},children:[e(T,{icon:"link"}),e("span",{children:e(h,{id:"27x6gl"})})]}),e(ve,{href:z,target:"_blank",children:[e(T,{icon:"external"}),e("span",{children:e(h,{id:"Bz5hLl"})})]}),e(Ge,{}),e(ve,{onClick:()=>{x.showMediaModal={mediaAttachments:[{type:"image",url:S}]}},children:[e(T,{icon:"user"}),e("span",{children:e(h,{id:"7WYl2I"})})]}),e(ve,{onClick:()=>{x.showMediaModal={mediaAttachments:[{type:"image",url:be}]}},children:[e(T,{icon:"media"}),e("span",{children:e(h,{id:"ZNme5R"})})]}),l&&we&&et("@mastodon/profile-edit")&&e(U,{children:[e(Ge,{}),e(ve,{onClick:()=>{$(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:e(h,{id:"9OpVZg"})})]})]})]}):e(ft,{account:f,instance:o,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!M&&e("span",{class:"tag",children:e(h,{id:"prdIOK"})}),!!k&&e("span",{class:"tag",children:[e(T,{icon:"bot"})," ",e(h,{id:"9Vdq+j"})]}),!!P&&e("span",{class:"tag",children:[e(T,{icon:"group"})," ",e(h,{id:"L8fEEm"})]}),V==null?void 0:V.map(N=>e("span",{class:"tag",children:[N.name,!!W&&e(U,{children:[" ",e("span",{class:"more-insignificant",children:W})]})]})),e("div",{class:"note",dir:"auto",onClick:_s({instance:p}),dangerouslySetInnerHTML:{__html:Wn(J,{emojis:I})}}),e("div",{class:"account-metadata-box",children:[(R==null?void 0:R.length)>0&&e("div",{class:"profile-metadata",children:R.map(({name:N,value:Z,verifiedAt:j},K)=>e("div",{class:`profile-field ${j?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(Is,{text:N,emojis:I})," ",!!j&&e(T,{icon:"check-circle",size:"s",alt:u({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:Wn(Z,{emojis:I})}})]},N+K))}),e("div",{class:"stats",children:[e(X,{tabIndex:0,to:ke,onClick:()=>{setTimeout(()=>{x.showGenericAccounts={id:"followers",heading:u({id:"x5LEuB"}),fetchAccounts:ze,instance:o,excludeRelationshipAttrs:we?["followedBy"]:[],blankCopy:re?u({id:"BRV/wh"}):void 0}},0)},children:[!!Ne.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:Ne.map(N=>e(pt,{url:N.avatarStatic,size:"s",alt:`${N.displayName} @${N.acct}`,squircle:N==null?void 0:N.bot}))})}),e("span",{title:L,children:Je(L)})," ",e(h,{id:"x5LEuB"})]}),e(X,{class:"insignificant",tabIndex:0,to:ke,onClick:()=>{setTimeout(()=>{x.showGenericAccounts={heading:u({id:"following.stats"}),fetchAccounts:Ae,instance:o,excludeRelationshipAttrs:we?["following"]:[],blankCopy:re?u({id:"BRV/wh"}):void 0}},0)},children:[e("span",{title:B,children:Je(B)})," ",e(h,{id:"following.stats"}),e("br",{})]}),e(X,{class:"insignificant",to:ke,children:[e("span",{title:G,children:Je(G)})," ",e(h,{id:"+owNNn"})]}),!!A&&e("div",{class:"insignificant",children:e(h,{id:"PCcEFZ",values:{0:ct(A,{hideTime:!0})},components:{0:e("time",{datetime:A})}})})]})]}),!!oe&&e(X,{to:ke,class:"account-metadata-box",children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:fe?e("div",{class:"posting-stats",title:u({id:"wiuWLe",values:{0:(oe.originals/oe.total).toLocaleString(r.locale||void 0,{style:"percent"}),1:(oe.replies/oe.total).toLocaleString(r.locale||void 0,{style:"percent"}),2:(oe.boosts/oe.total).toLocaleString(r.locale||void 0,{style:"percent"})}}),children:[e("div",{children:oe.daysSinceLastPost<365?he._({id:"oZUtTk",values:{0:oe.total,1:oe.daysSinceLastPost,2:oe.daysSinceLastPost,3:oe.daysSinceLastPost,4:oe.total,5:oe.total,6:oe.daysSinceLastPost}}):he._({id:"JvA7Mo",values:{0:oe.total,1:oe.total}})}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${oe.originals/oe.total*100}%`,"--replies-percentage":`${(oe.originals+oe.replies)/oe.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(h,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ",e(h,{id:"N8UzTV"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ",e(h,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(h,{id:"vl3XTJ"})})})})}),!F&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!oe,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:O==="loading",onClick:()=>{ae()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${O==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),e(h,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(Gc,{info:f,instance:o,standalone:s,authenticated:c,onRelationshipChange:Ie,onProfileUpdate:Se,setShowEditProfile:$})})]})]}),!!je&&e(He,{onClose:()=>{$(!1)},children:e(ta,{onClose:({state:N,account:Z}={})=>{$(!1),N==="success"&&Z&&Se(Z)}})})]})}const Kc=3;function Gc({info:n,instance:i,standalone:s,authenticated:o,onRelationshipChange:c=()=>{},onProfileUpdate:r=()=>{},setShowEditProfile:u=()=>{}}){var Ne;if(!n)return null;const{_:d,_:l}=de(),{masto:a,instance:p,authenticated:y}=ce(),m=i===p,[b,f]=E("default"),[g,v]=E(null),{id:w,acct:C,url:S,username:k,locked:A,lastStatusAt:_,note:I,fields:R,moved:L}=n,B=Y(w),{following:P,showingReblogs:q,notifying:Q,followedBy:te,blocking:J,blockedBy:G,muting:z,mutingNotifications:ue,requested:M,domainBlocking:F,endorsed:V,note:re}=g||{},[H,se]=E(null),[be,we]=E(!1),W=C.includes("@")?C:`${C}@${i}`;ie(()=>{if(n){const ne=wt();let oe;(async()=>{if(m&&o)oe=w;else if(!m&&y){const O=n.acct.includes("@");try{const ee=await a.v2.search.fetch({q:O?n.acct:`${n.username}@${i}`,type:"accounts",limit:1,resolve:!0});ee.accounts.length&&(oe=ee.accounts[0].id,se(ee.accounts[0]))}catch{}}if(!oe)return;if(ne===oe){we(!0);return}B.current=oe,f("loading");const xe=a.v1.accounts.relationships.fetch({id:[oe]});try{const O=await xe;if(f("default"),O.length){const ee=O[0];v(ee),c({relationship:ee,currentID:oe})}}catch{f("error")}})()}},[n,o]),ie(()=>{n&&be&&wo(n)},[n,be]);const le=b==="loading",[Ee,$e]=E(!1),[De,ze]=E(!1),[Le,Ae]=E(!1),[X,ke]=E([]);return e(U,{children:[e("div",{class:"actions",children:[e("span",{children:[te?e("span",{class:"tag",children:e(h,{id:"p3UO/y"})}):_?e("small",{class:"insignificant",children:e(h,{id:"F3cM1G",values:{0:ct(_,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),z&&e("span",{class:"tag danger",children:e(h,{id:"+IJm1Z"})}),J&&e("span",{class:"tag danger",children:e(h,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!re&&e("button",{type:"button",class:"private-note-tag",title:l({id:"zxFxcH"}),onClick:()=>{Ae(!0)},dir:"auto",children:e("span",{children:re})}),e(lt,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",disabled:le,children:e(T,{icon:"more",size:"l",alt:l({id:"2FYpfJ"})})}),onMenuChange:ne=>{P&&ne.open&&(async()=>{try{const oe=await a.v1.accounts.$select(B.current).lists.list();ke(oe)}catch{}})()},children:[y&&!be&&e(U,{children:[e(ve,{onClick:()=>{ks({draftStatus:{status:`@${(H==null?void 0:H.acct)||C} `}})},children:[e(T,{icon:"at"}),e("span",{children:e(h,{id:"3LkfZu",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(ve,{onClick:()=>{$e(!0)},children:[e(T,{icon:"translate"}),e("span",{children:e(h,{id:"R8mSiS"})})]}),et("@mastodon/profile-private-note")&&e(ve,{onClick:()=>{Ae(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:l(re?{id:"U+Gokq"}:{id:"VcQzRi"})})]}),P&&!!g&&e(U,{children:[e(ve,{onClick:()=>{f("loading"),(async()=>{try{const ne=await a.v1.accounts.$select(B.current).follow({notify:!Q});ne&&v(ne),f("default"),pe(ne.notifying?l({id:"jL3N0G",values:{username:k}}):l({id:"0h4/9h",values:{username:k}}))}catch(ne){alert(ne),f("error")}})()},children:[e(T,{icon:"notification"}),e("span",{children:l(Q?{id:"osJmEN"}:{id:"I92Z+b"})})]}),e(ve,{onClick:()=>{f("loading"),(async()=>{try{const ne=await a.v1.accounts.$select(B.current).follow({reblogs:!q});ne&&v(ne),f("default"),pe(ne.showingReblogs?l({id:"0X2KC8",values:{username:k}}):l({id:"cXWjH0",values:{username:k}}))}catch(ne){alert(ne),f("error")}})()},children:[e(T,{icon:"rocket"}),e("span",{children:l(q?{id:"GRUr8d"}:{id:"uREpT3"})})]})]}),P&&e(ve,{onClick:()=>{ze(!0)},children:[e(T,{icon:"list"}),X.length?e(U,{children:[e("small",{class:"menu-grow",children:[e(h,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:X.map(ne=>ne.title).join(", ")})]}),e("small",{class:"more-insignificant",children:X.length})]}):e("span",{children:e(h,{id:"sJ2yQc"})})]}),e(Ge,{})]}),e(ve,{onClick:()=>{const ne=`@${(H==null?void 0:H.acct)||W}`;try{navigator.clipboard.writeText(ne),pe(l({id:"zJoEwS"}))}catch{pe(l({id:"BC0lSD"}))}},children:[e(T,{icon:"copy"}),e("small",{children:[e(h,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",(H==null?void 0:H.acct)||W]})]})]}),e(ve,{href:S,target:"_blank",children:[e(T,{icon:"external"}),e("small",{class:"menu-double-lines",children:Wc(S)})]}),e("div",{class:"menu-horizontal",children:[e(ve,{onClick:()=>{try{navigator.clipboard.writeText(S),pe(l({id:"edWbV6"}))}catch{pe(l({id:"W1ewR0"}))}},children:[e(T,{icon:"link"}),e("span",{children:e(h,{id:"he3ygx"})})]}),(navigator==null?void 0:navigator.share)&&((Ne=navigator==null?void 0:navigator.canShare)==null?void 0:Ne.call(navigator,{url:S}))&&e(ve,{onClick:()=>{try{navigator.share({url:S})}catch{alert(l({id:"TtG3Uh"}))}},children:[e(T,{icon:"share"}),e("span",{children:e(h,{id:"LFKLqp"})})]})]}),!!g&&e(U,{children:[e(Ge,{}),z?e(ve,{onClick:()=>{f("loading"),(async()=>{try{const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).unmute();v(ne),f("default"),pe(l({id:"B4Xkly",values:{username:k}})),x.reloadGenericAccounts.id="mute",x.reloadGenericAccounts.counter++}catch{f("error")}})()},children:[e(T,{icon:"unmute"}),e("span",{children:e(h,{id:"Q/HUhC",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(an,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(U,{children:[e(T,{icon:"mute"}),e("span",{class:"menu-grow",children:e(h,{id:"xhPEH3",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(T,{icon:"time"}),e(T,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:Hc.map(ne=>e(ve,{onClick:()=>{f("loading"),(async()=>{try{const oe=await a.v1.accounts.$select((H==null?void 0:H.id)||w).mute({duration:ne});v(oe),f("default"),pe(l({id:"/plB9m",values:{0:typeof Ft[ne]=="function"?Ft[ne]():d(Ft[ne]),username:k}})),x.reloadGenericAccounts.id="mute",x.reloadGenericAccounts.counter++}catch{f("error"),pe(l({id:"vWGBjT",values:{username:k}}))}})()},children:typeof Ft[ne]=="function"?Ft[ne]():d(Ft[ne])}))})}),te&&e(ht,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(U,{children:[e(T,{icon:"user-x"}),e("span",{children:e(h,{id:"unyq2W",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{f("loading"),(async()=>{try{const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).removeFromFollowers();v(ne),f("default"),pe(l({id:"AgkcM/",values:{username:k}})),x.reloadGenericAccounts.id="followers",x.reloadGenericAccounts.counter++}catch{f("error")}})()},children:[e(T,{icon:"user-x"}),e("span",{children:e(h,{id:"VCZ0OT"})})]}),e(ht,{subMenu:!0,confirm:!J,confirmLabel:e(U,{children:[e(T,{icon:"block"}),e("span",{children:e(h,{id:"aforS9",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{f("loading"),(async()=>{try{if(J){const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).unblock();v(ne),f("default"),pe(l({id:"sI9N29",values:{username:k}}))}else{const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).block();v(ne),f("default"),pe(l({id:"uYcYzu",values:{username:k}}))}x.reloadGenericAccounts.id="block",x.reloadGenericAccounts.counter++}catch{f("error"),J?pe(l({id:"0tG4wG",values:{username:k}})):pe(l({id:"pA+qEx",values:{username:k}}))}})()},children:J?e(U,{children:[e(T,{icon:"unblock"}),e("span",{children:e(h,{id:"/3LJfX",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(U,{children:[e(T,{icon:"block"}),e("span",{children:e(h,{id:"JRswkR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(ve,{className:"danger",onClick:()=>{x.showReportModal={account:H||n}},children:[e(T,{icon:"flag"}),e("span",{children:e(h,{id:"qTJgpR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),y&&be&&s&&et("@mastodon/profile-edit")&&e(U,{children:[e(Ge,{}),e(ve,{onClick:()=>{u(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:e(h,{id:"9OpVZg"})})]})]}),!1]}),!g&&b==="loading"&&e(Ue,{abrupt:!0}),!!g&&!L&&e(ht,{confirm:P||M,confirmLabel:e("span",{children:l(M?{id:"e7qQIH"}:{id:"eYsAQr",values:{0:n.acct||n.username}})}),menuItemClassName:"danger",align:"end",disabled:le,onClick:()=>{f("loading"),(async()=>{try{let ne;P||M?ne=await a.v1.accounts.$select(B.current).unfollow():ne=await a.v1.accounts.$select(B.current).follow(),ne&&v(ne),f("default")}catch(ne){alert(ne),f("error")}})()},children:e("button",{type:"button",class:`${P||M?"light swap":""}`,"data-swap-state":P||M?"danger":"",disabled:le,children:P?e(U,{children:[e("span",{children:e(h,{id:"y6sq5j"})}),e("span",{children:e(h,{id:"HKrBPX"})})]}):M?e(U,{children:[e("span",{children:e(h,{id:"Yx0Ud8"})}),e("span",{children:e(h,{id:"yTVtKs"})})]}):A?e(U,{children:[e(T,{icon:"lock"})," ",e("span",{children:e(h,{id:"MKEPCY"})})]}):l({id:"MKEPCY"})})})]})]}),!!Ee&&e(He,{onClose:()=>{$e(!1)},children:e(Xc,{note:I,fields:R,onClose:()=>$e(!1)})}),!!De&&e(He,{onClose:()=>{ze(!1)},children:e(Jc,{accountID:B.current,onClose:()=>ze(!1)})}),!!Le&&e(He,{onClose:()=>{Ae(!1)},children:e(Qc,{account:n,note:re,onRelationshipChange:ne=>{v(ne)},onClose:()=>Ae(!1)})})]})}function Zc([n,i,s]){const o=.2126*n+.7152*i+.0722*s;let c;return o>=220?c=1:o<=50?c=.1:c=o/255,c=Math.min(1,c),[n,i,s,c]}function Wc(n){if(!n)return;const i=URL.parse(n);if(!i)return;const{host:s,pathname:o}=i,c=o.replace(/\/$/,"").replace(/^\//,"");return e(U,{children:[e("span",{class:"more-insignificant",children:[rn.toUnicode(s),"/"]}),e("wbr",{}),e("span",{children:c})]})}function Xc({note:n,fields:i,onClose:s}){const{_:o}=de(),c=(i==null?void 0:i.map(({name:u,value:d})=>`${u}
${Li(d)}`).join(`
`))||"",r=Li(n)+(c?`
${c}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:r}),e(Ts,{forceTranslate:!0,text:r})]})]})}function Jc({accountID:n,onClose:i}){const{_:s}=de(),{masto:o}=ce(),[c,r]=E("default"),[u,d]=E([]),[l,a]=E([]),[p,y]=Et(f=>f+1,0);ie(()=>{r("loading"),(async()=>{try{const f=await ln();d(f);const g=await o.v1.accounts.$select(n).lists.list();a(g),r("default")}catch{r("error")}})()},[p]);const[m,b]=E(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"sJ2yQc"})})}),e("main",{children:[u.length>0?e("ul",{class:"list-add-remove",children:u.map(f=>{const g=l.some(v=>v.id===f.id);return e("li",{children:e("button",{type:"button",class:`light ${g?"checked":""}`,disabled:c==="loading",onClick:()=>{r("loading"),(async()=>{try{g?await o.v1.lists.$select(f.id).accounts.remove({accountIds:[n]}):await o.v1.lists.$select(f.id).accounts.create({accountIds:[n]}),y()}catch{r("error"),alert(s(g?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(T,{icon:"check-circle",alt:"☑️"}),e("span",{children:f.title})]})})})}):c==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):c==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>b(!0),disabled:c!=="default",children:[e(T,{icon:"plus",size:"l"})," ",e("span",{children:e(h,{id:"Sb2gYF"})})]})]}),m&&e(He,{onClick:f=>{f.target===f.currentTarget&&b(!1)},children:e(ki,{list:m==null?void 0:m.list,onClose:f=>{f.state==="success"&&y(),b(!1)}})})]})}function Qc({account:n,note:i,onRelationshipChange:s=()=>{},onClose:o=()=>{}}){const{_:c}=de(),{masto:r}=ce(),[u,d]=E("default"),l=Y(null);return ie(()=>{let a;return l.current&&!i&&(a=setTimeout(()=>{var p,y;(y=(p=l.current).focus)==null||y.call(p)},100)),()=>{clearTimeout(a)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"DYqYm5",values:{0:(n==null?void 0:n.username)||(n==null?void 0:n.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:a=>{a.preventDefault();const y=new FormData(a.target).get("note");(y==null?void 0:y.trim())!==(i==null?void 0:i.trim())&&(d("loading"),(async()=>{try{const m=await r.v1.accounts.$select(n==null?void 0:n.id).note.create({comment:y});d("default"),s(m),o()}catch(m){d("error"),alert((m==null?void 0:m.message)||c({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:l,name:"note",disabled:u==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:u==="loading",onClick:()=>{o==null||o()},children:e(h,{id:"dEgA5A"})}),e("span",{children:[e(Ue,{abrupt:!0,hidden:u!=="loading"}),e("button",{disabled:u==="loading",type:"submit",children:e(h,{id:"SrwrEj"})})]})]})]})})]})}const ea=["image/jpeg","image/png","image/gif","image/webp"],qi=ea.join(",");function ta({onClose:n=()=>{}}){const{_:i}=de(),{masto:s}=ce(),[o,c]=E("loading"),[r,u]=E(null),[d,l]=E(null),[a,p]=E(null);ie(()=>{(async()=>{try{const k=await s.v1.accounts.verifyCredentials();u(k),c("default")}catch{c("error")}})()},[]);const{displayName:y,source:m,avatar:b,header:f}=r||{},{note:g,fields:v}=m||{},w=Y(null),C=[...b?[{type:"image",url:b}]:[],...a?[{type:"image",url:a}]:[]],S=[...f?[{type:"image",url:f}]:[],...d?[{type:"image",url:d}]:[]];return e("div",{class:"sheet",id:"edit-profile-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"9OpVZg"})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("form",{onSubmit:k=>{k.preventDefault();const A=new FormData(k.target),_=A.get("header"),I=A.get("avatar"),R=A.get("display_name"),L=A.get("note"),B=w.current.querySelectorAll('input[name^="fields_attributes"]'),P=[];B.forEach(q=>{const Q=q.name,[te,J,G]=Q.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],z=q.value?q.value.trim():"";J&&G&&z&&(P[J]||(P[J]={}),P[J][G]=z)}),P.forEach(q=>{q.name&&!q.value&&(q.value="")}),(async()=>{try{const q=await s.v1.accounts.updateCredentials({header:_,avatar:I,displayName:R,note:L,fieldsAttributes:P});n==null||n({state:"success",account:q})}catch(q){alert((q==null?void 0:q.message)||i({id:"FwMMx0"}))}})()},children:[e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(h,{id:"C5zXYJ"})," ",e("input",{type:"file",name:"header",accept:qi,onChange:k=>{const A=k.target.files[0];if(A){const _=URL.createObjectURL(A);l(_)}}})]}),e("div",{class:"edit-profile-media-field",children:[f?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:S,index:0}},children:e("img",{src:f,alt:""})}):e("div",{class:"edit-media"}),d&&e(U,{children:[e(T,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:S,index:1}},children:e("img",{src:d,alt:""})})]})]})]}),e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(h,{id:"4XF0BB"})," ",e("input",{type:"file",name:"avatar",accept:qi,onChange:k=>{const A=k.target.files[0];if(A){const _=URL.createObjectURL(A);p(_)}}})]}),e("div",{class:"edit-profile-media-field",children:[b?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:C,index:0}},children:e("img",{src:b,alt:""})}):e("div",{class:"edit-media"}),a&&e(U,{children:[e(T,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:C,index:1}},children:e("img",{src:a,alt:""})})]})]})]}),e("p",{children:e("label",{children:[e(h,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:y,maxLength:30,disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e("label",{children:[e(h,{id:"E+oKCO"}),e("textarea",{defaultValue:g,name:"note",maxLength:500,rows:"5",disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e(h,{id:"T4I119"})}),e("table",{ref:w,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(h,{id:"87a/t/"})}),e("th",{children:e(h,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,v.length)}).map((k,A)=>{const{name:_="",value:I=""}=v[A]||{};return e(na,{name:_,value:I,index:A,disabled:o==="loading"},A)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:o==="loading",onClick:()=>{n==null||n()},children:e(h,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:o==="loading",children:e(h,{id:"tfDRzk"})})]})]})})]})}function na({name:n,value:i,disabled:s,index:o}){const[c,r]=E(!!i);return e("tr",{children:[e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][name]`,defaultValue:n,disabled:s,maxLength:255,required:c,dir:"auto"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][value]`,defaultValue:i,disabled:s,maxLength:255,onChange:u=>r(!!u.currentTarget.value),dir:"auto"})})]})}function ia({acct:n,instance:i}){let[s,o]=n.split("@");o||(o=i);const c=rn.toASCII(n);return e("div",{class:"handle-info",children:[e("span",{class:"handle-handle",title:c,children:[e("b",{class:"handle-username",children:s}),e("span",{class:"handle-at",children:"@"}),e("b",{class:"handle-server",children:o})]}),e("div",{class:"handle-legend",children:[e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon username"})," ",e(h,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(h,{id:"rZgCpJ"})]})]})]})}function sa({account:n,instance:i,onClose:s}){const{_:o}=de(),{masto:c,instance:r,authenticated:u}=ce({instance:i}),d=typeof n=="string";return ie(()=>{d||(x.accounts[`${n.id}@${r}`]=n)},[n]),Us(s),e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e(qs,{instance:r,authenticated:u,account:n,fetchAccount:async()=>{if(d)try{return await c.v1.accounts.lookup({acct:n,skip_webfinger:!1})}catch{const a=await c.v2.search.fetch({q:n,type:"accounts",limit:1,resolve:u});if(a.accounts.length)return a.accounts[0];if(/https?:\/\/[^/]+\/@/.test(n)){const p=URL.parse(n);if(p){const{hostname:y,pathname:m}=p,b=m.replace(/^\//,"").replace(/\/$/,"")+"@"+y,f=await c.v2.search.fetch({q:b,type:"accounts",limit:1,resolve:u});if(f.accounts.length)return f.accounts[0]}}}else return n}})]})}function oa({onClose:n}){const{_:i}=de(),{masto:s}=ce(),[o,c]=E("default"),[r,u]=E([]),[d,l]=Et(p=>p+1,0);ie(()=>{c("loading"),(async()=>{try{const p=await mt.drafts.keys();if(p.length){const y=_n(),m=p.filter(b=>b.startsWith(y));if(m.length){const b=await mt.drafts.getMany(m);b.sort((f,g)=>new Date(g.updatedAt).getTime()-new Date(f.updatedAt).getTime()),u(b)}else u([])}else u([]);c("default")}catch{c("error")}})()},[d]);const a=(r==null?void 0:r.length)>0;return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(h,{id:"krk5ws"})," ",e(Ue,{abrupt:!0,hidden:o!=="loading"})]}),a&&e("div",{class:"insignificant",children:e(h,{id:"Ap/10+"})})]}),e("main",{children:a?e(U,{children:[e("ul",{class:"drafts-list",children:r.map(p=>{const{updatedAt:y,key:m,draftStatus:b,replyTo:f}=p,g=new Date(y);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(T,{icon:f?"reply":"quill",size:"s"})," ",e("time",{children:[!!f&&e(U,{children:[e("span",{class:"bidi-isolate",children:["@",f.account.acct]}),e("br",{})]}),ct(g)]})]}),e(ht,{confirmLabel:e("span",{children:e(h,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:o==="loading",onClick:()=>{(async()=>{try{await mt.drafts.del(m),l()}catch{alert(i({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:o==="loading",children:e(h,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:o==="loading",class:"draft-item",onClick:async()=>{let v;if(f){c("loading");try{v=await s.v1.statuses.$select(f.id).fetch()}catch{alert(i({id:"tMwimH"})),c("default");return}c("default")}window.__COMPOSE__={draftStatus:b,replyToStatus:v},x.showCompose=!0,x.showDrafts=!1},children:e(ca,{draft:p})})]},y)})}),r.length>1&&e("p",{children:e(ht,{confirmLabel:e("span",{children:e(h,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:o==="loading",onClick:()=>{(async()=>{c("loading");try{await mt.drafts.delMany(r.map(p=>p.key)),c("default"),l()}catch{alert(i({id:"0J4sZq"})),c("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:o==="loading",children:e(h,{id:"hOg+Mt"})})})})]}):e("p",{children:e(h,{id:"8iQ+jk"})})})]})}function ca({draft:n}){var m;const{_:i}=de(),{draftStatus:s,replyTo:o}=n,{status:c,spoilerText:r,poll:u,mediaAttachments:d}=s,l=((m=u==null?void 0:u.options)==null?void 0:m.length)>0,a=(d==null?void 0:d.length)>0,p=l||a,y=Ce(()=>{if(!a)return;const b=d.find(v=>/image/.test(v.type));if(!b)return;const{file:f}=b;return URL.createObjectURL(f)},[a,d]);return e(U,{children:e("div",{class:"mini-draft",children:[p&&e("div",{class:`mini-draft-aside ${y?"has-image":""}`,style:y?{"--bg-image":`url(${y})`}:{},children:[l&&e(T,{icon:"poll",alt:i({id:"4WUbF1"})}),a&&e("span",{children:[e(T,{icon:"attachment",alt:i({id:"xYilR2"})})," ",e("small",{children:d==null?void 0:d.length})]})]}),e("div",{class:"mini-draft-main",children:[!!r&&e("div",{class:"mini-draft-spoiler",children:r}),!!c&&e("div",{class:"mini-draft-status",children:c})]})]})})}function aa({html:n,url:i,width:s,height:o,onClose:c=()=>{}}){const{_:r}=de();return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>c(),children:e(T,{icon:"x",alt:r({id:"yz7wBu"})})}),i&&e("a",{href:i,target:"_blank",rel:"noopener",class:"button plain",children:[e("span",{children:e(h,{id:"4/RpOy"})})," ",e(T,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:n},style:{"--width":s+"px","--height":o+"px","--aspect-ratio":`${s}/${o}`}})]})}function ra({instance:n,excludeRelationshipAttrs:i=[],postID:s,onClose:o=()=>{},blankCopy:c}){const{_:r}=de(),{masto:u,instance:d}=ce(),l=n?n===d:!0,a=Ve(x),[p,y]=E("default"),[m,b]=E([]),[f,g]=E(!1);if(Us(o),!a.showGenericAccounts)return null;const{id:v,heading:w,fetchAccounts:C,accounts:S,showReactions:k}=a.showGenericAccounts,[A,_]=E({}),I=async P=>{if(!(P!=null&&P.length)||!l)return;const q=await ui(P,A);q&&_({...A,...q})},R=P=>{C&&(P&&b([]),y("loading"),(async()=>{try{const{done:q,value:Q}=await C(P);if(Array.isArray(Q)){if(P){const te=[];for(let J=0;J<Q.length;J++){const G=Q[J],z=te.find((ue,M)=>ue.id===G.id&&J!==M);z?z._types.push(...G._types):te.push({_types:[],...G})}b(te)}else b(te=>{const J=te;for(const G of Q){const z=J.find(ue=>ue.id===G.id);z?z._types.push(...G._types):J.push(G)}return J});g(!q),I(Q)}else g(!1);y("default")}catch{y("error")}})())},L=Y(!0);ie(()=>{(S==null?void 0:S.length)>0?(b(S),I(S)):(R(!0),L.current=!1)},[S,C]),ie(()=>{var P;L.current||((P=a.reloadGenericAccounts)==null?void 0:P.id)===v&&R(!0)},[a.reloadGenericAccounts.counter]);const B=x.statuses[s];return e("div",{id:"generic-accounts-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:r({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:w||r({id:"bPwFdf"})})}),e("main",{children:[B&&e(ge,{to:`/${n||d}/s/${B.id}`,class:"post-preview",children:e(Ye,{status:B,size:"s",readOnly:!0})}),m.length>0?e(U,{children:[e("ul",{class:"accounts-list",children:m.map(P=>{var te,J;const q=A[P.id],Q=`${P.id}-${((te=P._types)==null?void 0:te.length)||""}`;return e("li",{children:[k&&((J=P._types)==null?void 0:J.length)>0&&e("div",{class:"reactions-block",children:P._types.map(G=>e(T,{icon:{reblog:"rocket",favourite:"heart"}[G],class:`${G}-icon`}))}),e("div",{class:"account-relationships",children:e(ft,{account:P,showStats:!0,relationship:q,excludeRelationshipAttrs:i})})]},Q)})}),p==="default"?f?e(_t,{onChange:P=>{P&&R()},children:e("button",{type:"button",class:"plain block",onClick:()=>R(),children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}):p==="loading"&&e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})})]}):p==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):p==="error"?e("p",{class:"ui-state",children:e(h,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:c||r({id:"10OlfF"})})]})]})}function la({alt:n,lang:i,onClose:s}){const{_:o}=de(),c=Ve(x),[r,u]=E(!1),d=Cs(!0),l=c.settings.contentTranslationHideLanguages||[],a=!!i&&i!==d&&!xi([i],[d])&&!l.find(p=>i===p||xi([i],[p]));return e("div",{class:"sheet",tabindex:"-1",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(h,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(lt,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(T,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(ve,{disabled:r,onClick:()=>{u(!0)},children:[e(T,{icon:"translate"}),e("span",{children:e(h,{id:"pi8x/S"})})]}),Bo&&e(ve,{onClick:()=>{Fo(n,i)},children:[e(T,{icon:"speak"}),e("span",{children:e(h,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:i,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:n}),(a||r)&&e(Ts,{forceTranslate:r,sourceLanguage:i,text:n})]})]})}const{min:Td,max:Ad}=Math;const Ys={};for(let n of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Ys[`[object ${n}]`]=n.toLowerCase();function da(n){return Ys[Object.prototype.toString.call(n)]||"object"}const Wt=(n,i=null)=>n.length>=3?Array.prototype.slice.call(n):da(n[0])=="object"&&i?i.split("").filter(s=>n[0][s]!==void 0).map(s=>n[0][s]):n[0].slice(0);const{PI:Pn,min:xd,max:Rd}=Math;const Ed=Pn*2,Ld=Pn/3,ua=Pn/180,ha=180/Pn;function An(n,i){let s=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(i[0])||(i=i.map(u=>[u]));let o=i[0].length,c=i[0].map((u,d)=>i.map(l=>l[d])),r=n.map(u=>c.map(d=>Array.isArray(u)?u.reduce((l,a,p)=>l+a*(d[p]||0),0):d.reduce((l,a)=>l+a*u,0)));return s===1&&(r=r[0]),o===1?r.map(u=>u[0]):r}const js={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 Hn=n=>{const i=Math.sign(n);return n=Math.abs(n),(n<=.0031308?n*12.92:1.055*Math.pow(n,1/2.4)-.055)*i},fa=(n,i,s)=>{const{MtxAdaptMa:o,MtxAdaptMaI:c,MtxXYZ2RGB:r,RefWhiteRGB:u,Xn:d,Yn:l,Zn:a}=js,p=d*o.m00+l*o.m10+a*o.m20,y=d*o.m01+l*o.m11+a*o.m21,m=d*o.m02+l*o.m12+a*o.m22,b=u.X*o.m00+u.Y*o.m10+u.Z*o.m20,f=u.X*o.m01+u.Y*o.m11+u.Z*o.m21,g=u.X*o.m02+u.Y*o.m12+u.Z*o.m22,v=(n*o.m00+i*o.m10+s*o.m20)*(b/p),w=(n*o.m01+i*o.m11+s*o.m21)*(f/y),C=(n*o.m02+i*o.m12+s*o.m22)*(g/m),S=v*c.m00+w*c.m10+C*c.m20,k=v*c.m01+w*c.m11+C*c.m21,A=v*c.m02+w*c.m12+C*c.m22,_=Hn(S*r.m00+k*r.m10+A*r.m20),I=Hn(S*r.m01+k*r.m11+A*r.m21),R=Hn(S*r.m02+k*r.m12+A*r.m22);return[_*255,I*255,R*255]},Si=(...n)=>{n=Wt(n,"lab");const[i,s,o,...c]=n,[r,u,d]=pa([i,s,o]),[l,a,p]=fa(r,u,d);return[l,a,p,...c.length>0&&c[0]<1?[c[0]]:[]]};function pa(n){var i=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],s=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=An(s,n);return An(i,o.map(c=>c**3))}function qn(n){const i=Math.sign(n);return n=Math.abs(n),(n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4))*i}const ma=(n,i,s)=>{n=qn(n/255),i=qn(i/255),s=qn(s/255);const{MtxRGB2XYZ:o,MtxAdaptMa:c,MtxAdaptMaI:r,Xn:u,Yn:d,Zn:l,As:a,Bs:p,Cs:y}=js;let m=n*o.m00+i*o.m10+s*o.m20,b=n*o.m01+i*o.m11+s*o.m21,f=n*o.m02+i*o.m12+s*o.m22;const g=u*c.m00+d*c.m10+l*c.m20,v=u*c.m01+d*c.m11+l*c.m21,w=u*c.m02+d*c.m12+l*c.m22;let C=m*c.m00+b*c.m10+f*c.m20,S=m*c.m01+b*c.m11+f*c.m21,k=m*c.m02+b*c.m12+f*c.m22;return C*=g/a,S*=v/p,k*=w/y,m=C*r.m00+S*r.m10+k*r.m20,b=C*r.m01+S*r.m11+k*r.m21,f=C*r.m02+S*r.m12+k*r.m22,[m,b,f]},Ci=(...n)=>{const[i,s,o,...c]=Wt(n,"rgb"),r=ma(i,s,o);return[...ga(r),...c.length>0&&c[0]<1?[c[0]]:[]]};function ga(n){const i=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],s=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=An(i,n);return An(s,o.map(c=>Math.cbrt(c)))}const{sin:ba,cos:ya}=Math,va=(...n)=>{let[i,s,o]=Wt(n,"lch");return isNaN(o)&&(o=0),o=o*ua,[i,ya(o)*s,ba(o)*s]},Yn=(...n)=>{n=Wt(n,"lch");const[i,s,o,...c]=n,[r,u,d]=va(i,s,o),[l,a,p]=Si(r,u,d);return[l,a,p,...c.length>0&&c[0]<1?[c[0]]:[]]},{sqrt:wa,atan2:ka,round:Sa}=Math,Ca=(...n)=>{const[i,s,o]=Wt(n,"lab"),c=wa(s*s+o*o);let r=(ka(o,s)*ha+360)%360;return Sa(c*1e4)===0&&(r=Number.NaN),[i,c,r]},_a=(...n)=>{const[i,s,o,...c]=Wt(n,"rgb"),[r,u,d]=Ci(i,s,o),[l,a,p]=Ca(r,u,d);return[l,a,p,...c.length>0&&c[0]<1?[c[0]]:[]]},Ia={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_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:Md}=Ia;function Vs({mediaAttachments:n,statusID:i,instance:s,lang:o,index:c=0,onClose:r=()=>{}}){var k,A;const{_:u}=de(),[d,l]=E("default"),a=Y(null),[p,y]=E(c),m=Y(null);kt(()=>{var _;(_=m.current)==null||_.scrollIntoView()},[]);const b=Y(i);ie(()=>{const _=c*a.current.clientWidth,I=b.current!==i;I&&(b.current=i),a.current.focus(),a.current.scrollTo({left:_*(Dt()?-1:1),behavior:I?"auto":"smooth"})},[c,i]);const[f,g]=E(!0);ie(()=>{let _=()=>{r()};return a.current&&a.current.addEventListener("swiped-down",_),()=>{a.current&&a.current.removeEventListener("swiped-down",_)}},[]),Fe("esc",r,{ignoreEventWhen:_=>!!document.querySelector("#modal-container > *")},[r]),ie(()=>{let _=()=>{const{clientWidth:I,scrollLeft:R}=a.current,L=Math.round(Math.abs(R)/I);y(L)};return a.current&&a.current.addEventListener("scroll",_,{passive:!0}),()=>{a.current&&a.current.removeEventListener("scroll",_)}},[]),ie(()=>{let _=setTimeout(()=>{var I,R;(R=(I=a.current)==null?void 0:I.focus)==null||R.call(I)},100);return()=>clearTimeout(_)},[]);const v=Ce(()=>n==null?void 0:n.map(_=>{const{blurhash:I}=_;if(I){const R=hi(I);return _a(R)}return null}),[n]),w=Ce(()=>v==null?void 0:v.map(_=>_?{light:Yn([.95,.01,_[2]]),dark:Yn([.35,.01,_[2]]),default:Yn([.6,_[1],_[2]])}:null)),C=Ce(()=>{const I=100/w.length,R=w.map((P,q)=>{var J,G,z,ue;const Q=q*I+5,te=(q+1)*I-5;return P!=null&&P.light&&(P!=null&&P.dark)?{light:`
rgb(${(J=P.light)==null?void 0:J.join(",")}) ${Q}%,
rgb(${(G=P.light)==null?void 0:G.join(",")}) ${te}%
`,dark:`
rgb(${(z=P.dark)==null?void 0:z.join(",")}) ${Q}%,
rgb(${(ue=P.dark)==null?void 0:ue.join(",")}) ${te}%
`}:{light:`
transparent ${Q}%,
transparent ${te}%
`,dark:`
transparent ${Q}%,
transparent ${te}%
`}}),L=R.map(P=>P.light).join(", "),B=R.map(P=>P.dark).join(", ");return{light:L,dark:B}},[w]);let S=Y(null);return ie(()=>()=>{var _,I;(I=(_=S.current)==null?void 0:_.hideToast)==null||I.call(_)},[]),kt(()=>{const _=w[p];let I,R;if(_){const L=ye.local.get("theme");if(L){const B=`rgb(${_[L].join(",")})`;I=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),I&&(R=I.content,I.content=B)}else{const B=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",P=`rgb(${_[B].join(",")})`;I=document.querySelector(`meta[name="theme-color"][media*="${B}"]`),I&&(R=I.content,I.content=P)}}return()=>{I&&R&&(I.content=R)}},[p,w]),e("div",{class:`media-modal-container media-modal-count-${n==null?void 0:n.length}`,children:[e("div",{ref:a,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:_=>{(_.target.classList.contains("carousel-item")||_.target.classList.contains("media")||_.target.classList.contains("media-zoom"))&&r()},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":C==null?void 0:C.light,"--accent-gradient-dark":C==null?void 0:C.dark}:{},children:n==null?void 0:n.map((_,I)=>{var L,B;const R=n.length===1?w[I]:null;return e("div",{class:"carousel-item",style:R?{"--accent-color":`rgb(${R.default.join(",")})`,"--accent-light-color":`rgb(${(L=R.light)==null?void 0:L.join(",")})`,"--accent-dark-color":`rgb(${(B=R.dark)==null?void 0:B.join(",")})`,"--accent-alpha-color":`rgba(${R.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:I===p?m:null,onClick:P=>{P.target.classList.contains("media")||g(!f)},children:[!!_.description&&e("button",{type:"button",class:"media-alt",hidden:!f,onClick:()=>{x.showMediaAlt={alt:_.description,lang:o}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:o,dir:"auto",children:_.description})]}),e(As,{media:_,showOriginal:!0,lang:o})]},_.id)})}),e("div",{class:"carousel-top-controls",hidden:!f,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>r(),children:e(T,{icon:"x",alt:u({id:"yz7wBu"})})})}),(n==null?void 0:n.length)>1?e("span",{class:"carousel-dots",children:n==null?void 0:n.map((_,I)=>e("button",{type:"button",disabled:I===p,class:`carousel-dot ${I===p?"active":""}`,onClick:R=>{R.preventDefault(),R.stopPropagation();const L=a.current.clientWidth*I*(Dt()?-1:1);a.current.focus(),a.current.scrollTo({left:L,behavior:"smooth"})},children:e(T,{icon:"round",size:"s",alt:"⸱"})},_.id))}):e("span",{}),e("span",{children:[e(lt,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(T,{icon:"more",alt:u({id:"2FYpfJ"})})}),children:[e(qe,{href:((k=n[p])==null?void 0:k.remoteUrl)||((A=n[p])==null?void 0:A.url),class:"carousel-button",target:"_blank",title:u({id:"5hXGws"}),children:[e(T,{icon:"popout"}),e("span",{children:e(h,{id:"aDr7Vc"})})]}),!1]})," ",!!i&&e(ge,{to:`${s?`/${s}`:""}/s/${i}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${p+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(h,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(n==null?void 0:n.length)>1&&e("div",{class:"carousel-controls",hidden:!f,children:[e("button",{type:"button",class:"carousel-button",hidden:p===0,onClick:_=>{_.preventDefault(),_.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(p-1)*(Dt()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-left",alt:u({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:p===n.length-1,onClick:_=>{_.preventDefault(),_.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(p+1)*(Dt()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-right",alt:u({id:"hXzOVo"})})})]})]})}const Ta=[,"spam","legal","violation","other"],Xt={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 Aa({account:n,post:i,onClose:s}){const{_:o,_:c}=de(),{masto:r}=ce(),[u,d]=E("default"),[l,a]=n.acct.split("@"),[p,y]=Ce(()=>{const{rules:S,domain:k}=ms();return[S||[],k]}),[m,b]=E(null),[f,g]=E(!1),v=Y(null),[w,C]=E(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:c(i?{id:"muLhL3"}:{id:"ACul2G",values:{username:l}})}),e("button",{type:"button",class:"plain4 small",disabled:u==="loading",onClick:()=>s(),children:e(T,{icon:"x",size:"xl",alt:c({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:i?e(Ye,{status:i,size:"s",previewMode:!0}):e(ft,{account:n,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!m&&!Xt[m].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[o(Xt[m].stampLabel||o(Xt[m].label)),e("small",{children:e(h,{id:"2WtL62"})})]},m),e("form",{onSubmit:S=>{S.preventDefault();const k=new FormData(S.target),A=Object.fromEntries(k.entries());let{category:_,comment:I,forward:R}=A;I||(I=void 0),R==="on"&&(R=!0);const L=_==="violation"?Object.entries(A).filter(([P])=>P.startsWith("rule_ids")).map(([P,q])=>q):void 0,B={category:_,comment:I,forward:R,ruleIds:L};d("loading"),(async()=>{try{await r.v1.reports.create({accountId:n.id,statusIds:i!=null&&i.id?[i.id]:void 0,category:_,comment:I,ruleIds:L,forward:R}),d("success"),pe(c(i?{id:"y3ou+8"}:{id:"R9kjEL"})),s()}catch(P){d("error"),pe((P==null?void 0:P.message)||c(i?{id:"+3FjPq"}:{id:"oEQq5w"}))}})()},children:[e("p",{children:c(i?{id:"L9fUm+"}:{id:"rSLkfe"})}),e("section",{class:"report-categories",children:Ta.map(S=>S==="violation"&&!(p!=null&&p.length)?null:e(U,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:S,required:!0,disabled:u==="loading",onChange:k=>{b(k.target.value),g(k.target.value==="violation")}}),e("span",{children:[o(Xt[S].label),"  ",e("small",{class:"ib insignificant",children:o(Xt[S].description)})]})]}),S==="violation"&&!!(p!=null&&p.length)&&e("div",{class:"shazam-container no-animation",hidden:!f,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:v,children:p.map((k,A)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${A}]`,value:k.id,required:f&&!w,disabled:u==="loading",onChange:_=>{const{checked:I}=_.target;I?C(!0):v.current.querySelectorAll("input:checked").length||C(!1)}}),e("span",{children:k.text})]},k.id))})})})]},S))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(h,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:u==="loading",required:!i})]}),!!a&&a!==y&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:u==="loading"})," ",e("span",{children:e(h,{id:"cyjS8M",values:{domain:a},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:u==="loading",children:e(h,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:u==="loading",onClick:async()=>{try{await r.v1.accounts.$select(n.id).mute(),pe(c({id:"/BGBeF",values:{username:l}}))}catch{pe(c({id:"v02K7/",values:{username:l}}))}},children:e(h,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:u==="loading",onClick:async()=>{try{await r.v1.accounts.$select(n.id).block(),pe(c({id:"kjUejn",values:{username:l}}))}catch{pe(c({id:"pMcdDp",values:{username:l}}))}},children:e(h,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(Ue,{hidden:u!=="loading"})]})]})]})]})}var bn={exports:{}},$d=bn.exports,Yi;function xa(){return Yi||(Yi=1,function(n){var i=function(){var s=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function u(l,a){if(!r[l]){r[l]={};for(var p=0;p<l.length;p++)r[l][l.charAt(p)]=p}return r[l][a]}var d={compressToBase64:function(l){if(l==null)return"";var a=d._compress(l,6,function(p){return o.charAt(p)});switch(a.length%4){default:case 0:return a;case 1:return a+"===";case 2:return a+"==";case 3:return a+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:d._decompress(l.length,32,function(a){return u(o,l.charAt(a))})},compressToUTF16:function(l){return l==null?"":d._compress(l,15,function(a){return s(a+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:d._decompress(l.length,16384,function(a){return l.charCodeAt(a)-32})},compressToUint8Array:function(l){for(var a=d.compress(l),p=new Uint8Array(a.length*2),y=0,m=a.length;y<m;y++){var b=a.charCodeAt(y);p[y*2]=b>>>8,p[y*2+1]=b%256}return p},decompressFromUint8Array:function(l){if(l==null)return d.decompress(l);for(var a=new Array(l.length/2),p=0,y=a.length;p<y;p++)a[p]=l[p*2]*256+l[p*2+1];var m=[];return a.forEach(function(b){m.push(s(b))}),d.decompress(m.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":d._compress(l,6,function(a){return c.charAt(a)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),d._decompress(l.length,32,function(a){return u(c,l.charAt(a))}))},compress:function(l){return d._compress(l,16,function(a){return s(a)})},_compress:function(l,a,p){if(l==null)return"";var y,m,b={},f={},g="",v="",w="",C=2,S=3,k=2,A=[],_=0,I=0,R;for(R=0;R<l.length;R+=1)if(g=l.charAt(R),Object.prototype.hasOwnProperty.call(b,g)||(b[g]=S++,f[g]=!0),v=w+g,Object.prototype.hasOwnProperty.call(b,v))w=v;else{if(Object.prototype.hasOwnProperty.call(f,w)){if(w.charCodeAt(0)<256){for(y=0;y<k;y++)_=_<<1,I==a-1?(I=0,A.push(p(_)),_=0):I++;for(m=w.charCodeAt(0),y=0;y<8;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1}else{for(m=1,y=0;y<k;y++)_=_<<1|m,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=0;for(m=w.charCodeAt(0),y=0;y<16;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1}C--,C==0&&(C=Math.pow(2,k),k++),delete f[w]}else for(m=b[w],y=0;y<k;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1;C--,C==0&&(C=Math.pow(2,k),k++),b[v]=S++,w=String(g)}if(w!==""){if(Object.prototype.hasOwnProperty.call(f,w)){if(w.charCodeAt(0)<256){for(y=0;y<k;y++)_=_<<1,I==a-1?(I=0,A.push(p(_)),_=0):I++;for(m=w.charCodeAt(0),y=0;y<8;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1}else{for(m=1,y=0;y<k;y++)_=_<<1|m,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=0;for(m=w.charCodeAt(0),y=0;y<16;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1}C--,C==0&&(C=Math.pow(2,k),k++),delete f[w]}else for(m=b[w],y=0;y<k;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1;C--,C==0&&(C=Math.pow(2,k),k++)}for(m=2,y=0;y<k;y++)_=_<<1|m&1,I==a-1?(I=0,A.push(p(_)),_=0):I++,m=m>>1;for(;;)if(_=_<<1,I==a-1){A.push(p(_));break}else I++;return A.join("")},decompress:function(l){return l==null?"":l==""?null:d._decompress(l.length,32768,function(a){return l.charCodeAt(a)})},_decompress:function(l,a,p){var y=[],m,b=4,f=4,g=3,v="",w=[],C,S,k,A,_,I,R,L={val:p(0),position:a,index:1};for(C=0;C<3;C+=1)y[C]=C;for(k=0,_=Math.pow(2,2),I=1;I!=_;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(A>0?1:0)*I,I<<=1;switch(m=k){case 0:for(k=0,_=Math.pow(2,8),I=1;I!=_;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(A>0?1:0)*I,I<<=1;R=s(k);break;case 1:for(k=0,_=Math.pow(2,16),I=1;I!=_;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(A>0?1:0)*I,I<<=1;R=s(k);break;case 2:return""}for(y[3]=R,S=R,w.push(R);;){if(L.index>l)return"";for(k=0,_=Math.pow(2,g),I=1;I!=_;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(A>0?1:0)*I,I<<=1;switch(R=k){case 0:for(k=0,_=Math.pow(2,8),I=1;I!=_;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(A>0?1:0)*I,I<<=1;y[f++]=s(k),R=f-1,b--;break;case 1:for(k=0,_=Math.pow(2,16),I=1;I!=_;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(A>0?1:0)*I,I<<=1;y[f++]=s(k),R=f-1,b--;break;case 2:return w.join("")}if(b==0&&(b=Math.pow(2,g),g++),y[R])v=y[R];else if(R===f)v=S+S.charAt(0);else return null;w.push(v),y[f++]=S+v.charAt(0),b--,S=v,b==0&&(b=Math.pow(2,g),g++)}}};return d}();n!=null?n.exports=i:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return i})}(bn)),bn.exports}var ji=xa();const Ra="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",Ea="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",La="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",Ma=200,$a=10;async function xn(){const{masto:n}=ce(),i=n.v1.followedTags.list({limit:Ma}),s=[];let o=0;do{const{value:c,done:r}=await i.next();if(r||(c==null?void 0:c.length)===0)break;s.push(...c),o++}while(o<$a);return s.sort((c,r)=>c.name.localeCompare(r.name)),s.length&&setTimeout(()=>{ye.account.set("followedTags",{tags:s,updatedAt:Date.now()})},1),s}const Na=24*60*60*1e3;async function Pa(){try{const{tags:n,updatedAt:i}=ye.account.get("followedTags")||{};return n!=null&&n.length?(Date.now()-i>Na&&xn(),n):await xn()}catch{return[]}}const Vi=document.createElement("div"),Da=n=>{if(!n)return[];if(n.indexOf("#")===-1)return[];Vi.innerHTML=n;const i=Vi.querySelectorAll("a.hashtag");return i.length?Array.from(i).map(s=>s.innerText.trim().replace(/^[^#]*#+/,"")):[]};function yn({children:n}){if(typeof n=="string")return n;const[i,s]=E("");return ie(()=>{Promise.resolve(n).then(s)},[n]),i}const Ct=9,Oa=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],Ks={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"}},vn={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}]},za=bt(async({id:n})=>{const i=await ce().masto.v1.accounts.$select(n).fetch();return i.username||i.acct||i.displayName}),Rn={following:{id:"home",title:(n,i)=>i===0?he._({id:"i0qMbr"}):he._({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:n})=>n?"list":"lists",title:({id:n})=>n?zc(n):he._({id:"h16FyT"}),path:({id:n})=>n?`/l/${n}`:"/l",icon:"list",excludeViewMode:({id:n})=>n?[]:["multi-column"]},public:{id:"public",title:({local:n})=>n?he._({id:"d5zxa4"}):he._({id:"4ERYY7"}),subtitle:({instance:n})=>n||ce().instance,path:({local:n,instance:i})=>`/${i}/p${n?"/l":""}`,icon:({local:n})=>n?"building":"earth"},trending:{id:"trending",title:{id:"4/iCqx"},subtitle:({instance:n})=>n||ce().instance,path:({instance:n})=>`/${n}/trending`,icon:"chart"},search:{id:"search",title:({query:n})=>n?`${n}`:he._({id:"A1taO8"}),path:({query:n})=>n?`/search?q=${encodeURIComponent(n)}&type=statuses`:"/search",icon:"search",excludeViewMode:({query:n})=>n?[]:["multi-column"]},"account-statuses":{id:"account-statuses",title:za,path:({id:n})=>`/a/${n}`,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:n})=>n,subtitle:({instance:n})=>n||ce().instance,path:({hashtag:n,instance:i,media:s})=>`${i?`/${i}`:""}/t/${n.split(/\s+/).join("+")}${s?"?media=1":""}`,icon:"hashtag"}};function Ua({onClose:n}){const{_:i}=de(),s=Ve(x),{shortcuts:o}=s,[c,r]=E(!1),[u,d]=E(!1),[l]=bi();return e("div",{id:"shortcuts-settings-container",class:"sheet",tabindex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(T,{icon:"shortcut"})," ",e(h,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(h,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(h,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:he._({id:"qwdOim"}),imgURL:Ra},{value:"tab-menu-bar",label:he._({id:"UxBoCm"}),imgURL:La},{value:"multi-column",label:he._({id:"uvDfdW"}),imgURL:Ea}].map(({value:a,label:p,imgURL:y})=>{const m=s.settings.shortcutsViewMode===a||a==="float-button"&&!s.settings.shortcutsViewMode;return e("label",{class:m?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:a,checked:m,onChange:b=>{x.settings.shortcutsViewMode=b.target.value}})," ",e("img",{src:y,alt:"",width:"80",height:"58"})," ",e("span",{children:p})]},a)})}),o.length>0?e(U,{children:[e("ol",{class:"shortcuts-list",ref:l,children:o.filter(Boolean).map((a,p)=>{const y=Object.values(a).join("-"),{type:m}=a;if(!Rn[m])return null;let{icon:b,title:f,subtitle:g,excludeViewMode:v}=Rn[m];typeof f=="function"?f=f(a,p):f=i(f),typeof g=="function"?g=g(a,p):g=i(g),typeof b=="function"&&(b=b(a,p)),typeof v=="function"&&(v=v(a,p));const w=v==null?void 0:v.includes(s.settings.shortcutsViewMode);return e("li",{children:[e(T,{icon:b}),e("span",{class:"shortcut-text",children:[e(yn,{children:f}),g&&e(U,{children:[" ",e("small",{class:"ib insignificant",children:g})]}),w&&e("span",{class:"tag",children:e(h,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:p===0,onClick:()=>{const C=Array.from(x.shortcuts);if(p>0){const S=x.shortcuts[p-1];C[p-1]=a,C[p]=S,x.shortcuts=C}},children:e(T,{icon:"arrow-up",alt:he._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:p===o.length-1,onClick:()=>{const C=Array.from(x.shortcuts);if(p<x.shortcuts.length-1){const S=x.shortcuts[p+1];C[p+1]=a,C[p]=S,x.shortcuts=C}},children:e(T,{icon:"arrow-down",alt:he._({id:"3Ib6FN"})})}),e("button",{type:"button",class:"plain small",onClick:()=>{r({shortcut:a,shortcutIndex:p})},children:e(T,{icon:"pencil",alt:he._({id:"ePK91l"})})})]})]},y)})}),o.length===1&&s.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(T,{icon:"info"})," ",e("small",{children:e(h,{id:"3Xq4Zi"})})]})]}):e("div",{class:"ui-state insignificant",children:[e("p",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"3xIN+E"}):he._({id:"vLxvHT"})}),e("p",{children:e(h,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:a=>{a.preventDefault(),x.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:o.length>=Ct&&(s.settings.shortcutsViewMode==="multi-column"?he._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:Ct}}):he._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:Ct}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>d(!0),children:e(h,{id:"bgVLbt"})}),e("button",{type:"button",disabled:o.length>=Ct,onClick:()=>r(!0),children:[e(T,{icon:"plus"})," ",e("span",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"Vh3ADI"}):he._({id:"9tmn6W"})})]})]})]}),c&&e(He,{onClick:a=>{a.target===a.currentTarget&&r(!1)},children:e(Ba,{shortcut:c.shortcut,shortcutIndex:c.shortcutIndex,onSubmit:({result:a,mode:p})=>{p==="edit"?x.shortcuts[c.shortcutIndex]=a:x.shortcuts.push(a)},onClose:()=>r(!1)})}),u&&e(He,{onClick:a=>{a.target===a.currentTarget&&d(!1)},children:e(Fa,{shortcuts:o,onClose:()=>d(!1)})})]})}const Ki={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function Ba({onSubmit:n,disabled:i,shortcut:s,shortcutIndex:o,onClose:c}){var v,w;const{_:r}=de(),u=!!s,[d,l]=E((s==null?void 0:s.type)||null),[a,p]=E("default"),[y,m]=E([]),[b,f]=E([]);ie(()=>{(async()=>{if(d==="list")try{p("loading");const C=await ln();m(C),p("default")}catch{p("error")}})(),(async()=>{if(d==="hashtag")try{const C=await xn();f(C)}catch{}})()},[d]);const g=Y();return ie(()=>{if(u&&d&&vn[d]){const C=g.current;vn[d].forEach(({name:S,type:k})=>{const A=C.querySelector(`[name="${S}"]`);A&&s[S]&&(k==="checkbox"?A.checked=s[S]==="on":A.value=s[S])})}},[u,d]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!c&&e("button",{type:"button",class:"sheet-close",onClick:c,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:u?he._({id:"pe1jog"}):he._({id:"Lsxpe5"})})}),e("main",{tabindex:"-1",children:e("form",{ref:g,onSubmit:C=>{C.preventDefault();const S=new FormData(C.target),k={};S.forEach((A,_)=>{k[_]=A==null?void 0:A.trim(),_==="instance"&&(k[_]=k[_].replace(/^https?:\/\//,"").replace(/\/+$/,""),k[_]=k[_].replace(/^@?[^@]+@/,""))}),k.type&&(n({result:k,mode:u?"edit":"add"}),C.target.reset(),l(null),c==null||c())},children:[e("p",{children:e("label",{children:[e("span",{children:e(h,{id:"cklVjM"})}),e("select",{required:!0,disabled:i,onChange:C=>{l(C.target.value)},defaultValue:u?s.type:void 0,name:"type",dir:"auto",children:[e("option",{}),Oa.map(C=>e("option",{value:C,children:r(Ks[C])}))]})]})}),(w=(v=vn[d])==null?void 0:v.map)==null?void 0:w.call(v,({text:C,name:S,type:k,placeholder:A,pattern:_,notRequired:I})=>d==="list"?e("p",{children:e("label",{children:[e("span",{children:e(h,{id:"2BBAbc"})}),e("select",{name:"id",required:!I,disabled:i||a==="loading",defaultValue:u?s.id:void 0,dir:"auto",children:[e("option",{value:""}),y.map(R=>e("option",{value:R.id,children:R.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:r(C)})," ",e("input",{type:k,switch:k==="checkbox"||void 0,name:S,placeholder:r(A),required:k==="text"&&!I,disabled:i,list:d==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:_,dir:"auto"}),d==="hashtag"&&b.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:b.map(R=>e("option",{value:R.name}))})]})})),!!Ki[d]&&e("p",{class:"form-note insignificant",children:[e(T,{icon:"info"}),r(Ki[d])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:i||a==="loading",children:u?he._({id:"tfDRzk"}):he._({id:"m16xKo"})}),u&&e("button",{type:"button",class:"light danger",onClick:()=>{x.shortcuts.splice(o,1),c==null||c()},children:e(h,{id:"t/YqKh"})})]})]})})]})}function Fa({shortcuts:n,onClose:i}){var m;const{_:s}=de(),{masto:o}=ce(),c=Ce(()=>!n||!n.filter(Boolean).length?"":ji.compressToEncodedURIComponent(JSON.stringify(n.filter(Boolean))),[n]),[r,u]=E(""),[d,l]=E("default"),a=Ce(()=>{if(!r)return l("default"),null;try{const b=JSON.parse(ji.decompressFromEncodedURIComponent(r));if(!Array.isArray(b))throw new Error("Not an array");return l("default"),b}catch{try{const f=JSON.parse(r);if(!Array.isArray(f))throw new Error("Not an array");return l("default"),f}catch{return l("error"),null}}},[r]),p=x.shortcuts.length>0,y=Y();return e("div",{id:"import-export-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(T,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(h,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:y,type:"text",name:"import",placeholder:he._({id:"tBmklN"}),class:"block",onInput:b=>{u(b.target.value)},dir:"auto"}),x.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:d==="cloud-downloading",onClick:async()=>{l("cloud-downloading");const b=wt();pe(he._({id:"HLqLGx"}));try{const g=(await o.v1.accounts.relationships.fetch({id:[b]}))[0];if(g){const{note:v=""}=g;if(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(v)){const w=v.match(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/)[1],{v:C,dt:S,data:k}=JSON.parse(w);y.current.value=k,y.current.dispatchEvent(new Event("input"))}}l("default")}catch{l("error"),pe(he._({id:"gCDfX+"}))}},title:he._({id:"B6cG3J"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-down"})]})]}),!!a&&Array.isArray(a)&&e(U,{children:[e("p",{children:[e("b",{children:a.length})," shortcut",a.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",r.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:a.map(b=>{var f,g;return e("li",{children:[e("span",{style:{opacity:n.some(v=>Object.keys(v).every(w=>v[w]===b[w]))?1:0},children:"*"}),e("span",{children:[s(Ks[b.type]),b.type==="list"&&" ⚠️"," ",(g=(f=vn[b.type])==null?void 0:f.map)==null?void 0:g.call(f,({text:v,name:w,type:C})=>b[w]?e(U,{children:[e("span",{class:"tag collapsed insignificant",children:[v,":"," ",C==="checkbox"?b[w]==="on"?"✅":"❌":b[w]]})," "]}):null)]})]})})}),e("p",{children:[e("small",{children:e(h,{id:"o6sElH"})}),e("br",{}),e("small",{children:["⚠️"," ",e(h,{id:"N4z4P/"})]})]})]}),d==="error"&&e("p",{class:"error",children:e("small",{children:["⚠️ ",e(h,{id:"ZhsPEb"})]})}),e("p",{children:[p&&e(U,{children:[e(ht,{confirmLabel:he._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(h,{id:"nl8sCE"})}),onClick:()=>{const b=a.filter(v=>!x.shortcuts.some(w=>Object.keys(w).every(C=>w[C]===v[C])));if(!b.length){pe(he._({id:"o6L30P"}));return}let f=[...x.shortcuts,...b];const g=f.length>Ct;g&&(f=f.slice(0,Ct)),x.shortcuts=f,pe(g?he._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:Ct}}):he._({id:"QO9uTx"})),i==null||i()},children:e("button",{type:"button",class:"plain2",disabled:!a,children:e(h,{id:"c89gCv"})})})," "]}),e(ht,{confirmLabel:p?he._({id:"6ZjzWP"}):he._({id:"DWumLi"}),menuItemClassName:p?"danger":void 0,onClick:()=>{x.shortcuts=a,pe(he._({id:"QO9uTx"})),i==null||i()},children:e("button",{type:"button",class:"plain2",disabled:!a,children:p?he._({id:"uIp8WL"}):he._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(T,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(h,{id:"GS+Mus"})})]}),e("p",{children:e("input",{style:{width:"100%"},type:"text",value:c,readOnly:!0,onClick:b=>{if(b.target.value){b.target.select();try{navigator.clipboard.writeText(b.target.value),pe(he._({id:"cWtH+v"}))}catch{pe(he._({id:"yUWyHa"}))}}},dir:"auto"})}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.clipboard.writeText(c),pe(he._({id:"+Kq2vY"}))}catch{pe(he._({id:"tFvxZF"}))}},children:[e(T,{icon:"clipboard"})," ",e("span",{children:e(h,{id:"he3ygx"})})]})," ",(navigator==null?void 0:navigator.share)&&((m=navigator==null?void 0:navigator.canShare)==null?void 0:m.call(navigator,{text:c}))&&e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.share({text:c})}catch{alert(he._({id:"TtG3Uh"}))}},children:[e(T,{icon:"share"})," ",e("span",{children:e(h,{id:"Z8lGw6"})})]})," ",x.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2",disabled:d==="cloud-uploading",onClick:async()=>{l("cloud-uploading");const b=wt();try{const g=(await o.v1.accounts.relationships.fetch({id:[b]}))[0];if(g){const{note:v=""}=g;let w="";const C=JSON.stringify({v:"1",dt:Date.now(),data:c});/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(v)?w=v.replace(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/,`<phanpy-shortcuts-settings>${C}</phanpy-shortcuts-settings>`):w=`${v}
<phanpy-shortcuts-settings>${C}</phanpy-shortcuts-settings>`,pe(he._({id:"9ZYiLz"})),await o.v1.accounts.$select(b).note.create({comment:w}),l("default"),pe(he._({id:"5w02SH"}))}}catch{l("error"),pe(he._({id:"aVsTYo"}))}},title:he._({id:"gWd6Cu"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-up"})]})," ",c.length>0&&e("small",{class:"insignificant ib",children:e(h,{id:"IPXOXm",values:{0:c.length}})})]}),!!c&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(h,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),x.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(T,{icon:"cloud"})," ",e(h,{id:"C4T6O/"})]})})]})]})}gs(x,n=>{for(const[i,s,o,c]of n)/^show/i.test(s)&&!o&&Qn()});function Ha(){var c,r,u,d,l,a,p,y;const{_:n}=de(),i=Ve(x),s=bs(),o=Zt();return ie(()=>{setTimeout(ko,1e3)},[]),e(U,{children:[!!i.showCompose&&e(He,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(So,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:((c=window.__COMPOSE__)==null?void 0:c.replyToStatus)||null,editStatus:((r=x.showCompose)==null?void 0:r.editStatus)||((u=window.__COMPOSE__)==null?void 0:u.editStatus)||null,draftStatus:((d=x.showCompose)==null?void 0:d.draftStatus)||((l=window.__COMPOSE__)==null?void 0:l.draftStatus)||null,onClose:m=>{const{newStatus:b,instance:f,type:g,scheduledAt:v}=m||{};x.showCompose=!1,window.__COMPOSE__=null,b&&(x.reloadStatusPage++,v&&x.reloadScheduledPosts++,pe({text:{post:n(v?{id:"IrX0sj"}:{id:"aTyHBW"}),reply:n(v?{id:"+38pse"}:{id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[g||"post"],delay:1e3,duration:1e4,onClick:w=>{w.hideToast(),x.prevLocation=o,s(v?"/sp":f?`/${f}/s/${b.id}`:`/s/${b.id}`)}}))}})}),!!i.showSettings&&e(He,{onClose:()=>{x.showSettings=!1},children:e(Nc,{onClose:()=>{x.showSettings=!1}})}),!!i.showAccounts&&e(He,{onClose:()=>{x.showAccounts=!1},children:e(kc,{onClose:()=>{x.showAccounts=!1}})}),!!i.showAccount&&e(He,{onClose:()=>{x.showAccount=!1},children:e(sa,{account:((a=i.showAccount)==null?void 0:a.account)||i.showAccount,instance:(p=i.showAccount)==null?void 0:p.instance,onClose:({destination:m}={})=>{x.showAccount=!1}})}),!!i.showDrafts&&e(He,{onClose:()=>{x.showDrafts=!1},children:e(oa,{onClose:()=>x.showDrafts=!1})}),!!i.showMediaModal&&e(He,{onClick:m=>{(m.target===m.currentTarget||m.target.classList.contains("media"))&&(x.showMediaModal=!1)},children:e(Vs,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.index,statusID:i.showMediaModal.statusID,onClose:()=>{x.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(He,{onClose:()=>{x.showShortcutsSettings=!1},children:e(Ua,{onClose:()=>x.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(He,{onClose:()=>{x.showGenericAccounts=!1},children:e(ra,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>x.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(He,{onClose:m=>{x.showMediaAlt=!1},children:e(la,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:(y=i.showMediaAlt)==null?void 0:y.lang,onClose:()=>{x.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(He,{class:"solid",onClose:()=>{x.showEmbedModal=!1},children:e(aa,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{x.showEmbedModal=!1}})}),!!i.showReportModal&&e(He,{onClose:()=>{x.showReportModal=!1},children:e(Aa,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{x.showReportModal=!1}})})]})}function ti({accountID:n,onChange:i}){const{_:s}=de(),{masto:o}=ce(),[c,r]=E("default"),[u,d]=E(null),[l,a]=E(null),p=l!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||p,onClick:()=>{r("loading"),d("accept"),(async()=>{try{const y=await o.v1.followRequests.$select(n).authorize();if(!(y!=null&&y.followedBy))throw new Error("Follow request not accepted");a(y),i()}catch{}r("default")})()},children:e(h,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:c==="loading"||p,class:"light danger",onClick:()=>{r("loading"),d("reject"),(async()=>{try{const y=await o.v1.followRequests.$select(n).reject();if(y!=null&&y.followedBy)throw new Error("Follow request not rejected");a(y),i()}catch{r("default")}})()},children:e(h,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:p&&u?u==="accept"?e(T,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"follow-accepted"}):e(T,{icon:"x-circle",alt:s({id:"ekCRTP"}),class:"follow-rejected"}):e(Ue,{hidden:c!=="loading"})})]})}const Gi={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",annual_report:"celebrate"};function Zi({account:n,emoji:i,emoji_url:s}){let o,c;typeof s=="string"?o=s:(o=s==null?void 0:s.url,c=s==null?void 0:s.staticUrl);const r=o?e(Ho,{url:o,staticUrl:c,alt:i}):i;return e(h,{id:"i5uN6K",values:{account:n,emojiObject:r}})}const jn={status:({account:n})=>e(h,{id:"idiIxW",values:{account:n}}),reblog:({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(h,{id:"jkt9P5",values:{0:Je(n),1:Je(n),count:n,postsCount:s,postType:o,account:i},components:{0:e(c,{clickable:n>1}),1:e("span",{title:n}),2:e(c,{clickable:n>1}),3:e("span",{title:n})}}),follow:({account:n,count:i,components:{Subject:s}})=>e(h,{id:"+71G9C",values:{0:Je(i),count:i,account:n},components:{0:e(s,{clickable:i>1}),1:e("span",{title:i})}}),follow_request:({account:n})=>e(h,{id:"eh6NHW",values:{account:n}}),favourite:({account:n,count:i,postsCount:s,postType:o,components:{Subject:c}})=>e(h,{id:"RqX1mR",values:{0:Je(i),1:Je(i),count:i,postsCount:s,postType:o,account:n},components:{0:e(c,{clickable:i>1}),1:e("span",{title:i}),2:e(c,{clickable:i>1}),3:e("span",{title:i})}}),poll:()=>he._({id:"kIlJaS"}),"poll-self":()=>he._({id:"kpjzdN"}),"poll-voted":()=>he._({id:"moT7M8"}),update:()=>he._({id:"uzt17m"}),"favourite+reblog":({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(h,{id:"NunZZQ",values:{0:Je(n),1:Je(n),count:n,postsCount:s,postType:o,account:i},components:{0:e(c,{clickable:n>1}),1:e("span",{title:n}),2:e(c,{clickable:n>1}),3:e("span",{title:n})}}),"admin.sign_up":({account:n})=>e(h,{id:"fJCCpx",values:{account:n}}),"admin.report":({account:n,targetAccount:i})=>e(h,{id:"eNfCmq",values:{account:n,targetAccount:i}}),severed_relationships:({name:n})=>e(h,{id:"Xl9v6+",values:{name:n},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(h,{id:"YqffEv"})}),emoji_reaction:Zi,"pleroma:emoji_reaction":Zi,annual_report:({year:n})=>e(h,{id:"INLTzH",values:{year:n}})},qa={account_suspension:({from:n,targetName:i})=>e(h,{id:"uRkcgw",values:{from:n,targetName:i},components:{0:e("i",{}),1:e("i",{})}}),domain_block:({from:n,targetName:i,followersCount:s,followingCount:o})=>e(h,{id:"Q3yArs",values:{from:n,targetName:i,followersCount:s,followingCount:o},components:{0:e("i",{}),1:e("i",{})}}),user_domain_block:({targetName:n,followersCount:i,followingCount:s})=>e(h,{id:"RQKWUa",values:{targetName:n,followersCount:i,followingCount:s},components:{0:e("i",{})}})},Ya={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"}},Vn=30;function ja({notification:n,instance:i,isStatic:s,disableContextMenu:o}){var F,V,re,H,se,be,we;const{_:c}=de(),{masto:r}=ce(),{id:u,status:d,account:l,report:a,event:p,moderation_warning:y,annualReport:m,_ids:b,_accounts:f,_statuses:g,_groupKeys:v,sampleAccounts:w,notificationsCount:C,groupKey:S}=n;let{type:k}=n;if(k==="mention"&&!d)return null;const A=(d==null?void 0:d.reblog)||d,_=A==null?void 0:A.id,I=wt(),R=I===(l==null?void 0:l.id),L=(F=d==null?void 0:d.poll)==null?void 0:F.voted,B=!!(d!=null&&d.inReplyToAccountId)&&(d==null?void 0:d.inReplyToAccountId)!==I&&((V=d==null?void 0:d.account)==null?void 0:V.id)===I;let P=0,q=0;if(k==="favourite+reblog"){if(f)for(const W of f)(re=W._types)!=null&&re.includes("favourite")&&P++,(H=W._types)!=null&&H.includes("reblog")&&q++;!q&&P&&(k="favourite"),!P&&q&&(k="reblog")}let Q;k==="poll"?Q=jn[R?"poll-self":L?"poll-voted":"poll"]:jn[k]?Q=jn[k]:Q=he._({id:"ODqZt1",values:{type:k}});const te=({clickable:W,...le})=>W?e("b",{tabIndex:"0",onClick:z,...le}):e("b",{...le});if(typeof Q=="function"){const W=(f==null?void 0:f.length)||(w==null?void 0:w.length)||(l?1:0),le=(g==null?void 0:g.length)||(d?1:0);if(k==="admin.report"){const Ee=a==null?void 0:a.targetAccount;Ee&&(Q=Q({account:e(gt,{account:l,showAvatar:!0}),targetAccount:e(gt,{account:Ee,showAvatar:!0})}))}else if(k==="severed_relationships"){const Ee=p==null?void 0:p.targetName;Ee&&(Q=Q({name:Ee}))}else if((k==="emoji_reaction"||k==="pleroma:emoji_reaction")&&n.emoji){const Ee=n.emoji_url||((be=(se=d==null?void 0:d.emojis)==null?void 0:se.find)==null?void 0:be.call(se,$e=>($e==null?void 0:$e.shortcode)===n.emoji.replace(/^:/,"").replace(/:$/,"")));Q=Q({account:e(gt,{account:l,showAvatar:!0}),emoji:n.emoji,emojiURL:Ee})}else k==="annual_report"?Q=Q({...n.annualReport}):Q=Q({account:l?e(gt,{account:l,showAvatar:!0}):(w==null?void 0:w[0])&&e(gt,{account:w[0],showAvatar:!0}),count:W,postsCount:le,postType:B?"reply":"post",components:{Subject:te}})}const J=n.createdAt&&new Date(n.createdAt).toLocaleString(),G={"favourite+reblog":he._({id:"+XOeb+"}),favourite:he._({id:"LQFF6J"}),reblog:he._({id:"phQpSa"}),follow:he._({id:"Ih01jh"})}[k]||he._({id:"bPwFdf"}),z=()=>{x.showGenericAccounts={heading:G,accounts:f,showReactions:k==="favourite+reblog",excludeRelationshipAttrs:k==="follow"?["followedBy"]:[],postID:rt(_,i)}},M=C>0&&C>(w==null?void 0:w.length)?"remote":"local";if(d!=null&&d.filtered){const W=((we=d==null?void 0:d.account)==null?void 0:we.id)===I,le=Yt(d.filtered,"notifications");if(!R&&!W&&(le==null?void 0:le.action)==="hide")return null}return e("div",{class:`notification notification-${k}`,"data-notification-id":b||u,"data-group-key":(v==null?void 0:v.join(" "))||S,tabIndex:"0",children:[e("div",{class:`notification-type notification-${k}`,title:J,children:k==="favourite+reblog"?e(U,{children:[e(T,{icon:"rocket",size:"xl",alt:k,class:"reblog-icon"}),e(T,{icon:"heart",size:"xl",alt:k,class:"favourite-icon"})]}):e(T,{icon:Gi[k]||"notification",size:"xl",alt:k})}),e("div",{class:"notification-content",children:[k!=="mention"&&e(U,{children:[e("p",{children:Q}),k==="follow_request"&&e(ti,{accountID:l.id}),k==="severed_relationships"&&e("div",{children:[qa[p.type]({from:i,...p}),e("br",{}),e("a",{href:`https://${i}/severed_relationships`,target:"_blank",rel:"noopener",children:e(h,{id:"YL6Y8P",components:{0:e(T,{icon:"external",size:"s"})}})}),"."]}),k==="moderation_warning"&&!!y&&e("div",{children:[c(Ya[y.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${y.id}`,target:"_blank",rel:"noopener",children:e(h,{id:"YL6Y8P",components:{0:e(T,{icon:"external",size:"s"})}})})]}),k==="annual_report"&&e("div",{children:e(ge,{to:`/annual_report/${m==null?void 0:m.year}`,children:e(h,{id:"5PGPvG"})})})]}),(f==null?void 0:f.length)>1&&e("p",{class:"avatars-stack",children:[f.slice(0,Vn).map(W=>e(U,{children:[e("a",{href:W.url,rel:"noopener",class:"account-avatar-stack",onClick:le=>{le.preventDefault(),x.showAccount=W},children:[e(pt,{url:W.avatarStatic,size:f.length<=10?"xxl":f.length<20?"xl":"l",alt:`${W.displayName} @${W.acct}`,squircle:W==null?void 0:W.bot},W.id),k==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:W._types.map(le=>e(T,{icon:Gi[le],size:"s",class:`${le}-icon`}))})]},W.id)," "]},W.id)),k==="favourite+reblog"&&M==="remote"?e("button",{type:"button",class:"small plain","data-group-keys":v==null?void 0:v.join(" "),onClick:()=>{x.showGenericAccounts={heading:G,fetchAccounts:async()=>{const W=await Promise.allSettled(v.map(async Ee=>{const $e=r.v2.notifications.$select(Ee).accounts.list();return[Ee,(await $e.next()).value]})),le=[];for(const Ee of W){const[$e,De]=Ee.value,ze=/^favourite/.test($e)?"favourite":/^reblog/.test($e)?"reblog":null;if(ze)for(const Le of De){const Ae=le.find(X=>X.id===Le.id);Ae?Ae._types.push(ze):(Le._types=[ze],le.push(Le))}}return{done:!0,value:le}},showReactions:!0,postID:rt(_,i)}},children:e(T,{icon:"chevron-down"})}):e("button",{type:"button",class:"small plain",onClick:z,children:[f.length>Vn&&`+${f.length-Vn}`,e(T,{icon:"chevron-down"})]})]}),!(f!=null&&f.length)&&(w==null?void 0:w.length)>1&&e("p",{class:"avatars-stack",children:[w.map(W=>e(U,{children:[e("a",{href:W.url,rel:"noopener",class:"account-avatar-stack",onClick:le=>{le.preventDefault(),x.showAccount=W},children:e(pt,{url:W.avatarStatic,size:"xxl",alt:`${W.displayName} @${W.acct}`,squircle:W==null?void 0:W.bot},W.id)},W.id)," "]},W.id)),C>w.length&&e(ge,{to:i?`/${i}/s/${d.id}`:`/s/${d.id}`,class:"button small plain centered",children:["+",C-w.length,e(T,{icon:"chevron-right"})]})]}),(g==null?void 0:g.length)>1&&e("ul",{class:"notification-group-statuses",children:g.map(W=>e("li",{children:e(Wi,{class:`status-link status-type-${k}`,to:i?`/${i}/s/${W.id}`:`/s/${W.id}`,children:e(Ye,{status:W,size:"s",previewMode:!0,allowContextMenu:!0,allowFilters:!0})})},W.id))}),d&&(!(g!=null&&g.length)||(g==null?void 0:g.length)<=1)&&e(Wi,{class:`status-link status-type-${k}`,to:i?`/${i}/s/${_}`:`/s/${_}`,onContextMenu:o?void 0:W=>{const le=W.target.querySelector(".status");if(le){if(W.metaKey)return;W.preventDefault(),le.dispatchEvent(new MouseEvent("contextmenu",{clientX:W.clientX,clientY:W.clientY}))}},children:s?e(Ye,{status:A,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0}):e(Ye,{statusID:_,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0})})]})]})}function Wi(n){const i=qo();return e(ge,{...n,"data-read-more":he._({id:"8fZueG"}),ref:i})}const cn=dt(ja,(n,i)=>{var s,o;return((s=n.notification)==null?void 0:s.id)===((o=i.notification)==null?void 0:o.id)});"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",n=>{const{type:i,id:s,accessToken:o}=(n==null?void 0:n.data)||{};i==="notification"&&(x.routeNotification={id:s,accessToken:o})});const Va=dt(function(){const{_:i}=de();if(!("serviceWorker"in navigator))return null;const s=Ve(x),{routeNotification:o}=s,{id:c,accessToken:r}=o||{},[u,d]=E(!1);kt(()=>{if(!c||!r)return;const{instance:a}=ce(),{masto:p,instance:y}=ce({accessToken:r}),m=a===y,b=r?Co(r):ci();(async()=>{const f=await p.v1.notifications.$select(c).fetch();if(f&&b){const g=b.instanceURL,{type:v,status:w,account:C}=f,S=!!document.querySelector("#modal-container > *"),k=v==="follow"&&!!(C!=null&&C.id),A=!!(C!=null&&C.id),_=!!(w!=null&&w.id);k&&m?x.showAccount={account:C,instance:g}:S||!m||A&&_?d({id:c,account:b,notification:f,sameInstance:m}):_?location.hash=`/${a}/s/${w.id}`:k?location.hash=`/${a}/a/${C.id}`:location.hash="/notifications"}})()},[c,r]),kt(()=>{navigator!=null&&navigator.clearAppBadge&&navigator.clearAppBadge()},[]),jt(a=>{a&&(navigator!=null&&navigator.clearAppBadge)&&navigator.clearAppBadge()});const l=()=>{d(!1),x.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(u){const{id:a,account:p,notification:y,sameInstance:m}=u;return e(He,{onClick:b=>{b.target===b.currentTarget&&l()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:l,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"5+87Pq"})})}),e("main",{children:[!m&&e("p",{children:e(h,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:b=>{const{target:f}=b;(b.target.tagName==="BUTTON"||b.target.tagName==="A")&&l()},children:e(cn,{instance:p.instanceURL,notification:y,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(ge,{to:"/notifications",class:"button light",onClick:l,children:[e("span",{children:e(h,{id:"/WA/tl"})})," ",e(T,{icon:"arrow-right"})]})})]})]})})}return null}),Gs=_o((n,i)=>{const{_:s}=de(),{instance:o}=ce(),[c,r]=yt(),[u,d]=E(!1),[l,a]=E(c.get("q")||""),p=c.get("type"),y=Y(null),m=Y(null);return Io(i,()=>({setValue:b=>{a(b)},focus:()=>{m.current.focus()},select:()=>{m.current.select()},blur:()=>{m.current.blur()}})),e("form",{ref:y,class:"search-popover-container",onSubmit:b=>{var g;if(b.preventDefault(),/\/search/.test(location.hash))if(l){const v={q:l};p&&(v.type=p),r(v)}else r({});else l?location.hash=`/search?q=${encodeURIComponent(l)}${p?`&type=${p}`:""}`:location.hash="/search";(g=n==null?void 0:n.onSubmit)==null||g.call(n,b)},children:[e("input",{ref:m,value:l,name:"q",type:"search",placeholder:s({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",onSearch:b=>{b.target.value||r({})},onInput:b=>{a(b.target.value),d(!0)},onFocus:()=>{var b,f;d(!0),(f=(b=y.current)==null?void 0:b.querySelector(".search-popover-item"))==null||f.classList.add("focus")},onBlur:()=>{var b,f;setTimeout(()=>{d(!1)},100),(f=(b=y.current)==null?void 0:b.querySelector(".search-popover-item.focus"))==null||f.classList.remove("focus")},onKeyDown:b=>{var g;const{key:f}=b;switch(f){case"Escape":d(!1);break;case"Down":case"ArrowDown":if(b.preventDefault(),u){const v=y.current.querySelector(".search-popover-item.focus");if(v){let w=v.nextElementSibling;for(;w&&w.hidden;)w=w.nextElementSibling;w&&(w.classList.add("focus"),Array.from(w.parentElement.children).filter(S=>S!==w).forEach(S=>{S.classList.remove("focus")}))}else{const w=y.current.querySelector(".search-popover-item");w&&w.classList.add("focus")}}break;case"Up":case"ArrowUp":if(b.preventDefault(),u){const v=document.querySelector(".search-popover-item.focus");if(v){let w=v.previousElementSibling;for(;w&&w.hidden;)w=w.previousElementSibling;w&&(w.classList.add("focus"),Array.from(w.parentElement.children).filter(S=>S!==w).forEach(S=>{S.classList.remove("focus")}))}else{const w=document.querySelector(".search-popover-item:last-child");w&&w.classList.add("focus")}}break;case"Enter":if(u){const v=document.querySelector(".search-popover-item.focus");v&&(b.preventDefault(),v.click()),d(!1),(g=n==null?void 0:n.onSubmit)==null||g.call(n,b)}break}}}),e("div",{class:"search-popover",hidden:!u||!l,children:!!l&&[{label:e(h,{id:"48oDit",values:{query:l},components:{0:e("small",{class:"insignificant"})}}),to:`/search?q=${encodeURIComponent(l)}`,top:!p&&!/\s/.test(l),hidden:!!p},{label:e(h,{id:"o1mMWT",values:{query:l},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(l)}&type=statuses`,hidden:/^https?:/.test(l),top:/\s/.test(l),icon:"document",queryType:"statuses"},{label:e(h,{id:"YAZw8D",values:{0:l.replace(/^#/,"")},components:{0:e("mark",{})}}),to:`/${o}/t/${l.replace(/^#/,"")}`,hidden:/^@/.test(l)||/^https?:/.test(l)||/\s/.test(l),top:/^#/.test(l),type:"link",icon:"hashtag",queryType:"hashtags"},{label:e(h,{id:"gEoOUj",values:{query:l},components:{0:e("mark",{})}}),to:`/${l}`,hidden:!/^https?:/.test(l),top:/^https?:/.test(l),type:"link"},{label:e(h,{id:"cDoNQr",values:{query:l},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(l)}&type=accounts`,icon:"group",queryType:"accounts"}].sort((b,f)=>{if(p){if(b.queryType===p)return-1;if(f.queryType===p)return 1}return b.top&&!f.top?-1:!b.top&&f.top?1:0}).filter(({hidden:b})=>!b).map(({label:b,to:f,icon:g,type:v},w)=>e(ge,{to:f,class:`search-popover-item ${w===0?"focus":""}`,onClick:C=>{var S;(S=n==null?void 0:n.onSubmit)==null||S.call(n,C)},children:[e(T,{icon:g||(v==="link"?"arrow-right":"search"),class:"more-insignificant"}),e("span",{children:b})," "]}))})]})}),Ka=dt(function({onClose:i=()=>{}}){const[s,o]=E(!1),c=Y(null);Fe(["Slash","/"],u=>{o(!0),setTimeout(()=>{var d,l,a,p;(l=(d=c.current)==null?void 0:d.focus)==null||l.call(d),(p=(a=c.current)==null?void 0:a.select)==null||p.call(a)},0)},{useKey:!0,preventDefault:!0,ignoreEventWhen:u=>{const d=/\/search/.test(location.hash),l=!!document.querySelector("#modal-container > *");return d||l}});const r=()=>{o(!1),i()};return Fe("esc",u=>{var d,l;(l=(d=c.current)==null?void 0:d.blur)==null||l.call(d),r()},{enabled:s,enableOnFormTags:!0,preventDefault:!0}),e("div",{id:"search-command-container",hidden:!s,onClick:u=>{u.target===u.currentTarget&&r()},children:e(Gs,{ref:c,onSubmit:()=>{r()}})})});function Ga(){const{_:n,_:i}=de(),{instance:s}=ce(),o=Ve(x),{shortcuts:c,settings:r}=o;if(!c.length)return null;const u=r.shortcutsViewMode==="multi-column"||!r.shortcutsViewMode&&r.shortcutsColumnsMode;if(u)return null;const d=Y(),l=Y(!1),a=c.map((b,f)=>{const{type:g,...v}=b;if(!Rn[g])return null;let{id:w,path:C,title:S,subtitle:k,icon:A}=Rn[g];return typeof w=="function"&&(w=w(v,f)),typeof C=="function"&&(C=C({...v,instance:v.instance||s},f)),typeof S=="function"?S=S(v,f):S=i(S),typeof k=="function"?k=k(v,f):k=i(k),typeof A=="function"&&(A=A(v,f)),w==="lists"&&(l.current=!0),{id:w,path:C,title:S,subtitle:k,icon:A}}).filter(Boolean),p=bs();Fe(["1","2","3","4","5","6","7","8","9"],(b,f)=>{var v,w;const g=parseInt(f.keys[0],10)-1;if(g<a.length){const{path:C}=a[g];C&&(p(C),(w=(v=d.current)==null?void 0:v.closeMenu)==null||w.call(v))}},{enabled:!u});const[y,m]=E([]);return e("div",{id:"shortcuts",children:o.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{class:"tab-bar",onContextMenu:b=>{b.preventDefault(),x.showShortcutsSettings=!0},children:e("ul",{children:a.map(({id:b,path:f,title:g,subtitle:v,icon:w},C)=>e("li",{children:e(ge,{class:v?"has-subtitle":"",to:f,onClick:S=>{if(S.target.classList.contains("is-active")){S.preventDefault();const k=document.getElementById(`${b}-page`);if(k){k.scrollTop=0;const A=k.querySelector(".updates-button");A&&A.click()}}},children:[e(T,{icon:w,size:"xl",alt:g}),e("span",{children:[e(yn,{children:g}),v&&e(U,{children:[e("br",{}),e("small",{children:v})]})]})]})},`${C}-${b}-${g}-${v}-${f}`))})}):e(lt,{instanceRef:d,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:b=>{b.open&&l.current&&ln().then(m)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:b=>{b.preventDefault(),x.showShortcutsSettings=!0},onTransitionStart:b=>{var f,g;try{const{target:v}=b;getComputedStyle(v).pointerEvents==="none"&&((g=(f=d.current)==null?void 0:f.closeMenu)==null||g.call(f))}catch{}},children:e(T,{icon:"shortcut",size:"xl",alt:n({id:"CTqTgr"})})}),children:a.map(({id:b,path:f,title:g,subtitle:v,icon:w},C)=>b==="lists"?e(an,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(U,{children:[e(T,{icon:w,size:"l"}),e("span",{class:"menu-grow",children:e(yn,{children:g})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),e(Ge,{}),y==null?void 0:y.map(S=>e(qe,{to:`/l/${S.id}`,children:e("span",{children:S.title})},S.id))]}):e(qe,{to:f,class:"glass-menu-item",children:[e(T,{icon:w,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(yn,{children:g})}),v&&e(U,{children:[" ",e("small",{class:"more-insignificant",children:v})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:C+1})]},`${C}-${b}-${g}-${v}-${f}`))})})}const Za=dt(Ga);function Wa(n){var c;let i=[],s=[],o=0;for(let r=0;r<n.length;r++){const u=n[r];u.reblog&&!((c=u.account)!=null&&c.group)?(s.push(u),o++):(i.push(u),o<3&&(o=0))}if(n.length>10&&(s.length>n.length/4||o>=3)){const r=s.map(u=>u.id);if(s.length>n.length*3/4)i=[...i,{id:r,items:s,type:"boosts"}];else{const u=Math.floor(i.length/2);i=[...i.slice(0,u),{id:r,items:s,type:"boosts"},...i.slice(u)]}return i}else return n}function Xi(n,i){const s=ye.account.get("boostedStatusIDs")||{},o=n.filter(r=>{if(!r.reblog)return!0;const u=`${i}-${r.reblog.id}`,d=s[u];return d&&d!==r.id?!1:(s[u]=r.id,!0)}),c=Object.keys(s);return c.length>50&&c.slice(0,c.length-50).forEach(r=>{delete s[r]}),ye.account.set("boostedStatusIDs",s),o}function Xa(n,i){const s=[];let o=0;n.forEach(d=>{for(let a=0;a<s.length;a++){if(s[a].find(p=>p.id===d.id))return;if(s[a].find(p=>p.id===d.inReplyToId)||s[a].find(p=>p.inReplyToId===d.id)){s[a].push(d);return}}const l=n.find(a=>a.id===d.inReplyToId);l&&(s[o++]=[d,l])});for(let d=0;d<s.length;d++)for(let l=d+1;l<s.length;l++)s[d].find(p=>s[l].includes(p))&&(s[d]=[...s[d],...s[l]],s[d]=s[d].filter((p,y,m)=>m.findIndex(b=>b.id===p.id)===y),s.splice(l,1),l--);s.forEach(d=>{d.sort((l,a)=>!l.inReplyToId&&!a.inReplyToId?new Date(l.createdAt)-new Date(a.createdAt):l.inReplyToId===a.id?1:a.inReplyToId===l.id||!l.inReplyToId?-1:a.inReplyToId?new Date(l.createdAt)-new Date(a.createdAt):1)}),s.forEach(d=>{const l=d[0].account.id;d.forEach(a=>{a.account.id!==l&&(a._differentAuthor=!0)})}),s.length;const c=[],r=[],u=[];return n.forEach(d=>{if(d.reblog){c.push(d);return}for(let l=0;l<s.length;l++)if(s[l].find(a=>a.id===d.id)){if(r.includes(l))return;const a=s[l];a.sort((y,m)=>{const b=new Date(y.createdAt),f=new Date(m.createdAt);return b-f});const p=a[0].account.id;c.push({id:a.map(y=>y.id),items:a,type:a.every(y=>y.account.id===p)?"thread":"conversation"}),r.push(l);return}if(d.inReplyToId&&d.inReplyToAccountId!==d.account.id){const l=rt(d.id,i);x.statusReply[l]||u.push({sKey:l,inReplyToId:d.inReplyToId})}c.push(d)}),u!=null&&u.length&&queueMicrotask(()=>{const{masto:d}=ce({instance:i});async function l(){for(let a=0;a<u.length;a++){const{sKey:p,inReplyToId:y}=u[a];try{const m=await Ja(y,d);Qe(m,i,{skipThreading:!0}),x.statusReply[p]={id:m.id,instance:i},await new Promise(b=>setTimeout(b,1e3))}catch{}}}if(et("@mastodon/fetch-multiple-statuses")){const a=u.map(({inReplyToId:p})=>p);(async()=>{var p;try{const y=await d.v1.statuses.list({id:a});if(y!=null&&y.length)for(const m of y){Qe(m,i,{skipThreading:!0});const b=(p=u.find(({inReplyToId:f})=>f===m.id))==null?void 0:p.sKey;b&&(x.statusReply[b]={id:m.id,instance:i})}else l()}catch{l()}})()}else l()}),c}const Ja=bt((n,i)=>i.v1.statuses.$select(n).fetch());async function Zs(n,i){const s=await Pa();if(!s.length)return;const{statusFollowedTags:o}=x,c=[];if(n.forEach(r=>{var m;if(r.reblog)return;const{id:u,content:d,tags:l=[]}=r,a=rt(u,i);if((m=o[a])!=null&&m.length)return;const p=Da(d);if(!p.length&&!l.length)return;const y=s.reduce((b,f)=>((p.some(g=>g.toLowerCase()===f.name.toLowerCase())||l.some(g=>g.name.toLowerCase()===f.name.toLowerCase()))&&b.push(f.name),b),[]);y.length&&c.push({item:r,sKey:a,followedTags:y})}),c.length){const r=c.map(d=>d.item.account),u=await ui(r);if(!u)return;c.forEach(d=>{const{item:l,sKey:a,followedTags:p}=d,y=u[l.account.id];y&&!y.following&&(o[a]=p)})}}function Qa(){x.statusFollowedTags={}}function er({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:r="vertical",distanceFromStartPx:u,distanceFromEndPx:d}={}){const[l,a]=E(null),[p,y]=E(!1),[m,b]=E(!1),[f,g]=E(!1),[v,w]=E(!1),C=r==="vertical";return kt(()=>{const S=n.current;if(!S)return{};let k=C?S.scrollTop:S.scrollLeft;function A(){const{scrollTop:_,scrollLeft:I,scrollHeight:R,scrollWidth:L,clientHeight:B,clientWidth:P}=S,q=C?_:I,Q=C?R:L,te=C?B:P,J=Math.abs(q-k),G=u||Math.min(te*i,Q,q),z=d||Math.min(te*s,Q,Q-q-te);J>=(k<q?c:o)&&(a(k<q?"end":"start"),k=q),y(q<=0),b(q+te>=Q),g(q<=G),w(q+te>=Q-z)}return S.addEventListener("scroll",A,{passive:!0}),()=>S.removeEventListener("scroll",A)},[i,s,o,c]),{scrollDirection:l,reachStart:p,reachEnd:m,nearReachStart:f,nearReachEnd:v,init:()=>{n.current&&n.current.dispatchEvent(new Event("scroll"))}}}function tr({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:r="vertical",distanceFromStartPx:u,distanceFromEndPx:d,init:l}={},a,p){if(!a)return;const y=r==="vertical",m=Y(null),b=Y(null),f=Yo(()=>{let g=!1,v=!1,w=!1,C=!1;const S=n.current,{scrollTop:k,scrollLeft:A,scrollHeight:_,scrollWidth:I,clientHeight:R,clientWidth:L}=S,B=y?k:A,P=y?_:I,q=y?R:L,Q=Math.abs(B-m.current),te=u||Math.min(q*i,P,B),J=d||Math.min(q*s,P,P-B-q);Q>=(m.current<B?c:o)&&(b.current=m.current<B?"end":"start",m.current=B),g=B<=0,v=B+q>=P,w=B<=te,C=B+q>=P-J,a({scrollDirection:b.current,reachStart:g,reachEnd:v,nearReachStart:w,nearReachEnd:C})},500);kt(()=>{const g=n.current;return g?(m.current=g[y?"scrollTop":"scrollLeft"],g.addEventListener("scroll",f,{passive:!0}),()=>g.removeEventListener("scroll",f)):{}},[i,s,o,c,...p]),ie(()=>{l&&n.current&&queueMicrotask(()=>{n.current.dispatchEvent(new Event("scroll"))})},[l])}function nr({class:n,statusID:i,status:s,instance:o,parent:c,onMediaClick:r}){const{_:u}=de();let d=rt(i,o);const l=Ve(x);if(s||(s=l.statuses[d]||l.statuses[i],d=rt(s==null?void 0:s.id,o)),!s)return null;const{account:{acct:a,avatar:p,avatarStatic:y,id:m,url:b,displayName:f,username:g,emojis:v,bot:w,group:C},id:S,repliesCount:k,reblogged:A,reblogsCount:_,favourited:I,favouritesCount:R,bookmarked:L,poll:B,muted:P,sensitive:q,spoilerText:Q,visibility:te,language:J,editedAt:G,filtered:z,card:ue,createdAt:M,inReplyToId:F,inReplyToAccountId:V,content:re,mentions:H,mediaAttachments:se,reblog:be,uri:we,url:W,emojis:le,_deleted:Ee,_pinned:$e}=s;if(!(se!=null&&se.length))return null;const De=xe=>{xe.shiftKey},ze=Ce(()=>wt(),[]),Le=Ce(()=>ze&&ze===m,[m,ze]),Ae=To(Mn),X=!Le&&Yt(z,Ae);if((X==null?void 0:X.action)==="hide")return null;const ke=q,ne=Ce(()=>{var O;return((O=(ye.account.get("preferences")||{})["reading:expand:media"])==null?void 0:O.toLowerCase())||"default"},[])==="show_all",oe=c||"div";return se.map((xe,O)=>{const ee=`${d}-${xe.id}`,fe=X==null?void 0:X.titlesStr;return e(oe,{"data-state-post-id":d,onMouseEnter:De,"data-spoiler-text":Q||(q?u({id:"FKojeB"}):void 0),"data-filtered-text":X?u(fe?{id:"7FGvtQ",values:{filterTitleStr:fe}}:{id:"03Qqf9"}):void 0,class:`
media-post
${X?"filtered":""}
${ke?"has-spoiler":""}
${ne?"show-media":""}
`,children:e(As,{class:n,media:xe,lang:J,to:`/${o}/s/${S}?media-only=${O+1}`,onClick:r?D=>r(D,O,xe,s):void 0})},ee)})}const Ji=dt(nr);function ir(n){var S,k,A,_,I;const{_:i}=de(),s=Ve(x),{masto:o,instance:c,authenticated:r}=ce(),[u,d]=Ce(()=>{const R=ye.local.getJSON("accounts")||[];return[R.find(B=>B.info.id===wt())||R[0],R.length>1]},[]),l=(s.settings.shortcutsViewMode==="multi-column"||!s.settings.shortcutsViewMode&&s.settings.shortcutsColumnsMode)&&!s.shortcuts.find(R=>R.type==="following"),a=ws(()=>{x.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),p=Y(),[y,m]=E(void 0),b=Ss([0,0,s.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),f=Y();async function g(R){return(R||!f.current)&&(f.current=o.v1.mutes.list({limit:80})),await f.current.next()}const v=Y();async function w(R){return(R||!v.current)&&(v.current=o.v1.blocks.list({limit:80})),await v.current.next()}const C=Y();return e(U,{children:[e("button",{ref:p,type:"button",class:`button plain nav-menu-button ${d?"with-avatar":""} ${y==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{C.current=Date.now(),m(R=>R?void 0:"open")},onContextMenu:R=>{R.preventDefault(),x.showAccounts=!0},...a(),children:[d&&e(pt,{url:((S=u==null?void 0:u.info)==null?void 0:S.avatar)||((k=u==null?void 0:u.info)==null?void 0:k.avatarStatic),size:"l",squircle:(A=u==null?void 0:u.info)==null?void 0:A.bot}),e(T,{icon:"menu",size:d?"s":"l",alt:i({id:"zucql+"})})]}),e(di,{menuClassName:"nav-menu",state:y,anchorRef:p,onClose:()=>{m(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-C.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:b,unmountOnClose:!0,children:[!!((_=s.appVersion)!=null&&_.commitHash)&&s.appVersion.commitHash!=="0d0fa92"&&e("div",{class:"top-menu",children:[e(ve,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(T,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(h,{id:"95IFnD"})})]}),e(Ge,{})]}),e("section",{children:[e(qe,{to:"/",children:[e(T,{icon:"home",size:"l"})," ",e("span",{children:e(h,{id:"i0qMbr"})})]}),r?e(U,{children:[l&&e(qe,{to:"/following",children:[e(T,{icon:"following",size:"l"})," ",e("span",{children:e(h,{id:"following.title"})})]}),e(qe,{to:"/catchup",children:[e(T,{icon:"history2",size:"l"}),e("span",{children:e(h,{id:"xrl8fj"})})]}),et("@mastodon/mentions")&&e(qe,{to:"/mentions",children:[e(T,{icon:"at",size:"l"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(qe,{to:"/notifications",children:[e(T,{icon:"notification",size:"l"})," ",e("span",{children:e(h,{id:"iDNBZe"})}),s.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ge,{}),((I=u==null?void 0:u.info)==null?void 0:I.id)&&e(qe,{to:`/${c}/a/${u.info.id}`,children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"vERlcd"})})]}),e(sr,{menuState:y}),e(qe,{to:"/b",children:[e(T,{icon:"bookmark",size:"l"})," ",e("span",{children:e(h,{id:"7Ff7ia"})})]}),e(an,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(U,{children:[e(T,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"24misb"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/f",children:[e(T,{icon:"heart",size:"l"})," ",e("span",{children:e(h,{id:"zZOZj7"})})]}),e(qe,{to:"/fh",children:[e(T,{icon:"hashtag",size:"l"})," ",e("span",{children:e(h,{id:"Xi1/bw"})})]}),e(qe,{to:"/sp",children:[e(T,{icon:"schedule",size:"l"})," ",e("span",{children:e(h,{id:"+GkIdc"})})]}),e(Ge,{}),et("@mastodon/filters")&&e(qe,{to:"/ft",children:[e(T,{icon:"filters",size:"l"})," ",e("span",{children:e(h,{id:"cSev+j"})})]}),e(ve,{onClick:()=>{x.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:g,excludeRelationshipAttrs:["muting"]}},children:[e(T,{icon:"mute",size:"l"})," ",e("span",{children:e(h,{id:"n1sANU"})})]}),e(ve,{onClick:()=>{x.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:w,excludeRelationshipAttrs:["blocking"]}},children:[e(T,{icon:"block",size:"l"})," ",e("span",{children:e(h,{id:"r3RRWo"})})]})," "]}),e(Ge,{}),e(ve,{onClick:()=>{x.showAccounts=!0},children:[e(T,{icon:"group",size:"l"})," ",e("span",{children:e(h,{id:"7e0O8Z"})})]})]}):e(U,{children:[e(Ge,{}),e(qe,{to:"/login",children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(Ge,{}),e(qe,{to:"/search",children:[e(T,{icon:"search",size:"l"})," ",e("span",{children:e(h,{id:"A1taO8"})})]}),e(qe,{to:`/${c}/trending`,children:[e(T,{icon:"chart",size:"l"})," ",e("span",{children:e(h,{id:"4/iCqx"})})]}),e(qe,{to:`/${c}/p/l`,children:[e(T,{icon:"building",size:"l"})," ",e("span",{children:e(h,{id:"d5zxa4"})})]}),e(qe,{to:`/${c}/p`,children:[e(T,{icon:"earth",size:"l"})," ",e("span",{children:e(h,{id:"4ERYY7"})})]}),r?e(U,{children:[e(Ge,{className:"divider-grow"}),e(ve,{onClick:()=>{x.showKeyboardShortcutsHelp=!0},children:[e(T,{icon:"keyboard",size:"l"})," ",e("span",{children:e(h,{id:"77Emn0"})})]}),e(ve,{onClick:()=>{x.showShortcutsSettings=!0},children:[e(T,{icon:"shortcut",size:"l"})," ",e("span",{children:e(h,{id:"8Kudkr"})})]}),e(ve,{onClick:()=>{x.showSettings=!0},children:[e(T,{icon:"gear",size:"l"})," ",e("span",{children:e(h,{id:"uVbUP8"})})]})]}):e(U,{children:[e(Ge,{}),e(ve,{onClick:()=>{x.showSettings=!0},children:[e(T,{icon:"gear",size:"l"})," ",e("span",{children:e(h,{id:"uVbUP8"})})]})]})]})]})]})}function sr({menuState:n}){const i=et("@mastodon/lists"),[s,o]=E([]);return ie(()=>{i&&n==="open"&&ln().then(o)},[n,i]),s.length>0?e(an,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(U,{children:[e(T,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"h16FyT"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),(s==null?void 0:s.length)>0&&e(U,{children:[e(Ge,{}),s.map(c=>e(qe,{to:`/l/${c.id}`,children:e("span",{children:c.title})},c.id))]})]}):i&&e(qe,{to:"/l",children:[e(T,{icon:"list",size:"l"}),e("span",{children:e(h,{id:"h16FyT"})})]})}const Mt=dt(ir),un={block:"start",inline:"center",behavior:"smooth"};function Tt({title:n,titleComponent:i,id:s,instance:o,emptyText:c,errorText:r,useItemID:u,boostsCarousel:d,fetchItems:l=()=>{},checkForUpdates:a=()=>{},checkForUpdatesInterval:p=15e3,headerStart:y,headerEnd:m,timelineStart:b,refresh:f,view:g,filterContext:v,showFollowedTags:w,showReplyParent:C,clearWhenRefresh:S}){const{_:k}=de(),A=Ve(x),[_,I]=E([]),[R,L]=E("start"),[B,P]=E(!1),[q,Q]=E(!1),[te,J]=E(!0),G=Y();__BENCHMARK.start(`timeline-${s}-load`);const z=Ce(()=>ai(),[]),ue=g!=="media",M=Y(0),F=jo(X=>{Q(!1),L("loading"),(async()=>{try{const ke=M.current=Date.now();let{done:Ne,value:ne}=await l(X);if(ke!==M.current)return;if(Array.isArray(ne)){const[oe,xe]=ne.reduce((O,ee)=>(ee._pinned?O[0].push(ee):O[1].push(ee),O),[[],[]]);ne=xe,ue&&(d&&(ne=Wa(ne)),ne=Xa(ne,o)),oe.length&&(ne=oe.concat(ne)),I(X?ne:O=>[...O,...ne]),ne.length||(Ne=!0),P(!Ne)}else P(!1);L("default"),__BENCHMARK.end(`timeline-${s}-load`)}catch{L("error"),X&&!_.length&&r&&pe(r)}finally{F.cancel()}})()},1e3,{leading:!0}),V=".timeline-item, .timeline-item-alt",re=Fe("j, shift+j",(X,ke)=>{if(X.shiftKey!==ke.shift)return;const Ne=document.activeElement.closest(V),ne=Ne==null?void 0:Ne.getBoundingClientRect(),oe=Array.from(G.current.querySelectorAll(V)).filter(xe=>!!xe.offsetHeight);if(Ne&&ne.top<G.current.clientHeight&&ne.bottom>0){const xe=oe.indexOf(Ne);let O=oe[xe+1];ke.shift&&(O=oe.find((ee,fe)=>fe>xe&&!ee.classList.contains("timeline-item-alt"))),O&&(O.focus(),O.scrollIntoView(un))}else{const xe=oe.find(O=>{const ee=O.getBoundingClientRect();return ee.top>=44&&ee.left>=0});xe&&(xe.focus(),xe.scrollIntoView(un))}},{useKey:!0}),H=Fe("k, shift+k",(X,ke)=>{if(X.shiftKey!==ke.shift)return;const Ne=document.activeElement.closest(V),ne=Ne==null?void 0:Ne.getBoundingClientRect(),oe=Array.from(G.current.querySelectorAll(V)).filter(xe=>!!xe.offsetHeight);if(Ne&&ne.top<G.current.clientHeight&&ne.bottom>0){const xe=oe.indexOf(Ne);let O=oe[xe-1];ke.shift&&(O=oe.findLast((ee,fe)=>fe<xe&&!ee.classList.contains("timeline-item-alt"))),O&&(O.focus(),O.scrollIntoView(un))}else{const xe=oe.find(O=>{const ee=O.getBoundingClientRect();return ee.top>=44&&ee.left>=0});xe&&(xe.focus(),xe.scrollIntoView(un))}},{useKey:!0}),se=Fe(["enter","o"],()=>{const X=document.activeElement;X!=null&&X.matches(V)&&X.click()},{useKey:!0}),be=_.length>0&&R!=="loading"&&q,we=ot(()=>{var X;be&&F(!0),(X=G.current)==null||X.scrollTo({top:0,behavior:"smooth"})},[F,be]),W=Fe(".",we),le=Y(),[Ee,$e]=E(!1);tr({scrollableRef:G,distanceFromEnd:2,scrollThresholdStart:44},({scrollDirection:X,nearReachStart:ke,reachStart:Ne})=>{if(le.current){const ne=X==="end"&&!ke;le.current.hidden=ne}$e(ke),Ne&&F(!0)},[]),ie(()=>{var X;(X=G.current)==null||X.scrollTo({top:0}),F(!0)},[]);const De=Y(!0);ie(()=>{var X;if(De.current){De.current=!1;return}S&&(_!=null&&_.length)&&((X=F.cancel)==null||X.call(F),I([])),F(!0)},[S,f]);const ze=Y(g);ie(()=>{ze.current!==g&&(ze.current=g,I([]))},[g]);const Le=ot(async({disableIdleCheck:X=!1}={})=>{const ke=G.current?getComputedStyle(G.current).pointerEvents==="none":!1;A.settings.autoRefresh&&G.current.scrollTop<16&&(X||window.__IDLE__)&&!rr()&&!ke?F(!0):await a()&&Q(!0)},[s,F,a,A.settings.autoRefresh]),Ae=Y();return jt(X=>{if(X){const ke=Date.now()-Ae.current;(!Ae.current||ke>1e3*3)&&Le({disableIdleCheck:!0})}else Ae.current=Date.now();J(X)},[a,Le,A.settings.autoRefresh]),li(Le,te&&!q?p*(Ee?1:2):null),e(Mn.Provider,{value:v,children:e("div",{id:`${s}-page`,class:`deck-container ${z?"deck-container-media-first":""}`,ref:X=>{G.current=X,re.current=X,H.current=X,se.current=X,W.current=X},tabIndex:"-1",onClick:X=>{le.current&&X.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{le.current.hidden=!1},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:le,onClick:X=>{var ke;X.target.closest("a, button")||(ke=G.current)==null||ke.scrollTo({top:0,behavior:"smooth"})},onDblClick:X=>{X.target.closest("a, button")||F(!0)},class:R==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),y??e(ge,{to:"/",class:"button plain home-button",children:e(T,{icon:"home",size:"l",alt:k({id:"i0qMbr"})})})]}),n&&(i||e("h1",{children:n})),e("div",{class:"header-side",children:!!m&&m})]}),be&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:we,children:[e(T,{icon:"arrow-up"})," ",e(h,{id:"2yr1/p"})]})]}),!!b&&e("div",{class:`timeline-start ${R==="loading"?"loading":""}`,children:b}),_.length?e(U,{children:[e("ul",{class:`timeline ${g?`timeline-${g}`:""}`,children:[_.map(X=>e(or,{status:X,instance:o,useItemID:u,filterContext:v,view:g,showFollowedTags:w,showReplyParent:C,mediaFirst:z},X.id+(X==null?void 0:X._pinned)+g)),B&&R==="loading"&&(g==="media"?null:e(U,{children:[e("li",{style:{height:"20vh"},children:e(Ye,{skeleton:!0,mediaFirst:z})}),e("li",{style:{height:"25vh"},children:e(Ye,{skeleton:!0,mediaFirst:z})})]}))]}),R==="default"&&(B?e(_t,{root:G.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:X=>{X&&F()},children:e("button",{type:"button",class:"plain block",onClick:()=>F(),style:{marginBlockEnd:"6em"},children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}))]}):R==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((X,ke)=>g==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(Ye,{skeleton:!0,mediaFirst:z})},ke))}):R!=="error"&&R!=="start"&&e("p",{class:"ui-state",children:c}),R==="error"&&e("p",{class:"ui-state",children:[r,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>F(!_.length),children:e(h,{id:"KDw4GX"})})]})]})})})}const or=dt(({status:n,instance:i,useItemID:s,filterContext:o,view:c,showFollowedTags:r,showReplyParent:u,mediaFirst:d})=>{const{_:l}=de(),{id:a,reblog:p,items:y,type:m,_pinned:b}=n;b&&(s=!1);const f=(p==null?void 0:p.id)||a,g=i?`/${i}/s/${f}`:`/s/${f}`;if(y){let w=Ot(y,o),C="";if(m==="boosts"?C=he._({id:"NuqppG",values:{0:w.length}}):m==="pinned"&&(C=l({id:"GlfmCu"})),m==="boosts"||m==="pinned"){const A=new Set;if(w.sort((_,I)=>{const R=Yt(_.filtered,o),L=Yt(I.filtered,o);return R&&(R==null?void 0:R.action)!=="blur"&&A.add(_.id),L&&(L==null?void 0:L.action)!=="blur"&&A.add(I.id),R&&!L?1:!R&&L?-1:0}),A.size>=2){const I=[],R=[];w.forEach(B=>{A.has(B.id)?R.push(B):I.push(B)});const L=[];for(let B=0;B<R.length;B+=5)L.push({_grouped:!0,posts:R.slice(B,B+5)});w=I.concat(L)}return e("li",{class:"timeline-item-carousel",children:e(cr,{title:C,class:`${m}-carousel`,children:w.map(_=>{const{id:I,reblog:R,_pinned:L,_grouped:B}=_;if(B)return e("li",{class:"timeline-item-carousel-group",children:_.posts.map(Q=>{const{id:te,reblog:J,_pinned:G}=Q,z=(J==null?void 0:J.id)||te,ue=i?`/${i}/s/${z}`:`/s/${z}`;return G&&(s=!1),e(ge,{class:"status-carousel-link timeline-item-alt",to:ue,children:s?e(Ye,{statusID:te,instance:i,size:"s"}):e(Ye,{status:Q,instance:i,size:"s"})})})},I);const P=(R==null?void 0:R.id)||I,q=i?`/${i}/s/${P}`:`/s/${P}`;return L&&(s=!1),e("li",{children:e(ge,{class:"status-carousel-link timeline-item-alt",to:q,children:s?e(Ye,{statusID:I,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d}):e(Ye,{status:_,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d})})},I)})})},`timeline-${a}`)}const k=w.length>3;return w.map((A,_)=>{const{id:I,_differentAuthor:R}=A,L=i?`/${i}/s/${I}`:`/s/${I}`,B=_>0&&_<w.length-1,P=A.sensitive&&!!A.spoilerText,q=!R&&P&&_>0||k&&B&&(m==="thread"||m==="conversation"&&!R&&!w[_-1]._differentAuthor&&!w[_+1]._differentAuthor),Q=_===0,te=_===w.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${m} timeline-item-container-${Q?"start":te?"end":"middle"} ${R?"timeline-item-diff-author":""}`,children:e(ge,{class:"status-link timeline-item",to:L,children:q?e(ar,{status:A,instance:i,filterContext:o}):s?e(Ye,{statusID:I,instance:i,enableCommentHint:te,showFollowedTags:r}):e(Ye,{status:A,instance:i,enableCommentHint:te,showFollowedTags:r})})},`timeline-${I}`)})}const v=`timeline-${a+b}`;return c==="media"?s?e(Ji,{class:"timeline-item",parent:"li",statusID:a,instance:i},v):e(Ji,{class:"timeline-item",parent:"li",status:n,instance:i},v):e("li",{children:e(ge,{class:"status-link timeline-item",to:g,children:s?e(Ye,{statusID:a,instance:i,enableCommentHint:!0,showFollowedTags:r,showReplyParent:u,mediaFirst:d}):e(Ye,{status:n,instance:i,enableCommentHint:!0,showFollowedTags:r,showReplyParent:u,mediaFirst:d})})},v)},(n,i)=>{var c,r;const s=(((c=n.status)==null?void 0:c.id)||"").toString(),o=(((r=i.status)==null?void 0:r.id)||"").toString();return s===o&&n.instance===i.instance&&n.view===i.view});function cr({title:n,class:i,children:s}){const{_:o}=de(),c=Y(),r=Y(),u=Y(),[d,l]=E(!1);return ie(()=>{setTimeout(()=>{l(!0)},1)},[]),e("div",{class:`status-carousel ${i}`,children:[e("header",{children:[e("h3",{children:n}),e("span",{children:[e("button",{ref:r,type:"button",class:"small plain2",onClick:()=>{var p,y;const a=Math.min(320,(p=c.current)==null?void 0:p.offsetWidth)*(Dt()?1:-1);(y=c.current)==null||y.scrollBy({left:a,behavior:"smooth"})},children:e(T,{icon:"chevron-left",alt:o({id:"DHhJ7s"})})})," ",e("button",{ref:u,type:"button",class:"small plain2",onClick:()=>{var p,y;const a=Math.min(320,(p=c.current)==null?void 0:p.offsetWidth)*(Dt()?-1:1);(y=c.current)==null||y.scrollBy({left:a,behavior:"smooth"})},children:e(T,{icon:"chevron-right",alt:o({id:"hXzOVo"})})})]})]}),e("ul",{ref:c,children:[e(_t,{class:"status-carousel-beacon",onChange:a=>{r.current&&(r.current.disabled=a)}}),s[0],d&&s.slice(1),e(_t,{class:"status-carousel-beacon",onChange:a=>{u.current&&(u.current.disabled=a)}})]})]})}function ar({status:n,instance:i,filterContext:s}){const{_:o}=de(),c=Ve(x),{id:r,visibility:u,language:d}=n,l=Ln(n),a=rt(r,i),p=Yt(n.filtered,s);return e("article",{class:`status compact-thread ${u==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[c.statusThreadNumber[a]?e("div",{class:"status-thread-badge",children:[e(T,{icon:"thread",size:"s",alt:o({id:"e66y2Z"})}),c.statusThreadNumber[a]?` ${c.statusThreadNumber[a]}/X`:""]}):e("div",{class:"status-thread-badge",children:e(T,{icon:"thread",size:"s",alt:o({id:"e66y2Z"})})}),e("div",{class:"content-compact",title:l,lang:d,dir:"auto",children:p&&(p==null?void 0:p.action)!=="blur"?e("b",{class:"status-filtered-badge badge-meta horizontal",title:(p==null?void 0:p.titlesStr)||"",children:p!=null&&p.titlesStr?e(h,{id:"sr6maL",values:{0:p.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(h,{id:"03Qqf9"})})}):e(U,{children:[l,n.sensitive&&n.spoilerText&&e(U,{children:[" ",e("span",{class:"spoiler-badge",children:e(T,{icon:"eye-close",size:"s",alt:o({id:"gnKo7f"})})})]})]})})]})}function rr(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const Ht=20,_i=1983,Qi=`${_i}-01`,lr=(()=>{try{const n=document.createElement("input");return n.setAttribute("type","month"),n.type==="month"}catch{return!1}})();async function dr(n){var o;const{masto:i}=ce({instance:n}),s=await i.v2.search.fetch({q:"from:me",type:"statuses",limit:1});return!!((o=s==null?void 0:s.statuses)!=null&&o.length)}const ur=bt(dr);function hr(){const{i18n:n,_:i}=de(),s=Ve(x),{id:o,...c}=Lt(),[r,u]=yt(),d=r.get("month"),l=!r.get("replies"),a=!!r.get("boosts"),p=r.get("tagged"),y=!!r.get("media"),{masto:m,instance:b,authenticated:f}=ce({instance:c.instance}),{masto:g,instance:v}=ce(),w=Y(),C=[d,l,a,p,y],[S,k]=E(),A=Y(0);ie(()=>{A.current=0},C);const _=Ce(()=>ai(),[]),I=Ce(()=>b===v,[b,v]),[R,L]=E(!1);ie(()=>{I&&S!=null&&S.acct&&(async()=>{const H=await ur(b);L(H)})()},[b,I,S==null?void 0:S.acct]);async function B(H){var Ee,$e,De,ze;const se=/^\d{4}-[01]\d$/.test(d),be=(($e=(Ee=d==null?void 0:d.split)==null?void 0:Ee.call(d,"-"))==null?void 0:$e[0])>=_i;if(se&&be){if(!S)return{value:[],done:!0};const[Le,Ae]=d.split("-"),X=parseInt(Ae,10)-1,ke=new Date(Le,X,0),Ne=`${ke.getFullYear()}-${(ke.getMonth()+1).toString().padStart(2,"0")}-${ke.getDate().toString().padStart(2,"0")}`,ne=new Date(Le,X+1,1),oe=`${ne.getFullYear()}-${(ne.getMonth()+1).toString().padStart(2,"0")}-${ne.getDate().toString().padStart(2,"0")}`;let xe;H?(xe=Ht+1,A.current=0):(xe=Ht+A.current+1,A.current+=Ht);const O=await m.v2.search.fetch({q:`from:${S.acct} after:${Ne} before:${oe}`,type:"statuses",limit:xe,offset:A.current});if((De=O==null?void 0:O.statuses)!=null&&De.length){const ee=O.statuses.slice(0,Ht);ee.forEach(D=>{Qe(D,b)});const fe=O.statuses.length<=Ht;return{value:ee,done:fe}}else return{value:[],done:!0}}let we=[];if(H){const{value:Le}=await m.v1.accounts.$select(o).statuses.list({pinned:!0}).next();if(Le!=null&&Le.length&&!p&&!y){const Ae=Le.map(X=>(Qe(X,b),{...X,_pinned:!0}));if(Ae.length>=3){const X=Ae.map(ke=>ke.id);we.push({id:X,items:Ae,type:"pinned"})}else we.push(...Ae)}}(H||!w.current)&&(w.current=m.v1.accounts.$select(o).statuses.list({limit:Ht,exclude_replies:l,exclude_reblogs:a,only_media:y||void 0,tagged:p}));const{value:W,done:le}=await w.current.next();if(W!=null&&W.length){if(we.length){let Le=[];((ze=we[0])==null?void 0:ze.type)==="pinned"?Le=we[0].id:Le=we.filter(X=>X._pinned).map(X=>X.id),Le.every(X=>W.some(ke=>ke.id===X))&&(we=[])}we.push(...W),W.forEach(Le=>{Qe(Le,b)})}return{value:we,done:le}}const[P,q]=E([]);let Q=i({id:"/cKnpj"});if(S!=null&&S.acct){const H=(/@/.test(S.acct)?"":"@")+S.acct,se=S!=null&&S.displayName?`${S.displayName} (${H})`:`${H}`;if(!l)Q=i({id:"hS1Opy",values:{accountDisplay:se}});else if(a)Q=i({id:"A/CX5F",values:{accountDisplay:se}});else if(p)Q=i({id:"QQrO94",values:{accountDisplay:se,tagged:p}});else if(y)Q=i({id:"NoG5wD",values:{accountDisplay:se}});else if(d){const be=new Date(d).toLocaleString(n.locale,{month:"long",year:"numeric"});Q=i({id:"8GjLvB",values:{accountDisplay:se,monthYear:be}})}else Q=se}tt(Q,"/:instance?/a/:id");const te=ot(()=>mr(o,m),[o,m]);ie(()=>{(async()=>{try{const H=await te();k(H)}catch{}if(!_)try{const H=await m.v1.accounts.$select(o).featuredTags.list();q(H)}catch{}})()},[o,_]);const{displayName:J,acct:G,emojis:z}=S||{},ue=Y(),M=Ce(()=>{const H=!l||a||p||y||!!d,se=s.accounts[`${o}@${b}`];return e(U,{children:[e(qs,{instance:b,account:se||o,fetchAccount:te,authenticated:f,standalone:!0}),!_&&e("div",{class:"filter-bar",ref:ue,style:{position:"relative"},children:[H?e(ge,{to:`/${b}/a/${o}`,class:"insignificant filter-clear",title:i({id:"u8JHrO"}),children:e(T,{icon:"x",size:"l",alt:i({id:"xCJdfg"})})},"clear-filters"):e(T,{icon:"filter",class:"insignificant",size:"l",alt:i({id:"cSev+j"})}),e(ge,{to:`/${b}/a/${o}${l?"?replies=1":""}`,onClick:()=>{l&&pe(i({id:"PIWNSQ"}))},class:l?"":"is-active",children:e(h,{id:"5BFynH"})}),e(ge,{to:`/${b}/a/${o}${a?"":"?boosts=0"}`,onClick:()=>{a||pe(i({id:"Qd13i0"}))},class:a?"is-active":"",children:e(h,{id:"usxQx0"})}),e(ge,{to:`/${b}/a/${o}${y?"":"?media=1"}`,onClick:()=>{y||pe(i({id:"rKpfPY"}))},class:y?"is-active":"",children:e(h,{id:"xYilR2"})}),P.map(be=>e(ge,{to:`/${b}/a/${o}${p===be.name?"":`?tagged=${encodeURIComponent(be.name)}`}`,onClick:()=>{p!==be.name&&pe(i({id:"L+HFfr",values:{0:be.name}}))},class:p===be.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),be.name]})},be.id)),R&&(lr?e("label",{class:`filter-field ${d?"is-active":""}`,children:[e(T,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!(S!=null&&S.acct),value:d||"",min:Qi,max:new Date().toISOString().slice(0,7),onInput:be=>{const{value:we,validity:W}=be.currentTarget;if(!W.valid)return;u(we?{month:we}:{});const[le,Ee]=we.split("-"),$e=parseInt(Ee,10)-1,De=new Date(le,$e);pe(i({id:"0WUFGD",values:{0:De.toLocaleString(n.locale,{month:"long",year:"numeric"})}}))}})]}):e(fr,{class:`filter-field ${d?"is-active":""}`,disabled:!(S!=null&&S.acct),value:d||"",min:Qi,max:new Date().toISOString().slice(0,7),onInput:be=>{const{value:we,validity:W}=be;W.valid&&u(we?{month:we}:{})}}))]})]})},[o,b,f,P,te,R,...C]);ie(()=>{var se;const H=(se=ue.current)==null?void 0:se.querySelector(".is-active");H&&ue.current.scrollTo({behavior:"smooth",left:H.offsetLeft-(ue.current.offsetWidth-H.offsetWidth)/2})},[P,R,...C]);const F=Ce(()=>{var se;return S!=null&&S.url?(se=URL.parse(S.url))==null?void 0:se.hostname:null},[S]),re=!!S&&!(b===F);return e(Tt,{title:`${S!=null&&S.acct?"@"+S.acct:i({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(Is,{text:J,emojis:z})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",G]})})]}),id:"account-statuses",instance:b,emptyText:i({id:"+k97fV"}),errorText:i({id:"scd9lw"}),fetchItems:B,useItemID:!0,view:y||_?"media":void 0,boostsCarousel:s.settings.boostsCarousel,timelineStart:M,refresh:[l,a,p,y,d+(S==null?void 0:S.acct)].toString(),headerEnd:e(lt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ve,{disabled:!re,onClick:()=>{(async()=>{try{const{masto:H}=ce({instance:F}),se=await H.v1.accounts.lookup({acct:S.acct}),{id:be}=se;location.hash=`/${F}/a/${be}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(T,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"/JFxxT",values:{0:F?e(U,{children:[" ","(",e("b",{children:rn.toUnicode(F)}),")"]}):null}})})]}),!I&&e(ve,{onClick:()=>{(async()=>{try{const H=await g.v1.accounts.lookup({acct:S.acct+"@"+b}),{id:se}=H;location.hash=`/${v}/a/${se}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(T,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"HkuyOu",values:{currentInstance:v},components:{0:e("b",{})}})})]})]})},o)}function fr(n){const{i18n:i}=de(),{class:s,disabled:o,value:c,min:r,max:u,onInput:d=()=>{}}=n,[l,a]=(c==null?void 0:c.split("-"))||[],p=Y(),y=Y(),m=(b,f)=>{const[g,v]=(r==null?void 0:r.split("-"))||[],[w,C]=(u==null?void 0:u.split("-"))||[];return!(f<g||f>w||f===g&&b<v||f===w&&b>C)};return e("div",{class:s,children:[e(T,{icon:"month",size:"l"}),e("select",{ref:p,disabled:o,value:a||"",onInput:b=>{const{value:f}=b.currentTarget,g=y.current.value;if(!m(f,g))return{value:"",validity:{valid:!1}};d({value:f?`${g}-${f}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(h,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(b,f)=>e("option",{value:(f+1).toString().padStart(2,"0"),children:new Date(0,f).toLocaleString(i.locale,{month:"long"})},f))]})," ",e("input",{ref:y,type:"number",disabled:o,value:l||new Date().getFullYear(),min:(r==null?void 0:r.slice(0,4))||_i,max:(u==null?void 0:u.slice(0,4))||new Date().getFullYear(),onInput:b=>{const{value:f,validity:g}=b.currentTarget,v=p.current.value;if(!g.valid||!m(v,f))return{value:"",validity:{valid:!1}};d({value:f?`${f}-${v}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}function pr(n,i){return i.v1.accounts.$select(n).fetch()}const mr=bt(pr,{maxAge:30*60*1e3});function gr(){var b;const n=Lt(),{year:i}=n;tt(i?`Annual Report: ${i}`:"Annual Report");const{masto:s,instance:o}=ce(),[c,r]=E(null),[u,d]=E("default");ie(()=>{i&&(async()=>{d("loading");const f=await s.v1.annualReports.$select(i).fetch();r(f),d("default")})()},[i]);const{accounts:l,annualReports:a,statuses:p}=c||{},y=(b=a==null?void 0:a.find(f=>f.year==i))==null?void 0:b.data,m=new Date;return e("div",{id:"annual-report-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"report",children:[e("h1",{children:[i," #Wrapstodon"]}),u==="loading"&&e("p",{children:[e(Ue,{abrupt:!0})," ",e(h,{id:"Pwqkdw"})]}),!!y&&e("dl",{children:Object.entries(y).map(([f,g])=>e(U,{children:[e("dt",{children:f}),e("dd",{class:`report-${f}`,children:Array.isArray(g)?e("table",{children:[e("thead",{children:e("tr",{children:Object.entries(g[0]).map(([v,w])=>e("th",{class:v!=="month"&&typeof w=="number"?"number":"",children:v}))})}),e("tbody",{children:g.map(v=>e("tr",{children:Object.entries(v).map(([w,C])=>e("td",{class:w!=="month"&&typeof C=="number"?"number":"",children:C&&/(accountId)/i.test(w)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(f)?e(gt,{account:l==null?void 0:l.find(S=>S.id===C),showAvatar:!0}):w==="month"?m.setMonth(C-1)&&m.toLocaleString(void 0,{month:"long"}):typeof C=="number"?C.toLocaleString():C}))}))})]}):typeof g=="object"?/^(topStatuses)$/i.test(f)?e("dl",{children:Object.entries(g).map(([v,w])=>e(U,{children:[e("dt",{children:v}),e("dd",{children:w&&e(ge,{to:`/${o}/s/${w}`,children:e(Ye,{status:p==null?void 0:p.find(C=>C.id===w),size:"s",readOnly:!0})})})]}))}):e("table",{children:e("tbody",{children:Object.entries(g).map(([v,w])=>e("tr",{children:[e("th",{children:v}),e("td",{class:typeof w=="number"?"number":"",children:w})]}))})}):typeof g=="string"?g:JSON.stringify(g,null,2)})]}))})]}),e("hr",{}),e("p",{style:{textAlign:"center"},children:e(ge,{to:"/",children:e(h,{id:"iWpEwy"})})})]})}const br=20;function Ws(){const{_:n}=de();tt(n({id:"7Ff7ia"}),"/bookmarks");const{masto:i,instance:s}=ce(),o=Y();async function c(r){return(r||!o.current)&&(o.current=i.v1.bookmarks.list({limit:br})),await o.current.next()}return e(Tt,{title:n({id:"7Ff7ia"}),id:"bookmarks",emptyText:n({id:"8k2w6G"}),errorText:n({id:"UoL+FC"}),instance:s,fetchItems:c})}const yr=""+new URL("catch-up-O5q5C75Z.png",import.meta.url).href,vr="home",ut=[{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}],wr={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},kr=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],Sr=[null,"account"],Cr=ys(n=>new Intl.DateTimeFormat(n||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function _r(){const{i18n:n,_:i,_:s}=de(),o=Cr(n.locale);tt("Catch-up","/catchup");const{masto:c,instance:r}=ce(),[u,d]=yt(),l=u.get("id"),[a,p]=E("start"),[y,m]=E(!1),b=Ce(()=>wt(),[]),f=$=>$===b,g=et("@pixelfed/home-include-reblogs");async function v({maxCreatedAt:$}){var K,Oe,Te;const N=$?new Date($):null,Z=[],j=c.v1.timelines.home.list({limit:40});e:for(;;)try{g&&j.nextParams&&(typeof j.nextParams=="string"?j.nextParams+="&include_reblogs=true":j.nextParams.include_reblogs=!0);const _e=await j.next(),{value:Be}=_e;if(Be!=null&&Be.length){await Zs(Be,r);let Ze=!1;for(let me=0;me<Be.length;me++){const Me=Be[me],We=new Date(Me.createdAt);if(!N||We>=N){const Re=!f(((Oe=(K=Me.reblog)==null?void 0:K.account)==null?void 0:Oe.id)||Me.account.id)&&Yt(((Te=Me.reblog)==null?void 0:Te.filtered)||Me.filtered,vr);if((Re==null?void 0:Re.action)==="hide")continue;Me._filtered=Re;const Xe=rt(Me.id,r);Me._followedTags=x.statusFollowedTags[Xe]?[...x.statusFollowedTags[Xe]]:[],Z.push(Me),Ze=!0}if(!Ze)break e}}else break e;await new Promise(Ze=>setTimeout(Ze,1e3))}catch{break e}return Z.forEach(_e=>{if(_e!=null&&_e.inReplyToId){const Be=Z.find(Ze=>Ze.id===_e.inReplyToId);Be&&!Be.inReplyToId&&(Be._thread=!0)}}),Z}const[w,C]=E([]),S=Y(),k=Y(),A=Ce(()=>_n(),[]),_=ot(async({duration:$}={})=>{const N=Date.now(),Z=$?N-$:null;p("loading");const j=await v({maxCreatedAt:Z}),K=`${A}-${Vo()}`;try{await mt.catchup.set(K,{id:K,posts:j,count:j.length,startAt:Z,endAt:N}),d({id:K})}catch{}},[]);ie(()=>{l?(async()=>{const $=await mt.catchup.get(l);$&&($.posts.sort((N,Z)=>N.createdAt>Z.createdAt?1:-1),C($.posts),p("results"))})():a==="results"&&(C([]),p("start"))},[l]);const[I,R]=Et($=>$+1,0),[L,B]=E(null),[P,q]=E([]);ie(()=>{(async()=>{try{const $=await mt.catchup.keys();if($.length){const N=_n(),Z=$.filter(j=>j.startsWith(`${N}-`));if(Z.length){let j=await mt.catchup.getMany(Z);j.sort((_e,Be)=>Be.endAt-_e.endAt);let K=j.slice(0,3),Oe=j.slice(3);const Te=K.map(_e=>{const{id:Be,count:Ze,startAt:me,endAt:Me}=_e;return{id:Be,count:Ze,startAt:me,endAt:Me}});q(Te),B(K[0].endAt),j=null,K=null,queueMicrotask(()=>{Oe.length&&mt.catchup.delMany(Oe.map(_e=>_e.id)).then(()=>{Oe=null}).catch(_e=>{})});return}}}catch{}q([])})()},[I]),ie(()=>{a==="start"&&R()},[a==="start"]);const[Q,te]=Ce(()=>{var Be,Ze,me,Me,We,nt;let $=0,N=0,Z=0,j=0,K=0,Oe=0;const Te={};for(const Re of w){Re._filtered&&((Be=Re._filtered)==null?void 0:Be.action)!=="blur"?($++,Re.__FILTER="filtered"):Re.group?(N++,Re.__FILTER="groups"):Re.reblog?(Z++,Re.__FILTER="boosts"):(Ze=Re._followedTags)!=null&&Ze.length?(K++,Re.__FILTER="followedTags"):Re.inReplyToId&&Re.inReplyToAccountId!==((me=Re.account)==null?void 0:me.id)?(j++,Re.__FILTER="replies"):(Oe++,Re.__FILTER="original");const Xe=Re.reblog||Re;if(Re.__FILTER!=="filtered"&&((Me=Xe.card)!=null&&Me.url)&&((We=Xe.card)!=null&&We.image)&&((nt=Xe.card)==null?void 0:nt.type)==="link"){const{card:dn,favouritesCount:$t,reblogsCount:Nt}=Xe;let{url:it}=dn;if(it=it.replace(/\/$/,""),!Te[it])Te[it]={postID:Xe.id,card:dn,shared:1,sharers:[Re.account],likes:$t,boosts:Nt};else{if(Te[it].sharers.find(On=>On.id===Re.account.id))continue;Te[it].shared++,Te[it].sharers.push(Re.account),Te[it].postID!==Xe.id&&(Te[it].likes+=$t,Te[it].boosts+=Nt)}}}let _e=[];for(const Re in Te)_e.push({url:Re,...Te[Re]});if(_e.sort((Re,Xe)=>Re.shared>Xe.shared?-1:Re.shared<Xe.shared?1:Re.boosts>Xe.boosts?-1:Re.boosts<Xe.boosts?1:Re.likes>Xe.likes?-1:Re.likes<Xe.likes?1:0),_e.length>10)e:for(let Re=10;Re<_e.length;Re++){const{shared:Xe}=_e[Re];if(Xe<=1){_e=_e.slice(0,Re);break e}}return[{filtered:$,groups:N,boosts:Z,replies:j,followedTags:K,original:Oe},_e]},[w]),[J,G]=E("all"),[z,ue]=E(null),[M,F]=E(1),[V,re]=E("createdAt"),[H,se]=E("asc"),[be,we]=E(null),[W,le,Ee]=Ce(()=>{const $={},N=new Map;let Z=w.filter(K=>{const Oe=J==="all"||K.__FILTER===J;return Oe&&($[K.account.id]=K.account,N.set(K.account.id,(N.get(K.account.id)||0)+1)),Oe});const j={};return Z.forEach(K=>{K.reblog&&(j[K.reblog.id]?(j[K.reblog.id].__BOOSTERS?j[K.reblog.id].__BOOSTERS.add(K.account):j[K.reblog.id].__BOOSTERS=new Set([K.account]),K.__HIDDEN=!0):j[K.reblog.id]=K)}),z&&N.has(z)&&(Z=Z.filter(K=>K.account.id===z||[...K.__BOOSTERS||[]].find(Oe=>Oe.id===z))),[Z,$,Object.fromEntries(N)]},[J,z,w]),$e=Ce(()=>{const $={};return W.forEach(N=>{$[N.id]=N}),$},[W]),De=Ce(()=>Object.keys(Ee).sort(($,N)=>Ee[N]-Ee[$]),[Ee]),ze=Ce(()=>{const $={};return De.forEach((N,Z)=>{$[N]=Z}),W.filter(N=>!N.__HIDDEN).sort((N,Z)=>{if(be==="account"){const j=N.account.id,K=Z.account.id,Oe=$[j],Te=$[K],_e=Oe-Te;if(_e!==0)return _e}if(V!=="createdAt"&&(N=N.reblog||N,Z=Z.reblog||Z,V!=="density"&&N[V]===Z[V]))return N.createdAt>Z.createdAt?1:-1;if(V==="density"){const j=es(N),K=es(Z);return H==="asc"?j>K?1:-1:K>j?1:-1}return H==="asc"?N[V]>Z[V]?1:-1:Z[V]>N[V]?1:-1})},[W,V,H,be,De]),Le=Y(null),Ae=Y(null),X=Y(!1);ie(()=>{w.length>100||X.current||Ae.current&&(Os(Ae.current,{duration:200}),X.current=!0)},[w,Ae]);const ke=w.length>160?"3d":"2d",Ne=Ce(()=>ke!=="2d"?null:w.map($=>{const N=$e[$.id];return e("span",{class:`post-dot ${N?"post-dot-highlight":""}`},$.id)}),[$e]),ne=Ce(()=>ke!=="3d"||!(w!=null&&w.length)?null:Lr(w,"createdAt",320).map((N,Z)=>e("div",{class:"posts-bin",children:N.map(j=>{const K=$e[j.id];return e("span",{class:`post-dot ${K?"post-dot-highlight":""}`},j.id)})},Z)),[$e]),oe=Y(null),xe=Ce(()=>L?(Date.now()-L)/1e3/60/60:null,[L,M]);ie(()=>{if(a!=="results")return;const $=z&&le[z]?le[z].username:"",N=H==="asc"?0:1,Z={account:"authors"};let j=pe({duration:5e3,text:s({id:"TLYeLT",values:{selectedFilterCategory:J,sortBy:V,sortOrder:H,groupBy:be}})});return()=>{var K;(K=j==null?void 0:j.hideToast)==null||K.call(j)}},[a,J,z,V,H,be,le]),ie(()=>{var $;if(z&&le[z]){const N=Ae.current.querySelector(`[data-author="${z}"]`),Z=($=Ae.current)==null?void 0:$.getBoundingClientRect(),j=N==null?void 0:N.getBoundingClientRect();j.left<Z.left||j.right>Z.right?N.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):j.top<0&&N.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[z,le]);const[O,ee]=E(!1),fe=".catchup-list > li > a",D=Fe("j",()=>{const $=document.activeElement.closest(fe),N=$==null?void 0:$.getBoundingClientRect(),Z=Array.from(oe.current.querySelectorAll(fe));if($&&N.top<oe.current.clientHeight&&N.bottom>0){const j=Z.indexOf($),K=Z[j+1];K&&(K.focus(),K.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const j=Z.find(K=>K.getBoundingClientRect().top>=0);j&&(j.focus(),j.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{useKey:!0,preventDefault:!0,ignoreModifiers:!0}),ae=Fe("k",()=>{const $=document.activeElement.closest(fe),N=$==null?void 0:$.getBoundingClientRect(),Z=Array.from(oe.current.querySelectorAll(fe));if($&&N.top<oe.current.clientHeight&&N.bottom>0){const j=Z.indexOf($);let K=Z[j-1];K&&(K.focus(),K.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const j=Z.find(K=>{const Oe=K.getBoundingClientRect();return Oe.top>=44&&Oe.left>=0});j&&(j.focus(),j.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{useKey:!0,preventDefault:!0,ignoreModifiers:!0}),Ie=Fe("h, l",($,N)=>{var j,K,Oe;const Z=N.keys[0];if(z){const Te=De.indexOf(z);Z==="h"?Te>0&&Te<De.length&&(ue(De[Te-1]),(j=oe.current)==null||j.focus()):Z==="l"&&Te<De.length-1&&Te>=0&&(ue(De[Te+1]),(K=oe.current)==null||K.focus())}else Z==="l"&&(ue(De[0]),(Oe=oe.current)==null||Oe.focus())},{useKey:!0,preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Se=Fe("esc",()=>{var $;ue(null),($=oe.current)==null||$.focus()},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Pe=Fe(".",()=>{var $;($=oe.current)==null||$.scrollTo({top:0,behavior:"smooth"})},{useKey:!0,preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),je=ot($=>{const N=document.activeElement,Z=(N==null?void 0:N.tagName)==="INPUT"&&N.type==="radio";if(($.key==="ArrowDown"||$.key==="ArrowUp"||$.key==="ArrowLeft"||$.key==="ArrowRight")&&Z){N.blur();return}},[]);return e("div",{ref:$=>{oe.current=$,D.current=$,ae.current=$,Ie.current=$,Se.current=$,Pe.current=$},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${a==="loading"?"loading":""}`,onClick:$=>{var N;$.target.closest("a, button")||(N=oe.current)==null||N.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),a==="results"&&e(ge,{to:"/catchup",class:"button plain",children:e(T,{icon:"history2",size:"l",alt:s({id:"xrl8fj"})})}),a==="start"&&e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:a!=="start"&&e(h,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:a!=="start"&&a!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{ee(!0)},children:e(h,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:je,children:[a==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(h,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(h,{id:"CxKPv6"})}),e("p",{children:e(h,{id:"YMU1CK"})}),e("img",{src:yr,width:"1200",height:"900",alt:s({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:$=>{$.target.closest("details").open=!1},children:e(h,{id:"2jI8hh"})})})]}),e("p",{children:e(h,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(h,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:S,type:"range",value:M,min:ut[0].value,max:ut[ut.length-1].value,step:"1",list:"catchup-ranges",onChange:$=>F(+$.target.value)})," ",e("span",{style:{width:"8em"},children:[i(ut[M-1].label),e("br",{}),e("small",{class:"insignificant",children:M==ut[ut.length-1].value?s({id:"NMNiaO"}):ct(new Date(Date.now()-M*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:ut.map(({label:$,value:N})=>e("option",{value:N,label:i($)}))})," ",e("button",{type:"button",onClick:()=>{var $;if(M<ut[ut.length-1].value){let N;M===ut[ut.length-1].value&&(($=k.current)!=null&&$.checked)?N=Date.now()-L:N=M*60*60*1e3,_({duration:N})}else _()},children:e(h,{id:"R0yu2l"})})]}),xe&&M>xe?e("p",{class:"catchup-info",children:[e(T,{icon:"info"})," ",e(h,{id:"AGyV7s"})]}):M===ut[ut.length-1].value&&L?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:k})," ",e(h,{id:"dDJEHI",values:{0:o.format(new Date(L))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"EAjFM0"})})}),!!(P!=null&&P.length)&&e("div",{class:"catchup-prev",children:[e("p",{children:e(h,{id:"Yfb9A8"})}),e("ul",{children:P.map($=>e("li",{children:[e(ge,{to:`/catchup?id=${$.id}`,children:[e(T,{icon:"history2"})," ",e("span",{children:$.startAt?o.formatRange(new Date($.startAt),new Date($.endAt)):`… – ${o.format(new Date($.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(h,{id:"S6XZwv",values:{0:$.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{var Z;if(confirm(s({id:"D9CmP2"}))){let j=pe(s({id:"xJUo4P",values:{0:$.id}}));await mt.catchup.del($.id),(Z=j==null?void 0:j.hideToast)==null||Z.call(j),pe(s({id:"1dyGG/",values:{0:$.id}})),R()}},children:e(T,{icon:"x",alt:s({id:"t/YqKh"})})})]})]},$.id))}),P.length>=3&&e("p",{children:e("small",{children:e(h,{id:"sXmrl4"})})})]})]}),a==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(Ue,{abrupt:!0}),e("p",{class:"insignificant",children:e(h,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(h,{id:"q9urQO"})})]}),a==="results"&&e(U,{children:[e("div",{class:"catchup-header",children:[w.length>0&&e("p",{children:e("b",{class:"ib",children:o.formatRange(new Date(w[0].createdAt),new Date(w[w.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:J==="all"&&!z&&V==="createdAt"&&H==="asc",type:"button",class:"plain4 small",onClick:()=>{G("all"),ue(null),re("createdAt"),we(null),se("asc")},children:e(h,{id:"I9EnzM"})}),(te==null?void 0:te.length)>0&&e("button",{type:"button",class:"plain small",onClick:()=>m(!y),children:[e(h,{id:"EIZREX"})," ",e(T,{icon:"chevron-down",style:{transform:y?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!y,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:te.map($=>{const{card:N,shared:Z,sharers:j,likes:K,boosts:Oe}=$,{blurhash:Te,title:_e,description:Be,url:Ze,image:me,imageDescription:Me,language:We,width:nt,height:Re,publishedAt:Xe}=N,dn=xs(Ze);let $t;if(Te){const Nt=hi(Te),it=Ci(Nt);$t=Si([.6,it[1],it[2]])}return e("a",{href:Ze,target:"_blank",rel:"noopener",class:"link-block",style:$t?{"--accent-color":`rgb(${$t.join(",")})`,"--accent-alpha-color":`rgba(${$t.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:me,alt:Me,width:nt,height:Re,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:dn})," ",!!Xe&&e(U,{children:"· "}),!!Xe&&e(U,{children:e(It,{datetime:Xe,format:"micro"})})]}),!!_e&&e("h1",{class:"title",lang:We,dir:"auto",title:_e,children:_e})]}),!!Be&&e("p",{class:"description",lang:We,dir:"auto",title:Be,children:Be}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(h,{id:"bfSr6z",values:{0:j.map(Nt=>{const{avatarStatic:it,displayName:On}=Nt;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:Ai=>{Ai.preventDefault(),Ai.stopPropagation();const{id:go}=Nt;ue(go),G("all")},children:e(pt,{url:it,size:"s",alt:On})})})}})})]})]})},Ze)})})})}),w.length>=5&&(ke==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:ne}):e("div",{class:"catchup-posts-viz-bar",children:Ne})),w.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:()=>{G("all")}}),e(h,{id:"N40H+G"})," ",e("span",{class:"count",children:w.length})]}),Object.entries(wr).map(([$,N])=>!!Q[$]&&e("label",{class:"filter-cat",title:(Q[$]/w.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:J.toLowerCase()===$.toLowerCase(),onChange:()=>{G($),$==="boosts"&&(re("reblogsCount"),se("desc"),we(null))}}),i(N)," ",e("span",{class:"count",children:Q[$]})]},i(N)))]}),w.length>=2&&!!Ee&&e("div",{class:"catchup-filters authors-filters",ref:Ae,children:[De.map($=>e("label",{class:"filter-author","data-author":$,children:[e("input",{type:"radio",name:"filter-author",checked:z===$,onChange:()=>{ue($)},onClick:()=>{z===$&&ue(null)}}),e(pt,{url:le[$].avatarStatic||le[$].avatar,size:"xxl",alt:`${le[$].displayName} (@${le[$].acct})`})," ",e("span",{class:"count",children:Ee[$]}),e("span",{class:"username",children:le[$].username})]},`${$}-${Ee[$]}`)),De.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(h,{id:"HHtYi7",values:{0:De.length}})},"authors-count")]}),w.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(h,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:kr.map($=>e("label",{class:"filter-sort",onClick:N=>{V===$&&(N.preventDefault(),N.stopPropagation(),se(H==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:V===$,onChange:()=>{re($);const N=/(replies|favourites|reblogs)/.test($)?"desc":"asc";se(N)}}),{createdAt:s({id:"mYGY3B"}),repliesCount:s({id:"N8UzTV"}),favouritesCount:s({id:"zZOZj7"}),reblogsCount:s({id:"puY2t0"}),density:s({id:"0tQ7AD"})}[$],V===$&&(H==="asc"?" ↑":" ↓")]},$))}),e("span",{class:"filter-label",children:e(h,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:Sr.map($=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:be===$,onChange:()=>{we($)},disabled:$==="account"&&z}),{account:s({id:"dpqPBg"})}[$]||s({id:"EdQY6l"})]},$||"none"))}),z&&De.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{ue(null)},style:{whiteSpace:"nowrap"},children:e(h,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${J||""} ${V?`catchup-sort-${V}`:""} ${z&&le[z]?"catchup-selected-author":""} ${be?`catchup-group-${be}`:""}`,children:ze.map(($,N)=>{var K;const Z=((K=$.reblog)==null?void 0:K.id)||$.id;let j=!1;return be==="account"&&(Le.current&&$.account.id!==Le.current&&N>0&&(j=!0),Le.current=$.account.id),e(U,{children:[j&&e("li",{class:"separator"}),e(Tr,{to:`/${r}/s/${Z}`,post:$,root:oe.current})]},`${$.id}-${j}`)})}),e("footer",{children:W.length>5&&e("p",{children:[s(J==="boosts"?{id:"eVosYr"}:{id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{oe.current.scrollTop=0},children:e(h,{id:"0MgdN+"})}),"."]})})]})]})]}),O&&e(He,{onClose:()=>ee(!1),children:e("div",{class:"sheet",id:"catchup-help-sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>ee(!1),children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(h,{id:"EIZREX"})}),e("dd",{children:e(h,{id:"YmGrIy"})}),e("dt",{children:e(h,{id:"coaNtr"})}),e("dd",{children:e(h,{id:"UUrqX1"})}),e("dt",{children:e(h,{id:"ScQBC/"})}),e("dd",{children:e(h,{id:"srocAr"})}),e("dt",{children:e(h,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(h,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const Ir=dt(function({post:n}){const{id:i,account:s,group:o,reblog:c,inReplyToId:r,inReplyToAccountId:u,_followedTags:d,_filtered:l,visibility:a,__BOOSTERS:p}=n,y=r&&u!==s.id,m=!!l&&(l==null?void 0:l.action)!=="blur",b=f=>{f.shiftKey};return e("article",{class:`post-line ${o?"group":c?"reblog":d!=null&&d.length?"followed-tags":""} ${y?"reply-to":""} ${m?"filtered":""} visibility-${a}`,onMouseEnter:b,children:[e("span",{class:"post-author",children:c?e("span",{class:"post-reblog-avatar",children:[e(pt,{url:s.avatarStatic||s.avatar,squircle:s.bot}),(p==null?void 0:p.size)>0?[...p].map(f=>e(pt,{url:f.avatarStatic||f.avatar,squircle:f.bot})):""," ",e(T,{icon:"rocket"})," ",e(gt,{account:c.account,showAvatar:!0})]}):e(gt,{account:s,showAvatar:!0})}),e(Rr,{post:c||n,filterInfo:l}),e("span",{class:"post-meta",children:[e(Er,{post:c||n})," ",e(It,{datetime:new Date((c==null?void 0:c.createdAt)||n.createdAt),format:"micro"})]})]})},(n,i)=>{var s,o;return((s=n==null?void 0:n.post)==null?void 0:s.id)===((o=i==null?void 0:i.post)==null?void 0:o.id)}),Tr=({root:n,to:i,...s})=>{const o=Y(),[c,r]=E(!1);return ie(()=>{const u=new IntersectionObserver(d=>{d[0].isIntersecting&&(queueMicrotask(()=>r(!0)),u.unobserve(o.current))},{root:n,rootMargin:`${Math.max(320,screen.height*.75)}px`});return o.current&&u.observe(o.current),()=>{o.current&&u.unobserve(o.current)}},[]),c?e("li",{children:e(ge,{to:i,children:e(Ir,{...s})})}):e("li",{ref:o,style:{height:"4em"}})},Ar=8,xr=8;function es(n){var l;const{spoilerText:i,content:s,poll:o,mediaAttachments:c,card:r}=n,u=(l=o==null?void 0:o.options)!=null&&l.length?o.options.reduce((a,p)=>a+p.title,""):"";return(i.length+Rs(s)+u.length)/140+(c!=null&&c.length?Ar*c.length:r!=null&&r.image?xr:0)}const At=48;function Rr({post:n,filterInfo:i}){var S;const{_:s}=de(),{spoilerText:o,sensitive:c,content:r,emojis:u,poll:d,mediaAttachments:l,card:a,inReplyToId:p,inReplyToAccountId:y,account:m,_thread:b}=n,f=p&&y===m.id||!!b,g=Ce(()=>!!(ye.account.get("preferences")||{})["reading:expand:spoilers"],[]),v=g||!o&&!c&&(i==null?void 0:i.action)!=="blur",w=r?Ln(n):"",C=!o||g;return e("div",{class:"post-peek",title:o?"":w,children:[e("span",{class:"post-peek-content",children:[f&&!C&&e(U,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),i&&(i==null?void 0:i.action)!=="blur"?e("span",{class:"post-peek-filtered",children:i!=null&&i.titlesStr?s({id:"suKjh3",values:{0:i.titlesStr}}):s({id:"03Qqf9"})}):e(U,{children:[!!o&&e("span",{class:"post-peek-spoiler",children:[e(T,{icon:`${g?"eye-open":"eye-close"}`})," ",o]}),C&&e("div",{class:"post-peek-html",children:[f&&e(U,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(h,{id:"e66y2Z"})})," "]}),!!r&&e("div",{dangerouslySetInnerHTML:{__html:Ko(r,u)}}),!!((S=d==null?void 0:d.options)!=null&&S.length)&&d.options.map(k=>e("div",{children:[d.multiple?"▪️":"•"," ",k.title]})),!r&&(l==null?void 0:l.length)===1&&l[0].description&&e(U,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:l[0].description})]})]})]})]}),(!i||(i==null?void 0:i.action)==="blur")&&e("span",{class:"post-peek-post-content",children:[!!d&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(T,{icon:"poll",size:"s"}),e(h,{id:"4WUbF1"})]}),l!=null&&l.length?l.map(k=>{var L,B,P,q,Q,te,J,G,z,ue;const A=k.previewUrl||k.url,_=k.previewRemoteUrl||k.remoteUrl,I=(L=k.meta)!=null&&L.original?k.meta.original.width:((P=(B=k.meta)==null?void 0:B.small)==null?void 0:P.width)||((Q=(q=k.meta)==null?void 0:q.original)==null?void 0:Q.width),R=(te=k.meta)!=null&&te.original?k.meta.original.height:((G=(J=k.meta)==null?void 0:J.small)==null?void 0:G.height)||((ue=(z=k.meta)==null?void 0:z.original)==null?void 0:ue.height);return e("span",{class:"post-peek-media",children:{image:(A||_)&&v?e("img",{src:A,width:At,height:At,alt:k.description,loading:"lazy",onError:M=>{const{src:F}=M.target;F===A&&(M.target.src=_)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(I,R)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🖼"}),gifv:(A||_)&&v?e("img",{src:A,width:At,height:At,alt:k.description,loading:"lazy",onError:M=>{const{src:F}=M.target;F===A&&(M.target.src=_)}}):e("span",{class:"post-peek-faux-media",children:"🎞️"}),video:(A||_)&&v?e("img",{src:A,width:At,height:At,alt:k.description,loading:"lazy",onError:M=>{const{src:F}=M.target;F===A&&(M.target.src=_)}}):e("span",{class:"post-peek-faux-media",children:"📹"}),audio:e("span",{class:"post-peek-faux-media",children:"🎵"})}[k.type]||null},k.id)}):!!a&&a.image&&v&&e("span",{class:`post-peek-media post-peek-card card-${a.type||""}`,children:a.image?e("img",{src:a.image,width:At,height:At,alt:a.title||a.description||a.imageDescription,loading:"lazy",style:{"--anim-duration":a.width&&a.height&&`${Math.min(Math.max(Math.max(a.width,a.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🔗"})})]})]})}function Er({post:n}){const{_:i}=de(),{reblogsCount:s,repliesCount:o,favouritesCount:c}=n;return e("span",{class:"post-stats",children:[o>0&&e("span",{class:"post-stat-replies",children:[e(T,{icon:"comment2",size:"s",alt:i({id:"N8UzTV"})})," ",Je(o)]}),c>0&&e("span",{class:"post-stat-likes",children:[e(T,{icon:"heart",size:"s",alt:i({id:"zZOZj7"})})," ",Je(c)]}),s>0&&e("span",{class:"post-stat-boosts",children:[e(T,{icon:"rocket",size:"s",alt:i({id:"puY2t0"})})," ",Je(s)]})]})}function Lr(n,i,s){const o=n.map(l=>new Date(l[i])),c=o.reduce((l,a)=>a<l?a:l,o[0]),r=o.reduce((l,a)=>a>l?a:l,o[0]),u=Math.min(r.getTime(),Date.now())-c.getTime(),d=Array.from({length:s},()=>[]);return n.forEach(l=>{const a=new Date(l[i]);if(a.getTime()>Date.now())d[d.length-1].push(l);else{const p=(a.getTime()-c.getTime())/u,y=Math.floor(p*(s-1));d[y].push(l)}}),d}const Mr=20;function Xs(){const{_:n}=de();tt(n({id:"zZOZj7"}),"/favourites");const{masto:i,instance:s}=ce(),o=Y();async function c(r){return(r||!o.current)&&(o.current=i.v1.favourites.list({limit:Mr})),await o.current.next()}return e(Tt,{title:n({id:"zZOZj7"}),id:"favourites",emptyText:n({id:"PHIrMr"}),errorText:n({id:"khVljG"}),instance:s,fetchItems:c})}const $r=["home","public","notifications","thread","account"],ts=["thread","account"],Nr={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},Pr=[0,30*60,60*60,6*60*60,12*60*60,60*60*24,60*60*24*7,60*60*24*30],Kn={0:{id:"qqeAJM"},1800:st(30,"minute"),3600:st(1,"hour"),21600:st(6,"hour"),43200:st(12,"hour"),86400:st(24,"hour"),604800:st(7,"day"),2592e3:st(30,"day")};function Dr(){const{_:n}=de(),{masto:i}=ce();tt(n({id:"cSev+j"}),"/ft");const[s,o]=E("default"),[c,r]=E(!1),[u,d]=Et(p=>p+1,0),[l,a]=E([]);return ie(()=>{o("loading"),(async()=>{try{const p=await i.v2.filters.list();p.sort((y,m)=>y.title.localeCompare(m.title)),p.forEach(y=>{var m;(m=y.keywords)!=null&&m.length&&y.keywords.sort((b,f)=>b.id-f.id)}),a(p),o("default")}catch{o("error")}})()},[u]),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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{r(!0)},children:e(T,{icon:"plus",size:"l",alt:n({id:"yFfBdX"})})})})]})}),e("main",{children:l.length>0?e(U,{children:[e("ul",{class:"filters-list",children:l.map(p=>{const{id:y,title:m,expiresAt:b,keywords:f}=p;return e("li",{children:[e("div",{children:[e("h2",{children:m}),(f==null?void 0:f.length)>0&&e("div",{children:f.map(g=>e(U,{children:[e("span",{class:"tag collapsed insignificant",children:g.wholeWord?`${g.keyword}`:g.keyword})," "]}))}),e("small",{class:"insignificant",children:e(Js,{expiresAt:b})})]}),e("button",{type:"button",class:"plain",onClick:()=>{r({filter:p})},children:e(T,{icon:"pencil",size:"l",alt:"Edit filter"})})]},y)})}),l.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"5vzJxv",values:{0:l.length}})})})]}):s==="loading"?e("p",{class:"ui-state",children:e(Ue,{})}):s==="error"?e("p",{class:"ui-state",children:e(h,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(h,{id:"cWIHTt"})})})]}),!!c&&e(He,{title:n({id:"vCSBPD"}),onClose:()=>{r(!1)},children:e(Ur,{filter:c==null?void 0:c.filter,onClose:p=>{p.state==="success"&&d(),r(!1)}})})]})}let Or=1;const zr=()=>Or++;function Ur({filter:n,onClose:i}){var R;const{_:s,_:o}=de(),{masto:c}=ce(),[r,u]=E("default"),d=!!n,{context:l,expiresAt:a,id:p,keywords:y,title:m,filterAction:b}=n||{},f=!!a,g=f&&new Date(a),[v,w]=E(y||[]),C=Y(),[S,k]=E([]),[A,_]=E([]),I=v.filter(L=>!S.includes(L.id)&&!A.includes(L._id));return e("div",{class:"sheet",id:"filters-add-edit-modal",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:o(d?{id:"3mOee6"}:{id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:L=>{L.preventDefault();const B=new FormData(L.target),P=B.get("title"),q=B.getAll("keyword_attributes[][id]"),Q=B.getAll("keyword_attributes[][keyword]"),te=[...C.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(M=>M.checked),J=Q.map((M,F)=>({id:q[F]||void 0,keyword:M,wholeWord:te[F]}));d&&(S!=null&&S.length)&&S.forEach(M=>{J.push({id:M,_destroy:!0})});const G=B.getAll("context");let z=B.get("expires_in");const ue=B.get("filter_action");!P||!(G!=null&&G.length)||(u("loading"),(async()=>{try{let M;d?(z===""||z===null?f?z=Math.floor((g-new Date)/1e3):z=null:z==="0"||z===0?z=null:z=+z,M=await c.v2.filters.$select(p).update({title:P,context:G,expiresIn:z,keywordsAttributes:J,filterAction:ue})):(z=+z||null,M=await c.v2.filters.create({title:P,context:G,expiresIn:z,keywordsAttributes:J,filterAction:ue})),u("default"),i==null||i({state:"success",filter:M})}catch{u("error"),alert(o(d?{id:"H8RP+h"}:{id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(h,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:m,disabled:r==="loading",dir:"auto",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:C,children:[I.length?e("ul",{class:"filter-keywords",children:I.map(L=>{const{id:B,keyword:P,wholeWord:q,_id:Q}=L;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:B}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:P,disabled:r==="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:B,defaultChecked:q,disabled:r==="loading"})," ",e(h,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:r==="loading",onClick:()=>{B?(S.push(B),k([...S])):Q&&(A.push(Q),_([...A]))},children:e(T,{icon:"x",alt:o({id:"t/YqKh"})})})]})]},`${B}-${Q}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(h,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{w([...v,{_id:zr(),keyword:"",wholeWord:!0}]),setTimeout(()=>{var B,P;const L=C.current.querySelectorAll('input[type="text"]');(P=(B=L[L.length-1])==null?void 0:B.focus)==null||P.call(B)},10)},children:e(h,{id:"qn5Dbn"})})," ",(I==null?void 0:I.length)>1&&e("small",{class:"insignificant",children:e(h,{id:"1JZ175",values:{0:I.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(h,{id:"uqf7Yq"})})}),$r.map(L=>e("div",{children:[e("label",{class:ts.includes(L)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:L,defaultChecked:l?l.includes(L):!0,disabled:r==="loading"})," ",s(Nr[L]),ts.includes(L)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(h,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[d&&e(h,{id:"ucJk3m",components:{0:e("b",{}),1:e(Js,{expiresAt:a,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:o(d?{id:"BcNdg+"}:{id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:r==="loading",defaultValue:d?void 0:0,children:[d&&e("option",{}),Pr.map(L=>e("option",{value:L,children:typeof Kn[L]=="function"?Kn[L]():s(Kn[L])}))]})]}),e("p",{children:[e(h,{id:"blQMpa"}),e("br",{}),((R=ps())==null?void 0:R.mastodon)>=5&&e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"blur",defaultChecked:b==="blur",disabled:r==="loading"})," ",e(h,{id:"ggxOw9"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:b!=="hide"&&b!=="blur"||!d,disabled:r==="loading"})," ",e(h,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:b==="hide",disabled:r==="loading"})," ",e(h,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:r==="loading",children:o(d?{id:"tfDRzk"}:{id:"hYgDIe"})})," ",e(Ue,{abrupt:!0,hidden:r!=="loading"})]}),d&&e(ht,{disabled:r==="loading",align:"end",menuItemClassName:"danger",confirmLabel:o({id:"BPjyR2"}),onClick:()=>{u("loading"),(async()=>{try{await c.v2.filters.$select(p).remove(),u("default"),i==null||i({state:"success"})}catch{u("error"),alert(o({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:r==="loading",children:e(h,{id:"Jb6/SB"})})})]})]})})]})}function Js({expiresAt:n,showNeverExpires:i}){const{_:s}=de(),o=!!n,c=o&&new Date(n),r=o&&c<=new Date,[u,d]=Et(l=>l+1,0);return li(d,r||3e4),r?s({id:"M1RnFv"}):o?e(h,{id:"urGtsw",components:{0:e(It,{datetime:c})}}):i&&s({id:"O1Aswy"})}function Br(){const{_:n}=de(),{masto:i,instance:s}=ce();tt(n({id:"Xi1/bw"}),"/fh");const[o,c]=E("default"),[r,u]=E([]);return ie(()=>{c("loading"),(async()=>{try{const d=await xn();u(d),c("default")}catch{c("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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:r.length>0?e(U,{children:[e("ul",{class:"link-list",children:r.map(d=>e("li",{children:e(ge,{to:s?`/${s}/t/${d.name}`:`/t/${d.name}`,children:[e(T,{icon:"hashtag",alt:"#"})," ",e("span",{children:d.name})]})}))}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"2S/uvJ",values:{0:r.length}})})})]}):o==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):o==="error"?e("p",{class:"ui-state",children:e(h,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(h,{id:"vKsGhk"})})})]})})}const Fr=20;function Ii({title:n,path:i,id:s,...o}){const{_:c}=de();tt(n||c({id:"following.title"}),i||"/following");const{masto:r,streaming:u,instance:d}=ce(),l=Ve(x),a=Y(),p=Y();__BENCHMARK.end("time-to-following");const y=et("@pixelfed/home-include-reblogs");async function m(f){var w;(f||!a.current)&&(__BENCHMARK.start("fetch-home-first"),a.current=r.v1.timelines.home.list({limit:Fr})),y&&((w=a.current)!=null&&w.nextParams)&&(typeof a.current.nextParams=="string"?a.current.nextParams+="&include_reblogs=true":a.current.nextParams.include_reblogs=!0);const g=await a.current.next();let{value:v}=g;if(v!=null&&v.length){let C=!1;f&&(v[0].id!==p.current&&(C=!0),p.current=v[0].id),v.forEach(S=>{Qe(S,d)}),v=Xi(v,d),f&&C&&Qa(),Zs(v,d),v.sort((S,k)=>{const A=new Date(S.createdAt);return new Date(k.createdAt)-A})}return __BENCHMARK.end("fetch-home-first"),{...g,value:v}}async function b(){var f;try{const g={limit:5,since_id:p.current};et("@pixelfed/home-include-reblogs")&&(g.include_reblogs=!0);const v=await r.v1.timelines.home.list(g).next();let{value:w}=v;const C=((f=w[0])==null?void 0:f.id)===p.current;return!!(w!=null&&w.length&&!C&&(p.current=w[0].id,w=Xi(w,d),w=Ot(w,"home"),w.some(S=>!S.reblog)))}catch{return!1}}return ie(()=>{let f;return(async()=>{if(u){f=u.user.subscribe();for await(const g of f){if(!f)break;if(g.event==="status.update"){const v=g.payload;Qe(v,d)}else if(g.event==="delete"){const v=g.payload,w=vs(v,d);w&&(w._deleted=!0)}}}})(),()=>{var g;(g=f==null?void 0:f.unsubscribe)==null||g.call(f),f=null}},[u]),e(Tt,{title:n||c({id:"following.title"}),id:s||"following",emptyText:c({id:"nJEKbY"}),errorText:c({id:"7QSeK6"}),instance:d,fetchItems:m,checkForUpdates:b,useItemID:!0,boostsCarousel:l.settings.boostsCarousel,...o,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const Hr=20,qr=4,ns=qr+1;function Qs({media:n,columnMode:i,...s}){const{_:o}=de();let{hashtag:c,...r}=i?{}:Lt();s.hashtag&&(c=s.hashtag);let u=c.trim().split(/[\s+]+/);u.sort(),c=u[0];const[d,l]=yt(),a=n||!!d.get("media"),p=a?"?media=1":"",{masto:y,instance:m,authenticated:b}=ce({instance:(s==null?void 0:s.instance)||r.instance}),{masto:f,instance:g,authenticated:v}=ce(),w=u.map(M=>`#${M}`).join(" "),C=o(m?a?{id:"kH0rA0",values:{hashtagTitle:w,instance:m}}:{id:"IK0zKi",values:{hashtagTitle:w,instance:m}}:a?{id:"hHSI3w",values:{hashtagTitle:w}}:{id:"+ZzjRY",values:{hashtagTitle:w}});tt(C,"/:instance?/t/:hashtag");const S=Y(),k=Ce(()=>ai(),[]),A=Y(void 0);async function _(M){const F=await y.v1.timelines.tag.$select(c).list({limit:Hr,any:u.slice(1),maxId:M?void 0:A.current,onlyMedia:a?!0:void 0}).next();let{value:V}=F;return V!=null&&V.length&&(M&&(S.current=V[0].id),V.forEach(re=>{Qe(re,m,{skipThreading:a||k})}),A.current=V[V.length-1].id),{...F,value:V}}async function I(){var M;try{const F=await y.v1.timelines.tag.$select(c).list({limit:1,any:u.slice(1),since_id:S.current,onlyMedia:a}).next();let{value:V}=F;const re=((M=V[0])==null?void 0:M.id)===S.current;return V!=null&&V.length&&!re?(V=Ot(V,"public"),!0):!1}catch{return!1}}const[R,L]=E("default"),[B,P]=E();ie(()=>{(async()=>{try{const M=await y.v1.tags.$select(c).fetch();P(M)}catch{}})()},[c]);const q=u.length>=ns,[Q,te]=E("default"),[J,G]=E([]),[z,ue]=E(!1);return ie(()=>{b&&(async()=>{try{const M=await y.v1.featuredTags.list();G(M),ue(M.some(F=>F.name.toLowerCase()===c.toLowerCase()))}catch{}})()},[]),e(Tt,{title:C,titleComponent:!!m&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:w}),e("div",{children:m})]}),id:"hashtag",instance:m,emptyText:o({id:"CNSLAW"}),errorText:o({id:"yjj6Ll"}),fetchItems:_,checkForUpdates:I,useItemID:!0,view:a||k?"media":void 0,refresh:a,filterContext:"public",headerEnd:e(lt,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[!!B&&u.length===1&&e(U,{children:[e(ht,{subMenu:!0,confirm:B.following,confirmLabel:o({id:"ctJi7k",values:{hashtag:c}}),disabled:R==="loading"||!b,onClick:()=>{L("loading"),B.following?y.v1.tags.$select(c).unfollow().then(()=>{P({...B,following:!1}),pe(o({id:"doK/ij",values:{hashtag:c}}))}).catch(M=>{alert(M)}).finally(()=>{L("default")}):y.v1.tags.$select(c).follow().then(()=>{P({...B,following:!0}),pe(o({id:"R9+aEN",values:{hashtag:c}}))}).catch(M=>{alert(M)}).finally(()=>{L("default")})},children:B.following?e(U,{children:[e(T,{icon:"check-circle"})," ",e("span",{children:e(h,{id:"HOSk7R"})})]}):e(U,{children:[e(T,{icon:"plus"})," ",e("span",{children:e(h,{id:"MKEPCY"})})]})}),e(ve,{type:"checkbox",checked:z,disabled:Q==="loading"||!b,onClick:()=>{if(te("loading"),z){const M=J.find(F=>F.name.toLowerCase()===c.toLowerCase()).id;M?y.v1.featuredTags.$select(M).remove().then(()=>{ue(!1),pe(o({id:"VH+Tf9"})),G(J.filter(F=>F.id!==M))}).catch(F=>{}).finally(()=>{te("default")}):pe(o({id:"3OLv47"}))}else y.v1.featuredTags.create({name:c}).then(M=>{ue(!0),pe(o({id:"9ra4hn"})),G(J.concat(M))}).catch(M=>{}).finally(()=>{te("default")})},children:z?e(U,{children:[e(T,{icon:"check-circle"}),e("span",{children:e(h,{id:"9ra4hn"})})]}):e(U,{children:[e(T,{icon:"check-circle"}),e("span",{children:e(h,{id:"UlJ3QN"})})]})}),e(Ge,{})]}),!k&&e(U,{children:[e(Es,{className:"plain",children:e(h,{id:"cSev+j"})}),e(ve,{type:"checkbox",checked:!!a,onClick:()=>{a?d.delete("media"):d.set("media","1"),l(d)},children:[e(T,{icon:"check-circle",alt:"☑️"})," ",e("span",{class:"menu-grow",children:e(h,{id:"eK4SL/"})})]}),e(Ge,{})]}),e(Go,{className:"menu-field",disabled:q,children:({ref:M})=>e("form",{onSubmit:F=>{var re,H;F.preventDefault();const V=(H=(re=F.target[0].value)==null?void 0:re.trim)==null?void 0:H.call(re);V&&!u.some(se=>se.toLowerCase()===V.toLowerCase())&&(u.push(V),u.sort(),location.hash=m?`/${m}/t/${u.join("+")}${p}`:`/t/${u.join("+")}${p}`)},children:[e(T,{icon:"hashtag"}),e("input",{ref:M,type:"text",placeholder:q?he._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:ns}}):o({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:q,dir:"auto"})]})}),e(Zo,{takeOverflow:!0,children:u.map((M,F)=>e(ve,{disabled:u.length===1,onClick:V=>{u.splice(F,1),u.sort(),location.hash=m?`/${m}/t/${u.join("+")}${p}`:`/t/${u.join("+")}${p}`},children:[e(T,{icon:"x",alt:o({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),M]})]},M))}),e(Ge,{}),e(ve,{disabled:!v,onClick:()=>{if(x.shortcuts.length>=Ct){alert(he._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:Ct}}));return}const M={type:"hashtag",hashtag:u.join(" "),instance:m,media:a?"on":void 0};x.shortcuts.some(V=>V.type===M.type&&V.hashtag.split(/[\s+]+/).sort().join(" ")===M.hashtag.split(/[\s+]+/).sort().join(" ")&&(V.instance?V.instance===M.instance:!0)&&(V.media?!!V.media==!!M.media:!0))?alert(o({id:"kfeQnS"})):(x.shortcuts.push(M),pe(o({id:"MIhb91"})))},children:[e(T,{icon:"shortcut"})," ",e("span",{children:e(h,{id:"i02Lq/"})})]}),e(ve,{onClick:()=>{let M=prompt(o({id:"2MQ2cd"}));if(!/\./.test(M)){M&&alert(o({id:"7WddtO"}));return}M&&(M=M.toLowerCase().trim(),location.hash=`/${M}/t/${u.join("+")}${p}`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),g!==m&&e(ve,{onClick:()=>{location.hash=`/${g}/t/${u.join("+")}${p}`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:g},components:{0:e("b",{})}})})]})]})},m+w)}const Yr=20;function eo(n){var C;const{_:i}=de(),s=Ve(x),{masto:o,instance:c}=ce(),r=(n==null?void 0:n.id)||((C=Lt())==null?void 0:C.id),u=Y(),d=Y();async function l(S){(S||!d.current)&&(d.current=o.v1.timelines.list.$select(r).list({limit:Yr}));const k=await d.current.next();let{value:A}=k;return A!=null&&A.length&&(S&&(u.current=A[0].id),A.forEach(_=>{Qe(_,c)})),{...k,value:A}}async function a(){var S;try{const k=await o.v1.timelines.list.$select(r).list({limit:1,since_id:u.current});let{value:A}=k;const _=((S=A[0])==null?void 0:S.id)===u.current;return A!=null&&A.length&&!_?(A=Ot(A,"home"),!0):!1}catch{return!1}}const[p,y]=E([]);ie(()=>{ln().then(y)},[]);const[m,b]=E({title:"List"});tt(m.title,"/l/:id"),ie(()=>{(async()=>{try{const S=await Fs(r);b(S)}catch{}})()},[r]);const[f,g]=E(!1),[v,w]=E(!1);return e(U,{children:[e(Tt,{title:m.title,id:"list",emptyText:i({id:"KkDhfU"}),errorText:i({id:"7QSeK6"}),instance:c,fetchItems:l,checkForUpdates:a,useItemID:!0,boostsCarousel:s.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(lt,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(T,{icon:"list",size:"l",alt:i({id:"h16FyT"})}),e(T,{icon:"chevron-down",size:"s"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),(p==null?void 0:p.length)>0&&e(U,{children:[e(Ge,{}),p.map(S=>e(qe,{to:`/l/${S.id}`,children:e("span",{children:S.title})},S.id))]})]}),headerEnd:e(lt,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ve,{onClick:()=>g({list:m}),children:[e(T,{icon:"pencil",size:"l"}),e("span",{children:e(h,{id:"ePK91l"})})]}),e(ve,{onClick:()=>w(!0),children:[e(T,{icon:"group",size:"l"}),e("span",{children:e(h,{id:"hB02vO"})})]})]})},r),f&&e(He,{onClick:S=>{S.target===S.currentTarget&&g(!1)},children:e(ki,{list:f==null?void 0:f.list,onClose:S=>{S.state==="success"&&S.list?b(S.list):S.state==="deleted"&&(location.hash="/l"),g(!1)}})}),v&&e(He,{onClick:S=>{S.target===S.currentTarget&&w(!1)},children:e(Vr,{listID:r,onClose:()=>w(!1)})})]})}const jr=40;function Vr({listID:n,onClose:i}){const{_:s}=de(),{masto:o,instance:c}=ce(),[r,u]=E([]),[d,l]=E("default"),[a,p]=E(!1),y=Y();async function m(b){p(!1),l("loading"),(async()=>{try{(b||!y.current)&&(y.current=o.v1.lists.$select(n).accounts.list({limit:jr}));const f=await y.current.next();let{done:g,value:v}=f;v!=null&&v.length?(u(b?v:r.concat(v)),p(!g)):p(!1),l("default")}catch{l("error")}})()}return ie(()=>{m(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[r.map(b=>e("li",{children:[e(ft,{account:b,instance:c}),e(Kr,{account:b,listID:n})]},b.id)),a&&d==="default"&&e(_t,{as:"li",onChange:b=>b&&m(),children:e("button",{type:"button",class:"light block",onClick:m,children:e(h,{id:"uXRAkV"})})})]})})]})}function Kr({account:n,listID:i}){const{_:s}=de(),{masto:o}=ce(),[c,r]=E("default"),[u,d]=E(!1);return e(ht,{confirm:!u,confirmLabel:e("span",{children:e(h,{id:"j5n9Ry",values:{0:n.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{u?(r("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.create({accountIds:[n.id]}),r("default"),d(!1)}catch{r("error")}})()):(r("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.remove({accountIds:[n.id]}),r("default"),d(!0)}catch{r("error")}})())},children:e("button",{type:"button",class:`light ${u?"":"danger"}`,disabled:c==="loading",children:s(u?{id:"m16xKo"}:{id:"MWIaew"})})})}const Gr={mention:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},Zr=["favourite","reblog","follow"],to=n=>Zr.includes(n);function no(n){return n.filter(i=>{const{type:s,id:o,createdAt:c}=i;if(!s)return!1;const r=Gr[s];return r!=null&&r.length?r.every(u=>!!i[u]):!0})}function io(n){if(n!=null&&n.notificationGroups){const{accounts:i=[],notificationGroups:s=[],statuses:o=[]}=n;return s.map(c=>{const{sampleAccountIds:r,statusId:u}=c,d=(r==null?void 0:r.map(a=>i.find(p=>p.id===a)))||[],l=(o==null?void 0:o.find(a=>a.id===u))||null;return{...c,sampleAccounts:d,status:l}})}return n}function Wr(n){const i=n.map(u=>{const{latestPageNotificationAt:d,mostRecentNotificationId:l,sampleAccounts:a,notificationsCount:p}=u;return{id:""+l,createdAt:d,account:a[0],...u}}),s={},o=[];for(let u=0;u<i.length;u++){const d=i[u],{type:l,status:a,createdAt:p,notificationsCount:y,sampleAccounts:m,groupKey:b}=d,f=p?new Date(p).toLocaleDateString():"";let g=l;y>0&&(m==null||m.length),(l==="favourite"||l==="reblog")&&(g="favourite+reblog");const v=`${a==null?void 0:a.id}-${g}-${f}`,w=s[v];if(!to(l))o.push(d);else if(w)m.forEach(C=>{const S=w.sampleAccounts.find(k=>k.id===C.id);S?(S._types.push(l),S._types.sort().reverse()):w.sampleAccounts.push({...C,_types:[l]})}),w.notificationsCount=Math.min(w.notificationsCount,y),w._notificationsCount.push(y),w._accounts=w.sampleAccounts,w._groupKeys.push(b);else{const C=m.map(S=>({...S,_types:[l]}));s[v]={...d,sampleAccounts:C,type:g,_accounts:C,_groupKeys:b?[b]:[],_notificationsCount:[y]},o.push(s[v])}}const c={},r=[];for(let u=0;u<o.length;u++){const d=o[u],{type:l,account:a,_accounts:p,sampleAccounts:y,createdAt:m,groupKey:b}=d,f=m?new Date(m).toLocaleDateString():"",g=(y==null?void 0:y.length)===1||(p==null?void 0:p.length)===1;if((l==="favourite"||l==="reblog"||l==="favourite+reblog")&&g){const v=`${a==null?void 0:a.id}-${l}-${f}`,w=c[v];if(w)w._statuses.push(d.status),w._ids+=`-${d.id}`,w._groupKeys.push(b);else{let C=c[v]={...d,type:l,_ids:d.id,_statuses:[d.status],_groupKeys:b?[b]:[]};r.push(C)}}else r.push(d)}return r}function Xr(n){n=no(n);const i={},s=[];for(let r=0,u=0;r<n.length;r++){const d=n[r],{id:l,status:a,account:p,type:y,createdAt:m}=d,b=m?new Date(m).toLocaleDateString():"";let f=y;(y==="favourite"||y==="reblog")&&(f="favourite+reblog");const g=`${a==null?void 0:a.id}-${f}-${b}`,v=i[g];if(!to(y))s[u++]=d;else if(v!=null&&v.account){const w=v._accounts.find(C=>C.id===p.id);w?(w._types.push(y),w._types.sort().reverse(),v._ids+=`-${l}`):(p._types=[y],v._accounts.push(p),v._ids+=`-${l}`)}else{p&&(p._types=[y]);let w=i[g]={...d,type:f,_ids:l,_accounts:p?[p]:[]};s[u++]=w}}const o={},c=[];for(let r=0,u=0;r<s.length;r++){const d=s[r],{id:l,account:a,_accounts:p,type:y,createdAt:m}=d,b=m?new Date(m).toLocaleDateString():"";if(y==="favourite+reblog"&&a&&p.length===1){const f=`${a==null?void 0:a.id}-${y}-${b}`,g=o[f];if(g)g._statuses.push(d.status),g._ids+=`-${l}`;else{let v=o[f]={...d,type:y,_ids:l,_statuses:[d.status]};c[u++]=v}}else c[u++]=d}return c}const is=20,Jr=new URLSearchParams;function so({columnMode:n,...i}){const{_:s}=de(),{masto:o,instance:c}=ce(),[r]=n?[Jr]:yt(),[u,d]=E(null),l=(i==null?void 0:i.type)||r.get("type")||u;tt(s(l==="private"?{id:"2BApYc"}:{id:"/bZzdR"}),"/mentions");const a=Y(),p=Y();async function y(C){(C||!a.current)&&(a.current=o.v1.notifications.list({limit:is,types:["mention"]}));const S=await a.current.next();let{value:k}=S;return k!=null&&k.length&&(k=no(k),C&&(p.current=k[0].id),k.forEach(({status:A})=>{Qe(A,c)})),{...S,value:k==null?void 0:k.map(A=>A.status)}}const m=Y(),b=Y();async function f(C){(C||!m.current)&&(m.current=o.v1.conversations.list({limit:is}));const S=await m.current.next();let{value:k}=S;return k=k==null?void 0:k.filter(A=>A.lastStatus),k!=null&&k.length&&(C&&(b.current=k[0].lastStatus.id),k.forEach(({lastStatus:A})=>{Qe(A,c)})),{...S,value:k==null?void 0:k.map(A=>A.lastStatus)}}function g(...C){return l==="private"?f(...C):y(...C)}async function v(){var C;if(l==="private")try{const S=await o.v1.conversations.list({limit:1,since_id:b.current}).next();let{value:k}=S;const A=((C=k[0])==null?void 0:C.id)===b.current;return k!=null&&k.length&&!A?(b.current=k[0].lastStatus.id,!0):!1}catch{return!1}else try{const S=await o.v1.notifications.list({limit:1,types:["mention"],since_id:p.current}).next();let{value:k}=S;return k!=null&&k.length?(p.current=k[0].id,!0):!1}catch{return!1}}const w=Ce(()=>e("div",{class:"filter-bar centered",children:[e(ge,{to:"/mentions",class:l?"":"is-active",onClick:C=>{n&&(C.preventDefault(),d(null))},children:e(h,{id:"N40H+G"})}),e(ge,{to:"/mentions?type=private",class:l==="private"?"is-active":"",onClick:C=>{n&&(C.preventDefault(),d("private"))},children:e(h,{id:"zwBp5t"})})]}),[l]);return e(Tt,{title:s({id:"/bZzdR"}),id:"mentions",emptyText:s({id:"03jFGT"}),errorText:s({id:"pqR9KF"}),instance:c,fetchItems:g,checkForUpdates:v,useItemID:!0,timelineStart:w,refresh:l,filterContext:"notifications"})}const Qr=80,el=20,tl=new URLSearchParams,hn={block:"center",inline:"center",behavior:"smooth"},oo=ys(()=>et("@mastodon/grouped-notifications"),{maxAge:1e3*60*5});function ni(n={}){const{masto:i}=ce();return x.settings.groupedNotificationsAlpha&&oo()?i.v2.notifications.list({limit:el,...n}):i.v1.notifications.list({limit:Qr,...n})}function co(n){return x.settings.groupedNotificationsAlpha&&oo()?Wr(n):Xr(n)}const nl=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],il={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function sl({columnMode:n}){var fe;const{_:i,_:s}=de();tt(s({id:"iDNBZe"}),"/notifications");const{masto:o,instance:c}=ce(),r=Ve(x),[u,d]=E("default"),[l]=n?[tl]:yt(),a=l.get("id"),p=l.get("access_token"),[y,m]=E(!1),[b,f]=E(!1),g=Y(),{nearReachEnd:v,scrollDirection:w,reachStart:C,nearReachStart:S}=er({scrollableRef:g}),k=w==="end"&&!S,[A,_]=E([]),[I,R]=E([]),L=Y();async function B(D){var Se;if((D||!L.current)&&(L.current=ni({excludeTypes:["follow_request"]})),/max_id=($|&)/i.test((Se=L.current)==null?void 0:Se.nextParams))return{done:!0};const ae=await L.current.next(),Ie=io(ae.value);if(Ie!=null&&Ie.length){Ie.forEach(je=>{Qe(je.status,c,{skipThreading:!0})});const Pe=co(Ie);D?(x.notificationsLast=Pe[0],x.notifications=Pe,o.v1.markers.create({notifications:{lastReadId:Pe[0].id}}).catch(()=>{})):x.notifications.push(...Pe)}return x.notificationsShowNew=!1,x.notificationsLastFetchTime=Date.now(),ae}async function P(){try{return await o.v1.followRequests.list({limit:80})}catch{return[]}}const q=()=>{d("loading"),(async()=>{try{const D=await P();_(D),d("default")}catch{d("error")}})()};async function Q(){try{return await o.v1.announcements.list()}catch{return[]}}const te=et("@mastodon/filtered-notifications"),[J,G]=E(!1),[z,ue]=E({});function M(){return o.v2.notifications.policy.fetch().catch(()=>{})}function F(){M().then(D=>{ue(D)}).catch(()=>{})}const[V,re]=E(null);function H(){return o.v1.notifications.requests.list()}const se=D=>{we(!1),d("loading"),(async()=>{try{const ae=B(D);D&&(Q().then(Se=>{Se.sort((Pe,je)=>{const $=new Date(Pe.updatedAt||Pe.createdAt);return new Date(je.updatedAt||je.createdAt)-$}),R(Se)}).catch(()=>{}),P().then(Se=>{_(Se)}).catch(()=>{}),te&&F());const{done:Ie}=await ae;m(!Ie),d("default")}catch{d("error")}})()};ie(()=>{se(!0)},[]),ie(()=>{C&&se(!0)},[C]);const[be,we]=E(!1),W=ot(({disableIdleCheck:D=!1}={})=>{var ae;u!=="loading"&&r.settings.autoRefresh&&((ae=g.current)==null?void 0:ae.scrollTop)<16&&(D||window.__IDLE__)&&!ol()&&se(!0)},[r.notificationsShowNew,r.settings.autoRefresh,u]),le=Y();jt(D=>{if(D){const ae=Date.now()-le.current;!le.current||ae>1e3*3?W({disableIdleCheck:!0}):le.current=Date.now()}});const Ee=Y(!0);ie(()=>{let D=Ao(x,"notificationsShowNew",ae=>{if(Ee.current){Ee.current=!1;return}u!=="loading"&&(ae&&W(),we(ae))});return()=>D==null?void 0:D()},[]);const $e=new Date,De=new Date($e-24*60*60*1e3);let ze=new Date;const Le=!r.notifications.some(D=>new Date(D.createdAt).toDateString()===$e.toDateString()),Ae=Y();ie(()=>{a&&(x.routeNotification={id:a,accessToken:atob(p)})},[a,p]);const[X,ke]=E(null);ie(async()=>{var Se,Pe,je;const D=new Date;if(D.getMonth()!==11||!et("@mastodon/annual-report"))return;let ae=ye.account.get("annualReportNotification");if(ae){ke(ae);return}const Ie=ni({types:["annual_report"]});try{const $=await Ie.next();ae=(Pe=(Se=$==null?void 0:$.value)==null?void 0:Se.notificationGroups)==null?void 0:Pe[0],((je=ae==null?void 0:ae.annualReport)==null?void 0:je.year)==D.getFullYear()&&(ke(ae),ye.account.set("annualReportNotification",ae))}catch{}},[]);const Ne=".notification",ne=Fe("j",()=>{const D=document.activeElement.closest(Ne),ae=D==null?void 0:D.getBoundingClientRect(),Ie=Array.from(g.current.querySelectorAll(Ne));if(D&&ae.top<g.current.clientHeight&&ae.bottom>0){const Se=Ie.indexOf(D);let Pe=Ie[Se+1];Pe&&(Pe.focus(),Pe.scrollIntoView(hn))}else{const Se=Ie.find(Pe=>{const je=Pe.getBoundingClientRect();return je.top>=44&&je.left>=0});Se&&(Se.focus(),Se.scrollIntoView(hn))}},{useKey:!0}),oe=Fe("k",()=>{const D=document.activeElement.closest(Ne),ae=D==null?void 0:D.getBoundingClientRect(),Ie=Array.from(g.current.querySelectorAll(Ne));if(D&&ae.top<g.current.clientHeight&&ae.bottom>0){const Se=Ie.indexOf(D);let Pe=Ie[Se-1];Pe&&(Pe.focus(),Pe.scrollIntoView(hn))}else{const Se=Ie.find(Pe=>{const je=Pe.getBoundingClientRect();return je.top>=44&&je.left>=0});Se&&(Se.focus(),Se.scrollIntoView(hn))}},{useKey:!0}),xe=Fe(["enter","o"],()=>{const D=document.activeElement.closest(Ne),ae=D==null?void 0:D.querySelector(".status-link");ae&&ae.click()},{useKey:!0}),O=new Date,ee=Ce(()=>ct(O,{forceOpts:{weekday:"long"}}),[O]);return e("div",{id:"notifications-page",class:"deck-container",ref:D=>{g.current=D,ne.current=D,oe.current=D,xe.current=D},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${b?"only-mentions":""}`,children:[e("header",{hidden:k,onClick:D=>{var ae;D.target.closest("a, button")||(ae=g.current)==null||ae.scrollTo({top:0,behavior:"smooth"})},onDblClick:D=>{D.target.closest("a, button")||se(!0)},class:u==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"iDNBZe"})}),e("div",{class:"header-side",children:te&&e("button",{type:"button",class:"button plain4",onClick:()=>{G(!0)},children:e(T,{icon:"settings",size:"l",alt:s({id:"a/+arl"})})})})]}),be&&u!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{var D;se(!0),(D=g.current)==null||D.scrollTo({top:0,behavior:"smooth"})},children:[e(T,{icon:"arrow-up"})," ",e(h,{id:"Jy9RU/"})]})]}),I.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(T,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(h,{id:"0whvLM",values:{0:I.length}})," ",e("small",{class:"insignificant",children:c})]}),I.length>1&&e("span",{class:"announcements-nav-buttons",children:I.map((D,ae)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{var Ie;(Ie=Ae.current)==null||Ie.children[ae].scrollIntoView({behavior:"smooth",block:"nearest"})},children:ae+1}))})]}),e("ul",{class:`announcements-list-${I.length>1?"multiple":"single"}`,ref:Ae,children:I.map(D=>e("li",{children:e(cl,{announcement:D})}))})]})})}),A.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(h,{id:"6Fs1Ba"})}),A.length>5?e("details",{children:[e("summary",{children:e(h,{id:"7dHKu4",values:{0:A.length}})}),e("ul",{children:A.map(D=>e("li",{children:[e(ft,{account:D}),e(ti,{accountID:D.id,onChange:()=>{}})]},D.id))})]}):e("ul",{children:A.map(D=>e("li",{children:[e(ft,{account:D}),e(ti,{accountID:D.id,onChange:()=>{}})]},D.id))})]}),te&&((fe=z==null?void 0:z.summary)==null?void 0:fe.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 D=>{const{open:ae}=D.target;if(ae){const Ie=await H();re(Ie)}},children:[e("summary",{children:e(h,{id:"N3Bq0f",values:{0:z.summary.pendingRequestsCount}})}),V?(V==null?void 0:V.length)>0&&e("ul",{children:V.map(D=>{var ae,Ie;return e("li",{children:[e("div",{class:"request-notifcations",children:[!((ae=D.lastStatus)!=null&&ae.id)&&e(ft,{useAvatarStatic:!0,showStats:!0,account:D.account}),((Ie=D.lastStatus)==null?void 0:Ie.id)&&e("div",{class:"last-post",children:e(ge,{class:"status-link",to:`/${c}/s/${D.lastStatus.id}`,children:e(Ye,{status:D.lastStatus,size:"s",readOnly:!0})})}),e(rl,{request:D})]}),e(ll,{request:D,onChange:()=>{se(!0)}})]},D.id)})}):e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})})]})})})}),X&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e(cn,{notification:X})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:b,onChange:D=>{f(D.target.checked)}})," ",e(h,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(h,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:ee})]}),Le&&e("p",{class:"ui-state insignificant",children:u==="default"?s({id:"KS7iJH"}):e(U,{children:"…"})}),r.notifications.length?e(Mn.Provider,{value:"notifications",children:r.notifications.filter(D=>D.type!=="follow_request").map(D=>{if(b&&D.type!=="mention")return null;const ae=new Date(D.createdAt),Ie=ae.toDateString()!==ze.toDateString();Ie&&(ze=ae);const Se=ae.toDateString()===De.toDateString()?s({id:"y/0uwd"}):ct(ze,{hideTime:!0}),Pe=ct(ze,{forceOpts:{weekday:"long"}});return e(U,{children:[Ie&&e("h2",{class:"timeline-header",children:[e("span",{children:Se})," ",e("small",{class:"insignificant bidi-isolate",children:Pe})]}),e(cn,{instance:c,notification:D},D._ids||D.id)]},D._ids||D.id)})}):e(U,{children:[u==="loading"&&e(U,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((D,ae)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(T,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"███████████ ████"})})]}))})}),u==="error"&&e("p",{class:"ui-state",children:[e(h,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>se(!0),children:e(h,{id:"KDw4GX"})})]})]}),y&&e(_t,{onChange:D=>{D&&se()},children:e("button",{type:"button",class:"plain block",disabled:u==="loading",onClick:()=>se(),style:{marginBlockEnd:"6em"},children:u==="loading"?e(Ue,{abrupt:!0}):e(h,{id:"uXRAkV"})})})]}),te&&J&&e(He,{onClick:D=>{D.target===D.currentTarget&&G(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>G(!1),children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:D=>{D.preventDefault();const{forNotFollowing:ae,forNotFollowers:Ie,forNewAccounts:Se,forPrivateMentions:Pe,forLimitedAccounts:je}=D.target,$={...z,forNotFollowing:ae.value,forNotFollowers:Ie.value,forNewAccounts:Se.value,forPrivateMentions:Pe.value,forLimitedAccounts:je.value};ue($),G(!1),(async()=>{try{await o.v2.notifications.policy.update($),pe(s({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(h,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:nl.map(D=>{const ae=z[D];return e("div",{children:e("label",{children:[i(il[D]),e("select",{name:D,defaultValue:ae,class:"small",children:[e("option",{value:"accept",children:e(h,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(h,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(h,{id:"gbbkE7"})})]})]})},D)})}),e("p",{children:e("button",{type:"submit",children:e(h,{id:"tfDRzk"})})})]})})]})})]})}function ol(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function cl({announcement:n}){const{instance:i}=ce(),{contact:s}=ms(),o=s==null?void 0:s.account,{id:c,content:r,startsAt:u,endsAt:d,published:l,allDay:a,publishedAt:p,updatedAt:y,read:m,mentions:b,statuses:f,tags:g,emojis:v,reactions:w}=n,C=new Date(p),S=ct(C),k=new Date(y),A=ct(k);return e("div",{class:"announcement-block",children:[e(ft,{account:o}),e("div",{class:"announcement-content",onClick:_s({mentions:b,instance:i}),dangerouslySetInnerHTML:{__html:Wn(r,{emojis:v})}}),e("p",{class:"insignificant",children:[e("time",{datetime:C.toISOString(),children:ct(C)}),y&&A!==S&&e(U,{children:[" ","•"," ",e("span",{class:"ib",children:e(h,{id:"TbFrLc",values:{0:ct(k)},components:{0:e("time",{datetime:k.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:w.map(_=>{const{name:I,count:R,me:L,staticUrl:B,url:P}=_;return e("button",{type:"button",class:`plain4 small ${L?"reacted":""}`,children:[P||B?e("img",{src:P||B,alt:I,width:"16",height:"16"}):e("span",{children:I})," ",e("span",{class:"count",children:Je(R)})]})})})]})}function al(n){const{masto:i}=ce();return i.v1.notifications.list({accountID:n})}function rl({request:n}){var y;const{instance:i}=ce(),[s,o]=E("loading"),{account:c,lastStatus:r}=n,[u,d]=E(!1),[l,a]=E([]);function p(){d(!1)}return ie(()=>{var m;(m=n==null?void 0:n.account)!=null&&m.id&&u&&(o("loading"),(async()=>{const b=await al(n.account.id);a(b||[]),o("default")})())},[u,(y=n==null?void 0:n.account)==null?void 0:y.id]),e(U,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{d(!0)},children:[e(T,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(h,{id:"H0wUNM",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(T,{icon:"chevron-down"})]}),u&&e(He,{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(T,{icon:"x",alt:t`Close`})}),e("header",{children:e("b",{children:e(h,{id:"MXOmPt",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):l.map(m=>e("div",{class:"notification-peek",onClick:b=>{const{target:f}=b;(b.target.tagName==="BUTTON"||b.target.tagName==="A")&&p()},children:e(cn,{instance:i,notification:m,isStatic:!0})}))})]})})]})}function ll({request:n,onChange:i}){const{_:s}=de(),{masto:o}=ce(),[c,r]=E("default"),[u,d]=E(null),l=u!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||l,onClick:()=>{r("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).accept(),d("accept"),r("default"),i({request:n,state:"accept"}),pe(s({id:"ZtBMwU",values:{0:n.account.username}}))}catch{r("error"),pe(s({id:"S92JKG"}))}})()},children:e(h,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:c==="loading"||l,class:"light danger",onClick:()=>{r("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).dismiss(),d("dismiss"),r("default"),i({request:n,state:"dismiss"}),pe(s({id:"ibBDry",values:{0:n.account.username}}))}catch{r("error"),pe(s({id:"S5aemF"}))}})()},children:e(h,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:c==="loading"?e(Ue,{abrupt:!0}):u==="accept"?e(T,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"notification-accepted"}):u==="dismiss"&&e(T,{icon:"x-circle",alt:s({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const ao=dt(sl),dl=20;function ii({local:n,columnMode:i,...s}){const{_:o}=de(),c=Ve(x),r=!!n,u=i?{}:Lt(),{masto:d,instance:l}=ce({instance:(s==null?void 0:s.instance)||u.instance}),{masto:a,instance:p}=ce(),y=o(r?{id:"u96B/B",values:{instance:l}}:{id:"PgVqvd",values:{instance:l}});tt(y,r?"/:instance?/p/l":"/:instance?/p");const m=Y(),b=Y();async function f(v){if(v||!b.current){const S={limit:dl,local:r||void 0};!r&&et("@pixelfed/global-feed")&&(S.remote=!0),b.current=d.v1.timelines.public.list(S)}const w=await b.current.next();let{value:C}=w;return C!=null&&C.length&&(v&&(m.current=C[0].id),C.forEach(S=>{Qe(S,l)})),{...w,value:C}}async function g(){var v;try{const w=await d.v1.timelines.public.list({limit:1,local:r,since_id:m.current}).next();let{value:C}=w;const S=((v=C[0])==null?void 0:v.id)===m.current;return C!=null&&C.length&&!S?(C=Ot(C,"public"),!0):!1}catch{return!1}}return e(Tt,{title:y,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:o(r?{id:"pJQgQV"}:{id:"cg0I+x"})}),e("div",{children:l})]}),id:"public",instance:l,emptyText:o({id:"BiZJ6G"}),errorText:o({id:"scd9lw"}),fetchItems:f,checkForUpdates:g,useItemID:!0,headerStart:e(U,{}),boostsCarousel:c.settings.boostsCarousel,filterContext:"public",headerEnd:e(lt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[e(ve,{href:r?`/#/${l}/p`:`/#/${l}/p/l`,children:r?e(U,{children:[e(T,{icon:"transfer"})," ",e("span",{children:e(h,{id:"dXMiUw"})})]}):e(U,{children:[e(T,{icon:"transfer"})," ",e("span",{children:e(h,{id:"t2B/we"})})]})}),e(Ge,{}),e(ve,{onClick:()=>{let v=prompt(o({id:"2MQ2cd"}));if(!/\./.test(v)){v&&alert(o({id:"7WddtO"}));return}v&&(v=v.toLowerCase().trim(),location.hash=r?`/${v}/p/l`:`/${v}/p`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),p!==l&&e(ve,{onClick:()=>{location.hash=r?`/${p}/p/l`:`/${p}/p`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:p},components:{0:e("b",{})}})})]})]})},l+r)}const fn=5,Gn=40,ul=new URLSearchParams,pn={block:"nearest",inline:"center",behavior:"smooth"};function ro({columnMode:n,...i}){const{_:s}=de(),o=n?{}:Lt(),{masto:c,instance:r,authenticated:u}=ce({instance:o.instance}),[d,l]=E("default"),[a]=n?[ul]:yt(),p=Y(),y=(i==null?void 0:i.query)||a.get("q"),m=n?"statuses":(i==null?void 0:i.type)||a.get("type");let b=s({id:"A1taO8"});if(y)switch(m){case"statuses":b=s({id:"6YeoAt",values:{q:y}});break;case"accounts":b=s({id:"fpgumQ",values:{q:y}});break;case"hashtags":b=s({id:"AuiMZZ",values:{q:y}});break;default:b=s({id:"wr3GZI",values:{q:y}})}tt(b,"/search");const[f,g]=E(!1),v=Y(0);ie(()=>{v.current=0},[y,m]);const w=Y();kt(()=>{var M,F;(F=(M=w.current)==null?void 0:M.scrollTo)==null||F.call(M,0,0)},[y,m]);const[C,S]=E([]),[k,A]=E([]),[_,I]=E([]);ie(()=>{S([]),A([]),I([])},[y]);const R={statuses:C,accounts:k,hashtags:_},L={statuses:S,accounts:A,hashtags:I},[B,P]=E({}),q=async M=>{if(!(M!=null&&M.length))return;const F=await ui(M,B);F&&P({...B,...F})};function Q(M){M&&(v.current=0),!(!M&&!u)&&(l("loading"),M&&!m&&(S(C.slice(0,fn)),A(k.slice(0,fn)),I(_.slice(0,fn))),(async()=>{var V,re,H,se,be,we;const F={q:y,resolve:u,limit:fn};m&&(F.limit=Gn,F.type=m,u&&(F.offset=v.current));try{const W=await c.v2.search.fetch(F);if(m)if(M){L[m](W[m]);const le=(V=W[m])==null?void 0:V.length;v.current=Gn,g(!!le)}else if(((H=(re=W[m])==null?void 0:re[0])==null?void 0:H.id)===((be=(se=R[m])==null?void 0:se[0])==null?void 0:be.id))g(!1);else{L[m](Ee=>[...Ee,...W[m]]);const le=(we=W[m])==null?void 0:we.length;v.current=v.current+Gn,g(!!le)}else S(W.statuses||[]),A(W.accounts||[]),I(W.hashtags||[]),v.current=0,g(!1);q(W.accounts),l("default")}catch{l("error")}})())}const te=Y();jt(M=>{var V;const F=((V=w.current)==null?void 0:V.scrollTop)===0;if(M&&F){const re=Date.now()-te.current;!te.current||re>1e3*3?Q(!0):te.current=Date.now()}}),ie(()=>{var F,V;let M;return(V=(F=p.current)==null?void 0:F.setValue)==null||V.call(F,y||""),y?Q(!0):M=setTimeout(()=>{var re,H;(H=(re=p.current)==null?void 0:re.focus)==null||H.call(re)},150),()=>clearTimeout(M)},[y,m,r]),Fe(["Slash","/"],M=>{var F,V,re,H;(V=(F=p.current)==null?void 0:F.focus)==null||V.call(F),(H=(re=p.current)==null?void 0:re.select)==null||H.call(re)},{useKey:!0,preventDefault:!0});const J=".timeline > li > a, .hashtag-list > li > a",G=Fe("j",()=>{const M=document.activeElement.closest(J),F=M==null?void 0:M.getBoundingClientRect(),V=Array.from(w.current.querySelectorAll(J));if(M&&F.top<w.current.clientHeight&&F.bottom>0){const re=V.indexOf(M);let H=V[re+1];H&&(H.focus(),H.scrollIntoView(pn))}else{const re=V.find(H=>{const se=H.getBoundingClientRect();return se.top>=44&&se.left>=0});re&&(re.focus(),re.scrollIntoView(pn))}},{useKey:!0}),z=Fe("k",()=>{const M=document.activeElement.closest(J),F=M==null?void 0:M.getBoundingClientRect(),V=Array.from(w.current.querySelectorAll(J));if(M&&F.top<w.current.clientHeight&&F.bottom>0){const re=V.indexOf(M);let H=V[re-1];H&&(H.focus(),H.scrollIntoView(pn))}else{const re=V.find(H=>{const se=H.getBoundingClientRect();return se.top>=44&&se.left>=0});re&&(re.focus(),re.scrollIntoView(pn))}},{useKey:!0}),[ue]=bi();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:M=>{w.current=M,G.current=M,z.current=M},children:e("div",{class:"timeline-deck deck",children:[e("header",{class:d==="loading"?"loading":"",children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:e(Mt,{})}),e(Gs,{ref:p}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{Q(!0)},disabled:d==="loading",children:e(T,{icon:"search",size:"l",alt:s({id:"A1taO8"})})})})]})}),e("main",{children:[!!y&&!n&&e("div",{ref:ue,class:`filter-bar ${d==="loading"?"loading":""}`,children:[!!m&&e(ge,{to:`/search${y?`?q=${encodeURIComponent(y)}`:""}`,children:[e(T,{icon:"chevron-left"})," ",e(h,{id:"N40H+G"})]}),[{label:s({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(y)}&type=accounts`},{label:s({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(y)}&type=hashtags`},{label:s({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(y)}&type=statuses`}].sort((M,F)=>M.type===m?-1:F.type===m?1:0).map(M=>e(ge,{to:M.to,children:M.label},M.type))]}),y?e(U,{children:[(!m||m==="accounts")&&e(U,{children:[m!=="accounts"&&e("h2",{class:"timeline-header",children:[e(h,{id:"bPwFdf"})," ",e(ge,{to:`/search?q=${encodeURIComponent(y)}&type=accounts`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),k.length>0?e(U,{children:[e("ul",{class:"timeline flat accounts-list",children:k.map(M=>e("li",{children:e(ft,{account:M,instance:r,showStats:!0,relationship:B[M.id]})},M.id))}),m!=="accounts"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(y)}&type=accounts`,children:[e(h,{id:"BMmtZ8"})," ",e(T,{icon:"arrow-right"})]})})]}):!m&&(d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"YYB61U"})}))]}),(!m||m==="hashtags")&&e(U,{children:[m!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(h,{id:"VwUsHI"})," ",e(ge,{to:`/search?q=${encodeURIComponent(y)}&type=hashtags`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),_.length>0?e(U,{children:[e("ul",{class:"link-list hashtag-list",children:_.map(M=>{var H;const{name:F,history:V}=M,re=(H=V==null?void 0:V.reduce)==null?void 0:H.call(V,(se,be)=>se+ +be.uses,0);return e("li",{children:e(ge,{to:r?`/${r}/t/${F}`:`/t/${F}`,children:[e(T,{icon:"hashtag",alt:"#"}),e("span",{children:F}),!!re&&e("span",{class:"count",children:Je(re)})]})},`${F}-${re}`)})}),m!=="hashtags"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(y)}&type=hashtags`,children:[e(h,{id:"Nc/W5J"})," ",e(T,{icon:"arrow-right"})]})})]}):!m&&(d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"4MFM3P"})}))]}),(!m||m==="statuses")&&e(U,{children:[m!=="statuses"&&e("h2",{class:"timeline-header",children:[e(h,{id:"+owNNn"})," ",e(ge,{to:`/search?q=${encodeURIComponent(y)}&type=statuses`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),C.length>0?e(U,{children:[e("ul",{class:"timeline",children:C.map(M=>e("li",{children:e(ge,{class:"status-link",to:r?`/${r}/s/${M.id}`:`/s/${M.id}`,children:e(Ye,{status:M})})},M.id))}),m!=="statuses"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(y)}&type=statuses`,children:[e(h,{id:"LYCgej"})," ",e(T,{icon:"arrow-right"})]})})]}):!m&&(d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"Hzi9AA"})}))]}),!!m&&(d==="default"?f?e(_t,{onChange:M=>{M&&Q()},children:e("button",{type:"button",class:"plain block",onClick:()=>Q(),style:{marginBlockEnd:"6em"},children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}):d==="loading"&&e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}))]}):d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"fGn1Hk"})})]})]})})}const hl=20,lo=10*60*1e3,fl=bt(n=>n.v1.trends.links.list().next(),{maxAge:lo}),pl=bt(n=>n.v1.trends.tags.list().next(),{maxAge:lo});function ml(n){return et("@pixelfed/trending")?n.pixelfed.v2.discover.posts.trending.list({range:"daily"}):n.v1.trends.statuses.list({limit:hl})}function gl(n,i){return n.v1.timelines.link.list(i)}function uo({columnMode:n,...i}){const{_:s}=de(),o=Ve(x),c=n?{}:Lt(),{masto:r,instance:u}=ce({instance:(i==null?void 0:i.instance)||c.instance}),{masto:d,instance:l}=ce(),a=s({id:"cI3UEs",values:{instance:u}});tt(a,"/:instance?/trending");const p=Y(),y=u===l,[m,b]=E([]),[f,g]=E([]),v=Y();async function w(te){var z;if(te||!v.current){if(v.current=ml(r),et("@mastodon/trending-hashtags"))try{const{value:ue}=await pl(r);ue!=null&&ue.length&&b(ue)}catch{}if(et("@mastodon/trending-links"))try{const{value:ue}=await fl(r,u),M=(z=ue==null?void 0:ue.filter)==null?void 0:z.call(ue,F=>F.type==="link");M!=null&&M.length&&g(M)}catch{}}const J=await v.current.next();let{value:G}=J;return G!=null&&G.length&&(te&&(p.current=G[0].id),G.forEach(ue=>{Qe(ue,u)})),{...J,value:G}}const[C,S]=E(!1),k=Y(),[A,_]=E(null),I=!!A,R=Y(),L=y&&et("@mastodon/trending-link-posts");ie(()=>{A&&R.current&&R.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[A]);const B=Y();async function P(te){(te||!k.current)&&(S(!0),k.current=gl(r,{url:A})),B.current=A;const J=await k.current.next();let{value:G}=J;return G!=null&&G.length&&(G=Ot(G,"public"),G.forEach(z=>{Qe(z,u)})),B.current===A&&S(!1),{...J,value:G}}async function q(){try{const te=await r.v1.trends.statuses.list({limit:1}).next();let{value:J}=te;return J=Ot(J,"public"),J!=null&&J.length&&J[0].id!==p.current?(p.current=J[0].id,!0):!1}catch{return!1}}const Q=Ce(()=>e(U,{children:[!!m.length&&e("div",{class:"filter-bar expandable",children:[e(T,{icon:"chart",class:"insignificant",size:"l"}),m.map((te,J)=>{const{name:G,history:z}=te,ue=z.reduce((M,F)=>M+ +F.uses,0);return e(ge,{to:`/${u}/t/${G}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),G]}),e("span",{class:"filter-count",children:Je(ue)})]},G)})]}),!!f.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(h,{id:"9veeTb"})})}),f.map(te=>{var X,ke;const{authors:J,authorName:G,authorUrl:z,blurhash:ue,description:M,height:F,image:V,imageDescription:re,language:H,providerName:se,providerUrl:be,publishedAt:we,title:W,url:le,width:Ee}=te,$e=(ke=(X=J==null?void 0:J[0])==null?void 0:X.account)!=null&&ke.id?J[0].account:null,De=W.length<30,ze=!!(G||$e),Le=xs(le);let Ae;if(ue){const Ne=hi(ue),ne=Ci(Ne);Ae=Si([.6,ne[1],ne[2]])}return e("div",{children:[e("a",{ref:A===le?R:null,href:le,target:"_blank",rel:"noopener",class:`link-block ${I?A===le?"active":"inactive":""}`,style:Ae?{"--accent-color":`rgb(${Ae.join(",")})`,"--accent-alpha-color":`rgba(${Ae.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:V,alt:re,width:Ee,height:F,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:Le})," ",!!we&&e(U,{children:"· "}),!!we&&e(U,{children:e(It,{datetime:we,format:"micro"})})]}),!!W&&e("h1",{class:"title",lang:H,dir:"auto",title:W,children:W})]}),!!M&&e("p",{class:`description ${ze&&!De?"":"more-lines"}`,lang:H,dir:"auto",title:M,children:M}),ze&&e(U,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(h,{id:"aavdrC",values:{0:$e?e(gt,{account:$e,showAvatar:!0}):z?e("a",{href:z,target:"_blank",rel:"noopener",children:G}):G}})})})]})]})]})}),L&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{_(le)},disabled:le===A,children:[e(T,{icon:"comment2"})," ",e("span",{children:e(h,{id:"/bZzdR"})})," ",e(T,{icon:"chevron-down"})]})]},le)})]}),L&&!!f.length&&e("div",{class:`timeline-header-block ${I?"blended":""}`,children:I?e(U,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:C?e(Ue,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{_(null)},children:e(T,{icon:"x",alt:s({id:"9Q/4xJ"})})})}),e("p",{children:e(h,{id:"BATCqf",values:{0:A.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(h,{id:"Vosm4k"})})})]}),[m,f,A,C]);return e(Tt,{title:a,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(h,{id:"4/iCqx"})}),e("div",{children:u})]}),id:"trending",instance:u,emptyText:s({id:"6HA9+s"}),errorText:s({id:"scd9lw"}),fetchItems:I?P:w,checkForUpdates:I?void 0:q,checkForUpdatesInterval:5*60*1e3,useItemID:!0,headerStart:e(U,{}),boostsCarousel:o.settings.boostsCarousel,filterContext:"public",timelineStart:Q,refresh:A,clearWhenRefresh:!0,view:I?"link-mentions":void 0,headerEnd:e(lt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[e(ve,{onClick:()=>{let te=prompt(s({id:"2MQ2cd"}));if(!/\./.test(te)){te&&alert(s({id:"7WddtO"}));return}te&&(te=te.toLowerCase().trim(),location.hash=`/${te}/trending`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),l!==u&&e(ve,{onClick:()=>{location.hash=`/${l}/trending`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:l},components:{0:e("b",{})}})})]})]})},u)}const ss={block:"nearest",inline:"nearest",behavior:"smooth"};function bl(){const{_:n}=de();tt(n({id:"i0qMbr"}),"/");const i=Ve(x),{shortcuts:s}=i,o=s.map(c=>{if(!c)return null;const{type:r,...u}=c,d={following:Ii,notifications:ao,list:eo,public:ii,bookmarks:Ws,favourites:Xs,hashtag:Qs,mentions:so,trending:uo,search:ro}[r];return!d||r==="search"&&!u.query||r==="list"&&!u.id?null:e(d,{...u,columnMode:!0},r+JSON.stringify(u))});return Fe(["1","2","3","4","5","6","7","8","9"],(c,r)=>{try{const u=parseInt(r.keys[0],10)-1,d=document.querySelectorAll("#columns > *")[u];d&&(d.focus(),d.scrollIntoView(ss))}catch{}}),Fe(["[","]"],(c,r)=>{const u=r.keys[0],d=document.activeElement.closest("#columns > *"),l=Dt(),a=l?"]":"[",p=l?"[":"]";let y;u===a?y=d?d.previousElementSibling:document.querySelectorAll("#columns > *")[0]:u===p&&(y=d?d.nextElementSibling:document.querySelectorAll("#columns > *")[1]),y&&(y.focus(),y.scrollIntoView(ss))},{useKey:!0}),e("div",{id:"columns",onContextMenu:c=>{c.target.closest(".deck > header")&&!c.target.closest("a")&&!c.target.closest("button")&&(c.preventDefault(),x.showShortcutsSettings=!0)},onFocus:()=>{const c=document.activeElement.closest("#columns > *");c&&document.querySelectorAll("#columns > *").forEach(r=>{r.classList.toggle("focus",r===c)})},children:o})}function yl(){var s;const{_:n}=de(),i=Ve(x);return __BENCHMARK.end("time-to-home"),ie(()=>{(async()=>{const o=await mt.drafts.keys();if(o.length){const c=_n();o.filter(u=>u.startsWith(c)).length&&(x.showDrafts=!0)}})()},[]),e(U,{children:(i.settings.shortcutsViewMode==="multi-column"||!i.settings.shortcutsViewMode&&i.settings.shortcutsColumnsMode)&&((s=i.shortcuts)!=null&&s.length)?e(bl,{}):e(Ii,{title:n({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(vl,{})})})}function vl(){const{_:n}=de(),i=Ve(x),s=Y(),[o,c]=E(void 0);return e(U,{children:[e(ge,{ref:s,to:"/notifications",class:`button plain notifications-button ${i.notificationsShowNew?"has-badge":""} ${o||""}`,onClick:r=>{r.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(r.preventDefault(),c(u=>u?void 0:"open"))},children:e(T,{icon:"notification",size:"l",alt:n({id:"iDNBZe"})})}),e(kl,{state:o,anchorRef:s,onClose:()=>c(void 0)})]})}const wl=5;function kl({anchorRef:n,state:i,onClose:s}){const{masto:o,instance:c}=ce(),r=Ve(x),[u,d]=E("default"),l=ni();async function a(){const g=await l.next(),v=io(g.value);if(v!=null&&v.length){v.forEach(C=>{Qe(C.status,c,{skipThreading:!0})});const w=co(v);x.notificationsLast=w[0],x.notifications=w,o.v1.markers.create({notifications:{lastReadId:w[0].id}}).catch(()=>{})}return x.notificationsShowNew=!1,x.notificationsLastFetchTime=Date.now(),g}const[p,y]=E(!1);function m(){return o.v1.followRequests.list({limit:1})}function b(){d("loading"),(async()=>{try{await a();const g=await m();y(!!(g!=null&&g.length)),d("default")}catch{d("error")}})()}ie(()=>{i==="open"&&b()},[i]);const f=Y();return e(di,{ref:f,menuClassName:"notifications-menu",state:i,anchorRef:n,onClose:s,portal:{target:document.body},containerProps:{onClick:()=>{var g,v;(v=(g=f.current)==null?void 0:g.closeMenu)==null||v.call(g)}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(h,{id:"iDNBZe"})})}),e(Mn.Provider,{value:"notifications",children:e("main",{children:r.notifications.length?e(U,{children:r.notifications.slice(0,wl).map(g=>e(cn,{instance:c,notification:g,disableContextMenu:!0},g._ids||g.id))}):u==="loading"?e("div",{class:"ui-state",children:e(Ue,{abrupt:!0})}):u==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(h,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:b,children:e(h,{id:"KDw4GX"})})})]})})}),e("footer",{children:[e(ge,{to:"/mentions",class:"button plain",children:[e(T,{icon:"at"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(ge,{to:"/notifications",class:"button plain2",children:[p?e(h,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(h,{id:"gukqfD"})})," ",e(T,{icon:"arrow-right"})]})]})]})}const Sl=dt(yl),Cl=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function ho(n){const i=URL.parse(n);if(!i)return{};const{hostname:s,pathname:o}=i;for(const c of Cl){const[,r]=o.match(c)||[];if(r)return{instance:s,id:r}}return{}}function _l(n){const{instance:i,id:s}=ho(n);return i&&s?`/${i}/s/${s}`:null}function Il(){const i=Zt().pathname.replace(/^\//,""),s=ho(i),o=s!=null&&s.instance?`/${s.instance}/s/${s.id}`:null,[c,r]=E("loading");return kt(()=>{r("loading"),(async()=>{try{const{instance:u,id:d}=s;if(d){const{masto:l}=ce({instance:u});if(await l.v1.statuses.$select(d).fetch()){window.location.hash=o+"?view=full";return}}}catch{}{const{masto:u,instance:d}=ce(),l=await u.v2.search.fetch({q:i,limit:1,resolve:!0});if(l.statuses.length){const a=l.statuses[0];window.location.hash=`/${d}/s/${a.id}?view=full`}else if(l.accounts.length){const a=l.accounts[0];window.location.hash=`/${d}/a/${a.id}`}else o?window.location.hash=o+"?view=full":r("error")}})()},[o]),e("div",{class:"ui-state",tabIndex:"-1",children:[c==="loading"?e(U,{children:[e(Ue,{abrupt:!0}),e("h2",{children:e(h,{id:"RTAr/z"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}):e(U,{children:[e("h2",{children:e(h,{id:"ufzZSJ"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}),e("hr",{}),e("p",{children:e(ge,{to:"/",children:e(h,{id:"iWpEwy"})})})]})}function Tl(){const{_:n}=de();tt(n({id:"h16FyT"}),"/l");const[i,s]=E("default"),[o,c]=Et(a=>a+1,0),[r,u]=E([]);ie(()=>{s("loading"),(async()=>{try{const a=await ei();u(a),s("default")}catch{s("error")}})()},[o]);const[d,l]=E(!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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l"})})]}),e("h1",{children:e(h,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>l(!0),children:e(T,{icon:"plus",size:"l",alt:n({id:"Sb2gYF"})})})})]})}),e("main",{children:r.length>0?e(U,{children:[e("ul",{class:"link-list",children:r.map(a=>e("li",{children:e(ge,{to:`/l/${a.id}`,children:e("span",{children:[e(T,{icon:"list"})," ",e("span",{children:a.title})]})})}))}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"8prZNK",values:{0:r.length}})})})]}):i==="loading"?e("p",{class:"ui-state",children:e(Ue,{})}):i==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"IvPikw"})})})]}),d&&e(He,{onClick:a=>{a.target===a.currentTarget&&l(!1)},children:e(ki,{list:d==null?void 0:d.list,onClose:a=>{a.state==="success"&&c(),l(!1)}})})]})}const Al=""+new URL("instances-LA7224ZB.json",import.meta.url).href;function xl(n){return("0"+n.toString(16)).slice(-2)}function Rl(){var n=new Uint32Array(28);return window.crypto.getRandomValues(n),Array.from(n,xl).join("")}function El(n){const s=new TextEncoder().encode(n);return window.crypto.subtle.digest("SHA-256",s)}function Ll(n){let i="";const s=new Uint8Array(n),o=s.byteLength;for(var c=0;c<o;c++)i+=String.fromCharCode(s[c]);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function fo(n){const i=await El(n);return Ll(i)}async function Ml({instanceURL:n}){var i;if(!n)return!1;try{const s=await fetch(`https://${n}/.well-known/oauth-authorization-server`);return!s.ok||s.status!==200?!1:!!((i=(await s.json()).code_challenge_methods_supported)!=null&&i.includes("S256"))}catch{return!1}}window.__generateCodeChallenge=fo;const $l={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_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{DEV:Nl,PHANPY_CLIENT_NAME:Pl,PHANPY_WEBSITE:En}=$l,Ti="read write follow push",Dl=En?En.toLowerCase().includes(location.hostname):!1,Ol=location.origin+location.pathname,Dn=Nl||!Dl?Ol:En;async function zl({instanceURL:n}){const i=new URLSearchParams({client_name:Pl,redirect_uris:Dn,scopes:Ti,website:En});return await(await fetch(`https://${n}/api/v1/apps`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json()}async function Ul({instanceURL:n,client_id:i}){const s=Rl(),o=await fo(s),c=new URLSearchParams({client_id:i,code_challenge_method:"S256",code_challenge:o,redirect_uri:Dn,response_type:"code",scope:Ti});return[`https://${n}/oauth/authorize?${c.toString()}`,s]}async function Bl({instanceURL:n,client_id:i}){const s=new URLSearchParams({client_id:i,scope:Ti,redirect_uri:Dn,response_type:"code"});return`https://${n}/oauth/authorize?${s.toString()}`}async function Fl({instanceURL:n,client_id:i,client_secret:s,code:o,code_verifier:c}){const r=new URLSearchParams({client_id:i,redirect_uri:Dn,grant_type:"authorization_code",code:o});return s&&r.append("client_secret",s),c&&r.append("code_verifier",c),await(await fetch(`https://${n}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()})).json()}const Hl={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_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:ql}=Hl;function Yl(){var S,k;const{_:n}=de();tt(n({id:"sQia9P"}),"/login");const i=Y(),s=ye.local.get("instanceURL"),[o,c]=E("default"),[r]=yt(),u=r.get("instance"),d=r.get("submit"),[l,a]=E(u||(s==null?void 0:s.toLowerCase())||""),[p,y]=E([]),m=Y();ie(()=>{(async()=>{try{const _=await(await fetch(Al)).json();y(_),m.current=new Wo(_)}catch{}})()},[]);const b=A=>{A&&(async()=>{try{const I=await(await fetch(`https://${A}/.well-known/host-meta`)).text(),P=new DOMParser().parseFromString(I,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),q=URL.parse(P),{host:Q}=q;A!==Q&&(A=Q)}catch{}ye.local.set("instanceURL",A),c("loading");try{const{client_id:_,client_secret:I,vapid_key:R}=await zl({instanceURL:A});if(await Ml({instanceURL:A}))if(_&&I){ye.sessionCookie.set("clientID",_),ye.sessionCookie.set("clientSecret",I),ye.sessionCookie.set("vapidKey",R);const[B,P]=await Ul({instanceURL:A,client_id:_});ye.sessionCookie.set("codeVerifier",P),location.href=B}else alert(n({id:"ZP1FIA"}));else _&&I?(ye.sessionCookie.set("clientID",_),ye.sessionCookie.set("clientSecret",I),ye.sessionCookie.set("vapidKey",R),location.href=await Bl({instanceURL:A,client_id:_})):alert(n({id:"ZP1FIA"}));c("default")}catch{c("error")}})()},f=l?l.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,g=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(f)&&!/[\s\/\\@]/.test(f),v=f?(k=(S=m.current)==null?void 0:S.search(f,{limit:10}))==null?void 0:k.map(A=>A.item):[],w=g?f:v!=null&&v.length?v[0]:l?p.find(A=>A.includes(l)):null,C=A=>{A.preventDefault(),b(w)};return d&&ie(()=>{b(u||w)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:C,children:[e("h1",{children:[e("img",{src:yi,alt:"",width:"80",height:"80"}),e("br",{}),e(h,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(h,{id:"kyAi7k"})}),e("input",{value:l,required:!0,type:"text",class:"large",id:"instanceURL",ref:i,disabled:o==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:n({id:"u3gOdY"}),onInput:A=>{a(A.target.value)},dir:"auto"}),(v==null?void 0:v.length)>0?e("ul",{id:"instances-suggestions",children:v.map((A,_)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{b(A)},children:A})}))}):e("div",{id:"instances-eg",children:e(h,{id:"/OvbEC"})})]}),o==="error"&&e("p",{class:"error",children:e(h,{id:"rmBHZn"})}),e("div",{children:[e("button",{disabled:o==="loading"||!l||!w,children:n(w?{id:"2xahsi",values:{selectedInstanceText:w}}:{id:"xGVfLh"})})," "]}),e(Ue,{hidden:o!=="loading"}),e("hr",{}),!ql&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(h,{id:"LcOiWS"})})}),e("p",{children:e(ge,{to:"/",children:e(h,{id:"iWpEwy"})})}),e(vi,{})]})})}const jl=40;function Vl(){const{_:n}=de(),i=Ve(x);tt(n({id:"+GkIdc"}),"/sp");const{masto:s}=ce(),[o,c]=E([]),[r,u]=E("default"),[d,l]=Et(y=>y+1,0),[a,p]=E(!1);return ie(l,[i.reloadScheduledPosts]),ie(()=>{u("loading"),(async()=>{try{const y=s.v1.scheduledStatuses.list({limit:jl}),m=[];let b;do b=(await y.next()).value,b!=null&&b.length&&m.push(...b);while(b!=null&&b.length);c(m)}catch{u("error")}finally{u("default")}})()},[d]),e("div",{id:"scheduled-posts-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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"+GkIdc"})}),e("div",{class:"header-side",children:e(lt,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:n({id:"2FYpfJ"})})}),children:e(ve,{onClick:()=>{l()},children:[e(T,{icon:"refresh",size:"l"}),e("span",{children:e(h,{id:"lCF0wC"})})]})})})]})}),e("main",{children:[o.length?e("ul",{class:"posts-list",children:o.map(y=>{const{id:m,params:b,scheduledAt:f,mediaAttachments:g}=y,{inReplyToId:v,language:w,poll:C,sensitive:S,spoilerText:k,text:A,visibility:_}=b,I={id:m,inReplyToId:v,language:w,mediaAttachments:g,poll:C?{...C,expiresAt:new Date(Date.now()+C.expiresIn*1e3),options:C.options.map(R=>({title:R,votesCount:0}))}:void 0,sensitive:S,spoilerText:k,text:A,visibility:_,content:`<p>${A}</p>`};return e("li",{children:e(Kl,{status:I,scheduledAt:f,onClick:()=>{p({post:I,scheduledAt:new Date(f)})}})},m)})}):e("p",{class:"ui-state",children:r==="loading"?e(Ue,{}):n({id:"mZYb1f"})}),a&&e(He,{onClick:y=>{y.target===y.currentTarget&&p(!1)},children:e(Gl,{post:a.post,scheduledAt:a.scheduledAt,onClose:()=>p(!1)})})]})]})})}function Kl({status:n,scheduledAt:i,onClick:s}){const o=Ce(()=>{const c=(new Date(i).getTime()-Date.now())/36e5;return c<24?"time":c<720?"day":"month"},[i]);return e("button",{type:"button",class:"textual block",onClick:s,children:[e("div",{class:`post-schedule-meta post-schedule-${o}`,children:[e(T,{icon:o,class:"insignificant"})," ",e("span",{children:e(h,{id:"aEp6lO",values:{0:ct(i,{formatOpts:{weekday:"short",second:"numeric"}})},components:{0:e("b",{}),1:e(It,{datetime:i}),2:e("small",{})}})})]}),e(Ye,{status:n,size:"s",previewMode:!0,readOnly:!0})]})}function Gl({post:n,scheduledAt:i,onClose:s}){const{masto:o}=ce(),{_:c}=de(),[r,u]=E("default"),[d,l]=E(),a=d&&d.getTime()!==i.getTime(),p=Xo(),y=i&&i<=Date.now(),{inReplyToId:m}=n,[b,f]=E(null);return e("div",{id:"scheduled-post-sheet",class:"sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",size:"l",alt:c({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(h,{id:"orjBLU",components:{0:e("b",{}),1:e(It,{datetime:i})}}),e("br",{}),e("small",{children:ct(i,{formatOpts:{weekday:"short",second:"numeric"}})})]})}),e("main",{tabIndex:"-1",children:[!!b&&e("div",{class:"status-reply",children:e(Ye,{status:b,size:"s",previewMode:!0,readOnly:!0})}),e(Ye,{status:n,size:"s",previewMode:!0,readOnly:!0,onMediaClick:(g,v,w,C)=>{g.preventDefault(),x.showMediaModal={mediaAttachments:n.mediaAttachments,mediaIndex:v}}}),e("form",{onSubmit:g=>{g.preventDefault(),u("loading"),(async()=>{try{await o.v1.scheduledStatuses.$select(n.id).update({scheduledAt:d.toISOString()}),pe(c({id:"40naR1"})),s(),u("default"),x.reloadScheduledPosts++}catch{u("error"),pe(c({id:"ZM3jAs"}))}})()},children:e("footer",{children:[e("div",{class:"row",children:e("span",{children:[e(Jo,{scheduledAt:i,setScheduledAt:g=>{l(g)}})," ",e("small",{class:"ib",children:p})]})}),e("div",{class:"row",children:[e("button",{disabled:!a||r==="loading"||y,children:e(h,{id:"QqW27M"})}),e("span",{class:"grow"}),e(ht,{align:"end",menuItemClassName:"danger",confirmLabel:c({id:"09u3Kk"}),onClick:()=>{u("loading"),(async()=>{try{await ce().masto.v1.scheduledStatuses.$select(n.id).remove(),pe(c({id:"/zL/Mq"})),s(),u("default"),x.reloadScheduledPosts++}catch{u("error"),pe(c({id:"aOh6Md"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:r==="loading"||y,children:e(h,{id:"Jb6/SB"})})})]})]})})]})]})}const Zl={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_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:os}=Zl,mn=40,Wl=10,Xl=5;let si={},wn={},kn={};function Sn(n){delete wn[n],delete kn[n]}const Jt={block:"nearest",inline:"center",behavior:"smooth"},cs=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",as=/\/s\//i;function Jl(n){var A;const{_:i}=de(),{id:s}=n,{masto:o,instance:c}=ce({instance:n.instance}),r=Ve(x),[u,d]=yt(),l=u.get("media"),a=u.get("media-only"),p=parseInt(l||a,10);let y=p>0;const m=u.get("mediaStatusID"),b=vs(m,c);m&&!b&&(y=!1);const f=y&&!!a,g=rt(s,c),[v,w]=E(x.statuses[g]);ie(()=>{x.statuses[g]&&w(x.statuses[g])},[g]);const C=Ce(()=>{const{prevLocation:_}=x,I=((_==null?void 0:_.pathname)||"")+((_==null?void 0:_.search)||""),R=nn("/:instance/s/:id",I)||nn("/s/:id",I);return!I||R?"/":I},[]);ie(()=>{!v&&y&&(async()=>{try{const _=await o.v1.statuses.$select(s).fetch();Qe(_,c),w(_)}catch{alert("Unable to load post."),location.hash=C}})()},[y]);const S=m?(A=r.statuses[rt(m,c)])==null?void 0:A.mediaAttachments:v==null?void 0:v.mediaAttachments,k=ot(()=>{!window.matchMedia("(min-width: calc(40em + 350px))").matches&&r.prevLocation?history.back():f?location.hash=C:(u.delete("media"),u.delete("mediaStatusID"),d(u))},[f,C,r.prevLocation]);return ie(()=>{let _=setTimeout(()=>{const I=document.querySelector(".carousel");I&&I.focus()},100);return()=>clearTimeout(_)},[f]),ie(()=>{const _=document.querySelectorAll(".deck-container");return _.forEach(I=>{I.setAttribute("inert","")}),()=>{_.forEach(I=>{I.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[y?S!=null&&S.length?e(Vs,{mediaAttachments:S,statusID:m||s,instance:c,lang:v==null?void 0:v.language,index:p-1,onClose:k}):e("div",{class:"media-modal-container loading",children:e(Ue,{abrupt:!0})}):e(ge,{to:C}),!f&&e(ed,{id:s,instance:n.instance,closeLink:C})]})}function Ql(n){const{linkable:i,to:s,onClick:o,...c}=n;return i?e(ge,{class:"status-link",to:s,onClick:o,...c}):e("div",{class:"status-focus",tabIndex:0,...c})}function rs(n,i){return new Date(i.created_at)-new Date(n.created_at)}function ed({id:n,closeLink:i="/",instance:s}){var oe,xe;const{_:o}=de(),[c,r]=yt(),u=c.get("media"),d=c.get("mediaStatusID"),l=parseInt(u,10)>0,a=Y(!x.prevLocation&&(history.length===1||"navigation"in window&&((xe=(oe=navigation==null?void 0:navigation.entries)==null?void 0:oe.call(navigation))==null?void 0:xe.length)===1)),[p,y]=E(c.get("view")||a.current?"full":null),m=!!parseInt(c.get("translate")),{masto:b,instance:f}=ce({instance:s}),{masto:g,instance:v,authenticated:w}=ce(),C=f===v,S=Ve(x),[k,A]=E([]),[_,I]=E("default"),R=Y(),L=rt(n,f),B=Y(0),P=Y();ie(()=>{var O;(O=P.current)==null||O.focus()},[]),ie(()=>{var ee;const O=Ls(()=>{if(!P.current)return;const{scrollTop:fe}=P.current;_!=="loading"&&(kn[n]=fe)},50);return(ee=P.current)==null||ee.addEventListener("scroll",O,{passive:!0}),O(),()=>{var fe;O.cancel(),(fe=P.current)==null||fe.removeEventListener("scroll",O)}},[n,_!=="loading"]);const q=Y(),Q=Y(),te=({reloadHero:O}={})=>{I("loading");let ee;const fe=wn[n];if(fe){const D=fe.filter(ae=>x.statuses[L]);A(D)}else A([{id:n}]);return(async()=>{var Pe,je;const D=()=>Mi(()=>b.v1.statuses.$select(n).fetch(),{retries:4}),ae=Mi(()=>b.v1.statuses.$select(n).context.fetch(),{retries:8}),Ie=!!S.statuses[L];let Se=S.statuses[L];if(!(Ie&&!O))try{Se=await D(),Qe(Se,f),await new Promise($=>{setTimeout($,100)})}catch{I("error");return}try{let $=function(me,Me){const We=Me+1;return We>_e&&(_e=Me),me==null?void 0:me.map(nt=>({id:nt.id,account:nt.account,repliesCount:nt.repliesCount,content:nt.content,weight:tn(nt),level:We,replies:$(nt.__replies,We)}))};const N=await ae,{ancestors:Z,descendants:j}=N;Z.sort(rs),j.sort(rs),B.current=(j==null?void 0:j.length)||0;const K=new Set;Z.forEach(me=>{Qe(me,f,{skipThreading:!0}),me.inReplyToId&&!Z.find(Me=>Me.id===me.inReplyToId)&&K.add(me.inReplyToId)});const Oe=Z.every(me=>me.account.id===Se.account.id),Te=[];j.forEach(me=>{if(Qe(me,f,{skipThreading:!0}),me.inReplyToId&&!j.find(Me=>Me.id===me.inReplyToId)&&me.inReplyToId!==Se.id&&K.add(me.inReplyToId),me.inReplyToAccountId===me.account.id)Te.push(me);else if(me.inReplyToId===Se.id)Te.push(me);else if(!me.inReplyToAccountId&&Te.find(Me=>Me.id===me.inReplyToId&&Me.account.id===Se.account.id)&&me.account.id===Se.account.id)Te.push(me);else{const Me=j.find(We=>We.id===me.inReplyToId);Me&&(Me.__replies||(Me.__replies=[]),Me.__replies.push(me))}}),Te.sort((me,Me)=>{const We=Se.account.id;return me.account.id===We&&Me.account.id!==We?-1:Me.account.id===We&&me.account.id!==We?1:0}),K.size;let _e=1;const Be=[...Z.map(me=>({id:me.id,ancestor:!0,isThread:Oe,accountID:me.account.id,account:me.account,repliesCount:me.repliesCount,weight:tn(me)})),{id:n,accountID:Se.account.id,weight:tn(Se)},...Te.map(me=>({id:me.id,account:me.account,accountID:me.account.id,descendant:!0,thread:me.account.id===Se.account.id,weight:tn(me),level:1,replies:$(me.__replies,1)}))];I("default"),q.current={offsetTop:(Pe=R.current)==null?void 0:Pe.offsetTop,scrollTop:(je=P.current)==null?void 0:je.scrollTop};const Ze=Z.length||0;Ze>=re&&H(Ze+1),A(Be),wn[n]=Be,xo(Se,f)}catch{I("error")}})(),Q.current=Date.now(),()=>{clearTimeout(ee)}};ie(te,[n,b]);const[J,G]=E(!1);ie(()=>{let O=setInterval(()=>{const ee=Date.now();Q.current&&ee-Q.current>=6e4&&G(!0)},6e4);return()=>{clearInterval(O)}},[]),kt(()=>{var ee,fe;if(!k.length)return;const O=kn[n];if(O)P.current.scrollTop=O;else if(q.current){const D={offsetTop:(ee=R.current)==null?void 0:ee.offsetTop,scrollTop:(fe=P.current)==null?void 0:fe.scrollTop},ae=D.offsetTop-q.current.offsetTop+D.scrollTop;P.current.scrollTop=ae}else k.length===1&&(P.current.scrollTop=0);q.current=null},[k]),ie(()=>{S.reloadStatusPage<=0||(async()=>{try{const{instanceURL:O}=ci(),ee=`https://${O}/api/v1/statuses/${n}/context`;return await(await caches.open("api")).delete(ee,{ignoreVary:!0}),te({reloadHero:!0})}catch{}})()},[S.reloadStatusPage]),ie(()=>()=>{kn={},x.reloadStatusPage=0,wn={},si={},oi.clear()},[]);const z=S.statuses[L]||S.statuses[n],ue=Ce(()=>{if(!z)return"";const{account:O}=z,ee=document.createElement("div");return ee.innerHTML=O.displayName,ee.innerText.trim()},[z]),M=Ce(()=>{if(!z)return"";let O=Ln(z);return O.length>64&&(O=O.slice(0,64)+"…"),O},[z]);tt(ue&&M?`${ue}: "${M}"`:o({id:"post.title"}),"/:instance?/s/:id");const F=Ce(()=>{var ee;if(!z)return;const{url:O}=z;if(O)return(ee=URL.parse(O))==null?void 0:ee.hostname},[z]),V=Ce(()=>{if(F)return F===f},[F,f]),[re,H]=E(mn),se=Ce(()=>k.length-re,[k.length,re]),be=k.some(O=>O.descendant),we=k.filter(O=>O.ancestor),[W,le]=E(!0),Ee=Ce(()=>{if(!R.current||W)return null;const{top:O}=R.current.getBoundingClientRect();return O>0?"down":"up"},[W]);Fe("esc",()=>{location.hash=i},{enabled:!l,ignoreEventWhen:O=>!!document.querySelector("#modal-container > *")}),Fe("backspace",()=>{location.hash=i}),Fe("j",()=>{const O=document.activeElement.closest(".status-link, .status-focus"),ee=O==null?void 0:O.getBoundingClientRect(),fe=Array.from(P.current.querySelectorAll(cs));if(O&&ee.top<P.current.clientHeight&&ee.bottom>0){const D=fe.indexOf(O);let ae=fe[D+1];ae&&(ae.focus(),ae.scrollIntoView(Jt))}else{const D=fe.find(ae=>{const Ie=ae.getBoundingClientRect();return Ie.top>=44&&Ie.left>=0});D&&(D.focus(),D.scrollIntoView(Jt))}},{useKey:!0}),Fe("k",()=>{const O=document.activeElement.closest(".status-link, .status-focus"),ee=O==null?void 0:O.getBoundingClientRect(),fe=Array.from(P.current.querySelectorAll(cs));if(O&&ee.top<P.current.clientHeight&&ee.bottom>0){const D=fe.indexOf(O);let ae=fe[D-1];ae&&(ae.focus(),ae.scrollIntoView(Jt))}else{const D=fe.find(ae=>{const Ie=ae.getBoundingClientRect();return Ie.top>=44&&Ie.left>=0});D&&(D.focus(),D.scrollIntoView(Jt))}},{useKey:!0}),Fe("x",()=>{const O=document.activeElement.closest(".status-link, .status-focus");if(O){const ee=O.nextElementSibling;ee&&ee.tagName.toLowerCase()==="details"&&(ee.open=!ee.open)}},{useKey:!0});const[$e,De]=E(!1),ze=Y(l?"media+status":"status"),Le=ot((O,ee,fe,D)=>{O.preventDefault(),O.stopPropagation(),r({media:ee+1,mediaStatusID:D.id})},[n]),Ae=ot((O,ee)=>{Sn(ee.id)},[]);ie(()=>{let O;return d&&l&&(O=setTimeout(()=>{var fe;const ee=(fe=P.current)==null?void 0:fe.querySelector(`.status-link[href*="/${d}"]`);ee&&ee.scrollIntoView(Jt)},400)),()=>{clearTimeout(O)}},[d,l]);const X=ot((O,ee)=>{const{id:fe,ancestor:D,isThread:ae,descendant:Ie,thread:Se,replies:Pe,repliesCount:je,weight:$,level:N}=O,Z=fe===n;return e("li",{ref:Z?R:null,class:`${D?"ancestor":""} ${Ie?"descendant":""} ${Se?"thread":""} ${Z?"hero":""}`,children:[Z?e(U,{children:[e(_t,{threshold:.1,onChange:K=>{queueMicrotask(()=>{requestAnimationFrame(()=>{le(K)})})},class:"status-focus",tabIndex:0,children:e(Ye,{statusID:fe,instance:f,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:m})}),_!=="loading"&&!w?e("div",{class:"post-status-banner",children:[e("p",{children:e(h,{id:"Vyeh4F"})}),e(ge,{to:os?`/login?instance=${os}&submit=1`:"/login",class:"button",children:e(h,{id:"sQia9P"})})]}):!C&&e("div",{class:"post-status-banner",children:[e("p",{children:e(h,{id:"j5roNG",values:{instance:f},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:_==="loading",onClick:()=>{I("loading"),(async()=>{try{const K=await g.v2.search.fetch({q:z.url,type:"statuses",resolve:!0,limit:1});if(K.statuses.length){const Oe=K.statuses[0];location.hash=v?`/${v}/s/${Oe.id}`:`/s/${Oe.id}`}else throw new Error("No results")}catch(K){I("default"),alert(o({id:"DnepCE",values:{e:K}}))}})()},children:[e(T,{icon:"transfer"})," ",e(h,{id:"ejAVrO"})]})]})]}):e(Ql,{linkable:ae||D,to:f?`/${f}/s/${fe}`:`/s/${fe}`,onClick:()=>{Sn(fe)},children:[ee===0&&D?e(_t,{threshold:.5,onChange:K=>{queueMicrotask(()=>{requestAnimationFrame(()=>{De(K)})})},children:e(Ye,{statusID:fe,instance:f,withinContext:!0,size:Se||D?"m":"s",enableTranslate:!0,onMediaClick:Le,onStatusLinkClick:Ae})}):e(Ye,{statusID:fe,instance:f,withinContext:!0,size:Se||D?"m":"s",enableTranslate:!0,onMediaClick:Le,onStatusLinkClick:Ae,showActionsBar:!!Ie}),D&&je>1&&e("div",{class:"replies-link",children:[e(T,{icon:"comment2",alt:o({id:"N8UzTV"})})," ",e("span",{title:je,children:Je(je)})]})," "]}),Ie&&(Pe==null?void 0:Pe.length)>0&&e(po,{instance:f,replies:Pe,hasParentThread:Se,level:N,accWeight:$,openAll:B.current<Wl,parentLink:{to:f?`/${f}/s/${fe}`:`/s/${fe}`,onClick:()=>Sn(fe)}}),_==="loading"&&Z&&!!(z!=null&&z.repliesCount)&&!be&&e("div",{class:"status-loading",children:e(Ue,{abrupt:z.repliesCount>=3})}),_==="error"&&Z&&!!(z!=null&&z.repliesCount)&&!be&&e("div",{class:"status-error",children:[e(h,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{x.reloadStatusPage++},children:e(h,{id:"KDw4GX"})})]})]},fe)},[n,f,_,w,C,m,Le,Ae,be]),ke=Ce(()=>{var O;if("navigation"in window&&(navigation!=null&&navigation.entries)){const ee=navigation.entries()[navigation.currentEntry.index-1];if(ee!=null&&ee.url)return as.test(ee.url)}return as.test((O=x.prevLocation)==null?void 0:O.pathname)},[L]),Ne=Ce(()=>{if(!se)return[];const O=[];function ee(fe){O.push(fe.id),fe.replies&&fe.replies.forEach(ee)}return k.slice(re).forEach(ee),O.map(fe=>rt(fe,f))},[se,k,re,f]),ne=Ce(()=>k.slice(0,re).map(X),[k,re,X]);return ie(()=>{let O=setTimeout(()=>{if(!R.current)return;const ee=R.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");ee&&ee.click()},1e3);return()=>clearTimeout(O)},[n]),e("div",{tabIndex:"-1",ref:P,class:`status-deck deck contained ${k.length>1?"padded-bottom":""} ${ze.current==="status"&&!a.current?"slide-in":""} ${p?`deck-view-${p}`:""}`,onAnimationEnd:O=>{ze.current==="status"&&(ze.current=null)},children:[e("header",{class:`${_==="loading"?"loading":""}`,onDblClick:O=>{x.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[ke&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(T,{icon:"chevron-left",size:"xl",alt:o({id:"iH8pgl"})})}),!W&&z&&_!=="loading"?e(U,{children:[e("span",{class:"hero-heading",children:[e(gt,{account:z.account,instance:f,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["•"," ",e(It,{datetime:z.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:O=>{O.preventDefault(),O.stopPropagation(),R.current.scrollIntoView({behavior:"smooth",block:"start"})},title:o({id:"NCy+Nw"}),children:e(T,{icon:Ee==="down"?"arrow-down":"arrow-up"})})]}):e(U,{children:[e(h,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:O=>{O.preventDefault(),O.stopPropagation(),P.current.scrollTo({top:0,behavior:"smooth"})},hidden:!we.length||$e,title:o({id:"R8CUl0",values:{0:we.length}}),children:[e(T,{icon:"arrow-up"}),we.filter((O,ee,fe)=>fe.findIndex(D=>D.accountID===O.accountID)===ee).slice(0,3).map(O=>e(pt,{url:O.account.avatar,alt:O.account.displayName},O.account.id)),we.length>3&&e(U,{children:[" ",e("span",{class:"insignificant",children:Je(we.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:p==="full"?"":"none"},onClick:()=>{y(null),c.delete("media"),c.delete("media-only"),c.delete("view"),r(c)},title:o({id:"+/xYEI"}),children:e(T,{icon:"layout4",size:"l"})}),J&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{x.reloadStatusPage++,G(!1)},children:e(T,{icon:"refresh",size:"l",alt:o({id:"lCF0wC"})})}),e(lt,{align:"end",portal:{target:P.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(T,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(ve,{disabled:_==="loading",onClick:()=>{x.reloadStatusPage++},children:[e(T,{icon:"refresh"}),e("span",{children:e(h,{id:"lCF0wC"})})]}),e(ve,{className:"menu-switch-view",onClick:()=>{y(p==="full"?null:"full"),c.delete("media"),c.delete("media-only"),p==="full"?c.delete("view"):c.set("view","full"),r(c)},children:[e(T,{icon:{"":"layout5",full:"layout4"}[p||""]}),e("span",{children:o(p==="full"?{id:"+/xYEI"}:{id:"2LiWsE"})})]}),e(ve,{onClick:()=>{Array.from(P.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(ee=>{ee.click()})},children:[e(T,{icon:"eye-open"})," ",e("span",{children:e(h,{id:"8r8KmB"})})]}),e(Ge,{}),e(Es,{className:"plain",children:e(h,{id:"Rsjgm0"})}),e(ve,{disabled:!F||V,onClick:()=>{const O=_l(z.url);O?location.hash=O:alert(o({id:"9J6biQ"}))},children:[e(T,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:o(F?{id:"Kp9SAs",values:{0:rn.toUnicode(F)}}:{id:"lb07+k"})})]})]}),e(ge,{class:"button plain deck-close",to:i,children:e(T,{icon:"x",size:"xl",alt:o({id:"yz7wBu"})})})]})]})}),k.length&&z?e("ul",{class:`timeline flat contextual grow ${_==="loading"?"loading":""}`,children:[ne,se>0&&e("li",{class:"descendant descendant-more",children:e("button",{type:"button",class:"plain block show-more",disabled:_==="loading",onClick:()=>H(O=>O+mn),style:{marginBlockEnd:"6em"},"data-state-post-ids":Ne.join(" "),children:[e("div",{class:"ib avatars-bunch",children:k.slice(re,re+5).map(O=>e(pt,{url:O.account.avatarStatic},O.id))})," ",e("div",{class:"ib",children:[e(h,{id:"uXRAkV"})," ",e("span",{class:"tag",children:se>mn?`${mn}+`:se})]})]})})]}):e(U,{children:[_==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(Ye,{skeleton:!0,size:"l"})})}),_==="error"&&e("p",{class:"ui-state",children:[e(h,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{x.reloadStatusPage++},children:e(h,{id:"KDw4GX"})})]})]})]})}function po({replies:n,instance:i,hasParentThread:s,level:o,accWeight:c,openAll:r,parentLink:u}){const{_:d}=de(),[l,a]=yt(),p=I=>I.reduce((R,L)=>{const{repliesCount:B,replies:P}=L,q=(P==null?void 0:P.length)||B;return R+q+p(P||[])},0),y=n.length+p(n),m=n.length===y,b=n.map(I=>I.account).filter((I,R,L)=>L.findIndex(B=>B.id===I.id)===R).slice(0,3),f=Ce(()=>n==null?void 0:n.reduce((I,R)=>I+(R==null?void 0:R.weight),c),[c,n==null?void 0:n.length]);let g=!1;(r||f<=Xl||!s&&y===1&&tn(n[0])<2)&&(g=!0);const v=si[n[0].id],w=ot((I,R,L,B)=>{I.preventDefault(),I.stopPropagation(),a({media:R+1,mediaStatusID:B.id})},[]),C=Y();kt(()=>{var R;function I(L){L.target.dataset.scrollLeft=L.target.scrollLeft}return(R=C.current)==null||R.addEventListener("scroll",I,{passive:!0}),()=>{var L;(L=C.current)==null||L.removeEventListener("scroll",I)}},[]);const[S,k]=E(v||g);ie(()=>{let I;return!v&&!g&&(I=setTimeout(()=>k(!0),100)),()=>clearTimeout(I)},[v,g]);const A=g?"div":"details",_=A==="details";return e(A,{ref:C,class:"replies",open:_?v||g:void 0,onToggle:_?I=>{const{open:R}=I.target;si[n[0].id]=R}:void 0,style:{"--comments-level":o},"data-comments-level":o,"data-comments-level-overflow":o>4,children:[!g&&e("summary",{class:"replies-summary",hidden:g,children:[e("span",{class:"avatars",children:b.map(I=>e(pt,{url:I.avatarStatic,title:`${I.displayName} @${I.username}`,squircle:I==null?void 0:I.bot},I.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(h,{id:"DOQUen",values:{0:n.length,1:Je(n.length)},components:{0:e("span",{title:n.length})}})}),!m&&y>1&&e(U,{children:[" ","·"," ",e("span",{children:e(h,{id:"qSQQSe",values:{0:Je(y),totalComments:y},components:{0:e("span",{title:y})}})})]})]}),e(T,{icon:"chevron-down",class:"replies-summary-chevron"}),!!u&&e(ge,{class:"replies-parent-link",to:u.to,onClick:u.onClick,title:d({id:"ZlV82A"}),children:"»"})]}),S&&e("ul",{children:n.map(I=>{var R,L;return e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(Ye,{statusID:I.id,instance:i,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:w,showActionsBar:!0}),!((R=I.replies)!=null&&R.length)&&I.repliesCount>0&&e("div",{class:"replies-link",children:[e(T,{icon:"comment2",alt:d({id:"N8UzTV"})})," ",e("span",{title:I.repliesCount,children:Je(I.repliesCount)})]})]}),((L=I.replies)==null?void 0:L.length)&&e(po,{instance:i,replies:I.replies,level:I.level,accWeight:g?f:I.weight,openAll:r,parentLink:{to:i?`/${i}/s/${I.id}`:`/s/${I.id}`,onClick:()=>{Sn(I.id)}}})]},I.id)})})]})}const td=140,nd=35,id=70,sd=140,oi=new Map;function tn(n){var b,f;const i=oi.get(n.id);if(i)return i;const{spoilerText:s,content:o,mediaAttachments:c,poll:r,card:u}=n,d=Rs(s+o),l=c!=null&&c.length?td:0,a=(((b=r==null?void 0:r.options)==null?void 0:b.length)||0)*nd,p=u&&(c!=null&&c.length||(f=r==null?void 0:r.options)!=null&&f.length)?0:id,m=(d+l+a+p)/sd;return oi.set(n.id,m),m}const od=dt(Jl);function cd(){const n=Lt(),{id:i,instance:s}=n;return e(od,{id:i,instance:s})}const ad=""+new URL("boosts-carousel-BiOaNdMT.jpg",import.meta.url).href,rd=""+new URL("grouped-notifications-DFgwVVj3.jpg",import.meta.url).href,ld=""+new URL("multi-column-ROck0NVt.jpg",import.meta.url).href,dd=""+new URL("multi-hashtag-timeline-DH5INVHi.jpg",import.meta.url).href,ud=""+new URL("nested-comments-thread-hv59kZLc.jpg",import.meta.url).href,hd="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",fd={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_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Qt,PHANPY_WEBSITE:ls,PHANPY_PRIVACY_POLICY_URL:pd,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:ds}=fd,us=ls?ls.replace(/https?:\/\//g,"").replace(/\/$/,""):null,hs=`${"2025-04-26T09:46:35.214Z".slice(0,10).replace(/-/g,".")}.0d0fa92`;function mo(){const{_:n}=de();return tt(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:yi,alt:"",width:"160",height:"160",style:{aspectRatio:"1/1",marginBlockEnd:-16}}),e("img",{src:hd,alt:"Phanpy",width:"200"})]}),e("p",{class:"desc",children:e(h,{id:"Ogtv0V"})}),e("p",{children:e(ge,{to:Qt?`/login?instance=${Qt}&submit=1`:"/login",class:"button",children:n(Qt?{id:"sQia9P"}:{id:"ZLoGls"})})}),Qt&&ds&&e("p",{children:e("a",{href:ds,class:"button plain5",children:e(h,{id:"e+RpCP"})})}),!Qt&&e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"fvAsUK",components:{0:e("br",{})}})})})]}),(us||hs)&&e("p",{class:"app-site-version",children:e("small",{children:[us," ",hs]})}),e("p",{children:e(h,{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:i=>{i.preventDefault(),x.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:pd,target:"_blank"})}})}),e("div",{children:e(vi,{})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:ad,alt:n({id:"S5cYrQ"}),loading:"lazy"}),e("h4",{children:e(h,{id:"Tu+sCN"})}),e("p",{children:e(h,{id:"e2uVlo"})})]}),e("section",{children:[e("img",{src:ud,alt:n({id:"CGQ27z"}),loading:"lazy"}),e("h4",{children:e(h,{id:"cYE45+"})}),e("p",{children:e(h,{id:"Pc7QKh"})})]}),e("section",{children:[e("img",{src:rd,alt:n({id:"rnrM7k"}),loading:"lazy"}),e("h4",{children:e(h,{id:"4RRMre"})}),e("p",{children:e(h,{id:"8GMtDr"})})]}),e("section",{children:[e("img",{src:ld,alt:n({id:"VLKtvP"}),loading:"lazy"}),e("h4",{children:e(h,{id:"pEkad9"})}),e("p",{children:e(h,{id:"t7Py5R"})})]}),e("section",{children:[e("img",{src:dd,alt:n({id:"wOax6E"}),loading:"lazy"}),e("h4",{children:e(h,{id:"Wi1Ov0"})}),e("p",{children:e(h,{id:"tS2i+h"})})]})]})})]})}const md=window.alert;window.__nativeAlert||(window.__nativeAlert=md);window.alert=function(n){n instanceof Error&&(n!=null&&n.message)&&(n=n.message),typeof n!="string"&&(n=JSON.stringify(n));const i=Qo({text:n,className:"alert",gravity:"top",position:"center",duration:1e4,offset:{y:48},onClick:()=>{i.hideToast()}});i.showToast()};window.__STATES__=x;window.__STATES_STATS__=()=>{const n=["statuses","accounts","spoilers","unfurledLinks","statusQuotes"],i={};n.forEach(c=>{i[c]=Object.keys(x[c]).length});const{statuses:s}=x,o=[];for(const c in s)document.querySelector(`[data-state-post-id~="${c}"], [data-state-post-ids~="${c}"]`)||o.push(c)};setInterval(()=>{if(!window.__IDLE__)return;const{statuses:n,unfurledLinks:i,notifications:s}=x;let o=0;const{instance:c}=ce();for(const r in n){if(!window.__IDLE__)break;try{const u=document.querySelector(`[data-state-post-id~="${r}"], [data-state-post-ids~="${r}"]`),d=s.some(l=>{var a;return r===rt((a=l.status)==null?void 0:a.id,c)});if(!u&&!d){delete x.statuses[r],delete x.statusQuotes[r];for(const l in i){const a=i[l];if(rt(a.id,a.instance)===r){delete x.unfurledLinks[l];break}}o++}}catch{}}},15*60*1e3);setTimeout(()=>{for(const n in Bt)setTimeout(()=>{var i,s,o,c,r,u;Array.isArray(Bt[n])?(s=(i=Bt[n])[0])==null||s.call(i):typeof Bt[n]=="object"?(c=(o=Bt[n]).module)==null||c.call(o):(u=(r=Bt)[n])==null||u.call(r)},1)},5e3);(()=>{window.__IDLE__=!0;const n=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],i=()=>{window.__IDLE__=!0},o=Ls(i,3e3),c=()=>{window.__IDLE__=!1,o()};n.forEach(r=>{window.addEventListener(r,c,{passive:!0,capture:!0})}),window.addEventListener("blur",i,{passive:!0}),document.documentElement.addEventListener("mouseleave",r=>{!r.relatedTarget&&!r.toElement&&i()},{passive:!0})})();const gd=/iPad|iPhone|iPod/.test(navigator.userAgent);gd&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const i=ye.local.get("theme");let s;if(i){if(s=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),s){const o=s.content,c=i==="light"?s.dataset.themeLightColorTemp:s.dataset.themeDarkColorTemp;s.content=c||"",setTimeout(()=>{s.content=o},10)}}else{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(s=document.querySelector(`meta[name="theme-color"][media*="${o}"]`),s){const c=s.dataset.content,r=s.dataset.contentTemp;s.content=r||"",setTimeout(()=>{s.content=c},10)}}}});{const n=ye.local.get("theme");if(n){document.documentElement.classList.add(`is-${n}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",n||"dark light");const s=document.querySelector('meta[data-theme-setting="manual"]');s&&(s.name="theme-color",s.content=n==="light"?s.dataset.themeLightColor:s.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(c=>{c.name=""})}const i=ye.local.get("textSize");i&&document.documentElement.style.setProperty("--text-size",`${i}px`)}gs(x,n=>{var i;for(const[s,o,c,r]of n){if(o.join(".")==="settings.shortcutsViewMode"){const u=document.getElementById("app");u&&(u.dataset.shortcutsViewMode=(i=x.shortcuts)!=null&&i.length?c:"")}o.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",c)}});const gn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(n){},end(n){}};function bd(){const[n,i]=E(!1),[s,o]=E("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),de(),ie(()=>{const r=ye.local.get("instanceURL"),u=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(u){window.history.replaceState({},document.title,window.location.pathname||"/");const d=ye.sessionCookie.get("clientID"),l=ye.sessionCookie.get("clientSecret"),a=ye.sessionCookie.get("vapidKey"),p=ye.sessionCookie.get("codeVerifier");(async()=>{o("loading");const{access_token:y}=await Fl({instanceURL:r,client_id:d,client_secret:l,code:u,code_verifier:p||void 0});if(y){const m=Ro({instance:r,accessToken:y});await Promise.allSettled([Un(m),Bn(m,r),Eo(m,r,y,a)]),Ri(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,i(!0),o("default")}else o("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const d=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let l;if(d&&(l=Lo(d),l&&(Cn(l.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),l||(l=ci()),l){Cn(l.info.id);const{client:a}=ce({account:l}),{instance:p}=a;Ri(),o("loading"),(async()=>{try{Mo()&&$o(p)?(Un(a),Bn(a,p)):await Promise.allSettled([Un(a),Bn(a,p)])}catch{}finally{i(!0),o("default"),__BENCHMARK.end("app-init")}})()}else o("default"),__BENCHMARK.end("app-init")}ye.sessionCookie.del("clientID"),ye.sessionCookie.del("clientSecret"),ye.sessionCookie.del("codeVerifier")},[]);let c=Zt();return x.currentLocation=c.pathname,ie(Qn,[c,n]),/\/https?:/.test(c.pathname)?e(Il,{}):s==="loading"?e(Ue,{id:"loader-root"}):e(U,{children:[e(vd,{isLoggedIn:n}),e(wd,{isLoggedIn:n}),e(ri,{children:e(Ke,{path:"/:instance?/s/:id",element:e(cd,{})})}),n&&e(sc,{}),n&&e(Za,{}),e(Ha,{}),n&&e(Va,{}),e(nc,{isLoggedIn:n}),e(Ka,{onClose:Qn}),e(oc,{})]})}function yd({isLoggedIn:n}){return n&&__BENCHMARK.end("time-to-isLoggedIn"),n?e(Sl,{}):e(mo,{})}const vd=dt(({isLoggedIn:n})=>{const i=Zt(),s=Ce(()=>{const{pathname:o}=i;return!/^\/(login|welcome)/i.test(o)},[i]);return e(ri,{location:s||i,children:[e(Ke,{path:"/",element:e(yd,{isLoggedIn:n})}),e(Ke,{path:"/login",element:e(Yl,{})}),e(Ke,{path:"/welcome",element:e(mo,{})})]})});function fs(){return x.prevLocation||null}function wd({isLoggedIn:n}){const i=Zt(),s=Y(fs());return Ce(()=>nn("/:instance/s/:id",i.pathname)||nn("/s/:id",i.pathname),[i.pathname,nn])?s.current||(s.current=fs()):s.current=null,e(ri,{location:s.current||i,children:[n&&e(U,{children:[e(Ke,{path:"/notifications",element:e(ao,{})}),e(Ke,{path:"/mentions",element:e(so,{})}),e(Ke,{path:"/following",element:e(Ii,{})}),e(Ke,{path:"/b",element:e(Ws,{})}),e(Ke,{path:"/f",element:e(Xs,{})}),e(Ke,{path:"/l",children:[e(Ke,{index:!0,element:e(Tl,{})}),e(Ke,{path:":id",element:e(eo,{})})]}),e(Ke,{path:"/fh",element:e(Br,{})}),e(Ke,{path:"/sp",element:e(Vl,{})}),e(Ke,{path:"/ft",element:e(Dr,{})}),e(Ke,{path:"/catchup",element:e(_r,{})}),e(Ke,{path:"/annual_report/:year",element:e(gr,{})})]}),e(Ke,{path:"/:instance?/t/:hashtag",element:e(Qs,{})}),e(Ke,{path:"/:instance?/a/:id",element:e(hr,{})}),e(Ke,{path:"/:instance?/p",children:[e(Ke,{index:!0,element:e(ii,{})}),e(Ke,{path:"l",element:e(ii,{local:!0})})]}),e(Ke,{path:"/:instance?/trending",element:e(uo,{})}),e(Ke,{path:"/:instance?/search",element:e(ro,{})})]})}No();Po(e(Do,{i18n:he,children:e(Oo,{children:e(bd,{})})}),document.getElementById("app"));setTimeout(()=>{try{Object.keys(localStorage).forEach(n=>{n.startsWith("iconify")&&localStorage.removeItem(n)}),Object.keys(sessionStorage).forEach(n=>{n.startsWith("iconify")&&sessionStorage.removeItem(n)}),localStorage.removeItem("settings:boostsCarousel")}catch{}},5e3);if("serviceWorker"in navigator&&typeof caches<"u"){const i=["icons"];let s=!1;const o=1e4,c=60*60*1e3;async function r(){if(window.__IDLE__)try{const u=await caches.keys();for(const d of u){if(i.includes(d))continue;const l=await caches.open(d),a=await l.keys();if(a.length>50){const p=a.slice(50);for(const y of p)await l.delete(y)}}s=!0}catch{}setTimeout(r,s?c:o)}setTimeout(r,o)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")};
//# sourceMappingURL=main-VxNg86V0.js.map