nextcloud/dist/comments-comments-app.js
Ferdinand Thiessen 0001c3000e
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-19 15:40:09 +01:00

2 lines
No EOL
47 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var e,n,o,r={11083(t,e,n){var o=n(11568),r=n(88835),a=t.exports;for(var s in o)o.hasOwnProperty(s)&&(a[s]=o[s]);function i(t){if("string"==typeof t&&(t=r.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a.request=function(t,e){return t=i(t),o.request.call(this,t,e)},a.get=function(t,e){return t=i(t),o.get.call(this,t,e)}},11568(t,e,n){var o=n(55537),r=n(6917),a=n(57510),s=n(86866),i=n(88835),c=e;c.request=function(t,e){t="string"==typeof t?i.parse(t):a(t);var n=-1===globalThis.location.protocol.search(/^https?:$/)?"http:":"",r=t.protocol||n,s=t.hostname||t.host,c=t.port,l=t.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),t.url=(s?r+"//"+s:"")+(c?":"+c:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var d=new o(t);return e&&d.on("response",e),d},c.get=function(t,e){var n=c.request(t,e);return n.end(),n},c.ClientRequest=o,c.IncomingMessage=r.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},15340(){},17601(t,e,n){"use strict";n.d(e,{G:()=>s});var o=n(93028),r=n(11163),a=n(78049);class s extends Error{constructor(t,e){const n=[...arguments],{options:o,shortMessage:s}=(0,a.W)(n);let i=s;if(o.cause&&(i=`${i}: ${o.cause.message}`),super(i),this.message=i,o.name&&"string"==typeof o.name?this.name=o.name:this.name=(0,r.z)(),o.cause&&Object.defineProperty(this,"_cause",{value:o.cause}),Object.defineProperty(this,"_info",{value:{}}),o.info&&"object"==typeof o.info&&Object.assign(this._info,o.info),Error.captureStackTrace){const t=o.constructorOpt||this.constructor;Error.captureStackTrace(this,t)}}static cause(t){return(0,o.t)(t),t._cause&&(0,o.b)(t._cause)?t._cause:null}static fullStack(t){(0,o.t)(t);const e=s.cause(t);return e?`${t.stack}\ncaused by: ${s.fullStack(e)}`:t.stack??""}static info(t){(0,o.t)(t);const e={},n=s.cause(t);return n&&Object.assign(e,s.info(n)),t._info&&Object.assign(e,t._info),e}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}},22408(t,e,n){"use strict";n.d(e,{A:()=>i});var o=n(71354),r=n.n(o),a=n(76314),s=n.n(a)()(r());s.push([t.id,".comment[data-v-70317f94]{display:flex;gap:8px;padding:5px 10px}.comment__side[data-v-70317f94]{display:flex;align-items:flex-start;padding-top:6px}.comment__body[data-v-70317f94]{display:flex;flex-grow:1;flex-direction:column;container-type:inline-size}.comment__header[data-v-70317f94]{display:flex;align-items:center;min-height:44px}.comment__actions[data-v-70317f94]{margin-inline-start:10px !important}.comment__author[data-v-70317f94]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--color-text-maxcontrast)}.comment_loading[data-v-70317f94],.comment__timestamp[data-v-70317f94]{margin-inline-start:auto;text-align:end;white-space:nowrap;color:var(--color-text-maxcontrast)}.comment__editor-group[data-v-70317f94]{position:relative}.comment__editor-description[data-v-70317f94]{color:var(--color-text-maxcontrast);padding-block:var(--default-grid-baseline)}.comment__submit[data-v-70317f94]{position:absolute !important;bottom:5px;inset-inline-end:0}.comment__message[data-v-70317f94]{white-space:pre-wrap;word-break:normal;max-height:200px;overflow:auto;scrollbar-gutter:stable;scrollbar-width:thin;margin-top:-6px}.comment__message--expanded[data-v-70317f94]{max-height:none;overflow:visible}.comment__message[data-v-70317f94] img{max-width:100%;height:auto}.rich-contenteditable__input[data-v-70317f94]{min-height:44px;margin:0;padding:10px}","",{version:3,sources:["webpack://./apps/comments/src/components/Comment.vue"],names:[],mappings:"AAKA,0BACC,YAAA,CACA,OAAA,CACA,gBAAA,CAEA,gCACC,YAAA,CACA,sBAAA,CACA,eAAA,CAGD,gCACC,YAAA,CACA,WAAA,CACA,qBAAA,CACA,0BAAA,CAGD,kCACC,YAAA,CACA,kBAAA,CACA,eAAA,CAGD,mCACC,mCAAA,CAGD,kCACC,eAAA,CACA,kBAAA,CACA,sBAAA,CACA,mCAAA,CAGD,uEAEC,wBAAA,CACA,cAAA,CACA,kBAAA,CACA,mCAAA,CAGD,wCACC,iBAAA,CAGD,8CACC,mCAAA,CACA,0CAAA,CAGD,kCACC,4BAAA,CACA,UAAA,CACA,kBAAA,CAGD,mCACC,oBAAA,CACA,iBAAA,CACA,gBAAA,CACA,aAAA,CACA,uBAAA,CACA,oBAAA,CACA,eAAA,CACA,6CACC,eAAA,CACA,gBAAA,CAED,uCACC,cAAA,CACA,WAAA,CAKH,8CACC,eAAA,CACA,QAAA,CACA,YAlFiB",sourcesContent:['\n@use "sass:math";\n\n$comment-padding: 10px;\n\n.comment {\n\tdisplay: flex;\n\tgap: 8px;\n\tpadding: 5px $comment-padding;\n\n\t&__side {\n\t\tdisplay: flex;\n\t\talign-items: flex-start;\n\t\tpadding-top: 6px;\n\t}\n\n\t&__body {\n\t\tdisplay: flex;\n\t\tflex-grow: 1;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tmin-height: 44px;\n\t}\n\n\t&__actions {\n\t\tmargin-inline-start: $comment-padding !important;\n\t}\n\n\t&__author {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&_loading,\n\t&__timestamp {\n\t\tmargin-inline-start: auto;\n\t\ttext-align: end;\n\t\twhite-space: nowrap;\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&__editor-group {\n\t\tposition: relative;\n\t}\n\n\t&__editor-description {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tpadding-block: var(--default-grid-baseline);\n\t}\n\n\t&__submit {\n\t\tposition: absolute !important;\n\t\tbottom: 5px;\n\t\tinset-inline-end: 0;\n\t}\n\n\t&__message {\n\t\twhite-space: pre-wrap;\n\t\tword-break: normal;\n\t\tmax-height: 200px;\n\t\toverflow: auto;\n\t\tscrollbar-gutter: stable;\n\t\tscrollbar-width: thin;\n\t\tmargin-top: -6px;\n\t\t&--expanded {\n\t\t\tmax-height: none;\n\t\t\toverflow: visible;\n\t\t}\n\t\t:deep(img) {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t}\n}\n\n.rich-contenteditable__input {\n\tmin-height: 44px;\n\tmargin: 0;\n\tpadding: $comment-padding;\n}\n\n'],sourceRoot:""}]);const i=s},42634(){},47790(){},51069(){},59169(){},61160(t,e,n){"use strict";var o=n(92063),r=n(73992),a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,d=/^[a-zA-Z]:/;function u(t){return(t||"").toString().replace(a,"")}var m=[["#","hash"],["?","query"],function(t,e){return f(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};function h(t){var e,n=("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).location||{},o={},r=typeof(t=t||n);if("blob:"===t.protocol)o=new A(unescape(t.pathname),{});else if("string"===r)for(e in o=new A(t,{}),p)delete o[e];else if("object"===r){for(e in t)e in p||(o[e]=t[e]);void 0===o.slashes&&(o.slashes=i.test(t.href))}return o}function f(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function g(t,e){t=(t=u(t)).replace(s,""),e=e||{};var n,o=l.exec(t),r=o[1]?o[1].toLowerCase():"",a=!!o[2],i=!!o[3],c=0;return a?i?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):i?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):f(r)?n=o[4]:r?a&&(n=n.slice(2)):c>=2&&f(e.protocol)&&(n=o[4]),{protocol:r,slashes:a||f(r),slashesCount:c,rest:n}}function A(t,e,n){if(t=(t=u(t)).replace(s,""),!(this instanceof A))return new A(t,e,n);var a,i,c,l,p,C,y=m.slice(),v=typeof e,w=this,b=0;for("object"!==v&&"string"!==v&&(n=e,e=null),n&&"function"!=typeof n&&(n=r.parse),a=!(i=g(t||"",e=h(e))).protocol&&!i.slashes,w.slashes=i.slashes||a&&e.slashes,w.protocol=i.protocol||e.protocol||"",t=i.rest,("file:"===i.protocol&&(2!==i.slashesCount||d.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!f(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);b<y.length;b++)"function"!=typeof(l=y[b])?(c=l[0],C=l[1],c!=c?w[C]=t:"string"==typeof c?~(p="@"===c?t.lastIndexOf(c):t.indexOf(c))&&("number"==typeof l[2]?(w[C]=t.slice(0,p),t=t.slice(p+l[2])):(w[C]=t.slice(p),t=t.slice(0,p))):(p=c.exec(t))&&(w[C]=p[1],t=t.slice(0,p.index)),w[C]=w[C]||a&&l[3]&&e[C]||"",l[4]&&(w[C]=w[C].toLowerCase())):t=l(t,w);n&&(w.query=n(w.query)),a&&e.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==e.pathname)&&(w.pathname=function(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),o=n.length,r=n[o-1],a=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(a=!0),n.splice(o,1),s--);return a&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,e.pathname)),"/"!==w.pathname.charAt(0)&&f(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(p=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,p),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(p+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&f(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}A.prototype={set:function(t,e,n){var a=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||r.parse)(e)),a[t]=e;break;case"port":a[t]=e,o(e,a.protocol)?e&&(a.host=a.hostname+":"+e):(a.host=a.hostname,a[t]="");break;case"hostname":a[t]=e,a.port&&(e+=":"+a.port),a.host=e;break;case"host":a[t]=e,c.test(e)?(e=e.split(":"),a.port=e.pop(),a.hostname=e.join(":")):(a.hostname=e,a.port="");break;case"protocol":a.protocol=e.toLowerCase(),a.slashes=!n;break;case"pathname":case"hash":if(e){var s="pathname"===t?"/":"#";a[t]=e.charAt(0)!==s?s+e:e}else a[t]=e;break;case"username":case"password":a[t]=encodeURIComponent(e);break;case"auth":var i=e.indexOf(":");~i?(a.username=e.slice(0,i),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=e.slice(i+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(e))}for(var l=0;l<m.length;l++){var d=m[l];d[4]&&(a[d[1]]=a[d[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin="file:"!==a.protocol&&f(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a},toString:function(t){t&&"function"==typeof t||(t=r.stringify);var e,n=this,o=n.host,a=n.protocol;a&&":"!==a.charAt(a.length-1)&&(a+=":");var s=a+(n.protocol&&n.slashes||f(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&f(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(e="object"==typeof n.query?t(n.query):n.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(s+=n.hash),s}},A.extractProtocol=g,A.location=h,A.trimLeft=u,A.qs=r,t.exports=A},63779(){},64688(){},66089(){},67691(t,e){"use strict";e.d=function(t){if(!t)return 0;for(var e=(t=t.toString()).length,n=t.length;n--;){var o=t.charCodeAt(n);56320<=o&&o<=57343&&n--,127<o&&o<=2047?e++:2047<o&&o<=65535&&(e+=2)}return e}},73776(){},76894(e,n,o){"use strict";const r=(0,o(35947).YK)().setApp("comments").detectUser().build();var a=o(21777),s=o(53334),i=o(10810),c=o(85471),l=o(85168),d=o(57579),u=o(74095),m=o(42507),p=o(57578);const h={name:"MessageReplyTextOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var f=o(14486);const g=(0,f.A)(h,function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon message-reply-text-outline-icon",attrs:{"aria-hidden":t.title?null:"true","aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M9 11H18V13H9V11M18 7H6V9H18V7M22 4V22L18 18H4C2.9 18 2 17.11 2 16V4C2 2.9 2.9 2 4 2H20C21.1 2 22 2.89 22 4M20 4H4V16H18.83L20 17.17V4Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])},[],!1,null,null,null).exports;var A=o(83239),C=o(57505),y=o(24764),v=o(15502),w=o(41944),b=o(4604),_=o(88289),x=o(77764),T=o(33691),O=o(66001),I=o(16502),k=o(37793),R=o(61160),D=o(42294),S=o(406),$=o(36236);function N(t){let e=new R(t).pathname;return e.length<=0&&(e="/"),(0,$.qb)(e)}function U(...t){return(0,S.A)(t.reduce((t,e,n)=>((0===n||"/"!==e||"/"===e&&"/"!==t[t.length-1])&&t.push(e),t),[]))}var E=o(83503),L=o(35658);function P(t,e){const n=t.url.replace("//",""),o=-1==n.indexOf("/")?"/":n.slice(n.indexOf("/")),r=t.method?t.method.toUpperCase():"GET",a=!!/(^|,)\s*auth\s*($|,)/.test(e.qop)&&"auth",s=`00000000${e.nc}`.slice(-8),i=(0,L.M)(e.algorithm,e.username,e.realm,e.password,e.nonce,e.cnonce,e.ha1),c=E(`${r}:${o}`),l=E(a?`${i}:${e.nonce}:${s}:${e.cnonce}:${a}:${c}`:`${i}:${e.nonce}:${c}`),d={username:e.username,realm:e.realm,nonce:e.nonce,uri:o,qop:a,response:l,nc:s,cnonce:e.cnonce,algorithm:e.algorithm,opaque:e.opaque},u=[];for(const t in d)d[t]&&("qop"===t||"nc"===t||"algorithm"===t?u.push(`${t}=${d[t]}`):u.push(`${t}="${d[t]}"`));return`Digest ${u.join(", ")}`}function H(t){return"digest"===(t.headers&&t.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()}var q=o(85914);function B(t){return q.decode(t)}function M(t,e){var n;return`Basic ${n=`${t}:${e}`,q.encode(n)}`}o(29602);var j=o(89793),F=o(38374);function G(t,e,n,o,r){switch(t.authType){case F.hT.Auto:e&&n&&(t.headers.Authorization=M(e,n));break;case F.hT.Digest:t.digest=function(t,e,n){return{username:t,password:e,ha1:n,nc:0,algorithm:"md5",hasDigestAuth:!1}}(e,n,r);break;case F.hT.None:break;case F.hT.Password:t.headers.Authorization=M(e,n);break;case F.hT.Token:t.headers.Authorization=(0,j.O)(o);break;default:throw new D.GU({info:{code:F.O4.InvalidAuthType}},`Invalid auth type: ${t.authType}`)}}var V=o(11568),z=o(11083),W=o(97192),K=o(84819),Y=o(22921),Z=o(79275),Q=o(79605),X=o(88310);const J="function"==typeof ArrayBuffer,{toString:tt}=Object.prototype;function et(t){return J&&(t instanceof ArrayBuffer||"[object ArrayBuffer]"===tt.call(t))}var nt=o(53850);function ot(t,e,n){const o=(0,Z.q)(t);return o.headers=(0,Q.l)(e.headers,o.headers||{},n.headers||{}),void 0!==n.data&&(o.data=n.data),n.signal&&(o.signal=n.signal),e.httpAgent&&(o.httpAgent=e.httpAgent),e.httpsAgent&&(o.httpsAgent=e.httpsAgent),e.digest&&(o._digest=e.digest),"boolean"==typeof e.withCredentials&&(o.withCredentials=e.withCredentials),o}async function rt(t,e){return e.authType===F.hT.Auto?async function(t,e){const n=await st(t);return n.ok?(e.authType=F.hT.Password,n):401==n.status&&H(n)?(e.authType=F.hT.Digest,G(e,e.username,e.password,void 0,void 0),t._digest=e.digest,at(t)):n}(t,e):t._digest?at(t):st(t)}async function at(t){const e=t._digest;delete t._digest,e.hasDigestAuth&&(t=(0,Z.h)(t,{headers:{Authorization:P(t,e)}}));const n=await st(t);if(401==n.status){if(e.hasDigestAuth=function(t,e){if(!H(t))return!1;const n=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const o=t.headers&&t.headers.get("www-authenticate")||"",r=n.exec(o);if(!r)break;e[r[1]]=r[2]||r[3]}return e.nc+=1,e.cnonce=function(){let t="";for(let e=0;e<32;++e)t=`${t}${"abcdef0123456789"[Math.floor(16*Math.random())]}`;return t}(),!0}(n,e),e.hasDigestAuth){t=(0,Z.h)(t,{headers:{Authorization:P(t,e)}});const n=await st(t);return 401==n.status?e.hasDigestAuth=!1:e.nc++,n}}else e.nc++;return n}function st(t){const e=(0,K.G)();return e.patchInline("request",t=>e.patchInline("fetch",W.hd,t.url,function(t){let e={};const n={method:t.method};if(t.headers&&(e=(0,Q.l)(e,t.headers)),void 0!==t.data){const[o,r]=function(t){if(!(0,Y.HZ)()&&!(0,Y.lV)()&&t instanceof X.Readable)return[t,{}];if("string"==typeof t)return[t,{}];if((0,nt.P)(t))return[t,{}];if(et(t))return[t,{}];if(t&&"object"==typeof t)return[JSON.stringify(t),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof t)}(t.data);n.body=o,e=(0,Q.l)(e,r)}return t.signal&&(n.signal=t.signal),t.withCredentials&&(n.credentials="include"),(0,Y.HZ)()||(0,Y.lV)()||(t.httpAgent||t.httpsAgent)&&(n.agent=e=>"http:"===e.protocol?t.httpAgent||new V.Agent:t.httpsAgent||new z.Agent),n.headers=e,n}(t)),t)}var it=o(29999),ct=o(90176);async function lt(t,e,n={}){const{details:o=!1}=n,r=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},t,n),a=await rt(r,t);(0,it.HT)(t,a);const s=await a.text(),i=await(0,ct.h4)(s),c=(0,ct.ky)(i,e,o);return(0,it.hq)(a,c,o)}async function dt(t,e,n={}){if(!0===n.recursive)return async function(t,e,n={}){const o=(0,$.xi)((0,$.qb)(e));o.sort((t,e)=>t.length>e.length?1:e.length>t.length?-1:0);let r=!1;for(const a of o)if(r)await dt(t,a,{...n,recursive:!1});else try{if("directory"!==(await lt(t,a)).type)throw new Error(`Path includes a file: ${e}`)}catch(e){if(404!==e.status)throw e;r=!0,await dt(t,a,{...n,recursive:!1})}}(t,e,n);const o=ot({url:U(t.remoteURL,(a=(0,$.O0)(e),a.endsWith("/")?a:a+"/")),method:"MKCOL"},t,n),r=await rt(o,t);var a;(0,it.HT)(t,r)}const ut=()=>{};var mt=o(12692);var pt=o(62045).hp;const ht=t=>t;var ft=o(26602),gt=o(14113);function At(t){return new gt.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Ct({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:t}}},"d"))}function Ct(t,e){const n={...t};for(const t in n)n.hasOwnProperty(t)&&(n[t]&&"object"==typeof n[t]&&-1===t.indexOf(":")?(n[`${e}:${t}`]=Ct(n[t],e),delete n[t]):!1===/^@_/.test(t)&&(n[`${e}:${t}`]=n[t],delete n[t]));return n}const yt="Infinite, Second-4100000000";var vt=o(67691);async function wt(t,e,n={}){const o=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"OPTIONS"},t,n),r=await rt(o,t);try{(0,it.HT)(t,r)}catch(t){throw t}return{compliance:(r.headers.get("DAV")??"").split(",").map(t=>t.trim()),server:r.headers.get("Server")??""}}const bt="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";var _t=o(63814);function xt(){return(0,_t.dC)("dav/comments")}const Tt=function(t,e={}){const{authType:n=null,remoteBasePath:o,contactHref:r=bt,ha1:a,headers:s={},httpAgent:i,httpsAgent:c,password:l,token:d,username:u,withCredentials:m}=e;let p=n;p||(p=u||l?F.hT.Password:F.hT.None);const h={authType:p,remoteBasePath:o,contactHref:r,ha1:a,headers:Object.assign({},s),httpAgent:i,httpsAgent:c,password:l,remotePath:N(t),remoteURL:t,token:d,username:u,withCredentials:m};return G(h,u,l,d,a),{copyFile:(t,e,n)=>async function(t,e,n,o={}){const r=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"COPY",headers:{Destination:U(t.remoteURL,(0,$.O0)(n)),Overwrite:!1===o.overwrite?"F":"T",Depth:o.shallow?"0":"infinity"}},t,o),a=await rt(r,t);(0,it.HT)(t,a)}(h,t,e,n),createDirectory:(t,e)=>dt(h,t,e),createReadStream:(t,e)=>function(t,e,n={}){const o=new(0,X.PassThrough);return async function(t,e,n={}){const o={};if("object"==typeof n.range&&"number"==typeof n.range.start){let t=`bytes=${n.range.start}-`;"number"==typeof n.range.end&&(t=`${t}${n.range.end}`),o.Range=t}const r=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"GET",headers:o},t,n),a=await rt(r,t);if((0,it.HT)(t,a),o.Range&&206!==a.status){const t=new Error(`Invalid response code for partial request: ${a.status}`);throw t.status=a.status,t}return n.callback&&setTimeout(()=>{n.callback(a)},0),a.body}(t,e,n).then(t=>{t.pipe(o)}).catch(t=>{o.emit("error",t)}),o}(h,t,e),createWriteStream:(t,e,n)=>function(t,e,n={},o=ut){const r=new(0,X.PassThrough),a={};return!1===n.overwrite&&(a["If-None-Match"]="*"),rt(ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"PUT",headers:a,data:r,maxRedirects:0},t,n),t).then(e=>(0,it.HT)(t,e)).then(t=>{setTimeout(()=>{o(t)},0)}).catch(t=>{r.emit("error",t)}),r}(h,t,e,n),customRequest:(t,e)=>async function(t,e,n){n.url||(n.url=U(t.remoteURL,(0,$.O0)(e)));const o=ot(n,t,{}),r=await rt(o,t);return(0,it.HT)(t,r),r}(h,t,e),deleteFile:(t,e)=>async function(t,e,n={}){const o=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"DELETE"},t,n),r=await rt(o,t);(0,it.HT)(t,r)}(h,t,e),exists:(t,e)=>async function(t,e,n={}){try{return await lt(t,e,n),!0}catch(t){if(404===t.status)return!1;throw t}}(h,t,e),getDirectoryContents:(t,e)=>async function(t,e,n={}){const o=ot({url:U(t.remoteURL,(0,$.O0)(e),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},t,n),r=await rt(o,t);(0,it.HT)(t,r);const a=await r.text();if(!a)throw new Error("Failed parsing directory contents: Empty response");const s=await(0,ct.h4)(a),i=(0,$.dU)(e);let c=function(t,e,n,o=!1,r=!1){const a=mt.join(e,"/"),{multistatus:{response:s}}=t,i=s.map(t=>{const e=function(t){try{return t.replace(/^https?:\/\/[^\/]+/,"")}catch(t){throw new D.GU(t,"Failed normalising HREF")}}(t.href),{propstat:{prop:n}}=t,r="/"===a?decodeURIComponent((0,$.qb)(e)):(0,$.qb)(mt.relative(decodeURIComponent(a),decodeURIComponent(e)));return(0,ct.ch)(n,r,o)});return r?i:i.filter(t=>t.basename&&("file"===t.type||t.filename!==n.replace(/\/$/,"")))}(s,(0,$.dU)(t.remoteBasePath||t.remotePath),i,n.details,n.includeSelf);return n.glob&&(c=(0,it.eh)(c,n.glob)),(0,it.hq)(r,c,n.details)}(h,t,e),getFileContents:(t,e)=>async function(t,e,n={}){const{format:o="binary"}=n;if("binary"!==o&&"text"!==o)throw new D.GU({info:{code:F.O4.InvalidOutputFormat}},`Invalid output format: ${o}`);return"text"===o?async function(t,e,n={}){const o=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[ht]},t,n),r=await rt(o,t);(0,it.HT)(t,r);const a=await r.text();return(0,it.hq)(r,a,n.details)}(t,e,n):async function(t,e,n={}){const o=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"GET"},t,n),r=await rt(o,t);let a;return(0,it.HT)(t,r),a=(0,Y.HZ)()||(0,Y.lV)()?await r.arrayBuffer():pt.from(await r.arrayBuffer()),(0,it.hq)(r,a,n.details)}(t,e,n)}(h,t,e),getFileDownloadLink:t=>function(t,e){let n=U(t.remoteURL,(0,$.O0)(e));const o=/^https:/i.test(n)?"https":"http";switch(t.authType){case F.hT.None:break;case F.hT.Password:{const e=B(t.headers.Authorization.replace(/^Basic /i,"").trim());n=n.replace(/^https?:\/\//,`${o}://${e}@`);break}default:throw new D.GU({info:{code:F.O4.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${t.authType}`)}return n}(h,t),getFileUploadLink:t=>function(t,e){let n=`${U(t.remoteURL,(0,$.O0)(e))}?Content-Type=application/octet-stream`;const o=/^https:/i.test(n)?"https":"http";switch(t.authType){case F.hT.None:break;case F.hT.Password:{const e=B(t.headers.Authorization.replace(/^Basic /i,"").trim());n=n.replace(/^https?:\/\//,`${o}://${e}@`);break}default:throw new D.GU({info:{code:F.O4.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${t.authType}`)}return n}(h,t),getHeaders:()=>Object.assign({},h.headers),getQuota:t=>async function(t,e={}){const n=e.path||"/",o=ot({url:U(t.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},t,e),r=await rt(o,t);(0,it.HT)(t,r);const a=await r.text(),s=function(t){try{const[e]=t.multistatus.response,{propstat:{prop:{"quota-used-bytes":n,"quota-available-bytes":o}}}=e;return void 0!==n&&void 0!==o?{used:parseInt(String(n),10),available:(0,ct.i5)(o)}:null}catch(t){}return null}(await(0,ct.h4)(a));return(0,it.hq)(r,s,e.details)}(h,t),lock:(t,e)=>async function(t,e,n={}){const{refreshToken:o,timeout:r=yt}=n,a={Accept:"text/plain,application/xml",Timeout:r};o&&(a.If=o);const s=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"LOCK",headers:a,data:At(t.contactHref)},t,n),i=await rt(s,t);(0,it.HT)(t,i);const c=(u=await i.text(),new gt.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(u)),l=ft.get(c,"prop.lockdiscovery.activelock.locktoken.href"),d=ft.get(c,"prop.lockdiscovery.activelock.timeout");var u;if(!l)throw(0,it.YQ)(i,"No lock token received: ");return{token:l,serverTimeout:d}}(h,t,e),moveFile:(t,e,n)=>async function(t,e,n,o={}){const r=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"MOVE",headers:{Destination:U(t.remoteURL,(0,$.O0)(n)),Overwrite:!1===o.overwrite?"F":"T"}},t,o),a=await rt(r,t);(0,it.HT)(t,a)}(h,t,e,n),putFileContents:(t,e,n)=>async function(t,e,n,o={}){const{contentLength:r=!0,overwrite:a=!0}=o,s={"Content-Type":"application/octet-stream"};!(0,Y.HZ)()&&!(0,Y.lV)()&&void 0!==X&&void 0!==X?.Readable&&n instanceof X.Readable||!1===r||(s["Content-Length"]="number"==typeof r?`${r}`:`${function(t){if(et(t))return t.byteLength;if((0,nt.P)(t))return t.length;if("string"==typeof t)return(0,vt.d)(t);throw new D.GU({info:{code:F.O4.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),a||(s["If-None-Match"]="*");const i=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"PUT",headers:s,data:n},t,o),c=await rt(i,t);try{(0,it.HT)(t,c)}catch(t){const e=t;if(412!==e.status||a)throw e;return!1}return!0}(h,t,e,n),partialUpdateFileContents:(t,e,n,o,r)=>async function(t,e,n,o,r,a={}){const s=await wt(t,e,a);if(s.compliance.includes("sabredav-partialupdate"))return await async function(t,e,n,o,r,a={}){if(n>o||n<0)throw new D.GU({info:{code:F.O4.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(o-n+1),"X-Update-Range":`bytes=${n}-${o}`},i=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"PATCH",headers:s,data:r},t,a),c=await rt(i,t);(0,it.HT)(t,c)}(t,e,n,o,r,a);if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return await async function(t,e,n,o,r,a={}){if(n>o||n<0)throw new D.GU({info:{code:F.O4.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(o-n+1),"Content-Range":`bytes ${n}-${o}/*`},i=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"PUT",headers:s,data:r},t,a),c=await rt(i,t);(0,it.HT)(t,c)}(t,e,n,o,r,a);throw new D.GU({info:{code:F.O4.NotSupported}},"Not supported")}(h,t,e,n,o,r),getDAVCompliance:t=>wt(h,t),search:(t,e)=>async function(t,e,n={}){const{details:o=!1}=n,r=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":t.headers["Content-Type"]||"application/xml; charset=utf-8"}},t,n),a=await rt(r,t);(0,it.HT)(t,a);const s=await a.text(),i=await(0,ct.h4)(s),c=(0,ct.KA)(i,e,o);return(0,it.hq)(a,c,o)}(h,t,e),setHeaders:t=>{h.headers=Object.assign({},t)},stat:(t,e)=>lt(h,t,e),unlock:(t,e,n)=>async function(t,e,n,o={}){const r=ot({url:U(t.remoteURL,(0,$.O0)(e)),method:"UNLOCK",headers:{"Lock-Token":n}},t,o),a=await rt(r,t);if((0,it.HT)(t,a),204!==a.status&&200!==a.status)throw(0,it.YQ)(a)}(h,t,e,n)}}(xt());function Ot(t){Tt.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}(0,a.zo)(Ot),Ot((0,a.do)());const It=Tt;var kt=o(19051);function Rt(t,e=1){const n=new DOMParser;let o=t;for(let t=0;t<e;t++)o=n.parseFromString(o,"text/html").documentElement.textContent;return o}const Dt=(0,i.nY)("deletedCommentLimbo",{state:()=>({idsInLimbo:[]}),actions:{addId(t){this.idsInLimbo.push(t)},removeId(t){const e=this.idsInLimbo.indexOf(t);e>-1&&this.idsInLimbo.splice(e,1)},checkForId(t){return this.idsInLimbo.includes(t)}}}),St={props:{id:{type:Number,default:null},message:{type:String,default:""},resourceId:{type:[String,Number],required:!0},resourceType:{type:String,default:"files"}},data:()=>({deleted:!1,editing:!1,loading:!1}),computed:{...(0,i.n2)(Dt)},methods:{onEdit(){this.editing=!0},onEditCancel(){this.editing=!1,this.updateLocalMessage(this.message)},async onEditComment(e){this.loading=!0;try{await async function(t,e,n,o){const r=["",t,e,n].join("/");return await It.customRequest(r,{method:"PROPPATCH",data:`<?xml version="1.0"?>\n\t\t\t<d:propertyupdate\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t<d:set>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:message>${o}</oc:message>\n\t\t\t\t</d:prop>\n\t\t\t</d:set>\n\t\t\t</d:propertyupdate>`})}(this.resourceType,this.resourceId,this.id,e),r.debug("Comment edited",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id,message:e}),this.$emit("update:message",e),this.editing=!1}catch(e){(0,l.Qg)(t("comments","An error occurred while trying to edit the comment")),r.error("An error occurred while trying to edit the comment",{error:e})}finally{this.loading=!1}},onDeleteWithUndo(){this.$emit("delete"),this.deleted=!0,this.deletedCommentLimboStore.addId(this.id);const e=setTimeout(this.onDelete,l.Br);(0,l._h)(t("comments","Comment deleted"),()=>{clearTimeout(e),this.deleted=!1,this.deletedCommentLimboStore.removeId(this.id)})},async onDelete(){try{await async function(t,e,n){const o=["",t,e,n].join("/");await It.deleteFile(o)}(this.resourceType,this.resourceId,this.id),r.debug("Comment deleted",{resourceType:this.resourceType,resourceId:this.resourceId,id:this.id}),this.$emit("delete",this.id)}catch(e){(0,l.Qg)(t("comments","An error occurred while trying to delete the comment")),r.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 t=await async function(t,e,n){const o=["",t,e].join("/"),r=await kt.Ay.post(xt()+o,{actorDisplayName:(0,a.HW)().displayName,actorId:(0,a.HW)().uid,actorType:"users",creationDateTime:(new Date).toUTCString(),message:n,objectType:t,verb:"comment"}),s=o+"/"+parseInt(r.headers["content-location"].split("/").pop()),i=await It.stat(s,{details:!0}),c=i.data.props;return c.actorDisplayName=Rt(c.actorDisplayName,2),c.message=Rt(c.message,2),i.data}(this.resourceType,this.resourceId,e);r.debug("New comment posted",{resourceType:this.resourceType,resourceId:this.resourceId,newComment:t}),this.$emit("new",t),this.$emit("update:message",""),this.localMessage=""}catch(e){(0,l.Qg)(t("comments","An error occurred while trying to create the comment")),r.error("An error occurred while trying to create the comment",{error:e})}finally{this.loading=!1}}}},$t={name:"Comment",components:{IconArrowRight:T.A,IconClose:O.A,IconTrashCanOutline:k.A,IconPencilOutline:I.A,NcActionButton:C.A,NcActions:y.A,NcActionSeparator:v.A,NcAvatar:w.A,NcButton:u.A,NcDateTime:b.A,NcLoadingIcon:_.A,NcRichContenteditable:()=>Promise.all([o.e(4208),o.e(5528)]).then(o.bind(o,95528)),NcRichText:()=>Promise.all([o.e(4208),o.e(4508)]).then(o.bind(o,64508))},mixins:[St],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:()=>({expanded:!1,localMessage:"",submitted:!1}),computed:{...(0,i.n2)(Dt),isOwnComment(){return(0,a.HW)().uid===this.actorId},richContent(){const t={};let e=this.localMessage;return Object.keys(this.userData).forEach((n,o)=>{const r=`mention-${o}`,a=new RegExp(`@${n}|@"${n}"`,"g");e=e.replace(a,`{${r}}`),t[r]={component:x.A,props:{user:n,displayName:this.userData[n].label,primary:this.userData[n].primary}}}),{mentions:t,message:e}},isEmptyMessage(){return!this.localMessage||""===this.localMessage.trim()},timestamp(){return Date.parse(this.creationDateTime)},isLimbo(){return this.deletedCommentLimboStore.checkForId(this.id)}},watch:{message(t){this.updateLocalMessage(t)}},beforeMount(){this.updateLocalMessage(this.message)},methods:{t:s.Tl,updateLocalMessage(t){this.localMessage=t.toString(),this.submitted=!1},onSubmit(){if(""!==this.localMessage.trim())return this.editor?(this.onNewComment(this.localMessage.trim()),void this.$nextTick(()=>{this.$refs.editor.$el.focus()})):void this.onEditComment(this.localMessage.trim())},onExpand(){this.expanded=!0}}};var Nt=o(85072),Ut=o.n(Nt),Et=o(97825),Lt=o.n(Et),Pt=o(77659),Ht=o.n(Pt),qt=o(55056),Bt=o.n(qt),Mt=o(10540),jt=o.n(Mt),Ft=o(41113),Gt=o.n(Ft),Vt=o(22408),zt={};zt.styleTagTransform=Gt(),zt.setAttributes=Bt(),zt.insert=Ht().bind(null,"head"),zt.domAPI=Lt(),zt.insertStyleElement=jt(),Ut()(Vt.A,zt),Vt.A&&Vt.A.locals&&Vt.A.locals;var Wt=(0,f.A)($t,function(){var t=this,e=t._self._c;return e(t.tag,{directives:[{name:"show",rawName:"v-show",value:!t.deleted&&!t.isLimbo,expression:"!deleted && !isLimbo"}],tag:"component",staticClass:"comment",class:{"comment--loading":t.loading}},[e("div",{staticClass:"comment__side"},[e("NcAvatar",{staticClass:"comment__avatar",attrs:{"display-name":t.actorDisplayName,user:t.actorId,size:32}})],1),t._v(" "),e("div",{staticClass:"comment__body"},[e("div",{staticClass:"comment__header"},[e("span",{staticClass:"comment__author"},[t._v(t._s(t.actorDisplayName))]),t._v(" "),t.isOwnComment&&t.id&&!t.loading?e("NcActions",{staticClass:"comment__actions"},[t.editing?e("NcActionButton",{on:{click:t.onEditCancel},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconClose",{attrs:{size:20}})]},proxy:!0}],null,!1,2888946197)},[t._v("\n\t\t\t\t\t"+t._s(t.t("comments","Cancel edit"))+"\n\t\t\t\t")]):[e("NcActionButton",{attrs:{"close-after-click":""},on:{click:t.onEdit},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconPencilOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,3345211262)},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("comments","Edit comment"))+"\n\t\t\t\t\t")]),t._v(" "),e("NcActionSeparator"),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":""},on:{click:t.onDeleteWithUndo},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconTrashCanOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,1034796883)},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("comments","Delete comment"))+"\n\t\t\t\t\t")])]],2):t._e(),t._v(" "),t.id&&t.loading?e("div",{staticClass:"comment_loading icon-loading-small"}):t.creationDateTime?e("NcDateTime",{staticClass:"comment__timestamp",attrs:{timestamp:t.timestamp,"ignore-seconds":!0}}):t._e()],1),t._v(" "),t.editor||t.editing?e("form",{staticClass:"comment__editor",on:{submit:function(t){t.preventDefault()}}},[e("div",{staticClass:"comment__editor-group"},[e("NcRichContenteditable",{ref:"editor",attrs:{"auto-complete":t.autoComplete,contenteditable:!t.loading,label:t.editor?t.t("comments","New comment"):t.t("comments","Edit comment"),placeholder:t.t("comments","Write a comment …"),"model-value":t.localMessage,"user-data":t.userData,"aria-describedby":"tab-comments__editor-description"},on:{"update:value":t.updateLocalMessage,submit:t.onSubmit}}),t._v(" "),e("div",{staticClass:"comment__submit"},[e("NcButton",{attrs:{variant:"tertiary-no-background",type:"submit","aria-label":t.t("comments","Post comment"),disabled:t.isEmptyMessage},on:{click:t.onSubmit},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("IconArrowRight",{attrs:{size:20}})]},proxy:!0}],null,!1,758946661)})],1)],1),t._v(" "),e("div",{staticClass:"comment__editor-description",attrs:{id:"tab-comments__editor-description"}},[t._v("\n\t\t\t\t"+t._s(t.t("comments","@ for mentions, : for emoji, / for smart picker"))+"\n\t\t\t")])]):e("NcRichText",{staticClass:"comment__message",class:{"comment__message--expanded":t.expanded},attrs:{text:t.richContent.message,arguments:t.richContent.mentions,"use-markdown":""},nativeOn:{click:function(e){return t.onExpand.apply(null,arguments)}}})],1)])},[],!1,null,"70317f94",null);const Kt=Wt.exports;var Yt=o(81222);const Zt=(0,c.pM)({props:{resourceId:{type:Number,required:!0},resourceType:{type:String,default:"files"}},data(){return{editorData:{actorDisplayName:(0,a.HW)().displayName,actorId:(0,a.HW)().uid,key:"editor"},userData:{},currentResourceId:this.resourceId}},methods:{async autoComplete(t,e){const{data:n}=await kt.Ay.get((0,_t.KT)("core/autocomplete/get"),{params:{search:t,itemType:this.resourceType,itemId:this.currentResourceId,sorter:"commenters|share-recipients",limit:(0,Yt.C)("comments","maxAutoCompleteResults")}});return n.ocs.data.forEach(t=>{this.userData[t.id]=t}),e(Object.values(this.userData))},genMentionsData(t){return Object.values(t).flat().forEach(t=>{this.userData[t.mentionId]={icon:"icon-user",id:t.mentionId,label:t.mentionDisplayName,source:"users",primary:(0,a.HW)()?.uid===t.mentionId}}),this.userData}}});async function Qt({resourceType:t,resourceId:e},n){const o=["",t,e].join("/"),r=n.datetime?`<oc:datetime>${n.datetime.toISOString()}</oc:datetime>`:"",a=await It.customRequest(o,{method:"REPORT",data:`<?xml version="1.0"?>\n\t\t\t<oc:filter-comments\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<oc:limit>${n.limit??20}</oc:limit>\n\t\t\t\t<oc:offset>${n.offset||0}</oc:offset>\n\t\t\t\t${r}\n\t\t\t</oc:filter-comments>`,...n}),s=await a.text(),i=function(t,e=!1){const{multistatus:{response:n}}=t;return n.map(t=>{const n=t.propstat.prop;return(0,ct.ch)(n,n.id.toString(),e)})}(await(0,ct.h4)(s),!0);return(0,it.hq)(a,i,!0)}const Xt={name:"Comments",components:{Comment:Kt,NcEmptyContent:m.A,NcButton:u.A,IconRefresh:A.A,IconMessageReplyTextOutline:g,IconAlertCircleOutline:p.A},directives:{elementVisibility:d.Zx},mixins:[Zt],data:()=>({error:"",loading:!1,done:!1,offset:0,comments:[],cancelRequest:()=>{},Comment:Kt,userData:{}}),computed:{hasComments(){return this.comments.length>0},isFirstLoading(){return this.loading&&0===this.offset}},watch:{resourceId(){this.currentResourceId=this.resourceId}},methods:{t:s.Tl,async onVisibilityChange(t){if(t)try{await function(t,e,n){const o=["",t,e].join("/"),r=n.toUTCString();return It.customRequest(o,{method:"PROPPATCH",data:`<?xml version="1.0"?>\n\t\t\t<d:propertyupdate\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t<d:set>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:readMarker>${r}</oc:readMarker>\n\t\t\t\t</d:prop>\n\t\t\t</d:set>\n\t\t\t</d:propertyupdate>`})}(this.resourceType,this.currentResourceId,new Date)}catch(t){(0,l.Qg)(t.message||(0,s.Tl)("comments","Failed to mark comments as read"))}},async update(t){this.currentResourceId=t,this.resetState(),await this.getComments()},onScrollBottomReached(){this.error||this.done||this.loading||this.getComments()},async getComments(){this.cancelRequest("cancel");try{this.loading=!0,this.error="";const{request:t,abort:e}=function(t){const e=new AbortController,n=e.signal;return{request:async function(e,o){return await t(e,{signal:n,...o})},abort:()=>e.abort()}}(Qt);this.cancelRequest=e;const{data:n}=await t({resourceType:this.resourceType,resourceId:this.currentResourceId},{offset:this.offset})||{data:[]};this.logger.debug(`Processed ${n.length} comments`,{comments:n}),n.length<20&&(this.done=!0);for(const t of n)t.props.actorId=t.props.actorId.toString();this.comments=[...this.comments,...n],this.offset+=20}catch(t){if("cancel"===t.message)return;this.error=(0,s.Tl)("comments","Unable to load the comments list"),r.error("Error loading the comments list",{error:t})}finally{this.loading=!1}},onNewComment(t){this.comments.unshift(t)},onDelete(t){const e=this.comments.findIndex(e=>e.props.id===t);e>-1?this.comments.splice(e,1):r.error("Could not find the deleted comment in the list",{id:t})},resetState(){this.error="",this.loading=!1,this.done=!1,this.offset=0,this.comments=[]}}},Jt=Xt;var te=o(94262),ee={};ee.styleTagTransform=Gt(),ee.setAttributes=Bt(),ee.insert=Ht().bind(null,"head"),ee.domAPI=Lt(),ee.insertStyleElement=jt(),Ut()(te.A,ee),te.A&&te.A.locals&&te.A.locals;const ne=(0,f.A)(Jt,function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"element-visibility",rawName:"v-element-visibility",value:t.onVisibilityChange,expression:"onVisibilityChange"}],staticClass:"comments",class:{"icon-loading":t.isFirstLoading}},[e("Comment",t._b({staticClass:"comments__writer",attrs:{"auto-complete":t.autoComplete,"resource-type":t.resourceType,editor:!0,"user-data":t.userData,"resource-id":t.currentResourceId},on:{new:t.onNewComment}},"Comment",t.editorData,!1)),t._v(" "),t.isFirstLoading?t._e():[!t.hasComments&&t.done?e("NcEmptyContent",{staticClass:"comments__empty",attrs:{name:t.t("comments","No comments yet, start the conversation!")},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconMessageReplyTextOutline")]},proxy:!0}],null,!1,326612300)}):e("ul",t._l(t.comments,function(n){return e("Comment",t._b({key:n.props.id,staticClass:"comments__list",attrs:{tag:"li","auto-complete":t.autoComplete,"resource-type":t.resourceType,message:n.props.message,"resource-id":t.currentResourceId,"user-data":t.genMentionsData(n.props.mentions)},on:{"update:message":function(e){return t.$set(n.props,"message",e)},delete:t.onDelete}},"Comment",n.props,!1))}),1),t._v(" "),t.loading&&!t.isFirstLoading?e("div",{staticClass:"comments__info icon-loading"}):t.hasComments&&t.done?e("div",{staticClass:"comments__info"},[t._v("\n\t\t\t"+t._s(t.t("comments","No more messages"))+"\n\t\t")]):t.error?[e("NcEmptyContent",{staticClass:"comments__error",attrs:{name:t.error},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconAlertCircleOutline")]},proxy:!0}],null,!1,3663249556)}),t._v(" "),e("NcButton",{staticClass:"comments__retry",on:{click:t.getComments},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconRefresh")]},proxy:!0}],null,!1,2997625269)},[t._v("\n\t\t\t\t"+t._s(t.t("comments","Retry"))+"\n\t\t\t")])]:t._e()]],2)},[],!1,null,"6c8c157a",null).exports;c.Ay.use(i.R2),o.nc=(0,a.aV)(),c.Ay.mixin({data:()=>({logger:r}),methods:{t:s.t,n:s.n}}),window.OCA&&!window.OCA.Comments&&Object.assign(window.OCA,{Comments:{}}),Object.assign(window.OCA.Comments,{View:class{constructor(t="files",e={}){const n=(0,i.Ey)();return e={...e,propsData:{...e.propsData??{},resourceType:t},pinia:n},new(c.Ay.extend(ne))(e)}}}),r.debug("OCA.Comments.View initialized")},77199(){},77965(){},78982(){},79368(){},79838(){},85914(t,e,n){var o;t=n.nmd(t),function(){var r=(t&&t.exports,"object"==typeof globalThis&&globalThis);r.global!==r&&r.window;var a=function(t){this.message=t};(a.prototype=new Error).name="InvalidCharacterError";var s=function(t){throw new a(t)},i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,l={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,a=t.length%3,c="",l=-1,d=t.length-a;++l<d;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),c+=i.charAt((r=e+n+o)>>18&63)+i.charAt(r>>12&63)+i.charAt(r>>6&63)+i.charAt(63&r);return 2==a?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),c+=i.charAt((r=e+n)>>10)+i.charAt(r>>4&63)+i.charAt(r<<2&63)+"="):1==a&&(r=t.charCodeAt(l),c+=i.charAt(r>>2)+i.charAt(r<<4&63)+"=="),c},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=i.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"1.0.0"};void 0===(o=function(){return l}.call(e,n,e,t))||(t.exports=o)}()},86833(){},94262(t,e,n){"use strict";n.d(e,{A:()=>i});var o=n(71354),r=n.n(o),a=n(76314),s=n.n(a)()(r());s.push([t.id,".comments[data-v-6c8c157a]{min-height:100%;display:flex;flex-direction:column}.comments__empty[data-v-6c8c157a],.comments__error[data-v-6c8c157a]{flex:1 0}.comments__retry[data-v-6c8c157a]{margin:0 auto}.comments__info[data-v-6c8c157a]{height:60px;color:var(--color-text-maxcontrast);text-align:center;line-height:60px}","",{version:3,sources:["webpack://./apps/comments/src/views/Comments.vue"],names:[],mappings:"AACA,2BACC,eAAA,CACA,YAAA,CACA,qBAAA,CAEA,oEAEC,QAAA,CAGD,kCACC,aAAA,CAGD,iCACC,WAAA,CACA,mCAAA,CACA,iBAAA,CACA,gBAAA",sourcesContent:["\n.comments {\n\tmin-height: 100%;\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t&__empty,\n\t&__error {\n\t\tflex: 1 0;\n\t}\n\n\t&__retry {\n\t\tmargin: 0 auto;\n\t}\n\n\t&__info {\n\t\theight: 60px;\n\t\tcolor: var(--color-text-maxcontrast);\n\t\ttext-align: center;\n\t\tline-height: 60px;\n\t}\n}\n"],sourceRoot:""}]);const i=s}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=r,e=[],s.O=(t,n,o,r)=>{if(!n){var a=1/0;for(d=0;d<e.length;d++){for(var[n,o,r]=e[d],i=!0,c=0;c<n.length;c++)(!1&r||a>=r)&&Object.keys(s.O).every(t=>s.O[t](n[c]))?n.splice(c--,1):(i=!1,r<a&&(a=r));if(i){e.splice(d--,1);var l=o();void 0!==l&&(t=l)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,o,r]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce((e,n)=>(s.f[n](t,e),e),[])),s.u=t=>t+"-"+t+".js?v="+{594:"f5af3d132040859cb666",620:"efadeb09ed40b2f78241",2391:"6d29c12fea2fbb265756",2880:"b7ea58dbe842a6c59642",4325:"b496c21b366280f18e3c",4508:"d82a3a5b45c59e826da3",5528:"a2c796c3574e3e32b0c3",5862:"580b9c2e231a9169a12f",7145:"7cf397a0552103874fc6",8339:"b2246be0f4c885a9d524"}[t],s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},o="nextcloud-ui-legacy:",s.l=(t,e,r,a)=>{if(n[t])n[t].push(e);else{var i,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==o+r){i=u;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+r),i.src=t),n[t]=[e];var m=(e,o)=>{i.onerror=i.onload=null,clearTimeout(p);var r=n[t];if(delete n[t],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach(t=>t(o)),e)return e(o)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=m.bind(null,i.onerror),i.onload=m.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=7062,(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var e=globalThis.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{s.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={7062:0};s.f.j=(e,n)=>{var o=s.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise((n,r)=>o=t[e]=[n,r]);n.push(o[2]=r);var a=s.p+s.u(e),i=new Error;s.l(a,n=>{if(s.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+a+")",i.name="ChunkLoadError",i.type=r,i.request=a,o[1](i)}},"chunk-"+e,e)}},s.O.j=e=>0===t[e];var e=(e,n)=>{var o,r,[a,i,c]=n,l=0;if(a.some(e=>0!==t[e])){for(o in i)s.o(i,o)&&(s.m[o]=i[o]);if(c)var d=c(s)}for(e&&e(n);l<a.length;l++)r=a[l],s.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return s.O(d)},n=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),s.nc=void 0;var i=s.O(void 0,[4208],()=>s(76894));i=s.O(i)})();
//# sourceMappingURL=comments-comments-app.js.map?v=2ef53acf6c6a844613dc