/*! For license information please see files_external-init.js.LICENSE.txt */ !function(){var t,e,r,n={5220:function(t,e,r){"use strict";var n,i=r(43554),o=r(31352),a=r(5656),s=r(79753),u=r(64024),c=r(93664),l=r(20144);!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.INDETERMINATE=2]="INDETERMINATE",t[t.INCOMPLETE_CONF=3]="INCOMPLETE_CONF",t[t.UNAUTHORIZED=4]="UNAUTHORIZED",t[t.TIMEOUT=5]="TIMEOUT",t[t.NETWORK_ERROR=6]="NETWORK_ERROR"}(n||(n={}));var f=function(t){return!(!t.status||t.status===n.SUCCESS)&&(t.userProvided||"password::global::user"===t.authMechanism)},h=function(t){if(t.type===a.Tv.File)return!1;var e=t.attributes;return!(!e.scope||!e.backend||"personal"!==e.scope&&"system"!==e.scope)};function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function p(){p=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new T(i||[]);return n(a,"_invoke",{value:N(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function g(){}function v(){}var m={};u(m,o,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(L([])));w&&w!==e&&r.call(w,o)&&(m=w);var b=v.prototype=h.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(n,o,a,s){var u=l(t[n],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==d(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function N(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=_(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function g(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}var v=new a.p$({id:"credentials-external-storage",displayName:function(){return(0,o.Iu)("files","Enter missing credentials")},iconSvgInline:function(){return''},enabled:function(t){var e;if(1!==t.length)return!1;var r=t[0];if(!h(r))return!1;var n=(null===(e=r.attributes)||void 0===e?void 0:e.config)||{};return!!f(n)},exec:function(t){return(e=p().mark((function e(){var r,i,a,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch((0,s.generateOcsUrl)("/apps/files_external/api/v1/auth"),{headers:new Headers({Accept:"application/json"}),credentials:"include"});case 2:return r=e.sent,e.next=5,null==r?void 0:r.json();case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:if(!(i=e.t0).ocs.data.user||!i.ocs.data.password){e.next=19;break}return e.next=12,c.Z.put((0,s.generateUrl)("apps/files_external/userglobalstorages/{id}",t.attributes),{backendOptions:i.ocs.data});case 12:if(a=e.sent,(f=a.data).status===n.SUCCESS){e.next=17;break}return(0,u.x2)((0,o.Iu)("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:(null==f?void 0:f.statusMessage)||""})),e.abrupt("return",null);case 17:(0,u.s$)((0,o.Iu)("files_external","New configuration successfully saved")),l.default.set(t.attributes,"config",f);case 19:return e.abrupt("return",null);case 20:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(t){g(o,n,i,a,s,"next",t)}function s(t){g(o,n,i,a,s,"throw",t)}a(void 0)}))})();var e},order:-1e3,default:a.DT.DEFAULT,inline:function(){return!0}}),m=r(93379),y=r.n(m),w=r(7795),b=r.n(w),x=r(90569),E=r.n(x),N=r(3565),_=r.n(N),A=r(19216),O=r.n(A),T=r(44589),L=r.n(T),S=r(17150),I={};I.styleTagTransform=L(),I.setAttributes=_(),I.insert=E().bind(null,"head"),I.domAPI=b(),I.insertStyleElement=O(),y()(S.Z,I),S.Z&&S.Z.locals&&S.Z.locals;var P,C=r(77958);function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function k(){k=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new A(i||[]);return n(a,"_invoke",{value:x(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function d(){}function p(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(O([])));m&&m!==e&&r.call(m,o)&&(g=m);var y=p.prototype=h.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(n,o,a,s){var u=l(t[n],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==j(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function D(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e1&&void 0!==arguments[1]&&!arguments[1]?"userstorages":"userglobalstorages";return c.Z.get((0,s.generateUrl)("apps/files_external/".concat(e,"/").concat(t,"?testOnly=false")))};function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function H(){H=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new A(i||[]);return n(a,"_invoke",{value:x(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function d(){}function p(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(O([])));m&&m!==e&&r.call(m,o)&&(g=m);var y=p.prototype=h.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(n,o,a,s){var u=l(t[n],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==B(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function q(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Y(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){q(o,n,i,a,s,"next",t)}function s(t){q(o,n,i,a,s,"throw",t)}a(void 0)}))}}var Z,z=new a.p$({id:"check-external-storage",displayName:function(){return""},iconSvgInline:function(){return""},enabled:function(t){return t.every((function(t){return!0===h(t)}))},exec:(Z=Y(H().mark((function t(){return H().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),t)}))),function(){return Z.apply(this,arguments)}),renderInline:function(t){return Y(H().mark((function e(){var r,i,a,s,c,h;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,U(t.attributes.id,"system"===t.attributes.scope);case 4:if(i=e.sent,r=i.data,l.default.set(t.attributes,"config",r),r.status===n.SUCCESS){e.next=9;break}throw new Error((null===(a=r)||void 0===a?void 0:a.statusMessage)||(0,o.Iu)("files_external","There was an error with this external storage."));case 9:return e.abrupt("return",null);case 12:if(e.prev=12,e.t0=e.catch(1),!e.t0.response||r){e.next=17;break}return(0,u.K2)((0,o.Iu)("files_external","We were unable to check the external storage {basename}",{basename:t.basename})),e.abrupt("return",null);case 17:return s=f(r),(c=document.createElement("span")).classList.add("files-list__row-status--".concat(s?"warning":"error")),(h=document.createElement("span")).className="files-list__row-status",s||(h.innerHTML='',h.title=e.t0.message),h.prepend(c),e.abrupt("return",h);case 25:case"end":return e.stop()}}),e,null,[[1,12]])})))()},order:10});function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function K(){K=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new A(i||[]);return n(a,"_invoke",{value:x(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function d(){}function p(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(O([])));m&&m!==e&&r.call(m,o)&&(g=m);var y=p.prototype=h.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(n,o,a,s){var u=l(t[n],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==X(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function W(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}var J=new a.p$({id:"open-in-files-external-storage",displayName:function(t){var e;return((null==t||null===(e=t[0])||void 0===e||null===(e=e.attributes)||void 0===e?void 0:e.config)||{status:n.INDETERMINATE}).status!==n.SUCCESS?(0,o.Iu)("files_external","Examine this faulty external storage configuration"):(0,o.Iu)("files","Open in files")},iconSvgInline:function(){return""},enabled:function(t,e){return"extstoragemounts"===e.id},exec:function(t){return(e=K().mark((function e(){var r;return K().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null==(r=t.attributes.config)?void 0:r.status)===n.SUCCESS){e.next=4;break}return window.OC.dialogs.confirm((0,o.Iu)("files_external","There was an error with this external storage. Do you want to review this mount point config in the settings page?"),(0,o.Iu)("files_external","External mount error"),(function(e){if(!0===e){var r="personal"===t.attributes.scope?"user":"admin";window.location.href=(0,s.generateUrl)("/settings/".concat(r,"/externalstorages"))}})),e.abrupt("return",null);case 4:return window.OCP.Files.Router.goToRoute(null,{view:"files"},{dir:t.path}),e.abrupt("return",null);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(t){W(o,n,i,a,s,"next",t)}function s(t){W(o,n,i,a,s,"throw",t)}a(void 0)}))})();var e},order:-1e3,default:a.DT.HIDDEN}),Q=(0,i.j)("files_external","allowUserMounting",!1);(0,a.Ti)().register(new a.G7({id:"extstoragemounts",name:(0,o.Iu)("files_external","External storage"),caption:(0,o.Iu)("files_external","List of external storage."),emptyCaption:Q?(0,o.Iu)("files_external","There is no external storage configured. You can configure them in your Personal settings."):(0,o.Iu)("files_external","There is no external storage configured and you don't have the permission to configure them."),emptyTitle:(0,o.Iu)("files_external","No external storage"),icon:'',order:30,columns:[new a.sg({id:"storage-type",title:(0,o.Iu)("files_external","Storage type"),render:function(t){var e,r=(null===(e=t.attributes)||void 0===e?void 0:e.backend)||(0,o.Iu)("files_external","Unknown"),n=document.createElement("span");return n.textContent=r,n}}),new a.sg({id:"scope",title:(0,o.Iu)("files_external","Scope"),render:function(t){var e,r=document.createElement("span"),n=(0,o.Iu)("files_external","Personal");return"system"===(null===(e=t.attributes)||void 0===e?void 0:e.scope)&&(n=(0,o.Iu)("files_external","System")),r.textContent=n,r}})],getContents:G})),(0,a.p4)(v),(0,a.p4)(z),(0,a.p4)(J)},17150:function(t,e,r){"use strict";var n=r(87537),i=r.n(n),o=r(23645),a=r.n(o)()(i());a.push([t.id,".files-list__row-status{display:flex;width:44px;justify-content:center;align-items:center;height:100%}.files-list__row-status svg{width:24px;height:24px}.files-list__row-status svg path{fill:currentColor}.files-list__row-status--error,.files-list__row-status--warning{position:absolute;display:block;top:0;left:0;right:0;bottom:0;opacity:.1;z-index:-1}.files-list__row-status--error{background:var(--color-error)}.files-list__row-status--warning{background:var(--color-warning)}","",{version:3,sources:["webpack://./apps/files_external/src/css/fileEntryStatus.scss"],names:[],mappings:"AAAA,wBACC,YAAA,CACA,UAAA,CACA,sBAAA,CACA,kBAAA,CACA,WAAA,CAEA,4BACC,UAAA,CACA,WAAA,CAEA,iCACC,iBAAA,CAIF,gEAEC,iBAAA,CACA,aAAA,CACA,KAAA,CACA,MAAA,CACA,OAAA,CACA,QAAA,CACA,UAAA,CACA,UAAA,CAGD,+BACC,6BAAA,CAGD,iCACC,+BAAA",sourcesContent:[".files-list__row-status {\n\tdisplay: flex;\n\twidth: 44px;\n\tjustify-content: center;\n\talign-items: center;\n\theight: 100%;\n\n\tsvg {\n\t\twidth: 24px;\n\t\theight: 24px;\n\n\t\tpath {\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n\n\t&--error,\n\t&--warning {\n\t\tposition: absolute;\n\t\tdisplay: block;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\topacity: .1;\n\t\tz-index: -1;\n\t}\n\n\t&--error {\n\t\tbackground: var(--color-error);\n\t}\n\n\t&--warning {\n\t\tbackground: var(--color-warning);\n\t}\n}\n"],sourceRoot:""}]),e.Z=a},24654:function(){},52361:function(){},94616:function(){},5656:function(t,e,r){"use strict";r.d(e,{DT:function(){return v},G7:function(){return ie},RL:function(){return F},Ti:function(){return $},Tv:function(){return O},_o:function(){return j},gt:function(){return C},h7:function(){return _},p$:function(){return m},p4:function(){return y},pC:function(){return V},rp:function(){return D},sS:function(){return g},sg:function(){return M},tB:function(){return A},y3:function(){return w}});var n=r(77958),i=r(17499),o=r(31352),a=r(62520),s=r(65358),u=r(79753),c=r(14596),l=r(26721);const f=null===(h=(0,n.ts)())?(0,i.IY)().setApp("files").build():(0,i.IY)().setApp("files").setUid(h.uid).build();var h;const d=["B","KB","MB","GB","TB","PB"],p=["B","KiB","MiB","GiB","TiB","PiB"];function g(t,e=!1,r=!0){"string"==typeof t&&(t=Number(t));let n=t>0?Math.floor(Math.log(t)/Math.log(r?1024:1e3)):0;n=Math.min((r?p.length:d.length)-1,n);const i=r?p[n]:d[n];let a=(t/Math.pow(r?1024:1e3,n)).toFixed(1);return!0===e&&0===n?("0.0"!==a?"< 1 ":"0 ")+(r?p[1]:d[1]):(a=n<2?parseFloat(a).toFixed(0):parseFloat(a).toLocaleString((0,o.aj)()),a+" "+i)}var v=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(v||{});class m{_action;constructor(t){this.validateAction(t),this._action=t}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 order(){return this._action.order}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if("title"in t&&"function"!=typeof t.title)throw new Error("Invalid title function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if(t.default&&!Object.values(v).includes(t.default))throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}const y=function(t){typeof window._nc_fileactions>"u"&&(window._nc_fileactions=[],f.debug("FileActions initialized")),window._nc_fileactions.find((e=>e.id===t.id))?f.error(`FileAction ${t.id} already registered`,{action:t}):window._nc_fileactions.push(t)};var w=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(w||{});const b=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","nc:share-attributes","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:share-types","oc:size","ocs:share-permissions"],x={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},E=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...b]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")},N=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...x}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")},_=function(){return`\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t`},A=function(t){return`\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${(0,n.ts)()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${t}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`};var O=(t=>(t.Folder="folder",t.File="file",t))(O||{});const T=function(t,e){return null!==t.match(e)},L=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=w.NONE&&t.permissions<=w.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&T(t.source,e)){const r=t.source.match(e)[0];if(!t.source.includes((0,a.join)(r,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(S).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var S=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(S||{});class I{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(t,e){L(t,e||this._knownDavService),this._data=t;const r={set:(t,e,r)=>(this.updateMtime(),Reflect.set(t,e,r)),deleteProperty:(t,e)=>(this.updateMtime(),Reflect.deleteProperty(t,e))};this._attributes=new Proxy(t.attributes||{},r),delete this._data.attributes,e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,s.Ec)(this.source.slice(t.length))}get basename(){return(0,a.basename)(this.source)}get extension(){return(0,a.extname)(this.source)}get dirname(){if(this.root){const t=this.source.indexOf(this.root);return(0,a.dirname)(this.source.slice(t+this.root.length)||"/")}const t=new URL(this.source);return(0,a.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:w.NONE:w.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return T(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,a.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){const t=this.source.indexOf(this.root);return this.source.slice(t+this.root.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){L({...this._data,source:t},this._knownDavService),this._data.source=t,this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,a.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class P extends I{get type(){return O.File}}class C extends I{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return O.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const j=`/files/${(0,n.ts)()?.uid}`,k=(0,u.generateRemoteUrl)("dav"),D=function(t=k){const e=(0,c.eI)(t,{headers:{requesttoken:(0,n.IH)()||""}});return(0,c.lD)().patch("request",(t=>(t.headers?.method&&(t.method=t.headers.method,delete t.headers.method),(0,l.W)(t)))),e},V=async(t,e="/",r=j)=>(await t.getDirectoryContents(`${r}${e}`,{details:!0,data:`\n\t\t\n\t\t\t\n\t\t\t\t${E()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((t=>t.filename!==e)).map((t=>F(t,r))),F=function(t,e=j,r=k){const i=t.props,o=function(t=""){let e=w.NONE;return t&&((t.includes("C")||t.includes("K"))&&(e|=w.CREATE),t.includes("G")&&(e|=w.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=w.UPDATE),t.includes("D")&&(e|=w.DELETE),t.includes("R")&&(e|=w.SHARE)),e}(i?.permissions),a=(0,n.ts)()?.uid,s={id:i?.fileid||0,source:`${r}${t.filename}`,mtime:new Date(Date.parse(t.lastmod)),mime:t.mime,size:i?.size||Number.parseInt(i.getcontentlength||"0"),permissions:o,owner:a,root:e,attributes:{...t,...i,hasPreview:i?.["has-preview"]}};return delete s.attributes?.props,"file"===t.type?new P(s):new C(s)};class R{_views=[];_currentView=null;register(t){if(this._views.find((e=>e.id===t.id)))throw new Error(`View id ${t.id} is already registered`);this._views.push(t)}remove(t){const e=this._views.findIndex((e=>e.id===t));-1!==e&&this._views.splice(e,1)}get views(){return this._views}setActive(t){this._currentView=t}get active(){return this._currentView}}const $=function(){return typeof window._nc_navigation>"u"&&(window._nc_navigation=new R,f.debug("Navigation service initialized")),window._nc_navigation};class M{_column;constructor(t){G(t),this._column=t}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const G=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var U={},B={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+r+"$");t.isExist=function(t){return typeof t<"u"},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,r){if(e){const n=Object.keys(e),i=n.length;for(let o=0;o"u")},t.getAllMatches=function(t,e){const r=[];let n=e.exec(t);for(;n;){const i=[];i.startIndex=e.lastIndex-n[0].length;const o=n.length;for(let t=0;t5&&"xml"===n)return et("InvalidXml","XML declaration allowed only at the start of the document.",it(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function z(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let r=1;for(e+=8;e"===t[e]&&(r--,0===r))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}U.validate=function(t,e){e=Object.assign({},q,e);const r=[];let n=!1,i=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)u+=t[o];if(u=u.trim(),"/"===u[u.length-1]&&(u=u.substring(0,u.length-1),o--),!nt(u)){let e;return e=0===u.trim().length?"Invalid space after '<'.":"Tag '"+u+"' is an invalid name.",et("InvalidTag",e,it(t,o))}const c=W(t,o);if(!1===c)return et("InvalidAttr","Attributes for '"+u+"' have open quote.",it(t,o));let l=c.value;if(o=c.index,"/"===l[l.length-1]){const r=o-l.length;l=l.substring(0,l.length-1);const i=Q(l,e);if(!0!==i)return et(i.err.code,i.err.msg,it(t,r+i.err.line));n=!0}else if(s){if(!c.tagClosed)return et("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",it(t,o));if(l.trim().length>0)return et("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",it(t,a));{const e=r.pop();if(u!==e.tagName){let r=it(t,e.tagStartPos);return et("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+r.line+", col "+r.col+") instead of closing tag '"+u+"'.",it(t,a))}0==r.length&&(i=!0)}}else{const s=Q(l,e);if(!0!==s)return et(s.err.code,s.err.msg,it(t,o-l.length+s.err.line));if(!0===i)return et("InvalidXml","Multiple possible root nodes found.",it(t,o));-1!==e.unpairedTags.indexOf(u)||r.push({tagName:u,tagStartPos:a}),n=!0}for(o++;o0)||et("InvalidXml","Invalid '"+JSON.stringify(r.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):et("InvalidXml","Start tag expected.",1)};const X='"',K="'";function W(t,e){let r="",n="",i=!1;for(;e"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}const J=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Q(t,e){const r=H.getAllMatches(t,J),n={};for(let t=0;t!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}};at.buildOptions=function(t){return Object.assign({},st,t)},at.defaultOptions=st;const ut=B;function ct(t,e){let r="";for(;e0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}},xt=function(t,e){const r={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let n=1,i=!1,o=!1,a="";for(;e"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,n--):n--,0===n)break}else"["===t[e]?i=!0:a+=t[e];else{if(i&&ft(t,e))e+=7,[entityName,val,e]=ct(t,e+1),-1===val.indexOf("&")&&(r[gt(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&ht(t,e))e+=8;else if(i&&dt(t,e))e+=8;else if(i&&pt(t,e))e+=9;else{if(!lt)throw new Error("Invalid DOCTYPE");o=!0}n++,a=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:e}},Et=function(t,e={}){if(e=Object.assign({},yt,e),!t||"string"!=typeof t)return t;let r=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if(e.hex&&vt.test(r))return Number.parseInt(r,16);{const n=mt.exec(r);if(n){const i=n[1],o=n[2];let a=function(t){return t&&-1!==t.indexOf(".")&&("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1))),t}(n[3]);const s=n[4]||n[6];if(!e.leadingZeros&&o.length>0&&i&&"."!==r[2])return t;if(!e.leadingZeros&&o.length>0&&!i&&"."!==r[1])return t;{const n=Number(r),u=""+n;return-1!==u.search(/[eE]/)||s?e.eNotation?n:t:-1!==r.indexOf(".")?"0"===u&&""===a||u===a||i&&u==="-"+a?n:t:o?a===u||i+a===u?n:t:r===u||r===i+u?n:t}}return t}};function Nt(t){const e=Object.keys(t);for(let r=0;r0)){a||(t=this.replaceEntitiesValue(t));const n=this.options.tagValueProcessor(e,t,r,i,o);return null==n?t:typeof n!=typeof t||n!==t?n:this.options.trimValues||t.trim()===t?Vt(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function At(t){if(this.options.removeNSPrefix){const e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,wt.nameRegexp);const Ot=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Tt(t,e,r){if(!this.options.ignoreAttributes&&"string"==typeof t){const r=wt.getAllMatches(t,Ot),n=r.length,i={};for(let t=0;t",o,"Closing Tag is not closed.");let a=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),r&&(n=this.saveTextToParentTag(n,r,i));const s=i.substring(i.lastIndexOf(".")+1);if(a&&-1!==this.options.unpairedTags.indexOf(a))throw new Error(`Unpaired tag can not be used as closing tag: `);let u=0;s&&-1!==this.options.unpairedTags.indexOf(s)?(u=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=i.lastIndexOf("."),i=i.substring(0,u),r=this.tagsNodeStack.pop(),n="",o=e}else if("?"===t[o+1]){let e=kt(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,i),!(this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags)){const t=new bt(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,i,e.tagName)),this.addChild(r,t,i)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=jt(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=t.substring(o+4,e-2);n=this.saveTextToParentTag(n,r,i),r.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=e}else if("!D"===t.substr(o+1,2)){const e=xt(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=jt(t,"]]>",o,"CDATA is not closed.")-2,a=t.substring(o+9,e);if(n=this.saveTextToParentTag(n,r,i),this.options.cdataPropName)r.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let t=this.parseTextData(a,r.tagname,i,!0,!1,!0);null==t&&(t=""),r.add(this.options.textNodeName,t)}o=e+2}else{let a=kt(t,o,this.options.removeNSPrefix),s=a.tagName;const u=a.rawTagName;let c=a.tagExp,l=a.attrExpPresent,f=a.closeIndex;this.options.transformTagName&&(s=this.options.transformTagName(s)),r&&n&&"!xml"!==r.tagname&&(n=this.saveTextToParentTag(n,r,i,!1));const h=r;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(r=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),s!==e.tagname&&(i+=i?"."+s:s),this.isItStopNode(this.options.stopNodes,i,s)){let e="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)o=a.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(s))o=a.closeIndex;else{const r=this.readStopNodeData(t,u,f+1);if(!r)throw new Error(`Unexpected end of ${u}`);o=r.i,e=r.tagContent}const n=new bt(s);s!==c&&l&&(n[":@"]=this.buildAttributesMap(c,i,s)),e&&(e=this.parseTextData(e,s,i,!0,l,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),n.add(this.options.textNodeName,e),this.addChild(r,n,i)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===s[s.length-1]?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),c=s):c=c.substr(0,c.length-1),this.options.transformTagName&&(s=this.options.transformTagName(s));const t=new bt(s);s!==c&&l&&(t[":@"]=this.buildAttributesMap(c,i,s)),this.addChild(r,t,i),i=i.substr(0,i.lastIndexOf("."))}else{const t=new bt(s);this.tagsNodeStack.push(r),s!==c&&l&&(t[":@"]=this.buildAttributesMap(c,i,s)),this.addChild(r,t,i),r=t}n="",o=f}}else n+=t[o];return e.child};function St(t,e,r){const n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n&&(e.tagname=n),t.addChild(e))}const It=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(let e in this.lastEntities){const r=this.lastEntities[e];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const r=this.htmlEntities[e];t=t.replace(r.regex,r.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Pt(t,e,r,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Ct(t,e,r){const n="*."+r;for(const r in t){const i=t[r];if(n===i||e===i)return!0}return!1}function jt(t,e,r,n){const i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}function kt(t,e,r,n=">"){const i=function(t,e,r=">"){let n,i="";for(let o=e;o",r,`${e} is not closed`);if(t.substring(r+2,o).trim()===e&&(i--,0===i))return{tagContent:t.substring(n,r),i:o};r=o}else if("?"===t[r+1])r=jt(t,"?>",r+1,"StopNode is not closed.");else if("!--"===t.substr(r+1,3))r=jt(t,"--\x3e",r+3,"StopNode is not closed.");else if("!["===t.substr(r+1,2))r=jt(t,"]]>",r,"StopNode is not closed.")-2;else{const n=kt(t,r,">");n&&((n&&n.tagName)===e&&"/"!==n.tagExp[n.tagExp.length-1]&&i++,r=n.closeIndex)}}function Vt(t,e,r){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&Et(t,r)}return wt.isExist(t)?t:""}var Ft={};function Rt(t,e,r){let n;const i={};for(let o=0;o0&&(i[e.textNodeName]=n):void 0!==n&&(i[e.textNodeName]=n),i}function $t(t){const e=Object.keys(t);for(let t=0;t"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=Nt,this.parseXml=Lt,this.parseTextData=_t,this.resolveNameSpace=At,this.buildAttributesMap=Tt,this.isItStopNode=Ct,this.replaceEntitiesValue=It,this.readStopNodeData=Dt,this.saveTextToParentTag=Pt,this.addChild=St}},{prettify:Ht}=Ft,qt=U;function Yt(t,e,r,n){let i="",o=!1;for(let a=0;a`,o=!1;continue}if(u===e.commentPropName){i+=n+`\x3c!--${s[u][0][e.textNodeName]}--\x3e`,o=!0;continue}if("?"===u[0]){const t=zt(s[":@"],e),r="?xml"===u?"":n;let a=s[u][0][e.textNodeName];a=0!==a.length?" "+a:"",i+=r+`<${u}${a}${t}?>`,o=!0;continue}let l=n;""!==l&&(l+=e.indentBy);const f=n+`<${u}${zt(s[":@"],e)}`,h=Yt(s[u],e,c,l);-1!==e.unpairedTags.indexOf(u)?e.suppressUnpairedNode?i+=f+">":i+=f+"/>":h&&0!==h.length||!e.suppressEmptyNode?h&&h.endsWith(">")?i+=f+`>${h}${n}`:(i+=f+">",h&&""!==n&&(h.includes("/>")||h.includes("`):i+=f+"/>",o=!0}return i}function Zt(t){const e=Object.keys(t);for(let r=0;r0&&e.processEntities)for(let r=0;r0&&(r="\n"),Yt(t,e,"",r)},Jt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Qt(t){this.options=Object.assign({},Jt,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=re),this.processTextOrObjNode=te,this.options.format?(this.indentate=ee,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function te(t,e,r){const n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function ee(t){return this.options.indentBy.repeat(t)}function re(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Qt.prototype.build=function(t){return this.options.preserveOrder?Wt(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Qt.prototype.j2x=function(t,e){let r="",n="";for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i))if(typeof t[i]>"u")this.isAttribute(i)&&(n+="");else if(null===t[i])this.isAttribute(i)?n+="":"?"===i[0]?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextValNode(t[i],i,"",e);else if("object"!=typeof t[i]){const o=this.isAttribute(i);if(o)r+=this.buildAttrPairStr(o,""+t[i]);else if(i===this.options.textNodeName){let e=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(e)}else n+=this.buildTextValNode(t[i],i,"",e)}else if(Array.isArray(t[i])){const r=t[i].length;let o="";for(let a=0;a"u"||(null===r?"?"===i[0]?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:"object"==typeof r?this.options.oneListGroup?o+=this.j2x(r,e+1).val:o+=this.processTextOrObjNode(r,i,e):o+=this.buildTextValNode(r,i,"",e))}this.options.oneListGroup&&(o=this.buildObjectNode(o,i,"",e)),n+=o}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const e=Object.keys(t[i]),n=e.length;for(let o=0;o"+t+i}},Qt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),""===i?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"0&&this.options.processEntities)for(let e=0;e0&&(!t.caption||"string"!=typeof t.caption))throw new Error("View caption is required for top-level views and must be a string");if(!t.getContents||"function"!=typeof t.getContents)throw new Error("View getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(0===(t=t.trim()).length||!0!==ne.XMLValidator.validate(t))return!1;let e;const r=new ne.XMLParser;try{e=r.parse(t)}catch{return!1}return!(!e||!("svg"in e))}(t.icon))throw new Error("View icon is required and must be a valid svg string");if(!("order"in t)||"number"!=typeof t.order)throw new Error("View order is required and must be a number");if(t.columns&&t.columns.forEach((t=>{if(!(t instanceof M))throw new Error("View columns must be an array of Column. Invalid column found")})),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("View emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("View parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("View sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("View expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("View defaultSortKey must be a string");return!0}}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={id:t,loaded:!1,exports:{}};return n[t].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.m=n,t=[],o.O=function(e,r,n,i){if(!r){var a=1/0;for(l=0;l=i)&&Object.keys(o.O).every((function(t){return o.O[t](r[u])}))?r.splice(u--,1):(s=!1,i0&&t[l-1][2]>i;l--)t[l]=t[l-1];t[l]=[r,n,i]},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=function(t){return Promise.all(Object.keys(o.f).reduce((function(e,r){return o.f[r](t,e),e}),[]))},o.u=function(t){return t+"-"+t+".js?v="+{2250:"34f75a254de23027f023",7608:"e10b56a26e98ac647fb2"}[t]},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e={},r="nextcloud:",o.l=function(t,n,i,a){if(e[t])e[t].push(n);else{var s,u;if(void 0!==i)for(var c=document.getElementsByTagName("script"),l=0;l-1&&!t;)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t}(),function(){o.b=document.baseURI||self.location.href;var t={8213:0};o.f.j=function(e,r){var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((function(r,i){n=t[e]=[r,i]}));r.push(n[2]=i);var a=o.p+o.u(e),s=new Error;o.l(a,(function(r){if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,n[1](s)}}),"chunk-"+e,e)}},o.O.j=function(e){return 0===t[e]};var e=function(e,r){var n,i,a=r[0],s=r[1],u=r[2],c=0;if(a.some((function(e){return 0!==t[e]}))){for(n in s)o.o(s,n)&&(o.m[n]=s[n]);if(u)var l=u(o)}for(e&&e(r);c