phanpy-cz/assets/main-hRAbIWke.js

33 lines
267 KiB
JavaScript
Raw Permalink Normal View History

2024-06-23 10:39:24 +00:00
import{F as B,_ as W,p as E,s as $,a as ee,b as He,x as Je,u as De,c as e,k as L,d as ye,g as dt,y as kt,e as Ni,f as Et,h as Nt,i as ft,q as ge,j as et,l as As,L as $e,m as rn,A as ut,n as Ui,o as zc,r as Oi,t as Fi,v as Rs,C as Es,w as Xe,z as _s,B as ot,T as Ls,D as Ms,P as Ds,E as _n,G as St,H as qe,I as zi,J as Ps,K as qt,M as Ns,N as Us,O as Zn,Q as Jn,R as Os,S as Qn,U as Ln,V as Ue,W as Fs,X as zs}from"./useTitle-TOnOofzE.js";import{u as Mn,s as ie,a as Le,o as ei,b as Bs,I as v,M as Ee,A as st,N as _t,c as Ze,d as pe,e as ze,f as tt,L as oe,g as Bi,l as Hs,t as ti,R as It,h as Ge,p as Ut,i as Qe,j as _e,k as Hi,m as Sn,E as qi,n as je,q as rt,r as qs,S as cn,v as ni,T as Vi,w as it,x as Dn,y as Be,z as ht,B as ii,C as Vs,D as Gs,F as Pn,G as Gi,H as js,J as Ys,K as Ws,O as ji,P as Vt,Q as Ks,U as Xs,V as Yi,W as Zs,X as wt,Y as Nn,Z as Js,_ as Wi,$ as Qs,a0 as Ki,a1 as eo,a2 as to,a3 as no,a4 as si,a5 as io,a6 as Kt}from"./fuse-sLNor9NY.js";import"./tinyld-light-PxOyhYWY.js";import"./index-gNUvm9kb.js";var Xi=so;function so(t,n,s){var i=null,o=null,r=function(){i&&(clearTimeout(i),o=null,i=null)},f=function(){var a=o;r(),a&&a()},u=function(){if(!n)return t.apply(this,arguments);var a=this,d=arguments,p=s&&!i;if(r(),o=function(){t.apply(a,d)},i=setTimeout(function(){if(i=null,!p){var c=o;return o=null,c()}},n),p)return o()};return u.cancel=r,u.flush=f,u}/*!
* swiped-events.js - v@version@
* Pure JavaScript swipe events
* https://github.com/john-doherty/swiped-events
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
* @author John Doherty <www.johndoherty.info>
* @license MIT
*/(function(t,n){"use strict";typeof t.CustomEvent!="function"&&(t.CustomEvent=function(l,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var m=n.createEvent("CustomEvent");return m.initCustomEvent(l,b.bubbles,b.cancelable,b.detail),m},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",p,!1),n.addEventListener("touchmove",c,!1),n.addEventListener("touchend",d,!1);var s=null,i=null,o=null,r=null,f=null,u=null,a=0;function d(l){if(u===l.target){var b=parseInt(h(u,"data-swipe-threshold","20"),10),m=h(u,"data-swipe-unit","px"),S=parseInt(h(u,"data-swipe-timeout","500"),10),g=Date.now()-f,y="",I=l.changedTouches||l.touches||[];if(m==="vh"&&(b=Math.round(b/100*n.documentElement.clientHeight)),m==="vw"&&(b=Math.round(b/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(r)?Math.abs(o)>b&&g<S&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(r)>b&&g<S&&(r>0?y="swiped-up":y="swiped-down"),y!==""){var w={dir:y.replace(/swiped-/,""),touchType:(I[0]||{}).touchType||"direct",fingers:a,xStart:parseInt(s,10),xEnd:parseInt((I[0]||{}).clientX||-1,10),yStart:parseInt(i,10),yEnd:parseInt((I[0]||{}).clientY||-1,10)};u.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:w})),u.dispatchEvent(new CustomEvent(y,{bubbles:!0,cancelable:!0,detail:w}))}s=null,i=null,f=null}}function p(l){l.target.getAttribute("data-swipe-ignore")!=="true"&&(u=l.target,f=Date.now(),s=l.touches[0].clientX,i=l.touches[0].clientY,o=0,r=0,a=l.touches.length)}function c(l){if(!(!s||!i)){var b=l.touches[0].clientX,m=l.touches[0].clientY;o=s-b,r=i-m}}function h(l,b,m){for(;l&&l!==n.documentElement;){var S=l.getAttribute(b);if(S)return S;l=l.parentNode}return m}})(window,document);function Lt(t=()=>{},n=[]){const s=B(t);W(()=>{s.current=t},[n]),W(()=>{const i=()=>{const o=document.hidden||document.visibilityState==="hidden";s.current(!o)};return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)},[])}const oo=1e3*3,ao=15e3,ro=Je(function({isLoggedIn:n}){const[s,i]=E(!0);Lt(i);const o=async(u,a,d)=>{var p;if($.notificationsLast){const c=u.v1.notifications.list({limit:1,sinceId:$.notificationsLast.id}),{value:h}=await c.next();if(h!=null&&h.length)if(d)$.notificationsShowNew=!0;else{let l;try{const b=await u.v1.markers.fetch({timeline:"notifications"});l=(p=b==null?void 0:b.notifications)==null?void 0:p.lastReadId}catch{}l?$.notificationsShowNew=h[0].id!==l:$.notificationsShowNew=!0}}};W(()=>{let u,a;if(n&&s){const{masto:d,streaming:p,instance:c}=ee();(async()=>{await o(d,c);let h=!1;p&&(a=setTimeout(()=>{(async()=>{try{h=!0,u=p.user.notification.subscribe();for await(const l of u){if(!u||!s)break;l.event==="notification"&&He(l.payload,c,{skipThreading:!0}),$.notificationsShowNew=!0}}catch{h=!1}h||(a=setInterval(()=>{o(d,c,!0)},ao))})()},oo))})()}return()=>{var d;(d=u==null?void 0:u.unsubscribe)==null||d.call(u),u=null,clearTimeout(a),clearInterval(a)}},[s,n]);const r=B(),f=()=>{r.current=Date.now(),fetch("./version.json").then(u=>u.json()).then(u=>{u&&($.appVersion=u)}).catch(u=>{})};return Mn(f,s&&1e3*60*30),Lt(u=>{u&&(r.current?Date.now()-r.current>1e3*60*60&&f():f())}),Le("shift+alt+k",()=>{const u=$.settings.cloakMode;$.settings.cloakMode=!u,ie({text:`Cloak mode ${u?"disabled":"enabled"}`})}),null});function co(){const t=De($);function n(s){if(t.composerState.minimized){$.composerState.minimized=!1,ei();return}s.shiftKey?Bs()||($.showCompose=!0):(ei(),$.showCompose=!0)}return Le("c, shift+c",n,{ignoreEventWhen:s=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:n,class:`${t.composerState.minimized?"min":""} ${t.composerState.publishing?"loading":""} ${t.composerState.publishingError?"error":""}`,children:e(v,{icon:"quill",size:"xl",alt:"Compose"})})}const lo=Je(function(){const n=De($);function s(){$.showKeyboardShortcutsHelp=!1}return Le("?, shift+?, shift+slash",i=>{$.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:i=>!!document.querySelector("#modal-container > *")}),!!n.showKeyboardShortcutsHelp&&e(Ee,{onClose:s
${F.daysSinceLastPost} day${F.daysSinceLastPost>1?"s":""}`:`
Last ${F.total} posts in the past year(s)
`}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${F.originals/F.total*100}%`,"--replies-percentage":`${(F.originals+F.replies)/F.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"})," ","Original"]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ","Replies"]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ","Boosts"]})]})]}):e("div",{class:"posting-stats",children:"Post stats unavailable."})})})}),!K&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!F,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:U==="loading",onClick:()=>{X()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${U==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),"View post stats"," "]})})})})]}),e("footer",{children:e(Ko,{info:c,instance:i,standalone:s,authenticated:o,onRelationshipChange:ce,onProfileUpdate:Pe})})]})]})}const Wo=3;function Ko({info:t,instance:n,standalone:s,authenticated:i,onRelationshipChange:o=()=>{},onProfileUpdate:r=()=>{}}){var me;if(!t)return null;const{masto:f,instance:u,authenticated:a}=ee(),d=n===u,[p,c]=E("default"),[h,l]=E(null),{id:b,acct:m,url:S,username:g,locked:y,lastStatusAt:I,note:w,fields:k,moved:T}=t,x=B(b),{following:q,showingReblogs:N,notifying:P,followedBy:J,blocking:V,blockedBy:A,muting:D,mutingNotifications:_,requested:M,domainBlocking:K,endorsed:ue,note:ne}=h||{},[le,te]=E(null),[we,de]=E(!1);W(()=>{if(t){const F=dt();let re;(async()=>{if(d&&i)re=b;else if(!d&&a){const G=t.acct.includes("@");try{const R=await f.v2.search.fetch({q:G?t.acct:`${t.username}@${n}`,type:"accounts",limit:1,resolve:!0});R.accounts.length&&(re=R.accounts[0].id,te(R.accounts[0]))}catch{}}if(!re)return;if(F===re){de(!0);return}x.current=re,c("loading");const U=f.v1.accounts.relationships.fetch({id:[re]});try{const G=await U;if(c("default"),G.length){const R=G[0];l(R),o({relationship:R,currentID:re})}}catch{c("error")}})()}},[t,i]),W(()=>{t&&we&&As(t)},[t,we]);const ae=p==="loading",[fe,Re]=E(!1),[Se,Ae]=E(!1),[Oe,xe]=E(!1),[Ie,Ce]=E(!1),[ve,Q]=E([]);return e(L,{children:[e("div",{class:"actions",children:[e("span",{children:[J?e("span",{class:"tag",children:"Follows you"}):I?e("small",{class:"insignificant",children:["Last post:"," ",e("span",{class:"ib",children:rt(I,{hideTime:!0})})]}):e("span",{}),D&&e("span",{class:"tag danger",children:"Muted"}),V&&e("span",{class:"tag danger",children:"Blocked"})]})," ",e("span",{class:"buttons",children:[!!ne&&e("button",{type:"button",class:"private-note-tag",title:"Private note",onClick:()=>{xe(!0)},dir:"auto",children:e("span",{children:ne})}),e(Ze,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",title:"More",class:"plain",disabled:ae,children:e(v,{icon:"more",size:"l",alt:"More"})}),onMenuChange:F=>{q&&F.open&&(async()=>{try{const re=await f.v1.accounts.$select(x.current).lists.list();Q(re)}catch{}})()},children:[a&&!we&&e(L,{children:[e(pe,{onClick:()=>{qs({draftStatus:{status:`@${(le==null?void 0:le.acct)||m} `}})},children:[e(v,{icon:"at"}),e("span",{children:["Mention @",g]})]}),e(pe,{onClick:()=>{Re(!0)},children:[e(v,{icon:"translate"}),e("span",{children:"Translate bio"})]}),Ge("@mastodon/profile-private-note")&&e(pe,{onClick:()=>{xe(!0)},children:[e(v,{icon:"pencil"}),e("span",{children:ne?"Edit private note":"Add private note"})]}),q&&!!h&&e(L,{children:[e(pe,{onClick:()=>{c("loading"),(async()=>{try{const F=await f.v1.accounts.$select(x.current).follow({notify:!P});F&&l(F),c("default"),ie(F.notifying?`Notifications enabled for @${g}'s posts.`:` Notifications disabled for @${g}'s posts.`)}c
${ni(f)}`).join(`
`))||"",o=ni(t)+(i?`
${i}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(v,{icon:"x"})}),e("header",{children:e("h2",{children:"Translated Bio"})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(Vi,{forceTranslate:!0,text:o})]})]})}function Qo({accountID:t,onClose:n}){const{masto:s}=ee(),[i,o]=E("default"),[r,f]=E([]),[u,a]=E([]),[d,p]=kt(l=>l+1,0);W(()=>{o("loading"),(async()=>{try{const l=await Yt();f(l);const b=await s.v1.accounts.$select(t).lists.list();a(b),o("default")}catch{o("error")}})()},[d]);const[c,h]=E(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(v,{icon:"x"})}),e("header",{children:e("h2",{children:"Add/Remove from Lists"})}),e("main",{children:[r.length>0?e("ul",{class:"list-add-remove",children:r.map(l=>{const b=u.some(m=>m.id===l.id);return e("li",{children:e("button",{type:"button",class:`light ${b?"checked":""}`,disabled:i==="loading",onClick:()=>{o("loading"),(async()=>{try{b?await s.v1.lists.$select(l.id).accounts.remove({accountIds:[t]}):await s.v1.lists.$select(l.id).accounts.create({accountIds:[t]}),p()}catch{o("error"),alert(b?"Unable to remove from list.":"Unable to add to list.")}})()},children:[e(v,{icon:"check-circle"}),e("span",{children:l.title})]})})})}):i==="loading"?e("p",{class:"ui-state",children:e($e,{abrupt:!0})}):i==="error"?e("p",{class:"ui-state",children:"Unable to load lists."}):e("p",{class:"ui-state",children:"No lists."}),e("button",{type:"button",class:"plain2",onClick:()=>h(!0),disabled:i!=="default",children:[e(v,{icon:"plus",size:"l"})," ",e("span",{children:"New list"})]})]}),c&&e(Ee,{onClick:l=>{l.target===l.currentTarget&&h(!1)},children:e(Vn,{list:c==null?void 0:c.list,onClose:l=>{l.state==="success"&&p(),h(!1)}})})]})}function ea({account:t,note:n,onRelationshipChange:s=()=>{},onClose:i=()=>{}}){const{masto:o}=ee(),[r,f]=E("default"),u=B(null);return W(()=>{let a;return u.current&&!n&&(a=setTimeout(()=>{var d,p;(p=(d=u.current).focus)==null||p.call(d)},100)),()=>{clearTimeout(a)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(v,{icon:"x"})}),e("header",{children:e("b",{children:["Private note about @",(t==null?void 0:t.username)||(t==null?void 0:t.acct)]})}),e("main",{children:e("form",{onSubmit:a=>{a.preventDefault();const p=new FormData(a.target).get("note");(p==null?void 0:p.trim())!==(n==null?void 0:n.trim())&&(f("loading"),(async()=>{try{const c=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:p});f("default"),s(c),i()}catch(c){f("error"),alert((c==null?void 0:c.message)||"Unable to update private note.")}})())},children:[e("textarea",{ref:u,name:"note",disabled:r==="loading",children:n}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:r==="loading",onClick:()=>{i==null||i()},children:"Cancel"}),e("span",{children:[e($e,{abrupt:!0,hidden:r!=="loading"}),e("button",{disabled:r==="loading",type:"submit",children:"Save & close"})]})]})]})})]})}function ta({onClose:t=()=>{}}){const{masto:n}=ee(),[s,i]=E("loading"),[o,r]=E(null);W(()=>{(async()=>{try{const c=await n.v1.accounts.verifyCredentials();r(c),i("default")}catch{i("error")}})()},[]);const{displayName:f,source:u}=o||{},{note:a,fields:d}=u||{},p=B(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(v,{icon:"x"})}),e("header",{children:e("b",{children:"Edit profile"})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e($e,{abrupt:!0})}):e("form",{onSubmit:c=>{c.preventDefault();const h=new FormData(c.target),l=h.get("display_name"),b=h.get("note"),m=p.current.querySelectorAll('input[name^="fields_attributes"]'),S=[];m.forEach(g=>{const y=g.name,[I,w,k]=y.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],T=g.value?g.value.trim():"";w&&k&&T&&(S[w]||(S[w]={}),S[w][k]=T)}),S.forEach(g=>{g.name&&!g.val
rgba(${x==null?void 0:x.join(",")}, 0.4) ${N}%,
rgba(${x==null?void 0:x.join(",")}, 0.4) ${P}%
`:`
transparent ${N}%,
transparent ${P}%
`}))==null?void 0:T.join(", "))||"transparent"},[m]);let g=B(null);return W(()=>()=>{var w,k;(k=(w=g.current)==null?void 0:w.hideToast)==null||k.call(w)},[]),e("div",{class:`media-modal-container media-modal-count-${t==null?void 0:t.length}`,children:[e("div",{ref:a,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"))&&r()},style:t.length>1?{backgroundAttachment:"local",backgroundImage:`linear-gradient(
to right, ${S})`}:{},children:t==null?void 0:t.map((w,k)=>{const T=t.length===1?m[k]:null;return e("div",{class:"carousel-item",style:T?{"--accent-color":`rgb(${T==null?void 0:T.join(",")})`,"--accent-alpha-color":`rgba(${T==null?void 0:T.join(",")}, 0.4)`}:{},tabindex:"0",ref:k===d?c:null,onClick:x=>{x.target.classList.contains("media")||b(!l)},children:[!!w.description&&e("button",{type:"button",class:"media-alt",hidden:!l,onClick:()=>{$.showMediaAlt={alt:w.description,lang:i}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:i,dir:"auto",children:w.description})]}),e(Gi,{media:w,showOriginal:!0,lang:i})]},w.id)})}),e("div",{class:"carousel-top-controls",hidden:!l,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>r(),children:e(v,{icon:"x"})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((w,k)=>e("button",{type:"button",disabled:k===d,class:`carousel-dot ${k===d?"active":""}`,onClick:T=>{T.preventDefault(),T.stopPropagation(),a.current.scrollTo({left:a.current.clientWidth*k,behavior:"smooth"}),a.current.focus()},children:e(v,{icon:"round",size:"s"})},w.id))}):e("span",{}),e("span",{children:[e(Ze,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(v,{icon:"more",alt:"More"})}),children:[e(_e,{href:((y=t[d])==null?void 0:y.remoteUrl)||((I=t[d])==null?void 0:I.url),class:"carousel-button",target:"_blank",title:"Open original media in new window",children:[e(v,{icon:"popout"}),e("span",{children:"Open original media"})]}),!1]})," ",e(oe,{to:`${s?`/${s}`:""}/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:!l,children:[e("button",{type:"button",class:"carousel-button",hidden:d===0,onClick:w=>{w.preventDefault(),w.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(d-1),behavior:"smooth"})},children:e(v,{icon:"arrow-left"})}),e("button",{type:"button",class:"carousel-button",hidden:d===t.length-1,onClick:w=>{w.preventDefault(),w.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(d+1),behavior:"smooth"})},children:e(v,{icon:"arrow-right"})})]})]})}const ua=[,"spam","legal","violation","other"],Ot={spam:{label:"Spam",description:"Malicious links, fake engagement, or repetitive replies"},legal:{label:"Illegal",description:"Violates the law of your or the server's country"},violation:{label:"Server rule violation",description:"Breaks specific server rules",stampLabel:"Violation"},other:{label:"Other",description:"Issue doesn't fit other categories",excludeStamp:!0}};function ha({account:t,post:n,onClose:s}){const{masto:i}=ee(),[o,r]=E("default"),[f,u]=t.acct.split("@"),[a,d]=ge(()=>{const{rules:g,domain:y}=Ui();return[g||[],y]}),[p,c]=E(null),[h,l]=E(!1),b=B(null),[m,S]=E(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:n?"Report Post":`Report @${f}`}),e("button",{type:"button",class:"plain4 small",disabled:o==="loading",onClick:()=>s(),children:e(v,{icon:"x",size:"xl"})})]}),e("main",{children:[e("div",{class:"report-preview",children:n?e(Be,{status:n,size:"s",previewMode:!0}):e(Qe,{account:t,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!p&&!Ot[p].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[Ot[p].stampLabel||Ot[p].label,e("small",{children:"Pending review"})]},p),e("form",{onSubmit:g=>{g.preventDefault();const y=new FormData(g.target),I=Object.fromEntries(y.entries());let{category:w,comment:k,forward:T}=I;k||(k=void 0),T==="on"&&(T=!0);const x=w==="violation"?Object.entries(I).filter(([N])=>N.startsWith("rule_ids")).map(([N,P])=>P):void 0,q={category:w,comment:k,for
<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;ie("Saving shortcuts to instance server…"),await s.v1.accounts.$select(h).note.create({comment:S}),u("default"),ie("Shortcuts saved")}}catch{u("error"),ie("Unable to save shortcuts")}},title:"Sync to instance server",children:[e(v,{icon:"cloud"}),e(v,{icon:"arrow-up"})]})," ",i.length>0&&e("small",{class:"insignificant ib",children:[i.length," characters"]})]}),!!i&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:"Raw Shortcuts JSON"})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(t.filter(Boolean),null,2)})]})]}),$.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(v,{icon:"cloud"})," Import/export settings from/to instance server (Very experimental)"]})})]})]})}Oi($,t=>{for(const[n,s,i,o]of t)/^show/i.test(s)&&!i&&Tn()});function xa(){var i,o,r,f,u,a,d,p;const t=De($),n=Fi(),s=Nt();return W(()=>{setTimeout(Rs,1e3)},[]),e(L,{children:[!!t.showCompose&&e(Ee,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(Es,{replyToStatus:typeof t.showCompose!="boolean"?t.showCompose.replyToStatus:((i=window.__COMPOSE__)==null?void 0:i.replyToStatus)||null,editStatus:((o=$.showCompose)==null?void 0:o.editStatus)||((r=window.__COMPOSE__)==null?void 0:r.editStatus)||null,draftStatus:((f=$.showCompose)==null?void 0:f.draftStatus)||((u=window.__COMPOSE__)==null?void 0:u.draftStatus)||null,onClose:c=>{const{newStatus:h,instance:l,type:b}=c||{};$.showCompose=!1,window.__COMPOSE__=null,h&&($.reloadStatusPage++,ie({text:{post:"Post published. Check it out.",reply:"Reply posted. Check it out.",edit:"Post updated. Check it out."}[b||"post"],delay:1e3,duration:1e4,onClick:m=>{m.hideToast(),$.prevLocation=s,n(l?`/${l}/s/${h.id}`:`/s/${h.id}`)}}))}})}),!!t.showSettings&&e(Ee,{onClose:()=>{$.showSettings=!1},children:e(Po,{onClose:()=>{$.showSettings=!1}})}),!!t.showAccounts&&e(Ee,{onClose:()=>{$.showAccounts=!1},children:e(To,{onClose:()=>{$.showAccounts=!1}})}),!!t.showAccount&&e(Ee,{onClose:()=>{$.showAccount=!1},children:e(sa,{account:((a=t.showAccount)==null?void 0:a.account)||t.showAccount,instance:(d=t.showAccount)==null?void 0:d.instance,onClose:({destination:c}={})=>{$.showAccount=!1}})}),!!t.showDrafts&&e(Ee,{onClose:()=>{$.showDrafts=!1},children:e(oa,{onClose:()=>$.showDrafts=!1})}),!!t.showMediaModal&&e(Ee,{onClick:c=>{(c.target===c.currentTarget||c.target.classList.contains("media"))&&($.showMediaModal=!1)},children:e(ls,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{$.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(Ee,{onClose:()=>{$.showShortcutsSettings=!1},children:e(Ia,{onClose:()=>$.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Ee,{onClose:()=>{$.showGenericAccounts=!1},children:e(ca,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>$.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(Ee,{onClose:c=>{$.showMediaAlt=!1},children:e(la,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(p=t.showMediaAlt)==null?void 0:p.lang,onClose:()=>{$.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(Ee,{class:"solid",onClose:()=>{$.showEmbedModal=!1},children:e(ra,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{$.showEmbedModal=!1}})}),!!t.showReportModal&&e(Ee,{onClose:()=>{$.showReportModal=!1},children:e(ha,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{$.showReportModal=!1}})})]})}function $n({accountID:t,onChange:n}){const{masto:s}=ee(),[i,o]=E("default"),[r,f]=E(null),[u,a]=E(null),d=u!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:i==="loading"||d,onClick:()=>{o("loading"),f("accept"),(async(
media-post
${Q?"filtered":""}
${me?"has-spoiler":""}
${re?"show-media":""}
`,children:e(Gi,{class:t,media:G,lang:D,to:`/${i}/s/${y}?media-only=${R+1}`,onClick:r?ce=>r(ce,R,G,s):void 0})},H)})}const ki=Je(za);function Ba(t){var k,T,x,q,N;const n=De($),{masto:s,instance:i,authenticated:o}=ee(),[r,f]=ge(()=>{const P=ye.local.getJSON("accounts")||[];return[P.find(V=>V.info.id===dt())||P[0],P.length>1]},[]),u=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(P=>P.type==="following"),a=Ks(()=>{$.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),d=B(),[p,c]=E(void 0),h=Xs([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),l=B();async function b(P){return(P||!l.current)&&(l.current=s.v1.mutes.list({limit:80})),await l.current.next()}const m=B();async function S(P){return(P||!m.current)&&(m.current=s.v1.blocks.list({limit:80})),await m.current.next()}const g=Ge("@mastodon/lists"),[y,I]=E([]);W(()=>{g&&p==="open"&&Yt().then(I)},[p==="open"]);const w=B();return e(L,{children:[e("button",{ref:d,type:"button",class:`button plain nav-menu-button ${f?"with-avatar":""} ${p==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{w.current=Date.now(),c(P=>P?void 0:"open")},onContextMenu:P=>{P.preventDefault(),$.showAccounts=!0},...a(),children:[f&&e(st,{url:((k=r==null?void 0:r.info)==null?void 0:k.avatar)||((T=r==null?void 0:r.info)==null?void 0:T.avatarStatic),size:"l",squircle:(x=r==null?void 0:r.info)==null?void 0:x.bot}),e(v,{icon:"menu",size:f?"s":"l"})]}),e(Yi,{menuClassName:"nav-menu",state:p,anchorRef:d,onClose:()=>{c(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-w.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:h,unmountOnClose:!0,children:[!!((q=n.appVersion)!=null&&q.commitHash)&&n.appVersion.commitHash!=="20d0b1c"&&e("div",{class:"top-menu",children:[e(pe,{onClick:()=>{confirm("Reload page now to update?")&&(async()=>{try{location.reload()}catch{}})()},children:[e(v,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:"New update available…"})]}),e(ze,{})]}),e("section",{children:[e(_e,{to:"/",children:[e(v,{icon:"home",size:"l"})," ",e("span",{children:"Home"})]}),o?e(L,{children:[u&&e(_e,{to:"/following",children:[e(v,{icon:"following",size:"l"})," ",e("span",{children:"Following"})]}),e(_e,{to:"/catchup",children:[e(v,{icon:"history2",size:"l"}),e("span",{children:"Catch-up"})]}),Ge("@mastodon/mentions")&&e(_e,{to:"/mentions",children:[e(v,{icon:"at",size:"l"})," ",e("span",{children:"Mentions"})]}),e(_e,{to:"/notifications",children:[e(v,{icon:"notification",size:"l"})," ",e("span",{children:"Notifications"}),n.notificationsShowNew&&e("sup",{title:"New",style:{opacity:.5},children:[" ","•"]})]}),e(ze,{}),((N=r==null?void 0:r.info)==null?void 0:N.id)&&e(_e,{to:`/${i}/a/${r.info.id}`,children:[e(v,{icon:"user",size:"l"})," ",e("span",{children:"Profile"})]}),(y==null?void 0:y.length)>0?e(cn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(L,{children:[e(v,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:"Lists"}),e(v,{icon:"chevron-right"})]}),children:[e(_e,{to:"/l",children:e("span",{children:"All Lists"})}),(y==null?void 0:y.length)>0&&e(L,{children:[e(ze,{}),y.map(P=>e(_e,{to:`/l/${P.id}`,children:e("span",{children:P.title})},P.id))]})]}):g&&e(_e,{to:"/l",children:[e(v,{icon:"list",size:"l"}),e("span",{children:"Lists"})]}),e(_e,{to:"/b",children:[e(v,{icon:"bookmark",size:"l"})," ",e("span",{children:"Bookmarks"})]}),e(cn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(L,{children:[e(v,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:"More…"}),e(v,{icon:"chevron-right"})]}),children:[e(_e,{to:"/f",children:[e(v,{icon:"heart",size:"l"})," ",e("span",{children:"Likes"})]}),e(_e,{to:"/fh",children:[e(v,{icon:"hashtag",size:"l"})," ",e("span",{children:"Followed Hashtags"})]}),e(ze,{}),Ge("@mastodon/filters")&&e(_e,{to:"/ft",children:[e(v,{icon:"filters",size:"l"}),"Filters"]}),e(pe,{onClick:()
//# sourceMappingURL=main-hRAbIWke.js.map