33 lines
267 KiB
JavaScript
33 lines
267 KiB
JavaScript
|
import{F as H,_ as X,p as A,s as $,a as ne,b as He,x as Je,u as De,c as e,k as E,d as we,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 Ae,m as rn,A as ut,n as Ui,o as zc,r as Fi,t as Oi,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 Fs,S as Qn,U as Ln,V as Fe,W as Os,X as zs}from"./useTitle-KMkGka9H.js";import{u as Mn,s as se,a as _e,o as ei,b as Bs,I as v,M as Re,A as st,N as _t,c as Ze,d as pe,e as ze,f as tt,L as re,g as Bi,l as Hs,t as ti,R as It,h as Ge,p as Ut,i as Qe,j as Ee,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-GSnTzOyH.js";import"./tinyld-light-PxOyhYWY.js";import"./index-dbOm7oTI.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"),k=parseInt(h(u,"data-swipe-timeout","500"),10),g=Date.now()-f,y="",T=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<k&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(r)>b&&g<k&&(r>0?y="swiped-up":y="swiped-down"),y!==""){var w={dir:y.replace(/swiped-/,""),touchType:(T[0]||{}).touchType||"direct",fingers:a,xStart:parseInt(s,10),xEnd:parseInt((T[0]||{}).clientX||-1,10),yStart:parseInt(i,10),yEnd:parseInt((T[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 k=l.getAttribute(b);if(k)return k;l=l.parentNode}return m}})(window,document);function Lt(t=()=>{},n=[]){const s=H(t);X(()=>{s.current=t},[n]),X(()=>{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]=A(!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}}};X(()=>{let u,a;if(n&&s){const{masto:d,streaming:p,instance:c}=ne();(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=H(),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())}),_e("shift+alt+k",()=>{const u=$.settings.cloakMode;$.settings.cloakMode=!u,se({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 _e("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 _e("?, shift+?, shift+slash",i=>{$.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:i=>!!document.querySelector("#modal-container > *")}),!!n.showKeyboardShortcutsHelp&&e(Re,{onClose:s
|
||
|
${z.daysSinceLastPost} day${z.daysSinceLastPost>1?"s":""}`:`
|
||
|
Last ${z.total} posts in the past year(s)
|
||
|
`}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${z.originals/z.total*100}%`,"--replies-percentage":`${(z.originals+z.replies)/z.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."})})})}),!j&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!z,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:P==="loading",onClick:()=>{Z()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${P==="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:ue,onProfileUpdate:Ne})})]})]})}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}=ne(),d=n===u,[p,c]=A("default"),[h,l]=A(null),{id:b,acct:m,url:k,username:g,locked:y,lastStatusAt:T,note:w,fields:S,moved:I}=t,x=H(b),{following:G,showingReblogs:D,notifying:M,followedBy:ee,blocking:J,blockedBy:L,muting:N,mutingNotifications:_,requested:U,domainBlocking:j,endorsed:ce,note:O}=h||{},[ie,V]=A(null),[de,he]=A(!1);X(()=>{if(t){const z=dt();let le;(async()=>{if(d&&i)le=b;else if(!d&&a){const Y=t.acct.includes("@");try{const R=await f.v2.search.fetch({q:Y?t.acct:`${t.username}@${n}`,type:"accounts",limit:1,resolve:!0});R.accounts.length&&(le=R.accounts[0].id,V(R.accounts[0]))}catch{}}if(!le)return;if(z===le){he(!0);return}x.current=le,c("loading");const P=f.v1.accounts.relationships.fetch({id:[le]});try{const Y=await P;if(c("default"),Y.length){const R=Y[0];l(R),o({relationship:R,currentID:le})}}catch{c("error")}})()}},[t,i]),X(()=>{t&&de&&As(t)},[t,de]);const oe=p==="loading",[be,Ce]=A(!1),[Ie,Le]=A(!1),[Pe,$e]=A(!1),[Se,Te]=A(!1),[ve,te]=A([]);return e(E,{children:[e("div",{class:"actions",children:[e("span",{children:[ee?e("span",{class:"tag",children:"Follows you"}):T?e("small",{class:"insignificant",children:["Last post:"," ",e("span",{class:"ib",children:rt(T,{hideTime:!0})})]}):e("span",{}),N&&e("span",{class:"tag danger",children:"Muted"}),J&&e("span",{class:"tag danger",children:"Blocked"})]})," ",e("span",{class:"buttons",children:[!!O&&e("button",{type:"button",class:"private-note-tag",title:"Private note",onClick:()=>{$e(!0)},dir:"auto",children:e("span",{children:O})}),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:oe,children:e(v,{icon:"more",size:"l",alt:"More"})}),onMenuChange:z=>{G&&z.open&&(async()=>{try{const le=await f.v1.accounts.$select(x.current).lists.list();te(le)}catch{}})()},children:[a&&!de&&e(E,{children:[e(pe,{onClick:()=>{qs({draftStatus:{status:`@${(ie==null?void 0:ie.acct)||m} `}})},children:[e(v,{icon:"at"}),e("span",{children:["Mention @",g]})]}),e(pe,{onClick:()=>{Ce(!0)},children:[e(v,{icon:"translate"}),e("span",{children:"Translate bio"})]}),Ge("@mastodon/profile-private-note")&&e(pe,{onClick:()=>{$e(!0)},children:[e(v,{icon:"pencil"}),e("span",{children:O?"Edit private note":"Add private note"})]}),G&&!!h&&e(E,{children:[e(pe,{onClick:()=>{c("loading"),(async()=>{try{const z=await f.v1.accounts.$select(x.current).follow({notify:!M});z&&l(z),c("default"),se(z.notifying?`Notifications enabled for @${g}'s posts.`:` Notifications disabled for @${g}'s posts.`)}cat
|
||
|
${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}=ne(),[i,o]=A("default"),[r,f]=A([]),[u,a]=A([]),[d,p]=kt(l=>l+1,0);X(()=>{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]=A(!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(Ae,{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(Re,{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}=ne(),[r,f]=A("default"),u=H(null);return X(()=>{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(Ae,{abrupt:!0,hidden:r!=="loading"}),e("button",{disabled:r==="loading",type:"submit",children:"Save & close"})]})]})]})})]})}function ta({onClose:t=()=>{}}){const{masto:n}=ne(),[s,i]=A("loading"),[o,r]=A(null);X(()=>{(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=H(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(Ae,{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"]'),k=[];m.forEach(g=>{const y=g.name,[T,w,S]=y.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],I=g.value?g.value.trim():"";w&&S&&I&&(k[w]||(k[w]={}),k[w][S]=I)}),k.forEach(g=>{g.name&&!g.val
|
||
|
rgba(${x==null?void 0:x.join(",")}, 0.4) ${D}%,
|
||
|
rgba(${x==null?void 0:x.join(",")}, 0.4) ${M}%
|
||
|
`:`
|
||
|
transparent ${D}%,
|
||
|
transparent ${M}%
|
||
|
`}))==null?void 0:I.join(", "))||"transparent"},[m]);let g=H(null);return X(()=>()=>{var w,S;(S=(w=g.current)==null?void 0:w.hideToast)==null||S.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, ${k})`}:{},children:t==null?void 0:t.map((w,S)=>{const I=t.length===1?m[S]:null;return e("div",{class:"carousel-item",style:I?{"--accent-color":`rgb(${I==null?void 0:I.join(",")})`,"--accent-alpha-color":`rgba(${I==null?void 0:I.join(",")}, 0.4)`}:{},tabindex:"0",ref:S===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,S)=>e("button",{type:"button",disabled:S===d,class:`carousel-dot ${S===d?"active":""}`,onClick:I=>{I.preventDefault(),I.stopPropagation(),a.current.scrollTo({left:a.current.clientWidth*S,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(Ee,{href:((y=t[d])==null?void 0:y.remoteUrl)||((T=t[d])==null?void 0:T.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(re,{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"],Ft={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}=ne(),[o,r]=A("default"),[f,u]=t.acct.split("@"),[a,d]=ge(()=>{const{rules:g,domain:y}=Ui();return[g||[],y]}),[p,c]=A(null),[h,l]=A(!1),b=H(null),[m,k]=A(!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&&!Ft[p].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[Ft[p].stampLabel||Ft[p].label,e("small",{children:"Pending review"})]},p),e("form",{onSubmit:g=>{g.preventDefault();const y=new FormData(g.target),T=Object.fromEntries(y.entries());let{category:w,comment:S,forward:I}=T;S||(S=void 0),I==="on"&&(I=!0);const x=w==="violation"?Object.entries(T).filter(([D])=>D.startsWith("rule_ids")).map(([D,M])=>M):void 0,G={category:w,comment:S,for
|
||
|
|
||
|
|
||
|
<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;se("Saving shortcuts to instance server…"),await s.v1.accounts.$select(h).note.create({comment:k}),u("default"),se("Shortcuts saved")}}catch{u("error"),se("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)"]})})]})]})}Fi($,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=Oi(),s=Nt();return X(()=>{setTimeout(Rs,1e3)},[]),e(E,{children:[!!t.showCompose&&e(Re,{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++,se({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(Re,{onClose:()=>{$.showSettings=!1},children:e(Po,{onClose:()=>{$.showSettings=!1}})}),!!t.showAccounts&&e(Re,{onClose:()=>{$.showAccounts=!1},children:e(To,{onClose:()=>{$.showAccounts=!1}})}),!!t.showAccount&&e(Re,{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(Re,{onClose:()=>{$.showDrafts=!1},children:e(oa,{onClose:()=>$.showDrafts=!1})}),!!t.showMediaModal&&e(Re,{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(Re,{onClose:()=>{$.showShortcutsSettings=!1},children:e(Ia,{onClose:()=>$.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Re,{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(Re,{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(Re,{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(Re,{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}=ne(),[i,o]=A("default"),[r,f]=A(null),[u,a]=A(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
|
||
|
${te?"filtered":""}
|
||
|
${me?"has-spoiler":""}
|
||
|
${le?"show-media":""}
|
||
|
`,children:e(Gi,{class:t,media:Y,lang:N,to:`/${i}/s/${y}?media-only=${R+1}`,onClick:r?ue=>r(ue,R,Y,s):void 0})},q)})}const ki=Je(za);function Ba(t){var S,I,x,G,D;const n=De($),{masto:s,instance:i,authenticated:o}=ne(),[r,f]=ge(()=>{const M=we.local.getJSON("accounts")||[];return[M.find(J=>J.info.id===dt())||M[0],M.length>1]},[]),u=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(M=>M.type==="following"),a=Ks(()=>{$.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),d=H(),[p,c]=A(void 0),h=Xs([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),l=H();async function b(M){return(M||!l.current)&&(l.current=s.v1.mutes.list({limit:80})),await l.current.next()}const m=H();async function k(M){return(M||!m.current)&&(m.current=s.v1.blocks.list({limit:80})),await m.current.next()}const g=Ge("@mastodon/lists"),[y,T]=A([]);X(()=>{g&&p==="open"&&Yt().then(T)},[p==="open"]);const w=H();return e(E,{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(M=>M?void 0:"open")},onContextMenu:M=>{M.preventDefault(),$.showAccounts=!0},...a(),children:[f&&e(st,{url:((S=r==null?void 0:r.info)==null?void 0:S.avatar)||((I=r==null?void 0:r.info)==null?void 0:I.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:[!!((G=n.appVersion)!=null&&G.commitHash)&&n.appVersion.commitHash!=="5e9165b"&&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(Ee,{to:"/",children:[e(v,{icon:"home",size:"l"})," ",e("span",{children:"Home"})]}),o?e(E,{children:[u&&e(Ee,{to:"/following",children:[e(v,{icon:"following",size:"l"})," ",e("span",{children:"Following"})]}),e(Ee,{to:"/catchup",children:[e(v,{icon:"history2",size:"l"}),e("span",{children:"Catch-up"})]}),Ge("@mastodon/mentions")&&e(Ee,{to:"/mentions",children:[e(v,{icon:"at",size:"l"})," ",e("span",{children:"Mentions"})]}),e(Ee,{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,{}),((D=r==null?void 0:r.info)==null?void 0:D.id)&&e(Ee,{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(E,{children:[e(v,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:"Lists"}),e(v,{icon:"chevron-right"})]}),children:[e(Ee,{to:"/l",children:e("span",{children:"All Lists"})}),(y==null?void 0:y.length)>0&&e(E,{children:[e(ze,{}),y.map(M=>e(Ee,{to:`/l/${M.id}`,children:e("span",{children:M.title})},M.id))]})]}):g&&e(Ee,{to:"/l",children:[e(v,{icon:"list",size:"l"}),e("span",{children:"Lists"})]}),e(Ee,{to:"/b",children:[e(v,{icon:"bookmark",size:"l"})," ",e("span",{children:"Bookmarks"})]}),e(cn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(E,{children:[e(v,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:"More…"}),e(v,{icon:"chevron-right"})]}),children:[e(Ee,{to:"/f",children:[e(v,{icon:"heart",size:"l"})," ",e("span",{children:"Likes"})]}),e(Ee,{to:"/fh",children:[e(v,{icon:"hashtag",size:"l"})," ",e("span",{children:"Followed Hashtags"})]}),e(ze,{}),Ge("@mastodon/filters")&&e(Ee,{to:"/ft",children:[e(v,{icon:"filters",size:"l"}),"Filters"]}),e(pe,{onClick:()
|
||
|
//# sourceMappingURL=main-ztohNzti.js.map
|