@opencloud-eu/web-pkg 5.0.0 → 5.1.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.
Files changed (35) hide show
  1. package/dist/{TextEditor-CJgYG8Kl.js → TextEditor-CXSedGM4.js} +1 -1
  2. package/dist/assets/worker-22sDKzz_.js +21 -0
  3. package/dist/assets/worker-BSCY2vwA.js +21 -0
  4. package/dist/assets/worker-DH8D29Kr.js +21 -0
  5. package/dist/index-CEJcEmbf.js +25419 -0
  6. package/dist/src/components/AppBar/AppBar.vue.d.ts +1 -9
  7. package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +1 -1
  8. package/dist/src/components/FilesList/ResourceStatusIndicators.vue.d.ts +1 -1
  9. package/dist/src/components/FilesList/ResourceTable.vue.d.ts +0 -1
  10. package/dist/src/components/PortalTarget.vue.d.ts +1 -40
  11. package/dist/src/components/SideBar/FileSideBar.vue.d.ts +2 -12
  12. package/dist/src/components/SideBar/SideBar.vue.d.ts +3 -9
  13. package/dist/src/components/SideBar/SideBarPanels.vue.d.ts +38 -0
  14. package/dist/src/components/SideBar/index.d.ts +1 -0
  15. package/dist/src/composables/actions/files/index.d.ts +1 -0
  16. package/dist/src/composables/actions/files/useFileActionFallbackToDownload.d.ts +4 -0
  17. package/dist/src/composables/folderLink/useFolderLink.d.ts +1 -1
  18. package/dist/src/composables/index.d.ts +0 -1
  19. package/dist/src/composables/piniaStores/avatars.d.ts +1 -1
  20. package/dist/src/composables/piniaStores/index.d.ts +4 -3
  21. package/dist/src/composables/piniaStores/sideBar.d.ts +46 -0
  22. package/dist/src/composables/piniaStores/user.d.ts +1 -1
  23. package/dist/src/composables/resources/index.d.ts +1 -0
  24. package/dist/src/composables/resources/useResourceIndicators.d.ts +19 -0
  25. package/dist/src/helpers/statusIndicators.d.ts +3 -14
  26. package/dist/web-pkg.js +254 -251
  27. package/dist/web-pkg.umd.cjs +19 -51
  28. package/package.json +4 -5
  29. package/dist/assets/worker-Bc2UmjVr.js +0 -40
  30. package/dist/assets/worker-BeDmEhWu.js +0 -40
  31. package/dist/assets/worker-DWoO7i6z.js +0 -40
  32. package/dist/index-D-EuklHo.js +0 -33782
  33. package/dist/src/composables/sideBar/eventTopics.d.ts +0 -7
  34. package/dist/src/composables/sideBar/index.d.ts +0 -2
  35. package/dist/src/composables/sideBar/useSideBar.d.ts +0 -12
@@ -1,68 +1,36 @@
1
- (function($,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("deepmerge"),require("portal-vue"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","deepmerge","portal-vue","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","@sentry/vue","screenfull","@codemirror/view"],re):($=typeof globalThis<"u"?globalThis:$||self,re($["web-pkg"]={},$.webClient,$.vue,$.vue3Gettext,$.Fuse,$.lodashEs,$.globalAxios,$.uuid,$.fetchEventSource,$.vueConcurrency,$.luxon,$.filesize,$.qs,$.passwordSheriff,$.Uppy,$.Tus,$.XHRUpload,$.utils,$.pinia,$.oidcClientTs,$.core,$.merge$1,$.portalVue,$.DOMPurify,$.Mark,$.PQueue,$.Cropper,$.vueRouter,$.shared,$.mdEditorV3,$.zod,$.vue$1,$.screenfull,$.view))})(this,(function($,re,wS,Ie,zd,Tt,us,Xt,SS,rn,Ut,ES,TS,AS,Wd,xS,RS,Hd,Me,CS,Yn,Kd,fs,Gd,Qd,Lr,il,ds,z,oo,de,kS,PS,IS){"use strict";const OS=e=>e;function Xd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function FS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yd={exports:{}},Nt=Yd.exports={},Jn,Zn;function ol(){throw new Error("setTimeout has not been defined")}function sl(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Jn=setTimeout:Jn=ol}catch{Jn=ol}try{typeof clearTimeout=="function"?Zn=clearTimeout:Zn=sl}catch{Zn=sl}})();function Jd(e){if(Jn===setTimeout)return setTimeout(e,0);if((Jn===ol||!Jn)&&setTimeout)return Jn=setTimeout,setTimeout(e,0);try{return Jn(e,0)}catch{try{return Jn.call(null,e,0)}catch{return Jn.call(this,e,0)}}}function _S(e){if(Zn===clearTimeout)return clearTimeout(e);if((Zn===sl||!Zn)&&clearTimeout)return Zn=clearTimeout,clearTimeout(e);try{return Zn(e)}catch{try{return Zn.call(null,e)}catch{return Zn.call(this,e)}}}var mr=[],Ti=!1,Jr,ps=-1;function DS(){!Ti||!Jr||(Ti=!1,Jr.length?mr=Jr.concat(mr):ps=-1,mr.length&&Zd())}function Zd(){if(!Ti){var e=Jd(DS);Ti=!0;for(var t=mr.length;t;){for(Jr=mr,mr=[];++ps<t;)Jr&&Jr[ps].run();ps=-1,t=mr.length}Jr=null,Ti=!1,_S(e)}}Nt.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];mr.push(new ep(e,t)),mr.length===1&&!Ti&&Jd(Zd)};function ep(e,t){this.fun=e,this.array=t}ep.prototype.run=function(){this.fun.apply(null,this.array)},Nt.title="browser",Nt.browser=!0,Nt.env={},Nt.argv=[],Nt.version="",Nt.versions={};function gr(){}Nt.on=gr,Nt.addListener=gr,Nt.once=gr,Nt.off=gr,Nt.removeListener=gr,Nt.removeAllListeners=gr,Nt.emit=gr,Nt.prependListener=gr,Nt.prependOnceListener=gr,Nt.listeners=function(e){return[]},Nt.binding=function(e){throw new Error("process.binding is not supported")},Nt.cwd=function(){return"/"},Nt.chdir=function(e){throw new Error("process.chdir is not supported")},Nt.umask=function(){return 0};var NS=Yd.exports;const be=FS(NS);function er(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let ut;const al=new WeakSet;class LS{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,al.has(this)&&(al.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||np(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ap(this),rp(this);const t=ut,n=Un;ut=this,Un=!0;try{return this.fn()}finally{be.env.NODE_ENV!=="production"&&ut!==this&&er("Active effect was not restored correctly - this is likely a Vue internal bug."),ip(this),ut=t,Un=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)fl(t);this.deps=this.depsTail=void 0,ap(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?al.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ul(this)&&this.run()}get dirty(){return ul(this)}}let tp=0,so,ao;function np(e,t=!1){if(e.flags|=8,t){e.next=ao,ao=e;return}e.next=so,so=e}function ll(){tp++}function cl(){if(--tp>0)return;if(ao){let t=ao;for(ao=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;so;){let t=so;for(so=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function rp(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ip(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),fl(r),$S(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ul(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(op(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function op(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===lo)||(e.globalVersion=lo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ul(e))))return;e.flags|=2;const t=e.dep,n=ut,r=Un;ut=e,Un=!0;try{rp(e);const i=e.fn(e._value);(t.version===0||z.hasChanged(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ut=n,Un=r,ip(e),e.flags&=-3}}function fl(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),be.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)fl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $S(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Un=!0;const sp=[];function Ai(){sp.push(Un),Un=!1}function xi(){const e=sp.pop();Un=e===void 0?!0:e}function ap(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ut;ut=void 0;try{t()}finally{ut=n}}}let lo=0;class MS{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,be.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!ut||!Un||ut===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ut)n=this.activeLink=new MS(ut,this),ut.deps?(n.prevDep=ut.depsTail,ut.depsTail.nextDep=n,ut.depsTail=n):ut.deps=ut.depsTail=n,lp(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ut.depsTail,n.nextDep=void 0,ut.depsTail.nextDep=n,ut.depsTail=n,ut.deps===n&&(ut.deps=r)}return be.env.NODE_ENV!=="production"&&ut.onTrack&&ut.onTrack(z.extend({effect:ut},t)),n}trigger(t){this.version++,lo++,this.notify(t)}notify(t){ll();try{if(be.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(z.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{cl()}}}function lp(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)lp(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),be.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const ms=new WeakMap,Zr=Symbol(be.env.NODE_ENV!=="production"?"Object iterate":""),dl=Symbol(be.env.NODE_ENV!=="production"?"Map keys iterate":""),co=Symbol(be.env.NODE_ENV!=="production"?"Array iterate":"");function Jt(e,t,n){if(Un&&ut){let r=ms.get(e);r||ms.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new hs),i.map=r,i.key=n),be.env.NODE_ENV!=="production"?i.track({target:e,type:t,key:n}):i.track()}}function $r(e,t,n,r,i,o){const s=ms.get(e);if(!s){lo++;return}const a=l=>{l&&(be.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:o}):l.trigger())};if(ll(),t==="clear")s.forEach(a);else{const l=z.isArray(e),u=l&&z.isIntegerKey(n);if(l&&n==="length"){const c=Number(r);s.forEach((p,d)=>{(d==="length"||d===co||!z.isSymbol(d)&&d>=c)&&a(p)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(co)),t){case"add":l?u&&a(s.get("length")):(a(s.get(Zr)),z.isMap(e)&&a(s.get(dl)));break;case"delete":l||(a(s.get(Zr)),z.isMap(e)&&a(s.get(dl)));break;case"set":z.isMap(e)&&a(s.get(Zr));break}}cl()}function BS(e,t){const n=ms.get(e);return n&&n.get(t)}function Ri(e){const t=it(e);return t===e?t:(Jt(t,"iterate",co),on(e)?t:t.map(qn))}function gs(e){return Jt(e=it(e),"iterate",co),e}function Mr(e,t){return Vn(e)?Ci(Br(e)?qn(t):t):qn(t)}const jS={__proto__:null,[Symbol.iterator](){return pl(this,Symbol.iterator,e=>Mr(this,e))},concat(...e){return Ri(this).concat(...e.map(t=>z.isArray(t)?Ri(t):t))},entries(){return pl(this,"entries",e=>(e[1]=Mr(this,e[1]),e))},every(e,t){return yr(this,"every",e,t,void 0,arguments)},filter(e,t){return yr(this,"filter",e,t,n=>n.map(r=>Mr(this,r)),arguments)},find(e,t){return yr(this,"find",e,t,n=>Mr(this,n),arguments)},findIndex(e,t){return yr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return yr(this,"findLast",e,t,n=>Mr(this,n),arguments)},findLastIndex(e,t){return yr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return yr(this,"forEach",e,t,void 0,arguments)},includes(...e){return hl(this,"includes",e)},indexOf(...e){return hl(this,"indexOf",e)},join(e){return Ri(this).join(e)},lastIndexOf(...e){return hl(this,"lastIndexOf",e)},map(e,t){return yr(this,"map",e,t,void 0,arguments)},pop(){return uo(this,"pop")},push(...e){return uo(this,"push",e)},reduce(e,...t){return cp(this,"reduce",e,t)},reduceRight(e,...t){return cp(this,"reduceRight",e,t)},shift(){return uo(this,"shift")},some(e,t){return yr(this,"some",e,t,void 0,arguments)},splice(...e){return uo(this,"splice",e)},toReversed(){return Ri(this).toReversed()},toSorted(e){return Ri(this).toSorted(e)},toSpliced(...e){return Ri(this).toSpliced(...e)},unshift(...e){return uo(this,"unshift",e)},values(){return pl(this,"values",e=>Mr(this,e))}};function pl(e,t,n){const r=gs(e),i=r[t]();return r!==e&&!on(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.done||(o.value=n(o.value)),o}),i}const US=Array.prototype;function yr(e,t,n,r,i,o){const s=gs(e),a=s!==e&&!on(e),l=s[t];if(l!==US[t]){const p=l.apply(e,o);return a?qn(p):p}let u=n;s!==e&&(a?u=function(p,d){return n.call(this,Mr(e,p),d,e)}:n.length>2&&(u=function(p,d){return n.call(this,p,d,e)}));const c=l.call(s,u,r);return a&&i?i(c):c}function cp(e,t,n,r){const i=gs(e);let o=n;return i!==e&&(on(e)?n.length>3&&(o=function(s,a,l){return n.call(this,s,a,l,e)}):o=function(s,a,l){return n.call(this,s,Mr(e,a),l,e)}),i[t](o,...r)}function hl(e,t,n){const r=it(e);Jt(r,"iterate",co);const i=r[t](...n);return(i===-1||i===!1)&&fo(n[0])?(n[0]=it(n[0]),r[t](...n)):i}function uo(e,t,n=[]){Ai(),ll();const r=it(e)[t].apply(e,n);return cl(),xi(),r}const VS=z.makeMap("__proto__,__v_isRef,__isVue"),up=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(z.isSymbol));function qS(e){z.isSymbol(e)||(e=String(e));const t=it(this);return Jt(t,"has",e),t.hasOwnProperty(e)}class fp{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?gp:mp:o?ZS:hp).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=z.isArray(t);if(!i){let l;if(s&&(l=jS[n]))return l;if(n==="hasOwnProperty")return qS}const a=Reflect.get(t,n,Ft(t)?t:r);if((z.isSymbol(n)?up.has(n):VS(n))||(i||Jt(t,"get",n),o))return a;if(Ft(a)){const l=s&&z.isIntegerKey(n)?a:a.value;return i&&z.isObject(l)?tr(l):l}return z.isObject(a)?i?tr(a):yl(a):a}}class zS extends fp{constructor(t=!1){super(!1,t)}set(t,n,r,i){let o=t[n];const s=z.isArray(t)&&z.isIntegerKey(n);if(!this._isShallow){const u=Vn(o);if(!on(r)&&!Vn(r)&&(o=it(o),r=it(r)),!s&&Ft(o)&&!Ft(r))return u?(be.env.NODE_ENV!=="production"&&er(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=r,!0)}const a=s?Number(n)<t.length:z.hasOwn(t,n),l=Reflect.set(t,n,r,Ft(t)?t:i);return t===it(i)&&(a?z.hasChanged(r,o)&&$r(t,"set",n,r,o):$r(t,"add",n,r)),l}deleteProperty(t,n){const r=z.hasOwn(t,n),i=t[n],o=Reflect.deleteProperty(t,n);return o&&r&&$r(t,"delete",n,void 0,i),o}has(t,n){const r=Reflect.has(t,n);return(!z.isSymbol(n)||!up.has(n))&&Jt(t,"has",n),r}ownKeys(t){return Jt(t,"iterate",z.isArray(t)?"length":Zr),Reflect.ownKeys(t)}}class dp extends fp{constructor(t=!1){super(!0,t)}set(t,n){return be.env.NODE_ENV!=="production"&&er(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return be.env.NODE_ENV!=="production"&&er(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const WS=new zS,HS=new dp,KS=new dp(!0),ml=e=>e,ys=e=>Reflect.getPrototypeOf(e);function GS(e,t,n){return function(...r){const i=this.__v_raw,o=it(i),s=z.isMap(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,u=i[e](...r),c=n?ml:t?Ci:qn;return!t&&Jt(o,"iterate",l?dl:Zr),z.extend(Object.create(u),{next(){const{value:p,done:d}=u.next();return d?{value:p,done:d}:{value:a?[c(p[0]),c(p[1])]:c(p),done:d}}})}}function vs(e){return function(...t){if(be.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";er(`${z.capitalize(e)} operation ${n}failed: target is readonly.`,it(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function QS(e,t){const n={get(i){const o=this.__v_raw,s=it(o),a=it(i);e||(z.hasChanged(i,a)&&Jt(s,"get",i),Jt(s,"get",a));const{has:l}=ys(s),u=t?ml:e?Ci:qn;if(l.call(s,i))return u(o.get(i));if(l.call(s,a))return u(o.get(a));o!==s&&o.get(i)},get size(){const i=this.__v_raw;return!e&&Jt(it(i),"iterate",Zr),i.size},has(i){const o=this.__v_raw,s=it(o),a=it(i);return e||(z.hasChanged(i,a)&&Jt(s,"has",i),Jt(s,"has",a)),i===a?o.has(i):o.has(i)||o.has(a)},forEach(i,o){const s=this,a=s.__v_raw,l=it(a),u=t?ml:e?Ci:qn;return!e&&Jt(l,"iterate",Zr),a.forEach((c,p)=>i.call(o,u(c),u(p),s))}};return z.extend(n,e?{add:vs("add"),set:vs("set"),delete:vs("delete"),clear:vs("clear")}:{add(i){!t&&!on(i)&&!Vn(i)&&(i=it(i));const o=it(this);return ys(o).has.call(o,i)||(o.add(i),$r(o,"add",i,i)),this},set(i,o){!t&&!on(o)&&!Vn(o)&&(o=it(o));const s=it(this),{has:a,get:l}=ys(s);let u=a.call(s,i);u?be.env.NODE_ENV!=="production"&&pp(s,a,i):(i=it(i),u=a.call(s,i));const c=l.call(s,i);return s.set(i,o),u?z.hasChanged(o,c)&&$r(s,"set",i,o,c):$r(s,"add",i,o),this},delete(i){const o=it(this),{has:s,get:a}=ys(o);let l=s.call(o,i);l?be.env.NODE_ENV!=="production"&&pp(o,s,i):(i=it(i),l=s.call(o,i));const u=a?a.call(o,i):void 0,c=o.delete(i);return l&&$r(o,"delete",i,void 0,u),c},clear(){const i=it(this),o=i.size!==0,s=be.env.NODE_ENV!=="production"?z.isMap(i)?new Map(i):new Set(i):void 0,a=i.clear();return o&&$r(i,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=GS(i,e,t)}),n}function gl(e,t){const n=QS(e,t);return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(z.hasOwn(n,i)&&i in r?n:r,i,o)}const XS={get:gl(!1,!1)},YS={get:gl(!0,!1)},JS={get:gl(!0,!0)};function pp(e,t,n){const r=it(n);if(r!==n&&t.call(e,r)){const i=z.toRawType(e);er(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const hp=new WeakMap,ZS=new WeakMap,mp=new WeakMap,gp=new WeakMap;function e1(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function t1(e){return e.__v_skip||!Object.isExtensible(e)?0:e1(z.toRawType(e))}function yl(e){return Vn(e)?e:vl(e,!1,WS,XS,hp)}function tr(e){return vl(e,!0,HS,YS,mp)}function bs(e){return vl(e,!0,KS,JS,gp)}function vl(e,t,n,r,i){if(!z.isObject(e))return be.env.NODE_ENV!=="production"&&er(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=t1(e);if(o===0)return e;const s=i.get(e);if(s)return s;const a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function Br(e){return Vn(e)?Br(e.__v_raw):!!(e&&e.__v_isReactive)}function Vn(e){return!!(e&&e.__v_isReadonly)}function on(e){return!!(e&&e.__v_isShallow)}function fo(e){return e?!!e.__v_raw:!1}function it(e){const t=e&&e.__v_raw;return t?it(t):e}function yp(e){return!z.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&z.def(e,"__v_skip",!0),e}const qn=e=>z.isObject(e)?yl(e):e,Ci=e=>z.isObject(e)?tr(e):e;function Ft(e){return e?e.__v_isRef===!0:!1}function le(e){return vp(e,!1)}function n1(e){return vp(e,!0)}function vp(e,t){return Ft(e)?e:new r1(e,t)}class r1{constructor(t,n){this.dep=new hs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:it(t),this._value=n?t:qn(t),this.__v_isShallow=n}get value(){return be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||on(t)||Vn(t);t=r?t:it(t),z.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:qn(t),be.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function f(e){return Ft(e)?e.value:e}const i1={get:(e,t,n)=>t==="__v_raw"?e:f(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Ft(i)&&!Ft(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function o1(e){return Br(e)?e:new Proxy(e,i1)}class s1{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new hs,{get:r,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function a1(e){return new s1(e)}class l1{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=it(t);let i=!0,o=t;if(!z.isArray(t)||!z.isIntegerKey(String(n)))do i=!fo(o)||on(o);while(i&&(o=o.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=f(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ft(this._raw[this._key])){const n=this._object[this._key];if(Ft(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return BS(this._raw,this._key)}}class c1{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function u1(e,t,n){return Ft(e)?e:z.isFunction(e)?new c1(e):z.isObject(e)&&arguments.length>1?f1(e,t,n):le(e)}function f1(e,t,n){return new l1(e,t,n)}class d1{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new hs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ut!==this)return np(this,!0),!0;be.env.NODE_ENV}get value(){const t=be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return op(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):be.env.NODE_ENV!=="production"&&er("Write operation failed: computed value is readonly")}}function p1(e,t,n=!1){let r,i;z.isFunction(e)?r=e:(r=e.get,i=e.set);const o=new d1(r,i,n);return be.env.NODE_ENV,o}const ws={},Ss=new WeakMap;let ei;function h1(e,t=!1,n=ei){if(n){let r=Ss.get(n);r||Ss.set(n,r=[]),r.push(e)}else be.env.NODE_ENV!=="production"&&!t&&er("onWatcherCleanup() was called when there was no active watcher to associate with.")}function m1(e,t,n=z.EMPTY_OBJ){const{immediate:r,deep:i,once:o,scheduler:s,augmentJob:a,call:l}=n,u=h=>{(n.onWarn||er)("Invalid watch source: ",h,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=h=>i?h:on(h)||i===!1||i===0?vr(h,1):vr(h);let p,d,m,b,w=!1,S=!1;if(Ft(e)?(d=()=>e.value,w=on(e)):Br(e)?(d=()=>c(e),w=!0):z.isArray(e)?(S=!0,w=e.some(h=>Br(h)||on(h)),d=()=>e.map(h=>{if(Ft(h))return h.value;if(Br(h))return c(h);if(z.isFunction(h))return l?l(h,2):h();be.env.NODE_ENV!=="production"&&u(h)})):z.isFunction(e)?t?d=l?()=>l(e,2):e:d=()=>{if(m){Ai();try{m()}finally{xi()}}const h=ei;ei=p;try{return l?l(e,3,[b]):e(b)}finally{ei=h}}:(d=z.NOOP,be.env.NODE_ENV!=="production"&&u(e)),t&&i){const h=d,E=i===!0?1/0:i;d=()=>vr(h(),E)}const y=()=>{p.stop()};if(o&&t){const h=t;t=(...E)=>{h(...E),y()}}let g=S?new Array(e.length).fill(ws):ws;const v=h=>{if(!(!(p.flags&1)||!p.dirty&&!h))if(t){const E=p.run();if(i||w||(S?E.some((T,R)=>z.hasChanged(T,g[R])):z.hasChanged(E,g))){m&&m();const T=ei;ei=p;try{const R=[E,g===ws?void 0:S&&g[0]===ws?[]:g,b];g=E,l?l(t,3,R):t(...R)}finally{ei=T}}}else p.run()};return a&&a(v),p=new LS(d),p.scheduler=s?()=>s(v,!1):v,b=h=>h1(h,!1,p),m=p.onStop=()=>{const h=Ss.get(p);if(h){if(l)l(h,4);else for(const E of h)E();Ss.delete(p)}},be.env.NODE_ENV!=="production"&&(p.onTrack=n.onTrack,p.onTrigger=n.onTrigger),t?r?v(!0):g=p.run():s?s(v.bind(null,!0),!0):p.run(),y.pause=p.pause.bind(p),y.resume=p.resume.bind(p),y.stop=y,y}function vr(e,t=1/0,n){if(t<=0||!z.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ft(e))vr(e.value,t,n);else if(z.isArray(e))for(let r=0;r<e.length;r++)vr(e[r],t,n);else if(z.isSet(e)||z.isMap(e))e.forEach(r=>{vr(r,t,n)});else if(z.isPlainObject(e)){for(const r in e)vr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&vr(e[r],t,n)}return e}const ti=[];function g1(e){ti.push(e)}function y1(){ti.pop()}let bl=!1;function tt(e,...t){if(bl)return;bl=!0,Ai();const n=ti.length?ti[ti.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=v1();if(r)Es(r,n,11,[e+t.map(o=>{var s,a;return(a=(s=o.toString)==null?void 0:s.call(o))!=null?a:JSON.stringify(o)}).join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${oh(n,o.type)}>`).join(`
2
- `),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
3
- `,...b1(i)),console.warn(...o)}xi(),bl=!1}function v1(){let e=ti[ti.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function b1(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...w1(n))}),t}function w1({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${oh(e.component,e.type,r)}`,o=">"+n;return e.props?[i,...S1(e.props),o]:[i+o]}function S1(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...bp(r,e[r]))}),n.length>3&&t.push(" ..."),t}function bp(e,t,n){return z.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ft(t)?(t=bp(e,it(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):z.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=it(t),n?t:[`${e}=`,t])}const wl={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Es(e,t,n,r){try{return r?e(...r):e()}catch(i){Ts(i,t,n)}}function Sl(e,t,n,r){if(z.isFunction(e)){const i=Es(e,t,n,r);return i&&z.isPromise(i)&&i.catch(o=>{Ts(o,t,n)}),i}if(z.isArray(e)){const i=[];for(let o=0;o<e.length;o++)i.push(Sl(e[o],t,n,r));return i}else be.env.NODE_ENV!=="production"&&tt(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Ts(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||z.EMPTY_OBJ;if(t){let a=t.parent;const l=t.proxy,u=be.env.NODE_ENV!=="production"?wl[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,l,u)===!1)return}a=a.parent}if(o){Ai(),Es(o,null,10,[e,l,u]),xi();return}}E1(e,n,i,r,s)}function E1(e,t,n,r=!0,i=!1){if(be.env.NODE_ENV!=="production"){const o=wl[t];if(n&&g1(n),tt(`Unhandled error${o?` during execution of ${o}`:""}`),n&&y1(),r)throw e;console.error(e)}else{if(i)throw e;console.error(e)}}const kn=[];let br=-1;const ki=[];let jr=null,Pi=0;const wp=Promise.resolve();let As=null;const T1=100;function zt(e){const t=As||wp;return e?t.then(this?e.bind(this):e):t}function A1(e){let t=br+1,n=kn.length;for(;t<n;){const r=t+n>>>1,i=kn[r],o=po(i);o<e||o===e&&i.flags&2?t=r+1:n=r}return t}function El(e){if(!(e.flags&1)){const t=po(e),n=kn[kn.length-1];!n||!(e.flags&2)&&t>=po(n)?kn.push(e):kn.splice(A1(t),0,e),e.flags|=1,Sp()}}function Sp(){As||(As=wp.then(Tp))}function Ep(e){z.isArray(e)?ki.push(...e):jr&&e.id===-1?jr.splice(Pi+1,0,e):e.flags&1||(ki.push(e),e.flags|=1),Sp()}function x1(e){if(ki.length){const t=[...new Set(ki)].sort((n,r)=>po(n)-po(r));if(ki.length=0,jr){jr.push(...t);return}for(jr=t,be.env.NODE_ENV!=="production"&&(e=e||new Map),Pi=0;Pi<jr.length;Pi++){const n=jr[Pi];be.env.NODE_ENV!=="production"&&Ap(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}jr=null,Pi=0}}const po=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Tp(e){be.env.NODE_ENV!=="production"&&(e=e||new Map);const t=be.env.NODE_ENV!=="production"?n=>Ap(e,n):z.NOOP;try{for(br=0;br<kn.length;br++){const n=kn[br];if(n&&!(n.flags&8)){if(be.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Es(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;br<kn.length;br++){const n=kn[br];n&&(n.flags&=-2)}br=-1,kn.length=0,x1(e),As=null,(kn.length||ki.length)&&Tp(e)}}function Ap(e,t){const n=e.get(t)||0;if(n>T1){const r=t.i,i=r&&Ms(r.type);return Ts(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let ho=!1;const Tl=new Map;be.env.NODE_ENV!=="production"&&(z.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Al(R1),rerender:Al(C1),reload:Al(k1)});const xs=new Map;function R1(e,t){return xs.has(e)?!1:(xs.set(e,{initialDef:Rs(t),instances:new Set}),!0)}function Rs(e){return sh(e)?e.__vccOpts:e}function C1(e,t){const n=xs.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Rs(r.type).render=t),r.renderCache=[],ho=!0,r.job.flags&8||r.update(),ho=!1}))}function k1(e,t){const n=xs.get(e);if(!n)return;t=Rs(t),xp(n.initialDef,t);const r=[...n.instances];for(let i=0;i<r.length;i++){const o=r[i],s=Rs(o.type);let a=Tl.get(s);a||(s!==n.initialDef&&xp(s,t),Tl.set(s,a=new Set)),a.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(a.add(o),o.ceReload(t.styles),a.delete(o)):o.parent?El(()=>{o.job.flags&8||(ho=!0,o.parent.update(),ho=!1,a.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(s)}Ep(()=>{Tl.clear()})}function xp(e,t){z.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Al(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Ur,mo=[],xl=!1;function P1(e,...t){Ur?Ur.emit(e,...t):xl||mo.push({event:e,args:t})}function Rp(e,t){var n,r;Ur=e,Ur?(Ur.enabled=!0,mo.forEach(({event:i,args:o})=>Ur.emit(i,...o)),mo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{Rp(o,t)}),setTimeout(()=>{Ur||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,xl=!0,mo=[])},3e3)):(xl=!0,mo=[])}const I1=O1("component:updated");function O1(e){return t=>{P1(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Zt=null,Cp=null;function kp(e){const t=Zt;return Zt=e,Cp=e&&e.type.__scopeId||null,t}function ve(e,t=Zt,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Ds(-1);const o=kp(t);let s;try{s=e(...i)}finally{kp(o),r._d&&Ds(1)}return be.env.NODE_ENV!=="production"&&I1(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function ot(e,t){if(Zt===null)return be.env.NODE_ENV!=="production"&&tt("withDirectives can only be used inside render functions."),e;const n=ih(Zt),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,s,a,l=z.EMPTY_OBJ]=t[i];o&&(z.isFunction(o)&&(o={mounted:o,updated:o}),o.deep&&vr(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return e}function ni(e,t){if(be.env.NODE_ENV!=="production"&&(!un||un.isMounted)&&tt("provide() can only be used inside setup()."),un){let n=un.provides;const r=un.parent&&un.parent.provides;r===n&&(n=un.provides=Object.create(r)),n[e]=t}}function wr(e,t,n=!1){const r=$s();if(r||J1){let i=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&z.isFunction(t)?t.call(r&&r.proxy):t;be.env.NODE_ENV!=="production"&&tt(`injection "${String(e)}" not found.`)}else be.env.NODE_ENV!=="production"&&tt("inject() can only be used inside setup() or functional components.")}const F1=Symbol.for("v-scx"),_1=()=>{{const e=wr(F1);return e||be.env.NODE_ENV!=="production"&&tt("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function st(e,t,n){return be.env.NODE_ENV!=="production"&&!z.isFunction(t)&&tt("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Pp(e,t,n)}function Pp(e,t,n=z.EMPTY_OBJ){const{immediate:r,deep:i,flush:o,once:s}=n;be.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&tt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&tt('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&tt('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=z.extend({},n);be.env.NODE_ENV!=="production"&&(a.onWarn=tt);const l=t&&r||!t&&o!=="post";let u;if(Fi){if(o==="sync"){const m=_1();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!l){const m=()=>{};return m.stop=z.NOOP,m.resume=z.NOOP,m.pause=z.NOOP,m}}const c=un;a.call=(m,b,w)=>Sl(m,c,b,w);let p=!1;o==="post"?a.scheduler=m=>{_l(m,c&&c.suspense)}:o!=="sync"&&(p=!0,a.scheduler=(m,b)=>{b?m():El(m)}),a.augmentJob=m=>{t&&(m.flags|=4),p&&(m.flags|=2,c&&(m.id=c.uid,m.i=c))};const d=m1(e,t,a);return Fi&&(u?u.push(d):l&&d()),d}function D1(e,t,n){const r=this.proxy,i=z.isString(e)?e.includes(".")?N1(r,e):()=>r[e]:e.bind(r,r);let o;z.isFunction(t)?o=t:(o=t.handler,n=t);const s=nh(this),a=Pp(i,o.bind(r),n);return s(),a}function N1(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const L1=Symbol("_vte"),$1=e=>e.__isTeleport,ri=e=>e&&(e.disabled||e.disabled===""),Ip=e=>e&&(e.defer||e.defer===""),Op=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Fp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Rl=(e,t)=>{const n=e&&e.to;if(z.isString(n))if(t){const r=t(n);return be.env.NODE_ENV!=="production"&&!r&&!ri(e)&&tt(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return be.env.NODE_ENV!=="production"&&tt("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return be.env.NODE_ENV!=="production"&&!n&&!ri(e)&&tt(`Invalid Teleport target: ${n}`),n},_p={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,o,s,a,l,u){const{mc:c,pc:p,pbc:d,o:{insert:m,querySelector:b,createText:w,createComment:S}}=u,y=ri(t.props);let{shapeFlag:g,children:v,dynamicChildren:h}=t;if(be.env.NODE_ENV!=="production"&&ho&&(l=!1,h=null),e==null){const E=t.el=be.env.NODE_ENV!=="production"?S("teleport start"):w(""),T=t.anchor=be.env.NODE_ENV!=="production"?S("teleport end"):w("");m(E,n,r),m(T,n,r);const R=(A,N)=>{g&16&&c(v,A,N,i,o,s,a,l)},x=()=>{const A=t.target=Rl(t.props,b),N=Np(A,t,w,m);A?(s!=="svg"&&Op(A)?s="svg":s!=="mathml"&&Fp(A)&&(s="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(A),y||(R(A,N),ks(t,!1))):be.env.NODE_ENV!=="production"&&!y&&tt("Invalid Teleport target on mount:",A,`(${typeof A})`)};y&&(R(n,T),ks(t,!0)),Ip(t.props)?(t.el.__isMounted=!1,_l(()=>{x(),delete t.el.__isMounted},o)):x()}else{if(Ip(t.props)&&e.el.__isMounted===!1){_l(()=>{_p.process(e,t,n,r,i,o,s,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,T=t.target=e.target,R=t.targetAnchor=e.targetAnchor,x=ri(e.props),A=x?n:T,N=x?E:R;if(s==="svg"||Op(T)?s="svg":(s==="mathml"||Fp(T))&&(s="mathml"),h?(d(e.dynamicChildren,h,A,i,o,s,a),Qp(e,t,be.env.NODE_ENV==="production")):l||p(e,t,A,N,i,o,s,a,!1),y)x?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cs(t,n,E,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const W=t.target=Rl(t.props,b);W?Cs(t,W,null,u,0):be.env.NODE_ENV!=="production"&&tt("Invalid Teleport target on update:",T,`(${typeof T})`)}else x&&Cs(t,T,R,u,1);ks(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:u,targetAnchor:c,target:p,props:d}=e;if(p&&(i(u),i(c)),o&&i(l),s&16){const m=o||!ri(d);for(let b=0;b<a.length;b++){const w=a[b];r(w,t,n,m,!!w.dynamicChildren)}}},move:Cs,hydrate:M1};function Cs(e,t,n,{o:{insert:r},m:i},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:l,children:u,props:c}=e,p=o===2;if(p&&r(s,t,n),(!p||ri(c))&&l&16)for(let d=0;d<u.length;d++)i(u[d],t,n,2);p&&r(a,t,n)}function M1(e,t,n,r,i,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:u,createText:c}},p){function d(w,S,y,g){S.anchor=p(s(w),S,a(w),n,r,i,o),S.targetStart=y,S.targetAnchor=g}const m=t.target=Rl(t.props,l),b=ri(t.props);if(m){const w=m._lpa||m.firstChild;if(t.shapeFlag&16)if(b)d(e,t,w,w&&s(w));else{t.anchor=s(e);let S=w;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")t.targetStart=S;else if(S.data==="teleport anchor"){t.targetAnchor=S,m._lpa=t.targetAnchor&&s(t.targetAnchor);break}}S=s(S)}t.targetAnchor||Np(m,t,c,u),p(w&&s(w),t,m,n,r,i,o)}ks(t,b)}else b&&t.shapeFlag&16&&d(e,t,e,s(e));return t.anchor&&s(t.anchor)}const Dp=_p;function ks(e,t){const n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Np(e,t,n,r){const i=t.targetStart=n(""),o=t.targetAnchor=n("");return i[L1]=o,e&&(r(i,e),r(o,e)),o}function Lp(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Lp(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _e(e,t){return z.isFunction(e)?z.extend({name:e.name},t,{setup:e}):e}function B1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const j1=new WeakSet;function Tn(e){const t=$s(),n=n1(null);if(t){const i=t.refs===z.EMPTY_OBJ?t.refs={}:t.refs;let o;be.env.NODE_ENV!=="production"&&(o=Object.getOwnPropertyDescriptor(i,e))&&!o.configurable?tt(`useTemplateRef('${e}') already exists.`):Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else be.env.NODE_ENV!=="production"&&tt("useTemplateRef() is called when there is no active component instance to be associated with.");const r=be.env.NODE_ENV!=="production"?tr(n):n;return be.env.NODE_ENV!=="production"&&j1.add(r),r}const $p=e=>e.nodeType===8;z.getGlobalThis().requestIdleCallback,z.getGlobalThis().cancelIdleCallback;function U1(e,t){if($p(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if($p(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const V1=e=>!!e.type.__asyncLoader;function q1(e){z.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:o,timeout:s,suspensible:a=!0,onError:l}=e;let u=null,c,p=0;const d=()=>(p++,u=null,m()),m=()=>{let b;return u||(b=u=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),l)return new Promise((S,y)=>{l(w,()=>S(d()),()=>y(w),p+1)});throw w}).then(w=>{if(b!==u&&u)return u;if(be.env.NODE_ENV!=="production"&&!w&&tt("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),w&&(w.__esModule||w[Symbol.toStringTag]==="Module")&&(w=w.default),be.env.NODE_ENV!=="production"&&w&&!z.isObject(w)&&!z.isFunction(w))throw new Error(`Invalid async component load result: ${w}`);return c=w,w}))};return _e({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(b,w,S){let y=!1;(w.bu||(w.bu=[])).push(()=>y=!0);const g=()=>{if(y){be.env.NODE_ENV!=="production"&&tt(`Skipping lazy hydration for component '${Ms(c)||c.__file}': it was updated before lazy hydration performed.`);return}S()},v=o?()=>{const h=o(g,E=>U1(b,E));h&&(w.bum||(w.bum=[])).push(h)}:g;c?v():m().then(()=>!w.isUnmounted&&v())},get __asyncResolved(){return c},setup(){const b=un;if(B1(b),c)return()=>Ps(c,b);const w=v=>{u=null,Ts(v,b,13,!r)};if(a&&b.suspense||Fi)return m().then(v=>()=>Ps(v,b)).catch(v=>(w(v),()=>r?me(r,{error:v}):null));const S=le(!1),y=le(),g=le(!!i);return i&&setTimeout(()=>{g.value=!1},i),s!=null&&setTimeout(()=>{if(!S.value&&!y.value){const v=new Error(`Async component timed out after ${s}ms.`);w(v),y.value=v}},s),m().then(()=>{S.value=!0,b.parent&&z1(b.parent.vnode)&&b.parent.update()}).catch(v=>{w(v),y.value=v}),()=>{if(S.value&&c)return Ps(c,b);if(y.value&&r)return me(r,{error:y.value});if(n&&!g.value)return Ps(n,b)}}})}function Ps(e,t){const{ref:n,props:r,children:i,ce:o}=t.vnode,s=me(e,r,i);return s.ref=n,s.ce=o,delete t.vnode.ce,s}const z1=e=>e.type.__isKeepAlive;function W1(e,t,n=un,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Ai();const a=nh(n),l=Sl(t,n,e,s);return a(),xi(),l});return r?i.unshift(o):i.push(o),o}else if(be.env.NODE_ENV!=="production"){const i=z.toHandlerKey(wl[e].replace(/ hook$/,""));tt(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Cl=e=>(t,n=un)=>{(!Fi||e==="sp")&&W1(e,(...r)=>t(...r),n)},Lt=Cl("m"),An=Cl("bum"),kl=Cl("um"),Is="components",H1="directives";function Ee(e,t){return Pl(Is,e,!0,t)||e}const Mp=Symbol.for("v-ndc");function Pn(e){return z.isString(e)?Pl(Is,e,!1)||e:e||Mp}function sn(e){return Pl(H1,e)}function Pl(e,t,n=!0,r=!1){const i=Zt||un;if(i){const o=i.type;if(e===Is){const a=Ms(o,!1);if(a&&(a===t||a===z.camelize(t)||a===z.capitalize(z.camelize(t))))return o}const s=Bp(i[e]||o[e],t)||Bp(i.appContext[e],t);if(!s&&r)return o;if(be.env.NODE_ENV!=="production"&&n&&!s){const a=e===Is?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";tt(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else be.env.NODE_ENV!=="production"&&tt(`resolve${z.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Bp(e,t){return e&&(e[t]||e[z.camelize(t)]||e[z.capitalize(z.camelize(t))])}function mt(e,t,n,r){let i;const o=n,s=z.isArray(e);if(s||z.isString(e)){const a=s&&Br(e);let l=!1,u=!1;a&&(l=!on(e),u=Vn(e),e=gs(e)),i=new Array(e.length);for(let c=0,p=e.length;c<p;c++)i[c]=t(l?u?Ci(qn(e[c])):qn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){be.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&tt(`The v-for range expect an integer value but got ${e}.`),i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,o)}else if(z.isObject(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];i[l]=t(e[c],c,l,o)}}else i=[];return i}function jp(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(z.isArray(r))for(let i=0;i<r.length;i++)e[r[i].name]=r[i].fn;else r&&(e[r.name]=r.key?(...i)=>{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return e}function Ue(e,t,n={},r,i){if(Zt.ce||Zt.parent&&V1(Zt.parent)&&Zt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),X(),Te(Be,null,[me("slot",n,r&&r())],u?-2:64)}let o=e[t];be.env.NODE_ENV!=="production"&&o&&o.length>1&&(tt("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),o=()=>[]),o&&o._c&&(o._d=!1),X();const s=o&&Up(o(n)),a=n.key||s&&s.key,l=Te(Be,{key:(a&&!z.isSymbol(a)?a:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&e._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function Up(e){return e.some(t=>Ns(t)?!(t.type===Ii||t.type===Be&&!Up(t.children)):!0)?e:null}function Os(e,t){const n={};if(be.env.NODE_ENV!=="production"&&!z.isObject(e))return tt("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:z.toHandlerKey(r)]=e[r];return n}const Il=e=>e?oE(e)?ih(e):Il(e.parent):null,Ol=z.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>be.env.NODE_ENV!=="production"?bs(e.props):e.props,$attrs:e=>be.env.NODE_ENV!=="production"?bs(e.attrs):e.attrs,$slots:e=>be.env.NODE_ENV!=="production"?bs(e.slots):e.slots,$refs:e=>be.env.NODE_ENV!=="production"?bs(e.refs):e.refs,$parent:e=>Il(e.parent),$root:e=>Il(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>G1(e),$forceUpdate:e=>e.f||(e.f=()=>{El(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>D1.bind(e)}),K1={};be.env.NODE_ENV!=="production"&&(K1.ownKeys=e=>(tt("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function Vp(){return qp("useSlots").slots}function Fl(){return qp("useAttrs").attrs}function qp(e){const t=$s();return be.env.NODE_ENV!=="production"&&!t&&tt(`${e}() called without active instance.`),t.setupContext||(t.setupContext=aE(t))}function zp(e){return z.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function G1(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(u=>Fs(l,u,s,!0)),Fs(l,t,s)),z.isObject(t)&&o.set(t,l),l}function Fs(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&Fs(e,o,n,!0),i&&i.forEach(s=>Fs(e,s,n,!0));for(const s in t)if(r&&s==="expose")be.env.NODE_ENV!=="production"&&tt('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=Q1[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const Q1={data:Wp,props:Kp,emits:Kp,methods:go,computed:go,beforeCreate:cn,created:cn,beforeMount:cn,mounted:cn,beforeUpdate:cn,updated:cn,beforeDestroy:cn,beforeUnmount:cn,destroyed:cn,unmounted:cn,activated:cn,deactivated:cn,errorCaptured:cn,serverPrefetch:cn,components:go,directives:go,watch:Y1,provide:Wp,inject:X1};function Wp(e,t){return t?e?function(){return z.extend(z.isFunction(e)?e.call(this,this):e,z.isFunction(t)?t.call(this,this):t)}:t:e}function X1(e,t){return go(Hp(e),Hp(t))}function Hp(e){if(z.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function cn(e,t){return e?[...new Set([].concat(e,t))]:t}function go(e,t){return e?z.extend(Object.create(null),e,t):t}function Kp(e,t){return e?z.isArray(e)&&z.isArray(t)?[...new Set([...e,...t])]:z.extend(Object.create(null),zp(e),zp(t??{})):t}function Y1(e,t){if(!e)return t;if(!t)return e;const n=z.extend(Object.create(null),e);for(const r in t)n[r]=cn(e[r],t[r]);return n}let J1=null;const Z1={},Gp=e=>Object.getPrototypeOf(e)===Z1,_l=tE;function Qp(e,t,n=!1){const r=e.children,i=t.children;if(z.isArray(r)&&z.isArray(i))for(let o=0;o<r.length;o++){const s=r[o];let a=i[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[o]=iE(i[o]),a.el=s.el),!n&&a.patchFlag!==-2&&Qp(s,a)),a.type===Xp&&(a.patchFlag!==-1?a.el=s.el:a.__elIndex=o+(e.type===Be?1:0)),a.type===Ii&&!a.el&&(a.el=s.el),be.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const eE=e=>e.__isSuspense;function tE(e,t){t&&t.pendingBranch?z.isArray(e)?t.effects.push(...e):t.effects.push(e):Ep(e)}const Be=Symbol.for("v-fgt"),Xp=Symbol.for("v-txt"),Ii=Symbol.for("v-cmt"),_s=[];let xn=null;function X(e=!1){_s.push(xn=e?null:[])}function nE(){_s.pop(),xn=_s[_s.length-1]||null}let yo=1;function Ds(e,t=!1){yo+=e,e<0&&xn&&t&&(xn.hasOnce=!0)}function Yp(e){return e.dynamicChildren=yo>0?xn||z.EMPTY_ARR:null,nE(),yo>0&&xn&&xn.push(e),e}function pe(e,t,n,r,i,o){return Yp(fe(e,t,n,r,i,o,!0))}function Te(e,t,n,r,i){return Yp(me(e,t,n,r,i,!0))}function Ns(e){return e?e.__v_isVNode===!0:!1}const rE=(...e)=>Zp(...e),Jp=({key:e})=>e??null,Ls=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?z.isString(e)||Ft(e)||z.isFunction(e)?{i:Zt,r:e,k:t,f:!!n}:e:null);function fe(e,t=null,n=null,r=0,i=null,o=e===Be?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Jp(t),ref:t&&Ls(t),scopeId:Cp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Zt};return a?(Dl(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=z.isString(n)?8:16),be.env.NODE_ENV!=="production"&&l.key!==l.key&&tt("VNode created with invalid key (NaN). VNode type:",l.type),yo>0&&!s&&xn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&xn.push(l),l}const me=be.env.NODE_ENV!=="production"?rE:Zp;function Zp(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===Mp)&&(be.env.NODE_ENV!=="production"&&!e&&tt(`Invalid vnode type when creating vnode: ${e}.`),e=Ii),Ns(e)){const a=Oi(e,t,!0);return n&&Dl(a,n),yo>0&&!o&&xn&&(a.shapeFlag&6?xn[xn.indexOf(e)]=a:xn.push(a)),a.patchFlag=-2,a}if(sh(e)&&(e=e.__vccOpts),t){t=eh(t);let{class:a,style:l}=t;a&&!z.isString(a)&&(t.class=z.normalizeClass(a)),z.isObject(l)&&(fo(l)&&!z.isArray(l)&&(l=z.extend({},l)),t.style=z.normalizeStyle(l))}const s=z.isString(e)?1:eE(e)?128:$1(e)?64:z.isObject(e)?4:z.isFunction(e)?2:0;return be.env.NODE_ENV!=="production"&&s&4&&fo(e)&&(e=it(e),tt("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
- Component that was made reactive: `,e)),fe(e,t,n,r,i,s,o,!0)}function eh(e){return e?fo(e)||Gp(e)?z.extend({},e):e:null}function Oi(e,t,n=!1,r=!1){const{props:i,ref:o,patchFlag:s,children:a,transition:l}=e,u=t?$t(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Jp(u),ref:t&&t.ref?n&&o?z.isArray(o)?o.concat(Ls(t)):[o,Ls(t)]:Ls(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:be.env.NODE_ENV!=="production"&&s===-1&&z.isArray(a)?a.map(th):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oi(e.ssContent),ssFallback:e.ssFallback&&Oi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Lp(c,l.clone(c)),c}function th(e){const t=Oi(e);return z.isArray(e.children)&&(t.children=e.children.map(th)),t}function kt(e=" ",t=0){return me(Xp,null,e,t)}function Re(e="",t=!1){return t?(X(),Te(Ii,null,e)):me(Ii,null,e)}function iE(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oi(e)}function Dl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(z.isArray(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Dl(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Gp(t)?t._ctx=Zt:i===3&&Zt&&(Zt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else z.isFunction(t)?(t={default:t,_ctx:Zt},n=32):(t=String(t),r&64?(n=16,t=[kt(t)]):n=8);e.children=t,e.shapeFlag|=n}function $t(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=z.normalizeClass([t.class,r.class]));else if(i==="style")t.style=z.normalizeStyle([t.style,r.style]);else if(z.isOn(i)){const o=t[i],s=r[i];s&&o!==s&&!(z.isArray(o)&&o.includes(s))&&(t[i]=o?[].concat(o,s):s)}else i!==""&&(t[i]=r[i])}return t}let un=null;const $s=()=>un||Zt;let Nl;{const e=z.getGlobalThis(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Nl=t("__VUE_INSTANCE_SETTERS__",n=>un=n),t("__VUE_SSR_SETTERS__",n=>Fi=n)}const nh=e=>{const t=un;return Nl(e),e.scope.on(),()=>{e.scope.off(),Nl(t)}};function oE(e){return e.vnode.shapeFlag&4}let Fi=!1;const rh=be.env.NODE_ENV!=="production"?{get(e,t){return Jt(e,"get",""),e[t]},set(){return tt("setupContext.attrs is readonly."),!1},deleteProperty(){return tt("setupContext.attrs is readonly."),!1}}:{get(e,t){return Jt(e,"get",""),e[t]}};function sE(e){return new Proxy(e.slots,{get(t,n){return Jt(e,"get","$slots"),t[n]}})}function aE(e){const t=n=>{if(be.env.NODE_ENV!=="production"&&(e.exposed&&tt("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(z.isArray(n)?r="array":Ft(n)&&(r="ref")),r!=="object"&&tt(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(be.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,rh))},get slots(){return r||(r=sE(e))},get emit(){return(i,...o)=>e.emit(i,...o)},expose:t})}else return{attrs:new Proxy(e.attrs,rh),slots:e.slots,emit:e.emit,expose:t}}function ih(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(o1(yp(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ol)return Ol[n](e)},has(t,n){return n in t||n in Ol}})):e.proxy}const lE=/(?:^|[-_])\w/g,cE=e=>e.replace(lE,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ms(e,t=!0){return z.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function oh(e,t,n=!1){let r=Ms(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e){const i=o=>{for(const s in o)if(o[s]===t)return s};r=i(e.components)||e.parent&&i(e.parent.type.components)||i(e.appContext.components)}return r?cE(r):n?"App":"Anonymous"}function sh(e){return z.isFunction(e)&&"__vccOpts"in e}const B=(e,t)=>{const n=p1(e,t,Fi);if(be.env.NODE_ENV!=="production"){const r=$s();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Ll(e,t,n){try{Ds(-1);const r=arguments.length;return r===2?z.isObject(t)&&!z.isArray(t)?Ns(t)?me(e,null,[t]):me(e,t):me(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ns(n)&&(n=[n]),me(e,t,n))}finally{Ds(1)}}function uE(){if(be.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(p){if(!z.isObject(p))return null;if(p.__isVue)return["div",e,"VueInstance"];if(Ft(p)){Ai();const d=p.value;return xi(),["div",{},["span",e,c(p)],"<",a(d),">"]}else{if(Br(p))return["div",{},["span",e,on(p)?"ShallowReactive":"Reactive"],"<",a(p),`>${Vn(p)?" (readonly)":""}`];if(Vn(p))return["div",{},["span",e,on(p)?"ShallowReadonly":"Readonly"],"<",a(p),">"]}return null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...o(p.$)]}};function o(p){const d=[];p.type.props&&p.props&&d.push(s("props",it(p.props))),p.setupState!==z.EMPTY_OBJ&&d.push(s("setup",p.setupState)),p.data!==z.EMPTY_OBJ&&d.push(s("data",it(p.data)));const m=l(p,"computed");m&&d.push(s("computed",m));const b=l(p,"inject");return b&&d.push(s("injected",b)),d.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),d}function s(p,d){return d=z.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(m=>["div",{},["span",r,m+": "],a(d[m],!1)])]]:["span",{}]}function a(p,d=!0){return typeof p=="number"?["span",t,p]:typeof p=="string"?["span",n,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:z.isObject(p)?["object",{object:d?it(p):p}]:["span",n,String(p)]}function l(p,d){const m=p.type;if(z.isFunction(m))return;const b={};for(const w in p.ctx)u(m,w,d)&&(b[w]=p.ctx[w]);return b}function u(p,d,m){const b=p[m];if(z.isArray(b)&&b.includes(d)||z.isObject(b)&&d in b||p.extends&&u(p.extends,d,m)||p.mixins&&p.mixins.some(w=>u(w,d,m)))return!0}function c(p){return on(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const ah=be.env.NODE_ENV!=="production"?tt:z.NOOP;be.env.NODE_ENV,be.env.NODE_ENV;let fE;const lh=typeof window<"u"&&window.trustedTypes;if(lh)try{fE=lh.createPolicy("vue",{createHTML:e=>e})}catch(e){be.env.NODE_ENV!=="production"&&ah(`Error creating trusted types policy: ${e}`)}const ch=Symbol("_vod"),dE=Symbol("_vsh"),uh={name:"show",beforeMount(e,{value:t},{transition:n}){e[ch]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):vo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),vo(e,!0),r.enter(e)):r.leave(e,()=>{vo(e,!1)}):vo(e,t))},beforeUnmount(e,{value:t}){vo(e,t)}};function vo(e,t){e.style.display=t?e[ch]:"none",e[dE]=!t}be.env.NODE_ENV;function Vr(e,t,n,r){e.addEventListener(t,n,r)}const qr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z.isArray(t)?n=>z.invokeArrayFns(t,n):t};function pE(e){e.target.composing=!0}function fh(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const In=Symbol("_assign");function dh(e,t,n){return t&&(e=e.trim()),n&&(e=z.looseToNumber(e)),e}const $l={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[In]=qr(i);const o=r||i.props&&i.props.type==="number";Vr(e,t?"change":"input",s=>{s.target.composing||e[In](dh(e.value,n,o))}),(n||o)&&Vr(e,"change",()=>{e.value=dh(e.value,n,o)}),t||(Vr(e,"compositionstart",pE),Vr(e,"compositionend",fh),Vr(e,"change",fh))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:o}},s){if(e[In]=qr(s),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?z.looseToNumber(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l))}},hE={deep:!0,created(e,t,n){e[In]=qr(n),Vr(e,"change",()=>{const r=e._modelValue,i=_i(e),o=e.checked,s=e[In];if(z.isArray(r)){const a=z.looseIndexOf(r,i),l=a!==-1;if(o&&!l)s(r.concat(i));else if(!o&&l){const u=[...r];u.splice(a,1),s(u)}}else if(z.isSet(r)){const a=new Set(r);o?a.add(i):a.delete(i),s(a)}else s(mh(e,o))})},mounted:ph,beforeUpdate(e,t,n){e[In]=qr(n),ph(e,t,n)}};function ph(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(z.isArray(t))i=z.looseIndexOf(t,r.props.value)>-1;else if(z.isSet(t))i=t.has(r.props.value);else{if(t===n)return;i=z.looseEqual(t,mh(e,!0))}e.checked!==i&&(e.checked=i)}const mE={created(e,{value:t},n){e.checked=z.looseEqual(t,n.props.value),e[In]=qr(n),Vr(e,"change",()=>{e[In](_i(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[In]=qr(r),t!==n&&(e.checked=z.looseEqual(t,r.props.value))}},gE={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=z.isSet(t);Vr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?z.looseToNumber(_i(s)):_i(s));e[In](e.multiple?i?new Set(o):o:o[0]),e._assigning=!0,zt(()=>{e._assigning=!1})}),e[In]=qr(r)},mounted(e,{value:t}){hh(e,t)},beforeUpdate(e,t,n){e[In]=qr(n)},updated(e,{value:t}){e._assigning||hh(e,t)}};function hh(e,t){const n=e.multiple,r=z.isArray(t);if(n&&!r&&!z.isSet(t)){be.env.NODE_ENV!=="production"&&ah(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let i=0,o=e.options.length;i<o;i++){const s=e.options[i],a=_i(s);if(n)if(r){const l=typeof a;l==="string"||l==="number"?s.selected=t.some(u=>String(u)===String(a)):s.selected=z.looseIndexOf(t,a)>-1}else s.selected=t.has(a);else if(z.looseEqual(_i(s),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function _i(e){return"_value"in e?e._value:e.value}function mh(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const yE={created(e,t,n){Bs(e,t,n,null,"created")},mounted(e,t,n){Bs(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){Bs(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){Bs(e,t,n,r,"updated")}};function vE(e,t){switch(e){case"SELECT":return gE;case"TEXTAREA":return $l;default:switch(t){case"checkbox":return hE;case"radio":return mE;default:return $l}}}function Bs(e,t,n,r,i){const s=vE(e.tagName,n.props&&n.props.type)[i];s&&s(e,t,n,r)}const bE=["ctrl","shift","alt","meta"],wE={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>bE.some(n=>e[`${n}Key`]&&!t.includes(n))},Wt=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((i,...o)=>{for(let s=0;s<t.length;s++){const a=wE[t[s]];if(a&&a(i,t))return}return e(i,...o)}))},SE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},bo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(i=>{if(!("key"in i))return;const o=z.hyphenate(i.key);if(t.some(s=>s===o||SE[s]===o))return e(i)}))};function EE(){uE()}be.env.NODE_ENV!=="production"&&EE();const fn=()=>wS.useAbility();function gh(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const wo=(e,t)=>!e||!t?!1:e.id===t.id;var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function TE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ml,yh;function AE(){if(yh)return Ml;yh=1;function e(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function t(i,o){for(var s="",a=0,l=-1,u=0,c,p=0;p<=i.length;++p){if(p<i.length)c=i.charCodeAt(p);else{if(c===47)break;c=47}if(c===47){if(!(l===p-1||u===1))if(l!==p-1&&u===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",a=0):(s=s.slice(0,d),a=s.length-1-s.lastIndexOf("/")),l=p,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=p,u=0;continue}}o&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+i.slice(l+1,p):s=i.slice(l+1,p),a=p-l-1;l=p,u=0}else c===46&&u!==-1?++u:u=-1}return s}function n(i,o){var s=o.dir||o.root,a=o.base||(o.name||"")+(o.ext||"");return s?s===o.root?s+a:s+i+a:a}var r={resolve:function(){for(var o="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var u;l>=0?u=arguments[l]:(a===void 0&&(a=be.cwd()),u=a),e(u),u.length!==0&&(o=u+"/"+o,s=u.charCodeAt(0)===47)}return o=t(o,!s),s?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var s=o.charCodeAt(0)===47,a=o.charCodeAt(o.length-1)===47;return o=t(o,!s),o.length===0&&!s&&(o="."),o.length>0&&a&&(o+="/"),s?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,s=0;s<arguments.length;++s){var a=arguments[s];e(a),a.length>0&&(o===void 0?o=a:o+="/"+a)}return o===void 0?".":r.normalize(o)},relative:function(o,s){if(e(o),e(s),o===s||(o=r.resolve(o),s=r.resolve(s),o===s))return"";for(var a=1;a<o.length&&o.charCodeAt(a)===47;++a);for(var l=o.length,u=l-a,c=1;c<s.length&&s.charCodeAt(c)===47;++c);for(var p=s.length,d=p-c,m=u<d?u:d,b=-1,w=0;w<=m;++w){if(w===m){if(d>m){if(s.charCodeAt(c+w)===47)return s.slice(c+w+1);if(w===0)return s.slice(c+w)}else u>m&&(o.charCodeAt(a+w)===47?b=w:w===0&&(b=0));break}var S=o.charCodeAt(a+w),y=s.charCodeAt(c+w);if(S!==y)break;S===47&&(b=w)}var g="";for(w=a+b+1;w<=l;++w)(w===l||o.charCodeAt(w)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(c+b):(c+=b,s.charCodeAt(c)===47&&++c,s.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var s=o.charCodeAt(0),a=s===47,l=-1,u=!0,c=o.length-1;c>=1;--c)if(s=o.charCodeAt(c),s===47){if(!u){l=c;break}}else u=!1;return l===-1?a?"/":".":a&&l===1?"//":o.slice(0,l)},basename:function(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(o);var a=0,l=-1,u=!0,c;if(s!==void 0&&s.length>0&&s.length<=o.length){if(s.length===o.length&&s===o)return"";var p=s.length-1,d=-1;for(c=o.length-1;c>=0;--c){var m=o.charCodeAt(c);if(m===47){if(!u){a=c+1;break}}else d===-1&&(u=!1,d=c+1),p>=0&&(m===s.charCodeAt(p)?--p===-1&&(l=c):(p=-1,l=d))}return a===l?l=d:l===-1&&(l=o.length),o.slice(a,l)}else{for(c=o.length-1;c>=0;--c)if(o.charCodeAt(c)===47){if(!u){a=c+1;break}}else l===-1&&(u=!1,l=c+1);return l===-1?"":o.slice(a,l)}},extname:function(o){e(o);for(var s=-1,a=0,l=-1,u=!0,c=0,p=o.length-1;p>=0;--p){var d=o.charCodeAt(p);if(d===47){if(!u){a=p+1;break}continue}l===-1&&(u=!1,l=p+1),d===46?s===-1?s=p:c!==1&&(c=1):s!==-1&&(c=-1)}return s===-1||l===-1||c===0||c===1&&s===l-1&&s===a+1?"":o.slice(s,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var s={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return s;var a=o.charCodeAt(0),l=a===47,u;l?(s.root="/",u=1):u=0;for(var c=-1,p=0,d=-1,m=!0,b=o.length-1,w=0;b>=u;--b){if(a=o.charCodeAt(b),a===47){if(!m){p=b+1;break}continue}d===-1&&(m=!1,d=b+1),a===46?c===-1?c=b:w!==1&&(w=1):c!==-1&&(w=-1)}return c===-1||d===-1||w===0||w===1&&c===d-1&&c===p+1?d!==-1&&(p===0&&l?s.base=s.name=o.slice(1,d):s.base=s.name=o.slice(p,d)):(p===0&&l?(s.name=o.slice(1,c),s.base=o.slice(1,d)):(s.name=o.slice(p,c),s.base=o.slice(p,d)),s.ext=o.slice(c,d)),p>0?s.dir=o.slice(0,p-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Ml=r,Ml}var ft=AE();const Bl=TE(ft),xE=_e({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Ye=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},RE=["textContent"],CE=["textContent"];function kE(e,t,n,r,i,o){return X(),pe(Be,null,[fe("p",{class:"mt-0",textContent:z.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,RE),fe("p",{class:"mb-0",textContent:z.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,CE)],64)}const vh=Ye(xE,[["render",kE]]),PE=_e({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=ht(),{$gettext:n}=Ie.useGettext(),r=le(!1),i=B(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),o=B(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name},!0):n("File with name »%{name}« already exists.",{name:e.resource.name},!0)),s=B(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:o,checkboxValue:r,checkboxLabel:i,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.KEEP_BOTH,doForAllConflicts:f(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?Wn.MERGE:Wn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:f(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.SKIP,doForAllConflicts:f(r)})}}}}),IE=["textContent"],OE={class:"my-4"},FE={class:"flex justify-end items-center mt-4"},_E={class:"oc-modal-body-actions-grid"};function DE(e,t,n,r,i,o){const s=Ee("oc-checkbox"),a=Ee("oc-button");return X(),pe(Be,null,[fe("span",{class:"inline-block mb-4",textContent:z.toDisplayString(e.message)},null,8,IE),fe("div",OE,[e.conflictCount>1?(X(),Te(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=l=>e.checkboxValue=l),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):Re("",!0)]),fe("div",FE,[fe("div",_E,[me(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:ve(()=>[kt(z.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const bh=Ye(PE,[["render",DE]]);class jl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const i=[];for(const u of t){const c=ft.join(n.path,u.name);r.some(d=>d.path===c)&&i.push({resource:u,strategy:null})}let o=0,s=!1,a=null;const l=[];for(const u of i){if(s){u.strategy=a,l.push(u);continue}const c=i.length-o,p=await this.resolveFileExists(u.resource,c);u.strategy=p.strategy,l.push(u),o+=1,p.doForAllConflicts&&(s=!0,a=p.strategy)}return l}resolveFileExists(t,n,r=!1,i=!1){const{dispatchModal:o}=ht();return new Promise(s=>{o({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:bh,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:i,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=ht();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:vh,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const zn=(e,t,n,r=1)=>{let i;return t?i=`${re.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:i=`${e} (${r})`,n.some(s=>s.name===i)?zn(e,t,n,r+1):i},wh=(e,t,n,r)=>e.id===n.id&&ft.dirname(t.path)===r.path;var Wn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Wn||{}),Sr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Sr||{});class Sh extends jl{constructor(t,n,r,i,o,s,a,l){super(a,l),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=i,this.currentFolder=o,this.clientService=s}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",t);nt().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const a=n.length;if(a===0)return;const l=r===Sr.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",a,{count:a.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",a,{count:a.toString()},!0);nt().showMessage({title:l,status:"success"});return}let i=r===Sr.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()},!0):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()},!0);t.length===1&&(i=r===Sr.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName},!0));let o="";t.some(({error:a})=>a instanceof re.HttpError&&a.statusCode===507)&&(o=this.$gettext("Insufficient quota")),nt().showErrorMessage({title:i,...o&&{desc:o},errors:t.map(({error:a})=>a)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Sr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Sr.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),i=[];for(const o of this.resourcesToMove){const s={...o},{id:a,name:l,extension:u}=s,c=r.some(m=>m.resource.id===a);let p=l,d=!1;if(c){const m=r.find(b=>b.resource.id===a)?.strategy;if(m===Wn.SKIP)continue;if(m===Wn.REPLACE){if(this.isOverwritingParentFolder(s,this.targetFolder,n)){const b=new Error;this.showResultMessage([{error:b,resourceName:l}],[],t);continue}d=!0}m===Wn.KEEP_BOTH&&(p=zn(l,u,n),s.name=p)}wh(this.sourceSpace,s,this.targetSpace,this.targetFolder)&&d||i.push({resource:s,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:ft.join(this.targetFolder.path,p),overwrite:d,transferType:t})}return i}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const i=f(this.currentFolder)?.path;if(!i||n.path===i)return!1;const o=ft.basename(t.path),s=ft.join(n.path,o);return i.split("/").length<s.split("/").length?!1:r.some(a=>a.path===s)}}const Ul={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},NE=(e,t,n)=>new zd(e,{...Ul,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(i=>i.item),Eh="oc-resource-icon-mapping",LE={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function Th(){const e={};return Object.values(LE).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const Ah=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(re.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function Vl(e,t,n){return t.name=ft.basename(n),t.path=n,t.webDavPath=ft.join(e.webDavPath,n),t.extension=re.extractExtensionFromFile(t),t}function $E(){this.__data__=[],this.size=0}function So(e,t){return e===t||e!==e&&t!==t}function js(e,t){for(var n=e.length;n--;)if(So(e[n][0],t))return n;return-1}var ME=Array.prototype,BE=ME.splice;function jE(e){var t=this.__data__,n=js(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():BE.call(t,n,1),--this.size,!0}function UE(e){var t=this.__data__,n=js(t,e);return n<0?void 0:t[n][1]}function VE(e){return js(this.__data__,e)>-1}function qE(e,t){var n=this.__data__,r=js(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Er(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Er.prototype.clear=$E,Er.prototype.delete=jE,Er.prototype.get=UE,Er.prototype.has=VE,Er.prototype.set=qE;function zE(){this.__data__=new Er,this.size=0}function WE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function HE(e){return this.__data__.get(e)}function KE(e){return this.__data__.has(e)}const Wr=globalThis||void 0||self;var xh=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,GE=typeof self=="object"&&self&&self.Object===Object&&self,nr=xh||GE||Function("return this")(),On=nr.Symbol,Rh=Object.prototype,QE=Rh.hasOwnProperty,XE=Rh.toString,Eo=On?On.toStringTag:void 0;function YE(e){var t=QE.call(e,Eo),n=e[Eo];try{e[Eo]=void 0;var r=!0}catch{}var i=XE.call(e);return r&&(t?e[Eo]=n:delete e[Eo]),i}var JE=Object.prototype,ZE=JE.toString;function eT(e){return ZE.call(e)}var tT="[object Null]",nT="[object Undefined]",Ch=On?On.toStringTag:void 0;function ii(e){return e==null?e===void 0?nT:tT:Ch&&Ch in Object(e)?YE(e):eT(e)}function rr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var rT="[object AsyncFunction]",iT="[object Function]",oT="[object GeneratorFunction]",sT="[object Proxy]";function ql(e){if(!rr(e))return!1;var t=ii(e);return t==iT||t==oT||t==rT||t==sT}var zl=nr["__core-js_shared__"],kh=(function(){var e=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function aT(e){return!!kh&&kh in e}var lT=Function.prototype,cT=lT.toString;function oi(e){if(e!=null){try{return cT.call(e)}catch{}try{return e+""}catch{}}return""}var uT=/[\\^$.*+?()[\]{}|]/g,fT=/^\[object .+?Constructor\]$/,dT=Function.prototype,pT=Object.prototype,hT=dT.toString,mT=pT.hasOwnProperty,gT=RegExp("^"+hT.call(mT).replace(uT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yT(e){if(!rr(e)||aT(e))return!1;var t=ql(e)?gT:fT;return t.test(oi(e))}function vT(e,t){return e?.[t]}function si(e,t){var n=vT(e,t);return yT(n)?n:void 0}var To=si(nr,"Map"),Ao=si(Object,"create");function bT(){this.__data__=Ao?Ao(null):{},this.size=0}function wT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ST="__lodash_hash_undefined__",ET=Object.prototype,TT=ET.hasOwnProperty;function AT(e){var t=this.__data__;if(Ao){var n=t[e];return n===ST?void 0:n}return TT.call(t,e)?t[e]:void 0}var xT=Object.prototype,RT=xT.hasOwnProperty;function CT(e){var t=this.__data__;return Ao?t[e]!==void 0:RT.call(t,e)}var kT="__lodash_hash_undefined__";function PT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ao&&t===void 0?kT:t,this}function ai(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ai.prototype.clear=bT,ai.prototype.delete=wT,ai.prototype.get=AT,ai.prototype.has=CT,ai.prototype.set=PT;function IT(){this.size=0,this.__data__={hash:new ai,map:new(To||Er),string:new ai}}function OT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Us(e,t){var n=e.__data__;return OT(t)?n[typeof t=="string"?"string":"hash"]:n.map}function FT(e){var t=Us(this,e).delete(e);return this.size-=t?1:0,t}function _T(e){return Us(this,e).get(e)}function DT(e){return Us(this,e).has(e)}function NT(e,t){var n=Us(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Tr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Tr.prototype.clear=IT,Tr.prototype.delete=FT,Tr.prototype.get=_T,Tr.prototype.has=DT,Tr.prototype.set=NT;var LT=200;function $T(e,t){var n=this.__data__;if(n instanceof Er){var r=n.__data__;if(!To||r.length<LT-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Tr(r)}return n.set(e,t),this.size=n.size,this}function ir(e){var t=this.__data__=new Er(e);this.size=t.size}ir.prototype.clear=zE,ir.prototype.delete=WE,ir.prototype.get=HE,ir.prototype.has=KE,ir.prototype.set=$T;var Vs=(function(){try{var e=si(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Wl(e,t,n){t=="__proto__"&&Vs?Vs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Hl(e,t,n){(n!==void 0&&!So(e[t],n)||n===void 0&&!(t in e))&&Wl(e,t,n)}function MT(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[++i];if(n(o[l],l,o)===!1)break}return t}}var BT=MT(),Ph=typeof $=="object"&&$&&!$.nodeType&&$,Ih=Ph&&typeof module=="object"&&module&&!module.nodeType&&module,jT=Ih&&Ih.exports===Ph,Oh=jT?nr.Buffer:void 0,Fh=Oh?Oh.allocUnsafe:void 0;function _h(e,t){if(t)return e.slice();var n=e.length,r=Fh?Fh(n):new e.constructor(n);return e.copy(r),r}var qs=nr.Uint8Array;function Kl(e){var t=new e.constructor(e.byteLength);return new qs(t).set(new qs(e)),t}function Dh(e,t){var n=t?Kl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function UT(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Nh=Object.create,VT=(function(){function e(){}return function(t){if(!rr(t))return{};if(Nh)return Nh(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Lh(e,t){return function(n){return e(t(n))}}var Gl=Lh(Object.getPrototypeOf,Object),qT=Object.prototype;function Ql(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||qT;return e===n}function zT(e){return typeof e.constructor=="function"&&!Ql(e)?VT(Gl(e)):{}}function or(e){return e!=null&&typeof e=="object"}var WT="[object Arguments]";function $h(e){return or(e)&&ii(e)==WT}var Mh=Object.prototype,HT=Mh.hasOwnProperty,KT=Mh.propertyIsEnumerable,zs=$h((function(){return arguments})())?$h:function(e){return or(e)&&HT.call(e,"callee")&&!KT.call(e,"callee")},Hn=Array.isArray,GT=9007199254740991;function Bh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=GT}function Ws(e){return e!=null&&Bh(e.length)&&!ql(e)}function QT(e){return or(e)&&Ws(e)}function XT(){return!1}var jh=typeof $=="object"&&$&&!$.nodeType&&$,Uh=jh&&typeof module=="object"&&module&&!module.nodeType&&module,YT=Uh&&Uh.exports===jh,Vh=YT?nr.Buffer:void 0,JT=Vh?Vh.isBuffer:void 0,xo=JT||XT,ZT="[object Object]",eA=Function.prototype,tA=Object.prototype,qh=eA.toString,nA=tA.hasOwnProperty,rA=qh.call(Object);function Xl(e){if(!or(e)||ii(e)!=ZT)return!1;var t=Gl(e);if(t===null)return!0;var n=nA.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&qh.call(n)==rA}var iA="[object Arguments]",oA="[object Array]",sA="[object Boolean]",aA="[object Date]",lA="[object Error]",cA="[object Function]",uA="[object Map]",fA="[object Number]",dA="[object Object]",pA="[object RegExp]",hA="[object Set]",mA="[object String]",gA="[object WeakMap]",yA="[object ArrayBuffer]",vA="[object DataView]",bA="[object Float32Array]",wA="[object Float64Array]",SA="[object Int8Array]",EA="[object Int16Array]",TA="[object Int32Array]",AA="[object Uint8Array]",xA="[object Uint8ClampedArray]",RA="[object Uint16Array]",CA="[object Uint32Array]",At={};At[bA]=At[wA]=At[SA]=At[EA]=At[TA]=At[AA]=At[xA]=At[RA]=At[CA]=!0,At[iA]=At[oA]=At[yA]=At[sA]=At[vA]=At[aA]=At[lA]=At[cA]=At[uA]=At[fA]=At[dA]=At[pA]=At[hA]=At[mA]=At[gA]=!1;function kA(e){return or(e)&&Bh(e.length)&&!!At[ii(e)]}function Yl(e){return function(t){return e(t)}}var zh=typeof $=="object"&&$&&!$.nodeType&&$,Ro=zh&&typeof module=="object"&&module&&!module.nodeType&&module,PA=Ro&&Ro.exports===zh,Jl=PA&&xh.process,Di=(function(){try{var e=Ro&&Ro.require&&Ro.require("util").types;return e||Jl&&Jl.binding&&Jl.binding("util")}catch{}})(),Wh=Di&&Di.isTypedArray,Zl=Wh?Yl(Wh):kA;function ec(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var IA=Object.prototype,OA=IA.hasOwnProperty;function Hh(e,t,n){var r=e[t];(!(OA.call(e,t)&&So(r,n))||n===void 0&&!(t in e))&&Wl(e,t,n)}function Kh(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=void 0;l===void 0&&(l=e[a]),i?Wl(n,a,l):Hh(n,a,l)}return n}function FA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _A=9007199254740991,DA=/^(?:0|[1-9]\d*)$/;function Gh(e,t){var n=typeof e;return t=t??_A,!!t&&(n=="number"||n!="symbol"&&DA.test(e))&&e>-1&&e%1==0&&e<t}var NA=Object.prototype,LA=NA.hasOwnProperty;function Qh(e,t){var n=Hn(e),r=!n&&zs(e),i=!n&&!r&&xo(e),o=!n&&!r&&!i&&Zl(e),s=n||r||i||o,a=s?FA(e.length,String):[],l=a.length;for(var u in e)(t||LA.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Gh(u,l)))&&a.push(u);return a}function $A(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var MA=Object.prototype,BA=MA.hasOwnProperty;function jA(e){if(!rr(e))return $A(e);var t=Ql(e),n=[];for(var r in e)r=="constructor"&&(t||!BA.call(e,r))||n.push(r);return n}function tc(e){return Ws(e)?Qh(e,!0):jA(e)}function UA(e){return Kh(e,tc(e))}function VA(e,t,n,r,i,o,s){var a=ec(e,n),l=ec(t,n),u=s.get(l);if(u){Hl(e,n,u);return}var c=o?o(a,l,n+"",e,t,s):void 0,p=c===void 0;if(p){var d=Hn(l),m=!d&&xo(l),b=!d&&!m&&Zl(l);c=l,d||m||b?Hn(a)?c=a:QT(a)?c=UT(a):m?(p=!1,c=_h(l,!0)):b?(p=!1,c=Dh(l,!0)):c=[]:Xl(l)||zs(l)?(c=a,zs(a)?c=UA(a):(!rr(a)||ql(a))&&(c=zT(l))):p=!1}p&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),Hl(e,n,c)}function Xh(e,t,n,r,i){e!==t&&BT(t,function(o,s){if(i||(i=new ir),rr(o))VA(e,t,s,n,Xh,r,i);else{var a=r?r(ec(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),Hl(e,s,a)}},tc)}function Yh(e){return e}function qA(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Jh=Math.max;function Zh(e,t,n){return t=Jh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Jh(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),qA(e,this,a)}}function zA(e){return function(){return e}}var WA=Vs?function(e,t){return Vs(e,"toString",{configurable:!0,enumerable:!1,value:zA(t),writable:!0})}:Yh,HA=800,KA=16,GA=Date.now;function QA(e){var t=0,n=0;return function(){var r=GA(),i=KA-(r-n);if(n=r,i>0){if(++t>=HA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var em=QA(WA);function XA(e,t){return em(Zh(e,t,Yh),e+"")}function YA(e,t,n){if(!rr(n))return!1;var r=typeof t;return(r=="number"?Ws(n)&&Gh(t,n.length):r=="string"&&t in n)?So(n[t],e):!1}function JA(e){return XA(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&YA(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t})}var Co=JA(function(e,t,n){Xh(e,t,n)});const nc=(e,...t)=>{const{href:n}=e.resolve(f(e.currentRoute));return t.map(r=>{const{href:i}=e.resolve({...r});return i==="/"||i==="#/"?!1:n.startsWith(i)}).some(Boolean)},Ni=(...e)=>(t,...n)=>{if(!n.length)return nc(t,...e);const[r,...i]=n.map(o=>{const s=e.find(a=>a.name===o);if(!s)throw new Error(`unknown comparative '${o}'`);return s});return nc(t,r,...i)};function m8(e){return e}const Li=(e,...t)=>Co({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),$i=(e,t={})=>Li(e,t),tm=$i("files-common-favorites"),nm=$i("files-common-search"),Vt=Ni(tm,nm),ZA=e=>[{path:"/search",component:e.App,children:[{name:nm.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope"]}}]},{path:"/favorites",component:e.App,children:[{name:tm.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Kn=(e,t={})=>Li(e,t),rm=Kn("files-spaces-projects"),rc=Kn("files-spaces-generic"),xt=Ni(rm,rc),ex=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:rm.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:rc.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],Fn=(e,t={})=>Li(e,t),tx=Fn("files-shares"),Hs=Fn("files-shares-with-me"),ic=Fn("files-shares-with-others"),oc=Fn("files-shares-via-link"),Mt=Ni(Hs,ic,oc),nx=e=>[{name:tx.name,path:"/shares",component:e.App,redirect:Hs,children:[{name:Hs.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:ic.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:oc.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Mi=(e,t={})=>Li(e,t),sc=Mi("files-public-link"),ac=Mi("files-public-upload"),_n=Ni(sc,ac),rx=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:sc.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:ac.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Hr=(e,t={})=>Li(e,t),im=Hr("files-trash-generic"),om=Hr("files-trash-overview"),yn=Ni(im,om),ix=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:om.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:im.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function sm(e){return{applicationConfig:B(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const ox=["anonymous","user","idp","publicLink","hybrid"],Ar=e=>wr(e),He=()=>Ar("$router"),Ht=()=>He().currentRoute,lc=e=>e.path.split("/")[1],sx=()=>{const e=Ht();return B(()=>lc(f(e)))},sr=(e,t={},n)=>{const r=n?.configStore||dt();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...re.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!Tt.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},ax=(e,t)=>{const n=document.querySelector("base"),r=!!n,i=new URL(window.location.href.split("#")[0]);return i.search="",r?i.pathname=new URL(n.href).pathname:i.pathname.endsWith("/index.html")&&(i.pathname=i.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?i.pathname=[...i.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):i[r?"pathname":"hash"]=e.resolve(t).href,i.href},ar=Me.defineStore("apps",()=>{const e=le({}),t=le({}),n=le([]),r=B(()=>Object.keys(f(e))),i=(l,u)=>{l.id&&(l.extensions&&l.extensions.forEach(c=>{o({appId:l.id,data:c})}),f(e)[l.id]={defaultExtension:l.defaultExtension||"",icon:"check_box_outline_blank",name:l.name||l.id,translations:u,...l})},o=({appId:l,data:u})=>{f(n).push({...u,app:l,hasPriority:u.hasPriority||f(t)?.[l]?.priorityExtensions?.includes(u.extension)||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:i,registerFileExtension:o,loadExternalAppConfig:({appId:l,config:u})=>{t.value={...f(t),[l]:u}},isAppEnabled:l=>f(r).includes(l)}}),li=Me.defineStore("auth",()=>{const e=le(),t=le(!1),n=le(!1),r=le(),i=le(),o=le(),s=le(!1),a=m=>{e.value=m},l=m=>{t.value=m},u=m=>{n.value=m},c=m=>{r.value=m.publicLinkToken,i.value=m.publicLinkPassword,o.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:i,publicLinkType:o,publicLinkContextReady:s,setAccessToken:a,setIdpContextReady:l,setUserContextReady:u,setPublicLinkContext:c,clearUserContext:()=>{a(null),l(null),u(null)},clearPublicLinkContext:()=>{c({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),am={core:{"support-sse":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:re.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},en=Me.defineStore("capabilities",()=>{const e=le(!1),t=le(am),n=ee=>{t.value=Co({...am},ee.capabilities),e.value=!0},r=B(()=>f(t).core["support-sse"]),i=B(()=>f(t).core["support-radicale"]),o=B(()=>f(t).graph["personal-data-export"]),s=B(()=>f(t).core.status),a=B(()=>f(t).dav.reports),l=B(()=>f(t).dav.trashbin),u=B(()=>f(t).spaces.max_quota),c=B(()=>f(t).spaces.projects),p=B(()=>f(t).graph.users.create_disabled),d=B(()=>f(t).graph.users.delete_disabled),m=B(()=>f(t).graph.users.change_password_self_disabled),b=B(()=>f(t).graph.users.read_only_attributes),w=B(()=>f(t).graph.users.edit_login_allowed_disabled),S=B(()=>f(t).files.app_providers),y=B(()=>f(t).files.favorites),g=B(()=>f(t).files.archivers),v=B(()=>f(t).files.privateLinks),h=B(()=>f(t).files.permanent_deletion),E=B(()=>f(t).files.tags),T=B(()=>f(t).files.undelete),R=B(()=>f(t).files_sharing.api_enabled),x=B(()=>f(t).files_sharing.can_rename),A=B(()=>f(t).files_sharing.allow_custom),N=B(()=>f(t).files_sharing.public?.enabled),W=B(()=>f(t).files_sharing.public?.can_edit),O=B(()=>f(t).files_sharing.public?.can_contribute),D=B(()=>f(t).files_sharing.public?.alias),V=B(()=>f(t).files_sharing.public?.default_permissions),L=B(()=>f(t).files_sharing.public?.password.enforced_for),te=B(()=>f(t).files_sharing.search_min_length),Y=B(()=>f(t).files_sharing.user?.profile_picture),se=B(()=>f(t).files.tus_support?.max_chunk_size),he=B(()=>f(t).files.tus_support?.extension),ae=B(()=>f(t).files.tus_support?.http_method_override),we=B(()=>f(t).notifications["ocs-endpoints"]),Q=B(()=>f(t).password_policy),ie=B(()=>f(t).search.property?.mtime),ce=B(()=>f(t).search.property?.mediatype),Ae=B(()=>f(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:s,supportSSE:r,supportRadicale:i,personalDataExport:o,davReports:a,davTrashbin:l,spacesMaxQuota:u,spacesProjects:c,graphUsersCreateDisabled:p,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:m,graphUsersEditLoginAllowedDisabled:w,graphUsersReadOnlyAttributes:b,filesAppProviders:S,filesFavorites:y,filesArchivers:g,filesPrivateLinks:v,filesPermanentDeletion:h,filesTags:E,filesUndelete:T,sharingApiEnabled:R,sharingCanRename:x,sharingAllowCustom:A,sharingPublicEnabled:N,sharingPublicCanEdit:W,sharingPublicCanContribute:O,sharingPublicAlias:D,sharingPublicDefaultPermissions:V,sharingPublicPasswordEnforcedFor:L,sharingSearchMinLength:te,sharingUserProfilePicture:Y,tusMaxChunkSize:se,tusExtension:he,tusHttpMethodOverride:ae,notificationsOcsEndpoints:we,passwordPolicy:Q,searchLastMofifiedDate:ie,searchMediaType:ce,searchContent:Ae}});class lx{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class lm{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new lx(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const Ks=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const i=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!i)return null;const{id:o}=i;return e.driveItems.getDriveItem(o.split("!")[0],o)},cx=({sharedAncestor:e,matchingSpace:t})=>t?Kn("files-spaces-generic",sr(t,{path:e.path,fileId:e.id})):{},cm=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const i=r?.remoteItem?.permissions||[];if(!i.length)return;const o=[];i.forEach(s=>{if(s["@libre.graph.permissions.actions"]){o.push(...s["@libre.graph.permissions.actions"]);return}const a=e.graphRoles[s.roles[0]];if(!a)return;const l=a.rolePermissions.flatMap(u=>u.allowedResourceActions);o.push(...l)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(o)]})},ux=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},Gs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},fx="thead-clicked",dx="highlight",px="rowMounted",hx="contextmenuClicked",um="itemDropped",mx="itemDragged";let gx="";const yx=()=>gx,vx=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),bx=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),wx=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var pt=(e=>(e.Desc="desc",e.Asc="asc",e))(pt||{});let fm=0;const ci=(e="")=>(e=e||"",fm+=1,e+fm),dm=e=>e?[{name:"name",sortable:!0,sortDir:pt.Asc},{name:"size",sortable:!0,sortDir:pt.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:pt.Asc},{name:"owner",sortable:"displayName",sortDir:pt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:pt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:pt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:pt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function g8(e){return e}const pm=[{label:"A-Z",name:"name",sortable:!0,sortDir:pt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:pt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:pt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:pt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:pt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:pt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:pt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:pt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:pt.Desc}],Sx=e=>e?pm.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],Ex=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),Tx=de.z.object({icon:de.z.string(),name:de.z.string(),secure_view:de.z.boolean().optional().default(!1),target_ext:de.z.string().optional()}),Ax=de.z.object({allow_creation:de.z.boolean().optional(),app_providers:de.z.array(Tx),default_application:de.z.string().optional(),description:de.z.string().optional(),ext:de.z.string().optional(),mime_type:de.z.string(),name:de.z.string().optional()}),hm=de.z.object({"mime-types":de.z.array(Ax)});class xx{_mimeTypes=le([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=re.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:hm});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return f(this._mimeTypes)}get templateMimeTypes(){return f(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(f(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return f(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var mm={},Qs={};Qs.byteLength=kx,Qs.toByteArray=Ix,Qs.fromByteArray=_x;for(var lr=[],Dn=[],Rx=typeof Uint8Array<"u"?Uint8Array:Array,cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi=0,Cx=cc.length;Bi<Cx;++Bi)lr[Bi]=cc[Bi],Dn[cc.charCodeAt(Bi)]=Bi;Dn[45]=62,Dn[95]=63;function gm(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function kx(e){var t=gm(e),n=t[0],r=t[1];return(n+r)*3/4-r}function Px(e,t,n){return(t+n)*3/4-n}function Ix(e){var t,n=gm(e),r=n[0],i=n[1],o=new Rx(Px(e,r,i)),s=0,a=i>0?r-4:r,l;for(l=0;l<a;l+=4)t=Dn[e.charCodeAt(l)]<<18|Dn[e.charCodeAt(l+1)]<<12|Dn[e.charCodeAt(l+2)]<<6|Dn[e.charCodeAt(l+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Dn[e.charCodeAt(l)]<<2|Dn[e.charCodeAt(l+1)]>>4,o[s++]=t&255),i===1&&(t=Dn[e.charCodeAt(l)]<<10|Dn[e.charCodeAt(l+1)]<<4|Dn[e.charCodeAt(l+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function Ox(e){return lr[e>>18&63]+lr[e>>12&63]+lr[e>>6&63]+lr[e&63]}function Fx(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Ox(r));return i.join("")}function _x(e){for(var t,n=e.length,r=n%3,i=[],o=16383,s=0,a=n-r;s<a;s+=o)i.push(Fx(e,s,s+o>a?a:s+o));return r===1?(t=e[n-1],i.push(lr[t>>2]+lr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(lr[t>>10]+lr[t>>4&63]+lr[t<<2&63]+"=")),i.join("")}var uc={};uc.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,l=(1<<a)-1,u=l>>1,c=-7,p=n?i-1:0,d=n?-1:1,m=e[t+p];for(p+=d,o=m&(1<<-c)-1,m>>=-c,c+=a;c>0;o=o*256+e[t+p],p+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=s*256+e[t+p],p+=d,c-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-u}return(m?-1:1)*s*Math.pow(2,o-r)},uc.write=function(e,t,n,r,i,o){var s,a,l,u=o*8-i-1,c=(1<<u)-1,p=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,b=r?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(s++,l/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(t*l-1)*Math.pow(2,i),s=s+p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+m]=a&255,m+=b,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+m]=s&255,m+=b,s/=256,u-=8);e[n+m-b]|=w*128};(function(e){const t=Qs,n=uc,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i;const{Uint8Array:o,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 M=new o(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,o.prototype),Object.setPrototypeOf(M,k),M.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(M){if(M>i)throw new RangeError('The value "'+M+'" is invalid for option "size"');const k=new o(M);return Object.setPrototypeOf(k,c.prototype),k}function c(M,k,I){if(typeof M=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(M)}return p(M,k,I)}c.poolSize=8192;function p(M,k,I){if(typeof M=="string")return w(M,k);if(s.isView(M))return y(M);if(M==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(Et(M,s)||M&&Et(M.buffer,s)||typeof a<"u"&&(Et(M,a)||M&&Et(M.buffer,a)))return g(M,k,I);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=M.valueOf&&M.valueOf();if(J!=null&&J!==M)return c.from(J,k,I);const G=v(M);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return c.from(M[Symbol.toPrimitive]("string"),k,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M)}c.from=function(M,k,I){return p(M,k,I)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function d(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function m(M,k,I){return d(M),M<=0?u(M):k!==void 0?typeof I=="string"?u(M).fill(k,I):u(M).fill(k):u(M)}c.alloc=function(M,k,I){return m(M,k,I)};function b(M){return d(M),u(M<0?0:h(M)|0)}c.allocUnsafe=function(M){return b(M)},c.allocUnsafeSlow=function(M){return b(M)};function w(M,k){if((typeof k!="string"||k==="")&&(k="utf8"),!c.isEncoding(k))throw new TypeError("Unknown encoding: "+k);const I=T(M,k)|0;let J=u(I);const G=J.write(M,k);return G!==I&&(J=J.slice(0,G)),J}function S(M){const k=M.length<0?0:h(M.length)|0,I=u(k);for(let J=0;J<k;J+=1)I[J]=M[J]&255;return I}function y(M){if(Et(M,o)){const k=new o(M);return g(k.buffer,k.byteOffset,k.byteLength)}return S(M)}function g(M,k,I){if(k<0||M.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(M.byteLength<k+(I||0))throw new RangeError('"length" is outside of buffer bounds');let J;return k===void 0&&I===void 0?J=new o(M):I===void 0?J=new o(M,k):J=new o(M,k,I),Object.setPrototypeOf(J,c.prototype),J}function v(M){if(c.isBuffer(M)){const k=h(M.length)|0,I=u(k);return I.length===0||M.copy(I,0,0,k),I}if(M.length!==void 0)return typeof M.length!="number"||Bt(M.length)?u(0):S(M);if(M.type==="Buffer"&&Array.isArray(M.data))return S(M.data)}function h(M){if(M>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return M|0}function E(M){return+M!=M&&(M=0),c.alloc(+M)}c.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==c.prototype},c.compare=function(k,I){if(Et(k,o)&&(k=c.from(k,k.offset,k.byteLength)),Et(I,o)&&(I=c.from(I,I.offset,I.byteLength)),!c.isBuffer(k)||!c.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===I)return 0;let J=k.length,G=I.length;for(let oe=0,ne=Math.min(J,G);oe<ne;++oe)if(k[oe]!==I[oe]){J=k[oe],G=I[oe];break}return J<G?-1:G<J?1:0},c.isEncoding=function(k){switch(String(k).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(k,I){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return c.alloc(0);let J;if(I===void 0)for(I=0,J=0;J<k.length;++J)I+=k[J].length;const G=c.allocUnsafe(I);let oe=0;for(J=0;J<k.length;++J){let ne=k[J];if(Et(ne,o))oe+ne.length>G.length?(c.isBuffer(ne)||(ne=c.from(ne)),ne.copy(G,oe)):o.prototype.set.call(G,ne,oe);else if(c.isBuffer(ne))ne.copy(G,oe);else throw new TypeError('"list" argument must be an Array of Buffers');oe+=ne.length}return G};function T(M,k){if(c.isBuffer(M))return M.length;if(s.isView(M)||Et(M,s))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);const I=M.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&I===0)return 0;let G=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return We(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return Xe(M).length;default:if(G)return J?-1:We(M).length;k=(""+k).toLowerCase(),G=!0}}c.byteLength=T;function R(M,k,I){let J=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,k>>>=0,I<=k))return"";for(M||(M="utf8");;)switch(M){case"hex":return Q(this,k,I);case"utf8":case"utf-8":return Y(this,k,I);case"ascii":return ae(this,k,I);case"latin1":case"binary":return we(this,k,I);case"base64":return te(this,k,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,k,I);default:if(J)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),J=!0}}c.prototype._isBuffer=!0;function x(M,k,I){const J=M[k];M[k]=M[I],M[I]=J}c.prototype.swap16=function(){const k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<k;I+=2)x(this,I,I+1);return this},c.prototype.swap32=function(){const k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<k;I+=4)x(this,I,I+3),x(this,I+1,I+2);return this},c.prototype.swap64=function(){const k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<k;I+=8)x(this,I,I+7),x(this,I+1,I+6),x(this,I+2,I+5),x(this,I+3,I+4);return this},c.prototype.toString=function(){const k=this.length;return k===0?"":arguments.length===0?Y(this,0,k):R.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(k){if(!c.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:c.compare(this,k)===0},c.prototype.inspect=function(){let k="";const I=e.INSPECT_MAX_BYTES;return k=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(k+=" ... "),"<Buffer "+k+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(k,I,J,G,oe){if(Et(k,o)&&(k=c.from(k,k.offset,k.byteLength)),!c.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(I===void 0&&(I=0),J===void 0&&(J=k?k.length:0),G===void 0&&(G=0),oe===void 0&&(oe=this.length),I<0||J>k.length||G<0||oe>this.length)throw new RangeError("out of range index");if(G>=oe&&I>=J)return 0;if(G>=oe)return-1;if(I>=J)return 1;if(I>>>=0,J>>>=0,G>>>=0,oe>>>=0,this===k)return 0;let ne=oe-G,Pe=J-I;const Le=Math.min(ne,Pe),qe=this.slice(G,oe),Ze=k.slice(I,J);for(let et=0;et<Le;++et)if(qe[et]!==Ze[et]){ne=qe[et],Pe=Ze[et];break}return ne<Pe?-1:Pe<ne?1:0};function A(M,k,I,J,G){if(M.length===0)return-1;if(typeof I=="string"?(J=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,Bt(I)&&(I=G?0:M.length-1),I<0&&(I=M.length+I),I>=M.length){if(G)return-1;I=M.length-1}else if(I<0)if(G)I=0;else return-1;if(typeof k=="string"&&(k=c.from(k,J)),c.isBuffer(k))return k.length===0?-1:N(M,k,I,J,G);if(typeof k=="number")return k=k&255,typeof o.prototype.indexOf=="function"?G?o.prototype.indexOf.call(M,k,I):o.prototype.lastIndexOf.call(M,k,I):N(M,[k],I,J,G);throw new TypeError("val must be string, number or Buffer")}function N(M,k,I,J,G){let oe=1,ne=M.length,Pe=k.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(M.length<2||k.length<2)return-1;oe=2,ne/=2,Pe/=2,I/=2}function Le(Ze,et){return oe===1?Ze[et]:Ze.readUInt16BE(et*oe)}let qe;if(G){let Ze=-1;for(qe=I;qe<ne;qe++)if(Le(M,qe)===Le(k,Ze===-1?0:qe-Ze)){if(Ze===-1&&(Ze=qe),qe-Ze+1===Pe)return Ze*oe}else Ze!==-1&&(qe-=qe-Ze),Ze=-1}else for(I+Pe>ne&&(I=ne-Pe),qe=I;qe>=0;qe--){let Ze=!0;for(let et=0;et<Pe;et++)if(Le(M,qe+et)!==Le(k,et)){Ze=!1;break}if(Ze)return qe}return-1}c.prototype.includes=function(k,I,J){return this.indexOf(k,I,J)!==-1},c.prototype.indexOf=function(k,I,J){return A(this,k,I,J,!0)},c.prototype.lastIndexOf=function(k,I,J){return A(this,k,I,J,!1)};function W(M,k,I,J){I=Number(I)||0;const G=M.length-I;J?(J=Number(J),J>G&&(J=G)):J=G;const oe=k.length;J>oe/2&&(J=oe/2);let ne;for(ne=0;ne<J;++ne){const Pe=parseInt(k.substr(ne*2,2),16);if(Bt(Pe))return ne;M[I+ne]=Pe}return ne}function O(M,k,I,J){return lt(We(k,M.length-I),M,I,J)}function D(M,k,I,J){return lt(Ge(k),M,I,J)}function V(M,k,I,J){return lt(Xe(k),M,I,J)}function L(M,k,I,J){return lt(Qe(k,M.length-I),M,I,J)}c.prototype.write=function(k,I,J,G){if(I===void 0)G="utf8",J=this.length,I=0;else if(J===void 0&&typeof I=="string")G=I,J=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(J)?(J=J>>>0,G===void 0&&(G="utf8")):(G=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const oe=this.length-I;if((J===void 0||J>oe)&&(J=oe),k.length>0&&(J<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");G||(G="utf8");let ne=!1;for(;;)switch(G){case"hex":return W(this,k,I,J);case"utf8":case"utf-8":return O(this,k,I,J);case"ascii":case"latin1":case"binary":return D(this,k,I,J);case"base64":return V(this,k,I,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,k,I,J);default:if(ne)throw new TypeError("Unknown encoding: "+G);G=(""+G).toLowerCase(),ne=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(M,k,I){return k===0&&I===M.length?t.fromByteArray(M):t.fromByteArray(M.slice(k,I))}function Y(M,k,I){I=Math.min(M.length,I);const J=[];let G=k;for(;G<I;){const oe=M[G];let ne=null,Pe=oe>239?4:oe>223?3:oe>191?2:1;if(G+Pe<=I){let Le,qe,Ze,et;switch(Pe){case 1:oe<128&&(ne=oe);break;case 2:Le=M[G+1],(Le&192)===128&&(et=(oe&31)<<6|Le&63,et>127&&(ne=et));break;case 3:Le=M[G+1],qe=M[G+2],(Le&192)===128&&(qe&192)===128&&(et=(oe&15)<<12|(Le&63)<<6|qe&63,et>2047&&(et<55296||et>57343)&&(ne=et));break;case 4:Le=M[G+1],qe=M[G+2],Ze=M[G+3],(Le&192)===128&&(qe&192)===128&&(Ze&192)===128&&(et=(oe&15)<<18|(Le&63)<<12|(qe&63)<<6|Ze&63,et>65535&&et<1114112&&(ne=et))}}ne===null?(ne=65533,Pe=1):ne>65535&&(ne-=65536,J.push(ne>>>10&1023|55296),ne=56320|ne&1023),J.push(ne),G+=Pe}return he(J)}const se=4096;function he(M){const k=M.length;if(k<=se)return String.fromCharCode.apply(String,M);let I="",J=0;for(;J<k;)I+=String.fromCharCode.apply(String,M.slice(J,J+=se));return I}function ae(M,k,I){let J="";I=Math.min(M.length,I);for(let G=k;G<I;++G)J+=String.fromCharCode(M[G]&127);return J}function we(M,k,I){let J="";I=Math.min(M.length,I);for(let G=k;G<I;++G)J+=String.fromCharCode(M[G]);return J}function Q(M,k,I){const J=M.length;(!k||k<0)&&(k=0),(!I||I<0||I>J)&&(I=J);let G="";for(let oe=k;oe<I;++oe)G+=jt[M[oe]];return G}function ie(M,k,I){const J=M.slice(k,I);let G="";for(let oe=0;oe<J.length-1;oe+=2)G+=String.fromCharCode(J[oe]+J[oe+1]*256);return G}c.prototype.slice=function(k,I){const J=this.length;k=~~k,I=I===void 0?J:~~I,k<0?(k+=J,k<0&&(k=0)):k>J&&(k=J),I<0?(I+=J,I<0&&(I=0)):I>J&&(I=J),I<k&&(I=k);const G=this.subarray(k,I);return Object.setPrototypeOf(G,c.prototype),G};function ce(M,k,I){if(M%1!==0||M<0)throw new RangeError("offset is not uint");if(M+k>I)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=this[k],oe=1,ne=0;for(;++ne<I&&(oe*=256);)G+=this[k+ne]*oe;return G},c.prototype.readUintBE=c.prototype.readUIntBE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=this[k+--I],oe=1;for(;I>0&&(oe*=256);)G+=this[k+--I]*oe;return G},c.prototype.readUint8=c.prototype.readUInt8=function(k,I){return k=k>>>0,I||ce(k,1,this.length),this[k]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(k,I){return k=k>>>0,I||ce(k,2,this.length),this[k]|this[k+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(k,I){return k=k>>>0,I||ce(k,2,this.length),this[k]<<8|this[k+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},c.prototype.readBigUInt64LE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=I+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,oe=this[++k]+this[++k]*2**8+this[++k]*2**16+J*2**24;return BigInt(G)+(BigInt(oe)<<BigInt(32))}),c.prototype.readBigUInt64BE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=I*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],oe=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+J;return(BigInt(G)<<BigInt(32))+BigInt(oe)}),c.prototype.readIntLE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=this[k],oe=1,ne=0;for(;++ne<I&&(oe*=256);)G+=this[k+ne]*oe;return oe*=128,G>=oe&&(G-=Math.pow(2,8*I)),G},c.prototype.readIntBE=function(k,I,J){k=k>>>0,I=I>>>0,J||ce(k,I,this.length);let G=I,oe=1,ne=this[k+--G];for(;G>0&&(oe*=256);)ne+=this[k+--G]*oe;return oe*=128,ne>=oe&&(ne-=Math.pow(2,8*I)),ne},c.prototype.readInt8=function(k,I){return k=k>>>0,I||ce(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},c.prototype.readInt16LE=function(k,I){k=k>>>0,I||ce(k,2,this.length);const J=this[k]|this[k+1]<<8;return J&32768?J|4294901760:J},c.prototype.readInt16BE=function(k,I){k=k>>>0,I||ce(k,2,this.length);const J=this[k+1]|this[k]<<8;return J&32768?J|4294901760:J},c.prototype.readInt32LE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},c.prototype.readInt32BE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},c.prototype.readBigInt64LE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(J<<24);return(BigInt(G)<<BigInt(32))+BigInt(I+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),c.prototype.readBigInt64BE=ct(function(k){k=k>>>0,Oe(k,"offset");const I=this[k],J=this[k+7];(I===void 0||J===void 0)&&Ce(k,this.length-8);const G=(I<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(G)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+J)}),c.prototype.readFloatLE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),n.read(this,k,!0,23,4)},c.prototype.readFloatBE=function(k,I){return k=k>>>0,I||ce(k,4,this.length),n.read(this,k,!1,23,4)},c.prototype.readDoubleLE=function(k,I){return k=k>>>0,I||ce(k,8,this.length),n.read(this,k,!0,52,8)},c.prototype.readDoubleBE=function(k,I){return k=k>>>0,I||ce(k,8,this.length),n.read(this,k,!1,52,8)};function Ae(M,k,I,J,G,oe){if(!c.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>G||k<oe)throw new RangeError('"value" argument is out of bounds');if(I+J>M.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(k,I,J,G){if(k=+k,I=I>>>0,J=J>>>0,!G){const Pe=Math.pow(2,8*J)-1;Ae(this,k,I,J,Pe,0)}let oe=1,ne=0;for(this[I]=k&255;++ne<J&&(oe*=256);)this[I+ne]=k/oe&255;return I+J},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(k,I,J,G){if(k=+k,I=I>>>0,J=J>>>0,!G){const Pe=Math.pow(2,8*J)-1;Ae(this,k,I,J,Pe,0)}let oe=J-1,ne=1;for(this[I+oe]=k&255;--oe>=0&&(ne*=256);)this[I+oe]=k/ne&255;return I+J},c.prototype.writeUint8=c.prototype.writeUInt8=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,1,255,0),this[I]=k&255,I+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,65535,0),this[I]=k&255,this[I+1]=k>>>8,I+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,65535,0),this[I]=k>>>8,this[I+1]=k&255,I+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,4294967295,0),this[I+3]=k>>>24,this[I+2]=k>>>16,this[I+1]=k>>>8,this[I]=k&255,I+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,4294967295,0),this[I]=k>>>24,this[I+1]=k>>>16,this[I+2]=k>>>8,this[I+3]=k&255,I+4};function ee(M,k,I,J,G){De(k,J,G,M,I,7);let oe=Number(k&BigInt(4294967295));M[I++]=oe,oe=oe>>8,M[I++]=oe,oe=oe>>8,M[I++]=oe,oe=oe>>8,M[I++]=oe;let ne=Number(k>>BigInt(32)&BigInt(4294967295));return M[I++]=ne,ne=ne>>8,M[I++]=ne,ne=ne>>8,M[I++]=ne,ne=ne>>8,M[I++]=ne,I}function F(M,k,I,J,G){De(k,J,G,M,I,7);let oe=Number(k&BigInt(4294967295));M[I+7]=oe,oe=oe>>8,M[I+6]=oe,oe=oe>>8,M[I+5]=oe,oe=oe>>8,M[I+4]=oe;let ne=Number(k>>BigInt(32)&BigInt(4294967295));return M[I+3]=ne,ne=ne>>8,M[I+2]=ne,ne=ne>>8,M[I+1]=ne,ne=ne>>8,M[I]=ne,I+8}c.prototype.writeBigUInt64LE=ct(function(k,I=0){return ee(this,k,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=ct(function(k,I=0){return F(this,k,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(k,I,J,G){if(k=+k,I=I>>>0,!G){const Le=Math.pow(2,8*J-1);Ae(this,k,I,J,Le-1,-Le)}let oe=0,ne=1,Pe=0;for(this[I]=k&255;++oe<J&&(ne*=256);)k<0&&Pe===0&&this[I+oe-1]!==0&&(Pe=1),this[I+oe]=(k/ne>>0)-Pe&255;return I+J},c.prototype.writeIntBE=function(k,I,J,G){if(k=+k,I=I>>>0,!G){const Le=Math.pow(2,8*J-1);Ae(this,k,I,J,Le-1,-Le)}let oe=J-1,ne=1,Pe=0;for(this[I+oe]=k&255;--oe>=0&&(ne*=256);)k<0&&Pe===0&&this[I+oe+1]!==0&&(Pe=1),this[I+oe]=(k/ne>>0)-Pe&255;return I+J},c.prototype.writeInt8=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,1,127,-128),k<0&&(k=255+k+1),this[I]=k&255,I+1},c.prototype.writeInt16LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,32767,-32768),this[I]=k&255,this[I+1]=k>>>8,I+2},c.prototype.writeInt16BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,2,32767,-32768),this[I]=k>>>8,this[I+1]=k&255,I+2},c.prototype.writeInt32LE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,2147483647,-2147483648),this[I]=k&255,this[I+1]=k>>>8,this[I+2]=k>>>16,this[I+3]=k>>>24,I+4},c.prototype.writeInt32BE=function(k,I,J){return k=+k,I=I>>>0,J||Ae(this,k,I,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[I]=k>>>24,this[I+1]=k>>>16,this[I+2]=k>>>8,this[I+3]=k&255,I+4},c.prototype.writeBigInt64LE=ct(function(k,I=0){return ee(this,k,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=ct(function(k,I=0){return F(this,k,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(M,k,I,J,G,oe){if(I+J>M.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function q(M,k,I,J,G){return k=+k,I=I>>>0,G||C(M,k,I,4),n.write(M,k,I,J,23,4),I+4}c.prototype.writeFloatLE=function(k,I,J){return q(this,k,I,!0,J)},c.prototype.writeFloatBE=function(k,I,J){return q(this,k,I,!1,J)};function K(M,k,I,J,G){return k=+k,I=I>>>0,G||C(M,k,I,8),n.write(M,k,I,J,52,8),I+8}c.prototype.writeDoubleLE=function(k,I,J){return K(this,k,I,!0,J)},c.prototype.writeDoubleBE=function(k,I,J){return K(this,k,I,!1,J)},c.prototype.copy=function(k,I,J,G){if(!c.isBuffer(k))throw new TypeError("argument should be a Buffer");if(J||(J=0),!G&&G!==0&&(G=this.length),I>=k.length&&(I=k.length),I||(I=0),G>0&&G<J&&(G=J),G===J||k.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("sourceEnd out of bounds");G>this.length&&(G=this.length),k.length-I<G-J&&(G=k.length-I+J);const oe=G-J;return this===k&&typeof o.prototype.copyWithin=="function"?this.copyWithin(I,J,G):o.prototype.set.call(k,this.subarray(J,G),I),oe},c.prototype.fill=function(k,I,J,G){if(typeof k=="string"){if(typeof I=="string"?(G=I,I=0,J=this.length):typeof J=="string"&&(G=J,J=this.length),G!==void 0&&typeof G!="string")throw new TypeError("encoding must be a string");if(typeof G=="string"&&!c.isEncoding(G))throw new TypeError("Unknown encoding: "+G);if(k.length===1){const ne=k.charCodeAt(0);(G==="utf8"&&ne<128||G==="latin1")&&(k=ne)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(I<0||this.length<I||this.length<J)throw new RangeError("Out of range index");if(J<=I)return this;I=I>>>0,J=J===void 0?this.length:J>>>0,k||(k=0);let oe;if(typeof k=="number")for(oe=I;oe<J;++oe)this[oe]=k;else{const ne=c.isBuffer(k)?k:c.from(k,G),Pe=ne.length;if(Pe===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(oe=0;oe<J-I;++oe)this[oe+I]=ne[oe%Pe]}return this};const j={};function H(M,k,I){j[M]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${M}]`,this.stack,delete this.name}get code(){return M}set code(G){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:G,writable:!0})}toString(){return`${this.name} [${M}]: ${this.message}`}}}H("ERR_BUFFER_OUT_OF_BOUNDS",function(M){return M?`${M} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(M,k){return`The "${M}" argument must be of type number. Received type ${typeof k}`},TypeError),H("ERR_OUT_OF_RANGE",function(M,k,I){let J=`The value of "${M}" is out of range.`,G=I;return Number.isInteger(I)&&Math.abs(I)>2**32?G=ge(String(I)):typeof I=="bigint"&&(G=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(G=ge(G)),G+="n"),J+=` It must be ${k}. Received ${G}`,J},RangeError);function ge(M){let k="",I=M.length;const J=M[0]==="-"?1:0;for(;I>=J+4;I-=3)k=`_${M.slice(I-3,I)}${k}`;return`${M.slice(0,I)}${k}`}function xe(M,k,I){Oe(k,"offset"),(M[k]===void 0||M[k+I]===void 0)&&Ce(k,M.length-(I+1))}function De(M,k,I,J,G,oe){if(M>I||M<k){const ne=typeof k=="bigint"?"n":"";let Pe;throw k===0||k===BigInt(0)?Pe=`>= 0${ne} and < 2${ne} ** ${(oe+1)*8}${ne}`:Pe=`>= -(2${ne} ** ${(oe+1)*8-1}${ne}) and < 2 ** ${(oe+1)*8-1}${ne}`,new j.ERR_OUT_OF_RANGE("value",Pe,M)}xe(J,G,oe)}function Oe(M,k){if(typeof M!="number")throw new j.ERR_INVALID_ARG_TYPE(k,"number",M)}function Ce(M,k,I){throw Math.floor(M)!==M?(Oe(M,I),new j.ERR_OUT_OF_RANGE("offset","an integer",M)):k<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${k}`,M)}const Fe=/[^+/0-9A-Za-z-_]/g;function ye(M){if(M=M.split("=")[0],M=M.trim().replace(Fe,""),M.length<2)return"";for(;M.length%4!==0;)M=M+"=";return M}function We(M,k){k=k||1/0;let I;const J=M.length;let G=null;const oe=[];for(let ne=0;ne<J;++ne){if(I=M.charCodeAt(ne),I>55295&&I<57344){if(!G){if(I>56319){(k-=3)>-1&&oe.push(239,191,189);continue}else if(ne+1===J){(k-=3)>-1&&oe.push(239,191,189);continue}G=I;continue}if(I<56320){(k-=3)>-1&&oe.push(239,191,189),G=I;continue}I=(G-55296<<10|I-56320)+65536}else G&&(k-=3)>-1&&oe.push(239,191,189);if(G=null,I<128){if((k-=1)<0)break;oe.push(I)}else if(I<2048){if((k-=2)<0)break;oe.push(I>>6|192,I&63|128)}else if(I<65536){if((k-=3)<0)break;oe.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((k-=4)<0)break;oe.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return oe}function Ge(M){const k=[];for(let I=0;I<M.length;++I)k.push(M.charCodeAt(I)&255);return k}function Qe(M,k){let I,J,G;const oe=[];for(let ne=0;ne<M.length&&!((k-=2)<0);++ne)I=M.charCodeAt(ne),J=I>>8,G=I%256,oe.push(G),oe.push(J);return oe}function Xe(M){return t.toByteArray(ye(M))}function lt(M,k,I,J){let G;for(G=0;G<J&&!(G+I>=k.length||G>=M.length);++G)k[G+I]=M[G];return G}function Et(M,k){return M instanceof k||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===k.name}function Bt(M){return M!==M}const jt=(function(){const M="0123456789abcdef",k=new Array(256);for(let I=0;I<16;++I){const J=I*16;for(let G=0;G<16;++G)k[J+G]=M[I]+M[G]}return k})();function ct(M){return typeof BigInt>"u"?Ne:M}function Ne(){throw new Error("BigInt not supported")}})(mm);const Kr=mm.Buffer;class ji extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Dx extends ji{name="ApiError"}const fc=(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)},dc=(e="")=>e.split("/").map(encodeURIComponent).join("/"),Nx=e=>{const t=[],n=(r,i="")=>Object.keys(r).forEach(o=>{Xl(r[o])?n(r[o],`${i}${o}.`):t.push(`${i}${o}`)});return n(e),t},pc=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[i,o,s]=n.split(".").map(Number);return{major:i,minor:o,patch:s,pre:r}},hc=(e,t)=>{const n=pc(e),r=pc(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class Lx{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,i=le([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=B(()=>{const o=f(i).filter(s=>s.enabled).sort((s,a)=>hc(a.version,s.version));return o.length?o[0]:null}),this.available=B(()=>!!f(this.capability)?.version)}async triggerDownload(t){if(!f(this.available))throw new ji("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new ji("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new ji("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),i;if(t.publicLinkPassword)try{const o=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+Kr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!o.ok)throw new re.HttpError("",o);const s=await o.blob();r=URL.createObjectURL(s),i=decodeURI(o.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return fc(r,i),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new ji("no archiver available");const t=f(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:re.urlJoin(this.serverUrl,t.archiver_url)}}const $x=new lm({ttl:10*1e3,capacity:250});class Mx{get filePreview(){return $x}}const mc=new Mx;class gc{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+Kr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class yc{instance;cancelToken;constructor(t,n){this.cancelToken=us.CancelToken.source(),this.instance=us.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 Co({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n?.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const i=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(i,r)}async internalRequestWithData(t,n,r,i){const o=await this.instance[t](n,r,this.obtainConfig(i));return this.processResponse(o,i)}}class Bx extends Error{name="RetriableError"}const jx=15e3;class Ux{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return SS.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(o=>o(n))},onclose:()=>{throw this.readyState=this.CLOSED,new Bx},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*jx)}})}fetchProvider(...t){const[n,r]=t,i={...r,...this.fetchOptions};return window.fetch(n,i)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==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 vc=null;const Vx=(e,t)=>(vc||(vc=new Ux(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),vc),qx=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Xt.v4(),"X-Requested-With":"XMLHttpRequest"}});class zx{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=Xt.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new yc({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new yc({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 Vx(this.configStore.serverUrl,qx({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=us.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=re.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=us.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=re.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=re.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 "+Kr.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 ym{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:Xt.v4(),callback:n},i=[r,...this.topics.get(t)||[]];return this.topics.set(t,i),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(i=>i.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Je=new ym;class vm{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const Xs=e=>({value:e,type:null}),Wx=e=>Xs(e),gt=e=>Xs(e),Ys=e=>Xs(e),Hx=e=>Xs(e),Kx={Permissions:gt("permissions"),IsFavorite:Ys("favorite"),FileId:gt("fileid"),FileParent:gt("file-parent"),Name:gt("name"),OwnerId:gt("owner-id"),OwnerDisplayName:gt("owner-display-name"),PrivateLink:gt("privatelink"),ContentLength:Ys("getcontentlength"),ContentSize:Ys("size"),LastModifiedDate:gt("getlastmodified"),Tags:Wx("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:gt("getetag"),MimeType:gt("getcontenttype"),ResourceType:Hx("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:gt("owner"),LockTime:gt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:gt("downloadURL"),Highlights:gt("highlights"),MetaPathForUser:gt("meta-path-for-user"),RemoteItemId:gt("remote-item-id"),HasPreview:Ys("has-preview"),ShareId:gt("shareid"),ShareRoot:gt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:gt("share-permissions"),TrashbinOriginalFilename:gt("trashbin-original-filename"),TrashbinOriginalLocation:gt("trashbin-original-location"),TrashbinDeletedDate:gt("trashbin-delete-datetime"),PublicLinkItemType:gt("public-link-item-type"),PublicLinkPermission:gt("public-link-permission"),PublicLinkExpiration:gt("public-link-expiration"),PublicLinkShareDate:gt("public-link-share-datetime"),PublicLinkShareOwner:gt("public-link-share-owner")},Ve=Object.fromEntries(Object.entries(Kx).map(([e,t])=>[e,t.value]));class ko{static Default=[Ve.Permissions,Ve.IsFavorite,Ve.FileId,Ve.FileParent,Ve.Name,Ve.LockDiscovery,Ve.ActiveLock,Ve.OwnerId,Ve.OwnerDisplayName,Ve.RemoteItemId,Ve.ShareRoot,Ve.ShareTypes,Ve.PrivateLink,Ve.ContentLength,Ve.ContentSize,Ve.LastModifiedDate,Ve.ETag,Ve.MimeType,Ve.ResourceType,Ve.Tags,Ve.Audio,Ve.Location,Ve.Image,Ve.Photo,Ve.HasPreview];static PublicLink=ko.Default.concat([Ve.PublicLinkItemType,Ve.PublicLinkPermission,Ve.PublicLinkExpiration,Ve.PublicLinkShareDate,Ve.PublicLinkShareOwner]);static Trashbin=[Ve.ContentLength,Ve.ResourceType,Ve.TrashbinOriginalLocation,Ve.TrashbinOriginalFilename,Ve.TrashbinDeletedDate,Ve.Permissions,Ve.FileParent];static DavNamespace=[Ve.ContentLength,Ve.LastModifiedDate,Ve.ETag,Ve.MimeType,Ve.ResourceType,Ve.LockDiscovery,Ve.ActiveLock]}var Gx="[object Symbol]";function Js(e){return typeof e=="symbol"||or(e)&&ii(e)==Gx}var Qx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xx=/^\w*$/;function Yx(e,t){if(Hn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Js(e)?!0:Xx.test(e)||!Qx.test(e)||t!=null&&e in Object(t)}var Jx="Expected a function";function bc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Jx);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(bc.Cache||Tr),n}bc.Cache=Tr;var Zx=500;function eR(e){var t=bc(e,function(r){return n.size===Zx&&n.clear(),r}),n=t.cache;return t}var tR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nR=/\\(\\)?/g,rR=eR(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tR,function(n,r,i,o){t.push(i?o.replace(nR,"$1"):r||n)}),t});function bm(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var wm=On?On.prototype:void 0,Sm=wm?wm.toString:void 0;function Em(e){if(typeof e=="string")return e;if(Hn(e))return bm(e,Em)+"";if(Js(e))return Sm?Sm.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function wc(e){return e==null?"":Em(e)}function Sc(e,t){return Hn(e)?e:Yx(e,t)?[e]:rR(wc(e))}function Tm(e){if(typeof e=="string"||Js(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Am(e,t){t=Sc(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Tm(t[n++])];return n&&n==r?e:void 0}function Ec(e,t,n){var r=e==null?void 0:Am(e,t);return r===void 0?n:r}var Tc={},Zs={exports:{}},xm;function Ac(){if(xm)return Zs.exports;xm=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(E,T,R){return Function.prototype.apply.call(E,T,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:n=function(E){return Object.getOwnPropertyNames(E)};function r(h){console&&console.warn&&console.warn(h)}var i=Number.isNaN||function(E){return E!==E};function o(){o.init.call(this)}Zs.exports=o,Zs.exports.once=y,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number"||h<0||i(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");s=h}}),o.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},o.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||i(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function l(h){return h._maxListeners===void 0?o.defaultMaxListeners:h._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(E){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var x=E==="error",A=this._events;if(A!==void 0)x=x&&A.error===void 0;else if(!x)return!1;if(x){var N;if(T.length>0&&(N=T[0]),N instanceof Error)throw N;var W=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw W.context=N,W}var O=A[E];if(O===void 0)return!1;if(typeof O=="function")t(O,this,T);else for(var D=O.length,V=b(O,D),R=0;R<D;++R)t(V[R],this,T);return!0};function u(h,E,T,R){var x,A,N;if(a(T),A=h._events,A===void 0?(A=h._events=Object.create(null),h._eventsCount=0):(A.newListener!==void 0&&(h.emit("newListener",E,T.listener?T.listener:T),A=h._events),N=A[E]),N===void 0)N=A[E]=T,++h._eventsCount;else if(typeof N=="function"?N=A[E]=R?[T,N]:[N,T]:R?N.unshift(T):N.push(T),x=l(h),x>0&&N.length>x&&!N.warned){N.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=h,W.type=E,W.count=N.length,r(W)}return h}o.prototype.addListener=function(E,T){return u(this,E,T,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(E,T){return u(this,E,T,!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 p(h,E,T){var R={fired:!1,wrapFn:void 0,target:h,type:E,listener:T},x=c.bind(R);return x.listener=T,R.wrapFn=x,x}o.prototype.once=function(E,T){return a(T),this.on(E,p(this,E,T)),this},o.prototype.prependOnceListener=function(E,T){return a(T),this.prependListener(E,p(this,E,T)),this},o.prototype.removeListener=function(E,T){var R,x,A,N,W;if(a(T),x=this._events,x===void 0)return this;if(R=x[E],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete x[E],x.removeListener&&this.emit("removeListener",E,R.listener||T));else if(typeof R!="function"){for(A=-1,N=R.length-1;N>=0;N--)if(R[N]===T||R[N].listener===T){W=R[N].listener,A=N;break}if(A<0)return this;A===0?R.shift():w(R,A),R.length===1&&(x[E]=R[0]),x.removeListener!==void 0&&this.emit("removeListener",E,W||T)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(E){var T,R,x;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[E]),this;if(arguments.length===0){var A=Object.keys(R),N;for(x=0;x<A.length;++x)N=A[x],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[E],typeof T=="function")this.removeListener(E,T);else if(T!==void 0)for(x=T.length-1;x>=0;x--)this.removeListener(E,T[x]);return this};function d(h,E,T){var R=h._events;if(R===void 0)return[];var x=R[E];return x===void 0?[]:typeof x=="function"?T?[x.listener||x]:[x]:T?S(x):b(x,x.length)}o.prototype.listeners=function(E){return d(this,E,!0)},o.prototype.rawListeners=function(E){return d(this,E,!1)},o.listenerCount=function(h,E){return typeof h.listenerCount=="function"?h.listenerCount(E):m.call(h,E)},o.prototype.listenerCount=m;function m(h){var E=this._events;if(E!==void 0){var T=E[h];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function b(h,E){for(var T=new Array(E),R=0;R<E;++R)T[R]=h[R];return T}function w(h,E){for(;E+1<h.length;E++)h[E]=h[E+1];h.pop()}function S(h){for(var E=new Array(h.length),T=0;T<E.length;++T)E[T]=h[T].listener||h[T];return E}function y(h,E){return new Promise(function(T,R){function x(N){h.removeListener(E,A),R(N)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",x),T([].slice.call(arguments))}v(h,E,A,{once:!0}),E!=="error"&&g(h,x,{once:!0})})}function g(h,E,T){typeof h.on=="function"&&v(h,"error",E,T)}function v(h,E,T,R){if(typeof h.on=="function")R.once?h.once(E,T):h.on(E,T);else if(typeof h.addEventListener=="function")h.addEventListener(E,function x(A){R.once&&h.removeEventListener(E,x),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return Zs.exports}var ea={exports:{}},Rm;function ui(){return Rm||(Rm=1,typeof Object.create=="function"?ea.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ea.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),ea.exports}var xc,Cm;function km(){return Cm||(Cm=1,xc=Ac().EventEmitter),xc}var Rc={},Pm;function ta(){return Pm||(Pm=1,(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=c,n.toByteArray=d,n.fromByteArray=w;for(var r=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;i[45]=62,i[95]=63;function u(g){var v=g.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=g.indexOf("=");h===-1&&(h=v);var E=h===v?0:4-h%4;return[h,E]}function c(g){var v=u(g),h=v[0],E=v[1];return(h+E)*3/4-E}function p(g,v,h){return(v+h)*3/4-h}function d(g){var v,h=u(g),E=h[0],T=h[1],R=new o(p(g,E,T)),x=0,A=T>0?E-4:E,N;for(N=0;N<A;N+=4)v=i[g.charCodeAt(N)]<<18|i[g.charCodeAt(N+1)]<<12|i[g.charCodeAt(N+2)]<<6|i[g.charCodeAt(N+3)],R[x++]=v>>16&255,R[x++]=v>>8&255,R[x++]=v&255;return T===2&&(v=i[g.charCodeAt(N)]<<2|i[g.charCodeAt(N+1)]>>4,R[x++]=v&255),T===1&&(v=i[g.charCodeAt(N)]<<10|i[g.charCodeAt(N+1)]<<4|i[g.charCodeAt(N+2)]>>2,R[x++]=v>>8&255,R[x++]=v&255),R}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function b(g,v,h){for(var E,T=[],R=v;R<h;R+=3)E=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),T.push(m(E));return T.join("")}function w(g){for(var v,h=g.length,E=h%3,T=[],R=16383,x=0,A=h-E;x<A;x+=R)T.push(b(g,x,x+R>A?A:x+R));return E===1?(v=g[h-1],T.push(r[v>>2]+r[v<<4&63]+"==")):E===2&&(v=(g[h-2]<<8)+g[h-1],T.push(r[v>>10]+r[v>>4&63]+r[v<<2&63]+"=")),T.join("")}var S={};S.read=function(g,v,h,E,T){var R,x,A=T*8-E-1,N=(1<<A)-1,W=N>>1,O=-7,D=h?T-1:0,V=h?-1:1,L=g[v+D];for(D+=V,R=L&(1<<-O)-1,L>>=-O,O+=A;O>0;R=R*256+g[v+D],D+=V,O-=8);for(x=R&(1<<-O)-1,R>>=-O,O+=E;O>0;x=x*256+g[v+D],D+=V,O-=8);if(R===0)R=1-W;else{if(R===N)return x?NaN:(L?-1:1)*(1/0);x=x+Math.pow(2,E),R=R-W}return(L?-1:1)*x*Math.pow(2,R-E)},S.write=function(g,v,h,E,T,R){var x,A,N,W=R*8-T-1,O=(1<<W)-1,D=O>>1,V=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=E?0:R-1,te=E?1:-1,Y=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(A=isNaN(v)?1:0,x=O):(x=Math.floor(Math.log(v)/Math.LN2),v*(N=Math.pow(2,-x))<1&&(x--,N*=2),x+D>=1?v+=V/N:v+=V*Math.pow(2,1-D),v*N>=2&&(x++,N/=2),x+D>=O?(A=0,x=O):x+D>=1?(A=(v*N-1)*Math.pow(2,T),x=x+D):(A=v*Math.pow(2,D-1)*Math.pow(2,T),x=0));T>=8;g[h+L]=A&255,L+=te,A/=256,T-=8);for(x=x<<T|A,W+=T;W>0;g[h+L]=x&255,L+=te,x/=256,W-=8);g[h+L-te]|=Y*128};(function(g){const v=n,h=S,E=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=O,g.SlowBuffer=ie,g.INSPECT_MAX_BYTES=50;const T=2147483647;g.kMaxLength=T;const{Uint8Array:R,ArrayBuffer:x,SharedArrayBuffer:A}=globalThis;O.TYPED_ARRAY_SUPPORT=N(),!O.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 N(){try{const U=new R(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,R.prototype),Object.setPrototypeOf(U,P),U.foo()===42}catch{return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}}),Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function W(U){if(U>T)throw new RangeError('The value "'+U+'" is invalid for option "size"');const P=new R(U);return Object.setPrototypeOf(P,O.prototype),P}function O(U,P,_){if(typeof U=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return te(U)}return D(U,P,_)}O.poolSize=8192;function D(U,P,_){if(typeof U=="string")return Y(U,P);if(x.isView(U))return he(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(qt(U,x)||U&&qt(U.buffer,x)||typeof A<"u"&&(qt(U,A)||U&&qt(U.buffer,A)))return ae(U,P,_);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Z=U.valueOf&&U.valueOf();if(Z!=null&&Z!==U)return O.from(Z,P,_);const ue=we(U);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return O.from(U[Symbol.toPrimitive]("string"),P,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}O.from=function(U,P,_){return D(U,P,_)},Object.setPrototypeOf(O.prototype,R.prototype),Object.setPrototypeOf(O,R);function V(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function L(U,P,_){return V(U),U<=0?W(U):P!==void 0?typeof _=="string"?W(U).fill(P,_):W(U).fill(P):W(U)}O.alloc=function(U,P,_){return L(U,P,_)};function te(U){return V(U),W(U<0?0:Q(U)|0)}O.allocUnsafe=function(U){return te(U)},O.allocUnsafeSlow=function(U){return te(U)};function Y(U,P){if((typeof P!="string"||P==="")&&(P="utf8"),!O.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const _=ce(U,P)|0;let Z=W(_);const ue=Z.write(U,P);return ue!==_&&(Z=Z.slice(0,ue)),Z}function se(U){const P=U.length<0?0:Q(U.length)|0,_=W(P);for(let Z=0;Z<P;Z+=1)_[Z]=U[Z]&255;return _}function he(U){if(qt(U,R)){const P=new R(U);return ae(P.buffer,P.byteOffset,P.byteLength)}return se(U)}function ae(U,P,_){if(P<0||U.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<P+(_||0))throw new RangeError('"length" is outside of buffer bounds');let Z;return P===void 0&&_===void 0?Z=new R(U):_===void 0?Z=new R(U,P):Z=new R(U,P,_),Object.setPrototypeOf(Z,O.prototype),Z}function we(U){if(O.isBuffer(U)){const P=Q(U.length)|0,_=W(P);return _.length===0||U.copy(_,0,0,P),_}if(U.length!==void 0)return typeof U.length!="number"||Nr(U.length)?W(0):se(U);if(U.type==="Buffer"&&Array.isArray(U.data))return se(U.data)}function Q(U){if(U>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return U|0}function ie(U){return+U!=U&&(U=0),O.alloc(+U)}O.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==O.prototype},O.compare=function(P,_){if(qt(P,R)&&(P=O.from(P,P.offset,P.byteLength)),qt(_,R)&&(_=O.from(_,_.offset,_.byteLength)),!O.isBuffer(P)||!O.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===_)return 0;let Z=P.length,ue=_.length;for(let Se=0,ke=Math.min(Z,ue);Se<ke;++Se)if(P[Se]!==_[Se]){Z=P[Se],ue=_[Se];break}return Z<ue?-1:ue<Z?1:0},O.isEncoding=function(P){switch(String(P).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}},O.concat=function(P,_){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return O.alloc(0);let Z;if(_===void 0)for(_=0,Z=0;Z<P.length;++Z)_+=P[Z].length;const ue=O.allocUnsafe(_);let Se=0;for(Z=0;Z<P.length;++Z){let ke=P[Z];if(qt(ke,R))Se+ke.length>ue.length?(O.isBuffer(ke)||(ke=O.from(ke)),ke.copy(ue,Se)):R.prototype.set.call(ue,ke,Se);else if(O.isBuffer(ke))ke.copy(ue,Se);else throw new TypeError('"list" argument must be an Array of Buffers');Se+=ke.length}return ue};function ce(U,P){if(O.isBuffer(U))return U.length;if(x.isView(U)||qt(U,x))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const _=U.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&_===0)return 0;let ue=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return Le(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return et(U).length;default:if(ue)return Z?-1:Le(U).length;P=(""+P).toLowerCase(),ue=!0}}O.byteLength=ce;function Ae(U,P,_){let Z=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,P>>>=0,_<=P))return"";for(U||(U="utf8");;)switch(U){case"hex":return We(this,P,_);case"utf8":case"utf-8":return De(this,P,_);case"ascii":return Fe(this,P,_);case"latin1":case"binary":return ye(this,P,_);case"base64":return xe(this,P,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ge(this,P,_);default:if(Z)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),Z=!0}}O.prototype._isBuffer=!0;function ee(U,P,_){const Z=U[P];U[P]=U[_],U[_]=Z}O.prototype.swap16=function(){const P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<P;_+=2)ee(this,_,_+1);return this},O.prototype.swap32=function(){const P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<P;_+=4)ee(this,_,_+3),ee(this,_+1,_+2);return this},O.prototype.swap64=function(){const P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<P;_+=8)ee(this,_,_+7),ee(this,_+1,_+6),ee(this,_+2,_+5),ee(this,_+3,_+4);return this},O.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?De(this,0,P):Ae.apply(this,arguments)},O.prototype.toLocaleString=O.prototype.toString,O.prototype.equals=function(P){if(!O.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:O.compare(this,P)===0},O.prototype.inspect=function(){let P="";const _=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(P+=" ... "),"<Buffer "+P+">"},E&&(O.prototype[E]=O.prototype.inspect),O.prototype.compare=function(P,_,Z,ue,Se){if(qt(P,R)&&(P=O.from(P,P.offset,P.byteLength)),!O.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(_===void 0&&(_=0),Z===void 0&&(Z=P?P.length:0),ue===void 0&&(ue=0),Se===void 0&&(Se=this.length),_<0||Z>P.length||ue<0||Se>this.length)throw new RangeError("out of range index");if(ue>=Se&&_>=Z)return 0;if(ue>=Se)return-1;if(_>=Z)return 1;if(_>>>=0,Z>>>=0,ue>>>=0,Se>>>=0,this===P)return 0;let ke=Se-ue,rt=Z-_;const _t=Math.min(ke,rt),Pt=this.slice(ue,Se),Dt=P.slice(_,Z);for(let wt=0;wt<_t;++wt)if(Pt[wt]!==Dt[wt]){ke=Pt[wt],rt=Dt[wt];break}return ke<rt?-1:rt<ke?1:0};function F(U,P,_,Z,ue){if(U.length===0)return-1;if(typeof _=="string"?(Z=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,Nr(_)&&(_=ue?0:U.length-1),_<0&&(_=U.length+_),_>=U.length){if(ue)return-1;_=U.length-1}else if(_<0)if(ue)_=0;else return-1;if(typeof P=="string"&&(P=O.from(P,Z)),O.isBuffer(P))return P.length===0?-1:C(U,P,_,Z,ue);if(typeof P=="number")return P=P&255,typeof R.prototype.indexOf=="function"?ue?R.prototype.indexOf.call(U,P,_):R.prototype.lastIndexOf.call(U,P,_):C(U,[P],_,Z,ue);throw new TypeError("val must be string, number or Buffer")}function C(U,P,_,Z,ue){let Se=1,ke=U.length,rt=P.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(U.length<2||P.length<2)return-1;Se=2,ke/=2,rt/=2,_/=2}function _t(Dt,wt){return Se===1?Dt[wt]:Dt.readUInt16BE(wt*Se)}let Pt;if(ue){let Dt=-1;for(Pt=_;Pt<ke;Pt++)if(_t(U,Pt)===_t(P,Dt===-1?0:Pt-Dt)){if(Dt===-1&&(Dt=Pt),Pt-Dt+1===rt)return Dt*Se}else Dt!==-1&&(Pt-=Pt-Dt),Dt=-1}else for(_+rt>ke&&(_=ke-rt),Pt=_;Pt>=0;Pt--){let Dt=!0;for(let wt=0;wt<rt;wt++)if(_t(U,Pt+wt)!==_t(P,wt)){Dt=!1;break}if(Dt)return Pt}return-1}O.prototype.includes=function(P,_,Z){return this.indexOf(P,_,Z)!==-1},O.prototype.indexOf=function(P,_,Z){return F(this,P,_,Z,!0)},O.prototype.lastIndexOf=function(P,_,Z){return F(this,P,_,Z,!1)};function q(U,P,_,Z){_=Number(_)||0;const ue=U.length-_;Z?(Z=Number(Z),Z>ue&&(Z=ue)):Z=ue;const Se=P.length;Z>Se/2&&(Z=Se/2);let ke;for(ke=0;ke<Z;++ke){const rt=parseInt(P.substr(ke*2,2),16);if(Nr(rt))return ke;U[_+ke]=rt}return ke}function K(U,P,_,Z){return Dr(Le(P,U.length-_),U,_,Z)}function j(U,P,_,Z){return Dr(qe(P),U,_,Z)}function H(U,P,_,Z){return Dr(et(P),U,_,Z)}function ge(U,P,_,Z){return Dr(Ze(P,U.length-_),U,_,Z)}O.prototype.write=function(P,_,Z,ue){if(_===void 0)ue="utf8",Z=this.length,_=0;else if(Z===void 0&&typeof _=="string")ue=_,Z=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(Z)?(Z=Z>>>0,ue===void 0&&(ue="utf8")):(ue=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Se=this.length-_;if((Z===void 0||Z>Se)&&(Z=Se),P.length>0&&(Z<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let ke=!1;for(;;)switch(ue){case"hex":return q(this,P,_,Z);case"utf8":case"utf-8":return K(this,P,_,Z);case"ascii":case"latin1":case"binary":return j(this,P,_,Z);case"base64":return H(this,P,_,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,P,_,Z);default:if(ke)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),ke=!0}},O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xe(U,P,_){return P===0&&_===U.length?v.fromByteArray(U):v.fromByteArray(U.slice(P,_))}function De(U,P,_){_=Math.min(U.length,_);const Z=[];let ue=P;for(;ue<_;){const Se=U[ue];let ke=null,rt=Se>239?4:Se>223?3:Se>191?2:1;if(ue+rt<=_){let _t,Pt,Dt,wt;switch(rt){case 1:Se<128&&(ke=Se);break;case 2:_t=U[ue+1],(_t&192)===128&&(wt=(Se&31)<<6|_t&63,wt>127&&(ke=wt));break;case 3:_t=U[ue+1],Pt=U[ue+2],(_t&192)===128&&(Pt&192)===128&&(wt=(Se&15)<<12|(_t&63)<<6|Pt&63,wt>2047&&(wt<55296||wt>57343)&&(ke=wt));break;case 4:_t=U[ue+1],Pt=U[ue+2],Dt=U[ue+3],(_t&192)===128&&(Pt&192)===128&&(Dt&192)===128&&(wt=(Se&15)<<18|(_t&63)<<12|(Pt&63)<<6|Dt&63,wt>65535&&wt<1114112&&(ke=wt))}}ke===null?(ke=65533,rt=1):ke>65535&&(ke-=65536,Z.push(ke>>>10&1023|55296),ke=56320|ke&1023),Z.push(ke),ue+=rt}return Ce(Z)}const Oe=4096;function Ce(U){const P=U.length;if(P<=Oe)return String.fromCharCode.apply(String,U);let _="",Z=0;for(;Z<P;)_+=String.fromCharCode.apply(String,U.slice(Z,Z+=Oe));return _}function Fe(U,P,_){let Z="";_=Math.min(U.length,_);for(let ue=P;ue<_;++ue)Z+=String.fromCharCode(U[ue]&127);return Z}function ye(U,P,_){let Z="";_=Math.min(U.length,_);for(let ue=P;ue<_;++ue)Z+=String.fromCharCode(U[ue]);return Z}function We(U,P,_){const Z=U.length;(!P||P<0)&&(P=0),(!_||_<0||_>Z)&&(_=Z);let ue="";for(let Se=P;Se<_;++Se)ue+=$e[U[Se]];return ue}function Ge(U,P,_){const Z=U.slice(P,_);let ue="";for(let Se=0;Se<Z.length-1;Se+=2)ue+=String.fromCharCode(Z[Se]+Z[Se+1]*256);return ue}O.prototype.slice=function(P,_){const Z=this.length;P=~~P,_=_===void 0?Z:~~_,P<0?(P+=Z,P<0&&(P=0)):P>Z&&(P=Z),_<0?(_+=Z,_<0&&(_=0)):_>Z&&(_=Z),_<P&&(_=P);const ue=this.subarray(P,_);return Object.setPrototypeOf(ue,O.prototype),ue};function Qe(U,P,_){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+P>_)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=this[P],Se=1,ke=0;for(;++ke<_&&(Se*=256);)ue+=this[P+ke]*Se;return ue},O.prototype.readUintBE=O.prototype.readUIntBE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=this[P+--_],Se=1;for(;_>0&&(Se*=256);)ue+=this[P+--_]*Se;return ue},O.prototype.readUint8=O.prototype.readUInt8=function(P,_){return P=P>>>0,_||Qe(P,1,this.length),this[P]},O.prototype.readUint16LE=O.prototype.readUInt16LE=function(P,_){return P=P>>>0,_||Qe(P,2,this.length),this[P]|this[P+1]<<8},O.prototype.readUint16BE=O.prototype.readUInt16BE=function(P,_){return P=P>>>0,_||Qe(P,2,this.length),this[P]<<8|this[P+1]},O.prototype.readUint32LE=O.prototype.readUInt32LE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},O.prototype.readUint32BE=O.prototype.readUInt32BE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},O.prototype.readBigUInt64LE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=_+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,Se=this[++P]+this[++P]*2**8+this[++P]*2**16+Z*2**24;return BigInt(ue)+(BigInt(Se)<<BigInt(32))}),O.prototype.readBigUInt64BE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=_*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],Se=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Z;return(BigInt(ue)<<BigInt(32))+BigInt(Se)}),O.prototype.readIntLE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=this[P],Se=1,ke=0;for(;++ke<_&&(Se*=256);)ue+=this[P+ke]*Se;return Se*=128,ue>=Se&&(ue-=Math.pow(2,8*_)),ue},O.prototype.readIntBE=function(P,_,Z){P=P>>>0,_=_>>>0,Z||Qe(P,_,this.length);let ue=_,Se=1,ke=this[P+--ue];for(;ue>0&&(Se*=256);)ke+=this[P+--ue]*Se;return Se*=128,ke>=Se&&(ke-=Math.pow(2,8*_)),ke},O.prototype.readInt8=function(P,_){return P=P>>>0,_||Qe(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},O.prototype.readInt16LE=function(P,_){P=P>>>0,_||Qe(P,2,this.length);const Z=this[P]|this[P+1]<<8;return Z&32768?Z|4294901760:Z},O.prototype.readInt16BE=function(P,_){P=P>>>0,_||Qe(P,2,this.length);const Z=this[P+1]|this[P]<<8;return Z&32768?Z|4294901760:Z},O.prototype.readInt32LE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},O.prototype.readInt32BE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},O.prototype.readBigInt64LE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(Z<<24);return(BigInt(ue)<<BigInt(32))+BigInt(_+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),O.prototype.readBigInt64BE=je(function(P){P=P>>>0,G(P,"offset");const _=this[P],Z=this[P+7];(_===void 0||Z===void 0)&&oe(P,this.length-8);const ue=(_<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ue)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Z)}),O.prototype.readFloatLE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),h.read(this,P,!0,23,4)},O.prototype.readFloatBE=function(P,_){return P=P>>>0,_||Qe(P,4,this.length),h.read(this,P,!1,23,4)},O.prototype.readDoubleLE=function(P,_){return P=P>>>0,_||Qe(P,8,this.length),h.read(this,P,!0,52,8)},O.prototype.readDoubleBE=function(P,_){return P=P>>>0,_||Qe(P,8,this.length),h.read(this,P,!1,52,8)};function Xe(U,P,_,Z,ue,Se){if(!O.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>ue||P<Se)throw new RangeError('"value" argument is out of bounds');if(_+Z>U.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(P,_,Z,ue){if(P=+P,_=_>>>0,Z=Z>>>0,!ue){const rt=Math.pow(2,8*Z)-1;Xe(this,P,_,Z,rt,0)}let Se=1,ke=0;for(this[_]=P&255;++ke<Z&&(Se*=256);)this[_+ke]=P/Se&255;return _+Z},O.prototype.writeUintBE=O.prototype.writeUIntBE=function(P,_,Z,ue){if(P=+P,_=_>>>0,Z=Z>>>0,!ue){const rt=Math.pow(2,8*Z)-1;Xe(this,P,_,Z,rt,0)}let Se=Z-1,ke=1;for(this[_+Se]=P&255;--Se>=0&&(ke*=256);)this[_+Se]=P/ke&255;return _+Z},O.prototype.writeUint8=O.prototype.writeUInt8=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,1,255,0),this[_]=P&255,_+1},O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,65535,0),this[_]=P&255,this[_+1]=P>>>8,_+2},O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,65535,0),this[_]=P>>>8,this[_+1]=P&255,_+2},O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,4294967295,0),this[_+3]=P>>>24,this[_+2]=P>>>16,this[_+1]=P>>>8,this[_]=P&255,_+4},O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,4294967295,0),this[_]=P>>>24,this[_+1]=P>>>16,this[_+2]=P>>>8,this[_+3]=P&255,_+4};function lt(U,P,_,Z,ue){J(P,Z,ue,U,_,7);let Se=Number(P&BigInt(4294967295));U[_++]=Se,Se=Se>>8,U[_++]=Se,Se=Se>>8,U[_++]=Se,Se=Se>>8,U[_++]=Se;let ke=Number(P>>BigInt(32)&BigInt(4294967295));return U[_++]=ke,ke=ke>>8,U[_++]=ke,ke=ke>>8,U[_++]=ke,ke=ke>>8,U[_++]=ke,_}function Et(U,P,_,Z,ue){J(P,Z,ue,U,_,7);let Se=Number(P&BigInt(4294967295));U[_+7]=Se,Se=Se>>8,U[_+6]=Se,Se=Se>>8,U[_+5]=Se,Se=Se>>8,U[_+4]=Se;let ke=Number(P>>BigInt(32)&BigInt(4294967295));return U[_+3]=ke,ke=ke>>8,U[_+2]=ke,ke=ke>>8,U[_+1]=ke,ke=ke>>8,U[_]=ke,_+8}O.prototype.writeBigUInt64LE=je(function(P,_=0){return lt(this,P,_,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeBigUInt64BE=je(function(P,_=0){return Et(this,P,_,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeIntLE=function(P,_,Z,ue){if(P=+P,_=_>>>0,!ue){const _t=Math.pow(2,8*Z-1);Xe(this,P,_,Z,_t-1,-_t)}let Se=0,ke=1,rt=0;for(this[_]=P&255;++Se<Z&&(ke*=256);)P<0&&rt===0&&this[_+Se-1]!==0&&(rt=1),this[_+Se]=(P/ke>>0)-rt&255;return _+Z},O.prototype.writeIntBE=function(P,_,Z,ue){if(P=+P,_=_>>>0,!ue){const _t=Math.pow(2,8*Z-1);Xe(this,P,_,Z,_t-1,-_t)}let Se=Z-1,ke=1,rt=0;for(this[_+Se]=P&255;--Se>=0&&(ke*=256);)P<0&&rt===0&&this[_+Se+1]!==0&&(rt=1),this[_+Se]=(P/ke>>0)-rt&255;return _+Z},O.prototype.writeInt8=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,1,127,-128),P<0&&(P=255+P+1),this[_]=P&255,_+1},O.prototype.writeInt16LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,32767,-32768),this[_]=P&255,this[_+1]=P>>>8,_+2},O.prototype.writeInt16BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,2,32767,-32768),this[_]=P>>>8,this[_+1]=P&255,_+2},O.prototype.writeInt32LE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,2147483647,-2147483648),this[_]=P&255,this[_+1]=P>>>8,this[_+2]=P>>>16,this[_+3]=P>>>24,_+4},O.prototype.writeInt32BE=function(P,_,Z){return P=+P,_=_>>>0,Z||Xe(this,P,_,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[_]=P>>>24,this[_+1]=P>>>16,this[_+2]=P>>>8,this[_+3]=P&255,_+4},O.prototype.writeBigInt64LE=je(function(P,_=0){return lt(this,P,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),O.prototype.writeBigInt64BE=je(function(P,_=0){return Et(this,P,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Bt(U,P,_,Z,ue,Se){if(_+Z>U.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function jt(U,P,_,Z,ue){return P=+P,_=_>>>0,ue||Bt(U,P,_,4),h.write(U,P,_,Z,23,4),_+4}O.prototype.writeFloatLE=function(P,_,Z){return jt(this,P,_,!0,Z)},O.prototype.writeFloatBE=function(P,_,Z){return jt(this,P,_,!1,Z)};function ct(U,P,_,Z,ue){return P=+P,_=_>>>0,ue||Bt(U,P,_,8),h.write(U,P,_,Z,52,8),_+8}O.prototype.writeDoubleLE=function(P,_,Z){return ct(this,P,_,!0,Z)},O.prototype.writeDoubleBE=function(P,_,Z){return ct(this,P,_,!1,Z)},O.prototype.copy=function(P,_,Z,ue){if(!O.isBuffer(P))throw new TypeError("argument should be a Buffer");if(Z||(Z=0),!ue&&ue!==0&&(ue=this.length),_>=P.length&&(_=P.length),_||(_=0),ue>0&&ue<Z&&(ue=Z),ue===Z||P.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),P.length-_<ue-Z&&(ue=P.length-_+Z);const Se=ue-Z;return this===P&&typeof R.prototype.copyWithin=="function"?this.copyWithin(_,Z,ue):R.prototype.set.call(P,this.subarray(Z,ue),_),Se},O.prototype.fill=function(P,_,Z,ue){if(typeof P=="string"){if(typeof _=="string"?(ue=_,_=0,Z=this.length):typeof Z=="string"&&(ue=Z,Z=this.length),ue!==void 0&&typeof ue!="string")throw new TypeError("encoding must be a string");if(typeof ue=="string"&&!O.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);if(P.length===1){const ke=P.charCodeAt(0);(ue==="utf8"&&ke<128||ue==="latin1")&&(P=ke)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(_<0||this.length<_||this.length<Z)throw new RangeError("Out of range index");if(Z<=_)return this;_=_>>>0,Z=Z===void 0?this.length:Z>>>0,P||(P=0);let Se;if(typeof P=="number")for(Se=_;Se<Z;++Se)this[Se]=P;else{const ke=O.isBuffer(P)?P:O.from(P,ue),rt=ke.length;if(rt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(Se=0;Se<Z-_;++Se)this[Se+_]=ke[Se%rt]}return this};const Ne={};function M(U,P,_){Ne[U]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ue,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}M("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(U,P){return`The "${U}" argument must be of type number. Received type ${typeof P}`},TypeError),M("ERR_OUT_OF_RANGE",function(U,P,_){let Z=`The value of "${U}" is out of range.`,ue=_;return Number.isInteger(_)&&Math.abs(_)>2**32?ue=k(String(_)):typeof _=="bigint"&&(ue=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(ue=k(ue)),ue+="n"),Z+=` It must be ${P}. Received ${ue}`,Z},RangeError);function k(U){let P="",_=U.length;const Z=U[0]==="-"?1:0;for(;_>=Z+4;_-=3)P=`_${U.slice(_-3,_)}${P}`;return`${U.slice(0,_)}${P}`}function I(U,P,_){G(P,"offset"),(U[P]===void 0||U[P+_]===void 0)&&oe(P,U.length-(_+1))}function J(U,P,_,Z,ue,Se){if(U>_||U<P){const ke=typeof P=="bigint"?"n":"";let rt;throw P===0||P===BigInt(0)?rt=`>= 0${ke} and < 2${ke} ** ${(Se+1)*8}${ke}`:rt=`>= -(2${ke} ** ${(Se+1)*8-1}${ke}) and < 2 ** ${(Se+1)*8-1}${ke}`,new Ne.ERR_OUT_OF_RANGE("value",rt,U)}I(Z,ue,Se)}function G(U,P){if(typeof U!="number")throw new Ne.ERR_INVALID_ARG_TYPE(P,"number",U)}function oe(U,P,_){throw Math.floor(U)!==U?(G(U,_),new Ne.ERR_OUT_OF_RANGE("offset","an integer",U)):P<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,U)}const ne=/[^+/0-9A-Za-z-_]/g;function Pe(U){if(U=U.split("=")[0],U=U.trim().replace(ne,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Le(U,P){P=P||1/0;let _;const Z=U.length;let ue=null;const Se=[];for(let ke=0;ke<Z;++ke){if(_=U.charCodeAt(ke),_>55295&&_<57344){if(!ue){if(_>56319){(P-=3)>-1&&Se.push(239,191,189);continue}else if(ke+1===Z){(P-=3)>-1&&Se.push(239,191,189);continue}ue=_;continue}if(_<56320){(P-=3)>-1&&Se.push(239,191,189),ue=_;continue}_=(ue-55296<<10|_-56320)+65536}else ue&&(P-=3)>-1&&Se.push(239,191,189);if(ue=null,_<128){if((P-=1)<0)break;Se.push(_)}else if(_<2048){if((P-=2)<0)break;Se.push(_>>6|192,_&63|128)}else if(_<65536){if((P-=3)<0)break;Se.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((P-=4)<0)break;Se.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return Se}function qe(U){const P=[];for(let _=0;_<U.length;++_)P.push(U.charCodeAt(_)&255);return P}function Ze(U,P){let _,Z,ue;const Se=[];for(let ke=0;ke<U.length&&!((P-=2)<0);++ke)_=U.charCodeAt(ke),Z=_>>8,ue=_%256,Se.push(ue),Se.push(Z);return Se}function et(U){return v.toByteArray(Pe(U))}function Dr(U,P,_,Z){let ue;for(ue=0;ue<Z&&!(ue+_>=P.length||ue>=U.length);++ue)P[ue+_]=U[ue];return ue}function qt(U,P){return U instanceof P||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===P.name}function Nr(U){return U!==U}const $e=(function(){const U="0123456789abcdef",P=new Array(256);for(let _=0;_<16;++_){const Z=_*16;for(let ue=0;ue<16;++ue)P[Z+ue]=U[_]+U[ue]}return P})();function je(U){return typeof BigInt>"u"?bt:U}function bt(){throw new Error("BigInt not supported")}})(t);const y=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=y,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Rc)),Rc}var Cc={},kc={},Pc,Im;function Om(){return Im||(Im=1,Pc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),Pc}var Ic,Fm;function na(){if(Fm)return Ic;Fm=1;var e=Om();return Ic=function(){return e()&&!!Symbol.toStringTag},Ic}var Oc,_m;function Dm(){return _m||(_m=1,Oc=Object),Oc}var Fc,Nm;function iR(){return Nm||(Nm=1,Fc=Error),Fc}var _c,Lm;function oR(){return Lm||(Lm=1,_c=EvalError),_c}var Dc,$m;function sR(){return $m||($m=1,Dc=RangeError),Dc}var Nc,Mm;function aR(){return Mm||(Mm=1,Nc=ReferenceError),Nc}var Lc,Bm;function jm(){return Bm||(Bm=1,Lc=SyntaxError),Lc}var $c,Um;function Po(){return Um||(Um=1,$c=TypeError),$c}var Mc,Vm;function lR(){return Vm||(Vm=1,Mc=URIError),Mc}var Bc,qm;function cR(){return qm||(qm=1,Bc=Math.abs),Bc}var jc,zm;function uR(){return zm||(zm=1,jc=Math.floor),jc}var Uc,Wm;function fR(){return Wm||(Wm=1,Uc=Math.max),Uc}var Vc,Hm;function dR(){return Hm||(Hm=1,Vc=Math.min),Vc}var qc,Km;function pR(){return Km||(Km=1,qc=Math.pow),qc}var zc,Gm;function hR(){return Gm||(Gm=1,zc=Math.round),zc}var Wc,Qm;function mR(){return Qm||(Qm=1,Wc=Number.isNaN||function(t){return t!==t}),Wc}var Hc,Xm;function gR(){if(Xm)return Hc;Xm=1;var e=mR();return Hc=function(n){return e(n)||n===0?n:n<0?-1:1},Hc}var Kc,Ym;function yR(){return Ym||(Ym=1,Kc=Object.getOwnPropertyDescriptor),Kc}var Gc,Jm;function Ui(){if(Jm)return Gc;Jm=1;var e=yR();if(e)try{e([],"length")}catch{e=null}return Gc=e,Gc}var Qc,Zm;function ra(){if(Zm)return Qc;Zm=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Qc=e,Qc}var Xc,eg;function vR(){if(eg)return Xc;eg=1;var e=typeof Symbol<"u"&&Symbol,t=Om();return Xc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Xc}var Yc,tg;function ng(){return tg||(tg=1,Yc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Yc}var Jc,rg;function ig(){if(rg)return Jc;rg=1;var e=Dm();return Jc=e.getPrototypeOf||null,Jc}var Zc,og;function bR(){if(og)return Zc;og=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(l,u){for(var c=[],p=0;p<l.length;p+=1)c[p]=l[p];for(var d=0;d<u.length;d+=1)c[d+l.length]=u[d];return c},o=function(l,u){for(var c=[],p=u,d=0;p<l.length;p+=1,d+=1)c[d]=l[p];return c},s=function(a,l){for(var u="",c=0;c<a.length;c+=1)u+=a[c],c+1<a.length&&(u+=l);return u};return Zc=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var c=o(arguments,1),p,d=function(){if(this instanceof p){var y=u.apply(this,i(c,arguments));return Object(y)===y?y:this}return u.apply(l,i(c,arguments))},m=n(0,u.length-c.length),b=[],w=0;w<m;w++)b[w]="$"+w;if(p=Function("binder","return function ("+s(b,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var S=function(){};S.prototype=u.prototype,p.prototype=new S,S.prototype=null}return p},Zc}var eu,sg;function Io(){if(sg)return eu;sg=1;var e=bR();return eu=Function.prototype.bind||e,eu}var tu,ag;function nu(){return ag||(ag=1,tu=Function.prototype.call),tu}var ru,lg;function iu(){return lg||(lg=1,ru=Function.prototype.apply),ru}var ou,cg;function wR(){return cg||(cg=1,ou=typeof Reflect<"u"&&Reflect&&Reflect.apply),ou}var su,ug;function fg(){if(ug)return su;ug=1;var e=Io(),t=iu(),n=nu(),r=wR();return su=r||e.call(n,t),su}var au,dg;function lu(){if(dg)return au;dg=1;var e=Io(),t=Po(),n=nu(),r=fg();return au=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return r(e,n,o)},au}var cu,pg;function SR(){if(pg)return cu;pg=1;var e=lu(),t=Ui(),n;try{n=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!n&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return cu=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(a){return o(a==null?a:i(a))}:!1,cu}var uu,hg;function fu(){if(hg)return uu;hg=1;var e=ng(),t=ig(),n=SR();return uu=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:n?function(i){return n(i)}:null,uu}var du,mg;function gg(){if(mg)return du;mg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=Io();return du=n.call(e,t),du}var pu,yg;function vg(){if(yg)return pu;yg=1;var e,t=Dm(),n=iR(),r=oR(),i=sR(),o=aR(),s=jm(),a=Po(),l=lR(),u=cR(),c=uR(),p=fR(),d=dR(),m=pR(),b=hR(),w=gR(),S=Function,y=function(q){try{return S('"use strict"; return ('+q+").constructor;")()}catch{}},g=Ui(),v=ra(),h=function(){throw new a},E=g?(function(){try{return arguments.callee,h}catch{try{return g(arguments,"callee").get}catch{return h}}})():h,T=vR()(),R=fu(),x=ig(),A=ng(),N=iu(),W=nu(),O={},D=typeof Uint8Array>"u"||!R?e:R(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":T&&R?R([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&R?R(R([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!R?e:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!R?e:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&R?R(""[Symbol.iterator]()):e,"%Symbol%":T?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":E,"%TypedArray%":D,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":N,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":x,"%Math.abs%":u,"%Math.floor%":c,"%Math.max%":p,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":w,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(q){var L=R(R(q));V["%Error.prototype%"]=L}var te=function q(K){var j;if(K==="%AsyncFunction%")j=y("async function () {}");else if(K==="%GeneratorFunction%")j=y("function* () {}");else if(K==="%AsyncGeneratorFunction%")j=y("async function* () {}");else if(K==="%AsyncGenerator%"){var H=q("%AsyncGeneratorFunction%");H&&(j=H.prototype)}else if(K==="%AsyncIteratorPrototype%"){var ge=q("%AsyncGenerator%");ge&&R&&(j=R(ge.prototype))}return V[K]=j,j},Y={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},se=Io(),he=gg(),ae=se.call(W,Array.prototype.concat),we=se.call(N,Array.prototype.splice),Q=se.call(W,String.prototype.replace),ie=se.call(W,String.prototype.slice),ce=se.call(W,RegExp.prototype.exec),Ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ee=/\\(\\)?/g,F=function(K){var j=ie(K,0,1),H=ie(K,-1);if(j==="%"&&H!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&j!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ge=[];return Q(K,Ae,function(xe,De,Oe,Ce){ge[ge.length]=Oe?Q(Ce,ee,"$1"):De||xe}),ge},C=function(K,j){var H=K,ge;if(he(Y,H)&&(ge=Y[H],H="%"+ge[0]+"%"),he(V,H)){var xe=V[H];if(xe===O&&(xe=te(H)),typeof xe>"u"&&!j)throw new a("intrinsic "+K+" exists, but is not available. Please file an issue!");return{alias:ge,name:H,value:xe}}throw new s("intrinsic "+K+" does not exist!")};return pu=function(K,j){if(typeof K!="string"||K.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof j!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,K)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=F(K),ge=H.length>0?H[0]:"",xe=C("%"+ge+"%",j),De=xe.name,Oe=xe.value,Ce=!1,Fe=xe.alias;Fe&&(ge=Fe[0],we(H,ae([0,1],Fe)));for(var ye=1,We=!0;ye<H.length;ye+=1){var Ge=H[ye],Qe=ie(Ge,0,1),Xe=ie(Ge,-1);if((Qe==='"'||Qe==="'"||Qe==="`"||Xe==='"'||Xe==="'"||Xe==="`")&&Qe!==Xe)throw new s("property names with quotes must have matching quotes");if((Ge==="constructor"||!We)&&(Ce=!0),ge+="."+Ge,De="%"+ge+"%",he(V,De))Oe=V[De];else if(Oe!=null){if(!(Ge in Oe)){if(!j)throw new a("base intrinsic for "+K+" exists, but the property is not available.");return}if(g&&ye+1>=H.length){var lt=g(Oe,Ge);We=!!lt,We&&"get"in lt&&!("originalValue"in lt.get)?Oe=lt.get:Oe=Oe[Ge]}else We=he(Oe,Ge),Oe=Oe[Ge];We&&!Ce&&(V[De]=Oe)}}return Oe},pu}var hu,bg;function Oo(){if(bg)return hu;bg=1;var e=vg(),t=lu(),n=t([e("%String.prototype.indexOf%")]);return hu=function(i,o){var s=e(i,!!o);return typeof s=="function"&&n(i,".prototype.")>-1?t([s]):s},hu}var mu,wg;function ER(){if(wg)return mu;wg=1;var e=na()(),t=Oo(),n=t("Object.prototype.toString"),r=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},i=function(a){return r(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&n(a)!=="[object Array]"&&"callee"in a&&n(a.callee)==="[object Function]"},o=(function(){return r(arguments)})();return r.isLegacyArguments=i,mu=o?r:i,mu}var gu,Sg;function TR(){if(Sg)return gu;Sg=1;var e=Oo(),t=na()(),n=gg(),r=Ui(),i;if(t){var o=e("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),i=function(d){if(!d||typeof d!="object")return!1;var m=r(d,"lastIndex"),b=m&&n(m,"value");if(!b)return!1;try{o(d,l)}catch(w){return w===s}}}else{var u=e("Object.prototype.toString"),c="[object RegExp]";i=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===c}}return gu=i,gu}var yu,Eg;function AR(){if(Eg)return yu;Eg=1;var e=Oo(),t=TR(),n=e("RegExp.prototype.exec"),r=Po();return yu=function(o){if(!t(o))throw new r("`regex` must be a RegExp");return function(a){return n(o,a)!==null}},yu}var vu,Tg;function xR(){if(Tg)return vu;Tg=1;var e=Oo(),t=AR(),n=t(/^\s*(?:function)?\*/),r=na()(),i=fu(),o=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},l;return vu=function(c){if(typeof c!="function")return!1;if(n(s(c)))return!0;if(!r){var p=o(c);return p==="[object GeneratorFunction]"}if(!i)return!1;if(typeof l>"u"){var d=a();l=d?i(d):!1}return i(c)===l},vu}var bu,Ag;function RR(){if(Ag)return bu;Ag=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,n)}catch(g){g!==r&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(v){try{var h=e.call(v);return i.test(h)}catch{return!1}},s=function(v){try{return o(v)?!1:(e.call(v),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",u="[object Function]",c="[object GeneratorFunction]",p="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,w=!(0 in[,]),S=function(){return!1};if(typeof document=="object"){var y=document.all;a.call(y)===a.call(document.all)&&(S=function(v){if((w||!v)&&(typeof v>"u"||typeof v=="object"))try{var h=a.call(v);return(h===p||h===d||h===m||h===l)&&v("")==null}catch{}return!1})}return bu=t?function(v){if(S(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;try{t(v,null,n)}catch(h){if(h!==r)return!1}return!o(v)&&s(v)}:function(v){if(S(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(b)return s(v);if(o(v))return!1;var h=a.call(v);return h!==u&&h!==c&&!/^\[object HTML/.test(h)?!1:s(v)},bu}var wu,xg;function CR(){if(xg)return wu;xg=1;var e=RR(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,u,c){for(var p=0,d=l.length;p<d;p++)n.call(l,p)&&(c==null?u(l[p],p,l):u.call(c,l[p],p,l))},i=function(l,u,c){for(var p=0,d=l.length;p<d;p++)c==null?u(l.charAt(p),p,l):u.call(c,l.charAt(p),p,l)},o=function(l,u,c){for(var p in l)n.call(l,p)&&(c==null?u(l[p],p,l):u.call(c,l[p],p,l))};function s(a){return t.call(a)==="[object Array]"}return wu=function(l,u,c){if(!e(u))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=c),s(l)?r(l,u,p):typeof l=="string"?i(l,u,p):o(l,u,p)},wu}var Su,Rg;function kR(){return Rg||(Rg=1,Su=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Su}var Eu,Cg;function PR(){if(Cg)return Eu;Cg=1;var e=kR(),t=typeof globalThis>"u"?zr:globalThis;return Eu=function(){for(var r=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(r[r.length]=e[i]);return r},Eu}var Tu={exports:{}},Au,kg;function IR(){if(kg)return Au;kg=1;var e=ra(),t=jm(),n=Po(),r=Ui();return Au=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,d=!!r&&r(o,s);if(e)e(o,s,{configurable:c===null&&d?d.configurable:!c,enumerable:l===null&&d?d.enumerable:!l,value:a,writable:u===null&&d?d.writable:!u});else if(p||!l&&!u&&!c)o[s]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Au}var xu,Pg;function OR(){if(Pg)return xu;Pg=1;var e=ra(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},xu=t,xu}var Ru,Ig;function FR(){if(Ig)return Ru;Ig=1;var e=vg(),t=IR(),n=OR()(),r=Ui(),i=Po(),o=e("%Math.floor%");return Ru=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],c=!0,p=!0;if("length"in a&&r){var d=r(a,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(p=!1)}return(c||p||!u)&&(n?t(a,"length",l,!0,!0):t(a,"length",l)),a},Ru}var Cu,Og;function _R(){if(Og)return Cu;Og=1;var e=Io(),t=iu(),n=fg();return Cu=function(){return n(e,t,arguments)},Cu}var Fg;function DR(){return Fg||(Fg=1,(function(e){var t=FR(),n=ra(),r=lu(),i=_R();e.exports=function(s){var a=r(arguments),l=s.length-(arguments.length-1);return t(a,1+(l>0?l:0),!0)},n?n(e.exports,"apply",{value:i}):e.exports.apply=i})(Tu)),Tu.exports}var ku,_g;function Dg(){if(_g)return ku;_g=1;var e=CR(),t=PR(),n=DR(),r=Oo(),i=Ui(),o=fu(),s=r("Object.prototype.toString"),a=na()(),l=typeof globalThis>"u"?zr:globalThis,u=t(),c=r("String.prototype.slice"),p=r("Array.prototype.indexOf",!0)||function(S,y){for(var g=0;g<S.length;g+=1)if(S[g]===y)return g;return-1},d={__proto__:null};a&&i&&o?e(u,function(w){var S=new l[w];if(Symbol.toStringTag in S&&o){var y=o(S),g=i(y,Symbol.toStringTag);if(!g&&y){var v=o(y);g=i(v,Symbol.toStringTag)}d["$"+w]=n(g.get)}}):e(u,function(w){var S=new l[w],y=S.slice||S.set;y&&(d["$"+w]=n(y))});var m=function(S){var y=!1;return e(d,function(g,v){if(!y)try{"$"+g(S)===v&&(y=c(v,1))}catch{}}),y},b=function(S){var y=!1;return e(d,function(g,v){if(!y)try{g(S),y=c(v,1)}catch{}}),y};return ku=function(S){if(!S||typeof S!="object")return!1;if(!a){var y=c(s(S),8,-1);return p(u,y)>-1?y:y!=="Object"?!1:b(S)}return i?m(S):null},ku}var Pu,Ng;function NR(){if(Ng)return Pu;Ng=1;var e=Dg();return Pu=function(n){return!!e(n)},Pu}var Lg;function LR(){return Lg||(Lg=1,(function(e){var t=ER(),n=xR(),r=Dg(),i=NR();function o(ye){return ye.call.bind(ye)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),p=o(Boolean.prototype.valueOf);if(s)var d=o(BigInt.prototype.valueOf);if(a)var m=o(Symbol.prototype.valueOf);function b(ye,We){if(typeof ye!="object")return!1;try{return We(ye),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i;function w(ye){return typeof Promise<"u"&&ye instanceof Promise||ye!==null&&typeof ye=="object"&&typeof ye.then=="function"&&typeof ye.catch=="function"}e.isPromise=w;function S(ye){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ye):i(ye)||ie(ye)}e.isArrayBufferView=S;function y(ye){return r(ye)==="Uint8Array"}e.isUint8Array=y;function g(ye){return r(ye)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function v(ye){return r(ye)==="Uint16Array"}e.isUint16Array=v;function h(ye){return r(ye)==="Uint32Array"}e.isUint32Array=h;function E(ye){return r(ye)==="Int8Array"}e.isInt8Array=E;function T(ye){return r(ye)==="Int16Array"}e.isInt16Array=T;function R(ye){return r(ye)==="Int32Array"}e.isInt32Array=R;function x(ye){return r(ye)==="Float32Array"}e.isFloat32Array=x;function A(ye){return r(ye)==="Float64Array"}e.isFloat64Array=A;function N(ye){return r(ye)==="BigInt64Array"}e.isBigInt64Array=N;function W(ye){return r(ye)==="BigUint64Array"}e.isBigUint64Array=W;function O(ye){return l(ye)==="[object Map]"}O.working=typeof Map<"u"&&O(new Map);function D(ye){return typeof Map>"u"?!1:O.working?O(ye):ye instanceof Map}e.isMap=D;function V(ye){return l(ye)==="[object Set]"}V.working=typeof Set<"u"&&V(new Set);function L(ye){return typeof Set>"u"?!1:V.working?V(ye):ye instanceof Set}e.isSet=L;function te(ye){return l(ye)==="[object WeakMap]"}te.working=typeof WeakMap<"u"&&te(new WeakMap);function Y(ye){return typeof WeakMap>"u"?!1:te.working?te(ye):ye instanceof WeakMap}e.isWeakMap=Y;function se(ye){return l(ye)==="[object WeakSet]"}se.working=typeof WeakSet<"u"&&se(new WeakSet);function he(ye){return se(ye)}e.isWeakSet=he;function ae(ye){return l(ye)==="[object ArrayBuffer]"}ae.working=typeof ArrayBuffer<"u"&&ae(new ArrayBuffer);function we(ye){return typeof ArrayBuffer>"u"?!1:ae.working?ae(ye):ye instanceof ArrayBuffer}e.isArrayBuffer=we;function Q(ye){return l(ye)==="[object DataView]"}Q.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Q(new DataView(new ArrayBuffer(1),0,1));function ie(ye){return typeof DataView>"u"?!1:Q.working?Q(ye):ye instanceof DataView}e.isDataView=ie;var ce=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ae(ye){return l(ye)==="[object SharedArrayBuffer]"}function ee(ye){return typeof ce>"u"?!1:(typeof Ae.working>"u"&&(Ae.working=Ae(new ce)),Ae.working?Ae(ye):ye instanceof ce)}e.isSharedArrayBuffer=ee;function F(ye){return l(ye)==="[object AsyncFunction]"}e.isAsyncFunction=F;function C(ye){return l(ye)==="[object Map Iterator]"}e.isMapIterator=C;function q(ye){return l(ye)==="[object Set Iterator]"}e.isSetIterator=q;function K(ye){return l(ye)==="[object Generator]"}e.isGeneratorObject=K;function j(ye){return l(ye)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=j;function H(ye){return b(ye,u)}e.isNumberObject=H;function ge(ye){return b(ye,c)}e.isStringObject=ge;function xe(ye){return b(ye,p)}e.isBooleanObject=xe;function De(ye){return s&&b(ye,d)}e.isBigIntObject=De;function Oe(ye){return a&&b(ye,m)}e.isSymbolObject=Oe;function Ce(ye){return H(ye)||ge(ye)||xe(ye)||De(ye)||Oe(ye)}e.isBoxedPrimitive=Ce;function Fe(ye){return typeof Uint8Array<"u"&&(we(ye)||ee(ye))}e.isAnyArrayBuffer=Fe,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ye){Object.defineProperty(e,ye,{enumerable:!1,value:function(){throw new Error(ye+" is not supported in userland")}})})})(kc)),kc}var Iu,$g;function $R(){return $g||($g=1,Iu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),Iu}var Mg;function Bg(){return Mg||(Mg=1,(function(e){var t=Object.getOwnPropertyDescriptors||function(ie){for(var ce=Object.keys(ie),Ae={},ee=0;ee<ce.length;ee++)Ae[ce[ee]]=Object.getOwnPropertyDescriptor(ie,ce[ee]);return Ae},n=/%[sdj%]/g;e.format=function(Q){if(!E(Q)){for(var ie=[],ce=0;ce<arguments.length;ce++)ie.push(s(arguments[ce]));return ie.join(" ")}for(var ce=1,Ae=arguments,ee=Ae.length,F=String(Q).replace(n,function(q){if(q==="%%")return"%";if(ce>=ee)return q;switch(q){case"%s":return String(Ae[ce++]);case"%d":return Number(Ae[ce++]);case"%j":try{return JSON.stringify(Ae[ce++])}catch{return"[Circular]"}default:return q}}),C=Ae[ce];ce<ee;C=Ae[++ce])g(C)||!A(C)?F+=" "+C:F+=" "+s(C);return F},e.deprecate=function(Q,ie){if(typeof be<"u"&&be.noDeprecation===!0)return Q;if(typeof be>"u")return function(){return e.deprecate(Q,ie).apply(this,arguments)};var ce=!1;function Ae(){if(!ce){if(be.throwDeprecation)throw new Error(ie);be.traceDeprecation?console.trace(ie):console.error(ie),ce=!0}return Q.apply(this,arguments)}return Ae};var r={},i=/^$/;if(be.env.NODE_DEBUG){var o=be.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}e.debuglog=function(Q){if(Q=Q.toUpperCase(),!r[Q])if(i.test(Q)){var ie=be.pid;r[Q]=function(){var ce=e.format.apply(e,arguments);console.error("%s %d: %s",Q,ie,ce)}}else r[Q]=function(){};return r[Q]};function s(Q,ie){var ce={seen:[],stylize:l};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),y(ie)?ce.showHidden=ie:ie&&e._extend(ce,ie),R(ce.showHidden)&&(ce.showHidden=!1),R(ce.depth)&&(ce.depth=2),R(ce.colors)&&(ce.colors=!1),R(ce.customInspect)&&(ce.customInspect=!0),ce.colors&&(ce.stylize=a),c(ce,Q,ce.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(Q,ie){var ce=s.styles[ie];return ce?"\x1B["+s.colors[ce][0]+"m"+Q+"\x1B["+s.colors[ce][1]+"m":Q}function l(Q,ie){return Q}function u(Q){var ie={};return Q.forEach(function(ce,Ae){ie[ce]=!0}),ie}function c(Q,ie,ce){if(Q.customInspect&&ie&&O(ie.inspect)&&ie.inspect!==e.inspect&&!(ie.constructor&&ie.constructor.prototype===ie)){var Ae=ie.inspect(ce,Q);return E(Ae)||(Ae=c(Q,Ae,ce)),Ae}var ee=p(Q,ie);if(ee)return ee;var F=Object.keys(ie),C=u(F);if(Q.showHidden&&(F=Object.getOwnPropertyNames(ie)),W(ie)&&(F.indexOf("message")>=0||F.indexOf("description")>=0))return d(ie);if(F.length===0){if(O(ie)){var q=ie.name?": "+ie.name:"";return Q.stylize("[Function"+q+"]","special")}if(x(ie))return Q.stylize(RegExp.prototype.toString.call(ie),"regexp");if(N(ie))return Q.stylize(Date.prototype.toString.call(ie),"date");if(W(ie))return d(ie)}var K="",j=!1,H=["{","}"];if(S(ie)&&(j=!0,H=["[","]"]),O(ie)){var ge=ie.name?": "+ie.name:"";K=" [Function"+ge+"]"}if(x(ie)&&(K=" "+RegExp.prototype.toString.call(ie)),N(ie)&&(K=" "+Date.prototype.toUTCString.call(ie)),W(ie)&&(K=" "+d(ie)),F.length===0&&(!j||ie.length==0))return H[0]+K+H[1];if(ce<0)return x(ie)?Q.stylize(RegExp.prototype.toString.call(ie),"regexp"):Q.stylize("[Object]","special");Q.seen.push(ie);var xe;return j?xe=m(Q,ie,ce,C,F):xe=F.map(function(De){return b(Q,ie,ce,C,De,j)}),Q.seen.pop(),w(xe,K,H)}function p(Q,ie){if(R(ie))return Q.stylize("undefined","undefined");if(E(ie)){var ce="'"+JSON.stringify(ie).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Q.stylize(ce,"string")}if(h(ie))return Q.stylize(""+ie,"number");if(y(ie))return Q.stylize(""+ie,"boolean");if(g(ie))return Q.stylize("null","null")}function d(Q){return"["+Error.prototype.toString.call(Q)+"]"}function m(Q,ie,ce,Ae,ee){for(var F=[],C=0,q=ie.length;C<q;++C)se(ie,String(C))?F.push(b(Q,ie,ce,Ae,String(C),!0)):F.push("");return ee.forEach(function(K){K.match(/^\d+$/)||F.push(b(Q,ie,ce,Ae,K,!0))}),F}function b(Q,ie,ce,Ae,ee,F){var C,q,K;if(K=Object.getOwnPropertyDescriptor(ie,ee)||{value:ie[ee]},K.get?K.set?q=Q.stylize("[Getter/Setter]","special"):q=Q.stylize("[Getter]","special"):K.set&&(q=Q.stylize("[Setter]","special")),se(Ae,ee)||(C="["+ee+"]"),q||(Q.seen.indexOf(K.value)<0?(g(ce)?q=c(Q,K.value,null):q=c(Q,K.value,ce-1),q.indexOf(`
7
- `)>-1&&(F?q=q.split(`
8
- `).map(function(j){return" "+j}).join(`
9
- `).slice(2):q=`
10
- `+q.split(`
11
- `).map(function(j){return" "+j}).join(`
12
- `))):q=Q.stylize("[Circular]","special")),R(C)){if(F&&ee.match(/^\d+$/))return q;C=JSON.stringify(""+ee),C.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(C=C.slice(1,-1),C=Q.stylize(C,"name")):(C=C.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),C=Q.stylize(C,"string"))}return C+": "+q}function w(Q,ie,ce){var Ae=Q.reduce(function(ee,F){return F.indexOf(`
13
- `)>=0,ee+F.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ae>60?ce[0]+(ie===""?"":ie+`
14
- `)+" "+Q.join(`,
15
- `)+" "+ce[1]:ce[0]+ie+" "+Q.join(", ")+" "+ce[1]}e.types=LR();function S(Q){return Array.isArray(Q)}e.isArray=S;function y(Q){return typeof Q=="boolean"}e.isBoolean=y;function g(Q){return Q===null}e.isNull=g;function v(Q){return Q==null}e.isNullOrUndefined=v;function h(Q){return typeof Q=="number"}e.isNumber=h;function E(Q){return typeof Q=="string"}e.isString=E;function T(Q){return typeof Q=="symbol"}e.isSymbol=T;function R(Q){return Q===void 0}e.isUndefined=R;function x(Q){return A(Q)&&V(Q)==="[object RegExp]"}e.isRegExp=x,e.types.isRegExp=x;function A(Q){return typeof Q=="object"&&Q!==null}e.isObject=A;function N(Q){return A(Q)&&V(Q)==="[object Date]"}e.isDate=N,e.types.isDate=N;function W(Q){return A(Q)&&(V(Q)==="[object Error]"||Q instanceof Error)}e.isError=W,e.types.isNativeError=W;function O(Q){return typeof Q=="function"}e.isFunction=O;function D(Q){return Q===null||typeof Q=="boolean"||typeof Q=="number"||typeof Q=="string"||typeof Q=="symbol"||typeof Q>"u"}e.isPrimitive=D,e.isBuffer=$R();function V(Q){return Object.prototype.toString.call(Q)}function L(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}var te=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Y(){var Q=new Date,ie=[L(Q.getHours()),L(Q.getMinutes()),L(Q.getSeconds())].join(":");return[Q.getDate(),te[Q.getMonth()],ie].join(" ")}e.log=function(){console.log("%s - %s",Y(),e.format.apply(e,arguments))},e.inherits=ui(),e._extend=function(Q,ie){if(!ie||!A(ie))return Q;for(var ce=Object.keys(ie),Ae=ce.length;Ae--;)Q[ce[Ae]]=ie[ce[Ae]];return Q};function se(Q,ie){return Object.prototype.hasOwnProperty.call(Q,ie)}var he=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(ie){if(typeof ie!="function")throw new TypeError('The "original" argument must be of type Function');if(he&&ie[he]){var ce=ie[he];if(typeof ce!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ce,he,{value:ce,enumerable:!1,writable:!1,configurable:!0}),ce}function ce(){for(var Ae,ee,F=new Promise(function(K,j){Ae=K,ee=j}),C=[],q=0;q<arguments.length;q++)C.push(arguments[q]);C.push(function(K,j){K?ee(K):Ae(j)});try{ie.apply(this,C)}catch(K){ee(K)}return F}return Object.setPrototypeOf(ce,Object.getPrototypeOf(ie)),he&&Object.defineProperty(ce,he,{value:ce,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ce,t(ie))},e.promisify.custom=he;function ae(Q,ie){if(!Q){var ce=new Error("Promise was rejected with a falsy value");ce.reason=Q,Q=ce}return ie(Q)}function we(Q){if(typeof Q!="function")throw new TypeError('The "original" argument must be of type Function');function ie(){for(var ce=[],Ae=0;Ae<arguments.length;Ae++)ce.push(arguments[Ae]);var ee=ce.pop();if(typeof ee!="function")throw new TypeError("The last argument must be of type Function");var F=this,C=function(){return ee.apply(F,arguments)};Q.apply(this,ce).then(function(q){be.nextTick(C.bind(null,null,q))},function(q){be.nextTick(ae.bind(null,q,C))})}return Object.setPrototypeOf(ie,Object.getPrototypeOf(Q)),Object.defineProperties(ie,t(Q)),ie}e.callbackify=we})(Cc)),Cc}var Ou,jg;function MR(){if(jg)return Ou;jg=1;function e(b,w){var S=Object.keys(b);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(b);w&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),S.push.apply(S,y)}return S}function t(b){for(var w=1;w<arguments.length;w++){var S=arguments[w]!=null?arguments[w]:{};w%2?e(Object(S),!0).forEach(function(y){n(b,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(S)):e(Object(S)).forEach(function(y){Object.defineProperty(b,y,Object.getOwnPropertyDescriptor(S,y))})}return b}function n(b,w,S){return w=s(w),w in b?Object.defineProperty(b,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):b[w]=S,b}function r(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function i(b,w){for(var S=0;S<w.length;S++){var y=w[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,s(y.key),y)}}function o(b,w,S){return w&&i(b.prototype,w),Object.defineProperty(b,"prototype",{writable:!1}),b}function s(b){var w=a(b,"string");return typeof w=="symbol"?w:String(w)}function a(b,w){if(typeof b!="object"||b===null)return b;var S=b[Symbol.toPrimitive];if(S!==void 0){var y=S.call(b,w);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}var l=ta(),u=l.Buffer,c=Bg(),p=c.inspect,d=p&&p.custom||"inspect";function m(b,w,S){u.prototype.copy.call(b,w,S)}return Ou=(function(){function b(){r(this,b),this.head=null,this.tail=null,this.length=0}return o(b,[{key:"push",value:function(S){var y={data:S,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(S){var y={data:S,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var y=this.head,g=""+y.data;y=y.next;)g+=S+y.data;return g}},{key:"concat",value:function(S){if(this.length===0)return u.alloc(0);for(var y=u.allocUnsafe(S>>>0),g=this.head,v=0;g;)m(g.data,y,v),v+=g.data.length,g=g.next;return y}},{key:"consume",value:function(S,y){var g;return S<this.head.data.length?(g=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?g=this.shift():g=y?this._getString(S):this._getBuffer(S),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var y=this.head,g=1,v=y.data;for(S-=v.length;y=y.next;){var h=y.data,E=S>h.length?h.length:S;if(E===h.length?v+=h:v+=h.slice(0,S),S-=E,S===0){E===h.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=h.slice(E));break}++g}return this.length-=g,v}},{key:"_getBuffer",value:function(S){var y=u.allocUnsafe(S),g=this.head,v=1;for(g.data.copy(y),S-=g.data.length;g=g.next;){var h=g.data,E=S>h.length?h.length:S;if(h.copy(y,y.length-S,0,E),S-=E,S===0){E===h.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=h.slice(E));break}++v}return this.length-=v,y}},{key:d,value:function(S,y){return p(this,t(t({},y),{},{depth:0,customInspect:!1}))}}]),b})(),Ou}var Fu,Ug;function Vg(){if(Ug)return Fu;Ug=1;function e(s,a){var l=this,u=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return u||c?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,be.nextTick(i,this,s)):be.nextTick(i,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(p){!a&&p?l._writableState?l._writableState.errorEmitted?be.nextTick(n,l):(l._writableState.errorEmitted=!0,be.nextTick(t,l,p)):be.nextTick(t,l,p):a?(be.nextTick(n,l),a(p)):be.nextTick(n,l)}),this)}function t(s,a){i(s,a),n(s)}function n(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(s,a){s.emit("error",a)}function o(s,a){var l=s._readableState,u=s._writableState;l&&l.autoDestroy||u&&u.autoDestroy?s.destroy(a):s.emit("error",a)}return Fu={destroy:e,undestroy:r,errorOrDestroy:o},Fu}var _u={},qg;function Vi(){if(qg)return _u;qg=1;function e(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var t={};function n(a,l,u){u||(u=Error);function c(d,m,b){return typeof l=="string"?l:l(d,m,b)}var p=(function(d){e(m,d);function m(b,w,S){return d.call(this,c(b,w,S))||this}return m})(u);p.prototype.name=u.name,p.prototype.code=a,t[a]=p}function r(a,l){if(Array.isArray(a)){var u=a.length;return a=a.map(function(c){return String(c)}),u>2?"one of ".concat(l," ").concat(a.slice(0,u-1).join(", "),", or ")+a[u-1]:u===2?"one of ".concat(l," ").concat(a[0]," or ").concat(a[1]):"of ".concat(l," ").concat(a[0])}else return"of ".concat(l," ").concat(String(a))}function i(a,l,u){return a.substr(0,l.length)===l}function o(a,l,u){return(u===void 0||u>a.length)&&(u=a.length),a.substring(u-l.length,u)===l}function s(a,l,u){return typeof u!="number"&&(u=0),u+l.length>a.length?!1:a.indexOf(l,u)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,l,u){var c;typeof l=="string"&&i(l,"not ")?(c="must not be",l=l.replace(/^not /,"")):c="must be";var p;if(o(a," argument"))p="The ".concat(a," ").concat(c," ").concat(r(l,"type"));else{var d=s(a,".")?"property":"argument";p='The "'.concat(a,'" ').concat(d," ").concat(c," ").concat(r(l,"type"))}return p+=". Received type ".concat(typeof u),p},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_u.codes=t,_u}var Du,zg;function Wg(){if(zg)return Du;zg=1;var e=Vi().codes.ERR_INVALID_OPT_VALUE;function t(r,i,o){return r.highWaterMark!=null?r.highWaterMark:i?r[o]:null}function n(r,i,o,s){var a=t(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?o:"highWaterMark";throw new e(l,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return Du={getHighWaterMark:n},Du}var Nu,Hg;function BR(){if(Hg)return Nu;Hg=1,Nu=e;function e(n,r){if(t("noDeprecation"))return n;var i=!1;function o(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return o}function t(n){try{if(!zr.localStorage)return!1}catch{return!1}var r=zr.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return Nu}var Lu,Kg;function Gg(){if(Kg)return Lu;Kg=1,Lu=x;function e(ee){var F=this;this.next=null,this.entry=null,this.finish=function(){Ae(F,ee)}}var t;x.WritableState=T;var n={deprecate:BR()},r=km(),i=ta().Buffer,o=(typeof zr<"u"?zr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(ee){return i.from(ee)}function a(ee){return i.isBuffer(ee)||ee instanceof o}var l=Vg(),u=Wg(),c=u.getHighWaterMark,p=Vi().codes,d=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,b=p.ERR_MULTIPLE_CALLBACK,w=p.ERR_STREAM_CANNOT_PIPE,S=p.ERR_STREAM_DESTROYED,y=p.ERR_STREAM_NULL_VALUES,g=p.ERR_STREAM_WRITE_AFTER_END,v=p.ERR_UNKNOWN_ENCODING,h=l.errorOrDestroy;ui()(x,r);function E(){}function T(ee,F,C){t=t||qi(),ee=ee||{},typeof C!="boolean"&&(C=F instanceof t),this.objectMode=!!ee.objectMode,C&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=c(this,ee,"writableHighWaterMark",C),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var q=ee.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){te(F,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var F=this.bufferedRequest,C=[];F;)C.push(F),F=F.next;return C},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var R;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(F){return R.call(this,F)?!0:this!==x?!1:F&&F._writableState instanceof T}})):R=function(F){return F instanceof this};function x(ee){t=t||qi();var F=this instanceof t;if(!F&&!R.call(x,this))return new x(ee);this._writableState=new T(ee,this,F),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),r.call(this)}x.prototype.pipe=function(){h(this,new w)};function A(ee,F){var C=new g;h(ee,C),be.nextTick(F,C)}function N(ee,F,C,q){var K;return C===null?K=new y:typeof C!="string"&&!F.objectMode&&(K=new d("chunk",["string","Buffer"],C)),K?(h(ee,K),be.nextTick(q,K),!1):!0}x.prototype.write=function(ee,F,C){var q=this._writableState,K=!1,j=!q.objectMode&&a(ee);return j&&!i.isBuffer(ee)&&(ee=s(ee)),typeof F=="function"&&(C=F,F=null),j?F="buffer":F||(F=q.defaultEncoding),typeof C!="function"&&(C=E),q.ending?A(this,C):(j||N(this,q,ee,C))&&(q.pendingcb++,K=O(this,q,j,ee,F,C)),K},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&he(this,ee))},x.prototype.setDefaultEncoding=function(F){if(typeof F=="string"&&(F=F.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new v(F);return this._writableState.defaultEncoding=F,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function W(ee,F,C){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof F=="string"&&(F=i.from(F,C)),F}Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O(ee,F,C,q,K,j){if(!C){var H=W(F,q,K);q!==H&&(C=!0,K="buffer",q=H)}var ge=F.objectMode?1:q.length;F.length+=ge;var xe=F.length<F.highWaterMark;if(xe||(F.needDrain=!0),F.writing||F.corked){var De=F.lastBufferedRequest;F.lastBufferedRequest={chunk:q,encoding:K,isBuf:C,callback:j,next:null},De?De.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else D(ee,F,!1,ge,q,K,j);return xe}function D(ee,F,C,q,K,j,H){F.writelen=q,F.writecb=H,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new S("write")):C?ee._writev(K,F.onwrite):ee._write(K,j,F.onwrite),F.sync=!1}function V(ee,F,C,q,K){--F.pendingcb,C?(be.nextTick(K,q),be.nextTick(ie,ee,F),ee._writableState.errorEmitted=!0,h(ee,q)):(K(q),ee._writableState.errorEmitted=!0,h(ee,q),ie(ee,F))}function L(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}function te(ee,F){var C=ee._writableState,q=C.sync,K=C.writecb;if(typeof K!="function")throw new b;if(L(C),F)V(ee,C,q,F,K);else{var j=ae(C)||ee.destroyed;!j&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&he(ee,C),q?be.nextTick(Y,ee,C,j,K):Y(ee,C,j,K)}}function Y(ee,F,C,q){C||se(ee,F),F.pendingcb--,q(),ie(ee,F)}function se(ee,F){F.length===0&&F.needDrain&&(F.needDrain=!1,ee.emit("drain"))}function he(ee,F){F.bufferProcessing=!0;var C=F.bufferedRequest;if(ee._writev&&C&&C.next){var q=F.bufferedRequestCount,K=new Array(q),j=F.corkedRequestsFree;j.entry=C;for(var H=0,ge=!0;C;)K[H]=C,C.isBuf||(ge=!1),C=C.next,H+=1;K.allBuffers=ge,D(ee,F,!0,F.length,K,"",j.finish),F.pendingcb++,F.lastBufferedRequest=null,j.next?(F.corkedRequestsFree=j.next,j.next=null):F.corkedRequestsFree=new e(F),F.bufferedRequestCount=0}else{for(;C;){var xe=C.chunk,De=C.encoding,Oe=C.callback,Ce=F.objectMode?1:xe.length;if(D(ee,F,!1,Ce,xe,De,Oe),C=C.next,F.bufferedRequestCount--,F.writing)break}C===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=C,F.bufferProcessing=!1}x.prototype._write=function(ee,F,C){C(new m("_write()"))},x.prototype._writev=null,x.prototype.end=function(ee,F,C){var q=this._writableState;return typeof ee=="function"?(C=ee,ee=null,F=null):typeof F=="function"&&(C=F,F=null),ee!=null&&this.write(ee,F),q.corked&&(q.corked=1,this.uncork()),q.ending||ce(this,q,C),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ae(ee){return ee.ending&&ee.length===0&&ee.bufferedRequest===null&&!ee.finished&&!ee.writing}function we(ee,F){ee._final(function(C){F.pendingcb--,C&&h(ee,C),F.prefinished=!0,ee.emit("prefinish"),ie(ee,F)})}function Q(ee,F){!F.prefinished&&!F.finalCalled&&(typeof ee._final=="function"&&!F.destroyed?(F.pendingcb++,F.finalCalled=!0,be.nextTick(we,ee,F)):(F.prefinished=!0,ee.emit("prefinish")))}function ie(ee,F){var C=ae(F);if(C&&(Q(ee,F),F.pendingcb===0&&(F.finished=!0,ee.emit("finish"),F.autoDestroy))){var q=ee._readableState;(!q||q.autoDestroy&&q.endEmitted)&&ee.destroy()}return C}function ce(ee,F,C){F.ending=!0,ie(ee,F),C&&(F.finished?be.nextTick(C):ee.once("finish",C)),F.ended=!0,ee.writable=!1}function Ae(ee,F,C){var q=ee.entry;for(ee.entry=null;q;){var K=q.callback;F.pendingcb--,K(C),q=q.next}F.corkedRequestsFree.next=ee}return Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(F){this._writableState&&(this._writableState.destroyed=F)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(ee,F){F(ee)},Lu}var $u,Qg;function qi(){if(Qg)return $u;Qg=1;var e=Object.keys||function(u){var c=[];for(var p in u)c.push(p);return c};$u=s;var t=ny(),n=Gg();ui()(s,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var o=r[i];s.prototype[o]||(s.prototype[o]=n.prototype[o])}function s(u){if(!(this instanceof s))return new s(u);t.call(this,u),n.call(this,u),this.allowHalfOpen=!0,u&&(u.readable===!1&&(this.readable=!1),u.writable===!1&&(this.writable=!1),u.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||be.nextTick(l,this)}function l(u){u.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),$u}var Mu={},ia={exports:{}};var Xg;function jR(){return Xg||(Xg=1,(function(e,t){var n=ta(),r=n.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o);function o(s,a,l){return r(s,a,l)}o.prototype=Object.create(r.prototype),i(r,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=r(s);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},o.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}})(ia,ia.exports)),ia.exports}var Yg;function Bu(){if(Yg)return Mu;Yg=1;var e=jR().Buffer,t=e.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(y){if(!y)return"utf8";for(var g;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(g)return;y=(""+y).toLowerCase(),g=!0}}function r(y){var g=n(y);if(typeof g!="string"&&(e.isEncoding===t||!t(y)))throw new Error("Unknown encoding: "+y);return g||y}Mu.StringDecoder=i;function i(y){this.encoding=r(y);var g;switch(this.encoding){case"utf16le":this.text=p,this.end=d,g=4;break;case"utf8":this.fillLast=l,g=4;break;case"base64":this.text=m,this.end=b,g=3;break;default:this.write=w,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}i.prototype.write=function(y){if(y.length===0)return"";var g,v;if(this.lastNeed){if(g=this.fillLast(y),g===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<y.length?g?g+this.text(y,v):this.text(y,v):g||""},i.prototype.end=c,i.prototype.text=u,i.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function o(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function s(y,g,v){var h=g.length-1;if(h<v)return 0;var E=o(g[h]);return E>=0?(E>0&&(y.lastNeed=E-1),E):--h<v||E===-2?0:(E=o(g[h]),E>=0?(E>0&&(y.lastNeed=E-2),E):--h<v||E===-2?0:(E=o(g[h]),E>=0?(E>0&&(E===2?E=0:y.lastNeed=E-3),E):0))}function a(y,g,v){if((g[0]&192)!==128)return y.lastNeed=0,"�";if(y.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return y.lastNeed=1,"�";if(y.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return y.lastNeed=2,"�"}}function l(y){var g=this.lastTotal-this.lastNeed,v=a(this,y);if(v!==void 0)return v;if(this.lastNeed<=y.length)return y.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,g,0,y.length),this.lastNeed-=y.length}function u(y,g){var v=s(this,y,g);if(!this.lastNeed)return y.toString("utf8",g);this.lastTotal=v;var h=y.length-(v-this.lastNeed);return y.copy(this.lastChar,0,h),y.toString("utf8",g,h)}function c(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+"�":g}function p(y,g){if((y.length-g)%2===0){var v=y.toString("utf16le",g);if(v){var h=v.charCodeAt(v.length-1);if(h>=55296&&h<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",g,y.length-1)}function d(y){var g=y&&y.length?this.write(y):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,v)}return g}function m(y,g){var v=(y.length-g)%3;return v===0?y.toString("base64",g):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",g,y.length-v))}function b(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function w(y){return y.toString(this.encoding)}function S(y){return y&&y.length?this.write(y):""}return Mu}var ju,Jg;function Uu(){if(Jg)return ju;Jg=1;var e=Vi().codes.ERR_STREAM_PREMATURE_CLOSE;function t(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];o.apply(this,l)}}}function n(){}function r(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=t(a||n);var l=s.readable||s.readable!==!1&&o.readable,u=s.writable||s.writable!==!1&&o.writable,c=function(){o.writable||d()},p=o._writableState&&o._writableState.finished,d=function(){u=!1,p=!0,l||a.call(o)},m=o._readableState&&o._readableState.endEmitted,b=function(){l=!1,m=!0,u||a.call(o)},w=function(v){a.call(o,v)},S=function(){var v;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(v=new e),a.call(o,v);if(u&&!p)return(!o._writableState||!o._writableState.ended)&&(v=new e),a.call(o,v)},y=function(){o.req.on("finish",d)};return r(o)?(o.on("complete",d),o.on("abort",S),o.req?y():o.on("request",y)):u&&!o._writableState&&(o.on("end",c),o.on("close",c)),o.on("end",b),o.on("finish",d),s.error!==!1&&o.on("error",w),o.on("close",S),function(){o.removeListener("complete",d),o.removeListener("abort",S),o.removeListener("request",y),o.req&&o.req.removeListener("finish",d),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",d),o.removeListener("end",b),o.removeListener("error",w),o.removeListener("close",S)}}return ju=i,ju}var Vu,Zg;function UR(){if(Zg)return Vu;Zg=1;var e;function t(v,h,E){return h=n(h),h in v?Object.defineProperty(v,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[h]=E,v}function n(v){var h=r(v,"string");return typeof h=="symbol"?h:String(h)}function r(v,h){if(typeof v!="object"||v===null)return v;var E=v[Symbol.toPrimitive];if(E!==void 0){var T=E.call(v,h);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(v)}var i=Uu(),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),p=Symbol("stream");function d(v,h){return{value:v,done:h}}function m(v){var h=v[o];if(h!==null){var E=v[p].read();E!==null&&(v[u]=null,v[o]=null,v[s]=null,h(d(E,!1)))}}function b(v){be.nextTick(m,v)}function w(v,h){return function(E,T){v.then(function(){if(h[l]){E(d(void 0,!0));return}h[c](E,T)},T)}}var S=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var h=this,E=this[a];if(E!==null)return Promise.reject(E);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(A,N){be.nextTick(function(){h[a]?N(h[a]):A(d(void 0,!0))})});var T=this[u],R;if(T)R=new Promise(w(T,this));else{var x=this[p].read();if(x!==null)return Promise.resolve(d(x,!1));R=new Promise(this[c])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var h=this;return new Promise(function(E,T){h[p].destroy(null,function(R){if(R){T(R);return}E(d(void 0,!0))})})}),e),S),g=function(h){var E,T=Object.create(y,(E={},t(E,p,{value:h,writable:!0}),t(E,o,{value:null,writable:!0}),t(E,s,{value:null,writable:!0}),t(E,a,{value:null,writable:!0}),t(E,l,{value:h._readableState.endEmitted,writable:!0}),t(E,c,{value:function(x,A){var N=T[p].read();N?(T[u]=null,T[o]=null,T[s]=null,x(d(N,!1))):(T[o]=x,T[s]=A)},writable:!0}),E));return T[u]=null,i(h,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var x=T[s];x!==null&&(T[u]=null,T[o]=null,T[s]=null,x(R)),T[a]=R;return}var A=T[o];A!==null&&(T[u]=null,T[o]=null,T[s]=null,A(d(void 0,!0))),T[l]=!0}),h.on("readable",b.bind(null,T)),T};return Vu=g,Vu}var qu,ey;function VR(){return ey||(ey=1,qu=function(){throw new Error("Readable.from is not available in the browser")}),qu}var zu,ty;function ny(){if(ty)return zu;ty=1,zu=A;var e;A.ReadableState=x,Ac().EventEmitter;var t=function(H,ge){return H.listeners(ge).length},n=km(),r=ta().Buffer,i=(typeof zr<"u"?zr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(j){return r.from(j)}function s(j){return r.isBuffer(j)||j instanceof i}var a=Bg(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var u=MR(),c=Vg(),p=Wg(),d=p.getHighWaterMark,m=Vi().codes,b=m.ERR_INVALID_ARG_TYPE,w=m.ERR_STREAM_PUSH_AFTER_EOF,S=m.ERR_METHOD_NOT_IMPLEMENTED,y=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,v,h;ui()(A,n);var E=c.errorOrDestroy,T=["error","close","destroy","pause","resume"];function R(j,H,ge){if(typeof j.prependListener=="function")return j.prependListener(H,ge);!j._events||!j._events[H]?j.on(H,ge):Array.isArray(j._events[H])?j._events[H].unshift(ge):j._events[H]=[ge,j._events[H]]}function x(j,H,ge){e=e||qi(),j=j||{},typeof ge!="boolean"&&(ge=H instanceof e),this.objectMode=!!j.objectMode,ge&&(this.objectMode=this.objectMode||!!j.readableObjectMode),this.highWaterMark=d(this,j,"readableHighWaterMark",ge),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.destroyed=!1,this.defaultEncoding=j.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,j.encoding&&(g||(g=Bu().StringDecoder),this.decoder=new g(j.encoding),this.encoding=j.encoding)}function A(j){if(e=e||qi(),!(this instanceof A))return new A(j);var H=this instanceof e;this._readableState=new x(j,this,H),this.readable=!0,j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(H){this._readableState&&(this._readableState.destroyed=H)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(j,H){H(j)},A.prototype.push=function(j,H){var ge=this._readableState,xe;return ge.objectMode?xe=!0:typeof j=="string"&&(H=H||ge.defaultEncoding,H!==ge.encoding&&(j=r.from(j,H),H=""),xe=!0),N(this,j,H,!1,xe)},A.prototype.unshift=function(j){return N(this,j,null,!0,!1)};function N(j,H,ge,xe,De){l("readableAddChunk",H);var Oe=j._readableState;if(H===null)Oe.reading=!1,te(j,Oe);else{var Ce;if(De||(Ce=O(Oe,H)),Ce)E(j,Ce);else if(Oe.objectMode||H&&H.length>0)if(typeof H!="string"&&!Oe.objectMode&&Object.getPrototypeOf(H)!==r.prototype&&(H=o(H)),xe)Oe.endEmitted?E(j,new y):W(j,Oe,H,!0);else if(Oe.ended)E(j,new w);else{if(Oe.destroyed)return!1;Oe.reading=!1,Oe.decoder&&!ge?(H=Oe.decoder.write(H),Oe.objectMode||H.length!==0?W(j,Oe,H,!1):he(j,Oe)):W(j,Oe,H,!1)}else xe||(Oe.reading=!1,he(j,Oe))}return!Oe.ended&&(Oe.length<Oe.highWaterMark||Oe.length===0)}function W(j,H,ge,xe){H.flowing&&H.length===0&&!H.sync?(H.awaitDrain=0,j.emit("data",ge)):(H.length+=H.objectMode?1:ge.length,xe?H.buffer.unshift(ge):H.buffer.push(ge),H.needReadable&&Y(j)),he(j,H)}function O(j,H){var ge;return!s(H)&&typeof H!="string"&&H!==void 0&&!j.objectMode&&(ge=new b("chunk",["string","Buffer","Uint8Array"],H)),ge}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(j){g||(g=Bu().StringDecoder);var H=new g(j);this._readableState.decoder=H,this._readableState.encoding=this._readableState.decoder.encoding;for(var ge=this._readableState.buffer.head,xe="";ge!==null;)xe+=H.write(ge.data),ge=ge.next;return this._readableState.buffer.clear(),xe!==""&&this._readableState.buffer.push(xe),this._readableState.length=xe.length,this};var D=1073741824;function V(j){return j>=D?j=D:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function L(j,H){return j<=0||H.length===0&&H.ended?0:H.objectMode?1:j!==j?H.flowing&&H.length?H.buffer.head.data.length:H.length:(j>H.highWaterMark&&(H.highWaterMark=V(j)),j<=H.length?j:H.ended?H.length:(H.needReadable=!0,0))}A.prototype.read=function(j){l("read",j),j=parseInt(j,10);var H=this._readableState,ge=j;if(j!==0&&(H.emittedReadable=!1),j===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return l("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?C(this):Y(this),null;if(j=L(j,H),j===0&&H.ended)return H.length===0&&C(this),null;var xe=H.needReadable;l("need readable",xe),(H.length===0||H.length-j<H.highWaterMark)&&(xe=!0,l("length less than watermark",xe)),H.ended||H.reading?(xe=!1,l("reading or ended",xe)):xe&&(l("do read"),H.reading=!0,H.sync=!0,H.length===0&&(H.needReadable=!0),this._read(H.highWaterMark),H.sync=!1,H.reading||(j=L(ge,H)));var De;return j>0?De=F(j,H):De=null,De===null?(H.needReadable=H.length<=H.highWaterMark,j=0):(H.length-=j,H.awaitDrain=0),H.length===0&&(H.ended||(H.needReadable=!0),ge!==j&&H.ended&&C(this)),De!==null&&this.emit("data",De),De};function te(j,H){if(l("onEofChunk"),!H.ended){if(H.decoder){var ge=H.decoder.end();ge&&ge.length&&(H.buffer.push(ge),H.length+=H.objectMode?1:ge.length)}H.ended=!0,H.sync?Y(j):(H.needReadable=!1,H.emittedReadable||(H.emittedReadable=!0,se(j)))}}function Y(j){var H=j._readableState;l("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(l("emitReadable",H.flowing),H.emittedReadable=!0,be.nextTick(se,j))}function se(j){var H=j._readableState;l("emitReadable_",H.destroyed,H.length,H.ended),!H.destroyed&&(H.length||H.ended)&&(j.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,ee(j)}function he(j,H){H.readingMore||(H.readingMore=!0,be.nextTick(ae,j,H))}function ae(j,H){for(;!H.reading&&!H.ended&&(H.length<H.highWaterMark||H.flowing&&H.length===0);){var ge=H.length;if(l("maybeReadMore read 0"),j.read(0),ge===H.length)break}H.readingMore=!1}A.prototype._read=function(j){E(this,new S("_read()"))},A.prototype.pipe=function(j,H){var ge=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=j;break;case 1:xe.pipes=[xe.pipes,j];break;default:xe.pipes.push(j);break}xe.pipesCount+=1,l("pipe count=%d opts=%j",xe.pipesCount,H);var De=(!H||H.end!==!1)&&j!==be.stdout&&j!==be.stderr,Oe=De?Fe:Bt;xe.endEmitted?be.nextTick(Oe):ge.once("end",Oe),j.on("unpipe",Ce);function Ce(jt,ct){l("onunpipe"),jt===ge&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Ge())}function Fe(){l("onend"),j.end()}var ye=we(ge);j.on("drain",ye);var We=!1;function Ge(){l("cleanup"),j.removeListener("close",lt),j.removeListener("finish",Et),j.removeListener("drain",ye),j.removeListener("error",Xe),j.removeListener("unpipe",Ce),ge.removeListener("end",Fe),ge.removeListener("end",Bt),ge.removeListener("data",Qe),We=!0,xe.awaitDrain&&(!j._writableState||j._writableState.needDrain)&&ye()}ge.on("data",Qe);function Qe(jt){l("ondata");var ct=j.write(jt);l("dest.write",ct),ct===!1&&((xe.pipesCount===1&&xe.pipes===j||xe.pipesCount>1&&K(xe.pipes,j)!==-1)&&!We&&(l("false write response, pause",xe.awaitDrain),xe.awaitDrain++),ge.pause())}function Xe(jt){l("onerror",jt),Bt(),j.removeListener("error",Xe),t(j,"error")===0&&E(j,jt)}R(j,"error",Xe);function lt(){j.removeListener("finish",Et),Bt()}j.once("close",lt);function Et(){l("onfinish"),j.removeListener("close",lt),Bt()}j.once("finish",Et);function Bt(){l("unpipe"),ge.unpipe(j)}return j.emit("pipe",ge),xe.flowing||(l("pipe resume"),ge.resume()),j};function we(j){return function(){var ge=j._readableState;l("pipeOnDrain",ge.awaitDrain),ge.awaitDrain&&ge.awaitDrain--,ge.awaitDrain===0&&t(j,"data")&&(ge.flowing=!0,ee(j))}}A.prototype.unpipe=function(j){var H=this._readableState,ge={hasUnpiped:!1};if(H.pipesCount===0)return this;if(H.pipesCount===1)return j&&j!==H.pipes?this:(j||(j=H.pipes),H.pipes=null,H.pipesCount=0,H.flowing=!1,j&&j.emit("unpipe",this,ge),this);if(!j){var xe=H.pipes,De=H.pipesCount;H.pipes=null,H.pipesCount=0,H.flowing=!1;for(var Oe=0;Oe<De;Oe++)xe[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}var Ce=K(H.pipes,j);return Ce===-1?this:(H.pipes.splice(Ce,1),H.pipesCount-=1,H.pipesCount===1&&(H.pipes=H.pipes[0]),j.emit("unpipe",this,ge),this)},A.prototype.on=function(j,H){var ge=n.prototype.on.call(this,j,H),xe=this._readableState;return j==="data"?(xe.readableListening=this.listenerCount("readable")>0,xe.flowing!==!1&&this.resume()):j==="readable"&&!xe.endEmitted&&!xe.readableListening&&(xe.readableListening=xe.needReadable=!0,xe.flowing=!1,xe.emittedReadable=!1,l("on readable",xe.length,xe.reading),xe.length?Y(this):xe.reading||be.nextTick(ie,this)),ge},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(j,H){var ge=n.prototype.removeListener.call(this,j,H);return j==="readable"&&be.nextTick(Q,this),ge},A.prototype.removeAllListeners=function(j){var H=n.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&be.nextTick(Q,this),H};function Q(j){var H=j._readableState;H.readableListening=j.listenerCount("readable")>0,H.resumeScheduled&&!H.paused?H.flowing=!0:j.listenerCount("data")>0&&j.resume()}function ie(j){l("readable nexttick read 0"),j.read(0)}A.prototype.resume=function(){var j=this._readableState;return j.flowing||(l("resume"),j.flowing=!j.readableListening,ce(this,j)),j.paused=!1,this};function ce(j,H){H.resumeScheduled||(H.resumeScheduled=!0,be.nextTick(Ae,j,H))}function Ae(j,H){l("resume",H.reading),H.reading||j.read(0),H.resumeScheduled=!1,j.emit("resume"),ee(j),H.flowing&&!H.reading&&j.read(0)}A.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(j){var H=j._readableState;for(l("flow",H.flowing);H.flowing&&j.read()!==null;);}A.prototype.wrap=function(j){var H=this,ge=this._readableState,xe=!1;j.on("end",function(){if(l("wrapped end"),ge.decoder&&!ge.ended){var Ce=ge.decoder.end();Ce&&Ce.length&&H.push(Ce)}H.push(null)}),j.on("data",function(Ce){if(l("wrapped data"),ge.decoder&&(Ce=ge.decoder.write(Ce)),!(ge.objectMode&&Ce==null)&&!(!ge.objectMode&&(!Ce||!Ce.length))){var Fe=H.push(Ce);Fe||(xe=!0,j.pause())}});for(var De in j)this[De]===void 0&&typeof j[De]=="function"&&(this[De]=(function(Fe){return function(){return j[Fe].apply(j,arguments)}})(De));for(var Oe=0;Oe<T.length;Oe++)j.on(T[Oe],this.emit.bind(this,T[Oe]));return this._read=function(Ce){l("wrapped _read",Ce),xe&&(xe=!1,j.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=UR()),v(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(H){this._readableState&&(this._readableState.flowing=H)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function F(j,H){if(H.length===0)return null;var ge;return H.objectMode?ge=H.buffer.shift():!j||j>=H.length?(H.decoder?ge=H.buffer.join(""):H.buffer.length===1?ge=H.buffer.first():ge=H.buffer.concat(H.length),H.buffer.clear()):ge=H.buffer.consume(j,H.decoder),ge}function C(j){var H=j._readableState;l("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,be.nextTick(q,H,j))}function q(j,H){if(l("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,H.readable=!1,H.emit("end"),j.autoDestroy)){var ge=H._writableState;(!ge||ge.autoDestroy&&ge.finished)&&H.destroy()}}typeof Symbol=="function"&&(A.from=function(j,H){return h===void 0&&(h=VR()),h(A,j,H)});function K(j,H){for(var ge=0,xe=j.length;ge<xe;ge++)if(j[ge]===H)return ge;return-1}return zu}var Wu,ry;function iy(){if(ry)return Wu;ry=1,Wu=a;var e=Vi().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,o=qi();ui()(a,o);function s(c,p){var d=this._transformState;d.transforming=!1;var m=d.writecb;if(m===null)return this.emit("error",new n);d.writechunk=null,d.writecb=null,p!=null&&this.push(p),m(c);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function a(c){if(!(this instanceof a))return new a(c);o.call(this,c),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",l)}function l(){var c=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(p,d){u(c,p,d)}):u(this,null,null)}a.prototype.push=function(c,p){return this._transformState.needTransform=!1,o.prototype.push.call(this,c,p)},a.prototype._transform=function(c,p,d){d(new t("_transform()"))},a.prototype._write=function(c,p,d){var m=this._transformState;if(m.writecb=d,m.writechunk=c,m.writeencoding=p,!m.transforming){var b=this._readableState;(m.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},a.prototype._read=function(c){var p=this._transformState;p.writechunk!==null&&!p.transforming?(p.transforming=!0,this._transform(p.writechunk,p.writeencoding,p.afterTransform)):p.needTransform=!0},a.prototype._destroy=function(c,p){o.prototype._destroy.call(this,c,function(d){p(d)})};function u(c,p,d){if(p)return c.emit("error",p);if(d!=null&&c.push(d),c._writableState.length)throw new i;if(c._transformState.transforming)throw new r;return c.push(null)}return Wu}var Hu,oy;function qR(){if(oy)return Hu;oy=1,Hu=t;var e=iy();ui()(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,i){i(null,n)},Hu}var Ku,sy;function zR(){if(sy)return Ku;sy=1;var e;function t(d){var m=!1;return function(){m||(m=!0,d.apply(void 0,arguments))}}var n=Vi().codes,r=n.ERR_MISSING_ARGS,i=n.ERR_STREAM_DESTROYED;function o(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,m,b,w){w=t(w);var S=!1;d.on("close",function(){S=!0}),e===void 0&&(e=Uu()),e(d,{readable:m,writable:b},function(g){if(g)return w(g);S=!0,w()});var y=!1;return function(g){if(!S&&!y){if(y=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();w(g||new i("pipe"))}}}function l(d){d()}function u(d,m){return d.pipe(m)}function c(d){return!d.length||typeof d[d.length-1]!="function"?o:d.pop()}function p(){for(var d=arguments.length,m=new Array(d),b=0;b<d;b++)m[b]=arguments[b];var w=c(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var S,y=m.map(function(g,v){var h=v<m.length-1,E=v>0;return a(g,h,E,function(T){S||(S=T),T&&y.forEach(l),!h&&(y.forEach(l),w(S))})});return m.reduce(u)}return Ku=p,Ku}var Gu,ay;function WR(){if(ay)return Gu;ay=1,Gu=n;var e=Ac().EventEmitter,t=ui();t(n,e),n.Readable=ny(),n.Writable=Gg(),n.Duplex=qi(),n.Transform=iy(),n.PassThrough=qR(),n.finished=Uu(),n.pipeline=zR(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,i){var o=this;function s(m){r.writable&&r.write(m)===!1&&o.pause&&o.pause()}o.on("data",s);function a(){o.readable&&o.resume&&o.resume()}r.on("drain",a),!r._isStdio&&(!i||i.end!==!1)&&(o.on("end",u),o.on("close",c));var l=!1;function u(){l||(l=!0,r.end())}function c(){l||(l=!0,typeof r.destroy=="function"&&r.destroy())}function p(m){if(d(),e.listenerCount(this,"error")===0)throw m}o.on("error",p),r.on("error",p);function d(){o.removeListener("data",s),r.removeListener("drain",a),o.removeListener("end",u),o.removeListener("close",c),o.removeListener("error",p),r.removeListener("error",p),o.removeListener("end",d),o.removeListener("close",d),r.removeListener("close",d)}return o.on("end",d),o.on("close",d),r.on("close",d),r.emit("pipe",o),r},Gu}var ly;function HR(){return ly||(ly=1,(function(e){(function(t){t.parser=function(F,C){return new r(F,C)},t.SAXParser=r,t.SAXStream=c,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(F,C){if(!(this instanceof r))return new r(F,C);var q=this;o(q),q.q=q.c="",q.bufferCheckPosition=t.MAX_BUFFER_LENGTH,q.opt=C||{},q.opt.lowercase=q.opt.lowercase||q.opt.lowercasetags,q.looseCase=q.opt.lowercase?"toLowerCase":"toUpperCase",q.tags=[],q.closed=q.closedRoot=q.sawRoot=!1,q.tag=q.error=null,q.strict=!!F,q.noscript=!!(F||q.opt.noscript),q.state=A.BEGIN,q.strictEntities=q.opt.strictEntities,q.ENTITIES=q.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),q.attribList=[],q.opt.xmlns&&(q.ns=Object.create(w)),q.opt.unquotedAttributeValues===void 0&&(q.opt.unquotedAttributeValues=!F),q.trackPosition=q.opt.position!==!1,q.trackPosition&&(q.position=q.line=q.column=0),W(q,"onready")}Object.create||(Object.create=function(F){function C(){}C.prototype=F;var q=new C;return q}),Object.keys||(Object.keys=function(F){var C=[];for(var q in F)F.hasOwnProperty(q)&&C.push(q);return C});function i(F){for(var C=Math.max(t.MAX_BUFFER_LENGTH,10),q=0,K=0,j=n.length;K<j;K++){var H=F[n[K]].length;if(H>C)switch(n[K]){case"textNode":D(F);break;case"cdata":O(F,"oncdata",F.cdata),F.cdata="";break;case"script":O(F,"onscript",F.script),F.script="";break;default:L(F,"Max buffer length exceeded: "+n[K])}q=Math.max(q,H)}var ge=t.MAX_BUFFER_LENGTH-q;F.bufferCheckPosition=ge+F.position}function o(F){for(var C=0,q=n.length;C<q;C++)F[n[C]]=""}function s(F){D(F),F.cdata!==""&&(O(F,"oncdata",F.cdata),F.cdata=""),F.script!==""&&(O(F,"onscript",F.script),F.script="")}r.prototype={end:function(){te(this)},write:ee,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=WR().Stream}catch{a=function(){}}a||(a=function(){});var l=t.EVENTS.filter(function(F){return F!=="error"&&F!=="end"});function u(F,C){return new c(F,C)}function c(F,C){if(!(this instanceof c))return new c(F,C);a.apply(this),this._parser=new r(F,C),this.writable=!0,this.readable=!0;var q=this;this._parser.onend=function(){q.emit("end")},this._parser.onerror=function(K){q.emit("error",K),q._parser.error=null},this._decoder=null,l.forEach(function(K){Object.defineProperty(q,"on"+K,{get:function(){return q._parser["on"+K]},set:function(j){if(!j)return q.removeAllListeners(K),q._parser["on"+K]=j,j;q.on(K,j)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(a.prototype,{constructor:{value:c}}),c.prototype.write=function(F){if(typeof Kr=="function"&&typeof Kr.isBuffer=="function"&&Kr.isBuffer(F)){if(!this._decoder){var C=Bu().StringDecoder;this._decoder=new C("utf8")}F=this._decoder.write(F)}return this._parser.write(F.toString()),this.emit("data",F),!0},c.prototype.end=function(F){return F&&F.length&&this.write(F),this._parser.end(),!0},c.prototype.on=function(F,C){var q=this;return!q._parser["on"+F]&&l.indexOf(F)!==-1&&(q._parser["on"+F]=function(){var K=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);K.splice(0,0,F),q.emit.apply(q,K)}),a.prototype.on.call(q,F,C)};var p="[CDATA[",d="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",b="http://www.w3.org/2000/xmlns/",w={xml:m,xmlns:b},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function h(F){return F===" "||F===`
16
- `||F==="\r"||F===" "}function E(F){return F==='"'||F==="'"}function T(F){return F===">"||h(F)}function R(F,C){return F.test(C)}function x(F,C){return!R(F,C)}var A=0;t.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(F){var C=t.ENTITIES[F],q=typeof C=="number"?String.fromCharCode(C):C;t.ENTITIES[F]=q});for(var N in t.STATE)t.STATE[t.STATE[N]]=N;A=t.STATE;function W(F,C,q){F[C]&&F[C](q)}function O(F,C,q){F.textNode&&D(F),W(F,C,q)}function D(F){F.textNode=V(F.opt,F.textNode),F.textNode&&W(F,"ontext",F.textNode),F.textNode=""}function V(F,C){return F.trim&&(C=C.trim()),F.normalize&&(C=C.replace(/\s+/g," ")),C}function L(F,C){return D(F),F.trackPosition&&(C+=`
17
- Line: `+F.line+`
18
- Column: `+F.column+`
19
- Char: `+F.c),C=new Error(C),F.error=C,W(F,"onerror",C),F}function te(F){return F.sawRoot&&!F.closedRoot&&Y(F,"Unclosed root tag"),F.state!==A.BEGIN&&F.state!==A.BEGIN_WHITESPACE&&F.state!==A.TEXT&&L(F,"Unexpected end"),D(F),F.c="",F.closed=!0,W(F,"onend"),r.call(F,F.strict,F.opt),F}function Y(F,C){if(typeof F!="object"||!(F instanceof r))throw new Error("bad call to strictFail");F.strict&&L(F,C)}function se(F){F.strict||(F.tagName=F.tagName[F.looseCase]());var C=F.tags[F.tags.length-1]||F,q=F.tag={name:F.tagName,attributes:{}};F.opt.xmlns&&(q.ns=C.ns),F.attribList.length=0,O(F,"onopentagstart",q)}function he(F,C){var q=F.indexOf(":"),K=q<0?["",F]:F.split(":"),j=K[0],H=K[1];return C&&F==="xmlns"&&(j="xmlns",H=""),{prefix:j,local:H}}function ae(F){if(F.strict||(F.attribName=F.attribName[F.looseCase]()),F.attribList.indexOf(F.attribName)!==-1||F.tag.attributes.hasOwnProperty(F.attribName)){F.attribName=F.attribValue="";return}if(F.opt.xmlns){var C=he(F.attribName,!0),q=C.prefix,K=C.local;if(q==="xmlns")if(K==="xml"&&F.attribValue!==m)Y(F,"xml: prefix must be bound to "+m+`
20
- Actual: `+F.attribValue);else if(K==="xmlns"&&F.attribValue!==b)Y(F,"xmlns: prefix must be bound to "+b+`
21
- Actual: `+F.attribValue);else{var j=F.tag,H=F.tags[F.tags.length-1]||F;j.ns===H.ns&&(j.ns=Object.create(H.ns)),j.ns[K]=F.attribValue}F.attribList.push([F.attribName,F.attribValue])}else F.tag.attributes[F.attribName]=F.attribValue,O(F,"onattribute",{name:F.attribName,value:F.attribValue});F.attribName=F.attribValue=""}function we(F,C){if(F.opt.xmlns){var q=F.tag,K=he(F.tagName);q.prefix=K.prefix,q.local=K.local,q.uri=q.ns[K.prefix]||"",q.prefix&&!q.uri&&(Y(F,"Unbound namespace prefix: "+JSON.stringify(F.tagName)),q.uri=K.prefix);var j=F.tags[F.tags.length-1]||F;q.ns&&j.ns!==q.ns&&Object.keys(q.ns).forEach(function(Qe){O(F,"onopennamespace",{prefix:Qe,uri:q.ns[Qe]})});for(var H=0,ge=F.attribList.length;H<ge;H++){var xe=F.attribList[H],De=xe[0],Oe=xe[1],Ce=he(De,!0),Fe=Ce.prefix,ye=Ce.local,We=Fe===""?"":q.ns[Fe]||"",Ge={name:De,value:Oe,prefix:Fe,local:ye,uri:We};Fe&&Fe!=="xmlns"&&!We&&(Y(F,"Unbound namespace prefix: "+JSON.stringify(Fe)),Ge.uri=Fe),F.tag.attributes[De]=Ge,O(F,"onattribute",Ge)}F.attribList.length=0}F.tag.isSelfClosing=!!C,F.sawRoot=!0,F.tags.push(F.tag),O(F,"onopentag",F.tag),C||(!F.noscript&&F.tagName.toLowerCase()==="script"?F.state=A.SCRIPT:F.state=A.TEXT,F.tag=null,F.tagName=""),F.attribName=F.attribValue="",F.attribList.length=0}function Q(F){if(!F.tagName){Y(F,"Weird empty close tag."),F.textNode+="</>",F.state=A.TEXT;return}if(F.script){if(F.tagName!=="script"){F.script+="</"+F.tagName+">",F.tagName="",F.state=A.SCRIPT;return}O(F,"onscript",F.script),F.script=""}var C=F.tags.length,q=F.tagName;F.strict||(q=q[F.looseCase]());for(var K=q;C--;){var j=F.tags[C];if(j.name!==K)Y(F,"Unexpected close tag");else break}if(C<0){Y(F,"Unmatched closing tag: "+F.tagName),F.textNode+="</"+F.tagName+">",F.state=A.TEXT;return}F.tagName=q;for(var H=F.tags.length;H-- >C;){var ge=F.tag=F.tags.pop();F.tagName=F.tag.name,O(F,"onclosetag",F.tagName);var xe={};for(var De in ge.ns)xe[De]=ge.ns[De];var Oe=F.tags[F.tags.length-1]||F;F.opt.xmlns&&ge.ns!==Oe.ns&&Object.keys(ge.ns).forEach(function(Ce){var Fe=ge.ns[Ce];O(F,"onclosenamespace",{prefix:Ce,uri:Fe})})}C===0&&(F.closedRoot=!0),F.tagName=F.attribValue=F.attribName="",F.attribList.length=0,F.state=A.TEXT}function ie(F){var C=F.entity,q=C.toLowerCase(),K,j="";return F.ENTITIES[C]?F.ENTITIES[C]:F.ENTITIES[q]?F.ENTITIES[q]:(C=q,C.charAt(0)==="#"&&(C.charAt(1)==="x"?(C=C.slice(2),K=parseInt(C,16),j=K.toString(16)):(C=C.slice(1),K=parseInt(C,10),j=K.toString(10))),C=C.replace(/^0+/,""),isNaN(K)||j.toLowerCase()!==C?(Y(F,"Invalid character entity"),"&"+F.entity+";"):String.fromCodePoint(K))}function ce(F,C){C==="<"?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):h(C)||(Y(F,"Non-whitespace before first tag."),F.textNode=C,F.state=A.TEXT)}function Ae(F,C){var q="";return C<F.length&&(q=F.charAt(C)),q}function ee(F){var C=this;if(this.error)throw this.error;if(C.closed)return L(C,"Cannot write after close. Assign an onready handler.");if(F===null)return te(C);typeof F=="object"&&(F=F.toString());for(var q=0,K="";K=Ae(F,q++),C.c=K,!!K;)switch(C.trackPosition&&(C.position++,K===`
22
- `?(C.line++,C.column=0):C.column++),C.state){case A.BEGIN:if(C.state=A.BEGIN_WHITESPACE,K==="\uFEFF")continue;ce(C,K);continue;case A.BEGIN_WHITESPACE:ce(C,K);continue;case A.TEXT:if(C.sawRoot&&!C.closedRoot){for(var j=q-1;K&&K!=="<"&&K!=="&";)K=Ae(F,q++),K&&C.trackPosition&&(C.position++,K===`
23
- `?(C.line++,C.column=0):C.column++);C.textNode+=F.substring(j,q-1)}K==="<"&&!(C.sawRoot&&C.closedRoot&&!C.strict)?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):(!h(K)&&(!C.sawRoot||C.closedRoot)&&Y(C,"Text data outside of root node."),K==="&"?C.state=A.TEXT_ENTITY:C.textNode+=K);continue;case A.SCRIPT:K==="<"?C.state=A.SCRIPT_ENDING:C.script+=K;continue;case A.SCRIPT_ENDING:K==="/"?C.state=A.CLOSE_TAG:(C.script+="<"+K,C.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(K==="!")C.state=A.SGML_DECL,C.sgmlDecl="";else if(!h(K))if(R(S,K))C.state=A.OPEN_TAG,C.tagName=K;else if(K==="/")C.state=A.CLOSE_TAG,C.tagName="";else if(K==="?")C.state=A.PROC_INST,C.procInstName=C.procInstBody="";else{if(Y(C,"Unencoded <"),C.startTagPosition+1<C.position){var H=C.position-C.startTagPosition;K=new Array(H).join(" ")+K}C.textNode+="<"+K,C.state=A.TEXT}continue;case A.SGML_DECL:if(C.sgmlDecl+K==="--"){C.state=A.COMMENT,C.comment="",C.sgmlDecl="";continue}C.doctype&&C.doctype!==!0&&C.sgmlDecl?(C.state=A.DOCTYPE_DTD,C.doctype+="<!"+C.sgmlDecl+K,C.sgmlDecl=""):(C.sgmlDecl+K).toUpperCase()===p?(O(C,"onopencdata"),C.state=A.CDATA,C.sgmlDecl="",C.cdata=""):(C.sgmlDecl+K).toUpperCase()===d?(C.state=A.DOCTYPE,(C.doctype||C.sawRoot)&&Y(C,"Inappropriately located doctype declaration"),C.doctype="",C.sgmlDecl=""):K===">"?(O(C,"onsgmldeclaration",C.sgmlDecl),C.sgmlDecl="",C.state=A.TEXT):(E(K)&&(C.state=A.SGML_DECL_QUOTED),C.sgmlDecl+=K);continue;case A.SGML_DECL_QUOTED:K===C.q&&(C.state=A.SGML_DECL,C.q=""),C.sgmlDecl+=K;continue;case A.DOCTYPE:K===">"?(C.state=A.TEXT,O(C,"ondoctype",C.doctype),C.doctype=!0):(C.doctype+=K,K==="["?C.state=A.DOCTYPE_DTD:E(K)&&(C.state=A.DOCTYPE_QUOTED,C.q=K));continue;case A.DOCTYPE_QUOTED:C.doctype+=K,K===C.q&&(C.q="",C.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:K==="]"?(C.doctype+=K,C.state=A.DOCTYPE):K==="<"?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):E(K)?(C.doctype+=K,C.state=A.DOCTYPE_DTD_QUOTED,C.q=K):C.doctype+=K;continue;case A.DOCTYPE_DTD_QUOTED:C.doctype+=K,K===C.q&&(C.state=A.DOCTYPE_DTD,C.q="");continue;case A.COMMENT:K==="-"?C.state=A.COMMENT_ENDING:C.comment+=K;continue;case A.COMMENT_ENDING:K==="-"?(C.state=A.COMMENT_ENDED,C.comment=V(C.opt,C.comment),C.comment&&O(C,"oncomment",C.comment),C.comment=""):(C.comment+="-"+K,C.state=A.COMMENT);continue;case A.COMMENT_ENDED:K!==">"?(Y(C,"Malformed comment"),C.comment+="--"+K,C.state=A.COMMENT):C.doctype&&C.doctype!==!0?C.state=A.DOCTYPE_DTD:C.state=A.TEXT;continue;case A.CDATA:K==="]"?C.state=A.CDATA_ENDING:C.cdata+=K;continue;case A.CDATA_ENDING:K==="]"?C.state=A.CDATA_ENDING_2:(C.cdata+="]"+K,C.state=A.CDATA);continue;case A.CDATA_ENDING_2:K===">"?(C.cdata&&O(C,"oncdata",C.cdata),O(C,"onclosecdata"),C.cdata="",C.state=A.TEXT):K==="]"?C.cdata+="]":(C.cdata+="]]"+K,C.state=A.CDATA);continue;case A.PROC_INST:K==="?"?C.state=A.PROC_INST_ENDING:h(K)?C.state=A.PROC_INST_BODY:C.procInstName+=K;continue;case A.PROC_INST_BODY:if(!C.procInstBody&&h(K))continue;K==="?"?C.state=A.PROC_INST_ENDING:C.procInstBody+=K;continue;case A.PROC_INST_ENDING:K===">"?(O(C,"onprocessinginstruction",{name:C.procInstName,body:C.procInstBody}),C.procInstName=C.procInstBody="",C.state=A.TEXT):(C.procInstBody+="?"+K,C.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:R(y,K)?C.tagName+=K:(se(C),K===">"?we(C):K==="/"?C.state=A.OPEN_TAG_SLASH:(h(K)||Y(C,"Invalid character in tag name"),C.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:K===">"?(we(C,!0),Q(C)):(Y(C,"Forward-slash in opening tag not followed by >"),C.state=A.ATTRIB);continue;case A.ATTRIB:if(h(K))continue;K===">"?we(C):K==="/"?C.state=A.OPEN_TAG_SLASH:R(S,K)?(C.attribName=K,C.attribValue="",C.state=A.ATTRIB_NAME):Y(C,"Invalid attribute name");continue;case A.ATTRIB_NAME:K==="="?C.state=A.ATTRIB_VALUE:K===">"?(Y(C,"Attribute without value"),C.attribValue=C.attribName,ae(C),we(C)):h(K)?C.state=A.ATTRIB_NAME_SAW_WHITE:R(y,K)?C.attribName+=K:Y(C,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(K==="=")C.state=A.ATTRIB_VALUE;else{if(h(K))continue;Y(C,"Attribute without value"),C.tag.attributes[C.attribName]="",C.attribValue="",O(C,"onattribute",{name:C.attribName,value:""}),C.attribName="",K===">"?we(C):R(S,K)?(C.attribName=K,C.state=A.ATTRIB_NAME):(Y(C,"Invalid attribute name"),C.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(h(K))continue;E(K)?(C.q=K,C.state=A.ATTRIB_VALUE_QUOTED):(C.opt.unquotedAttributeValues||L(C,"Unquoted attribute value"),C.state=A.ATTRIB_VALUE_UNQUOTED,C.attribValue=K);continue;case A.ATTRIB_VALUE_QUOTED:if(K!==C.q){K==="&"?C.state=A.ATTRIB_VALUE_ENTITY_Q:C.attribValue+=K;continue}ae(C),C.q="",C.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:h(K)?C.state=A.ATTRIB:K===">"?we(C):K==="/"?C.state=A.OPEN_TAG_SLASH:R(S,K)?(Y(C,"No whitespace between attributes"),C.attribName=K,C.attribValue="",C.state=A.ATTRIB_NAME):Y(C,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!T(K)){K==="&"?C.state=A.ATTRIB_VALUE_ENTITY_U:C.attribValue+=K;continue}ae(C),K===">"?we(C):C.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(C.tagName)K===">"?Q(C):R(y,K)?C.tagName+=K:C.script?(C.script+="</"+C.tagName,C.tagName="",C.state=A.SCRIPT):(h(K)||Y(C,"Invalid tagname in closing tag"),C.state=A.CLOSE_TAG_SAW_WHITE);else{if(h(K))continue;x(S,K)?C.script?(C.script+="</"+K,C.state=A.SCRIPT):Y(C,"Invalid tagname in closing tag."):C.tagName=K}continue;case A.CLOSE_TAG_SAW_WHITE:if(h(K))continue;K===">"?Q(C):Y(C,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ge,xe;switch(C.state){case A.TEXT_ENTITY:ge=A.TEXT,xe="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ge=A.ATTRIB_VALUE_QUOTED,xe="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ge=A.ATTRIB_VALUE_UNQUOTED,xe="attribValue";break}if(K===";"){var De=ie(C);C.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(De)?(C.entity="",C.state=ge,C.write(De)):(C[xe]+=De,C.entity="",C.state=ge)}else R(C.entity.length?v:g,K)?C.entity+=K:(Y(C,"Invalid character in entity name"),C[xe]+="&"+C.entity+K,C.entity="",C.state=ge);continue;default:throw new Error(C,"Unknown state: "+C.state)}return C.position>=C.bufferCheckPosition&&i(C),C}String.fromCodePoint||(function(){var F=String.fromCharCode,C=Math.floor,q=function(){var K=16384,j=[],H,ge,xe=-1,De=arguments.length;if(!De)return"";for(var Oe="";++xe<De;){var Ce=Number(arguments[xe]);if(!isFinite(Ce)||Ce<0||Ce>1114111||C(Ce)!==Ce)throw RangeError("Invalid code point: "+Ce);Ce<=65535?j.push(Ce):(Ce-=65536,H=(Ce>>10)+55296,ge=Ce%1024+56320,j.push(H,ge)),(xe+1===De||j.length>K)&&(Oe+=F.apply(null,j),j.length=0)}return Oe};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:q,configurable:!0,writable:!0}):String.fromCodePoint=q})()})(e)})(Tc)),Tc}var Qu,cy;function Xu(){return cy||(cy=1,Qu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Qu}var Yu,uy;function Ju(){if(uy)return Yu;uy=1;var e=Xu().isArray;return Yu={copyOptions:function(t){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r},ensureFlagExists:function(t,n){(!(t in n)||typeof n[t]!="boolean")&&(n[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||typeof t.spaces!="number"&&typeof t.spaces!="string")&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){(!("alwaysArray"in t)||typeof t.alwaysArray!="boolean"&&!e(t.alwaysArray))&&(t.alwaysArray=!1)},ensureKeyExists:function(t,n){(!(t+"Key"in n)||typeof n[t+"Key"]!="string")&&(n[t+"Key"]=n.compact?"_"+t:t)},checkFnExists:function(t,n){return t+"Fn"in n}},Yu}var Zu,fy;function dy(){if(fy)return Zu;fy=1;var e=HR(),t=Ju(),n=Xu().isArray,r,i;function o(y){return r=t.copyOptions(y),t.ensureFlagExists("ignoreDeclaration",r),t.ensureFlagExists("ignoreInstruction",r),t.ensureFlagExists("ignoreAttributes",r),t.ensureFlagExists("ignoreText",r),t.ensureFlagExists("ignoreComment",r),t.ensureFlagExists("ignoreCdata",r),t.ensureFlagExists("ignoreDoctype",r),t.ensureFlagExists("compact",r),t.ensureFlagExists("alwaysChildren",r),t.ensureFlagExists("addParent",r),t.ensureFlagExists("trim",r),t.ensureFlagExists("nativeType",r),t.ensureFlagExists("nativeTypeAttributes",r),t.ensureFlagExists("sanitize",r),t.ensureFlagExists("instructionHasAttributes",r),t.ensureFlagExists("captureSpacesBetweenElements",r),t.ensureAlwaysArrayExists(r),t.ensureKeyExists("declaration",r),t.ensureKeyExists("instruction",r),t.ensureKeyExists("attributes",r),t.ensureKeyExists("text",r),t.ensureKeyExists("comment",r),t.ensureKeyExists("cdata",r),t.ensureKeyExists("doctype",r),t.ensureKeyExists("type",r),t.ensureKeyExists("name",r),t.ensureKeyExists("elements",r),t.ensureKeyExists("parent",r),t.checkFnExists("doctype",r),t.checkFnExists("instruction",r),t.checkFnExists("cdata",r),t.checkFnExists("comment",r),t.checkFnExists("text",r),t.checkFnExists("instructionName",r),t.checkFnExists("elementName",r),t.checkFnExists("attributeName",r),t.checkFnExists("attributeValue",r),t.checkFnExists("attributes",r),r}function s(y){var g=Number(y);if(!isNaN(g))return g;var v=y.toLowerCase();return v==="true"?!0:v==="false"?!1:y}function a(y,g){var v;if(r.compact){if(!i[r[y+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[y+"Key"])!==-1:r.alwaysArray)&&(i[r[y+"Key"]]=[]),i[r[y+"Key"]]&&!n(i[r[y+"Key"]])&&(i[r[y+"Key"]]=[i[r[y+"Key"]]]),y+"Fn"in r&&typeof g=="string"&&(g=r[y+"Fn"](g,i)),y==="instruction"&&("instructionFn"in r||"instructionNameFn"in r)){for(v in g)if(g.hasOwnProperty(v))if("instructionFn"in r)g[v]=r.instructionFn(g[v],v,i);else{var h=g[v];delete g[v],g[r.instructionNameFn(v,h,i)]=h}}n(i[r[y+"Key"]])?i[r[y+"Key"]].push(g):i[r[y+"Key"]]=g}else{i[r.elementsKey]||(i[r.elementsKey]=[]);var E={};if(E[r.typeKey]=y,y==="instruction"){for(v in g)if(g.hasOwnProperty(v))break;E[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(v,g,i):v,r.instructionHasAttributes?(E[r.attributesKey]=g[v][r.attributesKey],"instructionFn"in r&&(E[r.attributesKey]=r.instructionFn(E[r.attributesKey],v,i))):("instructionFn"in r&&(g[v]=r.instructionFn(g[v],v,i)),E[r.instructionKey]=g[v])}else y+"Fn"in r&&(g=r[y+"Fn"](g,i)),E[r[y+"Key"]]=g;r.addParent&&(E[r.parentKey]=i),i[r.elementsKey].push(E)}}function l(y){if("attributesFn"in r&&y&&(y=r.attributesFn(y,i)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&y){var g;for(g in y)if(y.hasOwnProperty(g)&&(r.trim&&(y[g]=y[g].trim()),r.nativeTypeAttributes&&(y[g]=s(y[g])),"attributeValueFn"in r&&(y[g]=r.attributeValueFn(y[g],g,i)),"attributeNameFn"in r)){var v=y[g];delete y[g],y[r.attributeNameFn(g,y[g],i)]=v}}return y}function u(y){var g={};if(y.body&&(y.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var v=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,h;(h=v.exec(y.body))!==null;)g[h[1]]=h[2]||h[3]||h[4];g=l(g)}if(y.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;i[r.declarationKey]={},Object.keys(g).length&&(i[r.declarationKey][r.attributesKey]=g),r.addParent&&(i[r.declarationKey][r.parentKey]=i)}else{if(r.ignoreInstruction)return;r.trim&&(y.body=y.body.trim());var E={};r.instructionHasAttributes&&Object.keys(g).length?(E[y.name]={},E[y.name][r.attributesKey]=g):E[y.name]=y.body,a("instruction",E)}}function c(y,g){var v;if(typeof y=="object"&&(g=y.attributes,y=y.name),g=l(g),"elementNameFn"in r&&(y=r.elementNameFn(y,i)),r.compact){if(v={},!r.ignoreAttributes&&g&&Object.keys(g).length){v[r.attributesKey]={};var h;for(h in g)g.hasOwnProperty(h)&&(v[r.attributesKey][h]=g[h])}!(y in i)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(y)!==-1:r.alwaysArray)&&(i[y]=[]),i[y]&&!n(i[y])&&(i[y]=[i[y]]),n(i[y])?i[y].push(v):i[y]=v}else i[r.elementsKey]||(i[r.elementsKey]=[]),v={},v[r.typeKey]="element",v[r.nameKey]=y,!r.ignoreAttributes&&g&&Object.keys(g).length&&(v[r.attributesKey]=g),r.alwaysChildren&&(v[r.elementsKey]=[]),i[r.elementsKey].push(v);v[r.parentKey]=i,i=v}function p(y){r.ignoreText||!y.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(y=y.trim()),r.nativeType&&(y=s(y)),r.sanitize&&(y=y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",y))}function d(y){r.ignoreComment||(r.trim&&(y=y.trim()),a("comment",y))}function m(y){var g=i[r.parentKey];r.addParent||delete i[r.parentKey],i=g}function b(y){r.ignoreCdata||(r.trim&&(y=y.trim()),a("cdata",y))}function w(y){r.ignoreDoctype||(y=y.replace(/^ /,""),r.trim&&(y=y.trim()),a("doctype",y))}function S(y){y.note=y}return Zu=function(y,g){var v=e.parser(!0,{}),h={};if(i=h,r=o(g),v.opt={strictEntities:!0},v.onopentag=c,v.ontext=p,v.oncomment=d,v.onclosetag=m,v.onerror=S,v.oncdata=b,v.ondoctype=w,v.onprocessinginstruction=u,v.write(y).close(),h[r.elementsKey]){var E=h[r.elementsKey];delete h[r.elementsKey],h[r.elementsKey]=E,delete h.text}return h},Zu}var ef,py;function KR(){if(py)return ef;py=1;var e=Ju(),t=dy();function n(r){var i=e.copyOptions(r);return e.ensureSpacesExists(i),i}return ef=function(r,i){var o,s,a,l;return o=n(i),s=t(r,o),l="compact"in o&&o.compact?"_parent":"parent","addParent"in o&&o.addParent?a=JSON.stringify(s,function(u,c){return u===l?"_":c},o.spaces):a=JSON.stringify(s,null,o.spaces),a.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},ef}var tf,hy;function my(){if(hy)return tf;hy=1;var e=Ju(),t=Xu().isArray,n,r;function i(v){var h=e.copyOptions(v);return e.ensureFlagExists("ignoreDeclaration",h),e.ensureFlagExists("ignoreInstruction",h),e.ensureFlagExists("ignoreAttributes",h),e.ensureFlagExists("ignoreText",h),e.ensureFlagExists("ignoreComment",h),e.ensureFlagExists("ignoreCdata",h),e.ensureFlagExists("ignoreDoctype",h),e.ensureFlagExists("compact",h),e.ensureFlagExists("indentText",h),e.ensureFlagExists("indentCdata",h),e.ensureFlagExists("indentAttributes",h),e.ensureFlagExists("indentInstruction",h),e.ensureFlagExists("fullTagEmptyElement",h),e.ensureFlagExists("noQuotesForNativeAttributes",h),e.ensureSpacesExists(h),typeof h.spaces=="number"&&(h.spaces=Array(h.spaces+1).join(" ")),e.ensureKeyExists("declaration",h),e.ensureKeyExists("instruction",h),e.ensureKeyExists("attributes",h),e.ensureKeyExists("text",h),e.ensureKeyExists("comment",h),e.ensureKeyExists("cdata",h),e.ensureKeyExists("doctype",h),e.ensureKeyExists("type",h),e.ensureKeyExists("name",h),e.ensureKeyExists("elements",h),e.checkFnExists("doctype",h),e.checkFnExists("instruction",h),e.checkFnExists("cdata",h),e.checkFnExists("comment",h),e.checkFnExists("text",h),e.checkFnExists("instructionName",h),e.checkFnExists("elementName",h),e.checkFnExists("attributeName",h),e.checkFnExists("attributeValue",h),e.checkFnExists("attributes",h),e.checkFnExists("fullTagEmptyElement",h),h}function o(v,h,E){return(!E&&v.spaces?`
24
- `:"")+Array(h+1).join(v.spaces)}function s(v,h,E){if(h.ignoreAttributes)return"";"attributesFn"in h&&(v=h.attributesFn(v,r,n));var T,R,x,A,N=[];for(T in v)v.hasOwnProperty(T)&&v[T]!==null&&v[T]!==void 0&&(A=h.noQuotesForNativeAttributes&&typeof v[T]!="string"?"":'"',R=""+v[T],R=R.replace(/"/g,"&quot;"),x="attributeNameFn"in h?h.attributeNameFn(T,R,r,n):T,N.push(h.spaces&&h.indentAttributes?o(h,E+1,!1):" "),N.push(x+"="+A+("attributeValueFn"in h?h.attributeValueFn(R,T,r,n):R)+A));return v&&Object.keys(v).length&&h.spaces&&h.indentAttributes&&N.push(o(h,E,!1)),N.join("")}function a(v,h,E){return n=v,r="xml",h.ignoreDeclaration?"":"<?xml"+s(v[h.attributesKey],h,E)+"?>"}function l(v,h,E){if(h.ignoreInstruction)return"";var T;for(T in v)if(v.hasOwnProperty(T))break;var R="instructionNameFn"in h?h.instructionNameFn(T,v[T],r,n):T;if(typeof v[T]=="object")return n=v,r=R,"<?"+R+s(v[T][h.attributesKey],h,E)+"?>";var x=v[T]?v[T]:"";return"instructionFn"in h&&(x=h.instructionFn(x,T,r,n)),"<?"+R+(x?" "+x:"")+"?>"}function u(v,h){return h.ignoreComment?"":"<!--"+("commentFn"in h?h.commentFn(v,r,n):v)+"-->"}function c(v,h){return h.ignoreCdata?"":"<![CDATA["+("cdataFn"in h?h.cdataFn(v,r,n):v.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function p(v,h){return h.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in h?h.doctypeFn(v,r,n):v)+">"}function d(v,h){return h.ignoreText?"":(v=""+v,v=v.replace(/&amp;/g,"&"),v=v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in h?h.textFn(v,r,n):v)}function m(v,h){var E;if(v.elements&&v.elements.length)for(E=0;E<v.elements.length;++E)switch(v.elements[E][h.typeKey]){case"text":if(h.indentText)return!0;break;case"cdata":if(h.indentCdata)return!0;break;case"instruction":if(h.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function b(v,h,E){n=v,r=v.name;var T=[],R="elementNameFn"in h?h.elementNameFn(v.name,v):v.name;T.push("<"+R),v[h.attributesKey]&&T.push(s(v[h.attributesKey],h,E));var x=v[h.elementsKey]&&v[h.elementsKey].length||v[h.attributesKey]&&v[h.attributesKey]["xml:space"]==="preserve";return x||("fullTagEmptyElementFn"in h?x=h.fullTagEmptyElementFn(v.name,v):x=h.fullTagEmptyElement),x?(T.push(">"),v[h.elementsKey]&&v[h.elementsKey].length&&(T.push(w(v[h.elementsKey],h,E+1)),n=v,r=v.name),T.push(h.spaces&&m(v,h)?`
25
- `+Array(E+1).join(h.spaces):""),T.push("</"+R+">")):T.push("/>"),T.join("")}function w(v,h,E,T){return v.reduce(function(R,x){var A=o(h,E,T&&!R);switch(x.type){case"element":return R+A+b(x,h,E);case"comment":return R+A+u(x[h.commentKey],h);case"doctype":return R+A+p(x[h.doctypeKey],h);case"cdata":return R+(h.indentCdata?A:"")+c(x[h.cdataKey],h);case"text":return R+(h.indentText?A:"")+d(x[h.textKey],h);case"instruction":var N={};return N[x[h.nameKey]]=x[h.attributesKey]?x:x[h.instructionKey],R+(h.indentInstruction?A:"")+l(N,h,E)}},"")}function S(v,h,E){var T;for(T in v)if(v.hasOwnProperty(T))switch(T){case h.parentKey:case h.attributesKey:break;case h.textKey:if(h.indentText||E)return!0;break;case h.cdataKey:if(h.indentCdata||E)return!0;break;case h.instructionKey:if(h.indentInstruction||E)return!0;break;case h.doctypeKey:case h.commentKey:return!0;default:return!0}return!1}function y(v,h,E,T,R){n=v,r=h;var x="elementNameFn"in E?E.elementNameFn(h,v):h;if(typeof v>"u"||v===null||v==="")return"fullTagEmptyElementFn"in E&&E.fullTagEmptyElementFn(h,v)||E.fullTagEmptyElement?"<"+x+"></"+x+">":"<"+x+"/>";var A=[];if(h){if(A.push("<"+x),typeof v!="object")return A.push(">"+d(v,E)+"</"+x+">"),A.join("");v[E.attributesKey]&&A.push(s(v[E.attributesKey],E,T));var N=S(v,E,!0)||v[E.attributesKey]&&v[E.attributesKey]["xml:space"]==="preserve";if(N||("fullTagEmptyElementFn"in E?N=E.fullTagEmptyElementFn(h,v):N=E.fullTagEmptyElement),N)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(v,E,T+1,!1)),n=v,r=h,h&&A.push((R?o(E,T,!1):"")+"</"+x+">"),A.join("")}function g(v,h,E,T){var R,x,A,N=[];for(x in v)if(v.hasOwnProperty(x))for(A=t(v[x])?v[x]:[v[x]],R=0;R<A.length;++R){switch(x){case h.declarationKey:N.push(a(A[R],h,E));break;case h.instructionKey:N.push((h.indentInstruction?o(h,E,T):"")+l(A[R],h,E));break;case h.attributesKey:case h.parentKey:break;case h.textKey:N.push((h.indentText?o(h,E,T):"")+d(A[R],h));break;case h.cdataKey:N.push((h.indentCdata?o(h,E,T):"")+c(A[R],h));break;case h.doctypeKey:N.push(o(h,E,T)+p(A[R],h));break;case h.commentKey:N.push(o(h,E,T)+u(A[R],h));break;default:N.push(o(h,E,T)+y(A[R],x,h,E,S(A[R],h)))}T=T&&!N.length}return N.join("")}return tf=function(v,h){h=i(h);var E=[];return n=v,r="_root_",h.compact?E.push(g(v,h,0,!0)):(v[h.declarationKey]&&E.push(a(v[h.declarationKey],h,0)),v[h.elementsKey]&&v[h.elementsKey].length&&E.push(w(v[h.elementsKey],h,0,!E.length))),E.join("")},tf}var nf,gy;function GR(){if(gy)return nf;gy=1;var e=my();return nf=function(t,n){t instanceof Kr&&(t=t.toString());var r=null;if(typeof t=="string")try{r=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else r=t;return e(r,n)},nf}var rf,yy;function QR(){if(yy)return rf;yy=1;var e=dy(),t=KR(),n=my(),r=GR();return rf={xml2js:e,xml2json:t,js2xml:n,json2xml:r},rf}QR();var XR={2:e=>{function t(i,o,s){i instanceof RegExp&&(i=n(i,s)),o instanceof RegExp&&(o=n(o,s));var a=r(i,o,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+i.length,a[1]),post:s.slice(a[1]+o.length)}}function n(i,o){var s=o.match(i);return s?s[0]:null}function r(i,o,s){var a,l,u,c,p,d=s.indexOf(i),m=s.indexOf(o,d+1),b=d;if(d>=0&&m>0){for(a=[],u=s.length;b>=0&&!p;)b==d?(a.push(b),d=s.indexOf(i,b+1)):a.length==1?p=[a.pop(),m]:((l=a.pop())<u&&(u=l,c=m),m=s.indexOf(o,b+1)),b=d<m&&d>=0?d:m;a.length&&(p=[u,c])}return p}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),(function(i){var o=(e&&e.exports,typeof Wr=="object"&&Wr);o.global!==o&&o.window;var s=function(p){this.message=p};(s.prototype=new Error).name="InvalidCharacterError";var a=function(p){throw new s(p)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,c={encode:function(p){p=String(p),/[^\0-\xFF]/.test(p)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var d,m,b,w,S=p.length%3,y="",g=-1,v=p.length-S;++g<v;)d=p.charCodeAt(g)<<16,m=p.charCodeAt(++g)<<8,b=p.charCodeAt(++g),y+=l.charAt((w=d+m+b)>>18&63)+l.charAt(w>>12&63)+l.charAt(w>>6&63)+l.charAt(63&w);return S==2?(d=p.charCodeAt(g)<<8,m=p.charCodeAt(++g),y+=l.charAt((w=d+m)>>10)+l.charAt(w>>4&63)+l.charAt(w<<2&63)+"="):S==1&&(w=p.charCodeAt(g),y+=l.charAt(w>>2)+l.charAt(w<<4&63)+"=="),y},decode:function(p){var d=(p=String(p).replace(u,"")).length;d%4==0&&(d=(p=p.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(p))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,b,w=0,S="",y=-1;++y<d;)b=l.indexOf(p.charAt(y)),m=w%4?64*m+b:b,w++%4&&(S+=String.fromCharCode(255&m>>(-2*w&6)));return S},version:"1.0.0"};(r=(function(){return c}).call(t,n,t,e))===void 0||(e.exports=r)})()},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,i=n.length;i--;){var o=n.charCodeAt(i);56320<=o&&o<=57343&&i--,127<o&&o<=2047?r++:2047<o&&o<=65535&&(r+=2)}return r}},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],i=0;i<n.length;i++)r.push(255&n.charCodeAt(i));return r},bytesToString:function(n){for(var r=[],i=0;i<n.length;i++)r.push(String.fromCharCode(n[i]));return r.join("")}}};e.exports=t},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,i){return r<<i|r>>>32-i},rotr:function(r,i){return r<<32-i|r>>>i},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var i=0;i<r.length;i++)r[i]=n.endian(r[i]);return r},randomBytes:function(r){for(var i=[];r>0;r--)i.push(Math.floor(256*Math.random()));return i},bytesToWords:function(r){for(var i=[],o=0,s=0;o<r.length;o++,s+=8)i[s>>>5]|=r[o]<<24-s%32;return i},wordsToBytes:function(r){for(var i=[],o=0;o<32*r.length;o+=8)i.push(r[o>>>5]>>>24-o%32&255);return i},bytesToHex:function(r){for(var i=[],o=0;o<r.length;o++)i.push((r[o]>>>4).toString(16)),i.push((15&r[o]).toString(16));return i.join("")},hexToBytes:function(r){for(var i=[],o=0;o<r.length;o+=2)i.push(parseInt(r.substr(o,2),16));return i},bytesToBase64:function(r){for(var i=[],o=0;o<r.length;o+=3)for(var s=r[o]<<16|r[o+1]<<8|r[o+2],a=0;a<4;a++)8*o+6*a<=8*r.length?i.push(t.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],o=0,s=0;o<r.length;s=++o%4)s!=0&&i.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(r.charAt(o))>>>6-2*s);return i}},e.exports=n},635:(e,t,n)=>{const r=n(31),i=n(338),o=n(221);e.exports={XMLParser:i,XMLValidator:r,XMLBuilder:o}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}},705:(e,t)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");t.isExist=function(o){return o!==void 0},t.isEmptyObject=function(o){return Object.keys(o).length===0},t.merge=function(o,s,a){if(s){const l=Object.keys(s),u=l.length;for(let c=0;c<u;c++)o[l[c]]=a==="strict"?[s[l[c]]]:s[l[c]]}},t.getValue=function(o){return t.isExist(o)?o:""},t.isName=function(o){return i.exec(o)!=null},t.getAllMatches=function(o,s){const a=[];let l=s.exec(o);for(;l;){const u=[];u.startIndex=s.lastIndex-l[0].length;const c=l.length;for(let p=0;p<c;p++)u.push(l[p]);a.push(u),l=s.exec(o)}return a},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),i={allowBooleanAttributes:!1,unpairedTags:[]};function o(g){return g===" "||g===" "||g===`
26
- `||g==="\r"}function s(g,v){const h=v;for(;v<g.length;v++)if(!(g[v]!="?"&&g[v]!=" ")){const E=g.substr(h,v-h);if(v>5&&E==="xml")return b("InvalidXml","XML declaration allowed only at the start of the document.",S(g,v));if(g[v]=="?"&&g[v+1]==">"){v++;break}}return v}function a(g,v){if(g.length>v+5&&g[v+1]==="-"&&g[v+2]==="-"){for(v+=3;v<g.length;v++)if(g[v]==="-"&&g[v+1]==="-"&&g[v+2]===">"){v+=2;break}}else if(g.length>v+8&&g[v+1]==="D"&&g[v+2]==="O"&&g[v+3]==="C"&&g[v+4]==="T"&&g[v+5]==="Y"&&g[v+6]==="P"&&g[v+7]==="E"){let h=1;for(v+=8;v<g.length;v++)if(g[v]==="<")h++;else if(g[v]===">"&&(h--,h===0))break}else if(g.length>v+9&&g[v+1]==="["&&g[v+2]==="C"&&g[v+3]==="D"&&g[v+4]==="A"&&g[v+5]==="T"&&g[v+6]==="A"&&g[v+7]==="["){for(v+=8;v<g.length;v++)if(g[v]==="]"&&g[v+1]==="]"&&g[v+2]===">"){v+=2;break}}return v}t.validate=function(g,v){v=Object.assign({},i,v);const h=[];let E=!1,T=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let x=0;x<g.length;x++)if(g[x]==="<"&&g[x+1]==="?"){if(x+=2,x=s(g,x),x.err)return x}else{if(g[x]!=="<"){if(o(g[x]))continue;return b("InvalidChar","char '"+g[x]+"' is not expected.",S(g,x))}{let A=x;if(x++,g[x]==="!"){x=a(g,x);continue}{let N=!1;g[x]==="/"&&(N=!0,x++);let W="";for(;x<g.length&&g[x]!==">"&&g[x]!==" "&&g[x]!==" "&&g[x]!==`
27
- `&&g[x]!=="\r";x++)W+=g[x];if(W=W.trim(),W[W.length-1]==="/"&&(W=W.substring(0,W.length-1),x--),R=W,!r.isName(R)){let V;return V=W.trim().length===0?"Invalid space after '<'.":"Tag '"+W+"' is an invalid name.",b("InvalidTag",V,S(g,x))}const O=c(g,x);if(O===!1)return b("InvalidAttr","Attributes for '"+W+"' have open quote.",S(g,x));let D=O.value;if(x=O.index,D[D.length-1]==="/"){const V=x-D.length;D=D.substring(0,D.length-1);const L=d(D,v);if(L!==!0)return b(L.err.code,L.err.msg,S(g,V+L.err.line));E=!0}else if(N){if(!O.tagClosed)return b("InvalidTag","Closing tag '"+W+"' doesn't have proper closing.",S(g,x));if(D.trim().length>0)return b("InvalidTag","Closing tag '"+W+"' can't have attributes or invalid starting.",S(g,A));if(h.length===0)return b("InvalidTag","Closing tag '"+W+"' has not been opened.",S(g,A));{const V=h.pop();if(W!==V.tagName){let L=S(g,V.tagStartPos);return b("InvalidTag","Expected closing tag '"+V.tagName+"' (opened in line "+L.line+", col "+L.col+") instead of closing tag '"+W+"'.",S(g,A))}h.length==0&&(T=!0)}}else{const V=d(D,v);if(V!==!0)return b(V.err.code,V.err.msg,S(g,x-D.length+V.err.line));if(T===!0)return b("InvalidXml","Multiple possible root nodes found.",S(g,x));v.unpairedTags.indexOf(W)!==-1||h.push({tagName:W,tagStartPos:A}),E=!0}for(x++;x<g.length;x++)if(g[x]==="<"){if(g[x+1]==="!"){x++,x=a(g,x);continue}if(g[x+1]!=="?")break;if(x=s(g,++x),x.err)return x}else if(g[x]==="&"){const V=m(g,x);if(V==-1)return b("InvalidChar","char '&' is not expected.",S(g,x));x=V}else if(T===!0&&!o(g[x]))return b("InvalidXml","Extra text at the end",S(g,x));g[x]==="<"&&x--}}}var R;return E?h.length==1?b("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",S(g,h[0].tagStartPos)):!(h.length>0)||b("InvalidXml","Invalid '"+JSON.stringify(h.map((x=>x.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):b("InvalidXml","Start tag expected.",1)};const l='"',u="'";function c(g,v){let h="",E="",T=!1;for(;v<g.length;v++){if(g[v]===l||g[v]===u)E===""?E=g[v]:E!==g[v]||(E="");else if(g[v]===">"&&E===""){T=!0;break}h+=g[v]}return E===""&&{value:h,index:v,tagClosed:T}}const p=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(g,v){const h=r.getAllMatches(g,p),E={};for(let T=0;T<h.length;T++){if(h[T][1].length===0)return b("InvalidAttr","Attribute '"+h[T][2]+"' has no space in starting.",y(h[T]));if(h[T][3]!==void 0&&h[T][4]===void 0)return b("InvalidAttr","Attribute '"+h[T][2]+"' is without value.",y(h[T]));if(h[T][3]===void 0&&!v.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+h[T][2]+"' is not allowed.",y(h[T]));const R=h[T][2];if(!w(R))return b("InvalidAttr","Attribute '"+R+"' is an invalid name.",y(h[T]));if(E.hasOwnProperty(R))return b("InvalidAttr","Attribute '"+R+"' is repeated.",y(h[T]));E[R]=1}return!0}function m(g,v){if(g[++v]===";")return-1;if(g[v]==="#")return(function(E,T){let R=/\d/;for(E[T]==="x"&&(T++,R=/[\da-fA-F]/);T<E.length;T++){if(E[T]===";")return T;if(!E[T].match(R))break}return-1})(g,++v);let h=0;for(;v<g.length;v++,h++)if(!(g[v].match(/\w/)&&h<20)){if(g[v]===";")break;return-1}return v}function b(g,v,h){return{err:{code:g,msg:v,line:h.line||h,col:h.col}}}function w(g){return r.isName(g)}function S(g,v){const h=g.substring(0,v).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function y(g){return g.startIndex+g[1].length}},221:(e,t,n)=>{const r=n(87),i=n(118),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(c,p){return p},attributeValueProcessor:function(c,p){return p},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(c){this.options=Object.assign({},o,c),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=l,this.tagEndChar=`>
28
- `,this.newLine=`
29
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(c,p,d,m){const b=this.j2x(c,d+1,m.concat(p));return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],p,b.attrStr,d):this.buildObjectNode(b.val,p,b.attrStr,d)}function l(c){return this.options.indentBy.repeat(c)}function u(c){return!(!c.startsWith(this.options.attributeNamePrefix)||c===this.options.textNodeName)&&c.substr(this.attrPrefixLen)}s.prototype.build=function(c){return this.options.preserveOrder?r(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0,[]).val)},s.prototype.j2x=function(c,p,d){let m="",b="";const w=d.join(".");for(let S in c)if(Object.prototype.hasOwnProperty.call(c,S))if(c[S]===void 0)this.isAttribute(S)&&(b+="");else if(c[S]===null)this.isAttribute(S)?b+="":S[0]==="?"?b+=this.indentate(p)+"<"+S+"?"+this.tagEndChar:b+=this.indentate(p)+"<"+S+"/"+this.tagEndChar;else if(c[S]instanceof Date)b+=this.buildTextValNode(c[S],S,"",p);else if(typeof c[S]!="object"){const y=this.isAttribute(S);if(y&&!this.ignoreAttributesFn(y,w))m+=this.buildAttrPairStr(y,""+c[S]);else if(!y)if(S===this.options.textNodeName){let g=this.options.tagValueProcessor(S,""+c[S]);b+=this.replaceEntitiesValue(g)}else b+=this.buildTextValNode(c[S],S,"",p)}else if(Array.isArray(c[S])){const y=c[S].length;let g="",v="";for(let h=0;h<y;h++){const E=c[S][h];if(E!==void 0)if(E===null)S[0]==="?"?b+=this.indentate(p)+"<"+S+"?"+this.tagEndChar:b+=this.indentate(p)+"<"+S+"/"+this.tagEndChar;else if(typeof E=="object")if(this.options.oneListGroup){const T=this.j2x(E,p+1,d.concat(S));g+=T.val,this.options.attributesGroupName&&E.hasOwnProperty(this.options.attributesGroupName)&&(v+=T.attrStr)}else g+=this.processTextOrObjNode(E,S,p,d);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(S,E);T=this.replaceEntitiesValue(T),g+=T}else g+=this.buildTextValNode(E,S,"",p)}this.options.oneListGroup&&(g=this.buildObjectNode(g,S,v,p)),b+=g}else if(this.options.attributesGroupName&&S===this.options.attributesGroupName){const y=Object.keys(c[S]),g=y.length;for(let v=0;v<g;v++)m+=this.buildAttrPairStr(y[v],""+c[S][y[v]])}else b+=this.processTextOrObjNode(c[S],S,p,d);return{attrStr:m,val:b}},s.prototype.buildAttrPairStr=function(c,p){return p=this.options.attributeValueProcessor(c,""+p),p=this.replaceEntitiesValue(p),this.options.suppressBooleanAttributes&&p==="true"?" "+c:" "+c+'="'+p+'"'},s.prototype.buildObjectNode=function(c,p,d,m){if(c==="")return p[0]==="?"?this.indentate(m)+"<"+p+d+"?"+this.tagEndChar:this.indentate(m)+"<"+p+d+this.closeTag(p)+this.tagEndChar;{let b="</"+p+this.tagEndChar,w="";return p[0]==="?"&&(w="?",b=""),!d&&d!==""||c.indexOf("<")!==-1?this.options.commentPropName!==!1&&p===this.options.commentPropName&&w.length===0?this.indentate(m)+`<!--${c}-->`+this.newLine:this.indentate(m)+"<"+p+d+w+this.tagEndChar+c+this.indentate(m)+b:this.indentate(m)+"<"+p+d+w+">"+c+b}},s.prototype.closeTag=function(c){let p="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(p="/"):p=this.options.suppressEmptyNode?"/":`></${c}`,p},s.prototype.buildTextValNode=function(c,p,d,m){if(this.options.cdataPropName!==!1&&p===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&p===this.options.commentPropName)return this.indentate(m)+`<!--${c}-->`+this.newLine;if(p[0]==="?")return this.indentate(m)+"<"+p+d+"?"+this.tagEndChar;{let b=this.options.tagValueProcessor(p,c);return b=this.replaceEntitiesValue(b),b===""?this.indentate(m)+"<"+p+d+this.closeTag(p)+this.tagEndChar:this.indentate(m)+"<"+p+d+">"+b+"</"+p+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let p=0;p<this.options.entities.length;p++){const d=this.options.entities[p];c=c.replace(d.regex,d.val)}return c},e.exports=s},87:e=>{function t(s,a,l,u){let c="",p=!1;for(let d=0;d<s.length;d++){const m=s[d],b=n(m);if(b===void 0)continue;let w="";if(w=l.length===0?b:`${l}.${b}`,b===a.textNodeName){let v=m[b];i(w,a)||(v=a.tagValueProcessor(b,v),v=o(v,a)),p&&(c+=u),c+=v,p=!1;continue}if(b===a.cdataPropName){p&&(c+=u),c+=`<![CDATA[${m[b][0][a.textNodeName]}]]>`,p=!1;continue}if(b===a.commentPropName){c+=u+`<!--${m[b][0][a.textNodeName]}-->`,p=!0;continue}if(b[0]==="?"){const v=r(m[":@"],a),h=b==="?xml"?"":u;let E=m[b][0][a.textNodeName];E=E.length!==0?" "+E:"",c+=h+`<${b}${E}${v}?>`,p=!0;continue}let S=u;S!==""&&(S+=a.indentBy);const y=u+`<${b}${r(m[":@"],a)}`,g=t(m[b],a,w,S);a.unpairedTags.indexOf(b)!==-1?a.suppressUnpairedNode?c+=y+">":c+=y+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?c+=y+`>${g}${u}</${b}>`:(c+=y+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?c+=u+a.indentBy+g+u:c+=g,c+=`</${b}>`):c+=y+"/>",p=!0}return c}function n(s){const a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l];if(s.hasOwnProperty(u)&&u!==":@")return u}}function r(s,a){let l="";if(s&&!a.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let c=a.attributeValueProcessor(u,s[u]);c=o(c,a),c===!0&&a.suppressBooleanAttributes?l+=` ${u.substr(a.attributeNamePrefix.length)}`:l+=` ${u.substr(a.attributeNamePrefix.length)}="${c}"`}return l}function i(s,a){let l=(s=s.substr(0,s.length-a.textNodeName.length-1)).substr(s.lastIndexOf(".")+1);for(let u in a.stopNodes)if(a.stopNodes[u]===s||a.stopNodes[u]==="*."+l)return!0;return!1}function o(s,a){if(s&&s.length>0&&a.processEntities)for(let l=0;l<a.entities.length;l++){const u=a.entities[l];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,a){let l="";return a.format&&a.indentBy.length>0&&(l=`
30
- `),t(s,a,"",l)}},193:(e,t,n)=>{const r=n(705);function i(p,d){let m="";for(;d<p.length&&p[d]!=="'"&&p[d]!=='"';d++)m+=p[d];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const b=p[d++];let w="";for(;d<p.length&&p[d]!==b;d++)w+=p[d];return[m,w,d]}function o(p,d){return p[d+1]==="!"&&p[d+2]==="-"&&p[d+3]==="-"}function s(p,d){return p[d+1]==="!"&&p[d+2]==="E"&&p[d+3]==="N"&&p[d+4]==="T"&&p[d+5]==="I"&&p[d+6]==="T"&&p[d+7]==="Y"}function a(p,d){return p[d+1]==="!"&&p[d+2]==="E"&&p[d+3]==="L"&&p[d+4]==="E"&&p[d+5]==="M"&&p[d+6]==="E"&&p[d+7]==="N"&&p[d+8]==="T"}function l(p,d){return p[d+1]==="!"&&p[d+2]==="A"&&p[d+3]==="T"&&p[d+4]==="T"&&p[d+5]==="L"&&p[d+6]==="I"&&p[d+7]==="S"&&p[d+8]==="T"}function u(p,d){return p[d+1]==="!"&&p[d+2]==="N"&&p[d+3]==="O"&&p[d+4]==="T"&&p[d+5]==="A"&&p[d+6]==="T"&&p[d+7]==="I"&&p[d+8]==="O"&&p[d+9]==="N"}function c(p){if(r.isName(p))return p;throw new Error(`Invalid entity name ${p}`)}e.exports=function(p,d){const m={};if(p[d+3]!=="O"||p[d+4]!=="C"||p[d+5]!=="T"||p[d+6]!=="Y"||p[d+7]!=="P"||p[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let b=1,w=!1,S=!1,y="";for(;d<p.length;d++)if(p[d]!=="<"||S)if(p[d]===">"){if(S?p[d-1]==="-"&&p[d-2]==="-"&&(S=!1,b--):b--,b===0)break}else p[d]==="["?w=!0:y+=p[d];else{if(w&&s(p,d)){let g,v;d+=7,[g,v,d]=i(p,d+1),v.indexOf("&")===-1&&(m[c(g)]={regx:RegExp(`&${g};`,"g"),val:v})}else if(w&&a(p,d))d+=8;else if(w&&l(p,d))d+=8;else if(w&&u(p,d))d+=9;else{if(!o)throw new Error("Invalid DOCTYPE");S=!0}b++,y=""}if(b!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:d}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,i){return i},attributeValueProcessor:function(r,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,i,o){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),i=n(365),o=n(193),s=n(494),a=n(118);function l(T){const R=Object.keys(T);for(let x=0;x<R.length;x++){const A=R[x];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:T[A]}}}function u(T,R,x,A,N,W,O){if(T!==void 0&&(this.options.trimValues&&!A&&(T=T.trim()),T.length>0)){O||(T=this.replaceEntitiesValue(T));const D=this.options.tagValueProcessor(R,T,x,N,W);return D==null?T:typeof D!=typeof T||D!==T?D:this.options.trimValues||T.trim()===T?E(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function c(T){if(this.options.removeNSPrefix){const R=T.split(":"),x=T.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(T=x+R[1])}return T}const p=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(T,R,x){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const A=r.getAllMatches(T,p),N=A.length,W={};for(let O=0;O<N;O++){const D=this.resolveNameSpace(A[O][1]);if(this.ignoreAttributesFn(D,R))continue;let V=A[O][4],L=this.options.attributeNamePrefix+D;if(D.length)if(this.options.transformAttributeName&&(L=this.options.transformAttributeName(L)),L==="__proto__"&&(L="#__proto__"),V!==void 0){this.options.trimValues&&(V=V.trim()),V=this.replaceEntitiesValue(V);const te=this.options.attributeValueProcessor(D,V,R);W[L]=te==null?V:typeof te!=typeof V||te!==V?te:E(V,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(W[L]=!0)}if(!Object.keys(W).length)return;if(this.options.attributesGroupName){const O={};return O[this.options.attributesGroupName]=W,O}return W}}const m=function(T){T=T.replace(/\r\n?/g,`
31
- `);const R=new i("!xml");let x=R,A="",N="";for(let W=0;W<T.length;W++)if(T[W]==="<")if(T[W+1]==="/"){const O=g(T,">",W,"Closing Tag is not closed.");let D=T.substring(W+2,O).trim();if(this.options.removeNSPrefix){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),x&&(A=this.saveTextToParentTag(A,x,N));const V=N.substring(N.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let L=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(L=N.lastIndexOf(".",N.lastIndexOf(".")-1),this.tagsNodeStack.pop()):L=N.lastIndexOf("."),N=N.substring(0,L),x=this.tagsNodeStack.pop(),A="",W=O}else if(T[W+1]==="?"){let O=v(T,W,!1,"?>");if(!O)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,x,N),!(this.options.ignoreDeclaration&&O.tagName==="?xml"||this.options.ignorePiTags)){const D=new i(O.tagName);D.add(this.options.textNodeName,""),O.tagName!==O.tagExp&&O.attrExpPresent&&(D[":@"]=this.buildAttributesMap(O.tagExp,N,O.tagName)),this.addChild(x,D,N)}W=O.closeIndex+1}else if(T.substr(W+1,3)==="!--"){const O=g(T,"-->",W+4,"Comment is not closed.");if(this.options.commentPropName){const D=T.substring(W+4,O-2);A=this.saveTextToParentTag(A,x,N),x.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}W=O}else if(T.substr(W+1,2)==="!D"){const O=o(T,W);this.docTypeEntities=O.entities,W=O.i}else if(T.substr(W+1,2)==="!["){const O=g(T,"]]>",W,"CDATA is not closed.")-2,D=T.substring(W+9,O);A=this.saveTextToParentTag(A,x,N);let V=this.parseTextData(D,x.tagname,N,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?x.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):x.add(this.options.textNodeName,V),W=O+2}else{let O=v(T,W,this.options.removeNSPrefix),D=O.tagName;const V=O.rawTagName;let L=O.tagExp,te=O.attrExpPresent,Y=O.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),x&&A&&x.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,x,N,!1));const se=x;if(se&&this.options.unpairedTags.indexOf(se.tagname)!==-1&&(x=this.tagsNodeStack.pop(),N=N.substring(0,N.lastIndexOf("."))),D!==R.tagname&&(N+=N?"."+D:D),this.isItStopNode(this.options.stopNodes,N,D)){let he="";if(L.length>0&&L.lastIndexOf("/")===L.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),N=N.substr(0,N.length-1),L=D):L=L.substr(0,L.length-1),W=O.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)W=O.closeIndex;else{const we=this.readStopNodeData(T,V,Y+1);if(!we)throw new Error(`Unexpected end of ${V}`);W=we.i,he=we.tagContent}const ae=new i(D);D!==L&&te&&(ae[":@"]=this.buildAttributesMap(L,N,D)),he&&(he=this.parseTextData(he,D,N,!0,te,!0,!0)),N=N.substr(0,N.lastIndexOf(".")),ae.add(this.options.textNodeName,he),this.addChild(x,ae,N)}else{if(L.length>0&&L.lastIndexOf("/")===L.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),N=N.substr(0,N.length-1),L=D):L=L.substr(0,L.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const he=new i(D);D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,N,D)),this.addChild(x,he,N),N=N.substr(0,N.lastIndexOf("."))}else{const he=new i(D);this.tagsNodeStack.push(x),D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,N,D)),this.addChild(x,he,N),x=he}A="",W=Y}}else A+=T[W];return R.child};function b(T,R,x){const A=this.options.updateTag(R.tagname,x,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),T.addChild(R))}const w=function(T){if(this.options.processEntities){for(let R in this.docTypeEntities){const x=this.docTypeEntities[R];T=T.replace(x.regx,x.val)}for(let R in this.lastEntities){const x=this.lastEntities[R];T=T.replace(x.regex,x.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const x=this.htmlEntities[R];T=T.replace(x.regex,x.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function S(T,R,x,A){return T&&(A===void 0&&(A=Object.keys(R.child).length===0),(T=this.parseTextData(T,R.tagname,x,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&T!==""&&R.add(this.options.textNodeName,T),T=""),T}function y(T,R,x){const A="*."+x;for(const N in T){const W=T[N];if(A===W||R===W)return!0}return!1}function g(T,R,x,A){const N=T.indexOf(R,x);if(N===-1)throw new Error(A);return N+R.length-1}function v(T,R,x){const A=(function(te,Y){let se,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",ae="";for(let we=Y;we<te.length;we++){let Q=te[we];if(se)Q===se&&(se="");else if(Q==='"'||Q==="'")se=Q;else if(Q===he[0]){if(!he[1])return{data:ae,index:we};if(te[we+1]===he[1])return{data:ae,index:we}}else Q===" "&&(Q=" ");ae+=Q}})(T,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let N=A.data;const W=A.index,O=N.search(/\s/);let D=N,V=!0;O!==-1&&(D=N.substring(0,O),N=N.substring(O+1).trimStart());const L=D;if(x){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1),V=D!==A.data.substr(te+1))}return{tagName:D,tagExp:N,closeIndex:W,attrExpPresent:V,rawTagName:L}}function h(T,R,x){const A=x;let N=1;for(;x<T.length;x++)if(T[x]==="<")if(T[x+1]==="/"){const W=g(T,">",x,`${R} is not closed`);if(T.substring(x+2,W).trim()===R&&(N--,N===0))return{tagContent:T.substring(A,x),i:W};x=W}else if(T[x+1]==="?")x=g(T,"?>",x+1,"StopNode is not closed.");else if(T.substr(x+1,3)==="!--")x=g(T,"-->",x+3,"StopNode is not closed.");else if(T.substr(x+1,2)==="![")x=g(T,"]]>",x,"StopNode is not closed.")-2;else{const W=v(T,x,">");W&&((W&&W.tagName)===R&&W.tagExp[W.tagExp.length-1]!=="/"&&N++,x=W.closeIndex)}}function E(T,R,x){if(R&&typeof T=="string"){const A=T.trim();return A==="true"||A!=="false"&&s(T,x)}return r.isExist(T)?T:""}e.exports=class{constructor(T){this.options=T,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,16))}},this.addExternalEntities=l,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=c,this.buildAttributesMap=d,this.isItStopNode=y,this.replaceEntitiesValue=w,this.readStopNodeData=h,this.saveTextToParentTag=S,this.addChild=b,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),i=n(299),{prettify:o}=n(728),s=n(31);e.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,l){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(l){l===!0&&(l={});const p=s.validate(a,l);if(p!==!0)throw Error(`${p.err.msg}:${p.err.line}:${p.err.col}`)}const u=new i(this.options);u.addExternalEntities(this.externalEntities);const c=u.parseXml(a);return this.options.preserveOrder||c===void 0?c:o(c,this.options)}addEntity(a,l){if(l.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(a.indexOf("&")!==-1||a.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(l==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=l}}},728:(e,t)=>{function n(s,a,l){let u;const c={};for(let p=0;p<s.length;p++){const d=s[p],m=r(d);let b="";if(b=l===void 0?m:l+"."+m,m===a.textNodeName)u===void 0?u=d[m]:u+=""+d[m];else{if(m===void 0)continue;if(d[m]){let w=n(d[m],a,b);const S=o(w,a);d[":@"]?i(w,d[":@"],b,a):Object.keys(w).length!==1||w[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(w).length===0&&(a.alwaysCreateTextNode?w[a.textNodeName]="":w=""):w=w[a.textNodeName],c[m]!==void 0&&c.hasOwnProperty(m)?(Array.isArray(c[m])||(c[m]=[c[m]]),c[m].push(w)):a.isArray(m,b,S)?c[m]=[w]:c[m]=w}}}return typeof u=="string"?u.length>0&&(c[a.textNodeName]=u):u!==void 0&&(c[a.textNodeName]=u),c}function r(s){const a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l];if(u!==":@")return u}}function i(s,a,l,u){if(a){const c=Object.keys(a),p=c.length;for(let d=0;d<p;d++){const m=c[d];u.isArray(m,l+"."+m,!0,!0)?s[m]=[a[m]]:s[m]=a[m]}}}function o(s,a){const{textNodeName:l}=a,u=Object.keys(s).length;return u===0||!(u!==1||!s[l]&&typeof s[l]!="boolean"&&s[l]!==0)}t.prettify=function(s,a){return n(s,a)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},542:(e,t,n)=>{(function(){var r=n(298),i=n(526).utf8,o=n(135),s=n(526).bin,a=function(l,u){l.constructor==String?l=u&&u.encoding==="binary"?s.stringToBytes(l):i.stringToBytes(l):o(l)?l=Array.prototype.slice.call(l,0):Array.isArray(l)||l.constructor===Uint8Array||(l=l.toString());for(var c=r.bytesToWords(l),p=8*l.length,d=1732584193,m=-271733879,b=-1732584194,w=271733878,S=0;S<c.length;S++)c[S]=16711935&(c[S]<<8|c[S]>>>24)|4278255360&(c[S]<<24|c[S]>>>8);c[p>>>5]|=128<<p%32,c[14+(p+64>>>9<<4)]=p;var y=a._ff,g=a._gg,v=a._hh,h=a._ii;for(S=0;S<c.length;S+=16){var E=d,T=m,R=b,x=w;d=y(d,m,b,w,c[S+0],7,-680876936),w=y(w,d,m,b,c[S+1],12,-389564586),b=y(b,w,d,m,c[S+2],17,606105819),m=y(m,b,w,d,c[S+3],22,-1044525330),d=y(d,m,b,w,c[S+4],7,-176418897),w=y(w,d,m,b,c[S+5],12,1200080426),b=y(b,w,d,m,c[S+6],17,-1473231341),m=y(m,b,w,d,c[S+7],22,-45705983),d=y(d,m,b,w,c[S+8],7,1770035416),w=y(w,d,m,b,c[S+9],12,-1958414417),b=y(b,w,d,m,c[S+10],17,-42063),m=y(m,b,w,d,c[S+11],22,-1990404162),d=y(d,m,b,w,c[S+12],7,1804603682),w=y(w,d,m,b,c[S+13],12,-40341101),b=y(b,w,d,m,c[S+14],17,-1502002290),d=g(d,m=y(m,b,w,d,c[S+15],22,1236535329),b,w,c[S+1],5,-165796510),w=g(w,d,m,b,c[S+6],9,-1069501632),b=g(b,w,d,m,c[S+11],14,643717713),m=g(m,b,w,d,c[S+0],20,-373897302),d=g(d,m,b,w,c[S+5],5,-701558691),w=g(w,d,m,b,c[S+10],9,38016083),b=g(b,w,d,m,c[S+15],14,-660478335),m=g(m,b,w,d,c[S+4],20,-405537848),d=g(d,m,b,w,c[S+9],5,568446438),w=g(w,d,m,b,c[S+14],9,-1019803690),b=g(b,w,d,m,c[S+3],14,-187363961),m=g(m,b,w,d,c[S+8],20,1163531501),d=g(d,m,b,w,c[S+13],5,-1444681467),w=g(w,d,m,b,c[S+2],9,-51403784),b=g(b,w,d,m,c[S+7],14,1735328473),d=v(d,m=g(m,b,w,d,c[S+12],20,-1926607734),b,w,c[S+5],4,-378558),w=v(w,d,m,b,c[S+8],11,-2022574463),b=v(b,w,d,m,c[S+11],16,1839030562),m=v(m,b,w,d,c[S+14],23,-35309556),d=v(d,m,b,w,c[S+1],4,-1530992060),w=v(w,d,m,b,c[S+4],11,1272893353),b=v(b,w,d,m,c[S+7],16,-155497632),m=v(m,b,w,d,c[S+10],23,-1094730640),d=v(d,m,b,w,c[S+13],4,681279174),w=v(w,d,m,b,c[S+0],11,-358537222),b=v(b,w,d,m,c[S+3],16,-722521979),m=v(m,b,w,d,c[S+6],23,76029189),d=v(d,m,b,w,c[S+9],4,-640364487),w=v(w,d,m,b,c[S+12],11,-421815835),b=v(b,w,d,m,c[S+15],16,530742520),d=h(d,m=v(m,b,w,d,c[S+2],23,-995338651),b,w,c[S+0],6,-198630844),w=h(w,d,m,b,c[S+7],10,1126891415),b=h(b,w,d,m,c[S+14],15,-1416354905),m=h(m,b,w,d,c[S+5],21,-57434055),d=h(d,m,b,w,c[S+12],6,1700485571),w=h(w,d,m,b,c[S+3],10,-1894986606),b=h(b,w,d,m,c[S+10],15,-1051523),m=h(m,b,w,d,c[S+1],21,-2054922799),d=h(d,m,b,w,c[S+8],6,1873313359),w=h(w,d,m,b,c[S+15],10,-30611744),b=h(b,w,d,m,c[S+6],15,-1560198380),m=h(m,b,w,d,c[S+13],21,1309151649),d=h(d,m,b,w,c[S+4],6,-145523070),w=h(w,d,m,b,c[S+11],10,-1120210379),b=h(b,w,d,m,c[S+2],15,718787259),m=h(m,b,w,d,c[S+9],21,-343485551),d=d+E>>>0,m=m+T>>>0,b=b+R>>>0,w=w+x>>>0}return r.endian([d,m,b,w])};a._ff=function(l,u,c,p,d,m,b){var w=l+(u&c|~u&p)+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._gg=function(l,u,c,p,d,m,b){var w=l+(u&p|c&~p)+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._hh=function(l,u,c,p,d,m,b){var w=l+(u^c^p)+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._ii=function(l,u,c,p,d,m,b){var w=l+(c^(u|~p))+(d>>>0)+b;return(w<<m|w>>>32-m)+u},a._blocksize=16,a._digestsize=16,e.exports=function(l,u){if(l==null)throw new Error("Illegal argument "+l);var c=r.wordsToBytes(a(l,u));return u&&u.asBytes?c:u&&u.asString?s.bytesToString(c):r.bytesToHex(c)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(y){return y?(y.substr(0,2)==="{}"&&(y="\\{\\}"+y.substr(2)),S((function(g){return g.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(l)})(y),!0).map(c)):[]};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function u(y){return parseInt(y,10)==y?parseInt(y,10):y.charCodeAt(0)}function c(y){return y.split(i).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(l).join(".")}function p(y){if(!y)return[""];var g=[],v=r("{","}",y);if(!v)return y.split(",");var h=v.pre,E=v.body,T=v.post,R=h.split(",");R[R.length-1]+="{"+E+"}";var x=p(T);return T.length&&(R[R.length-1]+=x.shift(),R.push.apply(R,x)),g.push.apply(g,R),g}function d(y){return"{"+y+"}"}function m(y){return/^-?0\d/.test(y)}function b(y,g){return y<=g}function w(y,g){return y>=g}function S(y,g){var v=[],h=r("{","}",y);if(!h)return[y];var E=h.pre,T=h.post.length?S(h.post,!1):[""];if(/\$$/.test(h.pre))for(var R=0;R<T.length;R++){var x=E+"{"+h.body+"}"+T[R];v.push(x)}else{var A,N,W=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),O=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),D=W||O,V=h.body.indexOf(",")>=0;if(!D&&!V)return h.post.match(/,.*\}/)?S(y=h.pre+"{"+h.body+s+h.post):[y];if(D)A=h.body.split(/\.\./);else if((A=p(h.body)).length===1&&(A=S(A[0],!1).map(d)).length===1)return T.map((function(ee){return h.pre+A[0]+ee}));if(D){var L=u(A[0]),te=u(A[1]),Y=Math.max(A[0].length,A[1].length),se=A.length==3?Math.abs(u(A[2])):1,he=b;te<L&&(se*=-1,he=w);var ae=A.some(m);N=[];for(var we=L;he(we,te);we+=se){var Q;if(O)(Q=String.fromCharCode(we))==="\\"&&(Q="");else if(Q=String(we),ae){var ie=Y-Q.length;if(ie>0){var ce=new Array(ie+1).join("0");Q=we<0?"-"+ce+Q.slice(1):ce+Q}}N.push(Q)}}else{N=[];for(var Ae=0;Ae<A.length;Ae++)N.push.apply(N,S(A[Ae],!1))}for(Ae=0;Ae<N.length;Ae++)for(R=0;R<T.length;R++)x=E+N[Ae]+T[R],(!g||D||x)&&v.push(x)}return v}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(u)}function n(u){var c=typeof Map=="function"?new Map:void 0;return n=function(p){if(p===null||(d=p,Function.toString.call(d).indexOf("[native code]")===-1))return p;var d;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(p))return c.get(p);c.set(p,m)}function m(){return r(p,arguments,o(this).constructor)}return m.prototype=Object.create(p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),i(m,p)},n(u)}function r(u,c,p){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(d,m,b){var w=[null];w.push.apply(w,m);var S=new(Function.bind.apply(d,w));return b&&i(S,b.prototype),S},r.apply(null,arguments)}function i(u,c){return i=Object.setPrototypeOf||function(p,d){return p.__proto__=d,p},i(u,c)}function o(u){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},o(u)}var s=(function(u){function c(p){var d;return(function(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),(d=(function(m,b){return!b||t(b)!=="object"&&typeof b!="function"?(function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w})(m):b})(this,o(c).call(this,p))).name="ObjectPrototypeMutationError",d}return(function(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),d&&i(p,d)})(c,u),c})(n(Error));function a(u,c){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=c.split("."),m=d.length,b=function(y){var g=d[y];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map((function(h,E){var T=d.slice(y+1);return T.length>0?a(h,T.join("."),p):p(u,E,d,y)}))};var v=d.slice(0,y).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}u=p(u,g,d,y)},w=0;w<m;w++){var S=b(w);if(t(S)==="object")return S.v}return u}function l(u,c){return u.length===c+1}e.exports={set:function(u,c,p){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c]=p,u[c];try{return a(u,c,(function(d,m,b,w){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[m]){var S=Number.isInteger(Number(b[w+1])),y=b[w+1]==="+";d[m]=S||y?[]:{}}return l(b,w)&&(d[m]=p),d[m]}))}catch(d){if(d instanceof s)throw d;return u}},get:function(u,c){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c];try{return a(u,c,(function(p,d){return p[d]}))}catch{return u}},has:function(u,c){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||c===void 0)return!1;if(typeof c=="number")return c in u;try{var d=!1;return a(u,c,(function(m,b,w,S){if(!l(w,S))return m&&m[b];d=p.own?m.hasOwnProperty(b):b in m})),d}catch{return!1}},hasOwn:function(u,c,p){return this.has(u,c,p||{own:!0})},isIn:function(u,c,p){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||c===void 0)return!1;try{var m=!1,b=!1;return a(u,c,(function(w,S,y,g){return m=m||w===p||!!w&&w[S]===p,b=l(y,g)&&t(w)==="object"&&S in w,w&&w[S]})),d.validPath?m&&b:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,n)=>{var r=n(410),i=function(u){return typeof u=="string"};function o(u,c){for(var p=[],d=0;d<u.length;d++){var m=u[d];m&&m!=="."&&(m===".."?p.length&&p[p.length-1]!==".."?p.pop():c&&p.push(".."):p.push(m))}return p}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function l(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",c=!1,p=arguments.length-1;p>=-1&&!c;p--){var d=p>=0?arguments[p]:be.cwd();if(!i(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,c=d.charAt(0)==="/")}return(c?"/":"")+(u=o(u.split("/"),!c).join("/"))||"."},a.normalize=function(u){var c=a.isAbsolute(u),p=u.substr(-1)==="/";return(u=o(u.split("/"),!c).join("/"))||c||(u="."),u&&p&&(u+="/"),(c?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",c=0;c<arguments.length;c++){var p=arguments[c];if(!i(p))throw new TypeError("Arguments to path.join must be strings");p&&(u+=u?"/"+p:p)}return a.normalize(u)},a.relative=function(u,c){function p(g){for(var v=0;v<g.length&&g[v]==="";v++);for(var h=g.length-1;h>=0&&g[h]==="";h--);return v>h?[]:g.slice(v,h+1)}u=a.resolve(u).substr(1),c=a.resolve(c).substr(1);for(var d=p(u.split("/")),m=p(c.split("/")),b=Math.min(d.length,m.length),w=b,S=0;S<b;S++)if(d[S]!==m[S]){w=S;break}var y=[];for(S=w;S<d.length;S++)y.push("..");return(y=y.concat(m.slice(w))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var c=l(u),p=c[0],d=c[1];return p||d?(d&&(d=d.substr(0,d.length-1)),p+d):"."},a.basename=function(u,c){var p=l(u)[2];return c&&p.substr(-1*c.length)===c&&(p=p.substr(0,p.length-c.length)),p},a.extname=function(u){return l(u)[3]},a.format=function(u){if(!r.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var c=u.root||"";if(!i(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof u.root);return(u.dir?u.dir+a.sep:"")+(u.base||"")},a.parse=function(u){if(!i(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var c=l(u);if(!c||c.length!==4)throw new TypeError("Invalid path '"+u+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},a.sep="/",a.delimiter=":",e.exports=a},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function i(o){try{return encodeURIComponent(o)}catch{return null}}t.stringify=function(o,s){s=s||"";var a,l,u=[];for(l in typeof s!="string"&&(s="?"),o)if(n.call(o,l)){if((a=o[l])||a!=null&&!isNaN(a)||(a=""),l=i(l),a=i(a),l===null||a===null)continue;u.push(l+"="+a)}return u.length?s+u.join("&"):""},t.parse=function(o){for(var s,a=/([^=?#&]+)=?([^&]*)/g,l={};s=a.exec(o);){var u=r(s[1]),c=r(s[2]);u===null||c===null||u in l||(l[u]=c)}return l}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},494:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(o=Object.assign({},r,o),!i||typeof i!="string")return i;let s=i.trim();if(o.skipLike!==void 0&&o.skipLike.test(s))return i;if(o.hex&&t.test(s))return Number.parseInt(s,16);{const l=n.exec(s);if(l){const u=l[1],c=l[2];let p=((a=l[3])&&a.indexOf(".")!==-1&&((a=a.replace(/0+$/,""))==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substr(0,a.length-1))),a);const d=l[4]||l[6];if(!o.leadingZeros&&c.length>0&&u&&s[2]!=="."||!o.leadingZeros&&c.length>0&&!u&&s[1]!==".")return i;{const m=Number(s),b=""+m;return b.search(/[eE]/)!==-1||d?o.eNotation?m:i:s.indexOf(".")!==-1?b==="0"&&p===""||b===p||u&&b==="-"+p?m:i:c?p===b||u+p===b?m:i:s===b||s===u+b?m:i}}return i}var a}},737:(e,t,n)=>{var r=n(670),i=n(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(g){return(g||"").toString().replace(o,"")}var d=[["#","hash"],["?","query"],function(g,v){return w(v.protocol)?g.replace(/\\/g,"/"):g},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],m={hash:1,query:1};function b(g){var v,h=(typeof window<"u"?window:typeof Wr<"u"?Wr:typeof self<"u"?self:{}).location||{},E={},T=typeof(g=g||h);if(g.protocol==="blob:")E=new y(unescape(g.pathname),{});else if(T==="string")for(v in E=new y(g,{}),m)delete E[v];else if(T==="object"){for(v in g)v in m||(E[v]=g[v]);E.slashes===void 0&&(E.slashes=a.test(g.href))}return E}function w(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function S(g,v){g=(g=p(g)).replace(s,""),v=v||{};var h,E=u.exec(g),T=E[1]?E[1].toLowerCase():"",R=!!E[2],x=!!E[3],A=0;return R?x?(h=E[2]+E[3]+E[4],A=E[2].length+E[3].length):(h=E[2]+E[4],A=E[2].length):x?(h=E[3]+E[4],A=E[3].length):h=E[4],T==="file:"?A>=2&&(h=h.slice(2)):w(T)?h=E[4]:T?R&&(h=h.slice(2)):A>=2&&w(v.protocol)&&(h=E[4]),{protocol:T,slashes:R||w(T),slashesCount:A,rest:h}}function y(g,v,h){if(g=(g=p(g)).replace(s,""),!(this instanceof y))return new y(g,v,h);var E,T,R,x,A,N,W=d.slice(),O=typeof v,D=this,V=0;for(O!=="object"&&O!=="string"&&(h=v,v=null),h&&typeof h!="function"&&(h=i.parse),E=!(T=S(g||"",v=b(v))).protocol&&!T.slashes,D.slashes=T.slashes||E&&v.slashes,D.protocol=T.protocol||v.protocol||"",g=T.rest,(T.protocol==="file:"&&(T.slashesCount!==2||c.test(g))||!T.slashes&&(T.protocol||T.slashesCount<2||!w(D.protocol)))&&(W[3]=[/(.*)/,"pathname"]);V<W.length;V++)typeof(x=W[V])!="function"?(R=x[0],N=x[1],R!=R?D[N]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof x[2]=="number"?(D[N]=g.slice(0,A),g=g.slice(A+x[2])):(D[N]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(D[N]=A[1],g=g.slice(0,A.index)),D[N]=D[N]||E&&x[3]&&v[N]||"",x[4]&&(D[N]=D[N].toLowerCase())):g=x(g,D);h&&(D.query=h(D.query)),E&&v.slashes&&D.pathname.charAt(0)!=="/"&&(D.pathname!==""||v.pathname!=="")&&(D.pathname=(function(L,te){if(L==="")return te;for(var Y=(te||"/").split("/").slice(0,-1).concat(L.split("/")),se=Y.length,he=Y[se-1],ae=!1,we=0;se--;)Y[se]==="."?Y.splice(se,1):Y[se]===".."?(Y.splice(se,1),we++):we&&(se===0&&(ae=!0),Y.splice(se,1),we--);return ae&&Y.unshift(""),he!=="."&&he!==".."||Y.push(""),Y.join("/")})(D.pathname,v.pathname)),D.pathname.charAt(0)!=="/"&&w(D.protocol)&&(D.pathname="/"+D.pathname),r(D.port,D.protocol)||(D.host=D.hostname,D.port=""),D.username=D.password="",D.auth&&(~(A=D.auth.indexOf(":"))?(D.username=D.auth.slice(0,A),D.username=encodeURIComponent(decodeURIComponent(D.username)),D.password=D.auth.slice(A+1),D.password=encodeURIComponent(decodeURIComponent(D.password))):D.username=encodeURIComponent(decodeURIComponent(D.auth)),D.auth=D.password?D.username+":"+D.password:D.username),D.origin=D.protocol!=="file:"&&w(D.protocol)&&D.host?D.protocol+"//"+D.host:"null",D.href=D.toString()}y.prototype={set:function(g,v,h){var E=this;switch(g){case"query":typeof v=="string"&&v.length&&(v=(h||i.parse)(v)),E[g]=v;break;case"port":E[g]=v,r(v,E.protocol)?v&&(E.host=E.hostname+":"+v):(E.host=E.hostname,E[g]="");break;case"hostname":E[g]=v,E.port&&(v+=":"+E.port),E.host=v;break;case"host":E[g]=v,l.test(v)?(v=v.split(":"),E.port=v.pop(),E.hostname=v.join(":")):(E.hostname=v,E.port="");break;case"protocol":E.protocol=v.toLowerCase(),E.slashes=!h;break;case"pathname":case"hash":if(v){var T=g==="pathname"?"/":"#";E[g]=v.charAt(0)!==T?T+v:v}else E[g]=v;break;case"username":case"password":E[g]=encodeURIComponent(v);break;case"auth":var R=v.indexOf(":");~R?(E.username=v.slice(0,R),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=v.slice(R+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(v))}for(var x=0;x<d.length;x++){var A=d[x];A[4]&&(E[A[1]]=E[A[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&w(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(g){g&&typeof g=="function"||(g=i.stringify);var v,h=this,E=h.host,T=h.protocol;T&&T.charAt(T.length-1)!==":"&&(T+=":");var R=T+(h.protocol&&h.slashes||w(h.protocol)?"//":"");return h.username?(R+=h.username,h.password&&(R+=":"+h.password),R+="@"):h.password?(R+=":"+h.password,R+="@"):h.protocol!=="file:"&&w(h.protocol)&&!E&&h.pathname!=="/"&&(R+="@"),(E[E.length-1]===":"||l.test(h.hostname)&&!h.port)&&(E+=":"),R+=E+h.pathname,(v=typeof h.query=="object"?g(h.query):h.query)&&(R+=v.charAt(0)!=="?"?"?"+v:v),h.hash&&(R+=h.hash),R}},y.extractProtocol=S,y.location=b,y.trimLeft=p,y.qs=i,e.exports=y},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},vy={};function yt(e){var t=vy[e];if(t!==void 0)return t.exports;var n=vy[e]={id:e,loaded:!1,exports:{}};return XR[e].call(n.exports,n,n.exports,yt),n.loaded=!0,n.exports}yt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return yt.d(t,{a:t}),t},yt.d=(e,t)=>{for(var n in t)yt.o(t,n)&&!yt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},yt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),yt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Nn={};yt.d(Nn,{hT:()=>pn,O4:()=>xr,Kd:()=>oC,YK:()=>sC,UU:()=>dk,Gu:()=>Py,ky:()=>Wy,h4:()=>Lo,ch:()=>da,hq:()=>fi,i5:()=>Hy});var YR=yt(737),JR=yt.n(YR);function of(e){if(!sf(e))throw new Error("Parameter was not an error")}function sf(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class dn extends Error{constructor(t,n){const r=[...arguments],{options:i,shortMessage:o}=(function(a){let l,u="";if(a.length===0)l={};else if(sf(a[0]))l={cause:a[0]},u=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")l=Object.assign({},a[0]),u=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");l={},u=u=a.join(" ")||""}return{options:l,shortMessage:u}})(r);let s=o;if(i.cause&&(s=`${s}: ${i.cause.message}`),super(s),this.message=s,i.name&&typeof i.name=="string"?this.name=i.name:this.name="Layerr",i.cause&&Object.defineProperty(this,"_cause",{value:i.cause}),Object.defineProperty(this,"_info",{value:{}}),i.info&&typeof i.info=="object"&&Object.assign(this._info,i.info),Error.captureStackTrace){const a=i.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return of(t),t._cause&&sf(t._cause)?t._cause:null}static fullStack(t){of(t);const n=dn.cause(t);return n?`${t.stack}
32
- caused by: ${dn.fullStack(n)}`:t.stack??""}static info(t){of(t);const n={},r=dn.cause(t);return r&&Object.assign(n,dn.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var ZR=yt(47),oa=yt.n(ZR);const by="__PATH_SEPARATOR_POSIX__",wy="__PATH_SEPARATOR_WINDOWS__";function It(e){try{const t=e.replace(/\//g,by).replace(/\\\\/g,wy);return encodeURIComponent(t).split(wy).join("\\\\").split(by).join("/")}catch(t){throw new dn(t,"Failed encoding path")}}function Sy(e){return e.startsWith("/")?e:"/"+e}function Fo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function eC(e){let t=new(JR())(e).pathname;return t.length<=0&&(t="/"),Fo(t)}function Ot(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(function(){return(function(r){var i=[];if(r.length===0)return"";if(typeof r[0]!="string")throw new TypeError("Url must be a string. Received "+r[0]);if(r[0].match(/^[^/:]+:\/*$/)&&r.length>1){var o=r.shift();r[0]=o+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s<r.length;s++){var a=r[s];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(s>0&&(a=a.replace(/^[\/]+/,"")),a=s<r.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),i.push(a))}var l=i.join("/"),u=(l=l.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,i,o)=>((o===0||i!=="/"||i==="/"&&r[r.length-1]!=="/")&&r.push(i),r)),[]))}var tC=yt(542),_o=yt.n(tC);const nC="abcdef0123456789";function Ey(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=(function(d,m,b,w,S,y,g){const v=g||_o()(`${m}:${b}:${w}`);return d&&d.toLowerCase()==="md5-sess"?_o()(`${v}:${S}:${y}`):v})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),l=_o()(`${i}:${r}`),u=o?_o()(`${a}:${t.nonce}:${s}:${t.cnonce}:${o}:${l}`):_o()(`${a}:${t.nonce}:${l}`),c={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:o,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},p=[];for(const d in c)c[d]&&(d==="qop"||d==="nc"||d==="algorithm"?p.push(`${d}=${c[d]}`):p.push(`${d}="${c[d]}"`));return`Digest ${p.join(", ")}`}function Ty(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var rC=yt(101),Ay=yt.n(rC);function xy(e){return Ay().decode(e)}function Ry(e,t){var n;return`Basic ${n=`${e}:${t}`,Ay().encode(n)}`}const sa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,iC=sa.fetch.bind(sa),oC=sa.Request,sC=sa.Response;let pn=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),xr=(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({});function Cy(e,t,n,r,i){switch(e.authType){case pn.Auto:t&&n&&(e.headers.Authorization=Ry(t,n));break;case pn.Digest:e.digest=(function(s,a,l){return{username:s,password:a,ha1:l,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,i);break;case pn.None:break;case pn.Password:e.headers.Authorization=Ry(t,n);break;case pn.Token:e.headers.Authorization=`${(o=r).token_type} ${o.access_token}`;break;default:throw new dn({info:{code:xr.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var o}yt(345),yt(800);const ky="@@HOTPATCHER",aC=()=>{};function af(e){return{original:e,methods:[e],final:!1}}class lC{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=ky}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==ky)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((r=>{this.configuration.registry.hasOwnProperty(r)?n&&(this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])):this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])})),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||aC;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return n(...i)}get(t){const n=this.configuration.registry[t];if(!n)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error(`Failed handling method request: No method provided for override: ${t}`);default:throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`)}return(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(i.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];let u=a;const c=this;for(;i.length>0;)u=[i.shift().apply(c,u)];return u[0]}})(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:i=!1}=r;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(i)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=af(n);else if(this.isPatched(t)){const{original:o}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(af(n),{original:o})}else this.configuration.registry[t]=af(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return this.execute(t,...i)}plugin(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((o=>{this.patch(t,o,{chain:!0})})),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if(typeof this.configuration.registry[t].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}let lf=null;function Py(){return lf||(lf=new lC),lf}function aa(e){return(function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n})(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Iy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,i=[...t];for(;i.length>0;){const o=i.shift();r=r?Oy(r,o):aa(o)}return r}function Oy(e,t){const n=aa(e);return Object.keys(t).forEach((r=>{n.hasOwnProperty(r)?Array.isArray(t[r])?n[r]=Array.isArray(n[r])?[...n[r],...t[r]]:[...t[r]]:typeof t[r]=="object"&&t[r]?n[r]=typeof n[r]=="object"&&n[r]?Oy(n[r],t[r]):aa(t[r]):n[r]=t[r]:n[r]=t[r]})),n}function cC(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function cf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length===0)return{};const r={};return t.reduce(((i,o)=>(Object.keys(o).forEach((s=>{const a=s.toLowerCase();r.hasOwnProperty(a)?i[r[a]]=o[s]:(r[a]=s,i[s]=o[s])})),i)),{})}yt(805);const uC=typeof ArrayBuffer=="function",{toString:fC}=Object.prototype;function Fy(e){return uC&&(e instanceof ArrayBuffer||fC.call(e)==="[object ArrayBuffer]")}function _y(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function uf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function ff(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Dy=uf((function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Iy(e,{headers:{Authorization:Ey(e,t)}})),ff(la(e),(function(n){let r=!1;return i=function(s){return r?s:n},(o=(function(){if(n.status==401)return t.hasDigestAuth=(function(s,a){if(!Ty(s))return!1;const l=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",c=l.exec(u);if(!c)break;a[c[1]]=c[2]||c[3]}return a.nc+=1,a.cnonce=(function(){let u="";for(let c=0;c<32;++c)u=`${u}${nC[Math.floor(16*Math.random())]}`;return u})(),!0})(n,t),(function(){if(t.hasDigestAuth)return ff(la(e=Iy(e,{headers:{Authorization:Ey(e,t)}})),(function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,s}))})();t.nc++})())&&o.then?o.then(i):i(o);var i,o}))})),dC=uf((function(e,t){return ff(la(e),(function(n){return n.ok?(t.authType=pn.Password,n):n.status==401&&Ty(n)?(t.authType=pn.Digest,Cy(t,t.username,t.password,void 0,void 0),e._digest=t.digest,Dy(e)):n}))})),Kt=uf((function(e,t){return t.authType===pn.Auto?dC(e,t):e._digest?Dy(e):la(e)}));function Gt(e,t,n){const r=aa(e);return r.headers=cf(t.headers,r.headers||{},n.headers||{}),n.data!==void 0&&(r.data=n.data),n.signal&&(r.signal=n.signal),t.httpAgent&&(r.httpAgent=t.httpAgent),t.httpsAgent&&(r.httpsAgent=t.httpsAgent),t.digest&&(r._digest=t.digest),typeof t.withCredentials=="boolean"&&(r.withCredentials=t.withCredentials),r}function la(e){const t=Py();return t.patchInline("request",(n=>t.patchInline("fetch",iC,n.url,(function(r){let i={};const o={method:r.method};if(r.headers&&(i=cf(i,r.headers)),r.data!==void 0){const[s,a]=(function(l){if(typeof l=="string")return[l,{}];if(_y(l))return[l,{}];if(Fy(l))return[l,{}];if(l&&typeof l=="object")return[JSON.stringify(l),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof l)})(r.data);o.body=s,i=cf(i,a)}return r.signal&&(o.signal=r.signal),r.withCredentials&&(o.credentials="include"),o.headers=i,o})(n))),e)}var pC=yt(285);const ca=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},hC={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Do=e=>e.replace(/[[\]\\-]/g,"\\$&"),Ny=e=>e.join(""),mC=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],i=[];let o=n+1,s=!1,a=!1,l=!1,u=!1,c=n,p="";e:for(;o<e.length;){const w=e.charAt(o);if(w!=="!"&&w!=="^"||o!==n+1){if(w==="]"&&s&&!l){c=o+1;break}if(s=!0,w!=="\\"||l){if(w==="["&&!l){for(const[S,[y,g,v]]of Object.entries(hC))if(e.startsWith(S,o)){if(p)return["$.",!1,e.length-n,!0];o+=S.length,v?i.push(y):r.push(y),a=a||g;continue e}}l=!1,p?(w>p?r.push(Do(p)+"-"+Do(w)):w===p&&r.push(Do(w)),p="",o++):e.startsWith("-]",o+1)?(r.push(Do(w+"-")),o+=2):e.startsWith("-",o+1)?(p=w,o+=2):(r.push(Do(w)),o++)}else l=!0,o++}else u=!0,o++}if(c<o)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u)return[(d=r[0].length===2?r[0].slice(-1):r[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var d;const m="["+(u?"^":"")+Ny(r)+"]",b="["+(u?"":"^")+Ny(i)+"]";return[r.length&&i.length?"("+m+"|"+b+")":r.length?m:b,a,c-n,!0]},No=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},gC=new Set(["!","?","+","*","@"]),Ly=e=>gC.has(e),df="(?!\\.)",yC=new Set(["[","."]),vC=new Set(["..","."]),bC=new Set("().*{}+?[]^$\\!"),pf="[^/]",$y=pf+"*?",My=pf+"+?";class hn{type;#n;#r;#o=!1;#e=[];#t;#s;#l;#a=!1;#i;#c;#f=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#s=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#e.length;i++)for(const o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(r.#e[i])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const i of n)if(i!==""){if(typeof i!="string"&&!(i instanceof hn&&i.#t===this))throw new Error("invalid part: "+i);this.#e.push(i)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#s===0)return!0;const t=this.#t;for(let n=0;n<this.#s;n++){const r=t.#e[n];if(!(r instanceof hn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new hn(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,i){let o=!1,s=!1,a=-1,l=!1;if(n.type===null){let m=r,b="";for(;m<t.length;){const w=t.charAt(m++);if(o||w==="\\")o=!o,b+=w;else if(s)m===a+1?w!=="^"&&w!=="!"||(l=!0):w!=="]"||m===a+2&&l||(s=!1),b+=w;else if(w!=="[")if(i.noext||!Ly(w)||t.charAt(m)!=="(")b+=w;else{n.push(b),b="";const S=new hn(w,n);m=hn.#u(t,S,m,i),n.push(S)}else s=!0,a=m,l=!1,b+=w}return n.push(b),m}let u=r+1,c=new hn(null,n);const p=[];let d="";for(;u<t.length;){const m=t.charAt(u++);if(o||m==="\\")o=!o,d+=m;else if(s)u===a+1?m!=="^"&&m!=="!"||(l=!0):m!=="]"||u===a+2&&l||(s=!1),d+=m;else if(m!=="[")if(Ly(m)&&t.charAt(u)==="("){c.push(d),d="";const b=new hn(m,c);c.push(b),u=hn.#u(t,b,u,i)}else if(m!=="|"){if(m===")")return d===""&&n.#e.length===0&&(n.#f=!0),c.push(d),d="",n.push(...p,c),u;d+=m}else c.push(d),d="",p.push(c),c=new hn(null,n);else s=!0,a=u,l=!1,d+=m}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],u}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new hn(null,void 0,n);return hn.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,i,o]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){const n=t??!!this.#i.dot;if(this.#n===this&&this.#p(),!this.type){const l=this.isStart()&&this.isEnd(),u=this.#e.map((d=>{const[m,b,w,S]=typeof d=="string"?hn.#h(d,this.#r,l):d.toRegExpSource(t);return this.#r=this.#r||w,this.#o=this.#o||S,m})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!vC.has(this.#e[0]))){const d=yC,m=n&&d.has(u.charAt(0))||u.startsWith("\\.")&&d.has(u.charAt(2))||u.startsWith("\\.\\.")&&d.has(u.charAt(4)),b=!n&&!t&&d.has(u.charAt(0));c=m?"(?!(?:^|/)\\.\\.?(?:$|/))":b?df:""}let p="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[c+u+p,No(u),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#d(n);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const l=this.toString();return this.#e=[l],this.type=null,this.#r=void 0,[l,No(this.toString()),!1,!1]}let s=!r||t||n?"":this.#d(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";return a=this.type==="!"&&this.#f?(this.isStart()&&!n?df:"")+My:i+o+(this.type==="!"?"))"+(!this.isStart()||n||t?"":df)+$y+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,No(o),this.#r=!!this.#r,this.#o]}#d(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,i,o,s]=n.toRegExpSource(t);return this.#o=this.#o||s,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=!1,o="",s=!1;for(let a=0;a<t.length;a++){const l=t.charAt(a);if(i)i=!1,o+=(bC.has(l)?"\\":"")+l;else if(l!=="\\"){if(l==="["){const[u,c,p,d]=mC(t,a);if(p){o+=u,s=s||c,a+=p-1,n=n||d;continue}}l!=="*"?l!=="?"?o+=l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=pf,n=!0):(o+=r&&t==="*"?My:$y,n=!0)}else a===t.length-1?o+="\\\\":i=!0}return[o,No(t),!!n,s]}}const an=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ca(t),!(!n.nocomment&&t.charAt(0)==="#")&&new ua(t,n).match(e)},wC=/^\*+([^+@!?\*\[\(]*)$/,SC=e=>t=>!t.startsWith(".")&&t.endsWith(e),EC=e=>t=>t.endsWith(e),TC=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),AC=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),xC=/^\*+\.\*+$/,RC=e=>!e.startsWith(".")&&e.includes("."),CC=e=>e!=="."&&e!==".."&&e.includes("."),kC=/^\.\*+$/,PC=e=>e!=="."&&e!==".."&&e.startsWith("."),IC=/^\*+$/,OC=e=>e.length!==0&&!e.startsWith("."),FC=e=>e.length!==0&&e!=="."&&e!=="..",_C=/^\?+([^+@!?\*\[\(]*)?$/,DC=e=>{let[t,n=""]=e;const r=By([t]);return n?(n=n.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(n)):r},NC=e=>{let[t,n=""]=e;const r=jy([t]);return n?(n=n.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(n)):r},LC=e=>{let[t,n=""]=e;const r=jy([t]);return n?i=>r(i)&&i.endsWith(n):r},$C=e=>{let[t,n=""]=e;const r=By([t]);return n?i=>r(i)&&i.endsWith(n):r},By=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},jy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Uy=typeof be=="object"&&be?typeof be.env=="object"&&be.env&&be.env.__MINIMATCH_TESTING_PLATFORM__||be.platform:"posix";an.sep=Uy==="win32"?"\\":"/";const Ln=Symbol("globstar **");an.GLOBSTAR=Ln,an.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>an(n,e,t)};const $n=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};an.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return an;const t=an;return Object.assign((function(n,r){return t(n,r,$n(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,$n(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults($n(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,$n(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,$n(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,$n(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,$n(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,$n(e,r))},defaults:n=>t.defaults($n(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,$n(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,$n(e,r))},match:function(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,$n(e,i))},sep:t.sep,GLOBSTAR:Ln})};const Vy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ca(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:pC(e)};an.braceExpand=Vy,an.makeRe=function(e){return new ua(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},an.match=function(e,t){const n=new ua(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const qy=/[?*]|[+@!]\(.*?\)|\[|\]/;class ua{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ca(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Uy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((o=>this.slashSplit(o)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map(((o,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const l=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&qy.test(o[2])||qy.test(o[3])),u=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map((c=>this.parse(c)))];if(u)return[o[0],...o.slice(1).map((c=>this.parse(c)))]}return o.map((l=>this.parse(l)))}));if(this.debug(this.pattern,i),this.set=i.filter((o=>o.indexOf(!1)===-1)),this.isWindows)for(let o=0;o<this.set.length;o++){const s=this.set[o];s[0]===""&&s[1]===""&&this.globParts[o][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let i=0;i<t[r].length;i++)t[r][i]==="**"&&(t[r][i]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,i)=>{const o=r[r.length-1];return i==="**"&&o==="**"?r:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(r.pop(),r):(r.push(i),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const o=t[i];i===1&&o===""&&t[0]===""||o!=="."&&o!==""||(n=!0,t.splice(i,1),i--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s>i&&r.splice(i+1,s-i);let a=r[i+1];const l=r[i+2],u=r[i+3];if(a!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);const c=r.slice(0);c[i]="**",t.push(c),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<r.length-1;s++){const a=r[s];s===1&&a===""&&r[0]===""||a!=="."&&a!==""||(n=!0,r.splice(s,1),s--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let o=0;for(;(o=r.indexOf("..",o+1))!==-1;){const s=r[o-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;const a=o===1&&r[o+1]==="**"?["."]:[];r.splice(o-1,2,...a),r.length===0&&r.push(""),o-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,o=0,s=[],a="";for(;i<t.length&&o<n.length;)if(t[i]===n[o])s.push(a==="b"?n[o]:t[i]),i++,o++;else if(r&&t[i]==="**"&&n[o]===t[i+1])s.push(t[i]),i++;else if(r&&n[o]==="**"&&t[i]===n[o+1])s.push(n[o]),o++;else if(t[i]!=="*"||!n[o]||!this.options.dot&&n[o].startsWith(".")||n[o]==="**"){if(n[o]!=="*"||!t[i]||!this.options.dot&&t[i].startsWith(".")||t[i]==="**"||a==="a")return!1;a="b",s.push(n[o]),i++,o++}else{if(a==="b")return!1;a="a",s.push(t[i]),i++,o++}return t.length===n.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=this.options;if(this.isWindows){const w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),S=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=S?3:w?0:void 0,v=!y&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:y?0:void 0;if(typeof g=="number"&&typeof v=="number"){const[h,E]=[t[g],n[v]];h.toLowerCase()===E.toLowerCase()&&(n[v]=h,v>g?n=n.slice(v):g>v&&(t=t.slice(g)))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var s=0,a=0,l=t.length,u=n.length;s<l&&a<u;s++,a++){this.debug("matchOne loop");var c=n[a],p=t[s];if(this.debug(n,c,p),c===!1)return!1;if(c===Ln){this.debug("GLOBSTAR",[n,c,p]);var d=s,m=a+1;if(m===u){for(this.debug("** at the end");s<l;s++)if(t[s]==="."||t[s]===".."||!i.dot&&t[s].charAt(0)===".")return!1;return!0}for(;d<l;){var b=t[d];if(this.debug(`
33
- globstar while`,t,d,n,m,b),this.matchOne(t.slice(d),n.slice(m),r))return this.debug("globstar found match!",d,l,b),!0;if(b==="."||b===".."||!i.dot&&b.charAt(0)==="."){this.debug("dot detected!",t,d,n,m);break}this.debug("globstar swallow a segment, and continue"),d++}return!(!r||(this.debug(`
34
- >>> no match, partial?`,t,d,n,m),d!==l))}let w;if(typeof c=="string"?(w=p===c,this.debug("string match",c,p,w)):(w=c.test(p),this.debug("pattern match",c,p,w)),!w)return!1}if(s===l&&a===u)return!0;if(s===l)return r;if(a===u)return s===l-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return Vy(this.pattern,this.options)}parse(t){ca(t);const n=this.options;if(t==="**")return Ln;if(t==="")return"";let r,i=null;(r=t.match(IC))?i=n.dot?FC:OC:(r=t.match(wC))?i=(n.nocase?n.dot?AC:TC:n.dot?EC:SC)(r[1]):(r=t.match(_C))?i=(n.nocase?n.dot?NC:DC:n.dot?LC:$C)(r):(r=t.match(xC))?i=n.dot?CC:RC:(r=t.match(kC))&&(i=PC);const o=hn.fromGlob(t,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(n.nocase?["i"]:[]);let o=t.map((l=>{const u=l.map((c=>{if(c instanceof RegExp)for(const p of c.flags.split(""))i.add(p);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===Ln?Ln:c._src}));return u.forEach(((c,p)=>{const d=u[p+1],m=u[p-1];c===Ln&&m!==Ln&&(m===void 0?d!==void 0&&d!==Ln?u[p+1]="(?:\\/|"+r+"\\/)?"+d:u[p]=r:d===void 0?u[p-1]=m+"(?:\\/|"+r+")?":d!==Ln&&(u[p-1]=m+"(?:\\/|\\/"+r+"\\/)"+d,u[p+1]=Ln))})),u.filter((c=>c!==Ln)).join("/")})).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];o="^"+s+o+a+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const o=this.set;this.debug(this.pattern,"set",o);let s=i[i.length-1];if(!s)for(let a=i.length-2;!s&&a>=0;a--)s=i[a];for(let a=0;a<o.length;a++){const l=o[a];let u=i;if(r.matchBase&&l.length===1&&(u=[s]),this.matchOne(u,l,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return an.defaults(t).Minimatch}}function hf(e){const t=new Error(`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function Qt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw hf(t);return t}function fi(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?cC(e.headers):{},status:e.status,statusText:e.statusText}:t}an.AST=hn,an.Minimatch=ua,an.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},an.unescape=No;const MC=(zy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Gt({url:Ot(e.remoteURL,It(t)),method:"COPY",headers:{Destination:Ot(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Qt(e,a)},(o=Kt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(zy.apply(this,e))}catch(n){return Promise.reject(n)}});var zy,mf=yt(635),BC=yt(829),Rr=yt.n(BC),zi=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(zi||{});function fa(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zi.Original;const r=Rr().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function Lo(e){return new Promise((t=>{t((function(n){const{multistatus:r}=n;if(r==="")return{multistatus:{response:[]}};if(!r)throw new Error("Invalid response: No root multistatus found");const i={multistatus:Array.isArray(r)?r[0]:r};return Rr().set(i,"multistatus.response",fa(i,"multistatus.response",zi.Array)),Rr().set(i,"multistatus.response",Rr().get(i,"multistatus.response").map((o=>(function(s){const a=Object.assign({},s);return a.status?Rr().set(a,"status",fa(a,"status",zi.Object)):(Rr().set(a,"propstat",fa(a,"propstat",zi.Object)),Rr().set(a,"propstat.prop",fa(a,"propstat.prop",zi.Object))),a})(o)))),i})(new mf.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,i)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,i){if(!i.endsWith("propstat.prop.displayname"))return r}}).parse(e)))}))}function da(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:i="0",resourcetype:o=null,getcontenttype:s=null,getetag:a=null}=e,l=o&&typeof o=="object"&&o.collection!==void 0?"directory":"file",u={filename:t,basename:oa().basename(t),lastmod:r,size:parseInt(i,10),type:l,etag:typeof a=="string"?a.replace(/"/g,""):null};return l==="file"&&(u.mime=s&&typeof s=="string"?s.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),u.props=e),u}function Wy(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=null;try{e.multistatus.response[0].propstat&&(r=e.multistatus.response[0])}catch{}if(!r)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:i,status:o}}=r,[s,a,l]=o.split(" ",3),u=parseInt(a,10);if(u>=400){const c=new Error(`Invalid response: ${u} ${l}`);throw c.status=u,c}return da(i,Fo(t),n)}function Hy(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function gf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const yf=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,i=Gt({url:Ot(e.remoteURL,It(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return gf(Kt(i,e),(function(o){return Qt(e,o),gf(o.text(),(function(s){return gf(Lo(s),(function(a){const l=Wy(a,t,r);return fi(o,l,r)}))}))}))}));function Ky(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const jC=Gy((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=(function(o){if(!o||o==="/")return[];let s=o;const a=[];do a.push(s),s=oa().dirname(s);while(s&&s!=="/");return a})(Fo(t));r.sort(((o,s)=>o.length>s.length?1:s.length>o.length?-1:0));let i=!1;return(function(o,s,a){if(typeof o[Xy]=="function"){let w=function(S){try{for(;!(l=p.next()).done;)if((S=s(l.value))&&S.then){if(!Yy(S))return void S.then(w,c||(c=mn.bind(null,u=new Wi,2)));S=S.v}u?mn(u,1,S):u=S}catch(y){mn(u||(u=new Wi),2,y)}};var l,u,c,p=o[Xy]();if(w(),p.return){var d=function(S){try{l.done||p.return()}catch{}return S};if(u&&u.then)return u.then(d,(function(S){throw d(S)}));d()}return u}if(!("length"in o))throw new TypeError("Object is not iterable");for(var m=[],b=0;b<o.length;b++)m.push(o[b]);return(function(w,S,y){var g,v,h=-1;return(function E(T){try{for(;++h<w.length&&(!y||!y());)if((T=S(h))&&T.then){if(!Yy(T))return void T.then(E,v||(v=mn.bind(null,g=new Wi,2)));T=T.v}g?mn(g,1,T):g=T}catch(R){mn(g||(g=new Wi),2,R)}})(),g})(m,(function(w){return s(m[w])}),a)})(r,(function(o){return s=function(){return(function(l,u){try{var c=Ky(yf(e,o),(function(p){if(p.type!=="directory")throw new Error(`Path includes a file: ${t}`)}))}catch(p){return u(p)}return c&&c.then?c.then(void 0,u):c})(0,(function(l){const u=l;return(function(){if(u.status===404)return i=!0,Qy(vf(e,o,{...n,recursive:!1}));throw l})()}))},(a=(function(){if(i)return Qy(vf(e,o,{...n,recursive:!1}))})())&&a.then?a.then(s):s();var s,a}),(function(){return!1}))}));function Gy(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function UC(){}function Qy(e,t){return e&&e.then?e.then(UC):Promise.resolve()}const Xy=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function mn(e,t,n){if(!e.s){if(n instanceof Wi){if(!n.s)return void(n.o=mn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(mn.bind(null,e,t),mn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Wi=(function(){function e(){}return e.prototype.then=function(t,n){const r=new e,i=this.s;if(i){const o=1&i?t:n;if(o){try{mn(r,1,o(this.v))}catch(s){mn(r,2,s)}return r}return this}return this.o=function(o){try{const s=o.v;1&o.s?mn(r,1,t?t(s):s):n?mn(r,1,n(s)):mn(r,2,s)}catch(s){mn(r,2,s)}},r},e})();function Yy(e){return e instanceof Wi&&1&e.s}const vf=Gy((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return jC(e,t,n);const r=Gt({url:Ot(e.remoteURL,(i=It(t),i.endsWith("/")?i:i+"/")),method:"MKCOL"},e,n);var i;return Ky(Kt(r,e),(function(o){Qt(e,o)}))}));var VC=yt(388),Jy=yt.n(VC);const qC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let a=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(a=`${a}${n.range.end}`),r.Range=a}const i=Gt({url:Ot(e.remoteURL,It(t)),method:"GET",headers:r},e,n);return s=function(a){if(Qt(e,a),r.Range&&a.status!==206){const l=new Error(`Invalid response code for partial request: ${a.status}`);throw l.status=a.status,l}return n.callback&&setTimeout((()=>{n.callback(a)}),0),a.body},(o=Kt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s})),zC=()=>{},WC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){n.url||(n.url=Ot(e.remoteURL,It(t)));const r=Gt(n,e,{});return o=function(s){return Qt(e,s),s},(i=Kt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),HC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"DELETE"},e,n);return o=function(s){Qt(e,s)},(i=Kt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),KC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function(r,i){try{var o=(s=yf(e,t,n),a=function(){return!0},l?a?a(s):s:(s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s))}catch(u){return i(u)}var s,a,l;return o&&o.then?o.then(void 0,i):o})(0,(function(r){if(r.status===404)return!1;throw r}))}));function bf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const GC=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return bf(Kt(r,e),(function(i){return Qt(e,i),bf(i.text(),(function(o){if(!o)throw new Error("Failed parsing directory contents: Empty response");return bf(Lo(o),(function(s){const a=Sy(t);let l=(function(u,c,p){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const b=oa().join(c,"/"),{multistatus:{response:w}}=u,S=w.map((y=>{const g=(function(h){try{return h.replace(/^https?:\/\/[^\/]+/,"")}catch(E){throw new dn(E,"Failed normalising HREF")}})(y.href),{propstat:{prop:v}}=y;return da(v,b==="/"?decodeURIComponent(Fo(g)):Fo(oa().relative(decodeURIComponent(b),decodeURIComponent(g))),d)}));return m?S:S.filter((y=>y.basename&&(y.type==="file"||y.filename!==p.replace(/\/$/,""))))})(s,Sy(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(l=(function(u,c){return u.filter((p=>an(p.filename,c,{matchBase:!0})))})(l,n.glob)),fi(i,l,n.details)}))}))}))}));function wf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const QC=wf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[JC]},e,n);return pa(Kt(r,e),(function(i){return Qt(e,i),pa(i.text(),(function(o){return fi(i,o,n.details)}))}))}));function pa(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const XC=wf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"GET"},e,n);return pa(Kt(r,e),(function(i){let o;return Qt(e,i),(function(s,a){var l=s();return l&&l.then?l.then(a):a()})((function(){return pa(i.arrayBuffer(),(function(s){o=s}))}),(function(){return fi(i,o,n.details)}))}))})),YC=wf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:r="binary"}=n;if(r!=="binary"&&r!=="text")throw new dn({info:{code:xr.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?QC(e,t,n):XC(e,t,n)})),JC=e=>e;function ZC(e){return new mf.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Zy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Zy(e,t){const n={...e};for(const r in n)n.hasOwnProperty(r)&&(n[r]&&typeof n[r]=="object"&&r.indexOf(":")===-1?(n[`${t}:${r}`]=Zy(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function Sf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ev(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const ek=ev((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Gt({url:Ot(e.remoteURL,It(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return Sf(Kt(i,e),(function(o){if(Qt(e,o),o.status!==204&&o.status!==200)throw hf(o)}))})),tk=ev((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:i=nk}=n,o={Accept:"text/plain,application/xml",Timeout:i};r&&(o.If=r);const s=Gt({url:Ot(e.remoteURL,It(t)),method:"LOCK",headers:o,data:ZC(e.contactHref)},e,n);return Sf(Kt(s,e),(function(a){return Qt(e,a),Sf(a.text(),(function(l){const u=(d=l,new mf.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),c=Rr().get(u,"prop.lockdiscovery.activelock.locktoken.href"),p=Rr().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!c)throw hf(a,"No lock token received: ");return{token:c,serverTimeout:p}}))}))})),nk="Infinite, Second-4100000000";function Ef(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const rk=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",r=Gt({url:Ot(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Ef(Kt(r,e),(function(i){return Qt(e,i),Ef(i.text(),(function(o){return Ef(Lo(o),(function(s){const a=(function(l){try{const[u]=l.multistatus.response,{propstat:{prop:{"quota-used-bytes":c,"quota-available-bytes":p}}}=u;return c!==void 0&&p!==void 0?{used:parseInt(String(c),10),available:Hy(p)}:null}catch{}return null})(s);return fi(i,a,t.details)}))}))}))}));function Tf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ik=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,i=Gt({url:Ot(e.remoteURL,It(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Tf(Kt(i,e),(function(o){return Qt(e,o),Tf(o.text(),(function(s){return Tf(Lo(s),(function(a){const l=(function(u,c,p){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some((m=>(m.status||m.propstat?.status).split(" ",3)?.[1]==="507"&&m.href.replace(/\/$/,"").endsWith(It(c).replace(/\/$/,"")))),u.multistatus.response.forEach((m=>{if(m.propstat===void 0)return;const b=m.href.split("/").map(decodeURIComponent).join("/");d.results.push(da(m.propstat.prop,b,p))})),d})(a,t,r);return fi(o,l,r)}))}))}))})),ok=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Gt({url:Ot(e.remoteURL,It(t)),method:"MOVE",headers:{Destination:Ot(e.remoteURL,It(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Qt(e,a)},(o=Kt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s}));var sk=yt(172);const ak=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:i=!0,overwrite:o=!0}=r,s={"Content-Type":"application/octet-stream"};i===!1||(s["Content-Length"]=typeof i=="number"?`${i}`:`${(function(c){if(Fy(c))return c.byteLength;if(_y(c))return c.length;if(typeof c=="string")return(0,sk.d)(c);throw new dn({info:{code:xr.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(n)}`),o||(s["If-None-Match"]="*");const a=Gt({url:Ot(e.remoteURL,It(t)),method:"PUT",headers:s,data:n},e,r);return u=function(c){try{Qt(e,c)}catch(p){const d=p;if(d.status!==412||o)throw d;return!1}return!0},(l=Kt(a,e))&&l.then||(l=Promise.resolve(l)),u?l.then(u):l;var l,u})),tv=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Gt({url:Ot(e.remoteURL,It(t)),method:"OPTIONS"},e,n);return o=function(s){try{Qt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map((a=>a.trim())),server:s.headers.get("Server")??""}},(i=Kt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}));function $o(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const lk=Af((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new dn({info:{code:xr.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`},a=Gt({url:Ot(e.remoteURL,It(t)),method:"PUT",headers:s,data:i},e,o);return $o(Kt(a,e),(function(l){Qt(e,l)}))}));function nv(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const ck=Af((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new dn({info:{code:xr.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`},a=Gt({url:Ot(e.remoteURL,It(t)),method:"PATCH",headers:s,data:i},e,o);return $o(Kt(a,e),(function(l){Qt(e,l)}))}));function Af(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const uk=Af((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return $o(tv(e,t,o),(function(s){let a=!1;return nv((function(){if(s.compliance.includes("sabredav-partialupdate"))return $o(ck(e,t,n,r,i,o),(function(l){return a=!0,l}))}),(function(l){let u=!1;return a?l:nv((function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return $o(lk(e,t,n,r,i,o),(function(c){return u=!0,c}))}),(function(c){if(u)return c;throw new dn({info:{code:xr.NotSupported}},"Not supported")}))}))}))})),fk="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function dk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:i=fk,ha1:o,headers:s={},httpAgent:a,httpsAgent:l,password:u,token:c,username:p,withCredentials:d}=t;let m=n;m||(m=p||u?pn.Password:pn.None);const b={authType:m,remoteBasePath:r,contactHref:i,ha1:o,headers:Object.assign({},s),httpAgent:a,httpsAgent:l,password:u,remotePath:eC(e),remoteURL:e,token:c,username:p,withCredentials:d};return Cy(b,p,u,c,o),{copyFile:(w,S,y)=>MC(b,w,S,y),createDirectory:(w,S)=>vf(b,w,S),createReadStream:(w,S)=>(function(y,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const h=new(Jy()).PassThrough;return qC(y,g,v).then((E=>{E.pipe(h)})).catch((E=>{h.emit("error",E)})),h})(b,w,S),createWriteStream:(w,S,y)=>(function(g,v){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:zC;const T=new(Jy()).PassThrough,R={};h.overwrite===!1&&(R["If-None-Match"]="*");const x=Gt({url:Ot(g.remoteURL,It(v)),method:"PUT",headers:R,data:T,maxRedirects:0},g,h);return Kt(x,g).then((A=>Qt(g,A))).then((A=>{setTimeout((()=>{E(A)}),0)})).catch((A=>{T.emit("error",A)})),T})(b,w,S,y),customRequest:(w,S)=>WC(b,w,S),deleteFile:(w,S)=>HC(b,w,S),exists:(w,S)=>KC(b,w,S),getDirectoryContents:(w,S)=>GC(b,w,S),getFileContents:(w,S)=>YC(b,w,S),getFileDownloadLink:w=>(function(S,y){let g=Ot(S.remoteURL,It(y));const v=/^https:/i.test(g)?"https":"http";switch(S.authType){case pn.None:break;case pn.Password:{const h=xy(S.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new dn({info:{code:xr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${S.authType}`)}return g})(b,w),getFileUploadLink:w=>(function(S,y){let g=`${Ot(S.remoteURL,It(y))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(g)?"https":"http";switch(S.authType){case pn.None:break;case pn.Password:{const h=xy(S.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new dn({info:{code:xr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${S.authType}`)}return g})(b,w),getHeaders:()=>Object.assign({},b.headers),getQuota:w=>rk(b,w),lock:(w,S)=>tk(b,w,S),moveFile:(w,S,y)=>ok(b,w,S,y),putFileContents:(w,S,y)=>ak(b,w,S,y),partialUpdateFileContents:(w,S,y,g,v)=>uk(b,w,S,y,g,v),getDAVCompliance:w=>tv(b,w),search:(w,S)=>ik(b,w,S),setHeaders:w=>{b.headers=Object.assign({},w)},stat:(w,S)=>yf(b,w,S),unlock:(w,S,y)=>ek(b,w,S,y)}}Nn.hT,Nn.O4,Nn.Kd,Nn.YK,Nn.UU,Nn.Gu,Nn.ky,Nn.h4,Nn.ch,Nn.hq,Nn.i5;var xf={},Rf={},rv;function Cf(){return rv||(rv=1,(function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+t+"]["+n+"]*",i=new RegExp("^"+r+"$"),o=function(a,l){const u=[];let c=l.exec(a);for(;c;){const p=[];p.startIndex=l.lastIndex-c[0].length;const d=c.length;for(let m=0;m<d;m++)p.push(c[m]);u.push(p),c=l.exec(a)}return u},s=function(a){const l=i.exec(a);return!(l===null||typeof l>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,l,u){if(l){const c=Object.keys(l),p=c.length;for(let d=0;d<p;d++)u==="strict"?a[c[d]]=[l[c[d]]]:a[c[d]]=l[c[d]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=o,e.nameRegexp=r})(Rf)),Rf}var iv;function ov(){if(iv)return xf;iv=1;const e=Cf(),t={allowBooleanAttributes:!1,unpairedTags:[]};xf.validate=function(y,g){g=Object.assign({},t,g);const v=[];let h=!1,E=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let T=0;T<y.length;T++)if(y[T]==="<"&&y[T+1]==="?"){if(T+=2,T=r(y,T),T.err)return T}else if(y[T]==="<"){let R=T;if(T++,y[T]==="!"){T=i(y,T);continue}else{let x=!1;y[T]==="/"&&(x=!0,T++);let A="";for(;T<y.length&&y[T]!==">"&&y[T]!==" "&&y[T]!==" "&&y[T]!==`
35
- `&&y[T]!=="\r";T++)A+=y[T];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),T--),!b(A)){let O;return A.trim().length===0?O="Invalid space after '<'.":O="Tag '"+A+"' is an invalid name.",d("InvalidTag",O,w(y,T))}const N=a(y,T);if(N===!1)return d("InvalidAttr","Attributes for '"+A+"' have open quote.",w(y,T));let W=N.value;if(T=N.index,W[W.length-1]==="/"){const O=T-W.length;W=W.substring(0,W.length-1);const D=u(W,g);if(D===!0)h=!0;else return d(D.err.code,D.err.msg,w(y,O+D.err.line))}else if(x)if(N.tagClosed){if(W.trim().length>0)return d("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",w(y,R));if(v.length===0)return d("InvalidTag","Closing tag '"+A+"' has not been opened.",w(y,R));{const O=v.pop();if(A!==O.tagName){let D=w(y,O.tagStartPos);return d("InvalidTag","Expected closing tag '"+O.tagName+"' (opened in line "+D.line+", col "+D.col+") instead of closing tag '"+A+"'.",w(y,R))}v.length==0&&(E=!0)}}else return d("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",w(y,T));else{const O=u(W,g);if(O!==!0)return d(O.err.code,O.err.msg,w(y,T-W.length+O.err.line));if(E===!0)return d("InvalidXml","Multiple possible root nodes found.",w(y,T));g.unpairedTags.indexOf(A)!==-1||v.push({tagName:A,tagStartPos:R}),h=!0}for(T++;T<y.length;T++)if(y[T]==="<")if(y[T+1]==="!"){T++,T=i(y,T);continue}else if(y[T+1]==="?"){if(T=r(y,++T),T.err)return T}else break;else if(y[T]==="&"){const O=p(y,T);if(O==-1)return d("InvalidChar","char '&' is not expected.",w(y,T));T=O}else if(E===!0&&!n(y[T]))return d("InvalidXml","Extra text at the end",w(y,T));y[T]==="<"&&T--}}else{if(n(y[T]))continue;return d("InvalidChar","char '"+y[T]+"' is not expected.",w(y,T))}if(h){if(v.length==1)return d("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",w(y,v[0].tagStartPos));if(v.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(v.map(T=>T.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function n(y){return y===" "||y===" "||y===`
36
- `||y==="\r"}function r(y,g){const v=g;for(;g<y.length;g++)if(y[g]=="?"||y[g]==" "){const h=y.substr(v,g-v);if(g>5&&h==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",w(y,g));if(y[g]=="?"&&y[g+1]==">"){g++;break}else continue}return g}function i(y,g){if(y.length>g+5&&y[g+1]==="-"&&y[g+2]==="-"){for(g+=3;g<y.length;g++)if(y[g]==="-"&&y[g+1]==="-"&&y[g+2]===">"){g+=2;break}}else if(y.length>g+8&&y[g+1]==="D"&&y[g+2]==="O"&&y[g+3]==="C"&&y[g+4]==="T"&&y[g+5]==="Y"&&y[g+6]==="P"&&y[g+7]==="E"){let v=1;for(g+=8;g<y.length;g++)if(y[g]==="<")v++;else if(y[g]===">"&&(v--,v===0))break}else if(y.length>g+9&&y[g+1]==="["&&y[g+2]==="C"&&y[g+3]==="D"&&y[g+4]==="A"&&y[g+5]==="T"&&y[g+6]==="A"&&y[g+7]==="["){for(g+=8;g<y.length;g++)if(y[g]==="]"&&y[g+1]==="]"&&y[g+2]===">"){g+=2;break}}return g}const o='"',s="'";function a(y,g){let v="",h="",E=!1;for(;g<y.length;g++){if(y[g]===o||y[g]===s)h===""?h=y[g]:h!==y[g]||(h="");else if(y[g]===">"&&h===""){E=!0;break}v+=y[g]}return h!==""?!1:{value:v,index:g,tagClosed:E}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(y,g){const v=e.getAllMatches(y,l),h={};for(let E=0;E<v.length;E++){if(v[E][1].length===0)return d("InvalidAttr","Attribute '"+v[E][2]+"' has no space in starting.",S(v[E]));if(v[E][3]!==void 0&&v[E][4]===void 0)return d("InvalidAttr","Attribute '"+v[E][2]+"' is without value.",S(v[E]));if(v[E][3]===void 0&&!g.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+v[E][2]+"' is not allowed.",S(v[E]));const T=v[E][2];if(!m(T))return d("InvalidAttr","Attribute '"+T+"' is an invalid name.",S(v[E]));if(!h.hasOwnProperty(T))h[T]=1;else return d("InvalidAttr","Attribute '"+T+"' is repeated.",S(v[E]))}return!0}function c(y,g){let v=/\d/;for(y[g]==="x"&&(g++,v=/[\da-fA-F]/);g<y.length;g++){if(y[g]===";")return g;if(!y[g].match(v))break}return-1}function p(y,g){if(g++,y[g]===";")return-1;if(y[g]==="#")return g++,c(y,g);let v=0;for(;g<y.length;g++,v++)if(!(y[g].match(/\w/)&&v<20)){if(y[g]===";")break;return-1}return g}function d(y,g,v){return{err:{code:y,msg:g,line:v.line||v,col:v.col}}}function m(y){return e.isName(y)}function b(y){return e.isName(y)}function w(y,g){const v=y.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function S(y){return y.startIndex+y[1].length}return xf}var ha={},sv;function pk(){if(sv)return ha;sv=1;const e={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,r){return r},attributeValueProcessor:function(n,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,r,i){return n}},t=function(n){return Object.assign({},e,n)};return ha.buildOptions=t,ha.defaultOptions=e,ha}var kf,av;function hk(){if(av)return kf;av=1;class e{constructor(n){this.tagname=n,this.child=[],this[":@"]={}}add(n,r){n==="__proto__"&&(n="#__proto__"),this.child.push({[n]:r})}addChild(n){n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0?this.child.push({[n.tagname]:n.child,":@":n[":@"]}):this.child.push({[n.tagname]:n.child})}}return kf=e,kf}var Pf,lv;function mk(){if(lv)return Pf;lv=1;const e=Cf();function t(u,c){const p={};if(u[c+3]==="O"&&u[c+4]==="C"&&u[c+5]==="T"&&u[c+6]==="Y"&&u[c+7]==="P"&&u[c+8]==="E"){c=c+9;let d=1,m=!1,b=!1,w="";for(;c<u.length;c++)if(u[c]==="<"&&!b){if(m&&i(u,c)){c+=7;let S,y;[S,y,c]=n(u,c+1),y.indexOf("&")===-1&&(p[l(S)]={regx:RegExp(`&${S};`,"g"),val:y})}else if(m&&o(u,c))c+=8;else if(m&&s(u,c))c+=8;else if(m&&a(u,c))c+=9;else if(r)b=!0;else throw new Error("Invalid DOCTYPE");d++,w=""}else if(u[c]===">"){if(b?u[c-1]==="-"&&u[c-2]==="-"&&(b=!1,d--):d--,d===0)break}else u[c]==="["?m=!0:w+=u[c];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:p,i:c}}function n(u,c){let p="";for(;c<u.length&&u[c]!=="'"&&u[c]!=='"';c++)p+=u[c];if(p=p.trim(),p.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[c++];let m="";for(;c<u.length&&u[c]!==d;c++)m+=u[c];return[p,m,c]}function r(u,c){return u[c+1]==="!"&&u[c+2]==="-"&&u[c+3]==="-"}function i(u,c){return u[c+1]==="!"&&u[c+2]==="E"&&u[c+3]==="N"&&u[c+4]==="T"&&u[c+5]==="I"&&u[c+6]==="T"&&u[c+7]==="Y"}function o(u,c){return u[c+1]==="!"&&u[c+2]==="E"&&u[c+3]==="L"&&u[c+4]==="E"&&u[c+5]==="M"&&u[c+6]==="E"&&u[c+7]==="N"&&u[c+8]==="T"}function s(u,c){return u[c+1]==="!"&&u[c+2]==="A"&&u[c+3]==="T"&&u[c+4]==="T"&&u[c+5]==="L"&&u[c+6]==="I"&&u[c+7]==="S"&&u[c+8]==="T"}function a(u,c){return u[c+1]==="!"&&u[c+2]==="N"&&u[c+3]==="O"&&u[c+4]==="T"&&u[c+5]==="A"&&u[c+6]==="T"&&u[c+7]==="I"&&u[c+8]==="O"&&u[c+9]==="N"}function l(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return Pf=t,Pf}var If,cv;function gk(){if(cv)return If;cv=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function r(s,a={}){if(a=Object.assign({},n,a),!s||typeof s!="string")return s;let l=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(l))return s;if(s==="0")return 0;if(a.hex&&e.test(l))return o(l,16);if(l.search(/[eE]/)!==-1){const u=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(a.leadingZeros)l=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return a.eNotation?Number(l):s}else return s}else{const u=t.exec(l);if(u){const c=u[1],p=u[2];let d=i(u[3]);if(!a.leadingZeros&&p.length>0&&c&&l[2]!==".")return s;if(!a.leadingZeros&&p.length>0&&!c&&l[1]!==".")return s;if(a.leadingZeros&&p===s)return 0;{const m=Number(l),b=""+m;return b.search(/[eE]/)!==-1?a.eNotation?m:s:l.indexOf(".")!==-1?b==="0"&&d===""||b===d||c&&b==="-"+d?m:s:p?d===b||c+d===b?m:s:l===b||l===c+b?m:s}}else return s}}function i(s){return s&&s.indexOf(".")!==-1&&(s=s.replace(/0+$/,""),s==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substr(0,s.length-1))),s}function o(s,a){if(parseInt)return parseInt(s,a);if(Number.parseInt)return Number.parseInt(s,a);if(window&&window.parseInt)return window.parseInt(s,a);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}return If=r,If}var Of,uv;function fv(){if(uv)return Of;uv=1;function e(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}return Of=e,Of}var Ff,dv;function yk(){if(dv)return Ff;dv=1;const e=Cf(),t=hk(),n=mk(),r=gk(),i=fv();class o{constructor(T){this.options=T,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,x)=>String.fromCharCode(Number.parseInt(x,16))}},this.addExternalEntities=s,this.parseXml=p,this.parseTextData=a,this.resolveNameSpace=l,this.buildAttributesMap=c,this.isItStopNode=w,this.replaceEntitiesValue=m,this.readStopNodeData=v,this.saveTextToParentTag=b,this.addChild=d,this.ignoreAttributesFn=i(this.options.ignoreAttributes)}}function s(E){const T=Object.keys(E);for(let R=0;R<T.length;R++){const x=T[R];this.lastEntities[x]={regex:new RegExp("&"+x+";","g"),val:E[x]}}}function a(E,T,R,x,A,N,W){if(E!==void 0&&(this.options.trimValues&&!x&&(E=E.trim()),E.length>0)){W||(E=this.replaceEntitiesValue(E));const O=this.options.tagValueProcessor(T,E,R,A,N);return O==null?E:typeof O!=typeof E||O!==E?O:this.options.trimValues?h(E,this.options.parseTagValue,this.options.numberParseOptions):E.trim()===E?h(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function l(E){if(this.options.removeNSPrefix){const T=E.split(":"),R=E.charAt(0)==="/"?"/":"";if(T[0]==="xmlns")return"";T.length===2&&(E=R+T[1])}return E}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function c(E,T,R){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const x=e.getAllMatches(E,u),A=x.length,N={};for(let W=0;W<A;W++){const O=this.resolveNameSpace(x[W][1]);if(this.ignoreAttributesFn(O,T))continue;let D=x[W][4],V=this.options.attributeNamePrefix+O;if(O.length)if(this.options.transformAttributeName&&(V=this.options.transformAttributeName(V)),V==="__proto__"&&(V="#__proto__"),D!==void 0){this.options.trimValues&&(D=D.trim()),D=this.replaceEntitiesValue(D);const L=this.options.attributeValueProcessor(O,D,T);L==null?N[V]=D:typeof L!=typeof D||L!==D?N[V]=L:N[V]=h(D,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(N[V]=!0)}if(!Object.keys(N).length)return;if(this.options.attributesGroupName){const W={};return W[this.options.attributesGroupName]=N,W}return N}}const p=function(E){E=E.replace(/\r\n?/g,`
37
- `);const T=new t("!xml");let R=T,x="",A="";for(let N=0;N<E.length;N++)if(E[N]==="<")if(E[N+1]==="/"){const O=y(E,">",N,"Closing Tag is not closed.");let D=E.substring(N+2,O).trim();if(this.options.removeNSPrefix){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),R&&(x=this.saveTextToParentTag(x,R,A));const V=A.substring(A.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let L=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(L=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):L=A.lastIndexOf("."),A=A.substring(0,L),R=this.tagsNodeStack.pop(),x="",N=O}else if(E[N+1]==="?"){let O=g(E,N,!1,"?>");if(!O)throw new Error("Pi Tag is not closed.");if(x=this.saveTextToParentTag(x,R,A),!(this.options.ignoreDeclaration&&O.tagName==="?xml"||this.options.ignorePiTags)){const D=new t(O.tagName);D.add(this.options.textNodeName,""),O.tagName!==O.tagExp&&O.attrExpPresent&&(D[":@"]=this.buildAttributesMap(O.tagExp,A,O.tagName)),this.addChild(R,D,A)}N=O.closeIndex+1}else if(E.substr(N+1,3)==="!--"){const O=y(E,"-->",N+4,"Comment is not closed.");if(this.options.commentPropName){const D=E.substring(N+4,O-2);x=this.saveTextToParentTag(x,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}N=O}else if(E.substr(N+1,2)==="!D"){const O=n(E,N);this.docTypeEntities=O.entities,N=O.i}else if(E.substr(N+1,2)==="!["){const O=y(E,"]]>",N,"CDATA is not closed.")-2,D=E.substring(N+9,O);x=this.saveTextToParentTag(x,R,A);let V=this.parseTextData(D,R.tagname,A,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):R.add(this.options.textNodeName,V),N=O+2}else{let O=g(E,N,this.options.removeNSPrefix),D=O.tagName;const V=O.rawTagName;let L=O.tagExp,te=O.attrExpPresent,Y=O.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),R&&x&&R.tagname!=="!xml"&&(x=this.saveTextToParentTag(x,R,A,!1));const se=R;if(se&&this.options.unpairedTags.indexOf(se.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),D!==T.tagname&&(A+=A?"."+D:D),this.isItStopNode(this.options.stopNodes,A,D)){let he="";if(L.length>0&&L.lastIndexOf("/")===L.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),A=A.substr(0,A.length-1),L=D):L=L.substr(0,L.length-1),N=O.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)N=O.closeIndex;else{const we=this.readStopNodeData(E,V,Y+1);if(!we)throw new Error(`Unexpected end of ${V}`);N=we.i,he=we.tagContent}const ae=new t(D);D!==L&&te&&(ae[":@"]=this.buildAttributesMap(L,A,D)),he&&(he=this.parseTextData(he,D,A,!0,te,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),ae.add(this.options.textNodeName,he),this.addChild(R,ae,A)}else{if(L.length>0&&L.lastIndexOf("/")===L.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),A=A.substr(0,A.length-1),L=D):L=L.substr(0,L.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const he=new t(D);D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,A,D)),this.addChild(R,he,A),A=A.substr(0,A.lastIndexOf("."))}else{const he=new t(D);this.tagsNodeStack.push(R),D!==L&&te&&(he[":@"]=this.buildAttributesMap(L,A,D)),this.addChild(R,he,A),R=he}x="",N=Y}}else x+=E[N];return T.child};function d(E,T,R){const x=this.options.updateTag(T.tagname,R,T[":@"]);x===!1||(typeof x=="string"&&(T.tagname=x),E.addChild(T))}const m=function(E){if(this.options.processEntities){for(let T in this.docTypeEntities){const R=this.docTypeEntities[T];E=E.replace(R.regx,R.val)}for(let T in this.lastEntities){const R=this.lastEntities[T];E=E.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let T in this.htmlEntities){const R=this.htmlEntities[T];E=E.replace(R.regex,R.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function b(E,T,R,x){return E&&(x===void 0&&(x=T.child.length===0),E=this.parseTextData(E,T.tagname,R,!1,T[":@"]?Object.keys(T[":@"]).length!==0:!1,x),E!==void 0&&E!==""&&T.add(this.options.textNodeName,E),E=""),E}function w(E,T,R){const x="*."+R;for(const A in E){const N=E[A];if(x===N||T===N)return!0}return!1}function S(E,T,R=">"){let x,A="";for(let N=T;N<E.length;N++){let W=E[N];if(x)W===x&&(x="");else if(W==='"'||W==="'")x=W;else if(W===R[0])if(R[1]){if(E[N+1]===R[1])return{data:A,index:N}}else return{data:A,index:N};else W===" "&&(W=" ");A+=W}}function y(E,T,R,x){const A=E.indexOf(T,R);if(A===-1)throw new Error(x);return A+T.length-1}function g(E,T,R,x=">"){const A=S(E,T+1,x);if(!A)return;let N=A.data;const W=A.index,O=N.search(/\s/);let D=N,V=!0;O!==-1&&(D=N.substring(0,O),N=N.substring(O+1).trimStart());const L=D;if(R){const te=D.indexOf(":");te!==-1&&(D=D.substr(te+1),V=D!==A.data.substr(te+1))}return{tagName:D,tagExp:N,closeIndex:W,attrExpPresent:V,rawTagName:L}}function v(E,T,R){const x=R;let A=1;for(;R<E.length;R++)if(E[R]==="<")if(E[R+1]==="/"){const N=y(E,">",R,`${T} is not closed`);if(E.substring(R+2,N).trim()===T&&(A--,A===0))return{tagContent:E.substring(x,R),i:N};R=N}else if(E[R+1]==="?")R=y(E,"?>",R+1,"StopNode is not closed.");else if(E.substr(R+1,3)==="!--")R=y(E,"-->",R+3,"StopNode is not closed.");else if(E.substr(R+1,2)==="![")R=y(E,"]]>",R,"StopNode is not closed.")-2;else{const N=g(E,R,">");N&&((N&&N.tagName)===T&&N.tagExp[N.tagExp.length-1]!=="/"&&A++,R=N.closeIndex)}}function h(E,T,R){if(T&&typeof E=="string"){const x=E.trim();return x==="true"?!0:x==="false"?!1:r(E,R)}else return e.isExist(E)?E:""}return Ff=o,Ff}var _f={},pv;function vk(){if(pv)return _f;pv=1;function e(o,s){return t(o,s)}function t(o,s,a){let l;const u={};for(let c=0;c<o.length;c++){const p=o[c],d=n(p);let m="";if(a===void 0?m=d:m=a+"."+d,d===s.textNodeName)l===void 0?l=p[d]:l+=""+p[d];else{if(d===void 0)continue;if(p[d]){let b=t(p[d],s,m);const w=i(b,s);p[":@"]?r(b,p[":@"],m,s):Object.keys(b).length===1&&b[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?b=b[s.textNodeName]:Object.keys(b).length===0&&(s.alwaysCreateTextNode?b[s.textNodeName]="":b=""),u[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(b)):s.isArray(d,m,w)?u[d]=[b]:u[d]=b}}}return typeof l=="string"?l.length>0&&(u[s.textNodeName]=l):l!==void 0&&(u[s.textNodeName]=l),u}function n(o){const s=Object.keys(o);for(let a=0;a<s.length;a++){const l=s[a];if(l!==":@")return l}}function r(o,s,a,l){if(s){const u=Object.keys(s),c=u.length;for(let p=0;p<c;p++){const d=u[p];l.isArray(d,a+"."+d,!0,!0)?o[d]=[s[d]]:o[d]=s[d]}}}function i(o,s){const{textNodeName:a}=s,l=Object.keys(o).length;return!!(l===0||l===1&&(o[a]||typeof o[a]=="boolean"||o[a]===0))}return _f.prettify=e,_f}var Df,hv;function bk(){if(hv)return Df;hv=1;const{buildOptions:e}=pk(),t=yk(),{prettify:n}=vk(),r=ov();class i{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 '&#xD;'");if(a==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[s]=a}}return Df=i,Df}var Nf,mv;function wk(){if(mv)return Nf;mv=1;const e=`
38
- `;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 p="",d=!1;for(let m=0;m<a.length;m++){const b=a[m],w=r(b);if(w===void 0)continue;let S="";if(u.length===0?S=w:S=`${u}.${w}`,w===l.textNodeName){let E=b[w];o(S,l)||(E=l.tagValueProcessor(w,E),E=s(E,l)),d&&(p+=c),p+=E,d=!1;continue}else if(w===l.cdataPropName){d&&(p+=c),p+=`<![CDATA[${b[w][0][l.textNodeName]}]]>`,d=!1;continue}else if(w===l.commentPropName){p+=c+`<!--${b[w][0][l.textNodeName]}-->`,d=!0;continue}else if(w[0]==="?"){const E=i(b[":@"],l),T=w==="?xml"?"":c;let R=b[w][0][l.textNodeName];R=R.length!==0?" "+R:"",p+=T+`<${w}${R}${E}?>`,d=!0;continue}let y=c;y!==""&&(y+=l.indentBy);const g=i(b[":@"],l),v=c+`<${w}${g}`,h=n(b[w],l,S,y);l.unpairedTags.indexOf(w)!==-1?l.suppressUnpairedNode?p+=v+">":p+=v+"/>":(!h||h.length===0)&&l.suppressEmptyNode?p+=v+"/>":h&&h.endsWith(">")?p+=v+`>${h}${c}</${w}>`:(p+=v+">",h&&c!==""&&(h.includes("/>")||h.includes("</"))?p+=c+l.indentBy+h+c:p+=h,p+=`</${w}>`),d=!0}return p}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 i(a,l){let u="";if(a&&!l.ignoreAttributes)for(let c in a){if(!a.hasOwnProperty(c))continue;let p=l.attributeValueProcessor(c,a[c]);p=s(p,l),p===!0&&l.suppressBooleanAttributes?u+=` ${c.substr(l.attributeNamePrefix.length)}`:u+=` ${c.substr(l.attributeNamePrefix.length)}="${p}"`}return u}function o(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 Nf=t,Nf}var Lf,gv;function Sk(){if(gv)return Lf;gv=1;const e=wk(),t=fv(),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:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],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=i,this.options.format?(this.indentate=o,this.tagEndChar=`>
39
- `,this.newLine=`
40
- `):(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="",p="";const d=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(p+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?p+="":m[0]==="?"?p+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:p+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)p+=this.buildTextValNode(a[m],m,"",l);else if(typeof a[m]!="object"){const b=this.isAttribute(m);if(b&&!this.ignoreAttributesFn(b,d))c+=this.buildAttrPairStr(b,""+a[m]);else if(!b)if(m===this.options.textNodeName){let w=this.options.tagValueProcessor(m,""+a[m]);p+=this.replaceEntitiesValue(w)}else p+=this.buildTextValNode(a[m],m,"",l)}else if(Array.isArray(a[m])){const b=a[m].length;let w="",S="";for(let y=0;y<b;y++){const g=a[m][y];if(!(typeof g>"u"))if(g===null)m[0]==="?"?p+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:p+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const v=this.j2x(g,l+1,u.concat(m));w+=v.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(S+=v.attrStr)}else w+=this.processTextOrObjNode(g,m,l,u);else if(this.options.oneListGroup){let v=this.options.tagValueProcessor(m,g);v=this.replaceEntitiesValue(v),w+=v}else w+=this.buildTextValNode(g,m,"",l)}this.options.oneListGroup&&(w=this.buildObjectNode(w,m,S,l)),p+=w}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const b=Object.keys(a[m]),w=b.length;for(let S=0;S<w;S++)c+=this.buildAttrPairStr(b[S],""+a[m][b[S]])}else p+=this.processTextOrObjNode(a[m],m,l,u);return{attrStr:c,val:p}},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 i(a,l,u,c){const p=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,p.attrStr,u):this.buildObjectNode(p.val,l,p.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 p="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",p=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(c)+"<"+l+u+d+">"+a+p: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)+p}},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 p=this.options.tagValueProcessor(l,a);return p=this.replaceEntitiesValue(p),p===""?this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar:this.indentate(c)+"<"+l+u+">"+p+"</"+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 o(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 Lf=r,Lf}var $f,yv;function Ek(){if(yv)return $f;yv=1;const e=ov(),t=bk(),n=Sk();return $f={XMLParser:t,XMLValidator:e,XMLBuilder:n},$f}Ek();class vv{isEnabled(){return!0}isActive(t){return xt(t,"files-spaces-projects")?!1:xt(t,"files-spaces-generic")||_n(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:i,authService:o,spacesStore:s,sharesStore:a,configStore:l}=t,{webdav:u,graphAuthenticated:c}=r,{replaceInvalidFileRoute:p}=Ta({router:n});return rn.useTask(function*(d,m,b,w=null,S=null,y={}){try{i.clearResourceList();const g=ko.Default;re.isPublicSpaceResource(b)&&g.push(Ve.DownloadURL);let{resource:v,children:h}=yield*re.call(u.listFiles(b,{path:w,fileId:S},{signal:d,davProperties:g}));v.id&&p({space:b,resource:v,path:w,fileId:S});let E;w==="/"&&(re.isShareSpaceResource(b)?(E=yield*re.call(Ks({graphClient:c,spacesStore:s,space:b,signal:d})),E&&(v=re.buildIncomingShareResource({graphRoles:a.graphRoles,driveItem:E,serverUrl:l.serverUrl}))):!re.isPersonalSpaceResource(b)&&!re.isPublicSpaceResource(b)&&(v=b)),yield i.loadAncestorMetaData({folder:v,space:b,client:u,signal:d}),re.isProjectSpaceResource(b)&&(yield s.loadGraphPermissions({ids:[b.id],graphClient:c})),re.isShareSpaceResource(b)&&(h.forEach(T=>T.remoteItemId=b.id),b.graphPermissions===void 0&&(E||(E=yield*re.call(Ks({graphClient:c,spacesStore:s,space:b,signal:d}))),cm({sharesStore:a,spacesStore:s,space:b,sharedDriveItem:E}))),i.initResourceList({currentFolder:v,resources:h})}catch(g){if(i.setCurrentFolder(null),console.error(g),g.statusCode===401)return o.handleAuthError(f(n.currentRoute))}}).restartable()}}class bv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Vt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:i}=t;return rn.useTask(function*(o,s){n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:i.user?.onPremisesSamAccountName,signal:o});a=a.map(re.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class wv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Mt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:i,configStore:o,resourcesStore:s}=t;return rn.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*re.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(p=>p.permissions.some(({link:d})=>!!d)).map(p=>re.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Sv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Mt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:i,resourcesStore:o,sharesStore:s}=t;return rn.useTask(function*(a,l){o.clearResourceList(),o.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const c=(yield*re.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:a}))).map(p=>re.buildIncomingShareResource({driveItem:p,graphRoles:s.graphRoles,serverUrl:i.serverUrl}));o.initResourceList({currentFolder:null,resources:c})})}}class Ev{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Mt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:i,configStore:o,resourcesStore:s}=t;return rn.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*re.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(p=>p.permissions.some(({link:d})=>!d)).map(p=>re.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Tv{isEnabled(){return!0}isActive(t){return yn(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:i,graphAuthenticated:o}}=t;return rn.useTask(function*(s,a,l){n.clearResourceList(),n.setAncestorMetaData({});const{resource:u,children:c}=yield i.listFiles(l,{},{depth:1,davProperties:ko.Trashbin,isTrash:!0,signal:s});re.isProjectSpaceResource(l)&&(yield r.loadGraphPermissions({ids:[l.id],graphClient:o})),n.initResourceList({currentFolder:u,resources:c})})}}class Av{loaders;constructor(){this.loaders=[new vv,new bv,new wv,new Sv,new Ev,new Tv]}getTask(){const t=vt(),n=at(),r=en(),i=He(),o=Ke(),s=dt(),a=ze(),l=Cr(),u=Jf(),c=this.loaders.find(p=>p.isEnabled()&&p.isActive(f(i)));if(!c){console.debug("No folder loader found for route");return}return rn.useTask(function*(...p){const d={clientService:o,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:l,router:i,authService:u};try{yield c.getTask(d).perform(...p)}catch(m){console.error(m)}})}}const xv=new Av;var Gr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Gr||{});const Tk=200;class Ak{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,i)=>(r+=i.state.current/i.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=Tk,indeterminate:r=!0}={}){const i={id:Xt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(i),Tt.debounce(()=>{i.active=!0,Je.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:l})=>{r||this.setProgress({task:i,total:a,current:l})}}).finally(()=>{this.removeTask(i.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Je.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,Je.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var xk="__lodash_hash_undefined__";function Rk(e){return this.__data__.set(e,xk),this}function Ck(e){return this.__data__.has(e)}function ma(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Tr;++t<n;)this.add(e[t])}ma.prototype.add=ma.prototype.push=Rk,ma.prototype.has=Ck;function kk(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 Pk(e,t){return e.has(t)}var Ik=1,Ok=2;function Rv(e,t,n,r,i,o){var s=n&Ik,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var p=-1,d=!0,m=n&Ok?new ma:void 0;for(o.set(e,t),o.set(t,e);++p<a;){var b=e[p],w=t[p];if(r)var S=s?r(w,b,p,t,e,o):r(b,w,p,e,t,o);if(S!==void 0){if(S)continue;d=!1;break}if(m){if(!kk(t,function(y,g){if(!Pk(m,g)&&(b===y||i(b,y,n,r,o)))return m.push(g)})){d=!1;break}}else if(!(b===w||i(b,w,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function Fk(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function _k(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Dk=1,Nk=2,Lk="[object Boolean]",$k="[object Date]",Mk="[object Error]",Bk="[object Map]",jk="[object Number]",Uk="[object RegExp]",Vk="[object Set]",qk="[object String]",zk="[object Symbol]",Wk="[object ArrayBuffer]",Hk="[object DataView]",Cv=On?On.prototype:void 0,Mf=Cv?Cv.valueOf:void 0;function Kk(e,t,n,r,i,o,s){switch(n){case Hk:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wk:return!(e.byteLength!=t.byteLength||!o(new qs(e),new qs(t)));case Lk:case $k:case jk:return So(+e,+t);case Mk:return e.name==t.name&&e.message==t.message;case Uk:case qk:return e==t+"";case Bk:var a=Fk;case Vk:var l=r&Dk;if(a||(a=_k),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=Nk,s.set(e,t);var c=Rv(a(e),a(t),r,i,o,s);return s.delete(e),c;case zk:if(Mf)return Mf.call(e)==Mf.call(t)}return!1}function Bf(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function kv(e,t,n){var r=t(e);return Hn(e)?r:Bf(r,n(e))}function Gk(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Pv(){return[]}var Qk=Object.prototype,Xk=Qk.propertyIsEnumerable,Iv=Object.getOwnPropertySymbols,Ov=Iv?function(e){return e==null?[]:(e=Object(e),Gk(Iv(e),function(t){return Xk.call(e,t)}))}:Pv,Yk=Lh(Object.keys,Object),Jk=Object.prototype,Zk=Jk.hasOwnProperty;function eP(e){if(!Ql(e))return Yk(e);var t=[];for(var n in Object(e))Zk.call(e,n)&&n!="constructor"&&t.push(n);return t}function tP(e){return Ws(e)?Qh(e):eP(e)}function Fv(e){return kv(e,tP,Ov)}var nP=1,rP=Object.prototype,iP=rP.hasOwnProperty;function oP(e,t,n,r,i,o){var s=n&nP,a=Fv(e),l=a.length,u=Fv(t),c=u.length;if(l!=c&&!s)return!1;for(var p=l;p--;){var d=a[p];if(!(s?d in t:iP.call(t,d)))return!1}var m=o.get(e),b=o.get(t);if(m&&b)return m==t&&b==e;var w=!0;o.set(e,t),o.set(t,e);for(var S=s;++p<l;){d=a[p];var y=e[d],g=t[d];if(r)var v=s?r(g,y,d,t,e,o):r(y,g,d,e,t,o);if(!(v===void 0?y===g||i(y,g,n,r,o):v)){w=!1;break}S||(S=d=="constructor")}if(w&&!S){var h=e.constructor,E=t.constructor;h!=E&&"constructor"in e&&"constructor"in t&&!(typeof h=="function"&&h instanceof h&&typeof E=="function"&&E instanceof E)&&(w=!1)}return o.delete(e),o.delete(t),w}var jf=si(nr,"DataView"),Uf=si(nr,"Promise"),Vf=si(nr,"Set"),qf=si(nr,"WeakMap"),_v="[object Map]",sP="[object Object]",Dv="[object Promise]",Nv="[object Set]",Lv="[object WeakMap]",$v="[object DataView]",aP=oi(jf),lP=oi(To),cP=oi(Uf),uP=oi(Vf),fP=oi(qf),Gn=ii;(jf&&Gn(new jf(new ArrayBuffer(1)))!=$v||To&&Gn(new To)!=_v||Uf&&Gn(Uf.resolve())!=Dv||Vf&&Gn(new Vf)!=Nv||qf&&Gn(new qf)!=Lv)&&(Gn=function(e){var t=ii(e),n=t==sP?e.constructor:void 0,r=n?oi(n):"";if(r)switch(r){case aP:return $v;case lP:return _v;case cP:return Dv;case uP:return Nv;case fP:return Lv}return t});var dP=1,Mv="[object Arguments]",Bv="[object Array]",ga="[object Object]",pP=Object.prototype,jv=pP.hasOwnProperty;function hP(e,t,n,r,i,o){var s=Hn(e),a=Hn(t),l=s?Bv:Gn(e),u=a?Bv:Gn(t);l=l==Mv?ga:l,u=u==Mv?ga:u;var c=l==ga,p=u==ga,d=l==u;if(d&&xo(e)){if(!xo(t))return!1;s=!0,c=!1}if(d&&!c)return o||(o=new ir),s||Zl(e)?Rv(e,t,n,r,i,o):Kk(e,t,l,n,r,i,o);if(!(n&dP)){var m=c&&jv.call(e,"__wrapped__"),b=p&&jv.call(t,"__wrapped__");if(m||b){var w=m?e.value():e,S=b?t.value():t;return o||(o=new ir),i(w,S,n,r,o)}}return d?(o||(o=new ir),oP(e,t,n,r,i,o)):!1}function Uv(e,t,n,r,i){return e===t?!0:e==null||t==null||!or(e)&&!or(t)?e!==e&&t!==t:hP(e,t,n,r,Uv,i)}function Vv(e,t){return Uv(e,t)}class mP{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:i}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,i){const{space:o,resource:s}=t;if(!s.canDownload()||!s.hasPreview?.())return;const a=re.isPublicSpaceResource(o);if(!(!a&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(a)return this.publicPreviewUrl(t,i);try{return await this.privatePreviewBlob(t,n,r,i)}catch(l){if(r)return;throw l}}}async cacheFactory(t,n,r){const{resource:i,dimensions:o}=t,s=mc.filePreview.get(i.id.toString());if(s&&s.etag===i.etag&&Vv(o,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return mc.filePreview.set(i.id.toString(),{src:a,etag:i.etag,dimensions:o},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return TS.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,i){const{resource:o,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,i);const l=[this.configStore.serverUrl,"remote.php/dav",dc(o.webDavPath),"?",this.buildQueryString({etag:o.etag,dimensions:s,processor:a})].join("");try{const{data:u}=await this.clientService.httpAuthenticated.get(l,{responseType:"blob",signal:i});return window.URL.createObjectURL(u)}catch(u){if([425,429].includes(u.status)){const c=u.response?.headers?.["retry-after"]||5;return await new Promise(p=>setTimeout(p,c*1e3)),this.privatePreviewBlob(t,n,r,i)}throw u}}async publicPreviewUrl(t,n){const{space:r,resource:i,dimensions:o,processor:s}=t;let{downloadURL:a}=i;if(!a){const{downloadURL:d}=await this.clientService.webdav.getFileInfo(r,i,{davProperties:[Ve.DownloadURL]});a=d}const[l,u]=a.split("?"),c=[this.buildQueryString({etag:i.etag,dimensions:o,processor:s}),u].filter(Boolean).join("&"),p=[l,c].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(p,{signal:n});if(d!==404)return p}catch(d){if([425,429].includes(d.status)){const m=d.response?.headers?.["retry-after"]||5;return await new Promise(b=>setTimeout(b,m*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const ya=de.z.enum(["fit","resize","fill","thumbnail"]);class gP{$gettext;constructor({$gettext:t}){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 yP{$gettext;constructor({$gettext:t}){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(i=>t.characters.includes(i)).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 va{$gettext;constructor({$gettext:t}){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 vP extends va{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 bP extends va{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){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class wP extends va{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){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class SP extends va{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){return(n||"").match(/\d/g)?.length>=t.minLength}}class EP{language;capability;policy;generatePasswordRules;constructor({language:t}){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 vP({...this.language}),mustNotBeEmpty:new gP({...this.language}),atLeastUppercaseCharacters:new bP({...this.language}),atLeastLowercaseCharacters:new wP({...this.language}),atLeastDigits:new SP({...this.language}),mustContain:new yP({...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 AS.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",i="0123456789",o=(m,b)=>{const w=256-256%m.length;let S="",y;for(let g=0;g<b;g++){do y=window.crypto.getRandomValues(new Uint8Array(1))[0];while(y>=w);S+=m[y%m.length]}return S},{minLowercaseCharacters:s,minUppercaseCharacters:a,minDigits:l,minSpecialCharacters:u,length:c}=this.generatePasswordRules;let p="";if(p+=o(t,s),p+=o(n,a),p+=o(i,l),p+=o(r,u),p.length<c){const m=c-p.length,b=t+n+r+i;p+=o(b,m)}return(m=>{const b=m.split(""),w=new Uint32Array(b.length);window.crypto.getRandomValues(w);for(let S=b.length-1;S>0;S--){const y=w[S]%(S+1);[b[S],b[y]]=[b[y],b[S]]}return b.join("")})(p)}}const qv=e=>({name:ft.basename(e),type:"directory",relativePath:e}),zv=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),Wv=async e=>{const t=await new Promise((r,i)=>e.file(r,i));return e.fullPath===re.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},TP=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*AP(e){const t=e.createReader(),n=()=>new Promise((i,o)=>{t.readEntries(i,o)});let r;do{r=await n();for(const i of r)yield i}while(r.length>0)}async function*Hv(e,t){if(e.isDirectory){let n=!1;for await(const r of AP(e))if(r.isDirectory)yield*Hv(r,t);else if(r.isFile)try{n=!0,yield Wv(r)}catch(i){console.error(i),t?.(i)}n||(yield qv(e.fullPath||e.name))}else try{yield Wv(e)}catch(n){console.error(n),t?.(n)}}const xP=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,i=>TP(i)));for(let i=0;i<r.length;i++)for await(const o of Hv(r[i],t))n.push(o);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},RP={target:null,uppyService:null};class CP extends Wd.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...RP,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(o=>{o.type==="acquirer"&&o.handleRootDrop?.(t)});let n=!1;const r=o=>{this.uppy.log(o,"error"),n||(this.uppy.info(o.message,"error"),n=!0)},i=await xP(t.dataTransfer,r);if(i.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const o=zv("DropTarget",i);this.uppyService.addFiles(o)}catch(o){this.uppy.log(o)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=Hd.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class kP{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new Wd({autoProceed:!1,onBeforeFileAdded:(r,i)=>r.id in i&&!i[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),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()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?re.urlJoin(n):void 0};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:i,headers:o}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:o,onBeforeRequest:i,onShouldRetry:(u,c,p,d)=>u?.originalResponse?.getStatus()>=500?!1:u?.originalResponse?.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(xS,s)}useXhr({headers:t,timeout:n,endpoint:r}){const i={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},o=this.uppy.getPlugin("Tus");o&&this.uppy.removePlugin(o);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(i);return}this.uppy.use(RS,i)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(CP,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Je.subscribe(t,n)}unsubscribe(t,n){Je.unsubscribe(t,n)}publish(t,n){Je.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=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[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 i=r.target,o=Array.from(i.files);this.addFiles(o)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return Hd.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}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()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}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 PP(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var IP=Object.getOwnPropertySymbols,OP=IP?function(e){for(var t=[];e;)Bf(t,Ov(e)),e=Gl(e);return t}:Pv;function Kv(e){return kv(e,tc,OP)}var FP=Object.prototype,_P=FP.hasOwnProperty;function DP(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&_P.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function NP(e,t){var n=Kl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var LP=/\w*$/;function $P(e){var t=new e.constructor(e.source,LP.exec(e));return t.lastIndex=e.lastIndex,t}var Gv=On?On.prototype:void 0,Qv=Gv?Gv.valueOf:void 0;function MP(e){return Qv?Object(Qv.call(e)):{}}var BP="[object Boolean]",jP="[object Date]",UP="[object Map]",VP="[object Number]",qP="[object RegExp]",zP="[object Set]",WP="[object String]",HP="[object Symbol]",KP="[object ArrayBuffer]",GP="[object DataView]",QP="[object Float32Array]",XP="[object Float64Array]",YP="[object Int8Array]",JP="[object Int16Array]",ZP="[object Int32Array]",eI="[object Uint8Array]",tI="[object Uint8ClampedArray]",nI="[object Uint16Array]",rI="[object Uint32Array]";function iI(e,t,n){var r=e.constructor;switch(t){case KP:return Kl(e);case BP:case jP:return new r(+e);case GP:return NP(e);case QP:case XP:case YP:case JP:case ZP:case eI:case tI:case nI:case rI:return Dh(e,n);case UP:return new r;case VP:case WP:return new r(e);case qP:return $P(e);case zP:return new r;case HP:return MP(e)}}var oI="[object Map]";function sI(e){return or(e)&&Gn(e)==oI}var Xv=Di&&Di.isMap,aI=Xv?Yl(Xv):sI,lI="[object Set]";function cI(e){return or(e)&&Gn(e)==lI}var Yv=Di&&Di.isSet,uI=Yv?Yl(Yv):cI,fI=1,Jv="[object Arguments]",dI="[object Array]",pI="[object Boolean]",hI="[object Date]",mI="[object Error]",Zv="[object Function]",gI="[object GeneratorFunction]",yI="[object Map]",vI="[object Number]",eb="[object Object]",bI="[object RegExp]",wI="[object Set]",SI="[object String]",EI="[object Symbol]",TI="[object WeakMap]",AI="[object ArrayBuffer]",xI="[object DataView]",RI="[object Float32Array]",CI="[object Float64Array]",kI="[object Int8Array]",PI="[object Int16Array]",II="[object Int32Array]",OI="[object Uint8Array]",FI="[object Uint8ClampedArray]",_I="[object Uint16Array]",DI="[object Uint32Array]",St={};St[Jv]=St[dI]=St[AI]=St[xI]=St[pI]=St[hI]=St[RI]=St[CI]=St[kI]=St[PI]=St[II]=St[yI]=St[vI]=St[eb]=St[bI]=St[wI]=St[SI]=St[EI]=St[OI]=St[FI]=St[_I]=St[DI]=!0,St[mI]=St[Zv]=St[TI]=!1;function ba(e,t,n,r,i,o){var s,a=t&fI;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!rr(e))return e;var l=Hn(e);if(l)s=DP(e);else{var u=Gn(e),c=u==Zv||u==gI;if(xo(e))return _h(e,a);if(u==eb||u==Jv||c&&!i)s={};else{if(!St[u])return i?e:{};s=iI(e,u,a)}}o||(o=new ir);var p=o.get(e);if(p)return p;o.set(e,s),uI(e)?e.forEach(function(b){s.add(ba(b,t,n,b,e,o))}):aI(e)&&e.forEach(function(b,w){s.set(w,ba(b,t,n,w,e,o))});var d=Kv,m=l?void 0:d(e);return PP(m||e,function(b,w){m&&(w=b,b=e[w]),Hh(s,w,ba(b,t,n,w,e,o))}),s}function NI(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function LI(e,t){return t.length<2?e:Am(e,NI(t,0,-1))}var $I=Object.prototype,MI=$I.hasOwnProperty;function BI(e,t){t=Sc(t,e);var n=-1,r=t.length;if(!r)return!0;for(var i=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var o=t[n];if(typeof o=="string"){if(o==="__proto__"&&!MI.call(e,"__proto__"))return!1;if(o==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var s=LI(e,t);return s==null||delete s[Tm(Xd(t))]}function jI(e){return Xl(e)?void 0:e}var tb=On?On.isConcatSpreadable:void 0;function UI(e){return Hn(e)||zs(e)||!!(tb&&e&&e[tb])}function VI(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=UI),i||(i=[]);++o<s;){var a=e[o];n(a)?Bf(i,a):i[i.length]=a}return i}function qI(e){var t=e==null?0:e.length;return t?VI(e):[]}function zI(e){return em(Zh(e,void 0,qI),e+"")}var WI=1,HI=2,KI=4,Hi=zI(function(e,t){var n={};if(e==null)return n;var r=!1;t=bm(t,function(o){return o=Sc(o,e),r||(r=o.length>1),o}),Kh(e,Kv(e),n),r&&(n=ba(n,WI|HI|KI,jI));for(var i=t.length;i--;)BI(n,t[i]);return n});const GI=(e,t)=>{const n=(o="")=>o.split("/").filter(Boolean),r=n(e.path),i=n(t);return i.map((o,s)=>({id:Xt.v4(),allowContextActions:!0,text:o,to:{path:"/"+[...r].splice(0,r.length-i.length+s+1).join("/"),query:Hi(e.query,"fileId","page")},isStaticNav:!1}))},QI=(...e)=>{const t=e.pop();return[...e,{id:Xt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Je.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Mo{static Cut="cut";static Copy="copy"}const zf=e=>e.clientY===0,Wf=(e,t,n)=>{if(!e)return;let r=n;r.$el&&(r=n.$el);const i=r.getBoundingClientRect(),o=zf(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!zf(t)?t.clientX:i.x,right:t.type==="contextmenu"&&!zf(t)?t.clientX:i.x})}),e.show()},wa=e=>(e||"").split("_")[0],di=(e,t,n=Ut.DateTime.DATETIME_MED)=>e.setLocale(wa(t)).toLocaleString(n),nb=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromJSDate(e),t,n),XI=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromHTTP(e),t,n),rb=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromISO(e),t,n),YI=(e,t,n=Ut.DateTime.DATETIME_MED)=>di(Ut.DateTime.fromRFC2822(e),t,n),Bo=(e,t)=>e.setLocale(wa(t)).toRelative(),ib=(e,t)=>Bo(Ut.DateTime.fromJSDate(e),t),JI=(e,t)=>Bo(Ut.DateTime.fromHTTP(e),t),ZI=(e,t)=>Bo(Ut.DateTime.fromISO(e),t),eO=(e,t)=>Bo(Ut.DateTime.fromRFC2822(e),t),tO=1048576,vn=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":ES.filesize(n,{round:n<tO?0:1,locale:wa(t),base:10,output:"string"})};function ob(e="",t=!1){const n=re.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],i=n.split("/");for(t&&r.push(n),i.pop();i.length>0;){if(!i.join("/")){i.pop();continue}r.push(i.join("/")),i.pop()}return r}var Rt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(Rt||{});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 st(()=>f(r),(i,o)=>{i!==o&&(i!==void 0?window.localStorage.setItem(e,typeof i=="string"?i:JSON.stringify(i)):window.localStorage.removeItem(e))},{deep:!0}),r},Qr=()=>{const e=dt(),t=B(()=>e.options.embed?.enabled),n=B(()=>e.options.embed?.target==="location"),r=B(()=>e.options.embed?.chooseFileName),i=B(()=>e.options.embed?.chooseFileNameSuggestion),o=B(()=>e.options.embed?.target==="file"),s=B(()=>e.options.embed?.fileTypes),a=B(()=>e.options.embed?.messagesOrigin),l=B(()=>f(t)&&e.options.embed?.delegateAuthentication),u=B(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:i,isFilePicker:o,messagesTargetOrigin:a,isDelegatingAuthentication:l,fileTypes:s,postMessage:(d,m)=>{const b={};f(a)&&(b.targetOrigin=f(a)),window.parent.postMessage({name:d,data:m},b)},verifyDelegatedAuthenticationOrigin:d=>f(u)?f(u)===d:!0}},Sa=e=>{const{isEnabled:t}=Qr(),n=e?.bus||Je,r=Hf("oc_sideBarOpen",!1),i=le(!1),o=B({get(){return f(t)?f(i):f(r)},set(b){if(f(t)){i.value=b;return}r.value=b}}),s=async()=>{await zt();const b=document.getElementById("app-sidebar");b&&b.focus()},a=le(null),l=n.subscribe(Rt.toggle,()=>{o.value=!f(o),f(o)&&s()}),u=n.subscribe(Rt.close,()=>{o.value=!1,a.value=null}),c=n.subscribe(Rt.open,()=>{o.value=!0,a.value=null,s()}),p=n.subscribe(Rt.openWithPanel,b=>{o.value=!0,a.value=b,s()}),d=n.subscribe(Rt.setActivePanel,b=>{a.value=b});return An(()=>{n.unsubscribe(Rt.toggle,l),n.unsubscribe(Rt.close,u),n.unsubscribe(Rt.open,c),n.unsubscribe(Rt.openWithPanel,p),n.unsubscribe(Rt.setActivePanel,d)}),{isSideBarOpen:tr(o),sideBarActivePanel:tr(a),onPanelActive:(b,w)=>{n.subscribe(Rt.setActivePanel,S=>{b===S&&setTimeout(()=>{w(S)},100)})}}},Yt=e=>e,sb=e=>re.ShareTypes.containsAnyValue(re.ShareTypes.authenticated,e??[]),ab=e=>re.ShareTypes.containsAnyValue(re.ShareTypes.unauthenticated,e??[]),nO=({isDirect:e})=>Yt(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),rO=({isDirect:e})=>Yt(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),iO=({resource:e,isDirect:t,interceptModifierClick:n})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:nO({isDirect:t}),label:Yt("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:(r,i)=>{i&&n(i,r)||Je.publish(Rt.openWithPanel,"sharing#peopleShares")}}),oO=({resource:e})=>({id:`files-sharing-synced-${e.getDomSelector()}`,accessibleDescription:Yt("This item is synced with your devices"),label:Yt("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),sO=({resource:e})=>e.shareRoles?.length?{id:`files-sharing-role-${e.getDomSelector()}`,accessibleDescription:Yt(e.shareRoles[0].description),label:Yt(e.shareRoles[0].displayName),icon:e.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${e.getDomSelector()}`,accessibleDescription:re.ShareTypes.remote.label,label:re.ShareTypes.remote.label,icon:re.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},aO=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:rO({isDirect:t}),label:Yt("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Je.publish(Rt.openWithPanel,"sharing#linkShares")}}),lO=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:Yt("Item locked"),label:Yt("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),cO=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:Yt("Item in processing"),label:Yt("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),uO=({resource:e})=>({id:`resource-space-enabled-${e.getDomSelector()}`,accessibleDescription:Yt("Space is enabled"),label:Yt("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),fO=({resource:e})=>({id:`resource-space-disabled-${e.getDomSelector()}`,accessibleDescription:Yt("Space is disabled"),label:Yt("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"}),lb=({space:e,resource:t,ancestorMetaData:n,user:r,interceptModifierClick:i})=>{const o=[];if(t.locked&&o.push(lO({resource:t})),t.processing&&o.push(cO({resource:t})),re.isProjectSpaceResource(t)&&!t.disabled&&o.push(uO({resource:t})),re.isProjectSpaceResource(t)&&t.disabled&&o.push(fO({resource:t})),re.isIncomingShareResource(t)&&(t.shareTypes.includes(re.ShareTypes.remote.value)||t.shareRoles?.length)&&o.push(sO({resource:t})),re.isIncomingShareResource(t)&&t.syncEnabled&&o.push(oO({resource:t})),re.isProjectSpaceResource(e)||re.isPersonalSpaceResource(e)&&e.isOwner(r)){const a=Object.values(n).reduce((c,p)=>(c.push(...p.shareTypes||[]),c),[]),l=sb(t.shareTypes);(l||sb(a))&&o.push(iO({resource:t,isDirect:l,interceptModifierClick:i}));const u=ab(t.shareTypes);(u||ab(a))&&o.push(aO({resource:t,isDirect:u}))}return o},cb=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=i=>n(i),r.readAsArrayBuffer(e)}),ub=e=>new Promise(t=>e.toBlob(t)),jo=()=>window.navigator.platform.match("Mac");function pi(e){return e.status==="fulfilled"}function hi(e){return e.status==="rejected"}const Kf=e=>new TextEncoder().encode(e).length,nt=Me.defineStore("messages",()=>{const e=le([]),t=o=>{const s={...o,id:Xt.v4()};return e.value.push(s),s},n=o=>{const s=a=>a.response?.headers?.get("x-request-id");return o.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
41
- `)};return{messages:e,showMessage:t,showErrorMessage:o=>{const s={id:Xt.v4(),status:"danger",timeout:0,...o.errors&&{errorLogContent:n(o.errors)},...o};return e.value.push(s),s},removeMessage:o=>{e.value=f(e).filter(({id:s})=>o.id!==s)}}}),Uo=Me.defineStore("clipboard",()=>{const{$gettext:e}=Ie.useGettext(),{showMessage:t}=nt(),n=le(),r=le([]);return{action:n,resources:r,copyResources:a=>{a[0]?.canDownload()&&(n.value=Mo.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0]?.canDownload()&&(n.value=Mo.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),fb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,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},dt=Me.defineStore("config",()=>{const e=ar(),t=le(""),n=le(""),r=le({...fb}),i=le([]),o=le([]),s=le([]),a=le(),l=le(),u=le(),c=le([]),p=le([]),d=B(()=>re.urlJoin(f(t)||window.location.origin,{trailingSlash:!0})),m=B(()=>re.urlJoin(f(d),"groupware",{trailingSlash:!0})),b=B(()=>!!f(a)),w=B(()=>!!f(l));return{options:r,oAuth2:a,openIdConnect:l,isOAuth2:b,isOIDC:w,customTranslations:s,apps:i,externalApps:o,sentry:u,theme:n,scripts:c,styles:p,serverUrl:d,groupwareUrl:m,loadConfig:y=>{y.server&&(t.value=y.server?.endsWith("/")?y.server:y.server+"/"),i.value=y.apps||[],s.value=y.customTranslations||[],a.value=y.auth,l.value=y.openIdConnect,u.value=y.sentry,c.value=y.scripts||[],p.value=y.styles||[],n.value=y.theme,y.options&&(r.value=Co({...fb},y.options),f(r).ocm.openRemotely=f(r).cernFeatures,f(r).routing.idBased=!f(r).cernFeatures,f(r).routing.fullShareOwnerPaths=f(r).cernFeatures),y.external_apps&&(o.value=y.external_apps,y.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),dO=de.z.object({url:de.z.string()}),pO=de.z.object({apiUrl:de.z.string().optional(),authUrl:de.z.string().optional(),clientId:de.z.string().optional(),clientSecret:de.z.string().optional(),logoutUrl:de.z.string().optional(),metaDataUrl:de.z.string().optional(),url:de.z.string().optional()}),hO=de.z.object({authority:de.z.string().optional(),client_id:de.z.string().optional(),client_secret:de.z.string().optional(),dynamic:de.z.string().optional(),metadata_url:de.z.string().optional(),post_logout_redirect_uri:de.z.string().optional(),response_type:de.z.string().optional(),scope:de.z.string().optional()}).passthrough(),mO=de.z.record(de.z.any(),de.z.any()),gO=de.z.object({href:de.z.string().optional()}),yO=de.z.object({async:de.z.boolean().optional(),src:de.z.string().optional()}),vO=de.z.object({cernFeatures:de.z.boolean().optional(),concurrentRequests:de.z.object({resourceBatchActions:de.z.number().optional(),sse:de.z.number().optional(),shares:de.z.object({create:de.z.number().optional(),list:de.z.number().optional()}).optional(),avatars:de.z.number().optional()}).optional(),contextHelpers:de.z.boolean().optional(),contextHelpersReadMore:de.z.boolean().optional(),defaultAppId:de.z.string().optional(),disabledExtensions:de.z.array(de.z.string()).optional(),disableFeedbackLink:de.z.boolean().optional(),accountEditLink:de.z.object({href:de.z.string().optional()}).optional(),editor:de.z.object({autosaveEnabled:de.z.boolean().optional(),autosaveInterval:de.z.number().optional(),openAsPreview:de.z.union([de.z.boolean(),de.z.array(de.z.string())]).optional()}).optional(),embed:de.z.object({enabled:de.z.boolean().optional(),target:de.z.string().optional(),messagesOrigin:de.z.string().optional(),delegateAuthentication:de.z.boolean().optional(),delegateAuthenticationOrigin:de.z.string().optional(),fileTypes:de.z.array(de.z.string()).optional(),chooseFileName:de.z.boolean().optional(),chooseFileNameSuggestion:de.z.string().optional()}).optional(),feedbackLink:de.z.object({ariaLabel:de.z.string().optional(),description:de.z.string().optional(),href:de.z.string().optional()}).optional(),isRunningOnEos:de.z.boolean().optional(),loginUrl:de.z.string().optional(),logoutUrl:de.z.string().optional(),ocm:de.z.object({openRemotely:de.z.boolean().optional()}).optional(),routing:de.z.object({fullShareOwnerPaths:de.z.boolean().optional(),idBased:de.z.boolean().optional()}).optional(),runningOnEos:de.z.boolean().optional(),tokenStorageLocal:de.z.boolean().optional(),upload:de.z.object({companionUrl:de.z.string().optional()}).optional(),userListRequiresFilter:de.z.boolean().optional(),hideLogo:de.z.boolean().optional()}),bO=de.z.object({id:de.z.string(),path:de.z.string(),config:de.z.record(de.z.string(),de.z.unknown()).optional()}),wO=de.z.object({server:de.z.string(),theme:de.z.string(),options:vO,apps:de.z.array(de.z.string()).optional(),external_apps:de.z.array(bO).optional(),customTranslations:de.z.array(dO).optional(),auth:pO.optional(),openIdConnect:hO.optional(),sentry:mO.optional(),scripts:de.z.array(yO).optional(),styles:de.z.array(gO).optional()}),db=Me.defineStore("extensionPreferences",()=>{const e=Yn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(i,o)=>i.multiple?o.map(s=>s.id):i.defaultExtensionId?[i.defaultExtensionId]:[],getExtensionPreference:(i,o)=>{const s=e.value[i];return s||{extensionPointId:i,selectedExtensionIds:o}},setSelectedExtensionIds:(i,o)=>{if(!Object.hasOwn(f(e),i)){e.value[i]={extensionPointId:i,selectedExtensionIds:o};return}e.value[i].selectedExtensionIds=o}}}),Ki=Me.defineStore("extensionRegistry",()=>{const e=dt(),t=le([]),n=u=>{t.value.push(u)},r=u=>{t.value=f(t).map(c=>le(f(c).filter(({id:p})=>!u.includes(p)))).filter(c=>f(c).length)},i=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return f(t).flatMap(c=>f(c).filter(p=>p.type===u.extensionType&&!e.options.disabledExtensions.includes(p.id)&&(!p.extensionPointIds||p.extensionPointIds?.includes(u.id))))},o=le([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:i,extensionPoints:o,registerExtensionPoints:u=>{o.value.push(u)},unregisterExtensionPoints:u=>{o.value=f(o).map(c=>le(f(c).filter(({id:p})=>!u.includes(p)))).filter(c=>f(c).length)},getExtensionPoints:(u={})=>f(o).flatMap(c=>f(c).filter(p=>!(Object.hasOwn(u,"extensionType")&&p.extensionType!==u.extensionType)))}}),ht=Me.defineStore("modals",()=>{const e=le([]),t=B(()=>f(e).at(-1)),n=l=>f(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 p=n(l);p[u]=c},removeModal:l=>{e.value=f(e).filter(u=>u.id!==l)},removeAllModals:()=>{e.value=[]},setModalActive:l=>{const u=f(e).findIndex(p=>p.id===l);if(u<0)return;const c=n(l);f(e).splice(u,1),e.value.push(c)}}}),vt=Me.defineStore("user",()=>{const e=le();return{user:e,setUser:r=>{e.value=r,kS.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function SO(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;)n=t(n,e[i],i,e);return n}function EO(e){return function(t){return e?.[t]}}var TO={À:"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"},AO=EO(TO),xO=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,RO="\\u0300-\\u036f",CO="\\ufe20-\\ufe2f",kO="\\u20d0-\\u20ff",PO=RO+CO+kO,IO="["+PO+"]",OO=RegExp(IO,"g");function FO(e){return e=wc(e),e&&e.replace(xO,AO).replace(OO,"")}var _O=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function DO(e){return e.match(_O)||[]}var NO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function LO(e){return NO.test(e)}var pb="\\ud800-\\udfff",$O="\\u0300-\\u036f",MO="\\ufe20-\\ufe2f",BO="\\u20d0-\\u20ff",jO=$O+MO+BO,hb="\\u2700-\\u27bf",mb="a-z\\xdf-\\xf6\\xf8-\\xff",UO="\\xac\\xb1\\xd7\\xf7",VO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",qO="\\u2000-\\u206f",zO=" \\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",gb="A-Z\\xc0-\\xd6\\xd8-\\xde",WO="\\ufe0e\\ufe0f",yb=UO+VO+qO+zO,vb="['’]",bb="["+yb+"]",HO="["+jO+"]",wb="\\d+",KO="["+hb+"]",Sb="["+mb+"]",Eb="[^"+pb+yb+wb+hb+mb+gb+"]",GO="\\ud83c[\\udffb-\\udfff]",QO="(?:"+HO+"|"+GO+")",XO="[^"+pb+"]",Tb="(?:\\ud83c[\\udde6-\\uddff]){2}",Ab="[\\ud800-\\udbff][\\udc00-\\udfff]",Gi="["+gb+"]",YO="\\u200d",xb="(?:"+Sb+"|"+Eb+")",JO="(?:"+Gi+"|"+Eb+")",Rb="(?:"+vb+"(?:d|ll|m|re|s|t|ve))?",Cb="(?:"+vb+"(?:D|LL|M|RE|S|T|VE))?",kb=QO+"?",Pb="["+WO+"]?",ZO="(?:"+YO+"(?:"+[XO,Tb,Ab].join("|")+")"+Pb+kb+")*",eF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nF=Pb+kb+ZO,rF="(?:"+[KO,Tb,Ab].join("|")+")"+nF,iF=RegExp([Gi+"?"+Sb+"+"+Rb+"(?="+[bb,Gi,"$"].join("|")+")",JO+"+"+Cb+"(?="+[bb,Gi+xb,"$"].join("|")+")",Gi+"?"+xb+"+"+Rb,Gi+"+"+Cb,tF,eF,wb,rF].join("|"),"g");function oF(e){return e.match(iF)||[]}function sF(e,t,n){return e=wc(e),t=t,t===void 0?LO(e)?oF(e):DO(e):e.match(t)||[]}var aF="['’]",lF=RegExp(aF,"g");function cF(e){return function(t){return SO(sF(FO(t).replace(lF,"")),e,"")}}var Ib=cF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Ob=de.z.object({name:de.z.string().optional(),slogan:de.z.string().optional(),logo:de.z.string().optional(),logoMobile:de.z.string().optional(),urls:de.z.object({accessDeniedHelp:de.z.string().optional(),imprint:de.z.string().optional(),privacy:de.z.string().optional(),accessibility:de.z.string().optional()}).optional(),shareRoles:de.z.record(de.z.string(),de.z.object({iconName:de.z.string()})).optional()}),uF=de.z.object({roles:de.z.record(de.z.string(),de.z.string()).optional(),colorPalette:de.z.record(de.z.string(),de.z.string()).optional(),fontFamily:de.z.string().optional()}),Fb=Ob.extend({designTokens:uF.optional(),favicon:de.z.string().optional(),background:de.z.string().optional()}),fF=Fb.extend({isDark:de.z.boolean(),label:de.z.string()}),_b=de.z.object({defaults:Fb,themes:de.z.array(fF)}),dF=de.z.object({common:Ob.optional(),clients:de.z.object({web:_b})}),pF="oc_currentThemeName",hF=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},cr=Me.defineStore("theme",()=>{const e=Yn.useLocalStorage(pF,null),t=Yn.usePreferredDark(),n=le(),r=le([]),i=c=>{const p=c.common,d=c.clients.web.defaults,m=Kd(p,d);r.value=c.clients.web.themes.map(b=>Kd(m,b)),o()},o=()=>{const c=f(r).find(d=>!d.isDark),p=f(r).find(d=>d.isDark);l(f(r).find(d=>d.label===f(e))||(f(t)?p:c)||f(r)[0],!1)},s=()=>{e.value=null,o()},a=B(()=>e.value===null),l=(c,p=!0)=>{n.value=c,p&&(e.value=f(n).label);const d=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];Gs("font-family",f(n).designTokens.fontFamily),d.forEach(m=>{for(const b in f(n).designTokens[m.name])Gs(`${m.prefix}-${Ib(b)}`,f(n).designTokens[m.name][b])}),f(n).designTokens?.roles?.chrome||(Gs("role-chrome",f(n).designTokens?.roles?.surfaceContainer),Gs("role-on-chrome",f(n).designTokens?.roles?.onSurface)),f(n).favicon&&hF(f(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:i,setAndApplyTheme:l,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:c=>f(n).shareRoles[c.id]?.iconName||"user"}}),Cr=Me.defineStore("shares",()=>{const e=ze(),{getRoleIcon:t}=cr(),n=le(!1),r=le([]),i=le([]),o=le({}),s=x=>{o.value=x.reduce((A,N)=>(A[N.id]={...N,icon:t(N)},A),{})},a=x=>{const A=f(r).find(({id:N})=>N===x.id);if(A){Object.assign(A,x);return}f(r).push(x)},l=x=>{r.value=x},u=x=>{f(r).push(...x)},c=x=>{r.value=f(r).filter(({id:A})=>A!==x.id)},p=()=>{r.value=[],i.value=[],n.value=void 0},d=()=>{const x=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!x.length){r.value=[],i.value=[];return}f(r).forEach(A=>{x.includes(A.resourceId)||c(A)}),f(i).forEach(A=>{x.includes(A.resourceId)||w(A)})},m=x=>{i.value=x},b=x=>{const A=f(i).find(({id:N})=>N===x.id);if(A){Object.assign(A,x);return}f(i).push(x)},w=x=>{i.value=f(i).filter(({id:A})=>A!==x.id)},S=x=>{n.value=x},y=x=>{const A=D=>{const V=new Set;return D.forEach(L=>{V.add(L.shareType)}),Array.from(V)},N=[...e.resources,e.currentFolder].find(D=>D?.id===x);if(!N||re.isProjectSpaceResource(N))return;const W=[...f(r),...f(i)];e.updateResourceField({id:N.id,field:"shareTypes",value:A(W.filter(D=>!D.indirect))});const O=e.getAncestorById(x);O&&e.updateAncestorField({path:O.path,field:"shareTypes",value:A(W.filter(D=>!D.indirect))})};return{loading:n,collaboratorShares:r,linkShares:i,graphRoles:o,setGraphRoles:s,setLoading:S,setCollaboratorShares:l,setLinkShares:m,removeOrphanedShares:d,pruneShares:p,addShare:async({clientService:x,space:A,resource:N,options:W})=>{const D=await x.graphAuthenticated.permissions.createInvite(A.id,N.id,W,f(o));return u([D]),y(N.id),D},updateShare:async({clientService:x,space:A,resource:N,collaboratorShare:W,options:O})=>{const D=x.graphAuthenticated.permissions,V={roles:O.roles,expirationDateTime:O.expirationDateTime},L=await D.updatePermission(A.id,N.id,W.id,V,f(o));return a(L),L},deleteShare:async({clientService:x,space:A,resource:N,collaboratorShare:W})=>{await x.graphAuthenticated.permissions.deletePermission(A.id,N.id,W.id),c(W),y(N.id)},addLink:async({clientService:x,space:A,resource:N,options:W})=>{const D=await x.graphAuthenticated.permissions.createLink(A.id,N.id,W),V=e.selectedResources,L=V.some(({fileId:te})=>te===N.fileId)||V.length===0&&e.currentFolder.fileId===N.fileId;if(b(D),y(N.id),!L){const te=e.ancestorMetaData[N.path]??null;if(te){const{shareTypes:Y}=te;Y.includes(re.ShareTypes.link.value)||e.updateAncestorField({path:te.path,field:"shareTypes",value:[...Y,re.ShareTypes.link.value]})}}return D},updateLink:async({clientService:x,space:A,resource:N,linkShare:W,options:O})=>{const D=x.graphAuthenticated.permissions;let V;if(Object.hasOwn(O,"password"))V=await D.setPermissionPassword(A.id,N.id,W.id,{password:O.password}),W.hasPassword=!!O.password;else{const L={link:{...O.type&&{type:O.type},...O.displayName&&{"@libre.graph.displayName":O.displayName}},...Object.hasOwn(O,"expirationDateTime")&&{expirationDateTime:O.expirationDateTime}};V=await D.updatePermission(A.id,N.id,W.id,L)}return b(V),V},deleteLink:async({clientService:x,space:A,resource:N,linkShare:W})=>{await x.graphAuthenticated.permissions.deletePermission(A.id,N.id,W.id),w(W),y(N.id)}}}),bn={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Db={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Nb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),Vo=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const i=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!i.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return i;const o={};i.forEach(a=>{const{rootId:l,driveAlias:u}=a.root.remoteItem;o[l]=u});const s=Object.entries(o).map(([a,l])=>re.buildSpace({id:re.extractStorageId(a),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:n.serverUrl}));return[...i,...s]},at=Me.defineStore("spaces",()=>{const e=vt(),t=dt(),n=Cr(),r=le([]),i=le(),o=le(!1),s=le(!1),a=le(!1),l=le(null),u=le([]),c=le([]),p=B(()=>f(r).find(ae=>re.isPersonalSpaceResource(ae)&&ae.isOwner(e.user))),d=ae=>{o.value=ae},m=ae=>{s.value=ae},b=ae=>{a.value=ae},w=ae=>{i.value=ae},S=ae=>{l.value=ae},y=ae=>{if(!re.isProjectSpaceResource(ae))return[];const we=n.collaboratorShares.filter(Q=>Q.resourceId===ae.id);return Nb(we)},g=ae=>{f(r).push(...ae)},v=ae=>{r.value=f(r).filter(({id:we})=>we!==ae.id)},h=ae=>f(r).find(we=>ae==we.id),E=async({graphClient:ae,space:we,signal:Q})=>(await N({graphClient:ae,signal:Q}),f(r).find(ie=>re.isMountPointSpaceResource(ie)&&ie.root?.remoteItem?.id===we.id)),T=({driveAliasPrefix:ae,id:we,shareName:Q})=>{const ie=re.buildShareSpaceResource({driveAliasPrefix:ae,id:we,shareName:Q,serverUrl:t.serverUrl});return g([ie]),ie},R=ae=>{const we=f(r).find(({id:Q})=>Q===ae.id);if(we){Object.assign(we,ae);return}g([ae])},x=({id:ae,field:we,value:Q})=>{const ie=f(r).find(ce=>ae===ce.id);ie&&(ie[we]=Q)},A=async({graphClient:ae})=>{a.value=!0;try{const[we,Q]=await Promise.all([Vo({graphClient:ae,driveType:"personal",configStore:t}),Vo({graphClient:ae,driveType:"project",configStore:t})]);g([...we,...Q])}finally{a.value=!1}},N=async({graphClient:ae,signal:we})=>{if(!f(s))try{const Q=await Vo({graphClient:ae,driveType:"mountpoint",configStore:t,signal:we});g(Q)}finally{s.value=!0}},W=async({graphClient:ae,signal:we})=>{const Q=await Vo({graphClient:ae,driveType:"project",configStore:t,signal:we});r.value=f(r).filter(ie=>!re.isProjectSpaceResource(ie)),g(Q)},O=ae=>{f(u).includes(ae)||f(u).push(ae)},D=ae=>{u.value=f(u).filter(we=>we!==ae)},V=()=>{u.value=[]},L=ae=>{f(c).includes(ae)||f(c).push(ae)},te=ae=>{c.value=f(c).filter(we=>we!==ae)},Y=()=>{c.value=[]},se=le({});return{spaces:r,spacesInitialized:o,mountPointsInitialized:s,spacesLoading:a,currentSpace:i,personalSpace:p,defaultSpaceImageBlobURL:l,imagesLoading:u,readmesLoading:c,getSpace:h,createShareSpace:T,setSpacesInitialized:d,setMountPointsInitialized:m,setSpacesLoading:b,setCurrentSpace:w,setDefaultSpaceImageBlobURL:S,getSpaceMembers:y,getMountPointForSpace:E,addSpaces:g,removeSpace:v,upsertSpace:R,updateSpaceField:x,loadSpaces:A,loadMountPoints:N,reloadProjectSpaces:W,addToImagesLoading:O,removeFromImagesLoading:D,purgeImagesLoading:V,addToReadmesLoading:L,removeFromReadmesLoading:te,purgeReadmesLoading:Y,loadGraphPermissions:async({ids:ae,graphClient:we,useCache:Q=!0})=>{const ie=f(r).filter(ce=>ae.includes(ce.id)&&(ce.graphPermissions===void 0||!Q));if(ie.length){for(const{id:ce,disabled:Ae}of ie){if(Ae){x({id:ce,field:"graphPermissions",value:[]});continue}f(se)[ce]||(se.value[ce]=we.permissions.listPermissions(ce,ce,n.graphRoles,{select:[Db.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:ee})=>{x({id:ce,field:"graphPermissions",value:ee}),delete se.value[ce]}))}await Promise.all(Object.values(f(se)))}}}}),ze=Me.defineStore("resources",()=>{const e=dt(),t=at(),n=vt(),r=le([]),i=le(),o=le({}),s=le([]),a=B(()=>{let C=f(r);return f(O)||(C=C.filter(q=>!q.name.startsWith("."))),C}),l=B(()=>{const C=f(r).filter(({type:ge})=>ge==="file").length,q=f(r).filter(({type:ge,name:xe})=>ge==="file"&&xe.startsWith(".")).length,K=f(r).filter(({type:ge})=>ge==="folder").length,j=f(r).filter(({type:ge,name:xe})=>ge==="folder"&&xe.startsWith(".")).length,H=f(r).filter(re.isProjectSpaceResource).length;return{files:C,hiddenFiles:q,folders:K,hiddenFolders:j,spaces:H}}),u=C=>{r.value=C},c=C=>{r.value=f(r).filter(q=>!C.find(({id:K})=>K===q.id))},p=()=>{r.value=[]},d=C=>{const q=f(r).find(({id:K})=>K===C.id);if(q){Object.assign(q,C);return}f(r).push(C)},m=C=>{const q=f(r).filter(K=>!C.some(j=>j.path===K.path));r.value=[...q,...C]},b=({id:C,field:q,value:K})=>{const j=f(r).find(H=>C===H.id);j&&(j[q]=K)},w=C=>{i.value=C},S=()=>{i.value=void 0},y=C=>{r.value=C.resources,i.value=C.currentFolder},g=()=>{r.value=[],i.value=void 0,v.value=[]},v=le([]),h=le(null),E=B(()=>f(r).filter(C=>f(v).includes(C.id))),T=C=>{const q=C.find(K=>!f(v).includes(K));q&&(h.value=q),v.value=C},R=C=>{h.value=C,f(v).includes(C)||f(v).push(C)},x=C=>{h.value=C,f(v).includes(C)&&(v.value=f(v).filter(q=>q!==C))},A=C=>{f(v).includes(C)?x(C):R(C)},N=()=>{v.value=[]},W=C=>{h.value=C},O=le(!0),D=le(!0),V=le(!1),L=le(!0),te=le(!0),Y=C=>{O.value=C,window.localStorage.setItem("oc_hiddenFilesShown",C.toString())},se=C=>{D.value=C,window.localStorage.setItem("oc_fileExtensionsShown",C.toString())},he=C=>{V.value=C,window.localStorage.setItem("oc_webDavDetailsShown",C.toString())},ae=C=>{L.value=C,window.localStorage.setItem("oc_disabledSpacesShown",C.toString())},we=C=>{te.value=C,window.localStorage.setItem("oc_emptyTrashesShown",C.toString())},Q=C=>{o.value=C};return{resources:r,currentFolder:i,activeResources:a,totalResourcesCount:l,setResources:u,removeResources:c,clearResources:p,upsertResource:d,upsertResources:m,updateResourceField:b,setCurrentFolder:w,clearCurrentFolder:S,initResourceList:y,clearResourceList:g,selectedIds:v,latestSelectedId:h,selectedResources:E,setSelection:T,addSelection:R,removeSelection:x,toggleSelection:A,resetSelection:N,setLastSelectedId:W,areHiddenFilesShown:O,areFileExtensionsShown:D,areWebDavDetailsShown:V,areDisabledSpacesShown:L,areEmptyTrashesShown:te,setAreHiddenFilesShown:Y,setAreFileExtensionsShown:se,setAreWebDavDetailsShown:he,setAreDisabledSpacesShown:ae,setAreEmptyTrashesShown:we,ancestorMetaData:o,setAncestorMetaData:Q,updateAncestorField:({path:C,field:q,value:K})=>{const j=f(o)[C]??null;j&&(j[q]=K)},loadAncestorMetaData:({folder:C,space:q,client:K,signal:j})=>{const H={[C.path]:{id:C.fileId,shareTypes:C.shareTypes,parentFolderId:C.parentFolderId,spaceId:q.id,path:C.path}},ge=[],xe=[Ve.FileId,Ve.ShareTypes,Ve.FileParent],De=ob(C.path),Oe=t.spaces,Ce=()=>Oe.filter(ye=>re.isMountPointSpaceResource(ye)&&re.extractStorageId(ye.root.remoteItem.rootId)===q.id);let Fe=!0;if(e.options.routing.fullShareOwnerPaths){const ye=Oe.some(We=>re.isProjectSpaceResource(We)&&We.id===q.id);Fe=q.isOwner(n.user)||ye}for(const ye of De){const We=f(o)[ye]??null;if(We?.spaceId===q.id){H[ye]=We;continue}if(!Fe&&!Ce().find(Ge=>ye.startsWith(Ge.root.remoteItem.path)))break;ge.push(K.listFiles(q,{path:ye},{depth:0,davProperties:xe,signal:j}).then(({resource:Ge})=>{H[ye]={id:Ge.fileId,shareTypes:Ge.shareTypes,parentFolderId:Ge.parentFolderId,spaceId:q.id,path:ye}}))}return Promise.all(ge).then(()=>{if(!Object.keys(H).includes("/")){const ye=f(o)["/"];if(ye?.spaceId===q.id)H["/"]=ye;else{const{parentFolderId:We}=Object.values(H)[0],Ge=t.spaces.find(({id:Qe})=>We.startsWith(Qe));Ge&&(H["/"]={id:Ge.id,shareTypes:Ge.shareTypes,parentFolderId:Ge.id,spaceId:Ge.id,path:"/"})}}Q(H)})},getAncestorById:C=>Object.values(f(o)).find(q=>C===q.id),deleteQueue:s,addResourcesIntoDeleteQueue:C=>{s.value=s.value.concat(C.filter(q=>!f(s).includes(q)))},removeResourcesFromDeleteQueue:C=>{s.value=s.value.filter(q=>!C.includes(q))}}}),qo=Me.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(o,{needsTokenRenewal:s=!1}={})=>{const a=Xt.v4(),l=Yn.useWebWorker(o,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...l};return f(e).push(u),u},terminateWorker:o=>{const s=f(e).find(a=>o===a.id);s&&(s.terminate(),e.value=f(e).filter(a=>o!==a.id))},terminateAllWorkers:()=>{f(e).forEach(({terminate:o})=>{o()}),e.value=[]},updateAccessTokens:o=>{f(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${o}`}}))})}}}),Ea=Me.defineStore("avatars",()=>{const e=dt(),t=le({}),n=yp(new Lr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:l=>f(t)[l],addAvatar:(l,u)=>{t.value[l]=u},removeAvatar:l=>{t.value[l]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Lb=Me.defineStore("updates",()=>{const e=le(!0),t=le(!1),n=le();return{updates:n,isLoading:e,hasError:t,setUpdates:s=>{n.value=s},setHasError:s=>{t.value=s},setIsLoading:s=>{e.value=s}}}),mF=Me.defineStore("groupwareConfig",()=>{const e=le(""),t=le([]),n=le(),r=le([]),i=le({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:i,loadGroupwareConfig:s=>{e.value=s.version,t.value=s.capabilities||[],n.value=s.limits,r.value=s.accounts||[],i.value=s.primaryAccounts||{}}}}),$b=de.z.object({maxMailboxDepth:de.z.number(),maxSizeMailboxName:de.z.number(),maxMailboxesPerEmail:de.z.number(),maxSizeAttachmentsPerEmail:de.z.number(),mayCreateTopLevelMailbox:de.z.boolean(),maxDelayedSend:de.z.number()}),Mb=de.z.object({maxSizeScriptName:de.z.number(),maxSizeScript:de.z.number(),maxNumberScripts:de.z.number(),maxNumberRedirects:de.z.number()}),Bb=de.z.object({mail:$b.optional(),sieve:Mb.optional()}),jb=de.z.object({id:de.z.string(),name:de.z.string(),email:de.z.string().email(),mayDelete:de.z.boolean()}),Ub=de.z.object({accountId:de.z.string(),name:de.z.string(),isPersonal:de.z.boolean(),isReadOnly:de.z.boolean(),capabilities:Bb,identities:de.z.array(jb)}),Vb=de.z.object({maxSizeUpload:de.z.number(),maxConcurrentUpload:de.z.number(),maxSizeRequest:de.z.number(),maxConcurrentRequests:de.z.number()}),qb=de.z.array(Ub),zb=de.z.record(de.z.string(),de.z.string()),gF=de.z.object({version:de.z.string(),capabilities:de.z.array(de.z.string()),limits:Vb,accounts:qb,primaryAccounts:zb}),Ta=(e={})=>{const t=e.router||He(),n=e.configStore||dt();return{replaceInvalidFileRoute:({space:i,resource:o,path:s,fileId:a})=>{if(!n.options.routing?.idBased||s===o.path&&a===o.fileId)return!1;const l=sr(i,o,{configStore:n});return t.replace(l),!0}}},Gf=()=>{const e=Ht();return B(()=>f(e).name)},Wb=(e,t)=>{const n=Ht();return B(()=>f(n).meta[e]||t)},Aa=(e,t)=>{const n=He();return B({get(){return Ct(f(n.currentRoute).params[e])||t},async set(r){f(n.currentRoute).params[e]!==r&&await n.replace({params:{...f(n.currentRoute).params,[e]:r}})}})};let Hb=Promise.resolve();const tn=(e,t)=>{const n=He();return B({get(){return f(n.currentRoute).query[e]||t},set(r){if(f(n.currentRoute).query[e]===r)return;Hb=Hb.then(async()=>{try{await n.replace({path:f(n.currentRoute).path,query:{...f(n.currentRoute).query,[e]:r}})}catch{}})}})},kr=e=>{const t=tn(e.name),n=Hf(yF(e));return st(()=>f(t)?{value:f(t),source:"route"}:f(n)?{value:f(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:Ct(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},yF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Qn=(e,...t)=>{const n=le(!1),r=He(),i=Ht();return st(i,()=>{n.value=e(r,...t)},{immediate:!0}),n},xa="contextRouteName",Qf="contextRouteParams",Xf="contextRouteQuery",Ra=e=>{const{params:t,query:n}=e,r={},i=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const o of i)r[o]=n[o];return{[xa]:e.name,[Qf]:t,[Xf]:r}},Kb=e=>({routeName:Ct(e[xa]),routeParams:e[Qf],routeQuery:e[Xf]}),Ct=e=>Array.isArray(e)?e[0].toString():e?.toString();function Gb({router:e,currentFileContext:t}){const n=a=>{const{fileName:l,routeName:u,routeParams:c,routeQuery:p}=f(a);return f(u)?e.push({name:f(u),params:f(c),query:{...f(p),scrollTo:f(l)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ta({router:e}),i=(a,l)=>{const u=f(a);return r({space:f(u.space),resource:l,path:f(u.item),fileId:f(u.itemId)})},o=le(!1);return{replaceInvalidFileRoute:i,closeApp:()=>(o.value=!0,n(t)),closed:o}}const Ke=()=>Ar("$clientService");function Yf({clientService:e}){e=e||Ke();const t=vt();return{getUrlForResource:(a,l,u)=>e.webdav.getFileUrl(a,l,{username:t.user?.onPremisesSamAccountName,...u}),revokeUrl:a=>e.webdav.revokeUrl(a),getFileContents:(a,l)=>e.webdav.getFileContents(f(f(a).space),{path:f(f(a).item)},{...l}),getFileInfo:(a,l={})=>e.webdav.getFileInfo(f(f(a).space),{path:f(f(a).item),fileId:f(f(a).itemId)},l),putFileContents:(a,l)=>e.webdav.putFileContents(f(f(a).space),{path:f(f(a).item),...l})}}const Jf=()=>Ar("$authService");class mi{static allFiles="all-files";static currentFolder="current-folder"}const Zf=()=>{const e=dt(),t=Ke(),n=at(),r=ze(),i=en(),o=B(()=>i.searchContent?.enabled),s=B(()=>r.areHiddenFilesShown),a=B(()=>n.spaces.filter(re.isProjectSpaceResource)),l=d=>f(a).find(m=>m.id===d),u=rn.useTask(function*(d,m,b=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!m)return{totalResults:null,values:[]};const{resources:w,totalResults:S}=yield*re.call(t.webdav.search(m,{searchLimit:b,davProperties:ko.Default,signal:d}));return{totalResults:S,values:w.map(y=>{const g=l(y.parentFolderId),v=g||y;return e.options.routing.fullShareOwnerPaths&&v.remoteItemPath&&(v.path=re.urlJoin(v.remoteItemPath,v.path)),{id:v.id,data:v}}).filter(({data:y})=>!y.name.startsWith(".")||f(s))}}).restartable();return{search:async(d,m=null)=>await u.perform(d,m),buildSearchTerm:({term:d,isTitleOnlySearch:m,tags:b,lastModified:w,mediaType:S,scope:y,useScope:g})=>{const v=[],h=d,E=f(o)&&!m;if(h){let T=`name:"*${h}*"`;E&&(T=`(name:"*${h}*" OR content:"${h}")`),v.push(T)}if(g&&y&&v.push(`scope:${y}`),b){const T=b.split("+").map(R=>`"${R}"`);v.push(`tag:(${T.join(" OR ")})`)}if(w&&v.push(`mtime:${w}`),S){const T=S.split("+").map(R=>`"${R}"`);v.push(`mediatype:(${T.join(" OR ")})`)}return v.sort((T,R)=>Number(T.startsWith("scope:"))-Number(R.startsWith("scope:"))).join(" AND ")}}};function Qb({currentRoute:e,clientService:t}){const n=le(!1),{webdav:r}=t,{replaceInvalidFileRoute:i}=Ta(),{getFileInfo:o}=Yf({clientService:t}),s=Jf(),a=at(),{buildSearchTerm:l,search:u}=Zf(),c=tn("contextRouteQuery"),p=ze(),{activeResources:d}=Me.storeToRefs(p);return{isFolderLoading:n,loadFolderForFileContext:async b=>{n.value=!0;try{if(b=f(b),f(c)?.term){const T=l({term:f(c)?.term}),{values:R}=await u(T,200),x=R.filter(({data:A})=>re.isSearchResource(A)).map(A=>A.data);p.initResourceList({currentFolder:null,resources:x}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(f(b.routeName))){await xv.getTask().perform(),n.value=!1;return}p.clearResourceList();const S=f(b.space),y=await o(b,{davProperties:[Ve.FileId]});if(i({space:S,resource:y,path:f(b.item),fileId:f(b.itemId)}),a.spaces.some(T=>re.isMountPointSpaceResource(T)&&T.root.remoteItem?.id===y.id)){const T=await o(b);p.initResourceList({currentFolder:T,resources:[T]}),n.value=!1;return}const v=ft.dirname(y.path),{resource:h,children:E}=await r.listFiles(S,{path:v});h.type==="file"?p.initResourceList({currentFolder:h,resources:[h]}):p.initResourceList({currentFolder:h,resources:E})}catch(w){if(w.statusCode===401)return s.handleAuthError(f(e));p.setCurrentFolder(null),console.error(w)}n.value=!1},activeFiles:d}}function ed({appsStore:e,applicationId:t}){return{applicationMeta:B(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const ur=()=>Je;function Xb({titleSegments:e,eventBus:t}){const n=cr(),{currentTheme:r}=Me.storeToRefs(n);t=t||ur(),st(e,i=>{const o=f(i),s=" - ",a={shortDocumentTitle:o.join(s),fullDocumentTitle:[...o,f(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function vF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:i}){const o=ed({applicationId:t,appsStore:e}),{$gettext:s}=Ie.useGettext(),a=B(()=>{const l=ft.basename(f(f(r)?.fileName))||s(f(i)?.meta?.title||""),u=f(f(o).applicationMeta);return[l,f(n)||u.name||u.id].filter(Boolean)});Xb({titleSegments:a})}function Yb(e={}){const t=e.clientService??Ke(),n=e.authStore??li();return{makeRequest:(i,o,s={})=>{const a=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,l=new gc({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return s.method=i,s.url=o,s.headers={...l.getHeaders(),...s?.headers||{}},a.request(s)}}}const Jb=()=>{const e=at();return{areSpacesLoading:B(()=>!e.spacesInitialized||e.spacesLoading)}},Zb=(e={})=>{const t=at(),{areSpacesLoading:n}=Jb(),r=tn("shareId"),i=tn("fileId"),o=B(()=>Ct(f(i))),s=dt(),a=Ke(),l=B(()=>t.spaces),u=le(null),c=le(null),p=le(!1),d=m=>{const b=m.split("/");return f(l).find(w=>{if(!m.startsWith(w.driveAlias))return!1;const S=w.driveAlias.split("/");return b.length<S.length||b.slice(0,S.length).join("/")!==w.driveAlias?!1:w})};return kl(()=>{const m=f(e.driveAliasAndItem);!m?.startsWith("personal/")&&!m?.startsWith("project/")&&t.setCurrentSpace(null)}),st([e.driveAliasAndItem,n],async([m,b],[w,S])=>{if(m===w&&b===S)return;if(!m||m.startsWith("virtual/")){u.value=null,c.value=null;return}if(f(u)&&m.startsWith(f(u).driveAlias)){c.value=re.urlJoin(m.slice(f(u).driveAlias.length),{leadingSlash:!0});return}let g=null,v=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[h,...E]=m.split("/").slice(1);g=f(l).find(T=>T.id===h),v=E.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[h,...E]=m.split("/").slice(1),T=m.startsWith("ocm-share/")?"ocm-share":"share";let R=Ct(f(r));R?.includes(":")&&(R=[re.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:T,id:R,shareName:f(h)}),v=E.join("/")}else f(o)?g=f(l).find(h=>f(o).startsWith(`${h.fileId}`)):g=d(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(p.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(m)),g&&(v=m.slice(g.driveAlias.length));u.value=g,c.value=re.urlJoin(v,{leadingSlash:!0}),p.value=!1},{immediate:!0,deep:!0}),st(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:c,itemId:o,loading:p}};function ew(e){const t=He(),n=ar(),r=Ht(),i=e.clientService??Ke(),o=e.applicationId,s=li(),{publicLinkContextReady:a}=Me.storeToRefs(s),l=Aa("driveAliasAndItem"),{space:u,item:c,itemId:p,loading:d}=Zb({driveAliasAndItem:l}),m=B(()=>{if(f(d))return null;let b;return f(u)?b=re.urlJoin(f(u).webDavPath,f(c)):b=re.urlJoin(Ct(f(r).params.filePath)),{path:b,driveAliasAndItem:f(l),space:f(u),item:f(c),itemId:f(p),fileName:ft.basename(b),routeName:Ct(f(r).query[xa]),...Kb(f(r).query)}});return vF({appsStore:n,applicationId:o,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...sm({appsStore:n,...e}),...Gb({router:t,currentFileContext:m}),...Yf({clientService:i}),...Qb({clientService:i,currentRoute:r}),...Yb({clientService:i,currentRoute:f(r)})}}const bF=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}}),wF=()=>[{path:"/list",redirect:e=>Kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>Kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:re.urlJoin("personal/home",Ct(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>$i("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>Fn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>Fn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>Fn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Hr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Mi("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(bF),SF=(e,...t)=>{const[n,...r]=t.map(i=>{const o={"files-personal":Kn("files-spaces-generic").name,"files-favorites":$i("files-common-favorites").name,"files-shared-with-others":Fn("files-shares-with-others").name,"files-shared-with-me":Fn("files-shares-with-me").name,"files-trashbin ":Hr("files-trash-generic").name,"files-public-list":Mi("files-public-link").name}[i.name.toString()];return o&&console.warn(`route name "${name}" is deprecated, use "${o.toString()}" instead.`),{...i,...!!o&&{name:o}}});return nc(e,n,...r)},EF={name:"root",path:"/",redirect:e=>Kn("files-spaces-generic",e)},TF=e=>[EF,...ZA(e),...nx(e),...rx(e),...ex(e),...ix(e),...wF()],Ca=()=>{const e=Ke();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:i})=>i===".space")}}},ln=e=>{const t=vt(),n=at(),r=dt(),i=B(()=>n.spaces),o=Aa("driveAliasAndItem"),s=p=>f(e?.space)||f(i).find(d=>d.id===p),a=p=>{let d=p.storageId;(f(o)?.startsWith("public/")||f(o)?.startsWith("ocm/"))&&(d=f(o).split("/")[1]);const m=s(d);if(m&&!re.isMountPointSpaceResource(m))return m;const b=re.isShareResource(p)&&p.shareTypes.includes(re.ShareTypes.remote.value)||p?.id?.toString().startsWith(re.OCM_PROVIDER_ID)?"ocm-share":"share";let w;return p.remoteItemPath?w=ft.basename(p.remoteItemPath):f(o)?.startsWith("share/")||f(o)?.startsWith("ocm-share/")?w=f(o).split("/")[1]:w=p.name,n.getSpace(p.remoteItemId)||n.createShareSpace({driveAliasPrefix:b,id:p.remoteItemId,shareName:w})},l=p=>f(i).filter(d=>re.isMountPointSpaceResource(d)&&re.extractStorageId(d.root.remoteItem.rootId)===p.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:p=>p?.storageId&&p?.storageId===n.personalSpace?.storageId&&p?.path==="/"&&!re.isIncomingShareResource(p),isResourceAccessible:({space:p,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=f(i).some(w=>re.isProjectSpaceResource(w)&&w.id===p.id);return p.isOwner(t.user)||m||l(p).some(w=>d.startsWith(w.root.remoteItem.path))}}},Qi=()=>{const e=Ke(),t=ze();return{createSpace:i=>{const{graphAuthenticated:o}=e;return o.drives.createDrive({name:i},{params:{template:"default"}})},createDefaultMetaFolder:async i=>{const o=await e.webdav.createFolder(i,{path:".space"});return re.extractStorageId(o.parentFolderId)===t.currentFolder?.id&&t.upsertResource(o),o}}},gn=()=>Ar("$loadingService"),ka=()=>{const e=li(),t=Ke(),n=Ie.useGettext();return{headers:B(()=>{const i=new gc({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Xt.v4(),...i.getHeaders()}})}};function AF(e){return new Worker("/assets/worker-BeDmEhWu.js",{name:e?.name})}const tw=({concurrentRequests:e=4}={})=>{const t=dt(),n=gn(),{headers:r}=ka(),{createWorker:i,terminateWorker:o}=qo(),s=({topic:l,space:u,resources:c},p)=>{const d=i(AF,{needsTokenRenewal:!0});let m;f(d.worker).onmessage=b=>{o(d.id),m?.(!0);const{successful:w,failed:S}=JSON.parse(b.data),y=S.map(({resource:g,...v})=>({resource:g,error:re.createHttpError(v)}));p({successful:w,failed:y})},n.addTask(()=>new Promise(b=>{m=b})),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:{...f(r),"X-Request-ID":void 0}}});return{startWorker:s}};function xF(e){return new Worker("/assets/worker-DWoO7i6z.js",{name:e?.name})}const nw=()=>{const e=dt(),t=gn(),{headers:n}=ka(),{createWorker:r,terminateWorker:i}=qo(),o=(a,l)=>{const u=r(xF,{needsTokenRenewal:!0});let c;f(u.worker).onmessage=p=>{i(u.id),c?.(!0);const{successful:d,failed:m}=JSON.parse(p.data),b=m.map(({resourceName:w,...S})=>({resourceName:w,error:re.createHttpError(S)}));l({successful:d,failed:b})},t.addTask(()=>new Promise(p=>{c=p})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...f(n),"X-Request-ID":void 0}}});return{startWorker:o}};function RF(e){return new Worker("/assets/worker-Bc2UmjVr.js",{name:e?.name})}const rw=()=>{const e=dt(),t=gn(),{headers:n}=ka(),{createWorker:r,terminateWorker:i}=qo(),o=({space:a,resources:l,missingFolderPaths:u},c)=>{const p=r(RF,{needsTokenRenewal:!0});let d;f(p.worker).onmessage=m=>{i(p.id),d?.(!0);const{successful:b,failed:w}=JSON.parse(m.data),S=w.map(({resource:y,...g})=>({resource:y,error:re.createHttpError(g)}));c({successful:b,failed:S})},t.addTask(()=>new Promise(m=>{d=m})),p.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:{...f(n),"X-Request-ID":void 0}}});return{startWorker:o}};function CF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const kF=({authService:e})=>{const{createWorker:t}=qo(),n=le();return{startWorker:()=>{n.value=t(CF),f(f(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof CS.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),f(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(!f(n)){console.error("token timer worker is not running");return}f(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!f(n)){console.error("token timer worker is not running");return}f(n).post(JSON.stringify({topic:"reset"}))}}};function PF(e){return e==null}const Xn=()=>{const e=ar(),t=He(),n=Za(),{isEnabled:r}=Qr(),{requestExtensions:i}=Ki(),o=_r(),{openUrl:s}=W0(),a=dt(),{options:l}=Me.storeToRefs(a),{actions:u}=Qa(),{actions:c}=Ja(),{actions:p}=Pa(),{actions:d}=ss(),{actions:m}=Ka(),{actions:b}=Ga(),{actions:w}=as(),{actions:S}=Pd(),{actions:y}=Xa(),{actions:g}=S0(),{actions:v}=Ya(),{actions:h}=ls(),{actions:E}=kd(),T=B(()=>[...f(b),...f(w),...f(d),...f(y),...f(p),...f(v),...f(E),...f(h),...f(u),...f(c),...f(m),...f(S)]),R=B(()=>(i({id:"global.files.context-actions",extensionType:"action"})||[]).map(L=>L.action).filter(L=>PF(L.category)||L.category==="context"||L.category==="actions")),x=B(()=>f(r)?[]:e.fileExtensions.map(L=>{const te=e.apps[L.app];return{name:`editor-${L.app}`,label:()=>L.label?typeof L.label=="function"?L.label():L.label:te.name,icon:L.icon||te.icon,...te.iconFillType&&{iconFillType:te.iconFillType},img:te.img,route:({space:Y,resources:se})=>A({appFileExtension:L,space:Y,resource:se[0]}),handler:Y=>W(L,Y.space,Y.resources[0]),isVisible:({resources:Y})=>!f(o)||Y.length!==1||!Y[0].canDownload()&&!L.secureView||!f(n)&&yn(t,"files-trash-generic")?!1:Y[0].extension&&L.extension?Y[0].extension.toLowerCase()===L.extension.toLowerCase():Y[0].mimeType&&L.mimeType?Y[0].mimeType.toLowerCase()===L.mimeType.toLowerCase()||Y[0].mimeType.split("/")[0].toLowerCase()===L.mimeType.toLowerCase():!1,hasPriority:L.hasPriority,class:`oc-files-actions-${Ib(te.name).toLowerCase()}-trigger`}}).sort((L,te)=>te.hasPriority!==L.hasPriority&&te.hasPriority?1:0)),A=({appFileExtension:L,space:te,resource:Y})=>{const se=re.isShareSpaceResource(te)?te.id:void 0,he=L.routeName||L.app,ae=N(he,te,Y,se);return t.resolve(ae)},N=(L,te,Y,se,he)=>({name:L,params:{driveAliasAndItem:te?.getDriveAliasAndItem(Y)},query:{...se&&{shareId:se},...Y.fileId&&f(l).routing.idBased&&{fileId:Y.fileId},...he&&{templateId:he},...Ra(f(t.currentRoute))}}),W=(L,te,Y)=>{const se=re.isShareSpaceResource(te)?te.id:void 0,he=L.routeName||L.app,ae=N(he,te,Y,se);if(f(l).cernFeatures){const we=t.resolve(ae).href,Q=`${L.routeName}-${Y.path}`;s(we,Q,!0);return}t.push(ae)},O=L=>{const te=D(L);te&&te.handler({...L})},D=L=>{const te=V(L);if(te.length)return te[0]},V=L=>{const te=he=>he.isVisible(L),Y=[...f(R),...f(x),...f(g)].filter(te).sort((he,ae)=>Number(ae.hasPriority)-Number(he.hasPriority)),se=L.omitSystemActions?[]:f(T).filter(te);return[...Y,...se]};return{getDefaultAction:D,getAllOpenWithActions:V,getEditorRouteOpts:N,openEditor:W,triggerDefaultAction:O}},Pa=()=>{const e=dt(),t=He(),{copyResources:n}=Uo(),r=Ie.useGettext(),{$gettext:i}=r,o=ze(),{currentFolder:s}=Me.storeToRefs(o),a=B(()=>jo()?i("⌘ + C"):i("Ctrl + C")),l=({resources:c})=>{Vt(t,"files-common-search")&&(c=c.filter(p=>!re.isProjectSpaceResource(p))),n(c)};return{actions:B(()=>[{name:"copy",icon:"file-copy-2",handler:l,shortcut:f(a),label:()=>i("Copy"),isVisible:({resources:c})=>{if(!xt(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!Vt(t,"files-common-favorites")&&!Vt(t,"files-common-search")||xt(t,"files-spaces-projects")||c.length===0)return!1;if(_n(t,"files-public-link"))return f(s)?.canCreate();if(Vt(t,"files-common-search")&&c.every(p=>re.isProjectSpaceResource(p)))return!1;if(f(e.options.runningOnEos)){const p=c[0].path?.split("/").filter(Boolean)||[];if(xt(t,"files-spaces-generic")&&p.length<5)return!1}return!!f(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var fr=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(fr||{}),Ia=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Ia||{});const IF=()=>{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?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Oa=e=>{const t=le([]),n=le(0),r=a=>{if(!e?.skipDisabledKeyBindingsCheck&&IF())return;const{key:l,ctrlKey:u,metaKey:c,shiftKey:p}=a;let d=null;const m=[];c||u?(d="Control",m.push("altKey","shiftKey")):p&&(d="Shift",m.push("altKey","ctrlKey","metaKey")),!((w,S)=>S.some(y=>w[y]))(a,m)&&f(t).filter(w=>w.primary===l&&w.modifier===d).forEach(w=>{w.preventDefault&&a.preventDefault(),w.callback(a)})},i=(a,l,{preventDefault:u=!0}={})=>{const c=Xt.v4();return t.value.push({id:c,...a,modifier:a.modifier??null,preventDefault:u,callback:l}),c},o=a=>{t.value=t.value.filter(l=>l.id!==a)},s=()=>{n.value=0};return Yn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:i,removeKeyAction:o,selectionCursor:n,resetSelectionCursor:s}};function gi(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,i=t.ctrlKey||t.metaKey;return!r&&!i?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&Je.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),i&&Je.publish("app.files.list.clicked.meta",n),!0)}}}const td=()=>{const e=Oa(),t=10,n=.1;return{setCropperInstance:i=>{e.bindKeyAction({primary:fr.ArrowRight},()=>f(i)?.move(-t,0)),e.bindKeyAction({primary:fr.ArrowLeft},()=>f(i)?.move(t,0)),e.bindKeyAction({primary:fr.ArrowDown},()=>f(i)?.move(0,-t)),e.bindKeyAction({primary:fr.ArrowUp},()=>f(i)?.move(0,t)),e.bindKeyAction({primary:fr.Plus},()=>f(i)?.zoom(n)),e.bindKeyAction({primary:fr.Minus},()=>f(i)?.zoom(-n))}}},nd=()=>{const{showMessage:e,showErrorMessage:t}=nt(),{$gettext:n}=Ie.useGettext(),{copy:r}=Yn.useClipboard(),{interceptModifierClick:i}=gi(),o=async a=>{try{await r(a),e({title:n("The link has been copied to your clipboard.")})}catch(l){t({title:n("Copy link failed"),errors:[l]})}};return{actions:B(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:a=>{const{resources:l,event:u}=a,c=l[0];if(!(u&&i(u,c)))return o(c.privateLink)},isVisible:({space:a,resources:l})=>!(l.length!==1||re.isPublicSpaceResource(a)||re.isTrashResource(l[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},zo={};function OF(e){return e.getIsPending!==void 0}function FF(e){if(OF(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 _F(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 DF(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function NF(e,t){const{class:n,style:r,...i}=_F(e),{class:o,style:s,...a}=DF(t);return{class:[n,o],style:[r,s],...i,...a}}const iw=_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,i=n,o=Fl(),s=le(),a=le(),l=le(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:l}),st(()=>r.src,S=>{p(S)}),p(r.src);function c(S){if(S=S.cloneNode(!0),r.uniqueIds){const y=typeof r.uniqueIds=="string"?r.uniqueIds:u;S=w(S,y,r.uniqueIdsBase)}return S=r.transformSource(S),r.title&&b(S,r.title),S.innerHTML}function p(S){zo[S]||(zo[S]=d(S)),s.value&&zo[S].getIsPending()&&!r.keepDuringLoading&&(s.value=null,i("unloaded")),zo[S].then(y=>{s.value=y,zt(()=>{i("loaded",a.value)})}).catch(y=>{s.value&&(s.value=void 0,i("unloaded")),delete zo[S],i("error",y)})}function d(S){return FF(new Promise((y,g)=>{const v=new XMLHttpRequest;v.open("GET",S,!0),l.value=v,v.onload=()=>{if(v.status>=200&&v.status<400)try{let h=new DOMParser().parseFromString(v.responseText,"text/xml").getElementsByTagName("svg")[0];h?y(h):g(new Error('Loaded file is not valid SVG"'))}catch(h){g(h)}else g(new Error("Error loading SVG"))},v.onerror=g,v.send()}))}const m=()=>s.value?Ll("svg",{...NF(s.value,o),innerHTML:c(s.value),ref:a}):null;function b(S,y){const g=S.getElementsByTagName("title");if(g.length)g[0].textContent=y;else{const v=document.createElementNS("http://www.w3.org/2000/svg","title");v.textContent=y,S.insertBefore(v,S.firstChild)}}function w(S,y,g=""){const v=["id","href","xlink:href","xlink:role","xlink:arcrole"],h=["href","xlink:href"],E=(T,R)=>h.includes(T)&&(R?!R.includes("#"):!1);return[...S.children].forEach(T=>{var R;if((R=T.attributes)!=null&&R.length){const x=Object.values(T.attributes).map(A=>{const N=/url\((.*?)\)/.exec(A.value);return N!=null&&N[1]&&(A.value=A.value.replace(N[0],`url(${g}${N[1]}_${y})`)),A});v.forEach(A=>{const N=x.find(W=>W.name===A);N&&!E(A,N.value)&&(N.value=`${N.value}_${y}`)})}return T.children.length?w(T,y,g):T}),S}return(S,y)=>(X(),Te(m))}}),Pr=_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}){iw.name="inline-svg";const n=t,r=B(()=>ci("oc-icon-title-")),i=B(()=>{const a=`${yx()}icons/`,l=e.fillType.toLowerCase();return l==="none"?`${a}${e.name}.svg`:`${a}${e.name}-${l}.svg`}),o=B(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5.5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),s=a=>{if(e.accessibleLabel!==""){const l=document.createElement("title");l.setAttribute("id",r.value),l.appendChild(document.createTextNode(e.accessibleLabel)),a.insertBefore(l,a.firstChild)}return a};return(a,l)=>(X(),Te(Pn(e.type),{class:z.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",o.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:ve(()=>[me(f(iw),{src:i.value,"transform-source":s,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:z.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:z.normalizeClass(o.value),onLoaded:l[0]||(l[0]=u=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var ow=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Fa=ow.join(","),sw=typeof Element>"u",yi=sw?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_a=!sw&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Da=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Da(t.parentNode));return s},LF=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},aw=function(t,n,r){if(Da(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Fa));return n&&yi.call(t,Fa)&&i.unshift(t),i=i.filter(r),i},Na=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!Da(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=Na(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=yi.call(s,Fa);c&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var p=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!Da(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(p&&d){var m=Na(p===!0?s.children:p.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},lw=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},vi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||LF(t))&&!lw(t)?0:t.tabIndex},$F=function(t,n){var r=vi(t);return r<0&&n&&!lw(t)?0:r},MF=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},cw=function(t){return t.tagName==="INPUT"},BF=function(t){return cw(t)&&t.type==="hidden"},jF=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},UF=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},VF=function(t){if(!t.name)return!0;var n=t.form||_a(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=UF(i,t.form);return!o||o===t},qF=function(t){return cw(t)&&t.type==="radio"},zF=function(t){return qF(t)&&!VF(t)},WF=function(t){var n,r=t&&_a(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,p;r=_a(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(i))}}return o},uw=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},HF=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=yi.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(yi.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,c=_a(t);if(u&&!u.shadowRoot&&i(u)===!0)return uw(t);t.assignedSlot?t=t.assignedSlot:!u&&c!==t.ownerDocument?t=c.host:t=u}t=l}if(WF(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return uw(t);return!1},KF=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return yi.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},La=function(t,n){return!(n.disabled||BF(n)||HF(n,t)||jF(n)||KF(n))},rd=function(t,n){return!(zF(n)||vi(n)<0||!La(t,n))},GF=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},fw=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=$F(a,s),u=s?fw(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(MF).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},QF=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Na([t],n.includeContainer,{filter:rd.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:GF}):r=aw(t,n.includeContainer,rd.bind(null,n)),fw(r)},XF=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Na([t],n.includeContainer,{filter:La.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=aw(t,n.includeContainer,La.bind(null,n)),r},Xi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yi.call(t,Fa)===!1?!1:rd(n,t)},YF=ow.concat("iframe:not([inert]):not([inert] *)").join(","),id=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yi.call(t,YF)===!1?!1:La(n,t)};function od(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JF(e){if(Array.isArray(e))return od(e)}function dw(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=mw(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return s=l.done,l},e:function(l){a=!0,o=l},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function ZF(e,t,n){return(t=i_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function t_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pw(Object(n),!0).forEach(function(r){ZF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n_(e){return JF(e)||e_(e)||mw(e)||t_()}function r_(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i_(e){var t=r_(e,"string");return typeof t=="symbol"?t:t+""}function mw(e,t){if(e){if(typeof e=="string")return od(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?od(e,t):void 0}}var Ir={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=Ir.getActiveTrap(t);n!==r&&Ir.pauseTrap(t);var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),Ir.unpauseTrap(t)},pauseTrap:function(t){var n=Ir.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=Ir.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},o_=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},s_=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Wo=function(t){return t?.key==="Tab"||t?.keyCode===9},a_=function(t){return Wo(t)&&!t.shiftKey},l_=function(t){return Wo(t)&&t.shiftKey},gw=function(t){return setTimeout(t,0)},Ho=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},$a=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},c_=[],u_=function(t,n){var r=n?.document||document,i=n?.trapStack||c_,o=hw({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:a_,isKeyBackward:l_},n),s={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(V,L,te){return V&&V[L]!==void 0?V[L]:o[te||L]},u=function(V,L){var te=typeof L?.composedPath=="function"?L.composedPath():void 0;return s.containerGroups.findIndex(function(Y){var se=Y.container,he=Y.tabbableNodes;return se.contains(V)||te?.includes(se)||he.find(function(ae){return ae===V})})},c=function(V){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=L.hasFallback,Y=te===void 0?!1:te,se=L.params,he=se===void 0?[]:se,ae=o[V];if(typeof ae=="function"&&(ae=ae.apply(void 0,n_(he))),ae===!0&&(ae=void 0),!ae){if(ae===void 0||ae===!1)return ae;throw new Error("`".concat(V,"` was specified but was not a node, or did not return a node"))}var we=ae;if(typeof ae=="string"){try{we=r.querySelector(ae)}catch(Q){throw new Error("`".concat(V,'` appears to be an invalid selector; error="').concat(Q.message,'"'))}if(!we&&!Y)throw new Error("`".concat(V,"` as selector refers to no known node"))}return we},p=function(){var V=c("initialFocus",{hasFallback:!0});if(V===!1)return!1;if(V===void 0||V&&!id(V,o.tabbableOptions))if(u(r.activeElement)>=0)V=r.activeElement;else{var L=s.tabbableGroups[0],te=L&&L.firstTabbableNode;V=te||c("fallbackFocus")}else V===null&&(V=c("fallbackFocus"));if(!V)throw new Error("Your focus-trap needs to have at least one focusable element");return V},d=function(){if(s.containerGroups=s.containers.map(function(V){var L=QF(V,o.tabbableOptions),te=XF(V,o.tabbableOptions),Y=L.length>0?L[0]:void 0,se=L.length>0?L[L.length-1]:void 0,he=te.find(function(Q){return Xi(Q)}),ae=te.slice().reverse().find(function(Q){return Xi(Q)}),we=!!L.find(function(Q){return vi(Q)>0});return{container:V,tabbableNodes:L,focusableNodes:te,posTabIndexesFound:we,firstTabbableNode:Y,lastTabbableNode:se,firstDomTabbableNode:he,lastDomTabbableNode:ae,nextTabbableNode:function(ie){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ae=L.indexOf(ie);return Ae<0?ce?te.slice(te.indexOf(ie)+1).find(function(ee){return Xi(ee)}):te.slice(0,te.indexOf(ie)).reverse().find(function(ee){return Xi(ee)}):L[Ae+(ce?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(V){return V.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(V){return V.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function(V){var L=V.activeElement;if(L)return L.shadowRoot&&L.shadowRoot.activeElement!==null?m(L.shadowRoot):L},b=function(V){if(V!==!1&&V!==m(document)){if(!V||!V.focus){b(p());return}V.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=V,o_(V)&&V.select()}},w=function(V){var L=c("setReturnFocus",{params:[V]});return L||(L===!1?!1:V)},S=function(V){var L=V.target,te=V.event,Y=V.isBackward,se=Y===void 0?!1:Y;L=L||$a(te),d();var he=null;if(s.tabbableGroups.length>0){var ae=u(L,te),we=ae>=0?s.containerGroups[ae]:void 0;if(ae<0)se?he=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:he=s.tabbableGroups[0].firstTabbableNode;else if(se){var Q=s.tabbableGroups.findIndex(function(C){var q=C.firstTabbableNode;return L===q});if(Q<0&&(we.container===L||id(L,o.tabbableOptions)&&!Xi(L,o.tabbableOptions)&&!we.nextTabbableNode(L,!1))&&(Q=ae),Q>=0){var ie=Q===0?s.tabbableGroups.length-1:Q-1,ce=s.tabbableGroups[ie];he=vi(L)>=0?ce.lastTabbableNode:ce.lastDomTabbableNode}else Wo(te)||(he=we.nextTabbableNode(L,!1))}else{var Ae=s.tabbableGroups.findIndex(function(C){var q=C.lastTabbableNode;return L===q});if(Ae<0&&(we.container===L||id(L,o.tabbableOptions)&&!Xi(L,o.tabbableOptions)&&!we.nextTabbableNode(L))&&(Ae=ae),Ae>=0){var ee=Ae===s.tabbableGroups.length-1?0:Ae+1,F=s.tabbableGroups[ee];he=vi(L)>=0?F.firstTabbableNode:F.firstDomTabbableNode}else Wo(te)||(he=we.nextTabbableNode(L))}}else he=c("fallbackFocus");return he},y=function(V){var L=$a(V);if(!(u(L,V)>=0)){if(Ho(o.clickOutsideDeactivates,V)){a.deactivate({returnFocus:o.returnFocusOnDeactivate});return}Ho(o.allowOutsideClick,V)||V.preventDefault()}},g=function(V){var L=$a(V),te=u(L,V)>=0;if(te||L instanceof Document)te&&(s.mostRecentlyFocusedNode=L);else{V.stopImmediatePropagation();var Y,se=!0;if(s.mostRecentlyFocusedNode)if(vi(s.mostRecentlyFocusedNode)>0){var he=u(s.mostRecentlyFocusedNode),ae=s.containerGroups[he].tabbableNodes;if(ae.length>0){var we=ae.findIndex(function(Q){return Q===s.mostRecentlyFocusedNode});we>=0&&(o.isKeyForward(s.recentNavEvent)?we+1<ae.length&&(Y=ae[we+1],se=!1):we-1>=0&&(Y=ae[we-1],se=!1))}}else s.containerGroups.some(function(Q){return Q.tabbableNodes.some(function(ie){return vi(ie)>0})})||(se=!1);else se=!1;se&&(Y=S({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),b(Y||s.mostRecentlyFocusedNode||p())}s.recentNavEvent=void 0},v=function(V){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=V;var te=S({event:V,isBackward:L});te&&(Wo(V)&&V.preventDefault(),b(te))},h=function(V){(o.isKeyForward(V)||o.isKeyBackward(V))&&v(V,o.isKeyBackward(V))},E=function(V){s_(V)&&Ho(o.escapeDeactivates,V)!==!1&&(V.preventDefault(),a.deactivate())},T=function(V){var L=$a(V);u(L,V)>=0||Ho(o.clickOutsideDeactivates,V)||Ho(o.allowOutsideClick,V)||(V.preventDefault(),V.stopImmediatePropagation())},R=function(){if(s.active)return Ir.activateTrap(i,a),s.delayInitialFocusTimer=o.delayInitialFocus?gw(function(){b(p())}):b(p()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",T,{capture:!0,passive:!1}),r.addEventListener("keydown",h,{capture:!0,passive:!1}),r.addEventListener("keydown",E),a},x=function(V){s.active&&!s.paused&&a._setSubtreeIsolation(!1),s.adjacentElements.clear(),s.alreadySilent.clear();var L=new Set,te=new Set,Y=dw(V),se;try{for(Y.s();!(se=Y.n()).done;){var he=se.value;L.add(he);for(var ae=typeof ShadowRoot<"u"&&he.getRootNode()instanceof ShadowRoot,we=he;we;){L.add(we);var Q=we.parentElement,ie=[];Q?ie=Q.children:!Q&&ae&&(ie=we.getRootNode().children,Q=we.getRootNode().host,ae=typeof ShadowRoot<"u"&&Q.getRootNode()instanceof ShadowRoot);var ce=dw(ie),Ae;try{for(ce.s();!(Ae=ce.n()).done;){var ee=Ae.value;te.add(ee)}}catch(F){ce.e(F)}finally{ce.f()}we=Q}}}catch(F){Y.e(F)}finally{Y.f()}L.forEach(function(F){te.delete(F)}),s.adjacentElements=te},A=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",T,!0),r.removeEventListener("keydown",h,!0),r.removeEventListener("keydown",E),a},N=function(V){var L=V.some(function(te){var Y=Array.from(te.removedNodes);return Y.some(function(se){return se===s.mostRecentlyFocusedNode})});L&&b(p())},W=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(N):void 0,O=function(){W&&(W.disconnect(),s.active&&!s.paused&&s.containers.map(function(V){W.observe(V,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(V){if(s.active)return this;var L=l(V,"onActivate"),te=l(V,"onPostActivate"),Y=l(V,"checkCanFocusTrap"),se=Ir.getActiveTrap(i),he=!1;if(se&&!se.paused){var ae;(ae=se._setSubtreeIsolation)===null||ae===void 0||ae.call(se,!1),he=!0}try{Y||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=m(r),L?.();var we=function(){Y&&d(),R(),O(),o.isolateSubtrees&&a._setSubtreeIsolation(!0),te?.()};if(Y)return Y(s.containers.concat()).then(we,we),this;we()}catch(ie){if(se===Ir.getActiveTrap(i)&&he){var Q;(Q=se._setSubtreeIsolation)===null||Q===void 0||Q.call(se,!0)}throw ie}return this},deactivate:function(V){if(!s.active)return this;var L=hw({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},V);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,s.paused||a._setSubtreeIsolation(!1),s.alreadySilent.clear(),A(),s.active=!1,s.paused=!1,O(),Ir.deactivateTrap(i,a);var te=l(L,"onDeactivate"),Y=l(L,"onPostDeactivate"),se=l(L,"checkCanReturnFocus"),he=l(L,"returnFocus","returnFocusOnDeactivate");te?.();var ae=function(){gw(function(){he&&b(w(s.nodeFocusedBeforeActivation)),Y?.()})};return he&&se?(se(w(s.nodeFocusedBeforeActivation)).then(ae,ae),this):(ae(),this)},pause:function(V){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,V)):this},unpause:function(V){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,V)):this},updateContainerElements:function(V){var L=[].concat(V).filter(Boolean);return s.containers=L.map(function(te){return typeof te=="string"?r.querySelector(te):te}),o.isolateSubtrees&&x(s.containers),s.active&&(d(),o.isolateSubtrees&&!s.paused&&a._setSubtreeIsolation(!0)),O(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(V,L){if(s.paused===V)return this;if(s.paused=V,V){var te=l(L,"onPause"),Y=l(L,"onPostPause");te?.(),A(),O(),a._setSubtreeIsolation(!1),Y?.()}else{var se=l(L,"onUnpause"),he=l(L,"onPostUnpause");se?.(),a._setSubtreeIsolation(!0),d(),R(),O(),he?.()}return this}},_setSubtreeIsolation:{value:function(V){o.isolateSubtrees&&s.adjacentElements.forEach(function(L){var te;V?o.isolateSubtrees==="aria-hidden"?((L.ariaHidden==="true"||((te=L.getAttribute("aria-hidden"))===null||te===void 0?void 0:te.toLowerCase())==="true")&&s.alreadySilent.add(L),L.setAttribute("aria-hidden","true")):((L.inert||L.hasAttribute("inert"))&&s.alreadySilent.add(L),L.setAttribute("inert",!0)):s.alreadySilent.has(L)||(o.isolateSubtrees==="aria-hidden"?L.removeAttribute("aria-hidden"):L.removeAttribute("inert"))})}}}),a.updateContainerElements(t),a};function y8(e){return e}const f_={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},d_=_e({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},f_),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const i=le(null),o=B(()=>{const a=i.value;return a&&(a instanceof HTMLElement?a:a.$el)});function s(){return r||(r=u_(o.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return Lt(()=>{st(()=>e.active,a=>{a&&o.value?s().activate():r&&(r.deactivate(),(!o.value||o.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),kl(()=>{r&&r.deactivate(),r=null}),{activate(){s().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const a=t.default().filter(u=>u.type!==Ii);return!a||!a.length||a.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),a):Oi(a[0],{ref:i})}}}}),wn=_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=B(()=>({...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=B(()=>({...e.type==="button"&&{click:o}})),o=s=>{n("click",s)};return(s,a)=>{const l=Ee("oc-spinner");return X(),Te(Pn(e.type),$t(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${f(Tt.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${f(Tt.kebabCase)(e.colorRole)}-${e.appearance}`,{...f(vx)(e.gapSize),...f(bx)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Os(i.value)),{default:ve(()=>[e.showSpinner?(X(),Te(l,{key:0,size:"small",class:"spinner"})):Re("",!0),Ue(s.$slots,"default")]),_:3},16,["aria-label","class"])}}}),p_=["src"],sd=_e({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Vp(),n=B(()=>Object.hasOwn(t,"header")||!!f(e.title)||!!f(e.logoUrl)),r=B(()=>Object.hasOwn(t,"footer"));return(i,o)=>(X(),Te(Pn(e.tag),{class:"oc-card"},{default:ve(()=>[n.value?(X(),pe("div",{key:0,class:z.normalizeClass(["oc-card-header",e.headerClass])},[Ue(i.$slots,"header",{},()=>[e.logoUrl?(X(),pe("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,p_)):Re("",!0),e.title?(X(),Te(Pn(e.titleTag),{key:1,class:"mt-0"},{default:ve(()=>[kt(z.toDisplayString(e.title),1)]),_:1})):Re("",!0)])],2)):Re("",!0),fe("div",{class:z.normalizeClass(["oc-card-body",e.bodyClass])},[Ue(i.$slots,"default")],2),r.value?(X(),pe("div",{key:1,class:z.normalizeClass(["oc-card-footer",e.footerClass])},[Ue(i.$slots,"footer")],2)):Re("",!0)]),_:3}))}}),yw=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:le(!0)};const o=le(!1),s=new IntersectionObserver(a=>{const l=a.at(-1).isIntersecting;o.value=l,f(o)&&r&&r(),t!=="showHide"&&o.value&&s.unobserve(e.value)},{rootMargin:n});return st(e,()=>{s.observe(e.value)}),An(()=>s.disconnect()),{isVisible:o}},vw=()=>{const{width:e}=Yn.useWindowSize();return{isMobile:B(()=>e.value<640)}},h_=Me.defineStore("bottomDrawers",()=>{const e=le([]),t=B(()=>f(e).length?f(e)[f(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const o={id:ci()};return e.value.push(o),o},closeDrawer:o=>{e.value=f(e).filter(s=>s.id!==o)},closeAllDrawers:()=>{e.value=[]}}}),m_=["id"],g_=["textContent"],y_=_e({__name:"OcBottomDrawer",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""},usePortal:{type:Boolean,default:!1},portalTarget:{default:"app.runtime.bottom.drawer"}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:i}=Ie.useGettext(),o=h_(),{showDrawer:s,closeDrawer:a,closeAllDrawers:l}=o,{drawers:u,currentDrawer:c}=Me.storeToRefs(o),p=le(null),d=Tn("bottomDrawerCardBodyRef"),m=B(()=>f(u).map(({id:v})=>v).includes(f(p)?.id)),b=B(()=>f(p)?.id&&f(c)?.id===f(p).id),w=async()=>{p.value=s(),r("show"),await zt(),f(d)?.addEventListener("click",y)},S=()=>{a(f(p)?.id),f(d)?.removeEventListener("click",y),r("hide")},y=v=>{const h=v.target.closest("a[href], button");if(h){if(h.hasAttribute("aria-expanded")){h.setAttribute("aria-expanded","true");return}e.closeOnClick&&(S(),l())}},g=v=>{v.target===v.currentTarget&&l()};return Yn.onKeyStroke("Escape",v=>{v.preventDefault(),l()}),Lt(()=>{f(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",w)}),An(()=>{document.querySelector(e.toggle).removeEventListener("click",w),f(p)&&a(f(p).id)}),st(b,async()=>{f(b)&&(await zt(),document.getElementById(e.drawerId)?.classList.add("active"))}),t({show:w,hide:S}),(v,h)=>{const E=Ee("oc-icon");return m.value?(X(),Te(Pn(e.usePortal?"portal":"div"),{key:0,to:e.usePortal?e.portalTarget:void 0},{default:ve(()=>[fe("div",{class:"oc-bottom-drawer-background fixed inset-0 z-[calc(var(--z-index-modal)+2)] top-0 left-0 bg-black/40 size-full",role:"button",onClick:g},[me(f(d_),{active:b.value},{default:ve(()=>[fe("div",{id:e.drawerId,tabindex:"0",class:z.normalizeClass(["oc-bottom-drawer fixed inset-x-0 bg-role-surface-container-high rounded-t-sm w-full max-h-[66vh] overflow-y-auto transition-all duration-200 bottom-[-100%]",{"[&.active]:bottom-0":b.value}])},[me(sd,{class:"bg-transparent overflow-x-hidden","header-class":"flex flex-row justify-between items-center"},{header:ve(()=>[f(u).length>1?(X(),Te(wn,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":f(i)("Open the parent context menu"),onClick:h[0]||(h[0]=T=>S())},{default:ve(()=>[me(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):Re("",!0),fe("span",{class:"font-semibold",textContent:z.toDisplayString(e.title)},null,8,g_),me(wn,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":f(i)("Close the context menu"),onClick:h[1]||(h[1]=T=>f(l)())},{default:ve(()=>[me(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:ve(()=>[fe("div",{ref_key:"bottomDrawerCardBodyRef",ref:d},[Ue(v.$slots,"default")],512)]),_:3})],10,m_)]),_:3},8,["active"])])]),_:3},8,["to"])):Re("",!0)}}});var Sn="top",Mn="bottom",Bn="right",En="left",ad="auto",Ko=[Sn,Mn,Bn,En],Yi="start",Go="end",v_="clippingParents",bw="viewport",Qo="popper",b_="reference",ww=Ko.reduce(function(e,t){return e.concat([t+"-"+Yi,t+"-"+Go])},[]),Sw=[].concat(Ko,[ad]).reduce(function(e,t){return e.concat([t,t+"-"+Yi,t+"-"+Go])},[]),w_="beforeRead",S_="read",E_="afterRead",T_="beforeMain",A_="main",x_="afterMain",R_="beforeWrite",C_="write",k_="afterWrite",P_=[w_,S_,E_,T_,A_,x_,R_,C_,k_];function dr(e){return e?(e.nodeName||"").toLowerCase():null}function Rn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bi(e){var t=Rn(e).Element;return e instanceof t||e instanceof Element}function jn(e){var t=Rn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ld(e){if(typeof ShadowRoot>"u")return!1;var t=Rn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function I_(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!jn(o)||!dr(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function O_(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!jn(i)||!dr(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Ew={name:"applyStyles",enabled:!0,phase:"write",fn:I_,effect:O_,requires:["computeStyles"]};function pr(e){return e.split("-")[0]}var wi=Math.max,Ma=Math.min,Ji=Math.round;function cd(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Tw(){return!/^((?!chrome|android).)*safari/i.test(cd())}function Zi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&jn(e)&&(i=e.offsetWidth>0&&Ji(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ji(r.height)/e.offsetHeight||1);var s=bi(e)?Rn(e):window,a=s.visualViewport,l=!Tw()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,p=r.width/i,d=r.height/o;return{width:p,height:d,top:c,right:u+p,bottom:c+d,left:u,x:u,y:c}}function ud(e){var t=Zi(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Aw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ld(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Or(e){return Rn(e).getComputedStyle(e)}function F_(e){return["table","td","th"].indexOf(dr(e))>=0}function Xr(e){return((bi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ba(e){return dr(e)==="html"?e:e.assignedSlot||e.parentNode||(ld(e)?e.host:null)||Xr(e)}function xw(e){return!jn(e)||Or(e).position==="fixed"?null:e.offsetParent}function __(e){var t=/firefox/i.test(cd()),n=/Trident/i.test(cd());if(n&&jn(e)){var r=Or(e);if(r.position==="fixed")return null}var i=Ba(e);for(ld(i)&&(i=i.host);jn(i)&&["html","body"].indexOf(dr(i))<0;){var o=Or(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Xo(e){for(var t=Rn(e),n=xw(e);n&&F_(n)&&Or(n).position==="static";)n=xw(n);return n&&(dr(n)==="html"||dr(n)==="body"&&Or(n).position==="static")?t:n||__(e)||t}function fd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Yo(e,t,n){return wi(e,Ma(t,n))}function D_(e,t,n){var r=Yo(e,t,n);return r>n?n:r}function Rw(){return{top:0,right:0,bottom:0,left:0}}function Cw(e){return Object.assign({},Rw(),e)}function kw(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var N_=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Cw(typeof t!="number"?t:kw(t,Ko))};function L_(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=pr(n.placement),l=fd(a),u=[En,Bn].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var p=N_(i.padding,n),d=ud(o),m=l==="y"?Sn:En,b=l==="y"?Mn:Bn,w=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],S=s[l]-n.rects.reference[l],y=Xo(o),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,v=w/2-S/2,h=p[m],E=g-d[c]-p[b],T=g/2-d[c]/2+v,R=Yo(h,T,E),x=l;n.modifiersData[r]=(t={},t[x]=R,t.centerOffset=R-T,t)}}function $_(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Aw(t.elements.popper,i)&&(t.elements.arrow=i))}const M_={name:"arrow",enabled:!0,phase:"main",fn:L_,effect:$_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function eo(e){return e.split("-")[1]}var B_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function j_(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ji(n*i)/i||0,y:Ji(r*i)/i||0}}function Pw(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,p=e.isFixed,d=s.x,m=d===void 0?0:d,b=s.y,w=b===void 0?0:b,S=typeof c=="function"?c({x:m,y:w}):{x:m,y:w};m=S.x,w=S.y;var y=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),v=En,h=Sn,E=window;if(u){var T=Xo(n),R="clientHeight",x="clientWidth";if(T===Rn(n)&&(T=Xr(n),Or(T).position!=="static"&&a==="absolute"&&(R="scrollHeight",x="scrollWidth")),T=T,i===Sn||(i===En||i===Bn)&&o===Go){h=Mn;var A=p&&T===E&&E.visualViewport?E.visualViewport.height:T[R];w-=A-r.height,w*=l?1:-1}if(i===En||(i===Sn||i===Mn)&&o===Go){v=Bn;var N=p&&T===E&&E.visualViewport?E.visualViewport.width:T[x];m-=N-r.width,m*=l?1:-1}}var W=Object.assign({position:a},u&&B_),O=c===!0?j_({x:m,y:w},Rn(n)):{x:m,y:w};if(m=O.x,w=O.y,l){var D;return Object.assign({},W,(D={},D[h]=g?"0":"",D[v]=y?"0":"",D.transform=(E.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",D))}return Object.assign({},W,(t={},t[h]=g?w+"px":"",t[v]=y?m+"px":"",t.transform="",t))}function U_(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:pr(t.placement),variation:eo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Pw(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Pw(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const V_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:U_,data:{}};var ja={passive:!0};function q_(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Rn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,ja)}),a&&l.addEventListener("resize",n.update,ja),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,ja)}),a&&l.removeEventListener("resize",n.update,ja)}}const z_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:q_,data:{}};var W_={left:"right",right:"left",bottom:"top",top:"bottom"};function Ua(e){return e.replace(/left|right|bottom|top/g,function(t){return W_[t]})}var H_={start:"end",end:"start"};function Iw(e){return e.replace(/start|end/g,function(t){return H_[t]})}function dd(e){var t=Rn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function pd(e){return Zi(Xr(e)).left+dd(e).scrollLeft}function K_(e,t){var n=Rn(e),r=Xr(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=Tw();(u||!u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+pd(e),y:l}}function G_(e){var t,n=Xr(e),r=dd(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=wi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=wi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+pd(e),l=-r.scrollTop;return Or(i||n).direction==="rtl"&&(a+=wi(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function hd(e){var t=Or(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ow(e){return["html","body","#document"].indexOf(dr(e))>=0?e.ownerDocument.body:jn(e)&&hd(e)?e:Ow(Ba(e))}function Jo(e,t){var n;t===void 0&&(t=[]);var r=Ow(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Rn(r),s=i?[o].concat(o.visualViewport||[],hd(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Jo(Ba(s)))}function md(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q_(e,t){var n=Zi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Fw(e,t,n){return t===bw?md(K_(e,n)):bi(t)?Q_(t,n):md(G_(Xr(e)))}function X_(e){var t=Jo(Ba(e)),n=["absolute","fixed"].indexOf(Or(e).position)>=0,r=n&&jn(e)?Xo(e):e;return bi(r)?t.filter(function(i){return bi(i)&&Aw(i,r)&&dr(i)!=="body"}):[]}function Y_(e,t,n,r){var i=t==="clippingParents"?X_(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=Fw(e,u,r);return l.top=wi(c.top,l.top),l.right=Ma(c.right,l.right),l.bottom=Ma(c.bottom,l.bottom),l.left=wi(c.left,l.left),l},Fw(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function _w(e){var t=e.reference,n=e.element,r=e.placement,i=r?pr(r):null,o=r?eo(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(i){case Sn:l={x:s,y:t.y-n.height};break;case Mn:l={x:s,y:t.y+t.height};break;case Bn:l={x:t.x+t.width,y:a};break;case En:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=i?fd(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Yi:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Go:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function to(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?v_:a,u=n.rootBoundary,c=u===void 0?bw:u,p=n.elementContext,d=p===void 0?Qo:p,m=n.altBoundary,b=m===void 0?!1:m,w=n.padding,S=w===void 0?0:w,y=Cw(typeof S!="number"?S:kw(S,Ko)),g=d===Qo?b_:Qo,v=e.rects.popper,h=e.elements[b?g:d],E=Y_(bi(h)?h:h.contextElement||Xr(e.elements.popper),l,c,s),T=Zi(e.elements.reference),R=_w({reference:T,element:v,placement:i}),x=md(Object.assign({},v,R)),A=d===Qo?x:T,N={top:E.top-A.top+y.top,bottom:A.bottom-E.bottom+y.bottom,left:E.left-A.left+y.left,right:A.right-E.right+y.right},W=e.modifiersData.offset;if(d===Qo&&W){var O=W[i];Object.keys(N).forEach(function(D){var V=[Bn,Mn].indexOf(D)>=0?1:-1,L=[Sn,Mn].indexOf(D)>=0?"y":"x";N[D]+=O[L]*V})}return N}function J_(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Sw:l,c=eo(r),p=c?a?ww:ww.filter(function(b){return eo(b)===c}):Ko,d=p.filter(function(b){return u.indexOf(b)>=0});d.length===0&&(d=p);var m=d.reduce(function(b,w){return b[w]=to(e,{placement:w,boundary:i,rootBoundary:o,padding:s})[pr(w)],b},{});return Object.keys(m).sort(function(b,w){return m[b]-m[w]})}function Z_(e){if(pr(e)===ad)return[];var t=Ua(e);return[Iw(e),t,Iw(t)]}function eD(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,p=n.rootBoundary,d=n.altBoundary,m=n.flipVariations,b=m===void 0?!0:m,w=n.allowedAutoPlacements,S=t.options.placement,y=pr(S),g=y===S,v=l||(g||!b?[Ua(S)]:Z_(S)),h=[S].concat(v).reduce(function(ce,Ae){return ce.concat(pr(Ae)===ad?J_(t,{placement:Ae,boundary:c,rootBoundary:p,padding:u,flipVariations:b,allowedAutoPlacements:w}):Ae)},[]),E=t.rects.reference,T=t.rects.popper,R=new Map,x=!0,A=h[0],N=0;N<h.length;N++){var W=h[N],O=pr(W),D=eo(W)===Yi,V=[Sn,Mn].indexOf(O)>=0,L=V?"width":"height",te=to(t,{placement:W,boundary:c,rootBoundary:p,altBoundary:d,padding:u}),Y=V?D?Bn:En:D?Mn:Sn;E[L]>T[L]&&(Y=Ua(Y));var se=Ua(Y),he=[];if(o&&he.push(te[O]<=0),a&&he.push(te[Y]<=0,te[se]<=0),he.every(function(ce){return ce})){A=W,x=!1;break}R.set(W,he)}if(x)for(var ae=b?3:1,we=function(Ae){var ee=h.find(function(F){var C=R.get(F);if(C)return C.slice(0,Ae).every(function(q){return q})});if(ee)return A=ee,"break"},Q=ae;Q>0;Q--){var ie=we(Q);if(ie==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const tD={name:"flip",enabled:!0,phase:"main",fn:eD,requiresIfExists:["offset"],data:{_skip:!1}};function Dw(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Nw(e){return[Sn,Bn,Mn,En].some(function(t){return e[t]>=0})}function nD(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=to(t,{elementContext:"reference"}),a=to(t,{altBoundary:!0}),l=Dw(s,r),u=Dw(a,i,o),c=Nw(l),p=Nw(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const rD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:nD};function iD(e,t,n){var r=pr(e),i=[En,Sn].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[En,Bn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function oD(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=Sw.reduce(function(c,p){return c[p]=iD(p,t.rects,o),c},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const sD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:oD};function aD(e){var t=e.state,n=e.name;t.modifiersData[n]=_w({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const lD={name:"popperOffsets",enabled:!0,phase:"read",fn:aD,data:{}};function cD(e){return e==="x"?"y":"x"}function uD(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,p=n.padding,d=n.tether,m=d===void 0?!0:d,b=n.tetherOffset,w=b===void 0?0:b,S=to(t,{boundary:l,rootBoundary:u,padding:p,altBoundary:c}),y=pr(t.placement),g=eo(t.placement),v=!g,h=fd(y),E=cD(h),T=t.modifiersData.popperOffsets,R=t.rects.reference,x=t.rects.popper,A=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,N=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),W=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(T){if(o){var D,V=h==="y"?Sn:En,L=h==="y"?Mn:Bn,te=h==="y"?"height":"width",Y=T[h],se=Y+S[V],he=Y-S[L],ae=m?-x[te]/2:0,we=g===Yi?R[te]:x[te],Q=g===Yi?-x[te]:-R[te],ie=t.elements.arrow,ce=m&&ie?ud(ie):{width:0,height:0},Ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Rw(),ee=Ae[V],F=Ae[L],C=Yo(0,R[te],ce[te]),q=v?R[te]/2-ae-C-ee-N.mainAxis:we-C-ee-N.mainAxis,K=v?-R[te]/2+ae+C+F+N.mainAxis:Q+C+F+N.mainAxis,j=t.elements.arrow&&Xo(t.elements.arrow),H=j?h==="y"?j.clientTop||0:j.clientLeft||0:0,ge=(D=W?.[h])!=null?D:0,xe=Y+q-ge-H,De=Y+K-ge,Oe=Yo(m?Ma(se,xe):se,Y,m?wi(he,De):he);T[h]=Oe,O[h]=Oe-Y}if(a){var Ce,Fe=h==="x"?Sn:En,ye=h==="x"?Mn:Bn,We=T[E],Ge=E==="y"?"height":"width",Qe=We+S[Fe],Xe=We-S[ye],lt=[Sn,En].indexOf(y)!==-1,Et=(Ce=W?.[E])!=null?Ce:0,Bt=lt?Qe:We-R[Ge]-x[Ge]-Et+N.altAxis,jt=lt?We+R[Ge]+x[Ge]-Et-N.altAxis:Xe,ct=m&&lt?D_(Bt,We,jt):Yo(m?Bt:Qe,We,m?jt:Xe);T[E]=ct,O[E]=ct-We}t.modifiersData[r]=O}}const fD={name:"preventOverflow",enabled:!0,phase:"main",fn:uD,requiresIfExists:["offset"]};function dD(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function pD(e){return e===Rn(e)||!jn(e)?dd(e):dD(e)}function hD(e){var t=e.getBoundingClientRect(),n=Ji(t.width)/e.offsetWidth||1,r=Ji(t.height)/e.offsetHeight||1;return n!==1||r!==1}function mD(e,t,n){n===void 0&&(n=!1);var r=jn(t),i=jn(t)&&hD(t),o=Xr(t),s=Zi(e,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((dr(t)!=="body"||hd(o))&&(a=pD(t)),jn(t)?(l=Zi(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=pd(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function gD(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function yD(e){var t=gD(e);return P_.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function vD(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function bD(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Lw={placement:"bottom",modifiers:[],strategy:"absolute"};function $w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function wD(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Lw:i;return function(a,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Lw,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],d=!1,m={state:c,setOptions:function(y){var g=typeof y=="function"?y(c.options):y;w(),c.options=Object.assign({},o,c.options,g),c.scrollParents={reference:bi(a)?Jo(a):a.contextElement?Jo(a.contextElement):[],popper:Jo(l)};var v=yD(bD([].concat(r,c.options.modifiers)));return c.orderedModifiers=v.filter(function(h){return h.enabled}),b(),m.update()},forceUpdate:function(){if(!d){var y=c.elements,g=y.reference,v=y.popper;if($w(g,v)){c.rects={reference:mD(g,Xo(v),c.options.strategy==="fixed"),popper:ud(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(N){return c.modifiersData[N.name]=Object.assign({},N.data)});for(var h=0;h<c.orderedModifiers.length;h++){if(c.reset===!0){c.reset=!1,h=-1;continue}var E=c.orderedModifiers[h],T=E.fn,R=E.options,x=R===void 0?{}:R,A=E.name;typeof T=="function"&&(c=T({state:c,options:x,name:A,instance:m})||c)}}}},update:vD(function(){return new Promise(function(S){m.forceUpdate(),S(c)})}),destroy:function(){w(),d=!0}};if(!$w(a,l))return m;m.setOptions(u).then(function(S){!d&&u.onFirstUpdate&&u.onFirstUpdate(S)});function b(){c.orderedModifiers.forEach(function(S){var y=S.name,g=S.options,v=g===void 0?{}:g,h=S.effect;if(typeof h=="function"){var E=h({state:c,name:y,instance:m,options:v}),T=function(){};p.push(E||T)}})}function w(){p.forEach(function(S){return S()}),p=[]}return m}}var SD=[z_,lD,V_,Ew,sD,tD,fD,M_,rD],ED=wD({defaultModifiers:SD}),TD="tippy-box",Mw="tippy-content",AD="tippy-backdrop",Bw="tippy-arrow",jw="tippy-svg-arrow",Si={passive:!0,capture:!0},Uw=function(){return document.body};function xD(e,t){return{}.hasOwnProperty.call(e,t)}function gd(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function yd(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Vw(e,t){return typeof e=="function"?e.apply(void 0,t):e}function qw(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function RD(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function CD(e){return e.split(/\s+/).filter(Boolean)}function no(e){return[].concat(e)}function zw(e,t){e.indexOf(t)===-1&&e.push(t)}function kD(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function PD(e){return e.split("-")[0]}function Va(e){return[].slice.call(e)}function Ww(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Zo(){return document.createElement("div")}function es(e){return["Element","Fragment"].some(function(t){return yd(e,t)})}function ID(e){return yd(e,"NodeList")}function OD(e){return yd(e,"MouseEvent")}function Hw(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function FD(e){return es(e)?[e]:ID(e)?Va(e):Array.isArray(e)?e:Va(document.querySelectorAll(e))}function vd(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function Kw(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function _D(e){var t,n=no(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function DD(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=PD(s.placement),c=s.modifiersData.offset;if(!c)return!0;var p=u==="bottom"?c.top.y:0,d=u==="top"?c.bottom.y:0,m=u==="right"?c.left.x:0,b=u==="left"?c.right.x:0,w=o.top-r+p>l,S=r-o.bottom-d>l,y=o.left-n+m>l,g=n-o.right-b>l;return w||S||y||g})}function bd(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function Gw(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var hr={isTouch:!1},Qw=0;function ND(){hr.isTouch||(hr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xw))}function Xw(){var e=performance.now();e-Qw<20&&(hr.isTouch=!1,document.removeEventListener("mousemove",Xw)),Qw=e}function LD(){var e=document.activeElement;if(Hw(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function $D(){document.addEventListener("touchstart",ND,Si),window.addEventListener("blur",LD)}var MD=typeof window<"u"&&typeof document<"u",BD=MD?!!window.msCrypto:!1;function ro(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Yw(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function jD(e){return Yw(`
1
+ (function(x,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("deepmerge"),require("portal-vue"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","deepmerge","portal-vue","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","@sentry/vue","screenfull","@codemirror/view"],z):(x=typeof globalThis<"u"?globalThis:x||self,z(x["web-pkg"]={},x.webClient,x.vue,x.vue3Gettext,x.Fuse,x.lodashEs,x.globalAxios,x.uuid,x.fetchEventSource,x.vueConcurrency,x.luxon,x.filesize,x.qs,x.passwordSheriff,x.Uppy,x.Tus,x.XHRUpload,x.utils,x.pinia,x.oidcClientTs,x.core,x.merge$1,x.portalVue,x.DOMPurify,x.Mark,x.PQueue,x.Cropper,x.vueRouter,x.shared,x.mdEditorV3,x.zod,x.vue$1,x.screenfull,x.view))})(this,(function(x,z,Pg,me,Nc,rt,Es,Ct,Ig,$t,vt,Fg,$g,Og,Bc,Lg,_g,jc,we,Mg,Rn,zc,Rs,Uc,Vc,ur,ca,Ds,R,Ro,K,Ng,Bg,jg){"use strict";const zg=e=>e;function qc(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hc={exports:{}},ht=Hc.exports={},Dn,Pn;function ua(){throw new Error("setTimeout has not been defined")}function da(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Dn=setTimeout:Dn=ua}catch{Dn=ua}try{typeof clearTimeout=="function"?Pn=clearTimeout:Pn=da}catch{Pn=da}})();function Wc(e){if(Dn===setTimeout)return setTimeout(e,0);if((Dn===ua||!Dn)&&setTimeout)return Dn=setTimeout,setTimeout(e,0);try{return Dn(e,0)}catch{try{return Dn.call(null,e,0)}catch{return Dn.call(this,e,0)}}}function Vg(e){if(Pn===clearTimeout)return clearTimeout(e);if((Pn===da||!Pn)&&clearTimeout)return Pn=clearTimeout,clearTimeout(e);try{return Pn(e)}catch{try{return Pn.call(null,e)}catch{return Pn.call(this,e)}}}var Hn=[],Kr=!1,xr,Ps=-1;function qg(){!Kr||!xr||(Kr=!1,xr.length?Hn=xr.concat(Hn):Ps=-1,Hn.length&&Qc())}function Qc(){if(!Kr){var e=Wc(qg);Kr=!0;for(var t=Hn.length;t;){for(xr=Hn,Hn=[];++Ps<t;)xr&&xr[Ps].run();Ps=-1,t=Hn.length}xr=null,Kr=!1,Vg(e)}}ht.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hn.push(new Kc(e,t)),Hn.length===1&&!Kr&&Wc(Qc)};function Kc(e,t){this.fun=e,this.array=t}Kc.prototype.run=function(){this.fun.apply(null,this.array)},ht.title="browser",ht.browser=!0,ht.env={},ht.argv=[],ht.version="",ht.versions={};function Wn(){}ht.on=Wn,ht.addListener=Wn,ht.once=Wn,ht.off=Wn,ht.removeListener=Wn,ht.removeAllListeners=Wn,ht.emit=Wn,ht.prependListener=Wn,ht.prependOnceListener=Wn,ht.listeners=function(e){return[]},ht.binding=function(e){throw new Error("process.binding is not supported")},ht.cwd=function(){return"/"},ht.chdir=function(e){throw new Error("process.chdir is not supported")},ht.umask=function(){return 0};var Hg=Hc.exports;const ce=Ug(Hg);function In(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Qe;const fa=new WeakSet;class Wg{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,fa.has(this)&&(fa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Jc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,tu(this),Xc(this);const t=Qe,n=gn;Qe=this,gn=!0;try{return this.fn()}finally{ce.env.NODE_ENV!=="production"&&Qe!==this&&In("Active effect was not restored correctly - this is likely a Vue internal bug."),Yc(this),Qe=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ga(t);this.deps=this.depsTail=void 0,tu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?fa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ma(this)&&this.run()}get dirty(){return ma(this)}}let Gc=0,Do,Po;function Jc(e,t=!1){if(e.flags|=8,t){e.next=Po,Po=e;return}e.next=Do,Do=e}function pa(){Gc++}function ha(){if(--Gc>0)return;if(Po){let t=Po;for(Po=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Do;){let t=Do;for(Do=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Xc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Yc(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),ga(r),Qg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function ma(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Zc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Zc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Io)||(e.globalVersion=Io,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ma(e))))return;e.flags|=2;const t=e.dep,n=Qe,r=gn;Qe=e,gn=!0;try{Xc(e);const o=e.fn(e._value);(t.version===0||R.hasChanged(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Qe=n,gn=r,Yc(e),e.flags&=-3}}function ga(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),ce.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=o),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ga(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Qg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const eu=[];function Gr(){eu.push(gn),gn=!1}function Jr(){const e=eu.pop();gn=e===void 0?!0:e}function tu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Qe;Qe=void 0;try{t()}finally{Qe=n}}}let Io=0;class Kg{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Is{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,ce.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!Qe||!gn||Qe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Qe)n=this.activeLink=new Kg(Qe,this),Qe.deps?(n.prevDep=Qe.depsTail,Qe.depsTail.nextDep=n,Qe.depsTail=n):Qe.deps=Qe.depsTail=n,nu(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Qe.depsTail,n.nextDep=void 0,Qe.depsTail.nextDep=n,Qe.depsTail=n,Qe.deps===n&&(Qe.deps=r)}return ce.env.NODE_ENV!=="production"&&Qe.onTrack&&Qe.onTrack(R.extend({effect:Qe},t)),n}trigger(t){this.version++,Io++,this.notify(t)}notify(t){pa();try{if(ce.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(R.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ha()}}}function nu(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)nu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ce.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Fs=new WeakMap,Ar=Symbol(ce.env.NODE_ENV!=="production"?"Object iterate":""),va=Symbol(ce.env.NODE_ENV!=="production"?"Map keys iterate":""),Fo=Symbol(ce.env.NODE_ENV!=="production"?"Array iterate":"");function Et(e,t,n){if(gn&&Qe){let r=Fs.get(e);r||Fs.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Is),o.map=r,o.key=n),ce.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function dr(e,t,n,r,o,s){const i=Fs.get(e);if(!i){Io++;return}const l=u=>{u&&(ce.env.NODE_ENV!=="production"?u.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:s}):u.trigger())};if(pa(),t==="clear")i.forEach(l);else{const u=R.isArray(e),d=u&&R.isIntegerKey(n);if(u&&n==="length"){const c=Number(r);i.forEach((p,f)=>{(f==="length"||f===Fo||!R.isSymbol(f)&&f>=c)&&l(p)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(Fo)),t){case"add":u?d&&l(i.get("length")):(l(i.get(Ar)),R.isMap(e)&&l(i.get(va)));break;case"delete":u||(l(i.get(Ar)),R.isMap(e)&&l(i.get(va)));break;case"set":R.isMap(e)&&l(i.get(Ar));break}}ha()}function Gg(e,t){const n=Fs.get(e);return n&&n.get(t)}function Xr(e){const t=Be(e);return t===e?t:(Et(t,"iterate",Fo),Ot(e)?t:t.map(yn))}function $s(e){return Et(e=Be(e),"iterate",Fo),e}function fr(e,t){return vn(e)?Yr(hr(e)?yn(t):t):yn(t)}const Jg={__proto__:null,[Symbol.iterator](){return ya(this,Symbol.iterator,e=>fr(this,e))},concat(...e){return Xr(this).concat(...e.map(t=>R.isArray(t)?Xr(t):t))},entries(){return ya(this,"entries",e=>(e[1]=fr(this,e[1]),e))},every(e,t){return Qn(this,"every",e,t,void 0,arguments)},filter(e,t){return Qn(this,"filter",e,t,n=>n.map(r=>fr(this,r)),arguments)},find(e,t){return Qn(this,"find",e,t,n=>fr(this,n),arguments)},findIndex(e,t){return Qn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Qn(this,"findLast",e,t,n=>fr(this,n),arguments)},findLastIndex(e,t){return Qn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Qn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ba(this,"includes",e)},indexOf(...e){return ba(this,"indexOf",e)},join(e){return Xr(this).join(e)},lastIndexOf(...e){return ba(this,"lastIndexOf",e)},map(e,t){return Qn(this,"map",e,t,void 0,arguments)},pop(){return $o(this,"pop")},push(...e){return $o(this,"push",e)},reduce(e,...t){return ru(this,"reduce",e,t)},reduceRight(e,...t){return ru(this,"reduceRight",e,t)},shift(){return $o(this,"shift")},some(e,t){return Qn(this,"some",e,t,void 0,arguments)},splice(...e){return $o(this,"splice",e)},toReversed(){return Xr(this).toReversed()},toSorted(e){return Xr(this).toSorted(e)},toSpliced(...e){return Xr(this).toSpliced(...e)},unshift(...e){return $o(this,"unshift",e)},values(){return ya(this,"values",e=>fr(this,e))}};function ya(e,t,n){const r=$s(e),o=r[t]();return r!==e&&!Ot(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Xg=Array.prototype;function Qn(e,t,n,r,o,s){const i=$s(e),l=i!==e&&!Ot(e),u=i[t];if(u!==Xg[t]){const p=u.apply(e,s);return l?yn(p):p}let d=n;i!==e&&(l?d=function(p,f){return n.call(this,fr(e,p),f,e)}:n.length>2&&(d=function(p,f){return n.call(this,p,f,e)}));const c=u.call(i,d,r);return l&&o?o(c):c}function ru(e,t,n,r){const o=$s(e);let s=n;return o!==e&&(Ot(e)?n.length>3&&(s=function(i,l,u){return n.call(this,i,l,u,e)}):s=function(i,l,u){return n.call(this,i,fr(e,l),u,e)}),o[t](s,...r)}function ba(e,t,n){const r=Be(e);Et(r,"iterate",Fo);const o=r[t](...n);return(o===-1||o===!1)&&Oo(n[0])?(n[0]=Be(n[0]),r[t](...n)):o}function $o(e,t,n=[]){Gr(),pa();const r=Be(e)[t].apply(e,n);return ha(),Jr(),r}const Yg=R.makeMap("__proto__,__v_isRef,__isVue"),ou=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(R.isSymbol));function Zg(e){R.isSymbol(e)||(e=String(e));const t=Be(this);return Et(t,"has",e),t.hasOwnProperty(e)}class su{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?uu:cu:s?cv:lu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=R.isArray(t);if(!o){let u;if(i&&(u=Jg[n]))return u;if(n==="hasOwnProperty")return Zg}const l=Reflect.get(t,n,ft(t)?t:r);if((R.isSymbol(n)?ou.has(n):Yg(n))||(o||Et(t,"get",n),s))return l;if(ft(l)){const u=i&&R.isIntegerKey(n)?l:l.value;return o&&R.isObject(u)?pr(u):u}return R.isObject(l)?o?pr(l):Ta(l):l}}class ev extends su{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=R.isArray(t)&&R.isIntegerKey(n);if(!this._isShallow){const d=vn(s);if(!Ot(r)&&!vn(r)&&(s=Be(s),r=Be(r)),!i&&ft(s)&&!ft(r))return d?(ce.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(s.value=r,!0)}const l=i?Number(n)<t.length:R.hasOwn(t,n),u=Reflect.set(t,n,r,ft(t)?t:o);return t===Be(o)&&(l?R.hasChanged(r,s)&&dr(t,"set",n,r,s):dr(t,"add",n,r)),u}deleteProperty(t,n){const r=R.hasOwn(t,n),o=t[n],s=Reflect.deleteProperty(t,n);return s&&r&&dr(t,"delete",n,void 0,o),s}has(t,n){const r=Reflect.has(t,n);return(!R.isSymbol(n)||!ou.has(n))&&Et(t,"has",n),r}ownKeys(t){return Et(t,"iterate",R.isArray(t)?"length":Ar),Reflect.ownKeys(t)}}class iu extends su{constructor(t=!1){super(!0,t)}set(t,n){return ce.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ce.env.NODE_ENV!=="production"&&In(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const tv=new ev,nv=new iu,rv=new iu(!0),wa=e=>e,Os=e=>Reflect.getPrototypeOf(e);function ov(e,t,n){return function(...r){const o=this.__v_raw,s=Be(o),i=R.isMap(s),l=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=o[e](...r),c=n?wa:t?Yr:yn;return!t&&Et(s,"iterate",u?va:Ar),R.extend(Object.create(d),{next(){const{value:p,done:f}=d.next();return f?{value:p,done:f}:{value:l?[c(p[0]),c(p[1])]:c(p),done:f}}})}}function Ls(e){return function(...t){if(ce.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";In(`${R.capitalize(e)} operation ${n}failed: target is readonly.`,Be(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function sv(e,t){const n={get(o){const s=this.__v_raw,i=Be(s),l=Be(o);e||(R.hasChanged(o,l)&&Et(i,"get",o),Et(i,"get",l));const{has:u}=Os(i),d=t?wa:e?Yr:yn;if(u.call(i,o))return d(s.get(o));if(u.call(i,l))return d(s.get(l));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Et(Be(o),"iterate",Ar),o.size},has(o){const s=this.__v_raw,i=Be(s),l=Be(o);return e||(R.hasChanged(o,l)&&Et(i,"has",o),Et(i,"has",l)),o===l?s.has(o):s.has(o)||s.has(l)},forEach(o,s){const i=this,l=i.__v_raw,u=Be(l),d=t?wa:e?Yr:yn;return!e&&Et(u,"iterate",Ar),l.forEach((c,p)=>o.call(s,d(c),d(p),i))}};return R.extend(n,e?{add:Ls("add"),set:Ls("set"),delete:Ls("delete"),clear:Ls("clear")}:{add(o){!t&&!Ot(o)&&!vn(o)&&(o=Be(o));const s=Be(this);return Os(s).has.call(s,o)||(s.add(o),dr(s,"add",o,o)),this},set(o,s){!t&&!Ot(s)&&!vn(s)&&(s=Be(s));const i=Be(this),{has:l,get:u}=Os(i);let d=l.call(i,o);d?ce.env.NODE_ENV!=="production"&&au(i,l,o):(o=Be(o),d=l.call(i,o));const c=u.call(i,o);return i.set(o,s),d?R.hasChanged(s,c)&&dr(i,"set",o,s,c):dr(i,"add",o,s),this},delete(o){const s=Be(this),{has:i,get:l}=Os(s);let u=i.call(s,o);u?ce.env.NODE_ENV!=="production"&&au(s,i,o):(o=Be(o),u=i.call(s,o));const d=l?l.call(s,o):void 0,c=s.delete(o);return u&&dr(s,"delete",o,void 0,d),c},clear(){const o=Be(this),s=o.size!==0,i=ce.env.NODE_ENV!=="production"?R.isMap(o)?new Map(o):new Set(o):void 0,l=o.clear();return s&&dr(o,"clear",void 0,void 0,i),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=ov(o,e,t)}),n}function Sa(e,t){const n=sv(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(R.hasOwn(n,o)&&o in r?n:r,o,s)}const iv={get:Sa(!1,!1)},av={get:Sa(!0,!1)},lv={get:Sa(!0,!0)};function au(e,t,n){const r=Be(n);if(r!==n&&t.call(e,r)){const o=R.toRawType(e);In(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const lu=new WeakMap,cv=new WeakMap,cu=new WeakMap,uu=new WeakMap;function uv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dv(e){return e.__v_skip||!Object.isExtensible(e)?0:uv(R.toRawType(e))}function Ta(e){return vn(e)?e:ka(e,!1,tv,iv,lu)}function pr(e){return ka(e,!0,nv,av,cu)}function _s(e){return ka(e,!0,rv,lv,uu)}function ka(e,t,n,r,o){if(!R.isObject(e))return ce.env.NODE_ENV!=="production"&&In(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=dv(e);if(s===0)return e;const i=o.get(e);if(i)return i;const l=new Proxy(e,s===2?r:n);return o.set(e,l),l}function hr(e){return vn(e)?hr(e.__v_raw):!!(e&&e.__v_isReactive)}function vn(e){return!!(e&&e.__v_isReadonly)}function Ot(e){return!!(e&&e.__v_isShallow)}function Oo(e){return e?!!e.__v_raw:!1}function Be(e){const t=e&&e.__v_raw;return t?Be(t):e}function du(e){return!R.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&R.def(e,"__v_skip",!0),e}const yn=e=>R.isObject(e)?Ta(e):e,Yr=e=>R.isObject(e)?pr(e):e;function ft(e){return e?e.__v_isRef===!0:!1}function W(e){return fu(e,!1)}function fv(e){return fu(e,!0)}function fu(e,t){return ft(e)?e:new pv(e,t)}class pv{constructor(t,n){this.dep=new Is,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Be(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ot(t)||vn(t);t=r?t:Be(t),R.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),ce.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function a(e){return ft(e)?e.value:e}const hv={get:(e,t,n)=>t==="__v_raw"?e:a(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ft(o)&&!ft(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function mv(e){return hr(e)?e:new Proxy(e,hv)}class gv{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Is,{get:r,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function vv(e){return new gv(e)}class yv{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=Be(t);let o=!0,s=t;if(!R.isArray(t)||!R.isIntegerKey(String(n)))do o=!Oo(s)||Ot(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=a(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ft(this._raw[this._key])){const n=this._object[this._key];if(ft(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Gg(this._raw,this._key)}}class bv{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function wv(e,t,n){return ft(e)?e:R.isFunction(e)?new bv(e):R.isObject(e)&&arguments.length>1?Sv(e,t,n):W(e)}function Sv(e,t,n){return new yv(e,t,n)}class Tv{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Is(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Io-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Qe!==this)return Jc(this,!0),!0;ce.env.NODE_ENV}get value(){const t=ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Zc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ce.env.NODE_ENV!=="production"&&In("Write operation failed: computed value is readonly")}}function kv(e,t,n=!1){let r,o;R.isFunction(e)?r=e:(r=e.get,o=e.set);const s=new Tv(r,o,n);return ce.env.NODE_ENV,s}const Ms={},Ns=new WeakMap;let Er;function Cv(e,t=!1,n=Er){if(n){let r=Ns.get(n);r||Ns.set(n,r=[]),r.push(e)}else ce.env.NODE_ENV!=="production"&&!t&&In("onWatcherCleanup() was called when there was no active watcher to associate with.")}function xv(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:l,call:u}=n,d=y=>{(n.onWarn||In)("Invalid watch source: ",y,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=y=>o?y:Ot(y)||o===!1||o===0?Kn(y,1):Kn(y);let p,f,h,g,m=!1,w=!1;if(ft(e)?(f=()=>e.value,m=Ot(e)):hr(e)?(f=()=>c(e),m=!0):R.isArray(e)?(w=!0,m=e.some(y=>hr(y)||Ot(y)),f=()=>e.map(y=>{if(ft(y))return y.value;if(hr(y))return c(y);if(R.isFunction(y))return u?u(y,2):y();ce.env.NODE_ENV!=="production"&&d(y)})):R.isFunction(e)?t?f=u?()=>u(e,2):e:f=()=>{if(h){Gr();try{h()}finally{Jr()}}const y=Er;Er=p;try{return u?u(e,3,[g]):e(g)}finally{Er=y}}:(f=R.NOOP,ce.env.NODE_ENV!=="production"&&d(e)),t&&o){const y=f,E=o===!0?1/0:o;f=()=>Kn(y(),E)}const T=()=>{p.stop()};if(s&&t){const y=t;t=(...E)=>{y(...E),T()}}let k=w?new Array(e.length).fill(Ms):Ms;const S=y=>{if(!(!(p.flags&1)||!p.dirty&&!y))if(t){const E=p.run();if(o||m||(w?E.some((D,$)=>R.hasChanged(D,k[$])):R.hasChanged(E,k))){h&&h();const D=Er;Er=p;try{const $=[E,k===Ms?void 0:w&&k[0]===Ms?[]:k,g];k=E,u?u(t,3,$):t(...$)}finally{Er=D}}}else p.run()};return l&&l(S),p=new Wg(f),p.scheduler=i?()=>i(S,!1):S,g=y=>Cv(y,!1,p),h=p.onStop=()=>{const y=Ns.get(p);if(y){if(u)u(y,4);else for(const E of y)E();Ns.delete(p)}},ce.env.NODE_ENV!=="production"&&(p.onTrack=n.onTrack,p.onTrigger=n.onTrigger),t?r?S(!0):k=p.run():i?i(S.bind(null,!0),!0):p.run(),T.pause=p.pause.bind(p),T.resume=p.resume.bind(p),T.stop=T,T}function Kn(e,t=1/0,n){if(t<=0||!R.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ft(e))Kn(e.value,t,n);else if(R.isArray(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(R.isSet(e)||R.isMap(e))e.forEach(r=>{Kn(r,t,n)});else if(R.isPlainObject(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}const Rr=[];function Av(e){Rr.push(e)}function Ev(){Rr.pop()}let Ca=!1;function _e(e,...t){if(Ca)return;Ca=!0,Gr();const n=Rr.length?Rr[Rr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Rv();if(r)Bs(r,n,11,[e+t.map(s=>{var i,l;return(l=(i=s.toString)==null?void 0:i.call(s))!=null?l:JSON.stringify(s)}).join(""),n&&n.proxy,o.map(({vnode:s})=>`at <${Yu(n,s.type)}>`).join(`
2
+ `),o]);else{const s=[`[Vue warn]: ${e}`,...t];o.length&&s.push(`
3
+ `,...Dv(o)),console.warn(...s)}Jr(),Ca=!1}function Rv(){let e=Rr[Rr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function Dv(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
+ `],...Pv(n))}),t}function Pv({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${Yu(e.component,e.type,r)}`,s=">"+n;return e.props?[o,...Iv(e.props),s]:[o+s]}function Iv(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...pu(r,e[r]))}),n.length>3&&t.push(" ..."),t}function pu(e,t,n){return R.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ft(t)?(t=pu(e,Be(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Be(t),n?t:[`${e}=`,t])}const xa={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Bs(e,t,n,r){try{return r?e(...r):e()}catch(o){js(o,t,n)}}function Aa(e,t,n,r){if(R.isFunction(e)){const o=Bs(e,t,n,r);return o&&R.isPromise(o)&&o.catch(s=>{js(s,t,n)}),o}if(R.isArray(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Aa(e[s],t,n,r));return o}else ce.env.NODE_ENV!=="production"&&_e(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function js(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||R.EMPTY_OBJ;if(t){let l=t.parent;const u=t.proxy,d=ce.env.NODE_ENV!=="production"?xa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,u,d)===!1)return}l=l.parent}if(s){Gr(),Bs(s,null,10,[e,u,d]),Jr();return}}Fv(e,n,o,r,i)}function Fv(e,t,n,r=!0,o=!1){if(ce.env.NODE_ENV!=="production"){const s=xa[t];if(n&&Av(n),_e(`Unhandled error${s?` during execution of ${s}`:""}`),n&&Ev(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const tn=[];let Gn=-1;const Zr=[];let mr=null,eo=0;const hu=Promise.resolve();let zs=null;const $v=100;function xt(e){const t=zs||hu;return e?t.then(this?e.bind(this):e):t}function Ov(e){let t=Gn+1,n=tn.length;for(;t<n;){const r=t+n>>>1,o=tn[r],s=Lo(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Ea(e){if(!(e.flags&1)){const t=Lo(e),n=tn[tn.length-1];!n||!(e.flags&2)&&t>=Lo(n)?tn.push(e):tn.splice(Ov(t),0,e),e.flags|=1,mu()}}function mu(){zs||(zs=hu.then(vu))}function gu(e){R.isArray(e)?Zr.push(...e):mr&&e.id===-1?mr.splice(eo+1,0,e):e.flags&1||(Zr.push(e),e.flags|=1),mu()}function Lv(e){if(Zr.length){const t=[...new Set(Zr)].sort((n,r)=>Lo(n)-Lo(r));if(Zr.length=0,mr){mr.push(...t);return}for(mr=t,ce.env.NODE_ENV!=="production"&&(e=e||new Map),eo=0;eo<mr.length;eo++){const n=mr[eo];ce.env.NODE_ENV!=="production"&&yu(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}mr=null,eo=0}}const Lo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function vu(e){ce.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ce.env.NODE_ENV!=="production"?n=>yu(e,n):R.NOOP;try{for(Gn=0;Gn<tn.length;Gn++){const n=tn[Gn];if(n&&!(n.flags&8)){if(ce.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Bs(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;Gn<tn.length;Gn++){const n=tn[Gn];n&&(n.flags&=-2)}Gn=-1,tn.length=0,Lv(e),zs=null,(tn.length||Zr.length)&&vu(e)}}function yu(e,t){const n=e.get(t)||0;if(n>$v){const r=t.i,o=r&&ri(r.type);return js(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let _o=!1;const Ra=new Map;ce.env.NODE_ENV!=="production"&&(R.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Da(_v),rerender:Da(Mv),reload:Da(Nv)});const Us=new Map;function _v(e,t){return Us.has(e)?!1:(Us.set(e,{initialDef:Vs(t),instances:new Set}),!0)}function Vs(e){return Zu(e)?e.__vccOpts:e}function Mv(e,t){const n=Us.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Vs(r.type).render=t),r.renderCache=[],_o=!0,r.job.flags&8||r.update(),_o=!1}))}function Nv(e,t){const n=Us.get(e);if(!n)return;t=Vs(t),bu(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const s=r[o],i=Vs(s.type);let l=Ra.get(i);l||(i!==n.initialDef&&bu(i,t),Ra.set(i,l=new Set)),l.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(l.add(s),s.ceReload(t.styles),l.delete(s)):s.parent?Ea(()=>{s.job.flags&8||(_o=!0,s.parent.update(),_o=!1,l.delete(s))}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(i)}gu(()=>{Ra.clear()})}function bu(e,t){R.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Da(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let gr,Mo=[],Pa=!1;function Bv(e,...t){gr?gr.emit(e,...t):Pa||Mo.push({event:e,args:t})}function wu(e,t){var n,r;gr=e,gr?(gr.enabled=!0,Mo.forEach(({event:o,args:s})=>gr.emit(o,...s)),Mo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{wu(s,t)}),setTimeout(()=>{gr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Pa=!0,Mo=[])},3e3)):(Pa=!0,Mo=[])}const jv=zv("component:updated");function zv(e){return t=>{Bv(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Rt=null,Su=null;function Tu(e){const t=Rt;return Rt=e,Su=e&&e.type.__scopeId||null,t}function Z(e,t=Rt,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Zs(-1);const s=Tu(t);let i;try{i=e(...o)}finally{Tu(s),r._d&&Zs(1)}return ce.env.NODE_ENV!=="production"&&jv(t),i};return r._n=!0,r._c=!0,r._d=!0,r}function je(e,t){if(Rt===null)return ce.env.NODE_ENV!=="production"&&_e("withDirectives can only be used inside render functions."),e;const n=Xu(Rt),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,l,u=R.EMPTY_OBJ]=t[o];s&&(R.isFunction(s)&&(s={mounted:s,updated:s}),s.deep&&Kn(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:l,modifiers:u}))}return e}function Dr(e,t){if(ce.env.NODE_ENV!=="production"&&(!Nt||Nt.isMounted)&&_e("provide() can only be used inside setup()."),Nt){let n=Nt.provides;const r=Nt.parent&&Nt.parent.provides;r===n&&(n=Nt.provides=Object.create(r)),n[e]=t}}function Jn(e,t,n=!1){const r=ni();if(r||cy){let o=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&R.isFunction(t)?t.call(r&&r.proxy):t;ce.env.NODE_ENV!=="production"&&_e(`injection "${String(e)}" not found.`)}else ce.env.NODE_ENV!=="production"&&_e("inject() can only be used inside setup() or functional components.")}const Uv=Symbol.for("v-scx"),Vv=()=>{{const e=Jn(Uv);return e||ce.env.NODE_ENV!=="production"&&_e("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Ue(e,t,n){return ce.env.NODE_ENV!=="production"&&!R.isFunction(t)&&_e("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),ku(e,t,n)}function ku(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:o,flush:s,once:i}=n;ce.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&_e('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&_e('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&_e('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=R.extend({},n);ce.env.NODE_ENV!=="production"&&(l.onWarn=_e);const u=t&&r||!t&&s!=="post";let d;if(ro){if(s==="sync"){const h=Vv();d=h.__watcherHandles||(h.__watcherHandles=[])}else if(!u){const h=()=>{};return h.stop=R.NOOP,h.resume=R.NOOP,h.pause=R.NOOP,h}}const c=Nt;l.call=(h,g,m)=>Aa(h,c,g,m);let p=!1;s==="post"?l.scheduler=h=>{Na(h,c&&c.suspense)}:s!=="sync"&&(p=!0,l.scheduler=(h,g)=>{g?h():Ea(h)}),l.augmentJob=h=>{t&&(h.flags|=4),p&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=xv(e,t,l);return ro&&(d?d.push(f):u&&f()),f}function qv(e,t,n){const r=this.proxy,o=R.isString(e)?e.includes(".")?Hv(r,e):()=>r[e]:e.bind(r,r);let s;R.isFunction(t)?s=t:(s=t.handler,n=t);const i=Gu(this),l=ku(o,s.bind(r),n);return i(),l}function Hv(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const Wv=Symbol("_vte"),Qv=e=>e.__isTeleport,Pr=e=>e&&(e.disabled||e.disabled===""),Cu=e=>e&&(e.defer||e.defer===""),xu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Au=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ia=(e,t)=>{const n=e&&e.to;if(R.isString(n))if(t){const r=t(n);return ce.env.NODE_ENV!=="production"&&!r&&!Pr(e)&&_e(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return ce.env.NODE_ENV!=="production"&&_e("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ce.env.NODE_ENV!=="production"&&!n&&!Pr(e)&&_e(`Invalid Teleport target: ${n}`),n},Eu={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,l,u,d){const{mc:c,pc:p,pbc:f,o:{insert:h,querySelector:g,createText:m,createComment:w}}=d,T=Pr(t.props);let{shapeFlag:k,children:S,dynamicChildren:y}=t;if(ce.env.NODE_ENV!=="production"&&_o&&(u=!1,y=null),e==null){const E=t.el=ce.env.NODE_ENV!=="production"?w("teleport start"):m(""),D=t.anchor=ce.env.NODE_ENV!=="production"?w("teleport end"):m("");h(E,n,r),h(D,n,r);const $=(L,V)=>{k&16&&c(S,L,V,o,s,i,l,u)},_=()=>{const L=t.target=Ia(t.props,g),V=$a(L,t,m,h);L?(i!=="svg"&&xu(L)?i="svg":i!=="mathml"&&Au(L)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(L),T||($(L,V),Hs(t,!1))):ce.env.NODE_ENV!=="production"&&!T&&_e("Invalid Teleport target on mount:",L,`(${typeof L})`)};T&&($(n,D),Hs(t,!0)),Cu(t.props)?(t.el.__isMounted=!1,Na(()=>{_(),delete t.el.__isMounted},s)):_()}else{if(Cu(t.props)&&e.el.__isMounted===!1){Na(()=>{Eu.process(e,t,n,r,o,s,i,l,u,d)},s);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,D=t.target=e.target,$=t.targetAnchor=e.targetAnchor,_=Pr(e.props),L=_?n:D,V=_?E:$;if(i==="svg"||xu(D)?i="svg":(i==="mathml"||Au(D))&&(i="mathml"),y?(f(e.dynamicChildren,y,L,o,s,i,l),zu(e,t,ce.env.NODE_ENV==="production")):u||p(e,t,L,V,o,s,i,l,!1),T)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):qs(t,n,E,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const te=t.target=Ia(t.props,g);te?qs(t,te,null,d,0):ce.env.NODE_ENV!=="production"&&_e("Invalid Teleport target on update:",D,`(${typeof D})`)}else _&&qs(t,D,$,d,1);Hs(t,T)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:l,anchor:u,targetStart:d,targetAnchor:c,target:p,props:f}=e;if(p&&(o(d),o(c)),s&&o(u),i&16){const h=s||!Pr(f);for(let g=0;g<l.length;g++){const m=l[g];r(m,t,n,h,!!m.dynamicChildren)}}},move:qs,hydrate:Kv};function qs(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:u,children:d,props:c}=e,p=s===2;if(p&&r(i,t,n),(!p||Pr(c))&&u&16)for(let f=0;f<d.length;f++)o(d[f],t,n,2);p&&r(l,t,n)}function Kv(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:l,querySelector:u,insert:d,createText:c}},p){function f(w,T){let k=T;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,w._lpa=t.targetAnchor&&i(t.targetAnchor);break}}k=i(k)}}function h(w,T){T.anchor=p(i(w),T,l(w),n,r,o,s)}const g=t.target=Ia(t.props,u),m=Pr(t.props);if(g){const w=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(g,w),t.targetAnchor||$a(g,t,c,d,l(e)===g?e:null)):(t.anchor=i(e),f(g,w),t.targetAnchor||$a(g,t,c,d),p(w&&i(w),t,g,n,r,o,s))),Hs(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Fa=Eu;function Hs(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function $a(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Wv]=i,e&&(r(s,e,o),r(i,e,o)),i}function Ru(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ru(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ge(e,t){return R.isFunction(e)?R.extend({name:e.name},t,{setup:e}):e}function Gv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Jv=new WeakSet;function nn(e){const t=ni(),n=fv(null);if(t){const o=t.refs===R.EMPTY_OBJ?t.refs={}:t.refs;ce.env.NODE_ENV!=="production"&&Xv(o,e)?_e(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else ce.env.NODE_ENV!=="production"&&_e("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ce.env.NODE_ENV!=="production"?pr(n):n;return ce.env.NODE_ENV!=="production"&&Jv.add(r),r}function Xv(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Du=e=>e.nodeType===8;R.getGlobalThis().requestIdleCallback,R.getGlobalThis().cancelIdleCallback;function Yv(e,t){if(Du(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Du(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Zv=e=>!!e.type.__asyncLoader;function ey(e){R.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:l=!0,onError:u}=e;let d=null,c,p=0;const f=()=>(p++,d=null,h()),h=()=>{let g;return d||(g=d=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),u)return new Promise((w,T)=>{u(m,()=>w(f()),()=>T(m),p+1)});throw m}).then(m=>{if(g!==d&&d)return d;if(ce.env.NODE_ENV!=="production"&&!m&&_e("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),ce.env.NODE_ENV!=="production"&&m&&!R.isObject(m)&&!R.isFunction(m))throw new Error(`Invalid async component load result: ${m}`);return c=m,m}))};return ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(g,m,w){let T=!1;(m.bu||(m.bu=[])).push(()=>T=!0);const k=()=>{if(T){ce.env.NODE_ENV!=="production"&&_e(`Skipping lazy hydration for component '${ri(c)||c.__file}': it was updated before lazy hydration performed.`);return}w()},S=s?()=>{const y=s(k,E=>Yv(g,E));y&&(m.bum||(m.bum=[])).push(y)}:k;c?S():h().then(()=>!m.isUnmounted&&S())},get __asyncResolved(){return c},setup(){const g=Nt;if(Gv(g),c)return()=>Ws(c,g);const m=S=>{d=null,js(S,g,13,!r)};if(l&&g.suspense||ro)return h().then(S=>()=>Ws(S,g)).catch(S=>(m(S),()=>r?J(r,{error:S}):null));const w=W(!1),T=W(),k=W(!!o);return o&&setTimeout(()=>{k.value=!1},o),i!=null&&setTimeout(()=>{if(!w.value&&!T.value){const S=new Error(`Async component timed out after ${i}ms.`);m(S),T.value=S}},i),h().then(()=>{w.value=!0,g.parent&&ty(g.parent.vnode)&&g.parent.update()}).catch(S=>{m(S),T.value=S}),()=>{if(w.value&&c)return Ws(c,g);if(T.value&&r)return J(r,{error:T.value});if(n&&!k.value)return Ws(n,g)}}})}function Ws(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=J(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const ty=e=>e.type.__isKeepAlive;function ny(e,t,n=Nt,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Gr();const l=Gu(n),u=Aa(t,n,e,i);return l(),Jr(),u});return r?o.unshift(s):o.push(s),s}else if(ce.env.NODE_ENV!=="production"){const o=R.toHandlerKey(xa[e].replace(/ hook$/,""));_e(`${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Oa=e=>(t,n=Nt)=>{(!ro||e==="sp")&&ny(e,(...r)=>t(...r),n)},yt=Oa("m"),bn=Oa("bum"),Qs=Oa("um"),Ks="components",ry="directives";function oe(e,t){return La(Ks,e,!0,t)||e}const Pu=Symbol.for("v-ndc");function rn(e){return R.isString(e)?La(Ks,e,!1)||e:e||Pu}function Lt(e){return La(ry,e)}function La(e,t,n=!0,r=!1){const o=Rt||Nt;if(o){const s=o.type;if(e===Ks){const l=ri(s,!1);if(l&&(l===t||l===R.camelize(t)||l===R.capitalize(R.camelize(t))))return s}const i=Iu(o[e]||s[e],t)||Iu(o.appContext[e],t);if(!i&&r)return s;if(ce.env.NODE_ENV!=="production"&&n&&!i){const l=e===Ks?`
5
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";_e(`Failed to resolve ${e.slice(0,-1)}: ${t}${l}`)}return i}else ce.env.NODE_ENV!=="production"&&_e(`resolve${R.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Iu(e,t){return e&&(e[t]||e[R.camelize(t)]||e[R.capitalize(R.camelize(t))])}function Ye(e,t,n,r){let o;const s=n,i=R.isArray(e);if(i||R.isString(e)){const l=i&&hr(e);let u=!1,d=!1;l&&(u=!Ot(e),d=vn(e),e=$s(e)),o=new Array(e.length);for(let c=0,p=e.length;c<p;c++)o[c]=t(u?d?Yr(yn(e[c])):yn(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){ce.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&_e(`The v-for range expect an integer value but got ${e}.`),o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,s)}else if(R.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(l,u)=>t(l,u,void 0,s));else{const l=Object.keys(e);o=new Array(l.length);for(let u=0,d=l.length;u<d;u++){const c=l[u];o[u]=t(e[c],c,u,s)}}else o=[];return o}function Fu(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(R.isArray(r))for(let o=0;o<r.length;o++)e[r[o].name]=r[o].fn;else r&&(e[r.name]=r.key?(...o)=>{const s=r.fn(...o);return s&&(s.key=r.key),s}:r.fn)}return e}function Ce(e,t,n={},r,o){if(Rt.ce||Rt.parent&&Zv(Rt.parent)&&Rt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),I(),re(Ae,null,[J("slot",n,r&&r())],d?-2:64)}let s=e[t];ce.env.NODE_ENV!=="production"&&s&&s.length>1&&(_e("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),s=()=>[]),s&&s._c&&(s._d=!1),I();const i=s&&$u(s(n)),l=n.key||i&&i.key,u=re(Ae,{key:(l&&!R.isSymbol(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&e._===1?64:-2);return!o&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),s&&s._c&&(s._d=!0),u}function $u(e){return e.some(t=>ei(t)?!(t.type===to||t.type===Ae&&!$u(t.children)):!0)?e:null}function Gs(e,t){const n={};if(ce.env.NODE_ENV!=="production"&&!R.isObject(e))return _e("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R.toHandlerKey(r)]=e[r];return n}const _a=e=>e?my(e)?Xu(e):_a(e.parent):null,Ma=R.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ce.env.NODE_ENV!=="production"?_s(e.props):e.props,$attrs:e=>ce.env.NODE_ENV!=="production"?_s(e.attrs):e.attrs,$slots:e=>ce.env.NODE_ENV!=="production"?_s(e.slots):e.slots,$refs:e=>ce.env.NODE_ENV!=="production"?_s(e.refs):e.refs,$parent:e=>_a(e.parent),$root:e=>_a(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>sy(e),$forceUpdate:e=>e.f||(e.f=()=>{Ea(e.update)}),$nextTick:e=>e.n||(e.n=xt.bind(e.proxy)),$watch:e=>qv.bind(e)}),oy={};ce.env.NODE_ENV!=="production"&&(oy.ownKeys=e=>(_e("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function Ou(){return Lu("useSlots").slots}function Js(){return Lu("useAttrs").attrs}function Lu(e){const t=ni();return ce.env.NODE_ENV!=="production"&&!t&&_e(`${e}() called without active instance.`),t.setupContext||(t.setupContext=vy(t))}function _u(e){return R.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function sy(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let u;return l?u=l:!o.length&&!n&&!r?u=t:(u={},o.length&&o.forEach(d=>Xs(u,d,i,!0)),Xs(u,t,i)),R.isObject(t)&&s.set(t,u),u}function Xs(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&Xs(e,s,n,!0),o&&o.forEach(i=>Xs(e,i,n,!0));for(const i in t)if(r&&i==="expose")ce.env.NODE_ENV!=="production"&&_e('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const l=iy[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const iy={data:Mu,props:Bu,emits:Bu,methods:No,computed:No,beforeCreate:Mt,created:Mt,beforeMount:Mt,mounted:Mt,beforeUpdate:Mt,updated:Mt,beforeDestroy:Mt,beforeUnmount:Mt,destroyed:Mt,unmounted:Mt,activated:Mt,deactivated:Mt,errorCaptured:Mt,serverPrefetch:Mt,components:No,directives:No,watch:ly,provide:Mu,inject:ay};function Mu(e,t){return t?e?function(){return R.extend(R.isFunction(e)?e.call(this,this):e,R.isFunction(t)?t.call(this,this):t)}:t:e}function ay(e,t){return No(Nu(e),Nu(t))}function Nu(e){if(R.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Mt(e,t){return e?[...new Set([].concat(e,t))]:t}function No(e,t){return e?R.extend(Object.create(null),e,t):t}function Bu(e,t){return e?R.isArray(e)&&R.isArray(t)?[...new Set([...e,...t])]:R.extend(Object.create(null),_u(e),_u(t??{})):t}function ly(e,t){if(!e)return t;if(!t)return e;const n=R.extend(Object.create(null),e);for(const r in t)n[r]=Mt(e[r],t[r]);return n}let cy=null;const uy={},ju=e=>Object.getPrototypeOf(e)===uy,Na=fy;function zu(e,t,n=!1){const r=e.children,o=t.children;if(R.isArray(r)&&R.isArray(o))for(let s=0;s<r.length;s++){const i=r[s];let l=o[s];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[s]=Ku(o[s]),l.el=i.el),!n&&l.patchFlag!==-2&&zu(i,l)),l.type===Uu&&(l.patchFlag===-1&&(l=o[s]=Ku(l)),l.el=i.el),l.type===to&&!l.el&&(l.el=i.el),ce.env.NODE_ENV!=="production"&&l.el&&(l.el.__vnode=l)}}const dy=e=>e.__isSuspense;function fy(e,t){t&&t.pendingBranch?R.isArray(e)?t.effects.push(...e):t.effects.push(e):gu(e)}const Ae=Symbol.for("v-fgt"),Uu=Symbol.for("v-txt"),to=Symbol.for("v-cmt"),Ys=[];let Yt=null;function I(e=!1){Ys.push(Yt=e?null:[])}function py(){Ys.pop(),Yt=Ys[Ys.length-1]||null}let Bo=1;function Zs(e,t=!1){Bo+=e,e<0&&Yt&&t&&(Yt.hasOnce=!0)}function Vu(e){return e.dynamicChildren=Bo>0?Yt||R.EMPTY_ARR:null,py(),Bo>0&&Yt&&Yt.push(e),e}function G(e,t,n,r,o,s){return Vu(Q(e,t,n,r,o,s,!0))}function re(e,t,n,r,o){return Vu(J(e,t,n,r,o,!0))}function ei(e){return e?e.__v_isVNode===!0:!1}const hy=(...e)=>Hu(...e),qu=({key:e})=>e??null,ti=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?R.isString(e)||ft(e)||R.isFunction(e)?{i:Rt,r:e,k:t,f:!!n}:e:null);function Q(e,t=null,n=null,r=0,o=null,s=e===Ae?0:1,i=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qu(t),ref:t&&ti(t),scopeId:Su,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Rt};return l?(Ba(u,n),s&128&&e.normalize(u)):n&&(u.shapeFlag|=R.isString(n)?8:16),ce.env.NODE_ENV!=="production"&&u.key!==u.key&&_e("VNode created with invalid key (NaN). VNode type:",u.type),Bo>0&&!i&&Yt&&(u.patchFlag>0||s&6)&&u.patchFlag!==32&&Yt.push(u),u}const J=ce.env.NODE_ENV!=="production"?hy:Hu;function Hu(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Pu)&&(ce.env.NODE_ENV!=="production"&&!e&&_e(`Invalid vnode type when creating vnode: ${e}.`),e=to),ei(e)){const l=no(e,t,!0);return n&&Ba(l,n),Bo>0&&!s&&Yt&&(l.shapeFlag&6?Yt[Yt.indexOf(e)]=l:Yt.push(l)),l.patchFlag=-2,l}if(Zu(e)&&(e=e.__vccOpts),t){t=Wu(t);let{class:l,style:u}=t;l&&!R.isString(l)&&(t.class=R.normalizeClass(l)),R.isObject(u)&&(Oo(u)&&!R.isArray(u)&&(u=R.extend({},u)),t.style=R.normalizeStyle(u))}const i=R.isString(e)?1:dy(e)?128:Qv(e)?64:R.isObject(e)?4:R.isFunction(e)?2:0;return ce.env.NODE_ENV!=="production"&&i&4&&Oo(e)&&(e=Be(e),_e("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
+ Component that was made reactive: `,e)),Q(e,t,n,r,o,i,s,!0)}function Wu(e){return e?Oo(e)||ju(e)?R.extend({},e):e:null}function no(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:l,transition:u}=e,d=t?pt(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&qu(d),ref:t&&t.ref?n&&s?R.isArray(s)?s.concat(ti(t)):[s,ti(t)]:ti(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ce.env.NODE_ENV!=="production"&&i===-1&&R.isArray(l)?l.map(Qu):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ae?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&no(e.ssContent),ssFallback:e.ssFallback&&no(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&Ru(c,u.clone(c)),c}function Qu(e){const t=no(e);return R.isArray(e.children)&&(t.children=e.children.map(Qu)),t}function ct(e=" ",t=0){return J(Uu,null,e,t)}function le(e="",t=!1){return t?(I(),re(to,null,e)):J(to,null,e)}function Ku(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:no(e)}function Ba(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(R.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ba(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ju(t)?t._ctx=Rt:o===3&&Rt&&(Rt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else R.isFunction(t)?(t={default:t,_ctx:Rt},n=32):(t=String(t),r&64?(n=16,t=[ct(t)]):n=8);e.children=t,e.shapeFlag|=n}function pt(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=R.normalizeClass([t.class,r.class]));else if(o==="style")t.style=R.normalizeStyle([t.style,r.style]);else if(R.isOn(o)){const s=t[o],i=r[o];i&&s!==i&&!(R.isArray(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}let Nt=null;const ni=()=>Nt||Rt;let ja;{const e=R.getGlobalThis(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};ja=t("__VUE_INSTANCE_SETTERS__",n=>Nt=n),t("__VUE_SSR_SETTERS__",n=>ro=n)}const Gu=e=>{const t=Nt;return ja(e),e.scope.on(),()=>{e.scope.off(),ja(t)}};function my(e){return e.vnode.shapeFlag&4}let ro=!1;const Ju=ce.env.NODE_ENV!=="production"?{get(e,t){return Et(e,"get",""),e[t]},set(){return _e("setupContext.attrs is readonly."),!1},deleteProperty(){return _e("setupContext.attrs is readonly."),!1}}:{get(e,t){return Et(e,"get",""),e[t]}};function gy(e){return new Proxy(e.slots,{get(t,n){return Et(e,"get","$slots"),t[n]}})}function vy(e){const t=n=>{if(ce.env.NODE_ENV!=="production"&&(e.exposed&&_e("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(R.isArray(n)?r="array":ft(n)&&(r="ref")),r!=="object"&&_e(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ce.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Ju))},get slots(){return r||(r=gy(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,Ju),slots:e.slots,emit:e.emit,expose:t}}function Xu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(mv(du(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ma)return Ma[n](e)},has(t,n){return n in t||n in Ma}})):e.proxy}const yy=/(?:^|[-_])\w/g,by=e=>e.replace(yy,t=>t.toUpperCase()).replace(/[-_]/g,"");function ri(e,t=!0){return R.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function Yu(e,t,n=!1){let r=ri(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e){const o=s=>{for(const i in s)if(s[i]===t)return i};r=o(e.components)||e.parent&&o(e.parent.type.components)||o(e.appContext.components)}return r?by(r):n?"App":"Anonymous"}function Zu(e){return R.isFunction(e)&&"__vccOpts"in e}const A=(e,t)=>{const n=kv(e,t,ro);if(ce.env.NODE_ENV!=="production"){const r=ni();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function za(e,t,n){try{Zs(-1);const r=arguments.length;return r===2?R.isObject(t)&&!R.isArray(t)?ei(t)?J(e,null,[t]):J(e,t):J(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ei(n)&&(n=[n]),J(e,t,n))}finally{Zs(1)}}function wy(){if(ce.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(p){if(!R.isObject(p))return null;if(p.__isVue)return["div",e,"VueInstance"];if(ft(p)){Gr();const f=p.value;return Jr(),["div",{},["span",e,c(p)],"<",l(f),">"]}else{if(hr(p))return["div",{},["span",e,Ot(p)?"ShallowReactive":"Reactive"],"<",l(p),`>${vn(p)?" (readonly)":""}`];if(vn(p))return["div",{},["span",e,Ot(p)?"ShallowReadonly":"Readonly"],"<",l(p),">"]}return null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...s(p.$)]}};function s(p){const f=[];p.type.props&&p.props&&f.push(i("props",Be(p.props))),p.setupState!==R.EMPTY_OBJ&&f.push(i("setup",p.setupState)),p.data!==R.EMPTY_OBJ&&f.push(i("data",Be(p.data)));const h=u(p,"computed");h&&f.push(i("computed",h));const g=u(p,"inject");return g&&f.push(i("injected",g)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),f}function i(p,f){return f=R.extend({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(h=>["div",{},["span",r,h+": "],l(f[h],!1)])]]:["span",{}]}function l(p,f=!0){return typeof p=="number"?["span",t,p]:typeof p=="string"?["span",n,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:R.isObject(p)?["object",{object:f?Be(p):p}]:["span",n,String(p)]}function u(p,f){const h=p.type;if(R.isFunction(h))return;const g={};for(const m in p.ctx)d(h,m,f)&&(g[m]=p.ctx[m]);return g}function d(p,f,h){const g=p[h];if(R.isArray(g)&&g.includes(f)||R.isObject(g)&&f in g||p.extends&&d(p.extends,f,h)||p.mixins&&p.mixins.some(m=>d(m,f,h)))return!0}function c(p){return Ot(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const ed=ce.env.NODE_ENV!=="production"?_e:R.NOOP;ce.env.NODE_ENV,ce.env.NODE_ENV;let Sy;const td=typeof window<"u"&&window.trustedTypes;if(td)try{Sy=td.createPolicy("vue",{createHTML:e=>e})}catch(e){ce.env.NODE_ENV!=="production"&&ed(`Error creating trusted types policy: ${e}`)}const nd=Symbol("_vod"),Ty=Symbol("_vsh"),rd={name:"show",beforeMount(e,{value:t},{transition:n}){e[nd]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):jo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),jo(e,!0),r.enter(e)):r.leave(e,()=>{jo(e,!1)}):jo(e,t))},beforeUnmount(e,{value:t}){jo(e,t)}};function jo(e,t){e.style.display=t?e[nd]:"none",e[Ty]=!t}ce.env.NODE_ENV;function vr(e,t,n,r){e.addEventListener(t,n,r)}const yr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return R.isArray(t)?n=>R.invokeArrayFns(t,n):t};function ky(e){e.target.composing=!0}function od(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const on=Symbol("_assign");function sd(e,t,n){return t&&(e=e.trim()),n&&(e=R.looseToNumber(e)),e}const Ua={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[on]=yr(o);const s=r||o.props&&o.props.type==="number";vr(e,t?"change":"input",i=>{i.target.composing||e[on](sd(e.value,n,s))}),(n||s)&&vr(e,"change",()=>{e.value=sd(e.value,n,s)}),t||(vr(e,"compositionstart",ky),vr(e,"compositionend",od),vr(e,"change",od))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[on]=yr(i),e.composing)return;const l=(s||e.type==="number")&&!/^0\d/.test(e.value)?R.looseToNumber(e.value):e.value,u=t??"";l!==u&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===u)||(e.value=u))}},Cy={deep:!0,created(e,t,n){e[on]=yr(n),vr(e,"change",()=>{const r=e._modelValue,o=oo(e),s=e.checked,i=e[on];if(R.isArray(r)){const l=R.looseIndexOf(r,o),u=l!==-1;if(s&&!u)i(r.concat(o));else if(!s&&u){const d=[...r];d.splice(l,1),i(d)}}else if(R.isSet(r)){const l=new Set(r);s?l.add(o):l.delete(o),i(l)}else i(ld(e,s))})},mounted:id,beforeUpdate(e,t,n){e[on]=yr(n),id(e,t,n)}};function id(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(R.isArray(t))o=R.looseIndexOf(t,r.props.value)>-1;else if(R.isSet(t))o=t.has(r.props.value);else{if(t===n)return;o=R.looseEqual(t,ld(e,!0))}e.checked!==o&&(e.checked=o)}const xy={created(e,{value:t},n){e.checked=R.looseEqual(t,n.props.value),e[on]=yr(n),vr(e,"change",()=>{e[on](oo(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[on]=yr(r),t!==n&&(e.checked=R.looseEqual(t,r.props.value))}},Ay={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=R.isSet(t);vr(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?R.looseToNumber(oo(i)):oo(i));e[on](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,xt(()=>{e._assigning=!1})}),e[on]=yr(r)},mounted(e,{value:t}){ad(e,t)},beforeUpdate(e,t,n){e[on]=yr(n)},updated(e,{value:t}){e._assigning||ad(e,t)}};function ad(e,t){const n=e.multiple,r=R.isArray(t);if(n&&!r&&!R.isSet(t)){ce.env.NODE_ENV!=="production"&&ed(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],l=oo(i);if(n)if(r){const u=typeof l;u==="string"||u==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=R.looseIndexOf(t,l)>-1}else i.selected=t.has(l);else if(R.looseEqual(oo(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function oo(e){return"_value"in e?e._value:e.value}function ld(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ey={created(e,t,n){oi(e,t,n,null,"created")},mounted(e,t,n){oi(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){oi(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){oi(e,t,n,r,"updated")}};function Ry(e,t){switch(e){case"SELECT":return Ay;case"TEXTAREA":return Ua;default:switch(t){case"checkbox":return Cy;case"radio":return xy;default:return Ua}}}function oi(e,t,n,r,o){const i=Ry(e.tagName,n.props&&n.props.type)[o];i&&i(e,t,n,r)}const Dy=["ctrl","shift","alt","meta"],Py={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Dy.some(n=>e[`${n}Key`]&&!t.includes(n))},wt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<t.length;i++){const l=Py[t[i]];if(l&&l(o,t))return}return e(o,...s)}))},Iy={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},zo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=R.hyphenate(o.key);if(t.some(i=>i===s||Iy[i]===s))return e(o)}))};function Fy(){wy()}ce.env.NODE_ENV!=="production"&&Fy();const Bt=()=>Pg.useAbility();function cd(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Uo=(e,t)=>!e||!t?!1:e.id===t.id;function $y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Va,ud;function Oy(){if(ud)return Va;ud=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var i="",l=0,u=-1,d=0,c,p=0;p<=o.length;++p){if(p<o.length)c=o.charCodeAt(p);else{if(c===47)break;c=47}if(c===47){if(!(u===p-1||d===1))if(u!==p-1&&d===2){if(i.length<2||l!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var f=i.lastIndexOf("/");if(f!==i.length-1){f===-1?(i="",l=0):(i=i.slice(0,f),l=i.length-1-i.lastIndexOf("/")),u=p,d=0;continue}}else if(i.length===2||i.length===1){i="",l=0,u=p,d=0;continue}}s&&(i.length>0?i+="/..":i="..",l=2)}else i.length>0?i+="/"+o.slice(u+1,p):i=o.slice(u+1,p),l=p-u-1;u=p,d=0}else c===46&&d!==-1?++d:d=-1}return i}function n(o,s){var i=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return i?i===s.root?i+l:i+o+l:l}var r={resolve:function(){for(var s="",i=!1,l,u=arguments.length-1;u>=-1&&!i;u--){var d;u>=0?d=arguments[u]:(l===void 0&&(l=ce.cwd()),d=l),e(d),d.length!==0&&(s=d+"/"+s,i=d.charCodeAt(0)===47)}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var i=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=t(s,!i),s.length===0&&!i&&(s="."),s.length>0&&l&&(s+="/"),i?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,i=0;i<arguments.length;++i){var l=arguments[i];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":r.normalize(s)},relative:function(s,i){if(e(s),e(i),s===i||(s=r.resolve(s),i=r.resolve(i),s===i))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var u=s.length,d=u-l,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var p=i.length,f=p-c,h=d<f?d:f,g=-1,m=0;m<=h;++m){if(m===h){if(f>h){if(i.charCodeAt(c+m)===47)return i.slice(c+m+1);if(m===0)return i.slice(c+m)}else d>h&&(s.charCodeAt(l+m)===47?g=m:m===0&&(g=0));break}var w=s.charCodeAt(l+m),T=i.charCodeAt(c+m);if(w!==T)break;w===47&&(g=m)}var k="";for(m=l+g+1;m<=u;++m)(m===u||s.charCodeAt(m)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+i.slice(c+g):(c+=g,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var i=s.charCodeAt(0),l=i===47,u=-1,d=!0,c=s.length-1;c>=1;--c)if(i=s.charCodeAt(c),i===47){if(!d){u=c;break}}else d=!1;return u===-1?l?"/":".":l&&u===1?"//":s.slice(0,u)},basename:function(s,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,u=-1,d=!0,c;if(i!==void 0&&i.length>0&&i.length<=s.length){if(i.length===s.length&&i===s)return"";var p=i.length-1,f=-1;for(c=s.length-1;c>=0;--c){var h=s.charCodeAt(c);if(h===47){if(!d){l=c+1;break}}else f===-1&&(d=!1,f=c+1),p>=0&&(h===i.charCodeAt(p)?--p===-1&&(u=c):(p=-1,u=f))}return l===u?u=f:u===-1&&(u=s.length),s.slice(l,u)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!d){l=c+1;break}}else u===-1&&(d=!1,u=c+1);return u===-1?"":s.slice(l,u)}},extname:function(s){e(s);for(var i=-1,l=0,u=-1,d=!0,c=0,p=s.length-1;p>=0;--p){var f=s.charCodeAt(p);if(f===47){if(!d){l=p+1;break}continue}u===-1&&(d=!1,u=p+1),f===46?i===-1?i=p:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||u===-1||c===0||c===1&&i===u-1&&i===l+1?"":s.slice(i,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var i={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return i;var l=s.charCodeAt(0),u=l===47,d;u?(i.root="/",d=1):d=0;for(var c=-1,p=0,f=-1,h=!0,g=s.length-1,m=0;g>=d;--g){if(l=s.charCodeAt(g),l===47){if(!h){p=g+1;break}continue}f===-1&&(h=!1,f=g+1),l===46?c===-1?c=g:m!==1&&(m=1):c!==-1&&(m=-1)}return c===-1||f===-1||m===0||m===1&&c===f-1&&c===p+1?f!==-1&&(p===0&&u?i.base=i.name=s.slice(1,f):i.base=i.name=s.slice(p,f)):(p===0&&u?(i.name=s.slice(1,c),i.base=s.slice(1,f)):(i.name=s.slice(p,c),i.base=s.slice(p,f)),i.ext=s.slice(c,f)),p>0?i.dir=s.slice(0,p-1):u&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Va=r,Va}var Ke=Oy();const qa=$y(Ke),Ly=ge({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},_y=["textContent"],My=["textContent"];function Ny(e,t,n,r,o,s){return I(),G(Ae,null,[Q("p",{class:"mt-0",textContent:R.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,_y),Q("p",{class:"mb-0",textContent:R.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,My)],64)}const dd=Le(Ly,[["render",Ny]]),By=ge({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=Je(),{$gettext:n}=me.useGettext(),r=W(!1),o=A(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),s=A(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name},!0):n("File with name »%{name}« already exists.",{name:e.resource.name},!0)),i=A(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:s,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:i,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Sn.KEEP_BOTH,doForAllConflicts:a(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?Sn.MERGE:Sn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:a(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Sn.SKIP,doForAllConflicts:a(r)})}}}}),jy=["textContent"],zy={class:"my-4"},Uy={class:"flex justify-end items-center mt-4"},Vy={class:"oc-modal-body-actions-grid"};function qy(e,t,n,r,o,s){const i=oe("oc-checkbox"),l=oe("oc-button");return I(),G(Ae,null,[Q("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.message)},null,8,jy),Q("div",zy,[e.conflictCount>1?(I(),re(i,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=u=>e.checkboxValue=u),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):le("",!0)]),Q("div",Uy,[Q("div",Vy,[J(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),J(l,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:Z(()=>[ct(R.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),J(l,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const fd=Le(By,[["render",qy]]);class Ha{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const d of t){const c=Ke.join(n.path,d.name);r.some(f=>f.path===c)&&o.push({resource:d,strategy:null})}let s=0,i=!1,l=null;const u=[];for(const d of o){if(i){d.strategy=l,u.push(d);continue}const c=o.length-s,p=await this.resolveFileExists(d.resource,c);d.strategy=p.strategy,u.push(d),s+=1,p.doForAllConflicts&&(i=!0,l=p.strategy)}return u}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:s}=Je();return new Promise(i=>{s({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:fd,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:l=>{i(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=Je();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:dd,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const wn=(e,t,n,r=1)=>{let o;return t?o=`${z.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:o=`${e} (${r})`,n.some(i=>i.name===o)?wn(e,t,n,r+1):o},pd=(e,t,n,r)=>e.id===n.id&&Ke.dirname(t.path)===r.path;var Sn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Sn||{}),Xn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Xn||{});class hd extends Ha{constructor(t,n,r,o,s,i,l,u){super(l,u),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=o,this.currentFolder=s,this.clientService=i}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",t);Me().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const l=n.length;if(l===0)return;const u=r===Xn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",l,{count:l.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",l,{count:l.toString()},!0);Me().showMessage({title:u,status:"success"});return}let o=r===Xn.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()},!0):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()},!0);t.length===1&&(o=r===Xn.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName},!0));let s="";t.some(({error:l})=>l instanceof z.HttpError&&l.statusCode===507)&&(s=this.$gettext("Insufficient quota")),Me().showErrorMessage({title:o,...s&&{desc:s},errors:t.map(({error:l})=>l)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Xn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Xn.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),o=[];for(const s of this.resourcesToMove){const i={...s},{id:l,name:u,extension:d}=i,c=r.some(h=>h.resource.id===l);let p=u,f=!1;if(c){const h=r.find(g=>g.resource.id===l)?.strategy;if(h===Sn.SKIP)continue;if(h===Sn.REPLACE){if(this.isOverwritingParentFolder(i,this.targetFolder,n)){const g=new Error;this.showResultMessage([{error:g,resourceName:u}],[],t);continue}f=!0}h===Sn.KEEP_BOTH&&(p=wn(u,d,n),i.name=p)}pd(this.sourceSpace,i,this.targetSpace,this.targetFolder)&&f||o.push({resource:i,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:Ke.join(this.targetFolder.path,p),overwrite:f,transferType:t})}return o}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const o=a(this.currentFolder)?.path;if(!o||n.path===o)return!1;const s=Ke.basename(t.path),i=Ke.join(n.path,s);return o.split("/").length<i.split("/").length?!1:r.some(l=>l.path===i)}}const Wa={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},Hy=(e,t,n)=>new Nc(e,{...Wa,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),md="oc-resource-icon-mapping",Wy={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function gd(){const e={};return Object.values(Wy).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const vd=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(z.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function Qa(e,t,n){return t.name=Ke.basename(n),t.path=n,t.webDavPath=Ke.join(e.webDavPath,n),t.extension=z.extractExtensionFromFile(t),t}function Qy(){this.__data__=[],this.size=0}function Vo(e,t){return e===t||e!==e&&t!==t}function si(e,t){for(var n=e.length;n--;)if(Vo(e[n][0],t))return n;return-1}var Ky=Array.prototype,Gy=Ky.splice;function Jy(e){var t=this.__data__,n=si(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Gy.call(t,n,1),--this.size,!0}function Xy(e){var t=this.__data__,n=si(t,e);return n<0?void 0:t[n][1]}function Yy(e){return si(this.__data__,e)>-1}function Zy(e,t){var n=this.__data__,r=si(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Yn.prototype.clear=Qy,Yn.prototype.delete=Jy,Yn.prototype.get=Xy,Yn.prototype.has=Yy,Yn.prototype.set=Zy;function eb(){this.__data__=new Yn,this.size=0}function tb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function nb(e){return this.__data__.get(e)}function rb(e){return this.__data__.has(e)}const br=globalThis||void 0||self;var yd=typeof br=="object"&&br&&br.Object===Object&&br,ob=typeof self=="object"&&self&&self.Object===Object&&self,Fn=yd||ob||Function("return this")(),sn=Fn.Symbol,bd=Object.prototype,sb=bd.hasOwnProperty,ib=bd.toString,qo=sn?sn.toStringTag:void 0;function ab(e){var t=sb.call(e,qo),n=e[qo];try{e[qo]=void 0;var r=!0}catch{}var o=ib.call(e);return r&&(t?e[qo]=n:delete e[qo]),o}var lb=Object.prototype,cb=lb.toString;function ub(e){return cb.call(e)}var db="[object Null]",fb="[object Undefined]",wd=sn?sn.toStringTag:void 0;function Ir(e){return e==null?e===void 0?fb:db:wd&&wd in Object(e)?ab(e):ub(e)}function $n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pb="[object AsyncFunction]",hb="[object Function]",mb="[object GeneratorFunction]",gb="[object Proxy]";function Ka(e){if(!$n(e))return!1;var t=Ir(e);return t==hb||t==mb||t==pb||t==gb}var Ga=Fn["__core-js_shared__"],Sd=(function(){var e=/[^.]+$/.exec(Ga&&Ga.keys&&Ga.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function vb(e){return!!Sd&&Sd in e}var yb=Function.prototype,bb=yb.toString;function Fr(e){if(e!=null){try{return bb.call(e)}catch{}try{return e+""}catch{}}return""}var wb=/[\\^$.*+?()[\]{}|]/g,Sb=/^\[object .+?Constructor\]$/,Tb=Function.prototype,kb=Object.prototype,Cb=Tb.toString,xb=kb.hasOwnProperty,Ab=RegExp("^"+Cb.call(xb).replace(wb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Eb(e){if(!$n(e)||vb(e))return!1;var t=Ka(e)?Ab:Sb;return t.test(Fr(e))}function Rb(e,t){return e?.[t]}function $r(e,t){var n=Rb(e,t);return Eb(n)?n:void 0}var Ho=$r(Fn,"Map"),Wo=$r(Object,"create");function Db(){this.__data__=Wo?Wo(null):{},this.size=0}function Pb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ib="__lodash_hash_undefined__",Fb=Object.prototype,$b=Fb.hasOwnProperty;function Ob(e){var t=this.__data__;if(Wo){var n=t[e];return n===Ib?void 0:n}return $b.call(t,e)?t[e]:void 0}var Lb=Object.prototype,_b=Lb.hasOwnProperty;function Mb(e){var t=this.__data__;return Wo?t[e]!==void 0:_b.call(t,e)}var Nb="__lodash_hash_undefined__";function Bb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wo&&t===void 0?Nb:t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=Db,Or.prototype.delete=Pb,Or.prototype.get=Ob,Or.prototype.has=Mb,Or.prototype.set=Bb;function jb(){this.size=0,this.__data__={hash:new Or,map:new(Ho||Yn),string:new Or}}function zb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ii(e,t){var n=e.__data__;return zb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ub(e){var t=ii(this,e).delete(e);return this.size-=t?1:0,t}function Vb(e){return ii(this,e).get(e)}function qb(e){return ii(this,e).has(e)}function Hb(e,t){var n=ii(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Zn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zn.prototype.clear=jb,Zn.prototype.delete=Ub,Zn.prototype.get=Vb,Zn.prototype.has=qb,Zn.prototype.set=Hb;var Wb=200;function Qb(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Ho||r.length<Wb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this}function On(e){var t=this.__data__=new Yn(e);this.size=t.size}On.prototype.clear=eb,On.prototype.delete=tb,On.prototype.get=nb,On.prototype.has=rb,On.prototype.set=Qb;var ai=(function(){try{var e=$r(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Ja(e,t,n){t=="__proto__"&&ai?ai(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Xa(e,t,n){(n!==void 0&&!Vo(e[t],n)||n===void 0&&!(t in e))&&Ja(e,t,n)}function Kb(e){return function(t,n,r){for(var o=-1,s=Object(t),i=r(t),l=i.length;l--;){var u=i[++o];if(n(s[u],u,s)===!1)break}return t}}var Gb=Kb(),Td=typeof x=="object"&&x&&!x.nodeType&&x,kd=Td&&typeof module=="object"&&module&&!module.nodeType&&module,Jb=kd&&kd.exports===Td,Cd=Jb?Fn.Buffer:void 0,xd=Cd?Cd.allocUnsafe:void 0;function Ad(e,t){if(t)return e.slice();var n=e.length,r=xd?xd(n):new e.constructor(n);return e.copy(r),r}var li=Fn.Uint8Array;function Ya(e){var t=new e.constructor(e.byteLength);return new li(t).set(new li(e)),t}function Ed(e,t){var n=t?Ya(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Xb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Rd=Object.create,Yb=(function(){function e(){}return function(t){if(!$n(t))return{};if(Rd)return Rd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Dd(e,t){return function(n){return e(t(n))}}var Za=Dd(Object.getPrototypeOf,Object),Zb=Object.prototype;function el(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zb;return e===n}function ew(e){return typeof e.constructor=="function"&&!el(e)?Yb(Za(e)):{}}function Ln(e){return e!=null&&typeof e=="object"}var tw="[object Arguments]";function Pd(e){return Ln(e)&&Ir(e)==tw}var Id=Object.prototype,nw=Id.hasOwnProperty,rw=Id.propertyIsEnumerable,ci=Pd((function(){return arguments})())?Pd:function(e){return Ln(e)&&nw.call(e,"callee")&&!rw.call(e,"callee")},Tn=Array.isArray,ow=9007199254740991;function Fd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ow}function ui(e){return e!=null&&Fd(e.length)&&!Ka(e)}function sw(e){return Ln(e)&&ui(e)}function iw(){return!1}var $d=typeof x=="object"&&x&&!x.nodeType&&x,Od=$d&&typeof module=="object"&&module&&!module.nodeType&&module,aw=Od&&Od.exports===$d,Ld=aw?Fn.Buffer:void 0,lw=Ld?Ld.isBuffer:void 0,Qo=lw||iw,cw="[object Object]",uw=Function.prototype,dw=Object.prototype,_d=uw.toString,fw=dw.hasOwnProperty,pw=_d.call(Object);function tl(e){if(!Ln(e)||Ir(e)!=cw)return!1;var t=Za(e);if(t===null)return!0;var n=fw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&_d.call(n)==pw}var hw="[object Arguments]",mw="[object Array]",gw="[object Boolean]",vw="[object Date]",yw="[object Error]",bw="[object Function]",ww="[object Map]",Sw="[object Number]",Tw="[object Object]",kw="[object RegExp]",Cw="[object Set]",xw="[object String]",Aw="[object WeakMap]",Ew="[object ArrayBuffer]",Rw="[object DataView]",Dw="[object Float32Array]",Pw="[object Float64Array]",Iw="[object Int8Array]",Fw="[object Int16Array]",$w="[object Int32Array]",Ow="[object Uint8Array]",Lw="[object Uint8ClampedArray]",_w="[object Uint16Array]",Mw="[object Uint32Array]",ot={};ot[Dw]=ot[Pw]=ot[Iw]=ot[Fw]=ot[$w]=ot[Ow]=ot[Lw]=ot[_w]=ot[Mw]=!0,ot[hw]=ot[mw]=ot[Ew]=ot[gw]=ot[Rw]=ot[vw]=ot[yw]=ot[bw]=ot[ww]=ot[Sw]=ot[Tw]=ot[kw]=ot[Cw]=ot[xw]=ot[Aw]=!1;function Nw(e){return Ln(e)&&Fd(e.length)&&!!ot[Ir(e)]}function nl(e){return function(t){return e(t)}}var Md=typeof x=="object"&&x&&!x.nodeType&&x,Ko=Md&&typeof module=="object"&&module&&!module.nodeType&&module,Bw=Ko&&Ko.exports===Md,rl=Bw&&yd.process,so=(function(){try{var e=Ko&&Ko.require&&Ko.require("util").types;return e||rl&&rl.binding&&rl.binding("util")}catch{}})(),Nd=so&&so.isTypedArray,ol=Nd?nl(Nd):Nw;function sl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var jw=Object.prototype,zw=jw.hasOwnProperty;function Bd(e,t,n){var r=e[t];(!(zw.call(e,t)&&Vo(r,n))||n===void 0&&!(t in e))&&Ja(e,t,n)}function jd(e,t,n,r){var o=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var l=t[s],u=void 0;u===void 0&&(u=e[l]),o?Ja(n,l,u):Bd(n,l,u)}return n}function Uw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Vw=9007199254740991,qw=/^(?:0|[1-9]\d*)$/;function zd(e,t){var n=typeof e;return t=t??Vw,!!t&&(n=="number"||n!="symbol"&&qw.test(e))&&e>-1&&e%1==0&&e<t}var Hw=Object.prototype,Ww=Hw.hasOwnProperty;function Ud(e,t){var n=Tn(e),r=!n&&ci(e),o=!n&&!r&&Qo(e),s=!n&&!r&&!o&&ol(e),i=n||r||o||s,l=i?Uw(e.length,String):[],u=l.length;for(var d in e)(t||Ww.call(e,d))&&!(i&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||zd(d,u)))&&l.push(d);return l}function Qw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kw=Object.prototype,Gw=Kw.hasOwnProperty;function Jw(e){if(!$n(e))return Qw(e);var t=el(e),n=[];for(var r in e)r=="constructor"&&(t||!Gw.call(e,r))||n.push(r);return n}function il(e){return ui(e)?Ud(e,!0):Jw(e)}function Xw(e){return jd(e,il(e))}function Yw(e,t,n,r,o,s,i){var l=sl(e,n),u=sl(t,n),d=i.get(u);if(d){Xa(e,n,d);return}var c=s?s(l,u,n+"",e,t,i):void 0,p=c===void 0;if(p){var f=Tn(u),h=!f&&Qo(u),g=!f&&!h&&ol(u);c=u,f||h||g?Tn(l)?c=l:sw(l)?c=Xb(l):h?(p=!1,c=Ad(u,!0)):g?(p=!1,c=Ed(u,!0)):c=[]:tl(u)||ci(u)?(c=l,ci(l)?c=Xw(l):(!$n(l)||Ka(l))&&(c=ew(u))):p=!1}p&&(i.set(u,c),o(c,u,r,s,i),i.delete(u)),Xa(e,n,c)}function Vd(e,t,n,r,o){e!==t&&Gb(t,function(s,i){if(o||(o=new On),$n(s))Yw(e,t,i,n,Vd,r,o);else{var l=r?r(sl(e,i),s,i+"",e,t,o):void 0;l===void 0&&(l=s),Xa(e,i,l)}},il)}function qd(e){return e}function Zw(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Hd=Math.max;function Wd(e,t,n){return t=Hd(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=Hd(r.length-t,0),i=Array(s);++o<s;)i[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(i),Zw(e,this,l)}}function eS(e){return function(){return e}}var tS=ai?function(e,t){return ai(e,"toString",{configurable:!0,enumerable:!1,value:eS(t),writable:!0})}:qd,nS=800,rS=16,oS=Date.now;function sS(e){var t=0,n=0;return function(){var r=oS(),o=rS-(r-n);if(n=r,o>0){if(++t>=nS)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Qd=sS(tS);function iS(e,t){return Qd(Wd(e,t,qd),e+"")}function aS(e,t,n){if(!$n(n))return!1;var r=typeof t;return(r=="number"?ui(n)&&zd(t,n.length):r=="string"&&t in n)?Vo(n[t],e):!1}function lS(e){return iS(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,i=o>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(o--,s):void 0,i&&aS(n[0],n[1],i)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t})}var Go=lS(function(e,t,n){Vd(e,t,n)});const al=(e,...t)=>{const{href:n}=e.resolve(a(e.currentRoute));return t.map(r=>{const{href:o}=e.resolve({...r});return o==="/"||o==="#/"?!1:n.startsWith(o)}).some(Boolean)},io=(...e)=>(t,...n)=>{if(!n.length)return al(t,...e);const[r,...o]=n.map(s=>{const i=e.find(l=>l.name===s);if(!i)throw new Error(`unknown comparative '${s}'`);return i});return al(t,r,...o)};function PO(e){return e}const ao=(e,...t)=>Go({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),lo=(e,t={})=>ao(e,t),Kd=lo("files-common-favorites"),Gd=lo("files-common-search"),bt=io(Kd,Gd),cS=e=>[{path:"/search",component:e.App,children:[{name:Gd.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope","sort-by","sort-dir"]}}]},{path:"/favorites",component:e.App,children:[{name:Kd.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],kn=(e,t={})=>ao(e,t),Jd=kn("files-spaces-projects"),ll=kn("files-spaces-generic"),st=io(Jd,ll),uS=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:Jd.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:ll.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],an=(e,t={})=>ao(e,t),dS=an("files-shares"),di=an("files-shares-with-me"),cl=an("files-shares-with-others"),ul=an("files-shares-via-link"),mt=io(di,cl,ul),fS=e=>[{name:dS.name,path:"/shares",component:e.App,redirect:di,children:[{name:di.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:cl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:ul.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],co=(e,t={})=>ao(e,t),dl=co("files-public-link"),fl=co("files-public-upload"),ln=io(dl,fl),pS=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:dl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:fl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],wr=(e,t={})=>ao(e,t),Xd=wr("files-trash-generic"),Yd=wr("files-trash-overview"),qt=io(Xd,Yd),hS=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:Yd.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:Xd.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function Zd(e){return{applicationConfig:A(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const mS=["anonymous","user","idp","publicLink","hybrid"],er=e=>Jn(e),Re=()=>er("$router"),St=()=>Re().currentRoute,pl=e=>e.path.split("/")[1],gS=()=>{const e=St();return A(()=>pl(a(e)))},_n=(e,t={},n)=>{const r=n?.configStore||Ge();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...z.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!rt.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},vS=(e,t)=>{const n=document.querySelector("base"),r=!!n,o=new URL(window.location.href.split("#")[0]);return o.search="",r?o.pathname=new URL(n.href).pathname:o.pathname.endsWith("/index.html")&&(o.pathname=o.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?o.pathname=[...o.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):o[r?"pathname":"hash"]=e.resolve(t).href,o.href},Mn=we.defineStore("apps",()=>{const e=W({}),t=W({}),n=W([]),r=A(()=>Object.keys(a(e))),o=(u,d)=>{u.id&&(u.extensions&&u.extensions.forEach(c=>{s({appId:u.id,data:c})}),a(e)[u.id]={defaultExtension:u.defaultExtension||"",icon:"check_box_outline_blank",name:u.name||u.id,translations:d,...u})},s=({appId:u,data:d})=>{a(n).push({...d,app:u,hasPriority:d.hasPriority||a(t)?.[u]?.priorityExtensions?.includes(d.extension)||!1,secureView:d.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:o,registerFileExtension:s,loadExternalAppConfig:({appId:u,config:d})=>{t.value={...a(t),[u]:d}},isAppEnabled:u=>a(r).includes(u)}}),Lr=we.defineStore("auth",()=>{const e=W(),t=W(!1),n=W(!1),r=W(),o=W(),s=W(),i=W(!1),l=h=>{e.value=h},u=h=>{t.value=h},d=h=>{n.value=h},c=h=>{r.value=h.publicLinkToken,o.value=h.publicLinkPassword,s.value=h.publicLinkType,i.value=h.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:o,publicLinkType:s,publicLinkContextReady:i,setAccessToken:l,setIdpContextReady:u,setUserContextReady:d,setPublicLinkContext:c,clearUserContext:()=>{l(null),u(null),d(null)},clearPublicLinkContext:()=>{c({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),ef={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,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},Ge=we.defineStore("config",()=>{const e=Mn(),t=W(""),n=W(""),r=W({...ef}),o=W([]),s=W([]),i=W([]),l=W(),u=W(),d=W(),c=W([]),p=W([]),f=A(()=>z.urlJoin(a(t)||window.location.origin,{trailingSlash:!0})),h=A(()=>z.urlJoin(a(f),"groupware",{trailingSlash:!0})),g=A(()=>!!a(l)),m=A(()=>!!a(u));return{options:r,oAuth2:l,openIdConnect:u,isOAuth2:g,isOIDC:m,customTranslations:i,apps:o,externalApps:s,sentry:d,theme:n,scripts:c,styles:p,serverUrl:f,groupwareUrl:h,loadConfig:T=>{T.server&&(t.value=T.server?.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],i.value=T.customTranslations||[],l.value=T.auth,u.value=T.openIdConnect,d.value=T.sentry,c.value=T.scripts||[],p.value=T.styles||[],n.value=T.theme,T.options&&(r.value=Go({...ef},T.options),a(r).ocm.openRemotely=a(r).cernFeatures,a(r).routing.idBased=!a(r).cernFeatures,a(r).routing.fullShareOwnerPaths=a(r).cernFeatures),T.external_apps&&(s.value=T.external_apps,T.external_apps.filter(Boolean).forEach(k=>{e.loadExternalAppConfig({appId:k.id,config:k.config})}))}}}),yS=K.z.object({url:K.z.string()}),bS=K.z.object({apiUrl:K.z.string().optional(),authUrl:K.z.string().optional(),clientId:K.z.string().optional(),clientSecret:K.z.string().optional(),logoutUrl:K.z.string().optional(),metaDataUrl:K.z.string().optional(),url:K.z.string().optional()}),wS=K.z.object({authority:K.z.string().optional(),client_id:K.z.string().optional(),client_secret:K.z.string().optional(),dynamic:K.z.string().optional(),metadata_url:K.z.string().optional(),post_logout_redirect_uri:K.z.string().optional(),response_type:K.z.string().optional(),scope:K.z.string().optional()}).passthrough(),SS=K.z.record(K.z.any(),K.z.any()),TS=K.z.object({href:K.z.string().optional()}),kS=K.z.object({async:K.z.boolean().optional(),src:K.z.string().optional()}),CS=K.z.object({cernFeatures:K.z.boolean().optional(),concurrentRequests:K.z.object({resourceBatchActions:K.z.number().optional(),sse:K.z.number().optional(),shares:K.z.object({create:K.z.number().optional(),list:K.z.number().optional()}).optional(),avatars:K.z.number().optional()}).optional(),contextHelpers:K.z.boolean().optional(),contextHelpersReadMore:K.z.boolean().optional(),defaultAppId:K.z.string().optional(),disabledExtensions:K.z.array(K.z.string()).optional(),disableFeedbackLink:K.z.boolean().optional(),accountEditLink:K.z.object({href:K.z.string().optional()}).optional(),editor:K.z.object({autosaveEnabled:K.z.boolean().optional(),autosaveInterval:K.z.number().optional(),openAsPreview:K.z.union([K.z.boolean(),K.z.array(K.z.string())]).optional()}).optional(),embed:K.z.object({enabled:K.z.boolean().optional(),target:K.z.string().optional(),messagesOrigin:K.z.string().optional(),delegateAuthentication:K.z.boolean().optional(),delegateAuthenticationOrigin:K.z.string().optional(),fileTypes:K.z.array(K.z.string()).optional(),chooseFileName:K.z.boolean().optional(),chooseFileNameSuggestion:K.z.string().optional()}).optional(),feedbackLink:K.z.object({ariaLabel:K.z.string().optional(),description:K.z.string().optional(),href:K.z.string().optional()}).optional(),isRunningOnEos:K.z.boolean().optional(),loginUrl:K.z.string().optional(),logoutUrl:K.z.string().optional(),ocm:K.z.object({openRemotely:K.z.boolean().optional()}).optional(),routing:K.z.object({fullShareOwnerPaths:K.z.boolean().optional(),idBased:K.z.boolean().optional()}).optional(),runningOnEos:K.z.boolean().optional(),tokenStorageLocal:K.z.boolean().optional(),upload:K.z.object({companionUrl:K.z.string().optional()}).optional(),userListRequiresFilter:K.z.boolean().optional(),hideLogo:K.z.boolean().optional()}),xS=K.z.object({id:K.z.string(),path:K.z.string(),config:K.z.record(K.z.string(),K.z.unknown()).optional()}),AS=K.z.object({server:K.z.string(),theme:K.z.string(),options:CS,apps:K.z.array(K.z.string()).optional(),external_apps:K.z.array(xS).optional(),customTranslations:K.z.array(yS).optional(),auth:bS.optional(),openIdConnect:wS.optional(),sentry:SS.optional(),scripts:K.z.array(kS).optional(),styles:K.z.array(TS).optional()}),fi=we.defineStore("avatars",()=>{const e=Ge(),t=W({}),n=du(new ur({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:u=>a(t)[u],addAvatar:(u,d)=>{t.value[u]=d},removeAvatar:u=>{t.value[u]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),tf={core:{"support-sse":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:z.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},Dt=we.defineStore("capabilities",()=>{const e=W(!1),t=W(tf),n=xe=>{t.value=Go({...tf},xe.capabilities),e.value=!0},r=A(()=>a(t).core["support-sse"]),o=A(()=>a(t).core["support-radicale"]),s=A(()=>a(t).graph["personal-data-export"]),i=A(()=>a(t).core.status),l=A(()=>a(t).dav.reports),u=A(()=>a(t).dav.trashbin),d=A(()=>a(t).spaces.max_quota),c=A(()=>a(t).spaces.projects),p=A(()=>a(t).graph.users.create_disabled),f=A(()=>a(t).graph.users.delete_disabled),h=A(()=>a(t).graph.users.change_password_self_disabled),g=A(()=>a(t).graph.users.read_only_attributes),m=A(()=>a(t).graph.users.edit_login_allowed_disabled),w=A(()=>a(t).files.app_providers),T=A(()=>a(t).files.favorites),k=A(()=>a(t).files.archivers),S=A(()=>a(t).files.privateLinks),y=A(()=>a(t).files.permanent_deletion),E=A(()=>a(t).files.tags),D=A(()=>a(t).files.undelete),$=A(()=>a(t).files_sharing.api_enabled),_=A(()=>a(t).files_sharing.can_rename),L=A(()=>a(t).files_sharing.allow_custom),V=A(()=>a(t).files_sharing.public?.enabled),te=A(()=>a(t).files_sharing.public?.can_edit),B=A(()=>a(t).files_sharing.public?.can_contribute),O=A(()=>a(t).files_sharing.public?.alias),M=A(()=>a(t).files_sharing.public?.default_permissions),N=A(()=>a(t).files_sharing.public?.password.enforced_for),q=A(()=>a(t).files_sharing.search_min_length),j=A(()=>a(t).files_sharing.user?.profile_picture),H=A(()=>a(t).files.tus_support?.max_chunk_size),se=A(()=>a(t).files.tus_support?.extension),Y=A(()=>a(t).files.tus_support?.http_method_override),ae=A(()=>a(t).notifications["ocs-endpoints"]),ne=A(()=>a(t).password_policy),pe=A(()=>a(t).search.property?.mtime),fe=A(()=>a(t).search.property?.mediatype),be=A(()=>a(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:i,supportSSE:r,supportRadicale:o,personalDataExport:s,davReports:l,davTrashbin:u,spacesMaxQuota:d,spacesProjects:c,graphUsersCreateDisabled:p,graphUsersDeleteDisabled:f,graphUsersChangeSelfPasswordDisabled:h,graphUsersEditLoginAllowedDisabled:m,graphUsersReadOnlyAttributes:g,filesAppProviders:w,filesFavorites:T,filesArchivers:k,filesPrivateLinks:S,filesPermanentDeletion:y,filesTags:E,filesUndelete:D,sharingApiEnabled:$,sharingCanRename:_,sharingAllowCustom:L,sharingPublicEnabled:V,sharingPublicCanEdit:te,sharingPublicCanContribute:B,sharingPublicAlias:O,sharingPublicDefaultPermissions:M,sharingPublicPasswordEnforcedFor:N,sharingSearchMinLength:q,sharingUserProfilePicture:j,tusMaxChunkSize:H,tusExtension:se,tusHttpMethodOverride:Y,notificationsOcsEndpoints:ae,passwordPolicy:ne,searchLastMofifiedDate:pe,searchMediaType:fe,searchContent:be}});class ES{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class nf{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new ES(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const pi=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const o=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!o)return null;const{id:s}=o;return e.driveItems.getDriveItem(s.split("!")[0],s)},RS=({sharedAncestor:e,matchingSpace:t})=>t?kn("files-spaces-generic",_n(t,{path:e.path,fileId:e.id})):{},rf=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const o=r?.remoteItem?.permissions||[];if(!o.length)return;const s=[];o.forEach(i=>{if(i["@libre.graph.permissions.actions"]){s.push(...i["@libre.graph.permissions.actions"]);return}const l=e.graphRoles[i.roles[0]];if(!l)return;const u=l.rolePermissions.flatMap(d=>d.allowedResourceActions);s.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(s)]})},DS=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},hi=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},PS="thead-clicked",IS="highlight",FS="rowMounted",$S="contextmenuClicked",of="itemDropped",OS="itemDragged";let LS="";const _S=()=>LS,MS=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),NS=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),BS=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var Xe=(e=>(e.Desc="desc",e.Asc="asc",e))(Xe||{});let sf=0;const _r=(e="")=>(e=e||"",sf+=1,e+sf),af=e=>e?[{name:"name",sortable:!0,sortDir:Xe.Asc},{name:"size",sortable:!0,sortDir:Xe.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:Xe.Asc},{name:"owner",sortable:"displayName",sortDir:Xe.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function IO(e){return e}const lf=[{label:"A-Z",name:"name",sortable:!0,sortDir:Xe.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Xe.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Xe.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Xe.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Xe.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Xe.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Xe.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Xe.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Xe.Desc}],jS=e=>e?lf.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],zS=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),US=K.z.object({icon:K.z.string(),name:K.z.string(),secure_view:K.z.boolean().optional().default(!1),target_ext:K.z.string().optional()}),VS=K.z.object({allow_creation:K.z.boolean().optional(),app_providers:K.z.array(US),default_application:K.z.string().optional(),description:K.z.string().optional(),ext:K.z.string().optional(),mime_type:K.z.string(),name:K.z.string().optional()}),cf=K.z.object({"mime-types":K.z.array(VS)});class qS{_mimeTypes=W([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=z.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:cf});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return a(this._mimeTypes)}get templateMimeTypes(){return a(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(a(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return a(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var uf={},mi={};mi.byteLength=QS,mi.toByteArray=GS,mi.fromByteArray=YS;for(var Nn=[],cn=[],HS=typeof Uint8Array<"u"?Uint8Array:Array,hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uo=0,WS=hl.length;uo<WS;++uo)Nn[uo]=hl[uo],cn[hl.charCodeAt(uo)]=uo;cn[45]=62,cn[95]=63;function df(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function QS(e){var t=df(e),n=t[0],r=t[1];return(n+r)*3/4-r}function KS(e,t,n){return(t+n)*3/4-n}function GS(e){var t,n=df(e),r=n[0],o=n[1],s=new HS(KS(e,r,o)),i=0,l=o>0?r-4:r,u;for(u=0;u<l;u+=4)t=cn[e.charCodeAt(u)]<<18|cn[e.charCodeAt(u+1)]<<12|cn[e.charCodeAt(u+2)]<<6|cn[e.charCodeAt(u+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return o===2&&(t=cn[e.charCodeAt(u)]<<2|cn[e.charCodeAt(u+1)]>>4,s[i++]=t&255),o===1&&(t=cn[e.charCodeAt(u)]<<10|cn[e.charCodeAt(u+1)]<<4|cn[e.charCodeAt(u+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function JS(e){return Nn[e>>18&63]+Nn[e>>12&63]+Nn[e>>6&63]+Nn[e&63]}function XS(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(JS(r));return o.join("")}function YS(e){for(var t,n=e.length,r=n%3,o=[],s=16383,i=0,l=n-r;i<l;i+=s)o.push(XS(e,i,i+s>l?l:i+s));return r===1?(t=e[n-1],o.push(Nn[t>>2]+Nn[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(Nn[t>>10]+Nn[t>>4&63]+Nn[t<<2&63]+"=")),o.join("")}var ml={};ml.read=function(e,t,n,r,o){var s,i,l=o*8-r-1,u=(1<<l)-1,d=u>>1,c=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,s=h&(1<<-c)-1,h>>=-c,c+=l;c>0;s=s*256+e[t+p],p+=f,c-=8);for(i=s&(1<<-c)-1,s>>=-c,c+=r;c>0;i=i*256+e[t+p],p+=f,c-=8);if(s===0)s=1-d;else{if(s===u)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-d}return(h?-1:1)*i*Math.pow(2,s-r)},ml.write=function(e,t,n,r,o,s){var i,l,u,d=s*8-o-1,c=(1<<d)-1,p=c>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,g=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),i+p>=1?t+=f/u:t+=f*Math.pow(2,1-p),t*u>=2&&(i++,u/=2),i+p>=c?(l=0,i=c):i+p>=1?(l=(t*u-1)*Math.pow(2,o),i=i+p):(l=t*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;e[n+h]=l&255,h+=g,l/=256,o-=8);for(i=i<<o|l,d+=o;d>0;e[n+h]=i&255,h+=g,i/=256,d-=8);e[n+h-g]|=m*128};(function(e){const t=mi,n=ml,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:i,SharedArrayBuffer:l}=globalThis;c.TYPED_ARRAY_SUPPORT=u(),!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 u(){try{const C=new s(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,s.prototype),Object.setPrototypeOf(C,v),C.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 d(C){if(C>o)throw new RangeError('The value "'+C+'" is invalid for option "size"');const v=new s(C);return Object.setPrototypeOf(v,c.prototype),v}function c(C,v,b){if(typeof C=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(C)}return p(C,v,b)}c.poolSize=8192;function p(C,v,b){if(typeof C=="string")return m(C,v);if(i.isView(C))return T(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(dt(C,i)||C&&dt(C.buffer,i)||typeof l<"u"&&(dt(C,l)||C&&dt(C.buffer,l)))return k(C,v,b);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const F=C.valueOf&&C.valueOf();if(F!=null&&F!==C)return c.from(F,v,b);const P=S(C);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return c.from(C[Symbol.toPrimitive]("string"),v,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}c.from=function(C,v,b){return p(C,v,b)},Object.setPrototypeOf(c.prototype,s.prototype),Object.setPrototypeOf(c,s);function f(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function h(C,v,b){return f(C),C<=0?d(C):v!==void 0?typeof b=="string"?d(C).fill(v,b):d(C).fill(v):d(C)}c.alloc=function(C,v,b){return h(C,v,b)};function g(C){return f(C),d(C<0?0:y(C)|0)}c.allocUnsafe=function(C){return g(C)},c.allocUnsafeSlow=function(C){return g(C)};function m(C,v){if((typeof v!="string"||v==="")&&(v="utf8"),!c.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const b=D(C,v)|0;let F=d(b);const P=F.write(C,v);return P!==b&&(F=F.slice(0,P)),F}function w(C){const v=C.length<0?0:y(C.length)|0,b=d(v);for(let F=0;F<v;F+=1)b[F]=C[F]&255;return b}function T(C){if(dt(C,s)){const v=new s(C);return k(v.buffer,v.byteOffset,v.byteLength)}return w(C)}function k(C,v,b){if(v<0||C.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(C.byteLength<v+(b||0))throw new RangeError('"length" is outside of buffer bounds');let F;return v===void 0&&b===void 0?F=new s(C):b===void 0?F=new s(C,v):F=new s(C,v,b),Object.setPrototypeOf(F,c.prototype),F}function S(C){if(c.isBuffer(C)){const v=y(C.length)|0,b=d(v);return b.length===0||C.copy(b,0,0,v),b}if(C.length!==void 0)return typeof C.length!="number"||mn(C.length)?d(0):w(C);if(C.type==="Buffer"&&Array.isArray(C.data))return w(C.data)}function y(C){if(C>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return C|0}function E(C){return+C!=C&&(C=0),c.alloc(+C)}c.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==c.prototype},c.compare=function(v,b){if(dt(v,s)&&(v=c.from(v,v.offset,v.byteLength)),dt(b,s)&&(b=c.from(b,b.offset,b.byteLength)),!c.isBuffer(v)||!c.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===b)return 0;let F=v.length,P=b.length;for(let U=0,X=Math.min(F,P);U<X;++U)if(v[U]!==b[U]){F=v[U],P=b[U];break}return F<P?-1:P<F?1:0},c.isEncoding=function(v){switch(String(v).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(v,b){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return c.alloc(0);let F;if(b===void 0)for(b=0,F=0;F<v.length;++F)b+=v[F].length;const P=c.allocUnsafe(b);let U=0;for(F=0;F<v.length;++F){let X=v[F];if(dt(X,s))U+X.length>P.length?(c.isBuffer(X)||(X=c.from(X)),X.copy(P,U)):s.prototype.set.call(P,X,U);else if(c.isBuffer(X))X.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=X.length}return P};function D(C,v){if(c.isBuffer(C))return C.length;if(i.isView(C)||dt(C,i))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const b=C.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&b===0)return 0;let P=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return qe(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return Xt(C).length;default:if(P)return F?-1:qe(C).length;v=(""+v).toLowerCase(),P=!0}}c.byteLength=D;function $(C,v,b){let F=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,v>>>=0,b<=v))return"";for(C||(C="utf8");;)switch(C){case"hex":return ne(this,v,b);case"utf8":case"utf-8":return j(this,v,b);case"ascii":return Y(this,v,b);case"latin1":case"binary":return ae(this,v,b);case"base64":return q(this,v,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,v,b);default:if(F)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),F=!0}}c.prototype._isBuffer=!0;function _(C,v,b){const F=C[v];C[v]=C[b],C[b]=F}c.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<v;b+=2)_(this,b,b+1);return this},c.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<v;b+=4)_(this,b,b+3),_(this,b+1,b+2);return this},c.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<v;b+=8)_(this,b,b+7),_(this,b+1,b+6),_(this,b+2,b+5),_(this,b+3,b+4);return this},c.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?j(this,0,v):$.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(v){if(!c.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:c.compare(this,v)===0},c.prototype.inspect=function(){let v="";const b=e.INSPECT_MAX_BYTES;return v=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(v+=" ... "),"<Buffer "+v+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(v,b,F,P,U){if(dt(v,s)&&(v=c.from(v,v.offset,v.byteLength)),!c.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(b===void 0&&(b=0),F===void 0&&(F=v?v.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),b<0||F>v.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&b>=F)return 0;if(P>=U)return-1;if(b>=F)return 1;if(b>>>=0,F>>>=0,P>>>=0,U>>>=0,this===v)return 0;let X=U-P,ee=F-b;const ye=Math.min(X,ee),Ie=this.slice(P,U),Fe=v.slice(b,F);for(let Ne=0;Ne<ye;++Ne)if(Ie[Ne]!==Fe[Ne]){X=Ie[Ne],ee=Fe[Ne];break}return X<ee?-1:ee<X?1:0};function L(C,v,b,F,P){if(C.length===0)return-1;if(typeof b=="string"?(F=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,mn(b)&&(b=P?0:C.length-1),b<0&&(b=C.length+b),b>=C.length){if(P)return-1;b=C.length-1}else if(b<0)if(P)b=0;else return-1;if(typeof v=="string"&&(v=c.from(v,F)),c.isBuffer(v))return v.length===0?-1:V(C,v,b,F,P);if(typeof v=="number")return v=v&255,typeof s.prototype.indexOf=="function"?P?s.prototype.indexOf.call(C,v,b):s.prototype.lastIndexOf.call(C,v,b):V(C,[v],b,F,P);throw new TypeError("val must be string, number or Buffer")}function V(C,v,b,F,P){let U=1,X=C.length,ee=v.length;if(F!==void 0&&(F=String(F).toLowerCase(),F==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(C.length<2||v.length<2)return-1;U=2,X/=2,ee/=2,b/=2}function ye(Fe,Ne){return U===1?Fe[Ne]:Fe.readUInt16BE(Ne*U)}let Ie;if(P){let Fe=-1;for(Ie=b;Ie<X;Ie++)if(ye(C,Ie)===ye(v,Fe===-1?0:Ie-Fe)){if(Fe===-1&&(Fe=Ie),Ie-Fe+1===ee)return Fe*U}else Fe!==-1&&(Ie-=Ie-Fe),Fe=-1}else for(b+ee>X&&(b=X-ee),Ie=b;Ie>=0;Ie--){let Fe=!0;for(let Ne=0;Ne<ee;Ne++)if(ye(C,Ie+Ne)!==ye(v,Ne)){Fe=!1;break}if(Fe)return Ie}return-1}c.prototype.includes=function(v,b,F){return this.indexOf(v,b,F)!==-1},c.prototype.indexOf=function(v,b,F){return L(this,v,b,F,!0)},c.prototype.lastIndexOf=function(v,b,F){return L(this,v,b,F,!1)};function te(C,v,b,F){b=Number(b)||0;const P=C.length-b;F?(F=Number(F),F>P&&(F=P)):F=P;const U=v.length;F>U/2&&(F=U/2);let X;for(X=0;X<F;++X){const ee=parseInt(v.substr(X*2,2),16);if(mn(ee))return X;C[b+X]=ee}return X}function B(C,v,b,F){return kt(qe(v,C.length-b),C,b,F)}function O(C,v,b,F){return kt(We(v),C,b,F)}function M(C,v,b,F){return kt(Xt(v),C,b,F)}function N(C,v,b,F){return kt(Jt(v,C.length-b),C,b,F)}c.prototype.write=function(v,b,F,P){if(b===void 0)P="utf8",F=this.length,b=0;else if(F===void 0&&typeof b=="string")P=b,F=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(F)?(F=F>>>0,P===void 0&&(P="utf8")):(P=F,F=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-b;if((F===void 0||F>U)&&(F=U),v.length>0&&(F<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let X=!1;for(;;)switch(P){case"hex":return te(this,v,b,F);case"utf8":case"utf-8":return B(this,v,b,F);case"ascii":case"latin1":case"binary":return O(this,v,b,F);case"base64":return M(this,v,b,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,v,b,F);default:if(X)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),X=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(C,v,b){return v===0&&b===C.length?t.fromByteArray(C):t.fromByteArray(C.slice(v,b))}function j(C,v,b){b=Math.min(C.length,b);const F=[];let P=v;for(;P<b;){const U=C[P];let X=null,ee=U>239?4:U>223?3:U>191?2:1;if(P+ee<=b){let ye,Ie,Fe,Ne;switch(ee){case 1:U<128&&(X=U);break;case 2:ye=C[P+1],(ye&192)===128&&(Ne=(U&31)<<6|ye&63,Ne>127&&(X=Ne));break;case 3:ye=C[P+1],Ie=C[P+2],(ye&192)===128&&(Ie&192)===128&&(Ne=(U&15)<<12|(ye&63)<<6|Ie&63,Ne>2047&&(Ne<55296||Ne>57343)&&(X=Ne));break;case 4:ye=C[P+1],Ie=C[P+2],Fe=C[P+3],(ye&192)===128&&(Ie&192)===128&&(Fe&192)===128&&(Ne=(U&15)<<18|(ye&63)<<12|(Ie&63)<<6|Fe&63,Ne>65535&&Ne<1114112&&(X=Ne))}}X===null?(X=65533,ee=1):X>65535&&(X-=65536,F.push(X>>>10&1023|55296),X=56320|X&1023),F.push(X),P+=ee}return se(F)}const H=4096;function se(C){const v=C.length;if(v<=H)return String.fromCharCode.apply(String,C);let b="",F=0;for(;F<v;)b+=String.fromCharCode.apply(String,C.slice(F,F+=H));return b}function Y(C,v,b){let F="";b=Math.min(C.length,b);for(let P=v;P<b;++P)F+=String.fromCharCode(C[P]&127);return F}function ae(C,v,b){let F="";b=Math.min(C.length,b);for(let P=v;P<b;++P)F+=String.fromCharCode(C[P]);return F}function ne(C,v,b){const F=C.length;(!v||v<0)&&(v=0),(!b||b<0||b>F)&&(b=F);let P="";for(let U=v;U<b;++U)P+=qn[C[U]];return P}function pe(C,v,b){const F=C.slice(v,b);let P="";for(let U=0;U<F.length-1;U+=2)P+=String.fromCharCode(F[U]+F[U+1]*256);return P}c.prototype.slice=function(v,b){const F=this.length;v=~~v,b=b===void 0?F:~~b,v<0?(v+=F,v<0&&(v=0)):v>F&&(v=F),b<0?(b+=F,b<0&&(b=0)):b>F&&(b=F),b<v&&(b=v);const P=this.subarray(v,b);return Object.setPrototypeOf(P,c.prototype),P};function fe(C,v,b){if(C%1!==0||C<0)throw new RangeError("offset is not uint");if(C+v>b)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v],U=1,X=0;for(;++X<b&&(U*=256);)P+=this[v+X]*U;return P},c.prototype.readUintBE=c.prototype.readUIntBE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v+--b],U=1;for(;b>0&&(U*=256);)P+=this[v+--b]*U;return P},c.prototype.readUint8=c.prototype.readUInt8=function(v,b){return v=v>>>0,b||fe(v,1,this.length),this[v]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(v,b){return v=v>>>0,b||fe(v,2,this.length),this[v]|this[v+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(v,b){return v=v>>>0,b||fe(v,2,this.length),this[v]<<8|this[v+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},c.prototype.readBigUInt64LE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=b+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,U=this[++v]+this[++v]*2**8+this[++v]*2**16+F*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),c.prototype.readBigUInt64BE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=b*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],U=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+F;return(BigInt(P)<<BigInt(32))+BigInt(U)}),c.prototype.readIntLE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v],U=1,X=0;for(;++X<b&&(U*=256);)P+=this[v+X]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*b)),P},c.prototype.readIntBE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=b,U=1,X=this[v+--P];for(;P>0&&(U*=256);)X+=this[v+--P]*U;return U*=128,X>=U&&(X-=Math.pow(2,8*b)),X},c.prototype.readInt8=function(v,b){return v=v>>>0,b||fe(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},c.prototype.readInt16LE=function(v,b){v=v>>>0,b||fe(v,2,this.length);const F=this[v]|this[v+1]<<8;return F&32768?F|4294901760:F},c.prototype.readInt16BE=function(v,b){v=v>>>0,b||fe(v,2,this.length);const F=this[v+1]|this[v]<<8;return F&32768?F|4294901760:F},c.prototype.readInt32LE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},c.prototype.readInt32BE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},c.prototype.readBigInt64LE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(F<<24);return(BigInt(P)<<BigInt(32))+BigInt(b+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),c.prototype.readBigInt64BE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=(b<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(P)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+F)}),c.prototype.readFloatLE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),n.read(this,v,!0,23,4)},c.prototype.readFloatBE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),n.read(this,v,!1,23,4)},c.prototype.readDoubleLE=function(v,b){return v=v>>>0,b||fe(v,8,this.length),n.read(this,v,!0,52,8)},c.prototype.readDoubleBE=function(v,b){return v=v>>>0,b||fe(v,8,this.length),n.read(this,v,!1,52,8)};function be(C,v,b,F,P,U){if(!c.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>P||v<U)throw new RangeError('"value" argument is out of bounds');if(b+F>C.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(v,b,F,P){if(v=+v,b=b>>>0,F=F>>>0,!P){const ee=Math.pow(2,8*F)-1;be(this,v,b,F,ee,0)}let U=1,X=0;for(this[b]=v&255;++X<F&&(U*=256);)this[b+X]=v/U&255;return b+F},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(v,b,F,P){if(v=+v,b=b>>>0,F=F>>>0,!P){const ee=Math.pow(2,8*F)-1;be(this,v,b,F,ee,0)}let U=F-1,X=1;for(this[b+U]=v&255;--U>=0&&(X*=256);)this[b+U]=v/X&255;return b+F},c.prototype.writeUint8=c.prototype.writeUInt8=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,1,255,0),this[b]=v&255,b+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,65535,0),this[b]=v&255,this[b+1]=v>>>8,b+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,65535,0),this[b]=v>>>8,this[b+1]=v&255,b+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,4294967295,0),this[b+3]=v>>>24,this[b+2]=v>>>16,this[b+1]=v>>>8,this[b]=v&255,b+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,4294967295,0),this[b]=v>>>24,this[b+1]=v>>>16,this[b+2]=v>>>8,this[b+3]=v&255,b+4};function xe(C,v,b,F,P){Tt(v,F,P,C,b,7);let U=Number(v&BigInt(4294967295));C[b++]=U,U=U>>8,C[b++]=U,U=U>>8,C[b++]=U,U=U>>8,C[b++]=U;let X=Number(v>>BigInt(32)&BigInt(4294967295));return C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,b}function he(C,v,b,F,P){Tt(v,F,P,C,b,7);let U=Number(v&BigInt(4294967295));C[b+7]=U,U=U>>8,C[b+6]=U,U=U>>8,C[b+5]=U,U=U>>8,C[b+4]=U;let X=Number(v>>BigInt(32)&BigInt(4294967295));return C[b+3]=X,X=X>>8,C[b+2]=X,X=X>>8,C[b+1]=X,X=X>>8,C[b]=X,b+8}c.prototype.writeBigUInt64LE=At(function(v,b=0){return xe(this,v,b,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=At(function(v,b=0){return he(this,v,b,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(v,b,F,P){if(v=+v,b=b>>>0,!P){const ye=Math.pow(2,8*F-1);be(this,v,b,F,ye-1,-ye)}let U=0,X=1,ee=0;for(this[b]=v&255;++U<F&&(X*=256);)v<0&&ee===0&&this[b+U-1]!==0&&(ee=1),this[b+U]=(v/X>>0)-ee&255;return b+F},c.prototype.writeIntBE=function(v,b,F,P){if(v=+v,b=b>>>0,!P){const ye=Math.pow(2,8*F-1);be(this,v,b,F,ye-1,-ye)}let U=F-1,X=1,ee=0;for(this[b+U]=v&255;--U>=0&&(X*=256);)v<0&&ee===0&&this[b+U+1]!==0&&(ee=1),this[b+U]=(v/X>>0)-ee&255;return b+F},c.prototype.writeInt8=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,1,127,-128),v<0&&(v=255+v+1),this[b]=v&255,b+1},c.prototype.writeInt16LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,32767,-32768),this[b]=v&255,this[b+1]=v>>>8,b+2},c.prototype.writeInt16BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,32767,-32768),this[b]=v>>>8,this[b+1]=v&255,b+2},c.prototype.writeInt32LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,2147483647,-2147483648),this[b]=v&255,this[b+1]=v>>>8,this[b+2]=v>>>16,this[b+3]=v>>>24,b+4},c.prototype.writeInt32BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[b]=v>>>24,this[b+1]=v>>>16,this[b+2]=v>>>8,this[b+3]=v&255,b+4},c.prototype.writeBigInt64LE=At(function(v,b=0){return xe(this,v,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=At(function(v,b=0){return he(this,v,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ie(C,v,b,F,P,U){if(b+F>C.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function de(C,v,b,F,P){return v=+v,b=b>>>0,P||ie(C,v,b,4),n.write(C,v,b,F,23,4),b+4}c.prototype.writeFloatLE=function(v,b,F){return de(this,v,b,!0,F)},c.prototype.writeFloatBE=function(v,b,F){return de(this,v,b,!1,F)};function ue(C,v,b,F,P){return v=+v,b=b>>>0,P||ie(C,v,b,8),n.write(C,v,b,F,52,8),b+8}c.prototype.writeDoubleLE=function(v,b,F){return ue(this,v,b,!0,F)},c.prototype.writeDoubleBE=function(v,b,F){return ue(this,v,b,!1,F)},c.prototype.copy=function(v,b,F,P){if(!c.isBuffer(v))throw new TypeError("argument should be a Buffer");if(F||(F=0),!P&&P!==0&&(P=this.length),b>=v.length&&(b=v.length),b||(b=0),P>0&&P<F&&(P=F),P===F||v.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),v.length-b<P-F&&(P=v.length-b+F);const U=P-F;return this===v&&typeof s.prototype.copyWithin=="function"?this.copyWithin(b,F,P):s.prototype.set.call(v,this.subarray(F,P),b),U},c.prototype.fill=function(v,b,F,P){if(typeof v=="string"){if(typeof b=="string"?(P=b,b=0,F=this.length):typeof F=="string"&&(P=F,F=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!c.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(v.length===1){const X=v.charCodeAt(0);(P==="utf8"&&X<128||P==="latin1")&&(v=X)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(b<0||this.length<b||this.length<F)throw new RangeError("Out of range index");if(F<=b)return this;b=b>>>0,F=F===void 0?this.length:F>>>0,v||(v=0);let U;if(typeof v=="number")for(U=b;U<F;++U)this[U]=v;else{const X=c.isBuffer(v)?v:c.from(v,P),ee=X.length;if(ee===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(U=0;U<F-b;++U)this[U+b]=X[U%ee]}return this};const Se={};function $e(C,v,b){Se[C]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${C}]`,this.stack,delete this.name}get code(){return C}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${C}]: ${this.message}`}}}$e("ERR_BUFFER_OUT_OF_BOUNDS",function(C){return C?`${C} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$e("ERR_INVALID_ARG_TYPE",function(C,v){return`The "${C}" argument must be of type number. Received type ${typeof v}`},TypeError),$e("ERR_OUT_OF_RANGE",function(C,v,b){let F=`The value of "${C}" is out of range.`,P=b;return Number.isInteger(b)&&Math.abs(b)>2**32?P=Ve(String(b)):typeof b=="bigint"&&(P=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(P=Ve(P)),P+="n"),F+=` It must be ${v}. Received ${P}`,F},RangeError);function Ve(C){let v="",b=C.length;const F=C[0]==="-"?1:0;for(;b>=F+4;b-=3)v=`_${C.slice(b-3,b)}${v}`;return`${C.slice(0,b)}${v}`}function lt(C,v,b){ut(v,"offset"),(C[v]===void 0||C[v+b]===void 0)&&gt(v,C.length-(b+1))}function Tt(C,v,b,F,P,U){if(C>b||C<v){const X=typeof v=="bigint"?"n":"";let ee;throw v===0||v===BigInt(0)?ee=`>= 0${X} and < 2${X} ** ${(U+1)*8}${X}`:ee=`>= -(2${X} ** ${(U+1)*8-1}${X}) and < 2 ** ${(U+1)*8-1}${X}`,new Se.ERR_OUT_OF_RANGE("value",ee,C)}lt(F,P,U)}function ut(C,v){if(typeof C!="number")throw new Se.ERR_INVALID_ARG_TYPE(v,"number",C)}function gt(C,v,b){throw Math.floor(C)!==C?(ut(C,b),new Se.ERR_OUT_OF_RANGE("offset","an integer",C)):v<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,C)}const ve=/[^+/0-9A-Za-z-_]/g;function ke(C){if(C=C.split("=")[0],C=C.trim().replace(ve,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function qe(C,v){v=v||1/0;let b;const F=C.length;let P=null;const U=[];for(let X=0;X<F;++X){if(b=C.charCodeAt(X),b>55295&&b<57344){if(!P){if(b>56319){(v-=3)>-1&&U.push(239,191,189);continue}else if(X+1===F){(v-=3)>-1&&U.push(239,191,189);continue}P=b;continue}if(b<56320){(v-=3)>-1&&U.push(239,191,189),P=b;continue}b=(P-55296<<10|b-56320)+65536}else P&&(v-=3)>-1&&U.push(239,191,189);if(P=null,b<128){if((v-=1)<0)break;U.push(b)}else if(b<2048){if((v-=2)<0)break;U.push(b>>6|192,b&63|128)}else if(b<65536){if((v-=3)<0)break;U.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((v-=4)<0)break;U.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return U}function We(C){const v=[];for(let b=0;b<C.length;++b)v.push(C.charCodeAt(b)&255);return v}function Jt(C,v){let b,F,P;const U=[];for(let X=0;X<C.length&&!((v-=2)<0);++X)b=C.charCodeAt(X),F=b>>8,P=b%256,U.push(P),U.push(F);return U}function Xt(C){return t.toByteArray(ke(C))}function kt(C,v,b,F){let P;for(P=0;P<F&&!(P+b>=v.length||P>=C.length);++P)v[P+b]=C[P];return P}function dt(C,v){return C instanceof v||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===v.name}function mn(C){return C!==C}const qn=(function(){const C="0123456789abcdef",v=new Array(256);for(let b=0;b<16;++b){const F=b*16;for(let P=0;P<16;++P)v[F+P]=C[b]+C[P]}return v})();function At(C){return typeof BigInt>"u"?En:C}function En(){throw new Error("BigInt not supported")}})(uf);const gi=uf.Buffer;class fo extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ZS extends fo{name="ApiError"}const gl=(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)},vl=(e="")=>e.split("/").map(encodeURIComponent).join("/"),e0=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(s=>{tl(r[s])?n(r[s],`${o}${s}.`):t.push(`${o}${s}`)});return n(e),t},yl=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[o,s,i]=n.split(".").map(Number);return{major:o,minor:s,patch:i,pre:r}},bl=(e,t)=>{const n=yl(e),r=yl(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class t0{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,o=W([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=A(()=>{const s=a(o).filter(i=>i.enabled).sort((i,l)=>bl(l.version,i.version));return s.length?s[0]:null}),this.available=A(()=>!!a(this.capability)?.version)}async triggerDownload(t){if(!a(this.available))throw new fo("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new fo("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new fo("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),o;if(t.publicLinkPassword)try{const s=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+gi.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!s.ok)throw new z.HttpError("",s);const i=await s.blob();r=URL.createObjectURL(i),o=decodeURI(s.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return gl(r,o),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new fo("no archiver available");const t=a(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:z.urlJoin(this.serverUrl,t.archiver_url)}}const n0=new nf({ttl:10*1e3,capacity:250});class r0{get filePreview(){return n0}}const wl=new r0;class Sl{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+gi.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class Tl{instance;cancelToken;constructor(t,n){this.cancelToken=Es.CancelToken.source(),this.instance=Es.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 Go({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(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 s=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(s,o)}}class o0 extends Error{name="RetriableError"}const s0=15e3;class i0{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return Ig.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new o0},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*s0)}})}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){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==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 kl=null;const a0=(e,t)=>(kl||(kl=new i0(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),kl),l0=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Ct.v4(),"X-Requested-With":"XMLHttpRequest"}});class c0{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=Ct.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Tl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new Tl({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 a0(this.configStore.serverUrl,l0({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=Es.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=z.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Es.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=z.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=z.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 "+gi.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Ct.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class ff{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:Ct.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 ze=new ff;class pf{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const vi=e=>({value:e,type:null}),u0=e=>vi(e),Ze=e=>vi(e),yi=e=>vi(e),d0=e=>vi(e),f0={Permissions:Ze("permissions"),IsFavorite:yi("favorite"),FileId:Ze("fileid"),FileParent:Ze("file-parent"),Name:Ze("name"),OwnerId:Ze("owner-id"),OwnerDisplayName:Ze("owner-display-name"),PrivateLink:Ze("privatelink"),ContentLength:yi("getcontentlength"),ContentSize:yi("size"),LastModifiedDate:Ze("getlastmodified"),Tags:u0("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:Ze("getetag"),MimeType:Ze("getcontenttype"),ResourceType:d0("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:Ze("owner"),LockTime:Ze("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:Ze("downloadURL"),Highlights:Ze("highlights"),MetaPathForUser:Ze("meta-path-for-user"),RemoteItemId:Ze("remote-item-id"),HasPreview:yi("has-preview"),ShareId:Ze("shareid"),ShareRoot:Ze("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:Ze("share-permissions"),TrashbinOriginalFilename:Ze("trashbin-original-filename"),TrashbinOriginalLocation:Ze("trashbin-original-location"),TrashbinDeletedDate:Ze("trashbin-delete-datetime"),PublicLinkItemType:Ze("public-link-item-type"),PublicLinkPermission:Ze("public-link-permission"),PublicLinkExpiration:Ze("public-link-expiration"),PublicLinkShareDate:Ze("public-link-share-datetime"),PublicLinkShareOwner:Ze("public-link-share-owner")},Ee=Object.fromEntries(Object.entries(f0).map(([e,t])=>[e,t.value]));class Jo{static Default=[Ee.Permissions,Ee.IsFavorite,Ee.FileId,Ee.FileParent,Ee.Name,Ee.LockDiscovery,Ee.ActiveLock,Ee.OwnerId,Ee.OwnerDisplayName,Ee.RemoteItemId,Ee.ShareRoot,Ee.ShareTypes,Ee.PrivateLink,Ee.ContentLength,Ee.ContentSize,Ee.LastModifiedDate,Ee.ETag,Ee.MimeType,Ee.ResourceType,Ee.Tags,Ee.Audio,Ee.Location,Ee.Image,Ee.Photo,Ee.HasPreview];static PublicLink=Jo.Default.concat([Ee.PublicLinkItemType,Ee.PublicLinkPermission,Ee.PublicLinkExpiration,Ee.PublicLinkShareDate,Ee.PublicLinkShareOwner]);static Trashbin=[Ee.ContentLength,Ee.ResourceType,Ee.TrashbinOriginalLocation,Ee.TrashbinOriginalFilename,Ee.TrashbinDeletedDate,Ee.Permissions,Ee.FileParent];static DavNamespace=[Ee.ContentLength,Ee.LastModifiedDate,Ee.ETag,Ee.MimeType,Ee.ResourceType,Ee.LockDiscovery,Ee.ActiveLock]}var p0="[object Symbol]";function bi(e){return typeof e=="symbol"||Ln(e)&&Ir(e)==p0}var h0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m0=/^\w*$/;function g0(e,t){if(Tn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||bi(e)?!0:m0.test(e)||!h0.test(e)||t!=null&&e in Object(t)}var v0="Expected a function";function Cl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(v0);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var i=e.apply(this,r);return n.cache=s.set(o,i)||s,i};return n.cache=new(Cl.Cache||Zn),n}Cl.Cache=Zn;var y0=500;function b0(e){var t=Cl(e,function(r){return n.size===y0&&n.clear(),r}),n=t.cache;return t}var w0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S0=/\\(\\)?/g,T0=b0(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(w0,function(n,r,o,s){t.push(o?s.replace(S0,"$1"):r||n)}),t});function hf(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var mf=sn?sn.prototype:void 0,gf=mf?mf.toString:void 0;function vf(e){if(typeof e=="string")return e;if(Tn(e))return hf(e,vf)+"";if(bi(e))return gf?gf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function xl(e){return e==null?"":vf(e)}function Al(e,t){return Tn(e)?e:g0(e,t)?[e]:T0(xl(e))}function yf(e){if(typeof e=="string"||bi(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bf(e,t){t=Al(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[yf(t[n++])];return n&&n==r?e:void 0}function El(e,t,n){var r=e==null?void 0:bf(e,t);return r===void 0?n:r}var k0={2:e=>{function t(o,s,i){o instanceof RegExp&&(o=n(o,i)),s instanceof RegExp&&(s=n(s,i));var l=r(o,s,i);return l&&{start:l[0],end:l[1],pre:i.slice(0,l[0]),body:i.slice(l[0]+o.length,l[1]),post:i.slice(l[1]+s.length)}}function n(o,s){var i=s.match(o);return i?i[0]:null}function r(o,s,i){var l,u,d,c,p,f=i.indexOf(o),h=i.indexOf(s,f+1),g=f;if(f>=0&&h>0){for(l=[],d=i.length;g>=0&&!p;)g==f?(l.push(g),f=i.indexOf(o,g+1)):l.length==1?p=[l.pop(),h]:((u=l.pop())<d&&(d=u,c=h),h=i.indexOf(s,g+1)),g=f<h&&f>=0?f:h;l.length&&(p=[d,c])}return p}e.exports=t,t.range=r},47:(e,t,n)=>{var r=n(410),o=function(d){return typeof d=="string"};function s(d,c){for(var p=[],f=0;f<d.length;f++){var h=d[f];h&&h!=="."&&(h===".."?p.length&&p[p.length-1]!==".."?p.pop():c&&p.push(".."):p.push(h))}return p}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function u(d){return i.exec(d).slice(1)}l.resolve=function(){for(var d="",c=!1,p=arguments.length-1;p>=-1&&!c;p--){var f=p>=0?arguments[p]:ce.cwd();if(!o(f))throw new TypeError("Arguments to path.resolve must be strings");f&&(d=f+"/"+d,c=f.charAt(0)==="/")}return(c?"/":"")+(d=s(d.split("/"),!c).join("/"))||"."},l.normalize=function(d){var c=l.isAbsolute(d),p=d.substr(-1)==="/";return(d=s(d.split("/"),!c).join("/"))||c||(d="."),d&&p&&(d+="/"),(c?"/":"")+d},l.isAbsolute=function(d){return d.charAt(0)==="/"},l.join=function(){for(var d="",c=0;c<arguments.length;c++){var p=arguments[c];if(!o(p))throw new TypeError("Arguments to path.join must be strings");p&&(d+=d?"/"+p:p)}return l.normalize(d)},l.relative=function(d,c){function p(k){for(var S=0;S<k.length&&k[S]==="";S++);for(var y=k.length-1;y>=0&&k[y]==="";y--);return S>y?[]:k.slice(S,y+1)}d=l.resolve(d).substr(1),c=l.resolve(c).substr(1);for(var f=p(d.split("/")),h=p(c.split("/")),g=Math.min(f.length,h.length),m=g,w=0;w<g;w++)if(f[w]!==h[w]){m=w;break}var T=[];for(w=m;w<f.length;w++)T.push("..");return(T=T.concat(h.slice(m))).join("/")},l._makeLong=function(d){return d},l.dirname=function(d){var c=u(d),p=c[0],f=c[1];return p||f?(f&&(f=f.substr(0,f.length-1)),p+f):"."},l.basename=function(d,c){var p=u(d)[2];return c&&p.substr(-1*c.length)===c&&(p=p.substr(0,p.length-c.length)),p},l.extname=function(d){return u(d)[3]},l.format=function(d){if(!r.isObject(d))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof d);var c=d.root||"";if(!o(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof d.root);return(d.dir?d.dir+l.sep:"")+(d.base||"")},l.parse=function(d){if(!o(d))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof d);var c=u(d);if(!c||c.length!==4)throw new TypeError("Invalid path '"+d+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},101:function(e,t,n){var r;e=n.nmd(e),(function(){var o=(e&&e.exports,typeof br=="object"&&br);o.global!==o&&o.window;var s=function(c){this.message=c};(s.prototype=new Error).name="InvalidCharacterError";var i=function(c){throw new s(c)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,d={encode:function(c){c=String(c),/[^\0-\xFF]/.test(c)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var p,f,h,g,m=c.length%3,w="",T=-1,k=c.length-m;++T<k;)p=c.charCodeAt(T)<<16,f=c.charCodeAt(++T)<<8,h=c.charCodeAt(++T),w+=l.charAt((g=p+f+h)>>18&63)+l.charAt(g>>12&63)+l.charAt(g>>6&63)+l.charAt(63&g);return m==2?(p=c.charCodeAt(T)<<8,f=c.charCodeAt(++T),w+=l.charAt((g=p+f)>>10)+l.charAt(g>>4&63)+l.charAt(g<<2&63)+"="):m==1&&(g=c.charCodeAt(T),w+=l.charAt(g>>2)+l.charAt(g<<4&63)+"=="),w},decode:function(c){var p=(c=String(c).replace(u,"")).length;p%4==0&&(p=(c=c.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(c))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var f,h,g=0,m="",w=-1;++w<p;)h=l.indexOf(c.charAt(w)),f=g%4?64*f+h:h,g++%4&&(m+=String.fromCharCode(255&f>>(-2*g&6)));return m},version:"1.0.0"};(r=(function(){return d}).call(t,n,t,e))===void 0||(e.exports=r)})()},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,o=n.length;o--;){var s=n.charCodeAt(o);56320<=s&&s<=57343&&o--,127<s&&s<=2047?r++:2047<s&&s<=65535&&(r+=2)}return r}},285:(e,t,n)=>{var r=n(2);e.exports=function(T){return T?(T.substr(0,2)==="{}"&&(T="\\{\\}"+T.substr(2)),w((function(k){return k.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(i).split("\\,").join(l).split("\\.").join(u)})(T),!0).map(c)):[]};var o="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function d(T){return parseInt(T,10)==T?parseInt(T,10):T.charCodeAt(0)}function c(T){return T.split(o).join("\\").split(s).join("{").split(i).join("}").split(l).join(",").split(u).join(".")}function p(T){if(!T)return[""];var k=[],S=r("{","}",T);if(!S)return T.split(",");var y=S.pre,E=S.body,D=S.post,$=y.split(",");$[$.length-1]+="{"+E+"}";var _=p(D);return D.length&&($[$.length-1]+=_.shift(),$.push.apply($,_)),k.push.apply(k,$),k}function f(T){return"{"+T+"}"}function h(T){return/^-?0\d/.test(T)}function g(T,k){return T<=k}function m(T,k){return T>=k}function w(T,k){var S=[],y=r("{","}",T);if(!y)return[T];var E=y.pre,D=y.post.length?w(y.post,!1):[""];if(/\$$/.test(y.pre))for(var $=0;$<D.length;$++){var _=E+"{"+y.body+"}"+D[$];S.push(_)}else{var L,V,te=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body),O=te||B,M=y.body.indexOf(",")>=0;if(!O&&!M)return y.post.match(/,(?!,).*\}/)?w(T=y.pre+"{"+y.body+i+y.post):[T];if(O)L=y.body.split(/\.\./);else if((L=p(y.body)).length===1&&(L=w(L[0],!1).map(f)).length===1)return D.map((function(xe){return y.pre+L[0]+xe}));if(O){var N=d(L[0]),q=d(L[1]),j=Math.max(L[0].length,L[1].length),H=L.length==3?Math.abs(d(L[2])):1,se=g;q<N&&(H*=-1,se=m);var Y=L.some(h);V=[];for(var ae=N;se(ae,q);ae+=H){var ne;if(B)(ne=String.fromCharCode(ae))==="\\"&&(ne="");else if(ne=String(ae),Y){var pe=j-ne.length;if(pe>0){var fe=new Array(pe+1).join("0");ne=ae<0?"-"+fe+ne.slice(1):fe+ne}}V.push(ne)}}else{V=[];for(var be=0;be<L.length;be++)V.push.apply(V,w(L[be],!1))}for(be=0;be<V.length;be++)for($=0;$<D.length;$++)_=E+V[be]+D[$],(!k||O||_)&&S.push(_)}return S}},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,o){return r<<o|r>>>32-o},rotr:function(r,o){return r<<32-o|r>>>o},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var o=0;o<r.length;o++)r[o]=n.endian(r[o]);return r},randomBytes:function(r){for(var o=[];r>0;r--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(r){for(var o=[],s=0,i=0;s<r.length;s++,i+=8)o[i>>>5]|=r[s]<<24-i%32;return o},wordsToBytes:function(r){for(var o=[],s=0;s<32*r.length;s+=8)o.push(r[s>>>5]>>>24-s%32&255);return o},bytesToHex:function(r){for(var o=[],s=0;s<r.length;s++)o.push((r[s]>>>4).toString(16)),o.push((15&r[s]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],s=0;s<r.length;s+=2)o.push(parseInt(r.substr(s,2),16));return o},bytesToBase64:function(r){for(var o=[],s=0;s<r.length;s+=3)for(var i=r[s]<<16|r[s+1]<<8|r[s+2],l=0;l<4;l++)8*s+6*l<=8*r.length?o.push(t.charAt(i>>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],s=0,i=0;s<r.length;i=++s%4)i!=0&&o.push((t.indexOf(r.charAt(s-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(r.charAt(s))>>>6-2*i);return o}},e.exports=n},345:()=>{},388:()=>{},410:()=>{},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],o=0;o<n.length;o++)r.push(255&n.charCodeAt(o));return r},bytesToString:function(n){for(var r=[],o=0;o<n.length;o++)r.push(String.fromCharCode(n[o]));return r.join("")}}};e.exports=t},542:(e,t,n)=>{(function(){var r=n(298),o=n(526).utf8,s=n(135),i=n(526).bin,l=function(u,d){u.constructor==String?u=d&&d.encoding==="binary"?i.stringToBytes(u):o.stringToBytes(u):s(u)?u=Array.prototype.slice.call(u,0):Array.isArray(u)||u.constructor===Uint8Array||(u=u.toString());for(var c=r.bytesToWords(u),p=8*u.length,f=1732584193,h=-271733879,g=-1732584194,m=271733878,w=0;w<c.length;w++)c[w]=16711935&(c[w]<<8|c[w]>>>24)|4278255360&(c[w]<<24|c[w]>>>8);c[p>>>5]|=128<<p%32,c[14+(p+64>>>9<<4)]=p;var T=l._ff,k=l._gg,S=l._hh,y=l._ii;for(w=0;w<c.length;w+=16){var E=f,D=h,$=g,_=m;f=T(f,h,g,m,c[w+0],7,-680876936),m=T(m,f,h,g,c[w+1],12,-389564586),g=T(g,m,f,h,c[w+2],17,606105819),h=T(h,g,m,f,c[w+3],22,-1044525330),f=T(f,h,g,m,c[w+4],7,-176418897),m=T(m,f,h,g,c[w+5],12,1200080426),g=T(g,m,f,h,c[w+6],17,-1473231341),h=T(h,g,m,f,c[w+7],22,-45705983),f=T(f,h,g,m,c[w+8],7,1770035416),m=T(m,f,h,g,c[w+9],12,-1958414417),g=T(g,m,f,h,c[w+10],17,-42063),h=T(h,g,m,f,c[w+11],22,-1990404162),f=T(f,h,g,m,c[w+12],7,1804603682),m=T(m,f,h,g,c[w+13],12,-40341101),g=T(g,m,f,h,c[w+14],17,-1502002290),f=k(f,h=T(h,g,m,f,c[w+15],22,1236535329),g,m,c[w+1],5,-165796510),m=k(m,f,h,g,c[w+6],9,-1069501632),g=k(g,m,f,h,c[w+11],14,643717713),h=k(h,g,m,f,c[w+0],20,-373897302),f=k(f,h,g,m,c[w+5],5,-701558691),m=k(m,f,h,g,c[w+10],9,38016083),g=k(g,m,f,h,c[w+15],14,-660478335),h=k(h,g,m,f,c[w+4],20,-405537848),f=k(f,h,g,m,c[w+9],5,568446438),m=k(m,f,h,g,c[w+14],9,-1019803690),g=k(g,m,f,h,c[w+3],14,-187363961),h=k(h,g,m,f,c[w+8],20,1163531501),f=k(f,h,g,m,c[w+13],5,-1444681467),m=k(m,f,h,g,c[w+2],9,-51403784),g=k(g,m,f,h,c[w+7],14,1735328473),f=S(f,h=k(h,g,m,f,c[w+12],20,-1926607734),g,m,c[w+5],4,-378558),m=S(m,f,h,g,c[w+8],11,-2022574463),g=S(g,m,f,h,c[w+11],16,1839030562),h=S(h,g,m,f,c[w+14],23,-35309556),f=S(f,h,g,m,c[w+1],4,-1530992060),m=S(m,f,h,g,c[w+4],11,1272893353),g=S(g,m,f,h,c[w+7],16,-155497632),h=S(h,g,m,f,c[w+10],23,-1094730640),f=S(f,h,g,m,c[w+13],4,681279174),m=S(m,f,h,g,c[w+0],11,-358537222),g=S(g,m,f,h,c[w+3],16,-722521979),h=S(h,g,m,f,c[w+6],23,76029189),f=S(f,h,g,m,c[w+9],4,-640364487),m=S(m,f,h,g,c[w+12],11,-421815835),g=S(g,m,f,h,c[w+15],16,530742520),f=y(f,h=S(h,g,m,f,c[w+2],23,-995338651),g,m,c[w+0],6,-198630844),m=y(m,f,h,g,c[w+7],10,1126891415),g=y(g,m,f,h,c[w+14],15,-1416354905),h=y(h,g,m,f,c[w+5],21,-57434055),f=y(f,h,g,m,c[w+12],6,1700485571),m=y(m,f,h,g,c[w+3],10,-1894986606),g=y(g,m,f,h,c[w+10],15,-1051523),h=y(h,g,m,f,c[w+1],21,-2054922799),f=y(f,h,g,m,c[w+8],6,1873313359),m=y(m,f,h,g,c[w+15],10,-30611744),g=y(g,m,f,h,c[w+6],15,-1560198380),h=y(h,g,m,f,c[w+13],21,1309151649),f=y(f,h,g,m,c[w+4],6,-145523070),m=y(m,f,h,g,c[w+11],10,-1120210379),g=y(g,m,f,h,c[w+2],15,718787259),h=y(h,g,m,f,c[w+9],21,-343485551),f=f+E>>>0,h=h+D>>>0,g=g+$>>>0,m=m+_>>>0}return r.endian([f,h,g,m])};l._ff=function(u,d,c,p,f,h,g){var m=u+(d&c|~d&p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._gg=function(u,d,c,p,f,h,g){var m=u+(d&p|c&~p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._hh=function(u,d,c,p,f,h,g){var m=u+(d^c^p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._ii=function(u,d,c,p,f,h,g){var m=u+(c^(d|~p))+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._blocksize=16,l._digestsize=16,e.exports=function(u,d){if(u==null)throw new Error("Illegal argument "+u);var c=r.wordsToBytes(l(u,d));return d&&d.asBytes?c:d&&d.asString?i.bytesToString(c):r.bytesToHex(c)}})()},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(s){try{return decodeURIComponent(s.replace(/\+/g," "))}catch{return null}}function o(s){try{return encodeURIComponent(s)}catch{return null}}t.stringify=function(s,i){i=i||"";var l,u,d=[];for(u in typeof i!="string"&&(i="?"),s)if(n.call(s,u)){if((l=s[u])||l!=null&&!isNaN(l)||(l=""),u=o(u),l=o(l),u===null||l===null)continue;d.push(u+"="+l)}return d.length?i+d.join("&"):""},t.parse=function(s){for(var i,l=/([^=?#&]+)=?([^&]*)/g,u={};i=l.exec(s);){var d=r(i[1]),c=r(i[2]);d===null||c===null||d in u||(u[d]=c)}return u}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},737:(e,t,n)=>{var r=n(670),o=n(647),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(k){return(k||"").toString().replace(s,"")}var f=[["#","hash"],["?","query"],function(k,S){return m(S.protocol)?k.replace(/\\/g,"/"):k},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function g(k){var S,y=(typeof window<"u"?window:typeof br<"u"?br:typeof self<"u"?self:{}).location||{},E={},D=typeof(k=k||y);if(k.protocol==="blob:")E=new T(unescape(k.pathname),{});else if(D==="string")for(S in E=new T(k,{}),h)delete E[S];else if(D==="object"){for(S in k)S in h||(E[S]=k[S]);E.slashes===void 0&&(E.slashes=l.test(k.href))}return E}function m(k){return k==="file:"||k==="ftp:"||k==="http:"||k==="https:"||k==="ws:"||k==="wss:"}function w(k,S){k=(k=p(k)).replace(i,""),S=S||{};var y,E=d.exec(k),D=E[1]?E[1].toLowerCase():"",$=!!E[2],_=!!E[3],L=0;return $?_?(y=E[2]+E[3]+E[4],L=E[2].length+E[3].length):(y=E[2]+E[4],L=E[2].length):_?(y=E[3]+E[4],L=E[3].length):y=E[4],D==="file:"?L>=2&&(y=y.slice(2)):m(D)?y=E[4]:D?$&&(y=y.slice(2)):L>=2&&m(S.protocol)&&(y=E[4]),{protocol:D,slashes:$||m(D),slashesCount:L,rest:y}}function T(k,S,y){if(k=(k=p(k)).replace(i,""),!(this instanceof T))return new T(k,S,y);var E,D,$,_,L,V,te=f.slice(),B=typeof S,O=this,M=0;for(B!=="object"&&B!=="string"&&(y=S,S=null),y&&typeof y!="function"&&(y=o.parse),E=!(D=w(k||"",S=g(S))).protocol&&!D.slashes,O.slashes=D.slashes||E&&S.slashes,O.protocol=D.protocol||S.protocol||"",k=D.rest,(D.protocol==="file:"&&(D.slashesCount!==2||c.test(k))||!D.slashes&&(D.protocol||D.slashesCount<2||!m(O.protocol)))&&(te[3]=[/(.*)/,"pathname"]);M<te.length;M++)typeof(_=te[M])!="function"?($=_[0],V=_[1],$!=$?O[V]=k:typeof $=="string"?~(L=$==="@"?k.lastIndexOf($):k.indexOf($))&&(typeof _[2]=="number"?(O[V]=k.slice(0,L),k=k.slice(L+_[2])):(O[V]=k.slice(L),k=k.slice(0,L))):(L=$.exec(k))&&(O[V]=L[1],k=k.slice(0,L.index)),O[V]=O[V]||E&&_[3]&&S[V]||"",_[4]&&(O[V]=O[V].toLowerCase())):k=_(k,O);y&&(O.query=y(O.query)),E&&S.slashes&&O.pathname.charAt(0)!=="/"&&(O.pathname!==""||S.pathname!=="")&&(O.pathname=(function(N,q){if(N==="")return q;for(var j=(q||"/").split("/").slice(0,-1).concat(N.split("/")),H=j.length,se=j[H-1],Y=!1,ae=0;H--;)j[H]==="."?j.splice(H,1):j[H]===".."?(j.splice(H,1),ae++):ae&&(H===0&&(Y=!0),j.splice(H,1),ae--);return Y&&j.unshift(""),se!=="."&&se!==".."||j.push(""),j.join("/")})(O.pathname,S.pathname)),O.pathname.charAt(0)!=="/"&&m(O.protocol)&&(O.pathname="/"+O.pathname),r(O.port,O.protocol)||(O.host=O.hostname,O.port=""),O.username=O.password="",O.auth&&(~(L=O.auth.indexOf(":"))?(O.username=O.auth.slice(0,L),O.username=encodeURIComponent(decodeURIComponent(O.username)),O.password=O.auth.slice(L+1),O.password=encodeURIComponent(decodeURIComponent(O.password))):O.username=encodeURIComponent(decodeURIComponent(O.auth)),O.auth=O.password?O.username+":"+O.password:O.username),O.origin=O.protocol!=="file:"&&m(O.protocol)&&O.host?O.protocol+"//"+O.host:"null",O.href=O.toString()}T.prototype={set:function(k,S,y){var E=this;switch(k){case"query":typeof S=="string"&&S.length&&(S=(y||o.parse)(S)),E[k]=S;break;case"port":E[k]=S,r(S,E.protocol)?S&&(E.host=E.hostname+":"+S):(E.host=E.hostname,E[k]="");break;case"hostname":E[k]=S,E.port&&(S+=":"+E.port),E.host=S;break;case"host":E[k]=S,u.test(S)?(S=S.split(":"),E.port=S.pop(),E.hostname=S.join(":")):(E.hostname=S,E.port="");break;case"protocol":E.protocol=S.toLowerCase(),E.slashes=!y;break;case"pathname":case"hash":if(S){var D=k==="pathname"?"/":"#";E[k]=S.charAt(0)!==D?D+S:S}else E[k]=S;break;case"username":case"password":E[k]=encodeURIComponent(S);break;case"auth":var $=S.indexOf(":");~$?(E.username=S.slice(0,$),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=S.slice($+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(S))}for(var _=0;_<f.length;_++){var L=f[_];L[4]&&(E[L[1]]=E[L[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&m(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(k){k&&typeof k=="function"||(k=o.stringify);var S,y=this,E=y.host,D=y.protocol;D&&D.charAt(D.length-1)!==":"&&(D+=":");var $=D+(y.protocol&&y.slashes||m(y.protocol)?"//":"");return y.username?($+=y.username,y.password&&($+=":"+y.password),$+="@"):y.password?($+=":"+y.password,$+="@"):y.protocol!=="file:"&&m(y.protocol)&&!E&&y.pathname!=="/"&&($+="@"),(E[E.length-1]===":"||u.test(y.hostname)&&!y.port)&&(E+=":"),$+=E+y.pathname,(S=typeof y.query=="object"?k(y.query):y.query)&&($+=S.charAt(0)!=="?"?"?"+S:S),y.hash&&($+=y.hash),$}},T.extractProtocol=w,T.location=g,T.trimLeft=p,T.qs=o,e.exports=T},800:()=>{},805:()=>{},829:e=>{function t(d){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(d)}function n(d){var c=typeof Map=="function"?new Map:void 0;return n=function(p){if(p===null||(f=p,Function.toString.call(f).indexOf("[native code]")===-1))return p;var f;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(p))return c.get(p);c.set(p,h)}function h(){return r(p,arguments,s(this).constructor)}return h.prototype=Object.create(p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),o(h,p)},n(d)}function r(d,c,p){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(f,h,g){var m=[null];m.push.apply(m,h);var w=new(Function.bind.apply(f,m));return g&&o(w,g.prototype),w},r.apply(null,arguments)}function o(d,c){return o=Object.setPrototypeOf||function(p,f){return p.__proto__=f,p},o(d,c)}function s(d){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},s(d)}var i=(function(d){function c(p){var f;return(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),(f=(function(h,g){return!g||t(g)!=="object"&&typeof g!="function"?(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(h):g})(this,s(c).call(this,p))).name="ObjectPrototypeMutationError",f}return(function(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),f&&o(p,f)})(c,d),c})(n(Error));function l(d,c){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},f=c.split("."),h=f.length,g=function(T){var k=f[T];if(!d)return{v:void 0};if(k==="+"){if(Array.isArray(d))return{v:d.map((function(y,E){var D=f.slice(T+1);return D.length>0?l(y,D.join("."),p):p(d,E,f,T)}))};var S=f.slice(0,T).join(".");throw new Error("Object at wildcard (".concat(S,") is not an array"))}d=p(d,k,f,T)},m=0;m<h;m++){var w=g(m);if(t(w)==="object")return w.v}return d}function u(d,c){return d.length===c+1}e.exports={set:function(d,c,p){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c]=p,d[c];try{return l(d,c,(function(f,h,g,m){if(f===Reflect.getPrototypeOf({}))throw new i("Attempting to mutate Object.prototype");if(!f[h]){var w=Number.isInteger(Number(g[m+1])),T=g[m+1]==="+";f[h]=w||T?[]:{}}return u(g,m)&&(f[h]=p),f[h]}))}catch(f){if(f instanceof i)throw f;return d}},get:function(d,c){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c];try{return l(d,c,(function(p,f){return p[f]}))}catch{return d}},has:function(d,c){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(d)!="object"||d===null||c===void 0)return!1;if(typeof c=="number")return c in d;try{var f=!1;return l(d,c,(function(h,g,m,w){if(!u(m,w))return h&&h[g];f=p.own?h.hasOwnProperty(g):g in h})),f}catch{return!1}},hasOwn:function(d,c,p){return this.has(d,c,p||{own:!0})},isIn:function(d,c,p){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(d)!="object"||d===null||c===void 0)return!1;try{var h=!1,g=!1;return l(d,c,(function(m,w,T,k){return h=h||m===p||!!m&&m[w]===p,g=u(T,k)&&t(m)==="object"&&w in m,m&&m[w]})),f.validPath?h&&g:h}catch{return!1}},ObjectPrototypeMutationError:i}}},wf={};function it(e){var t=wf[e];if(t!==void 0)return t.exports;var n=wf[e]={id:e,loaded:!1,exports:{}};return k0[e].call(n.exports,n,n.exports,it),n.loaded=!0,n.exports}it.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return it.d(t,{a:t}),t},it.d=(e,t)=>{for(var n in t)it.o(t,n)&&!it.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},it.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),it.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var C0=it(737);it.n(C0);var x0=it(47);it.n(x0);var A0=it(542);it.n(A0);var E0=it(101);it.n(E0);const Sf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis;Sf.fetch.bind(Sf),(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({}),it(345),it(800),it(805);var R0=it(285);const wi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},D0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Xo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Tf=e=>e.join(""),P0=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let s=n+1,i=!1,l=!1,u=!1,d=!1,c=n,p="";e:for(;s<e.length;){const m=e.charAt(s);if(m!=="!"&&m!=="^"||s!==n+1){if(m==="]"&&i&&!u){c=s+1;break}if(i=!0,m!=="\\"||u){if(m==="["&&!u){for(const[w,[T,k,S]]of Object.entries(D0))if(e.startsWith(w,s)){if(p)return["$.",!1,e.length-n,!0];s+=w.length,S?o.push(T):r.push(T),l=l||k;continue e}}u=!1,p?(m>p?r.push(Xo(p)+"-"+Xo(m)):m===p&&r.push(Xo(m)),p="",s++):e.startsWith("-]",s+1)?(r.push(Xo(m+"-")),s+=2):e.startsWith("-",s+1)?(p=m,s+=2):(r.push(Xo(m)),s++)}else u=!0,s++}else d=!0,s++}if(c<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!d)return[(f=r[0].length===2?r[0].slice(-1):r[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var f;const h="["+(d?"^":"")+Tf(r)+"]",g="["+(d?"":"^")+Tf(o)+"]";return[r.length&&o.length?"("+h+"|"+g+")":r.length?h:g,l,c-n,!0]},Yo=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},I0=new Set(["!","?","+","*","@"]),kf=e=>I0.has(e),Rl="(?!\\.)",F0=new Set(["[","."]),$0=new Set(["..","."]),O0=new Set("().*{}+?[]^$\\!"),Dl="[^/]",Cf=Dl+"*?",xf=Dl+"+?";class jt{type;#n;#r;#s=!1;#e=[];#t;#i;#l;#a=!1;#o;#c;#d=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#o=this.#n===this?r:this.#n.#o,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#i=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let o=n.#i+1;!r.type&&o<r.#e.length;o++)for(const s of t.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const o of n)if(o!==""){if(typeof o!="string"&&!(o instanceof jt&&o.#t===this))throw new Error("invalid part: "+o);this.#e.push(o)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#i===0)return!0;const t=this.#t;for(let n=0;n<this.#i;n++){const r=t.#e[n];if(!(r instanceof jt&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#i===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new jt(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,o){let s=!1,i=!1,l=-1,u=!1;if(n.type===null){let h=r,g="";for(;h<t.length;){const m=t.charAt(h++);if(s||m==="\\")s=!s,g+=m;else if(i)h===l+1?m!=="^"&&m!=="!"||(u=!0):m!=="]"||h===l+2&&u||(i=!1),g+=m;else if(m!=="[")if(o.noext||!kf(m)||t.charAt(h)!=="(")g+=m;else{n.push(g),g="";const w=new jt(m,n);h=jt.#u(t,w,h,o),n.push(w)}else i=!0,l=h,u=!1,g+=m}return n.push(g),h}let d=r+1,c=new jt(null,n);const p=[];let f="";for(;d<t.length;){const h=t.charAt(d++);if(s||h==="\\")s=!s,f+=h;else if(i)d===l+1?h!=="^"&&h!=="!"||(u=!0):h!=="]"||d===l+2&&u||(i=!1),f+=h;else if(h!=="[")if(kf(h)&&t.charAt(d)==="("){c.push(f),f="";const g=new jt(h,c);c.push(g),d=jt.#u(t,g,d,o)}else if(h!=="|"){if(h===")")return f===""&&n.#e.length===0&&(n.#d=!0),c.push(f),f="",n.push(...p,c),d;f+=h}else c.push(f),f="",p.push(c),c=new jt(null,n);else i=!0,l=d,u=!1,f+=h}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],d}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new jt(null,void 0,n);return jt.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const i=(this.#o.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,i),{_src:n,_glob:t})}get options(){return this.#o}toRegExpSource(t){const n=t??!!this.#o.dot;if(this.#n===this&&this.#p(),!this.type){const u=this.isStart()&&this.isEnd(),d=this.#e.map((f=>{const[h,g,m,w]=typeof f=="string"?jt.#h(f,this.#r,u):f.toRegExpSource(t);return this.#r=this.#r||m,this.#s=this.#s||w,h})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!$0.has(this.#e[0]))){const f=F0,h=n&&f.has(d.charAt(0))||d.startsWith("\\.")&&f.has(d.charAt(2))||d.startsWith("\\.\\.")&&f.has(d.charAt(4)),g=!n&&!t&&f.has(d.charAt(0));c=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?Rl:""}let p="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[c+d+p,Yo(d),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,Yo(this.toString()),!1,!1]}let i=!r||t||n?"":this.#f(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let l="";return l=this.type==="!"&&this.#d?(this.isStart()&&!n?Rl:"")+xf:o+s+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Rl)+Cf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`),[l,Yo(s),this.#r=!!this.#r,this.#s]}#f(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,s,i]=n.toRegExpSource(t);return this.#s=this.#s||i,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,s="",i=!1;for(let l=0;l<t.length;l++){const u=t.charAt(l);if(o)o=!1,s+=(O0.has(u)?"\\":"")+u;else if(u!=="\\"){if(u==="["){const[d,c,p,f]=P0(t,l);if(p){s+=d,i=i||c,l+=p-1,n=n||f;continue}}u!=="*"?u!=="?"?s+=u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(s+=Dl,n=!0):(s+=r&&t==="*"?xf:Cf,n=!0)}else l===t.length-1?s+="\\\\":o=!0}return[s,Yo(t),!!n,i]}}const zt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return wi(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Si(t,n).match(e)},L0=/^\*+([^+@!?\*\[\(]*)$/,_0=e=>t=>!t.startsWith(".")&&t.endsWith(e),M0=e=>t=>t.endsWith(e),N0=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),B0=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),j0=/^\*+\.\*+$/,z0=e=>!e.startsWith(".")&&e.includes("."),U0=e=>e!=="."&&e!==".."&&e.includes("."),V0=/^\.\*+$/,q0=e=>e!=="."&&e!==".."&&e.startsWith("."),H0=/^\*+$/,W0=e=>e.length!==0&&!e.startsWith("."),Q0=e=>e.length!==0&&e!=="."&&e!=="..",K0=/^\?+([^+@!?\*\[\(]*)?$/,G0=e=>{let[t,n=""]=e;const r=Af([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},J0=e=>{let[t,n=""]=e;const r=Ef([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},X0=e=>{let[t,n=""]=e;const r=Ef([t]);return n?o=>r(o)&&o.endsWith(n):r},Y0=e=>{let[t,n=""]=e;const r=Af([t]);return n?o=>r(o)&&o.endsWith(n):r},Af=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Ef=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Rf=typeof ce=="object"&&ce?typeof ce.env=="object"&&ce.env&&ce.env.__MINIMATCH_TESTING_PLATFORM__||ce.platform:"posix";zt.sep=Rf==="win32"?"\\":"/";const un=Symbol("globstar **");zt.GLOBSTAR=un,zt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>zt(n,e,t)};const dn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};zt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zt;const t=zt;return Object.assign((function(n,r){return t(n,r,dn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,dn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(dn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,dn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,dn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,dn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,dn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,dn(e,r))},defaults:n=>t.defaults(dn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,dn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,dn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,dn(e,o))},sep:t.sep,GLOBSTAR:un})};const Df=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:R0(e)};zt.braceExpand=Df,zt.makeRe=function(e){return new Si(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},zt.match=function(e,t){const n=new Si(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const Pf=/[?*]|[+@!]\(.*?\)|\[|\]/;class Si{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wi(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Rf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((s=>this.slashSplit(s)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map(((s,i,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=!(s[0]!==""||s[1]!==""||s[2]!=="?"&&Pf.test(s[2])||Pf.test(s[3])),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map((c=>this.parse(c)))];if(d)return[s[0],...s.slice(1).map((c=>this.parse(c)))]}return s.map((u=>this.parse(u)))}));if(this.debug(this.pattern,o),this.set=o.filter((s=>s.indexOf(!1)===-1)),this.isWindows)for(let s=0;s<this.set.length;s++){const i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,o)=>{const s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const s=t[o];o===1&&s===""&&t[0]===""||s!=="."&&s!==""||(n=!0,t.splice(o,1),o--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let l=r[o+1];const u=r[o+2],d=r[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;n=!0,r.splice(o,1);const c=r.slice(0);c[o]="**",t.push(c),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){const l=r[i];i===1&&l===""&&r[0]===""||l!=="."&&l!==""||(n=!0,r.splice(i,1),i--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){const i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;const l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,s=0,i=[],l="";for(;o<t.length&&s<n.length;)if(t[o]===n[s])i.push(l==="b"?n[s]:t[o]),o++,s++;else if(r&&t[o]==="**"&&n[s]===t[o+1])i.push(t[o]),o++;else if(r&&n[s]==="**"&&t[o]===n[s+1])i.push(n[s]),s++;else if(t[o]!=="*"||!n[s]||!this.options.dot&&n[s].startsWith(".")||n[s]==="**"){if(n[s]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||l==="a")return!1;l="b",i.push(n[s]),o++,s++}else{if(l==="b")return!1;l="a",i.push(t[o]),o++,s++}return t.length===n.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),T=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=w?3:m?0:void 0,S=!T&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:T?0:void 0;if(typeof k=="number"&&typeof S=="number"){const[y,E]=[t[k],n[S]];y.toLowerCase()===E.toLowerCase()&&(n[S]=y,S>k?n=n.slice(S):k>S&&(t=t.slice(k)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,l=0,u=t.length,d=n.length;i<u&&l<d;i++,l++){this.debug("matchOne loop");var c=n[l],p=t[i];if(this.debug(n,c,p),c===!1)return!1;if(c===un){this.debug("GLOBSTAR",[n,c,p]);var f=i,h=l+1;if(h===d){for(this.debug("** at the end");i<u;i++)if(t[i]==="."||t[i]===".."||!o.dot&&t[i].charAt(0)===".")return!1;return!0}for(;f<u;){var g=t[f];if(this.debug(`
7
+ globstar while`,t,f,n,h,g),this.matchOne(t.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,u,g),!0;if(g==="."||g===".."||!o.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,f,n,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug(`
8
+ >>> no match, partial?`,t,f,n,h),f!==u))}let m;if(typeof c=="string"?(m=p===c,this.debug("string match",c,p,m)):(m=c.test(p),this.debug("pattern match",c,p,m)),!m)return!1}if(i===u&&l===d)return!0;if(i===u)return r;if(l===d)return i===u-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return Df(this.pattern,this.options)}parse(t){wi(t);const n=this.options;if(t==="**")return un;if(t==="")return"";let r,o=null;(r=t.match(H0))?o=n.dot?Q0:W0:(r=t.match(L0))?o=(n.nocase?n.dot?B0:N0:n.dot?M0:_0)(r[1]):(r=t.match(K0))?o=(n.nocase?n.dot?J0:G0:n.dot?X0:Y0)(r):(r=t.match(j0))?o=n.dot?U0:z0:(r=t.match(V0))&&(o=q0);const s=jt.fromGlob(t,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=new Set(n.nocase?["i"]:[]);let s=t.map((u=>{const d=u.map((c=>{if(c instanceof RegExp)for(const p of c.flags.split(""))o.add(p);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===un?un:c._src}));return d.forEach(((c,p)=>{const f=d[p+1],h=d[p-1];c===un&&h!==un&&(h===void 0?f!==void 0&&f!==un?d[p+1]="(?:\\/|"+r+"\\/)?"+f:d[p]=r:f===void 0?d[p-1]=h+"(?:\\/|"+r+")?":f!==un&&(d[p-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,d[p+1]=un))})),d.filter((c=>c!==un)).join("/")})).join("|");const[i,l]=t.length>1?["(?:",")"]:["",""];s="^"+i+s+l+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let l=o.length-2;!i&&l>=0;l--)i=o[l];for(let l=0;l<s.length;l++){const u=s[l];let d=o;if(r.matchBase&&u.length===1&&(d=[i]),this.matchOne(d,u,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return zt.defaults(t).Minimatch}}zt.AST=jt,zt.Minimatch=Si,zt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},zt.unescape=Yo;var Z0=it(829);it.n(Z0);var e1=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(e1||{});typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));var t1=it(388);it.n(t1),it(172);class If{isEnabled(){return!0}isActive(t){return st(t,"files-spaces-projects")?!1:st(t,"files-spaces-generic")||ln(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,authService:s,spacesStore:i,sharesStore:l,configStore:u}=t,{webdav:d,graphAuthenticated:c}=r,{replaceInvalidFileRoute:p}=Ri({router:n});return $t.useTask(function*(f,h,g,m=null,w=null,T={}){try{o.clearResourceList();const k=Jo.Default;z.isPublicSpaceResource(g)&&k.push(Ee.DownloadURL);let{resource:S,children:y}=yield*z.call(d.listFiles(g,{path:m,fileId:w},{signal:f,davProperties:k}));S.id&&p({space:g,resource:S,path:m,fileId:w});let E;m==="/"&&(z.isShareSpaceResource(g)?(E=yield*z.call(pi({graphClient:c,spacesStore:i,space:g,signal:f})),E&&(S=z.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:E,serverUrl:u.serverUrl}))):!z.isPersonalSpaceResource(g)&&!z.isPublicSpaceResource(g)&&(S=g)),yield o.loadAncestorMetaData({folder:S,space:g,client:d,signal:f}),z.isProjectSpaceResource(g)&&(yield i.loadGraphPermissions({ids:[g.id],graphClient:c})),z.isShareSpaceResource(g)&&(y.forEach(D=>D.remoteItemId=g.id),g.graphPermissions===void 0&&(E||(E=yield*z.call(pi({graphClient:c,spacesStore:i,space:g,signal:f}))),rf({sharesStore:l,spacesStore:i,space:g,sharedDriveItem:E}))),o.initResourceList({currentFolder:S,resources:y})}catch(k){if(o.setCurrentFolder(null),console.error(k),k.statusCode===401)return s.handleAuthError(a(n.currentRoute))}}).restartable()}}class Ff{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return bt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return $t.useTask(function*(s,i){n.clearResourceList(),n.setAncestorMetaData({});let l=yield r.webdav.listFavoriteFiles({username:o.user?.onPremisesSamAccountName,signal:s});l=l.map(z.buildResource),n.initResourceList({currentFolder:null,resources:l})})}}class $f{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:s,resourcesStore:i}=t;return $t.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const c=(yield*z.call(o.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(p=>p.permissions.some(({link:f})=>!!f)).map(p=>z.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:s.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class Of{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:s,sharesStore:i}=t;return $t.useTask(function*(l,u){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:l}));const c=(yield*z.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:l}))).map(p=>z.buildIncomingShareResource({driveItem:p,graphRoles:i.graphRoles,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Lf{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:s,resourcesStore:i}=t;return $t.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const c=(yield*z.call(o.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(p=>p.permissions.some(({link:f})=>!f)).map(p=>z.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:s.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class _f{isEnabled(){return!0}isActive(t){return qt(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:o,graphAuthenticated:s}}=t;return $t.useTask(function*(i,l,u){n.clearResourceList(),n.setAncestorMetaData({});const{resource:d,children:c}=yield o.listFiles(u,{},{depth:1,davProperties:Jo.Trashbin,isTrash:!0,signal:i});z.isProjectSpaceResource(u)&&(yield r.loadGraphPermissions({ids:[u.id],graphClient:s})),n.initResourceList({currentFolder:d,resources:c})})}}class Mf{loaders;constructor(){this.loaders=[new If,new Ff,new $f,new Of,new Lf,new _f]}getTask(){const t=et(),n=He(),r=Dt(),o=Re(),s=Pe(),i=Ge(),l=De(),u=tr(),d=ql(),c=this.loaders.find(p=>p.isEnabled()&&p.isActive(a(o)));if(!c){console.debug("No folder loader found for route");return}return $t.useTask(function*(...p){const f={clientService:s,configStore:i,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:l,sharesStore:u,router:o,authService:d};try{yield c.getTask(f).perform(...p)}catch(h){console.error(h)}})}}const Nf=new Mf;var Sr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Sr||{});const n1=200;class r1{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=n1,indeterminate:r=!0}={}){const o={id:Ct.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),rt.debounce(()=>{o.active=!0,ze.publish("loading-service.add")},n)(),t({setProgress:({total:l,current:u})=>{r||this.setProgress({task:o,total:l,current:u})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),ze.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,ze.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var o1="__lodash_hash_undefined__";function s1(e){return this.__data__.set(e,o1),this}function i1(e){return this.__data__.has(e)}function Ti(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}Ti.prototype.add=Ti.prototype.push=s1,Ti.prototype.has=i1;function a1(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 l1(e,t){return e.has(t)}var c1=1,u1=2;function Bf(e,t,n,r,o,s){var i=n&c1,l=e.length,u=t.length;if(l!=u&&!(i&&u>l))return!1;var d=s.get(e),c=s.get(t);if(d&&c)return d==t&&c==e;var p=-1,f=!0,h=n&u1?new Ti:void 0;for(s.set(e,t),s.set(t,e);++p<l;){var g=e[p],m=t[p];if(r)var w=i?r(m,g,p,t,e,s):r(g,m,p,e,t,s);if(w!==void 0){if(w)continue;f=!1;break}if(h){if(!a1(t,function(T,k){if(!l1(h,k)&&(g===T||o(g,T,n,r,s)))return h.push(k)})){f=!1;break}}else if(!(g===m||o(g,m,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function d1(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function f1(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var p1=1,h1=2,m1="[object Boolean]",g1="[object Date]",v1="[object Error]",y1="[object Map]",b1="[object Number]",w1="[object RegExp]",S1="[object Set]",T1="[object String]",k1="[object Symbol]",C1="[object ArrayBuffer]",x1="[object DataView]",jf=sn?sn.prototype:void 0,Pl=jf?jf.valueOf:void 0;function A1(e,t,n,r,o,s,i){switch(n){case x1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C1:return!(e.byteLength!=t.byteLength||!s(new li(e),new li(t)));case m1:case g1:case b1:return Vo(+e,+t);case v1:return e.name==t.name&&e.message==t.message;case w1:case T1:return e==t+"";case y1:var l=d1;case S1:var u=r&p1;if(l||(l=f1),e.size!=t.size&&!u)return!1;var d=i.get(e);if(d)return d==t;r|=h1,i.set(e,t);var c=Bf(l(e),l(t),r,o,s,i);return i.delete(e),c;case k1:if(Pl)return Pl.call(e)==Pl.call(t)}return!1}function Il(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function zf(e,t,n){var r=t(e);return Tn(e)?r:Il(r,n(e))}function E1(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[o++]=i)}return s}function Uf(){return[]}var R1=Object.prototype,D1=R1.propertyIsEnumerable,Vf=Object.getOwnPropertySymbols,qf=Vf?function(e){return e==null?[]:(e=Object(e),E1(Vf(e),function(t){return D1.call(e,t)}))}:Uf,P1=Dd(Object.keys,Object),I1=Object.prototype,F1=I1.hasOwnProperty;function $1(e){if(!el(e))return P1(e);var t=[];for(var n in Object(e))F1.call(e,n)&&n!="constructor"&&t.push(n);return t}function O1(e){return ui(e)?Ud(e):$1(e)}function Hf(e){return zf(e,O1,qf)}var L1=1,_1=Object.prototype,M1=_1.hasOwnProperty;function N1(e,t,n,r,o,s){var i=n&L1,l=Hf(e),u=l.length,d=Hf(t),c=d.length;if(u!=c&&!i)return!1;for(var p=u;p--;){var f=l[p];if(!(i?f in t:M1.call(t,f)))return!1}var h=s.get(e),g=s.get(t);if(h&&g)return h==t&&g==e;var m=!0;s.set(e,t),s.set(t,e);for(var w=i;++p<u;){f=l[p];var T=e[f],k=t[f];if(r)var S=i?r(k,T,f,t,e,s):r(T,k,f,e,t,s);if(!(S===void 0?T===k||o(T,k,n,r,s):S)){m=!1;break}w||(w=f=="constructor")}if(m&&!w){var y=e.constructor,E=t.constructor;y!=E&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(m=!1)}return s.delete(e),s.delete(t),m}var Fl=$r(Fn,"DataView"),$l=$r(Fn,"Promise"),Ol=$r(Fn,"Set"),Ll=$r(Fn,"WeakMap"),Wf="[object Map]",B1="[object Object]",Qf="[object Promise]",Kf="[object Set]",Gf="[object WeakMap]",Jf="[object DataView]",j1=Fr(Fl),z1=Fr(Ho),U1=Fr($l),V1=Fr(Ol),q1=Fr(Ll),Cn=Ir;(Fl&&Cn(new Fl(new ArrayBuffer(1)))!=Jf||Ho&&Cn(new Ho)!=Wf||$l&&Cn($l.resolve())!=Qf||Ol&&Cn(new Ol)!=Kf||Ll&&Cn(new Ll)!=Gf)&&(Cn=function(e){var t=Ir(e),n=t==B1?e.constructor:void 0,r=n?Fr(n):"";if(r)switch(r){case j1:return Jf;case z1:return Wf;case U1:return Qf;case V1:return Kf;case q1:return Gf}return t});var H1=1,Xf="[object Arguments]",Yf="[object Array]",ki="[object Object]",W1=Object.prototype,Zf=W1.hasOwnProperty;function Q1(e,t,n,r,o,s){var i=Tn(e),l=Tn(t),u=i?Yf:Cn(e),d=l?Yf:Cn(t);u=u==Xf?ki:u,d=d==Xf?ki:d;var c=u==ki,p=d==ki,f=u==d;if(f&&Qo(e)){if(!Qo(t))return!1;i=!0,c=!1}if(f&&!c)return s||(s=new On),i||ol(e)?Bf(e,t,n,r,o,s):A1(e,t,u,n,r,o,s);if(!(n&H1)){var h=c&&Zf.call(e,"__wrapped__"),g=p&&Zf.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,w=g?t.value():t;return s||(s=new On),o(m,w,n,r,s)}}return f?(s||(s=new On),N1(e,t,n,r,o,s)):!1}function ep(e,t,n,r,o){return e===t?!0:e==null||t==null||!Ln(e)&&!Ln(t)?e!==e&&t!==t:Q1(e,t,n,r,ep,o)}function tp(e,t){return ep(e,t)}class K1{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:o}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=o}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,o){const{space:s,resource:i}=t;if(!i.canDownload()||!i.hasPreview?.())return;const l=z.isPublicSpaceResource(s);if(!(!l&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(l)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(u){if(r)return;throw u}}}async cacheFactory(t,n,r){const{resource:o,dimensions:s}=t,i=wl.filePreview.get(o.id.toString());if(i&&i.etag===o.etag&&tp(s,i.dimensions))return i.src;try{const l=await this.privatePreviewBlob(t,!1,!0,r);return wl.filePreview.set(o.id.toString(),{src:l,etag:o.etag,dimensions:s},0).src}catch(l){if(n)return;throw l}}buildQueryString(t){return $g.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){const{resource:s,dimensions:i,processor:l}=t;if(n)return this.cacheFactory(t,r,o);const u=[this.configStore.serverUrl,"remote.php/dav",vl(s.webDavPath),"?",this.buildQueryString({etag:s.etag,dimensions:i,processor:l})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(u,{responseType:"blob",signal:o});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const c=d.response?.headers?.["retry-after"]||5;return await new Promise(p=>setTimeout(p,c*1e3)),this.privatePreviewBlob(t,n,r,o)}throw d}}async publicPreviewUrl(t,n){const{space:r,resource:o,dimensions:s,processor:i}=t;let{downloadURL:l}=o;if(!l){const{downloadURL:f}=await this.clientService.webdav.getFileInfo(r,o,{davProperties:[Ee.DownloadURL]});l=f}const[u,d]=l.split("?"),c=[this.buildQueryString({etag:o.etag,dimensions:s,processor:i}),d].filter(Boolean).join("&"),p=[u,c].filter(Boolean).join("?");try{const{status:f}=await this.clientService.httpUnAuthenticated.head(p,{signal:n});if(f!==404)return p}catch(f){if([425,429].includes(f.status)){const h=f.response?.headers?.["retry-after"]||5;return await new Promise(g=>setTimeout(g,h*1e3)),this.publicPreviewUrl(t,n)}throw f}}}const Ci=K.z.enum(["fit","resize","fill","thumbnail"]);class G1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...rt.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 J1{$gettext;constructor({$gettext:t}){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],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!rt.isObject(t))throw new Error("options should be an object");if(!rt.isNumber(t.minLength)||rt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!rt.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 xi{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!rt.isObject(t))throw new Error("options should be an object");if(!rt.isNumber(t.minLength)||rt.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 X1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class Y1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class Z1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class eT extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class tT{language;capability;policy;generatePasswordRules;constructor({language:t}){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 X1({...this.language}),mustNotBeEmpty:new G1({...this.language}),atLeastUppercaseCharacters:new Y1({...this.language}),atLeastLowercaseCharacters:new Z1({...this.language}),atLeastDigits:new eT({...this.language}),mustContain:new J1({...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 Og.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",o="0123456789",s=(h,g)=>{const m=256-256%h.length;let w="",T;for(let k=0;k<g;k++){do T=window.crypto.getRandomValues(new Uint8Array(1))[0];while(T>=m);w+=h[T%h.length]}return w},{minLowercaseCharacters:i,minUppercaseCharacters:l,minDigits:u,minSpecialCharacters:d,length:c}=this.generatePasswordRules;let p="";if(p+=s(t,i),p+=s(n,l),p+=s(o,u),p+=s(r,d),p.length<c){const h=c-p.length,g=t+n+r+o;p+=s(g,h)}return(h=>{const g=h.split(""),m=new Uint32Array(g.length);window.crypto.getRandomValues(m);for(let w=g.length-1;w>0;w--){const T=m[w]%(w+1);[g[w],g[T]]=[g[T],g[w]]}return g.join("")})(p)}}const np=e=>({name:Ke.basename(e),type:"directory",relativePath:e}),rp=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),op=async e=>{const t=await new Promise((r,o)=>e.file(r,o));return e.fullPath===z.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},nT=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*rT(e){const t=e.createReader(),n=()=>new Promise((o,s)=>{t.readEntries(o,s)});let r;do{r=await n();for(const o of r)yield o}while(r.length>0)}async function*sp(e,t){if(e.isDirectory){let n=!1;for await(const r of rT(e))if(r.isDirectory)yield*sp(r,t);else if(r.isFile)try{n=!0,yield op(r)}catch(o){console.error(o),t?.(o)}n||(yield np(e.fullPath||e.name))}else try{yield op(e)}catch(n){console.error(n),t?.(n)}}const oT=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,o=>nT(o)));for(let o=0;o<r.length;o++)for await(const s of sp(r[o],t))n.push(s);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},sT={target:null,uppyService:null};class iT extends Bc.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...sT,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(s=>{s.type==="acquirer"&&s.handleRootDrop?.(t)});let n=!1;const r=s=>{this.uppy.log(s,"error"),n||(this.uppy.info(s.message,"error"),n=!0)},o=await oT(t.dataTransfer,r);if(o.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const s=rp("DropTarget",o);this.uppyService.addFiles(s)}catch(s){this.uppy.log(s)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=jc.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class aT{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new Bc({autoProceed:!1,onBeforeFileAdded:(r,o)=>r.id in o&&!o[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),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()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?z.urlJoin(n):void 0};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:s}){const i={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:s,onBeforeRequest:o,onShouldRetry:(d,c,p,f)=>d?.originalResponse?.getStatus()>=500?!1:d?.originalResponse?.getStatus()===401?!0:f(d)},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const u=this.uppy.getPlugin("Tus");if(u){u.setOptions(i);return}this.uppy.use(Lg,i)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},s=this.uppy.getPlugin("Tus");s&&this.uppy.removePlugin(s);const i=this.uppy.getPlugin("XHRUpload");if(i){i.setOptions(o);return}this.uppy.use(_g,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(iT,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return ze.subscribe(t,n)}unsubscribe(t,n){ze.unsubscribe(t,n)}publish(t,n){ze.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=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[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,s=Array.from(o.files);this.addFiles(s)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return jc.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}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()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}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 lT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var cT=Object.getOwnPropertySymbols,uT=cT?function(e){for(var t=[];e;)Il(t,qf(e)),e=Za(e);return t}:Uf;function ip(e){return zf(e,il,uT)}var dT=Object.prototype,fT=dT.hasOwnProperty;function pT(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&fT.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function hT(e,t){var n=Ya(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var mT=/\w*$/;function gT(e){var t=new e.constructor(e.source,mT.exec(e));return t.lastIndex=e.lastIndex,t}var ap=sn?sn.prototype:void 0,lp=ap?ap.valueOf:void 0;function vT(e){return lp?Object(lp.call(e)):{}}var yT="[object Boolean]",bT="[object Date]",wT="[object Map]",ST="[object Number]",TT="[object RegExp]",kT="[object Set]",CT="[object String]",xT="[object Symbol]",AT="[object ArrayBuffer]",ET="[object DataView]",RT="[object Float32Array]",DT="[object Float64Array]",PT="[object Int8Array]",IT="[object Int16Array]",FT="[object Int32Array]",$T="[object Uint8Array]",OT="[object Uint8ClampedArray]",LT="[object Uint16Array]",_T="[object Uint32Array]";function MT(e,t,n){var r=e.constructor;switch(t){case AT:return Ya(e);case yT:case bT:return new r(+e);case ET:return hT(e);case RT:case DT:case PT:case IT:case FT:case $T:case OT:case LT:case _T:return Ed(e,n);case wT:return new r;case ST:case CT:return new r(e);case TT:return gT(e);case kT:return new r;case xT:return vT(e)}}var NT="[object Map]";function BT(e){return Ln(e)&&Cn(e)==NT}var cp=so&&so.isMap,jT=cp?nl(cp):BT,zT="[object Set]";function UT(e){return Ln(e)&&Cn(e)==zT}var up=so&&so.isSet,VT=up?nl(up):UT,qT=1,dp="[object Arguments]",HT="[object Array]",WT="[object Boolean]",QT="[object Date]",KT="[object Error]",fp="[object Function]",GT="[object GeneratorFunction]",JT="[object Map]",XT="[object Number]",pp="[object Object]",YT="[object RegExp]",ZT="[object Set]",ek="[object String]",tk="[object Symbol]",nk="[object WeakMap]",rk="[object ArrayBuffer]",ok="[object DataView]",sk="[object Float32Array]",ik="[object Float64Array]",ak="[object Int8Array]",lk="[object Int16Array]",ck="[object Int32Array]",uk="[object Uint8Array]",dk="[object Uint8ClampedArray]",fk="[object Uint16Array]",pk="[object Uint32Array]",nt={};nt[dp]=nt[HT]=nt[rk]=nt[ok]=nt[WT]=nt[QT]=nt[sk]=nt[ik]=nt[ak]=nt[lk]=nt[ck]=nt[JT]=nt[XT]=nt[pp]=nt[YT]=nt[ZT]=nt[ek]=nt[tk]=nt[uk]=nt[dk]=nt[fk]=nt[pk]=!0,nt[KT]=nt[fp]=nt[nk]=!1;function Ai(e,t,n,r,o,s){var i,l=t&qT;if(n&&(i=o?n(e,r,o,s):n(e)),i!==void 0)return i;if(!$n(e))return e;var u=Tn(e);if(u)i=pT(e);else{var d=Cn(e),c=d==fp||d==GT;if(Qo(e))return Ad(e,l);if(d==pp||d==dp||c&&!o)i={};else{if(!nt[d])return o?e:{};i=MT(e,d,l)}}s||(s=new On);var p=s.get(e);if(p)return p;s.set(e,i),VT(e)?e.forEach(function(g){i.add(Ai(g,t,n,g,e,s))}):jT(e)&&e.forEach(function(g,m){i.set(m,Ai(g,t,n,m,e,s))});var f=ip,h=u?void 0:f(e);return lT(h||e,function(g,m){h&&(m=g,g=e[m]),Bd(i,m,Ai(g,t,n,m,e,s))}),i}function hk(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 s=Array(o);++r<o;)s[r]=e[r+t];return s}function mk(e,t){return t.length<2?e:bf(e,hk(t,0,-1))}var gk=Object.prototype,vk=gk.hasOwnProperty;function yk(e,t){t=Al(t,e);var n=-1,r=t.length;if(!r)return!0;for(var o=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var s=t[n];if(typeof s=="string"){if(s==="__proto__"&&!vk.call(e,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(o&&n===0)continue;return!1}}}var i=mk(e,t);return i==null||delete i[yf(qc(t))]}function bk(e){return tl(e)?void 0:e}var hp=sn?sn.isConcatSpreadable:void 0;function wk(e){return Tn(e)||ci(e)||!!(hp&&e&&e[hp])}function Sk(e,t,n,r,o){var s=-1,i=e.length;for(n||(n=wk),o||(o=[]);++s<i;){var l=e[s];n(l)?Il(o,l):o[o.length]=l}return o}function Tk(e){var t=e==null?0:e.length;return t?Sk(e):[]}function kk(e){return Qd(Wd(e,void 0,Tk),e+"")}var Ck=1,xk=2,Ak=4,po=kk(function(e,t){var n={};if(e==null)return n;var r=!1;t=hf(t,function(s){return s=Al(s,e),r||(r=s.length>1),s}),jd(e,ip(e),n),r&&(n=Ai(n,Ck|xk|Ak,bk));for(var o=t.length;o--;)yk(n,t[o]);return n});const Ek=(e,t)=>{const n=(s="")=>s.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((s,i)=>({id:Ct.v4(),allowContextActions:!0,text:s,to:{path:"/"+[...r].splice(0,r.length-o.length+i+1).join("/"),query:po(e.query,"fileId","page")},isStaticNav:!1}))},Rk=(...e)=>{const t=e.pop();return[...e,{id:Ct.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Zo{static Cut="cut";static Copy="copy"}const _l=e=>e.clientY===0,Ml=(e,t,n)=>{if(!e)return;let r=n;r.$el&&(r=n.$el);const o=r.getBoundingClientRect(),s=_l(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:s,bottom:s,left:t.type==="contextmenu"&&!_l(t)?t.clientX:o.x,right:t.type==="contextmenu"&&!_l(t)?t.clientX:o.x})}),e.show()},Ei=e=>(e||"").split("_")[0],Mr=(e,t,n=vt.DateTime.DATETIME_MED)=>e.setLocale(Ei(t)).toLocaleString(n),mp=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromJSDate(e),t,n),Dk=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromHTTP(e),t,n),gp=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromISO(e),t,n),Pk=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromRFC2822(e),t,n),es=(e,t)=>e.setLocale(Ei(t)).toRelative(),vp=(e,t)=>es(vt.DateTime.fromJSDate(e),t),Ik=(e,t)=>es(vt.DateTime.fromHTTP(e),t),Fk=(e,t)=>es(vt.DateTime.fromISO(e),t),$k=(e,t)=>es(vt.DateTime.fromRFC2822(e),t),Ok=1048576,Ht=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":Fg.filesize(n,{round:n<Ok?0:1,locale:Ei(t),base:10,output:"string"})};function yp(e="",t=!1){const n=z.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}const Lk=({space:e,resource:t})=>{const{getIndicators:n}=Dc();return n({space:e,resource:t})},bp=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),wp=e=>new Promise(t=>e.toBlob(t)),ts=()=>window.navigator.platform.match("Mac");function Nr(e){return e.status==="fulfilled"}function Br(e){return e.status==="rejected"}const Nl=e=>new TextEncoder().encode(e).length,Me=we.defineStore("messages",()=>{const e=W([]),t=s=>{const i={...s,id:Ct.v4()};return e.value.push(i),i},n=s=>{const i=l=>l.response?.headers?.get("x-request-id");return s.map(l=>i(l)).filter(Boolean).map(l=>`X-Request-Id: ${l}`).join(`\r
9
+ `)};return{messages:e,showMessage:t,showErrorMessage:s=>{const i={id:Ct.v4(),status:"danger",timeout:0,...s.errors&&{errorLogContent:n(s.errors)},...s};return e.value.push(i),i},removeMessage:s=>{e.value=a(e).filter(({id:i})=>s.id!==i)}}}),ns=we.defineStore("clipboard",()=>{const{$gettext:e}=me.useGettext(),{showMessage:t}=Me(),n=W(),r=W([]);return{action:n,resources:r,copyResources:l=>{l[0]?.canDownload()&&(n.value=Zo.Copy,r.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0]?.canDownload()&&(n.value=Zo.Cut,r.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Sp=we.defineStore("extensionPreferences",()=>{const e=Rn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,s)=>o.multiple?s.map(i=>i.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,s)=>{const i=e.value[o];return i||{extensionPointId:o,selectedExtensionIds:s}},setSelectedExtensionIds:(o,s)=>{if(!Object.hasOwn(a(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:s};return}e.value[o].selectedExtensionIds=s}}}),ho=we.defineStore("extensionRegistry",()=>{const e=Ge(),t=W([]),n=d=>{t.value.push(d)},r=d=>{t.value=a(t).map(c=>W(a(c).filter(({id:p})=>!d.includes(p)))).filter(c=>a(c).length)},o=d=>{if(!d.id||!d.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return a(t).flatMap(c=>a(c).filter(p=>p.type===d.extensionType&&!e.options.disabledExtensions.includes(p.id)&&(!p.extensionPointIds||p.extensionPointIds?.includes(d.id))))},s=W([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:s,registerExtensionPoints:d=>{s.value.push(d)},unregisterExtensionPoints:d=>{s.value=a(s).map(c=>W(a(c).filter(({id:p})=>!d.includes(p)))).filter(c=>a(c).length)},getExtensionPoints:(d={})=>a(s).flatMap(c=>a(c).filter(p=>!(Object.hasOwn(d,"extensionType")&&p.extensionType!==d.extensionType)))}}),_k=we.defineStore("groupwareConfig",()=>{const e=W(""),t=W([]),n=W(),r=W([]),o=W({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:o,loadGroupwareConfig:i=>{e.value=i.version,t.value=i.capabilities||[],n.value=i.limits,r.value=i.accounts||[],o.value=i.primaryAccounts||{}}}}),Tp=K.z.object({maxMailboxDepth:K.z.number(),maxSizeMailboxName:K.z.number(),maxMailboxesPerEmail:K.z.number(),maxSizeAttachmentsPerEmail:K.z.number(),mayCreateTopLevelMailbox:K.z.boolean(),maxDelayedSend:K.z.number()}),kp=K.z.object({maxSizeScriptName:K.z.number(),maxSizeScript:K.z.number(),maxNumberScripts:K.z.number(),maxNumberRedirects:K.z.number()}),Cp=K.z.object({mail:Tp.optional(),sieve:kp.optional()}),xp=K.z.object({id:K.z.string(),name:K.z.string(),email:K.z.string().email(),mayDelete:K.z.boolean()}),Ap=K.z.object({accountId:K.z.string(),name:K.z.string(),isPersonal:K.z.boolean(),isReadOnly:K.z.boolean(),capabilities:Cp,identities:K.z.array(xp)}),Ep=K.z.object({maxSizeUpload:K.z.number(),maxConcurrentUpload:K.z.number(),maxSizeRequest:K.z.number(),maxConcurrentRequests:K.z.number()}),Rp=K.z.array(Ap),Dp=K.z.record(K.z.string(),K.z.string()),Mk=K.z.object({version:K.z.string(),capabilities:K.z.array(K.z.string()),limits:Ep,accounts:Rp,primaryAccounts:Dp}),Je=we.defineStore("modals",()=>{const e=W([]),t=A(()=>a(e).at(-1)),n=u=>a(e).find(d=>d.id===u);return{modals:e,activeModal:t,dispatchModal:u=>{const d={...u,id:Ct.v4()};return e.value.push(d),d},updateModal:(u,d,c)=>{const p=n(u);p[d]=c},removeModal:u=>{e.value=a(e).filter(d=>d.id!==u)},removeAllModals:()=>{e.value=[]},setModalActive:u=>{const d=a(e).findIndex(p=>p.id===u);if(d<0)return;const c=n(u);a(e).splice(d,1),e.value.push(c)}}}),et=we.defineStore("user",()=>{const e=W();return{user:e,setUser:r=>{e.value=r,Ng.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function Nk(e,t,n,r){for(var o=-1,s=e==null?0:e.length;++o<s;)n=t(n,e[o],o,e);return n}function Bk(e){return function(t){return e?.[t]}}var jk={À:"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"},zk=Bk(jk),Uk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vk="\\u0300-\\u036f",qk="\\ufe20-\\ufe2f",Hk="\\u20d0-\\u20ff",Wk=Vk+qk+Hk,Qk="["+Wk+"]",Kk=RegExp(Qk,"g");function Gk(e){return e=xl(e),e&&e.replace(Uk,zk).replace(Kk,"")}var Jk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Xk(e){return e.match(Jk)||[]}var Yk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Zk(e){return Yk.test(e)}var Pp="\\ud800-\\udfff",eC="\\u0300-\\u036f",tC="\\ufe20-\\ufe2f",nC="\\u20d0-\\u20ff",rC=eC+tC+nC,Ip="\\u2700-\\u27bf",Fp="a-z\\xdf-\\xf6\\xf8-\\xff",oC="\\xac\\xb1\\xd7\\xf7",sC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iC="\\u2000-\\u206f",aC=" \\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",$p="A-Z\\xc0-\\xd6\\xd8-\\xde",lC="\\ufe0e\\ufe0f",Op=oC+sC+iC+aC,Lp="['’]",_p="["+Op+"]",cC="["+rC+"]",Mp="\\d+",uC="["+Ip+"]",Np="["+Fp+"]",Bp="[^"+Pp+Op+Mp+Ip+Fp+$p+"]",dC="\\ud83c[\\udffb-\\udfff]",fC="(?:"+cC+"|"+dC+")",pC="[^"+Pp+"]",jp="(?:\\ud83c[\\udde6-\\uddff]){2}",zp="[\\ud800-\\udbff][\\udc00-\\udfff]",mo="["+$p+"]",hC="\\u200d",Up="(?:"+Np+"|"+Bp+")",mC="(?:"+mo+"|"+Bp+")",Vp="(?:"+Lp+"(?:d|ll|m|re|s|t|ve))?",qp="(?:"+Lp+"(?:D|LL|M|RE|S|T|VE))?",Hp=fC+"?",Wp="["+lC+"]?",gC="(?:"+hC+"(?:"+[pC,jp,zp].join("|")+")"+Wp+Hp+")*",vC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bC=Wp+Hp+gC,wC="(?:"+[uC,jp,zp].join("|")+")"+bC,SC=RegExp([mo+"?"+Np+"+"+Vp+"(?="+[_p,mo,"$"].join("|")+")",mC+"+"+qp+"(?="+[_p,mo+Up,"$"].join("|")+")",mo+"?"+Up+"+"+Vp,mo+"+"+qp,yC,vC,Mp,wC].join("|"),"g");function TC(e){return e.match(SC)||[]}function kC(e,t,n){return e=xl(e),t=t,t===void 0?Zk(e)?TC(e):Xk(e):e.match(t)||[]}var CC="['’]",xC=RegExp(CC,"g");function AC(e){return function(t){return Nk(kC(Gk(t).replace(xC,"")),e,"")}}var Qp=AC(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Kp=K.z.object({name:K.z.string().optional(),slogan:K.z.string().optional(),logo:K.z.string().optional(),logoMobile:K.z.string().optional(),urls:K.z.object({accessDeniedHelp:K.z.string().optional(),imprint:K.z.string().optional(),privacy:K.z.string().optional(),accessibility:K.z.string().optional()}).optional(),shareRoles:K.z.record(K.z.string(),K.z.object({iconName:K.z.string()})).optional()}),EC=K.z.object({roles:K.z.record(K.z.string(),K.z.string()).optional(),colorPalette:K.z.record(K.z.string(),K.z.string()).optional(),fontFamily:K.z.string().optional()}),Gp=Kp.extend({designTokens:EC.optional(),favicon:K.z.string().optional(),background:K.z.string().optional()}),RC=Gp.extend({isDark:K.z.boolean(),label:K.z.string()}),Jp=K.z.object({defaults:Gp,themes:K.z.array(RC)}),DC=K.z.object({common:Kp.optional(),clients:K.z.object({web:Jp})}),PC="oc_currentThemeName",IC=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},Bn=we.defineStore("theme",()=>{const e=Rn.useLocalStorage(PC,null),t=Rn.usePreferredDark(),n=W(),r=W([]),o=c=>{const p=c.common,f=c.clients.web.defaults,h=zc(p,f);r.value=c.clients.web.themes.map(g=>zc(h,g)),s()},s=()=>{const c=a(r).find(f=>!f.isDark),p=a(r).find(f=>f.isDark);u(a(r).find(f=>f.label===a(e))||(a(t)?p:c)||a(r)[0],!1)},i=()=>{e.value=null,s()},l=A(()=>e.value===null),u=(c,p=!0)=>{n.value=c,p&&(e.value=a(n).label);const f=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];hi("font-family",a(n).designTokens.fontFamily),f.forEach(h=>{for(const g in a(n).designTokens[h.name])hi(`${h.prefix}-${Qp(g)}`,a(n).designTokens[h.name][g])}),a(n).designTokens?.roles?.chrome||(hi("role-chrome",a(n).designTokens?.roles?.surfaceContainer),hi("role-on-chrome",a(n).designTokens?.roles?.onSurface)),a(n).favicon&&IC(a(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:u,setAutoSystemTheme:i,isCurrentThemeAutoSystem:l,getRoleIcon:c=>a(n).shareRoles[c.id]?.iconName||"user"}}),tr=we.defineStore("shares",()=>{const e=De(),{getRoleIcon:t}=Bn(),n=W(!1),r=W([]),o=W([]),s=W({}),i=_=>{s.value=_.reduce((L,V)=>(L[V.id]={...V,icon:t(V)},L),{})},l=_=>{const L=a(r).find(({id:V})=>V===_.id);if(L){Object.assign(L,_);return}a(r).push(_)},u=_=>{r.value=_},d=_=>{a(r).push(..._)},c=_=>{r.value=a(r).filter(({id:L})=>L!==_.id)},p=()=>{r.value=[],o.value=[],n.value=void 0},f=()=>{const _=Object.values(e.ancestorMetaData).map(({id:L})=>L);if(!_.length){r.value=[],o.value=[];return}a(r).forEach(L=>{_.includes(L.resourceId)||c(L)}),a(o).forEach(L=>{_.includes(L.resourceId)||m(L)})},h=_=>{o.value=_},g=_=>{const L=a(o).find(({id:V})=>V===_.id);if(L){Object.assign(L,_);return}a(o).push(_)},m=_=>{o.value=a(o).filter(({id:L})=>L!==_.id)},w=_=>{n.value=_},T=_=>{const L=O=>{const M=new Set;return O.forEach(N=>{M.add(N.shareType)}),Array.from(M)},V=[...e.resources,e.currentFolder].find(O=>O?.id===_);if(!V||z.isProjectSpaceResource(V))return;const te=[...a(r),...a(o)];e.updateResourceField({id:V.id,field:"shareTypes",value:L(te.filter(O=>!O.indirect))});const B=e.getAncestorById(_);B&&e.updateAncestorField({path:B.path,field:"shareTypes",value:L(te.filter(O=>!O.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:s,setGraphRoles:i,setLoading:w,setCollaboratorShares:u,setLinkShares:h,removeOrphanedShares:f,pruneShares:p,addShare:async({clientService:_,space:L,resource:V,options:te})=>{const O=await _.graphAuthenticated.permissions.createInvite(L.id,V.id,te,a(s));return d([O]),T(V.id),O},updateShare:async({clientService:_,space:L,resource:V,collaboratorShare:te,options:B})=>{const O=_.graphAuthenticated.permissions,M={roles:B.roles,expirationDateTime:B.expirationDateTime},N=await O.updatePermission(L.id,V.id,te.id,M,a(s));return l(N),N},deleteShare:async({clientService:_,space:L,resource:V,collaboratorShare:te})=>{await _.graphAuthenticated.permissions.deletePermission(L.id,V.id,te.id),c(te),T(V.id)},addLink:async({clientService:_,space:L,resource:V,options:te})=>{const O=await _.graphAuthenticated.permissions.createLink(L.id,V.id,te),M=e.selectedResources,N=M.some(({fileId:q})=>q===V.fileId)||M.length===0&&e.currentFolder.fileId===V.fileId;if(g(O),T(V.id),!N){const q=e.ancestorMetaData[V.path]??null;if(q){const{shareTypes:j}=q;j.includes(z.ShareTypes.link.value)||e.updateAncestorField({path:q.path,field:"shareTypes",value:[...j,z.ShareTypes.link.value]})}}return O},updateLink:async({clientService:_,space:L,resource:V,linkShare:te,options:B})=>{const O=_.graphAuthenticated.permissions;let M;if(Object.hasOwn(B,"password"))M=await O.setPermissionPassword(L.id,V.id,te.id,{password:B.password}),te.hasPassword=!!B.password;else{const N={link:{...B.type&&{type:B.type},...B.displayName&&{"@libre.graph.displayName":B.displayName}},...Object.hasOwn(B,"expirationDateTime")&&{expirationDateTime:B.expirationDateTime}};M=await O.updatePermission(L.id,V.id,te.id,N)}return g(M),M},deleteLink:async({clientService:_,space:L,resource:V,linkShare:te})=>{await _.graphAuthenticated.permissions.deletePermission(L.id,V.id,te.id),m(te),T(V.id)}}}),Wt={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Xp={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Yp=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),rs=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const o=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!o.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return o;const s={};o.forEach(l=>{const{rootId:u,driveAlias:d}=l.root.remoteItem;s[u]=d});const i=Object.entries(s).map(([l,u])=>z.buildSpace({id:z.extractStorageId(l),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...o,...i]},He=we.defineStore("spaces",()=>{const e=et(),t=Ge(),n=tr(),r=W([]),o=W(),s=W(!1),i=W(!1),l=W(!1),u=W(null),d=W([]),c=W([]),p=A(()=>a(r).find(Y=>z.isPersonalSpaceResource(Y)&&Y.isOwner(e.user))),f=Y=>{s.value=Y},h=Y=>{i.value=Y},g=Y=>{l.value=Y},m=Y=>{o.value=Y},w=Y=>{u.value=Y},T=Y=>{if(!z.isProjectSpaceResource(Y))return[];const ae=n.collaboratorShares.filter(ne=>ne.resourceId===Y.id);return Yp(ae)},k=Y=>{a(r).push(...Y)},S=Y=>{r.value=a(r).filter(({id:ae})=>ae!==Y.id)},y=Y=>a(r).find(ae=>Y==ae.id),E=async({graphClient:Y,space:ae,signal:ne})=>(await V({graphClient:Y,signal:ne}),a(r).find(pe=>z.isMountPointSpaceResource(pe)&&pe.root?.remoteItem?.id===ae.id)),D=({driveAliasPrefix:Y,id:ae,shareName:ne})=>{const pe=z.buildShareSpaceResource({driveAliasPrefix:Y,id:ae,shareName:ne,serverUrl:t.serverUrl});return k([pe]),pe},$=Y=>{const ae=a(r).find(({id:ne})=>ne===Y.id);if(ae){Object.assign(ae,Y);return}k([Y])},_=({id:Y,field:ae,value:ne})=>{const pe=a(r).find(fe=>Y===fe.id);pe&&(pe[ae]=ne)},L=async({graphClient:Y})=>{l.value=!0;try{const[ae,ne]=await Promise.all([rs({graphClient:Y,driveType:"personal",configStore:t}),rs({graphClient:Y,driveType:"project",configStore:t})]);k([...ae,...ne])}finally{l.value=!1}},V=async({graphClient:Y,signal:ae})=>{if(!a(i))try{const ne=await rs({graphClient:Y,driveType:"mountpoint",configStore:t,signal:ae});k(ne)}finally{i.value=!0}},te=async({graphClient:Y,signal:ae})=>{const ne=await rs({graphClient:Y,driveType:"project",configStore:t,signal:ae});r.value=a(r).filter(pe=>!z.isProjectSpaceResource(pe)),k(ne)},B=Y=>{a(d).includes(Y)||a(d).push(Y)},O=Y=>{d.value=a(d).filter(ae=>ae!==Y)},M=()=>{d.value=[]},N=Y=>{a(c).includes(Y)||a(c).push(Y)},q=Y=>{c.value=a(c).filter(ae=>ae!==Y)},j=()=>{c.value=[]},H=W({});return{spaces:r,spacesInitialized:s,mountPointsInitialized:i,spacesLoading:l,currentSpace:o,personalSpace:p,defaultSpaceImageBlobURL:u,imagesLoading:d,readmesLoading:c,getSpace:y,createShareSpace:D,setSpacesInitialized:f,setMountPointsInitialized:h,setSpacesLoading:g,setCurrentSpace:m,setDefaultSpaceImageBlobURL:w,getSpaceMembers:T,getMountPointForSpace:E,addSpaces:k,removeSpace:S,upsertSpace:$,updateSpaceField:_,loadSpaces:L,loadMountPoints:V,reloadProjectSpaces:te,addToImagesLoading:B,removeFromImagesLoading:O,purgeImagesLoading:M,addToReadmesLoading:N,removeFromReadmesLoading:q,purgeReadmesLoading:j,loadGraphPermissions:async({ids:Y,graphClient:ae,useCache:ne=!0})=>{const pe=a(r).filter(fe=>Y.includes(fe.id)&&(fe.graphPermissions===void 0||!ne));if(pe.length){for(const{id:fe,disabled:be}of pe){if(be){_({id:fe,field:"graphPermissions",value:[]});continue}a(H)[fe]||(H.value[fe]=ae.permissions.listPermissions(fe,fe,n.graphRoles,{select:[Xp.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:xe})=>{_({id:fe,field:"graphPermissions",value:xe}),delete H.value[fe]}))}await Promise.all(Object.values(a(H)))}}}}),De=we.defineStore("resources",()=>{const e=Ge(),t=He(),n=et(),r=W([]),o=W(),s=W({}),i=W([]),l=A(()=>{let ie=a(r);return a(B)||(ie=ie.filter(de=>!de.name.startsWith("."))),ie}),u=A(()=>{const ie=a(r).filter(({type:Ve})=>Ve==="file").length,de=a(r).filter(({type:Ve,name:lt})=>Ve==="file"&&lt.startsWith(".")).length,ue=a(r).filter(({type:Ve})=>Ve==="folder").length,Se=a(r).filter(({type:Ve,name:lt})=>Ve==="folder"&&lt.startsWith(".")).length,$e=a(r).filter(z.isProjectSpaceResource).length;return{files:ie,hiddenFiles:de,folders:ue,hiddenFolders:Se,spaces:$e}}),d=ie=>{r.value=ie},c=ie=>{r.value=a(r).filter(de=>!ie.find(({id:ue})=>ue===de.id))},p=()=>{r.value=[]},f=ie=>{const de=a(r).find(({id:ue})=>ue===ie.id);if(de){Object.assign(de,ie);return}a(r).push(ie)},h=ie=>{const de=a(r).filter(ue=>!ie.some(Se=>Se.path===ue.path));r.value=[...de,...ie]},g=({id:ie,field:de,value:ue})=>{const Se=a(r).find($e=>ie===$e.id);Se&&(Se[de]=ue)},m=ie=>{o.value=ie},w=()=>{o.value=void 0},T=ie=>{r.value=ie.resources,o.value=ie.currentFolder},k=()=>{r.value=[],o.value=void 0,S.value=[]},S=W([]),y=W(null),E=A(()=>a(r).filter(ie=>a(S).includes(ie.id))),D=ie=>{const de=ie.find(ue=>!a(S).includes(ue));de&&(y.value=de),S.value=ie},$=ie=>{y.value=ie,a(S).includes(ie)||a(S).push(ie)},_=ie=>{y.value=ie,a(S).includes(ie)&&(S.value=a(S).filter(de=>de!==ie))},L=ie=>{a(S).includes(ie)?_(ie):$(ie)},V=()=>{S.value=[]},te=ie=>{y.value=ie},B=W(!0),O=W(!0),M=W(!1),N=W(!0),q=W(!0),j=ie=>{B.value=ie,window.localStorage.setItem("oc_hiddenFilesShown",ie.toString())},H=ie=>{O.value=ie,window.localStorage.setItem("oc_fileExtensionsShown",ie.toString())},se=ie=>{M.value=ie,window.localStorage.setItem("oc_webDavDetailsShown",ie.toString())},Y=ie=>{N.value=ie,window.localStorage.setItem("oc_disabledSpacesShown",ie.toString())},ae=ie=>{q.value=ie,window.localStorage.setItem("oc_emptyTrashesShown",ie.toString())},ne=ie=>{s.value=ie};return{resources:r,currentFolder:o,activeResources:l,totalResourcesCount:u,setResources:d,removeResources:c,clearResources:p,upsertResource:f,upsertResources:h,updateResourceField:g,setCurrentFolder:m,clearCurrentFolder:w,initResourceList:T,clearResourceList:k,selectedIds:S,latestSelectedId:y,selectedResources:E,setSelection:D,addSelection:$,removeSelection:_,toggleSelection:L,resetSelection:V,setLastSelectedId:te,areHiddenFilesShown:B,areFileExtensionsShown:O,areWebDavDetailsShown:M,areDisabledSpacesShown:N,areEmptyTrashesShown:q,setAreHiddenFilesShown:j,setAreFileExtensionsShown:H,setAreWebDavDetailsShown:se,setAreDisabledSpacesShown:Y,setAreEmptyTrashesShown:ae,ancestorMetaData:s,setAncestorMetaData:ne,updateAncestorField:({path:ie,field:de,value:ue})=>{const Se=a(s)[ie]??null;Se&&(Se[de]=ue)},loadAncestorMetaData:({folder:ie,space:de,client:ue,signal:Se})=>{const $e={[ie.path]:{id:ie.fileId,shareTypes:ie.shareTypes,parentFolderId:ie.parentFolderId,spaceId:de.id,path:ie.path}},Ve=[],lt=[Ee.FileId,Ee.ShareTypes,Ee.FileParent],Tt=yp(ie.path),ut=t.spaces,gt=()=>ut.filter(ke=>z.isMountPointSpaceResource(ke)&&z.extractStorageId(ke.root.remoteItem.rootId)===de.id);let ve=!0;if(e.options.routing.fullShareOwnerPaths){const ke=ut.some(qe=>z.isProjectSpaceResource(qe)&&qe.id===de.id);ve=de.isOwner(n.user)||ke}for(const ke of Tt){const qe=a(s)[ke]??null;if(qe?.spaceId===de.id){$e[ke]=qe;continue}if(!ve&&!gt().find(We=>ke.startsWith(We.root.remoteItem.path)))break;Ve.push(ue.listFiles(de,{path:ke},{depth:0,davProperties:lt,signal:Se}).then(({resource:We})=>{$e[ke]={id:We.fileId,shareTypes:We.shareTypes,parentFolderId:We.parentFolderId,spaceId:de.id,path:ke}}))}return Promise.all(Ve).then(()=>{if(!Object.keys($e).includes("/")){const ke=a(s)["/"];if(ke?.spaceId===de.id)$e["/"]=ke;else{const{parentFolderId:qe}=Object.values($e)[0],We=t.spaces.find(({id:Jt})=>qe.startsWith(Jt));We&&($e["/"]={id:We.id,shareTypes:We.shareTypes,parentFolderId:We.id,spaceId:We.id,path:"/"})}}ne($e)})},getAncestorById:ie=>Object.values(a(s)).find(de=>ie===de.id),deleteQueue:i,addResourcesIntoDeleteQueue:ie=>{i.value=i.value.concat(ie.filter(de=>!a(i).includes(de)))},removeResourcesFromDeleteQueue:ie=>{i.value=i.value.filter(de=>!ie.includes(de))}}}),Bl=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=W(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return Ue(()=>a(r),(o,s)=>{o!==s&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},Tr=()=>{const e=Ge(),t=A(()=>e.options.embed?.enabled),n=A(()=>e.options.embed?.target==="location"),r=A(()=>e.options.embed?.chooseFileName),o=A(()=>e.options.embed?.chooseFileNameSuggestion),s=A(()=>e.options.embed?.target==="file"),i=A(()=>e.options.embed?.fileTypes),l=A(()=>e.options.embed?.messagesOrigin),u=A(()=>a(t)&&e.options.embed?.delegateAuthentication),d=A(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:s,messagesTargetOrigin:l,isDelegatingAuthentication:u,fileTypes:i,postMessage:(f,h)=>{const g={};a(l)&&(g.targetOrigin=a(l)),window.parent.postMessage({name:f,data:h},g)},verifyDelegatedAuthenticationOrigin:f=>a(d)?a(d)===f:!0}},Zp=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:W(!0)};const s=W(!1),i=new IntersectionObserver(l=>{const u=l.at(-1).isIntersecting;s.value=u,a(s)&&r&&r(),t!=="showHide"&&s.value&&i.unobserve(e.value)},{rootMargin:n});return Ue(e,()=>{i.observe(e.value)}),bn(()=>i.disconnect()),{isVisible:s}},os=()=>{const{width:e}=Rn.useWindowSize();return{isMobile:A(()=>e.value<640)}},FC=we.defineStore("bottomDrawers",()=>{const e=W([]),t=A(()=>a(e).length?a(e)[a(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const s={id:_r()};return e.value.push(s),s},closeDrawer:s=>{e.value=a(e).filter(i=>i.id!==s)},closeAllDrawers:()=>{e.value=[]}}});var eh=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(eh||{});const _t=we.defineStore("sideBar",()=>{const{isEnabled:e}=Tr(),t=Bl("oc_sideBarOpen",!1),{isMobile:n}=os(),r=W(!1),o=W(null),s=A({get(){return a(e)?a(r):a(t)},set(g){if(a(e)){r.value=g;return}t.value=g}}),i=async()=>{await xt();const g=document.getElementById("app-sidebar");g&&g.focus()},l=()=>{s.value=!a(s),a(s)&&i()},u=()=>{s.value=!1,o.value=null},d=()=>{s.value=!0,o.value=null,i()},c=g=>{s.value=!0,o.value=g,i()},p=g=>{o.value=g};return ze.subscribe("sidebar.toggle",l),ze.subscribe("sidebar.close",u),ze.subscribe("sidebar.open",d),ze.subscribe("sidebar.openWithPanel",c),ze.subscribe("sidebar.setActivePanel",p),{isSideBarOpen:s,sideBarActivePanel:o,focusSidebar:i,onInitialLoad:()=>{a(n)&&(s.value=!1)},toggleSideBar:l,closeSideBar:u,openSideBar:d,openSideBarPanel:c,setActiveSideBarPanel:p,onPanelActive:(g,m)=>{ze.subscribe("sidebar.setActivePanel",w=>{g===w&&setTimeout(()=>{m(w)},100)})}}}),th=we.defineStore("updates",()=>{const e=W(!0),t=W(!1),n=W();return{updates:n,isLoading:e,hasError:t,setUpdates:i=>{n.value=i},setHasError:i=>{t.value=i},setIsLoading:i=>{e.value=i}}}),ss=we.defineStore("webWorkers",()=>{const e=W([]);return{createWorker:(s,{needsTokenRenewal:i=!1}={})=>{const l=Ct.v4(),u=Rn.useWebWorker(s,{type:"module",name:l}),d={id:l,needsTokenRenewal:i,...u};return a(e).push(d),d},terminateWorker:s=>{const i=a(e).find(l=>s===l.id);i&&(i.terminate(),e.value=a(e).filter(l=>s!==l.id))},terminateAllWorkers:()=>{a(e).forEach(({terminate:s})=>{s()}),e.value=[]},updateAccessTokens:s=>{a(e).filter(({needsTokenRenewal:i})=>i).forEach(({post:i})=>{i(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${s}`}}))})}}}),Ri=(e={})=>{const t=e.router||Re(),n=e.configStore||Ge();return{replaceInvalidFileRoute:({space:o,resource:s,path:i,fileId:l})=>{if(!n.options.routing?.idBased||i===s.path&&l===s.fileId)return!1;const u=_n(o,s,{configStore:n});return t.replace(u),!0}}},jl=()=>{const e=St();return A(()=>a(e).name)},nh=(e,t)=>{const n=St();return A(()=>a(n).meta[e]||t)},Di=(e,t)=>{const n=Re();return A({get(){return at(a(n.currentRoute).params[e])||t},async set(r){a(n.currentRoute).params[e]!==r&&await n.replace({params:{...a(n.currentRoute).params,[e]:r}})}})};let rh=Promise.resolve();const Pt=(e,t)=>{const n=Re();return A({get(){return a(n.currentRoute).query[e]||t},set(r){if(a(n.currentRoute).query[e]===r)return;rh=rh.then(async()=>{try{await n.replace({path:a(n.currentRoute).path,query:{...a(n.currentRoute).query,[e]:r}})}catch{}})}})},nr=e=>{const t=Pt(e.name),n=Bl($C(e));return Ue(()=>a(t)?{value:a(t),source:"route"}:a(n)?{value:a(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:at(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},$C=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),xn=(e,...t)=>{const n=W(!1),r=Re(),o=St();return Ue(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Pi="contextRouteName",zl="contextRouteParams",Ul="contextRouteQuery",Ii=e=>{const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const s of o)r[s]=n[s];return{[Pi]:e.name,[zl]:t,[Ul]:r}},oh=e=>({routeName:at(e[Pi]),routeParams:e[zl],routeQuery:e[Ul]}),at=e=>Array.isArray(e)?e[0].toString():e?.toString();function sh({router:e,currentFileContext:t}){const n=l=>{const{fileName:u,routeName:d,routeParams:c,routeQuery:p}=a(l);return a(d)?e.push({name:a(d),params:a(c),query:{...a(p),scrollTo:a(u)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ri({router:e}),o=(l,u)=>{const d=a(l);return r({space:a(d.space),resource:u,path:a(d.item),fileId:a(d.itemId)})},s=W(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(s.value=!0,n(t)),closed:s}}const Pe=()=>er("$clientService");function Vl({clientService:e}){e=e||Pe();const t=et();return{getUrlForResource:(l,u,d)=>e.webdav.getFileUrl(l,u,{username:t.user?.onPremisesSamAccountName,...d}),revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(a(a(l).space),{path:a(a(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(a(a(l).space),{path:a(a(l).item),fileId:a(a(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(a(a(l).space),{path:a(a(l).item),...u})}}const ql=()=>er("$authService");class jr{static allFiles="all-files";static currentFolder="current-folder"}const Hl=()=>{const e=Ge(),t=Pe(),n=He(),r=De(),o=Dt(),s=A(()=>o.searchContent?.enabled),i=A(()=>r.areHiddenFilesShown),l=A(()=>n.spaces.filter(z.isProjectSpaceResource)),u=f=>a(l).find(h=>h.id===f),d=$t.useTask(function*(f,h,g=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:f})),!h)return{totalResults:null,values:[]};const{resources:m,totalResults:w}=yield*z.call(t.webdav.search(h,{searchLimit:g,davProperties:Jo.Default,signal:f}));return{totalResults:w,values:m.map(T=>{const k=u(T.parentFolderId),S=k||T;return e.options.routing.fullShareOwnerPaths&&S.remoteItemPath&&(S.path=z.urlJoin(S.remoteItemPath,S.path)),{id:S.id,data:S}}).filter(({data:T})=>!T.name.startsWith(".")||a(i))}}).restartable();return{search:async(f,h=null)=>await d.perform(f,h),buildSearchTerm:({term:f,isTitleOnlySearch:h,tags:g,lastModified:m,mediaType:w,scope:T,useScope:k})=>{const S=[],y=f,E=a(s)&&!h;if(y){let D=`name:"*${y}*"`;E&&(D=`(name:"*${y}*" OR content:"${y}")`),S.push(D)}if(k&&T&&S.push(`scope:${T}`),g){const D=g.split("+").map($=>`"${$}"`);S.push(`tag:(${D.join(" OR ")})`)}if(m&&S.push(`mtime:${m}`),w){const D=w.split("+").map($=>`"${$}"`);S.push(`mediatype:(${D.join(" OR ")})`)}return S.sort((D,$)=>Number(D.startsWith("scope:"))-Number($.startsWith("scope:"))).join(" AND ")}}};function ih({currentRoute:e,clientService:t}){const n=W(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=Ri(),{getFileInfo:s}=Vl({clientService:t}),i=ql(),l=He(),{buildSearchTerm:u,search:d}=Hl(),c=Pt("contextRouteQuery"),p=De(),{activeResources:f}=we.storeToRefs(p);return{isFolderLoading:n,loadFolderForFileContext:async g=>{n.value=!0;try{if(g=a(g),a(c)?.term){const D=u({term:a(c)?.term}),{values:$}=await d(D,200),_=$.filter(({data:L})=>z.isSearchResource(L)).map(L=>L.data);p.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(a(g.routeName))){await Nf.getTask().perform(),n.value=!1;return}p.clearResourceList();const w=a(g.space),T=await s(g,{davProperties:[Ee.FileId]});if(o({space:w,resource:T,path:a(g.item),fileId:a(g.itemId)}),l.spaces.some(D=>z.isMountPointSpaceResource(D)&&D.root.remoteItem?.id===T.id)){const D=await s(g);p.initResourceList({currentFolder:D,resources:[D]}),n.value=!1;return}const S=Ke.dirname(T.path),{resource:y,children:E}=await r.listFiles(w,{path:S});y.type==="file"?p.initResourceList({currentFolder:y,resources:[y]}):p.initResourceList({currentFolder:y,resources:E})}catch(m){if(m.statusCode===401)return i.handleAuthError(a(e));p.setCurrentFolder(null),console.error(m)}n.value=!1},activeFiles:f}}function Wl({appsStore:e,applicationId:t}){return{applicationMeta:A(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const rr=()=>ze;function ah({titleSegments:e,eventBus:t}){const n=Bn(),{currentTheme:r}=we.storeToRefs(n);t=t||rr(),Ue(e,o=>{const s=a(o),i=" - ",l={shortDocumentTitle:s.join(i),fullDocumentTitle:[...s,a(r).name].join(i)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function OC({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const s=Wl({applicationId:t,appsStore:e}),{$gettext:i}=me.useGettext(),l=A(()=>{const u=Ke.basename(a(a(r)?.fileName))||i(a(o)?.meta?.title||""),d=a(a(s).applicationMeta);return[u,a(n)||d.name||d.id].filter(Boolean)});ah({titleSegments:l})}function lh(e={}){const t=e.clientService??Pe(),n=e.authStore??Lr();return{makeRequest:(o,s,i={})=>{const l=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,u=new Sl({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return i.method=o,i.url=s,i.headers={...u.getHeaders(),...i?.headers||{}},l.request(i)}}}const ch=()=>{const e=He();return{areSpacesLoading:A(()=>!e.spacesInitialized||e.spacesLoading)}},uh=(e={})=>{const t=He(),{areSpacesLoading:n}=ch(),r=Pt("shareId"),o=Pt("fileId"),s=A(()=>at(a(o))),i=Ge(),l=Pe(),u=A(()=>t.spaces),d=W(null),c=W(null),p=W(!1),f=h=>{const g=h.split("/");return a(u).find(m=>{if(!h.startsWith(m.driveAlias))return!1;const w=m.driveAlias.split("/");return g.length<w.length||g.slice(0,w.length).join("/")!==m.driveAlias?!1:m})};return Qs(()=>{const h=a(e.driveAliasAndItem);!h?.startsWith("personal/")&&!h?.startsWith("project/")&&t.setCurrentSpace(null)}),Ue([e.driveAliasAndItem,n],async([h,g],[m,w])=>{if(h===m&&g===w)return;if(!h||h.startsWith("virtual/")){d.value=null,c.value=null;return}if(a(d)&&h.startsWith(a(d).driveAlias)){c.value=z.urlJoin(h.slice(a(d).driveAlias.length),{leadingSlash:!0});return}let k=null,S=null;if(h.startsWith("public/")||h.startsWith("ocm/")){const[y,...E]=h.split("/").slice(1);k=a(u).find(D=>D.id===y),S=E.join("/")}else if(h.startsWith("share/")||h.startsWith("ocm-share/")){const[y,...E]=h.split("/").slice(1),D=h.startsWith("ocm-share/")?"ocm-share":"share";let $=at(a(r));$?.includes(":")&&($=[z.SHARE_JAIL_ID,$].join("!")),k=t.getSpace($)||t.createShareSpace({driveAliasPrefix:D,id:$,shareName:a(y)}),S=E.join("/")}else a(s)?k=a(u).find(y=>a(s).startsWith(`${y.fileId}`)):k=f(h),k||(!t.mountPointsInitialized&&i.options.routing.fullShareOwnerPaths&&(p.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),k=f(h)),k&&(S=h.slice(k.driveAlias.length));d.value=k,c.value=z.urlJoin(S,{leadingSlash:!0}),p.value=!1},{immediate:!0,deep:!0}),Ue(d,h=>{t.setCurrentSpace(h)},{immediate:!0}),{space:d,item:c,itemId:s,loading:p}};function dh(e){const t=Re(),n=Mn(),r=St(),o=e.clientService??Pe(),s=e.applicationId,i=Lr(),{publicLinkContextReady:l}=we.storeToRefs(i),u=Di("driveAliasAndItem"),{space:d,item:c,itemId:p,loading:f}=uh({driveAliasAndItem:u}),h=A(()=>{if(a(f))return null;let g;return a(d)?g=z.urlJoin(a(d).webDavPath,a(c)):g=z.urlJoin(at(a(r).params.filePath)),{path:g,driveAliasAndItem:a(u),space:a(d),item:a(c),itemId:a(p),fileName:Ke.basename(g),routeName:at(a(r).query[Pi]),...oh(a(r).query)}});return OC({appsStore:n,applicationId:s,applicationName:e.applicationName,currentFileContext:h,currentRoute:r}),{isPublicLinkContext:l,currentFileContext:h,...Zd({appsStore:n,...e}),...sh({router:t,currentFileContext:h}),...Vl({clientService:o}),...ih({clientService:o,currentRoute:r}),...lh({clientService:o,currentRoute:a(r)})}}const LC=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}}),_C=()=>[{path:"/list",redirect:e=>kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:z.urlJoin("personal/home",at(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>lo("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>an("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>an("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>an("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>wr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>co("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(LC),MC=(e,...t)=>{const[n,...r]=t.map(o=>{const s={"files-personal":kn("files-spaces-generic").name,"files-favorites":lo("files-common-favorites").name,"files-shared-with-others":an("files-shares-with-others").name,"files-shared-with-me":an("files-shares-with-me").name,"files-trashbin ":wr("files-trash-generic").name,"files-public-list":co("files-public-link").name}[o.name.toString()];return s&&console.warn(`route name "${name}" is deprecated, use "${s.toString()}" instead.`),{...o,...!!s&&{name:s}}});return al(e,n,...r)},NC={name:"root",path:"/",redirect:e=>kn("files-spaces-generic",e)},BC=e=>[NC,...cS(e),...fS(e),...pS(e),...uS(e),...hS(e),..._C()],Fi=()=>{const e=Pe();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:o})=>o===".space")}}},It=e=>{const t=et(),n=He(),r=Ge(),o=A(()=>n.spaces),s=Di("driveAliasAndItem"),i=p=>a(e?.space)||a(o).find(f=>f.id===p),l=p=>{let f=p.storageId;(a(s)?.startsWith("public/")||a(s)?.startsWith("ocm/"))&&(f=a(s).split("/")[1]);const h=i(f);if(h&&!z.isMountPointSpaceResource(h))return h;const g=z.isShareResource(p)&&p.shareTypes.includes(z.ShareTypes.remote.value)||p?.id?.toString().startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return p.remoteItemPath?m=Ke.basename(p.remoteItemPath):a(s)?.startsWith("share/")||a(s)?.startsWith("ocm-share/")?m=a(s).split("/")[1]:m=p.name,n.getSpace(p.remoteItemId)||n.createShareSpace({driveAliasPrefix:g,id:p.remoteItemId,shareName:m})},u=p=>a(o).filter(f=>z.isMountPointSpaceResource(f)&&z.extractStorageId(f.root.remoteItem.rootId)===p.id);return{getInternalSpace:i,getMatchingSpace:l,isPersonalSpaceRoot:p=>p?.storageId&&p?.storageId===n.personalSpace?.storageId&&p?.path==="/"&&!z.isIncomingShareResource(p),isResourceAccessible:({space:p,path:f})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const h=a(o).some(m=>z.isProjectSpaceResource(m)&&m.id===p.id);return p.isOwner(t.user)||h||u(p).some(m=>f.startsWith(m.root.remoteItem.path))}}},go=()=>{const e=Pe(),t=De();return{createSpace:o=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:o},{params:{template:"default"}})},createDefaultMetaFolder:async o=>{const s=await e.webdav.createFolder(o,{path:".space"});return z.extractStorageId(s.parentFolderId)===t.currentFolder?.id&&t.upsertResource(s),s}}},Ut=()=>er("$loadingService"),$i=()=>{const e=Lr(),t=Pe(),n=me.useGettext();return{headers:A(()=>{const o=new Sl({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Ct.v4(),...o.getHeaders()}})}};function jC(e){return new Worker("/assets/worker-BSCY2vwA.js",{name:e?.name})}const fh=({concurrentRequests:e=4}={})=>{const t=Ge(),n=Ut(),{headers:r}=$i(),{createWorker:o,terminateWorker:s}=ss(),i=({topic:u,space:d,resources:c},p)=>{const f=o(jC,{needsTokenRenewal:!0});let h;a(f.worker).onmessage=g=>{s(f.id),h?.(!0);const{successful:m,failed:w}=JSON.parse(g.data),T=w.map(({resource:k,...S})=>({resource:k,error:z.createHttpError(S)}));p({successful:m,failed:T})},n.addTask(()=>new Promise(g=>{h=g})),f.post(l({topic:u,space:d,resources:c}))},l=({topic:u,space:d,resources:c})=>JSON.stringify({topic:u,data:{space:d,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...a(r),"X-Request-ID":void 0}}});return{startWorker:i}};function zC(e){return new Worker("/assets/worker-DH8D29Kr.js",{name:e?.name})}const ph=()=>{const e=Ge(),t=Ut(),{headers:n}=$i(),{createWorker:r,terminateWorker:o}=ss(),s=(l,u)=>{const d=r(zC,{needsTokenRenewal:!0});let c;a(d.worker).onmessage=p=>{o(d.id),c?.(!0);const{successful:f,failed:h}=JSON.parse(p.data),g=h.map(({resourceName:m,...w})=>({resourceName:m,error:z.createHttpError(w)}));u({successful:f,failed:g})},t.addTask(()=>new Promise(p=>{c=p})),d.post(i(l))},i=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:s}};function UC(e){return new Worker("/assets/worker-22sDKzz_.js",{name:e?.name})}const hh=()=>{const e=Ge(),t=Ut(),{headers:n}=$i(),{createWorker:r,terminateWorker:o}=ss(),s=({space:l,resources:u,missingFolderPaths:d},c)=>{const p=r(UC,{needsTokenRenewal:!0});let f;a(p.worker).onmessage=h=>{o(p.id),f?.(!0);const{successful:g,failed:m}=JSON.parse(h.data),w=m.map(({resource:T,...k})=>({resource:T,error:z.createHttpError(k)}));c({successful:g,failed:w})},t.addTask(()=>new Promise(h=>{f=h})),p.post(i({space:l,resources:u,missingFolderPaths:d}))},i=({space:l,resources:u,missingFolderPaths:d})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:u,missingFolderPaths:d,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:s}};function VC(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const qC=({authService:e})=>{const{createWorker:t}=ss(),n=W();return{startWorker:()=>{n.value=t(VC),a(a(n).worker).onmessage=()=>{e.signinSilent().catch(async i=>{if(i instanceof Mg.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),a(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",i),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:i,expiryThreshold:l})=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"set",expiry:i,expiryThreshold:l}))},resetTokenTimer:()=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"reset"}))}}};function HC(e){return e==null}const An=()=>{const e=Mn(),t=Re(),n=oa(),{isEnabled:r}=Tr(),{requestExtensions:o}=ho(),s=lr(),{openUrl:i}=eg(),l=Ge(),{options:u}=we.storeToRefs(l),{actions:d}=ea(),{actions:c}=ra(),{actions:p}=Oi(),{actions:f}=Ts(),{actions:h}=Yi(),{actions:g}=Zi(),{actions:m}=xo(),{actions:w}=Um(),{actions:T}=Tc(),{actions:k}=ta(),{actions:S}=Dm(),{actions:y}=na(),{actions:E}=ks(),{actions:D}=wc(),$=A(()=>[...a(g),...a(m),...a(f),...a(k),...a(p),...a(y),...a(D),...a(E),...a(d),...a(c),...a(h),...a(T)]),_=A(()=>(o({id:"global.files.context-actions",extensionType:"action"})||[]).map(q=>q.action).filter(q=>HC(q.category)||q.category==="context"||q.category==="actions")),L=A(()=>a(r)?[]:e.fileExtensions.map(q=>{const j=e.apps[q.app];return{name:`editor-${q.app}`,label:()=>q.label?typeof q.label=="function"?q.label():q.label:j.name,icon:q.icon||j.icon,...j.iconFillType&&{iconFillType:j.iconFillType},img:j.img,route:({space:H,resources:se})=>V({appFileExtension:q,space:H,resource:se[0]}),handler:H=>B(q,H.space,H.resources[0]),isVisible:({resources:H})=>!a(s)||H.length!==1||!H[0].canDownload()&&!q.secureView||!a(n)&&qt(t,"files-trash-generic")?!1:H[0].extension&&q.extension?H[0].extension.toLowerCase()===q.extension.toLowerCase():H[0].mimeType&&q.mimeType?H[0].mimeType.toLowerCase()===q.mimeType.toLowerCase()||H[0].mimeType.split("/")[0].toLowerCase()===q.mimeType.toLowerCase():!1,hasPriority:q.hasPriority,class:`oc-files-actions-${Qp(j.name).toLowerCase()}-trigger`}}).sort((q,j)=>j.hasPriority!==q.hasPriority&&j.hasPriority?1:0)),V=({appFileExtension:q,space:j,resource:H})=>{const se=z.isShareSpaceResource(j)?j.id:void 0,Y=q.routeName||q.app,ae=te(Y,j,H,se);return t.resolve(ae)},te=(q,j,H,se,Y)=>({name:q,params:{driveAliasAndItem:j?.getDriveAliasAndItem(H)},query:{...se&&{shareId:se},...H.fileId&&a(u).routing.idBased&&{fileId:H.fileId},...Y&&{templateId:Y},...Ii(a(t.currentRoute))}}),B=(q,j,H)=>{const se=z.isShareSpaceResource(j)?j.id:void 0,Y=q.routeName||q.app,ae=te(Y,j,H,se);if(a(u).cernFeatures){const ne=t.resolve(ae).href,pe=`${q.routeName}-${H.path}`;i(ne,pe,!0);return}t.push(ae)},O=q=>{const j=M(q);j&&j.handler({...q})},M=q=>{const j=N(q);if(j.length)return j[0].name===a(m)[0].name?a(w)[0]:j[0]},N=q=>{const j=Y=>Y.isVisible(q),H=[...a(_),...a(L),...a(S)].filter(j).sort((Y,ae)=>Number(ae.hasPriority)-Number(Y.hasPriority)),se=q.omitSystemActions?[]:a($).filter(j);return[...H,...se]};return{getDefaultAction:M,getAllOpenWithActions:N,getEditorRouteOpts:te,openEditor:B,triggerDefaultAction:O}},Oi=()=>{const e=Ge(),t=Re(),{copyResources:n}=ns(),r=me.useGettext(),{$gettext:o}=r,s=De(),{currentFolder:i}=we.storeToRefs(s),l=A(()=>ts()?o("⌘ + C"):o("Ctrl + C")),u=({resources:c})=>{bt(t,"files-common-search")&&(c=c.filter(p=>!z.isProjectSpaceResource(p))),n(c)};return{actions:A(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:a(l),label:()=>o("Copy"),isVisible:({resources:c})=>{if(!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")||st(t,"files-spaces-projects")||c.length===0)return!1;if(ln(t,"files-public-link"))return a(i)?.canCreate();if(bt(t,"files-common-search")&&c.every(p=>z.isProjectSpaceResource(p)))return!1;if(a(e.options.runningOnEos)){const p=c[0].path?.split("/").filter(Boolean)||[];if(st(t,"files-spaces-generic")&&p.length<5)return!1}return!!a(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var jn=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(jn||{}),Li=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Li||{});const WC=()=>{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?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},_i=e=>{const t=W([]),n=W(0),r=l=>{if(!e?.skipDisabledKeyBindingsCheck&&WC())return;const{key:u,ctrlKey:d,metaKey:c,shiftKey:p}=l;let f=null;const h=[];c||d?(f="Control",h.push("altKey","shiftKey")):p&&(f="Shift",h.push("altKey","ctrlKey","metaKey")),!((m,w)=>w.some(T=>m[T]))(l,h)&&a(t).filter(m=>m.primary===u&&m.modifier===f).forEach(m=>{m.preventDefault&&l.preventDefault(),m.callback(l)})},o=(l,u,{preventDefault:d=!0}={})=>{const c=Ct.v4();return t.value.push({id:c,...l,modifier:l.modifier??null,preventDefault:d,callback:u}),c},s=l=>{t.value=t.value.filter(u=>u.id!==l)},i=()=>{n.value=0};return Rn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:s,selectionCursor:n,resetSelectionCursor:i}};function zr(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,o=t.ctrlKey||t.metaKey;return!r&&!o?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&ze.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),o&&ze.publish("app.files.list.clicked.meta",n),!0)}}}const Ql=()=>{const e=_i(),t=10,n=.1;return{setCropperInstance:o=>{e.bindKeyAction({primary:jn.ArrowRight},()=>a(o)?.move(-t,0)),e.bindKeyAction({primary:jn.ArrowLeft},()=>a(o)?.move(t,0)),e.bindKeyAction({primary:jn.ArrowDown},()=>a(o)?.move(0,-t)),e.bindKeyAction({primary:jn.ArrowUp},()=>a(o)?.move(0,t)),e.bindKeyAction({primary:jn.Plus},()=>a(o)?.zoom(n)),e.bindKeyAction({primary:jn.Minus},()=>a(o)?.zoom(-n))}}},Kl=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{$gettext:n}=me.useGettext(),{copy:r}=Rn.useClipboard(),{interceptModifierClick:o}=zr(),s=async l=>{try{await r(l),e({title:n("The link has been copied to your clipboard.")})}catch(u){t({title:n("Copy link failed"),errors:[u]})}};return{actions:A(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:l=>{const{resources:u,event:d}=l,c=u[0];if(!(d&&o(d,c)))return s(c.privateLink)},isVisible:({space:l,resources:u})=>!(u.length!==1||z.isPublicSpaceResource(l)||z.isTrashResource(u[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},is={};function QC(e){return e.getIsPending!==void 0}function KC(e){if(QC(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 GC(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 JC(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function XC(e,t){const{class:n,style:r,...o}=GC(e),{class:s,style:i,...l}=JC(t);return{class:[n,s],style:[r,i],...o,...l}}const mh=ge({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,s=Js(),i=W(),l=W(),u=W(),d=Math.random().toString(36).substring(2);t({svgElSource:i,request:u}),Ue(()=>r.src,w=>{p(w)}),p(r.src);function c(w){if(w=w.cloneNode(!0),r.uniqueIds){const T=typeof r.uniqueIds=="string"?r.uniqueIds:d;w=m(w,T,r.uniqueIdsBase)}return w=r.transformSource(w),r.title&&g(w,r.title),w.innerHTML}function p(w){is[w]||(is[w]=f(w)),i.value&&is[w].getIsPending()&&!r.keepDuringLoading&&(i.value=null,o("unloaded")),is[w].then(T=>{i.value=T,xt(()=>{o("loaded",l.value)})}).catch(T=>{i.value&&(i.value=void 0,o("unloaded")),delete is[w],o("error",T)})}function f(w){return KC(new Promise((T,k)=>{const S=new XMLHttpRequest;S.open("GET",w,!0),u.value=S,S.onload=()=>{if(S.status>=200&&S.status<400)try{let y=new DOMParser().parseFromString(S.responseText,"text/xml").getElementsByTagName("svg")[0];y?T(y):k(new Error('Loaded file is not valid SVG"'))}catch(y){k(y)}else k(new Error("Error loading SVG"))},S.onerror=k,S.send()}))}const h=()=>i.value?za("svg",{...XC(i.value,s),innerHTML:c(i.value),ref:l}):null;function g(w,T){const k=w.getElementsByTagName("title");if(k.length)k[0].textContent=T;else{const S=document.createElementNS("http://www.w3.org/2000/svg","title");S.textContent=T,w.insertBefore(S,w.firstChild)}}function m(w,T,k=""){const S=["id","href","xlink:href","xlink:role","xlink:arcrole"],y=["href","xlink:href"],E=(D,$)=>y.includes(D)&&($?!$.includes("#"):!1);return[...w.children].forEach(D=>{var $;if(($=D.attributes)!=null&&$.length){const _=Object.values(D.attributes).map(L=>{const V=/url\((.*?)\)/.exec(L.value);return V!=null&&V[1]&&(L.value=L.value.replace(V[0],`url(${k}${V[1]}_${T})`)),L});S.forEach(L=>{const V=_.find(te=>te.name===L);V&&!E(L,V.value)&&(V.value=`${V.value}_${T}`)})}return D.children.length?m(D,T,k):D}),w}return(w,T)=>(I(),re(h))}}),or=ge({__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}){mh.name="inline-svg";const n=t,r=A(()=>_r("oc-icon-title-")),o=A(()=>{const l=`${_S()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${l}${e.name}.svg`:`${l}${e.name}-${u}.svg`}),s=A(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5.5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),i=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)=>(I(),re(rn(e.type),{class:R.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",s.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:Z(()=>[J(a(mh),{src:o.value,"transform-source":i,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:R.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:R.normalizeClass(s.value),onLoaded:u[0]||(u[0]=d=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var gh=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Mi=gh.join(","),vh=typeof Element>"u",Ur=vh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ni=!vh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Bi=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Bi(t.parentNode));return i},YC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yh=function(t,n,r){if(Bi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mi));return n&&Ur.call(t,Mi)&&o.unshift(t),o=o.filter(r),o},ji=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Bi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),u=l.length?l:i.children,d=ji(u,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else{var c=Ur.call(i,Mi);c&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Bi(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&f){var h=ji(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},bh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Vr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||YC(t))&&!bh(t)?0:t.tabIndex},ZC=function(t,n){var r=Vr(t);return r<0&&n&&!bh(t)?0:r},ex=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},wh=function(t){return t.tagName==="INPUT"},tx=function(t){return wh(t)&&t.type==="hidden"},nx=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},rx=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ox=function(t){if(!t.name)return!0;var n=t.form||Ni(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=rx(o,t.form);return!s||s===t},sx=function(t){return wh(t)&&t.type==="radio"},ix=function(t){return sx(t)&&!ox(t)},ax=function(t){var n,r=t&&Ni(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,l,u;for(s=!!((i=o)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&o;){var d,c,p;r=Ni(o),o=(d=r)===null||d===void 0?void 0:d.host,s=!!((c=o)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},Sh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},lx=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ur.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Ur.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var d=t.parentElement,c=Ni(t);if(d&&!d.shadowRoot&&o(d)===!0)return Sh(t);t.assignedSlot?t=t.assignedSlot:!d&&c!==t.ownerDocument?t=c.host:t=d}t=u}if(ax(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Sh(t);return!1},cx=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ur.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},zi=function(t,n){return!(n.disabled||tx(n)||lx(n,t)||nx(n)||cx(n))},Gl=function(t,n){return!(ix(n)||Vr(n)<0||!zi(t,n))},ux=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Th=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,l=i?o.scopeParent:o,u=ZC(l,i),d=i?Th(o.candidates):l;u===0?i?n.push.apply(n,d):n.push(l):r.push({documentOrder:s,tabIndex:u,item:o,isScope:i,content:d})}),r.sort(ex).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},dx=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ji([t],n.includeContainer,{filter:Gl.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ux}):r=yh(t,n.includeContainer,Gl.bind(null,n)),Th(r)},fx=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ji([t],n.includeContainer,{filter:zi.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=yh(t,n.includeContainer,zi.bind(null,n)),r},vo=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,Mi)===!1?!1:Gl(n,t)},px=gh.concat("iframe:not([inert]):not([inert] *)").join(","),Jl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,px)===!1?!1:zi(n,t)};function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hx(e){if(Array.isArray(e))return Xl(e)}function kh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ah(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return i=u.done,u},e:function(u){l=!0,s=u},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw s}}}}function mx(e,t,n){return(t=wx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gx(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ch(Object(n),!0).forEach(function(r){mx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ch(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e){return hx(e)||gx(e)||Ah(e)||vx()}function bx(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wx(e){var t=bx(e,"string");return typeof t=="symbol"?t:t+""}function Ah(e,t){if(e){if(typeof e=="string")return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}var sr={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=sr.getActiveTrap(t);n!==r&&sr.pauseTrap(t);var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),sr.unpauseTrap(t)},pauseTrap:function(t){var n=sr.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=sr.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},Sx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Tx=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},as=function(t){return t?.key==="Tab"||t?.keyCode===9},kx=function(t){return as(t)&&!t.shiftKey},Cx=function(t){return as(t)&&t.shiftKey},Eh=function(t){return setTimeout(t,0)},ls=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},Ui=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},xx=[],Ax=function(t,n){var r=n?.document||document,o=n?.trapStack||xx,s=xh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:kx,isKeyBackward:Cx},n),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,u=function(M,N,q){return M&&M[N]!==void 0?M[N]:s[q||N]},d=function(M,N){var q=typeof N?.composedPath=="function"?N.composedPath():void 0;return i.containerGroups.findIndex(function(j){var H=j.container,se=j.tabbableNodes;return H.contains(M)||q?.includes(H)||se.find(function(Y){return Y===M})})},c=function(M){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=N.hasFallback,j=q===void 0?!1:q,H=N.params,se=H===void 0?[]:H,Y=s[M];if(typeof Y=="function"&&(Y=Y.apply(void 0,yx(se))),Y===!0&&(Y=void 0),!Y){if(Y===void 0||Y===!1)return Y;throw new Error("`".concat(M,"` was specified but was not a node, or did not return a node"))}var ae=Y;if(typeof Y=="string"){try{ae=r.querySelector(Y)}catch(ne){throw new Error("`".concat(M,'` appears to be an invalid selector; error="').concat(ne.message,'"'))}if(!ae&&!j)throw new Error("`".concat(M,"` as selector refers to no known node"))}return ae},p=function(){var M=c("initialFocus",{hasFallback:!0});if(M===!1)return!1;if(M===void 0||M&&!Jl(M,s.tabbableOptions))if(d(r.activeElement)>=0)M=r.activeElement;else{var N=i.tabbableGroups[0],q=N&&N.firstTabbableNode;M=q||c("fallbackFocus")}else M===null&&(M=c("fallbackFocus"));if(!M)throw new Error("Your focus-trap needs to have at least one focusable element");return M},f=function(){if(i.containerGroups=i.containers.map(function(M){var N=dx(M,s.tabbableOptions),q=fx(M,s.tabbableOptions),j=N.length>0?N[0]:void 0,H=N.length>0?N[N.length-1]:void 0,se=q.find(function(ne){return vo(ne)}),Y=q.slice().reverse().find(function(ne){return vo(ne)}),ae=!!N.find(function(ne){return Vr(ne)>0});return{container:M,tabbableNodes:N,focusableNodes:q,posTabIndexesFound:ae,firstTabbableNode:j,lastTabbableNode:H,firstDomTabbableNode:se,lastDomTabbableNode:Y,nextTabbableNode:function(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,be=N.indexOf(pe);return be<0?fe?q.slice(q.indexOf(pe)+1).find(function(xe){return vo(xe)}):q.slice(0,q.indexOf(pe)).reverse().find(function(xe){return vo(xe)}):N[be+(fe?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(M){return M.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(M){return M.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(M){var N=M.activeElement;if(N)return N.shadowRoot&&N.shadowRoot.activeElement!==null?h(N.shadowRoot):N},g=function(M){if(M!==!1&&M!==h(document)){if(!M||!M.focus){g(p());return}M.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=M,Sx(M)&&M.select()}},m=function(M){var N=c("setReturnFocus",{params:[M]});return N||(N===!1?!1:M)},w=function(M){var N=M.target,q=M.event,j=M.isBackward,H=j===void 0?!1:j;N=N||Ui(q),f();var se=null;if(i.tabbableGroups.length>0){var Y=d(N,q),ae=Y>=0?i.containerGroups[Y]:void 0;if(Y<0)H?se=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:se=i.tabbableGroups[0].firstTabbableNode;else if(H){var ne=i.tabbableGroups.findIndex(function(ie){var de=ie.firstTabbableNode;return N===de});if(ne<0&&(ae.container===N||Jl(N,s.tabbableOptions)&&!vo(N,s.tabbableOptions)&&!ae.nextTabbableNode(N,!1))&&(ne=Y),ne>=0){var pe=ne===0?i.tabbableGroups.length-1:ne-1,fe=i.tabbableGroups[pe];se=Vr(N)>=0?fe.lastTabbableNode:fe.lastDomTabbableNode}else as(q)||(se=ae.nextTabbableNode(N,!1))}else{var be=i.tabbableGroups.findIndex(function(ie){var de=ie.lastTabbableNode;return N===de});if(be<0&&(ae.container===N||Jl(N,s.tabbableOptions)&&!vo(N,s.tabbableOptions)&&!ae.nextTabbableNode(N))&&(be=Y),be>=0){var xe=be===i.tabbableGroups.length-1?0:be+1,he=i.tabbableGroups[xe];se=Vr(N)>=0?he.firstTabbableNode:he.firstDomTabbableNode}else as(q)||(se=ae.nextTabbableNode(N))}}else se=c("fallbackFocus");return se},T=function(M){var N=Ui(M);if(!(d(N,M)>=0)){if(ls(s.clickOutsideDeactivates,M)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}ls(s.allowOutsideClick,M)||M.preventDefault()}},k=function(M){var N=Ui(M),q=d(N,M)>=0;if(q||N instanceof Document)q&&(i.mostRecentlyFocusedNode=N);else{M.stopImmediatePropagation();var j,H=!0;if(i.mostRecentlyFocusedNode)if(Vr(i.mostRecentlyFocusedNode)>0){var se=d(i.mostRecentlyFocusedNode),Y=i.containerGroups[se].tabbableNodes;if(Y.length>0){var ae=Y.findIndex(function(ne){return ne===i.mostRecentlyFocusedNode});ae>=0&&(s.isKeyForward(i.recentNavEvent)?ae+1<Y.length&&(j=Y[ae+1],H=!1):ae-1>=0&&(j=Y[ae-1],H=!1))}}else i.containerGroups.some(function(ne){return ne.tabbableNodes.some(function(pe){return Vr(pe)>0})})||(H=!1);else H=!1;H&&(j=w({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),g(j||i.mostRecentlyFocusedNode||p())}i.recentNavEvent=void 0},S=function(M){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=M;var q=w({event:M,isBackward:N});q&&(as(M)&&M.preventDefault(),g(q))},y=function(M){(s.isKeyForward(M)||s.isKeyBackward(M))&&S(M,s.isKeyBackward(M))},E=function(M){Tx(M)&&ls(s.escapeDeactivates,M)!==!1&&(M.preventDefault(),l.deactivate())},D=function(M){var N=Ui(M);d(N,M)>=0||ls(s.clickOutsideDeactivates,M)||ls(s.allowOutsideClick,M)||(M.preventDefault(),M.stopImmediatePropagation())},$=function(){if(i.active)return sr.activateTrap(o,l),i.delayInitialFocusTimer=s.delayInitialFocus?Eh(function(){g(p())}):g(p()),r.addEventListener("focusin",k,!0),r.addEventListener("mousedown",T,{capture:!0,passive:!1}),r.addEventListener("touchstart",T,{capture:!0,passive:!1}),r.addEventListener("click",D,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),r.addEventListener("keydown",E),l},_=function(M){i.active&&!i.paused&&l._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var N=new Set,q=new Set,j=kh(M),H;try{for(j.s();!(H=j.n()).done;){var se=H.value;N.add(se);for(var Y=typeof ShadowRoot<"u"&&se.getRootNode()instanceof ShadowRoot,ae=se;ae;){N.add(ae);var ne=ae.parentElement,pe=[];ne?pe=ne.children:!ne&&Y&&(pe=ae.getRootNode().children,ne=ae.getRootNode().host,Y=typeof ShadowRoot<"u"&&ne.getRootNode()instanceof ShadowRoot);var fe=kh(pe),be;try{for(fe.s();!(be=fe.n()).done;){var xe=be.value;q.add(xe)}}catch(he){fe.e(he)}finally{fe.f()}ae=ne}}}catch(he){j.e(he)}finally{j.f()}N.forEach(function(he){q.delete(he)}),i.adjacentElements=q},L=function(){if(i.active)return r.removeEventListener("focusin",k,!0),r.removeEventListener("mousedown",T,!0),r.removeEventListener("touchstart",T,!0),r.removeEventListener("click",D,!0),r.removeEventListener("keydown",y,!0),r.removeEventListener("keydown",E),l},V=function(M){var N=M.some(function(q){var j=Array.from(q.removedNodes);return j.some(function(H){return H===i.mostRecentlyFocusedNode})});N&&g(p())},te=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,B=function(){te&&(te.disconnect(),i.active&&!i.paused&&i.containers.map(function(M){te.observe(M,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(M){if(i.active)return this;var N=u(M,"onActivate"),q=u(M,"onPostActivate"),j=u(M,"checkCanFocusTrap"),H=sr.getActiveTrap(o),se=!1;if(H&&!H.paused){var Y;(Y=H._setSubtreeIsolation)===null||Y===void 0||Y.call(H,!1),se=!0}try{j||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=h(r),N?.();var ae=function(){j&&f(),$(),B(),s.isolateSubtrees&&l._setSubtreeIsolation(!0),q?.()};if(j)return j(i.containers.concat()).then(ae,ae),this;ae()}catch(pe){if(H===sr.getActiveTrap(o)&&se){var ne;(ne=H._setSubtreeIsolation)===null||ne===void 0||ne.call(H,!0)}throw pe}return this},deactivate:function(M){if(!i.active)return this;var N=xh({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},M);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||l._setSubtreeIsolation(!1),i.alreadySilent.clear(),L(),i.active=!1,i.paused=!1,B(),sr.deactivateTrap(o,l);var q=u(N,"onDeactivate"),j=u(N,"onPostDeactivate"),H=u(N,"checkCanReturnFocus"),se=u(N,"returnFocus","returnFocusOnDeactivate");q?.();var Y=function(){Eh(function(){se&&g(m(i.nodeFocusedBeforeActivation)),j?.()})};return se&&H?(H(m(i.nodeFocusedBeforeActivation)).then(Y,Y),this):(Y(),this)},pause:function(M){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,M)):this},unpause:function(M){return i.active?(i.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,M)):this},updateContainerElements:function(M){var N=[].concat(M).filter(Boolean);return i.containers=N.map(function(q){return typeof q=="string"?r.querySelector(q):q}),s.isolateSubtrees&&_(i.containers),i.active&&(f(),s.isolateSubtrees&&!i.paused&&l._setSubtreeIsolation(!0)),B(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(M,N){if(i.paused===M)return this;if(i.paused=M,M){var q=u(N,"onPause"),j=u(N,"onPostPause");q?.(),L(),B(),l._setSubtreeIsolation(!1),j?.()}else{var H=u(N,"onUnpause"),se=u(N,"onPostUnpause");H?.(),l._setSubtreeIsolation(!0),f(),$(),B(),se?.()}return this}},_setSubtreeIsolation:{value:function(M){s.isolateSubtrees&&i.adjacentElements.forEach(function(N){var q;M?s.isolateSubtrees==="aria-hidden"?((N.ariaHidden==="true"||((q=N.getAttribute("aria-hidden"))===null||q===void 0?void 0:q.toLowerCase())==="true")&&i.alreadySilent.add(N),N.setAttribute("aria-hidden","true")):((N.inert||N.hasAttribute("inert"))&&i.alreadySilent.add(N),N.setAttribute("inert",!0)):i.alreadySilent.has(N)||(s.isolateSubtrees==="aria-hidden"?N.removeAttribute("aria-hidden"):N.removeAttribute("inert"))})}}}),l.updateContainerElements(t),l};function FO(e){return e}const Ex={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},Rx=ge({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},Ex),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const o=W(null),s=A(()=>{const l=o.value;return l&&(l instanceof HTMLElement?l:l.$el)});function i(){return r||(r=Ax(s.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return yt(()=>{Ue(()=>e.active,l=>{l&&s.value?i().activate():r&&(r.deactivate(),(!s.value||s.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),Qs(()=>{r&&r.deactivate(),r=null}),{activate(){i().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const l=t.default().filter(d=>d.type!==to);return!l||!l.length||l.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),l):no(l[0],{ref:o})}}}}),Dx=["open"],Px=["id"],Ix=Le(ge({__name:"OcBottomDrawer",props:{id:{},isDrawerActive:{type:Boolean,default:!0},isFocusTrapActive:{type:Boolean,default:!0},hasFullHeight:{type:Boolean,default:!1},maxHeight:{default:"max-h-[66vh]"}},emits:["clicked"],setup(e){return Ue(()=>e.isDrawerActive,async()=>{e.isDrawerActive&&(await xt(),document.getElementById(e.id)?.classList.add("active"))},{immediate:!0}),(t,n)=>(I(),G("dialog",{class:"oc-bottom-drawer fixed inset-0 bg-black/40 size-full",open:e.isDrawerActive,onClick:n[0]||(n[0]=r=>t.$emit("clicked",r))},[J(a(Rx),{active:e.isFocusTrapActive},{default:Z(()=>[Q("div",{id:e.id,tabindex:"-1",class:R.normalizeClass(["fixed inset-x-0 rounded-t-xl w-full overflow-y-auto transition-all duration-200 -bottom-full overflow-x-hidden",[{"[&.active]:bottom-0":e.isDrawerActive,"h-full":e.hasFullHeight},e.maxHeight]])},[Ce(t.$slots,"default",{},void 0,!0)],10,Px)]),_:3},8,["active"])],8,Dx))}}),[["__scopeId","data-v-42899e08"]]),Qt=ge({__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=A(()=>({...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}})),o=A(()=>({...e.type==="button"&&{click:s}})),s=i=>{n("click",i)};return(i,l)=>{const u=oe("oc-spinner");return I(),re(rn(e.type),pt(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${a(rt.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${a(rt.kebabCase)(e.colorRole)}-${e.appearance}`,{...a(MS)(e.gapSize),...a(NS)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Gs(o.value)),{default:Z(()=>[e.showSpinner?(I(),re(u,{key:0,size:"small",class:"spinner"})):le("",!0),Ce(i.$slots,"default")]),_:3},16,["aria-label","class"])}}});var Kt="top",fn="bottom",pn="right",Gt="left",Yl="auto",cs=[Kt,fn,pn,Gt],yo="start",us="end",Fx="clippingParents",Rh="viewport",ds="popper",$x="reference",Dh=cs.reduce(function(e,t){return e.concat([t+"-"+yo,t+"-"+us])},[]),Ph=[].concat(cs,[Yl]).reduce(function(e,t){return e.concat([t,t+"-"+yo,t+"-"+us])},[]),Ox="beforeRead",Lx="read",_x="afterRead",Mx="beforeMain",Nx="main",Bx="afterMain",jx="beforeWrite",zx="write",Ux="afterWrite",Vx=[Ox,Lx,_x,Mx,Nx,Bx,jx,zx,Ux];function zn(e){return e?(e.nodeName||"").toLowerCase():null}function Zt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qr(e){var t=Zt(e).Element;return e instanceof t||e instanceof Element}function hn(e){var t=Zt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zl(e){if(typeof ShadowRoot>"u")return!1;var t=Zt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function qx(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!hn(s)||!zn(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function Hx(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(u,d){return u[d]="",u},{});!hn(o)||!zn(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const Ih={name:"applyStyles",enabled:!0,phase:"write",fn:qx,effect:Hx,requires:["computeStyles"]};function Un(e){return e.split("-")[0]}var Hr=Math.max,Vi=Math.min,bo=Math.round;function ec(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Fh(){return!/^((?!chrome|android).)*safari/i.test(ec())}function wo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&hn(e)&&(o=e.offsetWidth>0&&bo(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&bo(r.height)/e.offsetHeight||1);var i=qr(e)?Zt(e):window,l=i.visualViewport,u=!Fh()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/o,c=(r.top+(u&&l?l.offsetTop:0))/s,p=r.width/o,f=r.height/s;return{width:p,height:f,top:c,right:d+p,bottom:c+f,left:d,x:d,y:c}}function tc(e){var t=wo(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $h(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Zl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ir(e){return Zt(e).getComputedStyle(e)}function Wx(e){return["table","td","th"].indexOf(zn(e))>=0}function kr(e){return((qr(e)?e.ownerDocument:e.document)||window.document).documentElement}function qi(e){return zn(e)==="html"?e:e.assignedSlot||e.parentNode||(Zl(e)?e.host:null)||kr(e)}function Oh(e){return!hn(e)||ir(e).position==="fixed"?null:e.offsetParent}function Qx(e){var t=/firefox/i.test(ec()),n=/Trident/i.test(ec());if(n&&hn(e)){var r=ir(e);if(r.position==="fixed")return null}var o=qi(e);for(Zl(o)&&(o=o.host);hn(o)&&["html","body"].indexOf(zn(o))<0;){var s=ir(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function fs(e){for(var t=Zt(e),n=Oh(e);n&&Wx(n)&&ir(n).position==="static";)n=Oh(n);return n&&(zn(n)==="html"||zn(n)==="body"&&ir(n).position==="static")?t:n||Qx(e)||t}function nc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ps(e,t,n){return Hr(e,Vi(t,n))}function Kx(e,t,n){var r=ps(e,t,n);return r>n?n:r}function Lh(){return{top:0,right:0,bottom:0,left:0}}function _h(e){return Object.assign({},Lh(),e)}function Mh(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Gx=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,_h(typeof t!="number"?t:Mh(t,cs))};function Jx(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Un(n.placement),u=nc(l),d=[Gt,pn].indexOf(l)>=0,c=d?"height":"width";if(!(!s||!i)){var p=Gx(o.padding,n),f=tc(s),h=u==="y"?Kt:Gt,g=u==="y"?fn:pn,m=n.rects.reference[c]+n.rects.reference[u]-i[u]-n.rects.popper[c],w=i[u]-n.rects.reference[u],T=fs(s),k=T?u==="y"?T.clientHeight||0:T.clientWidth||0:0,S=m/2-w/2,y=p[h],E=k-f[c]-p[g],D=k/2-f[c]/2+S,$=ps(y,D,E),_=u;n.modifiersData[r]=(t={},t[_]=$,t.centerOffset=$-D,t)}}function Xx(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||$h(t.elements.popper,o)&&(t.elements.arrow=o))}const Yx={name:"arrow",enabled:!0,phase:"main",fn:Jx,effect:Xx,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(e){return e.split("-")[1]}var Zx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eA(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bo(n*o)/o||0,y:bo(r*o)/o||0}}function Nh(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,u=e.gpuAcceleration,d=e.adaptive,c=e.roundOffsets,p=e.isFixed,f=i.x,h=f===void 0?0:f,g=i.y,m=g===void 0?0:g,w=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=w.x,m=w.y;var T=i.hasOwnProperty("x"),k=i.hasOwnProperty("y"),S=Gt,y=Kt,E=window;if(d){var D=fs(n),$="clientHeight",_="clientWidth";if(D===Zt(n)&&(D=kr(n),ir(D).position!=="static"&&l==="absolute"&&($="scrollHeight",_="scrollWidth")),D=D,o===Kt||(o===Gt||o===pn)&&s===us){y=fn;var L=p&&D===E&&E.visualViewport?E.visualViewport.height:D[$];m-=L-r.height,m*=u?1:-1}if(o===Gt||(o===Kt||o===fn)&&s===us){S=pn;var V=p&&D===E&&E.visualViewport?E.visualViewport.width:D[_];h-=V-r.width,h*=u?1:-1}}var te=Object.assign({position:l},d&&Zx),B=c===!0?eA({x:h,y:m},Zt(n)):{x:h,y:m};if(h=B.x,m=B.y,u){var O;return Object.assign({},te,(O={},O[y]=k?"0":"",O[S]=T?"0":"",O.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",O))}return Object.assign({},te,(t={},t[y]=k?m+"px":"",t[S]=T?h+"px":"",t.transform="",t))}function tA(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Un(t.placement),variation:So(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Nh(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Nh(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const nA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tA,data:{}};var Hi={passive:!0};function rA(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,u=Zt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach(function(c){c.addEventListener("scroll",n.update,Hi)}),l&&u.addEventListener("resize",n.update,Hi),function(){s&&d.forEach(function(c){c.removeEventListener("scroll",n.update,Hi)}),l&&u.removeEventListener("resize",n.update,Hi)}}const oA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rA,data:{}};var sA={left:"right",right:"left",bottom:"top",top:"bottom"};function Wi(e){return e.replace(/left|right|bottom|top/g,function(t){return sA[t]})}var iA={start:"end",end:"start"};function Bh(e){return e.replace(/start|end/g,function(t){return iA[t]})}function rc(e){var t=Zt(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function oc(e){return wo(kr(e)).left+rc(e).scrollLeft}function aA(e,t){var n=Zt(e),r=kr(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var d=Fh();(d||!d&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+oc(e),y:u}}function lA(e){var t,n=kr(e),r=rc(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Hr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Hr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+oc(e),u=-r.scrollTop;return ir(o||n).direction==="rtl"&&(l+=Hr(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function sc(e){var t=ir(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function jh(e){return["html","body","#document"].indexOf(zn(e))>=0?e.ownerDocument.body:hn(e)&&sc(e)?e:jh(qi(e))}function hs(e,t){var n;t===void 0&&(t=[]);var r=jh(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Zt(r),i=o?[s].concat(s.visualViewport||[],sc(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(hs(qi(i)))}function ic(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cA(e,t){var n=wo(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zh(e,t,n){return t===Rh?ic(aA(e,n)):qr(t)?cA(t,n):ic(lA(kr(e)))}function uA(e){var t=hs(qi(e)),n=["absolute","fixed"].indexOf(ir(e).position)>=0,r=n&&hn(e)?fs(e):e;return qr(r)?t.filter(function(o){return qr(o)&&$h(o,r)&&zn(o)!=="body"}):[]}function dA(e,t,n,r){var o=t==="clippingParents"?uA(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,d){var c=zh(e,d,r);return u.top=Hr(c.top,u.top),u.right=Vi(c.right,u.right),u.bottom=Vi(c.bottom,u.bottom),u.left=Hr(c.left,u.left),u},zh(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Uh(e){var t=e.reference,n=e.element,r=e.placement,o=r?Un(r):null,s=r?So(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case Kt:u={x:i,y:t.y-n.height};break;case fn:u={x:i,y:t.y+t.height};break;case pn:u={x:t.x+t.width,y:l};break;case Gt:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var d=o?nc(o):null;if(d!=null){var c=d==="y"?"height":"width";switch(s){case yo:u[d]=u[d]-(t[c]/2-n[c]/2);break;case us:u[d]=u[d]+(t[c]/2-n[c]/2);break}}return u}function To(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?Fx:l,d=n.rootBoundary,c=d===void 0?Rh:d,p=n.elementContext,f=p===void 0?ds:p,h=n.altBoundary,g=h===void 0?!1:h,m=n.padding,w=m===void 0?0:m,T=_h(typeof w!="number"?w:Mh(w,cs)),k=f===ds?$x:ds,S=e.rects.popper,y=e.elements[g?k:f],E=dA(qr(y)?y:y.contextElement||kr(e.elements.popper),u,c,i),D=wo(e.elements.reference),$=Uh({reference:D,element:S,placement:o}),_=ic(Object.assign({},S,$)),L=f===ds?_:D,V={top:E.top-L.top+T.top,bottom:L.bottom-E.bottom+T.bottom,left:E.left-L.left+T.left,right:L.right-E.right+T.right},te=e.modifiersData.offset;if(f===ds&&te){var B=te[o];Object.keys(V).forEach(function(O){var M=[pn,fn].indexOf(O)>=0?1:-1,N=[Kt,fn].indexOf(O)>=0?"y":"x";V[O]+=B[N]*M})}return V}function fA(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Ph:u,c=So(r),p=c?l?Dh:Dh.filter(function(g){return So(g)===c}):cs,f=p.filter(function(g){return d.indexOf(g)>=0});f.length===0&&(f=p);var h=f.reduce(function(g,m){return g[m]=To(e,{placement:m,boundary:o,rootBoundary:s,padding:i})[Un(m)],g},{});return Object.keys(h).sort(function(g,m){return h[g]-h[m]})}function pA(e){if(Un(e)===Yl)return[];var t=Wi(e);return[Bh(e),t,Bh(t)]}function hA(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,u=n.fallbackPlacements,d=n.padding,c=n.boundary,p=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,g=h===void 0?!0:h,m=n.allowedAutoPlacements,w=t.options.placement,T=Un(w),k=T===w,S=u||(k||!g?[Wi(w)]:pA(w)),y=[w].concat(S).reduce(function(fe,be){return fe.concat(Un(be)===Yl?fA(t,{placement:be,boundary:c,rootBoundary:p,padding:d,flipVariations:g,allowedAutoPlacements:m}):be)},[]),E=t.rects.reference,D=t.rects.popper,$=new Map,_=!0,L=y[0],V=0;V<y.length;V++){var te=y[V],B=Un(te),O=So(te)===yo,M=[Kt,fn].indexOf(B)>=0,N=M?"width":"height",q=To(t,{placement:te,boundary:c,rootBoundary:p,altBoundary:f,padding:d}),j=M?O?pn:Gt:O?fn:Kt;E[N]>D[N]&&(j=Wi(j));var H=Wi(j),se=[];if(s&&se.push(q[B]<=0),l&&se.push(q[j]<=0,q[H]<=0),se.every(function(fe){return fe})){L=te,_=!1;break}$.set(te,se)}if(_)for(var Y=g?3:1,ae=function(be){var xe=y.find(function(he){var ie=$.get(he);if(ie)return ie.slice(0,be).every(function(de){return de})});if(xe)return L=xe,"break"},ne=Y;ne>0;ne--){var pe=ae(ne);if(pe==="break")break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}}const mA={name:"flip",enabled:!0,phase:"main",fn:hA,requiresIfExists:["offset"],data:{_skip:!1}};function Vh(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function qh(e){return[Kt,pn,fn,Gt].some(function(t){return e[t]>=0})}function gA(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=To(t,{elementContext:"reference"}),l=To(t,{altBoundary:!0}),u=Vh(i,r),d=Vh(l,o,s),c=qh(u),p=qh(d);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const vA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gA};function yA(e,t,n){var r=Un(e),o=[Gt,Kt].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[Gt,pn].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function bA(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=Ph.reduce(function(c,p){return c[p]=yA(p,t.rects,s),c},{}),l=i[t.placement],u=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=i}const wA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bA};function SA(e){var t=e.state,n=e.name;t.modifiersData[n]=Uh({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const TA={name:"popperOffsets",enabled:!0,phase:"read",fn:SA,data:{}};function kA(e){return e==="x"?"y":"x"}function CA(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,u=n.boundary,d=n.rootBoundary,c=n.altBoundary,p=n.padding,f=n.tether,h=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,w=To(t,{boundary:u,rootBoundary:d,padding:p,altBoundary:c}),T=Un(t.placement),k=So(t.placement),S=!k,y=nc(T),E=kA(y),D=t.modifiersData.popperOffsets,$=t.rects.reference,_=t.rects.popper,L=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,V=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),te=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(D){if(s){var O,M=y==="y"?Kt:Gt,N=y==="y"?fn:pn,q=y==="y"?"height":"width",j=D[y],H=j+w[M],se=j-w[N],Y=h?-_[q]/2:0,ae=k===yo?$[q]:_[q],ne=k===yo?-_[q]:-$[q],pe=t.elements.arrow,fe=h&&pe?tc(pe):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Lh(),xe=be[M],he=be[N],ie=ps(0,$[q],fe[q]),de=S?$[q]/2-Y-ie-xe-V.mainAxis:ae-ie-xe-V.mainAxis,ue=S?-$[q]/2+Y+ie+he+V.mainAxis:ne+ie+he+V.mainAxis,Se=t.elements.arrow&&fs(t.elements.arrow),$e=Se?y==="y"?Se.clientTop||0:Se.clientLeft||0:0,Ve=(O=te?.[y])!=null?O:0,lt=j+de-Ve-$e,Tt=j+ue-Ve,ut=ps(h?Vi(H,lt):H,j,h?Hr(se,Tt):se);D[y]=ut,B[y]=ut-j}if(l){var gt,ve=y==="x"?Kt:Gt,ke=y==="x"?fn:pn,qe=D[E],We=E==="y"?"height":"width",Jt=qe+w[ve],Xt=qe-w[ke],kt=[Kt,Gt].indexOf(T)!==-1,dt=(gt=te?.[E])!=null?gt:0,mn=kt?Jt:qe-$[We]-_[We]-dt+V.altAxis,qn=kt?qe+$[We]+_[We]-dt-V.altAxis:Xt,At=h&&kt?Kx(mn,qe,qn):ps(h?mn:Jt,qe,h?qn:Xt);D[E]=At,B[E]=At-qe}t.modifiersData[r]=B}}const xA={name:"preventOverflow",enabled:!0,phase:"main",fn:CA,requiresIfExists:["offset"]};function AA(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function EA(e){return e===Zt(e)||!hn(e)?rc(e):AA(e)}function RA(e){var t=e.getBoundingClientRect(),n=bo(t.width)/e.offsetWidth||1,r=bo(t.height)/e.offsetHeight||1;return n!==1||r!==1}function DA(e,t,n){n===void 0&&(n=!1);var r=hn(t),o=hn(t)&&RA(t),s=kr(t),i=wo(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((zn(t)!=="body"||sc(s))&&(l=EA(t)),hn(t)?(u=wo(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=oc(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function PA(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function IA(e){var t=PA(e);return Vx.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function FA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function $A(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Hh={placement:"bottom",modifiers:[],strategy:"absolute"};function Wh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function OA(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?Hh:o;return function(l,u,d){d===void 0&&(d=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Hh,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},p=[],f=!1,h={state:c,setOptions:function(T){var k=typeof T=="function"?T(c.options):T;m(),c.options=Object.assign({},s,c.options,k),c.scrollParents={reference:qr(l)?hs(l):l.contextElement?hs(l.contextElement):[],popper:hs(u)};var S=IA($A([].concat(r,c.options.modifiers)));return c.orderedModifiers=S.filter(function(y){return y.enabled}),g(),h.update()},forceUpdate:function(){if(!f){var T=c.elements,k=T.reference,S=T.popper;if(Wh(k,S)){c.rects={reference:DA(k,fs(S),c.options.strategy==="fixed"),popper:tc(S)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(V){return c.modifiersData[V.name]=Object.assign({},V.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var E=c.orderedModifiers[y],D=E.fn,$=E.options,_=$===void 0?{}:$,L=E.name;typeof D=="function"&&(c=D({state:c,options:_,name:L,instance:h})||c)}}}},update:FA(function(){return new Promise(function(w){h.forceUpdate(),w(c)})}),destroy:function(){m(),f=!0}};if(!Wh(l,u))return h;h.setOptions(d).then(function(w){!f&&d.onFirstUpdate&&d.onFirstUpdate(w)});function g(){c.orderedModifiers.forEach(function(w){var T=w.name,k=w.options,S=k===void 0?{}:k,y=w.effect;if(typeof y=="function"){var E=y({state:c,name:T,instance:h,options:S}),D=function(){};p.push(E||D)}})}function m(){p.forEach(function(w){return w()}),p=[]}return h}}var LA=[oA,TA,nA,Ih,wA,mA,xA,Yx,vA],_A=OA({defaultModifiers:LA}),MA="tippy-box",Qh="tippy-content",NA="tippy-backdrop",Kh="tippy-arrow",Gh="tippy-svg-arrow",Wr={passive:!0,capture:!0},Jh=function(){return document.body};function BA(e,t){return{}.hasOwnProperty.call(e,t)}function ac(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function lc(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Xh(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Yh(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function jA(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function zA(e){return e.split(/\s+/).filter(Boolean)}function ko(e){return[].concat(e)}function Zh(e,t){e.indexOf(t)===-1&&e.push(t)}function UA(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function VA(e){return e.split("-")[0]}function Qi(e){return[].slice.call(e)}function em(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ms(){return document.createElement("div")}function gs(e){return["Element","Fragment"].some(function(t){return lc(e,t)})}function qA(e){return lc(e,"NodeList")}function HA(e){return lc(e,"MouseEvent")}function tm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function WA(e){return gs(e)?[e]:qA(e)?Qi(e):Array.isArray(e)?e:Qi(document.querySelectorAll(e))}function cc(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function nm(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function QA(e){var t,n=ko(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function KA(e,t){var n=t.clientX,r=t.clientY;return e.every(function(o){var s=o.popperRect,i=o.popperState,l=o.props,u=l.interactiveBorder,d=VA(i.placement),c=i.modifiersData.offset;if(!c)return!0;var p=d==="bottom"?c.top.y:0,f=d==="top"?c.bottom.y:0,h=d==="right"?c.left.x:0,g=d==="left"?c.right.x:0,m=s.top-r+p>u,w=r-s.bottom-f>u,T=s.left-n+h>u,k=n-s.right-g>u;return m||w||T||k})}function uc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[r](o,n)})}function rm(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Vn={isTouch:!1},om=0;function GA(){Vn.isTouch||(Vn.isTouch=!0,window.performance&&document.addEventListener("mousemove",sm))}function sm(){var e=performance.now();e-om<20&&(Vn.isTouch=!1,document.removeEventListener("mousemove",sm)),om=e}function JA(){var e=document.activeElement;if(tm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function XA(){document.addEventListener("touchstart",GA,Wr),window.addEventListener("blur",JA)}var YA=typeof window<"u"&&typeof document<"u",ZA=YA?!!window.msCrypto:!1;function Co(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function im(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function eE(e){return im(`
44
12
  %ctippy.js
45
13
 
46
- %c`+Yw(e)+`
14
+ %c`+im(e)+`
47
15
 
48
16
  %c👷‍ This is a development-only message. It will be removed in production.
49
- `)}function Jw(e){return[jD(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ts;be.env.NODE_ENV!=="production"&&UD();function UD(){ts=new Set}function Fr(e,t){if(e&&!ts.has(t)){var n;ts.add(t),(n=console).warn.apply(n,Jw(t))}}function wd(e,t){if(e&&!ts.has(t)){var n;ts.add(t),(n=console).error.apply(n,Jw(t))}}function VD(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;wd(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),wd(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Zw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},qD={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Cn=Object.assign({appendTo:Uw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Zw,qD),zD=Object.keys(Cn),WD=function(t){be.env.NODE_ENV!=="production"&&n0(t,[]);var n=Object.keys(t);n.forEach(function(r){Cn[r]=t[r]})};function e0(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=e[o]!==void 0?e[o]:(a=Cn[o])!=null?a:s}return r},{});return Object.assign({},e,n)}function HD(e,t){var n=t?Object.keys(e0(Object.assign({},Cn,{plugins:t}))):zD,r=n.reduce(function(i,o){var s=(e.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function t0(e,t){var n=Object.assign({},t,{content:Vw(t.content,[e])},t.ignoreAttributes?{}:HD(e,t.plugins));return n.aria=Object.assign({},Cn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function n0(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=RD(Cn,Object.keys(Zw)),o=!xD(i,r);o&&(o=t.filter(function(s){return s.name===r}).length===0),Fr(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
17
+ `)}function am(e){return[eE(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vs;ce.env.NODE_ENV!=="production"&&tE();function tE(){vs=new Set}function ar(e,t){if(e&&!vs.has(t)){var n;vs.add(t),(n=console).warn.apply(n,am(t))}}function dc(e,t){if(e&&!vs.has(t)){var n;vs.add(t),(n=console).error.apply(n,am(t))}}function nE(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;dc(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),dc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var lm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},rE={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},en=Object.assign({appendTo:Jh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},lm,rE),oE=Object.keys(en),sE=function(t){ce.env.NODE_ENV!=="production"&&dm(t,[]);var n=Object.keys(t);n.forEach(function(r){en[r]=t[r]})};function cm(e){var t=e.plugins||[],n=t.reduce(function(r,o){var s=o.name,i=o.defaultValue;if(s){var l;r[s]=e[s]!==void 0?e[s]:(l=en[s])!=null?l:i}return r},{});return Object.assign({},e,n)}function iE(e,t){var n=t?Object.keys(cm(Object.assign({},en,{plugins:t}))):oE,r=n.reduce(function(o,s){var i=(e.getAttribute("data-tippy-"+s)||"").trim();if(!i)return o;if(s==="content")o[s]=i;else try{o[s]=JSON.parse(i)}catch{o[s]=i}return o},{});return r}function um(e,t){var n=Object.assign({},t,{content:Xh(t.content,[e])},t.ignoreAttributes?{}:iE(e,t.plugins));return n.aria=Object.assign({},en.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function dm(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var o=jA(en,Object.keys(lm)),s=!BA(o,r);s&&(s=t.filter(function(i){return i.name===r}).length===0),ar(s,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
50
18
 
51
19
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
52
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var KD=function(){return"innerHTML"};function Sd(e,t){e[KD()]=t}function r0(e){var t=Zo();return e===!0?t.className=Bw:(t.className=jw,es(e)?t.appendChild(e):Sd(t,e)),t}function i0(e,t){es(t.content)?(Sd(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Sd(e,t.content):e.textContent=t.content)}function Ed(e){var t=e.firstElementChild,n=Va(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(Mw)}),arrow:n.find(function(r){return r.classList.contains(Bw)||r.classList.contains(jw)}),backdrop:n.find(function(r){return r.classList.contains(AD)})}}function o0(e){var t=Zo(),n=Zo();n.className=TD,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Zo();r.className=Mw,r.setAttribute("data-state","hidden"),i0(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,s){var a=Ed(t),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&i0(u,e.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(r0(s.arrow))):l.appendChild(r0(s.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}o0.$$tippy=!0;var GD=1,qa=[],za=[];function QD(e,t){var n=t0(e,Object.assign({},Cn,e0(Ww(t)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,p,d,m=[],b=qw(xe,n.interactiveDebounce),w,S=GD++,y=null,g=kD(n.plugins),v={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:S,reference:e,popper:Zo(),popperInstance:y,props:n,state:v,plugins:g,clearDelayTimeouts:Bt,setProps:jt,setContent:ct,show:Ne,hide:M,hideWithInteractivity:k,enable:lt,disable:Et,unmount:I,destroy:J};if(!n.render)return be.env.NODE_ENV!=="production"&&wd(!0,"render() function has not been supplied."),h;var E=n.render(h),T=E.popper,R=E.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+h.id,h.popper=T,e._tippy=h,T._tippy=h;var x=g.map(function(G){return G.fn(h)}),A=e.hasAttribute("aria-expanded");return j(),ae(),Y(),se("onCreate",[h]),n.showOnCreate&&Qe(),T.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&V().addEventListener("mousemove",b)}),h;function N(){var G=h.props.touch;return Array.isArray(G)?G:[G,0]}function W(){return N()[0]==="hold"}function O(){var G;return!!((G=h.props.render)!=null&&G.$$tippy)}function D(){return w||e}function V(){var G=D().parentNode;return G?_D(G):document}function L(){return Ed(T)}function te(G){return h.state.isMounted&&!h.state.isVisible||hr.isTouch||c&&c.type==="focus"?0:gd(h.props.delay,G?0:1,Cn.delay)}function Y(G){G===void 0&&(G=!1),T.style.pointerEvents=h.props.interactive&&!G?"":"none",T.style.zIndex=""+h.props.zIndex}function se(G,oe,ne){if(ne===void 0&&(ne=!0),x.forEach(function(Le){Le[G]&&Le[G].apply(Le,oe)}),ne){var Pe;(Pe=h.props)[G].apply(Pe,oe)}}function he(){var G=h.props.aria;if(G.content){var oe="aria-"+G.content,ne=T.id,Pe=no(h.props.triggerTarget||e);Pe.forEach(function(Le){var qe=Le.getAttribute(oe);if(h.state.isVisible)Le.setAttribute(oe,qe?qe+" "+ne:ne);else{var Ze=qe&&qe.replace(ne,"").trim();Ze?Le.setAttribute(oe,Ze):Le.removeAttribute(oe)}})}}function ae(){if(!(A||!h.props.aria.expanded)){var G=no(h.props.triggerTarget||e);G.forEach(function(oe){h.props.interactive?oe.setAttribute("aria-expanded",h.state.isVisible&&oe===D()?"true":"false"):oe.removeAttribute("aria-expanded")})}}function we(){V().removeEventListener("mousemove",b),qa=qa.filter(function(G){return G!==b})}function Q(G){if(!(hr.isTouch&&(l||G.type==="mousedown"))){var oe=G.composedPath&&G.composedPath()[0]||G.target;if(!(h.props.interactive&&Gw(T,oe))){if(no(h.props.triggerTarget||e).some(function(ne){return Gw(ne,oe)})){if(hr.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[h,G]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),a=!0,setTimeout(function(){a=!1}),h.state.isMounted||ee())}}}function ie(){l=!0}function ce(){l=!1}function Ae(){var G=V();G.addEventListener("mousedown",Q,!0),G.addEventListener("touchend",Q,Si),G.addEventListener("touchstart",ce,Si),G.addEventListener("touchmove",ie,Si)}function ee(){var G=V();G.removeEventListener("mousedown",Q,!0),G.removeEventListener("touchend",Q,Si),G.removeEventListener("touchstart",ce,Si),G.removeEventListener("touchmove",ie,Si)}function F(G,oe){q(G,function(){!h.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&oe()})}function C(G,oe){q(G,oe)}function q(G,oe){var ne=L().box;function Pe(Le){Le.target===ne&&(bd(ne,"remove",Pe),oe())}if(G===0)return oe();bd(ne,"remove",p),bd(ne,"add",Pe),p=Pe}function K(G,oe,ne){ne===void 0&&(ne=!1);var Pe=no(h.props.triggerTarget||e);Pe.forEach(function(Le){Le.addEventListener(G,oe,ne),m.push({node:Le,eventType:G,handler:oe,options:ne})})}function j(){W()&&(K("touchstart",ge,{passive:!0}),K("touchend",De,{passive:!0})),CD(h.props.trigger).forEach(function(G){if(G!=="manual")switch(K(G,ge),G){case"mouseenter":K("mouseleave",De);break;case"focus":K(BD?"focusout":"blur",Oe);break;case"focusin":K("focusout",Oe);break}})}function H(){m.forEach(function(G){var oe=G.node,ne=G.eventType,Pe=G.handler,Le=G.options;oe.removeEventListener(ne,Pe,Le)}),m=[]}function ge(G){var oe,ne=!1;if(!(!h.state.isEnabled||Ce(G)||a)){var Pe=((oe=c)==null?void 0:oe.type)==="focus";c=G,w=G.currentTarget,ae(),!h.state.isVisible&&OD(G)&&qa.forEach(function(Le){return Le(G)}),G.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?ne=!0:Qe(G),G.type==="click"&&(s=!ne),ne&&!Pe&&Xe(G)}}function xe(G){var oe=G.target,ne=D().contains(oe)||T.contains(oe);if(!(G.type==="mousemove"&&ne)){var Pe=Ge().concat(T).map(function(Le){var qe,Ze=Le._tippy,et=(qe=Ze.popperInstance)==null?void 0:qe.state;return et?{popperRect:Le.getBoundingClientRect(),popperState:et,props:n}:null}).filter(Boolean);DD(Pe,G)&&(we(),Xe(G))}}function De(G){var oe=Ce(G)||h.props.trigger.indexOf("click")>=0&&s;if(!oe){if(h.props.interactive){h.hideWithInteractivity(G);return}Xe(G)}}function Oe(G){h.props.trigger.indexOf("focusin")<0&&G.target!==D()||h.props.interactive&&G.relatedTarget&&T.contains(G.relatedTarget)||Xe(G)}function Ce(G){return hr.isTouch?W()!==G.type.indexOf("touch")>=0:!1}function Fe(){ye();var G=h.props,oe=G.popperOptions,ne=G.placement,Pe=G.offset,Le=G.getReferenceClientRect,qe=G.moveTransition,Ze=O()?Ed(T).arrow:null,et=Le?{getBoundingClientRect:Le,contextElement:Le.contextElement||D()}:e,Dr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function($e){var je=$e.state;if(O()){var bt=L(),U=bt.box;["placement","reference-hidden","escaped"].forEach(function(P){P==="placement"?U.setAttribute("data-placement",je.placement):je.attributes.popper["data-popper-"+P]?U.setAttribute("data-"+P,""):U.removeAttribute("data-"+P)}),je.attributes.popper={}}}},qt=[{name:"offset",options:{offset:Pe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!qe}},Dr];O()&&Ze&&qt.push({name:"arrow",options:{element:Ze,padding:3}}),qt.push.apply(qt,oe?.modifiers||[]),h.popperInstance=ED(et,T,Object.assign({},oe,{placement:ne,onFirstUpdate:d,modifiers:qt}))}function ye(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function We(){var G=h.props.appendTo,oe,ne=D();h.props.interactive&&G===Uw||G==="parent"?oe=ne.parentNode:oe=Vw(G,[ne]),oe.contains(T)||oe.appendChild(T),h.state.isMounted=!0,Fe(),be.env.NODE_ENV!=="production"&&Fr(h.props.interactive&&G===Cn.appendTo&&ne.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
20
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var aE=function(){return"innerHTML"};function fc(e,t){e[aE()]=t}function fm(e){var t=ms();return e===!0?t.className=Kh:(t.className=Gh,gs(e)?t.appendChild(e):fc(t,e)),t}function pm(e,t){gs(t.content)?(fc(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?fc(e,t.content):e.textContent=t.content)}function pc(e){var t=e.firstElementChild,n=Qi(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(Qh)}),arrow:n.find(function(r){return r.classList.contains(Kh)||r.classList.contains(Gh)}),backdrop:n.find(function(r){return r.classList.contains(NA)})}}function hm(e){var t=ms(),n=ms();n.className=MA,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ms();r.className=Qh,r.setAttribute("data-state","hidden"),pm(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props);function o(s,i){var l=pc(t),u=l.box,d=l.content,c=l.arrow;i.theme?u.setAttribute("data-theme",i.theme):u.removeAttribute("data-theme"),typeof i.animation=="string"?u.setAttribute("data-animation",i.animation):u.removeAttribute("data-animation"),i.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof i.maxWidth=="number"?i.maxWidth+"px":i.maxWidth,i.role?u.setAttribute("role",i.role):u.removeAttribute("role"),(s.content!==i.content||s.allowHTML!==i.allowHTML)&&pm(d,e.props),i.arrow?c?s.arrow!==i.arrow&&(u.removeChild(c),u.appendChild(fm(i.arrow))):u.appendChild(fm(i.arrow)):c&&u.removeChild(c)}return{popper:t,onUpdate:o}}hm.$$tippy=!0;var lE=1,Ki=[],Gi=[];function cE(e,t){var n=um(e,Object.assign({},en,cm(em(t)))),r,o,s,i=!1,l=!1,u=!1,d=!1,c,p,f,h=[],g=Yh(lt,n.interactiveDebounce),m,w=lE++,T=null,k=UA(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:w,reference:e,popper:ms(),popperInstance:T,props:n,state:S,plugins:k,clearDelayTimeouts:mn,setProps:qn,setContent:At,show:En,hide:C,hideWithInteractivity:v,enable:kt,disable:dt,unmount:b,destroy:F};if(!n.render)return ce.env.NODE_ENV!=="production"&&dc(!0,"render() function has not been supplied."),y;var E=n.render(y),D=E.popper,$=E.onUpdate;D.setAttribute("data-tippy-root",""),D.id="tippy-"+y.id,y.popper=D,e._tippy=y,D._tippy=y;var _=k.map(function(P){return P.fn(y)}),L=e.hasAttribute("aria-expanded");return Se(),Y(),j(),H("onCreate",[y]),n.showOnCreate&&Jt(),D.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),D.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",g)}),y;function V(){var P=y.props.touch;return Array.isArray(P)?P:[P,0]}function te(){return V()[0]==="hold"}function B(){var P;return!!((P=y.props.render)!=null&&P.$$tippy)}function O(){return m||e}function M(){var P=O().parentNode;return P?QA(P):document}function N(){return pc(D)}function q(P){return y.state.isMounted&&!y.state.isVisible||Vn.isTouch||c&&c.type==="focus"?0:ac(y.props.delay,P?0:1,en.delay)}function j(P){P===void 0&&(P=!1),D.style.pointerEvents=y.props.interactive&&!P?"":"none",D.style.zIndex=""+y.props.zIndex}function H(P,U,X){if(X===void 0&&(X=!0),_.forEach(function(ye){ye[P]&&ye[P].apply(ye,U)}),X){var ee;(ee=y.props)[P].apply(ee,U)}}function se(){var P=y.props.aria;if(P.content){var U="aria-"+P.content,X=D.id,ee=ko(y.props.triggerTarget||e);ee.forEach(function(ye){var Ie=ye.getAttribute(U);if(y.state.isVisible)ye.setAttribute(U,Ie?Ie+" "+X:X);else{var Fe=Ie&&Ie.replace(X,"").trim();Fe?ye.setAttribute(U,Fe):ye.removeAttribute(U)}})}}function Y(){if(!(L||!y.props.aria.expanded)){var P=ko(y.props.triggerTarget||e);P.forEach(function(U){y.props.interactive?U.setAttribute("aria-expanded",y.state.isVisible&&U===O()?"true":"false"):U.removeAttribute("aria-expanded")})}}function ae(){M().removeEventListener("mousemove",g),Ki=Ki.filter(function(P){return P!==g})}function ne(P){if(!(Vn.isTouch&&(u||P.type==="mousedown"))){var U=P.composedPath&&P.composedPath()[0]||P.target;if(!(y.props.interactive&&rm(D,U))){if(ko(y.props.triggerTarget||e).some(function(X){return rm(X,U)})){if(Vn.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[y,P]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||xe())}}}function pe(){u=!0}function fe(){u=!1}function be(){var P=M();P.addEventListener("mousedown",ne,!0),P.addEventListener("touchend",ne,Wr),P.addEventListener("touchstart",fe,Wr),P.addEventListener("touchmove",pe,Wr)}function xe(){var P=M();P.removeEventListener("mousedown",ne,!0),P.removeEventListener("touchend",ne,Wr),P.removeEventListener("touchstart",fe,Wr),P.removeEventListener("touchmove",pe,Wr)}function he(P,U){de(P,function(){!y.state.isVisible&&D.parentNode&&D.parentNode.contains(D)&&U()})}function ie(P,U){de(P,U)}function de(P,U){var X=N().box;function ee(ye){ye.target===X&&(uc(X,"remove",ee),U())}if(P===0)return U();uc(X,"remove",p),uc(X,"add",ee),p=ee}function ue(P,U,X){X===void 0&&(X=!1);var ee=ko(y.props.triggerTarget||e);ee.forEach(function(ye){ye.addEventListener(P,U,X),h.push({node:ye,eventType:P,handler:U,options:X})})}function Se(){te()&&(ue("touchstart",Ve,{passive:!0}),ue("touchend",Tt,{passive:!0})),zA(y.props.trigger).forEach(function(P){if(P!=="manual")switch(ue(P,Ve),P){case"mouseenter":ue("mouseleave",Tt);break;case"focus":ue(ZA?"focusout":"blur",ut);break;case"focusin":ue("focusout",ut);break}})}function $e(){h.forEach(function(P){var U=P.node,X=P.eventType,ee=P.handler,ye=P.options;U.removeEventListener(X,ee,ye)}),h=[]}function Ve(P){var U,X=!1;if(!(!y.state.isEnabled||gt(P)||l)){var ee=((U=c)==null?void 0:U.type)==="focus";c=P,m=P.currentTarget,Y(),!y.state.isVisible&&HA(P)&&Ki.forEach(function(ye){return ye(P)}),P.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||i)&&y.props.hideOnClick!==!1&&y.state.isVisible?X=!0:Jt(P),P.type==="click"&&(i=!X),X&&!ee&&Xt(P)}}function lt(P){var U=P.target,X=O().contains(U)||D.contains(U);if(!(P.type==="mousemove"&&X)){var ee=We().concat(D).map(function(ye){var Ie,Fe=ye._tippy,Ne=(Ie=Fe.popperInstance)==null?void 0:Ie.state;return Ne?{popperRect:ye.getBoundingClientRect(),popperState:Ne,props:n}:null}).filter(Boolean);KA(ee,P)&&(ae(),Xt(P))}}function Tt(P){var U=gt(P)||y.props.trigger.indexOf("click")>=0&&i;if(!U){if(y.props.interactive){y.hideWithInteractivity(P);return}Xt(P)}}function ut(P){y.props.trigger.indexOf("focusin")<0&&P.target!==O()||y.props.interactive&&P.relatedTarget&&D.contains(P.relatedTarget)||Xt(P)}function gt(P){return Vn.isTouch?te()!==P.type.indexOf("touch")>=0:!1}function ve(){ke();var P=y.props,U=P.popperOptions,X=P.placement,ee=P.offset,ye=P.getReferenceClientRect,Ie=P.moveTransition,Fe=B()?pc(D).arrow:null,Ne=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||O()}:e,xs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Eo){var Te=Eo.state;if(B()){var Oe=N(),tt=Oe.box;["placement","reference-hidden","escaped"].forEach(function(Vt){Vt==="placement"?tt.setAttribute("data-placement",Te.placement):Te.attributes.popper["data-popper-"+Vt]?tt.setAttribute("data-"+Vt,""):tt.removeAttribute("data-"+Vt)}),Te.attributes.popper={}}}},cr=[{name:"offset",options:{offset:ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ie}},xs];B()&&Fe&&cr.push({name:"arrow",options:{element:Fe,padding:3}}),cr.push.apply(cr,U?.modifiers||[]),y.popperInstance=_A(Ne,D,Object.assign({},U,{placement:X,onFirstUpdate:f,modifiers:cr}))}function ke(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function qe(){var P=y.props.appendTo,U,X=O();y.props.interactive&&P===Jh||P==="parent"?U=X.parentNode:U=Xh(P,[X]),U.contains(D)||U.appendChild(D),y.state.isMounted=!0,ve(),ce.env.NODE_ENV!=="production"&&ar(y.props.interactive&&P===en.appendTo&&X.nextElementSibling!==D,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
53
21
 
54
22
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
55
23
 
56
24
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
57
25
 
58
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ge(){return Va(T.querySelectorAll("[data-tippy-root]"))}function Qe(G){h.clearDelayTimeouts(),G&&se("onTrigger",[h,G]),Ae();var oe=te(!0),ne=N(),Pe=ne[0],Le=ne[1];hr.isTouch&&Pe==="hold"&&Le&&(oe=Le),oe?r=setTimeout(function(){h.show()},oe):h.show()}function Xe(G){if(h.clearDelayTimeouts(),se("onUntrigger",[h,G]),!h.state.isVisible){ee();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&s)){var oe=te(!1);oe?i=setTimeout(function(){h.state.isVisible&&h.hide()},oe):o=requestAnimationFrame(function(){h.hide()})}}function lt(){h.state.isEnabled=!0}function Et(){h.hide(),h.state.isEnabled=!1}function Bt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function jt(G){if(be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("setProps")),!h.state.isDestroyed){se("onBeforeUpdate",[h,G]),H();var oe=h.props,ne=t0(e,Object.assign({},oe,Ww(G),{ignoreAttributes:!0}));h.props=ne,j(),oe.interactiveDebounce!==ne.interactiveDebounce&&(we(),b=qw(xe,ne.interactiveDebounce)),oe.triggerTarget&&!ne.triggerTarget?no(oe.triggerTarget).forEach(function(Pe){Pe.removeAttribute("aria-expanded")}):ne.triggerTarget&&e.removeAttribute("aria-expanded"),ae(),Y(),R&&R(oe,ne),h.popperInstance&&(Fe(),Ge().forEach(function(Pe){requestAnimationFrame(Pe._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[h,G])}}function ct(G){h.setProps({content:G})}function Ne(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("show"));var G=h.state.isVisible,oe=h.state.isDestroyed,ne=!h.state.isEnabled,Pe=hr.isTouch&&!h.props.touch,Le=gd(h.props.duration,0,Cn.duration);if(!(G||oe||ne||Pe)&&!D().hasAttribute("disabled")&&(se("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,O()&&(T.style.visibility="visible"),Y(),Ae(),h.state.isMounted||(T.style.transition="none"),O()){var qe=L(),Ze=qe.box,et=qe.content;vd([Ze,et],0)}d=function(){var qt;if(!(!h.state.isVisible||u)){if(u=!0,T.offsetHeight,T.style.transition=h.props.moveTransition,O()&&h.props.animation){var Nr=L(),$e=Nr.box,je=Nr.content;vd([$e,je],Le),Kw([$e,je],"visible")}he(),ae(),zw(za,h),(qt=h.popperInstance)==null||qt.forceUpdate(),se("onMount",[h]),h.props.animation&&O()&&C(Le,function(){h.state.isShown=!0,se("onShown",[h])})}},We()}}function M(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("hide"));var G=!h.state.isVisible,oe=h.state.isDestroyed,ne=!h.state.isEnabled,Pe=gd(h.props.duration,1,Cn.duration);if(!(G||oe||ne)&&(se("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,u=!1,s=!1,O()&&(T.style.visibility="hidden"),we(),ee(),Y(!0),O()){var Le=L(),qe=Le.box,Ze=Le.content;h.props.animation&&(vd([qe,Ze],Pe),Kw([qe,Ze],"hidden"))}he(),ae(),h.props.animation?O()&&F(Pe,h.unmount):h.unmount()}}function k(G){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("hideWithInteractivity")),V().addEventListener("mousemove",b),zw(qa,b),b(G)}function I(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("unmount")),h.state.isVisible&&h.hide(),h.state.isMounted&&(ye(),Ge().forEach(function(G){G._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),za=za.filter(function(G){return G!==h}),h.state.isMounted=!1,se("onHidden",[h]))}function J(){be.env.NODE_ENV!=="production"&&Fr(h.state.isDestroyed,ro("destroy")),!h.state.isDestroyed&&(h.clearDelayTimeouts(),h.unmount(),H(),delete e._tippy,h.state.isDestroyed=!0,se("onDestroy",[h]))}}function ns(e,t){t===void 0&&(t={});var n=Cn.plugins.concat(t.plugins||[]);be.env.NODE_ENV!=="production"&&(VD(e),n0(t,n)),$D();var r=Object.assign({},t,{plugins:n}),i=FD(e);if(be.env.NODE_ENV!=="production"){var o=es(r.content),s=i.length>1;Fr(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
26
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function We(){return Qi(D.querySelectorAll("[data-tippy-root]"))}function Jt(P){y.clearDelayTimeouts(),P&&H("onTrigger",[y,P]),be();var U=q(!0),X=V(),ee=X[0],ye=X[1];Vn.isTouch&&ee==="hold"&&ye&&(U=ye),U?r=setTimeout(function(){y.show()},U):y.show()}function Xt(P){if(y.clearDelayTimeouts(),H("onUntrigger",[y,P]),!y.state.isVisible){xe();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(P.type)>=0&&i)){var U=q(!1);U?o=setTimeout(function(){y.state.isVisible&&y.hide()},U):s=requestAnimationFrame(function(){y.hide()})}}function kt(){y.state.isEnabled=!0}function dt(){y.hide(),y.state.isEnabled=!1}function mn(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(s)}function qn(P){if(ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("setProps")),!y.state.isDestroyed){H("onBeforeUpdate",[y,P]),$e();var U=y.props,X=um(e,Object.assign({},U,em(P),{ignoreAttributes:!0}));y.props=X,Se(),U.interactiveDebounce!==X.interactiveDebounce&&(ae(),g=Yh(lt,X.interactiveDebounce)),U.triggerTarget&&!X.triggerTarget?ko(U.triggerTarget).forEach(function(ee){ee.removeAttribute("aria-expanded")}):X.triggerTarget&&e.removeAttribute("aria-expanded"),Y(),j(),$&&$(U,X),y.popperInstance&&(ve(),We().forEach(function(ee){requestAnimationFrame(ee._tippy.popperInstance.forceUpdate)})),H("onAfterUpdate",[y,P])}}function At(P){y.setProps({content:P})}function En(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("show"));var P=y.state.isVisible,U=y.state.isDestroyed,X=!y.state.isEnabled,ee=Vn.isTouch&&!y.props.touch,ye=ac(y.props.duration,0,en.duration);if(!(P||U||X||ee)&&!O().hasAttribute("disabled")&&(H("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,B()&&(D.style.visibility="visible"),j(),be(),y.state.isMounted||(D.style.transition="none"),B()){var Ie=N(),Fe=Ie.box,Ne=Ie.content;cc([Fe,Ne],0)}f=function(){var cr;if(!(!y.state.isVisible||d)){if(d=!0,D.offsetHeight,D.style.transition=y.props.moveTransition,B()&&y.props.animation){var As=N(),Eo=As.box,Te=As.content;cc([Eo,Te],ye),nm([Eo,Te],"visible")}se(),Y(),Zh(Gi,y),(cr=y.popperInstance)==null||cr.forceUpdate(),H("onMount",[y]),y.props.animation&&B()&&ie(ye,function(){y.state.isShown=!0,H("onShown",[y])})}},qe()}}function C(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("hide"));var P=!y.state.isVisible,U=y.state.isDestroyed,X=!y.state.isEnabled,ee=ac(y.props.duration,1,en.duration);if(!(P||U||X)&&(H("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,d=!1,i=!1,B()&&(D.style.visibility="hidden"),ae(),xe(),j(!0),B()){var ye=N(),Ie=ye.box,Fe=ye.content;y.props.animation&&(cc([Ie,Fe],ee),nm([Ie,Fe],"hidden"))}se(),Y(),y.props.animation?B()&&he(ee,y.unmount):y.unmount()}}function v(P){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("hideWithInteractivity")),M().addEventListener("mousemove",g),Zh(Ki,g),g(P)}function b(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(ke(),We().forEach(function(P){P._tippy.unmount()}),D.parentNode&&D.parentNode.removeChild(D),Gi=Gi.filter(function(P){return P!==y}),y.state.isMounted=!1,H("onHidden",[y]))}function F(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),$e(),delete e._tippy,y.state.isDestroyed=!0,H("onDestroy",[y]))}}function ys(e,t){t===void 0&&(t={});var n=en.plugins.concat(t.plugins||[]);ce.env.NODE_ENV!=="production"&&(nE(e),dm(t,n)),XA();var r=Object.assign({},t,{plugins:n}),o=WA(e);if(ce.env.NODE_ENV!=="production"){var s=gs(r.content),i=o.length>1;ar(s&&i,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
59
27
 
60
28
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
61
29
 
62
30
  `,`1) content: element.innerHTML
63
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,u){var c=u&&QD(u,r);return c&&l.push(c),l},[]);return es(e)?a[0]:a}ns.defaultProps=Cn,ns.setDefaultProps=WD,ns.currentInput=hr;var XD=function(t){var n=t===void 0?{}:t,r=n.exclude,i=n.duration;za.forEach(function(o){var s=!1;if(r&&(s=Hw(r)?o.reference===r:o.popper===r.popper),!s){var a=o.props.duration;o.setProps({duration:i}),o.hide(),o.state.isDestroyed||o.setProps({duration:a})}})};Object.assign({},Ew,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),ns.setDefaultProps({render:o0});const YD={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){const t=n=>{n.code==="Escape"&&e()};return{onShow:()=>{document.addEventListener("keydown",t)},onHide:()=>{document.removeEventListener("keydown",t)}}}},Td=e=>{if(e)try{e.destroy()}catch{}},JD=["id"],ZD=_e({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>ci("oc-drop-")},isNestedElement:{type:Boolean,default:!1},mode:{default:"click"},offset:{type:[Array,Function],default:[0,0]},paddingSize:{default:"medium"},popperOptions:{default:()=>({})},position:{default:"bottom-start"},target:{},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{isMobile:i}=vw(),o=le(!1),s=B(()=>f(i)&&!e.enforceDropOnMobile),a=Tn("bottomDrawerRef"),l=Tn("drop"),u=le(null),c=()=>{if(f(s)){f(a).show();return}f(u)?.show()},p=()=>{if(f(s)){f(a).hide();return}f(u)?.hide()};t({show:c,hide:p,tippy:u});const d=S=>{const y=S.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!y&&p()},m=S=>{const y=l.value?.closest(".tippy-box");S.relatedTarget&&!y?.contains(S.relatedTarget)&&p()},b=B(()=>({hover:"mouseenter focus",click:void 0,manual:void 0})[e.mode]||e.mode);st(()=>e.position,()=>{f(u)?.setProps({placement:e.position})}),st(()=>e.mode,()=>{f(u)?.setProps({trigger:b.value})}),An(()=>{f(l)?.removeEventListener("focusout",m),Td(f(u))});const w=()=>{Td(f(u));const S=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):l.value?.previousElementSibling,y=l.value;if(!S||!y)return;const g={trigger:b.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[YD],theme:"none",maxWidth:416,offset:e.offset,onShow:v=>{o.value=!0,r("showDrop"),e.isNestedElement||XD({exclude:v})},onHide:()=>{o.value=!1,r("hideDrop")},popperOptions:{...e.popperOptions,modifiers:[...e.popperOptions?.modifiers?e.popperOptions.modifiers:[],{name:"fixVerticalPosition",enabled:!0,phase:"beforeWrite",requiresIfExists:["offset","preventOverflow","flip"],fn({state:v}){const h=to(v),E=v.modifiersData.fullHeight||v.elements.popper.offsetHeight,T=h.top*-1-10,R=T+E+h.bottom*-1,x=R-T,A=R-x;E>x&&E>A&&(v.styles.popper.top=`-${T}px`,v.modifiersData.fullHeight=E),E>R&&(v.styles.popper.maxHeight=`${R-10}px`,v.styles.popper.overflowY="auto",v.styles.popper.overflowX="hidden")}}]},content:y};e.target&&(g.triggerTarget=e.toggle?document.querySelector(e.toggle):l.value?.previousElementSibling),u.value=ns(S,g),l.value?.addEventListener("focusout",m)};return st(s,async()=>{if(await zt(),f(s)){f(u)&&Td(f(u));return}w()},{immediate:!0}),(S,y)=>s.value?(X(),Te(y_,{key:0,ref_key:"bottomDrawerRef",ref:a,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,"use-portal":"",onShow:y[0]||(y[0]=g=>r("showDrop")),onHide:y[1]||(y[1]=g=>r("hideDrop"))},{default:ve(()=>[Ue(S.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title"])):(X(),pe("div",{key:1,id:e.dropId,ref_key:"drop",ref:l,class:"oc-drop shadow-md/20 rounded-sm",onClick:d},[o.value&&S.$slots.default?(X(),Te(sd,{key:0,"body-class":[f(wx)(e.paddingSize)]},{default:ve(()=>[Ue(S.$slots,"default")]),_:3},8,["body-class"])):o.value?Ue(S.$slots,"special",{key:1}):Re("",!0)],8,JD))}}),eN=["type","disabled"],tN={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},nN=["textContent"],s0="file-copy",rN=_e({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,i=Tn("passwordInput"),{$gettext:o}=Ie.useGettext(),s=le(e.value),a=le(!1),l=le(s0),u=le(!1),c=B(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),p=B(()=>e.passwordPolicy?.missing(f(s))),d=g=>{const v={};for(let h=0;h<g.format.length;h++)v[`param${h+1}`]=g.format[h]?.toString();return o(g.message,v,!0)},m=()=>{navigator.clipboard.writeText(f(s)),l.value="check",setTimeout(()=>l.value=s0,1500)},b=()=>{const g=e.generatePasswordMethod();s.value=g,r("passwordGenerated",s.value)};return t({focus:()=>{f(i).focus()},select:()=>{f(i).select()},setSelectionRange:(g,v)=>{f(i).setSelectionRange(g,v)}}),st(s,g=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(g))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(g,v)=>{const h=Ee("oc-contextual-helper"),E=Ee("portal"),T=sn("oc-tooltip");return X(),pe(Be,null,[fe("div",{class:z.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":u.value,"border-role-outline":!u.value}])},[ot(fe("input",$t(g.$attrs,{ref_key:"passwordInput",ref:i,"onUpdate:modelValue":v[0]||(v[0]=R=>s.value=R),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:a.value?"text":"password",disabled:e.disabled,onFocus:v[1]||(v[1]=R=>u.value=!0),onBlur:v[2]||(v[2]=R=>u.value=!1)}),null,16,eN),[[yE,s.value]]),s.value&&!e.disabled?ot((X(),Te(wn,{key:0,"aria-label":a.value?f(o)("Hide password"):f(o)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:v[3]||(v[3]=R=>a.value=!a.value)},{default:ve(()=>[me(Pr,{size:"small",name:a.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[T,a.value?f(o)("Hide password"):f(o)("Show password")]]):Re("",!0),s.value&&!e.disabled?ot((X(),Te(wn,{key:1,"aria-label":f(o)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:m},{default:ve(()=>[me(Pr,{size:"small",name:l.value},null,8,["name"])]),_:1},8,["aria-label"])),[[T,f(o)("Copy password")]]):Re("",!0),e.generatePasswordMethod&&!e.disabled?ot((X(),Te(wn,{key:2,"aria-label":f(o)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:b},{default:ve(()=>[me(Pr,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[T,f(o)("Generate password")]]):Re("",!0)],2),c.value?(X(),Te(E,{key:0,to:"app.design-system.password-policy"},{default:ve(()=>[fe("div",tN,[(X(!0),pe(Be,null,mt(p.value.rules,(R,x)=>(X(),pe("div",{key:x,class:"flex items-center oc-text-input-password-policy-rule"},[me(Pr,{size:"small",class:"mr-1",name:R.verified?"checkbox-circle":"close-circle",color:R.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),fe("span",{class:z.normalizeClass([{"oc-text-input-danger":!R.verified}]),textContent:z.toDisplayString(d(R))},null,10,nN),R.helperMessage?(X(),Te(h,{key:0,text:R.helperMessage,title:f(o)("Password policy")},null,8,["text","title"])):Re("",!0)]))),128))])]),_:1})):Re("",!0)],64)}}}),iN=["for"],oN={key:0,class:"text-role-error","aria-hidden":"true"},sN=["id","textContent"],aN=["id","textContent"],lN=_e({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>ci("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,i=le(!1),o=B(()=>!!e.descriptionMessage),s=B(()=>e.fixMessageLine||f(i)||f(o)),a=B(()=>f(i).toString()),l=B(()=>`${e.id}-message`),u=B(()=>e.type==="password"?{passwordGenerated:v}:{}),c=Fl(),p=B(()=>{const R={};(f(i)||f(o))&&(R["aria-describedby"]=l.value),e.defaultValue&&(R.placeholder=e.defaultValue),e.type==="password"&&(R["password-policy"]=e.passwordPolicy,R["generate-password-method"]=e.generatePasswordMethod,R["has-error"]=f(i));const{change:x,input:A,focus:N,class:W,...O}=c;return{...O,...R}}),d=B(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),m=B(()=>e.clearButtonAccessibleLabel||"Clear input"),b=B(()=>e.type==="password"?rN:"input"),w=Tn("inputRef"),S=()=>{f(w).focus()};t({focus:S});function y(){S(),v(""),g(null)}const g=R=>{r("change",R)},v=R=>{r("update:modelValue",R)},h=async R=>{await zt(),f(w).select(),E(),r("focus",R.value)},E=()=>{e.selectionRange&&e.selectionRange.length>1&&f(w).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};st([()=>e.selectionRange,w],async()=>{f(w)&&(await zt(),E())},{immediate:!0});const T=Tt.debounce(()=>{i.value=!!e.errorMessage},e.errorMessageDebouncedTime);return st(()=>e.modelValue,()=>{T()}),st(()=>e.errorMessage,()=>{e.errorMessage?T():(i.value=!1,T.cancel?.())}),(R,x)=>(X(),pe("div",{class:z.normalizeClass([{"flex items-center":e.inlineLabel},R.$attrs.class])},[Ue(R.$slots,"label",{},()=>[fe("label",{class:z.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[kt(z.toDisplayString(e.label)+" ",1),e.requiredMark?(X(),pe("span",oN,"*")):Re("",!0)],10,iN)]),fe("div",{class:z.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(X(),Te(Pr,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):Re("",!0),(X(),Te(Pn(b.value),$t({id:e.id},p.value,{ref_key:"inputRef",ref:w,"aria-invalid":a.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!i.value,"pl-6":!!e.readOnly,"pr-6":d.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly},Os(u.value),{onChange:x[0]||(x[0]=A=>g(A.target.value)),onInput:x[1]||(x[1]=A=>v(A.target.value)),onPasswordChallengeCompleted:x[2]||(x[2]=A=>R.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:x[3]||(x[3]=A=>R.$emit("passwordChallengeFailed")),onFocus:x[4]||(x[4]=A=>h(A.target))}),null,16,["id","aria-invalid","class","type","value","disabled"])),d.value?(X(),Te(wn,{key:1,"aria-label":m.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:y},{default:ve(()=>[me(Pr,{name:"close",size:"small"})]),_:1},8,["aria-label"])):Re("",!0)],2),s.value?(X(),pe("div",{key:0,class:z.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":o.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":i.value}])},[i.value?(X(),pe(Be,{key:0},[i.value?(X(),Te(Pr,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):Re("",!0),i.value?(X(),pe("span",{key:1,id:l.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:z.toDisplayString(e.errorMessage)},null,8,sN)):Re("",!0)],64)):o.value?(X(),pe("span",{key:1,id:l.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:z.toDisplayString(e.descriptionMessage)},null,8,aN)):Re("",!0)],2)):Re("",!0),e.type==="password"?(X(),Te(f(fs.PortalTarget),{key:1,name:"app.design-system.password-policy"})):Re("",!0)],2))}});var cN=Object.defineProperty,a0=Object.getOwnPropertySymbols,uN=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,l0=(e,t,n)=>t in e?cN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dN=(e,t)=>{for(var n in t||(t={}))uN.call(t,n)&&l0(e,n,t[n]);if(a0)for(var n of a0(t))fN.call(t,n)&&l0(e,n,t[n]);return e};const c0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},pN={},hN={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},mN=fe("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),gN=[mN];function yN(e,t){return X(),pe("svg",hN,gN)}const vN=c0(pN,[["render",yN]]),bN={},wN={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},SN=fe("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),EN=[SN];function TN(e,t){return X(),pe("svg",wN,EN)}dN({},{Deselect:vN,OpenIndicator:c0(bN,[["render",TN]])});const AN=["aria-label","aria-live","aria-hidden","role"],xN=_e({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(X(),pe("span",{class:z.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,AN))}}),RN={class:"oc-status-indicators flex"},CN=["id","textContent"],kN=_e({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Ie.useGettext(),n=le({}),r=o=>Object.hasOwn(o,"handler"),i=o=>o.accessibleDescription?(f(n)[o.id]||(f(n)[o.id]=ci("oc-indicator-description-")),f(n)[o.id]):null;return(o,s)=>{const a=sn("oc-tooltip");return X(),pe("div",RN,[(X(!0),pe(Be,null,mt(e.indicators,(l,u)=>(X(),pe(Be,null,[r(l)&&!e.disableHandler?ot((X(),Te(wn,{id:l.id,key:`${l.id}-handler`,class:z.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),"aria-label":f(t)(l.label),"aria-describedby":i(l),appearance:"raw","data-testid":l.id,"data-test-indicator-type":l.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>l.handler?.(e.resource,c)},{default:ve(()=>[me(Pr,{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","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[a,f(t)(l.label)]]):ot((X(),Te(Pr,{id:l.id,key:l.id,tabindex:"-1",size:"small",class:z.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),name:l.icon,"fill-type":l.fillType,"accessible-label":f(t)(l.label),"aria-describedby":i(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,f(t)(l.label)]]),i(l)?(X(),pe("p",{id:i(l),key:i(l),class:"sr-only",textContent:z.toDisplayString(f(t)(l.accessibleDescription))},null,8,CN)):Re("",!0)],64))),256))])}}}),PN={class:"oc-thead border-b"},IN=_e({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(X(),pe("thead",PN,[Ue(t.$slots,"default")]))}}),ON=_e({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(X(),pe("tbody",null,[Ue(t.$slots,"default")]))}}),u0=Ye(_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;return(r,i)=>(X(),Te(Pn(e.type),{class:z.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:i[0]||(i[0]=o=>n("click",o))},{default:ve(()=>[Ue(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),f0=_e({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(X(),Te(u0,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:ve(()=>[Ue(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),d0=Ye(_e({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=a1((a,l)=>{let u;return{get(){return a(),u},set(c){u=c,l()}}}),i=B(()=>e.lazy?e.lazy.colspan:1),{isVisible:o}=e.lazy?yw({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},s=B(()=>!f(o));return e.lazy||n("itemVisible"),(a,l)=>(X(),pe("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?(X(),Te(f0,{key:0,colspan:i.value},{default:ve(()=>[...l[8]||(l[8]=[fe("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Ue(a.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),FN=Ye(_e({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(X(),Te(u0,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:ve(()=>[Ue(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),_N={key:0,class:"oc-table-thead-content inline-table align-middle"},DN=["textContent"],NN={key:1},LN={key:0,class:"oc-table-thead-content inline-table align-middle"},$N=["textContent"],MN={key:1,class:"oc-table-footer border-t"},BN={class:"oc-table-footer-row h-10.5"},jN=["colspan"],UN=Ye(_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:fx,EVENT_TROW_CLICKED:dx,EVENT_TROW_MOUNTED:px,EVENT_TROW_CONTEXTMENU:hx},{$gettext:i}=Ie.useGettext(),o=O=>e.itemDomSelector?e.itemDomSelector(O):O[e.idKey],s=B(()=>{const O=["oc-table"];return e.hover&&O.push("oc-table-hover"),e.sticky&&O.push("oc-table-sticky"),O}),a=B(()=>e.fields.length),l=O=>{O.preventDefault()},u=(O,D)=>{n(mx,[O,D])},c=(O,D)=>{n(um,[O,D])},p=(O,D,V)=>{n("dropRowStyling",O,D,V)},d=O=>O.type==="slot",m=O=>["callback","function"].indexOf(O.type)>=0,b=O=>Object.prototype.hasOwnProperty.call(O,"title")?O.title:O.name,w=()=>({class:s.value}),S=O=>{switch(e.paddingX){case"remove":return O==="right"?"pr-0":"pl-0";case"xsmall":return O==="right"?"pr-1":"pl-1";case"small":return O==="right"?"pr-2":"pl-2";case"medium":return O==="right"?"pr-4":"pl-4";case"large":return O==="right"?"pr-6":"pl-6";case"xlarge":return O==="right"?"pr-12":"pl-12";case"xxlarge":return O==="right"?"pr-24":"pl-24"}},y=(O,D)=>{const V=h(O);return V.class=`oc-table-header-cell oc-table-header-cell-${O.name}`,Object.prototype.hasOwnProperty.call(O,"thClass")&&(V.class+=` ${O.thClass}`),e.sticky&&(V.style=`top: ${e.headerPosition}px;`,V.class+=" z-10"),D===0&&(V.class+=` ${S("left")} `),D===e.fields.length-1&&(V.class+=` ${S("right")}`),A(V,O),V},g=(O,D)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${o(O)||D}`,E(O)?"oc-table-highlighted":void 0,...T(O)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),v=(O,D,V)=>{const L=h(O);return L.class=`oc-table-data-cell oc-table-data-cell-${O.name}`,Object.prototype.hasOwnProperty.call(O,"tdClass")&&(L.class+=` ${O.tdClass}`),Object.prototype.hasOwnProperty.call(O,"wrap")&&(L.wrap=O.wrap),D===0&&(L.class+=` ${S("left")} `),D===e.fields.length-1&&(L.class+=` ${S("right")}`),Object.prototype.hasOwnProperty.call(O,"accessibleLabelCallback")&&(L["aria-label"]=O.accessibleLabelCallback(V)),L},h=O=>({...O?.alignH&&{alignH:O.alignH},...O?.alignV&&{alignV:O.alignV},...O?.width&&{width:O.width},class:void 0,wrap:void 0,style:void 0}),E=O=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(O[e.idKey])>-1:e.highlighted===O[e.idKey]:!1,T=O=>e.disabled.length?e.disabled.indexOf(O[e.idKey])>-1:!1,R=(O,D,V)=>{const L=[V[e.idKey],D+1].filter(Boolean);return d(O)?[...L,O.name].join("-"):m(O)?[...L,O.callback(V[O.name])].join("-"):[...L,V[O.name]].join("-")},x=O=>i("Sort by %{ name }",{name:O}),A=(O,D)=>{if(!N(D))return;let V="none";e.sortBy===D.name&&(V=e.sortDir===pt.Asc?"ascending":"descending"),O["aria-sort"]=V},N=({sortable:O})=>!!O,W=O=>{if(!N(O))return;let D=e.sortDir;e.sortBy===O.name&&e.sortDir!==void 0&&(D=e.sortDir===pt.Desc?pt.Asc:pt.Desc),(e.sortBy!==O.name||e.sortDir===void 0)&&(D=O.sortDir||pt.Desc),n("sort",{sortBy:O.name,sortDir:D})};return(O,D)=>{const V=Ee("oc-icon");return X(),pe("table",$t(w(),{class:"has-item-context-menu"}),[e.hasHeader?(X(),Te(IN,{key:0},{default:ve(()=>[me(d0,{class:"oc-table-header-row h-10.5"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.fields,(L,te)=>(X(),Te(FN,$t({key:`oc-thead-${L.name}`},{ref_for:!0},y(L,te)),{default:ve(()=>[L.sortable?(X(),Te(wn,{key:0,"aria-label":x(L.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:Y=>W(L)},{default:ve(()=>[L.headerType==="slot"?(X(),pe("span",_N,[Ue(O.$slots,L.name+"Header",{},void 0,!0)])):(X(),pe("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:z.toDisplayString(b(L))},null,8,DN)),me(V,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:z.normalizeClass([{"sr-only":e.sortBy!==L.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(X(),pe("div",NN,[L.headerType==="slot"?(X(),pe("span",LN,[Ue(O.$slots,L.name+"Header",{},void 0,!0)])):(X(),pe("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:z.toDisplayString(b(L))},null,8,$N))]))]),_:2},1040))),128))]),_:3})]),_:3})):Re("",!0),me(ON,{class:"has-item-context-menu"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.data,(L,te)=>(X(),Te(d0,$t({key:`oc-tbody-tr-${o(L)||te}`,ref_for:!0,ref:`row-${te}`},{ref_for:!0},g(L,te),{"data-item-id":L[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:Y=>O.$emit(r.EVENT_TROW_CLICKED,[L,Y]),onContextmenu:Y=>O.$emit(r.EVENT_TROW_CONTEXTMENU,O.$refs[`row-${te}`][0],Y,L),onVnodeMounted:Y=>O.$emit(r.EVENT_TROW_MOUNTED,L,O.$refs[`row-${te}`][0]),onDragstart:Y=>u(L,Y),onDrop:Y=>c(L,Y),onDragenter:Wt(Y=>p(L,!1,Y),["prevent"]),onDragleave:Wt(Y=>p(L,!0,Y),["prevent"]),onDragover:D[0]||(D[0]=Y=>l(Y)),onItemVisible:Y=>O.$emit("itemVisible",L)}),{default:ve(()=>[(X(!0),pe(Be,null,mt(e.fields,(Y,se)=>(X(),Te(f0,$t({key:"oc-tbody-td-"+R(Y,se,L)},{ref_for:!0},v(Y,se,L)),{default:ve(()=>[d(Y)?Ue(O.$slots,Y.name,{key:0,item:L},void 0,!0):m(Y)?(X(),pe(Be,{key:1},[kt(z.toDisplayString(Y.callback(L[Y.name])),1)],64)):(X(),pe(Be,{key:2},[kt(z.toDisplayString(L[Y.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),O.$slots.footer?(X(),pe("tfoot",MN,[fe("tr",BN,[fe("td",{colspan:a.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Ue(O.$slots,"footer",{},void 0,!0)],8,jN)])])):Re("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),Ad=()=>{const{$gettext:e,$ngettext:t}=Ie.useGettext(),{showMessage:n,showErrorMessage:r}=nt(),{copy:i}=Yn.useClipboard(),o=({result:a,password:l})=>{const u=a.filter(pi);let c="";if(u.length){let d=e("Link has been created successfully");if(a.length===1)try{c=l?e("%{link} Password:%{password}",{link:u[0].value.webUrl,password:l},!0):u[0].value.webUrl,d=e("The link has been copied to your clipboard.")}catch(m){console.warn("Unable to copy link to clipboard",m)}n({title:t(d,"Links have been created successfully.",u.length)})}const p=a.filter(hi);return p.length&&r({errors:p.map(({reason:d})=>d),title:t("Failed to create link","Failed to create links",p.length)}),c};return{copyLink:async({createLinkHandler:a,password:l})=>{if(navigator.clipboard.write)await new Promise((u,c)=>{const p=new ClipboardItem({"text/plain":a().then(d=>{const m=o({result:d,password:l}),b=new Blob([m],{type:"text/plain"});return u(),b}).catch(d=>{throw c(),d})});navigator.clipboard.write([p])});else{const u=await a(),c=o({result:u,password:l});c&&i(c)}}}},Wa=()=>{const{$gettext:e}=Ie.useGettext(),t=en(),n=fn(),r=B(()=>n.can("create-all","PublicLink")),i=B(()=>bn.View),o=u=>u===bn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===bn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===bn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===bn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>f(r)?u?[bn.View,bn.Edit,bn.CreateOnly]:[bn.View,bn.Edit]:[],a=[{id:bn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:bn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:bn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:bn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:i,isPasswordEnforcedForLinkType:o,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:c})=>c===u)}},VN=_e({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Ie.useGettext(),{getLinkRoleByType:r}=Wa(),i=l=>e.modelValue===l,o=l=>{t("update:modelValue",l)},s=B(()=>n(r(e.modelValue)?.displayName)),a=Xt.v4();return{isSelectedType:i,updateSelectedType:o,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),qN=["textContent"],zN=["textContent"],WN={class:"flex items-center"},HN={class:"text-left"},KN=["textContent"],GN={class:"text-sm leading-4"},QN={class:"flex"};function XN(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-drop"),c=sn("oc-tooltip");return X(),pe(Be,null,[e.availableLinkTypeOptions.length>1?(X(),Te(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:ve(()=>[fe("span",{class:"link-current-role",textContent:z.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,qN),me(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((X(),pe("span",{key:1,class:"link-current-role mr-4",textContent:z.toDisplayString(e.currentLinkRoleLabel)},null,8,zN)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(X(),Te(u,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:ve(()=>[me(l,{class:"role-dropdown-list"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.availableLinkTypeOptions,(p,d)=>(X(),pe("li",{key:`role-dropdown-${d}`},[me(a,{id:`files-role-${e.getLinkRoleByType(p).id}`,class:z.normalizeClass([{selected:e.isSelectedType(p)},"p-2"]),appearance:e.isSelectedType(p)?"filled":"raw-inverse","color-role":e.isSelectedType(p)?"secondaryContainer":"surface","justify-content":"space-between",onClick:m=>e.updateSelectedType(p)},{default:ve(()=>[fe("span",WN,[me(s,{name:e.getLinkRoleByType(p).icon,class:"pl-2 pr-4"},null,8,["name"]),fe("span",HN,[fe("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:z.toDisplayString(e.$gettext(e.getLinkRoleByType(p).displayName))},null,8,KN),fe("span",GN,z.toDisplayString(e.$gettext(e.getLinkRoleByType(p).description)),1)])]),fe("span",QN,[e.isSelectedType(p)?(X(),Te(s,{key:0,name:"check"})):Re("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):Re("",!0)],64)}const p0=Ye(VN,[["render",XN]]),YN={class:"flex justify-between pb-2"},JN={key:0,class:"flex items-center"},ZN={key:1,class:"flex items-center"},e2={class:"flex flex-col"},t2=["textContent"],n2=["textContent"],r2=["textContent"],i2={class:"mb-4 ml-[30px]"},o2={key:1,class:"text-sm text-role-on-surface-variant"},s2=["textContent"],a2=["textContent"],l2={class:"flex justify-end items-center mt-2"},c2={class:"sr-only"},h0=_e({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Ke(),r=Ie.useGettext(),{$gettext:i}=r,{removeModal:o}=ht(),{copyLink:s}=Ad(),a=H0(),{isEnabled:l,postMessage:u}=Qr(),{defaultLinkType:c,getAvailableLinkTypes:p,getLinkRoleByType:d,isPasswordEnforcedForLinkType:m}=Wa(),{addLink:b}=Cr(),w=cr(),{currentTheme:S}=Me.storeToRefs(w),y=le(!1),g=le(!1),v=B(()=>e.resources.every(({isFolder:F})=>F)),h=B(()=>f(l)?i("Share link(s)"):i("Copy link")),E=B(()=>f(l)?i("Share link(s) and password(s)"):i("Copy link and password")),T=le(Xt.v4()),R=le({}),x=le(),A=yl({value:"",error:void 0}),N=le(f(c)),W=B(()=>i(d(f(N)).description)),O=B(()=>i(d(f(N)).displayName)),D=B(()=>d(f(N)).icon),V=B(()=>p({isFolder:f(v)})),L=B(()=>m(f(N))),te=a.getPolicy({enforcePassword:f(L)}),Y=()=>{y.value=!0},se=({date:F,error:C})=>{x.value=F,g.value=C},he=()=>Promise.allSettled(e.resources.map(F=>b({clientService:n,space:e.space,resource:F,options:{type:f(N),"@libre.graph.quickLink":!1,password:f(A).value,expirationDateTime:f(x)?.toISO(),displayName:i("Unnamed link")}}))),ae=B(()=>te.check(f(A).value)),we=B(()=>!f(ae)||f(g)),Q=async()=>{const F=await he(),C=[],q=F.filter(hi);return q.length&&q.map(({reason:K})=>K).forEach(K=>{if(console.error(K),K.response?.status===400){const j=K.response.data.error;j.message=Tt.upperFirst(j.message),C.push(j)}}),C.length?(A.error=i(C[0].message),Promise.reject()):F};t({onConfirm:async(F={})=>{if(f(l)){const q=(await Q()).filter(pi);q.length&&(u("opencloud-embed:share",q.map(({value:K})=>K.webUrl)),u("opencloud-embed:share-links",q.map(({value:K})=>({url:K.webUrl,...F.copyPassword&&{password:f(A).value}})))),o(e.modal.id);return}await s({createLinkHandler:Q,password:F.copyPassword?f(A).value:void 0}),o(e.modal.id)}});const ce=F=>{A.value=F,A.error=void 0},Ae=F=>{N.value=F},ee=()=>a.generatePassword();return Lt(()=>{const F=f(R)[f(N)];F&&F.$el.focus(),f(L)&&(A.value=a.generatePassword())}),(F,C)=>{const q=Ee("oc-icon"),K=Ee("oc-text-input"),j=Ee("oc-datepicker"),H=Ee("oc-list"),ge=Ee("oc-drop");return X(),pe(Be,null,[fe("div",YN,[y.value?(X(),pe("div",JN,[me(q,{class:"mr-2",name:D.value,"fill-type":"line"},null,8,["name"]),me(p0,{"model-value":N.value,"available-link-type-options":V.value,"onUpdate:modelValue":Ae},null,8,["model-value","available-link-type-options"])])):(X(),pe("div",ZN,[me(q,{class:"mr-2",name:D.value,"fill-type":"line"},null,8,["name"]),fe("div",e2,[fe("span",{class:"font-semibold",textContent:z.toDisplayString(O.value)},null,8,t2),fe("span",{class:"text-sm",textContent:z.toDisplayString(W.value)},null,8,n2)])])),y.value?Re("",!0):(X(),Te(f(wn),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:C[0]||(C[0]=xe=>Y())},{default:ve(()=>[me(q,{name:"settings-3",size:"small","fill-type":"fill"}),fe("span",{textContent:z.toDisplayString(f(i)("Options"))},null,8,r2)]),_:1}))]),fe("div",i2,[y.value?(X(),Te(K,{key:T.value,"model-value":A.value,type:"password","password-policy":f(te),"generate-password-method":ee,"error-message":A.error,label:f(i)("Password"),"required-mark":L.value,class:"link-modal-password-input","onUpdate:modelValue":ce},null,8,["model-value","password-policy","error-message","label","required-mark"])):A.value?(X(),pe("div",o2,[fe("span",{textContent:z.toDisplayString(f(i)("Password:"))},null,8,s2),fe("span",{textContent:z.toDisplayString(A.value)},null,8,a2)])):Re("",!0),y.value?(X(),Te(j,{key:2,class:"mt-2","min-date":f(Ut.DateTime).now(),label:f(i)("Expiry date"),"is-dark":f(S).isDark,onDateChanged:se},null,8,["min-date","label","is-dark"])):Re("",!0)]),fe("div",l2,[me(f(wn),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:C[1]||(C[1]=xe=>F.$emit("cancel"))},{default:ve(()=>[kt(z.toDisplayString(f(i)("Cancel")),1)]),_:1}),fe("div",{class:z.normalizeClass(["ml-2",{"oc-button-group":A.value}])},[me(f(wn),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:we.value,onClick:C[2]||(C[2]=xe=>F.$emit("confirm"))},{default:ve(()=>[kt(z.toDisplayString(h.value),1)]),_:1},8,["disabled"]),A.value?(X(),Te(f(wn),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:we.value,"aria-label":f(i)("More options")},{default:ve(()=>[me(q,{size:"small",name:"arrow-down-s"}),fe("span",c2,z.toDisplayString(f(i)("More options")),1)]),_:1},8,["disabled","aria-label"])):Re("",!0),A.value?(X(),Te(ge,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:f(i)("More options"),"close-on-click":""},{default:ve(()=>[me(H,null,{default:ve(()=>[fe("li",null,[me(f(wn),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:C[3]||(C[3]=xe=>F.$emit("confirm",{copyPassword:!0}))},{default:ve(()=>[kt(z.toDisplayString(E.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):Re("",!0)],2)])],64)}}}),u2=({enforceModal:e=!1}={})=>{const t=Ke(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=en(),s=fn(),a=gn(),{defaultLinkType:l}=Wa(),{addLink:u}=Cr(),{dispatchModal:c}=ht(),{copyLink:p}=Ad(),d=({space:w,resources:S})=>{const y=o.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||y){c({title:i("Copy link for »%{resourceName}«","Copy links for the selected items",S.length,{resourceName:S[0].name}),customComponent:h0,customComponentAttrs:()=>({space:w,resources:S}),hideActions:!0});return}const g=S.map(h=>u({clientService:t,space:w,resource:h,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:f(l)}}));p({createLinkHandler:()=>a.addTask(()=>Promise.allSettled(g))})},m=({resources:w})=>{if(!w.length)return!1;for(const S of w)if(!S.canShare({user:n.user,ability:s})||re.isProjectSpaceResource(S)&&S.disabled)return!1;return!0};return{actions:B(()=>[{name:"create-links",icon:"link",handler:d,label:()=>r("Create links"),isVisible:m,class:"oc-files-actions-create-links"}])}},f2=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=nt(),r=vt(),{$gettext:i}=Ie.useGettext(),{dispatchModal:o}=ht(),s=ar(),{isEnabled:a}=Qr(),{openEditor:l}=Xn(),u=Ke(),c=ze(),{resources:p,currentFolder:d,areFileExtensionsShown:m}=Me.storeToRefs(c),{isFileNameValid:b}=Ei(),w=B(()=>s.fileExtensions.filter(({newFileMenu:v})=>!!v)),S=(v,h)=>(c.upsertResource(v),l(h,f(e),v)),y=(v,h,E)=>{let T=i("New file")+`.${h}`;f(p).some(x=>x.name===T)&&(T=zn(T,h,f(p))),m.value||(T=re.extractNameWithoutExtension({name:T,extension:h}));const R=m.value?[0,T.length-(h.length+1)]:null;o({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:T,inputLabel:i("File name"),inputRequiredMark:!0,inputSelectionRange:R,onConfirm:async x=>{m.value||(x=`${x}.${h}`);try{let A;if(E.createFileHandler)A=await E.createFileHandler({fileName:x,space:f(e),currentFolder:f(d)});else if(E.type==="folder"){const N=ft.join(f(d).path,x);A=await u.webdav.createFolder(f(e),{path:N})}else{const N=ft.join(f(d).path,x);A=await u.webdav.putFileContents(f(e),{path:N})}return c.upsertResource(A),t({title:i("»%{fileName}« was created successfully",{fileName:A.name})}),f(a)?void 0:S(A,E)}catch(A){console.error(A),n({title:i("Failed to create file"),errors:[A]})}},onInput:(x,A)=>{const N=m.value?x:`${x}.${h}`,W={path:ft.join(f(d).path,N),name:N,extension:h},{isValid:O,error:D}=b(W,N);A(O?null:D)}})};return{actions:B(()=>{const v=[],h={};for(const E of f(w)||[])E.hasPriority?h[E.extension]=E:h[E.extension]=h[E.extension]||E;for(const[,E]of Object.entries(h))v.push({name:"create-new-file",icon:"add",handler:T=>y(T,E.extension,E),label:()=>i(E.newFileMenu.menuTitle()),isVisible:()=>f(d)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:E.app?.startsWith("external-")});return v}),openFile:S}},m0=()=>{const e=tn("scrollTo"),t=tn("details"),n=ze(),r=B(()=>Ct(f(e))),i=B(()=>Ct(f(t))),o=(a,l={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Je.publish("app.files.navigate.page",{resourceId:a,forceScroll:l.forceScroll,topbarElement:l.topbarElement});return}const p=document.getElementById(l.topbarElement)?.offsetHeight||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<p||l.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Je.subscribe("app.files.navigate.scrollTo",a=>o(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:o,scrollToResourceFromRoute:(a,l)=>{if(!f(r)||!a.length)return;const u=f(a).find(c=>re.isIncomingShareResource(c)?c.remoteItemId===f(r):c.id===f(r));u&&u.processing!==!0&&(n.setSelection([u.id]),o(u.id,{forceScroll:!0,topbarElement:l}),f(i)&&Je.publish(Rt.openWithPanel,f(i)))}}},d2=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=nt(),{dispatchModal:r}=ht(),{$gettext:i}=Ie.useGettext(),{scrollToResource:o}=m0(),s=ze(),{resources:a,currentFolder:l}=Me.storeToRefs(s),u=Ke(),{isFileNameValid:c}=Ei(),p=async b=>{b=b.trimEnd();try{const w=ft.join(f(l).path,b),S=await u.webdav.createFolder(f(e),{path:w});re.isShareSpaceResource(f(e))&&(S.remoteItemId=f(e).id),s.upsertResource(S),t({title:i("»%{folderName}« was created successfully",{folderName:b})}),await zt(),o(S.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(w){console.error(w),n({title:i("Failed to create folder"),errors:[w]})}},d=()=>{let b=i("New folder");f(a).some(w=>w.name===b)&&(b=zn(b,"",f(a))),r({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:b,inputLabel:i("Folder name"),inputRequiredMark:!0,onConfirm:p,onInput:(w,S)=>{const y={path:ft.join(f(l).path,w),name:w,isFolder:!0},{isValid:g,error:v}=c(y,w,f(a));return S(g?null:v)}})};return{actions:B(()=>[{name:"create-folder",icon:"folder",handler:d,label:()=>i("New Folder"),isVisible:()=>f(l)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:p}},p2="rowMounted",h2="fileDropped",m2="contextmenuClicked";class rs{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class g2{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const xd=10,y2=63,Rd=256;class v2{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){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 g0{targets;intersectionObserver;options;constructor(t={}){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 v2(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 is=_e({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},i={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"resource-type-file",color:"var(--oc-role-on-surface)"},s=Th(),a=wr(Eh),l=B(()=>e.resource.extension?!1:e.resource.type==="folder"||e.resource.isFolder),u=B(()=>e.resource.type==="space"),c=B(()=>re.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),p=B(()=>re.isPersonalSpaceResource(e.resource)),d=B(()=>e.resource.extension?.toLowerCase()),m=B(()=>e.resource.mimeType?.toLowerCase()),b=B(()=>{if(f(p))return n;if(f(c))return i;if(f(u))return r;if(f(l))return t;const w=s[f(d)]||a?.mimeType[f(m)]||a?.extension[f(d)];return{...o,...w}});return(w,S)=>{const y=Ee("oc-icon");return X(),Te(y,{key:`resource-icon-${b.value.name}`,name:b.value.name,color:b.value.color,size:e.size,class:z.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!u.value&&!l.value}])},null,8,["name","color","size","class"])}}}),b2={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=dt(),{options:n}=Me.storeToRefs(t);return{linkTarget:B(()=>f(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},w2={key:1};function S2(e,t,n,r,i,o){return n.isResourceClickable?(X(),Te(Pn(o.isNavigatable?"router-link":"oc-button"),{key:0,to:o.isNavigatable?n.link:void 0,target:o.isNavigatable?e.linkTarget:void 0,rel:o.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:o.isNavigatable?void 0:"raw","gap-size":o.isNavigatable?void 0:"none","justify-content":o.isNavigatable?void 0:"left",type:o.isNavigatable?void 0:"button","no-hover":o.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=Wt(()=>{},["prevent","stop"])),onClick:o.emitClick},{default:ve(()=>[Ue(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(X(),pe("span",w2,[Ue(e.$slots,"default",{},void 0,!0)]))}const Ha=Ye(b2,[["render",S2],["__scopeId","data-v-15d92dd6"]]),E2=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],T2={key:0,class:"truncate leading-4"},A2=["textContent"],x2=["textContent"],R2=["textContent"],Cd=_e({__name:"ResourceName",props:{name:{},type:{},fullPath:{},pathPrefix:{default:""},extension:{default:""},isPathDisplayed:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},truncateName:{type:Boolean,default:!0}},setup(e){const t=B(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=B(()=>e.extension?"."+e.extension:""),r=B(()=>{if(!e.isPathDisplayed)return null;const a=e.fullPath.replace(/^\//,"").split("/");return a.length<2?null:a.length===2?a[0]+"/":`…/${a[a.length-2]}/`}),i=B(()=>!e.isPathDisplayed||f(r)===e.fullPath?null:e.pathPrefix?Bl.join(e.pathPrefix,e.fullPath):e.fullPath),o=B(()=>{if(!f(i))return e.isExtensionDisplayed?`${f(t)}${f(n)}`:f(t)}),s=B(()=>(f(r)||"")+e.name);return(a,l)=>{const u=sn("oc-tooltip");return ot((X(),pe("span",{class:z.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":s.value,"data-test-resource-type":e.type,title:o.value},[e.truncateName?(X(),pe("span",T2,[fe("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:z.toDisplayString(t.value)},null,8,A2)])):(X(),pe("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:z.toDisplayString(t.value)},null,8,x2)),e.extension&&e.isExtensionDisplayed?(X(),pe("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:z.toDisplayString(n.value)},null,8,R2)):Re("",!0)],10,E2)),[[u,i.value]])}}}),C2={class:"flex"},k2=["textContent"],os=_e({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=Ie.useGettext(),i=B(()=>e.parentFolderLink?"router-link":"span"),o=B(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),s=B(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),a=B(()=>e.resource.thumbnail),l=B(()=>e.resource.locked?r("This item is locked"):null),u=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,p)=>{const d=Ee("oc-image"),m=Ee("oc-icon"),b=sn("oc-tooltip");return X(),pe("div",{class:z.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?ot((X(),Te(Ha,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:z.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?f(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:u},{default:ve(()=>[s.value?ot((X(),Te(d,{key:a.value,src:a.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":l.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[b,l.value]]):ot((X(),Te(is,{key:1,"aria-label":l.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[b,l.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[b,e.isResourceClickable?l.value:void 0]]):Re("",!0),fe("div",{class:z.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[me(Ha,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:z.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:u},{default:ve(()=>[(X(),Te(Cd,{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","class"]),fe("div",C2,[e.isPathDisplayed?(X(),Te(Pn(i.value),{key:0,to:e.parentFolderLink,class:z.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:ve(()=>[me(m,$t(o.value,{class:"mr-1"}),null,16),fe("span",{class:"text truncate text-sm hover:underline",textContent:z.toDisplayString(e.parentFolderName)},null,8,k2)]),_:1},8,["to","class"])):Re("",!0)])],2)],2)}}}),y0=_e({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new g0,{triggerDefaultAction:n}=Xn(),{getMatchingSpace:r}=ln(),{getDefaultAction:i}=Xn(),{loadPreview:o}=Nd(),s=Tn("resourceListItem"),{getPathPrefix:a,getParentFolderName:l,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:p}=Yr(),d=ze(),m=le(),b=B(()=>d.areFileExtensionsShown),w=B(()=>({...e.searchResult.data,...f(m)&&{thumbnail:f(m)}})),S=B(()=>r(f(w))),y=B(()=>{const x=f(w);return re.isSpaceResource(x)&&x.disabled===!0}),g=()=>{n({space:f(S),resources:[f(w)]})},v=B(()=>e.isClickable?{parentFolderLink:u(f(w)),onClick:g}:{isResourceClickable:!1}),h=B(()=>{if(f(w).isFolder)return p(f(w));const x=i({resources:[f(w)],space:f(S)});if(!x?.route)return null;const A=x.route({space:f(S),resources:[f(w)]});return A.query={...A.query,contextRouteQuery:{...A.query?.contextRouteQuery||{},term:e.term}},A}),E=a(f(w)),T=l(f(w)),R=c(f(w));return Lt(()=>{f(y)&&f(s).parentElement.classList.add("disabled");const x=async()=>{const N=await o({space:f(S),resource:f(w),dimensions:rs.Thumbnail,cancelRunning:!0,updateStore:!1});N&&(m.value=N)},A=Tt.debounce(({unobserve:N})=>{N(),x()},250);t.observe(f(s).$el,{onEnter:A,onExit:A.cancel})}),An(()=>{t.disconnect()}),(x,A)=>(X(),Te(os,$t({ref_key:"resourceListItem",ref:s,resource:w.value,"path-prefix":f(E),"is-path-displayed":!0,link:h.value,"is-extension-displayed":b.value,"parent-folder-link-icon-additional-attributes":f(R),"parent-folder-name":f(T),"is-thumbnail-displayed":!!m.value},v.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),P2=7,I2=200,O2=_e({name:"CreateShortcutModal",components:{ResourcePreview:y0},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ke(),{$gettext:i}=Ie.useGettext(),{showMessage:o,showErrorMessage:s}=nt(),a=He(),{search:l}=Zf(),{getPathPrefix:u,getParentFolderName:c,getParentFolderLink:p,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:m}=Yr(),b=ze(),{resources:w,currentFolder:S}=Me.storeToRefs(b),y=Tn("dropRef"),g=le(""),v=le(""),h=le(null),E=le(null),T=le(!1);let R;const x=q=>{const K=q.trim();return L(K)?K:`https://${K}`},A=B(()=>x(f(g))),N=B(()=>!!f(w).find(q=>q.name===`${f(v)}.url`)),W=B(()=>f(N)||!f(v)||!f(g));st(W,()=>{t("update:confirmDisabled",f(W))},{immediate:!0});const O=B(()=>f(N)?i("»%{name}« already exists",{name:`${f(v)}.url`}):/[/]/.test(f(v))?i('Shortcut name cannot contain "/"'):""),D=rn.useTask(function*(q,K){h.value=null,K=`name:"*${K}*" NOT name:"*.url"`;try{h.value=yield l(K,P2)}catch{}}),V=Tt.debounce(()=>{D.perform(f(g))},I2),L=q=>["http://","https://"].some(j=>j.startsWith(q)||q.startsWith(j)),te=()=>{h.value=null,g.value=f(A);try{let q=new URL(f(A)).host;f(w).some(K=>K.name===`${q}.url`)&&(q=zn(`${q}.url`,"url",f(w)).slice(0,-4)),v.value=q}catch{}},Y=q=>{h.value=null;const K=new URL(window.location.href);let j=q.data.name;g.value=`${K.origin}/f/${q.id}`,f(w).some(H=>H.name===`${j}.url`)&&(j=zn(`${j}.url`,"url",f(w)).slice(0,-4)),v.value=j},se=q=>f(E)===q,he=(q=!1)=>{const K=Array.from(document.querySelectorAll("li.selectable-item"));let j=f(E)!==null?f(E):q?K.length:-1;const H=q?-1:1;do if(j+=H,j<0||j>K.length-1)return null;while(K[j].classList.contains("disabled"));return j},ae=()=>{E.value=he(!0)},we=()=>{E.value=he(!1)},Q=q=>{f(T)&&(q.stopPropagation(),f(y).hide())},ie=q=>{f(T)&&(q.stopPropagation(),f(E)!==null&&(f(E)===0?te():Y(f(h)?.values?.[f(E)-1]),f(y).hide()))},ce=()=>{T.value=!1,E.value=null},Ae=()=>{T.value=!0,E.value=0},ee=()=>{g.value.trim().length&&f(y).show()},F=async()=>{if(await zt(),v.value=g.value.trim(),!g.value.trim().length){f(y).hide();return}f(y).show(),_n(a,"files-public-link")||V()},C=async()=>{try{const K=`[InternetShortcut]
64
- URL=${Gd.sanitize(x(f(g)),{USE_PROFILES:{html:!0}})}`,j=re.urlJoin(f(S).path,`${f(v)}.url`),H=await r.webdav.putFileContents(e.space,{path:j,content:K});b.upsertResource(H),o({title:i("Shortcut was created successfully")})}catch(q){console.error(q),s({title:i("Failed to create shortcut"),errors:[q]})}};return Lt(async()=>{await zt(),R=new Qd(f(y)?.$refs?.drop)}),st(h,async()=>{await zt(),!(!f(T)||!R)&&(R.unmark(),R.mark(f(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),st(E,()=>{if(!f(T)||typeof f(y)?.$el?.scrollTo!="function")return;const q=f(y).$el.querySelectorAll(".selectable-item");q[f(E)]&&f(y).$el.scrollTo(0,f(E)===null?0:q[f(E)].getBoundingClientRect().y-q[f(E)].getBoundingClientRect().height)}),n({onConfirm:C}),{inputUrl:g,inputFilename:v,dropRef:y,dropItemUrl:A,searchResult:h,confirmButtonDisabled:W,inputFileNameErrorMessage:O,searchTask:D,dropItemUrlClicked:te,dropItemResourceClicked:Y,getPathPrefix:u,getFolderLink:m,getParentFolderLink:p,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:ie,onKeyDownDrop:we,onKeyUpDrop:ae,onKeyEscDrop:Q,onHideDrop:ce,onShowDrop:Ae,onInputUrlInput:F,onClickUrlInput:ee,isDropItemActive:se,onConfirm:C}}}),F2={class:"flex items-center mb-1"},_2={for:"create-shortcut-modal-url-input"},D2=["textContent"],N2={key:0,class:"p-1 flex justify-center"},L2={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},$2=["textContent"],M2={key:0,class:"flex w-full mt-4"},B2={class:"flex items-center mb-1"},j2={for:"create-shortcut-modal-filename-input"};function U2(e,t,n,r,i,o){const s=Ee("oc-contextual-helper"),a=Ee("oc-text-input"),l=Ee("oc-icon"),u=Ee("oc-button"),c=Ee("oc-spinner"),p=Ee("resource-preview"),d=Ee("oc-list"),m=Ee("oc-drop");return X(),pe(Be,null,[me(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=b=>e.inputUrl=b),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[bo(e.onKeyUpDrop,["up"]),bo(e.onKeyDownDrop,["down"]),bo(e.onKeyEscDrop,["esc"]),bo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:ve(()=>[fe("div",F2,[fe("label",_2,[kt(z.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=fe("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),me(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:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),me(m,{ref:"dropRef",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:ve(()=>[me(d,null,{default:ve(()=>[fe("li",{class:z.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[me(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:ve(()=>[me(l,{name:"external-link"}),fe("span",{textContent:z.toDisplayString(e.dropItemUrl)},null,8,D2)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(X(),pe("li",N2,[me(c)])):Re("",!0),e.searchResult?.values?.length?(X(),pe(Be,{key:1},[fe("li",L2,[fe("span",{textContent:z.toDisplayString(e.$gettext("Link to a file"))},null,8,$2)]),(X(!0),pe(Be,null,mt(e.searchResult.values,(b,w)=>(X(),pe("li",{key:w,class:z.normalizeClass(["selectable-item",{active:e.isDropItemActive(w+1)}])},[me(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:S=>e.dropItemResourceClicked(b)},{default:ve(()=>[me(p,{"search-result":b,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Re("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(X(),pe("div",M2,[me(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=b=>e.inputFilename=b),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:ve(()=>[fe("div",B2,[fe("label",j2,[kt(z.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=fe("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),me(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):Re("",!0)],64)}const v0=Ye(O2,[["render",U2]]),V2=({space:e})=>{const{dispatchModal:t}=ht(),{$gettext:n}=Ie.useGettext(),r=ze(),{currentFolder:i}=Me.storeToRefs(r);return{actions:B(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:v0,customComponentAttrs:()=>({space:f(e)})})},label:()=>n("New Shortcut"),isVisible:()=>f(i)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},kd=()=>{const{showMessage:e,showErrorMessage:t}=nt(),{can:n}=fn(),{$gettext:r,$ngettext:i}=Ie.useGettext(),{createSpace:o}=Qi(),s=Ke(),a=He(),l=B(()=>n("create-all","Drive")),{dispatchModal:u}=ht(),c=dt(),p=at(),d=ze(),{isSpaceNameValid:m}=Ei(),b=async({spaceName:y,resources:g,space:v})=>{const{webdav:h}=s,E=new Lr({concurrency:c.options.concurrentRequests.resourceBatchActions}),T=[];try{const R=await o(y);p.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await h.listFiles(v,{path:g[0].path})).children);for(const x of g)T.push(E.add(()=>h.copyFiles(v,x,R,{path:x.name})));await Promise.all(T),d.resetSelection(),e({title:r("Space was created successfully")})}catch(R){console.error(R),t({title:r("Creating space failed…"),errors:[R]})}},w=({resources:y,space:g})=>{u({title:i("Create Space from »%{resourceName}«","Create Space from selection",y.length,{resourceName:y[0].name}),message:i("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",y.length,{resourceName:y[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"),inputRequiredMark:!0,onInput:(v,h)=>{const{isValid:E,error:T}=m(v);h(E?null:T)},onConfirm:v=>b({spaceName:v,space:g,resources:y})})};return{actions:B(()=>[{name:"create-space-from-resource",icon:"function",handler:w,label:()=>r("Create Space from selection"),isVisible:({resources:y,space:g})=>!(!y.length||!f(l)||!xt(a,"files-spaces-generic")||!re.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},ss=()=>{const e=vt(),t=en(),{displayDialog:n,filesList_delete:r}=D0(),{$gettext:i}=Ie.useGettext();return{actions:B(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({resources:s})=>{r(s)},isVisible:({resources:s})=>s.length?s.every(a=>a.canBeDeleted()&&!re.isSpaceResource(a)&&!re.isIncomingShareResource(a)&&!re.isTrashResource(a)&&!a.isShareRoot()):!1,isDisabled:({resources:s})=>s.length===1&&s[0].locked,disabledTooltip:()=>i("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:s,resources:a})=>{n(s,a)},isVisible:({space:s,resources:a})=>!a.length||!t.filesPermanentDeletion||re.isProjectSpaceResource(s)&&!s.canDeleteFromTrashBin({user:e.user})?!1:a.every(re.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Ka=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=He(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=Ke(),s=gn(),a=dt(),{updateResourceField:l}=ze(),u=async({resources:p})=>{const d=[],m=[],b=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(p.forEach(w=>{m.push(b.add(async()=>{try{const{graphAuthenticated:S}=o;await S.driveItems.deleteDriveItem(w.driveId,w.id),l({id:w.id,field:"syncEnabled",value:!1})}catch(S){console.error(S),d.push(S)}}))}),await Promise.all(m),d.length===0){xt(n,"files-spaces-generic")&&(e({title:i("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",p.length)}),n.push(Fn("files-shares-with-me")));return}t({title:i("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",p.length),errors:d})};return{actions:B(()=>[{name:"disable-sync",icon:"spam-3",handler:p=>s.addTask(()=>u(p)),label:()=>r("Disable sync"),isVisible:({space:p,resources:d})=>!Mt(n,"files-shares-with-me")&&!xt(n,"files-spaces-generic")||d.length===0||xt(n,"files-spaces-generic")&&(p?.driveType!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},b0=()=>Ar("$archiverService"),Ga=()=>{const{showErrorMessage:e}=nt(),t=He(),n=b0(),{$ngettext:r,$gettext:i,current:o}=Ie.useGettext(),s=li(),a=_r(),l=({space:p,resources:d})=>(d.length>1&&(d=d.filter(m=>m.canDownload()&&!re.isProjectSpaceResource(m))),n.triggerDownload({fileIds:d.map(m=>m.fileId),...p&&re.isPublicSpaceResource(p)&&{publicToken:p.id,publicLinkPassword:s.publicLinkPassword}}).catch(m=>{console.error(m),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",d.length),errors:[m]})})),u=p=>{const d=f(n.capability);return d?p.reduce((b,w)=>b+parseInt(`${w.size}`),0)>parseInt(d.max_size):void 0};return{actions:B(()=>[{name:"download-archive",icon:"inbox-archive",handler:p=>{l(p)},label:()=>i("Download"),disabledTooltip:({resources:p})=>u(p)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:vn(f(n.capability).max_size,o)}):"",isDisabled:({resources:p})=>u(p),isVisible:({resources:p})=>f(a)&&!xt(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!Vt(t,"files-common-favorites")&&!Vt(t,"files-common-search")&&!Mt(t,"files-shares-with-me")&&!Mt(t,"files-shares-with-others")&&!Mt(t,"files-shares-via-link")&&!Vt(t,"files-common-search")||!f(n.available)||p.length===0||p.length===1&&!p[0].isFolder||p.length>1&&p.every(m=>re.isProjectSpaceResource(m))||re.isProjectSpaceResource(p[0])&&p[0].disabled?!1:!p.some(m=>!m.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},w0=e=>{const{showErrorMessage:t}=nt(),n=e?.clientService||Ke(),{$gettext:r}=Ie.useGettext(),i=vt();return{downloadFile:async(s,a,l=null)=>{try{const u=await n.webdav.getFileUrl(s,a,{version:l,username:i.user?.onPremisesSamAccountName});fc(u,a.name)}catch(u){console.error(u),t({title:r("Download failed"),desc:r("File could not be located"),errors:[u]})}}}},as=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=_r(),r=Za(),{downloadFile:i}=w0(),o=({space:a,resources:l})=>{i(a,l[0])};return{actions:B(()=>[{name:"download-file",icon:"file-download",handler:o,label:()=>t("Download"),isVisible:({resources:a})=>f(n)&&!f(r)&&!xt(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!Vt(e,"files-common-favorites")&&!Vt(e,"files-common-search")&&!Mt(e,"files-shares-with-me")&&!Mt(e,"files-shares-with-others")&&!Mt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},q2=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),r=en(),{$gettext:i}=Ie.useGettext(),o=Ke(),{dispatchModal:s}=ht(),a=ze(),l=at(),u=gn(),c=async({space:m})=>{try{await o.webdav.clearTrashBin(m),e({title:i("All deleted files were removed")}),a.resetSelection(),l.updateSpaceField({id:m.id,field:"hasTrashedItems",value:!1}),a.resources.some(re.isTrashResource)&&a.clearResources()}catch(b){console.error(b),t({title:i("Failed to empty trash bin"),errors:[b]})}},p=({resources:m})=>{s({title:i("Empty trash bin for »%{name}«",{name:m[0].name}),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:m[0].name}),hasInput:!1,onConfirm:()=>u.addTask(()=>c({space:m[0]}))})};return{actions:B(()=>[{name:"empty-trash-bin",icon:({resources:m})=>m[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>i("Empty trash bin"),handler:p,isVisible:({resources:m})=>m.length!==1||!r.filesPermanentDeletion||!re.isSpaceResource(m[0])?!1:m[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:m})=>!m[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},Qa=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=He(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=Ke(),s=gn(),a=dt(),l=ze(),{updateResourceField:u}=l,c=async({resources:d})=>{const m=[],b=[],w=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(S=>{b.push(w.add(async()=>{try{const{graphAuthenticated:y}=o;await y.driveItems.createDriveItem(S.driveId,{name:S.name,remoteItem:{id:S.fileId}}),u({id:S.id,field:"syncEnabled",value:!0})}catch(y){console.error(y),m.push(y)}}))}),await Promise.all(b),m.length===0){l.resetSelection(),xt(n,"files-spaces-generic")&&e({title:i("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:i("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:m})};return{actions:B(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>c(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:m})=>!Mt(n,"files-shares-with-me")&&!xt(n,"files-spaces-generic")||m.length===0||xt(n,"files-spaces-generic")&&(f(d)?.driveType!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(b=>!b.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},Pd=()=>{const{showErrorMessage:e}=nt(),t=en(),n=He(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=_r(),s=fn(),a=ze(),l=ur(),u=async({space:p,resources:d})=>{try{const m=!d[0].starred;await i.webdav.setFavorite(p,d[0],m),a.updateResourceField({id:d[0].id,field:"starred",value:m}),m||l.publish("app.files.list.removeFromFavorites",d[0].id)}catch(m){const b=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:b,errors:[m]})}};return{actions:B(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:p})=>p[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:p})=>f(o)&&!xt(n,"files-spaces-generic")&&!Vt(n,"files-common-favorites")||p.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function z2(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const Xa=()=>{const e=He(),{cutResources:t}=Uo(),n=Ie.useGettext(),{$gettext:r}=n,i=ze(),{currentFolder:o}=Me.storeToRefs(i),s=B(()=>jo()?r("⌘ + X"):r("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:B(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:f(s),label:()=>r("Cut"),isVisible:({resources:u})=>!xt(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!Vt(e,"files-common-favorites")||u.length===0||!f(o)||u.length===1&&u[0].locked?!1:!u.some(p=>z2(p,f(o).path)===!1),class:"oc-files-actions-move-trigger"}])}},S0=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=ze(),{currentFolder:r}=Me.storeToRefs(n),i=B(()=>_n(e,"files-public-link")?Mi("files-public-link"):yn(e,"files-trash-overview")?Hr("files-trash-generic"):Kn("files-spaces-generic"));return{actions:B(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:s})=>s.length!==1||f(r)!==null&&wo(s[0],f(r))||re.isTrashResource(s[0])?!1:s[0].isFolder||s[0].type==="space",route:({space:s,resources:a})=>Co({},f(i),sr(s,{path:a[0].path,fileId:a[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},E0=()=>{const{$gettext:e}=Ie.useGettext(),{getDefaultAction:t}=Xn();return{actions:B(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const i=t({...r,omitSystemActions:!0});!i||!Object.hasOwn(i,"handler")||i.handler(r)},route:r=>{const i=t({...r,omitSystemActions:!0});if(!(!i||!Object.hasOwn(i,"route")))return i.route(r)},isVisible:r=>{const i=t({...r,omitSystemActions:!0});return i?i.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},W2=()=>{const{showErrorMessage:e}=nt(),t=He(),{$gettext:n}=Ie.useGettext(),r=_r(),i=Za(),o=Ke(),s=u=>{const c=/URL=(.+)/,p=u.match(c);if(p&&p[1])return p[1];throw new Error("unable to extract url")},a=async({resources:u,space:c})=>{try{const p=new URL(window.location.href),d=(await o.webdav.getFileContents(c,u[0])).body;let m=s(d);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=Gd.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(p.origin)){window.location.href=m;return}window.open(m)}catch(p){console.error(p),e({title:n("Failed to open shortcut"),errors:[p]})}};return{actions:B(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>f(r)&&!f(i)&&!xt(t,"files-spaces-generic")&&!_n(t,"files-public-link")&&!Vt(t,"files-common-favorites")&&!Vt(t,"files-common-search")&&!Mt(t,"files-shares-with-me")&&!Mt(t,"files-shares-with-others")&&!Mt(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}},H2=_e({name:"AppLoadingSpinner"}),K2={class:"flex items-center justify-center size-full"};function G2(e,t,n,r,i,o){const s=Ee("oc-spinner");return X(),pe("div",K2,[me(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Id=Ye(H2,[["render",G2]]),Q2=_e({name:"FilePickerModal",components:{AppLoadingSpinner:Id},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=le(),n=le(!0),r=He(),{removeModal:i}=ht(),o=cr(),s=r.resolve(e.parentFolderLink),a=o.currentTheme.name,l=new URL(s.href,window.location.origin);l.searchParams.append("hide-logo","true"),l.searchParams.append("embed","true"),l.searchParams.append("embed-target","file"),l.searchParams.append("embed-delegate-authentication","false"),l.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const u=()=>{n.value=!1,f(t).contentWindow.focus()},c=({data:d})=>{if(d.name!=="opencloud-embed:file-pick")return;const{resource:m,locationQuery:b}=d.data;e.callbackFn({resource:m,locationQuery:b}),i(e.modal.id)},p=({data:d})=>{d.name==="opencloud-embed:cancel"&&i(e.modal.id)};return Lt(()=>{window.addEventListener("message",c),window.addEventListener("message",p)}),An(()=>{window.removeEventListener("message",c),window.removeEventListener("message",p)}),{isLoading:n,onLoad:u,iframeTitle:a,iframeSrc:l.href,iframeRef:t,onFilePick:c}}}),X2={class:"h-full",tabindex:"0"},Y2=["title","src"];function J2(e,t,n,r,i,o){const s=Ee("app-loading-spinner");return X(),pe("div",X2,[e.isLoading?(X(),Te(s,{key:0})):Re("",!0),ot(fe("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Y2),[[uh,!e.isLoading]])])}const T0=Ye(Q2,[["render",J2]]),A0=(e={})=>{const t=He(),{getMatchingSpace:n}=ln(e);return{createFolderLink:i=>{const{path:o,fileId:s,resource:a}=i,l=f(e.space)||n(a);return l?yn(t,"files-trash-overview")?Hr("files-trash-generic",sr(l)):Kn("files-spaces-generic",sr(l,{path:o,fileId:s})):{}}}},Yr=(e={})=>{const t=en(),{$gettext:n}=Ie.useGettext(),{getInternalSpace:r,getMatchingSpace:i,isResourceAccessible:o}=ln(),{createFolderLink:s}=A0(e);return{getPathPrefix:d=>{const m=f(e.space)||i(d);return re.isProjectSpaceResource(m)?Bl.join(n("Spaces"),m.name):re.isShareSpaceResource(m)?Bl.join(n("Shares"),m.name):m.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const m=f(e.space)||i(d),b=o({space:m,path:ft.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!b?Fn("files-shares-with-me"):re.isProjectSpaceResource(d)?Kn("files-spaces-projects"):s({path:ft.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const m=f(e.space)||i(d),b=o({space:m,path:ft.dirname(d.path)});if(re.isShareRoot(d)||d.id===m.id&&re.isShareSpaceResource(m)||!b)return n("Shared with me");const S=re.extractParentFolderName(d);if(S)return S;if(re.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(re.isProjectSpaceResource(d))return n("Spaces");if(m?.driveType==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>re.isProjectSpaceResource(d)||re.isProjectSpaceResource(r(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},x0=({appId:e})=>{const{$gettext:t}=Ie.useGettext(),n=_r(),{dispatchModal:r}=ht(),i=ar(),{apps:o}=Me.storeToRefs(i),s=He(),{getParentFolderLink:a}=Yr(),{getMatchingSpace:l}=ln(),{getEditorRouteOpts:u}=Xn(),c=({resources:m})=>{const b=f(o)[e],w=a(m[0]),S=b.extensions.map(y=>y.extension?y.extension:y.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:b.name}),customComponent:T0,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:S,parentFolderLink:w,callbackFn:d}),focusTrapInitial:!1})},p=B(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!f(n),class:"oc-files-actions-open-with-app-trigger"}]),d=({resource:m,locationQuery:b})=>{const w=l(m),S=re.isShareSpaceResource(w)?w.id:void 0,y=u(f(s.currentRoute).name,w,m,S);y.query={...y.query,...b};const g=s.resolve(y),v=new URL(g.href,window.location.origin);window.open(v.href,"_blank")};return{actions:p,onFilePicked:d}},R0=()=>{const e=He(),t=Ke(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=Uo(),{startWorker:s}=nw(),a=ze(),{currentFolder:l}=Me.storeToRefs(a),u=B(()=>jo()?r("⌘ + V"):r("Ctrl + V")),c=B(()=>o.action===Mo.Cut?Sr.MOVE:Sr.COPY),p=async({targetSpace:b,sourceSpace:w,resources:S})=>{const y=new Sh(w,S,b,f(l),l,t,r,i),g=await y.getTransferData(f(c));if(!g.length)return;const v=f(l)?.id;s(g,async({successful:h,failed:E})=>{if(y.showResultMessage(E,h,f(c)),!h.length||f(l)&&v!==f(l).id)return;const T=[],R=[];for(const x of h)T.push((async()=>{const A=await t.webdav.getFileInfo(b,x);R.push(A)})());await Promise.allSettled(T),re.isShareSpaceResource(b)&&R.forEach(x=>{x.remoteItemId=b.id}),a.upsertResources(R)})},d=async({space:b})=>{const w=o.resources.reduce((y,g)=>{if(g.storageId in y)return y[g.storageId].resources.push(g),y;const v=n(g);return v.id in y||(y[v.id]={space:v,resources:[]}),y[v.id].resources.push(g),y},{}),S=Object.values(w).map(({space:y,resources:g})=>p({targetSpace:b,sourceSpace:y,resources:g}));await Promise.all(S),o.clearClipboard()};return{actions:B(()=>[{name:"paste",icon:"clipboard",handler:d,label:()=>r("Paste"),shortcut:f(u),isVisible:({resources:b})=>o.resources.length===0||!xt(e,"files-spaces-generic")&&!_n(e,"files-public-link")&&!Vt(e,"files-common-favorites")||b.length===0?!1:_n(e,"files-public-link")&&f(l)?f(l)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},Ya=()=>{const{showErrorMessage:e}=nt(),t=en(),n=He(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=dt(),{dispatchModal:s}=ht(),a=vt(),l=fn(),u=ze(),{setCurrentFolder:c,upsertResource:p}=u,{isFileNameValid:d}=Ei(),m=async(S,y,g)=>{let v=u.currentFolder;try{const h=ft.join(ft.dirname(y.path),g);await i.webdav.moveFiles(S,y,S,{path:h});const E=wo(y,v);if(re.isShareSpaceResource(S)&&y.isReceivedShare()){if(S.rename(g),E)return v={...v},v.name=g,c(v),n.push(sr(S,{path:"",fileId:y.fileId}));const R={...y};R.name=g,p(R);return}if(E)return v={...v},Vl(S,v,h),c(v),n.push(sr(S,{path:h,fileId:y.fileId}));const T={...y};Vl(S,T,h),p(T)}catch(h){console.error(h);let E=r('Failed to rename "%{file}" to »%{newName}«',{file:y.name,newName:g},!0);h.statusCode===423&&(E=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:y.name,newName:g},!0)),e({title:E,errors:[h]})}},b=async({space:S,resources:y})=>{const g=u.currentFolder;let v;if(wo(y[0],g)){const O=ft.dirname(g.path);v=(await i.webdav.listFiles(S,{path:O})).children}const h=u.areFileExtensionsShown,E=async O=>{h||(O=`${O}.${y[0].extension}`),await m(S,y[0],O)},T=(O,D)=>{h||(O=`${O}.${y[0].extension}`);const{isValid:V,error:L}=d(y[0],O,v);D(V?null:L)},R=re.extractNameWithoutExtension(y[0]),x=!y[0].isFolder&&!h?R:y[0].name,A=y[0].isFolder?r("Rename folder »%{name}«",{name:x}):r("Rename file »%{name}«",{name:x}),N=!y[0].isFolder&&!h?R:y[0].name,W=y[0].isFolder||!h?null:[0,R.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:N,inputSelectionRange:W,inputLabel:y[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:E,onInput:T})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:b,isVisible:({resources:S})=>yn(n,"files-trash-generic")||Mt(n,"files-shares-with-me")&&!t.sharingCanRename||S.length!==1||(o.options.routing.fullShareOwnerPaths?S.some(v=>v.remoteItemPath&&v.path):S.some(v=>v.remoteItemId&&v.path==="/"))||S.length===1&&S[0].locked?!1:!S.some(v=>!v.canRename({user:a.user,ability:l})||v.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:m}},ls=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=nt(),i=vt(),o=He(),{$gettext:s,$ngettext:a}=Ie.useGettext(),l=Ke(),u=at(),c=ze(),{startWorker:p}=rw(),d=async(y,g)=>{const v={},h=[],E=[],T=[];for(const R of g){const x=ft.dirname(R.path);let A=[];if(x in v)A=v[x];else{try{A=(await l.webdav.listFiles(y,{path:x})).children}catch{T.push(x)}v[x]=A}A.some(W=>W.name===R.name)||E.filter(W=>W.id!==R.id).some(W=>W.path===R.path)?h.push(R):E.push(R)}return{existingResourcesByPath:v,conflicts:h,resolvedResources:E,missingFolderPaths:T.filter(R=>!v[R]?.length)}},m=async y=>{let g=0;const v=[],h=y.length;let E=!1,T;for(const R of y){const x=R.type==="folder";if(E){v.push({resource:R,strategy:T});continue}const A=h-g,W=await new jl(s,a).resolveFileExists({name:R.name,isFolder:x},A,!1);g++,W.doForAllConflicts&&(E=!0,T=W.strategy),v.push({resource:R,strategy:W.strategy})}return v},b=(y,g,v)=>{const h=f(o.currentRoute);p({space:y,resources:g,missingFolderPaths:v},async({successful:E,failed:T})=>{if(E.length){let R;E.length===1?R=s("%{resource} was restored successfully",{resource:E[0].name}):R=s("%{resourceCount} files restored successfully",{resourceCount:E.length.toString()}),e&&n({title:R}),h.name===f(o.currentRoute).name&&h.query?.fileId===f(o.currentRoute).query?.fileId&&(c.removeResources(E),c.resetSelection());const A=await l.graphAuthenticated.drives.getDrive(y.id);u.updateSpaceField({id:A.id,field:"spaceQuota",value:A.spaceQuota}),t?.({space:y,resources:E})}if(T.length){let R;const x={};T.length===1?(x.resource=T[0].resource.name,R=s('Failed to restore "%{resource}"',x,!0)):(x.resourceCount=T.length.toString(),R=s("Failed to restore %{resourceCount} files",x,!0)),r({title:R,errors:T.map(({error:A})=>A)})}})},w=async({space:y,resources:g})=>{const v=g.sort((W,O)=>W.path.length-O.path.length),{existingResourcesByPath:h,conflicts:E,resolvedResources:T,missingFolderPaths:R}=await d(y,v),x=await m(E),A=x.filter(W=>W.strategy===Wn.REPLACE).map(W=>W.resource);T.push(...A);const N=x.filter(W=>W.strategy===Wn.KEEP_BOTH).map(W=>W.resource);for(let W of N){W={...W};const O=ft.dirname(W.path),D=h[O]||[],V=re.extractExtensionFromFile(W),L=zn(W.name,V,[...D,...x.map(te=>te.resource),...T]);W.name=L,W.path=re.urlJoin(O,L),T.push(W)}return b(y,T,R)};return{actions:B(()=>[{name:"restore",icon:"arrow-go-back",label:()=>s("Restore"),handler:w,isVisible:({space:y,resources:g})=>!yn(o,"files-trash-generic")||!g.every(v=>re.isTrashResource(v)&&v.canBeRestored())||re.isProjectSpaceResource(y)&&!y.canRestoreFromTrashbin({user:i.user})?!1:g.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:b,collectConflicts:d}},Z2=_e({name:"SaveAsModal",components:{AppLoadingSpinner:Id},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=cr(),{$gettext:i}=Ie.useGettext(),o=He(),s=Ke(),{removeModal:a}=ht(),{showMessage:l,showErrorMessage:u}=nt(),{getMatchingSpace:c}=ln(),{getEditorRouteOpts:p}=Xn(),d=o.resolve(e.parentFolderLink),m=r.currentTheme.name,b=new URL(d.href,window.location.origin);b.searchParams.append("hide-logo","true"),b.searchParams.append("embed","true"),b.searchParams.append("embed-target","location"),b.searchParams.append("embed-choose-file-name","true"),b.searchParams.append("embed-delegate-authentication","false"),b.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const w=()=>{n.value=!1,f(t).contentWindow.focus()},S=async({data:h})=>{if(h.name!=="opencloud-embed:select")return;const{resources:E,fileName:T,locationQuery:R}=h.data,x=E[0],A=c(x);try{const N=await y({destinationFolder:x,fileName:T,space:A});l({title:i("»%{fileName}« was saved successfully",{fileName:N.name})}),g({resource:N,space:A,locationQuery:R})}catch(N){console.error(N),u({title:i("Unable to save »%{fileName}«",{fileName:T}),errors:[N]}),console.error(N)}a(e.modal.id)},y=async({destinationFolder:h,fileName:E,space:T})=>{const{children:R}=await s.webdav.listFiles(T,{fileId:h.fileId},{davProperties:[Ve.Name]});return R.find(A=>A.name===E)&&(E=zn(E,e.originalResource.extension,R)),s.webdav.putFileContents(T,{fileName:E,parentFolderId:h.id,content:e.content,path:re.urlJoin(h.path,E)})},g=({locationQuery:h,resource:E,space:T})=>{const R=re.isShareSpaceResource(T)?T.id:void 0,x=p(f(o.currentRoute).name,T,E,R);x.query={...x.query,...h};const A=o.resolve(x),N=new URL(A.href,window.location.origin);window.open(N.href,"_blank")},v=({data:h})=>{h.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Lt(()=>{window.addEventListener("message",S),window.addEventListener("message",v)}),An(()=>{window.removeEventListener("message",S),window.removeEventListener("message",v)}),{isLoading:n,onLoad:w,iframeTitle:m,iframeSrc:b.href,iframeRef:t,onLocationPick:S}}}),eL={class:"h-full",tabindex:"0"},tL=["title","src"];function nL(e,t,n,r,i,o){const s=Ee("app-loading-spinner");return X(),pe("div",eL,[e.isLoading?(X(),Te(s,{key:0})):Re("",!0),ot(fe("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,tL),[[uh,!e.isLoading]])])}const C0=Ye(Z2,[["render",nL]]),k0=({content:e})=>{const{$gettext:t}=Ie.useGettext(),n=_r(),{dispatchModal:r}=ht(),{getParentFolderLink:i}=Yr(),o=({resources:a})=>{const l=i(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:C0,hideActions:!0,customComponentAttrs:()=>({content:f(e),parentFolderLink:l,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"save-as",icon:"save-2",handler:o,label:()=>t("Save as"),isVisible:({resources:a})=>!f(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},rL={class:z.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},iL={key:0,class:"max-h-[400px]"},oL=["src"],sL={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},aL=["textContent"],P0=_e({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=nt(),{$gettext:i}=Ie.useGettext(),o=Ke(),s=at(),{createDefaultMetaFolder:a}=Qi(),{getDefaultMetaFolder:l}=Ca(),{setCropperInstance:u}=td(),c=le(null),p=Tn("imageRef"),d=le(null);t({onConfirm:async()=>{const S=f(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),y=await b(S);await w(y)}});const b=async S=>(await new Promise(g=>S.toBlob(g,"image/png"))).arrayBuffer(),w=async S=>{const y=o.graphAuthenticated;s.addToImagesLoading(e.space.id);let g=await l(e.space);g||(g=await a(e.space));const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h,processing:E}=await o.webdav.putFileContents(e.space,{parentFolderId:g.id,fileName:"image.png",content:S,headers:v,overwrite:!0}),T=await y.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:h}]});E||s.removeFromImagesLoading(e.space.id),s.updateSpaceField({id:e.space.id,field:"spaceImageData",value:T.spaceImageData}),n({title:i("Space image was set successfully")}),Je.publish("app.files.spaces.uploaded-image",T)}catch(h){if(console.error(h),s.removeFromImagesLoading(e.space.id),h instanceof re.HttpError&&h.statusCode===507){r({title:i("Failed to set space image"),desc:i("Not enough quota to set the space image"),errors:[h]});return}r({title:i("Failed to set space image"),errors:[h]})}};return Lt(async()=>{try{d.value=URL.createObjectURL(e.file),f(c)&&f(c)?.destroy(),await zt(),c.value=new il(f(p),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),u(c)}catch(S){r({title:i("Failed to load space image"),errors:[S]})}}),(S,y)=>{const g=Ee("oc-icon");return X(),pe("div",rL,[d.value?(X(),pe("div",iL,[fe("img",{ref_key:"imageRef",ref:p,src:d.value},null,8,oL),fe("div",sL,[me(g,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:z.toDisplayString(f(i)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:f(i)("+-"),panKeys:f(i)("↑↓←→")}))},null,8,aL)])])):Re("",!0)])}}}),I0=()=>{const e=vt(),t=He(),{$gettext:n}=Ie.useGettext(),r=Ke(),i=gn(),{dispatchModal:o}=ht(),s=async({space:l,resources:u})=>{const{getFileContents:c}=r.webdav,p=await c(l,u[0],{responseType:"blob"}),d=new File([p.body],u[0].name);o({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:P0,customComponentAttrs:()=>({file:d,space:l})})};return{actions:B(()=>[{name:"set-space-image",icon:"image-edit",handler:l=>i.addTask(()=>s(l)),label:()=>n("Set as space image"),isVisible:({space:l,resources:u})=>u.length!==1||!u[0].hasPreview?.()||!u[0].mimeType?.includes("image/")||!xt(t,"files-spaces-generic")||!l||!re.isProjectSpaceResource(l)?!1:l.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},lL=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=_r(),r=()=>{const o=yn(e,"files-trash-generic")?null:"actions";Je.publish(Rt.openWithPanel,o)};return{actions:B(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:o})=>f(n)?o.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Od=()=>{const e=He(),t=ze(),{$gettext:n}=Ie.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:i})=>yn(e,"files-trash-generic")?!1:i.length>0,handler({resources:i}){t.setSelection(i.map(({id:o})=>o)),Je.publish(Rt.open)}}])}},O0=()=>{const e=en(),{isPersonalSpaceRoot:t}=ln();return{canListShares:({space:r,resource:i})=>!e.sharingApiEnabled||re.isPublicSpaceResource(r)||t(i)||re.isTrashResource(i)?!1:re.isIncomingShareResource(i)?i.sharePermissions.includes(re.GraphSharePermission.readPermissions):re.isShareSpaceResource(r)?r.graphPermissions?.includes(re.GraphSharePermission.readPermissions):!0}},F0=()=>{const e=en(),t=fn(),n=vt();return{canShare:({space:i,resource:o})=>!e.sharingApiEnabled||re.isShareSpaceResource(i)||re.isProjectSpaceResource(i)&&!i.canShare({user:n.user})?!1:o.canShare({ability:t,user:n.user})}},Fd=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),{canShare:n}=F0();ze();const{interceptModifierClick:r}=gi(),i=({resources:s,event:a})=>{const l=s[0];a&&r(a,l)||Je.publish(Rt.openWithPanel,"sharing#peopleShares")};return{actions:B(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:i,isVisible:({space:s,resources:a})=>yn(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Ja=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=He(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=gn(),s=dt(),{updateResourceField:a,resetSelection:l}=ze(),u=async({resources:p})=>{const d=[],m=[],b=new Lr({concurrency:s.options.concurrentRequests.resourceBatchActions}),w=!p[0].hidden;if(p.forEach(S=>{m.push(b.add(async()=>{try{await i.graphAuthenticated.driveItems.updateDriveItem(S.driveId,S.id,{"@UI.Hidden":w}),a({id:S.id,field:"hidden",value:w})}catch(y){console.error(y),d.push(y)}}))}),await Promise.all(m),d.length===0){l(),e({title:r(w?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(w?"Failed to hide the share":"Failed to unhide the share"),errors:d})};return{actions:B(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:p=>o.addTask(()=>u(p)),label:({resources:p})=>p[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:p})=>p.length===0?!1:Mt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},_0=()=>{const{$gettext:e}=Ie.useGettext(),{showErrorMessage:t}=nt(),{webdav:n}=Ke(),r=en(),i=ze(),{currentFolder:o}=Me.storeToRefs(i),{actions:s}=ls({showSuccessMessage:!1,onRestoreComplete:async({space:p,resources:d})=>{if(Ah({resourcesStore:i,parentFolderId:d[0].parentFolderId})){const{children:m}=await n.listFiles(p,{path:f(o).path});i.upsertResources(m.filter(({id:b})=>d.some(w=>w.id===a(b))))}}}),a=p=>p.includes("!")?p.split("!")[1]:p,l=async({space:p,resources:d,callback:m})=>{const b=d.map(w=>({...w,id:a(w.id)}));try{await f(s)[0].handler({space:p,resources:b}),m()}catch(w){console.error(w),t({title:e("Failed to restore files"),errors:[w]})}},u=B(()=>jo()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:B(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:f(u),isVisible:({space:p})=>r.davTrashbin?re.isProjectSpaceResource(p)||re.isPersonalSpaceResource(p):!1,label:()=>e("Undo"),handler:l}])}},D0=()=>{const e=dt(),{showMessage:t,showErrorMessage:n,removeMessage:r}=nt(),i=He(),o=Ie.useGettext(),{getMatchingSpace:s}=ln(),{$gettext:a,$ngettext:l}=o,u=Ke(),{dispatchModal:c}=ht(),p=at(),d=ur(),{bindKeyAction:m,removeKeyAction:b}=Oa(),{startWorker:w}=tw({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:S}=_0(),y=ze(),{currentFolder:g}=Me.storeToRefs(y),v=le([]),h=tn("page","1"),E=B(()=>parseInt(Ct(f(h)))),T=tn("items-per-page","1"),R=B(()=>parseInt(Ct(f(T)))),x=B(()=>gh(f(v))),A=({space:L,filesToDelete:te,deletedFiles:Y})=>{const se=Y.length===1&&te.length===1?a('"%{item}" was moved to trash bin',{item:Y[0].name}):l("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",Y.length,{itemCount:Y.length.toString()},!0),he=7,ae=f(S)[0],we=ae.isVisible({space:L,resources:Y});let Q;const ie=t({title:se,timeout:he,actions:[ae],actionOptions:{space:L,resources:Y,callback:()=>{r(ie),Q&&b(Q)}}});we&&(Q=m({primary:fr.Z,modifier:Ia.Ctrl},()=>(b(Q),ae.handler({space:L,resources:Y,callback:()=>{r(ie)}}))),setTimeout(()=>b(Q),he*1e3))},N=B(()=>{const L=f(x),te=L[0].type==="folder";let Y=null;return L.length===1?(te?Y=a("Permanently delete folder »%{name}«",{name:L[0].name},!0):Y=a("Permanently delete file »%{name}«",{name:L[0].name},!0),Y):l("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",L.length,{amount:L.length.toString()},!1)}),W=B(()=>{const L=f(x),te=L[0].type==="folder";return L.length===1?a(te?"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."):a("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),O=L=>{const te=f(i.currentRoute);w({topic:"trashBinDelete",space:L,resources:f(x)},({successful:Y,failed:se})=>{if(Y.length){const he=Y.length===1&&f(x).length===1?a('"%{item}" was deleted successfully',{item:Y[0].name}):l("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",Y.length,{itemCount:Y.length.toString()},!0);t({title:he})}se.forEach(({resource:he})=>{const ae=a('Failed to delete "%{item}"',{item:he.name});n({title:ae,errors:[new Error]})}),te.name===f(i.currentRoute).name&&te.query?.fileId===f(i.currentRoute).query?.fileId&&(y.removeResources(Y),y.resetSelection())})};return{displayDialog:(L,te)=>{v.value=[...te],c({title:f(N),message:f(W),confirmText:a("Delete"),onConfirm:()=>O(L)})},filesList_delete:L=>{v.value=[...L],y.addResourcesIntoDeleteQueue(f(v).map(({id:se})=>se)),f(v).forEach(({id:se})=>y.removeSelection(se));const te=f(L).reduce((se,he)=>{if(he.storageId in se)return se[he.storageId].resources.push(he),se;const ae=s(he);return ae.id in se||(se[ae.id]={space:ae,resources:[]}),se[ae.id].resources.push(he),se},{}),Y=f(g)?.id;return Object.values(te).map(({space:se,resources:he})=>{w({topic:"fileListDelete",space:se,resources:he},async({successful:ae,failed:we})=>{if(ae.length&&(A({space:se,filesToDelete:he,deletedFiles:ae}),d.publish("runtime.resource.deleted",ae)),y.removeResourcesFromDeleteQueue(we.map(({resource:Q})=>Q.id)),y.removeResourcesFromDeleteQueue(ae.map(({id:Q})=>Q)),we.forEach(({error:Q,resource:ie})=>{let ce=a('Failed to delete "%{resource}"',{resource:ie.name});Q.statusCode===423&&(ce=a('Failed to delete "%{resource}" - the file is locked',{resource:ie.name})),n({title:ce,errors:[Q]})}),Y===f(g)?.id){y.removeResources(ae);const Q=y.activeResources.length,ie=Math.ceil(f(Q)/f(R));f(E)>1&&f(E)>ie&&(h.value=ie.toString())}if(xt(i,"files-spaces-generic")&&!["public","share"].includes(se?.driveType)){const ie=await u.graphAuthenticated.drives.getDrive(f(L)[0].storageId);p.updateSpaceField({id:ie.id,field:"spaceQuota",value:ie.spaceQuota})}if(f(v).length&&wo(f(v)[0],f(g)))return i.push(sr(se,{path:ft.dirname(f(v)[0].path),fileId:f(v)[0].parentFolderId}))})})}}},cL=()=>{const e=Ht();return B(()=>f(e)?.query?.contextRouteName)},uL=e=>e==="files",_r=()=>{const e=Ht();return B(()=>uL(lc(f(e))))},Ei=()=>{const{$gettext:e}=Ie.useGettext(),t=ze();return{isSpaceNameValid:i=>i.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Kf(i)>Rd?{isValid:!1,error:e("The Space name is too long")}:i.trim()!==i?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(i)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(i,o,s=void 0)=>{if(!o)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(o))return{isValid:!1,error:e('The name cannot contain "/"')};if(o===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(o==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(o.trim()!==o)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Kf(o)>Rd)return{isValid:!1,error:e("The name is too long")};const a=i.path.substring(0,i.path.length-i.name.length)+o;if((s||t.resources).some(u=>u.path===a&&u.name===o)){const u=e("The name »%{name}« is already taken");return{isValid:!1,error:e(u,{name:o},!0)}}return{isValid:!0,error:void 0}}}},Za=()=>B(()=>!!document.getElementById("files-global-search-options")),N0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=fn(),s=Ke(),a=Ht(),{dispatchModal:l}=ht(),u=at(),{removeResources:c}=ze(),p=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canBeDeleted({user:n.user,ability:o})),d=async w=>{const S=s.graphAuthenticated,y=w.map(E=>S.drives.deleteDrive(E.id).then(()=>(c([E]),u.removeSpace(E),!0))),g=await Promise.allSettled(y),v=g.filter(pi);if(v.length){const E=v.length===1&&w.length===1?r("Space »%{space}« was deleted successfully",{space:w[0].name}):i("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:E})}const h=g.filter(hi);if(h.length){h.forEach(console.error);const E=h.length===1&&w.length===1?r("Failed to delete space »%{space}«",{space:w[0].name}):i("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:E,errors:h.map(T=>T.reason)})}f(a).name==="admin-settings-spaces"&&Je.publish("app.admin-settings.list.load")},m=({resources:w})=>{const S=p(w);if(!S.length)return;const y=i("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",S.length,{count:S.length.toString()});l({title:i("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:r("Delete"),message:y,hasInput:!1,onConfirm:()=>d(S)})};return{actions:B(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:w})=>!!p(w).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},L0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=fn(),s=Ke(),a=Ht(),l=He(),{dispatchModal:u}=ht(),c=at(),p=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canDisable({user:n.user,ability:o})),d=async w=>{const S=f(a),y=s.graphAuthenticated,g=w.map(T=>y.drives.disableDrive(T.id).then(()=>(S.name==="files-spaces-generic"&&l.push({name:"files-spaces-projects"}),S.name==="admin-settings-spaces"&&(T.disabled=!0,T.spaceQuota={total:T.spaceQuota.total}),c.updateSpaceField({id:T.id,field:"disabled",value:!0}),!0))),v=await Promise.allSettled(g),h=v.filter(pi);if(h.length){const T=h.length===1&&w.length===1?r("Space »%{space}« was disabled successfully",{space:w[0].name}):i("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:T})}const E=v.filter(hi);if(E.length){E.forEach(console.error);const T=E.length===1&&w.length===1?r("Failed to disable space »%{space}«",{space:w[0].name}):i("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",E.length,{spaceCount:E.length.toString()},!0);t({title:T,errors:E.map(R=>R.reason)})}},m=({resources:w})=>{const S=p(w);if(!S.length)return;const y=i("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.",S.length,{count:S.length.toString()}),g=r("Disable");u({title:i("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>d(S)})};return{actions:B(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:w})=>!!p(w).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},$0=()=>{const e=dt(),t=at(),n=Cr(),{showMessage:r,showErrorMessage:i}=nt(),o=He(),{$gettext:s}=Ie.useGettext(),a=fn(),l=Ke(),u=gn(),{upsertResource:c}=ze(),p=xt(o,"files-spaces-projects"),d=async w=>{const S=t.spaces.filter(re.isProjectSpaceResource),y=zn(w.name,"",S);try{let g=await l.graphAuthenticated.drives.createDrive({name:y,description:w.description,quota:{total:w.spaceQuota.total}});const v=await l.webdav.listFiles(w);if(v.children.length){const h=new Lr({concurrency:e.options.concurrentRequests.resourceBatchActions}),E=[];for(const T of v.children)E.push(h.add(()=>l.webdav.copyFiles(w,T,g,{path:T.name})));await Promise.all(E)}if(w.spaceReadmeData||w.spaceImageData){const h={special:[]};if(w.spaceReadmeData){const E=await l.webdav.getFileInfo(g,{path:`.space/${w.spaceReadmeData.name}`});h.special.push({specialFolder:{name:"readme"},id:E.id})}if(w.spaceImageData){const E=await l.webdav.getFileInfo(g,{path:`.space/${w.spaceImageData.name}`});h.special.push({specialFolder:{name:"image"},id:E.id})}g=await l.graphAuthenticated.drives.updateDrive(g.id,h,n.graphRoles)}t.upsertSpace(g),p&&c(g),r({title:s("Space »%{space}« was duplicated successfully",{space:w.name})})}catch(g){console.error(g),i({title:s("Failed to duplicate space »%{space}«",{space:w.name}),errors:[g]})}},m=async({resources:w})=>{for(const S of w)S.disabled||!re.isProjectSpaceResource(S)||await d(S)};return{actions:B(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:w=>u.addTask(()=>m(w)),isVisible:({resources:w})=>!w?.length||w.every(S=>S.disabled)||w.every(S=>!re.isProjectSpaceResource(S))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},fL=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r}=Ie.useGettext(),i=fn(),o=Ke(),s=Ht(),{dispatchModal:a}=ht(),l=at(),u=(d,m)=>o.graphAuthenticated.drives.updateDrive(d.id,{name:d.name,description:m}).then(()=>{l.updateSpaceField({id:d.id,field:"description",value:m}),f(s).name==="admin-settings-spaces"&&(d.description=m),e({title:r("Space subtitle was changed successfully")})}).catch(w=>{console.error(w),t({title:r("Failed to change space subtitle"),errors:[w]})}),c=({resources:d})=>{d.length===1&&a({title:r("Change subtitle for space")+" "+d[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:d[0].description,onConfirm:m=>u(d[0],m)})};return{actions:B(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:d})=>d.length!==1?!1:d[0].canEditDescription({user:n.user,ability:i}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:u}},dL={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:le(void 0),options:le([])}},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=vn(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},pL={class:"quota-select-batch-action-form"},hL=["textContent"],mL={class:"flex justify-between"},gL=["textContent"],yL={key:0,class:"oc-text-input-danger"};function vL(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-select");return X(),pe("div",pL,[me(a,$t({ref:"select","model-value":r.selectedOption,selectable:o.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":o.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":o.onUpdate}),{"selected-option":ve(({displayValue:l})=>[e.$attrs["read-only"]?(X(),Te(s,{key:0,name:"lock",class:"mr-1",size:"small"})):Re("",!0),fe("span",{textContent:z.toDisplayString(l)},null,8,hL)]),search:ve(({attributes:l,events:u})=>[fe("input",$t({class:"vs__search"},l,Os(u,!0)),null,16)]),option:ve(({displayValue:l,error:u})=>[fe("div",mL,[fe("span",{textContent:z.toDisplayString(l)},null,8,gL)]),u?(X(),pe("div",yL,z.toDisplayString(u),1)):Re("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const M0=Ye(dL,[["render",vL]]),bL={key:0,class:"mt-2"},wL=["textContent"],B0=_e({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:i,showErrorMessage:o}=nt(),{$gettext:s,$ngettext:a}=Ie.useGettext(),l=Ke(),u=He(),c=at(),p=en(),{spacesMaxQuota:d}=Me.storeToRefs(p),{updateResourceField:m}=ze(),b=le(e.spaces[0]?.spaceQuota?.total||0),w=h=>e.resourceType==="space"?a("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",h,{count:h.toString()}):e.resourceType==="user"?a("User quota was changed successfully","Quota of %{count} users was changed successfully",h,{count:h.toString()}):s("Quota was changed successfully"),S=h=>e.resourceType==="space"?a("Failed to change space quota","Failed to change quota for %{count} spaces",h,{count:h.toString()}):e.resourceType==="user"?a("Failed to change user quota","Failed to change quota for %{count} users",h,{count:h.toString()}):s("Failed to change quota"),y=B(()=>!e.spaces.some(h=>h.spaceQuota.total!==f(b)));st(y,()=>{r("update:confirmDisabled",f(y))},{immediate:!0});const g=h=>{b.value=h.value};return t({onConfirm:async()=>{const h=l.graphAuthenticated,E=e.spaces.map(async A=>{const N=await h.drives.updateDrive(A.id,{name:A.name,quota:{total:f(b)}});f(u.currentRoute).name==="admin-settings-spaces"&&Je.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:N.spaceQuota}),f(u.currentRoute).name==="admin-settings-users"&&Je.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:N.spaceQuota}),c.updateSpaceField({id:A.id,field:"spaceQuota",value:N.spaceQuota}),m({id:A.id,field:"spaceQuota",value:N.spaceQuota})}),T=await Promise.allSettled(E),R=T.filter(pi);R.length&&i({title:w(R.length)});const x=T.filter(hi);x.length&&(console.error(x),x.forEach(console.error),o({title:S(x.length),errors:x.map(A=>A.reason)}))}}),(h,E)=>{const T=Ee("oc-contextual-helper");return X(),pe(Be,null,[me(M0,{"total-quota":b.value,"max-quota":f(d),"position-fixed":!0,onSelectedOptionChange:g},null,8,["total-quota","max-quota"]),e.warningMessage?(X(),pe("div",bL,[fe("span",{class:"oc-text-input-warning",textContent:z.toDisplayString(e.warningMessage)},null,8,wL),e.warningMessageContextualHelperData?(X(),Te(T,$t({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):Re("",!0)])):Re("",!0)],64)}}}),j0=()=>{const{dispatchModal:e}=ht(),{$gettext:t}=Ie.useGettext(),n=fn(),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()}),i=({resources:s})=>{e({title:r({resources:s}),customComponent:B0,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:B(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:i,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!re.isProjectSpaceResource(a)||re.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function U0(){const{triggerDefaultAction:e}=Xn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const SL=()=>{const e=Ke(),{openWithDefaultApp:t}=U0(),{createDefaultMetaFolder:n}=Qi(),r=vt(),i=at(),{$gettext:o}=Ie.useGettext(),{getDefaultMetaFolder:s}=Ca(),a=async(c,p)=>{const d=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:p.id,fileName:"readme.md"}),m=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:d.id}]});return i.updateSpaceField({id:c.id,field:"spaceReadmeData",value:m.spaceReadmeData}),d},l=async({resources:c})=>{let p=null,d=await s(c[0]);if(d||(d=await n(c[0]),p=await a(c[0],d)),!p){const m=re.getRelativeSpecialFolderSpacePath(c[0],"readme");m?p=await e.webdav.getFileInfo(c[0],{path:m}):p=await a(c[0],d)}t({space:c[0],resource:p})};return{actions:B(()=>[{name:"editReadmeContent",icon:"article",label:()=>o("Edit description"),handler:l,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},V0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r}=Ie.useGettext(),i=fn(),o=Ke(),s=Ht(),{isSpaceNameValid:a}=Ei(),{dispatchModal:l}=ht(),u=at(),c=(m,b)=>o.graphAuthenticated.drives.updateDrive(m.id,{name:b}).then(()=>{f(s).name==="admin-settings-spaces"&&(m.name=b),u.updateSpaceField({id:m.id,field:"name",value:b}),e({title:r("Space name was changed successfully")})}).catch(S=>{console.error(S),t({title:r("Failed to rename space"),errors:[S]})}),p=({resources:m})=>{m.length===1&&l({title:r("Rename space »%{name}«",{name:m[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:m[0].name,inputRequiredMark:!0,onConfirm:b=>c(m[0],b),onInput:(b,w)=>{const{isValid:S,error:y}=a(b);w(S?null:y)}})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:p,isVisible:({resources:m})=>m.length!==1?!1:m[0].canRename({user:n.user,ability:i}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},q0=()=>{const{showMessage:e,showErrorMessage:t}=nt(),n=vt(),{$gettext:r,$ngettext:i}=Ie.useGettext(),o=fn(),s=Ke(),a=gn(),l=Ht(),{dispatchModal:u}=ht(),c=at(),p=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canRestore({user:n.user,ability:o})),d=async w=>{const S=s.graphAuthenticated,y=w.map(E=>S.drives.updateDrive(E.id,{name:E.name},{headers:{Restore:"true"}}).then(T=>(f(l).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=T.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),g=await a.addTask(()=>Promise.allSettled(y));await c.loadGraphPermissions({ids:w.map(E=>E.id),graphClient:S});const v=g.filter(pi);if(v.length){const E=v.length===1&&w.length===1?r("Space »%{space}« was enabled successfully",{space:w[0].name}):i("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:E})}const h=g.filter(hi);if(h.length){h.forEach(console.error);const E=h.length===1&&w.length===1?r("Failed to enable space »%{space}«",{space:w[0].name}):i("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:E,errors:h.map(T=>T.reason)})}},m=({resources:w})=>{const S=p(w);if(!S.length)return;const y=i("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",S.length,{count:S.length.toString()}),g=r("Enable");u({title:i("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>d(S)})};return{actions:B(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:m,isVisible:({resources:w})=>!!p(w).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:d}},EL=()=>{const{$gettext:e}=Ie.useGettext(),t=ze(),n=({resources:i})=>{t.setSelection(i.map(({id:o})=>o)),Je.publish(Rt.openWithPanel,"space-share")};return{actions:B(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:i})=>i.length===1&&!i[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},TL=()=>{const e=He(),{$gettext:t}=Ie.useGettext(),n=i=>Hr("files-trash-generic",{...sr(i,{fileId:i.fileId})});return{actions:B(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:i})=>{e.push(n(i[0]))},isVisible:({resources:i})=>!(i.length!==1||!re.isProjectSpaceResource(i[0])&&!re.isPersonalSpaceResource(i[0])||i[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},AL=_e({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=cr(),{currentTheme:r}=Me.storeToRefs(n),i=B(()=>f(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:i}}});function xL(e,t,n,r,i,o){const s=Ee("oc-emoji-picker");return X(),Te(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const z0=Ye(AL,[["render",xL]]),RL=()=>{const e=vt(),{showMessage:t,showErrorMessage:n}=nt(),{$gettext:r}=Ie.useGettext(),i=Ke(),o=gn(),s=at(),{createDefaultMetaFolder:a}=Qi(),{dispatchModal:l}=ht(),{getDefaultMetaFolder:u}=Ca(),c=({resources:b})=>{b.length===1&&l({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:b[0].name}),hideConfirmButton:!0,customComponent:z0,focusTrapInitial:!1,onConfirm:w=>d(b[0],w)})},p=async b=>{const w=document.createElement("canvas"),S=w.getContext("2d"),y=16/9,g=720,v=g/y;w.width=g,w.height=v;const h=.4*g;S.font=`${h}px sans-serif`,S.textBaseline="middle",S.textAlign="center",S.fillText(b,w.width/2,w.height/2+15);const T=await ub(w);return cb(T)},d=async(b,w)=>{const S=i.graphAuthenticated,y=await p(w);let g=await u(b);return g||(g=await a(b)),o.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h}=await i.webdav.putFileContents(b,{parentFolderId:g.id,fileName:"image.png",content:y,headers:v,overwrite:!0}),E=await S.drives.updateDrive(b.id,{name:b.name,special:[{specialFolder:{name:"image"},id:h}]});s.updateSpaceField({id:b.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Je.publish("app.files.spaces.uploaded-image",E)}catch(h){if(console.error(h),h instanceof re.HttpError&&h.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[h]});return}n({title:r("Failed to set space icon"),errors:[h]})}})};return{actions:B(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:b})=>b.length!==1?!1:b[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:d}},CL=()=>{const e=vt(),{$gettext:t}=Ie.useGettext(),{dispatchModal:n}=ht(),{graphAuthenticated:r,webdav:i}=Ke(),o=at(),{showMessage:s,showErrorMessage:a}=nt(),{defaultSpaceImageBlobURL:l}=Me.storeToRefs(o),u=async({space:d})=>{try{await i.deleteFile(d,{path:".space/image.png"}),await r.drives.updateDrive(d.id,{name:d.name,special:[{specialFolder:{name:"image"},id:null}]}),o.updateSpaceField({id:d.id,field:"spaceImageData",value:null}),o.updateSpaceField({id:d.id,field:"thumbnail",value:f(l)}),s({title:t("Space image deleted successfully")})}catch(m){console.error(m),a({title:t("Failed to delete space image"),errors:[m]})}},c=({resources:d})=>{n({title:t("Delete »%{space}« image",{space:d[0].name}),confirmText:t("Delete"),onConfirm:()=>u({space:d[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:d[0].name})})};return{actions:B(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:d})=>d.length!==1||!d[0].spaceImageData?!1:d[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:u}},kL=()=>{const{$gettext:e}=Ie.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Je.publish(Rt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},PL=()=>{const{getMatchingSpace:e}=ln(),t=at(),n=ar(),r=ze(),i=Ke(),{$gettext:o}=Ie.useGettext(),{openEditor:s}=Xn(),{resources:a,currentFolder:l}=Me.storeToRefs(r);return{openEmptyEditor:async(c,p)=>{let d=f(l)?e(f(l)):null,m=f(a),b=f(l)?.path;(!d||!f(l).canCreate())&&(d=t.personalSpace,m=(await i.webdav.listFiles(d)).children,b="");let w=o("New file")+`.${p}`;m.some(v=>v.name===w)&&(w=zn(w,p,m));const S=await i.webdav.putFileContents(d,{path:re.urlJoin(b,w)}),y=e(S),g=n.fileExtensions.find(({app:v,extension:h})=>v===c&&h===p);s(g,y,S)}}},W0=()=>{const{$gettext:e}=Ie.useGettext(),{showMessage:t}=nt();return{openUrl:(r,i,o)=>{const s=window.open(r,i);s?o&&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.")})}}},IL=()=>Ar("$appProviderService"),OL=()=>{const{isResourceAccessible:e}=ln();return{breadcrumbsFromPath:({route:r,space:i,resourcePath:o,ancestorMetaData:s=le({})})=>{const a=(c="")=>c.split("/").filter(Boolean),l=a(r.path),u=a(o);return u.map((c,p)=>{const d=re.urlJoin(...u.slice(0,p+1),{leadingSlash:!0}),m=e({space:f(i),path:d});let b;return m&&(b=f(s)[d]),{id:Xt.v4(),allowContextActions:!0,text:c,...m&&{to:{path:"/"+[...l].splice(0,l.length-u.length+p+1).join("/"),query:{...Hi(r.query,"page","fileId"),...b&&{fileId:b.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const i=r.pop();return[...r,{id:Xt.v4(),allowContextActions:i.allowContextActions,text:i.text,onClick:()=>Je.publish("app.files.list.load"),isTruncationPlaceholder:i.isTruncationPlaceholder,isStaticNav:i.isStaticNav}]}}},FL=(e="")=>{const t=le(0),n=async()=>{await zt();const r=document.querySelector(e||"#files-app-bar"),i=r?r.getBoundingClientRect().height:0;t.value!==i&&(t.value=i)};return window.onresize=n,Lt(n),{y:t,refresh:n}},_d=()=>{const e=le(!0),t=()=>{e.value=window.innerHeight>500};return Lt(()=>{t(),window.addEventListener("resize",t)}),An(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class io{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function _L(e){const t=ds.useRouter(),n=ds.useRoute(),r=DL(e),i=NL(e),o=B(()=>Math.ceil(f(e.items).length/f(i))||1),s=B(()=>{if(!f(i))return f(e.items);const a=(f(r)-1)*f(i),l=a+f(i);return f(e.items).slice(a,l)});return Je.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:l,topbarElement:u})=>{const c=Tt.findIndex(f(e.items),p=>p.id===a);if(c>=0){const p=Math.ceil((c+1)/Number(f(i)));t.push({...f(n),query:{...f(n).query,page:p}}).then(()=>{Je.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:l,topbarElement:u})})}}),{items:s,total:o,page:r,perPage:i}}function DL(e){if(e.page)return B(()=>f(e.page));const t=tn("page","1");return B(()=>parseInt(Ct(f(t))))}function NL(e){if(e.perPage)return B(()=>f(e.perPage));const t=kr({name:e.perPageQueryName||io.perPageQueryName,defaultValue:e.perPageDefault||io.perPageDefault,storagePrefix:e.perPageStoragePrefix});return B(()=>parseInt(Ct(f(t))))}const H0=()=>Ar("$passwordPolicyService");var el=(e=>(e.mounted="portal-target.mounted",e))(el||{});const LL=()=>{const e=ur(),t=fs.useWormhole();return{registerPortal:r=>{e.subscribe(el.mounted,()=>{t.open(r)})}}},K0=()=>Ar("$previewService"),G0=()=>{const e=ar();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:i})=>i).some(({mimeType:i})=>i===n.mimeType)}},Q0=()=>{const e=vt();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||re.isSpaceResource(r)||re.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},X0=()=>{const e=Ke(),t=at(),n=B(()=>t.spaces),r=l=>f(n).find(u=>l.toString().startsWith(u.id.toString())),i=l=>f(n).find(u=>re.isMountPointSpaceResource(u)&&u.root?.remoteItem?.id===l),o=(l,u)=>{const c=[Ve.FileId,Ve.FileParent,Ve.Name,Ve.ResourceType],p=re.buildSpace({id:l,name:""});return e.webdav.getFileInfo(p,{fileId:l},{davProperties:c,signal:u})},s=rn.useTask(function*(l,u){let c,p,d=r(u);if(d)return c=yield e.webdav.getPathForFileId(u,{signal:l}),p=yield e.webdav.getFileInfo(d,{path:c},{signal:l}),{space:d,resource:p,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:l});let m=i(u);p=yield o(u,l);const b=m?[]:[f(p).name];let w=f(p);for(;!m;)w=yield o(w.parentFolderId,l),m=i(w.id),m||b.unshift(w.name);return d=t.getSpace(m.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:p.storageId?.startsWith(re.OCM_PROVIDER_ID)?"ocm-share":"share",id:m.root?.remoteItem?.id,shareName:m.name}),c=re.urlJoin(...b),{space:d,resource:p,path:c}}).restartable();return{getResourceContext:l=>s.perform(l)}},nn={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},$L=140,ML=84,Y0=()=>{const e=le($L),t=le(ML),n=i=>f(e)+(i-1)*f(t);return{calculateTileSizePixels:n,calculateTileSizeRem:i=>{const o=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(i)/o}}};function BL(e){if(e)return B(()=>f(e));const t=kr({name:nn.queryName,defaultValue:nn.defaultModeName});return B(()=>Ct(f(t)))}function jL(e){if(e)return B(()=>parseInt(f(e)));const t=kr({name:nn.tilesSizeQueryName,defaultValue:nn.tilesSizeDefault.toString()});return B(()=>parseInt(Ct(f(t))))}const UL=le(nn.tilesSizeMax);function Dd(){return UL}const Nd=e=>{const t=K0(),{updateResourceField:n}=ze(),{httpAuthenticated:r}=Ke(),i=at(),{defaultSpaceImageBlobURL:o}=Me.storeToRefs(i),s=dt(),{serverUrl:a}=Me.storeToRefs(s),l=new Lr({concurrency:4}),u=B(()=>f(e)===nn.name.tiles),c=B(()=>f(u)?ya.enum.fit:ya.enum.thumbnail),p=B(()=>f(u)?rs.Tile:rs.Thumbnail),d=rn.useTask(function*(S,{space:y,resource:g,dimensions:v,processor:h,updateStore:E=!0}){const T=re.isProjectSpaceResource(g)?re.buildSpaceImageResource(g):g,R=T.id===y.spaceImageData?.id;R&&i.addToImagesLoading(y.id);const x=yield l.add(()=>t.loadPreview({space:y,resource:T,processor:h||f(c),dimensions:v||f(p)},!0,!0,S));return x&&E&&n({id:g.id,field:"thumbnail",value:x}),R&&i.removeFromImagesLoading(y.id),x}),m=async S=>{const{resource:y,cancelRunning:g}=S;if(g&&w(),re.isProjectSpaceResource(y)&&(!y.spaceImageData||y.disabled)){f(o)&&i.updateSpaceField({id:y.id,field:"thumbnail",value:f(o)});try{const v=await r.get(`${f(a)}images/default-space-icon.png`,{responseType:"blob"});return i.setDefaultSpaceImageBlobURL(URL.createObjectURL(v.data)),i.updateSpaceField({id:y.id,field:"thumbnail",value:f(o)}),f(o)}catch{return null}}try{return await d.perform(S)}catch(v){v!=="cancel"&&console.error(v)}},b=B(()=>d.isRunning),w=()=>{d.cancelAll(),l.clear(),i.purgeImagesLoading()};return kl(w),{loadPreview:m,previewsLoading:b}},J0=({showSizeInformation:e=!0}={})=>{const t=ze(),{current:n,$gettext:r,$ngettext:i}=Ie.useGettext(),o=He(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:l,currentFolder:u}=Me.storeToRefs(t),c=B(()=>{if(!f(u)?.size||f(u)?.size==="0"){const d=f(s).map(m=>m.size?parseInt(m.size.toString()):0).reduce((m,b)=>m+b,0);return vn(d,n)}return vn(f(u).size,n)});return{resourceContentsText:B(()=>{let d=i("%{ filesCount } file","%{ filesCount } files",f(a).files,{filesCount:f(a).files.toString()});!f(l)&&f(a).hiddenFiles&&(d=i("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",f(a).files,{filesCount:f(a).files.toString(),filesHiddenCount:f(a).hiddenFiles.toString()}));let m=i("%{ foldersCount } folder","%{ foldersCount } folders",f(a).folders,{foldersCount:f(a).folders.toString()});!f(l)&&f(a).hiddenFolders&&(m=i("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",f(a).folders,{foldersCount:f(a).folders.toString(),foldersHiddenCount:f(a).hiddenFolders.toString()}));const b=i("%{ spacesCount } space","%{ spacesCount } spaces",f(a).spaces,{spacesCount:f(a).spaces.toString()}),w=f(a).files+f(a).folders+f(a).spaces,S=e&&parseFloat(f(c))>0,y=Mt(o,"files-shares-via-link"),g=r(S?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),v=r(S?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),h=y?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",E=`${g} ${h}`,T=`${v} ${h}`;return i(E,T,w,{itemsCount:w.toString(),itemSize:f(c),filesStr:d,foldersStr:m,spacesStr:b})})}},Z0=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=ur(),{isMobile:i}=vw(),{interceptModifierClick:o}=gi(),s=d=>{r.publish("app.files.list.clicked"),n("update:selectedIds",d)},a=Qn(yn,"files-trash-overview"),l=d=>f(a)&&re.isProjectSpaceResource(d)&&d.disabled?!1:!t(d),u=d=>document.getElementById(`context-menu-trigger-${d.getDomSelector()}`);return{shouldShowContextDrop:l,showContextMenuOnBtnClick:(d,m)=>{const{dropdown:b,event:w}=d;if(w instanceof MouseEvent&&o(w,m))return;if(t(m))return!1;if(b?.tippy===void 0)return;const S=u(m);S&&(e(m)||s([m.id]),Wf(b.tippy,w,S))},showContextMenuOnRightClick:(d,m)=>{if(d instanceof MouseEvent&&o(d,m))return;if(d.preventDefault(),t(m))return!1;const b=u(m);if(b){if(e(m)||s([m.id]),f(i)){b.click();return}Wf(b._tippy,d,b)}}}},eS=({selectedIds:e,selectedResources:t,emit:n})=>{const r=ze(),i=le(),o=Tn("ghostElement"),s=async(d,m)=>{i.value=d,await zt(),f(o).$el.ariaHidden="true",f(o).$el.style.left="-99999px",f(o).$el.style.top="-99999px",m.dataTransfer.setDragImage(f(o).$el,0,0),m.dataTransfer.dropEffect="move",m.dataTransfer.effectAllowed="move"},a=async(d,m)=>{f(e).includes(d.id)||(r.toggleSelection(d.id),n("update:selectedIds",[...r.selectedIds])),await s(d,m)},l=B(()=>f(t).filter(({id:d})=>d!==f(i)?.id)),u=d=>(d.dataTransfer.types||[]).some(m=>m==="Files"),c=(d,m)=>{u(m)||(i.value=null,p(d,!0,m),n("fileDropped",d.id))},p=(d,m,b)=>{if(u(b)||b.currentTarget?.contains(b.relatedTarget)||f(e).includes(d.id)||d.type!=="folder")return;const w=document.querySelectorAll(`[data-item-id='${d.id}']`)?.[0];if(!w)return;const S="!bg-role-secondary-container";m?w.classList.remove(S):w.classList.add(S)};return{ghostElement:o,dragItem:i,dragSelection:l,dragStart:a,fileDropped:c,setDropStyling:p}},tS=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const i=ur(),{$gettext:o}=Ie.useGettext(),s=p=>{i.publish("app.files.list.clicked"),r("update:selectedIds",p)},a=p=>{switch(p.type){case"folder":return o("Select folder");case"space":return o("Select space");default:return o("Select file")}},l=B(()=>{const p=f(t).length===f(e).length,d=f(n).length===f(e).length-f(t).length;return!p&&d}),u=B(()=>f(l)?o("Clear selection"):o("Select all"));return{getResourceCheckboxLabel:a,areAllResourcesSelected:l,selectAllCheckboxLabel:u,toggleSelectionAll:()=>{if(f(l))return s([]);s(f(e).filter(p=>!f(t).includes(p.id)).map(p=>p.id))}}},Ld=({space:e,resources:t,selectedIds:n,emit:r})=>{const i=ze(),o=He(),s=ur(),{interceptModifierClick:a}=gi(),{getMatchingSpace:l}=ln(),{canBeOpenedWithSecureView:u}=G0(),{getDefaultAction:c}=Xn(),{isEnabled:p,fileTypes:d,isFilePicker:m,postMessage:b}=Qr(),w=Uo(),{resources:S,action:y}=Me.storeToRefs(w),g=B(()=>f(t).filter(D=>f(n).includes(D.id))),v=D=>f(n).includes(D.id),h=D=>i.deleteQueue.includes(D),E=D=>f(p)&&f(d)?.length?!f(d).includes(D.extension)&&!f(d).includes(D.mimeType)&&!D.isFolder:h(D.id)?!0:re.isSpaceResource(D)?D.disabled:D.processing===!0,T=B(()=>f(t)?.filter(E)?.map(D=>D.id)||[]);return{selectedResources:g,disabledResources:T,isResourceSelected:v,isResourceInDeleteQueue:h,isResourceDisabled:E,isResourceClickable:(D,V)=>!V||re.isProjectSpaceResource(D)&&D.disabled||!D.isFolder&&!D.canDownload()&&!u(D)?!1:!E(D),isResourceCut:D=>f(y)!==Mo.Cut?!1:f(S).some(V=>V.id===D.id),fileContainerClicked:({resource:D,event:V})=>{if(E(D))return;if(f(p)&&f(m)&&!D.isFolder)return b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(D)),locationQuery:JSON.parse(JSON.stringify(Ra(f(o.currentRoute))))});!V.shiftKey&&!V.metaKey&&!V.ctrlKey&&s.publish("app.files.shiftAnchor.reset");const L=V?.target;if(L?.closest("div")?.id==="oc-files-context-menu")return;if(V&&V.metaKey)return s.publish("app.files.list.clicked.meta",D);if(V&&V.shiftKey)return s.publish("app.files.list.clicked.shift",{resource:D,skipTargetSelection:!1});L.getAttribute("type")!=="checkbox"&&(v(D)||(s.publish("app.files.list.clicked"),r("update:selectedIds",[D.id])))},fileNameClicked:({resource:D,event:V})=>{if(!a(V,D)){if(f(p))return f(m)||r("update:selectedIds",[D.id]),f(m)&&!D.isFolder?b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(D)),locationQuery:JSON.parse(JSON.stringify(Ra(f(o.currentRoute))))}):void 0;r("fileClick",{space:l(D),resources:[D]})}},fileCheckboxClicked:({resource:D,event:V})=>{a(V,D)||(i.toggleSelection(D.id),s.publish("app.files.list.clicked"),r("update:selectedIds",[...i.selectedIds]))},getResourceLink:D=>{let V=f(e);V||(V=l(D));const L=c({resources:[D],space:V});if(L?.route)return L.route({space:V,resources:[D]})},...eS({selectedIds:n,selectedResources:g,emit:r}),...Z0({isResourceDisabled:E,isResourceSelected:v,emit:r}),...tS({resources:t,disabledResources:T,selectedIds:n,emit:r})}},$d=()=>{const{getMatchingSpace:e}=ln(),t=ze(),n=B({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=B({get(){return t.selectedIds},set(s){t.setSelection(s)}}),i=s=>f(r).includes(s.id),o=B(()=>{if(f(n).length!==1)return null;const s=f(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:i,selectedResourceSpace:o}};class cs{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function VL(e){const t=He(),n=qL(e),r=zL(e),i=B(()=>rS(f(n))||f(Md(f(s))?.name)),o=B(()=>HL(f(r))||WL(f(i),f(s))),s=e.fields;return{items:B(()=>{const u=f(e.items);return f(i)?nS(u,f(s),f(i),f(o)):u}),sortBy:i,sortDir:o,handleSort:({sortBy:u,sortDir:c})=>t.replace({query:{...f(t.currentRoute).query,[f(e.sortByQueryName)||cs.sortByQueryName]:u,[f(e.sortDirQueryName)||cs.sortDirQueryName]:c}})}}function qL(e){return e.sortBy?Ft(e.sortBy)?e.sortBy:le(e.sortBy):kr({name:f(e.sortByQueryName)||cs.sortByQueryName,defaultValue:f(Md(f(e.fields))?.name),storagePrefix:f(e.routeName)||f(Gf())})}function zL(e){return e.sortDir?Ft(e.sortDir)?e.sortDir:le(e.sortDir):kr({name:f(e.sortDirQueryName)||cs.sortDirQueryName,defaultValue:f(Md(f(e.fields))?.sortDir),storagePrefix:f(e.routeName)||f(Gf())})}const Md=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},WL=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?f(n.sortDir):pt.Desc},nS=(e,t,n,r)=>{const i=t.find(a=>a.name===n);if(!i)return e;const{sortable:o}=i,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const a=c=>c.type==="folder"&&!c.extension,l=[...e.filter(c=>a(c))].sort((c,p)=>Bd(c,p,s,n,r,o)),u=[...e.filter(c=>!a(c))].sort((c,p)=>Bd(c,p,s,n,r,o));return r===pt.Asc?l.concat(u):u.concat(l)}return[...e].sort((a,l)=>Bd(a,l,s,i.prop||i.name,r,o))},Bd=(e,t,n,r,i,o)=>{let s=Ec(e,r),a=Ec(t,r);const l=i===pt.Asc?1:-1;if(o)if(typeof o=="string"){const c=p=>p.map(d=>d[o]).join("");s=c(s),a=c(a)}else typeof o=="function"&&(s=o(s),a=o(a));return!isNaN(s)&&!isNaN(a)?(s-a)*l:n.compare((s||"").toString(),(a||"").toString())*l},rS=e=>Array.isArray(e)?e[0]:e,HL=e=>{switch(rS(e)){case pt.Asc:return pt.Asc;case pt.Desc:return pt.Desc}return null};function KL(e){const t=en(),n=li(),r=Ke(),i=Ie.useGettext(),o=B(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+Kr.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"]=i.current,u["Initiator-ID"]=r.initiatorId,u},a=B(()=>{const u={onBeforeRequest:(c,p)=>new Promise(d=>{const m=s();c.setHeader("Authorization",m.Authorization),c.setHeader("X-Request-ID",m["X-Request-ID"]),c.setHeader("Accept-Language",m["Accept-Language"]),c.setHeader("Initiator-ID",m["Initiator-ID"]),p?.isRemote&&c.setHeader("x-oc-mtime",(p?.data?.lastModified/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...s()}},u}),l=B(()=>({timeout:6e4,endpoint:"",headers:u=>({"x-oc-mtime":(u?.data?.lastModified/1e3).toFixed(0),...s()})}));st([a,l],()=>{if(f(o)){e.uppyService.useTus(f(a));return}e.uppyService.useXhr(f(l))},{immediate:!0})}const iS=()=>{const e=Ke(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:i}=Ea(),o=async a=>{try{const l=await e.graphAuthenticated.photos.getUserPhoto(a,{responseType:"blob"});t(a,URL.createObjectURL(l))}catch(l){l.response?.status===404&&t(a,null)}return n(a)};return{enqueueAvatar:a=>{if(n(a)!==void 0||i.has(a))return;const l=r.add(()=>o(a));i.set(a,l),l.finally(()=>i.delete(a))}}},GL=_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 t=dt(),{options:n}=Me.storeToRefs(t),r=B(()=>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=B(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...f(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...f(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(f(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),o=B(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:i,actionIcon:o}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},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}}}}),QL={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},XL=["textContent"],YL=["textContent"];function JL(e,t,n,r,i,o){const s=Ee("oc-image"),a=Ee("oc-icon"),l=Ee("oc-button"),u=sn("oc-tooltip");return ot((X(),pe("li",null,[ot((X(),Te(l,$t({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Os(e.componentListeners)),{default:ve(()=>[e.action.img?(X(),Te(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(X(),Te(s,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(X(),Te(a,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):Re("",!0),e.action.hideLabel?Re("",!0):(X(),pe("span",QL,[fe("span",{class:"text-left",textContent:z.toDisplayString(e.action.label(e.actionOptions))},null,8,XL)])),e.action.shortcut&&e.shortcutHint?(X(),pe("span",{key:4,class:"text-sm flex-row-reverse",textContent:z.toDisplayString(e.action.shortcut)},null,8,YL)):Re("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const tl=Ye(GL,[["render",JL]]),ZL=_e({name:"BatchActions",components:{ActionMenuItem:tl},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function e$(e,t,n,r,i,o){const s=Ee("action-menu-item"),a=Ee("oc-list");return X(),pe("div",null,[me(a,{id:"oc-appbar-batch-actions",class:z.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.actions,(l,u)=>(X(),Te(s,{key:`action-${u}`,action:l,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const oS=Ye(ZL,[["render",e$]]),t$={class:"context-menu px-2"},n$={class:"inline-flex gap-2"},r$={class:"flex oc-files-context-action-label"},i$=["textContent"],sS=_e({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=ci(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=ci(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,i)=>{const o=Ee("oc-icon"),s=Ee("oc-button"),a=Ee("oc-list");return X(),pe("li",t$,[me(s,{id:f(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:ve(()=>[fe("span",n$,[me(o,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),fe("span",r$,[fe("span",{textContent:z.toDisplayString(e.menuSectionDrop.label)},null,8,i$)])]),me(o,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),me(f(ZD),{title:e.menuSectionDrop.label,"drop-id":f(t),toggle:`#${f(n)}`,"is-nested-element":!0,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:ve(()=>[e.menuSectionDrop.items.length?(X(),Te(a,{key:0},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.menuSectionDrop.items,(l,u)=>(X(),Te(tl,{key:`section-${e.menuSectionDrop.label}-action-${u}`,action:l,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):Re("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),o$=_e({name:"ContextActionMenu",components:{ActionMenuDropItem:sS,ActionMenuItem:tl},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("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),s$={id:"oc-files-context-menu"};function a$(e,t,n,r,i,o){const s=Ee("action-menu-item"),a=Ee("action-menu-drop-item"),l=Ee("oc-list");return X(),pe("div",s$,[(X(!0),pe(Be,null,mt(e.menuSections,(u,c)=>(X(),Te(l,{id:`oc-files-context-actions-${u.name}`,key:`section-${u.name}-list`,class:z.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:ve(()=>[u.items?(X(!0),pe(Be,{key:0},mt(u.items,(p,d)=>(X(),Te(s,{key:`section-${u.name}-action-${d}`,action:p,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):Re("",!0),(X(!0),pe(Be,null,mt(u.dropItems,p=>(X(),pe(Be,null,[p.items.length?(X(),Te(a,{key:p.name,"menu-section-drop":p,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):Re("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const nl=Ye(o$,[["render",a$]]),l$=_e({name:"ContextActions",components:{ContextActionMenu:nl},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=Xn(),{$gettext:n}=Ie.useGettext(),{actions:r}=E0(),{actions:i}=Qa(),{actions:o}=Ja(),{actions:s}=Pa(),{actions:a}=nd(),{actions:l}=Ka(),{actions:u}=ss(),{actions:c}=Ga(),{actions:p}=as(),{actions:d}=Pd(),{actions:m}=Xa(),{actions:b}=R0(),{actions:w}=Ya(),{actions:S}=ls(),{actions:y}=I0(),{actions:g}=Od(),{actions:v}=kd(),{actions:h}=Fd(),E=Ki(),T=B(()=>E.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(Y=>Y.action)),R=B(()=>E.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(Y=>Y.action)),x=u1(e,"actionOptions"),A=B(()=>[...f(i),...f(l),...f(c),...f(m),...f(s),...f(u),...f(S),...f(v),...f(R).filter(Y=>Y.category==="actions"||Tt.isNil(Y.category))].filter(Y=>Y.isVisible(f(x)))),N=B(()=>[...f(g),...f(R).filter(Y=>Y.category==="sidebar")].filter(Y=>Y.isVisible(f(x)))),W=B(()=>f(r).filter(Y=>Y.isVisible(f(x))).sort((Y,se)=>Number(se.hasPriority)-Number(Y.hasPriority))),O=B(()=>t({...f(x),omitSystemActions:!0}).filter(Y=>Y.isVisible(f(x))).sort((Y,se)=>Number(se.hasPriority)-Number(Y.hasPriority))),D=B(()=>[...f(h),...f(a),...f(T).filter(Y=>Y.category==="share")].filter(Y=>Y.isVisible(f(x)))),V=B(()=>[...f(c),...f(p),...f(u),...f(m),...f(s),...f(b),...f(w),...f(v),...f(S),...f(i),...f(l),...f(o),...f(y),...f(T).filter(Y=>Y.category==="actions"||Tt.isNil(Y.category))].filter(Y=>Y.isVisible(f(x)))),L=B(()=>[...f(d).map(Y=>(Y.keepOpen=!0,Y)),...f(g),...f(T).filter(Y=>Y.category==="sidebar")].filter(Y=>Y.isVisible(f(x))));return{menuSections:B(()=>{const Y=[];return f(x).resources.length>1?(f(A).length&&Y.push({name:"batch-actions",items:[...f(A)]}),Y.push({name:"batch-details",items:[...f(N)]}),Y):([...f(W),...f(O)].length&&Y.push({name:"context",items:[...f(W)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...f(O)]}]}),f(D).length&&Y.push({name:"share",items:f(D)}),f(V).length&&Y.push({name:"actions",items:f(V)}),f(L).length&&Y.push({name:"sidebar",items:f(L)}),Y)})}}});function c$(e,t,n,r,i,o){const s=Ee("context-action-menu");return X(),Te(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const aS=Ye(l$,[["render",c$]]),u$={class:"flex items-center"},f$={class:"flex justify-between w-full"},d$={class:"flex items-center"},p$=["textContent"],h$={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},m$={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},g$={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},y$={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},v$={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},b$={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},w$=["textContent"],S$=["max"],lS=Ye(_e({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>io.options},perPageQueryName:{default:()=>io.perPageQueryName},perPageDefault:{default:()=>io.perPageDefault},viewModeDefault:{default:()=>nn.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=He(),n=Ht(),{$gettext:r}=Ie.useGettext(),{isSideBarOpen:i}=Sa(),o=ze(),{setAreHiddenFilesShown:s,setAreFileExtensionsShown:a,setAreDisabledSpacesShown:l,setAreEmptyTrashesShown:u}=o,{areHiddenFilesShown:c,areFileExtensionsShown:p,areDisabledSpacesShown:d,areEmptyTrashesShown:m}=Me.storeToRefs(o),b=le(!1),w=Qn(xt,"files-spaces-projects"),S=Qn(yn,"files-trash-overview"),y=tn("page"),g=B(()=>f(y)?parseInt(Ct(f(y))):1),v=kr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),h=kr({name:nn.queryName,defaultValue:e.viewModeDefault}),E=kr({name:nn.tilesSizeQueryName,defaultValue:nn.tilesSizeDefault.toString()}),T=Y=>t.replace({query:{...f(n).query,[e.perPageQueryName]:Y.toString(),...f(g)>1&&{page:"1"}}}),R=Y=>{h.value=Y.name};st([v,h,E],Y=>{b.value=Y.some(se=>!se)},{immediate:!0,deep:!0});const x=Dd(),A=B({get(){return f(c)},set(Y){s(Y)}}),N=B({get(){return f(p)},set(Y){a(Y)}}),W=B({get(){return f(d)},set(Y){l(Y)}}),O=B({get(){return f(m)},set(Y){u(Y)}}),D=Y=>{A.value=Y},V=Y=>{N.value=Y},L=Y=>{W.value=Y},te=Y=>{O.value=Y};return(Y,se)=>{const he=Ee("oc-icon"),ae=Ee("oc-button"),we=Ee("oc-list"),Q=Ee("oc-drop"),ie=Ee("oc-switch"),ce=Ee("oc-page-size"),Ae=sn("oc-tooltip");return X(),pe("div",u$,[e.viewModes.length?(X(),pe(Be,{key:0},[ot((X(),Te(ae,{id:"mobile-viewmode-switch-toggle","aria-label":f(r)("Switch view mode"),appearance:"raw",class:z.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!f(i),"md:hidden":f(i)}])},{default:ve(()=>[me(he,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[Ae,f(r)("Switch view mode")]]),me(Q,{title:f(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:ve(()=>[me(we,null,{default:ve(()=>[(X(!0),pe(Be,null,mt(e.viewModes,ee=>(X(),pe("li",{key:ee.name},[me(ae,{appearance:f(h)===ee.name?"filled":"raw","color-role":f(h)===ee.name?"secondaryContainer":"secondary","justify-content":"left",onClick:F=>R(ee)},{default:ve(()=>[fe("div",f$,[fe("span",d$,[me(he,{name:ee.icon.name,"fill-type":ee.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),fe("span",{textContent:z.toDisplayString(ee.label)},null,8,p$)]),f(h)===ee.name?(X(),Te(he,{key:0,name:"check",size:"medium"})):Re("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):Re("",!0),e.viewModes.length>1?(X(),pe("div",{key:1,class:z.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!f(i),"md:inline-flex":f(i)}])},[(X(!0),pe(Be,null,mt(e.viewModes,ee=>ot((X(),Te(ae,{key:ee.name,"no-hover":f(h)===ee.name,class:z.normalizeClass([ee.name]),appearance:f(h)===ee.name?"filled":"outline","color-role":f(h)===ee.name?"secondaryContainer":"secondary","aria-label":f(r)("Switch to %{viewMode}",{viewMode:ee.label}),onClick:F=>R(ee)},{default:ve(()=>[me(he,{name:ee.icon.name,"fill-type":ee.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[Ae,f(r)("Switch to %{viewMode}",{viewMode:ee.label})]])),128))],2)):Re("",!0),ot((X(),Te(ae,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":f(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:ve(()=>[me(he,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[Ae,f(r)("Display customization options of the files list")]]),me(Q,{title:f(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:ve(()=>[me(we,null,{default:ve(()=>[e.hasHiddenFiles?(X(),pe("li",h$,[me(ie,{checked:A.value,"onUpdate:checked":[se[0]||(se[0]=ee=>A.value=ee),D],"data-testid":"files-switch-hidden-files",label:f(r)("Show hidden files")},null,8,["checked","label"])])):Re("",!0),e.hasFileExtensions?(X(),pe("li",m$,[me(ie,{checked:N.value,"onUpdate:checked":[se[1]||(se[1]=ee=>N.value=ee),V],"data-testid":"files-switch-files-extensions-files",label:f(r)("Show file extensions")},null,8,["checked","label"])])):Re("",!0),e.hasPagination?(X(),pe("li",g$,[b.value?Re("",!0):(X(),Te(ce,{key:0,selected:f(Ct)(f(v)),"data-testid":"files-pagination-size",label:f(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:T},null,8,["selected","label","options"]))])):Re("",!0),f(w)?(X(),pe("li",y$,[me(ie,{checked:W.value,"onUpdate:checked":[se[2]||(se[2]=ee=>W.value=ee),L],"data-testid":"files-switch-projects-show-disabled",label:f(r)("Show disabled Spaces")},null,8,["checked","label"])])):Re("",!0),f(S)?(X(),pe("li",v$,[me(ie,{checked:O.value,"onUpdate:checked":[se[3]||(se[3]=ee=>O.value=ee),te],"data-testid":"files-switch-projects-show-disabled",label:f(r)("Show empty trash bins")},null,8,["checked","label"])])):Re("",!0),f(h)===f(nn).name.tiles?(X(),pe("li",b$,[fe("label",{for:"tiles-size-slider",textContent:z.toDisplayString(f(r)("Tile size"))},null,8,w$),ot(fe("input",{id:"tiles-size-slider","onUpdate:modelValue":se[4]||(se[4]=ee=>Ft(E)?E.value=ee:null),type:"range",min:1,max:f(x),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,S$),[[$l,f(E)]])])):Re("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-15b0e205"]]),E$=_e({name:"AppBar",components:{BatchActions:oS,ContextActions:aS,ViewOptions:lS},props:{viewModeDefault:{type:String,required:!1,default:()=>nn.defaultModeName},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},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=at(),{$gettext:r}=Ie.useGettext(),{can:i}=fn(),o=He(),{requestExtensions:s}=Ki(),{isSticky:a}=_d(),l=ze(),{selectedResources:u}=Me.storeToRefs(l),c=B(()=>e.space),{actions:p}=Qa(),{actions:d}=Ja(),{actions:m}=Pa(),{actions:b}=$0(),{actions:w}=Ka(),{actions:S}=ss(),{actions:y}=Ga(),{actions:g}=as(),{actions:v}=Xa(),{actions:h}=ls(),{actions:E}=N0(),{actions:T}=L0(),{actions:R}=j0(),{actions:x}=q0(),A=le(0),N=Qn(Vt,"files-common-search"),W=B(()=>Object.hasOwn(Vp(),"navigation")&&i("create-all","Share")),O=B(()=>{let Q=[...f(d),...f(p),...f(w),...f(y),...f(g),...f(v),...f(m),...f(S),...f(h)];N.value||(Q=[...Q,...f(b),...f(R),...f(x),...f(E),...f(T)]);const ie=s({id:"global.files.batch-actions",extensionType:"action"});return ie.length&&(Q=[...Q,...ie.map(ce=>ce.action)]),Q.filter(ce=>ce.isVisible({space:f(c),resources:l.selectedResources}))}),D=B(()=>n.spaces.filter(Q=>re.isPersonalSpaceResource(Q)||re.isProjectSpaceResource(Q))),V=wr("isMobileWidth"),L=Qn(yn,"files-trash-generic"),te=B(()=>!f(V)&&e.breadcrumbs.length?!0:f(L)&&f(D).length===1?!1:e.breadcrumbs.length>1),Y=B(()=>f(L)&&f(D).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),se=B(()=>f(c)&&(re.isProjectSpaceResource(f(c))||re.isShareSpaceResource(f(c)))?3:2),he=Q=>{t(um,Q)},ae=Wb("title"),we=B(()=>f(ae)?r(f(ae)):f(c)?.name||"");return{router:o,hasSharesNavigation:W,batchActions:O,showBreadcrumb:te,showMobileNav:Y,breadcrumbMaxWidth:A,breadcrumbTruncationOffset:se,fileDroppedBreadcrumb:he,pageTitle:we,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return Xd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||yn(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(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),T$={class:"files-topbar py-2 w-full"},A$=["textContent"],x$={key:3,id:"files-app-bar-controls-right",class:"flex"},R$={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},C$={class:"flex-1 flex justify-start items-center"},k$={key:1};function P$(e,t,n,r,i,o){const s=Ee("oc-hidden-announcer"),a=Ee("context-actions"),l=Ee("oc-breadcrumb"),u=Ee("portal-target"),c=Ee("view-options"),p=Ee("batch-actions"),d=Ee("oc-spinner");return X(),pe("div",{id:"files-app-bar",ref:"filesAppBar",class:z.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[fe("div",T$,[fe("h1",{class:"sr-only",textContent:z.toDisplayString(e.pageTitle)},null,8,A$),me(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),fe("div",{class:z.normalizeClass(["flex items-center files-app-bar-controls min-h-13",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(X(),Te(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,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:ve(()=>[me(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","mobile-breakpoint","onItemDroppedBreadcrumb"])):Re("",!0),e.showMobileNav?(X(),Te(u,{key:1,name:"app.runtime.mobile.nav"})):Re("",!0),e.hasSharesNavigation?Ue(e.$slots,"navigation",{key:2}):Re("",!0),e.hasViewOptions?(X(),pe("div",x$,[me(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"])])):Re("",!0)],2),fe("div",R$,[fe("div",C$,[Ue(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(X(),Te(p,{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"])):e.showBatchActions&&e.batchActionsLoading?(X(),pe("div",k$,[me(d,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):Re("",!0)])]),Ue(e.$slots,"content")])],2)}const I$=Ye(E$,[["render",P$]]),O$=_e({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=nt(),{$gettext:i}=Ie.useGettext(),{createSpace:o}=Qi(),{isSpaceNameValid:s}=Ei(),{dispatchModal:a}=ht(),l=at(),{upsertResource:u}=ze(),c=async d=>{try{const m=await o(d);u(m),l.upsertSpace(m),t("spaceCreated",m),n({title:i("Space was created successfully")})}catch(m){console.error(m),r({title:i("Creating space failed…"),errors:[m]})}};return{showCreateSpaceModal:()=>{a({title:i("Create a new space"),confirmText:i("Create"),hasInput:!0,inputLabel:i("Space name"),inputValue:i("New space"),inputRequiredMark:!0,onConfirm:d=>c(d),onInput:(d,m)=>{const{isValid:b,error:w}=s(d);m(b?null:w)}})}}}}),F$=["textContent"];function _$(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=sn("oc-tooltip");return ot((X(),Te(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:ve(()=>[me(s,{name:"add"}),e.showLabel?(X(),pe("span",{key:0,textContent:z.toDisplayString(e.$gettext("New Space"))},null,8,F$)):Re("",!0)]),_:1},8,["aria-label","onClick"])),[[l,e.showLabel?void 0:e.$gettext("New space")]])}const D$=Ye(O$,[["render",_$]]),N$={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},L$={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},$$={class:"open-file-bar flex"},M$={class:"flex"},B$={key:1,class:"flex items-center","data-testid":"autosave-indicator"},cS=_e({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=Ie.useGettext(),r=ze(),i=dt(),{getMatchingSpace:o}=ln(),{getParentFolderName:s,getPathPrefix:a,getParentFolderLinkIconAdditionalAttributes:l}=Yr(),u=B(()=>r.areFileExtensionsShown),c=B(()=>t("Show context menu")),p=B(()=>e.isEditor&&e.hasAutoSave&&i.options.editor.autosaveEnabled),d=B(()=>{const w=Ut.Duration.fromObject({seconds:i.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:w.toHuman()})}),m=B(()=>o(e.resource)),b=B(()=>!re.isPublicSpaceResource(f(m)));return(w,S)=>{const y=Ee("oc-icon"),g=Ee("oc-button"),v=Ee("oc-drop"),h=Ee("portal"),E=sn("oc-tooltip");return X(),Te(h,{to:"app.runtime.header.left"},{default:ve(()=>[fe("div",N$,[fe("div",L$,[fe("div",$$,[e.resource?(X(),Te(os,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":u.value,"path-prefix":f(a)(e.resource),resource:e.resource,"parent-folder-name":f(s)(e.resource),"parent-folder-link-icon-additional-attributes":f(l)(e.resource),"is-path-displayed":b.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):Re("",!0)]),fe("div",M$,[e.dropDownMenuSections.length?(X(),pe(Be,{key:0},[ot((X(),Te(g,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:ve(()=>[me(y,{name:"more-2"})]),_:1},8,["aria-label"])),[[E,c.value]]),me(v,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:S[0]||(S[0]=Wt(()=>{},["stop","prevent"]))},{default:ve(()=>[me(nl,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):Re("",!0),p.value&&!e.isReadOnly?(X(),pe("span",B$,[ot(me(y,{"accessible-label":d.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[E,d.value]])])):Re("",!0),e.mainActions.length&&e.resource?(X(),Te(nl,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(T=>T.isVisible()).map(T=>({...T,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):Re("",!0),me(g,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":f(t)("Close"),onClick:S[1]||(S[1]=T=>w.$emit("close"))},{default:ve(()=>[me(y,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}}}),j$=_e({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),U$={class:"text-center flex justify-center items-center h-full"},V$={key:0,class:"text-xl"};function q$(e,t,n,r,i,o){const s=Ee("oc-icon");return X(),pe("div",U$,[me(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(X(),pe("p",V$,z.toDisplayString(e.message),1)):Re("",!0)])}const z$=Ye(j$,[["render",q$]]),W$=_e({name:"LoadingScreen"}),H$={class:"text-center flex justify-center items-center h-full"},K$=["textContent"];function G$(e,t,n,r,i,o){const s=Ee("oc-spinner");return X(),pe("div",H$,[me(s,{size:"xlarge"}),fe("p",{class:"sr-only",textContent:z.toDisplayString(e.$gettext("Loading app"))},null,8,K$)])}const Q$=Ye(W$,[["render",G$]]),X$=["id","data-testid","tabindex","inert"],Y$={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},J$={class:"col-start-2 text-center my-0 text-lg"},Z$={key:0,class:"mt-4"},uS=Ye(_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}=Ie.useGettext(),i=Tn("appSideBar"),o=B(()=>e.availablePanels.filter(A=>A.isVisible(e.panelContext)&&A.isRoot?.(e.panelContext))),s=B(()=>e.availablePanels.filter(A=>A.isVisible(e.panelContext)&&!A.isRoot?.(e.panelContext))),a=B(()=>f(o).length?[f(o)[0],...f(s)]:f(s)),l=B(()=>{const A=e.activePanel?.split("#")[0];return!A||!f(s).map(N=>N.name).includes(A)?null:A}),u=B(()=>f(l)!==null),c=B(()=>f(l)===null),p=le(null),d=A=>{p.value=A},m=B(()=>f(u)?f(l):f(o)[0].name),b=B(()=>f(o).length===1?r("Back to %{panel} panel",{panel:f(o)[0].title(e.panelContext)}):r("Back to main panels")),w=le(window.innerWidth),S=B(()=>f(w)<=580),y=B(()=>f(i)?.parentElement?.querySelector("div")),g=()=>{if(!f(y))return;const A=f(S)?"hidden":"visible";f(y).style.visibility=A},v=()=>{e.isOpen&&(w.value=window.innerWidth,g())};st(()=>e.isOpen,async A=>{A&&(await zt(),g())},{immediate:!0});const h=A=>{n("selectPanel",A)},E=()=>{n("selectPanel",null)},T=()=>{n("close")},R=A=>{d(f(m)),h(A)},x=()=>{d(f(m)),E(),f(i).focus()};return Lt(()=>{window.addEventListener("resize",v)}),An(()=>{window.removeEventListener("resize",v),f(y)&&(f(y).style.visibility="visible")}),(A,N)=>{const W=Ee("oc-spinner"),O=Ee("oc-icon"),D=Ee("oc-button"),V=sn("oc-tooltip");return X(),pe("div",{id:"app-sidebar",ref_key:"appSideBar",ref:i,"data-testid":"app-sidebar",tabindex:"-1",class:z.normalizeClass(["border-l focus:outline-0 focus-visible:outline-0 w-[440px] min-w-[440px] overflow-hidden relative focus:shadow-none focus-visible:shadow-none",{"flex justify-center items-center":e.loading,"w-full min-w-full":S.value}])},[e.loading?(X(),Te(W,{key:0})):(X(!0),pe(Be,{key:1},mt(a.value,L=>(X(),pe("div",{id:`sidebar-panel-${L.name}`,key:`panel-${L.name}`,"data-testid":`sidebar-panel-${L.name}`,tabindex:m.value===L.name?-1:null,class:z.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface rounded-r-xl w-full size-full max-w-full max-h-full overflow-hidden motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":L.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===L.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":c.value&&L.isRoot?.(e.panelContext)}]),inert:m.value!==L.name},[[m.value,p.value].includes(L.name)?(X(),pe("div",Y$,[L.isRoot?.(e.panelContext)?Re("",!0):ot((X(),Te(D,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":b.value,onClick:x},{default:ve(()=>[me(O,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[V,b.value]]),fe("h2",J$,z.toDisplayString(L.title(e.panelContext)),1),me(D,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":f(r)("Close file sidebar"),onClick:T},{default:ve(()=>[me(O,{name:"close"})]),_:1},8,["aria-label"])])):Re("",!0),fe("div",null,[L.isRoot?.(e.panelContext)?Ue(A.$slots,"rootHeader",{key:0},void 0,!0):Ue(A.$slots,"subHeader",{key:1},void 0,!0)]),fe("div",{class:z.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${L.name}`]])},[fe("div",{class:z.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!L.isRoot?.(e.panelContext)}])},[Ue(A.$slots,"body",{},()=>[(X(!0),pe(Be,null,mt(L.isRoot?.(e.panelContext)?o.value:[L],(te,Y)=>(X(),pe("div",{key:`sidebar-panel-${te.name}`},[(c.value?te.isRoot?.(e.panelContext):[m.value,p.value].includes(te.name))?(X(),Te(Pn(te.component),$t({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":Y>0},"rounded-sm"]},{ref_for:!0},te.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):Re("",!0)]))),128))],!0)],2),L.isRoot?.(e.panelContext)&&s.value.length>0?(X(),pe("div",Z$,[(X(!0),pe(Be,null,mt(s.value,te=>(X(),Te(D,{id:`sidebar-panel-${te.name}-select`,key:`panel-select-${te.name}`,"data-testid":`sidebar-panel-${te.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:Y=>R(te.name)},{default:ve(()=>[me(O,{name:te.icon,"fill-type":te.iconFillType},null,8,["name","fill-type"]),kt(" "+z.toDisplayString(te.title(e.panelContext))+" ",1),me(O,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Re("",!0)],2)],10,X$))),128))],2)}}}),[["__scopeId","data-v-b2b7e1e8"]]),eM={class:"grid items-center p-2"},tM={class:"flex items-center text-sm"},nM=["textContent"],rM=["textContent"],jd=_e({__name:"SpaceInfo",setup(e){const t=wr("resource");return(n,r)=>{const i=Ee("oc-icon");return X(),pe("div",eM,[fe("div",tM,[me(i,{name:"layout-grid",size:f(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),fe("div",null,[fe("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:z.toDisplayString(f(t).name)},null,8,nM),fe("span",{"data-testid":"space-info-subtitle",textContent:z.toDisplayString(f(t).description)},null,8,rM)])])])}}}),iM={class:"flex justify-between p-2"},oM={class:"flex items-center"},sM={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},Ud=_e({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=ze(),{isPersonalSpaceRoot:n}=ln(),r=wr("resource"),i=wr("space"),o=B(()=>t.areFileExtensionsShown),s=B(()=>n(f(r))?f(i).name:f(r).name);return(a,l)=>(X(),pe("div",iM,[fe("div",oM,[e.isSubPanelActive?(X(),Te(is,{key:0,resource:f(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):Re("",!0),fe("div",null,[fe("h3",sM,[me(Cd,{name:s.value,extension:f(r).extension,type:f(r).type,"full-path":f(r).webDavPath,"is-extension-displayed":o.value,"is-path-displayed":!1,"truncate-name":!1,class:"[&_span]:break-all"},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),fS=_e({__name:"FileSideBar",props:{isOpen:{type:Boolean},activePanel:{default:()=>{}},space:{default:()=>{}}},setup(e){const t=He(),n=Ke(),r=Ki(),i=ur(),o=at(),s=Cr(),a=dt(),l=ar(),{canListShares:u}=O0(),{canListVersions:c}=Q0(),p=ze(),{currentFolder:d}=Me.storeToRefs(p),m=le(),b=le([]),w=le([]),S=le([]),{selectedResources:y}=$d(),g=le(!1),v=B(()=>f(g)),h=B(()=>f(y).length===0?{root:e.space,parent:null,items:f(d)?.id?[f(d)]:[]}:{root:e.space,parent:f(d),items:f(y)}),E=Qn(Mt,"files-shares-with-me"),T=Qn(Mt,"files-shares-with-others"),R=Qn(Mt,"files-shares-via-link"),x=xt(t,"files-spaces-projects"),A=Qn(Vt,"files-common-favorites"),N=Qn(Vt,"files-common-search"),W=()=>{i.publish(Rt.close)},O=Q=>{i.publish(Rt.setActivePanel,Q)},D=B(()=>f(h).items?.length===1&&!re.isProjectSpaceResource(f(h).items[0])),V=B(()=>f(h).items?.length===1&&re.isProjectSpaceResource(f(h).items[0])),L=B(()=>f(E)||f(T)||f(R)),te=B(()=>f(L)||f(N)||f(A)),Y=B(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(Q=>Q.panel)),se=rn.useTask(function*(Q,ie){b.value=yield n.webdav.listFileVersions(ie.id,{signal:Q})}),he=rn.useTask(function*(Q,ie){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:ce,linkShares:Ae}=s,ee=n.graphAuthenticated.permissions;let F=e.space?.id;if(re.isShareSpaceResource(e.space)){const Fe=yield o.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:Q});Fe&&(F=Fe.root.remoteItem.rootId)}const{shares:C,allowedRoles:q}=yield*re.call(ee.listPermissions(F,ie.fileId,s.graphRoles,{},{signal:Q})),K=C.filter(re.isCollaboratorShare),j=C.filter(re.isLinkShare),H=Object.values(s.graphRoles);if(w.value=q?.map(Fe=>({...Fe,icon:H.find(ye=>ye.id===Fe.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Fe}=yield*re.call(ee.listPermissions(F,ie.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Db.LibreGraphPermissionsRolesAllowedValues]},{signal:Q}));S.value=Fe?.map(ye=>({...ye,icon:H.find(We=>We.id===ye.id)?.icon}))||[]}!f(te)&&!f(x)&&(ce.forEach(Fe=>{K.some(ye=>ye.id===Fe.id)||K.push({...Fe,indirect:!0})}),Ae.forEach(Fe=>{j.some(ye=>ye.id===Fe.id)||j.push({...Fe,indirect:!0})})),Vt(t,"files-common-search")&&(yield p.loadAncestorMetaData({folder:f(ie),space:e.space,client:n.webdav,signal:Q}));const xe=[...ce,...Ae].map(({resourceId:Fe})=>Fe),De=Object.values(p.ancestorMetaData).filter(({id:Fe,path:ye})=>Fe===ie.id||xe.includes(Fe)||re.isIncomingShareResource(ie)?!1:re.isPersonalSpaceResource(e.space)?ye!=="/":!0).map(({id:Fe})=>Fe);f(te)&&re.isProjectSpaceResource(e.space)&&!re.isProjectSpaceResource(ie)&&De.push(e.space.id);const Oe=new Lr({concurrency:a.options.concurrentRequests.shares.list}),Ce=[...new Set(De)].map(Fe=>Oe.add(()=>n.graphAuthenticated.permissions.listPermissions(F,Fe,s.graphRoles,{},{signal:Q}).then(ye=>{const We=ye.shares.map(Ge=>({...Ge,indirect:!0}));K.push(...We.filter(re.isCollaboratorShare)),j.push(...We.filter(re.isLinkShare))})));yield Promise.allSettled(Ce),s.setCollaboratorShares(K),s.setLinkShares(j),s.setLoading(!1)}).restartable(),ae=le();st(()=>[...f(h).items,e.isOpen],async(Q,ie)=>{if(f(h).items?.length!==1)return;if(!e.isOpen){ae.value=void 0,b.value=[];return}const ce=Q?.[0],Ae=ie?.[0];if(ce?.id===Ae?.id&&ce?.mdate===f(ae))return;const ee=f(h).items[0];if(ae.value=ee.mdate,se.isRunning&&se.cancelAll(),!!c({space:e.space,resource:ee}))try{await se.perform(ee)}catch(F){console.error(F)}},{immediate:!0,deep:!0});const we=B(()=>f(h).items.map(Q=>Q.id));return st(()=>[we,e.isOpen],async()=>{if(!e.isOpen||!f(h).items?.length){s.pruneShares(),m.value=null;return}if(f(h).items?.length!==1)return;const Q=f(h).items[0];if(g.value=!0,re.isProjectSpaceResource(Q)&&await o.loadGraphPermissions({ids:[Q.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:Q}))try{he.isRunning&&he.cancelAll(),he.perform(Q)}catch(ie){console.error(ie)}if(!re.isOutgoingShareResource(Q)&&!re.isIncomingShareResource(Q)){m.value=Q,g.value=!1;return}try{const ie=await n.webdav.getFileInfo(e.space,{path:Q.path}),ce={...ie,...Q,tags:ie.tags};m.value=ce}catch(ie){m.value=Q,console.error(ie)}g.value=!1},{deep:!0,immediate:!0}),ni("resource",tr(m)),ni("versions",tr(b)),ni("space",B(()=>e.space)),ni("activePanel",B(()=>e.activePanel)),ni("availableInternalShareRoles",tr(w)),ni("availableExternalShareRoles",tr(S)),ni("versionsLoading",B(()=>se.isRunning)),(Q,ie)=>e.isOpen?(X(),Te(uS,$t({key:0,ref:"sidebar",class:"files-side-bar z-30","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":Y.value,"panel-context":h.value,loading:v.value},Q.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:O,onClose:W}),{rootHeader:ve(()=>[D.value?(X(),Te(Ud,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):V.value?(X(),Te(jd,{key:1})):Re("",!0)]),subHeader:ve(()=>[D.value?(X(),Te(Ud,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):V.value?(X(),Te(jd,{key:1})):Re("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading"])):Re("",!0)}}),aM=_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=cr(),{currentTheme:t}=Me.storeToRefs(e),n=le(),r=le(!0);return{confirmDisabled:r,onDateChanged:({date:o,error:s})=>{r.value=s||!o,n.value=o},currentTheme:t,dateTime:n}}}),lM={class:"flex justify-end items-center mt-2"};function cM(e,t,n,r,i,o){const s=Ee("oc-datepicker"),a=Ee("oc-button");return X(),pe(Be,null,[me(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),fe("div",lM,[me(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm",e.dateTime))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const uM=Ye(aM,[["render",cM]]),fM=_e({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=ht();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),dM=["textContent"],pM={class:"flex justify-end items-center mt-4"},hM={class:"oc-modal-body-actions-grid"};function mM(e,t,n,r,i,o){const s=Ee("oc-button");return X(),pe(Be,null,[fe("span",{class:"inline-block mb-4",textContent:z.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,dM),t[2]||(t[2]=fe("div",{class:"my-4"},null,-1)),fe("div",pM,[fe("div",hM,[me(s,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(s,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),me(s,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const dS=Ye(fM,[["render",mM]]);var gM=/\s/;function yM(e){for(var t=e.length;t--&&gM.test(e.charAt(t)););return t}var vM=/^\s+/;function bM(e){return e&&e.slice(0,yM(e)+1).replace(vM,"")}var pS=NaN,wM=/^[-+]0x[0-9a-f]+$/i,SM=/^0b[01]+$/i,EM=/^0o[0-7]+$/i,TM=parseInt;function AM(e){if(typeof e=="number")return e;if(Js(e))return pS;if(rr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=bM(e);var n=SM.test(e);return n||EM.test(e)?TM(e.slice(2),n?2:8):wM.test(e)?pS:+e}const xM=["id"],RM=["textContent"],CM={key:3,class:"flex size-full"},hS=_e({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=Ie.useGettext(),r=ar(),{showMessage:i,showErrorMessage:o}=nt(),s=ds.useRouter(),a=Ht(),l=Ke(),u=gn(),{getResourceContext:c}=X0(),{selectedResources:p}=$d(),{dispatchModal:d}=ht(),m=at(),b=dt(),w=ze(),S=Cr(),y=ur(),{isSideBarOpen:g,sideBarActivePanel:v}=Sa(),{actions:h}=x0({appId:e.applicationId}),{actions:E}=nd(),{actions:T}=as(),{actions:R}=Od(),{actions:x}=Fd(),{actions:A}=ss(),N=B(()=>!!e.wrappedComponent.emits?.includes("update:resource")),W=le(),O=le(),D=le(""),V=le(""),L=le(!f(N)),te=le(),Y=le(!1),se=le(),he=le();let ae="",we=null;const{actions:Q}=k0({content:he}),ie=B(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),ce=$e=>!!Object.keys(e.wrappedComponent.props).includes($e),Ae=B(()=>f(he)!==f(se)),ee=$e=>{$e.preventDefault()};st(Ae,$e=>{$e?window.addEventListener("beforeunload",ee):window.removeEventListener("beforeunload",ee)});const{applicationConfig:F,closeApp:C,currentFileContext:q,getFileContents:K,getFileInfo:j,getUrlForResource:H,putFileContents:ge,replaceInvalidFileRoute:xe,revokeUrl:De,activeFiles:Oe,loadFolderForFileContext:Ce,isFolderLoading:Fe}=ew({applicationId:e.applicationId}),{applicationMeta:ye}=ed({applicationId:e.applicationId,appsStore:r}),We=B(()=>f(ye).meta?.fileSizeLimit),Ge=B(()=>{const{name:$e}=f(ye);return t("%{appName} for %{fileName}",{appName:t($e),fileName:f(f(q).fileName)})}),Qe=Aa("driveAliasAndItem"),Xe=tn("fileId"),lt=B(()=>Ct(f(Xe))),Et=async()=>{const $e=f(lt),{space:je,path:bt}=await c($e),U=je.getDriveAliasAndItem({path:bt});return re.isPersonalSpaceResource(je)?s.push({params:{...f(a).params,driveAliasAndItem:U},query:{...f(a).query,fileId:$e,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:ft.dirname(U)}}}):s.push({params:{...f(a).params,driveAliasAndItem:U},query:{...f(a).query,fileId:$e,contextRouteName:bt==="/"?"files-shares-with-me":"files-spaces-generic",...re.isShareSpaceResource(je)&&{shareId:je.id},contextRouteParams:{driveAliasAndItem:ft.dirname(U)},contextRouteQuery:{...re.isShareSpaceResource(je)&&{shareId:je.id}}}})},Bt=rn.useTask(function*($e){try{f(Qe)||(yield Et()),O.value=f(f(q).space);const je=yield j(f(q),{signal:$e});if(W.value=je,re.isShareSpaceResource(f(O))&&(f(W).remoteItemId=f(O).id,f(W).id===f(W).remoteItemId)){const bt=yield*re.call(Ks({graphClient:l.graphAuthenticated,spacesStore:m,space:f(O)}));bt&&(W.value={...je,...re.buildIncomingShareResource({graphRoles:S.graphRoles,driveItem:bt,serverUrl:b.serverUrl}),tags:je.tags})}w.initResourceList({currentFolder:null,resources:[f(W)]}),p.value=[f(W)]}catch(je){console.error(je),te.value=je,L.value=!1}}).restartable(),jt=rn.useTask(function*($e){try{const je=e.importResourceWithExtension(f(W));if(je){const bt=Ut.DateTime.local().toFormat("yyyyMMddHHmmss"),U=`${f(W).name}_${bt}.${je}`;if(!(yield l.webdav.copyFiles(f(O),f(W),f(O),{path:U},{signal:$e})))throw new Error(t("Importing failed"));W.value={path:U}}if(xe(q,f(W)))return;if(Y.value=![vm.Updateable,vm.FileUpdateable].some(bt=>(f(W).permissions||"").indexOf(bt)>-1),f(ce("currentContent"))){const bt=yield*re.call(K(q,{...e.fileContentOptions,signal:$e}));se.value=he.value=bt.body,D.value=bt.headers["OC-ETag"]}f(ce("url"))&&(V.value=yield H(f(O),f(W),{...e.urlForResourceOptions,signal:$e}))}catch(je){console.error(je),te.value=je}finally{L.value=!1}}).restartable();st(q,async()=>{f(N)?O.value=f(f(q).space):(await Bt.perform(),f(We)&&AM(f(W).size)>f(We)?d({title:t("File exceeds %{threshold}",{threshold:vn(f(We),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:f(W).name,threshold:vn(f(We),n)}),confirmText:t("Continue"),onCancel:()=>{C()},onConfirm:()=>{jt.perform()}}):jt.perform())},{immediate:!0});const ct=$e=>{console.error($e),o({title:t("An error occurred"),desc:$e.message,errors:[$e]})},Ne=()=>{i({title:t("File autosaved")})},M=rn.useTask(function*(){const $e=f(he);try{const je=yield ge(q,{content:$e,previousEntityTag:f(D)});se.value=$e,D.value=je.etag,w.upsertResource(je)}catch(je){switch(je.statusCode){case 401:case 403:ct(new re.HttpError(t("You're not authorized to save this file"),je.response));break;case 409:case 412:ct(new re.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),je.response));break;case 507:const bt=m.spaces.find(U=>U.id===f(W).storageId&&re.isProjectSpaceResource(U));if(bt){ct(new re.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:bt.name}),je.response));break}ct(new re.HttpError(t("Insufficient quota for saving this file"),je.response));break;default:ct(new re.HttpError("",je.response))}}}).drop(),k=async()=>{await M.perform()};let I=null;Lt(()=>{if(ae=y.subscribe("runtime.resource.deleted",Pe),w.ancestorMetaData?.["/"]&&f(O)&&w.ancestorMetaData["/"].spaceId!==f(O).id&&w.setAncestorMetaData({}),!f(ie))return;const $e=b.options.editor;$e.autosaveEnabled&&!e.disableAutoSave&&(I=setInterval(async()=>{Ae.value&&(await k(),Ne())},($e.autosaveInterval||120)*1e3))}),An(()=>{y.unsubscribe("runtime.resource.deleted",ae),u.isLoading||window.removeEventListener("beforeunload",ee),f(ce("url"))&&De(V.value),f(ie)&&(clearInterval(I),I=null)});const{bindKeyAction:J}=Oa({skipDisabledKeyBindingsCheck:!0});J({modifier:Ia.Ctrl,primary:fr.S},()=>{f(Ae)&&k()});const G=B(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>f(ie)&&!f(Y),isDisabled:()=>!f(Ae),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:k}]),oe=B(()=>({space:f(O),resources:[f(W)]})),ne=async($e,je)=>{f(Ae)&&(await k(),Ne()),je($e)},Pe=$e=>{if($e.find(bt=>bt.id===f(W).id)){if(we)return we();C()}},Le=B(()=>[...f(h),...f(G),...f(Q).map($e=>({...$e,isVisible:je=>ie.value&&$e.isVisible(je)}))].filter($e=>$e.isVisible(f(oe)))),qe=B(()=>[...f(x),...f(E)].filter($e=>$e.isVisible(f(oe)))),Ze=B(()=>[...f(T).map($e=>({...$e,handler:je=>ne(je,$e.handler)})),...f(A)].filter($e=>$e.isVisible(f(oe)))),et=B(()=>[...f(R)].filter($e=>$e.isVisible(f(oe)))),Dr=B(()=>{const $e=[];return f(Le).length&&$e.push({name:"context",items:f(Le)}),f(qe).length&&$e.push({name:"share",items:f(qe)}),f(Ze).length&&$e.push({name:"actions",items:f(Ze)}),f(et).length&&$e.push({name:"sidebar",items:f(et)}),$e}),qt=B(()=>[...f(G)]);ds.onBeforeRouteLeave(($e,je,bt)=>{f(Ae)?d({title:t("Unsaved changes"),customComponent:dS,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{bt()}}),async onConfirm(){await k(),bt()}}):bt()});const Nr=B(()=>({url:f(V),space:f(f(q).space),resource:f(W),activeFiles:f(Oe),isDirty:f(Ae),isReadOnly:f(Y),applicationConfig:f(F),currentFileContext:f(q),currentContent:f(he),isFolderLoading:f(Fe),"onUpdate:resource":$e=>{O.value=f(f(q).space),W.value={...$e,...re.isShareSpaceResource(f(O))&&{remoteItemId:f(O).id}},p.value=[f(W)]},"onUpdate:currentContent":$e=>{he.value=$e},"onRegister:onDeleteResourceCallback":$e=>{we=$e},"onDelete:resource":()=>{f(A)[0].isVisible({space:f(O),resources:[f(W)]})&&f(A)[0].handler({space:f(O),resources:[f(W)]})},onSave:k,onClose:C,loadFolderForFileContext:Ce,revokeUrl:De,getUrlForResource:H}));return($e,je)=>(X(),pe("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:je[0]||(je[0]=bo((...bt)=>f(C)&&f(C)(...bt),["esc"]))},[fe("h1",{class:"sr-only",textContent:z.toDisplayString(Ge.value)},null,8,RM),!L.value&&!te.value&&W.value?(X(),Te(cS,{key:0,"main-actions":qt.value,"drop-down-menu-sections":Dr.value,"drop-down-action-options":oe.value,"has-auto-save":!e.disableAutoSave,"is-editor":ie.value,resource:W.value,"is-read-only":Y.value,onClose:f(C)},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","is-read-only","onClose"])):Re("",!0),L.value?(X(),Te(Q$,{key:1})):te.value?(X(),Te(z$,{key:2,message:te.value.message},null,8,["message"])):(X(),pe("div",CM,[Ue($e.$slots,"default",$t({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)] hidden xs:block":f(g)}]},Nr.value)),me(fS,{"is-open":f(g),"active-panel":f(v),space:O.value},null,8,["is-open","active-panel","space"])]))],40,xM))}});function kM(e,t){return _e({render(){return Ll(hS,{wrappedComponent:e,...t},{default:n=>Ll(e,n)})}})}const Vd=_e({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>re.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e){const{$gettext:t}=Ie.useGettext(),n=B(()=>t("Show context menu"));return(r,i)=>{const o=Ee("oc-icon"),s=Ee("oc-drop"),a=Ee("oc-button"),l=sn("oc-tooltip");return ot((X(),Te(a,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":n.value,appearance:"raw",class:"quick-action-button ml-1 p-1",onClick:i[0]||(i[0]=Wt(u=>r.$emit("quickActionClicked",{event:u,dropdown:r.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:ve(()=>[me(o,{name:"more-2"}),me(s,{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)}`,title:e.title,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":""},{default:ve(()=>[Ue(r.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[l,n.value]])}}}),PM=_e({name:"ResourceGhostElement",components:{ResourceIcon:is},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}}}),IM={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},OM={class:"relative rounded-sm bg-role-surface-container-high"},FM={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},_M={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},DM={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function NM(e,t,n,r,i,o){const s=Ee("resource-icon");return X(),pe("div",IM,[fe("div",OM,[me(s,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(X(),pe("div",FM)):Re("",!0),e.showThirdLayer?(X(),pe("div",_M)):Re("",!0)]),fe("span",DM,z.toDisplayString(e.itemCount),1)])}const qd=Ye(PM,[["render",NM]]),LM=_e({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Ie.useGettext();return{formattedSize:B(()=>vn(e.size,t))}}}),$M=["textContent"];function MM(e,t,n,r,i,o){return X(),pe("span",{textContent:z.toDisplayString(e.formattedSize)},null,8,$M)}const mS=Ye(LM,[["render",MM]]),gS=_e({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=Fl(),n=vt(),r=ze(),{interceptModifierClick:i}=gi(),o=B(()=>{const s=lb({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user,interceptModifierClick:i});return e.filter?s.filter(e.filter):s});return(s,a)=>o.value.length>0?(X(),Te(f(kN),$t({key:0},f(t),{indicators:o.value,resource:e.resource}),null,16,["indicators","resource"])):Re("",!0)}}),rl=_e({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=Ea(),{avatarMap:n}=Me.storeToRefs(t),{enqueueAvatar:r}=iS(),i=B(()=>f(n)[e.userId]);return Lt(()=>{r(e.userId)}),(o,s)=>{const a=Ee("oc-avatar");return X(),Te(a,{"user-name":e.userName,src:i.value,width:36},null,8,["user-name","src"])}}}),BM={class:z.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},jM={class:"flex flex-col items-center"},UM={class:"oc-button-group"},VM={key:0},qM=["src"],zM={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},WM=["textContent"],HM=_e({__name:"AvatarUpload",setup(e){const t=vt(),n=Ea(),{avatarMap:r}=Me.storeToRefs(n),{user:i}=Me.storeToRefs(t),{$gettext:o}=Ie.useGettext(),{showErrorMessage:s,showMessage:a}=nt(),{graphAuthenticated:l}=Ke(),{setCropperInstance:u}=td(),c=le(null),p=le(null),d=le(null),m=le(!1),b=le(!1),w=le(!1),S=le(null),y=xd*1024*1024,g=B(()=>!!f(r)[f(i).id]),v=W=>{const D=W.target.files?.[0];if(D){if(D.size>y){s({title:o("File size exceeds the limit of %{size}MB",{size:xd.toString()})});return}c.value=URL.createObjectURL(D),b.value=!0}};st(c,async W=>{W&&(await zt(),d.value&&d.value.destroy(),p.value&&(d.value=new il(p.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){m.value=!0}}),u(d)))});const h=()=>d.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),E=async W=>await new Promise(O=>{W.toBlob(D=>O(D),"image/png")}),T=()=>{S.value?.click()},R=()=>{b.value=!1,N()},x=async()=>{const W=h(),O=await E(W),D=URL.createObjectURL(O),V=new File([O],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await l.photos.updateOwnUserPhotoPatch(V),n.addAvatar(f(i).id,D),a({title:o("Profile picture was set successfully")})}catch(L){s({title:o("Failed to set profile picture"),errors:[L]})}b.value=!1,N()},A=async()=>{try{await l.photos.deleteOwnUserPhoto(),n.removeAvatar(f(i).id),a({title:o("Profile picture was removed successfully")})}catch(W){s({title:o("Failed to remove profile picture"),errors:[W]})}w.value=!1},N=()=>{d.value?.destroy(),d.value=null,S.value&&(S.value.value=""),c.value=null};return(W,O)=>{const D=Ee("oc-button"),V=Ee("oc-icon"),L=Ee("oc-modal");return X(),pe("div",BM,[fe("input",{ref_key:"fileInputRef",ref:S,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:v},null,544),fe("div",jM,[me(rl,{class:"mb-4",width:128,"user-id":f(i).id,"user-name":f(i).displayName},null,8,["user-id","user-name"]),fe("div",null,[fe("div",UM,[me(D,{size:"small",onClick:T},{default:ve(()=>[kt(z.toDisplayString(f(o)("Upload")),1)]),_:1}),g.value?(X(),Te(D,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:O[0]||(O[0]=te=>w.value=!0)},{default:ve(()=>[kt(z.toDisplayString(f(o)("Remove")),1)]),_:1})):Re("",!0)])])]),b.value?(X(),Te(L,{key:0,title:f(o)("Crop your new profile picture"),"button-cancel-text":f(o)("Cancel"),"button-confirm-text":f(o)("Set"),"button-confirm-disabled":!m.value,"focus-trap-initial":!1,onCancel:R,onConfirm:x},{content:ve(()=>[c.value?(X(),pe("div",VM,[fe("img",{ref_key:"imageRef",ref:p,class:"max-h-[400px]",src:c.value},null,8,qM),fe("div",zM,[me(V,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:z.toDisplayString(f(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:f(o)("+-"),panKeys:f(o)("↑↓←→")}))},null,8,WM)])])):Re("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):Re("",!0),w.value?(X(),Te(L,{key:1,message:f(o)("Are you sure you want to remove your profile picture?"),title:f(o)("Remove profile picture"),"button-cancel-text":f(o)("Cancel"),"button-confirm-text":f(o)("Remove"),onCancel:O[1]||(O[1]=te=>w.value=!1),onConfirm:A},null,8,["message","title","button-cancel-text","button-confirm-text"])):Re("",!0)])}}}),KM={class:"resource-table-select-all flex justify-center items-center"},GM={class:"truncate"},QM=["textContent"],XM=["textContent"],YM=["textContent"],JM={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},ZM=850,eB=_e({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>re.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},isSideBarOpen:{type:Boolean,default:!1},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>nn.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=He(),i=en(),{getMatchingSpace:o}=ln(),{interceptModifierClick:s}=gi(),{getParentFolderLink:a,getParentFolderLinkIconAdditionalAttributes:l,getParentFolderName:u,getPathPrefix:c}=Yr({space:le(e.space)}),{isSticky:p}=_d(),{$gettext:d,$ngettext:m,current:b}=Ie.useGettext(),{isLocationPicker:w,isFilePicker:S}=Qr(),{selectedResources:y,disabledResources:g,isResourceSelected:v,fileContainerClicked:h,fileNameClicked:E,fileCheckboxClicked:T,isResourceDisabled:R,isResourceInDeleteQueue:x,isResourceClickable:A,isResourceCut:N,getResourceLink:W,dragItem:O,dragSelection:D,dragStart:V,fileDropped:L,setDropStyling:te,shouldShowContextDrop:Y,showContextMenuOnRightClick:se,showContextMenuOnBtnClick:he,selectAllCheckboxLabel:ae,getResourceCheckboxLabel:we,toggleSelectionAll:Q,areAllResourcesSelected:ie}=Ld({space:B(()=>e.space),resources:B(()=>e.resources),selectedIds:B(()=>e.selectedIds),emit:n}),ce=li(),{userContextReady:Ae}=Me.storeToRefs(ce),ee=ze(),{areFileExtensionsShown:F,latestSelectedId:C}=Me.storeToRefs(ee),{width:q}=Yn.useWindowSize(),K=B(()=>i.filesTags&&q.value>=ZM),{actions:j}=Ya(),{actions:H}=V0(),ge=B(()=>f(j)[0].handler),xe=B(()=>f(H)[0].handler),De=Ne=>d("Search for tag %{tag}",{tag:Ne}),Oe=B(()=>{if(e.resources.length===0)return[];const Ne=e.resources[0],M=[];e.isSelectable&&M.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const k=dm(Ne);return M.push(...[{name:"name",title:d("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:d("Manager"),type:"slot"},{name:"members",title:d("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:d("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:d("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:d("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:d("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:d("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:d("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:d("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:d("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:d("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:d("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:I=>lt(I.mdate)+" ("+Xe(I.mdate)+")"},{name:"sdate",title:d("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:I=>lt(I.sdate)+" ("+Xe(I.sdate)+")"},{name:"ddate",title:d("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:I=>lt(I.ddate)+" ("+Xe(I.ddate)+")"}].filter(I=>{if(I.name==="tags"&&!f(K))return!1;if(I.name==="indicators")return!0;let J;return I.prop?J=Ec(Ne,I.prop)!==void 0:J=Object.prototype.hasOwnProperty.call(Ne,I.name),e.fieldsDisplayed?J&&e.fieldsDisplayed.includes(I.name):J}).map(I=>{const J=k.find(G=>G.name===I.name);return J&&Object.assign(I,{sortable:J.sortable,sortDir:J.sortDir}),I})),e.hasActions&&M.push({name:"actions",title:d("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),M}),Ce=Ne=>{const M=f(r.currentRoute).query?.term;return $i("files-common-search",{query:{provider:"files.sdk",q_tags:Ne,...M&&{term:M}}})},Fe=Ne=>f(Ae)?{to:Ce(Ne)}:{},ye=Ne=>Ne.id===f(C),We=Ne=>e.showRenameQuickAction?re.isProjectSpaceResource(Ne)?f(H).filter(M=>M.isVisible({resources:[Ne]})).length:f(j).filter(M=>M.isVisible({space:e.space,resources:[Ne]})).length:!1,Ge=Ne=>{if(re.isProjectSpaceResource(Ne))return f(xe)({resources:[Ne]});f(ge)({space:o(Ne),resources:[Ne]})},Qe=()=>{Je.publish(Rt.open)},Xe=Ne=>nb(new Date(Ne),b),lt=Ne=>ib(new Date(Ne),b),Et=Ne=>{if(!re.isShareResource(Ne))return;const M=Ne.type==="folder"?d("folder"):d("file"),k=Ne.sharedWith.filter(({shareType:I})=>re.ShareTypes.authenticated.includes(re.ShareTypes.getByValue(I))).length;return k?m("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",k,{resourceType:M,shareCount:k.toString()}):""},Bt=Ne=>{if(!re.isShareResource(Ne))return"";const M=Ne.type==="folder"?d("folder"):d("file");return d("This %{ resourceType } is shared by %{ user }",{resourceType:M,user:Ne.sharedBy.map(({displayName:k})=>k).join(", ")})},jt=Ne=>re.isShareResource(Ne)?Ne.sharedBy.map(M=>({displayName:M.displayName,name:M.displayName,avatarType:re.ShareTypes.user.key,username:M.id,userId:M.id})):[],ct=Ne=>re.isShareResource(Ne)?Ne.sharedWith.filter(({shareType:M})=>re.ShareTypes.authenticated.includes(re.ShareTypes.getByValue(M))).map(M=>({displayName:M.displayName,name:M.displayName,avatarType:re.ShareTypes.getByValue(M.shareType).key,username:M.id,userId:M.id})):[];return(Ne,M)=>{const k=Ee("oc-checkbox"),I=Ee("oc-icon"),J=Ee("oc-tag"),G=Ee("oc-avatars"),oe=sn("oc-tooltip");return X(),pe(Be,null,[me(f(UN),$t(Ne.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===f(nn).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:Oe.value,highlighted:e.selectedIds,disabled:f(g),sticky:f(p),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:f(y),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:M[1]||(M[1]=ne=>f(h)({resource:ne[0],event:ne[1]})),onContextmenuClicked:M[2]||(M[2]=(ne,Pe,Le)=>f(se)(Pe,Le)),onItemDropped:M[3]||(M[3]=ne=>f(L)(ne[0],ne[1])),onItemDragged:M[4]||(M[4]=ne=>f(V)(ne[0],ne[1])),onDropRowStyling:f(te),onSort:M[5]||(M[5]=ne=>Ne.$emit("sort",ne)),"onUpdate:modelValue":M[6]||(M[6]=ne=>Ne.$emit("update:modelValue",ne))}),jp({name:ve(({item:ne})=>[fe("div",{class:z.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":We(ne)}]])},[Ue(Ne.$slots,"image",{resource:ne}),(X(),Te(os,{key:`${ne.path}-${e.resourceDomSelector(ne)}-${ne.thumbnail}`,resource:ne,"path-prefix":f(c)(ne),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":f(u)(ne),"is-icon-displayed":!Ne.$slots.image,"is-extension-displayed":f(F),"is-resource-clickable":f(A)(ne,e.areResourcesClickable),link:f(W)(ne),"parent-folder-link":f(a)(ne),"parent-folder-link-icon-additional-attributes":f(l)(ne),class:z.normalizeClass({"opacity-60":f(N)(ne)}),onClick:Wt(Pe=>f(E)({resource:ne,event:Pe}),["stop"])},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"])),We(ne)?(X(),Te(f(wn),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":f(d)("Rename file »%{name}«",{name:ne.name}),title:f(d)("Rename"),onClick:Wt(Pe=>{f(s)(Pe,ne)||Ge(ne)},["stop"])},{default:ve(()=>[me(I,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):Re("",!0)],2),Ue(Ne.$slots,"additionalResourceContent",{resource:ne})]),syncEnabled:ve(({item:ne})=>[Ue(Ne.$slots,"syncEnabled",{resource:ne})]),size:ve(({item:ne})=>[me(mS,{size:ne.size||Number.NaN},null,8,["size"])]),tags:ve(({item:ne})=>[(X(!0),pe(Be,null,mt(ne.tags.slice(0,2),Pe=>(X(),Te(Pn(f(Ae)?"router-link":"span"),$t({key:Pe},{ref_for:!0},Fe(Pe),{class:"resource-table-tag-wrapper"}),{default:ve(()=>[ot((X(),Te(J,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:ve(()=>[me(I,{name:"price-tag-3",size:"small"}),fe("span",GM,z.toDisplayString(Pe),1)]),_:2},1024)),[[oe,De(Pe)]])]),_:2},1040))),128)),ne.tags.length>2?(X(),Te(J,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:M[0]||(M[0]=Pe=>Qe())},{default:ve(()=>[kt(" + "+z.toDisplayString(ne.tags.length-2),1)]),_:2},1024)):Re("",!0)]),manager:ve(({item:ne})=>[Ue(Ne.$slots,"manager",{resource:ne})]),members:ve(({item:ne})=>[Ue(Ne.$slots,"members",{resource:ne})]),totalQuota:ve(({item:ne})=>[Ue(Ne.$slots,"totalQuota",{resource:ne})]),usedQuota:ve(({item:ne})=>[Ue(Ne.$slots,"usedQuota",{resource:ne})]),remainingQuota:ve(({item:ne})=>[Ue(Ne.$slots,"remainingQuota",{resource:ne})]),mdate:ve(({item:ne})=>[ot(fe("span",{tabindex:"0",textContent:z.toDisplayString(lt(ne.mdate))},null,8,QM),[[oe,Xe(ne.mdate)]])]),indicators:ve(({item:ne})=>[me(gS,{space:e.space,resource:ne,"disable-handler":f(R)(ne)},null,8,["space","resource","disable-handler"])]),sdate:ve(({item:ne})=>[ot(fe("span",{tabindex:"0",textContent:z.toDisplayString(lt(ne.sdate))},null,8,XM),[[oe,Xe(ne.sdate)]])]),ddate:ve(({item:ne})=>[ot(fe("p",{tabindex:"0",class:"m-0",textContent:z.toDisplayString(lt(ne.ddate))},null,8,YM),[[oe,Xe(ne.ddate)]])]),sharedBy:ve(({item:ne})=>[me(G,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:jt(ne),"accessible-description":Bt(ne),"hover-effect":""},{userAvatars:ve(({avatars:Pe,width:Le})=>[(X(!0),pe(Be,null,mt(Pe,qe=>(X(),Te(f(rl),{key:qe.userId,"user-id":qe.userId,"user-name":qe.displayName,width:Le},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:ve(({item:ne})=>[me(G,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:ct(ne),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":Et(ne),"hover-effect":""},{userAvatars:ve(({avatars:Pe,width:Le})=>[(X(!0),pe(Be,null,mt(Pe,qe=>(X(),Te(f(rl),{key:qe.userId,"user-id":qe.userId,"user-name":qe.displayName,width:Le},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:ve(({item:ne})=>[f(Y)(ne)?(X(),pe("div",JM,[Ue(Ne.$slots,"quickActions",{resource:ne}),me(Vd,{title:ne.name,item:ne,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:Pe=>f(he)(Pe,ne)},{contextMenu:ve(()=>[Ue(Ne.$slots,"contextMenu",{resource:ne})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):Re("",!0)]),_:2},[!f(w)&&!f(S)?{name:"selectHeader",fn:ve(()=>[fe("div",KM,[ot(me(k,{id:"resource-table-select-all",size:"large",label:f(ae),disabled:e.resources.length===f(g).length,"label-hidden":!0,"model-value":f(ie),onClick:Wt(f(Q),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[oe,{content:f(ae),placement:"bottom"}]])])]),key:"0"}:void 0,!f(w)&&!f(S)?{name:"select",fn:ve(({item:ne})=>[f(x)(ne.id)?(X(),Te(f(xN),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":f(d)("File is being processed")},null,8,["aria-label"])):(X(),Te(k,{key:1,id:`resource-table-select-${e.resourceDomSelector(ne)}`,label:f(we)(ne),"label-hidden":!0,size:"large",disabled:f(R)(ne),"model-value":f(v)(ne),outline:ye(ne),"data-test-selection-resource-name":ne.name,"data-test-selection-resource-path":ne.path,onClick:Wt(Pe=>f(T)({resource:ne,event:Pe}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,Ne.$slots.footer?{name:"footer",fn:ve(()=>[Ue(Ne.$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","onDropRowStyling"]),f(O)?(X(),Te(Dp,{key:0,to:"body"},[me(qd,{ref:"ghostElement","preview-items":[f(O),...f(D)]},null,8,["preview-items"])])):Re("",!0)],64)}}}),tB={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},nB={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},rB={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},iB=["textContent"],oB=["aria-label"],sB={class:"flex justify-between items-center"},aB={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},lB={class:"flex items-center"},cB={key:0,class:"text-left my-0 truncate"},uB=["textContent"],yS=_e({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=Ie.useGettext(),{getParentFolderName:i,getParentFolderLink:o}=Yr({space:le(e.space)}),s=Tn("observerTarget"),a=B(()=>f(s)?.$el),l=B(()=>e.resource.locked||e.resource.processing),u=B(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=B(()=>e.resource.locked?r("This item is locked"):null),p=B(()=>re.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:d}=e.lazy?yw({target:a,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},m=B(()=>!f(d));return e.lazy||n("itemVisible"),(b,w)=>{const S=Ee("oc-spinner"),y=Ee("oc-tag"),g=Ee("oc-image"),v=Ee("oc-icon"),h=sn("oc-tooltip");return X(),Te(f(sd),{ref_key:"observerTarget",ref:s,"body-class":"p-0",class:z.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!f(re.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&f(re.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:w[4]||(w[4]=E=>b.$emit("contextmenu",E))},{default:ve(()=>[m.value?(X(),pe("div",tB)):(X(),pe(Be,{key:1},[me(Ha,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:w[1]||(w[1]=E=>b.$emit("fileNameClicked",E))},{default:ve(()=>[fe("div",nB,[e.isLoading?(X(),pe("div",rB,[me(S,{"aria-label":f(r)("File is being processed")},null,8,["aria-label"])])):Ue(b.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&f(re.isProjectSpaceResource)(e.resource)?(X(),Te(y,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:ve(()=>[fe("span",{textContent:z.toDisplayString(f(r)("Disabled"))},null,8,iB)]),_:1})):Re("",!0),ot((X(),pe("div",{class:z.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Ue(b.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(X(),Te(g,{key:0,class:z.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:w[0]||(w[0]=Wt(E=>b.$emit("tileClicked",[e.resource,E]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(X(),Te(is,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},jp({_:2},[l.value?{name:"status",fn:ve(()=>[me(v,$t(u.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,oB)),[[h,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),fe("div",{class:"p-2",onClick:w[3]||(w[3]=Wt(E=>b.$emit("tileClicked",[e.resource,E]),["stop"]))},[fe("div",sB,[fe("div",aB,[me(os,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":f(i)(e.resource),"parent-folder-link":f(o)(e.resource),link:e.resourceRoute,onClick:w[2]||(w[2]=Wt(E=>b.$emit("fileNameClicked",E),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),fe("div",lB,[Ue(b.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ue(b.$slots,"actions",{item:e.resource}),Ue(b.$slots,"contextMenu",{item:e.resource})])]),p.value?(X(),pe("p",cB,[fe("span",{class:"text-sm",textContent:z.toDisplayString(p.value)},null,8,uB)])):Re("",!0),Ue(b.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),fB={id:"tiles-view",class:"px-4 pt-2"},dB={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},pB={key:1,class:"oc-tiles-sort"},hB={key:0,class:"flex"},mB={class:"p-1 text-sm"},gB=Ye(_e({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>nn.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=Ie.useGettext(),i=ze(),{areFileExtensionsShown:o}=Me.storeToRefs(i),{isLocationPicker:s,isFilePicker:a}=Qr(),l=Dd(),u=B(()=>Math.min(f(l),e.viewSize)),{isSideBarOpen:c}=Sa(),{disabledResources:p,isResourceSelected:d,fileContainerClicked:m,fileNameClicked:b,fileCheckboxClicked:w,isResourceDisabled:S,isResourceInDeleteQueue:y,isResourceClickable:g,isResourceCut:v,getResourceLink:h,dragItem:E,dragSelection:T,dragStart:R,fileDropped:x,setDropStyling:A,shouldShowContextDrop:N,showContextMenuOnRightClick:W,showContextMenuOnBtnClick:O,selectAllCheckboxLabel:D,getResourceCheckboxLabel:V,toggleSelectionAll:L,areAllResourcesSelected:te}=Ld({space:B(()=>e.space),resources:B(()=>e.resources),selectedIds:B(()=>e.selectedIds),emit:n}),Y=window.__E2E__===!0?!1:e.lazy,se=B(()=>e.sortFields.find(q=>q.name===e.sortBy&&q.sortDir===e.sortDir)||e.sortFields[0]),he=q=>{n("sort",{sortBy:q.name,sortDir:f(q.sortDir)})},ae=B(()=>{const q={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},K=f(u);return q[K]??"xxlarge"}),we=le(0),Q=()=>{const q=document.getElementById("tiles-view"),K=getComputedStyle(q),j=parseInt(K.getPropertyValue("padding-left"),10)|0,H=parseInt(K.getPropertyValue("padding-right"),10)|0;we.value=q.clientWidth-j-H},ie=B(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:ce}=Y0(),Ae=B(()=>{const q=[...Array(nn.tilesSizeMax).keys()].map(K=>K+1);return[...new Set(q.map(K=>{const j=ce(K);return j?Math.round(f(we)/(j+f(ie))):0}))]}),ee=B(()=>{const q=f(Ae);return q.length<f(u)?q[q.length-1]:q[f(u)-1]}),F=B(()=>{const q=f(ee)?e.resources.length%f(ee):0;return q?f(ee)-q:0}),C=B(()=>f(we)/f(ee)-f(ie));return st(C,q=>{q&&!isNaN(q)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${q}px`)},{immediate:!0}),st(Ae,q=>{l.value=Math.max(q.length,1)}),st(c,()=>{Q()}),Lt(()=>{window.addEventListener("resize",Q),Q()}),An(()=>{window.removeEventListener("resize",Q)}),(q,K)=>{const j=Ee("oc-checkbox"),H=Ee("oc-icon"),ge=Ee("oc-button"),xe=Ee("oc-list"),De=Ee("oc-filter-chip"),Oe=sn("oc-tooltip");return X(),pe("div",fB,[fe("div",dB,[e.isSelectable&&!f(a)?ot((X(),Te(j,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:f(D),"label-hidden":!0,disabled:e.resources.length===f(p).length,"model-value":f(te),onClick:Wt(f(L),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[Oe,f(D)]]):Re("",!0),e.sortFields.length?(X(),pe("div",pB,[me(De,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":f(r)("Sort by"),"selected-item-names":[se.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:ve(()=>[me(xe,null,{default:ve(()=>[(X(!0),pe(Be,null,mt(e.sortFields,(Ce,Fe)=>(X(),pe("li",{key:Fe},[me(ge,{appearance:se.value===Ce?"filled":"raw-inverse","color-role":se.value===Ce?"secondaryContainer":"surface","no-hover":se.value===Ce,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:ye=>he(Ce)},{default:ve(()=>[fe("span",null,z.toDisplayString(Ce.label),1),Ce===se.value?(X(),pe("div",hB,[me(H,{name:"check"})])):Re("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):Re("",!0)]),me(xe,{class:"oc-tiles grid justify-start gap-3"},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.resources,Ce=>(X(),pe("li",{key:Ce.id,class:"oc-tiles-item has-item-context-menu"},[me(yS,{resource:Ce,space:e.space,"resource-route":f(h)(Ce),"is-resource-selected":f(d)(Ce),"is-resource-clickable":f(g)(Ce,e.areResourcesClickable),"is-resource-disabled":f(S)(Ce),"is-extension-displayed":f(o),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ae.value,draggable:e.dragDrop,lazy:f(Y),"is-loading":f(y)(Ce.id),class:z.normalizeClass({"opacity-60":f(v)(Ce)}),onContextmenu:Fe=>f(W)(Fe,Ce),onFileNameClicked:Wt(Fe=>f(b)({resource:Ce,event:Fe}),["stop"]),onDragstart:Fe=>f(R)(Ce,Fe),onDragenter:Wt(Fe=>f(A)(Ce,!1,Fe),["prevent"]),onDragleave:Wt(Fe=>f(A)(Ce,!0,Fe),["prevent"]),onDrop:Fe=>f(x)(Ce,Fe),onDragover:K[0]||(K[0]=Fe=>Fe.preventDefault()),onItemVisible:Fe=>q.$emit("itemVisible",Ce),onTileClicked:Fe=>f(m)({resource:Ce,event:Fe[1]})},{selection:ve(()=>[e.isSelectable&&!f(s)&&!f(a)?(X(),Te(j,{key:0,label:f(V)(Ce),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:f(S)(Ce),"model-value":f(d)(Ce),"data-test-selection-resource-name":Ce.name,"data-test-selection-resource-path":Ce.path,onClick:Wt(Fe=>f(w)({resource:Ce,event:Fe}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):Re("",!0)]),imageField:ve(()=>[Ue(q.$slots,"image",{resource:Ce},void 0,!0)]),indicators:ve(()=>[me(gS,{space:e.space,class:"ml-2",resource:Ce,filter:Fe=>["system","sharing"].includes(Fe.category),"disable-handler":f(S)(Ce)},null,8,["space","resource","filter","disable-handler"])]),actions:ve(()=>[Ue(q.$slots,"actions",{resource:Ce},void 0,!0)]),contextMenu:ve(()=>[f(N)(Ce)?(X(),Te(f(Vd),{key:0,item:Ce,title:Ce.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:Fe=>f(O)(Fe,Ce)},{contextMenu:ve(()=>[Ue(q.$slots,"contextMenu",{resource:Ce},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):Re("",!0)]),additionalResourceContent:ve(()=>[Ue(q.$slots,"additionalResourceContent",{resource:Ce},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","class","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(X(!0),pe(Be,null,mt(F.value,Ce=>(X(),pe("li",{key:`ghost-tile-${Ce}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),f(E)?(X(),Te(Dp,{key:0,to:"body"},[me(qd,{ref:"ghostElement","preview-items":[f(E),...f(T)]},null,8,["preview-items"])])):Re("",!0),fe("div",mB,[Ue(q.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-8d88c01d"]]),yB=_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=He(),{current:i}=Ie.useGettext(),o=Ht(),s=cr(),{currentTheme:a}=Me.storeToRefs(s),l=le(),u=le(e.items),c=le(),p=le(),d=le(!1),m=le(),b=`q_${e.filterName}`,w=tn(b),S=V=>V[e.idAttribute],y=()=>r.push({query:{...Hi(f(o).query,[b]),...f(l)&&{[b]:S(f(l))}}}),g=V=>f(l)&&S(f(l))===S(V),v=()=>{c.value=void 0,p.value=void 0},h=async V=>{v(),g(V)?l.value=void 0:(l.value=V,f(m).hideDrop()),await y(),t("selectionChange",f(l))},E=()=>{l.value=void 0,d.value=!1,v(),t("selectionChange",f(l)),y()},T=()=>{u.value=e.items},R=()=>{d.value=!1},x=()=>{const V=Ct(f(w));if(!V)return;const L=e.items.find(te=>S(te)===V);if(L){l.value=L;return}if(f(A)){const te=V.replace("range:",""),Y=Number(te.split(" - ")[0]),se=Number(te.split(" - ")[1]);c.value=Ut.DateTime.fromMillis(Y),p.value=Ut.DateTime.fromMillis(se),l.value=f(W)}},A=B(()=>Ct(f(w))?.startsWith("range:")),N=B(()=>!f(c)||!f(p)?!1:f(c)<=f(p)),W=B(()=>{if(!f(c)||!f(p))return null;const V=di(f(c),i,Ut.DateTime.DATE_SHORT),L=di(f(p),i,Ut.DateTime.DATE_SHORT),te=f(c).toMillis(),Y=f(p).toMillis();return{[e.idAttribute]:`range:${te} - ${Y}`,[e.displayNameAttribute]:`${V} - ${L}`}}),O=async()=>{l.value=f(W),await y(),f(m).hideDrop(),t("selectionChange",f(l))},D=({date:V,error:L},te)=>{if(L){console.error("date could not be set");return}const Y=te==="from"?c:p;if(!V){Y.value=void 0;return}const se=te==="from"?V.startOf("day"):V.endOf("day");Y.value=se};return n({setSelectedItemsBasedOnQuery:x}),Lt(()=>{x()}),{clearFilter:E,displayedItems:u,isItemSelected:g,selectedItem:l,onShowDrop:T,onHideDrop:R,filterChip:m,toggleItemSelection:h,setSelectedItemsBasedOnQuery:x,fromDate:c,toDate:p,dateRangeValid:N,applyDateRangeFilter:O,dateRangeApplied:A,setDateRangeDate:D,dateRangeClicked:d,currentTheme:a,queryParam:b}}}),vB={class:"flex items-center truncate"},bB={class:"truncate ml-2"},wB={class:"flex"},SB={class:"my-1"},EB={class:"flex items-center truncate"},TB={class:"truncate ml-2"},AB=["textContent"],xB={class:"flex"},RB={class:"flex items-center justify-between mb-4"},CB=["textContent"],kB={class:"mt-2"},PB={class:"date-filter-apply-btn text-end"};function IB(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-datepicker"),c=Ee("oc-filter-chip");return X(),pe("div",{class:z.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[me(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:ve(()=>[me(l,{class:z.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:ve(()=>[(X(!0),pe(Be,null,mt(e.displayedItems,(p,d)=>(X(),pe("li",{key:d,class:"my-1 first:mt-0 last:mb-0"},[me(a,{class:z.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(p)}]),"justify-content":"space-between",appearance:"raw","data-testid":p[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(p)},{default:ve(()=>[fe("div",vB,[fe("div",bB,[Ue(e.$slots,"item",{item:p},void 0,!0)])]),fe("div",wB,[e.isItemSelected(p)?(X(),Te(s,{key:0,name:"check"})):Re("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),fe("li",SB,[me(a,{class:z.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=p=>e.dateRangeClicked=!0)},{default:ve(()=>[fe("div",EB,[fe("div",TB,[fe("span",{textContent:z.toDisplayString(e.$gettext("Custom date range"))},null,8,AB)])]),fe("div",xB,[e.dateRangeApplied?(X(),Te(s,{key:0,name:"check"})):Re("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),fe("div",{class:z.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[fe("div",RB,[me(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=p=>e.dateRangeClicked=!1)},{default:ve(()=>[me(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),fe("span",{textContent:z.toDisplayString(e.$gettext("Custom date range"))},null,8,CB),me(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=p=>e.filterChip.hideDrop())},{default:ve(()=>[me(s,{name:"close"})]),_:1},8,["aria-label"])]),fe("div",kB,[me(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=p=>e.setDateRangeDate(p,"from"))},null,8,["label","current-date","is-dark"]),me(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=p=>e.setDateRangeDate(p,"to"))},null,8,["label","current-date","min-date","is-dark"])]),fe("div",PB,[me(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:ve(()=>[kt(z.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const OB=Ye(yB,[["render",IB],["__scopeId","data-v-80ea8301"]]),FB=_e({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=He(),r=Ht(),i=le(e.filterOptions[0].name),o=`q_${e.filterName}`,s=tn(o),a=u=>n.push({query:{...Hi(f(r).query,[o]),[o]:u}}),l=async u=>{i.value=u.name,await a(u.name),t("toggleFilter",u)};return Lt(()=>{const u=Ct(f(s));u&&e.filterOptions.some(({name:c})=>c===u)&&(i.value=u,t("toggleFilter",e.filterOptions.find(({name:c})=>c===u)))}),{queryParam:o,activeOption:i,toggleFilter:l}}}),_B=["textContent"];function DB(e,t,n,r,i,o){const s=Ee("oc-button");return X(),pe("div",null,[fe("div",{class:z.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(X(!0),pe(Be,null,mt(e.filterOptions,(a,l)=>(X(),Te(s,{id:a.name,key:l,class:z.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:e.activeOption===a.name?"filled":"raw-inverse","color-role":e.activeOption===a.name?"secondaryContainer":"surface","no-hover":e.activeOption===a.name,onClick:u=>e.toggleFilter(a)},{default:ve(()=>[fe("span",{class:"truncate item-inline-filter-option-label",textContent:z.toDisplayString(a.label)},null,8,_B)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const NB=Ye(FB,[["render",DB]]),LB={class:"space-quota"},$B=["textContent"],vS=_e({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Ie.useGettext(),r=B(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:f(o),total:f(i),percentage:f(s).toString()}):t("%{used} used (no restriction)",{used:f(o)})),i=B(()=>vn(e.spaceQuota.total,n)),o=B(()=>vn(e.spaceQuota.used,n)),s=B(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=B(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(l,u)=>{const c=Ee("oc-progress");return X(),pe("div",LB,[fe("p",{class:"mb-2 mt-0",textContent:z.toDisplayString(r.value)},null,8,$B),me(c,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),MB=_e({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=wr("resource"),n="check",r="file-copy",i=le(r),o=le(r),s=B(()=>dc(f(t).webDavPath)),a=B(()=>e.space?.getWebDavUrl({path:f(t).path}));return{copyWebDAVPathIcon:i,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(f(s)),i.value=n,setTimeout(()=>i.value=r,1500)},copyWebDAVUrlIcon:o,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(f(a)),o.value=n,setTimeout(()=>o.value=r,1500)},webDavPath:s,webDavUrl:a}}}),BB={class:"flex"},jB=["textContent"],UB={class:"flex"},VB=["textContent"];function qB(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=sn("oc-tooltip");return X(),pe(Be,null,[fe("dt",null,z.toDisplayString(e.$gettext("WebDAV path")),1),fe("dd",BB,[ot(fe("div",{class:"truncate",textContent:z.toDisplayString(e.webDavPath)},null,8,jB),[[l,e.webDavPath]]),ot((X(),Te(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:ve(()=>[me(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV path")]])]),fe("dt",null,z.toDisplayString(e.$gettext("WebDAV URL")),1),fe("dd",UB,[ot(fe("div",{class:"truncate",textContent:z.toDisplayString(e.webDavUrl)},null,8,VB),[[l,e.webDavUrl]]),ot((X(),Te(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:ve(()=>[me(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV URL")]])])],64)}const bS=Ye(MB,[["render",qB]]),zB={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},WB={class:"text-center"},HB={key:1,class:"relative mb-2"},KB=["src"],GB={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},QB=["textContent"],XB=["textContent"],YB=["aria-label"],JB=_e({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=vt(),n=ze(),{resourceContentsText:r}=J0({showSizeInformation:!1}),i=He(),{$gettext:o,$ngettext:s,current:a}=Ie.useGettext(),{loadPreview:l}=Nd(),u=at(),{imagesLoading:c}=Me.storeToRefs(u),p=Cr(),d=wr("resource"),m=le(""),{user:b}=Me.storeToRefs(t),w=B(()=>u.getSpaceMembers(f(d))),S=B(()=>p.linkShares.length),y=B(()=>n.areWebDavDetailsShown),g=B(()=>!xt(i,"files-spaces-projects")),v=B(()=>`${vn(f(d).size,a)}, ${f(r)}`);st(()=>f(d).spaceImageData,async()=>{m.value=await l({space:f(d),resource:f(d).spaceImageData?re.buildSpaceImageResource(f(d)):f(d),dimensions:rs.Tile,processor:ya.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=B(()=>f(w).length?f(w).filter(re.isManager).map(({sharedWith:se})=>se.id===f(b)?.id?o("%{displayName} (me)",{displayName:se.displayName}):se.displayName).join(", "):re.getSpaceManagers(f(d),p.graphRoles)?.map(({grantedToV2:he})=>he.user?.id===f(b)?.id?o("%{displayName} (me)",{displayName:he.user.displayName}):he.user?.displayName||he.group?.displayName).join(", ")),E=B(()=>rb(f(d).mdate,a)),T=B(()=>f(W)||f(O)),R=B(()=>f(W)&&!f(O)?f(V):!f(W)&&f(O)?f(L):f(D)===1?s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",f(S),{linkShareCount:f(S).toString()}):f(S)===1?o("This space has %{memberShareCount} members and one link.",{memberShareCount:f(D).toString()}):o("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:f(D).toString(),linkShareCount:f(S).toString()})),x=B(()=>o("Open share panel")),A=B(()=>o("Open link list in share panel")),N=B(()=>o("Open member list in share panel")),W=B(()=>f(D)>0),O=B(()=>f(S)>0),D=B(()=>f(w).length),V=B(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",f(D),{memberShareCount:f(D).toString()})),L=B(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",f(S),{linkShareCount:f(S).toString()})),te=()=>{Je.publish(Rt.setActivePanel,"space-share")};return(Y,se)=>{const he=Ee("oc-spinner"),ae=Ee("oc-icon"),we=Ee("oc-button"),Q=Ee("portal-target");return X(),pe("div",zB,[fe("div",WB,[f(c).includes(f(d).id)?(X(),Te(he,{key:0,"aria-label":f(o)("Space image is loading")},null,8,["aria-label"])):m.value?(X(),pe("div",HB,[fe("img",{src:m.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,KB)])):(X(),Te(ae,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&T.value&&!f(d).disabled?(X(),pe("div",GB,[W.value?(X(),Te(we,{key:0,appearance:"raw","aria-label":N.value,"no-hover":"",onClick:te},{default:ve(()=>[me(ae,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Re("",!0),O.value?(X(),Te(we,{key:1,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:te},{default:ve(()=>[me(ae,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Re("",!0),fe("p",{textContent:z.toDisplayString(R.value)},null,8,QB),me(we,{appearance:"raw","aria-label":x.value,size:"small","no-hover":"",onClick:te},{default:ve(()=>[fe("span",{class:"text-sm",textContent:z.toDisplayString(f(o)("Show"))},null,8,XB)]),_:1},8,["aria-label"])])):Re("",!0),fe("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":f(o)("Overview of the information about the selected space")},[fe("dt",null,z.toDisplayString(f(o)("Last activity")),1),fe("dd",null,z.toDisplayString(E.value),1),f(d).description?(X(),pe(Be,{key:0},[fe("dt",null,z.toDisplayString(f(o)("Subtitle")),1),fe("dd",null,z.toDisplayString(f(d).description),1)],64)):Re("",!0),fe("dt",null,z.toDisplayString(f(o)("Manager")),1),fe("dd",null,z.toDisplayString(h.value),1),f(d).disabled?Re("",!0):(X(),pe(Be,{key:1},[fe("dt",null,z.toDisplayString(f(o)("Quota")),1),fe("dd",null,[me(vS,{"space-quota":f(d).spaceQuota},null,8,["space-quota"])])],64)),g.value?(X(),pe(Be,{key:2},[fe("dt",null,z.toDisplayString(f(o)("Size")),1),fe("dd",null,z.toDisplayString(v.value),1)],64)):Re("",!0),y.value?(X(),Te(bS,{key:3,space:f(d)},null,8,["space"])):Re("",!0),me(Q,{name:"app.files.sidebar.space.details.table","slot-props":{space:f(d),resource:f(d)},multiple:!0},null,8,["slot-props"])],8,YB)])}}}),ZB={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},ej={class:"text-center mb-6 rounded-sm"},tj=["textContent"],nj=_e({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Ie.useGettext(),{$gettext:n,$ngettext:r}=t,i=B(()=>{let d=0;return e.selectedSpaces.forEach(m=>{d+=m.spaceQuota.total}),vn(d,t.current)}),o=B(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.remaining)}),vn(d,t.current)}),s=B(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.used)}),vn(d,t.current)}),a=B(()=>e.selectedSpaces.filter(d=>!d.disabled).length),l=B(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=B(()=>n("Overview of the information about the selected spaces")),c=B(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),p=B(()=>[{term:n("Total quota:"),definition:f(i).toString()},{term:n("Remaining quota:"),definition:f(o).toString()},{term:n("Used quota:"),definition:f(s).toString()},{term:n("Enabled:"),definition:f(a).toString()},{term:n("Disabled:"),definition:f(l).toString()}]);return(d,m)=>{const b=Ee("oc-icon"),w=Ee("oc-definition-list");return X(),pe("div",ZB,[fe("div",ej,[fe("div",null,[me(b,{size:"xxlarge",name:"layout-grid"}),fe("p",{textContent:z.toDisplayString(c.value)},null,8,tj)])]),me(w,{"aria-label":u.value,items:p.value,class:"m-0"},null,8,["aria-label","items"])])}}}),rj=_e({name:"SpaceNoSelection"}),ij={class:"mt-12"},oj={class:"flex flex-col items-center space-info text-center"};function sj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=sn("translate");return X(),pe("div",ij,[fe("div",oj,[me(s,{name:"layout-grid",size:"xxlarge"}),ot((X(),pe("p",null,[...t[0]||(t[0]=[kt("Select a space to view details",-1)])])),[[a]])])])}const aj=Ye(rj,[["render",sj]]),lj=_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 Lt(()=>{t=Je.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),An(()=>{Je.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!Vv(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}}}),cj={class:"w-full flex flex-row flex-wrap justify-between items-center"},uj={key:0,class:"flex items-center"},fj=["textContent"],dj={key:1},pj=["textContent"],hj=["textContent"];function mj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button");return X(),pe("div",cj,[e.saved?(X(),pe("span",uj,[me(s,{name:"checkbox-circle"}),fe("span",{class:"ml-2",textContent:z.toDisplayString(e.$gettext("Changes saved"))},null,8,fj)])):(X(),pe("span",dj,z.toDisplayString(e.unsavedChangesText),1)),fe("div",null,[me(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=l=>e.$emit("revert"))},{default:ve(()=>[fe("span",{textContent:z.toDisplayString(e.$gettext("Revert"))},null,8,pj)]),_:1},8,["disabled"]),me(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:ve(()=>[fe("span",{textContent:z.toDisplayString(e.$gettext("Save"))},null,8,hj)]),_:1},8,["disabled"])])])}const gj=Ye(lj,[["render",mj]]),yj=q1(async()=>(await Promise.resolve().then(()=>h8)).default),vj=_e({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ki(),n=db(),r=B(()=>t.requestExtensions(e.extensionPoint)),i=n.extractDefaultExtensionIds(e.extensionPoint,f(r));return{extensions:B(()=>{if(e.extensionPoint.multiple||f(r).length<=1)return f(r);const s=n.getExtensionPreference(e.extensionPoint.id,i);return s.selectedExtensionIds.length?[f(r).find(a=>s.selectedExtensionIds.includes(a.id))||f(r)[0]]:[f(r)[0]]})}}});function bj(e,t,n,r,i,o){return X(!0),pe(Be,null,mt(e.extensions,s=>(X(),Te(Pn(s.content),{key:`custom-component-${s.id}`}))),128)}const wj=Ye(vj,[["render",bj]]),Sj={class:"flex items-center truncate"},Ej={class:"truncate"},Tj={class:"flex"},Aj=_e({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,i=He(),o=Ht(),s=Tn("filterInputRef"),a=le([]),l=le(e.items),u=Tn("itemFilterListRef"),c=`q_${e.filterName}`,p=tn(c),d=R=>R[e.idAttribute],m=()=>i.push({query:{...Hi(f(o).query,[c]),...!!f(a).length&&{[c]:f(a).reduce((R,x)=>(R+=`${d(x)}+`,R),"").slice(0,-1)}}}),b=R=>!!f(a).find(x=>d(x)===d(R)),w=async R=>{b(R)?a.value=f(a).filter(x=>d(x)!==d(R)):(e.allowMultiple||(a.value=[]),a.value.push(R)),await m(),r("selectionChange",f(a))},S=le(),y=(R,x)=>{if(!(x||"").trim())return R;const N=new zd(R,{...Ul,keys:e.filterableAttributes}).search(x).map(W=>W.item);return R.filter(W=>N.includes(W))},g=()=>{a.value=[],r("selectionChange",f(a)),m()},v=R=>{l.value=R},h=async()=>{v(e.items),await zt(),f(s)?.focus()};let E;st(S,()=>{v(y(e.items,f(S))),f(u)&&(E=new Qd(f(u)),E.unmark(),E.mark(f(S),{element:"span",className:"mark-highlight"}))});const T=()=>{const R=Ct(f(p));if(R){const x=R.split("+");a.value=e.items.filter(A=>x.includes(d(A)))}};return t({setSelectedItemsBasedOnQuery:T}),Lt(()=>{T()}),(R,x)=>{const A=Ee("oc-checkbox"),N=Ee("oc-icon"),W=Ee("oc-button"),O=Ee("oc-list"),D=Ee("oc-filter-chip");return X(),pe("div",{class:z.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[me(D,{"filter-label":e.filterLabel,"selected-item-names":a.value.map(V=>V[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:g,onShowDrop:h},{default:ve(()=>[e.showOptionFilter&&e.filterableAttributes.length?(X(),Te(f(lN),{key:0,ref_key:"filterInputRef",ref:s,modelValue:S.value,"onUpdate:modelValue":x[0]||(x[0]=V=>S.value=V),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?R.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Re("",!0),fe("div",{ref_key:"itemFilterListRef",ref:u},[me(O,{class:"item-filter-list"},{default:ve(()=>[(X(!0),pe(Be,null,mt(l.value,(V,L)=>(X(),pe("li",{key:L,class:"my-1"},[me(W,{class:z.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&b(V),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":V[e.displayNameAttribute],onClick:te=>w(V)},{default:ve(()=>[fe("div",Sj,[e.allowMultiple?(X(),Te(A,{key:0,size:"large",class:"mr-2",label:R.$gettext("Toggle selection"),"model-value":b(V),"label-hidden":!0,"onUpdate:modelValue":te=>w(V),onClick:x[1]||(x[1]=Wt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Re("",!0),fe("div",null,[Ue(R.$slots,"image",{item:V})]),fe("div",Ej,[Ue(R.$slots,"item",{item:V})])]),fe("div",Tj,[!e.allowMultiple&&b(V)?(X(),Te(N,{key:0,name:"check"})):Re("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),xj=_e({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=He(),r=Ht(),i=le(!1),o=`q_${e.filterName}`,s=tn(o),a=()=>n.push({query:{...Hi(f(r).query,[o]),...f(i)&&{[o]:"true"}}}),l=async()=>{i.value=!f(i),await a(),t("toggleFilter",f(i))};return Lt(()=>{Ct(f(s))==="true"&&(i.value=!0)}),{queryParam:o,filterActive:i,toggleFilter:l}}});function Rj(e,t,n,r,i,o){const s=Ee("oc-filter-chip");return X(),pe("div",{class:z.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[me(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 Cj=Ye(xj,[["render",Rj]]),kj=_e({name:"LoadingIndicator",setup(){const e=gn();let t,n,r;const i=le(e.isLoading),o=le(e.currentProgress),s=()=>{o.value=e.currentProgress,i.value=e.isLoading},a=()=>{o.value=e.currentProgress};return Lt(()=>{t=Je.subscribe(Gr.add,s),n=Je.subscribe(Gr.remove,s),r=Je.subscribe(Gr.setProgress,a)}),An(()=>{Je.unsubscribe(Gr.add,t),Je.unsubscribe(Gr.remove,n),Je.unsubscribe(Gr.setProgress,r)}),{isLoading:i,currentProgress:o}}}),Pj={key:0,id:"oc-loading-indicator",class:"w-full"};function Ij(e,t,n,r,i,o){const s=Ee("oc-progress");return e.isLoading?(X(),pe("div",Pj,[me(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):Re("",!0)}const Oj=Ye(kj,[["render",Ij]]),Fj={class:"no-content-message flex flex-col justify-center items-center text-center"},_j={class:"text-role-on-surface-variant text-xl"},Dj={class:"text-role-on-surface-variant"},Nj=Ye(_e({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=Ee("oc-icon");return X(),pe("div",Fj,[me(r,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),fe("div",_j,[Ue(t.$slots,"message",{},void 0,!0)]),fe("div",Dj,[Ue(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),Lj=_e({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function $j(e,t,n,r,i,o){const s=Ee("oc-pagination");return e.pages>1?(X(),Te(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):Re("",!0)}const Mj=Ye(Lj,[["render",$j]]),Bj=_e({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Ie.useGettext(),r=tn("useScope"),i=le(),o=le(),s=B(()=>n(i.value?.title)),a=B(()=>[{id:mi.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:mi.allFiles,title:n("All files"),enabled:!0}]);return st(()=>e.currentFolderAvailable,()=>{if(f(r)){if(f(r).toString()==="true"){i.value=f(a).find(({id:c})=>c===mi.currentFolder);return}i.value=f(a).find(({id:c})=>c===mi.allFiles);return}if(!e.currentFolderAvailable){i.value=f(a).find(({id:u})=>u===mi.allFiles);return}if(f(o)){i.value=f(a).find(({id:u})=>u===f(o).id);return}i.value=f(a).find(({id:u})=>u===mi.allFiles)},{immediate:!0}),{currentSelection:i,currentSelectionTitle:s,onOptionSelected:u=>{o.value=u,i.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),jj={key:0},Uj={key:0,class:"flex"};function Vj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-filter-chip");return X(),pe("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=Wt(()=>{},["stop"]))},[e.currentSelection?(X(),pe("div",jj,[me(u,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:ve(()=>[me(l,null,{default:ve(()=>[(X(!0),pe(Be,null,mt(e.locationOptions,(c,p)=>(X(),pe("li",{key:p},[me(a,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:d=>e.onOptionSelected(c)},{default:ve(()=>[fe("span",null,z.toDisplayString(c.title),1),c.id===e.currentSelection.id?(X(),pe("div",Uj,[me(s,{name:"check"})])):Re("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):Re("",!0)])}const qj=Ye(Bj,[["render",Vj]]),zj=_e({name:"PortalTarget",components:{PortalTargetVue:fs.PortalTarget},props:{...fs.PortalTarget.props},setup(e){const t=B(()=>e);return Lt(()=>{Je.publish(el.mounted,e)}),{properties:t}}});function Wj(e,t,n,r,i,o){const s=Ee("portal-target-vue");return X(),Te(s,z.normalizeProps(eh(e.properties)),null,16)}const Hj=Ye(zj,[["render",Wj]]),Kj={key:0},Gj={key:0,class:"version-check-loading flex items-center"},Qj=["textContent"],Xj={key:0,class:"version-check-no-updates flex items-center"},Yj=["textContent"],Jj=["textContent"],Zj=_e({__name:"VersionCheck",setup(e){const{$gettext:t}=Ie.useGettext(),n=en(),r=Lb(),i=n.capabilities.core["check-for-updates"],{updates:o,isLoading:s,hasError:a}=Me.storeToRefs(r),l=B(()=>i&&!f(a)),u=le(!1),c=le(),p=n.status.edition||"rolling",m=n.status.productversion.split("+")[0];return st(()=>o,()=>{if(!f(o))return;const b=f(o).channels[p].current_version;hc(b,m)>0&&(u.value=!0,c.value=f(o).channels[p])},{immediate:!0,deep:!0}),(b,w)=>{const S=Ee("oc-spinner"),y=Ee("oc-icon"),g=Ee("oc-button");return l.value?(X(),pe("div",Kj,[f(s)?(X(),pe("div",Gj,[fe("span",{textContent:z.toDisplayString(f(t)("Checking for updates"))},null,8,Qj),me(S,{class:"ml-1",size:"xsmall"})])):(X(),pe(Be,{key:1},[u.value?(X(),Te(g,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:ve(()=>[fe("span",{class:"text-xs",textContent:z.toDisplayString(f(t)("Version %{version} available",{version:c.value.current_version}))},null,8,Jj),me(y,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(X(),pe("div",Xj,[fe("span",{textContent:z.toDisplayString(f(t)("Up to date"))},null,8,Yj),me(y,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):Re("",!0)}}}),e8={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é"}},t8={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"}},n8={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"}},r8={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"}},i8={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"}},o8={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:"Автопрокрутка"}},s8={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:"同期スクロール"}},a8={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"}},l8={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"},c8={"fr-FR":e8,"de-DE":t8,"it-IT":n8,"es-ES":r8,"pl-PL":i8,ru:o8,"jp-JP":s8,"id-ID":a8},u8=_e({name:"TextEditor",components:{MdEditor:oo.MdEditor,MdPreview:oo.MdPreview,NormalToolbar:oo.NormalToolbar},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=Ie.useGettext(),{currentTheme:r}=cr(),i=le(!0),o=B(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),s=B(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!f(o).showPreviewOnlyMd),a=B(()=>f(r).isDark?"dark":"light"),l=B(()=>f(s)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return oo.config({editorConfig:{languageUserDefined:c8},editorExtensions:{screenfull:{instance:PS},cropper:{instance:il}},markdownItPlugins(c){return[...c,{type:"xss",plugin:oo.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const p=[...c,{type:"lineNumbers",extension:IS.lineNumbers()}],d=p.find(m=>m.type==="linkShortener");return d&&(d.options.maxLength=120),f(s)?p:p.filter(m=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(m.type))}}),{isMarkdown:s,theme:a,toolbars:l,language:n,languages:l8,onUploadImg:async c=>{const d=(await Promise.all([...c].map(b=>new Promise((w,S)=>{const y=new FileReader;y.onload=()=>w(y.result),y.onerror=S,y.readAsDataURL(b)})))).map(b=>`![image](${b})`),m=`${f(e.currentContent)}
65
- ${d.join(`
31
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=o.reduce(function(u,d){var c=d&&cE(d,r);return c&&u.push(c),u},[]);return gs(e)?l[0]:l}ys.defaultProps=en,ys.setDefaultProps=sE,ys.currentInput=Vn;var uE=function(t){var n=t===void 0?{}:t,r=n.exclude,o=n.duration;Gi.forEach(function(s){var i=!1;if(r&&(i=tm(r)?s.reference===r:s.popper===r.popper),!i){var l=s.props.duration;s.setProps({duration:o}),s.hide(),s.state.isDestroyed||s.setProps({duration:l})}})};Object.assign({},Ih,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),ys.setDefaultProps({render:hm});const dE={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){const t=n=>{n.code==="Escape"&&e()};return{onShow:()=>{document.addEventListener("keydown",t)},onHide:()=>{document.removeEventListener("keydown",t)}}}},hc=e=>{if(e)try{e.destroy()}catch{}},fE=["src"],mc=ge({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Ou(),n=A(()=>Object.hasOwn(t,"header")||!!a(e.title)||!!a(e.logoUrl)),r=A(()=>Object.hasOwn(t,"footer"));return(o,s)=>(I(),re(rn(e.tag),{class:"oc-card"},{default:Z(()=>[n.value?(I(),G("div",{key:0,class:R.normalizeClass(["oc-card-header",e.headerClass])},[Ce(o.$slots,"header",{},()=>[e.logoUrl?(I(),G("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,fE)):le("",!0),e.title?(I(),re(rn(e.titleTag),{key:1,class:"mt-0"},{default:Z(()=>[ct(R.toDisplayString(e.title),1)]),_:1})):le("",!0)])],2)):le("",!0),Q("div",{class:R.normalizeClass(["oc-card-body",e.bodyClass])},[Ce(o.$slots,"default")],2),r.value?(I(),G("div",{key:1,class:R.normalizeClass(["oc-card-footer",e.footerClass])},[Ce(o.$slots,"footer")],2)):le("",!0)]),_:3}))}}),pE=["textContent"],hE=ge({__name:"OcMobileDrop",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:o}=me.useGettext(),s=FC(),{showDrawer:i,closeDrawer:l,closeAllDrawers:u}=s,{drawers:d,currentDrawer:c}=we.storeToRefs(s),p=W(null),f=nn("bottomDrawerCardBodyRef"),h=A(()=>a(d).map(({id:S})=>S).includes(a(p)?.id)),g=A(()=>a(p)?.id&&a(c)?.id===a(p).id),m=async()=>{p.value=i(),r("show"),await xt(),a(f)?.addEventListener("click",T)},w=()=>{l(a(p)?.id),a(f)?.removeEventListener("click",T),r("hide")},T=S=>{const y=S.target.closest("a[href], button");if(y){if(y.hasAttribute("aria-expanded")){y.setAttribute("aria-expanded","true");return}e.closeOnClick&&(w(),u())}},k=S=>{S.target===S.currentTarget&&u()};return Rn.onKeyStroke("Escape",S=>{S.preventDefault(),u()}),yt(()=>{a(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",m)}),bn(()=>{document.querySelector(e.toggle).removeEventListener("click",m),a(p)&&l(a(p).id)}),t({show:m,hide:w}),(S,y)=>{const E=oe("oc-icon"),D=oe("portal");return h.value?(I(),re(D,{key:0,to:"app.runtime.bottom.drawer"},{default:Z(()=>[J(Ix,{id:e.drawerId,"is-drawer-active":g.value,"is-focus-trap-active":g.value,class:"oc-mobile-drop z-[calc(var(--z-index-modal)+2)]",onClicked:k},{default:Z(()=>[J(mc,{class:"bg-role-surface-container-high overflow-x-hidden rounded-b-none","header-class":"flex flex-row justify-between items-center"},{header:Z(()=>[a(d).length>1?(I(),re(Qt,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":a(o)("Open the parent context menu"),onClick:y[0]||(y[0]=$=>w())},{default:Z(()=>[J(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),Q("span",{class:"font-semibold",textContent:R.toDisplayString(e.title)},null,8,pE),J(Qt,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":a(o)("Close the context menu"),onClick:y[1]||(y[1]=$=>a(u)())},{default:Z(()=>[J(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:Z(()=>[Q("div",{ref_key:"bottomDrawerCardBodyRef",ref:f},[Ce(S.$slots,"default")],512)]),_:3})]),_:3},8,["id","is-drawer-active","is-focus-trap-active"])]),_:3})):le("",!0)}}}),mE=["id"],gE=ge({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>_r("oc-drop-")},isNestedElement:{type:Boolean,default:!1},mode:{default:"click"},offset:{type:[Array,Function],default:[0,0]},paddingSize:{default:"medium"},popperOptions:{default:()=>({})},position:{default:"bottom-start"},target:{},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{isMobile:o}=os(),s=W(!1),i=A(()=>a(o)&&!e.enforceDropOnMobile),l=nn("bottomDrawerRef"),u=nn("drop"),d=W(null),c=()=>{if(a(i)){a(l).show();return}a(d)?.show()},p=()=>{if(a(i)){a(l).hide();return}a(d)?.hide()};t({show:c,hide:p,tippy:d});const f=w=>{const T=w.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!T&&p()},h=w=>{const T=u.value?.closest(".tippy-box");w.relatedTarget&&!T?.contains(w.relatedTarget)&&p()},g=A(()=>({hover:"mouseenter focus",click:void 0,manual:void 0})[e.mode]||e.mode);Ue(()=>e.position,()=>{a(d)?.setProps({placement:e.position})}),Ue(()=>e.mode,()=>{a(d)?.setProps({trigger:g.value})}),bn(()=>{a(u)?.removeEventListener("focusout",h),hc(a(d))});const m=()=>{hc(a(d));const w=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):u.value?.previousElementSibling,T=u.value;if(!w||!T)return;const k={trigger:g.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[dE],theme:"none",maxWidth:416,offset:e.offset,onShow:S=>{s.value=!0,r("showDrop"),e.isNestedElement||uE({exclude:S})},onHide:()=>{s.value=!1,r("hideDrop")},popperOptions:{...e.popperOptions,modifiers:[...e.popperOptions?.modifiers?e.popperOptions.modifiers:[],{name:"fixVerticalPosition",enabled:!0,phase:"beforeWrite",requiresIfExists:["offset","preventOverflow","flip"],fn({state:S}){const y=To(S),E=S.modifiersData.fullHeight||S.elements.popper.offsetHeight,D=y.top*-1-10,$=D+E+y.bottom*-1,_=$-D,L=$-_;E>_&&E>L&&(S.styles.popper.top=`-${D}px`,S.modifiersData.fullHeight=E),E>$&&(S.styles.popper.maxHeight=`${$-10}px`,S.styles.popper.overflowY="auto",S.styles.popper.overflowX="hidden")}}]},content:T};e.target&&(k.triggerTarget=e.toggle?document.querySelector(e.toggle):u.value?.previousElementSibling),d.value=ys(w,k),u.value?.addEventListener("focusout",h)};return Ue(i,async()=>{if(await xt(),a(i)){a(d)&&hc(a(d));return}m()},{immediate:!0}),(w,T)=>i.value?(I(),re(hE,{key:0,ref_key:"bottomDrawerRef",ref:l,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,onShow:T[0]||(T[0]=k=>r("showDrop")),onHide:T[1]||(T[1]=k=>r("hideDrop"))},{default:Z(()=>[Ce(w.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title"])):(I(),G("div",{key:1,id:e.dropId,ref_key:"drop",ref:u,class:"oc-drop shadow-md/20 rounded-sm",onClick:f},[s.value&&w.$slots.default?(I(),re(mc,{key:0,"body-class":[a(BS)(e.paddingSize)]},{default:Z(()=>[Ce(w.$slots,"default")]),_:3},8,["body-class"])):s.value?Ce(w.$slots,"special",{key:1}):le("",!0)],8,mE))}}),vE=["type","disabled"],yE={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},bE=["textContent"],mm="file-copy",wE=ge({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,o=nn("passwordInput"),{$gettext:s}=me.useGettext(),i=W(e.value),l=W(!1),u=W(mm),d=W(!1),c=A(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),p=A(()=>e.passwordPolicy?.missing(a(i))),f=k=>{const S={};for(let y=0;y<k.format.length;y++)S[`param${y+1}`]=k.format[y]?.toString();return s(k.message,S,!0)},h=()=>{navigator.clipboard.writeText(a(i)),u.value="check",setTimeout(()=>u.value=mm,1500)},g=()=>{const k=e.generatePasswordMethod();i.value=k,r("passwordGenerated",i.value)};return t({focus:()=>{a(o).focus()},select:()=>{a(o).select()},setSelectionRange:(k,S)=>{a(o).setSelectionRange(k,S)}}),Ue(i,k=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(k))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(k,S)=>{const y=oe("oc-contextual-helper"),E=oe("portal"),D=Lt("oc-tooltip");return I(),G(Ae,null,[Q("div",{class:R.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":d.value,"border-role-outline":!d.value}])},[je(Q("input",pt(k.$attrs,{ref_key:"passwordInput",ref:o,"onUpdate:modelValue":S[0]||(S[0]=$=>i.value=$),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:l.value?"text":"password",disabled:e.disabled,onFocus:S[1]||(S[1]=$=>d.value=!0),onBlur:S[2]||(S[2]=$=>d.value=!1)}),null,16,vE),[[Ey,i.value]]),i.value&&!e.disabled?je((I(),re(Qt,{key:0,"aria-label":l.value?a(s)("Hide password"):a(s)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:S[3]||(S[3]=$=>l.value=!l.value)},{default:Z(()=>[J(or,{size:"small",name:l.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[D,l.value?a(s)("Hide password"):a(s)("Show password")]]):le("",!0),i.value&&!e.disabled?je((I(),re(Qt,{key:1,"aria-label":a(s)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:h},{default:Z(()=>[J(or,{size:"small",name:u.value},null,8,["name"])]),_:1},8,["aria-label"])),[[D,a(s)("Copy password")]]):le("",!0),e.generatePasswordMethod&&!e.disabled?je((I(),re(Qt,{key:2,"aria-label":a(s)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:g},{default:Z(()=>[J(or,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[D,a(s)("Generate password")]]):le("",!0)],2),c.value?(I(),re(E,{key:0,to:"app.design-system.password-policy"},{default:Z(()=>[Q("div",yE,[(I(!0),G(Ae,null,Ye(p.value.rules,($,_)=>(I(),G("div",{key:_,class:"flex items-center oc-text-input-password-policy-rule"},[J(or,{size:"small",class:"mr-1",name:$.verified?"checkbox-circle":"close-circle",color:$.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),Q("span",{class:R.normalizeClass([{"oc-text-input-danger":!$.verified}]),textContent:R.toDisplayString(f($))},null,10,bE),$.helperMessage?(I(),re(y,{key:0,text:$.helperMessage,title:a(s)("Password policy")},null,8,["text","title"])):le("",!0)]))),128))])]),_:1})):le("",!0)],64)}}}),SE=["for"],TE={key:0,class:"text-role-error","aria-hidden":"true"},kE=["id","textContent"],CE=["id","textContent"],xE=ge({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>_r("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,o=W(!1),s=A(()=>!!e.descriptionMessage),i=A(()=>e.fixMessageLine||a(o)||a(s)),l=A(()=>a(o).toString()),u=A(()=>`${e.id}-message`),d=A(()=>e.type==="password"?{passwordGenerated:S}:{}),c=Js(),p=A(()=>{const $={};(a(o)||a(s))&&($["aria-describedby"]=u.value),e.defaultValue&&($.placeholder=e.defaultValue),e.type==="password"&&($["password-policy"]=e.passwordPolicy,$["generate-password-method"]=e.generatePasswordMethod,$["has-error"]=a(o));const{change:_,input:L,focus:V,class:te,...B}=c;return{...B,...$}}),f=A(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),h=A(()=>e.clearButtonAccessibleLabel||"Clear input"),g=A(()=>e.type==="password"?wE:"input"),m=nn("inputRef"),w=()=>{a(m).focus()};t({focus:w});function T(){w(),S(""),k(null)}const k=$=>{r("change",$)},S=$=>{r("update:modelValue",$)},y=async $=>{await xt(),a(m).select(),E(),r("focus",$.value)},E=()=>{e.selectionRange&&e.selectionRange.length>1&&a(m).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};Ue([()=>e.selectionRange,m],async()=>{a(m)&&(await xt(),E())},{immediate:!0});const D=rt.debounce(()=>{o.value=!!e.errorMessage},e.errorMessageDebouncedTime);return Ue(()=>e.modelValue,()=>{D()}),Ue(()=>e.errorMessage,()=>{e.errorMessage?D():(o.value=!1,D.cancel?.())}),($,_)=>(I(),G("div",{class:R.normalizeClass([{"flex items-center":e.inlineLabel},$.$attrs.class])},[Ce($.$slots,"label",{},()=>[Q("label",{class:R.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[ct(R.toDisplayString(e.label)+" ",1),e.requiredMark?(I(),G("span",TE,"*")):le("",!0)],10,SE)]),Q("div",{class:R.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(I(),re(or,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):le("",!0),(I(),re(rn(g.value),pt({id:e.id},p.value,{ref_key:"inputRef",ref:m,"aria-invalid":l.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!o.value,"pl-6":!!e.readOnly,"pr-6":f.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly},Gs(d.value),{onChange:_[0]||(_[0]=L=>k(L.target.value)),onInput:_[1]||(_[1]=L=>S(L.target.value)),onPasswordChallengeCompleted:_[2]||(_[2]=L=>$.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:_[3]||(_[3]=L=>$.$emit("passwordChallengeFailed")),onFocus:_[4]||(_[4]=L=>y(L.target))}),null,16,["id","aria-invalid","class","type","value","disabled"])),f.value?(I(),re(Qt,{key:1,"aria-label":h.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:T},{default:Z(()=>[J(or,{name:"close",size:"small"})]),_:1},8,["aria-label"])):le("",!0)],2),i.value?(I(),G("div",{key:0,class:R.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":s.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":o.value}])},[o.value?(I(),G(Ae,{key:0},[o.value?(I(),re(or,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):le("",!0),o.value?(I(),G("span",{key:1,id:u.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:R.toDisplayString(e.errorMessage)},null,8,kE)):le("",!0)],64)):s.value?(I(),G("span",{key:1,id:u.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:R.toDisplayString(e.descriptionMessage)},null,8,CE)):le("",!0)],2)):le("",!0),e.type==="password"?(I(),re(a(Rs.PortalTarget),{key:1,name:"app.design-system.password-policy"})):le("",!0)],2))}});var AE=Object.defineProperty,gm=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable,vm=(e,t,n)=>t in e?AE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DE=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&vm(e,n,t[n]);if(gm)for(var n of gm(t))RE.call(t,n)&&vm(e,n,t[n]);return e};const ym=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},PE={},IE={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},FE=Q("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),$E=[FE];function OE(e,t){return I(),G("svg",IE,$E)}const LE=ym(PE,[["render",OE]]),_E={},ME={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},NE=Q("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),BE=[NE];function jE(e,t){return I(),G("svg",ME,BE)}DE({},{Deselect:LE,OpenIndicator:ym(_E,[["render",jE]])});const zE=["aria-label","aria-live","aria-hidden","role"],UE=ge({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(I(),G("span",{class:R.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,zE))}}),VE={class:"oc-status-indicators flex"},qE=["id","textContent"],HE=ge({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=me.useGettext(),n=W({}),r=s=>Object.hasOwn(s,"handler"),o=s=>s.accessibleDescription?(a(n)[s.id]||(a(n)[s.id]=_r("oc-indicator-description-")),a(n)[s.id]):null;return(s,i)=>{const l=Lt("oc-tooltip");return I(),G("div",VE,[(I(!0),G(Ae,null,Ye(e.indicators,(u,d)=>(I(),G(Ae,null,[r(u)&&!e.disableHandler?je((I(),re(Qt,{id:u.id,key:`${u.id}-handler`,class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),"aria-label":a(t)(u.label),"aria-describedby":o(u),appearance:"raw","data-testid":u.id,"data-test-indicator-type":u.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>u.handler?.(e.resource,c)},{default:Z(()=>[J(or,{name:u.icon,size:"small","fill-type":u.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[l,a(t)(u.label)]]):je((I(),re(or,{id:u.id,key:u.id,tabindex:"-1",size:"small",class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),name:u.icon,"fill-type":u.fillType,"accessible-label":a(t)(u.label),"aria-describedby":o(u),"data-testid":u.id,"data-test-indicator-type":u.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[l,a(t)(u.label)]]),o(u)?(I(),G("p",{id:o(u),key:o(u),class:"sr-only",textContent:R.toDisplayString(a(t)(u.accessibleDescription))},null,8,qE)):le("",!0)],64))),256))])}}}),WE={class:"oc-thead border-b"},QE=ge({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(I(),G("thead",WE,[Ce(t.$slots,"default")]))}}),KE=ge({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(I(),G("tbody",null,[Ce(t.$slots,"default")]))}}),bm=Le(ge({__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;return(r,o)=>(I(),re(rn(e.type),{class:R.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:o[0]||(o[0]=s=>n("click",s))},{default:Z(()=>[Ce(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),wm=ge({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(I(),re(bm,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:Z(()=>[Ce(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),Sm=Le(ge({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=vv((l,u)=>{let d;return{get(){return l(),d},set(c){d=c,u()}}}),o=A(()=>e.lazy?e.lazy.colspan:1),{isVisible:s}=e.lazy?Zp({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:W(!0)},i=A(()=>!a(s));return e.lazy||n("itemVisible"),(l,u)=>(I(),G("tr",{ref_key:"observerTarget",ref:r,onClick:u[0]||(u[0]=d=>l.$emit("click",d)),onContextmenu:u[1]||(u[1]=d=>l.$emit("contextmenu",d)),onDragstart:u[2]||(u[2]=d=>l.$emit("dragstart",d)),onDrop:u[3]||(u[3]=d=>l.$emit("drop",d)),onDragenter:u[4]||(u[4]=d=>l.$emit("dragenter",d)),onDragleave:u[5]||(u[5]=d=>l.$emit("dragleave",d)),onDragover:u[6]||(u[6]=d=>l.$emit("dragover",d)),onMouseleave:u[7]||(u[7]=d=>l.$emit("mouseleave",d))},[i.value?(I(),re(wm,{key:0,colspan:o.value},{default:Z(()=>[...u[8]||(u[8]=[Q("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Ce(l.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),GE=Le(ge({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(I(),re(bm,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Z(()=>[Ce(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),JE={key:0,class:"oc-table-thead-content inline-table align-middle"},XE=["textContent"],YE={key:1},ZE={key:0,class:"oc-table-thead-content inline-table align-middle"},eR=["textContent"],tR={key:1,class:"oc-table-footer border-t"},nR={class:"oc-table-footer-row h-10.5"},rR=["colspan"],oR=Le(ge({__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:PS,EVENT_TROW_CLICKED:IS,EVENT_TROW_MOUNTED:FS,EVENT_TROW_CONTEXTMENU:$S},{$gettext:o}=me.useGettext(),s=B=>e.itemDomSelector?e.itemDomSelector(B):B[e.idKey],i=A(()=>{const B=["oc-table"];return e.hover&&B.push("oc-table-hover"),e.sticky&&B.push("oc-table-sticky"),B}),l=A(()=>e.fields.length),u=B=>{B.preventDefault()},d=(B,O)=>{n(OS,[B,O])},c=(B,O)=>{n(of,[B,O])},p=(B,O,M)=>{n("dropRowStyling",B,O,M)},f=B=>B.type==="slot",h=B=>["callback","function"].indexOf(B.type)>=0,g=B=>Object.prototype.hasOwnProperty.call(B,"title")?B.title:B.name,m=()=>({class:i.value}),w=B=>{switch(e.paddingX){case"remove":return B==="right"?"pr-0":"pl-0";case"xsmall":return B==="right"?"pr-1":"pl-1";case"small":return B==="right"?"pr-2":"pl-2";case"medium":return B==="right"?"pr-4":"pl-4";case"large":return B==="right"?"pr-6":"pl-6";case"xlarge":return B==="right"?"pr-12":"pl-12";case"xxlarge":return B==="right"?"pr-24":"pl-24"}},T=(B,O)=>{const M=y(B);return M.class=`oc-table-header-cell oc-table-header-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"thClass")&&(M.class+=` ${B.thClass}`),e.sticky&&(M.style=`top: ${e.headerPosition}px;`,M.class+=" z-10"),O===0&&(M.class+=` ${w("left")} `),O===e.fields.length-1&&(M.class+=` ${w("right")}`),L(M,B),M},k=(B,O)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${s(B)||O}`,E(B)?"oc-table-highlighted":void 0,...D(B)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),S=(B,O,M)=>{const N=y(B);return N.class=`oc-table-data-cell oc-table-data-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"tdClass")&&(N.class+=` ${B.tdClass}`),Object.prototype.hasOwnProperty.call(B,"wrap")&&(N.wrap=B.wrap),O===0&&(N.class+=` ${w("left")} `),O===e.fields.length-1&&(N.class+=` ${w("right")}`),Object.prototype.hasOwnProperty.call(B,"accessibleLabelCallback")&&(N["aria-label"]=B.accessibleLabelCallback(M)),N},y=B=>({...B?.alignH&&{alignH:B.alignH},...B?.alignV&&{alignV:B.alignV},...B?.width&&{width:B.width},class:void 0,wrap:void 0,style:void 0}),E=B=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(B[e.idKey])>-1:e.highlighted===B[e.idKey]:!1,D=B=>e.disabled.length?e.disabled.indexOf(B[e.idKey])>-1:!1,$=(B,O,M)=>{const N=[M[e.idKey],O+1].filter(Boolean);return f(B)?[...N,B.name].join("-"):h(B)?[...N,B.callback(M[B.name])].join("-"):[...N,M[B.name]].join("-")},_=B=>o("Sort by %{ name }",{name:B}),L=(B,O)=>{if(!V(O))return;let M="none";e.sortBy===O.name&&(M=e.sortDir===Xe.Asc?"ascending":"descending"),B["aria-sort"]=M},V=({sortable:B})=>!!B,te=B=>{if(!V(B))return;let O=e.sortDir;e.sortBy===B.name&&e.sortDir!==void 0&&(O=e.sortDir===Xe.Desc?Xe.Asc:Xe.Desc),(e.sortBy!==B.name||e.sortDir===void 0)&&(O=B.sortDir||Xe.Desc),n("sort",{sortBy:B.name,sortDir:O})};return(B,O)=>{const M=oe("oc-icon");return I(),G("table",pt(m(),{class:"has-item-context-menu"}),[e.hasHeader?(I(),re(QE,{key:0},{default:Z(()=>[J(Sm,{class:"oc-table-header-row h-10.5"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.fields,(N,q)=>(I(),re(GE,pt({key:`oc-thead-${N.name}`},{ref_for:!0},T(N,q)),{default:Z(()=>[N.sortable?(I(),re(Qt,{key:0,"aria-label":_(N.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:j=>te(N)},{default:Z(()=>[N.headerType==="slot"?(I(),G("span",JE,[Ce(B.$slots,N.name+"Header",{},void 0,!0)])):(I(),G("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(N))},null,8,XE)),J(M,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:R.normalizeClass([{"sr-only":e.sortBy!==N.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(I(),G("div",YE,[N.headerType==="slot"?(I(),G("span",ZE,[Ce(B.$slots,N.name+"Header",{},void 0,!0)])):(I(),G("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(N))},null,8,eR))]))]),_:2},1040))),128))]),_:3})]),_:3})):le("",!0),J(KE,{class:"has-item-context-menu"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.data,(N,q)=>(I(),re(Sm,pt({key:`oc-tbody-tr-${s(N)||q}`,ref_for:!0,ref:`row-${q}`},{ref_for:!0},k(N,q),{"data-item-id":N[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:j=>B.$emit(r.EVENT_TROW_CLICKED,[N,j]),onContextmenu:j=>B.$emit(r.EVENT_TROW_CONTEXTMENU,B.$refs[`row-${q}`][0],j,N),onVnodeMounted:j=>B.$emit(r.EVENT_TROW_MOUNTED,N,B.$refs[`row-${q}`][0]),onDragstart:j=>d(N,j),onDrop:j=>c(N,j),onDragenter:wt(j=>p(N,!1,j),["prevent"]),onDragleave:wt(j=>p(N,!0,j),["prevent"]),onDragover:O[0]||(O[0]=j=>u(j)),onItemVisible:j=>B.$emit("itemVisible",N)}),{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.fields,(j,H)=>(I(),re(wm,pt({key:"oc-tbody-td-"+$(j,H,N)},{ref_for:!0},S(j,H,N)),{default:Z(()=>[f(j)?Ce(B.$slots,j.name,{key:0,item:N},void 0,!0):h(j)?(I(),G(Ae,{key:1},[ct(R.toDisplayString(j.callback(N[j.name])),1)],64)):(I(),G(Ae,{key:2},[ct(R.toDisplayString(N[j.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),B.$slots.footer?(I(),G("tfoot",tR,[Q("tr",nR,[Q("td",{colspan:l.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Ce(B.$slots,"footer",{},void 0,!0)],8,rR)])])):le("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),gc=()=>{const{$gettext:e,$ngettext:t}=me.useGettext(),{showMessage:n,showErrorMessage:r}=Me(),{copy:o}=Rn.useClipboard(),s=({result:l,password:u})=>{const d=l.filter(Nr);let c="";if(d.length){let f=e("Link has been created successfully");if(l.length===1)try{c=u?e("%{link} Password:%{password}",{link:d[0].value.webUrl,password:u},!0):d[0].value.webUrl,f=e("The link has been copied to your clipboard.")}catch(h){console.warn("Unable to copy link to clipboard",h)}n({title:t(f,"Links have been created successfully.",d.length)})}const p=l.filter(Br);return p.length&&r({errors:p.map(({reason:f})=>f),title:t("Failed to create link","Failed to create links",p.length)}),c};return{copyLink:async({createLinkHandler:l,password:u})=>{if(navigator.clipboard.write)await new Promise((d,c)=>{const p=new ClipboardItem({"text/plain":l().then(f=>{const h=s({result:f,password:u}),g=new Blob([h],{type:"text/plain"});return d(),g}).catch(f=>{throw c(),f})});navigator.clipboard.write([p])});else{const d=await l(),c=s({result:d,password:u});c&&o(c)}}}},Ji=()=>{const{$gettext:e}=me.useGettext(),t=Dt(),n=Bt(),r=A(()=>n.can("create-all","PublicLink")),o=A(()=>Wt.View),s=d=>d===Wt.View?t.sharingPublicPasswordEnforcedFor.read_only:d===Wt.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:d===Wt.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:d===Wt.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,i=({isFolder:d})=>a(r)?d?[Wt.View,Wt.Edit,Wt.CreateOnly]:[Wt.View,Wt.Edit]:[],l=[{id:Wt.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:Wt.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:Wt.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:Wt.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:s,getAvailableLinkTypes:i,linkShareRoles:l,getLinkRoleByType:d=>l.find(({id:c})=>c===d)}},sR=ge({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=me.useGettext(),{getLinkRoleByType:r}=Ji(),o=u=>e.modelValue===u,s=u=>{t("update:modelValue",u)},i=A(()=>n(r(e.modelValue)?.displayName)),l=Ct.v4();return{isSelectedType:o,updateSelectedType:s,currentLinkRoleLabel:i,dropUuid:l,getLinkRoleByType:r}}}),iR=["textContent"],aR=["textContent"],lR={class:"flex items-center"},cR={class:"text-left"},uR=["textContent"],dR={class:"text-sm leading-4"},fR={class:"flex"};function pR(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-drop"),c=Lt("oc-tooltip");return I(),G(Ae,null,[e.availableLinkTypeOptions.length>1?(I(),re(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:Z(()=>[Q("span",{class:"link-current-role",textContent:R.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,iR),J(i,{name:"arrow-down-s"})]),_:1},8,["id"])):je((I(),G("span",{key:1,class:"link-current-role mr-4",textContent:R.toDisplayString(e.currentLinkRoleLabel)},null,8,aR)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(I(),re(d,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:Z(()=>[J(u,{class:"role-dropdown-list"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.availableLinkTypeOptions,(p,f)=>(I(),G("li",{key:`role-dropdown-${f}`},[J(l,{id:`files-role-${e.getLinkRoleByType(p).id}`,class:R.normalizeClass([{selected:e.isSelectedType(p)},"p-2"]),appearance:e.isSelectedType(p)?"filled":"raw-inverse","color-role":e.isSelectedType(p)?"secondaryContainer":"surface","justify-content":"space-between",onClick:h=>e.updateSelectedType(p)},{default:Z(()=>[Q("span",lR,[J(i,{name:e.getLinkRoleByType(p).icon,class:"pl-2 pr-4"},null,8,["name"]),Q("span",cR,[Q("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:R.toDisplayString(e.$gettext(e.getLinkRoleByType(p).displayName))},null,8,uR),Q("span",dR,R.toDisplayString(e.$gettext(e.getLinkRoleByType(p).description)),1)])]),Q("span",fR,[e.isSelectedType(p)?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):le("",!0)],64)}const Tm=Le(sR,[["render",pR]]),hR={class:"flex justify-between pb-2"},mR={key:0,class:"flex items-center"},gR={key:1,class:"flex items-center"},vR={class:"flex flex-col"},yR=["textContent"],bR=["textContent"],wR=["textContent"],SR={class:"mb-4 ml-[30px]"},TR={key:1,class:"text-sm text-role-on-surface-variant"},kR=["textContent"],CR=["textContent"],xR={class:"flex justify-end items-center mt-2"},AR={class:"sr-only"},km=ge({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Pe(),r=me.useGettext(),{$gettext:o}=r,{removeModal:s}=Je(),{copyLink:i}=gc(),l=tg(),{isEnabled:u,postMessage:d}=Tr(),{defaultLinkType:c,getAvailableLinkTypes:p,getLinkRoleByType:f,isPasswordEnforcedForLinkType:h}=Ji(),{addLink:g}=tr(),m=Bn(),{currentTheme:w}=we.storeToRefs(m),T=W(!1),k=W(!1),S=A(()=>e.resources.every(({isFolder:he})=>he)),y=A(()=>a(u)?o("Share link(s)"):o("Copy link")),E=A(()=>a(u)?o("Share link(s) and password(s)"):o("Copy link and password")),D=W(Ct.v4()),$=W({}),_=W(),L=Ta({value:"",error:void 0}),V=W(a(c)),te=A(()=>o(f(a(V)).description)),B=A(()=>o(f(a(V)).displayName)),O=A(()=>f(a(V)).icon),M=A(()=>p({isFolder:a(S)})),N=A(()=>h(a(V))),q=l.getPolicy({enforcePassword:a(N)}),j=()=>{T.value=!0},H=({date:he,error:ie})=>{_.value=he,k.value=ie},se=()=>Promise.allSettled(e.resources.map(he=>g({clientService:n,space:e.space,resource:he,options:{type:a(V),"@libre.graph.quickLink":!1,password:a(L).value,expirationDateTime:a(_)?.toISO(),displayName:o("Unnamed link")}}))),Y=A(()=>q.check(a(L).value)),ae=A(()=>!a(Y)||a(k)),ne=async()=>{const he=await se(),ie=[],de=he.filter(Br);return de.length&&de.map(({reason:ue})=>ue).forEach(ue=>{if(console.error(ue),ue.response?.status===400){const Se=ue.response.data.error;Se.message=rt.upperFirst(Se.message),ie.push(Se)}}),ie.length?(L.error=o(ie[0].message),Promise.reject()):he};t({onConfirm:async(he={})=>{if(a(u)){const de=(await ne()).filter(Nr);de.length&&(d("opencloud-embed:share",de.map(({value:ue})=>ue.webUrl)),d("opencloud-embed:share-links",de.map(({value:ue})=>({url:ue.webUrl,...he.copyPassword&&{password:a(L).value}})))),s(e.modal.id);return}await i({createLinkHandler:ne,password:he.copyPassword?a(L).value:void 0}),s(e.modal.id)}});const fe=he=>{L.value=he,L.error=void 0},be=he=>{V.value=he},xe=()=>l.generatePassword();return yt(()=>{const he=a($)[a(V)];he&&he.$el.focus(),a(N)&&(L.value=l.generatePassword())}),(he,ie)=>{const de=oe("oc-icon"),ue=oe("oc-text-input"),Se=oe("oc-datepicker"),$e=oe("oc-list"),Ve=oe("oc-drop");return I(),G(Ae,null,[Q("div",hR,[T.value?(I(),G("div",mR,[J(de,{class:"mr-2",name:O.value,"fill-type":"line"},null,8,["name"]),J(Tm,{"model-value":V.value,"available-link-type-options":M.value,"onUpdate:modelValue":be},null,8,["model-value","available-link-type-options"])])):(I(),G("div",gR,[J(de,{class:"mr-2",name:O.value,"fill-type":"line"},null,8,["name"]),Q("div",vR,[Q("span",{class:"font-semibold",textContent:R.toDisplayString(B.value)},null,8,yR),Q("span",{class:"text-sm",textContent:R.toDisplayString(te.value)},null,8,bR)])])),T.value?le("",!0):(I(),re(a(Qt),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:ie[0]||(ie[0]=lt=>j())},{default:Z(()=>[J(de,{name:"settings-3",size:"small","fill-type":"fill"}),Q("span",{textContent:R.toDisplayString(a(o)("Options"))},null,8,wR)]),_:1}))]),Q("div",SR,[T.value?(I(),re(ue,{key:D.value,"model-value":L.value,type:"password","password-policy":a(q),"generate-password-method":xe,"error-message":L.error,label:a(o)("Password"),"required-mark":N.value,class:"link-modal-password-input","onUpdate:modelValue":fe},null,8,["model-value","password-policy","error-message","label","required-mark"])):L.value?(I(),G("div",TR,[Q("span",{textContent:R.toDisplayString(a(o)("Password:"))},null,8,kR),Q("span",{textContent:R.toDisplayString(L.value)},null,8,CR)])):le("",!0),T.value?(I(),re(Se,{key:2,class:"mt-2","min-date":a(vt.DateTime).now(),label:a(o)("Expiry date"),"is-dark":a(w).isDark,onDateChanged:H},null,8,["min-date","label","is-dark"])):le("",!0)]),Q("div",xR,[J(a(Qt),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:ie[1]||(ie[1]=lt=>he.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(a(o)("Cancel")),1)]),_:1}),Q("div",{class:R.normalizeClass(["ml-2",{"oc-button-group":L.value}])},[J(a(Qt),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:ae.value,onClick:ie[2]||(ie[2]=lt=>he.$emit("confirm"))},{default:Z(()=>[ct(R.toDisplayString(y.value),1)]),_:1},8,["disabled"]),L.value?(I(),re(a(Qt),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:ae.value,"aria-label":a(o)("More options")},{default:Z(()=>[J(de,{size:"small",name:"arrow-down-s"}),Q("span",AR,R.toDisplayString(a(o)("More options")),1)]),_:1},8,["disabled","aria-label"])):le("",!0),L.value?(I(),re(Ve,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:a(o)("More options"),"close-on-click":""},{default:Z(()=>[J($e,null,{default:Z(()=>[Q("li",null,[J(a(Qt),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:ie[3]||(ie[3]=lt=>he.$emit("confirm",{copyPassword:!0}))},{default:Z(()=>[ct(R.toDisplayString(E.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):le("",!0)],2)])],64)}}}),ER=({enforceModal:e=!1}={})=>{const t=Pe(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Dt(),i=Bt(),l=Ut(),{defaultLinkType:u}=Ji(),{addLink:d}=tr(),{dispatchModal:c}=Je(),{copyLink:p}=gc(),f=({space:m,resources:w})=>{const T=s.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||T){c({title:o("Copy link for »%{resourceName}«","Copy links for the selected items",w.length,{resourceName:w[0].name}),customComponent:km,customComponentAttrs:()=>({space:m,resources:w}),hideActions:!0});return}const k=w.map(y=>d({clientService:t,space:m,resource:y,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:a(u)}}));p({createLinkHandler:()=>l.addTask(()=>Promise.allSettled(k))})},h=({resources:m})=>{if(!m.length)return!1;for(const w of m)if(!w.canShare({user:n.user,ability:i})||z.isProjectSpaceResource(w)&&w.disabled)return!1;return!0};return{actions:A(()=>[{name:"create-links",icon:"link",handler:f,label:()=>r("Create links"),isVisible:h,class:"oc-files-actions-create-links"}])}},RR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),r=et(),{$gettext:o}=me.useGettext(),{dispatchModal:s}=Je(),i=Mn(),{isEnabled:l}=Tr(),{openEditor:u}=An(),d=Pe(),c=De(),{resources:p,currentFolder:f,areFileExtensionsShown:h}=we.storeToRefs(c),{isFileNameValid:g}=Qr(),m=A(()=>i.fileExtensions.filter(({newFileMenu:S})=>!!S)),w=(S,y)=>(c.upsertResource(S),u(y,a(e),S)),T=(S,y,E)=>{let D=o("New file")+`.${y}`;a(p).some(_=>_.name===D)&&(D=wn(D,y,a(p))),h.value||(D=z.extractNameWithoutExtension({name:D,extension:y}));const $=h.value?[0,D.length-(y.length+1)]:null;s({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:D,inputLabel:o("File name"),inputRequiredMark:!0,inputSelectionRange:$,onConfirm:async _=>{h.value||(_=`${_}.${y}`);try{let L;if(E.createFileHandler)L=await E.createFileHandler({fileName:_,space:a(e),currentFolder:a(f)});else if(E.type==="folder"){const V=Ke.join(a(f).path,_);L=await d.webdav.createFolder(a(e),{path:V})}else{const V=Ke.join(a(f).path,_);L=await d.webdav.putFileContents(a(e),{path:V})}return c.upsertResource(L),t({title:o("»%{fileName}« was created successfully",{fileName:L.name})}),a(l)?void 0:w(L,E)}catch(L){console.error(L),n({title:o("Failed to create file"),errors:[L]})}},onInput:(_,L)=>{const V=h.value?_:`${_}.${y}`,te={path:Ke.join(a(f).path,V),name:V,extension:y},{isValid:B,error:O}=g(te,V);L(B?null:O)}})};return{actions:A(()=>{const S=[],y={};for(const E of a(m)||[])E.hasPriority?y[E.extension]=E:y[E.extension]=y[E.extension]||E;for(const[,E]of Object.entries(y))S.push({name:"create-new-file",icon:"add",handler:D=>T(D,E.extension,E),label:()=>o(E.newFileMenu.menuTitle()),isVisible:()=>a(f)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:E.app?.startsWith("external-")});return S}),openFile:w}},Cm=()=>{const e=Pt("scrollTo"),t=Pt("details"),n=De(),{openSideBarPanel:r}=_t(),o=A(()=>at(a(e))),s=A(()=>at(a(t))),i=(u,d={forceScroll:!1,topbarElement:null})=>{const c=document.querySelectorAll(`[data-item-id='${u}']`)[0];if(!c){ze.publish("app.files.navigate.page",{resourceId:u,forceScroll:d.forceScroll,topbarElement:d.topbarElement});return}const f=document.getElementById(d.topbarElement)?.offsetHeight||0+c.offsetHeight*2;(c.getBoundingClientRect().bottom>window.innerHeight||c.getBoundingClientRect().top<f||d.forceScroll)&&c.scrollIntoView({behavior:"smooth",block:"center"})};return ze.subscribe("app.files.navigate.scrollTo",u=>i(u.resourceId,{forceScroll:u.forceScroll,topbarElement:u.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(u,d)=>{if(!a(o)||!u.length)return;const c=a(u).find(p=>z.isIncomingShareResource(p)?p.remoteItemId===a(o):p.id===a(o));c&&c.processing!==!0&&(n.setSelection([c.id]),i(c.id,{forceScroll:!0,topbarElement:d}),a(s)&&r(a(s)))}}},DR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),{dispatchModal:r}=Je(),{$gettext:o}=me.useGettext(),{scrollToResource:s}=Cm(),i=De(),{resources:l,currentFolder:u}=we.storeToRefs(i),d=Pe(),{isFileNameValid:c}=Qr(),p=async g=>{g=g.trimEnd();try{const m=Ke.join(a(u).path,g),w=await d.webdav.createFolder(a(e),{path:m});z.isShareSpaceResource(a(e))&&(w.remoteItemId=a(e).id),i.upsertResource(w),t({title:o("»%{folderName}« was created successfully",{folderName:g})}),await xt(),s(w.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:o("Failed to create folder"),errors:[m]})}},f=()=>{let g=o("New folder");a(l).some(m=>m.name===g)&&(g=wn(g,"",a(l))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:g,inputLabel:o("Folder name"),inputRequiredMark:!0,onConfirm:p,onInput:(m,w)=>{const T={path:Ke.join(a(u).path,m),name:m,isFolder:!0},{isValid:k,error:S}=c(T,m,a(l));return w(k?null:S)}})};return{actions:A(()=>[{name:"create-folder",icon:"folder",handler:f,label:()=>o("New Folder"),isVisible:()=>a(u)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:p}},PR="rowMounted",IR="fileDropped",FR="contextmenuClicked";class bs{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class $R{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const vc=10,OR=63,yc=256;class LR{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){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 xm{targets;intersectionObserver;options;constructor(t={}){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 LR(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 ws=ge({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"layout-grid",color:"var(--oc-role-secondary)"},s={name:"resource-type-file",color:"var(--oc-role-on-surface)"},i=gd(),l=Jn(md),u=A(()=>a(m)?.name===t.name),d=A(()=>e.resource.type==="space"),c=A(()=>z.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),p=A(()=>e.resource.type==="folder"||e.resource.isFolder?t:s),f=A(()=>z.isPersonalSpaceResource(e.resource)),h=A(()=>e.resource.extension?.toLowerCase()),g=A(()=>e.resource.mimeType?.toLowerCase()),m=A(()=>{if(a(f))return n;if(a(c))return o;if(a(d))return r;const w=i[a(h)]||l?.mimeType[a(g)]||l?.extension[a(h)];return{...a(p),...w}});return(w,T)=>{const k=oe("oc-icon");return I(),re(k,{key:`resource-icon-${m.value.name}`,name:m.value.name,color:m.value.color,size:e.size,class:R.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!d.value&&!u.value}])},null,8,["name","color","size","class"])}}}),_R={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=Ge(),{options:n}=we.storeToRefs(t);return{linkTarget:A(()=>a(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},MR={key:1};function NR(e,t,n,r,o,s){return n.isResourceClickable?(I(),re(rn(s.isNavigatable?"router-link":"oc-button"),{key:0,to:s.isNavigatable?n.link:void 0,target:s.isNavigatable?e.linkTarget:void 0,rel:s.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:s.isNavigatable?void 0:"raw","gap-size":s.isNavigatable?void 0:"none","justify-content":s.isNavigatable?void 0:"left",type:s.isNavigatable?void 0:"button","no-hover":s.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=wt(()=>{},["prevent","stop"])),onClick:s.emitClick},{default:Z(()=>[Ce(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(I(),G("span",MR,[Ce(e.$slots,"default",{},void 0,!0)]))}const Xi=Le(_R,[["render",NR],["__scopeId","data-v-15d92dd6"]]),BR=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],jR={key:0,class:"truncate leading-4"},zR=["textContent"],UR=["textContent"],VR=["textContent"],bc=ge({__name:"ResourceName",props:{name:{},type:{},fullPath:{},pathPrefix:{default:""},extension:{default:""},isPathDisplayed:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},truncateName:{type:Boolean,default:!0}},setup(e){const t=A(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=A(()=>e.extension?"."+e.extension:""),r=A(()=>{if(!e.isPathDisplayed)return null;const l=e.fullPath.replace(/^\//,"").split("/");return l.length<2?null:l.length===2?l[0]+"/":`…/${l[l.length-2]}/`}),o=A(()=>!e.isPathDisplayed||a(r)===e.fullPath?null:e.pathPrefix?qa.join(e.pathPrefix,e.fullPath):e.fullPath),s=A(()=>{if(!a(o))return e.isExtensionDisplayed?`${a(t)}${a(n)}`:a(t)}),i=A(()=>(a(r)||"")+e.name);return(l,u)=>{const d=Lt("oc-tooltip");return je((I(),G("span",{class:R.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":i.value,"data-test-resource-type":e.type,title:s.value},[e.truncateName?(I(),G("span",jR,[Q("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:R.toDisplayString(t.value)},null,8,zR)])):(I(),G("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:R.toDisplayString(t.value)},null,8,UR)),e.extension&&e.isExtensionDisplayed?(I(),G("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:R.toDisplayString(n.value)},null,8,VR)):le("",!0)],10,BR)),[[d,o.value]])}}}),qR={class:"flex"},HR=["textContent"],Ss=ge({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=A(()=>e.parentFolderLink?"router-link":"span"),s=A(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),i=A(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),l=A(()=>e.resource.thumbnail),u=A(()=>e.resource.locked?r("This item is locked"):null),d=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,p)=>{const f=oe("oc-image"),h=oe("oc-icon"),g=Lt("oc-tooltip");return I(),G("div",{class:R.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?je((I(),re(Xi,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:R.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?a(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:d},{default:Z(()=>[i.value?je((I(),re(f,{key:l.value,src:l.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":u.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[g,u.value]]):je((I(),re(ws,{key:1,"aria-label":u.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[g,u.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[g,e.isResourceClickable?u.value:void 0]]):le("",!0),Q("div",{class:R.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[J(Xi,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:R.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:d},{default:Z(()=>[(I(),re(bc,{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","class"]),Q("div",qR,[e.isPathDisplayed?(I(),re(rn(o.value),{key:0,to:e.parentFolderLink,class:R.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:Z(()=>[J(h,pt(s.value,{class:"mr-1"}),null,16),Q("span",{class:"text truncate text-sm hover:underline",textContent:R.toDisplayString(e.parentFolderName)},null,8,HR)]),_:1},8,["to","class"])):le("",!0)])],2)],2)}}}),Am=ge({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new xm,{triggerDefaultAction:n}=An(),{getMatchingSpace:r}=It(),{getDefaultAction:o}=An(),{loadPreview:s}=Rc(),i=nn("resourceListItem"),{getPathPrefix:l,getParentFolderName:u,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:p}=Cr(),f=De(),h=W(),g=A(()=>f.areFileExtensionsShown),m=A(()=>({...e.searchResult.data,...a(h)&&{thumbnail:a(h)}})),w=A(()=>r(a(m))),T=A(()=>{const _=a(m);return z.isSpaceResource(_)&&_.disabled===!0}),k=()=>{n({space:a(w),resources:[a(m)]})},S=A(()=>e.isClickable?{parentFolderLink:d(a(m)),onClick:k}:{isResourceClickable:!1}),y=A(()=>{if(a(m).isFolder)return p(a(m));const _=o({resources:[a(m)],space:a(w)});if(!_?.route)return null;const L=_.route({space:a(w),resources:[a(m)]});return L.query={...L.query,contextRouteQuery:{...L.query?.contextRouteQuery||{},term:e.term}},L}),E=l(a(m)),D=u(a(m)),$=c(a(m));return yt(()=>{a(T)&&a(i).parentElement.classList.add("disabled");const _=async()=>{const V=await s({space:a(w),resource:a(m),dimensions:bs.Thumbnail,cancelRunning:!0,updateStore:!1});V&&(h.value=V)},L=rt.debounce(({unobserve:V})=>{V(),_()},250);t.observe(a(i).$el,{onEnter:L,onExit:L.cancel})}),bn(()=>{t.disconnect()}),(_,L)=>(I(),re(Ss,pt({ref_key:"resourceListItem",ref:i,resource:m.value,"path-prefix":a(E),"is-path-displayed":!0,link:y.value,"is-extension-displayed":g.value,"parent-folder-link-icon-additional-attributes":a($),"parent-folder-name":a(D),"is-thumbnail-displayed":!!h.value},S.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),WR=7,QR=200,KR=ge({name:"CreateShortcutModal",components:{ResourcePreview:Am},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Pe(),{$gettext:o}=me.useGettext(),{showMessage:s,showErrorMessage:i}=Me(),l=Re(),{search:u}=Hl(),{getPathPrefix:d,getParentFolderName:c,getParentFolderLink:p,getParentFolderLinkIconAdditionalAttributes:f,getFolderLink:h}=Cr(),g=De(),{resources:m,currentFolder:w}=we.storeToRefs(g),T=nn("dropRef"),k=W(""),S=W(""),y=W(null),E=W(null),D=W(!1);let $;const _=de=>{const ue=de.trim();return N(ue)?ue:`https://${ue}`},L=A(()=>_(a(k))),V=A(()=>!!a(m).find(de=>de.name===`${a(S)}.url`)),te=A(()=>a(V)||!a(S)||!a(k));Ue(te,()=>{t("update:confirmDisabled",a(te))},{immediate:!0});const B=A(()=>a(V)?o("»%{name}« already exists",{name:`${a(S)}.url`}):/[/]/.test(a(S))?o('Shortcut name cannot contain "/"'):""),O=$t.useTask(function*(de,ue){y.value=null,ue=`name:"*${ue}*" NOT name:"*.url"`;try{y.value=yield u(ue,WR)}catch{}}),M=rt.debounce(()=>{O.perform(a(k))},QR),N=de=>["http://","https://"].some(Se=>Se.startsWith(de)||de.startsWith(Se)),q=()=>{y.value=null,k.value=a(L);try{let de=new URL(a(L)).host;a(m).some(ue=>ue.name===`${de}.url`)&&(de=wn(`${de}.url`,"url",a(m)).slice(0,-4)),S.value=de}catch{}},j=de=>{y.value=null;const ue=new URL(window.location.href);let Se=de.data.name;k.value=`${ue.origin}/f/${de.id}`,a(m).some($e=>$e.name===`${Se}.url`)&&(Se=wn(`${Se}.url`,"url",a(m)).slice(0,-4)),S.value=Se},H=de=>a(E)===de,se=(de=!1)=>{const ue=Array.from(document.querySelectorAll("li.selectable-item"));let Se=a(E)!==null?a(E):de?ue.length:-1;const $e=de?-1:1;do if(Se+=$e,Se<0||Se>ue.length-1)return null;while(ue[Se].classList.contains("disabled"));return Se},Y=()=>{E.value=se(!0)},ae=()=>{E.value=se(!1)},ne=de=>{a(D)&&(de.stopPropagation(),a(T).hide())},pe=de=>{a(D)&&(de.stopPropagation(),a(E)!==null&&(a(E)===0?q():j(a(y)?.values?.[a(E)-1]),a(T).hide()))},fe=()=>{D.value=!1,E.value=null},be=()=>{D.value=!0,E.value=0},xe=()=>{k.value.trim().length&&a(T).show()},he=async()=>{if(await xt(),S.value=k.value.trim(),!k.value.trim().length){a(T).hide();return}a(T).show(),ln(l,"files-public-link")||M()},ie=async()=>{try{const ue=`[InternetShortcut]
32
+ URL=${Uc.sanitize(_(a(k)),{USE_PROFILES:{html:!0}})}`,Se=z.urlJoin(a(w).path,`${a(S)}.url`),$e=await r.webdav.putFileContents(e.space,{path:Se,content:ue});g.upsertResource($e),s({title:o("Shortcut was created successfully")})}catch(de){console.error(de),i({title:o("Failed to create shortcut"),errors:[de]})}};return yt(async()=>{await xt(),$=new Vc(a(T)?.$refs?.drop)}),Ue(y,async()=>{await xt(),!(!a(D)||!$)&&($.unmark(),$.mark(a(k),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Ue(E,()=>{if(!a(D)||typeof a(T)?.$el?.scrollTo!="function")return;const de=a(T).$el.querySelectorAll(".selectable-item");de[a(E)]&&a(T).$el.scrollTo(0,a(E)===null?0:de[a(E)].getBoundingClientRect().y-de[a(E)].getBoundingClientRect().height)}),n({onConfirm:ie}),{inputUrl:k,inputFilename:S,dropRef:T,dropItemUrl:L,searchResult:y,confirmButtonDisabled:te,inputFileNameErrorMessage:B,searchTask:O,dropItemUrlClicked:q,dropItemResourceClicked:j,getPathPrefix:d,getFolderLink:h,getParentFolderLink:p,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:f,onKeyEnterDrop:pe,onKeyDownDrop:ae,onKeyUpDrop:Y,onKeyEscDrop:ne,onHideDrop:fe,onShowDrop:be,onInputUrlInput:he,onClickUrlInput:xe,isDropItemActive:H,onConfirm:ie}}}),GR={class:"flex items-center mb-1"},JR={for:"create-shortcut-modal-url-input"},XR=["textContent"],YR={key:0,class:"p-1 flex justify-center"},ZR={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},eD=["textContent"],tD={key:0,class:"flex w-full mt-4"},nD={class:"flex items-center mb-1"},rD={for:"create-shortcut-modal-filename-input"};function oD(e,t,n,r,o,s){const i=oe("oc-contextual-helper"),l=oe("oc-text-input"),u=oe("oc-icon"),d=oe("oc-button"),c=oe("oc-spinner"),p=oe("resource-preview"),f=oe("oc-list"),h=oe("oc-drop");return I(),G(Ae,null,[J(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=g=>e.inputUrl=g),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[zo(e.onKeyUpDrop,["up"]),zo(e.onKeyDownDrop,["down"]),zo(e.onKeyEscDrop,["esc"]),zo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Z(()=>[Q("div",GR,[Q("label",JR,[ct(R.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=Q("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),J(i,{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:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),J(h,{ref:"dropRef",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Z(()=>[J(f,null,{default:Z(()=>[Q("li",{class:R.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[J(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Z(()=>[J(u,{name:"external-link"}),Q("span",{textContent:R.toDisplayString(e.dropItemUrl)},null,8,XR)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(I(),G("li",YR,[J(c)])):le("",!0),e.searchResult?.values?.length?(I(),G(Ae,{key:1},[Q("li",ZR,[Q("span",{textContent:R.toDisplayString(e.$gettext("Link to a file"))},null,8,eD)]),(I(!0),G(Ae,null,Ye(e.searchResult.values,(g,m)=>(I(),G("li",{key:m,class:R.normalizeClass(["selectable-item",{active:e.isDropItemActive(m+1)}])},[J(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:w=>e.dropItemResourceClicked(g)},{default:Z(()=>[J(p,{"search-result":g,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):le("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(I(),G("div",tD,[J(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=g=>e.inputFilename=g),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Z(()=>[Q("div",nD,[Q("label",rD,[ct(R.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=Q("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),J(i,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):le("",!0)],64)}const Em=Le(KR,[["render",oD]]),sD=({space:e})=>{const{dispatchModal:t}=Je(),{$gettext:n}=me.useGettext(),r=De(),{currentFolder:o}=we.storeToRefs(r);return{actions:A(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Em,customComponentAttrs:()=>({space:a(e)})})},label:()=>n("New Shortcut"),isVisible:()=>a(o)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},wc=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{can:n}=Bt(),{$gettext:r,$ngettext:o}=me.useGettext(),{createSpace:s}=go(),i=Pe(),l=Re(),u=A(()=>n("create-all","Drive")),{dispatchModal:d}=Je(),c=Ge(),p=He(),f=De(),{isSpaceNameValid:h}=Qr(),g=async({spaceName:T,resources:k,space:S})=>{const{webdav:y}=i,E=new ur({concurrency:c.options.concurrentRequests.resourceBatchActions}),D=[];try{const $=await s(T);p.upsertSpace($),k.length===1&&k[0].isFolder&&(k=(await y.listFiles(S,{path:k[0].path})).children);for(const _ of k)D.push(E.add(()=>y.copyFiles(S,_,$,{path:_.name})));await Promise.all(D),f.resetSelection(),e({title:r("Space was created successfully")})}catch($){console.error($);const _=$.statusCode===425?r("Some files could not be copied"):r("Creating space failed…");t({title:_,errors:[$]})}},m=({resources:T,space:k})=>{d({title:o("Create Space from »%{resourceName}«","Create Space from selection",T.length,{resourceName:T[0].name}),message:o("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",T.length,{resourceName:T[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"),inputRequiredMark:!0,onInput:(S,y)=>{const{isValid:E,error:D}=h(S);y(E?null:D)},onConfirm:S=>g({spaceName:S,space:k,resources:T})})};return{actions:A(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:T,space:k})=>!(!T.length||!a(u)||!st(l,"files-spaces-generic")||!z.isPersonalSpaceResource(k)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Ts=()=>{const e=et(),t=Dt(),{displayDialog:n,filesList_delete:r}=Vm(),{$gettext:o}=me.useGettext();return{actions:A(()=>[{name:"delete",icon:"delete-bin-5",label:()=>o("Delete"),handler:({resources:i})=>{r(i)},isVisible:({resources:i})=>i.length?i.every(l=>l.canBeDeleted()&&!z.isSpaceResource(l)&&!z.isIncomingShareResource(l)&&!z.isTrashResource(l)&&!l.isShareRoot()):!1,isDisabled:({resources:i})=>i.length===1&&i[0].locked,disabledTooltip:()=>o("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>o("Delete"),handler:({space:i,resources:l})=>{n(i,l)},isVisible:({space:i,resources:l})=>!l.length||!t.filesPermanentDeletion||z.isProjectSpaceResource(i)&&!i.canDeleteFromTrashBin({user:e.user})?!1:l.every(z.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Yi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Pe(),i=Ut(),l=Ge(),{updateResourceField:u}=De(),d=async({resources:p})=>{const f=[],h=[],g=new ur({concurrency:l.options.concurrentRequests.resourceBatchActions});if(p.forEach(m=>{h.push(g.add(async()=>{try{const{graphAuthenticated:w}=s;await w.driveItems.deleteDriveItem(m.driveId,m.id),u({id:m.id,field:"syncEnabled",value:!1})}catch(w){console.error(w),f.push(w)}}))}),await Promise.all(h),f.length===0){st(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",p.length)}),n.push(an("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",p.length),errors:f})};return{actions:A(()=>[{name:"disable-sync",icon:"spam-3",handler:p=>i.addTask(()=>d(p)),label:()=>r("Disable sync"),isVisible:({space:p,resources:f})=>!mt(n,"files-shares-with-me")&&!st(n,"files-spaces-generic")||f.length===0||st(n,"files-spaces-generic")&&(p?.driveType!=="share"||f.length>1||f[0].path!=="/")?!1:f.some(h=>h.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},Rm=()=>er("$archiverService"),Zi=()=>{const{showErrorMessage:e}=Me(),t=Re(),n=Rm(),{$ngettext:r,$gettext:o,current:s}=me.useGettext(),i=Lr(),l=lr(),u=({space:p,resources:f})=>(f.length>1&&(f=f.filter(h=>h.canDownload()&&!z.isProjectSpaceResource(h))),n.triggerDownload({fileIds:f.map(h=>h.fileId),...p&&z.isPublicSpaceResource(p)&&{publicToken:p.id,publicLinkPassword:i.publicLinkPassword}}).catch(h=>{console.error(h),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",f.length),errors:[h]})})),d=p=>{const f=a(n.capability);return f?p.reduce((g,m)=>g+parseInt(`${m.size}`),0)>parseInt(f.max_size):void 0};return{actions:A(()=>[{name:"download-archive",icon:"inbox-archive",handler:p=>{u(p)},label:()=>o("Download"),disabledTooltip:({resources:p})=>d(p)?o("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:Ht(a(n.capability).max_size,s)}):"",isDisabled:({resources:p})=>d(p),isVisible:({resources:p})=>a(l)&&!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")&&!mt(t,"files-shares-with-me")&&!mt(t,"files-shares-with-others")&&!mt(t,"files-shares-via-link")&&!bt(t,"files-common-search")||!a(n.available)||p.length===0||p.length===1&&!p[0].isFolder||p.length>1&&p.every(h=>z.isProjectSpaceResource(h))||z.isProjectSpaceResource(p[0])&&p[0].disabled?!1:!p.some(h=>!h.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},Sc=e=>{const{showErrorMessage:t}=Me(),{getMatchingSpace:n}=It(),r=e?.clientService||Pe(),{$gettext:o}=me.useGettext(),s=et();return{downloadFile:async(l=null,u,d=null)=>{try{l||(l=n(u));const c=await r.webdav.getFileUrl(l,u,{version:d,username:s.user?.onPremisesSamAccountName});gl(c,u.name)}catch(c){console.error(c),t({title:o("Download failed"),desc:o("File could not be located"),errors:[c]})}}}},xo=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=lr(),r=oa(),{downloadFile:o}=Sc(),s=({space:l,resources:u})=>{o(l,u[0])};return{actions:A(()=>[{name:"download-file",icon:"file-download",handler:s,label:()=>t("Download"),isVisible:({resources:l})=>a(n)&&!a(r)&&!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")&&!bt(e,"files-common-search")&&!mt(e,"files-shares-with-me")&&!mt(e,"files-shares-with-others")&&!mt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},iD=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),r=Dt(),{$gettext:o}=me.useGettext(),s=Pe(),{dispatchModal:i}=Je(),l=De(),u=He(),d=Ut(),c=async({space:h})=>{try{await s.webdav.clearTrashBin(h),e({title:o("All deleted files were removed")}),l.resetSelection(),u.updateSpaceField({id:h.id,field:"hasTrashedItems",value:!1}),l.resources.some(z.isTrashResource)&&l.clearResources()}catch(g){console.error(g),t({title:o("Failed to empty trash bin"),errors:[g]})}},p=({resources:h})=>{i({title:o("Empty trash bin for »%{name}«",{name:h[0].name}),confirmText:o("Delete"),message:o("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:h[0].name}),hasInput:!1,onConfirm:()=>d.addTask(()=>c({space:h[0]}))})};return{actions:A(()=>[{name:"empty-trash-bin",icon:({resources:h})=>h[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>o("Empty trash bin"),handler:p,isVisible:({resources:h})=>h.length!==1||!r.filesPermanentDeletion||!z.isSpaceResource(h[0])?!1:h[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:h})=>!h[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},ea=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Pe(),i=Ut(),l=Ge(),u=De(),{updateResourceField:d}=u,c=async({resources:f})=>{const h=[],g=[],m=new ur({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(w=>{g.push(m.add(async()=>{try{const{graphAuthenticated:T}=s;await T.driveItems.createDriveItem(w.driveId,{name:w.name,remoteItem:{id:w.fileId}}),d({id:w.id,field:"syncEnabled",value:!0})}catch(T){console.error(T),h.push(T)}}))}),await Promise.all(g),h.length===0){u.resetSelection(),st(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",f.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",f.length),errors:h})};return{actions:A(()=>[{name:"enable-sync",icon:"check",handler:f=>i.addTask(()=>c(f)),label:()=>r("Enable sync"),isVisible:({space:f,resources:h})=>!mt(n,"files-shares-with-me")&&!st(n,"files-spaces-generic")||h.length===0||st(n,"files-spaces-generic")&&(a(f)?.driveType!=="share"||h.length>1||h[0].path!=="/")?!1:h.some(g=>!g.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},Tc=()=>{const{showErrorMessage:e}=Me(),t=Dt(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=lr(),i=Bt(),l=De(),u=rr(),d=async({space:p,resources:f})=>{try{const h=!f[0].starred;await o.webdav.setFavorite(p,f[0],h),l.updateResourceField({id:f[0].id,field:"starred",value:h}),h||u.publish("app.files.list.removeFromFavorites",f[0].id)}catch(h){const g=r('Failed to change favorite state of "%{file}"',{file:f[0].name},!0);e({title:g,errors:[h]})}};return{actions:A(()=>[{name:"favorite",icon:"star",handler:d,label:({resources:p})=>p[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:p})=>a(s)&&!st(n,"files-spaces-generic")&&!bt(n,"files-common-favorites")||p.length!==1?!1:t.filesFavorites&&i.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function aD(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const ta=()=>{const e=Re(),{cutResources:t}=ns(),n=me.useGettext(),{$gettext:r}=n,o=De(),{currentFolder:s}=we.storeToRefs(o),i=A(()=>ts()?r("⌘ + X"):r("Ctrl + X")),l=({resources:d})=>{t(d)};return{actions:A(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:a(i),label:()=>r("Cut"),isVisible:({resources:d})=>!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")||d.length===0||!a(s)||d.length===1&&d[0].locked?!1:!d.some(p=>aD(p,a(s).path)===!1),class:"oc-files-actions-move-trigger"}])}},Dm=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=De(),{currentFolder:r}=we.storeToRefs(n),o=A(()=>ln(e,"files-public-link")?co("files-public-link"):qt(e,"files-trash-overview")?wr("files-trash-generic"):kn("files-spaces-generic"));return{actions:A(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:i})=>i.length!==1||a(r)!==null&&Uo(i[0],a(r))||z.isTrashResource(i[0])?!1:i[0].isFolder||i[0].type==="space",route:({space:i,resources:l})=>Go({},a(o),_n(i,{path:l[0].path,fileId:l[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},Pm=()=>{const{$gettext:e}=me.useGettext(),{getDefaultAction:t}=An();return{actions:A(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const o=t({...r,omitSystemActions:!0});!o||!Object.hasOwn(o,"handler")||o.handler(r)},route:r=>{const o=t({...r,omitSystemActions:!0});if(!(!o||!Object.hasOwn(o,"route")))return o.route(r)},isVisible:r=>{const o=t({...r,omitSystemActions:!0});return o?o.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},lD=()=>{const{showErrorMessage:e}=Me(),t=Re(),{$gettext:n}=me.useGettext(),r=lr(),o=oa(),s=Pe(),i=d=>{const c=/URL=(.+)/,p=d.match(c);if(p&&p[1])return p[1];throw new Error("unable to extract url")},l=async({resources:d,space:c})=>{try{const p=new URL(window.location.href),f=(await s.webdav.getFileContents(c,d[0])).body;let h=i(f);if(h=h.match(/^http[s]?:\/\//)?h:`https://${h}`,h=Uc.sanitize(h,{USE_PROFILES:{html:!0}}),h.startsWith(p.origin)){window.location.href=h;return}window.open(h)}catch(p){console.error(p),e({title:n("Failed to open shortcut"),errors:[p]})}};return{actions:A(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>n("Open shortcut"),isVisible:({resources:d})=>a(r)&&!a(o)&&!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")&&!mt(t,"files-shares-with-me")&&!mt(t,"files-shares-with-others")&&!mt(t,"files-shares-via-link")||d.length!==1||d[0].extension!=="url"?!1:d[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:i}},cD=ge({name:"AppLoadingSpinner"}),uD={class:"flex items-center justify-center size-full"};function dD(e,t,n,r,o,s){const i=oe("oc-spinner");return I(),G("div",uD,[J(i,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const kc=Le(cD,[["render",dD]]),fD=ge({name:"FilePickerModal",components:{AppLoadingSpinner:kc},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=W(),n=W(!0),r=Re(),{removeModal:o}=Je(),s=Bn(),i=r.resolve(e.parentFolderLink),l=s.currentTheme.name,u=new URL(i.href,window.location.origin);u.searchParams.append("hide-logo","true"),u.searchParams.append("embed","true"),u.searchParams.append("embed-target","file"),u.searchParams.append("embed-delegate-authentication","false"),u.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const d=()=>{n.value=!1,a(t).contentWindow.focus()},c=({data:f})=>{if(f.name!=="opencloud-embed:file-pick")return;const{resource:h,locationQuery:g}=f.data;e.callbackFn({resource:h,locationQuery:g}),o(e.modal.id)},p=({data:f})=>{f.name==="opencloud-embed:cancel"&&o(e.modal.id)};return yt(()=>{window.addEventListener("message",c),window.addEventListener("message",p)}),bn(()=>{window.removeEventListener("message",c),window.removeEventListener("message",p)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:u.href,iframeRef:t,onFilePick:c}}}),pD={class:"h-full",tabindex:"0"},hD=["title","src"];function mD(e,t,n,r,o,s){const i=oe("app-loading-spinner");return I(),G("div",pD,[e.isLoading?(I(),re(i,{key:0})):le("",!0),je(Q("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,hD),[[rd,!e.isLoading]])])}const Im=Le(fD,[["render",mD]]),Fm=(e={})=>{const t=Re(),{getMatchingSpace:n}=It(e);return{createFolderLink:o=>{const{path:s,fileId:i,resource:l}=o,u=a(e.space)||n(l);return u?qt(t,"files-trash-overview")?wr("files-trash-generic",_n(u)):kn("files-spaces-generic",_n(u,{path:s,fileId:i})):{}}}},Cr=(e={})=>{const t=Dt(),{$gettext:n}=me.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:s}=It(),{createFolderLink:i}=Fm(e);return{getPathPrefix:f=>{const h=a(e.space)||o(f);return z.isProjectSpaceResource(h)?qa.join(n("Spaces"),h.name):z.isShareSpaceResource(h)?qa.join(n("Shares"),h.name):h.name},getFolderLink:f=>i({path:f.path,fileId:f.fileId,resource:f}),getParentFolderLink:f=>{const h=a(e.space)||o(f),g=s({space:h,path:Ke.dirname(f.path)});return f.remoteItemId&&f.path==="/"||!g?an("files-shares-with-me"):z.isProjectSpaceResource(f)?kn("files-spaces-projects"):i({path:Ke.dirname(f.path),...f.parentFolderId&&{fileId:f.parentFolderId},resource:f})},getParentFolderName:f=>{const h=a(e.space)||o(f),g=s({space:h,path:Ke.dirname(f.path)});if(z.isShareRoot(f)||f.id===h.id&&z.isShareSpaceResource(h)||!g)return n("Shared with me");const w=z.extractParentFolderName(f);if(w)return w;if(z.isShareSpaceResource(h))return h.name;if(t.spacesProjects){if(z.isProjectSpaceResource(f))return n("Spaces");if(h?.driveType==="project")return h.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:f=>z.isProjectSpaceResource(f)||z.isProjectSpaceResource(r(f.storageId)||{})&&f.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},$m=({appId:e})=>{const{$gettext:t}=me.useGettext(),n=lr(),{dispatchModal:r}=Je(),o=Mn(),{apps:s}=we.storeToRefs(o),i=Re(),{getParentFolderLink:l}=Cr(),{getMatchingSpace:u}=It(),{getEditorRouteOpts:d}=An(),c=({resources:h})=>{const g=a(s)[e],m=l(h[0]),w=g.extensions.map(T=>T.extension?T.extension:T.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:g.name}),customComponent:Im,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:w,parentFolderLink:m,callbackFn:f}),focusTrapInitial:!1})},p=A(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!a(n),class:"oc-files-actions-open-with-app-trigger"}]),f=({resource:h,locationQuery:g})=>{const m=u(h),w=z.isShareSpaceResource(m)?m.id:void 0,T=d(a(i.currentRoute).name,m,h,w);T.query={...T.query,...g};const k=i.resolve(T),S=new URL(k.href,window.location.origin);window.open(S.href,"_blank")};return{actions:p,onFilePicked:f}},Om=()=>{const e=Re(),t=Pe(),{getMatchingSpace:n}=It(),{$gettext:r,$ngettext:o}=me.useGettext(),s=ns(),{startWorker:i}=ph(),l=De(),{currentFolder:u}=we.storeToRefs(l),d=A(()=>ts()?r("⌘ + V"):r("Ctrl + V")),c=A(()=>s.action===Zo.Cut?Xn.MOVE:Xn.COPY),p=async({targetSpace:g,sourceSpace:m,resources:w})=>{const T=new hd(m,w,g,a(u),u,t,r,o),k=await T.getTransferData(a(c));if(!k.length)return;const S=a(u)?.id;i(k,async({successful:y,failed:E})=>{if(T.showResultMessage(E,y,a(c)),!y.length||a(u)&&S!==a(u).id)return;const D=[],$=[];for(const _ of y)D.push((async()=>{const L=await t.webdav.getFileInfo(g,_);$.push(L)})());await Promise.allSettled(D),z.isShareSpaceResource(g)&&$.forEach(_=>{_.remoteItemId=g.id}),l.upsertResources($)})},f=async({space:g})=>{const m=s.resources.reduce((T,k)=>{if(k.storageId in T)return T[k.storageId].resources.push(k),T;const S=n(k);return S.id in T||(T[S.id]={space:S,resources:[]}),T[S.id].resources.push(k),T},{}),w=Object.values(m).map(({space:T,resources:k})=>p({targetSpace:g,sourceSpace:T,resources:k}));await Promise.all(w),s.clearClipboard()};return{actions:A(()=>[{name:"paste",icon:"clipboard",handler:f,label:()=>r("Paste"),shortcut:a(d),isVisible:({resources:g})=>s.resources.length===0||!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")||g.length===0?!1:ln(e,"files-public-link")&&a(u)?a(u)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},na=()=>{const{showErrorMessage:e}=Me(),t=Dt(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ge(),{dispatchModal:i}=Je(),l=et(),u=Bt(),d=De(),{setCurrentFolder:c,upsertResource:p}=d,{isFileNameValid:f}=Qr(),h=async(w,T,k)=>{let S=d.currentFolder;try{const y=Ke.join(Ke.dirname(T.path),k);await o.webdav.moveFiles(w,T,w,{path:y});const E=Uo(T,S);if(z.isShareSpaceResource(w)&&T.isReceivedShare()){if(w.rename(k),E)return S={...S},S.name=k,c(S),n.push(_n(w,{path:"",fileId:T.fileId}));const $={...T};$.name=k,p($);return}if(E)return S={...S},Qa(w,S,y),c(S),n.push(_n(w,{path:y,fileId:T.fileId}));const D={...T};Qa(w,D,y),p(D)}catch(y){console.error(y);let E=r('Failed to rename "%{file}" to »%{newName}«',{file:T.name,newName:k},!0);y.statusCode===423&&(E=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:T.name,newName:k},!0)),e({title:E,errors:[y]})}},g=async({space:w,resources:T})=>{const k=d.currentFolder;let S;if(Uo(T[0],k)){const B=Ke.dirname(k.path);S=(await o.webdav.listFiles(w,{path:B})).children}const y=d.areFileExtensionsShown,E=async B=>{y||(B=`${B}.${T[0].extension}`),await h(w,T[0],B)},D=(B,O)=>{y||(B=`${B}.${T[0].extension}`);const{isValid:M,error:N}=f(T[0],B,S);O(M?null:N)},$=z.extractNameWithoutExtension(T[0]),_=!T[0].isFolder&&!y?$:T[0].name,L=T[0].isFolder?r("Rename folder »%{name}«",{name:_}):r("Rename file »%{name}«",{name:_}),V=!T[0].isFolder&&!y?$:T[0].name,te=T[0].isFolder||!y?null:[0,$.length];i({title:L,confirmText:r("Rename"),hasInput:!0,inputValue:V,inputSelectionRange:te,inputLabel:T[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:E,onInput:D})};return{actions:A(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:g,isVisible:({resources:w})=>qt(n,"files-trash-generic")||mt(n,"files-shares-with-me")&&!t.sharingCanRename||w.length!==1||(s.options.routing.fullShareOwnerPaths?w.some(S=>S.remoteItemPath&&S.path):w.some(S=>S.remoteItemId&&S.path==="/"))||w.length===1&&w[0].locked?!1:!w.some(S=>!S.canRename({user:l.user,ability:u})||S.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:h}},ks=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=Me(),o=et(),s=Re(),{$gettext:i,$ngettext:l}=me.useGettext(),u=Pe(),d=He(),c=De(),{startWorker:p}=hh(),f=async(T,k)=>{const S={},y=[],E=[],D=[];for(const $ of k){const _=Ke.dirname($.path);let L=[];if(_ in S)L=S[_];else{try{L=(await u.webdav.listFiles(T,{path:_})).children}catch{D.push(_)}S[_]=L}L.some(te=>te.name===$.name)||E.filter(te=>te.id!==$.id).some(te=>te.path===$.path)?y.push($):E.push($)}return{existingResourcesByPath:S,conflicts:y,resolvedResources:E,missingFolderPaths:D.filter($=>!S[$]?.length)}},h=async T=>{let k=0;const S=[],y=T.length;let E=!1,D;for(const $ of T){const _=$.type==="folder";if(E){S.push({resource:$,strategy:D});continue}const L=y-k,te=await new Ha(i,l).resolveFileExists({name:$.name,isFolder:_},L,!1);k++,te.doForAllConflicts&&(E=!0,D=te.strategy),S.push({resource:$,strategy:te.strategy})}return S},g=(T,k,S)=>{const y=a(s.currentRoute);p({space:T,resources:k,missingFolderPaths:S},async({successful:E,failed:D})=>{if(E.length){let $;E.length===1?$=i("%{resource} was restored successfully",{resource:E[0].name}):$=i("%{resourceCount} files restored successfully",{resourceCount:E.length.toString()}),e&&n({title:$}),y.name===a(s.currentRoute).name&&y.query?.fileId===a(s.currentRoute).query?.fileId&&(c.removeResources(E),c.resetSelection());const L=await u.graphAuthenticated.drives.getDrive(T.id);d.updateSpaceField({id:L.id,field:"spaceQuota",value:L.spaceQuota}),t?.({space:T,resources:E})}if(D.length){let $;const _={};D.length===1?(_.resource=D[0].resource.name,$=i('Failed to restore "%{resource}"',_,!0)):(_.resourceCount=D.length.toString(),$=i("Failed to restore %{resourceCount} files",_,!0)),r({title:$,errors:D.map(({error:L})=>L)})}})},m=async({space:T,resources:k})=>{const S=k.sort((te,B)=>te.path.length-B.path.length),{existingResourcesByPath:y,conflicts:E,resolvedResources:D,missingFolderPaths:$}=await f(T,S),_=await h(E),L=_.filter(te=>te.strategy===Sn.REPLACE).map(te=>te.resource);D.push(...L);const V=_.filter(te=>te.strategy===Sn.KEEP_BOTH).map(te=>te.resource);for(let te of V){te={...te};const B=Ke.dirname(te.path),O=y[B]||[],M=z.extractExtensionFromFile(te),N=wn(te.name,M,[...O,..._.map(q=>q.resource),...D]);te.name=N,te.path=z.urlJoin(B,N),D.push(te)}return g(T,D,$)};return{actions:A(()=>[{name:"restore",icon:"arrow-go-back",label:()=>i("Restore"),handler:m,isVisible:({space:T,resources:k})=>!qt(s,"files-trash-generic")||!k.every(S=>z.isTrashResource(S)&&S.canBeRestored())||z.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:o.user})?!1:k.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:g,collectConflicts:f}},gD=ge({name:"SaveAsModal",components:{AppLoadingSpinner:kc},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=W(),n=W(!0),r=Bn(),{$gettext:o}=me.useGettext(),s=Re(),i=Pe(),{removeModal:l}=Je(),{showMessage:u,showErrorMessage:d}=Me(),{getMatchingSpace:c}=It(),{getEditorRouteOpts:p}=An(),f=s.resolve(e.parentFolderLink),h=r.currentTheme.name,g=new URL(f.href,window.location.origin);g.searchParams.append("hide-logo","true"),g.searchParams.append("embed","true"),g.searchParams.append("embed-target","location"),g.searchParams.append("embed-choose-file-name","true"),g.searchParams.append("embed-delegate-authentication","false"),g.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const m=()=>{n.value=!1,a(t).contentWindow.focus()},w=async({data:y})=>{if(y.name!=="opencloud-embed:select")return;const{resources:E,fileName:D,locationQuery:$}=y.data,_=E[0],L=c(_);try{const V=await T({destinationFolder:_,fileName:D,space:L});u({title:o("»%{fileName}« was saved successfully",{fileName:V.name})}),k({resource:V,space:L,locationQuery:$})}catch(V){console.error(V),d({title:o("Unable to save »%{fileName}«",{fileName:D}),errors:[V]}),console.error(V)}l(e.modal.id)},T=async({destinationFolder:y,fileName:E,space:D})=>{const{children:$}=await i.webdav.listFiles(D,{fileId:y.fileId},{davProperties:[Ee.Name]});return $.find(L=>L.name===E)&&(E=wn(E,e.originalResource.extension,$)),i.webdav.putFileContents(D,{fileName:E,parentFolderId:y.id,content:e.content,path:z.urlJoin(y.path,E)})},k=({locationQuery:y,resource:E,space:D})=>{const $=z.isShareSpaceResource(D)?D.id:void 0,_=p(a(s.currentRoute).name,D,E,$);_.query={..._.query,...y};const L=s.resolve(_),V=new URL(L.href,window.location.origin);window.open(V.href,"_blank")},S=({data:y})=>{y.name==="opencloud-embed:cancel"&&l(e.modal.id)};return yt(()=>{window.addEventListener("message",w),window.addEventListener("message",S)}),bn(()=>{window.removeEventListener("message",w),window.removeEventListener("message",S)}),{isLoading:n,onLoad:m,iframeTitle:h,iframeSrc:g.href,iframeRef:t,onLocationPick:w}}}),vD={class:"h-full",tabindex:"0"},yD=["title","src"];function bD(e,t,n,r,o,s){const i=oe("app-loading-spinner");return I(),G("div",vD,[e.isLoading?(I(),re(i,{key:0})):le("",!0),je(Q("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,yD),[[rd,!e.isLoading]])])}const Lm=Le(gD,[["render",bD]]),_m=({content:e})=>{const{$gettext:t}=me.useGettext(),n=lr(),{dispatchModal:r}=Je(),{getParentFolderLink:o}=Cr(),s=({resources:l})=>{const u=o(l[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Lm,hideActions:!0,customComponentAttrs:()=>({content:a(e),parentFolderLink:u,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:A(()=>[{name:"save-as",icon:"save-2",handler:s,label:()=>t("Save as"),isVisible:({resources:l})=>!a(n)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},wD={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},SD={key:0,class:"max-h-[400px]"},TD=["src"],kD={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},CD=["textContent"],Mm=ge({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:o}=me.useGettext(),s=Pe(),i=He(),{createDefaultMetaFolder:l}=go(),{getDefaultMetaFolder:u}=Fi(),{setCropperInstance:d}=Ql(),c=W(null),p=nn("imageRef"),f=W(null);t({onConfirm:async()=>{const w=a(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),T=await g(w);await m(T)}});const g=async w=>(await new Promise(k=>w.toBlob(k,"image/png"))).arrayBuffer(),m=async w=>{const T=s.graphAuthenticated;i.addToImagesLoading(e.space.id);let k=await u(e.space);k||(k=await l(e.space));const S={"Content-Type":"application/offset+octet-stream"};try{const{fileId:y,processing:E}=await s.webdav.putFileContents(e.space,{parentFolderId:k.id,fileName:"image.png",content:w,headers:S,overwrite:!0}),D=await T.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:y}]});E||i.removeFromImagesLoading(e.space.id),i.updateSpaceField({id:e.space.id,field:"spaceImageData",value:D.spaceImageData}),n({title:o("Space image was set successfully")}),ze.publish("app.files.spaces.uploaded-image",D)}catch(y){if(console.error(y),i.removeFromImagesLoading(e.space.id),y instanceof z.HttpError&&y.statusCode===507){r({title:o("Failed to set space image"),desc:o("Not enough quota to set the space image"),errors:[y]});return}r({title:o("Failed to set space image"),errors:[y]})}};return yt(async()=>{try{f.value=URL.createObjectURL(e.file),a(c)&&a(c)?.destroy(),await xt(),c.value=new ca(a(p),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),d(c)}catch(w){r({title:o("Failed to load space image"),errors:[w]})}}),(w,T)=>{const k=oe("oc-icon");return I(),G("div",wD,[f.value?(I(),G("div",SD,[Q("img",{ref_key:"imageRef",ref:p,src:f.value},null,8,TD),Q("div",kD,[J(k,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),Q("span",{textContent:R.toDisplayString(a(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(o)("+-"),panKeys:a(o)("↑↓←→")}))},null,8,CD)])])):le("",!0)])}}}),Nm=()=>{const e=et(),t=Re(),{$gettext:n}=me.useGettext(),r=Pe(),o=Ut(),{dispatchModal:s}=Je(),i=async({space:u,resources:d})=>{const{getFileContents:c}=r.webdav,p=await c(u,d[0],{responseType:"blob"}),f=new File([p.body],d[0].name);s({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:Mm,customComponentAttrs:()=>({file:f,space:u})})};return{actions:A(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>o.addTask(()=>i(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:d})=>d.length!==1||!d[0].hasPreview?.()||!d[0].mimeType?.includes("image/")||!st(t,"files-spaces-generic")||!u||!z.isProjectSpaceResource(u)?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},xD=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=lr(),{openSideBarPanel:r}=_t(),o=()=>{const i=qt(e,"files-trash-generic")?null:"actions";r(i)};return{actions:A(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:o,isVisible:({resources:i})=>a(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Cc=()=>{const e=Re(),t=De(),{openSideBar:n}=_t(),{$gettext:r}=me.useGettext();return{actions:A(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:s})=>qt(e,"files-trash-generic")?!1:s.length>0,handler({resources:s}){t.setSelection(s.map(({id:i})=>i)),n()}}])}},Bm=()=>{const e=Dt(),{isPersonalSpaceRoot:t}=It();return{canListShares:({space:r,resource:o})=>!e.sharingApiEnabled||z.isPublicSpaceResource(r)||t(o)||z.isTrashResource(o)?!1:z.isIncomingShareResource(o)?o.sharePermissions.includes(z.GraphSharePermission.readPermissions):z.isShareSpaceResource(r)?r.graphPermissions?.includes(z.GraphSharePermission.readPermissions):!0}},jm=()=>{const e=Dt(),t=Bt(),n=et();return{canShare:({space:o,resource:s})=>!e.sharingApiEnabled||z.isShareSpaceResource(o)||z.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:s.canShare({ability:t,user:n.user})}},xc=()=>{const e=Re(),{$gettext:t}=me.useGettext(),{canShare:n}=jm(),{openSideBarPanel:r}=_t(),{interceptModifierClick:o}=zr(),s=({resources:l,event:u})=>{const d=l[0];u&&o(u,d)||r("sharing")};return{actions:A(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:s,isVisible:({space:l,resources:u})=>qt(e,"files-trash-generic")||u.length!==1?!1:n({space:l,resource:u[0]}),class:"oc-files-actions-show-shares-trigger"}])}},ra=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ut(),i=Ge(),{updateResourceField:l,resetSelection:u}=De(),d=async({resources:p})=>{const f=[],h=[],g=new ur({concurrency:i.options.concurrentRequests.resourceBatchActions}),m=!p[0].hidden;if(p.forEach(w=>{h.push(g.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(w.driveId,w.id,{"@UI.Hidden":m}),l({id:w.id,field:"hidden",value:m})}catch(T){console.error(T),f.push(T)}}))}),await Promise.all(h),f.length===0){u(),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 the share"),errors:f})};return{actions:A(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:p=>s.addTask(()=>d(p)),label:({resources:p})=>p[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:p})=>p.length===0?!1:mt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},zm=()=>{const{$gettext:e}=me.useGettext(),{showErrorMessage:t}=Me(),{webdav:n}=Pe(),r=Dt(),o=De(),{currentFolder:s}=we.storeToRefs(o),{actions:i}=ks({showSuccessMessage:!1,onRestoreComplete:async({space:p,resources:f})=>{if(vd({resourcesStore:o,parentFolderId:f[0].parentFolderId})){const{children:h}=await n.listFiles(p,{path:a(s).path});o.upsertResources(h.filter(({id:g})=>f.some(m=>m.id===l(g))))}}}),l=p=>p.includes("!")?p.split("!")[1]:p,u=async({space:p,resources:f,callback:h})=>{const g=f.map(m=>({...m,id:l(m.id)}));try{await a(i)[0].handler({space:p,resources:g}),h()}catch(m){console.error(m),t({title:e("Failed to restore files"),errors:[m]})}},d=A(()=>ts()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:A(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:a(d),isVisible:({space:p})=>r.davTrashbin?z.isProjectSpaceResource(p)||z.isPersonalSpaceResource(p):!1,label:()=>e("Undo"),handler:u}])}},Um=()=>{const{$gettext:e}=me.useGettext(),{actions:t}=xo(),{downloadFile:n}=Sc(),{dispatchModal:r}=Je(),o=({space:i,resources:l})=>{r({title:e("No preview available for »%{name}«",{name:l[0].name}),confirmText:e("Download"),message:e("There is no preview available for this file. Do you want to download it instead?"),onConfirm:()=>{n(i,l[0])}})};return{actions:A(()=>[{name:"fallback-to-download",icon:"file-download",handler:o,label:()=>e("Download"),isVisible:i=>a(t)[0].isVisible(i),class:"oc-files-actions-fallback-to-download-trigger"}])}},Vm=()=>{const e=Ge(),{showMessage:t,showErrorMessage:n,removeMessage:r}=Me(),o=Re(),s=me.useGettext(),{getMatchingSpace:i}=It(),{$gettext:l,$ngettext:u}=s,d=Pe(),{dispatchModal:c}=Je(),p=He(),f=rr(),{bindKeyAction:h,removeKeyAction:g}=_i(),{startWorker:m}=fh({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:w}=zm(),T=De(),{currentFolder:k}=we.storeToRefs(T),S=W([]),y=Pt("page","1"),E=A(()=>parseInt(at(a(y)))),D=Pt("items-per-page","1"),$=A(()=>parseInt(at(a(D)))),_=A(()=>cd(a(S))),L=({space:N,filesToDelete:q,deletedFiles:j})=>{const H=j.length===1&&q.length===1?l('"%{item}" was moved to trash bin',{item:j[0].name}):u("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",j.length,{itemCount:j.length.toString()},!0),se=7,Y=a(w)[0],ae=Y.isVisible({space:N,resources:j});let ne;const pe=t({title:H,timeout:se,actions:[Y],actionOptions:{space:N,resources:j,callback:()=>{r(pe),ne&&g(ne)}}});ae&&(ne=h({primary:jn.Z,modifier:Li.Ctrl},()=>(g(ne),Y.handler({space:N,resources:j,callback:()=>{r(pe)}}))),setTimeout(()=>g(ne),se*1e3))},V=A(()=>{const N=a(_),q=N[0].type==="folder";let j=null;return N.length===1?(q?j=l("Permanently delete folder »%{name}«",{name:N[0].name},!0):j=l("Permanently delete file »%{name}«",{name:N[0].name},!0),j):u("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",N.length,{amount:N.length.toString()},!1)}),te=A(()=>{const N=a(_),q=N[0].type==="folder";return N.length===1?l(q?"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."):l("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),B=N=>{const q=a(o.currentRoute);m({topic:"trashBinDelete",space:N,resources:a(_)},({successful:j,failed:H})=>{if(j.length){const se=j.length===1&&a(_).length===1?l('"%{item}" was deleted successfully',{item:j[0].name}):u("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",j.length,{itemCount:j.length.toString()},!0);t({title:se})}H.forEach(({resource:se})=>{const Y=l('Failed to delete "%{item}"',{item:se.name});n({title:Y,errors:[new Error]})}),q.name===a(o.currentRoute).name&&q.query?.fileId===a(o.currentRoute).query?.fileId&&(T.removeResources(j),T.resetSelection())})};return{displayDialog:(N,q)=>{S.value=[...q],c({title:a(V),message:a(te),confirmText:l("Delete"),onConfirm:()=>B(N)})},filesList_delete:N=>{S.value=[...N],T.addResourcesIntoDeleteQueue(a(S).map(({id:H})=>H)),a(S).forEach(({id:H})=>T.removeSelection(H));const q=a(N).reduce((H,se)=>{if(se.storageId in H)return H[se.storageId].resources.push(se),H;const Y=i(se);return Y.id in H||(H[Y.id]={space:Y,resources:[]}),H[Y.id].resources.push(se),H},{}),j=a(k)?.id;return Object.values(q).map(({space:H,resources:se})=>{m({topic:"fileListDelete",space:H,resources:se},async({successful:Y,failed:ae})=>{if(Y.length&&(L({space:H,filesToDelete:se,deletedFiles:Y}),f.publish("runtime.resource.deleted",Y)),T.removeResourcesFromDeleteQueue(ae.map(({resource:ne})=>ne.id)),T.removeResourcesFromDeleteQueue(Y.map(({id:ne})=>ne)),ae.forEach(({error:ne,resource:pe})=>{let fe=l('Failed to delete "%{resource}"',{resource:pe.name});ne.statusCode===423&&(fe=l('Failed to delete "%{resource}" - the file is locked',{resource:pe.name})),n({title:fe,errors:[ne]})}),j===a(k)?.id){T.removeResources(Y);const ne=T.activeResources.length,pe=Math.ceil(a(ne)/a($));a(E)>1&&a(E)>pe&&(y.value=pe.toString())}if(st(o,"files-spaces-generic")&&!["public","share"].includes(H?.driveType)){const pe=await d.graphAuthenticated.drives.getDrive(a(N)[0].storageId);p.updateSpaceField({id:pe.id,field:"spaceQuota",value:pe.spaceQuota})}if(a(S).length&&Uo(a(S)[0],a(k)))return o.push(_n(H,{path:Ke.dirname(a(S)[0].path),fileId:a(S)[0].parentFolderId}))})})}}},AD=()=>{const e=St();return A(()=>a(e)?.query?.contextRouteName)},ED=e=>e==="files",lr=()=>{const e=St();return A(()=>ED(pl(a(e))))},Qr=()=>{const{$gettext:e}=me.useGettext(),t=De();return{isSpaceNameValid:o=>o.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Nl(o)>yc?{isValid:!1,error:e("The Space name is too long")}:o.trim()!==o?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(o)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(o,s,i=void 0)=>{if(!s)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(s))return{isValid:!1,error:e('The name cannot contain "/"')};if(/[\\]/.test(s))return{isValid:!1,error:e('The name cannot contain "\\"')};if(s===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(s==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(s.trim()!==s)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Nl(s)>yc)return{isValid:!1,error:e("The name is too long")};const l=o.path.substring(0,o.path.length-o.name.length)+s;if((i||t.resources).some(d=>d.path===l&&d.name===s)){const d=e("The name »%{name}« is already taken");return{isValid:!1,error:e(d,{name:s},!0)}}return{isValid:!0,error:void 0}}}},oa=()=>A(()=>!!document.getElementById("files-global-search-options")),qm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=St(),{dispatchModal:u}=Je(),d=He(),{removeResources:c}=De(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canBeDeleted({user:n.user,ability:s})),f=async m=>{const w=i.graphAuthenticated,T=m.map(E=>w.drives.deleteDrive(E.id).then(()=>(c([E]),d.removeSpace(E),!0))),k=await Promise.allSettled(T),S=k.filter(Nr);if(S.length){const E=S.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",S.length,{spaceCount:S.length.toString()},!0);e({title:E})}const y=k.filter(Br);if(y.length){y.forEach(console.error);const E=y.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",y.length,{spaceCount:y.length.toString()},!0);t({title:E,errors:y.map(D=>D.reason)})}a(l).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.list.load")},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",w.length,{count:w.length.toString()});u({title:o("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:r("Delete"),message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:f}},Hm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=St(),u=Re(),{dispatchModal:d}=Je(),c=He(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canDisable({user:n.user,ability:s})),f=async m=>{const w=a(l),T=i.graphAuthenticated,k=m.map(D=>T.drives.disableDrive(D.id).then(()=>(w.name==="files-spaces-generic"&&u.push({name:"files-spaces-projects"}),w.name==="admin-settings-spaces"&&(D.disabled=!0,D.spaceQuota={total:D.spaceQuota.total}),c.updateSpaceField({id:D.id,field:"disabled",value:!0}),!0))),S=await Promise.allSettled(k),y=S.filter(Nr);if(y.length){const D=y.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",y.length,{spaceCount:y.length.toString()},!0);e({title:D})}const E=S.filter(Br);if(E.length){E.forEach(console.error);const D=E.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",E.length,{spaceCount:E.length.toString()},!0);t({title:D,errors:E.map($=>$.reason)})}},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=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.",w.length,{count:w.length.toString()}),k=r("Disable");d({title:o("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:k,message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:f}},Wm=()=>{const e=Ge(),t=He(),n=tr(),{showMessage:r,showErrorMessage:o}=Me(),s=Re(),{$gettext:i}=me.useGettext(),l=Bt(),u=Pe(),d=Ut(),{upsertResource:c}=De(),p=st(s,"files-spaces-projects"),f=async m=>{const w=t.spaces.filter(z.isProjectSpaceResource),T=wn(m.name,"",w);try{let k=await u.graphAuthenticated.drives.createDrive({name:T,description:m.description,quota:{total:m.spaceQuota.total}});const S=await u.webdav.listFiles(m);if(S.children.length){const y=new ur({concurrency:e.options.concurrentRequests.resourceBatchActions}),E=[];for(const D of S.children)E.push(y.add(()=>u.webdav.copyFiles(m,D,k,{path:D.name})));await Promise.all(E)}if(m.spaceReadmeData||m.spaceImageData){const y={special:[]};if(m.spaceReadmeData){const E=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceReadmeData.name}`});y.special.push({specialFolder:{name:"readme"},id:E.id})}if(m.spaceImageData){const E=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceImageData.name}`});y.special.push({specialFolder:{name:"image"},id:E.id})}k=await u.graphAuthenticated.drives.updateDrive(k.id,y,n.graphRoles)}t.upsertSpace(k),p&&c(k),r({title:i("Space »%{space}« was duplicated successfully",{space:m.name})})}catch(k){console.error(k),o({title:i("Failed to duplicate space »%{space}«",{space:m.name}),errors:[k]})}},h=async({resources:m})=>{for(const w of m)w.disabled||!z.isProjectSpaceResource(w)||await f(w)};return{actions:A(()=>[{name:"duplicate",icon:"folders",label:()=>i("Duplicate"),handler:m=>d.addTask(()=>h(m)),isVisible:({resources:m})=>!m?.length||m.every(w=>w.disabled)||m.every(w=>!z.isProjectSpaceResource(w))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:f}},RD=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r}=me.useGettext(),o=Bt(),s=Pe(),i=St(),{dispatchModal:l}=Je(),u=He(),d=(f,h)=>s.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,description:h}).then(()=>{u.updateSpaceField({id:f.id,field:"description",value:h}),a(i).name==="admin-settings-spaces"&&(f.description=h),e({title:r("Space subtitle was changed successfully")})}).catch(m=>{console.error(m),t({title:r("Failed to change space subtitle"),errors:[m]})}),c=({resources:f})=>{f.length===1&&l({title:r("Change subtitle for space")+" "+f[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:f[0].description,onConfirm:h=>d(f[0],h)})};return{actions:A(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:d}},DD={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:W(void 0),options:W([])}},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 rt.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=Ht(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},PD={class:"quota-select-batch-action-form"},ID=["textContent"],FD={class:"flex justify-between"},$D=["textContent"],OD={key:0,class:"oc-text-input-danger"};function LD(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-select");return I(),G("div",PD,[J(l,pt({ref:"select","model-value":r.selectedOption,selectable:s.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":s.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":s.onUpdate}),{"selected-option":Z(({displayValue:u})=>[e.$attrs["read-only"]?(I(),re(i,{key:0,name:"lock",class:"mr-1",size:"small"})):le("",!0),Q("span",{textContent:R.toDisplayString(u)},null,8,ID)]),search:Z(({attributes:u,events:d})=>[Q("input",pt({class:"vs__search"},u,Gs(d,!0)),null,16)]),option:Z(({displayValue:u,error:d})=>[Q("div",FD,[Q("span",{textContent:R.toDisplayString(u)},null,8,$D)]),d?(I(),G("div",OD,R.toDisplayString(d),1)):le("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Qm=Le(DD,[["render",LD]]),_D={key:0,class:"mt-2"},MD=["textContent"],Km=ge({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:o,showErrorMessage:s}=Me(),{$gettext:i,$ngettext:l}=me.useGettext(),u=Pe(),d=Re(),c=He(),p=Dt(),{spacesMaxQuota:f}=we.storeToRefs(p),{updateResourceField:h}=De(),g=W(e.spaces[0]?.spaceQuota?.total||0),m=y=>e.resourceType==="space"?l("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",y,{count:y.toString()}):e.resourceType==="user"?l("User quota was changed successfully","Quota of %{count} users was changed successfully",y,{count:y.toString()}):i("Quota was changed successfully"),w=y=>e.resourceType==="space"?l("Failed to change space quota","Failed to change quota for %{count} spaces",y,{count:y.toString()}):e.resourceType==="user"?l("Failed to change user quota","Failed to change quota for %{count} users",y,{count:y.toString()}):i("Failed to change quota"),T=A(()=>!e.spaces.some(y=>y.spaceQuota.total!==a(g)));Ue(T,()=>{r("update:confirmDisabled",a(T))},{immediate:!0});const k=y=>{g.value=y.value};return t({onConfirm:async()=>{const y=u.graphAuthenticated,E=e.spaces.map(async L=>{const V=await y.drives.updateDrive(L.id,{name:L.name,quota:{total:a(g)}});a(d.currentRoute).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:L.id,quota:V.spaceQuota}),a(d.currentRoute).name==="admin-settings-users"&&ze.publish("app.admin-settings.users.user.quota.updated",{spaceId:L.id,quota:V.spaceQuota}),c.updateSpaceField({id:L.id,field:"spaceQuota",value:V.spaceQuota}),h({id:L.id,field:"spaceQuota",value:V.spaceQuota})}),D=await Promise.allSettled(E),$=D.filter(Nr);$.length&&o({title:m($.length)});const _=D.filter(Br);_.length&&(console.error(_),_.forEach(console.error),s({title:w(_.length),errors:_.map(L=>L.reason)}))}}),(y,E)=>{const D=oe("oc-contextual-helper");return I(),G(Ae,null,[J(Qm,{"total-quota":g.value,"max-quota":a(f),"position-fixed":!0,onSelectedOptionChange:k},null,8,["total-quota","max-quota"]),e.warningMessage?(I(),G("div",_D,[Q("span",{class:"oc-text-input-warning",textContent:R.toDisplayString(e.warningMessage)},null,8,MD),e.warningMessageContextualHelperData?(I(),re(D,pt({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):le("",!0)])):le("",!0)],64)}}}),Gm=()=>{const{dispatchModal:e}=Je(),{$gettext:t}=me.useGettext(),n=Bt(),r=({resources:i})=>i.length===1?t("Change quota for Space »%{name}«",{name:i[0].name}):t("Change quota for %{count} Spaces",{count:i.length.toString()}),o=({resources:i})=>{e({title:r({resources:i}),customComponent:Km,customComponentAttrs:()=>({spaces:i,resourceType:"space"})})};return{actions:A(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:i})=>!i||!i.length||i.some(l=>!z.isProjectSpaceResource(l)||z.isSpaceResource(l)&&!l.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Jm(){const{triggerDefaultAction:e}=An();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const ND=()=>{const e=Pe(),{openWithDefaultApp:t}=Jm(),{createDefaultMetaFolder:n}=go(),r=et(),o=He(),{$gettext:s}=me.useGettext(),{getDefaultMetaFolder:i}=Fi(),l=async(c,p)=>{const f=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:p.id,fileName:"readme.md"}),h=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:f.id}]});return o.updateSpaceField({id:c.id,field:"spaceReadmeData",value:h.spaceReadmeData}),f},u=async({resources:c})=>{let p=null,f=await i(c[0]);if(f||(f=await n(c[0]),p=await l(c[0],f)),!p){const h=z.getRelativeSpecialFolderSpacePath(c[0],"readme");h?p=await e.webdav.getFileInfo(c[0],{path:h}):p=await l(c[0],f)}t({space:c[0],resource:p})};return{actions:A(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Xm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r}=me.useGettext(),o=Bt(),s=Pe(),i=St(),{isSpaceNameValid:l}=Qr(),{dispatchModal:u}=Je(),d=He(),c=(h,g)=>s.graphAuthenticated.drives.updateDrive(h.id,{name:g}).then(()=>{a(i).name==="admin-settings-spaces"&&(h.name=g),d.updateSpaceField({id:h.id,field:"name",value:g}),e({title:r("Space name was changed successfully")})}).catch(w=>{console.error(w),t({title:r("Failed to rename space"),errors:[w]})}),p=({resources:h})=>{h.length===1&&u({title:r("Rename space »%{name}«",{name:h[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:h[0].name,inputRequiredMark:!0,onConfirm:g=>c(h[0],g),onInput:(g,m)=>{const{isValid:w,error:T}=l(g);m(w?null:T)}})};return{actions:A(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:p,isVisible:({resources:h})=>h.length!==1?!1:h[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},Ym=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=Ut(),u=St(),{dispatchModal:d}=Je(),c=He(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canRestore({user:n.user,ability:s})),f=async m=>{const w=i.graphAuthenticated,T=m.map(E=>w.drives.updateDrive(E.id,{name:E.name},{headers:{Restore:"true"}}).then(D=>(a(u).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=D.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),k=await l.addTask(()=>Promise.allSettled(T));await c.loadGraphPermissions({ids:m.map(E=>E.id),graphClient:w});const S=k.filter(Nr);if(S.length){const E=S.length===1&&m.length===1?r("Space »%{space}« was enabled successfully",{space:m[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",S.length,{spaceCount:S.length.toString()},!0);e({title:E})}const y=k.filter(Br);if(y.length){y.forEach(console.error);const E=y.length===1&&m.length===1?r("Failed to enable space »%{space}«",{space:m[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:E,errors:y.map(D=>D.reason)})}},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",w.length,{count:w.length.toString()}),k=r("Enable");d({title:o("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:k,message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:f}},BD=()=>{const{$gettext:e}=me.useGettext(),t=De(),{openSideBarPanel:n}=_t(),r=({resources:s})=>{t.setSelection(s.map(({id:i})=>i)),n("space-share")};return{actions:A(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:s})=>s.length===1&&!s[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},jD=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=o=>wr("files-trash-generic",{..._n(o,{fileId:o.fileId})});return{actions:A(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:o})=>{e.push(n(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!z.isProjectSpaceResource(o[0])&&!z.isPersonalSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},zD=ge({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=Bn(),{currentTheme:r}=we.storeToRefs(n),o=A(()=>a(r).isDark?"dark":"light");return{onEmojiSelect:i=>{t("confirm",i)},theme:o}}});function UD(e,t,n,r,o,s){const i=oe("oc-emoji-picker");return I(),re(i,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Zm=Le(zD,[["render",UD]]),VD=()=>{const e=et(),{showMessage:t,showErrorMessage:n}=Me(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ut(),i=He(),{createDefaultMetaFolder:l}=go(),{dispatchModal:u}=Je(),{getDefaultMetaFolder:d}=Fi(),c=({resources:g})=>{g.length===1&&u({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:g[0].name}),hideConfirmButton:!0,customComponent:Zm,focusTrapInitial:!1,onConfirm:m=>f(g[0],m)})},p=async g=>{const m=document.createElement("canvas"),w=m.getContext("2d"),T=16/9,k=720,S=k/T;m.width=k,m.height=S;const y=.4*k;w.font=`${y}px sans-serif`,w.textBaseline="middle",w.textAlign="center",w.fillText(g,m.width/2,m.height/2+15);const D=await wp(m);return bp(D)},f=async(g,m)=>{const w=o.graphAuthenticated,T=await p(m);let k=await d(g);return k||(k=await l(g)),s.addTask(async()=>{const S={"Content-Type":"application/offset+octet-stream"};try{const{fileId:y}=await o.webdav.putFileContents(g,{parentFolderId:k.id,fileName:"image.png",content:T,headers:S,overwrite:!0}),E=await w.drives.updateDrive(g.id,{name:g.name,special:[{specialFolder:{name:"image"},id:y}]});i.updateSpaceField({id:g.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),ze.publish("app.files.spaces.uploaded-image",E)}catch(y){if(console.error(y),y instanceof z.HttpError&&y.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[y]});return}n({title:r("Failed to set space icon"),errors:[y]})}})};return{actions:A(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:g})=>g.length!==1?!1:g[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:f}},qD=()=>{const e=et(),{$gettext:t}=me.useGettext(),{dispatchModal:n}=Je(),{graphAuthenticated:r,webdav:o}=Pe(),s=He(),{showMessage:i,showErrorMessage:l}=Me(),{defaultSpaceImageBlobURL:u}=we.storeToRefs(s),d=async({space:f})=>{try{await o.deleteFile(f,{path:".space/image.png"}),await r.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"image"},id:null}]}),s.updateSpaceField({id:f.id,field:"spaceImageData",value:null}),s.updateSpaceField({id:f.id,field:"thumbnail",value:a(u)}),i({title:t("Space image deleted successfully")})}catch(h){console.error(h),l({title:t("Failed to delete space image"),errors:[h]})}},c=({resources:f})=>{n({title:t("Delete »%{space}« image",{space:f[0].name}),confirmText:t("Delete"),onConfirm:()=>d({space:f[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:f[0].name})})};return{actions:A(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:f})=>f.length!==1||!f[0].spaceImageData?!1:f[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:d}},HD=()=>{const{$gettext:e}=me.useGettext(),{openSideBar:t}=_t();return{actions:A(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>t(),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},WD=()=>{const{getMatchingSpace:e}=It(),t=He(),n=Mn(),r=De(),o=Pe(),{$gettext:s}=me.useGettext(),{openEditor:i}=An(),{resources:l,currentFolder:u}=we.storeToRefs(r);return{openEmptyEditor:async(c,p)=>{let f=a(u)?e(a(u)):null,h=a(l),g=a(u)?.path;(!f||!a(u).canCreate())&&(f=t.personalSpace,h=(await o.webdav.listFiles(f)).children,g="");let m=s("New file")+`.${p}`;h.some(S=>S.name===m)&&(m=wn(m,p,h));const w=await o.webdav.putFileContents(f,{path:z.urlJoin(g,m)}),T=e(w),k=n.fileExtensions.find(({app:S,extension:y})=>S===c&&y===p);i(k,T,w)}}},eg=()=>{const{$gettext:e}=me.useGettext(),{showMessage:t}=Me();return{openUrl:(r,o,s)=>{const i=window.open(r,o);i?s&&i.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.")})}}},QD=()=>er("$appProviderService"),KD=()=>{const{isResourceAccessible:e}=It();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:s,ancestorMetaData:i=W({})})=>{const l=(c="")=>c.split("/").filter(Boolean),u=l(r.path),d=l(s);return d.map((c,p)=>{const f=z.urlJoin(...d.slice(0,p+1),{leadingSlash:!0}),h=e({space:a(o),path:f});let g;return h&&(g=a(i)[f]),{id:Ct.v4(),allowContextActions:!0,text:c,...h&&{to:{path:"/"+[...u].splice(0,u.length-d.length+p+1).join("/"),query:{...po(r.query,"page","fileId"),...g&&{fileId:g.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:Ct.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},GD=(e="")=>{const t=W(0),n=async()=>{await xt();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,yt(n),{y:t,refresh:n}},Ac=()=>{const e=W(!0),t=()=>{e.value=window.innerHeight>500};return yt(()=>{t(),window.addEventListener("resize",t)}),bn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class Ao{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function JD(e){const t=Ds.useRouter(),n=Ds.useRoute(),r=XD(e),o=YD(e),s=A(()=>Math.ceil(a(e.items).length/a(o))||1),i=A(()=>{if(!a(o))return a(e.items);const l=(a(r)-1)*a(o),u=l+a(o);return a(e.items).slice(l,u)});return ze.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:u,topbarElement:d})=>{const c=rt.findIndex(a(e.items),p=>p.id===l);if(c>=0){const p=Math.ceil((c+1)/Number(a(o)));t.push({...a(n),query:{...a(n).query,page:p}}).then(()=>{ze.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:u,topbarElement:d})})}}),{items:i,total:s,page:r,perPage:o}}function XD(e){if(e.page)return A(()=>a(e.page));const t=Pt("page","1");return A(()=>parseInt(at(a(t))))}function YD(e){if(e.perPage)return A(()=>a(e.perPage));const t=nr({name:e.perPageQueryName||Ao.perPageQueryName,defaultValue:e.perPageDefault||Ao.perPageDefault,storagePrefix:e.perPageStoragePrefix});return A(()=>parseInt(at(a(t))))}const tg=()=>er("$passwordPolicyService");var sa=(e=>(e.mounted="portal-target.mounted",e))(sa||{});const ZD=()=>{const e=rr(),t=Rs.useWormhole();return{registerPortal:r=>{e.subscribe(sa.mounted,()=>{t.open(r)})}}},ng=()=>er("$previewService"),rg=()=>{const e=Mn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},og=()=>{const e=et();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||z.isSpaceResource(r)||z.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},sg=()=>{const e=Pe(),t=He(),n=A(()=>t.spaces),r=u=>a(n).find(d=>u.toString().startsWith(d.id.toString())),o=u=>a(n).find(d=>z.isMountPointSpaceResource(d)&&d.root?.remoteItem?.id===u),s=(u,d)=>{const c=[Ee.FileId,Ee.FileParent,Ee.Name,Ee.ResourceType],p=z.buildSpace({id:u,name:""});return e.webdav.getFileInfo(p,{fileId:u},{davProperties:c,signal:d})},i=$t.useTask(function*(u,d){let c,p,f=r(d);if(f)return c=yield e.webdav.getPathForFileId(d,{signal:u}),p=yield e.webdav.getFileInfo(f,{path:c},{signal:u}),{space:f,resource:p,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:u});let h=o(d);p=yield s(d,u);const g=h?[]:[a(p).name];let m=a(p);for(;!h;)m=yield s(m.parentFolderId,u),h=o(m.id),h||g.unshift(m.name);return f=t.getSpace(h.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:p.storageId?.startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share",id:h.root?.remoteItem?.id,shareName:h.name}),c=z.urlJoin(...g),{space:f,resource:p,path:c}}).restartable();return{getResourceContext:u=>i.perform(u)}},Ft={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},eP=140,tP=84,ig=()=>{const e=W(eP),t=W(tP),n=o=>a(e)+(o-1)*a(t);return{calculateTileSizePixels:n,calculateTileSizeRem:o=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(o)/s}}};function nP(e){if(e)return A(()=>a(e));const t=nr({name:Ft.queryName,defaultValue:Ft.defaultModeName});return A(()=>at(a(t)))}function rP(e){if(e)return A(()=>parseInt(a(e)));const t=nr({name:Ft.tilesSizeQueryName,defaultValue:Ft.tilesSizeDefault.toString()});return A(()=>parseInt(at(a(t))))}const oP=W(Ft.tilesSizeMax);function Ec(){return oP}const Rc=e=>{const t=ng(),{updateResourceField:n}=De(),{httpAuthenticated:r}=Pe(),o=He(),{defaultSpaceImageBlobURL:s}=we.storeToRefs(o),i=Ge(),{serverUrl:l}=we.storeToRefs(i),u=new ur({concurrency:4}),d=A(()=>a(e)===Ft.name.tiles),c=A(()=>a(d)?Ci.enum.fit:Ci.enum.thumbnail),p=A(()=>a(d)?bs.Tile:bs.Thumbnail),f=$t.useTask(function*(w,{space:T,resource:k,dimensions:S,processor:y,updateStore:E=!0}){const D=z.isProjectSpaceResource(k)?z.buildSpaceImageResource(k):k,$=D.id===T.spaceImageData?.id;$&&o.addToImagesLoading(T.id);const _=yield u.add(()=>t.loadPreview({space:T,resource:D,processor:y||a(c),dimensions:S||a(p)},!0,!0,w));return _&&E&&n({id:k.id,field:"thumbnail",value:_}),$&&o.removeFromImagesLoading(T.id),_}),h=async w=>{const{resource:T,cancelRunning:k}=w;if(k&&m(),z.isProjectSpaceResource(T)&&(!T.spaceImageData||T.disabled)){a(s)&&o.updateSpaceField({id:T.id,field:"thumbnail",value:a(s)});try{const S=await r.get(`${a(l)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(S.data)),o.updateSpaceField({id:T.id,field:"thumbnail",value:a(s)}),a(s)}catch{return null}}try{return await f.perform(w)}catch(S){S!=="cancel"&&console.error(S)}},g=A(()=>f.isRunning),m=()=>{f.cancelAll(),u.clear(),o.purgeImagesLoading()};return Qs(m),{loadPreview:h,previewsLoading:g}},ag=({showSizeInformation:e=!0}={})=>{const t=De(),{current:n,$gettext:r,$ngettext:o}=me.useGettext(),s=Re(),{resources:i,totalResourcesCount:l,areHiddenFilesShown:u,currentFolder:d}=we.storeToRefs(t),c=A(()=>{if(!a(d)?.size||a(d)?.size==="0"){const f=a(i).map(h=>h.size?parseInt(h.size.toString()):0).reduce((h,g)=>h+g,0);return Ht(f,n)}return Ht(a(d).size,n)});return{resourceContentsText:A(()=>{let f=o("%{ filesCount } file","%{ filesCount } files",a(l).files,{filesCount:a(l).files.toString()});!a(u)&&a(l).hiddenFiles&&(f=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",a(l).files,{filesCount:a(l).files.toString(),filesHiddenCount:a(l).hiddenFiles.toString()}));let h=o("%{ foldersCount } folder","%{ foldersCount } folders",a(l).folders,{foldersCount:a(l).folders.toString()});!a(u)&&a(l).hiddenFolders&&(h=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",a(l).folders,{foldersCount:a(l).folders.toString(),foldersHiddenCount:a(l).hiddenFolders.toString()}));const g=o("%{ spacesCount } space","%{ spacesCount } spaces",a(l).spaces,{spacesCount:a(l).spaces.toString()}),m=a(l).files+a(l).folders+a(l).spaces,w=e&&parseFloat(a(c))>0,T=mt(s,"files-shares-via-link"),k=r(w?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),S=r(w?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),y=T?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",E=`${k} ${y}`,D=`${S} ${y}`;return o(E,D,m,{itemsCount:m.toString(),itemSize:a(c),filesStr:f,foldersStr:h,spacesStr:g})})}},Dc=()=>{const{$gettext:e}=me.useGettext(),{interceptModifierClick:t}=zr(),{openSideBarPanel:n}=_t(),r=De(),o=et(),s=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.authenticated,k??[]),i=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.unauthenticated,k??[]),l=({isDirect:k})=>e(k?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),u=({isDirect:k})=>e(k?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),d=({resource:k,isDirect:S})=>({id:`files-sharing-${k.getDomSelector()}`,accessibleDescription:l({isDirect:S}),label:e("Show invited people"),icon:"group",category:"sharing",type:S?"user-direct":"user-indirect",fillType:"line",handler:(y,E)=>{E&&t(E,y)||n("sharing")}}),c=({resource:k})=>({id:`files-sharing-synced-${k.getDomSelector()}`,accessibleDescription:e("This item is synced with your devices"),label:e("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),p=({resource:k})=>k.shareRoles?.length?{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:e(k.shareRoles[0].description),label:e(k.shareRoles[0].displayName),icon:k.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:z.ShareTypes.remote.label,label:z.ShareTypes.remote.label,icon:z.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},f=({resource:k,isDirect:S})=>({id:`file-link-${k.getDomSelector()}`,accessibleDescription:u({isDirect:S}),label:e("Show links"),icon:"link",category:"sharing",type:S?"link-direct":"link-indirect",fillType:"line",handler:()=>n("sharing")}),h=({resource:k})=>({id:`resource-locked-${k.getDomSelector()}`,accessibleDescription:e("Item locked"),label:e("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),g=({resource:k})=>({id:`resource-processing-${k.getDomSelector()}`,accessibleDescription:e("Item in processing"),label:e("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),m=({resource:k})=>({id:`resource-space-enabled-${k.getDomSelector()}`,accessibleDescription:e("Space is enabled"),label:e("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),w=({resource:k})=>({id:`resource-space-disabled-${k.getDomSelector()}`,accessibleDescription:e("Space is disabled"),label:e("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"});return{getIndicators:({space:k,resource:S})=>{const y=[];if(S.locked&&y.push(h({resource:S})),S.processing&&y.push(g({resource:S})),z.isProjectSpaceResource(S)&&!S.disabled&&y.push(m({resource:S})),z.isProjectSpaceResource(S)&&S.disabled&&y.push(w({resource:S})),z.isIncomingShareResource(S)&&(S.shareTypes.includes(z.ShareTypes.remote.value)||S.shareRoles?.length)&&y.push(p({resource:S})),z.isIncomingShareResource(S)&&S.syncEnabled&&y.push(c({resource:S})),z.isProjectSpaceResource(k)||z.isPersonalSpaceResource(k)&&k.isOwner(o.user)){const $=Object.values(r.ancestorMetaData).flatMap(({shareTypes:V})=>V),_=s(S.shareTypes);(_||s($))&&y.push(d({resource:S,isDirect:_}));const L=i(S.shareTypes);(L||i($))&&y.push(f({resource:S,isDirect:L}))}return y}}},lg=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=rr(),{isMobile:o}=os(),{interceptModifierClick:s}=zr(),i=f=>{r.publish("app.files.list.clicked"),n("update:selectedIds",f)},l=xn(qt,"files-trash-overview"),u=f=>a(l)&&z.isProjectSpaceResource(f)&&f.disabled?!1:!t(f),d=f=>document.getElementById(`context-menu-trigger-${f.getDomSelector()}`);return{shouldShowContextDrop:u,showContextMenuOnBtnClick:(f,h)=>{const{dropdown:g,event:m}=f;if(m instanceof MouseEvent&&s(m,h))return;if(t(h))return!1;if(g?.tippy===void 0)return;const w=d(h);w&&(e(h)||i([h.id]),Ml(g.tippy,m,w))},showContextMenuOnRightClick:(f,h)=>{if(f instanceof MouseEvent&&s(f,h))return;if(f.preventDefault(),t(h))return!1;const g=d(h);if(g){if(e(h)||i([h.id]),a(o)){g.click();return}Ml(g._tippy,f,g)}}}},cg=({selectedIds:e,selectedResources:t,emit:n})=>{const r=De(),o=W(),s=nn("ghostElement"),i=async(f,h)=>{o.value=f,await xt(),a(s).$el.ariaHidden="true",a(s).$el.style.left="-99999px",a(s).$el.style.top="-99999px",h.dataTransfer.setDragImage(a(s).$el,0,0),h.dataTransfer.dropEffect="move",h.dataTransfer.effectAllowed="move"},l=async(f,h)=>{a(e).includes(f.id)||(r.toggleSelection(f.id),n("update:selectedIds",[...r.selectedIds])),await i(f,h)},u=A(()=>a(t).filter(({id:f})=>f!==a(o)?.id)),d=f=>(f.dataTransfer.types||[]).some(h=>h==="Files"),c=(f,h)=>{d(h)||(o.value=null,p(f,!0,h),n("fileDropped",f.id))},p=(f,h,g)=>{if(d(g)||g.currentTarget?.contains(g.relatedTarget)||a(e).includes(f.id)||f.type!=="folder")return;const m=document.querySelectorAll(`[data-item-id='${f.id}']`)?.[0];if(!m)return;const w="!bg-role-secondary-container";h?m.classList.remove(w):m.classList.add(w)};return{ghostElement:s,dragItem:o,dragSelection:u,dragStart:l,fileDropped:c,setDropStyling:p}},ug=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const o=rr(),{$gettext:s}=me.useGettext(),i=p=>{o.publish("app.files.list.clicked"),r("update:selectedIds",p)},l=p=>{switch(p.type){case"folder":return s("Select folder");case"space":return s("Select space");default:return s("Select file")}},u=A(()=>{const p=a(t).length===a(e).length,f=a(n).length===a(e).length-a(t).length;return!p&&f}),d=A(()=>a(u)?s("Clear selection"):s("Select all"));return{getResourceCheckboxLabel:l,areAllResourcesSelected:u,selectAllCheckboxLabel:d,toggleSelectionAll:()=>{if(a(u))return i([]);i(a(e).filter(p=>!a(t).includes(p.id)).map(p=>p.id))}}},Pc=({space:e,resources:t,selectedIds:n,emit:r})=>{const o=De(),s=Re(),i=rr(),{interceptModifierClick:l}=zr(),{getMatchingSpace:u}=It(),{canBeOpenedWithSecureView:d}=rg(),{getDefaultAction:c}=An(),{isEnabled:p,fileTypes:f,isFilePicker:h,postMessage:g}=Tr(),m=ns(),{resources:w,action:T}=we.storeToRefs(m),k=A(()=>a(t).filter(O=>a(n).includes(O.id))),S=O=>a(n).includes(O.id),y=O=>o.deleteQueue.includes(O),E=O=>a(p)&&a(f)?.length?!a(f).includes(O.extension)&&!a(f).includes(O.mimeType)&&!O.isFolder:y(O.id)?!0:O.processing===!0,D=A(()=>a(t)?.filter(E)?.map(O=>O.id)||[]);return{selectedResources:k,disabledResources:D,isResourceSelected:S,isResourceInDeleteQueue:y,isResourceDisabled:E,isResourceClickable:(O,M)=>!M||z.isProjectSpaceResource(O)&&O.disabled||!O.isFolder&&!O.canDownload()&&!d(O)?!1:!E(O),isResourceCut:O=>a(T)!==Zo.Cut?!1:a(w).some(M=>M.id===O.id),fileContainerClicked:({resource:O,event:M})=>{if(E(O))return;if(a(p)&&a(h)&&!O.isFolder)return g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(O)),locationQuery:JSON.parse(JSON.stringify(Ii(a(s.currentRoute))))});!M.shiftKey&&!M.metaKey&&!M.ctrlKey&&i.publish("app.files.shiftAnchor.reset");const N=M?.target;if(N?.closest("div")?.id==="oc-files-context-menu")return;if(M&&M.metaKey)return i.publish("app.files.list.clicked.meta",O);if(M&&M.shiftKey)return i.publish("app.files.list.clicked.shift",{resource:O,skipTargetSelection:!1});N.getAttribute("type")!=="checkbox"&&(S(O)||(i.publish("app.files.list.clicked"),r("update:selectedIds",[O.id])))},fileNameClicked:({resource:O,event:M})=>{if(!l(M,O)){if(a(p))return a(h)||r("update:selectedIds",[O.id]),a(h)&&!O.isFolder?g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(O)),locationQuery:JSON.parse(JSON.stringify(Ii(a(s.currentRoute))))}):void 0;r("fileClick",{space:u(O),resources:[O]})}},fileCheckboxClicked:({resource:O,event:M})=>{l(M,O)||(o.toggleSelection(O.id),i.publish("app.files.list.clicked"),r("update:selectedIds",[...o.selectedIds]))},getResourceLink:O=>{let M=a(e);M||(M=u(O));const N=c({resources:[O],space:M});if(N?.route)return N.route({space:M,resources:[O]})},...cg({selectedIds:n,selectedResources:k,emit:r}),...lg({isResourceDisabled:E,isResourceSelected:S,emit:r}),...ug({resources:t,disabledResources:D,selectedIds:n,emit:r})}},Ic=()=>{const{getMatchingSpace:e}=It(),t=De(),n=A({get(){return t.selectedResources},set(i){t.setSelection(i.map(({id:l})=>l))}}),r=A({get(){return t.selectedIds},set(i){t.setSelection(i)}}),o=i=>a(r).includes(i.id),s=A(()=>{if(a(n).length!==1)return null;const i=a(n)[0];return e(i)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:s}};class Cs{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function sP(e){const t=Re(),n=iP(e),r=aP(e),o=A(()=>fg(a(n))||a(Fc(a(i))?.name)),s=A(()=>cP(a(r))||lP(a(o),a(i))),i=e.fields;return{items:A(()=>{const d=a(e.items);return a(o)?dg(d,a(i),a(o),a(s)):d}),sortBy:o,sortDir:s,handleSort:({sortBy:d,sortDir:c})=>t.replace({query:{...a(t.currentRoute).query,[a(e.sortByQueryName)||Cs.sortByQueryName]:d,[a(e.sortDirQueryName)||Cs.sortDirQueryName]:c}})}}function iP(e){return e.sortBy?ft(e.sortBy)?e.sortBy:W(e.sortBy):nr({name:a(e.sortByQueryName)||Cs.sortByQueryName,defaultValue:a(Fc(a(e.fields))?.name),storagePrefix:a(e.routeName)||a(jl())})}function aP(e){return e.sortDir?ft(e.sortDir)?e.sortDir:W(e.sortDir):nr({name:a(e.sortDirQueryName)||Cs.sortDirQueryName,defaultValue:a(Fc(a(e.fields))?.sortDir),storagePrefix:a(e.routeName)||a(jl())})}const Fc=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},lP=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?a(n.sortDir):Xe.Desc},dg=(e,t,n,r)=>{const o=t.find(l=>l.name===n);if(!o)return e;const{sortable:s}=o,i=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const l=c=>c.type==="folder"&&!c.extension,u=[...e.filter(c=>l(c))].sort((c,p)=>$c(c,p,i,n,r,s)),d=[...e.filter(c=>!l(c))].sort((c,p)=>$c(c,p,i,n,r,s));return r===Xe.Asc?u.concat(d):d.concat(u)}return[...e].sort((l,u)=>$c(l,u,i,o.prop||o.name,r,s))},$c=(e,t,n,r,o,s)=>{let i=El(e,r),l=El(t,r);const u=o===Xe.Asc?1:-1;if(s)if(typeof s=="string"){const c=p=>p.map(f=>f[s]).join("");i=c(i),l=c(l)}else typeof s=="function"&&(i=s(i),l=s(l));return!isNaN(i)&&!isNaN(l)?(i-l)*u:n.compare((i||"").toString(),(l||"").toString())*u},fg=e=>Array.isArray(e)?e[0]:e,cP=e=>{switch(fg(e)){case Xe.Asc:return Xe.Asc;case Xe.Desc:return Xe.Desc}return null};function uP(e){const t=Dt(),n=Lr(),r=Pe(),o=me.useGettext(),s=A(()=>t.tusMaxChunkSize>0),i=()=>{const d={};return n.publicLinkPassword?d.Authorization="Basic "+gi.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(d.Authorization="Bearer "+n.accessToken),d["X-Request-ID"]=Ct.v4(),d["Accept-Language"]=o.current,d["Initiator-ID"]=r.initiatorId,d},l=A(()=>{const d={onBeforeRequest:(c,p)=>new Promise(f=>{const h=i();c.setHeader("Authorization",h.Authorization),c.setHeader("X-Request-ID",h["X-Request-ID"]),c.setHeader("Accept-Language",h["Accept-Language"]),c.setHeader("Initiator-ID",h["Initiator-ID"]),p?.isRemote&&c.setHeader("x-oc-mtime",(p?.data?.lastModified/1e3).toFixed(0)),f()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return d.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...i()}},d}),u=A(()=>({timeout:6e4,endpoint:"",headers:d=>({"x-oc-mtime":(d?.data?.lastModified/1e3).toFixed(0),...i()})}));Ue([l,u],()=>{if(a(s)){e.uppyService.useTus(a(l));return}e.uppyService.useXhr(a(u))},{immediate:!0})}const pg=()=>{const e=Pe(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:o}=fi(),s=async l=>{try{const u=await e.graphAuthenticated.photos.getUserPhoto(l,{responseType:"blob"});t(l,URL.createObjectURL(u))}catch(u){u.response?.status===404&&t(l,null)}return n(l)};return{enqueueAvatar:l=>{if(n(l)!==void 0||o.has(l))return;const u=r.add(()=>s(l));o.set(l,u),u.finally(()=>o.delete(l))}}},dP=ge({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 t=Ge(),{options:n}=we.storeToRefs(t),r=A(()=>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")),o=A(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...a(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...a(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(a(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),s=A(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:o,actionIcon:s}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},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}}}}),fP={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},pP=["textContent"],hP=["textContent"];function mP(e,t,n,r,o,s){const i=oe("oc-image"),l=oe("oc-icon"),u=oe("oc-button"),d=Lt("oc-tooltip");return je((I(),G("li",null,[je((I(),re(u,pt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Gs(e.componentListeners)),{default:Z(()=>[e.action.img?(I(),re(i,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(I(),re(i,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(I(),re(l,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):le("",!0),e.action.hideLabel?le("",!0):(I(),G("span",fP,[Q("span",{class:"text-left",textContent:R.toDisplayString(e.action.label(e.actionOptions))},null,8,pP)])),e.action.shortcut&&e.shortcutHint?(I(),G("span",{key:4,class:"text-sm flex-row-reverse",textContent:R.toDisplayString(e.action.shortcut)},null,8,hP)):le("",!0)]),_:1},16,["type","class","aria-label","size"])),[[d,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[d,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const ia=Le(dP,[["render",mP]]),gP=ge({name:"BatchActions",components:{ActionMenuItem:ia},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function vP(e,t,n,r,o,s){const i=oe("action-menu-item"),l=oe("oc-list");return I(),G("div",null,[J(l,{id:"oc-appbar-batch-actions",class:R.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.actions,(u,d)=>(I(),re(i,{key:`action-${d}`,action:u,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const hg=Le(gP,[["render",vP]]),yP={class:"context-menu px-2"},bP={class:"inline-flex gap-2"},wP={class:"flex oc-files-context-action-label"},SP=["textContent"],mg=ge({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=_r(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=_r(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,o)=>{const s=oe("oc-icon"),i=oe("oc-button"),l=oe("oc-list");return I(),G("li",yP,[J(i,{id:a(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:Z(()=>[Q("span",bP,[J(s,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),Q("span",wP,[Q("span",{textContent:R.toDisplayString(e.menuSectionDrop.label)},null,8,SP)])]),J(s,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),J(a(gE),{title:e.menuSectionDrop.label,"drop-id":a(t),toggle:`#${a(n)}`,"is-nested-element":!0,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:Z(()=>[e.menuSectionDrop.items.length?(I(),re(l,{key:0},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.menuSectionDrop.items,(u,d)=>(I(),re(ia,{key:`section-${e.menuSectionDrop.label}-action-${d}`,action:u,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):le("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),TP=ge({name:"ContextActionMenu",components:{ActionMenuDropItem:mg,ActionMenuItem:ia},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("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),kP={id:"oc-files-context-menu"};function CP(e,t,n,r,o,s){const i=oe("action-menu-item"),l=oe("action-menu-drop-item"),u=oe("oc-list");return I(),G("div",kP,[(I(!0),G(Ae,null,Ye(e.menuSections,(d,c)=>(I(),re(u,{id:`oc-files-context-actions-${d.name}`,key:`section-${d.name}-list`,class:R.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:Z(()=>[d.items?(I(!0),G(Ae,{key:0},Ye(d.items,(p,f)=>(I(),re(i,{key:`section-${d.name}-action-${f}`,action:p,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):le("",!0),(I(!0),G(Ae,null,Ye(d.dropItems,p=>(I(),G(Ae,null,[p.items.length?(I(),re(l,{key:p.name,"menu-section-drop":p,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):le("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const aa=Le(TP,[["render",CP]]),xP=ge({name:"ContextActions",components:{ContextActionMenu:aa},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=An(),{$gettext:n}=me.useGettext(),{actions:r}=Pm(),{actions:o}=ea(),{actions:s}=ra(),{actions:i}=Oi(),{actions:l}=Kl(),{actions:u}=Yi(),{actions:d}=Ts(),{actions:c}=Zi(),{actions:p}=xo(),{actions:f}=Tc(),{actions:h}=ta(),{actions:g}=Om(),{actions:m}=na(),{actions:w}=ks(),{actions:T}=Nm(),{actions:k}=Cc(),{actions:S}=wc(),{actions:y}=xc(),E=ho(),D=A(()=>E.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(j=>j.action)),$=A(()=>E.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(j=>j.action)),_=wv(e,"actionOptions"),L=A(()=>[...a(o),...a(u),...a(c),...a(h),...a(i),...a(d),...a(w),...a(S),...a($).filter(j=>j.category==="actions"||rt.isNil(j.category))].filter(j=>j.isVisible(a(_)))),V=A(()=>[...a(k),...a($).filter(j=>j.category==="sidebar")].filter(j=>j.isVisible(a(_)))),te=A(()=>a(r).filter(j=>j.isVisible(a(_))).sort((j,H)=>Number(H.hasPriority)-Number(j.hasPriority))),B=A(()=>t({...a(_),omitSystemActions:!0}).filter(j=>j.isVisible(a(_))).sort((j,H)=>Number(H.hasPriority)-Number(j.hasPriority))),O=A(()=>[...a(y),...a(l),...a(D).filter(j=>j.category==="share")].filter(j=>j.isVisible(a(_)))),M=A(()=>[...a(c),...a(p),...a(d),...a(h),...a(i),...a(g),...a(m),...a(S),...a(w),...a(o),...a(u),...a(s),...a(T),...a(D).filter(j=>j.category==="actions"||rt.isNil(j.category))].filter(j=>j.isVisible(a(_)))),N=A(()=>[...a(f).map(j=>(j.keepOpen=!0,j)),...a(k),...a(D).filter(j=>j.category==="sidebar")].filter(j=>j.isVisible(a(_))));return{menuSections:A(()=>{const j=[];return a(_).resources.length>1?(a(L).length&&j.push({name:"batch-actions",items:[...a(L)]}),j.push({name:"batch-details",items:[...a(V)]}),j):([...a(te),...a(B)].length&&j.push({name:"context",items:[...a(te)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...a(B)]}]}),a(O).length&&j.push({name:"share",items:a(O)}),a(M).length&&j.push({name:"actions",items:a(M)}),a(N).length&&j.push({name:"sidebar",items:a(N)}),j)})}}});function AP(e,t,n,r,o,s){const i=oe("context-action-menu");return I(),re(i,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const gg=Le(xP,[["render",AP]]),EP={class:"flex items-center"},RP={class:"flex justify-between w-full"},DP={class:"flex items-center"},PP=["textContent"],IP={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},FP={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},$P={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},OP={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},LP={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},_P={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},MP=["textContent"],NP=["max"],vg=Le(ge({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>Ao.options},perPageQueryName:{default:()=>Ao.perPageQueryName},perPageDefault:{default:()=>Ao.perPageDefault},viewModeDefault:{default:()=>Ft.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=Re(),n=St(),{$gettext:r}=me.useGettext(),o=_t(),{isSideBarOpen:s}=we.storeToRefs(o),i=De(),{setAreHiddenFilesShown:l,setAreFileExtensionsShown:u,setAreDisabledSpacesShown:d,setAreEmptyTrashesShown:c}=i,{areHiddenFilesShown:p,areFileExtensionsShown:f,areDisabledSpacesShown:h,areEmptyTrashesShown:g}=we.storeToRefs(i),m=W(!1),w=xn(st,"files-spaces-projects"),T=xn(qt,"files-trash-overview"),k=Pt("page"),S=A(()=>a(k)?parseInt(at(a(k))):1),y=nr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),E=nr({name:Ft.queryName,defaultValue:e.viewModeDefault}),D=nr({name:Ft.tilesSizeQueryName,defaultValue:Ft.tilesSizeDefault.toString()}),$=H=>t.replace({query:{...a(n).query,[e.perPageQueryName]:H.toString(),...a(S)>1&&{page:"1"}}}),_=H=>{E.value=H.name};Ue([y,E,D],H=>{m.value=H.some(se=>!se)},{immediate:!0,deep:!0});const L=Ec(),V=A({get(){return a(p)},set(H){l(H)}}),te=A({get(){return a(f)},set(H){u(H)}}),B=A({get(){return a(h)},set(H){d(H)}}),O=A({get(){return a(g)},set(H){c(H)}}),M=H=>{V.value=H},N=H=>{te.value=H},q=H=>{B.value=H},j=H=>{O.value=H};return(H,se)=>{const Y=oe("oc-icon"),ae=oe("oc-button"),ne=oe("oc-list"),pe=oe("oc-drop"),fe=oe("oc-switch"),be=oe("oc-page-size"),xe=Lt("oc-tooltip");return I(),G("div",EP,[e.viewModes.length?(I(),G(Ae,{key:0},[je((I(),re(ae,{id:"mobile-viewmode-switch-toggle","aria-label":a(r)("Switch view mode"),appearance:"raw",class:R.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!a(s),"md:hidden":a(s)}])},{default:Z(()=>[J(Y,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[xe,a(r)("Switch view mode")]]),J(pe,{title:a(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:Z(()=>[J(ne,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.viewModes,he=>(I(),G("li",{key:he.name},[J(ae,{appearance:a(E)===he.name?"filled":"raw","color-role":a(E)===he.name?"secondaryContainer":"secondary","justify-content":"left",onClick:ie=>_(he)},{default:Z(()=>[Q("div",RP,[Q("span",DP,[J(Y,{name:he.icon.name,"fill-type":he.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),Q("span",{textContent:R.toDisplayString(he.label)},null,8,PP)]),a(E)===he.name?(I(),re(Y,{key:0,name:"check",size:"medium"})):le("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):le("",!0),e.viewModes.length>1?(I(),G("div",{key:1,class:R.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!a(s),"md:inline-flex":a(s)}])},[(I(!0),G(Ae,null,Ye(e.viewModes,he=>je((I(),re(ae,{key:he.name,"no-hover":a(E)===he.name,class:R.normalizeClass([he.name]),appearance:a(E)===he.name?"filled":"outline","color-role":a(E)===he.name?"secondaryContainer":"secondary","aria-label":a(r)("Switch to %{viewMode}",{viewMode:he.label}),onClick:ie=>_(he)},{default:Z(()=>[J(Y,{name:he.icon.name,"fill-type":he.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[xe,a(r)("Switch to %{viewMode}",{viewMode:he.label})]])),128))],2)):le("",!0),je((I(),re(ae,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":a(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:Z(()=>[J(Y,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[xe,a(r)("Display customization options of the files list")]]),J(pe,{title:a(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:Z(()=>[J(ne,null,{default:Z(()=>[e.hasHiddenFiles?(I(),G("li",IP,[J(fe,{checked:V.value,"onUpdate:checked":[se[0]||(se[0]=he=>V.value=he),M],"data-testid":"files-switch-hidden-files",label:a(r)("Show hidden files")},null,8,["checked","label"])])):le("",!0),e.hasFileExtensions?(I(),G("li",FP,[J(fe,{checked:te.value,"onUpdate:checked":[se[1]||(se[1]=he=>te.value=he),N],"data-testid":"files-switch-files-extensions-files",label:a(r)("Show file extensions")},null,8,["checked","label"])])):le("",!0),e.hasPagination?(I(),G("li",$P,[m.value?le("",!0):(I(),re(be,{key:0,selected:a(at)(a(y)),"data-testid":"files-pagination-size",label:a(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:$},null,8,["selected","label","options"]))])):le("",!0),a(w)?(I(),G("li",OP,[J(fe,{checked:B.value,"onUpdate:checked":[se[2]||(se[2]=he=>B.value=he),q],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show disabled Spaces")},null,8,["checked","label"])])):le("",!0),a(T)?(I(),G("li",LP,[J(fe,{checked:O.value,"onUpdate:checked":[se[3]||(se[3]=he=>O.value=he),j],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show empty trash bins")},null,8,["checked","label"])])):le("",!0),a(E)===a(Ft).name.tiles?(I(),G("li",_P,[Q("label",{for:"tiles-size-slider",textContent:R.toDisplayString(a(r)("Tile size"))},null,8,MP),je(Q("input",{id:"tiles-size-slider","onUpdate:modelValue":se[4]||(se[4]=he=>ft(D)?D.value=he:null),type:"range",min:1,max:a(L),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,NP),[[Ua,a(D)]])])):le("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-17fa8a66"]]),BP=ge({name:"AppBar",components:{BatchActions:hg,ContextActions:gg,ViewOptions:vg},props:{viewModeDefault:{type:String,required:!1,default:()=>Ft.defaultModeName},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},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=He(),{$gettext:r}=me.useGettext(),{can:o}=Bt(),s=Re(),{requestExtensions:i}=ho(),{isSticky:l}=Ac(),u=_t(),{isSideBarOpen:d}=we.storeToRefs(u),c=De(),{selectedResources:p}=we.storeToRefs(c),f=A(()=>e.space),{actions:h}=ea(),{actions:g}=ra(),{actions:m}=Oi(),{actions:w}=Wm(),{actions:T}=Yi(),{actions:k}=Ts(),{actions:S}=Zi(),{actions:y}=xo(),{actions:E}=ta(),{actions:D}=ks(),{actions:$}=qm(),{actions:_}=Hm(),{actions:L}=Gm(),{actions:V}=Ym(),te=W(0),B=xn(bt,"files-common-search"),O=A(()=>Object.hasOwn(Ou(),"navigation")&&o("create-all","Share")),M=A(()=>{let fe=[...a(g),...a(h),...a(T),...a(S),...a(y),...a(E),...a(m),...a(k),...a(D)];B.value||(fe=[...fe,...a(w),...a(L),...a(V),...a($),...a(_)]);const be=i({id:"global.files.batch-actions",extensionType:"action"});return be.length&&(fe=[...fe,...be.map(xe=>xe.action)]),fe.filter(xe=>xe.isVisible({space:a(f),resources:c.selectedResources}))}),N=A(()=>n.spaces.filter(fe=>z.isPersonalSpaceResource(fe)||z.isProjectSpaceResource(fe))),q=Jn("isMobileWidth"),j=xn(qt,"files-trash-generic"),H=A(()=>!a(q)&&e.breadcrumbs.length?!0:a(j)&&a(N).length===1?!1:e.breadcrumbs.length>1),se=A(()=>a(j)&&a(N).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),Y=A(()=>a(f)&&(z.isProjectSpaceResource(a(f))||z.isShareSpaceResource(a(f)))?3:2),ae=fe=>{t(of,fe)},ne=nh("title"),pe=A(()=>a(ne)?r(a(ne)):a(f)?.name||"");return{router:s,hasSharesNavigation:O,batchActions:M,showBreadcrumb:H,showMobileNav:se,breadcrumbMaxWidth:te,breadcrumbTruncationOffset:Y,fileDroppedBreadcrumb:ae,pageTitle:pe,selectedResources:p,isSticky:l,isSideBarOpen:d}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return qc(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||qt(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(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),jP={class:"files-topbar py-2 w-full"},zP=["textContent"],UP={key:3,id:"files-app-bar-controls-right",class:"flex"},VP={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},qP={class:"flex-1 flex justify-start items-center"},HP={key:1};function WP(e,t,n,r,o,s){const i=oe("oc-hidden-announcer"),l=oe("context-actions"),u=oe("oc-breadcrumb"),d=oe("portal-target"),c=oe("view-options"),p=oe("batch-actions"),f=oe("oc-spinner");return I(),G("div",{id:"files-app-bar",ref:"filesAppBar",class:R.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[Q("div",jP,[Q("h1",{class:"sr-only",textContent:R.toDisplayString(e.pageTitle)},null,8,zP),J(i,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),Q("div",{class:R.normalizeClass(["flex items-center files-app-bar-controls min-h-13",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(I(),re(u,{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,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Z(()=>[J(l,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","mobile-breakpoint","onItemDroppedBreadcrumb"])):le("",!0),e.showMobileNav?(I(),re(d,{key:1,name:"app.runtime.mobile.nav"})):le("",!0),e.hasSharesNavigation?Ce(e.$slots,"navigation",{key:2}):le("",!0),e.hasViewOptions?(I(),G("div",UP,[J(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"])])):le("",!0)],2),Q("div",VP,[Q("div",qP,[Ce(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(I(),re(p,{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"])):e.showBatchActions&&e.batchActionsLoading?(I(),G("div",HP,[J(f,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):le("",!0)])]),Ce(e.$slots,"content")])],2)}const QP=Le(BP,[["render",WP]]),KP=ge({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:o}=me.useGettext(),{createSpace:s}=go(),{isSpaceNameValid:i}=Qr(),{dispatchModal:l}=Je(),u=He(),{upsertResource:d}=De(),c=async f=>{try{const h=await s(f);d(h),u.upsertSpace(h),t("spaceCreated",h),n({title:o("Space was created successfully")})}catch(h){console.error(h),r({title:o("Creating space failed…"),errors:[h]})}};return{showCreateSpaceModal:()=>{l({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),inputRequiredMark:!0,onConfirm:f=>c(f),onInput:(f,h)=>{const{isValid:g,error:m}=i(f);h(g?null:m)}})}}}}),GP=["textContent"];function JP(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=Lt("oc-tooltip");return je((I(),re(l,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Z(()=>[J(i,{name:"add"}),e.showLabel?(I(),G("span",{key:0,textContent:R.toDisplayString(e.$gettext("New Space"))},null,8,GP)):le("",!0)]),_:1},8,["aria-label","onClick"])),[[u,e.showLabel?void 0:e.$gettext("New space")]])}const XP=Le(KP,[["render",JP]]),YP={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},ZP={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},eI={class:"open-file-bar flex"},tI={class:"flex"},nI={key:1,class:"flex items-center","data-testid":"autosave-indicator"},yg=ge({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=me.useGettext(),r=De(),o=Ge(),{getMatchingSpace:s}=It(),{getParentFolderName:i,getPathPrefix:l,getParentFolderLinkIconAdditionalAttributes:u}=Cr(),d=A(()=>r.areFileExtensionsShown),c=A(()=>t("Show context menu")),p=A(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),f=A(()=>{const m=vt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:m.toHuman()})}),h=A(()=>s(e.resource)),g=A(()=>!z.isPublicSpaceResource(a(h)));return(m,w)=>{const T=oe("oc-icon"),k=oe("oc-button"),S=oe("oc-drop"),y=oe("portal"),E=Lt("oc-tooltip");return I(),re(y,{to:"app.runtime.header.left"},{default:Z(()=>[Q("div",YP,[Q("div",ZP,[Q("div",eI,[e.resource?(I(),re(Ss,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":d.value,"path-prefix":a(l)(e.resource),resource:e.resource,"parent-folder-name":a(i)(e.resource),"parent-folder-link-icon-additional-attributes":a(u)(e.resource),"is-path-displayed":g.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):le("",!0)]),Q("div",tI,[e.dropDownMenuSections.length?(I(),G(Ae,{key:0},[je((I(),re(k,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:Z(()=>[J(T,{name:"more-2"})]),_:1},8,["aria-label"])),[[E,c.value]]),J(S,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:w[0]||(w[0]=wt(()=>{},["stop","prevent"]))},{default:Z(()=>[J(aa,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):le("",!0),p.value&&!e.isReadOnly?(I(),G("span",nI,[je(J(T,{"accessible-label":f.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[E,f.value]])])):le("",!0),e.mainActions.length&&e.resource?(I(),re(aa,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(D=>D.isVisible()).map(D=>({...D,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):le("",!0),J(k,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":a(t)("Close"),onClick:w[1]||(w[1]=D=>m.$emit("close"))},{default:Z(()=>[J(T,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}}}),rI=ge({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),oI={class:"text-center flex justify-center items-center h-full"},sI={key:0,class:"text-xl"};function iI(e,t,n,r,o,s){const i=oe("oc-icon");return I(),G("div",oI,[J(i,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(I(),G("p",sI,R.toDisplayString(e.message),1)):le("",!0)])}const aI=Le(rI,[["render",iI]]),lI=ge({name:"LoadingScreen"}),cI={class:"text-center flex justify-center items-center h-full"},uI=["textContent"];function dI(e,t,n,r,o,s){const i=oe("oc-spinner");return I(),G("div",cI,[J(i,{size:"xlarge"}),Q("p",{class:"sr-only",textContent:R.toDisplayString(e.$gettext("Loading app"))},null,8,uI)])}const fI=Le(lI,[["render",dI]]),pI=["id","data-testid","tabindex","inert"],hI={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},mI={class:"col-start-2 text-center my-0 text-lg"},gI={key:0,class:"mt-4"},bg=Le(ge({__name:"SideBarPanels",props:{loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close","closePanel"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=A(()=>e.availablePanels.filter(S=>S.isVisible(e.panelContext)&&S.isRoot?.(e.panelContext))),s=A(()=>e.availablePanels.filter(S=>S.isVisible(e.panelContext)&&!S.isRoot?.(e.panelContext))),i=A(()=>a(o).length?[a(o)[0],...a(s)]:a(s)),l=A(()=>{const S=e.activePanel?.split("#")[0];return!S||!a(s).map(y=>y.name).includes(S)?null:S}),u=A(()=>a(l)!==null),d=A(()=>a(l)===null),c=W(null),p=S=>{c.value=S},f=A(()=>a(u)?a(l):a(o)[0].name),h=A(()=>a(o).length===1?r("Back to %{panel} panel",{panel:a(o)[0].title(e.panelContext)}):r("Back to main panels")),g=S=>{n("selectPanel",S)},m=()=>{n("selectPanel",null)},w=()=>{n("close")},T=S=>{p(a(f)),g(S)},k=()=>{p(a(f)),m(),n("closePanel")};return(S,y)=>{const E=oe("oc-spinner"),D=oe("oc-icon"),$=oe("oc-button"),_=Lt("oc-tooltip");return e.loading?(I(),re(E,{key:0,"aria-label":a(r)("Loading sidebar content")},null,8,["aria-label"])):(I(!0),G(Ae,{key:1},Ye(i.value,L=>(I(),G("div",{id:`sidebar-panel-${L.name}`,key:`panel-${L.name}`,"data-testid":`sidebar-panel-${L.name}`,tabindex:f.value===L.name?-1:null,class:R.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface w-full size-full max-w-full max-h-full motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":L.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===L.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":d.value&&L.isRoot?.(e.panelContext)}]),inert:f.value!==L.name},[[f.value,c.value].includes(L.name)?(I(),G("div",hI,[L.isRoot?.(e.panelContext)?le("",!0):je((I(),re($,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":h.value,onClick:k},{default:Z(()=>[J(D,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[_,h.value]]),Q("h2",mI,R.toDisplayString(L.title(e.panelContext)),1),J($,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":a(r)("Close file sidebar"),onClick:w},{default:Z(()=>[J(D,{name:"close"})]),_:1},8,["aria-label"])])):le("",!0),Q("div",null,[L.isRoot?.(e.panelContext)?Ce(S.$slots,"rootHeader",{key:0},void 0,!0):Ce(S.$slots,"subHeader",{key:1},void 0,!0)]),Q("div",{class:R.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${L.name}`]])},[Q("div",{class:R.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!L.isRoot?.(e.panelContext)}])},[Ce(S.$slots,"body",{},()=>[(I(!0),G(Ae,null,Ye(L.isRoot?.(e.panelContext)?o.value:[L],(V,te)=>(I(),G("div",{key:`sidebar-panel-${V.name}`},[(d.value?V.isRoot?.(e.panelContext):[f.value,c.value].includes(V.name))?(I(),re(rn(V.component),pt({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":te>0},"rounded-sm"]},{ref_for:!0},V.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):le("",!0)]))),128))],!0)],2),L.isRoot?.(e.panelContext)&&s.value.length>0?(I(),G("div",gI,[(I(!0),G(Ae,null,Ye(s.value,V=>(I(),re($,{id:`sidebar-panel-${V.name}-select`,key:`panel-select-${V.name}`,"data-testid":`sidebar-panel-${V.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:te=>T(V.name)},{default:Z(()=>[J(D,{name:V.icon,"fill-type":V.iconFillType},null,8,["name","fill-type"]),ct(" "+R.toDisplayString(V.title(e.panelContext))+" ",1),J(D,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):le("",!0)],2)],10,pI))),128))}}}),[["__scopeId","data-v-839c4e7a"]]),wg=ge({inheritAttrs:!1,__name:"SideBar",props:{loading:{type:Boolean},availablePanels:{},panelContext:{}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,r=Js(),{isMobile:o}=os(),s=_t(),{focusSidebar:i}=s,{sideBarActivePanel:l}=we.storeToRefs(s),u=A(()=>{if(a(o))return{...a(r),isFocusTrapActive:!e.loading,hasFullHeight:!0,maxHeight:"max-h-[80vh]",class:"z-100",onClicked:d};const f=["border-l","focus:outline-0","focus-visible:outline-0","w-[440px]","min-w-[440px]","overflow-hidden","relative","focus:shadow-none","focus-visible:shadow-none",...a(r)?.class?[a(r).class]:[]];return e.loading&&f.push("flex","justify-center","items-center"),{...a(r),class:f}}),d=f=>{if(!f.target)return;const h=f.target===f.currentTarget,g=f.target instanceof HTMLAnchorElement,m=f.target.closest("ul.sidebar-actions-panel");(h||g||m)&&c()},c=()=>{s.closeSideBar(),n("close")},p=f=>{s.openSideBarPanel(f),n("selectPanel",f)};return Qs(()=>{a(o)&&c()}),(f,h)=>(I(),re(Fa,{to:"#mobile-right-sidebar",disabled:!a(o)},[(I(),re(rn(a(o)?"oc-bottom-drawer":"div"),pt({id:"app-sidebar",tabindex:"-1"},u.value),{default:Z(()=>[J(bg,{loading:e.loading,"available-panels":e.availablePanels,"panel-context":e.panelContext,"active-panel":a(l),onSelectPanel:p,onClose:c,onClosePanel:a(i)},{body:Z(()=>[Ce(f.$slots,"body")]),rootHeader:Z(()=>[Ce(f.$slots,"rootHeader")]),subHeader:Z(()=>[Ce(f.$slots,"subHeader")]),_:3},8,["loading","available-panels","panel-context","active-panel","onClosePanel"])]),_:3},16))],8,["disabled"]))}}),vI={class:"grid items-center p-2"},yI={class:"flex items-center text-sm"},bI=["textContent"],wI=["textContent"],Oc=ge({__name:"SpaceInfo",setup(e){const t=Jn("resource");return(n,r)=>{const o=oe("oc-icon");return I(),G("div",vI,[Q("div",yI,[J(o,{name:"layout-grid",size:a(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),Q("div",null,[Q("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:R.toDisplayString(a(t).name)},null,8,bI),Q("span",{"data-testid":"space-info-subtitle",textContent:R.toDisplayString(a(t).description)},null,8,wI)])])])}}}),SI={class:"flex justify-between p-2"},TI={class:"flex items-center"},kI={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},Lc=ge({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=De(),{isPersonalSpaceRoot:n}=It(),r=Jn("resource"),o=Jn("space"),s=A(()=>t.areFileExtensionsShown),i=A(()=>n(a(r))?a(o).name:a(r).name);return(l,u)=>(I(),G("div",SI,[Q("div",TI,[e.isSubPanelActive?(I(),re(ws,{key:0,resource:a(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):le("",!0),Q("div",null,[Q("h3",kI,[J(bc,{name:i.value,extension:a(r).extension,type:a(r).type,"full-path":a(r).webDavPath,"is-extension-displayed":s.value,"is-path-displayed":!1,"truncate-name":!1,class:"[&_span]:break-all"},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),Sg=ge({__name:"FileSideBar",props:{space:{default:()=>{}}},setup(e){const t=Re(),n=Pe(),r=ho(),o=He(),s=tr(),i=Ge(),l=Mn(),{canListShares:u}=Bm(),{canListVersions:d}=og(),c=De(),{currentFolder:p}=we.storeToRefs(c),f=_t(),{isSideBarOpen:h,sideBarActivePanel:g}=we.storeToRefs(f),m=W(),w=W([]),T=W([]),k=W([]),{selectedResources:S}=Ic(),y=W(!1),E=A(()=>a(y)),D=A(()=>a(S).length===0?{root:e.space,parent:null,items:a(p)?.id?[a(p)]:[]}:{root:e.space,parent:a(p),items:a(S)}),$=xn(mt,"files-shares-with-me"),_=xn(mt,"files-shares-with-others"),L=xn(mt,"files-shares-via-link"),V=st(t,"files-spaces-projects"),te=xn(bt,"files-common-favorites"),B=xn(bt,"files-common-search"),O=A(()=>a(D).items?.length===1&&!z.isProjectSpaceResource(a(D).items[0])),M=A(()=>a(D).items?.length===1&&z.isProjectSpaceResource(a(D).items[0])),N=A(()=>a($)||a(_)||a(L)),q=A(()=>a(N)||a(B)||a(te)),j=A(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ne=>ne.panel)),H=$t.useTask(function*(ne,pe){w.value=yield n.webdav.listFileVersions(pe.id,{signal:ne})}),se=$t.useTask(function*(ne,pe){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:fe,linkShares:be}=s,xe=n.graphAuthenticated.permissions;let he=e.space?.id;if(z.isShareSpaceResource(e.space)){const ve=yield o.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ne});ve&&(he=ve.root.remoteItem.rootId)}const{shares:ie,allowedRoles:de}=yield*z.call(xe.listPermissions(he,pe.fileId,s.graphRoles,{},{signal:ne})),ue=ie.filter(z.isCollaboratorShare),Se=ie.filter(z.isLinkShare),$e=Object.values(s.graphRoles);if(T.value=de?.map(ve=>({...ve,icon:$e.find(ke=>ke.id===ve.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:ve}=yield*z.call(xe.listPermissions(he,pe.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Xp.LibreGraphPermissionsRolesAllowedValues]},{signal:ne}));k.value=ve?.map(ke=>({...ke,icon:$e.find(qe=>qe.id===ke.id)?.icon}))||[]}!a(q)&&!a(V)&&(fe.forEach(ve=>{ue.some(ke=>ke.id===ve.id)||ue.push({...ve,indirect:!0})}),be.forEach(ve=>{Se.some(ke=>ke.id===ve.id)||Se.push({...ve,indirect:!0})})),bt(t,"files-common-search")&&(yield c.loadAncestorMetaData({folder:a(pe),space:e.space,client:n.webdav,signal:ne}));const lt=[...fe,...be].map(({resourceId:ve})=>ve),Tt=Object.values(c.ancestorMetaData).filter(({id:ve,path:ke})=>ve===pe.id||lt.includes(ve)||z.isIncomingShareResource(pe)?!1:z.isPersonalSpaceResource(e.space)?ke!=="/":!0).map(({id:ve})=>ve);a(q)&&z.isProjectSpaceResource(e.space)&&!z.isProjectSpaceResource(pe)&&Tt.push(e.space.id);const ut=new ur({concurrency:i.options.concurrentRequests.shares.list}),gt=[...new Set(Tt)].map(ve=>ut.add(()=>n.graphAuthenticated.permissions.listPermissions(he,ve,s.graphRoles,{},{signal:ne}).then(ke=>{const qe=ke.shares.map(We=>({...We,indirect:!0}));ue.push(...qe.filter(z.isCollaboratorShare)),Se.push(...qe.filter(z.isLinkShare))})));yield Promise.allSettled(gt),s.setCollaboratorShares(ue),s.setLinkShares(Se),s.setLoading(!1)}).restartable(),Y=W();Ue(()=>[...a(D).items,h],async(ne,pe)=>{if(a(D).items?.length!==1)return;if(!a(h)){Y.value=void 0,w.value=[];return}const fe=ne?.[0],be=pe?.[0];if(fe?.id===be?.id&&fe?.mdate===a(Y))return;const xe=a(D).items[0];if(Y.value=xe.mdate,H.isRunning&&H.cancelAll(),!!d({space:e.space,resource:xe}))try{await H.perform(xe)}catch(he){console.error(he)}},{immediate:!0,deep:!0});const ae=A(()=>a(D).items.map(ne=>ne.id));return Ue(()=>[ae,h],async()=>{if(!a(h)||!a(D).items?.length){s.pruneShares(),m.value=null;return}if(a(D).items?.length!==1)return;const ne=a(D).items[0];if(y.value=!0,z.isProjectSpaceResource(ne)&&await o.loadGraphPermissions({ids:[ne.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:ne}))try{se.isRunning&&se.cancelAll(),se.perform(ne)}catch(pe){console.error(pe)}if(!z.isOutgoingShareResource(ne)&&!z.isIncomingShareResource(ne)){m.value=ne,y.value=!1;return}try{const pe=await n.webdav.getFileInfo(e.space,{path:ne.path}),fe={...pe,...ne,tags:pe.tags};m.value=fe}catch(pe){m.value=ne,console.error(pe)}y.value=!1},{deep:!0,immediate:!0}),Dr("resource",pr(m)),Dr("versions",pr(w)),Dr("space",A(()=>e.space)),Dr("availableInternalShareRoles",pr(T)),Dr("availableExternalShareRoles",pr(k)),Dr("versionsLoading",A(()=>H.isRunning)),Dr("activePanel",g),(ne,pe)=>a(h)?(I(),re(wg,pt({key:0,ref:"sidebar",class:"files-side-bar z-30","available-panels":j.value,"panel-context":D.value,loading:E.value},ne.$attrs,{"data-custom-key-bindings-disabled":"true"}),{rootHeader:Z(()=>[O.value?(I(),re(Lc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):M.value?(I(),re(Oc,{key:1})):le("",!0)]),subHeader:Z(()=>[O.value?(I(),re(Lc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):M.value?(I(),re(Oc,{key:1})):le("",!0)]),_:1},16,["available-panels","panel-context","loading"])):le("",!0)}}),CI=ge({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=Bn(),{currentTheme:t}=we.storeToRefs(e),n=W(),r=W(!0);return{confirmDisabled:r,onDateChanged:({date:s,error:i})=>{r.value=i||!s,n.value=s},currentTheme:t,dateTime:n}}}),xI={class:"flex justify-end items-center mt-2"};function AI(e,t,n,r,o,s){const i=oe("oc-datepicker"),l=oe("oc-button");return I(),G(Ae,null,[J(i,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),Q("div",xI,[J(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=u=>e.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),J(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=u=>e.$emit("confirm",e.dateTime))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const EI=Le(CI,[["render",AI]]),RI=ge({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=Je();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),DI=["textContent"],PI={class:"flex justify-end items-center mt-4"},II={class:"oc-modal-body-actions-grid"};function FI(e,t,n,r,o,s){const i=oe("oc-button");return I(),G(Ae,null,[Q("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,DI),t[2]||(t[2]=Q("div",{class:"my-4"},null,-1)),Q("div",PI,[Q("div",II,[J(i,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),J(i,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),J(i,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const Tg=Le(RI,[["render",FI]]);var $I=/\s/;function OI(e){for(var t=e.length;t--&&$I.test(e.charAt(t)););return t}var LI=/^\s+/;function _I(e){return e&&e.slice(0,OI(e)+1).replace(LI,"")}var kg=NaN,MI=/^[-+]0x[0-9a-f]+$/i,NI=/^0b[01]+$/i,BI=/^0o[0-7]+$/i,jI=parseInt;function zI(e){if(typeof e=="number")return e;if(bi(e))return kg;if($n(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$n(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_I(e);var n=NI.test(e);return n||BI.test(e)?jI(e.slice(2),n?2:8):MI.test(e)?kg:+e}const UI=["id"],VI=["textContent"],qI={key:3,class:"flex size-full"},Cg=ge({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=me.useGettext(),r=Mn(),{showMessage:o,showErrorMessage:s}=Me(),i=Ds.useRouter(),l=St(),u=Pe(),d=Ut(),{getResourceContext:c}=sg(),{selectedResources:p}=Ic(),{dispatchModal:f}=Je(),h=He(),g=Ge(),m=De(),w=tr(),T=rr(),{isMobile:k}=os(),S=_t(),{isSideBarOpen:y}=we.storeToRefs(S),{actions:E}=$m({appId:e.applicationId}),{actions:D}=Kl(),{actions:$}=xo(),{actions:_}=Cc(),{actions:L}=xc(),{actions:V}=Ts(),te=A(()=>!!e.wrappedComponent.emits?.includes("update:resource")),B=W(),O=W(),M=W(""),N=W(""),q=W(!a(te)),j=W(),H=W(!1),se=W(),Y=W();let ae="",ne=null;const{actions:pe}=_m({content:Y}),fe=A(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),be=Te=>!!Object.keys(e.wrappedComponent.props).includes(Te),xe=A(()=>a(Y)!==a(se)),he=Te=>{Te.preventDefault()};Ue(xe,Te=>{Te?window.addEventListener("beforeunload",he):window.removeEventListener("beforeunload",he)});const{applicationConfig:ie,closeApp:de,currentFileContext:ue,getFileContents:Se,getFileInfo:$e,getUrlForResource:Ve,putFileContents:lt,replaceInvalidFileRoute:Tt,revokeUrl:ut,activeFiles:gt,loadFolderForFileContext:ve,isFolderLoading:ke}=dh({applicationId:e.applicationId}),{applicationMeta:qe}=Wl({applicationId:e.applicationId,appsStore:r}),We=A(()=>a(qe).meta?.fileSizeLimit),Jt=A(()=>{const{name:Te}=a(qe);return t("%{appName} for %{fileName}",{appName:t(Te),fileName:a(a(ue).fileName)})}),Xt=Di("driveAliasAndItem"),kt=Pt("fileId"),dt=A(()=>at(a(kt))),mn=async()=>{const Te=a(dt),{space:Oe,path:tt}=await c(Te),Vt=Oe.getDriveAliasAndItem({path:tt});return z.isPersonalSpaceResource(Oe)?i.push({params:{...a(l).params,driveAliasAndItem:Vt},query:{...a(l).query,fileId:Te,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:Ke.dirname(Vt)}}}):i.push({params:{...a(l).params,driveAliasAndItem:Vt},query:{...a(l).query,fileId:Te,contextRouteName:tt==="/"?"files-shares-with-me":"files-spaces-generic",...z.isShareSpaceResource(Oe)&&{shareId:Oe.id},contextRouteParams:{driveAliasAndItem:Ke.dirname(Vt)},contextRouteQuery:{...z.isShareSpaceResource(Oe)&&{shareId:Oe.id}}}})},qn=$t.useTask(function*(Te){try{a(Xt)||(yield mn()),O.value=a(a(ue).space);const Oe=yield $e(a(ue),{signal:Te});if(B.value=Oe,z.isShareSpaceResource(a(O))&&(a(B).remoteItemId=a(O).id,a(B).id===a(B).remoteItemId)){const tt=yield*z.call(pi({graphClient:u.graphAuthenticated,spacesStore:h,space:a(O)}));tt&&(B.value={...Oe,...z.buildIncomingShareResource({graphRoles:w.graphRoles,driveItem:tt,serverUrl:g.serverUrl}),tags:Oe.tags})}m.initResourceList({currentFolder:null,resources:[a(B)]}),p.value=[a(B)]}catch(Oe){console.error(Oe),j.value=Oe,q.value=!1}}).restartable(),At=$t.useTask(function*(Te){try{const Oe=e.importResourceWithExtension(a(B));if(Oe){const tt=vt.DateTime.local().toFormat("yyyyMMddHHmmss"),Vt=`${a(B).name}_${tt}.${Oe}`;if(!(yield u.webdav.copyFiles(a(O),a(B),a(O),{path:Vt},{signal:Te})))throw new Error(t("Importing failed"));B.value={path:Vt}}if(Tt(ue,a(B)))return;if(H.value=![pf.Updateable,pf.FileUpdateable].some(tt=>(a(B).permissions||"").indexOf(tt)>-1),a(be("currentContent"))){const tt=yield*z.call(Se(ue,{...e.fileContentOptions,signal:Te}));se.value=Y.value=tt.body,M.value=tt.headers["OC-ETag"]}a(be("url"))&&(N.value=yield Ve(a(O),a(B),{...e.urlForResourceOptions,signal:Te}))}catch(Oe){console.error(Oe),j.value=Oe}finally{q.value=!1}}).restartable();Ue(ue,async()=>{a(te)?O.value=a(a(ue).space):(await qn.perform(),a(We)&&zI(a(B).size)>a(We)?f({title:t("File exceeds %{threshold}",{threshold:Ht(a(We),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:a(B).name,threshold:Ht(a(We),n)}),confirmText:t("Continue"),onCancel:()=>{de()},onConfirm:()=>{At.perform()}}):At.perform())},{immediate:!0});const En=Te=>{console.error(Te),s({title:t("An error occurred"),desc:Te.message,errors:[Te]})},C=()=>{o({title:t("File autosaved")})},v=$t.useTask(function*(){const Te=a(Y);try{const Oe=yield lt(ue,{content:Te,previousEntityTag:a(M)});se.value=Te,M.value=Oe.etag,m.upsertResource(Oe)}catch(Oe){switch(Oe.statusCode){case 401:case 403:En(new z.HttpError(t("You're not authorized to save this file"),Oe.response));break;case 409:case 412:En(new z.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),Oe.response));break;case 507:const tt=h.spaces.find(Vt=>Vt.id===a(B).storageId&&z.isProjectSpaceResource(Vt));if(tt){En(new z.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:tt.name}),Oe.response));break}En(new z.HttpError(t("Insufficient quota for saving this file"),Oe.response));break;default:En(new z.HttpError("",Oe.response))}}}).drop(),b=async()=>{await v.perform()};let F=null;yt(()=>{if(ae=T.subscribe("runtime.resource.deleted",ye),m.ancestorMetaData?.["/"]&&a(O)&&m.ancestorMetaData["/"].spaceId!==a(O).id&&m.setAncestorMetaData({}),!a(fe))return;const Te=g.options.editor;Te.autosaveEnabled&&!e.disableAutoSave&&(F=setInterval(async()=>{xe.value&&(await b(),C())},(Te.autosaveInterval||120)*1e3))}),bn(()=>{T.unsubscribe("runtime.resource.deleted",ae),d.isLoading||window.removeEventListener("beforeunload",he),a(be("url"))&&ut(N.value),a(fe)&&(clearInterval(F),F=null)});const{bindKeyAction:P}=_i({skipDisabledKeyBindingsCheck:!0});P({modifier:Li.Ctrl,primary:jn.S},()=>{a(xe)&&b()});const U=A(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>a(fe)&&!a(H),isDisabled:()=>!a(xe),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:b}]),X=A(()=>({space:a(O),resources:[a(B)]})),ee=async(Te,Oe)=>{a(xe)&&(await b(),C()),Oe(Te)},ye=Te=>{if(Te.find(tt=>tt.id===a(B).id)){if(ne)return ne();de()}},Ie=A(()=>[...a(E),...a(U),...a(pe).map(Te=>({...Te,isVisible:Oe=>fe.value&&Te.isVisible(Oe)}))].filter(Te=>Te.isVisible(a(X)))),Fe=A(()=>[...a(L),...a(D)].filter(Te=>Te.isVisible(a(X)))),Ne=A(()=>[...a($).map(Te=>({...Te,handler:Oe=>ee(Oe,Te.handler)})),...a(V)].filter(Te=>Te.isVisible(a(X)))),xs=A(()=>[...a(_)].filter(Te=>Te.isVisible(a(X)))),cr=A(()=>{const Te=[];return a(Ie).length&&Te.push({name:"context",items:a(Ie)}),a(Fe).length&&Te.push({name:"share",items:a(Fe)}),a(Ne).length&&Te.push({name:"actions",items:a(Ne)}),a(xs).length&&Te.push({name:"sidebar",items:a(xs)}),Te}),As=A(()=>[...a(U)]);Ds.onBeforeRouteLeave((Te,Oe,tt)=>{a(xe)?f({title:t("Unsaved changes"),customComponent:Tg,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{tt()}}),async onConfirm(){await b(),tt()}}):tt()});const Eo=A(()=>({url:a(N),space:a(a(ue).space),resource:a(B),activeFiles:a(gt),isDirty:a(xe),isReadOnly:a(H),applicationConfig:a(ie),currentFileContext:a(ue),currentContent:a(Y),isFolderLoading:a(ke),"onUpdate:resource":Te=>{O.value=a(a(ue).space),B.value={...Te,...z.isShareSpaceResource(a(O))&&{remoteItemId:a(O).id}},p.value=[a(B)]},"onUpdate:currentContent":Te=>{Y.value=Te},"onRegister:onDeleteResourceCallback":Te=>{ne=Te},"onDelete:resource":()=>{a(V)[0].isVisible({space:a(O),resources:[a(B)]})&&a(V)[0].handler({space:a(O),resources:[a(B)]})},onSave:b,onClose:de,loadFolderForFileContext:ve,revokeUrl:ut,getUrlForResource:Ve}));return(Te,Oe)=>(I(),G("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:Oe[0]||(Oe[0]=zo((...tt)=>a(de)&&a(de)(...tt),["esc"]))},[Q("h1",{class:"sr-only",textContent:R.toDisplayString(Jt.value)},null,8,VI),!q.value&&!j.value&&B.value?(I(),re(yg,{key:0,"main-actions":As.value,"drop-down-menu-sections":cr.value,"drop-down-action-options":X.value,"has-auto-save":!e.disableAutoSave,"is-editor":fe.value,resource:B.value,"is-read-only":H.value,onClose:a(de)},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","is-read-only","onClose"])):le("",!0),q.value?(I(),re(fI,{key:1})):j.value?(I(),re(aI,{key:2,message:j.value.message},null,8,["message"])):(I(),G("div",qI,[Ce(Te.$slots,"default",pt({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)]":a(y)&&!a(k)}]},Eo.value)),J(Sg,{space:O.value},null,8,["space"])]))],40,UI))}});function HI(e,t){return ge({render(){return za(Cg,{wrappedComponent:e,...t},{default:n=>za(e,n)})}})}const _c=ge({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e){const{$gettext:t}=me.useGettext(),n=A(()=>t("Show context menu"));return(r,o)=>{const s=oe("oc-icon"),i=oe("oc-drop"),l=oe("oc-button"),u=Lt("oc-tooltip");return je((I(),re(l,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":n.value,appearance:"raw",class:"quick-action-button ml-1 p-1",onClick:o[0]||(o[0]=wt(d=>r.$emit("quickActionClicked",{event:d,dropdown:r.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Z(()=>[J(s,{name:"more-2"}),J(i,{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)}`,title:e.title,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":""},{default:Z(()=>[Ce(r.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[u,n.value]])}}}),WI=ge({name:"ResourceGhostElement",components:{ResourceIcon:ws},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}}}),QI={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},KI={class:"relative rounded-sm bg-role-surface-container-high"},GI={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},JI={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},XI={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function YI(e,t,n,r,o,s){const i=oe("resource-icon");return I(),G("div",QI,[Q("div",KI,[J(i,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(I(),G("div",GI)):le("",!0),e.showThirdLayer?(I(),G("div",JI)):le("",!0)]),Q("span",XI,R.toDisplayString(e.itemCount),1)])}const Mc=Le(WI,[["render",YI]]),ZI=ge({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=me.useGettext();return{formattedSize:A(()=>Ht(e.size,t))}}}),eF=["textContent"];function tF(e,t,n,r,o,s){return I(),G("span",{textContent:R.toDisplayString(e.formattedSize)},null,8,eF)}const xg=Le(ZI,[["render",tF]]),Ag=ge({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=Js(),{getIndicators:n}=Dc(),r=A(()=>{const o=n({space:e.space,resource:e.resource});return e.filter?o.filter(e.filter):o});return(o,s)=>r.value.length>0?(I(),re(a(HE),pt({key:0},a(t),{indicators:r.value,resource:e.resource}),null,16,["indicators","resource"])):le("",!0)}}),la=ge({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=fi(),{avatarMap:n}=we.storeToRefs(t),{enqueueAvatar:r}=pg(),o=A(()=>a(n)[e.userId]);return yt(()=>{r(e.userId)}),(s,i)=>{const l=oe("oc-avatar");return I(),re(l,{"user-name":e.userName,src:o.value,width:36},null,8,["user-name","src"])}}}),nF={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},rF={class:"flex flex-col items-center"},oF={class:"oc-button-group"},sF={key:0},iF=["src"],aF={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},lF=["textContent"],cF=ge({__name:"AvatarUpload",setup(e){const t=et(),n=fi(),{avatarMap:r}=we.storeToRefs(n),{user:o}=we.storeToRefs(t),{$gettext:s}=me.useGettext(),{showErrorMessage:i,showMessage:l}=Me(),{graphAuthenticated:u}=Pe(),{setCropperInstance:d}=Ql(),c=W(null),p=W(null),f=W(null),h=W(!1),g=W(!1),m=W(!1),w=W(null),T=vc*1024*1024,k=A(()=>!!a(r)[a(o).id]),S=te=>{const O=te.target.files?.[0];if(O){if(O.size>T){i({title:s("File size exceeds the limit of %{size}MB",{size:vc.toString()})});return}c.value=URL.createObjectURL(O),g.value=!0}};Ue(c,async te=>{te&&(await xt(),f.value&&f.value.destroy(),p.value&&(f.value=new ca(p.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){h.value=!0}}),d(f)))});const y=()=>f.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),E=async te=>await new Promise(B=>{te.toBlob(O=>B(O),"image/png")}),D=()=>{w.value?.click()},$=()=>{g.value=!1,V()},_=async()=>{const te=y(),B=await E(te),O=URL.createObjectURL(B),M=new File([B],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await u.photos.updateOwnUserPhotoPatch(M),n.addAvatar(a(o).id,O),l({title:s("Profile picture was set successfully")})}catch(N){i({title:s("Failed to set profile picture"),errors:[N]})}g.value=!1,V()},L=async()=>{try{await u.photos.deleteOwnUserPhoto(),n.removeAvatar(a(o).id),l({title:s("Profile picture was removed successfully")})}catch(te){i({title:s("Failed to remove profile picture"),errors:[te]})}m.value=!1},V=()=>{f.value?.destroy(),f.value=null,w.value&&(w.value.value=""),c.value=null};return(te,B)=>{const O=oe("oc-button"),M=oe("oc-icon"),N=oe("oc-modal");return I(),G("div",nF,[Q("input",{ref_key:"fileInputRef",ref:w,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:S},null,544),Q("div",rF,[J(la,{class:"mb-4",width:128,"user-id":a(o).id,"user-name":a(o).displayName},null,8,["user-id","user-name"]),Q("div",null,[Q("div",oF,[J(O,{size:"small",onClick:D},{default:Z(()=>[ct(R.toDisplayString(a(s)("Upload")),1)]),_:1}),k.value?(I(),re(O,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:B[0]||(B[0]=q=>m.value=!0)},{default:Z(()=>[ct(R.toDisplayString(a(s)("Remove")),1)]),_:1})):le("",!0)])])]),g.value?(I(),re(N,{key:0,title:a(s)("Crop your new profile picture"),"button-cancel-text":a(s)("Cancel"),"button-confirm-text":a(s)("Set"),"button-confirm-disabled":!h.value,"focus-trap-initial":!1,onCancel:$,onConfirm:_},{content:Z(()=>[c.value?(I(),G("div",sF,[Q("img",{ref_key:"imageRef",ref:p,class:"max-h-[400px]",src:c.value},null,8,iF),Q("div",aF,[J(M,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),Q("span",{textContent:R.toDisplayString(a(s)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(s)("+-"),panKeys:a(s)("↑↓←→")}))},null,8,lF)])])):le("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):le("",!0),m.value?(I(),re(N,{key:1,message:a(s)("Are you sure you want to remove your profile picture?"),title:a(s)("Remove profile picture"),"button-cancel-text":a(s)("Cancel"),"button-confirm-text":a(s)("Remove"),onCancel:B[1]||(B[1]=q=>m.value=!1),onConfirm:L},null,8,["message","title","button-cancel-text","button-confirm-text"])):le("",!0)])}}}),uF={class:"resource-table-select-all flex justify-center items-center"},dF={class:"truncate"},fF=["textContent"],pF=["textContent"],hF=["textContent"],mF={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},gF=850,vF=ge({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>Ft.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=Re(),o=Dt(),{getMatchingSpace:s}=It(),{interceptModifierClick:i}=zr(),{getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:u,getParentFolderName:d,getPathPrefix:c}=Cr({space:W(e.space)}),{isSticky:p}=Ac(),{$gettext:f,$ngettext:h,current:g}=me.useGettext(),{isLocationPicker:m,isFilePicker:w}=Tr(),{selectedResources:T,disabledResources:k,isResourceSelected:S,fileContainerClicked:y,fileNameClicked:E,fileCheckboxClicked:D,isResourceDisabled:$,isResourceInDeleteQueue:_,isResourceClickable:L,isResourceCut:V,getResourceLink:te,dragItem:B,dragSelection:O,dragStart:M,fileDropped:N,setDropStyling:q,shouldShowContextDrop:j,showContextMenuOnRightClick:H,showContextMenuOnBtnClick:se,selectAllCheckboxLabel:Y,getResourceCheckboxLabel:ae,toggleSelectionAll:ne,areAllResourcesSelected:pe}=Pc({space:A(()=>e.space),resources:A(()=>e.resources),selectedIds:A(()=>e.selectedIds),emit:n}),fe=_t(),{isSideBarOpen:be}=we.storeToRefs(fe),xe=Lr(),{userContextReady:he}=we.storeToRefs(xe),ie=De(),{areFileExtensionsShown:de,latestSelectedId:ue}=we.storeToRefs(ie),{width:Se}=Rn.useWindowSize(),$e=A(()=>o.filesTags&&Se.value>=gF),{actions:Ve}=na(),{actions:lt}=Xm(),Tt=A(()=>a(Ve)[0].handler),ut=A(()=>a(lt)[0].handler),gt=C=>f("Search for tag %{tag}",{tag:C}),ve=A(()=>{if(e.resources.length===0)return[];const C=e.resources[0],v=[];e.isSelectable&&v.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const b=af(C);return v.push(...[{name:"name",title:f("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:f("Manager"),type:"slot"},{name:"members",title:f("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:f("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:f("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:f("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:f("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:f("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:f("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:f("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:f("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:f("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:f("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.mdate)+" ("+kt(F.mdate)+")"},{name:"sdate",title:f("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.sdate)+" ("+kt(F.sdate)+")"},{name:"ddate",title:f("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.ddate)+" ("+kt(F.ddate)+")"}].filter(F=>{if(F.name==="tags"&&!a($e))return!1;if(F.name==="indicators")return!0;let P;return F.prop?P=El(C,F.prop)!==void 0:P=Object.prototype.hasOwnProperty.call(C,F.name),e.fieldsDisplayed?P&&e.fieldsDisplayed.includes(F.name):P}).map(F=>{const P=b.find(U=>U.name===F.name);return P&&Object.assign(F,{sortable:P.sortable,sortDir:P.sortDir}),F})),e.hasActions&&v.push({name:"actions",title:f("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),v}),ke=C=>{const v=a(r.currentRoute).query?.term;return lo("files-common-search",{query:{provider:"files.sdk",q_tags:C,...v&&{term:v}}})},qe=C=>a(he)?{to:ke(C)}:{},We=C=>C.id===a(ue),Jt=C=>e.showRenameQuickAction?z.isProjectSpaceResource(C)?a(lt).filter(v=>v.isVisible({resources:[C]})).length:a(Ve).filter(v=>v.isVisible({space:e.space,resources:[C]})).length:!1,Xt=C=>{if(z.isProjectSpaceResource(C))return a(ut)({resources:[C]});a(Tt)({space:s(C),resources:[C]})},kt=C=>mp(new Date(C),g),dt=C=>vp(new Date(C),g),mn=C=>{if(!z.isShareResource(C))return;const v=C.type==="folder"?f("folder"):f("file"),b=C.sharedWith.filter(({shareType:F})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(F))).length;return b?h("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",b,{resourceType:v,shareCount:b.toString()}):""},qn=C=>{if(!z.isShareResource(C))return"";const v=C.type==="folder"?f("folder"):f("file");return f("This %{ resourceType } is shared by %{ user }",{resourceType:v,user:C.sharedBy.map(({displayName:b})=>b).join(", ")})},At=C=>z.isShareResource(C)?C.sharedBy.map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.user.key,username:v.id,userId:v.id})):[],En=C=>z.isShareResource(C)?C.sharedWith.filter(({shareType:v})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(v))).map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.getByValue(v.shareType).key,username:v.id,userId:v.id})):[];return(C,v)=>{const b=oe("oc-checkbox"),F=oe("oc-icon"),P=oe("oc-tag"),U=oe("oc-avatars"),X=Lt("oc-tooltip");return I(),G(Ae,null,[J(a(oR),pt(C.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===a(Ft).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&a(be),"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&a(be)}],data:e.resources,fields:ve.value,highlighted:e.selectedIds,disabled:a(k),sticky:a(p),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:a(T),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:v[1]||(v[1]=ee=>a(y)({resource:ee[0],event:ee[1]})),onContextmenuClicked:v[2]||(v[2]=(ee,ye,Ie)=>a(H)(ye,Ie)),onItemDropped:v[3]||(v[3]=ee=>a(N)(ee[0],ee[1])),onItemDragged:v[4]||(v[4]=ee=>a(M)(ee[0],ee[1])),onDropRowStyling:a(q),onSort:v[5]||(v[5]=ee=>C.$emit("sort",ee)),"onUpdate:modelValue":v[6]||(v[6]=ee=>C.$emit("update:modelValue",ee))}),Fu({name:Z(({item:ee})=>[Q("div",{class:R.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":Jt(ee)}]])},[Ce(C.$slots,"image",{resource:ee}),(I(),re(Ss,{key:`${ee.path}-${e.resourceDomSelector(ee)}-${ee.thumbnail}`,resource:ee,"path-prefix":a(c)(ee),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":a(d)(ee),"is-icon-displayed":!C.$slots.image,"is-extension-displayed":a(de),"is-resource-clickable":a(L)(ee,e.areResourcesClickable),link:a(te)(ee),"parent-folder-link":a(l)(ee),"parent-folder-link-icon-additional-attributes":a(u)(ee),class:R.normalizeClass({"opacity-60":a(V)(ee)}),onClick:wt(ye=>a(E)({resource:ee,event:ye}),["stop"])},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"])),Jt(ee)?(I(),re(a(Qt),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":a(f)("Rename file »%{name}«",{name:ee.name}),title:a(f)("Rename"),onClick:wt(ye=>{a(i)(ye,ee)||Xt(ee)},["stop"])},{default:Z(()=>[J(F,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):le("",!0)],2),Ce(C.$slots,"additionalResourceContent",{resource:ee})]),syncEnabled:Z(({item:ee})=>[Ce(C.$slots,"syncEnabled",{resource:ee})]),size:Z(({item:ee})=>[J(xg,{size:ee.size||Number.NaN},null,8,["size"])]),tags:Z(({item:ee})=>[(I(!0),G(Ae,null,Ye(ee.tags.slice(0,2),ye=>(I(),re(rn(a(he)?"router-link":"span"),pt({key:ye},{ref_for:!0},qe(ye),{class:"resource-table-tag-wrapper"}),{default:Z(()=>[je((I(),re(P,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:Z(()=>[J(F,{name:"price-tag-3",size:"small"}),Q("span",dF,R.toDisplayString(ye),1)]),_:2},1024)),[[X,gt(ye)]])]),_:2},1040))),128)),ee.tags.length>2?(I(),re(P,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:v[0]||(v[0]=ye=>a(fe).openSideBar())},{default:Z(()=>[ct(" + "+R.toDisplayString(ee.tags.length-2),1)]),_:2},1024)):le("",!0)]),manager:Z(({item:ee})=>[Ce(C.$slots,"manager",{resource:ee})]),members:Z(({item:ee})=>[Ce(C.$slots,"members",{resource:ee})]),totalQuota:Z(({item:ee})=>[Ce(C.$slots,"totalQuota",{resource:ee})]),usedQuota:Z(({item:ee})=>[Ce(C.$slots,"usedQuota",{resource:ee})]),remainingQuota:Z(({item:ee})=>[Ce(C.$slots,"remainingQuota",{resource:ee})]),mdate:Z(({item:ee})=>[je(Q("span",{tabindex:"0",textContent:R.toDisplayString(dt(ee.mdate))},null,8,fF),[[X,kt(ee.mdate)]])]),indicators:Z(({item:ee})=>[J(Ag,{space:e.space,resource:ee,"disable-handler":a($)(ee)},null,8,["space","resource","disable-handler"])]),sdate:Z(({item:ee})=>[je(Q("span",{tabindex:"0",textContent:R.toDisplayString(dt(ee.sdate))},null,8,pF),[[X,kt(ee.sdate)]])]),ddate:Z(({item:ee})=>[je(Q("p",{tabindex:"0",class:"m-0",textContent:R.toDisplayString(dt(ee.ddate))},null,8,hF),[[X,kt(ee.ddate)]])]),sharedBy:Z(({item:ee})=>[J(U,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:At(ee),"accessible-description":qn(ee),"hover-effect":""},{userAvatars:Z(({avatars:ye,width:Ie})=>[(I(!0),G(Ae,null,Ye(ye,Fe=>(I(),re(a(la),{key:Fe.userId,"user-id":Fe.userId,"user-name":Fe.displayName,width:Ie},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:Z(({item:ee})=>[J(U,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:En(ee),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":mn(ee),"hover-effect":""},{userAvatars:Z(({avatars:ye,width:Ie})=>[(I(!0),G(Ae,null,Ye(ye,Fe=>(I(),re(a(la),{key:Fe.userId,"user-id":Fe.userId,"user-name":Fe.displayName,width:Ie},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:Z(({item:ee})=>[a(j)(ee)?(I(),G("div",mF,[Ce(C.$slots,"quickActions",{resource:ee}),J(_c,{title:ee.name,item:ee,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:ye=>a(se)(ye,ee)},{contextMenu:Z(()=>[Ce(C.$slots,"contextMenu",{resource:ee})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):le("",!0)]),_:2},[!a(m)&&!a(w)?{name:"selectHeader",fn:Z(()=>[Q("div",uF,[je(J(b,{id:"resource-table-select-all",size:"large",label:a(Y),disabled:e.resources.length===a(k).length,"label-hidden":!0,"model-value":a(pe),onClick:wt(a(ne),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[X,{content:a(Y),placement:"bottom"}]])])]),key:"0"}:void 0,!a(m)&&!a(w)?{name:"select",fn:Z(({item:ee})=>[a(_)(ee.id)?(I(),re(a(UE),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":a(f)("File is being processed")},null,8,["aria-label"])):(I(),re(b,{key:1,id:`resource-table-select-${e.resourceDomSelector(ee)}`,label:a(ae)(ee),"label-hidden":!0,size:"large",disabled:a($)(ee),"model-value":a(S)(ee),outline:We(ee),"data-test-selection-resource-name":ee.name,"data-test-selection-resource-path":ee.path,onClick:wt(ye=>a(D)({resource:ee,event:ye}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,C.$slots.footer?{name:"footer",fn:Z(()=>[Ce(C.$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","onDropRowStyling"]),a(B)?(I(),re(Fa,{key:0,to:"body"},[J(Mc,{ref:"ghostElement","preview-items":[a(B),...a(O)]},null,8,["preview-items"])])):le("",!0)],64)}}}),yF={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},bF={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},wF={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},SF=["textContent"],TF=["aria-label"],kF={class:"flex justify-between items-center"},CF={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},xF={class:"flex items-center"},AF={key:0,class:"text-left my-0 truncate"},EF=["textContent"],Eg=ge({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),{getParentFolderName:o,getParentFolderLink:s}=Cr({space:W(e.space)}),i=nn("observerTarget"),l=A(()=>a(i)?.$el),u=A(()=>e.resource.locked||e.resource.processing),d=A(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=A(()=>e.resource.locked?r("This item is locked"):null),p=A(()=>z.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:f}=e.lazy?Zp({target:l,onVisibleCallback:()=>n("itemVisible")}):{isVisible:W(!0)},h=A(()=>!a(f));return e.lazy||n("itemVisible"),(g,m)=>{const w=oe("oc-spinner"),T=oe("oc-tag"),k=oe("oc-image"),S=oe("oc-icon"),y=Lt("oc-tooltip");return I(),re(a(mc),{ref_key:"observerTarget",ref:i,"body-class":"p-0",class:R.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!a(z.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:m[4]||(m[4]=E=>g.$emit("contextmenu",E))},{default:Z(()=>[h.value?(I(),G("div",yF)):(I(),G(Ae,{key:1},[J(Xi,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:m[1]||(m[1]=E=>g.$emit("fileNameClicked",E))},{default:Z(()=>[Q("div",bF,[e.isLoading?(I(),G("div",wF,[J(w,{"aria-label":a(r)("File is being processed")},null,8,["aria-label"])])):Ce(g.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)?(I(),re(T,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(a(r)("Disabled"))},null,8,SF)]),_:1})):le("",!0),je((I(),G("div",{class:R.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Ce(g.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(I(),re(k,{key:0,class:R.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:m[0]||(m[0]=wt(E=>g.$emit("tileClicked",[e.resource,E]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(I(),re(ws,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},Fu({_:2},[u.value?{name:"status",fn:Z(()=>[J(S,pt(d.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,TF)),[[y,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),Q("div",{class:"p-2",onClick:m[3]||(m[3]=wt(E=>g.$emit("tileClicked",[e.resource,E]),["stop"]))},[Q("div",kF,[Q("div",CF,[J(Ss,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":a(o)(e.resource),"parent-folder-link":a(s)(e.resource),link:e.resourceRoute,onClick:m[2]||(m[2]=wt(E=>g.$emit("fileNameClicked",E),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),Q("div",xF,[Ce(g.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ce(g.$slots,"actions",{item:e.resource}),Ce(g.$slots,"contextMenu",{item:e.resource})])]),p.value?(I(),G("p",AF,[Q("span",{class:"text-sm",textContent:R.toDisplayString(p.value)},null,8,EF)])):le("",!0),Ce(g.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),RF={id:"tiles-view",class:"px-4 pt-2"},DF={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},PF={key:1,class:"oc-tiles-sort"},IF={key:0,class:"flex"},FF={class:"p-1 text-sm"},$F=Le(ge({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Ft.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=De(),{areFileExtensionsShown:s}=we.storeToRefs(o),{isLocationPicker:i,isFilePicker:l}=Tr(),u=Ec(),d=A(()=>Math.min(a(u),e.viewSize)),c=_t(),{isSideBarOpen:p}=we.storeToRefs(c),{disabledResources:f,isResourceSelected:h,fileContainerClicked:g,fileNameClicked:m,fileCheckboxClicked:w,isResourceDisabled:T,isResourceInDeleteQueue:k,isResourceClickable:S,isResourceCut:y,getResourceLink:E,dragItem:D,dragSelection:$,dragStart:_,fileDropped:L,setDropStyling:V,shouldShowContextDrop:te,showContextMenuOnRightClick:B,showContextMenuOnBtnClick:O,selectAllCheckboxLabel:M,getResourceCheckboxLabel:N,toggleSelectionAll:q,areAllResourcesSelected:j}=Pc({space:A(()=>e.space),resources:A(()=>e.resources),selectedIds:A(()=>e.selectedIds),emit:n}),H=window.__E2E__===!0?!1:e.lazy,se=A(()=>e.sortFields.find(ue=>ue.name===e.sortBy&&ue.sortDir===e.sortDir)||e.sortFields[0]),Y=ue=>{n("sort",{sortBy:ue.name,sortDir:a(ue.sortDir)})},ae=A(()=>{const ue={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Se=a(d);return ue[Se]??"xxlarge"}),ne=W(0),pe=()=>{const ue=document.getElementById("tiles-view"),Se=getComputedStyle(ue),$e=parseInt(Se.getPropertyValue("padding-left"),10)|0,Ve=parseInt(Se.getPropertyValue("padding-right"),10)|0;ne.value=ue.clientWidth-$e-Ve},fe=A(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:be}=ig(),xe=A(()=>{const ue=[...Array(Ft.tilesSizeMax).keys()].map(Se=>Se+1);return[...new Set(ue.map(Se=>{const $e=be(Se);return $e?Math.round(a(ne)/($e+a(fe))):0}))]}),he=A(()=>{const ue=a(xe);return ue.length<a(d)?ue[ue.length-1]:ue[a(d)-1]}),ie=A(()=>{const ue=a(he)?e.resources.length%a(he):0;return ue?a(he)-ue:0}),de=A(()=>a(ne)/a(he)-a(fe));return Ue(de,ue=>{ue&&!isNaN(ue)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${ue}px`)},{immediate:!0}),Ue(xe,ue=>{u.value=Math.max(ue.length,1)}),Ue(p,()=>{pe()}),yt(()=>{window.addEventListener("resize",pe),pe()}),bn(()=>{window.removeEventListener("resize",pe)}),(ue,Se)=>{const $e=oe("oc-checkbox"),Ve=oe("oc-icon"),lt=oe("oc-button"),Tt=oe("oc-list"),ut=oe("oc-filter-chip"),gt=Lt("oc-tooltip");return I(),G("div",RF,[Q("div",DF,[e.isSelectable&&!a(l)?je((I(),re($e,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:a(M),"label-hidden":!0,disabled:e.resources.length===a(f).length,"model-value":a(j),onClick:wt(a(q),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[gt,a(M)]]):le("",!0),e.sortFields.length?(I(),G("div",PF,[J(ut,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":a(r)("Sort by"),"selected-item-names":[se.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:Z(()=>[J(Tt,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.sortFields,(ve,ke)=>(I(),G("li",{key:ke},[J(lt,{appearance:se.value===ve?"filled":"raw-inverse","color-role":se.value===ve?"secondaryContainer":"surface","no-hover":se.value===ve,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:qe=>Y(ve)},{default:Z(()=>[Q("span",null,R.toDisplayString(ve.label),1),ve===se.value?(I(),G("div",IF,[J(Ve,{name:"check"})])):le("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):le("",!0)]),J(Tt,{class:"oc-tiles grid justify-start gap-3"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.resources,ve=>(I(),G("li",{key:ve.id,class:"oc-tiles-item has-item-context-menu"},[J(Eg,{resource:ve,space:e.space,"resource-route":a(E)(ve),"is-resource-selected":a(h)(ve),"is-resource-clickable":a(S)(ve,e.areResourcesClickable),"is-resource-disabled":a(T)(ve),"is-extension-displayed":a(s),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ae.value,draggable:e.dragDrop,lazy:a(H),"is-loading":a(k)(ve.id),class:R.normalizeClass({"opacity-60":a(y)(ve)}),onContextmenu:ke=>a(B)(ke,ve),onFileNameClicked:wt(ke=>a(m)({resource:ve,event:ke}),["stop"]),onDragstart:ke=>a(_)(ve,ke),onDragenter:wt(ke=>a(V)(ve,!1,ke),["prevent"]),onDragleave:wt(ke=>a(V)(ve,!0,ke),["prevent"]),onDrop:ke=>a(L)(ve,ke),onDragover:Se[0]||(Se[0]=ke=>ke.preventDefault()),onItemVisible:ke=>ue.$emit("itemVisible",ve),onTileClicked:ke=>a(g)({resource:ve,event:ke[1]})},{selection:Z(()=>[e.isSelectable&&!a(i)&&!a(l)?(I(),re($e,{key:0,label:a(N)(ve),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:a(T)(ve),"model-value":a(h)(ve),"data-test-selection-resource-name":ve.name,"data-test-selection-resource-path":ve.path,onClick:wt(ke=>a(w)({resource:ve,event:ke}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):le("",!0)]),imageField:Z(()=>[Ce(ue.$slots,"image",{resource:ve},void 0,!0)]),indicators:Z(()=>[J(Ag,{space:e.space,class:"ml-2",resource:ve,filter:ke=>["system","sharing"].includes(ke.category),"disable-handler":a(T)(ve)},null,8,["space","resource","filter","disable-handler"])]),actions:Z(()=>[Ce(ue.$slots,"actions",{resource:ve},void 0,!0)]),contextMenu:Z(()=>[a(te)(ve)?(I(),re(a(_c),{key:0,item:ve,title:ve.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:ke=>a(O)(ke,ve)},{contextMenu:Z(()=>[Ce(ue.$slots,"contextMenu",{resource:ve},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):le("",!0)]),additionalResourceContent:Z(()=>[Ce(ue.$slots,"additionalResourceContent",{resource:ve},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","class","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(I(!0),G(Ae,null,Ye(ie.value,ve=>(I(),G("li",{key:`ghost-tile-${ve}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),a(D)?(I(),re(Fa,{key:0,to:"body"},[J(Mc,{ref:"ghostElement","preview-items":[a(D),...a($)]},null,8,["preview-items"])])):le("",!0),Q("div",FF,[Ce(ue.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-6956bf7e"]]),OF=ge({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=Re(),{current:o}=me.useGettext(),s=St(),i=Bn(),{currentTheme:l}=we.storeToRefs(i),u=W(),d=W(e.items),c=W(),p=W(),f=W(!1),h=W(),g=`q_${e.filterName}`,m=Pt(g),w=M=>M[e.idAttribute],T=()=>r.push({query:{...po(a(s).query,[g]),...a(u)&&{[g]:w(a(u))}}}),k=M=>a(u)&&w(a(u))===w(M),S=()=>{c.value=void 0,p.value=void 0},y=async M=>{S(),k(M)?u.value=void 0:(u.value=M,a(h).hideDrop()),await T(),t("selectionChange",a(u))},E=()=>{u.value=void 0,f.value=!1,S(),t("selectionChange",a(u)),T()},D=()=>{d.value=e.items},$=()=>{f.value=!1},_=()=>{const M=at(a(m));if(!M)return;const N=e.items.find(q=>w(q)===M);if(N){u.value=N;return}if(a(L)){const q=M.replace("range:",""),j=Number(q.split(" - ")[0]),H=Number(q.split(" - ")[1]);c.value=vt.DateTime.fromMillis(j),p.value=vt.DateTime.fromMillis(H),u.value=a(te)}},L=A(()=>at(a(m))?.startsWith("range:")),V=A(()=>!a(c)||!a(p)?!1:a(c)<=a(p)),te=A(()=>{if(!a(c)||!a(p))return null;const M=Mr(a(c),o,vt.DateTime.DATE_SHORT),N=Mr(a(p),o,vt.DateTime.DATE_SHORT),q=a(c).toMillis(),j=a(p).toMillis();return{[e.idAttribute]:`range:${q} - ${j}`,[e.displayNameAttribute]:`${M} - ${N}`}}),B=async()=>{u.value=a(te),await T(),a(h).hideDrop(),t("selectionChange",a(u))},O=({date:M,error:N},q)=>{if(N){console.error("date could not be set");return}const j=q==="from"?c:p;if(!M){j.value=void 0;return}const H=q==="from"?M.startOf("day"):M.endOf("day");j.value=H};return n({setSelectedItemsBasedOnQuery:_}),yt(()=>{_()}),{clearFilter:E,displayedItems:d,isItemSelected:k,selectedItem:u,onShowDrop:D,onHideDrop:$,filterChip:h,toggleItemSelection:y,setSelectedItemsBasedOnQuery:_,fromDate:c,toDate:p,dateRangeValid:V,applyDateRangeFilter:B,dateRangeApplied:L,setDateRangeDate:O,dateRangeClicked:f,currentTheme:l,queryParam:g}}}),LF={class:"flex items-center truncate"},_F={class:"truncate ml-2"},MF={class:"flex"},NF={class:"my-1"},BF={class:"flex items-center truncate"},jF={class:"truncate ml-2"},zF=["textContent"],UF={class:"flex"},VF={class:"flex items-center justify-between mb-4"},qF=["textContent"],HF={class:"mt-2"},WF={class:"date-filter-apply-btn text-end"};function QF(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-datepicker"),c=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[J(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:Z(()=>[J(u,{class:R.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.displayedItems,(p,f)=>(I(),G("li",{key:f,class:"my-1 first:mt-0 last:mb-0"},[J(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(p)}]),"justify-content":"space-between",appearance:"raw","data-testid":p[e.displayNameAttribute],onClick:h=>e.toggleItemSelection(p)},{default:Z(()=>[Q("div",LF,[Q("div",_F,[Ce(e.$slots,"item",{item:p},void 0,!0)])]),Q("div",MF,[e.isItemSelected(p)?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),Q("li",NF,[J(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=p=>e.dateRangeClicked=!0)},{default:Z(()=>[Q("div",BF,[Q("div",jF,[Q("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,zF)])]),Q("div",UF,[e.dateRangeApplied?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),Q("div",{class:R.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[Q("div",VF,[J(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=p=>e.dateRangeClicked=!1)},{default:Z(()=>[J(i,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),Q("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,qF),J(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=p=>e.filterChip.hideDrop())},{default:Z(()=>[J(i,{name:"close"})]),_:1},8,["aria-label"])]),Q("div",HF,[J(d,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=p=>e.setDateRangeDate(p,"from"))},null,8,["label","current-date","is-dark"]),J(d,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=p=>e.setDateRangeDate(p,"to"))},null,8,["label","current-date","min-date","is-dark"])]),Q("div",WF,[J(l,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const KF=Le(OF,[["render",QF],["__scopeId","data-v-80ea8301"]]),GF=ge({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Re(),r=St(),o=W(e.filterOptions[0].name),s=`q_${e.filterName}`,i=Pt(s),l=d=>n.push({query:{...po(a(r).query,[s]),[s]:d}}),u=async d=>{o.value=d.name,await l(d.name),t("toggleFilter",d)};return yt(()=>{const d=at(a(i));d&&e.filterOptions.some(({name:c})=>c===d)&&(o.value=d,t("toggleFilter",e.filterOptions.find(({name:c})=>c===d)))}),{queryParam:s,activeOption:o,toggleFilter:u}}}),JF=["textContent"];function XF(e,t,n,r,o,s){const i=oe("oc-button");return I(),G("div",null,[Q("div",{class:R.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(I(!0),G(Ae,null,Ye(e.filterOptions,(l,u)=>(I(),re(i,{id:l.name,key:u,class:R.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:e.activeOption===l.name?"filled":"raw-inverse","color-role":e.activeOption===l.name?"secondaryContainer":"surface","no-hover":e.activeOption===l.name,onClick:d=>e.toggleFilter(l)},{default:Z(()=>[Q("span",{class:"truncate item-inline-filter-option-label",textContent:R.toDisplayString(l.label)},null,8,JF)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const YF=Le(GF,[["render",XF]]),ZF={class:"space-quota"},e$=["textContent"],Rg=ge({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=me.useGettext(),r=A(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:a(s),total:a(o),percentage:a(i).toString()}):t("%{used} used (no restriction)",{used:a(s)})),o=A(()=>Ht(e.spaceQuota.total,n)),s=A(()=>Ht(e.spaceQuota.used,n)),i=A(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),l=A(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(u,d)=>{const c=oe("oc-progress");return I(),G("div",ZF,[Q("p",{class:"mb-2 mt-0",textContent:R.toDisplayString(r.value)},null,8,e$),J(c,{value:i.value,max:100,size:"small",color:l.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),t$=ge({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Jn("resource"),n="check",r="file-copy",o=W(r),s=W(r),i=A(()=>vl(a(t).webDavPath)),l=A(()=>e.space?.getWebDavUrl({path:a(t).path}));return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(a(i)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:s,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(a(l)),s.value=n,setTimeout(()=>s.value=r,1500)},webDavPath:i,webDavUrl:l}}}),n$={class:"flex"},r$=["textContent"],o$={class:"flex"},s$=["textContent"];function i$(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=Lt("oc-tooltip");return I(),G(Ae,null,[Q("dt",null,R.toDisplayString(e.$gettext("WebDAV path")),1),Q("dd",n$,[je(Q("div",{class:"truncate",textContent:R.toDisplayString(e.webDavPath)},null,8,r$),[[u,e.webDavPath]]),je((I(),re(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Z(()=>[J(i,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV path")]])]),Q("dt",null,R.toDisplayString(e.$gettext("WebDAV URL")),1),Q("dd",o$,[je(Q("div",{class:"truncate",textContent:R.toDisplayString(e.webDavUrl)},null,8,s$),[[u,e.webDavUrl]]),je((I(),re(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Z(()=>[J(i,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV URL")]])])],64)}const Dg=Le(t$,[["render",i$]]),a$={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},l$={class:"text-center"},c$={key:1,class:"relative mb-2"},u$=["src"],d$={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},f$=["textContent"],p$=["textContent"],h$=["aria-label"],m$=ge({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=et(),n=De(),{resourceContentsText:r}=ag({showSizeInformation:!1}),o=Re(),{$gettext:s,$ngettext:i,current:l}=me.useGettext(),{loadPreview:u}=Rc(),{openSideBarPanel:d}=_t(),c=He(),{imagesLoading:p}=we.storeToRefs(c),f=tr(),h=Jn("resource"),g=W(""),{user:m}=we.storeToRefs(t),w=A(()=>c.getSpaceMembers(a(h))),T=A(()=>f.linkShares.length),k=A(()=>n.areWebDavDetailsShown),S=A(()=>!st(o,"files-spaces-projects")),y=A(()=>`${Ht(a(h).size,l)}, ${a(r)}`);Ue(()=>a(h).spaceImageData,async()=>{g.value=await u({space:a(h),resource:a(h).spaceImageData?z.buildSpaceImageResource(a(h)):a(h),dimensions:bs.Tile,processor:Ci.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const E=A(()=>a(w).length?a(w).filter(z.isManager).map(({sharedWith:H})=>H.id===a(m)?.id?s("%{displayName} (me)",{displayName:H.displayName}):H.displayName).join(", "):z.getSpaceManagers(a(h),f.graphRoles)?.map(({grantedToV2:se})=>se.user?.id===a(m)?.id?s("%{displayName} (me)",{displayName:se.user.displayName}):se.user?.displayName||se.group?.displayName).join(", ")),D=A(()=>gp(a(h).mdate,l)),$=A(()=>a(B)||a(O)),_=A(()=>a(B)&&!a(O)?a(N):!a(B)&&a(O)?a(q):a(M)===1?i("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",a(T),{linkShareCount:a(T).toString()}):a(T)===1?s("This space has %{memberShareCount} members and one link.",{memberShareCount:a(M).toString()}):s("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:a(M).toString(),linkShareCount:a(T).toString()})),L=A(()=>s("Open share panel")),V=A(()=>s("Open link list in share panel")),te=A(()=>s("Open member list in share panel")),B=A(()=>a(M)>0),O=A(()=>a(T)>0),M=A(()=>a(w).length),N=A(()=>i("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",a(M),{memberShareCount:a(M).toString()})),q=A(()=>i("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",a(T),{linkShareCount:a(T).toString()}));return(j,H)=>{const se=oe("oc-spinner"),Y=oe("oc-icon"),ae=oe("oc-button"),ne=oe("portal-target");return I(),G("div",a$,[Q("div",l$,[a(p).includes(a(h).id)?(I(),re(se,{key:0,"aria-label":a(s)("Space image is loading")},null,8,["aria-label"])):g.value?(I(),G("div",c$,[Q("img",{src:g.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,u$)])):(I(),re(Y,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&$.value&&!a(h).disabled?(I(),G("div",d$,[B.value?(I(),re(ae,{key:0,appearance:"raw","aria-label":te.value,"no-hover":"",onClick:H[0]||(H[0]=pe=>a(d)("space-share"))},{default:Z(()=>[J(Y,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),O.value?(I(),re(ae,{key:1,appearance:"raw","aria-label":V.value,"no-hover":"",onClick:H[1]||(H[1]=pe=>a(d)("space-share"))},{default:Z(()=>[J(Y,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),Q("p",{textContent:R.toDisplayString(_.value)},null,8,f$),J(ae,{appearance:"raw","aria-label":L.value,size:"small","no-hover":"",onClick:H[2]||(H[2]=pe=>a(d)("space-share"))},{default:Z(()=>[Q("span",{class:"text-sm",textContent:R.toDisplayString(a(s)("Show"))},null,8,p$)]),_:1},8,["aria-label"])])):le("",!0),Q("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":a(s)("Overview of the information about the selected space")},[Q("dt",null,R.toDisplayString(a(s)("Last activity")),1),Q("dd",null,R.toDisplayString(D.value),1),a(h).description?(I(),G(Ae,{key:0},[Q("dt",null,R.toDisplayString(a(s)("Subtitle")),1),Q("dd",null,R.toDisplayString(a(h).description),1)],64)):le("",!0),Q("dt",null,R.toDisplayString(a(s)("Manager")),1),Q("dd",null,R.toDisplayString(E.value),1),a(h).disabled?le("",!0):(I(),G(Ae,{key:1},[Q("dt",null,R.toDisplayString(a(s)("Quota")),1),Q("dd",null,[J(Rg,{"space-quota":a(h).spaceQuota},null,8,["space-quota"])])],64)),S.value?(I(),G(Ae,{key:2},[Q("dt",null,R.toDisplayString(a(s)("Size")),1),Q("dd",null,R.toDisplayString(y.value),1)],64)):le("",!0),k.value?(I(),re(Dg,{key:3,space:a(h)},null,8,["space"])):le("",!0),J(ne,{name:"app.files.sidebar.space.details.table","slot-props":{space:a(h),resource:a(h)},multiple:!0},null,8,["slot-props"])],8,h$)])}}}),g$={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},v$={class:"text-center mb-6 rounded-sm"},y$=["textContent"],b$=ge({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=me.useGettext(),{$gettext:n,$ngettext:r}=t,o=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{f+=h.spaceQuota.total}),Ht(f,t.current)}),s=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{h.disabled||(f+=h.spaceQuota.remaining)}),Ht(f,t.current)}),i=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{h.disabled||(f+=h.spaceQuota.used)}),Ht(f,t.current)}),l=A(()=>e.selectedSpaces.filter(f=>!f.disabled).length),u=A(()=>e.selectedSpaces.filter(f=>f.disabled).length),d=A(()=>n("Overview of the information about the selected spaces")),c=A(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),p=A(()=>[{term:n("Total quota:"),definition:a(o).toString()},{term:n("Remaining quota:"),definition:a(s).toString()},{term:n("Used quota:"),definition:a(i).toString()},{term:n("Enabled:"),definition:a(l).toString()},{term:n("Disabled:"),definition:a(u).toString()}]);return(f,h)=>{const g=oe("oc-icon"),m=oe("oc-definition-list");return I(),G("div",g$,[Q("div",v$,[Q("div",null,[J(g,{size:"xxlarge",name:"layout-grid"}),Q("p",{textContent:R.toDisplayString(c.value)},null,8,y$)])]),J(m,{"aria-label":d.value,items:p.value,class:"m-0"},null,8,["aria-label","items"])])}}}),w$=ge({name:"SpaceNoSelection"}),S$={class:"mt-12"},T$={class:"flex flex-col items-center space-info text-center"};function k$(e,t,n,r,o,s){const i=oe("oc-icon"),l=Lt("translate");return I(),G("div",S$,[Q("div",T$,[J(i,{name:"layout-grid",size:"xxlarge"}),je((I(),G("p",null,[...t[0]||(t[0]=[ct("Select a space to view details",-1)])])),[[l]])])])}const C$=Le(w$,[["render",k$]]),x$=ge({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=W(!1);let t;return yt(()=>{t=ze.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),bn(()=>{ze.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!tp(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}}}),A$={class:"w-full flex flex-row flex-wrap justify-between items-center"},E$={key:0,class:"flex items-center"},R$=["textContent"],D$={key:1},P$=["textContent"],I$=["textContent"];function F$(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button");return I(),G("div",A$,[e.saved?(I(),G("span",E$,[J(i,{name:"checkbox-circle"}),Q("span",{class:"ml-2",textContent:R.toDisplayString(e.$gettext("Changes saved"))},null,8,R$)])):(I(),G("span",D$,R.toDisplayString(e.unsavedChangesText),1)),Q("div",null,[J(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=u=>e.$emit("revert"))},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(e.$gettext("Revert"))},null,8,P$)]),_:1},8,["disabled"]),J(l,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=u=>e.$emit("confirm"))},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(e.$gettext("Save"))},null,8,I$)]),_:1},8,["disabled"])])])}const $$=Le(x$,[["render",F$]]),O$=ey(async()=>(await Promise.resolve().then(()=>DO)).default),L$=ge({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=ho(),n=Sp(),r=A(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,a(r));return{extensions:A(()=>{if(e.extensionPoint.multiple||a(r).length<=1)return a(r);const i=n.getExtensionPreference(e.extensionPoint.id,o);return i.selectedExtensionIds.length?[a(r).find(l=>i.selectedExtensionIds.includes(l.id))||a(r)[0]]:[a(r)[0]]})}}});function _$(e,t,n,r,o,s){return I(!0),G(Ae,null,Ye(e.extensions,i=>(I(),re(rn(i.content),{key:`custom-component-${i.id}`}))),128)}const M$=Le(L$,[["render",_$]]),N$={class:"flex items-center truncate"},B$={class:"truncate"},j$={class:"flex"},z$=ge({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,o=Re(),s=St(),i=nn("filterInputRef"),l=W([]),u=W(e.items),d=nn("itemFilterListRef"),c=`q_${e.filterName}`,p=Pt(c),f=$=>$[e.idAttribute],h=()=>o.push({query:{...po(a(s).query,[c]),...!!a(l).length&&{[c]:a(l).reduce(($,_)=>($+=`${f(_)}+`,$),"").slice(0,-1)}}}),g=$=>!!a(l).find(_=>f(_)===f($)),m=async $=>{g($)?l.value=a(l).filter(_=>f(_)!==f($)):(e.allowMultiple||(l.value=[]),l.value.push($)),await h(),r("selectionChange",a(l))},w=W(),T=($,_)=>{if(!(_||"").trim())return $;const V=new Nc($,{...Wa,keys:e.filterableAttributes}).search(_).map(te=>te.item);return $.filter(te=>V.includes(te))},k=()=>{l.value=[],r("selectionChange",a(l)),h()},S=$=>{u.value=$},y=async()=>{S(e.items),await xt(),a(i)?.focus()};let E;Ue(w,()=>{S(T(e.items,a(w))),a(d)&&(E=new Vc(a(d)),E.unmark(),E.mark(a(w),{element:"span",className:"mark-highlight"}))});const D=()=>{const $=at(a(p));if($){const _=$.split("+");l.value=e.items.filter(L=>_.includes(f(L)))}};return t({setSelectedItemsBasedOnQuery:D}),yt(()=>{D()}),($,_)=>{const L=oe("oc-checkbox"),V=oe("oc-icon"),te=oe("oc-button"),B=oe("oc-list"),O=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[J(O,{"filter-label":e.filterLabel,"selected-item-names":l.value.map(M=>M[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:k,onShowDrop:y},{default:Z(()=>[e.showOptionFilter&&e.filterableAttributes.length?(I(),re(a(xE),{key:0,ref_key:"filterInputRef",ref:i,modelValue:w.value,"onUpdate:modelValue":_[0]||(_[0]=M=>w.value=M),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?$.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):le("",!0),Q("div",{ref_key:"itemFilterListRef",ref:d},[J(B,{class:"item-filter-list"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(u.value,(M,N)=>(I(),G("li",{key:N,class:"my-1"},[J(te,{class:R.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&g(M),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":M[e.displayNameAttribute],onClick:q=>m(M)},{default:Z(()=>[Q("div",N$,[e.allowMultiple?(I(),re(L,{key:0,size:"large",class:"mr-2",label:$.$gettext("Toggle selection"),"model-value":g(M),"label-hidden":!0,"onUpdate:modelValue":q=>m(M),onClick:_[1]||(_[1]=wt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):le("",!0),Q("div",null,[Ce($.$slots,"image",{item:M})]),Q("div",B$,[Ce($.$slots,"item",{item:M})])]),Q("div",j$,[!e.allowMultiple&&g(M)?(I(),re(V,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),U$=ge({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Re(),r=St(),o=W(!1),s=`q_${e.filterName}`,i=Pt(s),l=()=>n.push({query:{...po(a(r).query,[s]),...a(o)&&{[s]:"true"}}}),u=async()=>{o.value=!a(o),await l(),t("toggleFilter",a(o))};return yt(()=>{at(a(i))==="true"&&(o.value=!0)}),{queryParam:s,filterActive:o,toggleFilter:u}}});function V$(e,t,n,r,o,s){const i=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[J(i,{"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 q$=Le(U$,[["render",V$]]),H$=ge({name:"LoadingIndicator",setup(){const e=Ut();let t,n,r;const o=W(e.isLoading),s=W(e.currentProgress),i=()=>{s.value=e.currentProgress,o.value=e.isLoading},l=()=>{s.value=e.currentProgress};return yt(()=>{t=ze.subscribe(Sr.add,i),n=ze.subscribe(Sr.remove,i),r=ze.subscribe(Sr.setProgress,l)}),bn(()=>{ze.unsubscribe(Sr.add,t),ze.unsubscribe(Sr.remove,n),ze.unsubscribe(Sr.setProgress,r)}),{isLoading:o,currentProgress:s}}}),W$={key:0,id:"oc-loading-indicator",class:"w-full"};function Q$(e,t,n,r,o,s){const i=oe("oc-progress");return e.isLoading?(I(),G("div",W$,[J(i,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):le("",!0)}const K$=Le(H$,[["render",Q$]]),G$={class:"no-content-message flex flex-col justify-center items-center text-center"},J$={class:"text-role-on-surface-variant text-xl"},X$={class:"text-role-on-surface-variant"},Y$=Le(ge({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=oe("oc-icon");return I(),G("div",G$,[J(r,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),Q("div",J$,[Ce(t.$slots,"message",{},void 0,!0)]),Q("div",X$,[Ce(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),Z$=ge({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function eO(e,t,n,r,o,s){const i=oe("oc-pagination");return e.pages>1?(I(),re(i,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):le("",!0)}const tO=Le(Z$,[["render",eO]]),nO=ge({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=me.useGettext(),r=Pt("useScope"),o=W(),s=W(),i=A(()=>n(o.value?.title)),l=A(()=>[{id:jr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:jr.allFiles,title:n("All files"),enabled:!0}]);return Ue(()=>e.currentFolderAvailable,()=>{if(a(r)){if(a(r).toString()==="true"){o.value=a(l).find(({id:c})=>c===jr.currentFolder);return}o.value=a(l).find(({id:c})=>c===jr.allFiles);return}if(!e.currentFolderAvailable){o.value=a(l).find(({id:d})=>d===jr.allFiles);return}if(a(s)){o.value=a(l).find(({id:d})=>d===a(s).id);return}o.value=a(l).find(({id:d})=>d===jr.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:i,onOptionSelected:d=>{s.value=d,o.value=d,t("update:modelValue",{value:d})},locationOptions:l}}}),rO={key:0},oO={key:0,class:"flex"};function sO(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-filter-chip");return I(),G("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=wt(()=>{},["stop"]))},[e.currentSelection?(I(),G("div",rO,[J(d,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:Z(()=>[J(u,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.locationOptions,(c,p)=>(I(),G("li",{key:p},[J(l,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:f=>e.onOptionSelected(c)},{default:Z(()=>[Q("span",null,R.toDisplayString(c.title),1),c.id===e.currentSelection.id?(I(),G("div",oO,[J(i,{name:"check"})])):le("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):le("",!0)])}const iO=Le(nO,[["render",sO]]),aO=ge({__name:"PortalTarget",setup(e){const t={...Rs.PortalTarget.props},n=A(()=>t);return yt(()=>{ze.publish(sa.mounted,t)}),(r,o)=>(I(),re(a(Rs.PortalTarget),R.normalizeProps(Wu(n.value)),null,16))}}),lO={key:0},cO={key:0,class:"version-check-loading flex items-center"},uO=["textContent"],dO={key:0,class:"version-check-no-updates flex items-center"},fO=["textContent"],pO=["textContent"],hO=ge({__name:"VersionCheck",setup(e){const{$gettext:t}=me.useGettext(),n=Dt(),r=th(),o=n.capabilities.core["check-for-updates"],{updates:s,isLoading:i,hasError:l}=we.storeToRefs(r),u=A(()=>o&&!a(l)),d=W(!1),c=W(),p=n.status.edition||"rolling",h=n.status.productversion.split("+")[0];return Ue(()=>s,()=>{if(!a(s))return;const g=a(s).channels[p].current_version;bl(g,h)>0&&(d.value=!0,c.value=a(s).channels[p])},{immediate:!0,deep:!0}),(g,m)=>{const w=oe("oc-spinner"),T=oe("oc-icon"),k=oe("oc-button");return u.value?(I(),G("div",lO,[a(i)?(I(),G("div",cO,[Q("span",{textContent:R.toDisplayString(a(t)("Checking for updates"))},null,8,uO),J(w,{class:"ml-1",size:"xsmall"})])):(I(),G(Ae,{key:1},[d.value?(I(),re(k,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:Z(()=>[Q("span",{class:"text-xs",textContent:R.toDisplayString(a(t)("Version %{version} available",{version:c.value.current_version}))},null,8,pO),J(T,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(I(),G("div",dO,[Q("span",{textContent:R.toDisplayString(a(t)("Up to date"))},null,8,fO),J(T,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):le("",!0)}}}),mO={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é"}},gO={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"}},vO={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"}},yO={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"}},bO={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"}},wO={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:"Автопрокрутка"}},SO={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:"同期スクロール"}},TO={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"}},kO={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"},CO={"fr-FR":mO,"de-DE":gO,"it-IT":vO,"es-ES":yO,"pl-PL":bO,ru:wO,"jp-JP":SO,"id-ID":TO},xO=ge({name:"TextEditor",components:{MdEditor:Ro.MdEditor,MdPreview:Ro.MdPreview,NormalToolbar:Ro.NormalToolbar},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=me.useGettext(),{currentTheme:r}=Bn(),o=W(!0),s=A(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=A(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!a(s).showPreviewOnlyMd),l=A(()=>a(r).isDark?"dark":"light"),u=A(()=>a(i)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return Ro.config({editorConfig:{languageUserDefined:CO},editorExtensions:{screenfull:{instance:Bg},cropper:{instance:ca}},markdownItPlugins(c){return[...c,{type:"xss",plugin:Ro.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const p=[...c,{type:"lineNumbers",extension:jg.lineNumbers()}],f=p.find(h=>h.type==="linkShortener");return f&&(f.options.maxLength=120),a(i)?p:p.filter(h=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(h.type))}}),{isMarkdown:i,theme:l,toolbars:u,language:n,languages:kO,onUploadImg:async c=>{const f=(await Promise.all([...c].map(g=>new Promise((m,w)=>{const T=new FileReader;T.onload=()=>m(T.result),T.onerror=w,T.readAsDataURL(g)})))).map(g=>`![image](${g})`),h=`${a(e.currentContent)}
33
+ ${f.join(`
66
34
 
67
35
  `)}
68
- `;t("update:currentContent",m)},showLineNumbers:i}}}),f8={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},d8={key:0};function p8(e,t,n,r,i,o){const s=Ee("md-preview"),a=Ee("oc-icon"),l=Ee("NormalToolbar"),u=Ee("md-editor");return X(),pe("div",f8,[e.isReadOnly?(X(),pe("article",d8,[me(s,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(X(),Te(u,{key:1,id:"text-editor-component",class:z.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:ve(()=>[me(l,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:ve(()=>[me(a,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const h8=Object.freeze(Object.defineProperty({__proto__:null,default:Ye(u8,[["render",p8]])},Symbol.toStringTag,{value:"Module"}));$.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=xd,$.AccountCapabilitiesSchema=Bb,$.AccountSchema=Ub,$.AccountsSchema=qb,$.ActionMenuDropItem=sS,$.ActionMenuItem=tl,$.ApiError=Dx,$.AppBar=I$,$.AppLoadingSpinner=Id,$.AppProviderService=xx,$.AppTopBar=cS,$.AppWrapper=hS,$.AppWrapperRoute=kM,$.ArchiverService=Lx,$.Auth=gc,$.AvatarUpload=HM,$.BatchActions=oS,$.Cache=lm,$.ClientService=zx,$.ClipboardActions=Mo,$.CompareSaveDialog=gj,$.ConflictDialog=jl,$.ContextActionMenu=nl,$.ContextActions=aS,$.ContextMenuQuickAction=Vd,$.CreateLinkModal=h0,$.CreateShortcutModal=v0,$.CreateSpace=D$,$.CustomComponentTarget=wj,$.DateFilter=OB,$.DatePickerModal=uM,$.EVENT_FILE_DROPPED=h2,$.EVENT_TROW_CONTEXTMENU=m2,$.EVENT_TROW_MOUNTED=p2,$.EmojiPickerModal=z0,$.EventBus=ym,$.FileInfo=Ud,$.FilePickerModal=T0,$.FileSideBar=fS,$.FolderLoaderFavorites=bv,$.FolderLoaderSharedViaLink=wv,$.FolderLoaderSharedWithMe=Sv,$.FolderLoaderSharedWithOthers=Ev,$.FolderLoaderSpace=vv,$.FolderLoaderTrashbin=Tv,$.FolderService=Av,$.FolderViewModeConstants=nn,$.HttpClient=yc,$.IdentitySchema=jb,$.ImageDimension=rs,$.ImageType=g2,$.ItemFilter=Aj,$.ItemFilterInline=NB,$.ItemFilterToggle=Cj,$.Key=fr,$.LimitsSchema=Vb,$.LinkRoleDropdown=p0,$.LoadingEventTopics=Gr,$.LoadingIndicator=Oj,$.LoadingService=Ak,$.MailCapabilitiesSchema=$b,$.MimeTypesToAppsSchema=hm,$.Modifier=Ia,$.NoContentMessage=Nj,$.Pagination=Mj,$.PaginationConstants=io,$.PasswordPolicyService=EP,$.PortalTarget=Hj,$.PortalTargetEventTopics=el,$.PreviewService=mP,$.PrimaryAccountsSchema=zb,$.ProcessorType=ya,$.QuotaModal=B0,$.QuotaSelect=M0,$.RESOURCE_MAX_CHARACTER_LENGTH=y2,$.RESOURCE_NAME_MAX_BYTES=Rd,$.RawConfigSchema=wO,$.RawGroupwareConfigSchema=gF,$.ResolveStrategy=Wn,$.ResourceConflictModal=bh,$.ResourceGhostElement=qd,$.ResourceIcon=is,$.ResourceLink=Ha,$.ResourceListItem=os,$.ResourceName=Cd,$.ResourcePreview=y0,$.ResourceSize=mS,$.ResourceTable=eB,$.ResourceTile=yS,$.ResourceTiles=gB,$.ResourceTransfer=Sh,$.RuntimeError=ji,$.SaveAsModal=C0,$.SearchBarFilter=qj,$.SearchLocationFilterConstants=mi,$.SideBar=uS,$.SideBarEventTopics=Rt,$.SieveCapabilitiesSchema=Mb,$.SortConstants=cs,$.SpaceDetails=JB,$.SpaceDetailsMultiple=nj,$.SpaceImageModal=P0,$.SpaceInfo=jd,$.SpaceMoveInfoModal=vh,$.SpaceNoSelection=aj,$.SpaceQuota=vS,$.TextEditor=yj,$.ThemeConfig=dF,$.TransferType=Sr,$.UnsavedChangesModal=dS,$.UppyService=kP,$.UserAvatar=rl,$.VersionCheck=Zj,$.ViewOptions=lS,$.VisibilityObserver=g0,$.WebDavDetails=bS,$.WebThemeConfig=_b,$.activeApp=lc,$.authContextValues=ox,$.blobToArrayBuffer=cb,$.breadcrumbsFromPath=GI,$.buildRoutes=TF,$.buildUrl=ax,$.cacheService=mc,$.canvasToBlob=ub,$.cloneStateObject=gh,$.compareVersions=hc,$.concatBreadcrumbs=QI,$.contextQueryToFileContextProps=Kb,$.contextRouteNameKey=xa,$.contextRouteParamsKey=Qf,$.contextRouteQueryKey=Xf,$.convertToMinimalUppyFile=zv,$.createDefaultFileIconMapping=Th,$.createFileRouteOptions=sr,$.createFolderDummyFile=qv,$.createLocation=Li,$.createLocationCommon=$i,$.createLocationPublic=Mi,$.createLocationShares=Fn,$.createLocationSpaces=Kn,$.createLocationTrash=Hr,$.defaultFuseOptions=Ul,$.defineWebApplication=OS,$.determineResourceTableSortFields=dm,$.determineResourceTilesSortFields=Sx,$.dirname=ft.dirname,$.displayPositionedDropdown=Wf,$.encodePath=dc,$.eventBus=Je,$.filterResources=NE,$.focusCheckbox=ux,$.folderService=xv,$.formatDateFromDateTime=di,$.formatDateFromHTTP=XI,$.formatDateFromISO=rb,$.formatDateFromJSDate=nb,$.formatDateFromRFC=YI,$.formatFileSize=vn,$.formatRelativeDateFromDateTime=Bo,$.formatRelativeDateFromHTTP=JI,$.formatRelativeDateFromISO=ZI,$.formatRelativeDateFromJSDate=ib,$.formatRelativeDateFromRFC=eO,$.getIndicators=lb,$.getLocaleFromLanguage=wa,$.getParentPaths=ob,$.getSharedAncestorRoute=cx,$.getSharedDriveItem=Ks,$.getSpacesByType=Vo,$.getTextByteSize=Kf,$.isItemInCurrentFolder=Ah,$.isLocationActive=SF,$.isLocationActiveDirector=Ni,$.isLocationCommonActive=Vt,$.isLocationPublicActive=_n,$.isLocationSharesActive=Mt,$.isLocationSpacesActive=xt,$.isLocationTrashActive=yn,$.isMacOs=jo,$.isPromiseFulfilled=pi,$.isPromiseRejected=hi,$.isResourceBeeingMovedToSameLocation=wh,$.isSameResource=wo,$.locationPublicLink=sc,$.locationPublicUpload=ac,$.locationSharesViaLink=oc,$.locationSharesWithMe=Hs,$.locationSharesWithOthers=ic,$.locationSpacesGeneric=rc,$.objectKeys=Nx,$.parseVersion=pc,$.queryItemAsString=Ct,$.renameResource=Vl,$.resolveFileNameDuplicate=zn,$.resourceIconMappingInjectionKey=Eh,$.routeToContextQuery=Ra,$.setCurrentUserShareSpacePermissions=cm,$.sortFields=pm,$.sortHelper=nS,$.sortSpaceMembers=Nb,$.translateSortFields=Ex,$.triggerDownloadWithFilename=fc,$.useAbility=fn,$.useActionsShowDetails=kL,$.useActiveApp=sx,$.useActiveLocation=Qn,$.useAppConfig=sm,$.useAppDefaults=ew,$.useAppFileHandling=Yf,$.useAppFolderHandling=Qb,$.useAppMeta=ed,$.useAppNavigation=Gb,$.useAppProviderService=IL,$.useAppsStore=ar,$.useArchiverService=b0,$.useAuthService=Jf,$.useAuthStore=li,$.useAvatarsStore=Ea,$.useBreadcrumbsFromPath=OL,$.useCanBeOpenedWithSecureView=G0,$.useCanListShares=O0,$.useCanListVersions=Q0,$.useCanShare=F0,$.useCapabilityStore=en,$.useClientService=Ke,$.useClipboardStore=Uo,$.useConfigStore=dt,$.useCopyLink=Ad,$.useCreateSpace=Qi,$.useCropperKeyboardActions=td,$.useDeleteWorker=tw,$.useDocumentTitle=Xb,$.useDownloadFile=w0,$.useDriveResolver=Zb,$.useEmbedMode=Qr,$.useEventBus=ur,$.useExtensionPreferencesStore=db,$.useExtensionRegistry=Ki,$.useFileActions=Xn,$.useFileActionsCopy=Pa,$.useFileActionsCopyPermanentLink=nd,$.useFileActionsCreateLink=u2,$.useFileActionsCreateNewFile=f2,$.useFileActionsCreateNewFolder=d2,$.useFileActionsCreateNewShortcut=V2,$.useFileActionsCreateSpaceFromResource=kd,$.useFileActionsDelete=ss,$.useFileActionsDeleteResources=D0,$.useFileActionsDisableSync=Ka,$.useFileActionsDownloadArchive=Ga,$.useFileActionsDownloadFile=as,$.useFileActionsEmptyTrashBin=q2,$.useFileActionsEnableSync=Qa,$.useFileActionsFavorite=Pd,$.useFileActionsMove=Xa,$.useFileActionsNavigate=S0,$.useFileActionsOpenShortcut=W2,$.useFileActionsOpenWithApp=x0,$.useFileActionsOpenWithDefault=E0,$.useFileActionsPaste=R0,$.useFileActionsRename=Ya,$.useFileActionsRestore=ls,$.useFileActionsSaveAs=k0,$.useFileActionsSetImage=I0,$.useFileActionsShowActions=lL,$.useFileActionsShowDetails=Od,$.useFileActionsShowShares=Fd,$.useFileActionsToggleHideShare=Ja,$.useFileActionsUndoDelete=_0,$.useFileListHeaderPosition=FL,$.useFileRouteReplace=Ta,$.useFolderLink=Yr,$.useGetMatchingSpace=ln,$.useGetResourceContext=X0,$.useGroupwareConfigStore=mF,$.useInterceptModifierClick=gi,$.useIsAppActive=cL,$.useIsFilesAppActive=_r,$.useIsResourceNameValid=Ei,$.useIsSearchActive=Za,$.useIsTopBarSticky=_d,$.useKeyboardActions=Oa,$.useLinkTypes=Wa,$.useLoadAvatars=iS,$.useLoadPreview=Nd,$.useLoadingService=gn,$.useLocalStorage=Hf,$.useMessages=nt,$.useModals=ht,$.useOpenEmptyEditor=PL,$.useOpenWithDefaultApp=U0,$.usePagination=_L,$.usePasswordPolicyService=H0,$.usePasteWorker=nw,$.usePortalTarget=LL,$.usePreviewService=K0,$.useRequest=Yb,$.useRequestHeaders=ka,$.useResourceContents=J0,$.useResourceRouteResolver=A0,$.useResourceViewContextMenu=Z0,$.useResourceViewDrag=eS,$.useResourceViewHelpers=Ld,$.useResourceViewSelection=tS,$.useResourcesStore=ze,$.useRestoreWorker=rw,$.useRoute=Ht,$.useRouteMeta=Wb,$.useRouteName=Gf,$.useRouteParam=Aa,$.useRouteQuery=tn,$.useRouteQueryPersisted=kr,$.useRouter=He,$.useScrollTo=m0,$.useSearch=Zf,$.useSelectedResources=$d,$.useService=Ar,$.useSharesStore=Cr,$.useSideBar=Sa,$.useSort=VL,$.useSpaceActionsDelete=N0,$.useSpaceActionsDeleteImage=CL,$.useSpaceActionsDisable=L0,$.useSpaceActionsDuplicate=$0,$.useSpaceActionsEditDescription=fL,$.useSpaceActionsEditQuota=j0,$.useSpaceActionsEditReadmeContent=SL,$.useSpaceActionsNavigateToTrash=TL,$.useSpaceActionsRename=V0,$.useSpaceActionsRestore=q0,$.useSpaceActionsSetIcon=RL,$.useSpaceActionsShowMembers=EL,$.useSpaceHelpers=Ca,$.useSpacesLoading=Jb,$.useSpacesStore=at,$.useThemeStore=cr,$.useTileSize=Y0,$.useTokenTimerWorker=kF,$.useUpdatesStore=Lb,$.useUpload=KL,$.useUserStore=vt,$.useViewMode=BL,$.useViewSize=jL,$.useViewSizeMax=Dd,$.useWebWorkersStore=qo,$.useWindowOpen=W0,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})}));
36
+ `;t("update:currentContent",h)},showLineNumbers:o}}}),AO={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},EO={key:0};function RO(e,t,n,r,o,s){const i=oe("md-preview"),l=oe("oc-icon"),u=oe("NormalToolbar"),d=oe("md-editor");return I(),G("div",AO,[e.isReadOnly?(I(),G("article",EO,[J(i,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(I(),re(d,{key:1,id:"text-editor-component",class:R.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:Z(()=>[J(u,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:Z(()=>[J(l,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const DO=Object.freeze(Object.defineProperty({__proto__:null,default:Le(xO,[["render",RO]])},Symbol.toStringTag,{value:"Module"}));x.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=vc,x.AccountCapabilitiesSchema=Cp,x.AccountSchema=Ap,x.AccountsSchema=Rp,x.ActionMenuDropItem=mg,x.ActionMenuItem=ia,x.ApiError=ZS,x.AppBar=QP,x.AppLoadingSpinner=kc,x.AppProviderService=qS,x.AppTopBar=yg,x.AppWrapper=Cg,x.AppWrapperRoute=HI,x.ArchiverService=t0,x.Auth=Sl,x.AvatarUpload=cF,x.BatchActions=hg,x.Cache=nf,x.ClientService=c0,x.ClipboardActions=Zo,x.CompareSaveDialog=$$,x.ConflictDialog=Ha,x.ContextActionMenu=aa,x.ContextActions=gg,x.ContextMenuQuickAction=_c,x.CreateLinkModal=km,x.CreateShortcutModal=Em,x.CreateSpace=XP,x.CustomComponentTarget=M$,x.DateFilter=KF,x.DatePickerModal=EI,x.EVENT_FILE_DROPPED=IR,x.EVENT_TROW_CONTEXTMENU=FR,x.EVENT_TROW_MOUNTED=PR,x.EmojiPickerModal=Zm,x.EventBus=ff,x.FileInfo=Lc,x.FilePickerModal=Im,x.FileSideBar=Sg,x.FolderLoaderFavorites=Ff,x.FolderLoaderSharedViaLink=$f,x.FolderLoaderSharedWithMe=Of,x.FolderLoaderSharedWithOthers=Lf,x.FolderLoaderSpace=If,x.FolderLoaderTrashbin=_f,x.FolderService=Mf,x.FolderViewModeConstants=Ft,x.HttpClient=Tl,x.IdentitySchema=xp,x.ImageDimension=bs,x.ImageType=$R,x.ItemFilter=z$,x.ItemFilterInline=YF,x.ItemFilterToggle=q$,x.Key=jn,x.LimitsSchema=Ep,x.LinkRoleDropdown=Tm,x.LoadingEventTopics=Sr,x.LoadingIndicator=K$,x.LoadingService=r1,x.MailCapabilitiesSchema=Tp,x.MimeTypesToAppsSchema=cf,x.Modifier=Li,x.NoContentMessage=Y$,x.Pagination=tO,x.PaginationConstants=Ao,x.PasswordPolicyService=tT,x.PortalTarget=aO,x.PortalTargetEventTopics=sa,x.PreviewService=K1,x.PrimaryAccountsSchema=Dp,x.ProcessorType=Ci,x.QuotaModal=Km,x.QuotaSelect=Qm,x.RESOURCE_MAX_CHARACTER_LENGTH=OR,x.RESOURCE_NAME_MAX_BYTES=yc,x.RawConfigSchema=AS,x.RawGroupwareConfigSchema=Mk,x.ResolveStrategy=Sn,x.ResourceConflictModal=fd,x.ResourceGhostElement=Mc,x.ResourceIcon=ws,x.ResourceLink=Xi,x.ResourceListItem=Ss,x.ResourceName=bc,x.ResourcePreview=Am,x.ResourceSize=xg,x.ResourceTable=vF,x.ResourceTile=Eg,x.ResourceTiles=$F,x.ResourceTransfer=hd,x.RuntimeError=fo,x.SaveAsModal=Lm,x.SearchBarFilter=iO,x.SearchLocationFilterConstants=jr,x.SideBar=wg,x.SideBarEventTopics=eh,x.SideBarPanels=bg,x.SieveCapabilitiesSchema=kp,x.SortConstants=Cs,x.SpaceDetails=m$,x.SpaceDetailsMultiple=b$,x.SpaceImageModal=Mm,x.SpaceInfo=Oc,x.SpaceMoveInfoModal=dd,x.SpaceNoSelection=C$,x.SpaceQuota=Rg,x.TextEditor=O$,x.ThemeConfig=DC,x.TransferType=Xn,x.UnsavedChangesModal=Tg,x.UppyService=aT,x.UserAvatar=la,x.VersionCheck=hO,x.ViewOptions=vg,x.VisibilityObserver=xm,x.WebDavDetails=Dg,x.WebThemeConfig=Jp,x.activeApp=pl,x.authContextValues=mS,x.blobToArrayBuffer=bp,x.breadcrumbsFromPath=Ek,x.buildRoutes=BC,x.buildUrl=vS,x.cacheService=wl,x.canvasToBlob=wp,x.cloneStateObject=cd,x.compareVersions=bl,x.concatBreadcrumbs=Rk,x.contextQueryToFileContextProps=oh,x.contextRouteNameKey=Pi,x.contextRouteParamsKey=zl,x.contextRouteQueryKey=Ul,x.convertToMinimalUppyFile=rp,x.createDefaultFileIconMapping=gd,x.createFileRouteOptions=_n,x.createFolderDummyFile=np,x.createLocation=ao,x.createLocationCommon=lo,x.createLocationPublic=co,x.createLocationShares=an,x.createLocationSpaces=kn,x.createLocationTrash=wr,x.defaultFuseOptions=Wa,x.defineWebApplication=zg,x.determineResourceTableSortFields=af,x.determineResourceTilesSortFields=jS,x.dirname=Ke.dirname,x.displayPositionedDropdown=Ml,x.encodePath=vl,x.eventBus=ze,x.filterResources=Hy,x.focusCheckbox=DS,x.folderService=Nf,x.formatDateFromDateTime=Mr,x.formatDateFromHTTP=Dk,x.formatDateFromISO=gp,x.formatDateFromJSDate=mp,x.formatDateFromRFC=Pk,x.formatFileSize=Ht,x.formatRelativeDateFromDateTime=es,x.formatRelativeDateFromHTTP=Ik,x.formatRelativeDateFromISO=Fk,x.formatRelativeDateFromJSDate=vp,x.formatRelativeDateFromRFC=$k,x.getIndicators=Lk,x.getLocaleFromLanguage=Ei,x.getParentPaths=yp,x.getSharedAncestorRoute=RS,x.getSharedDriveItem=pi,x.getSpacesByType=rs,x.getTextByteSize=Nl,x.isItemInCurrentFolder=vd,x.isLocationActive=MC,x.isLocationActiveDirector=io,x.isLocationCommonActive=bt,x.isLocationPublicActive=ln,x.isLocationSharesActive=mt,x.isLocationSpacesActive=st,x.isLocationTrashActive=qt,x.isMacOs=ts,x.isPromiseFulfilled=Nr,x.isPromiseRejected=Br,x.isResourceBeeingMovedToSameLocation=pd,x.isSameResource=Uo,x.locationPublicLink=dl,x.locationPublicUpload=fl,x.locationSharesViaLink=ul,x.locationSharesWithMe=di,x.locationSharesWithOthers=cl,x.locationSpacesGeneric=ll,x.objectKeys=e0,x.parseVersion=yl,x.queryItemAsString=at,x.renameResource=Qa,x.resolveFileNameDuplicate=wn,x.resourceIconMappingInjectionKey=md,x.routeToContextQuery=Ii,x.setCurrentUserShareSpacePermissions=rf,x.sortFields=lf,x.sortHelper=dg,x.sortSpaceMembers=Yp,x.translateSortFields=zS,x.triggerDownloadWithFilename=gl,x.useAbility=Bt,x.useActionsShowDetails=HD,x.useActiveApp=gS,x.useActiveLocation=xn,x.useAppConfig=Zd,x.useAppDefaults=dh,x.useAppFileHandling=Vl,x.useAppFolderHandling=ih,x.useAppMeta=Wl,x.useAppNavigation=sh,x.useAppProviderService=QD,x.useAppsStore=Mn,x.useArchiverService=Rm,x.useAuthService=ql,x.useAuthStore=Lr,x.useAvatarsStore=fi,x.useBreadcrumbsFromPath=KD,x.useCanBeOpenedWithSecureView=rg,x.useCanListShares=Bm,x.useCanListVersions=og,x.useCanShare=jm,x.useCapabilityStore=Dt,x.useClientService=Pe,x.useClipboardStore=ns,x.useConfigStore=Ge,x.useCopyLink=gc,x.useCreateSpace=go,x.useCropperKeyboardActions=Ql,x.useDeleteWorker=fh,x.useDocumentTitle=ah,x.useDownloadFile=Sc,x.useDriveResolver=uh,x.useEmbedMode=Tr,x.useEventBus=rr,x.useExtensionPreferencesStore=Sp,x.useExtensionRegistry=ho,x.useFileActionFallbackToDownload=Um,x.useFileActions=An,x.useFileActionsCopy=Oi,x.useFileActionsCopyPermanentLink=Kl,x.useFileActionsCreateLink=ER,x.useFileActionsCreateNewFile=RR,x.useFileActionsCreateNewFolder=DR,x.useFileActionsCreateNewShortcut=sD,x.useFileActionsCreateSpaceFromResource=wc,x.useFileActionsDelete=Ts,x.useFileActionsDeleteResources=Vm,x.useFileActionsDisableSync=Yi,x.useFileActionsDownloadArchive=Zi,x.useFileActionsDownloadFile=xo,x.useFileActionsEmptyTrashBin=iD,x.useFileActionsEnableSync=ea,x.useFileActionsFavorite=Tc,x.useFileActionsMove=ta,x.useFileActionsNavigate=Dm,x.useFileActionsOpenShortcut=lD,x.useFileActionsOpenWithApp=$m,x.useFileActionsOpenWithDefault=Pm,x.useFileActionsPaste=Om,x.useFileActionsRename=na,x.useFileActionsRestore=ks,x.useFileActionsSaveAs=_m,x.useFileActionsSetImage=Nm,x.useFileActionsShowActions=xD,x.useFileActionsShowDetails=Cc,x.useFileActionsShowShares=xc,x.useFileActionsToggleHideShare=ra,x.useFileActionsUndoDelete=zm,x.useFileListHeaderPosition=GD,x.useFileRouteReplace=Ri,x.useFolderLink=Cr,x.useGetMatchingSpace=It,x.useGetResourceContext=sg,x.useGroupwareConfigStore=_k,x.useInterceptModifierClick=zr,x.useIsAppActive=AD,x.useIsFilesAppActive=lr,x.useIsResourceNameValid=Qr,x.useIsSearchActive=oa,x.useIsTopBarSticky=Ac,x.useKeyboardActions=_i,x.useLinkTypes=Ji,x.useLoadAvatars=pg,x.useLoadPreview=Rc,x.useLoadingService=Ut,x.useLocalStorage=Bl,x.useMessages=Me,x.useModals=Je,x.useOpenEmptyEditor=WD,x.useOpenWithDefaultApp=Jm,x.usePagination=JD,x.usePasswordPolicyService=tg,x.usePasteWorker=ph,x.usePortalTarget=ZD,x.usePreviewService=ng,x.useRequest=lh,x.useRequestHeaders=$i,x.useResourceContents=ag,x.useResourceIndicators=Dc,x.useResourceRouteResolver=Fm,x.useResourceViewContextMenu=lg,x.useResourceViewDrag=cg,x.useResourceViewHelpers=Pc,x.useResourceViewSelection=ug,x.useResourcesStore=De,x.useRestoreWorker=hh,x.useRoute=St,x.useRouteMeta=nh,x.useRouteName=jl,x.useRouteParam=Di,x.useRouteQuery=Pt,x.useRouteQueryPersisted=nr,x.useRouter=Re,x.useScrollTo=Cm,x.useSearch=Hl,x.useSelectedResources=Ic,x.useService=er,x.useSharesStore=tr,x.useSideBar=_t,x.useSort=sP,x.useSpaceActionsDelete=qm,x.useSpaceActionsDeleteImage=qD,x.useSpaceActionsDisable=Hm,x.useSpaceActionsDuplicate=Wm,x.useSpaceActionsEditDescription=RD,x.useSpaceActionsEditQuota=Gm,x.useSpaceActionsEditReadmeContent=ND,x.useSpaceActionsNavigateToTrash=jD,x.useSpaceActionsRename=Xm,x.useSpaceActionsRestore=Ym,x.useSpaceActionsSetIcon=VD,x.useSpaceActionsShowMembers=BD,x.useSpaceHelpers=Fi,x.useSpacesLoading=ch,x.useSpacesStore=He,x.useThemeStore=Bn,x.useTileSize=ig,x.useTokenTimerWorker=qC,x.useUpdatesStore=th,x.useUpload=uP,x.useUserStore=et,x.useViewMode=nP,x.useViewSize=rP,x.useViewSizeMax=Ec,x.useWebWorkersStore=ss,x.useWindowOpen=eg,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));