import{b as S,a as l,w as E,f as m,E as r,j as n,g as u,i as p,k as v,q as f,T as B,u as a,p as R,H as $,I as H}from"./vue-Cm77DuTi.js";import{X as L}from"./MkNoteDetailed-PT22T8pk.js";import{M as P}from"./MkRemoteCaution-DJgb88dO.js";import{v as T,aA as V,b as d,d as D,_ as O}from"./app-QjDgb7aF.js";import"./MkTab.vue_vue_type_style_index_0_lang-Cn_SAquG.js";import"./MkNote-RPFbRjy2.js";import"./MkReactionsViewer-D75lmVQ0.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-D23mNn1N.js";import"./share-available-Drgr3YiT.js";import"./get-note-summary-DlGmePWF.js";import"./MkUserCardMini-DH-Qs1OK.js";import"./MkMiniChart.vue_vue_type_script_setup_true_lang-p7s6jgEI.js";import"./v4-Dnyct6Ft.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const X={class:"fcuexfpr"},j={key:0,class:"note"},q={class:"main _gap"},U={class:"note _gap"},z=S({__name:"note",props:{noteId:{}},setup(_){const h=_;let t=l(),k=l(),g=l(!1),e=l(),s=l(T.state.alwaysExpandCws);function C(){t.value=null,D("notes/show",{noteId:h.noteId}).then(o=>{t.value=o,g.value=t.value.renote!=null&&t.value.text==null&&t.value.fileIds.length===0&&t.value.poll==null,e.value=g.value?t.value.renote:t.value}).catch(o=>{k.value=o})}function M(){s.value=!s.value}E(()=>h.noteId,C,{immediate:!0});const w=m(()=>e.value?[{icon:`${s.value?"ph-eye":"ph-eye-slash"} ph-bold ph-lg`,text:s.value?d.ts.collapseAllCws:d.ts.expandAllCws,handler:M}]:[]),x=m(()=>[]);return V(m(()=>e.value?{title:d.t("noteOf",{user:e.value.user.name||e.value.user.username}),subtitle:new Date(e.value.createdAt).toLocaleString(),avatar:e.value.user,path:`/notes/${e.value.id}`,share:{title:d.t("noteOf",{user:e.value.user.name||e.value.user.username}),text:e.value.text}}:null)),(o,i)=>{const y=r("MkPageHeader"),b=r("MkError"),A=r("MkLoading"),I=r("MkSpacer"),N=r("MkStickyContainer");return n(),u(N,null,{header:p(()=>[v(y,{actions:w.value,tabs:x.value,"display-back-button":!0,to:`#${_.noteId}`},null,8,["actions","tabs","to"])]),default:p(()=>[v(I,{"content-max":800,marginMin:6},{default:p(()=>[f("div",X,[v(B,{name:o.$store.state.animation?"fade":"",mode:"out-in"},{default:p(()=>[a(e)?(n(),R("div",j,[f("div",q,[f("div",U,[a(e).user.host!=null?(n(),u(P,{key:0,href:a(e).url??a(e).uri},null,8,["href"])):$("",!0),(n(),u(L,{key:a(e).id,note:a(e),"onUpdate:note":i[0]||(i[0]=c=>H(e)?e.value=c:e=c),expandAllCws:a(s),class:"note"},null,8,["note","expandAllCws"]))])])])):a(k)?(n(),u(b,{key:1,onRetry:i[1]||(i[1]=c=>o.fetch())})):(n(),u(A,{key:2}))]),_:1},8,["name"])])]),_:1})]),_:1})}}}),re=O(z,[["__scopeId","data-v-83058636"]]);export{re as default};
//# sourceMappingURL=note-Brjt6oVe.js.map
