import{A as F,y as Z,M as ot,u as ce,d as E,s as x,a as ie,b as We,p as ft,c as qe,q as Qe,g as bt,e,k as D,T as u,f as li,h as Rt,i as Kt,j as In,l as Se,L as Co,C as Kn,D as _o,n as Re,o as Io,r as An,t as ri,v as Ao,w as di,x as Wt,z as fe,B as To,E as De,F as Tn,G as xn,_ as vt,H as vs,I as Bd,J as ys,K as ws,N as xo,O as Eo,P as it,Q as Ro,R as ui,S as Lo,U as mt,V as Mo,W as $o,X as hi,Y as Lt,Z as Ze,$ as ks,a0 as Ss,a1 as No,a2 as Cs,a3 as Po,a4 as Do,a5 as nn,a6 as Oo,a9 as zo,aa as Hn,ab as qn,ac as Bo,ad as $i,ae as Fo,af as Uo,ag as Ko,ah as pi,ai as je,ak as Ho,al as qo,am as jo,an as Yo}from"./useTitle-BuJm5pdu.js";import{u as fi,w as ze,s as he,o as Ni,a as Vo,V as _s,b as Is,I as C,C as mi,c as As,M as Fe,d as Ue,S as cn,e as ve,f as Pn,R as yt,n as tt,g as Be,A as ut,N as pt,h as st,i as rt,L as ge,l as xt,j as Go,k as Ts,p as qd,m as Ve,q as et,r as ln,t as lt,v as Qn,x as xs,E as Es,y as Ge,z as Pi,T as Rs,B as Dn,D as ht,F as Ke,G as St,H as Wo,J as Zo,K as Nt,O as gi,P as Ls,Q as Xo,U as qt,W as Jo,X as Qo,Y as On,Z as ea,_ as Pt,$ as ta,a0 as Ms,a1 as $s,a2 as na,a3 as bi,a4 as ia,a5 as sa,a6 as oa,a7 as aa,a8 as ca,a9 as la,aa as Di,ab as ra,ac as Bt}from"./ScheduledAtField-DOwsX15z.js";var Ns=da;function da(n,i,o){var s=null,a=null,c=function(){s&&(clearTimeout(s),a=null,s=null)},h=function(){var r=a;c(),r&&r()},d=function(){if(!i)return n.apply(this,arguments);var r=this,l=arguments,p=o&&!s;if(c(),a=function(){n.apply(r,l)},s=setTimeout(function(){if(s=null,!p){var m=a;return a=null,m()}},i),p)return a()};return d.cancel=c,d.flush=h,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 * @license MIT */(function(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(b,v){v=v||{bubbles:!1,cancelable:!1,detail:void 0};var k=i.createEvent("CustomEvent");return k.initCustomEvent(b,v.bubbles,v.cancelable,v.detail),k},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",p,!1),i.addEventListener("touchmove",m,!1),i.addEventListener("touchend",l,!1);var o=null,s=null,a=null,c=null,h=null,d=null,r=0;function l(b){if(d===b.target){var v=parseInt(f(d,"data-swipe-threshold","20"),10),k=f(d,"data-swipe-unit","px"),g=parseInt(f(d,"data-swipe-timeout","500"),10),y=Date.now()-h,S="",I=b.changedTouches||b.touches||[];if(k==="vh"&&(v=Math.round(v/100*i.documentElement.clientHeight)),k==="vw"&&(v=Math.round(v/100*i.documentElement.clientWidth)),Math.abs(a)>Math.abs(c)?Math.abs(a)>v&&y0?S="swiped-left":S="swiped-right"):Math.abs(c)>v&&y0?S="swiped-up":S="swiped-down"),S!==""){var w={dir:S.replace(/swiped-/,""),touchType:(I[0]||{}).touchType||"direct",fingers:r,xStart:parseInt(o,10),xEnd:parseInt((I[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((I[0]||{}).clientY||-1,10)};d.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:w})),d.dispatchEvent(new CustomEvent(S,{bubbles:!0,cancelable:!0,detail:w}))}o=null,s=null,h=null}}function p(b){b.target.getAttribute("data-swipe-ignore")!=="true"&&(d=b.target,h=Date.now(),o=b.touches[0].clientX,s=b.touches[0].clientY,a=0,c=0,r=b.touches.length)}function m(b){if(!(!o||!s)){var v=b.touches[0].clientX,k=b.touches[0].clientY;a=o-v,c=s-k}}function f(b,v,k){for(;b&&b!==i.documentElement;){var g=b.getAttribute(v);if(g)return g;b=b.parentNode}return k}})(window,document);function jt(n=()=>{},i=[]){const o=F(n);Z(()=>{o.current=n},[i]),Z(()=>{const s=()=>{const a=document.hidden||document.visibilityState==="hidden";o.current(!a)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const ua=1e3*3,Oi=2e4,ha=ot(function({isLoggedIn:i}){const{_:o}=ce(),[s,a]=E(!0),c=F();jt(l=>{clearTimeout(c.current),l?a(!0):c.current=setTimeout(()=>{a(!1)},Oi)});const h=async(l,p,m)=>{if(x.notificationsLast){const f=l.v1.notifications.list({limit:1,sinceId:x.notificationsLast.id}).values(),{value:b}=await f.next();if(b?.length)if(m)x.notificationsShowNew=!0;else{let v;try{v=(await l.v1.markers.fetch({timeline:"notifications"}))?.notifications?.lastReadId}catch{}v?x.notificationsShowNew=b[0].id!==v:x.notificationsShowNew=!0}}};Z(()=>{let l,p,m;if(i&&s){const{masto:f,streaming:b,instance:v}=ie();(async()=>{await h(f,v);let k=!1;b&&(p=setTimeout(()=>{(async()=>{try{k=!0,l=b.user.notification.subscribe();for await(const g of l){if(!l||!s)break;g.event==="notification"&&We(g.payload,v,{skipThreading:!0}),x.notificationsShowNew=!0}}catch{k=!1}k||(m=setInterval(()=>{h(f,v,!0)},Oi))})()},ua))})()}return()=>{l?.unsubscribe?.(),l=null,clearTimeout(p),clearInterval(m)}},[s,i]);const d=F(),r=()=>{d.current=Date.now(),fetch("./version.json").then(l=>l.json()).then(l=>{l&&(x.appVersion=l)}).catch(l=>{})};return fi(r,s&&1e3*60*30),jt(l=>{l&&(d.current?Date.now()-d.current>1e3*60*60&&r():r())}),ze("shift+alt+k",l=>{if(!l.shiftKey||!l.altKey)return;const p=x.settings.cloakMode;x.settings.cloakMode=!p,he({text:o(p?{id:"oguMwa"}:{id:"IXZLPs"})})},{useKey:!0,ignoreEventWhen:l=>l.metaKey||l.ctrlKey}),null}),pa=ft(async(n,i)=>{const o=n.v1.accounts.$select(i).statuses.list({limit:3,exclude_replies:!0,exclude_reblogs:!0}).values(),{value:s}=await o.next();return s||[]},{maxAge:6e4});function fa(){const{_:n}=ce(),i=qe(x),{masto:o}=ie(),[s,a]=E(!1),[c,h]=E([]),[d,r]=E(!1),l=F(null),p=F(null),m=i.settings.shortcutsViewMode==="multi-column";function f(g){if(g.key&&g.key.toLowerCase()!=="c")return;if(i.composerState.minimized){x.composerState.minimized=!1,Ni();return}const y=document.querySelectorAll("data.compose-data"),S=!m&&y.length===1?JSON.parse(y[0].value):void 0;g.shiftKey?Vo(S)||(x.showCompose=S||!0):(Ni(),x.showCompose=S||!0)}ze("c, shift+c",f,{useKey:!0,ignoreEventWhen:g=>!!document.querySelector("#modal-container > *")||g.metaKey||g.ctrlKey||g.altKey});const b=_s(()=>{a(!0)},{threshold:600}),v=Qe(async()=>{try{r(!0);const g=bt();if(!g)return;const y=await pa(o,g);h(y)}catch{}finally{r(!1)}},[o]),k=Qe(g=>{Is({replyToStatus:g}),a(!1)},[]);return Z(()=>{s&&v()},[v,s]),e(D,{children:[e("button",{ref:l,type:"button",id:"compose-button",onClick:f,onContextMenu:g=>{g.preventDefault(),a(!0)},...b(),class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(C,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})}),e(mi,{ref:p,state:s?"open":void 0,anchorRef:l,onClose:()=>a(!1),direction:"top",gap:8,unmountOnClose:!0,portal:{target:document.body},boundingBoxPadding:As(),containerProps:{style:{zIndex:19},onClick:()=>{p.current?.closeMenu?.()}},submenuOpenDelay:600,children:[e(Fe,{to:"/sp",children:[e(C,{icon:"schedule"})," ",e("span",{children:e(u,{id:"+GkIdc"})})]}),e(Ue,{}),e(cn,{align:"end",direction:"top",shift:-8,disabled:d||c.length===0,label:e(D,{children:[e(C,{icon:"comment"})," ",e("span",{className:"menu-grow",children:e(u,{id:"LwOr4P"})}),d?"โ€ฆ":e(C,{icon:"chevron-right"})]}),children:c.length>0&&c.map(g=>{const y=new Date(g.createdAt),S=new Date().getTime()-y.getTime()<864e5;return e(ve,{onClick:()=>k(g),children:e("small",{children:[e("div",{class:"menu-post-text",children:Pn(g)}),e("span",{className:"more-insignificant",children:[S&&e(D,{children:[e(yt,{datetime:y,format:"micro"})," ","โ€’"," "]}),e("time",{className:"created",dateTime:y.toISOString(),title:y.toLocaleString(),children:tt(g.createdAt)})]})]})},g.id)})})]})]})}const ma=ot(function(){const{_:i}=ce(),o=qe(x);function s(){x.showKeyboardShortcutsHelp=!1}return ze("?",()=>{x.showKeyboardShortcutsHelp=!0},{useKey:!0,ignoreEventWhen:a=>/\/catchup/i.test(location.hash)||a.metaKey||a.ctrlKey||a.altKey}),!!o.showKeyboardShortcutsHelp&&e(Be,{onClose:s,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(C,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{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(u,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"S5ez7Y"}),keys:e(u,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:i({id:"jsFF8C"}),keys:e(u,{id:"80sOCm",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:e(u,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:i({id:"jAj8rv"}),keys:e(u,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"duF1lx"}),keys:e(u,{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(u,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"1pKapz"}),keys:e(u,{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(u,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"cqi4Mx"}),keys:e(u,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"kulphB"}),keys:e(u,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:i({id:"C7ujRh"}),keys:e(u,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})}].map(({action:a,className:c,keys:h})=>e("tr",{children:[e("th",{class:c,children:a}),e("td",{children:h})]},a))})})})]})})}),Ps=new Set,nt=new WeakMap,Yt=new WeakMap,Dt=new WeakMap,ei=new WeakMap,ga=new WeakMap,Vt=new WeakMap,En=new WeakMap,en=new WeakSet;let Et,vi=0,yi=0;const wt="__aa_tgt",sn="__aa_del",Rn="__aa_new",ba=n=>{const i=Ca(n);i&&i.forEach(o=>_a(o))},va=n=>{n.forEach(i=>{i.target===Et&&wa(),nt.has(i.target)&&zt(i.target)})};function ya(n){const i=ei.get(n);i?.disconnect();let o=nt.get(n),s=0;const a=5;o||(o=Gt(n),nt.set(n,o));const{offsetWidth:c,offsetHeight:h}=Et,r=[o.top-a,c-(o.left+a+o.width),h-(o.top+a+o.height),o.left-a].map(p=>`${-1*Math.floor(p)}px`).join(" "),l=new IntersectionObserver(()=>{++s>1&&zt(n)},{root:Et,threshold:1,rootMargin:r});l.observe(n),ei.set(n,l)}function zt(n){clearTimeout(En.get(n));const i=zn(n),o=on(i)?500:i.duration;En.set(n,setTimeout(async()=>{const s=Dt.get(n);try{await s?.finished,nt.set(n,Gt(n)),ya(n)}catch{}},o))}function wa(){clearTimeout(En.get(Et)),En.set(Et,setTimeout(()=>{Ps.forEach(n=>Bs(n,i=>Ds(()=>zt(i))))},100))}function ka(n){setTimeout(()=>{ga.set(n,setInterval(()=>Ds(zt.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function Ds(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let ti,Ht;const Sa=typeof window<"u"&&"ResizeObserver"in window;Sa&&(Et=document.documentElement,ti=new MutationObserver(ba),Ht=new ResizeObserver(va),window.addEventListener("scroll",()=>{yi=window.scrollY,vi=window.scrollX}),Ht.observe(Et));function Ca(n){return n.reduce((s,a)=>[...s,...Array.from(a.addedNodes),...Array.from(a.removedNodes)],[]).every(s=>s.nodeName==="#comment")?!1:n.reduce((s,a)=>{if(s===!1)return!1;if(a.target instanceof Element){if(jn(a.target),!s.has(a.target)){s.add(a.target);for(let c=0;co(n,Vt.has(n)));for(let o=0;oa(s,Vt.has(s)))}}function ki(n){return Array.isArray(n)?n:[n]}function on(n){return typeof n=="function"}function Aa(n){const i=nt.get(n),o=Gt(n);if(!wi(n))return nt.set(n,o);let s;if(!i)return;const a=zn(n);if(typeof a!="function"){const c=i.left-o.left,h=i.top-o.top,[d,r,l,p]=Os(n,i,o),m={transform:`translate(${c}px, ${h}px)`},f={transform:"translate(0, 0)"};d!==r&&(m.width=`${d}px`,f.width=`${r}px`),l!==p&&(m.height=`${l}px`,f.height=`${p}px`),s=n.animate([m,f],{duration:a.duration,easing:a.easing})}else{const[c]=ki(a(n,"remain",i,o));s=new Animation(c),s.play()}Dt.set(n,s),nt.set(n,o),s.addEventListener("finish",zt.bind(null,n))}function zi(n){Rn in n&&delete n[Rn];const i=Gt(n);nt.set(n,i);const o=zn(n);if(!wi(n))return;let s;if(typeof o!="function")s=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:o.duration*1.5,easing:"ease-in"});else{const[a]=ki(o(n,"add",i));s=new Animation(a),s.play()}Dt.set(n,s),s.addEventListener("finish",zt.bind(null,n))}function Bi(n,i){var o;n.remove(),nt.delete(n),Yt.delete(n),Dt.delete(n),(o=ei.get(n))===null||o===void 0||o.disconnect(),setTimeout(()=>{if(sn in n&&delete n[sn],Object.defineProperty(n,Rn,{value:!0,configurable:!0}),i&&n instanceof HTMLElement)for(const s in i)n.style[s]=""},0)}function Ta(n){var i;if(!Yt.has(n)||!nt.has(n))return;const[o,s]=Yt.get(n);Object.defineProperty(n,sn,{value:!0,configurable:!0});const a=window.scrollX,c=window.scrollY;if(s&&s.parentNode&&s.parentNode instanceof Element?s.parentNode.insertBefore(n,s):o&&o.parentNode?o.parentNode.appendChild(n):(i=zs(n))===null||i===void 0||i.appendChild(n),!wi(n))return Bi(n);const[h,d,r,l]=Ea(n),p=zn(n),m=nt.get(n);(a!==vi||c!==yi)&&xa(n,a,c,p);let f,b={position:"absolute",top:`${h}px`,left:`${d}px`,width:`${r}px`,height:`${l}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!on(p))Object.assign(n.style,b),f=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:p.duration,easing:"ease-out"});else{const[v,k]=ki(p(n,"remove",m));k?.styleReset!==!1&&(b=k?.styleReset||b,Object.assign(n.style,b)),f=new Animation(v),f.play()}Dt.set(n,f),f.addEventListener("finish",Bi.bind(null,n,b))}function xa(n,i,o,s){const a=vi-i,c=yi-o,h=document.documentElement.style.scrollBehavior;if(getComputedStyle(Et).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+a,window.scrollY+c),!n.parentElement)return;const r=n.parentElement;let l=r.clientHeight,p=r.clientWidth;const m=performance.now();function f(){requestAnimationFrame(()=>{if(!on(s)){const b=l-r.clientHeight,v=p-r.clientWidth;m+s.duration>performance.now()?(window.scrollTo({left:window.scrollX-v,top:window.scrollY-b}),l=r.clientHeight,p=r.clientWidth,f()):document.documentElement.style.scrollBehavior=h}})}f()}function Ea(n){const i=nt.get(n),[o,,s]=Os(n,i,Gt(n));let a=n.parentElement;for(;a&&(getComputedStyle(a).position==="static"||a instanceof HTMLBodyElement);)a=a.parentElement;a||(a=document.body);const c=getComputedStyle(a),h=nt.get(a)||Gt(a),d=Math.round(i.top-h.top)-gt(c.borderTopWidth),r=Math.round(i.left-h.left)-gt(c.borderLeftWidth);return[d,r,o,s]}function Fs(n,i={}){return ti&&Ht&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!on(i)&&!i.disrespectUserMotionPreference||(en.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),Bs(n,zt,ka,a=>Ht?.observe(a)),on(i)?Vt.set(n,i):Vt.set(n,{duration:250,easing:"ease-in-out",...i}),ti.observe(n,{childList:!0}),Ps.add(n))),Object.freeze({parent:n,enable:()=>{en.add(n)},disable:()=>{en.delete(n)},isEnabled:()=>en.has(n)})}function Si(n){const i=F(null),[o,s]=E(),a=c=>{o&&(c?o.enable():o.disable())};return Z(()=>{i.current instanceof HTMLElement&&s(Fs(i.current,n||{}))},[]),[i,a]}function Ra(n){return("0"+n.toString(16)).slice(-2)}function La(){var n=new Uint32Array(28);return window.crypto.getRandomValues(n),Array.from(n,Ra).join("")}function Ma(n){const o=new TextEncoder().encode(n);return window.crypto.subtle.digest("SHA-256",o)}function $a(n){let i="";const o=new Uint8Array(n),s=o.byteLength;for(var a=0;a1,[h,d]=Rt(l=>l+1,0),[r]=Si();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(C,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(u,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:r,children:s.map((l,p)=>{const m=l.info.id===a,f=p===0;return e("li",{children:[e("div",{children:[c&&e("span",{class:`current ${m?"is-current":""}`,children:e(C,{icon:"check-circle",alt:i({id:"Hp1l6f"})})}),e(ut,{url:l.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(m)try{const b=await o.v1.accounts.$select(l.info.id).fetch();l.info=b,Kt(s),d()}catch{}}}),e(pt,{account:c?{...l.info,acct:/@/.test(l.info.acct)?l.info.acct:`${l.info.acct}@${l.instanceURL}`}:l.info,showAcct:!0,onClick:()=>{m?x.showAccount=`${l.info.username}@${l.instanceURL}`:(In(l.info.id),location.reload())}})]}),e("div",{class:"actions",children:[f&&c&&e(D,{children:[e("span",{class:"tag",children:e(u,{id:"ovBPCi"})})," "]}),e(st,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(C,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[c&&e(D,{children:[e(ve,{disabled:m,onClick:()=>{In(l.info.id),location.reload()},children:[e(C,{icon:"transfer"})," ",e(u,{id:"3t/Nrv"})]}),!ja&&!m&&e(Fe,{href:`./?account=${l.info.id}`,target:"_blank",children:[e(C,{icon:"external"}),e("span",{children:e(u,{id:"PZgZtY"})})]}),e(Ue,{})]}),e(ve,{onClick:()=>{x.showAccount=`${l.info.username}@${l.instanceURL}`},children:[e(C,{icon:"user"}),e("span",{children:e(u,{id:"40z2Fm"})})]}),e(Ue,{}),c&&e(D,{children:[e(ve,{disabled:f,onClick:()=>{s.splice(p,1),s.unshift(l),Kt(s),d()},children:[e(C,{icon:"check-circle"}),e("span",{children:e(u,{id:"PPcets"})})]}),e(ve,{disabled:p<=1,onClick:()=>{s.splice(p,1),s.splice(p-1,0,l),Kt(s),d()},children:[e(C,{icon:"arrow-up"}),e("span",{children:e(u,{id:"QyioBP"})})]}),e(ve,{disabled:p===0||p===s.length-1,onClick:()=>{s.splice(p,1),s.splice(p+1,0,l),Kt(s),d()},children:[e(C,{icon:"arrow-down"}),e("span",{children:e(u,{id:"3Ib6FN"})})]}),e(Ue,{})]}),e(rt,{subMenu:!0,confirmLabel:e(D,{children:[e(C,{icon:"exit"}),e("span",{children:e(u,{id:"k08LxG",values:{0:l.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!m,menuItemClassName:"danger",onClick:async()=>{await qa({instanceURL:l.instanceURL,client_id:l.clientId,client_secret:l.clientSecret,token:l.accessToken}),s.splice(p,1),Kt(s),location.href=location.pathname||"/"},children:[e(C,{icon:"exit"}),e("span",{children:e(u,{id:"CXk1bI"})})]}),!!l?.createdAt&&e("div",{class:"footer",children:[e(C,{icon:"account-add"}),e("span",{children:e(u,{id:"+9E7iR",values:{0:tt(l.createdAt)},components:{0:e(yt,{datetime:l.createdAt})}})})]})]})]})]},l.info.id)})}),e("p",{children:e(ge,{to:"/login",class:"button plain2",onClick:n,children:[e(C,{icon:"plus"})," ",e("span",{children:e(u,{id:"Is7/PB"})})]})}),c&&e("p",{children:e("small",{children:e(u,{id:"52x24e",components:{0:e("i",{})}})})})]})})]})}const _i="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",Va={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function Ii(){const{i18n:n}=ce(),i=Se(()=>Co.map(o=>{const s=Va[o]||o.replace(/-[a-z]+$/i,""),a=xt({code:s,locale:o,fallback:Kn.find(h=>h.code===o)?.nativeName}),c=xt({code:s,locale:n.locale,fallback:Kn.find(h=>h.code===o)?.name});return{code:o,regionlessCode:s,_common:c,native:a}}).sort((o,s)=>{const a=o._common.localeCompare(s._common,n.locale);return a!==0?a:o.codes.code?1:0}),[]);return e("label",{class:"lang-selector",children:["๐ŸŒ"," ",e("select",{class:"small",value:n.locale||_o,onChange:o=>{Re.local.set("lang",o.target.value),Io(o.target.value)},children:[i.map(({code:o,regionlessCode:s,native:a})=>{const c=xt({code:s,locale:n.locale,fallback:Kn.find(d=>d.code===o)?.name});return e("option",{value:o,"data-regionless-code":s,children:!!c&&c!==a?`${a} - ${c}`:a},o)}),void 0]})]})}function Fi(n){const{masto:i}=ie();return i.v1.push.subscription.create(n)}function Ga(){const{masto:n}=ie();return n.v1.push.subscription.fetch()}function Wa(n){const{masto:i}=ie();return i.v1.push.subscription.update(n)}function Za(){const{masto:n}=ie();return n.v1.push.subscription.remove()}function Fn(){return"serviceWorker"in navigator&&"PushManager"in window}function Xa(){return navigator.serviceWorker.getRegistration()}async function Ai(){const n=await Xa(),i=n?await n.pushManager.getSubscription():void 0;return{registration:n,subscription:i}}function Ks(n){const i="=".repeat((4-n.length%4)%4),o=`${n}${i}`.replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(o),a=new Uint8Array(s.length);for(let c=0;c({code:n,name:i})),sc="TransLang API";function oc({onClose:n}){const{_:i}=ce(),o=qe(x),s=Re.local.get("theme")||"auto",a=F(),c=o.settings.contentTranslationTargetLanguage||null,h=Ts(),d=xt(h),r=Re.local.get("textSize")||Hi,[l,p]=E(ri()),{masto:m,authenticated:f,instance:b}=ie(),[v,k]=E(Re.local.get("experiments-tabBarV2")??!1);return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${r}px`},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(C,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(u,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:a,onInput:g=>{g.preventDefault();const S=new FormData(a.current).get("theme"),I=document.documentElement;if(S==="auto"){I.classList.remove("is-light","is-dark");const w=document.querySelector('meta[data-theme-setting="manual"]');w&&(w.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(_=>{_.name="theme-color"})}else{I.classList.toggle("is-light",S==="light"),I.classList.toggle("is-dark",S==="dark");const w=document.querySelector('meta[data-theme-setting="manual"]');w&&(w.name="theme-color",w.content=S==="light"?w.dataset.themeLightColor:w.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(_=>{_.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",S==="auto"?"dark light":S),S==="auto"?Re.local.del("theme"):Re.local.set("theme",S)},children:e("div",{class:"radio-group",children:[e("label",{children:[e("input",{type:"radio",name:"theme",value:"light",defaultChecked:s==="light"}),e("span",{children:e(u,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:s==="dark"}),e("span",{children:e(u,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:s!=="light"&&s!=="dark"}),e("span",{children:e(u,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(u,{id:"7r6sCa"})})}),e("div",{class:"range-group",children:[e("span",{style:{fontSize:$t[0]},children:e(u,{id:"J6ypuD"})})," ",e("input",{type:"range",min:$t[0],max:$t[$t.length-1],step:"1",value:r,list:"sizes",onChange:g=>{const y=parseInt(g.target.value,10);document.documentElement.style.setProperty("--text-size",`${y}px`),y===Hi?Re.local.del("textSize"):Re.local.set("textSize",g.target.value)}})," ",e("span",{style:{fontSize:$t[$t.length-1]},children:e(u,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:$t.map(g=>e("option",{value:g}))})]})]}),e("li",{children:[e("span",{children:[e("label",{children:e(u,{id:"CeJHfb"})}),e("br",{}),e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener",children:e(u,{id:"FFmj1D"})})})]}),e(Ii,{})]})]})}),f&&e(D,{children:[e("h3",{children:e(u,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:e("li",{children:[e("div",{children:e("label",{for:"posting-privacy-field",children:[e(u,{id:"NAjVvt"})," ",e(C,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]})}),e("div",{children:e("select",{id:"posting-privacy-field",value:l["posting:default:visibility"]||"public",onChange:g=>{const{value:y}=g.target;(async()=>{try{await m.v1.accounts.updateCredentials({source:{privacy:y}}),p({...l,"posting:default:visibility":y}),Ao({...l,"posting:default:visibility":y})}catch{alert(i({id:"Oa+KBY"}))}})()},children:[e("option",{value:"public",children:e(u,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(u,{id:"WDcQq9"})}),e("option",{value:"private",children:e(u,{id:"o34OrG"})})]})})]})})}),e("p",{class:"section-postnote",children:[e(C,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(u,{id:"xlsg7n",values:{instance:b},components:{0:e("a",{href:`https://${b}/`,target:"_blank",rel:"noopener"})}})})]})]}),e("h3",{children:e(u,{id:"ivdhsq"})}),e("section",{children:e("ul",{children:[e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:o.settings.autoRefresh,onChange:g=>{x.settings.autoRefresh=g.target.checked}})," ",e(u,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:o.settings.boostsCarousel,onChange:g=>{x.settings.boostsCarousel=g.target.checked}})," ",e(u,{id:"TSbnoW"})]})}),!!tc&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.contentTranslation,onChange:g=>{const{checked:y}=g.target;x.settings.contentTranslation=y,y||(x.settings.contentTranslationTargetLanguage=null)}})," ",e(u,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${o.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(u,{id:"zXCa9e"})," ",e("select",{value:c||"",disabled:!o.settings.contentTranslation,style:{width:"10em"},onChange:g=>{x.settings.contentTranslationTargetLanguage=g.target.value||null},children:[e("option",{value:"",children:e(u,{id:"jNCSyx",values:{systemTargetLanguageText:d}})}),e("option",{disabled:!0,children:"โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€"}),ji.map(g=>{const y=xt({code:g.code,fallback:g.name}),S=xt({code:g.code,locale:g.code}),I=S&&y!==S;return e("option",{value:g.code,children:I?`${S} - ${y}`:y})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(u,{id:"cc0NrU",values:{0:o.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:ji.map(g=>{const y=xt({code:g.code,fallback:g.name}),S=xt({code:g.code,locale:g.code}),I=S&&y!==S;return e("label",{children:[e("input",{type:"checkbox",checked:o.settings.contentTranslationHideLanguages.includes(g.code),onChange:w=>{const{checked:T}=w.target;T?x.settings.contentTranslationHideLanguages.push(g.code):x.settings.contentTranslationHideLanguages=o.settings.contentTranslationHideLanguages.filter(_=>_!==g.code)}})," ",I?e("span",{children:[S," ",e("span",{class:"insignificant ib",children:["- ",y]})]}):y]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"7I3sDQ",values:{TRANSLATION_API_NAME:sc},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:o.settings.contentTranslationAutoInline,disabled:!o.settings.contentTranslation,onChange:g=>{x.settings.contentTranslationAutoInline=g.target.checked}})," ",e(u,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!ic&&f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.composerGIFPicker,onChange:g=>{x.settings.composerGIFPicker=g.target.checked}})," ",e(u,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener"})}})})})]}),!!nc&&f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.mediaAltGenerator,onChange:g=>{x.settings.mediaAltGenerator=g.target.checked}})," ",e(u,{id:"9q5uor"})," ",e(C,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener"})}})})})]}),f&&di()?.mastodon>=2&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.groupedNotificationsAlpha,onChange:g=>{x.settings.groupedNotificationsAlpha=g.target.checked}})," ",e(u,{id:"aGziA/"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"X17jCM"})})})]}),f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.shortcutSettingsCloudImportExport,onChange:g=>{x.settings.shortcutSettingsCloudImportExport=g.target.checked}})," ",e(u,{id:"570qTm"})," ",e(C,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"fHf1v/"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.cloakMode,onChange:g=>{x.settings.cloakMode=g.target.checked}})," ",e(u,{id:"lxYe+I",components:{0:e("span",{class:"insignificant"}),1:e("samp",{}),2:e("samp",{})}})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(u,{id:"T/hglb"})})})]}),f&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{x.showDrafts=!0,x.showSettings=!1},children:e(u,{id:"krk5ws"})})})]})}),f&&e(ac,{onClose:n}),e("h3",{children:e(u,{id:"uyJsf6"})}),e("section",{children:[e("div",{style:{display:"flex",flexWrap:"wrap",gap:8,lineHeight:1.25,alignItems:"center",marginTop:8},children:[e("img",{src:_i,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(u,{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(u,{id:"O4cLCR"})})," ","ยท"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener",children:e(u,{id:"Ng063n"})})," ","ยท"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener",children:"Patreon"})," ","ยท"," ",e("a",{href:"https://github.com/cheeaun/phanpy/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener",children:e(u,{id:"3ePd3I"})})," ","ยท"," ",e("a",{href:ec,target:"_blank",rel:"noopener",children:e(u,{id:"LcET2C"})})]}),e("p",{children:[qi&&e(D,{children:[e(u,{id:"pFnMHn",values:{0:qi.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(u,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/3f4b1a6",target:"_blank",rel:"noopener",children:e(yt,{datetime:new Date("2025-07-18T11:51:01.946Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2025-07-18T11:51:01.946Z".slice(0,10).replace(/-/g,".")}.3f4b1a6`,onClick:g=>{g.target.select();try{navigator.clipboard.writeText(g.target.value),he(i({id:"PiPfua"}))}catch{he(i({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function ac({onClose:n}){const{_:i}=ce();if(!Fn())return null;const{instance:o}=ie(),[s,a]=E("default"),c=F(),[h,d]=E(!1),[r,l]=E(!1),p=F();Z(()=>{(async()=>{a("loading");try{const{subscription:f,backendSubscription:b}=await Ja();if(b?.policy&&b.policy!=="none"){d(!0);const{alerts:v,policy:k}=b;p.current=k;const{elements:g}=c.current,y=g.namedItem("policy");y&&(y.value=k),Object.entries(v).forEach(([S,I])=>{const w=g.namedItem(S);w?.type==="checkbox"&&(w.checked=!!I)})}a("default")}catch(f){/outside.*authorized/i.test(f.message)?l(!0):alert(f?.message||f),a("error")}})()},[]);const m=s==="loading";return e("form",{ref:c,onChange:()=>{setTimeout(()=>{const f=Object.fromEntries(new FormData(c.current)),b=!!f["policy-allow"],v={data:{policy:f.policy,alerts:{mention:!!f.mention,favourite:!!f.favourite,reblog:!!f.reblog,follow:!!f.follow,follow_request:!!f.followRequest,poll:!!f.poll,update:!!f.update,status:!!f.status}}};let k=0;Object.keys(v.data.alerts).forEach(y=>{v.data.alerts[y]?k++:delete v.data.alerts[y]});const g=p.current!==v.data.policy;b&&k>0?g?Ki().then(()=>{Ui(v)}).catch(y=>{alert(i({id:"I6pdY3"}))}):Ui(v).catch(y=>{alert(i({id:"I6pdY3"}))}):Ki().catch(y=>{alert(i({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(u,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:m||r,name:"policy-allow",checked:h,onChange:async f=>{const{checked:b}=f.target;if(b){const v=await Notification.requestPermission();v==="granted"?d(!0):(d(!1),v==="denied"&&alert(i({id:"6LUsk7"})))}else d(!1)}})," ",e(u,{id:"qYNCa1",values:{0:[{value:"all",label:i({id:"+niKJH"})},{value:"followed",label:i({id:"x2NYtp"})},{value:"follower",label:i({id:"PBFNgg"})}].map(f=>e("option",{value:f.value,children:f.label}))},components:{0:e("select",{name:"policy",disabled:m||r||!h})}})]}),e("div",{class:"shazam-container no-animation",style:{width:"100%"},hidden:!h,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(f=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:f.value})," ",f.label]})}))})})})}),r&&e("div",{class:"sub-section",children:e("p",{children:e(u,{id:"8d0b8B",components:{0:e(ge,{to:`/login?instance=${o}`,onClick:n}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(u,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const ni=()=>{let n=setTimeout(()=>{const i=document.getElementById("columns");if(i){const o=i.querySelector(".deck-container.focus");if(o)o.focus();else{const s=Array.from(i.querySelectorAll(".deck-container")).find(a=>a.getBoundingClientRect().left>=0);s?s.focus():i.querySelector(".deck-container")?.focus?.()}}else{const o=document.querySelectorAll("#modal-container > *");if(o?.length){const h=o[o.length-1],d=h.querySelector('[tabindex="-1"]')||h;if(d){d.focus();return}}if(document.querySelector(".deck-backdrop"))return;const a=document.querySelectorAll(".deck-container"),c=a[a.length-1];c&&c.tabIndex===-1&&c.focus()}},100);return()=>clearTimeout(n)};function Hs(n){if(!n)return;const i=Wt(),o=F(i.pathname);Z(()=>{o.current&&i.pathname!==o.current&&n?.()},[i.pathname,n])}const qs=1e3*60,cc=24*60*60*1e3,ii=ft(async()=>{const{masto:n}=ie(),i=await n.v1.lists.list();return i.sort((o,s)=>o.title.localeCompare(s.title)),i.length&&setTimeout(()=>{Re.account.set("lists",{lists:i,updatedAt:Date.now()})},1),i},{maxAge:qs});async function rn(){try{const{lists:n,updatedAt:i}=Re.account.get("lists")||{};return n?.length?(Date.now()-i>cc&&ii(),n):await ii()}catch{return[]}}const lc=ft(n=>{const{masto:i}=ie();return i.v1.lists.$select(n).fetch()},{maxAge:qs});async function js(n){const{lists:i}=Re.account.get("lists")||{};if(i?.length){const o=i.find(s=>s.id===n);if(o)return o}try{return lc(n)}catch{return null}}async function rc(n){return(await js(n))?.title||""}function dc(n){const{lists:i}=Re.account.get("lists")||{};i?.length&&(i.push(n),i.sort((o,s)=>o.title.localeCompare(s.title)),Re.account.set("lists",{lists:i,updatedAt:Date.now()}))}function uc(n){const{lists:i}=Re.account.get("lists")||{};if(i?.length){const o=i.findIndex(s=>s.id===n.id);o!==-1&&(i[o]=n,i.sort((s,a)=>s.title.localeCompare(a.title)),Re.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function hc(n){const{lists:i}=Re.account.get("lists")||{};if(i?.length){const o=i.findIndex(s=>s.id===n);o!==-1&&(i.splice(o,1),Re.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Ot({insignificant:n}){const{_:i}=ce();return e(C,{icon:"filter",size:"xs",class:`list-exclusive-badge ${n?"insignificant":""}`,title:i({id:"FNptcJ"})})}function Ti({list:n,onClose:i}){const{_:o}=ce(),{masto:s}=ie(),[a,c]=E("default"),h=!!n,d=F(),r=F(),l=F();Z(()=>{h&&(d.current.value=n.title,r.current.value=n.repliesPolicy,l.current&&(l.current.checked=n.exclusive))},[h]);const p=Ve("@mastodon/list-exclusive")||Ve("@gotosocial/list-exclusive");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(C,{icon:"x",alt:o({id:"yz7wBu"})})})," ",e("header",{children:e("h2",{children:o(h?{id:"tuhghE"}:{id:"Sb2gYF"})})}),e("main",{children:e("form",{class:"list-form",onSubmit:m=>{m.preventDefault();const f=new FormData(m.target),b=f.get("title"),v=f.get("replies_policy"),k=f.get("exclusive")==="on";c("loading"),(async()=>{try{let g;h?g=await s.v1.lists.$select(n.id).update({title:b,replies_policy:v,exclusive:k}):g=await s.v1.lists.create({title:b,replies_policy:v,exclusive:k}),c("default"),i?.({state:"success",list:g}),setTimeout(()=>{h?uc(g):dc(g)},1)}catch{c("error"),alert(o(h?{id:"R7ep1i"}:{id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(u,{id:"6YtxFj"})," ",e("input",{ref:d,type:"text",id:"list-title",name:"title",required:!0,disabled:a==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:r,name:"replies_policy",required:!0,disabled:a==="loading",children:[e("option",{value:"list",children:e(u,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(u,{id:"Mr53YX"})}),e("option",{value:"none",children:e(u,{id:"PM7llw"})})]})}),p&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:l,type:"checkbox",name:"exclusive",disabled:a==="loading"})," ",e(Ot,{insignificant:!0})," ",e(u,{id:"jxxYp0"})]})}),e("div",{class:"list-form-footer",children:[e("button",{type:"submit",disabled:a==="loading",children:o(h?{id:"tfDRzk"}:{id:"hYgDIe"})}),h&&e(rt,{disabled:a==="loading",align:"end",menuItemClassName:"danger",confirmLabel:o({id:"+kQ/cY"}),onClick:()=>{c("loading"),(async()=>{try{await s.v1.lists.$select(n.id).remove(),c("default"),i?.({state:"deleted"}),setTimeout(()=>{hc(n.id)},1)}catch{c("error"),alert(o({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:a==="loading",children:e(u,{id:"Jb6/SB"})})})]})]})})]})}const pc=[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:et(5,"minute"),1800:et(30,"minute"),3600:et(1,"hour"),21600:et(6,"hour"),86400:et(1,"day"),259200:et(3,"day"),604800:et(1,"week"),2592e3:et(30,"day")},Yi=80,Ys=1e3*60*10;function fc(n,i){return i.v1.accounts.familiarFollowers.fetch({id:[n]})}const mc=ft(fc,{maxAge:Ys});async function gc(n,i){const o=i.v1.accounts.$select(n).statuses.list({limit:20}).values().next(),{value:s}=await o,a={total:s.length,originals:0,replies:0,boosts:0};return s.forEach(c=>{c.reblog?a.boosts++:c.inReplyToId&&c.inReplyToAccountId!==c.account.id?a.replies++:a.originals++}),s.length&&(a.daysSinceLastPost=Math.ceil((Date.now()-new Date(s[s.length-1].createdAt))/864e5)),a}const bc=ft(gc,{maxAge:Ys}),vc=80;function Vs({account:n,fetchAccount:i=()=>{},standalone:o,instance:s,authenticated:a,showEndorsements:c=!1}){const{i18n:h,_:d}=ce(),{masto:r,authenticated:l}=ie({instance:s}),{masto:p,instance:m}=ie(),[f,b]=E("default"),v=typeof n=="string",[k,g]=E(v?null:n),y=Se(()=>s===m,[s,m]);Z(()=>{if(!v){g(n);return}b("loading"),(async()=>{try{const z=await i();x.accounts[`${z.id}@${s}`]=z,g(z),b("default")}catch{g(null),b("error")}})()},[v,n,i]);const{acct:S,avatar:I,avatarStatic:w,bot:T,createdAt:_,displayName:A,emojis:L,fields:M,followersCount:K,followingCount:U,group:V,id:J,lastStatusAt:X,locked:j,note:G,statusesCount:B,url:oe,username:$,memorial:Y,moved:Q,roles:H,hideCollections:W}=k||{};let me=!1,{header:ue,headerStatic:be}=k||{};(!ue||/missing\.png$/.test(ue))&&I&&!/missing\.png$/.test(I)&&(ue=I,me=!0,w&&!/missing\.png$/.test(w)&&(be=w));const Ie=Se(()=>J===bt(),[J]);Z(()=>{const z=!!(k?.id&&k?.username&&k?.acct&&k?.avatar&&k?.avatarStatic&&k?.displayName&&k?.url);if(Ie&&s&&z){const ye=li();let ee=!1;ye.forEach(le=>{le.info.id===k.id&&le.instanceURL===s&&(le.info=k,ee=!0)}),ee&&Kt(ye)}},[Ie,k,s]);const ke=Se(()=>{if(!oe)return null;const z=URL.parse(oe)?.hostname;return z?ln.toUnicode(z):null},[oe]),[Ae,Pe]=E([]),we=F(),Ne=F([]);async function He(z){(z||!we.current)&&(we.current=r.v1.accounts.$select(J).followers.list({limit:Yi}).values());const ye=await we.current.next();if(Ie||!y)return ye;const{value:ee}=ye;let le=[];if(z){let pe=[];try{pe=await r.v1.accounts.familiarFollowers.fetch({id:[J]})}catch{}Ne.current=pe?.[0]?.accounts||[],le=[...Ne.current,...ee.filter(Ce=>!Ne.current.some(Je=>Je.id===Ce.id))]}else ee?.length&&(le=ee.filter(pe=>!Ne.current.some(Ce=>Ce.id===pe.id)));return{...ye,value:le}}const Le=F();async function se(z){return(z||!Le.current)&&(Le.current=r.v1.accounts.$select(J).following.list({limit:Yi}).values()),await Le.current.next()}const _e=o?"div":ge,Oe=s?`/${s}/a/${J}`:`/a/${J}`,[Te,N]=E([]),[q,O]=E(),[re,Me]=E("default"),P=!!q?.total,ae=async z=>{try{const ye=await mc(z,p);N(ye[0].accounts.slice(0,yc))}catch{}},xe=async()=>{if(J){Me("loading");try{const z=await bc(J,r);O(z),Me("default")}catch{Me("error")}}},Ee=Qe(({relationship:z,currentID:ye})=>{z.following||(ae(ye),!o&&B>0&&xe())},[o,J,B]),$e=Qe(z=>{z.id===J&&(g(z),x.accounts[`${z.id}@${s}`]=z)},[J,s]),Ye=v&&n&&/^https?:\/\//.test(n),[R,te]=E(!1),[ne,de]=E(!1);return e(D,{children:[e("div",{tabIndex:"-1",class:`account-container ${f==="loading"?"skeleton":""}`,style:{"--header-color-1":Ae[0],"--header-color-2":Ae[1],"--header-color-3":Ae[2],"--header-color-4":Ae[3]},children:[f==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(u,{id:"44hICK"})}),v?e("p",{children:Ye?e("a",{href:n,target:"_blank",rel:"noopener",children:n}):e("code",{class:"insignificant",children:n})}):e("p",{children:e("a",{href:oe,target:"_blank",rel:"noopener",children:[e(u,{id:"Aadw0+"})," ",e(C,{icon:"external"})]})})]}),f==="loading"?e(D,{children:[e("header",{children:e(lt,{avatarSize:"xxxl",skeleton:!0})}),e("main",{children:[e("div",{class:"note",children:[e("p",{children:"โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ"}),e("p",{children:"โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ"})]}),e("div",{class:"account-metadata-box",children:[e("div",{class:"profile-metadata",children:[e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"โ–ˆโ–ˆโ–ˆ"}),e("p",{children:"โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ"})]}),e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"โ–ˆโ–ˆโ–ˆโ–ˆ"}),e("p",{children:"โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ"})]})]}),e("div",{class:"stats",children:[e("div",{children:[e("span",{children:"โ–ˆโ–ˆ"})," ",e(u,{id:"x5LEuB"})]}),e("div",{children:[e("span",{children:"โ–ˆโ–ˆ"})," ",e(u,{id:"following.stats"})]}),e("div",{children:[e("span",{children:"โ–ˆโ–ˆ"})," ",e(u,{id:"+owNNn"})]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain",disabled:!0,children:e(C,{icon:"more",size:"l",alt:d({id:"2FYpfJ"})})})})]})]})]}):k&&e(D,{children:[!!Q&&e("div",{class:"account-moved",children:[e("p",{children:e(u,{id:"C6cVP/",values:{displayName:A},components:{0:e("b",{})}})}),e(lt,{account:Q,instance:s,onClick:z=>{z.stopPropagation(),x.showAccount=Q}})]}),!!ue&&!/missing\.png$/.test(ue)&&e("img",{src:ue,alt:"",class:`header-banner ${me?"header-is-avatar":""}`,onError:z=>{z.target.crossOrigin?z.target.src!==be?z.target.src=be:(z.target.removeAttribute("crossorigin"),z.target.src=ue):z.target.src!==be?z.target.src=be:z.target.remove()},crossOrigin:"anonymous",onLoad:z=>{z.target.classList.add("loaded");try{const ye=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),ee=ye.getContext("2d",{willReadFrequently:!0});ye.width=z.target.width,ye.height=z.target.height,ee.imageSmoothingEnabled=!1,ee.drawImage(z.target,0,0);const le=10,Ce=[ee.getImageData(0,0,le,le).data,ee.getImageData(z.target.width-le,0,le,le).data,ee.getImageData(0,z.target.height-le,le,le).data,ee.getImageData(z.target.width-le,z.target.height-le,le,le).data].map(Je=>{let dt=0,at=0,Xe=0,_t=0;for(let At=0;At{const[dt,at,Xe,_t]=kc(Je);return`rgba(${dt}, ${at}, ${Xe}, ${_t})`});Pe(Ce)}catch{}}}),e("header",{children:o?e(st,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(lt,{account:k,instance:s,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(Ec,{acct:S,instance:s})}),e(ve,{onClick:()=>{const z=S.includes("@")?`@${S}`:`@${S}@${s}`;try{navigator.clipboard.writeText(z),he(d({id:"zJoEwS"}))}catch{he(d({id:"BC0lSD"}))}},children:[e(C,{icon:"link"}),e("span",{children:e(u,{id:"27x6gl"})})]}),e(ve,{href:oe,target:"_blank",children:[e(C,{icon:"external"}),e("span",{children:e(u,{id:"Bz5hLl"})})]}),e(Ue,{}),e(ve,{onClick:()=>{x.showMediaModal={mediaAttachments:[{type:"image",url:w}]}},children:[e(C,{icon:"user"}),e("span",{children:e(u,{id:"7WYl2I"})})]}),!!be&&!me&&e(ve,{onClick:()=>{x.showMediaModal={mediaAttachments:[{type:"image",url:be}]}},children:[e(C,{icon:"media"}),e("span",{children:e(u,{id:"ZNme5R"})})]}),l&&Ie&&Ve("@mastodon/profile-edit")&&e(D,{children:[e(Ue,{}),e(ve,{onClick:()=>{te(!0)},children:[e(C,{icon:"pencil"}),e("span",{children:e(u,{id:"9OpVZg"})})]})]})]}):e(lt,{account:k,instance:s,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!Y&&e("span",{class:"tag",children:e(u,{id:"prdIOK"})}),!!T&&e("span",{class:"tag",children:[e(C,{icon:"bot"})," ",e(u,{id:"9Vdq+j"})]}),!!V&&e("span",{class:"tag",children:[e(C,{icon:"group"})," ",e(u,{id:"L8fEEm"})]}),H?.map(z=>e("span",{class:"tag",children:[z.name,!!ke&&e(D,{children:[" ",e("span",{class:"more-insignificant",children:ke})]})]})),e("div",{class:"note",dir:"auto",onClick:xs({instance:m}),dangerouslySetInnerHTML:{__html:Qn(G,{emojis:L})}}),e("div",{class:"account-metadata-box",children:[M?.length>0&&e("div",{class:"profile-metadata",children:M.map(({name:z,value:ye,verifiedAt:ee},le)=>e("div",{class:`profile-field ${ee?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(Es,{text:z,emojis:L})," ",!!ee&&e(C,{icon:"check-circle",size:"s",alt:d({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:Qn(ye,{emojis:L})}})]},z+le))}),e("div",{class:"stats",children:[e(_e,{tabIndex:0,to:Oe,onClick:()=>{setTimeout(()=>{x.showGenericAccounts={id:"followers",heading:d({id:"x5LEuB"}),fetchAccounts:He,instance:s,excludeRelationshipAttrs:Ie?["followedBy"]:[],blankCopy:W?d({id:"BRV/wh"}):void 0}},0)},children:[!!Te.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:Te.map(z=>e(ut,{url:z.avatarStatic,size:"s",alt:`${z.displayName} @${z.acct}`,squircle:z?.bot}))})}),e("span",{title:K,children:Ge(K)})," ",e(u,{id:"x5LEuB"})]}),e(_e,{class:"insignificant",tabIndex:0,to:Oe,onClick:()=>{setTimeout(()=>{x.showGenericAccounts={heading:d({id:"following.stats"}),fetchAccounts:se,instance:s,excludeRelationshipAttrs:Ie?["following"]:[],blankCopy:W?d({id:"BRV/wh"}):void 0}},0)},children:[e("span",{title:U,children:Ge(U)})," ",e(u,{id:"following.stats"}),e("br",{})]}),e(_e,{class:"insignificant",to:Oe,children:[e("span",{title:B,children:Ge(B)})," ",e(u,{id:"+owNNn"})]}),!!_&&e("div",{class:"insignificant",children:e(u,{id:"PCcEFZ",values:{0:tt(_,{hideTime:!0})},components:{0:e("time",{datetime:_})}})})]})]}),!!q&&e(_e,{to:Oe,class:"account-metadata-box",children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:P?e("div",{class:"posting-stats",title:d({id:"wiuWLe",values:{0:(q.originals/q.total).toLocaleString(h.locale||void 0,{style:"percent"}),1:(q.replies/q.total).toLocaleString(h.locale||void 0,{style:"percent"}),2:(q.boosts/q.total).toLocaleString(h.locale||void 0,{style:"percent"})}}),children:[e("div",{children:q.daysSinceLastPost<365?fe._({id:"oZUtTk",values:{0:q.total,1:q.daysSinceLastPost,2:q.daysSinceLastPost,3:q.daysSinceLastPost,4:q.total,5:q.total,6:q.daysSinceLastPost}}):fe._({id:"JvA7Mo",values:{0:q.total,1:q.total}})}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${q.originals/q.total*100}%`,"--replies-percentage":`${(q.originals+q.replies)/q.total*100}%`}}),e("div",{class:"posting-stats-legends",children:[e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-originals"})," ",e(u,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ",e(u,{id:"N8UzTV"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ",e(u,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(u,{id:"vl3XTJ"})})})})}),!Q&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!q,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:re==="loading",onClick:()=>{xe()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${re==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),e(u,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(wc,{info:k,instance:s,standalone:o,authenticated:a,onRelationshipChange:Ee,onProfileUpdate:$e,setShowEditProfile:te,showEndorsements:c,renderEndorsements:ne,setRenderEndorsements:de})}),e(Rc,{accountID:J,info:k,open:ne,onlyOpenIfHasEndorsements:ne==="onlyOpenIfHasEndorsements"})]})]}),!!R&&e(Be,{onClose:()=>{te(!1)},children:e(Tc,{onClose:({state:z,account:ye}={})=>{te(!1),z==="success"&&ye&&$e(ye)}})})]})}const yc=3;function wc({info:n,instance:i,standalone:o,authenticated:s,onRelationshipChange:a=()=>{},onProfileUpdate:c=()=>{},setShowEditProfile:h=()=>{},showEndorsements:d=!1,renderEndorsements:r=!1,setRenderEndorsements:l=()=>{}}){if(!n)return null;const{_:p,_:m}=ce(),{masto:f,instance:b,authenticated:v}=ie(),k=i===b,[g,y]=E("default"),[S,I]=E(null),{id:w,acct:T,url:_,username:A,locked:L,lastStatusAt:M,note:K,fields:U,moved:V}=n,J=F(w),{following:X,showingReblogs:j,notifying:G,followedBy:B,blocking:oe,blockedBy:$,muting:Y,mutingNotifications:Q,requested:H,domainBlocking:W,endorsed:me,note:ue}=S||{},[be,Ie]=E(null),[ke,Ae]=E(!1),Pe=T.includes("@")?T:`${T}@${i}`,we=Ve("@mastodon/endorsements");Z(()=>{if(n){const O=bt();let re;(async()=>{if(k&&s)re=w;else if(!k&&v){const P=n.acct.includes("@");try{const ae=await f.v2.search.list({q:P?n.acct:`${n.username}@${i}`,type:"accounts",limit:1,resolve:!0});ae.accounts.length&&(re=ae.accounts[0].id,Ie(ae.accounts[0]))}catch{}}if(!re)return;if(O===re){Ae(!0);return}J.current=re,y("loading");const Me=f.v1.accounts.relationships.fetch({id:[re]});try{const P=await Me;if(y("default"),P.length){const ae=P[0];I(ae),a({relationship:ae,currentID:re})}}catch{y("error")}})()}},[n,s]),Z(()=>{n&&ke&&To(n)},[n,ke]);const Ne=g==="loading",[He,Le]=E(!1),[se,_e]=E(!1),[Oe,Te]=E(!1),[N,q]=E([]);return e(D,{children:[e("div",{class:"actions",children:[e("span",{children:[B?e("span",{class:"tag",children:e(u,{id:"p3UO/y"})}):M?e("small",{class:"insignificant",children:e(u,{id:"F3cM1G",values:{0:tt(M,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),Y&&e("span",{class:"tag danger",children:e(u,{id:"+IJm1Z"})}),oe&&e("span",{class:"tag danger",children:e(u,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!ue&&e("button",{type:"button",class:"private-note-tag",title:m({id:"zxFxcH"}),onClick:()=>{Te(!0)},dir:"auto",children:e("span",{children:ue})}),e(st,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",disabled:Ne,children:e(C,{icon:"more",size:"l",alt:m({id:"2FYpfJ"})})}),onMenuChange:O=>{X&&O.open&&(async()=>{try{const re=await f.v1.accounts.$select(J.current).lists.list();q(re)}catch{}})()},children:[v&&!ke?e(D,{children:[e(ve,{onClick:()=>{Is({draftStatus:{status:`@${be?.acct||T} `}})},children:[e(C,{icon:"at"}),e("span",{children:e(u,{id:"3LkfZu",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(ve,{onClick:()=>{Le(!0)},children:[e(C,{icon:"translate"}),e("span",{children:e(u,{id:"R8mSiS"})})]}),Ve("@mastodon/profile-private-note")&&e(ve,{onClick:()=>{Te(!0)},children:[e(C,{icon:"pencil"}),e("span",{children:m(ue?{id:"U+Gokq"}:{id:"VcQzRi"})})]}),X&&!!S&&e(D,{children:[e(ve,{onClick:()=>{y("loading"),(async()=>{try{const O=await f.v1.accounts.$select(J.current).follow({notify:!G});O&&I(O),y("default"),he(O.notifying?m({id:"jL3N0G",values:{username:A}}):m({id:"0h4/9h",values:{username:A}}))}catch(O){alert(O),y("error")}})()},children:[e(C,{icon:"notification"}),e("span",{children:m(G?{id:"osJmEN"}:{id:"I92Z+b"})})]}),e(ve,{onClick:()=>{y("loading"),(async()=>{try{const O=await f.v1.accounts.$select(J.current).follow({reblogs:!j});O&&I(O),y("default"),he(O.showingReblogs?m({id:"0X2KC8",values:{username:A}}):m({id:"cXWjH0",values:{username:A}}))}catch(O){alert(O),y("error")}})()},children:[e(C,{icon:"rocket"}),e("span",{children:m(j?{id:"GRUr8d"}:{id:"uREpT3"})})]})]}),we&&X&&e(ve,{onClick:()=>{y("loading"),(async()=>{try{if(me){const O=await f.v1.accounts.$select(be?.id||w).unpin();I(O),y("default"),he(m({id:"pWFLFk",values:{username:A}}))}else{const O=await f.v1.accounts.$select(be?.id||w).pin();I(O),y("default"),he(m({id:"xhiXaF",values:{username:A}}))}}catch{y("error"),me?he(m({id:"xHq5L2",values:{username:A}})):he(m({id:"Owr/5+",values:{username:A}}))}})()},children:[e(C,{icon:"endorsement"}),m(me?{id:"S9JvjK"}:{id:"UlJ3QN"})]}),d&&we&&!r&&e(ve,{onClick:()=>l(!0),children:[e(C,{icon:"endorsement"}),e("span",{children:e(u,{id:"Qopbnd"})})]}),X&&e(ve,{onClick:()=>{_e(!0)},children:[e(C,{icon:"list"}),N.length?e(D,{children:[e("small",{class:"menu-grow",children:[e(u,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:N.map(O=>O.title).join(", ")})]}),e("small",{class:"more-insignificant",children:N.length})]}):e("span",{children:e(u,{id:"sJ2yQc"})})]}),e(Ue,{})]}):we&&!r&&e(D,{children:[e(ve,{onClick:()=>l(!0),children:[e(C,{icon:"endorsement"}),"Show featured profiles"]}),e(Ue,{})]}),e(ve,{onClick:()=>{const O=`@${be?.acct||Pe}`;try{navigator.clipboard.writeText(O),he(m({id:"zJoEwS"}))}catch{he(m({id:"BC0lSD"}))}},children:[e(C,{icon:"copy"}),e("small",{children:[e(u,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",be?.acct||Pe]})]})]}),e(ve,{href:_,target:"_blank",children:[e(C,{icon:"external"}),e("small",{class:"menu-double-lines",children:Sc(_)})]}),e("div",{class:"menu-horizontal",children:[e(ve,{onClick:()=>{try{navigator.clipboard.writeText(_),he(m({id:"edWbV6"}))}catch{he(m({id:"W1ewR0"}))}},children:[e(C,{icon:"link"}),e("span",{children:e(u,{id:"he3ygx"})})]}),navigator?.share&&navigator?.canShare?.({url:_})&&e(ve,{onClick:()=>{try{navigator.share({url:_})}catch{alert(m({id:"TtG3Uh"}))}},children:[e(C,{icon:"share"}),e("span",{children:e(u,{id:"LFKLqp"})})]})]}),!!S&&e(D,{children:[e(Ue,{}),Y?e(ve,{onClick:()=>{y("loading"),(async()=>{try{const O=await f.v1.accounts.$select(be?.id||w).unmute();I(O),y("default"),he(m({id:"B4Xkly",values:{username:A}})),x.reloadGenericAccounts.id="mute",x.reloadGenericAccounts.counter++}catch{y("error")}})()},children:[e(C,{icon:"unmute"}),e("span",{children:e(u,{id:"Q/HUhC",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(cn,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(D,{children:[e(C,{icon:"mute"}),e("span",{class:"menu-grow",children:e(u,{id:"xhPEH3",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(C,{icon:"time"}),e(C,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:pc.map(O=>e(ve,{onClick:()=>{y("loading"),(async()=>{try{const re=await f.v1.accounts.$select(be?.id||w).mute({duration:O});I(re),y("default"),he(m({id:"/plB9m",values:{0:typeof Ft[O]=="function"?Ft[O]():p(Ft[O]),username:A}})),x.reloadGenericAccounts.id="mute",x.reloadGenericAccounts.counter++}catch{y("error"),he(m({id:"vWGBjT",values:{username:A}}))}})()},children:typeof Ft[O]=="function"?Ft[O]():p(Ft[O])}))})}),B&&e(rt,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(D,{children:[e(C,{icon:"user-x"}),e("span",{children:e(u,{id:"unyq2W",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{y("loading"),(async()=>{try{const O=await f.v1.accounts.$select(be?.id||w).removeFromFollowers();I(O),y("default"),he(m({id:"AgkcM/",values:{username:A}})),x.reloadGenericAccounts.id="followers",x.reloadGenericAccounts.counter++}catch{y("error")}})()},children:[e(C,{icon:"user-x"}),e("span",{children:e(u,{id:"VCZ0OT"})})]}),e(rt,{subMenu:!0,confirm:!oe,confirmLabel:e(D,{children:[e(C,{icon:"block"}),e("span",{children:e(u,{id:"aforS9",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{y("loading"),(async()=>{try{if(oe){const O=await f.v1.accounts.$select(be?.id||w).unblock();I(O),y("default"),he(m({id:"sI9N29",values:{username:A}}))}else{const O=await f.v1.accounts.$select(be?.id||w).block();I(O),y("default"),he(m({id:"uYcYzu",values:{username:A}}))}x.reloadGenericAccounts.id="block",x.reloadGenericAccounts.counter++}catch{y("error"),oe?he(m({id:"0tG4wG",values:{username:A}})):he(m({id:"pA+qEx",values:{username:A}}))}})()},children:oe?e(D,{children:[e(C,{icon:"unblock"}),e("span",{children:e(u,{id:"/3LJfX",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(D,{children:[e(C,{icon:"block"}),e("span",{children:e(u,{id:"JRswkR",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(ve,{className:"danger",onClick:()=>{x.showReportModal={account:be||n}},children:[e(C,{icon:"flag"}),e("span",{children:e(u,{id:"qTJgpR",values:{username:A},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),v&&ke&&o&&Ve("@mastodon/profile-edit")&&e(D,{children:[e(Ue,{}),e(ve,{onClick:()=>{h(!0)},children:[e(C,{icon:"pencil"}),e("span",{children:e(u,{id:"9OpVZg"})})]})]}),!1]}),!S&&g==="loading"&&e(De,{abrupt:!0}),!!S&&!V&&e(rt,{confirm:X||H,confirmLabel:e("span",{children:m(H?{id:"e7qQIH"}:{id:"eYsAQr",values:{0:n.acct||n.username}})}),menuItemClassName:"danger",align:"end",disabled:Ne,onClick:()=>{y("loading"),(async()=>{try{let O;X||H?O=await f.v1.accounts.$select(J.current).unfollow():O=await f.v1.accounts.$select(J.current).follow(),O&&(I(O),O.following&&l("onlyOpenIfHasEndorsements")),y("default")}catch(O){alert(O),y("error")}})()},children:e("button",{type:"button",class:`${X||H?"light swap":""}`,"data-swap-state":X||H?"danger":"",disabled:Ne,children:X?e(D,{children:[e("span",{children:e(u,{id:"y6sq5j"})}),e("span",{children:e(u,{id:"HKrBPX"})})]}):H?e(D,{children:[e("span",{children:e(u,{id:"Yx0Ud8"})}),e("span",{children:e(u,{id:"yTVtKs"})})]}):L?e(D,{children:[e(C,{icon:"lock"})," ",e("span",{children:e(u,{id:"MKEPCY"})})]}):m({id:"MKEPCY"})})})]})]}),!!He&&e(Be,{onClose:()=>{Le(!1)},children:e(Cc,{note:K,fields:U,onClose:()=>Le(!1)})}),!!se&&e(Be,{onClose:()=>{_e(!1)},children:e(_c,{accountID:J.current,onClose:()=>_e(!1)})}),!!Oe&&e(Be,{onClose:()=>{Te(!1)},children:e(Ic,{account:n,note:ue,onRelationshipChange:O=>{I(O)},onClose:()=>Te(!1)})})]})}function kc([n,i,o]){const s=.2126*n+.7152*i+.0722*o;let a;return s>=220?a=1:s<=50?a=.1:a=s/255,a=Math.min(1,a),[n,i,o,a]}function Sc(n){if(!n)return;const i=URL.parse(n);if(!i)return;const{host:o,pathname:s}=i,a=s.replace(/\/$/,"").replace(/^\//,"");return e(D,{children:[e("span",{class:"more-insignificant",children:[ln.toUnicode(o),"/"]}),e("wbr",{}),e("span",{children:a})]})}function Cc({note:n,fields:i,onClose:o}){const{_:s}=ce(),a=i?.map(({name:h,value:d})=>`${h} ${Pi(d)}`).join(` `)||"",c=Pi(n)+(a?` ${a}`:"");return e("div",{class:"sheet",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(C,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:c}),e(Rs,{forceTranslate:!0,text:c})]})]})}function _c({accountID:n,onClose:i}){const{_:o}=ce(),{masto:s}=ie(),[a,c]=E("default"),[h,d]=E([]),[r,l]=E([]),[p,m]=Rt(v=>v+1,0);Z(()=>{c("loading"),(async()=>{try{const v=await rn();d(v);const k=await s.v1.accounts.$select(n).lists.list();l(k),c("default")}catch{c("error")}})()},[p]);const[f,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(C,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"sJ2yQc"})})}),e("main",{children:[h.length>0?e("ul",{class:"list-add-remove",children:h.map(v=>{const k=r.some(g=>g.id===v.id);return e("li",{children:e("button",{type:"button",class:`light ${k?"checked":""}`,disabled:a==="loading",onClick:()=>{c("loading"),(async()=>{try{k?await s.v1.lists.$select(v.id).accounts.remove({accountIds:[n]}):await s.v1.lists.$select(v.id).accounts.create({accountIds:[n]}),m()}catch{c("error"),alert(o(k?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(C,{icon:"check-circle",alt:"โ˜‘๏ธ"}),e("span",{children:v.title})]})})})}):a==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):a==="error"?e("p",{class:"ui-state",children:e(u,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(u,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>b(!0),disabled:a!=="default",children:[e(C,{icon:"plus",size:"l"})," ",e("span",{children:e(u,{id:"Sb2gYF"})})]})]}),f&&e(Be,{onClick:v=>{v.target===v.currentTarget&&b(!1)},children:e(Ti,{list:f?.list,onClose:v=>{v.state==="success"&&m(),b(!1)}})})]})}function Ic({account:n,note:i,onRelationshipChange:o=()=>{},onClose:s=()=>{}}){const{_:a}=ce(),{masto:c}=ie(),[h,d]=E("default"),r=F(null);return Z(()=>{let l;return r.current&&!i&&(l=setTimeout(()=>{r.current.focus?.()},100)),()=>{clearTimeout(l)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(C,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"DYqYm5",values:{0:n?.username||n?.acct},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:l=>{l.preventDefault();const m=new FormData(l.target).get("note");m?.trim()!==i?.trim()&&(d("loading"),(async()=>{try{const f=await c.v1.accounts.$select(n?.id).note.create({comment:m});d("default"),o(f),s()}catch(f){d("error"),alert(f?.message||a({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:r,name:"note",disabled:h==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:h==="loading",onClick:()=>{s?.()},children:e(u,{id:"dEgA5A"})}),e("span",{children:[e(De,{abrupt:!0,hidden:h!=="loading"}),e("button",{disabled:h==="loading",type:"submit",children:e(u,{id:"SrwrEj"})})]})]})]})})]})}const Ac=["image/jpeg","image/png","image/gif","image/webp"],Vi=Ac.join(",");function Tc({onClose:n=()=>{}}){const{_:i}=ce(),{masto:o}=ie(),[s,a]=E("loading"),[c,h]=E(null),[d,r]=E(null),[l,p]=E(null);Z(()=>{(async()=>{try{const w=await o.v1.accounts.verifyCredentials();h(w),a("default")}catch{a("error")}})()},[]);const{displayName:m,source:f,avatar:b,header:v}=c||{},{note:k,fields:g}=f||{},y=F(null),S=[...b?[{type:"image",url:b}]:[],...l?[{type:"image",url:l}]:[]],I=[...v?[{type:"image",url:v}]:[],...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(C,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"9OpVZg"})})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):e("form",{onSubmit:w=>{w.preventDefault();const T=new FormData(w.target),_=T.get("header"),A=T.get("avatar"),L=T.get("display_name"),M=T.get("note"),K=y.current.querySelectorAll('input[name^="fields_attributes"]'),U=[];K.forEach(V=>{const J=V.name,[X,j,G]=J.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],B=V.value?V.value.trim():"";j&&G&&B&&(U[j]||(U[j]={}),U[j][G]=B)}),U.forEach(V=>{V.name&&!V.value&&(V.value="")}),(async()=>{try{const V=await o.v1.accounts.updateCredentials({header:_,avatar:A,displayName:L,note:M,fieldsAttributes:U});n?.({state:"success",account:V})}catch(V){alert(V?.message||i({id:"FwMMx0"}))}})()},children:[e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(u,{id:"C5zXYJ"})," ",e("input",{type:"file",name:"header",accept:Vi,onChange:w=>{const T=w.target.files[0];if(T){const _=URL.createObjectURL(T);r(_)}}})]}),e("div",{class:"edit-profile-media-field",children:[v?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:I,mediaIndex:0}},children:e("img",{src:v,alt:""})}):e("div",{class:"edit-media"}),d&&e(D,{children:[e(C,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:I,mediaIndex:1}},children:e("img",{src:d,alt:""})})]})]})]}),e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(u,{id:"4XF0BB"})," ",e("input",{type:"file",name:"avatar",accept:Vi,onChange:w=>{const T=w.target.files[0];if(T){const _=URL.createObjectURL(T);p(_)}}})]}),e("div",{class:"edit-profile-media-field",children:[b?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:S,mediaIndex:0}},children:e("img",{src:b,alt:""})}):e("div",{class:"edit-media"}),l&&e(D,{children:[e(C,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{x.showMediaModal={mediaAttachments:S,mediaIndex:1}},children:e("img",{src:l,alt:""})})]})]})]}),e("p",{children:e("label",{children:[e(u,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:m,maxLength:30,disabled:s==="loading",dir:"auto"})]})}),e("p",{children:e("label",{children:[e(u,{id:"E+oKCO"}),e("textarea",{defaultValue:k,name:"note",maxLength:500,rows:"5",disabled:s==="loading",dir:"auto"})]})}),e("p",{children:e(u,{id:"T4I119"})}),e("table",{ref:y,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(u,{id:"87a/t/"})}),e("th",{children:e(u,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,g.length)}).map((w,T)=>{const{name:_="",value:A=""}=g[T]||{};return e(xc,{name:_,value:A,index:T,disabled:s==="loading"},T)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:s==="loading",onClick:()=>{n?.()},children:e(u,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:s==="loading",children:e(u,{id:"tfDRzk"})})]})]})})]})}function xc({name:n,value:i,disabled:o,index:s}){const[a,c]=E(!!i);return e("tr",{children:[e("td",{children:e("input",{type:"text",name:`fields_attributes[${s}][name]`,defaultValue:n,disabled:o,maxLength:255,required:a,dir:"auto"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${s}][value]`,defaultValue:i,disabled:o,maxLength:255,onChange:h=>c(!!h.currentTarget.value),dir:"auto"})})]})}function Ec({acct:n,instance:i}){let[o,s]=n.split("@");s||(s=i);const a=ln.toASCII(n);return e("div",{class:"handle-info",children:[e("span",{class:"handle-handle",title:a,children:[e("b",{class:"handle-username",children:o}),e("span",{class:"handle-at",children:"@"}),e("b",{class:"handle-server",children:s})]}),e("div",{class:"handle-legend",children:[e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon username"})," ",e(u,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(u,{id:"rZgCpJ"})]})]})]})}function Rc({accountID:n,info:i,open:o=!1,onlyOpenIfHasEndorsements:s=!1}){const{masto:a}=ie(),c=F(),[h,d]=E("default"),[r,l]=E([]),[p,m]=E({});return Z(()=>{Ve("@mastodon/endorsements")&&o&&(async()=>{d("loading");try{const b=await a.v1.accounts.$select(n).endorsements.list({limit:vc});if(!b.length){d("default");return}l(b),d("default"),setTimeout(()=>{c.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300);const v=await Dn(b,p);v&&m(v)}catch{d("error")}})()},[o,n]),(s?o&&r.length>0:o)?e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"endorsements-container",ref:c,children:[e("h3",{children:e(u,{id:"UIfdY1",values:{0:i.username}})}),h==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):r.length>0?e("ul",{class:`endorsements ${r.length>10?"expanded":""}`,children:r.map(b=>e("li",{children:e(lt,{account:b,showStats:!0,avatarSize:"xxl",relationship:p[b.id]},b.id)}))}):e("p",{class:"ui-state insignificant",children:e(u,{id:"AgkUZa"})})]})})}):null}function Lc({account:n,instance:i,onClose:o}){const{_:s}=ce(),{masto:a,instance:c,authenticated:h}=ie({instance:i}),d=typeof n=="string";return Z(()=>{d||(x.accounts[`${n.id}@${c}`]=n)},[n]),Hs(o),e("div",{class:"sheet",children:[!!o&&e("button",{type:"button",class:"sheet-close outer",onClick:o,children:e(C,{icon:"x",alt:s({id:"yz7wBu"})})}),e(Vs,{instance:c,authenticated:h,account:n,fetchAccount:async()=>{if(d)try{return await a.v1.accounts.lookup({acct:n,skip_webfinger:!1})}catch{const l=await a.v2.search.list({q:n,type:"accounts",limit:h?1:11,resolve:h});if(l.accounts.length){const p=l.accounts.find(m=>m.url===n||n.startsWith(m.url));if(p)return p}if(/^https?:\/\/[^/]+\/@[^/]+$/.test(n)){const p=URL.parse(n);if(p){const{hostname:m,pathname:f}=p,b=f.replace(/^\//,"").replace(/\/$/,"")+"@"+m,v=await a.v2.search.list({q:b,type:"accounts",limit:1,resolve:h});if(v.accounts.length)return v.accounts[0]}}}else return n}})]})}function Mc({onClose:n}){const{_:i}=ce(),{masto:o}=ie(),[s,a]=E("default"),[c,h]=E([]),[d,r]=Rt(p=>p+1,0);Z(()=>{a("loading"),(async()=>{try{const p=await ht.drafts.keys();if(p.length){const m=Tn(),f=p.filter(b=>b.startsWith(m));if(f.length){const b=await ht.drafts.getMany(f);b.sort((v,k)=>new Date(k.updatedAt).getTime()-new Date(v.updatedAt).getTime()),h(b)}else h([])}else h([]);a("default")}catch{a("error")}})()},[d]);const l=c?.length>0;return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(C,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(u,{id:"krk5ws"})," ",e(De,{abrupt:!0,hidden:s!=="loading"})]}),l&&e("div",{class:"insignificant",children:e(u,{id:"Ap/10+"})})]}),e("main",{children:l?e(D,{children:[e("ul",{class:"drafts-list",children:c.map(p=>{const{updatedAt:m,key:f,draftStatus:b,replyTo:v}=p,k=new Date(m);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(C,{icon:v?"reply":"quill",size:"s"})," ",e("time",{children:[!!v&&e(D,{children:[e("span",{class:"bidi-isolate",children:["@",v.account.acct]}),e("br",{})]}),tt(k)]})]}),e(rt,{confirmLabel:e("span",{children:e(u,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:s==="loading",onClick:()=>{(async()=>{try{await ht.drafts.del(f),r()}catch{alert(i({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:s==="loading",children:e(u,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:s==="loading",class:"draft-item",onClick:async()=>{let g;if(v){a("loading");try{g=await o.v1.statuses.$select(v.id).fetch()}catch{alert(i({id:"tMwimH"})),a("default");return}a("default")}window.__COMPOSE__={draftStatus:b,replyToStatus:g},x.showCompose=!0,x.showDrafts=!1},children:e($c,{draft:p})})]},m)})}),c.length>1&&e("p",{children:e(rt,{confirmLabel:e("span",{children:e(u,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:s==="loading",onClick:()=>{(async()=>{a("loading");try{await ht.drafts.delMany(c.map(p=>p.key)),a("default"),r()}catch{alert(i({id:"0J4sZq"})),a("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:s==="loading",children:e(u,{id:"hOg+Mt"})})})})]}):e("p",{children:e(u,{id:"8iQ+jk"})})})]})}function $c({draft:n}){const{_:i}=ce(),{draftStatus:o,replyTo:s}=n,{status:a,spoilerText:c,poll:h,mediaAttachments:d}=o,r=h?.options?.length>0,l=d?.length>0,p=r||l,m=Se(()=>{if(!l)return;const f=d.find(k=>/image/.test(k.type));if(!f)return;const{file:b}=f;return URL.createObjectURL(b)},[l,d]);return e(D,{children:e("div",{class:"mini-draft",children:[p&&e("div",{class:`mini-draft-aside ${m?"has-image":""}`,style:m?{"--bg-image":`url(${m})`}:{},children:[r&&e(C,{icon:"poll",alt:i({id:"4WUbF1"})}),l&&e("span",{children:[e(C,{icon:"attachment",alt:i({id:"xYilR2"})})," ",e("small",{children:d?.length})]})]}),e("div",{class:"mini-draft-main",children:[!!c&&e("div",{class:"mini-draft-spoiler",children:c}),!!a&&e("div",{class:"mini-draft-status",children:a})]})]})})}function Nc({html:n,url:i,width:o,height:s,onClose:a=()=>{}}){const{_:c}=ce();return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>a(),children:e(C,{icon:"x",alt:c({id:"yz7wBu"})})}),i&&e("a",{href:i,target:"_blank",rel:"noopener",class:"button plain",children:[e("span",{children:e(u,{id:"4/RpOy"})})," ",e(C,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:n},style:{"--width":o+"px","--height":s+"px","--aspect-ratio":`${o}/${s}`}})]})}function Pc({instance:n,excludeRelationshipAttrs:i=[],postID:o,onClose:s=()=>{},blankCopy:a}){const{_:c}=ce(),{masto:h,instance:d}=ie(),r=n?n===d:!0,l=qe(x),[p,m]=E("default"),[f,b]=E(!1);if(Hs(s),!l.showGenericAccounts)return null;const{id:v,heading:k,fetchAccounts:g,accounts:y,showReactions:S}=l.showGenericAccounts,[I,w]=E(y?.length?y:[]),[T,_]=E({}),A=async U=>{if(!U?.length||!r)return;const V=await Dn(U,T);V&&_({...T,...V})},L=U=>{g&&(U&&!I?.length&&w([]),m("loading"),(async()=>{try{const{done:V,value:J}=await g(U);if(Array.isArray(J)){if(U){const X=[];for(let j=0;joe.id===G.id&&j!==$);B?B._types.push(...G._types):X.push({_types:[],...G})}w(X)}else w(X=>{const j=X;for(const G of J){const B=j.find(oe=>oe.id===G.id);B?B._types.push(...G._types):j.push(G)}return j});b(!V),A(J)}else b(!1);m("default")}catch{m("error")}})())},M=F(!0);Z(()=>{I?.length>0?g?(L(!0),M.current=!1):A(I):(L(!0),M.current=!1)},[g]),Z(()=>{M.current||l.reloadGenericAccounts?.id===v&&L(!0)},[l.reloadGenericAccounts.counter]);const K=x.statuses[o];return e("div",{id:"generic-accounts-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(C,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:k||c({id:"bPwFdf"})})}),e("main",{children:[K&&e(ge,{to:`/${n||d}/s/${K.id}`,class:"post-preview",children:e(Ke,{status:K,size:"s",readOnly:!0})}),I.length>0?e(D,{children:[e("ul",{class:"accounts-list",children:I.map(U=>{const V=T[U.id],J=`${U.id}-${U._types?.length||""}`;return e("li",{children:[S&&U._types?.length>0&&e("div",{class:"reactions-block",children:U._types.map(X=>e(C,{icon:{reblog:"rocket",favourite:"heart"}[X],class:`${X}-icon`}))}),e("div",{class:"account-relationships",children:e(lt,{account:U,showStats:!0,relationship:V,excludeRelationshipAttrs:i})})]},J)})}),p==="default"?f?e(St,{onChange:U=>{U&&L()},children:e("button",{type:"button",class:"plain block",onClick:()=>L(),children:e(u,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(u,{id:"2EYeAZ"})}):p==="loading"&&e("p",{class:"ui-state",children:e(De,{abrupt:!0})})]}):p==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):p==="error"?e("p",{class:"ui-state",children:e(u,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:a||c({id:"10OlfF"})})]})]})}const Dc=140;function Oc({alt:n,lang:i,onClose:o}){const{_:s}=ce(),a=qe(x),[c,h]=E(!1),d=Ts(!0),r=a.settings.contentTranslationHideLanguages||[],l=!!i&&i!==d&&!xn([i],[d])&&!r.find(p=>i===p||xn([i],[p]));return Z(()=>{const p=n?.length>0&&n?.length<=Dc;l&&p&&h(!0)},[l,n]),e("div",{class:"sheet",tabindex:"-1",children:[!!o&&e("button",{type:"button",class:"sheet-close outer",onClick:o,children:e(C,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(u,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(st,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(C,{icon:"more",alt:s({id:"2FYpfJ"}),size:"xl"})}),children:[e(ve,{disabled:c,onClick:()=>{h(!0)},children:[e(C,{icon:"translate"}),e("span",{children:e(u,{id:"pi8x/S"})})]}),Wo&&e(ve,{onClick:()=>{Zo(n,i)},children:[e(C,{icon:"speak"}),e("span",{children:e(u,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:i,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:n}),(l||c)&&e(Rs,{forceTranslate:c,sourceLanguage:i,text:n})]})]})}const{min:jd,max:Yd}=Math;const Gs={};for(let n of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Gs[`[object ${n}]`]=n.toLowerCase();function zc(n){return Gs[Object.prototype.toString.call(n)]||"object"}const Zt=(n,i=null)=>n.length>=3?Array.prototype.slice.call(n):zc(n[0])=="object"&&i?i.split("").filter(o=>n[0][o]!==void 0).map(o=>n[0][o]):n[0].slice(0);const{PI:Un,min:Vd,max:Gd}=Math;const Wd=Un*2,Zd=Un/3,Bc=Un/180,Fc=180/Un;function Mn(n,i){let o=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(i[0])||(i=i.map(h=>[h]));let s=i[0].length,a=i[0].map((h,d)=>i.map(r=>r[d])),c=n.map(h=>a.map(d=>Array.isArray(h)?h.reduce((r,l,p)=>r+l*(d[p]||0),0):d.reduce((r,l)=>r+l*h,0)));return o===1&&(c=c[0]),s===1?c.map(h=>h[0]):c}const Ws={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 Yn=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},Uc=(n,i,o)=>{const{MtxAdaptMa:s,MtxAdaptMaI:a,MtxXYZ2RGB:c,RefWhiteRGB:h,Xn:d,Yn:r,Zn:l}=Ws,p=d*s.m00+r*s.m10+l*s.m20,m=d*s.m01+r*s.m11+l*s.m21,f=d*s.m02+r*s.m12+l*s.m22,b=h.X*s.m00+h.Y*s.m10+h.Z*s.m20,v=h.X*s.m01+h.Y*s.m11+h.Z*s.m21,k=h.X*s.m02+h.Y*s.m12+h.Z*s.m22,g=(n*s.m00+i*s.m10+o*s.m20)*(b/p),y=(n*s.m01+i*s.m11+o*s.m21)*(v/m),S=(n*s.m02+i*s.m12+o*s.m22)*(k/f),I=g*a.m00+y*a.m10+S*a.m20,w=g*a.m01+y*a.m11+S*a.m21,T=g*a.m02+y*a.m12+S*a.m22,_=Yn(I*c.m00+w*c.m10+T*c.m20),A=Yn(I*c.m01+w*c.m11+T*c.m21),L=Yn(I*c.m02+w*c.m12+T*c.m22);return[_*255,A*255,L*255]},xi=(...n)=>{n=Zt(n,"lab");const[i,o,s,...a]=n,[c,h,d]=Kc([i,o,s]),[r,l,p]=Uc(c,h,d);return[r,l,p,...a.length>0&&a[0]<1?[a[0]]:[]]};function Kc(n){var i=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],o=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],s=Mn(o,n);return Mn(i,s.map(a=>a**3))}function Vn(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 Hc=(n,i,o)=>{n=Vn(n/255),i=Vn(i/255),o=Vn(o/255);const{MtxRGB2XYZ:s,MtxAdaptMa:a,MtxAdaptMaI:c,Xn:h,Yn:d,Zn:r,As:l,Bs:p,Cs:m}=Ws;let f=n*s.m00+i*s.m10+o*s.m20,b=n*s.m01+i*s.m11+o*s.m21,v=n*s.m02+i*s.m12+o*s.m22;const k=h*a.m00+d*a.m10+r*a.m20,g=h*a.m01+d*a.m11+r*a.m21,y=h*a.m02+d*a.m12+r*a.m22;let S=f*a.m00+b*a.m10+v*a.m20,I=f*a.m01+b*a.m11+v*a.m21,w=f*a.m02+b*a.m12+v*a.m22;return S*=k/l,I*=g/p,w*=y/m,f=S*c.m00+I*c.m10+w*c.m20,b=S*c.m01+I*c.m11+w*c.m21,v=S*c.m02+I*c.m12+w*c.m22,[f,b,v]},Ei=(...n)=>{const[i,o,s,...a]=Zt(n,"rgb"),c=Hc(i,o,s);return[...qc(c),...a.length>0&&a[0]<1?[a[0]]:[]]};function qc(n){const i=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],o=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],s=Mn(i,n);return Mn(o,s.map(a=>Math.cbrt(a)))}const{sin:jc,cos:Yc}=Math,Vc=(...n)=>{let[i,o,s]=Zt(n,"lch");return isNaN(s)&&(s=0),s=s*Bc,[i,Yc(s)*o,jc(s)*o]},Gn=(...n)=>{n=Zt(n,"lch");const[i,o,s,...a]=n,[c,h,d]=Vc(i,o,s),[r,l,p]=xi(c,h,d);return[r,l,p,...a.length>0&&a[0]<1?[a[0]]:[]]},{sqrt:Gc,atan2:Wc,round:Zc}=Math,Xc=(...n)=>{const[i,o,s]=Zt(n,"lab"),a=Gc(o*o+s*s);let c=(Wc(s,o)*Fc+360)%360;return Zc(a*1e4)===0&&(c=Number.NaN),[i,a,c]},Jc=(...n)=>{const[i,o,s,...a]=Zt(n,"rgb"),[c,h,d]=Ei(i,o,s),[r,l,p]=Xc(c,h,d);return[r,l,p,...a.length>0&&a[0]<1?[a[0]]:[]]},Qc={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:Xd}=Qc;function Zs({mediaAttachments:n,statusID:i,instance:o,lang:s,index:a=0,onClose:c=()=>{}}){const{_:h}=ce(),[d,r]=E("default"),l=F(null),[p,m]=E(a),f=F(null);vt(()=>{f.current?.scrollIntoView()},[]);const b=F(i);Z(()=>{const w=a*l.current.clientWidth,T=b.current!==i;T&&(b.current=i),l.current.focus(),l.current.scrollTo({left:w*(Nt()?-1:1),behavior:T?"auto":"smooth"})},[a,i]);const[v,k]=E(!0);Z(()=>{let w=T=>{c(T,p,n,l)};return l.current&&l.current.addEventListener("swiped-down",w),()=>{l.current&&l.current.removeEventListener("swiped-down",w)}},[p,n]),ze("esc",w=>{c(w,p,n,l)},{ignoreEventWhen:w=>!!document.querySelector("#modal-container > *")||w.metaKey||w.ctrlKey||w.altKey||w.shiftKey,useKey:!0},[c,p,n]),Z(()=>{let w=()=>{const{clientWidth:T,scrollLeft:_}=l.current,A=Math.round(Math.abs(_)/T);m(A)};return l.current&&l.current.addEventListener("scroll",w,{passive:!0}),()=>{l.current&&l.current.removeEventListener("scroll",w)}},[]),Z(()=>{let w=setTimeout(()=>{l.current?.focus?.()},100);return()=>clearTimeout(w)},[]);const g=Se(()=>n?.map(w=>{const{blurhash:T}=w;if(T){const _=gi(T);return Jc(_)}return null}),[n]),y=Se(()=>g?.map(w=>w?{light:Gn([.95,.01,w[2]]),dark:Gn([.35,.01,w[2]]),default:Gn([.6,w[1],w[2]])}:null)),S=Se(()=>{const T=100/y.length,_=y.map((M,K)=>{const U=K*T+5,V=(K+1)*T-5;return M?.light&&M?.dark?{light:` rgb(${M.light?.join(",")}) ${U}%, rgb(${M.light?.join(",")}) ${V}% `,dark:` rgb(${M.dark?.join(",")}) ${U}%, rgb(${M.dark?.join(",")}) ${V}% `}:{light:` transparent ${U}%, transparent ${V}% `,dark:` transparent ${U}%, transparent ${V}% `}}),A=_.map(M=>M.light).join(", "),L=_.map(M=>M.dark).join(", ");return{light:A,dark:L}},[y]);let I=F(null);return Z(()=>()=>{I.current?.hideToast?.()},[]),vt(()=>{const w=y[p];let T,_;if(w){const A=Re.local.get("theme");if(A){const L=`rgb(${w[A].join(",")})`;T=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),T&&(_=T.content,T.content=L)}else{const L=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",M=`rgb(${w[L].join(",")})`;T=document.querySelector(`meta[name="theme-color"][media*="${L}"]`),T&&(_=T.content,T.content=M)}}return()=>{T&&_&&(T.content=_)}},[p,y]),e("div",{class:`media-modal-container media-modal-count-${n?.length}`,children:[e("div",{ref:l,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:w=>{(w.target.classList.contains("carousel-item")||w.target.classList.contains("media")||w.target.classList.contains("media-zoom"))&&c(w,p,n,l)},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":S?.light,"--accent-gradient-dark":S?.dark}:{},children:n?.map((w,T)=>{const _=n.length===1?y[T]:null;return e("div",{class:"carousel-item",style:_?{"--accent-color":`rgb(${_.default.join(",")})`,"--accent-light-color":`rgb(${_.light?.join(",")})`,"--accent-dark-color":`rgb(${_.dark?.join(",")})`,"--accent-alpha-color":`rgba(${_.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:T===p?f:null,onClick:A=>{A.target.classList.contains("media")||k(!v)},children:[!!w.description&&e("button",{type:"button",class:"media-alt",hidden:!v,onClick:()=>{x.showMediaAlt={alt:w.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:w.description})]}),e(Ls,{media:w,showOriginal:!0,lang:s})]},w.id)})}),e("div",{class:"carousel-top-controls",hidden:!v,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:w=>c(w,p,n,l),children:e(C,{icon:"x",alt:h({id:"yz7wBu"})})})}),n?.length>1?e("span",{class:"carousel-dots",children:n?.map((w,T)=>e("button",{type:"button",disabled:T===p,class:`carousel-dot ${T===p?"active":""}`,onClick:_=>{_.preventDefault(),_.stopPropagation();const A=l.current.clientWidth*T*(Nt()?-1:1);l.current.focus(),l.current.scrollTo({left:A,behavior:"smooth"})},children:e(C,{icon:"round",size:"s",alt:"โธฑ"})},w.id))}):e("span",{}),e("span",{children:[e(st,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(C,{icon:"more",alt:h({id:"2FYpfJ"})})}),children:[e(Fe,{href:n[p]?.remoteUrl||n[p]?.url,class:"carousel-button",target:"_blank",title:h({id:"5hXGws"}),children:[e(C,{icon:"popout"}),e("span",{children:e(u,{id:"aDr7Vc"})})]}),!1]})," ",!!i&&e(ge,{to:`${o?`/${o}`:""}/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(u,{id:"ISg5SQ"})," "]}),"ยป"]})]})]}),n?.length>1&&e("div",{class:"carousel-controls",hidden:!v,children:[e("button",{type:"button",class:"carousel-button",hidden:p===0,onClick:w=>{w.preventDefault(),w.stopPropagation(),l.current.focus(),l.current.scrollTo({left:l.current.clientWidth*(p-1)*(Nt()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-left",alt:h({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:p===n.length-1,onClick:w=>{w.preventDefault(),w.stopPropagation(),l.current.focus(),l.current.scrollTo({left:l.current.clientWidth*(p+1)*(Nt()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-right",alt:h({id:"hXzOVo"})})})]})]})}const el=["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 tl(n,i){if(!n.translations||!i)return null;const o=Object.keys(n.translations);if(!o?.length)return null;let s=xn([i],o,null);if(!s){const a=o.map(c=>c.split(/(?=[A-Z])/).map((d,r)=>r===0?d:d.toLowerCase()).join("-"));s=xn([i],a,null)}if(s&&s.includes("-")){const[a,c]=s.split("-");s=a+c.charAt(0).toUpperCase()+c.slice(1)}return s}function nl(n,i){return n?.length?i?n.map(o=>{const s=tl(o,i);return{...o,_translatedText:o.translations?.[s]?.text||null}}):n:[]}function il({account:n,post:i,onClose:o}){const{_:s,_:a,i18n:c}=ce(),{masto:h}=ie(),[d,r]=E("default"),[l,p]=n.acct.split("@"),[m,f]=Se(()=>{const{rules:w,domain:T}=vs();return[nl(w||[],c.locale),T]},[c.locale]),[b,v]=E(null),[k,g]=E(!1),y=F(null),[S,I]=E(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:a(i?{id:"muLhL3"}:{id:"ACul2G",values:{username:l}})}),e("button",{type:"button",class:"plain4 small",disabled:d==="loading",onClick:()=>o(),children:e(C,{icon:"x",size:"xl",alt:a({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:i?e(Ke,{status:i,size:"s",previewMode:!0}):e(lt,{account:n,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!b&&!Xt[b].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[s(Xt[b].stampLabel||s(Xt[b].label)),e("small",{children:e(u,{id:"2WtL62"})})]},b),e("form",{onSubmit:w=>{w.preventDefault();const T=new FormData(w.target),_=Object.fromEntries(T.entries());let{category:A,comment:L,forward:M}=_;L||(L=void 0),M==="on"&&(M=!0);const K=A==="violation"?Object.entries(_).filter(([V])=>V.startsWith("rule_ids")).map(([V,J])=>J):void 0,U={category:A,comment:L,forward:M,ruleIds:K};r("loading"),(async()=>{try{await h.v1.reports.create({accountId:n.id,statusIds:i?.id?[i.id]:void 0,category:A,comment:L,ruleIds:K,forward:M}),r("success"),he(a(i?{id:"y3ou+8"}:{id:"R9kjEL"})),o()}catch(V){r("error"),he(V?.message||a(i?{id:"+3FjPq"}:{id:"oEQq5w"}))}})()},children:[e("p",{children:a(i?{id:"L9fUm+"}:{id:"rSLkfe"})}),e("section",{class:"report-categories",children:el.map(w=>w==="violation"&&!m?.length?null:e(D,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:w,required:!0,disabled:d==="loading",onChange:T=>{v(T.target.value),g(T.target.value==="violation")}}),e("span",{children:[s(Xt[w].label)," ย ",e("small",{class:"ib insignificant",children:s(Xt[w].description)})]})]}),w==="violation"&&!!m?.length&&e("div",{class:"shazam-container no-animation",hidden:!k,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:y,children:m.map((T,_)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${_}]`,value:T.id,required:k&&!S,disabled:d==="loading",onChange:A=>{const{checked:L}=A.target;L?I(!0):y.current.querySelectorAll("input:checked").length||I(!1)}}),e("span",{children:T._translatedText||T.text})]},T.id))})})})]},w))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(u,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:d==="loading",required:!i})]}),!!p&&p!==f&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:d==="loading"})," ",e("span",{children:e(u,{id:"cyjS8M",values:{domain:p},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:d==="loading",children:e(u,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:d==="loading",onClick:async()=>{try{await h.v1.accounts.$select(n.id).mute(),he(a({id:"/BGBeF",values:{username:l}}))}catch{he(a({id:"v02K7/",values:{username:l}}))}},children:e(u,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:d==="loading",onClick:async()=>{try{await h.v1.accounts.$select(n.id).block(),he(a({id:"kjUejn",values:{username:l}}))}catch{he(a({id:"pMcdDp",values:{username:l}}))}},children:e(u,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(De,{hidden:d!=="loading"})]})]})]})]})}var yn={exports:{}},Jd=yn.exports,Gi;function sl(){return Gi||(Gi=1,function(n){var i=function(){var o=String.fromCharCode,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",c={};function h(r,l){if(!c[r]){c[r]={};for(var p=0;p>>8,p[m*2+1]=b%256}return p},decompressFromUint8Array:function(r){if(r==null)return d.decompress(r);for(var l=new Array(r.length/2),p=0,m=l.length;p>1}else{for(f=1,m=0;m>1}S--,S==0&&(S=Math.pow(2,w),w++),delete v[y]}else for(f=b[y],m=0;m>1;S--,S==0&&(S=Math.pow(2,w),w++),b[g]=I++,y=String(k)}if(y!==""){if(Object.prototype.hasOwnProperty.call(v,y)){if(y.charCodeAt(0)<256){for(m=0;m>1}else{for(f=1,m=0;m>1}S--,S==0&&(S=Math.pow(2,w),w++),delete v[y]}else for(f=b[y],m=0;m>1;S--,S==0&&(S=Math.pow(2,w),w++)}for(f=2,m=0;m>1;for(;;)if(_=_<<1,A==l-1){T.push(p(_));break}else A++;return T.join("")},decompress:function(r){return r==null?"":r==""?null:d._decompress(r.length,32768,function(l){return r.charCodeAt(l)})},_decompress:function(r,l,p){var m=[],f,b=4,v=4,k=3,g="",y=[],S,I,w,T,_,A,L,M={val:p(0),position:l,index:1};for(S=0;S<3;S+=1)m[S]=S;for(w=0,_=Math.pow(2,2),A=1;A!=_;)T=M.val&M.position,M.position>>=1,M.position==0&&(M.position=l,M.val=p(M.index++)),w|=(T>0?1:0)*A,A<<=1;switch(f=w){case 0:for(w=0,_=Math.pow(2,8),A=1;A!=_;)T=M.val&M.position,M.position>>=1,M.position==0&&(M.position=l,M.val=p(M.index++)),w|=(T>0?1:0)*A,A<<=1;L=o(w);break;case 1:for(w=0,_=Math.pow(2,16),A=1;A!=_;)T=M.val&M.position,M.position>>=1,M.position==0&&(M.position=l,M.val=p(M.index++)),w|=(T>0?1:0)*A,A<<=1;L=o(w);break;case 2:return""}for(m[3]=L,I=L,y.push(L);;){if(M.index>r)return"";for(w=0,_=Math.pow(2,k),A=1;A!=_;)T=M.val&M.position,M.position>>=1,M.position==0&&(M.position=l,M.val=p(M.index++)),w|=(T>0?1:0)*A,A<<=1;switch(L=w){case 0:for(w=0,_=Math.pow(2,8),A=1;A!=_;)T=M.val&M.position,M.position>>=1,M.position==0&&(M.position=l,M.val=p(M.index++)),w|=(T>0?1:0)*A,A<<=1;m[v++]=o(w),L=v-1,b--;break;case 1:for(w=0,_=Math.pow(2,16),A=1;A!=_;)T=M.val&M.position,M.position>>=1,M.position==0&&(M.position=l,M.val=p(M.index++)),w|=(T>0?1:0)*A,A<<=1;m[v++]=o(w),L=v-1,b--;break;case 2:return y.join("")}if(b==0&&(b=Math.pow(2,k),k++),m[L])g=m[L];else if(L===v)g=I+I.charAt(0);else return null;y.push(g),m[v++]=I+g.charAt(0),b--,I=g,b==0&&(b=Math.pow(2,k),k++)}}};return d}();n!=null?n.exports=i:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return i})}(yn)),yn.exports}var Wi=sl();const ol="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",al="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",cl="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",ll=200,rl=10;async function $n(){const{masto:n}=ie(),i=n.v1.followedTags.list({limit:ll}).values(),o=[];let s=0;do{const{value:a,done:c}=await i.next();if(c||a?.length===0)break;o.push(...a),s++}while(sa.name.localeCompare(c.name)),o.length&&setTimeout(()=>{Re.account.set("followedTags",{tags:o,updatedAt:Date.now()})},1),o}const dl=24*60*60*1e3;async function ul(){try{const{tags:n,updatedAt:i}=Re.account.get("followedTags")||{};return n?.length?(Date.now()-i>dl&&$n(),n):await $n()}catch{return[]}}const Zi=document.createElement("div"),hl=n=>{if(!n)return[];if(n.indexOf("#")===-1)return[];Zi.innerHTML=n;const i=Zi.querySelectorAll("a.hashtag");return i.length?Array.from(i).map(o=>o.innerText.trim().replace(/^[^#]*#+/,"")):[]};function wn({children:n}){if(typeof n=="string")return n;const[i,o]=E("");return Z(()=>{Promise.resolve(n).then(o)},[n]),i}const kt=9,pl=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],Xs={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"}},kn={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}]},fl=ft(async({id:n})=>{const i=await ie().masto.v1.accounts.$select(n).fetch();return i.username||i.acct||i.displayName}),Nn={following:{id:"home",title:(n,i)=>i===0?fe._({id:"i0qMbr"}):fe._({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?rc(n):fe._({id:"h16FyT"}),path:({id:n})=>n?`/l/${n}`:"/l",icon:"list",excludeViewMode:({id:n})=>n?[]:["multi-column"]},public:{id:"public",title:({local:n})=>n?fe._({id:"d5zxa4"}):fe._({id:"4ERYY7"}),subtitle:({instance:n})=>n||ie().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||ie().instance,path:({instance:n})=>`/${n}/trending`,icon:"chart"},search:{id:"search",title:({query:n})=>n?`โ€œ${n}โ€`:fe._({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:fl,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||ie().instance,path:({hashtag:n,instance:i,media:o})=>`${i?`/${i}`:""}/t/${n.split(/\s+/).join("+")}${o?"?media=1":""}`,icon:"hashtag"}};function ml({onClose:n}){const{_:i}=ce(),o=qe(x),{shortcuts:s}=o,[a,c]=E(!1),[h,d]=E(!1),[r]=Si();return e("div",{id:"shortcuts-settings-container",class:"sheet",tabindex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(C,{icon:"x",alt:fe._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(C,{icon:"shortcut"})," ",e(u,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(u,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(u,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:fe._({id:"qwdOim"}),imgURL:ol},{value:"tab-menu-bar",label:fe._({id:"UxBoCm"}),imgURL:cl},{value:"multi-column",label:fe._({id:"uvDfdW"}),imgURL:al}].map(({value:l,label:p,imgURL:m})=>{const f=o.settings.shortcutsViewMode===l||l==="float-button"&&!o.settings.shortcutsViewMode;return e("label",{class:f?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:l,checked:f,onChange:b=>{x.settings.shortcutsViewMode=b.target.value}})," ",e("img",{src:m,alt:"",width:"80",height:"58"})," ",e("span",{children:p})]},l)})}),s.length>0?e(D,{children:[e("ol",{class:"shortcuts-list",ref:r,children:s.filter(Boolean).map((l,p)=>{const m=Object.values(l).join("-"),{type:f}=l;if(!Nn[f])return null;let{icon:b,title:v,subtitle:k,excludeViewMode:g}=Nn[f];typeof v=="function"?v=v(l,p):v=i(v),typeof k=="function"?k=k(l,p):k=i(k),typeof b=="function"&&(b=b(l,p)),typeof g=="function"&&(g=g(l,p));const y=g?.includes(o.settings.shortcutsViewMode);return e("li",{children:[e(C,{icon:b}),e("span",{class:"shortcut-text",children:[e(wn,{children:v}),k&&e(D,{children:[" ",e("small",{class:"ib insignificant",children:k})]}),y&&e("span",{class:"tag",children:e(u,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:p===0,onClick:()=>{const S=Array.from(x.shortcuts);if(p>0){const I=x.shortcuts[p-1];S[p-1]=l,S[p]=I,x.shortcuts=S}},children:e(C,{icon:"arrow-up",alt:fe._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:p===s.length-1,onClick:()=>{const S=Array.from(x.shortcuts);if(p{c({shortcut:l,shortcutIndex:p})},children:e(C,{icon:"pencil",alt:fe._({id:"ePK91l"})})})]})]},m)})}),s.length===1&&o.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(C,{icon:"info"})," ",e("small",{children:e(u,{id:"3Xq4Zi"})})]})]}):e("div",{class:"ui-state insignificant",children:[e("p",{children:o.settings.shortcutsViewMode==="multi-column"?fe._({id:"3xIN+E"}):fe._({id:"vLxvHT"})}),e("p",{children:e(u,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:l=>{l.preventDefault(),x.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:s.length>=kt&&(o.settings.shortcutsViewMode==="multi-column"?fe._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:kt}}):fe._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:kt}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>d(!0),children:e(u,{id:"bgVLbt"})}),e("button",{type:"button",disabled:s.length>=kt,onClick:()=>c(!0),children:[e(C,{icon:"plus"})," ",e("span",{children:o.settings.shortcutsViewMode==="multi-column"?fe._({id:"Vh3ADI"}):fe._({id:"9tmn6W"})})]})]})]}),a&&e(Be,{onClick:l=>{l.target===l.currentTarget&&c(!1)},children:e(gl,{shortcut:a.shortcut,shortcutIndex:a.shortcutIndex,onSubmit:({result:l,mode:p})=>{p==="edit"?x.shortcuts[a.shortcutIndex]=l:x.shortcuts.push(l)},onClose:()=>c(!1)})}),h&&e(Be,{onClick:l=>{l.target===l.currentTarget&&d(!1)},children:e(bl,{shortcuts:s,onClose:()=>d(!1)})})]})}const Xi={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function gl({onSubmit:n,disabled:i,shortcut:o,shortcutIndex:s,onClose:a}){const{_:c}=ce(),h=!!o,[d,r]=E(o?.type||null),[l,p]=E("default"),[m,f]=E([]),[b,v]=E([]);Z(()=>{(async()=>{if(d==="list")try{p("loading");const g=await rn();f(g),p("default")}catch{p("error")}})(),(async()=>{if(d==="hashtag")try{const g=await $n();v(g)}catch{}})()},[d]);const k=F();return Z(()=>{if(h&&d&&kn[d]){const g=k.current;kn[d].forEach(({name:y,type:S})=>{const I=g.querySelector(`[name="${y}"]`);I&&o[y]&&(S==="checkbox"?I.checked=o[y]==="on":I.value=o[y])})}},[h,d]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!a&&e("button",{type:"button",class:"sheet-close",onClick:a,children:e(C,{icon:"x",alt:fe._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:h?fe._({id:"pe1jog"}):fe._({id:"Lsxpe5"})})}),e("main",{tabindex:"-1",children:e("form",{ref:k,onSubmit:g=>{g.preventDefault();const y=new FormData(g.target),S={};y.forEach((I,w)=>{S[w]=I?.trim(),w==="instance"&&(S[w]=S[w].replace(/^https?:\/\//,"").replace(/\/+$/,""),S[w]=S[w].replace(/^@?[^@]+@/,""))}),S.type&&(n({result:S,mode:h?"edit":"add"}),g.target.reset(),r(null),a?.())},children:[e("p",{children:e("label",{children:[e("span",{children:e(u,{id:"cklVjM"})}),e("select",{required:!0,disabled:i,onChange:g=>{r(g.target.value)},defaultValue:h?o.type:void 0,name:"type",dir:"auto",children:[e("option",{}),pl.map(g=>e("option",{value:g,children:c(Xs[g])}))]})]})}),kn[d]?.map?.(({text:g,name:y,type:S,placeholder:I,pattern:w,notRequired:T})=>d==="list"?e("p",{children:e("label",{children:[e("span",{children:e(u,{id:"2BBAbc"})}),e("select",{name:"id",required:!T,disabled:i||l==="loading",defaultValue:h?o.id:void 0,dir:"auto",children:[e("option",{value:""}),m.map(_=>e("option",{value:_.id,children:_.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:c(g)})," ",e("input",{type:S,switch:S==="checkbox"||void 0,name:y,placeholder:c(I),required:S==="text"&&!T,disabled:i,list:d==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:w,dir:"auto"}),d==="hashtag"&&b.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:b.map(_=>e("option",{value:_.name}))})]})})),!!Xi[d]&&e("p",{class:"form-note insignificant",children:[e(C,{icon:"info"}),c(Xi[d])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:i||l==="loading",children:h?fe._({id:"tfDRzk"}):fe._({id:"m16xKo"})}),h&&e("button",{type:"button",class:"light danger",onClick:()=>{x.shortcuts.splice(s,1),a?.()},children:e(u,{id:"t/YqKh"})})]})]})})]})}function bl({shortcuts:n,onClose:i}){const{_:o}=ce(),{masto:s}=ie(),a=Se(()=>!n||!n.filter(Boolean).length?"":Wi.compressToEncodedURIComponent(JSON.stringify(n.filter(Boolean))),[n]),[c,h]=E(""),[d,r]=E("default"),l=Se(()=>{if(!c)return r("default"),null;try{const f=JSON.parse(Wi.decompressFromEncodedURIComponent(c));if(!Array.isArray(f))throw new Error("Not an array");return r("default"),f}catch{try{const b=JSON.parse(c);if(!Array.isArray(b))throw new Error("Not an array");return r("default"),b}catch{return r("error"),null}}},[c]),p=x.shortcuts.length>0,m=F();return e("div",{id:"import-export-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(C,{icon:"x",alt:fe._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(C,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(u,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:m,type:"text",name:"import",placeholder:fe._({id:"tBmklN"}),class:"block",onInput:f=>{h(f.target.value)},dir:"auto"}),x.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:d==="cloud-downloading",onClick:async()=>{r("cloud-downloading");const f=bt();he(fe._({id:"HLqLGx"}));try{const v=(await s.v1.accounts.relationships.fetch({id:[f]}))[0];if(v){const{note:k=""}=v;if(/(.*)<\/phanpy-shortcuts-settings>/.test(k)){const g=k.match(/(.*)<\/phanpy-shortcuts-settings>/)[1],{v:y,dt:S,data:I}=JSON.parse(g);m.current.value=I,m.current.dispatchEvent(new Event("input"))}}r("default")}catch{r("error"),he(fe._({id:"gCDfX+"}))}},title:fe._({id:"B6cG3J"}),children:[e(C,{icon:"cloud"}),e(C,{icon:"arrow-down"})]})]}),!!l&&Array.isArray(l)&&e(D,{children:[e("p",{children:[e("b",{children:l.length})," shortcut",l.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",c.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:l.map(f=>e("li",{children:[e("span",{style:{opacity:n.some(b=>Object.keys(b).every(v=>b[v]===f[v]))?1:0},children:"*"}),e("span",{children:[o(Xs[f.type]),f.type==="list"&&" โš ๏ธ"," ",kn[f.type]?.map?.(({text:b,name:v,type:k})=>f[v]?e(D,{children:[e("span",{class:"tag collapsed insignificant",children:[b,":"," ",k==="checkbox"?f[v]==="on"?"โœ…":"โŒ":f[v]]})," "]}):null)]})]}))}),e("p",{children:[e("small",{children:e(u,{id:"o6sElH"})}),e("br",{}),e("small",{children:["โš ๏ธ"," ",e(u,{id:"N4z4P/"})]})]})]}),d==="error"&&e("p",{class:"error",children:e("small",{children:["โš ๏ธ ",e(u,{id:"ZhsPEb"})]})}),e("p",{children:[p&&e(D,{children:[e(rt,{confirmLabel:fe._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(u,{id:"nl8sCE"})}),onClick:()=>{const f=l.filter(k=>!x.shortcuts.some(g=>Object.keys(g).every(y=>g[y]===k[y])));if(!f.length){he(fe._({id:"o6L30P"}));return}let b=[...x.shortcuts,...f];const v=b.length>kt;v&&(b=b.slice(0,kt)),x.shortcuts=b,he(v?fe._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:kt}}):fe._({id:"QO9uTx"})),i?.()},children:e("button",{type:"button",class:"plain2",disabled:!l,children:e(u,{id:"c89gCv"})})})," "]}),e(rt,{confirmLabel:p?fe._({id:"6ZjzWP"}):fe._({id:"DWumLi"}),menuItemClassName:p?"danger":void 0,onClick:()=>{x.shortcuts=l,he(fe._({id:"QO9uTx"})),i?.()},children:e("button",{type:"button",class:"plain2",disabled:!l,children:p?fe._({id:"uIp8WL"}):fe._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(C,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(u,{id:"GS+Mus"})})]}),e("p",{children:e("input",{style:{width:"100%"},type:"text",value:a,readOnly:!0,onClick:f=>{if(f.target.value){f.target.select();try{navigator.clipboard.writeText(f.target.value),he(fe._({id:"cWtH+v"}))}catch{he(fe._({id:"yUWyHa"}))}}},dir:"auto"})}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!a,onClick:()=>{try{navigator.clipboard.writeText(a),he(fe._({id:"+Kq2vY"}))}catch{he(fe._({id:"tFvxZF"}))}},children:[e(C,{icon:"clipboard"})," ",e("span",{children:e(u,{id:"he3ygx"})})]})," ",navigator?.share&&navigator?.canShare?.({text:a})&&e("button",{type:"button",class:"plain2",disabled:!a,onClick:()=>{try{navigator.share({text:a})}catch{alert(fe._({id:"TtG3Uh"}))}},children:[e(C,{icon:"share"})," ",e("span",{children:e(u,{id:"Z8lGw6"})})]})," ",x.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2",disabled:d==="cloud-uploading",onClick:async()=>{r("cloud-uploading");const f=bt();try{const v=(await s.v1.accounts.relationships.fetch({id:[f]}))[0];if(v){const{note:k=""}=v;let g="";const y=JSON.stringify({v:"1",dt:Date.now(),data:a});/(.*)<\/phanpy-shortcuts-settings>/.test(k)?g=k.replace(/(.*)<\/phanpy-shortcuts-settings>/,`${y}`):g=`${k} ${y}`,he(fe._({id:"9ZYiLz"})),await s.v1.accounts.$select(f).note.create({comment:g}),r("default"),he(fe._({id:"5w02SH"}))}}catch{r("error"),he(fe._({id:"aVsTYo"}))}},title:fe._({id:"gWd6Cu"}),children:[e(C,{icon:"cloud"}),e(C,{icon:"arrow-up"})]})," ",a.length>0&&e("small",{class:"insignificant ib",children:e(u,{id:"IPXOXm",values:{0:a.length}})})]}),!!a&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(u,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),x.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(C,{icon:"cloud"})," ",e(u,{id:"C4T6O/"})]})})]})]})}ys(x,n=>{for(const[i,o,s,a]of n)/^show/i.test(o)&&!s&&ni()});function vl(){const{_:n}=ce(),i=qe(x),o=ws(),s=Wt();return Z(()=>{setTimeout(xo,1e3)},[]),e(D,{children:[!!i.showCompose&&e(Be,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(Eo,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:window.__COMPOSE__?.replyToStatus||null,editStatus:x.showCompose?.editStatus||window.__COMPOSE__?.editStatus||null,draftStatus:x.showCompose?.draftStatus||window.__COMPOSE__?.draftStatus||null,onClose:a=>{const{newStatus:c,instance:h,type:d,scheduledAt:r}=a||{};x.showCompose=!1,window.__COMPOSE__=null,c&&(x.reloadStatusPage++,r&&x.reloadScheduledPosts++,he({text:{post:n(r?{id:"IrX0sj"}:{id:"aTyHBW"}),reply:n(r?{id:"+38pse"}:{id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[d||"post"],delay:1e3,duration:1e4,onClick:l=>{l.hideToast(),x.prevLocation=s,o(r?"/sp":h?`/${h}/s/${c.id}`:`/s/${c.id}`)}}))}})}),!!i.showSettings&&e(Be,{onClose:()=>{x.showSettings=!1},children:e(oc,{onClose:()=>{x.showSettings=!1}})}),!!i.showAccounts&&e(Be,{onClose:()=>{x.showAccounts=!1},children:e(Ya,{onClose:()=>{x.showAccounts=!1}})}),!!i.showAccount&&e(Be,{onClose:()=>{x.showAccount=!1},children:e(Lc,{account:i.showAccount?.account||i.showAccount,instance:i.showAccount?.instance,onClose:({destination:a}={})=>{x.showAccount=!1}})}),!!i.showDrafts&&e(Be,{onClose:()=>{x.showDrafts=!1},children:e(Mc,{onClose:()=>x.showDrafts=!1})}),!!i.showMediaModal&&e(Be,{onClick:a=>{(a.target===a.currentTarget||a.target.classList.contains("media"))&&(x.showMediaModal=!1)},children:e(Zs,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.mediaIndex,statusID:i.showMediaModal.statusID,onClose:()=>{x.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(Be,{onClose:()=>{x.showShortcutsSettings=!1},children:e(ml,{onClose:()=>x.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(Be,{onClose:()=>{x.showGenericAccounts=!1},children:e(Pc,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>x.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(Be,{onClose:a=>{x.showMediaAlt=!1},children:e(Oc,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:i.showMediaAlt?.lang,onClose:()=>{x.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(Be,{class:"solid",onClose:()=>{x.showEmbedModal=!1},children:e(Nc,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{x.showEmbedModal=!1}})}),!!i.showReportModal&&e(Be,{onClose:()=>{x.showReportModal=!1},children:e(il,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{x.showReportModal=!1}})})]})}function si({accountID:n,onChange:i}){const{_:o}=ce(),{masto:s}=ie(),[a,c]=E("default"),[h,d]=E(null),[r,l]=E(null),p=r!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:a==="loading"||p,onClick:()=>{c("loading"),d("accept"),(async()=>{try{const m=await s.v1.followRequests.$select(n).authorize();if(!m?.followedBy)throw new Error("Follow request not accepted");l(m),i()}catch{}c("default")})()},children:e(u,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:a==="loading"||p,class:"light danger",onClick:()=>{c("loading"),d("reject"),(async()=>{try{const m=await s.v1.followRequests.$select(n).reject();if(m?.followedBy)throw new Error("Follow request not rejected");l(m),i()}catch{c("default")}})()},children:e(u,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:p&&h?h==="accept"?e(C,{icon:"check-circle",alt:o({id:"bzMKg7"}),class:"follow-accepted"}):e(C,{icon:"x-circle",alt:o({id:"ekCRTP"}),class:"follow-rejected"}):e(De,{hidden:a!=="loading"})})]})}const Ji={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 Qi({account:n,emoji:i,emoji_url:o}){let s,a;typeof o=="string"?s=o:(s=o?.url,a=o?.staticUrl);const c=s?e(Xo,{url:s,staticUrl:a,alt:i}):i;return e(u,{id:"i5uN6K",values:{account:n,emojiObject:c}})}const Wn={status:({account:n})=>e(u,{id:"idiIxW",values:{account:n}}),reblog:({count:n,account:i,postsCount:o,postType:s,components:{Subject:a}})=>e(u,{id:"jkt9P5",values:{0:Ge(n),1:Ge(n),count:n,postsCount:o,postType:s,account:i},components:{0:e(a,{clickable:n>1}),1:e("span",{title:n}),2:e(a,{clickable:n>1}),3:e("span",{title:n})}}),follow:({account:n,count:i,components:{Subject:o}})=>e(u,{id:"+71G9C",values:{0:Ge(i),count:i,account:n},components:{0:e(o,{clickable:i>1}),1:e("span",{title:i})}}),follow_request:({account:n})=>e(u,{id:"eh6NHW",values:{account:n}}),favourite:({account:n,count:i,postsCount:o,postType:s,components:{Subject:a}})=>e(u,{id:"RqX1mR",values:{0:Ge(i),1:Ge(i),count:i,postsCount:o,postType:s,account:n},components:{0:e(a,{clickable:i>1}),1:e("span",{title:i}),2:e(a,{clickable:i>1}),3:e("span",{title:i})}}),poll:()=>fe._({id:"kIlJaS"}),"poll-self":()=>fe._({id:"kpjzdN"}),"poll-voted":()=>fe._({id:"moT7M8"}),update:()=>fe._({id:"uzt17m"}),"favourite+reblog":({count:n,account:i,postsCount:o,postType:s,components:{Subject:a}})=>e(u,{id:"NunZZQ",values:{0:Ge(n),1:Ge(n),count:n,postsCount:o,postType:s,account:i},components:{0:e(a,{clickable:n>1}),1:e("span",{title:n}),2:e(a,{clickable:n>1}),3:e("span",{title:n})}}),"admin.sign_up":({account:n})=>e(u,{id:"fJCCpx",values:{account:n}}),"admin.report":({account:n,targetAccount:i})=>e(u,{id:"eNfCmq",values:{account:n,targetAccount:i}}),severed_relationships:({name:n})=>e(u,{id:"Xl9v6+",values:{name:n},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(u,{id:"YqffEv"})}),emoji_reaction:Qi,"pleroma:emoji_reaction":Qi,annual_report:({year:n})=>e(u,{id:"INLTzH",values:{year:n}})},yl={account_suspension:({from:n,targetName:i})=>e(u,{id:"uRkcgw",values:{from:n,targetName:i},components:{0:e("i",{}),1:e("i",{})}}),domain_block:({from:n,targetName:i,followersCount:o,followingCount:s})=>e(u,{id:"Q3yArs",values:{from:n,targetName:i,followersCount:o,followingCount:s},components:{0:e("i",{}),1:e("i",{})}}),user_domain_block:({targetName:n,followersCount:i,followingCount:o})=>e(u,{id:"RQKWUa",values:{targetName:n,followersCount:i,followingCount:o},components:{0:e("i",{})}})},wl={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"}},Zn=30;function kl({notification:n,instance:i,isStatic:o,disableContextMenu:s}){const{_:a}=ce(),{masto:c}=ie(),{id:h,status:d,account:r,report:l,event:p,moderation_warning:m,annualReport:f,_ids:b,_accounts:v,_statuses:k,_groupKeys:g,sampleAccounts:y,notificationsCount:S,groupKey:I,_notificationsCount:w,_sampleAccountsCount:T}=n;let{type:_}=n;if(_==="mention"&&!d)return null;const A=d?.reblog||d,L=A?.id,M=bt(),K=M===r?.id,U=d?.poll?.voted,V=!!d?.inReplyToAccountId&&d?.inReplyToAccountId!==M&&d?.account?.id===M;let J=0,X=0;if(_==="favourite+reblog"){if(v)for(const H of v)H._types?.includes("favourite")&&J++,H._types?.includes("reblog")&&X++;!X&&J&&(_="favourite"),!J&&X&&(_="reblog")}let j;_==="poll"?j=Wn[K?"poll-self":U?"poll-voted":"poll"]:Wn[_]?j=Wn[_]:j=fe._({id:"ODqZt1",values:{type:_}});const G=({clickable:H,...W})=>H?e("b",{tabIndex:"0",onClick:Q,...W}):e("b",{...W}),B=S>0&&S>y?.length,oe=B?"remote":"local";if(typeof j=="function"){const H=(_==="favourite"||_==="reblog")&&S?B?S:y?.length:v?.length||y?.length||(r?1:0),W=k?.length||(d?1:0);if(_==="admin.report"){const me=l?.targetAccount;me&&(j=j({account:e(pt,{account:r,showAvatar:!0}),targetAccount:e(pt,{account:me,showAvatar:!0})}))}else if(_==="severed_relationships"){const me=p?.targetName;me&&(j=j({name:me}))}else if((_==="emoji_reaction"||_==="pleroma:emoji_reaction")&&n.emoji){const me=n.emoji_url||d?.emojis?.find?.(ue=>ue?.shortcode===n.emoji.replace(/^:/,"").replace(/:$/,""));j=j({account:e(pt,{account:r,showAvatar:!0}),emoji:n.emoji,emojiURL:me})}else _==="annual_report"?j=j({...n.annualReport}):j=j({account:r?e(pt,{account:r,showAvatar:!0}):y?.[0]&&e(pt,{account:y[0],showAvatar:!0}),count:H,postsCount:W,postType:V?"reply":"post",components:{Subject:G}})}const $=n.createdAt&&new Date(n.createdAt).toLocaleString(),Y={"favourite+reblog":fe._({id:"+XOeb+"}),favourite:fe._({id:"LQFF6J"}),reblog:fe._({id:"phQpSa"}),follow:fe._({id:"Ih01jh"})}[_]||fe._({id:"bPwFdf"}),Q=()=>{x.showGenericAccounts={heading:Y,accounts:v,showReactions:_==="favourite+reblog",excludeRelationshipAttrs:_==="follow"?["followedBy"]:[],postID:it(L,i)}};if(d?.filtered){const H=d?.account?.id===M,W=qt(d.filtered,"notifications");if(!K&&!H&&W?.action==="hide")return null}return e("div",{class:`notification notification-${_}`,"data-notification-id":b||h,"data-group-key":g?.join(" ")||I,tabIndex:"0",children:[e("div",{class:`notification-type notification-${_}`,title:$,children:_==="favourite+reblog"?e(D,{children:[e(C,{icon:"rocket",size:"xl",alt:_,class:"reblog-icon"}),e(C,{icon:"heart",size:"xl",alt:_,class:"favourite-icon"})]}):e(C,{icon:Ji[_]||"notification",size:"xl",alt:_})}),e("div",{class:"notification-content",children:[_!=="mention"&&e(D,{children:[e("p",{children:j}),_==="follow_request"&&e(si,{accountID:r.id}),_==="severed_relationships"&&e("div",{children:[yl[p.type]({from:i,...p}),e("br",{}),e("a",{href:`https://${i}/severed_relationships`,target:"_blank",rel:"noopener",children:e(u,{id:"YL6Y8P",components:{0:e(C,{icon:"external",size:"s"})}})}),"."]}),_==="moderation_warning"&&!!m&&e("div",{children:[a(wl[m.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${m.id}`,target:"_blank",rel:"noopener",children:e(u,{id:"YL6Y8P",components:{0:e(C,{icon:"external",size:"s"})}})})]}),_==="annual_report"&&e("div",{children:e(ge,{to:`/annual_report/${f?.year}`,children:e(u,{id:"5PGPvG"})})})]}),v?.length>1&&e("p",{class:"avatars-stack",children:[v.slice(0,Zn).map(H=>e(D,{children:[e("a",{href:H.url,rel:"noopener",class:"account-avatar-stack",onClick:W=>{W.preventDefault(),x.showAccount=H},children:[e(ut,{url:H.avatarStatic,size:v.length<=10?"xxl":v.length<20?"xl":"l",alt:`${H.displayName} @${H.acct}`,squircle:H?.bot},H.id),_==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:H._types.map(W=>e(C,{icon:Ji[W],size:"s",class:`${W}-icon`}))})]},H.id)," "]},H.id)),(_==="favourite+reblog"||_==="favourite"||_==="reblog")&&oe==="remote"?e("button",{type:"button",class:"small plain","data-group-keys":g?.join(" "),onClick:()=>{x.showGenericAccounts={heading:Y,accounts:v,fetchAccounts:async()=>{const H=await Promise.allSettled(g.map(async me=>{const ue=c.v2.notifications.$select(me).accounts.list().values();return[me,(await ue.next()).value]})),W=[];for(const me of H){const[ue,be]=me.value,Ie=/^favourite/.test(ue)?"favourite":/^reblog/.test(ue)?"reblog":null;if(Ie)for(const ke of be){const Ae=W.find(Pe=>Pe.id===ke.id);Ae?Ae._types.push(Ie):(ke._types=[Ie],W.push(ke))}}return{done:!0,value:W}},showReactions:_==="favourite+reblog",postID:it(L,i)}},children:["+",(_==="favourite"||_==="reblog")&&S-v.length,e(C,{icon:"chevron-down"})]}):e("button",{type:"button",class:"small plain",onClick:Q,children:[v.length>Zn&&`+${v.length-Zn}`,e(C,{icon:"chevron-down"})]})]}),!v?.length&&y?.length>1&&e("p",{class:"avatars-stack",children:[y.map(H=>e(D,{children:[e("a",{href:H.url,rel:"noopener",class:"account-avatar-stack",onClick:W=>{W.preventDefault(),x.showAccount=H},children:e(ut,{url:H.avatarStatic,size:"xxl",alt:`${H.displayName} @${H.acct}`,squircle:H?.bot},H.id)},H.id)," "]},H.id)),S>y.length&&e(ge,{to:i?`/${i}/s/${d.id}`:`/s/${d.id}`,class:"button small plain centered",children:["+",S-y.length,e(C,{icon:"chevron-right"})]})]}),k?.length>1&&e("ul",{class:"notification-group-statuses",children:k.map(H=>e("li",{children:e(es,{class:`status-link status-type-${_}`,to:i?`/${i}/s/${H.id}`:`/s/${H.id}`,children:e(Ke,{status:H,size:"s",previewMode:!0,allowContextMenu:!0,allowFilters:!0})})},H.id))}),d&&(!k?.length||k?.length<=1)&&e(es,{class:`status-link status-type-${_}`,to:i?`/${i}/s/${L}`:`/s/${L}`,onContextMenu:s?void 0:H=>{const W=H.target.querySelector(".status");if(W){if(H.metaKey)return;H.preventDefault(),W.dispatchEvent(new MouseEvent("contextmenu",{clientX:H.clientX,clientY:H.clientY}))}},children:o?e(Ke,{status:A,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0}):e(Ke,{statusID:L,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0})})]})]})}function es(n){const i=Jo();return e(ge,{...n,"data-read-more":fe._({id:"8fZueG"}),ref:i})}const an=ot(kl,(n,i)=>n.notification?.id===i.notification?.id);"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",n=>{const{type:i,id:o,accessToken:s}=n?.data||{};i==="notification"&&(x.routeNotification={id:o,accessToken:s})});const Sl=ot(function(){const{_:i}=ce();if(!("serviceWorker"in navigator))return null;const o=qe(x),{routeNotification:s}=o,{id:a,accessToken:c}=s||{},[h,d]=E(!1);vt(()=>{if(!a||!c)return;const{instance:l}=ie(),{masto:p,instance:m}=ie({accessToken:c}),f=l===m,b=c?Ro(c):ui();(async()=>{const v=await p.v1.notifications.$select(a).fetch();if(v&&b){const k=b.instanceURL,{type:g,status:y,account:S}=v,I=!!document.querySelector("#modal-container > *"),w=g==="follow"&&!!S?.id,T=!!S?.id,_=!!y?.id;w&&f?x.showAccount={account:S,instance:k}:I||!f||T&&_?d({id:a,account:b,notification:v,sameInstance:f}):_?location.hash=`/${l}/s/${y.id}`:w?location.hash=`/${l}/a/${S.id}`:location.hash="/notifications"}})()},[a,c]),vt(()=>{navigator?.clearAppBadge&&navigator.clearAppBadge()},[]),jt(l=>{l&&navigator?.clearAppBadge&&navigator.clearAppBadge()});const r=()=>{d(!1),x.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(h){const{id:l,account:p,notification:m,sameInstance:f}=h;return e(Be,{onClick:b=>{b.target===b.currentTarget&&r()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:r,children:e(C,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"5+87Pq"})})}),e("main",{children:[!f&&e("p",{children:e(u,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:b=>{const{target:v}=b;(b.target.tagName==="BUTTON"||b.target.tagName==="A")&&r()},children:e(an,{instance:p.instanceURL,notification:m,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(ge,{to:"/notifications",class:"button light",onClick:r,children:[e("span",{children:e(u,{id:"/WA/tl"})})," ",e(C,{icon:"arrow-right"})]})})]})]})})}return null}),Js=Lo((n,i)=>{const{_:o}=ce(),{instance:s}=ie(),[a,c]=mt(),[h,d]=E(!1),[r,l]=E(a.get("q")||""),p=a.get("type"),m=F(null),f=F(null);return Mo(i,()=>({setValue:b=>{l(b)},focus:()=>{f.current.focus()},select:()=>{f.current.select()},blur:()=>{f.current.blur()}})),e("form",{ref:m,class:"search-popover-container",onSubmit:b=>{if(b.preventDefault(),/\/search/.test(location.hash))if(r){const k={q:r};p&&(k.type=p),c(k)}else c({});else r?location.hash=`/search?q=${encodeURIComponent(r)}${p?`&type=${p}`:""}`:location.hash="/search";n?.onSubmit?.(b)},children:[e("input",{ref:f,value:r,name:"q",type:"search",placeholder:o({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",onSearch:b=>{b.target.value||c({})},onInput:b=>{l(b.target.value),d(!0)},onFocus:()=>{d(!0),m.current?.querySelector(".search-popover-item")?.classList.add("focus")},onBlur:()=>{setTimeout(()=>{d(!1)},100),m.current?.querySelector(".search-popover-item.focus")?.classList.remove("focus")},onKeyDown:b=>{const{key:v}=b;switch(v){case"Escape":d(!1);break;case"Down":case"ArrowDown":if(b.preventDefault(),h){const k=m.current.querySelector(".search-popover-item.focus");if(k){let g=k.nextElementSibling;for(;g&&g.hidden;)g=g.nextElementSibling;g&&(g.classList.add("focus"),Array.from(g.parentElement.children).filter(S=>S!==g).forEach(S=>{S.classList.remove("focus")}))}else{const g=m.current.querySelector(".search-popover-item");g&&g.classList.add("focus")}}break;case"Up":case"ArrowUp":if(b.preventDefault(),h){const k=document.querySelector(".search-popover-item.focus");if(k){let g=k.previousElementSibling;for(;g&&g.hidden;)g=g.previousElementSibling;g&&(g.classList.add("focus"),Array.from(g.parentElement.children).filter(S=>S!==g).forEach(S=>{S.classList.remove("focus")}))}else{const g=document.querySelector(".search-popover-item:last-child");g&&g.classList.add("focus")}}break;case"Enter":if(h){const k=document.querySelector(".search-popover-item.focus");k&&(b.preventDefault(),k.click()),d(!1),n?.onSubmit?.(b)}break}}}),e("div",{class:"search-popover",hidden:!h||!r,children:!!r&&[{label:e(u,{id:"48oDit",values:{query:r},components:{0:e("small",{class:"insignificant"})}}),to:`/search?q=${encodeURIComponent(r)}`,top:!p&&!/\s/.test(r),hidden:!!p},{label:e(u,{id:"o1mMWT",values:{query:r},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(r)}&type=statuses`,hidden:/^https?:/.test(r),top:/\s/.test(r),icon:"document",queryType:"statuses"},{label:e(u,{id:"YAZw8D",values:{0:r.replace(/^#/,"")},components:{0:e("mark",{})}}),to:`/${s}/t/${r.replace(/^#/,"")}`,hidden:/^@/.test(r)||/^https?:/.test(r)||/\s/.test(r),top:/^#/.test(r),type:"link",icon:"hashtag",queryType:"hashtags"},{label:e(u,{id:"gEoOUj",values:{query:r},components:{0:e("mark",{})}}),to:`/${r}`,hidden:!/^https?:/.test(r),top:/^https?:/.test(r),type:"link"},{label:e(u,{id:"cDoNQr",values:{query:r},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(r)}&type=accounts`,icon:"group",queryType:"accounts"}].sort((b,v)=>{if(p){if(b.queryType===p)return-1;if(v.queryType===p)return 1}return b.top&&!v.top?-1:!b.top&&v.top?1:0}).filter(({hidden:b})=>!b).map(({label:b,to:v,icon:k,type:g},y)=>e(ge,{to:v,class:`search-popover-item ${y===0?"focus":""}`,onClick:S=>{n?.onSubmit?.(S)},children:[e(C,{icon:k||(g==="link"?"arrow-right":"search"),class:"more-insignificant"}),e("span",{children:b})," "]}))})]})}),Cl=ot(function({onClose:i=()=>{}}){const[o,s]=E(!1),a=F(null);ze(["Slash","/"],h=>{s(!0),setTimeout(()=>{a.current?.focus?.(),a.current?.select?.()},0)},{useKey:!0,preventDefault:!0,ignoreEventWhen:h=>{const d=/\/search/.test(location.hash),r=!!document.querySelector("#modal-container > *");return d||r||h.metaKey||h.ctrlKey||h.altKey||h.shiftKey}});const c=()=>{s(!1),i()};return ze("esc",h=>{a.current?.blur?.(),c()},{enabled:o,enableOnFormTags:!0,preventDefault:!0,useKey:!0,ignoreEventWhen:h=>h.metaKey||h.ctrlKey||h.altKey||h.shiftKey}),e("div",{id:"search-command-container",hidden:!o,onClick:h=>{h.target===h.currentTarget&&c()},children:e(Js,{ref:a,onSubmit:()=>{c()}})})});function _l(){const{_:n,_:i}=ce(),{instance:o}=ie(),s=qe(x),{shortcuts:a,settings:c}=s;if(!a.length)return null;const h=c.shortcutsViewMode==="multi-column"||!c.shortcutsViewMode&&c.shortcutsColumnsMode,d=F(),r=F(),l=F(!1),p=a.map((v,k)=>{const{type:g,...y}=v;if(!Nn[g])return null;let{id:S,path:I,title:w,subtitle:T,icon:_}=Nn[g];return typeof S=="function"&&(S=S(y,k)),typeof I=="function"&&(I=I({...y,instance:y.instance||o},k)),typeof w=="function"?w=w(y,k):w=i(w),typeof T=="function"?T=T(y,k):T=i(T),typeof _=="function"&&(_=_(y,k)),S==="lists"&&(l.current=!0),{id:S,path:I,title:w,subtitle:T,icon:_}}).filter(Boolean);Z(()=>{if(s.settings.shortcutsViewMode==="tab-menu-bar"&&r.current){const v=setTimeout(()=>{const k=r.current?.querySelector(".is-active");k&&k.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},100);return()=>clearTimeout(v)}},[]);const m=ws();ze(["1","2","3","4","5","6","7","8","9"],v=>{const k=parseInt(v.key,10)-1;if(kv.metaKey||v.ctrlKey||v.altKey||v.shiftKey});const[f,b]=E([]);return h?null:e("div",{id:"shortcuts",children:s.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{ref:r,class:"tab-bar",onContextMenu:v=>{v.preventDefault(),x.showShortcutsSettings=!0},children:e("ul",{children:p.map(({id:v,path:k,title:g,subtitle:y,icon:S},I)=>e("li",{children:e(ge,{class:y?"has-subtitle":"",to:k,onClick:w=>{if(w.target.classList.contains("is-active")){w.preventDefault();const T=document.getElementById(`${v}-page`);if(T){T.scrollTop=0;const _=T.querySelector(".updates-button");_&&_.click()}}},children:[e(C,{icon:S,size:"xl",alt:g}),e("span",{children:[e(wn,{children:g}),y&&e(D,{children:[e("br",{}),e("small",{children:y})]})]})]})},`${I}-${v}-${g}-${y}-${k}`))})}):e(st,{instanceRef:d,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:v=>{v.open&&l.current&&rn().then(b)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:v=>{v.preventDefault(),x.showShortcutsSettings=!0},onTransitionStart:v=>{try{const{target:k}=v;getComputedStyle(k).pointerEvents==="none"&&d.current?.closeMenu?.()}catch{}},children:e(C,{icon:"shortcut",size:"xl",alt:n({id:"CTqTgr"})})}),children:p.map(({id:v,path:k,title:g,subtitle:y,icon:S},I)=>v==="lists"?e(cn,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(D,{children:[e(C,{icon:S,size:"l"}),e("span",{class:"menu-grow",children:e(wn,{children:g})}),e(C,{icon:"chevron-right"})]}),children:[e(Fe,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),e(Ue,{}),f?.map(w=>e(Fe,{to:`/l/${w.id}`,children:e("span",{children:[w.title,w.exclusive&&e(D,{children:[" ",e(Ot,{})]})]})},w.id))]}):e(Fe,{to:k,class:"glass-menu-item",children:[e(C,{icon:S,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(wn,{children:g})}),y&&e(D,{children:[" ",e("small",{class:"more-insignificant",children:y})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:I+1})]},`${I}-${v}-${g}-${y}-${k}`))})})}const Il=ot(_l);function Al(n){let i=[],o=[],s=0;for(let a=0;a10&&(o.length>n.length/4||s>=3)){const a=o.map(c=>c.id);if(o.length>n.length*3/4)i=[...i,{id:a,items:o,type:"boosts"}];else{const c=Math.floor(i.length/2);i=[...i.slice(0,c),{id:a,items:o,type:"boosts"},...i.slice(c)]}return i}else return n}function ts(n,i){const o=Re.account.get("boostedStatusIDs")||{},s=n.filter(c=>{if(!c.reblog)return!0;const h=`${i}-${c.reblog.id}`,d=o[h];return d&&d!==c.id?!1:(o[h]=c.id,!0)}),a=Object.keys(o);return a.length>50&&a.slice(0,a.length-50).forEach(c=>{delete o[c]}),Re.account.set("boostedStatusIDs",o),s}function Tl(n,i){const o=[];let s=0;n.forEach(d=>{for(let l=0;lp.id===d.id))return;if(o[l].find(p=>p.id===d.inReplyToId)||o[l].find(p=>p.inReplyToId===d.id)){o[l].push(d);return}}const r=n.find(l=>l.id===d.inReplyToId);r&&(o[s++]=[d,r])});for(let d=0;do[r].includes(p))&&(o[d]=[...o[d],...o[r]],o[d]=o[d].filter((p,m,f)=>f.findIndex(b=>b.id===p.id)===m),o.splice(r,1),r--);o.forEach(d=>{d.sort((r,l)=>!r.inReplyToId&&!l.inReplyToId?new Date(r.createdAt)-new Date(l.createdAt):r.inReplyToId===l.id?1:l.inReplyToId===r.id||!r.inReplyToId?-1:l.inReplyToId?new Date(r.createdAt)-new Date(l.createdAt):1)}),o.forEach(d=>{const r=d[0].account.id;d.forEach(l=>{l.account.id!==r&&(l._differentAuthor=!0)})}),o.length;const a=[],c=[],h=[];return n.forEach(d=>{if(d.reblog){a.push(d);return}for(let r=0;rl.id===d.id)){if(c.includes(r))return;const l=o[r];l.sort((m,f)=>{const b=new Date(m.createdAt),v=new Date(f.createdAt);return b-v});const p=l[0].account.id;a.push({id:l.map(m=>m.id),items:l,type:l.every(m=>m.account.id===p)?"thread":"conversation"}),c.push(r);return}if(d.inReplyToId&&d.inReplyToAccountId!==d.account.id){const r=it(d.id,i);x.statusReply[r]||h.push({sKey:r,inReplyToId:d.inReplyToId})}a.push(d)}),h?.length&&queueMicrotask(()=>{const{masto:d}=ie({instance:i});async function r(){for(let l=0;lsetTimeout(b,1e3))}catch{}}}if(Ve("@mastodon/fetch-multiple-statuses")){const l=h.map(({inReplyToId:p})=>p);(async()=>{try{const p=await d.v1.statuses.list({id:l});if(p?.length)for(const m of p){We(m,i,{skipThreading:!0});const f=h.find(({inReplyToId:b})=>b===m.id)?.sKey;f&&(x.statusReply[f]={id:m.id,instance:i})}else r()}catch{r()}})()}else r()}),a}const xl=ft((n,i)=>i.v1.statuses.$select(n).fetch());async function Qs(n,i){const o=await ul();if(!o.length)return;const{statusFollowedTags:s}=x,a=[];if(n.forEach(c=>{if(c.reblog)return;const{id:h,content:d,tags:r=[]}=c,l=it(h,i);if(s[l]?.length)return;const p=hl(d);if(!p.length&&!r.length)return;const m=o.reduce((f,b)=>((p.some(v=>v.toLowerCase()===b.name.toLowerCase())||r.some(v=>v.name.toLowerCase()===b.name.toLowerCase()))&&f.push(b.name),f),[]);m.length&&a.push({item:c,sKey:l,followedTags:m})}),a.length){const c=a.map(d=>d.item.account),h=await Dn(c);if(!h)return;a.forEach(d=>{const{item:r,sKey:l,followedTags:p}=d,m=h[r.account.id];m&&!m.following&&(s[l]=p)})}}function El(){x.statusFollowedTags={}}function Rl({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:o=1,scrollThresholdStart:s=10,scrollThresholdEnd:a=10,direction:c="vertical",distanceFromStartPx:h,distanceFromEndPx:d}={}){const[r,l]=E(null),[p,m]=E(!1),[f,b]=E(!1),[v,k]=E(!1),[g,y]=E(!1),S=c==="vertical";return vt(()=>{const I=n.current;if(!I)return{};let w=S?I.scrollTop:I.scrollLeft;function T(){const{scrollTop:_,scrollLeft:A,scrollHeight:L,scrollWidth:M,clientHeight:K,clientWidth:U}=I,V=S?_:A,J=S?L:M,X=S?K:U,j=Math.abs(V-w),G=h||Math.min(X*i,J,V),B=d||Math.min(X*o,J,J-V-X);j>=(w=J),k(V<=G),y(V+X>=J-B)}return I.addEventListener("scroll",T,{passive:!0}),()=>I.removeEventListener("scroll",T)},[i,o,s,a]),{scrollDirection:r,reachStart:p,reachEnd:f,nearReachStart:v,nearReachEnd:g,init:()=>{n.current&&n.current.dispatchEvent(new Event("scroll"))}}}function Ll({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:o=1,scrollThresholdStart:s=10,scrollThresholdEnd:a=10,direction:c="vertical",distanceFromStartPx:h,distanceFromEndPx:d,init:r}={},l,p){if(!l)return;const m=c==="vertical",f=F(null),b=F(null),v=Qo(()=>{let k=!1,g=!1,y=!1,S=!1;const I=n.current,{scrollTop:w,scrollLeft:T,scrollHeight:_,scrollWidth:A,clientHeight:L,clientWidth:M}=I,K=m?w:T,U=m?_:A,V=m?L:M,J=Math.abs(K-f.current),X=h||Math.min(V*i,U,K),j=d||Math.min(V*o,U,U-K-V);J>=(f.current=U,y=K<=X,S=K+V>=U-j,l({scrollDirection:b.current,reachStart:k,reachEnd:g,nearReachStart:y,nearReachEnd:S})},500);vt(()=>{const k=n.current;return k?(f.current=k[m?"scrollTop":"scrollLeft"],k.addEventListener("scroll",v,{passive:!0}),()=>k.removeEventListener("scroll",v)):{}},[i,o,s,a,...p]),Z(()=>{r&&n.current&&queueMicrotask(()=>{n.current.dispatchEvent(new Event("scroll"))})},[r])}function Ml({class:n,statusID:i,status:o,instance:s,parent:a,onMediaClick:c}){const{_:h}=ce();let d=it(i,s);const r=qe(x);if(o||(o=r.statuses[d]||r.statuses[i],d=it(o?.id,s)),!o)return null;const{account:{acct:l,avatar:p,avatarStatic:m,id:f,url:b,displayName:v,username:k,emojis:g,bot:y,group:S},id:I,repliesCount:w,reblogged:T,reblogsCount:_,favourited:A,favouritesCount:L,bookmarked:M,poll:K,muted:U,sensitive:V,spoilerText:J,visibility:X,language:j,editedAt:G,filtered:B,card:oe,createdAt:$,inReplyToId:Y,inReplyToAccountId:Q,content:H,mentions:W,mediaAttachments:me,reblog:ue,uri:be,url:Ie,emojis:ke,_deleted:Ae,_pinned:Pe}=o;if(!me?.length)return null;const we=O=>{O.shiftKey},Ne=Se(()=>bt(),[]),He=Se(()=>Ne&&Ne===f,[f,Ne]),Le=$o(On),se=!He&&qt(B,Le);if(se?.action==="hide")return null;const _e=V,N=(ri()["reading:expand:media"]?.toLowerCase()||"default")==="show_all",q=a||"div";return me.map((O,re)=>{const Me=`${d}-${O.id}`,P=se?.titlesStr;return e(q,{"data-state-post-id":d,onMouseEnter:we,"data-spoiler-text":J||(V?h({id:"FKojeB"}):void 0),"data-filtered-text":se?h(P?{id:"7FGvtQ",values:{filterTitleStr:P}}:{id:"03Qqf9"}):void 0,class:` media-post ${se?"filtered":""} ${_e?"has-spoiler":""} ${N?"show-media":""} `,children:e(Ls,{class:n,media:O,lang:j,to:`/${s}/s/${I}?media-only=${re+1}`,onClick:c?ae=>c(ae,re,O,o):void 0})},Me)})}const ns=ot(Ml);function $l(n){const{_:i}=ce(),o=qe(x),{masto:s,instance:a,authenticated:c}=ie(),[h,d]=Se(()=>{const I=li();return[I.find(T=>T.info.id===bt())||I[0],I.length>1]},[]),r=(o.settings.shortcutsViewMode==="multi-column"||!o.settings.shortcutsViewMode&&o.settings.shortcutsColumnsMode)&&!o.shortcuts.find(I=>I.type==="following"),l=_s(()=>{x.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),p=F(),[m,f]=E(void 0),b=As([0,0,o.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),v=F();async function k(I){return(I||!v.current)&&(v.current=s.v1.mutes.list({limit:80}).values()),await v.current.next()}const g=F();async function y(I){return(I||!g.current)&&(g.current=s.v1.blocks.list({limit:80}).values()),await g.current.next()}const S=F();return e(D,{children:[e("button",{ref:p,type:"button",class:`button plain nav-menu-button ${d?"with-avatar":""} ${m==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{S.current=Date.now(),f(I=>I?void 0:"open")},onContextMenu:I=>{I.preventDefault(),x.showAccounts=!0},...l(),children:[d&&e(ut,{url:h?.info?.avatar||h?.info?.avatarStatic,size:"l",squircle:h?.info?.bot}),e(C,{icon:"menu",size:d?"s":"l",alt:i({id:"zucql+"})})]}),e(mi,{menuClassName:"nav-menu",state:m,anchorRef:p,onClose:()=>{f(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-S.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:b,unmountOnClose:!0,children:[!!o.appVersion?.commitHash&&o.appVersion.commitHash!=="3f4b1a6"&&e("div",{class:"top-menu",children:[e(ve,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(C,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(u,{id:"95IFnD"})})]}),e(Ue,{})]}),e("section",{children:[e(Fe,{to:"/",children:[e(C,{icon:"home",size:"l"})," ",e("span",{children:e(u,{id:"i0qMbr"})})]}),c?e(D,{children:[r&&e(Fe,{to:"/following",children:[e(C,{icon:"following",size:"l"})," ",e("span",{children:e(u,{id:"following.title"})})]}),e(Fe,{to:"/catchup",children:[e(C,{icon:"history2",size:"l"}),e("span",{children:e(u,{id:"xrl8fj"})})]}),Ve("@mastodon/mentions")&&e(Fe,{to:"/mentions",children:[e(C,{icon:"at",size:"l"})," ",e("span",{children:e(u,{id:"/bZzdR"})})]}),e(Fe,{to:"/notifications",children:[e(C,{icon:"notification",size:"l"})," ",e("span",{children:e(u,{id:"iDNBZe"})}),o.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","โ€ข"]})]}),e(Ue,{}),h?.info?.id&&e(Fe,{to:`/${a}/a/${h.info.id}`,children:[e(C,{icon:"user",size:"l"})," ",e("span",{children:e(u,{id:"vERlcd"})})]}),e(Nl,{menuState:m}),e(Fe,{to:"/b",children:[e(C,{icon:"bookmark",size:"l"})," ",e("span",{children:e(u,{id:"7Ff7ia"})})]}),e(cn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(D,{children:[e(C,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"24misb"})}),e(C,{icon:"chevron-right"})]}),children:[e(Fe,{to:"/f",children:[e(C,{icon:"heart",size:"l"})," ",e("span",{children:e(u,{id:"zZOZj7"})})]}),e(Fe,{to:"/fh",children:[e(C,{icon:"hashtag",size:"l"})," ",e("span",{children:e(u,{id:"Xi1/bw"})})]}),e(Fe,{to:"/sp",children:[e(C,{icon:"schedule",size:"l"})," ",e("span",{children:e(u,{id:"+GkIdc"})})]}),e(Ue,{}),Ve("@mastodon/filters")&&e(Fe,{to:"/ft",children:[e(C,{icon:"filters",size:"l"})," ",e("span",{children:e(u,{id:"cSev+j"})})]}),e(ve,{onClick:()=>{x.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:k,excludeRelationshipAttrs:["muting"]}},children:[e(C,{icon:"mute",size:"l"})," ",e("span",{children:e(u,{id:"n1sANU"})})]}),e(ve,{onClick:()=>{x.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:y,excludeRelationshipAttrs:["blocking"]}},children:[e(C,{icon:"block",size:"l"})," ",e("span",{children:e(u,{id:"r3RRWo"})})]})," "]}),e(Ue,{}),e(ve,{onClick:()=>{x.showAccounts=!0},children:[e(C,{icon:"group",size:"l"})," ",e("span",{children:e(u,{id:"7e0O8Z"})})]})]}):e(D,{children:[e(Ue,{}),e(Fe,{to:"/login",children:[e(C,{icon:"user",size:"l"})," ",e("span",{children:e(u,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(Ue,{}),e(Fe,{to:"/search",children:[e(C,{icon:"search",size:"l"})," ",e("span",{children:e(u,{id:"A1taO8"})})]}),e(Fe,{to:`/${a}/trending`,children:[e(C,{icon:"chart",size:"l"})," ",e("span",{children:e(u,{id:"4/iCqx"})})]}),e(Fe,{to:`/${a}/p/l`,children:[e(C,{icon:"building",size:"l"})," ",e("span",{children:e(u,{id:"d5zxa4"})})]}),e(Fe,{to:`/${a}/p`,children:[e(C,{icon:"earth",size:"l"})," ",e("span",{children:e(u,{id:"4ERYY7"})})]}),c?e(D,{children:[e(Ue,{className:"divider-grow"}),e(ve,{onClick:()=>{x.showKeyboardShortcutsHelp=!0},children:[e(C,{icon:"keyboard",size:"l"})," ",e("span",{children:e(u,{id:"77Emn0"})})]}),e(ve,{onClick:()=>{x.showShortcutsSettings=!0},children:[e(C,{icon:"shortcut",size:"l"})," ",e("span",{children:e(u,{id:"8Kudkr"})})]}),e(ve,{onClick:()=>{x.showSettings=!0},children:[e(C,{icon:"gear",size:"l"})," ",e("span",{children:e(u,{id:"uVbUP8"})})]})]}):e(D,{children:[e(Ue,{}),e(ve,{onClick:()=>{x.showSettings=!0},children:[e(C,{icon:"gear",size:"l"})," ",e("span",{children:e(u,{id:"uVbUP8"})})]})]})]})]})]})}function Nl({menuState:n}){const i=Ve("@mastodon/lists"),[o,s]=E([]);return Z(()=>{i&&n==="open"&&rn().then(s)},[n,i]),o.length>0?e(cn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(D,{children:[e(C,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"h16FyT"})}),e(C,{icon:"chevron-right"})]}),children:[e(Fe,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),o?.length>0&&e(D,{children:[e(Ue,{}),o.map(a=>e(Fe,{to:`/l/${a.id}`,children:e("span",{children:[a.title,a.exclusive&&e(D,{children:[" ",e(Ot,{})]})]})},a.id))]})]}):i&&e(Fe,{to:"/l",children:[e(C,{icon:"list",size:"l"}),e("span",{children:e(u,{id:"h16FyT"})})]})}const Mt=ot($l),pn={block:"start",inline:"center",behavior:"smooth"};function Ct({title:n,titleComponent:i,id:o,instance:s,emptyText:a,errorText:c,useItemID:h,boostsCarousel:d,fetchItems:r=()=>{},checkForUpdates:l=()=>{},checkForUpdatesInterval:p=15e3,headerStart:m,headerEnd:f,timelineStart:b,refresh:v,view:k,filterContext:g,showFollowedTags:y,showReplyParent:S,clearWhenRefresh:I}){const{_:w}=ce(),T=qe(x),[_,A]=E([]),[L,M]=E("start"),[K,U]=E(!1),[V,J]=E(!1),[X,j]=E(!0),G=F();__BENCHMARK.start(`timeline-${o}-load`);const B=Se(()=>hi(),[]),oe=k!=="media",$=F(0),Y=ea(se=>{J(!1),M("loading"),(async()=>{try{const _e=$.current=Date.now();let{done:Oe,value:Te}=await r(se);if(_e!==$.current)return;if(Array.isArray(Te)){const[N,q]=Te.reduce((O,re)=>(re._pinned?O[0].push(re):O[1].push(re),O),[[],[]]);Te=q,oe&&(d&&(Te=Al(Te)),Te=Tl(Te,s)),N.length&&(Te=N.concat(Te)),A(se?Te:O=>[...O,...Te]),Te.length||(Oe=!0),U(!Oe)}else U(!1);M("default"),__BENCHMARK.end(`timeline-${o}-load`)}catch{M("error"),se&&!_.length&&c&&he(c)}finally{Y.cancel()}})()},1e3,{leading:!0}),Q=".timeline-item, .timeline-item-alt",H=ze("j, shift+j",(se,_e)=>{if(se.shiftKey!==_e.shift)return;const Oe=document.activeElement.closest(Q),Te=Oe?.getBoundingClientRect(),N=Array.from(G.current.querySelectorAll(Q)).filter(q=>!!q.offsetHeight);if(Oe&&Te.top0){const q=N.indexOf(Oe);let O=N[q+1];_e.shift&&(O=N.find((re,Me)=>Me>q&&!re.classList.contains("timeline-item-alt"))),O&&(O.focus(),O.scrollIntoView(pn))}else{const q=N.find(O=>{const re=O.getBoundingClientRect();return re.top>=44&&re.left>=0});q&&(q.focus(),q.scrollIntoView(pn))}},{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey}),W=ze("k, shift+k",(se,_e)=>{if(se.shiftKey!==_e.shift)return;const Oe=document.activeElement.closest(Q),Te=Oe?.getBoundingClientRect(),N=Array.from(G.current.querySelectorAll(Q)).filter(q=>!!q.offsetHeight);if(Oe&&Te.top0){const q=N.indexOf(Oe);let O=N[q-1];_e.shift&&(O=N.findLast((re,Me)=>Me{const re=O.getBoundingClientRect();return re.top>=44&&re.left>=0});q&&(q.focus(),q.scrollIntoView(pn))}},{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey}),me=ze(["enter","o"],()=>{const se=document.activeElement;se?.matches(Q)&&se.click()},{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey||se.shiftKey}),ue=_.length>0&&L!=="loading"&&V,be=Qe(()=>{ue&&Y(!0),G.current?.scrollTo({top:0,behavior:"smooth"})},[Y,ue]),Ie=ze(".",be,{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey||se.shiftKey}),ke=F(),[Ae,Pe]=E(!1);Ll({scrollableRef:G,distanceFromEnd:2,scrollThresholdStart:44},({scrollDirection:se,nearReachStart:_e,reachStart:Oe})=>{if(ke.current){const Te=se==="end"&&!_e;ke.current.hidden=Te}Pe(_e),Oe&&Y(!0)},[]),Z(()=>{G.current?.scrollTo({top:0}),Y(!0)},[]);const we=F(!0);Z(()=>{if(we.current){we.current=!1;return}I&&_?.length&&(Y.cancel?.(),A([])),Y(!0)},[I,v]);const Ne=F(k);Z(()=>{Ne.current!==k&&(Ne.current=k,A([]))},[k]);const He=Qe(async({disableIdleCheck:se=!1}={})=>{const _e=G.current?getComputedStyle(G.current).pointerEvents==="none":!1;T.settings.autoRefresh&&G.current.scrollTop<16&&(se||window.__IDLE__)&&!zl()&&!_e?Y(!0):await l()&&J(!0)},[o,Y,l,T.settings.autoRefresh]),Le=F();return jt(se=>{if(se){const _e=Date.now()-Le.current;(!Le.current||_e>1e3*3)&&He({disableIdleCheck:!0})}else Le.current=Date.now();j(se)},[l,He,T.settings.autoRefresh]),fi(He,X&&!V?p*(Ae?1:2):null),e(On.Provider,{value:g,children:e("div",{id:`${o}-page`,class:`deck-container ${B?"deck-container-media-first":""}`,ref:se=>{G.current=se,H.current=se,W.current=se,me.current=se,Ie.current=se},tabIndex:"-1",onClick:se=>{ke.current&&se.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{ke.current.hidden=!1},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:ke,onClick:se=>{se.target.closest("a, button")||G.current?.scrollTo({top:0,behavior:"smooth"})},onDblClick:se=>{se.target.closest("a, button")||Y(!0)},class:L==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),m??e(ge,{to:"/",class:"button plain home-button",children:e(C,{icon:"home",size:"l",alt:w({id:"i0qMbr"})})})]}),n&&(i||e("h1",{children:n})),e("div",{class:"header-side",children:!!f&&f})]}),ue&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:be,children:[e(C,{icon:"arrow-up"})," ",e(u,{id:"2yr1/p"})]})]}),!!b&&e("div",{class:`timeline-start ${L==="loading"?"loading":""}`,children:b}),_.length?e(D,{children:[e("ul",{class:`timeline ${k?`timeline-${k}`:""}`,children:[_.map(se=>e(Pl,{status:se,instance:s,useItemID:h,filterContext:g,view:k,showFollowedTags:y,showReplyParent:S,mediaFirst:B},se.id+se?._pinned+k)),K&&L==="loading"&&(k==="media"?null:e(D,{children:[e("li",{style:{height:"20vh"},children:e(Ke,{skeleton:!0,mediaFirst:B})}),e("li",{style:{height:"25vh"},children:e(Ke,{skeleton:!0,mediaFirst:B})})]}))]}),L==="default"&&(K?e(St,{root:G.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:se=>{se&&Y()},children:e("button",{type:"button",class:"plain block",onClick:()=>Y(),style:{marginBlockEnd:"6em"},children:e(u,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(u,{id:"2EYeAZ"})}))]}):L==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((se,_e)=>k==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(Ke,{skeleton:!0,mediaFirst:B})},_e))}):L!=="error"&&L!=="start"&&e("p",{class:"ui-state",children:a}),L==="error"&&e("p",{class:"ui-state",children:[c,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>Y(!_.length),children:e(u,{id:"KDw4GX"})})]})]})})})}const Pl=ot(({status:n,instance:i,useItemID:o,filterContext:s,view:a,showFollowedTags:c,showReplyParent:h,mediaFirst:d})=>{const{_:r}=ce(),{id:l,reblog:p,items:m,type:f,_pinned:b}=n;b&&(o=!1);const v=p?.id||l,k=i?`/${i}/s/${v}`:`/s/${v}`;if(m){let y=Pt(m,s),S="";if(f==="boosts"?S=fe._({id:"NuqppG",values:{0:y.length}}):f==="pinned"&&(S=r({id:"GlfmCu"})),f==="boosts"||f==="pinned"){const T=new Set;if(y.sort((_,A)=>{const L=qt(_.filtered,s),M=qt(A.filtered,s);return L&&L?.action!=="blur"&&T.add(_.id),M&&M?.action!=="blur"&&T.add(A.id),L&&!M?1:!L&&M?-1:0}),T.size>=2){const A=[],L=[];y.forEach(K=>{T.has(K.id)?L.push(K):A.push(K)});const M=[];for(let K=0;K{const{id:A,reblog:L,_pinned:M,_grouped:K}=_;if(K)return e("li",{class:"timeline-item-carousel-group",children:_.posts.map(J=>{const{id:X,reblog:j,_pinned:G}=J,B=j?.id||X,oe=i?`/${i}/s/${B}`:`/s/${B}`;return G&&(o=!1),e(ge,{class:"status-carousel-link timeline-item-alt",to:oe,children:o?e(Ke,{statusID:X,instance:i,size:"s"}):e(Ke,{status:J,instance:i,size:"s"})})})},A);const U=L?.id||A,V=i?`/${i}/s/${U}`:`/s/${U}`;return M&&(o=!1),e("li",{children:e(ge,{class:"status-carousel-link timeline-item-alt",to:V,children:o?e(Ke,{statusID:A,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d}):e(Ke,{status:_,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d})})},A)})})},`timeline-${l}`)}const w=y.length>3;return y.map((T,_)=>{const{id:A,_differentAuthor:L}=T,M=i?`/${i}/s/${A}`:`/s/${A}`,K=_>0&&_0||w&&K&&(f==="thread"||f==="conversation"&&!L&&!y[_-1]._differentAuthor&&!y[_+1]._differentAuthor),J=_===0,X=_===y.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${f} timeline-item-container-${J?"start":X?"end":"middle"} ${L?"timeline-item-diff-author":""}`,children:e(ge,{class:"status-link timeline-item",to:M,children:V?e(Ol,{status:T,instance:i,filterContext:s}):o?e(Ke,{statusID:A,instance:i,enableCommentHint:X,showFollowedTags:c}):e(Ke,{status:T,instance:i,enableCommentHint:X,showFollowedTags:c})})},`timeline-${A}`)})}const g=`timeline-${l+b}`;return a==="media"?o?e(ns,{class:"timeline-item",parent:"li",statusID:l,instance:i},g):e(ns,{class:"timeline-item",parent:"li",status:n,instance:i},g):e("li",{children:e(ge,{class:"status-link timeline-item",to:k,children:o?e(Ke,{statusID:l,instance:i,enableCommentHint:!0,showFollowedTags:c,showReplyParent:h,mediaFirst:d}):e(Ke,{status:n,instance:i,enableCommentHint:!0,showFollowedTags:c,showReplyParent:h,mediaFirst:d})})},g)},(n,i)=>{const o=(n.status?.id||"").toString(),s=(i.status?.id||"").toString();return o===s&&n.instance===i.instance&&n.view===i.view});function Dl({title:n,class:i,children:o}){const{_:s}=ce(),a=F(),c=F(),h=F(),[d,r]=E(!1);return Z(()=>{setTimeout(()=>{r(!0)},1)},[]),e("div",{class:`status-carousel ${i}`,children:[e("header",{children:[e("h3",{children:n}),e("span",{children:[e("button",{ref:c,type:"button",class:"small plain2",onClick:()=>{const l=Math.min(320,a.current?.offsetWidth)*(Nt()?1:-1);a.current?.scrollBy({left:l,behavior:"smooth"})},children:e(C,{icon:"chevron-left",alt:s({id:"DHhJ7s"})})})," ",e("button",{ref:h,type:"button",class:"small plain2",onClick:()=>{const l=Math.min(320,a.current?.offsetWidth)*(Nt()?-1:1);a.current?.scrollBy({left:l,behavior:"smooth"})},children:e(C,{icon:"chevron-right",alt:s({id:"hXzOVo"})})})]})]}),e("ul",{ref:a,children:[e(St,{class:"status-carousel-beacon",onChange:l=>{c.current&&(c.current.disabled=l)}}),o[0],d&&o.slice(1),e(St,{class:"status-carousel-beacon",onChange:l=>{h.current&&(h.current.disabled=l)}})]})]})}function Ol({status:n,instance:i,filterContext:o}){const{_:s}=ce(),a=qe(x),{id:c,visibility:h,language:d}=n,r=Pn(n),l=it(c,i),p=qt(n.filtered,o);return e("article",{class:`status compact-thread ${h==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[a.statusThreadNumber[l]?e("div",{class:"status-thread-badge",children:[e(C,{icon:"thread",size:"s",alt:s({id:"e66y2Z"})}),a.statusThreadNumber[l]?` ${a.statusThreadNumber[l]}/X`:""]}):e("div",{class:"status-thread-badge",children:e(C,{icon:"thread",size:"s",alt:s({id:"e66y2Z"})})}),e("div",{class:"content-compact",title:r,lang:d,dir:"auto",children:p&&p?.action!=="blur"?e("b",{class:"status-filtered-badge badge-meta horizontal",title:p?.titlesStr||"",children:p?.titlesStr?e(u,{id:"sr6maL",values:{0:p.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(u,{id:"03Qqf9"})})}):e(D,{children:[r,n.sensitive&&n.spoilerText&&e(D,{children:[" ",e("span",{class:"spoiler-badge",children:e(C,{icon:"eye-close",size:"s",alt:s({id:"gnKo7f"})})})]})]})})]})}function zl(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const Ut=20,Ri=1983,is=`${Ri}-01`,Bl=(()=>{try{const n=document.createElement("input");return n.setAttribute("type","month"),n.type==="month"}catch{return!1}})();async function Fl(n){const{masto:i}=ie({instance:n});return!!(await i.v2.search.list({q:"from:me",type:"statuses",limit:1}))?.statuses?.length}const Ul=ft(Fl);function Kl(){const{i18n:n,_:i}=ce(),o=qe(x),{id:s,...a}=Lt(),[c,h]=mt(),d=c.get("month"),r=!c.get("replies"),l=!!c.get("boosts"),p=c.get("tagged"),m=!!c.get("media"),{masto:f,instance:b,authenticated:v}=ie({instance:a.instance}),{masto:k,instance:g}=ie(),y=F(),S=[d,r,l,p,m],[I,w]=E(),T=F(0);Z(()=>{T.current=0},S);const _=Se(()=>hi(),[]),A=Se(()=>b===g,[b,g]),[L,M]=E(!1);Z(()=>{A&&I?.acct&&(async()=>{const W=await Ul(b);M(W)})()},[b,A,I?.acct]);async function K(W){const me=/^\d{4}-[01]\d$/.test(d),ue=d?.split?.("-")?.[0]>=Ri;if(me&&ue){if(!I)return{value:[],done:!0};const[Ae,Pe]=d.split("-"),we=parseInt(Pe,10)-1,Ne=new Date(Ae,we,0),He=`${Ne.getFullYear()}-${(Ne.getMonth()+1).toString().padStart(2,"0")}-${Ne.getDate().toString().padStart(2,"0")}`,Le=new Date(Ae,we+1,1),se=`${Le.getFullYear()}-${(Le.getMonth()+1).toString().padStart(2,"0")}-${Le.getDate().toString().padStart(2,"0")}`;let _e;W?(_e=Ut+1,T.current=0):(_e=Ut+T.current+1,T.current+=Ut);const Oe=await f.v2.search.list({q:`from:${I.acct} after:${He} before:${se}`,type:"statuses",limit:_e,offset:T.current});if(Oe?.statuses?.length){const Te=Oe.statuses.slice(0,Ut);Te.forEach(q=>{We(q,b)});const N=Oe.statuses.length<=Ut;return{value:Te,done:N}}else return{value:[],done:!0}}let be=[];if(W){const{value:Ae}=await f.v1.accounts.$select(s).statuses.list({pinned:!0}).values().next();if(Ae?.length&&!p&&!m){const Pe=Ae.map(we=>(We(we,b),{...we,_pinned:!0}));if(Pe.length>=3){const we=Pe.map(Ne=>Ne.id);be.push({id:we,items:Pe,type:"pinned"})}else be.push(...Pe)}}(W||!y.current)&&(y.current=f.v1.accounts.$select(s).statuses.list({limit:Ut,exclude_replies:r,exclude_reblogs:l,only_media:m||void 0,tagged:p}).values());const{value:Ie,done:ke}=await y.current.next();if(Ie?.length){if(!Ve("@mastodon/pinned-posts")&&be.length){let Ae=[];be[0]?.type==="pinned"?Ae=be[0].id:Ae=be.filter(we=>we._pinned).map(we=>we.id),Ae.every(we=>Ie.some(Ne=>Ne.id===we))&&(be=[])}be.push(...Ie),Ie.forEach(Ae=>{We(Ae,b)})}return{value:be,done:ke}}const[U,V]=E([]);let J=i({id:"/cKnpj"});if(I?.acct){const W=(/@/.test(I.acct)?"":"@")+I.acct,me=I?.displayName?`${I.displayName} (${W})`:`${W}`;if(!r)J=i({id:"hS1Opy",values:{accountDisplay:me}});else if(l)J=i({id:"A/CX5F",values:{accountDisplay:me}});else if(p)J=i({id:"QQrO94",values:{accountDisplay:me,tagged:p}});else if(m)J=i({id:"NoG5wD",values:{accountDisplay:me}});else if(d){const ue=new Date(d).toLocaleString(n.locale,{month:"long",year:"numeric"});J=i({id:"8GjLvB",values:{accountDisplay:me,monthYear:ue}})}else J=me}Ze(J,"/:instance?/a/:id");const X=Qe(()=>jl(s,f),[s,f]);Z(()=>{(async()=>{try{const W=await X();w(W)}catch{}if(!_)try{const W=await f.v1.accounts.$select(s).featuredTags.list();V(W)}catch{}})()},[s,_]);const{displayName:j,acct:G,emojis:B}=I||{},oe=F(),$=Se(()=>{const W=!r||l||p||m||!!d,me=o.accounts[`${s}@${b}`];return e(D,{children:[e(Vs,{instance:b,account:me||s,fetchAccount:X,authenticated:v,standalone:!0,showEndorsements:!0}),!_&&e("div",{class:"filter-bar",ref:oe,style:{position:"relative"},children:[W?e(ge,{to:`/${b}/a/${s}`,class:"insignificant filter-clear",title:i({id:"u8JHrO"}),children:e(C,{icon:"x",size:"l",alt:i({id:"xCJdfg"})})},"clear-filters"):e(C,{icon:"filter",class:"insignificant",size:"l",alt:i({id:"cSev+j"})}),e(ge,{to:`/${b}/a/${s}${r?"?replies=1":""}`,onClick:()=>{r&&he(i({id:"PIWNSQ"}))},class:r?"":"is-active",children:e(u,{id:"5BFynH"})}),e(ge,{to:`/${b}/a/${s}${l?"":"?boosts=0"}`,onClick:()=>{l||he(i({id:"Qd13i0"}))},class:l?"is-active":"",children:e(u,{id:"usxQx0"})}),e(ge,{to:`/${b}/a/${s}${m?"":"?media=1"}`,onClick:()=>{m||he(i({id:"rKpfPY"}))},class:m?"is-active":"",children:e(u,{id:"xYilR2"})}),U.map(ue=>e(ge,{to:`/${b}/a/${s}${p===ue.name?"":`?tagged=${encodeURIComponent(ue.name)}`}`,onClick:()=>{p!==ue.name&&he(i({id:"L+HFfr",values:{0:ue.name}}))},class:p===ue.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),ue.name]})},ue.id)),L&&(Bl?e("label",{class:`filter-field ${d?"is-active":""}`,children:[e(C,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!I?.acct,value:d||"",min:is,max:new Date().toISOString().slice(0,7),onInput:ue=>{const{value:be,validity:Ie}=ue.currentTarget;if(!Ie.valid)return;h(be?{month:be}:{});const[ke,Ae]=be.split("-"),Pe=parseInt(Ae,10)-1,we=new Date(ke,Pe);he(i({id:"0WUFGD",values:{0:we.toLocaleString(n.locale,{month:"long",year:"numeric"})}}))}})]}):e(Hl,{class:`filter-field ${d?"is-active":""}`,disabled:!I?.acct,value:d||"",min:is,max:new Date().toISOString().slice(0,7),onInput:ue=>{const{value:be,validity:Ie}=ue;Ie.valid&&h(be?{month:be}:{})}}))]})]})},[s,b,v,U,X,L,...S]);Z(()=>{const W=oe.current?.querySelector(".is-active");W&&oe.current.scrollTo({behavior:"smooth",left:W.offsetLeft-(oe.current.offsetWidth-W.offsetWidth)/2})},[U,L,...S]);const Y=Se(()=>I?.url?URL.parse(I.url)?.hostname:null,[I]),H=!!I&&!(b===Y);return e(D,{children:[e(Ct,{title:`${I?.acct?"@"+I.acct:i({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(Es,{text:j,emojis:B})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",G]})})]}),id:"account-statuses",instance:b,emptyText:i({id:"+k97fV"}),errorText:i({id:"scd9lw"}),fetchItems:K,useItemID:!0,view:m||_?"media":void 0,boostsCarousel:o.settings.boostsCarousel,timelineStart:$,refresh:[r,l,p,m,d+I?.acct].toString(),headerEnd:e(st,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(C,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ve,{disabled:!H,onClick:()=>{(async()=>{try{const{masto:W}=ie({instance:Y}),me=await W.v1.accounts.lookup({acct:I.acct}),{id:ue}=me;location.hash=`/${Y}/a/${ue}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(C,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"/JFxxT",values:{0:Y?e(D,{children:[" ","(",e("b",{children:ln.toUnicode(Y)}),")"]}):null}})})]}),!A&&e(ve,{onClick:()=>{(async()=>{try{const W=await k.v1.accounts.lookup({acct:I.acct+"@"+b}),{id:me}=W;location.hash=`/${g}/a/${me}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(C,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"HkuyOu",values:{currentInstance:g},components:{0:e("b",{})}})})]})]})},s),G&&e("data",{class:"compose-data",value:JSON.stringify({draftStatus:{status:`@${G} `}})})]})}function Hl(n){const{i18n:i}=ce(),{class:o,disabled:s,value:a,min:c,max:h,onInput:d=()=>{}}=n,[r,l]=a?.split("-")||[],p=F(),m=F(),f=(b,v)=>{const[k,g]=c?.split("-")||[],[y,S]=h?.split("-")||[];return!(vy||v===k&&bS)};return e("div",{class:o,children:[e(C,{icon:"month",size:"l"}),e("select",{ref:p,disabled:s,value:l||"",onInput:b=>{const{value:v}=b.currentTarget,k=m.current.value;if(!f(v,k))return{value:"",validity:{valid:!1}};d({value:v?`${k}-${v}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(u,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(b,v)=>e("option",{value:(v+1).toString().padStart(2,"0"),children:new Date(0,v).toLocaleString(i.locale,{month:"long"})},v))]})," ",e("input",{ref:m,type:"number",disabled:s,value:r||new Date().getFullYear(),min:c?.slice(0,4)||Ri,max:h?.slice(0,4)||new Date().getFullYear(),onInput:b=>{const{value:v,validity:k}=b.currentTarget,g=p.current.value;if(!k.valid||!f(g,v))return{value:"",validity:{valid:!1}};d({value:v?`${v}-${g}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}function ql(n,i){return i.v1.accounts.$select(n).fetch()}const jl=ft(ql,{maxAge:30*60*1e3});function Yl(){const n=Lt(),{year:i}=n;Ze(i?`Annual Report: ${i}`:"Annual Report");const{masto:o,instance:s}=ie(),[a,c]=E(null),[h,d]=E("default");Z(()=>{i&&(async()=>{d("loading");const b=await o.v1.annualReports.$select(i).fetch();c(b),d("default")})()},[i]);const{accounts:r,annualReports:l,statuses:p}=a||{},m=l?.find(b=>b.year==i)?.data,f=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"]}),h==="loading"&&e("p",{children:[e(De,{abrupt:!0})," ",e(u,{id:"Pwqkdw"})]}),!!m&&e("dl",{children:Object.entries(m).map(([b,v])=>e(D,{children:[e("dt",{children:b}),e("dd",{class:`report-${b}`,children:Array.isArray(v)?e("table",{children:[e("thead",{children:e("tr",{children:Object.entries(v[0]).map(([k,g])=>e("th",{class:k!=="month"&&typeof g=="number"?"number":"",children:k}))})}),e("tbody",{children:v.map(k=>e("tr",{children:Object.entries(k).map(([g,y])=>e("td",{class:g!=="month"&&typeof y=="number"?"number":"",children:y&&/(accountId)/i.test(g)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(b)?e(pt,{account:r?.find(S=>S.id===y),showAvatar:!0}):g==="month"?f.setMonth(y-1)&&f.toLocaleString(void 0,{month:"long"}):typeof y=="number"?y.toLocaleString():y}))}))})]}):typeof v=="object"?/^(topStatuses)$/i.test(b)?e("dl",{children:Object.entries(v).map(([k,g])=>e(D,{children:[e("dt",{children:k}),e("dd",{children:g&&e(ge,{to:`/${s}/s/${g}`,children:e(Ke,{status:p?.find(y=>y.id===g),size:"s",readOnly:!0})})})]}))}):e("table",{children:e("tbody",{children:Object.entries(v).map(([k,g])=>e("tr",{children:[e("th",{children:k}),e("td",{class:typeof g=="number"?"number":"",children:g})]}))})}):typeof v=="string"?v:JSON.stringify(v,null,2)})]}))})]}),e("hr",{}),e("p",{style:{textAlign:"center"},children:e(ge,{to:"/",children:e(u,{id:"iWpEwy"})})})]})}const Vl=20;function eo(){const{_:n}=ce();Ze(n({id:"7Ff7ia"}),"/bookmarks");const{masto:i,instance:o}=ie(),s=F();async function a(c){return(c||!s.current)&&(s.current=i.v1.bookmarks.list({limit:Vl}).values()),await s.current.next()}return e(Ct,{title:n({id:"7Ff7ia"}),id:"bookmarks",emptyText:n({id:"8k2w6G"}),errorText:n({id:"UoL+FC"}),instance:o,fetchItems:a})}const Gl=""+new URL("catch-up-O5q5C75Z.png",import.meta.url).href,Wl="home",ct=[{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}],Zl={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},Xl=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],Jl=[null,"account"],Ql=ks(n=>new Intl.DateTimeFormat(n||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function er(){const{i18n:n,_:i,_:o}=ce(),s=Ql(n.locale);Ze("Catch-up","/catchup");const{masto:a,instance:c}=ie(),[h,d]=mt(),r=h.get("id"),[l,p]=E("start"),[m,f]=E(!1),b=Se(()=>bt(),[]),v=R=>R===b,k=Ve("@pixelfed/home-include-reblogs");async function g({maxCreatedAt:R}){const te=R?new Date(R):null,ne=[],de=a.v1.timelines.home.list({limit:40}),z=de.values();e:for(;;)try{k&&de.params&&(typeof de.params=="string"?de.params+="&include_reblogs=true":de.params.include_reblogs=!0);const ye=await z.next(),{value:ee}=ye;if(ee?.length){await Qs(ee,c);let le=!1;for(let pe=0;pe=te){const at=!v(Ce.reblog?.account?.id||Ce.account.id)&&qt(Ce.reblog?.filtered||Ce.filtered,Wl);if(at?.action==="hide")continue;Ce._filtered=at;const Xe=it(Ce.id,c);Ce._followedTags=x.statusFollowedTags[Xe]?[...x.statusFollowedTags[Xe]]:[],ne.push(Ce),le=!0}if(!le)break e}}else break e;await new Promise(le=>setTimeout(le,1e3))}catch{break e}return ne.forEach(ye=>{if(ye?.inReplyToId){const ee=ne.find(le=>le.id===ye.inReplyToId);ee&&!ee.inReplyToId&&(ee._thread=!0)}}),ne}const[y,S]=E([]),I=F(),w=F(),T=Se(()=>Tn(),[]),_=Qe(async({duration:R}={})=>{const te=Date.now(),ne=R?te-R:null;p("loading");const de=await g({maxCreatedAt:ne}),z=`${T}-${ta()}`;try{await ht.catchup.set(z,{id:z,posts:de,count:de.length,startAt:ne,endAt:te}),d({id:z})}catch{}},[]);Z(()=>{r?(async()=>{const R=await ht.catchup.get(r);R&&(R.posts.sort((te,ne)=>te.createdAt>ne.createdAt?1:-1),S(R.posts),p("results"))})():l==="results"&&(S([]),p("start"))},[r]);const[A,L]=Rt(R=>R+1,0),[M,K]=E(null),[U,V]=E([]);Z(()=>{(async()=>{try{const R=await ht.catchup.keys();if(R.length){const te=Tn(),ne=R.filter(de=>de.startsWith(`${te}-`));if(ne.length){let de=await ht.catchup.getMany(ne);de.sort((le,pe)=>pe.endAt-le.endAt);let z=de.slice(0,3),ye=de.slice(3);const ee=z.map(le=>{const{id:pe,count:Ce,startAt:Je,endAt:dt}=le;return{id:pe,count:Ce,startAt:Je,endAt:dt}});V(ee),K(z[0].endAt),de=null,z=null,queueMicrotask(()=>{ye.length&&ht.catchup.delMany(ye.map(le=>le.id)).then(()=>{ye=null}).catch(le=>{})});return}}}catch{}V([])})()},[A]),Z(()=>{l==="start"&&L()},[l==="start"]);const[J,X]=Se(()=>{let R=0,te=0,ne=0,de=0,z=0,ye=0;const ee={};for(const pe of y){pe._filtered&&pe._filtered?.action!=="blur"?(R++,pe.__FILTER="filtered"):pe.group?(te++,pe.__FILTER="groups"):pe.reblog?(ne++,pe.__FILTER="boosts"):pe._followedTags?.length?(z++,pe.__FILTER="followedTags"):pe.inReplyToId&&pe.inReplyToAccountId!==pe.account?.id?(de++,pe.__FILTER="replies"):(ye++,pe.__FILTER="original");const Ce=pe.reblog||pe;if(pe.__FILTER!=="filtered"&&Ce.card?.url&&Ce.card?.image&&Ce.card?.type==="link"){const{card:Je,favouritesCount:dt,reblogsCount:at}=Ce;let{url:Xe}=Je;if(Xe=Xe.replace(/\/$/,""),!ee[Xe])ee[Xe]={postID:Ce.id,card:Je,shared:1,sharers:[pe.account],likes:dt,boosts:at};else{if(ee[Xe].sharers.find(_t=>_t.id===pe.account.id))continue;ee[Xe].shared++,ee[Xe].sharers.push(pe.account),ee[Xe].postID!==Ce.id&&(ee[Xe].likes+=dt,ee[Xe].boosts+=at)}}}let le=[];for(const pe in ee)le.push({url:pe,...ee[pe]});if(le.sort((pe,Ce)=>pe.shared>Ce.shared?-1:pe.sharedCe.boosts?-1:pe.boostsCe.likes?-1:pe.likes10)e:for(let pe=10;pe{const R={},te=new Map;let ne=y.filter(z=>{const ye=j==="all"||z.__FILTER===j;return ye&&(R[z.account.id]=z.account,te.set(z.account.id,(te.get(z.account.id)||0)+1)),ye});const de={};return ne.forEach(z=>{z.reblog&&(de[z.reblog.id]?(de[z.reblog.id].__BOOSTERS?de[z.reblog.id].__BOOSTERS.add(z.account):de[z.reblog.id].__BOOSTERS=new Set([z.account]),z.__HIDDEN=!0):de[z.reblog.id]=z)}),B&&te.has(B)&&(ne=ne.filter(z=>z.account.id===B||[...z.__BOOSTERS||[]].find(ye=>ye.id===B))),[ne,R,Object.fromEntries(te)]},[j,B,y]),Pe=Se(()=>{const R={};return Ie.forEach(te=>{R[te.id]=te}),R},[Ie]),we=Se(()=>Object.keys(Ae).sort((R,te)=>Ae[te]-Ae[R]),[Ae]),Ne=Se(()=>{const R={};return we.forEach((te,ne)=>{R[te]=ne}),Ie.filter(te=>!te.__HIDDEN).sort((te,ne)=>{if(ue==="account"){const de=te.account.id,z=ne.account.id,ye=R[de],ee=R[z],le=ye-ee;if(le!==0)return le}if(Q!=="createdAt"&&(te=te.reblog||te,ne=ne.reblog||ne,Q!=="density"&&te[Q]===ne[Q]))return te.createdAt>ne.createdAt?1:-1;if(Q==="density"){const de=ss(te),z=ss(ne);return W==="asc"?de>z?1:-1:z>de?1:-1}return W==="asc"?te[Q]>ne[Q]?1:-1:ne[Q]>te[Q]?1:-1})},[Ie,Q,W,ue,we]),He=F(null),Le=F(null),se=F(!1);Z(()=>{y.length>100||se.current||Le.current&&(Fs(Le.current,{duration:200}),se.current=!0)},[y,Le]);const _e=y.length>160?"3d":"2d",Oe=Se(()=>_e!=="2d"?null:y.map(R=>{const te=Pe[R.id];return e("span",{class:`post-dot ${te?"post-dot-highlight":""}`},R.id)}),[Pe]),Te=Se(()=>_e!=="3d"||!y?.length?null:cr(y,"createdAt",320).map((te,ne)=>e("div",{class:"posts-bin",children:te.map(de=>{const z=Pe[de.id];return e("span",{class:`post-dot ${z?"post-dot-highlight":""}`},de.id)})},ne)),[Pe]),N=F(null),q=Se(()=>M?(Date.now()-M)/1e3/60/60:null,[M,$]);Z(()=>{if(l!=="results")return;const R=B&&ke[B]?ke[B].username:"",te=W==="asc"?0:1,ne={account:"authors"};let de=he({duration:5e3,text:o({id:"TLYeLT",values:{selectedFilterCategory:j,sortBy:Q,sortOrder:W,groupBy:ue}})});return()=>{de?.hideToast?.()}},[l,j,B,Q,W,ue,ke]),Z(()=>{if(B&&ke[B]){const R=Le.current.querySelector(`[data-author="${B}"]`),te=Le.current?.getBoundingClientRect(),ne=R?.getBoundingClientRect();ne.leftte.right?R.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):ne.top<0&&R.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[B,ke]);const[O,re]=E(!1),Me=".catchup-list > li > a",P=ze("j",()=>{const R=document.activeElement.closest(Me),te=R?.getBoundingClientRect(),ne=Array.from(N.current.querySelectorAll(Me));if(R&&te.top0){const de=ne.indexOf(R),z=ne[de+1];z&&(z.focus(),z.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const de=ne.find(z=>z.getBoundingClientRect().top>=0);de&&(de.focus(),de.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:R=>R.metaKey||R.ctrlKey||R.altKey||R.shiftKey}),ae=ze("k",()=>{const R=document.activeElement.closest(Me),te=R?.getBoundingClientRect(),ne=Array.from(N.current.querySelectorAll(Me));if(R&&te.top0){const de=ne.indexOf(R);let z=ne[de-1];z&&(z.focus(),z.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const de=ne.find(z=>{const ye=z.getBoundingClientRect();return ye.top>=44&&ye.left>=0});de&&(de.focus(),de.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:R=>R.metaKey||R.ctrlKey||R.altKey||R.shiftKey}),xe=ze("h, l",(R,te)=>{const ne=te.keys[0];if(B){const de=we.indexOf(B);ne==="h"?de>0&&de=0&&(oe(we[de+1]),N.current?.focus())}else ne==="l"&&(oe(we[0]),N.current?.focus())},{useKey:!0,preventDefault:!0,ignoreEventWhen:R=>R.metaKey||R.ctrlKey||R.altKey||R.shiftKey,enableOnFormTags:["input"]}),Ee=ze("esc",()=>{oe(null),N.current?.focus()},{preventDefault:!0,ignoreEventWhen:R=>R.metaKey||R.ctrlKey||R.altKey||R.shiftKey,enableOnFormTags:["input"],useKey:!0}),$e=ze(".",()=>{N.current?.scrollTo({top:0,behavior:"smooth"})},{useKey:!0,preventDefault:!0,ignoreEventWhen:R=>R.metaKey||R.ctrlKey||R.altKey||R.shiftKey,enableOnFormTags:["input"]}),Ye=Qe(R=>{const te=document.activeElement,ne=te?.tagName==="INPUT"&&te.type==="radio";if((R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="ArrowLeft"||R.key==="ArrowRight")&&ne){te.blur();return}},[]);return e("div",{ref:R=>{N.current=R,P.current=R,ae.current=R,xe.current=R,Ee.current=R,$e.current=R},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${l==="loading"?"loading":""}`,onClick:R=>{R.target.closest("a, button")||N.current?.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),l==="results"&&e(ge,{to:"/catchup",class:"button plain",children:e(C,{icon:"history2",size:"l",alt:o({id:"xrl8fj"})})}),l==="start"&&e(ge,{to:"/",class:"button plain",children:e(C,{icon:"home",size:"l",alt:o({id:"i0qMbr"})})})]}),e("h1",{children:l!=="start"&&e(u,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:l!=="start"&&l!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{re(!0)},children:e(u,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:Ye,children:[l==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(u,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(u,{id:"CxKPv6"})}),e("p",{children:e(u,{id:"YMU1CK"})}),e("img",{src:Gl,width:"1200",height:"900",alt:o({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:R=>{R.target.closest("details").open=!1},children:e(u,{id:"2jI8hh"})})})]}),e("p",{children:e(u,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(u,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:I,type:"range",value:$,min:ct[0].value,max:ct[ct.length-1].value,step:"1",list:"catchup-ranges",onChange:R=>Y(+R.target.value)})," ",e("span",{style:{width:"8em"},children:[i(ct[$-1].label),e("br",{}),e("small",{class:"insignificant",children:$==ct[ct.length-1].value?o({id:"NMNiaO"}):tt(new Date(Date.now()-$*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:ct.map(({label:R,value:te})=>e("option",{value:te,label:i(R)}))})," ",e("button",{type:"button",onClick:()=>{if($q?e("p",{class:"catchup-info",children:[e(C,{icon:"info"})," ",e(u,{id:"AGyV7s"})]}):$===ct[ct.length-1].value&&M?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:w})," ",e(u,{id:"dDJEHI",values:{0:s.format(new Date(M))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"EAjFM0"})})}),!!U?.length&&e("div",{class:"catchup-prev",children:[e("p",{children:e(u,{id:"Yfb9A8"})}),e("ul",{children:U.map(R=>e("li",{children:[e(ge,{to:`/catchup?id=${R.id}`,children:[e(C,{icon:"history2"})," ",e("span",{children:R.startAt?s.formatRange(new Date(R.startAt),new Date(R.endAt)):`โ€ฆโ€‰โ€“โ€‰${s.format(new Date(R.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(u,{id:"S6XZwv",values:{0:R.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{if(confirm(o({id:"D9CmP2"}))){let ne=he(o({id:"xJUo4P",values:{0:R.id}}));await ht.catchup.del(R.id),ne?.hideToast?.(),he(o({id:"1dyGG/",values:{0:R.id}})),L()}},children:e(C,{icon:"x",alt:o({id:"t/YqKh"})})})]})]},R.id))}),U.length>=3&&e("p",{children:e("small",{children:e(u,{id:"sXmrl4"})})})]})]}),l==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(De,{abrupt:!0}),e("p",{class:"insignificant",children:e(u,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(u,{id:"q9urQO"})})]}),l==="results"&&e(D,{children:[e("div",{class:"catchup-header",children:[y.length>0&&e("p",{children:e("b",{class:"ib",children:s.formatRange(new Date(y[0].createdAt),new Date(y[y.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:j==="all"&&!B&&Q==="createdAt"&&W==="asc",type:"button",class:"plain4 small",onClick:()=>{G("all"),oe(null),H("createdAt"),be(null),me("asc")},children:e(u,{id:"I9EnzM"})}),X?.length>0&&e("button",{type:"button",class:"plain small",onClick:()=>f(!m),children:[e(u,{id:"EIZREX"})," ",e(C,{icon:"chevron-down",style:{transform:m?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!m,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:X.map(R=>{const{card:te,shared:ne,sharers:de,likes:z,boosts:ye}=R,{blurhash:ee,title:le,description:pe,url:Ce,image:Je,imageDescription:dt,language:at,width:Xe,height:_t,publishedAt:It}=te,At=Ms(Ce);let dn;if(ee){const un=gi(ee),hn=Ei(un);dn=xi([.6,hn[1],hn[2]])}return e("a",{href:Ce,target:"_blank",rel:"noopener",class:"link-block",style:dn?{"--accent-color":`rgb(${dn.join(",")})`,"--accent-alpha-color":`rgba(${dn.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:Je,alt:dt,width:Xe,height:_t,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:At})," ",!!It&&e(D,{children:"ยท "}),!!It&&e(D,{children:e(yt,{datetime:It,format:"micro"})})]}),!!le&&e("h1",{class:"title",lang:at,dir:"auto",title:le,children:le})]}),!!pe&&e("p",{class:"description",lang:at,dir:"auto",title:pe,children:pe}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(u,{id:"bfSr6z",values:{0:de.map(un=>{const{avatarStatic:hn,displayName:ko}=un;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:Mi=>{Mi.preventDefault(),Mi.stopPropagation();const{id:So}=un;oe(So),G("all")},children:e(ut,{url:hn,size:"s",alt:ko})})})}})})]})]})},Ce)})})})}),y.length>=5&&(_e==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:Te}):e("div",{class:"catchup-posts-viz-bar",children:Oe})),y.length>=2&&e("div",{class:"catchup-filters",children:[e("label",{class:"filter-cat",children:[e("input",{type:"radio",name:"filter-cat",checked:j.toLowerCase()==="all",onChange:()=>{G("all")}}),e(u,{id:"N40H+G"})," ",e("span",{class:"count",children:y.length})]}),Object.entries(Zl).map(([R,te])=>!!J[R]&&e("label",{class:"filter-cat",title:(J[R]/y.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:j.toLowerCase()===R.toLowerCase(),onChange:()=>{G(R),R==="boosts"&&(H("reblogsCount"),me("desc"),be(null))}}),i(te)," ",e("span",{class:"count",children:J[R]})]},i(te)))]}),y.length>=2&&!!Ae&&e("div",{class:"catchup-filters authors-filters",ref:Le,children:[we.map(R=>e("label",{class:"filter-author","data-author":R,children:[e("input",{type:"radio",name:"filter-author",checked:B===R,onChange:()=>{oe(R)},onClick:()=>{B===R&&oe(null)}}),e(ut,{url:ke[R].avatarStatic||ke[R].avatar,size:"xxl",alt:`${ke[R].displayName} (@${ke[R].acct})`})," ",e("span",{class:"count",children:Ae[R]}),e("span",{class:"username",children:ke[R].username})]},`${R}-${Ae[R]}`)),we.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(u,{id:"HHtYi7",values:{0:we.length}})},"authors-count")]}),y.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(u,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:Xl.map(R=>e("label",{class:"filter-sort",onClick:te=>{Q===R&&(te.preventDefault(),te.stopPropagation(),me(W==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:Q===R,onChange:()=>{H(R);const te=/(replies|favourites|reblogs)/.test(R)?"desc":"asc";me(te)}}),{createdAt:o({id:"mYGY3B"}),repliesCount:o({id:"N8UzTV"}),favouritesCount:o({id:"zZOZj7"}),reblogsCount:o({id:"puY2t0"}),density:o({id:"0tQ7AD"})}[R],Q===R&&(W==="asc"?" โ†‘":" โ†“")]},R))}),e("span",{class:"filter-label",children:e(u,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:Jl.map(R=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:ue===R,onChange:()=>{be(R)},disabled:R==="account"&&B}),{account:o({id:"dpqPBg"})}[R]||o({id:"EdQY6l"})]},R||"none"))}),B&&we.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{oe(null)},style:{whiteSpace:"nowrap"},children:e(u,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${j||""} ${Q?`catchup-sort-${Q}`:""} ${B&&ke[B]?"catchup-selected-author":""} ${ue?`catchup-group-${ue}`:""}`,children:Ne.map((R,te)=>{const ne=R.reblog?.id||R.id;let de=!1;return ue==="account"&&(He.current&&R.account.id!==He.current&&te>0&&(de=!0),He.current=R.account.id),e(D,{children:[de&&e("li",{class:"separator"}),e(nr,{to:`/${c}/s/${ne}`,post:R,root:N.current})]},`${R.id}-${de}`)})}),e("footer",{children:Ie.length>5&&e("p",{children:[o(j==="boosts"?{id:"eVosYr"}:{id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{N.current.scrollTop=0},children:e(u,{id:"0MgdN+"})}),"."]})})]})]})]}),O&&e(Be,{onClose:()=>re(!1),children:e("div",{class:"sheet",id:"catchup-help-sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>re(!1),children:e(C,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(u,{id:"EIZREX"})}),e("dd",{children:e(u,{id:"YmGrIy"})}),e("dt",{children:e(u,{id:"coaNtr"})}),e("dd",{children:e(u,{id:"UUrqX1"})}),e("dt",{children:e(u,{id:"ScQBC/"})}),e("dd",{children:e(u,{id:"srocAr"})}),e("dt",{children:e(u,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(u,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(u,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const tr=ot(function({post:n}){const{id:i,account:o,group:s,reblog:a,inReplyToId:c,inReplyToAccountId:h,_followedTags:d,_filtered:r,visibility:l,__BOOSTERS:p}=n,m=c&&h!==o.id,f=!!r&&r?.action!=="blur",b=v=>{v.shiftKey};return e("article",{class:`post-line ${s?"group":a?"reblog":d?.length?"followed-tags":""} ${m?"reply-to":""} ${f?"filtered":""} visibility-${l}`,onMouseEnter:b,children:[e("span",{class:"post-author",children:a?e("span",{class:"post-reblog-avatar",children:[e(ut,{url:o.avatarStatic||o.avatar,squircle:o.bot}),p?.size>0?[...p].map(v=>e(ut,{url:v.avatarStatic||v.avatar,squircle:v.bot})):""," ",e(C,{icon:"rocket"})," ",e(pt,{account:a.account,showAvatar:!0})]}):e(pt,{account:o,showAvatar:!0})}),e(or,{post:a||n,filterInfo:r}),e("span",{class:"post-meta",children:[e(ar,{post:a||n})," ",e(yt,{datetime:new Date(a?.createdAt||n.createdAt),format:"micro"})]})]})},(n,i)=>n?.post?.id===i?.post?.id),nr=({root:n,to:i,...o})=>{const s=F(),[a,c]=E(!1);return Z(()=>{const h=new IntersectionObserver(d=>{d[0].isIntersecting&&(queueMicrotask(()=>c(!0)),h.unobserve(s.current))},{root:n,rootMargin:`${Math.max(320,screen.height*.75)}px`});return s.current&&h.observe(s.current),()=>{s.current&&h.unobserve(s.current)}},[]),a?e("li",{children:e(ge,{to:i,children:e(tr,{...o})})}):e("li",{ref:s,style:{height:"4em"}})},ir=8,sr=8;function ss(n){const{spoilerText:i,content:o,poll:s,mediaAttachments:a,card:c}=n,h=s?.options?.length?s.options.reduce((r,l)=>r+l.title,""):"";return(i.length+$s(o)+h.length)/140+(a?.length?ir*a.length:c?.image?sr:0)}const Tt=48;function or({post:n,filterInfo:i}){const{_:o}=ce(),{spoilerText:s,sensitive:a,content:c,emojis:h,poll:d,mediaAttachments:r,card:l,inReplyToId:p,inReplyToAccountId:m,account:f,_thread:b}=n,v=p&&m===f.id||!!b,g=!!ri()["reading:expand:spoilers"],y=g||!s&&!a&&i?.action!=="blur",S=c?Pn(n):"",I=!s||g;return e("div",{class:"post-peek",title:s?"":S,children:[e("span",{class:"post-peek-content",children:[v&&!I&&e(D,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),i&&i?.action!=="blur"?e("span",{class:"post-peek-filtered",children:i?.titlesStr?o({id:"suKjh3",values:{0:i.titlesStr}}):o({id:"03Qqf9"})}):e(D,{children:[!!s&&e("span",{class:"post-peek-spoiler",children:[e(C,{icon:`${g?"eye-open":"eye-close"}`})," ",s]}),I&&e("div",{class:"post-peek-html",children:[v&&e(D,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(u,{id:"e66y2Z"})})," "]}),!!c&&e("div",{dangerouslySetInnerHTML:{__html:na(c,h)}}),!!d?.options?.length&&d.options.map(w=>e("div",{children:[d.multiple?"โ–ช๏ธ":"โ€ข"," ",w.title]})),!c&&r?.length===1&&r[0].description&&e(D,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:r[0].description})]})]})]})]}),(!i||i?.action==="blur")&&e("span",{class:"post-peek-post-content",children:[!!d&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(C,{icon:"poll",size:"s"}),e(u,{id:"4WUbF1"})]}),r?.length?r.map(w=>{const T=w.previewUrl||w.url,_=w.previewRemoteUrl||w.remoteUrl,A=w.meta?.original?w.meta.original.width:w.meta?.small?.width||w.meta?.original?.width,L=w.meta?.original?w.meta.original.height:w.meta?.small?.height||w.meta?.original?.height;return e("span",{class:"post-peek-media",children:{image:(T||_)&&y?e("img",{src:T,width:Tt,height:Tt,alt:w.description,loading:"lazy",onError:M=>{const{src:K}=M.target;K===T&&(M.target.src=_)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(A,L)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"๐Ÿ–ผ"}),gifv:(T||_)&&y?e("img",{src:T,width:Tt,height:Tt,alt:w.description,loading:"lazy",onError:M=>{const{src:K}=M.target;K===T&&(M.target.src=_)}}):e("span",{class:"post-peek-faux-media",children:"๐ŸŽž๏ธ"}),video:(T||_)&&y?e("img",{src:T,width:Tt,height:Tt,alt:w.description,loading:"lazy",onError:M=>{const{src:K}=M.target;K===T&&(M.target.src=_)}}):e("span",{class:"post-peek-faux-media",children:"๐Ÿ“น"}),audio:e("span",{class:"post-peek-faux-media",children:"๐ŸŽต"})}[w.type]||null},w.id)}):!!l&&l.image&&y&&e("span",{class:`post-peek-media post-peek-card card-${l.type||""}`,children:l.image?e("img",{src:l.image,width:Tt,height:Tt,alt:l.title||l.description||l.imageDescription,loading:"lazy",style:{"--anim-duration":l.width&&l.height&&`${Math.min(Math.max(Math.max(l.width,l.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"๐Ÿ”—"})})]})]})}function ar({post:n}){const{_:i}=ce(),{reblogsCount:o,repliesCount:s,favouritesCount:a}=n;return e("span",{class:"post-stats",children:[s>0&&e("span",{class:"post-stat-replies",children:[e(C,{icon:"comment2",size:"s",alt:i({id:"N8UzTV"})})," ",Ge(s)]}),a>0&&e("span",{class:"post-stat-likes",children:[e(C,{icon:"heart",size:"s",alt:i({id:"zZOZj7"})})," ",Ge(a)]}),o>0&&e("span",{class:"post-stat-boosts",children:[e(C,{icon:"rocket",size:"s",alt:i({id:"puY2t0"})})," ",Ge(o)]})]})}function cr(n,i,o){const s=n.map(r=>new Date(r[i])),a=s.reduce((r,l)=>ll>r?l:r,s[0]),h=Math.min(c.getTime(),Date.now())-a.getTime(),d=Array.from({length:o},()=>[]);return n.forEach(r=>{const l=new Date(r[i]);if(l.getTime()>Date.now())d[d.length-1].push(r);else{const p=(l.getTime()-a.getTime())/h,m=Math.floor(p*(o-1));d[m].push(r)}}),d}const lr=20;function to(){const{_:n}=ce();Ze(n({id:"zZOZj7"}),"/favourites");const{masto:i,instance:o}=ie(),s=F();async function a(c){return(c||!s.current)&&(s.current=i.v1.favourites.list({limit:lr}).values()),await s.current.next()}return e(Ct,{title:n({id:"zZOZj7"}),id:"favourites",emptyText:n({id:"PHIrMr"}),errorText:n({id:"khVljG"}),instance:o,fetchItems:a})}const rr=["home","public","notifications","thread","account"],os=["thread","account"],dr={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},ur=[0,30*60,60*60,6*60*60,12*60*60,60*60*24,60*60*24*7,60*60*24*30],Xn={0:{id:"qqeAJM"},1800:et(30,"minute"),3600:et(1,"hour"),21600:et(6,"hour"),43200:et(12,"hour"),86400:et(24,"hour"),604800:et(7,"day"),2592e3:et(30,"day")};function hr(){const{_:n}=ce(),{masto:i}=ie();Ze(n({id:"cSev+j"}),"/ft");const[o,s]=E("default"),[a,c]=E(!1),[h,d]=Rt(p=>p+1,0),[r,l]=E([]);return Z(()=>{s("loading"),(async()=>{try{const p=await i.v2.filters.list();p.sort((m,f)=>m.title.localeCompare(f.title)),p.forEach(m=>{m.keywords?.length&&m.keywords.sort((f,b)=>f.id-b.id)}),l(p),s("default")}catch{s("error")}})()},[h]),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(C,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{c(!0)},children:e(C,{icon:"plus",size:"l",alt:n({id:"yFfBdX"})})})})]})}),e("main",{children:r.length>0?e(D,{children:[e("ul",{class:"filters-list",children:r.map(p=>{const{id:m,title:f,expiresAt:b,keywords:v}=p;return e("li",{children:[e("div",{children:[e("h2",{children:f}),v?.length>0&&e("div",{children:v.map(k=>e(D,{children:[e("span",{class:"tag collapsed insignificant",children:k.wholeWord?`โ€œ${k.keyword}โ€`:k.keyword})," "]}))}),e("small",{class:"insignificant",children:e(no,{expiresAt:b})})]}),e("button",{type:"button",class:"plain",onClick:()=>{c({filter:p})},children:e(C,{icon:"pencil",size:"l",alt:"Edit filter"})})]},m)})}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(u,{id:"5vzJxv",values:{0:r.length}})})})]}):o==="loading"?e("p",{class:"ui-state",children:e(De,{})}):o==="error"?e("p",{class:"ui-state",children:e(u,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(u,{id:"cWIHTt"})})})]}),!!a&&e(Be,{title:n({id:"vCSBPD"}),onClose:()=>{c(!1)},children:e(mr,{filter:a?.filter,onClose:p=>{p.state==="success"&&d(),c(!1)}})})]})}let pr=1;const fr=()=>pr++;function mr({filter:n,onClose:i}){const{_:o,_:s}=ce(),{masto:a}=ie(),[c,h]=E("default"),d=!!n,{context:r,expiresAt:l,id:p,keywords:m,title:f,filterAction:b}=n||{},v=!!l,k=v&&new Date(l),[g,y]=E(m||[]),S=F(),[I,w]=E([]),[T,_]=E([]),A=g.filter(L=>!I.includes(L.id)&&!T.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(C,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:s(d?{id:"3mOee6"}:{id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:L=>{L.preventDefault();const M=new FormData(L.target),K=M.get("title"),U=M.getAll("keyword_attributes[][id]"),V=M.getAll("keyword_attributes[][keyword]"),J=[...S.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(oe=>oe.checked),X=V.map((oe,$)=>({id:U[$]||void 0,keyword:oe,wholeWord:J[$]}));d&&I?.length&&I.forEach(oe=>{X.push({id:oe,_destroy:!0})});const j=M.getAll("context");let G=M.get("expires_in");const B=M.get("filter_action");!K||!j?.length||(h("loading"),(async()=>{try{let oe;d?(G===""||G===null?v?G=Math.floor((k-new Date)/1e3):G=null:G==="0"||G===0?G=null:G=+G,oe=await a.v2.filters.$select(p).update({title:K,context:j,expiresIn:G,keywordsAttributes:X,filterAction:B})):(G=+G||null,oe=await a.v2.filters.create({title:K,context:j,expiresIn:G,keywordsAttributes:X,filterAction:B})),h("default"),i?.({state:"success",filter:oe})}catch{h("error"),alert(s(d?{id:"H8RP+h"}:{id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(u,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:f,disabled:c==="loading",dir:"auto",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:S,children:[A.length?e("ul",{class:"filter-keywords",children:A.map(L=>{const{id:M,keyword:K,wholeWord:U,_id:V}=L;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:M}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:K,disabled:c==="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:M,defaultChecked:U,disabled:c==="loading"})," ",e(u,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:c==="loading",onClick:()=>{M?(I.push(M),w([...I])):V&&(T.push(V),_([...T]))},children:e(C,{icon:"x",alt:s({id:"t/YqKh"})})})]})]},`${M}-${V}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(u,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{y([...g,{_id:fr(),keyword:"",wholeWord:!0}]),setTimeout(()=>{const L=S.current.querySelectorAll('input[type="text"]');L[L.length-1]?.focus?.()},10)},children:e(u,{id:"qn5Dbn"})})," ",A?.length>1&&e("small",{class:"insignificant",children:e(u,{id:"1JZ175",values:{0:A.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(u,{id:"uqf7Yq"})})}),rr.map(L=>e("div",{children:[e("label",{class:os.includes(L)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:L,defaultChecked:r?r.includes(L):!0,disabled:c==="loading"})," ",o(dr[L]),os.includes(L)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(u,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[d&&e(u,{id:"ucJk3m",components:{0:e("b",{}),1:e(no,{expiresAt:l,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:s(d?{id:"BcNdg+"}:{id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:c==="loading",defaultValue:d?void 0:0,children:[d&&e("option",{}),ur.map(L=>e("option",{value:L,children:typeof Xn[L]=="function"?Xn[L]():o(Xn[L])}))]})]}),e("p",{children:[e(u,{id:"blQMpa"}),e("br",{}),di()?.mastodon>=5&&e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"blur",defaultChecked:b==="blur",disabled:c==="loading"})," ",e(u,{id:"ggxOw9"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:b!=="hide"&&b!=="blur"||!d,disabled:c==="loading"})," ",e(u,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:b==="hide",disabled:c==="loading"})," ",e(u,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:c==="loading",children:s(d?{id:"tfDRzk"}:{id:"hYgDIe"})})," ",e(De,{abrupt:!0,hidden:c!=="loading"})]}),d&&e(rt,{disabled:c==="loading",align:"end",menuItemClassName:"danger",confirmLabel:s({id:"BPjyR2"}),onClick:()=>{h("loading"),(async()=>{try{await a.v2.filters.$select(p).remove(),h("default"),i?.({state:"success"})}catch{h("error"),alert(s({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:c==="loading",children:e(u,{id:"Jb6/SB"})})})]})]})})]})}function no({expiresAt:n,showNeverExpires:i}){const{_:o}=ce(),s=!!n,a=s&&new Date(n),c=s&&a<=new Date,[h,d]=Rt(r=>r+1,0);return fi(d,c||3e4),c?o({id:"M1RnFv"}):s?e(u,{id:"urGtsw",components:{0:e(yt,{datetime:a})}}):i&&o({id:"O1Aswy"})}function gr(){const{_:n}=ce(),{masto:i,instance:o}=ie();Ze(n({id:"Xi1/bw"}),"/fh");const[s,a]=E("default"),[c,h]=E([]);return Z(()=>{a("loading"),(async()=>{try{const d=await $n();h(d),a("default")}catch{a("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(C,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:c.length>0?e(D,{children:[e("ul",{class:"link-list",children:c.map(d=>e("li",{children:e(ge,{to:o?`/${o}/t/${d.name}`:`/t/${d.name}`,children:[e(C,{icon:"hashtag",alt:"#"})," ",e("span",{children:d.name})]})}))}),c.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(u,{id:"2S/uvJ",values:{0:c.length}})})})]}):s==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(u,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(u,{id:"vKsGhk"})})})]})})}const br=20;function Li({title:n,path:i,id:o,...s}){const{_:a}=ce();Ze(n||a({id:"following.title"}),i||"/following");const{masto:c,streaming:h,instance:d}=ie(),r=qe(x),l=F(),p=F(),m=F();__BENCHMARK.end("time-to-following");const f=Ve("@pixelfed/home-include-reblogs");async function b(k){(k||!p.current)&&(__BENCHMARK.start("fetch-home-first"),l.current=c.v1.timelines.home.list({limit:br}),p.current=l.current.values()),f&&l.current?.params&&(typeof l.current.params=="string"?l.current.params+="&include_reblogs=true":l.current.params.include_reblogs=!0);const g=await p.current.next();let{value:y}=g;if(y?.length){let S=!1;k&&(y[0].id!==m.current&&(S=!0),m.current=y[0].id),y.forEach(I=>{We(I,d)}),y=ts(y,d),k&&S&&El(),Qs(y,d),y.sort((I,w)=>{const T=new Date(I.createdAt);return new Date(w.createdAt)-T})}return __BENCHMARK.end("fetch-home-first"),{...g,value:y}}async function v(){try{const k={limit:5,since_id:m.current};Ve("@pixelfed/home-include-reblogs")&&(k.include_reblogs=!0);const g=await c.v1.timelines.home.list(k).values().next();let{value:y}=g;const S=y[0]?.id===m.current;return!!(y?.length&&!S&&(m.current=y[0].id,y=ts(y,d),y=Pt(y,"home"),y.some(I=>!I.reblog)))}catch{return!1}}return Z(()=>{let k;return(async()=>{if(h){k=h.user.subscribe();for await(const g of k){if(!k)break;if(g.event==="status.update"){const y=g.payload;We(y,d)}else if(g.event==="delete"){const y=g.payload,S=Ss(y,d);S&&(S._deleted=!0)}}}})(),()=>{k?.unsubscribe?.(),k=null}},[h]),e(Ct,{title:n||a({id:"following.title"}),id:o||"following",emptyText:a({id:"nJEKbY"}),errorText:a({id:"7QSeK6"}),instance:d,fetchItems:b,checkForUpdates:v,useItemID:!0,boostsCarousel:r.settings.boostsCarousel,...s,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const vr=20,yr=4,as=yr+1;function io({media:n,columnMode:i,...o}){const{_:s}=ce();let{hashtag:a,...c}=i?{}:Lt();o.hashtag&&(a=o.hashtag);let h=a.trim().split(/[\s+]+/);h.sort(),a=h[0];const[d,r]=mt(),l=n||!!d.get("media"),p=l?"?media=1":"",{masto:m,instance:f,authenticated:b}=ie({instance:o?.instance||c.instance}),{masto:v,instance:k,authenticated:g}=ie(),y=h.map($=>`#${$}`).join(" "),S=s(f?l?{id:"kH0rA0",values:{hashtagTitle:y,instance:f}}:{id:"IK0zKi",values:{hashtagTitle:y,instance:f}}:l?{id:"hHSI3w",values:{hashtagTitle:y}}:{id:"+ZzjRY",values:{hashtagTitle:y}});Ze(S,"/:instance?/t/:hashtag");const I=F(),w=Se(()=>hi(),[]),T=F(void 0);async function _($){const Y=await m.v1.timelines.tag.$select(a).list({limit:vr,any:h.slice(1),maxId:$?void 0:T.current,onlyMedia:l?!0:void 0}).values().next();let{value:Q}=Y;return Q?.length&&($&&(I.current=Q[0].id),Q.forEach(H=>{We(H,f,{skipThreading:l||w})}),T.current=Q[Q.length-1].id),{...Y,value:Q}}async function A(){try{const $=await m.v1.timelines.tag.$select(a).list({limit:1,any:h.slice(1),since_id:I.current,onlyMedia:l}).values().next();let{value:Y}=$;const Q=Y[0]?.id===I.current;return Y?.length&&!Q?(Y=Pt(Y,"public"),!0):!1}catch{return!1}}const[L,M]=E("default"),[K,U]=E();Z(()=>{(async()=>{try{const $=await m.v1.tags.$select(a).fetch();U($)}catch{}})()},[a]);const V=h.length>=as,[J,X]=E("default"),[j,G]=E([]),[B,oe]=E(!1);return Z(()=>{b&&(async()=>{try{const $=await m.v1.featuredTags.list();G($),oe($.some(Y=>Y.name.toLowerCase()===a.toLowerCase()))}catch{}})()},[]),e(D,{children:[e(Ct,{title:S,titleComponent:!!f&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:y}),e("div",{children:f})]}),id:"hashtag",instance:f,emptyText:s({id:"CNSLAW"}),errorText:s({id:"yjj6Ll"}),fetchItems:_,checkForUpdates:A,useItemID:!0,view:l||w?"media":void 0,refresh:l,filterContext:"public",headerEnd:e(st,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(C,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[!!K&&h.length===1&&e(D,{children:[e(rt,{subMenu:!0,confirm:K.following,confirmLabel:s({id:"ctJi7k",values:{hashtag:a}}),disabled:L==="loading"||!b,onClick:()=>{M("loading"),K.following?m.v1.tags.$select(a).unfollow().then(()=>{U({...K,following:!1}),he(s({id:"doK/ij",values:{hashtag:a}}))}).catch($=>{alert($)}).finally(()=>{M("default")}):m.v1.tags.$select(a).follow().then(()=>{U({...K,following:!0}),he(s({id:"R9+aEN",values:{hashtag:a}}))}).catch($=>{alert($)}).finally(()=>{M("default")})},children:K.following?e(D,{children:[e(C,{icon:"check-circle"})," ",e("span",{children:e(u,{id:"HOSk7R"})})]}):e(D,{children:[e(C,{icon:"plus"})," ",e("span",{children:e(u,{id:"MKEPCY"})})]})}),e(ve,{type:"checkbox",checked:B,disabled:J==="loading"||!b,onClick:()=>{if(X("loading"),B){const $=j.find(Y=>Y.name.toLowerCase()===a.toLowerCase()).id;$?m.v1.featuredTags.$select($).remove().then(()=>{oe(!1),he(s({id:"VH+Tf9"})),G(j.filter(Y=>Y.id!==$))}).catch(Y=>{}).finally(()=>{X("default")}):he(s({id:"3OLv47"}))}else m.v1.featuredTags.create({name:a}).then($=>{oe(!0),he(s({id:"9ra4hn"})),G(j.concat($))}).catch($=>{}).finally(()=>{X("default")})},children:B?e(D,{children:[e(C,{icon:"check-circle"}),e("span",{children:e(u,{id:"9ra4hn"})})]}):e(D,{children:[e(C,{icon:"check-circle"}),e("span",{children:e(u,{id:"UlJ3QN"})})]})}),e(Ue,{})]}),!w&&e(D,{children:[e(bi,{className:"plain",children:e(u,{id:"cSev+j"})}),e(ve,{type:"checkbox",checked:!!l,onClick:()=>{l?d.delete("media"):d.set("media","1"),r(d)},children:[e(C,{icon:"check-circle",alt:"โ˜‘๏ธ"})," ",e("span",{class:"menu-grow",children:e(u,{id:"eK4SL/"})})]}),e(Ue,{})]}),e(ia,{className:"menu-field",disabled:V,children:({ref:$})=>e("form",{onSubmit:Y=>{Y.preventDefault();const Q=Y.target[0].value?.trim?.();Q&&!h.some(H=>H.toLowerCase()===Q.toLowerCase())&&(h.push(Q),h.sort(),location.hash=f?`/${f}/t/${h.join("+")}${p}`:`/t/${h.join("+")}${p}`)},children:[e(C,{icon:"hashtag"}),e("input",{ref:$,type:"text",placeholder:V?fe._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:as}}):s({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:V,dir:"auto"})]})}),e(sa,{takeOverflow:!0,children:h.map(($,Y)=>e(ve,{disabled:h.length===1,onClick:Q=>{h.splice(Y,1),h.sort(),location.hash=f?`/${f}/t/${h.join("+")}${p}`:`/t/${h.join("+")}${p}`},children:[e(C,{icon:"x",alt:s({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),$]})]},$))}),e(Ue,{}),e(ve,{disabled:!g,onClick:()=>{if(x.shortcuts.length>=kt){alert(fe._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:kt}}));return}const $={type:"hashtag",hashtag:h.join(" "),instance:f,media:l?"on":void 0};x.shortcuts.some(Q=>Q.type===$.type&&Q.hashtag.split(/[\s+]+/).sort().join(" ")===$.hashtag.split(/[\s+]+/).sort().join(" ")&&(Q.instance?Q.instance===$.instance:!0)&&(Q.media?!!Q.media==!!$.media:!0))?alert(s({id:"kfeQnS"})):(x.shortcuts.push($),he(s({id:"MIhb91"})))},children:[e(C,{icon:"shortcut"})," ",e("span",{children:e(u,{id:"i02Lq/"})})]}),e(ve,{onClick:()=>{let $=prompt(s({id:"2MQ2cd"}));if(!/\./.test($)){$&&alert(s({id:"7WddtO"}));return}$&&($=$.toLowerCase().trim(),location.hash=`/${$}/t/${h.join("+")}${p}`)},children:[e(C,{icon:"bus"})," ",e("span",{children:e(u,{id:"Sq04Yc"})})]}),k!==f&&e(ve,{onClick:()=>{location.hash=`/${k}/t/${h.join("+")}${p}`},children:[e(C,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"iAzCp4",values:{currentInstance:k},components:{0:e("b",{})}})})]})]})},f+y),!i&&!!h?.length&&e("data",{class:"compose-data",value:JSON.stringify({draftStatus:{status:`${h.length>1?` `:" "}${y}`}})})]})}const wr=20;function so(n){const{_:i}=ce(),o=qe(x),{masto:s,instance:a}=ie(),c=n?.id||Lt()?.id,h=F(),d=F();async function r(S){(S||!d.current)&&(d.current=s.v1.timelines.list.$select(c).list({limit:wr}).values());const I=await d.current.next();let{value:w}=I;return w?.length&&(S&&(h.current=w[0].id),w.forEach(T=>{We(T,a)})),{...I,value:w}}async function l(){try{const S=await s.v1.timelines.list.$select(c).list({limit:1,since_id:h.current});let{value:I}=S;const w=I[0]?.id===h.current;return I?.length&&!w?(I=Pt(I,"home"),!0):!1}catch{return!1}}const[p,m]=E([]),[f,b]=E({title:"List"});Ze(f.title,"/l/:id"),Z(()=>{(async()=>{try{const S=await js(c);b(S)}catch{}})()},[c]);const[v,k]=E(!1),[g,y]=E(!1);return e(D,{children:[e(Ct,{title:f.title,id:"list",emptyText:i({id:"KkDhfU"}),errorText:i({id:"7QSeK6"}),instance:a,fetchItems:r,checkForUpdates:l,useItemID:!0,boostsCarousel:o.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(st,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(C,{icon:"list",size:"l",alt:i({id:"h16FyT"})}),e(C,{icon:"chevron-down",size:"s"})]}),onMenuChange:S=>{S.open&&rn().then(m)},children:[e(Fe,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),p?.length>0&&e(D,{children:[e(Ue,{}),p.map(S=>e(Fe,{to:`/l/${S.id}`,children:e("span",{children:[S.title,S.exclusive&&e(D,{children:[" ",e(Ot,{})]})]})},S.id))]})]}),headerEnd:e(st,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(C,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[f?.exclusive&&e(D,{children:[e(bi,{className:"plain",children:[e(Ot,{})," ",e(u,{id:"FNptcJ"})]}),e(Ue,{})]}),e(ve,{onClick:()=>k({list:f}),children:[e(C,{icon:"pencil",size:"l"}),e("span",{children:e(u,{id:"ePK91l"})})]}),e(ve,{onClick:()=>y(!0),children:[e(C,{icon:"group",size:"l"}),e("span",{children:e(u,{id:"hB02vO"})})]})]})},c),v&&e(Be,{onClick:S=>{S.target===S.currentTarget&&k(!1)},children:e(Ti,{list:v?.list,onClose:S=>{S.state==="success"&&S.list?b(S.list):S.state==="deleted"&&(location.hash="/l"),k(!1)}})}),g&&e(Be,{onClick:S=>{S.target===S.currentTarget&&y(!1)},children:e(Sr,{listID:c,onClose:()=>y(!1)})})]})}const kr=40;function Sr({listID:n,onClose:i}){const{_:o}=ce(),{masto:s,instance:a}=ie(),[c,h]=E([]),[d,r]=E("default"),[l,p]=E(!1),m=F();async function f(b){p(!1),r("loading"),(async()=>{try{(b||!m.current)&&(m.current=s.v1.lists.$select(n).accounts.list({limit:kr}).values());const v=await m.current.next();let{done:k,value:g}=v;g?.length?(h(b?g:c.concat(g)),p(!k)):p(!1),r("default")}catch{r("error")}})()}return Z(()=>{f(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(C,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[c.map(b=>e("li",{children:[e(lt,{account:b,instance:a}),e(Cr,{account:b,listID:n})]},b.id)),l&&d==="default"&&e(St,{as:"li",onChange:b=>b&&f(),children:e("button",{type:"button",class:"light block",onClick:f,children:e(u,{id:"uXRAkV"})})})]})})]})}function Cr({account:n,listID:i}){const{_:o}=ce(),{masto:s}=ie(),[a,c]=E("default"),[h,d]=E(!1);return e(rt,{confirm:!h,confirmLabel:e("span",{children:e(u,{id:"j5n9Ry",values:{0:n.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{h?(c("loading"),(async()=>{try{await s.v1.lists.$select(i).accounts.create({accountIds:[n.id]}),c("default"),d(!1)}catch{c("error")}})()):(c("loading"),(async()=>{try{await s.v1.lists.$select(i).accounts.remove({accountIds:[n.id]}),c("default"),d(!0)}catch{c("error")}})())},children:e("button",{type:"button",class:`light ${h?"":"danger"}`,disabled:a==="loading",children:o(h?{id:"m16xKo"}:{id:"MWIaew"})})})}const _r={mention:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},Ir=["favourite","reblog","follow"],oo=n=>Ir.includes(n);function ao(n){return n.filter(i=>{const{type:o,id:s,createdAt:a}=i;if(!o)return!1;const c=_r[o];return c?.length?c.every(h=>!!i[h]):!0})}function co(n){if(n?.notificationGroups){const{accounts:i=[],notificationGroups:o=[],statuses:s=[]}=n;return o.map(a=>{const{sampleAccountIds:c,statusId:h}=a,d=c?.map(l=>i.find(p=>p.id===l))||[],r=s?.find(l=>l.id===h)||null;return{...a,sampleAccounts:d,status:r}})}return n}function Ar(n){const i=n.map(h=>{const{latestPageNotificationAt:d,mostRecentNotificationId:r,sampleAccounts:l,notificationsCount:p}=h;return{id:""+r,createdAt:d,account:l[0],...h}}),o={},s=[];for(let h=0;h0&&f?.length>0&&m>f?.length)&&(r==="favourite"||r==="reblog")&&(k="favourite+reblog");const y=`${l?.id}-${k}-${v}`,S=o[y];if(!oo(r))s.push(d);else if(S)f.forEach(I=>{const w=S.sampleAccounts.find(T=>T.id===I.id);w?(w._types.push(r),w._types.sort().reverse()):S.sampleAccounts.push({...I,_types:[r]})}),S.notificationsCount=Math.min(S.notificationsCount,m),S._notificationsCount.push(m),S._sampleAccountsCount.push(f?.length),S._accounts=S.sampleAccounts,S._groupKeys.push(b);else{const I=f.map(w=>({...w,_types:[r]}));o[y]={...d,sampleAccounts:I,type:k,_accounts:I,_groupKeys:b?[b]:[],_notificationsCount:[m],_sampleAccountsCount:[f?.length]},s.push(o[y])}}const a={},c=[];for(let h=0;hS.id===p.id);y?(y._types.push(m),y._types.sort().reverse(),g._ids+=`-${r}`):(p._types=[m],g._accounts.push(p),g._ids+=`-${r}`)}else{p&&(p._types=[m]);let y=i[k]={...d,type:v,_ids:r,_accounts:p?[p]:[]};o[h++]=y}}const s={},a=[];for(let c=0,h=0;c{We(T,a)})),{...I,value:w?.map(T=>T.status)}}const f=F(),b=F();async function v(S){(S||!f.current)&&(f.current=s.v1.conversations.list({limit:cs}).values());const I=await f.current.next();let{value:w}=I;return w=w?.filter(T=>T.lastStatus),w?.length&&(S&&(b.current=w[0].lastStatus.id),w.forEach(({lastStatus:T})=>{We(T,a)})),{...I,value:w?.map(T=>T.lastStatus)}}function k(...S){return r==="private"?v(...S):m(...S)}async function g(){if(r==="private")try{const S=await s.v1.conversations.list({limit:1,since_id:b.current}).values().next();let{value:I}=S;const w=I[0]?.id===b.current;return I?.length&&!w?(b.current=I[0].lastStatus.id,!0):!1}catch{return!1}else try{const S=await s.v1.notifications.list({limit:1,types:["mention"],since_id:p.current}).values().next();let{value:I}=S;return I?.length?(p.current=I[0].id,!0):!1}catch{return!1}}const y=Se(()=>e("div",{class:"filter-bar centered",children:[e(ge,{to:"/mentions",class:r?"":"is-active",onClick:S=>{n&&(S.preventDefault(),d(null))},children:e(u,{id:"N40H+G"})}),e(ge,{to:"/mentions?type=private",class:r==="private"?"is-active":"",onClick:S=>{n&&(S.preventDefault(),d("private"))},children:e(u,{id:"zwBp5t"})})]}),[r]);return e(Ct,{title:o({id:"/bZzdR"}),id:"mentions",emptyText:o({id:"03jFGT"}),errorText:o({id:"pqR9KF"}),instance:a,fetchItems:k,checkForUpdates:g,useItemID:!0,timelineStart:y,refresh:r,filterContext:"notifications"})}const Er=80,Rr=20,Lr=new URLSearchParams,fn={block:"center",inline:"center",behavior:"smooth"},ro=ks(()=>di()?.mastodon>=2,{maxAge:1e3*60*5});function uo(n={}){const{masto:i}=ie();return x.settings.groupedNotificationsAlpha&&ro()?i.v2.notifications.list({limit:Rr,...n}):i.v1.notifications.list({limit:Er,...n})}function ho(n={}){return uo(n).values()}function po(n){return x.settings.groupedNotificationsAlpha&&ro()?Ar(n):Tr(n)}const Mr=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],$r={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function Nr({columnMode:n}){const{_:i,_:o}=ce();Ze(o({id:"iDNBZe"}),"/notifications");const{masto:s,instance:a}=ie(),c=qe(x),[h,d]=E("default"),[r]=n?[Lr]:mt(),l=r.get("id"),p=r.get("access_token"),[m,f]=E(!1),[b,v]=E(!1),k=F(),{nearReachEnd:g,scrollDirection:y,reachStart:S,nearReachStart:I}=Rl({scrollableRef:k}),w=y==="end"&&!I,[T,_]=E([]),[A,L]=E([]),M=F(),K=F();async function U(P){if((P||!K.current)&&(M.current=uo({excludeTypes:["follow_request"]}),K.current=M.current.values()),/max_id=($|&)/i.test(K.current?.nextParams))return{done:!0};const ae=await K.current.next(),xe=co(ae.value);if(xe?.length){xe.forEach($e=>{We($e.status,a,{skipThreading:!0})});const Ee=po(xe);P?(x.notificationsLast=Ee[0],x.notifications=Ee,s.v1.markers.create({notifications:{lastReadId:Ee[0].id}}).catch(()=>{})):x.notifications.push(...Ee)}return x.notificationsShowNew=!1,x.notificationsLastFetchTime=Date.now(),ae}async function V(){try{return await s.v1.followRequests.list({limit:80})}catch{return[]}}const J=()=>{d("loading"),(async()=>{try{const P=await V();_(P),d("default")}catch{d("error")}})()};async function X(){try{return await s.v1.announcements.list()}catch{return[]}}const j=Ve("@mastodon/filtered-notifications"),[G,B]=E(!1),[oe,$]=E({});function Y(){return s.v2.notifications.policy.fetch().catch(()=>{})}function Q(){Y().then(P=>{$(P)}).catch(()=>{})}const[H,W]=E(null);function me(){return s.v1.notifications.requests.list()}const ue=P=>{Ie(!1),d("loading"),(async()=>{try{const ae=U(P);P&&(X().then(Ee=>{Ee.sort(($e,Ye)=>{const R=new Date($e.updatedAt||$e.createdAt);return new Date(Ye.updatedAt||Ye.createdAt)-R}),L(Ee)}).catch(()=>{}),V().then(Ee=>{_(Ee)}).catch(()=>{}),j&&Q());const{done:xe}=await ae;f(!xe),d("default")}catch{d("error")}})()};Z(()=>{ue(!0)},[]),Z(()=>{S&&ue(!0)},[S]);const[be,Ie]=E(!1),ke=Qe(({disableIdleCheck:P=!1}={})=>{h!=="loading"&&c.settings.autoRefresh&&k.current?.scrollTop<16&&(P||window.__IDLE__)&&!Pr()&&ue(!0)},[c.notificationsShowNew,c.settings.autoRefresh,h]),Ae=F();jt(P=>{if(P){const ae=Date.now()-Ae.current;!Ae.current||ae>1e3*3?ke({disableIdleCheck:!0}):Ae.current=Date.now()}});const Pe=F(!0);Z(()=>{let P=No(x,"notificationsShowNew",ae=>{if(Pe.current){Pe.current=!1;return}h!=="loading"&&(ae&&ke(),Ie(ae))});return()=>P?.()},[]);const we=new Date,Ne=new Date(we-24*60*60*1e3);let He=new Date;const Le=!c.notifications.some(P=>new Date(P.createdAt).toDateString()===we.toDateString()),se=F();Z(()=>{l&&(x.routeNotification={id:l,accessToken:atob(p)})},[l,p]);const[_e,Oe]=E(null);Z(async()=>{const P=new Date;if(P.getMonth()!==11||!Ve("@mastodon/annual-report"))return;let ae=Re.account.get("annualReportNotification");if(ae){Oe(ae);return}const xe=ho({types:["annual_report"]});try{ae=(await xe.next())?.value?.notificationGroups?.[0],ae?.annualReport?.year==P.getFullYear()&&(Oe(ae),Re.account.set("annualReportNotification",ae))}catch{}},[]);const Te=".notification",N=ze("j",()=>{const P=document.activeElement.closest(Te),ae=P?.getBoundingClientRect(),xe=Array.from(k.current.querySelectorAll(Te));if(P&&ae.top0){const Ee=xe.indexOf(P);let $e=xe[Ee+1];$e&&($e.focus(),$e.scrollIntoView(fn))}else{const Ee=xe.find($e=>{const Ye=$e.getBoundingClientRect();return Ye.top>=44&&Ye.left>=0});Ee&&(Ee.focus(),Ee.scrollIntoView(fn))}},{useKey:!0,ignoreEventWhen:P=>P.metaKey||P.ctrlKey||P.altKey||P.shiftKey}),q=ze("k",()=>{const P=document.activeElement.closest(Te),ae=P?.getBoundingClientRect(),xe=Array.from(k.current.querySelectorAll(Te));if(P&&ae.top0){const Ee=xe.indexOf(P);let $e=xe[Ee-1];$e&&($e.focus(),$e.scrollIntoView(fn))}else{const Ee=xe.find($e=>{const Ye=$e.getBoundingClientRect();return Ye.top>=44&&Ye.left>=0});Ee&&(Ee.focus(),Ee.scrollIntoView(fn))}},{useKey:!0,ignoreEventWhen:P=>P.metaKey||P.ctrlKey||P.altKey||P.shiftKey}),O=ze(["enter","o"],()=>{const ae=document.activeElement.closest(Te)?.querySelector(".status-link");ae&&ae.click()},{useKey:!0,ignoreEventWhen:P=>P.metaKey||P.ctrlKey||P.altKey||P.shiftKey}),re=new Date,Me=Se(()=>tt(re,{forceOpts:{weekday:"long"}}),[re]);return e("div",{id:"notifications-page",class:"deck-container",ref:P=>{k.current=P,N.current=P,q.current=P,O.current=P},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${b?"only-mentions":""}`,children:[e("header",{hidden:w,onClick:P=>{P.target.closest("a, button")||k.current?.scrollTo({top:0,behavior:"smooth"})},onDblClick:P=>{P.target.closest("a, button")||ue(!0)},class:h==="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(C,{icon:"home",size:"l",alt:o({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"iDNBZe"})}),e("div",{class:"header-side",children:j&&e("button",{type:"button",class:"button plain4",onClick:()=>{B(!0)},children:e(C,{icon:"settings",size:"l",alt:o({id:"a/+arl"})})})})]}),be&&h!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{ue(!0),k.current?.scrollTo({top:0,behavior:"smooth"})},children:[e(C,{icon:"arrow-up"})," ",e(u,{id:"Jy9RU/"})]})]}),A.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(C,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(u,{id:"0whvLM",values:{0:A.length}})," ",e("small",{class:"insignificant",children:a})]}),A.length>1&&e("span",{class:"announcements-nav-buttons",children:A.map((P,ae)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{se.current?.children[ae].scrollIntoView({behavior:"smooth",block:"nearest"})},children:ae+1}))})]}),e("ul",{class:`announcements-list-${A.length>1?"multiple":"single"}`,ref:se,children:A.map(P=>e("li",{children:e(Dr,{announcement:P})}))})]})})}),T.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(u,{id:"6Fs1Ba"})}),T.length>5?e("details",{children:[e("summary",{children:e(u,{id:"7dHKu4",values:{0:T.length}})}),e("ul",{children:T.map(P=>e("li",{children:[e(lt,{account:P}),e(si,{accountID:P.id,onChange:()=>{}})]},P.id))})]}):e("ul",{children:T.map(P=>e("li",{children:[e(lt,{account:P}),e(si,{accountID:P.id,onChange:()=>{}})]},P.id))})]}),j&&oe?.summary?.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 P=>{const{open:ae}=P.target;if(ae){const xe=await me();W(xe)}},children:[e("summary",{children:e(u,{id:"N3Bq0f",values:{0:oe.summary.pendingRequestsCount}})}),H?H?.length>0&&e("ul",{children:H.map(P=>e("li",{children:[e("div",{class:"request-notifcations",children:[!P.lastStatus?.id&&e(lt,{useAvatarStatic:!0,showStats:!0,account:P.account}),P.lastStatus?.id&&e("div",{class:"last-post",children:e(ge,{class:"status-link",to:`/${a}/s/${P.lastStatus.id}`,children:e(Ke,{status:P.lastStatus,size:"s",readOnly:!0})})}),e(zr,{request:P})]}),e(Br,{request:P,onChange:()=>{ue(!0)}})]},P.id))}):e("p",{class:"ui-state",children:e(De,{abrupt:!0})})]})})})}),_e&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e(an,{notification:_e})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:b,onChange:P=>{v(P.target.checked)}})," ",e(u,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(u,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:Me})]}),Le&&e("p",{class:"ui-state insignificant",children:h==="default"?o({id:"KS7iJH"}):e(D,{children:"โ€ฆ"})}),c.notifications.length?e(On.Provider,{value:"notifications",children:c.notifications.filter(P=>P.type!=="follow_request").map(P=>{if(b&&P.type!=="mention")return null;const ae=new Date(P.createdAt),xe=ae.toDateString()!==He.toDateString();xe&&(He=ae);const Ee=ae.toDateString()===Ne.toDateString()?o({id:"y/0uwd"}):tt(He,{hideTime:!0}),$e=tt(He,{forceOpts:{weekday:"long"}});return e(D,{children:[xe&&e("h2",{class:"timeline-header",children:[e("span",{children:Ee})," ",e("small",{class:"insignificant bidi-isolate",children:$e})]}),e(an,{instance:a,notification:P},P._ids||P.id)]},P._ids||P.id)})}):e(D,{children:[h==="loading"&&e(D,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((P,ae)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(C,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ"})})]}))})}),h==="error"&&e("p",{class:"ui-state",children:[e(u,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>ue(!0),children:e(u,{id:"KDw4GX"})})]})]}),m&&e(St,{onChange:P=>{P&&ue()},children:e("button",{type:"button",class:"plain block",disabled:h==="loading",onClick:()=>ue(),style:{marginBlockEnd:"6em"},children:h==="loading"?e(De,{abrupt:!0}):e(u,{id:"uXRAkV"})})})]}),j&&G&&e(Be,{onClick:P=>{P.target===P.currentTarget&&B(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>B(!1),children:e(C,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:P=>{P.preventDefault();const{forNotFollowing:ae,forNotFollowers:xe,forNewAccounts:Ee,forPrivateMentions:$e,forLimitedAccounts:Ye}=P.target,R={...oe,forNotFollowing:ae.value,forNotFollowers:xe.value,forNewAccounts:Ee.value,forPrivateMentions:$e.value,forLimitedAccounts:Ye.value};$(R),B(!1),(async()=>{try{await s.v2.notifications.policy.update(R),he(o({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(u,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:Mr.map(P=>{const ae=oe[P];return e("div",{children:e("label",{children:[i($r[P]),e("select",{name:P,defaultValue:ae,class:"small",children:[e("option",{value:"accept",children:e(u,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(u,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(u,{id:"gbbkE7"})})]})]})},P)})}),e("p",{children:e("button",{type:"submit",children:e(u,{id:"tfDRzk"})})})]})})]})})]})}function Pr(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function Dr({announcement:n}){const{instance:i}=ie(),{contact:o}=vs(),s=o?.account,{id:a,content:c,startsAt:h,endsAt:d,published:r,allDay:l,publishedAt:p,updatedAt:m,read:f,mentions:b,statuses:v,tags:k,emojis:g,reactions:y}=n,S=new Date(p),I=tt(S),w=new Date(m),T=tt(w);return e("div",{class:"announcement-block",children:[e(lt,{account:s}),e("div",{class:"announcement-content",onClick:xs({mentions:b,instance:i}),dangerouslySetInnerHTML:{__html:Qn(c,{emojis:g})}}),e("p",{class:"insignificant",children:[e("time",{datetime:S.toISOString(),children:tt(S)}),m&&T!==I&&e(D,{children:[" ","โ€ข"," ",e("span",{class:"ib",children:e(u,{id:"TbFrLc",values:{0:tt(w)},components:{0:e("time",{datetime:w.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:y.map(_=>{const{name:A,count:L,me:M,staticUrl:K,url:U}=_;return e("button",{type:"button",class:`plain4 small ${M?"reacted":""}`,children:[U||K?e("img",{src:U||K,alt:A,width:"16",height:"16"}):e("span",{children:A})," ",e("span",{class:"count",children:Ge(L)})]})})})]})}function Or(n){const{masto:i}=ie();return i.v1.notifications.list({accountID:n})}function zr({request:n}){const{instance:i}=ie(),[o,s]=E("loading"),{account:a,lastStatus:c}=n,[h,d]=E(!1),[r,l]=E([]);function p(){d(!1)}return Z(()=>{n?.account?.id&&h&&(s("loading"),(async()=>{const m=await Or(n.account.id);l(m||[]),s("default")})())},[h,n?.account?.id]),e(D,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{d(!0)},children:[e(C,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(u,{id:"H0wUNM",values:{0:a.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(C,{icon:"chevron-down"})]}),h&&e(Be,{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(C,{icon:"x",alt:t`Close`})}),e("header",{children:e("b",{children:e(u,{id:"MXOmPt",values:{0:a.username},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):r.map(m=>e("div",{class:"notification-peek",onClick:f=>{const{target:b}=f;(f.target.tagName==="BUTTON"||f.target.tagName==="A")&&p()},children:e(an,{instance:i,notification:m,isStatic:!0})}))})]})})]})}function Br({request:n,onChange:i}){const{_:o}=ce(),{masto:s}=ie(),[a,c]=E("default"),[h,d]=E(null),r=h!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:a==="loading"||r,onClick:()=>{c("loading"),(async()=>{try{await s.v1.notifications.requests.$select(n.id).accept(),d("accept"),c("default"),i({request:n,state:"accept"}),he(o({id:"ZtBMwU",values:{0:n.account.username}}))}catch{c("error"),he(o({id:"S92JKG"}))}})()},children:e(u,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:a==="loading"||r,class:"light danger",onClick:()=>{c("loading"),(async()=>{try{await s.v1.notifications.requests.$select(n.id).dismiss(),d("dismiss"),c("default"),i({request:n,state:"dismiss"}),he(o({id:"ibBDry",values:{0:n.account.username}}))}catch{c("error"),he(o({id:"S5aemF"}))}})()},children:e(u,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:a==="loading"?e(De,{abrupt:!0}):h==="accept"?e(C,{icon:"check-circle",alt:o({id:"bzMKg7"}),class:"notification-accepted"}):h==="dismiss"&&e(C,{icon:"x-circle",alt:o({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const fo=ot(Nr),Fr=20;function oi({local:n,columnMode:i,...o}){const{_:s}=ce(),a=qe(x),c=!!n,h=i?{}:Lt(),{masto:d,instance:r}=ie({instance:o?.instance||h.instance}),{masto:l,instance:p}=ie(),m=s(c?{id:"u96B/B",values:{instance:r}}:{id:"PgVqvd",values:{instance:r}});Ze(m,c?"/:instance?/p/l":"/:instance?/p");const f=F(),b=F();async function v(g){if(g||!b.current){const I={limit:Fr,local:c||void 0};!c&&Ve("@pixelfed/global-feed")&&(I.remote=!0),b.current=d.v1.timelines.public.list(I).values()}const y=await b.current.next();let{value:S}=y;return S?.length&&(g&&(f.current=S[0].id),S.forEach(I=>{We(I,r)})),{...y,value:S}}async function k(){try{const g=await d.v1.timelines.public.list({limit:1,local:c,since_id:f.current}).values().next();let{value:y}=g;const S=y[0]?.id===f.current;return y?.length&&!S?(y=Pt(y,"public"),!0):!1}catch{return!1}}return e(Ct,{title:m,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:s(c?{id:"pJQgQV"}:{id:"cg0I+x"})}),e("div",{children:r})]}),id:"public",instance:r,emptyText:s({id:"BiZJ6G"}),errorText:s({id:"scd9lw"}),fetchItems:v,checkForUpdates:k,useItemID:!0,headerStart:e(D,{}),boostsCarousel:a.settings.boostsCarousel,filterContext:"public",headerEnd:e(st,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(C,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[e(ve,{href:c?`/#/${r}/p`:`/#/${r}/p/l`,children:c?e(D,{children:[e(C,{icon:"transfer"})," ",e("span",{children:e(u,{id:"dXMiUw"})})]}):e(D,{children:[e(C,{icon:"transfer"})," ",e("span",{children:e(u,{id:"t2B/we"})})]})}),e(Ue,{}),e(ve,{onClick:()=>{let g=prompt(s({id:"2MQ2cd"}));if(!/\./.test(g)){g&&alert(s({id:"7WddtO"}));return}g&&(g=g.toLowerCase().trim(),location.hash=c?`/${g}/p/l`:`/${g}/p`)},children:[e(C,{icon:"bus"})," ",e("span",{children:e(u,{id:"Sq04Yc"})})]}),p!==r&&e(ve,{onClick:()=>{location.hash=c?`/${p}/p/l`:`/${p}/p`},children:[e(C,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"iAzCp4",values:{currentInstance:p},components:{0:e("b",{})}})})]})]})},r+c)}const mn=5,Jn=40,Ur=new URLSearchParams,gn={block:"nearest",inline:"center",behavior:"smooth"};function mo({columnMode:n,...i}){const{_:o}=ce(),s=n?{}:Lt(),{masto:a,instance:c,authenticated:h}=ie({instance:s.instance}),[d,r]=E("default"),[l]=n?[Ur]:mt(),p=F(),m=i?.query||l.get("q"),f=n?"statuses":i?.type||l.get("type");let b=o({id:"A1taO8"});if(m)switch(f){case"statuses":b=o({id:"6YeoAt",values:{q:m}});break;case"accounts":b=o({id:"fpgumQ",values:{q:m}});break;case"hashtags":b=o({id:"AuiMZZ",values:{q:m}});break;default:b=o({id:"wr3GZI",values:{q:m}})}Ze(b,"/search");const[v,k]=E(!1),g=F(0);Z(()=>{g.current=0},[m,f]);const y=F();vt(()=>{y.current?.scrollTo?.(0,0)},[m,f]);const[S,I]=E([]),[w,T]=E([]),[_,A]=E([]);Z(()=>{I([]),T([]),A([])},[m]);const L={statuses:S,accounts:w,hashtags:_},M={statuses:I,accounts:T,hashtags:A},[K,U]=E({}),V=async $=>{if(!$?.length)return;const Y=await Dn($,K);Y&&U({...K,...Y})};function J($){$&&(g.current=0),!(!$&&!h)&&(r("loading"),$&&!f&&(I(S.slice(0,mn)),T(w.slice(0,mn)),A(_.slice(0,mn))),(async()=>{const Y={q:m,resolve:h,limit:mn};f&&(Y.limit=Jn,Y.type=f,h&&(Y.offset=g.current));try{const Q=await a.v2.search.list(Y);if(f)if($){M[f](Q[f]);const H=Q[f]?.length;g.current=Jn,k(!!H)}else if(Q[f]?.[0]?.id===L[f]?.[0]?.id)k(!1);else{M[f](W=>[...W,...Q[f]]);const H=Q[f]?.length;g.current=g.current+Jn,k(!!H)}else I(Q.statuses||[]),T(Q.accounts||[]),A(Q.hashtags||[]),g.current=0,k(!1);V(Q.accounts),r("default")}catch{r("error")}})())}const X=F();jt($=>{const Y=y.current?.scrollTop===0;if($&&Y){const Q=Date.now()-X.current;!X.current||Q>1e3*3?J(!0):X.current=Date.now()}}),Z(()=>{let $;return p.current?.setValue?.(m||""),m?J(!0):$=setTimeout(()=>{p.current?.focus?.()},150),()=>clearTimeout($)},[m,f,c]),ze(["Slash","/"],$=>{p.current?.focus?.(),p.current?.select?.()},{useKey:!0,preventDefault:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey});const j=".timeline > li > a, .hashtag-list > li > a",G=ze("j",()=>{const $=document.activeElement.closest(j),Y=$?.getBoundingClientRect(),Q=Array.from(y.current.querySelectorAll(j));if($&&Y.top0){const H=Q.indexOf($);let W=Q[H+1];W&&(W.focus(),W.scrollIntoView(gn))}else{const H=Q.find(W=>{const me=W.getBoundingClientRect();return me.top>=44&&me.left>=0});H&&(H.focus(),H.scrollIntoView(gn))}},{useKey:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey}),B=ze("k",()=>{const $=document.activeElement.closest(j),Y=$?.getBoundingClientRect(),Q=Array.from(y.current.querySelectorAll(j));if($&&Y.top0){const H=Q.indexOf($);let W=Q[H-1];W&&(W.focus(),W.scrollIntoView(gn))}else{const H=Q.find(W=>{const me=W.getBoundingClientRect();return me.top>=44&&me.left>=0});H&&(H.focus(),H.scrollIntoView(gn))}},{useKey:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey}),[oe]=Si();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:$=>{y.current=$,G.current=$,B.current=$},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(Js,{ref:p}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{J(!0)},disabled:d==="loading",children:e(C,{icon:"search",size:"l",alt:o({id:"A1taO8"})})})})]})}),e("main",{children:[!!m&&!n&&e("div",{ref:oe,class:`filter-bar ${d==="loading"?"loading":""}`,children:[!!f&&e(ge,{to:`/search${m?`?q=${encodeURIComponent(m)}`:""}`,children:[e(C,{icon:"chevron-left"})," ",e(u,{id:"N40H+G"})]}),[{label:o({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(m)}&type=accounts`},{label:o({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(m)}&type=hashtags`},{label:o({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(m)}&type=statuses`}].sort(($,Y)=>$.type===f?-1:Y.type===f?1:0).map($=>e(ge,{to:$.to,children:$.label},$.type))]}),m?e(D,{children:[(!f||f==="accounts")&&e(D,{children:[f!=="accounts"&&e("h2",{class:"timeline-header",children:[e(u,{id:"bPwFdf"})," ",e(ge,{to:`/search?q=${encodeURIComponent(m)}&type=accounts`,children:e(C,{icon:"arrow-right",size:"l",alt:o({id:"V1fa9u"})})})]}),w.length>0?e(D,{children:[e("ul",{class:"timeline flat accounts-list",children:w.map($=>e("li",{children:e(lt,{account:$,instance:c,showStats:!0,relationship:K[$.id]})},$.id))}),f!=="accounts"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(m)}&type=accounts`,children:[e(u,{id:"BMmtZ8"})," ",e(C,{icon:"arrow-right"})]})})]}):!f&&(d==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"YYB61U"})}))]}),(!f||f==="hashtags")&&e(D,{children:[f!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(u,{id:"VwUsHI"})," ",e(ge,{to:`/search?q=${encodeURIComponent(m)}&type=hashtags`,children:e(C,{icon:"arrow-right",size:"l",alt:o({id:"V1fa9u"})})})]}),_.length>0?e(D,{children:[e("ul",{class:"link-list hashtag-list",children:_.map($=>{const{name:Y,history:Q}=$,H=Q?.reduce?.((W,me)=>W+ +me.uses,0);return e("li",{children:e(ge,{to:c?`/${c}/t/${Y}`:`/t/${Y}`,children:[e(C,{icon:"hashtag",alt:"#"}),e("span",{children:Y}),!!H&&e("span",{class:"count",children:Ge(H)})]})},`${Y}-${H}`)})}),f!=="hashtags"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(m)}&type=hashtags`,children:[e(u,{id:"Nc/W5J"})," ",e(C,{icon:"arrow-right"})]})})]}):!f&&(d==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"4MFM3P"})}))]}),(!f||f==="statuses")&&e(D,{children:[f!=="statuses"&&e("h2",{class:"timeline-header",children:[e(u,{id:"+owNNn"})," ",e(ge,{to:`/search?q=${encodeURIComponent(m)}&type=statuses`,children:e(C,{icon:"arrow-right",size:"l",alt:o({id:"V1fa9u"})})})]}),S.length>0?e(D,{children:[e("ul",{class:"timeline",children:S.map($=>e("li",{children:e(ge,{class:"status-link",to:c?`/${c}/s/${$.id}`:`/s/${$.id}`,children:e(Ke,{status:$})})},$.id))}),f!=="statuses"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(m)}&type=statuses`,children:[e(u,{id:"LYCgej"})," ",e(C,{icon:"arrow-right"})]})})]}):!f&&(d==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"Hzi9AA"})}))]}),!!f&&(d==="default"?v?e(St,{onChange:$=>{$&&J()},children:e("button",{type:"button",class:"plain block",onClick:()=>J(),style:{marginBlockEnd:"6em"},children:e(u,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(u,{id:"2EYeAZ"})}):d==="loading"&&e("p",{class:"ui-state",children:e(De,{abrupt:!0})}))]}):d==="loading"?e("p",{class:"ui-state",children:e(De,{abrupt:!0})}):e("p",{class:"ui-state",children:e(u,{id:"fGn1Hk"})})]})]})})}const Kr=20,go=10*60*1e3,Hr=ft(n=>n.v1.trends.links.list().values().next(),{maxAge:go}),qr=ft(n=>n.v1.trends.tags.list().values().next(),{maxAge:go});function jr(n){return Ve("@pixelfed/trending")?n.pixelfed.v2.discover.posts.trending.list({range:"daily"}).values():n.v1.trends.statuses.list({limit:Kr}).values()}function Yr(n,i){return n.v1.timelines.link.list(i).values()}function bo({columnMode:n,...i}){const{_:o}=ce(),s=qe(x),a=n?{}:Lt(),{masto:c,instance:h}=ie({instance:i?.instance||a.instance}),{masto:d,instance:r}=ie(),l=o({id:"cI3UEs",values:{instance:h}});Ze(l,"/:instance?/trending");const p=F(),m=h===r,[f,b]=E([]),[v,k]=E([]),g=F();async function y(X){if(X||!g.current){if(g.current=jr(c),Ve("@mastodon/trending-hashtags"))try{const{value:B}=await qr(c);B?.length&&b(B)}catch{}if(Ve("@mastodon/trending-links"))try{const{value:B}=await Hr(c,h),oe=B?.filter?.($=>$.type==="link");oe?.length&&k(oe)}catch{}}const j=await g.current.next();let{value:G}=j;return G?.length&&(X&&(p.current=G[0].id),G.forEach(B=>{We(B,h)})),{...j,value:G}}const[S,I]=E(!1),w=F(),[T,_]=E(null),A=!!T,L=F(),M=m&&Ve("@mastodon/trending-link-posts");Z(()=>{T&&L.current&&L.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[T]);const K=F();async function U(X){(X||!w.current)&&(I(!0),w.current=Yr(c,{url:T})),K.current=T;const j=await w.current.next();let{value:G}=j;return G?.length&&(G=Pt(G,"public"),G.forEach(B=>{We(B,h)})),K.current===T&&I(!1),{...j,value:G}}async function V(){try{const X=await c.v1.trends.statuses.list({limit:1}).values().next();let{value:j}=X;return j=Pt(j,"public"),j?.length&&j[0].id!==p.current?(p.current=j[0].id,!0):!1}catch{return!1}}const J=Se(()=>e(D,{children:[!!f.length&&e("div",{class:"filter-bar expandable",children:[e(C,{icon:"chart",class:"insignificant",size:"l"}),f.map((X,j)=>{const{name:G,history:B}=X,oe=B.reduce(($,Y)=>$+ +Y.uses,0);return e(ge,{to:`/${h}/t/${G}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),G]}),e("span",{class:"filter-count",children:Ge(oe)})]},G)})]}),!!v.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(u,{id:"9veeTb"})})}),v.map(X=>{const{authors:j,authorName:G,authorUrl:B,blurhash:oe,description:$,height:Y,image:Q,imageDescription:H,language:W,providerName:me,providerUrl:ue,publishedAt:be,title:Ie,url:ke,width:Ae}=X,Pe=j?.[0]?.account?.id?j[0].account:null,we=Ie.length<30,Ne=!!(G||Pe),He=Ms(ke);let Le;if(oe){const se=gi(oe),_e=Ei(se);Le=xi([.6,_e[1],_e[2]])}return e("div",{children:[e("a",{ref:T===ke?L:null,href:ke,target:"_blank",rel:"noopener",class:`link-block ${A?T===ke?"active":"inactive":""}`,style:Le?{"--accent-color":`rgb(${Le.join(",")})`,"--accent-alpha-color":`rgba(${Le.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:Q,alt:H,width:Ae,height:Y,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:He})," ",!!be&&e(D,{children:"ยท "}),!!be&&e(D,{children:e(yt,{datetime:be,format:"micro"})})]}),!!Ie&&e("h1",{class:"title",lang:W,dir:"auto",title:Ie,children:Ie})]}),!!$&&e("p",{class:`description ${Ne&&!we?"":"more-lines"}`,lang:W,dir:"auto",title:$,children:$}),Ne&&e(D,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(u,{id:"aavdrC",values:{0:Pe?e(pt,{account:Pe,showAvatar:!0}):B?e("a",{href:B,target:"_blank",rel:"noopener",children:G}):G}})})})]})]})]})}),M&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{_(ke)},disabled:ke===T,children:[e(C,{icon:"comment2"})," ",e("span",{children:e(u,{id:"/bZzdR"})})," ",e(C,{icon:"chevron-down"})]})]},ke)})]}),M&&!!v.length&&e("div",{class:`timeline-header-block ${A?"blended":""}`,children:A?e(D,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:S?e(De,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{_(null)},children:e(C,{icon:"x",alt:o({id:"9Q/4xJ"})})})}),e("p",{children:e(u,{id:"BATCqf",values:{0:T.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(u,{id:"Vosm4k"})})})]}),[f,v,T,S]);return e(Ct,{title:l,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(u,{id:"4/iCqx"})}),e("div",{children:h})]}),id:"trending",instance:h,emptyText:o({id:"6HA9+s"}),errorText:o({id:"scd9lw"}),fetchItems:A?U:y,checkForUpdates:A?void 0:V,checkForUpdatesInterval:5*60*1e3,useItemID:!0,headerStart:e(D,{}),boostsCarousel:s.settings.boostsCarousel,filterContext:"public",timelineStart:J,refresh:T,clearWhenRefresh:!0,view:A?"link-mentions":void 0,headerEnd:e(st,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(C,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[e(ve,{onClick:()=>{let X=prompt(o({id:"2MQ2cd"}));if(!/\./.test(X)){X&&alert(o({id:"7WddtO"}));return}X&&(X=X.toLowerCase().trim(),location.hash=`/${X}/trending`)},children:[e(C,{icon:"bus"})," ",e("span",{children:e(u,{id:"Sq04Yc"})})]}),r!==h&&e(ve,{onClick:()=>{location.hash=`/${r}/trending`},children:[e(C,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(u,{id:"iAzCp4",values:{currentInstance:r},components:{0:e("b",{})}})})]})]})},h)}const ls={block:"nearest",inline:"nearest",behavior:"smooth"};function Vr(){const{_:n}=ce();Ze(n({id:"i0qMbr"}),"/");const i=qe(x),{shortcuts:o}=i,s=o.map(a=>{if(!a)return null;const{type:c,...h}=a,d={following:Li,notifications:fo,list:so,public:oi,bookmarks:eo,favourites:to,hashtag:io,mentions:lo,trending:bo,search:mo}[c];return!d||c==="search"&&!h.query||c==="list"&&!h.id?null:e(d,{...h,columnMode:!0},c+JSON.stringify(h))});return ze(["1","2","3","4","5","6","7","8","9"],a=>{try{const c=parseInt(a.key,10)-1,h=document.querySelectorAll("#columns > *")[c];h&&(h.focus(),h.scrollIntoView(ls))}catch{}},{useKey:!0,ignoreEventWhen:a=>a.metaKey||a.ctrlKey||a.altKey||a.shiftKey}),ze(["[","]"],(a,c)=>{const h=c.keys[0],d=document.activeElement.closest("#columns > *"),r=Nt(),l=r?"]":"[",p=r?"[":"]";let m;h===l?m=d?d.previousElementSibling:document.querySelectorAll("#columns > *")[0]:h===p&&(m=d?d.nextElementSibling:document.querySelectorAll("#columns > *")[1]),m&&(m.focus(),m.scrollIntoView(ls))},{useKey:!0,ignoreEventWhen:a=>a.metaKey||a.ctrlKey||a.altKey||a.shiftKey}),e("div",{id:"columns",onContextMenu:a=>{a.target.closest(".deck > header")&&!a.target.closest("a")&&!a.target.closest("button")&&(a.preventDefault(),x.showShortcutsSettings=!0)},onFocus:()=>{const a=document.activeElement.closest("#columns > *");a&&document.querySelectorAll("#columns > *").forEach(c=>{c.classList.toggle("focus",c===a)})},children:s})}function Gr(){const{_:n}=ce(),i=qe(x);return __BENCHMARK.end("time-to-home"),Z(()=>{(async()=>{const o=await ht.drafts.keys();if(o.length){const s=Tn();o.filter(c=>c.startsWith(s)).length&&(x.showDrafts=!0)}})()},[]),e(D,{children:(i.settings.shortcutsViewMode==="multi-column"||!i.settings.shortcutsViewMode&&i.settings.shortcutsColumnsMode)&&i.shortcuts?.length?e(Vr,{}):e(Li,{title:n({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(Wr,{})})})}function Wr(){const{_:n}=ce(),i=qe(x),o=F(),[s,a]=E(void 0);return e(D,{children:[e(ge,{ref:o,to:"/notifications",class:`button plain notifications-button ${i.notificationsShowNew?"has-badge":""} ${s||""}`,onClick:c=>{c.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(c.preventDefault(),a(h=>h?void 0:"open"))},children:e(C,{icon:"notification",size:"l",alt:n({id:"iDNBZe"})})}),e(Xr,{state:s,anchorRef:o,onClose:()=>a(void 0)})]})}const Zr=5;function Xr({anchorRef:n,state:i,onClose:o}){const{masto:s,instance:a}=ie(),c=qe(x),[h,d]=E("default"),r=ho();async function l(){const g=await r.next(),y=co(g.value);if(y?.length){y.forEach(I=>{We(I.status,a,{skipThreading:!0})});const S=po(y);x.notificationsLast=S[0],x.notifications=S,s.v1.markers.create({notifications:{lastReadId:S[0].id}}).catch(()=>{})}return x.notificationsShowNew=!1,x.notificationsLastFetchTime=Date.now(),g}const[p,m]=E(!1);function f(){return s.v1.followRequests.list({limit:1})}function b({skipFollowRequests:g=!1}={}){d("loading"),(async()=>{try{if(await l(),!g){const y=await f();m(!!y?.length)}d("default")}catch{d("error")}})()}const v=F(),k=52;return Z(()=>{i==="open"&&(c.notificationsShowNew?v.current?.scrollTop<=k&&b({skipFollowRequests:!0}):b())},[i,c.notificationsShowNew]),e(mi,{ref:v,menuClassName:"notifications-menu",state:i,anchorRef:n,onClose:o,portal:{target:document.body},containerProps:{onClick:()=>{v.current?.closeMenu?.()}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(u,{id:"iDNBZe"})})}),e(On.Provider,{value:"notifications",children:e("main",{children:c.notifications.length?e(D,{children:c.notifications.slice(0,Zr).map(g=>e(an,{instance:a,notification:g,disableContextMenu:!0},g._ids||g.id))}):h==="loading"?e("div",{class:"ui-state",children:e(De,{abrupt:!0})}):h==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(u,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:b,children:e(u,{id:"KDw4GX"})})})]})})}),e("footer",{children:[e(ge,{to:"/mentions",class:"button plain",children:[e(C,{icon:"at"})," ",e("span",{children:e(u,{id:"/bZzdR"})})]}),e(ge,{to:"/notifications",class:"button plain2",children:[p?e(u,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(u,{id:"gukqfD"})})," ",e(C,{icon:"arrow-right"})]})]})]})}const Jr=ot(Gr),Qr=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function vo(n){const i=URL.parse(n);if(!i)return{};const{hostname:o,pathname:s}=i;for(const a of Qr){const[,c]=s.match(a)||[];if(c)return{instance:o,id:c}}return{}}function ed(n){const{instance:i,id:o}=vo(n);return i&&o?`/${i}/s/${o}`:null}function td(){const i=Wt().pathname.replace(/^\//,""),o=vo(i),s=o?.instance?`/${o.instance}/s/${o.id}`:null,[a,c]=E("loading");return vt(()=>{c("loading"),(async()=>{try{const{instance:h,id:d}=o;if(d){const{masto:r}=ie({instance:h});if(await r.v1.statuses.$select(d).fetch()){window.location.hash=s+"?view=full";return}}}catch{}{const{masto:h,instance:d}=ie(),r=await h.v2.search.list({q:i,limit:1,resolve:!0});if(r.statuses.length){const l=r.statuses[0];window.location.hash=`/${d}/s/${l.id}?view=full`}else if(r.accounts.length){const l=r.accounts[0];window.location.hash=`/${d}/a/${l.id}`}else s?window.location.hash=s+"?view=full":c("error")}})()},[s]),e("div",{class:"ui-state",tabIndex:"-1",children:[a==="loading"?e(D,{children:[e(De,{abrupt:!0}),e("h2",{children:e(u,{id:"RTAr/z"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}):e(D,{children:[e("h2",{children:e(u,{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(u,{id:"iWpEwy"})})})]})}function nd(){const{_:n}=ce();Ze(n({id:"h16FyT"}),"/l");const[i,o]=E("default"),[s,a]=Rt(p=>p+1,0),[c,h]=E([]);Z(()=>{o("loading"),(async()=>{try{const p=await ii();h(p),o("default")}catch{o("error")}})()},[s]);const[d,r]=E(!1),l=c.some(p=>p.exclusive);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(C,{icon:"home",size:"l"})})]}),e("h1",{children:e(u,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>r(!0),children:e(C,{icon:"plus",size:"l",alt:n({id:"Sb2gYF"})})})})]})}),e("main",{children:c.length>0?e(D,{children:[e("ul",{class:"link-list",children:c.map(p=>e("li",{children:e(ge,{to:`/l/${p.id}`,children:[e(C,{icon:"list"})," ",e("span",{children:[p.title,p.exclusive&&e(D,{children:[" ",e(Ot,{insignificant:!0})]})]})]})}))}),c.length>1&&e("footer",{class:"ui-state",children:[l&&e("p",{children:e("small",{class:"insignificant",children:[e(Ot,{})," ",e(u,{id:"FNptcJ"})]})}),e("p",{children:e("small",{class:"insignificant",children:e(u,{id:"8prZNK",values:{0:c.length}})})})]})]}):i==="loading"?e("p",{class:"ui-state",children:e(De,{})}):i==="error"?e("p",{class:"ui-state",children:e(u,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(u,{id:"IvPikw"})})})]}),d&&e(Be,{onClick:p=>{p.target===p.currentTarget&&r(!1)},children:e(Ti,{list:d?.list,onClose:p=>{p.state==="success"&&a(),r(!1)}})})]})}const id=""+new URL("instances-LA7224ZB.json",import.meta.url).href,sd={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:od}=sd;function ad(){const{_:n}=ce();Ze(n({id:"sQia9P"}),"/login");const i=F(),o=Re.local.get("instanceURL"),[s,a]=E("default"),[c]=mt(),h=c.get("instance"),d=c.get("submit"),[r,l]=E(h||o?.toLowerCase()||""),[p,m]=E([]),f=F();Z(()=>{(async()=>{try{const w=await(await fetch(id)).json();m(w),f.current=new oa(w)}catch{}})()},[]);const b=I=>{I&&(async()=>{try{const T=await(await fetch(`https://${I}/.well-known/host-meta`)).text(),M=new DOMParser().parseFromString(T,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),K=URL.parse(M),{host:U}=K;I!==U&&(I=U)}catch{}Re.local.set("instanceURL",I),a("loading");try{let w=Cs(I);(!w||!w.client_id||!w.client_secret)&&(w=await Fa({instanceURL:I}),Po(I,w));const{client_id:T,client_secret:_}=w,A=await Na({instanceURL:I}),L=Do(I);if(A)if(T&&_){const[M,K]=await Ua({instanceURL:I,client_id:T,forceLogin:L});Re.sessionCookie.set("codeVerifier",K),location.href=M}else alert(n({id:"ZP1FIA"}));else T&&_?location.href=await Ka({instanceURL:I,client_id:T,forceLogin:L}):alert(n({id:"ZP1FIA"}));a("default")}catch{a("error")}})()},v=r?r.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,k=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(v)&&!/[\s\/\\@]/.test(v),g=v?f.current?.search(v,{limit:10})?.map(I=>I.item):[],y=k?v:g?.length?g[0]:r?p.find(I=>I.includes(r)):null,S=I=>{I.preventDefault(),b(y)};return d&&Z(()=>{b(h||y)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:S,children:[e("h1",{children:[e("img",{src:_i,alt:"",width:"80",height:"80"}),e("br",{}),e(u,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(u,{id:"kyAi7k"})}),e("input",{value:r,required:!0,type:"text",class:"large",id:"instanceURL",ref:i,disabled:s==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:n({id:"u3gOdY"}),onInput:I=>{l(I.target.value)},dir:"auto"}),g?.length>0?e("ul",{id:"instances-suggestions",children:g.map((I,w)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{b(I)},children:I})}))}):e("div",{id:"instances-eg",children:e(u,{id:"/OvbEC"})})]}),s==="error"&&e("p",{class:"error",children:e(u,{id:"rmBHZn"})}),e("div",{children:[e("button",{disabled:s==="loading"||!r||!y,children:n(y?{id:"2xahsi",values:{selectedInstanceText:y}}:{id:"xGVfLh"})})," "]}),e(De,{hidden:s!=="loading"}),e("hr",{}),!od&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(u,{id:"LcOiWS"})})}),e("p",{children:e(ge,{to:"/",children:e(u,{id:"iWpEwy"})})}),e(Ii,{})]})})}const cd=40;function ld(){const{_:n}=ce(),i=qe(x);Ze(n({id:"+GkIdc"}),"/sp");const{masto:o}=ie(),[s,a]=E([]),[c,h]=E("default"),[d,r]=Rt(m=>m+1,0),[l,p]=E(!1);return Z(r,[i.reloadScheduledPosts]),Z(()=>{h("loading"),(async()=>{try{const m=o.v1.scheduledStatuses.list({limit:cd}).values(),f=[];let b;do b=(await m.next()).value,b?.length&&f.push(...b);while(b?.length);a(f)}catch{h("error")}finally{h("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(C,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(u,{id:"+GkIdc"})}),e("div",{class:"header-side",children:e(st,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(C,{icon:"more",size:"l",alt:n({id:"2FYpfJ"})})}),children:e(ve,{onClick:()=>{r()},children:[e(C,{icon:"refresh",size:"l"}),e("span",{children:e(u,{id:"lCF0wC"})})]})})})]})}),e("main",{children:[s.length?e("ul",{class:"posts-list",children:s.map(m=>{const{id:f,params:b,scheduledAt:v,mediaAttachments:k}=m,{inReplyToId:g,language:y,poll:S,sensitive:I,spoilerText:w,text:T,visibility:_}=b,A={id:f,inReplyToId:g,language:y,mediaAttachments:k,poll:S?{...S,expiresAt:new Date(Date.now()+S.expiresIn*1e3),options:S.options.map(L=>({title:L,votesCount:0}))}:void 0,sensitive:I,spoilerText:w,text:T,visibility:_,content:`

${T}

`};return e("li",{children:e(rd,{status:A,scheduledAt:v,onClick:()=>{p({post:A,scheduledAt:new Date(v)})}})},f)})}):e("p",{class:"ui-state",children:c==="loading"?e(De,{}):n({id:"mZYb1f"})}),l&&e(Be,{onClick:m=>{m.target===m.currentTarget&&p(!1)},children:e(dd,{post:l.post,scheduledAt:l.scheduledAt,onClose:()=>p(!1)})})]})]})})}function rd({status:n,scheduledAt:i,onClick:o}){const s=Se(()=>{const a=(new Date(i).getTime()-Date.now())/36e5;return a<24?"time":a<720?"day":"month"},[i]);return e("button",{type:"button",class:"textual block",onClick:o,children:[e("div",{class:`post-schedule-meta post-schedule-${s}`,children:[e(C,{icon:s,class:"insignificant"})," ",e("span",{children:e(u,{id:"aEp6lO",values:{0:tt(i,{formatOpts:{weekday:"short",second:"numeric"}})},components:{0:e("b",{}),1:e(yt,{datetime:i}),2:e("small",{})}})})]}),e(Ke,{status:n,size:"s",previewMode:!0,readOnly:!0})]})}function dd({post:n,scheduledAt:i,onClose:o}){const{masto:s}=ie(),{_:a}=ce(),[c,h]=E("default"),[d,r]=E(),l=d&&d.getTime()!==i.getTime(),p=aa(),m=i&&i<=Date.now(),{inReplyToId:f}=n,[b,v]=E(null);return e("div",{id:"scheduled-post-sheet",class:"sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(C,{icon:"x",size:"l",alt:a({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(u,{id:"orjBLU",components:{0:e("b",{}),1:e(yt,{datetime:i})}}),e("br",{}),e("small",{children:tt(i,{formatOpts:{weekday:"short",second:"numeric"}})})]})}),e("main",{tabIndex:"-1",children:[!!b&&e("div",{class:"status-reply",children:e(Ke,{status:b,size:"s",previewMode:!0,readOnly:!0})}),e(Ke,{status:n,size:"s",previewMode:!0,readOnly:!0,onMediaClick:(k,g,y,S)=>{k.preventDefault(),x.showMediaModal={mediaAttachments:n.mediaAttachments,mediaIndex:g}}}),e("form",{onSubmit:k=>{k.preventDefault(),h("loading"),(async()=>{try{await s.v1.scheduledStatuses.$select(n.id).update({scheduledAt:d.toISOString()}),he(a({id:"40naR1"})),o(),h("default"),x.reloadScheduledPosts++}catch{h("error"),he(a({id:"ZM3jAs"}))}})()},children:e("footer",{children:[e("div",{class:"row",children:e("span",{children:[e(ca,{scheduledAt:i,setScheduledAt:k=>{r(k)}})," ",e("small",{class:"ib",children:p})]})}),e("div",{class:"row",children:[e("button",{disabled:!l||c==="loading"||m,children:e(u,{id:"QqW27M"})}),e("span",{class:"grow"}),e(rt,{align:"end",menuItemClassName:"danger",confirmLabel:a({id:"09u3Kk"}),onClick:()=>{h("loading"),(async()=>{try{await ie().masto.v1.scheduledStatuses.$select(n.id).remove(),he(a({id:"/zL/Mq"})),o(),h("default"),x.reloadScheduledPosts++}catch{h("error"),he(a({id:"aOh6Md"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:c==="loading"||m,children:e(u,{id:"Jb6/SB"})})})]})]})})]})]})}const ud={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:rs}=ud,bn=40,hd=10,pd=5;let ai={},Sn={},Cn={};function _n(n){delete Sn[n],delete Cn[n]}const Jt={block:"nearest",inline:"center",behavior:"smooth"},ds=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",us=/\/s\//i;function fd(n){const{_:i}=ce(),{id:o}=n,{masto:s,instance:a}=ie({instance:n.instance}),c=qe(x),[h,d]=mt(),r=h.get("media"),l=h.get("media-only"),p=parseInt(r||l,10);let m=p>0;const f=h.get("mediaStatusID"),b=Ss(f,a);f&&!b&&(m=!1);const v=m&&!!l,k=it(o,a),[g,y]=E(x.statuses[k]);Z(()=>{x.statuses[k]&&y(x.statuses[k])},[k]);const S=Se(()=>{const{prevLocation:A}=x,L=(A?.pathname||"")+(A?.search||""),M=nn("/:instance/s/:id",L)||nn("/s/:id",L);return!L||M?"/":L},[]);Z(()=>{!g&&m&&(async()=>{try{const A=await s.v1.statuses.$select(o).fetch();We(A,a),y(A)}catch{alert("Unable to load post."),location.hash=S}})()},[m]);const I=f?c.statuses[it(f,a)]?.mediaAttachments:g?.mediaAttachments,w=()=>window.matchMedia("(min-width: calc(40em + 350px))").matches?"large":"small",T=Qe(()=>{w()==="small"&&c.prevLocation?history.back():v?location.hash=S:(h.delete("media"),h.delete("mediaStatusID"),d(h))},[v,S,c.prevLocation]),_=Qe((A,L,M,K)=>{if(w()==="large"&&!v){T();return}if(m&&document.startViewTransition){const U=M[L],{id:V,blurhash:J,url:X}=U,j=la(V||J||X),B=[...document.querySelectorAll(`.status .media [data-view-transition-name="${j}"]`)].filter?.($=>{const Y=$.getBoundingClientRect();return Y.top0&&Y.left0}),oe=B.length===1?B[0]:B.find($=>!!$.closest(".status-deck"));oe?document.startViewTransition(()=>{oe.style.viewTransitionName=j,K?.current&&K.current.querySelectorAll(".media img, .media video")?.forEach(Y=>{Y.style.viewTransitionName=""}),T()}).ready.finally(()=>{oe.style.viewTransitionName="",oe.dataset.viewTransitioned=j}):T()}else T()},[m,v]);return Z(()=>{let A=setTimeout(()=>{const L=document.querySelector(".carousel");L&&L.focus()},100);return()=>clearTimeout(A)},[v]),Z(()=>{const A=document.querySelectorAll(".deck-container");return A.forEach(L=>{L.setAttribute("inert","")}),()=>{A.forEach(L=>{L.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[m?I?.length?e(Zs,{mediaAttachments:I,statusID:f||o,instance:a,lang:g?.language,index:p-1,onClose:_}):e("div",{class:"media-modal-container loading",children:e(De,{abrupt:!0})}):e(ge,{to:S}),!v&&e(gd,{id:o,instance:n.instance,closeLink:S})]})}function md(n){const{linkable:i,to:o,onClick:s,...a}=n;return i?e(ge,{class:"status-link",to:o,onClick:s,...a}):e("div",{class:"status-focus",tabIndex:0,...a})}function hs(n,i){return new Date(i.created_at)-new Date(n.created_at)}function gd({id:n,closeLink:i="/",instance:o}){const{_:s}=ce(),[a,c]=mt(),h=a.get("media"),d=a.get("mediaStatusID"),r=parseInt(h,10)>0,l=F(!x.prevLocation&&(history.length===1||"navigation"in window&&navigation?.entries?.()?.length===1)),[p,m]=E(a.get("view")||l.current?"full":null),f=!!parseInt(a.get("translate")),{masto:b,instance:v}=ie({instance:o}),{masto:k,instance:g,authenticated:y}=ie(),S=v===g,I=qe(x),[w,T]=E([]),[_,A]=E("default"),L=F(),M=it(n,v),K=F(0),U=F();Z(()=>{U.current?.focus()},[]),Z(()=>{const N=Ns(()=>{if(!U.current)return;const{scrollTop:q}=U.current;_!=="loading"&&(Cn[n]=q)},50);return U.current?.addEventListener("scroll",N,{passive:!0}),N(),()=>{N.cancel(),U.current?.removeEventListener("scroll",N)}},[n,_!=="loading"]);const V=F(),J=F(),X=({reloadHero:N}={})=>{A("loading");let q;const O=Sn[n];if(O){const re=O.filter(Me=>x.statuses[M]);T(re)}else T([{id:n}]);return(async()=>{const re=()=>Di(()=>b.v1.statuses.$select(n).fetch(),{retries:4}),Me=Di(()=>b.v1.statuses.$select(n).context.fetch(),{retries:8}),P=!!I.statuses[M];let ae=I.statuses[M];if(!(P&&!N))try{ae=await re(),We(ae,v),await new Promise(xe=>{setTimeout(xe,100)})}catch{A("error");return}try{let xe=function(ee,le){const pe=le+1;return pe>de&&(de=le),ee?.map(Ce=>({id:Ce.id,account:Ce.account,repliesCount:Ce.repliesCount,content:Ce.content,weight:tn(Ce),level:pe,replies:xe(Ce.__replies,pe)}))};const Ee=await Me,{ancestors:$e,descendants:Ye}=Ee;$e.sort(hs),Ye.sort(hs),K.current=Ye?.length||0;const R=new Set;$e.forEach(ee=>{We(ee,v,{skipThreading:!0}),ee.inReplyToId&&!$e.find(le=>le.id===ee.inReplyToId)&&R.add(ee.inReplyToId)});const te=$e.every(ee=>ee.account.id===ae.account.id),ne=[];Ye.forEach(ee=>{if(We(ee,v,{skipThreading:!0}),ee.inReplyToId&&!Ye.find(le=>le.id===ee.inReplyToId)&&ee.inReplyToId!==ae.id&&R.add(ee.inReplyToId),ee.inReplyToAccountId===ee.account.id)ne.push(ee);else if(ee.inReplyToId===ae.id)ne.push(ee);else if(!ee.inReplyToAccountId&&ne.find(le=>le.id===ee.inReplyToId&&le.account.id===ae.account.id)&&ee.account.id===ae.account.id)ne.push(ee);else{const le=Ye.find(pe=>pe.id===ee.inReplyToId);le&&(le.__replies||(le.__replies=[]),le.__replies.push(ee))}}),ne.sort((ee,le)=>{const pe=ae.account.id;return ee.account.id===pe&&le.account.id!==pe?-1:le.account.id===pe&&ee.account.id!==pe?1:0}),R.size;let de=1;const z=[...$e.map(ee=>({id:ee.id,ancestor:!0,isThread:te,accountID:ee.account.id,account:ee.account,repliesCount:ee.repliesCount,weight:tn(ee)})),{id:n,accountID:ae.account.id,weight:tn(ae)},...ne.map(ee=>({id:ee.id,account:ee.account,accountID:ee.account.id,descendant:!0,thread:ee.account.id===ae.account.id,weight:tn(ee),level:1,replies:xe(ee.__replies,1)}))];A("default"),V.current={offsetTop:L.current?.offsetTop,scrollTop:U.current?.scrollTop};const ye=$e.length||0;ye>=H&&W(ye+1),T(z),Sn[n]=z,Oo(ae,v)}catch{A("error")}})(),J.current=Date.now(),()=>{clearTimeout(q)}};Z(X,[n,b]);const[j,G]=E(!1);Z(()=>{let N=setInterval(()=>{const q=Date.now();J.current&&q-J.current>=6e4&&G(!0)},6e4);return()=>{clearInterval(N)}},[]),vt(()=>{if(!w.length)return;const N=Cn[n];if(N)U.current.scrollTop=N;else if(V.current){const q={offsetTop:L.current?.offsetTop,scrollTop:U.current?.scrollTop},O=q.offsetTop-V.current.offsetTop+q.scrollTop;U.current.scrollTop=O}else w.length===1&&(U.current.scrollTop=0);V.current=null},[w]),Z(()=>{I.reloadStatusPage<=0||(async()=>{try{const{instanceURL:N}=ui(),q=`https://${N}/api/v1/statuses/${n}/context`;return await(await caches.open("api")).delete(q,{ignoreVary:!0}),X({reloadHero:!0})}catch{}})()},[I.reloadStatusPage]),Z(()=>()=>{Cn={},x.reloadStatusPage=0,Sn={},ai={},ci.clear()},[]);const B=I.statuses[M]||I.statuses[n],oe=Se(()=>{if(!B)return"";const{account:N}=B,q=document.createElement("div");return q.innerHTML=N.displayName,q.innerText.trim()},[B]),$=Se(()=>{if(!B)return"";let N=Pn(B);return N.length>64&&(N=N.slice(0,64)+"โ€ฆ"),N},[B]);Ze(oe&&$?`${oe}: "${$}"`:s({id:"post.title"}),"/:instance?/s/:id");const Y=Se(()=>{if(!B)return;const{url:N}=B;if(N)return URL.parse(N)?.hostname},[B]),Q=Se(()=>{if(Y)return Y===v},[Y,v]),[H,W]=E(bn),me=Se(()=>w.length-H,[w.length,H]),ue=w.some(N=>N.descendant),be=w.filter(N=>N.ancestor),[Ie,ke]=E(!0),Ae=Se(()=>{if(!L.current||Ie)return null;const{top:N}=L.current.getBoundingClientRect();return N>0?"down":"up"},[Ie]);ze("esc",()=>{location.hash=i},{enabled:!r,ignoreEventWhen:N=>!!document.querySelector("#modal-container > *")||N.metaKey||N.ctrlKey||N.altKey||N.shiftKey,useKey:!0}),ze("backspace",()=>{location.hash=i},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey}),ze("j",()=>{const N=document.activeElement.closest(".status-link, .status-focus"),q=N?.getBoundingClientRect(),O=Array.from(U.current.querySelectorAll(ds));if(N&&q.top0){const re=O.indexOf(N);let Me=O[re+1];Me&&(Me.focus(),Me.scrollIntoView(Jt))}else{const re=O.find(Me=>{const P=Me.getBoundingClientRect();return P.top>=44&&P.left>=0});re&&(re.focus(),re.scrollIntoView(Jt))}},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey}),ze("k",()=>{const N=document.activeElement.closest(".status-link, .status-focus"),q=N?.getBoundingClientRect(),O=Array.from(U.current.querySelectorAll(ds));if(N&&q.top0){const re=O.indexOf(N);let Me=O[re-1];Me&&(Me.focus(),Me.scrollIntoView(Jt))}else{const re=O.find(Me=>{const P=Me.getBoundingClientRect();return P.top>=44&&P.left>=0});re&&(re.focus(),re.scrollIntoView(Jt))}},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey}),ze("x",()=>{const N=document.activeElement.closest(".status-link, .status-focus");if(N){const q=N.nextElementSibling;q&&q.tagName.toLowerCase()==="details"&&(q.open=!q.open)}},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey});const[Pe,we]=E(!1),Ne=F(r?"media+status":"status"),He=Qe((N,q,O,re)=>{N.preventDefault(),N.stopPropagation(),c({media:q+1,mediaStatusID:re.id})},[n]),Le=Qe((N,q)=>{_n(q.id)},[]);Z(()=>{let N;return d&&r&&(N=setTimeout(()=>{const q=U.current?.querySelector(`.status-link[href*="/${d}"]`);q&&q.scrollIntoView(Jt)},400)),()=>{clearTimeout(N)}},[d,r]);const se=Qe((N,q)=>{const{id:O,ancestor:re,isThread:Me,descendant:P,thread:ae,replies:xe,repliesCount:Ee,weight:$e,level:Ye}=N,R=O===n;return e("li",{ref:R?L:null,class:`${re?"ancestor":""} ${P?"descendant":""} ${ae?"thread":""} ${R?"hero":""}`,children:[R?e(D,{children:[e(St,{threshold:.1,onChange:ne=>{queueMicrotask(()=>{requestAnimationFrame(()=>{ke(ne)})})},class:"status-focus",tabIndex:0,children:e(Ke,{statusID:O,instance:v,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:f})}),_!=="loading"&&!y?e("div",{class:"post-status-banner",children:[e("p",{children:e(u,{id:"Vyeh4F"})}),e(ge,{to:rs?`/login?instance=${rs}&submit=1`:"/login",class:"button",children:e(u,{id:"sQia9P"})})]}):!S&&e("div",{class:"post-status-banner",children:[e("p",{children:e(u,{id:"j5roNG",values:{instance:v},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:_==="loading",onClick:()=>{A("loading"),(async()=>{try{const ne=await k.v2.search.list({q:B.url,type:"statuses",resolve:!0,limit:1});if(ne.statuses.length){const de=ne.statuses[0];location.hash=g?`/${g}/s/${de.id}`:`/s/${de.id}`}else throw new Error("No results")}catch(ne){A("default"),alert(s({id:"DnepCE",values:{e:ne}}))}})()},children:[e(C,{icon:"transfer"})," ",e(u,{id:"ejAVrO"})]})]})]}):e(md,{linkable:Me||re,to:v?`/${v}/s/${O}`:`/s/${O}`,onClick:()=>{_n(O)},children:[q===0&&re?e(St,{threshold:.5,onChange:ne=>{queueMicrotask(()=>{requestAnimationFrame(()=>{we(ne)})})},children:e(Ke,{statusID:O,instance:v,withinContext:!0,size:ae||re?"m":"s",enableTranslate:!0,onMediaClick:He,onStatusLinkClick:Le})}):e(Ke,{statusID:O,instance:v,withinContext:!0,size:ae||re?"m":"s",enableTranslate:!0,onMediaClick:He,onStatusLinkClick:Le,showActionsBar:!!P}),re&&Ee>1&&e("div",{class:"replies-link",children:[e(C,{icon:"comment2",alt:s({id:"N8UzTV"})})," ",e("span",{title:Ee,children:Ge(Ee)})]})," "]}),P&&xe?.length>0&&e(yo,{instance:v,replies:xe,hasParentThread:ae,level:Ye,accWeight:$e,openAll:K.current_n(O)}}),_==="loading"&&R&&!!B?.repliesCount&&!ue&&e("div",{class:"status-loading",children:e(De,{abrupt:B.repliesCount>=3})}),_==="error"&&R&&!!B?.repliesCount&&!ue&&e("div",{class:"status-error",children:[e(u,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{x.reloadStatusPage++},children:e(u,{id:"KDw4GX"})})]})]},O)},[n,v,_,y,S,f,He,Le,ue]),_e=Se(()=>{if("navigation"in window&&navigation?.entries){const N=navigation.entries()[navigation.currentEntry.index-1];if(N?.url)return us.test(N.url)}return us.test(x.prevLocation?.pathname)},[M]),Oe=Se(()=>{if(!me)return[];const N=[];function q(O){N.push(O.id),O.replies&&O.replies.forEach(q)}return w.slice(H).forEach(q),N.map(O=>it(O,v))},[me,w,H,v]),Te=Se(()=>w.slice(0,H).map(se),[w,H,se]);return Z(()=>{let N=setTimeout(()=>{if(!L.current)return;const q=L.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");q&&q.click()},1e3);return()=>clearTimeout(N)},[n]),e("div",{tabIndex:"-1",ref:U,class:`status-deck deck contained ${w.length>1?"padded-bottom":""} ${Ne.current==="status"&&!l.current?"slide-in":""} ${p?`deck-view-${p}`:""}`,onAnimationEnd:N=>{Ne.current==="status"&&(Ne.current=null)},children:[e("header",{class:`${_==="loading"?"loading":""}`,onDblClick:N=>{x.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[_e&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(C,{icon:"chevron-left",size:"xl",alt:s({id:"iH8pgl"})})}),!Ie&&B&&_!=="loading"?e(D,{children:[e("span",{class:"hero-heading",children:[e(pt,{account:B.account,instance:v,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["โ€ข"," ",e(yt,{datetime:B.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:N=>{N.preventDefault(),N.stopPropagation(),L.current.scrollIntoView({behavior:"smooth",block:"start"})},title:s({id:"NCy+Nw"}),children:e(C,{icon:Ae==="down"?"arrow-down":"arrow-up"})})]}):e(D,{children:[e(u,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:N=>{N.preventDefault(),N.stopPropagation(),U.current.scrollTo({top:0,behavior:"smooth"})},hidden:!be.length||Pe,title:s({id:"R8CUl0",values:{0:be.length}}),children:[e(C,{icon:"arrow-up"}),be.filter((N,q,O)=>O.findIndex(re=>re.accountID===N.accountID)===q).slice(0,3).map(N=>e(ut,{url:N.account.avatarStatic||N.account.avatar,alt:N.account.displayName,squircle:N.account?.bot},N.account.id)),be.length>3&&e(D,{children:[" ",e("span",{class:"insignificant",children:Ge(be.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:p==="full"?"":"none"},onClick:()=>{m(null),a.delete("media"),a.delete("media-only"),a.delete("view"),c(a)},title:s({id:"+/xYEI"}),children:e(C,{icon:"layout4",size:"l"})}),j&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{x.reloadStatusPage++,G(!1)},children:e(C,{icon:"refresh",size:"l",alt:s({id:"lCF0wC"})})}),e(st,{align:"end",portal:{target:U.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(C,{icon:"more",alt:s({id:"2FYpfJ"}),size:"xl"})}),children:[e(ve,{disabled:_==="loading",onClick:()=>{x.reloadStatusPage++},children:[e(C,{icon:"refresh"}),e("span",{children:e(u,{id:"lCF0wC"})})]}),e(ve,{className:"menu-switch-view",onClick:()=>{m(p==="full"?null:"full"),a.delete("media"),a.delete("media-only"),p==="full"?a.delete("view"):a.set("view","full"),c(a)},children:[e(C,{icon:{"":"layout5",full:"layout4"}[p||""]}),e("span",{children:s(p==="full"?{id:"+/xYEI"}:{id:"2LiWsE"})})]}),e(ve,{onClick:()=>{Array.from(U.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(q=>{q.click()})},children:[e(C,{icon:"eye-open"})," ",e("span",{children:e(u,{id:"8r8KmB"})})]}),e(Ue,{}),e(bi,{className:"plain",children:e(u,{id:"Rsjgm0"})}),e(ve,{disabled:!Y||Q,onClick:()=>{const N=ed(B.url);N?location.hash=N:alert(s({id:"9J6biQ"}))},children:[e(C,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:s(Y?{id:"Kp9SAs",values:{0:ln.toUnicode(Y)}}:{id:"lb07+k"})})]})]}),e(ge,{class:"button plain deck-close",to:i,children:e(C,{icon:"x",size:"xl",alt:s({id:"yz7wBu"})})})]})]})}),w.length&&B?e("ul",{class:`timeline flat contextual grow ${_==="loading"?"loading":""}`,children:[Te,me>0&&e("li",{class:"descendant descendant-more",children:e("button",{type:"button",class:"plain block show-more",disabled:_==="loading",onClick:()=>W(N=>N+bn),style:{marginBlockEnd:"6em"},"data-state-post-ids":Oe.join(" "),children:[e("div",{class:"ib avatars-bunch",children:w.slice(H,H+5).map(N=>e(ut,{url:N.account.avatarStatic},N.id))})," ",e("div",{class:"ib",children:[e(u,{id:"uXRAkV"})," ",e("span",{class:"tag",children:me>bn?`${bn}+`:me})]})]})})]}):e(D,{children:[_==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(Ke,{skeleton:!0,size:"l"})})}),_==="error"&&e("p",{class:"ui-state",children:[e(u,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{x.reloadStatusPage++},children:e(u,{id:"KDw4GX"})})]})]})]})}function yo({replies:n,instance:i,hasParentThread:o,level:s,accWeight:a,openAll:c,parentLink:h}){const{_:d}=ce(),[r,l]=mt(),p=A=>A.reduce((L,M)=>{const{repliesCount:K,replies:U}=M,V=U?.length||K;return L+V+p(U||[])},0),m=n.length+p(n),f=n.length===m,b=n.map(A=>A.account).filter((A,L,M)=>M.findIndex(K=>K.id===A.id)===L).slice(0,3),v=Se(()=>n?.reduce((A,L)=>A+L?.weight,a),[a,n?.length]);let k=!1;(c||v<=pd||!o&&m===1&&tn(n[0])<2)&&(k=!0);const g=ai[n[0].id],y=Qe((A,L,M,K)=>{A.preventDefault(),A.stopPropagation(),l({media:L+1,mediaStatusID:K.id})},[]),S=F();vt(()=>{function A(L){L.target.dataset.scrollLeft=L.target.scrollLeft}return S.current?.addEventListener("scroll",A,{passive:!0}),()=>{S.current?.removeEventListener("scroll",A)}},[]);const[I,w]=E(g||k);Z(()=>{let A;return!g&&!k&&(A=setTimeout(()=>w(!0),100)),()=>clearTimeout(A)},[g,k]);const T=k?"div":"details",_=T==="details";return e(T,{ref:S,class:"replies",open:_?g||k:void 0,onToggle:_?A=>{const{open:L}=A.target;ai[n[0].id]=L}:void 0,style:{"--comments-level":s},"data-comments-level":s,"data-comments-level-overflow":s>4,children:[!k&&e("summary",{class:"replies-summary",hidden:k,children:[e("span",{class:"avatars",children:b.map(A=>e(ut,{url:A.avatarStatic,title:`${A.displayName} @${A.username}`,squircle:A?.bot},A.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(u,{id:"DOQUen",values:{0:n.length,1:Ge(n.length)},components:{0:e("span",{title:n.length})}})}),!f&&m>1&&e(D,{children:[" ","ยท"," ",e("span",{children:e(u,{id:"qSQQSe",values:{0:Ge(m),totalComments:m},components:{0:e("span",{title:m})}})})]})]}),e(C,{icon:"chevron-down",class:"replies-summary-chevron"}),!!h&&e(ge,{class:"replies-parent-link",to:h.to,onClick:h.onClick,title:d({id:"ZlV82A"}),children:"ยป"})]}),I&&e("ul",{children:n.map(A=>e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(Ke,{statusID:A.id,instance:i,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:y,showActionsBar:!0}),!A.replies?.length&&A.repliesCount>0&&e("div",{class:"replies-link",children:[e(C,{icon:"comment2",alt:d({id:"N8UzTV"})})," ",e("span",{title:A.repliesCount,children:Ge(A.repliesCount)})]})]}),A.replies?.length&&e(yo,{instance:i,replies:A.replies,level:A.level,accWeight:k?v:A.weight,openAll:c,parentLink:{to:i?`/${i}/s/${A.id}`:`/s/${A.id}`,onClick:()=>{_n(A.id)}}})]},A.id))})]})}const bd=140,vd=35,yd=70,wd=140,ci=new Map;function tn(n){const i=ci.get(n.id);if(i)return i;const{spoilerText:o,content:s,mediaAttachments:a,poll:c,card:h}=n,d=$s(o+s),r=a?.length?bd:0,l=(c?.options?.length||0)*vd,p=h&&(a?.length||c?.options?.length)?0:yd,f=(d+r+l+p)/wd;return ci.set(n.id,f),f}const kd=ot(fd);function Sd(){const n=Lt(),{id:i,instance:o}=n;return e(kd,{id:i,instance:o})}const Cd=""+new URL("boosts-carousel-BiOaNdMT.jpg",import.meta.url).href,_d=""+new URL("grouped-notifications-DFgwVVj3.jpg",import.meta.url).href,Id=""+new URL("multi-column-ROck0NVt.jpg",import.meta.url).href,Ad=""+new URL("multi-hashtag-timeline-DH5INVHi.jpg",import.meta.url).href,Td=""+new URL("nested-comments-thread-hv59kZLc.jpg",import.meta.url).href,xd="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",Ed={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:ps,PHANPY_PRIVACY_POLICY_URL:Rd,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:fs}=Ed,ms=ps?ps.replace(/https?:\/\//g,"").replace(/\/$/,""):null,gs=`${"2025-07-18T11:51:01.946Z".slice(0,10).replace(/-/g,".")}.3f4b1a6`;function wo(){const{_:n}=ce();return Ze(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:_i,alt:"",width:"160",height:"160",style:{aspectRatio:"1/1",marginBlockEnd:-16}}),e("img",{src:xd,alt:"Phanpy",width:"200"})]}),e("p",{class:"desc",children:e(u,{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&&fs&&e("p",{children:e("a",{href:fs,class:"button plain5",children:e(u,{id:"e+RpCP"})})}),!Qt&&e("p",{class:"insignificant",children:e("small",{children:e(u,{id:"fvAsUK",components:{0:e("br",{})}})})})]}),(ms||gs)&&e("p",{class:"app-site-version",children:e("small",{children:[ms," ",gs]})}),e("p",{children:e(u,{id:"BskFI2",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank"}),1:e("a",{href:"https://mastodon.social/@cheeaun",target:"_blank",onClick:i=>{i.preventDefault(),x.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:Rd,target:"_blank"})}})}),e("div",{children:e(Ii,{})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:Cd,alt:n({id:"S5cYrQ"}),loading:"lazy"}),e("h4",{children:e(u,{id:"Tu+sCN"})}),e("p",{children:e(u,{id:"e2uVlo"})})]}),e("section",{children:[e("img",{src:Td,alt:n({id:"CGQ27z"}),loading:"lazy"}),e("h4",{children:e(u,{id:"cYE45+"})}),e("p",{children:e(u,{id:"Pc7QKh"})})]}),e("section",{children:[e("img",{src:_d,alt:n({id:"rnrM7k"}),loading:"lazy"}),e("h4",{children:e(u,{id:"4RRMre"})}),e("p",{children:e(u,{id:"8GMtDr"})})]}),e("section",{children:[e("img",{src:Id,alt:n({id:"VLKtvP"}),loading:"lazy"}),e("h4",{children:e(u,{id:"pEkad9"})}),e("p",{children:e(u,{id:"t7Py5R"})})]}),e("section",{children:[e("img",{src:Ad,alt:n({id:"wOax6E"}),loading:"lazy"}),e("h4",{children:e(u,{id:"Wi1Ov0"})}),e("p",{children:e(u,{id:"tS2i+h"})})]})]})})]})}const Ld=window.alert;window.__nativeAlert||(window.__nativeAlert=Ld);window.alert=function(n){n instanceof Error&&n?.message&&(n=n.message),typeof n!="string"&&(n=JSON.stringify(n));const i=ra({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(a=>{i[a]=Object.keys(x[a]).length});const{statuses:o}=x,s=[];for(const a in o)document.querySelector(`[data-state-post-id~="${a}"], [data-state-post-ids~="${a}"]`)||s.push(a)};setInterval(()=>{if(!window.__IDLE__)return;const{statuses:n,unfurledLinks:i,notifications:o}=x;let s=0;const{instance:a}=ie();for(const c in n){if(!window.__IDLE__)break;try{const h=document.querySelector(`[data-state-post-id~="${c}"], [data-state-post-ids~="${c}"]`),d=o.some(r=>c===it(r.status?.id,a));if(!h&&!d){delete x.statuses[c],delete x.statusQuotes[c];for(const r in i){const l=i[r];if(it(l.id,l.instance)===c){delete x.unfurledLinks[r];break}}s++}}catch{}}},15*60*1e3);setTimeout(()=>{for(const n in Bt)setTimeout(()=>{Array.isArray(Bt[n])?Bt[n][0]?.():typeof Bt[n]=="object"?Bt[n].module?.():Bt[n]?.()},1)},5e3);(()=>{window.__IDLE__=!0;const n=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],i=()=>{window.__IDLE__=!0},s=Ns(i,3e3),a=()=>{window.__IDLE__=!1,s()};n.forEach(c=>{window.addEventListener(c,a,{passive:!0,capture:!0})}),window.addEventListener("blur",i,{passive:!0}),document.documentElement.addEventListener("mouseleave",c=>{!c.relatedTarget&&!c.toElement&&i()},{passive:!0})})();const Md=/iPad|iPhone|iPod/.test(navigator.userAgent);Md&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const i=Re.local.get("theme");let o;if(i){if(o=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),o){const s=o.content,a=i==="light"?o.dataset.themeLightColorTemp:o.dataset.themeDarkColorTemp;o.content=a||"",setTimeout(()=>{o.content=s},10)}}else{const s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(o=document.querySelector(`meta[name="theme-color"][media*="${s}"]`),o){const a=o.dataset.content,c=o.dataset.contentTemp;o.content=c||"",setTimeout(()=>{o.content=a},10)}}}});{const n=Re.local.get("theme");if(n){document.documentElement.classList.add(`is-${n}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",n||"dark light");const o=document.querySelector('meta[data-theme-setting="manual"]');o&&(o.name="theme-color",o.content=n==="light"?o.dataset.themeLightColor:o.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(a=>{a.name=""})}const i=Re.local.get("textSize");i&&document.documentElement.style.setProperty("--text-size",`${i}px`)}ys(x,n=>{for(const[i,o,s,a]of n){if(o.join(".")==="settings.shortcutsViewMode"){const c=document.getElementById("app");c&&(c.dataset.shortcutsViewMode=x.shortcuts?.length?s:"")}o.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",s)}});const vn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(n){},end(n){}};document.body.classList.toggle("exp-tab-bar-v2",Re.local.get("experiments-tabBarV2")??!1);function $d(){const[n,i]=E(!1),[o,s]=E("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),ce(),Z(()=>{const c=Re.local.get("instanceURL"),h=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(h){window.history.replaceState({},document.title,window.location.pathname||"/");const{client_id:d,client_secret:r,vapid_key:l}=Cs(c)||{},p=An(c)||l,m=Re.sessionCookie.get("codeVerifier");(async()=>{s("loading");const{access_token:f}=await Ha({instanceURL:c,client_id:d,client_secret:r,code:h,code_verifier:m||void 0});if(f){const b=zo({instance:c,accessToken:f});await Promise.allSettled([Hn(b),qn(b,c),Bo(b,c,f,p)]),$i(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,i(!0),s("default")}else s("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const d=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let r;if(d&&(r=Fo(d),r&&(In(r.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),r||(r=ui()),r){In(r.info.id);const{client:l}=ie({account:r}),{instance:p}=l;$i(),s("loading"),(async()=>{try{Uo()&&Ko(p)?(Hn(l),qn(l,p)):await Promise.allSettled([Hn(l),qn(l,p)])}catch{}finally{i(!0),s("default"),__BENCHMARK.end("app-init")}})()}else s("default"),__BENCHMARK.end("app-init")}Re.sessionCookie.del("clientID"),Re.sessionCookie.del("clientSecret"),Re.sessionCookie.del("codeVerifier")},[]);let a=Wt();return x.currentLocation=a.pathname,Z(ni,[a,n]),/\/https?:/.test(a.pathname)?e(td,{}):o==="loading"?e(De,{id:"loader-root"}):e(D,{children:[e(Pd,{isLoggedIn:n}),e(Dd,{isLoggedIn:n}),e(pi,{children:e(je,{path:"/:instance?/s/:id",element:e(Sd,{})})}),n&&e(fa,{}),n&&e(Il,{}),e(vl,{}),n&&e(Sl,{}),e(ha,{isLoggedIn:n}),e(Cl,{onClose:ni}),e(ma,{})]})}function Nd({isLoggedIn:n}){return n&&__BENCHMARK.end("time-to-isLoggedIn"),n?e(Jr,{}):e(wo,{})}const Pd=ot(({isLoggedIn:n})=>{const i=Wt(),o=Se(()=>{const{pathname:s}=i;return!/^\/(login|welcome|_sandbox)/i.test(s)},[i]);return e(pi,{location:o||i,children:[e(je,{path:"/",element:e(Nd,{isLoggedIn:n})}),e(je,{path:"/login",element:e(ad,{})}),e(je,{path:"/welcome",element:e(wo,{})}),void 0]})});function bs(){return x.prevLocation||null}function Dd({isLoggedIn:n}){const i=Wt(),o=F(bs());return Se(()=>nn("/:instance/s/:id",i.pathname)||nn("/s/:id",i.pathname),[i.pathname,nn])?o.current||(o.current=bs()):o.current=null,e(pi,{location:o.current||i,children:[n&&e(D,{children:[e(je,{path:"/notifications",element:e(fo,{})}),e(je,{path:"/mentions",element:e(lo,{})}),e(je,{path:"/following",element:e(Li,{})}),e(je,{path:"/b",element:e(eo,{})}),e(je,{path:"/f",element:e(to,{})}),e(je,{path:"/l",children:[e(je,{index:!0,element:e(nd,{})}),e(je,{path:":id",element:e(so,{})})]}),e(je,{path:"/fh",element:e(gr,{})}),e(je,{path:"/sp",element:e(ld,{})}),e(je,{path:"/ft",element:e(hr,{})}),e(je,{path:"/catchup",element:e(er,{})}),e(je,{path:"/annual_report/:year",element:e(Yl,{})})]}),e(je,{path:"/:instance?/t/:hashtag",element:e(io,{})}),e(je,{path:"/:instance?/a/:id",element:e(Kl,{})}),e(je,{path:"/:instance?/p",children:[e(je,{index:!0,element:e(oi,{})}),e(je,{path:"l",element:e(oi,{local:!0})})]}),e(je,{path:"/:instance?/trending",element:e(bo,{})}),e(je,{path:"/:instance?/search",element:e(mo,{})})]})}Ho();qo(e(jo,{i18n:fe,children:e(Yo,{children:e($d,{})})}),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 o=!1;const s=1e4,a=60*60*1e3;async function c(){if(window.__IDLE__)try{const h=await caches.keys();for(const d of h){if(i.includes(d))continue;const r=await caches.open(d),l=await r.keys();if(l.length>50){const p=l.slice(50);for(const m of p)await r.delete(m)}}o=!0}catch{}setTimeout(c,o?a:s)}setTimeout(c,s)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")}; //# sourceMappingURL=main-CknXn6mi.js.map