@opencloud-eu/web-pkg 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TextEditor-Czv8awPg.js → TextEditor-CaoYc1_7.js} +1 -1
- package/dist/assets/{worker-4Sj2EDss.js → worker-BpoAv3gP.js} +20 -20
- package/dist/assets/{worker-DNa_GQd0.js → worker-CppfaVl3.js} +29 -29
- package/dist/assets/{worker-BgOcJUCv.js → worker-Dlj5LBOt.js} +20 -20
- package/dist/{index-BJ_SQhGu.js → index-BeMHBWr5.js} +796 -794
- package/dist/web-pkg.js +2 -2
- package/dist/web-pkg.umd.cjs +4 -4
- package/package.json +3 -3
package/dist/web-pkg.umd.cjs
CHANGED
|
@@ -8,7 +8,7 @@ Component that was made reactive: `,e)),pe(e,t,n,r,o,s,i,!0)}function Ha(e){retu
|
|
|
8
8
|
*
|
|
9
9
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/(function(e){const t=ms,n=Ol,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=S,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;c.TYPED_ARRAY_SUPPORT=l(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const B=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf(B,C),B.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function u(B){if(B>o)throw new RangeError('The value "'+B+'" is invalid for option "size"');const C=new i(B);return Object.setPrototypeOf(C,c.prototype),C}function c(B,C,O){if(typeof B=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(B)}return f(B,C,O)}c.poolSize=8192;function f(B,C,O){if(typeof B=="string")return m(B,C);if(s.isView(B))return v(B);if(B==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(ct(B,s)||B&&ct(B.buffer,s)||typeof a<"u"&&(ct(B,a)||B&&ct(B.buffer,a)))return g(B,C,O);if(typeof B=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const K=B.valueOf&&B.valueOf();if(K!=null&&K!==B)return c.from(K,C,O);const ne=h(B);if(ne)return ne;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof B[Symbol.toPrimitive]=="function")return c.from(B[Symbol.toPrimitive]("string"),C,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B)}c.from=function(B,C,O){return f(B,C,O)},Object.setPrototypeOf(c.prototype,i.prototype),Object.setPrototypeOf(c,i);function d(B){if(typeof B!="number")throw new TypeError('"size" argument must be of type number');if(B<0)throw new RangeError('The value "'+B+'" is invalid for option "size"')}function y(B,C,O){return d(B),B<=0?u(B):C!==void 0?typeof O=="string"?u(B).fill(C,O):u(B).fill(C):u(B)}c.alloc=function(B,C,O){return y(B,C,O)};function w(B){return d(B),u(B<0?0:b(B)|0)}c.allocUnsafe=function(B){return w(B)},c.allocUnsafeSlow=function(B){return w(B)};function m(B,C){if((typeof C!="string"||C==="")&&(C="utf8"),!c.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const O=E(B,C)|0;let K=u(O);const ne=K.write(B,C);return ne!==O&&(K=K.slice(0,ne)),K}function T(B){const C=B.length<0?0:b(B.length)|0,O=u(C);for(let K=0;K<C;K+=1)O[K]=B[K]&255;return O}function v(B){if(ct(B,i)){const C=new i(B);return g(C.buffer,C.byteOffset,C.byteLength)}return T(B)}function g(B,C,O){if(C<0||B.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(B.byteLength<C+(O||0))throw new RangeError('"length" is outside of buffer bounds');let K;return C===void 0&&O===void 0?K=new i(B):O===void 0?K=new i(B,C):K=new i(B,C,O),Object.setPrototypeOf(K,c.prototype),K}function h(B){if(c.isBuffer(B)){const C=b(B.length)|0,O=u(C);return O.length===0||B.copy(O,0,0,C),O}if(B.length!==void 0)return typeof B.length!="number"||en(B.length)?u(0):T(B);if(B.type==="Buffer"&&Array.isArray(B.data))return T(B.data)}function b(B){if(B>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return B|0}function S(B){return+B!=B&&(B=0),c.alloc(+B)}c.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==c.prototype},c.compare=function(C,O){if(ct(C,i)&&(C=c.from(C,C.offset,C.byteLength)),ct(O,i)&&(O=c.from(O,O.offset,O.byteLength)),!c.isBuffer(C)||!c.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===O)return 0;let K=C.length,ne=O.length;for(let de=0,Te=Math.min(K,ne);de<Te;++de)if(C[de]!==O[de]){K=C[de],ne=O[de];break}return K<ne?-1:ne<K?1:0},c.isEncoding=function(C){switch(String(C).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(C,O){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return c.alloc(0);let K;if(O===void 0)for(O=0,K=0;K<C.length;++K)O+=C[K].length;const ne=c.allocUnsafe(O);let de=0;for(K=0;K<C.length;++K){let Te=C[K];if(ct(Te,i))de+Te.length>ne.length?(c.isBuffer(Te)||(Te=c.from(Te)),Te.copy(ne,de)):i.prototype.set.call(ne,Te,de);else if(c.isBuffer(Te))Te.copy(ne,de);else throw new TypeError('"list" argument must be an Array of Buffers');de+=Te.length}return ne};function E(B,C){if(c.isBuffer(B))return B.length;if(s.isView(B)||ct(B,s))return B.byteLength;if(typeof B!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);const O=B.length,K=arguments.length>2&&arguments[2]===!0;if(!K&&O===0)return 0;let ne=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return Ne(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return et(B).length;default:if(ne)return K?-1:Ne(B).length;C=(""+C).toLowerCase(),ne=!0}}c.byteLength=E;function _(B,C,O){let K=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,C>>>=0,O<=C))return"";for(B||(B="utf8");;)switch(B){case"hex":return ee(this,C,O);case"utf8":case"utf-8":return ae(this,C,O);case"ascii":return ue(this,C,O);case"latin1":case"binary":return we(this,C,O);case"base64":return J(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,C,O);default:if(K)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),K=!0}}c.prototype._isBuffer=!0;function R(B,C,O){const K=B[C];B[C]=B[O],B[O]=K}c.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<C;O+=2)R(this,O,O+1);return this},c.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<C;O+=4)R(this,O,O+3),R(this,O+1,O+2);return this},c.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<C;O+=8)R(this,O,O+7),R(this,O+1,O+6),R(this,O+2,O+5),R(this,O+3,O+4);return this},c.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?ae(this,0,C):_.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(C){if(!c.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:c.compare(this,C)===0},c.prototype.inspect=function(){let C="";const O=e.INSPECT_MAX_BYTES;return C=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(C+=" ... "),"<Buffer "+C+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(C,O,K,ne,de){if(ct(C,i)&&(C=c.from(C,C.offset,C.byteLength)),!c.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(O===void 0&&(O=0),K===void 0&&(K=C?C.length:0),ne===void 0&&(ne=0),de===void 0&&(de=this.length),O<0||K>C.length||ne<0||de>this.length)throw new RangeError("out of range index");if(ne>=de&&O>=K)return 0;if(ne>=de)return-1;if(O>=K)return 1;if(O>>>=0,K>>>=0,ne>>>=0,de>>>=0,this===C)return 0;let Te=de-ne,Ze=K-O;const ut=Math.min(Te,Ze),Pe=this.slice(ne,de),De=C.slice(O,K);for(let Ve=0;Ve<ut;++Ve)if(Pe[Ve]!==De[Ve]){Te=Pe[Ve],Ze=De[Ve];break}return Te<Ze?-1:Ze<Te?1:0};function A(B,C,O,K,ne){if(B.length===0)return-1;if(typeof O=="string"?(K=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,en(O)&&(O=ne?0:B.length-1),O<0&&(O=B.length+O),O>=B.length){if(ne)return-1;O=B.length-1}else if(O<0)if(ne)O=0;else return-1;if(typeof C=="string"&&(C=c.from(C,K)),c.isBuffer(C))return C.length===0?-1:$(B,C,O,K,ne);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?ne?i.prototype.indexOf.call(B,C,O):i.prototype.lastIndexOf.call(B,C,O):$(B,[C],O,K,ne);throw new TypeError("val must be string, number or Buffer")}function $(B,C,O,K,ne){let de=1,Te=B.length,Ze=C.length;if(K!==void 0&&(K=String(K).toLowerCase(),K==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(B.length<2||C.length<2)return-1;de=2,Te/=2,Ze/=2,O/=2}function ut(De,Ve){return de===1?De[Ve]:De.readUInt16BE(Ve*de)}let Pe;if(ne){let De=-1;for(Pe=O;Pe<Te;Pe++)if(ut(B,Pe)===ut(C,De===-1?0:Pe-De)){if(De===-1&&(De=Pe),Pe-De+1===Ze)return De*de}else De!==-1&&(Pe-=Pe-De),De=-1}else for(O+Ze>Te&&(O=Te-Ze),Pe=O;Pe>=0;Pe--){let De=!0;for(let Ve=0;Ve<Ze;Ve++)if(ut(B,Pe+Ve)!==ut(C,Ve)){De=!1;break}if(De)return Pe}return-1}c.prototype.includes=function(C,O,K){return this.indexOf(C,O,K)!==-1},c.prototype.indexOf=function(C,O,K){return A(this,C,O,K,!0)},c.prototype.lastIndexOf=function(C,O,K){return A(this,C,O,K,!1)};function L(B,C,O,K){O=Number(O)||0;const ne=B.length-O;K?(K=Number(K),K>ne&&(K=ne)):K=ne;const de=C.length;K>de/2&&(K=de/2);let Te;for(Te=0;Te<K;++Te){const Ze=parseInt(C.substr(Te*2,2),16);if(en(Ze))return Te;B[O+Te]=Ze}return Te}function k(B,C,O,K){return Pt(Ne(C,B.length-O),B,O,K)}function N(B,C,O,K){return Pt(Be(C),B,O,K)}function z(B,C,O,K){return Pt(et(C),B,O,K)}function Q(B,C,O,K){return Pt(qe(C,B.length-O),B,O,K)}c.prototype.write=function(C,O,K,ne){if(O===void 0)ne="utf8",K=this.length,O=0;else if(K===void 0&&typeof O=="string")ne=O,K=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(K)?(K=K>>>0,ne===void 0&&(ne="utf8")):(ne=K,K=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const de=this.length-O;if((K===void 0||K>de)&&(K=de),C.length>0&&(K<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let Te=!1;for(;;)switch(ne){case"hex":return L(this,C,O,K);case"utf8":case"utf-8":return k(this,C,O,K);case"ascii":case"latin1":case"binary":return N(this,C,O,K);case"base64":return z(this,C,O,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,C,O,K);default:if(Te)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),Te=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(B,C,O){return C===0&&O===B.length?t.fromByteArray(B):t.fromByteArray(B.slice(C,O))}function ae(B,C,O){O=Math.min(B.length,O);const K=[];let ne=C;for(;ne<O;){const de=B[ne];let Te=null,Ze=de>239?4:de>223?3:de>191?2:1;if(ne+Ze<=O){let ut,Pe,De,Ve;switch(Ze){case 1:de<128&&(Te=de);break;case 2:ut=B[ne+1],(ut&192)===128&&(Ve=(de&31)<<6|ut&63,Ve>127&&(Te=Ve));break;case 3:ut=B[ne+1],Pe=B[ne+2],(ut&192)===128&&(Pe&192)===128&&(Ve=(de&15)<<12|(ut&63)<<6|Pe&63,Ve>2047&&(Ve<55296||Ve>57343)&&(Te=Ve));break;case 4:ut=B[ne+1],Pe=B[ne+2],De=B[ne+3],(ut&192)===128&&(Pe&192)===128&&(De&192)===128&&(Ve=(de&15)<<18|(ut&63)<<12|(Pe&63)<<6|De&63,Ve>65535&&Ve<1114112&&(Te=Ve))}}Te===null?(Te=65533,Ze=1):Te>65535&&(Te-=65536,K.push(Te>>>10&1023|55296),Te=56320|Te&1023),K.push(Te),ne+=Ze}return se(K)}const re=4096;function se(B){const C=B.length;if(C<=re)return String.fromCharCode.apply(String,B);let O="",K=0;for(;K<C;)O+=String.fromCharCode.apply(String,B.slice(K,K+=re));return O}function ue(B,C,O){let K="";O=Math.min(B.length,O);for(let ne=C;ne<O;++ne)K+=String.fromCharCode(B[ne]&127);return K}function we(B,C,O){let K="";O=Math.min(B.length,O);for(let ne=C;ne<O;++ne)K+=String.fromCharCode(B[ne]);return K}function ee(B,C,O){const K=B.length;(!C||C<0)&&(C=0),(!O||O<0||O>K)&&(O=K);let ne="";for(let de=C;de<O;++de)ne+=Me[B[de]];return ne}function ie(B,C,O){const K=B.slice(C,O);let ne="";for(let de=0;de<K.length-1;de+=2)ne+=String.fromCharCode(K[de]+K[de+1]*256);return ne}c.prototype.slice=function(C,O){const K=this.length;C=~~C,O=O===void 0?K:~~O,C<0?(C+=K,C<0&&(C=0)):C>K&&(C=K),O<0?(O+=K,O<0&&(O=0)):O>K&&(O=K),O<C&&(O=C);const ne=this.subarray(C,O);return Object.setPrototypeOf(ne,c.prototype),ne};function ce(B,C,O){if(B%1!==0||B<0)throw new RangeError("offset is not uint");if(B+C>O)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C],de=1,Te=0;for(;++Te<O&&(de*=256);)ne+=this[C+Te]*de;return ne},c.prototype.readUintBE=c.prototype.readUIntBE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C+--O],de=1;for(;O>0&&(de*=256);)ne+=this[C+--O]*de;return ne},c.prototype.readUint8=c.prototype.readUInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]|this[C+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]<<8|this[C+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},c.prototype.readBigUInt64LE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,de=this[++C]+this[++C]*2**8+this[++C]*2**16+K*2**24;return BigInt(ne)+(BigInt(de)<<BigInt(32))}),c.prototype.readBigUInt64BE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=O*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],de=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+K;return(BigInt(ne)<<BigInt(32))+BigInt(de)}),c.prototype.readIntLE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C],de=1,Te=0;for(;++Te<O&&(de*=256);)ne+=this[C+Te]*de;return de*=128,ne>=de&&(ne-=Math.pow(2,8*O)),ne},c.prototype.readIntBE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=O,de=1,Te=this[C+--ne];for(;ne>0&&(de*=256);)Te+=this[C+--ne]*de;return de*=128,Te>=de&&(Te-=Math.pow(2,8*O)),Te},c.prototype.readInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},c.prototype.readInt16LE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const K=this[C]|this[C+1]<<8;return K&32768?K|4294901760:K},c.prototype.readInt16BE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const K=this[C+1]|this[C]<<8;return K&32768?K|4294901760:K},c.prototype.readInt32LE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},c.prototype.readInt32BE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},c.prototype.readBigInt64LE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(K<<24);return(BigInt(ne)<<BigInt(32))+BigInt(O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),c.prototype.readBigInt64BE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=(O<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(ne)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+K)}),c.prototype.readFloatLE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!0,23,4)},c.prototype.readFloatBE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!1,23,4)},c.prototype.readDoubleLE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!0,52,8)},c.prototype.readDoubleBE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!1,52,8)};function Ce(B,C,O,K,ne,de){if(!c.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>ne||C<de)throw new RangeError('"value" argument is out of bounds');if(O+K>B.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(C,O,K,ne){if(C=+C,O=O>>>0,K=K>>>0,!ne){const Ze=Math.pow(2,8*K)-1;Ce(this,C,O,K,Ze,0)}let de=1,Te=0;for(this[O]=C&255;++Te<K&&(de*=256);)this[O+Te]=C/de&255;return O+K},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(C,O,K,ne){if(C=+C,O=O>>>0,K=K>>>0,!ne){const Ze=Math.pow(2,8*K)-1;Ce(this,C,O,K,Ze,0)}let de=K-1,Te=1;for(this[O+de]=C&255;--de>=0&&(Te*=256);)this[O+de]=C/Te&255;return O+K},c.prototype.writeUint8=c.prototype.writeUInt8=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,1,255,0),this[O]=C&255,O+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,65535,0),this[O]=C&255,this[O+1]=C>>>8,O+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,65535,0),this[O]=C>>>8,this[O+1]=C&255,O+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,4294967295,0),this[O+3]=C>>>24,this[O+2]=C>>>16,this[O+1]=C>>>8,this[O]=C&255,O+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,4294967295,0),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4};function H(B,C,O,K,ne){Le(C,K,ne,B,O,7);let de=Number(C&BigInt(4294967295));B[O++]=de,de=de>>8,B[O++]=de,de=de>>8,B[O++]=de,de=de>>8,B[O++]=de;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return B[O++]=Te,Te=Te>>8,B[O++]=Te,Te=Te>>8,B[O++]=Te,Te=Te>>8,B[O++]=Te,O}function I(B,C,O,K,ne){Le(C,K,ne,B,O,7);let de=Number(C&BigInt(4294967295));B[O+7]=de,de=de>>8,B[O+6]=de,de=de>>8,B[O+5]=de,de=de>>8,B[O+4]=de;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return B[O+3]=Te,Te=Te>>8,B[O+2]=Te,Te=Te>>8,B[O+1]=Te,Te=Te>>8,B[O]=Te,O+8}c.prototype.writeBigUInt64LE=He(function(C,O=0){return H(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=He(function(C,O=0){return I(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(C,O,K,ne){if(C=+C,O=O>>>0,!ne){const ut=Math.pow(2,8*K-1);Ce(this,C,O,K,ut-1,-ut)}let de=0,Te=1,Ze=0;for(this[O]=C&255;++de<K&&(Te*=256);)C<0&&Ze===0&&this[O+de-1]!==0&&(Ze=1),this[O+de]=(C/Te>>0)-Ze&255;return O+K},c.prototype.writeIntBE=function(C,O,K,ne){if(C=+C,O=O>>>0,!ne){const ut=Math.pow(2,8*K-1);Ce(this,C,O,K,ut-1,-ut)}let de=K-1,Te=1,Ze=0;for(this[O+de]=C&255;--de>=0&&(Te*=256);)C<0&&Ze===0&&this[O+de+1]!==0&&(Ze=1),this[O+de]=(C/Te>>0)-Ze&255;return O+K},c.prototype.writeInt8=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,1,127,-128),C<0&&(C=255+C+1),this[O]=C&255,O+1},c.prototype.writeInt16LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,32767,-32768),this[O]=C&255,this[O+1]=C>>>8,O+2},c.prototype.writeInt16BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,32767,-32768),this[O]=C>>>8,this[O+1]=C&255,O+2},c.prototype.writeInt32LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,2147483647,-2147483648),this[O]=C&255,this[O+1]=C>>>8,this[O+2]=C>>>16,this[O+3]=C>>>24,O+4},c.prototype.writeInt32BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4},c.prototype.writeBigInt64LE=He(function(C,O=0){return H(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=He(function(C,O=0){return I(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(B,C,O,K,ne,de){if(O+K>B.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function G(B,C,O,K,ne){return C=+C,O=O>>>0,ne||F(B,C,O,4),n.write(B,C,O,K,23,4),O+4}c.prototype.writeFloatLE=function(C,O,K){return G(this,C,O,!0,K)},c.prototype.writeFloatBE=function(C,O,K){return G(this,C,O,!1,K)};function V(B,C,O,K,ne){return C=+C,O=O>>>0,ne||F(B,C,O,8),n.write(B,C,O,K,52,8),O+8}c.prototype.writeDoubleLE=function(C,O,K){return V(this,C,O,!0,K)},c.prototype.writeDoubleBE=function(C,O,K){return V(this,C,O,!1,K)},c.prototype.copy=function(C,O,K,ne){if(!c.isBuffer(C))throw new TypeError("argument should be a Buffer");if(K||(K=0),!ne&&ne!==0&&(ne=this.length),O>=C.length&&(O=C.length),O||(O=0),ne>0&&ne<K&&(ne=K),ne===K||C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(K<0||K>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),C.length-O<ne-K&&(ne=C.length-O+K);const de=ne-K;return this===C&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,K,ne):i.prototype.set.call(C,this.subarray(K,ne),O),de},c.prototype.fill=function(C,O,K,ne){if(typeof C=="string"){if(typeof O=="string"?(ne=O,O=0,K=this.length):typeof K=="string"&&(ne=K,K=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!c.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(C.length===1){const Te=C.charCodeAt(0);(ne==="utf8"&&Te<128||ne==="latin1")&&(C=Te)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(O<0||this.length<O||this.length<K)throw new RangeError("Out of range index");if(K<=O)return this;O=O>>>0,K=K===void 0?this.length:K>>>0,C||(C=0);let de;if(typeof C=="number")for(de=O;de<K;++de)this[de]=C;else{const Te=c.isBuffer(C)?C:c.from(C,ne),Ze=Te.length;if(Ze===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(de=0;de<K-O;++de)this[de+O]=Te[de%Ze]}return this};const M={};function q(B,C,O){M[B]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${B}]`,this.stack,delete this.name}get code(){return B}set code(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${B}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(B){return B?`${B} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(B,C){return`The "${B}" argument must be of type number. Received type ${typeof C}`},TypeError),q("ERR_OUT_OF_RANGE",function(B,C,O){let K=`The value of "${B}" is out of range.`,ne=O;return Number.isInteger(O)&&Math.abs(O)>2**32?ne=fe(String(O)):typeof O=="bigint"&&(ne=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(ne=fe(ne)),ne+="n"),K+=` It must be ${C}. Received ${ne}`,K},RangeError);function fe(B){let C="",O=B.length;const K=B[0]==="-"?1:0;for(;O>=K+4;O-=3)C=`_${B.slice(O-3,O)}${C}`;return`${B.slice(0,O)}${C}`}function Ae(B,C,O){ke(C,"offset"),(B[C]===void 0||B[C+O]===void 0)&&_e(C,B.length-(O+1))}function Le(B,C,O,K,ne,de){if(B>O||B<C){const Te=typeof C=="bigint"?"n":"";let Ze;throw C===0||C===BigInt(0)?Ze=`>= 0${Te} and < 2${Te} ** ${(de+1)*8}${Te}`:Ze=`>= -(2${Te} ** ${(de+1)*8-1}${Te}) and < 2 ** ${(de+1)*8-1}${Te}`,new M.ERR_OUT_OF_RANGE("value",Ze,B)}Ae(K,ne,de)}function ke(B,C){if(typeof B!="number")throw new M.ERR_INVALID_ARG_TYPE(C,"number",B)}function _e(B,C,O){throw Math.floor(B)!==B?(ke(B,O),new M.ERR_OUT_OF_RANGE("offset","an integer",B)):C<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,B)}const je=/[^+/0-9A-Za-z-_]/g;function Y(B){if(B=B.split("=")[0],B=B.trim().replace(je,""),B.length<2)return"";for(;B.length%4!==0;)B=B+"=";return B}function Ne(B,C){C=C||1/0;let O;const K=B.length;let ne=null;const de=[];for(let Te=0;Te<K;++Te){if(O=B.charCodeAt(Te),O>55295&&O<57344){if(!ne){if(O>56319){(C-=3)>-1&&de.push(239,191,189);continue}else if(Te+1===K){(C-=3)>-1&&de.push(239,191,189);continue}ne=O;continue}if(O<56320){(C-=3)>-1&&de.push(239,191,189),ne=O;continue}O=(ne-55296<<10|O-56320)+65536}else ne&&(C-=3)>-1&&de.push(239,191,189);if(ne=null,O<128){if((C-=1)<0)break;de.push(O)}else if(O<2048){if((C-=2)<0)break;de.push(O>>6|192,O&63|128)}else if(O<65536){if((C-=3)<0)break;de.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((C-=4)<0)break;de.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return de}function Be(B){const C=[];for(let O=0;O<B.length;++O)C.push(B.charCodeAt(O)&255);return C}function qe(B,C){let O,K,ne;const de=[];for(let Te=0;Te<B.length&&!((C-=2)<0);++Te)O=B.charCodeAt(Te),K=O>>8,ne=O%256,de.push(ne),de.push(K);return de}function et(B){return t.toByteArray(Y(B))}function Pt(B,C,O,K){let ne;for(ne=0;ne<K&&!(ne+O>=C.length||ne>=B.length);++ne)C[ne+O]=B[ne];return ne}function ct(B,C){return B instanceof C||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===C.name}function en(B){return B!==B}const Me=function(){const B="0123456789abcdef",C=new Array(256);for(let O=0;O<16;++O){const K=O*16;for(let ne=0;ne<16;++ne)C[K+ne]=B[O]+B[ne]}return C}();function He(B){return typeof BigInt>"u"?Mn:B}function Mn(){throw new Error("BigInt not supported")}})(Sh);const yr=Sh.Buffer;var xl,Th;function Ah(){return Th||(Th=1,xl=typeof ve=="object"&&ve.env&&ve.env.NODE_DEBUG&&/\bsemver\b/i.test(ve.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),xl}var kl,Rh;function _h(){if(Rh)return kl;Rh=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return kl={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},kl}var ys={exports:{}},Ih;function JT(){return Ih||(Ih=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=_h(),i=Ah();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],c=t.t={};let f=0;const d="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",o],[d,r]],w=T=>{for(const[v,g]of y)T=T.split(`${v}*`).join(`${v}{0,${g}}`).split(`${v}+`).join(`${v}{1,${g}}`);return T},m=(T,v,g)=>{const h=w(v),b=f++;i(T,b,v),c[T]=b,l[b]=v,u[b]=h,s[b]=new RegExp(v,g?"g":void 0),a[b]=new RegExp(h,g?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),m("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${d}+`),m("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),m("FULL",`^${l[c.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),m("LOOSE",`^${l[c.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),m("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",l[c.COERCE],!0),m("COERCERTLFULL",l[c.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ys,ys.exports)),ys.exports}var Nl,Ch;function ZT(){if(Ch)return Nl;Ch=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Nl=r=>r?typeof r!="object"?e:r:t,Nl}var $l,Ph;function eA(){if(Ph)return $l;Ph=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return $l={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},$l}var Dl,Fh;function Oh(){if(Fh)return Dl;Fh=1;const e=Ah(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=_h(),{safeRe:r,safeSrc:o,t:i}=JT(),s=ZT(),{compareIdentifiers:a}=eA();class l{constructor(c,f){if(f=s(f),c instanceof l){if(c.loose===!!f.loose&&c.includePrerelease===!!f.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=c.trim().match(f.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const w=+y;if(w>=0&&w<n)return w}return y}):this.prerelease=[],this.build=d[5]?d[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(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof l)){if(typeof c=="string"&&c===this.version)return 0;c=new l(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof l||(c=new l(c,this.options)),a(this.major,c.major)||a(this.minor,c.minor)||a(this.patch,c.patch)}comparePre(c){if(c instanceof l||(c=new l(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],y=c.prerelease[f];if(e("prerelease compare",f,d,y),d===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(d===void 0)return-1;if(d===y)continue;return a(d,y)}while(++f)}compareBuild(c){c instanceof l||(c=new l(c,this.options));let f=0;do{const d=this.build[f],y=c.build[f];if(e("build compare",f,d,y),d===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(d===void 0)return-1;if(d===y)continue;return a(d,y)}while(++f)}inc(c,f,d){if(c.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const y=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),w=`-${f}`.match(y);if(!w||w[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(f){let w=[f,y];d===!1&&(w=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Dl=l,Dl}var Ll,xh;function tA(){if(xh)return Ll;xh=1;const e=Oh();return Ll=(n,r)=>new e(n,r).major,Ll}var nA=tA();const kh=el(nA);var Ml,Nh;function rA(){if(Nh)return Ml;Nh=1;const e=Oh();return Ml=(n,r,o)=>new e(n,o).compare(new e(r,o)),Ml}var Bl,$h;function iA(){if($h)return Bl;$h=1;const e=rA();return Bl=(n,r,o)=>e(r,n,o),Bl}var oA=iA();const sA=el(oA);class Ii extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Se(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class aA extends Ii{constructor(){super(...arguments);Se(this,"name","ApiError")}}const jl=(e,t)=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)};class lA{constructor(t,n,r,o=le([])){Se(this,"clientService");Se(this,"userStore");Se(this,"serverUrl");Se(this,"capability");Se(this,"available");Se(this,"fileIdsSupported");this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=j(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>sA(s.version,a.version));return i.length?i[0]:null}),this.available=j(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=j(()=>{var i;return kh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new Ii("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new Ii("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new Ii("download url could not be built");const r=t.publicToken?n:await this.clientService.ocsUserContext.signUrl(n,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const a=await this.clientService.httpUnAuthenticated.get(r,{headers:{...!!t.publicLinkPassword&&{Authorization:"Basic "+yr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}},responseType:"arraybuffer"}),l=500*1024*1024,u=[];let c=0;for(;c<a.data.byteLength;)u.push(a.data.slice(c,c+l)),c+=l;const f=new Blob(u,{type:"application/octet-stream"}),d=URL.createObjectURL(f),y=this.getFileNameFromResponseHeaders(a.headers);return jl(d,y),r}catch(a){throw new te.HttpError("archive could not be fetched",a.response)}}buildDownloadUrl(t){const n=[];switch(t.publicToken&&n.push(`public-token=${t.publicToken}`),kh(p(this.capability).version)){case 2:return n.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+n.join("&");case 1:{const o=Math.random().toString(36).substring(2);return n.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+n.join("&")}default:return}}get url(){if(!this.available)throw new Ii("no archiver available");const t=p(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:te.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var r;const n=(r=t["content-disposition"])==null?void 0:r.split('"')[1];return decodeURI(n)}}const cA=new Tl({ttl:10*1e3,capacity:250}),uA=new Tl({ttl:10*1e3,capacity:250});class fA{get avatarUrl(){return uA}get filePreview(){return cA}}const Ul=new fA;class Dh{constructor(t={}){Se(this,"accessToken");Se(this,"publicLinkToken");Se(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+yr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class ql{constructor(t,n){Se(this,"instance");Se(this,"cancelToken");this.cancelToken=ko.CancelToken.source(),this.instance=ko.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return ao({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n!=null&&n.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const o=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(o,r)}async internalRequestWithData(t,n,r,o){const i=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(i,o)}}class dA extends Error{constructor(){super(...arguments);Se(this,"name","RetriableError")}}const pA=15e3;class hA{constructor(t,n){Se(this,"url");Se(this,"fetchOptions");Se(this,"abortController");Se(this,"eventListenerMap");Se(this,"readyState");Se(this,"withCredentials");Se(this,"CONNECTING");Se(this,"OPEN");Se(this,"CLOSED");Se(this,"onerror");Se(this,"onmessage");Se(this,"onopen");this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return N0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var n;const t=new Event("open");(n=this.onopen)==null||n.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const n=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(n);const r=t.event,o=this.eventListenerMap[r];o==null||o.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new dA},onerror:t=>{var r;console.error(t);const n=new CustomEvent("error",{detail:t});return(r=this.onerror)==null||r.bind(this)(n),3e4+Math.floor(Math.random()*pA)}})}fetchProvider(...t){const[n,r]=t,o={...r,...this.fetchOptions};return window.fetch(n,o)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){var r;this.eventListenerMap[t]=(r=this.eventListenerMap[t])==null?void 0:r.filter(o=>o!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let Vl=null;const gA=(e,t)=>(Vl||(Vl=new hA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),Vl),mA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Xt.v4(),"X-Requested-With":"XMLHttpRequest"}});class yA{constructor(t){Se(this,"configStore");Se(this,"language");Se(this,"authStore");Se(this,"httpAuthenticatedClient");Se(this,"httpUnAuthenticatedClient");Se(this,"graphClient");Se(this,"ocsClient");Se(this,"webDavClient");Se(this,"initiatorId",Xt.v4());Se(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new ql({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new ql({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return gA(this.configStore.serverUrl,mA({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}initGraphClient(){const t=ko.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=te.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=ko.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=te.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=te.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+yr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Xt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Lh{constructor(){Se(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:Xt.v4(),callback:n},o=[r,...this.topics.get(t)||[]];return this.topics.set(t,o),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(o=>o.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Ye=new Lh;var bA=Lp(Object.keys,Object),vA=Object.prototype,wA=vA.hasOwnProperty;function Mh(e){if(!fs(e))return bA(e);var t=[];for(var n in Object(e))wA.call(e,n)&&n!="constructor"&&t.push(n);return t}var zl=Qr(Kn,"DataView"),Wl=Qr(Kn,"Promise"),Hl=Qr(Kn,"Set"),Gl=Qr(Kn,"WeakMap"),Bh="[object Map]",SA="[object Object]",jh="[object Promise]",Uh="[object Set]",qh="[object WeakMap]",Vh="[object DataView]",EA=Kr(zl),TA=Kr(no),AA=Kr(Wl),RA=Kr(Hl),_A=Kr(Gl),Nn=Gr;(zl&&Nn(new zl(new ArrayBuffer(1)))!=Vh||no&&Nn(new no)!=Bh||Wl&&Nn(Wl.resolve())!=jh||Hl&&Nn(new Hl)!=Uh||Gl&&Nn(new Gl)!=qh)&&(Nn=function(e){var t=Gr(e),n=t==SA?e.constructor:void 0,r=n?Kr(n):"";if(r)switch(r){case EA:return Vh;case TA:return Bh;case AA:return jh;case RA:return Uh;case _A:return qh}return t});var IA="[object Map]",CA="[object Set]",PA=Object.prototype,FA=PA.hasOwnProperty;function OA(e){if(e==null)return!0;if(oo(e)&&(Fn(e)||typeof e=="string"||typeof e.splice=="function"||Si(e)||ds(e)||io(e)))return!e.length;var t=Nn(e);if(t==IA||t==CA)return!e.size;if(fs(e))return!Mh(e).length;for(var n in e)if(FA.call(e,n))return!1;return!0}class zh{isEnabled(){return!0}isActive(t){return ft(t,"files-spaces-projects")?!1:ft(t,"files-spaces-generic")||Rn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,userStore:i,authService:s,spacesStore:a,sharesStore:l,configStore:u}=t,{webdav:c,graphAuthenticated:f}=r,{replaceInvalidFileRoute:d}=zs({router:n});return un.useTask(function*(y,w,m,T=null,v=null,g={}){try{o.clearResourceList();let{resource:h,children:b}=yield*te.call(c.listFiles(m,{path:T,fileId:v},{signal:y}));h.id&&d({space:m,resource:h,path:T,fileId:v});let S;T==="/"&&(te.isShareSpaceResource(m)?(S=yield*te.call(hs({graphClient:f,spacesStore:a,space:m,signal:y})),S&&(h=te.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:S,serverUrl:u.serverUrl}))):!te.isPersonalSpaceResource(m)&&!te.isPublicSpaceResource(m)&&(h=m)),yield o.loadAncestorMetaData({folder:h,space:m,client:c,signal:y}),te.isShareSpaceResource(m)&&(b.forEach(E=>E.remoteItemId=m.id),OA(m.members)&&(S||(S=yield*te.call(hs({graphClient:f,spacesStore:a,space:m,signal:y}))),ch({sharesStore:l,spacesStore:a,userStore:i,space:m,sharedDriveItem:S}))),o.initResourceList({currentFolder:h,resources:b})}catch(h){if(o.setCurrentFolder(null),console.error(h),h.statusCode===401)return s.handleAuthError(p(n.currentRoute))}}).restartable()}}class Wh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return At(t,"files-common-favorites")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return un.useTask(function*(i,s){var l;n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:(l=o.user)==null?void 0:l.onPremisesSamAccountName,signal:i});a=a.map(te.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class Hh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(t,"files-shares-via-link")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return un.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const c=(yield*te.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(f=>f.permissions.some(({link:d})=>!!d)).map(f=>te.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Gh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(t,"files-shares-with-me")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:i,sharesStore:s}=t;return un.useTask(function*(a,l){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const c=(yield*te.call(r.graphAuthenticated.driveItems.listSharedWithMe({signal:a}))).map(f=>te.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class Kh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(t,"files-shares-with-others")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return un.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const c=(yield*te.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(f=>f.permissions.some(({link:d})=>!d)).map(f=>te.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class In{}Se(In,"Shared","S"),Se(In,"Shareable","R"),Se(In,"Mounted","M"),Se(In,"Deletable","D"),Se(In,"Renameable","N"),Se(In,"Moveable","V"),Se(In,"Updateable","NV"),Se(In,"FileUpdateable","W"),Se(In,"FolderCreateable","CK"),Se(In,"Deny","Z"),Se(In,"SecureView","X");const bs=e=>({value:e,type:null}),xA=e=>bs(e),dt=e=>bs(e),Kl=e=>bs(e),kA=e=>bs(e),NA={Permissions:dt("permissions"),IsFavorite:Kl("favorite"),FileId:dt("fileid"),FileParent:dt("file-parent"),Name:dt("name"),OwnerId:dt("owner-id"),OwnerDisplayName:dt("owner-display-name"),PrivateLink:dt("privatelink"),ContentLength:Kl("getcontentlength"),ContentSize:Kl("size"),LastModifiedDate:dt("getlastmodified"),Tags:xA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:dt("getetag"),MimeType:dt("getcontenttype"),ResourceType:kA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:dt("owner"),LockTime:dt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:dt("downloadURL"),Highlights:dt("highlights"),MetaPathForUser:dt("meta-path-for-user"),RemoteItemId:dt("remote-item-id"),ShareId:dt("shareid"),ShareRoot:dt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:dt("share-permissions"),TrashbinOriginalFilename:dt("trashbin-original-filename"),TrashbinOriginalLocation:dt("trashbin-original-location"),TrashbinDeletedDate:dt("trashbin-delete-datetime"),PublicLinkItemType:dt("public-link-item-type"),PublicLinkPermission:dt("public-link-permission"),PublicLinkExpiration:dt("public-link-expiration"),PublicLinkShareDate:dt("public-link-share-datetime"),PublicLinkShareOwner:dt("public-link-share-owner")},Ue=Object.fromEntries(Object.entries(NA).map(([e,t])=>[e,t.value])),ci=class ci{};Se(ci,"Default",[Ue.Permissions,Ue.IsFavorite,Ue.FileId,Ue.FileParent,Ue.Name,Ue.LockDiscovery,Ue.ActiveLock,Ue.OwnerId,Ue.OwnerDisplayName,Ue.RemoteItemId,Ue.ShareRoot,Ue.ShareTypes,Ue.PrivateLink,Ue.ContentLength,Ue.ContentSize,Ue.LastModifiedDate,Ue.ETag,Ue.MimeType,Ue.ResourceType,Ue.DownloadURL,Ue.Tags,Ue.Audio,Ue.Location,Ue.Image,Ue.Photo]),Se(ci,"PublicLink",ci.Default.concat([Ue.PublicLinkItemType,Ue.PublicLinkPermission,Ue.PublicLinkExpiration,Ue.PublicLinkShareDate,Ue.PublicLinkShareOwner])),Se(ci,"Trashbin",[Ue.ContentLength,Ue.ResourceType,Ue.TrashbinOriginalLocation,Ue.TrashbinOriginalFilename,Ue.TrashbinDeletedDate,Ue.Permissions,Ue.FileParent]),Se(ci,"DavNamespace",[Ue.ContentLength,Ue.LastModifiedDate,Ue.ETag,Ue.MimeType,Ue.ResourceType,Ue.LockDiscovery,Ue.ActiveLock]);let vs=ci;var Ql={},ws={exports:{}},Qh;function Xl(){if(Qh)return ws.exports;Qh=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,E,_){return Function.prototype.apply.call(S,E,_)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(b){console&&console.warn&&console.warn(b)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}ws.exports=i,ws.exports.once=v,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(b){if(typeof b!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(b){if(typeof b!="number"||b<0||o(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");s=b}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function l(b){return b._maxListeners===void 0?i.defaultMaxListeners:b._maxListeners}i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(S){for(var E=[],_=1;_<arguments.length;_++)E.push(arguments[_]);var R=S==="error",A=this._events;if(A!==void 0)R=R&&A.error===void 0;else if(!R)return!1;if(R){var $;if(E.length>0&&($=E[0]),$ instanceof Error)throw $;var L=new Error("Unhandled error."+($?" ("+$.message+")":""));throw L.context=$,L}var k=A[S];if(k===void 0)return!1;if(typeof k=="function")t(k,this,E);else for(var N=k.length,z=w(k,N),_=0;_<N;++_)t(z[_],this,E);return!0};function u(b,S,E,_){var R,A,$;if(a(E),A=b._events,A===void 0?(A=b._events=Object.create(null),b._eventsCount=0):(A.newListener!==void 0&&(b.emit("newListener",S,E.listener?E.listener:E),A=b._events),$=A[S]),$===void 0)$=A[S]=E,++b._eventsCount;else if(typeof $=="function"?$=A[S]=_?[E,$]:[$,E]:_?$.unshift(E):$.push(E),R=l(b),R>0&&$.length>R&&!$.warned){$.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+$.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=b,L.type=S,L.count=$.length,r(L)}return b}i.prototype.addListener=function(S,E){return u(this,S,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,E){return u(this,S,E,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(b,S,E){var _={fired:!1,wrapFn:void 0,target:b,type:S,listener:E},R=c.bind(_);return R.listener=E,_.wrapFn=R,R}i.prototype.once=function(S,E){return a(E),this.on(S,f(this,S,E)),this},i.prototype.prependOnceListener=function(S,E){return a(E),this.prependListener(S,f(this,S,E)),this},i.prototype.removeListener=function(S,E){var _,R,A,$,L;if(a(E),R=this._events,R===void 0)return this;if(_=R[S],_===void 0)return this;if(_===E||_.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete R[S],R.removeListener&&this.emit("removeListener",S,_.listener||E));else if(typeof _!="function"){for(A=-1,$=_.length-1;$>=0;$--)if(_[$]===E||_[$].listener===E){L=_[$].listener,A=$;break}if(A<0)return this;A===0?_.shift():m(_,A),_.length===1&&(R[S]=_[0]),R.removeListener!==void 0&&this.emit("removeListener",S,L||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var E,_,R;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[S]),this;if(arguments.length===0){var A=Object.keys(_),$;for(R=0;R<A.length;++R)$=A[R],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=_[S],typeof E=="function")this.removeListener(S,E);else if(E!==void 0)for(R=E.length-1;R>=0;R--)this.removeListener(S,E[R]);return this};function d(b,S,E){var _=b._events;if(_===void 0)return[];var R=_[S];return R===void 0?[]:typeof R=="function"?E?[R.listener||R]:[R]:E?T(R):w(R,R.length)}i.prototype.listeners=function(S){return d(this,S,!0)},i.prototype.rawListeners=function(S){return d(this,S,!1)},i.listenerCount=function(b,S){return typeof b.listenerCount=="function"?b.listenerCount(S):y.call(b,S)},i.prototype.listenerCount=y;function y(b){var S=this._events;if(S!==void 0){var E=S[b];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(b,S){for(var E=new Array(S),_=0;_<S;++_)E[_]=b[_];return E}function m(b,S){for(;S+1<b.length;S++)b[S]=b[S+1];b.pop()}function T(b){for(var S=new Array(b.length),E=0;E<S.length;++E)S[E]=b[E].listener||b[E];return S}function v(b,S){return new Promise(function(E,_){function R($){b.removeListener(S,A),_($)}function A(){typeof b.removeListener=="function"&&b.removeListener("error",R),E([].slice.call(arguments))}h(b,S,A,{once:!0}),S!=="error"&&g(b,R,{once:!0})})}function g(b,S,E){typeof b.on=="function"&&h(b,"error",S,E)}function h(b,S,E,_){if(typeof b.on=="function")_.once?b.once(S,E):b.on(S,E);else if(typeof b.addEventListener=="function")b.addEventListener(S,function R(A){_.once&&b.removeEventListener(S,R),E(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof b)}return ws.exports}var Ss={exports:{}},Xh;function Zr(){return Xh||(Xh=1,typeof Object.create=="function"?Ss.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ss.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),Ss.exports}var Yl,Yh;function Jh(){return Yh||(Yh=1,Yl=Xl().EventEmitter),Yl}var Jl={},Zh;function Es(){return Zh||(Zh=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=c,n.toByteArray=d,n.fromByteArray=m;for(var r=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;o[45]=62,o[95]=63;function u(g){var h=g.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=g.indexOf("=");b===-1&&(b=h);var S=b===h?0:4-b%4;return[b,S]}function c(g){var h=u(g),b=h[0],S=h[1];return(b+S)*3/4-S}function f(g,h,b){return(h+b)*3/4-b}function d(g){var h,b=u(g),S=b[0],E=b[1],_=new i(f(g,S,E)),R=0,A=E>0?S-4:S,$;for($=0;$<A;$+=4)h=o[g.charCodeAt($)]<<18|o[g.charCodeAt($+1)]<<12|o[g.charCodeAt($+2)]<<6|o[g.charCodeAt($+3)],_[R++]=h>>16&255,_[R++]=h>>8&255,_[R++]=h&255;return E===2&&(h=o[g.charCodeAt($)]<<2|o[g.charCodeAt($+1)]>>4,_[R++]=h&255),E===1&&(h=o[g.charCodeAt($)]<<10|o[g.charCodeAt($+1)]<<4|o[g.charCodeAt($+2)]>>2,_[R++]=h>>8&255,_[R++]=h&255),_}function y(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,h,b){for(var S,E=[],_=h;_<b;_+=3)S=(g[_]<<16&16711680)+(g[_+1]<<8&65280)+(g[_+2]&255),E.push(y(S));return E.join("")}function m(g){for(var h,b=g.length,S=b%3,E=[],_=16383,R=0,A=b-S;R<A;R+=_)E.push(w(g,R,R+_>A?A:R+_));return S===1?(h=g[b-1],E.push(r[h>>2]+r[h<<4&63]+"==")):S===2&&(h=(g[b-2]<<8)+g[b-1],E.push(r[h>>10]+r[h>>4&63]+r[h<<2&63]+"=")),E.join("")}var T={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */T.read=function(g,h,b,S,E){var _,R,A=E*8-S-1,$=(1<<A)-1,L=$>>1,k=-7,N=b?E-1:0,z=b?-1:1,Q=g[h+N];for(N+=z,_=Q&(1<<-k)-1,Q>>=-k,k+=A;k>0;_=_*256+g[h+N],N+=z,k-=8);for(R=_&(1<<-k)-1,_>>=-k,k+=S;k>0;R=R*256+g[h+N],N+=z,k-=8);if(_===0)_=1-L;else{if(_===$)return R?NaN:(Q?-1:1)*(1/0);R=R+Math.pow(2,S),_=_-L}return(Q?-1:1)*R*Math.pow(2,_-S)},T.write=function(g,h,b,S,E,_){var R,A,$,L=_*8-E-1,k=(1<<L)-1,N=k>>1,z=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,Q=S?0:_-1,J=S?1:-1,ae=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(A=isNaN(h)?1:0,R=k):(R=Math.floor(Math.log(h)/Math.LN2),h*($=Math.pow(2,-R))<1&&(R--,$*=2),R+N>=1?h+=z/$:h+=z*Math.pow(2,1-N),h*$>=2&&(R++,$/=2),R+N>=k?(A=0,R=k):R+N>=1?(A=(h*$-1)*Math.pow(2,E),R=R+N):(A=h*Math.pow(2,N-1)*Math.pow(2,E),R=0));E>=8;g[b+Q]=A&255,Q+=J,A/=256,E-=8);for(R=R<<E|A,L+=E;L>0;g[b+Q]=R&255,Q+=J,R/=256,L-=8);g[b+Q-J]|=ae*128};/*!
|
|
11
|
+
*/(function(e){const t=ms,n=Ol,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=S,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;c.TYPED_ARRAY_SUPPORT=l(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const B=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf(B,C),B.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function u(B){if(B>o)throw new RangeError('The value "'+B+'" is invalid for option "size"');const C=new i(B);return Object.setPrototypeOf(C,c.prototype),C}function c(B,C,O){if(typeof B=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(B)}return f(B,C,O)}c.poolSize=8192;function f(B,C,O){if(typeof B=="string")return m(B,C);if(s.isView(B))return v(B);if(B==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(ct(B,s)||B&&ct(B.buffer,s)||typeof a<"u"&&(ct(B,a)||B&&ct(B.buffer,a)))return g(B,C,O);if(typeof B=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const K=B.valueOf&&B.valueOf();if(K!=null&&K!==B)return c.from(K,C,O);const ne=h(B);if(ne)return ne;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof B[Symbol.toPrimitive]=="function")return c.from(B[Symbol.toPrimitive]("string"),C,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B)}c.from=function(B,C,O){return f(B,C,O)},Object.setPrototypeOf(c.prototype,i.prototype),Object.setPrototypeOf(c,i);function d(B){if(typeof B!="number")throw new TypeError('"size" argument must be of type number');if(B<0)throw new RangeError('The value "'+B+'" is invalid for option "size"')}function y(B,C,O){return d(B),B<=0?u(B):C!==void 0?typeof O=="string"?u(B).fill(C,O):u(B).fill(C):u(B)}c.alloc=function(B,C,O){return y(B,C,O)};function w(B){return d(B),u(B<0?0:b(B)|0)}c.allocUnsafe=function(B){return w(B)},c.allocUnsafeSlow=function(B){return w(B)};function m(B,C){if((typeof C!="string"||C==="")&&(C="utf8"),!c.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const O=E(B,C)|0;let K=u(O);const ne=K.write(B,C);return ne!==O&&(K=K.slice(0,ne)),K}function T(B){const C=B.length<0?0:b(B.length)|0,O=u(C);for(let K=0;K<C;K+=1)O[K]=B[K]&255;return O}function v(B){if(ct(B,i)){const C=new i(B);return g(C.buffer,C.byteOffset,C.byteLength)}return T(B)}function g(B,C,O){if(C<0||B.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(B.byteLength<C+(O||0))throw new RangeError('"length" is outside of buffer bounds');let K;return C===void 0&&O===void 0?K=new i(B):O===void 0?K=new i(B,C):K=new i(B,C,O),Object.setPrototypeOf(K,c.prototype),K}function h(B){if(c.isBuffer(B)){const C=b(B.length)|0,O=u(C);return O.length===0||B.copy(O,0,0,C),O}if(B.length!==void 0)return typeof B.length!="number"||en(B.length)?u(0):T(B);if(B.type==="Buffer"&&Array.isArray(B.data))return T(B.data)}function b(B){if(B>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return B|0}function S(B){return+B!=B&&(B=0),c.alloc(+B)}c.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==c.prototype},c.compare=function(C,O){if(ct(C,i)&&(C=c.from(C,C.offset,C.byteLength)),ct(O,i)&&(O=c.from(O,O.offset,O.byteLength)),!c.isBuffer(C)||!c.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===O)return 0;let K=C.length,ne=O.length;for(let de=0,Te=Math.min(K,ne);de<Te;++de)if(C[de]!==O[de]){K=C[de],ne=O[de];break}return K<ne?-1:ne<K?1:0},c.isEncoding=function(C){switch(String(C).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(C,O){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return c.alloc(0);let K;if(O===void 0)for(O=0,K=0;K<C.length;++K)O+=C[K].length;const ne=c.allocUnsafe(O);let de=0;for(K=0;K<C.length;++K){let Te=C[K];if(ct(Te,i))de+Te.length>ne.length?(c.isBuffer(Te)||(Te=c.from(Te)),Te.copy(ne,de)):i.prototype.set.call(ne,Te,de);else if(c.isBuffer(Te))Te.copy(ne,de);else throw new TypeError('"list" argument must be an Array of Buffers');de+=Te.length}return ne};function E(B,C){if(c.isBuffer(B))return B.length;if(s.isView(B)||ct(B,s))return B.byteLength;if(typeof B!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);const O=B.length,K=arguments.length>2&&arguments[2]===!0;if(!K&&O===0)return 0;let ne=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return Ne(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return et(B).length;default:if(ne)return K?-1:Ne(B).length;C=(""+C).toLowerCase(),ne=!0}}c.byteLength=E;function _(B,C,O){let K=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,C>>>=0,O<=C))return"";for(B||(B="utf8");;)switch(B){case"hex":return ee(this,C,O);case"utf8":case"utf-8":return ae(this,C,O);case"ascii":return ue(this,C,O);case"latin1":case"binary":return we(this,C,O);case"base64":return J(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,C,O);default:if(K)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),K=!0}}c.prototype._isBuffer=!0;function R(B,C,O){const K=B[C];B[C]=B[O],B[O]=K}c.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<C;O+=2)R(this,O,O+1);return this},c.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<C;O+=4)R(this,O,O+3),R(this,O+1,O+2);return this},c.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<C;O+=8)R(this,O,O+7),R(this,O+1,O+6),R(this,O+2,O+5),R(this,O+3,O+4);return this},c.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?ae(this,0,C):_.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(C){if(!c.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:c.compare(this,C)===0},c.prototype.inspect=function(){let C="";const O=e.INSPECT_MAX_BYTES;return C=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(C+=" ... "),"<Buffer "+C+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(C,O,K,ne,de){if(ct(C,i)&&(C=c.from(C,C.offset,C.byteLength)),!c.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(O===void 0&&(O=0),K===void 0&&(K=C?C.length:0),ne===void 0&&(ne=0),de===void 0&&(de=this.length),O<0||K>C.length||ne<0||de>this.length)throw new RangeError("out of range index");if(ne>=de&&O>=K)return 0;if(ne>=de)return-1;if(O>=K)return 1;if(O>>>=0,K>>>=0,ne>>>=0,de>>>=0,this===C)return 0;let Te=de-ne,Ze=K-O;const ut=Math.min(Te,Ze),Pe=this.slice(ne,de),De=C.slice(O,K);for(let Ve=0;Ve<ut;++Ve)if(Pe[Ve]!==De[Ve]){Te=Pe[Ve],Ze=De[Ve];break}return Te<Ze?-1:Ze<Te?1:0};function A(B,C,O,K,ne){if(B.length===0)return-1;if(typeof O=="string"?(K=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,en(O)&&(O=ne?0:B.length-1),O<0&&(O=B.length+O),O>=B.length){if(ne)return-1;O=B.length-1}else if(O<0)if(ne)O=0;else return-1;if(typeof C=="string"&&(C=c.from(C,K)),c.isBuffer(C))return C.length===0?-1:$(B,C,O,K,ne);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?ne?i.prototype.indexOf.call(B,C,O):i.prototype.lastIndexOf.call(B,C,O):$(B,[C],O,K,ne);throw new TypeError("val must be string, number or Buffer")}function $(B,C,O,K,ne){let de=1,Te=B.length,Ze=C.length;if(K!==void 0&&(K=String(K).toLowerCase(),K==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(B.length<2||C.length<2)return-1;de=2,Te/=2,Ze/=2,O/=2}function ut(De,Ve){return de===1?De[Ve]:De.readUInt16BE(Ve*de)}let Pe;if(ne){let De=-1;for(Pe=O;Pe<Te;Pe++)if(ut(B,Pe)===ut(C,De===-1?0:Pe-De)){if(De===-1&&(De=Pe),Pe-De+1===Ze)return De*de}else De!==-1&&(Pe-=Pe-De),De=-1}else for(O+Ze>Te&&(O=Te-Ze),Pe=O;Pe>=0;Pe--){let De=!0;for(let Ve=0;Ve<Ze;Ve++)if(ut(B,Pe+Ve)!==ut(C,Ve)){De=!1;break}if(De)return Pe}return-1}c.prototype.includes=function(C,O,K){return this.indexOf(C,O,K)!==-1},c.prototype.indexOf=function(C,O,K){return A(this,C,O,K,!0)},c.prototype.lastIndexOf=function(C,O,K){return A(this,C,O,K,!1)};function L(B,C,O,K){O=Number(O)||0;const ne=B.length-O;K?(K=Number(K),K>ne&&(K=ne)):K=ne;const de=C.length;K>de/2&&(K=de/2);let Te;for(Te=0;Te<K;++Te){const Ze=parseInt(C.substr(Te*2,2),16);if(en(Ze))return Te;B[O+Te]=Ze}return Te}function k(B,C,O,K){return Pt(Ne(C,B.length-O),B,O,K)}function N(B,C,O,K){return Pt(Be(C),B,O,K)}function z(B,C,O,K){return Pt(et(C),B,O,K)}function Q(B,C,O,K){return Pt(qe(C,B.length-O),B,O,K)}c.prototype.write=function(C,O,K,ne){if(O===void 0)ne="utf8",K=this.length,O=0;else if(K===void 0&&typeof O=="string")ne=O,K=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(K)?(K=K>>>0,ne===void 0&&(ne="utf8")):(ne=K,K=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const de=this.length-O;if((K===void 0||K>de)&&(K=de),C.length>0&&(K<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let Te=!1;for(;;)switch(ne){case"hex":return L(this,C,O,K);case"utf8":case"utf-8":return k(this,C,O,K);case"ascii":case"latin1":case"binary":return N(this,C,O,K);case"base64":return z(this,C,O,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,C,O,K);default:if(Te)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),Te=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(B,C,O){return C===0&&O===B.length?t.fromByteArray(B):t.fromByteArray(B.slice(C,O))}function ae(B,C,O){O=Math.min(B.length,O);const K=[];let ne=C;for(;ne<O;){const de=B[ne];let Te=null,Ze=de>239?4:de>223?3:de>191?2:1;if(ne+Ze<=O){let ut,Pe,De,Ve;switch(Ze){case 1:de<128&&(Te=de);break;case 2:ut=B[ne+1],(ut&192)===128&&(Ve=(de&31)<<6|ut&63,Ve>127&&(Te=Ve));break;case 3:ut=B[ne+1],Pe=B[ne+2],(ut&192)===128&&(Pe&192)===128&&(Ve=(de&15)<<12|(ut&63)<<6|Pe&63,Ve>2047&&(Ve<55296||Ve>57343)&&(Te=Ve));break;case 4:ut=B[ne+1],Pe=B[ne+2],De=B[ne+3],(ut&192)===128&&(Pe&192)===128&&(De&192)===128&&(Ve=(de&15)<<18|(ut&63)<<12|(Pe&63)<<6|De&63,Ve>65535&&Ve<1114112&&(Te=Ve))}}Te===null?(Te=65533,Ze=1):Te>65535&&(Te-=65536,K.push(Te>>>10&1023|55296),Te=56320|Te&1023),K.push(Te),ne+=Ze}return se(K)}const re=4096;function se(B){const C=B.length;if(C<=re)return String.fromCharCode.apply(String,B);let O="",K=0;for(;K<C;)O+=String.fromCharCode.apply(String,B.slice(K,K+=re));return O}function ue(B,C,O){let K="";O=Math.min(B.length,O);for(let ne=C;ne<O;++ne)K+=String.fromCharCode(B[ne]&127);return K}function we(B,C,O){let K="";O=Math.min(B.length,O);for(let ne=C;ne<O;++ne)K+=String.fromCharCode(B[ne]);return K}function ee(B,C,O){const K=B.length;(!C||C<0)&&(C=0),(!O||O<0||O>K)&&(O=K);let ne="";for(let de=C;de<O;++de)ne+=Me[B[de]];return ne}function ie(B,C,O){const K=B.slice(C,O);let ne="";for(let de=0;de<K.length-1;de+=2)ne+=String.fromCharCode(K[de]+K[de+1]*256);return ne}c.prototype.slice=function(C,O){const K=this.length;C=~~C,O=O===void 0?K:~~O,C<0?(C+=K,C<0&&(C=0)):C>K&&(C=K),O<0?(O+=K,O<0&&(O=0)):O>K&&(O=K),O<C&&(O=C);const ne=this.subarray(C,O);return Object.setPrototypeOf(ne,c.prototype),ne};function ce(B,C,O){if(B%1!==0||B<0)throw new RangeError("offset is not uint");if(B+C>O)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C],de=1,Te=0;for(;++Te<O&&(de*=256);)ne+=this[C+Te]*de;return ne},c.prototype.readUintBE=c.prototype.readUIntBE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C+--O],de=1;for(;O>0&&(de*=256);)ne+=this[C+--O]*de;return ne},c.prototype.readUint8=c.prototype.readUInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]|this[C+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]<<8|this[C+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},c.prototype.readBigUInt64LE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,de=this[++C]+this[++C]*2**8+this[++C]*2**16+K*2**24;return BigInt(ne)+(BigInt(de)<<BigInt(32))}),c.prototype.readBigUInt64BE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=O*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],de=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+K;return(BigInt(ne)<<BigInt(32))+BigInt(de)}),c.prototype.readIntLE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C],de=1,Te=0;for(;++Te<O&&(de*=256);)ne+=this[C+Te]*de;return de*=128,ne>=de&&(ne-=Math.pow(2,8*O)),ne},c.prototype.readIntBE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=O,de=1,Te=this[C+--ne];for(;ne>0&&(de*=256);)Te+=this[C+--ne]*de;return de*=128,Te>=de&&(Te-=Math.pow(2,8*O)),Te},c.prototype.readInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},c.prototype.readInt16LE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const K=this[C]|this[C+1]<<8;return K&32768?K|4294901760:K},c.prototype.readInt16BE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const K=this[C+1]|this[C]<<8;return K&32768?K|4294901760:K},c.prototype.readInt32LE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},c.prototype.readInt32BE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},c.prototype.readBigInt64LE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(K<<24);return(BigInt(ne)<<BigInt(32))+BigInt(O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),c.prototype.readBigInt64BE=He(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=(O<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(ne)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+K)}),c.prototype.readFloatLE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!0,23,4)},c.prototype.readFloatBE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!1,23,4)},c.prototype.readDoubleLE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!0,52,8)},c.prototype.readDoubleBE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!1,52,8)};function Ce(B,C,O,K,ne,de){if(!c.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>ne||C<de)throw new RangeError('"value" argument is out of bounds');if(O+K>B.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(C,O,K,ne){if(C=+C,O=O>>>0,K=K>>>0,!ne){const Ze=Math.pow(2,8*K)-1;Ce(this,C,O,K,Ze,0)}let de=1,Te=0;for(this[O]=C&255;++Te<K&&(de*=256);)this[O+Te]=C/de&255;return O+K},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(C,O,K,ne){if(C=+C,O=O>>>0,K=K>>>0,!ne){const Ze=Math.pow(2,8*K)-1;Ce(this,C,O,K,Ze,0)}let de=K-1,Te=1;for(this[O+de]=C&255;--de>=0&&(Te*=256);)this[O+de]=C/Te&255;return O+K},c.prototype.writeUint8=c.prototype.writeUInt8=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,1,255,0),this[O]=C&255,O+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,65535,0),this[O]=C&255,this[O+1]=C>>>8,O+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,65535,0),this[O]=C>>>8,this[O+1]=C&255,O+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,4294967295,0),this[O+3]=C>>>24,this[O+2]=C>>>16,this[O+1]=C>>>8,this[O]=C&255,O+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,4294967295,0),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4};function H(B,C,O,K,ne){Le(C,K,ne,B,O,7);let de=Number(C&BigInt(4294967295));B[O++]=de,de=de>>8,B[O++]=de,de=de>>8,B[O++]=de,de=de>>8,B[O++]=de;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return B[O++]=Te,Te=Te>>8,B[O++]=Te,Te=Te>>8,B[O++]=Te,Te=Te>>8,B[O++]=Te,O}function I(B,C,O,K,ne){Le(C,K,ne,B,O,7);let de=Number(C&BigInt(4294967295));B[O+7]=de,de=de>>8,B[O+6]=de,de=de>>8,B[O+5]=de,de=de>>8,B[O+4]=de;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return B[O+3]=Te,Te=Te>>8,B[O+2]=Te,Te=Te>>8,B[O+1]=Te,Te=Te>>8,B[O]=Te,O+8}c.prototype.writeBigUInt64LE=He(function(C,O=0){return H(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=He(function(C,O=0){return I(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(C,O,K,ne){if(C=+C,O=O>>>0,!ne){const ut=Math.pow(2,8*K-1);Ce(this,C,O,K,ut-1,-ut)}let de=0,Te=1,Ze=0;for(this[O]=C&255;++de<K&&(Te*=256);)C<0&&Ze===0&&this[O+de-1]!==0&&(Ze=1),this[O+de]=(C/Te>>0)-Ze&255;return O+K},c.prototype.writeIntBE=function(C,O,K,ne){if(C=+C,O=O>>>0,!ne){const ut=Math.pow(2,8*K-1);Ce(this,C,O,K,ut-1,-ut)}let de=K-1,Te=1,Ze=0;for(this[O+de]=C&255;--de>=0&&(Te*=256);)C<0&&Ze===0&&this[O+de+1]!==0&&(Ze=1),this[O+de]=(C/Te>>0)-Ze&255;return O+K},c.prototype.writeInt8=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,1,127,-128),C<0&&(C=255+C+1),this[O]=C&255,O+1},c.prototype.writeInt16LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,32767,-32768),this[O]=C&255,this[O+1]=C>>>8,O+2},c.prototype.writeInt16BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,32767,-32768),this[O]=C>>>8,this[O+1]=C&255,O+2},c.prototype.writeInt32LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,2147483647,-2147483648),this[O]=C&255,this[O+1]=C>>>8,this[O+2]=C>>>16,this[O+3]=C>>>24,O+4},c.prototype.writeInt32BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4},c.prototype.writeBigInt64LE=He(function(C,O=0){return H(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=He(function(C,O=0){return I(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(B,C,O,K,ne,de){if(O+K>B.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function G(B,C,O,K,ne){return C=+C,O=O>>>0,ne||F(B,C,O,4),n.write(B,C,O,K,23,4),O+4}c.prototype.writeFloatLE=function(C,O,K){return G(this,C,O,!0,K)},c.prototype.writeFloatBE=function(C,O,K){return G(this,C,O,!1,K)};function V(B,C,O,K,ne){return C=+C,O=O>>>0,ne||F(B,C,O,8),n.write(B,C,O,K,52,8),O+8}c.prototype.writeDoubleLE=function(C,O,K){return V(this,C,O,!0,K)},c.prototype.writeDoubleBE=function(C,O,K){return V(this,C,O,!1,K)},c.prototype.copy=function(C,O,K,ne){if(!c.isBuffer(C))throw new TypeError("argument should be a Buffer");if(K||(K=0),!ne&&ne!==0&&(ne=this.length),O>=C.length&&(O=C.length),O||(O=0),ne>0&&ne<K&&(ne=K),ne===K||C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(K<0||K>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),C.length-O<ne-K&&(ne=C.length-O+K);const de=ne-K;return this===C&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,K,ne):i.prototype.set.call(C,this.subarray(K,ne),O),de},c.prototype.fill=function(C,O,K,ne){if(typeof C=="string"){if(typeof O=="string"?(ne=O,O=0,K=this.length):typeof K=="string"&&(ne=K,K=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!c.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(C.length===1){const Te=C.charCodeAt(0);(ne==="utf8"&&Te<128||ne==="latin1")&&(C=Te)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(O<0||this.length<O||this.length<K)throw new RangeError("Out of range index");if(K<=O)return this;O=O>>>0,K=K===void 0?this.length:K>>>0,C||(C=0);let de;if(typeof C=="number")for(de=O;de<K;++de)this[de]=C;else{const Te=c.isBuffer(C)?C:c.from(C,ne),Ze=Te.length;if(Ze===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(de=0;de<K-O;++de)this[de+O]=Te[de%Ze]}return this};const M={};function q(B,C,O){M[B]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${B}]`,this.stack,delete this.name}get code(){return B}set code(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${B}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(B){return B?`${B} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(B,C){return`The "${B}" argument must be of type number. Received type ${typeof C}`},TypeError),q("ERR_OUT_OF_RANGE",function(B,C,O){let K=`The value of "${B}" is out of range.`,ne=O;return Number.isInteger(O)&&Math.abs(O)>2**32?ne=fe(String(O)):typeof O=="bigint"&&(ne=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(ne=fe(ne)),ne+="n"),K+=` It must be ${C}. Received ${ne}`,K},RangeError);function fe(B){let C="",O=B.length;const K=B[0]==="-"?1:0;for(;O>=K+4;O-=3)C=`_${B.slice(O-3,O)}${C}`;return`${B.slice(0,O)}${C}`}function Ae(B,C,O){ke(C,"offset"),(B[C]===void 0||B[C+O]===void 0)&&_e(C,B.length-(O+1))}function Le(B,C,O,K,ne,de){if(B>O||B<C){const Te=typeof C=="bigint"?"n":"";let Ze;throw C===0||C===BigInt(0)?Ze=`>= 0${Te} and < 2${Te} ** ${(de+1)*8}${Te}`:Ze=`>= -(2${Te} ** ${(de+1)*8-1}${Te}) and < 2 ** ${(de+1)*8-1}${Te}`,new M.ERR_OUT_OF_RANGE("value",Ze,B)}Ae(K,ne,de)}function ke(B,C){if(typeof B!="number")throw new M.ERR_INVALID_ARG_TYPE(C,"number",B)}function _e(B,C,O){throw Math.floor(B)!==B?(ke(B,O),new M.ERR_OUT_OF_RANGE("offset","an integer",B)):C<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,B)}const je=/[^+/0-9A-Za-z-_]/g;function Y(B){if(B=B.split("=")[0],B=B.trim().replace(je,""),B.length<2)return"";for(;B.length%4!==0;)B=B+"=";return B}function Ne(B,C){C=C||1/0;let O;const K=B.length;let ne=null;const de=[];for(let Te=0;Te<K;++Te){if(O=B.charCodeAt(Te),O>55295&&O<57344){if(!ne){if(O>56319){(C-=3)>-1&&de.push(239,191,189);continue}else if(Te+1===K){(C-=3)>-1&&de.push(239,191,189);continue}ne=O;continue}if(O<56320){(C-=3)>-1&&de.push(239,191,189),ne=O;continue}O=(ne-55296<<10|O-56320)+65536}else ne&&(C-=3)>-1&&de.push(239,191,189);if(ne=null,O<128){if((C-=1)<0)break;de.push(O)}else if(O<2048){if((C-=2)<0)break;de.push(O>>6|192,O&63|128)}else if(O<65536){if((C-=3)<0)break;de.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((C-=4)<0)break;de.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return de}function Be(B){const C=[];for(let O=0;O<B.length;++O)C.push(B.charCodeAt(O)&255);return C}function qe(B,C){let O,K,ne;const de=[];for(let Te=0;Te<B.length&&!((C-=2)<0);++Te)O=B.charCodeAt(Te),K=O>>8,ne=O%256,de.push(ne),de.push(K);return de}function et(B){return t.toByteArray(Y(B))}function Pt(B,C,O,K){let ne;for(ne=0;ne<K&&!(ne+O>=C.length||ne>=B.length);++ne)C[ne+O]=B[ne];return ne}function ct(B,C){return B instanceof C||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===C.name}function en(B){return B!==B}const Me=function(){const B="0123456789abcdef",C=new Array(256);for(let O=0;O<16;++O){const K=O*16;for(let ne=0;ne<16;++ne)C[K+ne]=B[O]+B[ne]}return C}();function He(B){return typeof BigInt>"u"?Mn:B}function Mn(){throw new Error("BigInt not supported")}})(Sh);const yr=Sh.Buffer;var xl,Th;function Ah(){return Th||(Th=1,xl=typeof ve=="object"&&ve.env&&ve.env.NODE_DEBUG&&/\bsemver\b/i.test(ve.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),xl}var kl,Rh;function _h(){if(Rh)return kl;Rh=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return kl={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},kl}var ys={exports:{}},Ih;function JT(){return Ih||(Ih=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=_h(),i=Ah();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],c=t.t={};let f=0;const d="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",o],[d,r]],w=T=>{for(const[v,g]of y)T=T.split(`${v}*`).join(`${v}{0,${g}}`).split(`${v}+`).join(`${v}{1,${g}}`);return T},m=(T,v,g)=>{const h=w(v),b=f++;i(T,b,v),c[T]=b,l[b]=v,u[b]=h,s[b]=new RegExp(v,g?"g":void 0),a[b]=new RegExp(h,g?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),m("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${d}+`),m("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),m("FULL",`^${l[c.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),m("LOOSE",`^${l[c.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),m("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",l[c.COERCE],!0),m("COERCERTLFULL",l[c.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ys,ys.exports)),ys.exports}var Nl,Ch;function ZT(){if(Ch)return Nl;Ch=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Nl=r=>r?typeof r!="object"?e:r:t,Nl}var $l,Ph;function eA(){if(Ph)return $l;Ph=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return $l={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},$l}var Dl,Fh;function Oh(){if(Fh)return Dl;Fh=1;const e=Ah(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=_h(),{safeRe:r,safeSrc:o,t:i}=JT(),s=ZT(),{compareIdentifiers:a}=eA();class l{constructor(c,f){if(f=s(f),c instanceof l){if(c.loose===!!f.loose&&c.includePrerelease===!!f.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=c.trim().match(f.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const w=+y;if(w>=0&&w<n)return w}return y}):this.prerelease=[],this.build=d[5]?d[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(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof l)){if(typeof c=="string"&&c===this.version)return 0;c=new l(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof l||(c=new l(c,this.options)),a(this.major,c.major)||a(this.minor,c.minor)||a(this.patch,c.patch)}comparePre(c){if(c instanceof l||(c=new l(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],y=c.prerelease[f];if(e("prerelease compare",f,d,y),d===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(d===void 0)return-1;if(d===y)continue;return a(d,y)}while(++f)}compareBuild(c){c instanceof l||(c=new l(c,this.options));let f=0;do{const d=this.build[f],y=c.build[f];if(e("build compare",f,d,y),d===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(d===void 0)return-1;if(d===y)continue;return a(d,y)}while(++f)}inc(c,f,d){if(c.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const y=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),w=`-${f}`.match(y);if(!w||w[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(f){let w=[f,y];d===!1&&(w=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Dl=l,Dl}var Ll,xh;function tA(){if(xh)return Ll;xh=1;const e=Oh();return Ll=(n,r)=>new e(n,r).major,Ll}var nA=tA();const kh=el(nA);var Ml,Nh;function rA(){if(Nh)return Ml;Nh=1;const e=Oh();return Ml=(n,r,o)=>new e(n,o).compare(new e(r,o)),Ml}var Bl,$h;function iA(){if($h)return Bl;$h=1;const e=rA();return Bl=(n,r,o)=>e(r,n,o),Bl}var oA=iA();const sA=el(oA);class Ii extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Se(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class aA extends Ii{constructor(){super(...arguments);Se(this,"name","ApiError")}}const jl=(e,t)=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)};class lA{constructor(t,n,r,o=le([])){Se(this,"clientService");Se(this,"userStore");Se(this,"serverUrl");Se(this,"capability");Se(this,"available");Se(this,"fileIdsSupported");this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=j(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>sA(s.version,a.version));return i.length?i[0]:null}),this.available=j(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=j(()=>{var i;return kh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new Ii("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new Ii("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new Ii("download url could not be built");const r=t.publicToken?n:await this.clientService.ocsUserContext.signUrl(n,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const a=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!t.publicLinkPassword}),...!!t.publicLinkPassword&&{Authorization:"Basic "+yr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}}});if(!a.ok)throw new te.HttpError("",a);const l=await a.blob(),u=URL.createObjectURL(l),c=this.getFileNameFromResponseHeaders(a.headers);return jl(u,c),r}catch(a){throw new te.HttpError("archive could not be fetched",a.response)}}buildDownloadUrl(t){const n=[];switch(t.publicToken&&n.push(`public-token=${t.publicToken}`),kh(p(this.capability).version)){case 2:return n.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+n.join("&");case 1:{const o=Math.random().toString(36).substring(2);return n.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+n.join("&")}default:return}}get url(){if(!this.available)throw new Ii("no archiver available");const t=p(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:te.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var r;const n=(r=t.get("content-disposition"))==null?void 0:r.split('"')[1];return decodeURI(n)}}const cA=new Tl({ttl:10*1e3,capacity:250}),uA=new Tl({ttl:10*1e3,capacity:250});class fA{get avatarUrl(){return uA}get filePreview(){return cA}}const Ul=new fA;class Dh{constructor(t={}){Se(this,"accessToken");Se(this,"publicLinkToken");Se(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+yr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class ql{constructor(t,n){Se(this,"instance");Se(this,"cancelToken");this.cancelToken=ko.CancelToken.source(),this.instance=ko.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return ao({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n!=null&&n.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const o=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(o,r)}async internalRequestWithData(t,n,r,o){const i=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(i,o)}}class dA extends Error{constructor(){super(...arguments);Se(this,"name","RetriableError")}}const pA=15e3;class hA{constructor(t,n){Se(this,"url");Se(this,"fetchOptions");Se(this,"abortController");Se(this,"eventListenerMap");Se(this,"readyState");Se(this,"withCredentials");Se(this,"CONNECTING");Se(this,"OPEN");Se(this,"CLOSED");Se(this,"onerror");Se(this,"onmessage");Se(this,"onopen");this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return N0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var n;const t=new Event("open");(n=this.onopen)==null||n.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const n=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(n);const r=t.event,o=this.eventListenerMap[r];o==null||o.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new dA},onerror:t=>{var r;console.error(t);const n=new CustomEvent("error",{detail:t});return(r=this.onerror)==null||r.bind(this)(n),3e4+Math.floor(Math.random()*pA)}})}fetchProvider(...t){const[n,r]=t,o={...r,...this.fetchOptions};return window.fetch(n,o)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){var r;this.eventListenerMap[t]=(r=this.eventListenerMap[t])==null?void 0:r.filter(o=>o!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let Vl=null;const gA=(e,t)=>(Vl||(Vl=new hA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),Vl),mA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Xt.v4(),"X-Requested-With":"XMLHttpRequest"}});class yA{constructor(t){Se(this,"configStore");Se(this,"language");Se(this,"authStore");Se(this,"httpAuthenticatedClient");Se(this,"httpUnAuthenticatedClient");Se(this,"graphClient");Se(this,"ocsClient");Se(this,"webDavClient");Se(this,"initiatorId",Xt.v4());Se(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});Se(this,"getRequestHeaders",({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})}));this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new ql({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new ql({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return gA(this.configStore.serverUrl,mA({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}initGraphClient(){const t=ko.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=te.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=ko.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=te.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=te.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+yr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Xt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Lh{constructor(){Se(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:Xt.v4(),callback:n},o=[r,...this.topics.get(t)||[]];return this.topics.set(t,o),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(o=>o.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Ye=new Lh;var bA=Lp(Object.keys,Object),vA=Object.prototype,wA=vA.hasOwnProperty;function Mh(e){if(!fs(e))return bA(e);var t=[];for(var n in Object(e))wA.call(e,n)&&n!="constructor"&&t.push(n);return t}var zl=Qr(Kn,"DataView"),Wl=Qr(Kn,"Promise"),Hl=Qr(Kn,"Set"),Gl=Qr(Kn,"WeakMap"),Bh="[object Map]",SA="[object Object]",jh="[object Promise]",Uh="[object Set]",qh="[object WeakMap]",Vh="[object DataView]",EA=Kr(zl),TA=Kr(no),AA=Kr(Wl),RA=Kr(Hl),_A=Kr(Gl),Nn=Gr;(zl&&Nn(new zl(new ArrayBuffer(1)))!=Vh||no&&Nn(new no)!=Bh||Wl&&Nn(Wl.resolve())!=jh||Hl&&Nn(new Hl)!=Uh||Gl&&Nn(new Gl)!=qh)&&(Nn=function(e){var t=Gr(e),n=t==SA?e.constructor:void 0,r=n?Kr(n):"";if(r)switch(r){case EA:return Vh;case TA:return Bh;case AA:return jh;case RA:return Uh;case _A:return qh}return t});var IA="[object Map]",CA="[object Set]",PA=Object.prototype,FA=PA.hasOwnProperty;function OA(e){if(e==null)return!0;if(oo(e)&&(Fn(e)||typeof e=="string"||typeof e.splice=="function"||Si(e)||ds(e)||io(e)))return!e.length;var t=Nn(e);if(t==IA||t==CA)return!e.size;if(fs(e))return!Mh(e).length;for(var n in e)if(FA.call(e,n))return!1;return!0}class zh{isEnabled(){return!0}isActive(t){return ft(t,"files-spaces-projects")?!1:ft(t,"files-spaces-generic")||Rn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,userStore:i,authService:s,spacesStore:a,sharesStore:l,configStore:u}=t,{webdav:c,graphAuthenticated:f}=r,{replaceInvalidFileRoute:d}=zs({router:n});return un.useTask(function*(y,w,m,T=null,v=null,g={}){try{o.clearResourceList();let{resource:h,children:b}=yield*te.call(c.listFiles(m,{path:T,fileId:v},{signal:y}));h.id&&d({space:m,resource:h,path:T,fileId:v});let S;T==="/"&&(te.isShareSpaceResource(m)?(S=yield*te.call(hs({graphClient:f,spacesStore:a,space:m,signal:y})),S&&(h=te.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:S,serverUrl:u.serverUrl}))):!te.isPersonalSpaceResource(m)&&!te.isPublicSpaceResource(m)&&(h=m)),yield o.loadAncestorMetaData({folder:h,space:m,client:c,signal:y}),te.isShareSpaceResource(m)&&(b.forEach(E=>E.remoteItemId=m.id),OA(m.members)&&(S||(S=yield*te.call(hs({graphClient:f,spacesStore:a,space:m,signal:y}))),ch({sharesStore:l,spacesStore:a,userStore:i,space:m,sharedDriveItem:S}))),o.initResourceList({currentFolder:h,resources:b})}catch(h){if(o.setCurrentFolder(null),console.error(h),h.statusCode===401)return s.handleAuthError(p(n.currentRoute))}}).restartable()}}class Wh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return At(t,"files-common-favorites")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return un.useTask(function*(i,s){var l;n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:(l=o.user)==null?void 0:l.onPremisesSamAccountName,signal:i});a=a.map(te.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class Hh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(t,"files-shares-via-link")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return un.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const c=(yield*te.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(f=>f.permissions.some(({link:d})=>!!d)).map(f=>te.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Gh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(t,"files-shares-with-me")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:i,sharesStore:s}=t;return un.useTask(function*(a,l){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const c=(yield*te.call(r.graphAuthenticated.driveItems.listSharedWithMe({signal:a}))).map(f=>te.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class Kh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Nt(t,"files-shares-with-others")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return un.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const c=(yield*te.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(f=>f.permissions.some(({link:d})=>!d)).map(f=>te.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class In{}Se(In,"Shared","S"),Se(In,"Shareable","R"),Se(In,"Mounted","M"),Se(In,"Deletable","D"),Se(In,"Renameable","N"),Se(In,"Moveable","V"),Se(In,"Updateable","NV"),Se(In,"FileUpdateable","W"),Se(In,"FolderCreateable","CK"),Se(In,"Deny","Z"),Se(In,"SecureView","X");const bs=e=>({value:e,type:null}),xA=e=>bs(e),dt=e=>bs(e),Kl=e=>bs(e),kA=e=>bs(e),NA={Permissions:dt("permissions"),IsFavorite:Kl("favorite"),FileId:dt("fileid"),FileParent:dt("file-parent"),Name:dt("name"),OwnerId:dt("owner-id"),OwnerDisplayName:dt("owner-display-name"),PrivateLink:dt("privatelink"),ContentLength:Kl("getcontentlength"),ContentSize:Kl("size"),LastModifiedDate:dt("getlastmodified"),Tags:xA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:dt("getetag"),MimeType:dt("getcontenttype"),ResourceType:kA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:dt("owner"),LockTime:dt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:dt("downloadURL"),Highlights:dt("highlights"),MetaPathForUser:dt("meta-path-for-user"),RemoteItemId:dt("remote-item-id"),ShareId:dt("shareid"),ShareRoot:dt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:dt("share-permissions"),TrashbinOriginalFilename:dt("trashbin-original-filename"),TrashbinOriginalLocation:dt("trashbin-original-location"),TrashbinDeletedDate:dt("trashbin-delete-datetime"),PublicLinkItemType:dt("public-link-item-type"),PublicLinkPermission:dt("public-link-permission"),PublicLinkExpiration:dt("public-link-expiration"),PublicLinkShareDate:dt("public-link-share-datetime"),PublicLinkShareOwner:dt("public-link-share-owner")},Ue=Object.fromEntries(Object.entries(NA).map(([e,t])=>[e,t.value])),ci=class ci{};Se(ci,"Default",[Ue.Permissions,Ue.IsFavorite,Ue.FileId,Ue.FileParent,Ue.Name,Ue.LockDiscovery,Ue.ActiveLock,Ue.OwnerId,Ue.OwnerDisplayName,Ue.RemoteItemId,Ue.ShareRoot,Ue.ShareTypes,Ue.PrivateLink,Ue.ContentLength,Ue.ContentSize,Ue.LastModifiedDate,Ue.ETag,Ue.MimeType,Ue.ResourceType,Ue.DownloadURL,Ue.Tags,Ue.Audio,Ue.Location,Ue.Image,Ue.Photo]),Se(ci,"PublicLink",ci.Default.concat([Ue.PublicLinkItemType,Ue.PublicLinkPermission,Ue.PublicLinkExpiration,Ue.PublicLinkShareDate,Ue.PublicLinkShareOwner])),Se(ci,"Trashbin",[Ue.ContentLength,Ue.ResourceType,Ue.TrashbinOriginalLocation,Ue.TrashbinOriginalFilename,Ue.TrashbinDeletedDate,Ue.Permissions,Ue.FileParent]),Se(ci,"DavNamespace",[Ue.ContentLength,Ue.LastModifiedDate,Ue.ETag,Ue.MimeType,Ue.ResourceType,Ue.LockDiscovery,Ue.ActiveLock]);let vs=ci;var Ql={},ws={exports:{}},Qh;function Xl(){if(Qh)return ws.exports;Qh=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,E,_){return Function.prototype.apply.call(S,E,_)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(b){console&&console.warn&&console.warn(b)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}ws.exports=i,ws.exports.once=v,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(b){if(typeof b!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(b){if(typeof b!="number"||b<0||o(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");s=b}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function l(b){return b._maxListeners===void 0?i.defaultMaxListeners:b._maxListeners}i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(S){for(var E=[],_=1;_<arguments.length;_++)E.push(arguments[_]);var R=S==="error",A=this._events;if(A!==void 0)R=R&&A.error===void 0;else if(!R)return!1;if(R){var $;if(E.length>0&&($=E[0]),$ instanceof Error)throw $;var L=new Error("Unhandled error."+($?" ("+$.message+")":""));throw L.context=$,L}var k=A[S];if(k===void 0)return!1;if(typeof k=="function")t(k,this,E);else for(var N=k.length,z=w(k,N),_=0;_<N;++_)t(z[_],this,E);return!0};function u(b,S,E,_){var R,A,$;if(a(E),A=b._events,A===void 0?(A=b._events=Object.create(null),b._eventsCount=0):(A.newListener!==void 0&&(b.emit("newListener",S,E.listener?E.listener:E),A=b._events),$=A[S]),$===void 0)$=A[S]=E,++b._eventsCount;else if(typeof $=="function"?$=A[S]=_?[E,$]:[$,E]:_?$.unshift(E):$.push(E),R=l(b),R>0&&$.length>R&&!$.warned){$.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+$.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=b,L.type=S,L.count=$.length,r(L)}return b}i.prototype.addListener=function(S,E){return u(this,S,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,E){return u(this,S,E,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(b,S,E){var _={fired:!1,wrapFn:void 0,target:b,type:S,listener:E},R=c.bind(_);return R.listener=E,_.wrapFn=R,R}i.prototype.once=function(S,E){return a(E),this.on(S,f(this,S,E)),this},i.prototype.prependOnceListener=function(S,E){return a(E),this.prependListener(S,f(this,S,E)),this},i.prototype.removeListener=function(S,E){var _,R,A,$,L;if(a(E),R=this._events,R===void 0)return this;if(_=R[S],_===void 0)return this;if(_===E||_.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete R[S],R.removeListener&&this.emit("removeListener",S,_.listener||E));else if(typeof _!="function"){for(A=-1,$=_.length-1;$>=0;$--)if(_[$]===E||_[$].listener===E){L=_[$].listener,A=$;break}if(A<0)return this;A===0?_.shift():m(_,A),_.length===1&&(R[S]=_[0]),R.removeListener!==void 0&&this.emit("removeListener",S,L||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var E,_,R;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[S]),this;if(arguments.length===0){var A=Object.keys(_),$;for(R=0;R<A.length;++R)$=A[R],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=_[S],typeof E=="function")this.removeListener(S,E);else if(E!==void 0)for(R=E.length-1;R>=0;R--)this.removeListener(S,E[R]);return this};function d(b,S,E){var _=b._events;if(_===void 0)return[];var R=_[S];return R===void 0?[]:typeof R=="function"?E?[R.listener||R]:[R]:E?T(R):w(R,R.length)}i.prototype.listeners=function(S){return d(this,S,!0)},i.prototype.rawListeners=function(S){return d(this,S,!1)},i.listenerCount=function(b,S){return typeof b.listenerCount=="function"?b.listenerCount(S):y.call(b,S)},i.prototype.listenerCount=y;function y(b){var S=this._events;if(S!==void 0){var E=S[b];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(b,S){for(var E=new Array(S),_=0;_<S;++_)E[_]=b[_];return E}function m(b,S){for(;S+1<b.length;S++)b[S]=b[S+1];b.pop()}function T(b){for(var S=new Array(b.length),E=0;E<S.length;++E)S[E]=b[E].listener||b[E];return S}function v(b,S){return new Promise(function(E,_){function R($){b.removeListener(S,A),_($)}function A(){typeof b.removeListener=="function"&&b.removeListener("error",R),E([].slice.call(arguments))}h(b,S,A,{once:!0}),S!=="error"&&g(b,R,{once:!0})})}function g(b,S,E){typeof b.on=="function"&&h(b,"error",S,E)}function h(b,S,E,_){if(typeof b.on=="function")_.once?b.once(S,E):b.on(S,E);else if(typeof b.addEventListener=="function")b.addEventListener(S,function R(A){_.once&&b.removeEventListener(S,R),E(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof b)}return ws.exports}var Ss={exports:{}},Xh;function Zr(){return Xh||(Xh=1,typeof Object.create=="function"?Ss.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Ss.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),Ss.exports}var Yl,Yh;function Jh(){return Yh||(Yh=1,Yl=Xl().EventEmitter),Yl}var Jl={},Zh;function Es(){return Zh||(Zh=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=c,n.toByteArray=d,n.fromByteArray=m;for(var r=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;o[45]=62,o[95]=63;function u(g){var h=g.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=g.indexOf("=");b===-1&&(b=h);var S=b===h?0:4-b%4;return[b,S]}function c(g){var h=u(g),b=h[0],S=h[1];return(b+S)*3/4-S}function f(g,h,b){return(h+b)*3/4-b}function d(g){var h,b=u(g),S=b[0],E=b[1],_=new i(f(g,S,E)),R=0,A=E>0?S-4:S,$;for($=0;$<A;$+=4)h=o[g.charCodeAt($)]<<18|o[g.charCodeAt($+1)]<<12|o[g.charCodeAt($+2)]<<6|o[g.charCodeAt($+3)],_[R++]=h>>16&255,_[R++]=h>>8&255,_[R++]=h&255;return E===2&&(h=o[g.charCodeAt($)]<<2|o[g.charCodeAt($+1)]>>4,_[R++]=h&255),E===1&&(h=o[g.charCodeAt($)]<<10|o[g.charCodeAt($+1)]<<4|o[g.charCodeAt($+2)]>>2,_[R++]=h>>8&255,_[R++]=h&255),_}function y(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,h,b){for(var S,E=[],_=h;_<b;_+=3)S=(g[_]<<16&16711680)+(g[_+1]<<8&65280)+(g[_+2]&255),E.push(y(S));return E.join("")}function m(g){for(var h,b=g.length,S=b%3,E=[],_=16383,R=0,A=b-S;R<A;R+=_)E.push(w(g,R,R+_>A?A:R+_));return S===1?(h=g[b-1],E.push(r[h>>2]+r[h<<4&63]+"==")):S===2&&(h=(g[b-2]<<8)+g[b-1],E.push(r[h>>10]+r[h>>4&63]+r[h<<2&63]+"=")),E.join("")}var T={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */T.read=function(g,h,b,S,E){var _,R,A=E*8-S-1,$=(1<<A)-1,L=$>>1,k=-7,N=b?E-1:0,z=b?-1:1,Q=g[h+N];for(N+=z,_=Q&(1<<-k)-1,Q>>=-k,k+=A;k>0;_=_*256+g[h+N],N+=z,k-=8);for(R=_&(1<<-k)-1,_>>=-k,k+=S;k>0;R=R*256+g[h+N],N+=z,k-=8);if(_===0)_=1-L;else{if(_===$)return R?NaN:(Q?-1:1)*(1/0);R=R+Math.pow(2,S),_=_-L}return(Q?-1:1)*R*Math.pow(2,_-S)},T.write=function(g,h,b,S,E,_){var R,A,$,L=_*8-E-1,k=(1<<L)-1,N=k>>1,z=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,Q=S?0:_-1,J=S?1:-1,ae=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(A=isNaN(h)?1:0,R=k):(R=Math.floor(Math.log(h)/Math.LN2),h*($=Math.pow(2,-R))<1&&(R--,$*=2),R+N>=1?h+=z/$:h+=z*Math.pow(2,1-N),h*$>=2&&(R++,$/=2),R+N>=k?(A=0,R=k):R+N>=1?(A=(h*$-1)*Math.pow(2,E),R=R+N):(A=h*Math.pow(2,N-1)*Math.pow(2,E),R=0));E>=8;g[b+Q]=A&255,Q+=J,A/=256,E-=8);for(R=R<<E|A,L+=E;L>0;g[b+Q]=R&255,Q+=J,R/=256,L-=8);g[b+Q-J]|=ae*128};/*!
|
|
12
12
|
* The buffer module from node.js, for the browser.
|
|
13
13
|
*
|
|
14
14
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -47,8 +47,8 @@ globstar while`,t,d,n,y,w),this.matchOne(t.slice(d),n.slice(y),r))return this.de
|
|
|
47
47
|
`);const E=new t("!xml");let _=E,R="",A="";for(let $=0;$<S.length;$++)if(S[$]==="<")if(S[$+1]==="/"){const k=v(S,">",$,"Closing Tag is not closed.");let N=S.substring($+2,k).trim();if(this.options.removeNSPrefix){const J=N.indexOf(":");J!==-1&&(N=N.substr(J+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),_&&(R=this.saveTextToParentTag(R,_,A));const z=A.substring(A.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let Q=0;z&&this.options.unpairedTags.indexOf(z)!==-1?(Q=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):Q=A.lastIndexOf("."),A=A.substring(0,Q),_=this.tagsNodeStack.pop(),R="",$=k}else if(S[$+1]==="?"){let k=g(S,$,!1,"?>");if(!k)throw new Error("Pi Tag is not closed.");if(R=this.saveTextToParentTag(R,_,A),!(this.options.ignoreDeclaration&&k.tagName==="?xml"||this.options.ignorePiTags)){const N=new t(k.tagName);N.add(this.options.textNodeName,""),k.tagName!==k.tagExp&&k.attrExpPresent&&(N[":@"]=this.buildAttributesMap(k.tagExp,A,k.tagName)),this.addChild(_,N,A)}$=k.closeIndex+1}else if(S.substr($+1,3)==="!--"){const k=v(S,"-->",$+4,"Comment is not closed.");if(this.options.commentPropName){const N=S.substring($+4,k-2);R=this.saveTextToParentTag(R,_,A),_.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}$=k}else if(S.substr($+1,2)==="!D"){const k=n(S,$);this.docTypeEntities=k.entities,$=k.i}else if(S.substr($+1,2)==="!["){const k=v(S,"]]>",$,"CDATA is not closed.")-2,N=S.substring($+9,k);R=this.saveTextToParentTag(R,_,A);let z=this.parseTextData(N,_.tagname,A,!0,!1,!0,!0);z==null&&(z=""),this.options.cdataPropName?_.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):_.add(this.options.textNodeName,z),$=k+2}else{let k=g(S,$,this.options.removeNSPrefix),N=k.tagName;const z=k.rawTagName;let Q=k.tagExp,J=k.attrExpPresent,ae=k.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),_&&R&&_.tagname!=="!xml"&&(R=this.saveTextToParentTag(R,_,A,!1));const re=_;if(re&&this.options.unpairedTags.indexOf(re.tagname)!==-1&&(_=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),N!==E.tagname&&(A+=A?"."+N:N),this.isItStopNode(this.options.stopNodes,A,N)){let se="";if(Q.length>0&&Q.lastIndexOf("/")===Q.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),Q=N):Q=Q.substr(0,Q.length-1),$=k.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)$=k.closeIndex;else{const we=this.readStopNodeData(S,z,ae+1);if(!we)throw new Error(`Unexpected end of ${z}`);$=we.i,se=we.tagContent}const ue=new t(N);N!==Q&&J&&(ue[":@"]=this.buildAttributesMap(Q,A,N)),se&&(se=this.parseTextData(se,N,A,!0,J,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),ue.add(this.options.textNodeName,se),this.addChild(_,ue,A)}else{if(Q.length>0&&Q.lastIndexOf("/")===Q.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),Q=N):Q=Q.substr(0,Q.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const se=new t(N);N!==Q&&J&&(se[":@"]=this.buildAttributesMap(Q,A,N)),this.addChild(_,se,A),A=A.substr(0,A.lastIndexOf("."))}else{const se=new t(N);this.tagsNodeStack.push(_),N!==Q&&J&&(se[":@"]=this.buildAttributesMap(Q,A,N)),this.addChild(_,se,A),_=se}R="",$=ae}}else R+=S[$];return E.child};function d(S,E,_){const R=this.options.updateTag(E.tagname,_,E[":@"]);R===!1||(typeof R=="string"&&(E.tagname=R),S.addChild(E))}const y=function(S){if(this.options.processEntities){for(let E in this.docTypeEntities){const _=this.docTypeEntities[E];S=S.replace(_.regx,_.val)}for(let E in this.lastEntities){const _=this.lastEntities[E];S=S.replace(_.regex,_.val)}if(this.options.htmlEntities)for(let E in this.htmlEntities){const _=this.htmlEntities[E];S=S.replace(_.regex,_.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,E,_,R){return S&&(R===void 0&&(R=E.child.length===0),S=this.parseTextData(S,E.tagname,_,!1,E[":@"]?Object.keys(E[":@"]).length!==0:!1,R),S!==void 0&&S!==""&&E.add(this.options.textNodeName,S),S=""),S}function m(S,E,_){const R="*."+_;for(const A in S){const $=S[A];if(R===$||E===$)return!0}return!1}function T(S,E,_=">"){let R,A="";for(let $=E;$<S.length;$++){let L=S[$];if(R)L===R&&(R="");else if(L==='"'||L==="'")R=L;else if(L===_[0])if(_[1]){if(S[$+1]===_[1])return{data:A,index:$}}else return{data:A,index:$};else L===" "&&(L=" ");A+=L}}function v(S,E,_,R){const A=S.indexOf(E,_);if(A===-1)throw new Error(R);return A+E.length-1}function g(S,E,_,R=">"){const A=T(S,E+1,R);if(!A)return;let $=A.data;const L=A.index,k=$.search(/\s/);let N=$,z=!0;k!==-1&&(N=$.substring(0,k),$=$.substring(k+1).trimStart());const Q=N;if(_){const J=N.indexOf(":");J!==-1&&(N=N.substr(J+1),z=N!==A.data.substr(J+1))}return{tagName:N,tagExp:$,closeIndex:L,attrExpPresent:z,rawTagName:Q}}function h(S,E,_){const R=_;let A=1;for(;_<S.length;_++)if(S[_]==="<")if(S[_+1]==="/"){const $=v(S,">",_,`${E} is not closed`);if(S.substring(_+2,$).trim()===E&&(A--,A===0))return{tagContent:S.substring(R,_),i:$};_=$}else if(S[_+1]==="?")_=v(S,"?>",_+1,"StopNode is not closed.");else if(S.substr(_+1,3)==="!--")_=v(S,"-->",_+3,"StopNode is not closed.");else if(S.substr(_+1,2)==="![")_=v(S,"]]>",_,"StopNode is not closed.")-2;else{const $=g(S,_,">");$&&(($&&$.tagName)===E&&$.tagExp[$.tagExp.length-1]!=="/"&&A++,_=$.closeIndex)}}function b(S,E,_){if(E&&typeof S=="string"){const R=S.trim();return R==="true"?!0:R==="false"?!1:r(S,_)}else return e.isExist(S)?S:""}return nf=i,nf}var rf={},My;function Q_(){if(My)return rf;My=1;function e(i,s){return t(i,s)}function t(i,s,a){let l;const u={};for(let c=0;c<i.length;c++){const f=i[c],d=n(f);let y="";if(a===void 0?y=d:y=a+"."+d,d===s.textNodeName)l===void 0?l=f[d]:l+=""+f[d];else{if(d===void 0)continue;if(f[d]){let w=t(f[d],s,y);const m=o(w,s);f[":@"]?r(w,f[":@"],y,s):Object.keys(w).length===1&&w[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?w=w[s.textNodeName]:Object.keys(w).length===0&&(s.alwaysCreateTextNode?w[s.textNodeName]="":w=""),u[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(w)):s.isArray(d,y,m)?u[d]=[w]:u[d]=w}}}return typeof l=="string"?l.length>0&&(u[s.textNodeName]=l):l!==void 0&&(u[s.textNodeName]=l),u}function n(i){const s=Object.keys(i);for(let a=0;a<s.length;a++){const l=s[a];if(l!==":@")return l}}function r(i,s,a,l){if(s){const u=Object.keys(s),c=u.length;for(let f=0;f<c;f++){const d=u[f];l.isArray(d,a+"."+d,!0,!0)?i[d]=[s[d]]:i[d]=s[d]}}}function o(i,s){const{textNodeName:a}=s,l=Object.keys(i).length;return!!(l===0||l===1&&(i[a]||typeof i[a]=="boolean"||i[a]===0))}return rf.prettify=e,rf}var of,By;function X_(){if(By)return of;By=1;const{buildOptions:e}=z_(),t=K_(),{prettify:n}=Q_(),r=Fy();class o{constructor(s){this.externalEntities={},this.options=e(s)}parse(s,a){if(typeof s!="string")if(s.toString)s=s.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(a){a===!0&&(a={});const c=r.validate(s,a);if(c!==!0)throw Error(`${c.err.msg}:${c.err.line}:${c.err.col}`)}const l=new t(this.options);l.addExternalEntities(this.externalEntities);const u=l.parseXml(s);return this.options.preserveOrder||u===void 0?u:n(u,this.options)}addEntity(s,a){if(a.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(s.indexOf("&")!==-1||s.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(a==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[s]=a}}return of=o,of}var sf,jy;function Y_(){if(jy)return sf;jy=1;const e=`
|
|
48
48
|
`;function t(a,l){let u="";return l.format&&l.indentBy.length>0&&(u=e),n(a,l,"",u)}function n(a,l,u,c){let f="",d=!1;for(let y=0;y<a.length;y++){const w=a[y],m=r(w);if(m===void 0)continue;let T="";if(u.length===0?T=m:T=`${u}.${m}`,m===l.textNodeName){let S=w[m];i(T,l)||(S=l.tagValueProcessor(m,S),S=s(S,l)),d&&(f+=c),f+=S,d=!1;continue}else if(m===l.cdataPropName){d&&(f+=c),f+=`<![CDATA[${w[m][0][l.textNodeName]}]]>`,d=!1;continue}else if(m===l.commentPropName){f+=c+`<!--${w[m][0][l.textNodeName]}-->`,d=!0;continue}else if(m[0]==="?"){const S=o(w[":@"],l),E=m==="?xml"?"":c;let _=w[m][0][l.textNodeName];_=_.length!==0?" "+_:"",f+=E+`<${m}${_}${S}?>`,d=!0;continue}let v=c;v!==""&&(v+=l.indentBy);const g=o(w[":@"],l),h=c+`<${m}${g}`,b=n(w[m],l,T,v);l.unpairedTags.indexOf(m)!==-1?l.suppressUnpairedNode?f+=h+">":f+=h+"/>":(!b||b.length===0)&&l.suppressEmptyNode?f+=h+"/>":b&&b.endsWith(">")?f+=h+`>${b}${c}</${m}>`:(f+=h+">",b&&c!==""&&(b.includes("/>")||b.includes("</"))?f+=c+l.indentBy+b+c:f+=b,f+=`</${m}>`),d=!0}return f}function r(a){const l=Object.keys(a);for(let u=0;u<l.length;u++){const c=l[u];if(a.hasOwnProperty(c)&&c!==":@")return c}}function o(a,l){let u="";if(a&&!l.ignoreAttributes)for(let c in a){if(!a.hasOwnProperty(c))continue;let f=l.attributeValueProcessor(c,a[c]);f=s(f,l),f===!0&&l.suppressBooleanAttributes?u+=` ${c.substr(l.attributeNamePrefix.length)}`:u+=` ${c.substr(l.attributeNamePrefix.length)}="${f}"`}return u}function i(a,l){a=a.substr(0,a.length-l.textNodeName.length-1);let u=a.substr(a.lastIndexOf(".")+1);for(let c in l.stopNodes)if(l.stopNodes[c]===a||l.stopNodes[c]==="*."+u)return!0;return!1}function s(a,l){if(a&&a.length>0&&l.processEntities)for(let u=0;u<l.entities.length;u++){const c=l.entities[u];a=a.replace(c.regex,c.val)}return a}return sf=t,sf}var af,Uy;function J_(){if(Uy)return af;Uy=1;const e=Y_(),t=Dy(),n={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,l){return l},attributeValueProcessor:function(a,l){return l},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 r(a){this.options=Object.assign({},n,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=s),this.processTextOrObjNode=o,this.options.format?(this.indentate=i,this.tagEndChar=`>
|
|
49
49
|
`,this.newLine=`
|
|
50
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?e(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,u){let c="",f="";const d=u.join(".");for(let y in a)if(Object.prototype.hasOwnProperty.call(a,y))if(typeof a[y]>"u")this.isAttribute(y)&&(f+="");else if(a[y]===null)this.isAttribute(y)||y===this.options.cdataPropName?f+="":y[0]==="?"?f+=this.indentate(l)+"<"+y+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+y+"/"+this.tagEndChar;else if(a[y]instanceof Date)f+=this.buildTextValNode(a[y],y,"",l);else if(typeof a[y]!="object"){const w=this.isAttribute(y);if(w&&!this.ignoreAttributesFn(w,d))c+=this.buildAttrPairStr(w,""+a[y]);else if(!w)if(y===this.options.textNodeName){let m=this.options.tagValueProcessor(y,""+a[y]);f+=this.replaceEntitiesValue(m)}else f+=this.buildTextValNode(a[y],y,"",l)}else if(Array.isArray(a[y])){const w=a[y].length;let m="",T="";for(let v=0;v<w;v++){const g=a[y][v];if(!(typeof g>"u"))if(g===null)y[0]==="?"?f+=this.indentate(l)+"<"+y+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+y+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const h=this.j2x(g,l+1,u.concat(y));m+=h.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(T+=h.attrStr)}else m+=this.processTextOrObjNode(g,y,l,u);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(y,g);h=this.replaceEntitiesValue(h),m+=h}else m+=this.buildTextValNode(g,y,"",l)}this.options.oneListGroup&&(m=this.buildObjectNode(m,y,T,l)),f+=m}else if(this.options.attributesGroupName&&y===this.options.attributesGroupName){const w=Object.keys(a[y]),m=w.length;for(let T=0;T<m;T++)c+=this.buildAttrPairStr(w[T],""+a[y][w[T]])}else f+=this.processTextOrObjNode(a[y],y,l,u);return{attrStr:c,val:f}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function o(a,l,u,c){const f=this.j2x(a,u+1,c.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,f.attrStr,u):this.buildObjectNode(f.val,l,f.attrStr,u)}r.prototype.buildObjectNode=function(a,l,u,c){if(a==="")return l[0]==="?"?this.indentate(c)+"<"+l+u+"?"+this.tagEndChar:this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar;{let f="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",f=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(c)+"<"+l+u+d+">"+a+f:this.options.commentPropName!==!1&&l===this.options.commentPropName&&d.length===0?this.indentate(c)+`<!--${a}-->`+this.newLine:this.indentate(c)+"<"+l+u+d+this.tagEndChar+a+this.indentate(c)+f}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,u,c){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(c)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(c)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(c)+"<"+l+u+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(l,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar:this.indentate(c)+"<"+l+u+">"+f+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const u=this.options.entities[l];a=a.replace(u.regex,u.val)}return a};function i(a){return this.options.indentBy.repeat(a)}function s(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return af=r,af}var lf,qy;function Z_(){if(qy)return lf;qy=1;const e=Fy(),t=X_(),n=J_();return lf={XMLParser:t,XMLValidator:e,XMLBuilder:n},lf}Z_();class Vy{isEnabled(){return!0}isActive(t){return _n(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,clientService:{webdav:r}}=t;return un.useTask(function*(o,i,s){n.clearResourceList(),n.setAncestorMetaData({});const{resource:a,children:l}=yield r.listFiles(s,{},{depth:1,davProperties:vs.Trashbin,isTrash:!0,signal:o});n.initResourceList({currentFolder:a,resources:l})})}}class zy{constructor(){Se(this,"loaders");this.loaders=[new zh,new Wh,new Hh,new Gh,new Kh,new Vy]}getTask(){const t=vt(),n=lt(),r=nn(),o=We(),i=Je(),s=at(),a=Xe(),l=jt(),u=bf(),c=this.loaders.find(f=>f.isEnabled()&&f.isActive(p(o)));if(!c){console.debug("No folder loader found for route");return}return un.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:l,router:o,authService:u};try{yield c.getTask(d).perform(...f)}catch(y){console.error(y)}})}}const Wy=new zy;var Or=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Or||{});const eI=200;class tI{constructor(){Se(this,"tasks",[])}get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,o)=>(r+=o.state.current/o.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=eI,indeterminate:r=!0}={}){const o={id:Xt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),Tt.debounce(()=>{o.active=!0,Ye.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:l})=>{r||this.setProgress({task:o,total:a,current:l})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Ye.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Ye.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var nI="__lodash_hash_undefined__";function rI(e){return this.__data__.set(e,nI),this}function iI(e){return this.__data__.has(e)}function Ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new gr;++t<n;)this.add(e[t])}Ls.prototype.add=Ls.prototype.push=rI,Ls.prototype.has=iI;function oI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function sI(e,t){return e.has(t)}var aI=1,lI=2;function Hy(e,t,n,r,o,i){var s=n&aI,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var f=-1,d=!0,y=n&lI?new Ls:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var w=e[f],m=t[f];if(r)var T=s?r(m,w,f,t,e,i):r(w,m,f,e,t,i);if(T!==void 0){if(T)continue;d=!1;break}if(y){if(!oI(t,function(v,g){if(!sI(y,g)&&(w===v||o(w,v,n,r,i)))return y.push(g)})){d=!1;break}}else if(!(w===m||o(w,m,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function cI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function uI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var fI=1,dI=2,pI="[object Boolean]",hI="[object Date]",gI="[object Error]",mI="[object Map]",yI="[object Number]",bI="[object RegExp]",vI="[object Set]",wI="[object String]",SI="[object Symbol]",EI="[object ArrayBuffer]",TI="[object DataView]",Gy=Pn?Pn.prototype:void 0,cf=Gy?Gy.valueOf:void 0;function AI(e,t,n,r,o,i,s){switch(n){case TI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case EI:return!(e.byteLength!=t.byteLength||!i(new us(e),new us(t)));case pI:case hI:case yI:return eo(+e,+t);case gI:return e.name==t.name&&e.message==t.message;case bI:case wI:return e==t+"";case mI:var a=cI;case vI:var l=r&fI;if(a||(a=uI),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=dI,s.set(e,t);var c=Hy(a(e),a(t),r,o,i,s);return s.delete(e),c;case SI:if(cf)return cf.call(e)==cf.call(t)}return!1}function uf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Ky(e,t,n){var r=t(e);return Fn(e)?r:uf(r,n(e))}function RI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}function Qy(){return[]}var _I=Object.prototype,II=_I.propertyIsEnumerable,Xy=Object.getOwnPropertySymbols,Yy=Xy?function(e){return e==null?[]:(e=Object(e),RI(Xy(e),function(t){return II.call(e,t)}))}:Qy;function CI(e){return oo(e)?Xp(e):Mh(e)}function Jy(e){return Ky(e,CI,Yy)}var PI=1,FI=Object.prototype,OI=FI.hasOwnProperty;function xI(e,t,n,r,o,i){var s=n&PI,a=Jy(e),l=a.length,u=Jy(t),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in t:OI.call(t,d)))return!1}var y=i.get(e),w=i.get(t);if(y&&w)return y==t&&w==e;var m=!0;i.set(e,t),i.set(t,e);for(var T=s;++f<l;){d=a[f];var v=e[d],g=t[d];if(r)var h=s?r(g,v,d,t,e,i):r(v,g,d,e,t,i);if(!(h===void 0?v===g||o(v,g,n,r,i):h)){m=!1;break}T||(T=d=="constructor")}if(m&&!T){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(e),i.delete(t),m}var kI=1,Zy="[object Arguments]",eb="[object Array]",Ms="[object Object]",NI=Object.prototype,tb=NI.hasOwnProperty;function $I(e,t,n,r,o,i){var s=Fn(e),a=Fn(t),l=s?eb:Nn(e),u=a?eb:Nn(t);l=l==Zy?Ms:l,u=u==Zy?Ms:u;var c=l==Ms,f=u==Ms,d=l==u;if(d&&Si(e)){if(!Si(t))return!1;s=!0,c=!1}if(d&&!c)return i||(i=new Xn),s||ds(e)?Hy(e,t,n,r,o,i):AI(e,t,l,n,r,o,i);if(!(n&kI)){var y=c&&tb.call(e,"__wrapped__"),w=f&&tb.call(t,"__wrapped__");if(y||w){var m=y?e.value():e,T=w?t.value():t;return i||(i=new Xn),o(m,T,n,r,i)}}return d?(i||(i=new Xn),xI(e,t,n,r,o,i)):!1}function nb(e,t,n,r,o){return e===t?!0:e==null||t==null||!Yn(e)&&!Yn(t)?e!==e&&t!==t:$I(e,t,n,r,nb,o)}function rb(e,t){return nb(e,t)}const ff=(e="")=>e.split("/").map(encodeURIComponent).join("/"),DI=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{fl(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class LI{constructor({clientService:t,userStore:n,authStore:r,capabilityStore:o,configStore:i}){Se(this,"clientService");Se(this,"configStore");Se(this,"userStore");Se(this,"authStore");Se(this,"capabilityStore");Se(this,"capability");this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","text/plain","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,n=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(n?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(n=>n.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,n=!1,r=!0,o){const{space:i,resource:s}=t,a=this.available&&this.isMimetypeSupported(s.mimeType),l=s.type!=="folder"&&s.extension&&s.canDownload();if(!a||!l)return;const u=te.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(c){if(r)return;throw c}}}async cacheFactory(t,n,r){const{resource:o,dimensions:i}=t,s=Ul.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&rb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return Ul.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return D0.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,o){var u,c;const{resource:i,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,o);const l=[this.configStore.serverUrl,"remote.php/dav",ff(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(l,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((c=(u=f.response)==null?void 0:u.headers)==null?void 0:c["retry-after"])||5;return await new Promise(y=>setTimeout(y,d*1e3)),this.privatePreviewBlob(t,n,r,o)}throw f}}async publicPreviewUrl(t,n){var c,f;const{resource:r,dimensions:o,processor:i}=t,[s,a]=r.downloadURL.split("?"),l=[this.buildQueryString({etag:r.etag,dimensions:o,processor:i}),a].filter(Boolean).join("&"),u=[s,l].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const y=((f=(c=d.response)==null?void 0:c.headers)==null?void 0:f["retry-after"])||5;return await new Promise(w=>setTimeout(w,y*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const Bs=be.z.enum(["fit","resize","fill","thumbnail"]);class MI{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class BI{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!Tt.isObject(t))throw new Error("options should be an object");if(!Tt.isNumber(t.minLength)||Tt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Tt.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class js{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!Tt.isObject(t))throw new Error("options should be an object");if(!Tt.isNumber(t.minLength)||Tt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class jI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class UI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class qI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class VI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var df={},ib;function zI(){if(ib)return df;ib=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",a="",l=i.length,u=i.lowercase,c=i.uppercase,f=i.numbers,d=i.symbols,y=i.minLengthLowercase,w=i.minLengthUppercase,m=i.minLengthNumbers,T=i.minLengthSymbols,v=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,v);var h="ABCDEFGHIJKLMNOPQRSTUVWXYZ";h=n(h,v);var b="0123456789";b=n(b,v);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,v);for(var E=g.length,_=0;_<y;_++)a+=g.charAt(e(E));for(E=h.length,_=0;_<w;_++)a+=h.charAt(e(E));for(E=b.length,_=0;_<m;_++)a+=b.charAt(e(E));for(E=S.length,_=0;_<T;_++)a+=S.charAt(e(E));s+=function($){for(var L=$.split(""),k=L.length-1;k>0;k--){var N=Math.floor(Math.random()*(k+1)),z=L[k];L[k]=L[N],L[N]=z}return L.join("")}(a);var R="";R=u?R+g:R,R=c?R+h:R,R=f?R+b:R,R=d?R+S:R;var A=l-s.length;for(E=R.length,_=0;_<A;_++)s+=R.charAt(e(E));return s},n=function(i,s){return s==null||s.split("").forEach(function(a){i=i.replace(a,"")}),i},r=function(i){var s=i.length,a=i.lowercase,l=i.uppercase,u=i.numbers,c=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(a==0&&l==0&&u==0&&c==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return df.GeneratePassword=function(i){return i?(i=o(i),r(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),r(i),t(i))},df}var WI=zI();class HI{constructor({language:t}){Se(this,"language");Se(this,"capability");Se(this,"policy");Se(this,"generatePasswordRules");this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new jI({...this.language}),mustNotBeEmpty:new MI({...this.language}),atLeastUppercaseCharacters:new UI({...this.language}),atLeastLowercaseCharacters:new qI({...this.language}),atLeastDigits:new VI({...this.language}),mustContain:new BI({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new L0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return WI.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function GI(e){return e.charCodeAt(0).toString(32)}function ob(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${GI(n)}`,"/"))+t}function sb(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${ob(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${ob(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class KI{constructor({language:t}){Se(this,"uppy");Se(this,"uploadInputs",[]);Se(this,"uploadFolderMap",{});Se(this,"getRelativeFilePath",t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?te.urlJoin(n):void 0});const{$gettext:n}=t;this.uppy=new M0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=sb(r,this.uppy.getID()),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:o,headers:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,c,f,d)=>{var y,w;return((y=u==null?void 0:u.originalResponse)==null?void 0:y.getStatus())>=500?!1:((w=u==null?void 0:u.originalResponse)==null?void 0:w.getStatus())===401?!0:d(u)}},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const l=this.uppy.getPlugin("Tus");if(l){l.setOptions(s);return}this.uppy.use(B0,s)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(j0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(U0,{target:t,onDragOver:n=>{this.publish("drag-over",n)},onDragLeave:n=>{this.publish("drag-out",n)},onDrop:n=>{this.publish("drop",n)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Ye.subscribe(t,n)}unsubscribe(t,n){Ye.unsubscribe(t,n)}publish(t,n){Ye.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{this.publish("uploadCompleted",t),t.successful.forEach(n=>{this.uppy.removeFile(n.id)}),this.clearInputs()}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const o=r.target,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return sb(t,this.uppy.getID())}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function QI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var XI=Object.getOwnPropertySymbols,YI=XI?function(e){for(var t=[];e;)uf(t,Yy(e)),e=ul(e);return t}:Qy;function ab(e){return Ky(e,gl,YI)}var JI=Object.prototype,ZI=JI.hasOwnProperty;function eC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ZI.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function tC(e,t){var n=cl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var nC=/\w*$/;function rC(e){var t=new e.constructor(e.source,nC.exec(e));return t.lastIndex=e.lastIndex,t}var lb=Pn?Pn.prototype:void 0,cb=lb?lb.valueOf:void 0;function iC(e){return cb?Object(cb.call(e)):{}}var oC="[object Boolean]",sC="[object Date]",aC="[object Map]",lC="[object Number]",cC="[object RegExp]",uC="[object Set]",fC="[object String]",dC="[object Symbol]",pC="[object ArrayBuffer]",hC="[object DataView]",gC="[object Float32Array]",mC="[object Float64Array]",yC="[object Int8Array]",bC="[object Int16Array]",vC="[object Int32Array]",wC="[object Uint8Array]",SC="[object Uint8ClampedArray]",EC="[object Uint16Array]",TC="[object Uint32Array]";function AC(e,t,n){var r=e.constructor;switch(t){case pC:return cl(e);case oC:case sC:return new r(+e);case hC:return tC(e);case gC:case mC:case yC:case bC:case vC:case wC:case SC:case EC:case TC:return $p(e,n);case aC:return new r;case lC:case fC:return new r(e);case cC:return rC(e);case uC:return new r;case dC:return iC(e)}}var RC="[object Map]";function _C(e){return Yn(e)&&Nn(e)==RC}var ub=Ei&&Ei.isMap,IC=ub?dl(ub):_C,CC="[object Set]";function PC(e){return Yn(e)&&Nn(e)==CC}var fb=Ei&&Ei.isSet,FC=fb?dl(fb):PC,OC=1,db="[object Arguments]",xC="[object Array]",kC="[object Boolean]",NC="[object Date]",$C="[object Error]",pb="[object Function]",DC="[object GeneratorFunction]",LC="[object Map]",MC="[object Number]",hb="[object Object]",BC="[object RegExp]",jC="[object Set]",UC="[object String]",qC="[object Symbol]",VC="[object WeakMap]",zC="[object ArrayBuffer]",WC="[object DataView]",HC="[object Float32Array]",GC="[object Float64Array]",KC="[object Int8Array]",QC="[object Int16Array]",XC="[object Int32Array]",YC="[object Uint8Array]",JC="[object Uint8ClampedArray]",ZC="[object Uint16Array]",eP="[object Uint32Array]",mt={};mt[db]=mt[xC]=mt[zC]=mt[WC]=mt[kC]=mt[NC]=mt[HC]=mt[GC]=mt[KC]=mt[QC]=mt[XC]=mt[LC]=mt[MC]=mt[hb]=mt[BC]=mt[jC]=mt[UC]=mt[qC]=mt[YC]=mt[JC]=mt[ZC]=mt[eP]=!0,mt[$C]=mt[pb]=mt[VC]=!1;function Us(e,t,n,r,o,i){var s,a=t&OC;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!Qn(e))return e;var l=Fn(e);if(l)s=eC(e);else{var u=Nn(e),c=u==pb||u==DC;if(Si(e))return Np(e,a);if(u==hb||u==db||c&&!o)s={};else{if(!mt[u])return o?e:{};s=AC(e,u,a)}}i||(i=new Xn);var f=i.get(e);if(f)return f;i.set(e,s),FC(e)?e.forEach(function(w){s.add(Us(w,t,n,w,e,i))}):IC(e)&&e.forEach(function(w,m){s.set(m,Us(w,t,n,m,e,i))});var d=ab,y=l?void 0:d(e);return QI(y||e,function(w,m){y&&(m=w,w=e[m]),Gp(s,m,Us(w,t,n,m,e,i))}),s}function tP(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}function nP(e,t){return t.length<2?e:gh(e,tP(t,0,-1))}function rP(e,t){return t=_l(t,e),e=nP(e,t),e==null||delete e[hh(nd(t))]}function iP(e){return fl(e)?void 0:e}var gb=Pn?Pn.isConcatSpreadable:void 0;function oP(e){return Fn(e)||io(e)||!!(gb&&e&&e[gb])}function sP(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=oP),o||(o=[]);++i<s;){var a=e[i];n(a)?uf(o,a):o[o.length]=a}return o}function aP(e){var t=e==null?0:e.length;return t?sP(e):[]}function lP(e){return th(eh(e,void 0,aP),e+"")}var cP=1,uP=2,fP=4,ki=lP(function(e,t){var n={};if(e==null)return n;var r=!1;t=uh(t,function(i){return i=_l(i,e),r||(r=i.length>1),i}),Kp(e,ab(e),n),r&&(n=Us(n,cP|uP|fP,iP));for(var o=t.length;o--;)rP(n,t[o]);return n});const dP=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:Xt.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:ki(e.query,"fileId","page")},isStaticNav:!1}))},pP=(...e)=>{const t=e.pop();return[...e,{id:Xt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Ye.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ti{}Se(ti,"Cut","cut"),Se(ti,"Copy","copy");const pf=e=>e.clientY===0,wo=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=pf(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!pf(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!pf(t)?t.clientX:r.x})}),e.show()},qs=e=>(e||"").split("_")[0],ni=(e,t,n=Dt.DateTime.DATETIME_MED)=>e.setLocale(qs(t)).toLocaleString(n),mb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromJSDate(e),t,n),hP=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromHTTP(e),t,n),yb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromISO(e),t,n),gP=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromRFC2822(e),t,n),So=(e,t)=>e.setLocale(qs(t)).toRelative(),bb=(e,t)=>So(Dt.DateTime.fromJSDate(e),t),mP=(e,t)=>So(Dt.DateTime.fromHTTP(e),t),yP=(e,t)=>So(Dt.DateTime.fromISO(e),t),bP=(e,t)=>So(Dt.DateTime.fromRFC2822(e),t),vP=1048576,Sn=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":$0.filesize(n,{round:n<vP?0:1,locale:qs(t),base:10,output:"string"})};function vb(e="",t=!1){const n=te.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],o=n.split("/");for(t&&r.push(n),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}r.push(o.join("/")),o.pop()}return r}var yt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(yt||{});const hf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=le(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return wt(()=>p(r),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},ri=()=>{const e=at(),t=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),n=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),r=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),a=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),l=j(()=>{var d;return p(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:l,fileTypes:s,postMessage:(d,y)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:d,data:y},w)},verifyDelegatedAuthenticationOrigin:d=>p(u)?p(u)===d:!0}},wb=e=>{const{isEnabled:t}=ri(),n=(e==null?void 0:e.bus)||Ye,r=hf("oc_sideBarOpen",!1),o=le(!1),i=j({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await jn();const w=document.getElementById("app-sidebar");w&&w.focus()},a=le(null),l=n.subscribe(yt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(yt.close,()=>{i.value=!1,a.value=null}),c=n.subscribe(yt.open,()=>{i.value=!0,a.value=null,s()}),f=n.subscribe(yt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),d=n.subscribe(yt.setActivePanel,w=>{a.value=w});Un(()=>{n.unsubscribe(yt.toggle,l),n.unsubscribe(yt.close,u),n.unsubscribe(yt.open,c),n.unsubscribe(yt.openWithPanel,f),n.unsubscribe(yt.setActivePanel,d)});const y=(w,m)=>{n.subscribe(yt.setActivePanel,T=>{w===T&&setTimeout(()=>{m(T)},100)})};return{isSideBarOpen:lr(i),sideBarActivePanel:lr(a),onPanelActive:y}},tr=e=>e,Sb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.authenticated,e??[]),Eb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.unauthenticated,e??[]),wP=({isDirect:e})=>tr(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),SP=({isDirect:e})=>tr(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),EP=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:wP({isDirect:t}),label:tr("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Ye.publish(yt.openWithPanel,"sharing#peopleShares")}}),TP=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:SP({isDirect:t}),label:tr("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Ye.publish(yt.openWithPanel,"sharing#linkShares")}}),AP=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:tr("Item locked"),label:tr("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),RP=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:tr("Item in processing"),label:tr("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),Tb=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(AP({resource:t})),t.processing&&o.push(RP({resource:t})),te.isProjectSpaceResource(e)&&e.isMember(r)||te.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,c)=>(u.push(...c.shareTypes||[]),u),[]),a=Sb(t.shareTypes);(a||Sb(s))&&o.push(EP({resource:t,isDirect:a}));const l=Eb(t.shareTypes);(l||Eb(s))&&o.push(TP({resource:t,isDirect:l}))}return o},Ab=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Rb=e=>new Promise(t=>e.toBlob(t)),it=Ge.defineStore("messages",()=>{const e=le([]),t=i=>{const s={...i,id:Xt.v4()};return e.value.push(s),s},n=i=>{const s=a=>{var l,u;return(u=(l=a.response)==null?void 0:l.headers)==null?void 0:u.get("x-request-id")};return i.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
|
|
51
|
-
`)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:Xt.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:n(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=p(e).filter(({id:s})=>i.id!==s)}}}),Eo=Ge.defineStore("clipboard",()=>{const{$gettext:e}=xe.useGettext(),{showMessage:t}=it(),n=le(),r=le([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ti.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ti.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),_b={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},at=Ge.defineStore("config",()=>{const e=Zn(),t=le(""),n=le(""),r=le({..._b}),o=le([]),i=le([]),s=le([]),a=le(),l=le(),u=le(),c=le([]),f=le([]),d=j(()=>te.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),y=j(()=>!!p(a)),w=j(()=>!!p(l));return{options:r,oAuth2:a,openIdConnect:l,isOAuth2:y,isOIDC:w,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:n,scripts:c,styles:f,serverUrl:d,loadConfig:T=>{var v;T.server&&(t.value=(v=T.server)!=null&&v.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],s.value=T.customTranslations||[],a.value=T.auth,l.value=T.openIdConnect,u.value=T.sentry,c.value=T.scripts||[],f.value=T.styles||[],n.value=T.theme,T.options&&(r.value=ao({..._b},T.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),T.external_apps&&(i.value=T.external_apps,T.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),_P=be.z.object({url:be.z.string()}),IP=be.z.object({apiUrl:be.z.string().optional(),authUrl:be.z.string().optional(),clientId:be.z.string().optional(),clientSecret:be.z.string().optional(),logoutUrl:be.z.string().optional(),metaDataUrl:be.z.string().optional(),url:be.z.string().optional()}),CP=be.z.object({authority:be.z.string().optional(),client_id:be.z.string().optional(),client_secret:be.z.string().optional(),dynamic:be.z.string().optional(),metadata_url:be.z.string().optional(),post_logout_redirect_uri:be.z.string().optional(),response_type:be.z.string().optional(),scope:be.z.string().optional()}).passthrough(),PP=be.z.record(be.z.any()),FP=be.z.object({href:be.z.string().optional()}),OP=be.z.object({async:be.z.boolean().optional(),src:be.z.string().optional()}),xP=be.z.object({cernFeatures:be.z.boolean().optional(),concurrentRequests:be.z.object({resourceBatchActions:be.z.number().optional(),sse:be.z.number().optional(),shares:be.z.object({create:be.z.number().optional(),list:be.z.number().optional()}).optional()}).optional(),contextHelpers:be.z.boolean().optional(),contextHelpersReadMore:be.z.boolean().optional(),defaultExtension:be.z.string().optional(),disabledExtensions:be.z.array(be.z.string()).optional(),disableFeedbackLink:be.z.boolean().optional(),accountEditLink:be.z.object({href:be.z.string().optional()}).optional(),editor:be.z.object({autosaveEnabled:be.z.boolean().optional(),autosaveInterval:be.z.number().optional(),openAsPreview:be.z.union([be.z.boolean(),be.z.array(be.z.string())]).optional()}).optional(),embed:be.z.object({enabled:be.z.boolean().optional(),target:be.z.string().optional(),messagesOrigin:be.z.string().optional(),delegateAuthentication:be.z.boolean().optional(),delegateAuthenticationOrigin:be.z.string().optional(),fileTypes:be.z.array(be.z.string()).optional(),chooseFileName:be.z.boolean().optional(),chooseFileNameSuggestion:be.z.string().optional()}).optional(),feedbackLink:be.z.object({ariaLabel:be.z.string().optional(),description:be.z.string().optional(),href:be.z.string().optional()}).optional(),isRunningOnEos:be.z.boolean().optional(),loginUrl:be.z.string().optional(),logoutUrl:be.z.string().optional(),ocm:be.z.object({openRemotely:be.z.boolean().optional()}).optional(),routing:be.z.object({fullShareOwnerPaths:be.z.boolean().optional(),idBased:be.z.boolean().optional()}).optional(),runningOnEos:be.z.boolean().optional(),tokenStorageLocal:be.z.boolean().optional(),upload:be.z.object({companionUrl:be.z.string().optional()}).optional(),userListRequiresFilter:be.z.boolean().optional(),hideLogo:be.z.boolean().optional()}),kP=be.z.object({id:be.z.string(),path:be.z.string(),config:be.z.record(be.z.unknown()).optional()}),NP=be.z.object({server:be.z.string(),theme:be.z.string(),options:xP,apps:be.z.array(be.z.string()).optional(),external_apps:be.z.array(kP).optional(),customTranslations:be.z.array(_P).optional(),auth:IP.optional(),openIdConnect:CP.optional(),sentry:PP.optional(),scripts:be.z.array(OP).optional(),styles:be.z.array(FP).optional()}),Ib=Ge.defineStore("extensionPreferences",()=>{const e=jr.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(p(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Ni=Ge.defineStore("extensionRegistry",()=>{const e=at(),t=le([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(c=>le(p(c).filter(({id:f})=>!u.includes(f)))).filter(c=>p(c).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return p(t).flatMap(c=>p(c).filter(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=le([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=p(i).map(c=>le(p(c).filter(({id:f})=>!u.includes(f)))).filter(c=>p(c).length)},getExtensionPoints:(u={})=>p(i).flatMap(c=>p(c).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),bt=Ge.defineStore("modals",()=>{const e=le([]),t=j(()=>p(e).at(-1)),n=l=>p(e).find(u=>u.id===l);return{modals:e,activeModal:t,dispatchModal:l=>{const u={...l,id:Xt.v4()};return e.value.push(u),u},updateModal:(l,u,c)=>{const f=n(l);f[u]=c},removeModal:l=>{e.value=p(e).filter(u=>u.id!==l)},removeAllModals:()=>{e.value=[]},setModalActive:l=>{const u=p(e).findIndex(f=>f.id===l);if(u<0)return;const c=n(l);p(e).splice(u,1),e.value.push(c)}}}),vt=Ge.defineStore("user",()=>{const e=le();return{user:e,setUser:r=>{e.value=r,V0.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Vs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},$P="thead-clicked",DP="highlight",LP="rowMounted",MP="contextmenuClicked",Cb="itemDropped",BP="itemDragged",jP=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"],UP={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function xr(e){return UP[e]}let Pb=0;const Fb=(e="")=>(e=e||"",Pb+=1,e+Pb);function qP(e,t,n,r){for(var o=-1,i=e==null?0:e.length;++o<i;)n=t(n,e[o],o,e);return n}function VP(e){return function(t){return e==null?void 0:e[t]}}var zP={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},WP=VP(zP),HP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,GP="\\u0300-\\u036f",KP="\\ufe20-\\ufe2f",QP="\\u20d0-\\u20ff",XP=GP+KP+QP,YP="["+XP+"]",JP=RegExp(YP,"g");function ZP(e){return e=Rl(e),e&&e.replace(HP,WP).replace(JP,"")}var eF=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function tF(e){return e.match(eF)||[]}var nF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function rF(e){return nF.test(e)}var Ob="\\ud800-\\udfff",iF="\\u0300-\\u036f",oF="\\ufe20-\\ufe2f",sF="\\u20d0-\\u20ff",aF=iF+oF+sF,xb="\\u2700-\\u27bf",kb="a-z\\xdf-\\xf6\\xf8-\\xff",lF="\\xac\\xb1\\xd7\\xf7",cF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uF="\\u2000-\\u206f",fF=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nb="A-Z\\xc0-\\xd6\\xd8-\\xde",dF="\\ufe0e\\ufe0f",$b=lF+cF+uF+fF,Db="['’]",Lb="["+$b+"]",pF="["+aF+"]",Mb="\\d+",hF="["+xb+"]",Bb="["+kb+"]",jb="[^"+Ob+$b+Mb+xb+kb+Nb+"]",gF="\\ud83c[\\udffb-\\udfff]",mF="(?:"+pF+"|"+gF+")",yF="[^"+Ob+"]",Ub="(?:\\ud83c[\\udde6-\\uddff]){2}",qb="[\\ud800-\\udbff][\\udc00-\\udfff]",$i="["+Nb+"]",bF="\\u200d",Vb="(?:"+Bb+"|"+jb+")",vF="(?:"+$i+"|"+jb+")",zb="(?:"+Db+"(?:d|ll|m|re|s|t|ve))?",Wb="(?:"+Db+"(?:D|LL|M|RE|S|T|VE))?",Hb=mF+"?",Gb="["+dF+"]?",wF="(?:"+bF+"(?:"+[yF,Ub,qb].join("|")+")"+Gb+Hb+")*",SF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",EF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",TF=Gb+Hb+wF,AF="(?:"+[hF,Ub,qb].join("|")+")"+TF,RF=RegExp([$i+"?"+Bb+"+"+zb+"(?="+[Lb,$i,"$"].join("|")+")",vF+"+"+Wb+"(?="+[Lb,$i+Vb,"$"].join("|")+")",$i+"?"+Vb+"+"+zb,$i+"+"+Wb,EF,SF,Mb,AF].join("|"),"g");function _F(e){return e.match(RF)||[]}function IF(e,t,n){return e=Rl(e),t=t,t===void 0?rF(e)?_F(e):tF(e):e.match(t)||[]}var CF="['’]",PF=RegExp(CF,"g");function FF(e){return function(t){return qP(IF(ZP(t).replace(PF,"")),e,"")}}var Kb=FF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Qb=be.z.object({name:be.z.string().optional(),slogan:be.z.string().optional(),logo:be.z.string().optional(),urls:be.z.object({accessDeniedHelp:be.z.string(),imprint:be.z.string(),privacy:be.z.string()}).optional(),shareRoles:be.z.record(be.z.string(),be.z.object({iconName:be.z.string()})).optional()}),OF=be.z.object({breakpoints:be.z.record(be.z.string()).optional(),roles:be.z.record(be.z.string()).optional(),colorPalette:be.z.record(be.z.string()).optional(),fontFamily:be.z.string().optional(),fontSizes:be.z.record(be.z.string()).optional(),sizes:be.z.record(be.z.string()).optional(),spacing:be.z.record(be.z.string()).optional()}),Xb=Qb.extend({designTokens:OF.optional(),favicon:be.z.string().optional(),background:be.z.string().optional()}),xF=Xb.extend({isDark:be.z.boolean(),label:be.z.string()}),Yb=be.z.object({defaults:Xb,themes:be.z.array(xF)}),kF=be.z.object({common:Qb.optional(),clients:be.z.object({web:Yb})}),NF="oc_currentThemeName",ii=Ge.defineStore("theme",()=>{const e=jr.useLocalStorage(NF,null),t=jr.usePreferredDark(),n=le(),r=le([]),o=c=>{const f=td(c.common,c.clients.web.defaults);r.value=c.clients.web.themes.map(d=>td(f,d)),i()},i=()=>{const c=p(r).find(d=>!d.isDark),f=p(r).find(d=>d.isDark);l(p(r).find(d=>d.label===p(e))||(p(t)?f:c)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=j(()=>e.value===null),l=(c,f=!0)=>{var y,w,m,T,v,g;n.value=c,f&&(e.value=p(n).label);const d=[{name:"breakpoints",prefix:"breakpoint"},{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Vs("font-family",p(n).designTokens.fontFamily),d.forEach(h=>{for(const b in p(n).designTokens[h.name])Vs(`${h.prefix}-${Kb(b)}`,p(n).designTokens[h.name][b])}),(w=(y=p(n).designTokens)==null?void 0:y.roles)!=null&&w.chrome||(Vs("role-chrome",(T=(m=p(n).designTokens)==null?void 0:m.roles)==null?void 0:T.surfaceContainer),Vs("role-on-chrome",(g=(v=p(n).designTokens)==null?void 0:v.roles)==null?void 0:g.onSurface))};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:l,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:c=>{var f;return((f=p(n).shareRoles[c.id])==null?void 0:f.iconName)||"user"}}}),jt=Ge.defineStore("shares",()=>{const e=Xe(),{getRoleIcon:t}=ii(),n=le(!1),r=le([]),o=le([]),i=le({}),s=R=>{i.value=R.reduce((A,$)=>(A[$.id]={...$,icon:t($)},A),{})},a=R=>{const A=p(r).find(({id:$})=>$===R.id);if(A){Object.assign(A,R);return}p(r).push(R)},l=R=>{r.value=R},u=R=>{p(r).push(...R)},c=R=>{r.value=p(r).filter(({id:A})=>A!==R.id)},f=()=>{r.value=[],o.value=[],n.value=void 0},d=()=>{const R=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!R.length){r.value=[],o.value=[];return}p(r).forEach(A=>{R.includes(A.resourceId)||c(A)}),p(o).forEach(A=>{R.includes(A.resourceId)||m(A)})},y=R=>{o.value=R},w=R=>{const A=p(o).find(({id:$})=>$===R.id);if(A){Object.assign(A,R);return}p(o).push(R)},m=R=>{o.value=p(o).filter(({id:A})=>A!==R.id)},T=R=>{n.value=R},v=R=>{const A=N=>{const z=new Set;return N.forEach(Q=>{z.add(Q.shareType)}),Array.from(z)},$=[...e.resources,e.currentFolder].find(N=>(N==null?void 0:N.id)===R);if(!$||te.isProjectSpaceResource($))return;const L=[...p(r),...p(o)];e.updateResourceField({id:$.id,field:"shareTypes",value:A(L.filter(N=>!N.indirect))});const k=e.getAncestorById(R);k&&e.updateAncestorField({path:k.path,field:"shareTypes",value:A(L.filter(N=>!N.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:T,setCollaboratorShares:l,setLinkShares:y,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:R,space:A,resource:$,options:L})=>{const N=await R.graphAuthenticated.permissions.createInvite(A.id,$.id,L,p(i));return u([N]),v($.id),N},updateShare:async({clientService:R,space:A,resource:$,collaboratorShare:L,options:k})=>{const N=R.graphAuthenticated.permissions,z={roles:k.roles,expirationDateTime:k.expirationDateTime},Q=await N.updatePermission(A.id,$.id,L.id,z,p(i));return a(Q),Q},deleteShare:async({clientService:R,space:A,resource:$,collaboratorShare:L})=>{await R.graphAuthenticated.permissions.deletePermission(A.id,$.id,L.id),c(L),v($.id)},addLink:async({clientService:R,space:A,resource:$,options:L})=>{const N=await R.graphAuthenticated.permissions.createLink(A.id,$.id,L),z=e.selectedResources,Q=z.some(({fileId:J})=>J===$.fileId)||z.length===0&&e.currentFolder.fileId===$.fileId;if(w(N),v($.id),!Q){const J=e.ancestorMetaData[$.path]??null;if(J){const{shareTypes:ae}=J;ae.includes(te.ShareTypes.link.value)||e.updateAncestorField({path:J.path,field:"shareTypes",value:[...ae,te.ShareTypes.link.value]})}}return N},updateLink:async({clientService:R,space:A,resource:$,linkShare:L,options:k})=>{const N=R.graphAuthenticated.permissions;let z;if(Object.hasOwn(k,"password"))z=await N.setPermissionPassword(A.id,$.id,L.id,{password:k.password}),L.hasPassword=!!k.password;else{const Q={link:{...k.type&&{type:k.type},...k.displayName&&{"@libre.graph.displayName":k.displayName}},...Object.hasOwn(k,"expirationDateTime")&&{expirationDateTime:k.expirationDateTime}};z=await N.updatePermission(A.id,$.id,L.id,Q)}return w(z),z},deleteLink:async({clientService:R,space:A,resource:$,linkShare:L})=>{await R.graphAuthenticated.permissions.deletePermission(A.id,$.id,L.id),m(L),v($.id)}}}),Jb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),To=async({graphClient:e,driveType:t,configStore:n,graphRoles:r,signal:o})=>{var l;const i=await e.drives.listMyDrives(r,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((l=n.options.routing)!=null&&l.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:c,driveAlias:f}=u.root.remoteItem;s[c]=f});const a=Object.entries(s).map(([u,c])=>te.buildSpace({id:te.extractStorageId(u),name:c,driveType:c.split("/")[0],driveAlias:c,path:"/",serverUrl:n.serverUrl},r));return[...i,...a]},lt=Ge.defineStore("spaces",()=>{const e=vt(),t=at(),n=jt(),r=le([]),o=le(),i=le(!1),s=le(!1),a=le(!1),l=le(null),u=le([]),c=le([]),f=j(()=>p(r).find(re=>te.isPersonalSpaceResource(re)&&re.isOwner(e.user))),d=re=>{i.value=re},y=re=>{s.value=re},w=re=>{a.value=re},m=re=>{o.value=re},T=re=>{l.value=re},v=re=>{if(!te.isProjectSpaceResource(re))return[];const se=n.collaboratorShares.filter(ue=>ue.resourceId===re.id);return Jb(se)},g=re=>{p(r).push(...re)},h=re=>{r.value=p(r).filter(({id:se})=>se!==re.id)},b=re=>p(r).find(se=>re==se.id),S=async({graphClient:re,space:se,signal:ue})=>(await $({graphClient:re,signal:ue}),p(r).find(we=>{var ee,ie;return te.isMountPointSpaceResource(we)&&((ie=(ee=we.root)==null?void 0:ee.remoteItem)==null?void 0:ie.id)===se.id})),E=({driveAliasPrefix:re,id:se,shareName:ue})=>{const we=te.buildShareSpaceResource({driveAliasPrefix:re,id:se,shareName:ue,serverUrl:t.serverUrl});return g([we]),we},_=re=>{const se=p(r).find(({id:ue})=>ue===re.id);if(se){Object.assign(se,re);return}g([re])},R=({id:re,field:se,value:ue})=>{const we=p(r).find(ee=>re===ee.id);we&&(we[se]=ue)},A=async({graphClient:re})=>{a.value=!0;try{const[se,ue]=await Promise.all([To({graphClient:re,driveType:"personal",configStore:t,graphRoles:n.graphRoles}),To({graphClient:re,driveType:"project",configStore:t,graphRoles:n.graphRoles})]);g([...se,...ue]),i.value=!0}finally{a.value=!1}},$=async({graphClient:re,signal:se})=>{if(!p(s))try{const ue=await To({graphClient:re,driveType:"mountpoint",configStore:t,graphRoles:n.graphRoles,signal:se});g(ue)}finally{s.value=!0}};return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:f,defaultSpaceImageBlobURL:l,imagesLoading:u,readmesLoading:c,getSpace:b,createShareSpace:E,setSpacesInitialized:d,setMountPointsInitialized:y,setSpacesLoading:w,setCurrentSpace:m,setDefaultSpaceImageBlobURL:T,getSpaceMembers:v,getMountPointForSpace:S,addSpaces:g,removeSpace:h,upsertSpace:_,updateSpaceField:R,loadSpaces:A,loadMountPoints:$,reloadProjectSpaces:async({graphClient:re,signal:se})=>{const ue=await To({graphClient:re,driveType:"project",configStore:t,graphRoles:n.graphRoles,signal:se});r.value=p(r).filter(we=>!te.isProjectSpaceResource(we)),g(ue)},addToImagesLoading:re=>{p(u).includes(re)||p(u).push(re)},removeFromImagesLoading:re=>{u.value=p(u).filter(se=>se!==re)},purgeImagesLoading:()=>{u.value=[]},addToReadmesLoading:re=>{p(c).includes(re)||p(c).push(re)},removeFromReadmesLoading:re=>{c.value=p(c).filter(se=>se!==re)},purgeReadmesLoading:()=>{c.value=[]}}}),Xe=Ge.defineStore("resources",()=>{const e=at(),t=lt(),n=vt(),r=le([]),o=le(),i=le({}),s=le([]),a=j(()=>{let H=p(r);return p(k)||(H=H.filter(I=>!I.name.startsWith("."))),H}),l=j(()=>{const H=p(r).filter(({type:M})=>M==="file").length,I=p(r).filter(({type:M,name:q})=>M==="file"&&q.startsWith(".")).length,F=p(r).filter(({type:M})=>M==="folder").length,G=p(r).filter(({type:M,name:q})=>M==="folder"&&q.startsWith(".")).length,V=p(r).filter(te.isProjectSpaceResource).length;return{files:H,hiddenFiles:I,folders:F,hiddenFolders:G,spaces:V}}),u=H=>{r.value=H},c=H=>{r.value=p(r).filter(I=>!H.find(({id:F})=>F===I.id))},f=()=>{r.value=[]},d=H=>{const I=p(r).find(({id:F})=>F===H.id);if(I){Object.assign(I,H);return}p(r).push(H)},y=H=>{const I=p(r).filter(F=>!H.some(G=>G.path===F.path));r.value=[...I,...H]},w=({id:H,field:I,value:F})=>{const G=p(r).find(V=>H===V.id);G&&(G[I]=F)},m=H=>{o.value=H},T=()=>{o.value=void 0},v=H=>{r.value=H.resources,o.value=H.currentFolder},g=()=>{r.value=[],o.value=void 0,h.value=[]},h=le([]),b=le(null),S=j(()=>p(r).filter(H=>p(h).includes(H.id))),E=H=>{const I=H.find(F=>!p(h).includes(F));I&&(b.value=I),h.value=H},_=H=>{b.value=H,p(h).includes(H)||p(h).push(H)},R=H=>{b.value=H,p(h).includes(H)&&(h.value=p(h).filter(I=>I!==H))},A=H=>{p(h).includes(H)?R(H):_(H)},$=()=>{h.value=[]},L=H=>{b.value=H},k=le(!0),N=le(!0),z=le(!1),Q=le(!0),J=H=>{k.value=H,window.localStorage.setItem("oc_hiddenFilesShown",H.toString())},ae=H=>{N.value=H,window.localStorage.setItem("oc_fileExtensionsShown",H.toString())},re=H=>{z.value=H,window.localStorage.setItem("oc_webDavDetailsShown",H.toString())},se=H=>{Q.value=H,window.localStorage.setItem("oc_disabledSpacesShown",H.toString())},ue=H=>{i.value=H};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:l,setResources:u,removeResources:c,clearResources:f,upsertResource:d,upsertResources:y,updateResourceField:w,setCurrentFolder:m,clearCurrentFolder:T,initResourceList:v,clearResourceList:g,selectedIds:h,latestSelectedId:b,selectedResources:S,setSelection:E,addSelection:_,removeSelection:R,toggleSelection:A,resetSelection:$,setLastSelectedId:L,areHiddenFilesShown:k,areFileExtensionsShown:N,areWebDavDetailsShown:z,areDisabledSpacesShown:Q,setAreHiddenFilesShown:J,setAreFileExtensionsShown:ae,setAreWebDavDetailsShown:re,setAreDisabledSpacesShown:se,ancestorMetaData:i,setAncestorMetaData:ue,updateAncestorField:({path:H,field:I,value:F})=>{const G=p(i)[H]??null;G&&(G[I]=F)},loadAncestorMetaData:({folder:H,space:I,client:F,signal:G})=>{const V={[H.path]:{id:H.fileId,shareTypes:H.shareTypes,parentFolderId:H.parentFolderId,spaceId:I.id,path:H.path}},M=[],q=[Ue.FileId,Ue.ShareTypes,Ue.FileParent],fe=vb(H.path),Ae=t.spaces,Le=()=>Ae.filter(_e=>te.isMountPointSpaceResource(_e)&&te.extractStorageId(_e.root.remoteItem.rootId)===I.id);let ke=!0;if(e.options.routing.fullShareOwnerPaths){const _e=Ae.find(je=>te.isProjectSpaceResource(je)&&je.id===I.id);ke=I.isOwner(n.user)||(_e==null?void 0:_e.isMember(n.user))}for(const _e of fe){const je=p(i)[_e]??null;if((je==null?void 0:je.spaceId)===I.id){V[_e]=je;continue}if(!ke&&!Le().find(Y=>_e.startsWith(Y.root.remoteItem.path)))break;M.push(F.listFiles(I,{path:_e},{depth:0,davProperties:q,signal:G}).then(({resource:Y})=>{V[_e]={id:Y.fileId,shareTypes:Y.shareTypes,parentFolderId:Y.parentFolderId,spaceId:I.id,path:_e}}))}return Promise.all(M).then(()=>{if(!Object.keys(V).includes("/")){const _e=p(i)["/"];if((_e==null?void 0:_e.spaceId)===I.id)V["/"]=_e;else{const{parentFolderId:je}=Object.values(V)[0],Y=t.spaces.find(({id:Ne})=>je.startsWith(Ne));Y&&(V["/"]={id:Y.id,shareTypes:Y.shareTypes,parentFolderId:Y.id,spaceId:Y.id,path:"/"})}}ue(V)})},getAncestorById:H=>Object.values(p(i)).find(I=>H===I.id),deleteQueue:s,addResourcesIntoDeleteQueue:H=>{s.value=s.value.concat(H.filter(I=>!p(s).includes(I)))},removeResourcesFromDeleteQueue:H=>{s.value=s.value.filter(I=>!H.includes(I))}}}),Ao=Ge.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=Xt.v4(),l=jr.useWebWorker(i,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...l};return p(e).push(u),u},terminateWorker:i=>{const s=p(e).find(a=>i===a.id);s&&(s.terminate(),e.value=p(e).filter(a=>i!==a.id))},terminateAllWorkers:()=>{p(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{p(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),zs=(e={})=>{const t=e.router||We(),n=e.configStore||at();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:a})=>{var u;if(!((u=n.options.routing)!=null&&u.idBased)||s===i.path&&a===i.fileId)return!1;const l=Jn(o,i,{configStore:n});return t.replace(l),!0}}},Ws=()=>{const e=Jt();return j(()=>p(e).name)},Zb=(e,t)=>{const n=Jt();return j(()=>p(n).meta[e]||t)},Hs=(e,t)=>{const n=We();return j({get(){return Et(p(n.currentRoute).params[e])||t},async set(r){p(n.currentRoute).params[e]!==r&&await n.replace({params:{...p(n.currentRoute).params,[e]:r}})}})};let ev=Promise.resolve();const rn=(e,t)=>{const n=We();return j({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;ev=ev.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},wr=e=>{const t=rn(e.name),n=hf($F(e));return wt(()=>p(t)?{value:p(t),source:"route"}:p(n)?{value:p(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:Et(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},$F=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Sr=(e,...t)=>{const n=le(!1),r=We(),o=Jt();return wt(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Gs="contextRouteName",gf="contextRouteParams",mf="contextRouteQuery",Ks=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[Gs]:e.name,[gf]:t,[mf]:r}},tv=e=>({routeName:Et(e[Gs]),routeParams:e[gf],routeQuery:e[mf]}),Et=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function nv({router:e,currentFileContext:t}){const n=a=>{const{fileName:l,routeName:u,routeParams:c,routeQuery:f}=p(a);return p(u)?e.push({name:p(u),params:p(c),query:{...p(f),scrollTo:p(l)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=zs({router:e}),o=(a,l)=>{const u=p(a);return r({space:p(u.space),resource:l,path:p(u.item),fileId:p(u.itemId)})},i=le(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const Je=()=>mr("$clientService");function yf({clientService:e}){e=e||Je();const t=nn(),n=vt();return{getUrlForResource:(l,u,c)=>{var f;return e.webdav.getFileUrl(l,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=n.user)==null?void 0:f.onPremisesSamAccountName,...c})},revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(p(p(l).space),{path:p(p(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(p(p(l).space),{path:p(p(l).item),fileId:p(p(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(p(p(l).space),{path:p(p(l).item),...u})}}const bf=()=>mr("$authService");class Er{}Se(Er,"allFiles","all-files"),Se(Er,"currentFolder","current-folder");const vf=()=>{const e=at(),t=Je(),n=lt(),r=Xe(),o=nn(),i=j(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=j(()=>r.areHiddenFilesShown),a=j(()=>n.spaces.filter(te.isProjectSpaceResource)),l=d=>p(a).find(y=>y.id===d),u=un.useTask(function*(d,y,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!y)return{totalResults:null,values:[]};const{resources:m,totalResults:T}=yield*te.call(t.webdav.search(y,{searchLimit:w,davProperties:vs.Default,signal:d}));return{totalResults:T,values:m.map(v=>{const g=l(v.parentFolderId),h=g||v;return e.options.routing.fullShareOwnerPaths&&h.remoteItemPath&&(h.path=te.urlJoin(h.remoteItemPath,h.path)),{id:h.id,data:h}}).filter(({data:v})=>!v.name.startsWith(".")||p(s))}}).restartable();return{search:async(d,y=null)=>await u.perform(d,y),buildSearchTerm:({term:d,isTitleOnlySearch:y,tags:w,lastModified:m,mediaType:T,scope:v,useScope:g})=>{const h=[],b=d,S=p(i)&&!y;if(b){let E=`name:"*${b}*"`;S&&(E=`(name:"*${b}*" OR content:"${b}")`),h.push(E)}if(g&&v&&h.push(`scope:${v}`),w){const E=w.split("+").map(_=>`"${_}"`);h.push(`tag:(${E.join(" OR ")})`)}if(m&&h.push(`mtime:${m}`),T){const E=T.split("+").map(_=>`"${_}"`);h.push(`mediatype:(${E.join(" OR ")})`)}return h.sort((E,_)=>Number(E.startsWith("scope:"))-Number(_.startsWith("scope:"))).join(" AND ")}}};function rv({currentRoute:e,clientService:t}){const n=le(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=zs(),{getFileInfo:i}=yf({clientService:t}),s=bf(),a=lt(),{buildSearchTerm:l,search:u}=vf(),c=rn("contextRouteQuery"),f=Xe(),{activeResources:d}=Ge.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var m,T;n.value=!0;try{if(w=p(w),(m=p(c))!=null&&m.term){const R=l({term:(T=p(c))==null?void 0:T.term}),{values:A}=await u(R,200),$=A.filter(({data:L})=>te.isSearchResource(L)).map(L=>L.data);f.initResourceList({currentFolder:null,resources:$}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(p(w.routeName))){await Wy.getTask().perform(),n.value=!1;return}f.clearResourceList();const g=p(w.space),h=await i(w,{davProperties:[Ue.FileId]});if(o({space:g,resource:h,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(R=>{var A;return te.isMountPointSpaceResource(R)&&((A=R.root.remoteItem)==null?void 0:A.id)===h.id})){const R=await i(w);f.initResourceList({currentFolder:R,resources:[R]}),n.value=!1;return}const S=gt.dirname(h.path),{resource:E,children:_}=await r.listFiles(g,{path:S});E.type==="file"?f.initResourceList({currentFolder:E,resources:[E]}):f.initResourceList({currentFolder:E,resources:_})}catch(v){if(v.statusCode===401)return s.handleAuthError(p(e));f.setCurrentFolder(null),console.error(v)}n.value=!1},activeFiles:d}}function wf({appsStore:e,applicationId:t}){return{applicationMeta:j(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const Ro=()=>Ye;function iv({titleSegments:e,eventBus:t}){const n=ii(),{currentTheme:r}=Ge.storeToRefs(n);t=t||Ro(),wt(e,o=>{const i=p(o),s=" - ",a={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,p(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function DF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=wf({applicationId:t,appsStore:e}),{$gettext:s}=xe.useGettext(),a=j(()=>{var c,f,d;const l=gt.basename(p((c=p(r))==null?void 0:c.fileName))||s(((d=(f=p(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=p(p(i).applicationMeta);return[l,p(n)||u.name||u.id].filter(Boolean)});iv({titleSegments:a})}function ov(e={}){const t=e.clientService??Je(),n=e.authStore??Yr();return{makeRequest:(o,i,s={})=>{const a=n.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},n.publicLinkContextReady&&(n.publicLinkPassword&&(s.headers.Authorization="Basic "+yr.from(["public",n.publicLinkPassword].join(":")).toString("base64")),n.publicLinkToken&&(s.headers["public-token"]=n.publicLinkToken)),s.method=o,s.url=i,a.request(s)}}}const sv=()=>{const e=lt();return{areSpacesLoading:j(()=>!e.spacesInitialized||e.spacesLoading)}},av=(e={})=>{const t=lt(),{areSpacesLoading:n}=sv(),r=rn("shareId"),o=rn("fileId"),i=j(()=>Et(p(o))),s=at(),a=Je(),l=j(()=>t.spaces),u=le(null),c=le(null),f=le(!1),d=y=>{const w=y.split("/");return p(l).find(m=>{if(!y.startsWith(m.driveAlias))return!1;const T=m.driveAlias.split("/");return w.length<T.length||w.slice(0,T.length).join("/")!==m.driveAlias?!1:m})};return ja(()=>{const y=p(e.driveAliasAndItem);!(y!=null&&y.startsWith("personal/"))&&!(y!=null&&y.startsWith("project/"))&&t.setCurrentSpace(null)}),wt([e.driveAliasAndItem,n],async([y,w],[m,T])=>{if(y===m&&w===T)return;if(!y||y.startsWith("virtual/")){u.value=null,c.value=null;return}if(p(u)&&y.startsWith(p(u).driveAlias)){c.value=te.urlJoin(y.slice(p(u).driveAlias.length),{leadingSlash:!0});return}let g=null,h=null;if(y.startsWith("public/")||y.startsWith("ocm/")){const[b,...S]=y.split("/").slice(1);g=p(l).find(E=>E.id===b),h=S.join("/")}else if(y.startsWith("share/")||y.startsWith("ocm-share/")){const[b,...S]=y.split("/").slice(1),E=y.startsWith("ocm-share/")?"ocm-share":"share";let _=Et(p(r));_!=null&&_.includes(":")&&(_=[te.SHARE_JAIL_ID,_].join("!")),g=t.getSpace(_)||t.createShareSpace({driveAliasPrefix:E,id:_,shareName:p(b)}),h=S.join("/")}else p(i)?g=p(l).find(b=>p(i).startsWith(`${b.fileId}`)):g=d(y),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(y)),g&&(h=y.slice(g.driveAlias.length));u.value=g,c.value=te.urlJoin(h,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),wt(u,y=>{t.setCurrentSpace(y)},{immediate:!0}),{space:u,item:c,itemId:i,loading:f}};function lv(e){const t=We(),n=Zn(),r=Jt(),o=e.clientService??Je(),i=e.applicationId,s=Yr(),{publicLinkContextReady:a}=Ge.storeToRefs(s),l=Hs("driveAliasAndItem"),{space:u,item:c,itemId:f,loading:d}=av({driveAliasAndItem:l}),y=j(()=>{if(p(d))return null;let w;return p(u)?w=te.urlJoin(p(u).webDavPath,p(c)):w=te.urlJoin(Et(p(r).params.filePath)),{path:w,driveAliasAndItem:p(l),space:p(u),item:p(c),itemId:p(f),fileName:gt.basename(w),routeName:Et(p(r).query[Gs]),...tv(p(r).query)}});return DF({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:y,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:y,...ah({appsStore:n,...e}),...nv({router:t,currentFileContext:y}),...yf({clientService:o}),...rv({clientService:o,currentRoute:r}),...ov({clientService:o,currentRoute:p(r)})}}const LF=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),MF=()=>[{path:"/list",redirect:e=>On("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>On("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:te.urlJoin("personal/home",Et(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ti("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>xn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>xn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>xn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Ri("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Ai("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(LF),BF=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":On("files-spaces-generic").name,"files-favorites":Ti("files-common-favorites").name,"files-shared-with-others":xn("files-shares-with-others").name,"files-shared-with-me":xn("files-shares-with-me").name,"files-trashbin ":Ri("files-trash-generic").name,"files-public-list":Ai("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return ml(e,n,...r)},jF={name:"root",path:"/",redirect:e=>On("files-spaces-generic",e)},UF=e=>[jF,...dT(e),...gT(e),...mT(e),...pT(e),...yT(e),...MF()],oi=()=>{const{$gettext:e}=xe.useGettext(),t=Je();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(o)?i(e(`Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)):i(null),getDefaultMetaFolder:async o=>{const{children:i}=await t.webdav.listFiles(o);return i.find(({name:s})=>s===".space")}}},ln=e=>{const t=vt(),n=lt(),r=at(),o=j(()=>n.spaces),i=Hs("driveAliasAndItem"),s=f=>p(e==null?void 0:e.space)||p(o).find(d=>d.id===f),a=f=>{var T,v,g,h,b;let d=f.storageId;((T=p(i))!=null&&T.startsWith("public/")||(v=p(i))!=null&&v.startsWith("ocm/"))&&(d=p(i).split("/")[1]);const y=s(d);if(y&&!te.isMountPointSpaceResource(y))return y;const w=te.isShareResource(f)&&f.shareTypes.includes(te.ShareTypes.remote.value)||(g=f==null?void 0:f.id)!=null&&g.toString().startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return f.remoteItemPath?m=gt.basename(f.remoteItemPath):(h=p(i))!=null&&h.startsWith("share/")||(b=p(i))!=null&&b.startsWith("ocm-share/")?m=p(i).split("/")[1]:m=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:f.remoteItemId,shareName:m})},l=f=>p(o).filter(d=>te.isMountPointSpaceResource(d)&&te.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=n.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const y=p(o).find(m=>te.isProjectSpaceResource(m)&&m.id===f.id);return f.isOwner(t.user)||(y==null?void 0:y.isMember(t.user))||l(f).some(m=>d.startsWith(m.root.remoteItem.path))}}},Di=()=>{const e=Je(),t=Xe(),n=jt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},n.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var a;const s=await e.webdav.createFolder(i,{path:".space"});return te.extractStorageId(s.parentFolderId)===((a=t.currentFolder)==null?void 0:a.id)&&t.upsertResource(s),s}}},cn=()=>mr("$loadingService"),Qs=()=>{const e=Yr(),t=Je(),n=xe.useGettext();return{headers:j(()=>{const o=new Dh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Xt.v4(),...o.getHeaders()}})}};function qF(e){return new Worker("/assets/worker-BgOcJUCv.js",{name:e==null?void 0:e.name})}const cv=({concurrentRequests:e=4}={})=>{const t=at(),n=cn(),{headers:r}=Qs(),{createWorker:o,terminateWorker:i}=Ao(),s=({topic:l,space:u,resources:c},f)=>{const d=o(qF,{needsTokenRenewal:!0});let y;p(d.worker).onmessage=w=>{i(d.id),y==null||y(!0);const{successful:m,failed:T}=JSON.parse(w.data),v=T.map(({resource:g,...h})=>({resource:g,error:te.createHttpError(h)}));f({successful:m,failed:v})},n.addTask(()=>new Promise(w=>{y=w})),d.post(a({topic:l,space:u,resources:c}))},a=({topic:l,space:u,resources:c})=>JSON.stringify({topic:l,data:{space:u,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...p(r),"X-Request-ID":void 0}}});return{startWorker:s}};function VF(e){return new Worker("/assets/worker-DNa_GQd0.js",{name:e==null?void 0:e.name})}const uv=()=>{const e=at(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ao(),i=(a,l)=>{const u=r(VF,{needsTokenRenewal:!0});let c;p(u.worker).onmessage=f=>{o(u.id),c==null||c(!0);const{successful:d,failed:y}=JSON.parse(f.data),w=y.map(({resourceName:m,...T})=>({resourceName:m,error:te.createHttpError(T)}));l({successful:d,failed:w})},t.addTask(()=>new Promise(f=>{c=f})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function zF(e){return new Worker("/assets/worker-4Sj2EDss.js",{name:e==null?void 0:e.name})}const fv=()=>{const e=at(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ao(),i=({space:a,resources:l,missingFolderPaths:u},c)=>{const f=r(zF,{needsTokenRenewal:!0});let d;p(f.worker).onmessage=y=>{o(f.id),d==null||d(!0);const{successful:w,failed:m}=JSON.parse(y.data),T=m.map(({resource:v,...g})=>({resource:v,error:te.createHttpError(g)}));c({successful:w,failed:T})},t.addTask(()=>new Promise(y=>{d=y})),f.post(s({space:a,resources:l,missingFolderPaths:u}))},s=({space:a,resources:l,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:l,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function WF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const HF=({authService:e})=>{const{createWorker:t}=Ao(),n=le();return{startWorker:()=>{n.value=t(WF),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof q0.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),p(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",s),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:s,expiryThreshold:a})=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"reset"}))}}},dv=()=>{const e=at(),t=it(),n=We(),r=xe.useGettext(),{getMatchingSpace:o}=ln(),{$gettext:i,$ngettext:s}=r,a=Je(),{dispatchModal:l}=bt(),u=lt(),c=jt(),{startWorker:f}=cv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),d=Xe(),{currentFolder:y}=Ge.storeToRefs(d),w=le([]),m=rn("page","1"),T=j(()=>parseInt(Et(p(m)))),v=rn("items-per-page","1"),g=j(()=>parseInt(Et(p(v)))),h=j(()=>bp(p(w))),b=j(()=>{const A=p(h),$=A[0].type==="folder";let L=null;return A.length===1?($?L=i('Permanently delete folder "%{name}"',{name:A[0].name},!0):L=i('Permanently delete file "%{name}"',{name:A[0].name},!0),L):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",A.length,{amount:A.length.toString()},!1)}),S=j(()=>{const A=p(h),$=A[0].type==="folder";return A.length===1?i($?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),E=A=>{const $=p(n.currentRoute);f({topic:"trashBinDelete",space:A,resources:p(h)},({successful:L,failed:k})=>{var N,z;if(L.length){const Q=L.length===1&&p(h).length===1?i('"%{item}" was deleted successfully',{item:L[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",L.length,{itemCount:L.length.toString()},!0);t.showMessage({title:Q})}k.forEach(({resource:Q})=>{const J=i('Failed to delete "%{item}"',{item:Q.name});t.showErrorMessage({title:J,errors:[new Error]})}),$.name===p(n.currentRoute).name&&((N=$.query)==null?void 0:N.fileId)===((z=p(n.currentRoute).query)==null?void 0:z.fileId)&&(d.removeResources(L),d.resetSelection())})};return{displayDialog:(A,$)=>{w.value=[...$],l({title:p(b),message:p(S),confirmText:i("Delete"),onConfirm:()=>E(A)})},filesList_delete:A=>{var k;w.value=[...A],d.addResourcesIntoDeleteQueue(p(w).map(({id:N})=>N)),p(w).forEach(({id:N})=>d.removeSelection(N));const $=p(A).reduce((N,z)=>{if(z.storageId in N)return N[z.storageId].resources.push(z),N;const Q=o(z);return Q.id in N||(N[Q.id]={space:Q,resources:[]}),N[Q.id].resources.push(z),N},{}),L=(k=p(y))==null?void 0:k.id;return Object.values($).map(({space:N,resources:z})=>{f({topic:"fileListDelete",space:N,resources:z},async({successful:Q,failed:J})=>{var ae;if(Q.length){const re=Q.length===1&&A.length===1?i('"%{item}" was moved to trash bin',{item:Q[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",Q.length,{itemCount:Q.length.toString()},!0);t.showMessage({title:re})}if(d.removeResourcesFromDeleteQueue(J.map(({resource:re})=>re.id)),d.removeResourcesFromDeleteQueue(Q.map(({id:re})=>re)),J.forEach(({error:re,resource:se})=>{let ue=i('Failed to delete "%{resource}"',{resource:se.name});re.statusCode===423&&(ue=i('Failed to delete "%{resource}" - the file is locked',{resource:se.name})),t.showErrorMessage({title:ue,errors:[re]})}),L===((ae=p(y))==null?void 0:ae.id)){d.removeResources(Q);const re=d.activeResources.length,se=Math.ceil(p(re)/p(g));p(T)>1&&p(T)>se&&(m.value=se.toString())}if(ft(n,"files-spaces-generic")&&!["public","share"].includes(N==null?void 0:N.driveType)){const se=await a.graphAuthenticated.drives.getDrive(p(A)[0].storageId,c.graphRoles);u.updateSpaceField({id:se.id,field:"spaceQuota",value:se.spaceQuota})}if(p(w).length&&Zi(p(w)[0],p(y)))return n.push(Jn(N,{path:gt.dirname(p(w)[0].path),fileId:p(w)[0].parentFolderId}))})})}}},GF=e=>e==="files",kr=()=>{const e=Jt();return j(()=>GF(El(p(e))))};function KF(e){return e==null}const QF="edit",XF="create",zn=()=>{const e=Zn(),t=We(),{$gettext:n}=xe.useGettext(),r=os(),{isEnabled:o}=ri(),{requestExtensions:i}=Ni(),{openUrl:s}=jv(),a=at(),{options:l}=Ge.storeToRefs(a),{actions:u}=Xs(),{actions:c}=Ys(),{actions:f}=Js(),{actions:d}=ea(),{actions:y}=Zs(),{actions:w}=ta(),{actions:m}=_o(),{actions:T}=Af(),{actions:v}=na(),{actions:g}=Rf(),{actions:h}=ra(),{actions:b}=ia(),{actions:S}=Pf(),E=j(()=>[...p(w),...p(m),...p(d),...p(v),...p(f),...p(h),...p(S),...p(b),...p(u),...p(c),...p(y),...p(T),...p(g)]),_=j(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(ae=>ae.action)),R=j(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),A=j(()=>p(o)?[]:e.fileExtensions.map(J=>{const ae=e.apps[J.app];return{name:`editor-${J.app}`,label:()=>J.label?typeof J.label=="function"?J.label():J.label:n("Open in %{app}",{app:ae.name},!0),showOpenInNewTabHint:!0,icon:J.icon||ae.icon,...ae.iconFillType&&{iconFillType:ae.iconFillType},img:ae.img,route:({space:re,resources:se})=>$({appFileExtension:J,space:re,resource:se[0]}),handler:re=>k(J,re.space,re.resources[0]),isVisible:({resources:re})=>re.length!==1||!re[0].canDownload()&&!J.secureView||!p(r)&&_n(t,"files-trash-generic")?!1:re[0].extension&&J.extension?re[0].extension.toLowerCase()===J.extension.toLowerCase():re[0].mimeType&&J.mimeType?re[0].mimeType.toLowerCase()===J.mimeType.toLowerCase()||re[0].mimeType.split("/")[0].toLowerCase()===J.mimeType.toLowerCase():!1,hasPriority:J.hasPriority,class:`oc-files-actions-${Kb(ae.name).toLowerCase()}-trigger`}}).sort((J,ae)=>ae.hasPriority!==J.hasPriority&&ae.hasPriority?1:0)),$=({appFileExtension:J,space:ae,resource:re})=>{const se=te.isShareSpaceResource(ae)?ae.id:void 0,ue=J.routeName||J.app,we=L(ue,ae,re,se);return t.resolve(we)},L=(J,ae,re,se,ue)=>({name:J,params:{driveAliasAndItem:ae==null?void 0:ae.getDriveAliasAndItem(re)},query:{...se&&{shareId:se},...re.fileId&&p(l).routing.idBased&&{fileId:re.fileId},...ue&&{templateId:ue},...Ks(p(t.currentRoute))}}),k=(J,ae,re)=>{const se=te.isShareSpaceResource(ae)?ae.id:void 0,ue=J.routeName||J.app,we=L(ue,ae,re,se);if(p(l).cernFeatures){const ee=t.resolve(we).href,ie=`${J.routeName}-${re.path}`;s(ee,ie,!0);return}t.push(we)},N=J=>{z(J).handler({...J})},z=J=>{const ae=Q(J);if(ae.length)return ae[0]},Q=J=>{const ae=ue=>ue.isVisible(J),re=[...p(_),...p(A)].filter(ae).sort((ue,we)=>Number(we.hasPriority)-Number(ue.hasPriority)),se=J.omitSystemActions?[]:p(E).filter(ae);return[...re,...se,...p(R).filter(ue=>ue.isVisible(J)&&(ue.category==="actions"||KF(ue.category)))]};return{editorActions:A,systemActions:E,getDefaultAction:z,getAllAvailableActions:Q,getEditorRouteOpts:L,openEditor:k,triggerDefaultAction:N}},Xs=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=We(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=Je(),s=cn(),a=at(),l=Xe(),{updateResourceField:u}=l,c=async({resources:d})=>{const y=[],w=[],m=new Br({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(T=>{w.push(m.add(async()=>{try{const{graphAuthenticated:v}=i;await v.driveItems.createDriveItem(T.driveId,{name:T.name,remoteItem:{id:T.fileId}}),u({id:T.id,field:"syncEnabled",value:!0})}catch(v){console.error(v),y.push(v)}}))}),await Promise.all(w),y.length===0){l.resetSelection(),ft(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:y})};return{actions:j(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>c(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:y})=>{var w;return!Nt(n,"files-shares-with-me")&&!ft(n,"files-spaces-generic")||y.length===0||ft(n,"files-spaces-generic")&&(((w=p(d))==null?void 0:w.driveType)!=="share"||y.length>1||y[0].path!=="/")?!1:y.some(m=>!m.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},Ys=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=We(),{$gettext:r}=xe.useGettext(),o=Je(),i=cn(),s=at(),{updateResourceField:a,resetSelection:l}=Xe(),u=async({resources:f})=>{const d=[],y=[],w=new Br({concurrency:s.options.concurrentRequests.resourceBatchActions}),m=!f[0].hidden;if(f.forEach(T=>{y.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(T.driveId,T.id,{"@UI.Hidden":m}),a({id:T.id,field:"hidden",value:m})}catch(v){console.error(v),d.push(v)}}))}),await Promise.all(y),d.length===0){l(),e({title:r(m?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(m?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:j(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:Nt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},Js=()=>{const e=at(),t=We(),{copyResources:n}=Eo(),r=xe.useGettext(),{$gettext:o}=r,i=Xe(),{currentFolder:s}=Ge.storeToRefs(i),a=j(()=>window.navigator.platform.match("Mac")),l=j(()=>p(a)?o("⌘ + C"):o("Ctrl + C")),u=({resources:f})=>{At(t,"files-common-search")&&(f=f.filter(d=>!te.isProjectSpaceResource(d))),n(f)};return{actions:j(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:p(l),label:()=>o("Copy"),isVisible:({resources:f})=>{var d,y;if(!ft(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")||ft(t,"files-spaces-projects")||f.length===0)return!1;if(Rn(t,"files-public-link"))return(d=p(s))==null?void 0:d.canCreate();if(At(t,"files-common-search")&&f.every(w=>te.isProjectSpaceResource(w)))return!1;if(p(e.options.runningOnEos)){const w=((y=f[0].path)==null?void 0:y.split("/").filter(Boolean))||[];if(ft(t,"files-spaces-generic")&&w.length<5)return!1}return!!p(f)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},Sf=()=>({copyToClipboard:t=>{var n;if((n=navigator==null?void 0:navigator.clipboard)!=null&&n.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:r}=jr.useClipboard({legacy:!0});return r(t)}}}),Ef=()=>{const{showMessage:e,showErrorMessage:t}=it(),{$gettext:n}=xe.useGettext(),{copyToClipboard:r}=Sf(),o=async s=>{try{await r(s),e({title:n("The link has been copied to your clipboard.")})}catch(a){console.error(a),t({title:n("Copy link failed"),errors:[a]})}};return{actions:j(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:({resources:s})=>{const[a]=s,l=a.privateLink;return o(l)},isVisible:({space:s,resources:a})=>te.isPublicSpaceResource(s)?!1:a.length===1,class:"oc-files-actions-copy-permanent-link-trigger"}])}},Zs=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=We(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=Je(),s=cn(),a=at(),{updateResourceField:l}=Xe(),u=async({resources:f})=>{const d=[],y=[],w=new Br({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(m=>{y.push(w.add(async()=>{try{const{graphAuthenticated:T}=i;await T.driveItems.deleteDriveItem(m.driveId,m.id),l({id:m.id,field:"syncEnabled",value:!1})}catch(T){console.error(T),d.push(T)}}))}),await Promise.all(y),d.length===0){ft(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push(xn("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",f.length),errors:d})};return{actions:j(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:d})=>!Nt(n,"files-shares-with-me")&&!ft(n,"files-spaces-generic")||d.length===0||ft(n,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(y=>y.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},ea=()=>{const e=vt(),t=nn(),n=We(),{displayDialog:r,filesList_delete:o}=dv(),{$gettext:i}=xe.useGettext(),s=({space:l,resources:u,deletePermanent:c})=>{if(At(n,"files-common-search")&&(u=u.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!te.isProjectSpaceResource(f))),c){r(l,u);return}o(u)};return{actions:j(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:l,resources:u})=>s({space:l,resources:u,deletePermanent:!1}),isVisible:({space:l,resources:u})=>!ft(n,"files-spaces-generic")&&!Rn(n,"files-public-link")&&!At(n,"files-common-search")||u.length===0||ft(n,"files-spaces-generic")&&(l==null?void 0:l.driveType)==="share"&&u[0].path==="/"||u.length===1&&u[0].locked?!1:At(n,"files-common-search")?u.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!te.isProjectSpaceResource(f)):!u.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:l,resources:u})=>s({space:l,resources:u,deletePermanent:!0}),isVisible:({space:l,resources:u})=>!_n(n,"files-trash-generic")||!t.filesPermanentDeletion||te.isProjectSpaceResource(l)&&!l.canDeleteFromTrashBin({user:e.user})?!1:u.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function YF(e){return e&&e.length?e[0]:void 0}const pv=()=>mr("$archiverService"),ta=()=>{const{showErrorMessage:e}=it(),t=We(),n=cn(),r=pv(),{$ngettext:o,$gettext:i,current:s}=xe.useGettext(),a=Yr(),l=kr(),u=({space:d,resources:y})=>{y.length>1&&(y=y.filter(m=>m.canDownload()&&!te.isProjectSpaceResource(m)));const w=p(r.fileIdsSupported)?{fileIds:y.map(m=>m.fileId)}:{dir:ss.dirname(YF(y).path)||"/",files:y.map(m=>m.name)};return r.triggerDownload({...w,...d&&te.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:a.publicLinkPassword}}).catch(m=>{console.error(m),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",y.length),errors:[m]})})},c=d=>{const y=p(r.capability);return y?d.reduce((m,T)=>m+parseInt(`${T.size}`),0)>parseInt(y.max_size):void 0};return{actions:j(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await n.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>c(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:Sn(p(r.capability).max_size,s)}):"",isDisabled:({resources:d})=>c(d),isVisible:({resources:d})=>p(l)&&!ft(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")&&!At(t,"files-common-search")||!p(r.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(w=>te.isProjectSpaceResource(w))||te.isProjectSpaceResource(d[0])&&d[0].disabled||!p(r.fileIdsSupported)&&At(t,"files-common-favorites")?!1:!d.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},hv=e=>{const{showErrorMessage:t}=it(),n=(e==null?void 0:e.clientService)||Je(),{$gettext:r}=xe.useGettext(),o=nn(),i=vt();return{downloadFile:async(a,l,u=null)=>{var c;try{const f=await n.webdav.getFileUrl(a,l,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(c=i.user)==null?void 0:c.onPremisesSamAccountName});jl(f,l.name)}catch(f){console.error(f),t({title:r("Download failed"),desc:r("File could not be located"),errors:[f]})}}}},_o=()=>{const e=We(),{$gettext:t}=xe.useGettext(),n=kr(),r=os(),{downloadFile:o}=hv(),i=({space:a,resources:l})=>{o(a,l[0])};return{actions:j(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!ft(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!At(e,"files-common-favorites")&&!At(e,"files-common-search")&&!Nt(e,"files-shares-with-me")&&!Nt(e,"files-shares-with-others")&&!Nt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Tf=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),r=nn(),o=We(),{$gettext:i}=xe.useGettext(),s=Je(),{dispatchModal:a}=bt(),l=Xe(),u=cn(),c=({space:y})=>s.webdav.clearTrashBin(y).then(()=>{e({title:i("All deleted files were removed")}),l.clearResources(),l.resetSelection()}).catch(w=>{console.error(w),t({title:i("Failed to empty trash bin"),errors:[w]})}),f=({space:y})=>{a({title:i("Empty trash bin"),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the listed items? You can’t undo this action."),hasInput:!1,onConfirm:()=>u.addTask(()=>c({space:y}))})};return{actions:j(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:y})=>!(!_n(o,"files-trash-generic")||!r.filesPermanentDeletion||te.isProjectSpaceResource(y)&&!y.canDeleteFromTrashBin({user:n.user})),isDisabled:()=>l.activeResources.length===0,class:"oc-files-actions-empty-trash-bin-trigger",appearance:"filled"}]),emptyTrashBin:c}},Af=()=>{const{showErrorMessage:e}=it(),t=nn(),n=We(),{$gettext:r}=xe.useGettext(),o=Je(),i=kr(),s=pn(),a=Xe(),l=Ro(),u=async({space:f,resources:d})=>{try{const y=!d[0].starred;await o.webdav.setFavorite(f,d[0],y),a.updateResourceField({id:d[0].id,field:"starred",value:y}),y||l.publish("app.files.list.removeFromFavorites",d[0].id)}catch(y){const w=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:w,errors:[y]})}};return{actions:j(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>p(i)&&!ft(n,"files-spaces-generic")&&!At(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function JF(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const na=()=>{const e=We(),{cutResources:t}=Eo(),n=xe.useGettext(),{$gettext:r}=n,o=Xe(),{currentFolder:i}=Ge.storeToRefs(o),s=j(()=>window.navigator.platform.match("Mac")),a=j(()=>p(s)?r("⌘ + X"):r("Ctrl + X")),l=({resources:c})=>{t(c)};return{actions:j(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:p(a),label:()=>r("Cut"),isVisible:({resources:c})=>!ft(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!At(e,"files-common-favorites")||c.length===0||!p(i)||c.length===1&&c[0].locked?!1:!c.some(d=>JF(d,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},Rf=()=>{const e=We(),{$gettext:t}=xe.useGettext(),{getMatchingSpace:n}=ln(),r=Xe(),{currentFolder:o}=Ge.storeToRefs(r),i=l=>l||n(l),s=j(()=>Rn(e,"files-public-link")?Ai("files-public-link"):On("files-spaces-generic"));return{actions:j(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:l})=>!(_n(e,"files-trash-generic")||l.length!==1||p(o)!==null&&Zi(l[0],p(o))||!l[0].isFolder||l[0].type==="space"),route:({space:l,resources:u})=>ao({},p(s),Jn(i(l),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},gv=()=>{const e=We(),t=Je(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=Eo(),{startWorker:s}=uv(),a=Xe(),{currentFolder:l}=Ge.storeToRefs(a),u=j(()=>window.navigator.platform.match("Mac")),c=j(()=>p(u)?r("⌘ + V"):r("Ctrl + V")),f=j(()=>i.action===ti.Cut?pr.MOVE:pr.COPY),d=async({targetSpace:m,sourceSpace:T,resources:v})=>{var S;const g=new Tp(T,v,m,p(l),l,t,r,o),h=await g.getTransferData(p(f));if(!h.length)return;const b=(S=p(l))==null?void 0:S.id;s(h,async({successful:E,failed:_})=>{if(g.showResultMessage(_,E,p(f)),!E.length||p(l)&&b!==p(l).id)return;const R=[],A=[];for(const $ of E)R.push((async()=>{const L=await t.webdav.getFileInfo(m,$);A.push(L)})());await Promise.allSettled(R),te.isShareSpaceResource(m)&&A.forEach($=>{$.remoteItemId=m.id}),a.upsertResources(A)})},y=async({space:m})=>{const T=i.resources.reduce((g,h)=>{if(h.storageId in g)return g[h.storageId].resources.push(h),g;const b=n(h);return b.id in g||(g[b.id]={space:b,resources:[]}),g[b.id].resources.push(h),g},{}),v=Object.values(T).map(({space:g,resources:h})=>d({targetSpace:m,sourceSpace:g,resources:h}));await Promise.all(v),i.clearClipboard()};return{actions:j(()=>[{name:"paste",icon:"clipboard",handler:y,label:()=>r("Paste"),shortcut:p(c),isVisible:({resources:m})=>{var T;return i.resources.length===0||!ft(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!At(e,"files-common-favorites")||m.length===0?!1:Rn(e,"files-public-link")&&p(l)?(T=p(l))==null?void 0:T.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},ra=()=>{const{showErrorMessage:e}=it(),t=nn(),n=We(),{$gettext:r}=xe.useGettext(),o=Je(),i=at(),{dispatchModal:s}=bt(),a=vt(),l=pn(),u=Xe(),{setCurrentFolder:c,upsertResource:f}=u,d=(T,v,g=void 0)=>{const h=T.path.substring(0,T.path.length-T.name.length)+v;if(!v)return r("The name cannot be empty");if(/[/]/.test(v))return r('The name cannot contain "/"');if(v===".")return r('The name cannot be equal to "."');if(v==="..")return r('The name cannot be equal to ".."');if(/\s+$/.test(v))return r("The name cannot end with whitespace");if(u.resources.find(S=>S.path===h&&T.name!==v)){const S=r('The name "%{name}" is already taken');return r(S,{name:v},!0)}if(g&&g.find(E=>E.path===h&&T.name!==v)){const E=r('The name "%{name}" is already taken');return r(E,{name:v},!0)}return null},y=async(T,v,g)=>{let h=u.currentFolder;try{const b=gt.join(gt.dirname(v.path),g);await o.webdav.moveFiles(T,v,T,{path:b});const S=Zi(v,h);if(te.isShareSpaceResource(T)&&v.isReceivedShare()){if(T.rename(g),S)return h={...h},h.name=g,c(h),n.push(Jn(T,{path:"",fileId:v.fileId}));const _={...v};_.name=g,f(_);return}if(S)return h={...h},il(T,h,b),c(h),n.push(Jn(T,{path:b,fileId:v.fileId}));const E={...v};il(T,E,b),f(E)}catch(b){console.error(b);let S=r('Failed to rename "%{file}" to "%{newName}"',{file:v.name,newName:g},!0);b.statusCode===423&&(S=r('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:v.name,newName:g},!0)),e({title:S,errors:[b]})}},w=async({space:T,resources:v})=>{const g=u.currentFolder;let h;if(Zi(v[0],g)){const k=gt.dirname(g.path);h=(await o.webdav.listFiles(T,{path:k})).children}const b=u.areFileExtensionsShown,S=async k=>{b||(k=`${k}.${v[0].extension}`),await y(T,v[0],k)},E=(k,N)=>{b||(k=`${k}.${v[0].extension}`);const z=d(v[0],k,h);N(z)},_=te.extractNameWithoutExtension(v[0]),R=!v[0].isFolder&&!b?_:v[0].name,A=v[0].isFolder?r("Rename folder %{name}",{name:R}):r("Rename file %{name}",{name:R}),$=!v[0].isFolder&&!b?_:v[0].name,L=v[0].isFolder||!b?null:[0,_.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:$,inputSelectionRange:L,inputLabel:v[0].isFolder?r("Folder name"):r("File name"),onConfirm:S,onInput:E})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:T})=>_n(n,"files-trash-generic")||Nt(n,"files-shares-with-me")&&!t.sharingCanRename||T.length!==1||(i.options.routing.fullShareOwnerPaths?T.some(h=>h.remoteItemPath&&h.path):T.some(h=>h.remoteItemId&&h.path==="/"))||T.length===1&&T[0].locked?!1:!T.some(h=>!h.canRename({user:a.user,ability:l})||h.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:y}},ia=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),r=We(),{$gettext:o,$ngettext:i}=xe.useGettext(),s=Je(),a=lt(),l=jt(),u=Xe(),{startWorker:c}=fv(),f=async(T,v)=>{const g={},h=[],b=[],S=[];for(const E of v){const _=gt.dirname(E.path);let R=[];if(_ in g)R=g[_];else{try{R=(await s.webdav.listFiles(T,{path:_})).children}catch{S.push(_)}g[_]=R}R.some($=>$.name===E.name)||b.filter($=>$.id!==E.id).some($=>$.path===E.path)?h.push(E):b.push(E)}return{existingResourcesByPath:g,conflicts:h,resolvedResources:b,missingFolderPaths:S.filter(E=>{var _;return!((_=g[E])!=null&&_.length)})}},d=async T=>{let v=0;const g=[],h=T.length;let b=!1,S;for(const E of T){const _=E.type==="folder";if(b){g.push({resource:E,strategy:S});continue}const R=h-v,$=await new nl(o,i).resolveFileExists({name:E.name,isFolder:_},R,!1);v++,$.doForAllConflicts&&(b=!0,S=$.strategy),g.push({resource:E,strategy:$.strategy})}return g},y=(T,v,g)=>{const h=p(r.currentRoute);c({space:T,resources:v,missingFolderPaths:g},async({successful:b,failed:S})=>{var E,_;if(b.length){let R;b.length===1?R=o("%{resource} was restored successfully",{resource:b[0].name}):R=o("%{resourceCount} files restored successfully",{resourceCount:b.length.toString()}),e({title:R}),h.name===p(r.currentRoute).name&&((E=h.query)==null?void 0:E.fileId)===((_=p(r.currentRoute).query)==null?void 0:_.fileId)&&(u.removeResources(b),u.resetSelection());const $=await s.graphAuthenticated.drives.getDrive(T.id,l.graphRoles);a.updateSpaceField({id:$.id,field:"spaceQuota",value:$.spaceQuota})}if(S.length){let R;const A={};S.length===1?(A.resource=S[0].resource.name,R=o('Failed to restore "%{resource}"',A,!0)):(A.resourceCount=S.length.toString(),R=o("Failed to restore %{resourceCount} files",A,!0)),t({title:R,errors:S.map(({error:$})=>$)})}})},w=async({space:T,resources:v})=>{const g=v.sort(($,L)=>$.path.length-L.path.length),{existingResourcesByPath:h,conflicts:b,resolvedResources:S,missingFolderPaths:E}=await f(T,g),_=await d(b),R=_.filter($=>$.strategy===Vn.REPLACE).map($=>$.resource);S.push(...R);const A=_.filter($=>$.strategy===Vn.KEEP_BOTH).map($=>$.resource);for(let $ of A){$={...$};const L=gt.dirname($.path),k=h[L]||[],N=te.extractExtensionFromFile($),z=qn($.name,N,[...k,..._.map(Q=>Q.resource),...S]);$.name=z,$.path=te.urlJoin(L,z),S.push($)}return y(T,S,E)};return{actions:j(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:w,isVisible:({space:T,resources:v})=>!_n(r,"files-trash-generic")||!v.every(g=>te.isTrashResource(g)&&g.canBeRestored())||te.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:n.user})?!1:v.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:y,collectConflicts:f}},_f=()=>mr("$previewService"),mv=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),r=We(),{$gettext:o}=xe.useGettext(),i=Je(),s=cn(),a=_f(),l=lt(),u=jt(),{createDefaultMetaFolder:c}=Di(),{getDefaultMetaFolder:f}=oi(),d=async({space:w,resources:m})=>{var b;const T=i.graphAuthenticated,v=w==null?void 0:w.id,{copyFiles:g,getFileInfo:h}=i.webdav;try{let S=await f(w);S||(S=await c(w)),m[0].id!==((b=w.spaceImageData)==null?void 0:b.id)&&await g(w,{fileId:m[0].id},w,{parentFolderId:S.id,name:m[0].name},{overwrite:!0});const{fileId:E}=await h(w,{fileId:m[0].id}),_=await T.drives.updateDrive(v,{name:w.name,special:[{specialFolder:{name:"image"},id:E}]},u.graphRoles);l.updateSpaceField({id:v,field:"spaceImageData",value:_.spaceImageData}),e({title:o("Space image was set successfully")})}catch(S){console.error(S),t({title:o("Failed to set space image"),errors:[S]})}};return{actions:j(()=>[{name:"set-space-image",icon:"image-edit",handler:w=>s.addTask(()=>d(w)),label:()=>o("Set as space image"),isVisible:({space:w,resources:m})=>m.length!==1||!m[0].mimeType||!a.isMimetypeSupported(m[0].mimeType,!0)||!ft(r,"files-spaces-generic")||!w?!1:w.canEditImage({user:n.user}),class:"oc-files-actions-set-space-image-trigger"}])}},ZF=()=>{const e=We(),{$gettext:t}=xe.useGettext(),n=kr(),r=()=>{const i=_n(e,"files-trash-generic")?null:"actions";Ye.publish(yt.openWithPanel,i)};return{actions:j(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:i})=>p(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},If=()=>{const e=We(),t=Xe(),{$gettext:n}=xe.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>_n(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Ye.publish(yt.open)}}])}},yv=()=>{const e=nn(),{isPersonalSpaceRoot:t}=ln(),n=vt();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||te.isPublicSpaceResource(o)||t(i)||te.isTrashResource(i)?!1:te.isIncomingShareResource(i)?i.sharePermissions.includes(te.GraphSharePermission.readPermissions):te.isShareSpaceResource(o)?te.getPermissionsForSpaceMember(o,n.user).includes(te.GraphSharePermission.readPermissions):!0}},bv=()=>{const e=nn(),t=pn(),n=vt();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||te.isShareSpaceResource(o)||te.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:i.canShare({ability:t,user:n.user})}},Cf=()=>{const e=We(),{$gettext:t}=xe.useGettext(),{canShare:n}=bv(),r=Xe(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Ye.publish(yt.openWithPanel,"sharing#peopleShares")};return{actions:j(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>_n(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Pf=()=>{const{showMessage:e,showErrorMessage:t}=it(),{can:n}=pn(),{$gettext:r,$ngettext:o}=xe.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),a=Je(),l=We(),u=j(()=>n("create-all","Drive")),{dispatchModal:c}=bt(),f=at(),d=lt(),y=Xe(),w=async({spaceName:v,resources:g,space:h})=>{const{webdav:b}=a,S=new Br({concurrency:f.options.concurrentRequests.resourceBatchActions}),E=[];try{const _=await i(v);d.upsertSpace(_),g.length===1&&g[0].isFolder&&(g=(await b.listFiles(h,{path:g[0].path})).children);for(const R of g)E.push(S.add(()=>b.copyFiles(h,R,_,{path:R.name})));await Promise.all(E),y.resetSelection(),e({title:r("Space was created successfully")})}catch(_){console.error(_),t({title:r("Creating space failed…"),errors:[_]})}},m=({resources:v,space:g})=>{c({title:o('Create Space from "%{resourceName}"',"Create Space from selection",v.length,{resourceName:v[0].name}),message:o('Create Space with the content of "%{resourceName}".',"Create Space with the selected files.",v.length,{resourceName:v[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),onInput:s,onConfirm:h=>w({spaceName:h,space:g,resources:v})})};return{actions:j(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:v,space:g})=>!(!v.length||!p(u)||!ft(l,"files-spaces-generic")||!te.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},vv=()=>{const e=rn("scrollTo"),t=rn("details"),n=Xe(),r=j(()=>Et(p(e))),o=j(()=>Et(p(t))),i=(a,l={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Ye.publish("app.files.navigate.page",{resourceId:a,forceScroll:l.forceScroll,topbarElement:l.topbarElement});return}const c=document.getElementById(l.topbarElement),f=(c==null?void 0:c.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||l.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Ye.subscribe("app.files.navigate.scrollTo",a=>i(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(a,l)=>{if(!p(r)||!a.length)return;const u=p(a).find(c=>te.isIncomingShareResource(c)?c.remoteItemId===p(r):c.id===p(r));u&&u.processing!==!0&&(n.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:l}),p(o)&&Ye.publish(yt.openWithPanel,p(o)))}}},eO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=it(),{dispatchModal:r}=bt(),{$gettext:o}=xe.useGettext(),{scrollToResource:i}=vv(),s=Xe(),{resources:a,currentFolder:l}=Ge.storeToRefs(s),u=Je(),c=(w,m)=>w.trim()===""?m(o("Folder name cannot be empty")):/[/]/.test(w)?m(o('Folder name cannot contain "/"')):w==="."?m(o('Folder name cannot be equal to "."')):w===".."?m(o('Folder name cannot be equal to ".."')):p(a).find(v=>v.name===w)?m(o("%{name} already exists",{name:w},!0)):m(null),f=async w=>{w=w.trimEnd();try{const m=gt.join(p(l).path,w),T=await u.webdav.createFolder(p(e),{path:m});te.isShareSpaceResource(p(e))&&(T.remoteItemId=p(e).id),s.upsertResource(T),t({title:o('"%{folderName}" was created successfully',{folderName:w})}),await jn(),i(T.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:o("Failed to create folder"),errors:[m]})}},d=()=>{let w=o("New folder");p(a).some(m=>m.name===w)&&(w=qn(w,"",p(a))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:w,inputLabel:o("Folder name"),onConfirm:f,onInput:c})};return{actions:j(()=>[{name:"create-folder",icon:"folder",handler:d,label:()=>o("New Folder"),isVisible:()=>{var w;return(w=p(l))==null?void 0:w.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:c,addNewFolder:f}},tO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=it(),r=vt(),{$gettext:o}=xe.useGettext(),{dispatchModal:i}=bt(),s=Zn(),{isEnabled:a}=ri(),{openEditor:l}=zn(),u=Je(),c=Xe(),{resources:f,currentFolder:d,areFileExtensionsShown:y}=Ge.storeToRefs(c),w=j(()=>s.fileExtensions.filter(({newFileMenu:h})=>!!h)),m=h=>h===""?o("File name cannot be empty"):/[/]/.test(h)?o('File name cannot contain "/"'):h==="."?o('File name cannot be equal to "."'):h===".."?o('File name cannot be equal to ".."'):/\s+$/.test(h)?o("File name cannot end with whitespace"):p(f).find(S=>S.name===h)?o("%{name} already exists",{name:h},!0):null,T=(h,b)=>(c.upsertResource(h),l(b,p(e),h)),v=(h,b,S)=>{let E=o("New file")+`.${b}`;p(f).some(R=>R.name===E)&&(E=qn(E,b,p(f))),y.value||(E=te.extractNameWithoutExtension({name:E,extension:b}));const _=y.value?[0,E.length-(b.length+1)]:null;i({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:E,inputLabel:o("File name"),inputSelectionRange:_,onConfirm:async R=>{y.value||(R=`${R}.${b}`);try{let A;if(S.createFileHandler)A=await S.createFileHandler({fileName:R,space:p(e),currentFolder:p(d)});else{const $=gt.join(p(d).path,R);A=await u.webdav.putFileContents(p(e),{path:$})}return c.upsertResource(A),t({title:o('"%{fileName}" was created successfully',{fileName:A.name})}),p(a)?void 0:T(A,S)}catch(A){console.error(A),n({title:o("Failed to create file"),errors:[A]})}},onInput:(R,A)=>A(m(y.value?R:`${R}.${b}`))})};return{actions:j(()=>{var S;const h=[],b={};for(const E of p(w)||[])E.hasPriority?b[E.extension]=E:b[E.extension]=b[E.extension]||E;for(const[,E]of Object.entries(b))h.push({name:"create-new-file",icon:"add",handler:_=>v(_,E.extension,E),label:()=>o(E.newFileMenu.menuTitle()),isVisible:()=>{var _;return(_=p(d))==null?void 0:_.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:(S=E.app)==null?void 0:S.startsWith("external-")});return h}),getNameErrorMsg:m,openFile:T}},wv="rowMounted",Ff="fileDropped",nO="contextmenuClicked";class Wn{}Se(Wn,"Thumbnail",[36,36]),Se(Wn,"Tile",[1e3,1e3]),Se(Wn,"Preview",[1200,1200]),Se(Wn,"Avatar",64);class oa{}Se(oa,"Thumbnail","thumbnail"),Se(oa,"Preview","preview"),Se(oa,"Avatar","avatar");class rO{constructor(t,n,r){Se(this,"state");Se(this,"observeEnter");Se(this,"observeExit");Se(this,"onEnterCallCount");Se(this,"onExitCallCount");Se(this,"onEnter");Se(this,"onExit");Se(this,"threshold");Se(this,"unobserver");this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class Sv{constructor(t={}){Se(this,"targets");Se(this,"intersectionObserver");Se(this,"options");this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new rO(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const iO={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},oO={name:"layout-grid",color:"var(--oc-role-secondary)"},sO={name:"resource-type-file",color:"var(--oc-role-on-surface)"},aO=Rp(),lO=$e({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>jP.some(t=>t===e)}},setup(e){const t=dr(Ap),n=j(()=>e.resource.type==="folder"||e.resource.isFolder),r=j(()=>e.resource.type==="space"),o=j(()=>{var l;return(l=e.resource.extension)==null?void 0:l.toLowerCase()}),i=j(()=>{var l;return(l=e.resource.mimeType)==null?void 0:l.toLowerCase()}),s=j(()=>{if(p(r))return oO;if(p(n))return iO;const l=aO[p(o)]||(t==null?void 0:t.mimeType[p(i)])||(t==null?void 0:t.extension[p(o)]);return{...sO,...l}}),a=j(()=>p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:a}}});function cO(e,t,n,r,o,i){const s=ge("oc-icon");return Z(),Ie(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:W.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const Io=ze(lO,[["render",cO]]),uO={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=at(),{options:n}=Ge.storeToRefs(t);return{linkTarget:j(()=>p(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},fO={key:1};function dO(e,t,n,r,o,i){return n.isResourceClickable?(Z(),Ie(Cr(i.componentType),zt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=An(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Ee(()=>[Ke(e.$slots,"default")]),_:3},16,["target","onClick"])):(Z(),me("span",fO,[Ke(e.$slots,"default")]))}const Of=ze(uO,[["render",dO]]),pO=$e({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?ss.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),hO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],gO={key:0,class:"oc-text-truncate"},mO=["textContent"],yO=["textContent"],bO=["textContent"];function vO(e,t,n,r,o,i){const s=sn("oc-tooltip");return ot((Z(),me("span",{class:W.normalizeClass(["oc-resource-name",[{"oc-display-inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(Z(),me("span",gO,[pe("span",{class:"oc-resource-basename",textContent:W.toDisplayString(e.displayName)},null,8,mO)])):(Z(),me("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:W.toDisplayString(e.displayName)},null,8,yO)),e.extension&&e.isExtensionDisplayed?(Z(),me("span",{key:2,class:"oc-resource-extension",textContent:W.toDisplayString(e.displayExtension)},null,8,bO)):Fe("",!0)],10,hO)),[[s,e.tooltip]])}const xf=ze(pO,[["render",vO]]),wO=$e({name:"ResourceListItem",components:{ResourceIcon:Io,ResourceLink:Of,ResourceName:xf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),SO={class:"oc-resource-indicators"},EO=["textContent"];function TO(e,t,n,r,o,i){const s=ge("oc-image"),a=ge("resource-icon"),l=ge("resource-link"),u=ge("resource-name"),c=ge("oc-icon"),f=sn("oc-tooltip");return Z(),me("div",{class:W.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(Z(),Ie(l,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Ee(()=>[e.hasThumbnail?ot((Z(),Ie(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):ot((Z(),Ie(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Fe("",!0),pe("div",{class:W.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[he(l,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Ee(()=>[(Z(),Ie(u,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","onClick"]),pe("div",SO,[e.isPathDisplayed?(Z(),Ie(Cr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:W.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Ee(()=>[he(c,W.normalizeProps(Ha(e.parentFolderLinkIconAttrs)),null,16),pe("span",{class:"text oc-text-truncate",textContent:W.toDisplayString(e.parentFolderName)},null,8,EO)]),_:1},8,["to","style"])):Fe("",!0)])],2)],2)}const Co=ze(wO,[["render",TO]]),Ev=$e({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new Sv,{triggerDefaultAction:n}=zn(),{getMatchingSpace:r}=ln(),{getDefaultAction:o}=zn(),{loadPreview:i}=Bf(),s=qd("resourceListItem"),{getPathPrefix:a,getParentFolderName:l,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:f}=si(),d=Xe(),y=le(),w=j(()=>d.areFileExtensionsShown),m=j(()=>({...e.searchResult.data,...p(y)&&{thumbnail:p(y)}})),T=j(()=>r(p(m))),v=j(()=>{const R=p(m);return te.isSpaceResource(R)&&R.disabled===!0}),g=()=>{n({space:p(T),resources:[p(m)]})},h=j(()=>e.isClickable?{parentFolderLink:u(p(m)),onClick:g}:{isResourceClickable:!1}),b=j(()=>{var $;if(p(m).isFolder)return f(p(m));const R=o({resources:[p(m)],space:p(T)});if(!(R!=null&&R.route))return null;const A=R.route({space:p(T),resources:[p(m)]});return A.query={...A.query,contextRouteQuery:{...(($=A.query)==null?void 0:$.contextRouteQuery)||{},term:e.term}},A}),S=a(p(m)),E=l(p(m)),_=c(p(m));return Mt(()=>{p(v)&&p(s).parentElement.classList.add("disabled");const R=async()=>{const $=await i({space:p(T),resource:p(m),dimensions:Wn.Thumbnail,cancelRunning:!0,updateStore:!1});$&&(y.value=$)},A=Tt.debounce(({unobserve:$})=>{$(),R()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),Un(()=>{t.disconnect()}),(R,A)=>(Z(),Ie(Co,zt({ref_key:"resourceListItem",ref:s,resource:m.value,"path-prefix":p(S),"is-path-displayed":!0,link:b.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(_),"parent-folder-name":p(E),"is-thumbnail-displayed":!!y.value},h.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),AO=7,RO=200,_O=$e({name:"CreateShortcutModal",components:{ResourcePreview:Ev},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Je(),{$gettext:o}=xe.useGettext(),{showMessage:i,showErrorMessage:s}=it(),a=We(),{search:l}=vf(),{getPathPrefix:u,getParentFolderName:c,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:y}=si(),w=Xe(),{resources:m,currentFolder:T}=Ge.storeToRefs(w),v=le(null),g=le(""),h=le(""),b=le(null),S=le(null),E=le(!1);let _=null;const R=G=>{const V=G.trim();return Q(V)?V:`https://${V}`},A=j(()=>R(p(g))),$=j(()=>!!p(m).find(G=>G.name===`${p(h)}.url`)),L=j(()=>p($)||!p(h)||!p(g));wt(L,()=>{t("update:confirmDisabled",p(L))},{immediate:!0});const k=j(()=>p($)?o("%{name} already exists",{name:`${p(h)}.url`}):/[/]/.test(p(h))?o('Shortcut name cannot contain "/"'):""),N=un.useTask(function*(G,V){b.value=null,V=`name:"*${V}*" NOT name:"*.url"`;try{b.value=yield l(V,AO)}catch{}}),z=Tt.debounce(()=>{N.perform(p(g))},RO),Q=G=>["http://","https://"].some(M=>M.startsWith(G)||G.startsWith(M)),J=()=>{b.value=null,g.value=p(A);try{let G=new URL(p(A)).host;p(m).some(V=>V.name===`${G}.url`)&&(G=qn(`${G}.url`,"url",p(m)).slice(0,-4)),h.value=G}catch{}},ae=G=>{b.value=null;const V=new URL(window.location.href);let M=G.data.name;g.value=`${V.origin}/f/${G.id}`,p(m).some(q=>q.name===`${M}.url`)&&(M=qn(`${M}.url`,"url",p(m)).slice(0,-4)),h.value=M},re=G=>p(S)===G,se=(G=!1)=>{const V=Array.from(document.querySelectorAll("li.selectable-item"));let M=p(S)!==null?p(S):G?V.length:-1;const q=G?-1:1;do if(M+=q,M<0||M>V.length-1)return null;while(V[M].classList.contains("disabled"));return M},ue=()=>{S.value=se(!0)},we=()=>{S.value=se(!1)},ee=G=>{p(E)&&(G.stopPropagation(),p(v).hide())},ie=G=>{var V,M;p(E)&&(G.stopPropagation(),p(S)!==null&&(p(S)===0?J():ae((M=(V=p(b))==null?void 0:V.values)==null?void 0:M[p(S)-1]),p(v).hide()))},ce=()=>{E.value=!1,S.value=null},Ce=()=>{E.value=!0,S.value=0},H=()=>{g.value.trim().length&&p(v).show()},I=async()=>{if(await jn(),h.value=g.value.trim(),!g.value.trim().length){p(v).hide();return}p(v).show(),Rn(a,"files-public-link")||z()},F=async()=>{try{const V=`[InternetShortcut]
|
|
50
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?e(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,u){let c="",f="";const d=u.join(".");for(let y in a)if(Object.prototype.hasOwnProperty.call(a,y))if(typeof a[y]>"u")this.isAttribute(y)&&(f+="");else if(a[y]===null)this.isAttribute(y)||y===this.options.cdataPropName?f+="":y[0]==="?"?f+=this.indentate(l)+"<"+y+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+y+"/"+this.tagEndChar;else if(a[y]instanceof Date)f+=this.buildTextValNode(a[y],y,"",l);else if(typeof a[y]!="object"){const w=this.isAttribute(y);if(w&&!this.ignoreAttributesFn(w,d))c+=this.buildAttrPairStr(w,""+a[y]);else if(!w)if(y===this.options.textNodeName){let m=this.options.tagValueProcessor(y,""+a[y]);f+=this.replaceEntitiesValue(m)}else f+=this.buildTextValNode(a[y],y,"",l)}else if(Array.isArray(a[y])){const w=a[y].length;let m="",T="";for(let v=0;v<w;v++){const g=a[y][v];if(!(typeof g>"u"))if(g===null)y[0]==="?"?f+=this.indentate(l)+"<"+y+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+y+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const h=this.j2x(g,l+1,u.concat(y));m+=h.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(T+=h.attrStr)}else m+=this.processTextOrObjNode(g,y,l,u);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(y,g);h=this.replaceEntitiesValue(h),m+=h}else m+=this.buildTextValNode(g,y,"",l)}this.options.oneListGroup&&(m=this.buildObjectNode(m,y,T,l)),f+=m}else if(this.options.attributesGroupName&&y===this.options.attributesGroupName){const w=Object.keys(a[y]),m=w.length;for(let T=0;T<m;T++)c+=this.buildAttrPairStr(w[T],""+a[y][w[T]])}else f+=this.processTextOrObjNode(a[y],y,l,u);return{attrStr:c,val:f}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function o(a,l,u,c){const f=this.j2x(a,u+1,c.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,f.attrStr,u):this.buildObjectNode(f.val,l,f.attrStr,u)}r.prototype.buildObjectNode=function(a,l,u,c){if(a==="")return l[0]==="?"?this.indentate(c)+"<"+l+u+"?"+this.tagEndChar:this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar;{let f="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",f=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(c)+"<"+l+u+d+">"+a+f:this.options.commentPropName!==!1&&l===this.options.commentPropName&&d.length===0?this.indentate(c)+`<!--${a}-->`+this.newLine:this.indentate(c)+"<"+l+u+d+this.tagEndChar+a+this.indentate(c)+f}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,u,c){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(c)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(c)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(c)+"<"+l+u+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(l,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar:this.indentate(c)+"<"+l+u+">"+f+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const u=this.options.entities[l];a=a.replace(u.regex,u.val)}return a};function i(a){return this.options.indentBy.repeat(a)}function s(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return af=r,af}var lf,qy;function Z_(){if(qy)return lf;qy=1;const e=Fy(),t=X_(),n=J_();return lf={XMLParser:t,XMLValidator:e,XMLBuilder:n},lf}Z_();class Vy{isEnabled(){return!0}isActive(t){return _n(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,clientService:{webdav:r}}=t;return un.useTask(function*(o,i,s){n.clearResourceList(),n.setAncestorMetaData({});const{resource:a,children:l}=yield r.listFiles(s,{},{depth:1,davProperties:vs.Trashbin,isTrash:!0,signal:o});n.initResourceList({currentFolder:a,resources:l})})}}class zy{constructor(){Se(this,"loaders");this.loaders=[new zh,new Wh,new Hh,new Gh,new Kh,new Vy]}getTask(){const t=vt(),n=lt(),r=nn(),o=We(),i=Je(),s=at(),a=Xe(),l=jt(),u=bf(),c=this.loaders.find(f=>f.isEnabled()&&f.isActive(p(o)));if(!c){console.debug("No folder loader found for route");return}return un.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:l,router:o,authService:u};try{yield c.getTask(d).perform(...f)}catch(y){console.error(y)}})}}const Wy=new zy;var Or=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Or||{});const eI=200;class tI{constructor(){Se(this,"tasks",[])}get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,o)=>(r+=o.state.current/o.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=eI,indeterminate:r=!0}={}){const o={id:Xt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),Tt.debounce(()=>{o.active=!0,Ye.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:l})=>{r||this.setProgress({task:o,total:a,current:l})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Ye.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Ye.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var nI="__lodash_hash_undefined__";function rI(e){return this.__data__.set(e,nI),this}function iI(e){return this.__data__.has(e)}function Ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new gr;++t<n;)this.add(e[t])}Ls.prototype.add=Ls.prototype.push=rI,Ls.prototype.has=iI;function oI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function sI(e,t){return e.has(t)}var aI=1,lI=2;function Hy(e,t,n,r,o,i){var s=n&aI,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var f=-1,d=!0,y=n&lI?new Ls:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var w=e[f],m=t[f];if(r)var T=s?r(m,w,f,t,e,i):r(w,m,f,e,t,i);if(T!==void 0){if(T)continue;d=!1;break}if(y){if(!oI(t,function(v,g){if(!sI(y,g)&&(w===v||o(w,v,n,r,i)))return y.push(g)})){d=!1;break}}else if(!(w===m||o(w,m,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function cI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function uI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var fI=1,dI=2,pI="[object Boolean]",hI="[object Date]",gI="[object Error]",mI="[object Map]",yI="[object Number]",bI="[object RegExp]",vI="[object Set]",wI="[object String]",SI="[object Symbol]",EI="[object ArrayBuffer]",TI="[object DataView]",Gy=Pn?Pn.prototype:void 0,cf=Gy?Gy.valueOf:void 0;function AI(e,t,n,r,o,i,s){switch(n){case TI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case EI:return!(e.byteLength!=t.byteLength||!i(new us(e),new us(t)));case pI:case hI:case yI:return eo(+e,+t);case gI:return e.name==t.name&&e.message==t.message;case bI:case wI:return e==t+"";case mI:var a=cI;case vI:var l=r&fI;if(a||(a=uI),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=dI,s.set(e,t);var c=Hy(a(e),a(t),r,o,i,s);return s.delete(e),c;case SI:if(cf)return cf.call(e)==cf.call(t)}return!1}function uf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Ky(e,t,n){var r=t(e);return Fn(e)?r:uf(r,n(e))}function RI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}function Qy(){return[]}var _I=Object.prototype,II=_I.propertyIsEnumerable,Xy=Object.getOwnPropertySymbols,Yy=Xy?function(e){return e==null?[]:(e=Object(e),RI(Xy(e),function(t){return II.call(e,t)}))}:Qy;function CI(e){return oo(e)?Xp(e):Mh(e)}function Jy(e){return Ky(e,CI,Yy)}var PI=1,FI=Object.prototype,OI=FI.hasOwnProperty;function xI(e,t,n,r,o,i){var s=n&PI,a=Jy(e),l=a.length,u=Jy(t),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in t:OI.call(t,d)))return!1}var y=i.get(e),w=i.get(t);if(y&&w)return y==t&&w==e;var m=!0;i.set(e,t),i.set(t,e);for(var T=s;++f<l;){d=a[f];var v=e[d],g=t[d];if(r)var h=s?r(g,v,d,t,e,i):r(v,g,d,e,t,i);if(!(h===void 0?v===g||o(v,g,n,r,i):h)){m=!1;break}T||(T=d=="constructor")}if(m&&!T){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(e),i.delete(t),m}var kI=1,Zy="[object Arguments]",eb="[object Array]",Ms="[object Object]",NI=Object.prototype,tb=NI.hasOwnProperty;function $I(e,t,n,r,o,i){var s=Fn(e),a=Fn(t),l=s?eb:Nn(e),u=a?eb:Nn(t);l=l==Zy?Ms:l,u=u==Zy?Ms:u;var c=l==Ms,f=u==Ms,d=l==u;if(d&&Si(e)){if(!Si(t))return!1;s=!0,c=!1}if(d&&!c)return i||(i=new Xn),s||ds(e)?Hy(e,t,n,r,o,i):AI(e,t,l,n,r,o,i);if(!(n&kI)){var y=c&&tb.call(e,"__wrapped__"),w=f&&tb.call(t,"__wrapped__");if(y||w){var m=y?e.value():e,T=w?t.value():t;return i||(i=new Xn),o(m,T,n,r,i)}}return d?(i||(i=new Xn),xI(e,t,n,r,o,i)):!1}function nb(e,t,n,r,o){return e===t?!0:e==null||t==null||!Yn(e)&&!Yn(t)?e!==e&&t!==t:$I(e,t,n,r,nb,o)}function rb(e,t){return nb(e,t)}const ff=(e="")=>e.split("/").map(encodeURIComponent).join("/"),DI=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{fl(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class LI{constructor({clientService:t,userStore:n,authStore:r,capabilityStore:o,configStore:i}){Se(this,"clientService");Se(this,"configStore");Se(this,"userStore");Se(this,"authStore");Se(this,"capabilityStore");Se(this,"capability");this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,n=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(n?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(n=>n.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,n=!1,r=!0,o){const{space:i,resource:s}=t,a=this.available&&this.isMimetypeSupported(s.mimeType),l=s.type!=="folder"&&s.extension&&s.canDownload();if(!a||!l)return;const u=te.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(c){if(r)return;throw c}}}async cacheFactory(t,n,r){const{resource:o,dimensions:i}=t,s=Ul.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&rb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return Ul.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return D0.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,o){var u,c;const{resource:i,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,o);const l=[this.configStore.serverUrl,"remote.php/dav",ff(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(l,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((c=(u=f.response)==null?void 0:u.headers)==null?void 0:c["retry-after"])||5;return await new Promise(y=>setTimeout(y,d*1e3)),this.privatePreviewBlob(t,n,r,o)}throw f}}async publicPreviewUrl(t,n){var c,f;const{resource:r,dimensions:o,processor:i}=t,[s,a]=r.downloadURL.split("?"),l=[this.buildQueryString({etag:r.etag,dimensions:o,processor:i}),a].filter(Boolean).join("&"),u=[s,l].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const y=((f=(c=d.response)==null?void 0:c.headers)==null?void 0:f["retry-after"])||5;return await new Promise(w=>setTimeout(w,y*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const Bs=be.z.enum(["fit","resize","fill","thumbnail"]);class MI{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class BI{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!Tt.isObject(t))throw new Error("options should be an object");if(!Tt.isNumber(t.minLength)||Tt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Tt.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class js{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!Tt.isObject(t))throw new Error("options should be an object");if(!Tt.isNumber(t.minLength)||Tt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class jI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class UI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class qI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class VI extends js{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Tt.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var df={},ib;function zI(){if(ib)return df;ib=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",a="",l=i.length,u=i.lowercase,c=i.uppercase,f=i.numbers,d=i.symbols,y=i.minLengthLowercase,w=i.minLengthUppercase,m=i.minLengthNumbers,T=i.minLengthSymbols,v=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,v);var h="ABCDEFGHIJKLMNOPQRSTUVWXYZ";h=n(h,v);var b="0123456789";b=n(b,v);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,v);for(var E=g.length,_=0;_<y;_++)a+=g.charAt(e(E));for(E=h.length,_=0;_<w;_++)a+=h.charAt(e(E));for(E=b.length,_=0;_<m;_++)a+=b.charAt(e(E));for(E=S.length,_=0;_<T;_++)a+=S.charAt(e(E));s+=function($){for(var L=$.split(""),k=L.length-1;k>0;k--){var N=Math.floor(Math.random()*(k+1)),z=L[k];L[k]=L[N],L[N]=z}return L.join("")}(a);var R="";R=u?R+g:R,R=c?R+h:R,R=f?R+b:R,R=d?R+S:R;var A=l-s.length;for(E=R.length,_=0;_<A;_++)s+=R.charAt(e(E));return s},n=function(i,s){return s==null||s.split("").forEach(function(a){i=i.replace(a,"")}),i},r=function(i){var s=i.length,a=i.lowercase,l=i.uppercase,u=i.numbers,c=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(a==0&&l==0&&u==0&&c==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return df.GeneratePassword=function(i){return i?(i=o(i),r(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),r(i),t(i))},df}var WI=zI();class HI{constructor({language:t}){Se(this,"language");Se(this,"capability");Se(this,"policy");Se(this,"generatePasswordRules");this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new jI({...this.language}),mustNotBeEmpty:new MI({...this.language}),atLeastUppercaseCharacters:new UI({...this.language}),atLeastLowercaseCharacters:new qI({...this.language}),atLeastDigits:new VI({...this.language}),mustContain:new BI({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new L0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return WI.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function GI(e){return e.charCodeAt(0).toString(32)}function ob(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${GI(n)}`,"/"))+t}function sb(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${ob(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${ob(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class KI{constructor({language:t}){Se(this,"uppy");Se(this,"uploadInputs",[]);Se(this,"uploadFolderMap",{});Se(this,"getRelativeFilePath",t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?te.urlJoin(n):void 0});const{$gettext:n}=t;this.uppy=new M0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=sb(r,this.uppy.getID()),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:o,headers:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,c,f,d)=>{var y,w;return((y=u==null?void 0:u.originalResponse)==null?void 0:y.getStatus())>=500?!1:((w=u==null?void 0:u.originalResponse)==null?void 0:w.getStatus())===401?!0:d(u)}},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const l=this.uppy.getPlugin("Tus");if(l){l.setOptions(s);return}this.uppy.use(B0,s)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(j0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(U0,{target:t,onDragOver:n=>{this.publish("drag-over",n)},onDragLeave:n=>{this.publish("drag-out",n)},onDrop:n=>{this.publish("drop",n)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Ye.subscribe(t,n)}unsubscribe(t,n){Ye.unsubscribe(t,n)}publish(t,n){Ye.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{t&&(this.publish("uploadCompleted",t),t.successful.forEach(n=>{this.uppy.removeFile(n.id)}),this.clearInputs())}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const o=r.target,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return sb(t,this.uppy.getID())}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function QI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var XI=Object.getOwnPropertySymbols,YI=XI?function(e){for(var t=[];e;)uf(t,Yy(e)),e=ul(e);return t}:Qy;function ab(e){return Ky(e,gl,YI)}var JI=Object.prototype,ZI=JI.hasOwnProperty;function eC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ZI.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function tC(e,t){var n=cl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var nC=/\w*$/;function rC(e){var t=new e.constructor(e.source,nC.exec(e));return t.lastIndex=e.lastIndex,t}var lb=Pn?Pn.prototype:void 0,cb=lb?lb.valueOf:void 0;function iC(e){return cb?Object(cb.call(e)):{}}var oC="[object Boolean]",sC="[object Date]",aC="[object Map]",lC="[object Number]",cC="[object RegExp]",uC="[object Set]",fC="[object String]",dC="[object Symbol]",pC="[object ArrayBuffer]",hC="[object DataView]",gC="[object Float32Array]",mC="[object Float64Array]",yC="[object Int8Array]",bC="[object Int16Array]",vC="[object Int32Array]",wC="[object Uint8Array]",SC="[object Uint8ClampedArray]",EC="[object Uint16Array]",TC="[object Uint32Array]";function AC(e,t,n){var r=e.constructor;switch(t){case pC:return cl(e);case oC:case sC:return new r(+e);case hC:return tC(e);case gC:case mC:case yC:case bC:case vC:case wC:case SC:case EC:case TC:return $p(e,n);case aC:return new r;case lC:case fC:return new r(e);case cC:return rC(e);case uC:return new r;case dC:return iC(e)}}var RC="[object Map]";function _C(e){return Yn(e)&&Nn(e)==RC}var ub=Ei&&Ei.isMap,IC=ub?dl(ub):_C,CC="[object Set]";function PC(e){return Yn(e)&&Nn(e)==CC}var fb=Ei&&Ei.isSet,FC=fb?dl(fb):PC,OC=1,db="[object Arguments]",xC="[object Array]",kC="[object Boolean]",NC="[object Date]",$C="[object Error]",pb="[object Function]",DC="[object GeneratorFunction]",LC="[object Map]",MC="[object Number]",hb="[object Object]",BC="[object RegExp]",jC="[object Set]",UC="[object String]",qC="[object Symbol]",VC="[object WeakMap]",zC="[object ArrayBuffer]",WC="[object DataView]",HC="[object Float32Array]",GC="[object Float64Array]",KC="[object Int8Array]",QC="[object Int16Array]",XC="[object Int32Array]",YC="[object Uint8Array]",JC="[object Uint8ClampedArray]",ZC="[object Uint16Array]",eP="[object Uint32Array]",mt={};mt[db]=mt[xC]=mt[zC]=mt[WC]=mt[kC]=mt[NC]=mt[HC]=mt[GC]=mt[KC]=mt[QC]=mt[XC]=mt[LC]=mt[MC]=mt[hb]=mt[BC]=mt[jC]=mt[UC]=mt[qC]=mt[YC]=mt[JC]=mt[ZC]=mt[eP]=!0,mt[$C]=mt[pb]=mt[VC]=!1;function Us(e,t,n,r,o,i){var s,a=t&OC;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!Qn(e))return e;var l=Fn(e);if(l)s=eC(e);else{var u=Nn(e),c=u==pb||u==DC;if(Si(e))return Np(e,a);if(u==hb||u==db||c&&!o)s={};else{if(!mt[u])return o?e:{};s=AC(e,u,a)}}i||(i=new Xn);var f=i.get(e);if(f)return f;i.set(e,s),FC(e)?e.forEach(function(w){s.add(Us(w,t,n,w,e,i))}):IC(e)&&e.forEach(function(w,m){s.set(m,Us(w,t,n,m,e,i))});var d=ab,y=l?void 0:d(e);return QI(y||e,function(w,m){y&&(m=w,w=e[m]),Gp(s,m,Us(w,t,n,m,e,i))}),s}function tP(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}function nP(e,t){return t.length<2?e:gh(e,tP(t,0,-1))}function rP(e,t){return t=_l(t,e),e=nP(e,t),e==null||delete e[hh(nd(t))]}function iP(e){return fl(e)?void 0:e}var gb=Pn?Pn.isConcatSpreadable:void 0;function oP(e){return Fn(e)||io(e)||!!(gb&&e&&e[gb])}function sP(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=oP),o||(o=[]);++i<s;){var a=e[i];n(a)?uf(o,a):o[o.length]=a}return o}function aP(e){var t=e==null?0:e.length;return t?sP(e):[]}function lP(e){return th(eh(e,void 0,aP),e+"")}var cP=1,uP=2,fP=4,ki=lP(function(e,t){var n={};if(e==null)return n;var r=!1;t=uh(t,function(i){return i=_l(i,e),r||(r=i.length>1),i}),Kp(e,ab(e),n),r&&(n=Us(n,cP|uP|fP,iP));for(var o=t.length;o--;)rP(n,t[o]);return n});const dP=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:Xt.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:ki(e.query,"fileId","page")},isStaticNav:!1}))},pP=(...e)=>{const t=e.pop();return[...e,{id:Xt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Ye.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ti{}Se(ti,"Cut","cut"),Se(ti,"Copy","copy");const pf=e=>e.clientY===0,wo=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=pf(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!pf(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!pf(t)?t.clientX:r.x})}),e.show()},qs=e=>(e||"").split("_")[0],ni=(e,t,n=Dt.DateTime.DATETIME_MED)=>e.setLocale(qs(t)).toLocaleString(n),mb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromJSDate(e),t,n),hP=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromHTTP(e),t,n),yb=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromISO(e),t,n),gP=(e,t,n=Dt.DateTime.DATETIME_MED)=>ni(Dt.DateTime.fromRFC2822(e),t,n),So=(e,t)=>e.setLocale(qs(t)).toRelative(),bb=(e,t)=>So(Dt.DateTime.fromJSDate(e),t),mP=(e,t)=>So(Dt.DateTime.fromHTTP(e),t),yP=(e,t)=>So(Dt.DateTime.fromISO(e),t),bP=(e,t)=>So(Dt.DateTime.fromRFC2822(e),t),vP=1048576,Sn=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":$0.filesize(n,{round:n<vP?0:1,locale:qs(t),base:10,output:"string"})};function vb(e="",t=!1){const n=te.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],o=n.split("/");for(t&&r.push(n),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}r.push(o.join("/")),o.pop()}return r}var yt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(yt||{});const hf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=le(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return wt(()=>p(r),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},ri=()=>{const e=at(),t=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),n=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),r=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),a=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),l=j(()=>{var d;return p(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:l,fileTypes:s,postMessage:(d,y)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:d,data:y},w)},verifyDelegatedAuthenticationOrigin:d=>p(u)?p(u)===d:!0}},wb=e=>{const{isEnabled:t}=ri(),n=(e==null?void 0:e.bus)||Ye,r=hf("oc_sideBarOpen",!1),o=le(!1),i=j({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await jn();const w=document.getElementById("app-sidebar");w&&w.focus()},a=le(null),l=n.subscribe(yt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(yt.close,()=>{i.value=!1,a.value=null}),c=n.subscribe(yt.open,()=>{i.value=!0,a.value=null,s()}),f=n.subscribe(yt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),d=n.subscribe(yt.setActivePanel,w=>{a.value=w});Un(()=>{n.unsubscribe(yt.toggle,l),n.unsubscribe(yt.close,u),n.unsubscribe(yt.open,c),n.unsubscribe(yt.openWithPanel,f),n.unsubscribe(yt.setActivePanel,d)});const y=(w,m)=>{n.subscribe(yt.setActivePanel,T=>{w===T&&setTimeout(()=>{m(T)},100)})};return{isSideBarOpen:lr(i),sideBarActivePanel:lr(a),onPanelActive:y}},tr=e=>e,Sb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.authenticated,e??[]),Eb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.unauthenticated,e??[]),wP=({isDirect:e})=>tr(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),SP=({isDirect:e})=>tr(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),EP=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:wP({isDirect:t}),label:tr("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Ye.publish(yt.openWithPanel,"sharing#peopleShares")}}),TP=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:SP({isDirect:t}),label:tr("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Ye.publish(yt.openWithPanel,"sharing#linkShares")}}),AP=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:tr("Item locked"),label:tr("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),RP=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:tr("Item in processing"),label:tr("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),Tb=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(AP({resource:t})),t.processing&&o.push(RP({resource:t})),te.isProjectSpaceResource(e)&&e.isMember(r)||te.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,c)=>(u.push(...c.shareTypes||[]),u),[]),a=Sb(t.shareTypes);(a||Sb(s))&&o.push(EP({resource:t,isDirect:a}));const l=Eb(t.shareTypes);(l||Eb(s))&&o.push(TP({resource:t,isDirect:l}))}return o},Ab=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Rb=e=>new Promise(t=>e.toBlob(t)),it=Ge.defineStore("messages",()=>{const e=le([]),t=i=>{const s={...i,id:Xt.v4()};return e.value.push(s),s},n=i=>{const s=a=>{var l,u;return(u=(l=a.response)==null?void 0:l.headers)==null?void 0:u.get("x-request-id")};return i.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
|
|
51
|
+
`)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:Xt.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:n(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=p(e).filter(({id:s})=>i.id!==s)}}}),Eo=Ge.defineStore("clipboard",()=>{const{$gettext:e}=xe.useGettext(),{showMessage:t}=it(),n=le(),r=le([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ti.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ti.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),_b={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},at=Ge.defineStore("config",()=>{const e=Zn(),t=le(""),n=le(""),r=le({..._b}),o=le([]),i=le([]),s=le([]),a=le(),l=le(),u=le(),c=le([]),f=le([]),d=j(()=>te.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),y=j(()=>!!p(a)),w=j(()=>!!p(l));return{options:r,oAuth2:a,openIdConnect:l,isOAuth2:y,isOIDC:w,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:n,scripts:c,styles:f,serverUrl:d,loadConfig:T=>{var v;T.server&&(t.value=(v=T.server)!=null&&v.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],s.value=T.customTranslations||[],a.value=T.auth,l.value=T.openIdConnect,u.value=T.sentry,c.value=T.scripts||[],f.value=T.styles||[],n.value=T.theme,T.options&&(r.value=ao({..._b},T.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),T.external_apps&&(i.value=T.external_apps,T.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),_P=be.z.object({url:be.z.string()}),IP=be.z.object({apiUrl:be.z.string().optional(),authUrl:be.z.string().optional(),clientId:be.z.string().optional(),clientSecret:be.z.string().optional(),logoutUrl:be.z.string().optional(),metaDataUrl:be.z.string().optional(),url:be.z.string().optional()}),CP=be.z.object({authority:be.z.string().optional(),client_id:be.z.string().optional(),client_secret:be.z.string().optional(),dynamic:be.z.string().optional(),metadata_url:be.z.string().optional(),post_logout_redirect_uri:be.z.string().optional(),response_type:be.z.string().optional(),scope:be.z.string().optional()}).passthrough(),PP=be.z.record(be.z.any()),FP=be.z.object({href:be.z.string().optional()}),OP=be.z.object({async:be.z.boolean().optional(),src:be.z.string().optional()}),xP=be.z.object({cernFeatures:be.z.boolean().optional(),concurrentRequests:be.z.object({resourceBatchActions:be.z.number().optional(),sse:be.z.number().optional(),shares:be.z.object({create:be.z.number().optional(),list:be.z.number().optional()}).optional()}).optional(),contextHelpers:be.z.boolean().optional(),contextHelpersReadMore:be.z.boolean().optional(),defaultExtension:be.z.string().optional(),disabledExtensions:be.z.array(be.z.string()).optional(),disableFeedbackLink:be.z.boolean().optional(),accountEditLink:be.z.object({href:be.z.string().optional()}).optional(),editor:be.z.object({autosaveEnabled:be.z.boolean().optional(),autosaveInterval:be.z.number().optional(),openAsPreview:be.z.union([be.z.boolean(),be.z.array(be.z.string())]).optional()}).optional(),embed:be.z.object({enabled:be.z.boolean().optional(),target:be.z.string().optional(),messagesOrigin:be.z.string().optional(),delegateAuthentication:be.z.boolean().optional(),delegateAuthenticationOrigin:be.z.string().optional(),fileTypes:be.z.array(be.z.string()).optional(),chooseFileName:be.z.boolean().optional(),chooseFileNameSuggestion:be.z.string().optional()}).optional(),feedbackLink:be.z.object({ariaLabel:be.z.string().optional(),description:be.z.string().optional(),href:be.z.string().optional()}).optional(),isRunningOnEos:be.z.boolean().optional(),loginUrl:be.z.string().optional(),logoutUrl:be.z.string().optional(),ocm:be.z.object({openRemotely:be.z.boolean().optional()}).optional(),routing:be.z.object({fullShareOwnerPaths:be.z.boolean().optional(),idBased:be.z.boolean().optional()}).optional(),runningOnEos:be.z.boolean().optional(),tokenStorageLocal:be.z.boolean().optional(),upload:be.z.object({companionUrl:be.z.string().optional()}).optional(),userListRequiresFilter:be.z.boolean().optional(),hideLogo:be.z.boolean().optional()}),kP=be.z.object({id:be.z.string(),path:be.z.string(),config:be.z.record(be.z.unknown()).optional()}),NP=be.z.object({server:be.z.string(),theme:be.z.string(),options:xP,apps:be.z.array(be.z.string()).optional(),external_apps:be.z.array(kP).optional(),customTranslations:be.z.array(_P).optional(),auth:IP.optional(),openIdConnect:CP.optional(),sentry:PP.optional(),scripts:be.z.array(OP).optional(),styles:be.z.array(FP).optional()}),Ib=Ge.defineStore("extensionPreferences",()=>{const e=jr.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(p(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Ni=Ge.defineStore("extensionRegistry",()=>{const e=at(),t=le([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(c=>le(p(c).filter(({id:f})=>!u.includes(f)))).filter(c=>p(c).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return p(t).flatMap(c=>p(c).filter(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=le([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=p(i).map(c=>le(p(c).filter(({id:f})=>!u.includes(f)))).filter(c=>p(c).length)},getExtensionPoints:(u={})=>p(i).flatMap(c=>p(c).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),bt=Ge.defineStore("modals",()=>{const e=le([]),t=j(()=>p(e).at(-1)),n=l=>p(e).find(u=>u.id===l);return{modals:e,activeModal:t,dispatchModal:l=>{const u={...l,id:Xt.v4()};return e.value.push(u),u},updateModal:(l,u,c)=>{const f=n(l);f[u]=c},removeModal:l=>{e.value=p(e).filter(u=>u.id!==l)},removeAllModals:()=>{e.value=[]},setModalActive:l=>{const u=p(e).findIndex(f=>f.id===l);if(u<0)return;const c=n(l);p(e).splice(u,1),e.value.push(c)}}}),vt=Ge.defineStore("user",()=>{const e=le();return{user:e,setUser:r=>{e.value=r,V0.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Vs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},$P="thead-clicked",DP="highlight",LP="rowMounted",MP="contextmenuClicked",Cb="itemDropped",BP="itemDragged",jP=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"],UP={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function xr(e){return UP[e]}let Pb=0;const Fb=(e="")=>(e=e||"",Pb+=1,e+Pb);function qP(e,t,n,r){for(var o=-1,i=e==null?0:e.length;++o<i;)n=t(n,e[o],o,e);return n}function VP(e){return function(t){return e==null?void 0:e[t]}}var zP={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},WP=VP(zP),HP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,GP="\\u0300-\\u036f",KP="\\ufe20-\\ufe2f",QP="\\u20d0-\\u20ff",XP=GP+KP+QP,YP="["+XP+"]",JP=RegExp(YP,"g");function ZP(e){return e=Rl(e),e&&e.replace(HP,WP).replace(JP,"")}var eF=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function tF(e){return e.match(eF)||[]}var nF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function rF(e){return nF.test(e)}var Ob="\\ud800-\\udfff",iF="\\u0300-\\u036f",oF="\\ufe20-\\ufe2f",sF="\\u20d0-\\u20ff",aF=iF+oF+sF,xb="\\u2700-\\u27bf",kb="a-z\\xdf-\\xf6\\xf8-\\xff",lF="\\xac\\xb1\\xd7\\xf7",cF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uF="\\u2000-\\u206f",fF=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nb="A-Z\\xc0-\\xd6\\xd8-\\xde",dF="\\ufe0e\\ufe0f",$b=lF+cF+uF+fF,Db="['’]",Lb="["+$b+"]",pF="["+aF+"]",Mb="\\d+",hF="["+xb+"]",Bb="["+kb+"]",jb="[^"+Ob+$b+Mb+xb+kb+Nb+"]",gF="\\ud83c[\\udffb-\\udfff]",mF="(?:"+pF+"|"+gF+")",yF="[^"+Ob+"]",Ub="(?:\\ud83c[\\udde6-\\uddff]){2}",qb="[\\ud800-\\udbff][\\udc00-\\udfff]",$i="["+Nb+"]",bF="\\u200d",Vb="(?:"+Bb+"|"+jb+")",vF="(?:"+$i+"|"+jb+")",zb="(?:"+Db+"(?:d|ll|m|re|s|t|ve))?",Wb="(?:"+Db+"(?:D|LL|M|RE|S|T|VE))?",Hb=mF+"?",Gb="["+dF+"]?",wF="(?:"+bF+"(?:"+[yF,Ub,qb].join("|")+")"+Gb+Hb+")*",SF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",EF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",TF=Gb+Hb+wF,AF="(?:"+[hF,Ub,qb].join("|")+")"+TF,RF=RegExp([$i+"?"+Bb+"+"+zb+"(?="+[Lb,$i,"$"].join("|")+")",vF+"+"+Wb+"(?="+[Lb,$i+Vb,"$"].join("|")+")",$i+"?"+Vb+"+"+zb,$i+"+"+Wb,EF,SF,Mb,AF].join("|"),"g");function _F(e){return e.match(RF)||[]}function IF(e,t,n){return e=Rl(e),t=t,t===void 0?rF(e)?_F(e):tF(e):e.match(t)||[]}var CF="['’]",PF=RegExp(CF,"g");function FF(e){return function(t){return qP(IF(ZP(t).replace(PF,"")),e,"")}}var Kb=FF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Qb=be.z.object({name:be.z.string().optional(),slogan:be.z.string().optional(),logo:be.z.string().optional(),urls:be.z.object({accessDeniedHelp:be.z.string(),imprint:be.z.string(),privacy:be.z.string()}).optional(),shareRoles:be.z.record(be.z.string(),be.z.object({iconName:be.z.string()})).optional()}),OF=be.z.object({breakpoints:be.z.record(be.z.string()).optional(),roles:be.z.record(be.z.string()).optional(),colorPalette:be.z.record(be.z.string()).optional(),fontFamily:be.z.string().optional(),fontSizes:be.z.record(be.z.string()).optional(),sizes:be.z.record(be.z.string()).optional(),spacing:be.z.record(be.z.string()).optional()}),Xb=Qb.extend({designTokens:OF.optional(),favicon:be.z.string().optional(),background:be.z.string().optional()}),xF=Xb.extend({isDark:be.z.boolean(),label:be.z.string()}),Yb=be.z.object({defaults:Xb,themes:be.z.array(xF)}),kF=be.z.object({common:Qb.optional(),clients:be.z.object({web:Yb})}),NF="oc_currentThemeName",ii=Ge.defineStore("theme",()=>{const e=jr.useLocalStorage(NF,null),t=jr.usePreferredDark(),n=le(),r=le([]),o=c=>{const f=td(c.common,c.clients.web.defaults);r.value=c.clients.web.themes.map(d=>td(f,d)),i()},i=()=>{const c=p(r).find(d=>!d.isDark),f=p(r).find(d=>d.isDark);l(p(r).find(d=>d.label===p(e))||(p(t)?f:c)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=j(()=>e.value===null),l=(c,f=!0)=>{var y,w,m,T,v,g;n.value=c,f&&(e.value=p(n).label);const d=[{name:"breakpoints",prefix:"breakpoint"},{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Vs("font-family",p(n).designTokens.fontFamily),d.forEach(h=>{for(const b in p(n).designTokens[h.name])Vs(`${h.prefix}-${Kb(b)}`,p(n).designTokens[h.name][b])}),(w=(y=p(n).designTokens)==null?void 0:y.roles)!=null&&w.chrome||(Vs("role-chrome",(T=(m=p(n).designTokens)==null?void 0:m.roles)==null?void 0:T.surfaceContainer),Vs("role-on-chrome",(g=(v=p(n).designTokens)==null?void 0:v.roles)==null?void 0:g.onSurface))};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:l,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:c=>{var f;return((f=p(n).shareRoles[c.id])==null?void 0:f.iconName)||"user"}}}),jt=Ge.defineStore("shares",()=>{const e=Xe(),{getRoleIcon:t}=ii(),n=le(!1),r=le([]),o=le([]),i=le({}),s=R=>{i.value=R.reduce((A,$)=>(A[$.id]={...$,icon:t($)},A),{})},a=R=>{const A=p(r).find(({id:$})=>$===R.id);if(A){Object.assign(A,R);return}p(r).push(R)},l=R=>{r.value=R},u=R=>{p(r).push(...R)},c=R=>{r.value=p(r).filter(({id:A})=>A!==R.id)},f=()=>{r.value=[],o.value=[],n.value=void 0},d=()=>{const R=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!R.length){r.value=[],o.value=[];return}p(r).forEach(A=>{R.includes(A.resourceId)||c(A)}),p(o).forEach(A=>{R.includes(A.resourceId)||m(A)})},y=R=>{o.value=R},w=R=>{const A=p(o).find(({id:$})=>$===R.id);if(A){Object.assign(A,R);return}p(o).push(R)},m=R=>{o.value=p(o).filter(({id:A})=>A!==R.id)},T=R=>{n.value=R},v=R=>{const A=N=>{const z=new Set;return N.forEach(Q=>{z.add(Q.shareType)}),Array.from(z)},$=[...e.resources,e.currentFolder].find(N=>(N==null?void 0:N.id)===R);if(!$||te.isProjectSpaceResource($))return;const L=[...p(r),...p(o)];e.updateResourceField({id:$.id,field:"shareTypes",value:A(L.filter(N=>!N.indirect))});const k=e.getAncestorById(R);k&&e.updateAncestorField({path:k.path,field:"shareTypes",value:A(L.filter(N=>!N.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:T,setCollaboratorShares:l,setLinkShares:y,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:R,space:A,resource:$,options:L})=>{const N=await R.graphAuthenticated.permissions.createInvite(A.id,$.id,L,p(i));return u([N]),v($.id),N},updateShare:async({clientService:R,space:A,resource:$,collaboratorShare:L,options:k})=>{const N=R.graphAuthenticated.permissions,z={roles:k.roles,expirationDateTime:k.expirationDateTime},Q=await N.updatePermission(A.id,$.id,L.id,z,p(i));return a(Q),Q},deleteShare:async({clientService:R,space:A,resource:$,collaboratorShare:L})=>{await R.graphAuthenticated.permissions.deletePermission(A.id,$.id,L.id),c(L),v($.id)},addLink:async({clientService:R,space:A,resource:$,options:L})=>{const N=await R.graphAuthenticated.permissions.createLink(A.id,$.id,L),z=e.selectedResources,Q=z.some(({fileId:J})=>J===$.fileId)||z.length===0&&e.currentFolder.fileId===$.fileId;if(w(N),v($.id),!Q){const J=e.ancestorMetaData[$.path]??null;if(J){const{shareTypes:ae}=J;ae.includes(te.ShareTypes.link.value)||e.updateAncestorField({path:J.path,field:"shareTypes",value:[...ae,te.ShareTypes.link.value]})}}return N},updateLink:async({clientService:R,space:A,resource:$,linkShare:L,options:k})=>{const N=R.graphAuthenticated.permissions;let z;if(Object.hasOwn(k,"password"))z=await N.setPermissionPassword(A.id,$.id,L.id,{password:k.password}),L.hasPassword=!!k.password;else{const Q={link:{...k.type&&{type:k.type},...k.displayName&&{"@libre.graph.displayName":k.displayName}},...Object.hasOwn(k,"expirationDateTime")&&{expirationDateTime:k.expirationDateTime}};z=await N.updatePermission(A.id,$.id,L.id,Q)}return w(z),z},deleteLink:async({clientService:R,space:A,resource:$,linkShare:L})=>{await R.graphAuthenticated.permissions.deletePermission(A.id,$.id,L.id),m(L),v($.id)}}}),Jb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),To=async({graphClient:e,driveType:t,configStore:n,graphRoles:r,signal:o})=>{var l;const i=await e.drives.listMyDrives(r,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((l=n.options.routing)!=null&&l.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:c,driveAlias:f}=u.root.remoteItem;s[c]=f});const a=Object.entries(s).map(([u,c])=>te.buildSpace({id:te.extractStorageId(u),name:c,driveType:c.split("/")[0],driveAlias:c,path:"/",serverUrl:n.serverUrl},r));return[...i,...a]},lt=Ge.defineStore("spaces",()=>{const e=vt(),t=at(),n=jt(),r=le([]),o=le(),i=le(!1),s=le(!1),a=le(!1),l=le(null),u=le([]),c=le([]),f=j(()=>p(r).find(re=>te.isPersonalSpaceResource(re)&&re.isOwner(e.user))),d=re=>{i.value=re},y=re=>{s.value=re},w=re=>{a.value=re},m=re=>{o.value=re},T=re=>{l.value=re},v=re=>{if(!te.isProjectSpaceResource(re))return[];const se=n.collaboratorShares.filter(ue=>ue.resourceId===re.id);return Jb(se)},g=re=>{p(r).push(...re)},h=re=>{r.value=p(r).filter(({id:se})=>se!==re.id)},b=re=>p(r).find(se=>re==se.id),S=async({graphClient:re,space:se,signal:ue})=>(await $({graphClient:re,signal:ue}),p(r).find(we=>{var ee,ie;return te.isMountPointSpaceResource(we)&&((ie=(ee=we.root)==null?void 0:ee.remoteItem)==null?void 0:ie.id)===se.id})),E=({driveAliasPrefix:re,id:se,shareName:ue})=>{const we=te.buildShareSpaceResource({driveAliasPrefix:re,id:se,shareName:ue,serverUrl:t.serverUrl});return g([we]),we},_=re=>{const se=p(r).find(({id:ue})=>ue===re.id);if(se){Object.assign(se,re);return}g([re])},R=({id:re,field:se,value:ue})=>{const we=p(r).find(ee=>re===ee.id);we&&(we[se]=ue)},A=async({graphClient:re})=>{a.value=!0;try{const[se,ue]=await Promise.all([To({graphClient:re,driveType:"personal",configStore:t,graphRoles:n.graphRoles}),To({graphClient:re,driveType:"project",configStore:t,graphRoles:n.graphRoles})]);g([...se,...ue]),i.value=!0}finally{a.value=!1}},$=async({graphClient:re,signal:se})=>{if(!p(s))try{const ue=await To({graphClient:re,driveType:"mountpoint",configStore:t,graphRoles:n.graphRoles,signal:se});g(ue)}finally{s.value=!0}};return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:f,defaultSpaceImageBlobURL:l,imagesLoading:u,readmesLoading:c,getSpace:b,createShareSpace:E,setSpacesInitialized:d,setMountPointsInitialized:y,setSpacesLoading:w,setCurrentSpace:m,setDefaultSpaceImageBlobURL:T,getSpaceMembers:v,getMountPointForSpace:S,addSpaces:g,removeSpace:h,upsertSpace:_,updateSpaceField:R,loadSpaces:A,loadMountPoints:$,reloadProjectSpaces:async({graphClient:re,signal:se})=>{const ue=await To({graphClient:re,driveType:"project",configStore:t,graphRoles:n.graphRoles,signal:se});r.value=p(r).filter(we=>!te.isProjectSpaceResource(we)),g(ue)},addToImagesLoading:re=>{p(u).includes(re)||p(u).push(re)},removeFromImagesLoading:re=>{u.value=p(u).filter(se=>se!==re)},purgeImagesLoading:()=>{u.value=[]},addToReadmesLoading:re=>{p(c).includes(re)||p(c).push(re)},removeFromReadmesLoading:re=>{c.value=p(c).filter(se=>se!==re)},purgeReadmesLoading:()=>{c.value=[]}}}),Xe=Ge.defineStore("resources",()=>{const e=at(),t=lt(),n=vt(),r=le([]),o=le(),i=le({}),s=le([]),a=j(()=>{let H=p(r);return p(k)||(H=H.filter(I=>!I.name.startsWith("."))),H}),l=j(()=>{const H=p(r).filter(({type:M})=>M==="file").length,I=p(r).filter(({type:M,name:q})=>M==="file"&&q.startsWith(".")).length,F=p(r).filter(({type:M})=>M==="folder").length,G=p(r).filter(({type:M,name:q})=>M==="folder"&&q.startsWith(".")).length,V=p(r).filter(te.isProjectSpaceResource).length;return{files:H,hiddenFiles:I,folders:F,hiddenFolders:G,spaces:V}}),u=H=>{r.value=H},c=H=>{r.value=p(r).filter(I=>!H.find(({id:F})=>F===I.id))},f=()=>{r.value=[]},d=H=>{const I=p(r).find(({id:F})=>F===H.id);if(I){Object.assign(I,H);return}p(r).push(H)},y=H=>{const I=p(r).filter(F=>!H.some(G=>G.path===F.path));r.value=[...I,...H]},w=({id:H,field:I,value:F})=>{const G=p(r).find(V=>H===V.id);G&&(G[I]=F)},m=H=>{o.value=H},T=()=>{o.value=void 0},v=H=>{r.value=H.resources,o.value=H.currentFolder},g=()=>{r.value=[],o.value=void 0,h.value=[]},h=le([]),b=le(null),S=j(()=>p(r).filter(H=>p(h).includes(H.id))),E=H=>{const I=H.find(F=>!p(h).includes(F));I&&(b.value=I),h.value=H},_=H=>{b.value=H,p(h).includes(H)||p(h).push(H)},R=H=>{b.value=H,p(h).includes(H)&&(h.value=p(h).filter(I=>I!==H))},A=H=>{p(h).includes(H)?R(H):_(H)},$=()=>{h.value=[]},L=H=>{b.value=H},k=le(!0),N=le(!0),z=le(!1),Q=le(!0),J=H=>{k.value=H,window.localStorage.setItem("oc_hiddenFilesShown",H.toString())},ae=H=>{N.value=H,window.localStorage.setItem("oc_fileExtensionsShown",H.toString())},re=H=>{z.value=H,window.localStorage.setItem("oc_webDavDetailsShown",H.toString())},se=H=>{Q.value=H,window.localStorage.setItem("oc_disabledSpacesShown",H.toString())},ue=H=>{i.value=H};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:l,setResources:u,removeResources:c,clearResources:f,upsertResource:d,upsertResources:y,updateResourceField:w,setCurrentFolder:m,clearCurrentFolder:T,initResourceList:v,clearResourceList:g,selectedIds:h,latestSelectedId:b,selectedResources:S,setSelection:E,addSelection:_,removeSelection:R,toggleSelection:A,resetSelection:$,setLastSelectedId:L,areHiddenFilesShown:k,areFileExtensionsShown:N,areWebDavDetailsShown:z,areDisabledSpacesShown:Q,setAreHiddenFilesShown:J,setAreFileExtensionsShown:ae,setAreWebDavDetailsShown:re,setAreDisabledSpacesShown:se,ancestorMetaData:i,setAncestorMetaData:ue,updateAncestorField:({path:H,field:I,value:F})=>{const G=p(i)[H]??null;G&&(G[I]=F)},loadAncestorMetaData:({folder:H,space:I,client:F,signal:G})=>{const V={[H.path]:{id:H.fileId,shareTypes:H.shareTypes,parentFolderId:H.parentFolderId,spaceId:I.id,path:H.path}},M=[],q=[Ue.FileId,Ue.ShareTypes,Ue.FileParent],fe=vb(H.path),Ae=t.spaces,Le=()=>Ae.filter(_e=>te.isMountPointSpaceResource(_e)&&te.extractStorageId(_e.root.remoteItem.rootId)===I.id);let ke=!0;if(e.options.routing.fullShareOwnerPaths){const _e=Ae.find(je=>te.isProjectSpaceResource(je)&&je.id===I.id);ke=I.isOwner(n.user)||(_e==null?void 0:_e.isMember(n.user))}for(const _e of fe){const je=p(i)[_e]??null;if((je==null?void 0:je.spaceId)===I.id){V[_e]=je;continue}if(!ke&&!Le().find(Y=>_e.startsWith(Y.root.remoteItem.path)))break;M.push(F.listFiles(I,{path:_e},{depth:0,davProperties:q,signal:G}).then(({resource:Y})=>{V[_e]={id:Y.fileId,shareTypes:Y.shareTypes,parentFolderId:Y.parentFolderId,spaceId:I.id,path:_e}}))}return Promise.all(M).then(()=>{if(!Object.keys(V).includes("/")){const _e=p(i)["/"];if((_e==null?void 0:_e.spaceId)===I.id)V["/"]=_e;else{const{parentFolderId:je}=Object.values(V)[0],Y=t.spaces.find(({id:Ne})=>je.startsWith(Ne));Y&&(V["/"]={id:Y.id,shareTypes:Y.shareTypes,parentFolderId:Y.id,spaceId:Y.id,path:"/"})}}ue(V)})},getAncestorById:H=>Object.values(p(i)).find(I=>H===I.id),deleteQueue:s,addResourcesIntoDeleteQueue:H=>{s.value=s.value.concat(H.filter(I=>!p(s).includes(I)))},removeResourcesFromDeleteQueue:H=>{s.value=s.value.filter(I=>!H.includes(I))}}}),Ao=Ge.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=Xt.v4(),l=jr.useWebWorker(i,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...l};return p(e).push(u),u},terminateWorker:i=>{const s=p(e).find(a=>i===a.id);s&&(s.terminate(),e.value=p(e).filter(a=>i!==a.id))},terminateAllWorkers:()=>{p(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{p(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),zs=(e={})=>{const t=e.router||We(),n=e.configStore||at();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:a})=>{var u;if(!((u=n.options.routing)!=null&&u.idBased)||s===i.path&&a===i.fileId)return!1;const l=Jn(o,i,{configStore:n});return t.replace(l),!0}}},Ws=()=>{const e=Jt();return j(()=>p(e).name)},Zb=(e,t)=>{const n=Jt();return j(()=>p(n).meta[e]||t)},Hs=(e,t)=>{const n=We();return j({get(){return Et(p(n.currentRoute).params[e])||t},async set(r){p(n.currentRoute).params[e]!==r&&await n.replace({params:{...p(n.currentRoute).params,[e]:r}})}})};let ev=Promise.resolve();const rn=(e,t)=>{const n=We();return j({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;ev=ev.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},wr=e=>{const t=rn(e.name),n=hf($F(e));return wt(()=>p(t)?{value:p(t),source:"route"}:p(n)?{value:p(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:Et(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},$F=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Sr=(e,...t)=>{const n=le(!1),r=We(),o=Jt();return wt(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Gs="contextRouteName",gf="contextRouteParams",mf="contextRouteQuery",Ks=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[Gs]:e.name,[gf]:t,[mf]:r}},tv=e=>({routeName:Et(e[Gs]),routeParams:e[gf],routeQuery:e[mf]}),Et=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function nv({router:e,currentFileContext:t}){const n=a=>{const{fileName:l,routeName:u,routeParams:c,routeQuery:f}=p(a);return p(u)?e.push({name:p(u),params:p(c),query:{...p(f),scrollTo:p(l)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=zs({router:e}),o=(a,l)=>{const u=p(a);return r({space:p(u.space),resource:l,path:p(u.item),fileId:p(u.itemId)})},i=le(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const Je=()=>mr("$clientService");function yf({clientService:e}){e=e||Je();const t=nn(),n=vt();return{getUrlForResource:(l,u,c)=>{var f;return e.webdav.getFileUrl(l,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=n.user)==null?void 0:f.onPremisesSamAccountName,...c})},revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(p(p(l).space),{path:p(p(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(p(p(l).space),{path:p(p(l).item),fileId:p(p(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(p(p(l).space),{path:p(p(l).item),...u})}}const bf=()=>mr("$authService");class Er{}Se(Er,"allFiles","all-files"),Se(Er,"currentFolder","current-folder");const vf=()=>{const e=at(),t=Je(),n=lt(),r=Xe(),o=nn(),i=j(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=j(()=>r.areHiddenFilesShown),a=j(()=>n.spaces.filter(te.isProjectSpaceResource)),l=d=>p(a).find(y=>y.id===d),u=un.useTask(function*(d,y,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!y)return{totalResults:null,values:[]};const{resources:m,totalResults:T}=yield*te.call(t.webdav.search(y,{searchLimit:w,davProperties:vs.Default,signal:d}));return{totalResults:T,values:m.map(v=>{const g=l(v.parentFolderId),h=g||v;return e.options.routing.fullShareOwnerPaths&&h.remoteItemPath&&(h.path=te.urlJoin(h.remoteItemPath,h.path)),{id:h.id,data:h}}).filter(({data:v})=>!v.name.startsWith(".")||p(s))}}).restartable();return{search:async(d,y=null)=>await u.perform(d,y),buildSearchTerm:({term:d,isTitleOnlySearch:y,tags:w,lastModified:m,mediaType:T,scope:v,useScope:g})=>{const h=[],b=d,S=p(i)&&!y;if(b){let E=`name:"*${b}*"`;S&&(E=`(name:"*${b}*" OR content:"${b}")`),h.push(E)}if(g&&v&&h.push(`scope:${v}`),w){const E=w.split("+").map(_=>`"${_}"`);h.push(`tag:(${E.join(" OR ")})`)}if(m&&h.push(`mtime:${m}`),T){const E=T.split("+").map(_=>`"${_}"`);h.push(`mediatype:(${E.join(" OR ")})`)}return h.sort((E,_)=>Number(E.startsWith("scope:"))-Number(_.startsWith("scope:"))).join(" AND ")}}};function rv({currentRoute:e,clientService:t}){const n=le(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=zs(),{getFileInfo:i}=yf({clientService:t}),s=bf(),a=lt(),{buildSearchTerm:l,search:u}=vf(),c=rn("contextRouteQuery"),f=Xe(),{activeResources:d}=Ge.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var m,T;n.value=!0;try{if(w=p(w),(m=p(c))!=null&&m.term){const R=l({term:(T=p(c))==null?void 0:T.term}),{values:A}=await u(R,200),$=A.filter(({data:L})=>te.isSearchResource(L)).map(L=>L.data);f.initResourceList({currentFolder:null,resources:$}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(p(w.routeName))){await Wy.getTask().perform(),n.value=!1;return}f.clearResourceList();const g=p(w.space),h=await i(w,{davProperties:[Ue.FileId]});if(o({space:g,resource:h,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(R=>{var A;return te.isMountPointSpaceResource(R)&&((A=R.root.remoteItem)==null?void 0:A.id)===h.id})){const R=await i(w);f.initResourceList({currentFolder:R,resources:[R]}),n.value=!1;return}const S=gt.dirname(h.path),{resource:E,children:_}=await r.listFiles(g,{path:S});E.type==="file"?f.initResourceList({currentFolder:E,resources:[E]}):f.initResourceList({currentFolder:E,resources:_})}catch(v){if(v.statusCode===401)return s.handleAuthError(p(e));f.setCurrentFolder(null),console.error(v)}n.value=!1},activeFiles:d}}function wf({appsStore:e,applicationId:t}){return{applicationMeta:j(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const Ro=()=>Ye;function iv({titleSegments:e,eventBus:t}){const n=ii(),{currentTheme:r}=Ge.storeToRefs(n);t=t||Ro(),wt(e,o=>{const i=p(o),s=" - ",a={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,p(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function DF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=wf({applicationId:t,appsStore:e}),{$gettext:s}=xe.useGettext(),a=j(()=>{var c,f,d;const l=gt.basename(p((c=p(r))==null?void 0:c.fileName))||s(((d=(f=p(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=p(p(i).applicationMeta);return[l,p(n)||u.name||u.id].filter(Boolean)});iv({titleSegments:a})}function ov(e={}){const t=e.clientService??Je(),n=e.authStore??Yr();return{makeRequest:(o,i,s={})=>{const a=n.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},n.publicLinkContextReady&&(n.publicLinkPassword&&(s.headers.Authorization="Basic "+yr.from(["public",n.publicLinkPassword].join(":")).toString("base64")),n.publicLinkToken&&(s.headers["public-token"]=n.publicLinkToken)),s.method=o,s.url=i,a.request(s)}}}const sv=()=>{const e=lt();return{areSpacesLoading:j(()=>!e.spacesInitialized||e.spacesLoading)}},av=(e={})=>{const t=lt(),{areSpacesLoading:n}=sv(),r=rn("shareId"),o=rn("fileId"),i=j(()=>Et(p(o))),s=at(),a=Je(),l=j(()=>t.spaces),u=le(null),c=le(null),f=le(!1),d=y=>{const w=y.split("/");return p(l).find(m=>{if(!y.startsWith(m.driveAlias))return!1;const T=m.driveAlias.split("/");return w.length<T.length||w.slice(0,T.length).join("/")!==m.driveAlias?!1:m})};return ja(()=>{const y=p(e.driveAliasAndItem);!(y!=null&&y.startsWith("personal/"))&&!(y!=null&&y.startsWith("project/"))&&t.setCurrentSpace(null)}),wt([e.driveAliasAndItem,n],async([y,w],[m,T])=>{if(y===m&&w===T)return;if(!y||y.startsWith("virtual/")){u.value=null,c.value=null;return}if(p(u)&&y.startsWith(p(u).driveAlias)){c.value=te.urlJoin(y.slice(p(u).driveAlias.length),{leadingSlash:!0});return}let g=null,h=null;if(y.startsWith("public/")||y.startsWith("ocm/")){const[b,...S]=y.split("/").slice(1);g=p(l).find(E=>E.id===b),h=S.join("/")}else if(y.startsWith("share/")||y.startsWith("ocm-share/")){const[b,...S]=y.split("/").slice(1),E=y.startsWith("ocm-share/")?"ocm-share":"share";let _=Et(p(r));_!=null&&_.includes(":")&&(_=[te.SHARE_JAIL_ID,_].join("!")),g=t.getSpace(_)||t.createShareSpace({driveAliasPrefix:E,id:_,shareName:p(b)}),h=S.join("/")}else p(i)?g=p(l).find(b=>p(i).startsWith(`${b.fileId}`)):g=d(y),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(y)),g&&(h=y.slice(g.driveAlias.length));u.value=g,c.value=te.urlJoin(h,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),wt(u,y=>{t.setCurrentSpace(y)},{immediate:!0}),{space:u,item:c,itemId:i,loading:f}};function lv(e){const t=We(),n=Zn(),r=Jt(),o=e.clientService??Je(),i=e.applicationId,s=Yr(),{publicLinkContextReady:a}=Ge.storeToRefs(s),l=Hs("driveAliasAndItem"),{space:u,item:c,itemId:f,loading:d}=av({driveAliasAndItem:l}),y=j(()=>{if(p(d))return null;let w;return p(u)?w=te.urlJoin(p(u).webDavPath,p(c)):w=te.urlJoin(Et(p(r).params.filePath)),{path:w,driveAliasAndItem:p(l),space:p(u),item:p(c),itemId:p(f),fileName:gt.basename(w),routeName:Et(p(r).query[Gs]),...tv(p(r).query)}});return DF({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:y,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:y,...ah({appsStore:n,...e}),...nv({router:t,currentFileContext:y}),...yf({clientService:o}),...rv({clientService:o,currentRoute:r}),...ov({clientService:o,currentRoute:p(r)})}}const LF=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),MF=()=>[{path:"/list",redirect:e=>On("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>On("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:te.urlJoin("personal/home",Et(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ti("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>xn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>xn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>xn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Ri("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Ai("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(LF),BF=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":On("files-spaces-generic").name,"files-favorites":Ti("files-common-favorites").name,"files-shared-with-others":xn("files-shares-with-others").name,"files-shared-with-me":xn("files-shares-with-me").name,"files-trashbin ":Ri("files-trash-generic").name,"files-public-list":Ai("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return ml(e,n,...r)},jF={name:"root",path:"/",redirect:e=>On("files-spaces-generic",e)},UF=e=>[jF,...dT(e),...gT(e),...mT(e),...pT(e),...yT(e),...MF()],oi=()=>{const{$gettext:e}=xe.useGettext(),t=Je();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(o)?i(e(`Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)):i(null),getDefaultMetaFolder:async o=>{const{children:i}=await t.webdav.listFiles(o);return i.find(({name:s})=>s===".space")}}},ln=e=>{const t=vt(),n=lt(),r=at(),o=j(()=>n.spaces),i=Hs("driveAliasAndItem"),s=f=>p(e==null?void 0:e.space)||p(o).find(d=>d.id===f),a=f=>{var T,v,g,h,b;let d=f.storageId;((T=p(i))!=null&&T.startsWith("public/")||(v=p(i))!=null&&v.startsWith("ocm/"))&&(d=p(i).split("/")[1]);const y=s(d);if(y&&!te.isMountPointSpaceResource(y))return y;const w=te.isShareResource(f)&&f.shareTypes.includes(te.ShareTypes.remote.value)||(g=f==null?void 0:f.id)!=null&&g.toString().startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return f.remoteItemPath?m=gt.basename(f.remoteItemPath):(h=p(i))!=null&&h.startsWith("share/")||(b=p(i))!=null&&b.startsWith("ocm-share/")?m=p(i).split("/")[1]:m=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:f.remoteItemId,shareName:m})},l=f=>p(o).filter(d=>te.isMountPointSpaceResource(d)&&te.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=n.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const y=p(o).find(m=>te.isProjectSpaceResource(m)&&m.id===f.id);return f.isOwner(t.user)||(y==null?void 0:y.isMember(t.user))||l(f).some(m=>d.startsWith(m.root.remoteItem.path))}}},Di=()=>{const e=Je(),t=Xe(),n=jt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},n.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var a;const s=await e.webdav.createFolder(i,{path:".space"});return te.extractStorageId(s.parentFolderId)===((a=t.currentFolder)==null?void 0:a.id)&&t.upsertResource(s),s}}},cn=()=>mr("$loadingService"),Qs=()=>{const e=Yr(),t=Je(),n=xe.useGettext();return{headers:j(()=>{const o=new Dh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Xt.v4(),...o.getHeaders()}})}};function qF(e){return new Worker("/assets/worker-Dlj5LBOt.js",{name:e==null?void 0:e.name})}const cv=({concurrentRequests:e=4}={})=>{const t=at(),n=cn(),{headers:r}=Qs(),{createWorker:o,terminateWorker:i}=Ao(),s=({topic:l,space:u,resources:c},f)=>{const d=o(qF,{needsTokenRenewal:!0});let y;p(d.worker).onmessage=w=>{i(d.id),y==null||y(!0);const{successful:m,failed:T}=JSON.parse(w.data),v=T.map(({resource:g,...h})=>({resource:g,error:te.createHttpError(h)}));f({successful:m,failed:v})},n.addTask(()=>new Promise(w=>{y=w})),d.post(a({topic:l,space:u,resources:c}))},a=({topic:l,space:u,resources:c})=>JSON.stringify({topic:l,data:{space:u,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...p(r),"X-Request-ID":void 0}}});return{startWorker:s}};function VF(e){return new Worker("/assets/worker-CppfaVl3.js",{name:e==null?void 0:e.name})}const uv=()=>{const e=at(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ao(),i=(a,l)=>{const u=r(VF,{needsTokenRenewal:!0});let c;p(u.worker).onmessage=f=>{o(u.id),c==null||c(!0);const{successful:d,failed:y}=JSON.parse(f.data),w=y.map(({resourceName:m,...T})=>({resourceName:m,error:te.createHttpError(T)}));l({successful:d,failed:w})},t.addTask(()=>new Promise(f=>{c=f})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function zF(e){return new Worker("/assets/worker-BpoAv3gP.js",{name:e==null?void 0:e.name})}const fv=()=>{const e=at(),t=cn(),{headers:n}=Qs(),{createWorker:r,terminateWorker:o}=Ao(),i=({space:a,resources:l,missingFolderPaths:u},c)=>{const f=r(zF,{needsTokenRenewal:!0});let d;p(f.worker).onmessage=y=>{o(f.id),d==null||d(!0);const{successful:w,failed:m}=JSON.parse(y.data),T=m.map(({resource:v,...g})=>({resource:v,error:te.createHttpError(g)}));c({successful:w,failed:T})},t.addTask(()=>new Promise(y=>{d=y})),f.post(s({space:a,resources:l,missingFolderPaths:u}))},s=({space:a,resources:l,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:l,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function WF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const HF=({authService:e})=>{const{createWorker:t}=Ao(),n=le();return{startWorker:()=>{n.value=t(WF),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof q0.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),p(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",s),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:s,expiryThreshold:a})=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"reset"}))}}},dv=()=>{const e=at(),t=it(),n=We(),r=xe.useGettext(),{getMatchingSpace:o}=ln(),{$gettext:i,$ngettext:s}=r,a=Je(),{dispatchModal:l}=bt(),u=lt(),c=jt(),{startWorker:f}=cv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),d=Xe(),{currentFolder:y}=Ge.storeToRefs(d),w=le([]),m=rn("page","1"),T=j(()=>parseInt(Et(p(m)))),v=rn("items-per-page","1"),g=j(()=>parseInt(Et(p(v)))),h=j(()=>bp(p(w))),b=j(()=>{const A=p(h),$=A[0].type==="folder";let L=null;return A.length===1?($?L=i('Permanently delete folder "%{name}"',{name:A[0].name},!0):L=i('Permanently delete file "%{name}"',{name:A[0].name},!0),L):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",A.length,{amount:A.length.toString()},!1)}),S=j(()=>{const A=p(h),$=A[0].type==="folder";return A.length===1?i($?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),E=A=>{const $=p(n.currentRoute);f({topic:"trashBinDelete",space:A,resources:p(h)},({successful:L,failed:k})=>{var N,z;if(L.length){const Q=L.length===1&&p(h).length===1?i('"%{item}" was deleted successfully',{item:L[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",L.length,{itemCount:L.length.toString()},!0);t.showMessage({title:Q})}k.forEach(({resource:Q})=>{const J=i('Failed to delete "%{item}"',{item:Q.name});t.showErrorMessage({title:J,errors:[new Error]})}),$.name===p(n.currentRoute).name&&((N=$.query)==null?void 0:N.fileId)===((z=p(n.currentRoute).query)==null?void 0:z.fileId)&&(d.removeResources(L),d.resetSelection())})};return{displayDialog:(A,$)=>{w.value=[...$],l({title:p(b),message:p(S),confirmText:i("Delete"),onConfirm:()=>E(A)})},filesList_delete:A=>{var k;w.value=[...A],d.addResourcesIntoDeleteQueue(p(w).map(({id:N})=>N)),p(w).forEach(({id:N})=>d.removeSelection(N));const $=p(A).reduce((N,z)=>{if(z.storageId in N)return N[z.storageId].resources.push(z),N;const Q=o(z);return Q.id in N||(N[Q.id]={space:Q,resources:[]}),N[Q.id].resources.push(z),N},{}),L=(k=p(y))==null?void 0:k.id;return Object.values($).map(({space:N,resources:z})=>{f({topic:"fileListDelete",space:N,resources:z},async({successful:Q,failed:J})=>{var ae;if(Q.length){const re=Q.length===1&&A.length===1?i('"%{item}" was moved to trash bin',{item:Q[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",Q.length,{itemCount:Q.length.toString()},!0);t.showMessage({title:re})}if(d.removeResourcesFromDeleteQueue(J.map(({resource:re})=>re.id)),d.removeResourcesFromDeleteQueue(Q.map(({id:re})=>re)),J.forEach(({error:re,resource:se})=>{let ue=i('Failed to delete "%{resource}"',{resource:se.name});re.statusCode===423&&(ue=i('Failed to delete "%{resource}" - the file is locked',{resource:se.name})),t.showErrorMessage({title:ue,errors:[re]})}),L===((ae=p(y))==null?void 0:ae.id)){d.removeResources(Q);const re=d.activeResources.length,se=Math.ceil(p(re)/p(g));p(T)>1&&p(T)>se&&(m.value=se.toString())}if(ft(n,"files-spaces-generic")&&!["public","share"].includes(N==null?void 0:N.driveType)){const se=await a.graphAuthenticated.drives.getDrive(p(A)[0].storageId,c.graphRoles);u.updateSpaceField({id:se.id,field:"spaceQuota",value:se.spaceQuota})}if(p(w).length&&Zi(p(w)[0],p(y)))return n.push(Jn(N,{path:gt.dirname(p(w)[0].path),fileId:p(w)[0].parentFolderId}))})})}}},GF=e=>e==="files",kr=()=>{const e=Jt();return j(()=>GF(El(p(e))))};function KF(e){return e==null}const QF="edit",XF="create",zn=()=>{const e=Zn(),t=We(),{$gettext:n}=xe.useGettext(),r=os(),{isEnabled:o}=ri(),{requestExtensions:i}=Ni(),{openUrl:s}=jv(),a=at(),{options:l}=Ge.storeToRefs(a),{actions:u}=Xs(),{actions:c}=Ys(),{actions:f}=Js(),{actions:d}=ea(),{actions:y}=Zs(),{actions:w}=ta(),{actions:m}=_o(),{actions:T}=Af(),{actions:v}=na(),{actions:g}=Rf(),{actions:h}=ra(),{actions:b}=ia(),{actions:S}=Pf(),E=j(()=>[...p(w),...p(m),...p(d),...p(v),...p(f),...p(h),...p(S),...p(b),...p(u),...p(c),...p(y),...p(T),...p(g)]),_=j(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(ae=>ae.action)),R=j(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),A=j(()=>p(o)?[]:e.fileExtensions.map(J=>{const ae=e.apps[J.app];return{name:`editor-${J.app}`,label:()=>J.label?typeof J.label=="function"?J.label():J.label:n("Open in %{app}",{app:ae.name},!0),showOpenInNewTabHint:!0,icon:J.icon||ae.icon,...ae.iconFillType&&{iconFillType:ae.iconFillType},img:ae.img,route:({space:re,resources:se})=>$({appFileExtension:J,space:re,resource:se[0]}),handler:re=>k(J,re.space,re.resources[0]),isVisible:({resources:re})=>re.length!==1||!re[0].canDownload()&&!J.secureView||!p(r)&&_n(t,"files-trash-generic")?!1:re[0].extension&&J.extension?re[0].extension.toLowerCase()===J.extension.toLowerCase():re[0].mimeType&&J.mimeType?re[0].mimeType.toLowerCase()===J.mimeType.toLowerCase()||re[0].mimeType.split("/")[0].toLowerCase()===J.mimeType.toLowerCase():!1,hasPriority:J.hasPriority,class:`oc-files-actions-${Kb(ae.name).toLowerCase()}-trigger`}}).sort((J,ae)=>ae.hasPriority!==J.hasPriority&&ae.hasPriority?1:0)),$=({appFileExtension:J,space:ae,resource:re})=>{const se=te.isShareSpaceResource(ae)?ae.id:void 0,ue=J.routeName||J.app,we=L(ue,ae,re,se);return t.resolve(we)},L=(J,ae,re,se,ue)=>({name:J,params:{driveAliasAndItem:ae==null?void 0:ae.getDriveAliasAndItem(re)},query:{...se&&{shareId:se},...re.fileId&&p(l).routing.idBased&&{fileId:re.fileId},...ue&&{templateId:ue},...Ks(p(t.currentRoute))}}),k=(J,ae,re)=>{const se=te.isShareSpaceResource(ae)?ae.id:void 0,ue=J.routeName||J.app,we=L(ue,ae,re,se);if(p(l).cernFeatures){const ee=t.resolve(we).href,ie=`${J.routeName}-${re.path}`;s(ee,ie,!0);return}t.push(we)},N=J=>{z(J).handler({...J})},z=J=>{const ae=Q(J);if(ae.length)return ae[0]},Q=J=>{const ae=ue=>ue.isVisible(J),re=[...p(_),...p(A)].filter(ae).sort((ue,we)=>Number(we.hasPriority)-Number(ue.hasPriority)),se=J.omitSystemActions?[]:p(E).filter(ae);return[...re,...se,...p(R).filter(ue=>ue.isVisible(J)&&(ue.category==="actions"||KF(ue.category)))]};return{editorActions:A,systemActions:E,getDefaultAction:z,getAllAvailableActions:Q,getEditorRouteOpts:L,openEditor:k,triggerDefaultAction:N}},Xs=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=We(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=Je(),s=cn(),a=at(),l=Xe(),{updateResourceField:u}=l,c=async({resources:d})=>{const y=[],w=[],m=new Br({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(T=>{w.push(m.add(async()=>{try{const{graphAuthenticated:v}=i;await v.driveItems.createDriveItem(T.driveId,{name:T.name,remoteItem:{id:T.fileId}}),u({id:T.id,field:"syncEnabled",value:!0})}catch(v){console.error(v),y.push(v)}}))}),await Promise.all(w),y.length===0){l.resetSelection(),ft(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:y})};return{actions:j(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>c(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:y})=>{var w;return!Nt(n,"files-shares-with-me")&&!ft(n,"files-spaces-generic")||y.length===0||ft(n,"files-spaces-generic")&&(((w=p(d))==null?void 0:w.driveType)!=="share"||y.length>1||y[0].path!=="/")?!1:y.some(m=>!m.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},Ys=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=We(),{$gettext:r}=xe.useGettext(),o=Je(),i=cn(),s=at(),{updateResourceField:a,resetSelection:l}=Xe(),u=async({resources:f})=>{const d=[],y=[],w=new Br({concurrency:s.options.concurrentRequests.resourceBatchActions}),m=!f[0].hidden;if(f.forEach(T=>{y.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(T.driveId,T.id,{"@UI.Hidden":m}),a({id:T.id,field:"hidden",value:m})}catch(v){console.error(v),d.push(v)}}))}),await Promise.all(y),d.length===0){l(),e({title:r(m?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(m?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:j(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:Nt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},Js=()=>{const e=at(),t=We(),{copyResources:n}=Eo(),r=xe.useGettext(),{$gettext:o}=r,i=Xe(),{currentFolder:s}=Ge.storeToRefs(i),a=j(()=>window.navigator.platform.match("Mac")),l=j(()=>p(a)?o("⌘ + C"):o("Ctrl + C")),u=({resources:f})=>{At(t,"files-common-search")&&(f=f.filter(d=>!te.isProjectSpaceResource(d))),n(f)};return{actions:j(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:p(l),label:()=>o("Copy"),isVisible:({resources:f})=>{var d,y;if(!ft(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")||ft(t,"files-spaces-projects")||f.length===0)return!1;if(Rn(t,"files-public-link"))return(d=p(s))==null?void 0:d.canCreate();if(At(t,"files-common-search")&&f.every(w=>te.isProjectSpaceResource(w)))return!1;if(p(e.options.runningOnEos)){const w=((y=f[0].path)==null?void 0:y.split("/").filter(Boolean))||[];if(ft(t,"files-spaces-generic")&&w.length<5)return!1}return!!p(f)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},Sf=()=>({copyToClipboard:t=>{var n;if((n=navigator==null?void 0:navigator.clipboard)!=null&&n.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:r}=jr.useClipboard({legacy:!0});return r(t)}}}),Ef=()=>{const{showMessage:e,showErrorMessage:t}=it(),{$gettext:n}=xe.useGettext(),{copyToClipboard:r}=Sf(),o=async s=>{try{await r(s),e({title:n("The link has been copied to your clipboard.")})}catch(a){console.error(a),t({title:n("Copy link failed"),errors:[a]})}};return{actions:j(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:({resources:s})=>{const[a]=s,l=a.privateLink;return o(l)},isVisible:({space:s,resources:a})=>!(a.length!==1||te.isPublicSpaceResource(s)||te.isTrashResource(a[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},Zs=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=We(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=Je(),s=cn(),a=at(),{updateResourceField:l}=Xe(),u=async({resources:f})=>{const d=[],y=[],w=new Br({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(m=>{y.push(w.add(async()=>{try{const{graphAuthenticated:T}=i;await T.driveItems.deleteDriveItem(m.driveId,m.id),l({id:m.id,field:"syncEnabled",value:!1})}catch(T){console.error(T),d.push(T)}}))}),await Promise.all(y),d.length===0){ft(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push(xn("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",f.length),errors:d})};return{actions:j(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:d})=>!Nt(n,"files-shares-with-me")&&!ft(n,"files-spaces-generic")||d.length===0||ft(n,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(y=>y.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},ea=()=>{const e=vt(),t=nn(),n=We(),{displayDialog:r,filesList_delete:o}=dv(),{$gettext:i}=xe.useGettext(),s=({space:l,resources:u,deletePermanent:c})=>{if(At(n,"files-common-search")&&(u=u.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!te.isProjectSpaceResource(f))),c){r(l,u);return}o(u)};return{actions:j(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:l,resources:u})=>s({space:l,resources:u,deletePermanent:!1}),isVisible:({space:l,resources:u})=>!ft(n,"files-spaces-generic")&&!Rn(n,"files-public-link")&&!At(n,"files-common-search")||u.length===0||ft(n,"files-spaces-generic")&&(l==null?void 0:l.driveType)==="share"&&u[0].path==="/"||u.length===1&&u[0].locked?!1:At(n,"files-common-search")?u.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!te.isProjectSpaceResource(f)):!u.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:l,resources:u})=>s({space:l,resources:u,deletePermanent:!0}),isVisible:({space:l,resources:u})=>!_n(n,"files-trash-generic")||!t.filesPermanentDeletion||te.isProjectSpaceResource(l)&&!l.canDeleteFromTrashBin({user:e.user})?!1:u.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function YF(e){return e&&e.length?e[0]:void 0}const pv=()=>mr("$archiverService"),ta=()=>{const{showErrorMessage:e}=it(),t=We(),n=cn(),r=pv(),{$ngettext:o,$gettext:i,current:s}=xe.useGettext(),a=Yr(),l=kr(),u=({space:d,resources:y})=>{y.length>1&&(y=y.filter(m=>m.canDownload()&&!te.isProjectSpaceResource(m)));const w=p(r.fileIdsSupported)?{fileIds:y.map(m=>m.fileId)}:{dir:ss.dirname(YF(y).path)||"/",files:y.map(m=>m.name)};return r.triggerDownload({...w,...d&&te.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:a.publicLinkPassword}}).catch(m=>{console.error(m),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",y.length),errors:[m]})})},c=d=>{const y=p(r.capability);return y?d.reduce((m,T)=>m+parseInt(`${T.size}`),0)>parseInt(y.max_size):void 0};return{actions:j(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await n.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>c(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:Sn(p(r.capability).max_size,s)}):"",isDisabled:({resources:d})=>c(d),isVisible:({resources:d})=>p(l)&&!ft(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")&&!At(t,"files-common-search")||!p(r.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(w=>te.isProjectSpaceResource(w))||te.isProjectSpaceResource(d[0])&&d[0].disabled||!p(r.fileIdsSupported)&&At(t,"files-common-favorites")?!1:!d.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},hv=e=>{const{showErrorMessage:t}=it(),n=(e==null?void 0:e.clientService)||Je(),{$gettext:r}=xe.useGettext(),o=nn(),i=vt();return{downloadFile:async(a,l,u=null)=>{var c;try{const f=await n.webdav.getFileUrl(a,l,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(c=i.user)==null?void 0:c.onPremisesSamAccountName});jl(f,l.name)}catch(f){console.error(f),t({title:r("Download failed"),desc:r("File could not be located"),errors:[f]})}}}},_o=()=>{const e=We(),{$gettext:t}=xe.useGettext(),n=kr(),r=os(),{downloadFile:o}=hv(),i=({space:a,resources:l})=>{o(a,l[0])};return{actions:j(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!ft(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!At(e,"files-common-favorites")&&!At(e,"files-common-search")&&!Nt(e,"files-shares-with-me")&&!Nt(e,"files-shares-with-others")&&!Nt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Tf=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),r=nn(),o=We(),{$gettext:i}=xe.useGettext(),s=Je(),{dispatchModal:a}=bt(),l=Xe(),u=cn(),c=({space:y})=>s.webdav.clearTrashBin(y).then(()=>{e({title:i("All deleted files were removed")}),l.clearResources(),l.resetSelection()}).catch(w=>{console.error(w),t({title:i("Failed to empty trash bin"),errors:[w]})}),f=({space:y})=>{a({title:i("Empty trash bin"),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the listed items? You can’t undo this action."),hasInput:!1,onConfirm:()=>u.addTask(()=>c({space:y}))})};return{actions:j(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:y})=>!(!_n(o,"files-trash-generic")||!r.filesPermanentDeletion||te.isProjectSpaceResource(y)&&!y.canDeleteFromTrashBin({user:n.user})),isDisabled:()=>l.activeResources.length===0,class:"oc-files-actions-empty-trash-bin-trigger",appearance:"filled"}]),emptyTrashBin:c}},Af=()=>{const{showErrorMessage:e}=it(),t=nn(),n=We(),{$gettext:r}=xe.useGettext(),o=Je(),i=kr(),s=pn(),a=Xe(),l=Ro(),u=async({space:f,resources:d})=>{try{const y=!d[0].starred;await o.webdav.setFavorite(f,d[0],y),a.updateResourceField({id:d[0].id,field:"starred",value:y}),y||l.publish("app.files.list.removeFromFavorites",d[0].id)}catch(y){const w=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:w,errors:[y]})}};return{actions:j(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>p(i)&&!ft(n,"files-spaces-generic")&&!At(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function JF(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const na=()=>{const e=We(),{cutResources:t}=Eo(),n=xe.useGettext(),{$gettext:r}=n,o=Xe(),{currentFolder:i}=Ge.storeToRefs(o),s=j(()=>window.navigator.platform.match("Mac")),a=j(()=>p(s)?r("⌘ + X"):r("Ctrl + X")),l=({resources:c})=>{t(c)};return{actions:j(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:p(a),label:()=>r("Cut"),isVisible:({resources:c})=>!ft(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!At(e,"files-common-favorites")||c.length===0||!p(i)||c.length===1&&c[0].locked?!1:!c.some(d=>JF(d,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},Rf=()=>{const e=We(),{$gettext:t}=xe.useGettext(),{getMatchingSpace:n}=ln(),r=Xe(),{currentFolder:o}=Ge.storeToRefs(r),i=l=>l||n(l),s=j(()=>Rn(e,"files-public-link")?Ai("files-public-link"):On("files-spaces-generic"));return{actions:j(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:l})=>!(_n(e,"files-trash-generic")||l.length!==1||p(o)!==null&&Zi(l[0],p(o))||!l[0].isFolder||l[0].type==="space"),route:({space:l,resources:u})=>ao({},p(s),Jn(i(l),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},gv=()=>{const e=We(),t=Je(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=Eo(),{startWorker:s}=uv(),a=Xe(),{currentFolder:l}=Ge.storeToRefs(a),u=j(()=>window.navigator.platform.match("Mac")),c=j(()=>p(u)?r("⌘ + V"):r("Ctrl + V")),f=j(()=>i.action===ti.Cut?pr.MOVE:pr.COPY),d=async({targetSpace:m,sourceSpace:T,resources:v})=>{var S;const g=new Tp(T,v,m,p(l),l,t,r,o),h=await g.getTransferData(p(f));if(!h.length)return;const b=(S=p(l))==null?void 0:S.id;s(h,async({successful:E,failed:_})=>{if(g.showResultMessage(_,E,p(f)),!E.length||p(l)&&b!==p(l).id)return;const R=[],A=[];for(const $ of E)R.push((async()=>{const L=await t.webdav.getFileInfo(m,$);A.push(L)})());await Promise.allSettled(R),te.isShareSpaceResource(m)&&A.forEach($=>{$.remoteItemId=m.id}),a.upsertResources(A)})},y=async({space:m})=>{const T=i.resources.reduce((g,h)=>{if(h.storageId in g)return g[h.storageId].resources.push(h),g;const b=n(h);return b.id in g||(g[b.id]={space:b,resources:[]}),g[b.id].resources.push(h),g},{}),v=Object.values(T).map(({space:g,resources:h})=>d({targetSpace:m,sourceSpace:g,resources:h}));await Promise.all(v),i.clearClipboard()};return{actions:j(()=>[{name:"paste",icon:"clipboard",handler:y,label:()=>r("Paste"),shortcut:p(c),isVisible:({resources:m})=>{var T;return i.resources.length===0||!ft(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!At(e,"files-common-favorites")||m.length===0?!1:Rn(e,"files-public-link")&&p(l)?(T=p(l))==null?void 0:T.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},ra=()=>{const{showErrorMessage:e}=it(),t=nn(),n=We(),{$gettext:r}=xe.useGettext(),o=Je(),i=at(),{dispatchModal:s}=bt(),a=vt(),l=pn(),u=Xe(),{setCurrentFolder:c,upsertResource:f}=u,d=(T,v,g=void 0)=>{const h=T.path.substring(0,T.path.length-T.name.length)+v;if(!v)return r("The name cannot be empty");if(/[/]/.test(v))return r('The name cannot contain "/"');if(v===".")return r('The name cannot be equal to "."');if(v==="..")return r('The name cannot be equal to ".."');if(/\s+$/.test(v))return r("The name cannot end with whitespace");if(u.resources.find(S=>S.path===h&&T.name!==v)){const S=r('The name "%{name}" is already taken');return r(S,{name:v},!0)}if(g&&g.find(E=>E.path===h&&T.name!==v)){const E=r('The name "%{name}" is already taken');return r(E,{name:v},!0)}return null},y=async(T,v,g)=>{let h=u.currentFolder;try{const b=gt.join(gt.dirname(v.path),g);await o.webdav.moveFiles(T,v,T,{path:b});const S=Zi(v,h);if(te.isShareSpaceResource(T)&&v.isReceivedShare()){if(T.rename(g),S)return h={...h},h.name=g,c(h),n.push(Jn(T,{path:"",fileId:v.fileId}));const _={...v};_.name=g,f(_);return}if(S)return h={...h},il(T,h,b),c(h),n.push(Jn(T,{path:b,fileId:v.fileId}));const E={...v};il(T,E,b),f(E)}catch(b){console.error(b);let S=r('Failed to rename "%{file}" to "%{newName}"',{file:v.name,newName:g},!0);b.statusCode===423&&(S=r('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:v.name,newName:g},!0)),e({title:S,errors:[b]})}},w=async({space:T,resources:v})=>{const g=u.currentFolder;let h;if(Zi(v[0],g)){const k=gt.dirname(g.path);h=(await o.webdav.listFiles(T,{path:k})).children}const b=u.areFileExtensionsShown,S=async k=>{b||(k=`${k}.${v[0].extension}`),await y(T,v[0],k)},E=(k,N)=>{b||(k=`${k}.${v[0].extension}`);const z=d(v[0],k,h);N(z)},_=te.extractNameWithoutExtension(v[0]),R=!v[0].isFolder&&!b?_:v[0].name,A=v[0].isFolder?r("Rename folder %{name}",{name:R}):r("Rename file %{name}",{name:R}),$=!v[0].isFolder&&!b?_:v[0].name,L=v[0].isFolder||!b?null:[0,_.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:$,inputSelectionRange:L,inputLabel:v[0].isFolder?r("Folder name"):r("File name"),onConfirm:S,onInput:E})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:T})=>_n(n,"files-trash-generic")||Nt(n,"files-shares-with-me")&&!t.sharingCanRename||T.length!==1||(i.options.routing.fullShareOwnerPaths?T.some(h=>h.remoteItemPath&&h.path):T.some(h=>h.remoteItemId&&h.path==="/"))||T.length===1&&T[0].locked?!1:!T.some(h=>!h.canRename({user:a.user,ability:l})||h.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:y}},ia=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),r=We(),{$gettext:o,$ngettext:i}=xe.useGettext(),s=Je(),a=lt(),l=jt(),u=Xe(),{startWorker:c}=fv(),f=async(T,v)=>{const g={},h=[],b=[],S=[];for(const E of v){const _=gt.dirname(E.path);let R=[];if(_ in g)R=g[_];else{try{R=(await s.webdav.listFiles(T,{path:_})).children}catch{S.push(_)}g[_]=R}R.some($=>$.name===E.name)||b.filter($=>$.id!==E.id).some($=>$.path===E.path)?h.push(E):b.push(E)}return{existingResourcesByPath:g,conflicts:h,resolvedResources:b,missingFolderPaths:S.filter(E=>{var _;return!((_=g[E])!=null&&_.length)})}},d=async T=>{let v=0;const g=[],h=T.length;let b=!1,S;for(const E of T){const _=E.type==="folder";if(b){g.push({resource:E,strategy:S});continue}const R=h-v,$=await new nl(o,i).resolveFileExists({name:E.name,isFolder:_},R,!1);v++,$.doForAllConflicts&&(b=!0,S=$.strategy),g.push({resource:E,strategy:$.strategy})}return g},y=(T,v,g)=>{const h=p(r.currentRoute);c({space:T,resources:v,missingFolderPaths:g},async({successful:b,failed:S})=>{var E,_;if(b.length){let R;b.length===1?R=o("%{resource} was restored successfully",{resource:b[0].name}):R=o("%{resourceCount} files restored successfully",{resourceCount:b.length.toString()}),e({title:R}),h.name===p(r.currentRoute).name&&((E=h.query)==null?void 0:E.fileId)===((_=p(r.currentRoute).query)==null?void 0:_.fileId)&&(u.removeResources(b),u.resetSelection());const $=await s.graphAuthenticated.drives.getDrive(T.id,l.graphRoles);a.updateSpaceField({id:$.id,field:"spaceQuota",value:$.spaceQuota})}if(S.length){let R;const A={};S.length===1?(A.resource=S[0].resource.name,R=o('Failed to restore "%{resource}"',A,!0)):(A.resourceCount=S.length.toString(),R=o("Failed to restore %{resourceCount} files",A,!0)),t({title:R,errors:S.map(({error:$})=>$)})}})},w=async({space:T,resources:v})=>{const g=v.sort(($,L)=>$.path.length-L.path.length),{existingResourcesByPath:h,conflicts:b,resolvedResources:S,missingFolderPaths:E}=await f(T,g),_=await d(b),R=_.filter($=>$.strategy===Vn.REPLACE).map($=>$.resource);S.push(...R);const A=_.filter($=>$.strategy===Vn.KEEP_BOTH).map($=>$.resource);for(let $ of A){$={...$};const L=gt.dirname($.path),k=h[L]||[],N=te.extractExtensionFromFile($),z=qn($.name,N,[...k,..._.map(Q=>Q.resource),...S]);$.name=z,$.path=te.urlJoin(L,z),S.push($)}return y(T,S,E)};return{actions:j(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:w,isVisible:({space:T,resources:v})=>!_n(r,"files-trash-generic")||!v.every(g=>te.isTrashResource(g)&&g.canBeRestored())||te.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:n.user})?!1:v.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:y,collectConflicts:f}},_f=()=>mr("$previewService"),mv=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),r=We(),{$gettext:o}=xe.useGettext(),i=Je(),s=cn(),a=_f(),l=lt(),u=jt(),{createDefaultMetaFolder:c}=Di(),{getDefaultMetaFolder:f}=oi(),d=async({space:w,resources:m})=>{var b;const T=i.graphAuthenticated,v=w==null?void 0:w.id,{copyFiles:g,getFileInfo:h}=i.webdav;try{let S=await f(w);S||(S=await c(w)),m[0].id!==((b=w.spaceImageData)==null?void 0:b.id)&&await g(w,{fileId:m[0].id},w,{parentFolderId:S.id,name:m[0].name},{overwrite:!0});const{fileId:E}=await h(w,{fileId:m[0].id}),_=await T.drives.updateDrive(v,{name:w.name,special:[{specialFolder:{name:"image"},id:E}]},u.graphRoles);l.updateSpaceField({id:v,field:"spaceImageData",value:_.spaceImageData}),e({title:o("Space image was set successfully")})}catch(S){console.error(S),t({title:o("Failed to set space image"),errors:[S]})}};return{actions:j(()=>[{name:"set-space-image",icon:"image-edit",handler:w=>s.addTask(()=>d(w)),label:()=>o("Set as space image"),isVisible:({space:w,resources:m})=>m.length!==1||!m[0].mimeType||!a.isMimetypeSupported(m[0].mimeType,!0)||!ft(r,"files-spaces-generic")||!w?!1:w.canEditImage({user:n.user}),class:"oc-files-actions-set-space-image-trigger"}])}},ZF=()=>{const e=We(),{$gettext:t}=xe.useGettext(),n=kr(),r=()=>{const i=_n(e,"files-trash-generic")?null:"actions";Ye.publish(yt.openWithPanel,i)};return{actions:j(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:i})=>p(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},If=()=>{const e=We(),t=Xe(),{$gettext:n}=xe.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>_n(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Ye.publish(yt.open)}}])}},yv=()=>{const e=nn(),{isPersonalSpaceRoot:t}=ln(),n=vt();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||te.isPublicSpaceResource(o)||t(i)||te.isTrashResource(i)?!1:te.isIncomingShareResource(i)?i.sharePermissions.includes(te.GraphSharePermission.readPermissions):te.isShareSpaceResource(o)?te.getPermissionsForSpaceMember(o,n.user).includes(te.GraphSharePermission.readPermissions):!0}},bv=()=>{const e=nn(),t=pn(),n=vt();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||te.isShareSpaceResource(o)||te.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:i.canShare({ability:t,user:n.user})}},Cf=()=>{const e=We(),{$gettext:t}=xe.useGettext(),{canShare:n}=bv(),r=Xe(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Ye.publish(yt.openWithPanel,"sharing#peopleShares")};return{actions:j(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>_n(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Pf=()=>{const{showMessage:e,showErrorMessage:t}=it(),{can:n}=pn(),{$gettext:r,$ngettext:o}=xe.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),a=Je(),l=We(),u=j(()=>n("create-all","Drive")),{dispatchModal:c}=bt(),f=at(),d=lt(),y=Xe(),w=async({spaceName:v,resources:g,space:h})=>{const{webdav:b}=a,S=new Br({concurrency:f.options.concurrentRequests.resourceBatchActions}),E=[];try{const _=await i(v);d.upsertSpace(_),g.length===1&&g[0].isFolder&&(g=(await b.listFiles(h,{path:g[0].path})).children);for(const R of g)E.push(S.add(()=>b.copyFiles(h,R,_,{path:R.name})));await Promise.all(E),y.resetSelection(),e({title:r("Space was created successfully")})}catch(_){console.error(_),t({title:r("Creating space failed…"),errors:[_]})}},m=({resources:v,space:g})=>{c({title:o('Create Space from "%{resourceName}"',"Create Space from selection",v.length,{resourceName:v[0].name}),message:o('Create Space with the content of "%{resourceName}".',"Create Space with the selected files.",v.length,{resourceName:v[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),onInput:s,onConfirm:h=>w({spaceName:h,space:g,resources:v})})};return{actions:j(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:v,space:g})=>!(!v.length||!p(u)||!ft(l,"files-spaces-generic")||!te.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},vv=()=>{const e=rn("scrollTo"),t=rn("details"),n=Xe(),r=j(()=>Et(p(e))),o=j(()=>Et(p(t))),i=(a,l={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Ye.publish("app.files.navigate.page",{resourceId:a,forceScroll:l.forceScroll,topbarElement:l.topbarElement});return}const c=document.getElementById(l.topbarElement),f=(c==null?void 0:c.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||l.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Ye.subscribe("app.files.navigate.scrollTo",a=>i(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(a,l)=>{if(!p(r)||!a.length)return;const u=p(a).find(c=>te.isIncomingShareResource(c)?c.remoteItemId===p(r):c.id===p(r));u&&u.processing!==!0&&(n.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:l}),p(o)&&Ye.publish(yt.openWithPanel,p(o)))}}},eO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=it(),{dispatchModal:r}=bt(),{$gettext:o}=xe.useGettext(),{scrollToResource:i}=vv(),s=Xe(),{resources:a,currentFolder:l}=Ge.storeToRefs(s),u=Je(),c=(w,m)=>w.trim()===""?m(o("Folder name cannot be empty")):/[/]/.test(w)?m(o('Folder name cannot contain "/"')):w==="."?m(o('Folder name cannot be equal to "."')):w===".."?m(o('Folder name cannot be equal to ".."')):p(a).find(v=>v.name===w)?m(o("%{name} already exists",{name:w},!0)):m(null),f=async w=>{w=w.trimEnd();try{const m=gt.join(p(l).path,w),T=await u.webdav.createFolder(p(e),{path:m});te.isShareSpaceResource(p(e))&&(T.remoteItemId=p(e).id),s.upsertResource(T),t({title:o('"%{folderName}" was created successfully',{folderName:w})}),await jn(),i(T.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:o("Failed to create folder"),errors:[m]})}},d=()=>{let w=o("New folder");p(a).some(m=>m.name===w)&&(w=qn(w,"",p(a))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:w,inputLabel:o("Folder name"),onConfirm:f,onInput:c})};return{actions:j(()=>[{name:"create-folder",icon:"folder",handler:d,label:()=>o("New Folder"),isVisible:()=>{var w;return(w=p(l))==null?void 0:w.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:c,addNewFolder:f}},tO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=it(),r=vt(),{$gettext:o}=xe.useGettext(),{dispatchModal:i}=bt(),s=Zn(),{isEnabled:a}=ri(),{openEditor:l}=zn(),u=Je(),c=Xe(),{resources:f,currentFolder:d,areFileExtensionsShown:y}=Ge.storeToRefs(c),w=j(()=>s.fileExtensions.filter(({newFileMenu:h})=>!!h)),m=h=>h===""?o("File name cannot be empty"):/[/]/.test(h)?o('File name cannot contain "/"'):h==="."?o('File name cannot be equal to "."'):h===".."?o('File name cannot be equal to ".."'):/\s+$/.test(h)?o("File name cannot end with whitespace"):p(f).find(S=>S.name===h)?o("%{name} already exists",{name:h},!0):null,T=(h,b)=>(c.upsertResource(h),l(b,p(e),h)),v=(h,b,S)=>{let E=o("New file")+`.${b}`;p(f).some(R=>R.name===E)&&(E=qn(E,b,p(f))),y.value||(E=te.extractNameWithoutExtension({name:E,extension:b}));const _=y.value?[0,E.length-(b.length+1)]:null;i({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:E,inputLabel:o("File name"),inputSelectionRange:_,onConfirm:async R=>{y.value||(R=`${R}.${b}`);try{let A;if(S.createFileHandler)A=await S.createFileHandler({fileName:R,space:p(e),currentFolder:p(d)});else{const $=gt.join(p(d).path,R);A=await u.webdav.putFileContents(p(e),{path:$})}return c.upsertResource(A),t({title:o('"%{fileName}" was created successfully',{fileName:A.name})}),p(a)?void 0:T(A,S)}catch(A){console.error(A),n({title:o("Failed to create file"),errors:[A]})}},onInput:(R,A)=>A(m(y.value?R:`${R}.${b}`))})};return{actions:j(()=>{var S;const h=[],b={};for(const E of p(w)||[])E.hasPriority?b[E.extension]=E:b[E.extension]=b[E.extension]||E;for(const[,E]of Object.entries(b))h.push({name:"create-new-file",icon:"add",handler:_=>v(_,E.extension,E),label:()=>o(E.newFileMenu.menuTitle()),isVisible:()=>{var _;return(_=p(d))==null?void 0:_.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:(S=E.app)==null?void 0:S.startsWith("external-")});return h}),getNameErrorMsg:m,openFile:T}},wv="rowMounted",Ff="fileDropped",nO="contextmenuClicked";class Wn{}Se(Wn,"Thumbnail",[36,36]),Se(Wn,"Tile",[1e3,1e3]),Se(Wn,"Preview",[1200,1200]),Se(Wn,"Avatar",64);class oa{}Se(oa,"Thumbnail","thumbnail"),Se(oa,"Preview","preview"),Se(oa,"Avatar","avatar");class rO{constructor(t,n,r){Se(this,"state");Se(this,"observeEnter");Se(this,"observeExit");Se(this,"onEnterCallCount");Se(this,"onExitCallCount");Se(this,"onEnter");Se(this,"onExit");Se(this,"threshold");Se(this,"unobserver");this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class Sv{constructor(t={}){Se(this,"targets");Se(this,"intersectionObserver");Se(this,"options");this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new rO(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const iO={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},oO={name:"layout-grid",color:"var(--oc-role-secondary)"},sO={name:"resource-type-file",color:"var(--oc-role-on-surface)"},aO=Rp(),lO=$e({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>jP.some(t=>t===e)}},setup(e){const t=dr(Ap),n=j(()=>e.resource.type==="folder"||e.resource.isFolder),r=j(()=>e.resource.type==="space"),o=j(()=>{var l;return(l=e.resource.extension)==null?void 0:l.toLowerCase()}),i=j(()=>{var l;return(l=e.resource.mimeType)==null?void 0:l.toLowerCase()}),s=j(()=>{if(p(r))return oO;if(p(n))return iO;const l=aO[p(o)]||(t==null?void 0:t.mimeType[p(i)])||(t==null?void 0:t.extension[p(o)]);return{...sO,...l}}),a=j(()=>p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:a}}});function cO(e,t,n,r,o,i){const s=ge("oc-icon");return Z(),Ie(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:W.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const Io=ze(lO,[["render",cO]]),uO={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=at(),{options:n}=Ge.storeToRefs(t);return{linkTarget:j(()=>p(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},fO={key:1};function dO(e,t,n,r,o,i){return n.isResourceClickable?(Z(),Ie(Cr(i.componentType),zt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=An(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Ee(()=>[Ke(e.$slots,"default")]),_:3},16,["target","onClick"])):(Z(),me("span",fO,[Ke(e.$slots,"default")]))}const Of=ze(uO,[["render",dO]]),pO=$e({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?ss.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),hO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],gO={key:0,class:"oc-text-truncate"},mO=["textContent"],yO=["textContent"],bO=["textContent"];function vO(e,t,n,r,o,i){const s=sn("oc-tooltip");return ot((Z(),me("span",{class:W.normalizeClass(["oc-resource-name",[{"oc-display-inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(Z(),me("span",gO,[pe("span",{class:"oc-resource-basename",textContent:W.toDisplayString(e.displayName)},null,8,mO)])):(Z(),me("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:W.toDisplayString(e.displayName)},null,8,yO)),e.extension&&e.isExtensionDisplayed?(Z(),me("span",{key:2,class:"oc-resource-extension",textContent:W.toDisplayString(e.displayExtension)},null,8,bO)):Fe("",!0)],10,hO)),[[s,e.tooltip]])}const xf=ze(pO,[["render",vO]]),wO=$e({name:"ResourceListItem",components:{ResourceIcon:Io,ResourceLink:Of,ResourceName:xf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),SO={class:"oc-resource-indicators"},EO=["textContent"];function TO(e,t,n,r,o,i){const s=ge("oc-image"),a=ge("resource-icon"),l=ge("resource-link"),u=ge("resource-name"),c=ge("oc-icon"),f=sn("oc-tooltip");return Z(),me("div",{class:W.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(Z(),Ie(l,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Ee(()=>[e.hasThumbnail?ot((Z(),Ie(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):ot((Z(),Ie(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Fe("",!0),pe("div",{class:W.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[he(l,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Ee(()=>[(Z(),Ie(u,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","onClick"]),pe("div",SO,[e.isPathDisplayed?(Z(),Ie(Cr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:W.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Ee(()=>[he(c,W.normalizeProps(Ha(e.parentFolderLinkIconAttrs)),null,16),pe("span",{class:"text oc-text-truncate",textContent:W.toDisplayString(e.parentFolderName)},null,8,EO)]),_:1},8,["to","style"])):Fe("",!0)])],2)],2)}const Co=ze(wO,[["render",TO]]),Ev=$e({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new Sv,{triggerDefaultAction:n}=zn(),{getMatchingSpace:r}=ln(),{getDefaultAction:o}=zn(),{loadPreview:i}=Bf(),s=qd("resourceListItem"),{getPathPrefix:a,getParentFolderName:l,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:f}=si(),d=Xe(),y=le(),w=j(()=>d.areFileExtensionsShown),m=j(()=>({...e.searchResult.data,...p(y)&&{thumbnail:p(y)}})),T=j(()=>r(p(m))),v=j(()=>{const R=p(m);return te.isSpaceResource(R)&&R.disabled===!0}),g=()=>{n({space:p(T),resources:[p(m)]})},h=j(()=>e.isClickable?{parentFolderLink:u(p(m)),onClick:g}:{isResourceClickable:!1}),b=j(()=>{var $;if(p(m).isFolder)return f(p(m));const R=o({resources:[p(m)],space:p(T)});if(!(R!=null&&R.route))return null;const A=R.route({space:p(T),resources:[p(m)]});return A.query={...A.query,contextRouteQuery:{...(($=A.query)==null?void 0:$.contextRouteQuery)||{},term:e.term}},A}),S=a(p(m)),E=l(p(m)),_=c(p(m));return Mt(()=>{p(v)&&p(s).parentElement.classList.add("disabled");const R=async()=>{const $=await i({space:p(T),resource:p(m),dimensions:Wn.Thumbnail,cancelRunning:!0,updateStore:!1});$&&(y.value=$)},A=Tt.debounce(({unobserve:$})=>{$(),R()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),Un(()=>{t.disconnect()}),(R,A)=>(Z(),Ie(Co,zt({ref_key:"resourceListItem",ref:s,resource:m.value,"path-prefix":p(S),"is-path-displayed":!0,link:b.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(_),"parent-folder-name":p(E),"is-thumbnail-displayed":!!y.value},h.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),AO=7,RO=200,_O=$e({name:"CreateShortcutModal",components:{ResourcePreview:Ev},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Je(),{$gettext:o}=xe.useGettext(),{showMessage:i,showErrorMessage:s}=it(),a=We(),{search:l}=vf(),{getPathPrefix:u,getParentFolderName:c,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:y}=si(),w=Xe(),{resources:m,currentFolder:T}=Ge.storeToRefs(w),v=le(null),g=le(""),h=le(""),b=le(null),S=le(null),E=le(!1);let _=null;const R=G=>{const V=G.trim();return Q(V)?V:`https://${V}`},A=j(()=>R(p(g))),$=j(()=>!!p(m).find(G=>G.name===`${p(h)}.url`)),L=j(()=>p($)||!p(h)||!p(g));wt(L,()=>{t("update:confirmDisabled",p(L))},{immediate:!0});const k=j(()=>p($)?o("%{name} already exists",{name:`${p(h)}.url`}):/[/]/.test(p(h))?o('Shortcut name cannot contain "/"'):""),N=un.useTask(function*(G,V){b.value=null,V=`name:"*${V}*" NOT name:"*.url"`;try{b.value=yield l(V,AO)}catch{}}),z=Tt.debounce(()=>{N.perform(p(g))},RO),Q=G=>["http://","https://"].some(M=>M.startsWith(G)||G.startsWith(M)),J=()=>{b.value=null,g.value=p(A);try{let G=new URL(p(A)).host;p(m).some(V=>V.name===`${G}.url`)&&(G=qn(`${G}.url`,"url",p(m)).slice(0,-4)),h.value=G}catch{}},ae=G=>{b.value=null;const V=new URL(window.location.href);let M=G.data.name;g.value=`${V.origin}/f/${G.id}`,p(m).some(q=>q.name===`${M}.url`)&&(M=qn(`${M}.url`,"url",p(m)).slice(0,-4)),h.value=M},re=G=>p(S)===G,se=(G=!1)=>{const V=Array.from(document.querySelectorAll("li.selectable-item"));let M=p(S)!==null?p(S):G?V.length:-1;const q=G?-1:1;do if(M+=q,M<0||M>V.length-1)return null;while(V[M].classList.contains("disabled"));return M},ue=()=>{S.value=se(!0)},we=()=>{S.value=se(!1)},ee=G=>{p(E)&&(G.stopPropagation(),p(v).hide())},ie=G=>{var V,M;p(E)&&(G.stopPropagation(),p(S)!==null&&(p(S)===0?J():ae((M=(V=p(b))==null?void 0:V.values)==null?void 0:M[p(S)-1]),p(v).hide()))},ce=()=>{E.value=!1,S.value=null},Ce=()=>{E.value=!0,S.value=0},H=()=>{g.value.trim().length&&p(v).show()},I=async()=>{if(await jn(),h.value=g.value.trim(),!g.value.trim().length){p(v).hide();return}p(v).show(),Rn(a,"files-public-link")||z()},F=async()=>{try{const V=`[InternetShortcut]
|
|
52
52
|
URL=${Zf.sanitize(R(p(g)),{USE_PROFILES:{html:!0}})}`,M=te.urlJoin(p(T).path,`${p(h)}.url`),q=await r.webdav.putFileContents(e.space,{path:M,content:V});w.upsertResource(q),i({title:o("Shortcut was created successfully")})}catch(G){console.error(G),s({title:o("Failed to create shortcut"),errors:[G]})}};return Mt(async()=>{var G,V;await jn(),_=new ed((V=(G=p(v))==null?void 0:G.$refs)==null?void 0:V.drop)}),wt(b,async()=>{await jn(),!(!p(E)||!_)&&(_.unmark(),_.mark(p(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),wt(S,()=>{var V,M;if(!p(E)||typeof((M=(V=p(v))==null?void 0:V.$el)==null?void 0:M.scrollTo)!="function")return;const G=p(v).$el.querySelectorAll(".selectable-item");p(v).$el.scrollTo(0,p(S)===null?0:G[p(S)].getBoundingClientRect().y-G[p(S)].getBoundingClientRect().height)}),n({onConfirm:F}),{inputUrl:g,inputFilename:h,dropRef:v,dropItemUrl:A,searchResult:b,confirmButtonDisabled:L,inputFileNameErrorMessage:k,searchTask:N,dropItemUrlClicked:J,dropItemResourceClicked:ae,getPathPrefix:u,getFolderLink:y,getParentFolderLink:f,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:ie,onKeyDownDrop:we,onKeyUpDrop:ue,onKeyEscDrop:ee,onHideDrop:ce,onShowDrop:Ce,onInputUrlInput:I,onClickUrlInput:H,isDropItemActive:re,onConfirm:F}}}),IO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},CO=["textContent"],PO=["textContent"],FO={key:0,class:"oc-p-xs oc-flex oc-flex-center"},OO={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},xO=["textContent"],kO={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},NO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},$O=["textContent"];function DO(e,t,n,r,o,i){const s=ge("oc-contextual-helper"),a=ge("oc-text-input"),l=ge("oc-icon"),u=ge("oc-button"),c=ge("oc-spinner"),f=ge("resource-preview"),d=ge("oc-list"),y=ge("oc-drop");return Z(),me(Qe,null,[he(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=w=>e.inputUrl=w),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[Ji(e.onKeyUpDrop,["up"]),Ji(e.onKeyDownDrop,["down"]),Ji(e.onKeyEscDrop,["esc"]),Ji(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Ee(()=>[pe("div",IO,[pe("label",{for:"create-shortcut-modal-url-input",textContent:W.toDisplayString(e.$gettext("Webpage or file"))},null,8,CO),he(s,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),he(y,{ref:"dropRef",class:"oc-pt-s","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":!0,onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Ee(()=>[he(d,null,{default:Ee(()=>{var w,m;return[pe("li",{class:W.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[he(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Ee(()=>[he(l,{name:"external-link"}),pe("span",{textContent:W.toDisplayString(e.dropItemUrl)},null,8,PO)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(Z(),me("li",FO,[he(c)])):Fe("",!0),(m=(w=e.searchResult)==null?void 0:w.values)!=null&&m.length?(Z(),me(Qe,{key:1},[pe("li",OO,[pe("span",{textContent:W.toDisplayString(e.$gettext("Link to a file"))},null,8,xO)]),(Z(!0),me(Qe,null,Ft(e.searchResult.values,(T,v)=>(Z(),me("li",{key:v,class:W.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(v+1)}])},[he(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:g=>e.dropItemResourceClicked(T)},{default:Ee(()=>[he(f,{"search-result":T,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Fe("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(Z(),me("div",kO,[he(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),label:e.$gettext("Shortcut name"),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Ee(()=>[pe("div",NO,[pe("label",{for:"create-shortcut-modal-filename-input",textContent:W.toDisplayString(e.$gettext("Shortcut name"))},null,8,$O),he(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):Fe("",!0)],64)}const Tv=ze(_O,[["render",DO]]),LO=({space:e})=>{const{dispatchModal:t}=bt(),{$gettext:n}=xe.useGettext(),r=Xe(),{currentFolder:o}=Ge.storeToRefs(r);return{actions:j(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Tv,customComponentAttrs:()=>({space:p(e)})})},label:()=>n("New Shortcut"),isVisible:()=>{var s;return(s=p(o))==null?void 0:s.canCreate()},class:"oc-files-actions-create-new-shortcut"}])}},MO=()=>{const{showErrorMessage:e}=it(),t=We(),{$gettext:n}=xe.useGettext(),r=kr(),o=os(),i=Je(),s=u=>{const c=/URL=(.+)/,f=u.match(c);if(f&&f[1])return f[1];throw new Error("unable to extract url")},a=async({resources:u,space:c})=>{try{const f=new URL(window.location.href),d=(await i.webdav.getFileContents(c,u[0])).body;let y=s(d);if(y=y.match(/^http[s]?:\/\//)?y:`https://${y}`,y=Zf.sanitize(y,{USE_PROFILES:{html:!0}}),y.startsWith(f.origin)){window.location.href=y;return}window.open(y)}catch(f){console.error(f),e({title:n("Failed to open shortcut"),errors:[f]})}};return{actions:j(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>p(r)&&!p(o)&&!ft(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")||u.length!==1||u[0].extension!=="url"?!1:u[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:s}},BO=$e({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=xe.useGettext(),{getLinkRoleByType:r}=sa(),o=l=>e.modelValue===l,i=l=>{t("update:modelValue",l)},s=j(()=>{var l;return n((l=r(e.modelValue))==null?void 0:l.displayName)}),a=Xt.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),jO=["textContent"],UO=["textContent"],qO={class:"oc-flex oc-flex-middle"},VO=["textContent"],zO={class:"oc-text-small"},WO={class:"oc-flex"};function HO(e,t,n,r,o,i){var f;const s=ge("oc-icon"),a=ge("oc-button"),l=ge("oc-list"),u=ge("oc-drop"),c=sn("oc-tooltip");return Z(),me(Qe,null,[e.availableLinkTypeOptions.length>1?(Z(),Ie(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"oc-text-left link-role-dropdown-toggle"},{default:Ee(()=>[pe("span",{class:"link-current-role",textContent:W.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,jO),he(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((Z(),me("span",{key:1,class:"link-current-role oc-mr-m",textContent:W.toDisplayString(e.currentLinkRoleLabel)},null,8,UO)),[[c,(f=e.getLinkRoleByType(e.modelValue))==null?void 0:f.description]]),e.availableLinkTypeOptions.length>1?(Z(),Ie(u,{key:2,class:"link-role-dropdown","drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click",offset:e.dropOffset,"close-on-click":""},{default:Ee(()=>[he(l,{class:"role-dropdown-list"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.availableLinkTypeOptions,(d,y)=>(Z(),me("li",{key:`role-dropdown-${y}`},[he(a,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:W.normalizeClass([{selected:e.isSelectedType(d),"oc-secondary-container":e.isSelectedType(d)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:w=>e.updateSelectedType(d)},{default:Ee(()=>[pe("span",qO,[he(s,{name:e.getLinkRoleByType(d).icon,class:"oc-pl-s oc-pr-m"},null,8,["name"]),pe("span",null,[pe("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,VO),pe("span",zO,W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),pe("span",WO,[e.isSelectedType(d)?(Z(),Ie(s,{key:0,name:"check"})):Fe("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):Fe("",!0)],64)}const Av=ze(BO,[["render",HO],["__scopeId","data-v-0eaa2216"]]),GO=$e({name:"CreateLinkModal",components:{LinkRoleDropdown:Av},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Je(),r=xe.useGettext(),{$gettext:o}=r,i=qv(),{isEnabled:s,postMessage:a}=ri(),{defaultLinkType:l,getAvailableLinkTypes:u,getLinkRoleByType:c,isPasswordEnforcedForLinkType:f}=sa(),{addLink:d}=jt(),y=le(!1),w=le(!1),m=j(()=>e.resources.every(({isFolder:we})=>we)),T=j(()=>p(s)?o("Share link(s)"):o("Copy link")),v=le(Xt.v4()),g=le({}),h=le(),b=Ca({value:"",error:void 0}),S=le(p(l)),E=j(()=>o(c(p(S)).description)),_=j(()=>o(c(p(S)).displayName)),R=j(()=>c(p(S)).icon),A=j(()=>u({isFolder:p(m)})),$=j(()=>f(p(S))),L=i.getPolicy({enforcePassword:p($)}),k=()=>{y.value=!0},N=({date:we,error:ee})=>{h.value=we,w.value=ee},z=()=>Promise.allSettled(e.resources.map(we=>{var ee;return d({clientService:n,space:e.space,resource:we,options:{type:p(S),"@libre.graph.quickLink":!1,password:p(b).value,expirationDateTime:(ee=p(h))==null?void 0:ee.toISO(),displayName:o("Unnamed link")}})})),Q=j(()=>!!L.check(p(b).value)),J=j(()=>!(p(Q)&&!p(w))),ae=async(we={})=>{const ee=await z(),ie=ee.filter(({status:H})=>H==="fulfilled");ie.length&&p(s)&&a("opencloud-embed:share",ie.map(({value:H})=>H.webUrl));const ce=[],Ce=ee.filter(({status:H})=>H==="rejected");if(Ce.length&&Ce.map(({reason:H})=>H).forEach(H=>{var I;if(console.error(H),((I=H.response)==null?void 0:I.status)===400){const F=H.response.data.error;F.message=Tt.upperFirst(F.message),ce.push(F)}}),ce.length)return b.error=o(ce[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:ee,password:b.value,options:we})};t({onConfirm:ae});const re=we=>p(S)===we,se=we=>{b.value=we,b.error=void 0},ue=we=>{S.value=we};return Mt(()=>{const we=p(g)[p(S)];we&&we.$el.focus(),p($)&&(b.value=i.generatePassword())}),{roleRefs:g,password:b,passwordEnforced:$,passwordPolicy:L,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:v,selectedExpiry:h,availableLinkTypes:A,selectedType:S,selectedTypeIcon:R,selectedTypeDisplayName:_,selectedTypeDescription:E,isSelectedLinkType:re,updateSelectedLinkType:ue,updatePassword:se,getLinkRoleByType:c,confirmButtonText:T,isAdvancedMode:y,setAdvancedMode:k,onExpiryDateChanged:N,confirmButtonDisabled:J,DateTime:Dt.DateTime,onConfirm:ae}}}),KO={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},QO={key:0,class:"oc-flex oc-flex-middle"},XO={key:1,class:"oc-flex oc-flex-middle"},YO={class:"oc-flex oc-flex-column"},JO=["textContent"],ZO=["textContent"],ex=["textContent"],tx={class:"link-modal-password oc-mb-m"},nx={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},rx=["textContent"],ix=["textContent"],ox={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},sx={class:"oc-rounded oc-menu-item-hover"};function ax(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("link-role-dropdown"),l=ge("oc-button"),u=ge("oc-text-input"),c=ge("oc-datepicker"),f=ge("oc-list"),d=ge("oc-drop");return Z(),me(Qe,null,[pe("div",KO,[e.isAdvancedMode?(Z(),me("div",QO,[he(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),he(a,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(Z(),me("div",XO,[he(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),pe("div",YO,[pe("span",{class:"oc-text-bold",textContent:W.toDisplayString(e.selectedTypeDisplayName)},null,8,JO),pe("span",{class:"oc-text-small",textContent:W.toDisplayString(e.selectedTypeDescription)},null,8,ZO)])])),e.isAdvancedMode?Fe("",!0):(Z(),Ie(l,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:t[0]||(t[0]=y=>e.setAdvancedMode())},{default:Ee(()=>[he(s,{name:"settings-3",size:"small","fill-type":"fill"}),pe("span",{textContent:W.toDisplayString(e.$gettext("Options"))},null,8,ex)]),_:1}))]),pe("div",tx,[e.isAdvancedMode?(Z(),Ie(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.passwordEnforced?`${e.$gettext("Password")}*`:e.$gettext("Password"),class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","onUpdate:modelValue"])):e.password.value?(Z(),me("div",nx,[pe("span",{textContent:W.toDisplayString(e.$gettext("Password:"))},null,8,rx),pe("span",{textContent:W.toDisplayString(e.password.value)},null,8,ix)])):Fe("",!0),e.isAdvancedMode?(Z(),Ie(c,{key:2,class:"oc-mt-s","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):Fe("",!0)]),pe("div",ox,[he(l,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=y=>e.$emit("cancel"))},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),pe("div",{class:W.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[he(l,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=y=>e.$emit("confirm"))},{default:Ee(()=>[Vt(W.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(Z(),Ie(l,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Ee(()=>[he(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):Fe("",!0),e.password.value?(Z(),Ie(d,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small","close-on-click":""},{default:Ee(()=>[he(f,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Ee(()=>[pe("li",sx,[he(l,{class:"oc-modal-body-actions-confirm-password action-menu-item",appearance:"raw",onClick:t[3]||(t[3]=y=>e.$emit("confirm",{copyPassword:!0}))},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):Fe("",!0)],2)])],64)}const Rv=ze(GO,[["render",ax],["__scopeId","data-v-0f5a06c6"]]),yn={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},lx={LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},sa=()=>{const{$gettext:e}=xe.useGettext(),t=nn(),n=pn(),r=j(()=>n.can("create-all","PublicLink")),o=j(()=>yn.View),i=u=>u===yn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===yn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===yn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===yn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>p(r)?u?[yn.View,yn.Edit,yn.CreateOnly]:[yn.View,yn.Edit]:[],a=[{id:yn.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:yn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:yn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:yn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:yn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:c})=>c===u)}},cx=({enforceModal:e=!1}={})=>{const t=Je(),n=vt(),{showMessage:r,showErrorMessage:o}=it(),{$gettext:i,$ngettext:s}=xe.useGettext(),a=nn(),l=pn(),u=cn(),{defaultLinkType:c}=sa(),{addLink:f}=jt(),{dispatchModal:d}=bt(),{copyToClipboard:y}=Sf(),w=async({result:g,password:h,options:b={}})=>{const S=g.filter(_=>_.status==="fulfilled");if(S.length){let _=i("Link has been created successfully");if(g.length===1)try{const R=b.copyPassword?i("%{link} Password:%{password}",{link:S[0].value.webUrl,password:h},!0):S[0].value.webUrl;await y(R),_=i("The link has been copied to your clipboard.")}catch(R){console.warn("Unable to copy link to clipboard",R)}r({title:s(_,"Links have been created successfully.",S.length)})}const E=g.filter(({status:_})=>_==="rejected");E.length&&o({errors:E.map(({reason:_})=>_),title:s("Failed to create link","Failed to create links",E.length)})},m=async({space:g,resources:h})=>{const b=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||b){d({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",h.length,{resourceName:h[0].name}),customComponent:Rv,customComponentAttrs:()=>({space:g,resources:h,callbackFn:w}),hideActions:!0});return}const S=h.map(_=>f({clientService:t,space:g,resource:_,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:p(c)}})),E=await u.addTask(()=>Promise.allSettled(S));w({result:E})},T=({resources:g})=>{if(!g.length)return!1;for(const h of g)if(!h.canShare({user:n.user,ability:l})||te.isProjectSpaceResource(h)&&h.disabled)return!1;return!0};return{actions:j(()=>[{name:"create-links",icon:"link",handler:m,label:()=>i("Create links"),isVisible:T,class:"oc-files-actions-create-links"}])}},ux=$e({name:"AppLoadingSpinner"}),fx={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function dx(e,t,n,r,o,i){const s=ge("oc-spinner");return Z(),me("div",fx,[he(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const kf=ze(ux,[["render",dx]]),px=$e({name:"FilePickerModal",components:{AppLoadingSpinner:kf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=le(),n=le(!0),r=We(),{removeModal:o}=bt(),{getMatchingSpace:i}=ln(),s=ii(),{getEditorRouteOpts:a}=zn(),l=r.resolve(e.parentFolderLink),u=e.app.extensions.map(m=>m.extension?m.extension:m.mimeType),c=s.currentTheme.name,f=new URL(l.href,window.location.origin);f.searchParams.append("hide-logo","true"),f.searchParams.append("embed","true"),f.searchParams.append("embed-target","file"),f.searchParams.append("embed-delegate-authentication","false"),f.searchParams.append("embed-file-types",u.join(","));const d=()=>{n.value=!1,p(t).contentWindow.focus()},y=({data:m})=>{if(m.name!=="opencloud-embed:file-pick")return;const{resource:T,locationQuery:v}=m.data,g=i(T),h=te.isShareSpaceResource(g)?g.id:void 0,b=a(p(r.currentRoute).name,g,T,h);b.query={...b.query,...v};const S=r.resolve(b),E=new URL(S.href,window.location.origin);o(e.modal.id),window.open(E.href,"_blank")},w=({data:m})=>{m.name==="opencloud-embed:cancel"&&o(e.modal.id)};return Mt(()=>{window.addEventListener("message",y),window.addEventListener("message",w)}),Un(()=>{window.removeEventListener("message",y),window.removeEventListener("message",w)}),{isLoading:n,onLoad:d,iframeTitle:c,iframeSrc:f.href,iframeRef:t,onFilePick:y}}}),hx={class:"oc-height-1-1",tabindex:"0"},gx=["title","src"];function mx(e,t,n,r,o,i){const s=ge("app-loading-spinner");return Z(),me("div",hx,[e.isLoading?(Z(),Ie(s,{key:0})):Fe("",!0),ot(pe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,gx),[[Ja,!e.isLoading]])])}const _v=ze(px,[["render",mx]]),aa=(e={},t)=>{const n=e.targetRouteCallback,{getMatchingSpace:r}=ln(e);return{createFileAction:s=>{const a=p(e.space)||r(s);t.emit("fileClick",{space:a,resources:[s]})},createFolderLink:s=>{if(p(n))return p(n)(s);const{path:a,fileId:l,resource:u}=s,c=p(e.space)||r(u);return c?On("files-spaces-generic",Jn(c,{path:a,fileId:l})):{}}}},si=(e={})=>{const t=nn(),{$gettext:n}=xe.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:i}=ln(),{createFolderLink:s}=aa(e);return{getPathPrefix:d=>{const y=p(e.space)||o(d);return te.isProjectSpaceResource(y)?ss.join(n("Spaces"),y.name):te.isShareSpaceResource(y)?ss.join(n("Shares"),y.name):y.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const y=p(e.space)||o(d),w=i({space:y,path:gt.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!w?xn("files-shares-with-me"):te.isProjectSpaceResource(d)?On("files-spaces-projects"):s({path:gt.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const y=p(e.space)||o(d),w=i({space:y,path:gt.dirname(d.path)});if(te.isShareRoot(d)||d.id===y.id&&te.isShareSpaceResource(y)||!w)return n("Shared with me");const T=te.extractParentFolderName(d);if(T)return T;if(te.isShareSpaceResource(y))return y.name;if(t.spacesProjects){if(te.isProjectSpaceResource(d))return n("Spaces");if((y==null?void 0:y.driveType)==="project")return y.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>te.isProjectSpaceResource(d)||te.isProjectSpaceResource(r(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Iv=({appId:e})=>{const{$gettext:t}=xe.useGettext(),n=kr(),{dispatchModal:r}=bt(),o=Zn(),{apps:i}=Ge.storeToRefs(o),{getParentFolderLink:s}=si(),a=({resources:u})=>{const c=p(i)[e],f=s(u[0]);r({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:c.name}),customComponent:_v,hideActions:!0,customComponentAttrs:()=>({app:c,parentFolderLink:f}),focusTrapInitial:!1})};return{actions:j(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!p(n),class:"oc-files-actions-open-with-app-trigger"}])}},yx=$e({name:"SaveAsModal",components:{AppLoadingSpinner:kf},props:{modal:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0},originalResource:{type:Object,required:!0},content:{type:String,required:!0}},setup(e){const t=le(),n=le(!0),r=ii(),{$gettext:o}=xe.useGettext(),i=We(),s=Je(),{removeModal:a}=bt(),{showMessage:l,showErrorMessage:u}=it(),{getMatchingSpace:c}=ln(),{getEditorRouteOpts:f}=zn(),d=i.resolve(e.parentFolderLink),y=r.currentTheme.name,w=new URL(d.href,window.location.origin);w.searchParams.append("hide-logo","true"),w.searchParams.append("embed","true"),w.searchParams.append("embed-target","location"),w.searchParams.append("embed-choose-file-name","true"),w.searchParams.append("embed-delegate-authentication","false"),w.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const m=()=>{n.value=!1,p(t).contentWindow.focus()},T=async({data:b})=>{if(b.name!=="opencloud-embed:select")return;const{resources:S,fileName:E,locationQuery:_}=b.data,R=S[0],A=c(R);try{const $=await v({destinationFolder:R,fileName:E,space:A});l({title:o('"%{fileName}" was saved successfully',{fileName:$.name})}),g({resource:$,space:A,locationQuery:_})}catch($){console.error($),u({title:o('Unable to save "%{fileName}"',{fileName:E}),errors:[$]}),console.error($)}a(e.modal.id)},v=async({destinationFolder:b,fileName:S,space:E})=>{const{children:_}=await s.webdav.listFiles(E,{fileId:b.fileId},{davProperties:[Ue.Name]});return _.find(A=>A.name===S)&&(S=qn(S,e.originalResource.extension,_)),s.webdav.putFileContents(E,{fileName:S,parentFolderId:b.id,content:e.content,path:te.urlJoin(b.path,S)})},g=({locationQuery:b,resource:S,space:E})=>{const _=te.isShareSpaceResource(E)?E.id:void 0,R=f(p(i.currentRoute).name,E,S,_);R.query={...R.query,...b};const A=i.resolve(R),$=new URL(A.href,window.location.origin);window.open($.href,"_blank")},h=({data:b})=>{b.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Mt(()=>{window.addEventListener("message",T),window.addEventListener("message",h)}),Un(()=>{window.removeEventListener("message",T),window.removeEventListener("message",h)}),{isLoading:n,onLoad:m,iframeTitle:y,iframeSrc:w.href,iframeRef:t,onLocationPick:T}}}),bx={class:"oc-height-1-1",tabindex:"0"},vx=["title","src"];function wx(e,t,n,r,o,i){const s=ge("app-loading-spinner");return Z(),me("div",bx,[e.isLoading?(Z(),Ie(s,{key:0})):Fe("",!0),ot(pe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,vx),[[Ja,!e.isLoading]])])}const Cv=ze(yx,[["render",wx]]),Pv=({content:e})=>{const{$gettext:t}=xe.useGettext(),n=kr(),{dispatchModal:r}=bt(),{getParentFolderLink:o}=si(),i=({resources:a})=>{const l=o(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Cv,hideActions:!0,customComponentAttrs:()=>({content:p(e),parentFolderLink:l,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:j(()=>[{name:"save-as",icon:"save-2",handler:i,label:()=>t("Save as"),isVisible:({resources:a})=>!p(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},Fv=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=pn(),s=Je(),a=Jt(),{dispatchModal:l}=bt(),u=lt(),{removeResources:c}=Xe(),f=m=>m.filter(T=>te.isProjectSpaceResource(T)&&T.canBeDeleted({user:n.user,ability:i})),d=async m=>{const T=s.graphAuthenticated,v=m.map(S=>T.drives.deleteDrive(S.id).then(()=>(c([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(v),h=g.filter(S=>S.status==="fulfilled");if(h.length){const S=h.length===1&&m.length===1?r('Space "%{space}" was deleted successfully',{space:m[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:S})}const b=g.filter(S=>S.status==="rejected");if(b.length){b.forEach(console.error);const S=b.length===1&&m.length===1?r('Failed to delete space "%{space}"',{space:m[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",b.length,{spaceCount:b.length.toString()},!0);t({title:S,errors:b.map(E=>E.reason)})}p(a).name==="admin-settings-spaces"&&Ye.publish("app.admin-settings.list.load")},y=({resources:m})=>{const T=f(m);if(!T.length)return;const v=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",T.length,{count:T.length.toString()});l({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:r("Delete"),message:v,hasInput:!1,onConfirm:()=>d(T)})};return{actions:j(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:y,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},Ov=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=pn(),s=Je(),a=Jt(),l=We(),{dispatchModal:u}=bt(),c=lt(),f=m=>m.filter(T=>te.isProjectSpaceResource(T)&&T.canDisable({user:n.user,ability:i})),d=async m=>{const T=p(a),v=s.graphAuthenticated,g=m.map(E=>v.drives.disableDrive(E.id).then(()=>(T.name==="files-spaces-generic"&&l.push({name:"files-spaces-projects"}),T.name==="admin-settings-spaces"&&(E.disabled=!0,E.spaceQuota={total:E.spaceQuota.total}),c.updateSpaceField({id:E.id,field:"disabled",value:!0}),!0))),h=await Promise.allSettled(g),b=h.filter(E=>E.status==="fulfilled");if(b.length){const E=b.length===1&&m.length===1?r('Space "%{space}" was disabled successfully',{space:m[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",b.length,{spaceCount:b.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&m.length===1?r('Failed to disable space "%{space}"',{space:m[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(_=>_.reason)})}},y=({resources:m})=>{const T=f(m);if(!T.length)return;const v=o("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",T.length,{count:T.length.toString()}),g=r("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:g,message:v,hasInput:!1,onConfirm:()=>d(T)})};return{actions:j(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:y,isVisible:({resources:m})=>!!f(m).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},xv=()=>{const e=at(),t=lt(),n=jt(),{showMessage:r,showErrorMessage:o}=it(),i=We(),{$gettext:s}=xe.useGettext(),a=pn(),l=Je(),u=cn(),{upsertResource:c}=Xe(),f=ft(i,"files-spaces-projects"),d=async m=>{const T=t.spaces.filter(te.isProjectSpaceResource),v=qn(m.name,"",T);try{let g=await l.graphAuthenticated.drives.createDrive({name:v,description:m.description,quota:{total:m.spaceQuota.total}},n.graphRoles);const h=await l.webdav.listFiles(m);if(h.children.length){const b=new Br({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const E of h.children)S.push(b.add(()=>l.webdav.copyFiles(m,E,g,{path:E.name})));await Promise.all(S)}if(m.spaceReadmeData||m.spaceImageData){const b={special:[]};if(m.spaceReadmeData){const S=await l.webdav.getFileInfo(g,{path:`.space/${m.spaceReadmeData.name}`});b.special.push({specialFolder:{name:"readme"},id:S.id})}if(m.spaceImageData){const S=await l.webdav.getFileInfo(g,{path:`.space/${m.spaceImageData.name}`});b.special.push({specialFolder:{name:"image"},id:S.id})}g=await l.graphAuthenticated.drives.updateDrive(g.id,b,n.graphRoles)}t.upsertSpace(g),f&&c(g),r({title:s('Space "%{space}" was duplicated successfully',{space:m.name})})}catch(g){console.error(g),o({title:s('Failed to duplicate space "%{space}"',{space:m.name}),errors:[g]})}},y=async({resources:m})=>{for(const T of m)T.disabled||!te.isProjectSpaceResource(T)||await d(T)};return{actions:j(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:m=>u.addTask(()=>y(m)),isVisible:({resources:m})=>!(m!=null&&m.length)||m.every(T=>T.disabled)||m.every(T=>!te.isProjectSpaceResource(T))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},Sx=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),{$gettext:r}=xe.useGettext(),o=pn(),i=Je(),s=Jt(),{dispatchModal:a}=bt(),l=lt(),u=jt(),c=(y,w)=>i.graphAuthenticated.drives.updateDrive(y.id,{name:y.name,description:w},u.graphRoles).then(()=>{l.updateSpaceField({id:y.id,field:"description",value:w}),p(s).name==="admin-settings-spaces"&&(y.description=w),e({title:r("Space subtitle was changed successfully")})}).catch(T=>{console.error(T),t({title:r("Failed to change space subtitle"),errors:[T]})}),f=({resources:y})=>{y.length===1&&a({title:r("Change subtitle for space")+" "+y[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:y[0].description,onConfirm:w=>c(y[0],w)})};return{actions:j(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:f,isVisible:({resources:y})=>y.length!==1?!1:y[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:c}},Ex={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=le(void 0),t=le([]);return{selectedOption:e,options:t}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return Tt.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=Sn(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},Tx={class:"quota-select-batch-action-form"},Ax=["textContent"],Rx={class:"oc-flex oc-flex-between"},_x=["textContent"],Ix={key:0,class:"oc-text-input-danger"};function Cx(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-select");return Z(),me("div",Tx,[he(a,zt({ref:"select","model-value":r.selectedOption,selectable:i.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":i.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":i.onUpdate}),{"selected-option":Ee(({displayValue:l})=>[e.$attrs["read-only"]?(Z(),Ie(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):Fe("",!0),pe("span",{textContent:W.toDisplayString(l)},null,8,Ax)]),search:Ee(({attributes:l,events:u})=>[pe("input",zt({class:"vs__search"},l,qa(u,!0)),null,16)]),option:Ee(({displayValue:l,error:u})=>[pe("div",Rx,[pe("span",{textContent:W.toDisplayString(l)},null,8,_x)]),u?(Z(),me("div",Ix,W.toDisplayString(u),1)):Fe("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const kv=ze(Ex,[["render",Cx]]),Px=$e({name:"SpaceQuotaModal",components:{QuotaSelect:kv},props:{modal:{type:Object,required:!0},spaces:{type:Array,required:!0},warningMessage:{type:String,default:""},warningMessageContextualHelperData:{type:Object,default:()=>{}},resourceType:{type:String,required:!1,default:"space",validator:e=>["space","user"].includes(e)}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const{showMessage:r,showErrorMessage:o}=it(),i=nn(),s=Ge.storeToRefs(i),{$gettext:a,$ngettext:l}=xe.useGettext(),u=Je(),c=We(),f=lt(),d=jt(),{updateResourceField:y}=Xe(),w=le(0),m=b=>e.resourceType==="space"?l("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",b,{count:b.toString()}):e.resourceType==="user"?l("User quota was changed successfully","Quota of %{count} users was changed successfully",b,{count:b.toString()}):a("Quota was changed successfully"),T=b=>e.resourceType==="space"?l("Failed to change space quota","Failed to change quota for %{count} spaces",b,{count:b.toString()}):e.resourceType==="user"?l("Failed to change user quota","Failed to change quota for %{count} users",b,{count:b.toString()}):a("Failed to change quota"),v=j(()=>!e.spaces.some(b=>b.spaceQuota.total!==p(w)));wt(v,()=>{t("update:confirmDisabled",p(v))},{immediate:!0});const g=b=>{w.value=b.value},h=async()=>{const b=u.graphAuthenticated,S=e.spaces.map(async A=>{const $=await b.drives.updateDrive(A.id,{name:A.name,quota:{total:p(w)}},d.graphRoles);p(c.currentRoute).name==="admin-settings-spaces"&&Ye.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:$.spaceQuota}),p(c.currentRoute).name==="admin-settings-users"&&Ye.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:$.spaceQuota}),f.updateSpaceField({id:A.id,field:"spaceQuota",value:$.spaceQuota}),y({id:A.id,field:"spaceQuota",value:$.spaceQuota})}),E=await Promise.allSettled(S),_=E.filter(A=>A.status==="fulfilled");_.length&&r({title:m(_.length)});const R=E.filter(A=>A.status==="rejected");R.length&&(console.error(R),R.forEach(console.error),o({title:T(R.length),errors:R.map(A=>A.reason)}))};return n({onConfirm:h}),Mt(()=>{var b,S;w.value=((S=(b=e.spaces[0])==null?void 0:b.spaceQuota)==null?void 0:S.total)||0}),{selectedOption:w,confirmButtonDisabled:v,changeSelectedQuotaOption:g,maxQuota:s.spacesMaxQuota,onConfirm:h}}}),Fx={key:0,class:"oc-mt-s"},Ox=["textContent"];function xx(e,t,n,r,o,i){const s=ge("quota-select"),a=ge("oc-contextual-helper");return Z(),me(Qe,null,[he(s,{"total-quota":e.selectedOption,"max-quota":e.maxQuota,"position-fixed":!0,onSelectedOptionChange:e.changeSelectedQuotaOption},null,8,["total-quota","max-quota","onSelectedOptionChange"]),e.warningMessage?(Z(),me("div",Fx,[pe("span",{class:"oc-text-input-warning",textContent:W.toDisplayString(e.warningMessage)},null,8,Ox),e.warningMessageContextualHelperData?(Z(),Ie(a,zt({key:0,class:"oc-pl-xs"},e.warningMessageContextualHelperData),null,16)):Fe("",!0)])):Fe("",!0)],64)}const Nv=ze(Px,[["render",xx]]),$v=()=>{const{dispatchModal:e}=bt(),{$gettext:t}=xe.useGettext(),n=pn(),r=({resources:s})=>s.length===1?t('Change quota for Space "%{name}"',{name:s[0].name}):t("Change quota for %{count} Spaces",{count:s.length.toString()}),o=({resources:s})=>{e({title:r({resources:s}),customComponent:Nv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:j(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!te.isProjectSpaceResource(a)||te.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Dv(){const{getDefaultAction:e}=zn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;const o={resources:[r],space:n},i=e({...o,omitSystemActions:!0});i&&i.handler(o)}}}const kx=()=>{const e=Je(),{openWithDefaultApp:t}=Dv(),{createDefaultMetaFolder:n}=Di(),r=vt(),o=lt(),i=jt(),{$gettext:s}=xe.useGettext(),{getDefaultMetaFolder:a}=oi(),l=async(f,d)=>{const y=await e.webdav.putFileContents(f,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),w=await e.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"readme"},id:y.id}]},i.graphRoles);return o.updateSpaceField({id:f.id,field:"spaceReadmeData",value:w.spaceReadmeData}),y},u=async({resources:f})=>{let d=null,y=await a(f[0]);if(y||(y=await n(f[0]),d=await l(f[0],y)),!d){const w=te.getRelativeSpecialFolderSpacePath(f[0],"readme");w?d=await e.webdav.getFileInfo(f[0],{path:w}):d=await l(f[0],y)}t({space:f[0],resource:d})};return{actions:j(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Lv=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),{$gettext:r}=xe.useGettext(),o=pn(),i=Je(),s=Jt(),{checkSpaceNameModalInput:a}=oi(),{dispatchModal:l}=bt(),u=lt(),c=jt(),f=(w,m)=>i.graphAuthenticated.drives.updateDrive(w.id,{name:m},c.graphRoles).then(()=>{p(s).name==="admin-settings-spaces"&&(w.name=m),u.updateSpaceField({id:w.id,field:"name",value:m}),e({title:r("Space name was changed successfully")})}).catch(v=>{console.error(v),t({title:r("Failed to rename space"),errors:[v]})}),d=({resources:w})=>{w.length===1&&l({title:r("Rename space")+" "+w[0].name,confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:w[0].name,onConfirm:m=>f(w[0],m),onInput:a})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:w})=>w.length!==1?!1:w[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:f}},Mv=()=>{const{showMessage:e,showErrorMessage:t}=it(),n=vt(),{$gettext:r,$ngettext:o}=xe.useGettext(),i=pn(),s=Je(),a=cn(),l=Jt(),{dispatchModal:u}=bt(),c=lt(),f=jt(),d=T=>T.filter(v=>te.isProjectSpaceResource(v)&&v.canRestore({user:n.user,ability:i})),y=async T=>{const v=s.graphAuthenticated,g=T.map(E=>v.drives.updateDrive(E.id,{name:E.name},f.graphRoles,{headers:{Restore:"true"}}).then(_=>(p(l).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=_.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),h=await a.addTask(()=>Promise.allSettled(g)),b=h.filter(E=>E.status==="fulfilled");if(b.length){const E=b.length===1&&T.length===1?r('Space "%{space}" was enabled successfully',{space:T[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",b.length,{spaceCount:b.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&T.length===1?r('Failed to enabled space "%{space}"',{space:T[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(_=>_.reason)})}},w=({resources:T})=>{const v=d(T);if(!v.length)return;const g=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",v.length,{count:v.length.toString()}),h=r("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",v.length,{space:v[0].name,spaceCount:v.length.toString()}),confirmText:h,message:g,hasInput:!1,onConfirm:()=>y(v)})};return{actions:j(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:w,isVisible:({resources:T})=>!!d(T).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:y}},Nx=()=>{const{$gettext:e}=xe.useGettext(),t=Xe(),n=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Ye.publish(yt.openWithPanel,"space-share")};return{actions:j(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},$x=()=>{const e=We(),{$gettext:t}=xe.useGettext(),n=o=>Ri("files-trash-generic",{...Jn(o,{fileId:o.fileId})});return{actions:j(()=>[{name:"navigateToTrash",icon:"delete-bin",label:()=>t("Show deleted files"),handler:({resources:o})=>{e.push(n(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!te.isProjectSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},Dx=$e({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=ii(),{currentTheme:r}=Ge.storeToRefs(n),o=j(()=>p(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function Lx(e,t,n,r,o,i){const s=ge("oc-emoji-picker");return Z(),Ie(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Bv=ze(Dx,[["render",Lx]]),Mx=()=>{const e=vt(),{showMessage:t,showErrorMessage:n}=it(),{$gettext:r}=xe.useGettext(),o=Je(),i=cn(),s=lt(),{createDefaultMetaFolder:a}=Di(),{dispatchModal:l}=bt(),{getDefaultMetaFolder:u}=oi(),c=jt(),f=({resources:m})=>{m.length===1&&l({elementClass:"oc-width-auto",title:r("Set icon for %{space}",{space:m[0].name}),hideConfirmButton:!0,customComponent:Bv,focusTrapInitial:!1,onConfirm:T=>y(m[0],T)})},d=async m=>{const T=document.createElement("canvas"),v=T.getContext("2d"),g=16/9,h=720,b=h/g;T.width=h,T.height=b;const S=.4*h;v.font=`${S}px sans-serif`,v.textBaseline="middle",v.textAlign="center",v.fillText(m,T.width/2,T.height/2+15);const _=await Rb(T);return Ab(_)},y=async(m,T)=>{const v=o.graphAuthenticated,g=await d(T);let h=await u(m);return h||(h=await a(m)),i.addTask(async()=>{const b={"Content-Type":"application/offset+octet-stream"};try{const{fileId:S}=await o.webdav.putFileContents(m,{parentFolderId:h.id,fileName:"emoji.png",content:g,headers:b,overwrite:!0}),E=await v.drives.updateDrive(m.id,{name:m.name,special:[{specialFolder:{name:"image"},id:S}]},c.graphRoles);s.updateSpaceField({id:m.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Ye.publish("app.files.spaces.uploaded-image",E)}catch(S){console.error(S),n({title:r("Failed to set space icon"),errors:[S]})}})};return{actions:j(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:f,label:()=>r("Set icon"),isVisible:({resources:m})=>m.length!==1?!1:m[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:y}},Bx=()=>{const{$gettext:e}=xe.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Ye.publish(yt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},jx=()=>{const{getMatchingSpace:e}=ln(),t=lt(),n=Zn(),r=Xe(),o=Je(),{$gettext:i}=xe.useGettext(),{openEditor:s}=zn(),{resources:a,currentFolder:l}=Ge.storeToRefs(r);return{openEmptyEditor:async(c,f)=>{var h;let d=p(l)?e(p(l)):null,y=p(a),w=(h=p(l))==null?void 0:h.path;(!d||!p(l).canCreate())&&(d=t.personalSpace,y=(await o.webdav.listFiles(d)).children,w="");let m=i("New file")+`.${f}`;y.some(b=>b.name===m)&&(m=qn(m,f,y));const T=await o.webdav.putFileContents(d,{path:te.urlJoin(w,m)}),v=e(T),g=n.fileExtensions.find(({app:b,extension:S})=>b===c&&S===f);s(g,v,T)}}},jv=()=>{const{$gettext:e}=xe.useGettext(),{showMessage:t}=it();return{openUrl:(r,o,i)=>{const s=window.open(r,o);s?i&&s.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},Ux=()=>mr("$appProviderService"),qx=()=>{const{isResourceAccessible:e}=ln();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:i,ancestorMetaData:s=le({})})=>{const a=(c="")=>c.split("/").filter(Boolean),l=a(r.path),u=a(i);return u.map((c,f)=>{const d=te.urlJoin(...u.slice(0,f+1),{leadingSlash:!0}),y=e({space:p(o),path:d});let w;return y&&(w=p(s)[d]),{id:Xt.v4(),allowContextActions:!0,text:c,...y&&{to:{path:"/"+[...l].splice(0,l.length-u.length+f+1).join("/"),query:{...ki(r.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:Xt.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Ye.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},Vx=(e="")=>{const t=le(0),n=async()=>{await jn();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,Mt(n),{y:t,refresh:n}},Nf=()=>{const e=le(!0),t=()=>{e.value=window.innerHeight>500};return Mt(()=>{t(),window.addEventListener("resize",t)}),Un(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var $f=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e))($f||{}),Df=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Df||{});const zx=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const n=document.activeElement;if(!n)return!1;let r;try{r=n==null?void 0:n.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n==null?void 0:n.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Uv=e=>{const t=le([]),n=le(0),r=a=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&zx())return;const{key:l,ctrlKey:u,metaKey:c,shiftKey:f}=a;let d=null;const y=[];c||u?(d="Control",y.push("altKey","shiftKey")):f&&(d="Shift",y.push("altKey","ctrlKey","metaKey")),!((m,T)=>T.some(v=>m[v]))(a,y)&&p(t).filter(m=>m.primary===l&&m.modifier===d).forEach(m=>{a.preventDefault(),m.callback(a)})},o=(a,l)=>{const u=Xt.v4();return t.value.push({id:u,...a,modifier:a.modifier??null,callback:l}),u},i=a=>{t.value=t.value.filter(l=>l.id!==a)},s=()=>{n.value=0};return jr.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:n,resetSelectionCursor:s}};class Tr{}Se(Tr,"perPageDefault","100"),Se(Tr,"perPageQueryName","items-per-page"),Se(Tr,"options",["20","50","100","250","500"]);function Wx(e){const t=No.useRouter(),n=No.useRoute(),r=Hx(e),o=Gx(e),i=j(()=>Math.ceil(p(e.items).length/p(o))||1),s=j(()=>{if(!p(o))return p(e.items);const a=(p(r)-1)*p(o),l=a+p(o);return p(e.items).slice(a,l)});return Ye.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:l,topbarElement:u})=>{const c=Tt.findIndex(p(e.items),f=>f.id===a);if(c>=0){const f=Math.ceil((c+1)/Number(p(o)));t.push({...p(n),query:{...p(n).query,page:f}}).then(()=>{Ye.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:l,topbarElement:u})})}}),{items:s,total:i,page:r,perPage:o}}function Hx(e){if(e.page)return j(()=>p(e.page));const t=rn("page","1");return j(()=>parseInt(Et(p(t))))}function Gx(e){if(e.perPage)return j(()=>p(e.perPage));const t=wr({name:e.perPageQueryName||Tr.perPageQueryName,defaultValue:e.perPageDefault||Tr.perPageDefault,storagePrefix:e.perPageStoragePrefix});return j(()=>parseInt(Et(p(t))))}const qv=()=>mr("$passwordPolicyService");var la=(e=>(e.mounted="portal-target.mounted",e))(la||{});const Kx=()=>{const e=Ro(),t=ga.useWormhole();return{registerPortal:r=>{e.subscribe(la.mounted,()=>{t.open(r)})}}},Lf=()=>{const e=Zn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},Vv=()=>{const e=vt();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||te.isSpaceResource(r)||te.isTrashResource(r)?!1:n==null?void 0:n.canListVersions({user:e.user})}},zv=()=>{const e=Je(),t=lt(),n=jt(),r=j(()=>t.spaces),o=l=>p(r).find(u=>l.toString().startsWith(u.id.toString())),i=l=>p(r).find(u=>{var c,f;return te.isMountPointSpaceResource(u)&&((f=(c=u.root)==null?void 0:c.remoteItem)==null?void 0:f.id)===l}),s=l=>{const u=[Ue.FileId,Ue.FileParent,Ue.Name,Ue.ResourceType],c=te.buildSpace({id:l,name:""},n.graphRoles);return e.webdav.getFileInfo(c,{fileId:l},{davProperties:u})};return{getResourceContext:async l=>{var m,T,v,g,h;let u,c,f=o(l);if(f)return u=await e.webdav.getPathForFileId(l),c=await e.webdav.getFileInfo(f,{path:u}),{space:f,resource:c,path:u};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(l);c=await s(l);const y=d?[]:[p(c).name];let w=p(c);for(;!d;)w=await s(w.parentFolderId),d=i(w.id),d||y.unshift(w.name);return f=t.getSpace((T=(m=d.root)==null?void 0:m.remoteItem)==null?void 0:T.id)||t.createShareSpace({driveAliasPrefix:(v=c.storageId)!=null&&v.startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share",id:(h=(g=d.root)==null?void 0:g.remoteItem)==null?void 0:h.id,shareName:d.name}),u=te.urlJoin(...y),{space:f,resource:c,path:u}}}},Kt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},Wv=()=>{const e=i=>{if(!i.endsWith("rem")&&!i.endsWith("px"))return 0;if(i.endsWith("rem")){const s=parseInt(i.replace("rem","").trim()),a=parseFloat(getComputedStyle(document.documentElement).fontSize);return s*a}return parseInt(i.replace("px","").trim())},t=le(0),n=le(0);Mt(()=>{const i=getComputedStyle(document.documentElement);t.value=e(i.getPropertyValue("--oc-size-tiles-default")),n.value=e(i.getPropertyValue("--oc-size-tiles-resize-step"))});const r=i=>p(t)+(i-1)*p(n);return{calculateTileSizePixels:r,calculateTileSizeRem:i=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return r(i)/s}}};function Qx(e){if(e)return j(()=>p(e));const t=wr({name:Kt.queryName,defaultValue:Kt.defaultModeName});return j(()=>Et(p(t)))}function Xx(e){if(e)return j(()=>parseInt(p(e)));const t=wr({name:Kt.tilesSizeQueryName,defaultValue:Kt.tilesSizeDefault.toString()});return j(()=>parseInt(Et(p(t))))}const Yx=le(Kt.tilesSizeMax);function Mf(){return Yx}const Bf=e=>{const t=_f(),{updateResourceField:n}=Xe(),{httpAuthenticated:r}=Je(),o=lt(),{defaultSpaceImageBlobURL:i}=Ge.storeToRefs(o),s=at(),{serverUrl:a}=Ge.storeToRefs(s),l=new Br({concurrency:4}),u=j(()=>p(e)===Kt.name.tiles),c=j(()=>p(u)?Bs.enum.fit:Bs.enum.thumbnail),f=j(()=>p(u)?Wn.Tile:Wn.Thumbnail),d=un.useTask(function*(T,{space:v,resource:g,dimensions:h,processor:b,updateStore:S=!0}){var A;const E=te.isProjectSpaceResource(g)?te.buildSpaceImageResource(g):g,_=E.id===((A=v.spaceImageData)==null?void 0:A.id);_&&o.addToImagesLoading(v.id);const R=yield l.add(()=>t.loadPreview({space:v,resource:E,processor:b||p(c),dimensions:h||p(f)},!0,!0,T));return R&&S&&n({id:g.id,field:"thumbnail",value:R}),_&&o.removeFromImagesLoading(v.id),R}),y=async T=>{const{resource:v,cancelRunning:g}=T;if(g&&m(),te.isProjectSpaceResource(v)&&(!v.spaceImageData||v.disabled)){if(p(i))return v.thumbnail=p(i),p(i);try{const h=await r.get(`${p(a)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(h.data)),v.thumbnail=p(i),p(i)}catch{return null}}try{return await d.perform(T)}catch(h){h!=="cancel"&&console.error(h)}},w=j(()=>d.isRunning),m=()=>{d.cancelAll(),l.clear(),o.purgeImagesLoading()};return ja(m),{loadPreview:y,previewsLoading:w}},Hv=({showSizeInformation:e=!0}={})=>{const t=Xe(),{current:n,$gettext:r,$ngettext:o}=xe.useGettext(),i=We(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:l,currentFolder:u}=Ge.storeToRefs(t),c=j(()=>{var d,y;if(!((d=p(u))!=null&&d.size)||((y=p(u))==null?void 0:y.size)==="0"){const w=p(s).map(m=>m.size?parseInt(m.size.toString()):0).reduce((m,T)=>m+T,0);return Sn(w,n)}return Sn(p(u).size,n)});return{resourceContentsText:j(()=>{let d=o("%{ filesCount } file","%{ filesCount } files",p(a).files,{filesCount:p(a).files.toString()});!p(l)&&p(a).hiddenFiles&&(d=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",p(a).files,{filesCount:p(a).files.toString(),filesHiddenCount:p(a).hiddenFiles.toString()}));let y=o("%{ foldersCount } folder","%{ foldersCount } folders",p(a).folders,{foldersCount:p(a).folders.toString()});!p(l)&&p(a).hiddenFolders&&(y=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",p(a).folders,{foldersCount:p(a).folders.toString(),foldersHiddenCount:p(a).hiddenFolders.toString()}));const w=o("%{ spacesCount } space","%{ spacesCount } spaces",p(a).spaces,{spacesCount:p(a).spaces.toString()}),m=p(a).files+p(a).folders+p(a).spaces,T=e&&parseFloat(p(c))>0,v=Nt(i,"files-shares-via-link"),g=r(T?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),h=r(T?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),b=v?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${b}`,E=`${h} ${b}`;return o(S,E,m,{itemsCount:m.toString(),itemSize:p(c),filesStr:d,foldersStr:y,spacesStr:w})})}},jf=()=>{const{getMatchingSpace:e}=ln(),t=Xe(),n=j({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=j({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>p(r).includes(s.id),i=j(()=>{if(p(n).length!==1)return null;const s=p(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:i}};function Jx(e){const t=nn(),n=Yr(),r=Je(),o=xe.useGettext(),i=j(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+yr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=Xt.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=r.initiatorId,u},a=j(()=>{const u={onBeforeRequest:(c,f)=>new Promise(d=>{var w;const y=s();c.setHeader("Authorization",y.Authorization),c.setHeader("X-Request-ID",y["X-Request-ID"]),c.setHeader("Accept-Language",y["Accept-Language"]),c.setHeader("Initiator-ID",y["Initiator-ID"]),f!=null&&f.isRemote&&c.setHeader("x-oc-mtime",(((w=f==null?void 0:f.data)==null?void 0:w.lastModified)/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=c=>{var f;if(c.xhrUpload||c!=null&&c.isRemote)return{"x-oc-mtime":(((f=c==null?void 0:c.data)==null?void 0:f.lastModified)/1e3).toFixed(0),...s()}},u}),l=j(()=>({timeout:6e4,endpoint:"",headers:u=>{var c;return{"x-oc-mtime":(((c=u==null?void 0:u.data)==null?void 0:c.lastModified)/1e3).toFixed(0),...s()}}}));wt([a,l],()=>{if(p(i)){e.uppyService.useTus(p(a));return}e.uppyService.useXhr(p(l))},{immediate:!0})}const Zx=$e({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const{$gettext:t}=xe.useGettext(),n=at(),{options:r}=Ge.storeToRefs(n),o=j(()=>Object.hasOwn(e.action,"route")?"router-link":Object.hasOwn(e.action,"href")?"a":(Object.hasOwn(e.action,"handler")||console.warn("ActionMenuItem: No handler, route or href callback found in action",e.action),"button")),i=j(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...p(o)==="router-link"&&{to:e.action.route(e.actionOptions)},...p(o)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(p(o))&&{target:r.value.cernFeatures?"_blank":"_self"}})),s=j(()=>window.navigator.platform.match("Mac")),a=j(()=>t("Hold %{key} and click to open in new tab",{key:p(s)?"⌘":t("ctrl")},!0));return{componentType:o,componentProps:i,openInNewTabHint:a}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),ek={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},tk=["textContent"],nk=["textContent"],rk=["textContent"];function ik(e,t,n,r,o,i){var c,f,d,y;const s=ge("oc-image"),a=ge("oc-icon"),l=ge("oc-button"),u=sn("oc-tooltip");return ot((Z(),me("li",null,[ot((Z(),Ie(l,zt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","oc-py-s","oc-px-m","oc-width-1-1",...e.buttonClasses],"aria-label":e.componentProps.disabled?(f=(c=e.action).disabledTooltip)==null?void 0:f.call(c,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},qa(e.componentListeners)),{default:Ee(()=>[e.action.img?(Z(),Ie(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(Z(),Ie(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(Z(),Ie(a,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):Fe("",!0),e.action.hideLabel?Fe("",!0):(Z(),me("span",ek,[pe("span",{textContent:W.toDisplayString(e.action.label(e.actionOptions))},null,8,tk),e.action.showOpenInNewTabHint?(Z(),me("span",{key:0,class:"oc-text-muted oc-text-xsmall",textContent:W.toDisplayString(e.openInNewTabHint)},null,8,nk)):Fe("",!0)])),e.action.shortcut&&e.shortcutHint?(Z(),me("span",{key:4,class:"oc-files-context-action-shortcut",textContent:W.toDisplayString(e.action.shortcut)},null,8,rk)):Fe("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(y=(d=e.action).disabledTooltip)==null?void 0:y.call(d,e.actionOptions):""]])}const Uf=ze(Zx,[["render",ik]]),ok=$e({name:"BatchActions",components:{ActionMenuItem:Uf},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function sk(e,t,n,r,o,i){const s=ge("action-menu-item"),a=ge("oc-list");return Z(),me("div",null,[he(a,{id:"oc-appbar-batch-actions",class:W.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.actions,(l,u)=>(Z(),Ie(s,{key:`action-${u}`,action:l,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions oc-mr-s","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const Gv=ze(ok,[["render",sk]]),ak=$e({name:"ContextActionMenu",components:{ActionMenuItem:Uf},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("oc-pb-s"),e>0&&t.push("oc-pt-s"),e<this.menuSections.length-1&&t.push("oc-files-context-actions-border")),t}}}),lk={id:"oc-files-context-menu"};function ck(e,t,n,r,o,i){const s=ge("action-menu-item"),a=ge("oc-list");return Z(),me("div",lk,[(Z(!0),me(Qe,null,Ft(e.menuSections,(l,u)=>(Z(),Ie(a,{id:`oc-files-context-actions-${l.name}`,key:`section-${l.name}-list`,class:W.normalizeClass(["oc-files-context-actions",e.getSectionClasses(u)])},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(l.items,(c,f)=>(Z(),Ie(s,{key:`section-${l.name}-action-${f}`,action:c,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128))]),_:2},1032,["id","class"]))),128))])}const qf=ze(ak,[["render",ck]]),uk=$e({name:"ContextActions",components:{ContextActionMenu:qf},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t}=zn(),{actions:n}=Xs(),{actions:r}=Ys(),{actions:o}=Js(),{actions:i}=Ef(),{actions:s}=Zs(),{actions:a}=ea(),{actions:l}=ta(),{actions:u}=_o(),{actions:c}=Af(),{actions:f}=Tf(),{actions:d}=na(),{actions:y}=Rf(),{actions:w}=gv(),{actions:m}=ra(),{actions:T}=ia(),{actions:v}=mv(),{actions:g}=If(),{actions:h}=Pf(),{actions:b}=Cf(),S=Ni(),E=j(()=>S.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),_=j(()=>S.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(J=>J.action)),R=Rw(e,"actionOptions"),A=j(()=>[...p(n),...p(s),...p(l),...p(d),...p(o),...p(f),...p(a),...p(T),...p(h),...p(_).filter(J=>J.category==="actions"||Tt.isNil(J.category))].filter(J=>J.isVisible(p(R)))),$=j(()=>[...p(g),...p(_).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(p(R)))),L=j(()=>[...p(t),...p(E).filter(J=>J.category==="context")].filter(J=>J.isVisible(p(R))).sort((J,ae)=>Number(ae.hasPriority)-Number(J.hasPriority))),k=j(()=>[...p(b),...p(i),...p(E).filter(J=>J.category==="share")].filter(J=>J.isVisible(p(R)))),N=j(()=>[...p(l),...p(u),...p(a),...p(d),...p(o),...p(w),...p(m),...p(h),...p(T),...p(n),...p(s),...p(r),...p(v),...p(E).filter(J=>J.category==="actions"||Tt.isNil(J.category))].filter(J=>J.isVisible(p(R)))),z=j(()=>[...p(c).map(J=>(J.keepOpen=!0,J)),...p(y),...p(g),...p(E).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(p(R))));return{menuSections:j(()=>{const J=[];return p(R).resources.length>1?(p(A).length&&J.push({name:"batch-actions",items:[...p(A)]}),J.push({name:"batch-details",items:[...p($)]}),J):(p(L).length&&J.push({name:"context",items:p(L)}),p(k).length&&J.push({name:"share",items:p(k)}),p(N).length&&J.push({name:"actions",items:p(N)}),p(z).length&&J.push({name:"sidebar",items:p(z)}),J)})}}});function fk(e,t,n,r,o,i){const s=ge("context-action-menu");return Z(),Ie(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const Kv=ze(uk,[["render",fk]]),dk=$e({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Tr.options},perPageQueryName:{type:String,default:()=>Tr.perPageQueryName},perPageDefault:{type:String,default:()=>Tr.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Kt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=We(),n=Jt(),{$gettext:r}=xe.useGettext(),o=Xe(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a}=o,{areHiddenFilesShown:l,areFileExtensionsShown:u,areDisabledSpacesShown:c}=Ge.storeToRefs(o),f=le(!1),d=rn("page"),y=j(()=>p(d)?parseInt(Et(p(d))):1),w=wr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),m=Ws(),T=wr({name:`${p(m)}-${Kt.queryName}`,defaultValue:e.viewModeDefault}),v=wr({name:Kt.tilesSizeQueryName,defaultValue:Kt.tilesSizeDefault.toString()}),g=S=>t.replace({query:{...p(n).query,[e.perPageQueryName]:S,...p(y)>1&&{page:"1"}}}),h=S=>{T.value=S.name};wt([w,T,v],S=>{f.value=S.some(E=>!E)},{immediate:!0,deep:!0});const b=Mf();return{FolderViewModeConstants:Kt,viewModeCurrent:T,viewSizeCurrent:v,viewSizeMax:b,itemsPerPageCurrent:w,queryParamsLoading:f,queryItemAsString:Et,setItemsPerPage:g,setViewMode:h,areHiddenFilesShown:l,areFileExtensionsShown:u,areDisabledSpacesShown:c,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,viewOptionsButtonLabel:r("Display customization options of the files list"),isProjectsLocation:Sr(ft,"files-spaces-projects")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}},disabledSpacesShownModel:{get(){return this.areDisabledSpacesShown},set(e){this.setAreDisabledSpacesShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e},updateDisabledSpacesShownModel(e){this.disabledSpacesShownModel=e}}}),pk={class:"oc-flex oc-flex-middle"},hk={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},gk={key:0,class:"files-view-options-list-item"},mk={key:1,class:"files-view-options-list-item"},yk={key:2,class:"files-view-options-list-item"},bk={key:3,class:"files-view-options-list-item"},vk={key:4,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},wk=["textContent"],Sk=["max"];function Ek(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=ge("oc-switch"),u=ge("oc-page-size"),c=ge("oc-list"),f=ge("oc-drop"),d=sn("oc-tooltip");return Z(),me("div",pk,[e.viewModes.length>1?(Z(),me("div",hk,[(Z(!0),me(Qe,null,Ft(e.viewModes,y=>ot((Z(),Ie(a,{key:y.name,"no-hover":e.viewModeCurrent===y.name,class:W.normalizeClass([y.name]),appearance:e.viewModeCurrent===y.name?"filled":"outline","color-role":e.viewModeCurrent===y.name?"secondaryContainer":"secondary","aria-label":e.$gettext(y.label),onClick:w=>e.setViewMode(y)},{default:Ee(()=>[he(s,{name:y.icon.name,"fill-type":y.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[d,e.$gettext(y.label)]])),128))])):Fe("",!0),ot((Z(),Ie(a,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"oc-my-s oc-p-xs"},{default:Ee(()=>[he(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[d,e.viewOptionsButtonLabel]]),he(f,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Ee(()=>[he(c,null,{default:Ee(()=>[e.hasHiddenFiles?(Z(),me("li",gk,[he(l,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=y=>e.hiddenFilesShownModel=y),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):Fe("",!0),e.hasFileExtensions?(Z(),me("li",mk,[he(l,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=y=>e.fileExtensionsShownModel=y),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):Fe("",!0),e.hasPagination?(Z(),me("li",yk,[e.queryParamsLoading?Fe("",!0):(Z(),Ie(u,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):Fe("",!0),e.isProjectsLocation?(Z(),me("li",bk,[he(l,{checked:e.disabledSpacesShownModel,"onUpdate:checked":[t[2]||(t[2]=y=>e.disabledSpacesShownModel=y),e.updateDisabledSpacesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show disabled Spaces")},null,8,["checked","label","onUpdate:checked"])])):Fe("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(Z(),me("li",vk,[pe("label",{for:"tiles-size-slider",textContent:W.toDisplayString(e.$gettext("Tile size"))},null,8,wk),ot(pe("input",{id:"tiles-size-slider","onUpdate:modelValue":t[3]||(t[3]=y=>e.viewSizeCurrent=y),type:"range",min:1,max:e.viewSizeMax,class:"oc-range","data-testid":"files-tiles-size-slider"},null,8,Sk),[[xS,e.viewSizeCurrent]])])):Fe("",!0)]),_:1})]),_:1})])}const Qv=ze(dk,[["render",Ek],["__scopeId","data-v-cc70f12f"]]),Tk=$e({name:"AppBar",components:{BatchActions:Gv,ContextActions:Kv,ViewOptions:Qv},props:{viewModeDefault:{type:String,required:!1,default:()=>Kt.name.table},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},isSideBarOpen:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=lt(),{$gettext:r}=xe.useGettext(),{can:o}=pn(),i=We(),{requestExtensions:s}=Ni(),{isSticky:a}=Nf(),l=Xe(),{selectedResources:u}=Ge.storeToRefs(l),c=j(()=>e.space),{actions:f}=Xs(),{actions:d}=Ys(),{actions:y}=Js(),{actions:w}=xv(),{actions:m}=Zs(),{actions:T}=ea(),{actions:v}=ta(),{actions:g}=_o(),{actions:h}=Tf(),{actions:b}=na(),{actions:S}=ia(),{actions:E}=Fv(),{actions:_}=Ov(),{actions:R}=$v(),{actions:A}=Mv(),$=le(0),L=Sr(At,"files-common-search"),k=j(()=>Object.hasOwn(sS(),"navigation")&&o("create-all","Share")),N=j(()=>{let ie=[...p(d),...p(f),...p(m),...p(v),...p(g),...p(b),...p(y),...p(h),...p(T),...p(S)];L.value||(ie=[...ie,...p(w),...p(R),...p(A),...p(E),...p(_)]);const ce=s({id:"global.files.batch-actions",extensionType:"action"});return ce.length&&(ie=[...ie,...ce.map(Ce=>Ce.action)]),ie.filter(Ce=>Ce.isVisible({space:p(c),resources:l.selectedResources}))}),z=j(()=>n.spaces.filter(ie=>te.isPersonalSpaceResource(ie)||te.isProjectSpaceResource(ie))),Q=dr("isMobileWidth"),J=Sr(_n,"files-trash-generic"),ae=j(()=>!p(Q)&&e.breadcrumbs.length?!0:p(J)&&p(z).length===1?!1:e.breadcrumbs.length>1),re=j(()=>p(J)&&p(z).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),se=j(()=>p(c)&&(te.isProjectSpaceResource(p(c))||te.isShareSpaceResource(p(c)))?3:2),ue=ie=>{t(Cb,ie)},we=Zb("title"),ee=j(()=>{var ie;return p(we)?r(p(we)):((ie=p(c))==null?void 0:ie.name)||""});return{router:i,hasSharesNavigation:k,batchActions:N,showBreadcrumb:ae,showMobileNav:re,breadcrumbMaxWidth:$,breadcrumbTruncationOffset:se,fileDroppedBreadcrumb:ue,pageTitle:ee,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return nd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||_n(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){var o,i,s,a;const e=((o=document.getElementById("web-content-main"))==null?void 0:o.getBoundingClientRect().width)||0,t=((i=document.getElementById("web-nav-sidebar"))==null?void 0:i.getBoundingClientRect().width)||0,n=((s=document.getElementById("app-sidebar"))==null?void 0:s.getBoundingClientRect().width)||0,r=(a=document.getElementById("files-app-bar-controls-right"))==null?void 0:a.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),Ak={class:"files-topbar oc-py-s"},Rk=["textContent"],_k={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},Ik={class:"files-app-bar-actions oc-mt-xs"},Ck={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"};function Pk(e,t,n,r,o,i){const s=ge("oc-hidden-announcer"),a=ge("context-actions"),l=ge("oc-breadcrumb"),u=ge("portal-target"),c=ge("view-options"),f=ge("batch-actions");return Z(),me("div",{id:"files-app-bar",ref:"filesAppBar",class:W.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[pe("div",Ak,[pe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,Rk),he(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),pe("div",{class:W.normalizeClass(["oc-flex oc-flex-middle files-app-bar-controls",{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(Z(),Ie(l,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Ee(()=>[he(a,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","onItemDroppedBreadcrumb"])):Fe("",!0),e.showMobileNav?(Z(),Ie(u,{key:1,name:"app.runtime.mobile.nav"})):Fe("",!0),e.hasSharesNavigation?Ke(e.$slots,"navigation",{key:2},void 0,!0):Fe("",!0),e.hasViewOptions?(Z(),me("div",_k,[he(c,{"view-modes":e.viewModes,"has-hidden-files":e.hasHiddenFiles,"has-file-extensions":e.hasFileExtensions,"has-pagination":e.hasPagination,"per-page-storage-prefix":"files","view-mode-default":e.viewModeDefault},null,8,["view-modes","has-hidden-files","has-file-extensions","has-pagination","view-mode-default"])])):Fe("",!0)],2),pe("div",Ik,[pe("div",Ck,[Ke(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions?(Z(),Ie(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):Fe("",!0)])]),Ke(e.$slots,"content",{},void 0,!0)])],2)}const Fk=ze(Tk,[["render",Pk],["__scopeId","data-v-d27aef7c"]]),Ok=$e({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=it(),{$gettext:o}=xe.useGettext(),{createSpace:i}=Di(),{checkSpaceNameModalInput:s}=oi(),{dispatchModal:a}=bt(),l=lt(),{upsertResource:u}=Xe(),c=async d=>{try{const y=await i(d);u(y),l.upsertSpace(y),t("spaceCreated",y),n({title:o("Space was created successfully")})}catch(y){console.error(y),r({title:o("Creating space failed…"),errors:[y]})}};return{showCreateSpaceModal:()=>{a({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),onConfirm:d=>c(d),onInput:s})}}}}),xk=["textContent"];function kk(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=sn("oc-tooltip");return ot((Z(),Ie(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Ee(()=>[he(s,{name:"add"}),e.showLabel?(Z(),me("span",{key:0,textContent:W.toDisplayString(e.$gettext("New Space"))},null,8,xk)):Fe("",!0)]),_:1},8,["aria-label","onClick"])),[[l,e.showLabel?void 0:e.$gettext("New space")]])}const Nk=ze(Ok,[["render",kk]]),$k=$e({name:"AppTopBar",components:{ContextActionMenu:qf,ResourceListItem:Co},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:n}=xe.useGettext(),r=Xe(),o=at(),{getMatchingSpace:i}=ln(),s=j(()=>r.areFileExtensionsShown),a=j(()=>t("Show context menu")),l=j(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=j(()=>{const d=Dt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:d.toHuman()})}),c=j(()=>i(e.resource)),f=j(()=>!te.isPublicSpaceResource(p(c)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:l,autoSaveTooltipText:u,isPathDisplayed:f,...si()}}}),Dk={class:"oc-app-top-bar oc-flex"},Lk={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},Mk={class:"open-file-bar oc-flex"},Bk={class:"oc-flex main-actions"},jk={key:1,class:"oc-flex oc-flex-middle"};function Uk(e,t,n,r,o,i){const s=ge("resource-list-item"),a=ge("oc-icon"),l=ge("oc-button"),u=ge("context-action-menu"),c=ge("oc-drop"),f=ge("portal"),d=sn("oc-tooltip");return Z(),Ie(f,{to:"app.runtime.header.left"},{default:Ee(()=>[pe("div",Dk,[pe("span",Lk,[pe("div",Mk,[e.resource?(Z(),Ie(s,{key:0,id:"app-top-bar-resource","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):Fe("",!0)]),pe("div",Bk,[e.dropDownMenuSections.length?(Z(),me(Qe,{key:0},[ot((Z(),Ie(l,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Ee(()=>[he(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[d,e.contextMenuLabel]]),he(c,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=An(()=>{},["stop","prevent"]))},{default:Ee(()=>[he(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):Fe("",!0),e.hasAutosave?(Z(),me("span",jk,[ot(he(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[d,e.autoSaveTooltipText]])])):Fe("",!0),e.mainActions.length&&e.resource?(Z(),Ie(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(y=>y.isVisible()).map(y=>({...y,class:"oc-p-xs app-topbar-action",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):Fe("",!0),he(l,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs","aria-label":e.$gettext("Close"),onClick:t[1]||(t[1]=y=>e.$emit("close"))},{default:Ee(()=>[he(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const Xv=ze($k,[["render",Uk]]),qk=$e({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),Vk={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},zk={key:0,class:"oc-text-xlarge"};function Wk(e,t,n,r,o,i){const s=ge("oc-icon");return Z(),me("div",Vk,[he(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(Z(),me("p",zk,W.toDisplayString(e.message),1)):Fe("",!0)])}const Hk=ze(qk,[["render",Wk]]),Gk=$e({name:"LoadingScreen"}),Kk={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},Qk={class:"oc-invisible"};function Xk(e,t,n,r,o,i){const s=ge("oc-spinner"),a=sn("translate");return Z(),me("div",Kk,[he(s,{size:"xlarge"}),ot((Z(),me("p",Qk,t[0]||(t[0]=[Vt("Loading app")]))),[[a]])])}const Yk=ze(Gk,[["render",Xk]]),Jk=["id","data-testid","tabindex","inert"],Zk={key:0,class:"sidebar-panel__header header"},eN={class:"header__title oc-my-rm"},tN={key:0,class:"sidebar-panel__navigation oc-mt-m"},Yv=$e({__name:"SideBar",props:{isOpen:{type:Boolean},loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,{$gettext:r}=xe.useGettext(),o=qd("appSideBar"),i=j(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&(($=A.isRoot)==null?void 0:$.call(A,e.panelContext))})),s=j(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&!(($=A.isRoot)!=null&&$.call(A,e.panelContext))})),a=j(()=>p(i).length?[p(i)[0],...p(s)]:p(s)),l=j(()=>{var $;const A=($=e.activePanel)==null?void 0:$.split("#")[0];return!A||!p(s).map(L=>L.name).includes(A)?null:A}),u=j(()=>p(l)!==null),c=j(()=>p(l)===null),f=le(null),d=A=>{f.value=A},y=j(()=>p(u)?p(l):p(i)[0].name),w=j(()=>p(i).length===1?r("Back to %{panel} panel",{panel:p(i)[0].title(e.panelContext)}):r("Back to main panels")),m=le(window.innerWidth),T=j(()=>p(m)<=580),v=j(()=>{var A,$;return($=(A=p(o))==null?void 0:A.parentElement)==null?void 0:$.querySelector("div")}),g=()=>{if(!p(v))return;const A=p(T)?"hidden":"visible";p(v).style.visibility=A},h=()=>{e.isOpen&&(m.value=window.innerWidth,g())};wt(()=>e.isOpen,async A=>{A&&(await jn(),g())},{immediate:!0});const b=A=>{n("selectPanel",A)},S=()=>{n("selectPanel",null)},E=()=>{n("close")},_=A=>{d(p(y)),b(A)},R=()=>{d(p(y)),S(),p(o).focus()};return Mt(()=>{window.addEventListener("resize",h)}),Un(()=>{window.removeEventListener("resize",h),p(v)&&(p(v).style.visibility="visible")}),(A,$)=>{const L=ge("oc-spinner"),k=ge("oc-icon"),N=ge("oc-button"),z=sn("oc-tooltip");return Z(),me("div",{id:"app-sidebar",ref_key:"appSideBar",ref:o,"data-testid":"app-sidebar",tabindex:"-1",class:W.normalizeClass({"has-active-sub-panel":u.value,"oc-flex oc-flex-center oc-flex-middle":A.loading,"app-sidebar-full-width":T.value})},[A.loading?(Z(),Ie(L,{key:0})):(Z(!0),me(Qe,{key:1},Ft(a.value,Q=>{var J,ae,re,se,ue,we;return Z(),me("div",{id:`sidebar-panel-${Q.name}`,key:`panel-${Q.name}`,"data-testid":`sidebar-panel-${Q.name}`,tabindex:y.value===Q.name?-1:null,class:W.normalizeClass(["sidebar-panel",{"is-root-panel":(J=Q.isRoot)==null?void 0:J.call(Q,A.panelContext),"is-active-sub-panel":u.value&&l.value===Q.name,"is-active-root-panel":c.value&&((ae=Q.isRoot)==null?void 0:ae.call(Q,A.panelContext))}]),inert:y.value!==Q.name},[[y.value,f.value].includes(Q.name)?(Z(),me("div",Zk,[(re=Q.isRoot)!=null&&re.call(Q,A.panelContext)?Fe("",!0):ot((Z(),Ie(N,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":w.value,onClick:R},{default:Ee(()=>[he(k,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[z,w.value]]),pe("h2",eN,W.toDisplayString(Q.title(A.panelContext)),1),he(N,{appearance:"raw",class:"header__close oc-p-xs","aria-label":p(r)("Close file sidebar"),onClick:E},{default:Ee(()=>[he(k,{name:"close"})]),_:1},8,["aria-label"])])):Fe("",!0),pe("div",null,[(se=Q.isRoot)!=null&&se.call(Q,A.panelContext)?Ke(A.$slots,"rootHeader",{key:0}):Ke(A.$slots,"subHeader",{key:1})]),pe("div",{class:W.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${Q.name}`]])},[pe("div",{class:W.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((ue=Q.isRoot)!=null&&ue.call(Q,A.panelContext))}])},[Ke(A.$slots,"body",{},()=>{var ee;return[(Z(!0),me(Qe,null,Ft((ee=Q.isRoot)!=null&&ee.call(Q,A.panelContext)?i.value:[Q],(ie,ce)=>{var Ce;return Z(),Ie(Cr(ie.component),zt({key:`sidebar-panel-${ie.name}`,class:{"multi-root-panel-separator oc-mt oc-pt-s":ce>0},ref_for:!0},((Ce=ie.componentAttrs)==null?void 0:Ce.call(ie,A.panelContext))||{}),null,16,["class"])}),128))]})],2),(we=Q.isRoot)!=null&&we.call(Q,A.panelContext)&&s.value.length>0?(Z(),me("div",tN,[(Z(!0),me(Qe,null,Ft(s.value,ee=>(Z(),Ie(N,{id:`sidebar-panel-${ee.name}-select`,key:`panel-select-${ee.name}`,"data-testid":`sidebar-panel-${ee.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:ie=>_(ee.name)},{default:Ee(()=>[he(k,{name:ee.icon,"fill-type":ee.iconFillType},null,8,["name","fill-type"]),Vt(" "+W.toDisplayString(ee.title(A.panelContext))+" ",1),he(k,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Fe("",!0)],2)],10,Jk)}),128))],2)}}}),nN=$e({name:"SpaceInfo",setup(){return{resource:dr("resource")}}}),rN={class:"space_info oc-p-s"},iN={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},oN={class:"oc-mr-s"},sN=["textContent"],aN=["textContent"];function lN(e,t,n,r,o,i){const s=ge("oc-icon");return Z(),me("div",rN,[pe("div",iN,[pe("div",oN,[he(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),pe("div",null,[pe("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:W.toDisplayString(e.resource.name)},null,8,sN),pe("span",{"data-testid":"space-info-subtitle",textContent:W.toDisplayString(e.resource.description)},null,8,aN)])])])}const Jv=ze(nN,[["render",lN]]),cN=$e({name:"FileInfo",components:{ResourceIcon:Io,ResourceName:xf},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Xe(),t=dr("resource"),n=dr("space"),r=j(()=>e.areFileExtensionsShown),o=j(()=>te.isPersonalSpaceResource(p(n))&&p(t).path==="/"?p(n).name:p(t).name);return{resource:t,resourceName:o,areFileExtensionsShown:r}}}),uN={class:"file_info oc-flex oc-flex-between oc-p-s"},fN={class:"oc-flex oc-flex-middle"},dN={class:"file_info__body oc-text-overflow"},pN={"data-testid":"files-info-name",class:"oc-font-semibold"};function hN(e,t,n,r,o,i){const s=ge("resource-icon"),a=ge("resource-name");return Z(),me("div",uN,[pe("div",fN,[e.isSubPanelActive?(Z(),Ie(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):Fe("",!0),pe("div",dN,[pe("h3",pN,[he(a,{name:e.resourceName,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])])}const Zv=ze(cN,[["render",hN]]),gN=$e({name:"FileSideBar",components:{FileInfo:Zv,SpaceInfo:Jv,InnerSideBar:Yv},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=We(),n=Je(),r=Ni(),o=Ro(),i=lt(),s=jt(),a=at(),l=Zn(),{canListShares:u}=yv(),{canListVersions:c}=Vv(),f=Xe(),{currentFolder:d}=Ge.storeToRefs(f),y=le(),w=le([]),m=le([]),T=le([]),{selectedResources:v}=jf(),g=le(!1),h=j(()=>p(g)||re.isRunning),b=j(()=>{var ue;return p(v).length===0?{root:e.space,parent:null,items:(ue=p(d))!=null&&ue.id?[p(d)]:[]}:{root:e.space,parent:p(d),items:p(v)}}),S=Sr(Nt,"files-shares-with-me"),E=Sr(Nt,"files-shares-with-others"),_=Sr(Nt,"files-shares-via-link"),R=ft(t,"files-spaces-projects"),A=Sr(At,"files-common-favorites"),$=Sr(At,"files-common-search"),L=()=>{o.publish(yt.close)},k=ue=>{o.publish(yt.setActivePanel,ue)},N=j(()=>{var ue;return((ue=p(b).items)==null?void 0:ue.length)===1&&!te.isProjectSpaceResource(p(b).items[0])}),z=j(()=>{var ue;return((ue=p(b).items)==null?void 0:ue.length)===1&&te.isProjectSpaceResource(p(b).items[0])}),Q=j(()=>p(S)||p(E)||p(_)),J=j(()=>p(Q)||p($)||p(A)),ae=j(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ue=>ue.panel)),re=un.useTask(function*(ue,we){w.value=yield n.webdav.listFileVersions(we.id,{signal:ue})}),se=un.useTask(function*(ue,we){var ke;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:ee,linkShares:ie}=s,ce=n.graphAuthenticated.permissions;let Ce=(ke=e.space)==null?void 0:ke.id;if(te.isShareSpaceResource(e==null?void 0:e.space)){const _e=yield i.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ue});_e&&(Ce=_e.root.remoteItem.rootId)}const{shares:H,allowedRoles:I}=yield*te.call(ce.listPermissions(Ce,we.fileId,s.graphRoles,{},{signal:ue})),F=H.filter(te.isCollaboratorShare),G=H.filter(te.isLinkShare),V=Object.values(s.graphRoles);if(m.value=(I==null?void 0:I.map(_e=>{var je;return{..._e,icon:(je=V.find(Y=>Y.id===_e.id))==null?void 0:je.icon}}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:_e}=yield*te.call(ce.listPermissions(Ce,we.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[lx.LibreGraphPermissionsRolesAllowedValues]},{signal:ue}));T.value=(_e==null?void 0:_e.map(je=>{var Y;return{...je,icon:(Y=V.find(Ne=>Ne.id===je.id))==null?void 0:Y.icon}}))||[]}!p(J)&&!p(R)&&(ee.forEach(_e=>{F.some(je=>je.id===_e.id)||F.push({..._e,indirect:!0})}),ie.forEach(_e=>{G.some(je=>je.id===_e.id)||G.push({..._e,indirect:!0})})),At(t,"files-common-search")&&(yield f.loadAncestorMetaData({folder:p(we),space:p(e.space),client:n.webdav,signal:ue}));const q=[...ee,...ie].map(({resourceId:_e})=>_e),fe=Object.values(f.ancestorMetaData).filter(({id:_e,path:je})=>_e===we.id||q.includes(_e)||te.isIncomingShareResource(we)?!1:te.isPersonalSpaceResource(e.space)?je!=="/":!0).map(({id:_e})=>_e);p(J)&&te.isProjectSpaceResource(e.space)&&!te.isProjectSpaceResource(we)&&fe.push(e.space.id);const Ae=new Br({concurrency:a.options.concurrentRequests.shares.list}),Le=[...new Set(fe)].map(_e=>Ae.add(()=>n.graphAuthenticated.permissions.listPermissions(Ce,_e,s.graphRoles,{},{signal:ue}).then(je=>{const Y=je.shares.map(Ne=>({...Ne,indirect:!0}));F.push(...Y.filter(te.isCollaboratorShare)),G.push(...Y.filter(te.isLinkShare))})));yield Promise.allSettled(Le),s.setCollaboratorShares(F),s.setLinkShares(G),s.setLoading(!1)}).restartable();return wt(()=>[...p(b).items,e.isOpen],async()=>{var we;if(((we=p(b).items)==null?void 0:we.length)!==1)return;if(!e.isOpen){w.value=[];return}const ue=p(b).items[0];if(re.isRunning&&re.cancelAll(),!!c({space:e.space,resource:ue}))try{await re.perform(ue)}catch(ee){console.error(ee)}},{immediate:!0,deep:!0}),wt(()=>[...p(b).items,e.isOpen],async()=>{var we;if(!e.isOpen){s.pruneShares(),y.value=null;return}if(((we=p(b).items)==null?void 0:we.length)!==1)return;const ue=p(b).items[0];if(g.value=!0,u({space:e.space,resource:ue}))try{se.isRunning&&se.cancelAll(),se.perform(ue)}catch(ee){console.error(ee)}if(!p(Q)){y.value=ue,g.value=!1;return}try{const ee=await n.webdav.getFileInfo(e.space,{path:ue.path}),ie={...ee,...ue,tags:ee.tags};y.value=ie}catch(ee){y.value=ue,console.error(ee)}g.value=!1},{deep:!0,immediate:!0}),yi("resource",lr(y)),yi("versions",lr(w)),yi("space",j(()=>e.space)),yi("activePanel",j(()=>e.activePanel)),yi("availableInternalShareRoles",lr(m)),yi("availableExternalShareRoles",lr(T)),{loadedResource:y,setActiveSideBarPanel:k,closeSideBar:L,panelContext:b,availablePanels:ae,isFileHeaderVisible:N,isSpaceHeaderVisible:z,isLoading:h,loadSharesTask:se}}});function mN(e,t,n,r,o,i){const s=ge("file-info"),a=ge("space-info"),l=ge("InnerSideBar");return e.isOpen?(Z(),Ie(l,zt({key:0,ref:"sidebar",class:"files-side-bar","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:Ee(()=>[e.isFileHeaderVisible?(Z(),Ie(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(Z(),Ie(a,{key:1,class:"sidebar-panel__space_info"})):Fe("",!0)]),subHeader:Ee(()=>[e.isFileHeaderVisible?(Z(),Ie(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(Z(),Ie(a,{key:1,class:"sidebar-panel__space_info"})):Fe("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):Fe("",!0)}const e0=ze(gN,[["render",mN]]),yN=$e({name:"DatePickerModal",props:{modal:{type:Object,required:!0},currentDate:{type:Object,required:!1,default:null},minDate:{type:Object,required:!1,default:null},isClearable:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(){const e=le(),t=le(!0);return{confirmDisabled:t,onDateChanged:({date:r,error:o})=>{t.value=o||!r,e.value=r},dateTime:e}}}),bN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function vN(e,t,n,r,o,i){const s=ge("oc-datepicker"),a=ge("oc-button");return Z(),me(Qe,null,[he(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),pe("div",bN,[he(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),he(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm",e.dateTime))},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const wN=ze(yN,[["render",vN]]),SN=$e({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=bt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),EN=["textContent"],TN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},AN={class:"oc-modal-body-actions-grid"};function RN(e,t,n,r,o,i){const s=ge("oc-button");return Z(),me(Qe,null,[pe("span",{class:"oc-display-inline-block oc-mb-m",textContent:W.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,EN),t[2]||(t[2]=pe("div",{class:"oc-my-m"},null,-1)),pe("div",TN,[pe("div",AN,[he(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),he(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),he(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const t0=ze(SN,[["render",RN]]);var _N=/\s/;function IN(e){for(var t=e.length;t--&&_N.test(e.charAt(t)););return t}var CN=/^\s+/;function PN(e){return e&&e.slice(0,IN(e)+1).replace(CN,"")}var n0=NaN,FN=/^[-+]0x[0-9a-f]+$/i,ON=/^0b[01]+$/i,xN=/^0o[0-7]+$/i,kN=parseInt;function NN(e){if(typeof e=="number")return e;if(gs(e))return n0;if(Qn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=PN(e);var n=ON.test(e);return n||xN.test(e)?kN(e.slice(2),n?2:8):FN.test(e)?n0:+e}const $N=$e({name:"AppWrapper",components:{AppTopBar:Xv,FileSideBar:e0,ErrorScreen:Hk,LoadingScreen:Yk},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=xe.useGettext(),r=Zn(),{showMessage:o,showErrorMessage:i}=it(),s=No.useRouter(),a=Jt(),l=Je(),u=cn(),{getResourceContext:c}=zv(),{selectedResources:f}=jf(),{dispatchModal:d}=bt(),y=lt(),w=at(),m=Xe(),T=jt(),{actions:v}=Iv({appId:e.applicationId}),{actions:g}=Ef(),{actions:h}=_o(),{actions:b}=If(),{actions:S}=Cf(),E=j(()=>{var Pe;return!!((Pe=e.wrappedComponent.emits)!=null&&Pe.includes("update:resource"))}),_=le(),R=le(),A=le(""),$=le(""),L=le(!p(E)),k=le(),N=le(!1),z=le(),Q=le(),{actions:J}=Pv({content:Q}),ae=j(()=>{var Pe;return!!((Pe=e.wrappedComponent.emits)!=null&&Pe.includes("update:currentContent"))}),re=Pe=>!!Object.keys(e.wrappedComponent.props).includes(Pe),se=j(()=>p(Q)!==p(z)),ue=Pe=>{Pe.preventDefault()};wt(se,Pe=>{Pe?window.addEventListener("beforeunload",ue):window.removeEventListener("beforeunload",ue)});const{applicationConfig:we,closeApp:ee,currentFileContext:ie,getFileContents:ce,getFileInfo:Ce,getUrlForResource:H,putFileContents:I,replaceInvalidFileRoute:F,revokeUrl:G,activeFiles:V,loadFolderForFileContext:M,isFolderLoading:q}=lv({applicationId:e.applicationId}),{applicationMeta:fe}=wf({applicationId:e.applicationId,appsStore:r}),Ae=j(()=>{var Pe;return(Pe=p(fe).meta)==null?void 0:Pe.fileSizeLimit}),Le=j(()=>{const{name:Pe}=p(fe);return t("%{appName} for %{fileName}",{appName:t(Pe),fileName:p(p(ie).fileName)})}),ke=Hs("driveAliasAndItem"),_e=rn("fileId"),je=j(()=>Et(p(_e))),Y=async()=>{const Pe=p(je),{space:De,path:Ve}=await c(Pe),vn=De.getDriveAliasAndItem({path:Ve});return te.isPersonalSpaceResource(De)?s.push({params:{...p(a).params,driveAliasAndItem:vn},query:{...p(a).query,fileId:Pe,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:gt.dirname(vn)}}}):s.push({params:{...p(a).params,driveAliasAndItem:vn},query:{...p(a).query,fileId:Pe,contextRouteName:Ve==="/"?"files-shares-with-me":"files-spaces-generic",...te.isShareSpaceResource(De)&&{shareId:De.id},contextRouteParams:{driveAliasAndItem:gt.dirname(vn)},contextRouteQuery:{...te.isShareSpaceResource(De)&&{shareId:De.id}}}})},Ne=un.useTask(function*(Pe){try{p(ke)||(yield Y()),R.value=p(p(ie).space);const De=yield Ce(p(ie),{signal:Pe});if(_.value=De,te.isShareSpaceResource(p(R))&&(p(_).remoteItemId=p(R).id,p(_).id===p(_).remoteItemId)){const Ve=yield*te.call(hs({graphClient:l.graphAuthenticated,spacesStore:y,space:p(R)}));Ve&&(_.value={...De,...te.buildIncomingShareResource({graphRoles:T.graphRoles,driveItem:Ve,serverUrl:w.serverUrl}),tags:De.tags})}m.initResourceList({currentFolder:null,resources:[p(_)]}),f.value=[p(_)]}catch(De){console.error(De),k.value=De,L.value=!1}}).restartable(),Be=un.useTask(function*(Pe){try{const De=e.importResourceWithExtension(p(_));if(De){const Ve=Dt.DateTime.local().toFormat("yyyyMMddHHmmss"),vn=`${p(_).name}_${Ve}.${De}`;if(!(yield l.webdav.copyFiles(p(R),p(_),p(R),{path:vn},{signal:Pe})))throw new Error(t("Importing failed"));_.value={path:vn}}if(F(ie,p(_)))return;if(N.value=![In.Updateable,In.FileUpdateable].some(Ve=>(p(_).permissions||"").indexOf(Ve)>-1),p(re("currentContent"))){const Ve=yield*te.call(ce(ie,{...e.fileContentOptions,signal:Pe}));z.value=Q.value=Ve.body,A.value=Ve.headers["OC-ETag"]}p(re("url"))&&($.value=yield H(p(R),p(_),{...e.urlForResourceOptions,signal:Pe}))}catch(De){console.error(De),k.value=De}finally{L.value=!1}}).restartable();wt(ie,async()=>{p(E)||(await Ne.perform(),p(Ae)&&NN(p(_).size)>p(Ae)?d({title:t("File exceeds %{threshold}",{threshold:Sn(p(Ae),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:p(_).name,threshold:Sn(p(Ae),n)}),confirmText:t("Continue"),onCancel:()=>{ee()},onConfirm:()=>{Be.perform()}}):Be.perform())},{immediate:!0});const qe=Pe=>{console.error(Pe),i({title:t("An error occurred"),desc:Pe.message,errors:[Pe]})},et=()=>{o({title:t("File autosaved")})},Pt=un.useTask(function*(){const Pe=p(Q);try{const De=yield I(ie,{content:Pe,previousEntityTag:p(A)});z.value=Pe,A.value=De.etag,m.upsertResource(De)}catch(De){switch(De.statusCode){case 401:case 403:qe(new te.HttpError(t("You're not authorized to save this file"),De.response));break;case 409:case 412:qe(new te.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),De.response));break;case 507:const Ve=y.spaces.find(vn=>vn.id===p(_).storageId&&te.isProjectSpaceResource(vn));if(Ve){qe(new te.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:Ve.name}),De.response));break}qe(new te.HttpError(t("Insufficient quota for saving this file"),De.response));break;default:qe(new te.HttpError("",De.response))}}}).drop(),ct=async()=>{await Pt.perform()},en=j(()=>!e.disableAutoSave);let Me=null;Mt(()=>{var De;if((De=m.ancestorMetaData)!=null&&De["/"]&&p(R)&&m.ancestorMetaData["/"].spaceId!==p(R).id&&m.setAncestorMetaData({}),!p(ae))return;const Pe=w.options.editor;Pe.autosaveEnabled&&!e.disableAutoSave&&(Me=setInterval(async()=>{se.value&&(await ct(),et())},(Pe.autosaveInterval||120)*1e3))}),Un(()=>{u.isLoading||window.removeEventListener("beforeunload",ue),p(re("url"))&&G($.value),p(ae)&&(clearInterval(Me),Me=null)});const{bindKeyAction:He}=Uv({skipDisabledKeyBindingsCheck:!0});He({modifier:Df.Ctrl,primary:$f.S},()=>{p(se)&&ct()});const Mn=j(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>p(ae),isDisabled:()=>N.value||!se.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:ct}]),B=j(()=>({space:p(R),resources:[p(_)]})),C=async(Pe,De)=>{p(se)&&(await ct(),et()),De(Pe)},O=j(()=>[...p(v),...p(Mn),...p(J).map(Pe=>({...Pe,isVisible:De=>ae.value&&Pe.isVisible(De)}))].filter(Pe=>Pe.isVisible(p(B)))),K=j(()=>[...p(S),...p(g)].filter(Pe=>Pe.isVisible(p(B)))),ne=j(()=>[...p(h).map(Pe=>({...Pe,handler:De=>C(De,Pe.handler)}))].filter(Pe=>Pe.isVisible(p(B)))),de=j(()=>[...p(b)].filter(Pe=>Pe.isVisible(p(B)))),Te=j(()=>{const Pe=[];return p(O).length&&Pe.push({name:"context",items:p(O)}),p(K).length&&Pe.push({name:"share",items:p(K)}),p(ne).length&&Pe.push({name:"actions",items:p(ne)}),p(de).length&&Pe.push({name:"sidebar",items:p(de)}),Pe}),Ze=j(()=>[...p(Mn)]);No.onBeforeRouteLeave((Pe,De,Ve)=>{p(se)?d({title:t("Unsaved changes"),customComponent:t0,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{Ve()}}),async onConfirm(){await ct(),Ve()}}):Ve()});const ut=j(()=>({url:p($),space:p(p(ie).space),resource:p(_),activeFiles:p(V),isDirty:p(se),isReadOnly:p(N),applicationConfig:p(we),currentFileContext:p(ie),currentContent:p(Q),isFolderLoading:p(q),"onUpdate:resource":Pe=>{_.value=Pe,R.value=p(p(ie).space),f.value=[Pe]},"onUpdate:currentContent":Pe=>{Q.value=Pe},onSave:ct,onClose:ee,loadFolderForFileContext:M,revokeUrl:G,getUrlForResource:H}));return{...wb(),dropDownMenuSections:Te,dropDownActionOptions:B,hasAutoSave:en,isEditor:ae,closeApp:ee,fileActions:Ze,loading:L,loadingError:k,pageTitle:Le,resource:_,space:R,slotAttrs:ut}}}),DN=["id"],LN=["textContent"];function MN(e,t,n,r,o,i){const s=ge("app-top-bar"),a=ge("loading-screen"),l=ge("error-screen"),u=ge("file-side-bar");return Z(),me("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=Ji((...c)=>e.closeApp&&e.closeApp(...c),["esc"]))},[pe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,LN),!e.loading&&!e.loadingError&&e.resource?(Z(),Ie(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):Fe("",!0),e.loading?(Z(),Ie(a,{key:1})):e.loadingError?(Z(),Ie(l,{key:2,message:e.loadingError.message},null,8,["message"])):(Z(),me("div",{key:3,class:W.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Ke(e.$slots,"default",zt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),he(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,DN)}const r0=ze($N,[["render",MN]]);function BN(e,t){return $e({render(){return Ya(r0,{wrappedComponent:e,...t},{default:n=>Ya(e,n)})}})}const jN=$e({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)}},emits:["quickActionClicked"],setup(){const{$gettext:e}=xe.useGettext();return{contextMenuLabel:j(()=>e("Show context menu"))}}});function UN(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-drop"),l=ge("oc-button"),u=sn("oc-tooltip");return ot((Z(),Ie(l,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"aria-label":e.contextMenuLabel,appearance:"raw",class:"quick-action-button oc-ml-xs oc-p-xs",onClick:t[0]||(t[0]=An(c=>e.$emit("quickActionClicked",{event:c,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Ee(()=>[he(s,{name:"more-2"}),he(a,{ref:`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,class:"oc-overflow-hidden",position:"bottom-end",mode:"click","close-on-click":"","padding-size":"small"},{default:Ee(()=>[Ke(e.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const Vf=ze(jN,[["render",UN]]),qN=$e({name:"ResourceGhostElement",components:{ResourceIcon:Io},props:{previewItems:{type:Array,required:!0}},computed:{layerCount(){return Math.min(this.previewItems.length,3)},showSecondLayer(){return this.layerCount>1},showThirdLayer(){return this.layerCount>2},itemCount(){return this.previewItems.length}}}),VN={id:"ghost-element",class:"ghost-element"},zN={class:"ghost-element-layer1 oc-rounded"},WN={key:0,class:"ghost-element-layer2 oc-rounded"},HN={key:1,class:"ghost-element-layer3 oc-rounded"},GN={class:"badge"};function KN(e,t,n,r,o,i){const s=ge("resource-icon");return Z(),me("div",VN,[pe("div",zN,[he(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(Z(),me("div",WN)):Fe("",!0),e.showThirdLayer?(Z(),me("div",HN)):Fe("",!0)]),pe("span",GN,W.toDisplayString(e.itemCount),1)])}const zf=ze(qN,[["render",KN]]),QN=$e({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=xe.useGettext();return{formattedSize:j(()=>Sn(e.size,t))}}}),XN=["textContent"];function YN(e,t,n,r,o,i){return Z(),me("span",{class:"oc-resource-size",textContent:W.toDisplayString(e.formattedSize)},null,8,XN)}const i0=ze(QN,[["render",YN]]),Po={};function JN(e){return e.getIsPending!==void 0}function ZN(e){if(JN(e))return e;let t=!0,n=e.then(r=>(t=!1,r),r=>{throw t=!1,r});return n.getIsPending=function(){return t},n}function e$(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t}function t$(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function n$(e,t){const{class:n,style:r,...o}=e$(e),{class:i,style:s,...a}=t$(t);return{class:[n,i],style:[r,s],...o,...a}}const o0=$e({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,o=n,i=Kd(),s=le(),a=le(),l=Math.random().toString(36).substring(2);t({svgElSource:s,request:a}),wt(()=>r.src,m=>{c(m)}),c(r.src);function u(m){if(m=m.cloneNode(!0),r.uniqueIds){const T=typeof r.uniqueIds=="string"?r.uniqueIds:l;m=w(m,T,r.uniqueIdsBase)}return m=r.transformSource(m),r.title&&y(m,r.title),m.innerHTML}function c(m){Po[m]||(Po[m]=f(m)),s.value&&Po[m].getIsPending()&&!r.keepDuringLoading&&(s.value=null,o("unloaded")),Po[m].then(T=>{s.value=T,jn(()=>{o("loaded",document.querySelector("svg"))})}).catch(T=>{s.value&&(s.value=void 0,o("unloaded")),delete Po[m],o("error",T)})}function f(m){return ZN(new Promise((T,v)=>{const g=new XMLHttpRequest;g.open("GET",m,!0),a.value=g,g.onload=()=>{if(g.status>=200&&g.status<400)try{let h=new DOMParser().parseFromString(g.responseText,"text/xml").getElementsByTagName("svg")[0];h?T(h):v(new Error('Loaded file is not valid SVG"'))}catch(h){v(h)}else v(new Error("Error loading SVG"))},g.onerror=v,g.send()}))}const d=()=>s.value?Ya("svg",{...n$(s.value,i),innerHTML:u(s.value)}):null;function y(m,T){const v=m.getElementsByTagName("title");if(v.length)v[0].textContent=T;else{const g=document.createElementNS("http://www.w3.org/2000/svg","title");g.textContent=T,m.insertBefore(g,m.firstChild)}}function w(m,T,v=""){const g=["id","href","xlink:href","xlink:role","xlink:arcrole"],h=["href","xlink:href"],b=(S,E)=>h.includes(S)&&(E?!E.includes("#"):!1);return[...m.children].forEach(S=>{var E;if((E=S.attributes)!=null&&E.length){const _=Object.values(S.attributes).map(R=>{const A=/url\((.*?)\)/.exec(R.value);return A!=null&&A[1]&&(R.value=R.value.replace(A[0],`url(${v}${A[1]}_${T})`)),R});g.forEach(R=>{const A=_.find($=>$.name===R);A&&!b(R,A.value)&&(A.value=`${A.value}_${T}`)})}return S.children.length?w(S,T,v):S}),m}return(m,T)=>(Z(),Ie(d))}}),s0=$e({__name:"OcIcon",props:{accessibleLabel:{default:""},color:{default:""},fillType:{default:"fill"},name:{default:"info"},size:{default:"medium"},type:{default:"span"}},emits:["loaded"],setup(e,{emit:t}){o0.name="inline-svg";const n=t,r=j(()=>Fb("oc-icon-title-")),o=j(()=>{const l="icons/",u=e.fillType.toLowerCase();return u==="none"?`${l}${e.name}.svg`:`${l}${e.name}-${u}.svg`}),i=l=>s(xr(l)),s=l=>{if(l!==null)return`oc-icon-${l}`},a=l=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),l.insertBefore(u,l.firstChild)}return l};return(l,u)=>(Z(),Ie(Cr(l.type),{class:W.normalizeClass([{"oc-button-reset":l.type==="button"},"oc-icon",i(l.size)])},{default:Ee(()=>[he(p(o0),{src:o.value,"transform-source":a,"aria-hidden":l.accessibleLabel===""?"true":null,"aria-labelledby":l.accessibleLabel===""?null:r.value,focusable:l.accessibleLabel===""?"false":null,style:W.normalizeStyle(l.color!==""?{fill:l.color}:{}),onLoaded:u[0]||(u[0]=c=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style"])]),_:1},8,["class"]))}}),a0=$e({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},colorRole:{default:"secondary"},disabled:{type:Boolean,default:!1},gapSize:{default:"medium"},href:{},justifyContent:{default:"center"},showSpinner:{type:Boolean,default:!1},size:{default:"medium"},submit:{default:"button"},target:{},to:{},type:{default:"button"},noHover:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,r=j(()=>{const a=["oc-button","oc-rounded",`oc-button-${xr(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${xr(e.gapSize)}`,`oc-button-${Tt.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${Tt.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&a.push("no-hover"),a}),o=j(()=>({...e.href&&{href:e.href},...e.target&&{target:e.target},...e.to&&{to:e.to},...e.type==="button"&&{type:e.submit},...e.type==="button"&&{disabled:e.disabled}})),i=j(()=>({...e.type==="button"&&{click:s}})),s=a=>{n("click",a)};return(a,l)=>{const u=ge("oc-spinner");return Z(),Ie(Cr(a.type),zt(o.value,{"aria-label":a.ariaLabel,class:r.value},qa(i.value)),{default:Ee(()=>[a.showSpinner?(Z(),Ie(u,{key:0,size:"small",class:"spinner"})):Fe("",!0),Ke(a.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
|
|
53
53
|
* tabbable 6.2.0
|
|
54
54
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
@@ -60,7 +60,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
60
60
|
* focus-trap-vue v4.0.2
|
|
61
61
|
* (c) 2023 Eduardo San Martin Morote
|
|
62
62
|
* @license MIT
|
|
63
|
-
*/function V2(e){return e}const N$={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object};Object.assign({active:{type:Boolean,default:!0}},N$);var $$=Object.defineProperty,v0=Object.getOwnPropertySymbols,D$=Object.prototype.hasOwnProperty,L$=Object.prototype.propertyIsEnumerable,w0=(e,t,n)=>t in e?$$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M$=(e,t)=>{for(var n in t||(t={}))D$.call(t,n)&&w0(e,n,t[n]);if(v0)for(var n of v0(t))L$.call(t,n)&&w0(e,n,t[n]);return e};const S0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},B$={},j$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},U$=pe("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),q$=[U$];function V$(e,t){return Z(),me("svg",j$,q$)}const z$=S0(B$,[["render",V$]]),W$={},H$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},G$=pe("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),K$=[G$];function Q$(e,t){return Z(),me("svg",H$,K$)}M$({},{Deselect:z$,OpenIndicator:S0(W$,[["render",Q$]])});const X$=["aria-label"],Y$=$e({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=j(()=>["oc-spinner",`oc-spinner-${xr(e.size||"medium")}`]);return(n,r)=>(Z(),me("span",{class:W.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,X$))}}),J$={class:"oc-status-indicators oc-flex"},Z$=["id","textContent"],eD=$e({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=xe.useGettext(),n=le({}),r=i=>Object.hasOwn(i,"handler"),o=i=>i.accessibleDescription?(p(n)[i.id]||(p(n)[i.id]=Fb("oc-indicator-description-")),p(n)[i.id]):null;return(i,s)=>{const a=sn("oc-tooltip");return Z(),me("div",J$,[(Z(!0),me(Qe,null,Ft(i.indicators,(l,u)=>(Z(),me(Qe,null,[r(l)&&!i.disableHandler?ot((Z(),Ie(a0,{id:l.id,key:`${l.id}-handler`,class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),"aria-label":p(t)(l.label),"aria-describedby":o(l),appearance:"raw","data-testid":l.id,"data-test-indicator-type":l.type,"no-hover":"",onClick:c=>l.handler(i.resource)},{default:Ee(()=>[he(s0,{name:l.icon,size:"small","fill-type":l.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","onClick"])),[[a,p(t)(l.label)]]):ot((Z(),Ie(s0,{id:l.id,key:l.id,tabindex:"-1",size:"small",class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),name:l.icon,"fill-type":l.fillType,"accessible-label":p(t)(l.label),"aria-describedby":o(l),"data-testid":l.id,"data-test-indicator-type":l.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,p(t)(l.label)]]),o(l)?(Z(),me("p",{id:o(l),key:o(l),class:"oc-invisible-sr",textContent:W.toDisplayString(p(t)(l.accessibleDescription))},null,8,Z$)):Fe("",!0)],64))),256))])}}}),tD={class:"oc-thead"},nD=$e({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(Z(),me("thead",tD,[Ke(t.$slots,"default")]))}}),rD=$e({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(Z(),me("tbody",null,[Ke(t.$slots,"default")]))}}),E0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:le(!0)};const i=le(!1),s=new IntersectionObserver(a=>{const l=a.at(-1).isIntersecting;i.value=l,p(i)&&r&&r(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:n});return wt(e,()=>{s.observe(e.value)}),Un(()=>s.disconnect()),{isVisible:i}},T0=$e({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t,r=j(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(Z(),Ie(Cr(o.type),{class:W.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Ee(()=>[Ke(o.$slots,"default")]),_:3},8,["class"]))}}),A0=$e({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(Z(),Ie(T0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Ee(()=>[Ke(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),R0=$e({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Ad((a,l)=>{let u;return{get(){return a(),u},set(c){u=c,l()}}}),o=j(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?E0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},s=j(()=>!p(i));return e.lazy||n("itemVisible"),(a,l)=>(Z(),me("tr",{ref_key:"observerTarget",ref:r,onClick:l[0]||(l[0]=u=>a.$emit("click",u)),onContextmenu:l[1]||(l[1]=u=>a.$emit("contextmenu",u)),onDragstart:l[2]||(l[2]=u=>a.$emit("dragstart",u)),onDrop:l[3]||(l[3]=u=>a.$emit("drop",u)),onDragenter:l[4]||(l[4]=u=>a.$emit("dragenter",u)),onDragleave:l[5]||(l[5]=u=>a.$emit("dragleave",u)),onDragover:l[6]||(l[6]=u=>a.$emit("dragover",u)),onMouseleave:l[7]||(l[7]=u=>a.$emit("mouseleave",u))},[s.value?(Z(),Ie(A0,{key:0,colspan:o.value},{default:Ee(()=>l[8]||(l[8]=[pe("span",{class:"shimmer"},null,-1)])),_:1},8,["colspan"])):Ke(a.$slots,"default",{key:1})],544))}}),iD=$e({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(Z(),Ie(T0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Ee(()=>[Ke(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),oD={key:0,class:"oc-table-thead-content"},sD=["textContent"],aD={key:1},lD={key:0,class:"oc-table-thead-content"},cD=["textContent"],uD={key:1,class:"oc-table-footer"},fD={class:"oc-table-footer-row"},dD=["colspan"],_0="asc",Kf="desc",pD=$e({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:$P,EVENT_TROW_CLICKED:DP,EVENT_TROW_MOUNTED:LP,EVENT_TROW_CONTEXTMENU:MP},{$gettext:o}=xe.useGettext(),i=L=>e.itemDomSelector?e.itemDomSelector(L):L[e.idKey],s=j(()=>{const L=["oc-table"];return e.hover&&L.push("oc-table-hover"),e.sticky&&L.push("oc-table-sticky"),L}),a=j(()=>e.fields.length),l=L=>{L.preventDefault()},u=(L,k)=>{n(BP,L,k)},c=(L,k)=>{n(Cb,L,k)},f=(L,k,N)=>{n("dropRowStyling",L,k,N)},d=L=>L.type==="slot",y=L=>["callback","function"].indexOf(L.type)>=0,w=L=>Object.prototype.hasOwnProperty.call(L,"title")?L.title:L.name,m=()=>({class:s.value}),T=(L,k)=>{const N=h(L);return N.class=`oc-table-header-cell oc-table-header-cell-${L.name}`,Object.prototype.hasOwnProperty.call(L,"thClass")&&(N.class+=` ${L.thClass}`),e.sticky&&(N.style=`top: ${e.headerPosition}px;`),k===0&&(N.class+=` oc-pl-${xr(e.paddingX)} `),k===e.fields.length-1&&(N.class+=` oc-pr-${xr(e.paddingX)}`),R(N,L),N},v=(L,k)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(L)||k}`,b(L)?"oc-table-highlighted":void 0,S(L)?"oc-table-disabled":void 0].filter(Boolean)}),g=(L,k,N)=>{const z=h(L);return z.class=`oc-table-data-cell oc-table-data-cell-${L.name}`,Object.prototype.hasOwnProperty.call(L,"tdClass")&&(z.class+=` ${L.tdClass}`),Object.prototype.hasOwnProperty.call(L,"wrap")&&(z.wrap=L.wrap),k===0&&(z.class+=` oc-pl-${xr(e.paddingX)} `),k===e.fields.length-1&&(z.class+=` oc-pr-${xr(e.paddingX)}`),Object.prototype.hasOwnProperty.call(L,"accessibleLabelCallback")&&(z["aria-label"]=L.accessibleLabelCallback(N)),z},h=L=>({...(L==null?void 0:L.alignH)&&{alignH:L.alignH},...(L==null?void 0:L.alignV)&&{alignV:L.alignV},...(L==null?void 0:L.width)&&{width:L.width},class:void 0,wrap:void 0,style:void 0}),b=L=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(L[e.idKey])>-1:e.highlighted===L[e.idKey]:!1,S=L=>e.disabled.length?e.disabled.indexOf(L[e.idKey])>-1:!1,E=(L,k,N)=>{const z=[N[e.idKey],k+1].filter(Boolean);return d(L)?[...z,L.name].join("-"):y(L)?[...z,L.callback(N[L.name])].join("-"):[...z,N[L.name]].join("-")},_=L=>o("Sort by %{ name }",{name:L}),R=(L,k)=>{if(!A(k))return;let N="none";e.sortBy===k.name&&(N=e.sortDir===_0?"ascending":"descending"),L["aria-sort"]=N},A=({sortable:L})=>!!L,$=L=>{if(!A(L))return;let k=e.sortDir;e.sortBy===L.name&&e.sortDir!==void 0&&(k=e.sortDir===Kf?_0:Kf),(e.sortBy!==L.name||e.sortDir===void 0)&&(k=L.sortDir||Kf),n("sort",{sortBy:L.name,sortDir:k})};return(L,k)=>{const N=ge("oc-icon");return Z(),me("table",zt(m(),{class:"has-item-context-menu"}),[L.hasHeader?(Z(),Ie(nD,{key:0},{default:Ee(()=>[he(R0,{class:"oc-table-header-row"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(L.fields,(z,Q)=>(Z(),Ie(iD,zt({key:`oc-thead-${z.name}`,ref_for:!0},T(z,Q)),{default:Ee(()=>[z.sortable?(Z(),Ie(a0,{key:0,"aria-label":_(z.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:J=>$(z)},{default:Ee(()=>[z.headerType==="slot"?(Z(),me("span",oD,[Ke(L.$slots,z.name+"Header")])):(Z(),me("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(z))},null,8,sD)),he(N,{name:L.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:W.normalizeClass([{"oc-invisible-sr":L.sortBy!==z.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(Z(),me("div",aD,[z.headerType==="slot"?(Z(),me("span",lD,[Ke(L.$slots,z.name+"Header")])):(Z(),me("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(z))},null,8,cD))]))]),_:2},1040))),128))]),_:3})]),_:3})):Fe("",!0),he(rD,{class:"has-item-context-menu"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(L.data,(z,Q)=>(Z(),Ie(R0,zt({key:`oc-tbody-tr-${i(z)||Q}`,ref_for:!0,ref:`row-${Q}`},v(z,Q),{"data-item-id":z[L.idKey],draggable:L.dragDrop,onClick:J=>L.$emit(r.EVENT_TROW_CLICKED,[z,J]),onContextmenu:J=>L.$emit(r.EVENT_TROW_CONTEXTMENU,L.$refs[`row-${Q}`][0],J,z),onVnodeMounted:J=>L.$emit(r.EVENT_TROW_MOUNTED,z,L.$refs[`row-${Q}`][0]),onDragstart:J=>u(z,J),onDrop:J=>c(i(z),J),onDragenter:An(J=>f(i(z),!1,J),["prevent"]),onDragleave:An(J=>f(i(z),!0,J),["prevent"]),onMouseleave:J=>f(i(z),!0,J),onDragover:k[0]||(k[0]=J=>l(J)),onItemVisible:J=>L.$emit("itemVisible",z)}),{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(L.fields,(J,ae)=>(Z(),Ie(A0,zt({key:"oc-tbody-td-"+E(J,ae,z),ref_for:!0},g(J,ae,z)),{default:Ee(()=>[d(J)?Ke(L.$slots,J.name,{key:0,item:z}):y(J)?(Z(),me(Qe,{key:1},[Vt(W.toDisplayString(J.callback(z[J.name])),1)],64)):(Z(),me(Qe,{key:2},[Vt(W.toDisplayString(z[J.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),L.$slots.footer?(Z(),me("tfoot",uD,[pe("tr",fD,[pe("td",{colspan:a.value,class:"oc-table-footer-cell"},[Ke(L.$slots,"footer")],8,dD)])])):Fe("",!0)],16)}}}),I0=$e({__name:"ResourceStatusIndicators",props:{space:{},resource:{},filter:{type:Function}},setup(e){const t=Kd(),n=vt(),r=Xe(),o=j(()=>{const i=Tb({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user});return e.filter?i.filter(e.filter):i});return(i,s)=>o.value.length>0?(Z(),Ie(p(eD),zt({key:0},p(t),{indicators:o.value}),null,16,["indicators"])):Fe("",!0)}}),hD=850,gD=$e({components:{ContextMenuQuickAction:Vf,ResourceGhostElement:zf,ResourceListItem:Co,ResourceSize:i0,ResourceStatusIndicators:I0,OcSpinner:Y$,OcTable:pD},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Kt.defaultModeName,validator:e=>[Kt.name.condensedTable,Kt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Bt.Asc.toString(),Bt.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Ff,"update:selectedIds","update:modelValue"],setup(e,t){const n=We(),r=nn(),{getMatchingSpace:o}=ln(),{canBeOpenedWithSecureView:i}=Lf(),s=si({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)}),{isSticky:a}=Nf(),{$gettext:l}=xe.useGettext(),{isLocationPicker:u,isFilePicker:c,postMessage:f,isEnabled:d,fileTypes:y}=ri(),{getDefaultAction:w}=zn(),m=at(),{options:T}=Ge.storeToRefs(m),v=Eo(),{resources:g,action:h}=Ge.storeToRefs(v),b=Yr(),{userContextReady:S}=Ge.storeToRefs(b),E=Xe(),{areFileExtensionsShown:_,latestSelectedId:R,deleteQueue:A}=Ge.storeToRefs(E),$=le(),L=le(),k=le(),{width:N}=jr.useWindowSize(),z=j(()=>r.filesTags&&N.value>=hD),{actions:Q}=ra(),{actions:J}=Lv(),ae=j(()=>p(Q)[0].handler),re=j(()=>p(J)[0].handler),se=I=>l("Search for tag %{tag}",{tag:I}),ue=I=>{var F;return p(d)&&((F=p(y))!=null&&F.length)?!p(y).includes(I.extension)&&!p(y).includes(I.mimeType)&&!I.isFolder:I.processing===!0||H(I.id)},we=j(()=>{var I,F;return((F=(I=e.resources)==null?void 0:I.filter(G=>ue(G)===!0))==null?void 0:F.map(G=>G.id))||[]}),ee=I=>!e.areResourcesClickable||te.isProjectSpaceResource(I)&&I.disabled||!I.isFolder&&(!I.canDownload()&&!i(I)||p(d)&&!p(c))?!1:!p(we).includes(I.id),ie=I=>{Ye.publish("app.files.list.clicked"),t.emit("update:selectedIds",I)},ce=I=>{E.toggleSelection(I),ie(E.selectedIds)},Ce=I=>{if(I.isFolder)return s.getFolderLink(I);let F=e.space;F||(F=o(I));const G=w({resources:[I],space:F});if(G!=null&&G.route)return G.route({space:F,resources:[I]})},H=I=>p(A).includes(I);return{router:n,configOptions:T,dragItem:$,ghostElement:L,contextMenuButton:k,getTagToolTip:se,renameActions:Q,renameActionsSpace:J,renameHandler:ae,renameHandlerSpace:re,FolderViewModeConstants:Kt,hasTags:z,disabledResources:we,isResourceDisabled:ue,userContextReady:S,getMatchingSpace:o,clipboardResources:g,clipboardAction:h,...aa({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},t),...s,postMessage:f,isFilePicker:c,isLocationPicker:u,isEmbedModeEnabled:d,emitSelect:ie,toggleSelection:ce,areFileExtensionsShown:_,latestSelectedId:R,isResourceClickable:ee,getResourceLink:Ce,isSticky:a,isResourceInDeleteQueue:H}},data(){return{constants:{ImageDimension:Wn,EVENT_TROW_MOUNTED:wv}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const n=bh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"status",prop:"disabled",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.mdate)+" ("+this.formatDate(r.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.sdate)+" ("+this.formatDate(r.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.ddate)+" ("+this.formatDate(r.ddate)+")"}].filter(r=>{if(r.name==="tags"&&!this.hasTags)return!1;if(r.name==="indicators")return!0;let o;return r.prop?o=Il(e,r.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,r.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(r.name):o}).map(r=>{const o=n.find(i=>i.name===r.name);return o&&Object.assign(r,{sortable:o.sortable,sortDir:o.sortDir}),r})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ti.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var n;const t=(n=p(this.router.currentRoute).query)==null?void 0:n.term;return Ti("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return te.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length},openRenameDialog(e){if(te.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Ye.publish(yt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Ye.publish(yt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Ff,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,n){var s,a;if((((s=n.dataTransfer)==null?void 0:s.types)||[]).some(l=>l==="Files")||(a=n.currentTarget)!=null&&a.contains(n.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:n,event:r}=e;(n==null?void 0:n.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),wo(n.tippy,r,this.contextMenuButton))},showContextMenu(e,t,n){if(t.preventDefault(),this.isResourceDisabled(n))return!1;const r=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];r!==void 0&&(this.isResourceSelected(n)||this.emitSelect([n.id]),wo(r._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,a;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(Ks(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1,o=(n==null?void 0:n.target).getAttribute("type")==="checkbox";if(((a=(s=n==null?void 0:n.target)==null?void 0:s.closest("div"))==null?void 0:a.id)!=="oc-files-context-menu"){if(n&&n.metaKey)return Ye.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Ye.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return mb(new Date(e),this.$language.current)},formatDateRelative(e){return bb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!te.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),n=e.sharedWith.filter(({shareType:r})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(r))).length;return n?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",n,{resourceType:t,shareCount:n.toString()}):""},getSharedByAvatarDescription(e){if(!te.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:n})=>n).join(", ")})},getSharedByAvatarItems(e){return te.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,shareType:te.ShareTypes.user.value,username:t.id})):[]},getSharedWithAvatarItems(e){return te.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,shareType:t.shareType,username:t.id})):[]}}}),mD={class:"resource-table-select-all"},yD={class:"oc-text-truncate"},bD=["textContent"],vD=["textContent"],wD=["textContent"],SD={key:0,class:"resource-table-actions"};function ED(e,t,n,r,o,i){const s=ge("oc-checkbox"),a=ge("oc-spinner"),l=ge("resource-list-item"),u=ge("oc-icon"),c=ge("oc-button"),f=ge("resource-size"),d=ge("oc-tag"),y=ge("resource-status-indicators"),w=ge("oc-avatars"),m=ge("context-menu-quick-action"),T=ge("oc-table"),v=ge("resource-ghost-element"),g=sn("oc-tooltip");return Z(),me(Qe,null,[he(T,zt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&e.isSideBarOpen,"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&e.isSideBarOpen}],data:e.resources,fields:e.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=h=>e.$emit("update:modelValue",h))}),Hd({name:Ee(({item:h})=>[pe("div",{class:W.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[Ke(e.$slots,"image",{resource:h}),(Z(),Ie(l,{key:`${h.path}-${e.resourceDomSelector(h)}-${h.thumbnail}`,resource:h,"path-prefix":e.getPathPrefix(h),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(h),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(h),link:e.getResourceLink(h),"parent-folder-link":e.getParentFolderLink(h),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(h),class:W.normalizeClass({"resource-table-resource-cut":e.isResourceCut(h)}),onClick:b=>e.emitFileClick(h)},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),e.hasRenameAction(h)?(Z(),Ie(c,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:b=>e.openRenameDialog(h)},{default:Ee(()=>[he(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Fe("",!0)],2),Ke(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Ee(({item:h})=>[Ke(e.$slots,"syncEnabled",{resource:h})]),size:Ee(({item:h})=>[he(f,{size:h.size||Number.NaN},null,8,["size"])]),tags:Ee(({item:h})=>[(Z(!0),me(Qe,null,Ft(h.tags.slice(0,2),b=>(Z(),Ie(Cr(e.userContextReady?"router-link":"span"),zt({key:b,ref_for:!0},e.getTagComponentAttrs(b),{class:"resource-table-tag-wrapper"}),{default:Ee(()=>[ot((Z(),Ie(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Ee(()=>[he(u,{name:"price-tag-3",size:"small"}),pe("span",yD,W.toDisplayString(b),1)]),_:2},1024)),[[g,e.getTagToolTip(b)]])]),_:2},1040))),128)),h.tags.length>2?(Z(),Ie(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Ee(()=>[Vt(" + "+W.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Fe("",!0)]),manager:Ee(({item:h})=>[Ke(e.$slots,"manager",{resource:h})]),members:Ee(({item:h})=>[Ke(e.$slots,"members",{resource:h})]),totalQuota:Ee(({item:h})=>[Ke(e.$slots,"totalQuota",{resource:h})]),usedQuota:Ee(({item:h})=>[Ke(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Ee(({item:h})=>[Ke(e.$slots,"remainingQuota",{resource:h})]),mdate:Ee(({item:h})=>[ot(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.mdate))},null,8,bD),[[g,e.formatDate(h.mdate)]])]),indicators:Ee(({item:h})=>[he(y,{space:e.space,resource:h,"disable-handler":e.isResourceDisabled(h)},null,8,["space","resource","disable-handler"])]),status:Ee(({item:h})=>[ot(he(u,{name:h.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[g,h.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Ee(({item:h})=>[ot(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.sdate))},null,8,vD),[[g,e.formatDate(h.sdate)]])]),ddate:Ee(({item:h})=>[ot(pe("p",{tabindex:"0",class:"oc-m-rm",textContent:W.toDisplayString(e.formatDateRelative(h.ddate))},null,8,wD),[[g,e.formatDate(h.ddate)]])]),sharedBy:Ee(({item:h})=>[he(c,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:b=>e.openSharingSidebar(h)},{default:Ee(()=>[he(w,{class:"resource-table-people",items:e.getSharedByAvatarItems(h),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Ee(({item:h})=>[he(c,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:b=>e.openSharingSidebar(h)},{default:Ee(()=>[he(w,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Ee(({item:h})=>[e.isResourceDisabled(h)?Fe("",!0):(Z(),me("div",SD,[Ke(e.$slots,"quickActions",{resource:h}),he(m,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:b=>e.showContextMenuOnBtnClick(b,h)},{contextMenu:Ee(()=>[Ke(e.$slots,"contextMenu",{resource:h})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Ee(()=>[pe("div",mD,[ot(he(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:An(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[g,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Ee(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(Z(),Ie(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(Z(),Ie(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(h)}`,label:e.getResourceCheckboxLabel(h),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(h),"model-value":e.isResourceSelected(h),outline:e.isLatestSelectedItem(h),onClick:An(b=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Ee(()=>[Ke(e.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(Z(),Ie(Bd,{key:0,to:"body"},[he(v,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Fe("",!0)],64)}const TD=ze(gD,[["render",ED]]),AD=["data-item-id"],RD={key:0,class:"oc-tile-card-lazy-shimmer"},_D={class:"oc-tile-card-selection"},ID={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},CD=["textContent"],PD=["aria-label"],FD={class:"oc-card-body oc-p-s"},OD={class:"oc-flex oc-flex-between oc-flex-middle"},xD={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},kD={class:"oc-flex oc-flex-middle"},ND={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},$D=["textContent"],C0=$e({__name:"ResourceTile",props:{resource:{},resourceRoute:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const n=t,{$gettext:r}=xe.useGettext(),o=Ad((f,d)=>{let y;return{get(){return f(),y},set(w){y=w,d()}}}),i=j(()=>e.resource.locked||e.resource.processing),s=j(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=j(()=>e.resource.locked?r("This item is locked"):null),l=j(()=>te.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?E0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},c=j(()=>!p(u));return e.lazy||n("itemVisible"),(f,d)=>{const y=ge("oc-spinner"),w=ge("oc-tag"),m=ge("oc-image"),T=ge("oc-icon"),v=sn("oc-tooltip");return Z(),me("div",{ref_key:"observerTarget",ref:o,class:W.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":f.isResourceSelected,"oc-tile-card-disabled":f.isResourceDisabled&&!p(te.isProjectSpaceResource)(f.resource),"state-trashed":f.isResourceDisabled&&p(te.isProjectSpaceResource)(f.resource)}]),"data-item-id":f.resource.id,onContextmenu:d[2]||(d[2]=g=>f.$emit("contextmenu",g))},[c.value?(Z(),me("div",RD)):(Z(),me(Qe,{key:1},[he(Of,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:f.resource,link:f.resourceRoute,"is-resource-clickable":f.isResourceClickable,tabindex:"-1",onClick:d[0]||(d[0]=g=>f.$emit("click"))},{default:Ee(()=>[pe("div",_D,[f.isLoading?(Z(),me("div",ID,[he(y,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):Ke(f.$slots,"selection",{key:1,item:f.resource})]),f.isResourceDisabled&&p(te.isProjectSpaceResource)(f.resource)?(Z(),Ie(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(p(r)("Disabled"))},null,8,CD)]),_:1})):Fe("",!0),ot((Z(),me("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[Ke(f.$slots,"imageField",{item:f.resource},()=>[f.resource.thumbnail?(Z(),Ie(m,{key:0,class:"tile-preview",src:f.resource.thumbnail},null,8,["src"])):(Z(),Ie(Io,{key:1,resource:f.resource,size:f.resourceIconSize,class:"tile-default-image oc-pt-xs"},Hd({_:2},[i.value?{name:"status",fn:Ee(()=>[he(T,zt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,PD)),[[v,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),pe("div",FD,[pe("div",OD,[pe("div",xD,[he(Co,{resource:f.resource,"is-icon-displayed":!1,"is-extension-displayed":f.isExtensionDisplayed,"is-resource-clickable":f.isResourceClickable,link:f.resourceRoute,onClick:d[1]||(d[1]=g=>f.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),pe("div",kD,[Ke(f.$slots,"indicators",{item:f.resource,class:"resource-indicators"}),Ke(f.$slots,"actions",{item:f.resource}),Ke(f.$slots,"contextMenu",{item:f.resource})])]),l.value?(Z(),me("p",ND,[pe("small",{textContent:W.toDisplayString(l.value)},null,8,$D)])):Fe("",!0)])],64))],42,AD)}}}),DD={id:"tiles-view",class:"oc-px-m oc-pt-l"},LD={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},MD={key:0,class:"oc-tiles-sort"},BD={key:0,class:"oc-flex"},jD={class:"oc-tiles-footer"},UD=$e({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Kt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=xe.useGettext(),o=We(),i=Xe(),{getDefaultAction:s}=zn(),{getMatchingSpace:a}=ln(),{canBeOpenedWithSecureView:l}=Lf(),{isEnabled:u,fileTypes:c,isLocationPicker:f,isFilePicker:d,postMessage:y}=ri(),w=Mf(),m=j(()=>Math.min(p(w),e.viewSize)),T=j(()=>i.areFileExtensionsShown),v=j(()=>p(_e)?r("Clear selection"):r("Select all")),g=le(),h=le(),b=le({tiles:{},dropBtns:{}}),S=aa({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},{emit:n}),E=Y=>{if(te.isSpaceResource(Y))return Y.disabled?null:On("files-spaces-generic",Jn(Y,{path:"",fileId:Y.fileId}));if(Y.isFolder)return S.createFolderLink({path:Y.path,fileId:Y.fileId,resource:Y});let Ne=e.space;Ne||(Ne=a(Y));const Be=s({resources:[Y],space:Ne});return Be!=null&&Be.route?Be.route({space:Ne,resources:[Y]}):null},_=Y=>{if(p(u)&&p(d))return y("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(Y)),locationQuery:JSON.parse(JSON.stringify(Ks(p(o.currentRoute))))});Y.type!=="space"&&Y.type!=="folder"&&S.createFileAction(Y)},R=(Y,Ne,Be)=>{const{dropdown:qe,event:et}=Y;(qe==null?void 0:qe.tippy)!==void 0&&(i.setSelection([Ne.id]),wo(qe.tippy,et,p(b).dropBtns[Be]))},A=Y=>e.selectedIds.includes(Y.id),$=j(()=>e.resources.filter(Y=>e.selectedIds.includes(Y.id))),L=Y=>k(Y)||N(Y)?!1:Y.isFolder?!0:!(!Y.canDownload()&&!l(Y)||p(u)&&!p(d)),k=Y=>{var Ne;return p(u)&&((Ne=p(c))!=null&&Ne.length)?!p(c).includes(Y.extension)&&!p(c).includes(Y.mimeType)&&!Y.isFolder:je(Y.id)?!0:Y.processing===!0},N=Y=>k(Y)?!0:te.isSpaceResource(Y)&&Y.disabled,z=j(()=>{var Y,Ne;return((Ne=(Y=e.resources)==null?void 0:Y.filter(Be=>k(Be)===!0))==null?void 0:Ne.map(Be=>Be.id))||[]}),Q=Y=>{n("update:selectedIds",Y)},J=()=>{if(p(_e))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(Y=>!p(z).includes(Y.id)).map(Y=>Y.id))},ae=(Y,Ne,Be)=>{var et;Y.preventDefault();const qe=(et=p(b).tiles[Ne.id])==null?void 0:et.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];qe!==void 0&&(A(Ne)||Q([Ne.id]),wo(qe._tippy,Y,Be))},re=Y=>{const Ne=Y[0],Be=Y[1];if(Be&&Be.metaKey)return Ye.publish("app.files.list.clicked.meta",Ne);if(Be&&Be.shiftKey)return Ye.publish("app.files.list.clicked.shift",{resource:Ne,skipTargetSelection:!1});se(Ne)},se=Y=>{const Ne=A(Y)?e.selectedIds.filter(Be=>Be!==Y.id):[...e.selectedIds,Y.id];n("update:selectedIds",Ne)},ue=Y=>{switch(Y.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},we=j(()=>e.sortFields.find(Y=>Y.name===e.sortBy&&Y.sortDir===e.sortDir)||e.sortFields[0]),ee=Y=>{n("sort",{sortBy:Y.name,sortDir:Y.sortDir})},ie=j(()=>{const Y={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Ne=p(m);return Y[Ne]??"xxlarge"});rS(()=>{b.value={tiles:{},dropBtns:{}}});const ce=(Y,Ne,Be)=>{var Pt,ct;if((((Pt=Be.dataTransfer)==null?void 0:Pt.types)||[]).some(en=>en==="Files")||(ct=Be.currentTarget)!=null&&ct.contains(Be.relatedTarget)||e.selectedIds.includes(Y.id)||Y.type!=="folder")return;const et=p(b).tiles[Y.id];if(Ne){et.$el.classList.remove("oc-tiles-item-drop-highlight");return}et.$el.classList.add("oc-tiles-item-drop-highlight")},Ce=j(()=>e.selectedIds.filter(Y=>Y!==p(g).id)),H=async(Y,Ne)=>{g.value=Y,await jn(),p(h).$el.ariaHidden="true",p(h).$el.style.left="-99999px",p(h).$el.style.top="-99999px",Ne.dataTransfer.setDragImage(p(h).$el,0,0),Ne.dataTransfer.dropEffect="move",Ne.dataTransfer.effectAllowed="move"},I=async(Y,Ne)=>{A(Y)||se(Y),await H(Y,Ne)},F=(Y,Ne)=>{(Ne.dataTransfer.types||[]).some(qe=>qe==="Files")||(g.value=null,ce(Y,!0,Ne),n("fileDropped",Y.id))},G=le(0),V=()=>{const Y=document.getElementById("tiles-view"),Ne=getComputedStyle(Y),Be=parseInt(Ne.getPropertyValue("padding-left"),10)|0,qe=parseInt(Ne.getPropertyValue("padding-right"),10)|0;G.value=Y.clientWidth-Be-qe},M=j(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:q}=Wv(),fe=j(()=>{const Y=[...Array(Kt.tilesSizeMax).keys()].map(Ne=>Ne+1);return[...new Set(Y.map(Ne=>{const Be=q(Ne);return Be?Math.round(p(G)/(Be+p(M))):0}))]}),Ae=j(()=>{const Y=p(fe);return Y.length<p(m)?Y[Y.length-1]:Y[p(m)-1]}),Le=j(()=>{const Y=p(Ae)?e.resources.length%p(Ae):0;return Y?p(Ae)-Y:0}),ke=j(()=>p(G)/p(Ae)-p(M)),_e=j(()=>{const Y=p(z).length===e.resources.length,Ne=p($).length===e.resources.length-p(z).length;return!Y&&Ne}),je=Y=>i.deleteQueue.includes(Y);return wt(ke,Y=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${Y}px`)},{immediate:!0}),wt(fe,Y=>{w.value=Math.max(Y.length,1)}),Mt(()=>{window.addEventListener("resize",V),V()}),Un(()=>{window.removeEventListener("resize",V)}),(Y,Ne)=>{const Be=ge("oc-checkbox"),qe=ge("oc-icon"),et=ge("oc-button"),Pt=ge("oc-filter-chip"),ct=ge("oc-list"),en=sn("oc-tooltip");return Z(),me("div",DD,[pe("div",LD,[ot(he(Be,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:v.value,"label-hidden":!0,disabled:Y.resources.length===z.value.length,"model-value":_e.value,onClick:An(J,["stop"])},null,8,["label","disabled","model-value"]),[[en,v.value]]),Y.sortFields.length?(Z(),me("div",MD,[he(Pt,{class:"oc-tiles-sort-filter-chip","filter-label":we.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(Y.sortFields,(Me,He)=>(Z(),Ie(et,{key:He,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"oc-tiles-sort-filter-chip-item-active":we.value===Me,"oc-mt-xs":He>0}]),onClick:Mn=>ee(Me)},{default:Ee(()=>[pe("span",null,W.toDisplayString(Me.label),1),Me===we.value?(Z(),me("div",BD,[he(qe,{name:"check"})])):Fe("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Fe("",!0)]),he(ct,{class:"oc-tiles"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(Y.resources,Me=>(Z(),me("li",{key:Me.id,class:"oc-tiles-item has-item-context-menu"},[he(C0,{ref_for:!0,ref:He=>b.value.tiles[Me.id]=He,resource:Me,"resource-route":E(Me),"is-resource-selected":A(Me),"is-resource-clickable":L(Me),"is-resource-disabled":k(Me)||N(Me),"is-extension-displayed":T.value,"resource-icon-size":ie.value,draggable:Y.dragDrop,lazy:Y.lazy,"is-loading":je(Me.id),onVnodeMounted:He=>Y.$emit("rowMounted",Me,b.value.tiles[Me.id],p(Wn).Tile),onContextmenu:He=>ae(He,Me,b.value.tiles[Me.id]),onClick:He=>_(Me),onDragstart:He=>I(Me,He),onDragenter:An(He=>ce(Me,!1,He),["prevent"]),onDragleave:An(He=>ce(Me,!0,He),["prevent"]),onDrop:He=>F(Me,He),onDragover:Ne[0]||(Ne[0]=He=>He.preventDefault()),onItemVisible:He=>Y.$emit("itemVisible",Me)},{selection:Ee(()=>[!p(f)&&!p(d)?(Z(),Ie(Be,{key:0,label:ue(Me),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:k(Me),"model-value":A(Me),onClick:An(He=>re([Me,He]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Fe("",!0)]),imageField:Ee(()=>[Ke(Y.$slots,"image",{resource:Me})]),indicators:Ee(()=>[he(I0,{space:Y.space,resource:Me,filter:He=>He.category==="system","disable-handler":k(Me)},null,8,["space","resource","filter","disable-handler"])]),actions:Ee(()=>[Ke(Y.$slots,"actions",{resource:Me})]),contextMenu:Ee(()=>[p(te.isSpaceResource)(Me)||!k(Me)?(Z(),Ie(p(Vf),{key:0,ref_for:!0,ref:He=>b.value.dropBtns[Me.id]=He,item:Me,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:He=>R(He,Me,Me.id)},{contextMenu:Ee(()=>[Ke(Y.$slots,"contextMenu",{resource:Me})]),_:2},1032,["item","onQuickActionClicked"])):Fe("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","is-loading","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(Z(!0),me(Qe,null,Ft(Le.value,Me=>(Z(),me("li",{key:`ghost-tile-${Me}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(Z(),Ie(Bd,{key:0,to:"body"},[he(zf,{ref_key:"ghostElementRef",ref:h,"preview-items":[g.value,...Ce.value]},null,8,["preview-items"])])):Fe("",!0),pe("div",jD,[Ke(Y.$slots,"footer")])])}}}),qD=$e({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=We(),{current:o}=xe.useGettext(),i=Jt(),s=le(),a=le(e.items),l=le(),u=le(),c=le(!1),f=le(),d=`q_${e.filterName}`,y=rn(d),w=k=>k[e.idAttribute],m=()=>r.push({query:{...ki(p(i).query,[d]),...p(s)&&{[d]:w(p(s))}}}),T=k=>p(s)&&w(p(s))===w(k),v=()=>{l.value=void 0,u.value=void 0},g=async k=>{v(),T(k)?s.value=void 0:(s.value=k,p(f).hideDrop()),await m(),t("selectionChange",p(s))},h=()=>{s.value=void 0,c.value=!1,v(),t("selectionChange",p(s)),m()},b=()=>{a.value=e.items},S=()=>{c.value=!1},E=()=>{const k=Et(p(y));if(!k)return;const N=e.items.find(z=>w(z)===k);if(N){s.value=N;return}if(p(_)){const z=k.replace("range:",""),Q=Number(z.split(" - ")[0]),J=Number(z.split(" - ")[1]);l.value=Dt.DateTime.fromMillis(Q),u.value=Dt.DateTime.fromMillis(J),s.value=p(A)}},_=j(()=>{var k;return(k=Et(p(y)))==null?void 0:k.startsWith("range:")}),R=j(()=>!p(l)||!p(u)?!1:p(l)<=p(u)),A=j(()=>{if(!p(l)||!p(u))return null;const k=ni(p(l),o,Dt.DateTime.DATE_SHORT),N=ni(p(u),o,Dt.DateTime.DATE_SHORT),z=p(l).toMillis(),Q=p(u).toMillis();return{[e.idAttribute]:`range:${z} - ${Q}`,[e.displayNameAttribute]:`${k} - ${N}`}}),$=async()=>{s.value=p(A),await m(),p(f).hideDrop(),t("selectionChange",p(s))},L=({date:k,error:N},z)=>{if(N){console.error("date could not be set");return}const Q=z==="from"?l:u;if(!k){Q.value=void 0;return}const J=z==="from"?k.startOf("day"):k.endOf("day");Q.value=J};return n({setSelectedItemsBasedOnQuery:E}),Mt(()=>{E()}),{clearFilter:h,displayedItems:a,isItemSelected:T,selectedItem:s,onShowDrop:b,onHideDrop:S,filterChip:f,toggleItemSelection:g,setSelectedItemsBasedOnQuery:E,fromDate:l,toDate:u,dateRangeValid:R,applyDateRangeFilter:$,dateRangeApplied:_,setDateRangeDate:L,dateRangeClicked:c,queryParam:d}}}),VD={class:"oc-flex oc-flex-middle oc-text-truncate"},zD={class:"oc-text-truncate oc-ml-s"},WD={class:"oc-flex"},HD={class:"oc-my-xs"},GD={class:"oc-flex oc-flex-middle oc-text-truncate"},KD={class:"oc-text-truncate oc-ml-s"},QD=["textContent"],XD={class:"oc-flex"},YD={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},JD=["textContent"],ZD={class:"oc-mt-s"},eL={class:"date-filter-apply-btn"};function tL(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=ge("oc-list"),u=ge("oc-datepicker"),c=ge("oc-filter-chip");return Z(),me("div",{class:W.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[he(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:Ee(()=>[he(l,{class:W.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.displayedItems,(f,d)=>(Z(),me("li",{key:d,class:"oc-my-xs"},[he(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:y=>e.toggleItemSelection(f)},{default:Ee(()=>[pe("div",VD,[pe("div",zD,[Ke(e.$slots,"item",{item:f})])]),pe("div",WD,[e.isItemSelected(f)?(Z(),Ie(s,{key:0,name:"check"})):Fe("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),pe("li",HD,[he(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:Ee(()=>[pe("div",GD,[pe("div",KD,[pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,QD)])]),pe("div",XD,[e.dateRangeApplied?(Z(),Ie(s,{key:0,name:"check"})):Fe("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),pe("div",{class:W.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[pe("div",YD,[he(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Ee(()=>[he(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,JD),he(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Ee(()=>[he(s,{name:"close"})]),_:1},8,["aria-label"])]),pe("div",ZD,[he(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),he(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),pe("div",eL,[he(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const nL=ze(qD,[["render",tL]]),rL=$e({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=We(),r=Jt(),o=le(e.filterOptions[0].name),i=`q_${e.filterName}`,s=rn(i),a=u=>n.push({query:{...ki(p(r).query,[i]),[i]:u}}),l=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return Mt(()=>{const u=Et(p(s));u&&e.filterOptions.some(({name:c})=>c===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:c})=>c===u)))}),{queryParam:i,activeOption:o,toggleFilter:l}}}),iL=["textContent"];function oL(e,t,n,r,o,i){const s=ge("oc-button");return Z(),me("div",null,[pe("div",{class:W.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(Z(!0),me(Qe,null,Ft(e.filterOptions,(a,l)=>(Z(),Ie(s,{id:a.name,key:l,class:W.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:"raw-inverse","color-role":"surface",onClick:u=>e.toggleFilter(a)},{default:Ee(()=>[pe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:W.toDisplayString(a.label)},null,8,iL)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const sL=ze(rL,[["render",oL]]),aL={class:"space-quota"},lL=["textContent"],P0=$e({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=xe.useGettext(),r=j(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:p(i),total:p(o),percentage:p(s).toString()}):t("%{used} used (no restriction)",{used:p(i)})),o=j(()=>Sn(e.spaceQuota.total,n)),i=j(()=>Sn(e.spaceQuota.used,n)),s=j(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=j(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(l,u)=>{const c=ge("oc-progress");return Z(),me("div",aL,[pe("p",{class:"oc-mb-s oc-mt-rm",textContent:W.toDisplayString(r.value)},null,8,lL),he(c,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),cL=$e({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=dr("resource"),n="check",r="file-copy",o=le(r),i=le(r),s=j(()=>ff(p(t).webDavPath)),a=j(()=>{var c;return(c=e.space)==null?void 0:c.getWebDavUrl({path:p(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(p(s)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(p(a)),i.value=n,setTimeout(()=>i.value=r,1500)},webDavPath:s,webDavUrl:a}}}),uL={class:"oc-flex"},fL=["textContent"],dL={class:"oc-flex"},pL=["textContent"];function hL(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=sn("oc-tooltip");return Z(),me(Qe,null,[pe("dt",null,W.toDisplayString(e.$gettext("WebDAV path")),1),pe("dd",uL,[ot(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavPath)},null,8,fL),[[l,e.webDavPath]]),ot((Z(),Ie(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Ee(()=>[he(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV path")]])]),pe("dt",null,W.toDisplayString(e.$gettext("WebDAV URL")),1),pe("dd",dL,[ot(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavUrl)},null,8,pL),[[l,e.webDavUrl]]),ot((Z(),Ie(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Ee(()=>[he(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV URL")]])])],64)}const F0=ze(cL,[["render",hL]]),gL={id:"oc-space-details-sidebar"},mL={class:"oc-space-details-sidebar-image oc-text-center"},yL={key:1,class:"oc-position-relative"},bL=["src"],vL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},wL=["textContent"],SL=["textContent"],EL=["aria-label"],TL=ze($e({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=vt(),n=Xe(),{resourceContentsText:r}=Hv({showSizeInformation:!1}),o=We(),{$gettext:i,$ngettext:s,current:a}=xe.useGettext(),{loadPreview:l}=Bf(),u=lt(),{imagesLoading:c}=Ge.storeToRefs(u),f=jt(),d=dr("resource"),y=le(""),{user:w}=Ge.storeToRefs(t),m=j(()=>f.linkShares.length),T=j(()=>n.areWebDavDetailsShown),v=j(()=>!ft(o,"files-spaces-projects")),g=j(()=>`${Sn(p(d).size,a)}, ${p(r)}`);wt(()=>p(d).spaceImageData,async()=>{if(!p(d).spaceImageData){y.value="";return}const J=te.buildSpaceImageResource(p(d));y.value=await l({space:p(d),resource:J,dimensions:Wn.Tile,processor:Bs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=j(()=>te.getSpaceManagers(p(d)).map(ae=>{var se;const re=ae.grantedTo.user||ae.grantedTo.group;return re.id===((se=p(w))==null?void 0:se.id)?i("%{displayName} (me)",{displayName:re.displayName}):re.displayName}).join(", ")),b=j(()=>yb(p(d).mdate,a)),S=j(()=>p($)||p(L)),E=j(()=>{if(p($)&&!p(L))return p(N);if(!p($)&&p(L))return p(z);switch(p(k)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(m),{linkShareCount:p(m).toString()});default:return p(m)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(k).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(k).toString(),linkShareCount:p(m).toString()})}}),_=j(()=>i("Open share panel")),R=j(()=>i("Open link list in share panel")),A=j(()=>i("Open member list in share panel")),$=j(()=>p(k)>0),L=j(()=>p(m)>0),k=j(()=>Object.keys(p(d).members).length),N=j(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(k),{memberShareCount:p(k).toString()})),z=j(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(m),{linkShareCount:p(m).toString()})),Q=()=>{Ye.publish(yt.setActivePanel,"space-share")};return(J,ae)=>{const re=ge("oc-spinner"),se=ge("oc-icon"),ue=ge("oc-button"),we=ge("portal-target");return Z(),me("div",gL,[pe("div",mL,[p(c).includes(p(d).id)?(Z(),Ie(re,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):y.value?(Z(),me("div",yL,[pe("img",{src:y.value,alt:""},null,8,bL)])):(Z(),Ie(se,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),J.showShareIndicators&&S.value&&!p(d).disabled?(Z(),me("div",vL,[$.value?(Z(),Ie(ue,{key:0,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:Q},{default:Ee(()=>[he(se,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Fe("",!0),L.value?(Z(),Ie(ue,{key:1,appearance:"raw","aria-label":R.value,"no-hover":"",onClick:Q},{default:Ee(()=>[he(se,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Fe("",!0),pe("p",{textContent:W.toDisplayString(E.value)},null,8,wL),he(ue,{appearance:"raw","aria-label":_.value,size:"small","no-hover":"",onClick:Q},{default:Ee(()=>[pe("span",{class:"oc-text-small",textContent:W.toDisplayString(p(i)("Show"))},null,8,SL)]),_:1},8,["aria-label"])])):Fe("",!0),pe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[pe("dt",null,W.toDisplayString(p(i)("Last activity")),1),pe("dd",null,W.toDisplayString(b.value),1),p(d).description?(Z(),me(Qe,{key:0},[pe("dt",null,W.toDisplayString(p(i)("Subtitle")),1),pe("dd",null,W.toDisplayString(p(d).description),1)],64)):Fe("",!0),pe("dt",null,W.toDisplayString(p(i)("Manager")),1),pe("dd",null,W.toDisplayString(h.value),1),p(d).disabled?Fe("",!0):(Z(),me(Qe,{key:1},[pe("dt",null,W.toDisplayString(p(i)("Quota")),1),pe("dd",null,[he(P0,{"space-quota":p(d).spaceQuota},null,8,["space-quota"])])],64)),v.value?(Z(),me(Qe,{key:2},[pe("dt",null,W.toDisplayString(p(i)("Size")),1),pe("dd",null,W.toDisplayString(g.value),1)],64)):Fe("",!0),T.value?(Z(),Ie(F0,{key:3,space:p(d)},null,8,["space"])):Fe("",!0),he(we,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(d),resource:p(d)},multiple:!0},null,8,["slot-props"])],8,EL)])}}}),[["__scopeId","data-v-6de460b8"]]),AL={id:"oc-spaces-details-multiple-sidebar"},RL={class:"spaces-preview oc-mb-l"},_L={class:"spaces-preview-body"},IL=["textContent"],CL=ze($e({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=xe.useGettext(),{$gettext:n,$ngettext:r}=t,o=j(()=>{let d=0;return e.selectedSpaces.forEach(y=>{d+=y.spaceQuota.total}),Sn(d,t.current)}),i=j(()=>{let d=0;return e.selectedSpaces.forEach(y=>{y.disabled||(d+=y.spaceQuota.remaining)}),Sn(d,t.current)}),s=j(()=>{let d=0;return e.selectedSpaces.forEach(y=>{y.disabled||(d+=y.spaceQuota.used)}),Sn(d,t.current)}),a=j(()=>e.selectedSpaces.filter(d=>!d.disabled).length),l=j(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=j(()=>n("Overview of the information about the selected spaces")),c=j(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=j(()=>[{term:n("Total quota:"),definition:p(o).toString()},{term:n("Remaining quota:"),definition:p(i).toString()},{term:n("Used quota:"),definition:p(s).toString()},{term:n("Enabled:"),definition:p(a).toString()},{term:n("Disabled:"),definition:p(l).toString()}]);return(d,y)=>{const w=ge("oc-icon"),m=ge("oc-definition-list");return Z(),me("div",AL,[pe("div",RL,[pe("div",_L,[he(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),pe("p",{class:"preview-text",textContent:W.toDisplayString(c.value)},null,8,IL)])]),he(m,{"aria-label":u.value,items:f.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-11ad741e"]]),PL=$e({name:"SpaceNoSelection"}),FL={class:"oc-mt-xl"},OL={class:"oc-flex space-info oc-text-center"};function xL(e,t,n,r,o,i){const s=ge("oc-icon"),a=sn("translate");return Z(),me("div",FL,[pe("div",OL,[he(s,{name:"layout-grid",size:"xxlarge"}),ot((Z(),me("p",null,t[0]||(t[0]=[Vt("Select a space to view details")]))),[[a]])])])}const kL=ze(PL,[["render",xL]]),NL=$e({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=le(!1);let t;return Mt(()=>{t=Ye.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Un(()=>{Ye.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!rb(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),$L={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},DL={key:0,class:"state-indicator oc-flex oc-flex-middle"},LL=["textContent"],ML={key:1,class:"state-indicator"},BL=["textContent"],jL=["textContent"];function UL(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button");return Z(),me("div",$L,[e.saved?(Z(),me("span",DL,[he(s,{name:"checkbox-circle"}),pe("span",{class:"oc-ml-s",textContent:W.toDisplayString(e.$gettext("Changes saved"))},null,8,LL)])):(Z(),me("span",ML,W.toDisplayString(e.unsavedChangesText),1)),pe("div",null,[he(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=l=>e.$emit("revert"))},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Revert"))},null,8,BL)]),_:1},8,["disabled"]),he(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Save"))},null,8,jL)]),_:1},8,["disabled"])])])}const qL=ze(NL,[["render",UL],["__scopeId","data-v-471483fe"]]),VL=eS(async()=>(await Promise.resolve().then(()=>D2)).default),zL=$e({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ni(),n=Ib(),r=j(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:j(()=>{if(e.extensionPoint.multiple||p(r).length<=1)return p(r);const s=n.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[p(r).find(a=>s.selectedExtensionIds.includes(a.id))||p(r)[0]]:[p(r)[0]]})}}});function WL(e,t,n,r,o,i){return Z(!0),me(Qe,null,Ft(e.extensions,s=>(Z(),Ie(Cr(s.content),{key:`custom-component-${s.id}`}))),128)}const HL=ze(zL,[["render",WL]]),GL=$e({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=We(),o=Jt(),i=le(),s=le([]),a=le(e.items),l=le(null),u=le(null),c=`q_${e.filterName}`,f=rn(c),d=E=>E[e.idAttribute],y=()=>r.push({query:{...ki(p(o).query,[c]),...!!p(s).length&&{[c]:p(s).reduce((E,_)=>(E+=`${d(_)}+`,E),"").slice(0,-1)}}}),w=E=>!!p(s).find(_=>d(_)===d(E)),m=async E=>{w(E)?s.value=p(s).filter(_=>d(_)!==d(E)):(e.allowMultiple||(s.value=[]),s.value.push(E)),await y(),t("selectionChange",p(s))},T=le(),v=(E,_)=>{if(!(_||"").trim())return E;const A=new Jf(E,{...rl,keys:e.filterableAttributes}).search(_).map($=>$.item);return E.filter($=>A.includes($))},g=()=>{s.value=[],t("selectionChange",p(s)),y()},h=E=>{a.value=E},b=async()=>{var E;h(e.items),await jn(),(E=p(i))==null||E.focus()};wt(T,()=>{h(v(e.items,p(T))),p(u)&&(l.value=new ed(p(u)),p(l).unmark(),p(l).mark(p(T),{element:"span",className:"mark-highlight"}))});const S=()=>{const E=Et(p(f));if(E){const _=E.split("+");s.value=e.items.filter(R=>_.includes(d(R)))}};return n({setSelectedItemsBasedOnQuery:S}),Mt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:T,isItemSelected:w,itemFilterListRef:u,queryParam:c,selectedItems:s,setDisplayedItems:h,showDrop:b,toggleItemSelection:m,setSelectedItemsBasedOnQuery:S}}}),KL={ref:"itemFilterListRef"},QL={class:"oc-flex oc-flex-middle oc-text-truncate"},XL={class:"oc-text-truncate oc-ml-s"},YL={class:"oc-flex"};function JL(e,t,n,r,o,i){const s=ge("oc-text-input"),a=ge("oc-checkbox"),l=ge("oc-icon"),u=ge("oc-button"),c=ge("oc-list"),f=ge("oc-filter-chip");return Z(),me("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[he(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Ee(()=>[e.showOptionFilter&&e.filterableAttributes.length?(Z(),Ie(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Fe("",!0),pe("div",KL,[he(c,{class:"item-filter-list"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.displayedItems,(d,y)=>(Z(),me("li",{key:y,class:"oc-my-xs"},[he(u,{class:W.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(d)},{default:Ee(()=>[pe("div",QL,[e.allowMultiple?(Z(),Ie(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=An(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Fe("",!0),pe("div",null,[Ke(e.$slots,"image",{item:d})]),pe("div",XL,[Ke(e.$slots,"item",{item:d})])]),pe("div",YL,[!e.allowMultiple&&e.isItemSelected(d)?(Z(),Ie(l,{key:0,name:"check"})):Fe("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const ZL=ze(GL,[["render",JL]]),e2=$e({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=We(),r=Jt(),o=le(!1),i=`q_${e.filterName}`,s=rn(i),a=()=>n.push({query:{...ki(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),l=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return Mt(()=>{Et(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:l}}});function t2(e,t,n,r,o,i){const s=ge("oc-filter-chip");return Z(),me("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[he(s,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const n2=ze(e2,[["render",t2]]),r2=$e({name:"LoadingIndicator",setup(){const e=cn();let t,n,r;const o=le(e.isLoading),i=le(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return Mt(()=>{t=Ye.subscribe(Or.add,s),n=Ye.subscribe(Or.remove,s),r=Ye.subscribe(Or.setProgress,a)}),Un(()=>{Ye.unsubscribe(Or.add,t),Ye.unsubscribe(Or.remove,n),Ye.unsubscribe(Or.setProgress,r)}),{isLoading:o,currentProgress:i}}}),i2={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function o2(e,t,n,r,o,i){const s=ge("oc-progress");return e.isLoading?(Z(),me("div",i2,[he(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Fe("",!0)}const s2=ze(r2,[["render",o2]]),a2={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},l2={class:"oc-text-muted oc-text-xlarge"},c2={class:"oc-text-muted"},u2=$e({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=ge("oc-icon");return Z(),me("div",a2,[he(r,{name:t.icon,type:"div",size:"xxlarge","fill-type":t.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),pe("div",l2,[Ke(t.$slots,"message")]),pe("div",c2,[Ke(t.$slots,"callToAction")])])}}}),f2=$e({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function d2(e,t,n,r,o,i){const s=ge("oc-pagination");return e.pages>1?(Z(),Ie(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):Fe("",!0)}const p2=ze(f2,[["render",d2]]),h2=$e({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=xe.useGettext(),r=rn("useScope"),o=le(),i=le(),s=j(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=j(()=>[{id:Er.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Er.allFiles,title:n("All files"),enabled:!0}]);return wt(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:c})=>c===Er.currentFolder);return}o.value=p(a).find(({id:c})=>c===Er.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Er.allFiles);return}if(p(i)){o.value=p(a).find(({id:u})=>u===p(i).id);return}o.value=p(a).find(({id:u})=>u===Er.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),g2={key:0},m2={key:0,class:"oc-flex"};function y2(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=ge("oc-filter-chip");return Z(),me("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=An(()=>{},["stop"]))},[e.currentSelection?(Z(),me("div",g2,[he(l,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.locationOptions,(u,c)=>(Z(),Ie(a,{key:c,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-secondary-container":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:f=>e.onOptionSelected(u)},{default:Ee(()=>[pe("span",null,W.toDisplayString(u.title),1),u.id===e.currentSelection.id?(Z(),me("div",m2,[he(s,{name:"check"})])):Fe("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Fe("",!0)])}const b2=ze(h2,[["render",y2]]),v2=$e({name:"PortalTarget",components:{PortalTargetVue:ga.PortalTarget},props:{...ga.PortalTarget.props},setup(e){const t=j(()=>e);return Mt(()=>{Ye.publish(la.mounted,e)}),{properties:t}}});function w2(e,t,n,r,o,i){const s=ge("portal-target-vue");return Z(),Ie(s,W.normalizeProps(Ha(e.properties)),null,16)}const S2=ze(v2,[["render",w2]]),E2=({sortBy:e,sortDir:t})=>({groupingSettings:j(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(r){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(r.name.charAt(0)))?r.name.charAt(0)==="."?r.name.charAt(1).toLowerCase():r.name.charAt(0).toLowerCase():"#"},"Shared on":function(r){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(r.sdate)<i?"Older":Date.parse(r.sdate)>=o?"Recently":"Last month"},"Share owner":function(r){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=r==null?void 0:r.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="name"&&p(t)==="desc"&&o.reverse(),o},"Shared on":function(r){const o=[],i=["Recently","Last month","Older"];for(const s of i){const a=r.find(l=>l.name.toLowerCase()===s.toLowerCase());a&&o.push(a)}return p(e)==="sdate"&&p(t)==="asc"&&o.reverse(),o},"Share owner":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="owner"&&p(t)==="desc"&&o.reverse(),o}}}))}),T2={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},A2={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},R2={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},_2={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},I2={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},C2={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},P2={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},F2={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},O2={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},x2={"fr-FR":T2,"de-DE":A2,"it-IT":R2,"es-ES":_2,"pl-PL":I2,ru:C2,"jp-JP":P2,"id-ID":F2},k2=$e({name:"TextEditor",components:{MdEditor:$o.MdEditor,MdPreview:$o.MdPreview},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=xe.useGettext(),{currentTheme:r}=ii(),o=j(()=>{const{showPreviewOnlyMd:l=!0}=e.applicationConfig;return{showPreviewOnlyMd:l}}),i=j(()=>{var l;return e.markdownMode||["md","markdown"].includes((l=e.resource)==null?void 0:l.extension)||!p(o).showPreviewOnlyMd}),s=j(()=>p(r).isDark?"dark":"light");return $o.config({editorConfig:{languageUserDefined:x2},editorExtensions:{screenfull:{instance:z0},cropper:{instance:W0}},markdownItPlugins(l){return[...l,{type:"xss",plugin:$o.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:O2,onUploadImg:async l=>{const c=(await Promise.all([...l].map(d=>new Promise((y,w)=>{const m=new FileReader;m.onload=()=>y(m.result),m.onerror=w,m.readAsDataURL(d)})))).map(d=>``),f=`${p(e.currentContent)}
|
|
63
|
+
*/function V2(e){return e}const N$={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object};Object.assign({active:{type:Boolean,default:!0}},N$);var $$=Object.defineProperty,v0=Object.getOwnPropertySymbols,D$=Object.prototype.hasOwnProperty,L$=Object.prototype.propertyIsEnumerable,w0=(e,t,n)=>t in e?$$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M$=(e,t)=>{for(var n in t||(t={}))D$.call(t,n)&&w0(e,n,t[n]);if(v0)for(var n of v0(t))L$.call(t,n)&&w0(e,n,t[n]);return e};const S0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},B$={},j$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},U$=pe("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),q$=[U$];function V$(e,t){return Z(),me("svg",j$,q$)}const z$=S0(B$,[["render",V$]]),W$={},H$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},G$=pe("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),K$=[G$];function Q$(e,t){return Z(),me("svg",H$,K$)}M$({},{Deselect:z$,OpenIndicator:S0(W$,[["render",Q$]])});const X$=["aria-label"],Y$=$e({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=j(()=>["oc-spinner",`oc-spinner-${xr(e.size||"medium")}`]);return(n,r)=>(Z(),me("span",{class:W.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,X$))}}),J$={class:"oc-status-indicators oc-flex"},Z$=["id","textContent"],eD=$e({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=xe.useGettext(),n=le({}),r=i=>Object.hasOwn(i,"handler"),o=i=>i.accessibleDescription?(p(n)[i.id]||(p(n)[i.id]=Fb("oc-indicator-description-")),p(n)[i.id]):null;return(i,s)=>{const a=sn("oc-tooltip");return Z(),me("div",J$,[(Z(!0),me(Qe,null,Ft(i.indicators,(l,u)=>(Z(),me(Qe,null,[r(l)&&!i.disableHandler?ot((Z(),Ie(a0,{id:l.id,key:`${l.id}-handler`,class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),"aria-label":p(t)(l.label),"aria-describedby":o(l),appearance:"raw","data-testid":l.id,"data-test-indicator-type":l.type,"no-hover":"",onClick:c=>l.handler(i.resource)},{default:Ee(()=>[he(s0,{name:l.icon,size:"small","fill-type":l.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","onClick"])),[[a,p(t)(l.label)]]):ot((Z(),Ie(s0,{id:l.id,key:l.id,tabindex:"-1",size:"small",class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),name:l.icon,"fill-type":l.fillType,"accessible-label":p(t)(l.label),"aria-describedby":o(l),"data-testid":l.id,"data-test-indicator-type":l.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,p(t)(l.label)]]),o(l)?(Z(),me("p",{id:o(l),key:o(l),class:"oc-invisible-sr",textContent:W.toDisplayString(p(t)(l.accessibleDescription))},null,8,Z$)):Fe("",!0)],64))),256))])}}}),tD={class:"oc-thead"},nD=$e({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(Z(),me("thead",tD,[Ke(t.$slots,"default")]))}}),rD=$e({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(Z(),me("tbody",null,[Ke(t.$slots,"default")]))}}),E0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:le(!0)};const i=le(!1),s=new IntersectionObserver(a=>{const l=a.at(-1).isIntersecting;i.value=l,p(i)&&r&&r(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:n});return wt(e,()=>{s.observe(e.value)}),Un(()=>s.disconnect()),{isVisible:i}},T0=$e({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t,r=j(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(Z(),Ie(Cr(o.type),{class:W.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Ee(()=>[Ke(o.$slots,"default")]),_:3},8,["class"]))}}),A0=$e({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(Z(),Ie(T0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Ee(()=>[Ke(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),R0=$e({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Ad((a,l)=>{let u;return{get(){return a(),u},set(c){u=c,l()}}}),o=j(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?E0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},s=j(()=>!p(i));return e.lazy||n("itemVisible"),(a,l)=>(Z(),me("tr",{ref_key:"observerTarget",ref:r,onClick:l[0]||(l[0]=u=>a.$emit("click",u)),onContextmenu:l[1]||(l[1]=u=>a.$emit("contextmenu",u)),onDragstart:l[2]||(l[2]=u=>a.$emit("dragstart",u)),onDrop:l[3]||(l[3]=u=>a.$emit("drop",u)),onDragenter:l[4]||(l[4]=u=>a.$emit("dragenter",u)),onDragleave:l[5]||(l[5]=u=>a.$emit("dragleave",u)),onDragover:l[6]||(l[6]=u=>a.$emit("dragover",u)),onMouseleave:l[7]||(l[7]=u=>a.$emit("mouseleave",u))},[s.value?(Z(),Ie(A0,{key:0,colspan:o.value},{default:Ee(()=>l[8]||(l[8]=[pe("span",{class:"shimmer"},null,-1)])),_:1},8,["colspan"])):Ke(a.$slots,"default",{key:1})],544))}}),iD=$e({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(Z(),Ie(T0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Ee(()=>[Ke(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),oD={key:0,class:"oc-table-thead-content"},sD=["textContent"],aD={key:1},lD={key:0,class:"oc-table-thead-content"},cD=["textContent"],uD={key:1,class:"oc-table-footer"},fD={class:"oc-table-footer-row"},dD=["colspan"],_0="asc",Kf="desc",pD=$e({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:$P,EVENT_TROW_CLICKED:DP,EVENT_TROW_MOUNTED:LP,EVENT_TROW_CONTEXTMENU:MP},{$gettext:o}=xe.useGettext(),i=L=>e.itemDomSelector?e.itemDomSelector(L):L[e.idKey],s=j(()=>{const L=["oc-table"];return e.hover&&L.push("oc-table-hover"),e.sticky&&L.push("oc-table-sticky"),L}),a=j(()=>e.fields.length),l=L=>{L.preventDefault()},u=(L,k)=>{n(BP,L,k)},c=(L,k)=>{n(Cb,L,k)},f=(L,k,N)=>{n("dropRowStyling",L,k,N)},d=L=>L.type==="slot",y=L=>["callback","function"].indexOf(L.type)>=0,w=L=>Object.prototype.hasOwnProperty.call(L,"title")?L.title:L.name,m=()=>({class:s.value}),T=(L,k)=>{const N=h(L);return N.class=`oc-table-header-cell oc-table-header-cell-${L.name}`,Object.prototype.hasOwnProperty.call(L,"thClass")&&(N.class+=` ${L.thClass}`),e.sticky&&(N.style=`top: ${e.headerPosition}px;`),k===0&&(N.class+=` oc-pl-${xr(e.paddingX)} `),k===e.fields.length-1&&(N.class+=` oc-pr-${xr(e.paddingX)}`),R(N,L),N},v=(L,k)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(L)||k}`,b(L)?"oc-table-highlighted":void 0,S(L)?"oc-table-disabled":void 0].filter(Boolean)}),g=(L,k,N)=>{const z=h(L);return z.class=`oc-table-data-cell oc-table-data-cell-${L.name}`,Object.prototype.hasOwnProperty.call(L,"tdClass")&&(z.class+=` ${L.tdClass}`),Object.prototype.hasOwnProperty.call(L,"wrap")&&(z.wrap=L.wrap),k===0&&(z.class+=` oc-pl-${xr(e.paddingX)} `),k===e.fields.length-1&&(z.class+=` oc-pr-${xr(e.paddingX)}`),Object.prototype.hasOwnProperty.call(L,"accessibleLabelCallback")&&(z["aria-label"]=L.accessibleLabelCallback(N)),z},h=L=>({...(L==null?void 0:L.alignH)&&{alignH:L.alignH},...(L==null?void 0:L.alignV)&&{alignV:L.alignV},...(L==null?void 0:L.width)&&{width:L.width},class:void 0,wrap:void 0,style:void 0}),b=L=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(L[e.idKey])>-1:e.highlighted===L[e.idKey]:!1,S=L=>e.disabled.length?e.disabled.indexOf(L[e.idKey])>-1:!1,E=(L,k,N)=>{const z=[N[e.idKey],k+1].filter(Boolean);return d(L)?[...z,L.name].join("-"):y(L)?[...z,L.callback(N[L.name])].join("-"):[...z,N[L.name]].join("-")},_=L=>o("Sort by %{ name }",{name:L}),R=(L,k)=>{if(!A(k))return;let N="none";e.sortBy===k.name&&(N=e.sortDir===_0?"ascending":"descending"),L["aria-sort"]=N},A=({sortable:L})=>!!L,$=L=>{if(!A(L))return;let k=e.sortDir;e.sortBy===L.name&&e.sortDir!==void 0&&(k=e.sortDir===Kf?_0:Kf),(e.sortBy!==L.name||e.sortDir===void 0)&&(k=L.sortDir||Kf),n("sort",{sortBy:L.name,sortDir:k})};return(L,k)=>{const N=ge("oc-icon");return Z(),me("table",zt(m(),{class:"has-item-context-menu"}),[L.hasHeader?(Z(),Ie(nD,{key:0},{default:Ee(()=>[he(R0,{class:"oc-table-header-row"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(L.fields,(z,Q)=>(Z(),Ie(iD,zt({key:`oc-thead-${z.name}`,ref_for:!0},T(z,Q)),{default:Ee(()=>[z.sortable?(Z(),Ie(a0,{key:0,"aria-label":_(z.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:J=>$(z)},{default:Ee(()=>[z.headerType==="slot"?(Z(),me("span",oD,[Ke(L.$slots,z.name+"Header")])):(Z(),me("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(z))},null,8,sD)),he(N,{name:L.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:W.normalizeClass([{"oc-invisible-sr":L.sortBy!==z.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(Z(),me("div",aD,[z.headerType==="slot"?(Z(),me("span",lD,[Ke(L.$slots,z.name+"Header")])):(Z(),me("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(z))},null,8,cD))]))]),_:2},1040))),128))]),_:3})]),_:3})):Fe("",!0),he(rD,{class:"has-item-context-menu"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(L.data,(z,Q)=>(Z(),Ie(R0,zt({key:`oc-tbody-tr-${i(z)||Q}`,ref_for:!0,ref:`row-${Q}`},v(z,Q),{"data-item-id":z[L.idKey],draggable:L.dragDrop,onClick:J=>L.$emit(r.EVENT_TROW_CLICKED,[z,J]),onContextmenu:J=>L.$emit(r.EVENT_TROW_CONTEXTMENU,L.$refs[`row-${Q}`][0],J,z),onVnodeMounted:J=>L.$emit(r.EVENT_TROW_MOUNTED,z,L.$refs[`row-${Q}`][0]),onDragstart:J=>u(z,J),onDrop:J=>c(i(z),J),onDragenter:An(J=>f(i(z),!1,J),["prevent"]),onDragleave:An(J=>f(i(z),!0,J),["prevent"]),onMouseleave:J=>f(i(z),!0,J),onDragover:k[0]||(k[0]=J=>l(J)),onItemVisible:J=>L.$emit("itemVisible",z)}),{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(L.fields,(J,ae)=>(Z(),Ie(A0,zt({key:"oc-tbody-td-"+E(J,ae,z),ref_for:!0},g(J,ae,z)),{default:Ee(()=>[d(J)?Ke(L.$slots,J.name,{key:0,item:z}):y(J)?(Z(),me(Qe,{key:1},[Vt(W.toDisplayString(J.callback(z[J.name])),1)],64)):(Z(),me(Qe,{key:2},[Vt(W.toDisplayString(z[J.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),L.$slots.footer?(Z(),me("tfoot",uD,[pe("tr",fD,[pe("td",{colspan:a.value,class:"oc-table-footer-cell"},[Ke(L.$slots,"footer")],8,dD)])])):Fe("",!0)],16)}}}),I0=$e({__name:"ResourceStatusIndicators",props:{space:{},resource:{},filter:{type:Function}},setup(e){const t=Kd(),n=vt(),r=Xe(),o=j(()=>{const i=Tb({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user});return e.filter?i.filter(e.filter):i});return(i,s)=>o.value.length>0?(Z(),Ie(p(eD),zt({key:0},p(t),{indicators:o.value}),null,16,["indicators"])):Fe("",!0)}}),hD=850,gD=$e({components:{ContextMenuQuickAction:Vf,ResourceGhostElement:zf,ResourceListItem:Co,ResourceSize:i0,ResourceStatusIndicators:I0,OcSpinner:Y$,OcTable:pD},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Kt.defaultModeName,validator:e=>[Kt.name.condensedTable,Kt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Bt.Asc.toString(),Bt.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Ff,"update:selectedIds","update:modelValue"],setup(e,t){const n=We(),r=nn(),{getMatchingSpace:o}=ln(),{canBeOpenedWithSecureView:i}=Lf(),s=si({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)}),{isSticky:a}=Nf(),{$gettext:l}=xe.useGettext(),{isLocationPicker:u,isFilePicker:c,postMessage:f,isEnabled:d,fileTypes:y}=ri(),{getDefaultAction:w}=zn(),m=at(),{options:T}=Ge.storeToRefs(m),v=Eo(),{resources:g,action:h}=Ge.storeToRefs(v),b=Yr(),{userContextReady:S}=Ge.storeToRefs(b),E=Xe(),{areFileExtensionsShown:_,latestSelectedId:R,deleteQueue:A}=Ge.storeToRefs(E),$=le(),L=le(),k=le(),{width:N}=jr.useWindowSize(),z=j(()=>r.filesTags&&N.value>=hD),{actions:Q}=ra(),{actions:J}=Lv(),ae=j(()=>p(Q)[0].handler),re=j(()=>p(J)[0].handler),se=I=>l("Search for tag %{tag}",{tag:I}),ue=I=>{var F;return p(d)&&((F=p(y))!=null&&F.length)?!p(y).includes(I.extension)&&!p(y).includes(I.mimeType)&&!I.isFolder:I.processing===!0||H(I.id)},we=j(()=>{var I,F;return((F=(I=e.resources)==null?void 0:I.filter(G=>ue(G)===!0))==null?void 0:F.map(G=>G.id))||[]}),ee=I=>!e.areResourcesClickable||te.isProjectSpaceResource(I)&&I.disabled||!I.isFolder&&(!I.canDownload()&&!i(I)||p(d)&&!p(c))?!1:!p(we).includes(I.id),ie=I=>{Ye.publish("app.files.list.clicked"),t.emit("update:selectedIds",I)},ce=I=>{E.toggleSelection(I),ie(E.selectedIds)},Ce=I=>{if(I.isFolder)return s.getFolderLink(I);let F=e.space;F||(F=o(I));const G=w({resources:[I],space:F});if(G!=null&&G.route)return G.route({space:F,resources:[I]})},H=I=>p(A).includes(I);return{router:n,configOptions:T,dragItem:$,ghostElement:L,contextMenuButton:k,getTagToolTip:se,renameActions:Q,renameActionsSpace:J,renameHandler:ae,renameHandlerSpace:re,FolderViewModeConstants:Kt,hasTags:z,disabledResources:we,isResourceDisabled:ue,userContextReady:S,getMatchingSpace:o,clipboardResources:g,clipboardAction:h,...aa({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},t),...s,postMessage:f,isFilePicker:c,isLocationPicker:u,isEmbedModeEnabled:d,emitSelect:ie,toggleSelection:ce,areFileExtensionsShown:_,latestSelectedId:R,isResourceClickable:ee,getResourceLink:Ce,isSticky:a,isResourceInDeleteQueue:H}},data(){return{constants:{ImageDimension:Wn,EVENT_TROW_MOUNTED:wv}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const n=bh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"status",prop:"disabled",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.mdate)+" ("+this.formatDate(r.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.sdate)+" ("+this.formatDate(r.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.ddate)+" ("+this.formatDate(r.ddate)+")"}].filter(r=>{if(r.name==="tags"&&!this.hasTags)return!1;if(r.name==="indicators")return!0;let o;return r.prop?o=Il(e,r.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,r.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(r.name):o}).map(r=>{const o=n.find(i=>i.name===r.name);return o&&Object.assign(r,{sortable:o.sortable,sortDir:o.sortDir}),r})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ti.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var n;const t=(n=p(this.router.currentRoute).query)==null?void 0:n.term;return Ti("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return te.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length},openRenameDialog(e){if(te.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Ye.publish(yt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Ye.publish(yt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Ff,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,n){var s,a;if((((s=n.dataTransfer)==null?void 0:s.types)||[]).some(l=>l==="Files")||(a=n.currentTarget)!=null&&a.contains(n.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:n,event:r}=e;(n==null?void 0:n.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),wo(n.tippy,r,this.contextMenuButton))},showContextMenu(e,t,n){if(t.preventDefault(),this.isResourceDisabled(n))return!1;const r=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];r!==void 0&&(this.isResourceSelected(n)||this.emitSelect([n.id]),wo(r._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,a;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(Ks(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1,o=(n==null?void 0:n.target).getAttribute("type")==="checkbox";if(((a=(s=n==null?void 0:n.target)==null?void 0:s.closest("div"))==null?void 0:a.id)!=="oc-files-context-menu"){if(n&&n.metaKey)return Ye.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Ye.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return mb(new Date(e),this.$language.current)},formatDateRelative(e){return bb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!te.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),n=e.sharedWith.filter(({shareType:r})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(r))).length;return n?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",n,{resourceType:t,shareCount:n.toString()}):""},getSharedByAvatarDescription(e){if(!te.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:n})=>n).join(", ")})},getSharedByAvatarItems(e){return te.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,shareType:te.ShareTypes.user.value,username:t.id})):[]},getSharedWithAvatarItems(e){return te.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,shareType:t.shareType,username:t.id})):[]}}}),mD={class:"resource-table-select-all"},yD={class:"oc-text-truncate"},bD=["textContent"],vD=["textContent"],wD=["textContent"],SD={key:0,class:"resource-table-actions"};function ED(e,t,n,r,o,i){const s=ge("oc-checkbox"),a=ge("oc-spinner"),l=ge("resource-list-item"),u=ge("oc-icon"),c=ge("oc-button"),f=ge("resource-size"),d=ge("oc-tag"),y=ge("resource-status-indicators"),w=ge("oc-avatars"),m=ge("context-menu-quick-action"),T=ge("oc-table"),v=ge("resource-ghost-element"),g=sn("oc-tooltip");return Z(),me(Qe,null,[he(T,zt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&e.isSideBarOpen,"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&e.isSideBarOpen}],data:e.resources,fields:e.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=h=>e.$emit("update:modelValue",h))}),Hd({name:Ee(({item:h})=>[pe("div",{class:W.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[Ke(e.$slots,"image",{resource:h}),(Z(),Ie(l,{key:`${h.path}-${e.resourceDomSelector(h)}-${h.thumbnail}`,resource:h,"path-prefix":e.getPathPrefix(h),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(h),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(h),link:e.getResourceLink(h),"parent-folder-link":e.getParentFolderLink(h),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(h),class:W.normalizeClass({"resource-table-resource-cut":e.isResourceCut(h)}),onClick:b=>e.emitFileClick(h)},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),e.hasRenameAction(h)?(Z(),Ie(c,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:b=>e.openRenameDialog(h)},{default:Ee(()=>[he(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Fe("",!0)],2),Ke(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Ee(({item:h})=>[Ke(e.$slots,"syncEnabled",{resource:h})]),size:Ee(({item:h})=>[he(f,{size:h.size||Number.NaN},null,8,["size"])]),tags:Ee(({item:h})=>[(Z(!0),me(Qe,null,Ft(h.tags.slice(0,2),b=>(Z(),Ie(Cr(e.userContextReady?"router-link":"span"),zt({key:b,ref_for:!0},e.getTagComponentAttrs(b),{class:"resource-table-tag-wrapper"}),{default:Ee(()=>[ot((Z(),Ie(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Ee(()=>[he(u,{name:"price-tag-3",size:"small"}),pe("span",yD,W.toDisplayString(b),1)]),_:2},1024)),[[g,e.getTagToolTip(b)]])]),_:2},1040))),128)),h.tags.length>2?(Z(),Ie(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Ee(()=>[Vt(" + "+W.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Fe("",!0)]),manager:Ee(({item:h})=>[Ke(e.$slots,"manager",{resource:h})]),members:Ee(({item:h})=>[Ke(e.$slots,"members",{resource:h})]),totalQuota:Ee(({item:h})=>[Ke(e.$slots,"totalQuota",{resource:h})]),usedQuota:Ee(({item:h})=>[Ke(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Ee(({item:h})=>[Ke(e.$slots,"remainingQuota",{resource:h})]),mdate:Ee(({item:h})=>[ot(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.mdate))},null,8,bD),[[g,e.formatDate(h.mdate)]])]),indicators:Ee(({item:h})=>[he(y,{space:e.space,resource:h,"disable-handler":e.isResourceDisabled(h)},null,8,["space","resource","disable-handler"])]),status:Ee(({item:h})=>[ot(he(u,{name:h.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[g,h.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Ee(({item:h})=>[ot(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.sdate))},null,8,vD),[[g,e.formatDate(h.sdate)]])]),ddate:Ee(({item:h})=>[ot(pe("p",{tabindex:"0",class:"oc-m-rm",textContent:W.toDisplayString(e.formatDateRelative(h.ddate))},null,8,wD),[[g,e.formatDate(h.ddate)]])]),sharedBy:Ee(({item:h})=>[he(c,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:b=>e.openSharingSidebar(h)},{default:Ee(()=>[he(w,{class:"resource-table-people",items:e.getSharedByAvatarItems(h),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Ee(({item:h})=>[he(c,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:b=>e.openSharingSidebar(h)},{default:Ee(()=>[he(w,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Ee(({item:h})=>[e.isResourceDisabled(h)?Fe("",!0):(Z(),me("div",SD,[Ke(e.$slots,"quickActions",{resource:h}),he(m,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:b=>e.showContextMenuOnBtnClick(b,h)},{contextMenu:Ee(()=>[Ke(e.$slots,"contextMenu",{resource:h})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Ee(()=>[pe("div",mD,[ot(he(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:An(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[g,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Ee(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(Z(),Ie(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(Z(),Ie(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(h)}`,label:e.getResourceCheckboxLabel(h),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(h),"model-value":e.isResourceSelected(h),outline:e.isLatestSelectedItem(h),onClick:An(b=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Ee(()=>[Ke(e.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(Z(),Ie(Bd,{key:0,to:"body"},[he(v,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Fe("",!0)],64)}const TD=ze(gD,[["render",ED]]),AD=["data-item-id"],RD={key:0,class:"oc-tile-card-lazy-shimmer"},_D={class:"oc-tile-card-selection"},ID={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},CD=["textContent"],PD=["aria-label"],FD={class:"oc-card-body oc-p-s"},OD={class:"oc-flex oc-flex-between oc-flex-middle"},xD={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},kD={class:"oc-flex oc-flex-middle"},ND={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},$D=["textContent"],C0=$e({__name:"ResourceTile",props:{resource:{},resourceRoute:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const n=t,{$gettext:r}=xe.useGettext(),o=Ad((f,d)=>{let y;return{get(){return f(),y},set(w){y=w,d()}}}),i=j(()=>e.resource.locked||e.resource.processing),s=j(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=j(()=>e.resource.locked?r("This item is locked"):null),l=j(()=>te.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?E0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},c=j(()=>!p(u));return e.lazy||n("itemVisible"),(f,d)=>{const y=ge("oc-spinner"),w=ge("oc-tag"),m=ge("oc-image"),T=ge("oc-icon"),v=sn("oc-tooltip");return Z(),me("div",{ref_key:"observerTarget",ref:o,class:W.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":f.isResourceSelected,"oc-tile-card-disabled":f.isResourceDisabled&&!p(te.isProjectSpaceResource)(f.resource),"state-trashed":f.isResourceDisabled&&p(te.isProjectSpaceResource)(f.resource)}]),"data-item-id":f.resource.id,onContextmenu:d[2]||(d[2]=g=>f.$emit("contextmenu",g))},[c.value?(Z(),me("div",RD)):(Z(),me(Qe,{key:1},[he(Of,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:f.resource,link:f.resourceRoute,"is-resource-clickable":f.isResourceClickable,tabindex:"-1",onClick:d[0]||(d[0]=g=>f.$emit("click"))},{default:Ee(()=>[pe("div",_D,[f.isLoading?(Z(),me("div",ID,[he(y,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):Ke(f.$slots,"selection",{key:1,item:f.resource})]),f.isResourceDisabled&&p(te.isProjectSpaceResource)(f.resource)?(Z(),Ie(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(p(r)("Disabled"))},null,8,CD)]),_:1})):Fe("",!0),ot((Z(),me("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[Ke(f.$slots,"imageField",{item:f.resource},()=>[f.resource.thumbnail?(Z(),Ie(m,{key:0,class:"tile-preview",src:f.resource.thumbnail},null,8,["src"])):(Z(),Ie(Io,{key:1,resource:f.resource,size:f.resourceIconSize,class:"tile-default-image oc-pt-xs"},Hd({_:2},[i.value?{name:"status",fn:Ee(()=>[he(T,zt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,PD)),[[v,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),pe("div",FD,[pe("div",OD,[pe("div",xD,[he(Co,{resource:f.resource,"is-icon-displayed":!1,"is-extension-displayed":f.isExtensionDisplayed,"is-resource-clickable":f.isResourceClickable,link:f.resourceRoute,onClick:d[1]||(d[1]=g=>f.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),pe("div",kD,[Ke(f.$slots,"indicators",{item:f.resource,class:"resource-indicators"}),Ke(f.$slots,"actions",{item:f.resource}),Ke(f.$slots,"contextMenu",{item:f.resource})])]),l.value?(Z(),me("p",ND,[pe("small",{textContent:W.toDisplayString(l.value)},null,8,$D)])):Fe("",!0)])],64))],42,AD)}}}),DD={id:"tiles-view",class:"oc-px-m oc-pt-l"},LD={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},MD={key:0,class:"oc-tiles-sort"},BD={key:0,class:"oc-flex"},jD={class:"oc-tiles-footer"},UD=$e({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Kt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=xe.useGettext(),o=We(),i=Xe(),{getDefaultAction:s}=zn(),{getMatchingSpace:a}=ln(),{canBeOpenedWithSecureView:l}=Lf(),{isEnabled:u,fileTypes:c,isLocationPicker:f,isFilePicker:d,postMessage:y}=ri(),w=Mf(),m=j(()=>Math.min(p(w),e.viewSize)),T=j(()=>i.areFileExtensionsShown),v=j(()=>p(_e)?r("Clear selection"):r("Select all")),g=le(),h=le(),b=le({tiles:{},dropBtns:{}}),S=aa({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},{emit:n}),E=Y=>{if(te.isSpaceResource(Y))return Y.disabled?null:On("files-spaces-generic",Jn(Y,{path:"",fileId:Y.fileId}));if(Y.isFolder)return S.createFolderLink({path:Y.path,fileId:Y.fileId,resource:Y});let Ne=e.space;Ne||(Ne=a(Y));const Be=s({resources:[Y],space:Ne});return Be!=null&&Be.route?Be.route({space:Ne,resources:[Y]}):null},_=Y=>{if(p(u)&&p(d))return y("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(Y)),locationQuery:JSON.parse(JSON.stringify(Ks(p(o.currentRoute))))});Y.type!=="space"&&Y.type!=="folder"&&S.createFileAction(Y)},R=(Y,Ne,Be)=>{const{dropdown:qe,event:et}=Y;(qe==null?void 0:qe.tippy)!==void 0&&(i.setSelection([Ne.id]),wo(qe.tippy,et,p(b).dropBtns[Be]))},A=Y=>e.selectedIds.includes(Y.id),$=j(()=>e.resources.filter(Y=>e.selectedIds.includes(Y.id))),L=Y=>k(Y)||N(Y)?!1:Y.isFolder?!0:!(!Y.canDownload()&&!l(Y)||p(u)&&!p(d)),k=Y=>{var Ne;return p(u)&&((Ne=p(c))!=null&&Ne.length)?!p(c).includes(Y.extension)&&!p(c).includes(Y.mimeType)&&!Y.isFolder:je(Y.id)?!0:Y.processing===!0},N=Y=>k(Y)?!0:te.isSpaceResource(Y)&&Y.disabled,z=j(()=>{var Y,Ne;return((Ne=(Y=e.resources)==null?void 0:Y.filter(Be=>k(Be)===!0))==null?void 0:Ne.map(Be=>Be.id))||[]}),Q=Y=>{n("update:selectedIds",Y)},J=()=>{if(p(_e))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(Y=>!p(z).includes(Y.id)).map(Y=>Y.id))},ae=(Y,Ne,Be)=>{var et;Y.preventDefault();const qe=(et=p(b).tiles[Ne.id])==null?void 0:et.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];qe!==void 0&&(A(Ne)||Q([Ne.id]),wo(qe._tippy,Y,Be))},re=Y=>{const Ne=Y[0],Be=Y[1];if(Be&&Be.metaKey)return Ye.publish("app.files.list.clicked.meta",Ne);if(Be&&Be.shiftKey)return Ye.publish("app.files.list.clicked.shift",{resource:Ne,skipTargetSelection:!1});se(Ne)},se=Y=>{const Ne=A(Y)?e.selectedIds.filter(Be=>Be!==Y.id):[...e.selectedIds,Y.id];n("update:selectedIds",Ne)},ue=Y=>{switch(Y.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},we=j(()=>e.sortFields.find(Y=>Y.name===e.sortBy&&Y.sortDir===e.sortDir)||e.sortFields[0]),ee=Y=>{n("sort",{sortBy:Y.name,sortDir:Y.sortDir})},ie=j(()=>{const Y={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Ne=p(m);return Y[Ne]??"xxlarge"});rS(()=>{b.value={tiles:{},dropBtns:{}}});const ce=(Y,Ne,Be)=>{var Pt,ct;if((((Pt=Be.dataTransfer)==null?void 0:Pt.types)||[]).some(en=>en==="Files")||(ct=Be.currentTarget)!=null&&ct.contains(Be.relatedTarget)||e.selectedIds.includes(Y.id)||Y.type!=="folder")return;const et=p(b).tiles[Y.id];if(Ne){et.$el.classList.remove("oc-tiles-item-drop-highlight");return}et.$el.classList.add("oc-tiles-item-drop-highlight")},Ce=j(()=>e.selectedIds.filter(Y=>Y!==p(g).id)),H=async(Y,Ne)=>{g.value=Y,await jn(),p(h).$el.ariaHidden="true",p(h).$el.style.left="-99999px",p(h).$el.style.top="-99999px",Ne.dataTransfer.setDragImage(p(h).$el,0,0),Ne.dataTransfer.dropEffect="move",Ne.dataTransfer.effectAllowed="move"},I=async(Y,Ne)=>{A(Y)||se(Y),await H(Y,Ne)},F=(Y,Ne)=>{(Ne.dataTransfer.types||[]).some(qe=>qe==="Files")||(g.value=null,ce(Y,!0,Ne),n("fileDropped",Y.id))},G=le(0),V=()=>{const Y=document.getElementById("tiles-view"),Ne=getComputedStyle(Y),Be=parseInt(Ne.getPropertyValue("padding-left"),10)|0,qe=parseInt(Ne.getPropertyValue("padding-right"),10)|0;G.value=Y.clientWidth-Be-qe},M=j(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:q}=Wv(),fe=j(()=>{const Y=[...Array(Kt.tilesSizeMax).keys()].map(Ne=>Ne+1);return[...new Set(Y.map(Ne=>{const Be=q(Ne);return Be?Math.round(p(G)/(Be+p(M))):0}))]}),Ae=j(()=>{const Y=p(fe);return Y.length<p(m)?Y[Y.length-1]:Y[p(m)-1]}),Le=j(()=>{const Y=p(Ae)?e.resources.length%p(Ae):0;return Y?p(Ae)-Y:0}),ke=j(()=>p(G)/p(Ae)-p(M)),_e=j(()=>{const Y=p(z).length===e.resources.length,Ne=p($).length===e.resources.length-p(z).length;return!Y&&Ne}),je=Y=>i.deleteQueue.includes(Y);return wt(ke,Y=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${Y}px`)},{immediate:!0}),wt(fe,Y=>{w.value=Math.max(Y.length,1)}),Mt(()=>{window.addEventListener("resize",V),V()}),Un(()=>{window.removeEventListener("resize",V)}),(Y,Ne)=>{const Be=ge("oc-checkbox"),qe=ge("oc-icon"),et=ge("oc-button"),Pt=ge("oc-filter-chip"),ct=ge("oc-list"),en=sn("oc-tooltip");return Z(),me("div",DD,[pe("div",LD,[ot(he(Be,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:v.value,"label-hidden":!0,disabled:Y.resources.length===z.value.length,"model-value":_e.value,onClick:An(J,["stop"])},null,8,["label","disabled","model-value"]),[[en,v.value]]),Y.sortFields.length?(Z(),me("div",MD,[he(Pt,{class:"oc-tiles-sort-filter-chip","filter-label":we.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(Y.sortFields,(Me,He)=>(Z(),Ie(et,{key:He,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"oc-tiles-sort-filter-chip-item-active":we.value===Me,"oc-mt-xs":He>0}]),onClick:Mn=>ee(Me)},{default:Ee(()=>[pe("span",null,W.toDisplayString(Me.label),1),Me===we.value?(Z(),me("div",BD,[he(qe,{name:"check"})])):Fe("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Fe("",!0)]),he(ct,{class:"oc-tiles"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(Y.resources,Me=>(Z(),me("li",{key:Me.id,class:"oc-tiles-item has-item-context-menu"},[he(C0,{ref_for:!0,ref:He=>b.value.tiles[Me.id]=He,resource:Me,"resource-route":E(Me),"is-resource-selected":A(Me),"is-resource-clickable":L(Me),"is-resource-disabled":k(Me)||N(Me),"is-extension-displayed":T.value,"resource-icon-size":ie.value,draggable:Y.dragDrop,lazy:Y.lazy,"is-loading":je(Me.id),onVnodeMounted:He=>Y.$emit("rowMounted",Me,b.value.tiles[Me.id],p(Wn).Tile),onContextmenu:He=>ae(He,Me,b.value.tiles[Me.id]),onClick:He=>_(Me),onDragstart:He=>I(Me,He),onDragenter:An(He=>ce(Me,!1,He),["prevent"]),onDragleave:An(He=>ce(Me,!0,He),["prevent"]),onDrop:He=>F(Me,He),onDragover:Ne[0]||(Ne[0]=He=>He.preventDefault()),onItemVisible:He=>Y.$emit("itemVisible",Me)},{selection:Ee(()=>[!p(f)&&!p(d)?(Z(),Ie(Be,{key:0,label:ue(Me),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:k(Me),"model-value":A(Me),onClick:An(He=>re([Me,He]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Fe("",!0)]),imageField:Ee(()=>[Ke(Y.$slots,"image",{resource:Me})]),indicators:Ee(()=>[he(I0,{space:Y.space,resource:Me,filter:He=>He.category==="system","disable-handler":k(Me)},null,8,["space","resource","filter","disable-handler"])]),actions:Ee(()=>[Ke(Y.$slots,"actions",{resource:Me})]),contextMenu:Ee(()=>[p(te.isSpaceResource)(Me)||!k(Me)?(Z(),Ie(p(Vf),{key:0,ref_for:!0,ref:He=>b.value.dropBtns[Me.id]=He,item:Me,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:He=>R(He,Me,Me.id)},{contextMenu:Ee(()=>[Ke(Y.$slots,"contextMenu",{resource:Me})]),_:2},1032,["item","onQuickActionClicked"])):Fe("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","is-loading","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(Z(!0),me(Qe,null,Ft(Le.value,Me=>(Z(),me("li",{key:`ghost-tile-${Me}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(Z(),Ie(Bd,{key:0,to:"body"},[he(zf,{ref_key:"ghostElementRef",ref:h,"preview-items":[g.value,...Ce.value]},null,8,["preview-items"])])):Fe("",!0),pe("div",jD,[Ke(Y.$slots,"footer")])])}}}),qD=$e({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=We(),{current:o}=xe.useGettext(),i=Jt(),s=le(),a=le(e.items),l=le(),u=le(),c=le(!1),f=le(),d=`q_${e.filterName}`,y=rn(d),w=k=>k[e.idAttribute],m=()=>r.push({query:{...ki(p(i).query,[d]),...p(s)&&{[d]:w(p(s))}}}),T=k=>p(s)&&w(p(s))===w(k),v=()=>{l.value=void 0,u.value=void 0},g=async k=>{v(),T(k)?s.value=void 0:(s.value=k,p(f).hideDrop()),await m(),t("selectionChange",p(s))},h=()=>{s.value=void 0,c.value=!1,v(),t("selectionChange",p(s)),m()},b=()=>{a.value=e.items},S=()=>{c.value=!1},E=()=>{const k=Et(p(y));if(!k)return;const N=e.items.find(z=>w(z)===k);if(N){s.value=N;return}if(p(_)){const z=k.replace("range:",""),Q=Number(z.split(" - ")[0]),J=Number(z.split(" - ")[1]);l.value=Dt.DateTime.fromMillis(Q),u.value=Dt.DateTime.fromMillis(J),s.value=p(A)}},_=j(()=>{var k;return(k=Et(p(y)))==null?void 0:k.startsWith("range:")}),R=j(()=>!p(l)||!p(u)?!1:p(l)<=p(u)),A=j(()=>{if(!p(l)||!p(u))return null;const k=ni(p(l),o,Dt.DateTime.DATE_SHORT),N=ni(p(u),o,Dt.DateTime.DATE_SHORT),z=p(l).toMillis(),Q=p(u).toMillis();return{[e.idAttribute]:`range:${z} - ${Q}`,[e.displayNameAttribute]:`${k} - ${N}`}}),$=async()=>{s.value=p(A),await m(),p(f).hideDrop(),t("selectionChange",p(s))},L=({date:k,error:N},z)=>{if(N){console.error("date could not be set");return}const Q=z==="from"?l:u;if(!k){Q.value=void 0;return}const J=z==="from"?k.startOf("day"):k.endOf("day");Q.value=J};return n({setSelectedItemsBasedOnQuery:E}),Mt(()=>{E()}),{clearFilter:h,displayedItems:a,isItemSelected:T,selectedItem:s,onShowDrop:b,onHideDrop:S,filterChip:f,toggleItemSelection:g,setSelectedItemsBasedOnQuery:E,fromDate:l,toDate:u,dateRangeValid:R,applyDateRangeFilter:$,dateRangeApplied:_,setDateRangeDate:L,dateRangeClicked:c,queryParam:d}}}),VD={class:"oc-flex oc-flex-middle oc-text-truncate"},zD={class:"oc-text-truncate oc-ml-s"},WD={class:"oc-flex"},HD={class:"oc-my-xs"},GD={class:"oc-flex oc-flex-middle oc-text-truncate"},KD={class:"oc-text-truncate oc-ml-s"},QD=["textContent"],XD={class:"oc-flex"},YD={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},JD=["textContent"],ZD={class:"oc-mt-s"},eL={class:"date-filter-apply-btn"};function tL(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=ge("oc-list"),u=ge("oc-datepicker"),c=ge("oc-filter-chip");return Z(),me("div",{class:W.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[he(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:Ee(()=>[he(l,{class:W.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.displayedItems,(f,d)=>(Z(),me("li",{key:d,class:"oc-my-xs"},[he(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:y=>e.toggleItemSelection(f)},{default:Ee(()=>[pe("div",VD,[pe("div",zD,[Ke(e.$slots,"item",{item:f})])]),pe("div",WD,[e.isItemSelected(f)?(Z(),Ie(s,{key:0,name:"check"})):Fe("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),pe("li",HD,[he(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:Ee(()=>[pe("div",GD,[pe("div",KD,[pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,QD)])]),pe("div",XD,[e.dateRangeApplied?(Z(),Ie(s,{key:0,name:"check"})):Fe("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),pe("div",{class:W.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[pe("div",YD,[he(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Ee(()=>[he(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,JD),he(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Ee(()=>[he(s,{name:"close"})]),_:1},8,["aria-label"])]),pe("div",ZD,[he(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),he(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),pe("div",eL,[he(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Ee(()=>[Vt(W.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const nL=ze(qD,[["render",tL]]),rL=$e({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=We(),r=Jt(),o=le(e.filterOptions[0].name),i=`q_${e.filterName}`,s=rn(i),a=u=>n.push({query:{...ki(p(r).query,[i]),[i]:u}}),l=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return Mt(()=>{const u=Et(p(s));u&&e.filterOptions.some(({name:c})=>c===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:c})=>c===u)))}),{queryParam:i,activeOption:o,toggleFilter:l}}}),iL=["textContent"];function oL(e,t,n,r,o,i){const s=ge("oc-button");return Z(),me("div",null,[pe("div",{class:W.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(Z(!0),me(Qe,null,Ft(e.filterOptions,(a,l)=>(Z(),Ie(s,{id:a.name,key:l,class:W.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:"raw-inverse","color-role":"surface",onClick:u=>e.toggleFilter(a)},{default:Ee(()=>[pe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:W.toDisplayString(a.label)},null,8,iL)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const sL=ze(rL,[["render",oL]]),aL={class:"space-quota"},lL=["textContent"],P0=$e({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=xe.useGettext(),r=j(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:p(i),total:p(o),percentage:p(s).toString()}):t("%{used} used (no restriction)",{used:p(i)})),o=j(()=>Sn(e.spaceQuota.total,n)),i=j(()=>Sn(e.spaceQuota.used,n)),s=j(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=j(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(l,u)=>{const c=ge("oc-progress");return Z(),me("div",aL,[pe("p",{class:"oc-mb-s oc-mt-rm",textContent:W.toDisplayString(r.value)},null,8,lL),he(c,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),cL=$e({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=dr("resource"),n="check",r="file-copy",o=le(r),i=le(r),s=j(()=>ff(p(t).webDavPath)),a=j(()=>{var c;return(c=e.space)==null?void 0:c.getWebDavUrl({path:p(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(p(s)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(p(a)),i.value=n,setTimeout(()=>i.value=r,1500)},webDavPath:s,webDavUrl:a}}}),uL={class:"oc-flex"},fL=["textContent"],dL={class:"oc-flex"},pL=["textContent"];function hL(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=sn("oc-tooltip");return Z(),me(Qe,null,[pe("dt",null,W.toDisplayString(e.$gettext("WebDAV path")),1),pe("dd",uL,[ot(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavPath)},null,8,fL),[[l,e.webDavPath]]),ot((Z(),Ie(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Ee(()=>[he(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV path")]])]),pe("dt",null,W.toDisplayString(e.$gettext("WebDAV URL")),1),pe("dd",dL,[ot(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavUrl)},null,8,pL),[[l,e.webDavUrl]]),ot((Z(),Ie(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Ee(()=>[he(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV URL")]])])],64)}const F0=ze(cL,[["render",hL]]),gL={id:"oc-space-details-sidebar"},mL={class:"oc-space-details-sidebar-image oc-text-center"},yL={key:1,class:"oc-position-relative"},bL=["src"],vL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},wL=["textContent"],SL=["textContent"],EL=["aria-label"],TL=ze($e({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=vt(),n=Xe(),{resourceContentsText:r}=Hv({showSizeInformation:!1}),o=We(),{$gettext:i,$ngettext:s,current:a}=xe.useGettext(),{loadPreview:l}=Bf(),u=lt(),{imagesLoading:c}=Ge.storeToRefs(u),f=jt(),d=dr("resource"),y=le(""),{user:w}=Ge.storeToRefs(t),m=j(()=>f.linkShares.length),T=j(()=>n.areWebDavDetailsShown),v=j(()=>!ft(o,"files-spaces-projects")),g=j(()=>`${Sn(p(d).size,a)}, ${p(r)}`);wt(()=>p(d).spaceImageData,async()=>{if(!p(d).spaceImageData){y.value="";return}const J=te.buildSpaceImageResource(p(d));y.value=await l({space:p(d),resource:J,dimensions:Wn.Tile,processor:Bs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=j(()=>te.getSpaceManagers(p(d)).map(ae=>{var se;const re=ae.grantedTo.user||ae.grantedTo.group;return re.id===((se=p(w))==null?void 0:se.id)?i("%{displayName} (me)",{displayName:re.displayName}):re.displayName}).join(", ")),b=j(()=>yb(p(d).mdate,a)),S=j(()=>p($)||p(L)),E=j(()=>{if(p($)&&!p(L))return p(N);if(!p($)&&p(L))return p(z);switch(p(k)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(m),{linkShareCount:p(m).toString()});default:return p(m)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(k).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(k).toString(),linkShareCount:p(m).toString()})}}),_=j(()=>i("Open share panel")),R=j(()=>i("Open link list in share panel")),A=j(()=>i("Open member list in share panel")),$=j(()=>p(k)>0),L=j(()=>p(m)>0),k=j(()=>Object.keys(p(d).members).length),N=j(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(k),{memberShareCount:p(k).toString()})),z=j(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(m),{linkShareCount:p(m).toString()})),Q=()=>{Ye.publish(yt.setActivePanel,"space-share")};return(J,ae)=>{const re=ge("oc-spinner"),se=ge("oc-icon"),ue=ge("oc-button"),we=ge("portal-target");return Z(),me("div",gL,[pe("div",mL,[p(c).includes(p(d).id)?(Z(),Ie(re,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):y.value?(Z(),me("div",yL,[pe("img",{src:y.value,alt:""},null,8,bL)])):(Z(),Ie(se,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),J.showShareIndicators&&S.value&&!p(d).disabled?(Z(),me("div",vL,[$.value?(Z(),Ie(ue,{key:0,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:Q},{default:Ee(()=>[he(se,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Fe("",!0),L.value?(Z(),Ie(ue,{key:1,appearance:"raw","aria-label":R.value,"no-hover":"",onClick:Q},{default:Ee(()=>[he(se,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Fe("",!0),pe("p",{textContent:W.toDisplayString(E.value)},null,8,wL),he(ue,{appearance:"raw","aria-label":_.value,size:"small","no-hover":"",onClick:Q},{default:Ee(()=>[pe("span",{class:"oc-text-small",textContent:W.toDisplayString(p(i)("Show"))},null,8,SL)]),_:1},8,["aria-label"])])):Fe("",!0),pe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[pe("dt",null,W.toDisplayString(p(i)("Last activity")),1),pe("dd",null,W.toDisplayString(b.value),1),p(d).description?(Z(),me(Qe,{key:0},[pe("dt",null,W.toDisplayString(p(i)("Subtitle")),1),pe("dd",null,W.toDisplayString(p(d).description),1)],64)):Fe("",!0),pe("dt",null,W.toDisplayString(p(i)("Manager")),1),pe("dd",null,W.toDisplayString(h.value),1),p(d).disabled?Fe("",!0):(Z(),me(Qe,{key:1},[pe("dt",null,W.toDisplayString(p(i)("Quota")),1),pe("dd",null,[he(P0,{"space-quota":p(d).spaceQuota},null,8,["space-quota"])])],64)),v.value?(Z(),me(Qe,{key:2},[pe("dt",null,W.toDisplayString(p(i)("Size")),1),pe("dd",null,W.toDisplayString(g.value),1)],64)):Fe("",!0),T.value?(Z(),Ie(F0,{key:3,space:p(d)},null,8,["space"])):Fe("",!0),he(we,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(d),resource:p(d)},multiple:!0},null,8,["slot-props"])],8,EL)])}}}),[["__scopeId","data-v-6e24534c"]]),AL={id:"oc-spaces-details-multiple-sidebar"},RL={class:"spaces-preview oc-mb-l"},_L={class:"spaces-preview-body"},IL=["textContent"],CL=ze($e({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=xe.useGettext(),{$gettext:n,$ngettext:r}=t,o=j(()=>{let d=0;return e.selectedSpaces.forEach(y=>{d+=y.spaceQuota.total}),Sn(d,t.current)}),i=j(()=>{let d=0;return e.selectedSpaces.forEach(y=>{y.disabled||(d+=y.spaceQuota.remaining)}),Sn(d,t.current)}),s=j(()=>{let d=0;return e.selectedSpaces.forEach(y=>{y.disabled||(d+=y.spaceQuota.used)}),Sn(d,t.current)}),a=j(()=>e.selectedSpaces.filter(d=>!d.disabled).length),l=j(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=j(()=>n("Overview of the information about the selected spaces")),c=j(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=j(()=>[{term:n("Total quota:"),definition:p(o).toString()},{term:n("Remaining quota:"),definition:p(i).toString()},{term:n("Used quota:"),definition:p(s).toString()},{term:n("Enabled:"),definition:p(a).toString()},{term:n("Disabled:"),definition:p(l).toString()}]);return(d,y)=>{const w=ge("oc-icon"),m=ge("oc-definition-list");return Z(),me("div",AL,[pe("div",RL,[pe("div",_L,[he(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),pe("p",{class:"preview-text",textContent:W.toDisplayString(c.value)},null,8,IL)])]),he(m,{"aria-label":u.value,items:f.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-11ad741e"]]),PL=$e({name:"SpaceNoSelection"}),FL={class:"oc-mt-xl"},OL={class:"oc-flex space-info oc-text-center"};function xL(e,t,n,r,o,i){const s=ge("oc-icon"),a=sn("translate");return Z(),me("div",FL,[pe("div",OL,[he(s,{name:"layout-grid",size:"xxlarge"}),ot((Z(),me("p",null,t[0]||(t[0]=[Vt("Select a space to view details")]))),[[a]])])])}const kL=ze(PL,[["render",xL]]),NL=$e({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=le(!1);let t;return Mt(()=>{t=Ye.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Un(()=>{Ye.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!rb(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),$L={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},DL={key:0,class:"state-indicator oc-flex oc-flex-middle"},LL=["textContent"],ML={key:1,class:"state-indicator"},BL=["textContent"],jL=["textContent"];function UL(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button");return Z(),me("div",$L,[e.saved?(Z(),me("span",DL,[he(s,{name:"checkbox-circle"}),pe("span",{class:"oc-ml-s",textContent:W.toDisplayString(e.$gettext("Changes saved"))},null,8,LL)])):(Z(),me("span",ML,W.toDisplayString(e.unsavedChangesText),1)),pe("div",null,[he(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=l=>e.$emit("revert"))},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Revert"))},null,8,BL)]),_:1},8,["disabled"]),he(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Save"))},null,8,jL)]),_:1},8,["disabled"])])])}const qL=ze(NL,[["render",UL],["__scopeId","data-v-471483fe"]]),VL=eS(async()=>(await Promise.resolve().then(()=>D2)).default),zL=$e({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ni(),n=Ib(),r=j(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:j(()=>{if(e.extensionPoint.multiple||p(r).length<=1)return p(r);const s=n.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[p(r).find(a=>s.selectedExtensionIds.includes(a.id))||p(r)[0]]:[p(r)[0]]})}}});function WL(e,t,n,r,o,i){return Z(!0),me(Qe,null,Ft(e.extensions,s=>(Z(),Ie(Cr(s.content),{key:`custom-component-${s.id}`}))),128)}const HL=ze(zL,[["render",WL]]),GL=$e({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=We(),o=Jt(),i=le(),s=le([]),a=le(e.items),l=le(null),u=le(null),c=`q_${e.filterName}`,f=rn(c),d=E=>E[e.idAttribute],y=()=>r.push({query:{...ki(p(o).query,[c]),...!!p(s).length&&{[c]:p(s).reduce((E,_)=>(E+=`${d(_)}+`,E),"").slice(0,-1)}}}),w=E=>!!p(s).find(_=>d(_)===d(E)),m=async E=>{w(E)?s.value=p(s).filter(_=>d(_)!==d(E)):(e.allowMultiple||(s.value=[]),s.value.push(E)),await y(),t("selectionChange",p(s))},T=le(),v=(E,_)=>{if(!(_||"").trim())return E;const A=new Jf(E,{...rl,keys:e.filterableAttributes}).search(_).map($=>$.item);return E.filter($=>A.includes($))},g=()=>{s.value=[],t("selectionChange",p(s)),y()},h=E=>{a.value=E},b=async()=>{var E;h(e.items),await jn(),(E=p(i))==null||E.focus()};wt(T,()=>{h(v(e.items,p(T))),p(u)&&(l.value=new ed(p(u)),p(l).unmark(),p(l).mark(p(T),{element:"span",className:"mark-highlight"}))});const S=()=>{const E=Et(p(f));if(E){const _=E.split("+");s.value=e.items.filter(R=>_.includes(d(R)))}};return n({setSelectedItemsBasedOnQuery:S}),Mt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:T,isItemSelected:w,itemFilterListRef:u,queryParam:c,selectedItems:s,setDisplayedItems:h,showDrop:b,toggleItemSelection:m,setSelectedItemsBasedOnQuery:S}}}),KL={ref:"itemFilterListRef"},QL={class:"oc-flex oc-flex-middle oc-text-truncate"},XL={class:"oc-text-truncate oc-ml-s"},YL={class:"oc-flex"};function JL(e,t,n,r,o,i){const s=ge("oc-text-input"),a=ge("oc-checkbox"),l=ge("oc-icon"),u=ge("oc-button"),c=ge("oc-list"),f=ge("oc-filter-chip");return Z(),me("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[he(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Ee(()=>[e.showOptionFilter&&e.filterableAttributes.length?(Z(),Ie(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Fe("",!0),pe("div",KL,[he(c,{class:"item-filter-list"},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.displayedItems,(d,y)=>(Z(),me("li",{key:y,class:"oc-my-xs"},[he(u,{class:W.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(d)},{default:Ee(()=>[pe("div",QL,[e.allowMultiple?(Z(),Ie(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=An(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Fe("",!0),pe("div",null,[Ke(e.$slots,"image",{item:d})]),pe("div",XL,[Ke(e.$slots,"item",{item:d})])]),pe("div",YL,[!e.allowMultiple&&e.isItemSelected(d)?(Z(),Ie(l,{key:0,name:"check"})):Fe("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const ZL=ze(GL,[["render",JL]]),e2=$e({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=We(),r=Jt(),o=le(!1),i=`q_${e.filterName}`,s=rn(i),a=()=>n.push({query:{...ki(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),l=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return Mt(()=>{Et(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:l}}});function t2(e,t,n,r,o,i){const s=ge("oc-filter-chip");return Z(),me("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[he(s,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const n2=ze(e2,[["render",t2]]),r2=$e({name:"LoadingIndicator",setup(){const e=cn();let t,n,r;const o=le(e.isLoading),i=le(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return Mt(()=>{t=Ye.subscribe(Or.add,s),n=Ye.subscribe(Or.remove,s),r=Ye.subscribe(Or.setProgress,a)}),Un(()=>{Ye.unsubscribe(Or.add,t),Ye.unsubscribe(Or.remove,n),Ye.unsubscribe(Or.setProgress,r)}),{isLoading:o,currentProgress:i}}}),i2={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function o2(e,t,n,r,o,i){const s=ge("oc-progress");return e.isLoading?(Z(),me("div",i2,[he(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Fe("",!0)}const s2=ze(r2,[["render",o2]]),a2={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},l2={class:"oc-text-muted oc-text-xlarge"},c2={class:"oc-text-muted"},u2=$e({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=ge("oc-icon");return Z(),me("div",a2,[he(r,{name:t.icon,type:"div",size:"xxlarge","fill-type":t.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),pe("div",l2,[Ke(t.$slots,"message")]),pe("div",c2,[Ke(t.$slots,"callToAction")])])}}}),f2=$e({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function d2(e,t,n,r,o,i){const s=ge("oc-pagination");return e.pages>1?(Z(),Ie(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):Fe("",!0)}const p2=ze(f2,[["render",d2]]),h2=$e({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=xe.useGettext(),r=rn("useScope"),o=le(),i=le(),s=j(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=j(()=>[{id:Er.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Er.allFiles,title:n("All files"),enabled:!0}]);return wt(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:c})=>c===Er.currentFolder);return}o.value=p(a).find(({id:c})=>c===Er.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Er.allFiles);return}if(p(i)){o.value=p(a).find(({id:u})=>u===p(i).id);return}o.value=p(a).find(({id:u})=>u===Er.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),g2={key:0},m2={key:0,class:"oc-flex"};function y2(e,t,n,r,o,i){const s=ge("oc-icon"),a=ge("oc-button"),l=ge("oc-filter-chip");return Z(),me("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=An(()=>{},["stop"]))},[e.currentSelection?(Z(),me("div",g2,[he(l,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Ee(()=>[(Z(!0),me(Qe,null,Ft(e.locationOptions,(u,c)=>(Z(),Ie(a,{key:c,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-secondary-container":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:f=>e.onOptionSelected(u)},{default:Ee(()=>[pe("span",null,W.toDisplayString(u.title),1),u.id===e.currentSelection.id?(Z(),me("div",m2,[he(s,{name:"check"})])):Fe("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Fe("",!0)])}const b2=ze(h2,[["render",y2]]),v2=$e({name:"PortalTarget",components:{PortalTargetVue:ga.PortalTarget},props:{...ga.PortalTarget.props},setup(e){const t=j(()=>e);return Mt(()=>{Ye.publish(la.mounted,e)}),{properties:t}}});function w2(e,t,n,r,o,i){const s=ge("portal-target-vue");return Z(),Ie(s,W.normalizeProps(Ha(e.properties)),null,16)}const S2=ze(v2,[["render",w2]]),E2=({sortBy:e,sortDir:t})=>({groupingSettings:j(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(r){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(r.name.charAt(0)))?r.name.charAt(0)==="."?r.name.charAt(1).toLowerCase():r.name.charAt(0).toLowerCase():"#"},"Shared on":function(r){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(r.sdate)<i?"Older":Date.parse(r.sdate)>=o?"Recently":"Last month"},"Share owner":function(r){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=r==null?void 0:r.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="name"&&p(t)==="desc"&&o.reverse(),o},"Shared on":function(r){const o=[],i=["Recently","Last month","Older"];for(const s of i){const a=r.find(l=>l.name.toLowerCase()===s.toLowerCase());a&&o.push(a)}return p(e)==="sdate"&&p(t)==="asc"&&o.reverse(),o},"Share owner":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="owner"&&p(t)==="desc"&&o.reverse(),o}}}))}),T2={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},A2={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},R2={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},_2={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},I2={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},C2={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},P2={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},F2={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},O2={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},x2={"fr-FR":T2,"de-DE":A2,"it-IT":R2,"es-ES":_2,"pl-PL":I2,ru:C2,"jp-JP":P2,"id-ID":F2},k2=$e({name:"TextEditor",components:{MdEditor:$o.MdEditor,MdPreview:$o.MdPreview},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=xe.useGettext(),{currentTheme:r}=ii(),o=j(()=>{const{showPreviewOnlyMd:l=!0}=e.applicationConfig;return{showPreviewOnlyMd:l}}),i=j(()=>{var l;return e.markdownMode||["md","markdown"].includes((l=e.resource)==null?void 0:l.extension)||!p(o).showPreviewOnlyMd}),s=j(()=>p(r).isDark?"dark":"light");return $o.config({editorConfig:{languageUserDefined:x2},editorExtensions:{screenfull:{instance:z0},cropper:{instance:W0}},markdownItPlugins(l){return[...l,{type:"xss",plugin:$o.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:O2,onUploadImg:async l=>{const c=(await Promise.all([...l].map(d=>new Promise((y,w)=>{const m=new FileReader;m.onload=()=>y(m.result),m.onerror=w,m.readAsDataURL(d)})))).map(d=>``),f=`${p(e.currentContent)}
|
|
64
64
|
${c.join(`
|
|
65
65
|
|
|
66
66
|
`)}
|