2026-05-17 06:37:38 -04:00
|
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/index-DjvuVPm0.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CziSTDUD.chunk.mjs'),window.OC.filePath('', '', 'dist/NcAvatar-ruClKRzS-CpNPWscr.chunk.mjs'),window.OC.filePath('', '', 'dist/index-COpU9qvO.chunk.mjs'),window.OC.filePath('', '', 'dist/preload-helper-BByimXjD.chunk.mjs'),window.OC.filePath('', '', 'dist/util-BUyb4W9M.chunk.mjs'),window.OC.filePath('', '', 'dist/NcModal-kyWZ3UFC-Cl18TGtY.chunk.mjs'),window.OC.filePath('', '', 'dist/ArrowRight-DgB87uF-.chunk.mjs'),window.OC.filePath('', '', 'dist/Web-CSo1f5Mo.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-CPJIGC2H.chunk.mjs'),window.OC.filePath('', '', 'dist/public-C1mLBHT3.chunk.mjs'),window.OC.filePath('', '', 'dist/common-Web-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/common-ArrowRight-D7L4ZBkR.chunk.css'),window.OC.filePath('', '', 'dist/common-NcModal-kyWZ3UFC-CBh34man.chunk.css'),window.OC.filePath('', '', 'dist/colors-BfjxNgsx-J-p3roax.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-JWiuiAXe-DKCNAxz8.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcUserStatusIcon-JWiuiAXe-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/PencilOutline-Bd3gXgSl.chunk.mjs'),window.OC.filePath('', '', 'dist/common-PencilOutline-DdQinVMt.chunk.css'),window.OC.filePath('', '', 'dist/NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-BqrXIjDq.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcDateTime-DS-ziNw6.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-DeYHYTy2.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrashCanOutline-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/common-NcAvatar-ruClKRzS-D_G6wUEW.chunk.css'),window.OC.filePath('', '', 'dist/emoji-V9hqFgPs-BoVPPNKM.chunk.mjs'),window.OC.filePath('', '', 'dist/index-BxkFOOAm.chunk.mjs'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-D0gFwEVl-CVdipCjx.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcCheckboxRadioSwitch-D0gFwEVl-CQwJiKOs.chunk.css'),window.OC.filePath('', '', 'dist/index-C8_Me_Lb.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-B9mkBKAR.chunk.css'),window.OC.filePath('', '', 'dist/NcEmptyContent-CDgWCt_m-BbQM3A2Q.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcEmptyContent-CDgWCt_m-DoZPzs7J.chunk.css'),window.OC.filePath('', '', 'dist/NcTextField.vue_vue_type_script_setup_true_lang-B-4HNjYH-B-_jVAzM.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-CPL-a_MM-DbT1N8jl.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcInputField-CPL-a_MM-Bsffit-T.chunk.css'),window.OC.filePath('', '', 'dist/common-index--M3XHucY.chunk.css'),window.OC.filePath('', '', 'dist/common-index-DK2nV6zf.chunk.css')])))=>i.map(i=>d[i]);
|
2026-05-26 04:18:20 -04:00
|
|
|
import{o as n,f as h,g as u,t as y,h as N,m as V,a as T,_ as v,r as c,L as U,M as W,c as p,w as m,k as d,F as H,j as _,N as Z,y as w,C as G,b as J}from"./preload-helper-BByimXjD.chunk.mjs";import{a as f,c as K}from"./index-CziSTDUD.chunk.mjs";import{t as Q}from"./translation-DoG5ZELJ-CPJIGC2H.chunk.mjs";import{d as X,m as A}from"./pinia-CjL5y06H.chunk.mjs";import{N as Y,P as ee}from"./PencilOutline-Bd3gXgSl.chunk.mjs";import{a as te}from"./NcModal-kyWZ3UFC-Cl18TGtY.chunk.mjs";/* empty css */import{_ as oe}from"./Web-CSo1f5Mo.chunk.mjs";import{N as ie}from"./NcAvatar-ruClKRzS-CpNPWscr.chunk.mjs";import{N as se,A as ae}from"./ArrowRight-DgB87uF-.chunk.mjs";import{_ as re}from"./NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-BqrXIjDq.chunk.mjs";import{N as ne,D as ce}from"./TrashCanOutline-DeYHYTy2.chunk.mjs";import{N as me}from"./NcUserBubble-BE6yD-R0-ClcDBpx3.chunk.mjs";import{_ as S,l as de}from"./public-C1mLBHT3.chunk.mjs";import{a as I,T as le,f as ue}from"./index-C1xmmKTZ-BhXb8nZF.chunk.mjs";import{l as g}from"./activity-CS_yDSTQ.chunk.mjs";import{c as D,a as pe}from"./GetComments-Dy7uLqLM.chunk.mjs";import{c as x}from"./index-COpU9qvO.chunk.mjs";const he={name:"NcActionSeparator"},ge={class:"action action-separator action--disabled",role:"separator"};function ye(e,o,i,a,r,s){return n(),h("li",ge)}const fe=oe(he,[["render",ye],["__scopeId","data-v-3e2324b7"]]),be={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ce=["aria-hidden","aria-label"],_e=["fill","width","height"],Ie={d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},Ne={key:0};function De(e,o,i,a,r,s){return n(),h("span",V(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon close-icon",role:"img",onClick:o[0]||(o[0]=b=>e.$emit("click",b))}),[(n(),h("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[u("path",Ie,[i.title?(n(),h("title",Ne,y(i.title),1)):N("",!0)])],8,_e))],16,Ce)}const ke=S(be,[["render",De]]);async function we(e,o,i){const a=["",e,o,i].join("/");await D.deleteFile(a)}async function Le(e,o,i,a){const r=["",e,o,i].join("/");return await D.customRequest(r,{method:"PROPPATCH",data:`<?xml version="1.0"?>
|
2026-04-01 09:41:02 -04:00
|
|
|
<d:propertyupdate
|
|
|
|
|
xmlns:d="DAV:"
|
|
|
|
|
xmlns:oc="http://owncloud.org/ns">
|
|
|
|
|
<d:set>
|
|
|
|
|
<d:prop>
|
|
|
|
|
<oc:message>${a}</oc:message>
|
|
|
|
|
</d:prop>
|
|
|
|
|
</d:set>
|
2026-05-17 06:37:38 -04:00
|
|
|
</d:propertyupdate>`})}function L(e,o=1){const i=new DOMParser;let a=e;for(let r=0;r<o;r++)a=i.parseFromString(a,"text/html").documentElement.textContent;return a}async function Te(e,o,i){const a=["",e,o].join("/"),r=await x.post(pe()+a,{actorDisplayName:f().displayName,actorId:f().uid,actorType:"users",creationDateTime:new Date().toUTCString(),message:i,objectType:e,verb:"comment"}),s=parseInt(r.headers["content-location"].split("/").pop()),b=a+"/"+s,C=await D.stat(b,{details:!0}),l=C.data.props;return l.actorDisplayName=L(l.actorDisplayName,2),l.message=L(l.message,2),C.data}const M=X("deletedCommentLimbo",{state:()=>({idsInLimbo:[]}),actions:{addId(e){this.idsInLimbo.push(e)},removeId(e){const o=this.idsInLimbo.indexOf(e);o>-1&&this.idsInLimbo.splice(o,1)},checkForId(e){return this.idsInLimbo.includes(e)}}}),ve={props:{id:{type:Number,default:null},message:{type:String,default:""},resourceId:{type:[String,Number],required:!0},resourceType:{type:String,default:"files"}},data(){return{deleted:!1,editing:!1,loading:!1}},computed:{...A(M)},methods:{onEdit(){this.editing=!0},onEditCancel(){this.editing=!1,this.updateLocalMessage(this.message)},async onEditComment(e){this.loading=!0;try{await Le(this.resourceType,this.resourceId,this.id,e),g.debug("Comment edited",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id,message:e}),this.$emit("update:message",e),this.editing=!1}catch(o){I(t("comments","An error occurred while trying to edit the comment")),g.error("An error occurred while trying to edit the comment",{error:o})}finally{this.loading=!1}},onDeleteWithUndo(){this.$emit("delete"),this.deleted=!0,this.deletedCommentLimboStore.addId(this.id);const e=setTimeout(this.onDelete,le);ue(t("comments","Comment deleted"),()=>{clearTimeout(e),this.deleted=!1,this.deletedCommentLimboStore.removeId(this.id)})},async onDelete(){try{await we(this.resourceType,this.resourceId,this.id),g.debug("Comment deleted",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id}),this.$emit("delete",this.id)}catch(e){I(t("comments","An error occurred while trying to delete the comment")),g.error("An error occurred while trying to delete the comment",{error:e}),this.deleted=!1,this.deletedCommentLimboStore.removeId(this.id)}},async onNewComment(e){this.loading=!0;try{const o=await Te(this.resourceType,this.resourceId,e);g.debug("New comment posted",{resourceType:this.resourceType,resourceId:this.resourceId,newComment:o}),this.$emit("new",o),this.$emit("update:message",""),this.localMessage=""}catch(o){I(t("comments","An error occurred while trying to create the comment")),g.error("An error occurred while trying to create the comment",{error:o})}finally{this.loading=!1}}}},Ae=T(()=>v(()=>import("./index-DjvuVPm0.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url)),Se=T(()=>v(()=>import("./index-BxkFOOAm.chunk.mjs").then(e=>e.i),__vite__mapDeps([25,4,7,8,9,1,10,11,12,26,21,22,27,3,5,28,6,13,29,30,31,32,33,34,35]),import.meta.url)),xe={name:"Comment",components:{IconArrowRight:ae,IconClose:ke,IconTrashCanOutline:ce,IconPencilOutline:ee,NcActionButton:Y,NcActions:te,NcActionSeparator:fe,NcAvatar:ie,NcButton:se,NcDateTime:re,NcLoadingIcon:ne,NcRichContenteditable:Ae,NcRichText:Se},mixins:[ve],inheritAttrs:!1,props:{actorDisplayName:{type:String,required:!0},actorId:{type:String,required:!0},creationDateTime:{type:String,default:null},editor:{type:Boolean,default:!1},autoComplete:{type:Function,required:!0},userData:{type:Object,default:()=>({})},tag:{type:String,default:"div"}},data(){return{expanded:!1,localMessage:"",submitted:!1}},computed:{...A(M),isOwnComment(){return f().uid===this.actorId},richContent(){const e={};let o=this.localMessage;return Object.keys(this.userData).forEach((i,a)=>{const r=`mention-${a}`,s=new RegExp(`@${i}|@"${i}"`,"g");o=o.replace(s,`{${r}}`),e[r]={component:me,props:{user:i,displayName:this.userData[i].label,primary:this.userData[i].primary}}}),{mentions:e,message:o}},isEmptyMessage(){return
|
2026-05-26 04:18:20 -04:00
|
|
|
//# sourceMappingURL=CommentView-BWs00COP.chunk.mjs.map
|