import{X as C}from"./MkNotes-DrVlMmnc.js";import{d as P,aA as N,$ as c,b as t,j as A,P as u,r as B,_ as S}from"./app-QjDgb7aF.js";import{b as H,w as V,f as o,E as a,j as r,g as j,i as p,k as i,u as s,p as m,q as _,H as f,a as q,B as E}from"./vue-Cm77DuTi.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"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-87CjANkN.js";import"./MkPagination-DzUgufpZ.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const U={key:0},X={class:"okzinsic _panel"},$={key:0,class:"description"},z={class:"user"},D=H({__name:"clip",props:{clipId:{}},setup(v){const l=v;let e=q();const h={endpoint:"clips/notes",limit:10,params:o(()=>({clipId:l.clipId}))},k=o(()=>c&&e.value&&c.id===e.value.userId);V(()=>l.clipId,async()=>{e.value=await P("clips/show",{clipId:l.clipId})},{immediate:!0}),E("currentClipPage",e);const g=o(()=>e.value&&k.value?[{icon:"ph-pencil ph-bold ph-lg",text:t.ts.edit,handler:async()=>{const{canceled:n,result:d}=await A(e.value.name,{name:{type:"string",label:t.ts.name,default:e.value.name},description:{type:"string",required:!1,multiline:!0,label:t.ts.description,default:e.value.description},isPublic:{type:"boolean",label:t.ts.public,default:e.value.isPublic}});n||u("clips/update",{clipId:e.value.id,...d})}},{icon:"ph-trash ph-bold ph-lg",text:t.ts.delete,danger:!0,handler:async()=>{const{canceled:n}=await B({type:"warning",text:t.t("deleteAreYouSure",{x:e.value.name})});n||await u("clips/delete",{clipId:e.value.id})}}]:null);return N(o(()=>e.value?{title:e.value.name,icon:"ph-paperclip ph-bold ph-lg"}:null)),(n,d)=>{const M=a("MkPageHeader"),b=a("Mfm"),w=a("MkAvatar"),x=a("MkUserName"),y=a("MkSpacer"),I=a("MkStickyContainer");return r(),j(I,null,{header:p(()=>[i(M,{actions:g.value},null,8,["actions"])]),default:p(()=>[i(y,{"content-max":800},{default:p(()=>[s(e)?(r(),m("div",U,[_("div",X,[s(e).description?(r(),m("div",$,[i(b,{text:s(e).description,"is-note":!1,i:s(c)},null,8,["text","i"])])):f("",!0),_("div",z,[i(w,{user:s(e).user,class:"avatar","show-indicator":!0},null,8,["user"]),i(x,{user:s(e).user,nowrap:!1},null,8,["user"])])]),i(C,{pagination:h,detail:!0})])):f("",!0)]),_:1})]),_:1})}}}),ee=S(D,[["__scopeId","data-v-1e0cfe5e"]]);export{ee as default};
//# sourceMappingURL=clip-Dm_Xvo_c.js.map
