You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nextcloud-server/dist/comments-init.js

2 lines
14 KiB

(()=>{"use strict";var e,r={1107(e,r,t){var i,n,o,s,E=t(44013),a=t(380),c=t(53334),l=t(65606),h=(e=>(e.DEFAULT="default",e.HIDDEN="hidden",e))(h||{});function I(){if(n)return i;n=1;const e="object"==typeof l&&l.env&&l.env.NODE_DEBUG&&/\bsemver\b/i.test(l.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return i=e}function p(){if(s)return o;s=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return o={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}var d,f,u,R,N,L,O,A,m,$,v,T,w,S={exports:{}};function g(){if(O)return L;O=1;const e=I(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:t}=p(),{safeRe:i,t:n}=(d||(d=1,function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=p(),o=I(),s=(r=e.exports={}).re=[],E=r.safeRe=[],a=r.src=[],c=r.safeSrc=[],l=r.t={};let h=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",n],[d,i]],u=(e,r,t)=>{const i=(e=>{for(const[r,t]of f)e=e.split(`${r}*`).join(`${r}{0,${t}}`).split(`${r}+`).join(`${r}{1,${t}}`);return e})(r),n=h++;o(e,n,r),l[e]=n,a[n]=r,c[n]=i,s[n]=new RegExp(r,t?"g":void 0),E[n]=new RegExp(i,t?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","\\d+"),u("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),u("MAINVERSION",`(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${a[l.NONNUMERICIDENTIFIER]}|${a[l.NUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${a[l.NONNUMERICIDENTIFIER]}|${a[l.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASE",`(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER",`${d}+`),u("BUILD",`(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`),u("FULL",`^${a[l.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`),u("LOOSE",`^${a[l.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${a[l.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`),u("XRANGE",`^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`),u("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),u("COERCE",`${a[l.COERCEPLAIN]}(?:$|[^\\d])`),u("COERCEFULL",a[l.COERCEPLAIN]+`(?:${a[l.PRERELEASE]})?(?:${a[l.BUILD]})?(?:$|[^\\d])`),u("COERCERTL",a[l.COERCE],!0),u("COERCERTLFULL",a[l.COERCEFULL],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${a[l.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",u("TILDE",`^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${a[l.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",u("CARET",`^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(S,S.exports)),S.exports),o=function(){if(u)return f;u=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return f=t=>t?"object"!=typeof t?e:t:r}(),{compareIdentifiers:s}=function(){if(N)return R;N=1;const e=/^[0-9]+$/,r=(r,t)=>{if("number"==typeof r&&"number"==typeof t)return r===t?0:r<t?-1:1;const i=e.test(r),n=e.test(t);return i&&n&&(r=+r,t=+t),r===t?0:i&&!n?-1:n&&!i?1:r<t?-1:1};return R={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}}();class E{constructor(s,a){if(a=o(a),s instanceof E){if(s.loose===!!a.loose&&s.includePrerelease===!!a.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",s,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const c=s.trim().match(a.loose?i[n.LOOSE]:i[n.FULL]);if(!c)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const r=+e;if(r>=0&&r<t)return r}return e}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(e("SemVer.compare",this.version,this.options,r),!(r instanceof E)){if("string"==typeof r&&r===this.version)return 0;r=new E(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(e){return e instanceof E||(e=new E(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(r){if(r instanceof E||(r=new E(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let t=0;do{const i=this.prerelease[t],n=r.prerelease[t];if(e("prerelease compare",t,i,n),void 0===i&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===i)return-1;if(i!==n)return s(i,n)}while(++t)}compareBuild(r){r instanceof E||(r=new E(r,this.options));let t=0;do{const i=this.build[t],n=r.build[t];if(e("build compare",t,i,n),void 0===i&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===i)return-1;if(i!==n)return s(i,n)}while(++t)}inc(e,r,t){if(e.startsWith("pre")){if(!r&&!1===t)throw new Error("invalid increment argument: identifier is empty");if(r){const e=`-${r}`.match(this.options.loose?i[n.PRERELEASELOOSE]:i[n.PRERELEASE]);if(!e||e[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,t),this.inc("pre",r,t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r,t),this.inc("pre",r,t);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(t)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(r===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(r){let i=[r,e];!1===t&&(i=[r]),0===s(this.prerelease[0],r)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return L=E}!function(){if(m)return A;m=1;const e=g();A=(r,t)=>new e(r,t).major}(),function(){if(w)return T;w=1;const e=function(){if(v)return $;v=1;const e=g();return $=(r,t,i=!1)=>{if(r instanceof e)return r;try{return new e(r,t)}catch(e){if(!i)return null;throw e}}}();T=(r,t)=>{const i=e(r,t);return i?i.version:null}}(),a.m,Error;const y=(0,t(35947).YK)().setApp("comments").detectUser().build();var b;b=new class{_action;constructor(e){this.validateAction(e),this._action=e}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get hotkey(){return this._action.hotkey}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get destructive(){return this._action.destructive}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(void 0!==e.destructive&&"boolean"!=typeof e.destructive)throw new Error("Invalid destructive flag");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(h).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function");if("hotkey"in e&&void 0!==e.hotkey){if("object"!=typeof e.hotkey)throw new Error("Invalid hotkey configuration");if("string"!=typeof e.hotkey.key||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if("string"!=typeof e.hotkey.description||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}}}({id:"comments-unread",title({nodes:e}){const r=e[0]?.attributes["comments-unread"];return"number"==typeof r&&r>=0?(0,c.n)("comments","1 new comment","{unread} new comments",r,{unread:r}):(0,c.t)("comments","Comment")},displayName:()=>"",iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-comment-processing" viewBox="0 0 24 24"><path d="M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M17,11V9H15V11H17M13,11V9H11V11H13M9,11V9H7V11H9Z" /></svg>',enabled({nodes:e}){const r=e[0]?.attributes?.["comments-unread"];return"number"==typeof r&&r>0},async exec({nodes:e}){if(1!==e.length||!e[0])return!1;try{return window.OCA.Files.Sidebar.setActiveTab("comments"),await window.OCA.Files.Sidebar.open(e[0].path),null}catch(e){return y.error("Error while opening sidebar",{error:e}),!1}},inline:()=>!0,order:-140}),void 0===window._nc_fileactions&&(window._nc_fileactions=[],E.l.debug("FileActions initialized")),window._nc_fileactions.find(e=>e.id===b.id)?E.l.error(`FileAction ${b.id} already registered`,{action:b}):window._nc_fileactions.push(b)}},t={};function i(e){var n=t[e];if(void 0!==n)return n.exports;var o=t[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=r,e=[],i.O=(r,t,n,o)=>{if(!t){var s=1/0;for(l=0;l<e.length;l++){for(var[t,n,o]=e[l],E=!0,a=0;a<t.length;a++)(!1&o||s>=o)&&Object.keys(i.O).every(e=>i.O[e](t[a]))?t.splice(a--,1):(E=!1,o<s&&(s=o));if(E){e.splice(l--,1);var c=n();void 0!==c&&(r=c)}}return r}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[t,n,o]},i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.e=()=>Promise.resolve(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=3260,(()=>{var e={3260:0};i.O.j=r=>0===e[r];var r=(r,t)=>{var n,o,[s,E,a]=t,c=0;if(s.some(r=>0!==e[r])){for(n in E)i.o(E,n)&&(i.m[n]=E[n]);if(a)var l=a(i)}for(r&&r(t);c<s.length;c++)o=s[c],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return i.O(l)},t=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),i.nc=void 0;var n=i.O(void 0,[4208],()=>i(1107));n=i.O(n)})();
//# sourceMappingURL=comments-init.js.map?v=4aaa3ac10ef4587f569c