import{sask,aasz,basAe,uas_n,caspe,oasms,Iasw,MasCe,dasse,Aaset,NasIt,easFe,fasBe,Lasee,gasat,hasEn,lasgs,tasQt,Ras$t,iasbs,pastt,jasHe,kasPn,masPt,EasNn,nasUe,qasKe,rasys,vasIe,wasen,TasDn,xasht,yasUn,zastn,Basws,Casvs,DasFn,FasEe,GasSs,SasMe,Hasks,JasIs,KasGe,OasOn,PasNt,QasTs,Uasrt,VasBn,Was_e,Xaszn,YasCs,Zas$s,_asxs,$asgt,a0asAs,a1asnn,a2asLs,a3assn,a4ason}from"./useTitle-60DQEO3r.js";import{_asD,pasB,has$,uasRe,wasze,aase,basSe,gasA,sasxt,casHt,Masoe,dasDe,easlt,Fashe,TasVe,SasMs,Iasje,yasJe,fasqn,lasan,iasHn,jasVn,kasqe,AasRs,Nas_s,masEs,qasPs,JasNs,CasGn,nasDs,oasnt,rasjn,tasUs,vasFs,xasOs,zaspt,BasYn,Dascn,EasBs,RasVt,GasTe,Haszs,Kasqs}from"./vendor-jabuMAqb.js";functionct(t=()=>{},n=[]){consti=D(t);B(()=>{i.current=t},[n]),B(()=>{consto=()=>{consta=document.hidden||document.visibilityState==="hidden";i.current(!a)};returndocument.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[])}constHs=1e3*3,Vs=15e3,Gs=ze(function({isLoggedIn:n}){const[i,o]=$(!0);ct(o);consta=async(l,c,d)=>{varh;if(k.notificationsLast){constr=l.v1.notifications.list({limit:1,sinceId:k.notificationsLast.id}),{value:p}=awaitr.next();if(p!=null&&p.length)if(d)k.notificationsShowNew=!0;else{letf;try{constb=awaitl.v1.markers.fetch({timeline:"notifications"});f=(h=b==null?void0:b.notifications)==null?void0:h.lastReadId}catch{}f?k.notificationsShowNew=p[0].id!==f:k.notificationsShowNew=!0}}};B(()=>{letl,c;if(n&&i){const{masto:d,streaming:h,instance:r}=z();(async()=>{awaita(d,r);letp=!1;h&&(c=setTimeout(()=>{(async()=>{try{p=!0,l=h.user.notification.subscribe();forawait(constfofl){if(!l||!i)break;f.event==="notification"&&Ae(f.payload,r,{skipThreading:!0}),k.notificationsShowNew=!0}}catch{p=!1}p||(c=setInterval(()=>{a(d,r,!0)},Vs))})()},Hs))})()}return()=>{vard;(d=l==null?void0:l.unsubscribe)==null||d.call(l),l=null,clearTimeout(c),clearInterval(c)}},[i,n]);consts=D(),u=()=>{s.current=Date.now(),fetch("./version.json").then(l=>l.json()).then(l=>{l&&(k.appVersion=l)}).catch(l=>{})};return_n(u,i&&1e3*60*30),ct(l=>{l&&(s.current?Date.now()-s.current>1e3*60*60&&u():u())}),Re("shift+alt+k",()=>{constl=k.settings.cloakMode;k.settings.cloakMode=!l,pe({text:`Cloak mode ${l?"disabled":"enabled"}`})}),null});functionjs(){functiont(n){n.shiftKey?ms()||(k.showCompose=!0):k.showCompose=!0}returnRe("c, shift+c",t,{ignoreEventWhen:n=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:t,children:e(w,{icon:"quill",size:"xl",alt:"Compose"})})}constYs=ze(function(){constn=Se(k);functioni(){k.showKeyboardShortcutsHelp=!1}returnRe("?, shift+?",o=>{k.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:o=>!!document.querySelector("#modal-container > *")}),!!n.showKeyboardShortcutsHelp&&e(Ce,{class:"light",onClose:i,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:i,children:e(w,{icon:"x"})}),e("header",{children:e("h2",{children:"Keyboard shortcuts"})}),e("main",{children:e("table",{children:[{action:"Keyboard shortcuts help",keys:e("kbd",{children:"?"})},{action:"Next post",keys:e("kbd",{children:"j"})},{action:"Previous post",keys:e("kbd",{children:"k"})},{action:"Skip carousel to next post",keys:e(A,{children:[e("kbd",{children:"Shift"})," + ",e("kbd",{children:"j"})]})},{action:"Skip carousel to previous post",keys:e(A,{children:[e("kbd",{children:"Shift"})," + ",e("kbd",{children:"k"})]})},{action:"Open post details",keys:e(A,{children:[e("kbd",{children:"Enter"})," or ",e("kbd",{children:"o"})]})},{action:e(A,{children:["Expand content warning or",e("br",{}),"toggle expanded/collapsed thread"]}),keys:e("kbd",{children:"x"})},{action:"Close post or dialogs",keys:e(A,{children:[e("kbd",{children:"Esc"})," or ",e("kbd",{children:"Backspace"})]
toright,${v})`}:{},children:t==null?void 0:t.map((I,T)=>{const x=t.length===1?g[T]:null;return e("div",{class:"carousel-item",style:x?{"--accent-color":`rgb(${x==null?void0:x.join(",")})`,"--accent-alpha-color":`rgba(${x==null?void0:x.join(",")},0.4)`}:{},tabindex:"0",ref:T===d?r:null,onClick:L=>{L.target.classList.contains("media")||b(!f)},children:[!!I.description&&e("button",{type:"button",class:"media-alt",hidden:!f,onClick:()=>{k.showMediaAlt={alt:I.description,lang:o}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:o,dir:"auto",children:I.description})]}),e(Fn,{media:I,showOriginal:!0,lang:o})]},I.id)})}),e("div",{class:"carousel-top-controls",hidden:!f,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>s(),children:e(w,{icon:"x"})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((I,T)=>e("button",{type:"button",disabled:T===d,class:`carousel-dot${T===d?"active":""}`,onClick:x=>{x.preventDefault(),x.stopPropagation(),c.current.scrollTo({left:c.current.clientWidth*T,behavior:"smooth"}),c.current.focus()},children:e(w,{icon:"round",size:"s"})},I.id))}):e("span",{}),e("span",{children:[e(Fe,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(w,{icon:"more",alt:"More"})}),children:[e(Ee,{href:((y=t[d])==null?void 0:y.remoteUrl)||((S=t[d])==null?void 0:S.url),class:"carousel-button",target:"_blank",title:"Open original media in new window",children:[e(w,{icon:"popout"}),e("span",{children:"Open original media"})]}),!1]})," ",e(ee,{to:`${i?`/${i}`:""}/s/${n}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${d+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:"View post "}),"»"]})]})]}),(t==null?void 0:t.length)>1&&e("div",{class:"carousel-controls",hidden:!f,children:[e("button",{type:"button",class:"carousel-button",hidden:d===0,onClick:I=>{I.preventDefault(),I.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(d-1),behavior:"smooth"})},children:e(w,{icon:"arrow-left"})}),e("button",{type:"button",class:"carousel-button",hidden:d===t.length-1,onClick:I=>{I.preventDefault(),I.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(d+1),behavior:"smooth"})},children:e(w,{icon:"arrow-right"})})]})]})}const Ii="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",Ti="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",Ci="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