var N=Object.defineProperty;var u=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var m=(a,t,e)=>t in a?N(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,_=(a,t)=>{for(var e in t||(t={}))S.call(t,e)&&m(a,e,t[e]);if(u)for(var e of u(t))A.call(t,e)&&m(a,e,t[e]);return a};import{X as B}from"./MkNotes-Z5KXbZLG.js";import{$ as c,f as H,i,q as V,P as v,w as q,a4 as z,n as D}from"./app-JmgyQoR0.js";import{b as U,a as X,c as o,w as $,p as j,D as s,h as r,i as E,j as p,l as n,t as f,u as h,z as O,H as k}from"./vue-y3KLWBaS.js";import"./MkNote-Y7yPCL5J.js";import"./MkReactionsViewer-iZKN4Via.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-MnLL2GJr.js";import"./share-available-LNRVMfAE.js";import"./get-note-summary-7eDLQp-L.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-bpwwzSpi.js";import"./MkPagination-urywMrXv.js";const W={key:0},Y={class:"okzinsic _panel"},F={key:0,class:"description"},G={class:"user"},J=U({__name:"clip",props:{clipId:{}},setup(a){const t=a;let e=X();const g={endpoint:"clips/notes",limit:10,params:o(()=>({clipId:t.clipId}))},w=o(()=>c&&e.value&&c.id===e.value.userId);$(()=>t.clipId,async()=>{e.value=await H("clips/show",{clipId:t.clipId})},{immediate:!0}),j("currentClipPage",e);const M=o(()=>e.value&&w.value?[{icon:"ph-pencil ph-bold ph-lg",text:i.ts.edit,handler:async()=>{const{canceled:l,result:d}=await V(e.value.name,{name:{type:"string",label:i.ts.name,default:e.value.name},description:{type:"string",required:!1,multiline:!0,label:i.ts.description,default:e.value.description},isPublic:{type:"boolean",label:i.ts.public,default:e.value.isPublic}});l||v("clips/update",_({clipId:e.value.id},d))}},{icon:"ph-trash ph-bold ph-lg",text:i.ts.delete,danger:!0,handler:async()=>{const{canceled:l}=await q({type:"warning",text:i.t("deleteAreYouSure",{x:e.value.name})});l||await v("clips/delete",{clipId:e.value.id})}}]:null);return z(o(()=>e.value?{title:e.value.name,icon:"ph-paperclip ph-bold ph-lg"}:null)),(l,d)=>{const b=s("MkPageHeader"),x=s("Mfm"),y=s("MkAvatar"),I=s("MkUserName"),C=s("MkSpacer"),P=s("MkStickyContainer");return r(),E(P,null,{header:p(()=>[n(b,{actions:M.value},null,8,["actions"])]),default:p(()=>[n(C,{"content-max":800},{default:p(()=>[e.value?(r(),f("div",W,[h("div",Y,[e.value.description?(r(),f("div",F,[n(x,{text:e.value.description,"is-note":!1,i:O(c)},null,8,["text","i"])])):k("",!0),h("div",G,[n(y,{user:e.value.user,class:"avatar","show-indicator":!0},null,8,["user"]),n(I,{user:e.value.user,nowrap:!1},null,8,["user"])])]),n(B,{pagination:g,detail:!0})])):k("",!0)]),_:1})]),_:1})}}}),ne=D(J,[["__scopeId","data-v-ddb524f9"]]);export{ne as default};
