@opencloud-eu/web-pkg 0.1.1 → 2.0.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 (41) hide show
  1. package/dist/{TextEditor-dPv5RFiT.js → TextEditor-CBpP9DFX.js} +68 -51
  2. package/dist/assets/{worker-DzSy5ndr.js → worker-BCEWb3C6.js} +27 -27
  3. package/dist/assets/{worker-BTxctNFM.js → worker-BpDXOTOV.js} +18 -18
  4. package/dist/assets/{worker-oQBkmUkg.js → worker-Ds2rbROB.js} +26 -26
  5. package/dist/{index-B8n8dCfU.js → index-CPsauqxc.js} +12683 -12675
  6. package/dist/src/components/AppBar/AppBar.vue.d.ts +28 -31
  7. package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +71 -94
  8. package/dist/src/components/AppTopBar.vue.d.ts +13 -24
  9. package/dist/src/components/BatchActions.vue.d.ts +10 -11
  10. package/dist/src/components/ContextActions/ActionMenuItem.vue.d.ts +10 -11
  11. package/dist/src/components/ContextActions/ContextActionMenu.vue.d.ts +10 -20
  12. package/dist/src/components/CreateShortcutModal.vue.d.ts +3 -3
  13. package/dist/src/components/FilesList/ContextActions.vue.d.ts +10 -20
  14. package/dist/src/components/FilesList/ResourceLink.vue.d.ts +2 -2
  15. package/dist/src/components/FilesList/ResourceListItem.vue.d.ts +3 -3
  16. package/dist/src/components/FilesList/ResourceTable.vue.d.ts +15 -55
  17. package/dist/src/components/FilesList/ResourceTile.vue.d.ts +6 -6
  18. package/dist/src/components/FilesList/ResourceTiles.vue.d.ts +6 -6
  19. package/dist/src/components/Filters/DateFilter.vue.d.ts +196 -52
  20. package/dist/src/components/Search/ResourcePreview.vue.d.ts +3 -3
  21. package/dist/src/components/SideBar/FileSideBar.vue.d.ts +57 -69
  22. package/dist/src/components/SideBar/SideBar.vue.d.ts +39 -71
  23. package/dist/src/components/SideBar/Spaces/Details/SpaceDetails.vue.d.ts +1 -1
  24. package/dist/src/components/SpaceQuota.vue.d.ts +1 -1
  25. package/dist/src/components/Spaces/QuotaModal.vue.d.ts +1 -1
  26. package/dist/src/components/TextEditor/TextEditor.vue.d.ts +1 -0
  27. package/dist/src/components/TextEditor/index.d.ts +1 -0
  28. package/dist/src/components/ViewOptions.vue.d.ts +8 -0
  29. package/dist/src/composables/actions/files/useFileActions.d.ts +1 -1
  30. package/dist/src/composables/actions/types.d.ts +0 -1
  31. package/dist/src/composables/piniaStores/auth.d.ts +8 -7
  32. package/dist/src/composables/piniaStores/modals.d.ts +18 -20
  33. package/dist/src/composables/piniaStores/resources.d.ts +8 -2
  34. package/dist/src/composables/piniaStores/spaces.d.ts +8 -2
  35. package/dist/src/composables/piniaStores/theme.d.ts +56 -0
  36. package/dist/src/helpers/resource/icon.d.ts +2 -1
  37. package/dist/src/router/deprecated.d.ts +1 -1
  38. package/dist/src/router/utils.d.ts +2 -2
  39. package/dist/web-pkg.js +2 -2
  40. package/dist/web-pkg.umd.cjs +47 -43
  41. package/package.json +5 -5
@@ -1,68 +1,72 @@
1
- (function(j,ie){typeof exports=="object"&&typeof module<"u"?ie(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/drop-target"),require("pinia"),require("oidc-client-ts"),require("p-queue"),require("@vueuse/core"),require("dompurify"),require("mark.js"),require("vue-router"),require("portal-vue"),require("@vue/shared"),require("deepmerge"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("cropperjs")):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/drop-target","pinia","oidc-client-ts","p-queue","@vueuse/core","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull","cropperjs"],ie):(j=typeof globalThis<"u"?globalThis:j||self,ie(j["web-pkg"]={},j.webClient,j.vue,j.vue3Gettext,j.Fuse,j.lodashEs,j.globalAxios,j.uuid,j.fetchEventSource,j.vueConcurrency,j.luxon,j.filesize,j.qs,j.passwordSheriff,j.Uppy,j.Tus,j.XHRUpload,j.DropTarget,j.pinia,j.oidcClientTs,j.PQueue,j.core,j.DOMPurify,j.Mark,j.vueRouter,j.portalVue,j.shared,j.merge$1,j.mdEditorV3,j.zod,j.vue$1,j.screenfull,j.Cropper))})(this,function(j,ie,qt,Ne,id,Ct,Do,Qt,L0,cr,$t,B0,M0,j0,U0,q0,V0,z0,Qe,W0,Bn,Mn,od,sd,Lo,va,K,ad,Bo,ye,H0,G0,K0){"use strict";var tB=Object.defineProperty;var N0=j=>{throw TypeError(j)};var rB=(j,ie,qt)=>ie in j?tB(j,ie,{enumerable:!0,configurable:!0,writable:!0,value:qt}):j[ie]=qt;var Ee=(j,ie,qt)=>rB(j,typeof ie!="symbol"?ie+"":ie,qt),rd=(j,ie,qt)=>ie.has(j)||N0("Cannot "+qt);var Oe=(j,ie,qt)=>(rd(j,ie,"read from private field"),qt?qt.call(j):ie.get(j)),Sr=(j,ie,qt)=>ie.has(j)?N0("Cannot add the same private member more than once"):ie instanceof WeakSet?ie.add(j):ie.set(j,qt),Nt=(j,ie,qt,Ne)=>(rd(j,ie,"write to private field"),Ne?Ne.call(j,qt):ie.set(j,qt),qt),Ln=(j,ie,qt)=>(rd(j,ie,"access private method"),qt);var Kt,Zt,Tn,At,jt,kn,fi,Nn,nn,di,$o,pi,$0,$n,ba,nd,D0;const Q0=e=>e;function ld(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function X0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cd={exports:{}},Ot=cd.exports={},zr,Wr;function wa(){throw new Error("setTimeout has not been defined")}function Sa(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?zr=setTimeout:zr=wa}catch{zr=wa}try{typeof clearTimeout=="function"?Wr=clearTimeout:Wr=Sa}catch{Wr=Sa}})();function ud(e){if(zr===setTimeout)return setTimeout(e,0);if((zr===wa||!zr)&&setTimeout)return zr=setTimeout,setTimeout(e,0);try{return zr(e,0)}catch{try{return zr.call(null,e,0)}catch{return zr.call(this,e,0)}}}function Y0(e){if(Wr===clearTimeout)return clearTimeout(e);if((Wr===Sa||!Wr)&&clearTimeout)return Wr=clearTimeout,clearTimeout(e);try{return Wr(e)}catch{try{return Wr.call(null,e)}catch{return Wr.call(this,e)}}}var sn=[],hi=!1,jn,Mo=-1;function J0(){!hi||!jn||(hi=!1,jn.length?sn=jn.concat(sn):Mo=-1,sn.length&&fd())}function fd(){if(!hi){var e=ud(J0);hi=!0;for(var t=sn.length;t;){for(jn=sn,sn=[];++Mo<t;)jn&&jn[Mo].run();Mo=-1,t=sn.length}jn=null,hi=!1,Y0(e)}}Ot.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];sn.push(new dd(e,t)),sn.length===1&&!hi&&ud(fd)};function dd(e,t){this.fun=e,this.array=t}dd.prototype.run=function(){this.fun.apply(null,this.array)},Ot.title="browser",Ot.browser=!0,Ot.env={},Ot.argv=[],Ot.version="",Ot.versions={};function an(){}Ot.on=an,Ot.addListener=an,Ot.once=an,Ot.off=an,Ot.removeListener=an,Ot.removeAllListeners=an,Ot.emit=an,Ot.prependListener=an,Ot.prependOnceListener=an,Ot.listeners=function(e){return[]},Ot.binding=function(e){throw new Error("process.binding is not supported")},Ot.cwd=function(){return"/"},Ot.chdir=function(e){throw new Error("process.chdir is not supported")},Ot.umask=function(){return 0};var Z0=cd.exports;const me=X0(Z0);function ln(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let st;const Ea=new WeakSet;class ew{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,Ea.has(this)&&(Ea.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vd(this),gd(this);const t=st,r=Mr;st=this,Mr=!0;try{return this.fn()}finally{me.env.NODE_ENV!=="production"&&st!==this&&ln("Active effect was not restored correctly - this is likely a Vue internal bug."),md(this),st=t,Mr=r,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)_a(t);this.deps=this.depsTail=void 0,vd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ea.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ra(this)&&this.run()}get dirty(){return Ra(this)}}let pd=0,ji,Ui;function hd(e,t=!1){if(e.flags|=8,t){e.next=Ui,Ui=e;return}e.next=ji,ji=e}function Ta(){pd++}function Aa(){if(--pd>0)return;if(Ui){let t=Ui;for(Ui=void 0;t;){const r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;for(;ji;){let t=ji;for(ji=void 0;t;){const r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=r}}if(e)throw e}function gd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function md(e){let t,r=e.depsTail,n=r;for(;n;){const o=n.prevDep;n.version===-1?(n===r&&(r=o),_a(n),tw(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=r}function Ra(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zi))return;e.globalVersion=zi;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Ra(e)){e.flags&=-3;return}const r=st,n=Mr;st=e,Mr=!0;try{gd(e);const o=e.fn(e._value);(t.version===0||K.hasChanged(o,e._value))&&(e._value=o,t.version++)}catch(o){throw t.version++,o}finally{st=r,Mr=n,md(e),e.flags&=-3}}function _a(e,t=!1){const{dep:r,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),me.env.NODE_ENV!=="production"&&r.subsHead===e&&(r.subsHead=o),r.subs===e&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let i=r.computed.deps;i;i=i.nextDep)_a(i,!0)}!t&&!--r.sc&&r.map&&r.map.delete(r.key)}function tw(e){const{prevDep:t,nextDep:r}=e;t&&(t.nextDep=r,e.prevDep=void 0),r&&(r.prevDep=t,e.nextDep=void 0)}let Mr=!0;const bd=[];function qi(){bd.push(Mr),Mr=!1}function Vi(){const e=bd.pop();Mr=e===void 0?!0:e}function vd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const r=st;st=void 0;try{t()}finally{st=r}}}let zi=0;class rw{constructor(t,r){this.sub=t,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class jo{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,me.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!st||!Mr||st===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==st)r=this.activeLink=new rw(st,this),st.deps?(r.prevDep=st.depsTail,st.depsTail.nextDep=r,st.depsTail=r):st.deps=st.depsTail=r,wd(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const n=r.nextDep;n.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=n),r.prevDep=st.depsTail,r.nextDep=void 0,st.depsTail.nextDep=r,st.depsTail=r,st.deps===r&&(st.deps=n)}return me.env.NODE_ENV!=="production"&&st.onTrack&&st.onTrack(K.extend({effect:st},t)),r}trigger(t){this.version++,zi++,this.notify(t)}notify(t){Ta();try{if(me.env.NODE_ENV!=="production")for(let r=this.subsHead;r;r=r.nextSub)r.sub.onTrigger&&!(r.sub.flags&8)&&r.sub.onTrigger(K.extend({effect:r.sub},t));for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{Aa()}}}function wd(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)wd(n)}const r=e.dep.subs;r!==e&&(e.prevSub=r,r&&(r.nextSub=e)),me.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Uo=new WeakMap,Un=Symbol(me.env.NODE_ENV!=="production"?"Object iterate":""),Ia=Symbol(me.env.NODE_ENV!=="production"?"Map keys iterate":""),Wi=Symbol(me.env.NODE_ENV!=="production"?"Array iterate":"");function er(e,t,r){if(Mr&&st){let n=Uo.get(e);n||Uo.set(e,n=new Map);let o=n.get(r);o||(n.set(r,o=new jo),o.map=n,o.key=r),me.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:r}):o.track()}}function An(e,t,r,n,o,i){const s=Uo.get(e);if(!s){zi++;return}const l=c=>{c&&(me.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:r,newValue:n,oldValue:o,oldTarget:i}):c.trigger())};if(Ta(),t==="clear")s.forEach(l);else{const c=K.isArray(e),u=c&&K.isIntegerKey(r);if(c&&r==="length"){const a=Number(n);s.forEach((f,d)=>{(d==="length"||d===Wi||!K.isSymbol(d)&&d>=a)&&l(f)})}else switch((r!==void 0||s.has(void 0))&&l(s.get(r)),u&&l(s.get(Wi)),t){case"add":c?u&&l(s.get("length")):(l(s.get(Un)),K.isMap(e)&&l(s.get(Ia)));break;case"delete":c||(l(s.get(Un)),K.isMap(e)&&l(s.get(Ia)));break;case"set":K.isMap(e)&&l(s.get(Un));break}}Aa()}function nw(e,t){const r=Uo.get(e);return r&&r.get(t)}function gi(e){const t=nt(e);return t===e?t:(er(t,"iterate",Wi),ur(e)?t:t.map(ir))}function qo(e){return er(e=nt(e),"iterate",Wi),e}const iw={__proto__:null,[Symbol.iterator](){return Ca(this,Symbol.iterator,ir)},concat(...e){return gi(this).concat(...e.map(t=>K.isArray(t)?gi(t):t))},entries(){return Ca(this,"entries",e=>(e[1]=ir(e[1]),e))},every(e,t){return cn(this,"every",e,t,void 0,arguments)},filter(e,t){return cn(this,"filter",e,t,r=>r.map(ir),arguments)},find(e,t){return cn(this,"find",e,t,ir,arguments)},findIndex(e,t){return cn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return cn(this,"findLast",e,t,ir,arguments)},findLastIndex(e,t){return cn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return cn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Fa(this,"includes",e)},indexOf(...e){return Fa(this,"indexOf",e)},join(e){return gi(this).join(e)},lastIndexOf(...e){return Fa(this,"lastIndexOf",e)},map(e,t){return cn(this,"map",e,t,void 0,arguments)},pop(){return Hi(this,"pop")},push(...e){return Hi(this,"push",e)},reduce(e,...t){return Sd(this,"reduce",e,t)},reduceRight(e,...t){return Sd(this,"reduceRight",e,t)},shift(){return Hi(this,"shift")},some(e,t){return cn(this,"some",e,t,void 0,arguments)},splice(...e){return Hi(this,"splice",e)},toReversed(){return gi(this).toReversed()},toSorted(e){return gi(this).toSorted(e)},toSpliced(...e){return gi(this).toSpliced(...e)},unshift(...e){return Hi(this,"unshift",e)},values(){return Ca(this,"values",ir)}};function Ca(e,t,r){const n=qo(e),o=n[t]();return n!==e&&!ur(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=r(i.value)),i}),o}const ow=Array.prototype;function cn(e,t,r,n,o,i){const s=qo(e),l=s!==e&&!ur(e),c=s[t];if(c!==ow[t]){const f=c.apply(e,i);return l?ir(f):f}let u=r;s!==e&&(l?u=function(f,d){return r.call(this,ir(f),d,e)}:r.length>2&&(u=function(f,d){return r.call(this,f,d,e)}));const a=c.call(s,u,n);return l&&o?o(a):a}function Sd(e,t,r,n){const o=qo(e);let i=r;return o!==e&&(ur(e)?r.length>3&&(i=function(s,l,c){return r.call(this,s,l,c,e)}):i=function(s,l,c){return r.call(this,s,ir(l),c,e)}),o[t](i,...n)}function Fa(e,t,r){const n=nt(e);er(n,"iterate",Wi);const o=n[t](...r);return(o===-1||o===!1)&&Ho(r[0])?(r[0]=nt(r[0]),n[t](...r)):o}function Hi(e,t,r=[]){qi(),Ta();const n=nt(e)[t].apply(e,r);return Aa(),Vi(),n}const sw=K.makeMap("__proto__,__v_isRef,__isVue"),Ed=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(K.isSymbol));function aw(e){K.isSymbol(e)||(e=String(e));const t=nt(this);return er(t,"has",e),t.hasOwnProperty(e)}class Td{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){if(r==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(r==="__v_isReactive")return!o;if(r==="__v_isReadonly")return o;if(r==="__v_isShallow")return i;if(r==="__v_raw")return n===(o?i?Cd:Id:i?yw:_d).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const s=K.isArray(t);if(!o){let c;if(s&&(c=iw[r]))return c;if(r==="hasOwnProperty")return aw}const l=Reflect.get(t,r,Dt(t)?t:n);return(K.isSymbol(r)?Ed.has(r):sw(r))||(o||er(t,"get",r),i)?l:Dt(l)?s&&K.isIntegerKey(r)?l:l.value:K.isObject(l)?o?un(l):Oa(l):l}}class lw extends Td{constructor(t=!1){super(!1,t)}set(t,r,n,o){let i=t[r];if(!this._isShallow){const c=fn(i);if(!ur(n)&&!fn(n)&&(i=nt(i),n=nt(n)),!K.isArray(t)&&Dt(i)&&!Dt(n))return c?!1:(i.value=n,!0)}const s=K.isArray(t)&&K.isIntegerKey(r)?Number(r)<t.length:K.hasOwn(t,r),l=Reflect.set(t,r,n,Dt(t)?t:o);return t===nt(o)&&(s?K.hasChanged(n,i)&&An(t,"set",r,n,i):An(t,"add",r,n)),l}deleteProperty(t,r){const n=K.hasOwn(t,r),o=t[r],i=Reflect.deleteProperty(t,r);return i&&n&&An(t,"delete",r,void 0,o),i}has(t,r){const n=Reflect.has(t,r);return(!K.isSymbol(r)||!Ed.has(r))&&er(t,"has",r),n}ownKeys(t){return er(t,"iterate",K.isArray(t)?"length":Un),Reflect.ownKeys(t)}}class Ad extends Td{constructor(t=!1){super(!0,t)}set(t,r){return me.env.NODE_ENV!=="production"&&ln(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return me.env.NODE_ENV!=="production"&&ln(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const cw=new lw,uw=new Ad,fw=new Ad(!0),Pa=e=>e,Vo=e=>Reflect.getPrototypeOf(e);function dw(e,t,r){return function(...n){const o=this.__v_raw,i=nt(o),s=K.isMap(i),l=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...n),a=r?Pa:t?Na:ir;return!t&&er(i,"iterate",c?Ia:Un),{next(){const{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:l?[a(f[0]),a(f[1])]:a(f),done:d}},[Symbol.iterator](){return this}}}}function zo(e){return function(...t){if(me.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";ln(`${K.capitalize(e)} operation ${r}failed: target is readonly.`,nt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function pw(e,t){const r={get(o){const i=this.__v_raw,s=nt(i),l=nt(o);e||(K.hasChanged(o,l)&&er(s,"get",o),er(s,"get",l));const{has:c}=Vo(s),u=t?Pa:e?Na:ir;if(c.call(s,o))return u(i.get(o));if(c.call(s,l))return u(i.get(l));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!e&&er(nt(o),"iterate",Un),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=nt(i),l=nt(o);return e||(K.hasChanged(o,l)&&er(s,"has",o),er(s,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const s=this,l=s.__v_raw,c=nt(l),u=t?Pa:e?Na:ir;return!e&&er(c,"iterate",Un),l.forEach((a,f)=>o.call(i,u(a),u(f),s))}};return K.extend(r,e?{add:zo("add"),set:zo("set"),delete:zo("delete"),clear:zo("clear")}:{add(o){!t&&!ur(o)&&!fn(o)&&(o=nt(o));const i=nt(this);return Vo(i).has.call(i,o)||(i.add(o),An(i,"add",o,o)),this},set(o,i){!t&&!ur(i)&&!fn(i)&&(i=nt(i));const s=nt(this),{has:l,get:c}=Vo(s);let u=l.call(s,o);u?me.env.NODE_ENV!=="production"&&Rd(s,l,o):(o=nt(o),u=l.call(s,o));const a=c.call(s,o);return s.set(o,i),u?K.hasChanged(i,a)&&An(s,"set",o,i,a):An(s,"add",o,i),this},delete(o){const i=nt(this),{has:s,get:l}=Vo(i);let c=s.call(i,o);c?me.env.NODE_ENV!=="production"&&Rd(i,s,o):(o=nt(o),c=s.call(i,o));const u=l?l.call(i,o):void 0,a=i.delete(o);return c&&An(i,"delete",o,void 0,u),a},clear(){const o=nt(this),i=o.size!==0,s=me.env.NODE_ENV!=="production"?K.isMap(o)?new Map(o):new Set(o):void 0,l=o.clear();return i&&An(o,"clear",void 0,void 0,s),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{r[o]=dw(o,e,t)}),r}function xa(e,t){const r=pw(e,t);return(n,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(K.hasOwn(r,o)&&o in n?r:n,o,i)}const hw={get:xa(!1,!1)},gw={get:xa(!0,!1)},mw={get:xa(!0,!0)};function Rd(e,t,r){const n=nt(r);if(n!==r&&t.call(e,n)){const o=K.toRawType(e);ln(`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 _d=new WeakMap,yw=new WeakMap,Id=new WeakMap,Cd=new WeakMap;function bw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function vw(e){return e.__v_skip||!Object.isExtensible(e)?0:bw(K.toRawType(e))}function Oa(e){return fn(e)?e:ka(e,!1,cw,hw,_d)}function un(e){return ka(e,!0,uw,gw,Id)}function Wo(e){return ka(e,!0,fw,mw,Cd)}function ka(e,t,r,n,o){if(!K.isObject(e))return me.env.NODE_ENV!=="production"&&ln(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=vw(e);if(s===0)return e;const l=new Proxy(e,s===2?n:r);return o.set(e,l),l}function qn(e){return fn(e)?qn(e.__v_raw):!!(e&&e.__v_isReactive)}function fn(e){return!!(e&&e.__v_isReadonly)}function ur(e){return!!(e&&e.__v_isShallow)}function Ho(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function ww(e){return!K.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&K.def(e,"__v_skip",!0),e}const ir=e=>K.isObject(e)?Oa(e):e,Na=e=>K.isObject(e)?un(e):e;function Dt(e){return e?e.__v_isRef===!0:!1}function ue(e){return Fd(e,!1)}function Sw(e){return Fd(e,!0)}function Fd(e,t){return Dt(e)?e:new Ew(e,t)}class Ew{constructor(t,r){this.dep=new jo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?t:nt(t),this._value=r?t:ir(t),this.__v_isShallow=r}get value(){return me.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const r=this._rawValue,n=this.__v_isShallow||ur(t)||fn(t);t=n?t:nt(t),K.hasChanged(t,r)&&(this._rawValue=t,this._value=n?t:ir(t),me.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:r}):this.dep.trigger())}}function y(e){return Dt(e)?e.value:e}const Tw={get:(e,t,r)=>t==="__v_raw"?e:y(Reflect.get(e,t,r)),set:(e,t,r,n)=>{const o=e[t];return Dt(o)&&!Dt(r)?(o.value=r,!0):Reflect.set(e,t,r,n)}};function Aw(e){return qn(e)?e:new Proxy(e,Tw)}class Rw{constructor(t){this.__v_isRef=!0,this._value=void 0;const r=this.dep=new jo,{get:n,set:o}=t(r.track.bind(r),r.trigger.bind(r));this._get=n,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Pd(e){return new Rw(e)}class _w{constructor(t,r,n){this._object=t,this._key=r,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return nw(nt(this._object),this._key)}}class Iw{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 Cw(e,t,r){return Dt(e)?e:K.isFunction(e)?new Iw(e):K.isObject(e)&&arguments.length>1?Fw(e,t,r):ue(e)}function Fw(e,t,r){const n=e[t];return Dt(n)?n:new _w(e,t,r)}class Pw{constructor(t,r,n){this.fn=t,this.setter=r,this._value=void 0,this.dep=new jo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&st!==this)return hd(this,!0),!0;me.env.NODE_ENV}get value(){const t=me.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return yd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):me.env.NODE_ENV!=="production"&&ln("Write operation failed: computed value is readonly")}}function xw(e,t,r=!1){let n,o;K.isFunction(e)?n=e:(n=e.get,o=e.set);const i=new Pw(n,o,r);return me.env.NODE_ENV,i}const Go={},Ko=new WeakMap;let Vn;function Ow(e,t=!1,r=Vn){if(r){let n=Ko.get(r);n||Ko.set(r,n=[]),n.push(e)}else me.env.NODE_ENV!=="production"&&!t&&ln("onWatcherCleanup() was called when there was no active watcher to associate with.")}function kw(e,t,r=K.EMPTY_OBJ){const{immediate:n,deep:o,once:i,scheduler:s,augmentJob:l,call:c}=r,u=v=>{(r.onWarn||ln)("Invalid watch source: ",v,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},a=v=>o?v:ur(v)||o===!1||o===0?dn(v,1):dn(v);let f,d,b,E,w=!1,R=!1;if(Dt(e)?(d=()=>e.value,w=ur(e)):qn(e)?(d=()=>a(e),w=!0):K.isArray(e)?(R=!0,w=e.some(v=>qn(v)||ur(v)),d=()=>e.map(v=>{if(Dt(v))return v.value;if(qn(v))return a(v);if(K.isFunction(v))return c?c(v,2):v();me.env.NODE_ENV!=="production"&&u(v)})):K.isFunction(e)?t?d=c?()=>c(e,2):e:d=()=>{if(b){qi();try{b()}finally{Vi()}}const v=Vn;Vn=f;try{return c?c(e,3,[E]):e(E)}finally{Vn=v}}:(d=K.NOOP,me.env.NODE_ENV!=="production"&&u(e)),t&&o){const v=d,T=o===!0?1/0:o;d=()=>dn(v(),T)}const S=()=>{f.stop()};if(i&&t){const v=t;t=(...T)=>{v(...T),S()}}let m=R?new Array(e.length).fill(Go):Go;const g=v=>{if(!(!(f.flags&1)||!f.dirty&&!v))if(t){const T=f.run();if(o||w||(R?T.some((A,F)=>K.hasChanged(A,m[F])):K.hasChanged(T,m))){b&&b();const A=Vn;Vn=f;try{const F=[T,m===Go?void 0:R&&m[0]===Go?[]:m,E];c?c(t,3,F):t(...F),m=T}finally{Vn=A}}}else f.run()};return l&&l(g),f=new ew(d),f.scheduler=s?()=>s(g,!1):g,E=v=>Ow(v,!1,f),b=f.onStop=()=>{const v=Ko.get(f);if(v){if(c)c(v,4);else for(const T of v)T();Ko.delete(f)}},me.env.NODE_ENV!=="production"&&(f.onTrack=r.onTrack,f.onTrigger=r.onTrigger),t?n?g(!0):m=f.run():s?s(g.bind(null,!0),!0):f.run(),S.pause=f.pause.bind(f),S.resume=f.resume.bind(f),S.stop=S,S}function dn(e,t=1/0,r){if(t<=0||!K.isObject(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,Dt(e))dn(e.value,t,r);else if(K.isArray(e))for(let n=0;n<e.length;n++)dn(e[n],t,r);else if(K.isSet(e)||K.isMap(e))e.forEach(n=>{dn(n,t,r)});else if(K.isPlainObject(e)){for(const n in e)dn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&dn(e[n],t,r)}return e}const zn=[];function Nw(e){zn.push(e)}function $w(){zn.pop()}let $a=!1;function tt(e,...t){if($a)return;$a=!0,qi();const r=zn.length?zn[zn.length-1].component:null,n=r&&r.appContext.config.warnHandler,o=Dw();if(n)Qo(n,r,11,[e+t.map(i=>{var s,l;return(l=(s=i.toString)==null?void 0:s.call(i))!=null?l:JSON.stringify(i)}).join(""),r&&r.proxy,o.map(({vnode:i})=>`at <${gp(r,i.type)}>`).join(`
1
+ (function(j,ie){typeof exports=="object"&&typeof module<"u"?ie(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/drop-target"),require("pinia"),require("oidc-client-ts"),require("p-queue"),require("@vueuse/core"),require("dompurify"),require("mark.js"),require("vue-router"),require("portal-vue"),require("@vue/shared"),require("deepmerge"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("cropperjs")):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/drop-target","pinia","oidc-client-ts","p-queue","@vueuse/core","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull","cropperjs"],ie):(j=typeof globalThis<"u"?globalThis:j||self,ie(j["web-pkg"]={},j.webClient,j.vue,j.vue3Gettext,j.Fuse,j.lodashEs,j.globalAxios,j.uuid,j.fetchEventSource,j.vueConcurrency,j.luxon,j.filesize,j.qs,j.passwordSheriff,j.Uppy,j.Tus,j.XHRUpload,j.DropTarget,j.pinia,j.oidcClientTs,j.PQueue,j.core,j.DOMPurify,j.Mark,j.vueRouter,j.portalVue,j.shared,j.merge$1,j.mdEditorV3,j.zod,j.vue$1,j.screenfull,j.Cropper))})(this,function(j,ie,Ut,$e,id,Et,Do,Qt,k0,lr,Dt,N0,$0,D0,L0,B0,M0,j0,Ge,U0,Bn,Mn,od,sd,Lo,wa,K,ad,Bo,ge,q0,V0,z0){"use strict";var eB=Object.defineProperty;var P0=j=>{throw TypeError(j)};var tB=(j,ie,Ut)=>ie in j?eB(j,ie,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):j[ie]=Ut;var Ee=(j,ie,Ut)=>tB(j,typeof ie!="symbol"?ie+"":ie,Ut),rd=(j,ie,Ut)=>ie.has(j)||P0("Cannot "+Ut);var Ne=(j,ie,Ut)=>(rd(j,ie,"read from private field"),Ut?Ut.call(j):ie.get(j)),Sr=(j,ie,Ut)=>ie.has(j)?P0("Cannot add the same private member more than once"):ie instanceof WeakSet?ie.add(j):ie.set(j,Ut),$t=(j,ie,Ut,$e)=>(rd(j,ie,"write to private field"),$e?$e.call(j,Ut):ie.set(j,Ut),Ut),Ln=(j,ie,Ut)=>(rd(j,ie,"access private method"),Ut);var Kt,Zt,An,Rt,Mt,kn,fi,Nn,nn,di,$o,pi,x0,$n,va,nd,O0;const W0=e=>e;function ld(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function H0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cd={exports:{}},Ot=cd.exports={},zr,Wr;function Sa(){throw new Error("setTimeout has not been defined")}function Ea(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?zr=setTimeout:zr=Sa}catch{zr=Sa}try{typeof clearTimeout=="function"?Wr=clearTimeout:Wr=Ea}catch{Wr=Ea}})();function ud(e){if(zr===setTimeout)return setTimeout(e,0);if((zr===Sa||!zr)&&setTimeout)return zr=setTimeout,setTimeout(e,0);try{return zr(e,0)}catch{try{return zr.call(null,e,0)}catch{return zr.call(this,e,0)}}}function G0(e){if(Wr===clearTimeout)return clearTimeout(e);if((Wr===Ea||!Wr)&&clearTimeout)return Wr=clearTimeout,clearTimeout(e);try{return Wr(e)}catch{try{return Wr.call(null,e)}catch{return Wr.call(this,e)}}}var sn=[],hi=!1,jn,Mo=-1;function K0(){!hi||!jn||(hi=!1,jn.length?sn=jn.concat(sn):Mo=-1,sn.length&&fd())}function fd(){if(!hi){var e=ud(K0);hi=!0;for(var t=sn.length;t;){for(jn=sn,sn=[];++Mo<t;)jn&&jn[Mo].run();Mo=-1,t=sn.length}jn=null,hi=!1,G0(e)}}Ot.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];sn.push(new dd(e,t)),sn.length===1&&!hi&&ud(fd)};function dd(e,t){this.fun=e,this.array=t}dd.prototype.run=function(){this.fun.apply(null,this.array)},Ot.title="browser",Ot.browser=!0,Ot.env={},Ot.argv=[],Ot.version="",Ot.versions={};function an(){}Ot.on=an,Ot.addListener=an,Ot.once=an,Ot.off=an,Ot.removeListener=an,Ot.removeAllListeners=an,Ot.emit=an,Ot.prependListener=an,Ot.prependOnceListener=an,Ot.listeners=function(e){return[]},Ot.binding=function(e){throw new Error("process.binding is not supported")},Ot.cwd=function(){return"/"},Ot.chdir=function(e){throw new Error("process.chdir is not supported")},Ot.umask=function(){return 0};var Q0=cd.exports;const ye=H0(Q0);function ln(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let st;const Ta=new WeakSet;class X0{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,Ta.has(this)&&(Ta.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vd(this),gd(this);const t=st,r=Mr;st=this,Mr=!0;try{return this.fn()}finally{ye.env.NODE_ENV!=="production"&&st!==this&&ln("Active effect was not restored correctly - this is likely a Vue internal bug."),md(this),st=t,Mr=r,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ia(t);this.deps=this.depsTail=void 0,vd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ta.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_a(this)&&this.run()}get dirty(){return _a(this)}}let pd=0,ji,Ui;function hd(e,t=!1){if(e.flags|=8,t){e.next=Ui,Ui=e;return}e.next=ji,ji=e}function Aa(){pd++}function Ra(){if(--pd>0)return;if(Ui){let t=Ui;for(Ui=void 0;t;){const r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;for(;ji;){let t=ji;for(ji=void 0;t;){const r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=r}}if(e)throw e}function gd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function md(e){let t,r=e.depsTail,n=r;for(;n;){const o=n.prevDep;n.version===-1?(n===r&&(r=o),Ia(n),Y0(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=r}function _a(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===zi))return;e.globalVersion=zi;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!_a(e)){e.flags&=-3;return}const r=st,n=Mr;st=e,Mr=!0;try{gd(e);const o=e.fn(e._value);(t.version===0||K.hasChanged(o,e._value))&&(e._value=o,t.version++)}catch(o){throw t.version++,o}finally{st=r,Mr=n,md(e),e.flags&=-3}}function Ia(e,t=!1){const{dep:r,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),ye.env.NODE_ENV!=="production"&&r.subsHead===e&&(r.subsHead=o),r.subs===e&&(r.subs=n,!n&&r.computed)){r.computed.flags&=-5;for(let i=r.computed.deps;i;i=i.nextDep)Ia(i,!0)}!t&&!--r.sc&&r.map&&r.map.delete(r.key)}function Y0(e){const{prevDep:t,nextDep:r}=e;t&&(t.nextDep=r,e.prevDep=void 0),r&&(r.prevDep=t,e.nextDep=void 0)}let Mr=!0;const bd=[];function qi(){bd.push(Mr),Mr=!1}function Vi(){const e=bd.pop();Mr=e===void 0?!0:e}function vd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const r=st;st=void 0;try{t()}finally{st=r}}}let zi=0;class J0{constructor(t,r){this.sub=t,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class jo{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,ye.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!st||!Mr||st===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==st)r=this.activeLink=new J0(st,this),st.deps?(r.prevDep=st.depsTail,st.depsTail.nextDep=r,st.depsTail=r):st.deps=st.depsTail=r,wd(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const n=r.nextDep;n.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=n),r.prevDep=st.depsTail,r.nextDep=void 0,st.depsTail.nextDep=r,st.depsTail=r,st.deps===r&&(st.deps=n)}return ye.env.NODE_ENV!=="production"&&st.onTrack&&st.onTrack(K.extend({effect:st},t)),r}trigger(t){this.version++,zi++,this.notify(t)}notify(t){Aa();try{if(ye.env.NODE_ENV!=="production")for(let r=this.subsHead;r;r=r.nextSub)r.sub.onTrigger&&!(r.sub.flags&8)&&r.sub.onTrigger(K.extend({effect:r.sub},t));for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{Ra()}}}function wd(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)wd(n)}const r=e.dep.subs;r!==e&&(e.prevSub=r,r&&(r.nextSub=e)),ye.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Uo=new WeakMap,Un=Symbol(ye.env.NODE_ENV!=="production"?"Object iterate":""),Ca=Symbol(ye.env.NODE_ENV!=="production"?"Map keys iterate":""),Wi=Symbol(ye.env.NODE_ENV!=="production"?"Array iterate":"");function er(e,t,r){if(Mr&&st){let n=Uo.get(e);n||Uo.set(e,n=new Map);let o=n.get(r);o||(n.set(r,o=new jo),o.map=n,o.key=r),ye.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:r}):o.track()}}function Rn(e,t,r,n,o,i){const s=Uo.get(e);if(!s){zi++;return}const l=c=>{c&&(ye.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:r,newValue:n,oldValue:o,oldTarget:i}):c.trigger())};if(Aa(),t==="clear")s.forEach(l);else{const c=K.isArray(e),u=c&&K.isIntegerKey(r);if(c&&r==="length"){const a=Number(n);s.forEach((f,d)=>{(d==="length"||d===Wi||!K.isSymbol(d)&&d>=a)&&l(f)})}else switch((r!==void 0||s.has(void 0))&&l(s.get(r)),u&&l(s.get(Wi)),t){case"add":c?u&&l(s.get("length")):(l(s.get(Un)),K.isMap(e)&&l(s.get(Ca)));break;case"delete":c||(l(s.get(Un)),K.isMap(e)&&l(s.get(Ca)));break;case"set":K.isMap(e)&&l(s.get(Un));break}}Ra()}function Z0(e,t){const r=Uo.get(e);return r&&r.get(t)}function gi(e){const t=nt(e);return t===e?t:(er(t,"iterate",Wi),cr(e)?t:t.map(ir))}function qo(e){return er(e=nt(e),"iterate",Wi),e}const ew={__proto__:null,[Symbol.iterator](){return Fa(this,Symbol.iterator,ir)},concat(...e){return gi(this).concat(...e.map(t=>K.isArray(t)?gi(t):t))},entries(){return Fa(this,"entries",e=>(e[1]=ir(e[1]),e))},every(e,t){return cn(this,"every",e,t,void 0,arguments)},filter(e,t){return cn(this,"filter",e,t,r=>r.map(ir),arguments)},find(e,t){return cn(this,"find",e,t,ir,arguments)},findIndex(e,t){return cn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return cn(this,"findLast",e,t,ir,arguments)},findLastIndex(e,t){return cn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return cn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Pa(this,"includes",e)},indexOf(...e){return Pa(this,"indexOf",e)},join(e){return gi(this).join(e)},lastIndexOf(...e){return Pa(this,"lastIndexOf",e)},map(e,t){return cn(this,"map",e,t,void 0,arguments)},pop(){return Hi(this,"pop")},push(...e){return Hi(this,"push",e)},reduce(e,...t){return Sd(this,"reduce",e,t)},reduceRight(e,...t){return Sd(this,"reduceRight",e,t)},shift(){return Hi(this,"shift")},some(e,t){return cn(this,"some",e,t,void 0,arguments)},splice(...e){return Hi(this,"splice",e)},toReversed(){return gi(this).toReversed()},toSorted(e){return gi(this).toSorted(e)},toSpliced(...e){return gi(this).toSpliced(...e)},unshift(...e){return Hi(this,"unshift",e)},values(){return Fa(this,"values",ir)}};function Fa(e,t,r){const n=qo(e),o=n[t]();return n!==e&&!cr(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=r(i.value)),i}),o}const tw=Array.prototype;function cn(e,t,r,n,o,i){const s=qo(e),l=s!==e&&!cr(e),c=s[t];if(c!==tw[t]){const f=c.apply(e,i);return l?ir(f):f}let u=r;s!==e&&(l?u=function(f,d){return r.call(this,ir(f),d,e)}:r.length>2&&(u=function(f,d){return r.call(this,f,d,e)}));const a=c.call(s,u,n);return l&&o?o(a):a}function Sd(e,t,r,n){const o=qo(e);let i=r;return o!==e&&(cr(e)?r.length>3&&(i=function(s,l,c){return r.call(this,s,l,c,e)}):i=function(s,l,c){return r.call(this,s,ir(l),c,e)}),o[t](i,...n)}function Pa(e,t,r){const n=nt(e);er(n,"iterate",Wi);const o=n[t](...r);return(o===-1||o===!1)&&Ho(r[0])?(r[0]=nt(r[0]),n[t](...r)):o}function Hi(e,t,r=[]){qi(),Aa();const n=nt(e)[t].apply(e,r);return Ra(),Vi(),n}const rw=K.makeMap("__proto__,__v_isRef,__isVue"),Ed=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(K.isSymbol));function nw(e){K.isSymbol(e)||(e=String(e));const t=nt(this);return er(t,"has",e),t.hasOwnProperty(e)}class Td{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){if(r==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(r==="__v_isReactive")return!o;if(r==="__v_isReadonly")return o;if(r==="__v_isShallow")return i;if(r==="__v_raw")return n===(o?i?Cd:Id:i?pw:_d).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const s=K.isArray(t);if(!o){let c;if(s&&(c=ew[r]))return c;if(r==="hasOwnProperty")return nw}const l=Reflect.get(t,r,Lt(t)?t:n);return(K.isSymbol(r)?Ed.has(r):rw(r))||(o||er(t,"get",r),i)?l:Lt(l)?s&&K.isIntegerKey(r)?l:l.value:K.isObject(l)?o?un(l):ka(l):l}}class iw extends Td{constructor(t=!1){super(!1,t)}set(t,r,n,o){let i=t[r];if(!this._isShallow){const c=fn(i);if(!cr(n)&&!fn(n)&&(i=nt(i),n=nt(n)),!K.isArray(t)&&Lt(i)&&!Lt(n))return c?!1:(i.value=n,!0)}const s=K.isArray(t)&&K.isIntegerKey(r)?Number(r)<t.length:K.hasOwn(t,r),l=Reflect.set(t,r,n,Lt(t)?t:o);return t===nt(o)&&(s?K.hasChanged(n,i)&&Rn(t,"set",r,n,i):Rn(t,"add",r,n)),l}deleteProperty(t,r){const n=K.hasOwn(t,r),o=t[r],i=Reflect.deleteProperty(t,r);return i&&n&&Rn(t,"delete",r,void 0,o),i}has(t,r){const n=Reflect.has(t,r);return(!K.isSymbol(r)||!Ed.has(r))&&er(t,"has",r),n}ownKeys(t){return er(t,"iterate",K.isArray(t)?"length":Un),Reflect.ownKeys(t)}}class Ad extends Td{constructor(t=!1){super(!0,t)}set(t,r){return ye.env.NODE_ENV!=="production"&&ln(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return ye.env.NODE_ENV!=="production"&&ln(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const ow=new iw,sw=new Ad,aw=new Ad(!0),xa=e=>e,Vo=e=>Reflect.getPrototypeOf(e);function lw(e,t,r){return function(...n){const o=this.__v_raw,i=nt(o),s=K.isMap(i),l=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...n),a=r?xa:t?$a:ir;return!t&&er(i,"iterate",c?Ca:Un),{next(){const{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:l?[a(f[0]),a(f[1])]:a(f),done:d}},[Symbol.iterator](){return this}}}}function zo(e){return function(...t){if(ye.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";ln(`${K.capitalize(e)} operation ${r}failed: target is readonly.`,nt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function cw(e,t){const r={get(o){const i=this.__v_raw,s=nt(i),l=nt(o);e||(K.hasChanged(o,l)&&er(s,"get",o),er(s,"get",l));const{has:c}=Vo(s),u=t?xa:e?$a:ir;if(c.call(s,o))return u(i.get(o));if(c.call(s,l))return u(i.get(l));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!e&&er(nt(o),"iterate",Un),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=nt(i),l=nt(o);return e||(K.hasChanged(o,l)&&er(s,"has",o),er(s,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const s=this,l=s.__v_raw,c=nt(l),u=t?xa:e?$a:ir;return!e&&er(c,"iterate",Un),l.forEach((a,f)=>o.call(i,u(a),u(f),s))}};return K.extend(r,e?{add:zo("add"),set:zo("set"),delete:zo("delete"),clear:zo("clear")}:{add(o){!t&&!cr(o)&&!fn(o)&&(o=nt(o));const i=nt(this);return Vo(i).has.call(i,o)||(i.add(o),Rn(i,"add",o,o)),this},set(o,i){!t&&!cr(i)&&!fn(i)&&(i=nt(i));const s=nt(this),{has:l,get:c}=Vo(s);let u=l.call(s,o);u?ye.env.NODE_ENV!=="production"&&Rd(s,l,o):(o=nt(o),u=l.call(s,o));const a=c.call(s,o);return s.set(o,i),u?K.hasChanged(i,a)&&Rn(s,"set",o,i,a):Rn(s,"add",o,i),this},delete(o){const i=nt(this),{has:s,get:l}=Vo(i);let c=s.call(i,o);c?ye.env.NODE_ENV!=="production"&&Rd(i,s,o):(o=nt(o),c=s.call(i,o));const u=l?l.call(i,o):void 0,a=i.delete(o);return c&&Rn(i,"delete",o,void 0,u),a},clear(){const o=nt(this),i=o.size!==0,s=ye.env.NODE_ENV!=="production"?K.isMap(o)?new Map(o):new Set(o):void 0,l=o.clear();return i&&Rn(o,"clear",void 0,void 0,s),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{r[o]=lw(o,e,t)}),r}function Oa(e,t){const r=cw(e,t);return(n,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(K.hasOwn(r,o)&&o in n?r:n,o,i)}const uw={get:Oa(!1,!1)},fw={get:Oa(!0,!1)},dw={get:Oa(!0,!0)};function Rd(e,t,r){const n=nt(r);if(n!==r&&t.call(e,n)){const o=K.toRawType(e);ln(`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 _d=new WeakMap,pw=new WeakMap,Id=new WeakMap,Cd=new WeakMap;function hw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function gw(e){return e.__v_skip||!Object.isExtensible(e)?0:hw(K.toRawType(e))}function ka(e){return fn(e)?e:Na(e,!1,ow,uw,_d)}function un(e){return Na(e,!0,sw,fw,Id)}function Wo(e){return Na(e,!0,aw,dw,Cd)}function Na(e,t,r,n,o){if(!K.isObject(e))return ye.env.NODE_ENV!=="production"&&ln(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=gw(e);if(s===0)return e;const l=new Proxy(e,s===2?n:r);return o.set(e,l),l}function qn(e){return fn(e)?qn(e.__v_raw):!!(e&&e.__v_isReactive)}function fn(e){return!!(e&&e.__v_isReadonly)}function cr(e){return!!(e&&e.__v_isShallow)}function Ho(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function mw(e){return!K.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&K.def(e,"__v_skip",!0),e}const ir=e=>K.isObject(e)?ka(e):e,$a=e=>K.isObject(e)?un(e):e;function Lt(e){return e?e.__v_isRef===!0:!1}function ce(e){return Fd(e,!1)}function yw(e){return Fd(e,!0)}function Fd(e,t){return Lt(e)?e:new bw(e,t)}class bw{constructor(t,r){this.dep=new jo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?t:nt(t),this._value=r?t:ir(t),this.__v_isShallow=r}get value(){return ye.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const r=this._rawValue,n=this.__v_isShallow||cr(t)||fn(t);t=n?t:nt(t),K.hasChanged(t,r)&&(this._rawValue=t,this._value=n?t:ir(t),ye.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:r}):this.dep.trigger())}}function m(e){return Lt(e)?e.value:e}const vw={get:(e,t,r)=>t==="__v_raw"?e:m(Reflect.get(e,t,r)),set:(e,t,r,n)=>{const o=e[t];return Lt(o)&&!Lt(r)?(o.value=r,!0):Reflect.set(e,t,r,n)}};function ww(e){return qn(e)?e:new Proxy(e,vw)}class Sw{constructor(t){this.__v_isRef=!0,this._value=void 0;const r=this.dep=new jo,{get:n,set:o}=t(r.track.bind(r),r.trigger.bind(r));this._get=n,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Pd(e){return new Sw(e)}class Ew{constructor(t,r,n){this._object=t,this._key=r,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Z0(nt(this._object),this._key)}}class Tw{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 Aw(e,t,r){return Lt(e)?e:K.isFunction(e)?new Tw(e):K.isObject(e)&&arguments.length>1?Rw(e,t,r):ce(e)}function Rw(e,t,r){const n=e[t];return Lt(n)?n:new Ew(e,t,r)}class _w{constructor(t,r,n){this.fn=t,this.setter=r,this._value=void 0,this.dep=new jo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&st!==this)return hd(this,!0),!0;ye.env.NODE_ENV}get value(){const t=ye.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return yd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ye.env.NODE_ENV!=="production"&&ln("Write operation failed: computed value is readonly")}}function Iw(e,t,r=!1){let n,o;K.isFunction(e)?n=e:(n=e.get,o=e.set);const i=new _w(n,o,r);return ye.env.NODE_ENV,i}const Go={},Ko=new WeakMap;let Vn;function Cw(e,t=!1,r=Vn){if(r){let n=Ko.get(r);n||Ko.set(r,n=[]),n.push(e)}else ye.env.NODE_ENV!=="production"&&!t&&ln("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Fw(e,t,r=K.EMPTY_OBJ){const{immediate:n,deep:o,once:i,scheduler:s,augmentJob:l,call:c}=r,u=v=>{(r.onWarn||ln)("Invalid watch source: ",v,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},a=v=>o?v:cr(v)||o===!1||o===0?dn(v,1):dn(v);let f,d,b,E,S=!1,T=!1;if(Lt(e)?(d=()=>e.value,S=cr(e)):qn(e)?(d=()=>a(e),S=!0):K.isArray(e)?(T=!0,S=e.some(v=>qn(v)||cr(v)),d=()=>e.map(v=>{if(Lt(v))return v.value;if(qn(v))return a(v);if(K.isFunction(v))return c?c(v,2):v();ye.env.NODE_ENV!=="production"&&u(v)})):K.isFunction(e)?t?d=c?()=>c(e,2):e:d=()=>{if(b){qi();try{b()}finally{Vi()}}const v=Vn;Vn=f;try{return c?c(e,3,[E]):e(E)}finally{Vn=v}}:(d=K.NOOP,ye.env.NODE_ENV!=="production"&&u(e)),t&&o){const v=d,A=o===!0?1/0:o;d=()=>dn(v(),A)}const w=()=>{f.stop()};if(i&&t){const v=t;t=(...A)=>{v(...A),w()}}let y=T?new Array(e.length).fill(Go):Go;const g=v=>{if(!(!(f.flags&1)||!f.dirty&&!v))if(t){const A=f.run();if(o||S||(T?A.some((R,C)=>K.hasChanged(R,y[C])):K.hasChanged(A,y))){b&&b();const R=Vn;Vn=f;try{const C=[A,y===Go?void 0:T&&y[0]===Go?[]:y,E];c?c(t,3,C):t(...C),y=A}finally{Vn=R}}}else f.run()};return l&&l(g),f=new X0(d),f.scheduler=s?()=>s(g,!1):g,E=v=>Cw(v,!1,f),b=f.onStop=()=>{const v=Ko.get(f);if(v){if(c)c(v,4);else for(const A of v)A();Ko.delete(f)}},ye.env.NODE_ENV!=="production"&&(f.onTrack=r.onTrack,f.onTrigger=r.onTrigger),t?n?g(!0):y=f.run():s?s(g.bind(null,!0),!0):f.run(),w.pause=f.pause.bind(f),w.resume=f.resume.bind(f),w.stop=w,w}function dn(e,t=1/0,r){if(t<=0||!K.isObject(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,Lt(e))dn(e.value,t,r);else if(K.isArray(e))for(let n=0;n<e.length;n++)dn(e[n],t,r);else if(K.isSet(e)||K.isMap(e))e.forEach(n=>{dn(n,t,r)});else if(K.isPlainObject(e)){for(const n in e)dn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&dn(e[n],t,r)}return e}const zn=[];function Pw(e){zn.push(e)}function xw(){zn.pop()}let Da=!1;function tt(e,...t){if(Da)return;Da=!0,qi();const r=zn.length?zn[zn.length-1].component:null,n=r&&r.appContext.config.warnHandler,o=Ow();if(n)Qo(n,r,11,[e+t.map(i=>{var s,l;return(l=(s=i.toString)==null?void 0:s.call(i))!=null?l:JSON.stringify(i)}).join(""),r&&r.proxy,o.map(({vnode:i})=>`at <${gp(r,i.type)}>`).join(`
2
2
  `),o]);else{const i=[`[Vue warn]: ${e}`,...t];o.length&&i.push(`
3
- `,...Lw(o)),console.warn(...i)}Vi(),$a=!1}function Dw(){let e=zn[zn.length-1];if(!e)return[];const t=[];for(;e;){const r=t[0];r&&r.vnode===e?r.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function Lw(e){const t=[];return e.forEach((r,n)=>{t.push(...n===0?[]:[`
4
- `],...Bw(r))}),t}function Bw({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,o=` at <${gp(e.component,e.type,n)}`,i=">"+r;return e.props?[o,...Mw(e.props),i]:[o+i]}function Mw(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...xd(n,e[n]))}),r.length>3&&t.push(" ..."),t}function xd(e,t,r){return K.isString(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Dt(t)?(t=xd(e,nt(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):K.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=nt(t),r?t:[`${e}=`,t])}const Da={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 Qo(e,t,r,n){try{return n?e(...n):e()}catch(o){Xo(o,t,r)}}function La(e,t,r,n){if(K.isFunction(e)){const o=Qo(e,t,r,n);return o&&K.isPromise(o)&&o.catch(i=>{Xo(i,t,r)}),o}if(K.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(La(e[i],t,r,n));return o}else me.env.NODE_ENV!=="production"&&tt(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Xo(e,t,r,n=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||K.EMPTY_OBJ;if(t){let l=t.parent;const c=t.proxy,u=me.env.NODE_ENV!=="production"?Da[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;l;){const a=l.ec;if(a){for(let f=0;f<a.length;f++)if(a[f](e,c,u)===!1)return}l=l.parent}if(i){qi(),Qo(i,null,10,[e,c,u]),Vi();return}}jw(e,r,o,n,s)}function jw(e,t,r,n=!0,o=!1){if(me.env.NODE_ENV!=="production"){const i=Da[t];if(r&&Nw(r),tt(`Unhandled error${i?` during execution of ${i}`:""}`),r&&$w(),n)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const Cr=[];let pn=-1;const mi=[];let Rn=null,yi=0;const Od=Promise.resolve();let Yo=null;const Uw=100;function Hr(e){const t=Yo||Od;return e?t.then(this?e.bind(this):e):t}function qw(e){let t=pn+1,r=Cr.length;for(;t<r;){const n=t+r>>>1,o=Cr[n],i=Gi(o);i<e||i===e&&o.flags&2?t=n+1:r=n}return t}function Ba(e){if(!(e.flags&1)){const t=Gi(e),r=Cr[Cr.length-1];!r||!(e.flags&2)&&t>=Gi(r)?Cr.push(e):Cr.splice(qw(t),0,e),e.flags|=1,kd()}}function kd(){Yo||(Yo=Od.then($d))}function Nd(e){K.isArray(e)?mi.push(...e):Rn&&e.id===-1?Rn.splice(yi+1,0,e):e.flags&1||(mi.push(e),e.flags|=1),kd()}function Vw(e){if(mi.length){const t=[...new Set(mi)].sort((r,n)=>Gi(r)-Gi(n));if(mi.length=0,Rn){Rn.push(...t);return}for(Rn=t,me.env.NODE_ENV!=="production"&&(e=e||new Map),yi=0;yi<Rn.length;yi++){const r=Rn[yi];me.env.NODE_ENV!=="production"&&Dd(e,r)||(r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2)}Rn=null,yi=0}}const Gi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function $d(e){me.env.NODE_ENV!=="production"&&(e=e||new Map);const t=me.env.NODE_ENV!=="production"?r=>Dd(e,r):K.NOOP;try{for(pn=0;pn<Cr.length;pn++){const r=Cr[pn];if(r&&!(r.flags&8)){if(me.env.NODE_ENV!=="production"&&t(r))continue;r.flags&4&&(r.flags&=-2),Qo(r,r.i,r.i?15:14),r.flags&4||(r.flags&=-2)}}}finally{for(;pn<Cr.length;pn++){const r=Cr[pn];r&&(r.flags&=-2)}pn=-1,Cr.length=0,Vw(e),Yo=null,(Cr.length||mi.length)&&$d(e)}}function Dd(e,t){const r=e.get(t)||0;if(r>Uw){const n=t.i,o=n&&el(n.type);return Xo(`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,r+1),!1}let Ki=!1;const Ma=new Map;me.env.NODE_ENV!=="production"&&(K.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:ja(zw),rerender:ja(Ww),reload:ja(Hw)});const Jo=new Map;function zw(e,t){return Jo.has(e)?!1:(Jo.set(e,{initialDef:Zo(t),instances:new Set}),!0)}function Zo(e){return mp(e)?e.__vccOpts:e}function Ww(e,t){const r=Jo.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,Zo(n.type).render=t),n.renderCache=[],Ki=!0,n.update(),Ki=!1}))}function Hw(e,t){const r=Jo.get(e);if(!r)return;t=Zo(t),Ld(r.initialDef,t);const n=[...r.instances];for(let o=0;o<n.length;o++){const i=n[o],s=Zo(i.type);let l=Ma.get(s);l||(s!==r.initialDef&&Ld(s,t),Ma.set(s,l=new Set)),l.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(l.add(i),i.ceReload(t.styles),l.delete(i)):i.parent?Ba(()=>{Ki=!0,i.parent.update(),Ki=!1,l.delete(i)}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(s)}Nd(()=>{Ma.clear()})}function Ld(e,t){K.extend(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function ja(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let _n,Qi=[],Ua=!1;function Gw(e,...t){_n?_n.emit(e,...t):Ua||Qi.push({event:e,args:t})}function Bd(e,t){var r,n;_n=e,_n?(_n.enabled=!0,Qi.forEach(({event:o,args:i})=>_n.emit(o,...i)),Qi=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{Bd(i,t)}),setTimeout(()=>{_n||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ua=!0,Qi=[])},3e3)):(Ua=!0,Qi=[])}const Kw=Qw("component:updated");/*! #__NO_SIDE_EFFECTS__ */function Qw(e){return t=>{Gw(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Xt=null,Md=null;function jd(e){const t=Xt;return Xt=e,Md=e&&e.type.__scopeId||null,t}function Te(e,t=Xt,r){if(!t||e._n)return e;const n=(...o)=>{n._d&&ap(-1);const i=jd(t);let s;try{s=e(...o)}finally{jd(i),n._d&&ap(1)}return me.env.NODE_ENV!=="production"&&Kw(t),s};return n._n=!0,n._c=!0,n._d=!0,n}function ot(e,t){if(Xt===null)return me.env.NODE_ENV!=="production"&&tt("withDirectives can only be used inside render functions."),e;const r=hp(Xt),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,s,l,c=K.EMPTY_OBJ]=t[o];i&&(K.isFunction(i)&&(i={mounted:i,updated:i}),i.deep&&dn(s),n.push({dir:i,instance:r,value:s,oldValue:void 0,arg:l,modifiers:c}))}return e}const Xw=Symbol("_vte"),Yw=e=>e.__isTeleport,Wn=e=>e&&(e.disabled||e.disabled===""),Ud=e=>e&&(e.defer||e.defer===""),qd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Vd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,qa=(e,t)=>{const r=e&&e.to;if(K.isString(r))if(t){const n=t(r);return me.env.NODE_ENV!=="production"&&!n&&!Wn(e)&&tt(`Failed to locate Teleport target with selector "${r}". 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.`),n}else return me.env.NODE_ENV!=="production"&&tt("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return me.env.NODE_ENV!=="production"&&!r&&!Wn(e)&&tt(`Invalid Teleport target: ${r}`),r},zd={name:"Teleport",__isTeleport:!0,process(e,t,r,n,o,i,s,l,c,u){const{mc:a,pc:f,pbc:d,o:{insert:b,querySelector:E,createText:w,createComment:R}}=u,S=Wn(t.props);let{shapeFlag:m,children:g,dynamicChildren:v}=t;if(me.env.NODE_ENV!=="production"&&Ki&&(c=!1,v=null),e==null){const T=t.el=me.env.NODE_ENV!=="production"?R("teleport start"):w(""),A=t.anchor=me.env.NODE_ENV!=="production"?R("teleport end"):w("");b(T,r,n),b(A,r,n);const F=(I,L)=>{m&16&&(o&&o.isCE&&(o.ce._teleportTarget=I),a(g,I,L,o,i,s,l,c))},C=()=>{const I=t.target=qa(t.props,E),L=Hd(I,t,w,b);I?(s!=="svg"&&qd(I)?s="svg":s!=="mathml"&&Vd(I)&&(s="mathml"),S||(F(I,L),ts(t,!1))):me.env.NODE_ENV!=="production"&&!S&&tt("Invalid Teleport target on mount:",I,`(${typeof I})`)};S&&(F(r,A),ts(t,!0)),Ud(t.props)?Qa(()=>{C(),t.el.__isMounted=!0},i):C()}else{if(Ud(t.props)&&!e.el.__isMounted){Qa(()=>{zd.process(e,t,r,n,o,i,s,l,c,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const T=t.anchor=e.anchor,A=t.target=e.target,F=t.targetAnchor=e.targetAnchor,C=Wn(e.props),I=C?r:A,L=C?T:F;if(s==="svg"||qd(A)?s="svg":(s==="mathml"||Vd(A))&&(s="mathml"),v?(d(e.dynamicChildren,v,I,o,i,s,l),ip(e,t,!0)):c||f(e,t,I,L,o,i,s,l,!1),S)C?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):es(t,r,T,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const B=t.target=qa(t.props,E);B?es(t,B,null,u,0):me.env.NODE_ENV!=="production"&&tt("Invalid Teleport target on update:",A,`(${typeof A})`)}else C&&es(t,A,F,u,1);ts(t,S)}},remove(e,t,r,{um:n,o:{remove:o}},i){const{shapeFlag:s,children:l,anchor:c,targetStart:u,targetAnchor:a,target:f,props:d}=e;if(f&&(o(u),o(a)),i&&o(c),s&16){const b=i||!Wn(d);for(let E=0;E<l.length;E++){const w=l[E];n(w,t,r,b,!!w.dynamicChildren)}}},move:es,hydrate:Jw};function es(e,t,r,{o:{insert:n},m:o},i=2){i===0&&n(e.targetAnchor,t,r);const{el:s,anchor:l,shapeFlag:c,children:u,props:a}=e,f=i===2;if(f&&n(s,t,r),(!f||Wn(a))&&c&16)for(let d=0;d<u.length;d++)o(u[d],t,r,2);f&&n(l,t,r)}function Jw(e,t,r,n,o,i,{o:{nextSibling:s,parentNode:l,querySelector:c,insert:u,createText:a}},f){const d=t.target=qa(t.props,c);if(d){const b=Wn(t.props),E=d._lpa||d.firstChild;if(t.shapeFlag&16)if(b)t.anchor=f(s(e),t,l(e),r,n,o,i),t.targetStart=E,t.targetAnchor=E&&s(E);else{t.anchor=s(e);let w=E;for(;w;){if(w&&w.nodeType===8){if(w.data==="teleport start anchor")t.targetStart=w;else if(w.data==="teleport anchor"){t.targetAnchor=w,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}}w=s(w)}t.targetAnchor||Hd(d,t,a,u),f(E&&s(E),t,d,r,n,o,i)}ts(t,b)}return t.anchor&&s(t.anchor)}const Wd=zd;function ts(e,t){const r=e.ctx;if(r&&r.ut){let n,o;for(t?(n=e.el,o=e.anchor):(n=e.targetStart,o=e.targetAnchor);n&&n!==o;)n.nodeType===1&&n.setAttribute("data-v-owner",r.uid),n=n.nextSibling;r.ut()}}function Hd(e,t,r,n){const o=t.targetStart=r(""),i=t.targetAnchor=r("");return o[Xw]=i,e&&(n(o,e),n(i,e)),i}function Gd(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gd(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function Me(e,t){return K.isFunction(e)?K.extend({name:e.name},t,{setup:e}):e}function Zw(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const eS=new WeakSet;function tS(e){const t=Ja(),r=Sw(null);if(t){const o=t.refs===K.EMPTY_OBJ?t.refs={}:t.refs;let i;me.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?tt(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>r.value,set:s=>r.value=s})}else me.env.NODE_ENV!=="production"&&tt("useTemplateRef() is called when there is no active component instance to be associated with.");const n=me.env.NODE_ENV!=="production"?un(r):r;return me.env.NODE_ENV!=="production"&&eS.add(n),n}const Kd=e=>e.nodeType===8;K.getGlobalThis().requestIdleCallback,K.getGlobalThis().cancelIdleCallback;function rS(e,t){if(Kd(e)&&e.data==="["){let r=1,n=e.nextSibling;for(;n;){if(n.nodeType===1){if(t(n)===!1)break}else if(Kd(n))if(n.data==="]"){if(--r===0)break}else n.data==="["&&r++;n=n.nextSibling}}else t(e)}const nS=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function iS(e){K.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:r,errorComponent:n,delay:o=200,hydrate:i,timeout:s,suspensible:l=!0,onError:c}=e;let u=null,a,f=0;const d=()=>(f++,u=null,b()),b=()=>{let E;return u||(E=u=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),c)return new Promise((R,S)=>{c(w,()=>R(d()),()=>S(w),f+1)});throw w}).then(w=>{if(E!==u&&u)return u;if(me.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),me.env.NODE_ENV!=="production"&&w&&!K.isObject(w)&&!K.isFunction(w))throw new Error(`Invalid async component load result: ${w}`);return a=w,w}))};return Me({name:"AsyncComponentWrapper",__asyncLoader:b,__asyncHydrate(E,w,R){const S=i?()=>{const m=i(R,g=>rS(E,g));m&&(w.bum||(w.bum=[])).push(m)}:R;a?S():b().then(()=>!w.isUnmounted&&S())},get __asyncResolved(){return a},setup(){const E=vr;if(Zw(E),a)return()=>Va(a,E);const w=g=>{u=null,Xo(g,E,13,!n)};if(l&&E.suspense||Si)return b().then(g=>()=>Va(g,E)).catch(g=>(w(g),()=>n?we(n,{error:g}):null));const R=ue(!1),S=ue(),m=ue(!!o);return o&&setTimeout(()=>{m.value=!1},o),s!=null&&setTimeout(()=>{if(!R.value&&!S.value){const g=new Error(`Async component timed out after ${s}ms.`);w(g),S.value=g}},s),b().then(()=>{R.value=!0,E.parent&&oS(E.parent.vnode)&&E.parent.update()}).catch(g=>{w(g),S.value=g}),()=>{if(R.value&&a)return Va(a,E);if(S.value&&n)return we(n,{error:S.value});if(r&&!m.value)return we(r)}}})}function Va(e,t){const{ref:r,props:n,children:o,ce:i}=t.vnode,s=we(e,n,o);return s.ref=r,s.ce=i,delete t.vnode.ce,s}const oS=e=>e.type.__isKeepAlive;function sS(e,t,r=vr,n=!1){if(r){const o=r[e]||(r[e]=[]),i=t.__weh||(t.__weh=(...s)=>{qi();const l=dp(r),c=La(t,r,e,s);return l(),Vi(),c});return n?o.unshift(i):o.push(i),i}else if(me.env.NODE_ENV!=="production"){const o=K.toHandlerKey(Da[e].replace(/ hook$/,""));tt(`${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 rs=e=>(t,r=vr)=>{(!Si||e==="sp")&&sS(e,(...n)=>t(...n),r)},Vt=rs("m"),aS=rs("bu"),Gr=rs("bum"),za=rs("um"),ns="components",lS="directives";function pe(e,t){return Wa(ns,e,!0,t)||e}const Qd=Symbol.for("v-ndc");function Hn(e){return K.isString(e)?Wa(ns,e,!1)||e:e||Qd}function or(e){return Wa(lS,e)}function Wa(e,t,r=!0,n=!1){const o=Xt||vr;if(o){const i=o.type;if(e===ns){const l=el(i,!1);if(l&&(l===t||l===K.camelize(t)||l===K.capitalize(K.camelize(t))))return i}const s=Xd(o[e]||i[e],t)||Xd(o.appContext[e],t);if(!s&&n)return i;if(me.env.NODE_ENV!=="production"&&r&&!s){const l=e===ns?`
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}${l}`)}return s}else me.env.NODE_ENV!=="production"&&tt(`resolve${K.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Xd(e,t){return e&&(e[t]||e[K.camelize(t)]||e[K.capitalize(K.camelize(t))])}function Lt(e,t,r,n){let o;const i=r,s=K.isArray(e);if(s||K.isString(e)){const l=s&&qn(e);let c=!1;l&&(c=!ur(e),e=qo(e)),o=new Array(e.length);for(let u=0,a=e.length;u<a;u++)o[u]=t(c?ir(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){me.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&tt(`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,i)}else if(K.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(l,c)=>t(l,c,void 0,i));else{const l=Object.keys(e);o=new Array(l.length);for(let c=0,u=l.length;c<u;c++){const a=l[c];o[c]=t(e[a],a,c,i)}}else o=[];return o}function Yd(e,t){for(let r=0;r<t.length;r++){const n=t[r];if(K.isArray(n))for(let o=0;o<n.length;o++)e[n[o].name]=n[o].fn;else n&&(e[n.name]=n.key?(...o)=>{const i=n.fn(...o);return i&&(i.key=n.key),i}:n.fn)}return e}function Ge(e,t,r={},n,o){if(Xt.ce||Xt.parent&&nS(Xt.parent)&&Xt.parent.ce)return t!=="default"&&(r.name=t),Z(),Ce(Ye,null,[we("slot",r,n&&n())],64);let i=e[t];me.env.NODE_ENV!=="production"&&i&&i.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."),i=()=>[]),i&&i._c&&(i._d=!1),Z();const s=i&&Jd(i(r)),l=r.key||s&&s.key,c=Ce(Ye,{key:(l&&!K.isSymbol(l)?l:`_${t}`)+(!s&&n?"_fb":"")},s||(n?n():[]),s&&e._===1?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function Jd(e){return e.some(t=>ss(t)?!(t.type===vi||t.type===Ye&&!Jd(t.children)):!0)?e:null}function Ha(e,t){const r={};if(me.env.NODE_ENV!=="production"&&!K.isObject(e))return tt("v-on with no argument expects an object value."),r;for(const n in e)r[t&&/[A-Z]/.test(n)?`on:${n}`:K.toHandlerKey(n)]=e[n];return r}const Ga=e=>e?IS(e)?hp(e):Ga(e.parent):null,Ka=K.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>me.env.NODE_ENV!=="production"?Wo(e.props):e.props,$attrs:e=>me.env.NODE_ENV!=="production"?Wo(e.attrs):e.attrs,$slots:e=>me.env.NODE_ENV!=="production"?Wo(e.slots):e.slots,$refs:e=>me.env.NODE_ENV!=="production"?Wo(e.refs):e.refs,$parent:e=>Ga(e.parent),$root:e=>Ga(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>dS(e),$forceUpdate:e=>e.f||(e.f=()=>{Ba(e.update)}),$nextTick:e=>e.n||(e.n=Hr.bind(e.proxy)),$watch:e=>wS.bind(e)}),cS={};me.env.NODE_ENV!=="production"&&(cS.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 uS(){return fS().slots}function fS(){const e=Ja();return me.env.NODE_ENV!=="production"&&!e&&tt("useContext() called without active instance."),e.setupContext||(e.setupContext=FS(e))}function Zd(e){return K.isArray(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function dS(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,l=i.get(t);let c;return l?c=l:!o.length&&!r&&!n?c=t:(c={},o.length&&o.forEach(u=>is(c,u,s,!0)),is(c,t,s)),K.isObject(t)&&i.set(t,c),c}function is(e,t,r,n=!1){const{mixins:o,extends:i}=t;i&&is(e,i,r,!0),o&&o.forEach(s=>is(e,s,r,!0));for(const s in t)if(n&&s==="expose")me.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 l=pS[s]||r&&r[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const pS={data:ep,props:rp,emits:rp,methods:Xi,computed:Xi,beforeCreate:fr,created:fr,beforeMount:fr,mounted:fr,beforeUpdate:fr,updated:fr,beforeDestroy:fr,beforeUnmount:fr,destroyed:fr,unmounted:fr,activated:fr,deactivated:fr,errorCaptured:fr,serverPrefetch:fr,components:Xi,directives:Xi,watch:gS,provide:ep,inject:hS};function ep(e,t){return t?e?function(){return K.extend(K.isFunction(e)?e.call(this,this):e,K.isFunction(t)?t.call(this,this):t)}:t:e}function hS(e,t){return Xi(tp(e),tp(t))}function tp(e){if(K.isArray(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function fr(e,t){return e?[...new Set([].concat(e,t))]:t}function Xi(e,t){return e?K.extend(Object.create(null),e,t):t}function rp(e,t){return e?K.isArray(e)&&K.isArray(t)?[...new Set([...e,...t])]:K.extend(Object.create(null),Zd(e),Zd(t??{})):t}function gS(e,t){if(!e)return t;if(!t)return e;const r=K.extend(Object.create(null),e);for(const n in t)r[n]=fr(e[n],t[n]);return r}let mS=null;function bi(e,t){if(!vr)me.env.NODE_ENV!=="production"&&tt("provide() can only be used inside setup().");else{let r=vr.provides;const n=vr.parent&&vr.parent.provides;n===r&&(r=vr.provides=Object.create(n)),r[e]=t}}function In(e,t,r=!1){const n=vr||Xt;if(n||mS){const o=n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return r&&K.isFunction(t)?t.call(n&&n.proxy):t;me.env.NODE_ENV!=="production"&&tt(`injection "${String(e)}" not found.`)}else me.env.NODE_ENV!=="production"&&tt("inject() can only be used inside setup() or functional components.")}const yS={},np=e=>Object.getPrototypeOf(e)===yS,Qa=TS;function ip(e,t,r=!1){const n=e.children,o=t.children;if(K.isArray(n)&&K.isArray(o))for(let i=0;i<n.length;i++){const s=n[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=_S(o[i]),l.el=s.el),!r&&l.patchFlag!==-2&&ip(s,l)),l.type===sp&&(l.el=s.el),me.env.NODE_ENV!=="production"&&l.type===vi&&!l.el&&(l.el=s.el)}}const bS=Symbol.for("v-scx"),vS=()=>{{const e=In(bS);return e||me.env.NODE_ENV!=="production"&&tt("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Et(e,t,r){return me.env.NODE_ENV!=="production"&&!K.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."),op(e,t,r)}function op(e,t,r=K.EMPTY_OBJ){const{immediate:n,deep:o,flush:i,once:s}=r;me.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&tt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==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 l=K.extend({},r);me.env.NODE_ENV!=="production"&&(l.onWarn=tt);const c=t&&n||!t&&i!=="post";let u;if(Si){if(i==="sync"){const b=vS();u=b.__watcherHandles||(b.__watcherHandles=[])}else if(!c){const b=()=>{};return b.stop=K.NOOP,b.resume=K.NOOP,b.pause=K.NOOP,b}}const a=vr;l.call=(b,E,w)=>La(b,a,E,w);let f=!1;i==="post"?l.scheduler=b=>{Qa(b,a&&a.suspense)}:i!=="sync"&&(f=!0,l.scheduler=(b,E)=>{E?b():Ba(b)}),l.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,a&&(b.id=a.uid,b.i=a))};const d=kw(e,t,l);return Si&&(u?u.push(d):c&&d()),d}function wS(e,t,r){const n=this.proxy,o=K.isString(e)?e.includes(".")?SS(n,e):()=>n[e]:e.bind(n,n);let i;K.isFunction(t)?i=t:(i=t.handler,r=t);const s=dp(this),l=op(o,i.bind(n),r);return s(),l}function SS(e,t){const r=t.split(".");return()=>{let n=e;for(let o=0;o<r.length&&n;o++)n=n[r[o]];return n}}const ES=e=>e.__isSuspense;function TS(e,t){t&&t.pendingBranch?K.isArray(e)?t.effects.push(...e):t.effects.push(e):Nd(e)}const Ye=Symbol.for("v-fgt"),sp=Symbol.for("v-txt"),vi=Symbol.for("v-cmt"),os=[];let Er=null;function Z(e=!1){os.push(Er=e?null:[])}function AS(){os.pop(),Er=os[os.length-1]||null}let Yi=1;function ap(e,t=!1){Yi+=e,e<0&&Er&&t&&(Er.hasOnce=!0)}function lp(e){return e.dynamicChildren=Yi>0?Er||K.EMPTY_ARR:null,AS(),Yi>0&&Er&&Er.push(e),e}function ve(e,t,r,n,o,i){return lp(he(e,t,r,n,o,i,!0))}function Ce(e,t,r,n,o){return lp(we(e,t,r,n,o,!0))}function ss(e){return e?e.__v_isVNode===!0:!1}const RS=(...e)=>up(...e),cp=({key:e})=>e??null,as=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?K.isString(e)||Dt(e)||K.isFunction(e)?{i:Xt,r:e,k:t,f:!!r}:e:null);function he(e,t=null,r=null,n=0,o=null,i=e===Ye?0:1,s=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&cp(t),ref:t&&as(t),scopeId:Md,slotScopeIds:null,children:r,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:i,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Xt};return l?(Ya(c,r),i&128&&e.normalize(c)):r&&(c.shapeFlag|=K.isString(r)?8:16),me.env.NODE_ENV!=="production"&&c.key!==c.key&&tt("VNode created with invalid key (NaN). VNode type:",c.type),Yi>0&&!s&&Er&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Er.push(c),c}const we=me.env.NODE_ENV!=="production"?RS:up;function up(e,t=null,r=null,n=0,o=null,i=!1){if((!e||e===Qd)&&(me.env.NODE_ENV!=="production"&&!e&&tt(`Invalid vnode type when creating vnode: ${e}.`),e=vi),ss(e)){const l=wi(e,t,!0);return r&&Ya(l,r),Yi>0&&!i&&Er&&(l.shapeFlag&6?Er[Er.indexOf(e)]=l:Er.push(l)),l.patchFlag=-2,l}if(mp(e)&&(e=e.__vccOpts),t){t=Xa(t);let{class:l,style:c}=t;l&&!K.isString(l)&&(t.class=K.normalizeClass(l)),K.isObject(c)&&(Ho(c)&&!K.isArray(c)&&(c=K.extend({},c)),t.style=K.normalizeStyle(c))}const s=K.isString(e)?1:ES(e)?128:Yw(e)?64:K.isObject(e)?4:K.isFunction(e)?2:0;return me.env.NODE_ENV!=="production"&&s&4&&Ho(e)&&(e=nt(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)),he(e,t,r,n,o,s,i,!0)}function Xa(e){return e?Ho(e)||np(e)?K.extend({},e):e:null}function wi(e,t,r=!1,n=!1){const{props:o,ref:i,patchFlag:s,children:l,transition:c}=e,u=t?Yt(o||{},t):o,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&cp(u),ref:t&&t.ref?r&&i?K.isArray(i)?i.concat(as(t)):[i,as(t)]:as(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:me.env.NODE_ENV!=="production"&&s===-1&&K.isArray(l)?l.map(fp):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ye?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&wi(e.ssContent),ssFallback:e.ssFallback&&wi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&Gd(a,c.clone(a)),a}function fp(e){const t=wi(e);return K.isArray(e.children)&&(t.children=e.children.map(fp)),t}function Bt(e=" ",t=0){return we(sp,null,e,t)}function ke(e="",t=!1){return t?(Z(),Ce(vi,null,e)):we(vi,null,e)}function _S(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wi(e)}function Ya(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(K.isArray(t))r=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),Ya(e,o()),o._c&&(o._d=!0));return}else{r=32;const o=t._;!o&&!np(t)?t._ctx=Xt:o===3&&Xt&&(Xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else K.isFunction(t)?(t={default:t,_ctx:Xt},r=32):(t=String(t),n&64?(r=16,t=[Bt(t)]):r=8);e.children=t,e.shapeFlag|=r}function Yt(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=K.normalizeClass([t.class,n.class]));else if(o==="style")t.style=K.normalizeStyle([t.style,n.style]);else if(K.isOn(o)){const i=t[o],s=n[o];s&&i!==s&&!(K.isArray(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=n[o])}return t}let vr=null;const Ja=()=>vr||Xt;let Za;{const e=K.getGlobalThis(),t=(r,n)=>{let o;return(o=e[r])||(o=e[r]=[]),o.push(n),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};Za=t("__VUE_INSTANCE_SETTERS__",r=>vr=r),t("__VUE_SSR_SETTERS__",r=>Si=r)}const dp=e=>{const t=vr;return Za(e),e.scope.on(),()=>{e.scope.off(),Za(t)}};function IS(e){return e.vnode.shapeFlag&4}let Si=!1;const pp=me.env.NODE_ENV!=="production"?{get(e,t){return er(e,"get",""),e[t]},set(){return tt("setupContext.attrs is readonly."),!1},deleteProperty(){return tt("setupContext.attrs is readonly."),!1}}:{get(e,t){return er(e,"get",""),e[t]}};function CS(e){return new Proxy(e.slots,{get(t,r){return er(e,"get","$slots"),t[r]}})}function FS(e){const t=r=>{if(me.env.NODE_ENV!=="production"&&(e.exposed&&tt("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(K.isArray(r)?n="array":Dt(r)&&(n="ref")),n!=="object"&&tt(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(me.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,pp))},get slots(){return n||(n=CS(e))},get emit(){return(o,...i)=>e.emit(o,...i)},expose:t})}else return{attrs:new Proxy(e.attrs,pp),slots:e.slots,emit:e.emit,expose:t}}function hp(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Aw(ww(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in Ka)return Ka[r](e)},has(t,r){return r in t||r in Ka}})):e.proxy}const PS=/(?:^|[-_])(\w)/g,xS=e=>e.replace(PS,t=>t.toUpperCase()).replace(/[-_]/g,"");function el(e,t=!0){return K.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function gp(e,t,r=!1){let n=el(t);if(!n&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(n=o[1])}if(!n&&e&&e.parent){const o=i=>{for(const s in i)if(i[s]===t)return s};n=o(e.components||e.parent.type.components)||o(e.appContext.components)}return n?xS(n):r?"App":"Anonymous"}function mp(e){return K.isFunction(e)&&"__vccOpts"in e}const V=(e,t)=>{const r=xw(e,t,Si);if(me.env.NODE_ENV!=="production"){const n=Ja();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function yp(e,t,r){const n=arguments.length;return n===2?K.isObject(t)&&!K.isArray(t)?ss(t)?we(e,null,[t]):we(e,t):we(e,null,t):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&ss(r)&&(r=[r]),we(e,t,r))}function OS(){if(me.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(f){return K.isObject(f)?f.__isVue?["div",e,"VueInstance"]:Dt(f)?["div",{},["span",e,a(f)],"<",l("_value"in f?f._value:f),">"]:qn(f)?["div",{},["span",e,ur(f)?"ShallowReactive":"Reactive"],"<",l(f),`>${fn(f)?" (readonly)":""}`]:fn(f)?["div",{},["span",e,ur(f)?"ShallowReadonly":"Readonly"],"<",l(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...i(f.$)]}};function i(f){const d=[];f.type.props&&f.props&&d.push(s("props",nt(f.props))),f.setupState!==K.EMPTY_OBJ&&d.push(s("setup",f.setupState)),f.data!==K.EMPTY_OBJ&&d.push(s("data",nt(f.data)));const b=c(f,"computed");b&&d.push(s("computed",b));const E=c(f,"inject");return E&&d.push(s("injected",E)),d.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),d}function s(f,d){return d=K.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(b=>["div",{},["span",n,b+": "],l(d[b],!1)])]]:["span",{}]}function l(f,d=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",r,JSON.stringify(f)]:typeof f=="boolean"?["span",n,f]:K.isObject(f)?["object",{object:d?nt(f):f}]:["span",r,String(f)]}function c(f,d){const b=f.type;if(K.isFunction(b))return;const E={};for(const w in f.ctx)u(b,w,d)&&(E[w]=f.ctx[w]);return E}function u(f,d,b){const E=f[b];if(K.isArray(E)&&E.includes(d)||K.isObject(E)&&d in E||f.extends&&u(f.extends,d,b)||f.mixins&&f.mixins.some(w=>u(w,d,b)))return!0}function a(f){return ur(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const kS=me.env.NODE_ENV!=="production"?tt:K.NOOP;me.env.NODE_ENV,me.env.NODE_ENV;let NS;const bp=typeof window<"u"&&window.trustedTypes;if(bp)try{NS=bp.createPolicy("vue",{createHTML:e=>e})}catch(e){me.env.NODE_ENV!=="production"&&kS(`Error creating trusted types policy: ${e}`)}const vp=Symbol("_vod"),$S=Symbol("_vsh"),tl={beforeMount(e,{value:t},{transition:r}){e[vp]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):Ji(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),Ji(e,!0),n.enter(e)):n.leave(e,()=>{Ji(e,!1)}):Ji(e,t))},beforeUnmount(e,{value:t}){Ji(e,t)}};me.env.NODE_ENV!=="production"&&(tl.name="show");function Ji(e,t){e.style.display=t?e[vp]:"none",e[$S]=!t}Symbol(me.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function Zi(e,t,r,n){e.addEventListener(t,r,n)}const wp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return K.isArray(t)?r=>K.invokeArrayFns(t,r):t};function DS(e){e.target.composing=!0}function Sp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const rl=Symbol("_assign"),LS={created(e,{modifiers:{lazy:t,trim:r,number:n}},o){e[rl]=wp(o);const i=n||o.props&&o.props.type==="number";Zi(e,t?"change":"input",s=>{if(s.target.composing)return;let l=e.value;r&&(l=l.trim()),i&&(l=K.looseToNumber(l)),e[rl](l)}),r&&Zi(e,"change",()=>{e.value=e.value.trim()}),t||(Zi(e,"compositionstart",DS),Zi(e,"compositionend",Sp),Zi(e,"change",Sp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:n,trim:o,number:i}},s){if(e[rl]=wp(s),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?K.looseToNumber(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(n&&t===r||o&&e.value.trim()===c)||(e.value=c))}},BS=["ctrl","shift","alt","meta"],MS={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)=>BS.some(r=>e[`${r}Key`]&&!t.includes(r))},Tr=(e,t)=>{const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=(o,...i)=>{for(let s=0;s<t.length;s++){const l=MS[t[s]];if(l&&l(o,t))return}return e(o,...i)})},jS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},eo=(e,t)=>{const r=e._withKeys||(e._withKeys={}),n=t.join(".");return r[n]||(r[n]=o=>{if(!("key"in o))return;const i=K.hyphenate(o.key);if(t.some(s=>s===i||jS[s]===i))return e(o)})};function US(){OS()}me.env.NODE_ENV!=="production"&&US();const dr=()=>qt.useAbility(),ls=()=>V(()=>!!document.getElementById("files-global-search-options"));function Ep(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const to=(e,t)=>!e||!t?!1:e.id===t.id;var Cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var il,Tp;function qS(){if(Tp)return il;Tp=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,i){for(var s="",l=0,c=-1,u=0,a,f=0;f<=o.length;++f){if(f<o.length)a=o.charCodeAt(f);else{if(a===47)break;a=47}if(a===47){if(!(c===f-1||u===1))if(c!==f-1&&u===2){if(s.length<2||l!==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="",l=0):(s=s.slice(0,d),l=s.length-1-s.lastIndexOf("/")),c=f,u=0;continue}}else if(s.length===2||s.length===1){s="",l=0,c=f,u=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+o.slice(c+1,f):s=o.slice(c+1,f),l=f-c-1;c=f,u=0}else a===46&&u!==-1?++u:u=-1}return s}function r(o,i){var s=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+l:s+o+l:l}var n={resolve:function(){for(var i="",s=!1,l,c=arguments.length-1;c>=-1&&!s;c--){var u;c>=0?u=arguments[c]:(l===void 0&&(l=me.cwd()),u=l),e(u),u.length!==0&&(i=u+"/"+i,s=u.charCodeAt(0)===47)}return i=t(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=t(i,!s),i.length===0&&!s&&(i="."),i.length>0&&l&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var l=arguments[s];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":n.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=n.resolve(i),s=n.resolve(s),i===s))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var c=i.length,u=c-l,a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var f=s.length,d=f-a,b=u<d?u:d,E=-1,w=0;w<=b;++w){if(w===b){if(d>b){if(s.charCodeAt(a+w)===47)return s.slice(a+w+1);if(w===0)return s.slice(a+w)}else u>b&&(i.charCodeAt(l+w)===47?E=w:w===0&&(E=0));break}var R=i.charCodeAt(l+w),S=s.charCodeAt(a+w);if(R!==S)break;R===47&&(E=w)}var m="";for(w=l+E+1;w<=c;++w)(w===c||i.charCodeAt(w)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+s.slice(a+E):(a+=E,s.charCodeAt(a)===47&&++a,s.slice(a))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),l=s===47,c=-1,u=!0,a=i.length-1;a>=1;--a)if(s=i.charCodeAt(a),s===47){if(!u){c=a;break}}else u=!1;return c===-1?l?"/":".":l&&c===1?"//":i.slice(0,c)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,c=-1,u=!0,a;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var f=s.length-1,d=-1;for(a=i.length-1;a>=0;--a){var b=i.charCodeAt(a);if(b===47){if(!u){l=a+1;break}}else d===-1&&(u=!1,d=a+1),f>=0&&(b===s.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=d))}return l===c?c=d:c===-1&&(c=i.length),i.slice(l,c)}else{for(a=i.length-1;a>=0;--a)if(i.charCodeAt(a)===47){if(!u){l=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":i.slice(l,c)}},extname:function(i){e(i);for(var s=-1,l=0,c=-1,u=!0,a=0,f=i.length-1;f>=0;--f){var d=i.charCodeAt(f);if(d===47){if(!u){l=f+1;break}continue}c===-1&&(u=!1,c=f+1),d===46?s===-1?s=f:a!==1&&(a=1):s!==-1&&(a=-1)}return s===-1||c===-1||a===0||a===1&&s===c-1&&s===l+1?"":i.slice(s,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var l=i.charCodeAt(0),c=l===47,u;c?(s.root="/",u=1):u=0;for(var a=-1,f=0,d=-1,b=!0,E=i.length-1,w=0;E>=u;--E){if(l=i.charCodeAt(E),l===47){if(!b){f=E+1;break}continue}d===-1&&(b=!1,d=E+1),l===46?a===-1?a=E:w!==1&&(w=1):a!==-1&&(w=-1)}return a===-1||d===-1||w===0||w===1&&a===d-1&&a===f+1?d!==-1&&(f===0&&c?s.base=s.name=i.slice(1,d):s.base=s.name=i.slice(f,d)):(f===0&&c?(s.name=i.slice(1,a),s.base=i.slice(1,d)):(s.name=i.slice(f,a),s.base=i.slice(f,d)),s.ext=i.slice(a,d)),f>0?s.dir=i.slice(0,f-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,il=n,il}var ht=qS();const cs=nl(ht),VS=Me({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Ue=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},zS=["textContent"],WS=["textContent"];function HS(e,t,r,n,o,i){return Z(),ve(Ye,null,[he("p",{class:"oc-mt-rm",textContent:K.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,zS),he("p",{class:"oc-mb-rm",textContent:K.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,WS)],64)}const Ap=Ue(VS,[["render",HS]]),GS=Me({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}=yt(),{$gettext:r}=Ne.useGettext(),n=ue(!1),o=V(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?r("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):r("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):r("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),i=V(()=>e.resource.isFolder?r('Folder with name "%{name}" already exists.',{name:e.resource.name},!0):r('File with name "%{name}" already exists.',{name:e.resource.name},!0)),s=V(()=>e.confirmSecondaryTextOverwrite||r("Replace"));return{message:i,checkboxValue:n,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Ur.KEEP_BOTH,doForAllConflicts:y(n)})},onConfirmSecondary:()=>{t(e.modal.id);const a=e.suggestMerge?Ur.MERGE:Ur.REPLACE;e.callbackFn({strategy:a,doForAllConflicts:y(n)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Ur.SKIP,doForAllConflicts:y(n)})}}}}),KS=["textContent"],QS={class:"oc-my-m"},XS={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},YS={class:"oc-modal-body-actions-grid"};function JS(e,t,r,n,o,i){const s=pe("oc-checkbox"),l=pe("oc-button");return Z(),ve(Ye,null,[he("span",{class:"oc-display-inline-block oc-mb-m",textContent:K.toDisplayString(e.message)},null,8,KS),he("div",QS,[e.conflictCount>1?(Z(),Ce(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checkboxValue=c),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):ke("",!0)]),he("div",XS,[he("div",YS,[we(l,{class:"oc-modal-body-actions-cancel oc-ml-s",appearance:"outline",variation:"passive",onClick:e.onCancel},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),we(l,{class:"oc-modal-body-actions-secondary oc-ml-s",appearance:"outline",variation:"passive",onClick:e.onConfirmSecondary},{default:Te(()=>[Bt(K.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),we(l,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",variation:"primary",onClick:e.onConfirm},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const Rp=Ue(GS,[["render",JS]]);class ol{constructor(t,r){this.$gettext=t,this.$ngettext=r}async resolveAllConflicts(t,r,n){const o=[];for(const u of t){const a=ht.join(r.path,u.name);n.some(d=>d.path===a)&&o.push({resource:u,strategy:null})}let i=0,s=!1,l=null;const c=[];for(const u of o){if(s){u.strategy=l,c.push(u);continue}const a=o.length-i,f=await this.resolveFileExists(u.resource,a);u.strategy=f.strategy,c.push(u),i+=1,f.doForAllConflicts&&(s=!0,l=f.strategy)}return c}resolveFileExists(t,r,n=!1,o=!1){const{dispatchModal:i}=yt();return new Promise(s=>{i({variation:"danger",title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:Rp,customComponentAttrs:()=>({resource:t,conflictCount:r,suggestMerge:n,separateSkipHandling:o,callbackFn:l=>{s(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=yt();return new Promise(r=>{t({variation:"danger",title:this.$gettext("Copy here?"),customComponent:Ap,confirmText:this.$gettext("Copy here"),onCancel:()=>{r(!1)},onConfirm:()=>Promise.resolve(r(!0))})})}}const jr=(e,t,r,n=1)=>{let o;return t?o=`${ie.extractNameWithoutExtension({name:e,extension:t})} (${n}).${t}`:o=`${e} (${n})`,r.some(s=>s.name===o)?jr(e,t,r,n+1):o},_p=(e,t,r,n)=>e.id===r.id&&ht.dirname(t.path)===n.path;var Ur=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Ur||{}),hn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(hn||{});class Ip extends ol{constructor(t,r,n,o,i,s,l,c){super(l,c),this.sourceSpace=t,this.resourcesToMove=r,this.targetSpace=n,this.targetFolder=o,this.currentFolder=i,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,r=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);it().showErrorMessage({title:r})}showResultMessage(t,r,n){var l,c;if(t.length===0){const u=r.length;if(u===0)return;const a=n===hn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",u,{count:u.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",u,{count:u.toString()},!0);it().showMessage({title:a,status:"success"});return}let o=n===hn.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=n===hn.COPY?this.$gettext('Failed to copy "%{name}"',{name:(l=t[0])==null?void 0:l.resourceName},!0):this.$gettext('Failed to move "%{name}"',{name:(c=t[0])==null?void 0:c.resourceName},!0));let i="";t.some(({error:u})=>u instanceof ie.HttpError&&u.statusCode===507)&&(i=this.$gettext("Insufficient quota")),it().showErrorMessage({title:o,...i&&{desc:i},errors:t.map(({error:u})=>u)})}async getTransferData(t){var i;if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===hn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=hn.COPY}const r=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,n=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,r),o=[];for(const s of this.resourcesToMove){const l={...s},{id:c,name:u,extension:a}=l,f=n.some(E=>E.resource.id===c);let d=u,b=!1;if(f){const E=(i=n.find(w=>w.resource.id===c))==null?void 0:i.strategy;if(E===Ur.SKIP)continue;if(E===Ur.REPLACE){if(this.isOverwritingParentFolder(l,this.targetFolder,r)){const w=new Error;this.showResultMessage([{error:w,resourceName:u}],[],t);continue}b=!0}E===Ur.KEEP_BOTH&&(d=jr(u,a,r),l.name=d)}_p(this.sourceSpace,l,this.targetSpace,this.targetFolder)&&b||o.push({resource:l,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:ht.join(this.targetFolder.path,d),overwrite:b,transferType:t})}return o}isOverwritingParentFolder(t,r,n){var s;if(t.type!=="folder"||r.path===((s=y(this.currentFolder))==null?void 0:s.path))return!1;const o=ht.basename(t.path),i=ht.join(r.path,o);return n.some(l=>l.path===i)}}const sl={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},ZS=(e,t,r)=>new id(e,{...sl,keys:["name","type","icon","extension","tags"]}).search(t,{limit:r}).map(o=>o.item),Cp="oc-resource-icon-mapping",eE={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-color-text-default)"},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-color-text-default)"},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","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","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-color-text-default)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-color-text-default)"},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"]}};function Fp(){const e={};return Object.values(eE).forEach(t=>{t.extensions.forEach(r=>{e[r]=t.icon})}),e}function al(e,t,r){return t.name=ht.basename(r),t.path=r,t.webDavPath=ht.join(e.webDavPath,r),t.extension=ie.extractExtensionFromFile(t),t}function tE(){this.__data__=[],this.size=0}function ro(e,t){return e===t||e!==e&&t!==t}function us(e,t){for(var r=e.length;r--;)if(ro(e[r][0],t))return r;return-1}var rE=Array.prototype,nE=rE.splice;function iE(e){var t=this.__data__,r=us(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():nE.call(t,r,1),--this.size,!0}function oE(e){var t=this.__data__,r=us(t,e);return r<0?void 0:t[r][1]}function sE(e){return us(this.__data__,e)>-1}function aE(e,t){var r=this.__data__,n=us(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function gn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gn.prototype.clear=tE,gn.prototype.delete=iE,gn.prototype.get=oE,gn.prototype.has=sE,gn.prototype.set=aE;function lE(){this.__data__=new gn,this.size=0}function cE(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function uE(e){return this.__data__.get(e)}function fE(e){return this.__data__.has(e)}const Fn=globalThis||void 0||self;var Pp=typeof Fn=="object"&&Fn&&Fn.Object===Object&&Fn,dE=typeof self=="object"&&self&&self.Object===Object&&self,Kr=Pp||dE||Function("return this")(),Fr=Kr.Symbol,xp=Object.prototype,pE=xp.hasOwnProperty,hE=xp.toString,no=Fr?Fr.toStringTag:void 0;function gE(e){var t=pE.call(e,no),r=e[no];try{e[no]=void 0;var n=!0}catch{}var o=hE.call(e);return n&&(t?e[no]=r:delete e[no]),o}var mE=Object.prototype,yE=mE.toString;function bE(e){return yE.call(e)}var vE="[object Null]",wE="[object Undefined]",Op=Fr?Fr.toStringTag:void 0;function Gn(e){return e==null?e===void 0?wE:vE:Op&&Op in Object(e)?gE(e):bE(e)}function Qr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var SE="[object AsyncFunction]",EE="[object Function]",TE="[object GeneratorFunction]",AE="[object Proxy]";function ll(e){if(!Qr(e))return!1;var t=Gn(e);return t==EE||t==TE||t==SE||t==AE}var cl=Kr["__core-js_shared__"],kp=function(){var e=/[^.]+$/.exec(cl&&cl.keys&&cl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function RE(e){return!!kp&&kp in e}var _E=Function.prototype,IE=_E.toString;function Kn(e){if(e!=null){try{return IE.call(e)}catch{}try{return e+""}catch{}}return""}var CE=/[\\^$.*+?()[\]{}|]/g,FE=/^\[object .+?Constructor\]$/,PE=Function.prototype,xE=Object.prototype,OE=PE.toString,kE=xE.hasOwnProperty,NE=RegExp("^"+OE.call(kE).replace(CE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $E(e){if(!Qr(e)||RE(e))return!1;var t=ll(e)?NE:FE;return t.test(Kn(e))}function DE(e,t){return e==null?void 0:e[t]}function Qn(e,t){var r=DE(e,t);return $E(r)?r:void 0}var io=Qn(Kr,"Map"),oo=Qn(Object,"create");function LE(){this.__data__=oo?oo(null):{},this.size=0}function BE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ME="__lodash_hash_undefined__",jE=Object.prototype,UE=jE.hasOwnProperty;function qE(e){var t=this.__data__;if(oo){var r=t[e];return r===ME?void 0:r}return UE.call(t,e)?t[e]:void 0}var VE=Object.prototype,zE=VE.hasOwnProperty;function WE(e){var t=this.__data__;return oo?t[e]!==void 0:zE.call(t,e)}var HE="__lodash_hash_undefined__";function GE(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=oo&&t===void 0?HE:t,this}function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=LE,Xn.prototype.delete=BE,Xn.prototype.get=qE,Xn.prototype.has=WE,Xn.prototype.set=GE;function KE(){this.size=0,this.__data__={hash:new Xn,map:new(io||gn),string:new Xn}}function QE(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function fs(e,t){var r=e.__data__;return QE(t)?r[typeof t=="string"?"string":"hash"]:r.map}function XE(e){var t=fs(this,e).delete(e);return this.size-=t?1:0,t}function YE(e){return fs(this,e).get(e)}function JE(e){return fs(this,e).has(e)}function ZE(e,t){var r=fs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function mn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}mn.prototype.clear=KE,mn.prototype.delete=XE,mn.prototype.get=YE,mn.prototype.has=JE,mn.prototype.set=ZE;var e1=200;function t1(e,t){var r=this.__data__;if(r instanceof gn){var n=r.__data__;if(!io||n.length<e1-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new mn(n)}return r.set(e,t),this.size=r.size,this}function Xr(e){var t=this.__data__=new gn(e);this.size=t.size}Xr.prototype.clear=lE,Xr.prototype.delete=cE,Xr.prototype.get=uE,Xr.prototype.has=fE,Xr.prototype.set=t1;var ds=function(){try{var e=Qn(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ul(e,t,r){t=="__proto__"&&ds?ds(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function fl(e,t,r){(r!==void 0&&!ro(e[t],r)||r===void 0&&!(t in e))&&ul(e,t,r)}function r1(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),l=s.length;l--;){var c=s[++o];if(r(i[c],c,i)===!1)break}return t}}var n1=r1(),Np=typeof j=="object"&&j&&!j.nodeType&&j,$p=Np&&typeof module=="object"&&module&&!module.nodeType&&module,i1=$p&&$p.exports===Np,Dp=i1?Kr.Buffer:void 0,Lp=Dp?Dp.allocUnsafe:void 0;function Bp(e,t){if(t)return e.slice();var r=e.length,n=Lp?Lp(r):new e.constructor(r);return e.copy(n),n}var ps=Kr.Uint8Array;function dl(e){var t=new e.constructor(e.byteLength);return new ps(t).set(new ps(e)),t}function Mp(e,t){var r=t?dl(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function o1(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var jp=Object.create,s1=function(){function e(){}return function(t){if(!Qr(t))return{};if(jp)return jp(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Up(e,t){return function(r){return e(t(r))}}var pl=Up(Object.getPrototypeOf,Object),a1=Object.prototype;function hs(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||a1;return e===r}function l1(e){return typeof e.constructor=="function"&&!hs(e)?s1(pl(e)):{}}function Yr(e){return e!=null&&typeof e=="object"}var c1="[object Arguments]";function qp(e){return Yr(e)&&Gn(e)==c1}var Vp=Object.prototype,u1=Vp.hasOwnProperty,f1=Vp.propertyIsEnumerable,so=qp(function(){return arguments}())?qp:function(e){return Yr(e)&&u1.call(e,"callee")&&!f1.call(e,"callee")},Pr=Array.isArray,d1=9007199254740991;function zp(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=d1}function ao(e){return e!=null&&zp(e.length)&&!ll(e)}function p1(e){return Yr(e)&&ao(e)}function h1(){return!1}var Wp=typeof j=="object"&&j&&!j.nodeType&&j,Hp=Wp&&typeof module=="object"&&module&&!module.nodeType&&module,g1=Hp&&Hp.exports===Wp,Gp=g1?Kr.Buffer:void 0,m1=Gp?Gp.isBuffer:void 0,Ei=m1||h1,y1="[object Object]",b1=Function.prototype,v1=Object.prototype,Kp=b1.toString,w1=v1.hasOwnProperty,S1=Kp.call(Object);function hl(e){if(!Yr(e)||Gn(e)!=y1)return!1;var t=pl(e);if(t===null)return!0;var r=w1.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Kp.call(r)==S1}var E1="[object Arguments]",T1="[object Array]",A1="[object Boolean]",R1="[object Date]",_1="[object Error]",I1="[object Function]",C1="[object Map]",F1="[object Number]",P1="[object Object]",x1="[object RegExp]",O1="[object Set]",k1="[object String]",N1="[object WeakMap]",$1="[object ArrayBuffer]",D1="[object DataView]",L1="[object Float32Array]",B1="[object Float64Array]",M1="[object Int8Array]",j1="[object Int16Array]",U1="[object Int32Array]",q1="[object Uint8Array]",V1="[object Uint8ClampedArray]",z1="[object Uint16Array]",W1="[object Uint32Array]",wt={};wt[L1]=wt[B1]=wt[M1]=wt[j1]=wt[U1]=wt[q1]=wt[V1]=wt[z1]=wt[W1]=!0,wt[E1]=wt[T1]=wt[$1]=wt[A1]=wt[D1]=wt[R1]=wt[_1]=wt[I1]=wt[C1]=wt[F1]=wt[P1]=wt[x1]=wt[O1]=wt[k1]=wt[N1]=!1;function H1(e){return Yr(e)&&zp(e.length)&&!!wt[Gn(e)]}function gl(e){return function(t){return e(t)}}var Qp=typeof j=="object"&&j&&!j.nodeType&&j,lo=Qp&&typeof module=="object"&&module&&!module.nodeType&&module,G1=lo&&lo.exports===Qp,ml=G1&&Pp.process,Ti=function(){try{var e=lo&&lo.require&&lo.require("util").types;return e||ml&&ml.binding&&ml.binding("util")}catch{}}(),Xp=Ti&&Ti.isTypedArray,gs=Xp?gl(Xp):H1;function yl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var K1=Object.prototype,Q1=K1.hasOwnProperty;function Yp(e,t,r){var n=e[t];(!(Q1.call(e,t)&&ro(n,r))||r===void 0&&!(t in e))&&ul(e,t,r)}function Jp(e,t,r,n){var o=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var l=t[i],c=void 0;c===void 0&&(c=e[l]),o?ul(r,l,c):Yp(r,l,c)}return r}function X1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Y1=9007199254740991,J1=/^(?:0|[1-9]\d*)$/;function Zp(e,t){var r=typeof e;return t=t??Y1,!!t&&(r=="number"||r!="symbol"&&J1.test(e))&&e>-1&&e%1==0&&e<t}var Z1=Object.prototype,eT=Z1.hasOwnProperty;function eh(e,t){var r=Pr(e),n=!r&&so(e),o=!r&&!n&&Ei(e),i=!r&&!n&&!o&&gs(e),s=r||n||o||i,l=s?X1(e.length,String):[],c=l.length;for(var u in e)(t||eT.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Zp(u,c)))&&l.push(u);return l}function tT(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var rT=Object.prototype,nT=rT.hasOwnProperty;function iT(e){if(!Qr(e))return tT(e);var t=hs(e),r=[];for(var n in e)n=="constructor"&&(t||!nT.call(e,n))||r.push(n);return r}function bl(e){return ao(e)?eh(e,!0):iT(e)}function oT(e){return Jp(e,bl(e))}function sT(e,t,r,n,o,i,s){var l=yl(e,r),c=yl(t,r),u=s.get(c);if(u){fl(e,r,u);return}var a=i?i(l,c,r+"",e,t,s):void 0,f=a===void 0;if(f){var d=Pr(c),b=!d&&Ei(c),E=!d&&!b&&gs(c);a=c,d||b||E?Pr(l)?a=l:p1(l)?a=o1(l):b?(f=!1,a=Bp(c,!0)):E?(f=!1,a=Mp(c,!0)):a=[]:hl(c)||so(c)?(a=l,so(l)?a=oT(l):(!Qr(l)||ll(l))&&(a=l1(c))):f=!1}f&&(s.set(c,a),o(a,c,n,i,s),s.delete(c)),fl(e,r,a)}function th(e,t,r,n,o){e!==t&&n1(t,function(i,s){if(o||(o=new Xr),Qr(i))sT(e,t,s,r,th,n,o);else{var l=n?n(yl(e,s),i,s+"",e,t,o):void 0;l===void 0&&(l=i),fl(e,s,l)}},bl)}function rh(e){return e}function aT(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var nh=Math.max;function ih(e,t,r){return t=nh(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=nh(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=n[o];return l[t]=r(s),aT(e,this,l)}}function lT(e){return function(){return e}}var cT=ds?function(e,t){return ds(e,"toString",{configurable:!0,enumerable:!1,value:lT(t),writable:!0})}:rh,uT=800,fT=16,dT=Date.now;function pT(e){var t=0,r=0;return function(){var n=dT(),o=fT-(n-r);if(r=n,o>0){if(++t>=uT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var oh=pT(cT);function hT(e,t){return oh(ih(e,t,rh),e+"")}function gT(e,t,r){if(!Qr(r))return!1;var n=typeof t;return(n=="number"?ao(r)&&Zp(t,r.length):n=="string"&&t in r)?ro(r[t],e):!1}function mT(e){return hT(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&gT(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var l=r[n];l&&e(t,l,n,i)}return t})}var co=mT(function(e,t,r){th(e,t,r)});const vl=(e,...t)=>{const{href:r}=e.resolve(y(e.currentRoute));return t.map(n=>{const{href:o}=e.resolve({...n});return o==="/"||o==="#/"?!1:r.startsWith(o)}).some(Boolean)},uo=(...e)=>(t,...r)=>{if(!r.length)return vl(t,...e);const[n,...o]=r.map(i=>{const s=e.find(l=>l.name===i);if(!s)throw new Error(`unknown comparative '${i}'`);return s});return vl(t,n,...o)};function nB(e){return e}const fo=(e,...t)=>co({},{name:e},...t.map(r=>({...r.params&&{params:r.params},...r.query&&{query:r.query}}))),Ai=(e,t={})=>fo(e,t),sh=Ai("files-common-favorites"),ah=Ai("files-common-search"),Tt=uo(sh,ah),yT=e=>[{path:"/search",component:e.App,children:[{name:ah.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:sh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],xr=(e,t={})=>fo(e,t),lh=xr("files-spaces-projects"),wl=xr("files-spaces-generic"),ct=uo(lh,wl),bT=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:lh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:wl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],Or=(e,t={})=>fo(e,t),vT=Or("files-shares"),ms=Or("files-shares-with-me"),Sl=Or("files-shares-with-others"),El=Or("files-shares-via-link"),kt=uo(ms,Sl,El),wT=e=>[{name:vT.name,path:"/shares",component:e.App,redirect:ms,children:[{name:ms.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:Sl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:El.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Ri=(e,t={})=>fo(e,t),Tl=Ri("files-public-link"),Al=Ri("files-public-upload"),Ar=uo(Tl,Al),ST=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:Tl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:Al.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],_i=(e,t={})=>fo(e,t),ch=_i("files-trash-generic"),uh=_i("files-trash-overview"),Rr=uo(ch,uh),ET=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:uh.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:ch.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function fh(e){return{applicationConfig:V(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const TT=["anonymous","user","idp","publicLink","hybrid"],yn=e=>In(e),We=()=>yn("$router"),Jt=()=>We().currentRoute,Rl=e=>e.path.split("/")[1],AT=()=>{const e=Jt();return V(()=>Rl(y(e)))},Jr=(e,t={},r)=>{var o,i;const n=(r==null?void 0:r.configStore)||at();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...ie.isShareSpaceResource(e)&&{shareId:e.id},...((i=(o=n==null?void 0:n.options)==null?void 0:o.routing)==null?void 0:i.idBased)&&!Ct.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},RT=(e,t)=>{const r=document.querySelector("base"),n=!!r,o=new URL(window.location.href.split("#")[0]);return o.search="",n?o.pathname=new URL(r.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[n?"pathname":"hash"]=e.resolve(t).href,o.href},Zr=Qe.defineStore("apps",()=>{const e=ue({}),t=ue({}),r=ue([]),n=V(()=>Object.keys(y(e))),o=(c,u)=>{c.id&&(c.extensions&&c.extensions.forEach(a=>{i({appId:c.id,data:a})}),y(e)[c.id]={applicationMenu:c.applicationMenu||{enabled:()=>!1},defaultExtension:c.defaultExtension||"",icon:"check_box_outline_blank",name:c.name||c.id,translations:u,...c})},i=({appId:c,data:u})=>{var a,f,d;y(r).push({app:c,extension:u.extension,createFileHandler:u.createFileHandler,label:u.label,mimeType:u.mimeType,routeName:u.routeName,newFileMenu:u.newFileMenu,icon:u.icon,name:u.name,hasPriority:u.hasPriority||((d=(f=(a=y(t))==null?void 0:a[c])==null?void 0:f.priorityExtensions)==null?void 0:d.includes(u.extension))||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:n,fileExtensions:r,registerApp:o,registerFileExtension:i,loadExternalAppConfig:({appId:c,config:u})=>{t.value={...y(t),[c]:u}},isAppEnabled:c=>y(n).includes(c)}}),Yn=Qe.defineStore("auth",()=>{const e=ue(),t=ue(!1),r=ue(!1),n=ue(),o=ue(),i=ue(),s=ue(!1),l=b=>{e.value=b},c=b=>{t.value=b},u=b=>{r.value=b},a=b=>{n.value=b.publicLinkToken,o.value=b.publicLinkPassword,i.value=b.publicLinkType,s.value=b.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:r,publicLinkToken:n,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:s,setAccessToken:l,setIdpContextReady:c,setUserContextReady:u,setPublicLinkContext:a,clearUserContext:()=>{l(null),c(null),u(null)},clearPublicLinkContext:()=>{a({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),dh={core:{"support-sse":!1,"support-url-signing":!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:ie.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:[]}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},tr=Qe.defineStore("capabilities",()=>{const e=ue(!1),t=ue(dh),r=x=>{t.value=co({...dh},x.capabilities),e.value=!0},n=V(()=>y(t).core["support-url-signing"]),o=V(()=>y(t).core["support-sse"]),i=V(()=>y(t).graph["personal-data-export"]),s=V(()=>y(t).core.status),l=V(()=>y(t).dav.reports),c=V(()=>y(t).dav.trashbin),u=V(()=>y(t).spaces.max_quota),a=V(()=>y(t).spaces.projects),f=V(()=>y(t).graph.users.create_disabled),d=V(()=>y(t).graph.users.delete_disabled),b=V(()=>y(t).graph.users.change_password_self_disabled),E=V(()=>y(t).graph.users.read_only_attributes),w=V(()=>y(t).files.app_providers),R=V(()=>y(t).files.favorites),S=V(()=>y(t).files.thumbnail),m=V(()=>y(t).files.archivers),g=V(()=>y(t).files.privateLinks),v=V(()=>y(t).files.permanent_deletion),T=V(()=>y(t).files.tags),A=V(()=>y(t).files.undelete),F=V(()=>y(t).files_sharing.api_enabled),C=V(()=>y(t).files_sharing.deny_access),I=V(()=>y(t).files_sharing.can_rename),L=V(()=>y(t).files_sharing.allow_custom),B=V(()=>{var x;return(x=y(t).files_sharing.public)==null?void 0:x.enabled}),$=V(()=>{var x;return(x=y(t).files_sharing.public)==null?void 0:x.can_edit}),D=V(()=>{var x;return(x=y(t).files_sharing.public)==null?void 0:x.can_contribute}),H=V(()=>{var x;return(x=y(t).files_sharing.public)==null?void 0:x.alias}),ee=V(()=>{var x;return(x=y(t).files_sharing.public)==null?void 0:x.default_permissions}),J=V(()=>{var x;return(x=y(t).files_sharing.public)==null?void 0:x.password.enforced_for}),ce=V(()=>y(t).files_sharing.search_min_length),be=V(()=>{var x;return(x=y(t).files_sharing.user)==null?void 0:x.profile_picture}),de=V(()=>{var x;return(x=y(t).files.tus_support)==null?void 0:x.max_chunk_size}),Se=V(()=>{var x;return(x=y(t).files.tus_support)==null?void 0:x.extension}),Ae=V(()=>{var x;return(x=y(t).files.tus_support)==null?void 0:x.http_method_override}),ne=V(()=>y(t).notifications["ocs-endpoints"]),ae=V(()=>y(t).password_policy),le=V(()=>{var x;return(x=y(t).search.property)==null?void 0:x.mtime}),oe=V(()=>{var x;return(x=y(t).search.property)==null?void 0:x.mediatype}),Q=V(()=>{var x;return(x=y(t).search.property)==null?void 0:x.content});return{isInitialized:e,capabilities:t,setCapabilities:r,status:s,supportUrlSigning:n,supportSSE:o,personalDataExport:i,davReports:l,davTrashbin:c,spacesMaxQuota:u,spacesProjects:a,graphUsersCreateDisabled:f,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:b,graphUsersReadOnlyAttributes:E,filesAppProviders:w,filesFavorites:R,filesThumbnail:S,filesArchivers:m,filesPrivateLinks:g,filesPermanentDeletion:v,filesTags:T,filesUndelete:A,sharingApiEnabled:F,sharingDenyAccess:C,sharingCanRename:I,sharingAllowCustom:L,sharingPublicEnabled:B,sharingPublicCanEdit:$,sharingPublicCanContribute:D,sharingPublicAlias:H,sharingPublicDefaultPermissions:ee,sharingPublicPasswordEnforcedFor:J,sharingSearchMinLength:ce,sharingUserProfilePicture:be,tusMaxChunkSize:de,tusExtension:Se,tusHttpMethodOverride:Ae,notificationsOcsEndpoints:ne,passwordPolicy:ae,searchLastMofifiedDate:le,searchMediaType:oe,searchContent:Q}});class _T{constructor(t,r){Ee(this,"value");Ee(this,"expires");this.value=t,this.expires=r?new Date().getTime()+r:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class _l{constructor(t){Ee(this,"map");Ee(this,"ttl");Ee(this,"capacity");this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,r,n){return this.evict(),this.map.set(t,new _T(r,isNaN(n)?this.ttl:n)),r}get(t){this.evict();const r=this.map.get(t);if(r)return r.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,r)=>{t.expired&&this.delete(r)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const ys=async({graphClient:e,spacesStore:t,space:r,signal:n})=>{const o=await t.getMountPointForSpace({graphClient:e,space:r,signal:n});if(!o)return null;const{id:i}=o;return e.driveItems.getDriveItem(i.split("!")[0],i)},IT=({sharedAncestor:e,matchingSpace:t})=>t?xr("files-spaces-generic",Jr(t,{path:e.path,fileId:e.id})):{},CT=e=>{var r;const t=(r=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:r[0];t&&t.focus()};class Jn{}Ee(Jn,"sortByQueryName","sort-by"),Ee(Jn,"sortDirQueryName","sort-dir");var FT="[object Symbol]";function bs(e){return typeof e=="symbol"||Yr(e)&&Gn(e)==FT}var PT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xT=/^\w*$/;function OT(e,t){if(Pr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||bs(e)?!0:xT.test(e)||!PT.test(e)||t!=null&&e in Object(t)}var kT="Expected a function";function Il(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(kT);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(Il.Cache||mn),r}Il.Cache=mn;var NT=500;function $T(e){var t=Il(e,function(n){return r.size===NT&&r.clear(),n}),r=t.cache;return t}var DT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LT=/\\(\\)?/g,BT=$T(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(DT,function(r,n,o,i){t.push(o?i.replace(LT,"$1"):n||r)}),t});function ph(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var hh=Fr?Fr.prototype:void 0,gh=hh?hh.toString:void 0;function mh(e){if(typeof e=="string")return e;if(Pr(e))return ph(e,mh)+"";if(bs(e))return gh?gh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Cl(e){return e==null?"":mh(e)}function Fl(e,t){return Pr(e)?e:OT(e,t)?[e]:BT(Cl(e))}function yh(e){if(typeof e=="string"||bs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bh(e,t){t=Fl(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[yh(t[r++])];return r&&r==n?e:void 0}function Pl(e,t,r){var n=e==null?void 0:bh(e,t);return n===void 0?r:n}var Ft=(e=>(e.Desc="desc",e.Asc="asc",e))(Ft||{});function MT(e){const t=We(),r=jT(e),n=UT(e),o=V(()=>{var u;return wh(y(r))||y((u=xl(y(s)))==null?void 0:u.name)}),i=V(()=>VT(y(n))||qT(y(o),y(s))),s=e.fields;return{items:V(()=>{const u=y(e.items);return y(o)?vh(u,y(s),y(o),y(i)):u}),sortBy:o,sortDir:i,handleSort:({sortBy:u,sortDir:a})=>t.replace({query:{...y(t.currentRoute).query,[y(e.sortByQueryName)||Jn.sortByQueryName]:u,[y(e.sortDirQueryName)||Jn.sortDirQueryName]:a}})}}function jT(e){var t;return e.sortBy?Dt(e.sortBy)?e.sortBy:ue(e.sortBy):wn({name:y(e.sortByQueryName)||Jn.sortByQueryName,defaultValue:y((t=xl(y(e.fields)))==null?void 0:t.name),storagePrefix:y(e.routeName)||y(Qs())})}function UT(e){var t;return e.sortDir?Dt(e.sortDir)?e.sortDir:ue(e.sortDir):wn({name:y(e.sortDirQueryName)||Jn.sortDirQueryName,defaultValue:y((t=xl(y(e.fields)))==null?void 0:t.sortDir),storagePrefix:y(e.routeName)||y(Qs())})}const xl=e=>{const t=e.filter(r=>r.sortable);return t?t[0]:null},qT=(e,t)=>{const r=t.find(n=>n.name===e);return r&&r.sortDir?y(r.sortDir):"desc"},vh=(e,t,r,n)=>{const o=t.find(l=>l.name===r);if(!o)return e;const{sortable:i}=o,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(r==="name"){const l=[...e.filter(u=>u.type==="folder")].sort((u,a)=>Ol(u,a,s,r,n,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,a)=>Ol(u,a,s,r,n,i));return n==="asc"?l.concat(c):c.concat(l)}return[...e].sort((l,c)=>Ol(l,c,s,o.prop||o.name,n,i))},Ol=(e,t,r,n,o,i)=>{let s=Pl(e,n),l=Pl(t,n);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const a=f=>f.map(d=>d[i]).join("");s=a(s),l=a(l)}else typeof i=="function"&&(s=i(s),l=i(l));return!isNaN(s)&&!isNaN(l)?(s-l)*c:r.compare((s||"").toString(),(l||"").toString())*c},wh=e=>Array.isArray(e)?e[0]:e,VT=e=>{switch(wh(e)){case"asc":return"asc";case"desc":return"desc"}return null},Sh=e=>e?[{name:"name",sortable:!0,sortDir:Ft.Asc},{name:"size",sortable:!0,sortDir:Ft.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((r,n)=>r.shareType!==n.shareType?r.shareType<n.shareType?-1:1:r.displayName<n.displayName?-1:1).map(r=>r.displayName).join():!1,sortDir:Ft.Asc},{name:"owner",sortable:"displayName",sortDir:Ft.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Ft.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Ft.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Ft.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function iB(e){return e}const Eh=[{label:"A-Z",name:"name",sortable:!0,sortDir:Ft.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Ft.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Ft.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Ft.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Ft.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Ft.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Ft.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Ft.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Ft.Desc}],zT=e=>e?Eh.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],WT=(e,{$gettext:t})=>e.map(r=>({...r,label:t(r.label)})),HT=ye.z.object({icon:ye.z.string(),name:ye.z.string(),secure_view:ye.z.boolean().optional().default(!1),target_ext:ye.z.string().optional()}),GT=ye.z.object({allow_creation:ye.z.boolean().optional(),app_providers:ye.z.array(HT),default_application:ye.z.string().optional(),description:ye.z.string().optional(),ext:ye.z.string().optional(),mime_type:ye.z.string(),name:ye.z.string().optional()}),Th=ye.z.object({"mime-types":ye.z.array(GT)});class KT{constructor(t,r){Ee(this,"_mimeTypes",ue([]));Ee(this,"serverUrl");Ee(this,"clientService");this.serverUrl=t,this.clientService=r}async loadData(){const t=ie.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":r}}=await this.clientService.httpUnAuthenticated.get(t,{schema:Th});this._mimeTypes.value=r}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return y(this._mimeTypes)}get templateMimeTypes(){return y(this._mimeTypes).filter(t=>!!t.app_providers.some(r=>!!r.target_ext))}get appNames(){return[...new Set(y(this._mimeTypes).flatMap(t=>t.app_providers.map(r=>r.name)))]}getMimeTypesByAppName(t){return y(this._mimeTypes).filter(r=>r.app_providers.some(n=>n.name===t))}}var Ah={},vs={};vs.byteLength=YT,vs.toByteArray=ZT,vs.fromByteArray=rA;for(var en=[],kr=[],QT=typeof Uint8Array<"u"?Uint8Array:Array,kl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ii=0,XT=kl.length;Ii<XT;++Ii)en[Ii]=kl[Ii],kr[kl.charCodeAt(Ii)]=Ii;kr[45]=62,kr[95]=63;function Rh(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function YT(e){var t=Rh(e),r=t[0],n=t[1];return(r+n)*3/4-n}function JT(e,t,r){return(t+r)*3/4-r}function ZT(e){var t,r=Rh(e),n=r[0],o=r[1],i=new QT(JT(e,n,o)),s=0,l=o>0?n-4:n,c;for(c=0;c<l;c+=4)t=kr[e.charCodeAt(c)]<<18|kr[e.charCodeAt(c+1)]<<12|kr[e.charCodeAt(c+2)]<<6|kr[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=kr[e.charCodeAt(c)]<<2|kr[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=kr[e.charCodeAt(c)]<<10|kr[e.charCodeAt(c+1)]<<4|kr[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function eA(e){return en[e>>18&63]+en[e>>12&63]+en[e>>6&63]+en[e&63]}function tA(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(eA(n));return o.join("")}function rA(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,l=r-n;s<l;s+=i)o.push(tA(e,s,s+i>l?l:s+i));return n===1?(t=e[r-1],o.push(en[t>>2]+en[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(en[t>>10]+en[t>>4&63]+en[t<<2&63]+"=")),o.join("")}var Nl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Nl.read=function(e,t,r,n,o){var i,s,l=o*8-n-1,c=(1<<l)-1,u=c>>1,a=-7,f=r?o-1:0,d=r?-1:1,b=e[t+f];for(f+=d,i=b&(1<<-a)-1,b>>=-a,a+=l;a>0;i=i*256+e[t+f],f+=d,a-=8);for(s=i&(1<<-a)-1,i>>=-a,a+=n;a>0;s=s*256+e[t+f],f+=d,a-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-u}return(b?-1:1)*s*Math.pow(2,i-n)},Nl.write=function(e,t,r,n,o,i){var s,l,c,u=i*8-o-1,a=(1<<u)-1,f=a>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,E=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=a):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=a?(l=0,s=a):s+f>=1?(l=(t*c-1)*Math.pow(2,o),s=s+f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+b]=l&255,b+=E,l/=256,o-=8);for(s=s<<o|l,u+=o;u>0;e[r+b]=s&255,b+=E,s/=256,u-=8);e[r+b-E]|=w*128};/*!
3
+ `,...kw(o)),console.warn(...i)}Vi(),Da=!1}function Ow(){let e=zn[zn.length-1];if(!e)return[];const t=[];for(;e;){const r=t[0];r&&r.vnode===e?r.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function kw(e){const t=[];return e.forEach((r,n)=>{t.push(...n===0?[]:[`
4
+ `],...Nw(r))}),t}function Nw({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,o=` at <${gp(e.component,e.type,n)}`,i=">"+r;return e.props?[o,...$w(e.props),i]:[o+i]}function $w(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...xd(n,e[n]))}),r.length>3&&t.push(" ..."),t}function xd(e,t,r){return K.isString(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Lt(t)?(t=xd(e,nt(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):K.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=nt(t),r?t:[`${e}=`,t])}const La={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 Qo(e,t,r,n){try{return n?e(...n):e()}catch(o){Xo(o,t,r)}}function Ba(e,t,r,n){if(K.isFunction(e)){const o=Qo(e,t,r,n);return o&&K.isPromise(o)&&o.catch(i=>{Xo(i,t,r)}),o}if(K.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Ba(e[i],t,r,n));return o}else ye.env.NODE_ENV!=="production"&&tt(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Xo(e,t,r,n=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||K.EMPTY_OBJ;if(t){let l=t.parent;const c=t.proxy,u=ye.env.NODE_ENV!=="production"?La[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;l;){const a=l.ec;if(a){for(let f=0;f<a.length;f++)if(a[f](e,c,u)===!1)return}l=l.parent}if(i){qi(),Qo(i,null,10,[e,c,u]),Vi();return}}Dw(e,r,o,n,s)}function Dw(e,t,r,n=!0,o=!1){if(ye.env.NODE_ENV!=="production"){const i=La[t];if(r&&Pw(r),tt(`Unhandled error${i?` during execution of ${i}`:""}`),r&&xw(),n)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const Cr=[];let pn=-1;const mi=[];let _n=null,yi=0;const Od=Promise.resolve();let Yo=null;const Lw=100;function Hr(e){const t=Yo||Od;return e?t.then(this?e.bind(this):e):t}function Bw(e){let t=pn+1,r=Cr.length;for(;t<r;){const n=t+r>>>1,o=Cr[n],i=Gi(o);i<e||i===e&&o.flags&2?t=n+1:r=n}return t}function Ma(e){if(!(e.flags&1)){const t=Gi(e),r=Cr[Cr.length-1];!r||!(e.flags&2)&&t>=Gi(r)?Cr.push(e):Cr.splice(Bw(t),0,e),e.flags|=1,kd()}}function kd(){Yo||(Yo=Od.then($d))}function Nd(e){K.isArray(e)?mi.push(...e):_n&&e.id===-1?_n.splice(yi+1,0,e):e.flags&1||(mi.push(e),e.flags|=1),kd()}function Mw(e){if(mi.length){const t=[...new Set(mi)].sort((r,n)=>Gi(r)-Gi(n));if(mi.length=0,_n){_n.push(...t);return}for(_n=t,ye.env.NODE_ENV!=="production"&&(e=e||new Map),yi=0;yi<_n.length;yi++){const r=_n[yi];ye.env.NODE_ENV!=="production"&&Dd(e,r)||(r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2)}_n=null,yi=0}}const Gi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function $d(e){ye.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ye.env.NODE_ENV!=="production"?r=>Dd(e,r):K.NOOP;try{for(pn=0;pn<Cr.length;pn++){const r=Cr[pn];if(r&&!(r.flags&8)){if(ye.env.NODE_ENV!=="production"&&t(r))continue;r.flags&4&&(r.flags&=-2),Qo(r,r.i,r.i?15:14),r.flags&4||(r.flags&=-2)}}}finally{for(;pn<Cr.length;pn++){const r=Cr[pn];r&&(r.flags&=-2)}pn=-1,Cr.length=0,Mw(e),Yo=null,(Cr.length||mi.length)&&$d(e)}}function Dd(e,t){const r=e.get(t)||0;if(r>Lw){const n=t.i,o=n&&tl(n.type);return Xo(`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,r+1),!1}let Ki=!1;const ja=new Map;ye.env.NODE_ENV!=="production"&&(K.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Ua(jw),rerender:Ua(Uw),reload:Ua(qw)});const Jo=new Map;function jw(e,t){return Jo.has(e)?!1:(Jo.set(e,{initialDef:Zo(t),instances:new Set}),!0)}function Zo(e){return mp(e)?e.__vccOpts:e}function Uw(e,t){const r=Jo.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,Zo(n.type).render=t),n.renderCache=[],Ki=!0,n.update(),Ki=!1}))}function qw(e,t){const r=Jo.get(e);if(!r)return;t=Zo(t),Ld(r.initialDef,t);const n=[...r.instances];for(let o=0;o<n.length;o++){const i=n[o],s=Zo(i.type);let l=ja.get(s);l||(s!==r.initialDef&&Ld(s,t),ja.set(s,l=new Set)),l.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(l.add(i),i.ceReload(t.styles),l.delete(i)):i.parent?Ma(()=>{Ki=!0,i.parent.update(),Ki=!1,l.delete(i)}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(s)}Nd(()=>{ja.clear()})}function Ld(e,t){K.extend(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function Ua(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let In,Qi=[],qa=!1;function Vw(e,...t){In?In.emit(e,...t):qa||Qi.push({event:e,args:t})}function Bd(e,t){var r,n;In=e,In?(In.enabled=!0,Qi.forEach(({event:o,args:i})=>In.emit(o,...i)),Qi=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{Bd(i,t)}),setTimeout(()=>{In||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,qa=!0,Qi=[])},3e3)):(qa=!0,Qi=[])}const zw=Ww("component:updated");/*! #__NO_SIDE_EFFECTS__ */function Ww(e){return t=>{Vw(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Xt=null,Md=null;function jd(e){const t=Xt;return Xt=e,Md=e&&e.type.__scopeId||null,t}function Te(e,t=Xt,r){if(!t||e._n)return e;const n=(...o)=>{n._d&&ap(-1);const i=jd(t);let s;try{s=e(...o)}finally{jd(i),n._d&&ap(1)}return ye.env.NODE_ENV!=="production"&&zw(t),s};return n._n=!0,n._c=!0,n._d=!0,n}function at(e,t){if(Xt===null)return ye.env.NODE_ENV!=="production"&&tt("withDirectives can only be used inside render functions."),e;const r=hp(Xt),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,s,l,c=K.EMPTY_OBJ]=t[o];i&&(K.isFunction(i)&&(i={mounted:i,updated:i}),i.deep&&dn(s),n.push({dir:i,instance:r,value:s,oldValue:void 0,arg:l,modifiers:c}))}return e}const Hw=Symbol("_vte"),Gw=e=>e.__isTeleport,Wn=e=>e&&(e.disabled||e.disabled===""),Ud=e=>e&&(e.defer||e.defer===""),qd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Vd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Va=(e,t)=>{const r=e&&e.to;if(K.isString(r))if(t){const n=t(r);return ye.env.NODE_ENV!=="production"&&!n&&!Wn(e)&&tt(`Failed to locate Teleport target with selector "${r}". 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.`),n}else return ye.env.NODE_ENV!=="production"&&tt("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ye.env.NODE_ENV!=="production"&&!r&&!Wn(e)&&tt(`Invalid Teleport target: ${r}`),r},zd={name:"Teleport",__isTeleport:!0,process(e,t,r,n,o,i,s,l,c,u){const{mc:a,pc:f,pbc:d,o:{insert:b,querySelector:E,createText:S,createComment:T}}=u,w=Wn(t.props);let{shapeFlag:y,children:g,dynamicChildren:v}=t;if(ye.env.NODE_ENV!=="production"&&Ki&&(c=!1,v=null),e==null){const A=t.el=ye.env.NODE_ENV!=="production"?T("teleport start"):S(""),R=t.anchor=ye.env.NODE_ENV!=="production"?T("teleport end"):S("");b(A,r,n),b(R,r,n);const C=(_,L)=>{y&16&&(o&&o.isCE&&(o.ce._teleportTarget=_),a(g,_,L,o,i,s,l,c))},P=()=>{const _=t.target=Va(t.props,E),L=Hd(_,t,S,b);_?(s!=="svg"&&qd(_)?s="svg":s!=="mathml"&&Vd(_)&&(s="mathml"),w||(C(_,L),ts(t,!1))):ye.env.NODE_ENV!=="production"&&!w&&tt("Invalid Teleport target on mount:",_,`(${typeof _})`)};w&&(C(r,R),ts(t,!0)),Ud(t.props)?Xa(()=>{P(),t.el.__isMounted=!0},i):P()}else{if(Ud(t.props)&&!e.el.__isMounted){Xa(()=>{zd.process(e,t,r,n,o,i,s,l,c,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const A=t.anchor=e.anchor,R=t.target=e.target,C=t.targetAnchor=e.targetAnchor,P=Wn(e.props),_=P?r:R,L=P?A:C;if(s==="svg"||qd(R)?s="svg":(s==="mathml"||Vd(R))&&(s="mathml"),v?(d(e.dynamicChildren,v,_,o,i,s,l),ip(e,t,!0)):c||f(e,t,_,L,o,i,s,l,!1),w)P?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):es(t,r,A,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const B=t.target=Va(t.props,E);B?es(t,B,null,u,0):ye.env.NODE_ENV!=="production"&&tt("Invalid Teleport target on update:",R,`(${typeof R})`)}else P&&es(t,R,C,u,1);ts(t,w)}},remove(e,t,r,{um:n,o:{remove:o}},i){const{shapeFlag:s,children:l,anchor:c,targetStart:u,targetAnchor:a,target:f,props:d}=e;if(f&&(o(u),o(a)),i&&o(c),s&16){const b=i||!Wn(d);for(let E=0;E<l.length;E++){const S=l[E];n(S,t,r,b,!!S.dynamicChildren)}}},move:es,hydrate:Kw};function es(e,t,r,{o:{insert:n},m:o},i=2){i===0&&n(e.targetAnchor,t,r);const{el:s,anchor:l,shapeFlag:c,children:u,props:a}=e,f=i===2;if(f&&n(s,t,r),(!f||Wn(a))&&c&16)for(let d=0;d<u.length;d++)o(u[d],t,r,2);f&&n(l,t,r)}function Kw(e,t,r,n,o,i,{o:{nextSibling:s,parentNode:l,querySelector:c,insert:u,createText:a}},f){const d=t.target=Va(t.props,c);if(d){const b=Wn(t.props),E=d._lpa||d.firstChild;if(t.shapeFlag&16)if(b)t.anchor=f(s(e),t,l(e),r,n,o,i),t.targetStart=E,t.targetAnchor=E&&s(E);else{t.anchor=s(e);let S=E;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,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}}S=s(S)}t.targetAnchor||Hd(d,t,a,u),f(E&&s(E),t,d,r,n,o,i)}ts(t,b)}return t.anchor&&s(t.anchor)}const Wd=zd;function ts(e,t){const r=e.ctx;if(r&&r.ut){let n,o;for(t?(n=e.el,o=e.anchor):(n=e.targetStart,o=e.targetAnchor);n&&n!==o;)n.nodeType===1&&n.setAttribute("data-v-owner",r.uid),n=n.nextSibling;r.ut()}}function Hd(e,t,r,n){const o=t.targetStart=r(""),i=t.targetAnchor=r("");return o[Hw]=i,e&&(n(o,e),n(i,e)),i}function Gd(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Gd(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function je(e,t){return K.isFunction(e)?K.extend({name:e.name},t,{setup:e}):e}function Qw(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Xw=new WeakSet;function Yw(e){const t=Za(),r=yw(null);if(t){const o=t.refs===K.EMPTY_OBJ?t.refs={}:t.refs;let i;ye.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?tt(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>r.value,set:s=>r.value=s})}else ye.env.NODE_ENV!=="production"&&tt("useTemplateRef() is called when there is no active component instance to be associated with.");const n=ye.env.NODE_ENV!=="production"?un(r):r;return ye.env.NODE_ENV!=="production"&&Xw.add(n),n}const Kd=e=>e.nodeType===8;K.getGlobalThis().requestIdleCallback,K.getGlobalThis().cancelIdleCallback;function Jw(e,t){if(Kd(e)&&e.data==="["){let r=1,n=e.nextSibling;for(;n;){if(n.nodeType===1){if(t(n)===!1)break}else if(Kd(n))if(n.data==="]"){if(--r===0)break}else n.data==="["&&r++;n=n.nextSibling}}else t(e)}const Zw=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function eS(e){K.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:r,errorComponent:n,delay:o=200,hydrate:i,timeout:s,suspensible:l=!0,onError:c}=e;let u=null,a,f=0;const d=()=>(f++,u=null,b()),b=()=>{let E;return u||(E=u=t().catch(S=>{if(S=S instanceof Error?S:new Error(String(S)),c)return new Promise((T,w)=>{c(S,()=>T(d()),()=>w(S),f+1)});throw S}).then(S=>{if(E!==u&&u)return u;if(ye.env.NODE_ENV!=="production"&&!S&&tt("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),S&&(S.__esModule||S[Symbol.toStringTag]==="Module")&&(S=S.default),ye.env.NODE_ENV!=="production"&&S&&!K.isObject(S)&&!K.isFunction(S))throw new Error(`Invalid async component load result: ${S}`);return a=S,S}))};return je({name:"AsyncComponentWrapper",__asyncLoader:b,__asyncHydrate(E,S,T){const w=i?()=>{const y=i(T,g=>Jw(E,g));y&&(S.bum||(S.bum=[])).push(y)}:T;a?w():b().then(()=>!S.isUnmounted&&w())},get __asyncResolved(){return a},setup(){const E=vr;if(Qw(E),a)return()=>za(a,E);const S=g=>{u=null,Xo(g,E,13,!n)};if(l&&E.suspense||Si)return b().then(g=>()=>za(g,E)).catch(g=>(S(g),()=>n?be(n,{error:g}):null));const T=ce(!1),w=ce(),y=ce(!!o);return o&&setTimeout(()=>{y.value=!1},o),s!=null&&setTimeout(()=>{if(!T.value&&!w.value){const g=new Error(`Async component timed out after ${s}ms.`);S(g),w.value=g}},s),b().then(()=>{T.value=!0,E.parent&&tS(E.parent.vnode)&&E.parent.update()}).catch(g=>{S(g),w.value=g}),()=>{if(T.value&&a)return za(a,E);if(w.value&&n)return be(n,{error:w.value});if(r&&!y.value)return be(r)}}})}function za(e,t){const{ref:r,props:n,children:o,ce:i}=t.vnode,s=be(e,n,o);return s.ref=r,s.ce=i,delete t.vnode.ce,s}const tS=e=>e.type.__isKeepAlive;function rS(e,t,r=vr,n=!1){if(r){const o=r[e]||(r[e]=[]),i=t.__weh||(t.__weh=(...s)=>{qi();const l=dp(r),c=Ba(t,r,e,s);return l(),Vi(),c});return n?o.unshift(i):o.push(i),i}else if(ye.env.NODE_ENV!=="production"){const o=K.toHandlerKey(La[e].replace(/ hook$/,""));tt(`${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 rs=e=>(t,r=vr)=>{(!Si||e==="sp")&&rS(e,(...n)=>t(...n),r)},qt=rs("m"),nS=rs("bu"),Gr=rs("bum"),Wa=rs("um"),ns="components",iS="directives";function de(e,t){return Ha(ns,e,!0,t)||e}const Qd=Symbol.for("v-ndc");function Hn(e){return K.isString(e)?Ha(ns,e,!1)||e:e||Qd}function ur(e){return Ha(iS,e)}function Ha(e,t,r=!0,n=!1){const o=Xt||vr;if(o){const i=o.type;if(e===ns){const l=tl(i,!1);if(l&&(l===t||l===K.camelize(t)||l===K.capitalize(K.camelize(t))))return i}const s=Xd(o[e]||i[e],t)||Xd(o.appContext[e],t);if(!s&&n)return i;if(ye.env.NODE_ENV!=="production"&&r&&!s){const l=e===ns?`
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}${l}`)}return s}else ye.env.NODE_ENV!=="production"&&tt(`resolve${K.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Xd(e,t){return e&&(e[t]||e[K.camelize(t)]||e[K.capitalize(K.camelize(t))])}function kt(e,t,r,n){let o;const i=r,s=K.isArray(e);if(s||K.isString(e)){const l=s&&qn(e);let c=!1;l&&(c=!cr(e),e=qo(e)),o=new Array(e.length);for(let u=0,a=e.length;u<a;u++)o[u]=t(c?ir(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){ye.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&tt(`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,i)}else if(K.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(l,c)=>t(l,c,void 0,i));else{const l=Object.keys(e);o=new Array(l.length);for(let c=0,u=l.length;c<u;c++){const a=l[c];o[c]=t(e[a],a,c,i)}}else o=[];return o}function Yd(e,t){for(let r=0;r<t.length;r++){const n=t[r];if(K.isArray(n))for(let o=0;o<n.length;o++)e[n[o].name]=n[o].fn;else n&&(e[n.name]=n.key?(...o)=>{const i=n.fn(...o);return i&&(i.key=n.key),i}:n.fn)}return e}function Ke(e,t,r={},n,o){if(Xt.ce||Xt.parent&&Zw(Xt.parent)&&Xt.parent.ce)return t!=="default"&&(r.name=t),te(),Ce(Xe,null,[be("slot",r,n&&n())],64);let i=e[t];ye.env.NODE_ENV!=="production"&&i&&i.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."),i=()=>[]),i&&i._c&&(i._d=!1),te();const s=i&&Jd(i(r)),l=r.key||s&&s.key,c=Ce(Xe,{key:(l&&!K.isSymbol(l)?l:`_${t}`)+(!s&&n?"_fb":"")},s||(n?n():[]),s&&e._===1?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function Jd(e){return e.some(t=>ss(t)?!(t.type===vi||t.type===Xe&&!Jd(t.children)):!0)?e:null}function Ga(e,t){const r={};if(ye.env.NODE_ENV!=="production"&&!K.isObject(e))return tt("v-on with no argument expects an object value."),r;for(const n in e)r[t&&/[A-Z]/.test(n)?`on:${n}`:K.toHandlerKey(n)]=e[n];return r}const Ka=e=>e?TS(e)?hp(e):Ka(e.parent):null,Qa=K.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ye.env.NODE_ENV!=="production"?Wo(e.props):e.props,$attrs:e=>ye.env.NODE_ENV!=="production"?Wo(e.attrs):e.attrs,$slots:e=>ye.env.NODE_ENV!=="production"?Wo(e.slots):e.slots,$refs:e=>ye.env.NODE_ENV!=="production"?Wo(e.refs):e.refs,$parent:e=>Ka(e.parent),$root:e=>Ka(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lS(e),$forceUpdate:e=>e.f||(e.f=()=>{Ma(e.update)}),$nextTick:e=>e.n||(e.n=Hr.bind(e.proxy)),$watch:e=>mS.bind(e)}),oS={};ye.env.NODE_ENV!=="production"&&(oS.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 sS(){return aS().slots}function aS(){const e=Za();return ye.env.NODE_ENV!=="production"&&!e&&tt("useContext() called without active instance."),e.setupContext||(e.setupContext=RS(e))}function Zd(e){return K.isArray(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function lS(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,l=i.get(t);let c;return l?c=l:!o.length&&!r&&!n?c=t:(c={},o.length&&o.forEach(u=>is(c,u,s,!0)),is(c,t,s)),K.isObject(t)&&i.set(t,c),c}function is(e,t,r,n=!1){const{mixins:o,extends:i}=t;i&&is(e,i,r,!0),o&&o.forEach(s=>is(e,s,r,!0));for(const s in t)if(n&&s==="expose")ye.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 l=cS[s]||r&&r[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const cS={data:ep,props:rp,emits:rp,methods:Xi,computed:Xi,beforeCreate:fr,created:fr,beforeMount:fr,mounted:fr,beforeUpdate:fr,updated:fr,beforeDestroy:fr,beforeUnmount:fr,destroyed:fr,unmounted:fr,activated:fr,deactivated:fr,errorCaptured:fr,serverPrefetch:fr,components:Xi,directives:Xi,watch:fS,provide:ep,inject:uS};function ep(e,t){return t?e?function(){return K.extend(K.isFunction(e)?e.call(this,this):e,K.isFunction(t)?t.call(this,this):t)}:t:e}function uS(e,t){return Xi(tp(e),tp(t))}function tp(e){if(K.isArray(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function fr(e,t){return e?[...new Set([].concat(e,t))]:t}function Xi(e,t){return e?K.extend(Object.create(null),e,t):t}function rp(e,t){return e?K.isArray(e)&&K.isArray(t)?[...new Set([...e,...t])]:K.extend(Object.create(null),Zd(e),Zd(t??{})):t}function fS(e,t){if(!e)return t;if(!t)return e;const r=K.extend(Object.create(null),e);for(const n in t)r[n]=fr(e[n],t[n]);return r}let dS=null;function bi(e,t){if(!vr)ye.env.NODE_ENV!=="production"&&tt("provide() can only be used inside setup().");else{let r=vr.provides;const n=vr.parent&&vr.parent.provides;n===r&&(r=vr.provides=Object.create(n)),r[e]=t}}function Cn(e,t,r=!1){const n=vr||Xt;if(n||dS){const o=n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return r&&K.isFunction(t)?t.call(n&&n.proxy):t;ye.env.NODE_ENV!=="production"&&tt(`injection "${String(e)}" not found.`)}else ye.env.NODE_ENV!=="production"&&tt("inject() can only be used inside setup() or functional components.")}const pS={},np=e=>Object.getPrototypeOf(e)===pS,Xa=vS;function ip(e,t,r=!1){const n=e.children,o=t.children;if(K.isArray(n)&&K.isArray(o))for(let i=0;i<n.length;i++){const s=n[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=ES(o[i]),l.el=s.el),!r&&l.patchFlag!==-2&&ip(s,l)),l.type===sp&&(l.el=s.el),ye.env.NODE_ENV!=="production"&&l.type===vi&&!l.el&&(l.el=s.el)}}const hS=Symbol.for("v-scx"),gS=()=>{{const e=Cn(hS);return e||ye.env.NODE_ENV!=="production"&&tt("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Tt(e,t,r){return ye.env.NODE_ENV!=="production"&&!K.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."),op(e,t,r)}function op(e,t,r=K.EMPTY_OBJ){const{immediate:n,deep:o,flush:i,once:s}=r;ye.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&tt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==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 l=K.extend({},r);ye.env.NODE_ENV!=="production"&&(l.onWarn=tt);const c=t&&n||!t&&i!=="post";let u;if(Si){if(i==="sync"){const b=gS();u=b.__watcherHandles||(b.__watcherHandles=[])}else if(!c){const b=()=>{};return b.stop=K.NOOP,b.resume=K.NOOP,b.pause=K.NOOP,b}}const a=vr;l.call=(b,E,S)=>Ba(b,a,E,S);let f=!1;i==="post"?l.scheduler=b=>{Xa(b,a&&a.suspense)}:i!=="sync"&&(f=!0,l.scheduler=(b,E)=>{E?b():Ma(b)}),l.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,a&&(b.id=a.uid,b.i=a))};const d=Fw(e,t,l);return Si&&(u?u.push(d):c&&d()),d}function mS(e,t,r){const n=this.proxy,o=K.isString(e)?e.includes(".")?yS(n,e):()=>n[e]:e.bind(n,n);let i;K.isFunction(t)?i=t:(i=t.handler,r=t);const s=dp(this),l=op(o,i.bind(n),r);return s(),l}function yS(e,t){const r=t.split(".");return()=>{let n=e;for(let o=0;o<r.length&&n;o++)n=n[r[o]];return n}}const bS=e=>e.__isSuspense;function vS(e,t){t&&t.pendingBranch?K.isArray(e)?t.effects.push(...e):t.effects.push(e):Nd(e)}const Xe=Symbol.for("v-fgt"),sp=Symbol.for("v-txt"),vi=Symbol.for("v-cmt"),os=[];let Er=null;function te(e=!1){os.push(Er=e?null:[])}function wS(){os.pop(),Er=os[os.length-1]||null}let Yi=1;function ap(e,t=!1){Yi+=e,e<0&&Er&&t&&(Er.hasOnce=!0)}function lp(e){return e.dynamicChildren=Yi>0?Er||K.EMPTY_ARR:null,wS(),Yi>0&&Er&&Er.push(e),e}function ve(e,t,r,n,o,i){return lp(pe(e,t,r,n,o,i,!0))}function Ce(e,t,r,n,o){return lp(be(e,t,r,n,o,!0))}function ss(e){return e?e.__v_isVNode===!0:!1}const SS=(...e)=>up(...e),cp=({key:e})=>e??null,as=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?K.isString(e)||Lt(e)||K.isFunction(e)?{i:Xt,r:e,k:t,f:!!r}:e:null);function pe(e,t=null,r=null,n=0,o=null,i=e===Xe?0:1,s=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&cp(t),ref:t&&as(t),scopeId:Md,slotScopeIds:null,children:r,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:i,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Xt};return l?(Ja(c,r),i&128&&e.normalize(c)):r&&(c.shapeFlag|=K.isString(r)?8:16),ye.env.NODE_ENV!=="production"&&c.key!==c.key&&tt("VNode created with invalid key (NaN). VNode type:",c.type),Yi>0&&!s&&Er&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Er.push(c),c}const be=ye.env.NODE_ENV!=="production"?SS:up;function up(e,t=null,r=null,n=0,o=null,i=!1){if((!e||e===Qd)&&(ye.env.NODE_ENV!=="production"&&!e&&tt(`Invalid vnode type when creating vnode: ${e}.`),e=vi),ss(e)){const l=wi(e,t,!0);return r&&Ja(l,r),Yi>0&&!i&&Er&&(l.shapeFlag&6?Er[Er.indexOf(e)]=l:Er.push(l)),l.patchFlag=-2,l}if(mp(e)&&(e=e.__vccOpts),t){t=Ya(t);let{class:l,style:c}=t;l&&!K.isString(l)&&(t.class=K.normalizeClass(l)),K.isObject(c)&&(Ho(c)&&!K.isArray(c)&&(c=K.extend({},c)),t.style=K.normalizeStyle(c))}const s=K.isString(e)?1:bS(e)?128:Gw(e)?64:K.isObject(e)?4:K.isFunction(e)?2:0;return ye.env.NODE_ENV!=="production"&&s&4&&Ho(e)&&(e=nt(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)),pe(e,t,r,n,o,s,i,!0)}function Ya(e){return e?Ho(e)||np(e)?K.extend({},e):e:null}function wi(e,t,r=!1,n=!1){const{props:o,ref:i,patchFlag:s,children:l,transition:c}=e,u=t?Yt(o||{},t):o,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&cp(u),ref:t&&t.ref?r&&i?K.isArray(i)?i.concat(as(t)):[i,as(t)]:as(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ye.env.NODE_ENV!=="production"&&s===-1&&K.isArray(l)?l.map(fp):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Xe?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&wi(e.ssContent),ssFallback:e.ssFallback&&wi(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&Gd(a,c.clone(a)),a}function fp(e){const t=wi(e);return K.isArray(e.children)&&(t.children=e.children.map(fp)),t}function Vt(e=" ",t=0){return be(sp,null,e,t)}function ke(e="",t=!1){return t?(te(),Ce(vi,null,e)):be(vi,null,e)}function ES(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wi(e)}function Ja(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(K.isArray(t))r=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),Ja(e,o()),o._c&&(o._d=!0));return}else{r=32;const o=t._;!o&&!np(t)?t._ctx=Xt:o===3&&Xt&&(Xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else K.isFunction(t)?(t={default:t,_ctx:Xt},r=32):(t=String(t),n&64?(r=16,t=[Vt(t)]):r=8);e.children=t,e.shapeFlag|=r}function Yt(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=K.normalizeClass([t.class,n.class]));else if(o==="style")t.style=K.normalizeStyle([t.style,n.style]);else if(K.isOn(o)){const i=t[o],s=n[o];s&&i!==s&&!(K.isArray(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=n[o])}return t}let vr=null;const Za=()=>vr||Xt;let el;{const e=K.getGlobalThis(),t=(r,n)=>{let o;return(o=e[r])||(o=e[r]=[]),o.push(n),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};el=t("__VUE_INSTANCE_SETTERS__",r=>vr=r),t("__VUE_SSR_SETTERS__",r=>Si=r)}const dp=e=>{const t=vr;return el(e),e.scope.on(),()=>{e.scope.off(),el(t)}};function TS(e){return e.vnode.shapeFlag&4}let Si=!1;const pp=ye.env.NODE_ENV!=="production"?{get(e,t){return er(e,"get",""),e[t]},set(){return tt("setupContext.attrs is readonly."),!1},deleteProperty(){return tt("setupContext.attrs is readonly."),!1}}:{get(e,t){return er(e,"get",""),e[t]}};function AS(e){return new Proxy(e.slots,{get(t,r){return er(e,"get","$slots"),t[r]}})}function RS(e){const t=r=>{if(ye.env.NODE_ENV!=="production"&&(e.exposed&&tt("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(K.isArray(r)?n="array":Lt(r)&&(n="ref")),n!=="object"&&tt(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(ye.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,pp))},get slots(){return n||(n=AS(e))},get emit(){return(o,...i)=>e.emit(o,...i)},expose:t})}else return{attrs:new Proxy(e.attrs,pp),slots:e.slots,emit:e.emit,expose:t}}function hp(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ww(mw(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in Qa)return Qa[r](e)},has(t,r){return r in t||r in Qa}})):e.proxy}const _S=/(?:^|[-_])(\w)/g,IS=e=>e.replace(_S,t=>t.toUpperCase()).replace(/[-_]/g,"");function tl(e,t=!0){return K.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function gp(e,t,r=!1){let n=tl(t);if(!n&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(n=o[1])}if(!n&&e&&e.parent){const o=i=>{for(const s in i)if(i[s]===t)return s};n=o(e.components||e.parent.type.components)||o(e.appContext.components)}return n?IS(n):r?"App":"Anonymous"}function mp(e){return K.isFunction(e)&&"__vccOpts"in e}const V=(e,t)=>{const r=Iw(e,t,Si);if(ye.env.NODE_ENV!=="production"){const n=Za();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function yp(e,t,r){const n=arguments.length;return n===2?K.isObject(t)&&!K.isArray(t)?ss(t)?be(e,null,[t]):be(e,t):be(e,null,t):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&ss(r)&&(r=[r]),be(e,t,r))}function CS(){if(ye.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(f){return K.isObject(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,a(f)],"<",l("_value"in f?f._value:f),">"]:qn(f)?["div",{},["span",e,cr(f)?"ShallowReactive":"Reactive"],"<",l(f),`>${fn(f)?" (readonly)":""}`]:fn(f)?["div",{},["span",e,cr(f)?"ShallowReadonly":"Readonly"],"<",l(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...i(f.$)]}};function i(f){const d=[];f.type.props&&f.props&&d.push(s("props",nt(f.props))),f.setupState!==K.EMPTY_OBJ&&d.push(s("setup",f.setupState)),f.data!==K.EMPTY_OBJ&&d.push(s("data",nt(f.data)));const b=c(f,"computed");b&&d.push(s("computed",b));const E=c(f,"inject");return E&&d.push(s("injected",E)),d.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),d}function s(f,d){return d=K.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(b=>["div",{},["span",n,b+": "],l(d[b],!1)])]]:["span",{}]}function l(f,d=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",r,JSON.stringify(f)]:typeof f=="boolean"?["span",n,f]:K.isObject(f)?["object",{object:d?nt(f):f}]:["span",r,String(f)]}function c(f,d){const b=f.type;if(K.isFunction(b))return;const E={};for(const S in f.ctx)u(b,S,d)&&(E[S]=f.ctx[S]);return E}function u(f,d,b){const E=f[b];if(K.isArray(E)&&E.includes(d)||K.isObject(E)&&d in E||f.extends&&u(f.extends,d,b)||f.mixins&&f.mixins.some(S=>u(S,d,b)))return!0}function a(f){return cr(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const FS=ye.env.NODE_ENV!=="production"?tt:K.NOOP;ye.env.NODE_ENV,ye.env.NODE_ENV;let PS;const bp=typeof window<"u"&&window.trustedTypes;if(bp)try{PS=bp.createPolicy("vue",{createHTML:e=>e})}catch(e){ye.env.NODE_ENV!=="production"&&FS(`Error creating trusted types policy: ${e}`)}const vp=Symbol("_vod"),xS=Symbol("_vsh"),rl={beforeMount(e,{value:t},{transition:r}){e[vp]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):Ji(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),Ji(e,!0),n.enter(e)):n.leave(e,()=>{Ji(e,!1)}):Ji(e,t))},beforeUnmount(e,{value:t}){Ji(e,t)}};ye.env.NODE_ENV!=="production"&&(rl.name="show");function Ji(e,t){e.style.display=t?e[vp]:"none",e[xS]=!t}Symbol(ye.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function Zi(e,t,r,n){e.addEventListener(t,r,n)}const wp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return K.isArray(t)?r=>K.invokeArrayFns(t,r):t};function OS(e){e.target.composing=!0}function Sp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const nl=Symbol("_assign"),kS={created(e,{modifiers:{lazy:t,trim:r,number:n}},o){e[nl]=wp(o);const i=n||o.props&&o.props.type==="number";Zi(e,t?"change":"input",s=>{if(s.target.composing)return;let l=e.value;r&&(l=l.trim()),i&&(l=K.looseToNumber(l)),e[nl](l)}),r&&Zi(e,"change",()=>{e.value=e.value.trim()}),t||(Zi(e,"compositionstart",OS),Zi(e,"compositionend",Sp),Zi(e,"change",Sp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:n,trim:o,number:i}},s){if(e[nl]=wp(s),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?K.looseToNumber(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(n&&t===r||o&&e.value.trim()===c)||(e.value=c))}},NS=["ctrl","shift","alt","meta"],$S={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)=>NS.some(r=>e[`${r}Key`]&&!t.includes(r))},Tr=(e,t)=>{const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=(o,...i)=>{for(let s=0;s<t.length;s++){const l=$S[t[s]];if(l&&l(o,t))return}return e(o,...i)})},DS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},eo=(e,t)=>{const r=e._withKeys||(e._withKeys={}),n=t.join(".");return r[n]||(r[n]=o=>{if(!("key"in o))return;const i=K.hyphenate(o.key);if(t.some(s=>s===i||DS[s]===i))return e(o)})};function LS(){CS()}ye.env.NODE_ENV!=="production"&&LS();const dr=()=>Ut.useAbility(),ls=()=>V(()=>!!document.getElementById("files-global-search-options"));function Ep(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const to=(e,t)=>!e||!t?!1:e.id===t.id;var Fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function il(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ol,Tp;function BS(){if(Tp)return ol;Tp=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,i){for(var s="",l=0,c=-1,u=0,a,f=0;f<=o.length;++f){if(f<o.length)a=o.charCodeAt(f);else{if(a===47)break;a=47}if(a===47){if(!(c===f-1||u===1))if(c!==f-1&&u===2){if(s.length<2||l!==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="",l=0):(s=s.slice(0,d),l=s.length-1-s.lastIndexOf("/")),c=f,u=0;continue}}else if(s.length===2||s.length===1){s="",l=0,c=f,u=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+o.slice(c+1,f):s=o.slice(c+1,f),l=f-c-1;c=f,u=0}else a===46&&u!==-1?++u:u=-1}return s}function r(o,i){var s=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+l:s+o+l:l}var n={resolve:function(){for(var i="",s=!1,l,c=arguments.length-1;c>=-1&&!s;c--){var u;c>=0?u=arguments[c]:(l===void 0&&(l=ye.cwd()),u=l),e(u),u.length!==0&&(i=u+"/"+i,s=u.charCodeAt(0)===47)}return i=t(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=t(i,!s),i.length===0&&!s&&(i="."),i.length>0&&l&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var l=arguments[s];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":n.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=n.resolve(i),s=n.resolve(s),i===s))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var c=i.length,u=c-l,a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var f=s.length,d=f-a,b=u<d?u:d,E=-1,S=0;S<=b;++S){if(S===b){if(d>b){if(s.charCodeAt(a+S)===47)return s.slice(a+S+1);if(S===0)return s.slice(a+S)}else u>b&&(i.charCodeAt(l+S)===47?E=S:S===0&&(E=0));break}var T=i.charCodeAt(l+S),w=s.charCodeAt(a+S);if(T!==w)break;T===47&&(E=S)}var y="";for(S=l+E+1;S<=c;++S)(S===c||i.charCodeAt(S)===47)&&(y.length===0?y+="..":y+="/..");return y.length>0?y+s.slice(a+E):(a+=E,s.charCodeAt(a)===47&&++a,s.slice(a))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),l=s===47,c=-1,u=!0,a=i.length-1;a>=1;--a)if(s=i.charCodeAt(a),s===47){if(!u){c=a;break}}else u=!1;return c===-1?l?"/":".":l&&c===1?"//":i.slice(0,c)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,c=-1,u=!0,a;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var f=s.length-1,d=-1;for(a=i.length-1;a>=0;--a){var b=i.charCodeAt(a);if(b===47){if(!u){l=a+1;break}}else d===-1&&(u=!1,d=a+1),f>=0&&(b===s.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=d))}return l===c?c=d:c===-1&&(c=i.length),i.slice(l,c)}else{for(a=i.length-1;a>=0;--a)if(i.charCodeAt(a)===47){if(!u){l=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":i.slice(l,c)}},extname:function(i){e(i);for(var s=-1,l=0,c=-1,u=!0,a=0,f=i.length-1;f>=0;--f){var d=i.charCodeAt(f);if(d===47){if(!u){l=f+1;break}continue}c===-1&&(u=!1,c=f+1),d===46?s===-1?s=f:a!==1&&(a=1):s!==-1&&(a=-1)}return s===-1||c===-1||a===0||a===1&&s===c-1&&s===l+1?"":i.slice(s,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var l=i.charCodeAt(0),c=l===47,u;c?(s.root="/",u=1):u=0;for(var a=-1,f=0,d=-1,b=!0,E=i.length-1,S=0;E>=u;--E){if(l=i.charCodeAt(E),l===47){if(!b){f=E+1;break}continue}d===-1&&(b=!1,d=E+1),l===46?a===-1?a=E:S!==1&&(S=1):a!==-1&&(S=-1)}return a===-1||d===-1||S===0||S===1&&a===d-1&&a===f+1?d!==-1&&(f===0&&c?s.base=s.name=i.slice(1,d):s.base=s.name=i.slice(f,d)):(f===0&&c?(s.name=i.slice(1,a),s.base=i.slice(1,d)):(s.name=i.slice(f,a),s.base=i.slice(f,d)),s.ext=i.slice(a,d)),f>0?s.dir=i.slice(0,f-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ol=n,ol}var ht=BS();const cs=il(ht),MS=je({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),qe=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},jS=["textContent"],US=["textContent"];function qS(e,t,r,n,o,i){return te(),ve(Xe,null,[pe("p",{class:"oc-mt-rm",textContent:K.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,jS),pe("p",{class:"oc-mb-rm",textContent:K.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,US)],64)}const Ap=qe(MS,[["render",qS]]),VS=je({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}=yt(),{$gettext:r}=$e.useGettext(),n=ce(!1),o=V(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?r("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):r("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):r("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),i=V(()=>e.resource.isFolder?r('Folder with name "%{name}" already exists.',{name:e.resource.name},!0):r('File with name "%{name}" already exists.',{name:e.resource.name},!0)),s=V(()=>e.confirmSecondaryTextOverwrite||r("Replace"));return{message:i,checkboxValue:n,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Ur.KEEP_BOTH,doForAllConflicts:m(n)})},onConfirmSecondary:()=>{t(e.modal.id);const a=e.suggestMerge?Ur.MERGE:Ur.REPLACE;e.callbackFn({strategy:a,doForAllConflicts:m(n)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Ur.SKIP,doForAllConflicts:m(n)})}}}}),zS=["textContent"],WS={class:"oc-my-m"},HS={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},GS={class:"oc-modal-body-actions-grid"};function KS(e,t,r,n,o,i){const s=de("oc-checkbox"),l=de("oc-button");return te(),ve(Xe,null,[pe("span",{class:"oc-display-inline-block oc-mb-m",textContent:K.toDisplayString(e.message)},null,8,zS),pe("div",WS,[e.conflictCount>1?(te(),Ce(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checkboxValue=c),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):ke("",!0)]),pe("div",HS,[pe("div",GS,[be(l,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:e.onCancel},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),be(l,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onConfirmSecondary},{default:Te(()=>[Vt(K.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),be(l,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:e.onConfirm},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const Rp=qe(VS,[["render",KS]]);class sl{constructor(t,r){this.$gettext=t,this.$ngettext=r}async resolveAllConflicts(t,r,n){const o=[];for(const u of t){const a=ht.join(r.path,u.name);n.some(d=>d.path===a)&&o.push({resource:u,strategy:null})}let i=0,s=!1,l=null;const c=[];for(const u of o){if(s){u.strategy=l,c.push(u);continue}const a=o.length-i,f=await this.resolveFileExists(u.resource,a);u.strategy=f.strategy,c.push(u),i+=1,f.doForAllConflicts&&(s=!0,l=f.strategy)}return c}resolveFileExists(t,r,n=!1,o=!1){const{dispatchModal:i}=yt();return new Promise(s=>{i({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:Rp,customComponentAttrs:()=>({resource:t,conflictCount:r,suggestMerge:n,separateSkipHandling:o,callbackFn:l=>{s(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=yt();return new Promise(r=>{t({title:this.$gettext("Copy here?"),customComponent:Ap,confirmText:this.$gettext("Copy here"),onCancel:()=>{r(!1)},onConfirm:()=>Promise.resolve(r(!0))})})}}const jr=(e,t,r,n=1)=>{let o;return t?o=`${ie.extractNameWithoutExtension({name:e,extension:t})} (${n}).${t}`:o=`${e} (${n})`,r.some(s=>s.name===o)?jr(e,t,r,n+1):o},_p=(e,t,r,n)=>e.id===r.id&&ht.dirname(t.path)===n.path;var Ur=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Ur||{}),hn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(hn||{});class Ip extends sl{constructor(t,r,n,o,i,s,l,c){super(l,c),this.sourceSpace=t,this.resourcesToMove=r,this.targetSpace=n,this.targetFolder=o,this.currentFolder=i,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,r=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);it().showErrorMessage({title:r})}showResultMessage(t,r,n){var l,c;if(t.length===0){const u=r.length;if(u===0)return;const a=n===hn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",u,{count:u.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",u,{count:u.toString()},!0);it().showMessage({title:a,status:"success"});return}let o=n===hn.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=n===hn.COPY?this.$gettext('Failed to copy "%{name}"',{name:(l=t[0])==null?void 0:l.resourceName},!0):this.$gettext('Failed to move "%{name}"',{name:(c=t[0])==null?void 0:c.resourceName},!0));let i="";t.some(({error:u})=>u instanceof ie.HttpError&&u.statusCode===507)&&(i=this.$gettext("Insufficient quota")),it().showErrorMessage({title:o,...i&&{desc:i},errors:t.map(({error:u})=>u)})}async getTransferData(t){var i;if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===hn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=hn.COPY}const r=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,n=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,r),o=[];for(const s of this.resourcesToMove){const l={...s},{id:c,name:u,extension:a}=l,f=n.some(E=>E.resource.id===c);let d=u,b=!1;if(f){const E=(i=n.find(S=>S.resource.id===c))==null?void 0:i.strategy;if(E===Ur.SKIP)continue;if(E===Ur.REPLACE){if(this.isOverwritingParentFolder(l,this.targetFolder,r)){const S=new Error;this.showResultMessage([{error:S,resourceName:u}],[],t);continue}b=!0}E===Ur.KEEP_BOTH&&(d=jr(u,a,r),l.name=d)}_p(this.sourceSpace,l,this.targetSpace,this.targetFolder)&&b||o.push({resource:l,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:ht.join(this.targetFolder.path,d),overwrite:b,transferType:t})}return o}isOverwritingParentFolder(t,r,n){var s;if(t.type!=="folder"||r.path===((s=m(this.currentFolder))==null?void 0:s.path))return!1;const o=ht.basename(t.path),i=ht.join(r.path,o);return n.some(l=>l.path===i)}}const al={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},QS=(e,t,r)=>new id(e,{...al,keys:["name","type","icon","extension","tags"]}).search(t,{limit:r}).map(o=>o.item),Cp="oc-resource-icon-mapping",XS={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","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","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"]}};function Fp(){const e={};return Object.values(XS).forEach(t=>{t.extensions.forEach(r=>{e[r]=t.icon})}),e}function ll(e,t,r){return t.name=ht.basename(r),t.path=r,t.webDavPath=ht.join(e.webDavPath,r),t.extension=ie.extractExtensionFromFile(t),t}function YS(){this.__data__=[],this.size=0}function ro(e,t){return e===t||e!==e&&t!==t}function us(e,t){for(var r=e.length;r--;)if(ro(e[r][0],t))return r;return-1}var JS=Array.prototype,ZS=JS.splice;function eE(e){var t=this.__data__,r=us(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():ZS.call(t,r,1),--this.size,!0}function tE(e){var t=this.__data__,r=us(t,e);return r<0?void 0:t[r][1]}function rE(e){return us(this.__data__,e)>-1}function nE(e,t){var r=this.__data__,n=us(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function gn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gn.prototype.clear=YS,gn.prototype.delete=eE,gn.prototype.get=tE,gn.prototype.has=rE,gn.prototype.set=nE;function iE(){this.__data__=new gn,this.size=0}function oE(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function sE(e){return this.__data__.get(e)}function aE(e){return this.__data__.has(e)}const Pn=globalThis||void 0||self;var Pp=typeof Pn=="object"&&Pn&&Pn.Object===Object&&Pn,lE=typeof self=="object"&&self&&self.Object===Object&&self,Kr=Pp||lE||Function("return this")(),Fr=Kr.Symbol,xp=Object.prototype,cE=xp.hasOwnProperty,uE=xp.toString,no=Fr?Fr.toStringTag:void 0;function fE(e){var t=cE.call(e,no),r=e[no];try{e[no]=void 0;var n=!0}catch{}var o=uE.call(e);return n&&(t?e[no]=r:delete e[no]),o}var dE=Object.prototype,pE=dE.toString;function hE(e){return pE.call(e)}var gE="[object Null]",mE="[object Undefined]",Op=Fr?Fr.toStringTag:void 0;function Gn(e){return e==null?e===void 0?mE:gE:Op&&Op in Object(e)?fE(e):hE(e)}function Qr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var yE="[object AsyncFunction]",bE="[object Function]",vE="[object GeneratorFunction]",wE="[object Proxy]";function cl(e){if(!Qr(e))return!1;var t=Gn(e);return t==bE||t==vE||t==yE||t==wE}var ul=Kr["__core-js_shared__"],kp=function(){var e=/[^.]+$/.exec(ul&&ul.keys&&ul.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function SE(e){return!!kp&&kp in e}var EE=Function.prototype,TE=EE.toString;function Kn(e){if(e!=null){try{return TE.call(e)}catch{}try{return e+""}catch{}}return""}var AE=/[\\^$.*+?()[\]{}|]/g,RE=/^\[object .+?Constructor\]$/,_E=Function.prototype,IE=Object.prototype,CE=_E.toString,FE=IE.hasOwnProperty,PE=RegExp("^"+CE.call(FE).replace(AE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xE(e){if(!Qr(e)||SE(e))return!1;var t=cl(e)?PE:RE;return t.test(Kn(e))}function OE(e,t){return e==null?void 0:e[t]}function Qn(e,t){var r=OE(e,t);return xE(r)?r:void 0}var io=Qn(Kr,"Map"),oo=Qn(Object,"create");function kE(){this.__data__=oo?oo(null):{},this.size=0}function NE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var $E="__lodash_hash_undefined__",DE=Object.prototype,LE=DE.hasOwnProperty;function BE(e){var t=this.__data__;if(oo){var r=t[e];return r===$E?void 0:r}return LE.call(t,e)?t[e]:void 0}var ME=Object.prototype,jE=ME.hasOwnProperty;function UE(e){var t=this.__data__;return oo?t[e]!==void 0:jE.call(t,e)}var qE="__lodash_hash_undefined__";function VE(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=oo&&t===void 0?qE:t,this}function Xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xn.prototype.clear=kE,Xn.prototype.delete=NE,Xn.prototype.get=BE,Xn.prototype.has=UE,Xn.prototype.set=VE;function zE(){this.size=0,this.__data__={hash:new Xn,map:new(io||gn),string:new Xn}}function WE(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function fs(e,t){var r=e.__data__;return WE(t)?r[typeof t=="string"?"string":"hash"]:r.map}function HE(e){var t=fs(this,e).delete(e);return this.size-=t?1:0,t}function GE(e){return fs(this,e).get(e)}function KE(e){return fs(this,e).has(e)}function QE(e,t){var r=fs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function mn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}mn.prototype.clear=zE,mn.prototype.delete=HE,mn.prototype.get=GE,mn.prototype.has=KE,mn.prototype.set=QE;var XE=200;function YE(e,t){var r=this.__data__;if(r instanceof gn){var n=r.__data__;if(!io||n.length<XE-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new mn(n)}return r.set(e,t),this.size=r.size,this}function Xr(e){var t=this.__data__=new gn(e);this.size=t.size}Xr.prototype.clear=iE,Xr.prototype.delete=oE,Xr.prototype.get=sE,Xr.prototype.has=aE,Xr.prototype.set=YE;var ds=function(){try{var e=Qn(Object,"defineProperty");return e({},"",{}),e}catch{}}();function fl(e,t,r){t=="__proto__"&&ds?ds(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function dl(e,t,r){(r!==void 0&&!ro(e[t],r)||r===void 0&&!(t in e))&&fl(e,t,r)}function JE(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),l=s.length;l--;){var c=s[++o];if(r(i[c],c,i)===!1)break}return t}}var ZE=JE(),Np=typeof j=="object"&&j&&!j.nodeType&&j,$p=Np&&typeof module=="object"&&module&&!module.nodeType&&module,e1=$p&&$p.exports===Np,Dp=e1?Kr.Buffer:void 0,Lp=Dp?Dp.allocUnsafe:void 0;function Bp(e,t){if(t)return e.slice();var r=e.length,n=Lp?Lp(r):new e.constructor(r);return e.copy(n),n}var ps=Kr.Uint8Array;function pl(e){var t=new e.constructor(e.byteLength);return new ps(t).set(new ps(e)),t}function Mp(e,t){var r=t?pl(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function t1(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var jp=Object.create,r1=function(){function e(){}return function(t){if(!Qr(t))return{};if(jp)return jp(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Up(e,t){return function(r){return e(t(r))}}var hl=Up(Object.getPrototypeOf,Object),n1=Object.prototype;function hs(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||n1;return e===r}function i1(e){return typeof e.constructor=="function"&&!hs(e)?r1(hl(e)):{}}function Yr(e){return e!=null&&typeof e=="object"}var o1="[object Arguments]";function qp(e){return Yr(e)&&Gn(e)==o1}var Vp=Object.prototype,s1=Vp.hasOwnProperty,a1=Vp.propertyIsEnumerable,so=qp(function(){return arguments}())?qp:function(e){return Yr(e)&&s1.call(e,"callee")&&!a1.call(e,"callee")},Pr=Array.isArray,l1=9007199254740991;function zp(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=l1}function ao(e){return e!=null&&zp(e.length)&&!cl(e)}function c1(e){return Yr(e)&&ao(e)}function u1(){return!1}var Wp=typeof j=="object"&&j&&!j.nodeType&&j,Hp=Wp&&typeof module=="object"&&module&&!module.nodeType&&module,f1=Hp&&Hp.exports===Wp,Gp=f1?Kr.Buffer:void 0,d1=Gp?Gp.isBuffer:void 0,Ei=d1||u1,p1="[object Object]",h1=Function.prototype,g1=Object.prototype,Kp=h1.toString,m1=g1.hasOwnProperty,y1=Kp.call(Object);function gl(e){if(!Yr(e)||Gn(e)!=p1)return!1;var t=hl(e);if(t===null)return!0;var r=m1.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Kp.call(r)==y1}var b1="[object Arguments]",v1="[object Array]",w1="[object Boolean]",S1="[object Date]",E1="[object Error]",T1="[object Function]",A1="[object Map]",R1="[object Number]",_1="[object Object]",I1="[object RegExp]",C1="[object Set]",F1="[object String]",P1="[object WeakMap]",x1="[object ArrayBuffer]",O1="[object DataView]",k1="[object Float32Array]",N1="[object Float64Array]",$1="[object Int8Array]",D1="[object Int16Array]",L1="[object Int32Array]",B1="[object Uint8Array]",M1="[object Uint8ClampedArray]",j1="[object Uint16Array]",U1="[object Uint32Array]",wt={};wt[k1]=wt[N1]=wt[$1]=wt[D1]=wt[L1]=wt[B1]=wt[M1]=wt[j1]=wt[U1]=!0,wt[b1]=wt[v1]=wt[x1]=wt[w1]=wt[O1]=wt[S1]=wt[E1]=wt[T1]=wt[A1]=wt[R1]=wt[_1]=wt[I1]=wt[C1]=wt[F1]=wt[P1]=!1;function q1(e){return Yr(e)&&zp(e.length)&&!!wt[Gn(e)]}function ml(e){return function(t){return e(t)}}var Qp=typeof j=="object"&&j&&!j.nodeType&&j,lo=Qp&&typeof module=="object"&&module&&!module.nodeType&&module,V1=lo&&lo.exports===Qp,yl=V1&&Pp.process,Ti=function(){try{var e=lo&&lo.require&&lo.require("util").types;return e||yl&&yl.binding&&yl.binding("util")}catch{}}(),Xp=Ti&&Ti.isTypedArray,gs=Xp?ml(Xp):q1;function bl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var z1=Object.prototype,W1=z1.hasOwnProperty;function Yp(e,t,r){var n=e[t];(!(W1.call(e,t)&&ro(n,r))||r===void 0&&!(t in e))&&fl(e,t,r)}function Jp(e,t,r,n){var o=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var l=t[i],c=void 0;c===void 0&&(c=e[l]),o?fl(r,l,c):Yp(r,l,c)}return r}function H1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var G1=9007199254740991,K1=/^(?:0|[1-9]\d*)$/;function Zp(e,t){var r=typeof e;return t=t??G1,!!t&&(r=="number"||r!="symbol"&&K1.test(e))&&e>-1&&e%1==0&&e<t}var Q1=Object.prototype,X1=Q1.hasOwnProperty;function eh(e,t){var r=Pr(e),n=!r&&so(e),o=!r&&!n&&Ei(e),i=!r&&!n&&!o&&gs(e),s=r||n||o||i,l=s?H1(e.length,String):[],c=l.length;for(var u in e)(t||X1.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Zp(u,c)))&&l.push(u);return l}function Y1(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var J1=Object.prototype,Z1=J1.hasOwnProperty;function eT(e){if(!Qr(e))return Y1(e);var t=hs(e),r=[];for(var n in e)n=="constructor"&&(t||!Z1.call(e,n))||r.push(n);return r}function vl(e){return ao(e)?eh(e,!0):eT(e)}function tT(e){return Jp(e,vl(e))}function rT(e,t,r,n,o,i,s){var l=bl(e,r),c=bl(t,r),u=s.get(c);if(u){dl(e,r,u);return}var a=i?i(l,c,r+"",e,t,s):void 0,f=a===void 0;if(f){var d=Pr(c),b=!d&&Ei(c),E=!d&&!b&&gs(c);a=c,d||b||E?Pr(l)?a=l:c1(l)?a=t1(l):b?(f=!1,a=Bp(c,!0)):E?(f=!1,a=Mp(c,!0)):a=[]:gl(c)||so(c)?(a=l,so(l)?a=tT(l):(!Qr(l)||cl(l))&&(a=i1(c))):f=!1}f&&(s.set(c,a),o(a,c,n,i,s),s.delete(c)),dl(e,r,a)}function th(e,t,r,n,o){e!==t&&ZE(t,function(i,s){if(o||(o=new Xr),Qr(i))rT(e,t,s,r,th,n,o);else{var l=n?n(bl(e,s),i,s+"",e,t,o):void 0;l===void 0&&(l=i),dl(e,s,l)}},vl)}function rh(e){return e}function nT(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var nh=Math.max;function ih(e,t,r){return t=nh(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=nh(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=n[o];return l[t]=r(s),nT(e,this,l)}}function iT(e){return function(){return e}}var oT=ds?function(e,t){return ds(e,"toString",{configurable:!0,enumerable:!1,value:iT(t),writable:!0})}:rh,sT=800,aT=16,lT=Date.now;function cT(e){var t=0,r=0;return function(){var n=lT(),o=aT-(n-r);if(r=n,o>0){if(++t>=sT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var oh=cT(oT);function uT(e,t){return oh(ih(e,t,rh),e+"")}function fT(e,t,r){if(!Qr(r))return!1;var n=typeof t;return(n=="number"?ao(r)&&Zp(t,r.length):n=="string"&&t in r)?ro(r[t],e):!1}function dT(e){return uT(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&fT(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var l=r[n];l&&e(t,l,n,i)}return t})}var co=dT(function(e,t,r){th(e,t,r)});const wl=(e,...t)=>{const{href:r}=e.resolve(m(e.currentRoute));return t.map(n=>{const{href:o}=e.resolve({...n});return o==="/"||o==="#/"?!1:r.startsWith(o)}).some(Boolean)},uo=(...e)=>(t,...r)=>{if(!r.length)return wl(t,...e);const[n,...o]=r.map(i=>{const s=e.find(l=>l.name===i);if(!s)throw new Error(`unknown comparative '${i}'`);return s});return wl(t,n,...o)};function rB(e){return e}const fo=(e,...t)=>co({},{name:e},...t.map(r=>({...r.params&&{params:r.params},...r.query&&{query:r.query}}))),Ai=(e,t={})=>fo(e,t),sh=Ai("files-common-favorites"),ah=Ai("files-common-search"),At=uo(sh,ah),pT=e=>[{path:"/search",component:e.App,children:[{name:ah.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:sh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],xr=(e,t={})=>fo(e,t),lh=xr("files-spaces-projects"),Sl=xr("files-spaces-generic"),lt=uo(lh,Sl),hT=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:lh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:Sl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],Or=(e,t={})=>fo(e,t),gT=Or("files-shares"),ms=Or("files-shares-with-me"),El=Or("files-shares-with-others"),Tl=Or("files-shares-via-link"),Nt=uo(ms,El,Tl),mT=e=>[{name:gT.name,path:"/shares",component:e.App,redirect:ms,children:[{name:ms.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:El.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:Tl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Ri=(e,t={})=>fo(e,t),Al=Ri("files-public-link"),Rl=Ri("files-public-upload"),Ar=uo(Al,Rl),yT=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:Al.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:Rl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],_i=(e,t={})=>fo(e,t),ch=_i("files-trash-generic"),uh=_i("files-trash-overview"),Rr=uo(ch,uh),bT=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:uh.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:ch.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function fh(e){return{applicationConfig:V(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const vT=["anonymous","user","idp","publicLink","hybrid"],yn=e=>Cn(e),We=()=>yn("$router"),Jt=()=>We().currentRoute,_l=e=>e.path.split("/")[1],wT=()=>{const e=Jt();return V(()=>_l(m(e)))},Jr=(e,t={},r)=>{var o,i;const n=(r==null?void 0:r.configStore)||ot();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...ie.isShareSpaceResource(e)&&{shareId:e.id},...((i=(o=n==null?void 0:n.options)==null?void 0:o.routing)==null?void 0:i.idBased)&&!Et.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},ST=(e,t)=>{const r=document.querySelector("base"),n=!!r,o=new URL(window.location.href.split("#")[0]);return o.search="",n?o.pathname=new URL(r.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[n?"pathname":"hash"]=e.resolve(t).href,o.href},Zr=Ge.defineStore("apps",()=>{const e=ce({}),t=ce({}),r=ce([]),n=V(()=>Object.keys(m(e))),o=(c,u)=>{c.id&&(c.extensions&&c.extensions.forEach(a=>{i({appId:c.id,data:a})}),m(e)[c.id]={applicationMenu:c.applicationMenu||{enabled:()=>!1},defaultExtension:c.defaultExtension||"",icon:"check_box_outline_blank",name:c.name||c.id,translations:u,...c})},i=({appId:c,data:u})=>{var a,f,d;m(r).push({app:c,extension:u.extension,createFileHandler:u.createFileHandler,label:u.label,mimeType:u.mimeType,routeName:u.routeName,newFileMenu:u.newFileMenu,icon:u.icon,name:u.name,hasPriority:u.hasPriority||((d=(f=(a=m(t))==null?void 0:a[c])==null?void 0:f.priorityExtensions)==null?void 0:d.includes(u.extension))||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:n,fileExtensions:r,registerApp:o,registerFileExtension:i,loadExternalAppConfig:({appId:c,config:u})=>{t.value={...m(t),[c]:u}},isAppEnabled:c=>m(n).includes(c)}}),Yn=Ge.defineStore("auth",()=>{const e=ce(),t=ce(!1),r=ce(!1),n=ce(),o=ce(),i=ce(),s=ce(!1),l=b=>{e.value=b},c=b=>{t.value=b},u=b=>{r.value=b},a=b=>{n.value=b.publicLinkToken,o.value=b.publicLinkPassword,i.value=b.publicLinkType,s.value=b.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:r,publicLinkToken:n,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:s,setAccessToken:l,setIdpContextReady:c,setUserContextReady:u,setPublicLinkContext:a,clearUserContext:()=>{l(null),c(null),u(null)},clearPublicLinkContext:()=>{a({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),dh={core:{"support-sse":!1,"support-url-signing":!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:ie.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:[]}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},tr=Ge.defineStore("capabilities",()=>{const e=ce(!1),t=ce(dh),r=F=>{t.value=co({...dh},F.capabilities),e.value=!0},n=V(()=>m(t).core["support-url-signing"]),o=V(()=>m(t).core["support-sse"]),i=V(()=>m(t).graph["personal-data-export"]),s=V(()=>m(t).core.status),l=V(()=>m(t).dav.reports),c=V(()=>m(t).dav.trashbin),u=V(()=>m(t).spaces.max_quota),a=V(()=>m(t).spaces.projects),f=V(()=>m(t).graph.users.create_disabled),d=V(()=>m(t).graph.users.delete_disabled),b=V(()=>m(t).graph.users.change_password_self_disabled),E=V(()=>m(t).graph.users.read_only_attributes),S=V(()=>m(t).files.app_providers),T=V(()=>m(t).files.favorites),w=V(()=>m(t).files.thumbnail),y=V(()=>m(t).files.archivers),g=V(()=>m(t).files.privateLinks),v=V(()=>m(t).files.permanent_deletion),A=V(()=>m(t).files.tags),R=V(()=>m(t).files.undelete),C=V(()=>m(t).files_sharing.api_enabled),P=V(()=>m(t).files_sharing.deny_access),_=V(()=>m(t).files_sharing.can_rename),L=V(()=>m(t).files_sharing.allow_custom),B=V(()=>{var F;return(F=m(t).files_sharing.public)==null?void 0:F.enabled}),$=V(()=>{var F;return(F=m(t).files_sharing.public)==null?void 0:F.can_edit}),D=V(()=>{var F;return(F=m(t).files_sharing.public)==null?void 0:F.can_contribute}),H=V(()=>{var F;return(F=m(t).files_sharing.public)==null?void 0:F.alias}),X=V(()=>{var F;return(F=m(t).files_sharing.public)==null?void 0:F.default_permissions}),J=V(()=>{var F;return(F=m(t).files_sharing.public)==null?void 0:F.password.enforced_for}),le=V(()=>m(t).files_sharing.search_min_length),me=V(()=>{var F;return(F=m(t).files_sharing.user)==null?void 0:F.profile_picture}),fe=V(()=>{var F;return(F=m(t).files.tus_support)==null?void 0:F.max_chunk_size}),we=V(()=>{var F;return(F=m(t).files.tus_support)==null?void 0:F.extension}),Se=V(()=>{var F;return(F=m(t).files.tus_support)==null?void 0:F.http_method_override}),re=V(()=>m(t).notifications["ocs-endpoints"]),oe=V(()=>m(t).password_policy),ae=V(()=>{var F;return(F=m(t).search.property)==null?void 0:F.mtime}),Ae=V(()=>{var F;return(F=m(t).search.property)==null?void 0:F.mediatype}),Z=V(()=>{var F;return(F=m(t).search.property)==null?void 0:F.content});return{isInitialized:e,capabilities:t,setCapabilities:r,status:s,supportUrlSigning:n,supportSSE:o,personalDataExport:i,davReports:l,davTrashbin:c,spacesMaxQuota:u,spacesProjects:a,graphUsersCreateDisabled:f,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:b,graphUsersReadOnlyAttributes:E,filesAppProviders:S,filesFavorites:T,filesThumbnail:w,filesArchivers:y,filesPrivateLinks:g,filesPermanentDeletion:v,filesTags:A,filesUndelete:R,sharingApiEnabled:C,sharingDenyAccess:P,sharingCanRename:_,sharingAllowCustom:L,sharingPublicEnabled:B,sharingPublicCanEdit:$,sharingPublicCanContribute:D,sharingPublicAlias:H,sharingPublicDefaultPermissions:X,sharingPublicPasswordEnforcedFor:J,sharingSearchMinLength:le,sharingUserProfilePicture:me,tusMaxChunkSize:fe,tusExtension:we,tusHttpMethodOverride:Se,notificationsOcsEndpoints:re,passwordPolicy:oe,searchLastMofifiedDate:ae,searchMediaType:Ae,searchContent:Z}});class ET{constructor(t,r){Ee(this,"value");Ee(this,"expires");this.value=t,this.expires=r?new Date().getTime()+r:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class Il{constructor(t){Ee(this,"map");Ee(this,"ttl");Ee(this,"capacity");this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,r,n){return this.evict(),this.map.set(t,new ET(r,isNaN(n)?this.ttl:n)),r}get(t){this.evict();const r=this.map.get(t);if(r)return r.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,r)=>{t.expired&&this.delete(r)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const ys=async({graphClient:e,spacesStore:t,space:r,signal:n})=>{const o=await t.getMountPointForSpace({graphClient:e,space:r,signal:n});if(!o)return null;const{id:i}=o;return e.driveItems.getDriveItem(i.split("!")[0],i)},TT=({sharedAncestor:e,matchingSpace:t})=>t?xr("files-spaces-generic",Jr(t,{path:e.path,fileId:e.id})):{},AT=e=>{var r;const t=(r=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:r[0];t&&t.focus()};class Jn{}Ee(Jn,"sortByQueryName","sort-by"),Ee(Jn,"sortDirQueryName","sort-dir");var RT="[object Symbol]";function bs(e){return typeof e=="symbol"||Yr(e)&&Gn(e)==RT}var _T=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,IT=/^\w*$/;function CT(e,t){if(Pr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||bs(e)?!0:IT.test(e)||!_T.test(e)||t!=null&&e in Object(t)}var FT="Expected a function";function Cl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(FT);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(Cl.Cache||mn),r}Cl.Cache=mn;var PT=500;function xT(e){var t=Cl(e,function(n){return r.size===PT&&r.clear(),n}),r=t.cache;return t}var OT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kT=/\\(\\)?/g,NT=xT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(OT,function(r,n,o,i){t.push(o?i.replace(kT,"$1"):n||r)}),t});function ph(e,t){for(var r=-1,n=e==null?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var hh=Fr?Fr.prototype:void 0,gh=hh?hh.toString:void 0;function mh(e){if(typeof e=="string")return e;if(Pr(e))return ph(e,mh)+"";if(bs(e))return gh?gh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Fl(e){return e==null?"":mh(e)}function Pl(e,t){return Pr(e)?e:CT(e,t)?[e]:NT(Fl(e))}function yh(e){if(typeof e=="string"||bs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bh(e,t){t=Pl(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[yh(t[r++])];return r&&r==n?e:void 0}function xl(e,t,r){var n=e==null?void 0:bh(e,t);return n===void 0?r:n}var Ft=(e=>(e.Desc="desc",e.Asc="asc",e))(Ft||{});function $T(e){const t=We(),r=DT(e),n=LT(e),o=V(()=>{var u;return wh(m(r))||m((u=Ol(m(s)))==null?void 0:u.name)}),i=V(()=>MT(m(n))||BT(m(o),m(s))),s=e.fields;return{items:V(()=>{const u=m(e.items);return m(o)?vh(u,m(s),m(o),m(i)):u}),sortBy:o,sortDir:i,handleSort:({sortBy:u,sortDir:a})=>t.replace({query:{...m(t.currentRoute).query,[m(e.sortByQueryName)||Jn.sortByQueryName]:u,[m(e.sortDirQueryName)||Jn.sortDirQueryName]:a}})}}function DT(e){var t;return e.sortBy?Lt(e.sortBy)?e.sortBy:ce(e.sortBy):wn({name:m(e.sortByQueryName)||Jn.sortByQueryName,defaultValue:m((t=Ol(m(e.fields)))==null?void 0:t.name),storagePrefix:m(e.routeName)||m(Xs())})}function LT(e){var t;return e.sortDir?Lt(e.sortDir)?e.sortDir:ce(e.sortDir):wn({name:m(e.sortDirQueryName)||Jn.sortDirQueryName,defaultValue:m((t=Ol(m(e.fields)))==null?void 0:t.sortDir),storagePrefix:m(e.routeName)||m(Xs())})}const Ol=e=>{const t=e.filter(r=>r.sortable);return t?t[0]:null},BT=(e,t)=>{const r=t.find(n=>n.name===e);return r&&r.sortDir?m(r.sortDir):"desc"},vh=(e,t,r,n)=>{const o=t.find(l=>l.name===r);if(!o)return e;const{sortable:i}=o,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(r==="name"){const l=[...e.filter(u=>u.type==="folder")].sort((u,a)=>kl(u,a,s,r,n,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,a)=>kl(u,a,s,r,n,i));return n==="asc"?l.concat(c):c.concat(l)}return[...e].sort((l,c)=>kl(l,c,s,o.prop||o.name,n,i))},kl=(e,t,r,n,o,i)=>{let s=xl(e,n),l=xl(t,n);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const a=f=>f.map(d=>d[i]).join("");s=a(s),l=a(l)}else typeof i=="function"&&(s=i(s),l=i(l));return!isNaN(s)&&!isNaN(l)?(s-l)*c:r.compare((s||"").toString(),(l||"").toString())*c},wh=e=>Array.isArray(e)?e[0]:e,MT=e=>{switch(wh(e)){case"asc":return"asc";case"desc":return"desc"}return null},Sh=e=>e?[{name:"name",sortable:!0,sortDir:Ft.Asc},{name:"size",sortable:!0,sortDir:Ft.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((r,n)=>r.shareType!==n.shareType?r.shareType<n.shareType?-1:1:r.displayName<n.displayName?-1:1).map(r=>r.displayName).join():!1,sortDir:Ft.Asc},{name:"owner",sortable:"displayName",sortDir:Ft.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Ft.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Ft.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Ft.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function nB(e){return e}const Eh=[{label:"A-Z",name:"name",sortable:!0,sortDir:Ft.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Ft.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Ft.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Ft.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Ft.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Ft.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Ft.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Ft.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Ft.Desc}],jT=e=>e?Eh.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],UT=(e,{$gettext:t})=>e.map(r=>({...r,label:t(r.label)})),qT=ge.z.object({icon:ge.z.string(),name:ge.z.string(),secure_view:ge.z.boolean().optional().default(!1),target_ext:ge.z.string().optional()}),VT=ge.z.object({allow_creation:ge.z.boolean().optional(),app_providers:ge.z.array(qT),default_application:ge.z.string().optional(),description:ge.z.string().optional(),ext:ge.z.string().optional(),mime_type:ge.z.string(),name:ge.z.string().optional()}),Th=ge.z.object({"mime-types":ge.z.array(VT)});class zT{constructor(t,r){Ee(this,"_mimeTypes",ce([]));Ee(this,"serverUrl");Ee(this,"clientService");this.serverUrl=t,this.clientService=r}async loadData(){const t=ie.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":r}}=await this.clientService.httpUnAuthenticated.get(t,{schema:Th});this._mimeTypes.value=r}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return m(this._mimeTypes)}get templateMimeTypes(){return m(this._mimeTypes).filter(t=>!!t.app_providers.some(r=>!!r.target_ext))}get appNames(){return[...new Set(m(this._mimeTypes).flatMap(t=>t.app_providers.map(r=>r.name)))]}getMimeTypesByAppName(t){return m(this._mimeTypes).filter(r=>r.app_providers.some(n=>n.name===t))}}var Ah={},vs={};vs.byteLength=GT,vs.toByteArray=QT,vs.fromByteArray=JT;for(var en=[],kr=[],WT=typeof Uint8Array<"u"?Uint8Array:Array,Nl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ii=0,HT=Nl.length;Ii<HT;++Ii)en[Ii]=Nl[Ii],kr[Nl.charCodeAt(Ii)]=Ii;kr[45]=62,kr[95]=63;function Rh(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function GT(e){var t=Rh(e),r=t[0],n=t[1];return(r+n)*3/4-n}function KT(e,t,r){return(t+r)*3/4-r}function QT(e){var t,r=Rh(e),n=r[0],o=r[1],i=new WT(KT(e,n,o)),s=0,l=o>0?n-4:n,c;for(c=0;c<l;c+=4)t=kr[e.charCodeAt(c)]<<18|kr[e.charCodeAt(c+1)]<<12|kr[e.charCodeAt(c+2)]<<6|kr[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=kr[e.charCodeAt(c)]<<2|kr[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=kr[e.charCodeAt(c)]<<10|kr[e.charCodeAt(c+1)]<<4|kr[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function XT(e){return en[e>>18&63]+en[e>>12&63]+en[e>>6&63]+en[e&63]}function YT(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(XT(n));return o.join("")}function JT(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,l=r-n;s<l;s+=i)o.push(YT(e,s,s+i>l?l:s+i));return n===1?(t=e[r-1],o.push(en[t>>2]+en[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(en[t>>10]+en[t>>4&63]+en[t<<2&63]+"=")),o.join("")}var $l={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */$l.read=function(e,t,r,n,o){var i,s,l=o*8-n-1,c=(1<<l)-1,u=c>>1,a=-7,f=r?o-1:0,d=r?-1:1,b=e[t+f];for(f+=d,i=b&(1<<-a)-1,b>>=-a,a+=l;a>0;i=i*256+e[t+f],f+=d,a-=8);for(s=i&(1<<-a)-1,i>>=-a,a+=n;a>0;s=s*256+e[t+f],f+=d,a-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-u}return(b?-1:1)*s*Math.pow(2,i-n)},$l.write=function(e,t,r,n,o,i){var s,l,c,u=i*8-o-1,a=(1<<u)-1,f=a>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,E=n?1:-1,S=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=a):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=a?(l=0,s=a):s+f>=1?(l=(t*c-1)*Math.pow(2,o),s=s+f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+b]=l&255,b+=E,l/=256,o-=8);for(s=s<<o|l,u+=o;u>0;e[r+b]=s&255,b+=E,s/=256,u-=8);e[r+b-E]|=S*128};/*!
7
7
  * The buffer module from node.js, for the browser.
8
8
  *
9
9
  * @author Feross Aboukhadijeh <https://feross.org>
10
10
  * @license MIT
11
- */(function(e){const t=vs,r=Nl,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=T,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:l}=globalThis;a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{const _=new i(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,i.prototype),Object.setPrototypeOf(_,p),_.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(_){if(_>o)throw new RangeError('The value "'+_+'" is invalid for option "size"');const p=new i(_);return Object.setPrototypeOf(p,a.prototype),p}function a(_,p,h){if(typeof _=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(_)}return f(_,p,h)}a.poolSize=8192;function f(_,p,h){if(typeof _=="string")return w(_,p);if(s.isView(_))return S(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(et(_,s)||_&&et(_.buffer,s)||typeof l<"u"&&(et(_,l)||_&&et(_.buffer,l)))return m(_,p,h);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const O=_.valueOf&&_.valueOf();if(O!=null&&O!==_)return a.from(O,p,h);const M=g(_);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return a.from(_[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}a.from=function(_,p,h){return f(_,p,h)},Object.setPrototypeOf(a.prototype,i.prototype),Object.setPrototypeOf(a,i);function d(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function b(_,p,h){return d(_),_<=0?u(_):p!==void 0?typeof h=="string"?u(_).fill(p,h):u(_).fill(p):u(_)}a.alloc=function(_,p,h){return b(_,p,h)};function E(_){return d(_),u(_<0?0:v(_)|0)}a.allocUnsafe=function(_){return E(_)},a.allocUnsafeSlow=function(_){return E(_)};function w(_,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=A(_,p)|0;let O=u(h);const M=O.write(_,p);return M!==h&&(O=O.slice(0,M)),O}function R(_){const p=_.length<0?0:v(_.length)|0,h=u(p);for(let O=0;O<p;O+=1)h[O]=_[O]&255;return h}function S(_){if(et(_,i)){const p=new i(_);return m(p.buffer,p.byteOffset,p.byteLength)}return R(_)}function m(_,p,h){if(p<0||_.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let O;return p===void 0&&h===void 0?O=new i(_):h===void 0?O=new i(_,p):O=new i(_,p,h),Object.setPrototypeOf(O,a.prototype),O}function g(_){if(a.isBuffer(_)){const p=v(_.length)|0,h=u(p);return h.length===0||_.copy(h,0,0,p),h}if(_.length!==void 0)return typeof _.length!="number"||Ut(_.length)?u(0):R(_);if(_.type==="Buffer"&&Array.isArray(_.data))return R(_.data)}function v(_){if(_>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return _|0}function T(_){return+_!=_&&(_=0),a.alloc(+_)}a.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==a.prototype},a.compare=function(p,h){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),et(h,i)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(p)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let O=p.length,M=h.length;for(let G=0,re=Math.min(O,M);G<re;++G)if(p[G]!==h[G]){O=p[G],M=h[G];break}return O<M?-1:M<O?1:0},a.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}},a.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return a.alloc(0);let O;if(h===void 0)for(h=0,O=0;O<p.length;++O)h+=p[O].length;const M=a.allocUnsafe(h);let G=0;for(O=0;O<p.length;++O){let re=p[O];if(et(re,i))G+re.length>M.length?(a.isBuffer(re)||(re=a.from(re)),re.copy(M,G)):i.prototype.set.call(M,re,G);else if(a.isBuffer(re))re.copy(M,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=re.length}return M};function A(_,p){if(a.isBuffer(_))return _.length;if(s.isView(_)||et(_,s))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);const h=_.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&h===0)return 0;let M=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Le(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ze(_).length;default:if(M)return O?-1:Le(_).length;p=(""+p).toLowerCase(),M=!0}}a.byteLength=A;function F(_,p,h){let O=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(_||(_="utf8");;)switch(_){case"hex":return ne(this,p,h);case"utf8":case"utf-8":return ce(this,p,h);case"ascii":return Se(this,p,h);case"latin1":case"binary":return Ae(this,p,h);case"base64":return J(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,h);default:if(O)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),O=!0}}a.prototype._isBuffer=!0;function C(_,p,h){const O=_[p];_[p]=_[h],_[h]=O}a.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 h=0;h<p;h+=2)C(this,h,h+1);return this},a.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 h=0;h<p;h+=4)C(this,h,h+3),C(this,h+1,h+2);return this},a.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 h=0;h<p;h+=8)C(this,h,h+7),C(this,h+1,h+6),C(this,h+2,h+5),C(this,h+3,h+4);return this},a.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?ce(this,0,p):F.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(p){if(!a.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:a.compare(this,p)===0},a.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(p,h,O,M,G){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),!a.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),O===void 0&&(O=p?p.length:0),M===void 0&&(M=0),G===void 0&&(G=this.length),h<0||O>p.length||M<0||G>this.length)throw new RangeError("out of range index");if(M>=G&&h>=O)return 0;if(M>=G)return-1;if(h>=O)return 1;if(h>>>=0,O>>>=0,M>>>=0,G>>>=0,this===p)return 0;let re=G-M,$e=O-h;const He=Math.min(re,$e),Re=this.slice(M,G),xe=p.slice(h,O);for(let De=0;De<He;++De)if(Re[De]!==xe[De]){re=Re[De],$e=xe[De];break}return re<$e?-1:$e<re?1:0};function I(_,p,h,O,M){if(_.length===0)return-1;if(typeof h=="string"?(O=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ut(h)&&(h=M?0:_.length-1),h<0&&(h=_.length+h),h>=_.length){if(M)return-1;h=_.length-1}else if(h<0)if(M)h=0;else return-1;if(typeof p=="string"&&(p=a.from(p,O)),a.isBuffer(p))return p.length===0?-1:L(_,p,h,O,M);if(typeof p=="number")return p=p&255,typeof i.prototype.indexOf=="function"?M?i.prototype.indexOf.call(_,p,h):i.prototype.lastIndexOf.call(_,p,h):L(_,[p],h,O,M);throw new TypeError("val must be string, number or Buffer")}function L(_,p,h,O,M){let G=1,re=_.length,$e=p.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(_.length<2||p.length<2)return-1;G=2,re/=2,$e/=2,h/=2}function He(xe,De){return G===1?xe[De]:xe.readUInt16BE(De*G)}let Re;if(M){let xe=-1;for(Re=h;Re<re;Re++)if(He(_,Re)===He(p,xe===-1?0:Re-xe)){if(xe===-1&&(xe=Re),Re-xe+1===$e)return xe*G}else xe!==-1&&(Re-=Re-xe),xe=-1}else for(h+$e>re&&(h=re-$e),Re=h;Re>=0;Re--){let xe=!0;for(let De=0;De<$e;De++)if(He(_,Re+De)!==He(p,De)){xe=!1;break}if(xe)return Re}return-1}a.prototype.includes=function(p,h,O){return this.indexOf(p,h,O)!==-1},a.prototype.indexOf=function(p,h,O){return I(this,p,h,O,!0)},a.prototype.lastIndexOf=function(p,h,O){return I(this,p,h,O,!1)};function B(_,p,h,O){h=Number(h)||0;const M=_.length-h;O?(O=Number(O),O>M&&(O=M)):O=M;const G=p.length;O>G/2&&(O=G/2);let re;for(re=0;re<O;++re){const $e=parseInt(p.substr(re*2,2),16);if(Ut($e))return re;_[h+re]=$e}return re}function $(_,p,h,O){return vt(Le(p,_.length-h),_,h,O)}function D(_,p,h,O){return vt(qe(p),_,h,O)}function H(_,p,h,O){return vt(Ze(p),_,h,O)}function ee(_,p,h,O){return vt(ze(p,_.length-h),_,h,O)}a.prototype.write=function(p,h,O,M){if(h===void 0)M="utf8",O=this.length,h=0;else if(O===void 0&&typeof h=="string")M=h,O=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(O)?(O=O>>>0,M===void 0&&(M="utf8")):(M=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const G=this.length-h;if((O===void 0||O>G)&&(O=G),p.length>0&&(O<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let re=!1;for(;;)switch(M){case"hex":return B(this,p,h,O);case"utf8":case"utf-8":return $(this,p,h,O);case"ascii":case"latin1":case"binary":return D(this,p,h,O);case"base64":return H(this,p,h,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,p,h,O);default:if(re)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),re=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(_,p,h){return p===0&&h===_.length?t.fromByteArray(_):t.fromByteArray(_.slice(p,h))}function ce(_,p,h){h=Math.min(_.length,h);const O=[];let M=p;for(;M<h;){const G=_[M];let re=null,$e=G>239?4:G>223?3:G>191?2:1;if(M+$e<=h){let He,Re,xe,De;switch($e){case 1:G<128&&(re=G);break;case 2:He=_[M+1],(He&192)===128&&(De=(G&31)<<6|He&63,De>127&&(re=De));break;case 3:He=_[M+1],Re=_[M+2],(He&192)===128&&(Re&192)===128&&(De=(G&15)<<12|(He&63)<<6|Re&63,De>2047&&(De<55296||De>57343)&&(re=De));break;case 4:He=_[M+1],Re=_[M+2],xe=_[M+3],(He&192)===128&&(Re&192)===128&&(xe&192)===128&&(De=(G&15)<<18|(He&63)<<12|(Re&63)<<6|xe&63,De>65535&&De<1114112&&(re=De))}}re===null?(re=65533,$e=1):re>65535&&(re-=65536,O.push(re>>>10&1023|55296),re=56320|re&1023),O.push(re),M+=$e}return de(O)}const be=4096;function de(_){const p=_.length;if(p<=be)return String.fromCharCode.apply(String,_);let h="",O=0;for(;O<p;)h+=String.fromCharCode.apply(String,_.slice(O,O+=be));return h}function Se(_,p,h){let O="";h=Math.min(_.length,h);for(let M=p;M<h;++M)O+=String.fromCharCode(_[M]&127);return O}function Ae(_,p,h){let O="";h=Math.min(_.length,h);for(let M=p;M<h;++M)O+=String.fromCharCode(_[M]);return O}function ne(_,p,h){const O=_.length;(!p||p<0)&&(p=0),(!h||h<0||h>O)&&(h=O);let M="";for(let G=p;G<h;++G)M+=nr[_[G]];return M}function ae(_,p,h){const O=_.slice(p,h);let M="";for(let G=0;G<O.length-1;G+=2)M+=String.fromCharCode(O[G]+O[G+1]*256);return M}a.prototype.slice=function(p,h){const O=this.length;p=~~p,h=h===void 0?O:~~h,p<0?(p+=O,p<0&&(p=0)):p>O&&(p=O),h<0?(h+=O,h<0&&(h=0)):h>O&&(h=O),h<p&&(h=p);const M=this.subarray(p,h);return Object.setPrototypeOf(M,a.prototype),M};function le(_,p,h){if(_%1!==0||_<0)throw new RangeError("offset is not uint");if(_+p>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=this[p],G=1,re=0;for(;++re<h&&(G*=256);)M+=this[p+re]*G;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=this[p+--h],G=1;for(;h>0&&(G*=256);)M+=this[p+--h]*G;return M},a.prototype.readUint8=a.prototype.readUInt8=function(p,h){return p=p>>>0,h||le(p,1,this.length),this[p]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||le(p,2,this.length),this[p]|this[p+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||le(p,2,this.length),this[p]<<8|this[p+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||le(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||le(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},a.prototype.readBigUInt64LE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,G=this[++p]+this[++p]*2**8+this[++p]*2**16+O*2**24;return BigInt(M)+(BigInt(G)<<BigInt(32))}),a.prototype.readBigUInt64BE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],G=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+O;return(BigInt(M)<<BigInt(32))+BigInt(G)}),a.prototype.readIntLE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=this[p],G=1,re=0;for(;++re<h&&(G*=256);)M+=this[p+re]*G;return G*=128,M>=G&&(M-=Math.pow(2,8*h)),M},a.prototype.readIntBE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=h,G=1,re=this[p+--M];for(;M>0&&(G*=256);)re+=this[p+--M]*G;return G*=128,re>=G&&(re-=Math.pow(2,8*h)),re},a.prototype.readInt8=function(p,h){return p=p>>>0,h||le(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},a.prototype.readInt16LE=function(p,h){p=p>>>0,h||le(p,2,this.length);const O=this[p]|this[p+1]<<8;return O&32768?O|4294901760:O},a.prototype.readInt16BE=function(p,h){p=p>>>0,h||le(p,2,this.length);const O=this[p+1]|this[p]<<8;return O&32768?O|4294901760:O},a.prototype.readInt32LE=function(p,h){return p=p>>>0,h||le(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},a.prototype.readInt32BE=function(p,h){return p=p>>>0,h||le(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},a.prototype.readBigInt64LE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(O<<24);return(BigInt(M)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),a.prototype.readBigInt64BE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(M)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+O)}),a.prototype.readFloatLE=function(p,h){return p=p>>>0,h||le(p,4,this.length),r.read(this,p,!0,23,4)},a.prototype.readFloatBE=function(p,h){return p=p>>>0,h||le(p,4,this.length),r.read(this,p,!1,23,4)},a.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||le(p,8,this.length),r.read(this,p,!0,52,8)},a.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||le(p,8,this.length),r.read(this,p,!1,52,8)};function oe(_,p,h,O,M,G){if(!a.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>M||p<G)throw new RangeError('"value" argument is out of bounds');if(h+O>_.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(p,h,O,M){if(p=+p,h=h>>>0,O=O>>>0,!M){const $e=Math.pow(2,8*O)-1;oe(this,p,h,O,$e,0)}let G=1,re=0;for(this[h]=p&255;++re<O&&(G*=256);)this[h+re]=p/G&255;return h+O},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(p,h,O,M){if(p=+p,h=h>>>0,O=O>>>0,!M){const $e=Math.pow(2,8*O)-1;oe(this,p,h,O,$e,0)}let G=O-1,re=1;for(this[h+G]=p&255;--G>=0&&(re*=256);)this[h+G]=p/re&255;return h+O},a.prototype.writeUint8=a.prototype.writeUInt8=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,1,255,0),this[h]=p&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function Q(_,p,h,O,M){Be(p,O,M,_,h,7);let G=Number(p&BigInt(4294967295));_[h++]=G,G=G>>8,_[h++]=G,G=G>>8,_[h++]=G,G=G>>8,_[h++]=G;let re=Number(p>>BigInt(32)&BigInt(4294967295));return _[h++]=re,re=re>>8,_[h++]=re,re=re>>8,_[h++]=re,re=re>>8,_[h++]=re,h}function x(_,p,h,O,M){Be(p,O,M,_,h,7);let G=Number(p&BigInt(4294967295));_[h+7]=G,G=G>>8,_[h+6]=G,G=G>>8,_[h+5]=G,G=G>>8,_[h+4]=G;let re=Number(p>>BigInt(32)&BigInt(4294967295));return _[h+3]=re,re=re>>8,_[h+2]=re,re=re>>8,_[h+1]=re,re=re>>8,_[h]=re,h+8}a.prototype.writeBigUInt64LE=lt(function(p,h=0){return Q(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=lt(function(p,h=0){return x(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(p,h,O,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*O-1);oe(this,p,h,O,He-1,-He)}let G=0,re=1,$e=0;for(this[h]=p&255;++G<O&&(re*=256);)p<0&&$e===0&&this[h+G-1]!==0&&($e=1),this[h+G]=(p/re>>0)-$e&255;return h+O},a.prototype.writeIntBE=function(p,h,O,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*O-1);oe(this,p,h,O,He-1,-He)}let G=O-1,re=1,$e=0;for(this[h+G]=p&255;--G>=0&&(re*=256);)p<0&&$e===0&&this[h+G+1]!==0&&($e=1),this[h+G]=(p/re>>0)-$e&255;return h+O},a.prototype.writeInt8=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},a.prototype.writeInt16LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeInt16BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeInt32LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},a.prototype.writeInt32BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},a.prototype.writeBigInt64LE=lt(function(p,h=0){return Q(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=lt(function(p,h=0){return x(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function k(_,p,h,O,M,G){if(h+O>_.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function X(_,p,h,O,M){return p=+p,h=h>>>0,M||k(_,p,h,4),r.write(_,p,h,O,23,4),h+4}a.prototype.writeFloatLE=function(p,h,O){return X(this,p,h,!0,O)},a.prototype.writeFloatBE=function(p,h,O){return X(this,p,h,!1,O)};function W(_,p,h,O,M){return p=+p,h=h>>>0,M||k(_,p,h,8),r.write(_,p,h,O,52,8),h+8}a.prototype.writeDoubleLE=function(p,h,O){return W(this,p,h,!0,O)},a.prototype.writeDoubleBE=function(p,h,O){return W(this,p,h,!1,O)},a.prototype.copy=function(p,h,O,M){if(!a.isBuffer(p))throw new TypeError("argument should be a Buffer");if(O||(O=0),!M&&M!==0&&(M=this.length),h>=p.length&&(h=p.length),h||(h=0),M>0&&M<O&&(M=O),M===O||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),p.length-h<M-O&&(M=p.length-h+O);const G=M-O;return this===p&&typeof i.prototype.copyWithin=="function"?this.copyWithin(h,O,M):i.prototype.set.call(p,this.subarray(O,M),h),G},a.prototype.fill=function(p,h,O,M){if(typeof p=="string"){if(typeof h=="string"?(M=h,h=0,O=this.length):typeof O=="string"&&(M=O,O=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(p.length===1){const re=p.charCodeAt(0);(M==="utf8"&&re<128||M==="latin1")&&(p=re)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<O)throw new RangeError("Out of range index");if(O<=h)return this;h=h>>>0,O=O===void 0?this.length:O>>>0,p||(p=0);let G;if(typeof p=="number")for(G=h;G<O;++G)this[G]=p;else{const re=a.isBuffer(p)?p:a.from(p,M),$e=re.length;if($e===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(G=0;G<O-h;++G)this[G+h]=re[G%$e]}return this};const U={};function z(_,p,h){U[_]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${_}]`,this.stack,delete this.name}get code(){return _}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${_}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(_){return _?`${_} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(_,p){return`The "${_}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(_,p,h){let O=`The value of "${_}" is out of range.`,M=h;return Number.isInteger(h)&&Math.abs(h)>2**32?M=fe(String(h)):typeof h=="bigint"&&(M=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(M=fe(M)),M+="n"),O+=` It must be ${p}. Received ${M}`,O},RangeError);function fe(_){let p="",h=_.length;const O=_[0]==="-"?1:0;for(;h>=O+4;h-=3)p=`_${_.slice(h-3,h)}${p}`;return`${_.slice(0,h)}${p}`}function _e(_,p,h){Fe(p,"offset"),(_[p]===void 0||_[p+h]===void 0)&&Pe(p,_.length-(h+1))}function Be(_,p,h,O,M,G){if(_>h||_<p){const re=typeof p=="bigint"?"n":"";let $e;throw p===0||p===BigInt(0)?$e=`>= 0${re} and < 2${re} ** ${(G+1)*8}${re}`:$e=`>= -(2${re} ** ${(G+1)*8-1}${re}) and < 2 ** ${(G+1)*8-1}${re}`,new U.ERR_OUT_OF_RANGE("value",$e,_)}_e(O,M,G)}function Fe(_,p){if(typeof _!="number")throw new U.ERR_INVALID_ARG_TYPE(p,"number",_)}function Pe(_,p,h){throw Math.floor(_)!==_?(Fe(_,h),new U.ERR_OUT_OF_RANGE("offset","an integer",_)):p<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,_)}const je=/[^+/0-9A-Za-z-_]/g;function te(_){if(_=_.split("=")[0],_=_.trim().replace(je,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function Le(_,p){p=p||1/0;let h;const O=_.length;let M=null;const G=[];for(let re=0;re<O;++re){if(h=_.charCodeAt(re),h>55295&&h<57344){if(!M){if(h>56319){(p-=3)>-1&&G.push(239,191,189);continue}else if(re+1===O){(p-=3)>-1&&G.push(239,191,189);continue}M=h;continue}if(h<56320){(p-=3)>-1&&G.push(239,191,189),M=h;continue}h=(M-55296<<10|h-56320)+65536}else M&&(p-=3)>-1&&G.push(239,191,189);if(M=null,h<128){if((p-=1)<0)break;G.push(h)}else if(h<2048){if((p-=2)<0)break;G.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;G.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;G.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return G}function qe(_){const p=[];for(let h=0;h<_.length;++h)p.push(_.charCodeAt(h)&255);return p}function ze(_,p){let h,O,M;const G=[];for(let re=0;re<_.length&&!((p-=2)<0);++re)h=_.charCodeAt(re),O=h>>8,M=h%256,G.push(M),G.push(O);return G}function Ze(_){return t.toByteArray(te(_))}function vt(_,p,h,O){let M;for(M=0;M<O&&!(M+h>=p.length||M>=_.length);++M)p[M+h]=_[M];return M}function et(_,p){return _ instanceof p||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===p.name}function Ut(_){return _!==_}const nr=function(){const _="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const O=h*16;for(let M=0;M<16;++M)p[O+M]=_[h]+_[M]}return p}();function lt(_){return typeof BigInt>"u"?Ir:_}function Ir(){throw new Error("BigInt not supported")}})(Ah);const po=Ah.Buffer;var $l,_h;function Ih(){return _h||(_h=1,$l=typeof me=="object"&&me.env&&me.env.NODE_DEBUG&&/\bsemver\b/i.test(me.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),$l}var Dl,Ch;function Fh(){if(Ch)return Dl;Ch=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return Dl={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Dl}var ws={exports:{}},Ph;function nA(){return Ph||(Ph=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Fh(),i=Ih();t=e.exports={};const s=t.re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],a=t.t={};let f=0;const d="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",o],[d,n]],E=R=>{for(const[S,m]of b)R=R.split(`${S}*`).join(`${S}{0,${m}}`).split(`${S}+`).join(`${S}{1,${m}}`);return R},w=(R,S,m)=>{const g=E(S),v=f++;i(R,v,S),a[R]=v,c[v]=S,u[v]=g,s[v]=new RegExp(S,m?"g":void 0),l[v]=new RegExp(g,m?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),w("MAINVERSION",`(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${c[a.NUMERICIDENTIFIER]}|${c[a.NONNUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${c[a.NUMERICIDENTIFIERLOOSE]}|${c[a.NONNUMERICIDENTIFIER]})`),w("PRERELEASE",`(?:-(${c[a.PRERELEASEIDENTIFIER]}(?:\\.${c[a.PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${c[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[a.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${d}+`),w("BUILD",`(?:\\+(${c[a.BUILDIDENTIFIER]}(?:\\.${c[a.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${c[a.MAINVERSION]}${c[a.PRERELEASE]}?${c[a.BUILD]}?`),w("FULL",`^${c[a.FULLPLAIN]}$`),w("LOOSEPLAIN",`[v=\\s]*${c[a.MAINVERSIONLOOSE]}${c[a.PRERELEASELOOSE]}?${c[a.BUILD]}?`),w("LOOSE",`^${c[a.LOOSEPLAIN]}$`),w("GTLT","((?:<|>)?=?)"),w("XRANGEIDENTIFIERLOOSE",`${c[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),w("XRANGEIDENTIFIER",`${c[a.NUMERICIDENTIFIER]}|x|X|\\*`),w("XRANGEPLAIN",`[v=\\s]*(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:${c[a.PRERELEASE]})?${c[a.BUILD]}?)?)?`),w("XRANGEPLAINLOOSE",`[v=\\s]*(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:${c[a.PRERELEASELOOSE]})?${c[a.BUILD]}?)?)?`),w("XRANGE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAIN]}$`),w("XRANGELOOSE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAINLOOSE]}$`),w("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),w("COERCE",`${c[a.COERCEPLAIN]}(?:$|[^\\d])`),w("COERCEFULL",c[a.COERCEPLAIN]+`(?:${c[a.PRERELEASE]})?(?:${c[a.BUILD]})?(?:$|[^\\d])`),w("COERCERTL",c[a.COERCE],!0),w("COERCERTLFULL",c[a.COERCEFULL],!0),w("LONETILDE","(?:~>?)"),w("TILDETRIM",`(\\s*)${c[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",w("TILDE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAIN]}$`),w("TILDELOOSE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAINLOOSE]}$`),w("LONECARET","(?:\\^)"),w("CARETTRIM",`(\\s*)${c[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",w("CARET",`^${c[a.LONECARET]}${c[a.XRANGEPLAIN]}$`),w("CARETLOOSE",`^${c[a.LONECARET]}${c[a.XRANGEPLAINLOOSE]}$`),w("COMPARATORLOOSE",`^${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]})$|^$`),w("COMPARATOR",`^${c[a.GTLT]}\\s*(${c[a.FULLPLAIN]})$|^$`),w("COMPARATORTRIM",`(\\s*)${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]}|${c[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",w("HYPHENRANGE",`^\\s*(${c[a.XRANGEPLAIN]})\\s+-\\s+(${c[a.XRANGEPLAIN]})\\s*$`),w("HYPHENRANGELOOSE",`^\\s*(${c[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[a.XRANGEPLAINLOOSE]})\\s*$`),w("STAR","(<|>)?=?\\s*\\*"),w("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),w("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ws,ws.exports)),ws.exports}var Ll,xh;function iA(){if(xh)return Ll;xh=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ll=n=>n?typeof n!="object"?e:n:t,Ll}var Bl,Oh;function oA(){if(Oh)return Bl;Oh=1;const e=/^[0-9]+$/,t=(n,o)=>{const i=e.test(n),s=e.test(o);return i&&s&&(n=+n,o=+o),n===o?0:i&&!s?-1:s&&!i?1:n<o?-1:1};return Bl={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},Bl}var Ml,kh;function Nh(){if(kh)return Ml;kh=1;const e=Ih(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Fh(),{safeRe:n,safeSrc:o,t:i}=nA(),s=iA(),{compareIdentifiers:l}=oA();class c{constructor(a,f){if(f=s(f),a instanceof c){if(a.loose===!!f.loose&&a.includePrerelease===!!f.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=a.trim().match(f.loose?n[i.LOOSE]:n[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(b=>{if(/^[0-9]+$/.test(b)){const E=+b;if(E>=0&&E<r)return E}return b}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(a){if(e("SemVer.compare",this.version,this.options,a),!(a instanceof c)){if(typeof a=="string"&&a===this.version)return 0;a=new c(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof c||(a=new c(a,this.options)),l(this.major,a.major)||l(this.minor,a.minor)||l(this.patch,a.patch)}comparePre(a){if(a instanceof c||(a=new c(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],b=a.prerelease[f];if(e("prerelease compare",f,d,b),d===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(d===void 0)return-1;if(d===b)continue;return l(d,b)}while(++f)}compareBuild(a){a instanceof c||(a=new c(a,this.options));let f=0;do{const d=this.build[f],b=a.build[f];if(e("build compare",f,d,b),d===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(d===void 0)return-1;if(d===b)continue;return l(d,b)}while(++f)}inc(a,f,d){if(a.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const b=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),E=`-${f}`.match(b);if(!E||E[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const b=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[b];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(b)}}if(f){let E=[f,b];d===!1&&(E=[f]),l(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ml=c,Ml}var jl,$h;function sA(){if($h)return jl;$h=1;const e=Nh();return jl=(r,n)=>new e(r,n).major,jl}var aA=sA();const Dh=nl(aA);var Ul,Lh;function lA(){if(Lh)return Ul;Lh=1;const e=Nh();return Ul=(r,n,o)=>new e(r,o).compare(new e(n,o)),Ul}var ql,Bh;function cA(){if(Bh)return ql;Bh=1;const e=lA();return ql=(r,n,o)=>e(n,r,o),ql}var uA=cA();const fA=nl(uA);class Ci extends Error{constructor(r,...n){super([r,...n].filter(Boolean).join(", "));Ee(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class dA extends Ci{constructor(){super(...arguments);Ee(this,"name","ApiError")}}const Vl=(e,t)=>{const r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.href=e,r.setAttribute("download",t),r.click(),document.body.removeChild(r)};class pA{constructor(t,r,n,o=ue([])){Ee(this,"clientService");Ee(this,"userStore");Ee(this,"serverUrl");Ee(this,"capability");Ee(this,"available");Ee(this,"fileIdsSupported");this.clientService=t,this.userStore=r,this.serverUrl=n,this.capability=V(()=>{const i=y(o).filter(s=>s.enabled).sort((s,l)=>fA(s.version,l.version));return i.length?i[0]:null}),this.available=V(()=>{var i;return!!((i=y(this.capability))!=null&&i.version)}),this.fileIdsSupported=V(()=>{var i;return Dh((i=y(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!y(this.available))throw new Ci("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new Ci("requested archive with empty list of resources");const r=this.buildDownloadUrl({...t});if(!r)throw new Ci("download url could not be built");const n=t.publicToken?r:await this.clientService.ocsUserContext.signUrl(r,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const l=await this.clientService.httpUnAuthenticated.get(n,{headers:{...!!t.publicLinkPassword&&{Authorization:"Basic "+po.from(["public",t.publicLinkPassword].join(":")).toString("base64")}},responseType:"arraybuffer"}),c=new Blob([l.data],{type:"application/octet-stream"}),u=URL.createObjectURL(c),a=this.getFileNameFromResponseHeaders(l.headers);return Vl(u,a),n}catch(l){throw new ie.HttpError("archive could not be fetched",l.response)}}buildDownloadUrl(t){const r=[];switch(t.publicToken&&r.push(`public-token=${t.publicToken}`),Dh(y(this.capability).version)){case 2:return r.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+r.join("&");case 1:{const o=Math.random().toString(36).substring(2);return r.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+r.join("&")}default:return}}get url(){if(!this.available)throw new Ci("no archiver available");const t=y(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:ie.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var n;const r=(n=t["content-disposition"])==null?void 0:n.split('"')[1];return decodeURI(r)}}const hA=new _l({ttl:10*1e3,capacity:250}),gA=new _l({ttl:10*1e3,capacity:250});class mA{get avatarUrl(){return gA}get filePreview(){return hA}}const zl=new mA;class Mh{constructor(t={}){Ee(this,"accessToken");Ee(this,"publicLinkToken");Ee(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+po.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class Wl{constructor(t,r){Ee(this,"instance");Ee(this,"cancelToken");this.cancelToken=Do.CancelToken.source(),this.instance=Do.create(t),r&&this.instance.interceptors.request.use(r)}cancel(t){this.cancelToken.cancel(t)}async delete(t,r,n){return await this.internalRequestWithData("delete",t,r,n)}get(t,r){return this.internalRequest("get",t,r)}head(t,r){return this.internalRequest("head",t,r)}options(t,r){return this.internalRequest("options",t,r)}patch(t,r,n){return this.internalRequestWithData("patch",t,r,n)}post(t,r,n){return this.internalRequestWithData("post",t,r,n)}put(t,r,n){return this.internalRequestWithData("put",t,r,n)}async request(t){const r=await this.instance.request(this.obtainConfig(t));return this.processResponse(r,t)}obtainConfig(t){return co({cancelToken:this.cancelToken.token},t)}processResponse(t,r){if(r!=null&&r.schema){const n=r.schema.parse(t.data);return{...t,data:n}}return t}async internalRequest(t,r,n){const o=await this.instance[t](r,this.obtainConfig(n));return this.processResponse(o,n)}async internalRequestWithData(t,r,n,o){const i=await this.instance[t](r,n,this.obtainConfig(o));return this.processResponse(i,o)}}class yA extends Error{constructor(){super(...arguments);Ee(this,"name","RetriableError")}}const bA=15e3;class vA{constructor(t,r){Ee(this,"url");Ee(this,"fetchOptions");Ee(this,"abortController");Ee(this,"eventListenerMap");Ee(this,"readyState");Ee(this,"withCredentials");Ee(this,"CONNECTING");Ee(this,"OPEN");Ee(this,"CLOSED");Ee(this,"onerror");Ee(this,"onmessage");Ee(this,"onopen");this.url=t,this.fetchOptions=r,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return L0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var r;const t=new Event("open");(r=this.onopen)==null||r.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const r=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(r);const n=t.event,o=this.eventListenerMap[n];o==null||o.forEach(s=>s(r))},onclose:()=>{throw this.readyState=this.CLOSED,new yA},onerror:t=>{var n;console.error(t);const r=new CustomEvent("error",{detail:t});return(n=this.onerror)==null||n.bind(this)(r),3e4+Math.floor(Math.random()*bA)}})}fetchProvider(...t){const[r,n]=t,o={...n,...this.fetchOptions};return window.fetch(r,o)}close(){this.abortController.abort("closed")}addEventListener(t,r){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(r)}removeEventListener(t,r){var n;this.eventListenerMap[t]=(n=this.eventListenerMap[t])==null?void 0:n.filter(o=>o!==r)}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 Hl=null;const wA=(e,t)=>(Hl||(Hl=new vA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),Hl),SA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Qt.v4(),"X-Requested-With":"XMLHttpRequest"}});class EA{constructor(t){Ee(this,"configStore");Ee(this,"language");Ee(this,"authStore");Ee(this,"httpAuthenticatedClient");Ee(this,"httpUnAuthenticatedClient");Ee(this,"graphClient");Ee(this,"ocsClient");Ee(this,"webDavClient");Ee(this,"initiatorId",Qt.v4());Ee(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Wl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.httpUnAuthenticatedClient=new Wl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},r=>(Object.assign(r.headers,this.getDynamicHeaders({useAuth:!1})),r))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return wA(this.configStore.serverUrl,SA({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}initGraphClient(){const t=Do.create({headers:this.staticHeaders});t.interceptors.request.use(r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.graphClient=ie.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Do.create({headers:this.staticHeaders});t.interceptors.request.use(r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.ocsClient=ie.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=ie.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 "+po.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Qt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class jh{constructor(){Ee(this,"topics");this.topics=new Map}subscribe(t,r){const n={token:Qt.v4(),callback:r},o=[n,...this.topics.get(t)||[]];return this.topics.set(t,o),n.token}publish(t,r){(this.topics.get(t)||[]).forEach(o=>o.callback(r))}unsubscribe(t,r){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(n=>n.token!==r))}}const Xe=new jh;var TA=Up(Object.keys,Object),AA=Object.prototype,RA=AA.hasOwnProperty;function Uh(e){if(!hs(e))return TA(e);var t=[];for(var r in Object(e))RA.call(e,r)&&r!="constructor"&&t.push(r);return t}var Gl=Qn(Kr,"DataView"),Kl=Qn(Kr,"Promise"),Ql=Qn(Kr,"Set"),Xl=Qn(Kr,"WeakMap"),qh="[object Map]",_A="[object Object]",Vh="[object Promise]",zh="[object Set]",Wh="[object WeakMap]",Hh="[object DataView]",IA=Kn(Gl),CA=Kn(io),FA=Kn(Kl),PA=Kn(Ql),xA=Kn(Xl),Nr=Gn;(Gl&&Nr(new Gl(new ArrayBuffer(1)))!=Hh||io&&Nr(new io)!=qh||Kl&&Nr(Kl.resolve())!=Vh||Ql&&Nr(new Ql)!=zh||Xl&&Nr(new Xl)!=Wh)&&(Nr=function(e){var t=Gn(e),r=t==_A?e.constructor:void 0,n=r?Kn(r):"";if(n)switch(n){case IA:return Hh;case CA:return qh;case FA:return Vh;case PA:return zh;case xA:return Wh}return t});var OA="[object Map]",kA="[object Set]",NA=Object.prototype,$A=NA.hasOwnProperty;function DA(e){if(e==null)return!0;if(ao(e)&&(Pr(e)||typeof e=="string"||typeof e.splice=="function"||Ei(e)||gs(e)||so(e)))return!e.length;var t=Nr(e);if(t==OA||t==kA)return!e.size;if(hs(e))return!Uh(e).length;for(var r in e)if($A.call(e,r))return!1;return!0}class Gh{isEnabled(){return!0}isActive(t){return ct(t,"files-spaces-projects")?!1:ct(t,"files-spaces-generic")||Ar(t,"files-public-link")}getTask(t){const{router:r,clientService:n,resourcesStore:o,userStore:i,authService:s,spacesStore:l,sharesStore:c,configStore:u}=t,{webdav:a,graphAuthenticated:f}=n,{replaceInvalidFileRoute:d}=Ks({router:r}),b=this.setCurrentUserShareSpacePermissions;return cr.useTask(function*(E,w,R,S=null,m=null,g={}){try{o.clearResourceList();let{resource:v,children:T}=yield*ie.call(a.listFiles(R,{path:S,fileId:m},{signal:E}));v.id&&d({space:R,resource:v,path:S,fileId:m});let A;if(S==="/"&&(ie.isShareSpaceResource(R)?(A=yield*ie.call(ys({graphClient:f,spacesStore:l,space:R,signal:E})),A&&(v=ie.buildIncomingShareResource({graphRoles:c.graphRoles,driveItem:A,serverUrl:u.serverUrl}))):!ie.isPersonalSpaceResource(R)&&!ie.isPublicSpaceResource(R)&&(v=R)),yield o.loadAncestorMetaData({folder:v,space:R,client:a,signal:E}),g.loadShares){const F=o.ancestorMetaData;for(const C of T)C.indicators=Ro({space:R,resource:C,ancestorMetaData:F,user:i.user})}ie.isShareSpaceResource(R)&&(T.forEach(F=>F.remoteItemId=R.id),DA(R.members)&&(A||(A=yield*ie.call(ys({graphClient:f,spacesStore:l,space:R,signal:E}))),b({sharesStore:c,spacesStore:l,userStore:i,space:R,sharedDriveItem:A}))),o.initResourceList({currentFolder:v,resources:T})}catch(v){if(o.setCurrentFolder(null),console.error(v),v.statusCode===401)return s.handleAuthError(y(r.currentRoute))}}).restartable()}setCurrentUserShareSpacePermissions({sharesStore:t,spacesStore:r,userStore:n,space:o,sharedDriveItem:i}){var a;const s=((a=i==null?void 0:i.remoteItem)==null?void 0:a.permissions)||[];if(!s.length)return;const l=[];s.forEach(f=>{if(f["@libre.graph.permissions.actions"]){l.push(...f["@libre.graph.permissions.actions"]);return}const d=t.graphRoles[f.roles[0]];if(!d)return;const b=d.rolePermissions.flatMap(E=>E.allowedResourceActions);l.push(...b)});const c=[...new Set(l)],u={grantedTo:{user:{id:n.user.id,displayName:n.user.displayName}},permissions:c,roleId:""};r.updateSpaceField({id:o.id,field:"members",value:{[n.user.id]:u}})}}class Kh{isEnabled(){return!0}isActive(t){var n;const r=y(t.currentRoute);return Tt(t,"files-common-favorites")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:r,clientService:n,userStore:o}=t;return cr.useTask(function*(i,s){var c;r.clearResourceList(),r.setAncestorMetaData({});let l=yield n.webdav.listFavoriteFiles({username:(c=o.user)==null?void 0:c.onPremisesSamAccountName,signal:i});l=l.map(ie.buildResource),r.initResourceList({currentFolder:null,resources:l})})}}class Qh{isEnabled(){return!0}isActive(t){var n;const r=y(t.currentRoute);return kt(t,"files-shares-via-link")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:r,spacesStore:n,clientService:o,configStore:i,resourcesStore:s}=t;return cr.useTask(function*(l,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const a=(yield*ie.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:l}))).filter(f=>f.permissions.some(({link:d})=>!!d)).map(f=>ie.buildOutgoingShareResource({driveItem:f,user:r.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:a})})}}class Xh{isEnabled(){return!0}isActive(t){var n;const r=y(t.currentRoute);return kt(t,"files-shares-with-me")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:r,clientService:n,configStore:o,resourcesStore:i,sharesStore:s}=t;return cr.useTask(function*(l,c){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:n.graphAuthenticated,signal:l}));const a=(yield*ie.call(n.graphAuthenticated.driveItems.listSharedWithMe({signal:l}))).map(f=>ie.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:a})})}}class Yh{isEnabled(){return!0}isActive(t){var n;const r=y(t.currentRoute);return kt(t,"files-shares-with-others")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:r,spacesStore:n,clientService:o,configStore:i,resourcesStore:s}=t;return cr.useTask(function*(l,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const a=(yield*ie.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:l}))).filter(f=>f.permissions.some(({link:d})=>!d)).map(f=>ie.buildOutgoingShareResource({driveItem:f,user:r.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:a})})}}class _r{}Ee(_r,"Shared","S"),Ee(_r,"Shareable","R"),Ee(_r,"Mounted","M"),Ee(_r,"Deletable","D"),Ee(_r,"Renameable","N"),Ee(_r,"Moveable","V"),Ee(_r,"Updateable","NV"),Ee(_r,"FileUpdateable","W"),Ee(_r,"FolderCreateable","CK"),Ee(_r,"Deny","Z"),Ee(_r,"SecureView","X");const Ss=e=>({value:e,type:null}),LA=e=>Ss(e),ut=e=>Ss(e),Yl=e=>Ss(e),BA=e=>Ss(e),MA={Permissions:ut("permissions"),IsFavorite:Yl("favorite"),FileId:ut("fileid"),FileParent:ut("file-parent"),Name:ut("name"),OwnerId:ut("owner-id"),OwnerDisplayName:ut("owner-display-name"),PrivateLink:ut("privatelink"),ContentLength:Yl("getcontentlength"),ContentSize:Yl("size"),LastModifiedDate:ut("getlastmodified"),Tags:LA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:ut("getetag"),MimeType:ut("getcontenttype"),ResourceType:BA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:ut("owner"),LockTime:ut("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:ut("downloadURL"),Highlights:ut("highlights"),MetaPathForUser:ut("meta-path-for-user"),RemoteItemId:ut("remote-item-id"),ShareId:ut("shareid"),ShareRoot:ut("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:ut("share-permissions"),TrashbinOriginalFilename:ut("trashbin-original-filename"),TrashbinOriginalLocation:ut("trashbin-original-location"),TrashbinDeletedDate:ut("trashbin-delete-datetime"),PublicLinkItemType:ut("public-link-item-type"),PublicLinkPermission:ut("public-link-permission"),PublicLinkExpiration:ut("public-link-expiration"),PublicLinkShareDate:ut("public-link-share-datetime"),PublicLinkShareOwner:ut("public-link-share-owner")},Ve=Object.fromEntries(Object.entries(MA).map(([e,t])=>[e,t.value])),ui=class ui{};Ee(ui,"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.DownloadURL,Ve.Tags,Ve.Audio,Ve.Location,Ve.Image,Ve.Photo]),Ee(ui,"PublicLink",ui.Default.concat([Ve.PublicLinkItemType,Ve.PublicLinkPermission,Ve.PublicLinkExpiration,Ve.PublicLinkShareDate,Ve.PublicLinkShareOwner])),Ee(ui,"Trashbin",[Ve.ContentLength,Ve.ResourceType,Ve.TrashbinOriginalLocation,Ve.TrashbinOriginalFilename,Ve.TrashbinDeletedDate,Ve.Permissions,Ve.FileParent]),Ee(ui,"DavNamespace",[Ve.ContentLength,Ve.LastModifiedDate,Ve.ETag,Ve.MimeType,Ve.ResourceType,Ve.LockDiscovery,Ve.ActiveLock]);let Es=ui;var Jh={},Ts={};Ts.byteLength=qA,Ts.toByteArray=zA,Ts.fromByteArray=GA;for(var tn=[],$r=[],jA=typeof Uint8Array<"u"?Uint8Array:Array,Jl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fi=0,UA=Jl.length;Fi<UA;++Fi)tn[Fi]=Jl[Fi],$r[Jl.charCodeAt(Fi)]=Fi;$r[45]=62,$r[95]=63;function Zh(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function qA(e){var t=Zh(e),r=t[0],n=t[1];return(r+n)*3/4-n}function VA(e,t,r){return(t+r)*3/4-r}function zA(e){var t,r=Zh(e),n=r[0],o=r[1],i=new jA(VA(e,n,o)),s=0,l=o>0?n-4:n,c;for(c=0;c<l;c+=4)t=$r[e.charCodeAt(c)]<<18|$r[e.charCodeAt(c+1)]<<12|$r[e.charCodeAt(c+2)]<<6|$r[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=$r[e.charCodeAt(c)]<<2|$r[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=$r[e.charCodeAt(c)]<<10|$r[e.charCodeAt(c+1)]<<4|$r[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function WA(e){return tn[e>>18&63]+tn[e>>12&63]+tn[e>>6&63]+tn[e&63]}function HA(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(WA(n));return o.join("")}function GA(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,l=r-n;s<l;s+=i)o.push(HA(e,s,s+i>l?l:s+i));return n===1?(t=e[r-1],o.push(tn[t>>2]+tn[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(tn[t>>10]+tn[t>>4&63]+tn[t<<2&63]+"=")),o.join("")}var Zl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Zl.read=function(e,t,r,n,o){var i,s,l=o*8-n-1,c=(1<<l)-1,u=c>>1,a=-7,f=r?o-1:0,d=r?-1:1,b=e[t+f];for(f+=d,i=b&(1<<-a)-1,b>>=-a,a+=l;a>0;i=i*256+e[t+f],f+=d,a-=8);for(s=i&(1<<-a)-1,i>>=-a,a+=n;a>0;s=s*256+e[t+f],f+=d,a-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-u}return(b?-1:1)*s*Math.pow(2,i-n)},Zl.write=function(e,t,r,n,o,i){var s,l,c,u=i*8-o-1,a=(1<<u)-1,f=a>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,E=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=a):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=a?(l=0,s=a):s+f>=1?(l=(t*c-1)*Math.pow(2,o),s=s+f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+b]=l&255,b+=E,l/=256,o-=8);for(s=s<<o|l,u+=o;u>0;e[r+b]=s&255,b+=E,s/=256,u-=8);e[r+b-E]|=w*128};/*!
11
+ */(function(e){const t=vs,r=$l,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:l}=globalThis;a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{const I=new i(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,i.prototype),Object.setPrototypeOf(I,p),I.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(I){if(I>o)throw new RangeError('The value "'+I+'" is invalid for option "size"');const p=new i(I);return Object.setPrototypeOf(p,a.prototype),p}function a(I,p,h){if(typeof I=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(I)}return f(I,p,h)}a.poolSize=8192;function f(I,p,h){if(typeof I=="string")return S(I,p);if(s.isView(I))return w(I);if(I==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(et(I,s)||I&&et(I.buffer,s)||typeof l<"u"&&(et(I,l)||I&&et(I.buffer,l)))return y(I,p,h);if(typeof I=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const k=I.valueOf&&I.valueOf();if(k!=null&&k!==I)return a.from(k,p,h);const M=g(I);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]=="function")return a.from(I[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}a.from=function(I,p,h){return f(I,p,h)},Object.setPrototypeOf(a.prototype,i.prototype),Object.setPrototypeOf(a,i);function d(I){if(typeof I!="number")throw new TypeError('"size" argument must be of type number');if(I<0)throw new RangeError('The value "'+I+'" is invalid for option "size"')}function b(I,p,h){return d(I),I<=0?u(I):p!==void 0?typeof h=="string"?u(I).fill(p,h):u(I).fill(p):u(I)}a.alloc=function(I,p,h){return b(I,p,h)};function E(I){return d(I),u(I<0?0:v(I)|0)}a.allocUnsafe=function(I){return E(I)},a.allocUnsafeSlow=function(I){return E(I)};function S(I,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=R(I,p)|0;let k=u(h);const M=k.write(I,p);return M!==h&&(k=k.slice(0,M)),k}function T(I){const p=I.length<0?0:v(I.length)|0,h=u(p);for(let k=0;k<p;k+=1)h[k]=I[k]&255;return h}function w(I){if(et(I,i)){const p=new i(I);return y(p.buffer,p.byteOffset,p.byteLength)}return T(I)}function y(I,p,h){if(p<0||I.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(I.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let k;return p===void 0&&h===void 0?k=new i(I):h===void 0?k=new i(I,p):k=new i(I,p,h),Object.setPrototypeOf(k,a.prototype),k}function g(I){if(a.isBuffer(I)){const p=v(I.length)|0,h=u(p);return h.length===0||I.copy(h,0,0,p),h}if(I.length!==void 0)return typeof I.length!="number"||jt(I.length)?u(0):T(I);if(I.type==="Buffer"&&Array.isArray(I.data))return T(I.data)}function v(I){if(I>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return I|0}function A(I){return+I!=I&&(I=0),a.alloc(+I)}a.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==a.prototype},a.compare=function(p,h){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),et(h,i)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(p)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let k=p.length,M=h.length;for(let G=0,ne=Math.min(k,M);G<ne;++G)if(p[G]!==h[G]){k=p[G],M=h[G];break}return k<M?-1:M<k?1:0},a.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}},a.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return a.alloc(0);let k;if(h===void 0)for(h=0,k=0;k<p.length;++k)h+=p[k].length;const M=a.allocUnsafe(h);let G=0;for(k=0;k<p.length;++k){let ne=p[k];if(et(ne,i))G+ne.length>M.length?(a.isBuffer(ne)||(ne=a.from(ne)),ne.copy(M,G)):i.prototype.set.call(M,ne,G);else if(a.isBuffer(ne))ne.copy(M,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=ne.length}return M};function R(I,p){if(a.isBuffer(I))return I.length;if(s.isView(I)||et(I,s))return I.byteLength;if(typeof I!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);const h=I.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&h===0)return 0;let M=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Pe(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ze(I).length;default:if(M)return k?-1:Pe(I).length;p=(""+p).toLowerCase(),M=!0}}a.byteLength=R;function C(I,p,h){let k=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(I||(I="utf8");;)switch(I){case"hex":return re(this,p,h);case"utf8":case"utf-8":return le(this,p,h);case"ascii":return we(this,p,h);case"latin1":case"binary":return Se(this,p,h);case"base64":return J(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,p,h);default:if(k)throw new TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),k=!0}}a.prototype._isBuffer=!0;function P(I,p,h){const k=I[p];I[p]=I[h],I[h]=k}a.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 h=0;h<p;h+=2)P(this,h,h+1);return this},a.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 h=0;h<p;h+=4)P(this,h,h+3),P(this,h+1,h+2);return this},a.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 h=0;h<p;h+=8)P(this,h,h+7),P(this,h+1,h+6),P(this,h+2,h+5),P(this,h+3,h+4);return this},a.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?le(this,0,p):C.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(p){if(!a.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:a.compare(this,p)===0},a.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(p,h,k,M,G){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),!a.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),k===void 0&&(k=p?p.length:0),M===void 0&&(M=0),G===void 0&&(G=this.length),h<0||k>p.length||M<0||G>this.length)throw new RangeError("out of range index");if(M>=G&&h>=k)return 0;if(M>=G)return-1;if(h>=k)return 1;if(h>>>=0,k>>>=0,M>>>=0,G>>>=0,this===p)return 0;let ne=G-M,De=k-h;const He=Math.min(ne,De),Re=this.slice(M,G),Oe=p.slice(h,k);for(let Le=0;Le<He;++Le)if(Re[Le]!==Oe[Le]){ne=Re[Le],De=Oe[Le];break}return ne<De?-1:De<ne?1:0};function _(I,p,h,k,M){if(I.length===0)return-1;if(typeof h=="string"?(k=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,jt(h)&&(h=M?0:I.length-1),h<0&&(h=I.length+h),h>=I.length){if(M)return-1;h=I.length-1}else if(h<0)if(M)h=0;else return-1;if(typeof p=="string"&&(p=a.from(p,k)),a.isBuffer(p))return p.length===0?-1:L(I,p,h,k,M);if(typeof p=="number")return p=p&255,typeof i.prototype.indexOf=="function"?M?i.prototype.indexOf.call(I,p,h):i.prototype.lastIndexOf.call(I,p,h):L(I,[p],h,k,M);throw new TypeError("val must be string, number or Buffer")}function L(I,p,h,k,M){let G=1,ne=I.length,De=p.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(I.length<2||p.length<2)return-1;G=2,ne/=2,De/=2,h/=2}function He(Oe,Le){return G===1?Oe[Le]:Oe.readUInt16BE(Le*G)}let Re;if(M){let Oe=-1;for(Re=h;Re<ne;Re++)if(He(I,Re)===He(p,Oe===-1?0:Re-Oe)){if(Oe===-1&&(Oe=Re),Re-Oe+1===De)return Oe*G}else Oe!==-1&&(Re-=Re-Oe),Oe=-1}else for(h+De>ne&&(h=ne-De),Re=h;Re>=0;Re--){let Oe=!0;for(let Le=0;Le<De;Le++)if(He(I,Re+Le)!==He(p,Le)){Oe=!1;break}if(Oe)return Re}return-1}a.prototype.includes=function(p,h,k){return this.indexOf(p,h,k)!==-1},a.prototype.indexOf=function(p,h,k){return _(this,p,h,k,!0)},a.prototype.lastIndexOf=function(p,h,k){return _(this,p,h,k,!1)};function B(I,p,h,k){h=Number(h)||0;const M=I.length-h;k?(k=Number(k),k>M&&(k=M)):k=M;const G=p.length;k>G/2&&(k=G/2);let ne;for(ne=0;ne<k;++ne){const De=parseInt(p.substr(ne*2,2),16);if(jt(De))return ne;I[h+ne]=De}return ne}function $(I,p,h,k){return vt(Pe(p,I.length-h),I,h,k)}function D(I,p,h,k){return vt(Ue(p),I,h,k)}function H(I,p,h,k){return vt(Ze(p),I,h,k)}function X(I,p,h,k){return vt(ze(p,I.length-h),I,h,k)}a.prototype.write=function(p,h,k,M){if(h===void 0)M="utf8",k=this.length,h=0;else if(k===void 0&&typeof h=="string")M=h,k=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(k)?(k=k>>>0,M===void 0&&(M="utf8")):(M=k,k=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const G=this.length-h;if((k===void 0||k>G)&&(k=G),p.length>0&&(k<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let ne=!1;for(;;)switch(M){case"hex":return B(this,p,h,k);case"utf8":case"utf-8":return $(this,p,h,k);case"ascii":case"latin1":case"binary":return D(this,p,h,k);case"base64":return H(this,p,h,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,p,h,k);default:if(ne)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),ne=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(I,p,h){return p===0&&h===I.length?t.fromByteArray(I):t.fromByteArray(I.slice(p,h))}function le(I,p,h){h=Math.min(I.length,h);const k=[];let M=p;for(;M<h;){const G=I[M];let ne=null,De=G>239?4:G>223?3:G>191?2:1;if(M+De<=h){let He,Re,Oe,Le;switch(De){case 1:G<128&&(ne=G);break;case 2:He=I[M+1],(He&192)===128&&(Le=(G&31)<<6|He&63,Le>127&&(ne=Le));break;case 3:He=I[M+1],Re=I[M+2],(He&192)===128&&(Re&192)===128&&(Le=(G&15)<<12|(He&63)<<6|Re&63,Le>2047&&(Le<55296||Le>57343)&&(ne=Le));break;case 4:He=I[M+1],Re=I[M+2],Oe=I[M+3],(He&192)===128&&(Re&192)===128&&(Oe&192)===128&&(Le=(G&15)<<18|(He&63)<<12|(Re&63)<<6|Oe&63,Le>65535&&Le<1114112&&(ne=Le))}}ne===null?(ne=65533,De=1):ne>65535&&(ne-=65536,k.push(ne>>>10&1023|55296),ne=56320|ne&1023),k.push(ne),M+=De}return fe(k)}const me=4096;function fe(I){const p=I.length;if(p<=me)return String.fromCharCode.apply(String,I);let h="",k=0;for(;k<p;)h+=String.fromCharCode.apply(String,I.slice(k,k+=me));return h}function we(I,p,h){let k="";h=Math.min(I.length,h);for(let M=p;M<h;++M)k+=String.fromCharCode(I[M]&127);return k}function Se(I,p,h){let k="";h=Math.min(I.length,h);for(let M=p;M<h;++M)k+=String.fromCharCode(I[M]);return k}function re(I,p,h){const k=I.length;(!p||p<0)&&(p=0),(!h||h<0||h>k)&&(h=k);let M="";for(let G=p;G<h;++G)M+=nr[I[G]];return M}function oe(I,p,h){const k=I.slice(p,h);let M="";for(let G=0;G<k.length-1;G+=2)M+=String.fromCharCode(k[G]+k[G+1]*256);return M}a.prototype.slice=function(p,h){const k=this.length;p=~~p,h=h===void 0?k:~~h,p<0?(p+=k,p<0&&(p=0)):p>k&&(p=k),h<0?(h+=k,h<0&&(h=0)):h>k&&(h=k),h<p&&(h=p);const M=this.subarray(p,h);return Object.setPrototypeOf(M,a.prototype),M};function ae(I,p,h){if(I%1!==0||I<0)throw new RangeError("offset is not uint");if(I+p>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=this[p],G=1,ne=0;for(;++ne<h&&(G*=256);)M+=this[p+ne]*G;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=this[p+--h],G=1;for(;h>0&&(G*=256);)M+=this[p+--h]*G;return M},a.prototype.readUint8=a.prototype.readUInt8=function(p,h){return p=p>>>0,h||ae(p,1,this.length),this[p]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||ae(p,2,this.length),this[p]|this[p+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||ae(p,2,this.length),this[p]<<8|this[p+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},a.prototype.readBigUInt64LE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,G=this[++p]+this[++p]*2**8+this[++p]*2**16+k*2**24;return BigInt(M)+(BigInt(G)<<BigInt(32))}),a.prototype.readBigUInt64BE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],G=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k;return(BigInt(M)<<BigInt(32))+BigInt(G)}),a.prototype.readIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=this[p],G=1,ne=0;for(;++ne<h&&(G*=256);)M+=this[p+ne]*G;return G*=128,M>=G&&(M-=Math.pow(2,8*h)),M},a.prototype.readIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=h,G=1,ne=this[p+--M];for(;M>0&&(G*=256);)ne+=this[p+--M]*G;return G*=128,ne>=G&&(ne-=Math.pow(2,8*h)),ne},a.prototype.readInt8=function(p,h){return p=p>>>0,h||ae(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},a.prototype.readInt16LE=function(p,h){p=p>>>0,h||ae(p,2,this.length);const k=this[p]|this[p+1]<<8;return k&32768?k|4294901760:k},a.prototype.readInt16BE=function(p,h){p=p>>>0,h||ae(p,2,this.length);const k=this[p+1]|this[p]<<8;return k&32768?k|4294901760:k},a.prototype.readInt32LE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},a.prototype.readInt32BE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},a.prototype.readBigInt64LE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(k<<24);return(BigInt(M)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),a.prototype.readBigInt64BE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(M)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k)}),a.prototype.readFloatLE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),r.read(this,p,!0,23,4)},a.prototype.readFloatBE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),r.read(this,p,!1,23,4)},a.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||ae(p,8,this.length),r.read(this,p,!0,52,8)},a.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||ae(p,8,this.length),r.read(this,p,!1,52,8)};function Ae(I,p,h,k,M,G){if(!a.isBuffer(I))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>M||p<G)throw new RangeError('"value" argument is out of bounds');if(h+k>I.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(p,h,k,M){if(p=+p,h=h>>>0,k=k>>>0,!M){const De=Math.pow(2,8*k)-1;Ae(this,p,h,k,De,0)}let G=1,ne=0;for(this[h]=p&255;++ne<k&&(G*=256);)this[h+ne]=p/G&255;return h+k},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(p,h,k,M){if(p=+p,h=h>>>0,k=k>>>0,!M){const De=Math.pow(2,8*k)-1;Ae(this,p,h,k,De,0)}let G=k-1,ne=1;for(this[h+G]=p&255;--G>=0&&(ne*=256);)this[h+G]=p/ne&255;return h+k},a.prototype.writeUint8=a.prototype.writeUInt8=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,1,255,0),this[h]=p&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function Z(I,p,h,k,M){Be(p,k,M,I,h,7);let G=Number(p&BigInt(4294967295));I[h++]=G,G=G>>8,I[h++]=G,G=G>>8,I[h++]=G,G=G>>8,I[h++]=G;let ne=Number(p>>BigInt(32)&BigInt(4294967295));return I[h++]=ne,ne=ne>>8,I[h++]=ne,ne=ne>>8,I[h++]=ne,ne=ne>>8,I[h++]=ne,h}function F(I,p,h,k,M){Be(p,k,M,I,h,7);let G=Number(p&BigInt(4294967295));I[h+7]=G,G=G>>8,I[h+6]=G,G=G>>8,I[h+5]=G,G=G>>8,I[h+4]=G;let ne=Number(p>>BigInt(32)&BigInt(4294967295));return I[h+3]=ne,ne=ne>>8,I[h+2]=ne,ne=ne>>8,I[h+1]=ne,ne=ne>>8,I[h]=ne,h+8}a.prototype.writeBigUInt64LE=ct(function(p,h=0){return Z(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ct(function(p,h=0){return F(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(p,h,k,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*k-1);Ae(this,p,h,k,He-1,-He)}let G=0,ne=1,De=0;for(this[h]=p&255;++G<k&&(ne*=256);)p<0&&De===0&&this[h+G-1]!==0&&(De=1),this[h+G]=(p/ne>>0)-De&255;return h+k},a.prototype.writeIntBE=function(p,h,k,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*k-1);Ae(this,p,h,k,He-1,-He)}let G=k-1,ne=1,De=0;for(this[h+G]=p&255;--G>=0&&(ne*=256);)p<0&&De===0&&this[h+G+1]!==0&&(De=1),this[h+G]=(p/ne>>0)-De&255;return h+k},a.prototype.writeInt8=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},a.prototype.writeInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},a.prototype.writeInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},a.prototype.writeBigInt64LE=ct(function(p,h=0){return Z(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ct(function(p,h=0){return F(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function O(I,p,h,k,M,G){if(h+k>I.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function Q(I,p,h,k,M){return p=+p,h=h>>>0,M||O(I,p,h,4),r.write(I,p,h,k,23,4),h+4}a.prototype.writeFloatLE=function(p,h,k){return Q(this,p,h,!0,k)},a.prototype.writeFloatBE=function(p,h,k){return Q(this,p,h,!1,k)};function W(I,p,h,k,M){return p=+p,h=h>>>0,M||O(I,p,h,8),r.write(I,p,h,k,52,8),h+8}a.prototype.writeDoubleLE=function(p,h,k){return W(this,p,h,!0,k)},a.prototype.writeDoubleBE=function(p,h,k){return W(this,p,h,!1,k)},a.prototype.copy=function(p,h,k,M){if(!a.isBuffer(p))throw new TypeError("argument should be a Buffer");if(k||(k=0),!M&&M!==0&&(M=this.length),h>=p.length&&(h=p.length),h||(h=0),M>0&&M<k&&(M=k),M===k||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),p.length-h<M-k&&(M=p.length-h+k);const G=M-k;return this===p&&typeof i.prototype.copyWithin=="function"?this.copyWithin(h,k,M):i.prototype.set.call(p,this.subarray(k,M),h),G},a.prototype.fill=function(p,h,k,M){if(typeof p=="string"){if(typeof h=="string"?(M=h,h=0,k=this.length):typeof k=="string"&&(M=k,k=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(p.length===1){const ne=p.charCodeAt(0);(M==="utf8"&&ne<128||M==="latin1")&&(p=ne)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<k)throw new RangeError("Out of range index");if(k<=h)return this;h=h>>>0,k=k===void 0?this.length:k>>>0,p||(p=0);let G;if(typeof p=="number")for(G=h;G<k;++G)this[G]=p;else{const ne=a.isBuffer(p)?p:a.from(p,M),De=ne.length;if(De===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(G=0;G<k-h;++G)this[G+h]=ne[G%De]}return this};const U={};function z(I,p,h){U[I]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(I){return I?`${I} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(I,p){return`The "${I}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(I,p,h){let k=`The value of "${I}" is out of range.`,M=h;return Number.isInteger(h)&&Math.abs(h)>2**32?M=ue(String(h)):typeof h=="bigint"&&(M=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(M=ue(M)),M+="n"),k+=` It must be ${p}. Received ${M}`,k},RangeError);function ue(I){let p="",h=I.length;const k=I[0]==="-"?1:0;for(;h>=k+4;h-=3)p=`_${I.slice(h-3,h)}${p}`;return`${I.slice(0,h)}${p}`}function _e(I,p,h){xe(p,"offset"),(I[p]===void 0||I[p+h]===void 0)&&Fe(p,I.length-(h+1))}function Be(I,p,h,k,M,G){if(I>h||I<p){const ne=typeof p=="bigint"?"n":"";let De;throw p===0||p===BigInt(0)?De=`>= 0${ne} and < 2${ne} ** ${(G+1)*8}${ne}`:De=`>= -(2${ne} ** ${(G+1)*8-1}${ne}) and < 2 ** ${(G+1)*8-1}${ne}`,new U.ERR_OUT_OF_RANGE("value",De,I)}_e(k,M,G)}function xe(I,p){if(typeof I!="number")throw new U.ERR_INVALID_ARG_TYPE(p,"number",I)}function Fe(I,p,h){throw Math.floor(I)!==I?(xe(I,h),new U.ERR_OUT_OF_RANGE("offset","an integer",I)):p<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,I)}const Me=/[^+/0-9A-Za-z-_]/g;function ee(I){if(I=I.split("=")[0],I=I.trim().replace(Me,""),I.length<2)return"";for(;I.length%4!==0;)I=I+"=";return I}function Pe(I,p){p=p||1/0;let h;const k=I.length;let M=null;const G=[];for(let ne=0;ne<k;++ne){if(h=I.charCodeAt(ne),h>55295&&h<57344){if(!M){if(h>56319){(p-=3)>-1&&G.push(239,191,189);continue}else if(ne+1===k){(p-=3)>-1&&G.push(239,191,189);continue}M=h;continue}if(h<56320){(p-=3)>-1&&G.push(239,191,189),M=h;continue}h=(M-55296<<10|h-56320)+65536}else M&&(p-=3)>-1&&G.push(239,191,189);if(M=null,h<128){if((p-=1)<0)break;G.push(h)}else if(h<2048){if((p-=2)<0)break;G.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;G.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;G.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return G}function Ue(I){const p=[];for(let h=0;h<I.length;++h)p.push(I.charCodeAt(h)&255);return p}function ze(I,p){let h,k,M;const G=[];for(let ne=0;ne<I.length&&!((p-=2)<0);++ne)h=I.charCodeAt(ne),k=h>>8,M=h%256,G.push(M),G.push(k);return G}function Ze(I){return t.toByteArray(ee(I))}function vt(I,p,h,k){let M;for(M=0;M<k&&!(M+h>=p.length||M>=I.length);++M)p[M+h]=I[M];return M}function et(I,p){return I instanceof p||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===p.name}function jt(I){return I!==I}const nr=function(){const I="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const k=h*16;for(let M=0;M<16;++M)p[k+M]=I[h]+I[M]}return p}();function ct(I){return typeof BigInt>"u"?Ir:I}function Ir(){throw new Error("BigInt not supported")}})(Ah);const po=Ah.Buffer;var Dl,_h;function Ih(){return _h||(_h=1,Dl=typeof ye=="object"&&ye.env&&ye.env.NODE_DEBUG&&/\bsemver\b/i.test(ye.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Dl}var Ll,Ch;function Fh(){if(Ch)return Ll;Ch=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return Ll={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ll}var ws={exports:{}},Ph;function ZT(){return Ph||(Ph=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Fh(),i=Ih();t=e.exports={};const s=t.re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],a=t.t={};let f=0;const d="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",o],[d,n]],E=T=>{for(const[w,y]of b)T=T.split(`${w}*`).join(`${w}{0,${y}}`).split(`${w}+`).join(`${w}{1,${y}}`);return T},S=(T,w,y)=>{const g=E(w),v=f++;i(T,v,w),a[T]=v,c[v]=w,u[v]=g,s[v]=new RegExp(w,y?"g":void 0),l[v]=new RegExp(g,y?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),S("MAINVERSION",`(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${c[a.NUMERICIDENTIFIER]}|${c[a.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${c[a.NUMERICIDENTIFIERLOOSE]}|${c[a.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${c[a.PRERELEASEIDENTIFIER]}(?:\\.${c[a.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${c[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[a.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${d}+`),S("BUILD",`(?:\\+(${c[a.BUILDIDENTIFIER]}(?:\\.${c[a.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${c[a.MAINVERSION]}${c[a.PRERELEASE]}?${c[a.BUILD]}?`),S("FULL",`^${c[a.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${c[a.MAINVERSIONLOOSE]}${c[a.PRERELEASELOOSE]}?${c[a.BUILD]}?`),S("LOOSE",`^${c[a.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${c[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${c[a.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:${c[a.PRERELEASE]})?${c[a.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:${c[a.PRERELEASELOOSE]})?${c[a.BUILD]}?)?)?`),S("XRANGE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),S("COERCE",`${c[a.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",c[a.COERCEPLAIN]+`(?:${c[a.PRERELEASE]})?(?:${c[a.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",c[a.COERCE],!0),S("COERCERTLFULL",c[a.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${c[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",S("TILDE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${c[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",S("CARET",`^${c[a.LONECARET]}${c[a.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${c[a.LONECARET]}${c[a.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${c[a.GTLT]}\\s*(${c[a.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]}|${c[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${c[a.XRANGEPLAIN]})\\s+-\\s+(${c[a.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${c[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[a.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ws,ws.exports)),ws.exports}var Bl,xh;function eA(){if(xh)return Bl;xh=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Bl=n=>n?typeof n!="object"?e:n:t,Bl}var Ml,Oh;function tA(){if(Oh)return Ml;Oh=1;const e=/^[0-9]+$/,t=(n,o)=>{const i=e.test(n),s=e.test(o);return i&&s&&(n=+n,o=+o),n===o?0:i&&!s?-1:s&&!i?1:n<o?-1:1};return Ml={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},Ml}var jl,kh;function Nh(){if(kh)return jl;kh=1;const e=Ih(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Fh(),{safeRe:n,safeSrc:o,t:i}=ZT(),s=eA(),{compareIdentifiers:l}=tA();class c{constructor(a,f){if(f=s(f),a instanceof c){if(a.loose===!!f.loose&&a.includePrerelease===!!f.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=a.trim().match(f.loose?n[i.LOOSE]:n[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(b=>{if(/^[0-9]+$/.test(b)){const E=+b;if(E>=0&&E<r)return E}return b}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(a){if(e("SemVer.compare",this.version,this.options,a),!(a instanceof c)){if(typeof a=="string"&&a===this.version)return 0;a=new c(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof c||(a=new c(a,this.options)),l(this.major,a.major)||l(this.minor,a.minor)||l(this.patch,a.patch)}comparePre(a){if(a instanceof c||(a=new c(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],b=a.prerelease[f];if(e("prerelease compare",f,d,b),d===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(d===void 0)return-1;if(d===b)continue;return l(d,b)}while(++f)}compareBuild(a){a instanceof c||(a=new c(a,this.options));let f=0;do{const d=this.build[f],b=a.build[f];if(e("build compare",f,d,b),d===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(d===void 0)return-1;if(d===b)continue;return l(d,b)}while(++f)}inc(a,f,d){if(a.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const b=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),E=`-${f}`.match(b);if(!E||E[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const b=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[b];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(b)}}if(f){let E=[f,b];d===!1&&(E=[f]),l(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return jl=c,jl}var Ul,$h;function rA(){if($h)return Ul;$h=1;const e=Nh();return Ul=(r,n)=>new e(r,n).major,Ul}var nA=rA();const Dh=il(nA);var ql,Lh;function iA(){if(Lh)return ql;Lh=1;const e=Nh();return ql=(r,n,o)=>new e(r,o).compare(new e(n,o)),ql}var Vl,Bh;function oA(){if(Bh)return Vl;Bh=1;const e=iA();return Vl=(r,n,o)=>e(n,r,o),Vl}var sA=oA();const aA=il(sA);class Ci extends Error{constructor(r,...n){super([r,...n].filter(Boolean).join(", "));Ee(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class lA extends Ci{constructor(){super(...arguments);Ee(this,"name","ApiError")}}const zl=(e,t)=>{const r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.href=e,r.setAttribute("download",t),r.click(),document.body.removeChild(r)};class cA{constructor(t,r,n,o=ce([])){Ee(this,"clientService");Ee(this,"userStore");Ee(this,"serverUrl");Ee(this,"capability");Ee(this,"available");Ee(this,"fileIdsSupported");this.clientService=t,this.userStore=r,this.serverUrl=n,this.capability=V(()=>{const i=m(o).filter(s=>s.enabled).sort((s,l)=>aA(s.version,l.version));return i.length?i[0]:null}),this.available=V(()=>{var i;return!!((i=m(this.capability))!=null&&i.version)}),this.fileIdsSupported=V(()=>{var i;return Dh((i=m(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!m(this.available))throw new Ci("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new Ci("requested archive with empty list of resources");const r=this.buildDownloadUrl({...t});if(!r)throw new Ci("download url could not be built");const n=t.publicToken?r:await this.clientService.ocsUserContext.signUrl(r,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const l=await this.clientService.httpUnAuthenticated.get(n,{headers:{...!!t.publicLinkPassword&&{Authorization:"Basic "+po.from(["public",t.publicLinkPassword].join(":")).toString("base64")}},responseType:"arraybuffer"}),c=new Blob([l.data],{type:"application/octet-stream"}),u=URL.createObjectURL(c),a=this.getFileNameFromResponseHeaders(l.headers);return zl(u,a),n}catch(l){throw new ie.HttpError("archive could not be fetched",l.response)}}buildDownloadUrl(t){const r=[];switch(t.publicToken&&r.push(`public-token=${t.publicToken}`),Dh(m(this.capability).version)){case 2:return r.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+r.join("&");case 1:{const o=Math.random().toString(36).substring(2);return r.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+r.join("&")}default:return}}get url(){if(!this.available)throw new Ci("no archiver available");const t=m(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:ie.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var n;const r=(n=t["content-disposition"])==null?void 0:n.split('"')[1];return decodeURI(r)}}const uA=new Il({ttl:10*1e3,capacity:250}),fA=new Il({ttl:10*1e3,capacity:250});class dA{get avatarUrl(){return fA}get filePreview(){return uA}}const Wl=new dA;class Mh{constructor(t={}){Ee(this,"accessToken");Ee(this,"publicLinkToken");Ee(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+po.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class Hl{constructor(t,r){Ee(this,"instance");Ee(this,"cancelToken");this.cancelToken=Do.CancelToken.source(),this.instance=Do.create(t),r&&this.instance.interceptors.request.use(r)}cancel(t){this.cancelToken.cancel(t)}async delete(t,r,n){return await this.internalRequestWithData("delete",t,r,n)}get(t,r){return this.internalRequest("get",t,r)}head(t,r){return this.internalRequest("head",t,r)}options(t,r){return this.internalRequest("options",t,r)}patch(t,r,n){return this.internalRequestWithData("patch",t,r,n)}post(t,r,n){return this.internalRequestWithData("post",t,r,n)}put(t,r,n){return this.internalRequestWithData("put",t,r,n)}async request(t){const r=await this.instance.request(this.obtainConfig(t));return this.processResponse(r,t)}obtainConfig(t){return co({cancelToken:this.cancelToken.token},t)}processResponse(t,r){if(r!=null&&r.schema){const n=r.schema.parse(t.data);return{...t,data:n}}return t}async internalRequest(t,r,n){const o=await this.instance[t](r,this.obtainConfig(n));return this.processResponse(o,n)}async internalRequestWithData(t,r,n,o){const i=await this.instance[t](r,n,this.obtainConfig(o));return this.processResponse(i,o)}}class pA extends Error{constructor(){super(...arguments);Ee(this,"name","RetriableError")}}const hA=15e3;class gA{constructor(t,r){Ee(this,"url");Ee(this,"fetchOptions");Ee(this,"abortController");Ee(this,"eventListenerMap");Ee(this,"readyState");Ee(this,"withCredentials");Ee(this,"CONNECTING");Ee(this,"OPEN");Ee(this,"CLOSED");Ee(this,"onerror");Ee(this,"onmessage");Ee(this,"onopen");this.url=t,this.fetchOptions=r,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return k0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var r;const t=new Event("open");(r=this.onopen)==null||r.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const r=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(r);const n=t.event,o=this.eventListenerMap[n];o==null||o.forEach(s=>s(r))},onclose:()=>{throw this.readyState=this.CLOSED,new pA},onerror:t=>{var n;console.error(t);const r=new CustomEvent("error",{detail:t});return(n=this.onerror)==null||n.bind(this)(r),3e4+Math.floor(Math.random()*hA)}})}fetchProvider(...t){const[r,n]=t,o={...n,...this.fetchOptions};return window.fetch(r,o)}close(){this.abortController.abort("closed")}addEventListener(t,r){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(r)}removeEventListener(t,r){var n;this.eventListenerMap[t]=(n=this.eventListenerMap[t])==null?void 0:n.filter(o=>o!==r)}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 Gl=null;const mA=(e,t)=>(Gl||(Gl=new gA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),Gl),yA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Qt.v4(),"X-Requested-With":"XMLHttpRequest"}});class bA{constructor(t){Ee(this,"configStore");Ee(this,"language");Ee(this,"authStore");Ee(this,"httpAuthenticatedClient");Ee(this,"httpUnAuthenticatedClient");Ee(this,"graphClient");Ee(this,"ocsClient");Ee(this,"webDavClient");Ee(this,"initiatorId",Qt.v4());Ee(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Hl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.httpUnAuthenticatedClient=new Hl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},r=>(Object.assign(r.headers,this.getDynamicHeaders({useAuth:!1})),r))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return mA(this.configStore.serverUrl,yA({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}initGraphClient(){const t=Do.create({headers:this.staticHeaders});t.interceptors.request.use(r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.graphClient=ie.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Do.create({headers:this.staticHeaders});t.interceptors.request.use(r=>(Object.assign(r.headers,this.getDynamicHeaders()),r)),this.ocsClient=ie.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=ie.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 "+po.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Qt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class jh{constructor(){Ee(this,"topics");this.topics=new Map}subscribe(t,r){const n={token:Qt.v4(),callback:r},o=[n,...this.topics.get(t)||[]];return this.topics.set(t,o),n.token}publish(t,r){(this.topics.get(t)||[]).forEach(o=>o.callback(r))}unsubscribe(t,r){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(n=>n.token!==r))}}const Ye=new jh;var vA=Up(Object.keys,Object),wA=Object.prototype,SA=wA.hasOwnProperty;function Uh(e){if(!hs(e))return vA(e);var t=[];for(var r in Object(e))SA.call(e,r)&&r!="constructor"&&t.push(r);return t}var Kl=Qn(Kr,"DataView"),Ql=Qn(Kr,"Promise"),Xl=Qn(Kr,"Set"),Yl=Qn(Kr,"WeakMap"),qh="[object Map]",EA="[object Object]",Vh="[object Promise]",zh="[object Set]",Wh="[object WeakMap]",Hh="[object DataView]",TA=Kn(Kl),AA=Kn(io),RA=Kn(Ql),_A=Kn(Xl),IA=Kn(Yl),Nr=Gn;(Kl&&Nr(new Kl(new ArrayBuffer(1)))!=Hh||io&&Nr(new io)!=qh||Ql&&Nr(Ql.resolve())!=Vh||Xl&&Nr(new Xl)!=zh||Yl&&Nr(new Yl)!=Wh)&&(Nr=function(e){var t=Gn(e),r=t==EA?e.constructor:void 0,n=r?Kn(r):"";if(n)switch(n){case TA:return Hh;case AA:return qh;case RA:return Vh;case _A:return zh;case IA:return Wh}return t});var CA="[object Map]",FA="[object Set]",PA=Object.prototype,xA=PA.hasOwnProperty;function OA(e){if(e==null)return!0;if(ao(e)&&(Pr(e)||typeof e=="string"||typeof e.splice=="function"||Ei(e)||gs(e)||so(e)))return!e.length;var t=Nr(e);if(t==CA||t==FA)return!e.size;if(hs(e))return!Uh(e).length;for(var r in e)if(xA.call(e,r))return!1;return!0}class Gh{isEnabled(){return!0}isActive(t){return lt(t,"files-spaces-projects")?!1:lt(t,"files-spaces-generic")||Ar(t,"files-public-link")}getTask(t){const{router:r,clientService:n,resourcesStore:o,userStore:i,authService:s,spacesStore:l,sharesStore:c,configStore:u}=t,{webdav:a,graphAuthenticated:f}=n,{replaceInvalidFileRoute:d}=Qs({router:r}),b=this.setCurrentUserShareSpacePermissions;return lr.useTask(function*(E,S,T,w=null,y=null,g={}){try{o.clearResourceList();let{resource:v,children:A}=yield*ie.call(a.listFiles(T,{path:w,fileId:y},{signal:E}));v.id&&d({space:T,resource:v,path:w,fileId:y});let R;if(w==="/"&&(ie.isShareSpaceResource(T)?(R=yield*ie.call(ys({graphClient:f,spacesStore:l,space:T,signal:E})),R&&(v=ie.buildIncomingShareResource({graphRoles:c.graphRoles,driveItem:R,serverUrl:u.serverUrl}))):!ie.isPersonalSpaceResource(T)&&!ie.isPublicSpaceResource(T)&&(v=T)),yield o.loadAncestorMetaData({folder:v,space:T,client:a,signal:E}),g.loadShares){const C=o.ancestorMetaData;for(const P of A)P.indicators=Ro({space:T,resource:P,ancestorMetaData:C,user:i.user})}ie.isShareSpaceResource(T)&&(A.forEach(C=>C.remoteItemId=T.id),OA(T.members)&&(R||(R=yield*ie.call(ys({graphClient:f,spacesStore:l,space:T,signal:E}))),b({sharesStore:c,spacesStore:l,userStore:i,space:T,sharedDriveItem:R}))),o.initResourceList({currentFolder:v,resources:A})}catch(v){if(o.setCurrentFolder(null),console.error(v),v.statusCode===401)return s.handleAuthError(m(r.currentRoute))}}).restartable()}setCurrentUserShareSpacePermissions({sharesStore:t,spacesStore:r,userStore:n,space:o,sharedDriveItem:i}){var a;const s=((a=i==null?void 0:i.remoteItem)==null?void 0:a.permissions)||[];if(!s.length)return;const l=[];s.forEach(f=>{if(f["@libre.graph.permissions.actions"]){l.push(...f["@libre.graph.permissions.actions"]);return}const d=t.graphRoles[f.roles[0]];if(!d)return;const b=d.rolePermissions.flatMap(E=>E.allowedResourceActions);l.push(...b)});const c=[...new Set(l)],u={grantedTo:{user:{id:n.user.id,displayName:n.user.displayName}},permissions:c,roleId:""};r.updateSpaceField({id:o.id,field:"members",value:{[n.user.id]:u}})}}class Kh{isEnabled(){return!0}isActive(t){var n;const r=m(t.currentRoute);return At(t,"files-common-favorites")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:r,clientService:n,userStore:o}=t;return lr.useTask(function*(i,s){var c;r.clearResourceList(),r.setAncestorMetaData({});let l=yield n.webdav.listFavoriteFiles({username:(c=o.user)==null?void 0:c.onPremisesSamAccountName,signal:i});l=l.map(ie.buildResource),r.initResourceList({currentFolder:null,resources:l})})}}class Qh{isEnabled(){return!0}isActive(t){var n;const r=m(t.currentRoute);return Nt(t,"files-shares-via-link")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:r,spacesStore:n,clientService:o,configStore:i,resourcesStore:s}=t;return lr.useTask(function*(l,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const a=(yield*ie.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:l}))).filter(f=>f.permissions.some(({link:d})=>!!d)).map(f=>ie.buildOutgoingShareResource({driveItem:f,user:r.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:a})})}}class Xh{isEnabled(){return!0}isActive(t){var n;const r=m(t.currentRoute);return Nt(t,"files-shares-with-me")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:r,clientService:n,configStore:o,resourcesStore:i,sharesStore:s}=t;return lr.useTask(function*(l,c){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:n.graphAuthenticated,signal:l}));const a=(yield*ie.call(n.graphAuthenticated.driveItems.listSharedWithMe({signal:l}))).map(f=>ie.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:a})})}}class Yh{isEnabled(){return!0}isActive(t){var n;const r=m(t.currentRoute);return Nt(t,"files-shares-with-others")||((n=r==null?void 0:r.query)==null?void 0:n.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:r,spacesStore:n,clientService:o,configStore:i,resourcesStore:s}=t;return lr.useTask(function*(l,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const a=(yield*ie.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:l}))).filter(f=>f.permissions.some(({link:d})=>!d)).map(f=>ie.buildOutgoingShareResource({driveItem:f,user:r.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:a})})}}class _r{}Ee(_r,"Shared","S"),Ee(_r,"Shareable","R"),Ee(_r,"Mounted","M"),Ee(_r,"Deletable","D"),Ee(_r,"Renameable","N"),Ee(_r,"Moveable","V"),Ee(_r,"Updateable","NV"),Ee(_r,"FileUpdateable","W"),Ee(_r,"FolderCreateable","CK"),Ee(_r,"Deny","Z"),Ee(_r,"SecureView","X");const Ss=e=>({value:e,type:null}),kA=e=>Ss(e),ft=e=>Ss(e),Jl=e=>Ss(e),NA=e=>Ss(e),$A={Permissions:ft("permissions"),IsFavorite:Jl("favorite"),FileId:ft("fileid"),FileParent:ft("file-parent"),Name:ft("name"),OwnerId:ft("owner-id"),OwnerDisplayName:ft("owner-display-name"),PrivateLink:ft("privatelink"),ContentLength:Jl("getcontentlength"),ContentSize:Jl("size"),LastModifiedDate:ft("getlastmodified"),Tags:kA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:ft("getetag"),MimeType:ft("getcontenttype"),ResourceType:NA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:ft("owner"),LockTime:ft("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:ft("downloadURL"),Highlights:ft("highlights"),MetaPathForUser:ft("meta-path-for-user"),RemoteItemId:ft("remote-item-id"),ShareId:ft("shareid"),ShareRoot:ft("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:ft("share-permissions"),TrashbinOriginalFilename:ft("trashbin-original-filename"),TrashbinOriginalLocation:ft("trashbin-original-location"),TrashbinDeletedDate:ft("trashbin-delete-datetime"),PublicLinkItemType:ft("public-link-item-type"),PublicLinkPermission:ft("public-link-permission"),PublicLinkExpiration:ft("public-link-expiration"),PublicLinkShareDate:ft("public-link-share-datetime"),PublicLinkShareOwner:ft("public-link-share-owner")},Ve=Object.fromEntries(Object.entries($A).map(([e,t])=>[e,t.value])),ui=class ui{};Ee(ui,"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.DownloadURL,Ve.Tags,Ve.Audio,Ve.Location,Ve.Image,Ve.Photo]),Ee(ui,"PublicLink",ui.Default.concat([Ve.PublicLinkItemType,Ve.PublicLinkPermission,Ve.PublicLinkExpiration,Ve.PublicLinkShareDate,Ve.PublicLinkShareOwner])),Ee(ui,"Trashbin",[Ve.ContentLength,Ve.ResourceType,Ve.TrashbinOriginalLocation,Ve.TrashbinOriginalFilename,Ve.TrashbinDeletedDate,Ve.Permissions,Ve.FileParent]),Ee(ui,"DavNamespace",[Ve.ContentLength,Ve.LastModifiedDate,Ve.ETag,Ve.MimeType,Ve.ResourceType,Ve.LockDiscovery,Ve.ActiveLock]);let Es=ui;var Jh={},Ts={};Ts.byteLength=BA,Ts.toByteArray=jA,Ts.fromByteArray=VA;for(var tn=[],$r=[],DA=typeof Uint8Array<"u"?Uint8Array:Array,Zl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fi=0,LA=Zl.length;Fi<LA;++Fi)tn[Fi]=Zl[Fi],$r[Zl.charCodeAt(Fi)]=Fi;$r[45]=62,$r[95]=63;function Zh(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function BA(e){var t=Zh(e),r=t[0],n=t[1];return(r+n)*3/4-n}function MA(e,t,r){return(t+r)*3/4-r}function jA(e){var t,r=Zh(e),n=r[0],o=r[1],i=new DA(MA(e,n,o)),s=0,l=o>0?n-4:n,c;for(c=0;c<l;c+=4)t=$r[e.charCodeAt(c)]<<18|$r[e.charCodeAt(c+1)]<<12|$r[e.charCodeAt(c+2)]<<6|$r[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=$r[e.charCodeAt(c)]<<2|$r[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=$r[e.charCodeAt(c)]<<10|$r[e.charCodeAt(c+1)]<<4|$r[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function UA(e){return tn[e>>18&63]+tn[e>>12&63]+tn[e>>6&63]+tn[e&63]}function qA(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(UA(n));return o.join("")}function VA(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,l=r-n;s<l;s+=i)o.push(qA(e,s,s+i>l?l:s+i));return n===1?(t=e[r-1],o.push(tn[t>>2]+tn[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(tn[t>>10]+tn[t>>4&63]+tn[t<<2&63]+"=")),o.join("")}var ec={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ec.read=function(e,t,r,n,o){var i,s,l=o*8-n-1,c=(1<<l)-1,u=c>>1,a=-7,f=r?o-1:0,d=r?-1:1,b=e[t+f];for(f+=d,i=b&(1<<-a)-1,b>>=-a,a+=l;a>0;i=i*256+e[t+f],f+=d,a-=8);for(s=i&(1<<-a)-1,i>>=-a,a+=n;a>0;s=s*256+e[t+f],f+=d,a-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-u}return(b?-1:1)*s*Math.pow(2,i-n)},ec.write=function(e,t,r,n,o,i){var s,l,c,u=i*8-o-1,a=(1<<u)-1,f=a>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,E=n?1:-1,S=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=a):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=a?(l=0,s=a):s+f>=1?(l=(t*c-1)*Math.pow(2,o),s=s+f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+b]=l&255,b+=E,l/=256,o-=8);for(s=s<<o|l,u+=o;u>0;e[r+b]=s&255,b+=E,s/=256,u-=8);e[r+b-E]|=S*128};/*!
12
12
  * The buffer module from node.js, for the browser.
13
13
  *
14
14
  * @author Feross Aboukhadijeh <https://feross.org>
15
15
  * @license MIT
16
- */(function(e){const t=Ts,r=Zl,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=T,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:l}=globalThis;a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{const _=new i(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,i.prototype),Object.setPrototypeOf(_,p),_.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(_){if(_>o)throw new RangeError('The value "'+_+'" is invalid for option "size"');const p=new i(_);return Object.setPrototypeOf(p,a.prototype),p}function a(_,p,h){if(typeof _=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(_)}return f(_,p,h)}a.poolSize=8192;function f(_,p,h){if(typeof _=="string")return w(_,p);if(s.isView(_))return S(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(et(_,s)||_&&et(_.buffer,s)||typeof l<"u"&&(et(_,l)||_&&et(_.buffer,l)))return m(_,p,h);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const O=_.valueOf&&_.valueOf();if(O!=null&&O!==_)return a.from(O,p,h);const M=g(_);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return a.from(_[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}a.from=function(_,p,h){return f(_,p,h)},Object.setPrototypeOf(a.prototype,i.prototype),Object.setPrototypeOf(a,i);function d(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function b(_,p,h){return d(_),_<=0?u(_):p!==void 0?typeof h=="string"?u(_).fill(p,h):u(_).fill(p):u(_)}a.alloc=function(_,p,h){return b(_,p,h)};function E(_){return d(_),u(_<0?0:v(_)|0)}a.allocUnsafe=function(_){return E(_)},a.allocUnsafeSlow=function(_){return E(_)};function w(_,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=A(_,p)|0;let O=u(h);const M=O.write(_,p);return M!==h&&(O=O.slice(0,M)),O}function R(_){const p=_.length<0?0:v(_.length)|0,h=u(p);for(let O=0;O<p;O+=1)h[O]=_[O]&255;return h}function S(_){if(et(_,i)){const p=new i(_);return m(p.buffer,p.byteOffset,p.byteLength)}return R(_)}function m(_,p,h){if(p<0||_.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let O;return p===void 0&&h===void 0?O=new i(_):h===void 0?O=new i(_,p):O=new i(_,p,h),Object.setPrototypeOf(O,a.prototype),O}function g(_){if(a.isBuffer(_)){const p=v(_.length)|0,h=u(p);return h.length===0||_.copy(h,0,0,p),h}if(_.length!==void 0)return typeof _.length!="number"||Ut(_.length)?u(0):R(_);if(_.type==="Buffer"&&Array.isArray(_.data))return R(_.data)}function v(_){if(_>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return _|0}function T(_){return+_!=_&&(_=0),a.alloc(+_)}a.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==a.prototype},a.compare=function(p,h){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),et(h,i)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(p)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let O=p.length,M=h.length;for(let G=0,re=Math.min(O,M);G<re;++G)if(p[G]!==h[G]){O=p[G],M=h[G];break}return O<M?-1:M<O?1:0},a.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}},a.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return a.alloc(0);let O;if(h===void 0)for(h=0,O=0;O<p.length;++O)h+=p[O].length;const M=a.allocUnsafe(h);let G=0;for(O=0;O<p.length;++O){let re=p[O];if(et(re,i))G+re.length>M.length?(a.isBuffer(re)||(re=a.from(re)),re.copy(M,G)):i.prototype.set.call(M,re,G);else if(a.isBuffer(re))re.copy(M,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=re.length}return M};function A(_,p){if(a.isBuffer(_))return _.length;if(s.isView(_)||et(_,s))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);const h=_.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&h===0)return 0;let M=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Le(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ze(_).length;default:if(M)return O?-1:Le(_).length;p=(""+p).toLowerCase(),M=!0}}a.byteLength=A;function F(_,p,h){let O=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(_||(_="utf8");;)switch(_){case"hex":return ne(this,p,h);case"utf8":case"utf-8":return ce(this,p,h);case"ascii":return Se(this,p,h);case"latin1":case"binary":return Ae(this,p,h);case"base64":return J(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,p,h);default:if(O)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),O=!0}}a.prototype._isBuffer=!0;function C(_,p,h){const O=_[p];_[p]=_[h],_[h]=O}a.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 h=0;h<p;h+=2)C(this,h,h+1);return this},a.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 h=0;h<p;h+=4)C(this,h,h+3),C(this,h+1,h+2);return this},a.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 h=0;h<p;h+=8)C(this,h,h+7),C(this,h+1,h+6),C(this,h+2,h+5),C(this,h+3,h+4);return this},a.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?ce(this,0,p):F.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(p){if(!a.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:a.compare(this,p)===0},a.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(p,h,O,M,G){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),!a.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),O===void 0&&(O=p?p.length:0),M===void 0&&(M=0),G===void 0&&(G=this.length),h<0||O>p.length||M<0||G>this.length)throw new RangeError("out of range index");if(M>=G&&h>=O)return 0;if(M>=G)return-1;if(h>=O)return 1;if(h>>>=0,O>>>=0,M>>>=0,G>>>=0,this===p)return 0;let re=G-M,$e=O-h;const He=Math.min(re,$e),Re=this.slice(M,G),xe=p.slice(h,O);for(let De=0;De<He;++De)if(Re[De]!==xe[De]){re=Re[De],$e=xe[De];break}return re<$e?-1:$e<re?1:0};function I(_,p,h,O,M){if(_.length===0)return-1;if(typeof h=="string"?(O=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ut(h)&&(h=M?0:_.length-1),h<0&&(h=_.length+h),h>=_.length){if(M)return-1;h=_.length-1}else if(h<0)if(M)h=0;else return-1;if(typeof p=="string"&&(p=a.from(p,O)),a.isBuffer(p))return p.length===0?-1:L(_,p,h,O,M);if(typeof p=="number")return p=p&255,typeof i.prototype.indexOf=="function"?M?i.prototype.indexOf.call(_,p,h):i.prototype.lastIndexOf.call(_,p,h):L(_,[p],h,O,M);throw new TypeError("val must be string, number or Buffer")}function L(_,p,h,O,M){let G=1,re=_.length,$e=p.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(_.length<2||p.length<2)return-1;G=2,re/=2,$e/=2,h/=2}function He(xe,De){return G===1?xe[De]:xe.readUInt16BE(De*G)}let Re;if(M){let xe=-1;for(Re=h;Re<re;Re++)if(He(_,Re)===He(p,xe===-1?0:Re-xe)){if(xe===-1&&(xe=Re),Re-xe+1===$e)return xe*G}else xe!==-1&&(Re-=Re-xe),xe=-1}else for(h+$e>re&&(h=re-$e),Re=h;Re>=0;Re--){let xe=!0;for(let De=0;De<$e;De++)if(He(_,Re+De)!==He(p,De)){xe=!1;break}if(xe)return Re}return-1}a.prototype.includes=function(p,h,O){return this.indexOf(p,h,O)!==-1},a.prototype.indexOf=function(p,h,O){return I(this,p,h,O,!0)},a.prototype.lastIndexOf=function(p,h,O){return I(this,p,h,O,!1)};function B(_,p,h,O){h=Number(h)||0;const M=_.length-h;O?(O=Number(O),O>M&&(O=M)):O=M;const G=p.length;O>G/2&&(O=G/2);let re;for(re=0;re<O;++re){const $e=parseInt(p.substr(re*2,2),16);if(Ut($e))return re;_[h+re]=$e}return re}function $(_,p,h,O){return vt(Le(p,_.length-h),_,h,O)}function D(_,p,h,O){return vt(qe(p),_,h,O)}function H(_,p,h,O){return vt(Ze(p),_,h,O)}function ee(_,p,h,O){return vt(ze(p,_.length-h),_,h,O)}a.prototype.write=function(p,h,O,M){if(h===void 0)M="utf8",O=this.length,h=0;else if(O===void 0&&typeof h=="string")M=h,O=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(O)?(O=O>>>0,M===void 0&&(M="utf8")):(M=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const G=this.length-h;if((O===void 0||O>G)&&(O=G),p.length>0&&(O<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let re=!1;for(;;)switch(M){case"hex":return B(this,p,h,O);case"utf8":case"utf-8":return $(this,p,h,O);case"ascii":case"latin1":case"binary":return D(this,p,h,O);case"base64":return H(this,p,h,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,p,h,O);default:if(re)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),re=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(_,p,h){return p===0&&h===_.length?t.fromByteArray(_):t.fromByteArray(_.slice(p,h))}function ce(_,p,h){h=Math.min(_.length,h);const O=[];let M=p;for(;M<h;){const G=_[M];let re=null,$e=G>239?4:G>223?3:G>191?2:1;if(M+$e<=h){let He,Re,xe,De;switch($e){case 1:G<128&&(re=G);break;case 2:He=_[M+1],(He&192)===128&&(De=(G&31)<<6|He&63,De>127&&(re=De));break;case 3:He=_[M+1],Re=_[M+2],(He&192)===128&&(Re&192)===128&&(De=(G&15)<<12|(He&63)<<6|Re&63,De>2047&&(De<55296||De>57343)&&(re=De));break;case 4:He=_[M+1],Re=_[M+2],xe=_[M+3],(He&192)===128&&(Re&192)===128&&(xe&192)===128&&(De=(G&15)<<18|(He&63)<<12|(Re&63)<<6|xe&63,De>65535&&De<1114112&&(re=De))}}re===null?(re=65533,$e=1):re>65535&&(re-=65536,O.push(re>>>10&1023|55296),re=56320|re&1023),O.push(re),M+=$e}return de(O)}const be=4096;function de(_){const p=_.length;if(p<=be)return String.fromCharCode.apply(String,_);let h="",O=0;for(;O<p;)h+=String.fromCharCode.apply(String,_.slice(O,O+=be));return h}function Se(_,p,h){let O="";h=Math.min(_.length,h);for(let M=p;M<h;++M)O+=String.fromCharCode(_[M]&127);return O}function Ae(_,p,h){let O="";h=Math.min(_.length,h);for(let M=p;M<h;++M)O+=String.fromCharCode(_[M]);return O}function ne(_,p,h){const O=_.length;(!p||p<0)&&(p=0),(!h||h<0||h>O)&&(h=O);let M="";for(let G=p;G<h;++G)M+=nr[_[G]];return M}function ae(_,p,h){const O=_.slice(p,h);let M="";for(let G=0;G<O.length-1;G+=2)M+=String.fromCharCode(O[G]+O[G+1]*256);return M}a.prototype.slice=function(p,h){const O=this.length;p=~~p,h=h===void 0?O:~~h,p<0?(p+=O,p<0&&(p=0)):p>O&&(p=O),h<0?(h+=O,h<0&&(h=0)):h>O&&(h=O),h<p&&(h=p);const M=this.subarray(p,h);return Object.setPrototypeOf(M,a.prototype),M};function le(_,p,h){if(_%1!==0||_<0)throw new RangeError("offset is not uint");if(_+p>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=this[p],G=1,re=0;for(;++re<h&&(G*=256);)M+=this[p+re]*G;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=this[p+--h],G=1;for(;h>0&&(G*=256);)M+=this[p+--h]*G;return M},a.prototype.readUint8=a.prototype.readUInt8=function(p,h){return p=p>>>0,h||le(p,1,this.length),this[p]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||le(p,2,this.length),this[p]|this[p+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||le(p,2,this.length),this[p]<<8|this[p+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||le(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||le(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},a.prototype.readBigUInt64LE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,G=this[++p]+this[++p]*2**8+this[++p]*2**16+O*2**24;return BigInt(M)+(BigInt(G)<<BigInt(32))}),a.prototype.readBigUInt64BE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],G=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+O;return(BigInt(M)<<BigInt(32))+BigInt(G)}),a.prototype.readIntLE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=this[p],G=1,re=0;for(;++re<h&&(G*=256);)M+=this[p+re]*G;return G*=128,M>=G&&(M-=Math.pow(2,8*h)),M},a.prototype.readIntBE=function(p,h,O){p=p>>>0,h=h>>>0,O||le(p,h,this.length);let M=h,G=1,re=this[p+--M];for(;M>0&&(G*=256);)re+=this[p+--M]*G;return G*=128,re>=G&&(re-=Math.pow(2,8*h)),re},a.prototype.readInt8=function(p,h){return p=p>>>0,h||le(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},a.prototype.readInt16LE=function(p,h){p=p>>>0,h||le(p,2,this.length);const O=this[p]|this[p+1]<<8;return O&32768?O|4294901760:O},a.prototype.readInt16BE=function(p,h){p=p>>>0,h||le(p,2,this.length);const O=this[p+1]|this[p]<<8;return O&32768?O|4294901760:O},a.prototype.readInt32LE=function(p,h){return p=p>>>0,h||le(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},a.prototype.readInt32BE=function(p,h){return p=p>>>0,h||le(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},a.prototype.readBigInt64LE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(O<<24);return(BigInt(M)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),a.prototype.readBigInt64BE=lt(function(p){p=p>>>0,Fe(p,"offset");const h=this[p],O=this[p+7];(h===void 0||O===void 0)&&Pe(p,this.length-8);const M=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(M)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+O)}),a.prototype.readFloatLE=function(p,h){return p=p>>>0,h||le(p,4,this.length),r.read(this,p,!0,23,4)},a.prototype.readFloatBE=function(p,h){return p=p>>>0,h||le(p,4,this.length),r.read(this,p,!1,23,4)},a.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||le(p,8,this.length),r.read(this,p,!0,52,8)},a.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||le(p,8,this.length),r.read(this,p,!1,52,8)};function oe(_,p,h,O,M,G){if(!a.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>M||p<G)throw new RangeError('"value" argument is out of bounds');if(h+O>_.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(p,h,O,M){if(p=+p,h=h>>>0,O=O>>>0,!M){const $e=Math.pow(2,8*O)-1;oe(this,p,h,O,$e,0)}let G=1,re=0;for(this[h]=p&255;++re<O&&(G*=256);)this[h+re]=p/G&255;return h+O},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(p,h,O,M){if(p=+p,h=h>>>0,O=O>>>0,!M){const $e=Math.pow(2,8*O)-1;oe(this,p,h,O,$e,0)}let G=O-1,re=1;for(this[h+G]=p&255;--G>=0&&(re*=256);)this[h+G]=p/re&255;return h+O},a.prototype.writeUint8=a.prototype.writeUInt8=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,1,255,0),this[h]=p&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function Q(_,p,h,O,M){Be(p,O,M,_,h,7);let G=Number(p&BigInt(4294967295));_[h++]=G,G=G>>8,_[h++]=G,G=G>>8,_[h++]=G,G=G>>8,_[h++]=G;let re=Number(p>>BigInt(32)&BigInt(4294967295));return _[h++]=re,re=re>>8,_[h++]=re,re=re>>8,_[h++]=re,re=re>>8,_[h++]=re,h}function x(_,p,h,O,M){Be(p,O,M,_,h,7);let G=Number(p&BigInt(4294967295));_[h+7]=G,G=G>>8,_[h+6]=G,G=G>>8,_[h+5]=G,G=G>>8,_[h+4]=G;let re=Number(p>>BigInt(32)&BigInt(4294967295));return _[h+3]=re,re=re>>8,_[h+2]=re,re=re>>8,_[h+1]=re,re=re>>8,_[h]=re,h+8}a.prototype.writeBigUInt64LE=lt(function(p,h=0){return Q(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=lt(function(p,h=0){return x(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(p,h,O,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*O-1);oe(this,p,h,O,He-1,-He)}let G=0,re=1,$e=0;for(this[h]=p&255;++G<O&&(re*=256);)p<0&&$e===0&&this[h+G-1]!==0&&($e=1),this[h+G]=(p/re>>0)-$e&255;return h+O},a.prototype.writeIntBE=function(p,h,O,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*O-1);oe(this,p,h,O,He-1,-He)}let G=O-1,re=1,$e=0;for(this[h+G]=p&255;--G>=0&&(re*=256);)p<0&&$e===0&&this[h+G+1]!==0&&($e=1),this[h+G]=(p/re>>0)-$e&255;return h+O},a.prototype.writeInt8=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},a.prototype.writeInt16LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeInt16BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeInt32LE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},a.prototype.writeInt32BE=function(p,h,O){return p=+p,h=h>>>0,O||oe(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},a.prototype.writeBigInt64LE=lt(function(p,h=0){return Q(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=lt(function(p,h=0){return x(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function k(_,p,h,O,M,G){if(h+O>_.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function X(_,p,h,O,M){return p=+p,h=h>>>0,M||k(_,p,h,4),r.write(_,p,h,O,23,4),h+4}a.prototype.writeFloatLE=function(p,h,O){return X(this,p,h,!0,O)},a.prototype.writeFloatBE=function(p,h,O){return X(this,p,h,!1,O)};function W(_,p,h,O,M){return p=+p,h=h>>>0,M||k(_,p,h,8),r.write(_,p,h,O,52,8),h+8}a.prototype.writeDoubleLE=function(p,h,O){return W(this,p,h,!0,O)},a.prototype.writeDoubleBE=function(p,h,O){return W(this,p,h,!1,O)},a.prototype.copy=function(p,h,O,M){if(!a.isBuffer(p))throw new TypeError("argument should be a Buffer");if(O||(O=0),!M&&M!==0&&(M=this.length),h>=p.length&&(h=p.length),h||(h=0),M>0&&M<O&&(M=O),M===O||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),p.length-h<M-O&&(M=p.length-h+O);const G=M-O;return this===p&&typeof i.prototype.copyWithin=="function"?this.copyWithin(h,O,M):i.prototype.set.call(p,this.subarray(O,M),h),G},a.prototype.fill=function(p,h,O,M){if(typeof p=="string"){if(typeof h=="string"?(M=h,h=0,O=this.length):typeof O=="string"&&(M=O,O=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(p.length===1){const re=p.charCodeAt(0);(M==="utf8"&&re<128||M==="latin1")&&(p=re)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<O)throw new RangeError("Out of range index");if(O<=h)return this;h=h>>>0,O=O===void 0?this.length:O>>>0,p||(p=0);let G;if(typeof p=="number")for(G=h;G<O;++G)this[G]=p;else{const re=a.isBuffer(p)?p:a.from(p,M),$e=re.length;if($e===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(G=0;G<O-h;++G)this[G+h]=re[G%$e]}return this};const U={};function z(_,p,h){U[_]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${_}]`,this.stack,delete this.name}get code(){return _}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${_}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(_){return _?`${_} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(_,p){return`The "${_}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(_,p,h){let O=`The value of "${_}" is out of range.`,M=h;return Number.isInteger(h)&&Math.abs(h)>2**32?M=fe(String(h)):typeof h=="bigint"&&(M=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(M=fe(M)),M+="n"),O+=` It must be ${p}. Received ${M}`,O},RangeError);function fe(_){let p="",h=_.length;const O=_[0]==="-"?1:0;for(;h>=O+4;h-=3)p=`_${_.slice(h-3,h)}${p}`;return`${_.slice(0,h)}${p}`}function _e(_,p,h){Fe(p,"offset"),(_[p]===void 0||_[p+h]===void 0)&&Pe(p,_.length-(h+1))}function Be(_,p,h,O,M,G){if(_>h||_<p){const re=typeof p=="bigint"?"n":"";let $e;throw p===0||p===BigInt(0)?$e=`>= 0${re} and < 2${re} ** ${(G+1)*8}${re}`:$e=`>= -(2${re} ** ${(G+1)*8-1}${re}) and < 2 ** ${(G+1)*8-1}${re}`,new U.ERR_OUT_OF_RANGE("value",$e,_)}_e(O,M,G)}function Fe(_,p){if(typeof _!="number")throw new U.ERR_INVALID_ARG_TYPE(p,"number",_)}function Pe(_,p,h){throw Math.floor(_)!==_?(Fe(_,h),new U.ERR_OUT_OF_RANGE("offset","an integer",_)):p<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,_)}const je=/[^+/0-9A-Za-z-_]/g;function te(_){if(_=_.split("=")[0],_=_.trim().replace(je,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function Le(_,p){p=p||1/0;let h;const O=_.length;let M=null;const G=[];for(let re=0;re<O;++re){if(h=_.charCodeAt(re),h>55295&&h<57344){if(!M){if(h>56319){(p-=3)>-1&&G.push(239,191,189);continue}else if(re+1===O){(p-=3)>-1&&G.push(239,191,189);continue}M=h;continue}if(h<56320){(p-=3)>-1&&G.push(239,191,189),M=h;continue}h=(M-55296<<10|h-56320)+65536}else M&&(p-=3)>-1&&G.push(239,191,189);if(M=null,h<128){if((p-=1)<0)break;G.push(h)}else if(h<2048){if((p-=2)<0)break;G.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;G.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;G.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return G}function qe(_){const p=[];for(let h=0;h<_.length;++h)p.push(_.charCodeAt(h)&255);return p}function ze(_,p){let h,O,M;const G=[];for(let re=0;re<_.length&&!((p-=2)<0);++re)h=_.charCodeAt(re),O=h>>8,M=h%256,G.push(M),G.push(O);return G}function Ze(_){return t.toByteArray(te(_))}function vt(_,p,h,O){let M;for(M=0;M<O&&!(M+h>=p.length||M>=_.length);++M)p[M+h]=_[M];return M}function et(_,p){return _ instanceof p||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===p.name}function Ut(_){return _!==_}const nr=function(){const _="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const O=h*16;for(let M=0;M<16;++M)p[O+M]=_[h]+_[M]}return p}();function lt(_){return typeof BigInt>"u"?Ir:_}function Ir(){throw new Error("BigInt not supported")}})(Jh);const As=Jh.Buffer;var ec={},Rs={exports:{}},eg;function tc(){if(eg)return Rs.exports;eg=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(T,A,F){return Function.prototype.apply.call(T,A,F)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:r=function(T){return Object.getOwnPropertyNames(T)};function n(v){console&&console.warn&&console.warn(v)}var o=Number.isNaN||function(T){return T!==T};function i(){i.init.call(this)}Rs.exports=i,Rs.exports.once=S,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function l(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(v){if(typeof v!="number"||v<0||o(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");s=v}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(T){if(typeof T!="number"||T<0||o(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this};function c(v){return v._maxListeners===void 0?i.defaultMaxListeners:v._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(T){for(var A=[],F=1;F<arguments.length;F++)A.push(arguments[F]);var C=T==="error",I=this._events;if(I!==void 0)C=C&&I.error===void 0;else if(!C)return!1;if(C){var L;if(A.length>0&&(L=A[0]),L instanceof Error)throw L;var B=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw B.context=L,B}var $=I[T];if($===void 0)return!1;if(typeof $=="function")t($,this,A);else for(var D=$.length,H=E($,D),F=0;F<D;++F)t(H[F],this,A);return!0};function u(v,T,A,F){var C,I,L;if(l(A),I=v._events,I===void 0?(I=v._events=Object.create(null),v._eventsCount=0):(I.newListener!==void 0&&(v.emit("newListener",T,A.listener?A.listener:A),I=v._events),L=I[T]),L===void 0)L=I[T]=A,++v._eventsCount;else if(typeof L=="function"?L=I[T]=F?[A,L]:[L,A]:F?L.unshift(A):L.push(A),C=c(v),C>0&&L.length>C&&!L.warned){L.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=v,B.type=T,B.count=L.length,n(B)}return v}i.prototype.addListener=function(T,A){return u(this,T,A,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(T,A){return u(this,T,A,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(v,T,A){var F={fired:!1,wrapFn:void 0,target:v,type:T,listener:A},C=a.bind(F);return C.listener=A,F.wrapFn=C,C}i.prototype.once=function(T,A){return l(A),this.on(T,f(this,T,A)),this},i.prototype.prependOnceListener=function(T,A){return l(A),this.prependListener(T,f(this,T,A)),this},i.prototype.removeListener=function(T,A){var F,C,I,L,B;if(l(A),C=this._events,C===void 0)return this;if(F=C[T],F===void 0)return this;if(F===A||F.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete C[T],C.removeListener&&this.emit("removeListener",T,F.listener||A));else if(typeof F!="function"){for(I=-1,L=F.length-1;L>=0;L--)if(F[L]===A||F[L].listener===A){B=F[L].listener,I=L;break}if(I<0)return this;I===0?F.shift():w(F,I),F.length===1&&(C[T]=F[0]),C.removeListener!==void 0&&this.emit("removeListener",T,B||A)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(T){var A,F,C;if(F=this._events,F===void 0)return this;if(F.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):F[T]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete F[T]),this;if(arguments.length===0){var I=Object.keys(F),L;for(C=0;C<I.length;++C)L=I[C],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=F[T],typeof A=="function")this.removeListener(T,A);else if(A!==void 0)for(C=A.length-1;C>=0;C--)this.removeListener(T,A[C]);return this};function d(v,T,A){var F=v._events;if(F===void 0)return[];var C=F[T];return C===void 0?[]:typeof C=="function"?A?[C.listener||C]:[C]:A?R(C):E(C,C.length)}i.prototype.listeners=function(T){return d(this,T,!0)},i.prototype.rawListeners=function(T){return d(this,T,!1)},i.listenerCount=function(v,T){return typeof v.listenerCount=="function"?v.listenerCount(T):b.call(v,T)},i.prototype.listenerCount=b;function b(v){var T=this._events;if(T!==void 0){var A=T[v];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function E(v,T){for(var A=new Array(T),F=0;F<T;++F)A[F]=v[F];return A}function w(v,T){for(;T+1<v.length;T++)v[T]=v[T+1];v.pop()}function R(v){for(var T=new Array(v.length),A=0;A<T.length;++A)T[A]=v[A].listener||v[A];return T}function S(v,T){return new Promise(function(A,F){function C(L){v.removeListener(T,I),F(L)}function I(){typeof v.removeListener=="function"&&v.removeListener("error",C),A([].slice.call(arguments))}g(v,T,I,{once:!0}),T!=="error"&&m(v,C,{once:!0})})}function m(v,T,A){typeof v.on=="function"&&g(v,"error",T,A)}function g(v,T,A,F){if(typeof v.on=="function")F.once?v.once(T,A):v.on(T,A);else if(typeof v.addEventListener=="function")v.addEventListener(T,function C(I){F.once&&v.removeEventListener(T,C),A(I)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}return Rs.exports}var _s={exports:{}},tg;function Zn(){return tg||(tg=1,typeof Object.create=="function"?_s.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_s.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}),_s.exports}var rc,rg;function ng(){return rg||(rg=1,rc=tc().EventEmitter),rc}var nc={},ig;function Is(){return ig||(ig=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=a,r.toByteArray=d,r.fromByteArray=w;for(var n=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=s.length;l<c;++l)n[l]=s[l],o[s.charCodeAt(l)]=l;o[45]=62,o[95]=63;function u(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=m.indexOf("=");v===-1&&(v=g);var T=v===g?0:4-v%4;return[v,T]}function a(m){var g=u(m),v=g[0],T=g[1];return(v+T)*3/4-T}function f(m,g,v){return(g+v)*3/4-v}function d(m){var g,v=u(m),T=v[0],A=v[1],F=new i(f(m,T,A)),C=0,I=A>0?T-4:T,L;for(L=0;L<I;L+=4)g=o[m.charCodeAt(L)]<<18|o[m.charCodeAt(L+1)]<<12|o[m.charCodeAt(L+2)]<<6|o[m.charCodeAt(L+3)],F[C++]=g>>16&255,F[C++]=g>>8&255,F[C++]=g&255;return A===2&&(g=o[m.charCodeAt(L)]<<2|o[m.charCodeAt(L+1)]>>4,F[C++]=g&255),A===1&&(g=o[m.charCodeAt(L)]<<10|o[m.charCodeAt(L+1)]<<4|o[m.charCodeAt(L+2)]>>2,F[C++]=g>>8&255,F[C++]=g&255),F}function b(m){return n[m>>18&63]+n[m>>12&63]+n[m>>6&63]+n[m&63]}function E(m,g,v){for(var T,A=[],F=g;F<v;F+=3)T=(m[F]<<16&16711680)+(m[F+1]<<8&65280)+(m[F+2]&255),A.push(b(T));return A.join("")}function w(m){for(var g,v=m.length,T=v%3,A=[],F=16383,C=0,I=v-T;C<I;C+=F)A.push(E(m,C,C+F>I?I:C+F));return T===1?(g=m[v-1],A.push(n[g>>2]+n[g<<4&63]+"==")):T===2&&(g=(m[v-2]<<8)+m[v-1],A.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),A.join("")}var R={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */R.read=function(m,g,v,T,A){var F,C,I=A*8-T-1,L=(1<<I)-1,B=L>>1,$=-7,D=v?A-1:0,H=v?-1:1,ee=m[g+D];for(D+=H,F=ee&(1<<-$)-1,ee>>=-$,$+=I;$>0;F=F*256+m[g+D],D+=H,$-=8);for(C=F&(1<<-$)-1,F>>=-$,$+=T;$>0;C=C*256+m[g+D],D+=H,$-=8);if(F===0)F=1-B;else{if(F===L)return C?NaN:(ee?-1:1)*(1/0);C=C+Math.pow(2,T),F=F-B}return(ee?-1:1)*C*Math.pow(2,F-T)},R.write=function(m,g,v,T,A,F){var C,I,L,B=F*8-A-1,$=(1<<B)-1,D=$>>1,H=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=T?0:F-1,J=T?1:-1,ce=g<0||g===0&&1/g<0?1:0;for(g=Math.abs(g),isNaN(g)||g===1/0?(I=isNaN(g)?1:0,C=$):(C=Math.floor(Math.log(g)/Math.LN2),g*(L=Math.pow(2,-C))<1&&(C--,L*=2),C+D>=1?g+=H/L:g+=H*Math.pow(2,1-D),g*L>=2&&(C++,L/=2),C+D>=$?(I=0,C=$):C+D>=1?(I=(g*L-1)*Math.pow(2,A),C=C+D):(I=g*Math.pow(2,D-1)*Math.pow(2,A),C=0));A>=8;m[v+ee]=I&255,ee+=J,I/=256,A-=8);for(C=C<<A|I,B+=A;B>0;m[v+ee]=C&255,ee+=J,C/=256,B-=8);m[v+ee-J]|=ce*128};/*!
16
+ */(function(e){const t=Ts,r=ec,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:l}=globalThis;a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{const I=new i(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,i.prototype),Object.setPrototypeOf(I,p),I.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(I){if(I>o)throw new RangeError('The value "'+I+'" is invalid for option "size"');const p=new i(I);return Object.setPrototypeOf(p,a.prototype),p}function a(I,p,h){if(typeof I=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(I)}return f(I,p,h)}a.poolSize=8192;function f(I,p,h){if(typeof I=="string")return S(I,p);if(s.isView(I))return w(I);if(I==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(et(I,s)||I&&et(I.buffer,s)||typeof l<"u"&&(et(I,l)||I&&et(I.buffer,l)))return y(I,p,h);if(typeof I=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const k=I.valueOf&&I.valueOf();if(k!=null&&k!==I)return a.from(k,p,h);const M=g(I);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]=="function")return a.from(I[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}a.from=function(I,p,h){return f(I,p,h)},Object.setPrototypeOf(a.prototype,i.prototype),Object.setPrototypeOf(a,i);function d(I){if(typeof I!="number")throw new TypeError('"size" argument must be of type number');if(I<0)throw new RangeError('The value "'+I+'" is invalid for option "size"')}function b(I,p,h){return d(I),I<=0?u(I):p!==void 0?typeof h=="string"?u(I).fill(p,h):u(I).fill(p):u(I)}a.alloc=function(I,p,h){return b(I,p,h)};function E(I){return d(I),u(I<0?0:v(I)|0)}a.allocUnsafe=function(I){return E(I)},a.allocUnsafeSlow=function(I){return E(I)};function S(I,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=R(I,p)|0;let k=u(h);const M=k.write(I,p);return M!==h&&(k=k.slice(0,M)),k}function T(I){const p=I.length<0?0:v(I.length)|0,h=u(p);for(let k=0;k<p;k+=1)h[k]=I[k]&255;return h}function w(I){if(et(I,i)){const p=new i(I);return y(p.buffer,p.byteOffset,p.byteLength)}return T(I)}function y(I,p,h){if(p<0||I.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(I.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let k;return p===void 0&&h===void 0?k=new i(I):h===void 0?k=new i(I,p):k=new i(I,p,h),Object.setPrototypeOf(k,a.prototype),k}function g(I){if(a.isBuffer(I)){const p=v(I.length)|0,h=u(p);return h.length===0||I.copy(h,0,0,p),h}if(I.length!==void 0)return typeof I.length!="number"||jt(I.length)?u(0):T(I);if(I.type==="Buffer"&&Array.isArray(I.data))return T(I.data)}function v(I){if(I>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return I|0}function A(I){return+I!=I&&(I=0),a.alloc(+I)}a.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==a.prototype},a.compare=function(p,h){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),et(h,i)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(p)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let k=p.length,M=h.length;for(let G=0,ne=Math.min(k,M);G<ne;++G)if(p[G]!==h[G]){k=p[G],M=h[G];break}return k<M?-1:M<k?1:0},a.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}},a.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return a.alloc(0);let k;if(h===void 0)for(h=0,k=0;k<p.length;++k)h+=p[k].length;const M=a.allocUnsafe(h);let G=0;for(k=0;k<p.length;++k){let ne=p[k];if(et(ne,i))G+ne.length>M.length?(a.isBuffer(ne)||(ne=a.from(ne)),ne.copy(M,G)):i.prototype.set.call(M,ne,G);else if(a.isBuffer(ne))ne.copy(M,G);else throw new TypeError('"list" argument must be an Array of Buffers');G+=ne.length}return M};function R(I,p){if(a.isBuffer(I))return I.length;if(s.isView(I)||et(I,s))return I.byteLength;if(typeof I!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);const h=I.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&h===0)return 0;let M=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Pe(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Ze(I).length;default:if(M)return k?-1:Pe(I).length;p=(""+p).toLowerCase(),M=!0}}a.byteLength=R;function C(I,p,h){let k=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(I||(I="utf8");;)switch(I){case"hex":return re(this,p,h);case"utf8":case"utf-8":return le(this,p,h);case"ascii":return we(this,p,h);case"latin1":case"binary":return Se(this,p,h);case"base64":return J(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,p,h);default:if(k)throw new TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),k=!0}}a.prototype._isBuffer=!0;function P(I,p,h){const k=I[p];I[p]=I[h],I[h]=k}a.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 h=0;h<p;h+=2)P(this,h,h+1);return this},a.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 h=0;h<p;h+=4)P(this,h,h+3),P(this,h+1,h+2);return this},a.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 h=0;h<p;h+=8)P(this,h,h+7),P(this,h+1,h+6),P(this,h+2,h+5),P(this,h+3,h+4);return this},a.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?le(this,0,p):C.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(p){if(!a.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:a.compare(this,p)===0},a.prototype.inspect=function(){let p="";const h=e.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(p,h,k,M,G){if(et(p,i)&&(p=a.from(p,p.offset,p.byteLength)),!a.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),k===void 0&&(k=p?p.length:0),M===void 0&&(M=0),G===void 0&&(G=this.length),h<0||k>p.length||M<0||G>this.length)throw new RangeError("out of range index");if(M>=G&&h>=k)return 0;if(M>=G)return-1;if(h>=k)return 1;if(h>>>=0,k>>>=0,M>>>=0,G>>>=0,this===p)return 0;let ne=G-M,De=k-h;const He=Math.min(ne,De),Re=this.slice(M,G),Oe=p.slice(h,k);for(let Le=0;Le<He;++Le)if(Re[Le]!==Oe[Le]){ne=Re[Le],De=Oe[Le];break}return ne<De?-1:De<ne?1:0};function _(I,p,h,k,M){if(I.length===0)return-1;if(typeof h=="string"?(k=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,jt(h)&&(h=M?0:I.length-1),h<0&&(h=I.length+h),h>=I.length){if(M)return-1;h=I.length-1}else if(h<0)if(M)h=0;else return-1;if(typeof p=="string"&&(p=a.from(p,k)),a.isBuffer(p))return p.length===0?-1:L(I,p,h,k,M);if(typeof p=="number")return p=p&255,typeof i.prototype.indexOf=="function"?M?i.prototype.indexOf.call(I,p,h):i.prototype.lastIndexOf.call(I,p,h):L(I,[p],h,k,M);throw new TypeError("val must be string, number or Buffer")}function L(I,p,h,k,M){let G=1,ne=I.length,De=p.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(I.length<2||p.length<2)return-1;G=2,ne/=2,De/=2,h/=2}function He(Oe,Le){return G===1?Oe[Le]:Oe.readUInt16BE(Le*G)}let Re;if(M){let Oe=-1;for(Re=h;Re<ne;Re++)if(He(I,Re)===He(p,Oe===-1?0:Re-Oe)){if(Oe===-1&&(Oe=Re),Re-Oe+1===De)return Oe*G}else Oe!==-1&&(Re-=Re-Oe),Oe=-1}else for(h+De>ne&&(h=ne-De),Re=h;Re>=0;Re--){let Oe=!0;for(let Le=0;Le<De;Le++)if(He(I,Re+Le)!==He(p,Le)){Oe=!1;break}if(Oe)return Re}return-1}a.prototype.includes=function(p,h,k){return this.indexOf(p,h,k)!==-1},a.prototype.indexOf=function(p,h,k){return _(this,p,h,k,!0)},a.prototype.lastIndexOf=function(p,h,k){return _(this,p,h,k,!1)};function B(I,p,h,k){h=Number(h)||0;const M=I.length-h;k?(k=Number(k),k>M&&(k=M)):k=M;const G=p.length;k>G/2&&(k=G/2);let ne;for(ne=0;ne<k;++ne){const De=parseInt(p.substr(ne*2,2),16);if(jt(De))return ne;I[h+ne]=De}return ne}function $(I,p,h,k){return vt(Pe(p,I.length-h),I,h,k)}function D(I,p,h,k){return vt(Ue(p),I,h,k)}function H(I,p,h,k){return vt(Ze(p),I,h,k)}function X(I,p,h,k){return vt(ze(p,I.length-h),I,h,k)}a.prototype.write=function(p,h,k,M){if(h===void 0)M="utf8",k=this.length,h=0;else if(k===void 0&&typeof h=="string")M=h,k=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(k)?(k=k>>>0,M===void 0&&(M="utf8")):(M=k,k=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const G=this.length-h;if((k===void 0||k>G)&&(k=G),p.length>0&&(k<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let ne=!1;for(;;)switch(M){case"hex":return B(this,p,h,k);case"utf8":case"utf-8":return $(this,p,h,k);case"ascii":case"latin1":case"binary":return D(this,p,h,k);case"base64":return H(this,p,h,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,p,h,k);default:if(ne)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),ne=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(I,p,h){return p===0&&h===I.length?t.fromByteArray(I):t.fromByteArray(I.slice(p,h))}function le(I,p,h){h=Math.min(I.length,h);const k=[];let M=p;for(;M<h;){const G=I[M];let ne=null,De=G>239?4:G>223?3:G>191?2:1;if(M+De<=h){let He,Re,Oe,Le;switch(De){case 1:G<128&&(ne=G);break;case 2:He=I[M+1],(He&192)===128&&(Le=(G&31)<<6|He&63,Le>127&&(ne=Le));break;case 3:He=I[M+1],Re=I[M+2],(He&192)===128&&(Re&192)===128&&(Le=(G&15)<<12|(He&63)<<6|Re&63,Le>2047&&(Le<55296||Le>57343)&&(ne=Le));break;case 4:He=I[M+1],Re=I[M+2],Oe=I[M+3],(He&192)===128&&(Re&192)===128&&(Oe&192)===128&&(Le=(G&15)<<18|(He&63)<<12|(Re&63)<<6|Oe&63,Le>65535&&Le<1114112&&(ne=Le))}}ne===null?(ne=65533,De=1):ne>65535&&(ne-=65536,k.push(ne>>>10&1023|55296),ne=56320|ne&1023),k.push(ne),M+=De}return fe(k)}const me=4096;function fe(I){const p=I.length;if(p<=me)return String.fromCharCode.apply(String,I);let h="",k=0;for(;k<p;)h+=String.fromCharCode.apply(String,I.slice(k,k+=me));return h}function we(I,p,h){let k="";h=Math.min(I.length,h);for(let M=p;M<h;++M)k+=String.fromCharCode(I[M]&127);return k}function Se(I,p,h){let k="";h=Math.min(I.length,h);for(let M=p;M<h;++M)k+=String.fromCharCode(I[M]);return k}function re(I,p,h){const k=I.length;(!p||p<0)&&(p=0),(!h||h<0||h>k)&&(h=k);let M="";for(let G=p;G<h;++G)M+=nr[I[G]];return M}function oe(I,p,h){const k=I.slice(p,h);let M="";for(let G=0;G<k.length-1;G+=2)M+=String.fromCharCode(k[G]+k[G+1]*256);return M}a.prototype.slice=function(p,h){const k=this.length;p=~~p,h=h===void 0?k:~~h,p<0?(p+=k,p<0&&(p=0)):p>k&&(p=k),h<0?(h+=k,h<0&&(h=0)):h>k&&(h=k),h<p&&(h=p);const M=this.subarray(p,h);return Object.setPrototypeOf(M,a.prototype),M};function ae(I,p,h){if(I%1!==0||I<0)throw new RangeError("offset is not uint");if(I+p>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=this[p],G=1,ne=0;for(;++ne<h&&(G*=256);)M+=this[p+ne]*G;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=this[p+--h],G=1;for(;h>0&&(G*=256);)M+=this[p+--h]*G;return M},a.prototype.readUint8=a.prototype.readUInt8=function(p,h){return p=p>>>0,h||ae(p,1,this.length),this[p]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||ae(p,2,this.length),this[p]|this[p+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||ae(p,2,this.length),this[p]<<8|this[p+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},a.prototype.readBigUInt64LE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,G=this[++p]+this[++p]*2**8+this[++p]*2**16+k*2**24;return BigInt(M)+(BigInt(G)<<BigInt(32))}),a.prototype.readBigUInt64BE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],G=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k;return(BigInt(M)<<BigInt(32))+BigInt(G)}),a.prototype.readIntLE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=this[p],G=1,ne=0;for(;++ne<h&&(G*=256);)M+=this[p+ne]*G;return G*=128,M>=G&&(M-=Math.pow(2,8*h)),M},a.prototype.readIntBE=function(p,h,k){p=p>>>0,h=h>>>0,k||ae(p,h,this.length);let M=h,G=1,ne=this[p+--M];for(;M>0&&(G*=256);)ne+=this[p+--M]*G;return G*=128,ne>=G&&(ne-=Math.pow(2,8*h)),ne},a.prototype.readInt8=function(p,h){return p=p>>>0,h||ae(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},a.prototype.readInt16LE=function(p,h){p=p>>>0,h||ae(p,2,this.length);const k=this[p]|this[p+1]<<8;return k&32768?k|4294901760:k},a.prototype.readInt16BE=function(p,h){p=p>>>0,h||ae(p,2,this.length);const k=this[p+1]|this[p]<<8;return k&32768?k|4294901760:k},a.prototype.readInt32LE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},a.prototype.readInt32BE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},a.prototype.readBigInt64LE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(k<<24);return(BigInt(M)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),a.prototype.readBigInt64BE=ct(function(p){p=p>>>0,xe(p,"offset");const h=this[p],k=this[p+7];(h===void 0||k===void 0)&&Fe(p,this.length-8);const M=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(M)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+k)}),a.prototype.readFloatLE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),r.read(this,p,!0,23,4)},a.prototype.readFloatBE=function(p,h){return p=p>>>0,h||ae(p,4,this.length),r.read(this,p,!1,23,4)},a.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||ae(p,8,this.length),r.read(this,p,!0,52,8)},a.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||ae(p,8,this.length),r.read(this,p,!1,52,8)};function Ae(I,p,h,k,M,G){if(!a.isBuffer(I))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>M||p<G)throw new RangeError('"value" argument is out of bounds');if(h+k>I.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(p,h,k,M){if(p=+p,h=h>>>0,k=k>>>0,!M){const De=Math.pow(2,8*k)-1;Ae(this,p,h,k,De,0)}let G=1,ne=0;for(this[h]=p&255;++ne<k&&(G*=256);)this[h+ne]=p/G&255;return h+k},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(p,h,k,M){if(p=+p,h=h>>>0,k=k>>>0,!M){const De=Math.pow(2,8*k)-1;Ae(this,p,h,k,De,0)}let G=k-1,ne=1;for(this[h+G]=p&255;--G>=0&&(ne*=256);)this[h+G]=p/ne&255;return h+k},a.prototype.writeUint8=a.prototype.writeUInt8=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,1,255,0),this[h]=p&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function Z(I,p,h,k,M){Be(p,k,M,I,h,7);let G=Number(p&BigInt(4294967295));I[h++]=G,G=G>>8,I[h++]=G,G=G>>8,I[h++]=G,G=G>>8,I[h++]=G;let ne=Number(p>>BigInt(32)&BigInt(4294967295));return I[h++]=ne,ne=ne>>8,I[h++]=ne,ne=ne>>8,I[h++]=ne,ne=ne>>8,I[h++]=ne,h}function F(I,p,h,k,M){Be(p,k,M,I,h,7);let G=Number(p&BigInt(4294967295));I[h+7]=G,G=G>>8,I[h+6]=G,G=G>>8,I[h+5]=G,G=G>>8,I[h+4]=G;let ne=Number(p>>BigInt(32)&BigInt(4294967295));return I[h+3]=ne,ne=ne>>8,I[h+2]=ne,ne=ne>>8,I[h+1]=ne,ne=ne>>8,I[h]=ne,h+8}a.prototype.writeBigUInt64LE=ct(function(p,h=0){return Z(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ct(function(p,h=0){return F(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(p,h,k,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*k-1);Ae(this,p,h,k,He-1,-He)}let G=0,ne=1,De=0;for(this[h]=p&255;++G<k&&(ne*=256);)p<0&&De===0&&this[h+G-1]!==0&&(De=1),this[h+G]=(p/ne>>0)-De&255;return h+k},a.prototype.writeIntBE=function(p,h,k,M){if(p=+p,h=h>>>0,!M){const He=Math.pow(2,8*k-1);Ae(this,p,h,k,He-1,-He)}let G=k-1,ne=1,De=0;for(this[h+G]=p&255;--G>=0&&(ne*=256);)p<0&&De===0&&this[h+G+1]!==0&&(De=1),this[h+G]=(p/ne>>0)-De&255;return h+k},a.prototype.writeInt8=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},a.prototype.writeInt16LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},a.prototype.writeInt16BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},a.prototype.writeInt32LE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},a.prototype.writeInt32BE=function(p,h,k){return p=+p,h=h>>>0,k||Ae(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},a.prototype.writeBigInt64LE=ct(function(p,h=0){return Z(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ct(function(p,h=0){return F(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function O(I,p,h,k,M,G){if(h+k>I.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function Q(I,p,h,k,M){return p=+p,h=h>>>0,M||O(I,p,h,4),r.write(I,p,h,k,23,4),h+4}a.prototype.writeFloatLE=function(p,h,k){return Q(this,p,h,!0,k)},a.prototype.writeFloatBE=function(p,h,k){return Q(this,p,h,!1,k)};function W(I,p,h,k,M){return p=+p,h=h>>>0,M||O(I,p,h,8),r.write(I,p,h,k,52,8),h+8}a.prototype.writeDoubleLE=function(p,h,k){return W(this,p,h,!0,k)},a.prototype.writeDoubleBE=function(p,h,k){return W(this,p,h,!1,k)},a.prototype.copy=function(p,h,k,M){if(!a.isBuffer(p))throw new TypeError("argument should be a Buffer");if(k||(k=0),!M&&M!==0&&(M=this.length),h>=p.length&&(h=p.length),h||(h=0),M>0&&M<k&&(M=k),M===k||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),p.length-h<M-k&&(M=p.length-h+k);const G=M-k;return this===p&&typeof i.prototype.copyWithin=="function"?this.copyWithin(h,k,M):i.prototype.set.call(p,this.subarray(k,M),h),G},a.prototype.fill=function(p,h,k,M){if(typeof p=="string"){if(typeof h=="string"?(M=h,h=0,k=this.length):typeof k=="string"&&(M=k,k=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(p.length===1){const ne=p.charCodeAt(0);(M==="utf8"&&ne<128||M==="latin1")&&(p=ne)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<k)throw new RangeError("Out of range index");if(k<=h)return this;h=h>>>0,k=k===void 0?this.length:k>>>0,p||(p=0);let G;if(typeof p=="number")for(G=h;G<k;++G)this[G]=p;else{const ne=a.isBuffer(p)?p:a.from(p,M),De=ne.length;if(De===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(G=0;G<k-h;++G)this[G+h]=ne[G%De]}return this};const U={};function z(I,p,h){U[I]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(I){return I?`${I} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(I,p){return`The "${I}" argument must be of type number. Received type ${typeof p}`},TypeError),z("ERR_OUT_OF_RANGE",function(I,p,h){let k=`The value of "${I}" is out of range.`,M=h;return Number.isInteger(h)&&Math.abs(h)>2**32?M=ue(String(h)):typeof h=="bigint"&&(M=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(M=ue(M)),M+="n"),k+=` It must be ${p}. Received ${M}`,k},RangeError);function ue(I){let p="",h=I.length;const k=I[0]==="-"?1:0;for(;h>=k+4;h-=3)p=`_${I.slice(h-3,h)}${p}`;return`${I.slice(0,h)}${p}`}function _e(I,p,h){xe(p,"offset"),(I[p]===void 0||I[p+h]===void 0)&&Fe(p,I.length-(h+1))}function Be(I,p,h,k,M,G){if(I>h||I<p){const ne=typeof p=="bigint"?"n":"";let De;throw p===0||p===BigInt(0)?De=`>= 0${ne} and < 2${ne} ** ${(G+1)*8}${ne}`:De=`>= -(2${ne} ** ${(G+1)*8-1}${ne}) and < 2 ** ${(G+1)*8-1}${ne}`,new U.ERR_OUT_OF_RANGE("value",De,I)}_e(k,M,G)}function xe(I,p){if(typeof I!="number")throw new U.ERR_INVALID_ARG_TYPE(p,"number",I)}function Fe(I,p,h){throw Math.floor(I)!==I?(xe(I,h),new U.ERR_OUT_OF_RANGE("offset","an integer",I)):p<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,I)}const Me=/[^+/0-9A-Za-z-_]/g;function ee(I){if(I=I.split("=")[0],I=I.trim().replace(Me,""),I.length<2)return"";for(;I.length%4!==0;)I=I+"=";return I}function Pe(I,p){p=p||1/0;let h;const k=I.length;let M=null;const G=[];for(let ne=0;ne<k;++ne){if(h=I.charCodeAt(ne),h>55295&&h<57344){if(!M){if(h>56319){(p-=3)>-1&&G.push(239,191,189);continue}else if(ne+1===k){(p-=3)>-1&&G.push(239,191,189);continue}M=h;continue}if(h<56320){(p-=3)>-1&&G.push(239,191,189),M=h;continue}h=(M-55296<<10|h-56320)+65536}else M&&(p-=3)>-1&&G.push(239,191,189);if(M=null,h<128){if((p-=1)<0)break;G.push(h)}else if(h<2048){if((p-=2)<0)break;G.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;G.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;G.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return G}function Ue(I){const p=[];for(let h=0;h<I.length;++h)p.push(I.charCodeAt(h)&255);return p}function ze(I,p){let h,k,M;const G=[];for(let ne=0;ne<I.length&&!((p-=2)<0);++ne)h=I.charCodeAt(ne),k=h>>8,M=h%256,G.push(M),G.push(k);return G}function Ze(I){return t.toByteArray(ee(I))}function vt(I,p,h,k){let M;for(M=0;M<k&&!(M+h>=p.length||M>=I.length);++M)p[M+h]=I[M];return M}function et(I,p){return I instanceof p||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===p.name}function jt(I){return I!==I}const nr=function(){const I="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const k=h*16;for(let M=0;M<16;++M)p[k+M]=I[h]+I[M]}return p}();function ct(I){return typeof BigInt>"u"?Ir:I}function Ir(){throw new Error("BigInt not supported")}})(Jh);const As=Jh.Buffer;var tc={},Rs={exports:{}},eg;function rc(){if(eg)return Rs.exports;eg=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(A,R,C){return Function.prototype.apply.call(A,R,C)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:r=function(A){return Object.getOwnPropertyNames(A)};function n(v){console&&console.warn&&console.warn(v)}var o=Number.isNaN||function(A){return A!==A};function i(){i.init.call(this)}Rs.exports=i,Rs.exports.once=w,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function l(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(v){if(typeof v!="number"||v<0||o(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");s=v}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(A){if(typeof A!="number"||A<0||o(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function c(v){return v._maxListeners===void 0?i.defaultMaxListeners:v._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(A){for(var R=[],C=1;C<arguments.length;C++)R.push(arguments[C]);var P=A==="error",_=this._events;if(_!==void 0)P=P&&_.error===void 0;else if(!P)return!1;if(P){var L;if(R.length>0&&(L=R[0]),L instanceof Error)throw L;var B=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw B.context=L,B}var $=_[A];if($===void 0)return!1;if(typeof $=="function")t($,this,R);else for(var D=$.length,H=E($,D),C=0;C<D;++C)t(H[C],this,R);return!0};function u(v,A,R,C){var P,_,L;if(l(R),_=v._events,_===void 0?(_=v._events=Object.create(null),v._eventsCount=0):(_.newListener!==void 0&&(v.emit("newListener",A,R.listener?R.listener:R),_=v._events),L=_[A]),L===void 0)L=_[A]=R,++v._eventsCount;else if(typeof L=="function"?L=_[A]=C?[R,L]:[L,R]:C?L.unshift(R):L.push(R),P=c(v),P>0&&L.length>P&&!L.warned){L.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=v,B.type=A,B.count=L.length,n(B)}return v}i.prototype.addListener=function(A,R){return u(this,A,R,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(A,R){return u(this,A,R,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(v,A,R){var C={fired:!1,wrapFn:void 0,target:v,type:A,listener:R},P=a.bind(C);return P.listener=R,C.wrapFn=P,P}i.prototype.once=function(A,R){return l(R),this.on(A,f(this,A,R)),this},i.prototype.prependOnceListener=function(A,R){return l(R),this.prependListener(A,f(this,A,R)),this},i.prototype.removeListener=function(A,R){var C,P,_,L,B;if(l(R),P=this._events,P===void 0)return this;if(C=P[A],C===void 0)return this;if(C===R||C.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete P[A],P.removeListener&&this.emit("removeListener",A,C.listener||R));else if(typeof C!="function"){for(_=-1,L=C.length-1;L>=0;L--)if(C[L]===R||C[L].listener===R){B=C[L].listener,_=L;break}if(_<0)return this;_===0?C.shift():S(C,_),C.length===1&&(P[A]=C[0]),P.removeListener!==void 0&&this.emit("removeListener",A,B||R)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(A){var R,C,P;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[A]),this;if(arguments.length===0){var _=Object.keys(C),L;for(P=0;P<_.length;++P)L=_[P],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(R=C[A],typeof R=="function")this.removeListener(A,R);else if(R!==void 0)for(P=R.length-1;P>=0;P--)this.removeListener(A,R[P]);return this};function d(v,A,R){var C=v._events;if(C===void 0)return[];var P=C[A];return P===void 0?[]:typeof P=="function"?R?[P.listener||P]:[P]:R?T(P):E(P,P.length)}i.prototype.listeners=function(A){return d(this,A,!0)},i.prototype.rawListeners=function(A){return d(this,A,!1)},i.listenerCount=function(v,A){return typeof v.listenerCount=="function"?v.listenerCount(A):b.call(v,A)},i.prototype.listenerCount=b;function b(v){var A=this._events;if(A!==void 0){var R=A[v];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function E(v,A){for(var R=new Array(A),C=0;C<A;++C)R[C]=v[C];return R}function S(v,A){for(;A+1<v.length;A++)v[A]=v[A+1];v.pop()}function T(v){for(var A=new Array(v.length),R=0;R<A.length;++R)A[R]=v[R].listener||v[R];return A}function w(v,A){return new Promise(function(R,C){function P(L){v.removeListener(A,_),C(L)}function _(){typeof v.removeListener=="function"&&v.removeListener("error",P),R([].slice.call(arguments))}g(v,A,_,{once:!0}),A!=="error"&&y(v,P,{once:!0})})}function y(v,A,R){typeof v.on=="function"&&g(v,"error",A,R)}function g(v,A,R,C){if(typeof v.on=="function")C.once?v.once(A,R):v.on(A,R);else if(typeof v.addEventListener=="function")v.addEventListener(A,function P(_){C.once&&v.removeEventListener(A,P),R(_)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}return Rs.exports}var _s={exports:{}},tg;function Zn(){return tg||(tg=1,typeof Object.create=="function"?_s.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_s.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}),_s.exports}var nc,rg;function ng(){return rg||(rg=1,nc=rc().EventEmitter),nc}var ic={},ig;function Is(){return ig||(ig=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=a,r.toByteArray=d,r.fromByteArray=S;for(var n=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=s.length;l<c;++l)n[l]=s[l],o[s.charCodeAt(l)]=l;o[45]=62,o[95]=63;function u(y){var g=y.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=y.indexOf("=");v===-1&&(v=g);var A=v===g?0:4-v%4;return[v,A]}function a(y){var g=u(y),v=g[0],A=g[1];return(v+A)*3/4-A}function f(y,g,v){return(g+v)*3/4-v}function d(y){var g,v=u(y),A=v[0],R=v[1],C=new i(f(y,A,R)),P=0,_=R>0?A-4:A,L;for(L=0;L<_;L+=4)g=o[y.charCodeAt(L)]<<18|o[y.charCodeAt(L+1)]<<12|o[y.charCodeAt(L+2)]<<6|o[y.charCodeAt(L+3)],C[P++]=g>>16&255,C[P++]=g>>8&255,C[P++]=g&255;return R===2&&(g=o[y.charCodeAt(L)]<<2|o[y.charCodeAt(L+1)]>>4,C[P++]=g&255),R===1&&(g=o[y.charCodeAt(L)]<<10|o[y.charCodeAt(L+1)]<<4|o[y.charCodeAt(L+2)]>>2,C[P++]=g>>8&255,C[P++]=g&255),C}function b(y){return n[y>>18&63]+n[y>>12&63]+n[y>>6&63]+n[y&63]}function E(y,g,v){for(var A,R=[],C=g;C<v;C+=3)A=(y[C]<<16&16711680)+(y[C+1]<<8&65280)+(y[C+2]&255),R.push(b(A));return R.join("")}function S(y){for(var g,v=y.length,A=v%3,R=[],C=16383,P=0,_=v-A;P<_;P+=C)R.push(E(y,P,P+C>_?_:P+C));return A===1?(g=y[v-1],R.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(y[v-2]<<8)+y[v-1],R.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),R.join("")}var T={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */T.read=function(y,g,v,A,R){var C,P,_=R*8-A-1,L=(1<<_)-1,B=L>>1,$=-7,D=v?R-1:0,H=v?-1:1,X=y[g+D];for(D+=H,C=X&(1<<-$)-1,X>>=-$,$+=_;$>0;C=C*256+y[g+D],D+=H,$-=8);for(P=C&(1<<-$)-1,C>>=-$,$+=A;$>0;P=P*256+y[g+D],D+=H,$-=8);if(C===0)C=1-B;else{if(C===L)return P?NaN:(X?-1:1)*(1/0);P=P+Math.pow(2,A),C=C-B}return(X?-1:1)*P*Math.pow(2,C-A)},T.write=function(y,g,v,A,R,C){var P,_,L,B=C*8-R-1,$=(1<<B)-1,D=$>>1,H=R===23?Math.pow(2,-24)-Math.pow(2,-77):0,X=A?0:C-1,J=A?1:-1,le=g<0||g===0&&1/g<0?1:0;for(g=Math.abs(g),isNaN(g)||g===1/0?(_=isNaN(g)?1:0,P=$):(P=Math.floor(Math.log(g)/Math.LN2),g*(L=Math.pow(2,-P))<1&&(P--,L*=2),P+D>=1?g+=H/L:g+=H*Math.pow(2,1-D),g*L>=2&&(P++,L/=2),P+D>=$?(_=0,P=$):P+D>=1?(_=(g*L-1)*Math.pow(2,R),P=P+D):(_=g*Math.pow(2,D-1)*Math.pow(2,R),P=0));R>=8;y[v+X]=_&255,X+=J,_/=256,R-=8);for(P=P<<R|_,B+=R;B>0;y[v+X]=P&255,X+=J,P/=256,B-=8);y[v+X-J]|=le*128};/*!
17
17
  * The buffer module from node.js, for the browser.
18
18
  *
19
19
  * @author Feross Aboukhadijeh <https://feross.org>
20
20
  * @license MIT
21
- */(function(m){const g=r,v=R,T=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;m.Buffer=$,m.SlowBuffer=ae,m.INSPECT_MAX_BYTES=50;const A=2147483647;m.kMaxLength=A;const{Uint8Array:F,ArrayBuffer:C,SharedArrayBuffer:I}=globalThis;$.TYPED_ARRAY_SUPPORT=L(),!$.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 q=new F(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,F.prototype),Object.setPrototypeOf(q,P),q.foo()===42}catch{return!1}}Object.defineProperty($.prototype,"parent",{enumerable:!0,get:function(){if($.isBuffer(this))return this.buffer}}),Object.defineProperty($.prototype,"offset",{enumerable:!0,get:function(){if($.isBuffer(this))return this.byteOffset}});function B(q){if(q>A)throw new RangeError('The value "'+q+'" is invalid for option "size"');const P=new F(q);return Object.setPrototypeOf(P,$.prototype),P}function $(q,P,N){if(typeof q=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return J(q)}return D(q,P,N)}$.poolSize=8192;function D(q,P,N){if(typeof q=="string")return ce(q,P);if(C.isView(q))return de(q);if(q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q);if(on(q,C)||q&&on(q.buffer,C)||typeof I<"u"&&(on(q,I)||q&&on(q.buffer,I)))return Se(q,P,N);if(typeof q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=q.valueOf&&q.valueOf();if(Y!=null&&Y!==q)return $.from(Y,P,N);const se=Ae(q);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof q[Symbol.toPrimitive]=="function")return $.from(q[Symbol.toPrimitive]("string"),P,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q)}$.from=function(q,P,N){return D(q,P,N)},Object.setPrototypeOf($.prototype,F.prototype),Object.setPrototypeOf($,F);function H(q){if(typeof q!="number")throw new TypeError('"size" argument must be of type number');if(q<0)throw new RangeError('The value "'+q+'" is invalid for option "size"')}function ee(q,P,N){return H(q),q<=0?B(q):P!==void 0?typeof N=="string"?B(q).fill(P,N):B(q).fill(P):B(q)}$.alloc=function(q,P,N){return ee(q,P,N)};function J(q){return H(q),B(q<0?0:ne(q)|0)}$.allocUnsafe=function(q){return J(q)},$.allocUnsafeSlow=function(q){return J(q)};function ce(q,P){if((typeof P!="string"||P==="")&&(P="utf8"),!$.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const N=le(q,P)|0;let Y=B(N);const se=Y.write(q,P);return se!==N&&(Y=Y.slice(0,se)),Y}function be(q){const P=q.length<0?0:ne(q.length)|0,N=B(P);for(let Y=0;Y<P;Y+=1)N[Y]=q[Y]&255;return N}function de(q){if(on(q,F)){const P=new F(q);return Se(P.buffer,P.byteOffset,P.byteLength)}return be(q)}function Se(q,P,N){if(P<0||q.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(q.byteLength<P+(N||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return P===void 0&&N===void 0?Y=new F(q):N===void 0?Y=new F(q,P):Y=new F(q,P,N),Object.setPrototypeOf(Y,$.prototype),Y}function Ae(q){if($.isBuffer(q)){const P=ne(q.length)|0,N=B(P);return N.length===0||q.copy(N,0,0,P),N}if(q.length!==void 0)return typeof q.length!="number"||td(q.length)?B(0):be(q);if(q.type==="Buffer"&&Array.isArray(q.data))return be(q.data)}function ne(q){if(q>=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return q|0}function ae(q){return+q!=q&&(q=0),$.alloc(+q)}$.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==$.prototype},$.compare=function(P,N){if(on(P,F)&&(P=$.from(P,P.offset,P.byteLength)),on(N,F)&&(N=$.from(N,N.offset,N.byteLength)),!$.isBuffer(P)||!$.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===N)return 0;let Y=P.length,se=N.length;for(let ge=0,Ie=Math.min(Y,se);ge<Ie;++ge)if(P[ge]!==N[ge]){Y=P[ge],se=N[ge];break}return Y<se?-1:se<Y?1:0},$.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}},$.concat=function(P,N){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return $.alloc(0);let Y;if(N===void 0)for(N=0,Y=0;Y<P.length;++Y)N+=P[Y].length;const se=$.allocUnsafe(N);let ge=0;for(Y=0;Y<P.length;++Y){let Ie=P[Y];if(on(Ie,F))ge+Ie.length>se.length?($.isBuffer(Ie)||(Ie=$.from(Ie)),Ie.copy(se,ge)):F.prototype.set.call(se,Ie,ge);else if($.isBuffer(Ie))Ie.copy(se,ge);else throw new TypeError('"list" argument must be an Array of Buffers');ge+=Ie.length}return se};function le(q,P){if($.isBuffer(q))return q.length;if(C.isView(q)||on(q,C))return q.byteLength;if(typeof q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof q);const N=q.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&N===0)return 0;let se=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return He(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return De(q).length;default:if(se)return Y?-1:He(q).length;P=(""+P).toLowerCase(),se=!0}}$.byteLength=le;function oe(q,P,N){let Y=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,P>>>=0,N<=P))return"";for(q||(q="utf8");;)switch(q){case"hex":return Le(this,P,N);case"utf8":case"utf-8":return Be(this,P,N);case"ascii":return je(this,P,N);case"latin1":case"binary":return te(this,P,N);case"base64":return _e(this,P,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,P,N);default:if(Y)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),Y=!0}}$.prototype._isBuffer=!0;function Q(q,P,N){const Y=q[P];q[P]=q[N],q[N]=Y}$.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 N=0;N<P;N+=2)Q(this,N,N+1);return this},$.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 N=0;N<P;N+=4)Q(this,N,N+3),Q(this,N+1,N+2);return this},$.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 N=0;N<P;N+=8)Q(this,N,N+7),Q(this,N+1,N+6),Q(this,N+2,N+5),Q(this,N+3,N+4);return this},$.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?Be(this,0,P):oe.apply(this,arguments)},$.prototype.toLocaleString=$.prototype.toString,$.prototype.equals=function(P){if(!$.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:$.compare(this,P)===0},$.prototype.inspect=function(){let P="";const N=m.INSPECT_MAX_BYTES;return P=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(P+=" ... "),"<Buffer "+P+">"},T&&($.prototype[T]=$.prototype.inspect),$.prototype.compare=function(P,N,Y,se,ge){if(on(P,F)&&(P=$.from(P,P.offset,P.byteLength)),!$.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(N===void 0&&(N=0),Y===void 0&&(Y=P?P.length:0),se===void 0&&(se=0),ge===void 0&&(ge=this.length),N<0||Y>P.length||se<0||ge>this.length)throw new RangeError("out of range index");if(se>=ge&&N>=Y)return 0;if(se>=ge)return-1;if(N>=Y)return 1;if(N>>>=0,Y>>>=0,se>>>=0,ge>>>=0,this===P)return 0;let Ie=ge-se,rt=Y-N;const Pt=Math.min(Ie,rt),Rt=this.slice(se,ge),xt=P.slice(N,Y);for(let pt=0;pt<Pt;++pt)if(Rt[pt]!==xt[pt]){Ie=Rt[pt],rt=xt[pt];break}return Ie<rt?-1:rt<Ie?1:0};function x(q,P,N,Y,se){if(q.length===0)return-1;if(typeof N=="string"?(Y=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,td(N)&&(N=se?0:q.length-1),N<0&&(N=q.length+N),N>=q.length){if(se)return-1;N=q.length-1}else if(N<0)if(se)N=0;else return-1;if(typeof P=="string"&&(P=$.from(P,Y)),$.isBuffer(P))return P.length===0?-1:k(q,P,N,Y,se);if(typeof P=="number")return P=P&255,typeof F.prototype.indexOf=="function"?se?F.prototype.indexOf.call(q,P,N):F.prototype.lastIndexOf.call(q,P,N):k(q,[P],N,Y,se);throw new TypeError("val must be string, number or Buffer")}function k(q,P,N,Y,se){let ge=1,Ie=q.length,rt=P.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(q.length<2||P.length<2)return-1;ge=2,Ie/=2,rt/=2,N/=2}function Pt(xt,pt){return ge===1?xt[pt]:xt.readUInt16BE(pt*ge)}let Rt;if(se){let xt=-1;for(Rt=N;Rt<Ie;Rt++)if(Pt(q,Rt)===Pt(P,xt===-1?0:Rt-xt)){if(xt===-1&&(xt=Rt),Rt-xt+1===rt)return xt*ge}else xt!==-1&&(Rt-=Rt-xt),xt=-1}else for(N+rt>Ie&&(N=Ie-rt),Rt=N;Rt>=0;Rt--){let xt=!0;for(let pt=0;pt<rt;pt++)if(Pt(q,Rt+pt)!==Pt(P,pt)){xt=!1;break}if(xt)return Rt}return-1}$.prototype.includes=function(P,N,Y){return this.indexOf(P,N,Y)!==-1},$.prototype.indexOf=function(P,N,Y){return x(this,P,N,Y,!0)},$.prototype.lastIndexOf=function(P,N,Y){return x(this,P,N,Y,!1)};function X(q,P,N,Y){N=Number(N)||0;const se=q.length-N;Y?(Y=Number(Y),Y>se&&(Y=se)):Y=se;const ge=P.length;Y>ge/2&&(Y=ge/2);let Ie;for(Ie=0;Ie<Y;++Ie){const rt=parseInt(P.substr(Ie*2,2),16);if(td(rt))return Ie;q[N+Ie]=rt}return Ie}function W(q,P,N,Y){return br(He(P,q.length-N),q,N,Y)}function U(q,P,N,Y){return br(Re(P),q,N,Y)}function z(q,P,N,Y){return br(De(P),q,N,Y)}function fe(q,P,N,Y){return br(xe(P,q.length-N),q,N,Y)}$.prototype.write=function(P,N,Y,se){if(N===void 0)se="utf8",Y=this.length,N=0;else if(Y===void 0&&typeof N=="string")se=N,Y=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(Y)?(Y=Y>>>0,se===void 0&&(se="utf8")):(se=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ge=this.length-N;if((Y===void 0||Y>ge)&&(Y=ge),P.length>0&&(Y<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let Ie=!1;for(;;)switch(se){case"hex":return X(this,P,N,Y);case"utf8":case"utf-8":return W(this,P,N,Y);case"ascii":case"latin1":case"binary":return U(this,P,N,Y);case"base64":return z(this,P,N,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,P,N,Y);default:if(Ie)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),Ie=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _e(q,P,N){return P===0&&N===q.length?g.fromByteArray(q):g.fromByteArray(q.slice(P,N))}function Be(q,P,N){N=Math.min(q.length,N);const Y=[];let se=P;for(;se<N;){const ge=q[se];let Ie=null,rt=ge>239?4:ge>223?3:ge>191?2:1;if(se+rt<=N){let Pt,Rt,xt,pt;switch(rt){case 1:ge<128&&(Ie=ge);break;case 2:Pt=q[se+1],(Pt&192)===128&&(pt=(ge&31)<<6|Pt&63,pt>127&&(Ie=pt));break;case 3:Pt=q[se+1],Rt=q[se+2],(Pt&192)===128&&(Rt&192)===128&&(pt=(ge&15)<<12|(Pt&63)<<6|Rt&63,pt>2047&&(pt<55296||pt>57343)&&(Ie=pt));break;case 4:Pt=q[se+1],Rt=q[se+2],xt=q[se+3],(Pt&192)===128&&(Rt&192)===128&&(xt&192)===128&&(pt=(ge&15)<<18|(Pt&63)<<12|(Rt&63)<<6|xt&63,pt>65535&&pt<1114112&&(Ie=pt))}}Ie===null?(Ie=65533,rt=1):Ie>65535&&(Ie-=65536,Y.push(Ie>>>10&1023|55296),Ie=56320|Ie&1023),Y.push(Ie),se+=rt}return Pe(Y)}const Fe=4096;function Pe(q){const P=q.length;if(P<=Fe)return String.fromCharCode.apply(String,q);let N="",Y=0;for(;Y<P;)N+=String.fromCharCode.apply(String,q.slice(Y,Y+=Fe));return N}function je(q,P,N){let Y="";N=Math.min(q.length,N);for(let se=P;se<N;++se)Y+=String.fromCharCode(q[se]&127);return Y}function te(q,P,N){let Y="";N=Math.min(q.length,N);for(let se=P;se<N;++se)Y+=String.fromCharCode(q[se]);return Y}function Le(q,P,N){const Y=q.length;(!P||P<0)&&(P=0),(!N||N<0||N>Y)&&(N=Y);let se="";for(let ge=P;ge<N;++ge)se+=ZL[q[ge]];return se}function qe(q,P,N){const Y=q.slice(P,N);let se="";for(let ge=0;ge<Y.length-1;ge+=2)se+=String.fromCharCode(Y[ge]+Y[ge+1]*256);return se}$.prototype.slice=function(P,N){const Y=this.length;P=~~P,N=N===void 0?Y:~~N,P<0?(P+=Y,P<0&&(P=0)):P>Y&&(P=Y),N<0?(N+=Y,N<0&&(N=0)):N>Y&&(N=Y),N<P&&(N=P);const se=this.subarray(P,N);return Object.setPrototypeOf(se,$.prototype),se};function ze(q,P,N){if(q%1!==0||q<0)throw new RangeError("offset is not uint");if(q+P>N)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUintLE=$.prototype.readUIntLE=function(P,N,Y){P=P>>>0,N=N>>>0,Y||ze(P,N,this.length);let se=this[P],ge=1,Ie=0;for(;++Ie<N&&(ge*=256);)se+=this[P+Ie]*ge;return se},$.prototype.readUintBE=$.prototype.readUIntBE=function(P,N,Y){P=P>>>0,N=N>>>0,Y||ze(P,N,this.length);let se=this[P+--N],ge=1;for(;N>0&&(ge*=256);)se+=this[P+--N]*ge;return se},$.prototype.readUint8=$.prototype.readUInt8=function(P,N){return P=P>>>0,N||ze(P,1,this.length),this[P]},$.prototype.readUint16LE=$.prototype.readUInt16LE=function(P,N){return P=P>>>0,N||ze(P,2,this.length),this[P]|this[P+1]<<8},$.prototype.readUint16BE=$.prototype.readUInt16BE=function(P,N){return P=P>>>0,N||ze(P,2,this.length),this[P]<<8|this[P+1]},$.prototype.readUint32LE=$.prototype.readUInt32LE=function(P,N){return P=P>>>0,N||ze(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},$.prototype.readUint32BE=$.prototype.readUInt32BE=function(P,N){return P=P>>>0,N||ze(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},$.prototype.readBigUInt64LE=Dn(function(P){P=P>>>0,M(P,"offset");const N=this[P],Y=this[P+7];(N===void 0||Y===void 0)&&G(P,this.length-8);const se=N+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,ge=this[++P]+this[++P]*2**8+this[++P]*2**16+Y*2**24;return BigInt(se)+(BigInt(ge)<<BigInt(32))}),$.prototype.readBigUInt64BE=Dn(function(P){P=P>>>0,M(P,"offset");const N=this[P],Y=this[P+7];(N===void 0||Y===void 0)&&G(P,this.length-8);const se=N*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],ge=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Y;return(BigInt(se)<<BigInt(32))+BigInt(ge)}),$.prototype.readIntLE=function(P,N,Y){P=P>>>0,N=N>>>0,Y||ze(P,N,this.length);let se=this[P],ge=1,Ie=0;for(;++Ie<N&&(ge*=256);)se+=this[P+Ie]*ge;return ge*=128,se>=ge&&(se-=Math.pow(2,8*N)),se},$.prototype.readIntBE=function(P,N,Y){P=P>>>0,N=N>>>0,Y||ze(P,N,this.length);let se=N,ge=1,Ie=this[P+--se];for(;se>0&&(ge*=256);)Ie+=this[P+--se]*ge;return ge*=128,Ie>=ge&&(Ie-=Math.pow(2,8*N)),Ie},$.prototype.readInt8=function(P,N){return P=P>>>0,N||ze(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},$.prototype.readInt16LE=function(P,N){P=P>>>0,N||ze(P,2,this.length);const Y=this[P]|this[P+1]<<8;return Y&32768?Y|4294901760:Y},$.prototype.readInt16BE=function(P,N){P=P>>>0,N||ze(P,2,this.length);const Y=this[P+1]|this[P]<<8;return Y&32768?Y|4294901760:Y},$.prototype.readInt32LE=function(P,N){return P=P>>>0,N||ze(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},$.prototype.readInt32BE=function(P,N){return P=P>>>0,N||ze(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},$.prototype.readBigInt64LE=Dn(function(P){P=P>>>0,M(P,"offset");const N=this[P],Y=this[P+7];(N===void 0||Y===void 0)&&G(P,this.length-8);const se=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(Y<<24);return(BigInt(se)<<BigInt(32))+BigInt(N+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),$.prototype.readBigInt64BE=Dn(function(P){P=P>>>0,M(P,"offset");const N=this[P],Y=this[P+7];(N===void 0||Y===void 0)&&G(P,this.length-8);const se=(N<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(se)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Y)}),$.prototype.readFloatLE=function(P,N){return P=P>>>0,N||ze(P,4,this.length),v.read(this,P,!0,23,4)},$.prototype.readFloatBE=function(P,N){return P=P>>>0,N||ze(P,4,this.length),v.read(this,P,!1,23,4)},$.prototype.readDoubleLE=function(P,N){return P=P>>>0,N||ze(P,8,this.length),v.read(this,P,!0,52,8)},$.prototype.readDoubleBE=function(P,N){return P=P>>>0,N||ze(P,8,this.length),v.read(this,P,!1,52,8)};function Ze(q,P,N,Y,se,ge){if(!$.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>se||P<ge)throw new RangeError('"value" argument is out of bounds');if(N+Y>q.length)throw new RangeError("Index out of range")}$.prototype.writeUintLE=$.prototype.writeUIntLE=function(P,N,Y,se){if(P=+P,N=N>>>0,Y=Y>>>0,!se){const rt=Math.pow(2,8*Y)-1;Ze(this,P,N,Y,rt,0)}let ge=1,Ie=0;for(this[N]=P&255;++Ie<Y&&(ge*=256);)this[N+Ie]=P/ge&255;return N+Y},$.prototype.writeUintBE=$.prototype.writeUIntBE=function(P,N,Y,se){if(P=+P,N=N>>>0,Y=Y>>>0,!se){const rt=Math.pow(2,8*Y)-1;Ze(this,P,N,Y,rt,0)}let ge=Y-1,Ie=1;for(this[N+ge]=P&255;--ge>=0&&(Ie*=256);)this[N+ge]=P/Ie&255;return N+Y},$.prototype.writeUint8=$.prototype.writeUInt8=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,1,255,0),this[N]=P&255,N+1},$.prototype.writeUint16LE=$.prototype.writeUInt16LE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,2,65535,0),this[N]=P&255,this[N+1]=P>>>8,N+2},$.prototype.writeUint16BE=$.prototype.writeUInt16BE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,2,65535,0),this[N]=P>>>8,this[N+1]=P&255,N+2},$.prototype.writeUint32LE=$.prototype.writeUInt32LE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,4,4294967295,0),this[N+3]=P>>>24,this[N+2]=P>>>16,this[N+1]=P>>>8,this[N]=P&255,N+4},$.prototype.writeUint32BE=$.prototype.writeUInt32BE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,4,4294967295,0),this[N]=P>>>24,this[N+1]=P>>>16,this[N+2]=P>>>8,this[N+3]=P&255,N+4};function vt(q,P,N,Y,se){O(P,Y,se,q,N,7);let ge=Number(P&BigInt(4294967295));q[N++]=ge,ge=ge>>8,q[N++]=ge,ge=ge>>8,q[N++]=ge,ge=ge>>8,q[N++]=ge;let Ie=Number(P>>BigInt(32)&BigInt(4294967295));return q[N++]=Ie,Ie=Ie>>8,q[N++]=Ie,Ie=Ie>>8,q[N++]=Ie,Ie=Ie>>8,q[N++]=Ie,N}function et(q,P,N,Y,se){O(P,Y,se,q,N,7);let ge=Number(P&BigInt(4294967295));q[N+7]=ge,ge=ge>>8,q[N+6]=ge,ge=ge>>8,q[N+5]=ge,ge=ge>>8,q[N+4]=ge;let Ie=Number(P>>BigInt(32)&BigInt(4294967295));return q[N+3]=Ie,Ie=Ie>>8,q[N+2]=Ie,Ie=Ie>>8,q[N+1]=Ie,Ie=Ie>>8,q[N]=Ie,N+8}$.prototype.writeBigUInt64LE=Dn(function(P,N=0){return vt(this,P,N,BigInt(0),BigInt("0xffffffffffffffff"))}),$.prototype.writeBigUInt64BE=Dn(function(P,N=0){return et(this,P,N,BigInt(0),BigInt("0xffffffffffffffff"))}),$.prototype.writeIntLE=function(P,N,Y,se){if(P=+P,N=N>>>0,!se){const Pt=Math.pow(2,8*Y-1);Ze(this,P,N,Y,Pt-1,-Pt)}let ge=0,Ie=1,rt=0;for(this[N]=P&255;++ge<Y&&(Ie*=256);)P<0&&rt===0&&this[N+ge-1]!==0&&(rt=1),this[N+ge]=(P/Ie>>0)-rt&255;return N+Y},$.prototype.writeIntBE=function(P,N,Y,se){if(P=+P,N=N>>>0,!se){const Pt=Math.pow(2,8*Y-1);Ze(this,P,N,Y,Pt-1,-Pt)}let ge=Y-1,Ie=1,rt=0;for(this[N+ge]=P&255;--ge>=0&&(Ie*=256);)P<0&&rt===0&&this[N+ge+1]!==0&&(rt=1),this[N+ge]=(P/Ie>>0)-rt&255;return N+Y},$.prototype.writeInt8=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,1,127,-128),P<0&&(P=255+P+1),this[N]=P&255,N+1},$.prototype.writeInt16LE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,2,32767,-32768),this[N]=P&255,this[N+1]=P>>>8,N+2},$.prototype.writeInt16BE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,2,32767,-32768),this[N]=P>>>8,this[N+1]=P&255,N+2},$.prototype.writeInt32LE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,4,2147483647,-2147483648),this[N]=P&255,this[N+1]=P>>>8,this[N+2]=P>>>16,this[N+3]=P>>>24,N+4},$.prototype.writeInt32BE=function(P,N,Y){return P=+P,N=N>>>0,Y||Ze(this,P,N,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[N]=P>>>24,this[N+1]=P>>>16,this[N+2]=P>>>8,this[N+3]=P&255,N+4},$.prototype.writeBigInt64LE=Dn(function(P,N=0){return vt(this,P,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),$.prototype.writeBigInt64BE=Dn(function(P,N=0){return et(this,P,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ut(q,P,N,Y,se,ge){if(N+Y>q.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function nr(q,P,N,Y,se){return P=+P,N=N>>>0,se||Ut(q,P,N,4),v.write(q,P,N,Y,23,4),N+4}$.prototype.writeFloatLE=function(P,N,Y){return nr(this,P,N,!0,Y)},$.prototype.writeFloatBE=function(P,N,Y){return nr(this,P,N,!1,Y)};function lt(q,P,N,Y,se){return P=+P,N=N>>>0,se||Ut(q,P,N,8),v.write(q,P,N,Y,52,8),N+8}$.prototype.writeDoubleLE=function(P,N,Y){return lt(this,P,N,!0,Y)},$.prototype.writeDoubleBE=function(P,N,Y){return lt(this,P,N,!1,Y)},$.prototype.copy=function(P,N,Y,se){if(!$.isBuffer(P))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!se&&se!==0&&(se=this.length),N>=P.length&&(N=P.length),N||(N=0),se>0&&se<Y&&(se=Y),se===Y||P.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),P.length-N<se-Y&&(se=P.length-N+Y);const ge=se-Y;return this===P&&typeof F.prototype.copyWithin=="function"?this.copyWithin(N,Y,se):F.prototype.set.call(P,this.subarray(Y,se),N),ge},$.prototype.fill=function(P,N,Y,se){if(typeof P=="string"){if(typeof N=="string"?(se=N,N=0,Y=this.length):typeof Y=="string"&&(se=Y,Y=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!$.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(P.length===1){const Ie=P.charCodeAt(0);(se==="utf8"&&Ie<128||se==="latin1")&&(P=Ie)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(N<0||this.length<N||this.length<Y)throw new RangeError("Out of range index");if(Y<=N)return this;N=N>>>0,Y=Y===void 0?this.length:Y>>>0,P||(P=0);let ge;if(typeof P=="number")for(ge=N;ge<Y;++ge)this[ge]=P;else{const Ie=$.isBuffer(P)?P:$.from(P,se),rt=Ie.length;if(rt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(ge=0;ge<Y-N;++ge)this[ge+N]=Ie[ge%rt]}return this};const Ir={};function _(q,P,N){Ir[q]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${q}]`,this.stack,delete this.name}get code(){return q}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${q}]: ${this.message}`}}}_("ERR_BUFFER_OUT_OF_BOUNDS",function(q){return q?`${q} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(q,P){return`The "${q}" argument must be of type number. Received type ${typeof P}`},TypeError),_("ERR_OUT_OF_RANGE",function(q,P,N){let Y=`The value of "${q}" is out of range.`,se=N;return Number.isInteger(N)&&Math.abs(N)>2**32?se=p(String(N)):typeof N=="bigint"&&(se=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(se=p(se)),se+="n"),Y+=` It must be ${P}. Received ${se}`,Y},RangeError);function p(q){let P="",N=q.length;const Y=q[0]==="-"?1:0;for(;N>=Y+4;N-=3)P=`_${q.slice(N-3,N)}${P}`;return`${q.slice(0,N)}${P}`}function h(q,P,N){M(P,"offset"),(q[P]===void 0||q[P+N]===void 0)&&G(P,q.length-(N+1))}function O(q,P,N,Y,se,ge){if(q>N||q<P){const Ie=typeof P=="bigint"?"n":"";let rt;throw P===0||P===BigInt(0)?rt=`>= 0${Ie} and < 2${Ie} ** ${(ge+1)*8}${Ie}`:rt=`>= -(2${Ie} ** ${(ge+1)*8-1}${Ie}) and < 2 ** ${(ge+1)*8-1}${Ie}`,new Ir.ERR_OUT_OF_RANGE("value",rt,q)}h(Y,se,ge)}function M(q,P){if(typeof q!="number")throw new Ir.ERR_INVALID_ARG_TYPE(P,"number",q)}function G(q,P,N){throw Math.floor(q)!==q?(M(q,N),new Ir.ERR_OUT_OF_RANGE("offset","an integer",q)):P<0?new Ir.ERR_BUFFER_OUT_OF_BOUNDS:new Ir.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,q)}const re=/[^+/0-9A-Za-z-_]/g;function $e(q){if(q=q.split("=")[0],q=q.trim().replace(re,""),q.length<2)return"";for(;q.length%4!==0;)q=q+"=";return q}function He(q,P){P=P||1/0;let N;const Y=q.length;let se=null;const ge=[];for(let Ie=0;Ie<Y;++Ie){if(N=q.charCodeAt(Ie),N>55295&&N<57344){if(!se){if(N>56319){(P-=3)>-1&&ge.push(239,191,189);continue}else if(Ie+1===Y){(P-=3)>-1&&ge.push(239,191,189);continue}se=N;continue}if(N<56320){(P-=3)>-1&&ge.push(239,191,189),se=N;continue}N=(se-55296<<10|N-56320)+65536}else se&&(P-=3)>-1&&ge.push(239,191,189);if(se=null,N<128){if((P-=1)<0)break;ge.push(N)}else if(N<2048){if((P-=2)<0)break;ge.push(N>>6|192,N&63|128)}else if(N<65536){if((P-=3)<0)break;ge.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((P-=4)<0)break;ge.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return ge}function Re(q){const P=[];for(let N=0;N<q.length;++N)P.push(q.charCodeAt(N)&255);return P}function xe(q,P){let N,Y,se;const ge=[];for(let Ie=0;Ie<q.length&&!((P-=2)<0);++Ie)N=q.charCodeAt(Ie),Y=N>>8,se=N%256,ge.push(se),ge.push(Y);return ge}function De(q){return g.toByteArray($e(q))}function br(q,P,N,Y){let se;for(se=0;se<Y&&!(se+N>=P.length||se>=q.length);++se)P[se+N]=q[se];return se}function on(q,P){return q instanceof P||q!=null&&q.constructor!=null&&q.constructor.name!=null&&q.constructor.name===P.name}function td(q){return q!==q}const ZL=function(){const q="0123456789abcdef",P=new Array(256);for(let N=0;N<16;++N){const Y=N*16;for(let se=0;se<16;++se)P[Y+se]=q[N]+q[se]}return P}();function Dn(q){return typeof BigInt>"u"?eB:q}function eB(){throw new Error("BigInt not supported")}})(t);const S=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=S,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(nc)),nc}var ic={},oc={},sc,og;function sg(){return og||(og=1,sc=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i 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]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0}),sc}var ac,ag;function Cs(){if(ag)return ac;ag=1;var e=sg();return ac=function(){return e()&&!!Symbol.toStringTag},ac}var lc,lg;function cg(){return lg||(lg=1,lc=Object),lc}var cc,ug;function KA(){return ug||(ug=1,cc=Error),cc}var uc,fg;function QA(){return fg||(fg=1,uc=EvalError),uc}var fc,dg;function XA(){return dg||(dg=1,fc=RangeError),fc}var dc,pg;function YA(){return pg||(pg=1,dc=ReferenceError),dc}var pc,hg;function gg(){return hg||(hg=1,pc=SyntaxError),pc}var hc,mg;function ho(){return mg||(mg=1,hc=TypeError),hc}var gc,yg;function JA(){return yg||(yg=1,gc=URIError),gc}var mc,bg;function ZA(){return bg||(bg=1,mc=Math.abs),mc}var yc,vg;function eR(){return vg||(vg=1,yc=Math.floor),yc}var bc,wg;function tR(){return wg||(wg=1,bc=Math.max),bc}var vc,Sg;function rR(){return Sg||(Sg=1,vc=Math.min),vc}var wc,Eg;function nR(){return Eg||(Eg=1,wc=Math.pow),wc}var Sc,Tg;function iR(){return Tg||(Tg=1,Sc=Math.round),Sc}var Ec,Ag;function oR(){return Ag||(Ag=1,Ec=Number.isNaN||function(t){return t!==t}),Ec}var Tc,Rg;function sR(){if(Rg)return Tc;Rg=1;var e=oR();return Tc=function(r){return e(r)||r===0?r:r<0?-1:1},Tc}var Ac,_g;function aR(){return _g||(_g=1,Ac=Object.getOwnPropertyDescriptor),Ac}var Rc,Ig;function Pi(){if(Ig)return Rc;Ig=1;var e=aR();if(e)try{e([],"length")}catch{e=null}return Rc=e,Rc}var _c,Cg;function Fs(){if(Cg)return _c;Cg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return _c=e,_c}var Ic,Fg;function lR(){if(Fg)return Ic;Fg=1;var e=typeof Symbol<"u"&&Symbol,t=sg();return Ic=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Ic}var Cc,Pg;function xg(){return Pg||(Pg=1,Cc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Cc}var Fc,Og;function kg(){if(Og)return Fc;Og=1;var e=cg();return Fc=e.getPrototypeOf||null,Fc}var Pc,Ng;function cR(){if(Ng)return Pc;Ng=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",o=function(c,u){for(var a=[],f=0;f<c.length;f+=1)a[f]=c[f];for(var d=0;d<u.length;d+=1)a[d+c.length]=u[d];return a},i=function(c,u){for(var a=[],f=u,d=0;f<c.length;f+=1,d+=1)a[d]=c[f];return a},s=function(l,c){for(var u="",a=0;a<l.length;a+=1)u+=l[a],a+1<l.length&&(u+=c);return u};return Pc=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var a=i(arguments,1),f,d=function(){if(this instanceof f){var S=u.apply(this,o(a,arguments));return Object(S)===S?S:this}return u.apply(c,o(a,arguments))},b=r(0,u.length-a.length),E=[],w=0;w<b;w++)E[w]="$"+w;if(f=Function("binder","return function ("+s(E,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var R=function(){};R.prototype=u.prototype,f.prototype=new R,R.prototype=null}return f},Pc}var xc,$g;function go(){if($g)return xc;$g=1;var e=cR();return xc=Function.prototype.bind||e,xc}var Oc,Dg;function kc(){return Dg||(Dg=1,Oc=Function.prototype.call),Oc}var Nc,Lg;function $c(){return Lg||(Lg=1,Nc=Function.prototype.apply),Nc}var Dc,Bg;function uR(){return Bg||(Bg=1,Dc=typeof Reflect<"u"&&Reflect&&Reflect.apply),Dc}var Lc,Mg;function jg(){if(Mg)return Lc;Mg=1;var e=go(),t=$c(),r=kc(),n=uR();return Lc=n||e.call(r,t),Lc}var Bc,Ug;function Mc(){if(Ug)return Bc;Ug=1;var e=go(),t=ho(),r=kc(),n=jg();return Bc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return n(e,r,i)},Bc}var jc,qg;function fR(){if(qg)return jc;qg=1;var e=Mc(),t=Pi(),r;try{r=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!r&&t&&t(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return jc=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(l){return i(l==null?l:o(l))}:!1,jc}var Uc,Vg;function zg(){if(Vg)return Uc;Vg=1;var e=xg(),t=kg(),r=fR();return Uc=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:r?function(o){return r(o)}:null,Uc}var qc,Wg;function Hg(){if(Wg)return qc;Wg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=go();return qc=r.call(e,t),qc}var Vc,Gg;function Kg(){if(Gg)return Vc;Gg=1;var e,t=cg(),r=KA(),n=QA(),o=XA(),i=YA(),s=gg(),l=ho(),c=JA(),u=ZA(),a=eR(),f=tR(),d=rR(),b=nR(),E=iR(),w=sR(),R=Function,S=function(X){try{return R('"use strict"; return ('+X+").constructor;")()}catch{}},m=Pi(),g=Fs(),v=function(){throw new l},T=m?function(){try{return arguments.callee,v}catch{try{return m(arguments,"callee").get}catch{return v}}}():v,A=lR()(),F=zg(),C=kg(),I=xg(),L=$c(),B=kc(),$={},D=typeof Uint8Array>"u"||!F?e:F(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":A&&F?F([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%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%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":R,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&F?F(F([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!A||!F?e:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!A||!F?e:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&F?F(""[Symbol.iterator]()):e,"%Symbol%":A?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":T,"%TypedArray%":D,"%TypeError%":l,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":B,"%Function.prototype.apply%":L,"%Object.defineProperty%":g,"%Object.getPrototypeOf%":C,"%Math.abs%":u,"%Math.floor%":a,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":b,"%Math.round%":E,"%Math.sign%":w,"%Reflect.getPrototypeOf%":I};if(F)try{null.error}catch(X){var ee=F(F(X));H["%Error.prototype%"]=ee}var J=function X(W){var U;if(W==="%AsyncFunction%")U=S("async function () {}");else if(W==="%GeneratorFunction%")U=S("function* () {}");else if(W==="%AsyncGeneratorFunction%")U=S("async function* () {}");else if(W==="%AsyncGenerator%"){var z=X("%AsyncGeneratorFunction%");z&&(U=z.prototype)}else if(W==="%AsyncIteratorPrototype%"){var fe=X("%AsyncGenerator%");fe&&F&&(U=F(fe.prototype))}return H[W]=U,U},ce={__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"]},be=go(),de=Hg(),Se=be.call(B,Array.prototype.concat),Ae=be.call(L,Array.prototype.splice),ne=be.call(B,String.prototype.replace),ae=be.call(B,String.prototype.slice),le=be.call(B,RegExp.prototype.exec),oe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,x=function(W){var U=ae(W,0,1),z=ae(W,-1);if(U==="%"&&z!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&U!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var fe=[];return ne(W,oe,function(_e,Be,Fe,Pe){fe[fe.length]=Fe?ne(Pe,Q,"$1"):Be||_e}),fe},k=function(W,U){var z=W,fe;if(de(ce,z)&&(fe=ce[z],z="%"+fe[0]+"%"),de(H,z)){var _e=H[z];if(_e===$&&(_e=J(z)),typeof _e>"u"&&!U)throw new l("intrinsic "+W+" exists, but is not available. Please file an issue!");return{alias:fe,name:z,value:_e}}throw new s("intrinsic "+W+" does not exist!")};return Vc=function(W,U){if(typeof W!="string"||W.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof U!="boolean")throw new l('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,W)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=x(W),fe=z.length>0?z[0]:"",_e=k("%"+fe+"%",U),Be=_e.name,Fe=_e.value,Pe=!1,je=_e.alias;je&&(fe=je[0],Ae(z,Se([0,1],je)));for(var te=1,Le=!0;te<z.length;te+=1){var qe=z[te],ze=ae(qe,0,1),Ze=ae(qe,-1);if((ze==='"'||ze==="'"||ze==="`"||Ze==='"'||Ze==="'"||Ze==="`")&&ze!==Ze)throw new s("property names with quotes must have matching quotes");if((qe==="constructor"||!Le)&&(Pe=!0),fe+="."+qe,Be="%"+fe+"%",de(H,Be))Fe=H[Be];else if(Fe!=null){if(!(qe in Fe)){if(!U)throw new l("base intrinsic for "+W+" exists, but the property is not available.");return}if(m&&te+1>=z.length){var vt=m(Fe,qe);Le=!!vt,Le&&"get"in vt&&!("originalValue"in vt.get)?Fe=vt.get:Fe=Fe[qe]}else Le=de(Fe,qe),Fe=Fe[qe];Le&&!Pe&&(H[Be]=Fe)}}return Fe},Vc}var zc,Qg;function mo(){if(Qg)return zc;Qg=1;var e=Kg(),t=Mc(),r=t([e("%String.prototype.indexOf%")]);return zc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&r(o,".prototype.")>-1?t([s]):s},zc}var Wc,Xg;function dR(){if(Xg)return Wc;Xg=1;var e=Cs()(),t=mo(),r=t("Object.prototype.toString"),n=function(l){return e&&l&&typeof l=="object"&&Symbol.toStringTag in l?!1:r(l)==="[object Arguments]"},o=function(l){return n(l)?!0:l!==null&&typeof l=="object"&&"length"in l&&typeof l.length=="number"&&l.length>=0&&r(l)!=="[object Array]"&&"callee"in l&&r(l.callee)==="[object Function]"},i=function(){return n(arguments)}();return n.isLegacyArguments=o,Wc=i?n:o,Wc}var Hc,Yg;function pR(){if(Yg)return Hc;Yg=1;var e=mo(),t=Cs()(),r=Hg(),n=Pi(),o;if(t){var i=e("RegExp.prototype.exec"),s={},l=function(){throw s},c={toString:l,valueOf:l};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=l),o=function(d){if(!d||typeof d!="object")return!1;var b=n(d,"lastIndex"),E=b&&r(b,"value");if(!E)return!1;try{i(d,c)}catch(w){return w===s}}}else{var u=e("Object.prototype.toString"),a="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===a}}return Hc=o,Hc}var Gc,Jg;function hR(){if(Jg)return Gc;Jg=1;var e=mo(),t=pR(),r=e("RegExp.prototype.exec"),n=ho();return Gc=function(i){if(!t(i))throw new n("`regex` must be a RegExp");return function(l){return r(i,l)!==null}},Gc}var Kc,Zg;function gR(){if(Zg)return Kc;Zg=1;var e=mo(),t=hR(),r=t(/^\s*(?:function)?\*/),n=Cs()(),o=zg(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),l=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},c;return Kc=function(a){if(typeof a!="function")return!1;if(r(s(a)))return!0;if(!n){var f=i(a);return f==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var d=l();c=d?o(d):!1}return o(a)===c},Kc}var Qc,em;function mR(){if(em)return Qc;em=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(m){m!==n&&(t=null)}else t=null;var o=/^\s*class\b/,i=function(g){try{var v=e.call(g);return o.test(v)}catch{return!1}},s=function(g){try{return i(g)?!1:(e.call(g),!0)}catch{return!1}},l=Object.prototype.toString,c="[object Object]",u="[object Function]",a="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",b="[object HTMLCollection]",E=typeof Symbol=="function"&&!!Symbol.toStringTag,w=!(0 in[,]),R=function(){return!1};if(typeof document=="object"){var S=document.all;l.call(S)===l.call(document.all)&&(R=function(g){if((w||!g)&&(typeof g>"u"||typeof g=="object"))try{var v=l.call(g);return(v===f||v===d||v===b||v===c)&&g("")==null}catch{}return!1})}return Qc=t?function(g){if(R(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;try{t(g,null,r)}catch(v){if(v!==n)return!1}return!i(g)&&s(g)}:function(g){if(R(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;if(E)return s(g);if(i(g))return!1;var v=l.call(g);return v!==u&&v!==a&&!/^\[object HTML/.test(v)?!1:s(g)},Qc}var Xc,tm;function yR(){if(tm)return Xc;tm=1;var e=mR(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(c,u,a){for(var f=0,d=c.length;f<d;f++)r.call(c,f)&&(a==null?u(c[f],f,c):u.call(a,c[f],f,c))},o=function(c,u,a){for(var f=0,d=c.length;f<d;f++)a==null?u(c.charAt(f),f,c):u.call(a,c.charAt(f),f,c)},i=function(c,u,a){for(var f in c)r.call(c,f)&&(a==null?u(c[f],f,c):u.call(a,c[f],f,c))};function s(l){return t.call(l)==="[object Array]"}return Xc=function(c,u,a){if(!e(u))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=a),s(c)?n(c,u,f):typeof c=="string"?o(c,u,f):i(c,u,f)},Xc}var Yc,rm;function bR(){return rm||(rm=1,Yc=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Yc}var Jc,nm;function vR(){if(nm)return Jc;nm=1;var e=bR(),t=typeof globalThis>"u"?Cn:globalThis;return Jc=function(){for(var n=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(n[n.length]=e[o]);return n},Jc}var Zc={exports:{}},eu,im;function wR(){if(im)return eu;im=1;var e=Fs(),t=gg(),r=ho(),n=Pi();return eu=function(i,s,l){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!n&&n(i,s);if(e)e(i,s,{configurable:a===null&&d?d.configurable:!a,enumerable:c===null&&d?d.enumerable:!c,value:l,writable:u===null&&d?d.writable:!u});else if(f||!c&&!u&&!a)i[s]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},eu}var tu,om;function SR(){if(om)return tu;om=1;var e=Fs(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},tu=t,tu}var ru,sm;function ER(){if(sm)return ru;sm=1;var e=Kg(),t=wR(),r=SR()(),n=Pi(),o=ho(),i=e("%Math.floor%");return ru=function(l,c){if(typeof l!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||i(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],a=!0,f=!0;if("length"in l&&n){var d=n(l,"length");d&&!d.configurable&&(a=!1),d&&!d.writable&&(f=!1)}return(a||f||!u)&&(r?t(l,"length",c,!0,!0):t(l,"length",c)),l},ru}var nu,am;function TR(){if(am)return nu;am=1;var e=go(),t=$c(),r=jg();return nu=function(){return r(e,t,arguments)},nu}var lm;function AR(){return lm||(lm=1,function(e){var t=ER(),r=Fs(),n=Mc(),o=TR();e.exports=function(s){var l=n(arguments),c=s.length-(arguments.length-1);return t(l,1+(c>0?c:0),!0)},r?r(e.exports,"apply",{value:o}):e.exports.apply=o}(Zc)),Zc.exports}var iu,cm;function um(){if(cm)return iu;cm=1;var e=yR(),t=vR(),r=AR(),n=mo(),o=Pi(),i=n("Object.prototype.toString"),s=Cs()(),l=typeof globalThis>"u"?Cn:globalThis,c=t(),u=n("String.prototype.slice"),a=Object.getPrototypeOf,f=n("Array.prototype.indexOf",!0)||function(R,S){for(var m=0;m<R.length;m+=1)if(R[m]===S)return m;return-1},d={__proto__:null};s&&o&&a?e(c,function(w){var R=new l[w];if(Symbol.toStringTag in R){var S=a(R),m=o(S,Symbol.toStringTag);if(!m){var g=a(S);m=o(g,Symbol.toStringTag)}d["$"+w]=r(m.get)}}):e(c,function(w){var R=new l[w],S=R.slice||R.set;S&&(d["$"+w]=r(S))});var b=function(R){var S=!1;return e(d,function(m,g){if(!S)try{"$"+m(R)===g&&(S=u(g,1))}catch{}}),S},E=function(R){var S=!1;return e(d,function(m,g){if(!S)try{m(R),S=u(g,1)}catch{}}),S};return iu=function(R){if(!R||typeof R!="object")return!1;if(!s){var S=u(i(R),8,-1);return f(c,S)>-1?S:S!=="Object"?!1:E(R)}return o?b(R):null},iu}var ou,fm;function RR(){if(fm)return ou;fm=1;var e=um();return ou=function(r){return!!e(r)},ou}var dm;function _R(){return dm||(dm=1,function(e){var t=dR(),r=gR(),n=um(),o=RR();function i(te){return te.call.bind(te)}var s=typeof BigInt<"u",l=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),a=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(s)var d=i(BigInt.prototype.valueOf);if(l)var b=i(Symbol.prototype.valueOf);function E(te,Le){if(typeof te!="object")return!1;try{return Le(te),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function w(te){return typeof Promise<"u"&&te instanceof Promise||te!==null&&typeof te=="object"&&typeof te.then=="function"&&typeof te.catch=="function"}e.isPromise=w;function R(te){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(te):o(te)||ae(te)}e.isArrayBufferView=R;function S(te){return n(te)==="Uint8Array"}e.isUint8Array=S;function m(te){return n(te)==="Uint8ClampedArray"}e.isUint8ClampedArray=m;function g(te){return n(te)==="Uint16Array"}e.isUint16Array=g;function v(te){return n(te)==="Uint32Array"}e.isUint32Array=v;function T(te){return n(te)==="Int8Array"}e.isInt8Array=T;function A(te){return n(te)==="Int16Array"}e.isInt16Array=A;function F(te){return n(te)==="Int32Array"}e.isInt32Array=F;function C(te){return n(te)==="Float32Array"}e.isFloat32Array=C;function I(te){return n(te)==="Float64Array"}e.isFloat64Array=I;function L(te){return n(te)==="BigInt64Array"}e.isBigInt64Array=L;function B(te){return n(te)==="BigUint64Array"}e.isBigUint64Array=B;function $(te){return c(te)==="[object Map]"}$.working=typeof Map<"u"&&$(new Map);function D(te){return typeof Map>"u"?!1:$.working?$(te):te instanceof Map}e.isMap=D;function H(te){return c(te)==="[object Set]"}H.working=typeof Set<"u"&&H(new Set);function ee(te){return typeof Set>"u"?!1:H.working?H(te):te instanceof Set}e.isSet=ee;function J(te){return c(te)==="[object WeakMap]"}J.working=typeof WeakMap<"u"&&J(new WeakMap);function ce(te){return typeof WeakMap>"u"?!1:J.working?J(te):te instanceof WeakMap}e.isWeakMap=ce;function be(te){return c(te)==="[object WeakSet]"}be.working=typeof WeakSet<"u"&&be(new WeakSet);function de(te){return be(te)}e.isWeakSet=de;function Se(te){return c(te)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function Ae(te){return typeof ArrayBuffer>"u"?!1:Se.working?Se(te):te instanceof ArrayBuffer}e.isArrayBuffer=Ae;function ne(te){return c(te)==="[object DataView]"}ne.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ne(new DataView(new ArrayBuffer(1),0,1));function ae(te){return typeof DataView>"u"?!1:ne.working?ne(te):te instanceof DataView}e.isDataView=ae;var le=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function oe(te){return c(te)==="[object SharedArrayBuffer]"}function Q(te){return typeof le>"u"?!1:(typeof oe.working>"u"&&(oe.working=oe(new le)),oe.working?oe(te):te instanceof le)}e.isSharedArrayBuffer=Q;function x(te){return c(te)==="[object AsyncFunction]"}e.isAsyncFunction=x;function k(te){return c(te)==="[object Map Iterator]"}e.isMapIterator=k;function X(te){return c(te)==="[object Set Iterator]"}e.isSetIterator=X;function W(te){return c(te)==="[object Generator]"}e.isGeneratorObject=W;function U(te){return c(te)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=U;function z(te){return E(te,u)}e.isNumberObject=z;function fe(te){return E(te,a)}e.isStringObject=fe;function _e(te){return E(te,f)}e.isBooleanObject=_e;function Be(te){return s&&E(te,d)}e.isBigIntObject=Be;function Fe(te){return l&&E(te,b)}e.isSymbolObject=Fe;function Pe(te){return z(te)||fe(te)||_e(te)||Be(te)||Fe(te)}e.isBoxedPrimitive=Pe;function je(te){return typeof Uint8Array<"u"&&(Ae(te)||Q(te))}e.isAnyArrayBuffer=je,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(te){Object.defineProperty(e,te,{enumerable:!1,value:function(){throw new Error(te+" is not supported in userland")}})})}(oc)),oc}var su,pm;function IR(){return pm||(pm=1,su=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),su}var hm;function gm(){return hm||(hm=1,function(e){var t=Object.getOwnPropertyDescriptors||function(ae){for(var le=Object.keys(ae),oe={},Q=0;Q<le.length;Q++)oe[le[Q]]=Object.getOwnPropertyDescriptor(ae,le[Q]);return oe},r=/%[sdj%]/g;e.format=function(ne){if(!T(ne)){for(var ae=[],le=0;le<arguments.length;le++)ae.push(s(arguments[le]));return ae.join(" ")}for(var le=1,oe=arguments,Q=oe.length,x=String(ne).replace(r,function(X){if(X==="%%")return"%";if(le>=Q)return X;switch(X){case"%s":return String(oe[le++]);case"%d":return Number(oe[le++]);case"%j":try{return JSON.stringify(oe[le++])}catch{return"[Circular]"}default:return X}}),k=oe[le];le<Q;k=oe[++le])m(k)||!I(k)?x+=" "+k:x+=" "+s(k);return x},e.deprecate=function(ne,ae){if(typeof me<"u"&&me.noDeprecation===!0)return ne;if(typeof me>"u")return function(){return e.deprecate(ne,ae).apply(this,arguments)};var le=!1;function oe(){if(!le){if(me.throwDeprecation)throw new Error(ae);me.traceDeprecation?console.trace(ae):console.error(ae),le=!0}return ne.apply(this,arguments)}return oe};var n={},o=/^$/;if(me.env.NODE_DEBUG){var i=me.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(ne){if(ne=ne.toUpperCase(),!n[ne])if(o.test(ne)){var ae=me.pid;n[ne]=function(){var le=e.format.apply(e,arguments);console.error("%s %d: %s",ne,ae,le)}}else n[ne]=function(){};return n[ne]};function s(ne,ae){var le={seen:[],stylize:c};return arguments.length>=3&&(le.depth=arguments[2]),arguments.length>=4&&(le.colors=arguments[3]),S(ae)?le.showHidden=ae:ae&&e._extend(le,ae),F(le.showHidden)&&(le.showHidden=!1),F(le.depth)&&(le.depth=2),F(le.colors)&&(le.colors=!1),F(le.customInspect)&&(le.customInspect=!0),le.colors&&(le.stylize=l),a(le,ne,le.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 l(ne,ae){var le=s.styles[ae];return le?"\x1B["+s.colors[le][0]+"m"+ne+"\x1B["+s.colors[le][1]+"m":ne}function c(ne,ae){return ne}function u(ne){var ae={};return ne.forEach(function(le,oe){ae[le]=!0}),ae}function a(ne,ae,le){if(ne.customInspect&&ae&&$(ae.inspect)&&ae.inspect!==e.inspect&&!(ae.constructor&&ae.constructor.prototype===ae)){var oe=ae.inspect(le,ne);return T(oe)||(oe=a(ne,oe,le)),oe}var Q=f(ne,ae);if(Q)return Q;var x=Object.keys(ae),k=u(x);if(ne.showHidden&&(x=Object.getOwnPropertyNames(ae)),B(ae)&&(x.indexOf("message")>=0||x.indexOf("description")>=0))return d(ae);if(x.length===0){if($(ae)){var X=ae.name?": "+ae.name:"";return ne.stylize("[Function"+X+"]","special")}if(C(ae))return ne.stylize(RegExp.prototype.toString.call(ae),"regexp");if(L(ae))return ne.stylize(Date.prototype.toString.call(ae),"date");if(B(ae))return d(ae)}var W="",U=!1,z=["{","}"];if(R(ae)&&(U=!0,z=["[","]"]),$(ae)){var fe=ae.name?": "+ae.name:"";W=" [Function"+fe+"]"}if(C(ae)&&(W=" "+RegExp.prototype.toString.call(ae)),L(ae)&&(W=" "+Date.prototype.toUTCString.call(ae)),B(ae)&&(W=" "+d(ae)),x.length===0&&(!U||ae.length==0))return z[0]+W+z[1];if(le<0)return C(ae)?ne.stylize(RegExp.prototype.toString.call(ae),"regexp"):ne.stylize("[Object]","special");ne.seen.push(ae);var _e;return U?_e=b(ne,ae,le,k,x):_e=x.map(function(Be){return E(ne,ae,le,k,Be,U)}),ne.seen.pop(),w(_e,W,z)}function f(ne,ae){if(F(ae))return ne.stylize("undefined","undefined");if(T(ae)){var le="'"+JSON.stringify(ae).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ne.stylize(le,"string")}if(v(ae))return ne.stylize(""+ae,"number");if(S(ae))return ne.stylize(""+ae,"boolean");if(m(ae))return ne.stylize("null","null")}function d(ne){return"["+Error.prototype.toString.call(ne)+"]"}function b(ne,ae,le,oe,Q){for(var x=[],k=0,X=ae.length;k<X;++k)be(ae,String(k))?x.push(E(ne,ae,le,oe,String(k),!0)):x.push("");return Q.forEach(function(W){W.match(/^\d+$/)||x.push(E(ne,ae,le,oe,W,!0))}),x}function E(ne,ae,le,oe,Q,x){var k,X,W;if(W=Object.getOwnPropertyDescriptor(ae,Q)||{value:ae[Q]},W.get?W.set?X=ne.stylize("[Getter/Setter]","special"):X=ne.stylize("[Getter]","special"):W.set&&(X=ne.stylize("[Setter]","special")),be(oe,Q)||(k="["+Q+"]"),X||(ne.seen.indexOf(W.value)<0?(m(le)?X=a(ne,W.value,null):X=a(ne,W.value,le-1),X.indexOf(`
22
- `)>-1&&(x?X=X.split(`
21
+ */(function(y){const g=r,v=T,A=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;y.Buffer=$,y.SlowBuffer=oe,y.INSPECT_MAX_BYTES=50;const R=2147483647;y.kMaxLength=R;const{Uint8Array:C,ArrayBuffer:P,SharedArrayBuffer:_}=globalThis;$.TYPED_ARRAY_SUPPORT=L(),!$.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 q=new C(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,C.prototype),Object.setPrototypeOf(q,x),q.foo()===42}catch{return!1}}Object.defineProperty($.prototype,"parent",{enumerable:!0,get:function(){if($.isBuffer(this))return this.buffer}}),Object.defineProperty($.prototype,"offset",{enumerable:!0,get:function(){if($.isBuffer(this))return this.byteOffset}});function B(q){if(q>R)throw new RangeError('The value "'+q+'" is invalid for option "size"');const x=new C(q);return Object.setPrototypeOf(x,$.prototype),x}function $(q,x,N){if(typeof q=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return J(q)}return D(q,x,N)}$.poolSize=8192;function D(q,x,N){if(typeof q=="string")return le(q,x);if(P.isView(q))return fe(q);if(q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q);if(on(q,P)||q&&on(q.buffer,P)||typeof _<"u"&&(on(q,_)||q&&on(q.buffer,_)))return we(q,x,N);if(typeof q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=q.valueOf&&q.valueOf();if(Y!=null&&Y!==q)return $.from(Y,x,N);const se=Se(q);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof q[Symbol.toPrimitive]=="function")return $.from(q[Symbol.toPrimitive]("string"),x,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q)}$.from=function(q,x,N){return D(q,x,N)},Object.setPrototypeOf($.prototype,C.prototype),Object.setPrototypeOf($,C);function H(q){if(typeof q!="number")throw new TypeError('"size" argument must be of type number');if(q<0)throw new RangeError('The value "'+q+'" is invalid for option "size"')}function X(q,x,N){return H(q),q<=0?B(q):x!==void 0?typeof N=="string"?B(q).fill(x,N):B(q).fill(x):B(q)}$.alloc=function(q,x,N){return X(q,x,N)};function J(q){return H(q),B(q<0?0:re(q)|0)}$.allocUnsafe=function(q){return J(q)},$.allocUnsafeSlow=function(q){return J(q)};function le(q,x){if((typeof x!="string"||x==="")&&(x="utf8"),!$.isEncoding(x))throw new TypeError("Unknown encoding: "+x);const N=ae(q,x)|0;let Y=B(N);const se=Y.write(q,x);return se!==N&&(Y=Y.slice(0,se)),Y}function me(q){const x=q.length<0?0:re(q.length)|0,N=B(x);for(let Y=0;Y<x;Y+=1)N[Y]=q[Y]&255;return N}function fe(q){if(on(q,C)){const x=new C(q);return we(x.buffer,x.byteOffset,x.byteLength)}return me(q)}function we(q,x,N){if(x<0||q.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(q.byteLength<x+(N||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return x===void 0&&N===void 0?Y=new C(q):N===void 0?Y=new C(q,x):Y=new C(q,x,N),Object.setPrototypeOf(Y,$.prototype),Y}function Se(q){if($.isBuffer(q)){const x=re(q.length)|0,N=B(x);return N.length===0||q.copy(N,0,0,x),N}if(q.length!==void 0)return typeof q.length!="number"||td(q.length)?B(0):me(q);if(q.type==="Buffer"&&Array.isArray(q.data))return me(q.data)}function re(q){if(q>=R)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R.toString(16)+" bytes");return q|0}function oe(q){return+q!=q&&(q=0),$.alloc(+q)}$.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==$.prototype},$.compare=function(x,N){if(on(x,C)&&(x=$.from(x,x.offset,x.byteLength)),on(N,C)&&(N=$.from(N,N.offset,N.byteLength)),!$.isBuffer(x)||!$.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===N)return 0;let Y=x.length,se=N.length;for(let he=0,Ie=Math.min(Y,se);he<Ie;++he)if(x[he]!==N[he]){Y=x[he],se=N[he];break}return Y<se?-1:se<Y?1:0},$.isEncoding=function(x){switch(String(x).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}},$.concat=function(x,N){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return $.alloc(0);let Y;if(N===void 0)for(N=0,Y=0;Y<x.length;++Y)N+=x[Y].length;const se=$.allocUnsafe(N);let he=0;for(Y=0;Y<x.length;++Y){let Ie=x[Y];if(on(Ie,C))he+Ie.length>se.length?($.isBuffer(Ie)||(Ie=$.from(Ie)),Ie.copy(se,he)):C.prototype.set.call(se,Ie,he);else if($.isBuffer(Ie))Ie.copy(se,he);else throw new TypeError('"list" argument must be an Array of Buffers');he+=Ie.length}return se};function ae(q,x){if($.isBuffer(q))return q.length;if(P.isView(q)||on(q,P))return q.byteLength;if(typeof q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof q);const N=q.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&N===0)return 0;let se=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return He(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return Le(q).length;default:if(se)return Y?-1:He(q).length;x=(""+x).toLowerCase(),se=!0}}$.byteLength=ae;function Ae(q,x,N){let Y=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,x>>>=0,N<=x))return"";for(q||(q="utf8");;)switch(q){case"hex":return Pe(this,x,N);case"utf8":case"utf-8":return Be(this,x,N);case"ascii":return Me(this,x,N);case"latin1":case"binary":return ee(this,x,N);case"base64":return _e(this,x,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ue(this,x,N);default:if(Y)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),Y=!0}}$.prototype._isBuffer=!0;function Z(q,x,N){const Y=q[x];q[x]=q[N],q[N]=Y}$.prototype.swap16=function(){const x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<x;N+=2)Z(this,N,N+1);return this},$.prototype.swap32=function(){const x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<x;N+=4)Z(this,N,N+3),Z(this,N+1,N+2);return this},$.prototype.swap64=function(){const x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<x;N+=8)Z(this,N,N+7),Z(this,N+1,N+6),Z(this,N+2,N+5),Z(this,N+3,N+4);return this},$.prototype.toString=function(){const x=this.length;return x===0?"":arguments.length===0?Be(this,0,x):Ae.apply(this,arguments)},$.prototype.toLocaleString=$.prototype.toString,$.prototype.equals=function(x){if(!$.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:$.compare(this,x)===0},$.prototype.inspect=function(){let x="";const N=y.INSPECT_MAX_BYTES;return x=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(x+=" ... "),"<Buffer "+x+">"},A&&($.prototype[A]=$.prototype.inspect),$.prototype.compare=function(x,N,Y,se,he){if(on(x,C)&&(x=$.from(x,x.offset,x.byteLength)),!$.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(N===void 0&&(N=0),Y===void 0&&(Y=x?x.length:0),se===void 0&&(se=0),he===void 0&&(he=this.length),N<0||Y>x.length||se<0||he>this.length)throw new RangeError("out of range index");if(se>=he&&N>=Y)return 0;if(se>=he)return-1;if(N>=Y)return 1;if(N>>>=0,Y>>>=0,se>>>=0,he>>>=0,this===x)return 0;let Ie=he-se,rt=Y-N;const Pt=Math.min(Ie,rt),_t=this.slice(se,he),xt=x.slice(N,Y);for(let pt=0;pt<Pt;++pt)if(_t[pt]!==xt[pt]){Ie=_t[pt],rt=xt[pt];break}return Ie<rt?-1:rt<Ie?1:0};function F(q,x,N,Y,se){if(q.length===0)return-1;if(typeof N=="string"?(Y=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,td(N)&&(N=se?0:q.length-1),N<0&&(N=q.length+N),N>=q.length){if(se)return-1;N=q.length-1}else if(N<0)if(se)N=0;else return-1;if(typeof x=="string"&&(x=$.from(x,Y)),$.isBuffer(x))return x.length===0?-1:O(q,x,N,Y,se);if(typeof x=="number")return x=x&255,typeof C.prototype.indexOf=="function"?se?C.prototype.indexOf.call(q,x,N):C.prototype.lastIndexOf.call(q,x,N):O(q,[x],N,Y,se);throw new TypeError("val must be string, number or Buffer")}function O(q,x,N,Y,se){let he=1,Ie=q.length,rt=x.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(q.length<2||x.length<2)return-1;he=2,Ie/=2,rt/=2,N/=2}function Pt(xt,pt){return he===1?xt[pt]:xt.readUInt16BE(pt*he)}let _t;if(se){let xt=-1;for(_t=N;_t<Ie;_t++)if(Pt(q,_t)===Pt(x,xt===-1?0:_t-xt)){if(xt===-1&&(xt=_t),_t-xt+1===rt)return xt*he}else xt!==-1&&(_t-=_t-xt),xt=-1}else for(N+rt>Ie&&(N=Ie-rt),_t=N;_t>=0;_t--){let xt=!0;for(let pt=0;pt<rt;pt++)if(Pt(q,_t+pt)!==Pt(x,pt)){xt=!1;break}if(xt)return _t}return-1}$.prototype.includes=function(x,N,Y){return this.indexOf(x,N,Y)!==-1},$.prototype.indexOf=function(x,N,Y){return F(this,x,N,Y,!0)},$.prototype.lastIndexOf=function(x,N,Y){return F(this,x,N,Y,!1)};function Q(q,x,N,Y){N=Number(N)||0;const se=q.length-N;Y?(Y=Number(Y),Y>se&&(Y=se)):Y=se;const he=x.length;Y>he/2&&(Y=he/2);let Ie;for(Ie=0;Ie<Y;++Ie){const rt=parseInt(x.substr(Ie*2,2),16);if(td(rt))return Ie;q[N+Ie]=rt}return Ie}function W(q,x,N,Y){return br(He(x,q.length-N),q,N,Y)}function U(q,x,N,Y){return br(Re(x),q,N,Y)}function z(q,x,N,Y){return br(Le(x),q,N,Y)}function ue(q,x,N,Y){return br(Oe(x,q.length-N),q,N,Y)}$.prototype.write=function(x,N,Y,se){if(N===void 0)se="utf8",Y=this.length,N=0;else if(Y===void 0&&typeof N=="string")se=N,Y=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(Y)?(Y=Y>>>0,se===void 0&&(se="utf8")):(se=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const he=this.length-N;if((Y===void 0||Y>he)&&(Y=he),x.length>0&&(Y<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let Ie=!1;for(;;)switch(se){case"hex":return Q(this,x,N,Y);case"utf8":case"utf-8":return W(this,x,N,Y);case"ascii":case"latin1":case"binary":return U(this,x,N,Y);case"base64":return z(this,x,N,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,x,N,Y);default:if(Ie)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),Ie=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _e(q,x,N){return x===0&&N===q.length?g.fromByteArray(q):g.fromByteArray(q.slice(x,N))}function Be(q,x,N){N=Math.min(q.length,N);const Y=[];let se=x;for(;se<N;){const he=q[se];let Ie=null,rt=he>239?4:he>223?3:he>191?2:1;if(se+rt<=N){let Pt,_t,xt,pt;switch(rt){case 1:he<128&&(Ie=he);break;case 2:Pt=q[se+1],(Pt&192)===128&&(pt=(he&31)<<6|Pt&63,pt>127&&(Ie=pt));break;case 3:Pt=q[se+1],_t=q[se+2],(Pt&192)===128&&(_t&192)===128&&(pt=(he&15)<<12|(Pt&63)<<6|_t&63,pt>2047&&(pt<55296||pt>57343)&&(Ie=pt));break;case 4:Pt=q[se+1],_t=q[se+2],xt=q[se+3],(Pt&192)===128&&(_t&192)===128&&(xt&192)===128&&(pt=(he&15)<<18|(Pt&63)<<12|(_t&63)<<6|xt&63,pt>65535&&pt<1114112&&(Ie=pt))}}Ie===null?(Ie=65533,rt=1):Ie>65535&&(Ie-=65536,Y.push(Ie>>>10&1023|55296),Ie=56320|Ie&1023),Y.push(Ie),se+=rt}return Fe(Y)}const xe=4096;function Fe(q){const x=q.length;if(x<=xe)return String.fromCharCode.apply(String,q);let N="",Y=0;for(;Y<x;)N+=String.fromCharCode.apply(String,q.slice(Y,Y+=xe));return N}function Me(q,x,N){let Y="";N=Math.min(q.length,N);for(let se=x;se<N;++se)Y+=String.fromCharCode(q[se]&127);return Y}function ee(q,x,N){let Y="";N=Math.min(q.length,N);for(let se=x;se<N;++se)Y+=String.fromCharCode(q[se]);return Y}function Pe(q,x,N){const Y=q.length;(!x||x<0)&&(x=0),(!N||N<0||N>Y)&&(N=Y);let se="";for(let he=x;he<N;++he)se+=JL[q[he]];return se}function Ue(q,x,N){const Y=q.slice(x,N);let se="";for(let he=0;he<Y.length-1;he+=2)se+=String.fromCharCode(Y[he]+Y[he+1]*256);return se}$.prototype.slice=function(x,N){const Y=this.length;x=~~x,N=N===void 0?Y:~~N,x<0?(x+=Y,x<0&&(x=0)):x>Y&&(x=Y),N<0?(N+=Y,N<0&&(N=0)):N>Y&&(N=Y),N<x&&(N=x);const se=this.subarray(x,N);return Object.setPrototypeOf(se,$.prototype),se};function ze(q,x,N){if(q%1!==0||q<0)throw new RangeError("offset is not uint");if(q+x>N)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUintLE=$.prototype.readUIntLE=function(x,N,Y){x=x>>>0,N=N>>>0,Y||ze(x,N,this.length);let se=this[x],he=1,Ie=0;for(;++Ie<N&&(he*=256);)se+=this[x+Ie]*he;return se},$.prototype.readUintBE=$.prototype.readUIntBE=function(x,N,Y){x=x>>>0,N=N>>>0,Y||ze(x,N,this.length);let se=this[x+--N],he=1;for(;N>0&&(he*=256);)se+=this[x+--N]*he;return se},$.prototype.readUint8=$.prototype.readUInt8=function(x,N){return x=x>>>0,N||ze(x,1,this.length),this[x]},$.prototype.readUint16LE=$.prototype.readUInt16LE=function(x,N){return x=x>>>0,N||ze(x,2,this.length),this[x]|this[x+1]<<8},$.prototype.readUint16BE=$.prototype.readUInt16BE=function(x,N){return x=x>>>0,N||ze(x,2,this.length),this[x]<<8|this[x+1]},$.prototype.readUint32LE=$.prototype.readUInt32LE=function(x,N){return x=x>>>0,N||ze(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},$.prototype.readUint32BE=$.prototype.readUInt32BE=function(x,N){return x=x>>>0,N||ze(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},$.prototype.readBigUInt64LE=Dn(function(x){x=x>>>0,M(x,"offset");const N=this[x],Y=this[x+7];(N===void 0||Y===void 0)&&G(x,this.length-8);const se=N+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,he=this[++x]+this[++x]*2**8+this[++x]*2**16+Y*2**24;return BigInt(se)+(BigInt(he)<<BigInt(32))}),$.prototype.readBigUInt64BE=Dn(function(x){x=x>>>0,M(x,"offset");const N=this[x],Y=this[x+7];(N===void 0||Y===void 0)&&G(x,this.length-8);const se=N*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],he=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+Y;return(BigInt(se)<<BigInt(32))+BigInt(he)}),$.prototype.readIntLE=function(x,N,Y){x=x>>>0,N=N>>>0,Y||ze(x,N,this.length);let se=this[x],he=1,Ie=0;for(;++Ie<N&&(he*=256);)se+=this[x+Ie]*he;return he*=128,se>=he&&(se-=Math.pow(2,8*N)),se},$.prototype.readIntBE=function(x,N,Y){x=x>>>0,N=N>>>0,Y||ze(x,N,this.length);let se=N,he=1,Ie=this[x+--se];for(;se>0&&(he*=256);)Ie+=this[x+--se]*he;return he*=128,Ie>=he&&(Ie-=Math.pow(2,8*N)),Ie},$.prototype.readInt8=function(x,N){return x=x>>>0,N||ze(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},$.prototype.readInt16LE=function(x,N){x=x>>>0,N||ze(x,2,this.length);const Y=this[x]|this[x+1]<<8;return Y&32768?Y|4294901760:Y},$.prototype.readInt16BE=function(x,N){x=x>>>0,N||ze(x,2,this.length);const Y=this[x+1]|this[x]<<8;return Y&32768?Y|4294901760:Y},$.prototype.readInt32LE=function(x,N){return x=x>>>0,N||ze(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},$.prototype.readInt32BE=function(x,N){return x=x>>>0,N||ze(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},$.prototype.readBigInt64LE=Dn(function(x){x=x>>>0,M(x,"offset");const N=this[x],Y=this[x+7];(N===void 0||Y===void 0)&&G(x,this.length-8);const se=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(Y<<24);return(BigInt(se)<<BigInt(32))+BigInt(N+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)}),$.prototype.readBigInt64BE=Dn(function(x){x=x>>>0,M(x,"offset");const N=this[x],Y=this[x+7];(N===void 0||Y===void 0)&&G(x,this.length-8);const se=(N<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(se)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+Y)}),$.prototype.readFloatLE=function(x,N){return x=x>>>0,N||ze(x,4,this.length),v.read(this,x,!0,23,4)},$.prototype.readFloatBE=function(x,N){return x=x>>>0,N||ze(x,4,this.length),v.read(this,x,!1,23,4)},$.prototype.readDoubleLE=function(x,N){return x=x>>>0,N||ze(x,8,this.length),v.read(this,x,!0,52,8)},$.prototype.readDoubleBE=function(x,N){return x=x>>>0,N||ze(x,8,this.length),v.read(this,x,!1,52,8)};function Ze(q,x,N,Y,se,he){if(!$.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>se||x<he)throw new RangeError('"value" argument is out of bounds');if(N+Y>q.length)throw new RangeError("Index out of range")}$.prototype.writeUintLE=$.prototype.writeUIntLE=function(x,N,Y,se){if(x=+x,N=N>>>0,Y=Y>>>0,!se){const rt=Math.pow(2,8*Y)-1;Ze(this,x,N,Y,rt,0)}let he=1,Ie=0;for(this[N]=x&255;++Ie<Y&&(he*=256);)this[N+Ie]=x/he&255;return N+Y},$.prototype.writeUintBE=$.prototype.writeUIntBE=function(x,N,Y,se){if(x=+x,N=N>>>0,Y=Y>>>0,!se){const rt=Math.pow(2,8*Y)-1;Ze(this,x,N,Y,rt,0)}let he=Y-1,Ie=1;for(this[N+he]=x&255;--he>=0&&(Ie*=256);)this[N+he]=x/Ie&255;return N+Y},$.prototype.writeUint8=$.prototype.writeUInt8=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,1,255,0),this[N]=x&255,N+1},$.prototype.writeUint16LE=$.prototype.writeUInt16LE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,2,65535,0),this[N]=x&255,this[N+1]=x>>>8,N+2},$.prototype.writeUint16BE=$.prototype.writeUInt16BE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,2,65535,0),this[N]=x>>>8,this[N+1]=x&255,N+2},$.prototype.writeUint32LE=$.prototype.writeUInt32LE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,4,4294967295,0),this[N+3]=x>>>24,this[N+2]=x>>>16,this[N+1]=x>>>8,this[N]=x&255,N+4},$.prototype.writeUint32BE=$.prototype.writeUInt32BE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,4,4294967295,0),this[N]=x>>>24,this[N+1]=x>>>16,this[N+2]=x>>>8,this[N+3]=x&255,N+4};function vt(q,x,N,Y,se){k(x,Y,se,q,N,7);let he=Number(x&BigInt(4294967295));q[N++]=he,he=he>>8,q[N++]=he,he=he>>8,q[N++]=he,he=he>>8,q[N++]=he;let Ie=Number(x>>BigInt(32)&BigInt(4294967295));return q[N++]=Ie,Ie=Ie>>8,q[N++]=Ie,Ie=Ie>>8,q[N++]=Ie,Ie=Ie>>8,q[N++]=Ie,N}function et(q,x,N,Y,se){k(x,Y,se,q,N,7);let he=Number(x&BigInt(4294967295));q[N+7]=he,he=he>>8,q[N+6]=he,he=he>>8,q[N+5]=he,he=he>>8,q[N+4]=he;let Ie=Number(x>>BigInt(32)&BigInt(4294967295));return q[N+3]=Ie,Ie=Ie>>8,q[N+2]=Ie,Ie=Ie>>8,q[N+1]=Ie,Ie=Ie>>8,q[N]=Ie,N+8}$.prototype.writeBigUInt64LE=Dn(function(x,N=0){return vt(this,x,N,BigInt(0),BigInt("0xffffffffffffffff"))}),$.prototype.writeBigUInt64BE=Dn(function(x,N=0){return et(this,x,N,BigInt(0),BigInt("0xffffffffffffffff"))}),$.prototype.writeIntLE=function(x,N,Y,se){if(x=+x,N=N>>>0,!se){const Pt=Math.pow(2,8*Y-1);Ze(this,x,N,Y,Pt-1,-Pt)}let he=0,Ie=1,rt=0;for(this[N]=x&255;++he<Y&&(Ie*=256);)x<0&&rt===0&&this[N+he-1]!==0&&(rt=1),this[N+he]=(x/Ie>>0)-rt&255;return N+Y},$.prototype.writeIntBE=function(x,N,Y,se){if(x=+x,N=N>>>0,!se){const Pt=Math.pow(2,8*Y-1);Ze(this,x,N,Y,Pt-1,-Pt)}let he=Y-1,Ie=1,rt=0;for(this[N+he]=x&255;--he>=0&&(Ie*=256);)x<0&&rt===0&&this[N+he+1]!==0&&(rt=1),this[N+he]=(x/Ie>>0)-rt&255;return N+Y},$.prototype.writeInt8=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,1,127,-128),x<0&&(x=255+x+1),this[N]=x&255,N+1},$.prototype.writeInt16LE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,2,32767,-32768),this[N]=x&255,this[N+1]=x>>>8,N+2},$.prototype.writeInt16BE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,2,32767,-32768),this[N]=x>>>8,this[N+1]=x&255,N+2},$.prototype.writeInt32LE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,4,2147483647,-2147483648),this[N]=x&255,this[N+1]=x>>>8,this[N+2]=x>>>16,this[N+3]=x>>>24,N+4},$.prototype.writeInt32BE=function(x,N,Y){return x=+x,N=N>>>0,Y||Ze(this,x,N,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[N]=x>>>24,this[N+1]=x>>>16,this[N+2]=x>>>8,this[N+3]=x&255,N+4},$.prototype.writeBigInt64LE=Dn(function(x,N=0){return vt(this,x,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),$.prototype.writeBigInt64BE=Dn(function(x,N=0){return et(this,x,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function jt(q,x,N,Y,se,he){if(N+Y>q.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function nr(q,x,N,Y,se){return x=+x,N=N>>>0,se||jt(q,x,N,4),v.write(q,x,N,Y,23,4),N+4}$.prototype.writeFloatLE=function(x,N,Y){return nr(this,x,N,!0,Y)},$.prototype.writeFloatBE=function(x,N,Y){return nr(this,x,N,!1,Y)};function ct(q,x,N,Y,se){return x=+x,N=N>>>0,se||jt(q,x,N,8),v.write(q,x,N,Y,52,8),N+8}$.prototype.writeDoubleLE=function(x,N,Y){return ct(this,x,N,!0,Y)},$.prototype.writeDoubleBE=function(x,N,Y){return ct(this,x,N,!1,Y)},$.prototype.copy=function(x,N,Y,se){if(!$.isBuffer(x))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!se&&se!==0&&(se=this.length),N>=x.length&&(N=x.length),N||(N=0),se>0&&se<Y&&(se=Y),se===Y||x.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),x.length-N<se-Y&&(se=x.length-N+Y);const he=se-Y;return this===x&&typeof C.prototype.copyWithin=="function"?this.copyWithin(N,Y,se):C.prototype.set.call(x,this.subarray(Y,se),N),he},$.prototype.fill=function(x,N,Y,se){if(typeof x=="string"){if(typeof N=="string"?(se=N,N=0,Y=this.length):typeof Y=="string"&&(se=Y,Y=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!$.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(x.length===1){const Ie=x.charCodeAt(0);(se==="utf8"&&Ie<128||se==="latin1")&&(x=Ie)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(N<0||this.length<N||this.length<Y)throw new RangeError("Out of range index");if(Y<=N)return this;N=N>>>0,Y=Y===void 0?this.length:Y>>>0,x||(x=0);let he;if(typeof x=="number")for(he=N;he<Y;++he)this[he]=x;else{const Ie=$.isBuffer(x)?x:$.from(x,se),rt=Ie.length;if(rt===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(he=0;he<Y-N;++he)this[he+N]=Ie[he%rt]}return this};const Ir={};function I(q,x,N){Ir[q]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${q}]`,this.stack,delete this.name}get code(){return q}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${q}]: ${this.message}`}}}I("ERR_BUFFER_OUT_OF_BOUNDS",function(q){return q?`${q} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),I("ERR_INVALID_ARG_TYPE",function(q,x){return`The "${q}" argument must be of type number. Received type ${typeof x}`},TypeError),I("ERR_OUT_OF_RANGE",function(q,x,N){let Y=`The value of "${q}" is out of range.`,se=N;return Number.isInteger(N)&&Math.abs(N)>2**32?se=p(String(N)):typeof N=="bigint"&&(se=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(se=p(se)),se+="n"),Y+=` It must be ${x}. Received ${se}`,Y},RangeError);function p(q){let x="",N=q.length;const Y=q[0]==="-"?1:0;for(;N>=Y+4;N-=3)x=`_${q.slice(N-3,N)}${x}`;return`${q.slice(0,N)}${x}`}function h(q,x,N){M(x,"offset"),(q[x]===void 0||q[x+N]===void 0)&&G(x,q.length-(N+1))}function k(q,x,N,Y,se,he){if(q>N||q<x){const Ie=typeof x=="bigint"?"n":"";let rt;throw x===0||x===BigInt(0)?rt=`>= 0${Ie} and < 2${Ie} ** ${(he+1)*8}${Ie}`:rt=`>= -(2${Ie} ** ${(he+1)*8-1}${Ie}) and < 2 ** ${(he+1)*8-1}${Ie}`,new Ir.ERR_OUT_OF_RANGE("value",rt,q)}h(Y,se,he)}function M(q,x){if(typeof q!="number")throw new Ir.ERR_INVALID_ARG_TYPE(x,"number",q)}function G(q,x,N){throw Math.floor(q)!==q?(M(q,N),new Ir.ERR_OUT_OF_RANGE("offset","an integer",q)):x<0?new Ir.ERR_BUFFER_OUT_OF_BOUNDS:new Ir.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,q)}const ne=/[^+/0-9A-Za-z-_]/g;function De(q){if(q=q.split("=")[0],q=q.trim().replace(ne,""),q.length<2)return"";for(;q.length%4!==0;)q=q+"=";return q}function He(q,x){x=x||1/0;let N;const Y=q.length;let se=null;const he=[];for(let Ie=0;Ie<Y;++Ie){if(N=q.charCodeAt(Ie),N>55295&&N<57344){if(!se){if(N>56319){(x-=3)>-1&&he.push(239,191,189);continue}else if(Ie+1===Y){(x-=3)>-1&&he.push(239,191,189);continue}se=N;continue}if(N<56320){(x-=3)>-1&&he.push(239,191,189),se=N;continue}N=(se-55296<<10|N-56320)+65536}else se&&(x-=3)>-1&&he.push(239,191,189);if(se=null,N<128){if((x-=1)<0)break;he.push(N)}else if(N<2048){if((x-=2)<0)break;he.push(N>>6|192,N&63|128)}else if(N<65536){if((x-=3)<0)break;he.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((x-=4)<0)break;he.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return he}function Re(q){const x=[];for(let N=0;N<q.length;++N)x.push(q.charCodeAt(N)&255);return x}function Oe(q,x){let N,Y,se;const he=[];for(let Ie=0;Ie<q.length&&!((x-=2)<0);++Ie)N=q.charCodeAt(Ie),Y=N>>8,se=N%256,he.push(se),he.push(Y);return he}function Le(q){return g.toByteArray(De(q))}function br(q,x,N,Y){let se;for(se=0;se<Y&&!(se+N>=x.length||se>=q.length);++se)x[se+N]=q[se];return se}function on(q,x){return q instanceof x||q!=null&&q.constructor!=null&&q.constructor.name!=null&&q.constructor.name===x.name}function td(q){return q!==q}const JL=function(){const q="0123456789abcdef",x=new Array(256);for(let N=0;N<16;++N){const Y=N*16;for(let se=0;se<16;++se)x[Y+se]=q[N]+q[se]}return x}();function Dn(q){return typeof BigInt>"u"?ZL:q}function ZL(){throw new Error("BigInt not supported")}})(t);const w=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=w,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(ic)),ic}var oc={},sc={},ac,og;function sg(){return og||(og=1,ac=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i 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]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0}),ac}var lc,ag;function Cs(){if(ag)return lc;ag=1;var e=sg();return lc=function(){return e()&&!!Symbol.toStringTag},lc}var cc,lg;function cg(){return lg||(lg=1,cc=Object),cc}var uc,ug;function zA(){return ug||(ug=1,uc=Error),uc}var fc,fg;function WA(){return fg||(fg=1,fc=EvalError),fc}var dc,dg;function HA(){return dg||(dg=1,dc=RangeError),dc}var pc,pg;function GA(){return pg||(pg=1,pc=ReferenceError),pc}var hc,hg;function gg(){return hg||(hg=1,hc=SyntaxError),hc}var gc,mg;function ho(){return mg||(mg=1,gc=TypeError),gc}var mc,yg;function KA(){return yg||(yg=1,mc=URIError),mc}var yc,bg;function QA(){return bg||(bg=1,yc=Math.abs),yc}var bc,vg;function XA(){return vg||(vg=1,bc=Math.floor),bc}var vc,wg;function YA(){return wg||(wg=1,vc=Math.max),vc}var wc,Sg;function JA(){return Sg||(Sg=1,wc=Math.min),wc}var Sc,Eg;function ZA(){return Eg||(Eg=1,Sc=Math.pow),Sc}var Ec,Tg;function eR(){return Tg||(Tg=1,Ec=Math.round),Ec}var Tc,Ag;function tR(){return Ag||(Ag=1,Tc=Number.isNaN||function(t){return t!==t}),Tc}var Ac,Rg;function rR(){if(Rg)return Ac;Rg=1;var e=tR();return Ac=function(r){return e(r)||r===0?r:r<0?-1:1},Ac}var Rc,_g;function nR(){return _g||(_g=1,Rc=Object.getOwnPropertyDescriptor),Rc}var _c,Ig;function Pi(){if(Ig)return _c;Ig=1;var e=nR();if(e)try{e([],"length")}catch{e=null}return _c=e,_c}var Ic,Cg;function Fs(){if(Cg)return Ic;Cg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Ic=e,Ic}var Cc,Fg;function iR(){if(Fg)return Cc;Fg=1;var e=typeof Symbol<"u"&&Symbol,t=sg();return Cc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Cc}var Fc,Pg;function xg(){return Pg||(Pg=1,Fc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Fc}var Pc,Og;function kg(){if(Og)return Pc;Og=1;var e=cg();return Pc=e.getPrototypeOf||null,Pc}var xc,Ng;function oR(){if(Ng)return xc;Ng=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",o=function(c,u){for(var a=[],f=0;f<c.length;f+=1)a[f]=c[f];for(var d=0;d<u.length;d+=1)a[d+c.length]=u[d];return a},i=function(c,u){for(var a=[],f=u,d=0;f<c.length;f+=1,d+=1)a[d]=c[f];return a},s=function(l,c){for(var u="",a=0;a<l.length;a+=1)u+=l[a],a+1<l.length&&(u+=c);return u};return xc=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var a=i(arguments,1),f,d=function(){if(this instanceof f){var w=u.apply(this,o(a,arguments));return Object(w)===w?w:this}return u.apply(c,o(a,arguments))},b=r(0,u.length-a.length),E=[],S=0;S<b;S++)E[S]="$"+S;if(f=Function("binder","return function ("+s(E,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var T=function(){};T.prototype=u.prototype,f.prototype=new T,T.prototype=null}return f},xc}var Oc,$g;function go(){if($g)return Oc;$g=1;var e=oR();return Oc=Function.prototype.bind||e,Oc}var kc,Dg;function Nc(){return Dg||(Dg=1,kc=Function.prototype.call),kc}var $c,Lg;function Dc(){return Lg||(Lg=1,$c=Function.prototype.apply),$c}var Lc,Bg;function sR(){return Bg||(Bg=1,Lc=typeof Reflect<"u"&&Reflect&&Reflect.apply),Lc}var Bc,Mg;function jg(){if(Mg)return Bc;Mg=1;var e=go(),t=Dc(),r=Nc(),n=sR();return Bc=n||e.call(r,t),Bc}var Mc,Ug;function jc(){if(Ug)return Mc;Ug=1;var e=go(),t=ho(),r=Nc(),n=jg();return Mc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return n(e,r,i)},Mc}var Uc,qg;function aR(){if(qg)return Uc;qg=1;var e=jc(),t=Pi(),r;try{r=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!r&&t&&t(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return Uc=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(l){return i(l==null?l:o(l))}:!1,Uc}var qc,Vg;function zg(){if(Vg)return qc;Vg=1;var e=xg(),t=kg(),r=aR();return qc=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:r?function(o){return r(o)}:null,qc}var Vc,Wg;function Hg(){if(Wg)return Vc;Wg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=go();return Vc=r.call(e,t),Vc}var zc,Gg;function Kg(){if(Gg)return zc;Gg=1;var e,t=cg(),r=zA(),n=WA(),o=HA(),i=GA(),s=gg(),l=ho(),c=KA(),u=QA(),a=XA(),f=YA(),d=JA(),b=ZA(),E=eR(),S=rR(),T=Function,w=function(Q){try{return T('"use strict"; return ('+Q+").constructor;")()}catch{}},y=Pi(),g=Fs(),v=function(){throw new l},A=y?function(){try{return arguments.callee,v}catch{try{return y(arguments,"callee").get}catch{return v}}}():v,R=iR()(),C=zg(),P=kg(),_=xg(),L=Dc(),B=Nc(),$={},D=typeof Uint8Array>"u"||!C?e:C(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":R&&C?C([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%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%":r,"%eval%":eval,"%EvalError%":n,"%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%":T,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&C?C(C([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!C?e:C(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":y,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!C?e:C(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&C?C(""[Symbol.iterator]()):e,"%Symbol%":R?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":A,"%TypedArray%":D,"%TypeError%":l,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":B,"%Function.prototype.apply%":L,"%Object.defineProperty%":g,"%Object.getPrototypeOf%":P,"%Math.abs%":u,"%Math.floor%":a,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":b,"%Math.round%":E,"%Math.sign%":S,"%Reflect.getPrototypeOf%":_};if(C)try{null.error}catch(Q){var X=C(C(Q));H["%Error.prototype%"]=X}var J=function Q(W){var U;if(W==="%AsyncFunction%")U=w("async function () {}");else if(W==="%GeneratorFunction%")U=w("function* () {}");else if(W==="%AsyncGeneratorFunction%")U=w("async function* () {}");else if(W==="%AsyncGenerator%"){var z=Q("%AsyncGeneratorFunction%");z&&(U=z.prototype)}else if(W==="%AsyncIteratorPrototype%"){var ue=Q("%AsyncGenerator%");ue&&C&&(U=C(ue.prototype))}return H[W]=U,U},le={__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"]},me=go(),fe=Hg(),we=me.call(B,Array.prototype.concat),Se=me.call(L,Array.prototype.splice),re=me.call(B,String.prototype.replace),oe=me.call(B,String.prototype.slice),ae=me.call(B,RegExp.prototype.exec),Ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z=/\\(\\)?/g,F=function(W){var U=oe(W,0,1),z=oe(W,-1);if(U==="%"&&z!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&U!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ue=[];return re(W,Ae,function(_e,Be,xe,Fe){ue[ue.length]=xe?re(Fe,Z,"$1"):Be||_e}),ue},O=function(W,U){var z=W,ue;if(fe(le,z)&&(ue=le[z],z="%"+ue[0]+"%"),fe(H,z)){var _e=H[z];if(_e===$&&(_e=J(z)),typeof _e>"u"&&!U)throw new l("intrinsic "+W+" exists, but is not available. Please file an issue!");return{alias:ue,name:z,value:_e}}throw new s("intrinsic "+W+" does not exist!")};return zc=function(W,U){if(typeof W!="string"||W.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof U!="boolean")throw new l('"allowMissing" argument must be a boolean');if(ae(/^%?[^%]*%?$/,W)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=F(W),ue=z.length>0?z[0]:"",_e=O("%"+ue+"%",U),Be=_e.name,xe=_e.value,Fe=!1,Me=_e.alias;Me&&(ue=Me[0],Se(z,we([0,1],Me)));for(var ee=1,Pe=!0;ee<z.length;ee+=1){var Ue=z[ee],ze=oe(Ue,0,1),Ze=oe(Ue,-1);if((ze==='"'||ze==="'"||ze==="`"||Ze==='"'||Ze==="'"||Ze==="`")&&ze!==Ze)throw new s("property names with quotes must have matching quotes");if((Ue==="constructor"||!Pe)&&(Fe=!0),ue+="."+Ue,Be="%"+ue+"%",fe(H,Be))xe=H[Be];else if(xe!=null){if(!(Ue in xe)){if(!U)throw new l("base intrinsic for "+W+" exists, but the property is not available.");return}if(y&&ee+1>=z.length){var vt=y(xe,Ue);Pe=!!vt,Pe&&"get"in vt&&!("originalValue"in vt.get)?xe=vt.get:xe=xe[Ue]}else Pe=fe(xe,Ue),xe=xe[Ue];Pe&&!Fe&&(H[Be]=xe)}}return xe},zc}var Wc,Qg;function mo(){if(Qg)return Wc;Qg=1;var e=Kg(),t=jc(),r=t([e("%String.prototype.indexOf%")]);return Wc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&r(o,".prototype.")>-1?t([s]):s},Wc}var Hc,Xg;function lR(){if(Xg)return Hc;Xg=1;var e=Cs()(),t=mo(),r=t("Object.prototype.toString"),n=function(l){return e&&l&&typeof l=="object"&&Symbol.toStringTag in l?!1:r(l)==="[object Arguments]"},o=function(l){return n(l)?!0:l!==null&&typeof l=="object"&&"length"in l&&typeof l.length=="number"&&l.length>=0&&r(l)!=="[object Array]"&&"callee"in l&&r(l.callee)==="[object Function]"},i=function(){return n(arguments)}();return n.isLegacyArguments=o,Hc=i?n:o,Hc}var Gc,Yg;function cR(){if(Yg)return Gc;Yg=1;var e=mo(),t=Cs()(),r=Hg(),n=Pi(),o;if(t){var i=e("RegExp.prototype.exec"),s={},l=function(){throw s},c={toString:l,valueOf:l};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=l),o=function(d){if(!d||typeof d!="object")return!1;var b=n(d,"lastIndex"),E=b&&r(b,"value");if(!E)return!1;try{i(d,c)}catch(S){return S===s}}}else{var u=e("Object.prototype.toString"),a="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===a}}return Gc=o,Gc}var Kc,Jg;function uR(){if(Jg)return Kc;Jg=1;var e=mo(),t=cR(),r=e("RegExp.prototype.exec"),n=ho();return Kc=function(i){if(!t(i))throw new n("`regex` must be a RegExp");return function(l){return r(i,l)!==null}},Kc}var Qc,Zg;function fR(){if(Zg)return Qc;Zg=1;var e=mo(),t=uR(),r=t(/^\s*(?:function)?\*/),n=Cs()(),o=zg(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),l=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},c;return Qc=function(a){if(typeof a!="function")return!1;if(r(s(a)))return!0;if(!n){var f=i(a);return f==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var d=l();c=d?o(d):!1}return o(a)===c},Qc}var Xc,em;function dR(){if(em)return Xc;em=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(y){y!==n&&(t=null)}else t=null;var o=/^\s*class\b/,i=function(g){try{var v=e.call(g);return o.test(v)}catch{return!1}},s=function(g){try{return i(g)?!1:(e.call(g),!0)}catch{return!1}},l=Object.prototype.toString,c="[object Object]",u="[object Function]",a="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",b="[object HTMLCollection]",E=typeof Symbol=="function"&&!!Symbol.toStringTag,S=!(0 in[,]),T=function(){return!1};if(typeof document=="object"){var w=document.all;l.call(w)===l.call(document.all)&&(T=function(g){if((S||!g)&&(typeof g>"u"||typeof g=="object"))try{var v=l.call(g);return(v===f||v===d||v===b||v===c)&&g("")==null}catch{}return!1})}return Xc=t?function(g){if(T(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;try{t(g,null,r)}catch(v){if(v!==n)return!1}return!i(g)&&s(g)}:function(g){if(T(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;if(E)return s(g);if(i(g))return!1;var v=l.call(g);return v!==u&&v!==a&&!/^\[object HTML/.test(v)?!1:s(g)},Xc}var Yc,tm;function pR(){if(tm)return Yc;tm=1;var e=dR(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(c,u,a){for(var f=0,d=c.length;f<d;f++)r.call(c,f)&&(a==null?u(c[f],f,c):u.call(a,c[f],f,c))},o=function(c,u,a){for(var f=0,d=c.length;f<d;f++)a==null?u(c.charAt(f),f,c):u.call(a,c.charAt(f),f,c)},i=function(c,u,a){for(var f in c)r.call(c,f)&&(a==null?u(c[f],f,c):u.call(a,c[f],f,c))};function s(l){return t.call(l)==="[object Array]"}return Yc=function(c,u,a){if(!e(u))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=a),s(c)?n(c,u,f):typeof c=="string"?o(c,u,f):i(c,u,f)},Yc}var Jc,rm;function hR(){return rm||(rm=1,Jc=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Jc}var Zc,nm;function gR(){if(nm)return Zc;nm=1;var e=hR(),t=typeof globalThis>"u"?Fn:globalThis;return Zc=function(){for(var n=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(n[n.length]=e[o]);return n},Zc}var eu={exports:{}},tu,im;function mR(){if(im)return tu;im=1;var e=Fs(),t=gg(),r=ho(),n=Pi();return tu=function(i,s,l){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!n&&n(i,s);if(e)e(i,s,{configurable:a===null&&d?d.configurable:!a,enumerable:c===null&&d?d.enumerable:!c,value:l,writable:u===null&&d?d.writable:!u});else if(f||!c&&!u&&!a)i[s]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},tu}var ru,om;function yR(){if(om)return ru;om=1;var e=Fs(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},ru=t,ru}var nu,sm;function bR(){if(sm)return nu;sm=1;var e=Kg(),t=mR(),r=yR()(),n=Pi(),o=ho(),i=e("%Math.floor%");return nu=function(l,c){if(typeof l!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||i(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],a=!0,f=!0;if("length"in l&&n){var d=n(l,"length");d&&!d.configurable&&(a=!1),d&&!d.writable&&(f=!1)}return(a||f||!u)&&(r?t(l,"length",c,!0,!0):t(l,"length",c)),l},nu}var iu,am;function vR(){if(am)return iu;am=1;var e=go(),t=Dc(),r=jg();return iu=function(){return r(e,t,arguments)},iu}var lm;function wR(){return lm||(lm=1,function(e){var t=bR(),r=Fs(),n=jc(),o=vR();e.exports=function(s){var l=n(arguments),c=s.length-(arguments.length-1);return t(l,1+(c>0?c:0),!0)},r?r(e.exports,"apply",{value:o}):e.exports.apply=o}(eu)),eu.exports}var ou,cm;function um(){if(cm)return ou;cm=1;var e=pR(),t=gR(),r=wR(),n=mo(),o=Pi(),i=n("Object.prototype.toString"),s=Cs()(),l=typeof globalThis>"u"?Fn:globalThis,c=t(),u=n("String.prototype.slice"),a=Object.getPrototypeOf,f=n("Array.prototype.indexOf",!0)||function(T,w){for(var y=0;y<T.length;y+=1)if(T[y]===w)return y;return-1},d={__proto__:null};s&&o&&a?e(c,function(S){var T=new l[S];if(Symbol.toStringTag in T){var w=a(T),y=o(w,Symbol.toStringTag);if(!y){var g=a(w);y=o(g,Symbol.toStringTag)}d["$"+S]=r(y.get)}}):e(c,function(S){var T=new l[S],w=T.slice||T.set;w&&(d["$"+S]=r(w))});var b=function(T){var w=!1;return e(d,function(y,g){if(!w)try{"$"+y(T)===g&&(w=u(g,1))}catch{}}),w},E=function(T){var w=!1;return e(d,function(y,g){if(!w)try{y(T),w=u(g,1)}catch{}}),w};return ou=function(T){if(!T||typeof T!="object")return!1;if(!s){var w=u(i(T),8,-1);return f(c,w)>-1?w:w!=="Object"?!1:E(T)}return o?b(T):null},ou}var su,fm;function SR(){if(fm)return su;fm=1;var e=um();return su=function(r){return!!e(r)},su}var dm;function ER(){return dm||(dm=1,function(e){var t=lR(),r=fR(),n=um(),o=SR();function i(ee){return ee.call.bind(ee)}var s=typeof BigInt<"u",l=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),a=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(s)var d=i(BigInt.prototype.valueOf);if(l)var b=i(Symbol.prototype.valueOf);function E(ee,Pe){if(typeof ee!="object")return!1;try{return Pe(ee),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function S(ee){return typeof Promise<"u"&&ee instanceof Promise||ee!==null&&typeof ee=="object"&&typeof ee.then=="function"&&typeof ee.catch=="function"}e.isPromise=S;function T(ee){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ee):o(ee)||oe(ee)}e.isArrayBufferView=T;function w(ee){return n(ee)==="Uint8Array"}e.isUint8Array=w;function y(ee){return n(ee)==="Uint8ClampedArray"}e.isUint8ClampedArray=y;function g(ee){return n(ee)==="Uint16Array"}e.isUint16Array=g;function v(ee){return n(ee)==="Uint32Array"}e.isUint32Array=v;function A(ee){return n(ee)==="Int8Array"}e.isInt8Array=A;function R(ee){return n(ee)==="Int16Array"}e.isInt16Array=R;function C(ee){return n(ee)==="Int32Array"}e.isInt32Array=C;function P(ee){return n(ee)==="Float32Array"}e.isFloat32Array=P;function _(ee){return n(ee)==="Float64Array"}e.isFloat64Array=_;function L(ee){return n(ee)==="BigInt64Array"}e.isBigInt64Array=L;function B(ee){return n(ee)==="BigUint64Array"}e.isBigUint64Array=B;function $(ee){return c(ee)==="[object Map]"}$.working=typeof Map<"u"&&$(new Map);function D(ee){return typeof Map>"u"?!1:$.working?$(ee):ee instanceof Map}e.isMap=D;function H(ee){return c(ee)==="[object Set]"}H.working=typeof Set<"u"&&H(new Set);function X(ee){return typeof Set>"u"?!1:H.working?H(ee):ee instanceof Set}e.isSet=X;function J(ee){return c(ee)==="[object WeakMap]"}J.working=typeof WeakMap<"u"&&J(new WeakMap);function le(ee){return typeof WeakMap>"u"?!1:J.working?J(ee):ee instanceof WeakMap}e.isWeakMap=le;function me(ee){return c(ee)==="[object WeakSet]"}me.working=typeof WeakSet<"u"&&me(new WeakSet);function fe(ee){return me(ee)}e.isWeakSet=fe;function we(ee){return c(ee)==="[object ArrayBuffer]"}we.working=typeof ArrayBuffer<"u"&&we(new ArrayBuffer);function Se(ee){return typeof ArrayBuffer>"u"?!1:we.working?we(ee):ee instanceof ArrayBuffer}e.isArrayBuffer=Se;function re(ee){return c(ee)==="[object DataView]"}re.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&re(new DataView(new ArrayBuffer(1),0,1));function oe(ee){return typeof DataView>"u"?!1:re.working?re(ee):ee instanceof DataView}e.isDataView=oe;var ae=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ae(ee){return c(ee)==="[object SharedArrayBuffer]"}function Z(ee){return typeof ae>"u"?!1:(typeof Ae.working>"u"&&(Ae.working=Ae(new ae)),Ae.working?Ae(ee):ee instanceof ae)}e.isSharedArrayBuffer=Z;function F(ee){return c(ee)==="[object AsyncFunction]"}e.isAsyncFunction=F;function O(ee){return c(ee)==="[object Map Iterator]"}e.isMapIterator=O;function Q(ee){return c(ee)==="[object Set Iterator]"}e.isSetIterator=Q;function W(ee){return c(ee)==="[object Generator]"}e.isGeneratorObject=W;function U(ee){return c(ee)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=U;function z(ee){return E(ee,u)}e.isNumberObject=z;function ue(ee){return E(ee,a)}e.isStringObject=ue;function _e(ee){return E(ee,f)}e.isBooleanObject=_e;function Be(ee){return s&&E(ee,d)}e.isBigIntObject=Be;function xe(ee){return l&&E(ee,b)}e.isSymbolObject=xe;function Fe(ee){return z(ee)||ue(ee)||_e(ee)||Be(ee)||xe(ee)}e.isBoxedPrimitive=Fe;function Me(ee){return typeof Uint8Array<"u"&&(Se(ee)||Z(ee))}e.isAnyArrayBuffer=Me,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ee){Object.defineProperty(e,ee,{enumerable:!1,value:function(){throw new Error(ee+" is not supported in userland")}})})}(sc)),sc}var au,pm;function TR(){return pm||(pm=1,au=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),au}var hm;function gm(){return hm||(hm=1,function(e){var t=Object.getOwnPropertyDescriptors||function(oe){for(var ae=Object.keys(oe),Ae={},Z=0;Z<ae.length;Z++)Ae[ae[Z]]=Object.getOwnPropertyDescriptor(oe,ae[Z]);return Ae},r=/%[sdj%]/g;e.format=function(re){if(!A(re)){for(var oe=[],ae=0;ae<arguments.length;ae++)oe.push(s(arguments[ae]));return oe.join(" ")}for(var ae=1,Ae=arguments,Z=Ae.length,F=String(re).replace(r,function(Q){if(Q==="%%")return"%";if(ae>=Z)return Q;switch(Q){case"%s":return String(Ae[ae++]);case"%d":return Number(Ae[ae++]);case"%j":try{return JSON.stringify(Ae[ae++])}catch{return"[Circular]"}default:return Q}}),O=Ae[ae];ae<Z;O=Ae[++ae])y(O)||!_(O)?F+=" "+O:F+=" "+s(O);return F},e.deprecate=function(re,oe){if(typeof ye<"u"&&ye.noDeprecation===!0)return re;if(typeof ye>"u")return function(){return e.deprecate(re,oe).apply(this,arguments)};var ae=!1;function Ae(){if(!ae){if(ye.throwDeprecation)throw new Error(oe);ye.traceDeprecation?console.trace(oe):console.error(oe),ae=!0}return re.apply(this,arguments)}return Ae};var n={},o=/^$/;if(ye.env.NODE_DEBUG){var i=ye.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(re){if(re=re.toUpperCase(),!n[re])if(o.test(re)){var oe=ye.pid;n[re]=function(){var ae=e.format.apply(e,arguments);console.error("%s %d: %s",re,oe,ae)}}else n[re]=function(){};return n[re]};function s(re,oe){var ae={seen:[],stylize:c};return arguments.length>=3&&(ae.depth=arguments[2]),arguments.length>=4&&(ae.colors=arguments[3]),w(oe)?ae.showHidden=oe:oe&&e._extend(ae,oe),C(ae.showHidden)&&(ae.showHidden=!1),C(ae.depth)&&(ae.depth=2),C(ae.colors)&&(ae.colors=!1),C(ae.customInspect)&&(ae.customInspect=!0),ae.colors&&(ae.stylize=l),a(ae,re,ae.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 l(re,oe){var ae=s.styles[oe];return ae?"\x1B["+s.colors[ae][0]+"m"+re+"\x1B["+s.colors[ae][1]+"m":re}function c(re,oe){return re}function u(re){var oe={};return re.forEach(function(ae,Ae){oe[ae]=!0}),oe}function a(re,oe,ae){if(re.customInspect&&oe&&$(oe.inspect)&&oe.inspect!==e.inspect&&!(oe.constructor&&oe.constructor.prototype===oe)){var Ae=oe.inspect(ae,re);return A(Ae)||(Ae=a(re,Ae,ae)),Ae}var Z=f(re,oe);if(Z)return Z;var F=Object.keys(oe),O=u(F);if(re.showHidden&&(F=Object.getOwnPropertyNames(oe)),B(oe)&&(F.indexOf("message")>=0||F.indexOf("description")>=0))return d(oe);if(F.length===0){if($(oe)){var Q=oe.name?": "+oe.name:"";return re.stylize("[Function"+Q+"]","special")}if(P(oe))return re.stylize(RegExp.prototype.toString.call(oe),"regexp");if(L(oe))return re.stylize(Date.prototype.toString.call(oe),"date");if(B(oe))return d(oe)}var W="",U=!1,z=["{","}"];if(T(oe)&&(U=!0,z=["[","]"]),$(oe)){var ue=oe.name?": "+oe.name:"";W=" [Function"+ue+"]"}if(P(oe)&&(W=" "+RegExp.prototype.toString.call(oe)),L(oe)&&(W=" "+Date.prototype.toUTCString.call(oe)),B(oe)&&(W=" "+d(oe)),F.length===0&&(!U||oe.length==0))return z[0]+W+z[1];if(ae<0)return P(oe)?re.stylize(RegExp.prototype.toString.call(oe),"regexp"):re.stylize("[Object]","special");re.seen.push(oe);var _e;return U?_e=b(re,oe,ae,O,F):_e=F.map(function(Be){return E(re,oe,ae,O,Be,U)}),re.seen.pop(),S(_e,W,z)}function f(re,oe){if(C(oe))return re.stylize("undefined","undefined");if(A(oe)){var ae="'"+JSON.stringify(oe).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return re.stylize(ae,"string")}if(v(oe))return re.stylize(""+oe,"number");if(w(oe))return re.stylize(""+oe,"boolean");if(y(oe))return re.stylize("null","null")}function d(re){return"["+Error.prototype.toString.call(re)+"]"}function b(re,oe,ae,Ae,Z){for(var F=[],O=0,Q=oe.length;O<Q;++O)me(oe,String(O))?F.push(E(re,oe,ae,Ae,String(O),!0)):F.push("");return Z.forEach(function(W){W.match(/^\d+$/)||F.push(E(re,oe,ae,Ae,W,!0))}),F}function E(re,oe,ae,Ae,Z,F){var O,Q,W;if(W=Object.getOwnPropertyDescriptor(oe,Z)||{value:oe[Z]},W.get?W.set?Q=re.stylize("[Getter/Setter]","special"):Q=re.stylize("[Getter]","special"):W.set&&(Q=re.stylize("[Setter]","special")),me(Ae,Z)||(O="["+Z+"]"),Q||(re.seen.indexOf(W.value)<0?(y(ae)?Q=a(re,W.value,null):Q=a(re,W.value,ae-1),Q.indexOf(`
22
+ `)>-1&&(F?Q=Q.split(`
23
23
  `).map(function(U){return" "+U}).join(`
24
- `).slice(2):X=`
25
- `+X.split(`
24
+ `).slice(2):Q=`
25
+ `+Q.split(`
26
26
  `).map(function(U){return" "+U}).join(`
27
- `))):X=ne.stylize("[Circular]","special")),F(k)){if(x&&Q.match(/^\d+$/))return X;k=JSON.stringify(""+Q),k.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(k=k.slice(1,-1),k=ne.stylize(k,"name")):(k=k.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),k=ne.stylize(k,"string"))}return k+": "+X}function w(ne,ae,le){var oe=ne.reduce(function(Q,x){return x.indexOf(`
28
- `)>=0,Q+x.replace(/\u001b\[\d\d?m/g,"").length+1},0);return oe>60?le[0]+(ae===""?"":ae+`
29
- `)+" "+ne.join(`,
30
- `)+" "+le[1]:le[0]+ae+" "+ne.join(", ")+" "+le[1]}e.types=_R();function R(ne){return Array.isArray(ne)}e.isArray=R;function S(ne){return typeof ne=="boolean"}e.isBoolean=S;function m(ne){return ne===null}e.isNull=m;function g(ne){return ne==null}e.isNullOrUndefined=g;function v(ne){return typeof ne=="number"}e.isNumber=v;function T(ne){return typeof ne=="string"}e.isString=T;function A(ne){return typeof ne=="symbol"}e.isSymbol=A;function F(ne){return ne===void 0}e.isUndefined=F;function C(ne){return I(ne)&&H(ne)==="[object RegExp]"}e.isRegExp=C,e.types.isRegExp=C;function I(ne){return typeof ne=="object"&&ne!==null}e.isObject=I;function L(ne){return I(ne)&&H(ne)==="[object Date]"}e.isDate=L,e.types.isDate=L;function B(ne){return I(ne)&&(H(ne)==="[object Error]"||ne instanceof Error)}e.isError=B,e.types.isNativeError=B;function $(ne){return typeof ne=="function"}e.isFunction=$;function D(ne){return ne===null||typeof ne=="boolean"||typeof ne=="number"||typeof ne=="string"||typeof ne=="symbol"||typeof ne>"u"}e.isPrimitive=D,e.isBuffer=IR();function H(ne){return Object.prototype.toString.call(ne)}function ee(ne){return ne<10?"0"+ne.toString(10):ne.toString(10)}var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ce(){var ne=new Date,ae=[ee(ne.getHours()),ee(ne.getMinutes()),ee(ne.getSeconds())].join(":");return[ne.getDate(),J[ne.getMonth()],ae].join(" ")}e.log=function(){console.log("%s - %s",ce(),e.format.apply(e,arguments))},e.inherits=Zn(),e._extend=function(ne,ae){if(!ae||!I(ae))return ne;for(var le=Object.keys(ae),oe=le.length;oe--;)ne[le[oe]]=ae[le[oe]];return ne};function be(ne,ae){return Object.prototype.hasOwnProperty.call(ne,ae)}var de=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(ae){if(typeof ae!="function")throw new TypeError('The "original" argument must be of type Function');if(de&&ae[de]){var le=ae[de];if(typeof le!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(le,de,{value:le,enumerable:!1,writable:!1,configurable:!0}),le}function le(){for(var oe,Q,x=new Promise(function(W,U){oe=W,Q=U}),k=[],X=0;X<arguments.length;X++)k.push(arguments[X]);k.push(function(W,U){W?Q(W):oe(U)});try{ae.apply(this,k)}catch(W){Q(W)}return x}return Object.setPrototypeOf(le,Object.getPrototypeOf(ae)),de&&Object.defineProperty(le,de,{value:le,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(le,t(ae))},e.promisify.custom=de;function Se(ne,ae){if(!ne){var le=new Error("Promise was rejected with a falsy value");le.reason=ne,ne=le}return ae(ne)}function Ae(ne){if(typeof ne!="function")throw new TypeError('The "original" argument must be of type Function');function ae(){for(var le=[],oe=0;oe<arguments.length;oe++)le.push(arguments[oe]);var Q=le.pop();if(typeof Q!="function")throw new TypeError("The last argument must be of type Function");var x=this,k=function(){return Q.apply(x,arguments)};ne.apply(this,le).then(function(X){me.nextTick(k.bind(null,null,X))},function(X){me.nextTick(Se.bind(null,X,k))})}return Object.setPrototypeOf(ae,Object.getPrototypeOf(ne)),Object.defineProperties(ae,t(ne)),ae}e.callbackify=Ae}(ic)),ic}var au,mm;function CR(){if(mm)return au;mm=1;function e(E,w){var R=Object.keys(E);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(E);w&&(S=S.filter(function(m){return Object.getOwnPropertyDescriptor(E,m).enumerable})),R.push.apply(R,S)}return R}function t(E){for(var w=1;w<arguments.length;w++){var R=arguments[w]!=null?arguments[w]:{};w%2?e(Object(R),!0).forEach(function(S){r(E,S,R[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(R)):e(Object(R)).forEach(function(S){Object.defineProperty(E,S,Object.getOwnPropertyDescriptor(R,S))})}return E}function r(E,w,R){return w=s(w),w in E?Object.defineProperty(E,w,{value:R,enumerable:!0,configurable:!0,writable:!0}):E[w]=R,E}function n(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function o(E,w){for(var R=0;R<w.length;R++){var S=w[R];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(E,s(S.key),S)}}function i(E,w,R){return w&&o(E.prototype,w),Object.defineProperty(E,"prototype",{writable:!1}),E}function s(E){var w=l(E,"string");return typeof w=="symbol"?w:String(w)}function l(E,w){if(typeof E!="object"||E===null)return E;var R=E[Symbol.toPrimitive];if(R!==void 0){var S=R.call(E,w);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}var c=Is(),u=c.Buffer,a=gm(),f=a.inspect,d=f&&f.custom||"inspect";function b(E,w,R){u.prototype.copy.call(E,w,R)}return au=function(){function E(){n(this,E),this.head=null,this.tail=null,this.length=0}return i(E,[{key:"push",value:function(R){var S={data:R,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length}},{key:"unshift",value:function(R){var S={data:R,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length}},{key:"shift",value:function(){if(this.length!==0){var R=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,R}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(R){if(this.length===0)return"";for(var S=this.head,m=""+S.data;S=S.next;)m+=R+S.data;return m}},{key:"concat",value:function(R){if(this.length===0)return u.alloc(0);for(var S=u.allocUnsafe(R>>>0),m=this.head,g=0;m;)b(m.data,S,g),g+=m.data.length,m=m.next;return S}},{key:"consume",value:function(R,S){var m;return R<this.head.data.length?(m=this.head.data.slice(0,R),this.head.data=this.head.data.slice(R)):R===this.head.data.length?m=this.shift():m=S?this._getString(R):this._getBuffer(R),m}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(R){var S=this.head,m=1,g=S.data;for(R-=g.length;S=S.next;){var v=S.data,T=R>v.length?v.length:R;if(T===v.length?g+=v:g+=v.slice(0,R),R-=T,R===0){T===v.length?(++m,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=v.slice(T));break}++m}return this.length-=m,g}},{key:"_getBuffer",value:function(R){var S=u.allocUnsafe(R),m=this.head,g=1;for(m.data.copy(S),R-=m.data.length;m=m.next;){var v=m.data,T=R>v.length?v.length:R;if(v.copy(S,S.length-R,0,T),R-=T,R===0){T===v.length?(++g,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=v.slice(T));break}++g}return this.length-=g,S}},{key:d,value:function(R,S){return f(this,t(t({},S),{},{depth:0,customInspect:!1}))}}]),E}(),au}var lu,ym;function bm(){if(ym)return lu;ym=1;function e(s,l){var c=this,u=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return u||a?(l?l(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,me.nextTick(o,this,s)):me.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!l&&f?c._writableState?c._writableState.errorEmitted?me.nextTick(r,c):(c._writableState.errorEmitted=!0,me.nextTick(t,c,f)):me.nextTick(t,c,f):l?(me.nextTick(r,c),l(f)):me.nextTick(r,c)}),this)}function t(s,l){o(s,l),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function n(){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 o(s,l){s.emit("error",l)}function i(s,l){var c=s._readableState,u=s._writableState;c&&c.autoDestroy||u&&u.autoDestroy?s.destroy(l):s.emit("error",l)}return lu={destroy:e,undestroy:n,errorOrDestroy:i},lu}var cu={},vm;function xi(){if(vm)return cu;vm=1;function e(l,c){l.prototype=Object.create(c.prototype),l.prototype.constructor=l,l.__proto__=c}var t={};function r(l,c,u){u||(u=Error);function a(d,b,E){return typeof c=="string"?c:c(d,b,E)}var f=function(d){e(b,d);function b(E,w,R){return d.call(this,a(E,w,R))||this}return b}(u);f.prototype.name=u.name,f.prototype.code=l,t[l]=f}function n(l,c){if(Array.isArray(l)){var u=l.length;return l=l.map(function(a){return String(a)}),u>2?"one of ".concat(c," ").concat(l.slice(0,u-1).join(", "),", or ")+l[u-1]:u===2?"one of ".concat(c," ").concat(l[0]," or ").concat(l[1]):"of ".concat(c," ").concat(l[0])}else return"of ".concat(c," ").concat(String(l))}function o(l,c,u){return l.substr(0,c.length)===c}function i(l,c,u){return(u===void 0||u>l.length)&&(u=l.length),l.substring(u-c.length,u)===c}function s(l,c,u){return typeof u!="number"&&(u=0),u+c.length>l.length?!1:l.indexOf(c,u)!==-1}return r("ERR_INVALID_OPT_VALUE",function(l,c){return'The value "'+c+'" is invalid for option "'+l+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(l,c,u){var a;typeof c=="string"&&o(c,"not ")?(a="must not be",c=c.replace(/^not /,"")):a="must be";var f;if(i(l," argument"))f="The ".concat(l," ").concat(a," ").concat(n(c,"type"));else{var d=s(l,".")?"property":"argument";f='The "'.concat(l,'" ').concat(d," ").concat(a," ").concat(n(c,"type"))}return f+=". Received type ".concat(typeof u),f},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),cu.codes=t,cu}var uu,wm;function Sm(){if(wm)return uu;wm=1;var e=xi().codes.ERR_INVALID_OPT_VALUE;function t(n,o,i){return n.highWaterMark!=null?n.highWaterMark:o?n[i]:null}function r(n,o,i,s){var l=t(o,s,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var c=s?i:"highWaterMark";throw new e(c,l)}return Math.floor(l)}return n.objectMode?16:16*1024}return uu={getHighWaterMark:r},uu}var fu,Em;function FR(){if(Em)return fu;Em=1,fu=e;function e(r,n){if(t("noDeprecation"))return r;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),o=!0}return r.apply(this,arguments)}return i}function t(r){try{if(!Cn.localStorage)return!1}catch{return!1}var n=Cn.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return fu}var du,Tm;function Am(){if(Tm)return du;Tm=1,du=C;function e(Q){var x=this;this.next=null,this.entry=null,this.finish=function(){oe(x,Q)}}var t;C.WritableState=A;var r={deprecate:FR()},n=ng(),o=Is().Buffer,i=(typeof Cn<"u"?Cn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(Q){return o.from(Q)}function l(Q){return o.isBuffer(Q)||Q instanceof i}var c=bm(),u=Sm(),a=u.getHighWaterMark,f=xi().codes,d=f.ERR_INVALID_ARG_TYPE,b=f.ERR_METHOD_NOT_IMPLEMENTED,E=f.ERR_MULTIPLE_CALLBACK,w=f.ERR_STREAM_CANNOT_PIPE,R=f.ERR_STREAM_DESTROYED,S=f.ERR_STREAM_NULL_VALUES,m=f.ERR_STREAM_WRITE_AFTER_END,g=f.ERR_UNKNOWN_ENCODING,v=c.errorOrDestroy;Zn()(C,n);function T(){}function A(Q,x,k){t=t||Oi(),Q=Q||{},typeof k!="boolean"&&(k=x instanceof t),this.objectMode=!!Q.objectMode,k&&(this.objectMode=this.objectMode||!!Q.writableObjectMode),this.highWaterMark=a(this,Q,"writableHighWaterMark",k),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=Q.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=Q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(W){J(x,W)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Q.emitClose!==!1,this.autoDestroy=!!Q.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}A.prototype.getBuffer=function(){for(var x=this.bufferedRequest,k=[];x;)k.push(x),x=x.next;return k},function(){try{Object.defineProperty(A.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var F;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(x){return F.call(this,x)?!0:this!==C?!1:x&&x._writableState instanceof A}})):F=function(x){return x instanceof this};function C(Q){t=t||Oi();var x=this instanceof t;if(!x&&!F.call(C,this))return new C(Q);this._writableState=new A(Q,this,x),this.writable=!0,Q&&(typeof Q.write=="function"&&(this._write=Q.write),typeof Q.writev=="function"&&(this._writev=Q.writev),typeof Q.destroy=="function"&&(this._destroy=Q.destroy),typeof Q.final=="function"&&(this._final=Q.final)),n.call(this)}C.prototype.pipe=function(){v(this,new w)};function I(Q,x){var k=new m;v(Q,k),me.nextTick(x,k)}function L(Q,x,k,X){var W;return k===null?W=new S:typeof k!="string"&&!x.objectMode&&(W=new d("chunk",["string","Buffer"],k)),W?(v(Q,W),me.nextTick(X,W),!1):!0}C.prototype.write=function(Q,x,k){var X=this._writableState,W=!1,U=!X.objectMode&&l(Q);return U&&!o.isBuffer(Q)&&(Q=s(Q)),typeof x=="function"&&(k=x,x=null),U?x="buffer":x||(x=X.defaultEncoding),typeof k!="function"&&(k=T),X.ending?I(this,k):(U||L(this,X,Q,k))&&(X.pendingcb++,W=$(this,X,U,Q,x,k)),W},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var Q=this._writableState;Q.corked&&(Q.corked--,!Q.writing&&!Q.corked&&!Q.bufferProcessing&&Q.bufferedRequest&&de(this,Q))},C.prototype.setDefaultEncoding=function(x){if(typeof x=="string"&&(x=x.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((x+"").toLowerCase())>-1))throw new g(x);return this._writableState.defaultEncoding=x,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function B(Q,x,k){return!Q.objectMode&&Q.decodeStrings!==!1&&typeof x=="string"&&(x=o.from(x,k)),x}Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(Q,x,k,X,W,U){if(!k){var z=B(x,X,W);X!==z&&(k=!0,W="buffer",X=z)}var fe=x.objectMode?1:X.length;x.length+=fe;var _e=x.length<x.highWaterMark;if(_e||(x.needDrain=!0),x.writing||x.corked){var Be=x.lastBufferedRequest;x.lastBufferedRequest={chunk:X,encoding:W,isBuf:k,callback:U,next:null},Be?Be.next=x.lastBufferedRequest:x.bufferedRequest=x.lastBufferedRequest,x.bufferedRequestCount+=1}else D(Q,x,!1,fe,X,W,U);return _e}function D(Q,x,k,X,W,U,z){x.writelen=X,x.writecb=z,x.writing=!0,x.sync=!0,x.destroyed?x.onwrite(new R("write")):k?Q._writev(W,x.onwrite):Q._write(W,U,x.onwrite),x.sync=!1}function H(Q,x,k,X,W){--x.pendingcb,k?(me.nextTick(W,X),me.nextTick(ae,Q,x),Q._writableState.errorEmitted=!0,v(Q,X)):(W(X),Q._writableState.errorEmitted=!0,v(Q,X),ae(Q,x))}function ee(Q){Q.writing=!1,Q.writecb=null,Q.length-=Q.writelen,Q.writelen=0}function J(Q,x){var k=Q._writableState,X=k.sync,W=k.writecb;if(typeof W!="function")throw new E;if(ee(k),x)H(Q,k,X,x,W);else{var U=Se(k)||Q.destroyed;!U&&!k.corked&&!k.bufferProcessing&&k.bufferedRequest&&de(Q,k),X?me.nextTick(ce,Q,k,U,W):ce(Q,k,U,W)}}function ce(Q,x,k,X){k||be(Q,x),x.pendingcb--,X(),ae(Q,x)}function be(Q,x){x.length===0&&x.needDrain&&(x.needDrain=!1,Q.emit("drain"))}function de(Q,x){x.bufferProcessing=!0;var k=x.bufferedRequest;if(Q._writev&&k&&k.next){var X=x.bufferedRequestCount,W=new Array(X),U=x.corkedRequestsFree;U.entry=k;for(var z=0,fe=!0;k;)W[z]=k,k.isBuf||(fe=!1),k=k.next,z+=1;W.allBuffers=fe,D(Q,x,!0,x.length,W,"",U.finish),x.pendingcb++,x.lastBufferedRequest=null,U.next?(x.corkedRequestsFree=U.next,U.next=null):x.corkedRequestsFree=new e(x),x.bufferedRequestCount=0}else{for(;k;){var _e=k.chunk,Be=k.encoding,Fe=k.callback,Pe=x.objectMode?1:_e.length;if(D(Q,x,!1,Pe,_e,Be,Fe),k=k.next,x.bufferedRequestCount--,x.writing)break}k===null&&(x.lastBufferedRequest=null)}x.bufferedRequest=k,x.bufferProcessing=!1}C.prototype._write=function(Q,x,k){k(new b("_write()"))},C.prototype._writev=null,C.prototype.end=function(Q,x,k){var X=this._writableState;return typeof Q=="function"?(k=Q,Q=null,x=null):typeof x=="function"&&(k=x,x=null),Q!=null&&this.write(Q,x),X.corked&&(X.corked=1,this.uncork()),X.ending||le(this,X,k),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Se(Q){return Q.ending&&Q.length===0&&Q.bufferedRequest===null&&!Q.finished&&!Q.writing}function Ae(Q,x){Q._final(function(k){x.pendingcb--,k&&v(Q,k),x.prefinished=!0,Q.emit("prefinish"),ae(Q,x)})}function ne(Q,x){!x.prefinished&&!x.finalCalled&&(typeof Q._final=="function"&&!x.destroyed?(x.pendingcb++,x.finalCalled=!0,me.nextTick(Ae,Q,x)):(x.prefinished=!0,Q.emit("prefinish")))}function ae(Q,x){var k=Se(x);if(k&&(ne(Q,x),x.pendingcb===0&&(x.finished=!0,Q.emit("finish"),x.autoDestroy))){var X=Q._readableState;(!X||X.autoDestroy&&X.endEmitted)&&Q.destroy()}return k}function le(Q,x,k){x.ending=!0,ae(Q,x),k&&(x.finished?me.nextTick(k):Q.once("finish",k)),x.ended=!0,Q.writable=!1}function oe(Q,x,k){var X=Q.entry;for(Q.entry=null;X;){var W=X.callback;x.pendingcb--,W(k),X=X.next}x.corkedRequestsFree.next=Q}return Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(x){this._writableState&&(this._writableState.destroyed=x)}}),C.prototype.destroy=c.destroy,C.prototype._undestroy=c.undestroy,C.prototype._destroy=function(Q,x){x(Q)},du}var pu,Rm;function Oi(){if(Rm)return pu;Rm=1;var e=Object.keys||function(u){var a=[];for(var f in u)a.push(f);return a};pu=s;var t=Om(),r=Am();Zn()(s,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];s.prototype[i]||(s.prototype[i]=r.prototype[i])}function s(u){if(!(this instanceof s))return new s(u);t.call(this,u),r.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",l)))}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 l(){this._writableState.ended||me.nextTick(c,this)}function c(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(a){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=a,this._writableState.destroyed=a)}}),pu}var hu={},Ps={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var _m;function PR(){return _m||(_m=1,function(e,t){var r=Is(),n=r.Buffer;function o(s,l){for(var c in s)l[c]=s[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(s,l,c){return n(s,l,c)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(s,l,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,l,c)},i.alloc=function(s,l,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=n(s);return l!==void 0?typeof c=="string"?u.fill(l,c):u.fill(l):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}(Ps,Ps.exports)),Ps.exports}var Im;function gu(){if(Im)return hu;Im=1;var e=PR().Buffer,t=e.isEncoding||function(S){switch(S=""+S,S&&S.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 r(S){if(!S)return"utf8";for(var m;;)switch(S){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 S;default:if(m)return;S=(""+S).toLowerCase(),m=!0}}function n(S){var m=r(S);if(typeof m!="string"&&(e.isEncoding===t||!t(S)))throw new Error("Unknown encoding: "+S);return m||S}hu.StringDecoder=o;function o(S){this.encoding=n(S);var m;switch(this.encoding){case"utf16le":this.text=f,this.end=d,m=4;break;case"utf8":this.fillLast=c,m=4;break;case"base64":this.text=b,this.end=E,m=3;break;default:this.write=w,this.end=R;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(m)}o.prototype.write=function(S){if(S.length===0)return"";var m,g;if(this.lastNeed){if(m=this.fillLast(S),m===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;return g<S.length?m?m+this.text(S,g):this.text(S,g):m||""},o.prototype.end=a,o.prototype.text=u,o.prototype.fillLast=function(S){if(this.lastNeed<=S.length)return S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,S.length),this.lastNeed-=S.length};function i(S){return S<=127?0:S>>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function s(S,m,g){var v=m.length-1;if(v<g)return 0;var T=i(m[v]);return T>=0?(T>0&&(S.lastNeed=T-1),T):--v<g||T===-2?0:(T=i(m[v]),T>=0?(T>0&&(S.lastNeed=T-2),T):--v<g||T===-2?0:(T=i(m[v]),T>=0?(T>0&&(T===2?T=0:S.lastNeed=T-3),T):0))}function l(S,m,g){if((m[0]&192)!==128)return S.lastNeed=0,"�";if(S.lastNeed>1&&m.length>1){if((m[1]&192)!==128)return S.lastNeed=1,"�";if(S.lastNeed>2&&m.length>2&&(m[2]&192)!==128)return S.lastNeed=2,"�"}}function c(S){var m=this.lastTotal-this.lastNeed,g=l(this,S);if(g!==void 0)return g;if(this.lastNeed<=S.length)return S.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,m,0,S.length),this.lastNeed-=S.length}function u(S,m){var g=s(this,S,m);if(!this.lastNeed)return S.toString("utf8",m);this.lastTotal=g;var v=S.length-(g-this.lastNeed);return S.copy(this.lastChar,0,v),S.toString("utf8",m,v)}function a(S){var m=S&&S.length?this.write(S):"";return this.lastNeed?m+"�":m}function f(S,m){if((S.length-m)%2===0){var g=S.toString("utf16le",m);if(g){var v=g.charCodeAt(g.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",m,S.length-1)}function d(S){var m=S&&S.length?this.write(S):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,g)}return m}function b(S,m){var g=(S.length-m)%3;return g===0?S.toString("base64",m):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",m,S.length-g))}function E(S){var m=S&&S.length?this.write(S):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function w(S){return S.toString(this.encoding)}function R(S){return S&&S.length?this.write(S):""}return hu}var mu,Cm;function yu(){if(Cm)return mu;Cm=1;var e=xi().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var s=!1;return function(){if(!s){s=!0;for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];i.apply(this,c)}}}function r(){}function n(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,l){if(typeof s=="function")return o(i,null,s);s||(s={}),l=t(l||r);var c=s.readable||s.readable!==!1&&i.readable,u=s.writable||s.writable!==!1&&i.writable,a=function(){i.writable||d()},f=i._writableState&&i._writableState.finished,d=function(){u=!1,f=!0,c||l.call(i)},b=i._readableState&&i._readableState.endEmitted,E=function(){c=!1,b=!0,u||l.call(i)},w=function(g){l.call(i,g)},R=function(){var g;if(c&&!b)return(!i._readableState||!i._readableState.ended)&&(g=new e),l.call(i,g);if(u&&!f)return(!i._writableState||!i._writableState.ended)&&(g=new e),l.call(i,g)},S=function(){i.req.on("finish",d)};return n(i)?(i.on("complete",d),i.on("abort",R),i.req?S():i.on("request",S)):u&&!i._writableState&&(i.on("end",a),i.on("close",a)),i.on("end",E),i.on("finish",d),s.error!==!1&&i.on("error",w),i.on("close",R),function(){i.removeListener("complete",d),i.removeListener("abort",R),i.removeListener("request",S),i.req&&i.req.removeListener("finish",d),i.removeListener("end",a),i.removeListener("close",a),i.removeListener("finish",d),i.removeListener("end",E),i.removeListener("error",w),i.removeListener("close",R)}}return mu=o,mu}var bu,Fm;function xR(){if(Fm)return bu;Fm=1;var e;function t(g,v,T){return v=r(v),v in g?Object.defineProperty(g,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):g[v]=T,g}function r(g){var v=n(g,"string");return typeof v=="symbol"?v:String(v)}function n(g,v){if(typeof g!="object"||g===null)return g;var T=g[Symbol.toPrimitive];if(T!==void 0){var A=T.call(g,v);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(g)}var o=yu(),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),a=Symbol("handlePromise"),f=Symbol("stream");function d(g,v){return{value:g,done:v}}function b(g){var v=g[i];if(v!==null){var T=g[f].read();T!==null&&(g[u]=null,g[i]=null,g[s]=null,v(d(T,!1)))}}function E(g){me.nextTick(b,g)}function w(g,v){return function(T,A){g.then(function(){if(v[c]){T(d(void 0,!0));return}v[a](T,A)},A)}}var R=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var v=this,T=this[l];if(T!==null)return Promise.reject(T);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(I,L){me.nextTick(function(){v[l]?L(v[l]):I(d(void 0,!0))})});var A=this[u],F;if(A)F=new Promise(w(A,this));else{var C=this[f].read();if(C!==null)return Promise.resolve(d(C,!1));F=new Promise(this[a])}return this[u]=F,F}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var v=this;return new Promise(function(T,A){v[f].destroy(null,function(F){if(F){A(F);return}T(d(void 0,!0))})})}),e),R),m=function(v){var T,A=Object.create(S,(T={},t(T,f,{value:v,writable:!0}),t(T,i,{value:null,writable:!0}),t(T,s,{value:null,writable:!0}),t(T,l,{value:null,writable:!0}),t(T,c,{value:v._readableState.endEmitted,writable:!0}),t(T,a,{value:function(C,I){var L=A[f].read();L?(A[u]=null,A[i]=null,A[s]=null,C(d(L,!1))):(A[i]=C,A[s]=I)},writable:!0}),T));return A[u]=null,o(v,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var C=A[s];C!==null&&(A[u]=null,A[i]=null,A[s]=null,C(F)),A[l]=F;return}var I=A[i];I!==null&&(A[u]=null,A[i]=null,A[s]=null,I(d(void 0,!0))),A[c]=!0}),v.on("readable",E.bind(null,A)),A};return bu=m,bu}var vu,Pm;function OR(){return Pm||(Pm=1,vu=function(){throw new Error("Readable.from is not available in the browser")}),vu}var wu,xm;function Om(){if(xm)return wu;xm=1,wu=I;var e;I.ReadableState=C,tc().EventEmitter;var t=function(z,fe){return z.listeners(fe).length},r=ng(),n=Is().Buffer,o=(typeof Cn<"u"?Cn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(U){return n.from(U)}function s(U){return n.isBuffer(U)||U instanceof o}var l=gm(),c;l&&l.debuglog?c=l.debuglog("stream"):c=function(){};var u=CR(),a=bm(),f=Sm(),d=f.getHighWaterMark,b=xi().codes,E=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,R=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,m,g,v;Zn()(I,r);var T=a.errorOrDestroy,A=["error","close","destroy","pause","resume"];function F(U,z,fe){if(typeof U.prependListener=="function")return U.prependListener(z,fe);!U._events||!U._events[z]?U.on(z,fe):Array.isArray(U._events[z])?U._events[z].unshift(fe):U._events[z]=[fe,U._events[z]]}function C(U,z,fe){e=e||Oi(),U=U||{},typeof fe!="boolean"&&(fe=z instanceof e),this.objectMode=!!U.objectMode,fe&&(this.objectMode=this.objectMode||!!U.readableObjectMode),this.highWaterMark=d(this,U,"readableHighWaterMark",fe),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=U.emitClose!==!1,this.autoDestroy=!!U.autoDestroy,this.destroyed=!1,this.defaultEncoding=U.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,U.encoding&&(m||(m=gu().StringDecoder),this.decoder=new m(U.encoding),this.encoding=U.encoding)}function I(U){if(e=e||Oi(),!(this instanceof I))return new I(U);var z=this instanceof e;this._readableState=new C(U,this,z),this.readable=!0,U&&(typeof U.read=="function"&&(this._read=U.read),typeof U.destroy=="function"&&(this._destroy=U.destroy)),r.call(this)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(z){this._readableState&&(this._readableState.destroyed=z)}}),I.prototype.destroy=a.destroy,I.prototype._undestroy=a.undestroy,I.prototype._destroy=function(U,z){z(U)},I.prototype.push=function(U,z){var fe=this._readableState,_e;return fe.objectMode?_e=!0:typeof U=="string"&&(z=z||fe.defaultEncoding,z!==fe.encoding&&(U=n.from(U,z),z=""),_e=!0),L(this,U,z,!1,_e)},I.prototype.unshift=function(U){return L(this,U,null,!0,!1)};function L(U,z,fe,_e,Be){c("readableAddChunk",z);var Fe=U._readableState;if(z===null)Fe.reading=!1,J(U,Fe);else{var Pe;if(Be||(Pe=$(Fe,z)),Pe)T(U,Pe);else if(Fe.objectMode||z&&z.length>0)if(typeof z!="string"&&!Fe.objectMode&&Object.getPrototypeOf(z)!==n.prototype&&(z=i(z)),_e)Fe.endEmitted?T(U,new S):B(U,Fe,z,!0);else if(Fe.ended)T(U,new w);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!fe?(z=Fe.decoder.write(z),Fe.objectMode||z.length!==0?B(U,Fe,z,!1):de(U,Fe)):B(U,Fe,z,!1)}else _e||(Fe.reading=!1,de(U,Fe))}return!Fe.ended&&(Fe.length<Fe.highWaterMark||Fe.length===0)}function B(U,z,fe,_e){z.flowing&&z.length===0&&!z.sync?(z.awaitDrain=0,U.emit("data",fe)):(z.length+=z.objectMode?1:fe.length,_e?z.buffer.unshift(fe):z.buffer.push(fe),z.needReadable&&ce(U)),de(U,z)}function $(U,z){var fe;return!s(z)&&typeof z!="string"&&z!==void 0&&!U.objectMode&&(fe=new E("chunk",["string","Buffer","Uint8Array"],z)),fe}I.prototype.isPaused=function(){return this._readableState.flowing===!1},I.prototype.setEncoding=function(U){m||(m=gu().StringDecoder);var z=new m(U);this._readableState.decoder=z,this._readableState.encoding=this._readableState.decoder.encoding;for(var fe=this._readableState.buffer.head,_e="";fe!==null;)_e+=z.write(fe.data),fe=fe.next;return this._readableState.buffer.clear(),_e!==""&&this._readableState.buffer.push(_e),this._readableState.length=_e.length,this};var D=1073741824;function H(U){return U>=D?U=D:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}function ee(U,z){return U<=0||z.length===0&&z.ended?0:z.objectMode?1:U!==U?z.flowing&&z.length?z.buffer.head.data.length:z.length:(U>z.highWaterMark&&(z.highWaterMark=H(U)),U<=z.length?U:z.ended?z.length:(z.needReadable=!0,0))}I.prototype.read=function(U){c("read",U),U=parseInt(U,10);var z=this._readableState,fe=U;if(U!==0&&(z.emittedReadable=!1),U===0&&z.needReadable&&((z.highWaterMark!==0?z.length>=z.highWaterMark:z.length>0)||z.ended))return c("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?k(this):ce(this),null;if(U=ee(U,z),U===0&&z.ended)return z.length===0&&k(this),null;var _e=z.needReadable;c("need readable",_e),(z.length===0||z.length-U<z.highWaterMark)&&(_e=!0,c("length less than watermark",_e)),z.ended||z.reading?(_e=!1,c("reading or ended",_e)):_e&&(c("do read"),z.reading=!0,z.sync=!0,z.length===0&&(z.needReadable=!0),this._read(z.highWaterMark),z.sync=!1,z.reading||(U=ee(fe,z)));var Be;return U>0?Be=x(U,z):Be=null,Be===null?(z.needReadable=z.length<=z.highWaterMark,U=0):(z.length-=U,z.awaitDrain=0),z.length===0&&(z.ended||(z.needReadable=!0),fe!==U&&z.ended&&k(this)),Be!==null&&this.emit("data",Be),Be};function J(U,z){if(c("onEofChunk"),!z.ended){if(z.decoder){var fe=z.decoder.end();fe&&fe.length&&(z.buffer.push(fe),z.length+=z.objectMode?1:fe.length)}z.ended=!0,z.sync?ce(U):(z.needReadable=!1,z.emittedReadable||(z.emittedReadable=!0,be(U)))}}function ce(U){var z=U._readableState;c("emitReadable",z.needReadable,z.emittedReadable),z.needReadable=!1,z.emittedReadable||(c("emitReadable",z.flowing),z.emittedReadable=!0,me.nextTick(be,U))}function be(U){var z=U._readableState;c("emitReadable_",z.destroyed,z.length,z.ended),!z.destroyed&&(z.length||z.ended)&&(U.emit("readable"),z.emittedReadable=!1),z.needReadable=!z.flowing&&!z.ended&&z.length<=z.highWaterMark,Q(U)}function de(U,z){z.readingMore||(z.readingMore=!0,me.nextTick(Se,U,z))}function Se(U,z){for(;!z.reading&&!z.ended&&(z.length<z.highWaterMark||z.flowing&&z.length===0);){var fe=z.length;if(c("maybeReadMore read 0"),U.read(0),fe===z.length)break}z.readingMore=!1}I.prototype._read=function(U){T(this,new R("_read()"))},I.prototype.pipe=function(U,z){var fe=this,_e=this._readableState;switch(_e.pipesCount){case 0:_e.pipes=U;break;case 1:_e.pipes=[_e.pipes,U];break;default:_e.pipes.push(U);break}_e.pipesCount+=1,c("pipe count=%d opts=%j",_e.pipesCount,z);var Be=(!z||z.end!==!1)&&U!==me.stdout&&U!==me.stderr,Fe=Be?je:Ut;_e.endEmitted?me.nextTick(Fe):fe.once("end",Fe),U.on("unpipe",Pe);function Pe(nr,lt){c("onunpipe"),nr===fe&&lt&&lt.hasUnpiped===!1&&(lt.hasUnpiped=!0,qe())}function je(){c("onend"),U.end()}var te=Ae(fe);U.on("drain",te);var Le=!1;function qe(){c("cleanup"),U.removeListener("close",vt),U.removeListener("finish",et),U.removeListener("drain",te),U.removeListener("error",Ze),U.removeListener("unpipe",Pe),fe.removeListener("end",je),fe.removeListener("end",Ut),fe.removeListener("data",ze),Le=!0,_e.awaitDrain&&(!U._writableState||U._writableState.needDrain)&&te()}fe.on("data",ze);function ze(nr){c("ondata");var lt=U.write(nr);c("dest.write",lt),lt===!1&&((_e.pipesCount===1&&_e.pipes===U||_e.pipesCount>1&&W(_e.pipes,U)!==-1)&&!Le&&(c("false write response, pause",_e.awaitDrain),_e.awaitDrain++),fe.pause())}function Ze(nr){c("onerror",nr),Ut(),U.removeListener("error",Ze),t(U,"error")===0&&T(U,nr)}F(U,"error",Ze);function vt(){U.removeListener("finish",et),Ut()}U.once("close",vt);function et(){c("onfinish"),U.removeListener("close",vt),Ut()}U.once("finish",et);function Ut(){c("unpipe"),fe.unpipe(U)}return U.emit("pipe",fe),_e.flowing||(c("pipe resume"),fe.resume()),U};function Ae(U){return function(){var fe=U._readableState;c("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&t(U,"data")&&(fe.flowing=!0,Q(U))}}I.prototype.unpipe=function(U){var z=this._readableState,fe={hasUnpiped:!1};if(z.pipesCount===0)return this;if(z.pipesCount===1)return U&&U!==z.pipes?this:(U||(U=z.pipes),z.pipes=null,z.pipesCount=0,z.flowing=!1,U&&U.emit("unpipe",this,fe),this);if(!U){var _e=z.pipes,Be=z.pipesCount;z.pipes=null,z.pipesCount=0,z.flowing=!1;for(var Fe=0;Fe<Be;Fe++)_e[Fe].emit("unpipe",this,{hasUnpiped:!1});return this}var Pe=W(z.pipes,U);return Pe===-1?this:(z.pipes.splice(Pe,1),z.pipesCount-=1,z.pipesCount===1&&(z.pipes=z.pipes[0]),U.emit("unpipe",this,fe),this)},I.prototype.on=function(U,z){var fe=r.prototype.on.call(this,U,z),_e=this._readableState;return U==="data"?(_e.readableListening=this.listenerCount("readable")>0,_e.flowing!==!1&&this.resume()):U==="readable"&&!_e.endEmitted&&!_e.readableListening&&(_e.readableListening=_e.needReadable=!0,_e.flowing=!1,_e.emittedReadable=!1,c("on readable",_e.length,_e.reading),_e.length?ce(this):_e.reading||me.nextTick(ae,this)),fe},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(U,z){var fe=r.prototype.removeListener.call(this,U,z);return U==="readable"&&me.nextTick(ne,this),fe},I.prototype.removeAllListeners=function(U){var z=r.prototype.removeAllListeners.apply(this,arguments);return(U==="readable"||U===void 0)&&me.nextTick(ne,this),z};function ne(U){var z=U._readableState;z.readableListening=U.listenerCount("readable")>0,z.resumeScheduled&&!z.paused?z.flowing=!0:U.listenerCount("data")>0&&U.resume()}function ae(U){c("readable nexttick read 0"),U.read(0)}I.prototype.resume=function(){var U=this._readableState;return U.flowing||(c("resume"),U.flowing=!U.readableListening,le(this,U)),U.paused=!1,this};function le(U,z){z.resumeScheduled||(z.resumeScheduled=!0,me.nextTick(oe,U,z))}function oe(U,z){c("resume",z.reading),z.reading||U.read(0),z.resumeScheduled=!1,U.emit("resume"),Q(U),z.flowing&&!z.reading&&U.read(0)}I.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Q(U){var z=U._readableState;for(c("flow",z.flowing);z.flowing&&U.read()!==null;);}I.prototype.wrap=function(U){var z=this,fe=this._readableState,_e=!1;U.on("end",function(){if(c("wrapped end"),fe.decoder&&!fe.ended){var Pe=fe.decoder.end();Pe&&Pe.length&&z.push(Pe)}z.push(null)}),U.on("data",function(Pe){if(c("wrapped data"),fe.decoder&&(Pe=fe.decoder.write(Pe)),!(fe.objectMode&&Pe==null)&&!(!fe.objectMode&&(!Pe||!Pe.length))){var je=z.push(Pe);je||(_e=!0,U.pause())}});for(var Be in U)this[Be]===void 0&&typeof U[Be]=="function"&&(this[Be]=function(je){return function(){return U[je].apply(U,arguments)}}(Be));for(var Fe=0;Fe<A.length;Fe++)U.on(A[Fe],this.emit.bind(this,A[Fe]));return this._read=function(Pe){c("wrapped _read",Pe),_e&&(_e=!1,U.resume())},this},typeof Symbol=="function"&&(I.prototype[Symbol.asyncIterator]=function(){return g===void 0&&(g=xR()),g(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(z){this._readableState&&(this._readableState.flowing=z)}}),I._fromList=x,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function x(U,z){if(z.length===0)return null;var fe;return z.objectMode?fe=z.buffer.shift():!U||U>=z.length?(z.decoder?fe=z.buffer.join(""):z.buffer.length===1?fe=z.buffer.first():fe=z.buffer.concat(z.length),z.buffer.clear()):fe=z.buffer.consume(U,z.decoder),fe}function k(U){var z=U._readableState;c("endReadable",z.endEmitted),z.endEmitted||(z.ended=!0,me.nextTick(X,z,U))}function X(U,z){if(c("endReadableNT",U.endEmitted,U.length),!U.endEmitted&&U.length===0&&(U.endEmitted=!0,z.readable=!1,z.emit("end"),U.autoDestroy)){var fe=z._writableState;(!fe||fe.autoDestroy&&fe.finished)&&z.destroy()}}typeof Symbol=="function"&&(I.from=function(U,z){return v===void 0&&(v=OR()),v(I,U,z)});function W(U,z){for(var fe=0,_e=U.length;fe<_e;fe++)if(U[fe]===z)return fe;return-1}return wu}var Su,km;function Nm(){if(km)return Su;km=1,Su=l;var e=xi().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=Oi();Zn()(l,i);function s(a,f){var d=this._transformState;d.transforming=!1;var b=d.writecb;if(b===null)return this.emit("error",new r);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),b(a);var E=this._readableState;E.reading=!1,(E.needReadable||E.length<E.highWaterMark)&&this._read(E.highWaterMark)}function l(a){if(!(this instanceof l))return new l(a);i.call(this,a),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",c)}function c(){var a=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,d){u(a,f,d)}):u(this,null,null)}l.prototype.push=function(a,f){return this._transformState.needTransform=!1,i.prototype.push.call(this,a,f)},l.prototype._transform=function(a,f,d){d(new t("_transform()"))},l.prototype._write=function(a,f,d){var b=this._transformState;if(b.writecb=d,b.writechunk=a,b.writeencoding=f,!b.transforming){var E=this._readableState;(b.needTransform||E.needReadable||E.length<E.highWaterMark)&&this._read(E.highWaterMark)}},l.prototype._read=function(a){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},l.prototype._destroy=function(a,f){i.prototype._destroy.call(this,a,function(d){f(d)})};function u(a,f,d){if(f)return a.emit("error",f);if(d!=null&&a.push(d),a._writableState.length)throw new o;if(a._transformState.transforming)throw new n;return a.push(null)}return Su}var Eu,$m;function kR(){if($m)return Eu;$m=1,Eu=t;var e=Nm();Zn()(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,n,o){o(null,r)},Eu}var Tu,Dm;function NR(){if(Dm)return Tu;Dm=1;var e;function t(d){var b=!1;return function(){b||(b=!0,d.apply(void 0,arguments))}}var r=xi().codes,n=r.ERR_MISSING_ARGS,o=r.ERR_STREAM_DESTROYED;function i(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function l(d,b,E,w){w=t(w);var R=!1;d.on("close",function(){R=!0}),e===void 0&&(e=yu()),e(d,{readable:b,writable:E},function(m){if(m)return w(m);R=!0,w()});var S=!1;return function(m){if(!R&&!S){if(S=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();w(m||new o("pipe"))}}}function c(d){d()}function u(d,b){return d.pipe(b)}function a(d){return!d.length||typeof d[d.length-1]!="function"?i:d.pop()}function f(){for(var d=arguments.length,b=new Array(d),E=0;E<d;E++)b[E]=arguments[E];var w=a(b);if(Array.isArray(b[0])&&(b=b[0]),b.length<2)throw new n("streams");var R,S=b.map(function(m,g){var v=g<b.length-1,T=g>0;return l(m,v,T,function(A){R||(R=A),A&&S.forEach(c),!v&&(S.forEach(c),w(R))})});return b.reduce(u)}return Tu=f,Tu}var Au,Lm;function $R(){if(Lm)return Au;Lm=1,Au=r;var e=tc().EventEmitter,t=Zn();t(r,e),r.Readable=Om(),r.Writable=Am(),r.Duplex=Oi(),r.Transform=Nm(),r.PassThrough=kR(),r.finished=yu(),r.pipeline=NR(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,o){var i=this;function s(b){n.writable&&n.write(b)===!1&&i.pause&&i.pause()}i.on("data",s);function l(){i.readable&&i.resume&&i.resume()}n.on("drain",l),!n._isStdio&&(!o||o.end!==!1)&&(i.on("end",u),i.on("close",a));var c=!1;function u(){c||(c=!0,n.end())}function a(){c||(c=!0,typeof n.destroy=="function"&&n.destroy())}function f(b){if(d(),e.listenerCount(this,"error")===0)throw b}i.on("error",f),n.on("error",f);function d(){i.removeListener("data",s),n.removeListener("drain",l),i.removeListener("end",u),i.removeListener("close",a),i.removeListener("error",f),n.removeListener("error",f),i.removeListener("end",d),i.removeListener("close",d),n.removeListener("close",d)}return i.on("end",d),i.on("close",d),n.on("close",d),n.emit("pipe",i),n},Au}var Bm;function DR(){return Bm||(Bm=1,function(e){(function(t){t.parser=function(x,k){return new n(x,k)},t.SAXParser=n,t.SAXStream=a,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var r=["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 n(x,k){if(!(this instanceof n))return new n(x,k);var X=this;i(X),X.q=X.c="",X.bufferCheckPosition=t.MAX_BUFFER_LENGTH,X.opt=k||{},X.opt.lowercase=X.opt.lowercase||X.opt.lowercasetags,X.looseCase=X.opt.lowercase?"toLowerCase":"toUpperCase",X.tags=[],X.closed=X.closedRoot=X.sawRoot=!1,X.tag=X.error=null,X.strict=!!x,X.noscript=!!(x||X.opt.noscript),X.state=I.BEGIN,X.strictEntities=X.opt.strictEntities,X.ENTITIES=X.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),X.attribList=[],X.opt.xmlns&&(X.ns=Object.create(w)),X.opt.unquotedAttributeValues===void 0&&(X.opt.unquotedAttributeValues=!x),X.trackPosition=X.opt.position!==!1,X.trackPosition&&(X.position=X.line=X.column=0),B(X,"onready")}Object.create||(Object.create=function(x){function k(){}k.prototype=x;var X=new k;return X}),Object.keys||(Object.keys=function(x){var k=[];for(var X in x)x.hasOwnProperty(X)&&k.push(X);return k});function o(x){for(var k=Math.max(t.MAX_BUFFER_LENGTH,10),X=0,W=0,U=r.length;W<U;W++){var z=x[r[W]].length;if(z>k)switch(r[W]){case"textNode":D(x);break;case"cdata":$(x,"oncdata",x.cdata),x.cdata="";break;case"script":$(x,"onscript",x.script),x.script="";break;default:ee(x,"Max buffer length exceeded: "+r[W])}X=Math.max(X,z)}var fe=t.MAX_BUFFER_LENGTH-X;x.bufferCheckPosition=fe+x.position}function i(x){for(var k=0,X=r.length;k<X;k++)x[r[k]]=""}function s(x){D(x),x.cdata!==""&&($(x,"oncdata",x.cdata),x.cdata=""),x.script!==""&&($(x,"onscript",x.script),x.script="")}n.prototype={end:function(){J(this)},write:Q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var l;try{l=$R().Stream}catch{l=function(){}}l||(l=function(){});var c=t.EVENTS.filter(function(x){return x!=="error"&&x!=="end"});function u(x,k){return new a(x,k)}function a(x,k){if(!(this instanceof a))return new a(x,k);l.apply(this),this._parser=new n(x,k),this.writable=!0,this.readable=!0;var X=this;this._parser.onend=function(){X.emit("end")},this._parser.onerror=function(W){X.emit("error",W),X._parser.error=null},this._decoder=null,c.forEach(function(W){Object.defineProperty(X,"on"+W,{get:function(){return X._parser["on"+W]},set:function(U){if(!U)return X.removeAllListeners(W),X._parser["on"+W]=U,U;X.on(W,U)},enumerable:!0,configurable:!1})})}a.prototype=Object.create(l.prototype,{constructor:{value:a}}),a.prototype.write=function(x){if(typeof As=="function"&&typeof As.isBuffer=="function"&&As.isBuffer(x)){if(!this._decoder){var k=gu().StringDecoder;this._decoder=new k("utf8")}x=this._decoder.write(x)}return this._parser.write(x.toString()),this.emit("data",x),!0},a.prototype.end=function(x){return x&&x.length&&this.write(x),this._parser.end(),!0},a.prototype.on=function(x,k){var X=this;return!X._parser["on"+x]&&c.indexOf(x)!==-1&&(X._parser["on"+x]=function(){var W=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);W.splice(0,0,x),X.emit.apply(X,W)}),l.prototype.on.call(X,x,k)};var f="[CDATA[",d="DOCTYPE",b="http://www.w3.org/XML/1998/namespace",E="http://www.w3.org/2000/xmlns/",w={xml:b,xmlns:E},R=/[:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,m=/[#:_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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function v(x){return x===" "||x===`
31
- `||x==="\r"||x===" "}function T(x){return x==='"'||x==="'"}function A(x){return x===">"||v(x)}function F(x,k){return x.test(k)}function C(x,k){return!F(x,k)}var I=0;t.STATE={BEGIN:I++,BEGIN_WHITESPACE:I++,TEXT:I++,TEXT_ENTITY:I++,OPEN_WAKA:I++,SGML_DECL:I++,SGML_DECL_QUOTED:I++,DOCTYPE:I++,DOCTYPE_QUOTED:I++,DOCTYPE_DTD:I++,DOCTYPE_DTD_QUOTED:I++,COMMENT_STARTING:I++,COMMENT:I++,COMMENT_ENDING:I++,COMMENT_ENDED:I++,CDATA:I++,CDATA_ENDING:I++,CDATA_ENDING_2:I++,PROC_INST:I++,PROC_INST_BODY:I++,PROC_INST_ENDING:I++,OPEN_TAG:I++,OPEN_TAG_SLASH:I++,ATTRIB:I++,ATTRIB_NAME:I++,ATTRIB_NAME_SAW_WHITE:I++,ATTRIB_VALUE:I++,ATTRIB_VALUE_QUOTED:I++,ATTRIB_VALUE_CLOSED:I++,ATTRIB_VALUE_UNQUOTED:I++,ATTRIB_VALUE_ENTITY_Q:I++,ATTRIB_VALUE_ENTITY_U:I++,CLOSE_TAG:I++,CLOSE_TAG_SAW_WHITE:I++,SCRIPT:I++,SCRIPT_ENDING:I++},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(x){var k=t.ENTITIES[x],X=typeof k=="number"?String.fromCharCode(k):k;t.ENTITIES[x]=X});for(var L in t.STATE)t.STATE[t.STATE[L]]=L;I=t.STATE;function B(x,k,X){x[k]&&x[k](X)}function $(x,k,X){x.textNode&&D(x),B(x,k,X)}function D(x){x.textNode=H(x.opt,x.textNode),x.textNode&&B(x,"ontext",x.textNode),x.textNode=""}function H(x,k){return x.trim&&(k=k.trim()),x.normalize&&(k=k.replace(/\s+/g," ")),k}function ee(x,k){return D(x),x.trackPosition&&(k+=`
32
- Line: `+x.line+`
33
- Column: `+x.column+`
34
- Char: `+x.c),k=new Error(k),x.error=k,B(x,"onerror",k),x}function J(x){return x.sawRoot&&!x.closedRoot&&ce(x,"Unclosed root tag"),x.state!==I.BEGIN&&x.state!==I.BEGIN_WHITESPACE&&x.state!==I.TEXT&&ee(x,"Unexpected end"),D(x),x.c="",x.closed=!0,B(x,"onend"),n.call(x,x.strict,x.opt),x}function ce(x,k){if(typeof x!="object"||!(x instanceof n))throw new Error("bad call to strictFail");x.strict&&ee(x,k)}function be(x){x.strict||(x.tagName=x.tagName[x.looseCase]());var k=x.tags[x.tags.length-1]||x,X=x.tag={name:x.tagName,attributes:{}};x.opt.xmlns&&(X.ns=k.ns),x.attribList.length=0,$(x,"onopentagstart",X)}function de(x,k){var X=x.indexOf(":"),W=X<0?["",x]:x.split(":"),U=W[0],z=W[1];return k&&x==="xmlns"&&(U="xmlns",z=""),{prefix:U,local:z}}function Se(x){if(x.strict||(x.attribName=x.attribName[x.looseCase]()),x.attribList.indexOf(x.attribName)!==-1||x.tag.attributes.hasOwnProperty(x.attribName)){x.attribName=x.attribValue="";return}if(x.opt.xmlns){var k=de(x.attribName,!0),X=k.prefix,W=k.local;if(X==="xmlns")if(W==="xml"&&x.attribValue!==b)ce(x,"xml: prefix must be bound to "+b+`
35
- Actual: `+x.attribValue);else if(W==="xmlns"&&x.attribValue!==E)ce(x,"xmlns: prefix must be bound to "+E+`
36
- Actual: `+x.attribValue);else{var U=x.tag,z=x.tags[x.tags.length-1]||x;U.ns===z.ns&&(U.ns=Object.create(z.ns)),U.ns[W]=x.attribValue}x.attribList.push([x.attribName,x.attribValue])}else x.tag.attributes[x.attribName]=x.attribValue,$(x,"onattribute",{name:x.attribName,value:x.attribValue});x.attribName=x.attribValue=""}function Ae(x,k){if(x.opt.xmlns){var X=x.tag,W=de(x.tagName);X.prefix=W.prefix,X.local=W.local,X.uri=X.ns[W.prefix]||"",X.prefix&&!X.uri&&(ce(x,"Unbound namespace prefix: "+JSON.stringify(x.tagName)),X.uri=W.prefix);var U=x.tags[x.tags.length-1]||x;X.ns&&U.ns!==X.ns&&Object.keys(X.ns).forEach(function(ze){$(x,"onopennamespace",{prefix:ze,uri:X.ns[ze]})});for(var z=0,fe=x.attribList.length;z<fe;z++){var _e=x.attribList[z],Be=_e[0],Fe=_e[1],Pe=de(Be,!0),je=Pe.prefix,te=Pe.local,Le=je===""?"":X.ns[je]||"",qe={name:Be,value:Fe,prefix:je,local:te,uri:Le};je&&je!=="xmlns"&&!Le&&(ce(x,"Unbound namespace prefix: "+JSON.stringify(je)),qe.uri=je),x.tag.attributes[Be]=qe,$(x,"onattribute",qe)}x.attribList.length=0}x.tag.isSelfClosing=!!k,x.sawRoot=!0,x.tags.push(x.tag),$(x,"onopentag",x.tag),k||(!x.noscript&&x.tagName.toLowerCase()==="script"?x.state=I.SCRIPT:x.state=I.TEXT,x.tag=null,x.tagName=""),x.attribName=x.attribValue="",x.attribList.length=0}function ne(x){if(!x.tagName){ce(x,"Weird empty close tag."),x.textNode+="</>",x.state=I.TEXT;return}if(x.script){if(x.tagName!=="script"){x.script+="</"+x.tagName+">",x.tagName="",x.state=I.SCRIPT;return}$(x,"onscript",x.script),x.script=""}var k=x.tags.length,X=x.tagName;x.strict||(X=X[x.looseCase]());for(var W=X;k--;){var U=x.tags[k];if(U.name!==W)ce(x,"Unexpected close tag");else break}if(k<0){ce(x,"Unmatched closing tag: "+x.tagName),x.textNode+="</"+x.tagName+">",x.state=I.TEXT;return}x.tagName=X;for(var z=x.tags.length;z-- >k;){var fe=x.tag=x.tags.pop();x.tagName=x.tag.name,$(x,"onclosetag",x.tagName);var _e={};for(var Be in fe.ns)_e[Be]=fe.ns[Be];var Fe=x.tags[x.tags.length-1]||x;x.opt.xmlns&&fe.ns!==Fe.ns&&Object.keys(fe.ns).forEach(function(Pe){var je=fe.ns[Pe];$(x,"onclosenamespace",{prefix:Pe,uri:je})})}k===0&&(x.closedRoot=!0),x.tagName=x.attribValue=x.attribName="",x.attribList.length=0,x.state=I.TEXT}function ae(x){var k=x.entity,X=k.toLowerCase(),W,U="";return x.ENTITIES[k]?x.ENTITIES[k]:x.ENTITIES[X]?x.ENTITIES[X]:(k=X,k.charAt(0)==="#"&&(k.charAt(1)==="x"?(k=k.slice(2),W=parseInt(k,16),U=W.toString(16)):(k=k.slice(1),W=parseInt(k,10),U=W.toString(10))),k=k.replace(/^0+/,""),isNaN(W)||U.toLowerCase()!==k?(ce(x,"Invalid character entity"),"&"+x.entity+";"):String.fromCodePoint(W))}function le(x,k){k==="<"?(x.state=I.OPEN_WAKA,x.startTagPosition=x.position):v(k)||(ce(x,"Non-whitespace before first tag."),x.textNode=k,x.state=I.TEXT)}function oe(x,k){var X="";return k<x.length&&(X=x.charAt(k)),X}function Q(x){var k=this;if(this.error)throw this.error;if(k.closed)return ee(k,"Cannot write after close. Assign an onready handler.");if(x===null)return J(k);typeof x=="object"&&(x=x.toString());for(var X=0,W="";W=oe(x,X++),k.c=W,!!W;)switch(k.trackPosition&&(k.position++,W===`
37
- `?(k.line++,k.column=0):k.column++),k.state){case I.BEGIN:if(k.state=I.BEGIN_WHITESPACE,W==="\uFEFF")continue;le(k,W);continue;case I.BEGIN_WHITESPACE:le(k,W);continue;case I.TEXT:if(k.sawRoot&&!k.closedRoot){for(var U=X-1;W&&W!=="<"&&W!=="&";)W=oe(x,X++),W&&k.trackPosition&&(k.position++,W===`
38
- `?(k.line++,k.column=0):k.column++);k.textNode+=x.substring(U,X-1)}W==="<"&&!(k.sawRoot&&k.closedRoot&&!k.strict)?(k.state=I.OPEN_WAKA,k.startTagPosition=k.position):(!v(W)&&(!k.sawRoot||k.closedRoot)&&ce(k,"Text data outside of root node."),W==="&"?k.state=I.TEXT_ENTITY:k.textNode+=W);continue;case I.SCRIPT:W==="<"?k.state=I.SCRIPT_ENDING:k.script+=W;continue;case I.SCRIPT_ENDING:W==="/"?k.state=I.CLOSE_TAG:(k.script+="<"+W,k.state=I.SCRIPT);continue;case I.OPEN_WAKA:if(W==="!")k.state=I.SGML_DECL,k.sgmlDecl="";else if(!v(W))if(F(R,W))k.state=I.OPEN_TAG,k.tagName=W;else if(W==="/")k.state=I.CLOSE_TAG,k.tagName="";else if(W==="?")k.state=I.PROC_INST,k.procInstName=k.procInstBody="";else{if(ce(k,"Unencoded <"),k.startTagPosition+1<k.position){var z=k.position-k.startTagPosition;W=new Array(z).join(" ")+W}k.textNode+="<"+W,k.state=I.TEXT}continue;case I.SGML_DECL:if(k.sgmlDecl+W==="--"){k.state=I.COMMENT,k.comment="",k.sgmlDecl="";continue}k.doctype&&k.doctype!==!0&&k.sgmlDecl?(k.state=I.DOCTYPE_DTD,k.doctype+="<!"+k.sgmlDecl+W,k.sgmlDecl=""):(k.sgmlDecl+W).toUpperCase()===f?($(k,"onopencdata"),k.state=I.CDATA,k.sgmlDecl="",k.cdata=""):(k.sgmlDecl+W).toUpperCase()===d?(k.state=I.DOCTYPE,(k.doctype||k.sawRoot)&&ce(k,"Inappropriately located doctype declaration"),k.doctype="",k.sgmlDecl=""):W===">"?($(k,"onsgmldeclaration",k.sgmlDecl),k.sgmlDecl="",k.state=I.TEXT):(T(W)&&(k.state=I.SGML_DECL_QUOTED),k.sgmlDecl+=W);continue;case I.SGML_DECL_QUOTED:W===k.q&&(k.state=I.SGML_DECL,k.q=""),k.sgmlDecl+=W;continue;case I.DOCTYPE:W===">"?(k.state=I.TEXT,$(k,"ondoctype",k.doctype),k.doctype=!0):(k.doctype+=W,W==="["?k.state=I.DOCTYPE_DTD:T(W)&&(k.state=I.DOCTYPE_QUOTED,k.q=W));continue;case I.DOCTYPE_QUOTED:k.doctype+=W,W===k.q&&(k.q="",k.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:W==="]"?(k.doctype+=W,k.state=I.DOCTYPE):W==="<"?(k.state=I.OPEN_WAKA,k.startTagPosition=k.position):T(W)?(k.doctype+=W,k.state=I.DOCTYPE_DTD_QUOTED,k.q=W):k.doctype+=W;continue;case I.DOCTYPE_DTD_QUOTED:k.doctype+=W,W===k.q&&(k.state=I.DOCTYPE_DTD,k.q="");continue;case I.COMMENT:W==="-"?k.state=I.COMMENT_ENDING:k.comment+=W;continue;case I.COMMENT_ENDING:W==="-"?(k.state=I.COMMENT_ENDED,k.comment=H(k.opt,k.comment),k.comment&&$(k,"oncomment",k.comment),k.comment=""):(k.comment+="-"+W,k.state=I.COMMENT);continue;case I.COMMENT_ENDED:W!==">"?(ce(k,"Malformed comment"),k.comment+="--"+W,k.state=I.COMMENT):k.doctype&&k.doctype!==!0?k.state=I.DOCTYPE_DTD:k.state=I.TEXT;continue;case I.CDATA:W==="]"?k.state=I.CDATA_ENDING:k.cdata+=W;continue;case I.CDATA_ENDING:W==="]"?k.state=I.CDATA_ENDING_2:(k.cdata+="]"+W,k.state=I.CDATA);continue;case I.CDATA_ENDING_2:W===">"?(k.cdata&&$(k,"oncdata",k.cdata),$(k,"onclosecdata"),k.cdata="",k.state=I.TEXT):W==="]"?k.cdata+="]":(k.cdata+="]]"+W,k.state=I.CDATA);continue;case I.PROC_INST:W==="?"?k.state=I.PROC_INST_ENDING:v(W)?k.state=I.PROC_INST_BODY:k.procInstName+=W;continue;case I.PROC_INST_BODY:if(!k.procInstBody&&v(W))continue;W==="?"?k.state=I.PROC_INST_ENDING:k.procInstBody+=W;continue;case I.PROC_INST_ENDING:W===">"?($(k,"onprocessinginstruction",{name:k.procInstName,body:k.procInstBody}),k.procInstName=k.procInstBody="",k.state=I.TEXT):(k.procInstBody+="?"+W,k.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:F(S,W)?k.tagName+=W:(be(k),W===">"?Ae(k):W==="/"?k.state=I.OPEN_TAG_SLASH:(v(W)||ce(k,"Invalid character in tag name"),k.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:W===">"?(Ae(k,!0),ne(k)):(ce(k,"Forward-slash in opening tag not followed by >"),k.state=I.ATTRIB);continue;case I.ATTRIB:if(v(W))continue;W===">"?Ae(k):W==="/"?k.state=I.OPEN_TAG_SLASH:F(R,W)?(k.attribName=W,k.attribValue="",k.state=I.ATTRIB_NAME):ce(k,"Invalid attribute name");continue;case I.ATTRIB_NAME:W==="="?k.state=I.ATTRIB_VALUE:W===">"?(ce(k,"Attribute without value"),k.attribValue=k.attribName,Se(k),Ae(k)):v(W)?k.state=I.ATTRIB_NAME_SAW_WHITE:F(S,W)?k.attribName+=W:ce(k,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if(W==="=")k.state=I.ATTRIB_VALUE;else{if(v(W))continue;ce(k,"Attribute without value"),k.tag.attributes[k.attribName]="",k.attribValue="",$(k,"onattribute",{name:k.attribName,value:""}),k.attribName="",W===">"?Ae(k):F(R,W)?(k.attribName=W,k.state=I.ATTRIB_NAME):(ce(k,"Invalid attribute name"),k.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(v(W))continue;T(W)?(k.q=W,k.state=I.ATTRIB_VALUE_QUOTED):(k.opt.unquotedAttributeValues||ee(k,"Unquoted attribute value"),k.state=I.ATTRIB_VALUE_UNQUOTED,k.attribValue=W);continue;case I.ATTRIB_VALUE_QUOTED:if(W!==k.q){W==="&"?k.state=I.ATTRIB_VALUE_ENTITY_Q:k.attribValue+=W;continue}Se(k),k.q="",k.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:v(W)?k.state=I.ATTRIB:W===">"?Ae(k):W==="/"?k.state=I.OPEN_TAG_SLASH:F(R,W)?(ce(k,"No whitespace between attributes"),k.attribName=W,k.attribValue="",k.state=I.ATTRIB_NAME):ce(k,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(!A(W)){W==="&"?k.state=I.ATTRIB_VALUE_ENTITY_U:k.attribValue+=W;continue}Se(k),W===">"?Ae(k):k.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(k.tagName)W===">"?ne(k):F(S,W)?k.tagName+=W:k.script?(k.script+="</"+k.tagName,k.tagName="",k.state=I.SCRIPT):(v(W)||ce(k,"Invalid tagname in closing tag"),k.state=I.CLOSE_TAG_SAW_WHITE);else{if(v(W))continue;C(R,W)?k.script?(k.script+="</"+W,k.state=I.SCRIPT):ce(k,"Invalid tagname in closing tag."):k.tagName=W}continue;case I.CLOSE_TAG_SAW_WHITE:if(v(W))continue;W===">"?ne(k):ce(k,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var fe,_e;switch(k.state){case I.TEXT_ENTITY:fe=I.TEXT,_e="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:fe=I.ATTRIB_VALUE_QUOTED,_e="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:fe=I.ATTRIB_VALUE_UNQUOTED,_e="attribValue";break}if(W===";"){var Be=ae(k);k.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Be)?(k.entity="",k.state=fe,k.write(Be)):(k[_e]+=Be,k.entity="",k.state=fe)}else F(k.entity.length?g:m,W)?k.entity+=W:(ce(k,"Invalid character in entity name"),k[_e]+="&"+k.entity+W,k.entity="",k.state=fe);continue;default:throw new Error(k,"Unknown state: "+k.state)}return k.position>=k.bufferCheckPosition&&o(k),k}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var x=String.fromCharCode,k=Math.floor,X=function(){var W=16384,U=[],z,fe,_e=-1,Be=arguments.length;if(!Be)return"";for(var Fe="";++_e<Be;){var Pe=Number(arguments[_e]);if(!isFinite(Pe)||Pe<0||Pe>1114111||k(Pe)!==Pe)throw RangeError("Invalid code point: "+Pe);Pe<=65535?U.push(Pe):(Pe-=65536,z=(Pe>>10)+55296,fe=Pe%1024+56320,U.push(z,fe)),(_e+1===Be||U.length>W)&&(Fe+=x.apply(null,U),U.length=0)}return Fe};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:X,configurable:!0,writable:!0}):String.fromCodePoint=X}()})(e)}(ec)),ec}var Ru,Mm;function _u(){return Mm||(Mm=1,Ru={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Ru}var Iu,jm;function Cu(){if(jm)return Iu;jm=1;var e=_u().isArray;return Iu={copyOptions:function(t){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n},ensureFlagExists:function(t,r){(!(t in r)||typeof r[t]!="boolean")&&(r[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,r){(!(t+"Key"in r)||typeof r[t+"Key"]!="string")&&(r[t+"Key"]=r.compact?"_"+t:t)},checkFnExists:function(t,r){return t+"Fn"in r}},Iu}var Fu,Um;function qm(){if(Um)return Fu;Um=1;var e=DR(),t=Cu(),r=_u().isArray,n,o;function i(S){return n=t.copyOptions(S),t.ensureFlagExists("ignoreDeclaration",n),t.ensureFlagExists("ignoreInstruction",n),t.ensureFlagExists("ignoreAttributes",n),t.ensureFlagExists("ignoreText",n),t.ensureFlagExists("ignoreComment",n),t.ensureFlagExists("ignoreCdata",n),t.ensureFlagExists("ignoreDoctype",n),t.ensureFlagExists("compact",n),t.ensureFlagExists("alwaysChildren",n),t.ensureFlagExists("addParent",n),t.ensureFlagExists("trim",n),t.ensureFlagExists("nativeType",n),t.ensureFlagExists("nativeTypeAttributes",n),t.ensureFlagExists("sanitize",n),t.ensureFlagExists("instructionHasAttributes",n),t.ensureFlagExists("captureSpacesBetweenElements",n),t.ensureAlwaysArrayExists(n),t.ensureKeyExists("declaration",n),t.ensureKeyExists("instruction",n),t.ensureKeyExists("attributes",n),t.ensureKeyExists("text",n),t.ensureKeyExists("comment",n),t.ensureKeyExists("cdata",n),t.ensureKeyExists("doctype",n),t.ensureKeyExists("type",n),t.ensureKeyExists("name",n),t.ensureKeyExists("elements",n),t.ensureKeyExists("parent",n),t.checkFnExists("doctype",n),t.checkFnExists("instruction",n),t.checkFnExists("cdata",n),t.checkFnExists("comment",n),t.checkFnExists("text",n),t.checkFnExists("instructionName",n),t.checkFnExists("elementName",n),t.checkFnExists("attributeName",n),t.checkFnExists("attributeValue",n),t.checkFnExists("attributes",n),n}function s(S){var m=Number(S);if(!isNaN(m))return m;var g=S.toLowerCase();return g==="true"?!0:g==="false"?!1:S}function l(S,m){var g;if(n.compact){if(!o[n[S+"Key"]]&&(r(n.alwaysArray)?n.alwaysArray.indexOf(n[S+"Key"])!==-1:n.alwaysArray)&&(o[n[S+"Key"]]=[]),o[n[S+"Key"]]&&!r(o[n[S+"Key"]])&&(o[n[S+"Key"]]=[o[n[S+"Key"]]]),S+"Fn"in n&&typeof m=="string"&&(m=n[S+"Fn"](m,o)),S==="instruction"&&("instructionFn"in n||"instructionNameFn"in n)){for(g in m)if(m.hasOwnProperty(g))if("instructionFn"in n)m[g]=n.instructionFn(m[g],g,o);else{var v=m[g];delete m[g],m[n.instructionNameFn(g,v,o)]=v}}r(o[n[S+"Key"]])?o[n[S+"Key"]].push(m):o[n[S+"Key"]]=m}else{o[n.elementsKey]||(o[n.elementsKey]=[]);var T={};if(T[n.typeKey]=S,S==="instruction"){for(g in m)if(m.hasOwnProperty(g))break;T[n.nameKey]="instructionNameFn"in n?n.instructionNameFn(g,m,o):g,n.instructionHasAttributes?(T[n.attributesKey]=m[g][n.attributesKey],"instructionFn"in n&&(T[n.attributesKey]=n.instructionFn(T[n.attributesKey],g,o))):("instructionFn"in n&&(m[g]=n.instructionFn(m[g],g,o)),T[n.instructionKey]=m[g])}else S+"Fn"in n&&(m=n[S+"Fn"](m,o)),T[n[S+"Key"]]=m;n.addParent&&(T[n.parentKey]=o),o[n.elementsKey].push(T)}}function c(S){if("attributesFn"in n&&S&&(S=n.attributesFn(S,o)),(n.trim||"attributeValueFn"in n||"attributeNameFn"in n||n.nativeTypeAttributes)&&S){var m;for(m in S)if(S.hasOwnProperty(m)&&(n.trim&&(S[m]=S[m].trim()),n.nativeTypeAttributes&&(S[m]=s(S[m])),"attributeValueFn"in n&&(S[m]=n.attributeValueFn(S[m],m,o)),"attributeNameFn"in n)){var g=S[m];delete S[m],S[n.attributeNameFn(m,S[m],o)]=g}}return S}function u(S){var m={};if(S.body&&(S.name.toLowerCase()==="xml"||n.instructionHasAttributes)){for(var g=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,v;(v=g.exec(S.body))!==null;)m[v[1]]=v[2]||v[3]||v[4];m=c(m)}if(S.name.toLowerCase()==="xml"){if(n.ignoreDeclaration)return;o[n.declarationKey]={},Object.keys(m).length&&(o[n.declarationKey][n.attributesKey]=m),n.addParent&&(o[n.declarationKey][n.parentKey]=o)}else{if(n.ignoreInstruction)return;n.trim&&(S.body=S.body.trim());var T={};n.instructionHasAttributes&&Object.keys(m).length?(T[S.name]={},T[S.name][n.attributesKey]=m):T[S.name]=S.body,l("instruction",T)}}function a(S,m){var g;if(typeof S=="object"&&(m=S.attributes,S=S.name),m=c(m),"elementNameFn"in n&&(S=n.elementNameFn(S,o)),n.compact){if(g={},!n.ignoreAttributes&&m&&Object.keys(m).length){g[n.attributesKey]={};var v;for(v in m)m.hasOwnProperty(v)&&(g[n.attributesKey][v]=m[v])}!(S in o)&&(r(n.alwaysArray)?n.alwaysArray.indexOf(S)!==-1:n.alwaysArray)&&(o[S]=[]),o[S]&&!r(o[S])&&(o[S]=[o[S]]),r(o[S])?o[S].push(g):o[S]=g}else o[n.elementsKey]||(o[n.elementsKey]=[]),g={},g[n.typeKey]="element",g[n.nameKey]=S,!n.ignoreAttributes&&m&&Object.keys(m).length&&(g[n.attributesKey]=m),n.alwaysChildren&&(g[n.elementsKey]=[]),o[n.elementsKey].push(g);g[n.parentKey]=o,o=g}function f(S){n.ignoreText||!S.trim()&&!n.captureSpacesBetweenElements||(n.trim&&(S=S.trim()),n.nativeType&&(S=s(S)),n.sanitize&&(S=S.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),l("text",S))}function d(S){n.ignoreComment||(n.trim&&(S=S.trim()),l("comment",S))}function b(S){var m=o[n.parentKey];n.addParent||delete o[n.parentKey],o=m}function E(S){n.ignoreCdata||(n.trim&&(S=S.trim()),l("cdata",S))}function w(S){n.ignoreDoctype||(S=S.replace(/^ /,""),n.trim&&(S=S.trim()),l("doctype",S))}function R(S){S.note=S}return Fu=function(S,m){var g=e.parser(!0,{}),v={};if(o=v,n=i(m),g.opt={strictEntities:!0},g.onopentag=a,g.ontext=f,g.oncomment=d,g.onclosetag=b,g.onerror=R,g.oncdata=E,g.ondoctype=w,g.onprocessinginstruction=u,g.write(S).close(),v[n.elementsKey]){var T=v[n.elementsKey];delete v[n.elementsKey],v[n.elementsKey]=T,delete v.text}return v},Fu}var Pu,Vm;function LR(){if(Vm)return Pu;Vm=1;var e=Cu(),t=qm();function r(n){var o=e.copyOptions(n);return e.ensureSpacesExists(o),o}return Pu=function(n,o){var i,s,l,c;return i=r(o),s=t(n,i),c="compact"in i&&i.compact?"_parent":"parent","addParent"in i&&i.addParent?l=JSON.stringify(s,function(u,a){return u===c?"_":a},i.spaces):l=JSON.stringify(s,null,i.spaces),l.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Pu}var xu,zm;function Wm(){if(zm)return xu;zm=1;var e=Cu(),t=_u().isArray,r,n;function o(g){var v=e.copyOptions(g);return e.ensureFlagExists("ignoreDeclaration",v),e.ensureFlagExists("ignoreInstruction",v),e.ensureFlagExists("ignoreAttributes",v),e.ensureFlagExists("ignoreText",v),e.ensureFlagExists("ignoreComment",v),e.ensureFlagExists("ignoreCdata",v),e.ensureFlagExists("ignoreDoctype",v),e.ensureFlagExists("compact",v),e.ensureFlagExists("indentText",v),e.ensureFlagExists("indentCdata",v),e.ensureFlagExists("indentAttributes",v),e.ensureFlagExists("indentInstruction",v),e.ensureFlagExists("fullTagEmptyElement",v),e.ensureFlagExists("noQuotesForNativeAttributes",v),e.ensureSpacesExists(v),typeof v.spaces=="number"&&(v.spaces=Array(v.spaces+1).join(" ")),e.ensureKeyExists("declaration",v),e.ensureKeyExists("instruction",v),e.ensureKeyExists("attributes",v),e.ensureKeyExists("text",v),e.ensureKeyExists("comment",v),e.ensureKeyExists("cdata",v),e.ensureKeyExists("doctype",v),e.ensureKeyExists("type",v),e.ensureKeyExists("name",v),e.ensureKeyExists("elements",v),e.checkFnExists("doctype",v),e.checkFnExists("instruction",v),e.checkFnExists("cdata",v),e.checkFnExists("comment",v),e.checkFnExists("text",v),e.checkFnExists("instructionName",v),e.checkFnExists("elementName",v),e.checkFnExists("attributeName",v),e.checkFnExists("attributeValue",v),e.checkFnExists("attributes",v),e.checkFnExists("fullTagEmptyElement",v),v}function i(g,v,T){return(!T&&g.spaces?`
39
- `:"")+Array(v+1).join(g.spaces)}function s(g,v,T){if(v.ignoreAttributes)return"";"attributesFn"in v&&(g=v.attributesFn(g,n,r));var A,F,C,I,L=[];for(A in g)g.hasOwnProperty(A)&&g[A]!==null&&g[A]!==void 0&&(I=v.noQuotesForNativeAttributes&&typeof g[A]!="string"?"":'"',F=""+g[A],F=F.replace(/"/g,"&quot;"),C="attributeNameFn"in v?v.attributeNameFn(A,F,n,r):A,L.push(v.spaces&&v.indentAttributes?i(v,T+1,!1):" "),L.push(C+"="+I+("attributeValueFn"in v?v.attributeValueFn(F,A,n,r):F)+I));return g&&Object.keys(g).length&&v.spaces&&v.indentAttributes&&L.push(i(v,T,!1)),L.join("")}function l(g,v,T){return r=g,n="xml",v.ignoreDeclaration?"":"<?xml"+s(g[v.attributesKey],v,T)+"?>"}function c(g,v,T){if(v.ignoreInstruction)return"";var A;for(A in g)if(g.hasOwnProperty(A))break;var F="instructionNameFn"in v?v.instructionNameFn(A,g[A],n,r):A;if(typeof g[A]=="object")return r=g,n=F,"<?"+F+s(g[A][v.attributesKey],v,T)+"?>";var C=g[A]?g[A]:"";return"instructionFn"in v&&(C=v.instructionFn(C,A,n,r)),"<?"+F+(C?" "+C:"")+"?>"}function u(g,v){return v.ignoreComment?"":"<!--"+("commentFn"in v?v.commentFn(g,n,r):g)+"-->"}function a(g,v){return v.ignoreCdata?"":"<![CDATA["+("cdataFn"in v?v.cdataFn(g,n,r):g.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function f(g,v){return v.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in v?v.doctypeFn(g,n,r):g)+">"}function d(g,v){return v.ignoreText?"":(g=""+g,g=g.replace(/&amp;/g,"&"),g=g.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in v?v.textFn(g,n,r):g)}function b(g,v){var T;if(g.elements&&g.elements.length)for(T=0;T<g.elements.length;++T)switch(g.elements[T][v.typeKey]){case"text":if(v.indentText)return!0;break;case"cdata":if(v.indentCdata)return!0;break;case"instruction":if(v.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function E(g,v,T){r=g,n=g.name;var A=[],F="elementNameFn"in v?v.elementNameFn(g.name,g):g.name;A.push("<"+F),g[v.attributesKey]&&A.push(s(g[v.attributesKey],v,T));var C=g[v.elementsKey]&&g[v.elementsKey].length||g[v.attributesKey]&&g[v.attributesKey]["xml:space"]==="preserve";return C||("fullTagEmptyElementFn"in v?C=v.fullTagEmptyElementFn(g.name,g):C=v.fullTagEmptyElement),C?(A.push(">"),g[v.elementsKey]&&g[v.elementsKey].length&&(A.push(w(g[v.elementsKey],v,T+1)),r=g,n=g.name),A.push(v.spaces&&b(g,v)?`
40
- `+Array(T+1).join(v.spaces):""),A.push("</"+F+">")):A.push("/>"),A.join("")}function w(g,v,T,A){return g.reduce(function(F,C){var I=i(v,T,A&&!F);switch(C.type){case"element":return F+I+E(C,v,T);case"comment":return F+I+u(C[v.commentKey],v);case"doctype":return F+I+f(C[v.doctypeKey],v);case"cdata":return F+(v.indentCdata?I:"")+a(C[v.cdataKey],v);case"text":return F+(v.indentText?I:"")+d(C[v.textKey],v);case"instruction":var L={};return L[C[v.nameKey]]=C[v.attributesKey]?C:C[v.instructionKey],F+(v.indentInstruction?I:"")+c(L,v,T)}},"")}function R(g,v,T){var A;for(A in g)if(g.hasOwnProperty(A))switch(A){case v.parentKey:case v.attributesKey:break;case v.textKey:if(v.indentText||T)return!0;break;case v.cdataKey:if(v.indentCdata||T)return!0;break;case v.instructionKey:if(v.indentInstruction||T)return!0;break;case v.doctypeKey:case v.commentKey:return!0;default:return!0}return!1}function S(g,v,T,A,F){r=g,n=v;var C="elementNameFn"in T?T.elementNameFn(v,g):v;if(typeof g>"u"||g===null||g==="")return"fullTagEmptyElementFn"in T&&T.fullTagEmptyElementFn(v,g)||T.fullTagEmptyElement?"<"+C+"></"+C+">":"<"+C+"/>";var I=[];if(v){if(I.push("<"+C),typeof g!="object")return I.push(">"+d(g,T)+"</"+C+">"),I.join("");g[T.attributesKey]&&I.push(s(g[T.attributesKey],T,A));var L=R(g,T,!0)||g[T.attributesKey]&&g[T.attributesKey]["xml:space"]==="preserve";if(L||("fullTagEmptyElementFn"in T?L=T.fullTagEmptyElementFn(v,g):L=T.fullTagEmptyElement),L)I.push(">");else return I.push("/>"),I.join("")}return I.push(m(g,T,A+1,!1)),r=g,n=v,v&&I.push((F?i(T,A,!1):"")+"</"+C+">"),I.join("")}function m(g,v,T,A){var F,C,I,L=[];for(C in g)if(g.hasOwnProperty(C))for(I=t(g[C])?g[C]:[g[C]],F=0;F<I.length;++F){switch(C){case v.declarationKey:L.push(l(I[F],v,T));break;case v.instructionKey:L.push((v.indentInstruction?i(v,T,A):"")+c(I[F],v,T));break;case v.attributesKey:case v.parentKey:break;case v.textKey:L.push((v.indentText?i(v,T,A):"")+d(I[F],v));break;case v.cdataKey:L.push((v.indentCdata?i(v,T,A):"")+a(I[F],v));break;case v.doctypeKey:L.push(i(v,T,A)+f(I[F],v));break;case v.commentKey:L.push(i(v,T,A)+u(I[F],v));break;default:L.push(i(v,T,A)+S(I[F],C,v,T,R(I[F],v)))}A=A&&!L.length}return L.join("")}return xu=function(g,v){v=o(v);var T=[];return r=g,n="_root_",v.compact?T.push(m(g,v,0,!0)):(g[v.declarationKey]&&T.push(l(g[v.declarationKey],v,0)),g[v.elementsKey]&&g[v.elementsKey].length&&T.push(w(g[v.elementsKey],v,0,!T.length))),T.join("")},xu}var Ou,Hm;function BR(){if(Hm)return Ou;Hm=1;var e=Wm();return Ou=function(t,r){t instanceof As&&(t=t.toString());var n=null;if(typeof t=="string")try{n=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else n=t;return e(n,r)},Ou}var ku,Gm;function MR(){if(Gm)return ku;Gm=1;var e=qm(),t=LR(),r=Wm(),n=BR();return ku={xml2js:e,xml2json:t,js2xml:r,json2xml:n},ku}MR();/*! For license information please see index.js.LICENSE.txt */var jR={2:e=>{function t(o,i,s){o instanceof RegExp&&(o=r(o,s)),i instanceof RegExp&&(i=r(i,s));var l=n(o,i,s);return l&&{start:l[0],end:l[1],pre:s.slice(0,l[0]),body:s.slice(l[0]+o.length,l[1]),post:s.slice(l[1]+i.length)}}function r(o,i){var s=i.match(o);return s?s[0]:null}function n(o,i,s){var l,c,u,a,f,d=s.indexOf(o),b=s.indexOf(i,d+1),E=d;if(d>=0&&b>0){for(l=[],u=s.length;E>=0&&!f;)E==d?(l.push(E),d=s.indexOf(o,E+1)):l.length==1?f=[l.pop(),b]:((c=l.pop())<u&&(u=c,a=b),b=s.indexOf(i,E+1)),E=d<b&&d>=0?d:b;l.length&&(f=[u,a])}return f}e.exports=t,t.range=n},101:function(e,t,r){var n;e=r.nmd(e),function(o){var i=(e&&e.exports,typeof Fn=="object"&&Fn);i.global!==i&&i.window;var s=function(f){this.message=f};(s.prototype=new Error).name="InvalidCharacterError";var l=function(f){throw new s(f)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,a={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&l("The string to be encoded contains characters outside of the Latin1 range.");for(var d,b,E,w,R=f.length%3,S="",m=-1,g=f.length-R;++m<g;)d=f.charCodeAt(m)<<16,b=f.charCodeAt(++m)<<8,E=f.charCodeAt(++m),S+=c.charAt((w=d+b+E)>>18&63)+c.charAt(w>>12&63)+c.charAt(w>>6&63)+c.charAt(63&w);return R==2?(d=f.charCodeAt(m)<<8,b=f.charCodeAt(++m),S+=c.charAt((w=d+b)>>10)+c.charAt(w>>4&63)+c.charAt(w<<2&63)+"="):R==1&&(w=f.charCodeAt(m),S+=c.charAt(w>>2)+c.charAt(w<<4&63)+"=="),S},decode:function(f){var d=(f=String(f).replace(u,"")).length;d%4==0&&(d=(f=f.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(f))&&l("Invalid character: the string to be decoded is not correctly encoded.");for(var b,E,w=0,R="",S=-1;++S<d;)E=c.indexOf(f.charAt(S)),b=w%4?64*b+E:E,w++%4&&(R+=String.fromCharCode(255&b>>(-2*w&6)));return R},version:"1.0.0"};(n=(function(){return a}).call(t,r,t,e))===void 0||(e.exports=n)}()},172:(e,t)=>{t.d=function(r){if(!r)return 0;for(var n=(r=r.toString()).length,o=r.length;o--;){var i=r.charCodeAt(o);56320<=i&&i<=57343&&o--,127<i&&i<=2047?n++:2047<i&&i<=65535&&(n+=2)}return n}},526:e=>{var t={utf8:{stringToBytes:function(r){return t.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(t.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var n=[],o=0;o<r.length;o++)n.push(255&r.charCodeAt(o));return n},bytesToString:function(r){for(var n=[],o=0;o<r.length;o++)n.push(String.fromCharCode(r[o]));return n.join("")}}};e.exports=t},298:e=>{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return 16711935&r.rotl(n,8)|4278255360&r.rotl(n,24);for(var o=0;o<n.length;o++)n[o]=r.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(n){for(var o=[],i=0,s=0;i<n.length;i++,s+=8)o[s>>>5]|=n[i]<<24-s%32;return o},wordsToBytes:function(n){for(var o=[],i=0;i<32*n.length;i+=8)o.push(n[i>>>5]>>>24-i%32&255);return o},bytesToHex:function(n){for(var o=[],i=0;i<n.length;i++)o.push((n[i]>>>4).toString(16)),o.push((15&n[i]).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],i=0;i<n.length;i+=2)o.push(parseInt(n.substr(i,2),16));return o},bytesToBase64:function(n){for(var o=[],i=0;i<n.length;i+=3)for(var s=n[i]<<16|n[i+1]<<8|n[i+2],l=0;l<4;l++)8*i+6*l<=8*n.length?o.push(t.charAt(s>>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],i=0,s=0;i<n.length;s=++i%4)s!=0&&o.push((t.indexOf(n.charAt(i-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(n.charAt(i))>>>6-2*s);return o}},e.exports=r},635:(e,t,r)=>{const n=r(31),o=r(338),i=r(221);e.exports={XMLParser:o,XMLValidator:n,XMLBuilder:i}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?r=>{for(const n of t)if(typeof n=="string"&&r===n||n instanceof RegExp&&n.test(r))return!0}:()=>!1}},705:(e,t)=>{const r=":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="["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,s,l){if(s){const c=Object.keys(s),u=c.length;for(let a=0;a<u;a++)i[c[a]]=l==="strict"?[s[c[a]]]:s[c[a]]}},t.getValue=function(i){return t.isExist(i)?i:""},t.isName=function(i){return o.exec(i)!=null},t.getAllMatches=function(i,s){const l=[];let c=s.exec(i);for(;c;){const u=[];u.startIndex=s.lastIndex-c[0].length;const a=c.length;for(let f=0;f<a;f++)u.push(c[f]);l.push(u),c=s.exec(i)}return l},t.nameRegexp=n},31:(e,t,r)=>{const n=r(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(m){return m===" "||m===" "||m===`
41
- `||m==="\r"}function s(m,g){const v=g;for(;g<m.length;g++)if(!(m[g]!="?"&&m[g]!=" ")){const T=m.substr(v,g-v);if(g>5&&T==="xml")return E("InvalidXml","XML declaration allowed only at the start of the document.",R(m,g));if(m[g]=="?"&&m[g+1]==">"){g++;break}}return g}function l(m,g){if(m.length>g+5&&m[g+1]==="-"&&m[g+2]==="-"){for(g+=3;g<m.length;g++)if(m[g]==="-"&&m[g+1]==="-"&&m[g+2]===">"){g+=2;break}}else if(m.length>g+8&&m[g+1]==="D"&&m[g+2]==="O"&&m[g+3]==="C"&&m[g+4]==="T"&&m[g+5]==="Y"&&m[g+6]==="P"&&m[g+7]==="E"){let v=1;for(g+=8;g<m.length;g++)if(m[g]==="<")v++;else if(m[g]===">"&&(v--,v===0))break}else if(m.length>g+9&&m[g+1]==="["&&m[g+2]==="C"&&m[g+3]==="D"&&m[g+4]==="A"&&m[g+5]==="T"&&m[g+6]==="A"&&m[g+7]==="["){for(g+=8;g<m.length;g++)if(m[g]==="]"&&m[g+1]==="]"&&m[g+2]===">"){g+=2;break}}return g}t.validate=function(m,g){g=Object.assign({},o,g);const v=[];let T=!1,A=!1;m[0]==="\uFEFF"&&(m=m.substr(1));for(let C=0;C<m.length;C++)if(m[C]==="<"&&m[C+1]==="?"){if(C+=2,C=s(m,C),C.err)return C}else{if(m[C]!=="<"){if(i(m[C]))continue;return E("InvalidChar","char '"+m[C]+"' is not expected.",R(m,C))}{let I=C;if(C++,m[C]==="!"){C=l(m,C);continue}{let L=!1;m[C]==="/"&&(L=!0,C++);let B="";for(;C<m.length&&m[C]!==">"&&m[C]!==" "&&m[C]!==" "&&m[C]!==`
42
- `&&m[C]!=="\r";C++)B+=m[C];if(B=B.trim(),B[B.length-1]==="/"&&(B=B.substring(0,B.length-1),C--),F=B,!n.isName(F)){let H;return H=B.trim().length===0?"Invalid space after '<'.":"Tag '"+B+"' is an invalid name.",E("InvalidTag",H,R(m,C))}const $=a(m,C);if($===!1)return E("InvalidAttr","Attributes for '"+B+"' have open quote.",R(m,C));let D=$.value;if(C=$.index,D[D.length-1]==="/"){const H=C-D.length;D=D.substring(0,D.length-1);const ee=d(D,g);if(ee!==!0)return E(ee.err.code,ee.err.msg,R(m,H+ee.err.line));T=!0}else if(L){if(!$.tagClosed)return E("InvalidTag","Closing tag '"+B+"' doesn't have proper closing.",R(m,C));if(D.trim().length>0)return E("InvalidTag","Closing tag '"+B+"' can't have attributes or invalid starting.",R(m,I));if(v.length===0)return E("InvalidTag","Closing tag '"+B+"' has not been opened.",R(m,I));{const H=v.pop();if(B!==H.tagName){let ee=R(m,H.tagStartPos);return E("InvalidTag","Expected closing tag '"+H.tagName+"' (opened in line "+ee.line+", col "+ee.col+") instead of closing tag '"+B+"'.",R(m,I))}v.length==0&&(A=!0)}}else{const H=d(D,g);if(H!==!0)return E(H.err.code,H.err.msg,R(m,C-D.length+H.err.line));if(A===!0)return E("InvalidXml","Multiple possible root nodes found.",R(m,C));g.unpairedTags.indexOf(B)!==-1||v.push({tagName:B,tagStartPos:I}),T=!0}for(C++;C<m.length;C++)if(m[C]==="<"){if(m[C+1]==="!"){C++,C=l(m,C);continue}if(m[C+1]!=="?")break;if(C=s(m,++C),C.err)return C}else if(m[C]==="&"){const H=b(m,C);if(H==-1)return E("InvalidChar","char '&' is not expected.",R(m,C));C=H}else if(A===!0&&!i(m[C]))return E("InvalidXml","Extra text at the end",R(m,C));m[C]==="<"&&C--}}}var F;return T?v.length==1?E("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",R(m,v[0].tagStartPos)):!(v.length>0)||E("InvalidXml","Invalid '"+JSON.stringify(v.map(C=>C.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):E("InvalidXml","Start tag expected.",1)};const c='"',u="'";function a(m,g){let v="",T="",A=!1;for(;g<m.length;g++){if(m[g]===c||m[g]===u)T===""?T=m[g]:T!==m[g]||(T="");else if(m[g]===">"&&T===""){A=!0;break}v+=m[g]}return T===""&&{value:v,index:g,tagClosed:A}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(m,g){const v=n.getAllMatches(m,f),T={};for(let A=0;A<v.length;A++){if(v[A][1].length===0)return E("InvalidAttr","Attribute '"+v[A][2]+"' has no space in starting.",S(v[A]));if(v[A][3]!==void 0&&v[A][4]===void 0)return E("InvalidAttr","Attribute '"+v[A][2]+"' is without value.",S(v[A]));if(v[A][3]===void 0&&!g.allowBooleanAttributes)return E("InvalidAttr","boolean attribute '"+v[A][2]+"' is not allowed.",S(v[A]));const F=v[A][2];if(!w(F))return E("InvalidAttr","Attribute '"+F+"' is an invalid name.",S(v[A]));if(T.hasOwnProperty(F))return E("InvalidAttr","Attribute '"+F+"' is repeated.",S(v[A]));T[F]=1}return!0}function b(m,g){if(m[++g]===";")return-1;if(m[g]==="#")return function(T,A){let F=/\d/;for(T[A]==="x"&&(A++,F=/[\da-fA-F]/);A<T.length;A++){if(T[A]===";")return A;if(!T[A].match(F))break}return-1}(m,++g);let v=0;for(;g<m.length;g++,v++)if(!(m[g].match(/\w/)&&v<20)){if(m[g]===";")break;return-1}return g}function E(m,g,v){return{err:{code:m,msg:g,line:v.line||v,col:v.col}}}function w(m){return n.isName(m)}function R(m,g){const v=m.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function S(m){return m.startIndex+m[1].length}},221:(e,t,r)=>{const n=r(87),o=r(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,f){return f},attributeValueProcessor:function(a,f){return f},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(a){this.options=Object.assign({},i,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=l,this.options.format?(this.indentate=c,this.tagEndChar=`>
27
+ `))):Q=re.stylize("[Circular]","special")),C(O)){if(F&&Z.match(/^\d+$/))return Q;O=JSON.stringify(""+Z),O.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(O=O.slice(1,-1),O=re.stylize(O,"name")):(O=O.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),O=re.stylize(O,"string"))}return O+": "+Q}function S(re,oe,ae){var Ae=re.reduce(function(Z,F){return F.indexOf(`
28
+ `)>=0,Z+F.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ae>60?ae[0]+(oe===""?"":oe+`
29
+ `)+" "+re.join(`,
30
+ `)+" "+ae[1]:ae[0]+oe+" "+re.join(", ")+" "+ae[1]}e.types=ER();function T(re){return Array.isArray(re)}e.isArray=T;function w(re){return typeof re=="boolean"}e.isBoolean=w;function y(re){return re===null}e.isNull=y;function g(re){return re==null}e.isNullOrUndefined=g;function v(re){return typeof re=="number"}e.isNumber=v;function A(re){return typeof re=="string"}e.isString=A;function R(re){return typeof re=="symbol"}e.isSymbol=R;function C(re){return re===void 0}e.isUndefined=C;function P(re){return _(re)&&H(re)==="[object RegExp]"}e.isRegExp=P,e.types.isRegExp=P;function _(re){return typeof re=="object"&&re!==null}e.isObject=_;function L(re){return _(re)&&H(re)==="[object Date]"}e.isDate=L,e.types.isDate=L;function B(re){return _(re)&&(H(re)==="[object Error]"||re instanceof Error)}e.isError=B,e.types.isNativeError=B;function $(re){return typeof re=="function"}e.isFunction=$;function D(re){return re===null||typeof re=="boolean"||typeof re=="number"||typeof re=="string"||typeof re=="symbol"||typeof re>"u"}e.isPrimitive=D,e.isBuffer=TR();function H(re){return Object.prototype.toString.call(re)}function X(re){return re<10?"0"+re.toString(10):re.toString(10)}var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function le(){var re=new Date,oe=[X(re.getHours()),X(re.getMinutes()),X(re.getSeconds())].join(":");return[re.getDate(),J[re.getMonth()],oe].join(" ")}e.log=function(){console.log("%s - %s",le(),e.format.apply(e,arguments))},e.inherits=Zn(),e._extend=function(re,oe){if(!oe||!_(oe))return re;for(var ae=Object.keys(oe),Ae=ae.length;Ae--;)re[ae[Ae]]=oe[ae[Ae]];return re};function me(re,oe){return Object.prototype.hasOwnProperty.call(re,oe)}var fe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(oe){if(typeof oe!="function")throw new TypeError('The "original" argument must be of type Function');if(fe&&oe[fe]){var ae=oe[fe];if(typeof ae!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ae,fe,{value:ae,enumerable:!1,writable:!1,configurable:!0}),ae}function ae(){for(var Ae,Z,F=new Promise(function(W,U){Ae=W,Z=U}),O=[],Q=0;Q<arguments.length;Q++)O.push(arguments[Q]);O.push(function(W,U){W?Z(W):Ae(U)});try{oe.apply(this,O)}catch(W){Z(W)}return F}return Object.setPrototypeOf(ae,Object.getPrototypeOf(oe)),fe&&Object.defineProperty(ae,fe,{value:ae,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ae,t(oe))},e.promisify.custom=fe;function we(re,oe){if(!re){var ae=new Error("Promise was rejected with a falsy value");ae.reason=re,re=ae}return oe(re)}function Se(re){if(typeof re!="function")throw new TypeError('The "original" argument must be of type Function');function oe(){for(var ae=[],Ae=0;Ae<arguments.length;Ae++)ae.push(arguments[Ae]);var Z=ae.pop();if(typeof Z!="function")throw new TypeError("The last argument must be of type Function");var F=this,O=function(){return Z.apply(F,arguments)};re.apply(this,ae).then(function(Q){ye.nextTick(O.bind(null,null,Q))},function(Q){ye.nextTick(we.bind(null,Q,O))})}return Object.setPrototypeOf(oe,Object.getPrototypeOf(re)),Object.defineProperties(oe,t(re)),oe}e.callbackify=Se}(oc)),oc}var lu,mm;function AR(){if(mm)return lu;mm=1;function e(E,S){var T=Object.keys(E);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(E);S&&(w=w.filter(function(y){return Object.getOwnPropertyDescriptor(E,y).enumerable})),T.push.apply(T,w)}return T}function t(E){for(var S=1;S<arguments.length;S++){var T=arguments[S]!=null?arguments[S]:{};S%2?e(Object(T),!0).forEach(function(w){r(E,w,T[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(T)):e(Object(T)).forEach(function(w){Object.defineProperty(E,w,Object.getOwnPropertyDescriptor(T,w))})}return E}function r(E,S,T){return S=s(S),S in E?Object.defineProperty(E,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):E[S]=T,E}function n(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function o(E,S){for(var T=0;T<S.length;T++){var w=S[T];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(E,s(w.key),w)}}function i(E,S,T){return S&&o(E.prototype,S),Object.defineProperty(E,"prototype",{writable:!1}),E}function s(E){var S=l(E,"string");return typeof S=="symbol"?S:String(S)}function l(E,S){if(typeof E!="object"||E===null)return E;var T=E[Symbol.toPrimitive];if(T!==void 0){var w=T.call(E,S);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}var c=Is(),u=c.Buffer,a=gm(),f=a.inspect,d=f&&f.custom||"inspect";function b(E,S,T){u.prototype.copy.call(E,S,T)}return lu=function(){function E(){n(this,E),this.head=null,this.tail=null,this.length=0}return i(E,[{key:"push",value:function(T){var w={data:T,next:null};this.length>0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(T){var w={data:T,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var w=this.head,y=""+w.data;w=w.next;)y+=T+w.data;return y}},{key:"concat",value:function(T){if(this.length===0)return u.alloc(0);for(var w=u.allocUnsafe(T>>>0),y=this.head,g=0;y;)b(y.data,w,g),g+=y.data.length,y=y.next;return w}},{key:"consume",value:function(T,w){var y;return T<this.head.data.length?(y=this.head.data.slice(0,T),this.head.data=this.head.data.slice(T)):T===this.head.data.length?y=this.shift():y=w?this._getString(T):this._getBuffer(T),y}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(T){var w=this.head,y=1,g=w.data;for(T-=g.length;w=w.next;){var v=w.data,A=T>v.length?v.length:T;if(A===v.length?g+=v:g+=v.slice(0,T),T-=A,T===0){A===v.length?(++y,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=v.slice(A));break}++y}return this.length-=y,g}},{key:"_getBuffer",value:function(T){var w=u.allocUnsafe(T),y=this.head,g=1;for(y.data.copy(w),T-=y.data.length;y=y.next;){var v=y.data,A=T>v.length?v.length:T;if(v.copy(w,w.length-T,0,A),T-=A,T===0){A===v.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=v.slice(A));break}++g}return this.length-=g,w}},{key:d,value:function(T,w){return f(this,t(t({},w),{},{depth:0,customInspect:!1}))}}]),E}(),lu}var cu,ym;function bm(){if(ym)return cu;ym=1;function e(s,l){var c=this,u=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return u||a?(l?l(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ye.nextTick(o,this,s)):ye.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!l&&f?c._writableState?c._writableState.errorEmitted?ye.nextTick(r,c):(c._writableState.errorEmitted=!0,ye.nextTick(t,c,f)):ye.nextTick(t,c,f):l?(ye.nextTick(r,c),l(f)):ye.nextTick(r,c)}),this)}function t(s,l){o(s,l),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function n(){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 o(s,l){s.emit("error",l)}function i(s,l){var c=s._readableState,u=s._writableState;c&&c.autoDestroy||u&&u.autoDestroy?s.destroy(l):s.emit("error",l)}return cu={destroy:e,undestroy:n,errorOrDestroy:i},cu}var uu={},vm;function xi(){if(vm)return uu;vm=1;function e(l,c){l.prototype=Object.create(c.prototype),l.prototype.constructor=l,l.__proto__=c}var t={};function r(l,c,u){u||(u=Error);function a(d,b,E){return typeof c=="string"?c:c(d,b,E)}var f=function(d){e(b,d);function b(E,S,T){return d.call(this,a(E,S,T))||this}return b}(u);f.prototype.name=u.name,f.prototype.code=l,t[l]=f}function n(l,c){if(Array.isArray(l)){var u=l.length;return l=l.map(function(a){return String(a)}),u>2?"one of ".concat(c," ").concat(l.slice(0,u-1).join(", "),", or ")+l[u-1]:u===2?"one of ".concat(c," ").concat(l[0]," or ").concat(l[1]):"of ".concat(c," ").concat(l[0])}else return"of ".concat(c," ").concat(String(l))}function o(l,c,u){return l.substr(0,c.length)===c}function i(l,c,u){return(u===void 0||u>l.length)&&(u=l.length),l.substring(u-c.length,u)===c}function s(l,c,u){return typeof u!="number"&&(u=0),u+c.length>l.length?!1:l.indexOf(c,u)!==-1}return r("ERR_INVALID_OPT_VALUE",function(l,c){return'The value "'+c+'" is invalid for option "'+l+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(l,c,u){var a;typeof c=="string"&&o(c,"not ")?(a="must not be",c=c.replace(/^not /,"")):a="must be";var f;if(i(l," argument"))f="The ".concat(l," ").concat(a," ").concat(n(c,"type"));else{var d=s(l,".")?"property":"argument";f='The "'.concat(l,'" ').concat(d," ").concat(a," ").concat(n(c,"type"))}return f+=". Received type ".concat(typeof u),f},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),uu.codes=t,uu}var fu,wm;function Sm(){if(wm)return fu;wm=1;var e=xi().codes.ERR_INVALID_OPT_VALUE;function t(n,o,i){return n.highWaterMark!=null?n.highWaterMark:o?n[i]:null}function r(n,o,i,s){var l=t(o,s,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var c=s?i:"highWaterMark";throw new e(c,l)}return Math.floor(l)}return n.objectMode?16:16*1024}return fu={getHighWaterMark:r},fu}var du,Em;function RR(){if(Em)return du;Em=1,du=e;function e(r,n){if(t("noDeprecation"))return r;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),o=!0}return r.apply(this,arguments)}return i}function t(r){try{if(!Fn.localStorage)return!1}catch{return!1}var n=Fn.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return du}var pu,Tm;function Am(){if(Tm)return pu;Tm=1,pu=P;function e(Z){var F=this;this.next=null,this.entry=null,this.finish=function(){Ae(F,Z)}}var t;P.WritableState=R;var r={deprecate:RR()},n=ng(),o=Is().Buffer,i=(typeof Fn<"u"?Fn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(Z){return o.from(Z)}function l(Z){return o.isBuffer(Z)||Z instanceof i}var c=bm(),u=Sm(),a=u.getHighWaterMark,f=xi().codes,d=f.ERR_INVALID_ARG_TYPE,b=f.ERR_METHOD_NOT_IMPLEMENTED,E=f.ERR_MULTIPLE_CALLBACK,S=f.ERR_STREAM_CANNOT_PIPE,T=f.ERR_STREAM_DESTROYED,w=f.ERR_STREAM_NULL_VALUES,y=f.ERR_STREAM_WRITE_AFTER_END,g=f.ERR_UNKNOWN_ENCODING,v=c.errorOrDestroy;Zn()(P,n);function A(){}function R(Z,F,O){t=t||Oi(),Z=Z||{},typeof O!="boolean"&&(O=F instanceof t),this.objectMode=!!Z.objectMode,O&&(this.objectMode=this.objectMode||!!Z.writableObjectMode),this.highWaterMark=a(this,Z,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=Z.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=Z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(W){J(F,W)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Z.emitClose!==!1,this.autoDestroy=!!Z.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}R.prototype.getBuffer=function(){for(var F=this.bufferedRequest,O=[];F;)O.push(F),F=F.next;return O},function(){try{Object.defineProperty(R.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var C;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(C=Function.prototype[Symbol.hasInstance],Object.defineProperty(P,Symbol.hasInstance,{value:function(F){return C.call(this,F)?!0:this!==P?!1:F&&F._writableState instanceof R}})):C=function(F){return F instanceof this};function P(Z){t=t||Oi();var F=this instanceof t;if(!F&&!C.call(P,this))return new P(Z);this._writableState=new R(Z,this,F),this.writable=!0,Z&&(typeof Z.write=="function"&&(this._write=Z.write),typeof Z.writev=="function"&&(this._writev=Z.writev),typeof Z.destroy=="function"&&(this._destroy=Z.destroy),typeof Z.final=="function"&&(this._final=Z.final)),n.call(this)}P.prototype.pipe=function(){v(this,new S)};function _(Z,F){var O=new y;v(Z,O),ye.nextTick(F,O)}function L(Z,F,O,Q){var W;return O===null?W=new w:typeof O!="string"&&!F.objectMode&&(W=new d("chunk",["string","Buffer"],O)),W?(v(Z,W),ye.nextTick(Q,W),!1):!0}P.prototype.write=function(Z,F,O){var Q=this._writableState,W=!1,U=!Q.objectMode&&l(Z);return U&&!o.isBuffer(Z)&&(Z=s(Z)),typeof F=="function"&&(O=F,F=null),U?F="buffer":F||(F=Q.defaultEncoding),typeof O!="function"&&(O=A),Q.ending?_(this,O):(U||L(this,Q,Z,O))&&(Q.pendingcb++,W=$(this,Q,U,Z,F,O)),W},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){var Z=this._writableState;Z.corked&&(Z.corked--,!Z.writing&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&fe(this,Z))},P.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 g(F);return this._writableState.defaultEncoding=F,this},Object.defineProperty(P.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function B(Z,F,O){return!Z.objectMode&&Z.decodeStrings!==!1&&typeof F=="string"&&(F=o.from(F,O)),F}Object.defineProperty(P.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(Z,F,O,Q,W,U){if(!O){var z=B(F,Q,W);Q!==z&&(O=!0,W="buffer",Q=z)}var ue=F.objectMode?1:Q.length;F.length+=ue;var _e=F.length<F.highWaterMark;if(_e||(F.needDrain=!0),F.writing||F.corked){var Be=F.lastBufferedRequest;F.lastBufferedRequest={chunk:Q,encoding:W,isBuf:O,callback:U,next:null},Be?Be.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else D(Z,F,!1,ue,Q,W,U);return _e}function D(Z,F,O,Q,W,U,z){F.writelen=Q,F.writecb=z,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new T("write")):O?Z._writev(W,F.onwrite):Z._write(W,U,F.onwrite),F.sync=!1}function H(Z,F,O,Q,W){--F.pendingcb,O?(ye.nextTick(W,Q),ye.nextTick(oe,Z,F),Z._writableState.errorEmitted=!0,v(Z,Q)):(W(Q),Z._writableState.errorEmitted=!0,v(Z,Q),oe(Z,F))}function X(Z){Z.writing=!1,Z.writecb=null,Z.length-=Z.writelen,Z.writelen=0}function J(Z,F){var O=Z._writableState,Q=O.sync,W=O.writecb;if(typeof W!="function")throw new E;if(X(O),F)H(Z,O,Q,F,W);else{var U=we(O)||Z.destroyed;!U&&!O.corked&&!O.bufferProcessing&&O.bufferedRequest&&fe(Z,O),Q?ye.nextTick(le,Z,O,U,W):le(Z,O,U,W)}}function le(Z,F,O,Q){O||me(Z,F),F.pendingcb--,Q(),oe(Z,F)}function me(Z,F){F.length===0&&F.needDrain&&(F.needDrain=!1,Z.emit("drain"))}function fe(Z,F){F.bufferProcessing=!0;var O=F.bufferedRequest;if(Z._writev&&O&&O.next){var Q=F.bufferedRequestCount,W=new Array(Q),U=F.corkedRequestsFree;U.entry=O;for(var z=0,ue=!0;O;)W[z]=O,O.isBuf||(ue=!1),O=O.next,z+=1;W.allBuffers=ue,D(Z,F,!0,F.length,W,"",U.finish),F.pendingcb++,F.lastBufferedRequest=null,U.next?(F.corkedRequestsFree=U.next,U.next=null):F.corkedRequestsFree=new e(F),F.bufferedRequestCount=0}else{for(;O;){var _e=O.chunk,Be=O.encoding,xe=O.callback,Fe=F.objectMode?1:_e.length;if(D(Z,F,!1,Fe,_e,Be,xe),O=O.next,F.bufferedRequestCount--,F.writing)break}O===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=O,F.bufferProcessing=!1}P.prototype._write=function(Z,F,O){O(new b("_write()"))},P.prototype._writev=null,P.prototype.end=function(Z,F,O){var Q=this._writableState;return typeof Z=="function"?(O=Z,Z=null,F=null):typeof F=="function"&&(O=F,F=null),Z!=null&&this.write(Z,F),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||ae(this,Q,O),this},Object.defineProperty(P.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function we(Z){return Z.ending&&Z.length===0&&Z.bufferedRequest===null&&!Z.finished&&!Z.writing}function Se(Z,F){Z._final(function(O){F.pendingcb--,O&&v(Z,O),F.prefinished=!0,Z.emit("prefinish"),oe(Z,F)})}function re(Z,F){!F.prefinished&&!F.finalCalled&&(typeof Z._final=="function"&&!F.destroyed?(F.pendingcb++,F.finalCalled=!0,ye.nextTick(Se,Z,F)):(F.prefinished=!0,Z.emit("prefinish")))}function oe(Z,F){var O=we(F);if(O&&(re(Z,F),F.pendingcb===0&&(F.finished=!0,Z.emit("finish"),F.autoDestroy))){var Q=Z._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&Z.destroy()}return O}function ae(Z,F,O){F.ending=!0,oe(Z,F),O&&(F.finished?ye.nextTick(O):Z.once("finish",O)),F.ended=!0,Z.writable=!1}function Ae(Z,F,O){var Q=Z.entry;for(Z.entry=null;Q;){var W=Q.callback;F.pendingcb--,W(O),Q=Q.next}F.corkedRequestsFree.next=Z}return Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(F){this._writableState&&(this._writableState.destroyed=F)}}),P.prototype.destroy=c.destroy,P.prototype._undestroy=c.undestroy,P.prototype._destroy=function(Z,F){F(Z)},pu}var hu,Rm;function Oi(){if(Rm)return hu;Rm=1;var e=Object.keys||function(u){var a=[];for(var f in u)a.push(f);return a};hu=s;var t=Om(),r=Am();Zn()(s,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];s.prototype[i]||(s.prototype[i]=r.prototype[i])}function s(u){if(!(this instanceof s))return new s(u);t.call(this,u),r.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",l)))}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 l(){this._writableState.ended||ye.nextTick(c,this)}function c(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(a){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=a,this._writableState.destroyed=a)}}),hu}var gu={},Ps={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var _m;function _R(){return _m||(_m=1,function(e,t){var r=Is(),n=r.Buffer;function o(s,l){for(var c in s)l[c]=s[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(s,l,c){return n(s,l,c)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(s,l,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,l,c)},i.alloc=function(s,l,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=n(s);return l!==void 0?typeof c=="string"?u.fill(l,c):u.fill(l):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}(Ps,Ps.exports)),Ps.exports}var Im;function mu(){if(Im)return gu;Im=1;var e=_R().Buffer,t=e.isEncoding||function(w){switch(w=""+w,w&&w.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 r(w){if(!w)return"utf8";for(var y;;)switch(w){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 w;default:if(y)return;w=(""+w).toLowerCase(),y=!0}}function n(w){var y=r(w);if(typeof y!="string"&&(e.isEncoding===t||!t(w)))throw new Error("Unknown encoding: "+w);return y||w}gu.StringDecoder=o;function o(w){this.encoding=n(w);var y;switch(this.encoding){case"utf16le":this.text=f,this.end=d,y=4;break;case"utf8":this.fillLast=c,y=4;break;case"base64":this.text=b,this.end=E,y=3;break;default:this.write=S,this.end=T;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(y)}o.prototype.write=function(w){if(w.length===0)return"";var y,g;if(this.lastNeed){if(y=this.fillLast(w),y===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;return g<w.length?y?y+this.text(w,g):this.text(w,g):y||""},o.prototype.end=a,o.prototype.text=u,o.prototype.fillLast=function(w){if(this.lastNeed<=w.length)return w.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,this.lastTotal-this.lastNeed,0,w.length),this.lastNeed-=w.length};function i(w){return w<=127?0:w>>5===6?2:w>>4===14?3:w>>3===30?4:w>>6===2?-1:-2}function s(w,y,g){var v=y.length-1;if(v<g)return 0;var A=i(y[v]);return A>=0?(A>0&&(w.lastNeed=A-1),A):--v<g||A===-2?0:(A=i(y[v]),A>=0?(A>0&&(w.lastNeed=A-2),A):--v<g||A===-2?0:(A=i(y[v]),A>=0?(A>0&&(A===2?A=0:w.lastNeed=A-3),A):0))}function l(w,y,g){if((y[0]&192)!==128)return w.lastNeed=0,"�";if(w.lastNeed>1&&y.length>1){if((y[1]&192)!==128)return w.lastNeed=1,"�";if(w.lastNeed>2&&y.length>2&&(y[2]&192)!==128)return w.lastNeed=2,"�"}}function c(w){var y=this.lastTotal-this.lastNeed,g=l(this,w);if(g!==void 0)return g;if(this.lastNeed<=w.length)return w.copy(this.lastChar,y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,y,0,w.length),this.lastNeed-=w.length}function u(w,y){var g=s(this,w,y);if(!this.lastNeed)return w.toString("utf8",y);this.lastTotal=g;var v=w.length-(g-this.lastNeed);return w.copy(this.lastChar,0,v),w.toString("utf8",y,v)}function a(w){var y=w&&w.length?this.write(w):"";return this.lastNeed?y+"�":y}function f(w,y){if((w.length-y)%2===0){var g=w.toString("utf16le",y);if(g){var v=g.charCodeAt(g.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=w[w.length-1],w.toString("utf16le",y,w.length-1)}function d(w){var y=w&&w.length?this.write(w):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return y+this.lastChar.toString("utf16le",0,g)}return y}function b(w,y){var g=(w.length-y)%3;return g===0?w.toString("base64",y):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=w[w.length-1]:(this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1]),w.toString("base64",y,w.length-g))}function E(w){var y=w&&w.length?this.write(w):"";return this.lastNeed?y+this.lastChar.toString("base64",0,3-this.lastNeed):y}function S(w){return w.toString(this.encoding)}function T(w){return w&&w.length?this.write(w):""}return gu}var yu,Cm;function bu(){if(Cm)return yu;Cm=1;var e=xi().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var s=!1;return function(){if(!s){s=!0;for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];i.apply(this,c)}}}function r(){}function n(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,l){if(typeof s=="function")return o(i,null,s);s||(s={}),l=t(l||r);var c=s.readable||s.readable!==!1&&i.readable,u=s.writable||s.writable!==!1&&i.writable,a=function(){i.writable||d()},f=i._writableState&&i._writableState.finished,d=function(){u=!1,f=!0,c||l.call(i)},b=i._readableState&&i._readableState.endEmitted,E=function(){c=!1,b=!0,u||l.call(i)},S=function(g){l.call(i,g)},T=function(){var g;if(c&&!b)return(!i._readableState||!i._readableState.ended)&&(g=new e),l.call(i,g);if(u&&!f)return(!i._writableState||!i._writableState.ended)&&(g=new e),l.call(i,g)},w=function(){i.req.on("finish",d)};return n(i)?(i.on("complete",d),i.on("abort",T),i.req?w():i.on("request",w)):u&&!i._writableState&&(i.on("end",a),i.on("close",a)),i.on("end",E),i.on("finish",d),s.error!==!1&&i.on("error",S),i.on("close",T),function(){i.removeListener("complete",d),i.removeListener("abort",T),i.removeListener("request",w),i.req&&i.req.removeListener("finish",d),i.removeListener("end",a),i.removeListener("close",a),i.removeListener("finish",d),i.removeListener("end",E),i.removeListener("error",S),i.removeListener("close",T)}}return yu=o,yu}var vu,Fm;function IR(){if(Fm)return vu;Fm=1;var e;function t(g,v,A){return v=r(v),v in g?Object.defineProperty(g,v,{value:A,enumerable:!0,configurable:!0,writable:!0}):g[v]=A,g}function r(g){var v=n(g,"string");return typeof v=="symbol"?v:String(v)}function n(g,v){if(typeof g!="object"||g===null)return g;var A=g[Symbol.toPrimitive];if(A!==void 0){var R=A.call(g,v);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(g)}var o=bu(),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),a=Symbol("handlePromise"),f=Symbol("stream");function d(g,v){return{value:g,done:v}}function b(g){var v=g[i];if(v!==null){var A=g[f].read();A!==null&&(g[u]=null,g[i]=null,g[s]=null,v(d(A,!1)))}}function E(g){ye.nextTick(b,g)}function S(g,v){return function(A,R){g.then(function(){if(v[c]){A(d(void 0,!0));return}v[a](A,R)},R)}}var T=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var v=this,A=this[l];if(A!==null)return Promise.reject(A);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(_,L){ye.nextTick(function(){v[l]?L(v[l]):_(d(void 0,!0))})});var R=this[u],C;if(R)C=new Promise(S(R,this));else{var P=this[f].read();if(P!==null)return Promise.resolve(d(P,!1));C=new Promise(this[a])}return this[u]=C,C}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var v=this;return new Promise(function(A,R){v[f].destroy(null,function(C){if(C){R(C);return}A(d(void 0,!0))})})}),e),T),y=function(v){var A,R=Object.create(w,(A={},t(A,f,{value:v,writable:!0}),t(A,i,{value:null,writable:!0}),t(A,s,{value:null,writable:!0}),t(A,l,{value:null,writable:!0}),t(A,c,{value:v._readableState.endEmitted,writable:!0}),t(A,a,{value:function(P,_){var L=R[f].read();L?(R[u]=null,R[i]=null,R[s]=null,P(d(L,!1))):(R[i]=P,R[s]=_)},writable:!0}),A));return R[u]=null,o(v,function(C){if(C&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"){var P=R[s];P!==null&&(R[u]=null,R[i]=null,R[s]=null,P(C)),R[l]=C;return}var _=R[i];_!==null&&(R[u]=null,R[i]=null,R[s]=null,_(d(void 0,!0))),R[c]=!0}),v.on("readable",E.bind(null,R)),R};return vu=y,vu}var wu,Pm;function CR(){return Pm||(Pm=1,wu=function(){throw new Error("Readable.from is not available in the browser")}),wu}var Su,xm;function Om(){if(xm)return Su;xm=1,Su=_;var e;_.ReadableState=P,rc().EventEmitter;var t=function(z,ue){return z.listeners(ue).length},r=ng(),n=Is().Buffer,o=(typeof Fn<"u"?Fn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(U){return n.from(U)}function s(U){return n.isBuffer(U)||U instanceof o}var l=gm(),c;l&&l.debuglog?c=l.debuglog("stream"):c=function(){};var u=AR(),a=bm(),f=Sm(),d=f.getHighWaterMark,b=xi().codes,E=b.ERR_INVALID_ARG_TYPE,S=b.ERR_STREAM_PUSH_AFTER_EOF,T=b.ERR_METHOD_NOT_IMPLEMENTED,w=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y,g,v;Zn()(_,r);var A=a.errorOrDestroy,R=["error","close","destroy","pause","resume"];function C(U,z,ue){if(typeof U.prependListener=="function")return U.prependListener(z,ue);!U._events||!U._events[z]?U.on(z,ue):Array.isArray(U._events[z])?U._events[z].unshift(ue):U._events[z]=[ue,U._events[z]]}function P(U,z,ue){e=e||Oi(),U=U||{},typeof ue!="boolean"&&(ue=z instanceof e),this.objectMode=!!U.objectMode,ue&&(this.objectMode=this.objectMode||!!U.readableObjectMode),this.highWaterMark=d(this,U,"readableHighWaterMark",ue),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=U.emitClose!==!1,this.autoDestroy=!!U.autoDestroy,this.destroyed=!1,this.defaultEncoding=U.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,U.encoding&&(y||(y=mu().StringDecoder),this.decoder=new y(U.encoding),this.encoding=U.encoding)}function _(U){if(e=e||Oi(),!(this instanceof _))return new _(U);var z=this instanceof e;this._readableState=new P(U,this,z),this.readable=!0,U&&(typeof U.read=="function"&&(this._read=U.read),typeof U.destroy=="function"&&(this._destroy=U.destroy)),r.call(this)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(z){this._readableState&&(this._readableState.destroyed=z)}}),_.prototype.destroy=a.destroy,_.prototype._undestroy=a.undestroy,_.prototype._destroy=function(U,z){z(U)},_.prototype.push=function(U,z){var ue=this._readableState,_e;return ue.objectMode?_e=!0:typeof U=="string"&&(z=z||ue.defaultEncoding,z!==ue.encoding&&(U=n.from(U,z),z=""),_e=!0),L(this,U,z,!1,_e)},_.prototype.unshift=function(U){return L(this,U,null,!0,!1)};function L(U,z,ue,_e,Be){c("readableAddChunk",z);var xe=U._readableState;if(z===null)xe.reading=!1,J(U,xe);else{var Fe;if(Be||(Fe=$(xe,z)),Fe)A(U,Fe);else if(xe.objectMode||z&&z.length>0)if(typeof z!="string"&&!xe.objectMode&&Object.getPrototypeOf(z)!==n.prototype&&(z=i(z)),_e)xe.endEmitted?A(U,new w):B(U,xe,z,!0);else if(xe.ended)A(U,new S);else{if(xe.destroyed)return!1;xe.reading=!1,xe.decoder&&!ue?(z=xe.decoder.write(z),xe.objectMode||z.length!==0?B(U,xe,z,!1):fe(U,xe)):B(U,xe,z,!1)}else _e||(xe.reading=!1,fe(U,xe))}return!xe.ended&&(xe.length<xe.highWaterMark||xe.length===0)}function B(U,z,ue,_e){z.flowing&&z.length===0&&!z.sync?(z.awaitDrain=0,U.emit("data",ue)):(z.length+=z.objectMode?1:ue.length,_e?z.buffer.unshift(ue):z.buffer.push(ue),z.needReadable&&le(U)),fe(U,z)}function $(U,z){var ue;return!s(z)&&typeof z!="string"&&z!==void 0&&!U.objectMode&&(ue=new E("chunk",["string","Buffer","Uint8Array"],z)),ue}_.prototype.isPaused=function(){return this._readableState.flowing===!1},_.prototype.setEncoding=function(U){y||(y=mu().StringDecoder);var z=new y(U);this._readableState.decoder=z,this._readableState.encoding=this._readableState.decoder.encoding;for(var ue=this._readableState.buffer.head,_e="";ue!==null;)_e+=z.write(ue.data),ue=ue.next;return this._readableState.buffer.clear(),_e!==""&&this._readableState.buffer.push(_e),this._readableState.length=_e.length,this};var D=1073741824;function H(U){return U>=D?U=D:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}function X(U,z){return U<=0||z.length===0&&z.ended?0:z.objectMode?1:U!==U?z.flowing&&z.length?z.buffer.head.data.length:z.length:(U>z.highWaterMark&&(z.highWaterMark=H(U)),U<=z.length?U:z.ended?z.length:(z.needReadable=!0,0))}_.prototype.read=function(U){c("read",U),U=parseInt(U,10);var z=this._readableState,ue=U;if(U!==0&&(z.emittedReadable=!1),U===0&&z.needReadable&&((z.highWaterMark!==0?z.length>=z.highWaterMark:z.length>0)||z.ended))return c("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?O(this):le(this),null;if(U=X(U,z),U===0&&z.ended)return z.length===0&&O(this),null;var _e=z.needReadable;c("need readable",_e),(z.length===0||z.length-U<z.highWaterMark)&&(_e=!0,c("length less than watermark",_e)),z.ended||z.reading?(_e=!1,c("reading or ended",_e)):_e&&(c("do read"),z.reading=!0,z.sync=!0,z.length===0&&(z.needReadable=!0),this._read(z.highWaterMark),z.sync=!1,z.reading||(U=X(ue,z)));var Be;return U>0?Be=F(U,z):Be=null,Be===null?(z.needReadable=z.length<=z.highWaterMark,U=0):(z.length-=U,z.awaitDrain=0),z.length===0&&(z.ended||(z.needReadable=!0),ue!==U&&z.ended&&O(this)),Be!==null&&this.emit("data",Be),Be};function J(U,z){if(c("onEofChunk"),!z.ended){if(z.decoder){var ue=z.decoder.end();ue&&ue.length&&(z.buffer.push(ue),z.length+=z.objectMode?1:ue.length)}z.ended=!0,z.sync?le(U):(z.needReadable=!1,z.emittedReadable||(z.emittedReadable=!0,me(U)))}}function le(U){var z=U._readableState;c("emitReadable",z.needReadable,z.emittedReadable),z.needReadable=!1,z.emittedReadable||(c("emitReadable",z.flowing),z.emittedReadable=!0,ye.nextTick(me,U))}function me(U){var z=U._readableState;c("emitReadable_",z.destroyed,z.length,z.ended),!z.destroyed&&(z.length||z.ended)&&(U.emit("readable"),z.emittedReadable=!1),z.needReadable=!z.flowing&&!z.ended&&z.length<=z.highWaterMark,Z(U)}function fe(U,z){z.readingMore||(z.readingMore=!0,ye.nextTick(we,U,z))}function we(U,z){for(;!z.reading&&!z.ended&&(z.length<z.highWaterMark||z.flowing&&z.length===0);){var ue=z.length;if(c("maybeReadMore read 0"),U.read(0),ue===z.length)break}z.readingMore=!1}_.prototype._read=function(U){A(this,new T("_read()"))},_.prototype.pipe=function(U,z){var ue=this,_e=this._readableState;switch(_e.pipesCount){case 0:_e.pipes=U;break;case 1:_e.pipes=[_e.pipes,U];break;default:_e.pipes.push(U);break}_e.pipesCount+=1,c("pipe count=%d opts=%j",_e.pipesCount,z);var Be=(!z||z.end!==!1)&&U!==ye.stdout&&U!==ye.stderr,xe=Be?Me:jt;_e.endEmitted?ye.nextTick(xe):ue.once("end",xe),U.on("unpipe",Fe);function Fe(nr,ct){c("onunpipe"),nr===ue&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Ue())}function Me(){c("onend"),U.end()}var ee=Se(ue);U.on("drain",ee);var Pe=!1;function Ue(){c("cleanup"),U.removeListener("close",vt),U.removeListener("finish",et),U.removeListener("drain",ee),U.removeListener("error",Ze),U.removeListener("unpipe",Fe),ue.removeListener("end",Me),ue.removeListener("end",jt),ue.removeListener("data",ze),Pe=!0,_e.awaitDrain&&(!U._writableState||U._writableState.needDrain)&&ee()}ue.on("data",ze);function ze(nr){c("ondata");var ct=U.write(nr);c("dest.write",ct),ct===!1&&((_e.pipesCount===1&&_e.pipes===U||_e.pipesCount>1&&W(_e.pipes,U)!==-1)&&!Pe&&(c("false write response, pause",_e.awaitDrain),_e.awaitDrain++),ue.pause())}function Ze(nr){c("onerror",nr),jt(),U.removeListener("error",Ze),t(U,"error")===0&&A(U,nr)}C(U,"error",Ze);function vt(){U.removeListener("finish",et),jt()}U.once("close",vt);function et(){c("onfinish"),U.removeListener("close",vt),jt()}U.once("finish",et);function jt(){c("unpipe"),ue.unpipe(U)}return U.emit("pipe",ue),_e.flowing||(c("pipe resume"),ue.resume()),U};function Se(U){return function(){var ue=U._readableState;c("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&t(U,"data")&&(ue.flowing=!0,Z(U))}}_.prototype.unpipe=function(U){var z=this._readableState,ue={hasUnpiped:!1};if(z.pipesCount===0)return this;if(z.pipesCount===1)return U&&U!==z.pipes?this:(U||(U=z.pipes),z.pipes=null,z.pipesCount=0,z.flowing=!1,U&&U.emit("unpipe",this,ue),this);if(!U){var _e=z.pipes,Be=z.pipesCount;z.pipes=null,z.pipesCount=0,z.flowing=!1;for(var xe=0;xe<Be;xe++)_e[xe].emit("unpipe",this,{hasUnpiped:!1});return this}var Fe=W(z.pipes,U);return Fe===-1?this:(z.pipes.splice(Fe,1),z.pipesCount-=1,z.pipesCount===1&&(z.pipes=z.pipes[0]),U.emit("unpipe",this,ue),this)},_.prototype.on=function(U,z){var ue=r.prototype.on.call(this,U,z),_e=this._readableState;return U==="data"?(_e.readableListening=this.listenerCount("readable")>0,_e.flowing!==!1&&this.resume()):U==="readable"&&!_e.endEmitted&&!_e.readableListening&&(_e.readableListening=_e.needReadable=!0,_e.flowing=!1,_e.emittedReadable=!1,c("on readable",_e.length,_e.reading),_e.length?le(this):_e.reading||ye.nextTick(oe,this)),ue},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(U,z){var ue=r.prototype.removeListener.call(this,U,z);return U==="readable"&&ye.nextTick(re,this),ue},_.prototype.removeAllListeners=function(U){var z=r.prototype.removeAllListeners.apply(this,arguments);return(U==="readable"||U===void 0)&&ye.nextTick(re,this),z};function re(U){var z=U._readableState;z.readableListening=U.listenerCount("readable")>0,z.resumeScheduled&&!z.paused?z.flowing=!0:U.listenerCount("data")>0&&U.resume()}function oe(U){c("readable nexttick read 0"),U.read(0)}_.prototype.resume=function(){var U=this._readableState;return U.flowing||(c("resume"),U.flowing=!U.readableListening,ae(this,U)),U.paused=!1,this};function ae(U,z){z.resumeScheduled||(z.resumeScheduled=!0,ye.nextTick(Ae,U,z))}function Ae(U,z){c("resume",z.reading),z.reading||U.read(0),z.resumeScheduled=!1,U.emit("resume"),Z(U),z.flowing&&!z.reading&&U.read(0)}_.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Z(U){var z=U._readableState;for(c("flow",z.flowing);z.flowing&&U.read()!==null;);}_.prototype.wrap=function(U){var z=this,ue=this._readableState,_e=!1;U.on("end",function(){if(c("wrapped end"),ue.decoder&&!ue.ended){var Fe=ue.decoder.end();Fe&&Fe.length&&z.push(Fe)}z.push(null)}),U.on("data",function(Fe){if(c("wrapped data"),ue.decoder&&(Fe=ue.decoder.write(Fe)),!(ue.objectMode&&Fe==null)&&!(!ue.objectMode&&(!Fe||!Fe.length))){var Me=z.push(Fe);Me||(_e=!0,U.pause())}});for(var Be in U)this[Be]===void 0&&typeof U[Be]=="function"&&(this[Be]=function(Me){return function(){return U[Me].apply(U,arguments)}}(Be));for(var xe=0;xe<R.length;xe++)U.on(R[xe],this.emit.bind(this,R[xe]));return this._read=function(Fe){c("wrapped _read",Fe),_e&&(_e=!1,U.resume())},this},typeof Symbol=="function"&&(_.prototype[Symbol.asyncIterator]=function(){return g===void 0&&(g=IR()),g(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(z){this._readableState&&(this._readableState.flowing=z)}}),_._fromList=F,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function F(U,z){if(z.length===0)return null;var ue;return z.objectMode?ue=z.buffer.shift():!U||U>=z.length?(z.decoder?ue=z.buffer.join(""):z.buffer.length===1?ue=z.buffer.first():ue=z.buffer.concat(z.length),z.buffer.clear()):ue=z.buffer.consume(U,z.decoder),ue}function O(U){var z=U._readableState;c("endReadable",z.endEmitted),z.endEmitted||(z.ended=!0,ye.nextTick(Q,z,U))}function Q(U,z){if(c("endReadableNT",U.endEmitted,U.length),!U.endEmitted&&U.length===0&&(U.endEmitted=!0,z.readable=!1,z.emit("end"),U.autoDestroy)){var ue=z._writableState;(!ue||ue.autoDestroy&&ue.finished)&&z.destroy()}}typeof Symbol=="function"&&(_.from=function(U,z){return v===void 0&&(v=CR()),v(_,U,z)});function W(U,z){for(var ue=0,_e=U.length;ue<_e;ue++)if(U[ue]===z)return ue;return-1}return Su}var Eu,km;function Nm(){if(km)return Eu;km=1,Eu=l;var e=xi().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=Oi();Zn()(l,i);function s(a,f){var d=this._transformState;d.transforming=!1;var b=d.writecb;if(b===null)return this.emit("error",new r);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),b(a);var E=this._readableState;E.reading=!1,(E.needReadable||E.length<E.highWaterMark)&&this._read(E.highWaterMark)}function l(a){if(!(this instanceof l))return new l(a);i.call(this,a),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",c)}function c(){var a=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,d){u(a,f,d)}):u(this,null,null)}l.prototype.push=function(a,f){return this._transformState.needTransform=!1,i.prototype.push.call(this,a,f)},l.prototype._transform=function(a,f,d){d(new t("_transform()"))},l.prototype._write=function(a,f,d){var b=this._transformState;if(b.writecb=d,b.writechunk=a,b.writeencoding=f,!b.transforming){var E=this._readableState;(b.needTransform||E.needReadable||E.length<E.highWaterMark)&&this._read(E.highWaterMark)}},l.prototype._read=function(a){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},l.prototype._destroy=function(a,f){i.prototype._destroy.call(this,a,function(d){f(d)})};function u(a,f,d){if(f)return a.emit("error",f);if(d!=null&&a.push(d),a._writableState.length)throw new o;if(a._transformState.transforming)throw new n;return a.push(null)}return Eu}var Tu,$m;function FR(){if($m)return Tu;$m=1,Tu=t;var e=Nm();Zn()(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,n,o){o(null,r)},Tu}var Au,Dm;function PR(){if(Dm)return Au;Dm=1;var e;function t(d){var b=!1;return function(){b||(b=!0,d.apply(void 0,arguments))}}var r=xi().codes,n=r.ERR_MISSING_ARGS,o=r.ERR_STREAM_DESTROYED;function i(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function l(d,b,E,S){S=t(S);var T=!1;d.on("close",function(){T=!0}),e===void 0&&(e=bu()),e(d,{readable:b,writable:E},function(y){if(y)return S(y);T=!0,S()});var w=!1;return function(y){if(!T&&!w){if(w=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();S(y||new o("pipe"))}}}function c(d){d()}function u(d,b){return d.pipe(b)}function a(d){return!d.length||typeof d[d.length-1]!="function"?i:d.pop()}function f(){for(var d=arguments.length,b=new Array(d),E=0;E<d;E++)b[E]=arguments[E];var S=a(b);if(Array.isArray(b[0])&&(b=b[0]),b.length<2)throw new n("streams");var T,w=b.map(function(y,g){var v=g<b.length-1,A=g>0;return l(y,v,A,function(R){T||(T=R),R&&w.forEach(c),!v&&(w.forEach(c),S(T))})});return b.reduce(u)}return Au=f,Au}var Ru,Lm;function xR(){if(Lm)return Ru;Lm=1,Ru=r;var e=rc().EventEmitter,t=Zn();t(r,e),r.Readable=Om(),r.Writable=Am(),r.Duplex=Oi(),r.Transform=Nm(),r.PassThrough=FR(),r.finished=bu(),r.pipeline=PR(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,o){var i=this;function s(b){n.writable&&n.write(b)===!1&&i.pause&&i.pause()}i.on("data",s);function l(){i.readable&&i.resume&&i.resume()}n.on("drain",l),!n._isStdio&&(!o||o.end!==!1)&&(i.on("end",u),i.on("close",a));var c=!1;function u(){c||(c=!0,n.end())}function a(){c||(c=!0,typeof n.destroy=="function"&&n.destroy())}function f(b){if(d(),e.listenerCount(this,"error")===0)throw b}i.on("error",f),n.on("error",f);function d(){i.removeListener("data",s),n.removeListener("drain",l),i.removeListener("end",u),i.removeListener("close",a),i.removeListener("error",f),n.removeListener("error",f),i.removeListener("end",d),i.removeListener("close",d),n.removeListener("close",d)}return i.on("end",d),i.on("close",d),n.on("close",d),n.emit("pipe",i),n},Ru}var Bm;function OR(){return Bm||(Bm=1,function(e){(function(t){t.parser=function(F,O){return new n(F,O)},t.SAXParser=n,t.SAXStream=a,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var r=["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 n(F,O){if(!(this instanceof n))return new n(F,O);var Q=this;i(Q),Q.q=Q.c="",Q.bufferCheckPosition=t.MAX_BUFFER_LENGTH,Q.opt=O||{},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=_.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(S)),Q.opt.unquotedAttributeValues===void 0&&(Q.opt.unquotedAttributeValues=!F),Q.trackPosition=Q.opt.position!==!1,Q.trackPosition&&(Q.position=Q.line=Q.column=0),B(Q,"onready")}Object.create||(Object.create=function(F){function O(){}O.prototype=F;var Q=new O;return Q}),Object.keys||(Object.keys=function(F){var O=[];for(var Q in F)F.hasOwnProperty(Q)&&O.push(Q);return O});function o(F){for(var O=Math.max(t.MAX_BUFFER_LENGTH,10),Q=0,W=0,U=r.length;W<U;W++){var z=F[r[W]].length;if(z>O)switch(r[W]){case"textNode":D(F);break;case"cdata":$(F,"oncdata",F.cdata),F.cdata="";break;case"script":$(F,"onscript",F.script),F.script="";break;default:X(F,"Max buffer length exceeded: "+r[W])}Q=Math.max(Q,z)}var ue=t.MAX_BUFFER_LENGTH-Q;F.bufferCheckPosition=ue+F.position}function i(F){for(var O=0,Q=r.length;O<Q;O++)F[r[O]]=""}function s(F){D(F),F.cdata!==""&&($(F,"oncdata",F.cdata),F.cdata=""),F.script!==""&&($(F,"onscript",F.script),F.script="")}n.prototype={end:function(){J(this)},write:Z,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var l;try{l=xR().Stream}catch{l=function(){}}l||(l=function(){});var c=t.EVENTS.filter(function(F){return F!=="error"&&F!=="end"});function u(F,O){return new a(F,O)}function a(F,O){if(!(this instanceof a))return new a(F,O);l.apply(this),this._parser=new n(F,O),this.writable=!0,this.readable=!0;var Q=this;this._parser.onend=function(){Q.emit("end")},this._parser.onerror=function(W){Q.emit("error",W),Q._parser.error=null},this._decoder=null,c.forEach(function(W){Object.defineProperty(Q,"on"+W,{get:function(){return Q._parser["on"+W]},set:function(U){if(!U)return Q.removeAllListeners(W),Q._parser["on"+W]=U,U;Q.on(W,U)},enumerable:!0,configurable:!1})})}a.prototype=Object.create(l.prototype,{constructor:{value:a}}),a.prototype.write=function(F){if(typeof As=="function"&&typeof As.isBuffer=="function"&&As.isBuffer(F)){if(!this._decoder){var O=mu().StringDecoder;this._decoder=new O("utf8")}F=this._decoder.write(F)}return this._parser.write(F.toString()),this.emit("data",F),!0},a.prototype.end=function(F){return F&&F.length&&this.write(F),this._parser.end(),!0},a.prototype.on=function(F,O){var Q=this;return!Q._parser["on"+F]&&c.indexOf(F)!==-1&&(Q._parser["on"+F]=function(){var W=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);W.splice(0,0,F),Q.emit.apply(Q,W)}),l.prototype.on.call(Q,F,O)};var f="[CDATA[",d="DOCTYPE",b="http://www.w3.org/XML/1998/namespace",E="http://www.w3.org/2000/xmlns/",S={xml:b,xmlns:E},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]/,w=/[:_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-]/,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]/,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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function v(F){return F===" "||F===`
31
+ `||F==="\r"||F===" "}function A(F){return F==='"'||F==="'"}function R(F){return F===">"||v(F)}function C(F,O){return F.test(O)}function P(F,O){return!C(F,O)}var _=0;t.STATE={BEGIN:_++,BEGIN_WHITESPACE:_++,TEXT:_++,TEXT_ENTITY:_++,OPEN_WAKA:_++,SGML_DECL:_++,SGML_DECL_QUOTED:_++,DOCTYPE:_++,DOCTYPE_QUOTED:_++,DOCTYPE_DTD:_++,DOCTYPE_DTD_QUOTED:_++,COMMENT_STARTING:_++,COMMENT:_++,COMMENT_ENDING:_++,COMMENT_ENDED:_++,CDATA:_++,CDATA_ENDING:_++,CDATA_ENDING_2:_++,PROC_INST:_++,PROC_INST_BODY:_++,PROC_INST_ENDING:_++,OPEN_TAG:_++,OPEN_TAG_SLASH:_++,ATTRIB:_++,ATTRIB_NAME:_++,ATTRIB_NAME_SAW_WHITE:_++,ATTRIB_VALUE:_++,ATTRIB_VALUE_QUOTED:_++,ATTRIB_VALUE_CLOSED:_++,ATTRIB_VALUE_UNQUOTED:_++,ATTRIB_VALUE_ENTITY_Q:_++,ATTRIB_VALUE_ENTITY_U:_++,CLOSE_TAG:_++,CLOSE_TAG_SAW_WHITE:_++,SCRIPT:_++,SCRIPT_ENDING:_++},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 O=t.ENTITIES[F],Q=typeof O=="number"?String.fromCharCode(O):O;t.ENTITIES[F]=Q});for(var L in t.STATE)t.STATE[t.STATE[L]]=L;_=t.STATE;function B(F,O,Q){F[O]&&F[O](Q)}function $(F,O,Q){F.textNode&&D(F),B(F,O,Q)}function D(F){F.textNode=H(F.opt,F.textNode),F.textNode&&B(F,"ontext",F.textNode),F.textNode=""}function H(F,O){return F.trim&&(O=O.trim()),F.normalize&&(O=O.replace(/\s+/g," ")),O}function X(F,O){return D(F),F.trackPosition&&(O+=`
32
+ Line: `+F.line+`
33
+ Column: `+F.column+`
34
+ Char: `+F.c),O=new Error(O),F.error=O,B(F,"onerror",O),F}function J(F){return F.sawRoot&&!F.closedRoot&&le(F,"Unclosed root tag"),F.state!==_.BEGIN&&F.state!==_.BEGIN_WHITESPACE&&F.state!==_.TEXT&&X(F,"Unexpected end"),D(F),F.c="",F.closed=!0,B(F,"onend"),n.call(F,F.strict,F.opt),F}function le(F,O){if(typeof F!="object"||!(F instanceof n))throw new Error("bad call to strictFail");F.strict&&X(F,O)}function me(F){F.strict||(F.tagName=F.tagName[F.looseCase]());var O=F.tags[F.tags.length-1]||F,Q=F.tag={name:F.tagName,attributes:{}};F.opt.xmlns&&(Q.ns=O.ns),F.attribList.length=0,$(F,"onopentagstart",Q)}function fe(F,O){var Q=F.indexOf(":"),W=Q<0?["",F]:F.split(":"),U=W[0],z=W[1];return O&&F==="xmlns"&&(U="xmlns",z=""),{prefix:U,local:z}}function we(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 O=fe(F.attribName,!0),Q=O.prefix,W=O.local;if(Q==="xmlns")if(W==="xml"&&F.attribValue!==b)le(F,"xml: prefix must be bound to "+b+`
35
+ Actual: `+F.attribValue);else if(W==="xmlns"&&F.attribValue!==E)le(F,"xmlns: prefix must be bound to "+E+`
36
+ Actual: `+F.attribValue);else{var U=F.tag,z=F.tags[F.tags.length-1]||F;U.ns===z.ns&&(U.ns=Object.create(z.ns)),U.ns[W]=F.attribValue}F.attribList.push([F.attribName,F.attribValue])}else F.tag.attributes[F.attribName]=F.attribValue,$(F,"onattribute",{name:F.attribName,value:F.attribValue});F.attribName=F.attribValue=""}function Se(F,O){if(F.opt.xmlns){var Q=F.tag,W=fe(F.tagName);Q.prefix=W.prefix,Q.local=W.local,Q.uri=Q.ns[W.prefix]||"",Q.prefix&&!Q.uri&&(le(F,"Unbound namespace prefix: "+JSON.stringify(F.tagName)),Q.uri=W.prefix);var U=F.tags[F.tags.length-1]||F;Q.ns&&U.ns!==Q.ns&&Object.keys(Q.ns).forEach(function(ze){$(F,"onopennamespace",{prefix:ze,uri:Q.ns[ze]})});for(var z=0,ue=F.attribList.length;z<ue;z++){var _e=F.attribList[z],Be=_e[0],xe=_e[1],Fe=fe(Be,!0),Me=Fe.prefix,ee=Fe.local,Pe=Me===""?"":Q.ns[Me]||"",Ue={name:Be,value:xe,prefix:Me,local:ee,uri:Pe};Me&&Me!=="xmlns"&&!Pe&&(le(F,"Unbound namespace prefix: "+JSON.stringify(Me)),Ue.uri=Me),F.tag.attributes[Be]=Ue,$(F,"onattribute",Ue)}F.attribList.length=0}F.tag.isSelfClosing=!!O,F.sawRoot=!0,F.tags.push(F.tag),$(F,"onopentag",F.tag),O||(!F.noscript&&F.tagName.toLowerCase()==="script"?F.state=_.SCRIPT:F.state=_.TEXT,F.tag=null,F.tagName=""),F.attribName=F.attribValue="",F.attribList.length=0}function re(F){if(!F.tagName){le(F,"Weird empty close tag."),F.textNode+="</>",F.state=_.TEXT;return}if(F.script){if(F.tagName!=="script"){F.script+="</"+F.tagName+">",F.tagName="",F.state=_.SCRIPT;return}$(F,"onscript",F.script),F.script=""}var O=F.tags.length,Q=F.tagName;F.strict||(Q=Q[F.looseCase]());for(var W=Q;O--;){var U=F.tags[O];if(U.name!==W)le(F,"Unexpected close tag");else break}if(O<0){le(F,"Unmatched closing tag: "+F.tagName),F.textNode+="</"+F.tagName+">",F.state=_.TEXT;return}F.tagName=Q;for(var z=F.tags.length;z-- >O;){var ue=F.tag=F.tags.pop();F.tagName=F.tag.name,$(F,"onclosetag",F.tagName);var _e={};for(var Be in ue.ns)_e[Be]=ue.ns[Be];var xe=F.tags[F.tags.length-1]||F;F.opt.xmlns&&ue.ns!==xe.ns&&Object.keys(ue.ns).forEach(function(Fe){var Me=ue.ns[Fe];$(F,"onclosenamespace",{prefix:Fe,uri:Me})})}O===0&&(F.closedRoot=!0),F.tagName=F.attribValue=F.attribName="",F.attribList.length=0,F.state=_.TEXT}function oe(F){var O=F.entity,Q=O.toLowerCase(),W,U="";return F.ENTITIES[O]?F.ENTITIES[O]:F.ENTITIES[Q]?F.ENTITIES[Q]:(O=Q,O.charAt(0)==="#"&&(O.charAt(1)==="x"?(O=O.slice(2),W=parseInt(O,16),U=W.toString(16)):(O=O.slice(1),W=parseInt(O,10),U=W.toString(10))),O=O.replace(/^0+/,""),isNaN(W)||U.toLowerCase()!==O?(le(F,"Invalid character entity"),"&"+F.entity+";"):String.fromCodePoint(W))}function ae(F,O){O==="<"?(F.state=_.OPEN_WAKA,F.startTagPosition=F.position):v(O)||(le(F,"Non-whitespace before first tag."),F.textNode=O,F.state=_.TEXT)}function Ae(F,O){var Q="";return O<F.length&&(Q=F.charAt(O)),Q}function Z(F){var O=this;if(this.error)throw this.error;if(O.closed)return X(O,"Cannot write after close. Assign an onready handler.");if(F===null)return J(O);typeof F=="object"&&(F=F.toString());for(var Q=0,W="";W=Ae(F,Q++),O.c=W,!!W;)switch(O.trackPosition&&(O.position++,W===`
37
+ `?(O.line++,O.column=0):O.column++),O.state){case _.BEGIN:if(O.state=_.BEGIN_WHITESPACE,W==="\uFEFF")continue;ae(O,W);continue;case _.BEGIN_WHITESPACE:ae(O,W);continue;case _.TEXT:if(O.sawRoot&&!O.closedRoot){for(var U=Q-1;W&&W!=="<"&&W!=="&";)W=Ae(F,Q++),W&&O.trackPosition&&(O.position++,W===`
38
+ `?(O.line++,O.column=0):O.column++);O.textNode+=F.substring(U,Q-1)}W==="<"&&!(O.sawRoot&&O.closedRoot&&!O.strict)?(O.state=_.OPEN_WAKA,O.startTagPosition=O.position):(!v(W)&&(!O.sawRoot||O.closedRoot)&&le(O,"Text data outside of root node."),W==="&"?O.state=_.TEXT_ENTITY:O.textNode+=W);continue;case _.SCRIPT:W==="<"?O.state=_.SCRIPT_ENDING:O.script+=W;continue;case _.SCRIPT_ENDING:W==="/"?O.state=_.CLOSE_TAG:(O.script+="<"+W,O.state=_.SCRIPT);continue;case _.OPEN_WAKA:if(W==="!")O.state=_.SGML_DECL,O.sgmlDecl="";else if(!v(W))if(C(T,W))O.state=_.OPEN_TAG,O.tagName=W;else if(W==="/")O.state=_.CLOSE_TAG,O.tagName="";else if(W==="?")O.state=_.PROC_INST,O.procInstName=O.procInstBody="";else{if(le(O,"Unencoded <"),O.startTagPosition+1<O.position){var z=O.position-O.startTagPosition;W=new Array(z).join(" ")+W}O.textNode+="<"+W,O.state=_.TEXT}continue;case _.SGML_DECL:if(O.sgmlDecl+W==="--"){O.state=_.COMMENT,O.comment="",O.sgmlDecl="";continue}O.doctype&&O.doctype!==!0&&O.sgmlDecl?(O.state=_.DOCTYPE_DTD,O.doctype+="<!"+O.sgmlDecl+W,O.sgmlDecl=""):(O.sgmlDecl+W).toUpperCase()===f?($(O,"onopencdata"),O.state=_.CDATA,O.sgmlDecl="",O.cdata=""):(O.sgmlDecl+W).toUpperCase()===d?(O.state=_.DOCTYPE,(O.doctype||O.sawRoot)&&le(O,"Inappropriately located doctype declaration"),O.doctype="",O.sgmlDecl=""):W===">"?($(O,"onsgmldeclaration",O.sgmlDecl),O.sgmlDecl="",O.state=_.TEXT):(A(W)&&(O.state=_.SGML_DECL_QUOTED),O.sgmlDecl+=W);continue;case _.SGML_DECL_QUOTED:W===O.q&&(O.state=_.SGML_DECL,O.q=""),O.sgmlDecl+=W;continue;case _.DOCTYPE:W===">"?(O.state=_.TEXT,$(O,"ondoctype",O.doctype),O.doctype=!0):(O.doctype+=W,W==="["?O.state=_.DOCTYPE_DTD:A(W)&&(O.state=_.DOCTYPE_QUOTED,O.q=W));continue;case _.DOCTYPE_QUOTED:O.doctype+=W,W===O.q&&(O.q="",O.state=_.DOCTYPE);continue;case _.DOCTYPE_DTD:W==="]"?(O.doctype+=W,O.state=_.DOCTYPE):W==="<"?(O.state=_.OPEN_WAKA,O.startTagPosition=O.position):A(W)?(O.doctype+=W,O.state=_.DOCTYPE_DTD_QUOTED,O.q=W):O.doctype+=W;continue;case _.DOCTYPE_DTD_QUOTED:O.doctype+=W,W===O.q&&(O.state=_.DOCTYPE_DTD,O.q="");continue;case _.COMMENT:W==="-"?O.state=_.COMMENT_ENDING:O.comment+=W;continue;case _.COMMENT_ENDING:W==="-"?(O.state=_.COMMENT_ENDED,O.comment=H(O.opt,O.comment),O.comment&&$(O,"oncomment",O.comment),O.comment=""):(O.comment+="-"+W,O.state=_.COMMENT);continue;case _.COMMENT_ENDED:W!==">"?(le(O,"Malformed comment"),O.comment+="--"+W,O.state=_.COMMENT):O.doctype&&O.doctype!==!0?O.state=_.DOCTYPE_DTD:O.state=_.TEXT;continue;case _.CDATA:W==="]"?O.state=_.CDATA_ENDING:O.cdata+=W;continue;case _.CDATA_ENDING:W==="]"?O.state=_.CDATA_ENDING_2:(O.cdata+="]"+W,O.state=_.CDATA);continue;case _.CDATA_ENDING_2:W===">"?(O.cdata&&$(O,"oncdata",O.cdata),$(O,"onclosecdata"),O.cdata="",O.state=_.TEXT):W==="]"?O.cdata+="]":(O.cdata+="]]"+W,O.state=_.CDATA);continue;case _.PROC_INST:W==="?"?O.state=_.PROC_INST_ENDING:v(W)?O.state=_.PROC_INST_BODY:O.procInstName+=W;continue;case _.PROC_INST_BODY:if(!O.procInstBody&&v(W))continue;W==="?"?O.state=_.PROC_INST_ENDING:O.procInstBody+=W;continue;case _.PROC_INST_ENDING:W===">"?($(O,"onprocessinginstruction",{name:O.procInstName,body:O.procInstBody}),O.procInstName=O.procInstBody="",O.state=_.TEXT):(O.procInstBody+="?"+W,O.state=_.PROC_INST_BODY);continue;case _.OPEN_TAG:C(w,W)?O.tagName+=W:(me(O),W===">"?Se(O):W==="/"?O.state=_.OPEN_TAG_SLASH:(v(W)||le(O,"Invalid character in tag name"),O.state=_.ATTRIB));continue;case _.OPEN_TAG_SLASH:W===">"?(Se(O,!0),re(O)):(le(O,"Forward-slash in opening tag not followed by >"),O.state=_.ATTRIB);continue;case _.ATTRIB:if(v(W))continue;W===">"?Se(O):W==="/"?O.state=_.OPEN_TAG_SLASH:C(T,W)?(O.attribName=W,O.attribValue="",O.state=_.ATTRIB_NAME):le(O,"Invalid attribute name");continue;case _.ATTRIB_NAME:W==="="?O.state=_.ATTRIB_VALUE:W===">"?(le(O,"Attribute without value"),O.attribValue=O.attribName,we(O),Se(O)):v(W)?O.state=_.ATTRIB_NAME_SAW_WHITE:C(w,W)?O.attribName+=W:le(O,"Invalid attribute name");continue;case _.ATTRIB_NAME_SAW_WHITE:if(W==="=")O.state=_.ATTRIB_VALUE;else{if(v(W))continue;le(O,"Attribute without value"),O.tag.attributes[O.attribName]="",O.attribValue="",$(O,"onattribute",{name:O.attribName,value:""}),O.attribName="",W===">"?Se(O):C(T,W)?(O.attribName=W,O.state=_.ATTRIB_NAME):(le(O,"Invalid attribute name"),O.state=_.ATTRIB)}continue;case _.ATTRIB_VALUE:if(v(W))continue;A(W)?(O.q=W,O.state=_.ATTRIB_VALUE_QUOTED):(O.opt.unquotedAttributeValues||X(O,"Unquoted attribute value"),O.state=_.ATTRIB_VALUE_UNQUOTED,O.attribValue=W);continue;case _.ATTRIB_VALUE_QUOTED:if(W!==O.q){W==="&"?O.state=_.ATTRIB_VALUE_ENTITY_Q:O.attribValue+=W;continue}we(O),O.q="",O.state=_.ATTRIB_VALUE_CLOSED;continue;case _.ATTRIB_VALUE_CLOSED:v(W)?O.state=_.ATTRIB:W===">"?Se(O):W==="/"?O.state=_.OPEN_TAG_SLASH:C(T,W)?(le(O,"No whitespace between attributes"),O.attribName=W,O.attribValue="",O.state=_.ATTRIB_NAME):le(O,"Invalid attribute name");continue;case _.ATTRIB_VALUE_UNQUOTED:if(!R(W)){W==="&"?O.state=_.ATTRIB_VALUE_ENTITY_U:O.attribValue+=W;continue}we(O),W===">"?Se(O):O.state=_.ATTRIB;continue;case _.CLOSE_TAG:if(O.tagName)W===">"?re(O):C(w,W)?O.tagName+=W:O.script?(O.script+="</"+O.tagName,O.tagName="",O.state=_.SCRIPT):(v(W)||le(O,"Invalid tagname in closing tag"),O.state=_.CLOSE_TAG_SAW_WHITE);else{if(v(W))continue;P(T,W)?O.script?(O.script+="</"+W,O.state=_.SCRIPT):le(O,"Invalid tagname in closing tag."):O.tagName=W}continue;case _.CLOSE_TAG_SAW_WHITE:if(v(W))continue;W===">"?re(O):le(O,"Invalid characters in closing tag");continue;case _.TEXT_ENTITY:case _.ATTRIB_VALUE_ENTITY_Q:case _.ATTRIB_VALUE_ENTITY_U:var ue,_e;switch(O.state){case _.TEXT_ENTITY:ue=_.TEXT,_e="textNode";break;case _.ATTRIB_VALUE_ENTITY_Q:ue=_.ATTRIB_VALUE_QUOTED,_e="attribValue";break;case _.ATTRIB_VALUE_ENTITY_U:ue=_.ATTRIB_VALUE_UNQUOTED,_e="attribValue";break}if(W===";"){var Be=oe(O);O.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Be)?(O.entity="",O.state=ue,O.write(Be)):(O[_e]+=Be,O.entity="",O.state=ue)}else C(O.entity.length?g:y,W)?O.entity+=W:(le(O,"Invalid character in entity name"),O[_e]+="&"+O.entity+W,O.entity="",O.state=ue);continue;default:throw new Error(O,"Unknown state: "+O.state)}return O.position>=O.bufferCheckPosition&&o(O),O}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var F=String.fromCharCode,O=Math.floor,Q=function(){var W=16384,U=[],z,ue,_e=-1,Be=arguments.length;if(!Be)return"";for(var xe="";++_e<Be;){var Fe=Number(arguments[_e]);if(!isFinite(Fe)||Fe<0||Fe>1114111||O(Fe)!==Fe)throw RangeError("Invalid code point: "+Fe);Fe<=65535?U.push(Fe):(Fe-=65536,z=(Fe>>10)+55296,ue=Fe%1024+56320,U.push(z,ue)),(_e+1===Be||U.length>W)&&(xe+=F.apply(null,U),U.length=0)}return xe};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:Q,configurable:!0,writable:!0}):String.fromCodePoint=Q}()})(e)}(tc)),tc}var _u,Mm;function Iu(){return Mm||(Mm=1,_u={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),_u}var Cu,jm;function Fu(){if(jm)return Cu;jm=1;var e=Iu().isArray;return Cu={copyOptions:function(t){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n},ensureFlagExists:function(t,r){(!(t in r)||typeof r[t]!="boolean")&&(r[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,r){(!(t+"Key"in r)||typeof r[t+"Key"]!="string")&&(r[t+"Key"]=r.compact?"_"+t:t)},checkFnExists:function(t,r){return t+"Fn"in r}},Cu}var Pu,Um;function qm(){if(Um)return Pu;Um=1;var e=OR(),t=Fu(),r=Iu().isArray,n,o;function i(w){return n=t.copyOptions(w),t.ensureFlagExists("ignoreDeclaration",n),t.ensureFlagExists("ignoreInstruction",n),t.ensureFlagExists("ignoreAttributes",n),t.ensureFlagExists("ignoreText",n),t.ensureFlagExists("ignoreComment",n),t.ensureFlagExists("ignoreCdata",n),t.ensureFlagExists("ignoreDoctype",n),t.ensureFlagExists("compact",n),t.ensureFlagExists("alwaysChildren",n),t.ensureFlagExists("addParent",n),t.ensureFlagExists("trim",n),t.ensureFlagExists("nativeType",n),t.ensureFlagExists("nativeTypeAttributes",n),t.ensureFlagExists("sanitize",n),t.ensureFlagExists("instructionHasAttributes",n),t.ensureFlagExists("captureSpacesBetweenElements",n),t.ensureAlwaysArrayExists(n),t.ensureKeyExists("declaration",n),t.ensureKeyExists("instruction",n),t.ensureKeyExists("attributes",n),t.ensureKeyExists("text",n),t.ensureKeyExists("comment",n),t.ensureKeyExists("cdata",n),t.ensureKeyExists("doctype",n),t.ensureKeyExists("type",n),t.ensureKeyExists("name",n),t.ensureKeyExists("elements",n),t.ensureKeyExists("parent",n),t.checkFnExists("doctype",n),t.checkFnExists("instruction",n),t.checkFnExists("cdata",n),t.checkFnExists("comment",n),t.checkFnExists("text",n),t.checkFnExists("instructionName",n),t.checkFnExists("elementName",n),t.checkFnExists("attributeName",n),t.checkFnExists("attributeValue",n),t.checkFnExists("attributes",n),n}function s(w){var y=Number(w);if(!isNaN(y))return y;var g=w.toLowerCase();return g==="true"?!0:g==="false"?!1:w}function l(w,y){var g;if(n.compact){if(!o[n[w+"Key"]]&&(r(n.alwaysArray)?n.alwaysArray.indexOf(n[w+"Key"])!==-1:n.alwaysArray)&&(o[n[w+"Key"]]=[]),o[n[w+"Key"]]&&!r(o[n[w+"Key"]])&&(o[n[w+"Key"]]=[o[n[w+"Key"]]]),w+"Fn"in n&&typeof y=="string"&&(y=n[w+"Fn"](y,o)),w==="instruction"&&("instructionFn"in n||"instructionNameFn"in n)){for(g in y)if(y.hasOwnProperty(g))if("instructionFn"in n)y[g]=n.instructionFn(y[g],g,o);else{var v=y[g];delete y[g],y[n.instructionNameFn(g,v,o)]=v}}r(o[n[w+"Key"]])?o[n[w+"Key"]].push(y):o[n[w+"Key"]]=y}else{o[n.elementsKey]||(o[n.elementsKey]=[]);var A={};if(A[n.typeKey]=w,w==="instruction"){for(g in y)if(y.hasOwnProperty(g))break;A[n.nameKey]="instructionNameFn"in n?n.instructionNameFn(g,y,o):g,n.instructionHasAttributes?(A[n.attributesKey]=y[g][n.attributesKey],"instructionFn"in n&&(A[n.attributesKey]=n.instructionFn(A[n.attributesKey],g,o))):("instructionFn"in n&&(y[g]=n.instructionFn(y[g],g,o)),A[n.instructionKey]=y[g])}else w+"Fn"in n&&(y=n[w+"Fn"](y,o)),A[n[w+"Key"]]=y;n.addParent&&(A[n.parentKey]=o),o[n.elementsKey].push(A)}}function c(w){if("attributesFn"in n&&w&&(w=n.attributesFn(w,o)),(n.trim||"attributeValueFn"in n||"attributeNameFn"in n||n.nativeTypeAttributes)&&w){var y;for(y in w)if(w.hasOwnProperty(y)&&(n.trim&&(w[y]=w[y].trim()),n.nativeTypeAttributes&&(w[y]=s(w[y])),"attributeValueFn"in n&&(w[y]=n.attributeValueFn(w[y],y,o)),"attributeNameFn"in n)){var g=w[y];delete w[y],w[n.attributeNameFn(y,w[y],o)]=g}}return w}function u(w){var y={};if(w.body&&(w.name.toLowerCase()==="xml"||n.instructionHasAttributes)){for(var g=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,v;(v=g.exec(w.body))!==null;)y[v[1]]=v[2]||v[3]||v[4];y=c(y)}if(w.name.toLowerCase()==="xml"){if(n.ignoreDeclaration)return;o[n.declarationKey]={},Object.keys(y).length&&(o[n.declarationKey][n.attributesKey]=y),n.addParent&&(o[n.declarationKey][n.parentKey]=o)}else{if(n.ignoreInstruction)return;n.trim&&(w.body=w.body.trim());var A={};n.instructionHasAttributes&&Object.keys(y).length?(A[w.name]={},A[w.name][n.attributesKey]=y):A[w.name]=w.body,l("instruction",A)}}function a(w,y){var g;if(typeof w=="object"&&(y=w.attributes,w=w.name),y=c(y),"elementNameFn"in n&&(w=n.elementNameFn(w,o)),n.compact){if(g={},!n.ignoreAttributes&&y&&Object.keys(y).length){g[n.attributesKey]={};var v;for(v in y)y.hasOwnProperty(v)&&(g[n.attributesKey][v]=y[v])}!(w in o)&&(r(n.alwaysArray)?n.alwaysArray.indexOf(w)!==-1:n.alwaysArray)&&(o[w]=[]),o[w]&&!r(o[w])&&(o[w]=[o[w]]),r(o[w])?o[w].push(g):o[w]=g}else o[n.elementsKey]||(o[n.elementsKey]=[]),g={},g[n.typeKey]="element",g[n.nameKey]=w,!n.ignoreAttributes&&y&&Object.keys(y).length&&(g[n.attributesKey]=y),n.alwaysChildren&&(g[n.elementsKey]=[]),o[n.elementsKey].push(g);g[n.parentKey]=o,o=g}function f(w){n.ignoreText||!w.trim()&&!n.captureSpacesBetweenElements||(n.trim&&(w=w.trim()),n.nativeType&&(w=s(w)),n.sanitize&&(w=w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),l("text",w))}function d(w){n.ignoreComment||(n.trim&&(w=w.trim()),l("comment",w))}function b(w){var y=o[n.parentKey];n.addParent||delete o[n.parentKey],o=y}function E(w){n.ignoreCdata||(n.trim&&(w=w.trim()),l("cdata",w))}function S(w){n.ignoreDoctype||(w=w.replace(/^ /,""),n.trim&&(w=w.trim()),l("doctype",w))}function T(w){w.note=w}return Pu=function(w,y){var g=e.parser(!0,{}),v={};if(o=v,n=i(y),g.opt={strictEntities:!0},g.onopentag=a,g.ontext=f,g.oncomment=d,g.onclosetag=b,g.onerror=T,g.oncdata=E,g.ondoctype=S,g.onprocessinginstruction=u,g.write(w).close(),v[n.elementsKey]){var A=v[n.elementsKey];delete v[n.elementsKey],v[n.elementsKey]=A,delete v.text}return v},Pu}var xu,Vm;function kR(){if(Vm)return xu;Vm=1;var e=Fu(),t=qm();function r(n){var o=e.copyOptions(n);return e.ensureSpacesExists(o),o}return xu=function(n,o){var i,s,l,c;return i=r(o),s=t(n,i),c="compact"in i&&i.compact?"_parent":"parent","addParent"in i&&i.addParent?l=JSON.stringify(s,function(u,a){return u===c?"_":a},i.spaces):l=JSON.stringify(s,null,i.spaces),l.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},xu}var Ou,zm;function Wm(){if(zm)return Ou;zm=1;var e=Fu(),t=Iu().isArray,r,n;function o(g){var v=e.copyOptions(g);return e.ensureFlagExists("ignoreDeclaration",v),e.ensureFlagExists("ignoreInstruction",v),e.ensureFlagExists("ignoreAttributes",v),e.ensureFlagExists("ignoreText",v),e.ensureFlagExists("ignoreComment",v),e.ensureFlagExists("ignoreCdata",v),e.ensureFlagExists("ignoreDoctype",v),e.ensureFlagExists("compact",v),e.ensureFlagExists("indentText",v),e.ensureFlagExists("indentCdata",v),e.ensureFlagExists("indentAttributes",v),e.ensureFlagExists("indentInstruction",v),e.ensureFlagExists("fullTagEmptyElement",v),e.ensureFlagExists("noQuotesForNativeAttributes",v),e.ensureSpacesExists(v),typeof v.spaces=="number"&&(v.spaces=Array(v.spaces+1).join(" ")),e.ensureKeyExists("declaration",v),e.ensureKeyExists("instruction",v),e.ensureKeyExists("attributes",v),e.ensureKeyExists("text",v),e.ensureKeyExists("comment",v),e.ensureKeyExists("cdata",v),e.ensureKeyExists("doctype",v),e.ensureKeyExists("type",v),e.ensureKeyExists("name",v),e.ensureKeyExists("elements",v),e.checkFnExists("doctype",v),e.checkFnExists("instruction",v),e.checkFnExists("cdata",v),e.checkFnExists("comment",v),e.checkFnExists("text",v),e.checkFnExists("instructionName",v),e.checkFnExists("elementName",v),e.checkFnExists("attributeName",v),e.checkFnExists("attributeValue",v),e.checkFnExists("attributes",v),e.checkFnExists("fullTagEmptyElement",v),v}function i(g,v,A){return(!A&&g.spaces?`
39
+ `:"")+Array(v+1).join(g.spaces)}function s(g,v,A){if(v.ignoreAttributes)return"";"attributesFn"in v&&(g=v.attributesFn(g,n,r));var R,C,P,_,L=[];for(R in g)g.hasOwnProperty(R)&&g[R]!==null&&g[R]!==void 0&&(_=v.noQuotesForNativeAttributes&&typeof g[R]!="string"?"":'"',C=""+g[R],C=C.replace(/"/g,"&quot;"),P="attributeNameFn"in v?v.attributeNameFn(R,C,n,r):R,L.push(v.spaces&&v.indentAttributes?i(v,A+1,!1):" "),L.push(P+"="+_+("attributeValueFn"in v?v.attributeValueFn(C,R,n,r):C)+_));return g&&Object.keys(g).length&&v.spaces&&v.indentAttributes&&L.push(i(v,A,!1)),L.join("")}function l(g,v,A){return r=g,n="xml",v.ignoreDeclaration?"":"<?xml"+s(g[v.attributesKey],v,A)+"?>"}function c(g,v,A){if(v.ignoreInstruction)return"";var R;for(R in g)if(g.hasOwnProperty(R))break;var C="instructionNameFn"in v?v.instructionNameFn(R,g[R],n,r):R;if(typeof g[R]=="object")return r=g,n=C,"<?"+C+s(g[R][v.attributesKey],v,A)+"?>";var P=g[R]?g[R]:"";return"instructionFn"in v&&(P=v.instructionFn(P,R,n,r)),"<?"+C+(P?" "+P:"")+"?>"}function u(g,v){return v.ignoreComment?"":"<!--"+("commentFn"in v?v.commentFn(g,n,r):g)+"-->"}function a(g,v){return v.ignoreCdata?"":"<![CDATA["+("cdataFn"in v?v.cdataFn(g,n,r):g.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function f(g,v){return v.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in v?v.doctypeFn(g,n,r):g)+">"}function d(g,v){return v.ignoreText?"":(g=""+g,g=g.replace(/&amp;/g,"&"),g=g.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in v?v.textFn(g,n,r):g)}function b(g,v){var A;if(g.elements&&g.elements.length)for(A=0;A<g.elements.length;++A)switch(g.elements[A][v.typeKey]){case"text":if(v.indentText)return!0;break;case"cdata":if(v.indentCdata)return!0;break;case"instruction":if(v.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function E(g,v,A){r=g,n=g.name;var R=[],C="elementNameFn"in v?v.elementNameFn(g.name,g):g.name;R.push("<"+C),g[v.attributesKey]&&R.push(s(g[v.attributesKey],v,A));var P=g[v.elementsKey]&&g[v.elementsKey].length||g[v.attributesKey]&&g[v.attributesKey]["xml:space"]==="preserve";return P||("fullTagEmptyElementFn"in v?P=v.fullTagEmptyElementFn(g.name,g):P=v.fullTagEmptyElement),P?(R.push(">"),g[v.elementsKey]&&g[v.elementsKey].length&&(R.push(S(g[v.elementsKey],v,A+1)),r=g,n=g.name),R.push(v.spaces&&b(g,v)?`
40
+ `+Array(A+1).join(v.spaces):""),R.push("</"+C+">")):R.push("/>"),R.join("")}function S(g,v,A,R){return g.reduce(function(C,P){var _=i(v,A,R&&!C);switch(P.type){case"element":return C+_+E(P,v,A);case"comment":return C+_+u(P[v.commentKey],v);case"doctype":return C+_+f(P[v.doctypeKey],v);case"cdata":return C+(v.indentCdata?_:"")+a(P[v.cdataKey],v);case"text":return C+(v.indentText?_:"")+d(P[v.textKey],v);case"instruction":var L={};return L[P[v.nameKey]]=P[v.attributesKey]?P:P[v.instructionKey],C+(v.indentInstruction?_:"")+c(L,v,A)}},"")}function T(g,v,A){var R;for(R in g)if(g.hasOwnProperty(R))switch(R){case v.parentKey:case v.attributesKey:break;case v.textKey:if(v.indentText||A)return!0;break;case v.cdataKey:if(v.indentCdata||A)return!0;break;case v.instructionKey:if(v.indentInstruction||A)return!0;break;case v.doctypeKey:case v.commentKey:return!0;default:return!0}return!1}function w(g,v,A,R,C){r=g,n=v;var P="elementNameFn"in A?A.elementNameFn(v,g):v;if(typeof g>"u"||g===null||g==="")return"fullTagEmptyElementFn"in A&&A.fullTagEmptyElementFn(v,g)||A.fullTagEmptyElement?"<"+P+"></"+P+">":"<"+P+"/>";var _=[];if(v){if(_.push("<"+P),typeof g!="object")return _.push(">"+d(g,A)+"</"+P+">"),_.join("");g[A.attributesKey]&&_.push(s(g[A.attributesKey],A,R));var L=T(g,A,!0)||g[A.attributesKey]&&g[A.attributesKey]["xml:space"]==="preserve";if(L||("fullTagEmptyElementFn"in A?L=A.fullTagEmptyElementFn(v,g):L=A.fullTagEmptyElement),L)_.push(">");else return _.push("/>"),_.join("")}return _.push(y(g,A,R+1,!1)),r=g,n=v,v&&_.push((C?i(A,R,!1):"")+"</"+P+">"),_.join("")}function y(g,v,A,R){var C,P,_,L=[];for(P in g)if(g.hasOwnProperty(P))for(_=t(g[P])?g[P]:[g[P]],C=0;C<_.length;++C){switch(P){case v.declarationKey:L.push(l(_[C],v,A));break;case v.instructionKey:L.push((v.indentInstruction?i(v,A,R):"")+c(_[C],v,A));break;case v.attributesKey:case v.parentKey:break;case v.textKey:L.push((v.indentText?i(v,A,R):"")+d(_[C],v));break;case v.cdataKey:L.push((v.indentCdata?i(v,A,R):"")+a(_[C],v));break;case v.doctypeKey:L.push(i(v,A,R)+f(_[C],v));break;case v.commentKey:L.push(i(v,A,R)+u(_[C],v));break;default:L.push(i(v,A,R)+w(_[C],P,v,A,T(_[C],v)))}R=R&&!L.length}return L.join("")}return Ou=function(g,v){v=o(v);var A=[];return r=g,n="_root_",v.compact?A.push(y(g,v,0,!0)):(g[v.declarationKey]&&A.push(l(g[v.declarationKey],v,0)),g[v.elementsKey]&&g[v.elementsKey].length&&A.push(S(g[v.elementsKey],v,0,!A.length))),A.join("")},Ou}var ku,Hm;function NR(){if(Hm)return ku;Hm=1;var e=Wm();return ku=function(t,r){t instanceof As&&(t=t.toString());var n=null;if(typeof t=="string")try{n=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else n=t;return e(n,r)},ku}var Nu,Gm;function $R(){if(Gm)return Nu;Gm=1;var e=qm(),t=kR(),r=Wm(),n=NR();return Nu={xml2js:e,xml2json:t,js2xml:r,json2xml:n},Nu}$R();/*! For license information please see index.js.LICENSE.txt */var DR={2:e=>{function t(o,i,s){o instanceof RegExp&&(o=r(o,s)),i instanceof RegExp&&(i=r(i,s));var l=n(o,i,s);return l&&{start:l[0],end:l[1],pre:s.slice(0,l[0]),body:s.slice(l[0]+o.length,l[1]),post:s.slice(l[1]+i.length)}}function r(o,i){var s=i.match(o);return s?s[0]:null}function n(o,i,s){var l,c,u,a,f,d=s.indexOf(o),b=s.indexOf(i,d+1),E=d;if(d>=0&&b>0){for(l=[],u=s.length;E>=0&&!f;)E==d?(l.push(E),d=s.indexOf(o,E+1)):l.length==1?f=[l.pop(),b]:((c=l.pop())<u&&(u=c,a=b),b=s.indexOf(i,E+1)),E=d<b&&d>=0?d:b;l.length&&(f=[u,a])}return f}e.exports=t,t.range=n},101:function(e,t,r){var n;e=r.nmd(e),function(o){var i=(e&&e.exports,typeof Pn=="object"&&Pn);i.global!==i&&i.window;var s=function(f){this.message=f};(s.prototype=new Error).name="InvalidCharacterError";var l=function(f){throw new s(f)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,a={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&l("The string to be encoded contains characters outside of the Latin1 range.");for(var d,b,E,S,T=f.length%3,w="",y=-1,g=f.length-T;++y<g;)d=f.charCodeAt(y)<<16,b=f.charCodeAt(++y)<<8,E=f.charCodeAt(++y),w+=c.charAt((S=d+b+E)>>18&63)+c.charAt(S>>12&63)+c.charAt(S>>6&63)+c.charAt(63&S);return T==2?(d=f.charCodeAt(y)<<8,b=f.charCodeAt(++y),w+=c.charAt((S=d+b)>>10)+c.charAt(S>>4&63)+c.charAt(S<<2&63)+"="):T==1&&(S=f.charCodeAt(y),w+=c.charAt(S>>2)+c.charAt(S<<4&63)+"=="),w},decode:function(f){var d=(f=String(f).replace(u,"")).length;d%4==0&&(d=(f=f.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(f))&&l("Invalid character: the string to be decoded is not correctly encoded.");for(var b,E,S=0,T="",w=-1;++w<d;)E=c.indexOf(f.charAt(w)),b=S%4?64*b+E:E,S++%4&&(T+=String.fromCharCode(255&b>>(-2*S&6)));return T},version:"1.0.0"};(n=(function(){return a}).call(t,r,t,e))===void 0||(e.exports=n)}()},172:(e,t)=>{t.d=function(r){if(!r)return 0;for(var n=(r=r.toString()).length,o=r.length;o--;){var i=r.charCodeAt(o);56320<=i&&i<=57343&&o--,127<i&&i<=2047?n++:2047<i&&i<=65535&&(n+=2)}return n}},526:e=>{var t={utf8:{stringToBytes:function(r){return t.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(t.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var n=[],o=0;o<r.length;o++)n.push(255&r.charCodeAt(o));return n},bytesToString:function(r){for(var n=[],o=0;o<r.length;o++)n.push(String.fromCharCode(r[o]));return n.join("")}}};e.exports=t},298:e=>{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return 16711935&r.rotl(n,8)|4278255360&r.rotl(n,24);for(var o=0;o<n.length;o++)n[o]=r.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(n){for(var o=[],i=0,s=0;i<n.length;i++,s+=8)o[s>>>5]|=n[i]<<24-s%32;return o},wordsToBytes:function(n){for(var o=[],i=0;i<32*n.length;i+=8)o.push(n[i>>>5]>>>24-i%32&255);return o},bytesToHex:function(n){for(var o=[],i=0;i<n.length;i++)o.push((n[i]>>>4).toString(16)),o.push((15&n[i]).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],i=0;i<n.length;i+=2)o.push(parseInt(n.substr(i,2),16));return o},bytesToBase64:function(n){for(var o=[],i=0;i<n.length;i+=3)for(var s=n[i]<<16|n[i+1]<<8|n[i+2],l=0;l<4;l++)8*i+6*l<=8*n.length?o.push(t.charAt(s>>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],i=0,s=0;i<n.length;s=++i%4)s!=0&&o.push((t.indexOf(n.charAt(i-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(n.charAt(i))>>>6-2*s);return o}},e.exports=r},635:(e,t,r)=>{const n=r(31),o=r(338),i=r(221);e.exports={XMLParser:o,XMLValidator:n,XMLBuilder:i}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?r=>{for(const n of t)if(typeof n=="string"&&r===n||n instanceof RegExp&&n.test(r))return!0}:()=>!1}},705:(e,t)=>{const r=":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="["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,s,l){if(s){const c=Object.keys(s),u=c.length;for(let a=0;a<u;a++)i[c[a]]=l==="strict"?[s[c[a]]]:s[c[a]]}},t.getValue=function(i){return t.isExist(i)?i:""},t.isName=function(i){return o.exec(i)!=null},t.getAllMatches=function(i,s){const l=[];let c=s.exec(i);for(;c;){const u=[];u.startIndex=s.lastIndex-c[0].length;const a=c.length;for(let f=0;f<a;f++)u.push(c[f]);l.push(u),c=s.exec(i)}return l},t.nameRegexp=n},31:(e,t,r)=>{const n=r(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(y){return y===" "||y===" "||y===`
41
+ `||y==="\r"}function s(y,g){const v=g;for(;g<y.length;g++)if(!(y[g]!="?"&&y[g]!=" ")){const A=y.substr(v,g-v);if(g>5&&A==="xml")return E("InvalidXml","XML declaration allowed only at the start of the document.",T(y,g));if(y[g]=="?"&&y[g+1]==">"){g++;break}}return g}function l(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}t.validate=function(y,g){g=Object.assign({},o,g);const v=[];let A=!1,R=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let P=0;P<y.length;P++)if(y[P]==="<"&&y[P+1]==="?"){if(P+=2,P=s(y,P),P.err)return P}else{if(y[P]!=="<"){if(i(y[P]))continue;return E("InvalidChar","char '"+y[P]+"' is not expected.",T(y,P))}{let _=P;if(P++,y[P]==="!"){P=l(y,P);continue}{let L=!1;y[P]==="/"&&(L=!0,P++);let B="";for(;P<y.length&&y[P]!==">"&&y[P]!==" "&&y[P]!==" "&&y[P]!==`
42
+ `&&y[P]!=="\r";P++)B+=y[P];if(B=B.trim(),B[B.length-1]==="/"&&(B=B.substring(0,B.length-1),P--),C=B,!n.isName(C)){let H;return H=B.trim().length===0?"Invalid space after '<'.":"Tag '"+B+"' is an invalid name.",E("InvalidTag",H,T(y,P))}const $=a(y,P);if($===!1)return E("InvalidAttr","Attributes for '"+B+"' have open quote.",T(y,P));let D=$.value;if(P=$.index,D[D.length-1]==="/"){const H=P-D.length;D=D.substring(0,D.length-1);const X=d(D,g);if(X!==!0)return E(X.err.code,X.err.msg,T(y,H+X.err.line));A=!0}else if(L){if(!$.tagClosed)return E("InvalidTag","Closing tag '"+B+"' doesn't have proper closing.",T(y,P));if(D.trim().length>0)return E("InvalidTag","Closing tag '"+B+"' can't have attributes or invalid starting.",T(y,_));if(v.length===0)return E("InvalidTag","Closing tag '"+B+"' has not been opened.",T(y,_));{const H=v.pop();if(B!==H.tagName){let X=T(y,H.tagStartPos);return E("InvalidTag","Expected closing tag '"+H.tagName+"' (opened in line "+X.line+", col "+X.col+") instead of closing tag '"+B+"'.",T(y,_))}v.length==0&&(R=!0)}}else{const H=d(D,g);if(H!==!0)return E(H.err.code,H.err.msg,T(y,P-D.length+H.err.line));if(R===!0)return E("InvalidXml","Multiple possible root nodes found.",T(y,P));g.unpairedTags.indexOf(B)!==-1||v.push({tagName:B,tagStartPos:_}),A=!0}for(P++;P<y.length;P++)if(y[P]==="<"){if(y[P+1]==="!"){P++,P=l(y,P);continue}if(y[P+1]!=="?")break;if(P=s(y,++P),P.err)return P}else if(y[P]==="&"){const H=b(y,P);if(H==-1)return E("InvalidChar","char '&' is not expected.",T(y,P));P=H}else if(R===!0&&!i(y[P]))return E("InvalidXml","Extra text at the end",T(y,P));y[P]==="<"&&P--}}}var C;return A?v.length==1?E("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",T(y,v[0].tagStartPos)):!(v.length>0)||E("InvalidXml","Invalid '"+JSON.stringify(v.map(P=>P.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):E("InvalidXml","Start tag expected.",1)};const c='"',u="'";function a(y,g){let v="",A="",R=!1;for(;g<y.length;g++){if(y[g]===c||y[g]===u)A===""?A=y[g]:A!==y[g]||(A="");else if(y[g]===">"&&A===""){R=!0;break}v+=y[g]}return A===""&&{value:v,index:g,tagClosed:R}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(y,g){const v=n.getAllMatches(y,f),A={};for(let R=0;R<v.length;R++){if(v[R][1].length===0)return E("InvalidAttr","Attribute '"+v[R][2]+"' has no space in starting.",w(v[R]));if(v[R][3]!==void 0&&v[R][4]===void 0)return E("InvalidAttr","Attribute '"+v[R][2]+"' is without value.",w(v[R]));if(v[R][3]===void 0&&!g.allowBooleanAttributes)return E("InvalidAttr","boolean attribute '"+v[R][2]+"' is not allowed.",w(v[R]));const C=v[R][2];if(!S(C))return E("InvalidAttr","Attribute '"+C+"' is an invalid name.",w(v[R]));if(A.hasOwnProperty(C))return E("InvalidAttr","Attribute '"+C+"' is repeated.",w(v[R]));A[C]=1}return!0}function b(y,g){if(y[++g]===";")return-1;if(y[g]==="#")return function(A,R){let C=/\d/;for(A[R]==="x"&&(R++,C=/[\da-fA-F]/);R<A.length;R++){if(A[R]===";")return R;if(!A[R].match(C))break}return-1}(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 E(y,g,v){return{err:{code:y,msg:g,line:v.line||v,col:v.col}}}function S(y){return n.isName(y)}function T(y,g){const v=y.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function w(y){return y.startIndex+y[1].length}},221:(e,t,r)=>{const n=r(87),o=r(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,f){return f},attributeValueProcessor:function(a,f){return f},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(a){this.options=Object.assign({},i,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=l,this.options.format?(this.indentate=c,this.tagEndChar=`>
43
43
  `,this.newLine=`
44
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function l(a,f,d,b){const E=this.j2x(a,d+1,b.concat(f));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],f,E.attrStr,d):this.buildObjectNode(E.val,f,E.attrStr,d)}function c(a){return this.options.indentBy.repeat(a)}function u(a){return!(!a.startsWith(this.options.attributeNamePrefix)||a===this.options.textNodeName)&&a.substr(this.attrPrefixLen)}s.prototype.build=function(a){return this.options.preserveOrder?n(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},s.prototype.j2x=function(a,f,d){let b="",E="";const w=d.join(".");for(let R in a)if(Object.prototype.hasOwnProperty.call(a,R))if(a[R]===void 0)this.isAttribute(R)&&(E+="");else if(a[R]===null)this.isAttribute(R)?E+="":R[0]==="?"?E+=this.indentate(f)+"<"+R+"?"+this.tagEndChar:E+=this.indentate(f)+"<"+R+"/"+this.tagEndChar;else if(a[R]instanceof Date)E+=this.buildTextValNode(a[R],R,"",f);else if(typeof a[R]!="object"){const S=this.isAttribute(R);if(S&&!this.ignoreAttributesFn(S,w))b+=this.buildAttrPairStr(S,""+a[R]);else if(!S)if(R===this.options.textNodeName){let m=this.options.tagValueProcessor(R,""+a[R]);E+=this.replaceEntitiesValue(m)}else E+=this.buildTextValNode(a[R],R,"",f)}else if(Array.isArray(a[R])){const S=a[R].length;let m="",g="";for(let v=0;v<S;v++){const T=a[R][v];if(T!==void 0)if(T===null)R[0]==="?"?E+=this.indentate(f)+"<"+R+"?"+this.tagEndChar:E+=this.indentate(f)+"<"+R+"/"+this.tagEndChar;else if(typeof T=="object")if(this.options.oneListGroup){const A=this.j2x(T,f+1,d.concat(R));m+=A.val,this.options.attributesGroupName&&T.hasOwnProperty(this.options.attributesGroupName)&&(g+=A.attrStr)}else m+=this.processTextOrObjNode(T,R,f,d);else if(this.options.oneListGroup){let A=this.options.tagValueProcessor(R,T);A=this.replaceEntitiesValue(A),m+=A}else m+=this.buildTextValNode(T,R,"",f)}this.options.oneListGroup&&(m=this.buildObjectNode(m,R,g,f)),E+=m}else if(this.options.attributesGroupName&&R===this.options.attributesGroupName){const S=Object.keys(a[R]),m=S.length;for(let g=0;g<m;g++)b+=this.buildAttrPairStr(S[g],""+a[R][S[g]])}else E+=this.processTextOrObjNode(a[R],R,f,d);return{attrStr:b,val:E}},s.prototype.buildAttrPairStr=function(a,f){return f=this.options.attributeValueProcessor(a,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+a:" "+a+'="'+f+'"'},s.prototype.buildObjectNode=function(a,f,d,b){if(a==="")return f[0]==="?"?this.indentate(b)+"<"+f+d+"?"+this.tagEndChar:this.indentate(b)+"<"+f+d+this.closeTag(f)+this.tagEndChar;{let E="</"+f+this.tagEndChar,w="";return f[0]==="?"&&(w="?",E=""),!d&&d!==""||a.indexOf("<")!==-1?this.options.commentPropName!==!1&&f===this.options.commentPropName&&w.length===0?this.indentate(b)+`<!--${a}-->`+this.newLine:this.indentate(b)+"<"+f+d+w+this.tagEndChar+a+this.indentate(b)+E:this.indentate(b)+"<"+f+d+w+">"+a+E}},s.prototype.closeTag=function(a){let f="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(f="/"):f=this.options.suppressEmptyNode?"/":`></${a}`,f},s.prototype.buildTextValNode=function(a,f,d,b){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(b)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(b)+`<!--${a}-->`+this.newLine;if(f[0]==="?")return this.indentate(b)+"<"+f+d+"?"+this.tagEndChar;{let E=this.options.tagValueProcessor(f,a);return E=this.replaceEntitiesValue(E),E===""?this.indentate(b)+"<"+f+d+this.closeTag(f)+this.tagEndChar:this.indentate(b)+"<"+f+d+">"+E+"</"+f+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const d=this.options.entities[f];a=a.replace(d.regex,d.val)}return a},e.exports=s},87:e=>{function t(s,l,c,u){let a="",f=!1;for(let d=0;d<s.length;d++){const b=s[d],E=r(b);if(E===void 0)continue;let w="";if(w=c.length===0?E:`${c}.${E}`,E===l.textNodeName){let g=b[E];o(w,l)||(g=l.tagValueProcessor(E,g),g=i(g,l)),f&&(a+=u),a+=g,f=!1;continue}if(E===l.cdataPropName){f&&(a+=u),a+=`<![CDATA[${b[E][0][l.textNodeName]}]]>`,f=!1;continue}if(E===l.commentPropName){a+=u+`<!--${b[E][0][l.textNodeName]}-->`,f=!0;continue}if(E[0]==="?"){const g=n(b[":@"],l),v=E==="?xml"?"":u;let T=b[E][0][l.textNodeName];T=T.length!==0?" "+T:"",a+=v+`<${E}${T}${g}?>`,f=!0;continue}let R=u;R!==""&&(R+=l.indentBy);const S=u+`<${E}${n(b[":@"],l)}`,m=t(b[E],l,w,R);l.unpairedTags.indexOf(E)!==-1?l.suppressUnpairedNode?a+=S+">":a+=S+"/>":m&&m.length!==0||!l.suppressEmptyNode?m&&m.endsWith(">")?a+=S+`>${m}${u}</${E}>`:(a+=S+">",m&&u!==""&&(m.includes("/>")||m.includes("</"))?a+=u+l.indentBy+m+u:a+=m,a+=`</${E}>`):a+=S+"/>",f=!0}return a}function r(s){const l=Object.keys(s);for(let c=0;c<l.length;c++){const u=l[c];if(s.hasOwnProperty(u)&&u!==":@")return u}}function n(s,l){let c="";if(s&&!l.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let a=l.attributeValueProcessor(u,s[u]);a=i(a,l),a===!0&&l.suppressBooleanAttributes?c+=` ${u.substr(l.attributeNamePrefix.length)}`:c+=` ${u.substr(l.attributeNamePrefix.length)}="${a}"`}return c}function o(s,l){let c=(s=s.substr(0,s.length-l.textNodeName.length-1)).substr(s.lastIndexOf(".")+1);for(let u in l.stopNodes)if(l.stopNodes[u]===s||l.stopNodes[u]==="*."+c)return!0;return!1}function i(s,l){if(s&&s.length>0&&l.processEntities)for(let c=0;c<l.entities.length;c++){const u=l.entities[c];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,l){let c="";return l.format&&l.indentBy.length>0&&(c=`
45
- `),t(s,l,"",c)}},193:(e,t,r)=>{const n=r(705);function o(f,d){let b="";for(;d<f.length&&f[d]!=="'"&&f[d]!=='"';d++)b+=f[d];if(b=b.trim(),b.indexOf(" ")!==-1)throw new Error("External entites are not supported");const E=f[d++];let w="";for(;d<f.length&&f[d]!==E;d++)w+=f[d];return[b,w,d]}function i(f,d){return f[d+1]==="!"&&f[d+2]==="-"&&f[d+3]==="-"}function s(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="N"&&f[d+4]==="T"&&f[d+5]==="I"&&f[d+6]==="T"&&f[d+7]==="Y"}function l(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="L"&&f[d+4]==="E"&&f[d+5]==="M"&&f[d+6]==="E"&&f[d+7]==="N"&&f[d+8]==="T"}function c(f,d){return f[d+1]==="!"&&f[d+2]==="A"&&f[d+3]==="T"&&f[d+4]==="T"&&f[d+5]==="L"&&f[d+6]==="I"&&f[d+7]==="S"&&f[d+8]==="T"}function u(f,d){return f[d+1]==="!"&&f[d+2]==="N"&&f[d+3]==="O"&&f[d+4]==="T"&&f[d+5]==="A"&&f[d+6]==="T"&&f[d+7]==="I"&&f[d+8]==="O"&&f[d+9]==="N"}function a(f){if(n.isName(f))return f;throw new Error(`Invalid entity name ${f}`)}e.exports=function(f,d){const b={};if(f[d+3]!=="O"||f[d+4]!=="C"||f[d+5]!=="T"||f[d+6]!=="Y"||f[d+7]!=="P"||f[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let E=1,w=!1,R=!1,S="";for(;d<f.length;d++)if(f[d]!=="<"||R)if(f[d]===">"){if(R?f[d-1]==="-"&&f[d-2]==="-"&&(R=!1,E--):E--,E===0)break}else f[d]==="["?w=!0:S+=f[d];else{if(w&&s(f,d)){let m,g;d+=7,[m,g,d]=o(f,d+1),g.indexOf("&")===-1&&(b[a(m)]={regx:RegExp(`&${m};`,"g"),val:g})}else if(w&&l(f,d))d+=8;else if(w&&c(f,d))d+=8;else if(w&&u(f,d))d+=9;else{if(!i)throw new Error("Invalid DOCTYPE");R=!0}E++,S=""}if(E!==0)throw new Error("Unclosed DOCTYPE")}return{entities:b,i:d}}},63:(e,t)=>{const r={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,o){return o},attributeValueProcessor:function(n,o){return o},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,o,i){return n}};t.buildOptions=function(n){return Object.assign({},r,n)},t.defaultOptions=r},299:(e,t,r)=>{const n=r(705),o=r(365),i=r(193),s=r(494),l=r(118);function c(A){const F=Object.keys(A);for(let C=0;C<F.length;C++){const I=F[C];this.lastEntities[I]={regex:new RegExp("&"+I+";","g"),val:A[I]}}}function u(A,F,C,I,L,B,$){if(A!==void 0&&(this.options.trimValues&&!I&&(A=A.trim()),A.length>0)){$||(A=this.replaceEntitiesValue(A));const D=this.options.tagValueProcessor(F,A,C,L,B);return D==null?A:typeof D!=typeof A||D!==A?D:this.options.trimValues||A.trim()===A?T(A,this.options.parseTagValue,this.options.numberParseOptions):A}}function a(A){if(this.options.removeNSPrefix){const F=A.split(":"),C=A.charAt(0)==="/"?"/":"";if(F[0]==="xmlns")return"";F.length===2&&(A=C+F[1])}return A}const f=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(A,F,C){if(this.options.ignoreAttributes!==!0&&typeof A=="string"){const I=n.getAllMatches(A,f),L=I.length,B={};for(let $=0;$<L;$++){const D=this.resolveNameSpace(I[$][1]);if(this.ignoreAttributesFn(D,F))continue;let H=I[$][4],ee=this.options.attributeNamePrefix+D;if(D.length)if(this.options.transformAttributeName&&(ee=this.options.transformAttributeName(ee)),ee==="__proto__"&&(ee="#__proto__"),H!==void 0){this.options.trimValues&&(H=H.trim()),H=this.replaceEntitiesValue(H);const J=this.options.attributeValueProcessor(D,H,F);B[ee]=J==null?H:typeof J!=typeof H||J!==H?J:T(H,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(B[ee]=!0)}if(!Object.keys(B).length)return;if(this.options.attributesGroupName){const $={};return $[this.options.attributesGroupName]=B,$}return B}}const b=function(A){A=A.replace(/\r\n?/g,`
46
- `);const F=new o("!xml");let C=F,I="",L="";for(let B=0;B<A.length;B++)if(A[B]==="<")if(A[B+1]==="/"){const $=m(A,">",B,"Closing Tag is not closed.");let D=A.substring(B+2,$).trim();if(this.options.removeNSPrefix){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),C&&(I=this.saveTextToParentTag(I,C,L));const H=L.substring(L.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let ee=0;H&&this.options.unpairedTags.indexOf(H)!==-1?(ee=L.lastIndexOf(".",L.lastIndexOf(".")-1),this.tagsNodeStack.pop()):ee=L.lastIndexOf("."),L=L.substring(0,ee),C=this.tagsNodeStack.pop(),I="",B=$}else if(A[B+1]==="?"){let $=g(A,B,!1,"?>");if(!$)throw new Error("Pi Tag is not closed.");if(I=this.saveTextToParentTag(I,C,L),!(this.options.ignoreDeclaration&&$.tagName==="?xml"||this.options.ignorePiTags)){const D=new o($.tagName);D.add(this.options.textNodeName,""),$.tagName!==$.tagExp&&$.attrExpPresent&&(D[":@"]=this.buildAttributesMap($.tagExp,L,$.tagName)),this.addChild(C,D,L)}B=$.closeIndex+1}else if(A.substr(B+1,3)==="!--"){const $=m(A,"-->",B+4,"Comment is not closed.");if(this.options.commentPropName){const D=A.substring(B+4,$-2);I=this.saveTextToParentTag(I,C,L),C.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}B=$}else if(A.substr(B+1,2)==="!D"){const $=i(A,B);this.docTypeEntities=$.entities,B=$.i}else if(A.substr(B+1,2)==="!["){const $=m(A,"]]>",B,"CDATA is not closed.")-2,D=A.substring(B+9,$);I=this.saveTextToParentTag(I,C,L);let H=this.parseTextData(D,C.tagname,L,!0,!1,!0,!0);H==null&&(H=""),this.options.cdataPropName?C.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):C.add(this.options.textNodeName,H),B=$+2}else{let $=g(A,B,this.options.removeNSPrefix),D=$.tagName;const H=$.rawTagName;let ee=$.tagExp,J=$.attrExpPresent,ce=$.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),C&&I&&C.tagname!=="!xml"&&(I=this.saveTextToParentTag(I,C,L,!1));const be=C;if(be&&this.options.unpairedTags.indexOf(be.tagname)!==-1&&(C=this.tagsNodeStack.pop(),L=L.substring(0,L.lastIndexOf("."))),D!==F.tagname&&(L+=L?"."+D:D),this.isItStopNode(this.options.stopNodes,L,D)){let de="";if(ee.length>0&&ee.lastIndexOf("/")===ee.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),L=L.substr(0,L.length-1),ee=D):ee=ee.substr(0,ee.length-1),B=$.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)B=$.closeIndex;else{const Ae=this.readStopNodeData(A,H,ce+1);if(!Ae)throw new Error(`Unexpected end of ${H}`);B=Ae.i,de=Ae.tagContent}const Se=new o(D);D!==ee&&J&&(Se[":@"]=this.buildAttributesMap(ee,L,D)),de&&(de=this.parseTextData(de,D,L,!0,J,!0,!0)),L=L.substr(0,L.lastIndexOf(".")),Se.add(this.options.textNodeName,de),this.addChild(C,Se,L)}else{if(ee.length>0&&ee.lastIndexOf("/")===ee.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),L=L.substr(0,L.length-1),ee=D):ee=ee.substr(0,ee.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const de=new o(D);D!==ee&&J&&(de[":@"]=this.buildAttributesMap(ee,L,D)),this.addChild(C,de,L),L=L.substr(0,L.lastIndexOf("."))}else{const de=new o(D);this.tagsNodeStack.push(C),D!==ee&&J&&(de[":@"]=this.buildAttributesMap(ee,L,D)),this.addChild(C,de,L),C=de}I="",B=ce}}else I+=A[B];return F.child};function E(A,F,C){const I=this.options.updateTag(F.tagname,C,F[":@"]);I===!1||(typeof I=="string"&&(F.tagname=I),A.addChild(F))}const w=function(A){if(this.options.processEntities){for(let F in this.docTypeEntities){const C=this.docTypeEntities[F];A=A.replace(C.regx,C.val)}for(let F in this.lastEntities){const C=this.lastEntities[F];A=A.replace(C.regex,C.val)}if(this.options.htmlEntities)for(let F in this.htmlEntities){const C=this.htmlEntities[F];A=A.replace(C.regex,C.val)}A=A.replace(this.ampEntity.regex,this.ampEntity.val)}return A};function R(A,F,C,I){return A&&(I===void 0&&(I=Object.keys(F.child).length===0),(A=this.parseTextData(A,F.tagname,C,!1,!!F[":@"]&&Object.keys(F[":@"]).length!==0,I))!==void 0&&A!==""&&F.add(this.options.textNodeName,A),A=""),A}function S(A,F,C){const I="*."+C;for(const L in A){const B=A[L];if(I===B||F===B)return!0}return!1}function m(A,F,C,I){const L=A.indexOf(F,C);if(L===-1)throw new Error(I);return L+F.length-1}function g(A,F,C){const I=function(J,ce){let be,de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",Se="";for(let Ae=ce;Ae<J.length;Ae++){let ne=J[Ae];if(be)ne===be&&(be="");else if(ne==='"'||ne==="'")be=ne;else if(ne===de[0]){if(!de[1])return{data:Se,index:Ae};if(J[Ae+1]===de[1])return{data:Se,index:Ae}}else ne===" "&&(ne=" ");Se+=ne}}(A,F+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!I)return;let L=I.data;const B=I.index,$=L.search(/\s/);let D=L,H=!0;$!==-1&&(D=L.substring(0,$),L=L.substring($+1).trimStart());const ee=D;if(C){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1),H=D!==I.data.substr(J+1))}return{tagName:D,tagExp:L,closeIndex:B,attrExpPresent:H,rawTagName:ee}}function v(A,F,C){const I=C;let L=1;for(;C<A.length;C++)if(A[C]==="<")if(A[C+1]==="/"){const B=m(A,">",C,`${F} is not closed`);if(A.substring(C+2,B).trim()===F&&(L--,L===0))return{tagContent:A.substring(I,C),i:B};C=B}else if(A[C+1]==="?")C=m(A,"?>",C+1,"StopNode is not closed.");else if(A.substr(C+1,3)==="!--")C=m(A,"-->",C+3,"StopNode is not closed.");else if(A.substr(C+1,2)==="![")C=m(A,"]]>",C,"StopNode is not closed.")-2;else{const B=g(A,C,">");B&&((B&&B.tagName)===F&&B.tagExp[B.tagExp.length-1]!=="/"&&L++,C=B.closeIndex)}}function T(A,F,C){if(F&&typeof A=="string"){const I=A.trim();return I==="true"||I!=="false"&&s(A,C)}return n.isExist(A)?A:""}e.exports=class{constructor(A){this.options=A,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:(F,C)=>String.fromCharCode(Number.parseInt(C,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(F,C)=>String.fromCharCode(Number.parseInt(C,16))}},this.addExternalEntities=c,this.parseXml=b,this.parseTextData=u,this.resolveNameSpace=a,this.buildAttributesMap=d,this.isItStopNode=S,this.replaceEntitiesValue=w,this.readStopNodeData=v,this.saveTextToParentTag=R,this.addChild=E,this.ignoreAttributesFn=l(this.options.ignoreAttributes)}}},338:(e,t,r)=>{const{buildOptions:n}=r(63),o=r(299),{prettify:i}=r(728),s=r(31);e.exports=class{constructor(l){this.externalEntities={},this.options=n(l)}parse(l,c){if(typeof l!="string"){if(!l.toString)throw new Error("XML data is accepted in String or Bytes[] form.");l=l.toString()}if(c){c===!0&&(c={});const f=s.validate(l,c);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const u=new o(this.options);u.addExternalEntities(this.externalEntities);const a=u.parseXml(l);return this.options.preserveOrder||a===void 0?a:i(a,this.options)}addEntity(l,c){if(c.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(l.indexOf("&")!==-1||l.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(c==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[l]=c}}},728:(e,t)=>{function r(s,l,c){let u;const a={};for(let f=0;f<s.length;f++){const d=s[f],b=n(d);let E="";if(E=c===void 0?b:c+"."+b,b===l.textNodeName)u===void 0?u=d[b]:u+=""+d[b];else{if(b===void 0)continue;if(d[b]){let w=r(d[b],l,E);const R=i(w,l);d[":@"]?o(w,d[":@"],E,l):Object.keys(w).length!==1||w[l.textNodeName]===void 0||l.alwaysCreateTextNode?Object.keys(w).length===0&&(l.alwaysCreateTextNode?w[l.textNodeName]="":w=""):w=w[l.textNodeName],a[b]!==void 0&&a.hasOwnProperty(b)?(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(w)):l.isArray(b,E,R)?a[b]=[w]:a[b]=w}}}return typeof u=="string"?u.length>0&&(a[l.textNodeName]=u):u!==void 0&&(a[l.textNodeName]=u),a}function n(s){const l=Object.keys(s);for(let c=0;c<l.length;c++){const u=l[c];if(u!==":@")return u}}function o(s,l,c,u){if(l){const a=Object.keys(l),f=a.length;for(let d=0;d<f;d++){const b=a[d];u.isArray(b,c+"."+b,!0,!0)?s[b]=[l[b]]:s[b]=l[b]}}}function i(s,l){const{textNodeName:c}=l,u=Object.keys(s).length;return u===0||!(u!==1||!s[c]&&typeof s[c]!="boolean"&&s[c]!==0)}t.prettify=function(s,l){return r(s,l)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}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(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}e.exports=function(r){return r!=null&&(t(r)||function(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))}(r)||!!r._isBuffer)}},542:(e,t,r)=>{(function(){var n=r(298),o=r(526).utf8,i=r(135),s=r(526).bin,l=function(c,u){c.constructor==String?c=u&&u.encoding==="binary"?s.stringToBytes(c):o.stringToBytes(c):i(c)?c=Array.prototype.slice.call(c,0):Array.isArray(c)||c.constructor===Uint8Array||(c=c.toString());for(var a=n.bytesToWords(c),f=8*c.length,d=1732584193,b=-271733879,E=-1732584194,w=271733878,R=0;R<a.length;R++)a[R]=16711935&(a[R]<<8|a[R]>>>24)|4278255360&(a[R]<<24|a[R]>>>8);a[f>>>5]|=128<<f%32,a[14+(f+64>>>9<<4)]=f;var S=l._ff,m=l._gg,g=l._hh,v=l._ii;for(R=0;R<a.length;R+=16){var T=d,A=b,F=E,C=w;d=S(d,b,E,w,a[R+0],7,-680876936),w=S(w,d,b,E,a[R+1],12,-389564586),E=S(E,w,d,b,a[R+2],17,606105819),b=S(b,E,w,d,a[R+3],22,-1044525330),d=S(d,b,E,w,a[R+4],7,-176418897),w=S(w,d,b,E,a[R+5],12,1200080426),E=S(E,w,d,b,a[R+6],17,-1473231341),b=S(b,E,w,d,a[R+7],22,-45705983),d=S(d,b,E,w,a[R+8],7,1770035416),w=S(w,d,b,E,a[R+9],12,-1958414417),E=S(E,w,d,b,a[R+10],17,-42063),b=S(b,E,w,d,a[R+11],22,-1990404162),d=S(d,b,E,w,a[R+12],7,1804603682),w=S(w,d,b,E,a[R+13],12,-40341101),E=S(E,w,d,b,a[R+14],17,-1502002290),d=m(d,b=S(b,E,w,d,a[R+15],22,1236535329),E,w,a[R+1],5,-165796510),w=m(w,d,b,E,a[R+6],9,-1069501632),E=m(E,w,d,b,a[R+11],14,643717713),b=m(b,E,w,d,a[R+0],20,-373897302),d=m(d,b,E,w,a[R+5],5,-701558691),w=m(w,d,b,E,a[R+10],9,38016083),E=m(E,w,d,b,a[R+15],14,-660478335),b=m(b,E,w,d,a[R+4],20,-405537848),d=m(d,b,E,w,a[R+9],5,568446438),w=m(w,d,b,E,a[R+14],9,-1019803690),E=m(E,w,d,b,a[R+3],14,-187363961),b=m(b,E,w,d,a[R+8],20,1163531501),d=m(d,b,E,w,a[R+13],5,-1444681467),w=m(w,d,b,E,a[R+2],9,-51403784),E=m(E,w,d,b,a[R+7],14,1735328473),d=g(d,b=m(b,E,w,d,a[R+12],20,-1926607734),E,w,a[R+5],4,-378558),w=g(w,d,b,E,a[R+8],11,-2022574463),E=g(E,w,d,b,a[R+11],16,1839030562),b=g(b,E,w,d,a[R+14],23,-35309556),d=g(d,b,E,w,a[R+1],4,-1530992060),w=g(w,d,b,E,a[R+4],11,1272893353),E=g(E,w,d,b,a[R+7],16,-155497632),b=g(b,E,w,d,a[R+10],23,-1094730640),d=g(d,b,E,w,a[R+13],4,681279174),w=g(w,d,b,E,a[R+0],11,-358537222),E=g(E,w,d,b,a[R+3],16,-722521979),b=g(b,E,w,d,a[R+6],23,76029189),d=g(d,b,E,w,a[R+9],4,-640364487),w=g(w,d,b,E,a[R+12],11,-421815835),E=g(E,w,d,b,a[R+15],16,530742520),d=v(d,b=g(b,E,w,d,a[R+2],23,-995338651),E,w,a[R+0],6,-198630844),w=v(w,d,b,E,a[R+7],10,1126891415),E=v(E,w,d,b,a[R+14],15,-1416354905),b=v(b,E,w,d,a[R+5],21,-57434055),d=v(d,b,E,w,a[R+12],6,1700485571),w=v(w,d,b,E,a[R+3],10,-1894986606),E=v(E,w,d,b,a[R+10],15,-1051523),b=v(b,E,w,d,a[R+1],21,-2054922799),d=v(d,b,E,w,a[R+8],6,1873313359),w=v(w,d,b,E,a[R+15],10,-30611744),E=v(E,w,d,b,a[R+6],15,-1560198380),b=v(b,E,w,d,a[R+13],21,1309151649),d=v(d,b,E,w,a[R+4],6,-145523070),w=v(w,d,b,E,a[R+11],10,-1120210379),E=v(E,w,d,b,a[R+2],15,718787259),b=v(b,E,w,d,a[R+9],21,-343485551),d=d+T>>>0,b=b+A>>>0,E=E+F>>>0,w=w+C>>>0}return n.endian([d,b,E,w])};l._ff=function(c,u,a,f,d,b,E){var w=c+(u&a|~u&f)+(d>>>0)+E;return(w<<b|w>>>32-b)+u},l._gg=function(c,u,a,f,d,b,E){var w=c+(u&f|a&~f)+(d>>>0)+E;return(w<<b|w>>>32-b)+u},l._hh=function(c,u,a,f,d,b,E){var w=c+(u^a^f)+(d>>>0)+E;return(w<<b|w>>>32-b)+u},l._ii=function(c,u,a,f,d,b,E){var w=c+(a^(u|~f))+(d>>>0)+E;return(w<<b|w>>>32-b)+u},l._blocksize=16,l._digestsize=16,e.exports=function(c,u){if(c==null)throw new Error("Illegal argument "+c);var a=n.wordsToBytes(l(c,u));return u&&u.asBytes?a:u&&u.asString?s.bytesToString(a):n.bytesToHex(a)}})()},285:(e,t,r)=>{var n=r(2);e.exports=function(S){return S?(S.substr(0,2)==="{}"&&(S="\\{\\}"+S.substr(2)),R(function(m){return m.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(l).split("\\.").join(c)}(S),!0).map(a)):[]};var o="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(S){return parseInt(S,10)==S?parseInt(S,10):S.charCodeAt(0)}function a(S){return S.split(o).join("\\").split(i).join("{").split(s).join("}").split(l).join(",").split(c).join(".")}function f(S){if(!S)return[""];var m=[],g=n("{","}",S);if(!g)return S.split(",");var v=g.pre,T=g.body,A=g.post,F=v.split(",");F[F.length-1]+="{"+T+"}";var C=f(A);return A.length&&(F[F.length-1]+=C.shift(),F.push.apply(F,C)),m.push.apply(m,F),m}function d(S){return"{"+S+"}"}function b(S){return/^-?0\d/.test(S)}function E(S,m){return S<=m}function w(S,m){return S>=m}function R(S,m){var g=[],v=n("{","}",S);if(!v)return[S];var T=v.pre,A=v.post.length?R(v.post,!1):[""];if(/\$$/.test(v.pre))for(var F=0;F<A.length;F++){var C=T+"{"+v.body+"}"+A[F];g.push(C)}else{var I,L,B=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(v.body),$=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(v.body),D=B||$,H=v.body.indexOf(",")>=0;if(!D&&!H)return v.post.match(/,.*\}/)?R(S=v.pre+"{"+v.body+s+v.post):[S];if(D)I=v.body.split(/\.\./);else if((I=f(v.body)).length===1&&(I=R(I[0],!1).map(d)).length===1)return A.map(function(Q){return v.pre+I[0]+Q});if(D){var ee=u(I[0]),J=u(I[1]),ce=Math.max(I[0].length,I[1].length),be=I.length==3?Math.abs(u(I[2])):1,de=E;J<ee&&(be*=-1,de=w);var Se=I.some(b);L=[];for(var Ae=ee;de(Ae,J);Ae+=be){var ne;if($)(ne=String.fromCharCode(Ae))==="\\"&&(ne="");else if(ne=String(Ae),Se){var ae=ce-ne.length;if(ae>0){var le=new Array(ae+1).join("0");ne=Ae<0?"-"+le+ne.slice(1):le+ne}}L.push(ne)}}else{L=[];for(var oe=0;oe<I.length;oe++)L.push.apply(L,R(I[oe],!1))}for(oe=0;oe<L.length;oe++)for(F=0;F<A.length;F++)C=T+L[oe]+A[F],(!m||D||C)&&g.push(C)}return g}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},t(u)}function r(u){var a=typeof Map=="function"?new Map:void 0;return r=function(f){if(f===null||(d=f,Function.toString.call(d).indexOf("[native code]")===-1))return f;var d;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(a!==void 0){if(a.has(f))return a.get(f);a.set(f,b)}function b(){return n(f,arguments,i(this).constructor)}return b.prototype=Object.create(f.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),o(b,f)},r(u)}function n(u,a,f){return n=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,b,E){var w=[null];w.push.apply(w,b);var R=new(Function.bind.apply(d,w));return E&&o(R,E.prototype),R},n.apply(null,arguments)}function o(u,a){return o=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},o(u,a)}function i(u){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},i(u)}var s=function(u){function a(f){var d;return function(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}(this,a),(d=function(b,E){return!E||t(E)!=="object"&&typeof E!="function"?function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}(b):E}(this,i(a).call(this,f))).name="ObjectPrototypeMutationError",d}return function(f,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(d&&d.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),d&&o(f,d)}(a,u),a}(r(Error));function l(u,a){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=a.split("."),b=d.length,E=function(S){var m=d[S];if(!u)return{v:void 0};if(m==="+"){if(Array.isArray(u))return{v:u.map(function(v,T){var A=d.slice(S+1);return A.length>0?l(v,A.join("."),f):f(u,T,d,S)})};var g=d.slice(0,S).join(".");throw new Error("Object at wildcard (".concat(g,") is not an array"))}u=f(u,m,d,S)},w=0;w<b;w++){var R=E(w);if(t(R)==="object")return R.v}return u}function c(u,a){return u.length===a+1}e.exports={set:function(u,a,f){if(t(u)!="object"||u===null||a===void 0)return u;if(typeof a=="number")return u[a]=f,u[a];try{return l(u,a,function(d,b,E,w){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[b]){var R=Number.isInteger(Number(E[w+1])),S=E[w+1]==="+";d[b]=R||S?[]:{}}return c(E,w)&&(d[b]=f),d[b]})}catch(d){if(d instanceof s)throw d;return u}},get:function(u,a){if(t(u)!="object"||u===null||a===void 0)return u;if(typeof a=="number")return u[a];try{return l(u,a,function(f,d){return f[d]})}catch{return u}},has:function(u,a){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||a===void 0)return!1;if(typeof a=="number")return a in u;try{var d=!1;return l(u,a,function(b,E,w,R){if(!c(w,R))return b&&b[E];d=f.own?b.hasOwnProperty(E):E in b}),d}catch{return!1}},hasOwn:function(u,a,f){return this.has(u,a,f||{own:!0})},isIn:function(u,a,f){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||a===void 0)return!1;try{var b=!1,E=!1;return l(u,a,function(w,R,S,m){return b=b||w===f||!!w&&w[R]===f,E=c(S,m)&&t(w)==="object"&&R in w,w&&w[R]}),d.validPath?b&&E:b}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,r)=>{var n=r(410),o=function(u){return typeof u=="string"};function i(u,a){for(var f=[],d=0;d<u.length;d++){var b=u[d];b&&b!=="."&&(b===".."?f.length&&f[f.length-1]!==".."?f.pop():a&&f.push(".."):f.push(b))}return f}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function c(u){return s.exec(u).slice(1)}l.resolve=function(){for(var u="",a=!1,f=arguments.length-1;f>=-1&&!a;f--){var d=f>=0?arguments[f]:me.cwd();if(!o(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,a=d.charAt(0)==="/")}return(a?"/":"")+(u=i(u.split("/"),!a).join("/"))||"."},l.normalize=function(u){var a=l.isAbsolute(u),f=u.substr(-1)==="/";return(u=i(u.split("/"),!a).join("/"))||a||(u="."),u&&f&&(u+="/"),(a?"/":"")+u},l.isAbsolute=function(u){return u.charAt(0)==="/"},l.join=function(){for(var u="",a=0;a<arguments.length;a++){var f=arguments[a];if(!o(f))throw new TypeError("Arguments to path.join must be strings");f&&(u+=u?"/"+f:f)}return l.normalize(u)},l.relative=function(u,a){function f(m){for(var g=0;g<m.length&&m[g]==="";g++);for(var v=m.length-1;v>=0&&m[v]==="";v--);return g>v?[]:m.slice(g,v+1)}u=l.resolve(u).substr(1),a=l.resolve(a).substr(1);for(var d=f(u.split("/")),b=f(a.split("/")),E=Math.min(d.length,b.length),w=E,R=0;R<E;R++)if(d[R]!==b[R]){w=R;break}var S=[];for(R=w;R<d.length;R++)S.push("..");return(S=S.concat(b.slice(w))).join("/")},l._makeLong=function(u){return u},l.dirname=function(u){var a=c(u),f=a[0],d=a[1];return f||d?(d&&(d=d.substr(0,d.length-1)),f+d):"."},l.basename=function(u,a){var f=c(u)[2];return a&&f.substr(-1*a.length)===a&&(f=f.substr(0,f.length-a.length)),f},l.extname=function(u){return c(u)[3]},l.format=function(u){if(!n.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var a=u.root||"";if(!o(a))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof u.root);return(u.dir?u.dir+l.sep:"")+(u.base||"")},l.parse=function(u){if(!o(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var a=c(u);if(!a||a.length!==4)throw new TypeError("Invalid path '"+u+"'");return a[1]=a[1]||"",a[2]=a[2]||"",a[3]=a[3]||"",{root:a[0],dir:a[0]+a[1].slice(0,a[1].length-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},647:(e,t)=>{var r=Object.prototype.hasOwnProperty;function n(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function o(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,s){s=s||"";var l,c,u=[];for(c in typeof s!="string"&&(s="?"),i)if(r.call(i,c)){if((l=i[c])||l!=null&&!isNaN(l)||(l=""),c=o(c),l=o(l),c===null||l===null)continue;u.push(c+"="+l)}return u.length?s+u.join("&"):""},t.parse=function(i){for(var s,l=/([^=?#&]+)=?([^&]*)/g,c={};s=l.exec(i);){var u=n(s[1]),a=n(s[2]);u===null||a===null||u in c||(c[u]=a)}return c}},670:e=>{e.exports=function(t,r){if(r=r.split(":")[0],!(t=+t))return!1;switch(r){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]+$/,r=/^([\-\+])?(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 n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(o){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},n,i),!o||typeof o!="string")return o;let s=o.trim();if(i.skipLike!==void 0&&i.skipLike.test(s))return o;if(i.hex&&t.test(s))return Number.parseInt(s,16);{const c=r.exec(s);if(c){const u=c[1],a=c[2];let f=((l=c[3])&&l.indexOf(".")!==-1&&((l=l.replace(/0+$/,""))==="."?l="0":l[0]==="."?l="0"+l:l[l.length-1]==="."&&(l=l.substr(0,l.length-1))),l);const d=c[4]||c[6];if(!i.leadingZeros&&a.length>0&&u&&s[2]!=="."||!i.leadingZeros&&a.length>0&&!u&&s[1]!==".")return o;{const b=Number(s),E=""+b;return E.search(/[eE]/)!==-1||d?i.eNotation?b:o:s.indexOf(".")!==-1?E==="0"&&f===""||E===f||u&&E==="-"+f?b:o:a?f===E||u+f===E?b:o:s===E||s===u+E?b:o}}return o}var l}},737:(e,t,r)=>{var n=r(670),o=r(647),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/;function f(m){return(m||"").toString().replace(i,"")}var d=[["#","hash"],["?","query"],function(m,g){return w(g.protocol)?m.replace(/\\/g,"/"):m},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],b={hash:1,query:1};function E(m){var g,v=(typeof window<"u"?window:typeof Fn<"u"?Fn:typeof self<"u"?self:{}).location||{},T={},A=typeof(m=m||v);if(m.protocol==="blob:")T=new S(unescape(m.pathname),{});else if(A==="string")for(g in T=new S(m,{}),b)delete T[g];else if(A==="object"){for(g in m)g in b||(T[g]=m[g]);T.slashes===void 0&&(T.slashes=l.test(m.href))}return T}function w(m){return m==="file:"||m==="ftp:"||m==="http:"||m==="https:"||m==="ws:"||m==="wss:"}function R(m,g){m=(m=f(m)).replace(s,""),g=g||{};var v,T=u.exec(m),A=T[1]?T[1].toLowerCase():"",F=!!T[2],C=!!T[3],I=0;return F?C?(v=T[2]+T[3]+T[4],I=T[2].length+T[3].length):(v=T[2]+T[4],I=T[2].length):C?(v=T[3]+T[4],I=T[3].length):v=T[4],A==="file:"?I>=2&&(v=v.slice(2)):w(A)?v=T[4]:A?F&&(v=v.slice(2)):I>=2&&w(g.protocol)&&(v=T[4]),{protocol:A,slashes:F||w(A),slashesCount:I,rest:v}}function S(m,g,v){if(m=(m=f(m)).replace(s,""),!(this instanceof S))return new S(m,g,v);var T,A,F,C,I,L,B=d.slice(),$=typeof g,D=this,H=0;for($!=="object"&&$!=="string"&&(v=g,g=null),v&&typeof v!="function"&&(v=o.parse),T=!(A=R(m||"",g=E(g))).protocol&&!A.slashes,D.slashes=A.slashes||T&&g.slashes,D.protocol=A.protocol||g.protocol||"",m=A.rest,(A.protocol==="file:"&&(A.slashesCount!==2||a.test(m))||!A.slashes&&(A.protocol||A.slashesCount<2||!w(D.protocol)))&&(B[3]=[/(.*)/,"pathname"]);H<B.length;H++)typeof(C=B[H])!="function"?(F=C[0],L=C[1],F!=F?D[L]=m:typeof F=="string"?~(I=F==="@"?m.lastIndexOf(F):m.indexOf(F))&&(typeof C[2]=="number"?(D[L]=m.slice(0,I),m=m.slice(I+C[2])):(D[L]=m.slice(I),m=m.slice(0,I))):(I=F.exec(m))&&(D[L]=I[1],m=m.slice(0,I.index)),D[L]=D[L]||T&&C[3]&&g[L]||"",C[4]&&(D[L]=D[L].toLowerCase())):m=C(m,D);v&&(D.query=v(D.query)),T&&g.slashes&&D.pathname.charAt(0)!=="/"&&(D.pathname!==""||g.pathname!=="")&&(D.pathname=function(ee,J){if(ee==="")return J;for(var ce=(J||"/").split("/").slice(0,-1).concat(ee.split("/")),be=ce.length,de=ce[be-1],Se=!1,Ae=0;be--;)ce[be]==="."?ce.splice(be,1):ce[be]===".."?(ce.splice(be,1),Ae++):Ae&&(be===0&&(Se=!0),ce.splice(be,1),Ae--);return Se&&ce.unshift(""),de!=="."&&de!==".."||ce.push(""),ce.join("/")}(D.pathname,g.pathname)),D.pathname.charAt(0)!=="/"&&w(D.protocol)&&(D.pathname="/"+D.pathname),n(D.port,D.protocol)||(D.host=D.hostname,D.port=""),D.username=D.password="",D.auth&&(~(I=D.auth.indexOf(":"))?(D.username=D.auth.slice(0,I),D.username=encodeURIComponent(decodeURIComponent(D.username)),D.password=D.auth.slice(I+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()}S.prototype={set:function(m,g,v){var T=this;switch(m){case"query":typeof g=="string"&&g.length&&(g=(v||o.parse)(g)),T[m]=g;break;case"port":T[m]=g,n(g,T.protocol)?g&&(T.host=T.hostname+":"+g):(T.host=T.hostname,T[m]="");break;case"hostname":T[m]=g,T.port&&(g+=":"+T.port),T.host=g;break;case"host":T[m]=g,c.test(g)?(g=g.split(":"),T.port=g.pop(),T.hostname=g.join(":")):(T.hostname=g,T.port="");break;case"protocol":T.protocol=g.toLowerCase(),T.slashes=!v;break;case"pathname":case"hash":if(g){var A=m==="pathname"?"/":"#";T[m]=g.charAt(0)!==A?A+g:g}else T[m]=g;break;case"username":case"password":T[m]=encodeURIComponent(g);break;case"auth":var F=g.indexOf(":");~F?(T.username=g.slice(0,F),T.username=encodeURIComponent(decodeURIComponent(T.username)),T.password=g.slice(F+1),T.password=encodeURIComponent(decodeURIComponent(T.password))):T.username=encodeURIComponent(decodeURIComponent(g))}for(var C=0;C<d.length;C++){var I=d[C];I[4]&&(T[I[1]]=T[I[1]].toLowerCase())}return T.auth=T.password?T.username+":"+T.password:T.username,T.origin=T.protocol!=="file:"&&w(T.protocol)&&T.host?T.protocol+"//"+T.host:"null",T.href=T.toString(),T},toString:function(m){m&&typeof m=="function"||(m=o.stringify);var g,v=this,T=v.host,A=v.protocol;A&&A.charAt(A.length-1)!==":"&&(A+=":");var F=A+(v.protocol&&v.slashes||w(v.protocol)?"//":"");return v.username?(F+=v.username,v.password&&(F+=":"+v.password),F+="@"):v.password?(F+=":"+v.password,F+="@"):v.protocol!=="file:"&&w(v.protocol)&&!T&&v.pathname!=="/"&&(F+="@"),(T[T.length-1]===":"||c.test(v.hostname)&&!v.port)&&(T+=":"),F+=T+v.pathname,(g=typeof v.query=="object"?m(v.query):v.query)&&(F+=g.charAt(0)!=="?"?"?"+g:g),v.hash&&(F+=v.hash),F}},S.extractProtocol=R,S.location=E,S.trimLeft=f,S.qs=o,e.exports=S},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Km={};function ft(e){var t=Km[e];if(t!==void 0)return t.exports;var r=Km[e]={id:e,loaded:!1,exports:{}};return jR[e].call(r.exports,r,r.exports,ft),r.loaded=!0,r.exports}ft.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return ft.d(t,{a:t}),t},ft.d=(e,t)=>{for(var r in t)ft.o(t,r)&&!ft.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},ft.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ft.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Dr={};ft.d(Dr,{hT:()=>hr,O4:()=>bn,Kd:()=>QR,YK:()=>XR,UU:()=>rI,Gu:()=>oy,ky:()=>Sy,h4:()=>So,ch:()=>Ms,hq:()=>ei,i5:()=>Ey});var UR=ft(737),qR=ft.n(UR);function Nu(e){if(!$u(e))throw new Error("Parameter was not an error")}function $u(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class pr extends Error{constructor(t,r){const n=[...arguments],{options:o,shortMessage:i}=function(l){let c,u="";if(l.length===0)c={};else if($u(l[0]))c={cause:l[0]},u=l.slice(1).join(" ")||"";else if(l[0]&&typeof l[0]=="object")c=Object.assign({},l[0]),u=l.slice(1).join(" ")||"";else{if(typeof l[0]!="string")throw new Error("Invalid arguments passed to Layerr");c={},u=u=l.join(" ")||""}return{options:c,shortMessage:u}}(n);let s=i;if(o.cause&&(s=`${s}: ${o.cause.message}`),super(s),this.message=s,o.name&&typeof o.name=="string"?this.name=o.name:this.name="Layerr",o.cause&&Object.defineProperty(this,"_cause",{value:o.cause}),Object.defineProperty(this,"_info",{value:{}}),o.info&&typeof o.info=="object"&&Object.assign(this._info,o.info),Error.captureStackTrace){const l=o.constructorOpt||this.constructor;Error.captureStackTrace(this,l)}}static cause(t){return Nu(t),t._cause&&$u(t._cause)?t._cause:null}static fullStack(t){Nu(t);const r=pr.cause(t);return r?`${t.stack}
47
- caused by: ${pr.fullStack(r)}`:t.stack??""}static info(t){Nu(t);const r={},n=pr.cause(t);return n&&Object.assign(r,pr.info(n)),t._info&&Object.assign(r,t._info),r}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var VR=ft(47),xs=ft.n(VR);const Qm="__PATH_SEPARATOR_POSIX__",Xm="__PATH_SEPARATOR_WINDOWS__";function _t(e){try{const t=e.replace(/\//g,Qm).replace(/\\\\/g,Xm);return encodeURIComponent(t).split(Xm).join("\\\\").split(Qm).join("/")}catch(t){throw new pr(t,"Failed encoding path")}}function Ym(e){return e.startsWith("/")?e:"/"+e}function yo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function zR(e){let t=new(qR())(e).pathname;return t.length<=0&&(t="/"),yo(t)}function It(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){return function(n){var o=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var i=n.shift();n[0]=i+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s<n.length;s++){var l=n[s];if(typeof l!="string")throw new TypeError("Url must be a string. Received "+l);l!==""&&(s>0&&(l=l.replace(/^[\/]+/,"")),l=s<n.length-1?l.replace(/[\/]+$/,""):l.replace(/[\/]+$/,"/"),o.push(l))}var c=o.join("/"),u=(c=c.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((n,o,i)=>((i===0||o!=="/"||o==="/"&&n[n.length-1]!=="/")&&n.push(o),n),[]))}var WR=ft(542),bo=ft.n(WR);const HR="abcdef0123456789";function Jm(e,t){const r=e.url.replace("//",""),n=r.indexOf("/")==-1?"/":r.slice(r.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),l=function(d,b,E,w,R,S,m){const g=m||bo()(`${b}:${E}:${w}`);return d&&d.toLowerCase()==="md5-sess"?bo()(`${g}:${R}:${S}`):g}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=bo()(`${o}:${n}`),u=i?bo()(`${l}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):bo()(`${l}:${t.nonce}:${c}`),a={username:t.username,realm:t.realm,nonce:t.nonce,uri:n,qop:i,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},f=[];for(const d in a)a[d]&&(d==="qop"||d==="nc"||d==="algorithm"?f.push(`${d}=${a[d]}`):f.push(`${d}="${a[d]}"`));return`Digest ${f.join(", ")}`}function Zm(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var GR=ft(101),ey=ft.n(GR);function ty(e){return ey().decode(e)}function ry(e,t){var r;return`Basic ${r=`${e}:${t}`,ey().encode(r)}`}const Os=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,KR=Os.fetch.bind(Os),QR=Os.Request,XR=Os.Response;let hr=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),bn=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 ny(e,t,r,n,o){switch(e.authType){case hr.Auto:t&&r&&(e.headers.Authorization=ry(t,r));break;case hr.Digest:e.digest=function(s,l,c){return{username:s,password:l,ha1:c,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,r,o);break;case hr.None:break;case hr.Password:e.headers.Authorization=ry(t,r);break;case hr.Token:e.headers.Authorization=`${(i=n).token_type} ${i.access_token}`;break;default:throw new pr({info:{code:bn.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}ft(345),ft(800);const iy="@@HOTPATCHER",YR=()=>{};function Du(e){return{original:e,methods:[e],final:!1}}class JR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=iy}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==iy)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach(n=>{this.configuration.registry.hasOwnProperty(n)?r&&(this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])):this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])}),t._configuration=this.configuration,this}execute(t){const r=this.get(t)||YR;for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r(...o)}get(t){const r=this.configuration.registry[t];if(!r)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 n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];if(o.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];let u=l;const a=this;for(;o.length>0;)u=[o.shift().apply(a,u)];return u[0]}}(...r.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:o=!1}=n;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof r!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(o)this.configuration.registry[t]?this.configuration.registry[t].methods.push(r):this.configuration.registry[t]=Du(r);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Du(r),{original:i})}else this.configuration.registry[t]=Du(r);return this}patchInline(t,r){this.isPatched(t)||this.patch(t,r);for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return this.execute(t,...o)}plugin(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.forEach(i=>{this.patch(t,i,{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 Lu=null;function oy(){return Lu||(Lu=new JR),Lu}function ks(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 r=t;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function sy(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=null,o=[...t];for(;o.length>0;){const i=o.shift();n=n?ay(n,i):ks(i)}return n}function ay(e,t){const r=ks(e);return Object.keys(t).forEach(n=>{r.hasOwnProperty(n)?Array.isArray(t[n])?r[n]=Array.isArray(r[n])?[...r[n],...t[n]]:[...t[n]]:typeof t[n]=="object"&&t[n]?r[n]=typeof r[n]=="object"&&r[n]?ay(r[n],t[n]):ks(t[n]):r[n]=t[n]:r[n]=t[n]}),r}function ZR(e){const t={};for(const r of e.keys())t[r]=e.get(r);return t}function Bu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length===0)return{};const n={};return t.reduce((o,i)=>(Object.keys(i).forEach(s=>{const l=s.toLowerCase();n.hasOwnProperty(l)?o[n[l]]=i[s]:(n[l]=s,o[s]=i[s])}),o),{})}ft(805);const e_=typeof ArrayBuffer=="function",{toString:t_}=Object.prototype;function ly(e){return e_&&(e instanceof ArrayBuffer||t_.call(e)==="[object ArrayBuffer]")}function cy(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Mu(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function ju(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const uy=Mu(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=sy(e,{headers:{Authorization:Jm(e,t)}})),ju(Ns(e),function(r){let n=!1;return o=function(s){return n?s:r},(i=function(){if(r.status==401)return t.hasDigestAuth=function(s,l){if(!Zm(s))return!1;const c=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",a=c.exec(u);if(!a)break;l[a[1]]=a[2]||a[3]}return l.nc+=1,l.cnonce=function(){let u="";for(let a=0;a<32;++a)u=`${u}${HR[Math.floor(16*Math.random())]}`;return u}(),!0}(r,t),function(){if(t.hasDigestAuth)return ju(Ns(e=sy(e,{headers:{Authorization:Jm(e,t)}})),function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,n=!0,s})}();t.nc++}())&&i.then?i.then(o):o(i);var o,i})}),r_=Mu(function(e,t){return ju(Ns(e),function(r){return r.ok?(t.authType=hr.Password,r):r.status==401&&Zm(r)?(t.authType=hr.Digest,ny(t,t.username,t.password,void 0,void 0),e._digest=t.digest,uy(e)):r})}),zt=Mu(function(e,t){return t.authType===hr.Auto?r_(e,t):e._digest?uy(e):Ns(e)});function Wt(e,t,r){const n=ks(e);return n.headers=Bu(t.headers,n.headers||{},r.headers||{}),r.data!==void 0&&(n.data=r.data),r.signal&&(n.signal=r.signal),t.httpAgent&&(n.httpAgent=t.httpAgent),t.httpsAgent&&(n.httpsAgent=t.httpsAgent),t.digest&&(n._digest=t.digest),typeof t.withCredentials=="boolean"&&(n.withCredentials=t.withCredentials),n}function Ns(e){const t=oy();return t.patchInline("request",r=>t.patchInline("fetch",KR,r.url,function(n){let o={};const i={method:n.method};if(n.headers&&(o=Bu(o,n.headers)),n.data!==void 0){const[s,l]=function(c){if(typeof c=="string")return[c,{}];if(cy(c))return[c,{}];if(ly(c))return[c,{}];if(c&&typeof c=="object")return[JSON.stringify(c),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof c)}(n.data);i.body=s,o=Bu(o,l)}return n.signal&&(i.signal=n.signal),n.withCredentials&&(i.credentials="include"),i.headers=o,i}(r)),e)}var n_=ft(285);const $s=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},i_={"[: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]},vo=e=>e.replace(/[[\]\\-]/g,"\\$&"),fy=e=>e.join(""),o_=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const n=[],o=[];let i=r+1,s=!1,l=!1,c=!1,u=!1,a=r,f="";e:for(;i<e.length;){const w=e.charAt(i);if(w!=="!"&&w!=="^"||i!==r+1){if(w==="]"&&s&&!c){a=i+1;break}if(s=!0,w!=="\\"||c){if(w==="["&&!c){for(const[R,[S,m,g]]of Object.entries(i_))if(e.startsWith(R,i)){if(f)return["$.",!1,e.length-r,!0];i+=R.length,g?o.push(S):n.push(S),l=l||m;continue e}}c=!1,f?(w>f?n.push(vo(f)+"-"+vo(w)):w===f&&n.push(vo(w)),f="",i++):e.startsWith("-]",i+1)?(n.push(vo(w+"-")),i+=2):e.startsWith("-",i+1)?(f=w,i+=2):(n.push(vo(w)),i++)}else c=!0,i++}else u=!0,i++}if(a<i)return["",!1,0,!1];if(!n.length&&!o.length)return["$.",!1,e.length-r,!0];if(o.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u)return[(d=n[0].length===2?n[0].slice(-1):n[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,a-r,!1];var d;const b="["+(u?"^":"")+fy(n)+"]",E="["+(u?"":"^")+fy(o)+"]";return[n.length&&o.length?"("+b+"|"+E+")":n.length?b:E,l,a-r,!0]},wo=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")},s_=new Set(["!","?","+","*","@"]),dy=e=>s_.has(e),Uu="(?!\\.)",a_=new Set(["[","."]),l_=new Set(["..","."]),c_=new Set("().*{}+?[]^$\\!"),qu="[^/]",py=qu+"*?",hy=qu+"+?",yr=class yr{constructor(t,r){Sr(this,pi);Ee(this,"type");Sr(this,Kt);Sr(this,Zt);Sr(this,Tn,!1);Sr(this,At,[]);Sr(this,jt);Sr(this,kn);Sr(this,fi);Sr(this,Nn,!1);Sr(this,nn);Sr(this,di);Sr(this,$o,!1);let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&Nt(this,Zt,!0),Nt(this,jt,r),Nt(this,Kt,Oe(this,jt)?Oe(Oe(this,jt),Kt):this),Nt(this,nn,Oe(this,Kt)===this?n:Oe(Oe(this,Kt),nn)),Nt(this,fi,Oe(this,Kt)===this?[]:Oe(Oe(this,Kt),fi)),t!=="!"||Oe(Oe(this,Kt),Nn)||Oe(this,fi).push(this),Nt(this,kn,Oe(this,jt)?Oe(Oe(this,jt),At).length:0)}get hasMagic(){if(Oe(this,Zt)!==void 0)return Oe(this,Zt);for(const t of Oe(this,At))if(typeof t!="string"&&(t.type||t.hasMagic))return Nt(this,Zt,!0);return Oe(this,Zt)}toString(){return Oe(this,di)!==void 0?Oe(this,di):this.type?Nt(this,di,this.type+"("+Oe(this,At).map(t=>String(t)).join("|")+")"):Nt(this,di,Oe(this,At).map(t=>String(t)).join(""))}push(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(const o of r)if(o!==""){if(typeof o!="string"&&!(o instanceof yr&&Oe(o,jt)===this))throw new Error("invalid part: "+o);Oe(this,At).push(o)}}toJSON(){var r;const t=this.type===null?Oe(this,At).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...Oe(this,At).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===Oe(this,Kt)||Oe(Oe(this,Kt),Nn)&&((r=Oe(this,jt))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(Oe(this,Kt)===this)return!0;if(!((r=Oe(this,jt))!=null&&r.isStart()))return!1;if(Oe(this,kn)===0)return!0;const t=Oe(this,jt);for(let n=0;n<Oe(this,kn);n++){const o=Oe(t,At)[n];if(!(o instanceof yr&&o.type==="!"))return!1}return!0}isEnd(){var r,n,o;if(Oe(this,Kt)===this||((r=Oe(this,jt))==null?void 0:r.type)==="!")return!0;if(!((n=Oe(this,jt))!=null&&n.isEnd()))return!1;if(!this.type)return(o=Oe(this,jt))==null?void 0:o.isEnd();const t=Oe(this,jt)?Oe(Oe(this,jt),At).length:0;return Oe(this,kn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const r=new yr(this.type,t);for(const n of Oe(this,At))r.copyIn(n);return r}static fromGlob(t){var o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=new yr(null,void 0,r);return Ln(o=yr,$n,ba).call(o,t,n,0,r),n}toMMPattern(){if(this!==Oe(this,Kt))return Oe(this,Kt).toMMPattern();const t=this.toString(),[r,n,o,i]=this.toRegExpSource();if(!(o||Oe(this,Zt)||Oe(this,nn).nocase&&!Oe(this,nn).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const s=(Oe(this,nn).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:t})}get options(){return Oe(this,nn)}toRegExpSource(t){var c;const r=t??!!Oe(this,nn).dot;if(Oe(this,Kt)===this&&Ln(this,pi,$0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),a=Oe(this,At).map(b=>{var m;const[E,w,R,S]=typeof b=="string"?Ln(m=yr,$n,D0).call(m,b,Oe(this,Zt),u):b.toRegExpSource(t);return Nt(this,Zt,Oe(this,Zt)||R),Nt(this,Tn,Oe(this,Tn)||S),E}).join("");let f="";if(this.isStart()&&typeof Oe(this,At)[0]=="string"&&(Oe(this,At).length!==1||!l_.has(Oe(this,At)[0]))){const b=a_,E=r&&b.has(a.charAt(0))||a.startsWith("\\.")&&b.has(a.charAt(2))||a.startsWith("\\.\\.")&&b.has(a.charAt(4)),w=!r&&!t&&b.has(a.charAt(0));f=E?"(?!(?:^|/)\\.\\.?(?:$|/))":w?Uu:""}let d="";return this.isEnd()&&Oe(Oe(this,Kt),Nn)&&((c=Oe(this,jt))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[f+a+d,wo(a),Nt(this,Zt,!!Oe(this,Zt)),Oe(this,Tn)]}const n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=Ln(this,pi,nd).call(this,r);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return Nt(this,At,[u]),this.type=null,Nt(this,Zt,void 0),[u,wo(this.toString()),!1,!1]}let s=!n||t||r?"":Ln(this,pi,nd).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let l="";return l=this.type==="!"&&Oe(this,$o)?(this.isStart()&&!r?Uu:"")+hy:o+i+(this.type==="!"?"))"+(!this.isStart()||r||t?"":Uu)+py+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[l,wo(i),Nt(this,Zt,!!Oe(this,Zt)),Oe(this,Tn)]}};Kt=new WeakMap,Zt=new WeakMap,Tn=new WeakMap,At=new WeakMap,jt=new WeakMap,kn=new WeakMap,fi=new WeakMap,Nn=new WeakMap,nn=new WeakMap,di=new WeakMap,$o=new WeakMap,pi=new WeakSet,$0=function(){if(this!==Oe(this,Kt))throw new Error("should only call on root");if(Oe(this,Nn))return this;let t;for(this.toString(),Nt(this,Nn,!0);t=Oe(this,fi).pop();){if(t.type!=="!")continue;let r=t,n=Oe(r,jt);for(;n;){for(let o=Oe(r,kn)+1;!n.type&&o<Oe(n,At).length;o++)for(const i of Oe(t,At)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(Oe(n,At)[o])}r=n,n=Oe(r,jt)}}return this},$n=new WeakSet,ba=function(t,r,n,o){var b,E;let i=!1,s=!1,l=-1,c=!1;if(r.type===null){let w=n,R="";for(;w<t.length;){const S=t.charAt(w++);if(i||S==="\\")i=!i,R+=S;else if(s)w===l+1?S!=="^"&&S!=="!"||(c=!0):S!=="]"||w===l+2&&c||(s=!1),R+=S;else if(S!=="[")if(o.noext||!dy(S)||t.charAt(w)!=="(")R+=S;else{r.push(R),R="";const m=new yr(S,r);w=Ln(b=yr,$n,ba).call(b,t,m,w,o),r.push(m)}else s=!0,l=w,c=!1,R+=S}return r.push(R),w}let u=n+1,a=new yr(null,r);const f=[];let d="";for(;u<t.length;){const w=t.charAt(u++);if(i||w==="\\")i=!i,d+=w;else if(s)u===l+1?w!=="^"&&w!=="!"||(c=!0):w!=="]"||u===l+2&&c||(s=!1),d+=w;else if(w!=="[")if(dy(w)&&t.charAt(u)==="("){a.push(d),d="";const R=new yr(w,a);a.push(R),u=Ln(E=yr,$n,ba).call(E,t,R,u,o)}else if(w!=="|"){if(w===")")return d===""&&Oe(r,At).length===0&&Nt(r,$o,!0),a.push(d),d="",r.push(...f,a),u;d+=w}else a.push(d),d="",f.push(a),a=new yr(null,r);else s=!0,l=u,c=!1,d+=w}return r.type=null,Nt(r,Zt,void 0),Nt(r,At,[t.substring(n-1)]),u},nd=function(t){return Oe(this,At).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[n,o,i,s]=r.toRegExpSource(t);return Nt(this,Tn,Oe(this,Tn)||s),n}).filter(r=>!(this.isStart()&&this.isEnd()&&!r)).join("|")},D0=function(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,i="",s=!1;for(let l=0;l<t.length;l++){const c=t.charAt(l);if(o)o=!1,i+=(c_.has(c)?"\\":"")+c;else if(c!=="\\"){if(c==="["){const[u,a,f,d]=o_(t,l);if(f){i+=u,s=s||a,l+=f-1,r=r||d;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=qu,r=!0):(i+=n&&t==="*"?hy:py,r=!0)}else l===t.length-1?i+="\\\\":o=!0}return[i,wo(t),!!r,s]},Sr(yr,$n);let Ds=yr;const sr=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $s(t),!(!r.nocomment&&t.charAt(0)==="#")&&new Ls(t,r).match(e)},u_=/^\*+([^+@!?\*\[\(]*)$/,f_=e=>t=>!t.startsWith(".")&&t.endsWith(e),d_=e=>t=>t.endsWith(e),p_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),h_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),g_=/^\*+\.\*+$/,m_=e=>!e.startsWith(".")&&e.includes("."),y_=e=>e!=="."&&e!==".."&&e.includes("."),b_=/^\.\*+$/,v_=e=>e!=="."&&e!==".."&&e.startsWith("."),w_=/^\*+$/,S_=e=>e.length!==0&&!e.startsWith("."),E_=e=>e.length!==0&&e!=="."&&e!=="..",T_=/^\?+([^+@!?\*\[\(]*)?$/,A_=e=>{let[t,r=""]=e;const n=gy([t]);return r?(r=r.toLowerCase(),o=>n(o)&&o.toLowerCase().endsWith(r)):n},R_=e=>{let[t,r=""]=e;const n=my([t]);return r?(r=r.toLowerCase(),o=>n(o)&&o.toLowerCase().endsWith(r)):n},__=e=>{let[t,r=""]=e;const n=my([t]);return r?o=>n(o)&&o.endsWith(r):n},I_=e=>{let[t,r=""]=e;const n=gy([t]);return r?o=>n(o)&&o.endsWith(r):n},gy=e=>{let[t]=e;const r=t.length;return n=>n.length===r&&!n.startsWith(".")},my=e=>{let[t]=e;const r=t.length;return n=>n.length===r&&n!=="."&&n!==".."},yy=typeof me=="object"&&me?typeof me.env=="object"&&me.env&&me.env.__MINIMATCH_TESTING_PLATFORM__||me.platform:"posix";sr.sep=yy==="win32"?"\\":"/";const Lr=Symbol("globstar **");sr.GLOBSTAR=Lr,sr.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=>sr(r,e,t)};const Br=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};sr.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return sr;const t=sr;return Object.assign(function(r,n){return t(r,n,Br(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(r){super(r,Br(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(r){return t.defaults(Br(e,r)).Minimatch}},AST:class extends t.AST{constructor(r,n){super(r,n,Br(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(r,Br(e,n))}},unescape:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(r,Br(e,n))},escape:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(r,Br(e,n))},filter:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(r,Br(e,n))},defaults:r=>t.defaults(Br(e,r)),makeRe:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(r,Br(e,n))},braceExpand:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(r,Br(e,n))},match:function(r,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(r,n,Br(e,o))},sep:t.sep,GLOBSTAR:Lr})};const by=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $s(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:n_(e)};sr.braceExpand=by,sr.makeRe=function(e){return new Ls(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},sr.match=function(e,t){const r=new Ls(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter(n=>r.match(n)),r.options.nonull&&!e.length&&e.push(t),e};const vy=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ls{constructor(t){Ee(this,"options");Ee(this,"set");Ee(this,"pattern");Ee(this,"windowsPathsNoEscape");Ee(this,"nonegate");Ee(this,"negate");Ee(this,"comment");Ee(this,"empty");Ee(this,"preserveMultipleSlashes");Ee(this,"partial");Ee(this,"globSet");Ee(this,"globParts");Ee(this,"nocase");Ee(this,"isWindows");Ee(this,"platform");Ee(this,"windowsNoMagicRoot");Ee(this,"regexp");let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$s(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||yy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of t)if(typeof r!="string")return!0;return!1}debug(){}make(){const t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const n=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,s,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&vy.test(i[2])||vy.test(i[3])),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(a=>this.parse(a))];if(u)return[i[0],...i.slice(1).map(a=>this.parse(a))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][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 n=0;n<t.length;n++)for(let o=0;o<t[n].length;o++)t[n][o]==="**"&&(t[n][o]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=r>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,o)=>{const i=n[n.length-1];return o==="**"&&i==="**"?n:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(n.pop(),n):(n.push(o),n)},[])).length===0?[""]:r)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const i=t[o];o===1&&i===""&&t[0]===""||i!=="."&&i!==""||(r=!0,t.splice(o,1),o--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const o=t[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let o=-1;for(;(o=n.indexOf("**",o+1))!==-1;){let s=o;for(;n[s+1]==="**";)s++;s>o&&n.splice(o+1,s-o);let l=n[o+1];const c=n[o+2],u=n[o+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(o,1);const a=n.slice(0);a[o]="**",t.push(a),o--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){const l=n[s];s===1&&l===""&&n[0]===""||l!=="."&&l!==""||(r=!0,n.splice(s,1),s--)}n[0]!=="."||n.length!==2||n[1]!=="."&&n[1]!==""||(r=!0,n.pop())}let i=0;for(;(i=n.indexOf("..",i+1))!==-1;){const s=n[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;const l=i===1&&n[i+1]==="**"?["."]:[];n.splice(i-1,2,...l),n.length===0&&n.push(""),i-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){const o=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(o){t[r]=[],t[n]=o;break}}return t.filter(r=>r.length)}partsMatch(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,i=0,s=[],l="";for(;o<t.length&&i<r.length;)if(t[o]===r[i])s.push(l==="b"?r[i]:t[o]),o++,i++;else if(n&&t[o]==="**"&&r[i]===t[o+1])s.push(t[o]),o++;else if(n&&r[i]==="**"&&t[o]===r[i+1])s.push(r[i]),i++;else if(t[o]!=="*"||!r[i]||!this.options.dot&&r[i].startsWith(".")||r[i]==="**"){if(r[i]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||l==="a")return!1;l="b",s.push(r[i]),o++,i++}else{if(l==="b")return!1;l="a",s.push(t[o]),o++,i++}return t.length===r.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,n=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.options;if(this.isWindows){const w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),R=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),S=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),m=R?3:w?0:void 0,g=!S&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3])?3:S?0:void 0;if(typeof m=="number"&&typeof g=="number"){const[v,T]=[t[m],r[g]];v.toLowerCase()===T.toLowerCase()&&(r[g]=v,g>m?r=r.slice(g):m>g&&(t=t.slice(m)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var s=0,l=0,c=t.length,u=r.length;s<c&&l<u;s++,l++){this.debug("matchOne loop");var a=r[l],f=t[s];if(this.debug(r,a,f),a===!1)return!1;if(a===Lr){this.debug("GLOBSTAR",[r,a,f]);var d=s,b=l+1;if(b===u){for(this.debug("** at the end");s<c;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;d<c;){var E=t[d];if(this.debug(`
44
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function l(a,f,d,b){const E=this.j2x(a,d+1,b.concat(f));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],f,E.attrStr,d):this.buildObjectNode(E.val,f,E.attrStr,d)}function c(a){return this.options.indentBy.repeat(a)}function u(a){return!(!a.startsWith(this.options.attributeNamePrefix)||a===this.options.textNodeName)&&a.substr(this.attrPrefixLen)}s.prototype.build=function(a){return this.options.preserveOrder?n(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},s.prototype.j2x=function(a,f,d){let b="",E="";const S=d.join(".");for(let T in a)if(Object.prototype.hasOwnProperty.call(a,T))if(a[T]===void 0)this.isAttribute(T)&&(E+="");else if(a[T]===null)this.isAttribute(T)?E+="":T[0]==="?"?E+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:E+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(a[T]instanceof Date)E+=this.buildTextValNode(a[T],T,"",f);else if(typeof a[T]!="object"){const w=this.isAttribute(T);if(w&&!this.ignoreAttributesFn(w,S))b+=this.buildAttrPairStr(w,""+a[T]);else if(!w)if(T===this.options.textNodeName){let y=this.options.tagValueProcessor(T,""+a[T]);E+=this.replaceEntitiesValue(y)}else E+=this.buildTextValNode(a[T],T,"",f)}else if(Array.isArray(a[T])){const w=a[T].length;let y="",g="";for(let v=0;v<w;v++){const A=a[T][v];if(A!==void 0)if(A===null)T[0]==="?"?E+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:E+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(typeof A=="object")if(this.options.oneListGroup){const R=this.j2x(A,f+1,d.concat(T));y+=R.val,this.options.attributesGroupName&&A.hasOwnProperty(this.options.attributesGroupName)&&(g+=R.attrStr)}else y+=this.processTextOrObjNode(A,T,f,d);else if(this.options.oneListGroup){let R=this.options.tagValueProcessor(T,A);R=this.replaceEntitiesValue(R),y+=R}else y+=this.buildTextValNode(A,T,"",f)}this.options.oneListGroup&&(y=this.buildObjectNode(y,T,g,f)),E+=y}else if(this.options.attributesGroupName&&T===this.options.attributesGroupName){const w=Object.keys(a[T]),y=w.length;for(let g=0;g<y;g++)b+=this.buildAttrPairStr(w[g],""+a[T][w[g]])}else E+=this.processTextOrObjNode(a[T],T,f,d);return{attrStr:b,val:E}},s.prototype.buildAttrPairStr=function(a,f){return f=this.options.attributeValueProcessor(a,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+a:" "+a+'="'+f+'"'},s.prototype.buildObjectNode=function(a,f,d,b){if(a==="")return f[0]==="?"?this.indentate(b)+"<"+f+d+"?"+this.tagEndChar:this.indentate(b)+"<"+f+d+this.closeTag(f)+this.tagEndChar;{let E="</"+f+this.tagEndChar,S="";return f[0]==="?"&&(S="?",E=""),!d&&d!==""||a.indexOf("<")!==-1?this.options.commentPropName!==!1&&f===this.options.commentPropName&&S.length===0?this.indentate(b)+`<!--${a}-->`+this.newLine:this.indentate(b)+"<"+f+d+S+this.tagEndChar+a+this.indentate(b)+E:this.indentate(b)+"<"+f+d+S+">"+a+E}},s.prototype.closeTag=function(a){let f="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(f="/"):f=this.options.suppressEmptyNode?"/":`></${a}`,f},s.prototype.buildTextValNode=function(a,f,d,b){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(b)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(b)+`<!--${a}-->`+this.newLine;if(f[0]==="?")return this.indentate(b)+"<"+f+d+"?"+this.tagEndChar;{let E=this.options.tagValueProcessor(f,a);return E=this.replaceEntitiesValue(E),E===""?this.indentate(b)+"<"+f+d+this.closeTag(f)+this.tagEndChar:this.indentate(b)+"<"+f+d+">"+E+"</"+f+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const d=this.options.entities[f];a=a.replace(d.regex,d.val)}return a},e.exports=s},87:e=>{function t(s,l,c,u){let a="",f=!1;for(let d=0;d<s.length;d++){const b=s[d],E=r(b);if(E===void 0)continue;let S="";if(S=c.length===0?E:`${c}.${E}`,E===l.textNodeName){let g=b[E];o(S,l)||(g=l.tagValueProcessor(E,g),g=i(g,l)),f&&(a+=u),a+=g,f=!1;continue}if(E===l.cdataPropName){f&&(a+=u),a+=`<![CDATA[${b[E][0][l.textNodeName]}]]>`,f=!1;continue}if(E===l.commentPropName){a+=u+`<!--${b[E][0][l.textNodeName]}-->`,f=!0;continue}if(E[0]==="?"){const g=n(b[":@"],l),v=E==="?xml"?"":u;let A=b[E][0][l.textNodeName];A=A.length!==0?" "+A:"",a+=v+`<${E}${A}${g}?>`,f=!0;continue}let T=u;T!==""&&(T+=l.indentBy);const w=u+`<${E}${n(b[":@"],l)}`,y=t(b[E],l,S,T);l.unpairedTags.indexOf(E)!==-1?l.suppressUnpairedNode?a+=w+">":a+=w+"/>":y&&y.length!==0||!l.suppressEmptyNode?y&&y.endsWith(">")?a+=w+`>${y}${u}</${E}>`:(a+=w+">",y&&u!==""&&(y.includes("/>")||y.includes("</"))?a+=u+l.indentBy+y+u:a+=y,a+=`</${E}>`):a+=w+"/>",f=!0}return a}function r(s){const l=Object.keys(s);for(let c=0;c<l.length;c++){const u=l[c];if(s.hasOwnProperty(u)&&u!==":@")return u}}function n(s,l){let c="";if(s&&!l.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let a=l.attributeValueProcessor(u,s[u]);a=i(a,l),a===!0&&l.suppressBooleanAttributes?c+=` ${u.substr(l.attributeNamePrefix.length)}`:c+=` ${u.substr(l.attributeNamePrefix.length)}="${a}"`}return c}function o(s,l){let c=(s=s.substr(0,s.length-l.textNodeName.length-1)).substr(s.lastIndexOf(".")+1);for(let u in l.stopNodes)if(l.stopNodes[u]===s||l.stopNodes[u]==="*."+c)return!0;return!1}function i(s,l){if(s&&s.length>0&&l.processEntities)for(let c=0;c<l.entities.length;c++){const u=l.entities[c];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,l){let c="";return l.format&&l.indentBy.length>0&&(c=`
45
+ `),t(s,l,"",c)}},193:(e,t,r)=>{const n=r(705);function o(f,d){let b="";for(;d<f.length&&f[d]!=="'"&&f[d]!=='"';d++)b+=f[d];if(b=b.trim(),b.indexOf(" ")!==-1)throw new Error("External entites are not supported");const E=f[d++];let S="";for(;d<f.length&&f[d]!==E;d++)S+=f[d];return[b,S,d]}function i(f,d){return f[d+1]==="!"&&f[d+2]==="-"&&f[d+3]==="-"}function s(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="N"&&f[d+4]==="T"&&f[d+5]==="I"&&f[d+6]==="T"&&f[d+7]==="Y"}function l(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="L"&&f[d+4]==="E"&&f[d+5]==="M"&&f[d+6]==="E"&&f[d+7]==="N"&&f[d+8]==="T"}function c(f,d){return f[d+1]==="!"&&f[d+2]==="A"&&f[d+3]==="T"&&f[d+4]==="T"&&f[d+5]==="L"&&f[d+6]==="I"&&f[d+7]==="S"&&f[d+8]==="T"}function u(f,d){return f[d+1]==="!"&&f[d+2]==="N"&&f[d+3]==="O"&&f[d+4]==="T"&&f[d+5]==="A"&&f[d+6]==="T"&&f[d+7]==="I"&&f[d+8]==="O"&&f[d+9]==="N"}function a(f){if(n.isName(f))return f;throw new Error(`Invalid entity name ${f}`)}e.exports=function(f,d){const b={};if(f[d+3]!=="O"||f[d+4]!=="C"||f[d+5]!=="T"||f[d+6]!=="Y"||f[d+7]!=="P"||f[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let E=1,S=!1,T=!1,w="";for(;d<f.length;d++)if(f[d]!=="<"||T)if(f[d]===">"){if(T?f[d-1]==="-"&&f[d-2]==="-"&&(T=!1,E--):E--,E===0)break}else f[d]==="["?S=!0:w+=f[d];else{if(S&&s(f,d)){let y,g;d+=7,[y,g,d]=o(f,d+1),g.indexOf("&")===-1&&(b[a(y)]={regx:RegExp(`&${y};`,"g"),val:g})}else if(S&&l(f,d))d+=8;else if(S&&c(f,d))d+=8;else if(S&&u(f,d))d+=9;else{if(!i)throw new Error("Invalid DOCTYPE");T=!0}E++,w=""}if(E!==0)throw new Error("Unclosed DOCTYPE")}return{entities:b,i:d}}},63:(e,t)=>{const r={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,o){return o},attributeValueProcessor:function(n,o){return o},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,o,i){return n}};t.buildOptions=function(n){return Object.assign({},r,n)},t.defaultOptions=r},299:(e,t,r)=>{const n=r(705),o=r(365),i=r(193),s=r(494),l=r(118);function c(R){const C=Object.keys(R);for(let P=0;P<C.length;P++){const _=C[P];this.lastEntities[_]={regex:new RegExp("&"+_+";","g"),val:R[_]}}}function u(R,C,P,_,L,B,$){if(R!==void 0&&(this.options.trimValues&&!_&&(R=R.trim()),R.length>0)){$||(R=this.replaceEntitiesValue(R));const D=this.options.tagValueProcessor(C,R,P,L,B);return D==null?R:typeof D!=typeof R||D!==R?D:this.options.trimValues||R.trim()===R?A(R,this.options.parseTagValue,this.options.numberParseOptions):R}}function a(R){if(this.options.removeNSPrefix){const C=R.split(":"),P=R.charAt(0)==="/"?"/":"";if(C[0]==="xmlns")return"";C.length===2&&(R=P+C[1])}return R}const f=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(R,C,P){if(this.options.ignoreAttributes!==!0&&typeof R=="string"){const _=n.getAllMatches(R,f),L=_.length,B={};for(let $=0;$<L;$++){const D=this.resolveNameSpace(_[$][1]);if(this.ignoreAttributesFn(D,C))continue;let H=_[$][4],X=this.options.attributeNamePrefix+D;if(D.length)if(this.options.transformAttributeName&&(X=this.options.transformAttributeName(X)),X==="__proto__"&&(X="#__proto__"),H!==void 0){this.options.trimValues&&(H=H.trim()),H=this.replaceEntitiesValue(H);const J=this.options.attributeValueProcessor(D,H,C);B[X]=J==null?H:typeof J!=typeof H||J!==H?J:A(H,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(B[X]=!0)}if(!Object.keys(B).length)return;if(this.options.attributesGroupName){const $={};return $[this.options.attributesGroupName]=B,$}return B}}const b=function(R){R=R.replace(/\r\n?/g,`
46
+ `);const C=new o("!xml");let P=C,_="",L="";for(let B=0;B<R.length;B++)if(R[B]==="<")if(R[B+1]==="/"){const $=y(R,">",B,"Closing Tag is not closed.");let D=R.substring(B+2,$).trim();if(this.options.removeNSPrefix){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),P&&(_=this.saveTextToParentTag(_,P,L));const H=L.substring(L.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let X=0;H&&this.options.unpairedTags.indexOf(H)!==-1?(X=L.lastIndexOf(".",L.lastIndexOf(".")-1),this.tagsNodeStack.pop()):X=L.lastIndexOf("."),L=L.substring(0,X),P=this.tagsNodeStack.pop(),_="",B=$}else if(R[B+1]==="?"){let $=g(R,B,!1,"?>");if(!$)throw new Error("Pi Tag is not closed.");if(_=this.saveTextToParentTag(_,P,L),!(this.options.ignoreDeclaration&&$.tagName==="?xml"||this.options.ignorePiTags)){const D=new o($.tagName);D.add(this.options.textNodeName,""),$.tagName!==$.tagExp&&$.attrExpPresent&&(D[":@"]=this.buildAttributesMap($.tagExp,L,$.tagName)),this.addChild(P,D,L)}B=$.closeIndex+1}else if(R.substr(B+1,3)==="!--"){const $=y(R,"-->",B+4,"Comment is not closed.");if(this.options.commentPropName){const D=R.substring(B+4,$-2);_=this.saveTextToParentTag(_,P,L),P.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}B=$}else if(R.substr(B+1,2)==="!D"){const $=i(R,B);this.docTypeEntities=$.entities,B=$.i}else if(R.substr(B+1,2)==="!["){const $=y(R,"]]>",B,"CDATA is not closed.")-2,D=R.substring(B+9,$);_=this.saveTextToParentTag(_,P,L);let H=this.parseTextData(D,P.tagname,L,!0,!1,!0,!0);H==null&&(H=""),this.options.cdataPropName?P.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):P.add(this.options.textNodeName,H),B=$+2}else{let $=g(R,B,this.options.removeNSPrefix),D=$.tagName;const H=$.rawTagName;let X=$.tagExp,J=$.attrExpPresent,le=$.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),P&&_&&P.tagname!=="!xml"&&(_=this.saveTextToParentTag(_,P,L,!1));const me=P;if(me&&this.options.unpairedTags.indexOf(me.tagname)!==-1&&(P=this.tagsNodeStack.pop(),L=L.substring(0,L.lastIndexOf("."))),D!==C.tagname&&(L+=L?"."+D:D),this.isItStopNode(this.options.stopNodes,L,D)){let fe="";if(X.length>0&&X.lastIndexOf("/")===X.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),L=L.substr(0,L.length-1),X=D):X=X.substr(0,X.length-1),B=$.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)B=$.closeIndex;else{const Se=this.readStopNodeData(R,H,le+1);if(!Se)throw new Error(`Unexpected end of ${H}`);B=Se.i,fe=Se.tagContent}const we=new o(D);D!==X&&J&&(we[":@"]=this.buildAttributesMap(X,L,D)),fe&&(fe=this.parseTextData(fe,D,L,!0,J,!0,!0)),L=L.substr(0,L.lastIndexOf(".")),we.add(this.options.textNodeName,fe),this.addChild(P,we,L)}else{if(X.length>0&&X.lastIndexOf("/")===X.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),L=L.substr(0,L.length-1),X=D):X=X.substr(0,X.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const fe=new o(D);D!==X&&J&&(fe[":@"]=this.buildAttributesMap(X,L,D)),this.addChild(P,fe,L),L=L.substr(0,L.lastIndexOf("."))}else{const fe=new o(D);this.tagsNodeStack.push(P),D!==X&&J&&(fe[":@"]=this.buildAttributesMap(X,L,D)),this.addChild(P,fe,L),P=fe}_="",B=le}}else _+=R[B];return C.child};function E(R,C,P){const _=this.options.updateTag(C.tagname,P,C[":@"]);_===!1||(typeof _=="string"&&(C.tagname=_),R.addChild(C))}const S=function(R){if(this.options.processEntities){for(let C in this.docTypeEntities){const P=this.docTypeEntities[C];R=R.replace(P.regx,P.val)}for(let C in this.lastEntities){const P=this.lastEntities[C];R=R.replace(P.regex,P.val)}if(this.options.htmlEntities)for(let C in this.htmlEntities){const P=this.htmlEntities[C];R=R.replace(P.regex,P.val)}R=R.replace(this.ampEntity.regex,this.ampEntity.val)}return R};function T(R,C,P,_){return R&&(_===void 0&&(_=Object.keys(C.child).length===0),(R=this.parseTextData(R,C.tagname,P,!1,!!C[":@"]&&Object.keys(C[":@"]).length!==0,_))!==void 0&&R!==""&&C.add(this.options.textNodeName,R),R=""),R}function w(R,C,P){const _="*."+P;for(const L in R){const B=R[L];if(_===B||C===B)return!0}return!1}function y(R,C,P,_){const L=R.indexOf(C,P);if(L===-1)throw new Error(_);return L+C.length-1}function g(R,C,P){const _=function(J,le){let me,fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",we="";for(let Se=le;Se<J.length;Se++){let re=J[Se];if(me)re===me&&(me="");else if(re==='"'||re==="'")me=re;else if(re===fe[0]){if(!fe[1])return{data:we,index:Se};if(J[Se+1]===fe[1])return{data:we,index:Se}}else re===" "&&(re=" ");we+=re}}(R,C+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!_)return;let L=_.data;const B=_.index,$=L.search(/\s/);let D=L,H=!0;$!==-1&&(D=L.substring(0,$),L=L.substring($+1).trimStart());const X=D;if(P){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1),H=D!==_.data.substr(J+1))}return{tagName:D,tagExp:L,closeIndex:B,attrExpPresent:H,rawTagName:X}}function v(R,C,P){const _=P;let L=1;for(;P<R.length;P++)if(R[P]==="<")if(R[P+1]==="/"){const B=y(R,">",P,`${C} is not closed`);if(R.substring(P+2,B).trim()===C&&(L--,L===0))return{tagContent:R.substring(_,P),i:B};P=B}else if(R[P+1]==="?")P=y(R,"?>",P+1,"StopNode is not closed.");else if(R.substr(P+1,3)==="!--")P=y(R,"-->",P+3,"StopNode is not closed.");else if(R.substr(P+1,2)==="![")P=y(R,"]]>",P,"StopNode is not closed.")-2;else{const B=g(R,P,">");B&&((B&&B.tagName)===C&&B.tagExp[B.tagExp.length-1]!=="/"&&L++,P=B.closeIndex)}}function A(R,C,P){if(C&&typeof R=="string"){const _=R.trim();return _==="true"||_!=="false"&&s(R,P)}return n.isExist(R)?R:""}e.exports=class{constructor(R){this.options=R,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:(C,P)=>String.fromCharCode(Number.parseInt(P,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(C,P)=>String.fromCharCode(Number.parseInt(P,16))}},this.addExternalEntities=c,this.parseXml=b,this.parseTextData=u,this.resolveNameSpace=a,this.buildAttributesMap=d,this.isItStopNode=w,this.replaceEntitiesValue=S,this.readStopNodeData=v,this.saveTextToParentTag=T,this.addChild=E,this.ignoreAttributesFn=l(this.options.ignoreAttributes)}}},338:(e,t,r)=>{const{buildOptions:n}=r(63),o=r(299),{prettify:i}=r(728),s=r(31);e.exports=class{constructor(l){this.externalEntities={},this.options=n(l)}parse(l,c){if(typeof l!="string"){if(!l.toString)throw new Error("XML data is accepted in String or Bytes[] form.");l=l.toString()}if(c){c===!0&&(c={});const f=s.validate(l,c);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const u=new o(this.options);u.addExternalEntities(this.externalEntities);const a=u.parseXml(l);return this.options.preserveOrder||a===void 0?a:i(a,this.options)}addEntity(l,c){if(c.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(l.indexOf("&")!==-1||l.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(c==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[l]=c}}},728:(e,t)=>{function r(s,l,c){let u;const a={};for(let f=0;f<s.length;f++){const d=s[f],b=n(d);let E="";if(E=c===void 0?b:c+"."+b,b===l.textNodeName)u===void 0?u=d[b]:u+=""+d[b];else{if(b===void 0)continue;if(d[b]){let S=r(d[b],l,E);const T=i(S,l);d[":@"]?o(S,d[":@"],E,l):Object.keys(S).length!==1||S[l.textNodeName]===void 0||l.alwaysCreateTextNode?Object.keys(S).length===0&&(l.alwaysCreateTextNode?S[l.textNodeName]="":S=""):S=S[l.textNodeName],a[b]!==void 0&&a.hasOwnProperty(b)?(Array.isArray(a[b])||(a[b]=[a[b]]),a[b].push(S)):l.isArray(b,E,T)?a[b]=[S]:a[b]=S}}}return typeof u=="string"?u.length>0&&(a[l.textNodeName]=u):u!==void 0&&(a[l.textNodeName]=u),a}function n(s){const l=Object.keys(s);for(let c=0;c<l.length;c++){const u=l[c];if(u!==":@")return u}}function o(s,l,c,u){if(l){const a=Object.keys(l),f=a.length;for(let d=0;d<f;d++){const b=a[d];u.isArray(b,c+"."+b,!0,!0)?s[b]=[l[b]]:s[b]=l[b]}}}function i(s,l){const{textNodeName:c}=l,u=Object.keys(s).length;return u===0||!(u!==1||!s[c]&&typeof s[c]!="boolean"&&s[c]!==0)}t.prettify=function(s,l){return r(s,l)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}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(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}e.exports=function(r){return r!=null&&(t(r)||function(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))}(r)||!!r._isBuffer)}},542:(e,t,r)=>{(function(){var n=r(298),o=r(526).utf8,i=r(135),s=r(526).bin,l=function(c,u){c.constructor==String?c=u&&u.encoding==="binary"?s.stringToBytes(c):o.stringToBytes(c):i(c)?c=Array.prototype.slice.call(c,0):Array.isArray(c)||c.constructor===Uint8Array||(c=c.toString());for(var a=n.bytesToWords(c),f=8*c.length,d=1732584193,b=-271733879,E=-1732584194,S=271733878,T=0;T<a.length;T++)a[T]=16711935&(a[T]<<8|a[T]>>>24)|4278255360&(a[T]<<24|a[T]>>>8);a[f>>>5]|=128<<f%32,a[14+(f+64>>>9<<4)]=f;var w=l._ff,y=l._gg,g=l._hh,v=l._ii;for(T=0;T<a.length;T+=16){var A=d,R=b,C=E,P=S;d=w(d,b,E,S,a[T+0],7,-680876936),S=w(S,d,b,E,a[T+1],12,-389564586),E=w(E,S,d,b,a[T+2],17,606105819),b=w(b,E,S,d,a[T+3],22,-1044525330),d=w(d,b,E,S,a[T+4],7,-176418897),S=w(S,d,b,E,a[T+5],12,1200080426),E=w(E,S,d,b,a[T+6],17,-1473231341),b=w(b,E,S,d,a[T+7],22,-45705983),d=w(d,b,E,S,a[T+8],7,1770035416),S=w(S,d,b,E,a[T+9],12,-1958414417),E=w(E,S,d,b,a[T+10],17,-42063),b=w(b,E,S,d,a[T+11],22,-1990404162),d=w(d,b,E,S,a[T+12],7,1804603682),S=w(S,d,b,E,a[T+13],12,-40341101),E=w(E,S,d,b,a[T+14],17,-1502002290),d=y(d,b=w(b,E,S,d,a[T+15],22,1236535329),E,S,a[T+1],5,-165796510),S=y(S,d,b,E,a[T+6],9,-1069501632),E=y(E,S,d,b,a[T+11],14,643717713),b=y(b,E,S,d,a[T+0],20,-373897302),d=y(d,b,E,S,a[T+5],5,-701558691),S=y(S,d,b,E,a[T+10],9,38016083),E=y(E,S,d,b,a[T+15],14,-660478335),b=y(b,E,S,d,a[T+4],20,-405537848),d=y(d,b,E,S,a[T+9],5,568446438),S=y(S,d,b,E,a[T+14],9,-1019803690),E=y(E,S,d,b,a[T+3],14,-187363961),b=y(b,E,S,d,a[T+8],20,1163531501),d=y(d,b,E,S,a[T+13],5,-1444681467),S=y(S,d,b,E,a[T+2],9,-51403784),E=y(E,S,d,b,a[T+7],14,1735328473),d=g(d,b=y(b,E,S,d,a[T+12],20,-1926607734),E,S,a[T+5],4,-378558),S=g(S,d,b,E,a[T+8],11,-2022574463),E=g(E,S,d,b,a[T+11],16,1839030562),b=g(b,E,S,d,a[T+14],23,-35309556),d=g(d,b,E,S,a[T+1],4,-1530992060),S=g(S,d,b,E,a[T+4],11,1272893353),E=g(E,S,d,b,a[T+7],16,-155497632),b=g(b,E,S,d,a[T+10],23,-1094730640),d=g(d,b,E,S,a[T+13],4,681279174),S=g(S,d,b,E,a[T+0],11,-358537222),E=g(E,S,d,b,a[T+3],16,-722521979),b=g(b,E,S,d,a[T+6],23,76029189),d=g(d,b,E,S,a[T+9],4,-640364487),S=g(S,d,b,E,a[T+12],11,-421815835),E=g(E,S,d,b,a[T+15],16,530742520),d=v(d,b=g(b,E,S,d,a[T+2],23,-995338651),E,S,a[T+0],6,-198630844),S=v(S,d,b,E,a[T+7],10,1126891415),E=v(E,S,d,b,a[T+14],15,-1416354905),b=v(b,E,S,d,a[T+5],21,-57434055),d=v(d,b,E,S,a[T+12],6,1700485571),S=v(S,d,b,E,a[T+3],10,-1894986606),E=v(E,S,d,b,a[T+10],15,-1051523),b=v(b,E,S,d,a[T+1],21,-2054922799),d=v(d,b,E,S,a[T+8],6,1873313359),S=v(S,d,b,E,a[T+15],10,-30611744),E=v(E,S,d,b,a[T+6],15,-1560198380),b=v(b,E,S,d,a[T+13],21,1309151649),d=v(d,b,E,S,a[T+4],6,-145523070),S=v(S,d,b,E,a[T+11],10,-1120210379),E=v(E,S,d,b,a[T+2],15,718787259),b=v(b,E,S,d,a[T+9],21,-343485551),d=d+A>>>0,b=b+R>>>0,E=E+C>>>0,S=S+P>>>0}return n.endian([d,b,E,S])};l._ff=function(c,u,a,f,d,b,E){var S=c+(u&a|~u&f)+(d>>>0)+E;return(S<<b|S>>>32-b)+u},l._gg=function(c,u,a,f,d,b,E){var S=c+(u&f|a&~f)+(d>>>0)+E;return(S<<b|S>>>32-b)+u},l._hh=function(c,u,a,f,d,b,E){var S=c+(u^a^f)+(d>>>0)+E;return(S<<b|S>>>32-b)+u},l._ii=function(c,u,a,f,d,b,E){var S=c+(a^(u|~f))+(d>>>0)+E;return(S<<b|S>>>32-b)+u},l._blocksize=16,l._digestsize=16,e.exports=function(c,u){if(c==null)throw new Error("Illegal argument "+c);var a=n.wordsToBytes(l(c,u));return u&&u.asBytes?a:u&&u.asString?s.bytesToString(a):n.bytesToHex(a)}})()},285:(e,t,r)=>{var n=r(2);e.exports=function(w){return w?(w.substr(0,2)==="{}"&&(w="\\{\\}"+w.substr(2)),T(function(y){return y.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(l).split("\\.").join(c)}(w),!0).map(a)):[]};var o="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(w){return parseInt(w,10)==w?parseInt(w,10):w.charCodeAt(0)}function a(w){return w.split(o).join("\\").split(i).join("{").split(s).join("}").split(l).join(",").split(c).join(".")}function f(w){if(!w)return[""];var y=[],g=n("{","}",w);if(!g)return w.split(",");var v=g.pre,A=g.body,R=g.post,C=v.split(",");C[C.length-1]+="{"+A+"}";var P=f(R);return R.length&&(C[C.length-1]+=P.shift(),C.push.apply(C,P)),y.push.apply(y,C),y}function d(w){return"{"+w+"}"}function b(w){return/^-?0\d/.test(w)}function E(w,y){return w<=y}function S(w,y){return w>=y}function T(w,y){var g=[],v=n("{","}",w);if(!v)return[w];var A=v.pre,R=v.post.length?T(v.post,!1):[""];if(/\$$/.test(v.pre))for(var C=0;C<R.length;C++){var P=A+"{"+v.body+"}"+R[C];g.push(P)}else{var _,L,B=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(v.body),$=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(v.body),D=B||$,H=v.body.indexOf(",")>=0;if(!D&&!H)return v.post.match(/,.*\}/)?T(w=v.pre+"{"+v.body+s+v.post):[w];if(D)_=v.body.split(/\.\./);else if((_=f(v.body)).length===1&&(_=T(_[0],!1).map(d)).length===1)return R.map(function(Z){return v.pre+_[0]+Z});if(D){var X=u(_[0]),J=u(_[1]),le=Math.max(_[0].length,_[1].length),me=_.length==3?Math.abs(u(_[2])):1,fe=E;J<X&&(me*=-1,fe=S);var we=_.some(b);L=[];for(var Se=X;fe(Se,J);Se+=me){var re;if($)(re=String.fromCharCode(Se))==="\\"&&(re="");else if(re=String(Se),we){var oe=le-re.length;if(oe>0){var ae=new Array(oe+1).join("0");re=Se<0?"-"+ae+re.slice(1):ae+re}}L.push(re)}}else{L=[];for(var Ae=0;Ae<_.length;Ae++)L.push.apply(L,T(_[Ae],!1))}for(Ae=0;Ae<L.length;Ae++)for(C=0;C<R.length;C++)P=A+L[Ae]+R[C],(!y||D||P)&&g.push(P)}return g}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},t(u)}function r(u){var a=typeof Map=="function"?new Map:void 0;return r=function(f){if(f===null||(d=f,Function.toString.call(d).indexOf("[native code]")===-1))return f;var d;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(a!==void 0){if(a.has(f))return a.get(f);a.set(f,b)}function b(){return n(f,arguments,i(this).constructor)}return b.prototype=Object.create(f.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),o(b,f)},r(u)}function n(u,a,f){return n=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,b,E){var S=[null];S.push.apply(S,b);var T=new(Function.bind.apply(d,S));return E&&o(T,E.prototype),T},n.apply(null,arguments)}function o(u,a){return o=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},o(u,a)}function i(u){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},i(u)}var s=function(u){function a(f){var d;return function(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}(this,a),(d=function(b,E){return!E||t(E)!=="object"&&typeof E!="function"?function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}(b):E}(this,i(a).call(this,f))).name="ObjectPrototypeMutationError",d}return function(f,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(d&&d.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),d&&o(f,d)}(a,u),a}(r(Error));function l(u,a){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=a.split("."),b=d.length,E=function(w){var y=d[w];if(!u)return{v:void 0};if(y==="+"){if(Array.isArray(u))return{v:u.map(function(v,A){var R=d.slice(w+1);return R.length>0?l(v,R.join("."),f):f(u,A,d,w)})};var g=d.slice(0,w).join(".");throw new Error("Object at wildcard (".concat(g,") is not an array"))}u=f(u,y,d,w)},S=0;S<b;S++){var T=E(S);if(t(T)==="object")return T.v}return u}function c(u,a){return u.length===a+1}e.exports={set:function(u,a,f){if(t(u)!="object"||u===null||a===void 0)return u;if(typeof a=="number")return u[a]=f,u[a];try{return l(u,a,function(d,b,E,S){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[b]){var T=Number.isInteger(Number(E[S+1])),w=E[S+1]==="+";d[b]=T||w?[]:{}}return c(E,S)&&(d[b]=f),d[b]})}catch(d){if(d instanceof s)throw d;return u}},get:function(u,a){if(t(u)!="object"||u===null||a===void 0)return u;if(typeof a=="number")return u[a];try{return l(u,a,function(f,d){return f[d]})}catch{return u}},has:function(u,a){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||a===void 0)return!1;if(typeof a=="number")return a in u;try{var d=!1;return l(u,a,function(b,E,S,T){if(!c(S,T))return b&&b[E];d=f.own?b.hasOwnProperty(E):E in b}),d}catch{return!1}},hasOwn:function(u,a,f){return this.has(u,a,f||{own:!0})},isIn:function(u,a,f){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||a===void 0)return!1;try{var b=!1,E=!1;return l(u,a,function(S,T,w,y){return b=b||S===f||!!S&&S[T]===f,E=c(w,y)&&t(S)==="object"&&T in S,S&&S[T]}),d.validPath?b&&E:b}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,r)=>{var n=r(410),o=function(u){return typeof u=="string"};function i(u,a){for(var f=[],d=0;d<u.length;d++){var b=u[d];b&&b!=="."&&(b===".."?f.length&&f[f.length-1]!==".."?f.pop():a&&f.push(".."):f.push(b))}return f}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function c(u){return s.exec(u).slice(1)}l.resolve=function(){for(var u="",a=!1,f=arguments.length-1;f>=-1&&!a;f--){var d=f>=0?arguments[f]:ye.cwd();if(!o(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,a=d.charAt(0)==="/")}return(a?"/":"")+(u=i(u.split("/"),!a).join("/"))||"."},l.normalize=function(u){var a=l.isAbsolute(u),f=u.substr(-1)==="/";return(u=i(u.split("/"),!a).join("/"))||a||(u="."),u&&f&&(u+="/"),(a?"/":"")+u},l.isAbsolute=function(u){return u.charAt(0)==="/"},l.join=function(){for(var u="",a=0;a<arguments.length;a++){var f=arguments[a];if(!o(f))throw new TypeError("Arguments to path.join must be strings");f&&(u+=u?"/"+f:f)}return l.normalize(u)},l.relative=function(u,a){function f(y){for(var g=0;g<y.length&&y[g]==="";g++);for(var v=y.length-1;v>=0&&y[v]==="";v--);return g>v?[]:y.slice(g,v+1)}u=l.resolve(u).substr(1),a=l.resolve(a).substr(1);for(var d=f(u.split("/")),b=f(a.split("/")),E=Math.min(d.length,b.length),S=E,T=0;T<E;T++)if(d[T]!==b[T]){S=T;break}var w=[];for(T=S;T<d.length;T++)w.push("..");return(w=w.concat(b.slice(S))).join("/")},l._makeLong=function(u){return u},l.dirname=function(u){var a=c(u),f=a[0],d=a[1];return f||d?(d&&(d=d.substr(0,d.length-1)),f+d):"."},l.basename=function(u,a){var f=c(u)[2];return a&&f.substr(-1*a.length)===a&&(f=f.substr(0,f.length-a.length)),f},l.extname=function(u){return c(u)[3]},l.format=function(u){if(!n.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var a=u.root||"";if(!o(a))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof u.root);return(u.dir?u.dir+l.sep:"")+(u.base||"")},l.parse=function(u){if(!o(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var a=c(u);if(!a||a.length!==4)throw new TypeError("Invalid path '"+u+"'");return a[1]=a[1]||"",a[2]=a[2]||"",a[3]=a[3]||"",{root:a[0],dir:a[0]+a[1].slice(0,a[1].length-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},647:(e,t)=>{var r=Object.prototype.hasOwnProperty;function n(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function o(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,s){s=s||"";var l,c,u=[];for(c in typeof s!="string"&&(s="?"),i)if(r.call(i,c)){if((l=i[c])||l!=null&&!isNaN(l)||(l=""),c=o(c),l=o(l),c===null||l===null)continue;u.push(c+"="+l)}return u.length?s+u.join("&"):""},t.parse=function(i){for(var s,l=/([^=?#&]+)=?([^&]*)/g,c={};s=l.exec(i);){var u=n(s[1]),a=n(s[2]);u===null||a===null||u in c||(c[u]=a)}return c}},670:e=>{e.exports=function(t,r){if(r=r.split(":")[0],!(t=+t))return!1;switch(r){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]+$/,r=/^([\-\+])?(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 n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(o){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},n,i),!o||typeof o!="string")return o;let s=o.trim();if(i.skipLike!==void 0&&i.skipLike.test(s))return o;if(i.hex&&t.test(s))return Number.parseInt(s,16);{const c=r.exec(s);if(c){const u=c[1],a=c[2];let f=((l=c[3])&&l.indexOf(".")!==-1&&((l=l.replace(/0+$/,""))==="."?l="0":l[0]==="."?l="0"+l:l[l.length-1]==="."&&(l=l.substr(0,l.length-1))),l);const d=c[4]||c[6];if(!i.leadingZeros&&a.length>0&&u&&s[2]!=="."||!i.leadingZeros&&a.length>0&&!u&&s[1]!==".")return o;{const b=Number(s),E=""+b;return E.search(/[eE]/)!==-1||d?i.eNotation?b:o:s.indexOf(".")!==-1?E==="0"&&f===""||E===f||u&&E==="-"+f?b:o:a?f===E||u+f===E?b:o:s===E||s===u+E?b:o}}return o}var l}},737:(e,t,r)=>{var n=r(670),o=r(647),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/;function f(y){return(y||"").toString().replace(i,"")}var d=[["#","hash"],["?","query"],function(y,g){return S(g.protocol)?y.replace(/\\/g,"/"):y},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],b={hash:1,query:1};function E(y){var g,v=(typeof window<"u"?window:typeof Pn<"u"?Pn:typeof self<"u"?self:{}).location||{},A={},R=typeof(y=y||v);if(y.protocol==="blob:")A=new w(unescape(y.pathname),{});else if(R==="string")for(g in A=new w(y,{}),b)delete A[g];else if(R==="object"){for(g in y)g in b||(A[g]=y[g]);A.slashes===void 0&&(A.slashes=l.test(y.href))}return A}function S(y){return y==="file:"||y==="ftp:"||y==="http:"||y==="https:"||y==="ws:"||y==="wss:"}function T(y,g){y=(y=f(y)).replace(s,""),g=g||{};var v,A=u.exec(y),R=A[1]?A[1].toLowerCase():"",C=!!A[2],P=!!A[3],_=0;return C?P?(v=A[2]+A[3]+A[4],_=A[2].length+A[3].length):(v=A[2]+A[4],_=A[2].length):P?(v=A[3]+A[4],_=A[3].length):v=A[4],R==="file:"?_>=2&&(v=v.slice(2)):S(R)?v=A[4]:R?C&&(v=v.slice(2)):_>=2&&S(g.protocol)&&(v=A[4]),{protocol:R,slashes:C||S(R),slashesCount:_,rest:v}}function w(y,g,v){if(y=(y=f(y)).replace(s,""),!(this instanceof w))return new w(y,g,v);var A,R,C,P,_,L,B=d.slice(),$=typeof g,D=this,H=0;for($!=="object"&&$!=="string"&&(v=g,g=null),v&&typeof v!="function"&&(v=o.parse),A=!(R=T(y||"",g=E(g))).protocol&&!R.slashes,D.slashes=R.slashes||A&&g.slashes,D.protocol=R.protocol||g.protocol||"",y=R.rest,(R.protocol==="file:"&&(R.slashesCount!==2||a.test(y))||!R.slashes&&(R.protocol||R.slashesCount<2||!S(D.protocol)))&&(B[3]=[/(.*)/,"pathname"]);H<B.length;H++)typeof(P=B[H])!="function"?(C=P[0],L=P[1],C!=C?D[L]=y:typeof C=="string"?~(_=C==="@"?y.lastIndexOf(C):y.indexOf(C))&&(typeof P[2]=="number"?(D[L]=y.slice(0,_),y=y.slice(_+P[2])):(D[L]=y.slice(_),y=y.slice(0,_))):(_=C.exec(y))&&(D[L]=_[1],y=y.slice(0,_.index)),D[L]=D[L]||A&&P[3]&&g[L]||"",P[4]&&(D[L]=D[L].toLowerCase())):y=P(y,D);v&&(D.query=v(D.query)),A&&g.slashes&&D.pathname.charAt(0)!=="/"&&(D.pathname!==""||g.pathname!=="")&&(D.pathname=function(X,J){if(X==="")return J;for(var le=(J||"/").split("/").slice(0,-1).concat(X.split("/")),me=le.length,fe=le[me-1],we=!1,Se=0;me--;)le[me]==="."?le.splice(me,1):le[me]===".."?(le.splice(me,1),Se++):Se&&(me===0&&(we=!0),le.splice(me,1),Se--);return we&&le.unshift(""),fe!=="."&&fe!==".."||le.push(""),le.join("/")}(D.pathname,g.pathname)),D.pathname.charAt(0)!=="/"&&S(D.protocol)&&(D.pathname="/"+D.pathname),n(D.port,D.protocol)||(D.host=D.hostname,D.port=""),D.username=D.password="",D.auth&&(~(_=D.auth.indexOf(":"))?(D.username=D.auth.slice(0,_),D.username=encodeURIComponent(decodeURIComponent(D.username)),D.password=D.auth.slice(_+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:"&&S(D.protocol)&&D.host?D.protocol+"//"+D.host:"null",D.href=D.toString()}w.prototype={set:function(y,g,v){var A=this;switch(y){case"query":typeof g=="string"&&g.length&&(g=(v||o.parse)(g)),A[y]=g;break;case"port":A[y]=g,n(g,A.protocol)?g&&(A.host=A.hostname+":"+g):(A.host=A.hostname,A[y]="");break;case"hostname":A[y]=g,A.port&&(g+=":"+A.port),A.host=g;break;case"host":A[y]=g,c.test(g)?(g=g.split(":"),A.port=g.pop(),A.hostname=g.join(":")):(A.hostname=g,A.port="");break;case"protocol":A.protocol=g.toLowerCase(),A.slashes=!v;break;case"pathname":case"hash":if(g){var R=y==="pathname"?"/":"#";A[y]=g.charAt(0)!==R?R+g:g}else A[y]=g;break;case"username":case"password":A[y]=encodeURIComponent(g);break;case"auth":var C=g.indexOf(":");~C?(A.username=g.slice(0,C),A.username=encodeURIComponent(decodeURIComponent(A.username)),A.password=g.slice(C+1),A.password=encodeURIComponent(decodeURIComponent(A.password))):A.username=encodeURIComponent(decodeURIComponent(g))}for(var P=0;P<d.length;P++){var _=d[P];_[4]&&(A[_[1]]=A[_[1]].toLowerCase())}return A.auth=A.password?A.username+":"+A.password:A.username,A.origin=A.protocol!=="file:"&&S(A.protocol)&&A.host?A.protocol+"//"+A.host:"null",A.href=A.toString(),A},toString:function(y){y&&typeof y=="function"||(y=o.stringify);var g,v=this,A=v.host,R=v.protocol;R&&R.charAt(R.length-1)!==":"&&(R+=":");var C=R+(v.protocol&&v.slashes||S(v.protocol)?"//":"");return v.username?(C+=v.username,v.password&&(C+=":"+v.password),C+="@"):v.password?(C+=":"+v.password,C+="@"):v.protocol!=="file:"&&S(v.protocol)&&!A&&v.pathname!=="/"&&(C+="@"),(A[A.length-1]===":"||c.test(v.hostname)&&!v.port)&&(A+=":"),C+=A+v.pathname,(g=typeof v.query=="object"?y(v.query):v.query)&&(C+=g.charAt(0)!=="?"?"?"+g:g),v.hash&&(C+=v.hash),C}},w.extractProtocol=T,w.location=E,w.trimLeft=f,w.qs=o,e.exports=w},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Km={};function dt(e){var t=Km[e];if(t!==void 0)return t.exports;var r=Km[e]={id:e,loaded:!1,exports:{}};return DR[e].call(r.exports,r,r.exports,dt),r.loaded=!0,r.exports}dt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return dt.d(t,{a:t}),t},dt.d=(e,t)=>{for(var r in t)dt.o(t,r)&&!dt.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},dt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),dt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Dr={};dt.d(Dr,{hT:()=>hr,O4:()=>bn,Kd:()=>WR,YK:()=>HR,UU:()=>J_,Gu:()=>oy,ky:()=>Sy,h4:()=>So,ch:()=>Ms,hq:()=>ei,i5:()=>Ey});var LR=dt(737),BR=dt.n(LR);function $u(e){if(!Du(e))throw new Error("Parameter was not an error")}function Du(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class pr extends Error{constructor(t,r){const n=[...arguments],{options:o,shortMessage:i}=function(l){let c,u="";if(l.length===0)c={};else if(Du(l[0]))c={cause:l[0]},u=l.slice(1).join(" ")||"";else if(l[0]&&typeof l[0]=="object")c=Object.assign({},l[0]),u=l.slice(1).join(" ")||"";else{if(typeof l[0]!="string")throw new Error("Invalid arguments passed to Layerr");c={},u=u=l.join(" ")||""}return{options:c,shortMessage:u}}(n);let s=i;if(o.cause&&(s=`${s}: ${o.cause.message}`),super(s),this.message=s,o.name&&typeof o.name=="string"?this.name=o.name:this.name="Layerr",o.cause&&Object.defineProperty(this,"_cause",{value:o.cause}),Object.defineProperty(this,"_info",{value:{}}),o.info&&typeof o.info=="object"&&Object.assign(this._info,o.info),Error.captureStackTrace){const l=o.constructorOpt||this.constructor;Error.captureStackTrace(this,l)}}static cause(t){return $u(t),t._cause&&Du(t._cause)?t._cause:null}static fullStack(t){$u(t);const r=pr.cause(t);return r?`${t.stack}
47
+ caused by: ${pr.fullStack(r)}`:t.stack??""}static info(t){$u(t);const r={},n=pr.cause(t);return n&&Object.assign(r,pr.info(n)),t._info&&Object.assign(r,t._info),r}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var MR=dt(47),xs=dt.n(MR);const Qm="__PATH_SEPARATOR_POSIX__",Xm="__PATH_SEPARATOR_WINDOWS__";function It(e){try{const t=e.replace(/\//g,Qm).replace(/\\\\/g,Xm);return encodeURIComponent(t).split(Xm).join("\\\\").split(Qm).join("/")}catch(t){throw new pr(t,"Failed encoding path")}}function Ym(e){return e.startsWith("/")?e:"/"+e}function yo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function jR(e){let t=new(BR())(e).pathname;return t.length<=0&&(t="/"),yo(t)}function Ct(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){return function(n){var o=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var i=n.shift();n[0]=i+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s<n.length;s++){var l=n[s];if(typeof l!="string")throw new TypeError("Url must be a string. Received "+l);l!==""&&(s>0&&(l=l.replace(/^[\/]+/,"")),l=s<n.length-1?l.replace(/[\/]+$/,""):l.replace(/[\/]+$/,"/"),o.push(l))}var c=o.join("/"),u=(c=c.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((n,o,i)=>((i===0||o!=="/"||o==="/"&&n[n.length-1]!=="/")&&n.push(o),n),[]))}var UR=dt(542),bo=dt.n(UR);const qR="abcdef0123456789";function Jm(e,t){const r=e.url.replace("//",""),n=r.indexOf("/")==-1?"/":r.slice(r.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),l=function(d,b,E,S,T,w,y){const g=y||bo()(`${b}:${E}:${S}`);return d&&d.toLowerCase()==="md5-sess"?bo()(`${g}:${T}:${w}`):g}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=bo()(`${o}:${n}`),u=i?bo()(`${l}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):bo()(`${l}:${t.nonce}:${c}`),a={username:t.username,realm:t.realm,nonce:t.nonce,uri:n,qop:i,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},f=[];for(const d in a)a[d]&&(d==="qop"||d==="nc"||d==="algorithm"?f.push(`${d}=${a[d]}`):f.push(`${d}="${a[d]}"`));return`Digest ${f.join(", ")}`}function Zm(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var VR=dt(101),ey=dt.n(VR);function ty(e){return ey().decode(e)}function ry(e,t){var r;return`Basic ${r=`${e}:${t}`,ey().encode(r)}`}const Os=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,zR=Os.fetch.bind(Os),WR=Os.Request,HR=Os.Response;let hr=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),bn=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 ny(e,t,r,n,o){switch(e.authType){case hr.Auto:t&&r&&(e.headers.Authorization=ry(t,r));break;case hr.Digest:e.digest=function(s,l,c){return{username:s,password:l,ha1:c,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,r,o);break;case hr.None:break;case hr.Password:e.headers.Authorization=ry(t,r);break;case hr.Token:e.headers.Authorization=`${(i=n).token_type} ${i.access_token}`;break;default:throw new pr({info:{code:bn.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}dt(345),dt(800);const iy="@@HOTPATCHER",GR=()=>{};function Lu(e){return{original:e,methods:[e],final:!1}}class KR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=iy}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==iy)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach(n=>{this.configuration.registry.hasOwnProperty(n)?r&&(this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])):this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])}),t._configuration=this.configuration,this}execute(t){const r=this.get(t)||GR;for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r(...o)}get(t){const r=this.configuration.registry[t];if(!r)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 n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];if(o.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];let u=l;const a=this;for(;o.length>0;)u=[o.shift().apply(a,u)];return u[0]}}(...r.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:o=!1}=n;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof r!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(o)this.configuration.registry[t]?this.configuration.registry[t].methods.push(r):this.configuration.registry[t]=Lu(r);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Lu(r),{original:i})}else this.configuration.registry[t]=Lu(r);return this}patchInline(t,r){this.isPatched(t)||this.patch(t,r);for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return this.execute(t,...o)}plugin(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.forEach(i=>{this.patch(t,i,{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 Bu=null;function oy(){return Bu||(Bu=new KR),Bu}function ks(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 r=t;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function sy(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=null,o=[...t];for(;o.length>0;){const i=o.shift();n=n?ay(n,i):ks(i)}return n}function ay(e,t){const r=ks(e);return Object.keys(t).forEach(n=>{r.hasOwnProperty(n)?Array.isArray(t[n])?r[n]=Array.isArray(r[n])?[...r[n],...t[n]]:[...t[n]]:typeof t[n]=="object"&&t[n]?r[n]=typeof r[n]=="object"&&r[n]?ay(r[n],t[n]):ks(t[n]):r[n]=t[n]:r[n]=t[n]}),r}function QR(e){const t={};for(const r of e.keys())t[r]=e.get(r);return t}function Mu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length===0)return{};const n={};return t.reduce((o,i)=>(Object.keys(i).forEach(s=>{const l=s.toLowerCase();n.hasOwnProperty(l)?o[n[l]]=i[s]:(n[l]=s,o[s]=i[s])}),o),{})}dt(805);const XR=typeof ArrayBuffer=="function",{toString:YR}=Object.prototype;function ly(e){return XR&&(e instanceof ArrayBuffer||YR.call(e)==="[object ArrayBuffer]")}function cy(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function ju(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function Uu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const uy=ju(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=sy(e,{headers:{Authorization:Jm(e,t)}})),Uu(Ns(e),function(r){let n=!1;return o=function(s){return n?s:r},(i=function(){if(r.status==401)return t.hasDigestAuth=function(s,l){if(!Zm(s))return!1;const c=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",a=c.exec(u);if(!a)break;l[a[1]]=a[2]||a[3]}return l.nc+=1,l.cnonce=function(){let u="";for(let a=0;a<32;++a)u=`${u}${qR[Math.floor(16*Math.random())]}`;return u}(),!0}(r,t),function(){if(t.hasDigestAuth)return Uu(Ns(e=sy(e,{headers:{Authorization:Jm(e,t)}})),function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,n=!0,s})}();t.nc++}())&&i.then?i.then(o):o(i);var o,i})}),JR=ju(function(e,t){return Uu(Ns(e),function(r){return r.ok?(t.authType=hr.Password,r):r.status==401&&Zm(r)?(t.authType=hr.Digest,ny(t,t.username,t.password,void 0,void 0),e._digest=t.digest,uy(e)):r})}),zt=ju(function(e,t){return t.authType===hr.Auto?JR(e,t):e._digest?uy(e):Ns(e)});function Wt(e,t,r){const n=ks(e);return n.headers=Mu(t.headers,n.headers||{},r.headers||{}),r.data!==void 0&&(n.data=r.data),r.signal&&(n.signal=r.signal),t.httpAgent&&(n.httpAgent=t.httpAgent),t.httpsAgent&&(n.httpsAgent=t.httpsAgent),t.digest&&(n._digest=t.digest),typeof t.withCredentials=="boolean"&&(n.withCredentials=t.withCredentials),n}function Ns(e){const t=oy();return t.patchInline("request",r=>t.patchInline("fetch",zR,r.url,function(n){let o={};const i={method:n.method};if(n.headers&&(o=Mu(o,n.headers)),n.data!==void 0){const[s,l]=function(c){if(typeof c=="string")return[c,{}];if(cy(c))return[c,{}];if(ly(c))return[c,{}];if(c&&typeof c=="object")return[JSON.stringify(c),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof c)}(n.data);i.body=s,o=Mu(o,l)}return n.signal&&(i.signal=n.signal),n.withCredentials&&(i.credentials="include"),i.headers=o,i}(r)),e)}var ZR=dt(285);const $s=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},e_={"[: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]},vo=e=>e.replace(/[[\]\\-]/g,"\\$&"),fy=e=>e.join(""),t_=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const n=[],o=[];let i=r+1,s=!1,l=!1,c=!1,u=!1,a=r,f="";e:for(;i<e.length;){const S=e.charAt(i);if(S!=="!"&&S!=="^"||i!==r+1){if(S==="]"&&s&&!c){a=i+1;break}if(s=!0,S!=="\\"||c){if(S==="["&&!c){for(const[T,[w,y,g]]of Object.entries(e_))if(e.startsWith(T,i)){if(f)return["$.",!1,e.length-r,!0];i+=T.length,g?o.push(w):n.push(w),l=l||y;continue e}}c=!1,f?(S>f?n.push(vo(f)+"-"+vo(S)):S===f&&n.push(vo(S)),f="",i++):e.startsWith("-]",i+1)?(n.push(vo(S+"-")),i+=2):e.startsWith("-",i+1)?(f=S,i+=2):(n.push(vo(S)),i++)}else c=!0,i++}else u=!0,i++}if(a<i)return["",!1,0,!1];if(!n.length&&!o.length)return["$.",!1,e.length-r,!0];if(o.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u)return[(d=n[0].length===2?n[0].slice(-1):n[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,a-r,!1];var d;const b="["+(u?"^":"")+fy(n)+"]",E="["+(u?"":"^")+fy(o)+"]";return[n.length&&o.length?"("+b+"|"+E+")":n.length?b:E,l,a-r,!0]},wo=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")},r_=new Set(["!","?","+","*","@"]),dy=e=>r_.has(e),qu="(?!\\.)",n_=new Set(["[","."]),i_=new Set(["..","."]),o_=new Set("().*{}+?[]^$\\!"),Vu="[^/]",py=Vu+"*?",hy=Vu+"+?",yr=class yr{constructor(t,r){Sr(this,pi);Ee(this,"type");Sr(this,Kt);Sr(this,Zt);Sr(this,An,!1);Sr(this,Rt,[]);Sr(this,Mt);Sr(this,kn);Sr(this,fi);Sr(this,Nn,!1);Sr(this,nn);Sr(this,di);Sr(this,$o,!1);let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&$t(this,Zt,!0),$t(this,Mt,r),$t(this,Kt,Ne(this,Mt)?Ne(Ne(this,Mt),Kt):this),$t(this,nn,Ne(this,Kt)===this?n:Ne(Ne(this,Kt),nn)),$t(this,fi,Ne(this,Kt)===this?[]:Ne(Ne(this,Kt),fi)),t!=="!"||Ne(Ne(this,Kt),Nn)||Ne(this,fi).push(this),$t(this,kn,Ne(this,Mt)?Ne(Ne(this,Mt),Rt).length:0)}get hasMagic(){if(Ne(this,Zt)!==void 0)return Ne(this,Zt);for(const t of Ne(this,Rt))if(typeof t!="string"&&(t.type||t.hasMagic))return $t(this,Zt,!0);return Ne(this,Zt)}toString(){return Ne(this,di)!==void 0?Ne(this,di):this.type?$t(this,di,this.type+"("+Ne(this,Rt).map(t=>String(t)).join("|")+")"):$t(this,di,Ne(this,Rt).map(t=>String(t)).join(""))}push(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(const o of r)if(o!==""){if(typeof o!="string"&&!(o instanceof yr&&Ne(o,Mt)===this))throw new Error("invalid part: "+o);Ne(this,Rt).push(o)}}toJSON(){var r;const t=this.type===null?Ne(this,Rt).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...Ne(this,Rt).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===Ne(this,Kt)||Ne(Ne(this,Kt),Nn)&&((r=Ne(this,Mt))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(Ne(this,Kt)===this)return!0;if(!((r=Ne(this,Mt))!=null&&r.isStart()))return!1;if(Ne(this,kn)===0)return!0;const t=Ne(this,Mt);for(let n=0;n<Ne(this,kn);n++){const o=Ne(t,Rt)[n];if(!(o instanceof yr&&o.type==="!"))return!1}return!0}isEnd(){var r,n,o;if(Ne(this,Kt)===this||((r=Ne(this,Mt))==null?void 0:r.type)==="!")return!0;if(!((n=Ne(this,Mt))!=null&&n.isEnd()))return!1;if(!this.type)return(o=Ne(this,Mt))==null?void 0:o.isEnd();const t=Ne(this,Mt)?Ne(Ne(this,Mt),Rt).length:0;return Ne(this,kn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const r=new yr(this.type,t);for(const n of Ne(this,Rt))r.copyIn(n);return r}static fromGlob(t){var o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=new yr(null,void 0,r);return Ln(o=yr,$n,va).call(o,t,n,0,r),n}toMMPattern(){if(this!==Ne(this,Kt))return Ne(this,Kt).toMMPattern();const t=this.toString(),[r,n,o,i]=this.toRegExpSource();if(!(o||Ne(this,Zt)||Ne(this,nn).nocase&&!Ne(this,nn).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const s=(Ne(this,nn).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:t})}get options(){return Ne(this,nn)}toRegExpSource(t){var c;const r=t??!!Ne(this,nn).dot;if(Ne(this,Kt)===this&&Ln(this,pi,x0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),a=Ne(this,Rt).map(b=>{var y;const[E,S,T,w]=typeof b=="string"?Ln(y=yr,$n,O0).call(y,b,Ne(this,Zt),u):b.toRegExpSource(t);return $t(this,Zt,Ne(this,Zt)||T),$t(this,An,Ne(this,An)||w),E}).join("");let f="";if(this.isStart()&&typeof Ne(this,Rt)[0]=="string"&&(Ne(this,Rt).length!==1||!i_.has(Ne(this,Rt)[0]))){const b=n_,E=r&&b.has(a.charAt(0))||a.startsWith("\\.")&&b.has(a.charAt(2))||a.startsWith("\\.\\.")&&b.has(a.charAt(4)),S=!r&&!t&&b.has(a.charAt(0));f=E?"(?!(?:^|/)\\.\\.?(?:$|/))":S?qu:""}let d="";return this.isEnd()&&Ne(Ne(this,Kt),Nn)&&((c=Ne(this,Mt))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[f+a+d,wo(a),$t(this,Zt,!!Ne(this,Zt)),Ne(this,An)]}const n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=Ln(this,pi,nd).call(this,r);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return $t(this,Rt,[u]),this.type=null,$t(this,Zt,void 0),[u,wo(this.toString()),!1,!1]}let s=!n||t||r?"":Ln(this,pi,nd).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let l="";return l=this.type==="!"&&Ne(this,$o)?(this.isStart()&&!r?qu:"")+hy:o+i+(this.type==="!"?"))"+(!this.isStart()||r||t?"":qu)+py+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[l,wo(i),$t(this,Zt,!!Ne(this,Zt)),Ne(this,An)]}};Kt=new WeakMap,Zt=new WeakMap,An=new WeakMap,Rt=new WeakMap,Mt=new WeakMap,kn=new WeakMap,fi=new WeakMap,Nn=new WeakMap,nn=new WeakMap,di=new WeakMap,$o=new WeakMap,pi=new WeakSet,x0=function(){if(this!==Ne(this,Kt))throw new Error("should only call on root");if(Ne(this,Nn))return this;let t;for(this.toString(),$t(this,Nn,!0);t=Ne(this,fi).pop();){if(t.type!=="!")continue;let r=t,n=Ne(r,Mt);for(;n;){for(let o=Ne(r,kn)+1;!n.type&&o<Ne(n,Rt).length;o++)for(const i of Ne(t,Rt)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(Ne(n,Rt)[o])}r=n,n=Ne(r,Mt)}}return this},$n=new WeakSet,va=function(t,r,n,o){var b,E;let i=!1,s=!1,l=-1,c=!1;if(r.type===null){let S=n,T="";for(;S<t.length;){const w=t.charAt(S++);if(i||w==="\\")i=!i,T+=w;else if(s)S===l+1?w!=="^"&&w!=="!"||(c=!0):w!=="]"||S===l+2&&c||(s=!1),T+=w;else if(w!=="[")if(o.noext||!dy(w)||t.charAt(S)!=="(")T+=w;else{r.push(T),T="";const y=new yr(w,r);S=Ln(b=yr,$n,va).call(b,t,y,S,o),r.push(y)}else s=!0,l=S,c=!1,T+=w}return r.push(T),S}let u=n+1,a=new yr(null,r);const f=[];let d="";for(;u<t.length;){const S=t.charAt(u++);if(i||S==="\\")i=!i,d+=S;else if(s)u===l+1?S!=="^"&&S!=="!"||(c=!0):S!=="]"||u===l+2&&c||(s=!1),d+=S;else if(S!=="[")if(dy(S)&&t.charAt(u)==="("){a.push(d),d="";const T=new yr(S,a);a.push(T),u=Ln(E=yr,$n,va).call(E,t,T,u,o)}else if(S!=="|"){if(S===")")return d===""&&Ne(r,Rt).length===0&&$t(r,$o,!0),a.push(d),d="",r.push(...f,a),u;d+=S}else a.push(d),d="",f.push(a),a=new yr(null,r);else s=!0,l=u,c=!1,d+=S}return r.type=null,$t(r,Zt,void 0),$t(r,Rt,[t.substring(n-1)]),u},nd=function(t){return Ne(this,Rt).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[n,o,i,s]=r.toRegExpSource(t);return $t(this,An,Ne(this,An)||s),n}).filter(r=>!(this.isStart()&&this.isEnd()&&!r)).join("|")},O0=function(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,i="",s=!1;for(let l=0;l<t.length;l++){const c=t.charAt(l);if(o)o=!1,i+=(o_.has(c)?"\\":"")+c;else if(c!=="\\"){if(c==="["){const[u,a,f,d]=t_(t,l);if(f){i+=u,s=s||a,l+=f-1,r=r||d;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=Vu,r=!0):(i+=n&&t==="*"?hy:py,r=!0)}else l===t.length-1?i+="\\\\":o=!0}return[i,wo(t),!!r,s]},Sr(yr,$n);let Ds=yr;const or=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $s(t),!(!r.nocomment&&t.charAt(0)==="#")&&new Ls(t,r).match(e)},s_=/^\*+([^+@!?\*\[\(]*)$/,a_=e=>t=>!t.startsWith(".")&&t.endsWith(e),l_=e=>t=>t.endsWith(e),c_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),u_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),f_=/^\*+\.\*+$/,d_=e=>!e.startsWith(".")&&e.includes("."),p_=e=>e!=="."&&e!==".."&&e.includes("."),h_=/^\.\*+$/,g_=e=>e!=="."&&e!==".."&&e.startsWith("."),m_=/^\*+$/,y_=e=>e.length!==0&&!e.startsWith("."),b_=e=>e.length!==0&&e!=="."&&e!=="..",v_=/^\?+([^+@!?\*\[\(]*)?$/,w_=e=>{let[t,r=""]=e;const n=gy([t]);return r?(r=r.toLowerCase(),o=>n(o)&&o.toLowerCase().endsWith(r)):n},S_=e=>{let[t,r=""]=e;const n=my([t]);return r?(r=r.toLowerCase(),o=>n(o)&&o.toLowerCase().endsWith(r)):n},E_=e=>{let[t,r=""]=e;const n=my([t]);return r?o=>n(o)&&o.endsWith(r):n},T_=e=>{let[t,r=""]=e;const n=gy([t]);return r?o=>n(o)&&o.endsWith(r):n},gy=e=>{let[t]=e;const r=t.length;return n=>n.length===r&&!n.startsWith(".")},my=e=>{let[t]=e;const r=t.length;return n=>n.length===r&&n!=="."&&n!==".."},yy=typeof ye=="object"&&ye?typeof ye.env=="object"&&ye.env&&ye.env.__MINIMATCH_TESTING_PLATFORM__||ye.platform:"posix";or.sep=yy==="win32"?"\\":"/";const Lr=Symbol("globstar **");or.GLOBSTAR=Lr,or.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=>or(r,e,t)};const Br=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};or.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return or;const t=or;return Object.assign(function(r,n){return t(r,n,Br(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(r){super(r,Br(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(r){return t.defaults(Br(e,r)).Minimatch}},AST:class extends t.AST{constructor(r,n){super(r,n,Br(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(r,Br(e,n))}},unescape:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(r,Br(e,n))},escape:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(r,Br(e,n))},filter:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(r,Br(e,n))},defaults:r=>t.defaults(Br(e,r)),makeRe:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(r,Br(e,n))},braceExpand:function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(r,Br(e,n))},match:function(r,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(r,n,Br(e,o))},sep:t.sep,GLOBSTAR:Lr})};const by=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $s(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ZR(e)};or.braceExpand=by,or.makeRe=function(e){return new Ls(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},or.match=function(e,t){const r=new Ls(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter(n=>r.match(n)),r.options.nonull&&!e.length&&e.push(t),e};const vy=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ls{constructor(t){Ee(this,"options");Ee(this,"set");Ee(this,"pattern");Ee(this,"windowsPathsNoEscape");Ee(this,"nonegate");Ee(this,"negate");Ee(this,"comment");Ee(this,"empty");Ee(this,"preserveMultipleSlashes");Ee(this,"partial");Ee(this,"globSet");Ee(this,"globParts");Ee(this,"nocase");Ee(this,"isWindows");Ee(this,"platform");Ee(this,"windowsNoMagicRoot");Ee(this,"regexp");let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$s(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||yy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of t)if(typeof r!="string")return!0;return!1}debug(){}make(){const t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const n=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,s,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&vy.test(i[2])||vy.test(i[3])),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(a=>this.parse(a))];if(u)return[i[0],...i.slice(1).map(a=>this.parse(a))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][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 n=0;n<t.length;n++)for(let o=0;o<t[n].length;o++)t[n][o]==="**"&&(t[n][o]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=r>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,o)=>{const i=n[n.length-1];return o==="**"&&i==="**"?n:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(n.pop(),n):(n.push(o),n)},[])).length===0?[""]:r)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const i=t[o];o===1&&i===""&&t[0]===""||i!=="."&&i!==""||(r=!0,t.splice(o,1),o--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const o=t[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let o=-1;for(;(o=n.indexOf("**",o+1))!==-1;){let s=o;for(;n[s+1]==="**";)s++;s>o&&n.splice(o+1,s-o);let l=n[o+1];const c=n[o+2],u=n[o+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(o,1);const a=n.slice(0);a[o]="**",t.push(a),o--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){const l=n[s];s===1&&l===""&&n[0]===""||l!=="."&&l!==""||(r=!0,n.splice(s,1),s--)}n[0]!=="."||n.length!==2||n[1]!=="."&&n[1]!==""||(r=!0,n.pop())}let i=0;for(;(i=n.indexOf("..",i+1))!==-1;){const s=n[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;const l=i===1&&n[i+1]==="**"?["."]:[];n.splice(i-1,2,...l),n.length===0&&n.push(""),i-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){const o=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(o){t[r]=[],t[n]=o;break}}return t.filter(r=>r.length)}partsMatch(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,i=0,s=[],l="";for(;o<t.length&&i<r.length;)if(t[o]===r[i])s.push(l==="b"?r[i]:t[o]),o++,i++;else if(n&&t[o]==="**"&&r[i]===t[o+1])s.push(t[o]),o++;else if(n&&r[i]==="**"&&t[o]===r[i+1])s.push(r[i]),i++;else if(t[o]!=="*"||!r[i]||!this.options.dot&&r[i].startsWith(".")||r[i]==="**"){if(r[i]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||l==="a")return!1;l="b",s.push(r[i]),o++,i++}else{if(l==="b")return!1;l="a",s.push(t[o]),o++,i++}return t.length===r.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,n=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.options;if(this.isWindows){const S=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!S&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),w=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),y=T?3:S?0:void 0,g=!w&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3])?3:w?0:void 0;if(typeof y=="number"&&typeof g=="number"){const[v,A]=[t[y],r[g]];v.toLowerCase()===A.toLowerCase()&&(r[g]=v,g>y?r=r.slice(g):y>g&&(t=t.slice(y)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var s=0,l=0,c=t.length,u=r.length;s<c&&l<u;s++,l++){this.debug("matchOne loop");var a=r[l],f=t[s];if(this.debug(r,a,f),a===!1)return!1;if(a===Lr){this.debug("GLOBSTAR",[r,a,f]);var d=s,b=l+1;if(b===u){for(this.debug("** at the end");s<c;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;d<c;){var E=t[d];if(this.debug(`
48
48
  globstar while`,t,d,r,b,E),this.matchOne(t.slice(d),r.slice(b),n))return this.debug("globstar found match!",d,c,E),!0;if(E==="."||E===".."||!o.dot&&E.charAt(0)==="."){this.debug("dot detected!",t,d,r,b);break}this.debug("globstar swallow a segment, and continue"),d++}return!(!n||(this.debug(`
49
- >>> no match, partial?`,t,d,r,b),d!==c))}let w;if(typeof a=="string"?(w=f===a,this.debug("string match",a,f,w)):(w=a.test(f),this.debug("pattern match",a,f,w)),!w)return!1}if(s===c&&l===u)return!0;if(s===c)return n;if(l===u)return s===c-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return by(this.pattern,this.options)}parse(t){$s(t);const r=this.options;if(t==="**")return Lr;if(t==="")return"";let n,o=null;(n=t.match(w_))?o=r.dot?E_:S_:(n=t.match(u_))?o=(r.nocase?r.dot?h_:p_:r.dot?d_:f_)(n[1]):(n=t.match(T_))?o=(r.nocase?r.dot?R_:A_:r.dot?__:I_)(n):(n=t.match(g_))?o=r.dot?y_:m_:(n=t.match(b_))&&(o=v_);const i=Ds.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const r=this.options,n=r.noglobstar?"[^/]*?":r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=new Set(r.nocase?["i"]:[]);let i=t.map(c=>{const u=c.map(a=>{if(a instanceof RegExp)for(const f of a.flags.split(""))o.add(f);return typeof a=="string"?a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):a===Lr?Lr:a._src});return u.forEach((a,f)=>{const d=u[f+1],b=u[f-1];a===Lr&&b!==Lr&&(b===void 0?d!==void 0&&d!==Lr?u[f+1]="(?:\\/|"+n+"\\/)?"+d:u[f]=n:d===void 0?u[f-1]=b+"(?:\\/|"+n+")?":d!==Lr&&(u[f-1]=b+"(?:\\/|\\/"+n+"\\/)"+d,u[f+1]=Lr))}),u.filter(a=>a!==Lr).join("/")}).join("|");const[s,l]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+l+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...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 r=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==="/"&&r)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const i=this.set;this.debug(this.pattern,"set",i);let s=o[o.length-1];if(!s)for(let l=o.length-2;!s&&l>=0;l--)s=o[l];for(let l=0;l<i.length;l++){const c=i[l];let u=o;if(n.matchBase&&c.length===1&&(u=[s]),this.matchOne(u,c,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return sr.defaults(t).Minimatch}}function Vu(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 Ht(e,t){const{status:r}=t;if(r===401&&e.digest)return t;if(r>=400)throw Vu(t);return t}function ei(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?ZR(e.headers):{},status:e.status,statusText:e.statusText}:t}sr.AST=Ds,sr.Minimatch=Ls,sr.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},sr.unescape=wo;const C_=(wy=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:It(e.remoteURL,_t(t)),method:"COPY",headers:{Destination:It(e.remoteURL,_t(r)),Overwrite:n.overwrite===!1?"F":"T",Depth:n.shallow?"0":"infinity"}},e,n);return s=function(l){Ht(e,l)},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(wy.apply(this,e))}catch(r){return Promise.reject(r)}});var wy,zu=ft(635),F_=ft(829),vn=ft.n(F_),ki=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(ki||{});function Bs(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ki.Original;const n=vn().get(e,t);return r==="array"&&Array.isArray(n)===!1?[n]:r==="object"&&Array.isArray(n)?n[0]:n}function So(e){return new Promise(t=>{t(function(r){const{multistatus:n}=r;if(n==="")return{multistatus:{response:[]}};if(!n)throw new Error("Invalid response: No root multistatus found");const o={multistatus:Array.isArray(n)?n[0]:n};return vn().set(o,"multistatus.response",Bs(o,"multistatus.response",ki.Array)),vn().set(o,"multistatus.response",vn().get(o,"multistatus.response").map(i=>function(s){const l=Object.assign({},s);return l.status?vn().set(l,"status",Bs(l,"status",ki.Object)):(vn().set(l,"propstat",Bs(l,"propstat",ki.Object)),vn().set(l,"propstat.prop",Bs(l,"propstat.prop",ki.Object))),l}(i))),o}(new zu.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(r,n,o)=>n==="true"||n==="false"?n==="true":n,tagValueProcessor(r,n,o){if(!o.endsWith("propstat.prop.displayname"))return n}}).parse(e)))})}function Ms(e,t){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:n=null,getcontentlength:o="0",resourcetype:i=null,getcontenttype:s=null,getetag:l=null}=e,c=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",u={filename:t,basename:xs().basename(t),lastmod:n,size:parseInt(o,10),type:c,etag:typeof l=="string"?l.replace(/"/g,""):null};return c==="file"&&(u.mime=s&&typeof s=="string"?s.split(";")[0]:""),r&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),u.props=e),u}function Sy(e,t){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=null;try{e.multistatus.response[0].propstat&&(n=e.multistatus.response[0])}catch{}if(!n)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:o,status:i}}=n,[s,l,c]=i.split(" ",3),u=parseInt(l,10);if(u>=400){const a=new Error(`Invalid response: ${u} ${c}`);throw a.status=u,a}return Ms(o,yo(t),r)}function Ey(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Wu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Hu=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:n=!1}=r,o=Wt({url:It(e.remoteURL,_t(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,r);return Wu(zt(o,e),function(i){return Ht(e,i),Wu(i.text(),function(s){return Wu(So(s),function(l){const c=Sy(l,t,n);return ei(i,c,n)})})})});function Ty(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const P_=Ay(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=function(i){if(!i||i==="/")return[];let s=i;const l=[];do l.push(s),s=xs().dirname(s);while(s&&s!=="/");return l}(yo(t));n.sort((i,s)=>i.length>s.length?1:s.length>i.length?-1:0);let o=!1;return function(i,s,l){if(typeof i[_y]=="function"){let w=function(R){try{for(;!(c=f.next()).done;)if((R=s(c.value))&&R.then){if(!Iy(R))return void R.then(w,a||(a=gr.bind(null,u=new Ni,2)));R=R.v}u?gr(u,1,R):u=R}catch(S){gr(u||(u=new Ni),2,S)}};var c,u,a,f=i[_y]();if(w(),f.return){var d=function(R){try{c.done||f.return()}catch{}return R};if(u&&u.then)return u.then(d,function(R){throw d(R)});d()}return u}if(!("length"in i))throw new TypeError("Object is not iterable");for(var b=[],E=0;E<i.length;E++)b.push(i[E]);return function(w,R,S){var m,g,v=-1;return function T(A){try{for(;++v<w.length&&(!S||!S());)if((A=R(v))&&A.then){if(!Iy(A))return void A.then(T,g||(g=gr.bind(null,m=new Ni,2)));A=A.v}m?gr(m,1,A):m=A}catch(F){gr(m||(m=new Ni),2,F)}}(),m}(b,function(w){return s(b[w])},l)}(n,function(i){return s=function(){return function(c,u){try{var a=Ty(Hu(e,i),function(f){if(f.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(f){return u(f)}return a&&a.then?a.then(void 0,u):a}(0,function(c){const u=c;return function(){if(u.status===404)return o=!0,Ry(Gu(e,i,{...r,recursive:!1}));throw c}()})},(l=function(){if(o)return Ry(Gu(e,i,{...r,recursive:!1}))}())&&l.then?l.then(s):s();var s,l},function(){return!1})});function Ay(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function x_(){}function Ry(e,t){return e&&e.then?e.then(x_):Promise.resolve()}const _y=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function gr(e,t,r){if(!e.s){if(r instanceof Ni){if(!r.s)return void(r.o=gr.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(gr.bind(null,e,t),gr.bind(null,e,2));e.s=t,e.v=r;const n=e.o;n&&n(e)}}const Ni=function(){function e(){}return e.prototype.then=function(t,r){const n=new e,o=this.s;if(o){const i=1&o?t:r;if(i){try{gr(n,1,i(this.v))}catch(s){gr(n,2,s)}return n}return this}return this.o=function(i){try{const s=i.v;1&i.s?gr(n,1,t?t(s):s):r?gr(n,1,r(s)):gr(n,2,s)}catch(s){gr(n,2,s)}},n},e}();function Iy(e){return e instanceof Ni&&1&e.s}const Gu=Ay(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(r.recursive===!0)return P_(e,t,r);const n=Wt({url:It(e.remoteURL,(o=_t(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,r);var o;return Ty(zt(n,e),function(i){Ht(e,i)})});var O_=ft(388),Cy=ft.n(O_);const k_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n={};if(typeof r.range=="object"&&typeof r.range.start=="number"){let l=`bytes=${r.range.start}-`;typeof r.range.end=="number"&&(l=`${l}${r.range.end}`),n.Range=l}const o=Wt({url:It(e.remoteURL,_t(t)),method:"GET",headers:n},e,r);return s=function(l){if(Ht(e,l),n.Range&&l.status!==206){const c=new Error(`Invalid response code for partial request: ${l.status}`);throw c.status=l.status,c}return r.callback&&setTimeout(()=>{r.callback(l)},0),l.body},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),N_=()=>{},$_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){r.url||(r.url=It(e.remoteURL,_t(t)));const n=Wt(r,e,{});return i=function(s){return Ht(e,s),s},(o=zt(n,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),D_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:It(e.remoteURL,_t(t)),method:"DELETE"},e,r);return i=function(s){Ht(e,s)},(o=zt(n,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),L_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(n,o){try{var i=(s=Hu(e,t,r),l=function(){return!0},c?l?l(s):s:(s&&s.then||(s=Promise.resolve(s)),l?s.then(l):s))}catch(u){return o(u)}var s,l,c;return i&&i.then?i.then(void 0,o):i}(0,function(n){if(n.status===404)return!1;throw n})});function Ku(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const B_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:It(e.remoteURL,_t(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:r.deep?"infinity":"1"}},e,r);return Ku(zt(n,e),function(o){return Ht(e,o),Ku(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Ku(So(i),function(s){const l=Ym(t);let c=function(u,a,f){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],b=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const E=xs().join(a,"/"),{multistatus:{response:w}}=u,R=w.map(S=>{const m=function(v){try{return v.replace(/^https?:\/\/[^\/]+/,"")}catch(T){throw new pr(T,"Failed normalising HREF")}}(S.href),{propstat:{prop:g}}=S;return Ms(g,E==="/"?decodeURIComponent(yo(m)):yo(xs().relative(decodeURIComponent(E),decodeURIComponent(m))),d)});return b?R:R.filter(S=>S.basename&&(S.type==="file"||S.filename!==f.replace(/\/$/,"")))}(s,Ym(e.remoteBasePath||e.remotePath),l,r.details,r.includeSelf);return r.glob&&(c=function(u,a){return u.filter(f=>sr(f.filename,a,{matchBase:!0}))}(c,r.glob)),ei(o,c,r.details)})})})});function Qu(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const M_=Qu(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:It(e.remoteURL,_t(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[q_]},e,r);return js(zt(n,e),function(o){return Ht(e,o),js(o.text(),function(i){return ei(o,i,r.details)})})});function js(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const j_=Qu(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:It(e.remoteURL,_t(t)),method:"GET"},e,r);return js(zt(n,e),function(o){let i;return Ht(e,o),function(s,l){var c=s();return c&&c.then?c.then(l):l()}(function(){return js(o.arrayBuffer(),function(s){i=s})},function(){return ei(o,i,r.details)})})}),U_=Qu(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:n="binary"}=r;if(n!=="binary"&&n!=="text")throw new pr({info:{code:bn.InvalidOutputFormat}},`Invalid output format: ${n}`);return n==="text"?M_(e,t,r):j_(e,t,r)}),q_=e=>e;function V_(e){return new zu.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Fy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Fy(e,t){const r={...e};for(const n in r)r.hasOwnProperty(n)&&(r[n]&&typeof r[n]=="object"&&n.indexOf(":")===-1?(r[`${t}:${n}`]=Fy(r[n],t),delete r[n]):/^@_/.test(n)===!1&&(r[`${t}:${n}`]=r[n],delete r[n]));return r}function Xu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Py(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const z_=Py(function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:It(e.remoteURL,_t(t)),method:"UNLOCK",headers:{"Lock-Token":r}},e,n);return Xu(zt(o,e),function(i){if(Ht(e,i),i.status!==204&&i.status!==200)throw Vu(i)})}),W_=Py(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:n,timeout:o=H_}=r,i={Accept:"text/plain,application/xml",Timeout:o};n&&(i.If=n);const s=Wt({url:It(e.remoteURL,_t(t)),method:"LOCK",headers:i,data:V_(e.contactHref)},e,r);return Xu(zt(s,e),function(l){return Ht(e,l),Xu(l.text(),function(c){const u=(d=c,new zu.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),a=vn().get(u,"prop.lockdiscovery.activelock.locktoken.href"),f=vn().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!a)throw Vu(l,"No lock token received: ");return{token:a,serverTimeout:f}})})}),H_="Infinite, Second-4100000000";function Yu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const G_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.path||"/",n=Wt({url:It(e.remoteURL,r),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Yu(zt(n,e),function(o){return Ht(e,o),Yu(o.text(),function(i){return Yu(So(i),function(s){const l=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":a,"quota-available-bytes":f}}}=u;return a!==void 0&&f!==void 0?{used:parseInt(String(a),10),available:Ey(f)}:null}catch{}return null}(s);return ei(o,l,t.details)})})})});function Ju(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const K_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:n=!1}=r,o=Wt({url:It(e.remoteURL,_t(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,r);return Ju(zt(o,e),function(i){return Ht(e,i),Ju(i.text(),function(s){return Ju(So(s),function(l){const c=function(u,a,f){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some(b=>{var E,w;return((w=(b.status||((E=b.propstat)==null?void 0:E.status)).split(" ",3))==null?void 0:w[1])==="507"&&b.href.replace(/\/$/,"").endsWith(_t(a).replace(/\/$/,""))}),u.multistatus.response.forEach(b=>{if(b.propstat===void 0)return;const E=b.href.split("/").map(decodeURIComponent).join("/");d.results.push(Ms(b.propstat.prop,E,f))}),d}(l,t,n);return ei(i,c,n)})})})}),Q_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:It(e.remoteURL,_t(t)),method:"MOVE",headers:{Destination:It(e.remoteURL,_t(r)),Overwrite:n.overwrite===!1?"F":"T"}},e,n);return s=function(l){Ht(e,l)},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var X_=ft(172);const Y_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:o=!0,overwrite:i=!0}=n,s={"Content-Type":"application/octet-stream"};o===!1||(s["Content-Length"]=typeof o=="number"?`${o}`:`${function(a){if(ly(a))return a.byteLength;if(cy(a))return a.length;if(typeof a=="string")return(0,X_.d)(a);throw new pr({info:{code:bn.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(r)}`),i||(s["If-None-Match"]="*");const l=Wt({url:It(e.remoteURL,_t(t)),method:"PUT",headers:s,data:r},e,n);return u=function(a){try{Ht(e,a)}catch(f){const d=f;if(d.status!==412||i)throw d;return!1}return!0},(c=zt(l,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),xy=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:It(e.remoteURL,_t(t)),method:"OPTIONS"},e,r);return i=function(s){try{Ht(e,s)}catch(l){throw l}return{compliance:(s.headers.get("DAV")??"").split(",").map(l=>l.trim()),server:s.headers.get("Server")??""}},(o=zt(n,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function Eo(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const J_=Zu(function(e,t,r,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new pr({info:{code:bn.InvalidUpdateRange}},`Invalid update range ${r} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(n-r+1),"Content-Range":`bytes ${r}-${n}/*`},l=Wt({url:It(e.remoteURL,_t(t)),method:"PUT",headers:s,data:o},e,i);return Eo(zt(l,e),function(c){Ht(e,c)})});function Oy(e,t){var r=e();return r&&r.then?r.then(t):t(r)}const Z_=Zu(function(e,t,r,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new pr({info:{code:bn.InvalidUpdateRange}},`Invalid update range ${r} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(n-r+1),"X-Update-Range":`bytes=${r}-${n}`},l=Wt({url:It(e.remoteURL,_t(t)),method:"PATCH",headers:s,data:o},e,i);return Eo(zt(l,e),function(c){Ht(e,c)})});function Zu(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const eI=Zu(function(e,t,r,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Eo(xy(e,t,i),function(s){let l=!1;return Oy(function(){if(s.compliance.includes("sabredav-partialupdate"))return Eo(Z_(e,t,r,n,o,i),function(c){return l=!0,c})},function(c){let u=!1;return l?c:Oy(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Eo(J_(e,t,r,n,o,i),function(a){return u=!0,a})},function(a){if(u)return a;throw new pr({info:{code:bn.NotSupported}},"Not supported")})})})}),tI="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function rI(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:r=null,remoteBasePath:n,contactHref:o=tI,ha1:i,headers:s={},httpAgent:l,httpsAgent:c,password:u,token:a,username:f,withCredentials:d}=t;let b=r;b||(b=f||u?hr.Password:hr.None);const E={authType:b,remoteBasePath:n,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:l,httpsAgent:c,password:u,remotePath:zR(e),remoteURL:e,token:a,username:f,withCredentials:d};return ny(E,f,u,a,i),{copyFile:(w,R,S)=>C_(E,w,R,S),createDirectory:(w,R)=>Gu(E,w,R),createReadStream:(w,R)=>function(S,m){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const v=new(Cy()).PassThrough;return k_(S,m,g).then(T=>{T.pipe(v)}).catch(T=>{v.emit("error",T)}),v}(E,w,R),createWriteStream:(w,R,S)=>function(m,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:N_;const A=new(Cy()).PassThrough,F={};v.overwrite===!1&&(F["If-None-Match"]="*");const C=Wt({url:It(m.remoteURL,_t(g)),method:"PUT",headers:F,data:A,maxRedirects:0},m,v);return zt(C,m).then(I=>Ht(m,I)).then(I=>{setTimeout(()=>{T(I)},0)}).catch(I=>{A.emit("error",I)}),A}(E,w,R,S),customRequest:(w,R)=>$_(E,w,R),deleteFile:(w,R)=>D_(E,w,R),exists:(w,R)=>L_(E,w,R),getDirectoryContents:(w,R)=>B_(E,w,R),getFileContents:(w,R)=>U_(E,w,R),getFileDownloadLink:w=>function(R,S){let m=It(R.remoteURL,_t(S));const g=/^https:/i.test(m)?"https":"http";switch(R.authType){case hr.None:break;case hr.Password:{const v=ty(R.headers.Authorization.replace(/^Basic /i,"").trim());m=m.replace(/^https?:\/\//,`${g}://${v}@`);break}default:throw new pr({info:{code:bn.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${R.authType}`)}return m}(E,w),getFileUploadLink:w=>function(R,S){let m=`${It(R.remoteURL,_t(S))}?Content-Type=application/octet-stream`;const g=/^https:/i.test(m)?"https":"http";switch(R.authType){case hr.None:break;case hr.Password:{const v=ty(R.headers.Authorization.replace(/^Basic /i,"").trim());m=m.replace(/^https?:\/\//,`${g}://${v}@`);break}default:throw new pr({info:{code:bn.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${R.authType}`)}return m}(E,w),getHeaders:()=>Object.assign({},E.headers),getQuota:w=>G_(E,w),lock:(w,R)=>W_(E,w,R),moveFile:(w,R,S)=>Q_(E,w,R,S),putFileContents:(w,R,S)=>Y_(E,w,R,S),partialUpdateFileContents:(w,R,S,m,g)=>eI(E,w,R,S,m,g),getDAVCompliance:w=>xy(E,w),search:(w,R)=>K_(E,w,R),setHeaders:w=>{E.headers=Object.assign({},w)},stat:(w,R)=>Hu(E,w,R),unlock:(w,R,S)=>z_(E,w,R,S)}}Dr.hT,Dr.O4,Dr.Kd,Dr.YK,Dr.UU,Dr.Gu,Dr.ky,Dr.h4,Dr.ch,Dr.hq,Dr.i5;var ef={},tf={},ky;function rf(){return ky||(ky=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",r=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",n="["+t+"]["+r+"]*",o=new RegExp("^"+n+"$"),i=function(l,c){const u=[];let a=c.exec(l);for(;a;){const f=[];f.startIndex=c.lastIndex-a[0].length;const d=a.length;for(let b=0;b<d;b++)f.push(a[b]);u.push(f),a=c.exec(l)}return u},s=function(l){const c=o.exec(l);return!(c===null||typeof c>"u")};e.isExist=function(l){return typeof l<"u"},e.isEmptyObject=function(l){return Object.keys(l).length===0},e.merge=function(l,c,u){if(c){const a=Object.keys(c),f=a.length;for(let d=0;d<f;d++)u==="strict"?l[a[d]]=[c[a[d]]]:l[a[d]]=c[a[d]]}},e.getValue=function(l){return e.isExist(l)?l:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=n}(tf)),tf}var Ny;function $y(){if(Ny)return ef;Ny=1;const e=rf(),t={allowBooleanAttributes:!1,unpairedTags:[]};ef.validate=function(S,m){m=Object.assign({},t,m);const g=[];let v=!1,T=!1;S[0]==="\uFEFF"&&(S=S.substr(1));for(let A=0;A<S.length;A++)if(S[A]==="<"&&S[A+1]==="?"){if(A+=2,A=n(S,A),A.err)return A}else if(S[A]==="<"){let F=A;if(A++,S[A]==="!"){A=o(S,A);continue}else{let C=!1;S[A]==="/"&&(C=!0,A++);let I="";for(;A<S.length&&S[A]!==">"&&S[A]!==" "&&S[A]!==" "&&S[A]!==`
50
- `&&S[A]!=="\r";A++)I+=S[A];if(I=I.trim(),I[I.length-1]==="/"&&(I=I.substring(0,I.length-1),A--),!E(I)){let $;return I.trim().length===0?$="Invalid space after '<'.":$="Tag '"+I+"' is an invalid name.",d("InvalidTag",$,w(S,A))}const L=l(S,A);if(L===!1)return d("InvalidAttr","Attributes for '"+I+"' have open quote.",w(S,A));let B=L.value;if(A=L.index,B[B.length-1]==="/"){const $=A-B.length;B=B.substring(0,B.length-1);const D=u(B,m);if(D===!0)v=!0;else return d(D.err.code,D.err.msg,w(S,$+D.err.line))}else if(C)if(L.tagClosed){if(B.trim().length>0)return d("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",w(S,F));if(g.length===0)return d("InvalidTag","Closing tag '"+I+"' has not been opened.",w(S,F));{const $=g.pop();if(I!==$.tagName){let D=w(S,$.tagStartPos);return d("InvalidTag","Expected closing tag '"+$.tagName+"' (opened in line "+D.line+", col "+D.col+") instead of closing tag '"+I+"'.",w(S,F))}g.length==0&&(T=!0)}}else return d("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",w(S,A));else{const $=u(B,m);if($!==!0)return d($.err.code,$.err.msg,w(S,A-B.length+$.err.line));if(T===!0)return d("InvalidXml","Multiple possible root nodes found.",w(S,A));m.unpairedTags.indexOf(I)!==-1||g.push({tagName:I,tagStartPos:F}),v=!0}for(A++;A<S.length;A++)if(S[A]==="<")if(S[A+1]==="!"){A++,A=o(S,A);continue}else if(S[A+1]==="?"){if(A=n(S,++A),A.err)return A}else break;else if(S[A]==="&"){const $=f(S,A);if($==-1)return d("InvalidChar","char '&' is not expected.",w(S,A));A=$}else if(T===!0&&!r(S[A]))return d("InvalidXml","Extra text at the end",w(S,A));S[A]==="<"&&A--}}else{if(r(S[A]))continue;return d("InvalidChar","char '"+S[A]+"' is not expected.",w(S,A))}if(v){if(g.length==1)return d("InvalidTag","Unclosed tag '"+g[0].tagName+"'.",w(S,g[0].tagStartPos));if(g.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(g.map(A=>A.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function r(S){return S===" "||S===" "||S===`
51
- `||S==="\r"}function n(S,m){const g=m;for(;m<S.length;m++)if(S[m]=="?"||S[m]==" "){const v=S.substr(g,m-g);if(m>5&&v==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",w(S,m));if(S[m]=="?"&&S[m+1]==">"){m++;break}else continue}return m}function o(S,m){if(S.length>m+5&&S[m+1]==="-"&&S[m+2]==="-"){for(m+=3;m<S.length;m++)if(S[m]==="-"&&S[m+1]==="-"&&S[m+2]===">"){m+=2;break}}else if(S.length>m+8&&S[m+1]==="D"&&S[m+2]==="O"&&S[m+3]==="C"&&S[m+4]==="T"&&S[m+5]==="Y"&&S[m+6]==="P"&&S[m+7]==="E"){let g=1;for(m+=8;m<S.length;m++)if(S[m]==="<")g++;else if(S[m]===">"&&(g--,g===0))break}else if(S.length>m+9&&S[m+1]==="["&&S[m+2]==="C"&&S[m+3]==="D"&&S[m+4]==="A"&&S[m+5]==="T"&&S[m+6]==="A"&&S[m+7]==="["){for(m+=8;m<S.length;m++)if(S[m]==="]"&&S[m+1]==="]"&&S[m+2]===">"){m+=2;break}}return m}const i='"',s="'";function l(S,m){let g="",v="",T=!1;for(;m<S.length;m++){if(S[m]===i||S[m]===s)v===""?v=S[m]:v!==S[m]||(v="");else if(S[m]===">"&&v===""){T=!0;break}g+=S[m]}return v!==""?!1:{value:g,index:m,tagClosed:T}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(S,m){const g=e.getAllMatches(S,c),v={};for(let T=0;T<g.length;T++){if(g[T][1].length===0)return d("InvalidAttr","Attribute '"+g[T][2]+"' has no space in starting.",R(g[T]));if(g[T][3]!==void 0&&g[T][4]===void 0)return d("InvalidAttr","Attribute '"+g[T][2]+"' is without value.",R(g[T]));if(g[T][3]===void 0&&!m.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+g[T][2]+"' is not allowed.",R(g[T]));const A=g[T][2];if(!b(A))return d("InvalidAttr","Attribute '"+A+"' is an invalid name.",R(g[T]));if(!v.hasOwnProperty(A))v[A]=1;else return d("InvalidAttr","Attribute '"+A+"' is repeated.",R(g[T]))}return!0}function a(S,m){let g=/\d/;for(S[m]==="x"&&(m++,g=/[\da-fA-F]/);m<S.length;m++){if(S[m]===";")return m;if(!S[m].match(g))break}return-1}function f(S,m){if(m++,S[m]===";")return-1;if(S[m]==="#")return m++,a(S,m);let g=0;for(;m<S.length;m++,g++)if(!(S[m].match(/\w/)&&g<20)){if(S[m]===";")break;return-1}return m}function d(S,m,g){return{err:{code:S,msg:m,line:g.line||g,col:g.col}}}function b(S){return e.isName(S)}function E(S){return e.isName(S)}function w(S,m){const g=S.substring(0,m).split(/\r?\n/);return{line:g.length,col:g[g.length-1].length+1}}function R(S){return S.startIndex+S[1].length}return ef}var Us={},Dy;function nI(){if(Dy)return Us;Dy=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(r,n){return n},attributeValueProcessor:function(r,n){return n},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,n,o){return r}},t=function(r){return Object.assign({},e,r)};return Us.buildOptions=t,Us.defaultOptions=e,Us}var nf,Ly;function iI(){if(Ly)return nf;Ly=1;class e{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,n){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:n})}addChild(r){r.tagname==="__proto__"&&(r.tagname="#__proto__"),r[":@"]&&Object.keys(r[":@"]).length>0?this.child.push({[r.tagname]:r.child,":@":r[":@"]}):this.child.push({[r.tagname]:r.child})}}return nf=e,nf}var of,By;function oI(){if(By)return of;By=1;const e=rf();function t(u,a){const f={};if(u[a+3]==="O"&&u[a+4]==="C"&&u[a+5]==="T"&&u[a+6]==="Y"&&u[a+7]==="P"&&u[a+8]==="E"){a=a+9;let d=1,b=!1,E=!1,w="";for(;a<u.length;a++)if(u[a]==="<"&&!E){if(b&&o(u,a)){a+=7;let R,S;[R,S,a]=r(u,a+1),S.indexOf("&")===-1&&(f[c(R)]={regx:RegExp(`&${R};`,"g"),val:S})}else if(b&&i(u,a))a+=8;else if(b&&s(u,a))a+=8;else if(b&&l(u,a))a+=9;else if(n)E=!0;else throw new Error("Invalid DOCTYPE");d++,w=""}else if(u[a]===">"){if(E?u[a-1]==="-"&&u[a-2]==="-"&&(E=!1,d--):d--,d===0)break}else u[a]==="["?b=!0:w+=u[a];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:a}}function r(u,a){let f="";for(;a<u.length&&u[a]!=="'"&&u[a]!=='"';a++)f+=u[a];if(f=f.trim(),f.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[a++];let b="";for(;a<u.length&&u[a]!==d;a++)b+=u[a];return[f,b,a]}function n(u,a){return u[a+1]==="!"&&u[a+2]==="-"&&u[a+3]==="-"}function o(u,a){return u[a+1]==="!"&&u[a+2]==="E"&&u[a+3]==="N"&&u[a+4]==="T"&&u[a+5]==="I"&&u[a+6]==="T"&&u[a+7]==="Y"}function i(u,a){return u[a+1]==="!"&&u[a+2]==="E"&&u[a+3]==="L"&&u[a+4]==="E"&&u[a+5]==="M"&&u[a+6]==="E"&&u[a+7]==="N"&&u[a+8]==="T"}function s(u,a){return u[a+1]==="!"&&u[a+2]==="A"&&u[a+3]==="T"&&u[a+4]==="T"&&u[a+5]==="L"&&u[a+6]==="I"&&u[a+7]==="S"&&u[a+8]==="T"}function l(u,a){return u[a+1]==="!"&&u[a+2]==="N"&&u[a+3]==="O"&&u[a+4]==="T"&&u[a+5]==="A"&&u[a+6]==="T"&&u[a+7]==="I"&&u[a+8]==="O"&&u[a+9]==="N"}function c(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return of=t,of}var sf,My;function sI(){if(My)return sf;My=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function n(s,l={}){if(l=Object.assign({},r,l),!s||typeof s!="string")return s;if(s==="0")return 0;let c=s.trim();if(l.skipLike!==void 0&&l.skipLike.test(c))return s;if(l.hex&&e.test(c))return i(c,16);if(c.search(/[eE]/)!==-1){const u=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(l.leadingZeros)c=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return l.eNotation?Number(c):s}else return s}else{const u=t.exec(c);if(u){const a=u[1],f=u[2];let d=o(u[3]);if(!l.leadingZeros&&f.length>0&&a&&c[2]!==".")return s;if(!l.leadingZeros&&f.length>0&&!a&&c[1]!==".")return s;if(l.leadingZeros&&f===s)return 0;{const b=Number(c),E=""+b;return E.search(/[eE]/)!==-1?l.eNotation?b:s:c.indexOf(".")!==-1?E==="0"&&d===""||E===d||a&&E==="-"+d?b:s:f?d===E||a+d===E?b:s:c===E||c===a+E?b:s}}else return s}}function o(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 i(s,l){if(parseInt)return parseInt(s,l);if(Number.parseInt)return Number.parseInt(s,l);if(window&&window.parseInt)return window.parseInt(s,l);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}return sf=n,sf}var af,jy;function Uy(){if(jy)return af;jy=1;function e(t){return typeof t=="function"?t:Array.isArray(t)?r=>{for(const n of t)if(typeof n=="string"&&r===n||n instanceof RegExp&&n.test(r))return!0}:()=>!1}return af=e,af}var lf,qy;function aI(){if(qy)return lf;qy=1;const e=rf(),t=iI(),r=oI(),n=sI(),o=Uy();class i{constructor(A){this.options=A,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:(F,C)=>String.fromCharCode(Number.parseInt(C,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(F,C)=>String.fromCharCode(Number.parseInt(C,16))}},this.addExternalEntities=s,this.parseXml=f,this.parseTextData=l,this.resolveNameSpace=c,this.buildAttributesMap=a,this.isItStopNode=w,this.replaceEntitiesValue=b,this.readStopNodeData=g,this.saveTextToParentTag=E,this.addChild=d,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(T){const A=Object.keys(T);for(let F=0;F<A.length;F++){const C=A[F];this.lastEntities[C]={regex:new RegExp("&"+C+";","g"),val:T[C]}}}function l(T,A,F,C,I,L,B){if(T!==void 0&&(this.options.trimValues&&!C&&(T=T.trim()),T.length>0)){B||(T=this.replaceEntitiesValue(T));const $=this.options.tagValueProcessor(A,T,F,I,L);return $==null?T:typeof $!=typeof T||$!==T?$:this.options.trimValues?v(T,this.options.parseTagValue,this.options.numberParseOptions):T.trim()===T?v(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function c(T){if(this.options.removeNSPrefix){const A=T.split(":"),F=T.charAt(0)==="/"?"/":"";if(A[0]==="xmlns")return"";A.length===2&&(T=F+A[1])}return T}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function a(T,A,F){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const C=e.getAllMatches(T,u),I=C.length,L={};for(let B=0;B<I;B++){const $=this.resolveNameSpace(C[B][1]);if(this.ignoreAttributesFn($,A))continue;let D=C[B][4],H=this.options.attributeNamePrefix+$;if($.length)if(this.options.transformAttributeName&&(H=this.options.transformAttributeName(H)),H==="__proto__"&&(H="#__proto__"),D!==void 0){this.options.trimValues&&(D=D.trim()),D=this.replaceEntitiesValue(D);const ee=this.options.attributeValueProcessor($,D,A);ee==null?L[H]=D:typeof ee!=typeof D||ee!==D?L[H]=ee:L[H]=v(D,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(L[H]=!0)}if(!Object.keys(L).length)return;if(this.options.attributesGroupName){const B={};return B[this.options.attributesGroupName]=L,B}return L}}const f=function(T){T=T.replace(/\r\n?/g,`
52
- `);const A=new t("!xml");let F=A,C="",I="";for(let L=0;L<T.length;L++)if(T[L]==="<")if(T[L+1]==="/"){const $=S(T,">",L,"Closing Tag is not closed.");let D=T.substring(L+2,$).trim();if(this.options.removeNSPrefix){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),F&&(C=this.saveTextToParentTag(C,F,I));const H=I.substring(I.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let ee=0;H&&this.options.unpairedTags.indexOf(H)!==-1?(ee=I.lastIndexOf(".",I.lastIndexOf(".")-1),this.tagsNodeStack.pop()):ee=I.lastIndexOf("."),I=I.substring(0,ee),F=this.tagsNodeStack.pop(),C="",L=$}else if(T[L+1]==="?"){let $=m(T,L,!1,"?>");if(!$)throw new Error("Pi Tag is not closed.");if(C=this.saveTextToParentTag(C,F,I),!(this.options.ignoreDeclaration&&$.tagName==="?xml"||this.options.ignorePiTags)){const D=new t($.tagName);D.add(this.options.textNodeName,""),$.tagName!==$.tagExp&&$.attrExpPresent&&(D[":@"]=this.buildAttributesMap($.tagExp,I,$.tagName)),this.addChild(F,D,I)}L=$.closeIndex+1}else if(T.substr(L+1,3)==="!--"){const $=S(T,"-->",L+4,"Comment is not closed.");if(this.options.commentPropName){const D=T.substring(L+4,$-2);C=this.saveTextToParentTag(C,F,I),F.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}L=$}else if(T.substr(L+1,2)==="!D"){const $=r(T,L);this.docTypeEntities=$.entities,L=$.i}else if(T.substr(L+1,2)==="!["){const $=S(T,"]]>",L,"CDATA is not closed.")-2,D=T.substring(L+9,$);C=this.saveTextToParentTag(C,F,I);let H=this.parseTextData(D,F.tagname,I,!0,!1,!0,!0);H==null&&(H=""),this.options.cdataPropName?F.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):F.add(this.options.textNodeName,H),L=$+2}else{let $=m(T,L,this.options.removeNSPrefix),D=$.tagName;const H=$.rawTagName;let ee=$.tagExp,J=$.attrExpPresent,ce=$.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),F&&C&&F.tagname!=="!xml"&&(C=this.saveTextToParentTag(C,F,I,!1));const be=F;if(be&&this.options.unpairedTags.indexOf(be.tagname)!==-1&&(F=this.tagsNodeStack.pop(),I=I.substring(0,I.lastIndexOf("."))),D!==A.tagname&&(I+=I?"."+D:D),this.isItStopNode(this.options.stopNodes,I,D)){let de="";if(ee.length>0&&ee.lastIndexOf("/")===ee.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),I=I.substr(0,I.length-1),ee=D):ee=ee.substr(0,ee.length-1),L=$.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)L=$.closeIndex;else{const Ae=this.readStopNodeData(T,H,ce+1);if(!Ae)throw new Error(`Unexpected end of ${H}`);L=Ae.i,de=Ae.tagContent}const Se=new t(D);D!==ee&&J&&(Se[":@"]=this.buildAttributesMap(ee,I,D)),de&&(de=this.parseTextData(de,D,I,!0,J,!0,!0)),I=I.substr(0,I.lastIndexOf(".")),Se.add(this.options.textNodeName,de),this.addChild(F,Se,I)}else{if(ee.length>0&&ee.lastIndexOf("/")===ee.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),I=I.substr(0,I.length-1),ee=D):ee=ee.substr(0,ee.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const de=new t(D);D!==ee&&J&&(de[":@"]=this.buildAttributesMap(ee,I,D)),this.addChild(F,de,I),I=I.substr(0,I.lastIndexOf("."))}else{const de=new t(D);this.tagsNodeStack.push(F),D!==ee&&J&&(de[":@"]=this.buildAttributesMap(ee,I,D)),this.addChild(F,de,I),F=de}C="",L=ce}}else C+=T[L];return A.child};function d(T,A,F){const C=this.options.updateTag(A.tagname,F,A[":@"]);C===!1||(typeof C=="string"&&(A.tagname=C),T.addChild(A))}const b=function(T){if(this.options.processEntities){for(let A in this.docTypeEntities){const F=this.docTypeEntities[A];T=T.replace(F.regx,F.val)}for(let A in this.lastEntities){const F=this.lastEntities[A];T=T.replace(F.regex,F.val)}if(this.options.htmlEntities)for(let A in this.htmlEntities){const F=this.htmlEntities[A];T=T.replace(F.regex,F.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function E(T,A,F,C){return T&&(C===void 0&&(C=A.child.length===0),T=this.parseTextData(T,A.tagname,F,!1,A[":@"]?Object.keys(A[":@"]).length!==0:!1,C),T!==void 0&&T!==""&&A.add(this.options.textNodeName,T),T=""),T}function w(T,A,F){const C="*."+F;for(const I in T){const L=T[I];if(C===L||A===L)return!0}return!1}function R(T,A,F=">"){let C,I="";for(let L=A;L<T.length;L++){let B=T[L];if(C)B===C&&(C="");else if(B==='"'||B==="'")C=B;else if(B===F[0])if(F[1]){if(T[L+1]===F[1])return{data:I,index:L}}else return{data:I,index:L};else B===" "&&(B=" ");I+=B}}function S(T,A,F,C){const I=T.indexOf(A,F);if(I===-1)throw new Error(C);return I+A.length-1}function m(T,A,F,C=">"){const I=R(T,A+1,C);if(!I)return;let L=I.data;const B=I.index,$=L.search(/\s/);let D=L,H=!0;$!==-1&&(D=L.substring(0,$),L=L.substring($+1).trimStart());const ee=D;if(F){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1),H=D!==I.data.substr(J+1))}return{tagName:D,tagExp:L,closeIndex:B,attrExpPresent:H,rawTagName:ee}}function g(T,A,F){const C=F;let I=1;for(;F<T.length;F++)if(T[F]==="<")if(T[F+1]==="/"){const L=S(T,">",F,`${A} is not closed`);if(T.substring(F+2,L).trim()===A&&(I--,I===0))return{tagContent:T.substring(C,F),i:L};F=L}else if(T[F+1]==="?")F=S(T,"?>",F+1,"StopNode is not closed.");else if(T.substr(F+1,3)==="!--")F=S(T,"-->",F+3,"StopNode is not closed.");else if(T.substr(F+1,2)==="![")F=S(T,"]]>",F,"StopNode is not closed.")-2;else{const L=m(T,F,">");L&&((L&&L.tagName)===A&&L.tagExp[L.tagExp.length-1]!=="/"&&I++,F=L.closeIndex)}}function v(T,A,F){if(A&&typeof T=="string"){const C=T.trim();return C==="true"?!0:C==="false"?!1:n(T,F)}else return e.isExist(T)?T:""}return lf=i,lf}var cf={},Vy;function lI(){if(Vy)return cf;Vy=1;function e(i,s){return t(i,s)}function t(i,s,l){let c;const u={};for(let a=0;a<i.length;a++){const f=i[a],d=r(f);let b="";if(l===void 0?b=d:b=l+"."+d,d===s.textNodeName)c===void 0?c=f[d]:c+=""+f[d];else{if(d===void 0)continue;if(f[d]){let E=t(f[d],s,b);const w=o(E,s);f[":@"]?n(E,f[":@"],b,s):Object.keys(E).length===1&&E[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?E=E[s.textNodeName]:Object.keys(E).length===0&&(s.alwaysCreateTextNode?E[s.textNodeName]="":E=""),u[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(E)):s.isArray(d,b,w)?u[d]=[E]:u[d]=E}}}return typeof c=="string"?c.length>0&&(u[s.textNodeName]=c):c!==void 0&&(u[s.textNodeName]=c),u}function r(i){const s=Object.keys(i);for(let l=0;l<s.length;l++){const c=s[l];if(c!==":@")return c}}function n(i,s,l,c){if(s){const u=Object.keys(s),a=u.length;for(let f=0;f<a;f++){const d=u[f];c.isArray(d,l+"."+d,!0,!0)?i[d]=[s[d]]:i[d]=s[d]}}}function o(i,s){const{textNodeName:l}=s,c=Object.keys(i).length;return!!(c===0||c===1&&(i[l]||typeof i[l]=="boolean"||i[l]===0))}return cf.prettify=e,cf}var uf,zy;function cI(){if(zy)return uf;zy=1;const{buildOptions:e}=nI(),t=aI(),{prettify:r}=lI(),n=$y();class o{constructor(s){this.externalEntities={},this.options=e(s)}parse(s,l){if(typeof s!="string")if(s.toString)s=s.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(l){l===!0&&(l={});const a=n.validate(s,l);if(a!==!0)throw Error(`${a.err.msg}:${a.err.line}:${a.err.col}`)}const c=new t(this.options);c.addExternalEntities(this.externalEntities);const u=c.parseXml(s);return this.options.preserveOrder||u===void 0?u:r(u,this.options)}addEntity(s,l){if(l.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(l==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[s]=l}}return uf=o,uf}var ff,Wy;function uI(){if(Wy)return ff;Wy=1;const e=`
53
- `;function t(l,c){let u="";return c.format&&c.indentBy.length>0&&(u=e),r(l,c,"",u)}function r(l,c,u,a){let f="",d=!1;for(let b=0;b<l.length;b++){const E=l[b],w=n(E);if(w===void 0)continue;let R="";if(u.length===0?R=w:R=`${u}.${w}`,w===c.textNodeName){let T=E[w];i(R,c)||(T=c.tagValueProcessor(w,T),T=s(T,c)),d&&(f+=a),f+=T,d=!1;continue}else if(w===c.cdataPropName){d&&(f+=a),f+=`<![CDATA[${E[w][0][c.textNodeName]}]]>`,d=!1;continue}else if(w===c.commentPropName){f+=a+`<!--${E[w][0][c.textNodeName]}-->`,d=!0;continue}else if(w[0]==="?"){const T=o(E[":@"],c),A=w==="?xml"?"":a;let F=E[w][0][c.textNodeName];F=F.length!==0?" "+F:"",f+=A+`<${w}${F}${T}?>`,d=!0;continue}let S=a;S!==""&&(S+=c.indentBy);const m=o(E[":@"],c),g=a+`<${w}${m}`,v=r(E[w],c,R,S);c.unpairedTags.indexOf(w)!==-1?c.suppressUnpairedNode?f+=g+">":f+=g+"/>":(!v||v.length===0)&&c.suppressEmptyNode?f+=g+"/>":v&&v.endsWith(">")?f+=g+`>${v}${a}</${w}>`:(f+=g+">",v&&a!==""&&(v.includes("/>")||v.includes("</"))?f+=a+c.indentBy+v+a:f+=v,f+=`</${w}>`),d=!0}return f}function n(l){const c=Object.keys(l);for(let u=0;u<c.length;u++){const a=c[u];if(l.hasOwnProperty(a)&&a!==":@")return a}}function o(l,c){let u="";if(l&&!c.ignoreAttributes)for(let a in l){if(!l.hasOwnProperty(a))continue;let f=c.attributeValueProcessor(a,l[a]);f=s(f,c),f===!0&&c.suppressBooleanAttributes?u+=` ${a.substr(c.attributeNamePrefix.length)}`:u+=` ${a.substr(c.attributeNamePrefix.length)}="${f}"`}return u}function i(l,c){l=l.substr(0,l.length-c.textNodeName.length-1);let u=l.substr(l.lastIndexOf(".")+1);for(let a in c.stopNodes)if(c.stopNodes[a]===l||c.stopNodes[a]==="*."+u)return!0;return!1}function s(l,c){if(l&&l.length>0&&c.processEntities)for(let u=0;u<c.entities.length;u++){const a=c.entities[u];l=l.replace(a.regex,a.val)}return l}return ff=t,ff}var df,Hy;function fI(){if(Hy)return df;Hy=1;const e=uI(),t=Uy(),r={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(l,c){return c},attributeValueProcessor:function(l,c){return c},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 n(l){this.options=Object.assign({},r,l),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=s),this.processTextOrObjNode=o,this.options.format?(this.indentate=i,this.tagEndChar=`>
49
+ >>> no match, partial?`,t,d,r,b),d!==c))}let S;if(typeof a=="string"?(S=f===a,this.debug("string match",a,f,S)):(S=a.test(f),this.debug("pattern match",a,f,S)),!S)return!1}if(s===c&&l===u)return!0;if(s===c)return n;if(l===u)return s===c-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return by(this.pattern,this.options)}parse(t){$s(t);const r=this.options;if(t==="**")return Lr;if(t==="")return"";let n,o=null;(n=t.match(m_))?o=r.dot?b_:y_:(n=t.match(s_))?o=(r.nocase?r.dot?u_:c_:r.dot?l_:a_)(n[1]):(n=t.match(v_))?o=(r.nocase?r.dot?S_:w_:r.dot?E_:T_)(n):(n=t.match(f_))?o=r.dot?p_:d_:(n=t.match(h_))&&(o=g_);const i=Ds.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const r=this.options,n=r.noglobstar?"[^/]*?":r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=new Set(r.nocase?["i"]:[]);let i=t.map(c=>{const u=c.map(a=>{if(a instanceof RegExp)for(const f of a.flags.split(""))o.add(f);return typeof a=="string"?a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):a===Lr?Lr:a._src});return u.forEach((a,f)=>{const d=u[f+1],b=u[f-1];a===Lr&&b!==Lr&&(b===void 0?d!==void 0&&d!==Lr?u[f+1]="(?:\\/|"+n+"\\/)?"+d:u[f]=n:d===void 0?u[f-1]=b+"(?:\\/|"+n+")?":d!==Lr&&(u[f-1]=b+"(?:\\/|\\/"+n+"\\/)"+d,u[f+1]=Lr))}),u.filter(a=>a!==Lr).join("/")}).join("|");const[s,l]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+l+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...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 r=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==="/"&&r)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const i=this.set;this.debug(this.pattern,"set",i);let s=o[o.length-1];if(!s)for(let l=o.length-2;!s&&l>=0;l--)s=o[l];for(let l=0;l<i.length;l++){const c=i[l];let u=o;if(n.matchBase&&c.length===1&&(u=[s]),this.matchOne(u,c,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return or.defaults(t).Minimatch}}function zu(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 Ht(e,t){const{status:r}=t;if(r===401&&e.digest)return t;if(r>=400)throw zu(t);return t}function ei(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?QR(e.headers):{},status:e.status,statusText:e.statusText}:t}or.AST=Ds,or.Minimatch=Ls,or.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},or.unescape=wo;const A_=(wy=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"COPY",headers:{Destination:Ct(e.remoteURL,It(r)),Overwrite:n.overwrite===!1?"F":"T",Depth:n.shallow?"0":"infinity"}},e,n);return s=function(l){Ht(e,l)},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(wy.apply(this,e))}catch(r){return Promise.reject(r)}});var wy,Wu=dt(635),R_=dt(829),vn=dt.n(R_),ki=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(ki||{});function Bs(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ki.Original;const n=vn().get(e,t);return r==="array"&&Array.isArray(n)===!1?[n]:r==="object"&&Array.isArray(n)?n[0]:n}function So(e){return new Promise(t=>{t(function(r){const{multistatus:n}=r;if(n==="")return{multistatus:{response:[]}};if(!n)throw new Error("Invalid response: No root multistatus found");const o={multistatus:Array.isArray(n)?n[0]:n};return vn().set(o,"multistatus.response",Bs(o,"multistatus.response",ki.Array)),vn().set(o,"multistatus.response",vn().get(o,"multistatus.response").map(i=>function(s){const l=Object.assign({},s);return l.status?vn().set(l,"status",Bs(l,"status",ki.Object)):(vn().set(l,"propstat",Bs(l,"propstat",ki.Object)),vn().set(l,"propstat.prop",Bs(l,"propstat.prop",ki.Object))),l}(i))),o}(new Wu.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(r,n,o)=>n==="true"||n==="false"?n==="true":n,tagValueProcessor(r,n,o){if(!o.endsWith("propstat.prop.displayname"))return n}}).parse(e)))})}function Ms(e,t){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:n=null,getcontentlength:o="0",resourcetype:i=null,getcontenttype:s=null,getetag:l=null}=e,c=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",u={filename:t,basename:xs().basename(t),lastmod:n,size:parseInt(o,10),type:c,etag:typeof l=="string"?l.replace(/"/g,""):null};return c==="file"&&(u.mime=s&&typeof s=="string"?s.split(";")[0]:""),r&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),u.props=e),u}function Sy(e,t){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=null;try{e.multistatus.response[0].propstat&&(n=e.multistatus.response[0])}catch{}if(!n)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:o,status:i}}=n,[s,l,c]=i.split(" ",3),u=parseInt(l,10);if(u>=400){const a=new Error(`Invalid response: ${u} ${c}`);throw a.status=u,a}return Ms(o,yo(t),r)}function Ey(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Hu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Gu=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:n=!1}=r,o=Wt({url:Ct(e.remoteURL,It(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,r);return Hu(zt(o,e),function(i){return Ht(e,i),Hu(i.text(),function(s){return Hu(So(s),function(l){const c=Sy(l,t,n);return ei(i,c,n)})})})});function Ty(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const __=Ay(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=function(i){if(!i||i==="/")return[];let s=i;const l=[];do l.push(s),s=xs().dirname(s);while(s&&s!=="/");return l}(yo(t));n.sort((i,s)=>i.length>s.length?1:s.length>i.length?-1:0);let o=!1;return function(i,s,l){if(typeof i[_y]=="function"){let S=function(T){try{for(;!(c=f.next()).done;)if((T=s(c.value))&&T.then){if(!Iy(T))return void T.then(S,a||(a=gr.bind(null,u=new Ni,2)));T=T.v}u?gr(u,1,T):u=T}catch(w){gr(u||(u=new Ni),2,w)}};var c,u,a,f=i[_y]();if(S(),f.return){var d=function(T){try{c.done||f.return()}catch{}return T};if(u&&u.then)return u.then(d,function(T){throw d(T)});d()}return u}if(!("length"in i))throw new TypeError("Object is not iterable");for(var b=[],E=0;E<i.length;E++)b.push(i[E]);return function(S,T,w){var y,g,v=-1;return function A(R){try{for(;++v<S.length&&(!w||!w());)if((R=T(v))&&R.then){if(!Iy(R))return void R.then(A,g||(g=gr.bind(null,y=new Ni,2)));R=R.v}y?gr(y,1,R):y=R}catch(C){gr(y||(y=new Ni),2,C)}}(),y}(b,function(S){return s(b[S])},l)}(n,function(i){return s=function(){return function(c,u){try{var a=Ty(Gu(e,i),function(f){if(f.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(f){return u(f)}return a&&a.then?a.then(void 0,u):a}(0,function(c){const u=c;return function(){if(u.status===404)return o=!0,Ry(Ku(e,i,{...r,recursive:!1}));throw c}()})},(l=function(){if(o)return Ry(Ku(e,i,{...r,recursive:!1}))}())&&l.then?l.then(s):s();var s,l},function(){return!1})});function Ay(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function I_(){}function Ry(e,t){return e&&e.then?e.then(I_):Promise.resolve()}const _y=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function gr(e,t,r){if(!e.s){if(r instanceof Ni){if(!r.s)return void(r.o=gr.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(gr.bind(null,e,t),gr.bind(null,e,2));e.s=t,e.v=r;const n=e.o;n&&n(e)}}const Ni=function(){function e(){}return e.prototype.then=function(t,r){const n=new e,o=this.s;if(o){const i=1&o?t:r;if(i){try{gr(n,1,i(this.v))}catch(s){gr(n,2,s)}return n}return this}return this.o=function(i){try{const s=i.v;1&i.s?gr(n,1,t?t(s):s):r?gr(n,1,r(s)):gr(n,2,s)}catch(s){gr(n,2,s)}},n},e}();function Iy(e){return e instanceof Ni&&1&e.s}const Ku=Ay(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(r.recursive===!0)return __(e,t,r);const n=Wt({url:Ct(e.remoteURL,(o=It(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,r);var o;return Ty(zt(n,e),function(i){Ht(e,i)})});var C_=dt(388),Cy=dt.n(C_);const F_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n={};if(typeof r.range=="object"&&typeof r.range.start=="number"){let l=`bytes=${r.range.start}-`;typeof r.range.end=="number"&&(l=`${l}${r.range.end}`),n.Range=l}const o=Wt({url:Ct(e.remoteURL,It(t)),method:"GET",headers:n},e,r);return s=function(l){if(Ht(e,l),n.Range&&l.status!==206){const c=new Error(`Invalid response code for partial request: ${l.status}`);throw c.status=l.status,c}return r.callback&&setTimeout(()=>{r.callback(l)},0),l.body},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),P_=()=>{},x_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){r.url||(r.url=Ct(e.remoteURL,It(t)));const n=Wt(r,e,{});return i=function(s){return Ht(e,s),s},(o=zt(n,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),O_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:Ct(e.remoteURL,It(t)),method:"DELETE"},e,r);return i=function(s){Ht(e,s)},(o=zt(n,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),k_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(n,o){try{var i=(s=Gu(e,t,r),l=function(){return!0},c?l?l(s):s:(s&&s.then||(s=Promise.resolve(s)),l?s.then(l):s))}catch(u){return o(u)}var s,l,c;return i&&i.then?i.then(void 0,o):i}(0,function(n){if(n.status===404)return!1;throw n})});function Qu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const N_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:Ct(e.remoteURL,It(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:r.deep?"infinity":"1"}},e,r);return Qu(zt(n,e),function(o){return Ht(e,o),Qu(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Qu(So(i),function(s){const l=Ym(t);let c=function(u,a,f){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],b=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const E=xs().join(a,"/"),{multistatus:{response:S}}=u,T=S.map(w=>{const y=function(v){try{return v.replace(/^https?:\/\/[^\/]+/,"")}catch(A){throw new pr(A,"Failed normalising HREF")}}(w.href),{propstat:{prop:g}}=w;return Ms(g,E==="/"?decodeURIComponent(yo(y)):yo(xs().relative(decodeURIComponent(E),decodeURIComponent(y))),d)});return b?T:T.filter(w=>w.basename&&(w.type==="file"||w.filename!==f.replace(/\/$/,"")))}(s,Ym(e.remoteBasePath||e.remotePath),l,r.details,r.includeSelf);return r.glob&&(c=function(u,a){return u.filter(f=>or(f.filename,a,{matchBase:!0}))}(c,r.glob)),ei(o,c,r.details)})})})});function Xu(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const $_=Xu(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:Ct(e.remoteURL,It(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[B_]},e,r);return js(zt(n,e),function(o){return Ht(e,o),js(o.text(),function(i){return ei(o,i,r.details)})})});function js(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const D_=Xu(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:Ct(e.remoteURL,It(t)),method:"GET"},e,r);return js(zt(n,e),function(o){let i;return Ht(e,o),function(s,l){var c=s();return c&&c.then?c.then(l):l()}(function(){return js(o.arrayBuffer(),function(s){i=s})},function(){return ei(o,i,r.details)})})}),L_=Xu(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:n="binary"}=r;if(n!=="binary"&&n!=="text")throw new pr({info:{code:bn.InvalidOutputFormat}},`Invalid output format: ${n}`);return n==="text"?$_(e,t,r):D_(e,t,r)}),B_=e=>e;function M_(e){return new Wu.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Fy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Fy(e,t){const r={...e};for(const n in r)r.hasOwnProperty(n)&&(r[n]&&typeof r[n]=="object"&&n.indexOf(":")===-1?(r[`${t}:${n}`]=Fy(r[n],t),delete r[n]):/^@_/.test(n)===!1&&(r[`${t}:${n}`]=r[n],delete r[n]));return r}function Yu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Py(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const j_=Py(function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"UNLOCK",headers:{"Lock-Token":r}},e,n);return Yu(zt(o,e),function(i){if(Ht(e,i),i.status!==204&&i.status!==200)throw zu(i)})}),U_=Py(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:n,timeout:o=q_}=r,i={Accept:"text/plain,application/xml",Timeout:o};n&&(i.If=n);const s=Wt({url:Ct(e.remoteURL,It(t)),method:"LOCK",headers:i,data:M_(e.contactHref)},e,r);return Yu(zt(s,e),function(l){return Ht(e,l),Yu(l.text(),function(c){const u=(d=c,new Wu.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),a=vn().get(u,"prop.lockdiscovery.activelock.locktoken.href"),f=vn().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!a)throw zu(l,"No lock token received: ");return{token:a,serverTimeout:f}})})}),q_="Infinite, Second-4100000000";function Ju(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const V_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.path||"/",n=Wt({url:Ct(e.remoteURL,r),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Ju(zt(n,e),function(o){return Ht(e,o),Ju(o.text(),function(i){return Ju(So(i),function(s){const l=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":a,"quota-available-bytes":f}}}=u;return a!==void 0&&f!==void 0?{used:parseInt(String(a),10),available:Ey(f)}:null}catch{}return null}(s);return ei(o,l,t.details)})})})});function Zu(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const z_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:n=!1}=r,o=Wt({url:Ct(e.remoteURL,It(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,r);return Zu(zt(o,e),function(i){return Ht(e,i),Zu(i.text(),function(s){return Zu(So(s),function(l){const c=function(u,a,f){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some(b=>{var E,S;return((S=(b.status||((E=b.propstat)==null?void 0:E.status)).split(" ",3))==null?void 0:S[1])==="507"&&b.href.replace(/\/$/,"").endsWith(It(a).replace(/\/$/,""))}),u.multistatus.response.forEach(b=>{if(b.propstat===void 0)return;const E=b.href.split("/").map(decodeURIComponent).join("/");d.results.push(Ms(b.propstat.prop,E,f))}),d}(l,t,n);return ei(i,c,n)})})})}),W_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Wt({url:Ct(e.remoteURL,It(t)),method:"MOVE",headers:{Destination:Ct(e.remoteURL,It(r)),Overwrite:n.overwrite===!1?"F":"T"}},e,n);return s=function(l){Ht(e,l)},(i=zt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var H_=dt(172);const G_=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:o=!0,overwrite:i=!0}=n,s={"Content-Type":"application/octet-stream"};o===!1||(s["Content-Length"]=typeof o=="number"?`${o}`:`${function(a){if(ly(a))return a.byteLength;if(cy(a))return a.length;if(typeof a=="string")return(0,H_.d)(a);throw new pr({info:{code:bn.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(r)}`),i||(s["If-None-Match"]="*");const l=Wt({url:Ct(e.remoteURL,It(t)),method:"PUT",headers:s,data:r},e,n);return u=function(a){try{Ht(e,a)}catch(f){const d=f;if(d.status!==412||i)throw d;return!1}return!0},(c=zt(l,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),xy=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=Wt({url:Ct(e.remoteURL,It(t)),method:"OPTIONS"},e,r);return i=function(s){try{Ht(e,s)}catch(l){throw l}return{compliance:(s.headers.get("DAV")??"").split(",").map(l=>l.trim()),server:s.headers.get("Server")??""}},(o=zt(n,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function Eo(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const K_=ef(function(e,t,r,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new pr({info:{code:bn.InvalidUpdateRange}},`Invalid update range ${r} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(n-r+1),"Content-Range":`bytes ${r}-${n}/*`},l=Wt({url:Ct(e.remoteURL,It(t)),method:"PUT",headers:s,data:o},e,i);return Eo(zt(l,e),function(c){Ht(e,c)})});function Oy(e,t){var r=e();return r&&r.then?r.then(t):t(r)}const Q_=ef(function(e,t,r,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new pr({info:{code:bn.InvalidUpdateRange}},`Invalid update range ${r} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(n-r+1),"X-Update-Range":`bytes=${r}-${n}`},l=Wt({url:Ct(e.remoteURL,It(t)),method:"PATCH",headers:s,data:o},e,i);return Eo(zt(l,e),function(c){Ht(e,c)})});function ef(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}const X_=ef(function(e,t,r,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Eo(xy(e,t,i),function(s){let l=!1;return Oy(function(){if(s.compliance.includes("sabredav-partialupdate"))return Eo(Q_(e,t,r,n,o,i),function(c){return l=!0,c})},function(c){let u=!1;return l?c:Oy(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Eo(K_(e,t,r,n,o,i),function(a){return u=!0,a})},function(a){if(u)return a;throw new pr({info:{code:bn.NotSupported}},"Not supported")})})})}),Y_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function J_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:r=null,remoteBasePath:n,contactHref:o=Y_,ha1:i,headers:s={},httpAgent:l,httpsAgent:c,password:u,token:a,username:f,withCredentials:d}=t;let b=r;b||(b=f||u?hr.Password:hr.None);const E={authType:b,remoteBasePath:n,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:l,httpsAgent:c,password:u,remotePath:jR(e),remoteURL:e,token:a,username:f,withCredentials:d};return ny(E,f,u,a,i),{copyFile:(S,T,w)=>A_(E,S,T,w),createDirectory:(S,T)=>Ku(E,S,T),createReadStream:(S,T)=>function(w,y){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const v=new(Cy()).PassThrough;return F_(w,y,g).then(A=>{A.pipe(v)}).catch(A=>{v.emit("error",A)}),v}(E,S,T),createWriteStream:(S,T,w)=>function(y,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:P_;const R=new(Cy()).PassThrough,C={};v.overwrite===!1&&(C["If-None-Match"]="*");const P=Wt({url:Ct(y.remoteURL,It(g)),method:"PUT",headers:C,data:R,maxRedirects:0},y,v);return zt(P,y).then(_=>Ht(y,_)).then(_=>{setTimeout(()=>{A(_)},0)}).catch(_=>{R.emit("error",_)}),R}(E,S,T,w),customRequest:(S,T)=>x_(E,S,T),deleteFile:(S,T)=>O_(E,S,T),exists:(S,T)=>k_(E,S,T),getDirectoryContents:(S,T)=>N_(E,S,T),getFileContents:(S,T)=>L_(E,S,T),getFileDownloadLink:S=>function(T,w){let y=Ct(T.remoteURL,It(w));const g=/^https:/i.test(y)?"https":"http";switch(T.authType){case hr.None:break;case hr.Password:{const v=ty(T.headers.Authorization.replace(/^Basic /i,"").trim());y=y.replace(/^https?:\/\//,`${g}://${v}@`);break}default:throw new pr({info:{code:bn.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return y}(E,S),getFileUploadLink:S=>function(T,w){let y=`${Ct(T.remoteURL,It(w))}?Content-Type=application/octet-stream`;const g=/^https:/i.test(y)?"https":"http";switch(T.authType){case hr.None:break;case hr.Password:{const v=ty(T.headers.Authorization.replace(/^Basic /i,"").trim());y=y.replace(/^https?:\/\//,`${g}://${v}@`);break}default:throw new pr({info:{code:bn.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return y}(E,S),getHeaders:()=>Object.assign({},E.headers),getQuota:S=>V_(E,S),lock:(S,T)=>U_(E,S,T),moveFile:(S,T,w)=>W_(E,S,T,w),putFileContents:(S,T,w)=>G_(E,S,T,w),partialUpdateFileContents:(S,T,w,y,g)=>X_(E,S,T,w,y,g),getDAVCompliance:S=>xy(E,S),search:(S,T)=>z_(E,S,T),setHeaders:S=>{E.headers=Object.assign({},S)},stat:(S,T)=>Gu(E,S,T),unlock:(S,T,w)=>j_(E,S,T,w)}}Dr.hT,Dr.O4,Dr.Kd,Dr.YK,Dr.UU,Dr.Gu,Dr.ky,Dr.h4,Dr.ch,Dr.hq,Dr.i5;var tf={},rf={},ky;function nf(){return ky||(ky=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",r=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",n="["+t+"]["+r+"]*",o=new RegExp("^"+n+"$"),i=function(l,c){const u=[];let a=c.exec(l);for(;a;){const f=[];f.startIndex=c.lastIndex-a[0].length;const d=a.length;for(let b=0;b<d;b++)f.push(a[b]);u.push(f),a=c.exec(l)}return u},s=function(l){const c=o.exec(l);return!(c===null||typeof c>"u")};e.isExist=function(l){return typeof l<"u"},e.isEmptyObject=function(l){return Object.keys(l).length===0},e.merge=function(l,c,u){if(c){const a=Object.keys(c),f=a.length;for(let d=0;d<f;d++)u==="strict"?l[a[d]]=[c[a[d]]]:l[a[d]]=c[a[d]]}},e.getValue=function(l){return e.isExist(l)?l:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=n}(rf)),rf}var Ny;function $y(){if(Ny)return tf;Ny=1;const e=nf(),t={allowBooleanAttributes:!1,unpairedTags:[]};tf.validate=function(w,y){y=Object.assign({},t,y);const g=[];let v=!1,A=!1;w[0]==="\uFEFF"&&(w=w.substr(1));for(let R=0;R<w.length;R++)if(w[R]==="<"&&w[R+1]==="?"){if(R+=2,R=n(w,R),R.err)return R}else if(w[R]==="<"){let C=R;if(R++,w[R]==="!"){R=o(w,R);continue}else{let P=!1;w[R]==="/"&&(P=!0,R++);let _="";for(;R<w.length&&w[R]!==">"&&w[R]!==" "&&w[R]!==" "&&w[R]!==`
50
+ `&&w[R]!=="\r";R++)_+=w[R];if(_=_.trim(),_[_.length-1]==="/"&&(_=_.substring(0,_.length-1),R--),!E(_)){let $;return _.trim().length===0?$="Invalid space after '<'.":$="Tag '"+_+"' is an invalid name.",d("InvalidTag",$,S(w,R))}const L=l(w,R);if(L===!1)return d("InvalidAttr","Attributes for '"+_+"' have open quote.",S(w,R));let B=L.value;if(R=L.index,B[B.length-1]==="/"){const $=R-B.length;B=B.substring(0,B.length-1);const D=u(B,y);if(D===!0)v=!0;else return d(D.err.code,D.err.msg,S(w,$+D.err.line))}else if(P)if(L.tagClosed){if(B.trim().length>0)return d("InvalidTag","Closing tag '"+_+"' can't have attributes or invalid starting.",S(w,C));if(g.length===0)return d("InvalidTag","Closing tag '"+_+"' has not been opened.",S(w,C));{const $=g.pop();if(_!==$.tagName){let D=S(w,$.tagStartPos);return d("InvalidTag","Expected closing tag '"+$.tagName+"' (opened in line "+D.line+", col "+D.col+") instead of closing tag '"+_+"'.",S(w,C))}g.length==0&&(A=!0)}}else return d("InvalidTag","Closing tag '"+_+"' doesn't have proper closing.",S(w,R));else{const $=u(B,y);if($!==!0)return d($.err.code,$.err.msg,S(w,R-B.length+$.err.line));if(A===!0)return d("InvalidXml","Multiple possible root nodes found.",S(w,R));y.unpairedTags.indexOf(_)!==-1||g.push({tagName:_,tagStartPos:C}),v=!0}for(R++;R<w.length;R++)if(w[R]==="<")if(w[R+1]==="!"){R++,R=o(w,R);continue}else if(w[R+1]==="?"){if(R=n(w,++R),R.err)return R}else break;else if(w[R]==="&"){const $=f(w,R);if($==-1)return d("InvalidChar","char '&' is not expected.",S(w,R));R=$}else if(A===!0&&!r(w[R]))return d("InvalidXml","Extra text at the end",S(w,R));w[R]==="<"&&R--}}else{if(r(w[R]))continue;return d("InvalidChar","char '"+w[R]+"' is not expected.",S(w,R))}if(v){if(g.length==1)return d("InvalidTag","Unclosed tag '"+g[0].tagName+"'.",S(w,g[0].tagStartPos));if(g.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(g.map(R=>R.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function r(w){return w===" "||w===" "||w===`
51
+ `||w==="\r"}function n(w,y){const g=y;for(;y<w.length;y++)if(w[y]=="?"||w[y]==" "){const v=w.substr(g,y-g);if(y>5&&v==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",S(w,y));if(w[y]=="?"&&w[y+1]==">"){y++;break}else continue}return y}function o(w,y){if(w.length>y+5&&w[y+1]==="-"&&w[y+2]==="-"){for(y+=3;y<w.length;y++)if(w[y]==="-"&&w[y+1]==="-"&&w[y+2]===">"){y+=2;break}}else if(w.length>y+8&&w[y+1]==="D"&&w[y+2]==="O"&&w[y+3]==="C"&&w[y+4]==="T"&&w[y+5]==="Y"&&w[y+6]==="P"&&w[y+7]==="E"){let g=1;for(y+=8;y<w.length;y++)if(w[y]==="<")g++;else if(w[y]===">"&&(g--,g===0))break}else if(w.length>y+9&&w[y+1]==="["&&w[y+2]==="C"&&w[y+3]==="D"&&w[y+4]==="A"&&w[y+5]==="T"&&w[y+6]==="A"&&w[y+7]==="["){for(y+=8;y<w.length;y++)if(w[y]==="]"&&w[y+1]==="]"&&w[y+2]===">"){y+=2;break}}return y}const i='"',s="'";function l(w,y){let g="",v="",A=!1;for(;y<w.length;y++){if(w[y]===i||w[y]===s)v===""?v=w[y]:v!==w[y]||(v="");else if(w[y]===">"&&v===""){A=!0;break}g+=w[y]}return v!==""?!1:{value:g,index:y,tagClosed:A}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(w,y){const g=e.getAllMatches(w,c),v={};for(let A=0;A<g.length;A++){if(g[A][1].length===0)return d("InvalidAttr","Attribute '"+g[A][2]+"' has no space in starting.",T(g[A]));if(g[A][3]!==void 0&&g[A][4]===void 0)return d("InvalidAttr","Attribute '"+g[A][2]+"' is without value.",T(g[A]));if(g[A][3]===void 0&&!y.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+g[A][2]+"' is not allowed.",T(g[A]));const R=g[A][2];if(!b(R))return d("InvalidAttr","Attribute '"+R+"' is an invalid name.",T(g[A]));if(!v.hasOwnProperty(R))v[R]=1;else return d("InvalidAttr","Attribute '"+R+"' is repeated.",T(g[A]))}return!0}function a(w,y){let g=/\d/;for(w[y]==="x"&&(y++,g=/[\da-fA-F]/);y<w.length;y++){if(w[y]===";")return y;if(!w[y].match(g))break}return-1}function f(w,y){if(y++,w[y]===";")return-1;if(w[y]==="#")return y++,a(w,y);let g=0;for(;y<w.length;y++,g++)if(!(w[y].match(/\w/)&&g<20)){if(w[y]===";")break;return-1}return y}function d(w,y,g){return{err:{code:w,msg:y,line:g.line||g,col:g.col}}}function b(w){return e.isName(w)}function E(w){return e.isName(w)}function S(w,y){const g=w.substring(0,y).split(/\r?\n/);return{line:g.length,col:g[g.length-1].length+1}}function T(w){return w.startIndex+w[1].length}return tf}var Us={},Dy;function Z_(){if(Dy)return Us;Dy=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(r,n){return n},attributeValueProcessor:function(r,n){return n},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,n,o){return r}},t=function(r){return Object.assign({},e,r)};return Us.buildOptions=t,Us.defaultOptions=e,Us}var of,Ly;function eI(){if(Ly)return of;Ly=1;class e{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,n){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:n})}addChild(r){r.tagname==="__proto__"&&(r.tagname="#__proto__"),r[":@"]&&Object.keys(r[":@"]).length>0?this.child.push({[r.tagname]:r.child,":@":r[":@"]}):this.child.push({[r.tagname]:r.child})}}return of=e,of}var sf,By;function tI(){if(By)return sf;By=1;const e=nf();function t(u,a){const f={};if(u[a+3]==="O"&&u[a+4]==="C"&&u[a+5]==="T"&&u[a+6]==="Y"&&u[a+7]==="P"&&u[a+8]==="E"){a=a+9;let d=1,b=!1,E=!1,S="";for(;a<u.length;a++)if(u[a]==="<"&&!E){if(b&&o(u,a)){a+=7;let T,w;[T,w,a]=r(u,a+1),w.indexOf("&")===-1&&(f[c(T)]={regx:RegExp(`&${T};`,"g"),val:w})}else if(b&&i(u,a))a+=8;else if(b&&s(u,a))a+=8;else if(b&&l(u,a))a+=9;else if(n)E=!0;else throw new Error("Invalid DOCTYPE");d++,S=""}else if(u[a]===">"){if(E?u[a-1]==="-"&&u[a-2]==="-"&&(E=!1,d--):d--,d===0)break}else u[a]==="["?b=!0:S+=u[a];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:a}}function r(u,a){let f="";for(;a<u.length&&u[a]!=="'"&&u[a]!=='"';a++)f+=u[a];if(f=f.trim(),f.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[a++];let b="";for(;a<u.length&&u[a]!==d;a++)b+=u[a];return[f,b,a]}function n(u,a){return u[a+1]==="!"&&u[a+2]==="-"&&u[a+3]==="-"}function o(u,a){return u[a+1]==="!"&&u[a+2]==="E"&&u[a+3]==="N"&&u[a+4]==="T"&&u[a+5]==="I"&&u[a+6]==="T"&&u[a+7]==="Y"}function i(u,a){return u[a+1]==="!"&&u[a+2]==="E"&&u[a+3]==="L"&&u[a+4]==="E"&&u[a+5]==="M"&&u[a+6]==="E"&&u[a+7]==="N"&&u[a+8]==="T"}function s(u,a){return u[a+1]==="!"&&u[a+2]==="A"&&u[a+3]==="T"&&u[a+4]==="T"&&u[a+5]==="L"&&u[a+6]==="I"&&u[a+7]==="S"&&u[a+8]==="T"}function l(u,a){return u[a+1]==="!"&&u[a+2]==="N"&&u[a+3]==="O"&&u[a+4]==="T"&&u[a+5]==="A"&&u[a+6]==="T"&&u[a+7]==="I"&&u[a+8]==="O"&&u[a+9]==="N"}function c(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return sf=t,sf}var af,My;function rI(){if(My)return af;My=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function n(s,l={}){if(l=Object.assign({},r,l),!s||typeof s!="string")return s;if(s==="0")return 0;let c=s.trim();if(l.skipLike!==void 0&&l.skipLike.test(c))return s;if(l.hex&&e.test(c))return i(c,16);if(c.search(/[eE]/)!==-1){const u=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(l.leadingZeros)c=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return l.eNotation?Number(c):s}else return s}else{const u=t.exec(c);if(u){const a=u[1],f=u[2];let d=o(u[3]);if(!l.leadingZeros&&f.length>0&&a&&c[2]!==".")return s;if(!l.leadingZeros&&f.length>0&&!a&&c[1]!==".")return s;if(l.leadingZeros&&f===s)return 0;{const b=Number(c),E=""+b;return E.search(/[eE]/)!==-1?l.eNotation?b:s:c.indexOf(".")!==-1?E==="0"&&d===""||E===d||a&&E==="-"+d?b:s:f?d===E||a+d===E?b:s:c===E||c===a+E?b:s}}else return s}}function o(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 i(s,l){if(parseInt)return parseInt(s,l);if(Number.parseInt)return Number.parseInt(s,l);if(window&&window.parseInt)return window.parseInt(s,l);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}return af=n,af}var lf,jy;function Uy(){if(jy)return lf;jy=1;function e(t){return typeof t=="function"?t:Array.isArray(t)?r=>{for(const n of t)if(typeof n=="string"&&r===n||n instanceof RegExp&&n.test(r))return!0}:()=>!1}return lf=e,lf}var cf,qy;function nI(){if(qy)return cf;qy=1;const e=nf(),t=eI(),r=tI(),n=rI(),o=Uy();class i{constructor(R){this.options=R,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:(C,P)=>String.fromCharCode(Number.parseInt(P,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(C,P)=>String.fromCharCode(Number.parseInt(P,16))}},this.addExternalEntities=s,this.parseXml=f,this.parseTextData=l,this.resolveNameSpace=c,this.buildAttributesMap=a,this.isItStopNode=S,this.replaceEntitiesValue=b,this.readStopNodeData=g,this.saveTextToParentTag=E,this.addChild=d,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(A){const R=Object.keys(A);for(let C=0;C<R.length;C++){const P=R[C];this.lastEntities[P]={regex:new RegExp("&"+P+";","g"),val:A[P]}}}function l(A,R,C,P,_,L,B){if(A!==void 0&&(this.options.trimValues&&!P&&(A=A.trim()),A.length>0)){B||(A=this.replaceEntitiesValue(A));const $=this.options.tagValueProcessor(R,A,C,_,L);return $==null?A:typeof $!=typeof A||$!==A?$:this.options.trimValues?v(A,this.options.parseTagValue,this.options.numberParseOptions):A.trim()===A?v(A,this.options.parseTagValue,this.options.numberParseOptions):A}}function c(A){if(this.options.removeNSPrefix){const R=A.split(":"),C=A.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(A=C+R[1])}return A}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function a(A,R,C){if(this.options.ignoreAttributes!==!0&&typeof A=="string"){const P=e.getAllMatches(A,u),_=P.length,L={};for(let B=0;B<_;B++){const $=this.resolveNameSpace(P[B][1]);if(this.ignoreAttributesFn($,R))continue;let D=P[B][4],H=this.options.attributeNamePrefix+$;if($.length)if(this.options.transformAttributeName&&(H=this.options.transformAttributeName(H)),H==="__proto__"&&(H="#__proto__"),D!==void 0){this.options.trimValues&&(D=D.trim()),D=this.replaceEntitiesValue(D);const X=this.options.attributeValueProcessor($,D,R);X==null?L[H]=D:typeof X!=typeof D||X!==D?L[H]=X:L[H]=v(D,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(L[H]=!0)}if(!Object.keys(L).length)return;if(this.options.attributesGroupName){const B={};return B[this.options.attributesGroupName]=L,B}return L}}const f=function(A){A=A.replace(/\r\n?/g,`
52
+ `);const R=new t("!xml");let C=R,P="",_="";for(let L=0;L<A.length;L++)if(A[L]==="<")if(A[L+1]==="/"){const $=w(A,">",L,"Closing Tag is not closed.");let D=A.substring(L+2,$).trim();if(this.options.removeNSPrefix){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),C&&(P=this.saveTextToParentTag(P,C,_));const H=_.substring(_.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let X=0;H&&this.options.unpairedTags.indexOf(H)!==-1?(X=_.lastIndexOf(".",_.lastIndexOf(".")-1),this.tagsNodeStack.pop()):X=_.lastIndexOf("."),_=_.substring(0,X),C=this.tagsNodeStack.pop(),P="",L=$}else if(A[L+1]==="?"){let $=y(A,L,!1,"?>");if(!$)throw new Error("Pi Tag is not closed.");if(P=this.saveTextToParentTag(P,C,_),!(this.options.ignoreDeclaration&&$.tagName==="?xml"||this.options.ignorePiTags)){const D=new t($.tagName);D.add(this.options.textNodeName,""),$.tagName!==$.tagExp&&$.attrExpPresent&&(D[":@"]=this.buildAttributesMap($.tagExp,_,$.tagName)),this.addChild(C,D,_)}L=$.closeIndex+1}else if(A.substr(L+1,3)==="!--"){const $=w(A,"-->",L+4,"Comment is not closed.");if(this.options.commentPropName){const D=A.substring(L+4,$-2);P=this.saveTextToParentTag(P,C,_),C.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}L=$}else if(A.substr(L+1,2)==="!D"){const $=r(A,L);this.docTypeEntities=$.entities,L=$.i}else if(A.substr(L+1,2)==="!["){const $=w(A,"]]>",L,"CDATA is not closed.")-2,D=A.substring(L+9,$);P=this.saveTextToParentTag(P,C,_);let H=this.parseTextData(D,C.tagname,_,!0,!1,!0,!0);H==null&&(H=""),this.options.cdataPropName?C.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):C.add(this.options.textNodeName,H),L=$+2}else{let $=y(A,L,this.options.removeNSPrefix),D=$.tagName;const H=$.rawTagName;let X=$.tagExp,J=$.attrExpPresent,le=$.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),C&&P&&C.tagname!=="!xml"&&(P=this.saveTextToParentTag(P,C,_,!1));const me=C;if(me&&this.options.unpairedTags.indexOf(me.tagname)!==-1&&(C=this.tagsNodeStack.pop(),_=_.substring(0,_.lastIndexOf("."))),D!==R.tagname&&(_+=_?"."+D:D),this.isItStopNode(this.options.stopNodes,_,D)){let fe="";if(X.length>0&&X.lastIndexOf("/")===X.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),_=_.substr(0,_.length-1),X=D):X=X.substr(0,X.length-1),L=$.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)L=$.closeIndex;else{const Se=this.readStopNodeData(A,H,le+1);if(!Se)throw new Error(`Unexpected end of ${H}`);L=Se.i,fe=Se.tagContent}const we=new t(D);D!==X&&J&&(we[":@"]=this.buildAttributesMap(X,_,D)),fe&&(fe=this.parseTextData(fe,D,_,!0,J,!0,!0)),_=_.substr(0,_.lastIndexOf(".")),we.add(this.options.textNodeName,fe),this.addChild(C,we,_)}else{if(X.length>0&&X.lastIndexOf("/")===X.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),_=_.substr(0,_.length-1),X=D):X=X.substr(0,X.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const fe=new t(D);D!==X&&J&&(fe[":@"]=this.buildAttributesMap(X,_,D)),this.addChild(C,fe,_),_=_.substr(0,_.lastIndexOf("."))}else{const fe=new t(D);this.tagsNodeStack.push(C),D!==X&&J&&(fe[":@"]=this.buildAttributesMap(X,_,D)),this.addChild(C,fe,_),C=fe}P="",L=le}}else P+=A[L];return R.child};function d(A,R,C){const P=this.options.updateTag(R.tagname,C,R[":@"]);P===!1||(typeof P=="string"&&(R.tagname=P),A.addChild(R))}const b=function(A){if(this.options.processEntities){for(let R in this.docTypeEntities){const C=this.docTypeEntities[R];A=A.replace(C.regx,C.val)}for(let R in this.lastEntities){const C=this.lastEntities[R];A=A.replace(C.regex,C.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const C=this.htmlEntities[R];A=A.replace(C.regex,C.val)}A=A.replace(this.ampEntity.regex,this.ampEntity.val)}return A};function E(A,R,C,P){return A&&(P===void 0&&(P=R.child.length===0),A=this.parseTextData(A,R.tagname,C,!1,R[":@"]?Object.keys(R[":@"]).length!==0:!1,P),A!==void 0&&A!==""&&R.add(this.options.textNodeName,A),A=""),A}function S(A,R,C){const P="*."+C;for(const _ in A){const L=A[_];if(P===L||R===L)return!0}return!1}function T(A,R,C=">"){let P,_="";for(let L=R;L<A.length;L++){let B=A[L];if(P)B===P&&(P="");else if(B==='"'||B==="'")P=B;else if(B===C[0])if(C[1]){if(A[L+1]===C[1])return{data:_,index:L}}else return{data:_,index:L};else B===" "&&(B=" ");_+=B}}function w(A,R,C,P){const _=A.indexOf(R,C);if(_===-1)throw new Error(P);return _+R.length-1}function y(A,R,C,P=">"){const _=T(A,R+1,P);if(!_)return;let L=_.data;const B=_.index,$=L.search(/\s/);let D=L,H=!0;$!==-1&&(D=L.substring(0,$),L=L.substring($+1).trimStart());const X=D;if(C){const J=D.indexOf(":");J!==-1&&(D=D.substr(J+1),H=D!==_.data.substr(J+1))}return{tagName:D,tagExp:L,closeIndex:B,attrExpPresent:H,rawTagName:X}}function g(A,R,C){const P=C;let _=1;for(;C<A.length;C++)if(A[C]==="<")if(A[C+1]==="/"){const L=w(A,">",C,`${R} is not closed`);if(A.substring(C+2,L).trim()===R&&(_--,_===0))return{tagContent:A.substring(P,C),i:L};C=L}else if(A[C+1]==="?")C=w(A,"?>",C+1,"StopNode is not closed.");else if(A.substr(C+1,3)==="!--")C=w(A,"-->",C+3,"StopNode is not closed.");else if(A.substr(C+1,2)==="![")C=w(A,"]]>",C,"StopNode is not closed.")-2;else{const L=y(A,C,">");L&&((L&&L.tagName)===R&&L.tagExp[L.tagExp.length-1]!=="/"&&_++,C=L.closeIndex)}}function v(A,R,C){if(R&&typeof A=="string"){const P=A.trim();return P==="true"?!0:P==="false"?!1:n(A,C)}else return e.isExist(A)?A:""}return cf=i,cf}var uf={},Vy;function iI(){if(Vy)return uf;Vy=1;function e(i,s){return t(i,s)}function t(i,s,l){let c;const u={};for(let a=0;a<i.length;a++){const f=i[a],d=r(f);let b="";if(l===void 0?b=d:b=l+"."+d,d===s.textNodeName)c===void 0?c=f[d]:c+=""+f[d];else{if(d===void 0)continue;if(f[d]){let E=t(f[d],s,b);const S=o(E,s);f[":@"]?n(E,f[":@"],b,s):Object.keys(E).length===1&&E[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?E=E[s.textNodeName]:Object.keys(E).length===0&&(s.alwaysCreateTextNode?E[s.textNodeName]="":E=""),u[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(E)):s.isArray(d,b,S)?u[d]=[E]:u[d]=E}}}return typeof c=="string"?c.length>0&&(u[s.textNodeName]=c):c!==void 0&&(u[s.textNodeName]=c),u}function r(i){const s=Object.keys(i);for(let l=0;l<s.length;l++){const c=s[l];if(c!==":@")return c}}function n(i,s,l,c){if(s){const u=Object.keys(s),a=u.length;for(let f=0;f<a;f++){const d=u[f];c.isArray(d,l+"."+d,!0,!0)?i[d]=[s[d]]:i[d]=s[d]}}}function o(i,s){const{textNodeName:l}=s,c=Object.keys(i).length;return!!(c===0||c===1&&(i[l]||typeof i[l]=="boolean"||i[l]===0))}return uf.prettify=e,uf}var ff,zy;function oI(){if(zy)return ff;zy=1;const{buildOptions:e}=Z_(),t=nI(),{prettify:r}=iI(),n=$y();class o{constructor(s){this.externalEntities={},this.options=e(s)}parse(s,l){if(typeof s!="string")if(s.toString)s=s.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(l){l===!0&&(l={});const a=n.validate(s,l);if(a!==!0)throw Error(`${a.err.msg}:${a.err.line}:${a.err.col}`)}const c=new t(this.options);c.addExternalEntities(this.externalEntities);const u=c.parseXml(s);return this.options.preserveOrder||u===void 0?u:r(u,this.options)}addEntity(s,l){if(l.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(l==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[s]=l}}return ff=o,ff}var df,Wy;function sI(){if(Wy)return df;Wy=1;const e=`
53
+ `;function t(l,c){let u="";return c.format&&c.indentBy.length>0&&(u=e),r(l,c,"",u)}function r(l,c,u,a){let f="",d=!1;for(let b=0;b<l.length;b++){const E=l[b],S=n(E);if(S===void 0)continue;let T="";if(u.length===0?T=S:T=`${u}.${S}`,S===c.textNodeName){let A=E[S];i(T,c)||(A=c.tagValueProcessor(S,A),A=s(A,c)),d&&(f+=a),f+=A,d=!1;continue}else if(S===c.cdataPropName){d&&(f+=a),f+=`<![CDATA[${E[S][0][c.textNodeName]}]]>`,d=!1;continue}else if(S===c.commentPropName){f+=a+`<!--${E[S][0][c.textNodeName]}-->`,d=!0;continue}else if(S[0]==="?"){const A=o(E[":@"],c),R=S==="?xml"?"":a;let C=E[S][0][c.textNodeName];C=C.length!==0?" "+C:"",f+=R+`<${S}${C}${A}?>`,d=!0;continue}let w=a;w!==""&&(w+=c.indentBy);const y=o(E[":@"],c),g=a+`<${S}${y}`,v=r(E[S],c,T,w);c.unpairedTags.indexOf(S)!==-1?c.suppressUnpairedNode?f+=g+">":f+=g+"/>":(!v||v.length===0)&&c.suppressEmptyNode?f+=g+"/>":v&&v.endsWith(">")?f+=g+`>${v}${a}</${S}>`:(f+=g+">",v&&a!==""&&(v.includes("/>")||v.includes("</"))?f+=a+c.indentBy+v+a:f+=v,f+=`</${S}>`),d=!0}return f}function n(l){const c=Object.keys(l);for(let u=0;u<c.length;u++){const a=c[u];if(l.hasOwnProperty(a)&&a!==":@")return a}}function o(l,c){let u="";if(l&&!c.ignoreAttributes)for(let a in l){if(!l.hasOwnProperty(a))continue;let f=c.attributeValueProcessor(a,l[a]);f=s(f,c),f===!0&&c.suppressBooleanAttributes?u+=` ${a.substr(c.attributeNamePrefix.length)}`:u+=` ${a.substr(c.attributeNamePrefix.length)}="${f}"`}return u}function i(l,c){l=l.substr(0,l.length-c.textNodeName.length-1);let u=l.substr(l.lastIndexOf(".")+1);for(let a in c.stopNodes)if(c.stopNodes[a]===l||c.stopNodes[a]==="*."+u)return!0;return!1}function s(l,c){if(l&&l.length>0&&c.processEntities)for(let u=0;u<c.entities.length;u++){const a=c.entities[u];l=l.replace(a.regex,a.val)}return l}return df=t,df}var pf,Hy;function aI(){if(Hy)return pf;Hy=1;const e=sI(),t=Uy(),r={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(l,c){return c},attributeValueProcessor:function(l,c){return c},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 n(l){this.options=Object.assign({},r,l),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=s),this.processTextOrObjNode=o,this.options.format?(this.indentate=i,this.tagEndChar=`>
54
54
  `,this.newLine=`
55
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}n.prototype.build=function(l){return this.options.preserveOrder?e(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0,[]).val)},n.prototype.j2x=function(l,c,u){let a="",f="";const d=u.join(".");for(let b in l)if(Object.prototype.hasOwnProperty.call(l,b))if(typeof l[b]>"u")this.isAttribute(b)&&(f+="");else if(l[b]===null)this.isAttribute(b)||b===this.options.cdataPropName?f+="":b[0]==="?"?f+=this.indentate(c)+"<"+b+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+b+"/"+this.tagEndChar;else if(l[b]instanceof Date)f+=this.buildTextValNode(l[b],b,"",c);else if(typeof l[b]!="object"){const E=this.isAttribute(b);if(E&&!this.ignoreAttributesFn(E,d))a+=this.buildAttrPairStr(E,""+l[b]);else if(!E)if(b===this.options.textNodeName){let w=this.options.tagValueProcessor(b,""+l[b]);f+=this.replaceEntitiesValue(w)}else f+=this.buildTextValNode(l[b],b,"",c)}else if(Array.isArray(l[b])){const E=l[b].length;let w="",R="";for(let S=0;S<E;S++){const m=l[b][S];if(!(typeof m>"u"))if(m===null)b[0]==="?"?f+=this.indentate(c)+"<"+b+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+b+"/"+this.tagEndChar;else if(typeof m=="object")if(this.options.oneListGroup){const g=this.j2x(m,c+1,u.concat(b));w+=g.val,this.options.attributesGroupName&&m.hasOwnProperty(this.options.attributesGroupName)&&(R+=g.attrStr)}else w+=this.processTextOrObjNode(m,b,c,u);else if(this.options.oneListGroup){let g=this.options.tagValueProcessor(b,m);g=this.replaceEntitiesValue(g),w+=g}else w+=this.buildTextValNode(m,b,"",c)}this.options.oneListGroup&&(w=this.buildObjectNode(w,b,R,c)),f+=w}else if(this.options.attributesGroupName&&b===this.options.attributesGroupName){const E=Object.keys(l[b]),w=E.length;for(let R=0;R<w;R++)a+=this.buildAttrPairStr(E[R],""+l[b][E[R]])}else f+=this.processTextOrObjNode(l[b],b,c,u);return{attrStr:a,val:f}},n.prototype.buildAttrPairStr=function(l,c){return c=this.options.attributeValueProcessor(l,""+c),c=this.replaceEntitiesValue(c),this.options.suppressBooleanAttributes&&c==="true"?" "+l:" "+l+'="'+c+'"'};function o(l,c,u,a){const f=this.j2x(l,u+1,a.concat(c));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],c,f.attrStr,u):this.buildObjectNode(f.val,c,f.attrStr,u)}n.prototype.buildObjectNode=function(l,c,u,a){if(l==="")return c[0]==="?"?this.indentate(a)+"<"+c+u+"?"+this.tagEndChar:this.indentate(a)+"<"+c+u+this.closeTag(c)+this.tagEndChar;{let f="</"+c+this.tagEndChar,d="";return c[0]==="?"&&(d="?",f=""),(u||u==="")&&l.indexOf("<")===-1?this.indentate(a)+"<"+c+u+d+">"+l+f:this.options.commentPropName!==!1&&c===this.options.commentPropName&&d.length===0?this.indentate(a)+`<!--${l}-->`+this.newLine:this.indentate(a)+"<"+c+u+d+this.tagEndChar+l+this.indentate(a)+f}},n.prototype.closeTag=function(l){let c="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(c="/"):this.options.suppressEmptyNode?c="/":c=`></${l}`,c},n.prototype.buildTextValNode=function(l,c,u,a){if(this.options.cdataPropName!==!1&&c===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(a)+`<!--${l}-->`+this.newLine;if(c[0]==="?")return this.indentate(a)+"<"+c+u+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(c,l);return f=this.replaceEntitiesValue(f),f===""?this.indentate(a)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(a)+"<"+c+u+">"+f+"</"+c+this.tagEndChar}},n.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let c=0;c<this.options.entities.length;c++){const u=this.options.entities[c];l=l.replace(u.regex,u.val)}return l};function i(l){return this.options.indentBy.repeat(l)}function s(l){return l.startsWith(this.options.attributeNamePrefix)&&l!==this.options.textNodeName?l.substr(this.attrPrefixLen):!1}return df=n,df}var pf,Gy;function dI(){if(Gy)return pf;Gy=1;const e=$y(),t=cI(),r=fI();return pf={XMLParser:t,XMLValidator:e,XMLBuilder:r},pf}dI();class Ky{isEnabled(){return!0}isActive(t){return Rr(t,"files-trash-generic")}getTask(t){const{resourcesStore:r,clientService:{webdav:n}}=t;return cr.useTask(function*(o,i,s){r.clearResourceList(),r.setAncestorMetaData({});const{resource:l,children:c}=yield n.listFiles(s,{},{depth:1,davProperties:Es.Trashbin,isTrash:!0,signal:o});r.initResourceList({currentFolder:l,resources:c})})}}class Qy{constructor(){Ee(this,"loaders");this.loaders=[new Gh,new Kh,new Qh,new Xh,new Yh,new Ky]}getTask(){const t=bt(),r=dt(),n=tr(),o=We(),i=Je(),s=at(),l=Ke(),c=Mt(),u=Af(),a=this.loaders.find(f=>f.isEnabled()&&f.isActive(y(o)));if(!a){console.debug("No folder loader found for route");return}return cr.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:r,capabilityStore:n,resourcesStore:l,sharesStore:c,router:o,authService:u};try{yield a.getTask(d).perform(...f)}catch(b){console.error(b)}})}}const Xy=new Qy;var Pn=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Pn||{});const pI=200;class hI{constructor(){Ee(this,"tasks",[])}get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(n=>!n.state&&n.active))return null;const t=this.tasks.filter(n=>!!n.state&&n.active);if(!t.length)return null;const r=t.reduce((n,o)=>(n+=o.state.current/o.state.total,n),0);return Math.round(r/t.length*100)}addTask(t,{debounceTime:r=pI,indeterminate:n=!0}={}){const o={id:Qt.v4(),active:!1,...!n&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),Ct.debounce(()=>{o.active=!0,Xe.publish("loading-service.add")},r)(),t({setProgress:({total:l,current:c})=>{n||this.setProgress({task:o,total:l,current:c})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(r=>r.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Xe.publish("loading-service.remove")}setProgress({task:t,total:r,current:n}){t.state||(t.state={total:0,current:0}),t.state.total=r,t.state.current=n,Xe.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var gI="__lodash_hash_undefined__";function mI(e){return this.__data__.set(e,gI),this}function yI(e){return this.__data__.has(e)}function qs(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new mn;++t<r;)this.add(e[t])}qs.prototype.add=qs.prototype.push=mI,qs.prototype.has=yI;function bI(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function vI(e,t){return e.has(t)}var wI=1,SI=2;function Yy(e,t,r,n,o,i){var s=r&wI,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(e),a=i.get(t);if(u&&a)return u==t&&a==e;var f=-1,d=!0,b=r&SI?new qs:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var E=e[f],w=t[f];if(n)var R=s?n(w,E,f,t,e,i):n(E,w,f,e,t,i);if(R!==void 0){if(R)continue;d=!1;break}if(b){if(!bI(t,function(S,m){if(!vI(b,m)&&(E===S||o(E,S,r,n,i)))return b.push(m)})){d=!1;break}}else if(!(E===w||o(E,w,r,n,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function EI(e){var t=-1,r=Array(e.size);return e.forEach(function(n,o){r[++t]=[o,n]}),r}function TI(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var AI=1,RI=2,_I="[object Boolean]",II="[object Date]",CI="[object Error]",FI="[object Map]",PI="[object Number]",xI="[object RegExp]",OI="[object Set]",kI="[object String]",NI="[object Symbol]",$I="[object ArrayBuffer]",DI="[object DataView]",Jy=Fr?Fr.prototype:void 0,hf=Jy?Jy.valueOf:void 0;function LI(e,t,r,n,o,i,s){switch(r){case DI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $I:return!(e.byteLength!=t.byteLength||!i(new ps(e),new ps(t)));case _I:case II:case PI:return ro(+e,+t);case CI:return e.name==t.name&&e.message==t.message;case xI:case kI:return e==t+"";case FI:var l=EI;case OI:var c=n&AI;if(l||(l=TI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=RI,s.set(e,t);var a=Yy(l(e),l(t),n,o,i,s);return s.delete(e),a;case NI:if(hf)return hf.call(e)==hf.call(t)}return!1}function gf(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}function Zy(e,t,r){var n=t(e);return Pr(e)?n:gf(n,r(e))}function BI(e,t){for(var r=-1,n=e==null?0:e.length,o=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[o++]=s)}return i}function eb(){return[]}var MI=Object.prototype,jI=MI.propertyIsEnumerable,tb=Object.getOwnPropertySymbols,rb=tb?function(e){return e==null?[]:(e=Object(e),BI(tb(e),function(t){return jI.call(e,t)}))}:eb;function UI(e){return ao(e)?eh(e):Uh(e)}function nb(e){return Zy(e,UI,rb)}var qI=1,VI=Object.prototype,zI=VI.hasOwnProperty;function WI(e,t,r,n,o,i){var s=r&qI,l=nb(e),c=l.length,u=nb(t),a=u.length;if(c!=a&&!s)return!1;for(var f=c;f--;){var d=l[f];if(!(s?d in t:zI.call(t,d)))return!1}var b=i.get(e),E=i.get(t);if(b&&E)return b==t&&E==e;var w=!0;i.set(e,t),i.set(t,e);for(var R=s;++f<c;){d=l[f];var S=e[d],m=t[d];if(n)var g=s?n(m,S,d,t,e,i):n(S,m,d,e,t,i);if(!(g===void 0?S===m||o(S,m,r,n,i):g)){w=!1;break}R||(R=d=="constructor")}if(w&&!R){var v=e.constructor,T=t.constructor;v!=T&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof T=="function"&&T instanceof T)&&(w=!1)}return i.delete(e),i.delete(t),w}var HI=1,ib="[object Arguments]",ob="[object Array]",Vs="[object Object]",GI=Object.prototype,sb=GI.hasOwnProperty;function KI(e,t,r,n,o,i){var s=Pr(e),l=Pr(t),c=s?ob:Nr(e),u=l?ob:Nr(t);c=c==ib?Vs:c,u=u==ib?Vs:u;var a=c==Vs,f=u==Vs,d=c==u;if(d&&Ei(e)){if(!Ei(t))return!1;s=!0,a=!1}if(d&&!a)return i||(i=new Xr),s||gs(e)?Yy(e,t,r,n,o,i):LI(e,t,c,r,n,o,i);if(!(r&HI)){var b=a&&sb.call(e,"__wrapped__"),E=f&&sb.call(t,"__wrapped__");if(b||E){var w=b?e.value():e,R=E?t.value():t;return i||(i=new Xr),o(w,R,r,n,i)}}return d?(i||(i=new Xr),WI(e,t,r,n,o,i)):!1}function ab(e,t,r,n,o){return e===t?!0:e==null||t==null||!Yr(e)&&!Yr(t)?e!==e&&t!==t:KI(e,t,r,n,ab,o)}function lb(e,t){return ab(e,t)}const mf=(e="")=>e.split("/").map(encodeURIComponent).join("/"),QI=e=>{const t=[],r=(n,o="")=>Object.keys(n).forEach(i=>{hl(n[i])?r(n[i],`${o}${i}.`):t.push(`${o}${i}`)});return r(e),t};class XI{constructor({clientService:t,userStore:r,authStore:n,capabilityStore:o,configStore:i}){Ee(this,"clientService");Ee(this,"configStore");Ee(this,"userStore");Ee(this,"authStore");Ee(this,"capabilityStore");Ee(this,"capability");this.clientService=t,this.userStore=r,this.authStore=n,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","text/plain","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,r=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(r?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(r=>r.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,r=!1,n=!0,o){const{space:i,resource:s}=t,l=this.available&&this.isMimetypeSupported(s.mimeType),c=s.type!=="folder"&&s.extension&&s.canDownload();if(!l||!c)return;const u=ie.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,r,n,o)}catch(a){if(n)return;throw a}}}async cacheFactory(t,r,n){const{resource:o,dimensions:i}=t,s=zl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&lb(i,s.dimensions))return s.src;try{const l=await this.privatePreviewBlob(t,!1,!0,n);return zl.filePreview.set(o.id.toString(),{src:l,etag:o.etag,dimensions:i},0).src}catch(l){if(r)return;throw l}}buildQueryString(t){return M0.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,r=!1,n=!0,o){var u,a;const{resource:i,dimensions:s,processor:l}=t;if(r)return this.cacheFactory(t,n,o);const c=[this.configStore.serverUrl,"remote.php/dav",mf(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:l})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((a=(u=f.response)==null?void 0:u.headers)==null?void 0:a["retry-after"])||5;return await new Promise(b=>setTimeout(b,d*1e3)),this.privatePreviewBlob(t,r,n,o)}throw f}}async publicPreviewUrl(t,r){var a,f;const{resource:n,dimensions:o,processor:i}=t,[s,l]=n.downloadURL.split("?"),c=[this.buildQueryString({etag:n.etag,dimensions:o,processor:i}),l].filter(Boolean).join("&"),u=[s,c].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:r});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const b=((f=(a=d.response)==null?void 0:a.headers)==null?void 0:f["retry-after"])||5;return await new Promise(E=>setTimeout(E,b*1e3)),this.publicPreviewUrl(t,r)}throw d}}}const zs=ye.z.enum(["fit","resize","fill","thumbnail"]);class YI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,r){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return r.length>0}validate(){return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class JI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,r){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return Array.from(r).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!Ct.isObject(t))throw new Error("options should be an object");if(!Ct.isNumber(t.minLength)||Ct.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Ct.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class Ws{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}assert(t,r){throw new Error("Method not implemented.")}explain(t,r){throw new Error("Method not implemented.")}validate(t){if(!Ct.isObject(t))throw new Error("options should be an object");if(!Ct.isNumber(t.minLength)||Ct.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class ZI extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){return r.length>=t.minLength}}class eC extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){var o;return((o=(r||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class tC extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){var o;return((o=(r||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class rC extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Ct.isBoolean(r)&&{verified:r}}}assert(t,r){var o;return((o=(r||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var yf={},cb;function nC(){if(cb)return yf;cb=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",l="",c=i.length,u=i.lowercase,a=i.uppercase,f=i.numbers,d=i.symbols,b=i.minLengthLowercase,E=i.minLengthUppercase,w=i.minLengthNumbers,R=i.minLengthSymbols,S=i.exclude,m="abcdefghijklmnopqrstuvwxyz";m=r(m,S);var g="ABCDEFGHIJKLMNOPQRSTUVWXYZ";g=r(g,S);var v="0123456789";v=r(v,S);var T="!#$%&'()*+,-./:;<=>?@[]^_{|}~";T=r(T,S);for(var A=m.length,F=0;F<b;F++)l+=m.charAt(e(A));for(A=g.length,F=0;F<E;F++)l+=g.charAt(e(A));for(A=v.length,F=0;F<w;F++)l+=v.charAt(e(A));for(A=T.length,F=0;F<R;F++)l+=T.charAt(e(A));s+=function(L){for(var B=L.split(""),$=B.length-1;$>0;$--){var D=Math.floor(Math.random()*($+1)),H=B[$];B[$]=B[D],B[D]=H}return B.join("")}(l);var C="";C=u?C+m:C,C=a?C+g:C,C=f?C+v:C,C=d?C+T:C;var I=c-s.length;for(A=C.length,F=0;F<I;F++)s+=C.charAt(e(A));return s},r=function(i,s){return s==null||s.split("").forEach(function(l){i=i.replace(l,"")}),i},n=function(i){var s=i.length,l=i.lowercase,c=i.uppercase,u=i.numbers,a=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(l==0&&c==0&&u==0&&a==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return yf.GeneratePassword=function(i){return i?(i=o(i),n(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),n(i),t(i))},yf}var iC=nC();class oC{constructor({language:t}){Ee(this,"language");Ee(this,"capability");Ee(this,"policy");Ee(this,"generatePasswordRules");this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const r={atLeastCharacters:new ZI({...this.language}),mustNotBeEmpty:new YI({...this.language}),atLeastUppercaseCharacters:new eC({...this.language}),atLeastLowercaseCharacters:new tC({...this.language}),atLeastDigits:new rC({...this.language}),mustContain:new JI({...this.language})},n={};t&&!this.hasRules()&&(n.mustNotBeEmpty={}),this.capability.min_characters&&(n.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(n.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(n.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(n.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(n.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new j0.PasswordPolicy(n,r)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return iC.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function sC(e){return e.charCodeAt(0).toString(32)}function ub(e){let t="";return e.replace(/[^A-Z0-9]/gi,r=>(t+=`-${sC(r)}`,"/"))+t}function fb(e,t){let r=t||"uppy";return typeof e.name=="string"&&(r+=`-${ub(e.name.toLowerCase())}`),e.type!==void 0&&(r+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(r+=`-${ub(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(r+=`-${e.data.size}`),e.data.lastModified!==void 0&&(r+=`-${e.data.lastModified}`),r}class aC{constructor({language:t}){Ee(this,"uppy");Ee(this,"uploadInputs",[]);Ee(this,"uploadFolderMap",{});Ee(this,"getRelativeFilePath",t=>{const r=t.data.relativePath||t.data.webkitRelativePath;return r?ie.urlJoin(r):void 0});const{$gettext:r}=t;this.uppy=new U0({autoProceed:!1,onBeforeFileAdded:(n,o)=>(n.id in o&&(n.meta.retry=!0),n.meta.relativePath=this.getRelativeFilePath(n),n.id=fb(n,this.uppy.getID()),n)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:r("Added %{numFiles} file(s)"),authenticate:r("Connect"),authenticateWith:r("Connect to %{pluginName}"),authenticateWithTitle:r("Please authenticate with %{pluginName} to select files"),cancel:r("Cancel"),companionError:r("Connection with Companion failed"),loadedXFiles:r("Loaded %{numFiles} files"),loading:r("Loading..."),logOut:r("Log out"),pluginWebdavInputLabel:r("Public link without password protection"),selectX:{0:r("Select %{smart_count}"),1:r("Select %{smart_count}")},signInWithGoogle:r("Sign in with Google")}}}),this.setUpEvents()}addPlugin(t,...r){this.uppy.use(t,...r)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:r,uploadDataDuringCreation:n,onBeforeRequest:o,headers:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:r,retryDelays:[0,500,1e3],uploadDataDuringCreation:n,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,a,f,d)=>{var b,E;return((b=u==null?void 0:u.originalResponse)==null?void 0:b.getStatus())>=500?!1:((E=u==null?void 0:u.originalResponse)==null?void 0:E.getStatus())===401?!0:d(u)}},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const c=this.uppy.getPlugin("Tus");if(c){c.setOptions(s);return}this.uppy.use(q0,s)}useXhr({headers:t,timeout:r,endpoint:n}){const o={endpoint:n,method:"put",headers:t,formData:!1,timeout:r,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(V0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(z0,{target:t,onDragOver:r=>{this.publish("drag-over",r)},onDragLeave:r=>{this.publish("drag-out",r)},onDrop:r=>{this.publish("drop",r)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,r){return Xe.subscribe(t,r)}unsubscribe(t,r){Xe.unsubscribe(t,r)}publish(t,r){Xe.publish(t,r)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,r)=>{this.publish("upload-progress",{file:t,progress:r})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{this.publish("uploadCompleted",t),t.successful.forEach(r=>{this.uppy.removeFile(r.id)}),this.clearInputs()}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,r)=>{this.publish("uploadError",{file:t,error:r})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",n=>{const o=n.target,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(r=>r!==t)}generateUploadId(t){return fb(t,this.uppy.getID())}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,r){this.uploadFolderMap[t]=r}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function lC(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var cC=Object.getOwnPropertySymbols,uC=cC?function(e){for(var t=[];e;)gf(t,rb(e)),e=pl(e);return t}:eb;function db(e){return Zy(e,bl,uC)}var fC=Object.prototype,dC=fC.hasOwnProperty;function pC(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&dC.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function hC(e,t){var r=dl(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var gC=/\w*$/;function mC(e){var t=new e.constructor(e.source,gC.exec(e));return t.lastIndex=e.lastIndex,t}var pb=Fr?Fr.prototype:void 0,hb=pb?pb.valueOf:void 0;function yC(e){return hb?Object(hb.call(e)):{}}var bC="[object Boolean]",vC="[object Date]",wC="[object Map]",SC="[object Number]",EC="[object RegExp]",TC="[object Set]",AC="[object String]",RC="[object Symbol]",_C="[object ArrayBuffer]",IC="[object DataView]",CC="[object Float32Array]",FC="[object Float64Array]",PC="[object Int8Array]",xC="[object Int16Array]",OC="[object Int32Array]",kC="[object Uint8Array]",NC="[object Uint8ClampedArray]",$C="[object Uint16Array]",DC="[object Uint32Array]";function LC(e,t,r){var n=e.constructor;switch(t){case _C:return dl(e);case bC:case vC:return new n(+e);case IC:return hC(e);case CC:case FC:case PC:case xC:case OC:case kC:case NC:case $C:case DC:return Mp(e,r);case wC:return new n;case SC:case AC:return new n(e);case EC:return mC(e);case TC:return new n;case RC:return yC(e)}}var BC="[object Map]";function MC(e){return Yr(e)&&Nr(e)==BC}var gb=Ti&&Ti.isMap,jC=gb?gl(gb):MC,UC="[object Set]";function qC(e){return Yr(e)&&Nr(e)==UC}var mb=Ti&&Ti.isSet,VC=mb?gl(mb):qC,zC=1,yb="[object Arguments]",WC="[object Array]",HC="[object Boolean]",GC="[object Date]",KC="[object Error]",bb="[object Function]",QC="[object GeneratorFunction]",XC="[object Map]",YC="[object Number]",vb="[object Object]",JC="[object RegExp]",ZC="[object Set]",eF="[object String]",tF="[object Symbol]",rF="[object WeakMap]",nF="[object ArrayBuffer]",iF="[object DataView]",oF="[object Float32Array]",sF="[object Float64Array]",aF="[object Int8Array]",lF="[object Int16Array]",cF="[object Int32Array]",uF="[object Uint8Array]",fF="[object Uint8ClampedArray]",dF="[object Uint16Array]",pF="[object Uint32Array]",gt={};gt[yb]=gt[WC]=gt[nF]=gt[iF]=gt[HC]=gt[GC]=gt[oF]=gt[sF]=gt[aF]=gt[lF]=gt[cF]=gt[XC]=gt[YC]=gt[vb]=gt[JC]=gt[ZC]=gt[eF]=gt[tF]=gt[uF]=gt[fF]=gt[dF]=gt[pF]=!0,gt[KC]=gt[bb]=gt[rF]=!1;function Hs(e,t,r,n,o,i){var s,l=t&zC;if(r&&(s=o?r(e,n,o,i):r(e)),s!==void 0)return s;if(!Qr(e))return e;var c=Pr(e);if(c)s=pC(e);else{var u=Nr(e),a=u==bb||u==QC;if(Ei(e))return Bp(e,l);if(u==vb||u==yb||a&&!o)s={};else{if(!gt[u])return o?e:{};s=LC(e,u,l)}}i||(i=new Xr);var f=i.get(e);if(f)return f;i.set(e,s),VC(e)?e.forEach(function(E){s.add(Hs(E,t,r,E,e,i))}):jC(e)&&e.forEach(function(E,w){s.set(w,Hs(E,t,r,w,e,i))});var d=db,b=c?void 0:d(e);return lC(b||e,function(E,w){b&&(w=E,E=e[w]),Yp(s,w,Hs(E,t,r,w,e,i))}),s}function hF(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}function gF(e,t){return t.length<2?e:bh(e,hF(t,0,-1))}function mF(e,t){return t=Fl(t,e),e=gF(e,t),e==null||delete e[yh(ld(t))]}function yF(e){return hl(e)?void 0:e}var wb=Fr?Fr.isConcatSpreadable:void 0;function bF(e){return Pr(e)||so(e)||!!(wb&&e&&e[wb])}function vF(e,t,r,n,o){var i=-1,s=e.length;for(r||(r=bF),o||(o=[]);++i<s;){var l=e[i];r(l)?gf(o,l):o[o.length]=l}return o}function wF(e){var t=e==null?0:e.length;return t?vF(e):[]}function SF(e){return oh(ih(e,void 0,wF),e+"")}var EF=1,TF=2,AF=4,$i=SF(function(e,t){var r={};if(e==null)return r;var n=!1;t=ph(t,function(i){return i=Fl(i,e),n||(n=i.length>1),i}),Jp(e,db(e),r),n&&(r=Hs(r,EF|TF|AF,yF));for(var o=t.length;o--;)mF(r,t[o]);return r});const RF=(e,t)=>{const r=(i="")=>i.split("/").filter(Boolean),n=r(e.path),o=r(t);return o.map((i,s)=>({id:Qt.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...n].splice(0,n.length-o.length+s+1).join("/"),query:$i(e.query,"fileId","page")},isStaticNav:!1}))},_F=(...e)=>{const t=e.pop();return[...e,{id:Qt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ti{}Ee(ti,"Cut","cut"),Ee(ti,"Copy","copy");const bf=e=>e.clientY===0,To=(e,t,r)=>{var i;const n=r.$el.getBoundingClientRect(),o=bf(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!bf(t)?t.clientX:n.x,right:t.type==="contextmenu"&&!bf(t)?t.clientX:n.x})}),e.show()},Gs=e=>(e||"").split("_")[0],ri=(e,t,r=$t.DateTime.DATETIME_MED)=>e.setLocale(Gs(t)).toLocaleString(r),Sb=(e,t,r=$t.DateTime.DATETIME_MED)=>ri($t.DateTime.fromJSDate(e),t,r),IF=(e,t,r=$t.DateTime.DATETIME_MED)=>ri($t.DateTime.fromHTTP(e),t,r),Eb=(e,t,r=$t.DateTime.DATETIME_MED)=>ri($t.DateTime.fromISO(e),t,r),CF=(e,t,r=$t.DateTime.DATETIME_MED)=>ri($t.DateTime.fromRFC2822(e),t,r),Ao=(e,t)=>e.setLocale(Gs(t)).toRelative(),Tb=(e,t)=>Ao($t.DateTime.fromJSDate(e),t),FF=(e,t)=>Ao($t.DateTime.fromHTTP(e),t),PF=(e,t)=>Ao($t.DateTime.fromISO(e),t),xF=(e,t)=>Ao($t.DateTime.fromRFC2822(e),t),OF=1048576,wr=(e,t)=>{const r=typeof e=="string"?parseInt(e):e;return r<0?"--":isNaN(r)?"?":B0.filesize(r,{round:r<OF?0:1,locale:Gs(t),base:10,output:"string"})};function Ab(e="",t=!1){const r=ie.urlJoin(e,{leadingSlash:!0});if(r==="/")return[];const n=[],o=r.split("/");for(t&&n.push(r),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}n.push(o.join("/")),o.pop()}return n}var mt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(mt||{});const vf=(e,t=void 0)=>{const r=window.localStorage.getItem(e),n=ue(t);if(r)try{n.value=JSON.parse(r)}catch{n.value=r}return Et(()=>y(n),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),n},ni=()=>{const e=at(),t=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),r=V(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),n=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=V(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),l=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),c=V(()=>{var d;return y(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:r,chooseFileName:n,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:l,isDelegatingAuthentication:c,fileTypes:s,postMessage:(d,b)=>{const E={};y(l)&&(E.targetOrigin=y(l)),window.parent.postMessage({name:d,data:b},E)},verifyDelegatedAuthenticationOrigin:d=>y(u)?y(u)===d:!0}},Rb=e=>{const{isEnabled:t}=ni(),r=(e==null?void 0:e.bus)||Xe,n=vf("oc_sideBarOpen",!1),o=ue(!1),i=V({get(){return y(t)?y(o):y(n)},set(E){if(y(t)){o.value=E;return}n.value=E}}),s=async()=>{await Hr();const E=document.getElementById("app-sidebar");E&&E.focus()},l=ue(null),c=r.subscribe(mt.toggle,()=>{i.value=!y(i),y(i)&&s()}),u=r.subscribe(mt.close,()=>{i.value=!1,l.value=null}),a=r.subscribe(mt.open,()=>{i.value=!0,l.value=null,s()}),f=r.subscribe(mt.openWithPanel,E=>{i.value=!0,l.value=E,s()}),d=r.subscribe(mt.setActivePanel,E=>{l.value=E});Gr(()=>{r.unsubscribe(mt.toggle,c),r.unsubscribe(mt.close,u),r.unsubscribe(mt.open,a),r.unsubscribe(mt.openWithPanel,f),r.unsubscribe(mt.setActivePanel,d)});const b=(E,w)=>{r.subscribe(mt.setActivePanel,R=>{E===R&&setTimeout(()=>{w(R)},100)})};return{isSideBarOpen:un(i),sideBarActivePanel:un(l),onPanelActive:b}},rn=e=>e,_b=e=>ie.ShareTypes.containsAnyValue(ie.ShareTypes.authenticated,e??[]),Ib=e=>ie.ShareTypes.containsAnyValue(ie.ShareTypes.unauthenticated,e??[]),kF=({isDirect:e})=>rn(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),NF=({isDirect:e})=>rn(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),$F=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:kF({isDirect:t}),label:rn("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Xe.publish(mt.openWithPanel,"sharing#peopleShares")}}),DF=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:NF({isDirect:t}),label:rn("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Xe.publish(mt.openWithPanel,"sharing#linkShares")}}),LF=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:rn("Item locked"),label:rn("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),BF=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:rn("Item in processing"),label:rn("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),Ro=({space:e,resource:t,ancestorMetaData:r,user:n})=>{const o=[];if(t.locked&&o.push(LF({resource:t})),t.processing&&o.push(BF({resource:t})),ie.isProjectSpaceResource(e)&&e.isMember(n)||ie.isPersonalSpaceResource(e)&&e.isOwner(n)){const s=Object.values(r).reduce((u,a)=>(u.push(...a.shareTypes||[]),u),[]),l=_b(t.shareTypes);(l||_b(s))&&o.push($F({resource:t,isDirect:l}));const c=Ib(t.shareTypes);(c||Ib(s))&&o.push(DF({resource:t,isDirect:c}))}return o},Cb=e=>new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>t(n.result),n.onerror=o=>r(o),n.readAsArrayBuffer(e)}),Fb=e=>new Promise(t=>e.toBlob(t)),it=Qe.defineStore("messages",()=>{const e=ue([]),t=i=>{const s={...i,id:Qt.v4()};return e.value.push(s),s},r=i=>{const s=l=>{var c,u;return(u=(c=l.response)==null?void 0:c.headers)==null?void 0:u.get("x-request-id")};return i.map(l=>s(l)).filter(l=>l!==null).map(l=>`X-Request-Id: ${l}`).join(`\r
56
- `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:Qt.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:r(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=y(e).filter(({id:s})=>i.id!==s)}}}),_o=Qe.defineStore("clipboard",()=>{const{$gettext:e}=Ne.useGettext(),{showMessage:t}=it(),r=ue(),n=ue([]);return{action:r,resources:n,copyResources:l=>{l[0].canDownload()&&(r.value=ti.Copy,n.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0].canDownload()&&(r.value=ti.Cut,n.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{r.value=void 0,n.value=[]}}}),Pb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},at=Qe.defineStore("config",()=>{const e=Zr(),t=ue(""),r=ue(""),n=ue({...Pb}),o=ue([]),i=ue([]),s=ue([]),l=ue(),c=ue(),u=ue(),a=ue([]),f=ue([]),d=V(()=>ie.urlJoin(y(t)||window.location.origin,{trailingSlash:!0})),b=V(()=>!!y(l)),E=V(()=>!!y(c));return{options:n,oAuth2:l,openIdConnect:c,isOAuth2:b,isOIDC:E,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:r,scripts:a,styles:f,serverUrl:d,loadConfig:R=>{var S;R.server&&(t.value=(S=R.server)!=null&&S.endsWith("/")?R.server:R.server+"/"),o.value=R.apps||[],s.value=R.customTranslations||[],l.value=R.auth,c.value=R.openIdConnect,u.value=R.sentry,a.value=R.scripts||[],f.value=R.styles||[],r.value=R.theme,R.options&&(n.value=co({...Pb},R.options),y(n).ocm.openRemotely=y(n).cernFeatures,y(n).routing.idBased=!y(n).cernFeatures,y(n).routing.fullShareOwnerPaths=y(n).cernFeatures),R.external_apps&&(i.value=R.external_apps,R.external_apps.filter(Boolean).forEach(m=>{e.loadExternalAppConfig({appId:m.id,config:m.config})}))}}}),MF=ye.z.object({url:ye.z.string()}),jF=ye.z.object({apiUrl:ye.z.string().optional(),authUrl:ye.z.string().optional(),clientId:ye.z.string().optional(),clientSecret:ye.z.string().optional(),logoutUrl:ye.z.string().optional(),metaDataUrl:ye.z.string().optional(),url:ye.z.string().optional()}),UF=ye.z.object({authority:ye.z.string().optional(),client_id:ye.z.string().optional(),client_secret:ye.z.string().optional(),dynamic:ye.z.string().optional(),metadata_url:ye.z.string().optional(),post_logout_redirect_uri:ye.z.string().optional(),response_type:ye.z.string().optional(),scope:ye.z.string().optional()}).passthrough(),qF=ye.z.record(ye.z.any()),VF=ye.z.object({href:ye.z.string().optional()}),zF=ye.z.object({async:ye.z.boolean().optional(),src:ye.z.string().optional()}),WF=ye.z.object({cernFeatures:ye.z.boolean().optional(),concurrentRequests:ye.z.object({resourceBatchActions:ye.z.number().optional(),sse:ye.z.number().optional(),shares:ye.z.object({create:ye.z.number().optional(),list:ye.z.number().optional()}).optional()}).optional(),contextHelpers:ye.z.boolean().optional(),contextHelpersReadMore:ye.z.boolean().optional(),defaultExtension:ye.z.string().optional(),disabledExtensions:ye.z.array(ye.z.string()).optional(),disableFeedbackLink:ye.z.boolean().optional(),accountEditLink:ye.z.object({href:ye.z.string().optional()}).optional(),editor:ye.z.object({autosaveEnabled:ye.z.boolean().optional(),autosaveInterval:ye.z.number().optional(),openAsPreview:ye.z.union([ye.z.boolean(),ye.z.array(ye.z.string())]).optional()}).optional(),embed:ye.z.object({enabled:ye.z.boolean().optional(),target:ye.z.string().optional(),messagesOrigin:ye.z.string().optional(),delegateAuthentication:ye.z.boolean().optional(),delegateAuthenticationOrigin:ye.z.string().optional(),fileTypes:ye.z.array(ye.z.string()).optional(),chooseFileName:ye.z.boolean().optional(),chooseFileNameSuggestion:ye.z.string().optional()}).optional(),feedbackLink:ye.z.object({ariaLabel:ye.z.string().optional(),description:ye.z.string().optional(),href:ye.z.string().optional()}).optional(),isRunningOnEos:ye.z.boolean().optional(),loginUrl:ye.z.string().optional(),logoutUrl:ye.z.string().optional(),ocm:ye.z.object({openRemotely:ye.z.boolean().optional()}).optional(),routing:ye.z.object({fullShareOwnerPaths:ye.z.boolean().optional(),idBased:ye.z.boolean().optional()}).optional(),runningOnEos:ye.z.boolean().optional(),tokenStorageLocal:ye.z.boolean().optional(),upload:ye.z.object({companionUrl:ye.z.string().optional()}).optional(),userListRequiresFilter:ye.z.boolean().optional(),hideLogo:ye.z.boolean().optional()}),HF=ye.z.object({id:ye.z.string(),path:ye.z.string(),config:ye.z.record(ye.z.unknown()).optional()}),GF=ye.z.object({server:ye.z.string(),theme:ye.z.string(),options:WF,apps:ye.z.array(ye.z.string()).optional(),external_apps:ye.z.array(HF).optional(),customTranslations:ye.z.array(MF).optional(),auth:jF.optional(),openIdConnect:UF.optional(),sentry:qF.optional(),scripts:ye.z.array(zF).optional(),styles:ye.z.array(VF).optional()}),xb=Qe.defineStore("extensionPreferences",()=>{const e=Mn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(y(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Di=Qe.defineStore("extensionRegistry",()=>{const e=at(),t=ue([]),r=u=>{t.value.push(u)},n=u=>{t.value=y(t).map(a=>ue(y(a).filter(({id:f})=>!u.includes(f)))).filter(a=>y(a).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return y(t).flatMap(a=>y(a).filter(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=ue([]);return{extensions:t,registerExtensions:r,unregisterExtensions:n,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=y(i).map(a=>ue(y(a).filter(({id:f})=>!u.includes(f)))).filter(a=>y(a).length)},getExtensionPoints:(u={})=>y(i).flatMap(a=>y(a).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),yt=Qe.defineStore("modals",()=>{const e=ue([]),t=V(()=>y(e).at(-1)),r=c=>y(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:Qt.v4()};return e.value.push(u),u},updateModal:(c,u,a)=>{const f=r(c);f[u]=a},removeModal:c=>{e.value=y(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=y(e).findIndex(f=>f.id===c);if(u<0)return;const a=r(c);y(e).splice(u,1),e.value.push(a)}}}),bt=Qe.defineStore("user",()=>{const e=ue();return{user:e,setUser:n=>{e.value=n,H0.setUser({username:n.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Ob=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},kb="thead-clicked",Nb="highlight",$b="rowMounted",Db="contextmenuClicked",wf="itemDropped",Lb="itemDragged",KF="sort",QF=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"],XF={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function ii(e){return XF[e]}const Bb=ye.z.object({name:ye.z.string().optional(),slogan:ye.z.string().optional(),logo:ye.z.string().optional(),urls:ye.z.object({accessDeniedHelp:ye.z.string(),imprint:ye.z.string(),privacy:ye.z.string()}).optional(),shareRoles:ye.z.record(ye.z.string(),ye.z.object({iconName:ye.z.string()})).optional()}),YF=ye.z.object({breakpoints:ye.z.record(ye.z.string()).optional(),colorPalette:ye.z.record(ye.z.string()).optional(),fontFamily:ye.z.string().optional(),fontSizes:ye.z.record(ye.z.string()).optional(),sizes:ye.z.record(ye.z.string()).optional(),spacing:ye.z.record(ye.z.string()).optional()}),Mb=Bb.extend({designTokens:YF.optional(),favicon:ye.z.string().optional(),background:ye.z.string().optional()}),JF=Mb.extend({isDark:ye.z.boolean(),label:ye.z.string()}),jb=ye.z.object({defaults:Mb,themes:ye.z.array(JF)}),ZF=ye.z.object({common:Bb.optional(),clients:ye.z.object({web:jb})}),eP="oc_currentThemeName",oi=Qe.defineStore("theme",()=>{const e=Mn.useLocalStorage(eP,null),t=Mn.usePreferredDark(),r=ue(),n=ue([]),o=a=>{const f=ad(a.common,a.clients.web.defaults);n.value=a.clients.web.themes.map(d=>ad(f,d)),i()},i=()=>{const a=y(n).find(d=>!d.isDark),f=y(n).find(d=>d.isDark);c(y(n).find(d=>d.name===y(e))||(y(t)?f:a)||y(n)[0],!1)},s=()=>{e.value=null,i()},l=V(()=>e.value===null),c=(a,f=!0)=>{r.value=a,f&&(e.value=y(r).name);const d=[{name:"breakpoints",prefix:"breakpoint"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Ob("font-family",y(r).designTokens.fontFamily),d.forEach(b=>{for(const E in y(r).designTokens[b.name])Ob(`${b.prefix}-${E}`,y(r).designTokens[b.name][E])})};return{availableThemes:n,currentTheme:r,initializeThemes:o,setAndApplyTheme:c,setAutoSystemTheme:s,isCurrentThemeAutoSystem:l,getRoleIcon:a=>{var f;return((f=y(r).shareRoles[a.id])==null?void 0:f.iconName)||"user"}}}),Mt=Qe.defineStore("shares",()=>{const e=Ke(),{getRoleIcon:t}=oi(),r=ue(!1),n=ue([]),o=ue([]),i=ue({}),s=C=>{i.value=C.reduce((I,L)=>(I[L.id]={...L,icon:t(L)},I),{})},l=C=>{const I=y(n).find(({id:L})=>L===C.id);if(I){Object.assign(I,C);return}y(n).push(C)},c=C=>{n.value=C},u=C=>{y(n).push(...C)},a=C=>{n.value=y(n).filter(({id:I})=>I!==C.id)},f=()=>{n.value=[],o.value=[],r.value=void 0},d=()=>{const C=Object.values(e.ancestorMetaData).map(({id:I})=>I);if(!C.length){n.value=[],o.value=[];return}y(n).forEach(I=>{C.includes(I.resourceId)||a(I)}),y(o).forEach(I=>{C.includes(I.resourceId)||w(I)})},b=C=>{o.value=C},E=C=>{const I=y(o).find(({id:L})=>L===C.id);if(I){Object.assign(I,C);return}y(o).push(C)},w=C=>{o.value=y(o).filter(({id:I})=>I!==C.id)},R=C=>{r.value=C},S=C=>{const I=D=>{const H=new Set;return D.forEach(ee=>{H.add(ee.shareType)}),Array.from(H)},L=[...e.resources,e.currentFolder].find(D=>(D==null?void 0:D.id)===C);if(!L||ie.isProjectSpaceResource(L))return;const B=[...y(n),...y(o)];e.updateResourceField({id:L.id,field:"shareTypes",value:I(B.filter(D=>!D.indirect))});const $=e.getAncestorById(C);$&&e.updateAncestorField({path:$.path,field:"shareTypes",value:I(B.filter(D=>!D.indirect))})};return{loading:r,collaboratorShares:n,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:R,setCollaboratorShares:c,setLinkShares:b,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:C,space:I,resource:L,options:B})=>{const D=await C.graphAuthenticated.permissions.createInvite(I.id,L.id,B,y(i));return u([D]),S(L.id),e.loadIndicators(I,L.id),D},updateShare:async({clientService:C,space:I,resource:L,collaboratorShare:B,options:$})=>{const D=C.graphAuthenticated.permissions,H={roles:$.roles,expirationDateTime:$.expirationDateTime},ee=await D.updatePermission(I.id,L.id,B.id,H,y(i));return l(ee),ee},deleteShare:async({clientService:C,space:I,resource:L,collaboratorShare:B,loadIndicators:$=!1})=>{await C.graphAuthenticated.permissions.deletePermission(I.id,L.id,B.id),a(B),S(L.id),$&&e.loadIndicators(I,L.id)},addLink:async({clientService:C,space:I,resource:L,options:B})=>{const D=await C.graphAuthenticated.permissions.createLink(I.id,L.id,B),H=e.selectedResources,ee=H.some(({fileId:J})=>J===L.fileId)||H.length===0&&e.currentFolder.fileId===L.fileId;if(E(D),S(L.id),!ee){const J=e.ancestorMetaData[L.path]??null;if(J){const{shareTypes:ce}=J;ce.includes(ie.ShareTypes.link.value)||e.updateAncestorField({path:J.path,field:"shareTypes",value:[...ce,ie.ShareTypes.link.value]})}}return e.loadIndicators(I,L.id),D},updateLink:async({clientService:C,space:I,resource:L,linkShare:B,options:$})=>{const D=C.graphAuthenticated.permissions;let H;if(Object.hasOwn($,"password"))H=await D.setPermissionPassword(I.id,L.id,B.id,{password:$.password}),B.hasPassword=!!$.password;else{const ee={link:{...$.type&&{type:$.type},...$.displayName&&{"@libre.graph.displayName":$.displayName}},...Object.hasOwn($,"expirationDateTime")&&{expirationDateTime:$.expirationDateTime}};H=await D.updatePermission(I.id,L.id,B.id,ee)}return E(H),H},deleteLink:async({clientService:C,space:I,resource:L,linkShare:B,loadIndicators:$=!1})=>{await C.graphAuthenticated.permissions.deletePermission(I.id,L.id,B.id),w(B),S(L.id),$&&e.loadIndicators(I,L.id)}}}),Ub=e=>e.sort((t,r)=>r.permissions.length-t.permissions.length),Io=async({graphClient:e,driveType:t,configStore:r,graphRoles:n,signal:o})=>{var c;const i=await e.drives.listMyDrives(n,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((c=r.options.routing)!=null&&c.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:a,driveAlias:f}=u.root.remoteItem;s[a]=f});const l=Object.entries(s).map(([u,a])=>ie.buildSpace({id:ie.extractStorageId(u),name:a,driveType:a.split("/")[0],driveAlias:a,path:"/",serverUrl:r.serverUrl},n));return[...i,...l]},dt=Qe.defineStore("spaces",()=>{const e=bt(),t=at(),r=Mt(),n=ue([]),o=ue(),i=ue(!1),s=ue(!1),l=ue(!1),c=V(()=>y(n).find(C=>ie.isPersonalSpaceResource(C)&&C.isOwner(e.user))),u=C=>{i.value=C},a=C=>{s.value=C},f=C=>{l.value=C},d=C=>{o.value=C},b=C=>{if(!ie.isProjectSpaceResource(C))return[];const I=r.collaboratorShares.filter(L=>L.resourceId===C.id);return Ub(I)},E=C=>{y(n).push(...C)},w=C=>{n.value=y(n).filter(({id:I})=>I!==C.id)},R=C=>y(n).find(I=>C==I.id),S=async({graphClient:C,space:I,signal:L})=>(await A({graphClient:C,signal:L}),y(n).find(B=>{var $,D;return ie.isMountPointSpaceResource(B)&&((D=($=B.root)==null?void 0:$.remoteItem)==null?void 0:D.id)===I.id})),m=({driveAliasPrefix:C,id:I,shareName:L})=>{const B=ie.buildShareSpaceResource({driveAliasPrefix:C,id:I,shareName:L,serverUrl:t.serverUrl});return E([B]),B},g=C=>{const I=y(n).find(({id:L})=>L===C.id);if(I){Object.assign(I,C);return}E([C])},v=({id:C,field:I,value:L})=>{const B=y(n).find($=>C===$.id);B&&(B[I]=L)},T=async({graphClient:C})=>{l.value=!0;try{const[I,L]=await Promise.all([Io({graphClient:C,driveType:"personal",configStore:t,graphRoles:r.graphRoles}),Io({graphClient:C,driveType:"project",configStore:t,graphRoles:r.graphRoles})]);E([...I,...L]),i.value=!0}finally{l.value=!1}},A=async({graphClient:C,signal:I})=>{if(!y(s))try{const L=await Io({graphClient:C,driveType:"mountpoint",configStore:t,graphRoles:r.graphRoles,signal:I});E(L)}finally{s.value=!0}};return{spaces:n,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:l,currentSpace:o,personalSpace:c,getSpace:R,createShareSpace:m,setSpacesInitialized:u,setMountPointsInitialized:a,setSpacesLoading:f,setCurrentSpace:d,getSpaceMembers:b,getMountPointForSpace:S,addSpaces:E,removeSpace:w,upsertSpace:g,updateSpaceField:v,loadSpaces:T,loadMountPoints:A,reloadProjectSpaces:async({graphClient:C,signal:I})=>{const L=await Io({graphClient:C,driveType:"project",configStore:t,graphRoles:r.graphRoles,signal:I});n.value=y(n).filter(B=>!ie.isProjectSpaceResource(B)),E(L)}}}),Ke=Qe.defineStore("resources",()=>{const e=at(),t=dt(),r=bt(),n=ue([]),o=ue(),i=ue({}),s=ue([]),l=V(()=>{let oe=y(n);return y($)||(oe=oe.filter(Q=>!Q.name.startsWith("."))),oe}),c=V(()=>{const oe=y(n).filter(({type:W})=>W==="file").length,Q=y(n).filter(({type:W,name:U})=>W==="file"&&U.startsWith(".")).length,x=y(n).filter(({type:W})=>W==="folder").length,k=y(n).filter(({type:W,name:U})=>W==="folder"&&U.startsWith(".")).length,X=y(n).filter(ie.isProjectSpaceResource).length;return{files:oe,hiddenFiles:Q,folders:x,hiddenFolders:k,spaces:X}}),u=oe=>{n.value=oe},a=oe=>{n.value=y(n).filter(Q=>!oe.find(({id:x})=>x===Q.id))},f=()=>{n.value=[]},d=oe=>{const Q=y(n).find(({id:x})=>x===oe.id);if(Q){Object.assign(Q,oe);return}y(n).push(oe)},b=oe=>{const Q=y(n).filter(x=>!oe.some(k=>k.path===x.path));n.value=[...Q,...oe]},E=({id:oe,field:Q,value:x})=>{const k=y(n).find(X=>oe===X.id);k&&(k[Q]=x)},w=oe=>{o.value=oe},R=()=>{o.value=void 0},S=oe=>{n.value=oe.resources,o.value=oe.currentFolder},m=()=>{n.value=[],o.value=void 0,g.value=[]},g=ue([]),v=ue(null),T=V(()=>y(n).filter(oe=>y(g).includes(oe.id))),A=oe=>{const Q=oe.find(x=>!y(g).includes(x));Q&&(v.value=Q),g.value=oe},F=oe=>{v.value=oe,y(g).includes(oe)||y(g).push(oe)},C=oe=>{v.value=oe,y(g).includes(oe)&&(g.value=y(g).filter(Q=>Q!==oe))},I=oe=>{y(g).includes(oe)?C(oe):F(oe)},L=()=>{g.value=[]},B=oe=>{v.value=oe},$=ue(!0),D=ue(!0),H=ue(!1),ee=oe=>{$.value=oe,window.localStorage.setItem("oc_hiddenFilesShown",oe.toString())},J=oe=>{D.value=oe,window.localStorage.setItem("oc_fileExtensionsShown",oe.toString())},ce=oe=>{H.value=oe,window.localStorage.setItem("oc_webDavDetailsShown",oe.toString())},be=(oe,Q)=>{const x=y(n).filter(k=>[k.id,k.parentFolderId].includes(Q));for(const k of x){const X=Ro({space:oe,resource:k,ancestorMetaData:y(i),user:r.user});!X.length&&!k.indicators.length||E({id:k.id,field:"indicators",value:X})}},de=oe=>{i.value=oe};return{resources:n,currentFolder:o,activeResources:l,totalResourcesCount:c,setResources:u,removeResources:a,clearResources:f,upsertResource:d,upsertResources:b,updateResourceField:E,setCurrentFolder:w,clearCurrentFolder:R,initResourceList:S,clearResourceList:m,selectedIds:g,latestSelectedId:v,selectedResources:T,setSelection:A,addSelection:F,removeSelection:C,toggleSelection:I,resetSelection:L,setLastSelectedId:B,areHiddenFilesShown:$,areFileExtensionsShown:D,areWebDavDetailsShown:H,setAreHiddenFilesShown:ee,setAreFileExtensionsShown:J,setAreWebDavDetailsShown:ce,loadIndicators:be,ancestorMetaData:i,setAncestorMetaData:de,updateAncestorField:({path:oe,field:Q,value:x})=>{const k=y(i)[oe]??null;k&&(k[Q]=x)},loadAncestorMetaData:({folder:oe,space:Q,client:x,signal:k})=>{const X={[oe.path]:{id:oe.fileId,shareTypes:oe.shareTypes,parentFolderId:oe.parentFolderId,spaceId:Q.id,path:oe.path}},W=[],U=[Ve.FileId,Ve.ShareTypes,Ve.FileParent],z=Ab(oe.path),fe=t.spaces,_e=()=>fe.filter(Fe=>ie.isMountPointSpaceResource(Fe)&&ie.extractStorageId(Fe.root.remoteItem.rootId)===Q.id);let Be=!0;if(e.options.routing.fullShareOwnerPaths){const Fe=fe.find(Pe=>ie.isProjectSpaceResource(Pe)&&Pe.id===Q.id);Be=Q.isOwner(r.user)||(Fe==null?void 0:Fe.isMember(r.user))}for(const Fe of z){const Pe=y(i)[Fe]??null;if((Pe==null?void 0:Pe.spaceId)===Q.id){X[Fe]=Pe;continue}if(!Be&&!_e().find(je=>Fe.startsWith(je.root.remoteItem.path)))break;W.push(x.listFiles(Q,{path:Fe},{depth:0,davProperties:U,signal:k}).then(({resource:je})=>{X[Fe]={id:je.fileId,shareTypes:je.shareTypes,parentFolderId:je.parentFolderId,spaceId:Q.id,path:Fe}}))}return Promise.all(W).then(()=>{if(!Object.keys(X).includes("/")){const Fe=y(i)["/"];if((Fe==null?void 0:Fe.spaceId)===Q.id)X["/"]=Fe;else{const{parentFolderId:Pe}=Object.values(X)[0],je=t.spaces.find(({id:te})=>Pe.startsWith(te));je&&(X["/"]={id:je.id,shareTypes:je.shareTypes,parentFolderId:je.id,spaceId:je.id,path:"/"})}}de(X)})},getAncestorById:oe=>Object.values(y(i)).find(Q=>oe===Q.id),deleteQueue:s,addResourcesIntoDeleteQueue:oe=>{s.value=s.value.concat(oe.filter(Q=>!y(s).includes(Q)))},removeResourcesFromDeleteQueue:oe=>{s.value=s.value.filter(Q=>!oe.includes(Q))}}}),Co=Qe.defineStore("webWorkers",()=>{const e=ue([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const l=Qt.v4(),c=Mn.useWebWorker(i,{type:"module",name:l}),u={id:l,needsTokenRenewal:s,...c};return y(e).push(u),u},terminateWorker:i=>{const s=y(e).find(l=>i===l.id);s&&(s.terminate(),e.value=y(e).filter(l=>i!==l.id))},terminateAllWorkers:()=>{y(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{y(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),Ks=(e={})=>{const t=e.router||We(),r=e.configStore||at();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:l})=>{var u;if(!((u=r.options.routing)!=null&&u.idBased)||s===i.path&&l===i.fileId)return!1;const c=Jr(o,i,{configStore:r});return t.replace(c),!0}}},Qs=()=>{const e=Jt();return V(()=>y(e).name)},qb=(e,t)=>{const r=Jt();return V(()=>y(r).meta[e]||t)},Xs=(e,t)=>{const r=We();return V({get(){return St(y(r.currentRoute).params[e])||t},async set(n){y(r.currentRoute).params[e]!==n&&await r.replace({params:{...y(r.currentRoute).params,[e]:n}})}})};let Vb=Promise.resolve();const rr=(e,t)=>{const r=We();return V({get(){return y(r.currentRoute).query[e]||t},set(n){if(y(r.currentRoute).query[e]===n)return;Vb=Vb.then(async()=>{try{await r.replace({path:y(r.currentRoute).path,query:{...y(r.currentRoute).query,[e]:n}})}catch{}})}})},wn=e=>{const t=rr(e.name),r=vf(tP(e));return Et(()=>y(t)?{value:y(t),source:"route"}:y(r)?{value:y(r),source:"storage"}:{value:e.defaultValue,source:"default"},n=>{["route","default"].includes(n.source)&&(r.value=n.value===e.defaultValue?void 0:St(n.value)),["storage","default"].includes(n.source)&&(t.value=n.value)},{immediate:!0}),t},tP=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),xn=(e,...t)=>{const r=ue(!1),n=We(),o=Jt();return Et(o,()=>{r.value=e(n,...t)},{immediate:!0}),r},Ys="contextRouteName",Sf="contextRouteParams",Ef="contextRouteQuery",Js=e=>{var i;const{params:t,query:r}=e,n={},o=["fileId","shareId","q_share-visibility"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)n[s]=r[s];return{[Ys]:e.name,[Sf]:t,[Ef]:n}},zb=e=>({routeName:St(e[Ys]),routeParams:e[Sf],routeQuery:e[Ef]}),St=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function Wb({router:e,currentFileContext:t}){const r=l=>{const{fileName:c,routeName:u,routeParams:a,routeQuery:f}=y(l);return y(u)?e.push({name:y(u),params:y(a),query:{...y(f),scrollTo:y(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:n}=Ks({router:e}),o=(l,c)=>{const u=y(l);return n({space:y(u.space),resource:c,path:y(u.item),fileId:y(u.itemId)})},i=ue(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,r(t)),closed:i}}const Je=()=>yn("$clientService");function Tf({clientService:e}){e=e||Je();const t=tr(),r=bt();return{getUrlForResource:(c,u,a)=>{var f;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=r.user)==null?void 0:f.onPremisesSamAccountName,...a})},revokeUrl:c=>e.webdav.revokeUrl(c),getFileContents:(c,u)=>e.webdav.getFileContents(y(y(c).space),{path:y(y(c).item)},{...u}),getFileInfo:(c,u={})=>e.webdav.getFileInfo(y(y(c).space),{path:y(y(c).item),fileId:y(y(c).itemId)},u),putFileContents:(c,u)=>e.webdav.putFileContents(y(y(c).space),{path:y(y(c).item),...u})}}const Af=()=>yn("$authService");class Sn{}Ee(Sn,"allFiles","all-files"),Ee(Sn,"currentFolder","current-folder");const Rf=()=>{const e=at(),t=Je(),r=dt(),n=Ke(),o=tr(),i=V(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=V(()=>n.areHiddenFilesShown),l=V(()=>r.spaces.filter(ie.isProjectSpaceResource)),c=d=>y(l).find(b=>b.id===d),u=cr.useTask(function*(d,b,E=null){if(e.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!b)return{totalResults:null,values:[]};const{resources:w,totalResults:R}=yield*ie.call(t.webdav.search(b,{searchLimit:E,davProperties:Es.Default,signal:d}));return{totalResults:R,values:w.map(S=>{const m=c(S.parentFolderId),g=m||S;return e.options.routing.fullShareOwnerPaths&&g.remoteItemPath&&(g.path=ie.urlJoin(g.remoteItemPath,g.path)),{id:g.id,data:g}}).filter(({data:S})=>!S.name.startsWith(".")||y(s))}}).restartable();return{search:async(d,b=null)=>await u.perform(d,b),buildSearchTerm:({term:d,isTitleOnlySearch:b,tags:E,lastModified:w,mediaType:R,scope:S,useScope:m})=>{const g=[],v=d,T=y(i)&&!b;if(v){let A=`name:"*${v}*"`;T&&(A=`(name:"*${v}*" OR content:"${v}")`),g.push(A)}if(m&&S&&g.push(`scope:${S}`),E){const A=E.split("+").map(F=>`"${F}"`);g.push(`tag:(${A.join(" OR ")})`)}if(w&&g.push(`mtime:${w}`),R){const A=R.split("+").map(F=>`"${F}"`);g.push(`mediatype:(${A.join(" OR ")})`)}return g.sort((A,F)=>Number(A.startsWith("scope:"))-Number(F.startsWith("scope:"))).join(" AND ")}}};function Hb({currentRoute:e,clientService:t}){const r=ue(!1),{webdav:n}=t,{replaceInvalidFileRoute:o}=Ks(),{getFileInfo:i}=Tf({clientService:t}),s=Af(),l=dt(),{buildSearchTerm:c,search:u}=Rf(),a=rr("contextRouteQuery"),f=Ke(),{activeResources:d}=Qe.storeToRefs(f);return{isFolderLoading:r,loadFolderForFileContext:async E=>{var w,R;r.value=!0;try{if(E=y(E),(w=y(a))!=null&&w.term){const C=c({term:(R=y(a))==null?void 0:R.term}),{values:I}=await u(C,200),L=I.filter(({data:B})=>ie.isSearchResource(B)).map(B=>B.data);f.initResourceList({currentFolder:null,resources:L}),r.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(y(E.routeName))){await Xy.getTask().perform(),r.value=!1;return}f.clearResourceList();const m=y(E.space),g=await i(E,{davProperties:[Ve.FileId]});if(o({space:m,resource:g,path:y(E.item),fileId:y(E.itemId)}),l.spaces.some(C=>{var I;return ie.isMountPointSpaceResource(C)&&((I=C.root.remoteItem)==null?void 0:I.id)===g.id})){const C=await i(E);f.initResourceList({currentFolder:C,resources:[C]}),r.value=!1;return}const T=ht.dirname(g.path),{resource:A,children:F}=await n.listFiles(m,{path:T});A.type==="file"?f.initResourceList({currentFolder:A,resources:[A]}):f.initResourceList({currentFolder:A,resources:F})}catch(S){if(S.statusCode===401)return s.handleAuthError(y(e));f.setCurrentFolder(null),console.error(S)}r.value=!1},activeFiles:d}}function _f({appsStore:e,applicationId:t}){return{applicationMeta:V(()=>{const n=e.apps[t];if(!n)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return n||{}})}}const Fo=()=>Xe;function Gb({titleSegments:e,eventBus:t}){const r=oi(),{currentTheme:n}=Qe.storeToRefs(r);t=t||Fo(),Et(e,o=>{const i=y(o),s=" - ",l={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,y(n).name].join(s)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function rP({appsStore:e,applicationId:t,applicationName:r,currentFileContext:n,currentRoute:o}){const i=_f({applicationId:t,appsStore:e}),{$gettext:s}=Ne.useGettext(),l=V(()=>{var a,f,d;const c=ht.basename(y((a=y(n))==null?void 0:a.fileName))||s(((d=(f=y(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=y(y(i).applicationMeta);return[c,y(r)||u.name||u.id].filter(Boolean)});Gb({titleSegments:l})}function Kb(e={}){const t=e.clientService??Je(),r=e.authStore??Yn();return{makeRequest:(o,i,s={})=>{const l=r.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},r.publicLinkContextReady&&(r.publicLinkPassword&&(s.headers.Authorization="Basic "+po.from(["public",r.publicLinkPassword].join(":")).toString("base64")),r.publicLinkToken&&(s.headers["public-token"]=r.publicLinkToken)),s.method=o,s.url=i,l.request(s)}}}const Qb=()=>{const e=dt();return{areSpacesLoading:V(()=>!e.spacesInitialized||e.spacesLoading)}},Xb=(e={})=>{const t=dt(),{areSpacesLoading:r}=Qb(),n=rr("shareId"),o=rr("fileId"),i=V(()=>St(y(o))),s=at(),l=Je(),c=V(()=>t.spaces),u=ue(null),a=ue(null),f=ue(!1),d=b=>{const E=b.split("/");return y(c).find(w=>{if(!b.startsWith(w.driveAlias))return!1;const R=w.driveAlias.split("/");return E.length<R.length||E.slice(0,R.length).join("/")!==w.driveAlias?!1:w})};return za(()=>{const b=y(e.driveAliasAndItem);!(b!=null&&b.startsWith("personal/"))&&!(b!=null&&b.startsWith("project/"))&&t.setCurrentSpace(null)}),Et([e.driveAliasAndItem,r],async([b,E],[w,R])=>{if(b===w&&E===R)return;if(!b||b.startsWith("virtual/")){u.value=null,a.value=null;return}if(y(u)&&b.startsWith(y(u).driveAlias)){a.value=ie.urlJoin(b.slice(y(u).driveAlias.length),{leadingSlash:!0});return}let m=null,g=null;if(b.startsWith("public/")||b.startsWith("ocm/")){const[v,...T]=b.split("/").slice(1);m=y(c).find(A=>A.id===v),g=T.join("/")}else if(b.startsWith("share/")||b.startsWith("ocm-share/")){const[v,...T]=b.split("/").slice(1),A=b.startsWith("ocm-share/")?"ocm-share":"share";let F=St(y(n));F!=null&&F.includes(":")&&(F=[ie.SHARE_JAIL_ID,F].join("!")),m=t.getSpace(F)||t.createShareSpace({driveAliasPrefix:A,id:F,shareName:y(v)}),g=T.join("/")}else y(i)?m=y(c).find(v=>y(i).startsWith(`${v.fileId}`)):m=d(b),m||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),m=d(b)),m&&(g=b.slice(m.driveAlias.length));u.value=m,a.value=ie.urlJoin(g,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),Et(u,b=>{t.setCurrentSpace(b)},{immediate:!0}),{space:u,item:a,itemId:i,loading:f}};function Yb(e){const t=We(),r=Zr(),n=Jt(),o=e.clientService??Je(),i=e.applicationId,s=Yn(),{publicLinkContextReady:l}=Qe.storeToRefs(s),c=Xs("driveAliasAndItem"),{space:u,item:a,itemId:f,loading:d}=Xb({driveAliasAndItem:c}),b=V(()=>{if(y(d))return null;let E;return y(u)?E=ie.urlJoin(y(u).webDavPath,y(a)):E=ie.urlJoin(St(y(n).params.filePath)),{path:E,driveAliasAndItem:y(c),space:y(u),item:y(a),itemId:y(f),fileName:ht.basename(E),routeName:St(y(n).query[Ys]),...zb(y(n).query)}});return rP({appsStore:r,applicationId:i,applicationName:e.applicationName,currentFileContext:b,currentRoute:n}),{isPublicLinkContext:l,currentFileContext:b,...fh({appsStore:r,...e}),...Wb({router:t,currentFileContext:b}),...Tf({clientService:o}),...Hb({clientService:o,currentRoute:n}),...Kb({clientService:o,currentRoute:y(n)})}}const nP=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const r=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(r.path)||String(r.name)}" instead.`),r}}),iP=()=>[{path:"/list",redirect:e=>xr("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>xr("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:ie.urlJoin("personal/home",St(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ai("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>Or("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>Or("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>Or("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>_i("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Ri("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(nP),oP=(e,...t)=>{const[r,...n]=t.map(o=>{const i={"files-personal":xr("files-spaces-generic").name,"files-favorites":Ai("files-common-favorites").name,"files-shared-with-others":Or("files-shares-with-others").name,"files-shared-with-me":Or("files-shares-with-me").name,"files-trashbin ":_i("files-trash-generic").name,"files-public-list":Ri("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return vl(e,r,...n)},sP={name:"root",path:"/",redirect:e=>xr("files-spaces-generic",e)},aP=e=>[sP,...yT(e),...wT(e),...ST(e),...bT(e),...ET(e),...iP()],si=()=>{const{$gettext:e}=Ne.useGettext(),t=Je();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(o)?i(e(`Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)):i(null),getDefaultMetaFolder:async o=>{const{children:i}=await t.webdav.listFiles(o);return i.find(({name:s})=>s===".space")}}},ar=e=>{const t=bt(),r=dt(),n=at(),o=V(()=>r.spaces),i=Xs("driveAliasAndItem"),s=f=>y(e==null?void 0:e.space)||y(o).find(d=>d.id===f),l=f=>{var R,S,m,g,v;let d=f.storageId;((R=y(i))!=null&&R.startsWith("public/")||(S=y(i))!=null&&S.startsWith("ocm/"))&&(d=y(i).split("/")[1]);const b=s(d);if(b&&!ie.isMountPointSpaceResource(b))return b;const E=ie.isShareResource(f)&&f.shareTypes.includes(ie.ShareTypes.remote.value)||(m=f==null?void 0:f.id)!=null&&m.toString().startsWith(ie.OCM_PROVIDER_ID)?"ocm-share":"share";let w;return f.remoteItemPath?w=ht.basename(f.remoteItemPath):(g=y(i))!=null&&g.startsWith("share/")||(v=y(i))!=null&&v.startsWith("ocm-share/")?w=y(i).split("/")[1]:w=f.name,r.getSpace(f.remoteItemId)||r.createShareSpace({driveAliasPrefix:E,id:f.remoteItemId,shareName:w})},c=f=>y(o).filter(d=>ie.isMountPointSpaceResource(d)&&ie.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:l,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=r.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!n.options.routing.fullShareOwnerPaths)return!0;const b=y(o).find(w=>ie.isProjectSpaceResource(w)&&w.id===f.id);return f.isOwner(t.user)||(b==null?void 0:b.isMember(t.user))||c(f).some(w=>d.startsWith(w.root.remoteItem.path))}}},Li=()=>{const e=Je(),t=Ke(),r=Mt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},r.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var l;const s=await e.webdav.createFolder(i,{path:".space"});return ie.extractStorageId(s.parentFolderId)===((l=t.currentFolder)==null?void 0:l.id)&&t.upsertResource(s),s}}},lr=()=>yn("$loadingService"),Zs=()=>{const e=Yn(),t=Je(),r=Ne.useGettext();return{headers:V(()=>{const o=new Mh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":r.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Qt.v4(),...o.getHeaders()}})}};function lP(e){return new Worker("/assets/worker-oQBkmUkg.js",{name:e==null?void 0:e.name})}const Jb=({concurrentRequests:e=4}={})=>{const t=at(),r=lr(),{headers:n}=Zs(),{createWorker:o,terminateWorker:i}=Co(),s=({topic:c,space:u,resources:a},f)=>{const d=o(lP,{needsTokenRenewal:!0});let b;y(d.worker).onmessage=E=>{i(d.id),b==null||b(!0);const{successful:w,failed:R}=JSON.parse(E.data),S=R.map(({resource:m,...g})=>({resource:m,error:ie.createHttpError(g)}));f({successful:w,failed:S})},r.addTask(()=>new Promise(E=>{b=E})),d.post(l({topic:c,space:u,resources:a}))},l=({topic:c,space:u,resources:a})=>JSON.stringify({topic:c,data:{space:u,resources:a,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...y(n),"X-Request-ID":void 0}}});return{startWorker:s}};function cP(e){return new Worker("/assets/worker-BTxctNFM.js",{name:e==null?void 0:e.name})}const Zb=()=>{const e=at(),t=lr(),{headers:r}=Zs(),{createWorker:n,terminateWorker:o}=Co(),i=(l,c)=>{const u=n(cP,{needsTokenRenewal:!0});let a;y(u.worker).onmessage=f=>{o(u.id),a==null||a(!0);const{successful:d,failed:b}=JSON.parse(f.data),E=b.map(({resourceName:w,...R})=>({resourceName:w,error:ie.createHttpError(R)}));c({successful:d,failed:E})},t.addTask(()=>new Promise(f=>{a=f})),u.post(s(l))},s=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...y(r),"X-Request-ID":void 0}}});return{startWorker:i}};function uP(e){return new Worker("/assets/worker-DzSy5ndr.js",{name:e==null?void 0:e.name})}const ev=()=>{const e=at(),t=lr(),{headers:r}=Zs(),{createWorker:n,terminateWorker:o}=Co(),i=({space:l,resources:c,missingFolderPaths:u},a)=>{const f=n(uP,{needsTokenRenewal:!0});let d;y(f.worker).onmessage=b=>{o(f.id),d==null||d(!0);const{successful:E,failed:w}=JSON.parse(b.data),R=w.map(({resource:S,...m})=>({resource:S,error:ie.createHttpError(m)}));a({successful:E,failed:R})},t.addTask(()=>new Promise(b=>{d=b})),f.post(s({space:l,resources:c,missingFolderPaths:u}))},s=({space:l,resources:c,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:c,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...y(r),"X-Request-ID":void 0}}});return{startWorker:i}};function fP(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const dP=({authService:e})=>{const{createWorker:t}=Co(),r=ue();return{startWorker:()=>{r.value=t(fP),y(y(r).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof W0.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),y(r).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:l})=>{if(!y(r)){console.error("token timer worker is not running");return}y(r).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:l}))},resetTokenTimer:()=>{if(!y(r)){console.error("token timer worker is not running");return}y(r).post(JSON.stringify({topic:"reset"}))}}},tv=()=>{const e=at(),t=it(),r=We(),n=Ne.useGettext(),{getMatchingSpace:o}=ar(),{$gettext:i,$ngettext:s}=n,l=Je(),{dispatchModal:c}=yt(),u=dt(),a=Mt(),{startWorker:f}=Jb({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),d=Ke(),{currentFolder:b}=Qe.storeToRefs(d),E=ue([]),w=rr("page","1"),R=V(()=>parseInt(St(y(w)))),S=rr("items-per-page","1"),m=V(()=>parseInt(St(y(S)))),g=V(()=>Ep(y(E))),v=V(()=>{const I=y(g),L=I[0].type==="folder";let B=null;return I.length===1?(L?B=i('Permanently delete folder "%{name}"',{name:I[0].name},!0):B=i('Permanently delete file "%{name}"',{name:I[0].name},!0),B):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",I.length,{amount:I.length.toString()},!1)}),T=V(()=>{const I=y(g),L=I[0].type==="folder";return I.length===1?i(L?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),A=I=>{const L=y(r.currentRoute);f({topic:"trashBinDelete",space:I,resources:y(g)},({successful:B,failed:$})=>{var D,H;if(B.length){const ee=B.length===1&&y(g).length===1?i('"%{item}" was deleted successfully',{item:B[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",B.length,{itemCount:B.length.toString()},!0);t.showMessage({title:ee})}$.forEach(({resource:ee})=>{const J=i('Failed to delete "%{item}"',{item:ee.name});t.showErrorMessage({title:J,errors:[new Error]})}),L.name===y(r.currentRoute).name&&((D=L.query)==null?void 0:D.fileId)===((H=y(r.currentRoute).query)==null?void 0:H.fileId)&&(d.removeResources(B),d.resetSelection())})};return{displayDialog:(I,L)=>{E.value=[...L],c({variation:"danger",title:y(v),message:y(T),confirmText:i("Delete"),onConfirm:()=>A(I)})},filesList_delete:I=>{var $;E.value=[...I],d.addResourcesIntoDeleteQueue(y(E).map(({id:D})=>D)),y(E).forEach(({id:D})=>d.removeSelection(D));const L=y(I).reduce((D,H)=>{if(H.storageId in D)return D[H.storageId].resources.push(H),D;const ee=o(H);return ee.id in D||(D[ee.id]={space:ee,resources:[]}),D[ee.id].resources.push(H),D},{}),B=($=y(b))==null?void 0:$.id;return Object.values(L).map(({space:D,resources:H})=>{f({topic:"fileListDelete",space:D,resources:H},async({successful:ee,failed:J})=>{var ce;if(ee.length){const be=ee.length===1&&I.length===1?i('"%{item}" was moved to trash bin',{item:ee[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",ee.length,{itemCount:ee.length.toString()},!0);t.showMessage({title:be})}if(d.removeResourcesFromDeleteQueue(J.map(({resource:be})=>be.id)),d.removeResourcesFromDeleteQueue(ee.map(({id:be})=>be)),J.forEach(({error:be,resource:de})=>{let Se=i('Failed to delete "%{resource}"',{resource:de.name});be.statusCode===423&&(Se=i('Failed to delete "%{resource}" - the file is locked',{resource:de.name})),t.showErrorMessage({title:Se,errors:[be]})}),B===((ce=y(b))==null?void 0:ce.id)){d.removeResources(ee);const be=d.activeResources.length,de=Math.ceil(y(be)/y(m));y(R)>1&&y(R)>de&&(w.value=de.toString())}if(ct(r,"files-spaces-generic")&&!["public","share"].includes(D==null?void 0:D.driveType)){const de=await l.graphAuthenticated.drives.getDrive(y(I)[0].storageId,a.graphRoles);u.updateSpaceField({id:de.id,field:"spaceQuota",value:de.spaceQuota})}if(y(E).length&&to(y(E)[0],y(b)))return r.push(Jr(D,{path:ht.dirname(y(E)[0].path),fileId:y(E)[0].parentFolderId}))})})}}},pP=e=>e==="files",On=()=>{const e=Jt();return V(()=>pP(Rl(y(e))))};function hP(e,t,r,n){for(var o=-1,i=e==null?0:e.length;++o<i;)r=t(r,e[o],o,e);return r}function gP(e){return function(t){return e==null?void 0:e[t]}}var mP={À:"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"},yP=gP(mP),bP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vP="\\u0300-\\u036f",wP="\\ufe20-\\ufe2f",SP="\\u20d0-\\u20ff",EP=vP+wP+SP,TP="["+EP+"]",AP=RegExp(TP,"g");function RP(e){return e=Cl(e),e&&e.replace(bP,yP).replace(AP,"")}var _P=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function IP(e){return e.match(_P)||[]}var CP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function FP(e){return CP.test(e)}var rv="\\ud800-\\udfff",PP="\\u0300-\\u036f",xP="\\ufe20-\\ufe2f",OP="\\u20d0-\\u20ff",kP=PP+xP+OP,nv="\\u2700-\\u27bf",iv="a-z\\xdf-\\xf6\\xf8-\\xff",NP="\\xac\\xb1\\xd7\\xf7",$P="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",DP="\\u2000-\\u206f",LP=" \\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",ov="A-Z\\xc0-\\xd6\\xd8-\\xde",BP="\\ufe0e\\ufe0f",sv=NP+$P+DP+LP,av="['’]",lv="["+sv+"]",MP="["+kP+"]",cv="\\d+",jP="["+nv+"]",uv="["+iv+"]",fv="[^"+rv+sv+cv+nv+iv+ov+"]",UP="\\ud83c[\\udffb-\\udfff]",qP="(?:"+MP+"|"+UP+")",VP="[^"+rv+"]",dv="(?:\\ud83c[\\udde6-\\uddff]){2}",pv="[\\ud800-\\udbff][\\udc00-\\udfff]",Bi="["+ov+"]",zP="\\u200d",hv="(?:"+uv+"|"+fv+")",WP="(?:"+Bi+"|"+fv+")",gv="(?:"+av+"(?:d|ll|m|re|s|t|ve))?",mv="(?:"+av+"(?:D|LL|M|RE|S|T|VE))?",yv=qP+"?",bv="["+BP+"]?",HP="(?:"+zP+"(?:"+[VP,dv,pv].join("|")+")"+bv+yv+")*",GP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",KP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",QP=bv+yv+HP,XP="(?:"+[jP,dv,pv].join("|")+")"+QP,YP=RegExp([Bi+"?"+uv+"+"+gv+"(?="+[lv,Bi,"$"].join("|")+")",WP+"+"+mv+"(?="+[lv,Bi+hv,"$"].join("|")+")",Bi+"?"+hv+"+"+gv,Bi+"+"+mv,KP,GP,cv,XP].join("|"),"g");function JP(e){return e.match(YP)||[]}function ZP(e,t,r){return e=Cl(e),t=t,t===void 0?FP(e)?JP(e):IP(e):e.match(t)||[]}var ex="['’]",tx=RegExp(ex,"g");function rx(e){return function(t){return hP(ZP(RP(t).replace(tx,"")),e,"")}}var nx=rx(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()});function ix(e){return e==null}const ox="edit",sx="create",qr=()=>{const e=Zr(),t=We(),{$gettext:r}=Ne.useGettext(),n=ls(),{isEnabled:o}=ni(),{requestExtensions:i}=Di(),{openUrl:s}=Gv(),l=at(),{options:c}=Qe.storeToRefs(l),{actions:u}=ea(),{actions:a}=ta(),{actions:f}=ra(),{actions:d}=ia(),{actions:b}=na(),{actions:E}=oa(),{actions:w}=Po(),{actions:R}=Pf(),{actions:S}=sa(),{actions:m}=xf(),{actions:g}=aa(),{actions:v}=la(),{actions:T}=$f(),A=V(()=>[...y(E),...y(w),...y(d),...y(S),...y(f),...y(g),...y(T),...y(v),...y(u),...y(a),...y(b),...y(R),...y(m)]),F=V(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(ce=>ce.action)),C=V(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),I=V(()=>y(o)?[]:e.fileExtensions.map(J=>{const ce=e.apps[J.app];return{name:`editor-${J.app}`,label:()=>J.label?typeof J.label=="function"?J.label():J.label:r("Open in %{app}",{app:ce.name},!0),showOpenInNewTabHint:!0,icon:J.icon||ce.icon,...ce.iconFillType&&{iconFillType:ce.iconFillType},img:ce.img,route:({space:be,resources:de})=>L({appFileExtension:J,space:be,resource:de[0]}),handler:be=>$(J,be.space,be.resources[0]),isVisible:({resources:be})=>be.length!==1||!be[0].canDownload()&&!J.secureView||!y(n)&&Rr(t,"files-trash-generic")?!1:be[0].extension&&J.extension?be[0].extension.toLowerCase()===J.extension.toLowerCase():be[0].mimeType&&J.mimeType?be[0].mimeType.toLowerCase()===J.mimeType.toLowerCase()||be[0].mimeType.split("/")[0].toLowerCase()===J.mimeType.toLowerCase():!1,hasPriority:J.hasPriority,class:`oc-files-actions-${nx(ce.name).toLowerCase()}-trigger`}}).sort((J,ce)=>ce.hasPriority!==J.hasPriority&&ce.hasPriority?1:0)),L=({appFileExtension:J,space:ce,resource:be})=>{const de=ie.isShareSpaceResource(ce)?ce.id:void 0,Se=J.routeName||J.app,Ae=B(Se,ce,be,de);return t.resolve(Ae)},B=(J,ce,be,de,Se)=>({name:J,params:{driveAliasAndItem:ce==null?void 0:ce.getDriveAliasAndItem(be)},query:{...de&&{shareId:de},...be.fileId&&y(c).routing.idBased&&{fileId:be.fileId},...Se&&{templateId:Se},...Js(y(t.currentRoute))}}),$=(J,ce,be)=>{const de=ie.isShareSpaceResource(ce)?ce.id:void 0,Se=J.routeName||J.app,Ae=B(Se,ce,be,de);if(y(c).cernFeatures){const ne=t.resolve(Ae).href,ae=`${J.routeName}-${be.path}`;s(ne,ae,!0);return}t.push(Ae)},D=J=>{H(J).handler({...J})},H=J=>{const ce=ee(J);if(ce.length)return ce[0]},ee=J=>{const ce=Se=>Se.isVisible(J),be=[...y(F),...y(I)].filter(ce).sort((Se,Ae)=>Number(Ae.hasPriority)-Number(Se.hasPriority)),de=J.omitSystemActions?[]:y(A).filter(ce);return[...be,...de,...y(C).filter(Se=>Se.isVisible(J)&&(Se.category==="actions"||ix(Se.category)))]};return{editorActions:I,systemActions:A,getDefaultAction:H,getAllAvailableActions:ee,getEditorRouteOpts:B,openEditor:$,triggerDefaultAction:D}},ea=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=We(),{$gettext:n,$ngettext:o}=Ne.useGettext(),i=Je(),s=lr(),l=at(),c=Ke(),{updateResourceField:u}=c,a=async({resources:d})=>{const b=[],E=[],w=new Bn({concurrency:l.options.concurrentRequests.resourceBatchActions});if(d.forEach(R=>{E.push(w.add(async()=>{try{const{graphAuthenticated:S}=i;await S.driveItems.createDriveItem(R.driveId,{name:R.name,remoteItem:{id:R.fileId}}),u({id:R.id,field:"syncEnabled",value:!0})}catch(S){console.error(S),b.push(S)}}))}),await Promise.all(E),b.length===0){c.resetSelection(),ct(r,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:b})};return{actions:V(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>a(d)),label:()=>n("Enable sync"),isVisible:({space:d,resources:b})=>{var E;return!kt(r,"files-shares-with-me")&&!ct(r,"files-spaces-generic")||b.length===0||ct(r,"files-spaces-generic")&&(((E=y(d))==null?void 0:E.driveType)!=="share"||b.length>1||b[0].path!=="/")?!1:b.some(w=>!w.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},ta=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=We(),{$gettext:n}=Ne.useGettext(),o=Je(),i=lr(),s=at(),{updateResourceField:l,resetSelection:c}=Ke(),u=async({resources:f})=>{const d=[],b=[],E=new Bn({concurrency:s.options.concurrentRequests.resourceBatchActions}),w=!f[0].hidden;if(f.forEach(R=>{b.push(E.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(R.driveId,R.id,{"@UI.Hidden":w}),l({id:R.id,field:"hidden",value:w})}catch(S){console.error(S),d.push(S)}}))}),await Promise.all(b),d.length===0){c(),e({title:n(w?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:n(w?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:V(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?n("Unhide"):n("Hide"),isVisible:({resources:f})=>f.length===0?!1:kt(r,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},ra=()=>{const e=at(),t=We(),{copyResources:r}=_o(),n=Ne.useGettext(),{$gettext:o}=n,i=Ke(),{currentFolder:s}=Qe.storeToRefs(i),l=V(()=>window.navigator.platform.match("Mac")),c=V(()=>y(l)?o("⌘ + C"):o("Ctrl + C")),u=({resources:f})=>{Tt(t,"files-common-search")&&(f=f.filter(d=>!ie.isProjectSpaceResource(d))),r(f)};return{actions:V(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:y(c),label:()=>o("Copy"),isVisible:({resources:f})=>{var d,b;if(!ct(t,"files-spaces-generic")&&!Ar(t,"files-public-link")&&!Tt(t,"files-common-favorites")&&!Tt(t,"files-common-search")||ct(t,"files-spaces-projects")||f.length===0)return!1;if(Ar(t,"files-public-link"))return(d=y(s))==null?void 0:d.canCreate();if(Tt(t,"files-common-search")&&f.every(E=>ie.isProjectSpaceResource(E)))return!1;if(y(e.options.runningOnEos)){const E=((b=f[0].path)==null?void 0:b.split("/").filter(Boolean))||[];if(ct(t,"files-spaces-generic")&&E.length<5)return!1}return!!y(f)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},If=()=>({copyToClipboard:t=>{var r;if((r=navigator==null?void 0:navigator.clipboard)!=null&&r.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:n}=Mn.useClipboard({legacy:!0});return n(t)}}}),Cf=()=>{const{showMessage:e,showErrorMessage:t}=it(),{$gettext:r}=Ne.useGettext(),{copyToClipboard:n}=If(),o=async s=>{try{await n(s),e({title:r("The link has been copied to your clipboard.")})}catch(l){console.error(l),t({title:r("Copy link failed"),errors:[l]})}};return{actions:V(()=>[{name:"copy-permanent-link",icon:"link",label:()=>r("Copy permanent link"),handler:({resources:s})=>{const[l]=s,c=l.privateLink;return o(c)},isVisible:({space:s,resources:l})=>ie.isPublicSpaceResource(s)?!1:l.length===1,class:"oc-files-actions-copy-permanent-link-trigger"}])}},na=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=We(),{$gettext:n,$ngettext:o}=Ne.useGettext(),i=Je(),s=lr(),l=at(),{updateResourceField:c}=Ke(),u=async({resources:f})=>{const d=[],b=[],E=new Bn({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(w=>{b.push(E.add(async()=>{try{const{graphAuthenticated:R}=i;await R.driveItems.deleteDriveItem(w.driveId,w.id),c({id:w.id,field:"syncEnabled",value:!1})}catch(R){console.error(R),d.push(R)}}))}),await Promise.all(b),d.length===0){ct(r,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),r.push(Or("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",f.length),errors:d})};return{actions:V(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>n("Disable sync"),isVisible:({space:f,resources:d})=>!kt(r,"files-shares-with-me")&&!ct(r,"files-spaces-generic")||d.length===0||ct(r,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(b=>b.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},ia=()=>{const e=bt(),t=tr(),r=We(),{displayDialog:n,filesList_delete:o}=tv(),{$gettext:i}=Ne.useGettext(),s=({space:c,resources:u,deletePermanent:a})=>{if(Tt(r,"files-common-search")&&(u=u.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ie.isProjectSpaceResource(f))),a){n(c,u);return}o(u)};return{actions:V(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!1}),isVisible:({space:c,resources:u})=>!ct(r,"files-spaces-generic")&&!Ar(r,"files-public-link")&&!Tt(r,"files-common-search")||u.length===0||ct(r,"files-spaces-generic")&&(c==null?void 0:c.driveType)==="share"&&u[0].path==="/"||u.length===1&&u[0].locked?!1:Tt(r,"files-common-search")?u.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ie.isProjectSpaceResource(f)):!u.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!0}),isVisible:({space:c,resources:u})=>!Rr(r,"files-trash-generic")||!t.filesPermanentDeletion||ie.isProjectSpaceResource(c)&&!c.canDeleteFromTrashBin({user:e.user})?!1:u.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function ax(e){return e&&e.length?e[0]:void 0}const vv=()=>yn("$archiverService"),oa=()=>{const{showErrorMessage:e}=it(),t=We(),r=lr(),n=vv(),{$ngettext:o,$gettext:i,current:s}=Ne.useGettext(),l=Yn(),c=On(),u=({space:d,resources:b})=>{b.length>1&&(b=b.filter(w=>w.canDownload()&&!ie.isProjectSpaceResource(w)));const E=y(n.fileIdsSupported)?{fileIds:b.map(w=>w.fileId)}:{dir:cs.dirname(ax(b).path)||"/",files:b.map(w=>w.name)};return n.triggerDownload({...E,...d&&ie.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:l.publicLinkPassword}}).catch(w=>{console.error(w),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",b.length),errors:[w]})})},a=d=>{const b=y(n.capability);return b?d.reduce((w,R)=>w+parseInt(`${R.size}`),0)>parseInt(b.max_size):void 0};return{actions:V(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await r.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>a(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:wr(y(n.capability).max_size,s)}):"",isDisabled:({resources:d})=>a(d),isVisible:({resources:d})=>y(c)&&!ct(t,"files-spaces-generic")&&!Ar(t,"files-public-link")&&!Tt(t,"files-common-favorites")&&!Tt(t,"files-common-search")&&!kt(t,"files-shares-with-me")&&!kt(t,"files-shares-with-others")&&!kt(t,"files-shares-via-link")&&!Tt(t,"files-common-search")||!y(n.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(E=>ie.isProjectSpaceResource(E))||ie.isProjectSpaceResource(d[0])&&d[0].disabled||!y(n.fileIdsSupported)&&Tt(t,"files-common-favorites")?!1:!d.some(E=>!E.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},wv=e=>{const{showErrorMessage:t}=it(),r=(e==null?void 0:e.clientService)||Je(),{$gettext:n}=Ne.useGettext(),o=tr(),i=bt();return{downloadFile:async(l,c,u=null)=>{var a;try{const f=await r.webdav.getFileUrl(l,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(a=i.user)==null?void 0:a.onPremisesSamAccountName});Vl(f,c.name)}catch(f){console.error(f),t({title:n("Download failed"),desc:n("File could not be located"),errors:[f]})}}}},Po=()=>{const e=We(),{$gettext:t}=Ne.useGettext(),r=On(),n=ls(),{downloadFile:o}=wv(),i=({space:l,resources:c})=>{o(l,c[0])};return{actions:V(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:l})=>y(r)&&!y(n)&&!ct(e,"files-spaces-generic")&&!Ar(e,"files-public-link")&&!Tt(e,"files-common-favorites")&&!Tt(e,"files-common-search")&&!kt(e,"files-shares-with-me")&&!kt(e,"files-shares-with-others")&&!kt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Ff=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),n=tr(),o=We(),{$gettext:i}=Ne.useGettext(),s=Je(),{dispatchModal:l}=yt(),c=Ke(),u=lr(),a=({space:b})=>s.webdav.clearTrashBin(b).then(()=>{e({title:i("All deleted files were removed")}),c.clearResources(),c.resetSelection()}).catch(E=>{console.error(E),t({title:i("Failed to empty trash bin"),errors:[E]})}),f=({space:b})=>{l({variation:"danger",title:i("Empty trash bin"),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the listed items? You can’t undo this action."),hasInput:!1,onConfirm:()=>u.addTask(()=>a({space:b}))})};return{actions:V(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:b})=>!(!Rr(o,"files-trash-generic")||!n.filesPermanentDeletion||ie.isProjectSpaceResource(b)&&!b.canDeleteFromTrashBin({user:r.user})),isDisabled:()=>c.activeResources.length===0,class:"oc-files-actions-empty-trash-bin-trigger",variation:"danger",appearance:"filled"}]),emptyTrashBin:a}},Pf=()=>{const{showErrorMessage:e}=it(),t=tr(),r=We(),{$gettext:n}=Ne.useGettext(),o=Je(),i=On(),s=dr(),l=Ke(),c=Fo(),u=async({space:f,resources:d})=>{try{const b=!d[0].starred;await o.webdav.setFavorite(f,d[0],b),l.updateResourceField({id:d[0].id,field:"starred",value:b}),b||c.publish("app.files.list.removeFromFavorites",d[0].id)}catch(b){const E=n('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:E,errors:[b]})}};return{actions:V(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?n("Remove from favorites"):n("Add to favorites"),isVisible:({resources:f})=>y(i)&&!ct(r,"files-spaces-generic")&&!Tt(r,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function lx(e,t){const r=e.isReceivedShare()||e.isMounted(),n=t===""&&r;return e.canBeDeleted()&&!n}const sa=()=>{const e=We(),{cutResources:t}=_o(),r=Ne.useGettext(),{$gettext:n}=r,o=Ke(),{currentFolder:i}=Qe.storeToRefs(o),s=V(()=>window.navigator.platform.match("Mac")),l=V(()=>y(s)?n("⌘ + X"):n("Ctrl + X")),c=({resources:a})=>{t(a)};return{actions:V(()=>[{name:"cut",icon:"scissors",handler:c,shortcut:y(l),label:()=>n("Cut"),isVisible:({resources:a})=>!ct(e,"files-spaces-generic")&&!Ar(e,"files-public-link")&&!Tt(e,"files-common-favorites")||a.length===0||!y(i)||a.length===1&&a[0].locked?!1:!a.some(d=>lx(d,y(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},xf=()=>{const e=We(),{$gettext:t}=Ne.useGettext(),{getMatchingSpace:r}=ar(),n=Ke(),{currentFolder:o}=Qe.storeToRefs(n),i=c=>c||r(c),s=V(()=>Ar(e,"files-public-link")?Ri("files-public-link"):xr("files-spaces-generic"));return{actions:V(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:c})=>!(Rr(e,"files-trash-generic")||c.length!==1||y(o)!==null&&to(c[0],y(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>co({},y(s),Jr(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},Sv=()=>{const e=We(),t=Je(),{getMatchingSpace:r}=ar(),{$gettext:n,$ngettext:o}=Ne.useGettext(),i=_o(),{startWorker:s}=Zb(),l=Ke(),{currentFolder:c}=Qe.storeToRefs(l),u=V(()=>window.navigator.platform.match("Mac")),a=V(()=>y(u)?n("⌘ + V"):n("Ctrl + V")),f=V(()=>i.action===ti.Cut?hn.MOVE:hn.COPY),d=async({targetSpace:w,sourceSpace:R,resources:S})=>{var T;const m=new Ip(R,S,w,y(c),c,t,n,o),g=await m.getTransferData(y(f));if(!g.length)return;const v=(T=y(c))==null?void 0:T.id;s(g,async({successful:A,failed:F})=>{if(m.showResultMessage(F,A,y(f)),!A.length||y(c)&&v!==y(c).id)return;const C=[],I=[];for(const L of A)C.push((async()=>{const B=await t.webdav.getFileInfo(w,L);I.push(B)})());await Promise.allSettled(C),ie.isShareSpaceResource(w)&&I.forEach(L=>{L.remoteItemId=w.id}),l.upsertResources(I),l.loadIndicators(w,y(c).id)})},b=async({space:w})=>{const R=i.resources.reduce((m,g)=>{if(g.storageId in m)return m[g.storageId].resources.push(g),m;const v=r(g);return v.id in m||(m[v.id]={space:v,resources:[]}),m[v.id].resources.push(g),m},{}),S=Object.values(R).map(({space:m,resources:g})=>d({targetSpace:w,sourceSpace:m,resources:g}));await Promise.all(S),i.clearClipboard()};return{actions:V(()=>[{name:"paste",icon:"clipboard",handler:b,label:()=>n("Paste"),shortcut:y(a),isVisible:({resources:w})=>{var R;return i.resources.length===0||!ct(e,"files-spaces-generic")&&!Ar(e,"files-public-link")&&!Tt(e,"files-common-favorites")||w.length===0?!1:Ar(e,"files-public-link")&&y(c)?(R=y(c))==null?void 0:R.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},aa=()=>{const{showErrorMessage:e}=it(),t=tr(),r=We(),{$gettext:n}=Ne.useGettext(),o=Je(),i=at(),{dispatchModal:s}=yt(),l=bt(),c=dr(),u=Ke(),{setCurrentFolder:a,upsertResource:f}=u,d=(R,S,m=void 0)=>{const g=R.path.substring(0,R.path.length-R.name.length)+S;if(!S)return n("The name cannot be empty");if(/[/]/.test(S))return n('The name cannot contain "/"');if(S===".")return n('The name cannot be equal to "."');if(S==="..")return n('The name cannot be equal to ".."');if(/\s+$/.test(S))return n("The name cannot end with whitespace");if(u.resources.find(T=>T.path===g&&R.name!==S)){const T=n('The name "%{name}" is already taken');return n(T,{name:S},!0)}if(m&&m.find(A=>A.path===g&&R.name!==S)){const A=n('The name "%{name}" is already taken');return n(A,{name:S},!0)}return null},b=async(R,S,m)=>{let g=u.currentFolder;try{const v=ht.join(ht.dirname(S.path),m);await o.webdav.moveFiles(R,S,R,{path:v});const T=to(S,g);if(ie.isShareSpaceResource(R)&&S.isReceivedShare()){if(R.rename(m),T)return g={...g},g.name=m,a(g),r.push(Jr(R,{path:"",fileId:S.fileId}));const F={...S};F.name=m,f(F);return}if(T)return g={...g},al(R,g,v),a(g),r.push(Jr(R,{path:v,fileId:S.fileId}));const A={...S};al(R,A,v),f(A)}catch(v){console.error(v);let T=n('Failed to rename "%{file}" to "%{newName}"',{file:S.name,newName:m},!0);v.statusCode===423&&(T=n('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:S.name,newName:m},!0)),e({title:T,errors:[v]})}},E=async({space:R,resources:S})=>{const m=u.currentFolder;let g;if(to(S[0],m)){const $=ht.dirname(m.path);g=(await o.webdav.listFiles(R,{path:$})).children}const v=u.areFileExtensionsShown,T=async $=>{v||($=`${$}.${S[0].extension}`),await b(R,S[0],$)},A=($,D)=>{v||($=`${$}.${S[0].extension}`);const H=d(S[0],$,g);D(H)},F=ie.extractNameWithoutExtension(S[0]),C=!S[0].isFolder&&!v?F:S[0].name,I=S[0].isFolder?n("Rename folder %{name}",{name:C}):n("Rename file %{name}",{name:C}),L=!S[0].isFolder&&!v?F:S[0].name,B=S[0].isFolder||!v?null:[0,F.length];s({variation:"passive",title:I,confirmText:n("Rename"),hasInput:!0,inputValue:L,inputSelectionRange:B,inputLabel:S[0].isFolder?n("Folder name"):n("File name"),onConfirm:T,onInput:A})};return{actions:V(()=>[{name:"rename",icon:"pencil",label:()=>n("Rename"),handler:E,isVisible:({resources:R})=>Rr(r,"files-trash-generic")||kt(r,"files-shares-with-me")&&!t.sharingCanRename||R.length!==1||(i.options.routing.fullShareOwnerPaths?R.some(g=>g.remoteItemPath&&g.path):R.some(g=>g.remoteItemId&&g.path==="/"))||R.length===1&&R[0].locked?!1:!R.some(g=>!g.canRename({user:l.user,ability:c})||g.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:b}},la=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),n=We(),{$gettext:o,$ngettext:i}=Ne.useGettext(),s=Je(),l=dt(),c=Mt(),u=Ke(),{startWorker:a}=ev(),f=async(R,S)=>{const m={},g=[],v=[],T=[];for(const A of S){const F=ht.dirname(A.path);let C=[];if(F in m)C=m[F];else{try{C=(await s.webdav.listFiles(R,{path:F})).children}catch{T.push(F)}m[F]=C}C.some(L=>L.name===A.name)||v.filter(L=>L.id!==A.id).some(L=>L.path===A.path)?g.push(A):v.push(A)}return{existingResourcesByPath:m,conflicts:g,resolvedResources:v,missingFolderPaths:T.filter(A=>{var F;return!((F=m[A])!=null&&F.length)})}},d=async R=>{let S=0;const m=[],g=R.length;let v=!1,T;for(const A of R){const F=A.type==="folder";if(v){m.push({resource:A,strategy:T});continue}const C=g-S,L=await new ol(o,i).resolveFileExists({name:A.name,isFolder:F},C,!1);S++,L.doForAllConflicts&&(v=!0,T=L.strategy),m.push({resource:A,strategy:L.strategy})}return m},b=(R,S,m)=>{const g=y(n.currentRoute);a({space:R,resources:S,missingFolderPaths:m},async({successful:v,failed:T})=>{var A,F;if(v.length){let C;v.length===1?C=o("%{resource} was restored successfully",{resource:v[0].name}):C=o("%{resourceCount} files restored successfully",{resourceCount:v.length.toString()}),e({title:C}),g.name===y(n.currentRoute).name&&((A=g.query)==null?void 0:A.fileId)===((F=y(n.currentRoute).query)==null?void 0:F.fileId)&&(u.removeResources(v),u.resetSelection());const L=await s.graphAuthenticated.drives.getDrive(R.id,c.graphRoles);l.updateSpaceField({id:L.id,field:"spaceQuota",value:L.spaceQuota})}if(T.length){let C;const I={};T.length===1?(I.resource=T[0].resource.name,C=o('Failed to restore "%{resource}"',I,!0)):(I.resourceCount=T.length.toString(),C=o("Failed to restore %{resourceCount} files",I,!0)),t({title:C,errors:T.map(({error:L})=>L)})}})},E=async({space:R,resources:S})=>{const m=S.sort((L,B)=>L.path.length-B.path.length),{existingResourcesByPath:g,conflicts:v,resolvedResources:T,missingFolderPaths:A}=await f(R,m),F=await d(v),C=F.filter(L=>L.strategy===Ur.REPLACE).map(L=>L.resource);T.push(...C);const I=F.filter(L=>L.strategy===Ur.KEEP_BOTH).map(L=>L.resource);for(let L of I){L={...L};const B=ht.dirname(L.path),$=g[B]||[],D=ie.extractExtensionFromFile(L),H=jr(L.name,D,[...$,...F.map(ee=>ee.resource),...T]);L.name=H,L.path=ie.urlJoin(B,H),T.push(L)}return b(R,T,A)};return{actions:V(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:E,isVisible:({space:R,resources:S})=>!Rr(n,"files-trash-generic")||!S.every(m=>ie.isTrashResource(m)&&m.canBeRestored())||ie.isProjectSpaceResource(R)&&!R.canRestoreFromTrashbin({user:r.user})?!1:S.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:b,collectConflicts:f}},Of=()=>yn("$previewService"),Ev=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),n=We(),{$gettext:o}=Ne.useGettext(),i=Je(),s=lr(),l=Of(),c=dt(),u=Mt(),{createDefaultMetaFolder:a}=Li(),{getDefaultMetaFolder:f}=si(),d=async({space:E,resources:w})=>{var v;const R=i.graphAuthenticated,S=E==null?void 0:E.id,{copyFiles:m,getFileInfo:g}=i.webdav;try{let T=await f(E);T||(T=await a(E)),w[0].id!==((v=E.spaceImageData)==null?void 0:v.id)&&await m(E,{fileId:w[0].id},E,{parentFolderId:T.id,name:w[0].name},{overwrite:!0});const{fileId:A}=await g(E,{fileId:w[0].id}),F=await R.drives.updateDrive(S,{name:E.name,special:[{specialFolder:{name:"image"},id:A}]},u.graphRoles);c.updateSpaceField({id:S,field:"spaceImageData",value:F.spaceImageData}),e({title:o("Space image was set successfully")})}catch(T){console.error(T),t({title:o("Failed to set space image"),errors:[T]})}};return{actions:V(()=>[{name:"set-space-image",icon:"image-edit",handler:E=>s.addTask(()=>d(E)),label:()=>o("Set as space image"),isVisible:({space:E,resources:w})=>w.length!==1||!w[0].mimeType||!l.isMimetypeSupported(w[0].mimeType,!0)||!ct(n,"files-spaces-generic")||!E?!1:E.canEditImage({user:r.user}),class:"oc-files-actions-set-space-image-trigger"}])}},cx=()=>{const e=We(),{$gettext:t}=Ne.useGettext(),r=On(),n=()=>{const i=Rr(e,"files-trash-generic")?null:"actions";Xe.publish(mt.openWithPanel,i)};return{actions:V(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:n,isVisible:({resources:i})=>y(r)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},kf=()=>{const e=We(),t=Ke(),{$gettext:r}=Ne.useGettext();return{actions:V(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:o})=>Rr(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Xe.publish(mt.open)}}])}},Tv=()=>{const e=tr(),{isPersonalSpaceRoot:t}=ar(),r=bt();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||ie.isPublicSpaceResource(o)||t(i)||ie.isTrashResource(i)?!1:ie.isIncomingShareResource(i)?i.sharePermissions.includes(ie.GraphSharePermission.readPermissions):ie.isShareSpaceResource(o)?ie.getPermissionsForSpaceMember(o,r.user).includes(ie.GraphSharePermission.readPermissions):!0}},Av=()=>{const e=tr(),t=dr(),r=bt();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||ie.isShareSpaceResource(o)||ie.isProjectSpaceResource(o)&&!o.canShare({user:r.user})?!1:i.canShare({ability:t,user:r.user})}},Nf=()=>{const e=We(),{$gettext:t}=Ne.useGettext(),{canShare:r}=Av(),n=Ke(),o=({resources:s})=>{n.setSelection(s.map(({id:l})=>l)),Xe.publish(mt.openWithPanel,"sharing#peopleShares")};return{actions:V(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:l})=>Rr(e,"files-trash-generic")||l.length!==1?!1:r({space:s,resource:l[0]}),class:"oc-files-actions-show-shares-trigger"}])}},$f=()=>{const{showMessage:e,showErrorMessage:t}=it(),{can:r}=dr(),{$gettext:n,$ngettext:o}=Ne.useGettext(),{createSpace:i}=Li(),{checkSpaceNameModalInput:s}=si(),l=Je(),c=We(),u=V(()=>r("create-all","Drive")),{dispatchModal:a}=yt(),f=at(),d=dt(),b=Ke(),E=async({spaceName:S,resources:m,space:g})=>{const{webdav:v}=l,T=new Bn({concurrency:f.options.concurrentRequests.resourceBatchActions}),A=[];try{const F=await i(S);d.upsertSpace(F),m.length===1&&m[0].isFolder&&(m=(await v.listFiles(g,{path:m[0].path})).children);for(const C of m)A.push(T.add(()=>v.copyFiles(g,C,F,{path:C.name})));await Promise.all(A),b.resetSelection(),e({title:n("Space was created successfully")})}catch(F){console.error(F),t({title:n("Creating space failed…"),errors:[F]})}},w=({resources:S,space:m})=>{a({title:o('Create Space from "%{resourceName}"',"Create Space from selection",S.length,{resourceName:S[0].name}),message:o('Create Space with the content of "%{resourceName}".',"Create Space with the selected files.",S.length,{resourceName:S[0].name}),contextualHelperLabel:n("The marked elements will be copied."),contextualHelperData:{title:n("Restrictions"),text:n("Shares, versions and tags will not be copied.")},confirmText:n("Create"),hasInput:!0,inputLabel:n("Space name"),onInput:s,onConfirm:g=>E({spaceName:g,space:m,resources:S})})};return{actions:V(()=>[{name:"create-space-from-resource",icon:"function",handler:w,label:()=>n("Create Space from selection"),isVisible:({resources:S,space:m})=>!(!S.length||!y(u)||!ct(c,"files-spaces-generic")||!ie.isPersonalSpaceResource(m)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Rv=()=>{const e=rr("scrollTo"),t=rr("details"),r=Ke(),n=V(()=>St(y(e))),o=V(()=>St(y(t))),i=(l,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${l}']`)[0];if(!u){Xe.publish("app.files.navigate.page",{resourceId:l,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const a=document.getElementById(c.topbarElement),f=(a==null?void 0:a.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Xe.subscribe("app.files.navigate.scrollTo",l=>i(l.resourceId,{forceScroll:l.forceScroll,topbarElement:l.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(l,c)=>{if(!y(n)||!l.length)return;const u=y(l).find(a=>ie.isIncomingShareResource(a)?a.remoteItemId===y(n):a.id===y(n));u&&u.processing!==!0&&(r.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:c}),y(o)&&Xe.publish(mt.openWithPanel,y(o)))}}},ux=({space:e}={})=>{const{showMessage:t,showErrorMessage:r}=it(),n=We(),{dispatchModal:o}=yt(),{$gettext:i}=Ne.useGettext(),{scrollToResource:s}=Rv(),l=bt(),c=Ke(),{resources:u,currentFolder:a,ancestorMetaData:f}=Qe.storeToRefs(c),d=Je(),b=(m,g)=>m.trim()===""?g(i("Folder name cannot be empty")):/[/]/.test(m)?g(i('Folder name cannot contain "/"')):m==="."?g(i('Folder name cannot be equal to "."')):m===".."?g(i('Folder name cannot be equal to ".."')):y(u).find(T=>T.name===m)?g(i("%{name} already exists",{name:m},!0)):g(null),E=V(()=>ct(n,"files-spaces-generic")&&y(e).driveType!=="share"),w=async m=>{m=m.trimEnd();try{const g=ht.join(y(a).path,m),v=await d.webdav.createFolder(y(e),{path:g});y(E)&&(v.indicators=Ro({space:y(e),resource:v,ancestorMetaData:y(f),user:l.user})),ie.isShareSpaceResource(y(e))&&(v.remoteItemId=y(e).id),c.upsertResource(v),t({title:i('"%{folderName}" was created successfully',{folderName:m})}),await Hr(),s(v.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(g){console.error(g),r({title:i("Failed to create folder"),errors:[g]})}},R=()=>{let m=i("New folder");y(u).some(g=>g.name===m)&&(m=jr(m,"",y(u))),o({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:m,inputLabel:i("Folder name"),onConfirm:w,onInput:b})};return{actions:V(()=>[{name:"create-folder",icon:"folder",handler:R,label:()=>i("New Folder"),isVisible:()=>{var m;return(m=y(a))==null?void 0:m.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:b,addNewFolder:w}},fx=({space:e}={})=>{const{showMessage:t,showErrorMessage:r}=it(),n=bt(),o=We(),{$gettext:i}=Ne.useGettext(),{dispatchModal:s}=yt(),l=Zr(),{isEnabled:c}=ni(),{openEditor:u}=qr(),a=Je(),f=Ke(),{resources:d,currentFolder:b,ancestorMetaData:E,areFileExtensionsShown:w}=Qe.storeToRefs(f),R=V(()=>l.fileExtensions.filter(({newFileMenu:A})=>!!A)),S=A=>A===""?i("File name cannot be empty"):/[/]/.test(A)?i('File name cannot contain "/"'):A==="."?i('File name cannot be equal to "."'):A===".."?i('File name cannot be equal to ".."'):/\s+$/.test(A)?i("File name cannot end with whitespace"):y(d).find(C=>C.name===A)?i("%{name} already exists",{name:A},!0):null,m=V(()=>ct(o,"files-spaces-generic")&&y(e).driveType!=="share"),g=(A,F)=>(m.value&&(A.indicators=Ro({space:y(e),resource:A,ancestorMetaData:y(E),user:n.user})),f.upsertResource(A),u(F,y(e),A)),v=(A,F,C)=>{let I=i("New file")+`.${F}`;y(d).some(B=>B.name===I)&&(I=jr(I,F,y(d))),w.value||(I=ie.extractNameWithoutExtension({name:I,extension:F}));const L=w.value?[0,I.length-(F.length+1)]:null;s({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:I,inputLabel:i("File name"),inputSelectionRange:L,onConfirm:async B=>{w.value||(B=`${B}.${F}`);try{let $;if(C.createFileHandler)$=await C.createFileHandler({fileName:B,space:y(e),currentFolder:y(b)});else{const D=ht.join(y(b).path,B);$=await a.webdav.putFileContents(y(e),{path:D})}return f.upsertResource($),t({title:i('"%{fileName}" was created successfully',{fileName:$.name})}),y(c)?void 0:g($,C)}catch($){console.error($),r({title:i("Failed to create file"),errors:[$]})}},onInput:(B,$)=>$(S(w.value?B:`${B}.${F}`))})};return{actions:V(()=>{var C;const A=[],F={};for(const I of y(R)||[])I.hasPriority?F[I.extension]=I:F[I.extension]=F[I.extension]||I;for(const[,I]of Object.entries(F))A.push({name:"create-new-file",icon:"add",handler:L=>v(L,I.extension,I),label:()=>i(I.newFileMenu.menuTitle()),isVisible:()=>{var L;return(L=y(b))==null?void 0:L.canUpload({user:n.user})},class:"oc-files-actions-create-new-file",ext:I.extension,isExternal:(C=I.app)==null?void 0:C.startsWith("external-")});return A}),getNameErrorMsg:S,openFile:g}},_v="rowMounted",Df="fileDropped",dx="contextmenuClicked";class Vr{}Ee(Vr,"Thumbnail",[36,36]),Ee(Vr,"Tile",[1e3,1e3]),Ee(Vr,"Preview",[1200,1200]),Ee(Vr,"Avatar",64);class ca{}Ee(ca,"Thumbnail","thumbnail"),Ee(ca,"Preview","preview"),Ee(ca,"Avatar","avatar");class px{constructor(t,r,n){Ee(this,"state");Ee(this,"observeEnter");Ee(this,"observeExit");Ee(this,"onEnterCallCount");Ee(this,"onExitCallCount");Ee(this,"onEnter");Ee(this,"onExit");Ee(this,"threshold");Ee(this,"unobserver");this.unobserver=t,this.threshold=r,this.onEnter=n.onEnter,this.onExit=n.onExit,this.observeEnter=!!n.onEnter,this.observeExit=!!n.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,r){const n={element:r,unobserve:()=>this.unobserve(t,r)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...n})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...n})),this.state=t}unobserve(t,r){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(r)}}class Iv{constructor(t={}){Ee(this,"targets");Ee(this,"intersectionObserver");Ee(this,"options");this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,r={},n){!r.onEnter&&!r.onExit||(this.targets.set(t,new px(this.unobserve.bind(this),n||this.options.threshold||0,{onEnter:r.onEnter,onExit:r.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(r=>{const n=this.targets.get(r.target);n&&n.request(r.isIntersecting&&r.intersectionRatio>n.threshold?0:1,r.target)})}}const hx={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},gx={name:"layout-grid",color:"var(--oc-color-swatch-passive-default)"},mx={name:"resource-type-file",color:"var(--oc-color-text-default)"},yx=Fp(),bx=Me({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>QF.some(t=>t===e)}},setup(e){const t=In(Cp),r=V(()=>e.resource.type==="folder"||e.resource.isFolder),n=V(()=>e.resource.type==="space"),o=V(()=>{var c;return(c=e.resource.extension)==null?void 0:c.toLowerCase()}),i=V(()=>{var c;return(c=e.resource.mimeType)==null?void 0:c.toLowerCase()}),s=V(()=>{if(y(n))return gx;if(y(r))return hx;const c=yx[y(o)]||(t==null?void 0:t.mimeType[y(i)])||(t==null?void 0:t.extension[y(o)]);return{...mx,...c}}),l=V(()=>y(n)?"oc-resource-icon-space":y(r)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:l}}});function vx(e,t,r,n,o,i){const s=pe("oc-icon");return Z(),Ce(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:K.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const xo=Ue(bx,[["render",vx]]),wx={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=at(),{options:r}=Qe.storeToRefs(t);return{linkTarget:V(()=>y(r).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},Sx={key:1};function Ex(e,t,r,n,o,i){return r.isResourceClickable?(Z(),Ce(Hn(i.componentType),Yt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link",onDragstart:t[0]||(t[0]=Tr(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Te(()=>[Ge(e.$slots,"default")]),_:3},16,["target","onClick"])):(Z(),ve("span",Sx,[Ge(e.$slots,"default")]))}const Lf=Ue(wx,[["render",Ex]]),Tx=Me({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?cs.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),Ax=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],Rx={key:0,class:"oc-text-truncate"},_x=["textContent"],Ix=["textContent"],Cx=["textContent"];function Fx(e,t,r,n,o,i){const s=or("oc-tooltip");return ot((Z(),ve("span",{class:K.normalizeClass(["oc-resource-name",[{"oc-display-inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(Z(),ve("span",Rx,[he("span",{class:"oc-resource-basename",textContent:K.toDisplayString(e.displayName)},null,8,_x)])):(Z(),ve("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:K.toDisplayString(e.displayName)},null,8,Ix)),e.extension&&e.isExtensionDisplayed?(Z(),ve("span",{key:2,class:"oc-resource-extension",textContent:K.toDisplayString(e.displayExtension)},null,8,Cx)):ke("",!0)],10,Ax)),[[s,e.tooltip]])}const Bf=Ue(Tx,[["render",Fx]]),Px=Me({name:"ResourceListItem",components:{ResourceIcon:xo,ResourceLink:Lf,ResourceName:Bf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),xx={class:"oc-resource-indicators"},Ox=["textContent"];function kx(e,t,r,n,o,i){const s=pe("oc-image"),l=pe("resource-icon"),c=pe("resource-link"),u=pe("resource-name"),a=pe("oc-icon"),f=or("oc-tooltip");return Z(),ve("div",{class:K.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(Z(),Ce(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Te(()=>[e.hasThumbnail?ot((Z(),Ce(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):ot((Z(),Ce(l,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):ke("",!0),he("div",{class:K.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[we(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Te(()=>[(Z(),Ce(u,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","onClick"]),he("div",xx,[e.isPathDisplayed?(Z(),Ce(Hn(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:K.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Te(()=>[we(a,K.normalizeProps(Xa(e.parentFolderLinkIconAttrs)),null,16),he("span",{class:"text oc-text-truncate",textContent:K.toDisplayString(e.parentFolderName)},null,8,Ox)]),_:1},8,["to","style"])):ke("",!0)])],2)],2)}const Oo=Ue(Px,[["render",kx]]),Cv=new Iv,Nx=Me({components:{ResourceListItem:Oo},props:{searchResult:{type:Object,default:function(){return{}}},isClickable:{type:Boolean,default:!0},term:{type:String,default:""}},setup(e){const{triggerDefaultAction:t}=qr(),{getMatchingSpace:r}=ar(),{getDefaultAction:n}=qr(),{loadPreview:o}=Wf(),{getPathPrefix:i,getParentFolderName:s,getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:u}=ai(),a=at(),{options:f}=Qe.storeToRefs(a),d=Ke(),b=ue(),E=V(()=>d.areFileExtensionsShown),w=V(()=>({...e.searchResult.data,...y(b)&&{thumbnail:y(b)}})),R=V(()=>r(y(w))),S=V(()=>{const T=y(w);return ie.isSpaceResource(T)&&T.disabled===!0}),m=()=>{t({space:y(R),resources:[y(w)]})},g=V(()=>e.isClickable?{parentFolderLink:l(y(w)),onClick:m}:{isResourceClickable:!1}),v=V(()=>{var F;if(y(w).isFolder)return u(y(w));const T=n({resources:[y(w)],space:y(R)});if(!(T!=null&&T.route))return null;const A=T.route({space:y(R),resources:[y(w)]});return A.query={...A.query,contextRouteQuery:{...((F=A.query)==null?void 0:F.contextRouteQuery)||{},term:e.term}},A});return{configOptions:f,space:R,previewData:b,loadPreview:o,resource:w,resourceDisabled:S,resourceClicked:m,resourceLink:v,parentFolderLink:l(y(w)),pathPrefix:i(y(w)),parentFolderName:s(y(w)),parentFolderLinkIconAdditionalAttributes:c(y(w)),additionalAttrs:g,areFileExtensionsShown:E}},mounted(){this.resourceDisabled&&this.$el.parentElement.classList.add("disabled");const e=async()=>{const r=await this.loadPreview({space:this.space,resource:this.resource,dimensions:Vr.Thumbnail,cancelRunning:!0});r&&(this.previewData=r)},t=Ct.debounce(({unobserve:r})=>{r(),e()},250);Cv.observe(this.$el,{onEnter:t,onExit:t.cancel})},beforeUnmount(){Cv.disconnect()}});function $x(e,t,r,n,o,i){const s=pe("resource-list-item");return Z(),Ce(s,Yt({resource:e.resource,"path-prefix":e.pathPrefix,"is-path-displayed":!0,link:e.resourceLink,"is-extension-displayed":e.areFileExtensionsShown,"parent-folder-link-icon-additional-attributes":e.parentFolderLinkIconAdditionalAttributes,"parent-folder-name":e.parentFolderName,"is-thumbnail-displayed":!!e.previewData},e.additionalAttrs),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"])}const Fv=Ue(Nx,[["render",$x]]),Dx=7,Lx=200,Bx=Me({name:"CreateShortcutModal",components:{ResourcePreview:Fv},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:r}){const n=Je(),{$gettext:o}=Ne.useGettext(),{showMessage:i,showErrorMessage:s}=it(),l=We(),{search:c}=Rf(),{getPathPrefix:u,getParentFolderName:a,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:b}=ai(),E=Ke(),{resources:w,currentFolder:R}=Qe.storeToRefs(E),S=ue(null),m=ue(""),g=ue(""),v=ue(null),T=ue(null),A=ue(!1);let F=null;const C=X=>{const W=X.trim();return ee(W)?W:`https://${W}`},I=V(()=>C(y(m))),L=V(()=>!!y(w).find(X=>X.name===`${y(g)}.url`)),B=V(()=>y(L)||!y(g)||!y(m));Et(B,()=>{t("update:confirmDisabled",y(B))},{immediate:!0});const $=V(()=>y(L)?o("%{name} already exists",{name:`${y(g)}.url`}):/[/]/.test(y(g))?o('Shortcut name cannot contain "/"'):""),D=cr.useTask(function*(X,W){v.value=null,W=`name:"*${W}*" NOT name:"*.url"`;try{v.value=yield c(W,Dx)}catch{}}),H=Ct.debounce(()=>{D.perform(y(m))},Lx),ee=X=>["http://","https://"].some(U=>U.startsWith(X)||X.startsWith(U)),J=()=>{v.value=null,m.value=y(I);try{let X=new URL(y(I)).host;y(w).some(W=>W.name===`${X}.url`)&&(X=jr(`${X}.url`,"url",y(w)).slice(0,-4)),g.value=X}catch{}},ce=X=>{v.value=null;const W=new URL(window.location.href);let U=X.data.name;m.value=`${W.origin}/f/${X.id}`,y(w).some(z=>z.name===`${U}.url`)&&(U=jr(`${U}.url`,"url",y(w)).slice(0,-4)),g.value=U},be=X=>y(T)===X,de=(X=!1)=>{const W=Array.from(document.querySelectorAll("li.selectable-item"));let U=y(T)!==null?y(T):X?W.length:-1;const z=X?-1:1;do if(U+=z,U<0||U>W.length-1)return null;while(W[U].classList.contains("disabled"));return U},Se=()=>{T.value=de(!0)},Ae=()=>{T.value=de(!1)},ne=X=>{y(A)&&(X.stopPropagation(),y(S).hide())},ae=X=>{var W,U;y(A)&&(X.stopPropagation(),y(T)!==null&&(y(T)===0?J():ce((U=(W=y(v))==null?void 0:W.values)==null?void 0:U[y(T)-1]),y(S).hide()))},le=()=>{A.value=!1,T.value=null},oe=()=>{A.value=!0,T.value=0},Q=()=>{m.value.trim().length&&y(S).show()},x=async()=>{if(await Hr(),g.value=m.value.trim(),!m.value.trim().length){y(S).hide();return}y(S).show(),Ar(l,"files-public-link")||H()},k=async()=>{try{const W=`[InternetShortcut]
57
- URL=${od.sanitize(C(y(m)),{USE_PROFILES:{html:!0}})}`,U=ie.urlJoin(y(R).path,`${y(g)}.url`),z=await n.webdav.putFileContents(e.space,{path:U,content:W});E.upsertResource(z),i({title:o("Shortcut was created successfully")})}catch(X){console.error(X),s({title:o("Failed to create shortcut"),errors:[X]})}};return Vt(async()=>{var X,W;await Hr(),F=new sd((W=(X=y(S))==null?void 0:X.$refs)==null?void 0:W.drop)}),Et(v,async()=>{await Hr(),!(!y(A)||!F)&&(F.unmark(),F.mark(y(m),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Et(T,()=>{var W,U;if(!y(A)||typeof((U=(W=y(S))==null?void 0:W.$el)==null?void 0:U.scrollTo)!="function")return;const X=y(S).$el.querySelectorAll(".selectable-item");y(S).$el.scrollTo(0,y(T)===null?0:X[y(T)].getBoundingClientRect().y-X[y(T)].getBoundingClientRect().height)}),r({onConfirm:k}),{inputUrl:m,inputFilename:g,dropRef:S,dropItemUrl:I,searchResult:v,confirmButtonDisabled:B,inputFileNameErrorMessage:$,searchTask:D,dropItemUrlClicked:J,dropItemResourceClicked:ce,getPathPrefix:u,getFolderLink:b,getParentFolderLink:f,getParentFolderName:a,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:ae,onKeyDownDrop:Ae,onKeyUpDrop:Se,onKeyEscDrop:ne,onHideDrop:le,onShowDrop:oe,onInputUrlInput:x,onClickUrlInput:Q,isDropItemActive:be,onConfirm:k}}}),Mx={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},jx=["textContent"],Ux=["textContent"],qx={key:0,class:"oc-p-xs oc-flex oc-flex-center"},Vx={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},zx=["textContent"],Wx={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},Hx={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},Gx=["textContent"];function Kx(e,t,r,n,o,i){const s=pe("oc-contextual-helper"),l=pe("oc-text-input"),c=pe("oc-icon"),u=pe("oc-button"),a=pe("oc-spinner"),f=pe("resource-preview"),d=pe("oc-list"),b=pe("oc-drop");return Z(),ve(Ye,null,[we(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=E=>e.inputUrl=E),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[eo(e.onKeyUpDrop,["up"]),eo(e.onKeyDownDrop,["down"]),eo(e.onKeyEscDrop,["esc"]),eo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Te(()=>[he("div",Mx,[he("label",{for:"create-shortcut-modal-url-input",textContent:K.toDisplayString(e.$gettext("Webpage or file"))},null,8,jx),we(s,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),we(b,{ref:"dropRef",class:"oc-pt-s","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":!0,onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Te(()=>[we(d,null,{default:Te(()=>{var E,w;return[he("li",{class:K.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[we(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Te(()=>[we(c,{name:"external-link"}),he("span",{textContent:K.toDisplayString(e.dropItemUrl)},null,8,Ux)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(Z(),ve("li",qx,[we(a)])):ke("",!0),(w=(E=e.searchResult)==null?void 0:E.values)!=null&&w.length?(Z(),ve(Ye,{key:1},[he("li",Vx,[he("span",{textContent:K.toDisplayString(e.$gettext("Link to a file"))},null,8,zx)]),(Z(!0),ve(Ye,null,Lt(e.searchResult.values,(R,S)=>(Z(),ve("li",{key:S,class:K.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(S+1)}])},[we(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:m=>e.dropItemResourceClicked(R)},{default:Te(()=>[we(f,{"search-result":R,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):ke("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(Z(),ve("div",Wx,[we(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=E=>e.inputFilename=E),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Te(()=>[he("div",Hx,[he("label",{for:"create-shortcut-modal-filename-input",textContent:K.toDisplayString(e.$gettext("Shortcut name"))},null,8,Gx),we(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","error-message"])])):ke("",!0)],64)}const Pv=Ue(Bx,[["render",Kx]]),Qx=({space:e})=>{const{dispatchModal:t}=yt(),{$gettext:r}=Ne.useGettext(),n=Ke(),{currentFolder:o}=Qe.storeToRefs(n);return{actions:V(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:r("Create a Shortcut"),confirmText:r("Create"),customComponent:Pv,customComponentAttrs:()=>({space:y(e)})})},label:()=>r("New Shortcut"),isVisible:()=>{var s;return(s=y(o))==null?void 0:s.canCreate()},class:"oc-files-actions-create-new-shortcut"}])}},Xx=()=>{const{showErrorMessage:e}=it(),t=We(),{$gettext:r}=Ne.useGettext(),n=On(),o=ls(),i=Je(),s=u=>{const a=/URL=(.+)/,f=u.match(a);if(f&&f[1])return f[1];throw new Error("unable to extract url")},l=async({resources:u,space:a})=>{try{const f=new URL(window.location.href),d=(await i.webdav.getFileContents(a,u[0])).body;let b=s(d);if(b=b.match(/^http[s]?:\/\//)?b:`https://${b}`,b=od.sanitize(b,{USE_PROFILES:{html:!0}}),b.startsWith(f.origin)){window.location.href=b;return}window.open(b)}catch(f){console.error(f),e({title:r("Failed to open shortcut"),errors:[f]})}};return{actions:V(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>r("Open shortcut"),isVisible:({resources:u})=>y(n)&&!y(o)&&!ct(t,"files-spaces-generic")&&!Ar(t,"files-public-link")&&!Tt(t,"files-common-favorites")&&!Tt(t,"files-common-search")&&!kt(t,"files-shares-with-me")&&!kt(t,"files-shares-with-others")&&!kt(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}},Yx=Me({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:r}=Ne.useGettext(),{getLinkRoleByType:n}=ua(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=V(()=>{var c;return r((c=n(e.modelValue))==null?void 0:c.displayName)}),l=Qt.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:l,getLinkRoleByType:n}}}),Jx=["textContent"],Zx=["textContent"],eO={class:"oc-flex oc-flex-middle"},tO=["textContent"],rO={class:"oc-text-small"},nO={class:"oc-flex"};function iO(e,t,r,n,o,i){var f;const s=pe("oc-icon"),l=pe("oc-button"),c=pe("oc-list"),u=pe("oc-drop"),a=or("oc-tooltip");return Z(),ve(Ye,null,[e.availableLinkTypeOptions.length>1?(Z(),Ce(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none",class:"oc-text-left link-role-dropdown-toggle"},{default:Te(()=>[he("span",{class:"link-current-role",textContent:K.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,Jx),we(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((Z(),ve("span",{key:1,class:"link-current-role oc-mr-m",textContent:K.toDisplayString(e.currentLinkRoleLabel)},null,8,Zx)),[[a,(f=e.getLinkRoleByType(e.modelValue))==null?void 0:f.description]]),e.availableLinkTypeOptions.length>1?(Z(),Ce(u,{key:2,class:"link-role-dropdown","drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click",offset:e.dropOffset,"close-on-click":""},{default:Te(()=>[we(c,{class:"role-dropdown-list"},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(e.availableLinkTypeOptions,(d,b)=>(Z(),ve("li",{key:`role-dropdown-${b}`},[we(l,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:K.normalizeClass([{selected:e.isSelectedType(d),"oc-background-highlight":e.isSelectedType(d)},"oc-p-s"]),appearance:"raw",variation:"passive","justify-content":"space-between",onClick:E=>e.updateSelectedType(d)},{default:Te(()=>[he("span",eO,[we(s,{name:e.getLinkRoleByType(d).icon,class:"oc-pl-s oc-pr-m",variation:"inherit"},null,8,["name"]),he("span",null,[he("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:K.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,tO),he("span",rO,K.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),he("span",nO,[e.isSelectedType(d)?(Z(),Ce(s,{key:0,name:"check",variation:"inherit"})):ke("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):ke("",!0)],64)}const xv=Ue(Yx,[["render",iO],["__scopeId","data-v-cc4f9340"]]),oO=Me({name:"CreateLinkModal",components:{LinkRoleDropdown:xv},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const r=Je(),n=Ne.useGettext(),{$gettext:o}=n,i=Qv(),{isEnabled:s,postMessage:l}=ni(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:a,isPasswordEnforcedForLinkType:f}=ua(),{addLink:d}=Mt(),b=ue(!1),E=ue(!1),w=V(()=>e.resources.every(({isFolder:Ae})=>Ae)),R=V(()=>y(s)?o("Share link(s)"):o("Copy link")),S=ue(Qt.v4()),m=ue({}),g=ue(),v=Oa({value:"",error:void 0}),T=ue(y(c)),A=V(()=>o(a(y(T)).description)),F=V(()=>o(a(y(T)).displayName)),C=V(()=>a(y(T)).icon),I=V(()=>u({isFolder:y(w)})),L=V(()=>f(y(T))),B=i.getPolicy({enforcePassword:y(L)}),$=()=>{b.value=!0},D=({date:Ae,error:ne})=>{g.value=Ae,E.value=ne},H=()=>Promise.allSettled(e.resources.map(Ae=>{var ne;return d({clientService:r,space:e.space,resource:Ae,options:{type:y(T),"@libre.graph.quickLink":!1,password:y(v).value,expirationDateTime:(ne=y(g))==null?void 0:ne.toISO(),displayName:o("Unnamed link")}})})),ee=V(()=>!!B.check(y(v).value)),J=V(()=>!(y(ee)&&!y(E))),ce=async(Ae={})=>{const ne=await H(),ae=ne.filter(({status:Q})=>Q==="fulfilled");ae.length&&y(s)&&l("opencloud-embed:share",ae.map(({value:Q})=>Q.webUrl));const le=[],oe=ne.filter(({status:Q})=>Q==="rejected");if(oe.length&&oe.map(({reason:Q})=>Q).forEach(Q=>{var x;if(console.error(Q),((x=Q.response)==null?void 0:x.status)===400){const k=Q.response.data.error;k.message=Ct.upperFirst(k.message),le.push(k)}}),le.length)return v.error=o(le[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:ne,password:v.value,options:Ae})};t({onConfirm:ce});const be=Ae=>y(T)===Ae,de=Ae=>{v.value=Ae,v.error=void 0},Se=Ae=>{T.value=Ae};return Vt(()=>{const Ae=y(m)[y(T)];Ae&&Ae.$el.focus(),y(L)&&(v.value=i.generatePassword())}),{roleRefs:m,password:v,passwordEnforced:L,passwordPolicy:B,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:S,selectedExpiry:g,availableLinkTypes:I,selectedType:T,selectedTypeIcon:C,selectedTypeDisplayName:F,selectedTypeDescription:A,isSelectedLinkType:be,updateSelectedLinkType:Se,updatePassword:de,getLinkRoleByType:a,confirmButtonText:R,isAdvancedMode:b,setAdvancedMode:$,onExpiryDateChanged:D,confirmButtonDisabled:J,DateTime:$t.DateTime,onConfirm:ce}}}),sO={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},aO={key:0,class:"oc-flex oc-flex-middle"},lO={key:1,class:"oc-flex oc-flex-middle"},cO={class:"oc-flex oc-flex-column"},uO=["textContent"],fO=["textContent"],dO=["textContent"],pO={class:"link-modal-password oc-mb-m"},hO={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},gO=["textContent"],mO=["textContent"],yO={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},bO={class:"oc-rounded oc-menu-item-hover"};function vO(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("link-role-dropdown"),c=pe("oc-button"),u=pe("oc-text-input"),a=pe("oc-datepicker"),f=pe("oc-list"),d=pe("oc-drop");return Z(),ve(Ye,null,[he("div",sO,[e.isAdvancedMode?(Z(),ve("div",aO,[we(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),we(l,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(Z(),ve("div",lO,[we(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),he("div",cO,[he("span",{class:"oc-text-bold",textContent:K.toDisplayString(e.selectedTypeDisplayName)},null,8,uO),he("span",{class:"oc-text-small",textContent:K.toDisplayString(e.selectedTypeDescription)},null,8,fO)])])),e.isAdvancedMode?ke("",!0):(Z(),Ce(c,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw",variation:"primary",onClick:t[0]||(t[0]=b=>e.setAdvancedMode())},{default:Te(()=>[we(s,{name:"settings-3",size:"small","fill-type":"fill"}),he("span",{textContent:K.toDisplayString(e.$gettext("Options"))},null,8,dO)]),_:1}))]),he("div",pO,[e.isAdvancedMode?(Z(),Ce(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.passwordEnforced?`${e.$gettext("Password")}*`:e.$gettext("Password"),class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","onUpdate:modelValue"])):e.password.value?(Z(),ve("div",hO,[he("span",{textContent:K.toDisplayString(e.$gettext("Password:"))},null,8,gO),he("span",{textContent:K.toDisplayString(e.password.value)},null,8,mO)])):ke("",!0),e.isAdvancedMode?(Z(),Ce(a,{key:2,class:"oc-mt-s","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):ke("",!0)]),he("div",yO,[we(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",appearance:"outline",variation:"passive",onClick:t[1]||(t[1]=b=>e.$emit("cancel"))},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),he("div",{class:K.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[we(c,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",variation:"primary",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=b=>e.$emit("confirm"))},{default:Te(()=>[Bt(K.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(Z(),Ce(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",variation:"primary",disabled:e.confirmButtonDisabled},{default:Te(()=>[we(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):ke("",!0),e.password.value?(Z(),Ce(d,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small","close-on-click":""},{default:Te(()=>[we(f,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Te(()=>[he("li",bO,[we(c,{class:"oc-modal-body-actions-confirm-password action-menu-item",appearance:"raw",onClick:t[3]||(t[3]=b=>e.$emit("confirm",{copyPassword:!0}))},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):ke("",!0)],2)])],64)}const Ov=Ue(oO,[["render",vO],["__scopeId","data-v-e6bdc236"]]),mr={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},wO={LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},ua=()=>{const{$gettext:e}=Ne.useGettext(),t=tr(),r=dr(),n=V(()=>r.can("create-all","PublicLink")),o=V(()=>mr.View),i=u=>u===mr.View?t.sharingPublicPasswordEnforcedFor.read_only:u===mr.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===mr.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===mr.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>y(n)?u?[mr.View,mr.Edit,mr.CreateOnly]:[mr.View,mr.Edit]:[],l=[{id:mr.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:mr.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:mr.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:mr.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:mr.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:l,getLinkRoleByType:u=>l.find(({id:a})=>a===u)}},SO=({enforceModal:e=!1}={})=>{const t=Je(),r=bt(),{showMessage:n,showErrorMessage:o}=it(),{$gettext:i,$ngettext:s}=Ne.useGettext(),l=tr(),c=dr(),u=lr(),{defaultLinkType:a}=ua(),{addLink:f}=Mt(),{dispatchModal:d}=yt(),{copyToClipboard:b}=If(),E=async({result:m,password:g,options:v={}})=>{const T=m.filter(F=>F.status==="fulfilled");if(T.length){let F=i("Link has been created successfully");if(m.length===1)try{const C=v.copyPassword?i("%{link} Password:%{password}",{link:T[0].value.webUrl,password:g},!0):T[0].value.webUrl;await b(C),F=i("The link has been copied to your clipboard.")}catch(C){console.warn("Unable to copy link to clipboard",C)}n({title:s(F,"Links have been created successfully.",T.length)})}const A=m.filter(({status:F})=>F==="rejected");A.length&&o({errors:A.map(({reason:F})=>F),title:s("Failed to create link","Failed to create links",A.length)})},w=async({space:m,resources:g})=>{const v=l.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||v){d({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",g.length,{resourceName:g[0].name}),customComponent:Ov,customComponentAttrs:()=>({space:m,resources:g,callbackFn:E}),hideActions:!0});return}const T=g.map(F=>f({clientService:t,space:m,resource:F,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:y(a)}})),A=await u.addTask(()=>Promise.allSettled(T));E({result:A})},R=({resources:m})=>{if(!m.length)return!1;for(const g of m)if(!g.canShare({user:r.user,ability:c})||ie.isProjectSpaceResource(g)&&g.disabled)return!1;return!0};return{actions:V(()=>[{name:"create-links",icon:"link",handler:w,label:()=>i("Create links"),isVisible:R,class:"oc-files-actions-create-links"}])}},EO=Me({name:"AppLoadingSpinner"}),TO={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function AO(e,t,r,n,o,i){const s=pe("oc-spinner");return Z(),ve("div",TO,[we(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Mf=Ue(EO,[["render",AO]]),RO=Me({name:"FilePickerModal",components:{AppLoadingSpinner:Mf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=ue(),r=ue(!0),n=We(),{removeModal:o}=yt(),{getMatchingSpace:i}=ar(),s=oi(),{getEditorRouteOpts:l}=qr(),c=n.resolve(e.parentFolderLink),u=e.app.extensions.map(w=>w.extension?w.extension:w.mimeType),a=s.currentTheme.name,f=new URL(c.href,window.location.origin);f.searchParams.append("hide-logo","true"),f.searchParams.append("embed","true"),f.searchParams.append("embed-target","file"),f.searchParams.append("embed-delegate-authentication","false"),f.searchParams.append("embed-file-types",u.join(","));const d=()=>{r.value=!1,y(t).contentWindow.focus()},b=({data:w})=>{if(w.name!=="opencloud-embed:file-pick")return;const{resource:R,locationQuery:S}=w.data,m=i(R),g=ie.isShareSpaceResource(m)?m.id:void 0,v=l(y(n.currentRoute).name,m,R,g);v.query={...v.query,...S};const T=n.resolve(v),A=new URL(T.href,window.location.origin);o(e.modal.id),window.open(A.href,"_blank")},E=({data:w})=>{w.name==="opencloud-embed:cancel"&&o(e.modal.id)};return Vt(()=>{window.addEventListener("message",b),window.addEventListener("message",E)}),Gr(()=>{window.removeEventListener("message",b),window.removeEventListener("message",E)}),{isLoading:r,onLoad:d,iframeTitle:a,iframeSrc:f.href,iframeRef:t,onFilePick:b}}}),_O={class:"oc-height-1-1",tabindex:"0"},IO=["title","src"];function CO(e,t,r,n,o,i){const s=pe("app-loading-spinner");return Z(),ve("div",_O,[e.isLoading?(Z(),Ce(s,{key:0})):ke("",!0),ot(he("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,IO),[[tl,!e.isLoading]])])}const kv=Ue(RO,[["render",CO]]),fa=(e={},t)=>{const r=e.targetRouteCallback,{getMatchingSpace:n}=ar(e);return{createFileAction:s=>{const l=y(e.space)||n(s);t.emit("fileClick",{space:l,resources:[s]})},createFolderLink:s=>{if(y(r))return y(r)(s);const{path:l,fileId:c,resource:u}=s,a=y(e.space)||n(u);return a?xr("files-spaces-generic",Jr(a,{path:l,fileId:c})):{}}}},ai=(e={})=>{const t=tr(),{$gettext:r}=Ne.useGettext(),{getInternalSpace:n,getMatchingSpace:o,isResourceAccessible:i}=ar(),{createFolderLink:s}=fa(e);return{getPathPrefix:d=>{const b=y(e.space)||o(d);return ie.isProjectSpaceResource(b)?cs.join(r("Spaces"),b.name):ie.isShareSpaceResource(b)?cs.join(r("Shares"),b.name):b.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const b=y(e.space)||o(d),E=i({space:b,path:ht.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!E?Or("files-shares-with-me"):ie.isProjectSpaceResource(d)?xr("files-spaces-projects"):s({path:ht.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const b=y(e.space)||o(d),E=i({space:b,path:ht.dirname(d.path)});if(ie.isShareRoot(d)||d.id===b.id&&ie.isShareSpaceResource(b)||!E)return r("Shared with me");const R=ie.extractParentFolderName(d);if(R)return R;if(ie.isShareSpaceResource(b))return b.name;if(t.spacesProjects){if(ie.isProjectSpaceResource(d))return r("Spaces");if((b==null?void 0:b.driveType)==="project")return b.name}return r("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>ie.isProjectSpaceResource(d)||ie.isProjectSpaceResource(n(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Nv=({appId:e})=>{const{$gettext:t}=Ne.useGettext(),r=On(),{dispatchModal:n}=yt(),o=Zr(),{apps:i}=Qe.storeToRefs(o),{getParentFolderLink:s}=ai(),l=({resources:u})=>{const a=y(i)[e],f=s(u[0]);n({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:a.name}),customComponent:kv,hideActions:!0,customComponentAttrs:()=>({app:a,parentFolderLink:f}),focusTrapInitial:!1})};return{actions:V(()=>[{name:"open-with-app",icon:"folder-open",handler:l,label:()=>t("Open"),isVisible:()=>!y(r),class:"oc-files-actions-open-with-app-trigger"}])}},FO=Me({name:"SaveAsModal",components:{AppLoadingSpinner:Mf},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=ue(),r=ue(!0),n=oi(),{$gettext:o}=Ne.useGettext(),i=We(),s=Je(),{removeModal:l}=yt(),{showMessage:c,showErrorMessage:u}=it(),{getMatchingSpace:a}=ar(),{getEditorRouteOpts:f}=qr(),d=i.resolve(e.parentFolderLink),b=n.currentTheme.name,E=new URL(d.href,window.location.origin);E.searchParams.append("hide-logo","true"),E.searchParams.append("embed","true"),E.searchParams.append("embed-target","location"),E.searchParams.append("embed-choose-file-name","true"),E.searchParams.append("embed-delegate-authentication","false"),E.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const w=()=>{r.value=!1,y(t).contentWindow.focus()},R=async({data:v})=>{if(v.name!=="opencloud-embed:select")return;const{resources:T,fileName:A,locationQuery:F}=v.data,C=T[0],I=a(C);try{const L=await S({destinationFolder:C,fileName:A,space:I});c({title:o('"%{fileName}" was saved successfully',{fileName:L.name})}),m({resource:L,space:I,locationQuery:F})}catch(L){console.error(L),u({title:o('Unable to save "%{fileName}"',{fileName:A}),errors:[L]}),console.error(L)}l(e.modal.id)},S=async({destinationFolder:v,fileName:T,space:A})=>{const{children:F}=await s.webdav.listFiles(A,{fileId:v.fileId},{davProperties:[Ve.Name]});return F.find(I=>I.name===T)&&(T=jr(T,e.originalResource.extension,F)),s.webdav.putFileContents(A,{fileName:T,parentFolderId:v.id,content:e.content,path:ie.urlJoin(v.path,T)})},m=({locationQuery:v,resource:T,space:A})=>{const F=ie.isShareSpaceResource(A)?A.id:void 0,C=f(y(i.currentRoute).name,A,T,F);C.query={...C.query,...v};const I=i.resolve(C),L=new URL(I.href,window.location.origin);window.open(L.href,"_blank")},g=({data:v})=>{v.name==="opencloud-embed:cancel"&&l(e.modal.id)};return Vt(()=>{window.addEventListener("message",R),window.addEventListener("message",g)}),Gr(()=>{window.removeEventListener("message",R),window.removeEventListener("message",g)}),{isLoading:r,onLoad:w,iframeTitle:b,iframeSrc:E.href,iframeRef:t,onLocationPick:R}}}),PO={class:"oc-height-1-1",tabindex:"0"},xO=["title","src"];function OO(e,t,r,n,o,i){const s=pe("app-loading-spinner");return Z(),ve("div",PO,[e.isLoading?(Z(),Ce(s,{key:0})):ke("",!0),ot(he("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,xO),[[tl,!e.isLoading]])])}const $v=Ue(FO,[["render",OO]]),Dv=({content:e})=>{const{$gettext:t}=Ne.useGettext(),r=On(),{dispatchModal:n}=yt(),{getParentFolderLink:o}=ai(),i=({resources:l})=>{const c=o(l[0]);n({elementClass:"save-as-modal",title:t("Save as"),customComponent:$v,hideActions:!0,customComponentAttrs:()=>({content:y(e),parentFolderLink:c,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:V(()=>[{name:"save-as",icon:"save-2",handler:i,label:()=>t("Save as"),isVisible:({resources:l})=>!y(r)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},Lv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n,$ngettext:o}=Ne.useGettext(),i=dr(),s=Je(),l=Jt(),{dispatchModal:c}=yt(),u=dt(),{removeResources:a}=Ke(),f=w=>w.filter(R=>ie.isProjectSpaceResource(R)&&R.canBeDeleted({user:r.user,ability:i})),d=async w=>{const R=s.graphAuthenticated,S=w.map(T=>R.drives.deleteDrive(T.id).then(()=>(a([T]),u.removeSpace(T),!0))),m=await Promise.allSettled(S),g=m.filter(T=>T.status==="fulfilled");if(g.length){const T=g.length===1&&w.length===1?n('Space "%{space}" was deleted successfully',{space:w[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",g.length,{spaceCount:g.length.toString()},!0);e({title:T})}const v=m.filter(T=>T.status==="rejected");if(v.length){v.forEach(console.error);const T=v.length===1&&w.length===1?n('Failed to delete space "%{space}"',{space:w[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",v.length,{spaceCount:v.length.toString()},!0);t({title:T,errors:v.map(A=>A.reason)})}y(l).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.list.load")},b=({resources:w})=>{const R=f(w);if(!R.length)return;const S=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",R.length,{count:R.length.toString()});c({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",R.length,{space:R[0].name,spaceCount:R.length.toString()}),confirmText:n("Delete"),message:S,hasInput:!1,onConfirm:()=>d(R)})};return{actions:V(()=>[{name:"delete",icon:"delete-bin",label:()=>n("Delete"),handler:b,isVisible:({resources:w})=>!!f(w).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},Bv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n,$ngettext:o}=Ne.useGettext(),i=dr(),s=Je(),l=Jt(),c=We(),{dispatchModal:u}=yt(),a=dt(),f=w=>w.filter(R=>ie.isProjectSpaceResource(R)&&R.canDisable({user:r.user,ability:i})),d=async w=>{const R=y(l),S=s.graphAuthenticated,m=w.map(A=>S.drives.disableDrive(A.id).then(()=>(R.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),R.name==="admin-settings-spaces"&&(A.disabled=!0,A.spaceQuota={total:A.spaceQuota.total}),a.updateSpaceField({id:A.id,field:"disabled",value:!0}),!0))),g=await Promise.allSettled(m),v=g.filter(A=>A.status==="fulfilled");if(v.length){const A=v.length===1&&w.length===1?n('Space "%{space}" was disabled successfully',{space:w[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:A})}const T=g.filter(A=>A.status==="rejected");if(T.length){T.forEach(console.error);const A=T.length===1&&w.length===1?n('Failed to disable space "%{space}"',{space:w[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",T.length,{spaceCount:T.length.toString()},!0);t({title:A,errors:T.map(F=>F.reason)})}},b=({resources:w})=>{const R=f(w);if(!R.length)return;const S=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.",R.length,{count:R.length.toString()}),m=n("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",R.length,{space:R[0].name,spaceCount:R.length.toString()}),confirmText:m,message:S,hasInput:!1,onConfirm:()=>d(R)})};return{actions:V(()=>[{name:"disable",icon:"stop-circle",label:()=>n("Disable"),handler:b,isVisible:({resources:w})=>!!f(w).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},Mv=()=>{const e=at(),t=dt(),r=Mt(),{showMessage:n,showErrorMessage:o}=it(),i=We(),{$gettext:s}=Ne.useGettext(),l=dr(),c=Je(),u=lr(),{upsertResource:a}=Ke(),f=ct(i,"files-spaces-projects"),d=async w=>{const R=t.spaces.filter(ie.isProjectSpaceResource),S=jr(w.name,"",R);try{let m=await c.graphAuthenticated.drives.createDrive({name:S,description:w.description,quota:{total:w.spaceQuota.total}},r.graphRoles);const g=await c.webdav.listFiles(w);if(g.children.length){const v=new Bn({concurrency:e.options.concurrentRequests.resourceBatchActions}),T=[];for(const A of g.children)T.push(v.add(()=>c.webdav.copyFiles(w,A,m,{path:A.name})));await Promise.all(T)}if(w.spaceReadmeData||w.spaceImageData){const v={special:[]};if(w.spaceReadmeData){const T=await c.webdav.getFileInfo(m,{path:`.space/${w.spaceReadmeData.name}`});v.special.push({specialFolder:{name:"readme"},id:T.id})}if(w.spaceImageData){const T=await c.webdav.getFileInfo(m,{path:`.space/${w.spaceImageData.name}`});v.special.push({specialFolder:{name:"image"},id:T.id})}m=await c.graphAuthenticated.drives.updateDrive(m.id,v,r.graphRoles)}t.upsertSpace(m),f&&a(m),n({title:s('Space "%{space}" was duplicated successfully',{space:w.name})})}catch(m){console.error(m),o({title:s('Failed to duplicate space "%{space}"',{space:w.name}),errors:[m]})}},b=async({resources:w})=>{for(const R of w)R.disabled||!ie.isProjectSpaceResource(R)||await d(R)};return{actions:V(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:w=>u.addTask(()=>b(w)),isVisible:({resources:w})=>!(w!=null&&w.length)||w.every(R=>R.disabled)||w.every(R=>!ie.isProjectSpaceResource(R))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},kO=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n}=Ne.useGettext(),o=dr(),i=Je(),s=Jt(),{dispatchModal:l}=yt(),c=dt(),u=Mt(),a=(b,E)=>i.graphAuthenticated.drives.updateDrive(b.id,{name:b.name,description:E},u.graphRoles).then(()=>{c.updateSpaceField({id:b.id,field:"description",value:E}),y(s).name==="admin-settings-spaces"&&(b.description=E),e({title:n("Space subtitle was changed successfully")})}).catch(R=>{console.error(R),t({title:n("Failed to change space subtitle"),errors:[R]})}),f=({resources:b})=>{b.length===1&&l({title:n("Change subtitle for space")+" "+b[0].name,confirmText:n("Confirm"),hasInput:!0,inputLabel:n("Space subtitle"),inputValue:b[0].description,onConfirm:E=>a(b[0],E)})};return{actions:V(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>n("Edit subtitle"),handler:f,isVisible:({resources:b})=>b.length!==1?!1:b[0].canEditDescription({user:r.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:a}},NO={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=ue(void 0),t=ue([]);return{selectedOption:e,options:t}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return Ct.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(r=>this.totalQuota===0&&r.value===0?(r.selectable=!1,!0):r.value!==0&&r.value<=this.maxQuota)),e.find(r=>r.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(r=>r.value).sort((r,n)=>r.value-n.value),...e.filter(r=>!r.value)],this.options=e},getFormattedFileSize(e){const t=wr(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},$O={class:"quota-select-batch-action-form"},DO=["textContent"],LO={class:"oc-flex oc-flex-between"},BO=["textContent"],MO={key:0,class:"oc-text-input-danger"};function jO(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-select");return Z(),ve("div",$O,[we(l,Yt({ref:"select","model-value":n.selectedOption,selectable:i.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:n.options,"create-option":i.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":i.onUpdate}),{"selected-option":Te(({displayValue:c})=>[e.$attrs["read-only"]?(Z(),Ce(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):ke("",!0),he("span",{textContent:K.toDisplayString(c)},null,8,DO)]),search:Te(({attributes:c,events:u})=>[he("input",Yt({class:"vs__search"},c,Ha(u,!0)),null,16)]),option:Te(({displayValue:c,error:u})=>[he("div",LO,[he("span",{textContent:K.toDisplayString(c)},null,8,BO)]),u?(Z(),ve("div",MO,K.toDisplayString(u),1)):ke("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const jv=Ue(NO,[["render",jO]]),UO=Me({name:"SpaceQuotaModal",components:{QuotaSelect:jv},props:{modal:{type:Object,required:!0},spaces:{type:Array,required:!0},warningMessage:{type:String,default:""},warningMessageContextualHelperData:{type:Object,default:()=>{}},resourceType:{type:String,required:!1,default:"space",validator:e=>["space","user"].includes(e)}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:r}){const{showMessage:n,showErrorMessage:o}=it(),i=tr(),s=Qe.storeToRefs(i),{$gettext:l,$ngettext:c}=Ne.useGettext(),u=Je(),a=We(),f=dt(),d=Mt(),{updateResourceField:b}=Ke(),E=ue(0),w=v=>e.resourceType==="space"?c("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",v,{count:v.toString()}):e.resourceType==="user"?c("User quota was changed successfully","Quota of %{count} users was changed successfully",v,{count:v.toString()}):l("Quota was changed successfully"),R=v=>e.resourceType==="space"?c("Failed to change space quota","Failed to change quota for %{count} spaces",v,{count:v.toString()}):e.resourceType==="user"?c("Failed to change user quota","Failed to change quota for %{count} users",v,{count:v.toString()}):l("Failed to change quota"),S=V(()=>!e.spaces.some(v=>v.spaceQuota.total!==y(E)));Et(S,()=>{t("update:confirmDisabled",y(S))},{immediate:!0});const m=v=>{E.value=v.value},g=async()=>{const v=u.graphAuthenticated,T=e.spaces.map(async I=>{const L=await v.drives.updateDrive(I.id,{name:I.name,quota:{total:y(E)}},d.graphRoles);y(a.currentRoute).name==="admin-settings-spaces"&&Xe.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:I.id,quota:L.spaceQuota}),y(a.currentRoute).name==="admin-settings-users"&&Xe.publish("app.admin-settings.users.user.quota.updated",{spaceId:I.id,quota:L.spaceQuota}),f.updateSpaceField({id:I.id,field:"spaceQuota",value:L.spaceQuota}),b({id:I.id,field:"spaceQuota",value:L.spaceQuota})}),A=await Promise.allSettled(T),F=A.filter(I=>I.status==="fulfilled");F.length&&n({title:w(F.length)});const C=A.filter(I=>I.status==="rejected");C.length&&(console.error(C),C.forEach(console.error),o({title:R(C.length),errors:C.map(I=>I.reason)}))};return r({onConfirm:g}),Vt(()=>{var v,T;E.value=((T=(v=e.spaces[0])==null?void 0:v.spaceQuota)==null?void 0:T.total)||0}),{selectedOption:E,confirmButtonDisabled:S,changeSelectedQuotaOption:m,maxQuota:s.spacesMaxQuota,onConfirm:g}}}),qO={key:0,class:"oc-mt-s"},VO=["textContent"];function zO(e,t,r,n,o,i){const s=pe("quota-select"),l=pe("oc-contextual-helper");return Z(),ve(Ye,null,[we(s,{"total-quota":e.selectedOption,"max-quota":e.maxQuota,"position-fixed":!0,onSelectedOptionChange:e.changeSelectedQuotaOption},null,8,["total-quota","max-quota","onSelectedOptionChange"]),e.warningMessage?(Z(),ve("div",qO,[he("span",{class:"oc-text-input-warning",textContent:K.toDisplayString(e.warningMessage)},null,8,VO),e.warningMessageContextualHelperData?(Z(),Ce(l,Yt({key:0,class:"oc-pl-xs"},e.warningMessageContextualHelperData),null,16)):ke("",!0)])):ke("",!0)],64)}const Uv=Ue(UO,[["render",zO]]),qv=()=>{const{dispatchModal:e}=yt(),{$gettext:t}=Ne.useGettext(),r=dr(),n=({resources:s})=>s.length===1?t('Change quota for Space "%{name}"',{name:s[0].name}):t("Change quota for %{count} Spaces",{count:s.length.toString()}),o=({resources:s})=>{e({title:n({resources:s}),customComponent:Uv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:V(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:s})=>!s||!s.length||s.some(l=>!ie.isProjectSpaceResource(l)||ie.isSpaceResource(l)&&!l.spaceQuota)?!1:r.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Vv(){const{getDefaultAction:e}=qr();return{openWithDefaultApp:({space:r,resource:n})=>{if(!n||n.isFolder)return;const o={resources:[n],space:r},i=e({...o,omitSystemActions:!0});i&&i.handler(o)}}}const WO=()=>{const e=Je(),{openWithDefaultApp:t}=Vv(),{createDefaultMetaFolder:r}=Li(),n=bt(),o=dt(),i=Mt(),{$gettext:s}=Ne.useGettext(),{getDefaultMetaFolder:l}=si(),c=async(f,d)=>{const b=await e.webdav.putFileContents(f,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),E=await e.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"readme"},id:b.id}]},i.graphRoles);return o.updateSpaceField({id:f.id,field:"spaceReadmeData",value:E.spaceReadmeData}),b},u=async({resources:f})=>{let d=null,b=await l(f[0]);if(b||(b=await r(f[0]),d=await c(f[0],b)),!d){const E=ie.getRelativeSpecialFolderSpacePath(f[0],"readme");E?d=await e.webdav.getFileInfo(f[0],{path:E}):d=await c(f[0],b)}t({space:f[0],resource:d})};return{actions:V(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditReadme({user:n.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},zv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n}=Ne.useGettext(),o=dr(),i=Je(),s=Jt(),{checkSpaceNameModalInput:l}=si(),{dispatchModal:c}=yt(),u=dt(),a=Mt(),f=(E,w)=>i.graphAuthenticated.drives.updateDrive(E.id,{name:w},a.graphRoles).then(()=>{y(s).name==="admin-settings-spaces"&&(E.name=w),u.updateSpaceField({id:E.id,field:"name",value:w}),e({title:n("Space name was changed successfully")})}).catch(S=>{console.error(S),t({title:n("Failed to rename space"),errors:[S]})}),d=({resources:E})=>{E.length===1&&c({title:n("Rename space")+" "+E[0].name,confirmText:n("Rename"),hasInput:!0,inputLabel:n("Space name"),inputValue:E[0].name,onConfirm:w=>f(E[0],w),onInput:l})};return{actions:V(()=>[{name:"rename",icon:"pencil",label:()=>n("Rename"),handler:d,isVisible:({resources:E})=>E.length!==1?!1:E[0].canRename({user:r.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:f}},Wv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n,$ngettext:o}=Ne.useGettext(),i=dr(),s=Je(),l=lr(),c=Jt(),{dispatchModal:u}=yt(),a=dt(),f=Mt(),d=R=>R.filter(S=>ie.isProjectSpaceResource(S)&&S.canRestore({user:r.user,ability:i})),b=async R=>{const S=s.graphAuthenticated,m=R.map(A=>S.drives.updateDrive(A.id,{name:A.name},f.graphRoles,{headers:{Restore:"true"}}).then(F=>(y(c).name==="admin-settings-spaces"&&(A.disabled=!1,A.spaceQuota=F.spaceQuota),a.updateSpaceField({id:A.id,field:"disabled",value:!1}),!0))),g=await l.addTask(()=>Promise.allSettled(m)),v=g.filter(A=>A.status==="fulfilled");if(v.length){const A=v.length===1&&R.length===1?n('Space "%{space}" was enabled successfully',{space:R[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:A})}const T=g.filter(A=>A.status==="rejected");if(T.length){T.forEach(console.error);const A=T.length===1&&R.length===1?n('Failed to enabled space "%{space}"',{space:R[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",T.length,{spaceCount:T.length.toString()},!0);t({title:A,errors:T.map(F=>F.reason)})}},E=({resources:R})=>{const S=d(R);if(!S.length)return;const m=o("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=n("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,icon:"alert",message:m,hasInput:!1,onConfirm:()=>b(S)})};return{actions:V(()=>[{name:"restore",icon:"play-circle",label:()=>n("Enable"),handler:E,isVisible:({resources:R})=>!!d(R).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:b}},HO=()=>{const{$gettext:e}=Ne.useGettext(),t=Ke(),r=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Xe.publish(mt.openWithPanel,"space-share")};return{actions:V(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},GO=()=>{const e=We(),{$gettext:t}=Ne.useGettext(),r=o=>_i("files-trash-generic",{...Jr(o,{fileId:o.fileId})});return{actions:V(()=>[{name:"navigateToTrash",icon:"delete-bin",label:()=>t("Show deleted files"),handler:({resources:o})=>{e.push(r(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!ie.isProjectSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},KO=Me({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const r=oi(),{currentTheme:n}=Qe.storeToRefs(r),o=V(()=>y(n).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function QO(e,t,r,n,o,i){const s=pe("oc-emoji-picker");return Z(),Ce(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Hv=Ue(KO,[["render",QO]]),XO=()=>{const e=bt(),{showMessage:t,showErrorMessage:r}=it(),{$gettext:n}=Ne.useGettext(),o=Je(),i=lr(),s=dt(),{createDefaultMetaFolder:l}=Li(),{dispatchModal:c}=yt(),{getDefaultMetaFolder:u}=si(),a=Mt(),f=({resources:w})=>{w.length===1&&c({elementClass:"oc-width-auto",title:n("Set icon for %{space}",{space:w[0].name}),hideConfirmButton:!0,customComponent:Hv,focusTrapInitial:!1,onConfirm:R=>b(w[0],R)})},d=async w=>{const R=document.createElement("canvas"),S=R.getContext("2d"),m=16/9,g=720,v=g/m;R.width=g,R.height=v;const T=.4*g;S.font=`${T}px sans-serif`,S.textBaseline="middle",S.textAlign="center",S.fillText(w,R.width/2,R.height/2+15);const F=await Fb(R);return Cb(F)},b=async(w,R)=>{const S=o.graphAuthenticated,m=await d(R);let g=await u(w);return g||(g=await l(w)),i.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:T}=await o.webdav.putFileContents(w,{parentFolderId:g.id,fileName:"emoji.png",content:m,headers:v,overwrite:!0}),A=await S.drives.updateDrive(w.id,{name:w.name,special:[{specialFolder:{name:"image"},id:T}]},a.graphRoles);s.updateSpaceField({id:w.id,field:"spaceImageData",value:A.spaceImageData}),t({title:n("Space icon was set successfully")}),Xe.publish("app.files.spaces.uploaded-image",A)}catch(T){console.error(T),r({title:n("Failed to set space icon"),errors:[T]})}})};return{actions:V(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:f,label:()=>n("Set icon"),isVisible:({resources:w})=>w.length!==1?!1:w[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:b}},YO=()=>{const{$gettext:e}=Ne.useGettext();return{actions:V(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Xe.publish(mt.open),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},JO=()=>{const{getMatchingSpace:e}=ar(),t=dt(),r=Zr(),n=Ke(),o=Je(),{$gettext:i}=Ne.useGettext(),{openEditor:s}=qr(),{resources:l,currentFolder:c}=Qe.storeToRefs(n);return{openEmptyEditor:async(a,f)=>{var g;let d=y(c)?e(y(c)):null,b=y(l),E=(g=y(c))==null?void 0:g.path;(!d||!y(c).canCreate())&&(d=t.personalSpace,b=(await o.webdav.listFiles(d)).children,E="");let w=i("New file")+`.${f}`;b.some(v=>v.name===w)&&(w=jr(w,f,b));const R=await o.webdav.putFileContents(d,{path:ie.urlJoin(E,w)}),S=e(R),m=r.fileExtensions.find(({app:v,extension:T})=>v===a&&T===f);s(m,S,R)}}},Gv=()=>{const{$gettext:e}=Ne.useGettext(),{showMessage:t}=it();return{openUrl:(n,o,i)=>{const s=window.open(n,o);s?i&&s.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},ZO=()=>yn("$appProviderService"),ek=()=>{const{isResourceAccessible:e}=ar();return{breadcrumbsFromPath:({route:n,space:o,resourcePath:i,ancestorMetaData:s=ue({})})=>{const l=(a="")=>a.split("/").filter(Boolean),c=l(n.path),u=l(i);return u.map((a,f)=>{const d=ie.urlJoin(...u.slice(0,f+1),{leadingSlash:!0}),b=e({space:y(o),path:d});let E;return b&&(E=y(s)[d]),{id:Qt.v4(),allowContextActions:!0,text:a,...b&&{to:{path:"/"+[...c].splice(0,c.length-u.length+f+1).join("/"),query:{...$i(n.query,"page","fileId"),...E&&{fileId:E.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...n)=>{const o=n.pop();return[...n,{id:Qt.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Xe.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},tk=(e="")=>{const t=ue(0),r=async()=>{await Hr();const n=document.querySelector(e||"#files-app-bar"),o=n?n.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=r,Vt(r),{y:t,refresh:r}},jf=()=>{const e=ue(!0),t=()=>{e.value=window.innerHeight>500};return Vt(()=>{t(),window.addEventListener("resize",t)}),Gr(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var Uf=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e))(Uf||{}),qf=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(qf||{});const rk=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const r=document.activeElement;if(!r)return!1;let n;try{n=r==null?void 0:r.closest("[data-custom-key-bindings-disabled='true']")}catch{n=r==null?void 0:r.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return n?!0:window.getSelection().type==="Range"},Kv=e=>{const t=ue([]),r=ue(0),n=l=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&rk())return;const{key:c,ctrlKey:u,metaKey:a,shiftKey:f}=l;let d=null;const b=[];a||u?(d="Control",b.push("altKey","shiftKey")):f&&(d="Shift",b.push("altKey","ctrlKey","metaKey")),!((w,R)=>R.some(S=>w[S]))(l,b)&&y(t).filter(w=>w.primary===c&&w.modifier===d).forEach(w=>{l.preventDefault(),w.callback(l)})},o=(l,c)=>{const u=Qt.v4();return t.value.push({id:u,...l,modifier:l.modifier??null,callback:c}),u},i=l=>{t.value=t.value.filter(c=>c.id!==l)},s=()=>{r.value=0};return Mn.useEventListener(document,"keydown",n),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:r,resetSelectionCursor:s}};class En{}Ee(En,"perPageDefault","100"),Ee(En,"perPageQueryName","items-per-page"),Ee(En,"options",["20","50","100","250","500"]);function nk(e){const t=Lo.useRouter(),r=Lo.useRoute(),n=ik(e),o=ok(e),i=V(()=>Math.ceil(y(e.items).length/y(o))||1),s=V(()=>{if(!y(o))return y(e.items);const l=(y(n)-1)*y(o),c=l+y(o);return y(e.items).slice(l,c)});return Xe.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:c,topbarElement:u})=>{const a=Ct.findIndex(y(e.items),f=>f.id===l);if(a>=0){const f=Math.ceil((a+1)/Number(y(o)));t.push({...y(r),query:{...y(r).query,page:f}}).then(()=>{Xe.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:c,topbarElement:u})})}}),{items:s,total:i,page:n,perPage:o}}function ik(e){if(e.page)return V(()=>y(e.page));const t=rr("page","1");return V(()=>parseInt(St(y(t))))}function ok(e){if(e.perPage)return V(()=>y(e.perPage));const t=wn({name:e.perPageQueryName||En.perPageQueryName,defaultValue:e.perPageDefault||En.perPageDefault,storagePrefix:e.perPageStoragePrefix});return V(()=>parseInt(St(y(t))))}const Qv=()=>yn("$passwordPolicyService");var da=(e=>(e.mounted="portal-target.mounted",e))(da||{});const sk=()=>{const e=Fo(),t=va.useWormhole();return{registerPortal:n=>{e.subscribe(da.mounted,()=>{t.open(n)})}}},Vf=()=>{const e=Zr();return{canBeOpenedWithSecureView:r=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===r.mimeType)}},Xv=()=>{const e=bt();return{canListVersions:({space:r,resource:n})=>n.type==="folder"||ie.isSpaceResource(n)||ie.isTrashResource(n)?!1:r==null?void 0:r.canListVersions({user:e.user})}},Yv=()=>{const e=Je(),t=dt(),r=Mt(),n=V(()=>t.spaces),o=c=>y(n).find(u=>c.toString().startsWith(u.id.toString())),i=c=>y(n).find(u=>{var a,f;return ie.isMountPointSpaceResource(u)&&((f=(a=u.root)==null?void 0:a.remoteItem)==null?void 0:f.id)===c}),s=c=>{const u=[Ve.FileId,Ve.FileParent,Ve.Name,Ve.ResourceType],a=ie.buildSpace({id:c,name:""},r.graphRoles);return e.webdav.getFileInfo(a,{fileId:c},{davProperties:u})};return{getResourceContext:async c=>{var w,R,S,m,g;let u,a,f=o(c);if(f)return u=await e.webdav.getPathForFileId(c),a=await e.webdav.getFileInfo(f,{path:u}),{space:f,resource:a,path:u};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(c);a=await s(c);const b=d?[]:[y(a).name];let E=y(a);for(;!d;)E=await s(E.parentFolderId),d=i(E.id),d||b.unshift(E.name);return f=t.getSpace((R=(w=d.root)==null?void 0:w.remoteItem)==null?void 0:R.id)||t.createShareSpace({driveAliasPrefix:(S=a.storageId)!=null&&S.startsWith(ie.OCM_PROVIDER_ID)?"ocm-share":"share",id:(g=(m=d.root)==null?void 0:m.remoteItem)==null?void 0:g.id,shareName:d.name}),u=ie.urlJoin(...b),{space:f,resource:a,path:u}}}},Gt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},Jv=()=>{const e=i=>{if(!i.endsWith("rem")&&!i.endsWith("px"))return 0;if(i.endsWith("rem")){const s=parseInt(i.replace("rem","").trim()),l=parseFloat(getComputedStyle(document.documentElement).fontSize);return s*l}return parseInt(i.replace("px","").trim())},t=ue(0),r=ue(0);Vt(()=>{const i=getComputedStyle(document.documentElement);t.value=e(i.getPropertyValue("--oc-size-tiles-default")),r.value=e(i.getPropertyValue("--oc-size-tiles-resize-step"))});const n=i=>y(t)+(i-1)*y(r);return{calculateTileSizePixels:n,calculateTileSizeRem:i=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(i)/s}}};function ak(e){if(e)return V(()=>y(e));const t=wn({name:Gt.queryName,defaultValue:Gt.defaultModeName});return V(()=>St(y(t)))}function lk(e){if(e)return V(()=>parseInt(y(e)));const t=wn({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()});return V(()=>parseInt(St(y(t))))}const ck=ue(Gt.tilesSizeMax);function zf(){return ck}const Wf=e=>{const t=Of(),{updateResourceField:r}=Ke(),n=new Bn({concurrency:4}),o=V(()=>y(e)===Gt.name.tiles),i=V(()=>y(o)?zs.enum.fit:zs.enum.thumbnail),s=V(()=>y(o)?Vr.Tile:Vr.Thumbnail),l=cr.useTask(function*(f,{space:d,resource:b,dimensions:E,processor:w,updateStore:R=!0}){const S=ie.isProjectSpaceResource(b)?ie.buildSpaceImageResource(b):b,m=yield n.add(()=>t.loadPreview({space:d,resource:S,processor:w||y(i),dimensions:E||y(s)},!0,!0,f));return m&&R&&r({id:b.id,field:"thumbnail",value:m}),m}),c=async f=>{const{resource:d,cancelRunning:b}=f;if(b&&a(),ie.isProjectSpaceResource(d)&&(!d.spaceImageData||d.disabled))return null;try{return await l.perform(f)}catch(E){E!=="cancel"&&console.error(E)}},u=V(()=>l.isRunning),a=()=>{l.cancelAll(),n.clear()};return za(a),{loadPreview:c,previewsLoading:u}},Zv=({showSizeInformation:e=!0}={})=>{const t=Ke(),{current:r,$gettext:n,$ngettext:o}=Ne.useGettext(),i=We(),{resources:s,totalResourcesCount:l,areHiddenFilesShown:c,currentFolder:u}=Qe.storeToRefs(t),a=V(()=>{var d,b;if(!((d=y(u))!=null&&d.size)||((b=y(u))==null?void 0:b.size)==="0"){const E=y(s).map(w=>w.size?parseInt(w.size.toString()):0).reduce((w,R)=>w+R,0);return wr(E,r)}return wr(y(u).size,r)});return{resourceContentsText:V(()=>{let d=o("%{ filesCount } file","%{ filesCount } files",y(l).files,{filesCount:y(l).files.toString()});!y(c)&&y(l).hiddenFiles&&(d=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",y(l).files,{filesCount:y(l).files.toString(),filesHiddenCount:y(l).hiddenFiles.toString()}));let b=o("%{ foldersCount } folder","%{ foldersCount } folders",y(l).folders,{foldersCount:y(l).folders.toString()});!y(c)&&y(l).hiddenFolders&&(b=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",y(l).folders,{foldersCount:y(l).folders.toString(),foldersHiddenCount:y(l).hiddenFolders.toString()}));const E=o("%{ spacesCount } space","%{ spacesCount } spaces",y(l).spaces,{spacesCount:y(l).spaces.toString()}),w=y(l).files+y(l).folders+y(l).spaces,R=e&&parseFloat(y(a))>0,S=kt(i,"files-shares-via-link"),m=n(R?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),g=n(R?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),v=S?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",T=`${m} ${v}`,A=`${g} ${v}`;return o(T,A,w,{itemsCount:w.toString(),itemSize:y(a),filesStr:d,foldersStr:b,spacesStr:E})})}},Hf=()=>{const{getMatchingSpace:e}=ar(),t=Ke(),r=V({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:l})=>l))}}),n=V({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>y(n).includes(s.id),i=V(()=>{if(y(r).length!==1)return null;const s=y(r)[0];return e(s)});return{selectedResources:r,selectedResourcesIds:n,isResourceInSelection:o,selectedResourceSpace:i}};function uk(e){const t=tr(),r=Yn(),n=Je(),o=Ne.useGettext(),i=V(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return r.publicLinkPassword?u.Authorization="Basic "+po.from(["public",r.publicLinkPassword].join(":")).toString("base64"):r.accessToken&&!r.publicLinkPassword&&(u.Authorization="Bearer "+r.accessToken),u["X-Request-ID"]=Qt.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=n.initiatorId,u},l=V(()=>{const u={onBeforeRequest:(a,f)=>new Promise(d=>{var E;const b=s();a.setHeader("Authorization",b.Authorization),a.setHeader("X-Request-ID",b["X-Request-ID"]),a.setHeader("Accept-Language",b["Accept-Language"]),a.setHeader("Initiator-ID",b["Initiator-ID"]),f!=null&&f.isRemote&&a.setHeader("x-oc-mtime",(((E=f==null?void 0:f.data)==null?void 0:E.lastModified)/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=a=>{var f;if(a.xhrUpload||a!=null&&a.isRemote)return{"x-oc-mtime":(((f=a==null?void 0:a.data)==null?void 0:f.lastModified)/1e3).toFixed(0),...s()}},u}),c=V(()=>({timeout:6e4,endpoint:"",headers:u=>{var a;return{"x-oc-mtime":(((a=u==null?void 0:u.data)==null?void 0:a.lastModified)/1e3).toFixed(0),...s()}}}));Et([l,c],()=>{if(y(i)){e.uppyService.useTus(y(l));return}e.uppyService.useXhr(y(c))},{immediate:!0})}const fk=Me({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"},variation:{type:String,default:"passive"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1}},setup(e){const{$gettext:t}=Ne.useGettext(),r=at(),{options:n}=Qe.storeToRefs(r),o=V(()=>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=V(()=>({...{appearance:e.action.appearance||e.appearance,variation:e.action.variation||e.variation,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...y(o)==="router-link"&&{to:e.action.route(e.actionOptions)},...y(o)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(y(o))&&{target:n.value.cernFeatures?"_blank":"_self"}})),s=V(()=>window.navigator.platform.match("Mac")),l=V(()=>t("Hold %{key} and click to open in new tab",{key:y(s)?"⌘":t("ctrl")},!0));return{componentType:o,componentProps:i,openInNewTabHint:l}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),dk={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},pk=["textContent"],hk=["textContent"],gk=["textContent"];function mk(e,t,r,n,o,i){var a,f,d,b;const s=pe("oc-image"),l=pe("oc-icon"),c=pe("oc-button"),u=or("oc-tooltip");return ot((Z(),ve("li",null,[ot((Z(),Ce(c,Yt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","oc-py-s","oc-px-m","oc-width-1-1"],"aria-label":e.componentProps.disabled?(f=(a=e.action).disabledTooltip)==null?void 0:f.call(a,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},Ha(e.componentListeners)),{default:Te(()=>[e.action.img?(Z(),Ce(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(Z(),Ce(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(Z(),Ce(l,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):ke("",!0),e.action.hideLabel?ke("",!0):(Z(),ve("span",dk,[he("span",{textContent:K.toDisplayString(e.action.label(e.actionOptions))},null,8,pk),e.action.showOpenInNewTabHint?(Z(),ve("span",{key:0,class:"oc-text-muted oc-text-xsmall",textContent:K.toDisplayString(e.openInNewTabHint)},null,8,hk)):ke("",!0)])),e.action.shortcut&&e.shortcutHint?(Z(),ve("span",{key:4,class:"oc-files-context-action-shortcut",textContent:K.toDisplayString(e.action.shortcut)},null,8,gk)):ke("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(b=(d=e.action).disabledTooltip)==null?void 0:b.call(d,e.actionOptions):""]])}const Gf=Ue(fk,[["render",mk]]),yk=Me({name:"BatchActions",components:{ActionMenuItem:Gf},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function bk(e,t,r,n,o,i){const s=pe("action-menu-item"),l=pe("oc-list");return Z(),ve("div",null,[we(l,{id:"oc-appbar-batch-actions",class:K.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(e.actions,(c,u)=>(Z(),Ce(s,{key:`action-${u}`,action:c,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions oc-mr-s","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const e0=Ue(yk,[["render",bk]]),vk=Me({name:"ContextActionMenu",components:{ActionMenuItem:Gf},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},variation:{type:String,default:"passive"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("oc-pb-s"),e>0&&t.push("oc-pt-s"),e<this.menuSections.length-1&&t.push("oc-files-context-actions-border")),t}}}),wk={id:"oc-files-context-menu"};function Sk(e,t,r,n,o,i){const s=pe("action-menu-item"),l=pe("oc-list");return Z(),ve("div",wk,[(Z(!0),ve(Ye,null,Lt(e.menuSections,(c,u)=>(Z(),Ce(l,{id:`oc-files-context-actions-${c.name}`,key:`section-${c.name}-list`,class:K.normalizeClass(["oc-files-context-actions",e.getSectionClasses(u)])},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(c.items,(a,f)=>(Z(),Ce(s,{key:`section-${c.name}-action-${f}`,action:a,appearance:e.appearance,variation:e.variation,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},null,8,["action","appearance","variation","action-options"]))),128))]),_:2},1032,["id","class"]))),128))])}const Kf=Ue(vk,[["render",Sk]]),Ek=Me({name:"ContextActions",components:{ContextActionMenu:Kf},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t}=qr(),{actions:r}=ea(),{actions:n}=ta(),{actions:o}=ra(),{actions:i}=Cf(),{actions:s}=na(),{actions:l}=ia(),{actions:c}=oa(),{actions:u}=Po(),{actions:a}=Pf(),{actions:f}=Ff(),{actions:d}=sa(),{actions:b}=xf(),{actions:E}=Sv(),{actions:w}=aa(),{actions:R}=la(),{actions:S}=Ev(),{actions:m}=kf(),{actions:g}=$f(),{actions:v}=Nf(),T=Di(),A=V(()=>T.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),F=V(()=>T.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(J=>J.action)),C=Cw(e,"actionOptions"),I=V(()=>[...y(r),...y(s),...y(c),...y(d),...y(o),...y(f),...y(l),...y(R),...y(g),...y(F).filter(J=>J.category==="actions"||Ct.isNil(J.category))].filter(J=>J.isVisible(y(C)))),L=V(()=>[...y(m),...y(F).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(y(C)))),B=V(()=>[...y(t),...y(A).filter(J=>J.category==="context")].filter(J=>J.isVisible(y(C))).sort((J,ce)=>Number(ce.hasPriority)-Number(J.hasPriority))),$=V(()=>[...y(v),...y(i),...y(A).filter(J=>J.category==="share")].filter(J=>J.isVisible(y(C)))),D=V(()=>[...y(c),...y(u),...y(l),...y(d),...y(o),...y(E),...y(w),...y(g),...y(R),...y(r),...y(s),...y(n),...y(S),...y(A).filter(J=>J.category==="actions"||Ct.isNil(J.category))].filter(J=>J.isVisible(y(C)))),H=V(()=>[...y(a).map(J=>(J.keepOpen=!0,J)),...y(b),...y(m),...y(A).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(y(C))));return{menuSections:V(()=>{const J=[];return y(C).resources.length>1?(y(I).length&&J.push({name:"batch-actions",items:[...y(I)]}),J.push({name:"batch-details",items:[...y(L)]}),J):(y(B).length&&J.push({name:"context",items:y(B)}),y($).length&&J.push({name:"share",items:y($)}),y(D).length&&J.push({name:"actions",items:y(D)}),y(H).length&&J.push({name:"sidebar",items:y(H)}),J)})}}});function Tk(e,t,r,n,o,i){const s=pe("context-action-menu");return Z(),Ce(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const t0=Ue(Ek,[["render",Tk]]),Ak=Me({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>En.options},perPageQueryName:{type:String,default:()=>En.perPageQueryName},perPageDefault:{type:String,default:()=>En.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Gt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=We(),r=Jt(),{$gettext:n}=Ne.useGettext(),o=Ke(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s}=o,{areHiddenFilesShown:l,areFileExtensionsShown:c}=Qe.storeToRefs(o),u=ue(!1),a=rr("page"),f=V(()=>y(a)?parseInt(St(y(a))):1),d=wn({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),b=Qs(),E=wn({name:`${y(b)}-${Gt.queryName}`,defaultValue:e.viewModeDefault}),w=wn({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()}),R=g=>t.replace({query:{...y(r).query,[e.perPageQueryName]:g,...y(f)>1&&{page:"1"}}}),S=g=>{E.value=g.name};Et([d,E,w],g=>{u.value=g.some(v=>!v)},{immediate:!0,deep:!0});const m=zf();return{FolderViewModeConstants:Gt,viewModeCurrent:E,viewSizeCurrent:w,viewSizeMax:m,itemsPerPageCurrent:d,queryParamsLoading:u,queryItemAsString:St,setItemsPerPage:R,setViewMode:S,areHiddenFilesShown:l,areFileExtensionsShown:c,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,viewOptionsButtonLabel:n("Display customization options of the files list")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e}}}),Rk={class:"oc-flex oc-flex-middle"},_k={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},Ik={key:0,class:"files-view-options-list-item"},Ck={key:1,class:"files-view-options-list-item"},Fk={key:2,class:"files-view-options-list-item"},Pk={key:3,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},xk=["textContent"],Ok=["max"];function kk(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-button"),c=pe("oc-switch"),u=pe("oc-page-size"),a=pe("oc-list"),f=pe("oc-drop"),d=or("oc-tooltip");return Z(),ve("div",Rk,[e.viewModes.length>1?(Z(),ve("div",_k,[(Z(!0),ve(Ye,null,Lt(e.viewModes,b=>ot((Z(),Ce(l,{key:b.name,class:K.normalizeClass(b.name),appearance:e.viewModeCurrent===b.name?"filled":"outline","aria-label":e.$gettext(b.label),onClick:E=>e.setViewMode(b)},{default:Te(()=>[we(s,{name:b.icon.name,"fill-type":b.icon.fillType,size:"small",variation:"inherit"},null,8,["name","fill-type"])]),_:2},1032,["class","appearance","aria-label","onClick"])),[[d,e.$gettext(b.label)]])),128))])):ke("",!0),ot((Z(),Ce(l,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"oc-my-s oc-p-xs"},{default:Te(()=>[we(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[d,e.viewOptionsButtonLabel]]),we(f,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Te(()=>[we(a,null,{default:Te(()=>[e.hasHiddenFiles?(Z(),ve("li",Ik,[we(c,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=b=>e.hiddenFilesShownModel=b),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):ke("",!0),e.hasFileExtensions?(Z(),ve("li",Ck,[we(c,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=b=>e.fileExtensionsShownModel=b),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):ke("",!0),e.hasPagination?(Z(),ve("li",Fk,[e.queryParamsLoading?ke("",!0):(Z(),Ce(u,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):ke("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(Z(),ve("li",Pk,[he("label",{for:"tiles-size-slider",textContent:K.toDisplayString(e.$gettext("Tile size"))},null,8,xk),ot(he("input",{id:"tiles-size-slider","onUpdate:modelValue":t[2]||(t[2]=b=>e.viewSizeCurrent=b),type:"range",min:1,max:e.viewSizeMax,class:"oc-range","data-testid":"files-tiles-size-slider"},null,8,Ok),[[LS,e.viewSizeCurrent]])])):ke("",!0)]),_:1})]),_:1})])}const r0=Ue(Ak,[["render",kk],["__scopeId","data-v-af4bef96"]]),Nk=Me({components:{BatchActions:e0,ContextActions:t0,ViewOptions:r0},props:{viewModeDefault:{type:String,required:!1,default:()=>Gt.name.table},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},isSideBarOpen:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const r=dt(),{$gettext:n}=Ne.useGettext(),{can:o}=dr(),i=We(),{requestExtensions:s}=Di(),{isSticky:l}=jf(),c=Ke(),{selectedResources:u}=Qe.storeToRefs(c),a=V(()=>e.space),{actions:f}=ea(),{actions:d}=ta(),{actions:b}=ra(),{actions:E}=Mv(),{actions:w}=na(),{actions:R}=ia(),{actions:S}=oa(),{actions:m}=Po(),{actions:g}=Ff(),{actions:v}=sa(),{actions:T}=la(),{actions:A}=Lv(),{actions:F}=Bv(),{actions:C}=qv(),{actions:I}=Wv(),L=ue(0),B=xn(Tt,"files-common-search"),$=V(()=>Object.hasOwn(uS(),"navigation")&&o("create-all","Share")),D=V(()=>{let ae=[...y(d),...y(f),...y(w),...y(S),...y(m),...y(v),...y(b),...y(g),...y(R),...y(T)];B.value||(ae=[...ae,...y(E),...y(C),...y(I),...y(A),...y(F)]);const le=s({id:"global.files.batch-actions",extensionType:"action"});return le.length&&(ae=[...ae,...le.map(oe=>oe.action)]),ae.filter(oe=>oe.isVisible({space:y(a),resources:c.selectedResources}))}),H=V(()=>r.spaces.filter(ae=>ie.isPersonalSpaceResource(ae)||ie.isProjectSpaceResource(ae))),ee=In("isMobileWidth"),J=xn(Rr,"files-trash-generic"),ce=V(()=>!y(ee)&&e.breadcrumbs.length?!0:y(J)&&y(H).length===1?!1:e.breadcrumbs.length>1),be=V(()=>y(J)&&y(H).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),de=V(()=>y(a)&&(ie.isProjectSpaceResource(y(a))||ie.isShareSpaceResource(y(a)))?3:2),Se=ae=>{t(wf,ae)},Ae=qb("title"),ne=V(()=>{var ae;return y(Ae)?n(y(Ae)):((ae=y(a))==null?void 0:ae.name)||""});return{router:i,hasSharesNavigation:$,batchActions:D,showBreadcrumb:ce,showMobileNav:be,breadcrumbMaxWidth:L,breadcrumbTruncationOffset:de,fileDroppedBreadcrumb:Se,pageTitle:ne,selectedResources:u,isSticky:l}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return ld(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||Rr(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){var o,i,s,l;const e=((o=document.getElementById("web-content-main"))==null?void 0:o.getBoundingClientRect().width)||0,t=((i=document.getElementById("web-nav-sidebar"))==null?void 0:i.getBoundingClientRect().width)||0,r=((s=document.getElementById("app-sidebar"))==null?void 0:s.getBoundingClientRect().width)||0,n=(l=document.getElementById("files-app-bar-controls-right"))==null?void 0:l.clientWidth;this.breadcrumbMaxWidth=e-t-r-n,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),$k={class:"files-topbar oc-py-s"},Dk=["textContent"],Lk={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},Bk={class:"files-app-bar-actions oc-mt-xs"},Mk={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"};function jk(e,t,r,n,o,i){const s=pe("oc-hidden-announcer"),l=pe("context-actions"),c=pe("oc-breadcrumb"),u=pe("portal-target"),a=pe("view-options"),f=pe("batch-actions");return Z(),ve("div",{id:"files-app-bar",ref:"filesAppBar",class:K.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[he("div",$k,[he("h1",{class:"oc-invisible-sr",textContent:K.toDisplayString(e.pageTitle)},null,8,Dk),we(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),he("div",{class:K.normalizeClass(["oc-flex oc-flex-middle files-app-bar-controls",{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(Z(),Ce(c,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Te(()=>[we(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","onItemDroppedBreadcrumb"])):ke("",!0),e.showMobileNav?(Z(),Ce(u,{key:1,name:"app.runtime.mobile.nav"})):ke("",!0),e.hasSharesNavigation?Ge(e.$slots,"navigation",{key:2},void 0,!0):ke("",!0),e.hasViewOptions?(Z(),ve("div",Lk,[we(a,{"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"])])):ke("",!0)],2),he("div",Bk,[he("div",Mk,[Ge(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions?(Z(),Ce(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):ke("",!0)])]),Ge(e.$slots,"content",{},void 0,!0)])],2)}const Uk=Ue(Nk,[["render",jk],["__scopeId","data-v-5c40ce1f"]]),qk=Me({props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:r,showErrorMessage:n}=it(),{$gettext:o}=Ne.useGettext(),{createSpace:i}=Li(),{checkSpaceNameModalInput:s}=si(),{dispatchModal:l}=yt(),c=dt(),{upsertResource:u}=Ke(),a=async d=>{try{const b=await i(d);u(b),c.upsertSpace(b),t("spaceCreated",b),r({title:o("Space was created successfully")})}catch(b){console.error(b),n({title:o("Creating space failed…"),errors:[b]})}};return{showCreateSpaceModal:()=>{l({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),onConfirm:d=>a(d),onInput:s})}}}}),Vk=["textContent"];function zk(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-button"),c=or("oc-tooltip");return ot((Z(),Ce(l,{id:"new-space-menu-btn",key:"new-space-menu-btn-enabled","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",variation:"primary",onClick:e.showCreateSpaceModal},{default:Te(()=>[we(s,{name:"add"}),e.showLabel?(Z(),ve("span",{key:0,textContent:K.toDisplayString(e.$gettext("New Space"))},null,8,Vk)):ke("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const Wk=Ue(qk,[["render",zk]]),Hk=Me({name:"AppTopBar",components:{ContextActionMenu:Kf,ResourceListItem:Oo},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:r}=Ne.useGettext(),n=Ke(),o=at(),{getMatchingSpace:i}=ar(),s=V(()=>n.areFileExtensionsShown),l=V(()=>t("Show context menu")),c=V(()=>t("Close")),u=V(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),a=V(()=>{const b=$t.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:r});return t("Autosave (every %{ duration })",{duration:b.toHuman()})}),f=V(()=>i(e.resource)),d=V(()=>!ie.isPublicSpaceResource(y(f)));return{contextMenuLabel:l,closeButtonLabel:c,areFileExtensionsShown:s,hasAutosave:u,autoSaveTooltipText:a,isPathDisplayed:d,...ai()}}}),Gk={class:"oc-app-top-bar oc-flex"},Kk={class:"oc-app-top-bar-inner oc-px-m oc-flex oc-flex-middle oc-flex-between"},Qk={class:"open-file-bar oc-flex"},Xk={class:"oc-flex main-actions"},Yk={key:1,class:"oc-flex oc-flex-middle"};function Jk(e,t,r,n,o,i){const s=pe("resource-list-item"),l=pe("oc-icon"),c=pe("oc-button"),u=pe("context-action-menu"),a=pe("oc-drop"),f=pe("portal"),d=or("oc-tooltip");return Z(),Ce(f,{to:"app.runtime.header.left"},{default:Te(()=>[he("div",Gk,[he("span",Kk,[he("div",Qk,[e.resource?(Z(),Ce(s,{key:0,id:"app-top-bar-resource","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):ke("",!0)]),he("div",Xk,[e.dropDownMenuSections.length?(Z(),ve(Ye,{key:0},[ot((Z(),Ce(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse",class:"oc-p-xs",variation:"primary"},{default:Te(()=>[we(l,{name:"more-2"})]),_:1},8,["aria-label"])),[[d,e.contextMenuLabel]]),we(a,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=Tr(()=>{},["stop","prevent"]))},{default:Te(()=>[we(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):ke("",!0),e.hasAutosave?(Z(),ve("span",Yk,[ot(we(l,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white"},null,8,["accessible-label"]),[[d,e.autoSaveTooltipText]])])):ke("",!0),e.mainActions.length&&e.resource?(Z(),Ce(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(b=>b.isVisible()).map(b=>({...b,class:"oc-p-xs",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse",variation:"primary"},null,8,["menu-sections","action-options"])):ke("",!0),ot((Z(),Ce(c,{id:"app-top-bar-close",appearance:"raw-inverse",variation:"primary","aria-label":e.closeButtonLabel,onClick:t[1]||(t[1]=b=>e.$emit("close"))},{default:Te(()=>[we(l,{name:"close",size:"small"})]),_:1},8,["aria-label"])),[[d,e.closeButtonLabel]])])])])]),_:1})}const n0=Ue(Hk,[["render",Jk]]),Zk=Me({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),eN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},tN={key:0,class:"oc-text-xlarge"};function rN(e,t,r,n,o,i){const s=pe("oc-icon");return Z(),ve("div",eN,[we(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(Z(),ve("p",tN,K.toDisplayString(e.message),1)):ke("",!0)])}const nN=Ue(Zk,[["render",rN]]),iN=Me({name:"LoadingScreen"}),oN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},sN={class:"oc-invisible"};function aN(e,t,r,n,o,i){const s=pe("oc-spinner"),l=or("translate");return Z(),ve("div",oN,[we(s,{size:"xlarge"}),ot((Z(),ve("p",sN,t[0]||(t[0]=[Bt("Loading app")]))),[[l]])])}const lN=Ue(iN,[["render",aN]]),cN=Me({props:{isOpen:{type:Boolean,required:!0},loading:{type:Boolean,required:!0},availablePanels:{type:Array,required:!0},panelContext:{type:Object,required:!0},activePanel:{type:String,required:!1,default:""}},emits:["close","selectPanel"],setup(e){const{$gettext:t}=Ne.useGettext(),r=tS("appSideBar"),n=V(()=>e.availablePanels.filter(m=>{var g;return m.isVisible(e.panelContext)&&((g=m.isRoot)==null?void 0:g.call(m,e.panelContext))})),o=V(()=>e.availablePanels.filter(m=>{var g;return m.isVisible(e.panelContext)&&!((g=m.isRoot)!=null&&g.call(m,e.panelContext))})),i=V(()=>y(n).length?[y(n)[0],...y(o)]:y(o)),s=V(()=>{var g;const m=(g=e.activePanel)==null?void 0:g.split("#")[0];return!m||!y(o).map(v=>v.name).includes(m)?null:m}),l=V(()=>y(s)!==null),c=V(()=>y(s)===null),u=ue(null),a=()=>{u.value=null},f=m=>{u.value=m},d=V(()=>y(l)?y(s):y(n)[0].name),b=V(()=>y(n).length===1?t("Back to %{panel} panel",{panel:y(n)[0].title(e.panelContext)}):t("Back to main panels")),E=ue(window.innerWidth),w=V(()=>y(E)<=960),R=V(()=>{var m,g;return(g=(m=y(r))==null?void 0:m.parentElement)==null?void 0:g.querySelector("div")}),S=()=>{e.isOpen&&(E.value=window.innerWidth)};return Et(()=>e.isOpen,async m=>{m&&(await Hr(),y(w)&&y(R)&&(y(R).style.visibility="hidden"))},{immediate:!0}),Vt(()=>{window.addEventListener("resize",S)}),Gr(()=>{window.removeEventListener("resize",S),y(R)&&(y(R).style.visibility="visible")}),{appSideBar:r,displayPanels:i,rootPanels:n,subPanels:o,activeSubPanelName:s,activePanelName:d,oldPanelName:u,clearOldPanelName:a,setOldPanelName:f,hasActiveSubPanel:l,hasActiveRootPanel:c,accessibleLabelBack:b,fullWidthSideBar:w}},methods:{setSidebarPanel(e){this.$emit("selectPanel",e)},resetSidebarPanel(){this.$emit("selectPanel",null)},closeSidebar(){this.$emit("close")},openPanel(e){this.setOldPanelName(this.activePanelName),this.setSidebarPanel(e)},closePanel(){this.setOldPanelName(this.activePanelName),this.resetSidebarPanel(),this.appSideBar.focus()}}}),uN=["id","data-testid","tabindex","inert"],fN={key:0,class:"sidebar-panel__header header"},dN={class:"header__title oc-my-rm"},pN={key:0,class:"sidebar-panel__navigation oc-mt-m"};function hN(e,t,r,n,o,i){const s=pe("oc-spinner"),l=pe("oc-icon"),c=pe("oc-button"),u=or("oc-tooltip");return Z(),ve("div",{id:"app-sidebar",ref:"appSideBar","data-testid":"app-sidebar",tabindex:"-1",class:K.normalizeClass({"has-active-sub-panel":e.hasActiveSubPanel,"oc-flex oc-flex-center oc-flex-middle":e.loading,"app-sidebar-full-width":e.fullWidthSideBar})},[e.loading?(Z(),Ce(s,{key:0})):(Z(!0),ve(Ye,{key:1},Lt(e.displayPanels,a=>{var f,d,b,E,w,R;return Z(),ve("div",{id:`sidebar-panel-${a.name}`,key:`panel-${a.name}`,"data-testid":`sidebar-panel-${a.name}`,tabindex:e.activePanelName===a.name?-1:null,class:K.normalizeClass(["sidebar-panel",{"is-root-panel":(f=a.isRoot)==null?void 0:f.call(a,e.panelContext),"is-active-sub-panel":e.hasActiveSubPanel&&e.activeSubPanelName===a.name,"is-active-root-panel":e.hasActiveRootPanel&&((d=a.isRoot)==null?void 0:d.call(a,e.panelContext))}]),inert:e.activePanelName!==a.name},[[e.activePanelName,e.oldPanelName].includes(a.name)?(Z(),ve("div",fN,[(b=a.isRoot)!=null&&b.call(a,e.panelContext)?ke("",!0):ot((Z(),Ce(c,{key:0,class:"header__back",appearance:"raw","aria-label":e.accessibleLabelBack,onClick:e.closePanel},{default:Te(()=>[we(l,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label","onClick"])),[[u,e.accessibleLabelBack]]),he("h2",dN,K.toDisplayString(a.title(e.panelContext)),1),we(c,{appearance:"raw",class:"header__close","aria-label":e.$gettext("Close file sidebar"),onClick:e.closeSidebar},{default:Te(()=>[we(l,{name:"close"})]),_:1},8,["aria-label","onClick"])])):ke("",!0),he("div",null,[(E=a.isRoot)!=null&&E.call(a,e.panelContext)?Ge(e.$slots,"rootHeader",{key:0}):Ge(e.$slots,"subHeader",{key:1})]),he("div",{class:K.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${a.name}`]])},[he("div",{class:K.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((w=a.isRoot)!=null&&w.call(a,e.panelContext))}])},[Ge(e.$slots,"body",{},()=>{var S;return[(Z(!0),ve(Ye,null,Lt((S=a.isRoot)!=null&&S.call(a,e.panelContext)?e.rootPanels:[a],(m,g)=>{var v;return Z(),Ce(Hn(m.component),Yt({key:`sidebar-panel-${m.name}`,class:{"multi-root-panel-separator oc-mt oc-pt-s":g>0},ref_for:!0},((v=m.componentAttrs)==null?void 0:v.call(m,e.panelContext))||{}),null,16,["class"])}),128))]})],2),(R=a.isRoot)!=null&&R.call(a,e.panelContext)&&e.subPanels.length>0?(Z(),ve("div",pN,[(Z(!0),ve(Ye,null,Lt(e.subPanels,S=>(Z(),Ce(c,{id:`sidebar-panel-${S.name}-select`,key:`panel-select-${S.name}`,"data-testid":`sidebar-panel-${S.name}-select`,appearance:"raw",onClick:m=>e.openPanel(S.name)},{default:Te(()=>[we(l,{name:S.icon,"fill-type":S.iconFillType},null,8,["name","fill-type"]),Bt(" "+K.toDisplayString(S.title(e.panelContext))+" ",1),we(l,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):ke("",!0)],2)],10,uN)}),128))],2)}const i0=Ue(cN,[["render",hN]]),gN=Me({name:"SpaceInfo",setup(){return{resource:In("resource")}}}),mN={class:"space_info oc-p-s"},yN={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},bN={class:"oc-mr-s"},vN=["textContent"],wN=["textContent"];function SN(e,t,r,n,o,i){const s=pe("oc-icon");return Z(),ve("div",mN,[he("div",yN,[he("div",bN,[we(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),he("div",null,[he("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:K.toDisplayString(e.resource.name)},null,8,vN),he("span",{"data-testid":"space-info-subtitle",textContent:K.toDisplayString(e.resource.description)},null,8,wN)])])])}const o0=Ue(gN,[["render",SN]]),EN=Me({name:"FileInfo",components:{ResourceIcon:xo,ResourceName:Bf},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Ke(),t=In("resource"),r=V(()=>e.areFileExtensionsShown);return{resource:t,areFileExtensionsShown:r}}}),TN={class:"file_info oc-flex oc-flex-between oc-p-s"},AN={class:"oc-flex oc-flex-middle"},RN={class:"file_info__body oc-text-overflow"},_N={"data-testid":"files-info-name",class:"oc-font-semibold"};function IN(e,t,r,n,o,i){const s=pe("resource-icon"),l=pe("resource-name");return Z(),ve("div",TN,[he("div",AN,[e.isSubPanelActive?(Z(),Ce(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):ke("",!0),he("div",RN,[he("h3",_N,[we(l,{name:e.resource.name,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])])}const s0=Ue(EN,[["render",IN]]),CN=Me({name:"FileSideBar",components:{FileInfo:s0,SpaceInfo:o0,InnerSideBar:i0},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=We(),r=Je(),n=Di(),o=Fo(),i=dt(),s=Mt(),l=at(),c=Zr(),{canListShares:u}=Tv(),{canListVersions:a}=Xv(),f=Ke(),{currentFolder:d}=Qe.storeToRefs(f),b=ue(),E=ue([]),w=ue([]),R=ue([]),{selectedResources:S}=Hf(),m=ue(!1),g=V(()=>y(m)||be.isRunning),v=V(()=>{var Se;return y(S).length===0?{root:e.space,parent:null,items:(Se=y(d))!=null&&Se.id?[y(d)]:[]}:{root:e.space,parent:y(d),items:y(S)}}),T=xn(kt,"files-shares-with-me"),A=xn(kt,"files-shares-with-others"),F=xn(kt,"files-shares-via-link"),C=ct(t,"files-spaces-projects"),I=xn(Tt,"files-common-favorites"),L=xn(Tt,"files-common-search"),B=()=>{o.publish(mt.close)},$=Se=>{o.publish(mt.setActivePanel,Se)},D=V(()=>{var Se;return((Se=y(v).items)==null?void 0:Se.length)===1&&!ie.isProjectSpaceResource(y(v).items[0])}),H=V(()=>{var Se;return((Se=y(v).items)==null?void 0:Se.length)===1&&ie.isProjectSpaceResource(y(v).items[0])}),ee=V(()=>y(T)||y(A)||y(F)),J=V(()=>y(ee)||y(L)||y(I)),ce=V(()=>n.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(Se=>Se.panel)),be=cr.useTask(function*(Se,Ae){E.value=yield r.webdav.listFileVersions(Ae.id,{signal:Se})}),de=cr.useTask(function*(Se,Ae){var Fe;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:ne,linkShares:ae}=s,le=r.graphAuthenticated.permissions;let oe=(Fe=e.space)==null?void 0:Fe.id;if(ie.isShareSpaceResource(e==null?void 0:e.space)){const Pe=yield i.getMountPointForSpace({graphClient:r.graphAuthenticated,space:e.space,signal:Se});Pe&&(oe=Pe.root.remoteItem.rootId)}const{shares:Q,allowedRoles:x}=yield*ie.call(le.listPermissions(oe,Ae.fileId,s.graphRoles,{},{signal:Se})),k=Q.filter(ie.isCollaboratorShare),X=Q.filter(ie.isLinkShare),W=Object.values(s.graphRoles);if(w.value=(x==null?void 0:x.map(Pe=>{var je;return{...Pe,icon:(je=W.find(te=>te.id===Pe.id))==null?void 0:je.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Pe}=yield*ie.call(le.listPermissions(oe,Ae.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[wO.LibreGraphPermissionsRolesAllowedValues]},{signal:Se}));R.value=(Pe==null?void 0:Pe.map(je=>{var te;return{...je,icon:(te=W.find(Le=>Le.id===je.id))==null?void 0:te.icon}}))||[]}!y(J)&&!y(C)&&(ne.forEach(Pe=>{k.some(je=>je.id===Pe.id)||k.push({...Pe,indirect:!0})}),ae.forEach(Pe=>{X.some(je=>je.id===Pe.id)||X.push({...Pe,indirect:!0})})),Tt(t,"files-common-search")&&(yield f.loadAncestorMetaData({folder:y(Ae),space:y(e.space),client:r.webdav,signal:Se}));const z=[...ne,...ae].map(({resourceId:Pe})=>Pe),fe=Object.values(f.ancestorMetaData).filter(({id:Pe,path:je})=>Pe===Ae.id||z.includes(Pe)||ie.isIncomingShareResource(Ae)?!1:ie.isPersonalSpaceResource(e.space)?je!=="/":!0).map(({id:Pe})=>Pe);y(J)&&ie.isProjectSpaceResource(e.space)&&!ie.isProjectSpaceResource(Ae)&&fe.push(e.space.id);const _e=new Bn({concurrency:l.options.concurrentRequests.shares.list}),Be=[...new Set(fe)].map(Pe=>_e.add(()=>r.graphAuthenticated.permissions.listPermissions(oe,Pe,s.graphRoles,{},{signal:Se}).then(je=>{const te=je.shares.map(Le=>({...Le,indirect:!0}));k.push(...te.filter(ie.isCollaboratorShare)),X.push(...te.filter(ie.isLinkShare))})));yield Promise.allSettled(Be),s.setCollaboratorShares(k),s.setLinkShares(X),s.setLoading(!1)}).restartable();return Et(()=>[...y(v).items,e.isOpen],async()=>{var Ae;if(((Ae=y(v).items)==null?void 0:Ae.length)!==1)return;if(!e.isOpen){E.value=[];return}const Se=y(v).items[0];if(be.isRunning&&be.cancelAll(),!!a({space:e.space,resource:Se}))try{await be.perform(Se)}catch(ne){console.error(ne)}},{immediate:!0,deep:!0}),Et(()=>[...y(v).items,e.isOpen],async()=>{var Ae;if(!e.isOpen){s.pruneShares(),b.value=null;return}if(((Ae=y(v).items)==null?void 0:Ae.length)!==1)return;const Se=y(v).items[0];if(m.value=!0,u({space:e.space,resource:Se}))try{de.isRunning&&de.cancelAll(),de.perform(Se)}catch(ne){console.error(ne)}if(!y(ee)){b.value=Se,m.value=!1;return}try{const ne=await r.webdav.getFileInfo(e.space,{path:Se.path}),ae={...ne,...Se,tags:ne.tags};b.value=ae}catch(ne){b.value=Se,console.error(ne)}m.value=!1},{deep:!0,immediate:!0}),bi("resource",un(b)),bi("versions",un(E)),bi("space",V(()=>e.space)),bi("activePanel",V(()=>e.activePanel)),bi("availableInternalShareRoles",un(w)),bi("availableExternalShareRoles",un(R)),{loadedResource:b,setActiveSideBarPanel:$,closeSideBar:B,panelContext:v,availablePanels:ce,isFileHeaderVisible:D,isSpaceHeaderVisible:H,isLoading:g,loadSharesTask:de}}});function FN(e,t,r,n,o,i){const s=pe("file-info"),l=pe("space-info"),c=pe("InnerSideBar");return e.isOpen?(Z(),Ce(c,Yt({key:0,ref:"sidebar",class:"files-side-bar","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:Te(()=>[e.isFileHeaderVisible?(Z(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(Z(),Ce(l,{key:1,class:"sidebar-panel__space_info"})):ke("",!0)]),subHeader:Te(()=>[e.isFileHeaderVisible?(Z(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(Z(),Ce(l,{key:1,class:"sidebar-panel__space_info"})):ke("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):ke("",!0)}const a0=Ue(CN,[["render",FN]]),PN=Me({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=ue(),t=ue(!0);return{confirmDisabled:t,onDateChanged:({date:n,error:o})=>{t.value=o||!n,e.value=n},dateTime:e}}}),xN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function ON(e,t,r,n,o,i){const s=pe("oc-datepicker"),l=pe("oc-button");return Z(),ve(Ye,null,[we(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),he("div",xN,[we(l,{class:"oc-modal-body-actions-cancel oc-ml-s",appearance:"outline",variation:"passive",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),we(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",variation:"primary",onClick:t[1]||(t[1]=c=>e.$emit("confirm",e.dateTime))},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const kN=Ue(PN,[["render",ON]]),NN=Me({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=yt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),$N=["textContent"],DN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},LN={class:"oc-modal-body-actions-grid"};function BN(e,t,r,n,o,i){const s=pe("oc-button");return Z(),ve(Ye,null,[he("span",{class:"oc-display-inline-block oc-mb-m",textContent:K.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,$N),t[2]||(t[2]=he("div",{class:"oc-my-m"},null,-1)),he("div",DN,[he("div",LN,[we(s,{class:"oc-modal-body-actions-cancel oc-ml-s",appearance:"outline",variation:"passive",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),we(s,{class:"oc-modal-body-actions-secondary oc-ml-s",appearance:"outline",variation:"passive",onClick:e.onClose},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),we(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",variation:"primary",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const l0=Ue(NN,[["render",BN]]);var MN=/\s/;function jN(e){for(var t=e.length;t--&&MN.test(e.charAt(t)););return t}var UN=/^\s+/;function qN(e){return e&&e.slice(0,jN(e)+1).replace(UN,"")}var c0=NaN,VN=/^[-+]0x[0-9a-f]+$/i,zN=/^0b[01]+$/i,WN=/^0o[0-7]+$/i,HN=parseInt;function GN(e){if(typeof e=="number")return e;if(bs(e))return c0;if(Qr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=qN(e);var r=zN.test(e);return r||WN.test(e)?HN(e.slice(2),r?2:8):VN.test(e)?c0:+e}const KN=Me({name:"AppWrapper",components:{AppTopBar:n0,FileSideBar:a0,ErrorScreen:nN,LoadingScreen:lN},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:r}=Ne.useGettext(),n=Zr(),{showMessage:o,showErrorMessage:i}=it(),s=Lo.useRouter(),l=Jt(),c=Je(),u=lr(),{getResourceContext:a}=Yv(),{selectedResources:f}=Hf(),{dispatchModal:d}=yt(),b=dt(),E=at(),w=Ke(),R=Mt(),{actions:S}=Nv({appId:e.applicationId}),{actions:m}=Cf(),{actions:g}=Po(),{actions:v}=kf(),{actions:T}=Nf(),A=V(()=>{var Re;return!!((Re=e.wrappedComponent.emits)!=null&&Re.includes("update:resource"))}),F=ue(),C=ue(),I=ue(""),L=ue(""),B=ue(!y(A)),$=ue(),D=ue(!1),H=ue(),ee=ue(),{actions:J}=Dv({content:ee}),ce=V(()=>{var Re;return!!((Re=e.wrappedComponent.emits)!=null&&Re.includes("update:currentContent"))}),be=Re=>!!Object.keys(e.wrappedComponent.props).includes(Re),de=V(()=>y(ee)!==y(H)),Se=Re=>{Re.preventDefault()};Et(de,Re=>{Re?window.addEventListener("beforeunload",Se):window.removeEventListener("beforeunload",Se)});const{applicationConfig:Ae,closeApp:ne,currentFileContext:ae,getFileContents:le,getFileInfo:oe,getUrlForResource:Q,putFileContents:x,replaceInvalidFileRoute:k,revokeUrl:X,activeFiles:W,loadFolderForFileContext:U,isFolderLoading:z}=Yb({applicationId:e.applicationId}),{applicationMeta:fe}=_f({applicationId:e.applicationId,appsStore:n}),_e=V(()=>{var Re;return(Re=y(fe).meta)==null?void 0:Re.fileSizeLimit}),Be=V(()=>{const{name:Re}=y(fe);return t("%{appName} for %{fileName}",{appName:t(Re),fileName:y(y(ae).fileName)})}),Fe=Xs("driveAliasAndItem"),Pe=rr("fileId"),je=V(()=>St(y(Pe))),te=async()=>{const Re=y(je),{space:xe,path:De}=await a(Re),br=xe.getDriveAliasAndItem({path:De});return ie.isPersonalSpaceResource(xe)?s.push({params:{...y(l).params,driveAliasAndItem:br},query:{...y(l).query,fileId:Re,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:ht.dirname(br)}}}):s.push({params:{...y(l).params,driveAliasAndItem:br},query:{...y(l).query,fileId:Re,contextRouteName:De==="/"?"files-shares-with-me":"files-spaces-generic",...ie.isShareSpaceResource(xe)&&{shareId:xe.id},contextRouteParams:{driveAliasAndItem:ht.dirname(br)},contextRouteQuery:{...ie.isShareSpaceResource(xe)&&{shareId:xe.id}}}})},Le=cr.useTask(function*(Re){try{y(Fe)||(yield te()),C.value=y(y(ae).space);const xe=yield oe(y(ae),{signal:Re});if(F.value=xe,ie.isShareSpaceResource(y(C))&&(y(F).remoteItemId=y(C).id,y(F).id===y(F).remoteItemId)){const De=yield*ie.call(ys({graphClient:c.graphAuthenticated,spacesStore:b,space:y(C)}));De&&(F.value={...xe,...ie.buildIncomingShareResource({graphRoles:R.graphRoles,driveItem:De,serverUrl:E.serverUrl}),tags:xe.tags})}w.initResourceList({currentFolder:null,resources:[y(F)]}),f.value=[y(F)]}catch(xe){console.error(xe),$.value=xe,B.value=!1}}).restartable(),qe=cr.useTask(function*(Re){try{const xe=e.importResourceWithExtension(y(F));if(xe){const De=$t.DateTime.local().toFormat("yyyyMMddHHmmss"),br=`${y(F).name}_${De}.${xe}`;if(!(yield c.webdav.copyFiles(y(C),y(F),y(C),{path:br},{signal:Re})))throw new Error(t("Importing failed"));F.value={path:br}}if(k(ae,y(F)))return;if(D.value=![_r.Updateable,_r.FileUpdateable].some(De=>(y(F).permissions||"").indexOf(De)>-1),y(be("currentContent"))){const De=yield*ie.call(le(ae,{...e.fileContentOptions,signal:Re}));H.value=ee.value=De.body,I.value=De.headers["OC-ETag"]}y(be("url"))&&(L.value=yield Q(y(C),y(F),{...e.urlForResourceOptions,signal:Re}))}catch(xe){console.error(xe),$.value=xe}finally{B.value=!1}}).restartable();Et(ae,async()=>{y(A)||(await Le.perform(),y(_e)&&GN(y(F).size)>y(_e)?d({title:t("File exceeds %{threshold}",{threshold:wr(y(_e),r)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:y(F).name,threshold:wr(y(_e),r)}),confirmText:t("Continue"),onCancel:()=>{ne()},onConfirm:()=>{qe.perform()}}):qe.perform())},{immediate:!0});const ze=Re=>{console.error(Re),i({title:t("An error occurred"),desc:Re.message,errors:[Re]})},Ze=()=>{o({title:t("File autosaved")})},vt=cr.useTask(function*(){const Re=y(ee);try{const xe=yield x(ae,{content:Re,previousEntityTag:y(I)});H.value=Re,I.value=xe.etag,w.upsertResource(xe)}catch(xe){switch(xe.statusCode){case 401:case 403:ze(new ie.HttpError(t("You're not authorized to save this file"),xe.response));break;case 409:case 412:ze(new ie.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),xe.response));break;case 507:const De=b.spaces.find(br=>br.id===y(F).storageId&&ie.isProjectSpaceResource(br));if(De){ze(new ie.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:De.name}),xe.response));break}ze(new ie.HttpError(t("Insufficient quota for saving this file"),xe.response));break;default:ze(new ie.HttpError("",xe.response))}}}).drop(),et=async()=>{await vt.perform()},Ut=V(()=>!e.disableAutoSave);let nr=null;Vt(()=>{var xe;if((xe=w.ancestorMetaData)!=null&&xe["/"]&&y(C)&&w.ancestorMetaData["/"].spaceId!==y(C).id&&w.setAncestorMetaData({}),!y(ce))return;const Re=E.options.editor;Re.autosaveEnabled&&!e.disableAutoSave&&(nr=setInterval(async()=>{de.value&&(await et(),Ze())},(Re.autosaveInterval||120)*1e3))}),Gr(()=>{u.isLoading||window.removeEventListener("beforeunload",Se),y(be("url"))&&X(L.value),y(ce)&&(clearInterval(nr),nr=null)});const{bindKeyAction:lt}=Kv({skipDisabledKeyBindingsCheck:!0});lt({modifier:qf.Ctrl,primary:Uf.S},()=>{y(de)&&et()});const Ir=V(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>y(ce),isDisabled:()=>D.value||!de.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:et}]),_=V(()=>({space:y(C),resources:[y(F)]})),p=async(Re,xe)=>{y(de)&&(await et(),Ze()),xe(Re)},h=V(()=>[...y(S),...y(Ir),...y(J).map(Re=>({...Re,isVisible:xe=>ce.value&&Re.isVisible(xe)}))].filter(Re=>Re.isVisible(y(_)))),O=V(()=>[...y(T),...y(m)].filter(Re=>Re.isVisible(y(_)))),M=V(()=>[...y(g).map(Re=>({...Re,handler:xe=>p(xe,Re.handler)}))].filter(Re=>Re.isVisible(y(_)))),G=V(()=>[...y(v)].filter(Re=>Re.isVisible(y(_)))),re=V(()=>{const Re=[];return y(h).length&&Re.push({name:"context",items:y(h)}),y(O).length&&Re.push({name:"share",items:y(O)}),y(M).length&&Re.push({name:"actions",items:y(M)}),y(G).length&&Re.push({name:"sidebar",items:y(G)}),Re}),$e=V(()=>[...y(Ir)]);Lo.onBeforeRouteLeave((Re,xe,De)=>{y(de)?d({icon:"error-warning",title:t("Unsaved changes"),customComponent:l0,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{De()}}),async onConfirm(){await et(),De()}}):De()});const He=V(()=>({url:y(L),space:y(y(ae).space),resource:y(F),activeFiles:y(W),isDirty:y(de),isReadOnly:y(D),applicationConfig:y(Ae),currentFileContext:y(ae),currentContent:y(ee),isFolderLoading:y(z),"onUpdate:resource":Re=>{F.value=Re,C.value=y(y(ae).space),f.value=[Re]},"onUpdate:currentContent":Re=>{ee.value=Re},onSave:et,onClose:ne,loadFolderForFileContext:U,revokeUrl:X,getUrlForResource:Q}));return{...Rb(),dropDownMenuSections:re,dropDownActionOptions:_,hasAutoSave:Ut,isEditor:ce,closeApp:ne,fileActions:$e,loading:B,loadingError:$,pageTitle:Be,resource:F,space:C,slotAttrs:He}}}),QN=["id"],XN=["textContent"];function YN(e,t,r,n,o,i){const s=pe("app-top-bar"),l=pe("loading-screen"),c=pe("error-screen"),u=pe("file-side-bar");return Z(),ve("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=eo((...a)=>e.closeApp&&e.closeApp(...a),["esc"]))},[he("h1",{class:"oc-invisible-sr",textContent:K.toDisplayString(e.pageTitle)},null,8,XN),!e.loading&&!e.loadingError&&e.resource?(Z(),Ce(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):ke("",!0),e.loading?(Z(),Ce(l,{key:1})):e.loadingError?(Z(),Ce(c,{key:2,message:e.loadingError.message},null,8,["message"])):(Z(),ve("div",{key:3,class:K.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Ge(e.$slots,"default",Yt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),we(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,QN)}const u0=Ue(KN,[["render",YN]]);function JN(e,t){return Me({render(){return yp(u0,{wrappedComponent:e,...t},{default:r=>yp(e,r)})}})}const ZN=Me({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>ie.extractDomSelector(e.id)}},emits:["quickActionClicked"],setup(){const{$gettext:e}=Ne.useGettext();return{contextMenuLabel:V(()=>e("Show context menu"))}}});function e$(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-drop"),c=pe("oc-button"),u=or("oc-tooltip");return ot((Z(),Ce(c,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"aria-label":e.contextMenuLabel,appearance:"raw",onClick:t[0]||(t[0]=Tr(a=>e.$emit("quickActionClicked",{event:a,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Te(()=>[we(s,{name:"more-2"}),we(l,{ref:`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,class:"oc-overflow-hidden",position:"bottom-end",mode:"click","close-on-click":"","padding-size":"small"},{default:Te(()=>[Ge(e.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const Qf=Ue(ZN,[["render",e$]]),t$=Me({name:"ResourceGhostElement",components:{ResourceIcon:xo},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}}}),r$={id:"ghost-element",class:"ghost-element"},n$={class:"ghost-element-layer1 oc-rounded"},i$={key:0,class:"ghost-element-layer2 oc-rounded"},o$={key:1,class:"ghost-element-layer3 oc-rounded"},s$={class:"badge"};function a$(e,t,r,n,o,i){const s=pe("resource-icon");return Z(),ve("div",r$,[he("div",n$,[we(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(Z(),ve("div",i$)):ke("",!0),e.showThirdLayer?(Z(),ve("div",o$)):ke("",!0)]),he("span",s$,K.toDisplayString(e.itemCount),1)])}const Xf=Ue(t$,[["render",a$]]),l$=Me({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Ne.useGettext();return{formattedSize:V(()=>wr(e.size,t))}}}),c$=["textContent"];function u$(e,t,r,n,o,i){return Z(),ve("span",{class:"oc-resource-size",textContent:K.toDisplayString(e.formattedSize)},null,8,c$)}const f0=Ue(l$,[["render",u$]]),f$=Me({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},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"},variation:{default:"passive"}},emits:["click"],setup(e,{emit:t}){const r=t,n=V(()=>["oc-button","oc-rounded",`oc-button-${ii(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${ii(e.gapSize)}`,`oc-button-${e.variation}`,`oc-button-${e.appearance}`,`oc-button-${e.variation}-${e.appearance}`]),o=V(()=>({...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=V(()=>({...e.type==="button"&&{click:s}})),s=l=>{r("click",l)};return(l,c)=>{const u=pe("oc-spinner");return Z(),Ce(Hn(l.type),Yt(o.value,{"aria-label":l.ariaLabel,class:n.value},Ha(i.value)),{default:Te(()=>[l.showSpinner?(Z(),Ce(u,{key:0,size:"small",class:"spinner"})):ke("",!0),Ge(l.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
55
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}n.prototype.build=function(l){return this.options.preserveOrder?e(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0,[]).val)},n.prototype.j2x=function(l,c,u){let a="",f="";const d=u.join(".");for(let b in l)if(Object.prototype.hasOwnProperty.call(l,b))if(typeof l[b]>"u")this.isAttribute(b)&&(f+="");else if(l[b]===null)this.isAttribute(b)||b===this.options.cdataPropName?f+="":b[0]==="?"?f+=this.indentate(c)+"<"+b+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+b+"/"+this.tagEndChar;else if(l[b]instanceof Date)f+=this.buildTextValNode(l[b],b,"",c);else if(typeof l[b]!="object"){const E=this.isAttribute(b);if(E&&!this.ignoreAttributesFn(E,d))a+=this.buildAttrPairStr(E,""+l[b]);else if(!E)if(b===this.options.textNodeName){let S=this.options.tagValueProcessor(b,""+l[b]);f+=this.replaceEntitiesValue(S)}else f+=this.buildTextValNode(l[b],b,"",c)}else if(Array.isArray(l[b])){const E=l[b].length;let S="",T="";for(let w=0;w<E;w++){const y=l[b][w];if(!(typeof y>"u"))if(y===null)b[0]==="?"?f+=this.indentate(c)+"<"+b+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+b+"/"+this.tagEndChar;else if(typeof y=="object")if(this.options.oneListGroup){const g=this.j2x(y,c+1,u.concat(b));S+=g.val,this.options.attributesGroupName&&y.hasOwnProperty(this.options.attributesGroupName)&&(T+=g.attrStr)}else S+=this.processTextOrObjNode(y,b,c,u);else if(this.options.oneListGroup){let g=this.options.tagValueProcessor(b,y);g=this.replaceEntitiesValue(g),S+=g}else S+=this.buildTextValNode(y,b,"",c)}this.options.oneListGroup&&(S=this.buildObjectNode(S,b,T,c)),f+=S}else if(this.options.attributesGroupName&&b===this.options.attributesGroupName){const E=Object.keys(l[b]),S=E.length;for(let T=0;T<S;T++)a+=this.buildAttrPairStr(E[T],""+l[b][E[T]])}else f+=this.processTextOrObjNode(l[b],b,c,u);return{attrStr:a,val:f}},n.prototype.buildAttrPairStr=function(l,c){return c=this.options.attributeValueProcessor(l,""+c),c=this.replaceEntitiesValue(c),this.options.suppressBooleanAttributes&&c==="true"?" "+l:" "+l+'="'+c+'"'};function o(l,c,u,a){const f=this.j2x(l,u+1,a.concat(c));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],c,f.attrStr,u):this.buildObjectNode(f.val,c,f.attrStr,u)}n.prototype.buildObjectNode=function(l,c,u,a){if(l==="")return c[0]==="?"?this.indentate(a)+"<"+c+u+"?"+this.tagEndChar:this.indentate(a)+"<"+c+u+this.closeTag(c)+this.tagEndChar;{let f="</"+c+this.tagEndChar,d="";return c[0]==="?"&&(d="?",f=""),(u||u==="")&&l.indexOf("<")===-1?this.indentate(a)+"<"+c+u+d+">"+l+f:this.options.commentPropName!==!1&&c===this.options.commentPropName&&d.length===0?this.indentate(a)+`<!--${l}-->`+this.newLine:this.indentate(a)+"<"+c+u+d+this.tagEndChar+l+this.indentate(a)+f}},n.prototype.closeTag=function(l){let c="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(c="/"):this.options.suppressEmptyNode?c="/":c=`></${l}`,c},n.prototype.buildTextValNode=function(l,c,u,a){if(this.options.cdataPropName!==!1&&c===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(a)+`<!--${l}-->`+this.newLine;if(c[0]==="?")return this.indentate(a)+"<"+c+u+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(c,l);return f=this.replaceEntitiesValue(f),f===""?this.indentate(a)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(a)+"<"+c+u+">"+f+"</"+c+this.tagEndChar}},n.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let c=0;c<this.options.entities.length;c++){const u=this.options.entities[c];l=l.replace(u.regex,u.val)}return l};function i(l){return this.options.indentBy.repeat(l)}function s(l){return l.startsWith(this.options.attributeNamePrefix)&&l!==this.options.textNodeName?l.substr(this.attrPrefixLen):!1}return pf=n,pf}var hf,Gy;function lI(){if(Gy)return hf;Gy=1;const e=$y(),t=oI(),r=aI();return hf={XMLParser:t,XMLValidator:e,XMLBuilder:r},hf}lI();class Ky{isEnabled(){return!0}isActive(t){return Rr(t,"files-trash-generic")}getTask(t){const{resourcesStore:r,clientService:{webdav:n}}=t;return lr.useTask(function*(o,i,s){r.clearResourceList(),r.setAncestorMetaData({});const{resource:l,children:c}=yield n.listFiles(s,{},{depth:1,davProperties:Es.Trashbin,isTrash:!0,signal:o});r.initResourceList({currentFolder:l,resources:c})})}}class Qy{constructor(){Ee(this,"loaders");this.loaders=[new Gh,new Kh,new Qh,new Xh,new Yh,new Ky]}getTask(){const t=bt(),r=ut(),n=tr(),o=We(),i=Je(),s=ot(),l=Qe(),c=Bt(),u=Af(),a=this.loaders.find(f=>f.isEnabled()&&f.isActive(m(o)));if(!a){console.debug("No folder loader found for route");return}return lr.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:r,capabilityStore:n,resourcesStore:l,sharesStore:c,router:o,authService:u};try{yield a.getTask(d).perform(...f)}catch(b){console.error(b)}})}}const Xy=new Qy;var xn=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(xn||{});const cI=200;class uI{constructor(){Ee(this,"tasks",[])}get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(n=>!n.state&&n.active))return null;const t=this.tasks.filter(n=>!!n.state&&n.active);if(!t.length)return null;const r=t.reduce((n,o)=>(n+=o.state.current/o.state.total,n),0);return Math.round(r/t.length*100)}addTask(t,{debounceTime:r=cI,indeterminate:n=!0}={}){const o={id:Qt.v4(),active:!1,...!n&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),Et.debounce(()=>{o.active=!0,Ye.publish("loading-service.add")},r)(),t({setProgress:({total:l,current:c})=>{n||this.setProgress({task:o,total:l,current:c})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(r=>r.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Ye.publish("loading-service.remove")}setProgress({task:t,total:r,current:n}){t.state||(t.state={total:0,current:0}),t.state.total=r,t.state.current=n,Ye.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var fI="__lodash_hash_undefined__";function dI(e){return this.__data__.set(e,fI),this}function pI(e){return this.__data__.has(e)}function qs(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new mn;++t<r;)this.add(e[t])}qs.prototype.add=qs.prototype.push=dI,qs.prototype.has=pI;function hI(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function gI(e,t){return e.has(t)}var mI=1,yI=2;function Yy(e,t,r,n,o,i){var s=r&mI,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(e),a=i.get(t);if(u&&a)return u==t&&a==e;var f=-1,d=!0,b=r&yI?new qs:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var E=e[f],S=t[f];if(n)var T=s?n(S,E,f,t,e,i):n(E,S,f,e,t,i);if(T!==void 0){if(T)continue;d=!1;break}if(b){if(!hI(t,function(w,y){if(!gI(b,y)&&(E===w||o(E,w,r,n,i)))return b.push(y)})){d=!1;break}}else if(!(E===S||o(E,S,r,n,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function bI(e){var t=-1,r=Array(e.size);return e.forEach(function(n,o){r[++t]=[o,n]}),r}function vI(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var wI=1,SI=2,EI="[object Boolean]",TI="[object Date]",AI="[object Error]",RI="[object Map]",_I="[object Number]",II="[object RegExp]",CI="[object Set]",FI="[object String]",PI="[object Symbol]",xI="[object ArrayBuffer]",OI="[object DataView]",Jy=Fr?Fr.prototype:void 0,gf=Jy?Jy.valueOf:void 0;function kI(e,t,r,n,o,i,s){switch(r){case OI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xI:return!(e.byteLength!=t.byteLength||!i(new ps(e),new ps(t)));case EI:case TI:case _I:return ro(+e,+t);case AI:return e.name==t.name&&e.message==t.message;case II:case FI:return e==t+"";case RI:var l=bI;case CI:var c=n&wI;if(l||(l=vI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=SI,s.set(e,t);var a=Yy(l(e),l(t),n,o,i,s);return s.delete(e),a;case PI:if(gf)return gf.call(e)==gf.call(t)}return!1}function mf(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}function Zy(e,t,r){var n=t(e);return Pr(e)?n:mf(n,r(e))}function NI(e,t){for(var r=-1,n=e==null?0:e.length,o=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[o++]=s)}return i}function eb(){return[]}var $I=Object.prototype,DI=$I.propertyIsEnumerable,tb=Object.getOwnPropertySymbols,rb=tb?function(e){return e==null?[]:(e=Object(e),NI(tb(e),function(t){return DI.call(e,t)}))}:eb;function LI(e){return ao(e)?eh(e):Uh(e)}function nb(e){return Zy(e,LI,rb)}var BI=1,MI=Object.prototype,jI=MI.hasOwnProperty;function UI(e,t,r,n,o,i){var s=r&BI,l=nb(e),c=l.length,u=nb(t),a=u.length;if(c!=a&&!s)return!1;for(var f=c;f--;){var d=l[f];if(!(s?d in t:jI.call(t,d)))return!1}var b=i.get(e),E=i.get(t);if(b&&E)return b==t&&E==e;var S=!0;i.set(e,t),i.set(t,e);for(var T=s;++f<c;){d=l[f];var w=e[d],y=t[d];if(n)var g=s?n(y,w,d,t,e,i):n(w,y,d,e,t,i);if(!(g===void 0?w===y||o(w,y,r,n,i):g)){S=!1;break}T||(T=d=="constructor")}if(S&&!T){var v=e.constructor,A=t.constructor;v!=A&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof A=="function"&&A instanceof A)&&(S=!1)}return i.delete(e),i.delete(t),S}var qI=1,ib="[object Arguments]",ob="[object Array]",Vs="[object Object]",VI=Object.prototype,sb=VI.hasOwnProperty;function zI(e,t,r,n,o,i){var s=Pr(e),l=Pr(t),c=s?ob:Nr(e),u=l?ob:Nr(t);c=c==ib?Vs:c,u=u==ib?Vs:u;var a=c==Vs,f=u==Vs,d=c==u;if(d&&Ei(e)){if(!Ei(t))return!1;s=!0,a=!1}if(d&&!a)return i||(i=new Xr),s||gs(e)?Yy(e,t,r,n,o,i):kI(e,t,c,r,n,o,i);if(!(r&qI)){var b=a&&sb.call(e,"__wrapped__"),E=f&&sb.call(t,"__wrapped__");if(b||E){var S=b?e.value():e,T=E?t.value():t;return i||(i=new Xr),o(S,T,r,n,i)}}return d?(i||(i=new Xr),UI(e,t,r,n,o,i)):!1}function ab(e,t,r,n,o){return e===t?!0:e==null||t==null||!Yr(e)&&!Yr(t)?e!==e&&t!==t:zI(e,t,r,n,ab,o)}function lb(e,t){return ab(e,t)}const yf=(e="")=>e.split("/").map(encodeURIComponent).join("/"),WI=e=>{const t=[],r=(n,o="")=>Object.keys(n).forEach(i=>{gl(n[i])?r(n[i],`${o}${i}.`):t.push(`${o}${i}`)});return r(e),t};class HI{constructor({clientService:t,userStore:r,authStore:n,capabilityStore:o,configStore:i}){Ee(this,"clientService");Ee(this,"configStore");Ee(this,"userStore");Ee(this,"authStore");Ee(this,"capabilityStore");Ee(this,"capability");this.clientService=t,this.userStore=r,this.authStore=n,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","text/plain","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,r=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(r?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(r=>r.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,r=!1,n=!0,o){const{space:i,resource:s}=t,l=this.available&&this.isMimetypeSupported(s.mimeType),c=s.type!=="folder"&&s.extension&&s.canDownload();if(!l||!c)return;const u=ie.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,r,n,o)}catch(a){if(n)return;throw a}}}async cacheFactory(t,r,n){const{resource:o,dimensions:i}=t,s=Wl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&lb(i,s.dimensions))return s.src;try{const l=await this.privatePreviewBlob(t,!1,!0,n);return Wl.filePreview.set(o.id.toString(),{src:l,etag:o.etag,dimensions:i},0).src}catch(l){if(r)return;throw l}}buildQueryString(t){return $0.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,r=!1,n=!0,o){var u,a;const{resource:i,dimensions:s,processor:l}=t;if(r)return this.cacheFactory(t,n,o);const c=[this.configStore.serverUrl,"remote.php/dav",yf(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:l})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((a=(u=f.response)==null?void 0:u.headers)==null?void 0:a["retry-after"])||5;return await new Promise(b=>setTimeout(b,d*1e3)),this.privatePreviewBlob(t,r,n,o)}throw f}}async publicPreviewUrl(t,r){var a,f;const{resource:n,dimensions:o,processor:i}=t,[s,l]=n.downloadURL.split("?"),c=[this.buildQueryString({etag:n.etag,dimensions:o,processor:i}),l].filter(Boolean).join("&"),u=[s,c].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:r});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const b=((f=(a=d.response)==null?void 0:a.headers)==null?void 0:f["retry-after"])||5;return await new Promise(E=>setTimeout(E,b*1e3)),this.publicPreviewUrl(t,r)}throw d}}}const zs=ge.z.enum(["fit","resize","fill","thumbnail"]);class GI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,r){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...Et.isBoolean(r)&&{verified:r}}}assert(t,r){return r.length>0}validate(){return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class KI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,r){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...Et.isBoolean(r)&&{verified:r}}}assert(t,r){return Array.from(r).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!Et.isObject(t))throw new Error("options should be an object");if(!Et.isNumber(t.minLength)||Et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!Et.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class Ws{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}assert(t,r){throw new Error("Method not implemented.")}explain(t,r){throw new Error("Method not implemented.")}validate(t){if(!Et.isObject(t))throw new Error("options should be an object");if(!Et.isNumber(t.minLength)||Et.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,r){return this.explain(t,this.assert(t,r))}}class QI extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...Et.isBoolean(r)&&{verified:r}}}assert(t,r){return r.length>=t.minLength}}class XI extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...Et.isBoolean(r)&&{verified:r}}}assert(t,r){var o;return((o=(r||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class YI extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...Et.isBoolean(r)&&{verified:r}}}assert(t,r){var o;return((o=(r||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class JI extends Ws{constructor(t){super(t)}explain(t,r){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...Et.isBoolean(r)&&{verified:r}}}assert(t,r){var o;return((o=(r||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var bf={},cb;function ZI(){if(cb)return bf;cb=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",l="",c=i.length,u=i.lowercase,a=i.uppercase,f=i.numbers,d=i.symbols,b=i.minLengthLowercase,E=i.minLengthUppercase,S=i.minLengthNumbers,T=i.minLengthSymbols,w=i.exclude,y="abcdefghijklmnopqrstuvwxyz";y=r(y,w);var g="ABCDEFGHIJKLMNOPQRSTUVWXYZ";g=r(g,w);var v="0123456789";v=r(v,w);var A="!#$%&'()*+,-./:;<=>?@[]^_{|}~";A=r(A,w);for(var R=y.length,C=0;C<b;C++)l+=y.charAt(e(R));for(R=g.length,C=0;C<E;C++)l+=g.charAt(e(R));for(R=v.length,C=0;C<S;C++)l+=v.charAt(e(R));for(R=A.length,C=0;C<T;C++)l+=A.charAt(e(R));s+=function(L){for(var B=L.split(""),$=B.length-1;$>0;$--){var D=Math.floor(Math.random()*($+1)),H=B[$];B[$]=B[D],B[D]=H}return B.join("")}(l);var P="";P=u?P+y:P,P=a?P+g:P,P=f?P+v:P,P=d?P+A:P;var _=c-s.length;for(R=P.length,C=0;C<_;C++)s+=P.charAt(e(R));return s},r=function(i,s){return s==null||s.split("").forEach(function(l){i=i.replace(l,"")}),i},n=function(i){var s=i.length,l=i.lowercase,c=i.uppercase,u=i.numbers,a=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(l==0&&c==0&&u==0&&a==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return bf.GeneratePassword=function(i){return i?(i=o(i),n(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),n(i),t(i))},bf}var eC=ZI();class tC{constructor({language:t}){Ee(this,"language");Ee(this,"capability");Ee(this,"policy");Ee(this,"generatePasswordRules");this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const r={atLeastCharacters:new QI({...this.language}),mustNotBeEmpty:new GI({...this.language}),atLeastUppercaseCharacters:new XI({...this.language}),atLeastLowercaseCharacters:new YI({...this.language}),atLeastDigits:new JI({...this.language}),mustContain:new KI({...this.language})},n={};t&&!this.hasRules()&&(n.mustNotBeEmpty={}),this.capability.min_characters&&(n.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(n.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(n.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(n.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(n.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new D0.PasswordPolicy(n,r)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return eC.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function rC(e){return e.charCodeAt(0).toString(32)}function ub(e){let t="";return e.replace(/[^A-Z0-9]/gi,r=>(t+=`-${rC(r)}`,"/"))+t}function fb(e,t){let r=t||"uppy";return typeof e.name=="string"&&(r+=`-${ub(e.name.toLowerCase())}`),e.type!==void 0&&(r+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(r+=`-${ub(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(r+=`-${e.data.size}`),e.data.lastModified!==void 0&&(r+=`-${e.data.lastModified}`),r}class nC{constructor({language:t}){Ee(this,"uppy");Ee(this,"uploadInputs",[]);Ee(this,"uploadFolderMap",{});Ee(this,"getRelativeFilePath",t=>{const r=t.data.relativePath||t.data.webkitRelativePath;return r?ie.urlJoin(r):void 0});const{$gettext:r}=t;this.uppy=new L0({autoProceed:!1,onBeforeFileAdded:(n,o)=>(n.id in o&&(n.meta.retry=!0),n.meta.relativePath=this.getRelativeFilePath(n),n.id=fb(n,this.uppy.getID()),n)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:r("Added %{numFiles} file(s)"),authenticate:r("Connect"),authenticateWith:r("Connect to %{pluginName}"),authenticateWithTitle:r("Please authenticate with %{pluginName} to select files"),cancel:r("Cancel"),companionError:r("Connection with Companion failed"),loadedXFiles:r("Loaded %{numFiles} files"),loading:r("Loading..."),logOut:r("Log out"),pluginWebdavInputLabel:r("Public link without password protection"),selectX:{0:r("Select %{smart_count}"),1:r("Select %{smart_count}")},signInWithGoogle:r("Sign in with Google")}}}),this.setUpEvents()}addPlugin(t,...r){this.uppy.use(t,...r)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:r,uploadDataDuringCreation:n,onBeforeRequest:o,headers:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:r,retryDelays:[0,500,1e3],uploadDataDuringCreation:n,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,a,f,d)=>{var b,E;return((b=u==null?void 0:u.originalResponse)==null?void 0:b.getStatus())>=500?!1:((E=u==null?void 0:u.originalResponse)==null?void 0:E.getStatus())===401?!0:d(u)}},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const c=this.uppy.getPlugin("Tus");if(c){c.setOptions(s);return}this.uppy.use(B0,s)}useXhr({headers:t,timeout:r,endpoint:n}){const o={endpoint:n,method:"put",headers:t,formData:!1,timeout:r,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(M0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(j0,{target:t,onDragOver:r=>{this.publish("drag-over",r)},onDragLeave:r=>{this.publish("drag-out",r)},onDrop:r=>{this.publish("drop",r)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,r){return Ye.subscribe(t,r)}unsubscribe(t,r){Ye.unsubscribe(t,r)}publish(t,r){Ye.publish(t,r)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,r)=>{this.publish("upload-progress",{file:t,progress:r})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{this.publish("uploadCompleted",t),t.successful.forEach(r=>{this.uppy.removeFile(r.id)}),this.clearInputs()}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,r)=>{this.publish("uploadError",{file:t,error:r})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",n=>{const o=n.target,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(r=>r!==t)}generateUploadId(t){return fb(t,this.uppy.getID())}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,r){this.uploadFolderMap[t]=r}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function iC(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var oC=Object.getOwnPropertySymbols,sC=oC?function(e){for(var t=[];e;)mf(t,rb(e)),e=hl(e);return t}:eb;function db(e){return Zy(e,vl,sC)}var aC=Object.prototype,lC=aC.hasOwnProperty;function cC(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&lC.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function uC(e,t){var r=pl(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var fC=/\w*$/;function dC(e){var t=new e.constructor(e.source,fC.exec(e));return t.lastIndex=e.lastIndex,t}var pb=Fr?Fr.prototype:void 0,hb=pb?pb.valueOf:void 0;function pC(e){return hb?Object(hb.call(e)):{}}var hC="[object Boolean]",gC="[object Date]",mC="[object Map]",yC="[object Number]",bC="[object RegExp]",vC="[object Set]",wC="[object String]",SC="[object Symbol]",EC="[object ArrayBuffer]",TC="[object DataView]",AC="[object Float32Array]",RC="[object Float64Array]",_C="[object Int8Array]",IC="[object Int16Array]",CC="[object Int32Array]",FC="[object Uint8Array]",PC="[object Uint8ClampedArray]",xC="[object Uint16Array]",OC="[object Uint32Array]";function kC(e,t,r){var n=e.constructor;switch(t){case EC:return pl(e);case hC:case gC:return new n(+e);case TC:return uC(e);case AC:case RC:case _C:case IC:case CC:case FC:case PC:case xC:case OC:return Mp(e,r);case mC:return new n;case yC:case wC:return new n(e);case bC:return dC(e);case vC:return new n;case SC:return pC(e)}}var NC="[object Map]";function $C(e){return Yr(e)&&Nr(e)==NC}var gb=Ti&&Ti.isMap,DC=gb?ml(gb):$C,LC="[object Set]";function BC(e){return Yr(e)&&Nr(e)==LC}var mb=Ti&&Ti.isSet,MC=mb?ml(mb):BC,jC=1,yb="[object Arguments]",UC="[object Array]",qC="[object Boolean]",VC="[object Date]",zC="[object Error]",bb="[object Function]",WC="[object GeneratorFunction]",HC="[object Map]",GC="[object Number]",vb="[object Object]",KC="[object RegExp]",QC="[object Set]",XC="[object String]",YC="[object Symbol]",JC="[object WeakMap]",ZC="[object ArrayBuffer]",eF="[object DataView]",tF="[object Float32Array]",rF="[object Float64Array]",nF="[object Int8Array]",iF="[object Int16Array]",oF="[object Int32Array]",sF="[object Uint8Array]",aF="[object Uint8ClampedArray]",lF="[object Uint16Array]",cF="[object Uint32Array]",gt={};gt[yb]=gt[UC]=gt[ZC]=gt[eF]=gt[qC]=gt[VC]=gt[tF]=gt[rF]=gt[nF]=gt[iF]=gt[oF]=gt[HC]=gt[GC]=gt[vb]=gt[KC]=gt[QC]=gt[XC]=gt[YC]=gt[sF]=gt[aF]=gt[lF]=gt[cF]=!0,gt[zC]=gt[bb]=gt[JC]=!1;function Hs(e,t,r,n,o,i){var s,l=t&jC;if(r&&(s=o?r(e,n,o,i):r(e)),s!==void 0)return s;if(!Qr(e))return e;var c=Pr(e);if(c)s=cC(e);else{var u=Nr(e),a=u==bb||u==WC;if(Ei(e))return Bp(e,l);if(u==vb||u==yb||a&&!o)s={};else{if(!gt[u])return o?e:{};s=kC(e,u,l)}}i||(i=new Xr);var f=i.get(e);if(f)return f;i.set(e,s),MC(e)?e.forEach(function(E){s.add(Hs(E,t,r,E,e,i))}):DC(e)&&e.forEach(function(E,S){s.set(S,Hs(E,t,r,S,e,i))});var d=db,b=c?void 0:d(e);return iC(b||e,function(E,S){b&&(S=E,E=e[S]),Yp(s,S,Hs(E,t,r,S,e,i))}),s}function uF(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}function fF(e,t){return t.length<2?e:bh(e,uF(t,0,-1))}function dF(e,t){return t=Pl(t,e),e=fF(e,t),e==null||delete e[yh(ld(t))]}function pF(e){return gl(e)?void 0:e}var wb=Fr?Fr.isConcatSpreadable:void 0;function hF(e){return Pr(e)||so(e)||!!(wb&&e&&e[wb])}function gF(e,t,r,n,o){var i=-1,s=e.length;for(r||(r=hF),o||(o=[]);++i<s;){var l=e[i];r(l)?mf(o,l):o[o.length]=l}return o}function mF(e){var t=e==null?0:e.length;return t?gF(e):[]}function yF(e){return oh(ih(e,void 0,mF),e+"")}var bF=1,vF=2,wF=4,$i=yF(function(e,t){var r={};if(e==null)return r;var n=!1;t=ph(t,function(i){return i=Pl(i,e),n||(n=i.length>1),i}),Jp(e,db(e),r),n&&(r=Hs(r,bF|vF|wF,pF));for(var o=t.length;o--;)dF(r,t[o]);return r});const SF=(e,t)=>{const r=(i="")=>i.split("/").filter(Boolean),n=r(e.path),o=r(t);return o.map((i,s)=>({id:Qt.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...n].splice(0,n.length-o.length+s+1).join("/"),query:$i(e.query,"fileId","page")},isStaticNav:!1}))},EF=(...e)=>{const t=e.pop();return[...e,{id:Qt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Ye.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ti{}Ee(ti,"Cut","cut"),Ee(ti,"Copy","copy");const vf=e=>e.clientY===0,To=(e,t,r)=>{var i;const n=r.$el.getBoundingClientRect(),o=vf(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!vf(t)?t.clientX:n.x,right:t.type==="contextmenu"&&!vf(t)?t.clientX:n.x})}),e.show()},Gs=e=>(e||"").split("_")[0],ri=(e,t,r=Dt.DateTime.DATETIME_MED)=>e.setLocale(Gs(t)).toLocaleString(r),Sb=(e,t,r=Dt.DateTime.DATETIME_MED)=>ri(Dt.DateTime.fromJSDate(e),t,r),TF=(e,t,r=Dt.DateTime.DATETIME_MED)=>ri(Dt.DateTime.fromHTTP(e),t,r),Eb=(e,t,r=Dt.DateTime.DATETIME_MED)=>ri(Dt.DateTime.fromISO(e),t,r),AF=(e,t,r=Dt.DateTime.DATETIME_MED)=>ri(Dt.DateTime.fromRFC2822(e),t,r),Ao=(e,t)=>e.setLocale(Gs(t)).toRelative(),Tb=(e,t)=>Ao(Dt.DateTime.fromJSDate(e),t),RF=(e,t)=>Ao(Dt.DateTime.fromHTTP(e),t),_F=(e,t)=>Ao(Dt.DateTime.fromISO(e),t),IF=(e,t)=>Ao(Dt.DateTime.fromRFC2822(e),t),CF=1048576,wr=(e,t)=>{const r=typeof e=="string"?parseInt(e):e;return r<0?"--":isNaN(r)?"?":N0.filesize(r,{round:r<CF?0:1,locale:Gs(t),base:10,output:"string"})};function Ab(e="",t=!1){const r=ie.urlJoin(e,{leadingSlash:!0});if(r==="/")return[];const n=[],o=r.split("/");for(t&&n.push(r),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}n.push(o.join("/")),o.pop()}return n}var mt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(mt||{});const wf=(e,t=void 0)=>{const r=window.localStorage.getItem(e),n=ce(t);if(r)try{n.value=JSON.parse(r)}catch{n.value=r}return Tt(()=>m(n),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),n},ni=()=>{const e=ot(),t=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),r=V(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),n=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=V(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),l=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),c=V(()=>{var d;return m(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=V(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:r,chooseFileName:n,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:l,isDelegatingAuthentication:c,fileTypes:s,postMessage:(d,b)=>{const E={};m(l)&&(E.targetOrigin=m(l)),window.parent.postMessage({name:d,data:b},E)},verifyDelegatedAuthenticationOrigin:d=>m(u)?m(u)===d:!0}},Rb=e=>{const{isEnabled:t}=ni(),r=(e==null?void 0:e.bus)||Ye,n=wf("oc_sideBarOpen",!1),o=ce(!1),i=V({get(){return m(t)?m(o):m(n)},set(E){if(m(t)){o.value=E;return}n.value=E}}),s=async()=>{await Hr();const E=document.getElementById("app-sidebar");E&&E.focus()},l=ce(null),c=r.subscribe(mt.toggle,()=>{i.value=!m(i),m(i)&&s()}),u=r.subscribe(mt.close,()=>{i.value=!1,l.value=null}),a=r.subscribe(mt.open,()=>{i.value=!0,l.value=null,s()}),f=r.subscribe(mt.openWithPanel,E=>{i.value=!0,l.value=E,s()}),d=r.subscribe(mt.setActivePanel,E=>{l.value=E});Gr(()=>{r.unsubscribe(mt.toggle,c),r.unsubscribe(mt.close,u),r.unsubscribe(mt.open,a),r.unsubscribe(mt.openWithPanel,f),r.unsubscribe(mt.setActivePanel,d)});const b=(E,S)=>{r.subscribe(mt.setActivePanel,T=>{E===T&&setTimeout(()=>{S(T)},100)})};return{isSideBarOpen:un(i),sideBarActivePanel:un(l),onPanelActive:b}},rn=e=>e,_b=e=>ie.ShareTypes.containsAnyValue(ie.ShareTypes.authenticated,e??[]),Ib=e=>ie.ShareTypes.containsAnyValue(ie.ShareTypes.unauthenticated,e??[]),FF=({isDirect:e})=>rn(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),PF=({isDirect:e})=>rn(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),xF=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:FF({isDirect:t}),label:rn("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Ye.publish(mt.openWithPanel,"sharing#peopleShares")}}),OF=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:PF({isDirect:t}),label:rn("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Ye.publish(mt.openWithPanel,"sharing#linkShares")}}),kF=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:rn("Item locked"),label:rn("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),NF=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:rn("Item in processing"),label:rn("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),Ro=({space:e,resource:t,ancestorMetaData:r,user:n})=>{const o=[];if(t.locked&&o.push(kF({resource:t})),t.processing&&o.push(NF({resource:t})),ie.isProjectSpaceResource(e)&&e.isMember(n)||ie.isPersonalSpaceResource(e)&&e.isOwner(n)){const s=Object.values(r).reduce((u,a)=>(u.push(...a.shareTypes||[]),u),[]),l=_b(t.shareTypes);(l||_b(s))&&o.push(xF({resource:t,isDirect:l}));const c=Ib(t.shareTypes);(c||Ib(s))&&o.push(OF({resource:t,isDirect:c}))}return o},Cb=e=>new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>t(n.result),n.onerror=o=>r(o),n.readAsArrayBuffer(e)}),Fb=e=>new Promise(t=>e.toBlob(t)),it=Ge.defineStore("messages",()=>{const e=ce([]),t=i=>{const s={...i,id:Qt.v4()};return e.value.push(s),s},r=i=>{const s=l=>{var c,u;return(u=(c=l.response)==null?void 0:c.headers)==null?void 0:u.get("x-request-id")};return i.map(l=>s(l)).filter(l=>l!==null).map(l=>`X-Request-Id: ${l}`).join(`\r
56
+ `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:Qt.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:r(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=m(e).filter(({id:s})=>i.id!==s)}}}),_o=Ge.defineStore("clipboard",()=>{const{$gettext:e}=$e.useGettext(),{showMessage:t}=it(),r=ce(),n=ce([]);return{action:r,resources:n,copyResources:l=>{l[0].canDownload()&&(r.value=ti.Copy,n.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0].canDownload()&&(r.value=ti.Cut,n.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{r.value=void 0,n.value=[]}}}),Pb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},ot=Ge.defineStore("config",()=>{const e=Zr(),t=ce(""),r=ce(""),n=ce({...Pb}),o=ce([]),i=ce([]),s=ce([]),l=ce(),c=ce(),u=ce(),a=ce([]),f=ce([]),d=V(()=>ie.urlJoin(m(t)||window.location.origin,{trailingSlash:!0})),b=V(()=>!!m(l)),E=V(()=>!!m(c));return{options:n,oAuth2:l,openIdConnect:c,isOAuth2:b,isOIDC:E,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:r,scripts:a,styles:f,serverUrl:d,loadConfig:T=>{var w;T.server&&(t.value=(w=T.server)!=null&&w.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],s.value=T.customTranslations||[],l.value=T.auth,c.value=T.openIdConnect,u.value=T.sentry,a.value=T.scripts||[],f.value=T.styles||[],r.value=T.theme,T.options&&(n.value=co({...Pb},T.options),m(n).ocm.openRemotely=m(n).cernFeatures,m(n).routing.idBased=!m(n).cernFeatures,m(n).routing.fullShareOwnerPaths=m(n).cernFeatures),T.external_apps&&(i.value=T.external_apps,T.external_apps.filter(Boolean).forEach(y=>{e.loadExternalAppConfig({appId:y.id,config:y.config})}))}}}),$F=ge.z.object({url:ge.z.string()}),DF=ge.z.object({apiUrl:ge.z.string().optional(),authUrl:ge.z.string().optional(),clientId:ge.z.string().optional(),clientSecret:ge.z.string().optional(),logoutUrl:ge.z.string().optional(),metaDataUrl:ge.z.string().optional(),url:ge.z.string().optional()}),LF=ge.z.object({authority:ge.z.string().optional(),client_id:ge.z.string().optional(),client_secret:ge.z.string().optional(),dynamic:ge.z.string().optional(),metadata_url:ge.z.string().optional(),post_logout_redirect_uri:ge.z.string().optional(),response_type:ge.z.string().optional(),scope:ge.z.string().optional()}).passthrough(),BF=ge.z.record(ge.z.any()),MF=ge.z.object({href:ge.z.string().optional()}),jF=ge.z.object({async:ge.z.boolean().optional(),src:ge.z.string().optional()}),UF=ge.z.object({cernFeatures:ge.z.boolean().optional(),concurrentRequests:ge.z.object({resourceBatchActions:ge.z.number().optional(),sse:ge.z.number().optional(),shares:ge.z.object({create:ge.z.number().optional(),list:ge.z.number().optional()}).optional()}).optional(),contextHelpers:ge.z.boolean().optional(),contextHelpersReadMore:ge.z.boolean().optional(),defaultExtension:ge.z.string().optional(),disabledExtensions:ge.z.array(ge.z.string()).optional(),disableFeedbackLink:ge.z.boolean().optional(),accountEditLink:ge.z.object({href:ge.z.string().optional()}).optional(),editor:ge.z.object({autosaveEnabled:ge.z.boolean().optional(),autosaveInterval:ge.z.number().optional(),openAsPreview:ge.z.union([ge.z.boolean(),ge.z.array(ge.z.string())]).optional()}).optional(),embed:ge.z.object({enabled:ge.z.boolean().optional(),target:ge.z.string().optional(),messagesOrigin:ge.z.string().optional(),delegateAuthentication:ge.z.boolean().optional(),delegateAuthenticationOrigin:ge.z.string().optional(),fileTypes:ge.z.array(ge.z.string()).optional(),chooseFileName:ge.z.boolean().optional(),chooseFileNameSuggestion:ge.z.string().optional()}).optional(),feedbackLink:ge.z.object({ariaLabel:ge.z.string().optional(),description:ge.z.string().optional(),href:ge.z.string().optional()}).optional(),isRunningOnEos:ge.z.boolean().optional(),loginUrl:ge.z.string().optional(),logoutUrl:ge.z.string().optional(),ocm:ge.z.object({openRemotely:ge.z.boolean().optional()}).optional(),routing:ge.z.object({fullShareOwnerPaths:ge.z.boolean().optional(),idBased:ge.z.boolean().optional()}).optional(),runningOnEos:ge.z.boolean().optional(),tokenStorageLocal:ge.z.boolean().optional(),upload:ge.z.object({companionUrl:ge.z.string().optional()}).optional(),userListRequiresFilter:ge.z.boolean().optional(),hideLogo:ge.z.boolean().optional()}),qF=ge.z.object({id:ge.z.string(),path:ge.z.string(),config:ge.z.record(ge.z.unknown()).optional()}),VF=ge.z.object({server:ge.z.string(),theme:ge.z.string(),options:UF,apps:ge.z.array(ge.z.string()).optional(),external_apps:ge.z.array(qF).optional(),customTranslations:ge.z.array($F).optional(),auth:DF.optional(),openIdConnect:LF.optional(),sentry:BF.optional(),scripts:ge.z.array(jF).optional(),styles:ge.z.array(MF).optional()}),xb=Ge.defineStore("extensionPreferences",()=>{const e=Mn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(m(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Di=Ge.defineStore("extensionRegistry",()=>{const e=ot(),t=ce([]),r=u=>{t.value.push(u)},n=u=>{t.value=m(t).map(a=>ce(m(a).filter(({id:f})=>!u.includes(f)))).filter(a=>m(a).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return m(t).flatMap(a=>m(a).filter(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=ce([]);return{extensions:t,registerExtensions:r,unregisterExtensions:n,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=m(i).map(a=>ce(m(a).filter(({id:f})=>!u.includes(f)))).filter(a=>m(a).length)},getExtensionPoints:(u={})=>m(i).flatMap(a=>m(a).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),yt=Ge.defineStore("modals",()=>{const e=ce([]),t=V(()=>m(e).at(-1)),r=c=>m(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:Qt.v4()};return e.value.push(u),u},updateModal:(c,u,a)=>{const f=r(c);f[u]=a},removeModal:c=>{e.value=m(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=m(e).findIndex(f=>f.id===c);if(u<0)return;const a=r(c);m(e).splice(u,1),e.value.push(a)}}}),bt=Ge.defineStore("user",()=>{const e=ce();return{user:e,setUser:n=>{e.value=n,q0.setUser({username:n.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Ks=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},zF="thead-clicked",WF="highlight",HF="rowMounted",GF="contextmenuClicked",Ob="itemDropped",KF="itemDragged",QF=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"],XF={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function ii(e){return XF[e]}function YF(e,t,r,n){for(var o=-1,i=e==null?0:e.length;++o<i;)r=t(r,e[o],o,e);return r}function JF(e){return function(t){return e==null?void 0:e[t]}}var ZF={À:"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"},eP=JF(ZF),tP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rP="\\u0300-\\u036f",nP="\\ufe20-\\ufe2f",iP="\\u20d0-\\u20ff",oP=rP+nP+iP,sP="["+oP+"]",aP=RegExp(sP,"g");function lP(e){return e=Fl(e),e&&e.replace(tP,eP).replace(aP,"")}var cP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function uP(e){return e.match(cP)||[]}var fP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function dP(e){return fP.test(e)}var kb="\\ud800-\\udfff",pP="\\u0300-\\u036f",hP="\\ufe20-\\ufe2f",gP="\\u20d0-\\u20ff",mP=pP+hP+gP,Nb="\\u2700-\\u27bf",$b="a-z\\xdf-\\xf6\\xf8-\\xff",yP="\\xac\\xb1\\xd7\\xf7",bP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vP="\\u2000-\\u206f",wP=" \\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",Db="A-Z\\xc0-\\xd6\\xd8-\\xde",SP="\\ufe0e\\ufe0f",Lb=yP+bP+vP+wP,Bb="['’]",Mb="["+Lb+"]",EP="["+mP+"]",jb="\\d+",TP="["+Nb+"]",Ub="["+$b+"]",qb="[^"+kb+Lb+jb+Nb+$b+Db+"]",AP="\\ud83c[\\udffb-\\udfff]",RP="(?:"+EP+"|"+AP+")",_P="[^"+kb+"]",Vb="(?:\\ud83c[\\udde6-\\uddff]){2}",zb="[\\ud800-\\udbff][\\udc00-\\udfff]",Li="["+Db+"]",IP="\\u200d",Wb="(?:"+Ub+"|"+qb+")",CP="(?:"+Li+"|"+qb+")",Hb="(?:"+Bb+"(?:d|ll|m|re|s|t|ve))?",Gb="(?:"+Bb+"(?:D|LL|M|RE|S|T|VE))?",Kb=RP+"?",Qb="["+SP+"]?",FP="(?:"+IP+"(?:"+[_P,Vb,zb].join("|")+")"+Qb+Kb+")*",PP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",OP=Qb+Kb+FP,kP="(?:"+[TP,Vb,zb].join("|")+")"+OP,NP=RegExp([Li+"?"+Ub+"+"+Hb+"(?="+[Mb,Li,"$"].join("|")+")",CP+"+"+Gb+"(?="+[Mb,Li+Wb,"$"].join("|")+")",Li+"?"+Wb+"+"+Hb,Li+"+"+Gb,xP,PP,jb,kP].join("|"),"g");function $P(e){return e.match(NP)||[]}function DP(e,t,r){return e=Fl(e),t=t,t===void 0?dP(e)?$P(e):uP(e):e.match(t)||[]}var LP="['’]",BP=RegExp(LP,"g");function MP(e){return function(t){return YF(DP(lP(t).replace(BP,"")),e,"")}}var Xb=MP(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()});const Yb=ge.z.object({name:ge.z.string().optional(),slogan:ge.z.string().optional(),logo:ge.z.string().optional(),urls:ge.z.object({accessDeniedHelp:ge.z.string(),imprint:ge.z.string(),privacy:ge.z.string()}).optional(),shareRoles:ge.z.record(ge.z.string(),ge.z.object({iconName:ge.z.string()})).optional()}),jP=ge.z.object({breakpoints:ge.z.record(ge.z.string()).optional(),roles:ge.z.record(ge.z.string()).optional(),colorPalette:ge.z.record(ge.z.string()).optional(),fontFamily:ge.z.string().optional(),fontSizes:ge.z.record(ge.z.string()).optional(),sizes:ge.z.record(ge.z.string()).optional(),spacing:ge.z.record(ge.z.string()).optional()}),Jb=Yb.extend({designTokens:jP.optional(),favicon:ge.z.string().optional(),background:ge.z.string().optional()}),UP=Jb.extend({isDark:ge.z.boolean(),label:ge.z.string()}),Zb=ge.z.object({defaults:Jb,themes:ge.z.array(UP)}),qP=ge.z.object({common:Yb.optional(),clients:ge.z.object({web:Zb})}),VP="oc_currentThemeName",oi=Ge.defineStore("theme",()=>{const e=Mn.useLocalStorage(VP,null),t=Mn.usePreferredDark(),r=ce(),n=ce([]),o=a=>{const f=ad(a.common,a.clients.web.defaults);n.value=a.clients.web.themes.map(d=>ad(f,d)),i()},i=()=>{const a=m(n).find(d=>!d.isDark),f=m(n).find(d=>d.isDark);c(m(n).find(d=>d.label===m(e))||(m(t)?f:a)||m(n)[0],!1)},s=()=>{e.value=null,i()},l=V(()=>e.value===null),c=(a,f=!0)=>{var b,E,S,T,w,y;r.value=a,f&&(e.value=m(r).label);const d=[{name:"breakpoints",prefix:"breakpoint"},{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Ks("font-family",m(r).designTokens.fontFamily),d.forEach(g=>{for(const v in m(r).designTokens[g.name])Ks(`${g.prefix}-${Xb(v)}`,m(r).designTokens[g.name][v])}),(E=(b=m(r).designTokens)==null?void 0:b.roles)!=null&&E.chrome||(Ks("role-chrome",(T=(S=m(r).designTokens)==null?void 0:S.roles)==null?void 0:T.surfaceContainer),Ks("role-on-chrome",(y=(w=m(r).designTokens)==null?void 0:w.roles)==null?void 0:y.onSurface))};return{availableThemes:n,currentTheme:r,initializeThemes:o,setAndApplyTheme:c,setAutoSystemTheme:s,isCurrentThemeAutoSystem:l,getRoleIcon:a=>{var f;return((f=m(r).shareRoles[a.id])==null?void 0:f.iconName)||"user"}}}),Bt=Ge.defineStore("shares",()=>{const e=Qe(),{getRoleIcon:t}=oi(),r=ce(!1),n=ce([]),o=ce([]),i=ce({}),s=P=>{i.value=P.reduce((_,L)=>(_[L.id]={...L,icon:t(L)},_),{})},l=P=>{const _=m(n).find(({id:L})=>L===P.id);if(_){Object.assign(_,P);return}m(n).push(P)},c=P=>{n.value=P},u=P=>{m(n).push(...P)},a=P=>{n.value=m(n).filter(({id:_})=>_!==P.id)},f=()=>{n.value=[],o.value=[],r.value=void 0},d=()=>{const P=Object.values(e.ancestorMetaData).map(({id:_})=>_);if(!P.length){n.value=[],o.value=[];return}m(n).forEach(_=>{P.includes(_.resourceId)||a(_)}),m(o).forEach(_=>{P.includes(_.resourceId)||S(_)})},b=P=>{o.value=P},E=P=>{const _=m(o).find(({id:L})=>L===P.id);if(_){Object.assign(_,P);return}m(o).push(P)},S=P=>{o.value=m(o).filter(({id:_})=>_!==P.id)},T=P=>{r.value=P},w=P=>{const _=D=>{const H=new Set;return D.forEach(X=>{H.add(X.shareType)}),Array.from(H)},L=[...e.resources,e.currentFolder].find(D=>(D==null?void 0:D.id)===P);if(!L||ie.isProjectSpaceResource(L))return;const B=[...m(n),...m(o)];e.updateResourceField({id:L.id,field:"shareTypes",value:_(B.filter(D=>!D.indirect))});const $=e.getAncestorById(P);$&&e.updateAncestorField({path:$.path,field:"shareTypes",value:_(B.filter(D=>!D.indirect))})};return{loading:r,collaboratorShares:n,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:T,setCollaboratorShares:c,setLinkShares:b,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:P,space:_,resource:L,options:B})=>{const D=await P.graphAuthenticated.permissions.createInvite(_.id,L.id,B,m(i));return u([D]),w(L.id),e.loadIndicators(_,L.id),D},updateShare:async({clientService:P,space:_,resource:L,collaboratorShare:B,options:$})=>{const D=P.graphAuthenticated.permissions,H={roles:$.roles,expirationDateTime:$.expirationDateTime},X=await D.updatePermission(_.id,L.id,B.id,H,m(i));return l(X),X},deleteShare:async({clientService:P,space:_,resource:L,collaboratorShare:B,loadIndicators:$=!1})=>{await P.graphAuthenticated.permissions.deletePermission(_.id,L.id,B.id),a(B),w(L.id),$&&e.loadIndicators(_,L.id)},addLink:async({clientService:P,space:_,resource:L,options:B})=>{const D=await P.graphAuthenticated.permissions.createLink(_.id,L.id,B),H=e.selectedResources,X=H.some(({fileId:J})=>J===L.fileId)||H.length===0&&e.currentFolder.fileId===L.fileId;if(E(D),w(L.id),!X){const J=e.ancestorMetaData[L.path]??null;if(J){const{shareTypes:le}=J;le.includes(ie.ShareTypes.link.value)||e.updateAncestorField({path:J.path,field:"shareTypes",value:[...le,ie.ShareTypes.link.value]})}}return e.loadIndicators(_,L.id),D},updateLink:async({clientService:P,space:_,resource:L,linkShare:B,options:$})=>{const D=P.graphAuthenticated.permissions;let H;if(Object.hasOwn($,"password"))H=await D.setPermissionPassword(_.id,L.id,B.id,{password:$.password}),B.hasPassword=!!$.password;else{const X={link:{...$.type&&{type:$.type},...$.displayName&&{"@libre.graph.displayName":$.displayName}},...Object.hasOwn($,"expirationDateTime")&&{expirationDateTime:$.expirationDateTime}};H=await D.updatePermission(_.id,L.id,B.id,X)}return E(H),H},deleteLink:async({clientService:P,space:_,resource:L,linkShare:B,loadIndicators:$=!1})=>{await P.graphAuthenticated.permissions.deletePermission(_.id,L.id,B.id),S(B),w(L.id),$&&e.loadIndicators(_,L.id)}}}),ev=e=>e.sort((t,r)=>r.permissions.length-t.permissions.length),Io=async({graphClient:e,driveType:t,configStore:r,graphRoles:n,signal:o})=>{var c;const i=await e.drives.listMyDrives(n,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((c=r.options.routing)!=null&&c.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:a,driveAlias:f}=u.root.remoteItem;s[a]=f});const l=Object.entries(s).map(([u,a])=>ie.buildSpace({id:ie.extractStorageId(u),name:a,driveType:a.split("/")[0],driveAlias:a,path:"/",serverUrl:r.serverUrl},n));return[...i,...l]},ut=Ge.defineStore("spaces",()=>{const e=bt(),t=ot(),r=Bt(),n=ce([]),o=ce(),i=ce(!1),s=ce(!1),l=ce(!1),c=ce(null),u=V(()=>m(n).find(L=>ie.isPersonalSpaceResource(L)&&L.isOwner(e.user))),a=L=>{i.value=L},f=L=>{s.value=L},d=L=>{l.value=L},b=L=>{o.value=L},E=L=>{c.value=L},S=L=>{if(!ie.isProjectSpaceResource(L))return[];const B=r.collaboratorShares.filter($=>$.resourceId===L.id);return ev(B)},T=L=>{m(n).push(...L)},w=L=>{n.value=m(n).filter(({id:B})=>B!==L.id)},y=L=>m(n).find(B=>L==B.id),g=async({graphClient:L,space:B,signal:$})=>(await P({graphClient:L,signal:$}),m(n).find(D=>{var H,X;return ie.isMountPointSpaceResource(D)&&((X=(H=D.root)==null?void 0:H.remoteItem)==null?void 0:X.id)===B.id})),v=({driveAliasPrefix:L,id:B,shareName:$})=>{const D=ie.buildShareSpaceResource({driveAliasPrefix:L,id:B,shareName:$,serverUrl:t.serverUrl});return T([D]),D},A=L=>{const B=m(n).find(({id:$})=>$===L.id);if(B){Object.assign(B,L);return}T([L])},R=({id:L,field:B,value:$})=>{const D=m(n).find(H=>L===H.id);D&&(D[B]=$)},C=async({graphClient:L})=>{l.value=!0;try{const[B,$]=await Promise.all([Io({graphClient:L,driveType:"personal",configStore:t,graphRoles:r.graphRoles}),Io({graphClient:L,driveType:"project",configStore:t,graphRoles:r.graphRoles})]);T([...B,...$]),i.value=!0}finally{l.value=!1}},P=async({graphClient:L,signal:B})=>{if(!m(s))try{const $=await Io({graphClient:L,driveType:"mountpoint",configStore:t,graphRoles:r.graphRoles,signal:B});T($)}finally{s.value=!0}};return{spaces:n,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:l,currentSpace:o,personalSpace:u,defaultSpaceImageBlobURL:c,getSpace:y,createShareSpace:v,setSpacesInitialized:a,setMountPointsInitialized:f,setSpacesLoading:d,setCurrentSpace:b,setDefaultSpaceImageBlobURL:E,getSpaceMembers:S,getMountPointForSpace:g,addSpaces:T,removeSpace:w,upsertSpace:A,updateSpaceField:R,loadSpaces:C,loadMountPoints:P,reloadProjectSpaces:async({graphClient:L,signal:B})=>{const $=await Io({graphClient:L,driveType:"project",configStore:t,graphRoles:r.graphRoles,signal:B});n.value=m(n).filter(D=>!ie.isProjectSpaceResource(D)),T($)}}}),Qe=Ge.defineStore("resources",()=>{const e=ot(),t=ut(),r=bt(),n=ce([]),o=ce(),i=ce({}),s=ce([]),l=V(()=>{let F=m(n);return m($)||(F=F.filter(O=>!O.name.startsWith("."))),F}),c=V(()=>{const F=m(n).filter(({type:z})=>z==="file").length,O=m(n).filter(({type:z,name:ue})=>z==="file"&&ue.startsWith(".")).length,Q=m(n).filter(({type:z})=>z==="folder").length,W=m(n).filter(({type:z,name:ue})=>z==="folder"&&ue.startsWith(".")).length,U=m(n).filter(ie.isProjectSpaceResource).length;return{files:F,hiddenFiles:O,folders:Q,hiddenFolders:W,spaces:U}}),u=F=>{n.value=F},a=F=>{n.value=m(n).filter(O=>!F.find(({id:Q})=>Q===O.id))},f=()=>{n.value=[]},d=F=>{const O=m(n).find(({id:Q})=>Q===F.id);if(O){Object.assign(O,F);return}m(n).push(F)},b=F=>{const O=m(n).filter(Q=>!F.some(W=>W.path===Q.path));n.value=[...O,...F]},E=({id:F,field:O,value:Q})=>{const W=m(n).find(U=>F===U.id);W&&(W[O]=Q)},S=F=>{o.value=F},T=()=>{o.value=void 0},w=F=>{n.value=F.resources,o.value=F.currentFolder},y=()=>{n.value=[],o.value=void 0,g.value=[]},g=ce([]),v=ce(null),A=V(()=>m(n).filter(F=>m(g).includes(F.id))),R=F=>{const O=F.find(Q=>!m(g).includes(Q));O&&(v.value=O),g.value=F},C=F=>{v.value=F,m(g).includes(F)||m(g).push(F)},P=F=>{v.value=F,m(g).includes(F)&&(g.value=m(g).filter(O=>O!==F))},_=F=>{m(g).includes(F)?P(F):C(F)},L=()=>{g.value=[]},B=F=>{v.value=F},$=ce(!0),D=ce(!0),H=ce(!1),X=ce(!0),J=F=>{$.value=F,window.localStorage.setItem("oc_hiddenFilesShown",F.toString())},le=F=>{D.value=F,window.localStorage.setItem("oc_fileExtensionsShown",F.toString())},me=F=>{H.value=F,window.localStorage.setItem("oc_webDavDetailsShown",F.toString())},fe=F=>{X.value=F,window.localStorage.setItem("oc_disabledSpacesShown",F.toString())},we=(F,O)=>{const Q=m(n).filter(W=>[W.id,W.parentFolderId].includes(O));for(const W of Q){const U=Ro({space:F,resource:W,ancestorMetaData:m(i),user:r.user});!U.length&&!W.indicators.length||E({id:W.id,field:"indicators",value:U})}},Se=F=>{i.value=F};return{resources:n,currentFolder:o,activeResources:l,totalResourcesCount:c,setResources:u,removeResources:a,clearResources:f,upsertResource:d,upsertResources:b,updateResourceField:E,setCurrentFolder:S,clearCurrentFolder:T,initResourceList:w,clearResourceList:y,selectedIds:g,latestSelectedId:v,selectedResources:A,setSelection:R,addSelection:C,removeSelection:P,toggleSelection:_,resetSelection:L,setLastSelectedId:B,areHiddenFilesShown:$,areFileExtensionsShown:D,areWebDavDetailsShown:H,areDisabledSpacesShown:X,setAreHiddenFilesShown:J,setAreFileExtensionsShown:le,setAreWebDavDetailsShown:me,setAreDisabledSpacesShown:fe,loadIndicators:we,ancestorMetaData:i,setAncestorMetaData:Se,updateAncestorField:({path:F,field:O,value:Q})=>{const W=m(i)[F]??null;W&&(W[O]=Q)},loadAncestorMetaData:({folder:F,space:O,client:Q,signal:W})=>{const U={[F.path]:{id:F.fileId,shareTypes:F.shareTypes,parentFolderId:F.parentFolderId,spaceId:O.id,path:F.path}},z=[],ue=[Ve.FileId,Ve.ShareTypes,Ve.FileParent],_e=Ab(F.path),Be=t.spaces,xe=()=>Be.filter(Me=>ie.isMountPointSpaceResource(Me)&&ie.extractStorageId(Me.root.remoteItem.rootId)===O.id);let Fe=!0;if(e.options.routing.fullShareOwnerPaths){const Me=Be.find(ee=>ie.isProjectSpaceResource(ee)&&ee.id===O.id);Fe=O.isOwner(r.user)||(Me==null?void 0:Me.isMember(r.user))}for(const Me of _e){const ee=m(i)[Me]??null;if((ee==null?void 0:ee.spaceId)===O.id){U[Me]=ee;continue}if(!Fe&&!xe().find(Pe=>Me.startsWith(Pe.root.remoteItem.path)))break;z.push(Q.listFiles(O,{path:Me},{depth:0,davProperties:ue,signal:W}).then(({resource:Pe})=>{U[Me]={id:Pe.fileId,shareTypes:Pe.shareTypes,parentFolderId:Pe.parentFolderId,spaceId:O.id,path:Me}}))}return Promise.all(z).then(()=>{if(!Object.keys(U).includes("/")){const Me=m(i)["/"];if((Me==null?void 0:Me.spaceId)===O.id)U["/"]=Me;else{const{parentFolderId:ee}=Object.values(U)[0],Pe=t.spaces.find(({id:Ue})=>ee.startsWith(Ue));Pe&&(U["/"]={id:Pe.id,shareTypes:Pe.shareTypes,parentFolderId:Pe.id,spaceId:Pe.id,path:"/"})}}Se(U)})},getAncestorById:F=>Object.values(m(i)).find(O=>F===O.id),deleteQueue:s,addResourcesIntoDeleteQueue:F=>{s.value=s.value.concat(F.filter(O=>!m(s).includes(O)))},removeResourcesFromDeleteQueue:F=>{s.value=s.value.filter(O=>!F.includes(O))}}}),Co=Ge.defineStore("webWorkers",()=>{const e=ce([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const l=Qt.v4(),c=Mn.useWebWorker(i,{type:"module",name:l}),u={id:l,needsTokenRenewal:s,...c};return m(e).push(u),u},terminateWorker:i=>{const s=m(e).find(l=>i===l.id);s&&(s.terminate(),e.value=m(e).filter(l=>i!==l.id))},terminateAllWorkers:()=>{m(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{m(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),Qs=(e={})=>{const t=e.router||We(),r=e.configStore||ot();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:l})=>{var u;if(!((u=r.options.routing)!=null&&u.idBased)||s===i.path&&l===i.fileId)return!1;const c=Jr(o,i,{configStore:r});return t.replace(c),!0}}},Xs=()=>{const e=Jt();return V(()=>m(e).name)},tv=(e,t)=>{const r=Jt();return V(()=>m(r).meta[e]||t)},Ys=(e,t)=>{const r=We();return V({get(){return St(m(r.currentRoute).params[e])||t},async set(n){m(r.currentRoute).params[e]!==n&&await r.replace({params:{...m(r.currentRoute).params,[e]:n}})}})};let rv=Promise.resolve();const rr=(e,t)=>{const r=We();return V({get(){return m(r.currentRoute).query[e]||t},set(n){if(m(r.currentRoute).query[e]===n)return;rv=rv.then(async()=>{try{await r.replace({path:m(r.currentRoute).path,query:{...m(r.currentRoute).query,[e]:n}})}catch{}})}})},wn=e=>{const t=rr(e.name),r=wf(zP(e));return Tt(()=>m(t)?{value:m(t),source:"route"}:m(r)?{value:m(r),source:"storage"}:{value:e.defaultValue,source:"default"},n=>{["route","default"].includes(n.source)&&(r.value=n.value===e.defaultValue?void 0:St(n.value)),["storage","default"].includes(n.source)&&(t.value=n.value)},{immediate:!0}),t},zP=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Sn=(e,...t)=>{const r=ce(!1),n=We(),o=Jt();return Tt(o,()=>{r.value=e(n,...t)},{immediate:!0}),r},Js="contextRouteName",Sf="contextRouteParams",Ef="contextRouteQuery",Zs=e=>{var i;const{params:t,query:r}=e,n={},o=["fileId","shareId","q_share-visibility"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)n[s]=r[s];return{[Js]:e.name,[Sf]:t,[Ef]:n}},nv=e=>({routeName:St(e[Js]),routeParams:e[Sf],routeQuery:e[Ef]}),St=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function iv({router:e,currentFileContext:t}){const r=l=>{const{fileName:c,routeName:u,routeParams:a,routeQuery:f}=m(l);return m(u)?e.push({name:m(u),params:m(a),query:{...m(f),scrollTo:m(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:n}=Qs({router:e}),o=(l,c)=>{const u=m(l);return n({space:m(u.space),resource:c,path:m(u.item),fileId:m(u.itemId)})},i=ce(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,r(t)),closed:i}}const Je=()=>yn("$clientService");function Tf({clientService:e}){e=e||Je();const t=tr(),r=bt();return{getUrlForResource:(c,u,a)=>{var f;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=r.user)==null?void 0:f.onPremisesSamAccountName,...a})},revokeUrl:c=>e.webdav.revokeUrl(c),getFileContents:(c,u)=>e.webdav.getFileContents(m(m(c).space),{path:m(m(c).item)},{...u}),getFileInfo:(c,u={})=>e.webdav.getFileInfo(m(m(c).space),{path:m(m(c).item),fileId:m(m(c).itemId)},u),putFileContents:(c,u)=>e.webdav.putFileContents(m(m(c).space),{path:m(m(c).item),...u})}}const Af=()=>yn("$authService");class En{}Ee(En,"allFiles","all-files"),Ee(En,"currentFolder","current-folder");const Rf=()=>{const e=ot(),t=Je(),r=ut(),n=Qe(),o=tr(),i=V(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=V(()=>n.areHiddenFilesShown),l=V(()=>r.spaces.filter(ie.isProjectSpaceResource)),c=d=>m(l).find(b=>b.id===d),u=lr.useTask(function*(d,b,E=null){if(e.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!b)return{totalResults:null,values:[]};const{resources:S,totalResults:T}=yield*ie.call(t.webdav.search(b,{searchLimit:E,davProperties:Es.Default,signal:d}));return{totalResults:T,values:S.map(w=>{const y=c(w.parentFolderId),g=y||w;return e.options.routing.fullShareOwnerPaths&&g.remoteItemPath&&(g.path=ie.urlJoin(g.remoteItemPath,g.path)),{id:g.id,data:g}}).filter(({data:w})=>!w.name.startsWith(".")||m(s))}}).restartable();return{search:async(d,b=null)=>await u.perform(d,b),buildSearchTerm:({term:d,isTitleOnlySearch:b,tags:E,lastModified:S,mediaType:T,scope:w,useScope:y})=>{const g=[],v=d,A=m(i)&&!b;if(v){let R=`name:"*${v}*"`;A&&(R=`(name:"*${v}*" OR content:"${v}")`),g.push(R)}if(y&&w&&g.push(`scope:${w}`),E){const R=E.split("+").map(C=>`"${C}"`);g.push(`tag:(${R.join(" OR ")})`)}if(S&&g.push(`mtime:${S}`),T){const R=T.split("+").map(C=>`"${C}"`);g.push(`mediatype:(${R.join(" OR ")})`)}return g.sort((R,C)=>Number(R.startsWith("scope:"))-Number(C.startsWith("scope:"))).join(" AND ")}}};function ov({currentRoute:e,clientService:t}){const r=ce(!1),{webdav:n}=t,{replaceInvalidFileRoute:o}=Qs(),{getFileInfo:i}=Tf({clientService:t}),s=Af(),l=ut(),{buildSearchTerm:c,search:u}=Rf(),a=rr("contextRouteQuery"),f=Qe(),{activeResources:d}=Ge.storeToRefs(f);return{isFolderLoading:r,loadFolderForFileContext:async E=>{var S,T;r.value=!0;try{if(E=m(E),(S=m(a))!=null&&S.term){const P=c({term:(T=m(a))==null?void 0:T.term}),{values:_}=await u(P,200),L=_.filter(({data:B})=>ie.isSearchResource(B)).map(B=>B.data);f.initResourceList({currentFolder:null,resources:L}),r.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(m(E.routeName))){await Xy.getTask().perform(),r.value=!1;return}f.clearResourceList();const y=m(E.space),g=await i(E,{davProperties:[Ve.FileId]});if(o({space:y,resource:g,path:m(E.item),fileId:m(E.itemId)}),l.spaces.some(P=>{var _;return ie.isMountPointSpaceResource(P)&&((_=P.root.remoteItem)==null?void 0:_.id)===g.id})){const P=await i(E);f.initResourceList({currentFolder:P,resources:[P]}),r.value=!1;return}const A=ht.dirname(g.path),{resource:R,children:C}=await n.listFiles(y,{path:A});R.type==="file"?f.initResourceList({currentFolder:R,resources:[R]}):f.initResourceList({currentFolder:R,resources:C})}catch(w){if(w.statusCode===401)return s.handleAuthError(m(e));f.setCurrentFolder(null),console.error(w)}r.value=!1},activeFiles:d}}function _f({appsStore:e,applicationId:t}){return{applicationMeta:V(()=>{const n=e.apps[t];if(!n)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return n||{}})}}const Fo=()=>Ye;function sv({titleSegments:e,eventBus:t}){const r=oi(),{currentTheme:n}=Ge.storeToRefs(r);t=t||Fo(),Tt(e,o=>{const i=m(o),s=" - ",l={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,m(n).name].join(s)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function WP({appsStore:e,applicationId:t,applicationName:r,currentFileContext:n,currentRoute:o}){const i=_f({applicationId:t,appsStore:e}),{$gettext:s}=$e.useGettext(),l=V(()=>{var a,f,d;const c=ht.basename(m((a=m(n))==null?void 0:a.fileName))||s(((d=(f=m(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=m(m(i).applicationMeta);return[c,m(r)||u.name||u.id].filter(Boolean)});sv({titleSegments:l})}function av(e={}){const t=e.clientService??Je(),r=e.authStore??Yn();return{makeRequest:(o,i,s={})=>{const l=r.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},r.publicLinkContextReady&&(r.publicLinkPassword&&(s.headers.Authorization="Basic "+po.from(["public",r.publicLinkPassword].join(":")).toString("base64")),r.publicLinkToken&&(s.headers["public-token"]=r.publicLinkToken)),s.method=o,s.url=i,l.request(s)}}}const lv=()=>{const e=ut();return{areSpacesLoading:V(()=>!e.spacesInitialized||e.spacesLoading)}},cv=(e={})=>{const t=ut(),{areSpacesLoading:r}=lv(),n=rr("shareId"),o=rr("fileId"),i=V(()=>St(m(o))),s=ot(),l=Je(),c=V(()=>t.spaces),u=ce(null),a=ce(null),f=ce(!1),d=b=>{const E=b.split("/");return m(c).find(S=>{if(!b.startsWith(S.driveAlias))return!1;const T=S.driveAlias.split("/");return E.length<T.length||E.slice(0,T.length).join("/")!==S.driveAlias?!1:S})};return Wa(()=>{const b=m(e.driveAliasAndItem);!(b!=null&&b.startsWith("personal/"))&&!(b!=null&&b.startsWith("project/"))&&t.setCurrentSpace(null)}),Tt([e.driveAliasAndItem,r],async([b,E],[S,T])=>{if(b===S&&E===T)return;if(!b||b.startsWith("virtual/")){u.value=null,a.value=null;return}if(m(u)&&b.startsWith(m(u).driveAlias)){a.value=ie.urlJoin(b.slice(m(u).driveAlias.length),{leadingSlash:!0});return}let y=null,g=null;if(b.startsWith("public/")||b.startsWith("ocm/")){const[v,...A]=b.split("/").slice(1);y=m(c).find(R=>R.id===v),g=A.join("/")}else if(b.startsWith("share/")||b.startsWith("ocm-share/")){const[v,...A]=b.split("/").slice(1),R=b.startsWith("ocm-share/")?"ocm-share":"share";let C=St(m(n));C!=null&&C.includes(":")&&(C=[ie.SHARE_JAIL_ID,C].join("!")),y=t.getSpace(C)||t.createShareSpace({driveAliasPrefix:R,id:C,shareName:m(v)}),g=A.join("/")}else m(i)?y=m(c).find(v=>m(i).startsWith(`${v.fileId}`)):y=d(b),y||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),y=d(b)),y&&(g=b.slice(y.driveAlias.length));u.value=y,a.value=ie.urlJoin(g,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),Tt(u,b=>{t.setCurrentSpace(b)},{immediate:!0}),{space:u,item:a,itemId:i,loading:f}};function uv(e){const t=We(),r=Zr(),n=Jt(),o=e.clientService??Je(),i=e.applicationId,s=Yn(),{publicLinkContextReady:l}=Ge.storeToRefs(s),c=Ys("driveAliasAndItem"),{space:u,item:a,itemId:f,loading:d}=cv({driveAliasAndItem:c}),b=V(()=>{if(m(d))return null;let E;return m(u)?E=ie.urlJoin(m(u).webDavPath,m(a)):E=ie.urlJoin(St(m(n).params.filePath)),{path:E,driveAliasAndItem:m(c),space:m(u),item:m(a),itemId:m(f),fileName:ht.basename(E),routeName:St(m(n).query[Js]),...nv(m(n).query)}});return WP({appsStore:r,applicationId:i,applicationName:e.applicationName,currentFileContext:b,currentRoute:n}),{isPublicLinkContext:l,currentFileContext:b,...fh({appsStore:r,...e}),...iv({router:t,currentFileContext:b}),...Tf({clientService:o}),...ov({clientService:o,currentRoute:n}),...av({clientService:o,currentRoute:m(n)})}}const HP=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const r=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(r.path)||String(r.name)}" instead.`),r}}),GP=()=>[{path:"/list",redirect:e=>xr("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>xr("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:ie.urlJoin("personal/home",St(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ai("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>Or("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>Or("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>Or("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>_i("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Ri("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(HP),KP=(e,...t)=>{const[r,...n]=t.map(o=>{const i={"files-personal":xr("files-spaces-generic").name,"files-favorites":Ai("files-common-favorites").name,"files-shared-with-others":Or("files-shares-with-others").name,"files-shared-with-me":Or("files-shares-with-me").name,"files-trashbin ":_i("files-trash-generic").name,"files-public-list":Ri("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return wl(e,r,...n)},QP={name:"root",path:"/",redirect:e=>xr("files-spaces-generic",e)},XP=e=>[QP,...pT(e),...mT(e),...yT(e),...hT(e),...bT(e),...GP()],si=()=>{const{$gettext:e}=$e.useGettext(),t=Je();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(o)?i(e(`Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)):i(null),getDefaultMetaFolder:async o=>{const{children:i}=await t.webdav.listFiles(o);return i.find(({name:s})=>s===".space")}}},sr=e=>{const t=bt(),r=ut(),n=ot(),o=V(()=>r.spaces),i=Ys("driveAliasAndItem"),s=f=>m(e==null?void 0:e.space)||m(o).find(d=>d.id===f),l=f=>{var T,w,y,g,v;let d=f.storageId;((T=m(i))!=null&&T.startsWith("public/")||(w=m(i))!=null&&w.startsWith("ocm/"))&&(d=m(i).split("/")[1]);const b=s(d);if(b&&!ie.isMountPointSpaceResource(b))return b;const E=ie.isShareResource(f)&&f.shareTypes.includes(ie.ShareTypes.remote.value)||(y=f==null?void 0:f.id)!=null&&y.toString().startsWith(ie.OCM_PROVIDER_ID)?"ocm-share":"share";let S;return f.remoteItemPath?S=ht.basename(f.remoteItemPath):(g=m(i))!=null&&g.startsWith("share/")||(v=m(i))!=null&&v.startsWith("ocm-share/")?S=m(i).split("/")[1]:S=f.name,r.getSpace(f.remoteItemId)||r.createShareSpace({driveAliasPrefix:E,id:f.remoteItemId,shareName:S})},c=f=>m(o).filter(d=>ie.isMountPointSpaceResource(d)&&ie.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:l,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=r.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!n.options.routing.fullShareOwnerPaths)return!0;const b=m(o).find(S=>ie.isProjectSpaceResource(S)&&S.id===f.id);return f.isOwner(t.user)||(b==null?void 0:b.isMember(t.user))||c(f).some(S=>d.startsWith(S.root.remoteItem.path))}}},Bi=()=>{const e=Je(),t=Qe(),r=Bt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},r.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var l;const s=await e.webdav.createFolder(i,{path:".space"});return ie.extractStorageId(s.parentFolderId)===((l=t.currentFolder)==null?void 0:l.id)&&t.upsertResource(s),s}}},ar=()=>yn("$loadingService"),ea=()=>{const e=Yn(),t=Je(),r=$e.useGettext();return{headers:V(()=>{const o=new Mh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":r.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Qt.v4(),...o.getHeaders()}})}};function YP(e){return new Worker("/assets/worker-BCEWb3C6.js",{name:e==null?void 0:e.name})}const fv=({concurrentRequests:e=4}={})=>{const t=ot(),r=ar(),{headers:n}=ea(),{createWorker:o,terminateWorker:i}=Co(),s=({topic:c,space:u,resources:a},f)=>{const d=o(YP,{needsTokenRenewal:!0});let b;m(d.worker).onmessage=E=>{i(d.id),b==null||b(!0);const{successful:S,failed:T}=JSON.parse(E.data),w=T.map(({resource:y,...g})=>({resource:y,error:ie.createHttpError(g)}));f({successful:S,failed:w})},r.addTask(()=>new Promise(E=>{b=E})),d.post(l({topic:c,space:u,resources:a}))},l=({topic:c,space:u,resources:a})=>JSON.stringify({topic:c,data:{space:u,resources:a,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...m(n),"X-Request-ID":void 0}}});return{startWorker:s}};function JP(e){return new Worker("/assets/worker-BpDXOTOV.js",{name:e==null?void 0:e.name})}const dv=()=>{const e=ot(),t=ar(),{headers:r}=ea(),{createWorker:n,terminateWorker:o}=Co(),i=(l,c)=>{const u=n(JP,{needsTokenRenewal:!0});let a;m(u.worker).onmessage=f=>{o(u.id),a==null||a(!0);const{successful:d,failed:b}=JSON.parse(f.data),E=b.map(({resourceName:S,...T})=>({resourceName:S,error:ie.createHttpError(T)}));c({successful:d,failed:E})},t.addTask(()=>new Promise(f=>{a=f})),u.post(s(l))},s=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...m(r),"X-Request-ID":void 0}}});return{startWorker:i}};function ZP(e){return new Worker("/assets/worker-Ds2rbROB.js",{name:e==null?void 0:e.name})}const pv=()=>{const e=ot(),t=ar(),{headers:r}=ea(),{createWorker:n,terminateWorker:o}=Co(),i=({space:l,resources:c,missingFolderPaths:u},a)=>{const f=n(ZP,{needsTokenRenewal:!0});let d;m(f.worker).onmessage=b=>{o(f.id),d==null||d(!0);const{successful:E,failed:S}=JSON.parse(b.data),T=S.map(({resource:w,...y})=>({resource:w,error:ie.createHttpError(y)}));a({successful:E,failed:T})},t.addTask(()=>new Promise(b=>{d=b})),f.post(s({space:l,resources:c,missingFolderPaths:u}))},s=({space:l,resources:c,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:c,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...m(r),"X-Request-ID":void 0}}});return{startWorker:i}};function ex(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const tx=({authService:e})=>{const{createWorker:t}=Co(),r=ce();return{startWorker:()=>{r.value=t(ex),m(m(r).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof U0.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),m(r).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:l})=>{if(!m(r)){console.error("token timer worker is not running");return}m(r).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:l}))},resetTokenTimer:()=>{if(!m(r)){console.error("token timer worker is not running");return}m(r).post(JSON.stringify({topic:"reset"}))}}},hv=()=>{const e=ot(),t=it(),r=We(),n=$e.useGettext(),{getMatchingSpace:o}=sr(),{$gettext:i,$ngettext:s}=n,l=Je(),{dispatchModal:c}=yt(),u=ut(),a=Bt(),{startWorker:f}=fv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),d=Qe(),{currentFolder:b}=Ge.storeToRefs(d),E=ce([]),S=rr("page","1"),T=V(()=>parseInt(St(m(S)))),w=rr("items-per-page","1"),y=V(()=>parseInt(St(m(w)))),g=V(()=>Ep(m(E))),v=V(()=>{const _=m(g),L=_[0].type==="folder";let B=null;return _.length===1?(L?B=i('Permanently delete folder "%{name}"',{name:_[0].name},!0):B=i('Permanently delete file "%{name}"',{name:_[0].name},!0),B):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",_.length,{amount:_.length.toString()},!1)}),A=V(()=>{const _=m(g),L=_[0].type==="folder";return _.length===1?i(L?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),R=_=>{const L=m(r.currentRoute);f({topic:"trashBinDelete",space:_,resources:m(g)},({successful:B,failed:$})=>{var D,H;if(B.length){const X=B.length===1&&m(g).length===1?i('"%{item}" was deleted successfully',{item:B[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",B.length,{itemCount:B.length.toString()},!0);t.showMessage({title:X})}$.forEach(({resource:X})=>{const J=i('Failed to delete "%{item}"',{item:X.name});t.showErrorMessage({title:J,errors:[new Error]})}),L.name===m(r.currentRoute).name&&((D=L.query)==null?void 0:D.fileId)===((H=m(r.currentRoute).query)==null?void 0:H.fileId)&&(d.removeResources(B),d.resetSelection())})};return{displayDialog:(_,L)=>{E.value=[...L],c({title:m(v),message:m(A),confirmText:i("Delete"),onConfirm:()=>R(_)})},filesList_delete:_=>{var $;E.value=[..._],d.addResourcesIntoDeleteQueue(m(E).map(({id:D})=>D)),m(E).forEach(({id:D})=>d.removeSelection(D));const L=m(_).reduce((D,H)=>{if(H.storageId in D)return D[H.storageId].resources.push(H),D;const X=o(H);return X.id in D||(D[X.id]={space:X,resources:[]}),D[X.id].resources.push(H),D},{}),B=($=m(b))==null?void 0:$.id;return Object.values(L).map(({space:D,resources:H})=>{f({topic:"fileListDelete",space:D,resources:H},async({successful:X,failed:J})=>{var le;if(X.length){const me=X.length===1&&_.length===1?i('"%{item}" was moved to trash bin',{item:X[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",X.length,{itemCount:X.length.toString()},!0);t.showMessage({title:me})}if(d.removeResourcesFromDeleteQueue(J.map(({resource:me})=>me.id)),d.removeResourcesFromDeleteQueue(X.map(({id:me})=>me)),J.forEach(({error:me,resource:fe})=>{let we=i('Failed to delete "%{resource}"',{resource:fe.name});me.statusCode===423&&(we=i('Failed to delete "%{resource}" - the file is locked',{resource:fe.name})),t.showErrorMessage({title:we,errors:[me]})}),B===((le=m(b))==null?void 0:le.id)){d.removeResources(X);const me=d.activeResources.length,fe=Math.ceil(m(me)/m(y));m(T)>1&&m(T)>fe&&(S.value=fe.toString())}if(lt(r,"files-spaces-generic")&&!["public","share"].includes(D==null?void 0:D.driveType)){const fe=await l.graphAuthenticated.drives.getDrive(m(_)[0].storageId,a.graphRoles);u.updateSpaceField({id:fe.id,field:"spaceQuota",value:fe.spaceQuota})}if(m(E).length&&to(m(E)[0],m(b)))return r.push(Jr(D,{path:ht.dirname(m(E)[0].path),fileId:m(E)[0].parentFolderId}))})})}}},rx=e=>e==="files",On=()=>{const e=Jt();return V(()=>rx(_l(m(e))))};function nx(e){return e==null}const ix="edit",ox="create",qr=()=>{const e=Zr(),t=We(),{$gettext:r}=$e.useGettext(),n=ls(),{isEnabled:o}=ni(),{requestExtensions:i}=Di(),{openUrl:s}=Vv(),l=ot(),{options:c}=Ge.storeToRefs(l),{actions:u}=ta(),{actions:a}=ra(),{actions:f}=na(),{actions:d}=oa(),{actions:b}=ia(),{actions:E}=sa(),{actions:S}=Po(),{actions:T}=Pf(),{actions:w}=aa(),{actions:y}=xf(),{actions:g}=la(),{actions:v}=ca(),{actions:A}=$f(),R=V(()=>[...m(E),...m(S),...m(d),...m(w),...m(f),...m(g),...m(A),...m(v),...m(u),...m(a),...m(b),...m(T),...m(y)]),C=V(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(le=>le.action)),P=V(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),_=V(()=>m(o)?[]:e.fileExtensions.map(J=>{const le=e.apps[J.app];return{name:`editor-${J.app}`,label:()=>J.label?typeof J.label=="function"?J.label():J.label:r("Open in %{app}",{app:le.name},!0),showOpenInNewTabHint:!0,icon:J.icon||le.icon,...le.iconFillType&&{iconFillType:le.iconFillType},img:le.img,route:({space:me,resources:fe})=>L({appFileExtension:J,space:me,resource:fe[0]}),handler:me=>$(J,me.space,me.resources[0]),isVisible:({resources:me})=>me.length!==1||!me[0].canDownload()&&!J.secureView||!m(n)&&Rr(t,"files-trash-generic")?!1:me[0].extension&&J.extension?me[0].extension.toLowerCase()===J.extension.toLowerCase():me[0].mimeType&&J.mimeType?me[0].mimeType.toLowerCase()===J.mimeType.toLowerCase()||me[0].mimeType.split("/")[0].toLowerCase()===J.mimeType.toLowerCase():!1,hasPriority:J.hasPriority,class:`oc-files-actions-${Xb(le.name).toLowerCase()}-trigger`}}).sort((J,le)=>le.hasPriority!==J.hasPriority&&le.hasPriority?1:0)),L=({appFileExtension:J,space:le,resource:me})=>{const fe=ie.isShareSpaceResource(le)?le.id:void 0,we=J.routeName||J.app,Se=B(we,le,me,fe);return t.resolve(Se)},B=(J,le,me,fe,we)=>({name:J,params:{driveAliasAndItem:le==null?void 0:le.getDriveAliasAndItem(me)},query:{...fe&&{shareId:fe},...me.fileId&&m(c).routing.idBased&&{fileId:me.fileId},...we&&{templateId:we},...Zs(m(t.currentRoute))}}),$=(J,le,me)=>{const fe=ie.isShareSpaceResource(le)?le.id:void 0,we=J.routeName||J.app,Se=B(we,le,me,fe);if(m(c).cernFeatures){const re=t.resolve(Se).href,oe=`${J.routeName}-${me.path}`;s(re,oe,!0);return}t.push(Se)},D=J=>{H(J).handler({...J})},H=J=>{const le=X(J);if(le.length)return le[0]},X=J=>{const le=we=>we.isVisible(J),me=[...m(C),...m(_)].filter(le).sort((we,Se)=>Number(Se.hasPriority)-Number(we.hasPriority)),fe=J.omitSystemActions?[]:m(R).filter(le);return[...me,...fe,...m(P).filter(we=>we.isVisible(J)&&(we.category==="actions"||nx(we.category)))]};return{editorActions:_,systemActions:R,getDefaultAction:H,getAllAvailableActions:X,getEditorRouteOpts:B,openEditor:$,triggerDefaultAction:D}},ta=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=We(),{$gettext:n,$ngettext:o}=$e.useGettext(),i=Je(),s=ar(),l=ot(),c=Qe(),{updateResourceField:u}=c,a=async({resources:d})=>{const b=[],E=[],S=new Bn({concurrency:l.options.concurrentRequests.resourceBatchActions});if(d.forEach(T=>{E.push(S.add(async()=>{try{const{graphAuthenticated:w}=i;await w.driveItems.createDriveItem(T.driveId,{name:T.name,remoteItem:{id:T.fileId}}),u({id:T.id,field:"syncEnabled",value:!0})}catch(w){console.error(w),b.push(w)}}))}),await Promise.all(E),b.length===0){c.resetSelection(),lt(r,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:b})};return{actions:V(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>a(d)),label:()=>n("Enable sync"),isVisible:({space:d,resources:b})=>{var E;return!Nt(r,"files-shares-with-me")&&!lt(r,"files-spaces-generic")||b.length===0||lt(r,"files-spaces-generic")&&(((E=m(d))==null?void 0:E.driveType)!=="share"||b.length>1||b[0].path!=="/")?!1:b.some(S=>!S.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},ra=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=We(),{$gettext:n}=$e.useGettext(),o=Je(),i=ar(),s=ot(),{updateResourceField:l,resetSelection:c}=Qe(),u=async({resources:f})=>{const d=[],b=[],E=new Bn({concurrency:s.options.concurrentRequests.resourceBatchActions}),S=!f[0].hidden;if(f.forEach(T=>{b.push(E.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(T.driveId,T.id,{"@UI.Hidden":S}),l({id:T.id,field:"hidden",value:S})}catch(w){console.error(w),d.push(w)}}))}),await Promise.all(b),d.length===0){c(),e({title:n(S?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:n(S?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:V(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?n("Unhide"):n("Hide"),isVisible:({resources:f})=>f.length===0?!1:Nt(r,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},na=()=>{const e=ot(),t=We(),{copyResources:r}=_o(),n=$e.useGettext(),{$gettext:o}=n,i=Qe(),{currentFolder:s}=Ge.storeToRefs(i),l=V(()=>window.navigator.platform.match("Mac")),c=V(()=>m(l)?o("⌘ + C"):o("Ctrl + C")),u=({resources:f})=>{At(t,"files-common-search")&&(f=f.filter(d=>!ie.isProjectSpaceResource(d))),r(f)};return{actions:V(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:m(c),label:()=>o("Copy"),isVisible:({resources:f})=>{var d,b;if(!lt(t,"files-spaces-generic")&&!Ar(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")||lt(t,"files-spaces-projects")||f.length===0)return!1;if(Ar(t,"files-public-link"))return(d=m(s))==null?void 0:d.canCreate();if(At(t,"files-common-search")&&f.every(E=>ie.isProjectSpaceResource(E)))return!1;if(m(e.options.runningOnEos)){const E=((b=f[0].path)==null?void 0:b.split("/").filter(Boolean))||[];if(lt(t,"files-spaces-generic")&&E.length<5)return!1}return!!m(f)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},If=()=>({copyToClipboard:t=>{var r;if((r=navigator==null?void 0:navigator.clipboard)!=null&&r.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:n}=Mn.useClipboard({legacy:!0});return n(t)}}}),Cf=()=>{const{showMessage:e,showErrorMessage:t}=it(),{$gettext:r}=$e.useGettext(),{copyToClipboard:n}=If(),o=async s=>{try{await n(s),e({title:r("The link has been copied to your clipboard.")})}catch(l){console.error(l),t({title:r("Copy link failed"),errors:[l]})}};return{actions:V(()=>[{name:"copy-permanent-link",icon:"link",label:()=>r("Copy permanent link"),handler:({resources:s})=>{const[l]=s,c=l.privateLink;return o(c)},isVisible:({space:s,resources:l})=>ie.isPublicSpaceResource(s)?!1:l.length===1,class:"oc-files-actions-copy-permanent-link-trigger"}])}},ia=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=We(),{$gettext:n,$ngettext:o}=$e.useGettext(),i=Je(),s=ar(),l=ot(),{updateResourceField:c}=Qe(),u=async({resources:f})=>{const d=[],b=[],E=new Bn({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(S=>{b.push(E.add(async()=>{try{const{graphAuthenticated:T}=i;await T.driveItems.deleteDriveItem(S.driveId,S.id),c({id:S.id,field:"syncEnabled",value:!1})}catch(T){console.error(T),d.push(T)}}))}),await Promise.all(b),d.length===0){lt(r,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),r.push(Or("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",f.length),errors:d})};return{actions:V(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>n("Disable sync"),isVisible:({space:f,resources:d})=>!Nt(r,"files-shares-with-me")&&!lt(r,"files-spaces-generic")||d.length===0||lt(r,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(b=>b.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},oa=()=>{const e=bt(),t=tr(),r=We(),{displayDialog:n,filesList_delete:o}=hv(),{$gettext:i}=$e.useGettext(),s=({space:c,resources:u,deletePermanent:a})=>{if(At(r,"files-common-search")&&(u=u.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ie.isProjectSpaceResource(f))),a){n(c,u);return}o(u)};return{actions:V(()=>[{name:"delete",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!1}),isVisible:({space:c,resources:u})=>!lt(r,"files-spaces-generic")&&!Ar(r,"files-public-link")&&!At(r,"files-common-search")||u.length===0||lt(r,"files-spaces-generic")&&(c==null?void 0:c.driveType)==="share"&&u[0].path==="/"||u.length===1&&u[0].locked?!1:At(r,"files-common-search")?u.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!ie.isProjectSpaceResource(f)):!u.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>i("Delete"),handler:({space:c,resources:u})=>s({space:c,resources:u,deletePermanent:!0}),isVisible:({space:c,resources:u})=>!Rr(r,"files-trash-generic")||!t.filesPermanentDeletion||ie.isProjectSpaceResource(c)&&!c.canDeleteFromTrashBin({user:e.user})?!1:u.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function sx(e){return e&&e.length?e[0]:void 0}const gv=()=>yn("$archiverService"),sa=()=>{const{showErrorMessage:e}=it(),t=We(),r=ar(),n=gv(),{$ngettext:o,$gettext:i,current:s}=$e.useGettext(),l=Yn(),c=On(),u=({space:d,resources:b})=>{b.length>1&&(b=b.filter(S=>S.canDownload()&&!ie.isProjectSpaceResource(S)));const E=m(n.fileIdsSupported)?{fileIds:b.map(S=>S.fileId)}:{dir:cs.dirname(sx(b).path)||"/",files:b.map(S=>S.name)};return n.triggerDownload({...E,...d&&ie.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:l.publicLinkPassword}}).catch(S=>{console.error(S),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",b.length),errors:[S]})})},a=d=>{const b=m(n.capability);return b?d.reduce((S,T)=>S+parseInt(`${T.size}`),0)>parseInt(b.max_size):void 0};return{actions:V(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await r.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>a(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:wr(m(n.capability).max_size,s)}):"",isDisabled:({resources:d})=>a(d),isVisible:({resources:d})=>m(c)&&!lt(t,"files-spaces-generic")&&!Ar(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")&&!At(t,"files-common-search")||!m(n.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(E=>ie.isProjectSpaceResource(E))||ie.isProjectSpaceResource(d[0])&&d[0].disabled||!m(n.fileIdsSupported)&&At(t,"files-common-favorites")?!1:!d.some(E=>!E.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},mv=e=>{const{showErrorMessage:t}=it(),r=(e==null?void 0:e.clientService)||Je(),{$gettext:n}=$e.useGettext(),o=tr(),i=bt();return{downloadFile:async(l,c,u=null)=>{var a;try{const f=await r.webdav.getFileUrl(l,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(a=i.user)==null?void 0:a.onPremisesSamAccountName});zl(f,c.name)}catch(f){console.error(f),t({title:n("Download failed"),desc:n("File could not be located"),errors:[f]})}}}},Po=()=>{const e=We(),{$gettext:t}=$e.useGettext(),r=On(),n=ls(),{downloadFile:o}=mv(),i=({space:l,resources:c})=>{o(l,c[0])};return{actions:V(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:l})=>m(r)&&!m(n)&&!lt(e,"files-spaces-generic")&&!Ar(e,"files-public-link")&&!At(e,"files-common-favorites")&&!At(e,"files-common-search")&&!Nt(e,"files-shares-with-me")&&!Nt(e,"files-shares-with-others")&&!Nt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Ff=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),n=tr(),o=We(),{$gettext:i}=$e.useGettext(),s=Je(),{dispatchModal:l}=yt(),c=Qe(),u=ar(),a=({space:b})=>s.webdav.clearTrashBin(b).then(()=>{e({title:i("All deleted files were removed")}),c.clearResources(),c.resetSelection()}).catch(E=>{console.error(E),t({title:i("Failed to empty trash bin"),errors:[E]})}),f=({space:b})=>{l({title:i("Empty trash bin"),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the listed items? You can’t undo this action."),hasInput:!1,onConfirm:()=>u.addTask(()=>a({space:b}))})};return{actions:V(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:b})=>!(!Rr(o,"files-trash-generic")||!n.filesPermanentDeletion||ie.isProjectSpaceResource(b)&&!b.canDeleteFromTrashBin({user:r.user})),isDisabled:()=>c.activeResources.length===0,class:"oc-files-actions-empty-trash-bin-trigger",appearance:"filled"}]),emptyTrashBin:a}},Pf=()=>{const{showErrorMessage:e}=it(),t=tr(),r=We(),{$gettext:n}=$e.useGettext(),o=Je(),i=On(),s=dr(),l=Qe(),c=Fo(),u=async({space:f,resources:d})=>{try{const b=!d[0].starred;await o.webdav.setFavorite(f,d[0],b),l.updateResourceField({id:d[0].id,field:"starred",value:b}),b||c.publish("app.files.list.removeFromFavorites",d[0].id)}catch(b){const E=n('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:E,errors:[b]})}};return{actions:V(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?n("Remove from favorites"):n("Add to favorites"),isVisible:({resources:f})=>m(i)&&!lt(r,"files-spaces-generic")&&!At(r,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function ax(e,t){const r=e.isReceivedShare()||e.isMounted(),n=t===""&&r;return e.canBeDeleted()&&!n}const aa=()=>{const e=We(),{cutResources:t}=_o(),r=$e.useGettext(),{$gettext:n}=r,o=Qe(),{currentFolder:i}=Ge.storeToRefs(o),s=V(()=>window.navigator.platform.match("Mac")),l=V(()=>m(s)?n("⌘ + X"):n("Ctrl + X")),c=({resources:a})=>{t(a)};return{actions:V(()=>[{name:"cut",icon:"scissors",handler:c,shortcut:m(l),label:()=>n("Cut"),isVisible:({resources:a})=>!lt(e,"files-spaces-generic")&&!Ar(e,"files-public-link")&&!At(e,"files-common-favorites")||a.length===0||!m(i)||a.length===1&&a[0].locked?!1:!a.some(d=>ax(d,m(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},xf=()=>{const e=We(),{$gettext:t}=$e.useGettext(),{getMatchingSpace:r}=sr(),n=Qe(),{currentFolder:o}=Ge.storeToRefs(n),i=c=>c||r(c),s=V(()=>Ar(e,"files-public-link")?Ri("files-public-link"):xr("files-spaces-generic"));return{actions:V(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:c})=>!(Rr(e,"files-trash-generic")||c.length!==1||m(o)!==null&&to(c[0],m(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>co({},m(s),Jr(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},yv=()=>{const e=We(),t=Je(),{getMatchingSpace:r}=sr(),{$gettext:n,$ngettext:o}=$e.useGettext(),i=_o(),{startWorker:s}=dv(),l=Qe(),{currentFolder:c}=Ge.storeToRefs(l),u=V(()=>window.navigator.platform.match("Mac")),a=V(()=>m(u)?n("⌘ + V"):n("Ctrl + V")),f=V(()=>i.action===ti.Cut?hn.MOVE:hn.COPY),d=async({targetSpace:S,sourceSpace:T,resources:w})=>{var A;const y=new Ip(T,w,S,m(c),c,t,n,o),g=await y.getTransferData(m(f));if(!g.length)return;const v=(A=m(c))==null?void 0:A.id;s(g,async({successful:R,failed:C})=>{if(y.showResultMessage(C,R,m(f)),!R.length||m(c)&&v!==m(c).id)return;const P=[],_=[];for(const L of R)P.push((async()=>{const B=await t.webdav.getFileInfo(S,L);_.push(B)})());await Promise.allSettled(P),ie.isShareSpaceResource(S)&&_.forEach(L=>{L.remoteItemId=S.id}),l.upsertResources(_),l.loadIndicators(S,m(c).id)})},b=async({space:S})=>{const T=i.resources.reduce((y,g)=>{if(g.storageId in y)return y[g.storageId].resources.push(g),y;const v=r(g);return v.id in y||(y[v.id]={space:v,resources:[]}),y[v.id].resources.push(g),y},{}),w=Object.values(T).map(({space:y,resources:g})=>d({targetSpace:S,sourceSpace:y,resources:g}));await Promise.all(w),i.clearClipboard()};return{actions:V(()=>[{name:"paste",icon:"clipboard",handler:b,label:()=>n("Paste"),shortcut:m(a),isVisible:({resources:S})=>{var T;return i.resources.length===0||!lt(e,"files-spaces-generic")&&!Ar(e,"files-public-link")&&!At(e,"files-common-favorites")||S.length===0?!1:Ar(e,"files-public-link")&&m(c)?(T=m(c))==null?void 0:T.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},la=()=>{const{showErrorMessage:e}=it(),t=tr(),r=We(),{$gettext:n}=$e.useGettext(),o=Je(),i=ot(),{dispatchModal:s}=yt(),l=bt(),c=dr(),u=Qe(),{setCurrentFolder:a,upsertResource:f}=u,d=(T,w,y=void 0)=>{const g=T.path.substring(0,T.path.length-T.name.length)+w;if(!w)return n("The name cannot be empty");if(/[/]/.test(w))return n('The name cannot contain "/"');if(w===".")return n('The name cannot be equal to "."');if(w==="..")return n('The name cannot be equal to ".."');if(/\s+$/.test(w))return n("The name cannot end with whitespace");if(u.resources.find(A=>A.path===g&&T.name!==w)){const A=n('The name "%{name}" is already taken');return n(A,{name:w},!0)}if(y&&y.find(R=>R.path===g&&T.name!==w)){const R=n('The name "%{name}" is already taken');return n(R,{name:w},!0)}return null},b=async(T,w,y)=>{let g=u.currentFolder;try{const v=ht.join(ht.dirname(w.path),y);await o.webdav.moveFiles(T,w,T,{path:v});const A=to(w,g);if(ie.isShareSpaceResource(T)&&w.isReceivedShare()){if(T.rename(y),A)return g={...g},g.name=y,a(g),r.push(Jr(T,{path:"",fileId:w.fileId}));const C={...w};C.name=y,f(C);return}if(A)return g={...g},ll(T,g,v),a(g),r.push(Jr(T,{path:v,fileId:w.fileId}));const R={...w};ll(T,R,v),f(R)}catch(v){console.error(v);let A=n('Failed to rename "%{file}" to "%{newName}"',{file:w.name,newName:y},!0);v.statusCode===423&&(A=n('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:w.name,newName:y},!0)),e({title:A,errors:[v]})}},E=async({space:T,resources:w})=>{const y=u.currentFolder;let g;if(to(w[0],y)){const $=ht.dirname(y.path);g=(await o.webdav.listFiles(T,{path:$})).children}const v=u.areFileExtensionsShown,A=async $=>{v||($=`${$}.${w[0].extension}`),await b(T,w[0],$)},R=($,D)=>{v||($=`${$}.${w[0].extension}`);const H=d(w[0],$,g);D(H)},C=ie.extractNameWithoutExtension(w[0]),P=!w[0].isFolder&&!v?C:w[0].name,_=w[0].isFolder?n("Rename folder %{name}",{name:P}):n("Rename file %{name}",{name:P}),L=!w[0].isFolder&&!v?C:w[0].name,B=w[0].isFolder||!v?null:[0,C.length];s({title:_,confirmText:n("Rename"),hasInput:!0,inputValue:L,inputSelectionRange:B,inputLabel:w[0].isFolder?n("Folder name"):n("File name"),onConfirm:A,onInput:R})};return{actions:V(()=>[{name:"rename",icon:"pencil",label:()=>n("Rename"),handler:E,isVisible:({resources:T})=>Rr(r,"files-trash-generic")||Nt(r,"files-shares-with-me")&&!t.sharingCanRename||T.length!==1||(i.options.routing.fullShareOwnerPaths?T.some(g=>g.remoteItemPath&&g.path):T.some(g=>g.remoteItemId&&g.path==="/"))||T.length===1&&T[0].locked?!1:!T.some(g=>!g.canRename({user:l.user,ability:c})||g.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:b}},ca=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),n=We(),{$gettext:o,$ngettext:i}=$e.useGettext(),s=Je(),l=ut(),c=Bt(),u=Qe(),{startWorker:a}=pv(),f=async(T,w)=>{const y={},g=[],v=[],A=[];for(const R of w){const C=ht.dirname(R.path);let P=[];if(C in y)P=y[C];else{try{P=(await s.webdav.listFiles(T,{path:C})).children}catch{A.push(C)}y[C]=P}P.some(L=>L.name===R.name)||v.filter(L=>L.id!==R.id).some(L=>L.path===R.path)?g.push(R):v.push(R)}return{existingResourcesByPath:y,conflicts:g,resolvedResources:v,missingFolderPaths:A.filter(R=>{var C;return!((C=y[R])!=null&&C.length)})}},d=async T=>{let w=0;const y=[],g=T.length;let v=!1,A;for(const R of T){const C=R.type==="folder";if(v){y.push({resource:R,strategy:A});continue}const P=g-w,L=await new sl(o,i).resolveFileExists({name:R.name,isFolder:C},P,!1);w++,L.doForAllConflicts&&(v=!0,A=L.strategy),y.push({resource:R,strategy:L.strategy})}return y},b=(T,w,y)=>{const g=m(n.currentRoute);a({space:T,resources:w,missingFolderPaths:y},async({successful:v,failed:A})=>{var R,C;if(v.length){let P;v.length===1?P=o("%{resource} was restored successfully",{resource:v[0].name}):P=o("%{resourceCount} files restored successfully",{resourceCount:v.length.toString()}),e({title:P}),g.name===m(n.currentRoute).name&&((R=g.query)==null?void 0:R.fileId)===((C=m(n.currentRoute).query)==null?void 0:C.fileId)&&(u.removeResources(v),u.resetSelection());const L=await s.graphAuthenticated.drives.getDrive(T.id,c.graphRoles);l.updateSpaceField({id:L.id,field:"spaceQuota",value:L.spaceQuota})}if(A.length){let P;const _={};A.length===1?(_.resource=A[0].resource.name,P=o('Failed to restore "%{resource}"',_,!0)):(_.resourceCount=A.length.toString(),P=o("Failed to restore %{resourceCount} files",_,!0)),t({title:P,errors:A.map(({error:L})=>L)})}})},E=async({space:T,resources:w})=>{const y=w.sort((L,B)=>L.path.length-B.path.length),{existingResourcesByPath:g,conflicts:v,resolvedResources:A,missingFolderPaths:R}=await f(T,y),C=await d(v),P=C.filter(L=>L.strategy===Ur.REPLACE).map(L=>L.resource);A.push(...P);const _=C.filter(L=>L.strategy===Ur.KEEP_BOTH).map(L=>L.resource);for(let L of _){L={...L};const B=ht.dirname(L.path),$=g[B]||[],D=ie.extractExtensionFromFile(L),H=jr(L.name,D,[...$,...C.map(X=>X.resource),...A]);L.name=H,L.path=ie.urlJoin(B,H),A.push(L)}return b(T,A,R)};return{actions:V(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:E,isVisible:({space:T,resources:w})=>!Rr(n,"files-trash-generic")||!w.every(y=>ie.isTrashResource(y)&&y.canBeRestored())||ie.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:r.user})?!1:w.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:b,collectConflicts:f}},Of=()=>yn("$previewService"),bv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),n=We(),{$gettext:o}=$e.useGettext(),i=Je(),s=ar(),l=Of(),c=ut(),u=Bt(),{createDefaultMetaFolder:a}=Bi(),{getDefaultMetaFolder:f}=si(),d=async({space:E,resources:S})=>{var v;const T=i.graphAuthenticated,w=E==null?void 0:E.id,{copyFiles:y,getFileInfo:g}=i.webdav;try{let A=await f(E);A||(A=await a(E)),S[0].id!==((v=E.spaceImageData)==null?void 0:v.id)&&await y(E,{fileId:S[0].id},E,{parentFolderId:A.id,name:S[0].name},{overwrite:!0});const{fileId:R}=await g(E,{fileId:S[0].id}),C=await T.drives.updateDrive(w,{name:E.name,special:[{specialFolder:{name:"image"},id:R}]},u.graphRoles);c.updateSpaceField({id:w,field:"spaceImageData",value:C.spaceImageData}),e({title:o("Space image was set successfully")})}catch(A){console.error(A),t({title:o("Failed to set space image"),errors:[A]})}};return{actions:V(()=>[{name:"set-space-image",icon:"image-edit",handler:E=>s.addTask(()=>d(E)),label:()=>o("Set as space image"),isVisible:({space:E,resources:S})=>S.length!==1||!S[0].mimeType||!l.isMimetypeSupported(S[0].mimeType,!0)||!lt(n,"files-spaces-generic")||!E?!1:E.canEditImage({user:r.user}),class:"oc-files-actions-set-space-image-trigger"}])}},lx=()=>{const e=We(),{$gettext:t}=$e.useGettext(),r=On(),n=()=>{const i=Rr(e,"files-trash-generic")?null:"actions";Ye.publish(mt.openWithPanel,i)};return{actions:V(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:n,isVisible:({resources:i})=>m(r)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},kf=()=>{const e=We(),t=Qe(),{$gettext:r}=$e.useGettext();return{actions:V(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:o})=>Rr(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Ye.publish(mt.open)}}])}},vv=()=>{const e=tr(),{isPersonalSpaceRoot:t}=sr(),r=bt();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||ie.isPublicSpaceResource(o)||t(i)||ie.isTrashResource(i)?!1:ie.isIncomingShareResource(i)?i.sharePermissions.includes(ie.GraphSharePermission.readPermissions):ie.isShareSpaceResource(o)?ie.getPermissionsForSpaceMember(o,r.user).includes(ie.GraphSharePermission.readPermissions):!0}},wv=()=>{const e=tr(),t=dr(),r=bt();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||ie.isShareSpaceResource(o)||ie.isProjectSpaceResource(o)&&!o.canShare({user:r.user})?!1:i.canShare({ability:t,user:r.user})}},Nf=()=>{const e=We(),{$gettext:t}=$e.useGettext(),{canShare:r}=wv(),n=Qe(),o=({resources:s})=>{n.setSelection(s.map(({id:l})=>l)),Ye.publish(mt.openWithPanel,"sharing#peopleShares")};return{actions:V(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:l})=>Rr(e,"files-trash-generic")||l.length!==1?!1:r({space:s,resource:l[0]}),class:"oc-files-actions-show-shares-trigger"}])}},$f=()=>{const{showMessage:e,showErrorMessage:t}=it(),{can:r}=dr(),{$gettext:n,$ngettext:o}=$e.useGettext(),{createSpace:i}=Bi(),{checkSpaceNameModalInput:s}=si(),l=Je(),c=We(),u=V(()=>r("create-all","Drive")),{dispatchModal:a}=yt(),f=ot(),d=ut(),b=Qe(),E=async({spaceName:w,resources:y,space:g})=>{const{webdav:v}=l,A=new Bn({concurrency:f.options.concurrentRequests.resourceBatchActions}),R=[];try{const C=await i(w);d.upsertSpace(C),y.length===1&&y[0].isFolder&&(y=(await v.listFiles(g,{path:y[0].path})).children);for(const P of y)R.push(A.add(()=>v.copyFiles(g,P,C,{path:P.name})));await Promise.all(R),b.resetSelection(),e({title:n("Space was created successfully")})}catch(C){console.error(C),t({title:n("Creating space failed…"),errors:[C]})}},S=({resources:w,space:y})=>{a({title:o('Create Space from "%{resourceName}"',"Create Space from selection",w.length,{resourceName:w[0].name}),message:o('Create Space with the content of "%{resourceName}".',"Create Space with the selected files.",w.length,{resourceName:w[0].name}),contextualHelperLabel:n("The marked elements will be copied."),contextualHelperData:{title:n("Restrictions"),text:n("Shares, versions and tags will not be copied.")},confirmText:n("Create"),hasInput:!0,inputLabel:n("Space name"),onInput:s,onConfirm:g=>E({spaceName:g,space:y,resources:w})})};return{actions:V(()=>[{name:"create-space-from-resource",icon:"function",handler:S,label:()=>n("Create Space from selection"),isVisible:({resources:w,space:y})=>!(!w.length||!m(u)||!lt(c,"files-spaces-generic")||!ie.isPersonalSpaceResource(y)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Sv=()=>{const e=rr("scrollTo"),t=rr("details"),r=Qe(),n=V(()=>St(m(e))),o=V(()=>St(m(t))),i=(l,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${l}']`)[0];if(!u){Ye.publish("app.files.navigate.page",{resourceId:l,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const a=document.getElementById(c.topbarElement),f=(a==null?void 0:a.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Ye.subscribe("app.files.navigate.scrollTo",l=>i(l.resourceId,{forceScroll:l.forceScroll,topbarElement:l.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(l,c)=>{if(!m(n)||!l.length)return;const u=m(l).find(a=>ie.isIncomingShareResource(a)?a.remoteItemId===m(n):a.id===m(n));u&&u.processing!==!0&&(r.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:c}),m(o)&&Ye.publish(mt.openWithPanel,m(o)))}}},cx=({space:e}={})=>{const{showMessage:t,showErrorMessage:r}=it(),n=We(),{dispatchModal:o}=yt(),{$gettext:i}=$e.useGettext(),{scrollToResource:s}=Sv(),l=bt(),c=Qe(),{resources:u,currentFolder:a,ancestorMetaData:f}=Ge.storeToRefs(c),d=Je(),b=(y,g)=>y.trim()===""?g(i("Folder name cannot be empty")):/[/]/.test(y)?g(i('Folder name cannot contain "/"')):y==="."?g(i('Folder name cannot be equal to "."')):y===".."?g(i('Folder name cannot be equal to ".."')):m(u).find(A=>A.name===y)?g(i("%{name} already exists",{name:y},!0)):g(null),E=V(()=>lt(n,"files-spaces-generic")&&m(e).driveType!=="share"),S=async y=>{y=y.trimEnd();try{const g=ht.join(m(a).path,y),v=await d.webdav.createFolder(m(e),{path:g});m(E)&&(v.indicators=Ro({space:m(e),resource:v,ancestorMetaData:m(f),user:l.user})),ie.isShareSpaceResource(m(e))&&(v.remoteItemId=m(e).id),c.upsertResource(v),t({title:i('"%{folderName}" was created successfully',{folderName:y})}),await Hr(),s(v.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(g){console.error(g),r({title:i("Failed to create folder"),errors:[g]})}},T=()=>{let y=i("New folder");m(u).some(g=>g.name===y)&&(y=jr(y,"",m(u))),o({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:y,inputLabel:i("Folder name"),onConfirm:S,onInput:b})};return{actions:V(()=>[{name:"create-folder",icon:"folder",handler:T,label:()=>i("New Folder"),isVisible:()=>{var y;return(y=m(a))==null?void 0:y.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:b,addNewFolder:S}},ux=({space:e}={})=>{const{showMessage:t,showErrorMessage:r}=it(),n=bt(),o=We(),{$gettext:i}=$e.useGettext(),{dispatchModal:s}=yt(),l=Zr(),{isEnabled:c}=ni(),{openEditor:u}=qr(),a=Je(),f=Qe(),{resources:d,currentFolder:b,ancestorMetaData:E,areFileExtensionsShown:S}=Ge.storeToRefs(f),T=V(()=>l.fileExtensions.filter(({newFileMenu:R})=>!!R)),w=R=>R===""?i("File name cannot be empty"):/[/]/.test(R)?i('File name cannot contain "/"'):R==="."?i('File name cannot be equal to "."'):R===".."?i('File name cannot be equal to ".."'):/\s+$/.test(R)?i("File name cannot end with whitespace"):m(d).find(P=>P.name===R)?i("%{name} already exists",{name:R},!0):null,y=V(()=>lt(o,"files-spaces-generic")&&m(e).driveType!=="share"),g=(R,C)=>(y.value&&(R.indicators=Ro({space:m(e),resource:R,ancestorMetaData:m(E),user:n.user})),f.upsertResource(R),u(C,m(e),R)),v=(R,C,P)=>{let _=i("New file")+`.${C}`;m(d).some(B=>B.name===_)&&(_=jr(_,C,m(d))),S.value||(_=ie.extractNameWithoutExtension({name:_,extension:C}));const L=S.value?[0,_.length-(C.length+1)]:null;s({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:_,inputLabel:i("File name"),inputSelectionRange:L,onConfirm:async B=>{S.value||(B=`${B}.${C}`);try{let $;if(P.createFileHandler)$=await P.createFileHandler({fileName:B,space:m(e),currentFolder:m(b)});else{const D=ht.join(m(b).path,B);$=await a.webdav.putFileContents(m(e),{path:D})}return f.upsertResource($),t({title:i('"%{fileName}" was created successfully',{fileName:$.name})}),m(c)?void 0:g($,P)}catch($){console.error($),r({title:i("Failed to create file"),errors:[$]})}},onInput:(B,$)=>$(w(S.value?B:`${B}.${C}`))})};return{actions:V(()=>{var P;const R=[],C={};for(const _ of m(T)||[])_.hasPriority?C[_.extension]=_:C[_.extension]=C[_.extension]||_;for(const[,_]of Object.entries(C))R.push({name:"create-new-file",icon:"add",handler:L=>v(L,_.extension,_),label:()=>i(_.newFileMenu.menuTitle()),isVisible:()=>{var L;return(L=m(b))==null?void 0:L.canUpload({user:n.user})},class:"oc-files-actions-create-new-file",ext:_.extension,isExternal:(P=_.app)==null?void 0:P.startsWith("external-")});return R}),getNameErrorMsg:w,openFile:g}},Ev="rowMounted",Df="fileDropped",fx="contextmenuClicked";class Vr{}Ee(Vr,"Thumbnail",[36,36]),Ee(Vr,"Tile",[1e3,1e3]),Ee(Vr,"Preview",[1200,1200]),Ee(Vr,"Avatar",64);class ua{}Ee(ua,"Thumbnail","thumbnail"),Ee(ua,"Preview","preview"),Ee(ua,"Avatar","avatar");class dx{constructor(t,r,n){Ee(this,"state");Ee(this,"observeEnter");Ee(this,"observeExit");Ee(this,"onEnterCallCount");Ee(this,"onExitCallCount");Ee(this,"onEnter");Ee(this,"onExit");Ee(this,"threshold");Ee(this,"unobserver");this.unobserver=t,this.threshold=r,this.onEnter=n.onEnter,this.onExit=n.onExit,this.observeEnter=!!n.onEnter,this.observeExit=!!n.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,r){const n={element:r,unobserve:()=>this.unobserve(t,r)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...n})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...n})),this.state=t}unobserve(t,r){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(r)}}class Tv{constructor(t={}){Ee(this,"targets");Ee(this,"intersectionObserver");Ee(this,"options");this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,r={},n){!r.onEnter&&!r.onExit||(this.targets.set(t,new dx(this.unobserve.bind(this),n||this.options.threshold||0,{onEnter:r.onEnter,onExit:r.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(r=>{const n=this.targets.get(r.target);n&&n.request(r.isIntersecting&&r.intersectionRatio>n.threshold?0:1,r.target)})}}const px={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},hx={name:"layout-grid",color:"var(--oc-role-secondary)"},gx={name:"resource-type-file",color:"var(--oc-role-on-surface)"},mx=Fp(),yx=je({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>QF.some(t=>t===e)}},setup(e){const t=Cn(Cp),r=V(()=>e.resource.type==="folder"||e.resource.isFolder),n=V(()=>e.resource.type==="space"),o=V(()=>{var c;return(c=e.resource.extension)==null?void 0:c.toLowerCase()}),i=V(()=>{var c;return(c=e.resource.mimeType)==null?void 0:c.toLowerCase()}),s=V(()=>{if(m(n))return hx;if(m(r))return px;const c=mx[m(o)]||(t==null?void 0:t.mimeType[m(i)])||(t==null?void 0:t.extension[m(o)]);return{...gx,...c}}),l=V(()=>m(n)?"oc-resource-icon-space":m(r)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:l}}});function bx(e,t,r,n,o,i){const s=de("oc-icon");return te(),Ce(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:K.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const xo=qe(yx,[["render",bx]]),vx={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=ot(),{options:r}=Ge.storeToRefs(t);return{linkTarget:V(()=>m(r).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},wx={key:1};function Sx(e,t,r,n,o,i){return r.isResourceClickable?(te(),Ce(Hn(i.componentType),Yt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link",onDragstart:t[0]||(t[0]=Tr(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Te(()=>[Ke(e.$slots,"default")]),_:3},16,["target","onClick"])):(te(),ve("span",wx,[Ke(e.$slots,"default")]))}const Lf=qe(vx,[["render",Sx]]),Ex=je({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?cs.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),Tx=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],Ax={key:0,class:"oc-text-truncate"},Rx=["textContent"],_x=["textContent"],Ix=["textContent"];function Cx(e,t,r,n,o,i){const s=ur("oc-tooltip");return at((te(),ve("span",{class:K.normalizeClass(["oc-resource-name",[{"oc-display-inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(te(),ve("span",Ax,[pe("span",{class:"oc-resource-basename",textContent:K.toDisplayString(e.displayName)},null,8,Rx)])):(te(),ve("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:K.toDisplayString(e.displayName)},null,8,_x)),e.extension&&e.isExtensionDisplayed?(te(),ve("span",{key:2,class:"oc-resource-extension",textContent:K.toDisplayString(e.displayExtension)},null,8,Ix)):ke("",!0)],10,Tx)),[[s,e.tooltip]])}const Bf=qe(Ex,[["render",Cx]]),Fx=je({name:"ResourceListItem",components:{ResourceIcon:xo,ResourceLink:Lf,ResourceName:Bf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),Px={class:"oc-resource-indicators"},xx=["textContent"];function Ox(e,t,r,n,o,i){const s=de("oc-image"),l=de("resource-icon"),c=de("resource-link"),u=de("resource-name"),a=de("oc-icon"),f=ur("oc-tooltip");return te(),ve("div",{class:K.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(te(),Ce(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Te(()=>[e.hasThumbnail?at((te(),Ce(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):at((te(),Ce(l,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):ke("",!0),pe("div",{class:K.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[be(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Te(()=>[(te(),Ce(u,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","onClick"]),pe("div",Px,[e.isPathDisplayed?(te(),Ce(Hn(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:K.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Te(()=>[be(a,K.normalizeProps(Ya(e.parentFolderLinkIconAttrs)),null,16),pe("span",{class:"text oc-text-truncate",textContent:K.toDisplayString(e.parentFolderName)},null,8,xx)]),_:1},8,["to","style"])):ke("",!0)])],2)],2)}const Oo=qe(Fx,[["render",Ox]]),Av=new Tv,kx=je({components:{ResourceListItem:Oo},props:{searchResult:{type:Object,default:function(){return{}}},isClickable:{type:Boolean,default:!0},term:{type:String,default:""}},setup(e){const{triggerDefaultAction:t}=qr(),{getMatchingSpace:r}=sr(),{getDefaultAction:n}=qr(),{loadPreview:o}=Wf(),{getPathPrefix:i,getParentFolderName:s,getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:u}=ai(),a=ot(),{options:f}=Ge.storeToRefs(a),d=Qe(),b=ce(),E=V(()=>d.areFileExtensionsShown),S=V(()=>({...e.searchResult.data,...m(b)&&{thumbnail:m(b)}})),T=V(()=>r(m(S))),w=V(()=>{const A=m(S);return ie.isSpaceResource(A)&&A.disabled===!0}),y=()=>{t({space:m(T),resources:[m(S)]})},g=V(()=>e.isClickable?{parentFolderLink:l(m(S)),onClick:y}:{isResourceClickable:!1}),v=V(()=>{var C;if(m(S).isFolder)return u(m(S));const A=n({resources:[m(S)],space:m(T)});if(!(A!=null&&A.route))return null;const R=A.route({space:m(T),resources:[m(S)]});return R.query={...R.query,contextRouteQuery:{...((C=R.query)==null?void 0:C.contextRouteQuery)||{},term:e.term}},R});return{configOptions:f,space:T,previewData:b,loadPreview:o,resource:S,resourceDisabled:w,resourceClicked:y,resourceLink:v,parentFolderLink:l(m(S)),pathPrefix:i(m(S)),parentFolderName:s(m(S)),parentFolderLinkIconAdditionalAttributes:c(m(S)),additionalAttrs:g,areFileExtensionsShown:E}},mounted(){this.resourceDisabled&&this.$el.parentElement.classList.add("disabled");const e=async()=>{const r=await this.loadPreview({space:this.space,resource:this.resource,dimensions:Vr.Thumbnail,cancelRunning:!0});r&&(this.previewData=r)},t=Et.debounce(({unobserve:r})=>{r(),e()},250);Av.observe(this.$el,{onEnter:t,onExit:t.cancel})},beforeUnmount(){Av.disconnect()}});function Nx(e,t,r,n,o,i){const s=de("resource-list-item");return te(),Ce(s,Yt({resource:e.resource,"path-prefix":e.pathPrefix,"is-path-displayed":!0,link:e.resourceLink,"is-extension-displayed":e.areFileExtensionsShown,"parent-folder-link-icon-additional-attributes":e.parentFolderLinkIconAdditionalAttributes,"parent-folder-name":e.parentFolderName,"is-thumbnail-displayed":!!e.previewData},e.additionalAttrs),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"])}const Rv=qe(kx,[["render",Nx]]),$x=7,Dx=200,Lx=je({name:"CreateShortcutModal",components:{ResourcePreview:Rv},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:r}){const n=Je(),{$gettext:o}=$e.useGettext(),{showMessage:i,showErrorMessage:s}=it(),l=We(),{search:c}=Rf(),{getPathPrefix:u,getParentFolderName:a,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:b}=ai(),E=Qe(),{resources:S,currentFolder:T}=Ge.storeToRefs(E),w=ce(null),y=ce(""),g=ce(""),v=ce(null),A=ce(null),R=ce(!1);let C=null;const P=Q=>{const W=Q.trim();return X(W)?W:`https://${W}`},_=V(()=>P(m(y))),L=V(()=>!!m(S).find(Q=>Q.name===`${m(g)}.url`)),B=V(()=>m(L)||!m(g)||!m(y));Tt(B,()=>{t("update:confirmDisabled",m(B))},{immediate:!0});const $=V(()=>m(L)?o("%{name} already exists",{name:`${m(g)}.url`}):/[/]/.test(m(g))?o('Shortcut name cannot contain "/"'):""),D=lr.useTask(function*(Q,W){v.value=null,W=`name:"*${W}*" NOT name:"*.url"`;try{v.value=yield c(W,$x)}catch{}}),H=Et.debounce(()=>{D.perform(m(y))},Dx),X=Q=>["http://","https://"].some(U=>U.startsWith(Q)||Q.startsWith(U)),J=()=>{v.value=null,y.value=m(_);try{let Q=new URL(m(_)).host;m(S).some(W=>W.name===`${Q}.url`)&&(Q=jr(`${Q}.url`,"url",m(S)).slice(0,-4)),g.value=Q}catch{}},le=Q=>{v.value=null;const W=new URL(window.location.href);let U=Q.data.name;y.value=`${W.origin}/f/${Q.id}`,m(S).some(z=>z.name===`${U}.url`)&&(U=jr(`${U}.url`,"url",m(S)).slice(0,-4)),g.value=U},me=Q=>m(A)===Q,fe=(Q=!1)=>{const W=Array.from(document.querySelectorAll("li.selectable-item"));let U=m(A)!==null?m(A):Q?W.length:-1;const z=Q?-1:1;do if(U+=z,U<0||U>W.length-1)return null;while(W[U].classList.contains("disabled"));return U},we=()=>{A.value=fe(!0)},Se=()=>{A.value=fe(!1)},re=Q=>{m(R)&&(Q.stopPropagation(),m(w).hide())},oe=Q=>{var W,U;m(R)&&(Q.stopPropagation(),m(A)!==null&&(m(A)===0?J():le((U=(W=m(v))==null?void 0:W.values)==null?void 0:U[m(A)-1]),m(w).hide()))},ae=()=>{R.value=!1,A.value=null},Ae=()=>{R.value=!0,A.value=0},Z=()=>{y.value.trim().length&&m(w).show()},F=async()=>{if(await Hr(),g.value=y.value.trim(),!y.value.trim().length){m(w).hide();return}m(w).show(),Ar(l,"files-public-link")||H()},O=async()=>{try{const W=`[InternetShortcut]
57
+ URL=${od.sanitize(P(m(y)),{USE_PROFILES:{html:!0}})}`,U=ie.urlJoin(m(T).path,`${m(g)}.url`),z=await n.webdav.putFileContents(e.space,{path:U,content:W});E.upsertResource(z),i({title:o("Shortcut was created successfully")})}catch(Q){console.error(Q),s({title:o("Failed to create shortcut"),errors:[Q]})}};return qt(async()=>{var Q,W;await Hr(),C=new sd((W=(Q=m(w))==null?void 0:Q.$refs)==null?void 0:W.drop)}),Tt(v,async()=>{await Hr(),!(!m(R)||!C)&&(C.unmark(),C.mark(m(y),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Tt(A,()=>{var W,U;if(!m(R)||typeof((U=(W=m(w))==null?void 0:W.$el)==null?void 0:U.scrollTo)!="function")return;const Q=m(w).$el.querySelectorAll(".selectable-item");m(w).$el.scrollTo(0,m(A)===null?0:Q[m(A)].getBoundingClientRect().y-Q[m(A)].getBoundingClientRect().height)}),r({onConfirm:O}),{inputUrl:y,inputFilename:g,dropRef:w,dropItemUrl:_,searchResult:v,confirmButtonDisabled:B,inputFileNameErrorMessage:$,searchTask:D,dropItemUrlClicked:J,dropItemResourceClicked:le,getPathPrefix:u,getFolderLink:b,getParentFolderLink:f,getParentFolderName:a,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:oe,onKeyDownDrop:Se,onKeyUpDrop:we,onKeyEscDrop:re,onHideDrop:ae,onShowDrop:Ae,onInputUrlInput:F,onClickUrlInput:Z,isDropItemActive:me,onConfirm:O}}}),Bx={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},Mx=["textContent"],jx=["textContent"],Ux={key:0,class:"oc-p-xs oc-flex oc-flex-center"},qx={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},Vx=["textContent"],zx={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},Wx={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},Hx=["textContent"];function Gx(e,t,r,n,o,i){const s=de("oc-contextual-helper"),l=de("oc-text-input"),c=de("oc-icon"),u=de("oc-button"),a=de("oc-spinner"),f=de("resource-preview"),d=de("oc-list"),b=de("oc-drop");return te(),ve(Xe,null,[be(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=E=>e.inputUrl=E),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[eo(e.onKeyUpDrop,["up"]),eo(e.onKeyDownDrop,["down"]),eo(e.onKeyEscDrop,["esc"]),eo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Te(()=>[pe("div",Bx,[pe("label",{for:"create-shortcut-modal-url-input",textContent:K.toDisplayString(e.$gettext("Webpage or file"))},null,8,Mx),be(s,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),be(b,{ref:"dropRef",class:"oc-pt-s","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":!0,onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Te(()=>[be(d,null,{default:Te(()=>{var E,S;return[pe("li",{class:K.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[be(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Te(()=>[be(c,{name:"external-link"}),pe("span",{textContent:K.toDisplayString(e.dropItemUrl)},null,8,jx)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(te(),ve("li",Ux,[be(a)])):ke("",!0),(S=(E=e.searchResult)==null?void 0:E.values)!=null&&S.length?(te(),ve(Xe,{key:1},[pe("li",qx,[pe("span",{textContent:K.toDisplayString(e.$gettext("Link to a file"))},null,8,Vx)]),(te(!0),ve(Xe,null,kt(e.searchResult.values,(T,w)=>(te(),ve("li",{key:w,class:K.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(w+1)}])},[be(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:y=>e.dropItemResourceClicked(T)},{default:Te(()=>[be(f,{"search-result":T,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):ke("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(te(),ve("div",zx,[be(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=E=>e.inputFilename=E),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Te(()=>[pe("div",Wx,[pe("label",{for:"create-shortcut-modal-filename-input",textContent:K.toDisplayString(e.$gettext("Shortcut name"))},null,8,Hx),be(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","error-message"])])):ke("",!0)],64)}const _v=qe(Lx,[["render",Gx]]),Kx=({space:e})=>{const{dispatchModal:t}=yt(),{$gettext:r}=$e.useGettext(),n=Qe(),{currentFolder:o}=Ge.storeToRefs(n);return{actions:V(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:r("Create a Shortcut"),confirmText:r("Create"),customComponent:_v,customComponentAttrs:()=>({space:m(e)})})},label:()=>r("New Shortcut"),isVisible:()=>{var s;return(s=m(o))==null?void 0:s.canCreate()},class:"oc-files-actions-create-new-shortcut"}])}},Qx=()=>{const{showErrorMessage:e}=it(),t=We(),{$gettext:r}=$e.useGettext(),n=On(),o=ls(),i=Je(),s=u=>{const a=/URL=(.+)/,f=u.match(a);if(f&&f[1])return f[1];throw new Error("unable to extract url")},l=async({resources:u,space:a})=>{try{const f=new URL(window.location.href),d=(await i.webdav.getFileContents(a,u[0])).body;let b=s(d);if(b=b.match(/^http[s]?:\/\//)?b:`https://${b}`,b=od.sanitize(b,{USE_PROFILES:{html:!0}}),b.startsWith(f.origin)){window.location.href=b;return}window.open(b)}catch(f){console.error(f),e({title:r("Failed to open shortcut"),errors:[f]})}};return{actions:V(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>r("Open shortcut"),isVisible:({resources:u})=>m(n)&&!m(o)&&!lt(t,"files-spaces-generic")&&!Ar(t,"files-public-link")&&!At(t,"files-common-favorites")&&!At(t,"files-common-search")&&!Nt(t,"files-shares-with-me")&&!Nt(t,"files-shares-with-others")&&!Nt(t,"files-shares-via-link")||u.length!==1||u[0].extension!=="url"?!1:u[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:s}},Xx=je({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:r}=$e.useGettext(),{getLinkRoleByType:n}=fa(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=V(()=>{var c;return r((c=n(e.modelValue))==null?void 0:c.displayName)}),l=Qt.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:l,getLinkRoleByType:n}}}),Yx=["textContent"],Jx=["textContent"],Zx={class:"oc-flex oc-flex-middle"},eO=["textContent"],tO={class:"oc-text-small"},rO={class:"oc-flex"};function nO(e,t,r,n,o,i){var f;const s=de("oc-icon"),l=de("oc-button"),c=de("oc-list"),u=de("oc-drop"),a=ur("oc-tooltip");return te(),ve(Xe,null,[e.availableLinkTypeOptions.length>1?(te(),Ce(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none",class:"oc-text-left link-role-dropdown-toggle"},{default:Te(()=>[pe("span",{class:"link-current-role",textContent:K.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,Yx),be(s,{name:"arrow-down-s"})]),_:1},8,["id"])):at((te(),ve("span",{key:1,class:"link-current-role oc-mr-m",textContent:K.toDisplayString(e.currentLinkRoleLabel)},null,8,Jx)),[[a,(f=e.getLinkRoleByType(e.modelValue))==null?void 0:f.description]]),e.availableLinkTypeOptions.length>1?(te(),Ce(u,{key:2,class:"link-role-dropdown","drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click",offset:e.dropOffset,"close-on-click":""},{default:Te(()=>[be(c,{class:"role-dropdown-list"},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.availableLinkTypeOptions,(d,b)=>(te(),ve("li",{key:`role-dropdown-${b}`},[be(l,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:K.normalizeClass([{selected:e.isSelectedType(d),"oc-secondary-container":e.isSelectedType(d)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:E=>e.updateSelectedType(d)},{default:Te(()=>[pe("span",Zx,[be(s,{name:e.getLinkRoleByType(d).icon,class:"oc-pl-s oc-pr-m"},null,8,["name"]),pe("span",null,[pe("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:K.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,eO),pe("span",tO,K.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),pe("span",rO,[e.isSelectedType(d)?(te(),Ce(s,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):ke("",!0)],64)}const Iv=qe(Xx,[["render",nO],["__scopeId","data-v-c479d647"]]),iO=je({name:"CreateLinkModal",components:{LinkRoleDropdown:Iv},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const r=Je(),n=$e.useGettext(),{$gettext:o}=n,i=Wv(),{isEnabled:s,postMessage:l}=ni(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:a,isPasswordEnforcedForLinkType:f}=fa(),{addLink:d}=Bt(),b=ce(!1),E=ce(!1),S=V(()=>e.resources.every(({isFolder:Se})=>Se)),T=V(()=>m(s)?o("Share link(s)"):o("Copy link")),w=ce(Qt.v4()),y=ce({}),g=ce(),v=ka({value:"",error:void 0}),A=ce(m(c)),R=V(()=>o(a(m(A)).description)),C=V(()=>o(a(m(A)).displayName)),P=V(()=>a(m(A)).icon),_=V(()=>u({isFolder:m(S)})),L=V(()=>f(m(A))),B=i.getPolicy({enforcePassword:m(L)}),$=()=>{b.value=!0},D=({date:Se,error:re})=>{g.value=Se,E.value=re},H=()=>Promise.allSettled(e.resources.map(Se=>{var re;return d({clientService:r,space:e.space,resource:Se,options:{type:m(A),"@libre.graph.quickLink":!1,password:m(v).value,expirationDateTime:(re=m(g))==null?void 0:re.toISO(),displayName:o("Unnamed link")}})})),X=V(()=>!!B.check(m(v).value)),J=V(()=>!(m(X)&&!m(E))),le=async(Se={})=>{const re=await H(),oe=re.filter(({status:Z})=>Z==="fulfilled");oe.length&&m(s)&&l("opencloud-embed:share",oe.map(({value:Z})=>Z.webUrl));const ae=[],Ae=re.filter(({status:Z})=>Z==="rejected");if(Ae.length&&Ae.map(({reason:Z})=>Z).forEach(Z=>{var F;if(console.error(Z),((F=Z.response)==null?void 0:F.status)===400){const O=Z.response.data.error;O.message=Et.upperFirst(O.message),ae.push(O)}}),ae.length)return v.error=o(ae[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:re,password:v.value,options:Se})};t({onConfirm:le});const me=Se=>m(A)===Se,fe=Se=>{v.value=Se,v.error=void 0},we=Se=>{A.value=Se};return qt(()=>{const Se=m(y)[m(A)];Se&&Se.$el.focus(),m(L)&&(v.value=i.generatePassword())}),{roleRefs:y,password:v,passwordEnforced:L,passwordPolicy:B,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:w,selectedExpiry:g,availableLinkTypes:_,selectedType:A,selectedTypeIcon:P,selectedTypeDisplayName:C,selectedTypeDescription:R,isSelectedLinkType:me,updateSelectedLinkType:we,updatePassword:fe,getLinkRoleByType:a,confirmButtonText:T,isAdvancedMode:b,setAdvancedMode:$,onExpiryDateChanged:D,confirmButtonDisabled:J,DateTime:Dt.DateTime,onConfirm:le}}}),oO={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},sO={key:0,class:"oc-flex oc-flex-middle"},aO={key:1,class:"oc-flex oc-flex-middle"},lO={class:"oc-flex oc-flex-column"},cO=["textContent"],uO=["textContent"],fO=["textContent"],dO={class:"link-modal-password oc-mb-m"},pO={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},hO=["textContent"],gO=["textContent"],mO={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},yO={class:"oc-rounded oc-menu-item-hover"};function bO(e,t,r,n,o,i){const s=de("oc-icon"),l=de("link-role-dropdown"),c=de("oc-button"),u=de("oc-text-input"),a=de("oc-datepicker"),f=de("oc-list"),d=de("oc-drop");return te(),ve(Xe,null,[pe("div",oO,[e.isAdvancedMode?(te(),ve("div",sO,[be(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),be(l,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(te(),ve("div",aO,[be(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),pe("div",lO,[pe("span",{class:"oc-text-bold",textContent:K.toDisplayString(e.selectedTypeDisplayName)},null,8,cO),pe("span",{class:"oc-text-small",textContent:K.toDisplayString(e.selectedTypeDescription)},null,8,uO)])])),e.isAdvancedMode?ke("",!0):(te(),Ce(c,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:t[0]||(t[0]=b=>e.setAdvancedMode())},{default:Te(()=>[be(s,{name:"settings-3",size:"small","fill-type":"fill"}),pe("span",{textContent:K.toDisplayString(e.$gettext("Options"))},null,8,fO)]),_:1}))]),pe("div",dO,[e.isAdvancedMode?(te(),Ce(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.passwordEnforced?`${e.$gettext("Password")}*`:e.$gettext("Password"),class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","onUpdate:modelValue"])):e.password.value?(te(),ve("div",pO,[pe("span",{textContent:K.toDisplayString(e.$gettext("Password:"))},null,8,hO),pe("span",{textContent:K.toDisplayString(e.password.value)},null,8,gO)])):ke("",!0),e.isAdvancedMode?(te(),Ce(a,{key:2,class:"oc-mt-s","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):ke("",!0)]),pe("div",mO,[be(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=b=>e.$emit("cancel"))},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),pe("div",{class:K.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[be(c,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=b=>e.$emit("confirm"))},{default:Te(()=>[Vt(K.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(te(),Ce(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Te(()=>[be(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):ke("",!0),e.password.value?(te(),Ce(d,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small","close-on-click":""},{default:Te(()=>[be(f,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Te(()=>[pe("li",yO,[be(c,{class:"oc-modal-body-actions-confirm-password action-menu-item",appearance:"raw",onClick:t[3]||(t[3]=b=>e.$emit("confirm",{copyPassword:!0}))},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):ke("",!0)],2)])],64)}const Cv=qe(iO,[["render",bO],["__scopeId","data-v-0f5a06c6"]]),mr={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},vO={LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},fa=()=>{const{$gettext:e}=$e.useGettext(),t=tr(),r=dr(),n=V(()=>r.can("create-all","PublicLink")),o=V(()=>mr.View),i=u=>u===mr.View?t.sharingPublicPasswordEnforcedFor.read_only:u===mr.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===mr.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===mr.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>m(n)?u?[mr.View,mr.Edit,mr.CreateOnly]:[mr.View,mr.Edit]:[],l=[{id:mr.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:mr.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:mr.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:mr.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:mr.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:l,getLinkRoleByType:u=>l.find(({id:a})=>a===u)}},wO=({enforceModal:e=!1}={})=>{const t=Je(),r=bt(),{showMessage:n,showErrorMessage:o}=it(),{$gettext:i,$ngettext:s}=$e.useGettext(),l=tr(),c=dr(),u=ar(),{defaultLinkType:a}=fa(),{addLink:f}=Bt(),{dispatchModal:d}=yt(),{copyToClipboard:b}=If(),E=async({result:y,password:g,options:v={}})=>{const A=y.filter(C=>C.status==="fulfilled");if(A.length){let C=i("Link has been created successfully");if(y.length===1)try{const P=v.copyPassword?i("%{link} Password:%{password}",{link:A[0].value.webUrl,password:g},!0):A[0].value.webUrl;await b(P),C=i("The link has been copied to your clipboard.")}catch(P){console.warn("Unable to copy link to clipboard",P)}n({title:s(C,"Links have been created successfully.",A.length)})}const R=y.filter(({status:C})=>C==="rejected");R.length&&o({errors:R.map(({reason:C})=>C),title:s("Failed to create link","Failed to create links",R.length)})},S=async({space:y,resources:g})=>{const v=l.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||v){d({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",g.length,{resourceName:g[0].name}),customComponent:Cv,customComponentAttrs:()=>({space:y,resources:g,callbackFn:E}),hideActions:!0});return}const A=g.map(C=>f({clientService:t,space:y,resource:C,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:m(a)}})),R=await u.addTask(()=>Promise.allSettled(A));E({result:R})},T=({resources:y})=>{if(!y.length)return!1;for(const g of y)if(!g.canShare({user:r.user,ability:c})||ie.isProjectSpaceResource(g)&&g.disabled)return!1;return!0};return{actions:V(()=>[{name:"create-links",icon:"link",handler:S,label:()=>i("Create links"),isVisible:T,class:"oc-files-actions-create-links"}])}},SO=je({name:"AppLoadingSpinner"}),EO={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function TO(e,t,r,n,o,i){const s=de("oc-spinner");return te(),ve("div",EO,[be(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Mf=qe(SO,[["render",TO]]),AO=je({name:"FilePickerModal",components:{AppLoadingSpinner:Mf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=ce(),r=ce(!0),n=We(),{removeModal:o}=yt(),{getMatchingSpace:i}=sr(),s=oi(),{getEditorRouteOpts:l}=qr(),c=n.resolve(e.parentFolderLink),u=e.app.extensions.map(S=>S.extension?S.extension:S.mimeType),a=s.currentTheme.name,f=new URL(c.href,window.location.origin);f.searchParams.append("hide-logo","true"),f.searchParams.append("embed","true"),f.searchParams.append("embed-target","file"),f.searchParams.append("embed-delegate-authentication","false"),f.searchParams.append("embed-file-types",u.join(","));const d=()=>{r.value=!1,m(t).contentWindow.focus()},b=({data:S})=>{if(S.name!=="opencloud-embed:file-pick")return;const{resource:T,locationQuery:w}=S.data,y=i(T),g=ie.isShareSpaceResource(y)?y.id:void 0,v=l(m(n.currentRoute).name,y,T,g);v.query={...v.query,...w};const A=n.resolve(v),R=new URL(A.href,window.location.origin);o(e.modal.id),window.open(R.href,"_blank")},E=({data:S})=>{S.name==="opencloud-embed:cancel"&&o(e.modal.id)};return qt(()=>{window.addEventListener("message",b),window.addEventListener("message",E)}),Gr(()=>{window.removeEventListener("message",b),window.removeEventListener("message",E)}),{isLoading:r,onLoad:d,iframeTitle:a,iframeSrc:f.href,iframeRef:t,onFilePick:b}}}),RO={class:"oc-height-1-1",tabindex:"0"},_O=["title","src"];function IO(e,t,r,n,o,i){const s=de("app-loading-spinner");return te(),ve("div",RO,[e.isLoading?(te(),Ce(s,{key:0})):ke("",!0),at(pe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,_O),[[rl,!e.isLoading]])])}const Fv=qe(AO,[["render",IO]]),da=(e={},t)=>{const r=e.targetRouteCallback,{getMatchingSpace:n}=sr(e);return{createFileAction:s=>{const l=m(e.space)||n(s);t.emit("fileClick",{space:l,resources:[s]})},createFolderLink:s=>{if(m(r))return m(r)(s);const{path:l,fileId:c,resource:u}=s,a=m(e.space)||n(u);return a?xr("files-spaces-generic",Jr(a,{path:l,fileId:c})):{}}}},ai=(e={})=>{const t=tr(),{$gettext:r}=$e.useGettext(),{getInternalSpace:n,getMatchingSpace:o,isResourceAccessible:i}=sr(),{createFolderLink:s}=da(e);return{getPathPrefix:d=>{const b=m(e.space)||o(d);return ie.isProjectSpaceResource(b)?cs.join(r("Spaces"),b.name):ie.isShareSpaceResource(b)?cs.join(r("Shares"),b.name):b.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const b=m(e.space)||o(d),E=i({space:b,path:ht.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!E?Or("files-shares-with-me"):ie.isProjectSpaceResource(d)?xr("files-spaces-projects"):s({path:ht.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const b=m(e.space)||o(d),E=i({space:b,path:ht.dirname(d.path)});if(ie.isShareRoot(d)||d.id===b.id&&ie.isShareSpaceResource(b)||!E)return r("Shared with me");const T=ie.extractParentFolderName(d);if(T)return T;if(ie.isShareSpaceResource(b))return b.name;if(t.spacesProjects){if(ie.isProjectSpaceResource(d))return r("Spaces");if((b==null?void 0:b.driveType)==="project")return b.name}return r("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>ie.isProjectSpaceResource(d)||ie.isProjectSpaceResource(n(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Pv=({appId:e})=>{const{$gettext:t}=$e.useGettext(),r=On(),{dispatchModal:n}=yt(),o=Zr(),{apps:i}=Ge.storeToRefs(o),{getParentFolderLink:s}=ai(),l=({resources:u})=>{const a=m(i)[e],f=s(u[0]);n({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:a.name}),customComponent:Fv,hideActions:!0,customComponentAttrs:()=>({app:a,parentFolderLink:f}),focusTrapInitial:!1})};return{actions:V(()=>[{name:"open-with-app",icon:"folder-open",handler:l,label:()=>t("Open"),isVisible:()=>!m(r),class:"oc-files-actions-open-with-app-trigger"}])}},CO=je({name:"SaveAsModal",components:{AppLoadingSpinner:Mf},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=ce(),r=ce(!0),n=oi(),{$gettext:o}=$e.useGettext(),i=We(),s=Je(),{removeModal:l}=yt(),{showMessage:c,showErrorMessage:u}=it(),{getMatchingSpace:a}=sr(),{getEditorRouteOpts:f}=qr(),d=i.resolve(e.parentFolderLink),b=n.currentTheme.name,E=new URL(d.href,window.location.origin);E.searchParams.append("hide-logo","true"),E.searchParams.append("embed","true"),E.searchParams.append("embed-target","location"),E.searchParams.append("embed-choose-file-name","true"),E.searchParams.append("embed-delegate-authentication","false"),E.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const S=()=>{r.value=!1,m(t).contentWindow.focus()},T=async({data:v})=>{if(v.name!=="opencloud-embed:select")return;const{resources:A,fileName:R,locationQuery:C}=v.data,P=A[0],_=a(P);try{const L=await w({destinationFolder:P,fileName:R,space:_});c({title:o('"%{fileName}" was saved successfully',{fileName:L.name})}),y({resource:L,space:_,locationQuery:C})}catch(L){console.error(L),u({title:o('Unable to save "%{fileName}"',{fileName:R}),errors:[L]}),console.error(L)}l(e.modal.id)},w=async({destinationFolder:v,fileName:A,space:R})=>{const{children:C}=await s.webdav.listFiles(R,{fileId:v.fileId},{davProperties:[Ve.Name]});return C.find(_=>_.name===A)&&(A=jr(A,e.originalResource.extension,C)),s.webdav.putFileContents(R,{fileName:A,parentFolderId:v.id,content:e.content,path:ie.urlJoin(v.path,A)})},y=({locationQuery:v,resource:A,space:R})=>{const C=ie.isShareSpaceResource(R)?R.id:void 0,P=f(m(i.currentRoute).name,R,A,C);P.query={...P.query,...v};const _=i.resolve(P),L=new URL(_.href,window.location.origin);window.open(L.href,"_blank")},g=({data:v})=>{v.name==="opencloud-embed:cancel"&&l(e.modal.id)};return qt(()=>{window.addEventListener("message",T),window.addEventListener("message",g)}),Gr(()=>{window.removeEventListener("message",T),window.removeEventListener("message",g)}),{isLoading:r,onLoad:S,iframeTitle:b,iframeSrc:E.href,iframeRef:t,onLocationPick:T}}}),FO={class:"oc-height-1-1",tabindex:"0"},PO=["title","src"];function xO(e,t,r,n,o,i){const s=de("app-loading-spinner");return te(),ve("div",FO,[e.isLoading?(te(),Ce(s,{key:0})):ke("",!0),at(pe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,PO),[[rl,!e.isLoading]])])}const xv=qe(CO,[["render",xO]]),Ov=({content:e})=>{const{$gettext:t}=$e.useGettext(),r=On(),{dispatchModal:n}=yt(),{getParentFolderLink:o}=ai(),i=({resources:l})=>{const c=o(l[0]);n({elementClass:"save-as-modal",title:t("Save as"),customComponent:xv,hideActions:!0,customComponentAttrs:()=>({content:m(e),parentFolderLink:c,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:V(()=>[{name:"save-as",icon:"save-2",handler:i,label:()=>t("Save as"),isVisible:({resources:l})=>!m(r)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},kv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n,$ngettext:o}=$e.useGettext(),i=dr(),s=Je(),l=Jt(),{dispatchModal:c}=yt(),u=ut(),{removeResources:a}=Qe(),f=S=>S.filter(T=>ie.isProjectSpaceResource(T)&&T.canBeDeleted({user:r.user,ability:i})),d=async S=>{const T=s.graphAuthenticated,w=S.map(A=>T.drives.deleteDrive(A.id).then(()=>(a([A]),u.removeSpace(A),!0))),y=await Promise.allSettled(w),g=y.filter(A=>A.status==="fulfilled");if(g.length){const A=g.length===1&&S.length===1?n('Space "%{space}" was deleted successfully',{space:S[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",g.length,{spaceCount:g.length.toString()},!0);e({title:A})}const v=y.filter(A=>A.status==="rejected");if(v.length){v.forEach(console.error);const A=v.length===1&&S.length===1?n('Failed to delete space "%{space}"',{space:S[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",v.length,{spaceCount:v.length.toString()},!0);t({title:A,errors:v.map(R=>R.reason)})}m(l).name==="admin-settings-spaces"&&Ye.publish("app.admin-settings.list.load")},b=({resources:S})=>{const T=f(S);if(!T.length)return;const w=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",T.length,{count:T.length.toString()});c({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:n("Delete"),message:w,hasInput:!1,onConfirm:()=>d(T)})};return{actions:V(()=>[{name:"delete",icon:"delete-bin",label:()=>n("Delete"),handler:b,isVisible:({resources:S})=>!!f(S).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},Nv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n,$ngettext:o}=$e.useGettext(),i=dr(),s=Je(),l=Jt(),c=We(),{dispatchModal:u}=yt(),a=ut(),f=S=>S.filter(T=>ie.isProjectSpaceResource(T)&&T.canDisable({user:r.user,ability:i})),d=async S=>{const T=m(l),w=s.graphAuthenticated,y=S.map(R=>w.drives.disableDrive(R.id).then(()=>(T.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),T.name==="admin-settings-spaces"&&(R.disabled=!0,R.spaceQuota={total:R.spaceQuota.total}),a.updateSpaceField({id:R.id,field:"disabled",value:!0}),!0))),g=await Promise.allSettled(y),v=g.filter(R=>R.status==="fulfilled");if(v.length){const R=v.length===1&&S.length===1?n('Space "%{space}" was disabled successfully',{space:S[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:R})}const A=g.filter(R=>R.status==="rejected");if(A.length){A.forEach(console.error);const R=A.length===1&&S.length===1?n('Failed to disable space "%{space}"',{space:S[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",A.length,{spaceCount:A.length.toString()},!0);t({title:R,errors:A.map(C=>C.reason)})}},b=({resources:S})=>{const T=f(S);if(!T.length)return;const w=o("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",T.length,{count:T.length.toString()}),y=n("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:y,message:w,hasInput:!1,onConfirm:()=>d(T)})};return{actions:V(()=>[{name:"disable",icon:"stop-circle",label:()=>n("Disable"),handler:b,isVisible:({resources:S})=>!!f(S).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},$v=()=>{const e=ot(),t=ut(),r=Bt(),{showMessage:n,showErrorMessage:o}=it(),i=We(),{$gettext:s}=$e.useGettext(),l=dr(),c=Je(),u=ar(),{upsertResource:a}=Qe(),f=lt(i,"files-spaces-projects"),d=async S=>{const T=t.spaces.filter(ie.isProjectSpaceResource),w=jr(S.name,"",T);try{let y=await c.graphAuthenticated.drives.createDrive({name:w,description:S.description,quota:{total:S.spaceQuota.total}},r.graphRoles);const g=await c.webdav.listFiles(S);if(g.children.length){const v=new Bn({concurrency:e.options.concurrentRequests.resourceBatchActions}),A=[];for(const R of g.children)A.push(v.add(()=>c.webdav.copyFiles(S,R,y,{path:R.name})));await Promise.all(A)}if(S.spaceReadmeData||S.spaceImageData){const v={special:[]};if(S.spaceReadmeData){const A=await c.webdav.getFileInfo(y,{path:`.space/${S.spaceReadmeData.name}`});v.special.push({specialFolder:{name:"readme"},id:A.id})}if(S.spaceImageData){const A=await c.webdav.getFileInfo(y,{path:`.space/${S.spaceImageData.name}`});v.special.push({specialFolder:{name:"image"},id:A.id})}y=await c.graphAuthenticated.drives.updateDrive(y.id,v,r.graphRoles)}t.upsertSpace(y),f&&a(y),n({title:s('Space "%{space}" was duplicated successfully',{space:S.name})})}catch(y){console.error(y),o({title:s('Failed to duplicate space "%{space}"',{space:S.name}),errors:[y]})}},b=async({resources:S})=>{for(const T of S)T.disabled||!ie.isProjectSpaceResource(T)||await d(T)};return{actions:V(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:S=>u.addTask(()=>b(S)),isVisible:({resources:S})=>!(S!=null&&S.length)||S.every(T=>T.disabled)||S.every(T=>!ie.isProjectSpaceResource(T))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},OO=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n}=$e.useGettext(),o=dr(),i=Je(),s=Jt(),{dispatchModal:l}=yt(),c=ut(),u=Bt(),a=(b,E)=>i.graphAuthenticated.drives.updateDrive(b.id,{name:b.name,description:E},u.graphRoles).then(()=>{c.updateSpaceField({id:b.id,field:"description",value:E}),m(s).name==="admin-settings-spaces"&&(b.description=E),e({title:n("Space subtitle was changed successfully")})}).catch(T=>{console.error(T),t({title:n("Failed to change space subtitle"),errors:[T]})}),f=({resources:b})=>{b.length===1&&l({title:n("Change subtitle for space")+" "+b[0].name,confirmText:n("Confirm"),hasInput:!0,inputLabel:n("Space subtitle"),inputValue:b[0].description,onConfirm:E=>a(b[0],E)})};return{actions:V(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>n("Edit subtitle"),handler:f,isVisible:({resources:b})=>b.length!==1?!1:b[0].canEditDescription({user:r.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:a}},kO={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=ce(void 0),t=ce([]);return{selectedOption:e,options:t}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return Et.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(r=>this.totalQuota===0&&r.value===0?(r.selectable=!1,!0):r.value!==0&&r.value<=this.maxQuota)),e.find(r=>r.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(r=>r.value).sort((r,n)=>r.value-n.value),...e.filter(r=>!r.value)],this.options=e},getFormattedFileSize(e){const t=wr(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},NO={class:"quota-select-batch-action-form"},$O=["textContent"],DO={class:"oc-flex oc-flex-between"},LO=["textContent"],BO={key:0,class:"oc-text-input-danger"};function MO(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-select");return te(),ve("div",NO,[be(l,Yt({ref:"select","model-value":n.selectedOption,selectable:i.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:n.options,"create-option":i.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":i.onUpdate}),{"selected-option":Te(({displayValue:c})=>[e.$attrs["read-only"]?(te(),Ce(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):ke("",!0),pe("span",{textContent:K.toDisplayString(c)},null,8,$O)]),search:Te(({attributes:c,events:u})=>[pe("input",Yt({class:"vs__search"},c,Ga(u,!0)),null,16)]),option:Te(({displayValue:c,error:u})=>[pe("div",DO,[pe("span",{textContent:K.toDisplayString(c)},null,8,LO)]),u?(te(),ve("div",BO,K.toDisplayString(u),1)):ke("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Dv=qe(kO,[["render",MO]]),jO=je({name:"SpaceQuotaModal",components:{QuotaSelect:Dv},props:{modal:{type:Object,required:!0},spaces:{type:Array,required:!0},warningMessage:{type:String,default:""},warningMessageContextualHelperData:{type:Object,default:()=>{}},resourceType:{type:String,required:!1,default:"space",validator:e=>["space","user"].includes(e)}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:r}){const{showMessage:n,showErrorMessage:o}=it(),i=tr(),s=Ge.storeToRefs(i),{$gettext:l,$ngettext:c}=$e.useGettext(),u=Je(),a=We(),f=ut(),d=Bt(),{updateResourceField:b}=Qe(),E=ce(0),S=v=>e.resourceType==="space"?c("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",v,{count:v.toString()}):e.resourceType==="user"?c("User quota was changed successfully","Quota of %{count} users was changed successfully",v,{count:v.toString()}):l("Quota was changed successfully"),T=v=>e.resourceType==="space"?c("Failed to change space quota","Failed to change quota for %{count} spaces",v,{count:v.toString()}):e.resourceType==="user"?c("Failed to change user quota","Failed to change quota for %{count} users",v,{count:v.toString()}):l("Failed to change quota"),w=V(()=>!e.spaces.some(v=>v.spaceQuota.total!==m(E)));Tt(w,()=>{t("update:confirmDisabled",m(w))},{immediate:!0});const y=v=>{E.value=v.value},g=async()=>{const v=u.graphAuthenticated,A=e.spaces.map(async _=>{const L=await v.drives.updateDrive(_.id,{name:_.name,quota:{total:m(E)}},d.graphRoles);m(a.currentRoute).name==="admin-settings-spaces"&&Ye.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:_.id,quota:L.spaceQuota}),m(a.currentRoute).name==="admin-settings-users"&&Ye.publish("app.admin-settings.users.user.quota.updated",{spaceId:_.id,quota:L.spaceQuota}),f.updateSpaceField({id:_.id,field:"spaceQuota",value:L.spaceQuota}),b({id:_.id,field:"spaceQuota",value:L.spaceQuota})}),R=await Promise.allSettled(A),C=R.filter(_=>_.status==="fulfilled");C.length&&n({title:S(C.length)});const P=R.filter(_=>_.status==="rejected");P.length&&(console.error(P),P.forEach(console.error),o({title:T(P.length),errors:P.map(_=>_.reason)}))};return r({onConfirm:g}),qt(()=>{var v,A;E.value=((A=(v=e.spaces[0])==null?void 0:v.spaceQuota)==null?void 0:A.total)||0}),{selectedOption:E,confirmButtonDisabled:w,changeSelectedQuotaOption:y,maxQuota:s.spacesMaxQuota,onConfirm:g}}}),UO={key:0,class:"oc-mt-s"},qO=["textContent"];function VO(e,t,r,n,o,i){const s=de("quota-select"),l=de("oc-contextual-helper");return te(),ve(Xe,null,[be(s,{"total-quota":e.selectedOption,"max-quota":e.maxQuota,"position-fixed":!0,onSelectedOptionChange:e.changeSelectedQuotaOption},null,8,["total-quota","max-quota","onSelectedOptionChange"]),e.warningMessage?(te(),ve("div",UO,[pe("span",{class:"oc-text-input-warning",textContent:K.toDisplayString(e.warningMessage)},null,8,qO),e.warningMessageContextualHelperData?(te(),Ce(l,Yt({key:0,class:"oc-pl-xs"},e.warningMessageContextualHelperData),null,16)):ke("",!0)])):ke("",!0)],64)}const Lv=qe(jO,[["render",VO]]),Bv=()=>{const{dispatchModal:e}=yt(),{$gettext:t}=$e.useGettext(),r=dr(),n=({resources:s})=>s.length===1?t('Change quota for Space "%{name}"',{name:s[0].name}):t("Change quota for %{count} Spaces",{count:s.length.toString()}),o=({resources:s})=>{e({title:n({resources:s}),customComponent:Lv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:V(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:s})=>!s||!s.length||s.some(l=>!ie.isProjectSpaceResource(l)||ie.isSpaceResource(l)&&!l.spaceQuota)?!1:r.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Mv(){const{getDefaultAction:e}=qr();return{openWithDefaultApp:({space:r,resource:n})=>{if(!n||n.isFolder)return;const o={resources:[n],space:r},i=e({...o,omitSystemActions:!0});i&&i.handler(o)}}}const zO=()=>{const e=Je(),{openWithDefaultApp:t}=Mv(),{createDefaultMetaFolder:r}=Bi(),n=bt(),o=ut(),i=Bt(),{$gettext:s}=$e.useGettext(),{getDefaultMetaFolder:l}=si(),c=async(f,d)=>{const b=await e.webdav.putFileContents(f,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),E=await e.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"readme"},id:b.id}]},i.graphRoles);return o.updateSpaceField({id:f.id,field:"spaceReadmeData",value:E.spaceReadmeData}),b},u=async({resources:f})=>{let d=null,b=await l(f[0]);if(b||(b=await r(f[0]),d=await c(f[0],b)),!d){const E=ie.getRelativeSpecialFolderSpacePath(f[0],"readme");E?d=await e.webdav.getFileInfo(f[0],{path:E}):d=await c(f[0],b)}t({space:f[0],resource:d})};return{actions:V(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditReadme({user:n.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},jv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n}=$e.useGettext(),o=dr(),i=Je(),s=Jt(),{checkSpaceNameModalInput:l}=si(),{dispatchModal:c}=yt(),u=ut(),a=Bt(),f=(E,S)=>i.graphAuthenticated.drives.updateDrive(E.id,{name:S},a.graphRoles).then(()=>{m(s).name==="admin-settings-spaces"&&(E.name=S),u.updateSpaceField({id:E.id,field:"name",value:S}),e({title:n("Space name was changed successfully")})}).catch(w=>{console.error(w),t({title:n("Failed to rename space"),errors:[w]})}),d=({resources:E})=>{E.length===1&&c({title:n("Rename space")+" "+E[0].name,confirmText:n("Rename"),hasInput:!0,inputLabel:n("Space name"),inputValue:E[0].name,onConfirm:S=>f(E[0],S),onInput:l})};return{actions:V(()=>[{name:"rename",icon:"pencil",label:()=>n("Rename"),handler:d,isVisible:({resources:E})=>E.length!==1?!1:E[0].canRename({user:r.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:f}},Uv=()=>{const{showMessage:e,showErrorMessage:t}=it(),r=bt(),{$gettext:n,$ngettext:o}=$e.useGettext(),i=dr(),s=Je(),l=ar(),c=Jt(),{dispatchModal:u}=yt(),a=ut(),f=Bt(),d=T=>T.filter(w=>ie.isProjectSpaceResource(w)&&w.canRestore({user:r.user,ability:i})),b=async T=>{const w=s.graphAuthenticated,y=T.map(R=>w.drives.updateDrive(R.id,{name:R.name},f.graphRoles,{headers:{Restore:"true"}}).then(C=>(m(c).name==="admin-settings-spaces"&&(R.disabled=!1,R.spaceQuota=C.spaceQuota),a.updateSpaceField({id:R.id,field:"disabled",value:!1}),!0))),g=await l.addTask(()=>Promise.allSettled(y)),v=g.filter(R=>R.status==="fulfilled");if(v.length){const R=v.length===1&&T.length===1?n('Space "%{space}" was enabled successfully',{space:T[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:R})}const A=g.filter(R=>R.status==="rejected");if(A.length){A.forEach(console.error);const R=A.length===1&&T.length===1?n('Failed to enabled space "%{space}"',{space:T[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",A.length,{spaceCount:A.length.toString()},!0);t({title:R,errors:A.map(C=>C.reason)})}},E=({resources:T})=>{const w=d(T);if(!w.length)return;const y=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()}),g=n("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>b(w)})};return{actions:V(()=>[{name:"restore",icon:"play-circle",label:()=>n("Enable"),handler:E,isVisible:({resources:T})=>!!d(T).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:b}},WO=()=>{const{$gettext:e}=$e.useGettext(),t=Qe(),r=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Ye.publish(mt.openWithPanel,"space-share")};return{actions:V(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},HO=()=>{const e=We(),{$gettext:t}=$e.useGettext(),r=o=>_i("files-trash-generic",{...Jr(o,{fileId:o.fileId})});return{actions:V(()=>[{name:"navigateToTrash",icon:"delete-bin",label:()=>t("Show deleted files"),handler:({resources:o})=>{e.push(r(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!ie.isProjectSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},GO=je({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const r=oi(),{currentTheme:n}=Ge.storeToRefs(r),o=V(()=>m(n).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function KO(e,t,r,n,o,i){const s=de("oc-emoji-picker");return te(),Ce(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const qv=qe(GO,[["render",KO]]),QO=()=>{const e=bt(),{showMessage:t,showErrorMessage:r}=it(),{$gettext:n}=$e.useGettext(),o=Je(),i=ar(),s=ut(),{createDefaultMetaFolder:l}=Bi(),{dispatchModal:c}=yt(),{getDefaultMetaFolder:u}=si(),a=Bt(),f=({resources:S})=>{S.length===1&&c({elementClass:"oc-width-auto",title:n("Set icon for %{space}",{space:S[0].name}),hideConfirmButton:!0,customComponent:qv,focusTrapInitial:!1,onConfirm:T=>b(S[0],T)})},d=async S=>{const T=document.createElement("canvas"),w=T.getContext("2d"),y=16/9,g=720,v=g/y;T.width=g,T.height=v;const A=.4*g;w.font=`${A}px sans-serif`,w.textBaseline="middle",w.textAlign="center",w.fillText(S,T.width/2,T.height/2+15);const C=await Fb(T);return Cb(C)},b=async(S,T)=>{const w=o.graphAuthenticated,y=await d(T);let g=await u(S);return g||(g=await l(S)),i.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:A}=await o.webdav.putFileContents(S,{parentFolderId:g.id,fileName:"emoji.png",content:y,headers:v,overwrite:!0}),R=await w.drives.updateDrive(S.id,{name:S.name,special:[{specialFolder:{name:"image"},id:A}]},a.graphRoles);s.updateSpaceField({id:S.id,field:"spaceImageData",value:R.spaceImageData}),t({title:n("Space icon was set successfully")}),Ye.publish("app.files.spaces.uploaded-image",R)}catch(A){console.error(A),r({title:n("Failed to set space icon"),errors:[A]})}})};return{actions:V(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:f,label:()=>n("Set icon"),isVisible:({resources:S})=>S.length!==1?!1:S[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:b}},XO=()=>{const{$gettext:e}=$e.useGettext();return{actions:V(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Ye.publish(mt.open),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},YO=()=>{const{getMatchingSpace:e}=sr(),t=ut(),r=Zr(),n=Qe(),o=Je(),{$gettext:i}=$e.useGettext(),{openEditor:s}=qr(),{resources:l,currentFolder:c}=Ge.storeToRefs(n);return{openEmptyEditor:async(a,f)=>{var g;let d=m(c)?e(m(c)):null,b=m(l),E=(g=m(c))==null?void 0:g.path;(!d||!m(c).canCreate())&&(d=t.personalSpace,b=(await o.webdav.listFiles(d)).children,E="");let S=i("New file")+`.${f}`;b.some(v=>v.name===S)&&(S=jr(S,f,b));const T=await o.webdav.putFileContents(d,{path:ie.urlJoin(E,S)}),w=e(T),y=r.fileExtensions.find(({app:v,extension:A})=>v===a&&A===f);s(y,w,T)}}},Vv=()=>{const{$gettext:e}=$e.useGettext(),{showMessage:t}=it();return{openUrl:(n,o,i)=>{const s=window.open(n,o);s?i&&s.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},JO=()=>yn("$appProviderService"),ZO=()=>{const{isResourceAccessible:e}=sr();return{breadcrumbsFromPath:({route:n,space:o,resourcePath:i,ancestorMetaData:s=ce({})})=>{const l=(a="")=>a.split("/").filter(Boolean),c=l(n.path),u=l(i);return u.map((a,f)=>{const d=ie.urlJoin(...u.slice(0,f+1),{leadingSlash:!0}),b=e({space:m(o),path:d});let E;return b&&(E=m(s)[d]),{id:Qt.v4(),allowContextActions:!0,text:a,...b&&{to:{path:"/"+[...c].splice(0,c.length-u.length+f+1).join("/"),query:{...$i(n.query,"page","fileId"),...E&&{fileId:E.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...n)=>{const o=n.pop();return[...n,{id:Qt.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Ye.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},ek=(e="")=>{const t=ce(0),r=async()=>{await Hr();const n=document.querySelector(e||"#files-app-bar"),o=n?n.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=r,qt(r),{y:t,refresh:r}},jf=()=>{const e=ce(!0),t=()=>{e.value=window.innerHeight>500};return qt(()=>{t(),window.addEventListener("resize",t)}),Gr(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var Uf=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e))(Uf||{}),qf=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(qf||{});const tk=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const r=document.activeElement;if(!r)return!1;let n;try{n=r==null?void 0:r.closest("[data-custom-key-bindings-disabled='true']")}catch{n=r==null?void 0:r.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return n?!0:window.getSelection().type==="Range"},zv=e=>{const t=ce([]),r=ce(0),n=l=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&tk())return;const{key:c,ctrlKey:u,metaKey:a,shiftKey:f}=l;let d=null;const b=[];a||u?(d="Control",b.push("altKey","shiftKey")):f&&(d="Shift",b.push("altKey","ctrlKey","metaKey")),!((S,T)=>T.some(w=>S[w]))(l,b)&&m(t).filter(S=>S.primary===c&&S.modifier===d).forEach(S=>{l.preventDefault(),S.callback(l)})},o=(l,c)=>{const u=Qt.v4();return t.value.push({id:u,...l,modifier:l.modifier??null,callback:c}),u},i=l=>{t.value=t.value.filter(c=>c.id!==l)},s=()=>{r.value=0};return Mn.useEventListener(document,"keydown",n),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:r,resetSelectionCursor:s}};class Tn{}Ee(Tn,"perPageDefault","100"),Ee(Tn,"perPageQueryName","items-per-page"),Ee(Tn,"options",["20","50","100","250","500"]);function rk(e){const t=Lo.useRouter(),r=Lo.useRoute(),n=nk(e),o=ik(e),i=V(()=>Math.ceil(m(e.items).length/m(o))||1),s=V(()=>{if(!m(o))return m(e.items);const l=(m(n)-1)*m(o),c=l+m(o);return m(e.items).slice(l,c)});return Ye.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:c,topbarElement:u})=>{const a=Et.findIndex(m(e.items),f=>f.id===l);if(a>=0){const f=Math.ceil((a+1)/Number(m(o)));t.push({...m(r),query:{...m(r).query,page:f}}).then(()=>{Ye.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:c,topbarElement:u})})}}),{items:s,total:i,page:n,perPage:o}}function nk(e){if(e.page)return V(()=>m(e.page));const t=rr("page","1");return V(()=>parseInt(St(m(t))))}function ik(e){if(e.perPage)return V(()=>m(e.perPage));const t=wn({name:e.perPageQueryName||Tn.perPageQueryName,defaultValue:e.perPageDefault||Tn.perPageDefault,storagePrefix:e.perPageStoragePrefix});return V(()=>parseInt(St(m(t))))}const Wv=()=>yn("$passwordPolicyService");var pa=(e=>(e.mounted="portal-target.mounted",e))(pa||{});const ok=()=>{const e=Fo(),t=wa.useWormhole();return{registerPortal:n=>{e.subscribe(pa.mounted,()=>{t.open(n)})}}},Vf=()=>{const e=Zr();return{canBeOpenedWithSecureView:r=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===r.mimeType)}},Hv=()=>{const e=bt();return{canListVersions:({space:r,resource:n})=>n.type==="folder"||ie.isSpaceResource(n)||ie.isTrashResource(n)?!1:r==null?void 0:r.canListVersions({user:e.user})}},Gv=()=>{const e=Je(),t=ut(),r=Bt(),n=V(()=>t.spaces),o=c=>m(n).find(u=>c.toString().startsWith(u.id.toString())),i=c=>m(n).find(u=>{var a,f;return ie.isMountPointSpaceResource(u)&&((f=(a=u.root)==null?void 0:a.remoteItem)==null?void 0:f.id)===c}),s=c=>{const u=[Ve.FileId,Ve.FileParent,Ve.Name,Ve.ResourceType],a=ie.buildSpace({id:c,name:""},r.graphRoles);return e.webdav.getFileInfo(a,{fileId:c},{davProperties:u})};return{getResourceContext:async c=>{var S,T,w,y,g;let u,a,f=o(c);if(f)return u=await e.webdav.getPathForFileId(c),a=await e.webdav.getFileInfo(f,{path:u}),{space:f,resource:a,path:u};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(c);a=await s(c);const b=d?[]:[m(a).name];let E=m(a);for(;!d;)E=await s(E.parentFolderId),d=i(E.id),d||b.unshift(E.name);return f=t.getSpace((T=(S=d.root)==null?void 0:S.remoteItem)==null?void 0:T.id)||t.createShareSpace({driveAliasPrefix:(w=a.storageId)!=null&&w.startsWith(ie.OCM_PROVIDER_ID)?"ocm-share":"share",id:(g=(y=d.root)==null?void 0:y.remoteItem)==null?void 0:g.id,shareName:d.name}),u=ie.urlJoin(...b),{space:f,resource:a,path:u}}}},Gt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},Kv=()=>{const e=i=>{if(!i.endsWith("rem")&&!i.endsWith("px"))return 0;if(i.endsWith("rem")){const s=parseInt(i.replace("rem","").trim()),l=parseFloat(getComputedStyle(document.documentElement).fontSize);return s*l}return parseInt(i.replace("px","").trim())},t=ce(0),r=ce(0);qt(()=>{const i=getComputedStyle(document.documentElement);t.value=e(i.getPropertyValue("--oc-size-tiles-default")),r.value=e(i.getPropertyValue("--oc-size-tiles-resize-step"))});const n=i=>m(t)+(i-1)*m(r);return{calculateTileSizePixels:n,calculateTileSizeRem:i=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(i)/s}}};function sk(e){if(e)return V(()=>m(e));const t=wn({name:Gt.queryName,defaultValue:Gt.defaultModeName});return V(()=>St(m(t)))}function ak(e){if(e)return V(()=>parseInt(m(e)));const t=wn({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()});return V(()=>parseInt(St(m(t))))}const lk=ce(Gt.tilesSizeMax);function zf(){return lk}const Wf=e=>{const t=Of(),{updateResourceField:r}=Qe(),{httpAuthenticated:n}=Je(),o=ut(),{defaultSpaceImageBlobURL:i}=Ge.storeToRefs(o),s=ot(),{serverUrl:l}=Ge.storeToRefs(s),c=new Bn({concurrency:4}),u=V(()=>m(e)===Gt.name.tiles),a=V(()=>m(u)?zs.enum.fit:zs.enum.thumbnail),f=V(()=>m(u)?Vr.Tile:Vr.Thumbnail),d=lr.useTask(function*(T,{space:w,resource:y,dimensions:g,processor:v,updateStore:A=!0}){const R=ie.isProjectSpaceResource(y)?ie.buildSpaceImageResource(y):y,C=yield c.add(()=>t.loadPreview({space:w,resource:R,processor:v||m(a),dimensions:g||m(f)},!0,!0,T));return C&&A&&r({id:y.id,field:"thumbnail",value:C}),C}),b=async T=>{const{resource:w,cancelRunning:y}=T;if(y&&S(),ie.isProjectSpaceResource(w)&&(!w.spaceImageData||w.disabled)){if(m(i))return w.thumbnail=m(i),m(i);try{const g=await n.get(`${m(l)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(g.data)),w.thumbnail=m(i),m(i)}catch{return null}}try{return await d.perform(T)}catch(g){g!=="cancel"&&console.error(g)}},E=V(()=>d.isRunning),S=()=>{d.cancelAll(),c.clear()};return Wa(S),{loadPreview:b,previewsLoading:E}},Qv=({showSizeInformation:e=!0}={})=>{const t=Qe(),{current:r,$gettext:n,$ngettext:o}=$e.useGettext(),i=We(),{resources:s,totalResourcesCount:l,areHiddenFilesShown:c,currentFolder:u}=Ge.storeToRefs(t),a=V(()=>{var d,b;if(!((d=m(u))!=null&&d.size)||((b=m(u))==null?void 0:b.size)==="0"){const E=m(s).map(S=>S.size?parseInt(S.size.toString()):0).reduce((S,T)=>S+T,0);return wr(E,r)}return wr(m(u).size,r)});return{resourceContentsText:V(()=>{let d=o("%{ filesCount } file","%{ filesCount } files",m(l).files,{filesCount:m(l).files.toString()});!m(c)&&m(l).hiddenFiles&&(d=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",m(l).files,{filesCount:m(l).files.toString(),filesHiddenCount:m(l).hiddenFiles.toString()}));let b=o("%{ foldersCount } folder","%{ foldersCount } folders",m(l).folders,{foldersCount:m(l).folders.toString()});!m(c)&&m(l).hiddenFolders&&(b=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",m(l).folders,{foldersCount:m(l).folders.toString(),foldersHiddenCount:m(l).hiddenFolders.toString()}));const E=o("%{ spacesCount } space","%{ spacesCount } spaces",m(l).spaces,{spacesCount:m(l).spaces.toString()}),S=m(l).files+m(l).folders+m(l).spaces,T=e&&parseFloat(m(a))>0,w=Nt(i,"files-shares-via-link"),y=n(T?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),g=n(T?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),v=w?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",A=`${y} ${v}`,R=`${g} ${v}`;return o(A,R,S,{itemsCount:S.toString(),itemSize:m(a),filesStr:d,foldersStr:b,spacesStr:E})})}},Hf=()=>{const{getMatchingSpace:e}=sr(),t=Qe(),r=V({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:l})=>l))}}),n=V({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>m(n).includes(s.id),i=V(()=>{if(m(r).length!==1)return null;const s=m(r)[0];return e(s)});return{selectedResources:r,selectedResourcesIds:n,isResourceInSelection:o,selectedResourceSpace:i}};function ck(e){const t=tr(),r=Yn(),n=Je(),o=$e.useGettext(),i=V(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return r.publicLinkPassword?u.Authorization="Basic "+po.from(["public",r.publicLinkPassword].join(":")).toString("base64"):r.accessToken&&!r.publicLinkPassword&&(u.Authorization="Bearer "+r.accessToken),u["X-Request-ID"]=Qt.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=n.initiatorId,u},l=V(()=>{const u={onBeforeRequest:(a,f)=>new Promise(d=>{var E;const b=s();a.setHeader("Authorization",b.Authorization),a.setHeader("X-Request-ID",b["X-Request-ID"]),a.setHeader("Accept-Language",b["Accept-Language"]),a.setHeader("Initiator-ID",b["Initiator-ID"]),f!=null&&f.isRemote&&a.setHeader("x-oc-mtime",(((E=f==null?void 0:f.data)==null?void 0:E.lastModified)/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=a=>{var f;if(a.xhrUpload||a!=null&&a.isRemote)return{"x-oc-mtime":(((f=a==null?void 0:a.data)==null?void 0:f.lastModified)/1e3).toFixed(0),...s()}},u}),c=V(()=>({timeout:6e4,endpoint:"",headers:u=>{var a;return{"x-oc-mtime":(((a=u==null?void 0:u.data)==null?void 0:a.lastModified)/1e3).toFixed(0),...s()}}}));Tt([l,c],()=>{if(m(i)){e.uppyService.useTus(m(l));return}e.uppyService.useXhr(m(c))},{immediate:!0})}const uk=je({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const{$gettext:t}=$e.useGettext(),r=ot(),{options:n}=Ge.storeToRefs(r),o=V(()=>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=V(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...m(o)==="router-link"&&{to:e.action.route(e.actionOptions)},...m(o)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(m(o))&&{target:n.value.cernFeatures?"_blank":"_self"}})),s=V(()=>window.navigator.platform.match("Mac")),l=V(()=>t("Hold %{key} and click to open in new tab",{key:m(s)?"⌘":t("ctrl")},!0));return{componentType:o,componentProps:i,openInNewTabHint:l}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),fk={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},dk=["textContent"],pk=["textContent"],hk=["textContent"];function gk(e,t,r,n,o,i){var a,f,d,b;const s=de("oc-image"),l=de("oc-icon"),c=de("oc-button"),u=ur("oc-tooltip");return at((te(),ve("li",null,[at((te(),Ce(c,Yt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","oc-py-s","oc-px-m","oc-width-1-1",...e.buttonClasses],"aria-label":e.componentProps.disabled?(f=(a=e.action).disabledTooltip)==null?void 0:f.call(a,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},Ga(e.componentListeners)),{default:Te(()=>[e.action.img?(te(),Ce(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(te(),Ce(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(te(),Ce(l,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):ke("",!0),e.action.hideLabel?ke("",!0):(te(),ve("span",fk,[pe("span",{textContent:K.toDisplayString(e.action.label(e.actionOptions))},null,8,dk),e.action.showOpenInNewTabHint?(te(),ve("span",{key:0,class:"oc-text-muted oc-text-xsmall",textContent:K.toDisplayString(e.openInNewTabHint)},null,8,pk)):ke("",!0)])),e.action.shortcut&&e.shortcutHint?(te(),ve("span",{key:4,class:"oc-files-context-action-shortcut",textContent:K.toDisplayString(e.action.shortcut)},null,8,hk)):ke("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(b=(d=e.action).disabledTooltip)==null?void 0:b.call(d,e.actionOptions):""]])}const Gf=qe(uk,[["render",gk]]),mk=je({name:"BatchActions",components:{ActionMenuItem:Gf},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function yk(e,t,r,n,o,i){const s=de("action-menu-item"),l=de("oc-list");return te(),ve("div",null,[be(l,{id:"oc-appbar-batch-actions",class:K.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.actions,(c,u)=>(te(),Ce(s,{key:`action-${u}`,action:c,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions oc-mr-s","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const Xv=qe(mk,[["render",yk]]),bk=je({name:"ContextActionMenu",components:{ActionMenuItem:Gf},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("oc-pb-s"),e>0&&t.push("oc-pt-s"),e<this.menuSections.length-1&&t.push("oc-files-context-actions-border")),t}}}),vk={id:"oc-files-context-menu"};function wk(e,t,r,n,o,i){const s=de("action-menu-item"),l=de("oc-list");return te(),ve("div",vk,[(te(!0),ve(Xe,null,kt(e.menuSections,(c,u)=>(te(),Ce(l,{id:`oc-files-context-actions-${c.name}`,key:`section-${c.name}-list`,class:K.normalizeClass(["oc-files-context-actions",e.getSectionClasses(u)])},{default:Te(()=>[(te(!0),ve(Xe,null,kt(c.items,(a,f)=>(te(),Ce(s,{key:`section-${c.name}-action-${f}`,action:a,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128))]),_:2},1032,["id","class"]))),128))])}const Kf=qe(bk,[["render",wk]]),Sk=je({name:"ContextActions",components:{ContextActionMenu:Kf},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t}=qr(),{actions:r}=ta(),{actions:n}=ra(),{actions:o}=na(),{actions:i}=Cf(),{actions:s}=ia(),{actions:l}=oa(),{actions:c}=sa(),{actions:u}=Po(),{actions:a}=Pf(),{actions:f}=Ff(),{actions:d}=aa(),{actions:b}=xf(),{actions:E}=yv(),{actions:S}=la(),{actions:T}=ca(),{actions:w}=bv(),{actions:y}=kf(),{actions:g}=$f(),{actions:v}=Nf(),A=Di(),R=V(()=>A.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),C=V(()=>A.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(J=>J.action)),P=Aw(e,"actionOptions"),_=V(()=>[...m(r),...m(s),...m(c),...m(d),...m(o),...m(f),...m(l),...m(T),...m(g),...m(C).filter(J=>J.category==="actions"||Et.isNil(J.category))].filter(J=>J.isVisible(m(P)))),L=V(()=>[...m(y),...m(C).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(m(P)))),B=V(()=>[...m(t),...m(R).filter(J=>J.category==="context")].filter(J=>J.isVisible(m(P))).sort((J,le)=>Number(le.hasPriority)-Number(J.hasPriority))),$=V(()=>[...m(v),...m(i),...m(R).filter(J=>J.category==="share")].filter(J=>J.isVisible(m(P)))),D=V(()=>[...m(c),...m(u),...m(l),...m(d),...m(o),...m(E),...m(S),...m(g),...m(T),...m(r),...m(s),...m(n),...m(w),...m(R).filter(J=>J.category==="actions"||Et.isNil(J.category))].filter(J=>J.isVisible(m(P)))),H=V(()=>[...m(a).map(J=>(J.keepOpen=!0,J)),...m(b),...m(y),...m(R).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(m(P))));return{menuSections:V(()=>{const J=[];return m(P).resources.length>1?(m(_).length&&J.push({name:"batch-actions",items:[...m(_)]}),J.push({name:"batch-details",items:[...m(L)]}),J):(m(B).length&&J.push({name:"context",items:m(B)}),m($).length&&J.push({name:"share",items:m($)}),m(D).length&&J.push({name:"actions",items:m(D)}),m(H).length&&J.push({name:"sidebar",items:m(H)}),J)})}}});function Ek(e,t,r,n,o,i){const s=de("context-action-menu");return te(),Ce(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const Yv=qe(Sk,[["render",Ek]]),Tk=je({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Tn.options},perPageQueryName:{type:String,default:()=>Tn.perPageQueryName},perPageDefault:{type:String,default:()=>Tn.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Gt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=We(),r=Jt(),{$gettext:n}=$e.useGettext(),o=Qe(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:l}=o,{areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:a}=Ge.storeToRefs(o),f=ce(!1),d=rr("page"),b=V(()=>m(d)?parseInt(St(m(d))):1),E=wn({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),S=Xs(),T=wn({name:`${m(S)}-${Gt.queryName}`,defaultValue:e.viewModeDefault}),w=wn({name:Gt.tilesSizeQueryName,defaultValue:Gt.tilesSizeDefault.toString()}),y=A=>t.replace({query:{...m(r).query,[e.perPageQueryName]:A,...m(b)>1&&{page:"1"}}}),g=A=>{T.value=A.name};Tt([E,T,w],A=>{f.value=A.some(R=>!R)},{immediate:!0,deep:!0});const v=zf();return{FolderViewModeConstants:Gt,viewModeCurrent:T,viewSizeCurrent:w,viewSizeMax:v,itemsPerPageCurrent:E,queryParamsLoading:f,queryItemAsString:St,setItemsPerPage:y,setViewMode:g,areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:a,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:l,viewOptionsButtonLabel:n("Display customization options of the files list"),isProjectsLocation:Sn(lt,"files-spaces-projects")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}},disabledSpacesShownModel:{get(){return this.areDisabledSpacesShown},set(e){this.setAreDisabledSpacesShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e},updateDisabledSpacesShownModel(e){this.disabledSpacesShownModel=e}}}),Ak={class:"oc-flex oc-flex-middle"},Rk={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},_k={key:0,class:"files-view-options-list-item"},Ik={key:1,class:"files-view-options-list-item"},Ck={key:2,class:"files-view-options-list-item"},Fk={key:3,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},Pk=["textContent"],xk=["max"],Ok={key:4,class:"files-view-options-list-item"};function kk(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-button"),c=de("oc-switch"),u=de("oc-page-size"),a=de("oc-list"),f=de("oc-drop"),d=ur("oc-tooltip");return te(),ve("div",Ak,[e.viewModes.length>1?(te(),ve("div",Rk,[(te(!0),ve(Xe,null,kt(e.viewModes,b=>at((te(),Ce(l,{key:b.name,"no-hover":e.viewModeCurrent===b.name,class:K.normalizeClass([b.name]),appearance:e.viewModeCurrent===b.name?"filled":"outline","color-role":e.viewModeCurrent===b.name?"secondaryContainer":"secondary","aria-label":e.$gettext(b.label),onClick:E=>e.setViewMode(b)},{default:Te(()=>[be(s,{name:b.icon.name,"fill-type":b.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[d,e.$gettext(b.label)]])),128))])):ke("",!0),at((te(),Ce(l,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"oc-my-s oc-p-xs"},{default:Te(()=>[be(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[d,e.viewOptionsButtonLabel]]),be(f,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Te(()=>[be(a,null,{default:Te(()=>[e.hasHiddenFiles?(te(),ve("li",_k,[be(c,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=b=>e.hiddenFilesShownModel=b),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):ke("",!0),e.hasFileExtensions?(te(),ve("li",Ik,[be(c,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=b=>e.fileExtensionsShownModel=b),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):ke("",!0),e.hasPagination?(te(),ve("li",Ck,[e.queryParamsLoading?ke("",!0):(te(),Ce(u,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):ke("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(te(),ve("li",Fk,[pe("label",{for:"tiles-size-slider",textContent:K.toDisplayString(e.$gettext("Tile size"))},null,8,Pk),at(pe("input",{id:"tiles-size-slider","onUpdate:modelValue":t[2]||(t[2]=b=>e.viewSizeCurrent=b),type:"range",min:1,max:e.viewSizeMax,class:"oc-range","data-testid":"files-tiles-size-slider"},null,8,xk),[[kS,e.viewSizeCurrent]])])):ke("",!0),e.isProjectsLocation?(te(),ve("li",Ok,[be(c,{checked:e.disabledSpacesShownModel,"onUpdate:checked":[t[3]||(t[3]=b=>e.disabledSpacesShownModel=b),e.updateDisabledSpacesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show disabled Spaces")},null,8,["checked","label","onUpdate:checked"])])):ke("",!0)]),_:1})]),_:1})])}const Jv=qe(Tk,[["render",kk],["__scopeId","data-v-f2ddb48a"]]),Nk=je({components:{BatchActions:Xv,ContextActions:Yv,ViewOptions:Jv},props:{viewModeDefault:{type:String,required:!1,default:()=>Gt.name.table},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},isSideBarOpen:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const r=ut(),{$gettext:n}=$e.useGettext(),{can:o}=dr(),i=We(),{requestExtensions:s}=Di(),{isSticky:l}=jf(),c=Qe(),{selectedResources:u}=Ge.storeToRefs(c),a=V(()=>e.space),{actions:f}=ta(),{actions:d}=ra(),{actions:b}=na(),{actions:E}=$v(),{actions:S}=ia(),{actions:T}=oa(),{actions:w}=sa(),{actions:y}=Po(),{actions:g}=Ff(),{actions:v}=aa(),{actions:A}=ca(),{actions:R}=kv(),{actions:C}=Nv(),{actions:P}=Bv(),{actions:_}=Uv(),L=ce(0),B=Sn(At,"files-common-search"),$=V(()=>Object.hasOwn(sS(),"navigation")&&o("create-all","Share")),D=V(()=>{let oe=[...m(d),...m(f),...m(S),...m(w),...m(y),...m(v),...m(b),...m(g),...m(T),...m(A)];B.value||(oe=[...oe,...m(E),...m(P),...m(_),...m(R),...m(C)]);const ae=s({id:"global.files.batch-actions",extensionType:"action"});return ae.length&&(oe=[...oe,...ae.map(Ae=>Ae.action)]),oe.filter(Ae=>Ae.isVisible({space:m(a),resources:c.selectedResources}))}),H=V(()=>r.spaces.filter(oe=>ie.isPersonalSpaceResource(oe)||ie.isProjectSpaceResource(oe))),X=Cn("isMobileWidth"),J=Sn(Rr,"files-trash-generic"),le=V(()=>!m(X)&&e.breadcrumbs.length?!0:m(J)&&m(H).length===1?!1:e.breadcrumbs.length>1),me=V(()=>m(J)&&m(H).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),fe=V(()=>m(a)&&(ie.isProjectSpaceResource(m(a))||ie.isShareSpaceResource(m(a)))?3:2),we=oe=>{t(Ob,oe)},Se=tv("title"),re=V(()=>{var oe;return m(Se)?n(m(Se)):((oe=m(a))==null?void 0:oe.name)||""});return{router:i,hasSharesNavigation:$,batchActions:D,showBreadcrumb:le,showMobileNav:me,breadcrumbMaxWidth:L,breadcrumbTruncationOffset:fe,fileDroppedBreadcrumb:we,pageTitle:re,selectedResources:u,isSticky:l}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return ld(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||Rr(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){var o,i,s,l;const e=((o=document.getElementById("web-content-main"))==null?void 0:o.getBoundingClientRect().width)||0,t=((i=document.getElementById("web-nav-sidebar"))==null?void 0:i.getBoundingClientRect().width)||0,r=((s=document.getElementById("app-sidebar"))==null?void 0:s.getBoundingClientRect().width)||0,n=(l=document.getElementById("files-app-bar-controls-right"))==null?void 0:l.clientWidth;this.breadcrumbMaxWidth=e-t-r-n,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),$k={class:"files-topbar oc-py-s"},Dk=["textContent"],Lk={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},Bk={class:"files-app-bar-actions oc-mt-xs"},Mk={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"};function jk(e,t,r,n,o,i){const s=de("oc-hidden-announcer"),l=de("context-actions"),c=de("oc-breadcrumb"),u=de("portal-target"),a=de("view-options"),f=de("batch-actions");return te(),ve("div",{id:"files-app-bar",ref:"filesAppBar",class:K.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[pe("div",$k,[pe("h1",{class:"oc-invisible-sr",textContent:K.toDisplayString(e.pageTitle)},null,8,Dk),be(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),pe("div",{class:K.normalizeClass(["oc-flex oc-flex-middle files-app-bar-controls",{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(te(),Ce(c,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Te(()=>[be(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","onItemDroppedBreadcrumb"])):ke("",!0),e.showMobileNav?(te(),Ce(u,{key:1,name:"app.runtime.mobile.nav"})):ke("",!0),e.hasSharesNavigation?Ke(e.$slots,"navigation",{key:2},void 0,!0):ke("",!0),e.hasViewOptions?(te(),ve("div",Lk,[be(a,{"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"])])):ke("",!0)],2),pe("div",Bk,[pe("div",Mk,[Ke(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions?(te(),Ce(f,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):ke("",!0)])]),Ke(e.$slots,"content",{},void 0,!0)])],2)}const Uk=qe(Nk,[["render",jk],["__scopeId","data-v-5cea4090"]]),qk=je({props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:r,showErrorMessage:n}=it(),{$gettext:o}=$e.useGettext(),{createSpace:i}=Bi(),{checkSpaceNameModalInput:s}=si(),{dispatchModal:l}=yt(),c=ut(),{upsertResource:u}=Qe(),a=async d=>{try{const b=await i(d);u(b),c.upsertSpace(b),t("spaceCreated",b),r({title:o("Space was created successfully")})}catch(b){console.error(b),n({title:o("Creating space failed…"),errors:[b]})}};return{showCreateSpaceModal:()=>{l({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),onConfirm:d=>a(d),onInput:s})}}}}),Vk=["textContent"];function zk(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-button"),c=ur("oc-tooltip");return at((te(),Ce(l,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Te(()=>[be(s,{name:"add"}),e.showLabel?(te(),ve("span",{key:0,textContent:K.toDisplayString(e.$gettext("New Space"))},null,8,Vk)):ke("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const Wk=qe(qk,[["render",zk]]),Hk=je({name:"AppTopBar",components:{ContextActionMenu:Kf,ResourceListItem:Oo},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:r}=$e.useGettext(),n=Qe(),o=ot(),{getMatchingSpace:i}=sr(),s=V(()=>n.areFileExtensionsShown),l=V(()=>t("Show context menu")),c=V(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=V(()=>{const d=Dt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:r});return t("Autosave (every %{ duration })",{duration:d.toHuman()})}),a=V(()=>i(e.resource)),f=V(()=>!ie.isPublicSpaceResource(m(a)));return{contextMenuLabel:l,areFileExtensionsShown:s,hasAutosave:c,autoSaveTooltipText:u,isPathDisplayed:f,...ai()}}}),Gk={class:"oc-app-top-bar oc-flex"},Kk={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},Qk={class:"open-file-bar oc-flex"},Xk={class:"oc-flex main-actions"},Yk={key:1,class:"oc-flex oc-flex-middle"};function Jk(e,t,r,n,o,i){const s=de("resource-list-item"),l=de("oc-icon"),c=de("oc-button"),u=de("context-action-menu"),a=de("oc-drop"),f=de("portal"),d=ur("oc-tooltip");return te(),Ce(f,{to:"app.runtime.header.left"},{default:Te(()=>[pe("div",Gk,[pe("span",Kk,[pe("div",Qk,[e.resource?(te(),Ce(s,{key:0,id:"app-top-bar-resource","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):ke("",!0)]),pe("div",Xk,[e.dropDownMenuSections.length?(te(),ve(Xe,{key:0},[at((te(),Ce(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Te(()=>[be(l,{name:"more-2"})]),_:1},8,["aria-label"])),[[d,e.contextMenuLabel]]),be(a,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=Tr(()=>{},["stop","prevent"]))},{default:Te(()=>[be(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):ke("",!0),e.hasAutosave?(te(),ve("span",Yk,[at(be(l,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[d,e.autoSaveTooltipText]])])):ke("",!0),e.mainActions.length&&e.resource?(te(),Ce(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(b=>b.isVisible()).map(b=>({...b,class:"oc-p-xs app-topbar-action",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):ke("",!0),be(c,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs","aria-label":e.$gettext("Close"),onClick:t[1]||(t[1]=b=>e.$emit("close"))},{default:Te(()=>[be(l,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const Zv=qe(Hk,[["render",Jk]]),Zk=je({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),eN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},tN={key:0,class:"oc-text-xlarge"};function rN(e,t,r,n,o,i){const s=de("oc-icon");return te(),ve("div",eN,[be(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(te(),ve("p",tN,K.toDisplayString(e.message),1)):ke("",!0)])}const nN=qe(Zk,[["render",rN]]),iN=je({name:"LoadingScreen"}),oN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},sN={class:"oc-invisible"};function aN(e,t,r,n,o,i){const s=de("oc-spinner"),l=ur("translate");return te(),ve("div",oN,[be(s,{size:"xlarge"}),at((te(),ve("p",sN,t[0]||(t[0]=[Vt("Loading app")]))),[[l]])])}const lN=qe(iN,[["render",aN]]),cN=["id","data-testid","tabindex","inert"],uN={key:0,class:"sidebar-panel__header header"},fN={class:"header__title oc-my-rm"},dN={key:0,class:"sidebar-panel__navigation oc-mt-m"},e0=je({__name:"SideBar",props:{isOpen:{type:Boolean},loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close"],setup(e,{emit:t}){const r=t,{$gettext:n}=$e.useGettext(),o=Yw("appSideBar"),i=V(()=>e.availablePanels.filter(_=>{var L;return _.isVisible(e.panelContext)&&((L=_.isRoot)==null?void 0:L.call(_,e.panelContext))})),s=V(()=>e.availablePanels.filter(_=>{var L;return _.isVisible(e.panelContext)&&!((L=_.isRoot)!=null&&L.call(_,e.panelContext))})),l=V(()=>m(i).length?[m(i)[0],...m(s)]:m(s)),c=V(()=>{var L;const _=(L=e.activePanel)==null?void 0:L.split("#")[0];return!_||!m(s).map(B=>B.name).includes(_)?null:_}),u=V(()=>m(c)!==null),a=V(()=>m(c)===null),f=ce(null),d=_=>{f.value=_},b=V(()=>m(u)?m(c):m(i)[0].name),E=V(()=>m(i).length===1?n("Back to %{panel} panel",{panel:m(i)[0].title(e.panelContext)}):n("Back to main panels")),S=ce(window.innerWidth),T=V(()=>m(S)<=580),w=V(()=>{var _,L;return(L=(_=m(o))==null?void 0:_.parentElement)==null?void 0:L.querySelector("div")}),y=()=>{if(!m(w))return;const _=m(T)?"hidden":"visible";m(w).style.visibility=_},g=()=>{e.isOpen&&(S.value=window.innerWidth,y())};Tt(()=>e.isOpen,async _=>{_&&(await Hr(),y())},{immediate:!0});const v=_=>{r("selectPanel",_)},A=()=>{r("selectPanel",null)},R=()=>{r("close")},C=_=>{d(m(b)),v(_)},P=()=>{d(m(b)),A(),m(o).focus()};return qt(()=>{window.addEventListener("resize",g)}),Gr(()=>{window.removeEventListener("resize",g),m(w)&&(m(w).style.visibility="visible")}),(_,L)=>{const B=de("oc-spinner"),$=de("oc-icon"),D=de("oc-button"),H=ur("oc-tooltip");return te(),ve("div",{id:"app-sidebar",ref_key:"appSideBar",ref:o,"data-testid":"app-sidebar",tabindex:"-1",class:K.normalizeClass({"has-active-sub-panel":u.value,"oc-flex oc-flex-center oc-flex-middle":_.loading,"app-sidebar-full-width":T.value})},[_.loading?(te(),Ce(B,{key:0})):(te(!0),ve(Xe,{key:1},kt(l.value,X=>{var J,le,me,fe,we,Se;return te(),ve("div",{id:`sidebar-panel-${X.name}`,key:`panel-${X.name}`,"data-testid":`sidebar-panel-${X.name}`,tabindex:b.value===X.name?-1:null,class:K.normalizeClass(["sidebar-panel",{"is-root-panel":(J=X.isRoot)==null?void 0:J.call(X,_.panelContext),"is-active-sub-panel":u.value&&c.value===X.name,"is-active-root-panel":a.value&&((le=X.isRoot)==null?void 0:le.call(X,_.panelContext))}]),inert:b.value!==X.name},[[b.value,f.value].includes(X.name)?(te(),ve("div",uN,[(me=X.isRoot)!=null&&me.call(X,_.panelContext)?ke("",!0):at((te(),Ce(D,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":E.value,onClick:P},{default:Te(()=>[be($,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[H,E.value]]),pe("h2",fN,K.toDisplayString(X.title(_.panelContext)),1),be(D,{appearance:"raw",class:"header__close oc-p-xs","aria-label":m(n)("Close file sidebar"),onClick:R},{default:Te(()=>[be($,{name:"close"})]),_:1},8,["aria-label"])])):ke("",!0),pe("div",null,[(fe=X.isRoot)!=null&&fe.call(X,_.panelContext)?Ke(_.$slots,"rootHeader",{key:0}):Ke(_.$slots,"subHeader",{key:1})]),pe("div",{class:K.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${X.name}`]])},[pe("div",{class:K.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((we=X.isRoot)!=null&&we.call(X,_.panelContext))}])},[Ke(_.$slots,"body",{},()=>{var re;return[(te(!0),ve(Xe,null,kt((re=X.isRoot)!=null&&re.call(X,_.panelContext)?i.value:[X],(oe,ae)=>{var Ae;return te(),Ce(Hn(oe.component),Yt({key:`sidebar-panel-${oe.name}`,class:{"multi-root-panel-separator oc-mt oc-pt-s":ae>0},ref_for:!0},((Ae=oe.componentAttrs)==null?void 0:Ae.call(oe,_.panelContext))||{}),null,16,["class"])}),128))]})],2),(Se=X.isRoot)!=null&&Se.call(X,_.panelContext)&&s.value.length>0?(te(),ve("div",dN,[(te(!0),ve(Xe,null,kt(s.value,re=>(te(),Ce(D,{id:`sidebar-panel-${re.name}-select`,key:`panel-select-${re.name}`,"data-testid":`sidebar-panel-${re.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:oe=>C(re.name)},{default:Te(()=>[be($,{name:re.icon,"fill-type":re.iconFillType},null,8,["name","fill-type"]),Vt(" "+K.toDisplayString(re.title(_.panelContext))+" ",1),be($,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):ke("",!0)],2)],10,cN)}),128))],2)}}}),pN=je({name:"SpaceInfo",setup(){return{resource:Cn("resource")}}}),hN={class:"space_info oc-p-s"},gN={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},mN={class:"oc-mr-s"},yN=["textContent"],bN=["textContent"];function vN(e,t,r,n,o,i){const s=de("oc-icon");return te(),ve("div",hN,[pe("div",gN,[pe("div",mN,[be(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),pe("div",null,[pe("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:K.toDisplayString(e.resource.name)},null,8,yN),pe("span",{"data-testid":"space-info-subtitle",textContent:K.toDisplayString(e.resource.description)},null,8,bN)])])])}const t0=qe(pN,[["render",vN]]),wN=je({name:"FileInfo",components:{ResourceIcon:xo,ResourceName:Bf},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Qe(),t=Cn("resource"),r=V(()=>e.areFileExtensionsShown);return{resource:t,areFileExtensionsShown:r}}}),SN={class:"file_info oc-flex oc-flex-between oc-p-s"},EN={class:"oc-flex oc-flex-middle"},TN={class:"file_info__body oc-text-overflow"},AN={"data-testid":"files-info-name",class:"oc-font-semibold"};function RN(e,t,r,n,o,i){const s=de("resource-icon"),l=de("resource-name");return te(),ve("div",SN,[pe("div",EN,[e.isSubPanelActive?(te(),Ce(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):ke("",!0),pe("div",TN,[pe("h3",AN,[be(l,{name:e.resource.name,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])])}const r0=qe(wN,[["render",RN]]),_N=je({name:"FileSideBar",components:{FileInfo:r0,SpaceInfo:t0,InnerSideBar:e0},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=We(),r=Je(),n=Di(),o=Fo(),i=ut(),s=Bt(),l=ot(),c=Zr(),{canListShares:u}=vv(),{canListVersions:a}=Hv(),f=Qe(),{currentFolder:d}=Ge.storeToRefs(f),b=ce(),E=ce([]),S=ce([]),T=ce([]),{selectedResources:w}=Hf(),y=ce(!1),g=V(()=>m(y)||me.isRunning),v=V(()=>{var we;return m(w).length===0?{root:e.space,parent:null,items:(we=m(d))!=null&&we.id?[m(d)]:[]}:{root:e.space,parent:m(d),items:m(w)}}),A=Sn(Nt,"files-shares-with-me"),R=Sn(Nt,"files-shares-with-others"),C=Sn(Nt,"files-shares-via-link"),P=lt(t,"files-spaces-projects"),_=Sn(At,"files-common-favorites"),L=Sn(At,"files-common-search"),B=()=>{o.publish(mt.close)},$=we=>{o.publish(mt.setActivePanel,we)},D=V(()=>{var we;return((we=m(v).items)==null?void 0:we.length)===1&&!ie.isProjectSpaceResource(m(v).items[0])}),H=V(()=>{var we;return((we=m(v).items)==null?void 0:we.length)===1&&ie.isProjectSpaceResource(m(v).items[0])}),X=V(()=>m(A)||m(R)||m(C)),J=V(()=>m(X)||m(L)||m(_)),le=V(()=>n.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(we=>we.panel)),me=lr.useTask(function*(we,Se){E.value=yield r.webdav.listFileVersions(Se.id,{signal:we})}),fe=lr.useTask(function*(we,Se){var xe;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:re,linkShares:oe}=s,ae=r.graphAuthenticated.permissions;let Ae=(xe=e.space)==null?void 0:xe.id;if(ie.isShareSpaceResource(e==null?void 0:e.space)){const Fe=yield i.getMountPointForSpace({graphClient:r.graphAuthenticated,space:e.space,signal:we});Fe&&(Ae=Fe.root.remoteItem.rootId)}const{shares:Z,allowedRoles:F}=yield*ie.call(ae.listPermissions(Ae,Se.fileId,s.graphRoles,{},{signal:we})),O=Z.filter(ie.isCollaboratorShare),Q=Z.filter(ie.isLinkShare),W=Object.values(s.graphRoles);if(S.value=(F==null?void 0:F.map(Fe=>{var Me;return{...Fe,icon:(Me=W.find(ee=>ee.id===Fe.id))==null?void 0:Me.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Fe}=yield*ie.call(ae.listPermissions(Ae,Se.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[vO.LibreGraphPermissionsRolesAllowedValues]},{signal:we}));T.value=(Fe==null?void 0:Fe.map(Me=>{var ee;return{...Me,icon:(ee=W.find(Pe=>Pe.id===Me.id))==null?void 0:ee.icon}}))||[]}!m(J)&&!m(P)&&(re.forEach(Fe=>{O.some(Me=>Me.id===Fe.id)||O.push({...Fe,indirect:!0})}),oe.forEach(Fe=>{Q.some(Me=>Me.id===Fe.id)||Q.push({...Fe,indirect:!0})})),At(t,"files-common-search")&&(yield f.loadAncestorMetaData({folder:m(Se),space:m(e.space),client:r.webdav,signal:we}));const z=[...re,...oe].map(({resourceId:Fe})=>Fe),ue=Object.values(f.ancestorMetaData).filter(({id:Fe,path:Me})=>Fe===Se.id||z.includes(Fe)||ie.isIncomingShareResource(Se)?!1:ie.isPersonalSpaceResource(e.space)?Me!=="/":!0).map(({id:Fe})=>Fe);m(J)&&ie.isProjectSpaceResource(e.space)&&!ie.isProjectSpaceResource(Se)&&ue.push(e.space.id);const _e=new Bn({concurrency:l.options.concurrentRequests.shares.list}),Be=[...new Set(ue)].map(Fe=>_e.add(()=>r.graphAuthenticated.permissions.listPermissions(Ae,Fe,s.graphRoles,{},{signal:we}).then(Me=>{const ee=Me.shares.map(Pe=>({...Pe,indirect:!0}));O.push(...ee.filter(ie.isCollaboratorShare)),Q.push(...ee.filter(ie.isLinkShare))})));yield Promise.allSettled(Be),s.setCollaboratorShares(O),s.setLinkShares(Q),s.setLoading(!1)}).restartable();return Tt(()=>[...m(v).items,e.isOpen],async()=>{var Se;if(((Se=m(v).items)==null?void 0:Se.length)!==1)return;if(!e.isOpen){E.value=[];return}const we=m(v).items[0];if(me.isRunning&&me.cancelAll(),!!a({space:e.space,resource:we}))try{await me.perform(we)}catch(re){console.error(re)}},{immediate:!0,deep:!0}),Tt(()=>[...m(v).items,e.isOpen],async()=>{var Se;if(!e.isOpen){s.pruneShares(),b.value=null;return}if(((Se=m(v).items)==null?void 0:Se.length)!==1)return;const we=m(v).items[0];if(y.value=!0,u({space:e.space,resource:we}))try{fe.isRunning&&fe.cancelAll(),fe.perform(we)}catch(re){console.error(re)}if(!m(X)){b.value=we,y.value=!1;return}try{const re=await r.webdav.getFileInfo(e.space,{path:we.path}),oe={...re,...we,tags:re.tags};b.value=oe}catch(re){b.value=we,console.error(re)}y.value=!1},{deep:!0,immediate:!0}),bi("resource",un(b)),bi("versions",un(E)),bi("space",V(()=>e.space)),bi("activePanel",V(()=>e.activePanel)),bi("availableInternalShareRoles",un(S)),bi("availableExternalShareRoles",un(T)),{loadedResource:b,setActiveSideBarPanel:$,closeSideBar:B,panelContext:v,availablePanels:le,isFileHeaderVisible:D,isSpaceHeaderVisible:H,isLoading:g,loadSharesTask:fe}}});function IN(e,t,r,n,o,i){const s=de("file-info"),l=de("space-info"),c=de("InnerSideBar");return e.isOpen?(te(),Ce(c,Yt({key:0,ref:"sidebar",class:"files-side-bar","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:Te(()=>[e.isFileHeaderVisible?(te(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(te(),Ce(l,{key:1,class:"sidebar-panel__space_info"})):ke("",!0)]),subHeader:Te(()=>[e.isFileHeaderVisible?(te(),Ce(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(te(),Ce(l,{key:1,class:"sidebar-panel__space_info"})):ke("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):ke("",!0)}const n0=qe(_N,[["render",IN]]),CN=je({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=ce(),t=ce(!0);return{confirmDisabled:t,onDateChanged:({date:n,error:o})=>{t.value=o||!n,e.value=n},dateTime:e}}}),FN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function PN(e,t,r,n,o,i){const s=de("oc-datepicker"),l=de("oc-button");return te(),ve(Xe,null,[be(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),pe("div",FN,[be(l,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),be(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=c=>e.$emit("confirm",e.dateTime))},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const xN=qe(CN,[["render",PN]]),ON=je({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=yt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),kN=["textContent"],NN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},$N={class:"oc-modal-body-actions-grid"};function DN(e,t,r,n,o,i){const s=de("oc-button");return te(),ve(Xe,null,[pe("span",{class:"oc-display-inline-block oc-mb-m",textContent:K.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,kN),t[2]||(t[2]=pe("div",{class:"oc-my-m"},null,-1)),pe("div",NN,[pe("div",$N,[be(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),be(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),be(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const i0=qe(ON,[["render",DN]]);var LN=/\s/;function BN(e){for(var t=e.length;t--&&LN.test(e.charAt(t)););return t}var MN=/^\s+/;function jN(e){return e&&e.slice(0,BN(e)+1).replace(MN,"")}var o0=NaN,UN=/^[-+]0x[0-9a-f]+$/i,qN=/^0b[01]+$/i,VN=/^0o[0-7]+$/i,zN=parseInt;function WN(e){if(typeof e=="number")return e;if(bs(e))return o0;if(Qr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=jN(e);var r=qN.test(e);return r||VN.test(e)?zN(e.slice(2),r?2:8):UN.test(e)?o0:+e}const HN=je({name:"AppWrapper",components:{AppTopBar:Zv,FileSideBar:n0,ErrorScreen:nN,LoadingScreen:lN},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:r}=$e.useGettext(),n=Zr(),{showMessage:o,showErrorMessage:i}=it(),s=Lo.useRouter(),l=Jt(),c=Je(),u=ar(),{getResourceContext:a}=Gv(),{selectedResources:f}=Hf(),{dispatchModal:d}=yt(),b=ut(),E=ot(),S=Qe(),T=Bt(),{actions:w}=Pv({appId:e.applicationId}),{actions:y}=Cf(),{actions:g}=Po(),{actions:v}=kf(),{actions:A}=Nf(),R=V(()=>{var Re;return!!((Re=e.wrappedComponent.emits)!=null&&Re.includes("update:resource"))}),C=ce(),P=ce(),_=ce(""),L=ce(""),B=ce(!m(R)),$=ce(),D=ce(!1),H=ce(),X=ce(),{actions:J}=Ov({content:X}),le=V(()=>{var Re;return!!((Re=e.wrappedComponent.emits)!=null&&Re.includes("update:currentContent"))}),me=Re=>!!Object.keys(e.wrappedComponent.props).includes(Re),fe=V(()=>m(X)!==m(H)),we=Re=>{Re.preventDefault()};Tt(fe,Re=>{Re?window.addEventListener("beforeunload",we):window.removeEventListener("beforeunload",we)});const{applicationConfig:Se,closeApp:re,currentFileContext:oe,getFileContents:ae,getFileInfo:Ae,getUrlForResource:Z,putFileContents:F,replaceInvalidFileRoute:O,revokeUrl:Q,activeFiles:W,loadFolderForFileContext:U,isFolderLoading:z}=uv({applicationId:e.applicationId}),{applicationMeta:ue}=_f({applicationId:e.applicationId,appsStore:n}),_e=V(()=>{var Re;return(Re=m(ue).meta)==null?void 0:Re.fileSizeLimit}),Be=V(()=>{const{name:Re}=m(ue);return t("%{appName} for %{fileName}",{appName:t(Re),fileName:m(m(oe).fileName)})}),xe=Ys("driveAliasAndItem"),Fe=rr("fileId"),Me=V(()=>St(m(Fe))),ee=async()=>{const Re=m(Me),{space:Oe,path:Le}=await a(Re),br=Oe.getDriveAliasAndItem({path:Le});return ie.isPersonalSpaceResource(Oe)?s.push({params:{...m(l).params,driveAliasAndItem:br},query:{...m(l).query,fileId:Re,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:ht.dirname(br)}}}):s.push({params:{...m(l).params,driveAliasAndItem:br},query:{...m(l).query,fileId:Re,contextRouteName:Le==="/"?"files-shares-with-me":"files-spaces-generic",...ie.isShareSpaceResource(Oe)&&{shareId:Oe.id},contextRouteParams:{driveAliasAndItem:ht.dirname(br)},contextRouteQuery:{...ie.isShareSpaceResource(Oe)&&{shareId:Oe.id}}}})},Pe=lr.useTask(function*(Re){try{m(xe)||(yield ee()),P.value=m(m(oe).space);const Oe=yield Ae(m(oe),{signal:Re});if(C.value=Oe,ie.isShareSpaceResource(m(P))&&(m(C).remoteItemId=m(P).id,m(C).id===m(C).remoteItemId)){const Le=yield*ie.call(ys({graphClient:c.graphAuthenticated,spacesStore:b,space:m(P)}));Le&&(C.value={...Oe,...ie.buildIncomingShareResource({graphRoles:T.graphRoles,driveItem:Le,serverUrl:E.serverUrl}),tags:Oe.tags})}S.initResourceList({currentFolder:null,resources:[m(C)]}),f.value=[m(C)]}catch(Oe){console.error(Oe),$.value=Oe,B.value=!1}}).restartable(),Ue=lr.useTask(function*(Re){try{const Oe=e.importResourceWithExtension(m(C));if(Oe){const Le=Dt.DateTime.local().toFormat("yyyyMMddHHmmss"),br=`${m(C).name}_${Le}.${Oe}`;if(!(yield c.webdav.copyFiles(m(P),m(C),m(P),{path:br},{signal:Re})))throw new Error(t("Importing failed"));C.value={path:br}}if(O(oe,m(C)))return;if(D.value=![_r.Updateable,_r.FileUpdateable].some(Le=>(m(C).permissions||"").indexOf(Le)>-1),m(me("currentContent"))){const Le=yield*ie.call(ae(oe,{...e.fileContentOptions,signal:Re}));H.value=X.value=Le.body,_.value=Le.headers["OC-ETag"]}m(me("url"))&&(L.value=yield Z(m(P),m(C),{...e.urlForResourceOptions,signal:Re}))}catch(Oe){console.error(Oe),$.value=Oe}finally{B.value=!1}}).restartable();Tt(oe,async()=>{m(R)||(await Pe.perform(),m(_e)&&WN(m(C).size)>m(_e)?d({title:t("File exceeds %{threshold}",{threshold:wr(m(_e),r)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:m(C).name,threshold:wr(m(_e),r)}),confirmText:t("Continue"),onCancel:()=>{re()},onConfirm:()=>{Ue.perform()}}):Ue.perform())},{immediate:!0});const ze=Re=>{console.error(Re),i({title:t("An error occurred"),desc:Re.message,errors:[Re]})},Ze=()=>{o({title:t("File autosaved")})},vt=lr.useTask(function*(){const Re=m(X);try{const Oe=yield F(oe,{content:Re,previousEntityTag:m(_)});H.value=Re,_.value=Oe.etag,S.upsertResource(Oe)}catch(Oe){switch(Oe.statusCode){case 401:case 403:ze(new ie.HttpError(t("You're not authorized to save this file"),Oe.response));break;case 409:case 412:ze(new ie.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),Oe.response));break;case 507:const Le=b.spaces.find(br=>br.id===m(C).storageId&&ie.isProjectSpaceResource(br));if(Le){ze(new ie.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:Le.name}),Oe.response));break}ze(new ie.HttpError(t("Insufficient quota for saving this file"),Oe.response));break;default:ze(new ie.HttpError("",Oe.response))}}}).drop(),et=async()=>{await vt.perform()},jt=V(()=>!e.disableAutoSave);let nr=null;qt(()=>{var Oe;if((Oe=S.ancestorMetaData)!=null&&Oe["/"]&&m(P)&&S.ancestorMetaData["/"].spaceId!==m(P).id&&S.setAncestorMetaData({}),!m(le))return;const Re=E.options.editor;Re.autosaveEnabled&&!e.disableAutoSave&&(nr=setInterval(async()=>{fe.value&&(await et(),Ze())},(Re.autosaveInterval||120)*1e3))}),Gr(()=>{u.isLoading||window.removeEventListener("beforeunload",we),m(me("url"))&&Q(L.value),m(le)&&(clearInterval(nr),nr=null)});const{bindKeyAction:ct}=zv({skipDisabledKeyBindingsCheck:!0});ct({modifier:qf.Ctrl,primary:Uf.S},()=>{m(fe)&&et()});const Ir=V(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>m(le),isDisabled:()=>D.value||!fe.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:et}]),I=V(()=>({space:m(P),resources:[m(C)]})),p=async(Re,Oe)=>{m(fe)&&(await et(),Ze()),Oe(Re)},h=V(()=>[...m(w),...m(Ir),...m(J).map(Re=>({...Re,isVisible:Oe=>le.value&&Re.isVisible(Oe)}))].filter(Re=>Re.isVisible(m(I)))),k=V(()=>[...m(A),...m(y)].filter(Re=>Re.isVisible(m(I)))),M=V(()=>[...m(g).map(Re=>({...Re,handler:Oe=>p(Oe,Re.handler)}))].filter(Re=>Re.isVisible(m(I)))),G=V(()=>[...m(v)].filter(Re=>Re.isVisible(m(I)))),ne=V(()=>{const Re=[];return m(h).length&&Re.push({name:"context",items:m(h)}),m(k).length&&Re.push({name:"share",items:m(k)}),m(M).length&&Re.push({name:"actions",items:m(M)}),m(G).length&&Re.push({name:"sidebar",items:m(G)}),Re}),De=V(()=>[...m(Ir)]);Lo.onBeforeRouteLeave((Re,Oe,Le)=>{m(fe)?d({title:t("Unsaved changes"),customComponent:i0,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{Le()}}),async onConfirm(){await et(),Le()}}):Le()});const He=V(()=>({url:m(L),space:m(m(oe).space),resource:m(C),activeFiles:m(W),isDirty:m(fe),isReadOnly:m(D),applicationConfig:m(Se),currentFileContext:m(oe),currentContent:m(X),isFolderLoading:m(z),"onUpdate:resource":Re=>{C.value=Re,P.value=m(m(oe).space),f.value=[Re]},"onUpdate:currentContent":Re=>{X.value=Re},onSave:et,onClose:re,loadFolderForFileContext:U,revokeUrl:Q,getUrlForResource:Z}));return{...Rb(),dropDownMenuSections:ne,dropDownActionOptions:I,hasAutoSave:jt,isEditor:le,closeApp:re,fileActions:De,loading:B,loadingError:$,pageTitle:Be,resource:C,space:P,slotAttrs:He}}}),GN=["id"],KN=["textContent"];function QN(e,t,r,n,o,i){const s=de("app-top-bar"),l=de("loading-screen"),c=de("error-screen"),u=de("file-side-bar");return te(),ve("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=eo((...a)=>e.closeApp&&e.closeApp(...a),["esc"]))},[pe("h1",{class:"oc-invisible-sr",textContent:K.toDisplayString(e.pageTitle)},null,8,KN),!e.loading&&!e.loadingError&&e.resource?(te(),Ce(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):ke("",!0),e.loading?(te(),Ce(l,{key:1})):e.loadingError?(te(),Ce(c,{key:2,message:e.loadingError.message},null,8,["message"])):(te(),ve("div",{key:3,class:K.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Ke(e.$slots,"default",Yt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),be(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,GN)}const s0=qe(HN,[["render",QN]]);function XN(e,t){return je({render(){return yp(s0,{wrappedComponent:e,...t},{default:r=>yp(e,r)})}})}const YN=je({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>ie.extractDomSelector(e.id)}},emits:["quickActionClicked"],setup(){const{$gettext:e}=$e.useGettext();return{contextMenuLabel:V(()=>e("Show context menu"))}}});function JN(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-drop"),c=de("oc-button"),u=ur("oc-tooltip");return at((te(),Ce(c,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"aria-label":e.contextMenuLabel,appearance:"raw",class:"quick-action-button oc-ml-xs oc-p-xs",onClick:t[0]||(t[0]=Tr(a=>e.$emit("quickActionClicked",{event:a,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Te(()=>[be(s,{name:"more-2"}),be(l,{ref:`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,class:"oc-overflow-hidden",position:"bottom-end",mode:"click","close-on-click":"","padding-size":"small"},{default:Te(()=>[Ke(e.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const Qf=qe(YN,[["render",JN]]),ZN=je({name:"ResourceGhostElement",components:{ResourceIcon:xo},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}}}),e$={id:"ghost-element",class:"ghost-element"},t$={class:"ghost-element-layer1 oc-rounded"},r$={key:0,class:"ghost-element-layer2 oc-rounded"},n$={key:1,class:"ghost-element-layer3 oc-rounded"},i$={class:"badge"};function o$(e,t,r,n,o,i){const s=de("resource-icon");return te(),ve("div",e$,[pe("div",t$,[be(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(te(),ve("div",r$)):ke("",!0),e.showThirdLayer?(te(),ve("div",n$)):ke("",!0)]),pe("span",i$,K.toDisplayString(e.itemCount),1)])}const Xf=qe(ZN,[["render",o$]]),s$=je({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=$e.useGettext();return{formattedSize:V(()=>wr(e.size,t))}}}),a$=["textContent"];function l$(e,t,r,n,o,i){return te(),ve("span",{class:"oc-resource-size",textContent:K.toDisplayString(e.formattedSize)},null,8,a$)}const a0=qe(s$,[["render",l$]]),c$=je({__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 r=t,n=V(()=>{const l=["oc-button","oc-rounded",`oc-button-${ii(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${ii(e.gapSize)}`,`oc-button-${Et.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${Et.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&l.push("no-hover"),l}),o=V(()=>({...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=V(()=>({...e.type==="button"&&{click:s}})),s=l=>{r("click",l)};return(l,c)=>{const u=de("oc-spinner");return te(),Ce(Hn(l.type),Yt(o.value,{"aria-label":l.ariaLabel,class:n.value},Ga(i.value)),{default:Te(()=>[l.showSpinner?(te(),Ce(u,{key:0,size:"small",class:"spinner"})):ke("",!0),Ke(l.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
58
58
  * tabbable 6.2.0
59
59
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
60
- */var d0=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],pa=d0.join(","),p0=typeof Element>"u",li=p0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ha=!p0&&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==null?void 0:e.ownerDocument},ga=function e(t,r){var n;r===void 0&&(r=!0);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),i=o===""||o==="true",s=i||r&&t&&e(t.parentNode);return s},d$=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},h0=function(t,r,n){if(ga(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(pa));return r&&li.call(t,pa)&&o.unshift(t),o=o.filter(n),o},g0=function e(t,r,n){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ga(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),c=l.length?l:s.children,u=e(c,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var a=li.call(s,pa);a&&n.filter(s)&&(r||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(s),d=!ga(f,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(f&&d){var b=e(f===!0?s.children:f.children,!0,n);n.flatten?o.push.apply(o,b):o.push({scopeParent:s,candidates:b})}else i.unshift.apply(i,s.children)}}return o},m0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ci=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||d$(t))&&!m0(t)?0:t.tabIndex},p$=function(t,r){var n=ci(t);return n<0&&r&&!m0(t)?0:n},h$=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},y0=function(t){return t.tagName==="INPUT"},g$=function(t){return y0(t)&&t.type==="hidden"},m$=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},y$=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},b$=function(t){if(!t.name)return!0;var r=t.form||ha(t),n=function(l){return r.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=n(window.CSS.escape(t.name));else try{o=n(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 i=y$(o,t.form);return!i||i===t},v$=function(t){return y0(t)&&t.type==="radio"},w$=function(t){return v$(t)&&!b$(t)},S$=function(t){var r,n=t&&ha(t),o=(r=n)===null||r===void 0?void 0:r.host,i=!1;if(n&&n!==t){var s,l,c;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var u,a,f;n=ha(o),o=(u=n)===null||u===void 0?void 0:u.host,i=!!((a=o)!==null&&a!==void 0&&(f=a.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},b0=function(t){var r=t.getBoundingClientRect(),n=r.width,o=r.height;return n===0&&o===0},E$=function(t,r){var n=r.displayCheck,o=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=li.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(li.call(s,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,u=ha(t);if(c&&!c.shadowRoot&&o(c)===!0)return b0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=l}if(S$(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return b0(t);return!1},T$=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var o=r.children.item(n);if(o.tagName==="LEGEND")return li.call(r,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}r=r.parentElement}return!1},ma=function(t,r){return!(r.disabled||ga(r)||g$(r)||E$(r,t)||m$(r)||T$(r))},Yf=function(t,r){return!(w$(r)||ci(r)<0||!ma(t,r))},A$=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},R$=function e(t){var r=[],n=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,c=p$(l,s),u=s?e(o.candidates):l;c===0?s?r.push.apply(r,u):r.push(l):n.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:u})}),n.sort(h$).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},_$=function(t,r){r=r||{};var n;return r.getShadowRoot?n=g0([t],r.includeContainer,{filter:Yf.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:A$}):n=h0(t,r.includeContainer,Yf.bind(null,r)),R$(n)},I$=function(t,r){r=r||{};var n;return r.getShadowRoot?n=g0([t],r.includeContainer,{filter:ma.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=h0(t,r.includeContainer,ma.bind(null,r)),n},Mi=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return li.call(t,pa)===!1?!1:Yf(r,t)},C$=d0.concat("iframe").join(","),Jf=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return li.call(t,C$)===!1?!1:ma(r,t)};/*!
60
+ */var l0=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ha=l0.join(","),c0=typeof Element>"u",li=c0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ga=!c0&&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==null?void 0:e.ownerDocument},ma=function e(t,r){var n;r===void 0&&(r=!0);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),i=o===""||o==="true",s=i||r&&t&&e(t.parentNode);return s},u$=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},u0=function(t,r,n){if(ma(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ha));return r&&li.call(t,ha)&&o.unshift(t),o=o.filter(n),o},f0=function e(t,r,n){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ma(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),c=l.length?l:s.children,u=e(c,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var a=li.call(s,ha);a&&n.filter(s)&&(r||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(s),d=!ma(f,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(f&&d){var b=e(f===!0?s.children:f.children,!0,n);n.flatten?o.push.apply(o,b):o.push({scopeParent:s,candidates:b})}else i.unshift.apply(i,s.children)}}return o},d0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ci=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||u$(t))&&!d0(t)?0:t.tabIndex},f$=function(t,r){var n=ci(t);return n<0&&r&&!d0(t)?0:n},d$=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},p0=function(t){return t.tagName==="INPUT"},p$=function(t){return p0(t)&&t.type==="hidden"},h$=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},g$=function(t,r){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===r)return t[n]},m$=function(t){if(!t.name)return!0;var r=t.form||ga(t),n=function(l){return r.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=n(window.CSS.escape(t.name));else try{o=n(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 i=g$(o,t.form);return!i||i===t},y$=function(t){return p0(t)&&t.type==="radio"},b$=function(t){return y$(t)&&!m$(t)},v$=function(t){var r,n=t&&ga(t),o=(r=n)===null||r===void 0?void 0:r.host,i=!1;if(n&&n!==t){var s,l,c;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var u,a,f;n=ga(o),o=(u=n)===null||u===void 0?void 0:u.host,i=!!((a=o)!==null&&a!==void 0&&(f=a.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},h0=function(t){var r=t.getBoundingClientRect(),n=r.width,o=r.height;return n===0&&o===0},w$=function(t,r){var n=r.displayCheck,o=r.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=li.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(li.call(s,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,u=ga(t);if(c&&!c.shadowRoot&&o(c)===!0)return h0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=l}if(v$(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return h0(t);return!1},S$=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n<r.children.length;n++){var o=r.children.item(n);if(o.tagName==="LEGEND")return li.call(r,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}r=r.parentElement}return!1},ya=function(t,r){return!(r.disabled||ma(r)||p$(r)||w$(r,t)||h$(r)||S$(r))},Yf=function(t,r){return!(b$(r)||ci(r)<0||!ya(t,r))},E$=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},T$=function e(t){var r=[],n=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,c=f$(l,s),u=s?e(o.candidates):l;c===0?s?r.push.apply(r,u):r.push(l):n.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:u})}),n.sort(d$).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},A$=function(t,r){r=r||{};var n;return r.getShadowRoot?n=f0([t],r.includeContainer,{filter:Yf.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:E$}):n=u0(t,r.includeContainer,Yf.bind(null,r)),T$(n)},R$=function(t,r){r=r||{};var n;return r.getShadowRoot?n=f0([t],r.includeContainer,{filter:ya.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=u0(t,r.includeContainer,ya.bind(null,r)),n},Mi=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return li.call(t,ha)===!1?!1:Yf(r,t)},_$=l0.concat("iframe").join(","),Jf=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return li.call(t,_$)===!1?!1:ya(r,t)};/*!
61
61
  * focus-trap 7.6.4
62
62
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
63
- */function Zf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function F$(e){if(Array.isArray(e))return Zf(e)}function P$(e,t,r){return(t=$$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function O$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
64
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function w0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?v0(Object(r),!0).forEach(function(n){P$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function k$(e){return F$(e)||x$(e)||D$(e)||O$()}function N$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $$(e){var t=N$(e,"string");return typeof t=="symbol"?t:t+""}function D$(e,t){if(e){if(typeof e=="string")return Zf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zf(e,t):void 0}}var S0={activateTrap:function(t,r){if(t.length>0){var n=t[t.length-1];n!==r&&n._setPausedState(!0)}var o=t.indexOf(r);o===-1||t.splice(o,1),t.push(r)},deactivateTrap:function(t,r){var n=t.indexOf(r);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},L$=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},B$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},ko=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},M$=function(t){return ko(t)&&!t.shiftKey},j$=function(t){return ko(t)&&t.shiftKey},E0=function(t){return setTimeout(t,0)},No=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,n):t},ya=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},U$=[],q$=function(t,r){var n=(r==null?void 0:r.document)||document,o=(r==null?void 0:r.trapStack)||U$,i=w0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:M$,isKeyBackward:j$},r),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,c=function(D,H,ee){return D&&D[H]!==void 0?D[H]:i[ee||H]},u=function(D,H){var ee=typeof(H==null?void 0:H.composedPath)=="function"?H.composedPath():void 0;return s.containerGroups.findIndex(function(J){var ce=J.container,be=J.tabbableNodes;return ce.contains(D)||(ee==null?void 0:ee.includes(ce))||be.find(function(de){return de===D})})},a=function(D){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=H.hasFallback,J=ee===void 0?!1:ee,ce=H.params,be=ce===void 0?[]:ce,de=i[D];if(typeof de=="function"&&(de=de.apply(void 0,k$(be))),de===!0&&(de=void 0),!de){if(de===void 0||de===!1)return de;throw new Error("`".concat(D,"` was specified but was not a node, or did not return a node"))}var Se=de;if(typeof de=="string"){try{Se=n.querySelector(de)}catch(Ae){throw new Error("`".concat(D,'` appears to be an invalid selector; error="').concat(Ae.message,'"'))}if(!Se&&!J)throw new Error("`".concat(D,"` as selector refers to no known node"))}return Se},f=function(){var D=a("initialFocus",{hasFallback:!0});if(D===!1)return!1;if(D===void 0||D&&!Jf(D,i.tabbableOptions))if(u(n.activeElement)>=0)D=n.activeElement;else{var H=s.tabbableGroups[0],ee=H&&H.firstTabbableNode;D=ee||a("fallbackFocus")}else D===null&&(D=a("fallbackFocus"));if(!D)throw new Error("Your focus-trap needs to have at least one focusable element");return D},d=function(){if(s.containerGroups=s.containers.map(function(D){var H=_$(D,i.tabbableOptions),ee=I$(D,i.tabbableOptions),J=H.length>0?H[0]:void 0,ce=H.length>0?H[H.length-1]:void 0,be=ee.find(function(Ae){return Mi(Ae)}),de=ee.slice().reverse().find(function(Ae){return Mi(Ae)}),Se=!!H.find(function(Ae){return ci(Ae)>0});return{container:D,tabbableNodes:H,focusableNodes:ee,posTabIndexesFound:Se,firstTabbableNode:J,lastTabbableNode:ce,firstDomTabbableNode:be,lastDomTabbableNode:de,nextTabbableNode:function(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,le=H.indexOf(ne);return le<0?ae?ee.slice(ee.indexOf(ne)+1).find(function(oe){return Mi(oe)}):ee.slice(0,ee.indexOf(ne)).reverse().find(function(oe){return Mi(oe)}):H[le+(ae?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(D){return D.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!a("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(D){return D.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.")},b=function(D){var H=D.activeElement;if(H)return H.shadowRoot&&H.shadowRoot.activeElement!==null?b(H.shadowRoot):H},E=function(D){if(D!==!1&&D!==b(document)){if(!D||!D.focus){E(f());return}D.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=D,L$(D)&&D.select()}},w=function(D){var H=a("setReturnFocus",{params:[D]});return H||(H===!1?!1:D)},R=function(D){var H=D.target,ee=D.event,J=D.isBackward,ce=J===void 0?!1:J;H=H||ya(ee),d();var be=null;if(s.tabbableGroups.length>0){var de=u(H,ee),Se=de>=0?s.containerGroups[de]:void 0;if(de<0)ce?be=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:be=s.tabbableGroups[0].firstTabbableNode;else if(ce){var Ae=s.tabbableGroups.findIndex(function(x){var k=x.firstTabbableNode;return H===k});if(Ae<0&&(Se.container===H||Jf(H,i.tabbableOptions)&&!Mi(H,i.tabbableOptions)&&!Se.nextTabbableNode(H,!1))&&(Ae=de),Ae>=0){var ne=Ae===0?s.tabbableGroups.length-1:Ae-1,ae=s.tabbableGroups[ne];be=ci(H)>=0?ae.lastTabbableNode:ae.lastDomTabbableNode}else ko(ee)||(be=Se.nextTabbableNode(H,!1))}else{var le=s.tabbableGroups.findIndex(function(x){var k=x.lastTabbableNode;return H===k});if(le<0&&(Se.container===H||Jf(H,i.tabbableOptions)&&!Mi(H,i.tabbableOptions)&&!Se.nextTabbableNode(H))&&(le=de),le>=0){var oe=le===s.tabbableGroups.length-1?0:le+1,Q=s.tabbableGroups[oe];be=ci(H)>=0?Q.firstTabbableNode:Q.firstDomTabbableNode}else ko(ee)||(be=Se.nextTabbableNode(H))}}else be=a("fallbackFocus");return be},S=function(D){var H=ya(D);if(!(u(H,D)>=0)){if(No(i.clickOutsideDeactivates,D)){l.deactivate({returnFocus:i.returnFocusOnDeactivate});return}No(i.allowOutsideClick,D)||D.preventDefault()}},m=function(D){var H=ya(D),ee=u(H,D)>=0;if(ee||H instanceof Document)ee&&(s.mostRecentlyFocusedNode=H);else{D.stopImmediatePropagation();var J,ce=!0;if(s.mostRecentlyFocusedNode)if(ci(s.mostRecentlyFocusedNode)>0){var be=u(s.mostRecentlyFocusedNode),de=s.containerGroups[be].tabbableNodes;if(de.length>0){var Se=de.findIndex(function(Ae){return Ae===s.mostRecentlyFocusedNode});Se>=0&&(i.isKeyForward(s.recentNavEvent)?Se+1<de.length&&(J=de[Se+1],ce=!1):Se-1>=0&&(J=de[Se-1],ce=!1))}}else s.containerGroups.some(function(Ae){return Ae.tabbableNodes.some(function(ne){return ci(ne)>0})})||(ce=!1);else ce=!1;ce&&(J=R({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),E(J||s.mostRecentlyFocusedNode||f())}s.recentNavEvent=void 0},g=function(D){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=D;var ee=R({event:D,isBackward:H});ee&&(ko(D)&&D.preventDefault(),E(ee))},v=function(D){(i.isKeyForward(D)||i.isKeyBackward(D))&&g(D,i.isKeyBackward(D))},T=function(D){B$(D)&&No(i.escapeDeactivates,D)!==!1&&(D.preventDefault(),l.deactivate())},A=function(D){var H=ya(D);u(H,D)>=0||No(i.clickOutsideDeactivates,D)||No(i.allowOutsideClick,D)||(D.preventDefault(),D.stopImmediatePropagation())},F=function(){if(s.active)return S0.activateTrap(o,l),s.delayInitialFocusTimer=i.delayInitialFocus?E0(function(){E(f())}):E(f()),n.addEventListener("focusin",m,!0),n.addEventListener("mousedown",S,{capture:!0,passive:!1}),n.addEventListener("touchstart",S,{capture:!0,passive:!1}),n.addEventListener("click",A,{capture:!0,passive:!1}),n.addEventListener("keydown",v,{capture:!0,passive:!1}),n.addEventListener("keydown",T),l},C=function(){if(s.active)return n.removeEventListener("focusin",m,!0),n.removeEventListener("mousedown",S,!0),n.removeEventListener("touchstart",S,!0),n.removeEventListener("click",A,!0),n.removeEventListener("keydown",v,!0),n.removeEventListener("keydown",T),l},I=function(D){var H=D.some(function(ee){var J=Array.from(ee.removedNodes);return J.some(function(ce){return ce===s.mostRecentlyFocusedNode})});H&&E(f())},L=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,B=function(){L&&(L.disconnect(),s.active&&!s.paused&&s.containers.map(function(D){L.observe(D,{subtree:!0,childList:!0})}))};return l={get active(){return s.active},get paused(){return s.paused},activate:function(D){if(s.active)return this;var H=c(D,"onActivate"),ee=c(D,"onPostActivate"),J=c(D,"checkCanFocusTrap");J||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=n.activeElement,H==null||H();var ce=function(){J&&d(),F(),B(),ee==null||ee()};return J?(J(s.containers.concat()).then(ce,ce),this):(ce(),this)},deactivate:function(D){if(!s.active)return this;var H=w0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},D);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,C(),s.active=!1,s.paused=!1,B(),S0.deactivateTrap(o,l);var ee=c(H,"onDeactivate"),J=c(H,"onPostDeactivate"),ce=c(H,"checkCanReturnFocus"),be=c(H,"returnFocus","returnFocusOnDeactivate");ee==null||ee();var de=function(){E0(function(){be&&E(w(s.nodeFocusedBeforeActivation)),J==null||J()})};return be&&ce?(ce(w(s.nodeFocusedBeforeActivation)).then(de,de),this):(de(),this)},pause:function(D){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,D)):this},unpause:function(D){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,D)):this},updateContainerElements:function(D){var H=[].concat(D).filter(Boolean);return s.containers=H.map(function(ee){return typeof ee=="string"?n.querySelector(ee):ee}),s.active&&d(),B(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(D,H){if(s.paused===D)return this;if(s.paused=D,D){var ee=c(H,"onPause"),J=c(H,"onPostPause");ee==null||ee(),C(),B(),J==null||J()}else{var ce=c(H,"onUnpause"),be=c(H,"onPostUnpause");ce==null||ce(),d(),F(),B(),be==null||be()}return this}}}),l.updateContainerElements(t),l};/*!
63
+ */function Zf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function I$(e){if(Array.isArray(e))return Zf(e)}function C$(e,t,r){return(t=k$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function F$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function P$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
64
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function m0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g0(Object(r),!0).forEach(function(n){C$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x$(e){return I$(e)||F$(e)||N$(e)||P$()}function O$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k$(e){var t=O$(e,"string");return typeof t=="symbol"?t:t+""}function N$(e,t){if(e){if(typeof e=="string")return Zf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zf(e,t):void 0}}var y0={activateTrap:function(t,r){if(t.length>0){var n=t[t.length-1];n!==r&&n._setPausedState(!0)}var o=t.indexOf(r);o===-1||t.splice(o,1),t.push(r)},deactivateTrap:function(t,r){var n=t.indexOf(r);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},$$=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},D$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},ko=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},L$=function(t){return ko(t)&&!t.shiftKey},B$=function(t){return ko(t)&&t.shiftKey},b0=function(t){return setTimeout(t,0)},No=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,n):t},ba=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},M$=[],j$=function(t,r){var n=(r==null?void 0:r.document)||document,o=(r==null?void 0:r.trapStack)||M$,i=m0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:L$,isKeyBackward:B$},r),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,c=function(D,H,X){return D&&D[H]!==void 0?D[H]:i[X||H]},u=function(D,H){var X=typeof(H==null?void 0:H.composedPath)=="function"?H.composedPath():void 0;return s.containerGroups.findIndex(function(J){var le=J.container,me=J.tabbableNodes;return le.contains(D)||(X==null?void 0:X.includes(le))||me.find(function(fe){return fe===D})})},a=function(D){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=H.hasFallback,J=X===void 0?!1:X,le=H.params,me=le===void 0?[]:le,fe=i[D];if(typeof fe=="function"&&(fe=fe.apply(void 0,x$(me))),fe===!0&&(fe=void 0),!fe){if(fe===void 0||fe===!1)return fe;throw new Error("`".concat(D,"` was specified but was not a node, or did not return a node"))}var we=fe;if(typeof fe=="string"){try{we=n.querySelector(fe)}catch(Se){throw new Error("`".concat(D,'` appears to be an invalid selector; error="').concat(Se.message,'"'))}if(!we&&!J)throw new Error("`".concat(D,"` as selector refers to no known node"))}return we},f=function(){var D=a("initialFocus",{hasFallback:!0});if(D===!1)return!1;if(D===void 0||D&&!Jf(D,i.tabbableOptions))if(u(n.activeElement)>=0)D=n.activeElement;else{var H=s.tabbableGroups[0],X=H&&H.firstTabbableNode;D=X||a("fallbackFocus")}else D===null&&(D=a("fallbackFocus"));if(!D)throw new Error("Your focus-trap needs to have at least one focusable element");return D},d=function(){if(s.containerGroups=s.containers.map(function(D){var H=A$(D,i.tabbableOptions),X=R$(D,i.tabbableOptions),J=H.length>0?H[0]:void 0,le=H.length>0?H[H.length-1]:void 0,me=X.find(function(Se){return Mi(Se)}),fe=X.slice().reverse().find(function(Se){return Mi(Se)}),we=!!H.find(function(Se){return ci(Se)>0});return{container:D,tabbableNodes:H,focusableNodes:X,posTabIndexesFound:we,firstTabbableNode:J,lastTabbableNode:le,firstDomTabbableNode:me,lastDomTabbableNode:fe,nextTabbableNode:function(re){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=H.indexOf(re);return ae<0?oe?X.slice(X.indexOf(re)+1).find(function(Ae){return Mi(Ae)}):X.slice(0,X.indexOf(re)).reverse().find(function(Ae){return Mi(Ae)}):H[ae+(oe?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(D){return D.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!a("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(D){return D.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.")},b=function(D){var H=D.activeElement;if(H)return H.shadowRoot&&H.shadowRoot.activeElement!==null?b(H.shadowRoot):H},E=function(D){if(D!==!1&&D!==b(document)){if(!D||!D.focus){E(f());return}D.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=D,$$(D)&&D.select()}},S=function(D){var H=a("setReturnFocus",{params:[D]});return H||(H===!1?!1:D)},T=function(D){var H=D.target,X=D.event,J=D.isBackward,le=J===void 0?!1:J;H=H||ba(X),d();var me=null;if(s.tabbableGroups.length>0){var fe=u(H,X),we=fe>=0?s.containerGroups[fe]:void 0;if(fe<0)le?me=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:me=s.tabbableGroups[0].firstTabbableNode;else if(le){var Se=s.tabbableGroups.findIndex(function(F){var O=F.firstTabbableNode;return H===O});if(Se<0&&(we.container===H||Jf(H,i.tabbableOptions)&&!Mi(H,i.tabbableOptions)&&!we.nextTabbableNode(H,!1))&&(Se=fe),Se>=0){var re=Se===0?s.tabbableGroups.length-1:Se-1,oe=s.tabbableGroups[re];me=ci(H)>=0?oe.lastTabbableNode:oe.lastDomTabbableNode}else ko(X)||(me=we.nextTabbableNode(H,!1))}else{var ae=s.tabbableGroups.findIndex(function(F){var O=F.lastTabbableNode;return H===O});if(ae<0&&(we.container===H||Jf(H,i.tabbableOptions)&&!Mi(H,i.tabbableOptions)&&!we.nextTabbableNode(H))&&(ae=fe),ae>=0){var Ae=ae===s.tabbableGroups.length-1?0:ae+1,Z=s.tabbableGroups[Ae];me=ci(H)>=0?Z.firstTabbableNode:Z.firstDomTabbableNode}else ko(X)||(me=we.nextTabbableNode(H))}}else me=a("fallbackFocus");return me},w=function(D){var H=ba(D);if(!(u(H,D)>=0)){if(No(i.clickOutsideDeactivates,D)){l.deactivate({returnFocus:i.returnFocusOnDeactivate});return}No(i.allowOutsideClick,D)||D.preventDefault()}},y=function(D){var H=ba(D),X=u(H,D)>=0;if(X||H instanceof Document)X&&(s.mostRecentlyFocusedNode=H);else{D.stopImmediatePropagation();var J,le=!0;if(s.mostRecentlyFocusedNode)if(ci(s.mostRecentlyFocusedNode)>0){var me=u(s.mostRecentlyFocusedNode),fe=s.containerGroups[me].tabbableNodes;if(fe.length>0){var we=fe.findIndex(function(Se){return Se===s.mostRecentlyFocusedNode});we>=0&&(i.isKeyForward(s.recentNavEvent)?we+1<fe.length&&(J=fe[we+1],le=!1):we-1>=0&&(J=fe[we-1],le=!1))}}else s.containerGroups.some(function(Se){return Se.tabbableNodes.some(function(re){return ci(re)>0})})||(le=!1);else le=!1;le&&(J=T({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),E(J||s.mostRecentlyFocusedNode||f())}s.recentNavEvent=void 0},g=function(D){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=D;var X=T({event:D,isBackward:H});X&&(ko(D)&&D.preventDefault(),E(X))},v=function(D){(i.isKeyForward(D)||i.isKeyBackward(D))&&g(D,i.isKeyBackward(D))},A=function(D){D$(D)&&No(i.escapeDeactivates,D)!==!1&&(D.preventDefault(),l.deactivate())},R=function(D){var H=ba(D);u(H,D)>=0||No(i.clickOutsideDeactivates,D)||No(i.allowOutsideClick,D)||(D.preventDefault(),D.stopImmediatePropagation())},C=function(){if(s.active)return y0.activateTrap(o,l),s.delayInitialFocusTimer=i.delayInitialFocus?b0(function(){E(f())}):E(f()),n.addEventListener("focusin",y,!0),n.addEventListener("mousedown",w,{capture:!0,passive:!1}),n.addEventListener("touchstart",w,{capture:!0,passive:!1}),n.addEventListener("click",R,{capture:!0,passive:!1}),n.addEventListener("keydown",v,{capture:!0,passive:!1}),n.addEventListener("keydown",A),l},P=function(){if(s.active)return n.removeEventListener("focusin",y,!0),n.removeEventListener("mousedown",w,!0),n.removeEventListener("touchstart",w,!0),n.removeEventListener("click",R,!0),n.removeEventListener("keydown",v,!0),n.removeEventListener("keydown",A),l},_=function(D){var H=D.some(function(X){var J=Array.from(X.removedNodes);return J.some(function(le){return le===s.mostRecentlyFocusedNode})});H&&E(f())},L=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(_):void 0,B=function(){L&&(L.disconnect(),s.active&&!s.paused&&s.containers.map(function(D){L.observe(D,{subtree:!0,childList:!0})}))};return l={get active(){return s.active},get paused(){return s.paused},activate:function(D){if(s.active)return this;var H=c(D,"onActivate"),X=c(D,"onPostActivate"),J=c(D,"checkCanFocusTrap");J||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=n.activeElement,H==null||H();var le=function(){J&&d(),C(),B(),X==null||X()};return J?(J(s.containers.concat()).then(le,le),this):(le(),this)},deactivate:function(D){if(!s.active)return this;var H=m0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},D);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,P(),s.active=!1,s.paused=!1,B(),y0.deactivateTrap(o,l);var X=c(H,"onDeactivate"),J=c(H,"onPostDeactivate"),le=c(H,"checkCanReturnFocus"),me=c(H,"returnFocus","returnFocusOnDeactivate");X==null||X();var fe=function(){b0(function(){me&&E(S(s.nodeFocusedBeforeActivation)),J==null||J()})};return me&&le?(le(S(s.nodeFocusedBeforeActivation)).then(fe,fe),this):(fe(),this)},pause:function(D){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,D)):this},unpause:function(D){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,D)):this},updateContainerElements:function(D){var H=[].concat(D).filter(Boolean);return s.containers=H.map(function(X){return typeof X=="string"?n.querySelector(X):X}),s.active&&d(),B(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(D,H){if(s.paused===D)return this;if(s.paused=D,D){var X=c(H,"onPause"),J=c(H,"onPostPause");X==null||X(),P(),B(),J==null||J()}else{var le=c(H,"onUnpause"),me=c(H,"onPostUnpause");le==null||le(),d(),C(),B(),me==null||me()}return this}}}),l.updateContainerElements(t),l};/*!
65
65
  * focus-trap-vue v4.0.2
66
66
  * (c) 2023 Eduardo San Martin Morote
67
67
  * @license MIT
68
- */function oB(e){return e}const V$={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object};Object.assign({active:{type:Boolean,default:!0}},V$);var z$=Object.defineProperty,T0=Object.getOwnPropertySymbols,W$=Object.prototype.hasOwnProperty,H$=Object.prototype.propertyIsEnumerable,A0=(e,t,r)=>t in e?z$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G$=(e,t)=>{for(var r in t||(t={}))W$.call(t,r)&&A0(e,r,t[r]);if(T0)for(var r of T0(t))H$.call(t,r)&&A0(e,r,t[r]);return e};const R0=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},K$={},Q$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},X$=he("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),Y$=[X$];function J$(e,t){return Z(),ve("svg",Q$,Y$)}const Z$=R0(K$,[["render",J$]]),e2={},t2={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},r2=he("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),n2=[r2];function i2(e,t){return Z(),ve("svg",t2,n2)}G$({},{Deselect:Z$,OpenIndicator:R0(e2,[["render",i2]])});const o2=["aria-label"],s2=Me({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=V(()=>["oc-spinner",`oc-spinner-${ii(e.size||"medium")}`]);return(r,n)=>(Z(),ve("span",{class:K.normalizeClass(t.value),"aria-label":r.ariaLabel,tabindex:"-1",role:"img"},null,10,o2))}}),a2={class:"oc-thead"},l2=Me({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,r)=>(Z(),ve("thead",a2,[Ge(t.$slots,"default")]))}}),c2=Me({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,r)=>(Z(),ve("tbody",null,[Ge(t.$slots,"default")]))}}),_0=({target:e,mode:t="show",rootMargin:r="100px",onVisibleCallback:n})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:ue(!0)};const i=ue(!1),s=new IntersectionObserver(l=>{const c=l.at(-1).isIntersecting;i.value=c,y(i)&&n&&n(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:r});return Et(e,()=>{s.observe(e.value)}),Gr(()=>s.disconnect()),{isVisible:i}},I0=Me({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const r=t,n=V(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(Z(),Ce(Hn(o.type),{class:K.normalizeClass(n.value),onClick:i[0]||(i[0]=s=>r("click",s))},{default:Te(()=>[Ge(o.$slots,"default")]),_:3},8,["class"]))}}),C0=Me({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,r)=>(Z(),Ce(I0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Te(()=>[Ge(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),F0=Me({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const r=t,n=Pd((l,c)=>{let u;return{get(){return l(),u},set(a){u=a,c()}}}),o=V(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?_0({...e.lazy,target:n,onVisibleCallback:()=>r("itemVisible")}):{isVisible:ue(!0)},s=V(()=>!y(i));return e.lazy||r("itemVisible"),(l,c)=>(Z(),ve("tr",{ref_key:"observerTarget",ref:n,onClick:c[0]||(c[0]=u=>l.$emit("click",u)),onContextmenu:c[1]||(c[1]=u=>l.$emit("contextmenu",u)),onDragstart:c[2]||(c[2]=u=>l.$emit("dragstart",u)),onDrop:c[3]||(c[3]=u=>l.$emit("drop",u)),onDragenter:c[4]||(c[4]=u=>l.$emit("dragenter",u)),onDragleave:c[5]||(c[5]=u=>l.$emit("dragleave",u)),onDragover:c[6]||(c[6]=u=>l.$emit("dragover",u)),onMouseleave:c[7]||(c[7]=u=>l.$emit("mouseleave",u))},[s.value?(Z(),Ce(C0,{key:0,colspan:o.value},{default:Te(()=>c[8]||(c[8]=[he("span",{class:"shimmer"},null,-1)])),_:1},8,["colspan"])):Ge(l.$slots,"default",{key:1})],544))}}),u2=Me({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,r)=>(Z(),Ce(I0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:r[0]||(r[0]=n=>t.$emit("click",n))},{default:Te(()=>[Ge(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),f2={key:0,class:"oc-table-thead-content"},d2=["textContent"],p2={key:1},h2={key:0,class:"oc-table-thead-content"},g2=["textContent"],m2={key:1,class:"oc-table-footer"},y2={class:"oc-table-footer-row"},b2=["colspan"],P0="asc",ed="desc",v2=Me({__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:[wf,Lb,kb,Nb,$b,Db,KF,"dropRowStyling","itemVisible"],setup(e,{emit:t}){const r=t,n={EVENT_THEAD_CLICKED:kb,EVENT_TROW_CLICKED:Nb,EVENT_TROW_MOUNTED:$b,EVENT_TROW_CONTEXTMENU:Db},{$gettext:o}=Ne.useGettext(),i=B=>e.itemDomSelector?e.itemDomSelector(B):B[e.idKey],s=V(()=>{const B=["oc-table"];return e.hover&&B.push("oc-table-hover"),e.sticky&&B.push("oc-table-sticky"),B}),l=V(()=>e.fields.length),c=B=>{B.preventDefault()},u=(B,$)=>{r(Lb,B,$)},a=(B,$)=>{r(wf,B,$)},f=(B,$,D)=>{r("dropRowStyling",B,$,D)},d=B=>B.type==="slot",b=B=>["callback","function"].indexOf(B.type)>=0,E=B=>Object.prototype.hasOwnProperty.call(B,"title")?B.title:B.name,w=()=>({class:s.value}),R=(B,$)=>{const D=g(B);return D.class=`oc-table-header-cell oc-table-header-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"thClass")&&(D.class+=` ${B.thClass}`),e.sticky&&(D.style=`top: ${e.headerPosition}px;`),$===0&&(D.class+=` oc-pl-${ii(e.paddingX)} `),$===e.fields.length-1&&(D.class+=` oc-pr-${ii(e.paddingX)}`),C(D,B),D},S=(B,$)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(B)||$}`,v(B)?"oc-table-highlighted":void 0,T(B)?"oc-table-disabled":void 0].filter(Boolean)}),m=(B,$,D)=>{const H=g(B);return H.class=`oc-table-data-cell oc-table-data-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"tdClass")&&(H.class+=` ${B.tdClass}`),Object.prototype.hasOwnProperty.call(B,"wrap")&&(H.wrap=B.wrap),$===0&&(H.class+=` oc-pl-${ii(e.paddingX)} `),$===e.fields.length-1&&(H.class+=` oc-pr-${ii(e.paddingX)}`),Object.prototype.hasOwnProperty.call(B,"accessibleLabelCallback")&&(H["aria-label"]=B.accessibleLabelCallback(D)),H},g=B=>({...(B==null?void 0:B.alignH)&&{alignH:B.alignH},...(B==null?void 0:B.alignV)&&{alignV:B.alignV},...(B==null?void 0:B.width)&&{width:B.width},class:void 0,wrap:void 0,style:void 0}),v=B=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(B[e.idKey])>-1:e.highlighted===B[e.idKey]:!1,T=B=>e.disabled.length?e.disabled.indexOf(B[e.idKey])>-1:!1,A=(B,$,D)=>{const H=[D[e.idKey],$+1].filter(Boolean);return d(B)?[...H,B.name].join("-"):b(B)?[...H,B.callback(D[B.name])].join("-"):[...H,D[B.name]].join("-")},F=B=>o("Sort by %{ name }",{name:B}),C=(B,$)=>{if(!I($))return;let D="none";e.sortBy===$.name&&(D=e.sortDir===P0?"ascending":"descending"),B["aria-sort"]=D},I=({sortable:B})=>!!B,L=B=>{if(!I(B))return;let $=e.sortDir;e.sortBy===B.name&&e.sortDir!==void 0&&($=e.sortDir===ed?P0:ed),(e.sortBy!==B.name||e.sortDir===void 0)&&($=B.sortDir||ed),r("sort",{sortBy:B.name,sortDir:$})};return(B,$)=>{const D=pe("oc-icon");return Z(),ve("table",Yt(w(),{class:"has-item-context-menu"}),[B.hasHeader?(Z(),Ce(l2,{key:0},{default:Te(()=>[we(F0,{class:"oc-table-header-row"},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(B.fields,(H,ee)=>(Z(),Ce(u2,Yt({key:`oc-thead-${H.name}`,ref_for:!0},R(H,ee)),{default:Te(()=>[H.sortable?(Z(),Ce(f$,{key:0,"aria-label":F(H.name),appearance:"raw",class:"oc-button-sort oc-width-1-1",onClick:J=>L(H)},{default:Te(()=>[H.headerType==="slot"?(Z(),ve("span",f2,[Ge(B.$slots,H.name+"Header")])):(Z(),ve("span",{key:1,class:"oc-table-thead-content header-text",textContent:K.toDisplayString(E(H))},null,8,d2)),we(D,{name:B.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:K.normalizeClass({"oc-invisible-sr":B.sortBy!==H.name}),size:"small",variation:"passive"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(Z(),ve("div",p2,[H.headerType==="slot"?(Z(),ve("span",h2,[Ge(B.$slots,H.name+"Header")])):(Z(),ve("span",{key:1,class:"oc-table-thead-content header-text",textContent:K.toDisplayString(E(H))},null,8,g2))]))]),_:2},1040))),128))]),_:3})]),_:3})):ke("",!0),we(c2,{class:"has-item-context-menu"},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(B.data,(H,ee)=>(Z(),Ce(F0,Yt({key:`oc-tbody-tr-${i(H)||ee}`,ref_for:!0,ref:`row-${ee}`},S(H,ee),{"data-item-id":H[B.idKey],draggable:B.dragDrop,onClick:J=>B.$emit(n.EVENT_TROW_CLICKED,[H,J]),onContextmenu:J=>B.$emit(n.EVENT_TROW_CONTEXTMENU,B.$refs[`row-${ee}`][0],J,H),onVnodeMounted:J=>B.$emit(n.EVENT_TROW_MOUNTED,H,B.$refs[`row-${ee}`][0]),onDragstart:J=>u(H,J),onDrop:J=>a(i(H),J),onDragenter:Tr(J=>f(i(H),!1,J),["prevent"]),onDragleave:Tr(J=>f(i(H),!0,J),["prevent"]),onMouseleave:J=>f(i(H),!0,J),onDragover:$[0]||($[0]=J=>c(J)),onItemVisible:J=>B.$emit("itemVisible",H)}),{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(B.fields,(J,ce)=>(Z(),Ce(C0,Yt({key:"oc-tbody-td-"+A(J,ce,H),ref_for:!0},m(J,ce,H)),{default:Te(()=>[d(J)?Ge(B.$slots,J.name,{key:0,item:H}):b(J)?(Z(),ve(Ye,{key:1},[Bt(K.toDisplayString(J.callback(H[J.name])),1)],64)):(Z(),ve(Ye,{key:2},[Bt(K.toDisplayString(H[J.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),B.$slots.footer?(Z(),ve("tfoot",m2,[he("tr",y2,[he("td",{colspan:l.value,class:"oc-table-footer-cell"},[Ge(B.$slots,"footer")],8,b2)])])):ke("",!0)],16)}}}),w2=850,S2=Me({components:{ContextMenuQuickAction:Qf,ResourceGhostElement:Xf,ResourceListItem:Oo,ResourceSize:f0,OcTable:v2,OcSpinner:s2},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>ie.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Gt.defaultModeName,validator:e=>[Gt.name.condensedTable,Gt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Ft.Asc.toString(),Ft.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Df,"update:selectedIds","update:modelValue"],setup(e,t){const r=We(),n=tr(),{getMatchingSpace:o}=ar(),{canBeOpenedWithSecureView:i}=Vf(),s=ai({space:ue(e.space),targetRouteCallback:V(()=>e.targetRouteCallback)}),{isSticky:l}=jf(),{isLocationPicker:c,isFilePicker:u,postMessage:a,isEnabled:f,fileTypes:d}=ni(),{getDefaultAction:b}=qr(),E=at(),{options:w}=Qe.storeToRefs(E),R=_o(),{resources:S,action:m}=Qe.storeToRefs(R),g=Yn(),{userContextReady:v}=Qe.storeToRefs(g),T=Ke(),{areFileExtensionsShown:A,latestSelectedId:F,deleteQueue:C}=Qe.storeToRefs(T),I=ue(),L=ue(),B=ue(),{width:$}=Mn.useWindowSize(),D=V(()=>n.filesTags&&$.value>=w2),{actions:H}=aa(),{actions:ee}=zv(),J=V(()=>y(H)[0].handler),ce=V(()=>y(ee)[0].handler),be=Q=>Q.length>7?Q:"",de=Q=>{var x;return y(f)&&((x=y(d))!=null&&x.length)?!y(d).includes(Q.extension)&&!y(d).includes(Q.mimeType)&&!Q.isFolder:Q.processing===!0||oe(Q.id)},Se=V(()=>{var Q,x;return((x=(Q=e.resources)==null?void 0:Q.filter(k=>de(k)===!0))==null?void 0:x.map(k=>k.id))||[]}),Ae=Q=>!e.areResourcesClickable||ie.isProjectSpaceResource(Q)&&Q.disabled||!Q.isFolder&&(!Q.canDownload()&&!i(Q)||y(f)&&!y(u))?!1:!y(Se).includes(Q.id),ne=Q=>{Xe.publish("app.files.list.clicked"),t.emit("update:selectedIds",Q)},ae=Q=>{T.toggleSelection(Q),ne(T.selectedIds)},le=Q=>{if(Q.isFolder)return s.getFolderLink(Q);let x=e.space;x||(x=o(Q));const k=b({resources:[Q],space:x});if(k!=null&&k.route)return k.route({space:x,resources:[Q]})},oe=Q=>y(C).includes(Q);return{router:r,configOptions:w,dragItem:I,ghostElement:L,contextMenuButton:B,getTagToolTip:be,renameActions:H,renameActionsSpace:ee,renameHandler:J,renameHandlerSpace:ce,FolderViewModeConstants:Gt,hasTags:D,disabledResources:Se,isResourceDisabled:de,userContextReady:v,getMatchingSpace:o,clipboardResources:S,clipboardAction:m,...fa({space:ue(e.space),targetRouteCallback:V(()=>e.targetRouteCallback)},t),...s,postMessage:a,isFilePicker:u,isLocationPicker:c,isEmbedModeEnabled:f,emitSelect:ne,toggleSelection:ae,areFileExtensionsShown:A,latestSelectedId:F,isResourceClickable:Ae,getResourceLink:le,isSticky:l,isResourceInDeleteQueue:oe}},data(){return{constants:{ImageDimension:Vr,EVENT_TROW_MOUNTED:_v}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const r=Sh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"status",prop:"disabled",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.mdate)+" ("+this.formatDate(n.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.sdate)+" ("+this.formatDate(n.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.ddate)+" ("+this.formatDate(n.ddate)+")"}].filter(n=>{if(n.name==="tags"&&!this.hasTags)return!1;let o;return n.prop?o=Pl(e,n.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,n.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(n.name):o}).map(n=>{const o=r.find(i=>i.name===n.name);return o&&Object.assign(n,{sortable:o.sortable,sortDir:o.sortDir}),n})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ti.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var r;const t=(r=y(this.router.currentRoute).query)==null?void 0:r.term;return Ai("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return ie.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length},openRenameDialog(e){if(ie.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Xe.publish(mt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Xe.publish(mt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Df,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,r){var s,l;if((((s=r.dataTransfer)==null?void 0:s.types)||[]).some(c=>c==="Files")||(l=r.currentTarget)!=null&&l.contains(r.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:r,event:n}=e;(r==null?void 0:r.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),To(r.tippy,n,this.contextMenuButton))},showContextMenu(e,t,r){if(t.preventDefault(),this.isResourceDisabled(r))return!1;const n=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];n!==void 0&&(this.isResourceSelected(r)||this.emitSelect([r.id]),To(n._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,l;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(Js(y(this.router.currentRoute))))});const r=e[1],n=e[2]??!1,o=(r==null?void 0:r.target).getAttribute("type")==="checkbox";if(((l=(s=r==null?void 0:r.target)==null?void 0:s.closest("div"))==null?void 0:l.id)!=="oc-files-context-menu"){if(r&&r.metaKey)return Xe.publish("app.files.list.clicked.meta",t);if(r&&r.shiftKey)return Xe.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:n});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return Sb(new Date(e),this.$language.current)},formatDateRelative(e){return Tb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!ie.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),r=e.sharedWith.filter(({shareType:n})=>ie.ShareTypes.authenticated.includes(ie.ShareTypes.getByValue(n))).length;return r?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",r,{resourceType:t,shareCount:r.toString()}):""},getSharedByAvatarDescription(e){if(!ie.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:r})=>r).join(", ")})},getSharedByAvatarItems(e){return ie.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,shareType:ie.ShareTypes.user.value,username:t.id})):[]},getSharedWithAvatarItems(e){return ie.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>ie.ShareTypes.authenticated.includes(ie.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,shareType:t.shareType,username:t.id})):[]}}}),E2={class:"resource-table-select-all"},T2={class:"oc-text-truncate"},A2=["textContent"],R2=["textContent"],_2=["textContent"],I2={key:0,class:"resource-table-actions"};function C2(e,t,r,n,o,i){const s=pe("oc-checkbox"),l=pe("oc-spinner"),c=pe("resource-list-item"),u=pe("oc-icon"),a=pe("oc-button"),f=pe("resource-size"),d=pe("oc-tag"),b=pe("oc-status-indicators"),E=pe("oc-avatars"),w=pe("context-menu-quick-action"),R=pe("oc-table"),S=pe("resource-ghost-element"),m=or("oc-tooltip");return Z(),ve(Ye,null,[we(R,Yt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&e.isSideBarOpen,"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&e.isSideBarOpen}],data:e.resources,fields:e.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=g=>e.$emit("update:modelValue",g))}),Yd({name:Te(({item:g})=>[he("div",{class:K.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(g)}]])},[Ge(e.$slots,"image",{resource:g}),(Z(),Ce(c,{key:`${g.path}-${e.resourceDomSelector(g)}-${g.thumbnail}`,resource:g,"path-prefix":e.getPathPrefix(g),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(g),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(g),link:e.getResourceLink(g),"parent-folder-link":e.getParentFolderLink(g),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(g),class:K.normalizeClass({"resource-table-resource-cut":e.isResourceCut(g)}),onClick:v=>e.emitFileClick(g)},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),e.hasRenameAction(g)?(Z(),Ce(a,{key:0,class:"resource-table-edit-name",appearance:"raw",onClick:v=>e.openRenameDialog(g)},{default:Te(()=>[we(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):ke("",!0)],2),Ge(e.$slots,"additionalResourceContent",{resource:g})]),syncEnabled:Te(({item:g})=>[Ge(e.$slots,"syncEnabled",{resource:g})]),size:Te(({item:g})=>[we(f,{size:g.size||Number.NaN},null,8,["size"])]),tags:Te(({item:g})=>[(Z(!0),ve(Ye,null,Lt(g.tags.slice(0,2),v=>(Z(),Ce(Hn(e.userContextReady?"router-link":"span"),Yt({key:v,ref_for:!0},e.getTagComponentAttrs(v),{class:"resource-table-tag-wrapper"}),{default:Te(()=>[ot((Z(),Ce(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Te(()=>[we(u,{name:"price-tag-3",size:"small"}),he("span",T2,K.toDisplayString(v),1)]),_:2},1024)),[[m,e.getTagToolTip(v)]])]),_:2},1040))),128)),g.tags.length>2?(Z(),Ce(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Te(()=>[Bt(" + "+K.toDisplayString(g.tags.length-2),1)]),_:2},1032,["onClick"])):ke("",!0)]),manager:Te(({item:g})=>[Ge(e.$slots,"manager",{resource:g})]),members:Te(({item:g})=>[Ge(e.$slots,"members",{resource:g})]),totalQuota:Te(({item:g})=>[Ge(e.$slots,"totalQuota",{resource:g})]),usedQuota:Te(({item:g})=>[Ge(e.$slots,"usedQuota",{resource:g})]),remainingQuota:Te(({item:g})=>[Ge(e.$slots,"remainingQuota",{resource:g})]),mdate:Te(({item:g})=>[ot(he("span",{tabindex:"0",textContent:K.toDisplayString(e.formatDateRelative(g.mdate))},null,8,A2),[[m,e.formatDate(g.mdate)]])]),indicators:Te(({item:g})=>[g.indicators.length?(Z(),Ce(b,{key:0,resource:g,indicators:g.indicators,"disable-handler":e.isResourceDisabled(g)},null,8,["resource","indicators","disable-handler"])):ke("",!0)]),status:Te(({item:g})=>[ot(we(u,{name:g.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[m,g.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Te(({item:g})=>[ot(he("span",{tabindex:"0",textContent:K.toDisplayString(e.formatDateRelative(g.sdate))},null,8,R2),[[m,e.formatDate(g.sdate)]])]),ddate:Te(({item:g})=>[ot(he("p",{tabindex:"0",class:"oc-m-rm",textContent:K.toDisplayString(e.formatDateRelative(g.ddate))},null,8,_2),[[m,e.formatDate(g.ddate)]])]),sharedBy:Te(({item:g})=>[we(a,{appearance:"raw-inverse",variation:"passive",class:"resource-table-shared-by",onClick:v=>e.openSharingSidebar(g)},{default:Te(()=>[we(E,{class:"resource-table-people",items:e.getSharedByAvatarItems(g),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(g)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Te(({item:g})=>[we(a,{appearance:"raw-inverse",variation:"passive",class:"resource-table-shared-with",onClick:v=>e.openSharingSidebar(g)},{default:Te(()=>[we(E,{class:"resource-table-people",items:e.getSharedWithAvatarItems(g),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(g)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Te(({item:g})=>[e.isResourceDisabled(g)?ke("",!0):(Z(),ve("div",I2,[Ge(e.$slots,"quickActions",{resource:g}),we(w,{ref:"contextMenuButton",item:g,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:v=>e.showContextMenuOnBtnClick(v,g)},{contextMenu:Te(()=>[Ge(e.$slots,"contextMenu",{resource:g})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Te(()=>[he("div",E2,[ot(we(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:Tr(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[m,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Te(({item:g})=>[e.isResourceInDeleteQueue(g.id)?(Z(),Ce(l,{key:0,class:"resource-table-activity-indicator",size:"medium"})):(Z(),Ce(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(g)}`,label:e.getResourceCheckboxLabel(g),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(g),"model-value":e.isResourceSelected(g),outline:e.isLatestSelectedItem(g),onClick:Tr(v=>e.toggleSelection(g.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Te(()=>[Ge(e.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(Z(),Ce(Wd,{key:0,to:"body"},[we(S,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):ke("",!0)],64)}const F2=Ue(S2,[["render",C2]]),P2=Me({name:"ResourceTile",components:{ResourceListItem:Oo,ResourceIcon:xo,ResourceLink:Lf},props:{resource:{type:Object,default:()=>({})},resourceRoute:{type:Object,required:!1,default:null},isResourceSelected:{type:Boolean,required:!1,default:!1},isResourceClickable:{type:Boolean,required:!1,default:!0},isResourceDisabled:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{type:String,default:"xlarge",validator:e=>["large","xlarge","xxlarge","xxxlarge"].includes(e)},lazy:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const{$gettext:r}=Ne.useGettext(),n=Pd((f,d)=>{let b;return{get(){return f(),b},set(E){b=E,d()}}}),o=V(()=>e.resource.locked||e.resource.processing),i=V(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),s=V(()=>e.resource.locked?r("This item is locked"):null),l=V(()=>ie.isSpaceResource(e.resource)?e.resource.description:""),c=f=>f.thumbnail,{isVisible:u}=e.lazy?_0({target:n,onVisibleCallback:()=>t("itemVisible")}):{isVisible:ue(!0)},a=V(()=>!y(u));return e.lazy||t("itemVisible"),{statusIconAttrs:i,showStatusIcon:o,tooltipLabelIcon:s,resourceDescription:l,shouldDisplayThumbnails:c,isProjectSpaceResource:ie.isProjectSpaceResource,isHidden:a,observerTarget:n}}}),x2=["data-item-id"],O2={key:0,class:"oc-tile-card-lazy-shimmer"},k2={class:"oc-tile-card-selection"},N2=["textContent"],$2=["aria-label"],D2={class:"oc-card-body oc-p-s"},L2={class:"oc-flex oc-flex-between oc-flex-middle"},B2={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},M2={class:"oc-flex oc-flex-middle"},j2={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},U2=["textContent"];function q2(e,t,r,n,o,i){const s=pe("oc-tag"),l=pe("oc-image"),c=pe("oc-icon"),u=pe("resource-icon"),a=pe("resource-link"),f=pe("resource-list-item"),d=or("oc-tooltip");return Z(),ve("div",{ref:"observerTarget",class:K.normalizeClass(["oc-tile-card oc-card oc-card-default oc-rounded",{"oc-tile-card-selected":e.isResourceSelected,"oc-tile-card-disabled":e.isResourceDisabled&&!e.isProjectSpaceResource(e.resource),"state-trashed":e.isResourceDisabled&&e.isProjectSpaceResource(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:t[2]||(t[2]=b=>e.$emit("contextmenu",b))},[e.isHidden?(Z(),ve("div",O2)):(Z(),ve(Ye,{key:1},[we(a,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:t[0]||(t[0]=b=>e.$emit("click"))},{default:Te(()=>[he("div",k2,[Ge(e.$slots,"selection",{item:e.resource})]),e.isResourceDisabled&&e.isProjectSpaceResource(e.resource)?(Z(),Ce(s,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Te(()=>[he("span",{textContent:K.toDisplayString(e.$gettext("Disabled"))},null,8,N2)]),_:1})):ke("",!0),ot((Z(),ve("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":e.tooltipLabelIcon},[t[3]||(t[3]=he("div",{class:"oc-tile-card-hover"},null,-1)),Ge(e.$slots,"imageField",{item:e.resource},()=>[e.shouldDisplayThumbnails(e.resource)?(Z(),Ce(l,{key:0,class:"tile-preview",src:e.resource.thumbnail},null,8,["src"])):(Z(),Ce(u,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image oc-pt-xs"},Yd({_:2},[e.showStatusIcon?{name:"status",fn:Te(()=>[we(c,Yt(e.statusIconAttrs,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,$2)),[[d,e.tooltipLabelIcon]])]),_:3},8,["resource","link","is-resource-clickable"]),he("div",D2,[he("div",L2,[he("div",B2,[we(f,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,link:e.resourceRoute,onClick:t[1]||(t[1]=b=>e.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),he("div",M2,[Ge(e.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ge(e.$slots,"actions",{item:e.resource}),Ge(e.$slots,"contextMenu",{item:e.resource})])]),e.resourceDescription?(Z(),ve("p",j2,[he("small",{textContent:K.toDisplayString(e.resourceDescription)},null,8,U2)])):ke("",!0)])],64))],42,x2)}const x0=Ue(P2,[["render",q2]]),V2=Me({name:"ResourceTiles",components:{ContextMenuQuickAction:Qf,ResourceGhostElement:Xf,ResourceTile:x0},props:{resources:{type:Array,default:()=>[]},selectedIds:{type:Array,default:()=>[]},targetRouteCallback:{type:Function,required:!1,default:void 0},space:{type:Object,required:!1,default:null},sortFields:{type:Array,default:()=>[]},sortBy:{type:String,required:!1,default:void 0},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Ft.Asc.toString(),Ft.Desc.toString()].includes(e)},viewSize:{type:Number,required:!1,default:()=>Gt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileClick","fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,t){const{$gettext:r}=Ne.useGettext(),n=We(),o=Ke(),{getDefaultAction:i}=qr(),{getMatchingSpace:s}=ar(),{canBeOpenedWithSecureView:l}=Vf(),{emit:c}=t,{isEnabled:u,fileTypes:a,isLocationPicker:f,isFilePicker:d,postMessage:b}=ni(),E=zf(),w=V(()=>Math.min(y(E),e.viewSize)),R=V(()=>o.areFileExtensionsShown),S=V(()=>y(je)?r("Clear selection"):r("Select all")),m=ue(),g=ue(),v=ue({tiles:{},dropBtns:{}}),T=fa({space:ue(e.space),targetRouteCallback:V(()=>e.targetRouteCallback)},t),A=te=>{if(ie.isSpaceResource(te))return te.disabled?null:xr("files-spaces-generic",Jr(te,{path:"",fileId:te.fileId}));if(te.isFolder)return T.createFolderLink({path:te.path,fileId:te.fileId,resource:te});let Le=e.space;Le||(Le=s(te));const qe=i({resources:[te],space:Le});return qe!=null&&qe.route?qe.route({space:Le,resources:[te]}):null},F=te=>{if(y(u)&&y(d))return b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(te)),locationQuery:JSON.parse(JSON.stringify(Js(y(n.currentRoute))))});te.type!=="space"&&te.type!=="folder"&&T.createFileAction(te)},C=(te,Le,qe)=>{const{dropdown:ze,event:Ze}=te;(ze==null?void 0:ze.tippy)!==void 0&&(o.setSelection([Le.id]),To(ze.tippy,Ze,y(v).dropBtns[qe]))},I=te=>e.selectedIds.includes(te.id),L=V(()=>e.resources.filter(te=>e.selectedIds.includes(te.id))),B=te=>$(te)?!1:te.isFolder?!0:!(!te.canDownload()&&!l(te)||y(u)&&!y(d)),$=te=>{var Le;return y(u)&&((Le=y(a))!=null&&Le.length)?!y(a).includes(te.extension)&&!y(a).includes(te.mimeType)&&!te.isFolder:ie.isSpaceResource(te)&&te.disabled?!0:te.processing===!0},D=V(()=>{var te,Le;return((Le=(te=e.resources)==null?void 0:te.filter(qe=>$(qe)===!0))==null?void 0:Le.map(qe=>qe.id))||[]}),H=te=>{c("update:selectedIds",te)},ee=()=>{if(y(je))return c("update:selectedIds",[]);c("update:selectedIds",e.resources.filter(te=>!y(D).includes(te.id)).map(te=>te.id))},J=(te,Le,qe)=>{var Ze;te.preventDefault();const ze=(Ze=y(v).tiles[Le.id])==null?void 0:Ze.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];ze!==void 0&&(I(Le)||H([Le.id]),To(ze._tippy,te,qe))},ce=te=>{const Le=te[0],qe=te[1];if(qe&&qe.metaKey)return Xe.publish("app.files.list.clicked.meta",Le);if(qe&&qe.shiftKey)return Xe.publish("app.files.list.clicked.shift",{resource:Le,skipTargetSelection:!1});be(Le)},be=te=>{const Le=I(te)?e.selectedIds.filter(qe=>qe!==te.id):[...e.selectedIds,te.id];t.emit("update:selectedIds",Le)},de=te=>{switch(te.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},Se=V(()=>e.sortFields.find(te=>te.name===e.sortBy&&te.sortDir===e.sortDir)||e.sortFields[0]),Ae=te=>{t.emit("sort",{sortBy:te.name,sortDir:te.sortDir})},ne=te=>y(Se)===te,ae=V(()=>{const te={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Le=y(w);return te[Le]??"xxlarge"});aS(()=>{v.value={tiles:{},dropBtns:{}}});const le=(te,Le,qe)=>{var vt,et;if((((vt=qe.dataTransfer)==null?void 0:vt.types)||[]).some(Ut=>Ut==="Files")||(et=qe.currentTarget)!=null&&et.contains(qe.relatedTarget)||e.selectedIds.includes(te.id)||te.type!=="folder")return;const Ze=y(v).tiles[te.id];if(Le){Ze.$el.classList.remove("oc-tiles-item-drop-highlight");return}Ze.$el.classList.add("oc-tiles-item-drop-highlight")},oe=V(()=>e.selectedIds.filter(te=>te!==y(m).id)),Q=async(te,Le)=>{m.value=te,await Hr(),y(g).$el.ariaHidden="true",y(g).$el.style.left="-99999px",y(g).$el.style.top="-99999px",Le.dataTransfer.setDragImage(y(g).$el,0,0),Le.dataTransfer.dropEffect="move",Le.dataTransfer.effectAllowed="move"},x=async(te,Le)=>{I(te)||be(te),await Q(te,Le)},k=(te,Le)=>{(Le.dataTransfer.types||[]).some(ze=>ze==="Files")||(m.value=null,le(te,!0,Le),t.emit("fileDropped",te.id))},X=te=>te.indicators.filter(Le=>Le.category==="system"),W=ue(0),U=()=>{const te=document.getElementById("tiles-view"),Le=getComputedStyle(te),qe=parseInt(Le.getPropertyValue("padding-left"),10)|0,ze=parseInt(Le.getPropertyValue("padding-right"),10)|0;W.value=te.clientWidth-qe-ze},z=V(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:fe}=Jv(),_e=V(()=>{const te=[...Array(Gt.tilesSizeMax).keys()].map(Le=>Le+1);return[...new Set(te.map(Le=>{const qe=fe(Le);return qe?Math.round(y(W)/(qe+y(z))):0}))]}),Be=V(()=>{const te=y(_e);return te.length<y(w)?te[te.length-1]:te[y(w)-1]}),Fe=V(()=>{const te=y(Be)?e.resources.length%y(Be):0;return te?y(Be)-te:0}),Pe=V(()=>y(W)/y(Be)-y(z)),je=V(()=>{const te=y(D).length===e.resources.length,Le=y(L).length===e.resources.length-y(D).length;return!te&&Le});return Et(Pe,te=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${te}px`)},{immediate:!0}),Et(_e,te=>{E.value=Math.max(te.length,1)}),Vt(()=>{window.addEventListener("resize",U),U()}),Gr(()=>{window.removeEventListener("resize",U)}),{areFileExtensionsShown:R,emitTileClick:F,getRoute:A,showContextMenuOnBtnClick:C,showContextMenu:J,tileRefs:v,isResourceSelected:I,toggleTile:ce,toggleSelection:be,getResourceCheckboxLabel:de,selectSorting:Ae,isSortFieldSelected:ne,isResourceClickable:B,currentSortField:Se,resourceIconSize:ae,ghostElementRef:g,dragItem:m,dragStart:x,dragSelection:oe,fileDropped:k,setDropStyling:le,ghostTilesCount:Fe,getIndicators:X,isFilePicker:d,isLocationPicker:f,isResourceDisabled:$,isSpaceResource:ie.isSpaceResource,areAllResourcesSelected:je,disabledResourceIds:D,toggleSelectionAll:ee,selectAllCheckboxLabel:S}},data(){return{ImageDimension:Vr}}}),z2={id:"tiles-view",class:"oc-px-m oc-pt-l"},W2={class:"oc-flex oc-flex-middle oc-mb-m oc-pb-s oc-tiles-controls"},H2={key:0,class:"oc-tile-sorting oc-ml-m"},G2={class:"oc-tiles-footer"};function K2(e,t,r,n,o,i){const s=pe("oc-checkbox"),l=pe("oc-select"),c=pe("oc-status-indicators"),u=pe("context-menu-quick-action"),a=pe("resource-tile"),f=pe("oc-list"),d=pe("resource-ghost-element"),b=or("oc-tooltip");return Z(),ve("div",z2,[he("div",W2,[ot(we(s,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:e.selectAllCheckboxLabel,"label-hidden":!0,disabled:e.resources.length===e.disabledResourceIds.length,"model-value":e.areAllResourcesSelected,onClick:Tr(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[b,e.selectAllCheckboxLabel]]),e.sortFields.length?(Z(),ve("div",H2,[we(l,{class:"oc-tiles-sort-select oc-flex oc-flex-middle","model-value":e.currentSortField,label:e.$gettext("Sort by"),options:e.sortFields,clearable:!1,searchable:!1,"position-fixed":!0,"onUpdate:modelValue":e.selectSorting},null,8,["model-value","label","options","onUpdate:modelValue"])])):ke("",!0)]),we(f,{class:"oc-tiles"},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(e.resources,E=>(Z(),ve("li",{key:E.id,class:"oc-tiles-item has-item-context-menu"},[we(a,{ref_for:!0,ref:w=>e.tileRefs.tiles[E.id]=w,resource:E,"resource-route":e.getRoute(E),"is-resource-selected":e.isResourceSelected(E),"is-resource-clickable":e.isResourceClickable(E),"is-resource-disabled":e.isResourceDisabled(E),"is-extension-displayed":e.areFileExtensionsShown,"resource-icon-size":e.resourceIconSize,draggable:e.dragDrop,lazy:e.lazy,onVnodeMounted:w=>e.$emit("rowMounted",E,e.tileRefs.tiles[E.id],e.ImageDimension.Tile),onContextmenu:w=>e.showContextMenu(w,E,e.tileRefs.tiles[E.id]),onClick:w=>e.emitTileClick(E),onDragstart:w=>e.dragStart(E,w),onDragenter:Tr(w=>e.setDropStyling(E,!1,w),["prevent"]),onDragleave:Tr(w=>e.setDropStyling(E,!0,w),["prevent"]),onDrop:w=>e.fileDropped(E,w),onDragover:t[0]||(t[0]=w=>w.preventDefault()),onItemVisible:w=>e.$emit("itemVisible",E)},{selection:Te(()=>[!e.isLocationPicker&&!e.isFilePicker?(Z(),Ce(s,{key:0,label:e.getResourceCheckboxLabel(E),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:!e.isSpaceResource(E)&&e.isResourceDisabled(E),"model-value":e.isResourceSelected(E),onClick:Tr(w=>e.toggleTile([E,w]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):ke("",!0)]),imageField:Te(()=>[Ge(e.$slots,"image",{resource:E})]),indicators:Te(()=>[e.getIndicators(E).length?(Z(),Ce(c,{key:0,resource:E,indicators:e.getIndicators(E),"disable-handler":!e.isSpaceResource(E)&&e.isResourceDisabled(E)},null,8,["resource","indicators","disable-handler"])):ke("",!0)]),actions:Te(()=>[Ge(e.$slots,"actions",{resource:E})]),contextMenu:Te(()=>[e.isSpaceResource(E)||!e.isResourceDisabled(E)?(Z(),Ce(u,{key:0,ref_for:!0,ref:w=>e.tileRefs.dropBtns[E.id]=w,item:E,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:w=>e.showContextMenuOnBtnClick(w,E,E.id)},{contextMenu:Te(()=>[Ge(e.$slots,"contextMenu",{resource:E})]),_:2},1032,["item","onQuickActionClicked"])):ke("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(Z(!0),ve(Ye,null,Lt(e.ghostTilesCount,E=>(Z(),ve("li",{key:`ghost-tile-${E}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),e.dragItem?(Z(),Ce(Wd,{key:0,to:"body"},[we(d,{ref:"ghostElementRef","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):ke("",!0),he("div",G2,[Ge(e.$slots,"footer")])])}const Q2=Ue(V2,[["render",K2]]),X2=Me({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:r}){const n=We(),{current:o}=Ne.useGettext(),i=Jt(),s=ue(),l=ue(e.items),c=ue(),u=ue(),a=ue(!1),f=ue(),d=`q_${e.filterName}`,b=rr(d),E=$=>$[e.idAttribute],w=()=>n.push({query:{...$i(y(i).query,[d]),...y(s)&&{[d]:E(y(s))}}}),R=$=>y(s)&&E(y(s))===E($),S=()=>{c.value=void 0,u.value=void 0},m=async $=>{S(),R($)?s.value=void 0:(s.value=$,y(f).hideDrop()),await w(),t("selectionChange",y(s))},g=()=>{s.value=void 0,a.value=!1,S(),t("selectionChange",y(s)),w()},v=()=>{l.value=e.items},T=()=>{a.value=!1},A=()=>{const $=St(y(b));if(!$)return;const D=e.items.find(H=>E(H)===$);if(D){s.value=D;return}if(y(F)){const H=$.replace("range:",""),ee=Number(H.split(" - ")[0]),J=Number(H.split(" - ")[1]);c.value=$t.DateTime.fromMillis(ee),u.value=$t.DateTime.fromMillis(J),s.value=y(I)}},F=V(()=>{var $;return($=St(y(b)))==null?void 0:$.startsWith("range:")}),C=V(()=>!y(c)||!y(u)?!1:y(c)<=y(u)),I=V(()=>{if(!y(c)||!y(u))return null;const $=ri(y(c),o,$t.DateTime.DATE_SHORT),D=ri(y(u),o,$t.DateTime.DATE_SHORT),H=y(c).toMillis(),ee=y(u).toMillis();return{[e.idAttribute]:`range:${H} - ${ee}`,[e.displayNameAttribute]:`${$} - ${D}`}}),L=async()=>{s.value=y(I),await w(),y(f).hideDrop(),t("selectionChange",y(s))},B=({date:$,error:D},H)=>{if(D){console.error(D);return}const ee=H==="from"?c:u;if(!$){ee.value=void 0;return}const J=H==="from"?$.startOf("day"):$.endOf("day");ee.value=J};return r({setSelectedItemsBasedOnQuery:A}),Vt(()=>{A()}),{clearFilter:g,displayedItems:l,isItemSelected:R,selectedItem:s,onShowDrop:v,onHideDrop:T,filterChip:f,toggleItemSelection:m,setSelectedItemsBasedOnQuery:A,fromDate:c,toDate:u,dateRangeValid:C,applyDateRangeFilter:L,dateRangeApplied:F,setDateRangeDate:B,dateRangeClicked:a,queryParam:d}}}),Y2={class:"oc-flex oc-flex-middle oc-text-truncate"},J2={class:"oc-text-truncate oc-ml-s"},Z2={class:"oc-flex"},eD={class:"oc-my-xs"},tD={class:"oc-flex oc-flex-middle oc-text-truncate"},rD={class:"oc-text-truncate oc-ml-s"},nD=["textContent"],iD={class:"oc-flex"},oD={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},sD=["textContent"],aD={class:"oc-mt-s"},lD={class:"date-filter-apply-btn"};function cD(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-button"),c=pe("oc-list"),u=pe("oc-datepicker"),a=pe("oc-filter-chip");return Z(),ve("div",{class:K.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[we(a,{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:Te(()=>[we(c,{class:K.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(e.displayedItems,(f,d)=>(Z(),ve("li",{key:d,class:"oc-my-xs"},[we(l,{class:K.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:b=>e.toggleItemSelection(f)},{default:Te(()=>[he("div",Y2,[he("div",J2,[Ge(e.$slots,"item",{item:f})])]),he("div",Z2,[e.isItemSelected(f)?(Z(),Ce(s,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),he("li",eD,[we(l,{class:K.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:Te(()=>[he("div",tD,[he("div",rD,[he("span",{textContent:K.toDisplayString(e.$gettext("Custom date range"))},null,8,nD)])]),he("div",iD,[e.dateRangeApplied?(Z(),Ce(s,{key:0,name:"check"})):ke("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),he("div",{class:K.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[he("div",oD,[we(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Te(()=>[we(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),he("span",{textContent:K.toDisplayString(e.$gettext("Custom date range"))},null,8,sD),we(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Te(()=>[we(s,{name:"close"})]),_:1},8,["aria-label"])]),he("div",aD,[we(u,{label:e.$gettext("From"),type:"date","is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),we(u,{label:e.$gettext("To"),type:"date","is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),he("div",lD,[we(l,{appearance:"outline",variation:"passive",size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Te(()=>[Bt(K.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const uD=Ue(X2,[["render",cD]]),fD=Me({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const r=We(),n=Jt(),o=ue(e.filterOptions[0].name),i=`q_${e.filterName}`,s=rr(i),l=u=>r.push({query:{...$i(y(n).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await l(u.name),t("toggleFilter",u)};return Vt(()=>{const u=St(y(s));u&&e.filterOptions.some(({name:a})=>a===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:a})=>a===u)))}),{queryParam:i,activeOption:o,toggleFilter:c}}}),dD=["textContent"];function pD(e,t,r,n,o,i){const s=pe("oc-button");return Z(),ve("div",null,[he("div",{class:K.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(Z(!0),ve(Ye,null,Lt(e.filterOptions,(l,c)=>(Z(),Ce(s,{id:l.name,key:c,class:K.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:"raw",onClick:u=>e.toggleFilter(l)},{default:Te(()=>[he("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:K.toDisplayString(l.label)},null,8,dD)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const hD=Ue(fD,[["render",pD]]),gD=Me({name:"SpaceQuota",props:{spaceQuota:{type:Object,required:!0,default:()=>{}}},setup:()=>{const{current:e}=Ne.useGettext();return{currentLanguage:e}},computed:{spaceStorageDetailsLabel(){return this.spaceQuota.total?this.$gettext("%{used} of %{total} used (%{percentage}% used)",{used:this.quotaUsed,total:this.quotaTotal,percentage:this.quotaUsagePercent.toString()}):this.$gettext("%{used} used (no restriction)",{used:this.quotaUsed})},quotaTotal(){return wr(this.spaceQuota.total,this.currentLanguage)},quotaUsed(){return wr(this.spaceQuota.used,this.currentLanguage)},quotaUsagePercent(){return parseFloat((this.spaceQuota.used/this.spaceQuota.total*100).toFixed(2))},quotaProgressVariant(){switch(this.spaceQuota.state){case"normal":return"primary";case"nearing":return"warning";case"critical":return"warning";default:return"danger"}}}}),mD={class:"space-quota"},yD=["textContent"];function bD(e,t,r,n,o,i){const s=pe("oc-progress");return Z(),ve("div",mD,[he("p",{class:"oc-mb-s oc-mt-rm",textContent:K.toDisplayString(e.spaceStorageDetailsLabel)},null,8,yD),we(s,{value:e.quotaUsagePercent,max:100,size:"small",variation:e.quotaProgressVariant},null,8,["value","variation"])])}const O0=Ue(gD,[["render",bD]]),vD=Me({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=In("resource"),r="check",n="file-copy",o=ue(n),i=ue(n),s=V(()=>mf(y(t).webDavPath)),l=V(()=>{var a;return(a=e.space)==null?void 0:a.getWebDavUrl({path:y(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(y(s)),o.value=r,setTimeout(()=>o.value=n,500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(y(l)),i.value=r,setTimeout(()=>i.value=n,500)},webDavPath:s,webDavUrl:l}}}),wD={class:"oc-flex"},SD=["textContent"],ED={class:"oc-flex"},TD=["textContent"];function AD(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-button"),c=or("oc-tooltip");return Z(),ve(Ye,null,[he("dt",null,K.toDisplayString(e.$gettext("WebDAV path")),1),he("dd",wD,[ot(he("div",{class:"oc-text-truncate",textContent:K.toDisplayString(e.webDavPath)},null,8,SD),[[c,e.webDavPath]]),ot((Z(),Ce(l,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),onClick:e.copyWebDAVPathToClipboard},{default:Te(()=>[we(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),he("dt",null,K.toDisplayString(e.$gettext("WebDAV URL")),1),he("dd",ED,[ot(he("div",{class:"oc-text-truncate",textContent:K.toDisplayString(e.webDavUrl)},null,8,TD),[[c,e.webDavUrl]]),ot((Z(),Ce(l,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),onClick:e.copyWebDAVUrlToClipboard},{default:Te(()=>[we(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const k0=Ue(vD,[["render",AD]]),RD=Me({name:"SpaceDetails",components:{SpaceQuota:O0,WebDavDetails:k0},props:{showSpaceImage:{type:Boolean,required:!1,default:!0},showShareIndicators:{type:Boolean,required:!1,default:!0}},setup(){const e=bt(),t=Ke(),{resourceContentsText:r}=Zv({showSizeInformation:!1}),n=We(),{$gettext:o,current:i}=Ne.useGettext(),{loadPreview:s,previewsLoading:l}=Wf(),c=Mt(),u=In("resource"),a=ue(""),{user:f}=Qe.storeToRefs(e),d=V(()=>c.linkShares.length),b=V(()=>t.areWebDavDetailsShown),E=V(()=>!ct(n,"files-spaces-projects")),w=V(()=>`${wr(y(u).size,i)}, ${y(r)}`);Et(()=>y(u).spaceImageData,async()=>{if(!y(u).spaceImageData)return;const m=ie.buildSpaceImageResource(y(u));a.value=await s({space:y(u),resource:m,dimensions:Vr.Tile,processor:zs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const R=V(()=>ie.getSpaceManagers(y(u)).map(g=>{var T;const v=g.grantedTo.user||g.grantedTo.group;return v.id===((T=y(f))==null?void 0:T.id)?o("%{displayName} (me)",{displayName:v.displayName}):v.displayName}).join(", ")),S=V(()=>Eb(y(u).mdate,i));return{spaceImage:a,resource:u,linkShareCount:d,showWebDavDetails:b,user:f,resourceContentsText:r,showSize:E,size:w,previewsLoading:l,lastModifiedDate:S,ownerUsernames:R}},computed:{hasShares(){return this.hasMemberShares||this.hasLinkShares},shareLabel(){if(this.hasMemberShares&&!this.hasLinkShares)return this.memberShareLabel;if(!this.hasMemberShares&&this.hasLinkShares)return this.linkShareLabel;switch(this.memberShareCount){case 1:return this.$ngettext("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",this.linkShareCount,{linkShareCount:this.linkShareCount.toString()});default:return this.linkShareCount===1?this.$gettext("This space has %{memberShareCount} members and one link.",{memberShareCount:this.memberShareCount.toString()}):this.$gettext("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:this.memberShareCount.toString(),linkShareCount:this.linkShareCount.toString()})}},openSharesPanelHint(){return this.$gettext("Open share panel")},openSharesPanelLinkHint(){return this.$gettext("Open link list in share panel")},openSharesPanelMembersHint(){return this.$gettext("Open member list in share panel")},hasMemberShares(){return this.memberShareCount>0},hasLinkShares(){return this.linkShareCount>0},memberShareCount(){return Object.keys(this.resource.members).length},memberShareLabel(){return this.$ngettext("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",this.memberShareCount,{memberShareCount:this.memberShareCount.toString()})},linkShareLabel(){return this.$ngettext("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",this.linkShareCount,{linkShareCount:this.linkShareCount.toString()})}},methods:{expandSharesPanel(){Xe.publish(mt.setActivePanel,"space-share")}}}),_D={id:"oc-space-details-sidebar"},ID={class:"oc-space-details-sidebar-image oc-text-center"},CD={key:1,class:"oc-position-relative"},FD=["src"],PD={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small",style:{gap:"15px"}},xD=["textContent"],OD=["textContent"],kD=["aria-label"];function ND(e,t,r,n,o,i){const s=pe("oc-spinner"),l=pe("oc-icon"),c=pe("oc-button"),u=pe("space-quota"),a=pe("web-dav-details"),f=pe("portal-target");return Z(),ve("div",_D,[he("div",ID,[e.previewsLoading?(Z(),Ce(s,{key:0})):e.spaceImage?(Z(),ve("div",CD,[he("img",{src:e.spaceImage,alt:"",class:"oc-mb-s"},null,8,FD)])):(Z(),Ce(l,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),e.showShareIndicators&&e.hasShares&&!e.resource.disabled?(Z(),ve("div",PD,[e.hasMemberShares?(Z(),Ce(c,{key:0,appearance:"raw","aria-label":e.openSharesPanelMembersHint,onClick:e.expandSharesPanel},{default:Te(()=>[we(l,{name:"group"})]),_:1},8,["aria-label","onClick"])):ke("",!0),e.hasLinkShares?(Z(),Ce(c,{key:1,appearance:"raw","aria-label":e.openSharesPanelLinkHint,onClick:e.expandSharesPanel},{default:Te(()=>[we(l,{name:"link"})]),_:1},8,["aria-label","onClick"])):ke("",!0),he("p",{textContent:K.toDisplayString(e.shareLabel)},null,8,xD),we(c,{appearance:"raw","aria-label":e.openSharesPanelHint,size:"small",onClick:e.expandSharesPanel},{default:Te(()=>[he("span",{class:"oc-text-small",textContent:K.toDisplayString(e.$gettext("Show"))},null,8,OD)]),_:1},8,["aria-label","onClick"])])):ke("",!0),he("dl",{class:"details-list oc-m-rm","aria-label":e.$gettext("Overview of the information about the selected space")},[he("dt",null,K.toDisplayString(e.$gettext("Last activity")),1),he("dd",null,K.toDisplayString(e.lastModifiedDate),1),e.resource.description?(Z(),ve(Ye,{key:0},[he("dt",null,K.toDisplayString(e.$gettext("Subtitle")),1),he("dd",null,K.toDisplayString(e.resource.description),1)],64)):ke("",!0),he("dt",null,K.toDisplayString(e.$gettext("Manger")),1),he("dd",null,K.toDisplayString(e.ownerUsernames),1),e.resource.disabled?ke("",!0):(Z(),ve(Ye,{key:1},[he("dt",null,K.toDisplayString(e.$gettext("Quota")),1),he("dd",null,[we(u,{"space-quota":e.resource.spaceQuota},null,8,["space-quota"])])],64)),e.showSize?(Z(),ve(Ye,{key:2},[he("dt",null,K.toDisplayString(e.$gettext("Size")),1),he("dd",null,K.toDisplayString(e.size),1)],64)):ke("",!0),e.showWebDavDetails?(Z(),Ce(a,{key:3,space:e.resource},null,8,["space"])):ke("",!0),we(f,{name:"app.files.sidebar.space.details.table","slot-props":{space:e.resource,resource:e.resource},multiple:!0},null,8,["slot-props"])],8,kD)])}const $D=Ue(RD,[["render",ND],["__scopeId","data-v-913f3e21"]]),DD=Me({name:"SpaceDetailsMultiple",props:{selectedSpaces:{type:Array,required:!0}},setup(e){const t=Ne.useGettext(),{$gettext:r,$ngettext:n}=t,o=V(()=>{let d=0;return e.selectedSpaces.forEach(b=>{d+=b.spaceQuota.total}),wr(d,t.current)}),i=V(()=>{let d=0;return e.selectedSpaces.forEach(b=>{b.disabled||(d+=b.spaceQuota.remaining)}),wr(d,t.current)}),s=V(()=>{let d=0;return e.selectedSpaces.forEach(b=>{b.disabled||(d+=b.spaceQuota.used)}),wr(d,t.current)}),l=V(()=>e.selectedSpaces.filter(d=>!d.disabled).length),c=V(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=V(()=>r("Overview of the information about the selected spaces")),a=V(()=>n("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=[{term:r("Total quota:"),definition:y(o)},{term:r("Remaining quota:"),definition:y(i)},{term:r("Used quota:"),definition:y(s)},{term:r("Enabled:"),definition:y(l)},{term:r("Disabled:"),definition:y(c)}];return{detailsTableLabel:u,items:f,selectedSpacesString:a}}}),LD={id:"oc-spaces-details-multiple-sidebar"},BD={class:"spaces-preview oc-mb"},MD={class:"spaces-preview-body"},jD=["textContent"];function UD(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-definition-list");return Z(),ve("div",LD,[he("div",BD,[he("div",MD,[we(s,{class:"preview-icon",size:"xxlarge",variation:"passive",name:"layout-grid"}),he("p",{class:"preview-text",textContent:K.toDisplayString(e.selectedSpacesString)},null,8,jD)])]),we(l,{"aria-label":e.detailsTableLabel,items:e.items},null,8,["aria-label","items"])])}const qD=Ue(DD,[["render",UD]]),VD=Me({name:"SpaceNoSelection"}),zD={class:"oc-mt-xl"},WD={class:"oc-flex space-info oc-text-center"};function HD(e,t,r,n,o,i){const s=pe("oc-icon"),l=or("translate");return Z(),ve("div",zD,[he("div",WD,[we(s,{name:"layout-grid",size:"xxlarge"}),ot((Z(),ve("p",null,t[0]||(t[0]=[Bt("Select a space to view details")]))),[[l]])])])}const GD=Ue(VD,[["render",HD]]),KD=Me({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=ue(!1);let t;return Vt(()=>{t=Xe.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Gr(()=>{Xe.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!lb(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}}}),QD={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},XD={key:0,class:"state-indicator oc-flex oc-flex-middle"},YD={class:"changes-saved oc-ml-s"},JD={key:1,class:"state-indicator"},ZD=["textContent"],eL=["textContent"];function tL(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-button"),c=or("translate");return Z(),ve("div",QD,[e.saved?(Z(),ve("span",XD,[we(s,{variation:"success",name:"checkbox-circle"}),ot((Z(),ve("span",YD,t[2]||(t[2]=[Bt("Changes saved")]))),[[c]])])):(Z(),ve("span",JD,K.toDisplayString(e.unsavedChangesText),1)),he("div",null,[we(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=u=>e.$emit("revert"))},{default:Te(()=>[he("span",{textContent:K.toDisplayString(e.$gettext("Revert"))},null,8,ZD)]),_:1},8,["disabled"]),we(l,{appearance:"filled",variation:"primary",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=u=>e.$emit("confirm"))},{default:Te(()=>[he("span",{textContent:K.toDisplayString(e.$gettext("Save"))},null,8,eL)]),_:1},8,["disabled"])])])}const rL=Ue(KD,[["render",tL],["__scopeId","data-v-a61bf25c"]]),nL=iS(async()=>(await Promise.resolve().then(()=>JL)).default),iL=Me({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Di(),r=xb(),n=V(()=>t.requestExtensions(e.extensionPoint)),o=r.extractDefaultExtensionIds(e.extensionPoint,y(n));return{extensions:V(()=>{if(e.extensionPoint.multiple||y(n).length<=1)return y(n);const s=r.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[y(n).find(l=>s.selectedExtensionIds.includes(l.id))||y(n)[0]]:[y(n)[0]]})}}});function oL(e,t,r,n,o,i){return Z(!0),ve(Ye,null,Lt(e.extensions,s=>(Z(),Ce(Hn(s.content),{key:`custom-component-${s.id}`}))),128)}const sL=Ue(iL,[["render",oL]]),aL=Me({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:r}){const n=We(),o=Jt(),i=ue(),s=ue([]),l=ue(e.items),c=ue(null),u=ue(null),a=`q_${e.filterName}`,f=rr(a),d=A=>A[e.idAttribute],b=()=>n.push({query:{...$i(y(o).query,[a]),...!!y(s).length&&{[a]:y(s).reduce((A,F)=>(A+=`${d(F)}+`,A),"").slice(0,-1)}}}),E=A=>!!y(s).find(F=>d(F)===d(A)),w=async A=>{E(A)?s.value=y(s).filter(F=>d(F)!==d(A)):(e.allowMultiple||(s.value=[]),s.value.push(A)),await b(),t("selectionChange",y(s))},R=ue(),S=(A,F)=>{if(!(F||"").trim())return A;const I=new id(A,{...sl,keys:e.filterableAttributes}).search(F).map(L=>L.item);return A.filter(L=>I.includes(L))},m=()=>{s.value=[],t("selectionChange",y(s)),b()},g=A=>{l.value=A},v=async()=>{var A;g(e.items),await Hr(),(A=y(i))==null||A.focus()};Et(R,()=>{g(S(e.items,y(R))),y(u)&&(c.value=new sd(y(u)),y(c).unmark(),y(c).mark(y(R),{element:"span",className:"mark-highlight"}))});const T=()=>{const A=St(y(f));if(A){const F=A.split("+");s.value=e.items.filter(C=>F.includes(d(C)))}};return r({setSelectedItemsBasedOnQuery:T}),Vt(()=>{T()}),{clearFilter:m,displayedItems:l,filterInputRef:i,filterTerm:R,isItemSelected:E,itemFilterListRef:u,queryParam:a,selectedItems:s,setDisplayedItems:g,showDrop:v,toggleItemSelection:w,setSelectedItemsBasedOnQuery:T}}}),lL={ref:"itemFilterListRef"},cL={class:"oc-flex oc-flex-middle oc-text-truncate"},uL={class:"oc-text-truncate oc-ml-s"},fL={class:"oc-flex"};function dL(e,t,r,n,o,i){const s=pe("oc-text-input"),l=pe("oc-checkbox"),c=pe("oc-icon"),u=pe("oc-button"),a=pe("oc-list"),f=pe("oc-filter-chip");return Z(),ve("div",{class:K.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[we(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Te(()=>[e.showOptionFilter&&e.filterableAttributes.length?(Z(),Ce(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):ke("",!0),he("div",lL,[we(a,{class:"item-filter-list"},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(e.displayedItems,(d,b)=>(Z(),ve("li",{key:b,class:"oc-my-xs"},[we(u,{class:K.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-xs",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:E=>e.toggleItemSelection(d)},{default:Te(()=>[he("div",cL,[e.allowMultiple?(Z(),Ce(l,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":E=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=Tr(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):ke("",!0),he("div",null,[Ge(e.$slots,"image",{item:d})]),he("div",uL,[Ge(e.$slots,"item",{item:d})])]),he("div",fL,[!e.allowMultiple&&e.isItemSelected(d)?(Z(),Ce(c,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const pL=Ue(aL,[["render",dL]]),hL=Me({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const r=We(),n=Jt(),o=ue(!1),i=`q_${e.filterName}`,s=rr(i),l=()=>r.push({query:{...$i(y(n).query,[i]),...y(o)&&{[i]:"true"}}}),c=async()=>{o.value=!y(o),await l(),t("toggleFilter",y(o))};return Vt(()=>{St(y(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function gL(e,t,r,n,o,i){const s=pe("oc-filter-chip");return Z(),ve("div",{class:K.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[we(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 mL=Ue(hL,[["render",gL]]),yL=Me({name:"LoadingIndicator",setup(){const e=lr();let t,r,n;const o=ue(e.isLoading),i=ue(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},l=()=>{i.value=e.currentProgress};return Vt(()=>{t=Xe.subscribe(Pn.add,s),r=Xe.subscribe(Pn.remove,s),n=Xe.subscribe(Pn.setProgress,l)}),Gr(()=>{Xe.unsubscribe(Pn.add,t),Xe.unsubscribe(Pn.remove,r),Xe.unsubscribe(Pn.setProgress,n)}),{isLoading:o,currentProgress:i}}}),bL={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function vL(e,t,r,n,o,i){const s=pe("oc-progress");return e.isLoading?(Z(),ve("div",bL,[we(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):ke("",!0)}const wL=Ue(yL,[["render",vL]]),SL=Me({name:"NoContentMessage",props:{icon:{type:String,required:!0},iconFillType:{type:String,default:"fill"}}}),EL={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},TL={class:"oc-text-muted oc-text-xlarge"},AL={class:"oc-text-muted"};function RL(e,t,r,n,o,i){const s=pe("oc-icon");return Z(),ve("div",EL,[we(s,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),he("div",TL,[Ge(e.$slots,"message")]),he("div",AL,[Ge(e.$slots,"callToAction")])])}const _L=Ue(SL,[["render",RL]]),IL=Me({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function CL(e,t,r,n,o,i){const s=pe("oc-pagination");return e.pages>1?(Z(),Ce(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):ke("",!0)}const FL=Ue(IL,[["render",CL]]),PL=Me({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:r}=Ne.useGettext(),n=rr("useScope"),o=ue(),i=ue(),s=V(()=>{var u;return r((u=o.value)==null?void 0:u.title)}),l=V(()=>[{id:Sn.currentFolder,title:r("Current folder"),enabled:e.currentFolderAvailable},{id:Sn.allFiles,title:r("All files"),enabled:!0}]);return Et(()=>e.currentFolderAvailable,()=>{if(y(n)){if(y(n).toString()==="true"){o.value=y(l).find(({id:a})=>a===Sn.currentFolder);return}o.value=y(l).find(({id:a})=>a===Sn.allFiles);return}if(!e.currentFolderAvailable){o.value=y(l).find(({id:u})=>u===Sn.allFiles);return}if(y(i)){o.value=y(l).find(({id:u})=>u===y(i).id);return}o.value=y(l).find(({id:u})=>u===Sn.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:l}}}),xL={key:0},OL={key:0,class:"oc-flex"};function kL(e,t,r,n,o,i){const s=pe("oc-icon"),l=pe("oc-button"),c=pe("oc-filter-chip");return Z(),ve("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=Tr(()=>{},["stop"]))},[e.currentSelection?(Z(),ve("div",xL,[we(c,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Te(()=>[(Z(!0),ve(Ye,null,Lt(e.locationOptions,(u,a)=>(Z(),Ce(l,{key:a,appearance:"raw",size:"medium","justify-content":"space-between",class:K.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-background-highlight":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:f=>e.onOptionSelected(u)},{default:Te(()=>[he("span",null,K.toDisplayString(u.title),1),u.id===e.currentSelection.id?(Z(),ve("div",OL,[we(s,{name:"check"})])):ke("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):ke("",!0)])}const NL=Ue(PL,[["render",kL]]),$L=Me({name:"PortalTarget",components:{PortalTargetVue:va.PortalTarget},props:{...va.PortalTarget.props},setup(e){const t=V(()=>e);return Vt(()=>{Xe.publish(da.mounted,e)}),{properties:t}}});function DL(e,t,r,n,o,i){const s=pe("portal-target-vue");return Z(),Ce(s,K.normalizeProps(Xa(e.properties)),null,16)}const LL=Ue($L,[["render",DL]]),BL=({sortBy:e,sortDir:t})=>({groupingSettings:V(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(n){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(n.name.charAt(0)))?n.name.charAt(0)==="."?n.name.charAt(1).toLowerCase():n.name.charAt(0).toLowerCase():"#"},"Shared on":function(n){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(n.sdate)<i?"Older":Date.parse(n.sdate)>=o?"Recently":"Last month"},"Share owner":function(n){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=n==null?void 0:n.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(n){const o=n.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return y(e)==="name"&&y(t)==="desc"&&o.reverse(),o},"Shared on":function(n){const o=[],i=["Recently","Last month","Older"];for(const s of i){const l=n.find(c=>c.name.toLowerCase()===s.toLowerCase());l&&o.push(l)}return y(e)==="sdate"&&y(t)==="asc"&&o.reverse(),o},"Share owner":function(n){const o=n.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return y(e)==="owner"&&y(t)==="desc"&&o.reverse(),o}}}))}),ML={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é"}},jL={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"}},UL={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"}},qL={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"}},VL={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"}},zL={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:"Автопрокрутка"}},WL={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:"同期スクロール"}},HL={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"}},GL={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"},KL={"fr-FR":ML,"de-DE":jL,"it-IT":UL,"es-ES":qL,"pl-PL":VL,ru:zL,"jp-JP":WL,"id-ID":HL},QL=Me({name:"TextEditor",components:{MdEditor:Bo.MdEditor,MdPreview:Bo.MdPreview},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e){const t=Ne.useGettext(),{currentTheme:r}=oi(),n=V(()=>{const{showPreviewOnlyMd:s=!0}=e.applicationConfig;return{showPreviewOnlyMd:s}}),o=V(()=>{var s;return e.markdownMode||["md","markdown"].includes((s=e.resource)==null?void 0:s.extension)||!y(n).showPreviewOnlyMd}),i=V(()=>y(r).isDark?"dark":"light");return Bo.config({editorConfig:{languageUserDefined:KL},editorExtensions:{screenfull:{instance:G0},cropper:{instance:K0}},markdownItPlugins(s){return[...s,{type:"xss",plugin:Bo.XSSPlugin,options:{}}]}}),{isMarkdown:o,theme:i,language:t,languages:GL}}}),XL={id:"text-editor-container",class:"oc-height-1-1"};function YL(e,t,r,n,o,i){const s=pe("md-preview"),l=pe("md-editor");return Z(),ve("div",XL,[e.isReadOnly?(Z(),Ce(s,{key:0,id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"read-only":"",toolbars:[]},null,8,["model-value","language","theme"])):(Z(),Ce(l,{key:1,id:"text-editor-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.isMarkdown?void 0:[],"toolbars-exclude":["save","katex","github","catalog","mermaid","prettier","fullscreen","htmlPreview","pageFullscreen"],"read-only":e.isReadOnly,onOnChange:t[0]||(t[0]=c=>e.$emit("update:currentContent",c))},null,8,["model-value","language","theme","preview","toolbars","read-only"]))])}const JL=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(QL,[["render",YL]])},Symbol.toStringTag,{value:"Module"}));j.ActionMenuItem=Gf,j.ApiError=dA,j.AppBar=Uk,j.AppLoadingSpinner=Mf,j.AppProviderService=KT,j.AppTopBar=n0,j.AppWrapper=u0,j.AppWrapperRoute=JN,j.ArchiverService=pA,j.Auth=Mh,j.BatchActions=e0,j.Cache=_l,j.ClientService=EA,j.ClipboardActions=ti,j.CompareSaveDialog=rL,j.ConflictDialog=ol,j.ContextActionMenu=Kf,j.ContextActions=t0,j.ContextMenuQuickAction=Qf,j.CreateLinkModal=Ov,j.CreateShortcutModal=Pv,j.CreateSpace=Wk,j.CustomComponentTarget=sL,j.DateFilter=uD,j.DatePickerModal=kN,j.EDITOR_MODE_CREATE=sx,j.EDITOR_MODE_EDIT=ox,j.EVENT_FILE_DROPPED=Df,j.EVENT_TROW_CONTEXTMENU=dx,j.EVENT_TROW_MOUNTED=_v,j.EmojiPickerModal=Hv,j.EventBus=jh,j.FileInfo=s0,j.FilePickerModal=kv,j.FileSideBar=a0,j.FolderLoaderFavorites=Kh,j.FolderLoaderSharedViaLink=Qh,j.FolderLoaderSharedWithMe=Xh,j.FolderLoaderSharedWithOthers=Yh,j.FolderLoaderSpace=Gh,j.FolderLoaderTrashbin=Ky,j.FolderService=Qy,j.FolderViewModeConstants=Gt,j.HttpClient=Wl,j.ImageDimension=Vr,j.ImageType=ca,j.ItemFilter=pL,j.ItemFilterInline=hD,j.ItemFilterToggle=mL,j.Key=Uf,j.LinkRoleDropdown=xv,j.LoadingEventTopics=Pn,j.LoadingIndicator=wL,j.LoadingService=hI,j.MimeTypesToAppsSchema=Th,j.Modifier=qf,j.NoContentMessage=_L,j.Pagination=FL,j.PaginationConstants=En,j.PasswordPolicyService=oC,j.PortalTarget=LL,j.PortalTargetEventTopics=da,j.PreviewService=XI,j.ProcessorType=zs,j.QuotaModal=Uv,j.QuotaSelect=jv,j.RawConfigSchema=GF,j.ResolveStrategy=Ur,j.ResourceConflictModal=Rp,j.ResourceGhostElement=Xf,j.ResourceIcon=xo,j.ResourceLink=Lf,j.ResourceListItem=Oo,j.ResourceName=Bf,j.ResourcePreview=Fv,j.ResourceSize=f0,j.ResourceTable=F2,j.ResourceTile=x0,j.ResourceTiles=Q2,j.ResourceTransfer=Ip,j.RuntimeError=Ci,j.SaveAsModal=$v,j.SearchBarFilter=NL,j.SearchLocationFilterConstants=Sn,j.SideBar=i0,j.SideBarEventTopics=mt,j.SortConstants=Jn,j.SortDir=Ft,j.SpaceDetails=$D,j.SpaceDetailsMultiple=qD,j.SpaceInfo=o0,j.SpaceMoveInfoModal=Ap,j.SpaceNoSelection=GD,j.SpaceQuota=O0,j.TextEditor=nL,j.ThemeConfig=ZF,j.TransferType=hn,j.UnsavedChangesModal=l0,j.UppyService=aC,j.ViewOptions=r0,j.VisibilityObserver=Iv,j.WebDavDetails=k0,j.WebThemeConfig=jb,j.activeApp=Rl,j.authContextValues=TT,j.blobToArrayBuffer=Cb,j.breadcrumbsFromPath=RF,j.buildRoutes=aP,j.buildUrl=RT,j.cacheService=zl,j.canvasToBlob=Fb,j.cloneStateObject=Ep,j.concatBreadcrumbs=_F,j.contextQueryToFileContextProps=zb,j.contextRouteNameKey=Ys,j.contextRouteParamsKey=Sf,j.contextRouteQueryKey=Ef,j.createDefaultFileIconMapping=Fp,j.createFileRouteOptions=Jr,j.createLocationCommon=Ai,j.createLocationPublic=Ri,j.createLocationShares=Or,j.createLocationSpaces=xr,j.createLocationTrash=_i,j.defaultFuseOptions=sl,j.defineWebApplication=Q0,j.determineResourceTableSortFields=Sh,j.determineResourceTilesSortFields=zT,j.dirname=ht.dirname,j.displayPositionedDropdown=To,j.encodePath=mf,j.eventBus=Xe,j.filterResources=ZS,j.focusCheckbox=CT,j.folderService=Xy,j.formatDateFromDateTime=ri,j.formatDateFromHTTP=IF,j.formatDateFromISO=Eb,j.formatDateFromJSDate=Sb,j.formatDateFromRFC=CF,j.formatFileSize=wr,j.formatRelativeDateFromDateTime=Ao,j.formatRelativeDateFromHTTP=FF,j.formatRelativeDateFromISO=PF,j.formatRelativeDateFromJSDate=Tb,j.formatRelativeDateFromRFC=xF,j.getIndicators=Ro,j.getLocaleFromLanguage=Gs,j.getParentPaths=Ab,j.getSharedAncestorRoute=IT,j.getSharedDriveItem=ys,j.getSpacesByType=Io,j.isLocationActive=oP,j.isLocationCommonActive=Tt,j.isLocationPublicActive=Ar,j.isLocationSharesActive=kt,j.isLocationSpacesActive=ct,j.isLocationTrashActive=Rr,j.isResourceBeeingMovedToSameLocation=_p,j.isSameResource=to,j.locationPublicLink=Tl,j.locationPublicUpload=Al,j.locationSharesViaLink=El,j.locationSharesWithMe=ms,j.locationSharesWithOthers=Sl,j.locationSpacesGeneric=wl,j.objectKeys=QI,j.queryItemAsString=St,j.renameResource=al,j.resolveFileNameDuplicate=jr,j.resourceIconMappingInjectionKey=Cp,j.routeToContextQuery=Js,j.sortFields=Eh,j.sortHelper=vh,j.sortSpaceMembers=Ub,j.translateSortFields=WT,j.triggerDownloadWithFilename=Vl,j.useAbility=dr,j.useActionsShowDetails=YO,j.useActiveApp=AT,j.useActiveLocation=xn,j.useAppConfig=fh,j.useAppDefaults=Yb,j.useAppFileHandling=Tf,j.useAppFolderHandling=Hb,j.useAppMeta=_f,j.useAppNavigation=Wb,j.useAppProviderService=ZO,j.useAppsStore=Zr,j.useArchiverService=vv,j.useAuthService=Af,j.useAuthStore=Yn,j.useBreadcrumbsFromPath=ek,j.useCanBeOpenedWithSecureView=Vf,j.useCanListShares=Tv,j.useCanListVersions=Xv,j.useCanShare=Av,j.useCapabilityStore=tr,j.useClientService=Je,j.useClipboard=If,j.useClipboardStore=_o,j.useConfigStore=at,j.useCreateSpace=Li,j.useDeleteWorker=Jb,j.useDocumentTitle=Gb,j.useDownloadFile=wv,j.useDriveResolver=Xb,j.useEmbedMode=ni,j.useEventBus=Fo,j.useExtensionPreferencesStore=xb,j.useExtensionRegistry=Di,j.useFileActions=qr,j.useFileActionsCopy=ra,j.useFileActionsCopyPermanentLink=Cf,j.useFileActionsCreateLink=SO,j.useFileActionsCreateNewFile=fx,j.useFileActionsCreateNewFolder=ux,j.useFileActionsCreateNewShortcut=Qx,j.useFileActionsCreateSpaceFromResource=$f,j.useFileActionsDelete=ia,j.useFileActionsDeleteResources=tv,j.useFileActionsDisableSync=na,j.useFileActionsDownloadArchive=oa,j.useFileActionsDownloadFile=Po,j.useFileActionsEmptyTrashBin=Ff,j.useFileActionsEnableSync=ea,j.useFileActionsFavorite=Pf,j.useFileActionsMove=sa,j.useFileActionsNavigate=xf,j.useFileActionsOpenShortcut=Xx,j.useFileActionsOpenWithApp=Nv,j.useFileActionsPaste=Sv,j.useFileActionsRename=aa,j.useFileActionsRestore=la,j.useFileActionsSaveAs=Dv,j.useFileActionsSetImage=Ev,j.useFileActionsShowActions=cx,j.useFileActionsShowDetails=kf,j.useFileActionsShowShares=Nf,j.useFileActionsToggleHideShare=ta,j.useFileListHeaderPosition=tk,j.useFileRouteReplace=Ks,j.useFolderLink=ai,j.useGetMatchingSpace=ar,j.useGetResourceContext=Yv,j.useGroupingSettings=BL,j.useIsFilesAppActive=On,j.useIsSearchActive=ls,j.useIsTopBarSticky=jf,j.useKeyboardActions=Kv,j.useLinkTypes=ua,j.useLoadPreview=Wf,j.useLoadingService=lr,j.useLocalStorage=vf,j.useMessages=it,j.useModals=yt,j.useOpenEmptyEditor=JO,j.useOpenWithDefaultApp=Vv,j.usePagination=nk,j.usePasswordPolicyService=Qv,j.usePasteWorker=Zb,j.usePortalTarget=sk,j.usePreviewService=Of,j.useRequest=Kb,j.useRequestHeaders=Zs,j.useResourceContents=Zv,j.useResourceRouteResolver=fa,j.useResourcesStore=Ke,j.useRestoreWorker=ev,j.useRoute=Jt,j.useRouteMeta=qb,j.useRouteName=Qs,j.useRouteParam=Xs,j.useRouteQuery=rr,j.useRouteQueryPersisted=wn,j.useRouter=We,j.useScrollTo=Rv,j.useSearch=Rf,j.useSelectedResources=Hf,j.useService=yn,j.useSharesStore=Mt,j.useSideBar=Rb,j.useSort=MT,j.useSpaceActionsDelete=Lv,j.useSpaceActionsDisable=Bv,j.useSpaceActionsDuplicate=Mv,j.useSpaceActionsEditDescription=kO,j.useSpaceActionsEditQuota=qv,j.useSpaceActionsEditReadmeContent=WO,j.useSpaceActionsNavigateToTrash=GO,j.useSpaceActionsRename=zv,j.useSpaceActionsRestore=Wv,j.useSpaceActionsSetIcon=XO,j.useSpaceActionsShowMembers=HO,j.useSpaceHelpers=si,j.useSpacesLoading=Qb,j.useSpacesStore=dt,j.useThemeStore=oi,j.useTileSize=Jv,j.useTokenTimerWorker=dP,j.useUpload=uk,j.useUserStore=bt,j.useViewMode=ak,j.useViewSize=lk,j.useViewSizeMax=zf,j.useWebWorkersStore=Co,j.useWindowOpen=Gv,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
68
+ */function iB(e){return e}const U$={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object};Object.assign({active:{type:Boolean,default:!0}},U$);var q$=Object.defineProperty,v0=Object.getOwnPropertySymbols,V$=Object.prototype.hasOwnProperty,z$=Object.prototype.propertyIsEnumerable,w0=(e,t,r)=>t in e?q$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W$=(e,t)=>{for(var r in t||(t={}))V$.call(t,r)&&w0(e,r,t[r]);if(v0)for(var r of v0(t))z$.call(t,r)&&w0(e,r,t[r]);return e};const S0=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},H$={},G$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},K$=pe("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),Q$=[K$];function X$(e,t){return te(),ve("svg",G$,Q$)}const Y$=S0(H$,[["render",X$]]),J$={},Z$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},e2=pe("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),t2=[e2];function r2(e,t){return te(),ve("svg",Z$,t2)}W$({},{Deselect:Y$,OpenIndicator:S0(J$,[["render",r2]])});const n2=["aria-label"],i2=je({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=V(()=>["oc-spinner",`oc-spinner-${ii(e.size||"medium")}`]);return(r,n)=>(te(),ve("span",{class:K.normalizeClass(t.value),"aria-label":r.ariaLabel,tabindex:"-1",role:"img"},null,10,n2))}}),o2={class:"oc-thead"},s2=je({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,r)=>(te(),ve("thead",o2,[Ke(t.$slots,"default")]))}}),a2=je({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,r)=>(te(),ve("tbody",null,[Ke(t.$slots,"default")]))}}),E0=({target:e,mode:t="show",rootMargin:r="100px",onVisibleCallback:n})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:ce(!0)};const i=ce(!1),s=new IntersectionObserver(l=>{const c=l.at(-1).isIntersecting;i.value=c,m(i)&&n&&n(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:r});return Tt(e,()=>{s.observe(e.value)}),Gr(()=>s.disconnect()),{isVisible:i}},T0=je({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const r=t,n=V(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(te(),Ce(Hn(o.type),{class:K.normalizeClass(n.value),onClick:i[0]||(i[0]=s=>r("click",s))},{default:Te(()=>[Ke(o.$slots,"default")]),_:3},8,["class"]))}}),A0=je({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,r)=>(te(),Ce(T0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Te(()=>[Ke(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),R0=je({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const r=t,n=Pd((l,c)=>{let u;return{get(){return l(),u},set(a){u=a,c()}}}),o=V(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?E0({...e.lazy,target:n,onVisibleCallback:()=>r("itemVisible")}):{isVisible:ce(!0)},s=V(()=>!m(i));return e.lazy||r("itemVisible"),(l,c)=>(te(),ve("tr",{ref_key:"observerTarget",ref:n,onClick:c[0]||(c[0]=u=>l.$emit("click",u)),onContextmenu:c[1]||(c[1]=u=>l.$emit("contextmenu",u)),onDragstart:c[2]||(c[2]=u=>l.$emit("dragstart",u)),onDrop:c[3]||(c[3]=u=>l.$emit("drop",u)),onDragenter:c[4]||(c[4]=u=>l.$emit("dragenter",u)),onDragleave:c[5]||(c[5]=u=>l.$emit("dragleave",u)),onDragover:c[6]||(c[6]=u=>l.$emit("dragover",u)),onMouseleave:c[7]||(c[7]=u=>l.$emit("mouseleave",u))},[s.value?(te(),Ce(A0,{key:0,colspan:o.value},{default:Te(()=>c[8]||(c[8]=[pe("span",{class:"shimmer"},null,-1)])),_:1},8,["colspan"])):Ke(l.$slots,"default",{key:1})],544))}}),l2=je({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,r)=>(te(),Ce(T0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:r[0]||(r[0]=n=>t.$emit("click",n))},{default:Te(()=>[Ke(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),c2={key:0,class:"oc-table-thead-content"},u2=["textContent"],f2={key:1},d2={key:0,class:"oc-table-thead-content"},p2=["textContent"],h2={key:1,class:"oc-table-footer"},g2={class:"oc-table-footer-row"},m2=["colspan"],_0="asc",ed="desc",y2=je({__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 r=t,n={EVENT_THEAD_CLICKED:zF,EVENT_TROW_CLICKED:WF,EVENT_TROW_MOUNTED:HF,EVENT_TROW_CONTEXTMENU:GF},{$gettext:o}=$e.useGettext(),i=B=>e.itemDomSelector?e.itemDomSelector(B):B[e.idKey],s=V(()=>{const B=["oc-table"];return e.hover&&B.push("oc-table-hover"),e.sticky&&B.push("oc-table-sticky"),B}),l=V(()=>e.fields.length),c=B=>{B.preventDefault()},u=(B,$)=>{r(KF,B,$)},a=(B,$)=>{r(Ob,B,$)},f=(B,$,D)=>{r("dropRowStyling",B,$,D)},d=B=>B.type==="slot",b=B=>["callback","function"].indexOf(B.type)>=0,E=B=>Object.prototype.hasOwnProperty.call(B,"title")?B.title:B.name,S=()=>({class:s.value}),T=(B,$)=>{const D=g(B);return D.class=`oc-table-header-cell oc-table-header-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"thClass")&&(D.class+=` ${B.thClass}`),e.sticky&&(D.style=`top: ${e.headerPosition}px;`),$===0&&(D.class+=` oc-pl-${ii(e.paddingX)} `),$===e.fields.length-1&&(D.class+=` oc-pr-${ii(e.paddingX)}`),P(D,B),D},w=(B,$)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(B)||$}`,v(B)?"oc-table-highlighted":void 0,A(B)?"oc-table-disabled":void 0].filter(Boolean)}),y=(B,$,D)=>{const H=g(B);return H.class=`oc-table-data-cell oc-table-data-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"tdClass")&&(H.class+=` ${B.tdClass}`),Object.prototype.hasOwnProperty.call(B,"wrap")&&(H.wrap=B.wrap),$===0&&(H.class+=` oc-pl-${ii(e.paddingX)} `),$===e.fields.length-1&&(H.class+=` oc-pr-${ii(e.paddingX)}`),Object.prototype.hasOwnProperty.call(B,"accessibleLabelCallback")&&(H["aria-label"]=B.accessibleLabelCallback(D)),H},g=B=>({...(B==null?void 0:B.alignH)&&{alignH:B.alignH},...(B==null?void 0:B.alignV)&&{alignV:B.alignV},...(B==null?void 0:B.width)&&{width:B.width},class:void 0,wrap:void 0,style:void 0}),v=B=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(B[e.idKey])>-1:e.highlighted===B[e.idKey]:!1,A=B=>e.disabled.length?e.disabled.indexOf(B[e.idKey])>-1:!1,R=(B,$,D)=>{const H=[D[e.idKey],$+1].filter(Boolean);return d(B)?[...H,B.name].join("-"):b(B)?[...H,B.callback(D[B.name])].join("-"):[...H,D[B.name]].join("-")},C=B=>o("Sort by %{ name }",{name:B}),P=(B,$)=>{if(!_($))return;let D="none";e.sortBy===$.name&&(D=e.sortDir===_0?"ascending":"descending"),B["aria-sort"]=D},_=({sortable:B})=>!!B,L=B=>{if(!_(B))return;let $=e.sortDir;e.sortBy===B.name&&e.sortDir!==void 0&&($=e.sortDir===ed?_0:ed),(e.sortBy!==B.name||e.sortDir===void 0)&&($=B.sortDir||ed),r("sort",{sortBy:B.name,sortDir:$})};return(B,$)=>{const D=de("oc-icon");return te(),ve("table",Yt(S(),{class:"has-item-context-menu"}),[B.hasHeader?(te(),Ce(s2,{key:0},{default:Te(()=>[be(R0,{class:"oc-table-header-row"},{default:Te(()=>[(te(!0),ve(Xe,null,kt(B.fields,(H,X)=>(te(),Ce(l2,Yt({key:`oc-thead-${H.name}`,ref_for:!0},T(H,X)),{default:Te(()=>[H.sortable?(te(),Ce(c$,{key:0,"aria-label":C(H.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","no-hover":"",onClick:J=>L(H)},{default:Te(()=>[H.headerType==="slot"?(te(),ve("span",c2,[Ke(B.$slots,H.name+"Header")])):(te(),ve("span",{key:1,class:"oc-table-thead-content header-text",textContent:K.toDisplayString(E(H))},null,8,u2)),be(D,{name:B.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:K.normalizeClass({"oc-invisible-sr":B.sortBy!==H.name}),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(te(),ve("div",f2,[H.headerType==="slot"?(te(),ve("span",d2,[Ke(B.$slots,H.name+"Header")])):(te(),ve("span",{key:1,class:"oc-table-thead-content header-text",textContent:K.toDisplayString(E(H))},null,8,p2))]))]),_:2},1040))),128))]),_:3})]),_:3})):ke("",!0),be(a2,{class:"has-item-context-menu"},{default:Te(()=>[(te(!0),ve(Xe,null,kt(B.data,(H,X)=>(te(),Ce(R0,Yt({key:`oc-tbody-tr-${i(H)||X}`,ref_for:!0,ref:`row-${X}`},w(H,X),{"data-item-id":H[B.idKey],draggable:B.dragDrop,onClick:J=>B.$emit(n.EVENT_TROW_CLICKED,[H,J]),onContextmenu:J=>B.$emit(n.EVENT_TROW_CONTEXTMENU,B.$refs[`row-${X}`][0],J,H),onVnodeMounted:J=>B.$emit(n.EVENT_TROW_MOUNTED,H,B.$refs[`row-${X}`][0]),onDragstart:J=>u(H,J),onDrop:J=>a(i(H),J),onDragenter:Tr(J=>f(i(H),!1,J),["prevent"]),onDragleave:Tr(J=>f(i(H),!0,J),["prevent"]),onMouseleave:J=>f(i(H),!0,J),onDragover:$[0]||($[0]=J=>c(J)),onItemVisible:J=>B.$emit("itemVisible",H)}),{default:Te(()=>[(te(!0),ve(Xe,null,kt(B.fields,(J,le)=>(te(),Ce(A0,Yt({key:"oc-tbody-td-"+R(J,le,H),ref_for:!0},y(J,le,H)),{default:Te(()=>[d(J)?Ke(B.$slots,J.name,{key:0,item:H}):b(J)?(te(),ve(Xe,{key:1},[Vt(K.toDisplayString(J.callback(H[J.name])),1)],64)):(te(),ve(Xe,{key:2},[Vt(K.toDisplayString(H[J.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),B.$slots.footer?(te(),ve("tfoot",h2,[pe("tr",g2,[pe("td",{colspan:l.value,class:"oc-table-footer-cell"},[Ke(B.$slots,"footer")],8,m2)])])):ke("",!0)],16)}}}),b2=850,v2=je({components:{ContextMenuQuickAction:Qf,ResourceGhostElement:Xf,ResourceListItem:Oo,ResourceSize:a0,OcTable:y2,OcSpinner:i2},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>ie.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Gt.defaultModeName,validator:e=>[Gt.name.condensedTable,Gt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Ft.Asc.toString(),Ft.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Df,"update:selectedIds","update:modelValue"],setup(e,t){const r=We(),n=tr(),{getMatchingSpace:o}=sr(),{canBeOpenedWithSecureView:i}=Vf(),s=ai({space:ce(e.space),targetRouteCallback:V(()=>e.targetRouteCallback)}),{isSticky:l}=jf(),{isLocationPicker:c,isFilePicker:u,postMessage:a,isEnabled:f,fileTypes:d}=ni(),{getDefaultAction:b}=qr(),E=ot(),{options:S}=Ge.storeToRefs(E),T=_o(),{resources:w,action:y}=Ge.storeToRefs(T),g=Yn(),{userContextReady:v}=Ge.storeToRefs(g),A=Qe(),{areFileExtensionsShown:R,latestSelectedId:C,deleteQueue:P}=Ge.storeToRefs(A),_=ce(),L=ce(),B=ce(),{width:$}=Mn.useWindowSize(),D=V(()=>n.filesTags&&$.value>=b2),{actions:H}=la(),{actions:X}=jv(),J=V(()=>m(H)[0].handler),le=V(()=>m(X)[0].handler),me=Z=>Z.length>7?Z:"",fe=Z=>{var F;return m(f)&&((F=m(d))!=null&&F.length)?!m(d).includes(Z.extension)&&!m(d).includes(Z.mimeType)&&!Z.isFolder:Z.processing===!0||Ae(Z.id)},we=V(()=>{var Z,F;return((F=(Z=e.resources)==null?void 0:Z.filter(O=>fe(O)===!0))==null?void 0:F.map(O=>O.id))||[]}),Se=Z=>!e.areResourcesClickable||ie.isProjectSpaceResource(Z)&&Z.disabled||!Z.isFolder&&(!Z.canDownload()&&!i(Z)||m(f)&&!m(u))?!1:!m(we).includes(Z.id),re=Z=>{Ye.publish("app.files.list.clicked"),t.emit("update:selectedIds",Z)},oe=Z=>{A.toggleSelection(Z),re(A.selectedIds)},ae=Z=>{if(Z.isFolder)return s.getFolderLink(Z);let F=e.space;F||(F=o(Z));const O=b({resources:[Z],space:F});if(O!=null&&O.route)return O.route({space:F,resources:[Z]})},Ae=Z=>m(P).includes(Z);return{router:r,configOptions:S,dragItem:_,ghostElement:L,contextMenuButton:B,getTagToolTip:me,renameActions:H,renameActionsSpace:X,renameHandler:J,renameHandlerSpace:le,FolderViewModeConstants:Gt,hasTags:D,disabledResources:we,isResourceDisabled:fe,userContextReady:v,getMatchingSpace:o,clipboardResources:w,clipboardAction:y,...da({space:ce(e.space),targetRouteCallback:V(()=>e.targetRouteCallback)},t),...s,postMessage:a,isFilePicker:u,isLocationPicker:c,isEmbedModeEnabled:f,emitSelect:re,toggleSelection:oe,areFileExtensionsShown:R,latestSelectedId:C,isResourceClickable:Se,getResourceLink:ae,isSticky:l,isResourceInDeleteQueue:Ae}},data(){return{constants:{ImageDimension:Vr,EVENT_TROW_MOUNTED:Ev}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const r=Sh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"status",prop:"disabled",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.mdate)+" ("+this.formatDate(n.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.sdate)+" ("+this.formatDate(n.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:n=>this.formatDateRelative(n.ddate)+" ("+this.formatDate(n.ddate)+")"}].filter(n=>{if(n.name==="tags"&&!this.hasTags)return!1;let o;return n.prop?o=xl(e,n.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,n.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(n.name):o}).map(n=>{const o=r.find(i=>i.name===n.name);return o&&Object.assign(n,{sortable:o.sortable,sortDir:o.sortDir}),n})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ti.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var r;const t=(r=m(this.router.currentRoute).query)==null?void 0:r.term;return Ai("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return ie.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length},openRenameDialog(e){if(ie.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Ye.publish(mt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Ye.publish(mt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Df,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,r){var s,l;if((((s=r.dataTransfer)==null?void 0:s.types)||[]).some(c=>c==="Files")||(l=r.currentTarget)!=null&&l.contains(r.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:r,event:n}=e;(r==null?void 0:r.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),To(r.tippy,n,this.contextMenuButton))},showContextMenu(e,t,r){if(t.preventDefault(),this.isResourceDisabled(r))return!1;const n=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];n!==void 0&&(this.isResourceSelected(r)||this.emitSelect([r.id]),To(n._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,l;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(Zs(m(this.router.currentRoute))))});const r=e[1],n=e[2]??!1,o=(r==null?void 0:r.target).getAttribute("type")==="checkbox";if(((l=(s=r==null?void 0:r.target)==null?void 0:s.closest("div"))==null?void 0:l.id)!=="oc-files-context-menu"){if(r&&r.metaKey)return Ye.publish("app.files.list.clicked.meta",t);if(r&&r.shiftKey)return Ye.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:n});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return Sb(new Date(e),this.$language.current)},formatDateRelative(e){return Tb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!ie.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),r=e.sharedWith.filter(({shareType:n})=>ie.ShareTypes.authenticated.includes(ie.ShareTypes.getByValue(n))).length;return r?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",r,{resourceType:t,shareCount:r.toString()}):""},getSharedByAvatarDescription(e){if(!ie.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:r})=>r).join(", ")})},getSharedByAvatarItems(e){return ie.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,shareType:ie.ShareTypes.user.value,username:t.id})):[]},getSharedWithAvatarItems(e){return ie.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>ie.ShareTypes.authenticated.includes(ie.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,shareType:t.shareType,username:t.id})):[]}}}),w2={class:"resource-table-select-all"},S2={class:"oc-text-truncate"},E2=["textContent"],T2=["textContent"],A2=["textContent"],R2={key:0,class:"resource-table-actions"};function _2(e,t,r,n,o,i){const s=de("oc-checkbox"),l=de("oc-spinner"),c=de("resource-list-item"),u=de("oc-icon"),a=de("oc-button"),f=de("resource-size"),d=de("oc-tag"),b=de("oc-status-indicators"),E=de("oc-avatars"),S=de("context-menu-quick-action"),T=de("oc-table"),w=de("resource-ghost-element"),y=ur("oc-tooltip");return te(),ve(Xe,null,[be(T,Yt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&e.isSideBarOpen,"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&e.isSideBarOpen}],data:e.resources,fields:e.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=g=>e.$emit("update:modelValue",g))}),Yd({name:Te(({item:g})=>[pe("div",{class:K.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(g)}]])},[Ke(e.$slots,"image",{resource:g}),(te(),Ce(c,{key:`${g.path}-${e.resourceDomSelector(g)}-${g.thumbnail}`,resource:g,"path-prefix":e.getPathPrefix(g),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(g),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(g),link:e.getResourceLink(g),"parent-folder-link":e.getParentFolderLink(g),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(g),class:K.normalizeClass({"resource-table-resource-cut":e.isResourceCut(g)}),onClick:v=>e.emitFileClick(g)},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),e.hasRenameAction(g)?(te(),Ce(a,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:v=>e.openRenameDialog(g)},{default:Te(()=>[be(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):ke("",!0)],2),Ke(e.$slots,"additionalResourceContent",{resource:g})]),syncEnabled:Te(({item:g})=>[Ke(e.$slots,"syncEnabled",{resource:g})]),size:Te(({item:g})=>[be(f,{size:g.size||Number.NaN},null,8,["size"])]),tags:Te(({item:g})=>[(te(!0),ve(Xe,null,kt(g.tags.slice(0,2),v=>(te(),Ce(Hn(e.userContextReady?"router-link":"span"),Yt({key:v,ref_for:!0},e.getTagComponentAttrs(v),{class:"resource-table-tag-wrapper"}),{default:Te(()=>[at((te(),Ce(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Te(()=>[be(u,{name:"price-tag-3",size:"small"}),pe("span",S2,K.toDisplayString(v),1)]),_:2},1024)),[[y,e.getTagToolTip(v)]])]),_:2},1040))),128)),g.tags.length>2?(te(),Ce(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Te(()=>[Vt(" + "+K.toDisplayString(g.tags.length-2),1)]),_:2},1032,["onClick"])):ke("",!0)]),manager:Te(({item:g})=>[Ke(e.$slots,"manager",{resource:g})]),members:Te(({item:g})=>[Ke(e.$slots,"members",{resource:g})]),totalQuota:Te(({item:g})=>[Ke(e.$slots,"totalQuota",{resource:g})]),usedQuota:Te(({item:g})=>[Ke(e.$slots,"usedQuota",{resource:g})]),remainingQuota:Te(({item:g})=>[Ke(e.$slots,"remainingQuota",{resource:g})]),mdate:Te(({item:g})=>[at(pe("span",{tabindex:"0",textContent:K.toDisplayString(e.formatDateRelative(g.mdate))},null,8,E2),[[y,e.formatDate(g.mdate)]])]),indicators:Te(({item:g})=>[g.indicators.length?(te(),Ce(b,{key:0,resource:g,indicators:g.indicators,"disable-handler":e.isResourceDisabled(g)},null,8,["resource","indicators","disable-handler"])):ke("",!0)]),status:Te(({item:g})=>[at(be(u,{name:g.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[y,g.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Te(({item:g})=>[at(pe("span",{tabindex:"0",textContent:K.toDisplayString(e.formatDateRelative(g.sdate))},null,8,T2),[[y,e.formatDate(g.sdate)]])]),ddate:Te(({item:g})=>[at(pe("p",{tabindex:"0",class:"oc-m-rm",textContent:K.toDisplayString(e.formatDateRelative(g.ddate))},null,8,A2),[[y,e.formatDate(g.ddate)]])]),sharedBy:Te(({item:g})=>[be(a,{appearance:"raw-inverse",class:"resource-table-shared-by",onClick:v=>e.openSharingSidebar(g)},{default:Te(()=>[be(E,{class:"resource-table-people",items:e.getSharedByAvatarItems(g),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(g)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Te(({item:g})=>[be(a,{appearance:"raw-inverse",class:"resource-table-shared-with",onClick:v=>e.openSharingSidebar(g)},{default:Te(()=>[be(E,{class:"resource-table-people",items:e.getSharedWithAvatarItems(g),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(g)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Te(({item:g})=>[e.isResourceDisabled(g)?ke("",!0):(te(),ve("div",R2,[Ke(e.$slots,"quickActions",{resource:g}),be(S,{ref:"contextMenuButton",item:g,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:v=>e.showContextMenuOnBtnClick(v,g)},{contextMenu:Te(()=>[Ke(e.$slots,"contextMenu",{resource:g})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Te(()=>[pe("div",w2,[at(be(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:Tr(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[y,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Te(({item:g})=>[e.isResourceInDeleteQueue(g.id)?(te(),Ce(l,{key:0,class:"resource-table-activity-indicator",size:"medium"})):(te(),Ce(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(g)}`,label:e.getResourceCheckboxLabel(g),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(g),"model-value":e.isResourceSelected(g),outline:e.isLatestSelectedItem(g),onClick:Tr(v=>e.toggleSelection(g.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Te(()=>[Ke(e.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(te(),Ce(Wd,{key:0,to:"body"},[be(w,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):ke("",!0)],64)}const I2=qe(v2,[["render",_2]]),C2=je({name:"ResourceTile",components:{ResourceListItem:Oo,ResourceIcon:xo,ResourceLink:Lf},props:{resource:{type:Object,default:()=>({})},resourceRoute:{type:Object,required:!1,default:null},isResourceSelected:{type:Boolean,required:!1,default:!1},isResourceClickable:{type:Boolean,required:!1,default:!0},isResourceDisabled:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{type:String,default:"xlarge",validator:e=>["large","xlarge","xxlarge","xxxlarge"].includes(e)},lazy:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const{$gettext:r}=$e.useGettext(),n=Pd((f,d)=>{let b;return{get(){return f(),b},set(E){b=E,d()}}}),o=V(()=>e.resource.locked||e.resource.processing),i=V(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),s=V(()=>e.resource.locked?r("This item is locked"):null),l=V(()=>ie.isSpaceResource(e.resource)?e.resource.description:""),c=f=>f.thumbnail,{isVisible:u}=e.lazy?E0({target:n,onVisibleCallback:()=>t("itemVisible")}):{isVisible:ce(!0)},a=V(()=>!m(u));return e.lazy||t("itemVisible"),{statusIconAttrs:i,showStatusIcon:o,tooltipLabelIcon:s,resourceDescription:l,shouldDisplayThumbnails:c,isProjectSpaceResource:ie.isProjectSpaceResource,isHidden:a,observerTarget:n}}}),F2=["data-item-id"],P2={key:0,class:"oc-tile-card-lazy-shimmer"},x2={class:"oc-tile-card-selection"},O2=["textContent"],k2=["aria-label"],N2={class:"oc-card-body oc-p-s"},$2={class:"oc-flex oc-flex-between oc-flex-middle"},D2={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},L2={class:"oc-flex oc-flex-middle"},B2={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},M2=["textContent"];function j2(e,t,r,n,o,i){const s=de("oc-tag"),l=de("oc-image"),c=de("oc-icon"),u=de("resource-icon"),a=de("resource-link"),f=de("resource-list-item"),d=ur("oc-tooltip");return te(),ve("div",{ref:"observerTarget",class:K.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":e.isResourceSelected,"oc-tile-card-disabled":e.isResourceDisabled&&!e.isProjectSpaceResource(e.resource),"state-trashed":e.isResourceDisabled&&e.isProjectSpaceResource(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:t[2]||(t[2]=b=>e.$emit("contextmenu",b))},[e.isHidden?(te(),ve("div",P2)):(te(),ve(Xe,{key:1},[be(a,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:t[0]||(t[0]=b=>e.$emit("click"))},{default:Te(()=>[pe("div",x2,[Ke(e.$slots,"selection",{item:e.resource})]),e.isResourceDisabled&&e.isProjectSpaceResource(e.resource)?(te(),Ce(s,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Te(()=>[pe("span",{textContent:K.toDisplayString(e.$gettext("Disabled"))},null,8,O2)]),_:1})):ke("",!0),at((te(),ve("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":e.tooltipLabelIcon},[Ke(e.$slots,"imageField",{item:e.resource},()=>[e.shouldDisplayThumbnails(e.resource)?(te(),Ce(l,{key:0,class:"tile-preview",src:e.resource.thumbnail},null,8,["src"])):(te(),Ce(u,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image oc-pt-xs"},Yd({_:2},[e.showStatusIcon?{name:"status",fn:Te(()=>[be(c,Yt(e.statusIconAttrs,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,k2)),[[d,e.tooltipLabelIcon]])]),_:3},8,["resource","link","is-resource-clickable"]),pe("div",N2,[pe("div",$2,[pe("div",D2,[be(f,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,link:e.resourceRoute,onClick:t[1]||(t[1]=b=>e.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),pe("div",L2,[Ke(e.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ke(e.$slots,"actions",{item:e.resource}),Ke(e.$slots,"contextMenu",{item:e.resource})])]),e.resourceDescription?(te(),ve("p",B2,[pe("small",{textContent:K.toDisplayString(e.resourceDescription)},null,8,M2)])):ke("",!0)])],64))],42,F2)}const I0=qe(C2,[["render",j2]]),U2=je({name:"ResourceTiles",components:{ContextMenuQuickAction:Qf,ResourceGhostElement:Xf,ResourceTile:I0},props:{resources:{type:Array,default:()=>[]},selectedIds:{type:Array,default:()=>[]},targetRouteCallback:{type:Function,required:!1,default:void 0},space:{type:Object,required:!1,default:null},sortFields:{type:Array,default:()=>[]},sortBy:{type:String,required:!1,default:void 0},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Ft.Asc.toString(),Ft.Desc.toString()].includes(e)},viewSize:{type:Number,required:!1,default:()=>Gt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileClick","fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,t){const{$gettext:r}=$e.useGettext(),n=We(),o=Qe(),{getDefaultAction:i}=qr(),{getMatchingSpace:s}=sr(),{canBeOpenedWithSecureView:l}=Vf(),{emit:c}=t,{isEnabled:u,fileTypes:a,isLocationPicker:f,isFilePicker:d,postMessage:b}=ni(),E=zf(),S=V(()=>Math.min(m(E),e.viewSize)),T=V(()=>o.areFileExtensionsShown),w=V(()=>m(Me)?r("Clear selection"):r("Select all")),y=ce(),g=ce(),v=ce({tiles:{},dropBtns:{}}),A=da({space:ce(e.space),targetRouteCallback:V(()=>e.targetRouteCallback)},t),R=ee=>{if(ie.isSpaceResource(ee))return ee.disabled?null:xr("files-spaces-generic",Jr(ee,{path:"",fileId:ee.fileId}));if(ee.isFolder)return A.createFolderLink({path:ee.path,fileId:ee.fileId,resource:ee});let Pe=e.space;Pe||(Pe=s(ee));const Ue=i({resources:[ee],space:Pe});return Ue!=null&&Ue.route?Ue.route({space:Pe,resources:[ee]}):null},C=ee=>{if(m(u)&&m(d))return b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(ee)),locationQuery:JSON.parse(JSON.stringify(Zs(m(n.currentRoute))))});ee.type!=="space"&&ee.type!=="folder"&&A.createFileAction(ee)},P=(ee,Pe,Ue)=>{const{dropdown:ze,event:Ze}=ee;(ze==null?void 0:ze.tippy)!==void 0&&(o.setSelection([Pe.id]),To(ze.tippy,Ze,m(v).dropBtns[Ue]))},_=ee=>e.selectedIds.includes(ee.id),L=V(()=>e.resources.filter(ee=>e.selectedIds.includes(ee.id))),B=ee=>$(ee)?!1:ee.isFolder?!0:!(!ee.canDownload()&&!l(ee)||m(u)&&!m(d)),$=ee=>{var Pe;return m(u)&&((Pe=m(a))!=null&&Pe.length)?!m(a).includes(ee.extension)&&!m(a).includes(ee.mimeType)&&!ee.isFolder:ie.isSpaceResource(ee)&&ee.disabled?!0:ee.processing===!0},D=V(()=>{var ee,Pe;return((Pe=(ee=e.resources)==null?void 0:ee.filter(Ue=>$(Ue)===!0))==null?void 0:Pe.map(Ue=>Ue.id))||[]}),H=ee=>{c("update:selectedIds",ee)},X=()=>{if(m(Me))return c("update:selectedIds",[]);c("update:selectedIds",e.resources.filter(ee=>!m(D).includes(ee.id)).map(ee=>ee.id))},J=(ee,Pe,Ue)=>{var Ze;ee.preventDefault();const ze=(Ze=m(v).tiles[Pe.id])==null?void 0:Ze.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];ze!==void 0&&(_(Pe)||H([Pe.id]),To(ze._tippy,ee,Ue))},le=ee=>{const Pe=ee[0],Ue=ee[1];if(Ue&&Ue.metaKey)return Ye.publish("app.files.list.clicked.meta",Pe);if(Ue&&Ue.shiftKey)return Ye.publish("app.files.list.clicked.shift",{resource:Pe,skipTargetSelection:!1});me(Pe)},me=ee=>{const Pe=_(ee)?e.selectedIds.filter(Ue=>Ue!==ee.id):[...e.selectedIds,ee.id];t.emit("update:selectedIds",Pe)},fe=ee=>{switch(ee.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},we=V(()=>e.sortFields.find(ee=>ee.name===e.sortBy&&ee.sortDir===e.sortDir)||e.sortFields[0]),Se=ee=>{t.emit("sort",{sortBy:ee.name,sortDir:ee.sortDir})},re=ee=>m(we)===ee,oe=V(()=>{const ee={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Pe=m(S);return ee[Pe]??"xxlarge"});nS(()=>{v.value={tiles:{},dropBtns:{}}});const ae=(ee,Pe,Ue)=>{var vt,et;if((((vt=Ue.dataTransfer)==null?void 0:vt.types)||[]).some(jt=>jt==="Files")||(et=Ue.currentTarget)!=null&&et.contains(Ue.relatedTarget)||e.selectedIds.includes(ee.id)||ee.type!=="folder")return;const Ze=m(v).tiles[ee.id];if(Pe){Ze.$el.classList.remove("oc-tiles-item-drop-highlight");return}Ze.$el.classList.add("oc-tiles-item-drop-highlight")},Ae=V(()=>e.selectedIds.filter(ee=>ee!==m(y).id)),Z=async(ee,Pe)=>{y.value=ee,await Hr(),m(g).$el.ariaHidden="true",m(g).$el.style.left="-99999px",m(g).$el.style.top="-99999px",Pe.dataTransfer.setDragImage(m(g).$el,0,0),Pe.dataTransfer.dropEffect="move",Pe.dataTransfer.effectAllowed="move"},F=async(ee,Pe)=>{_(ee)||me(ee),await Z(ee,Pe)},O=(ee,Pe)=>{(Pe.dataTransfer.types||[]).some(ze=>ze==="Files")||(y.value=null,ae(ee,!0,Pe),t.emit("fileDropped",ee.id))},Q=ee=>ee.indicators.filter(Pe=>Pe.category==="system"),W=ce(0),U=()=>{const ee=document.getElementById("tiles-view"),Pe=getComputedStyle(ee),Ue=parseInt(Pe.getPropertyValue("padding-left"),10)|0,ze=parseInt(Pe.getPropertyValue("padding-right"),10)|0;W.value=ee.clientWidth-Ue-ze},z=V(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:ue}=Kv(),_e=V(()=>{const ee=[...Array(Gt.tilesSizeMax).keys()].map(Pe=>Pe+1);return[...new Set(ee.map(Pe=>{const Ue=ue(Pe);return Ue?Math.round(m(W)/(Ue+m(z))):0}))]}),Be=V(()=>{const ee=m(_e);return ee.length<m(S)?ee[ee.length-1]:ee[m(S)-1]}),xe=V(()=>{const ee=m(Be)?e.resources.length%m(Be):0;return ee?m(Be)-ee:0}),Fe=V(()=>m(W)/m(Be)-m(z)),Me=V(()=>{const ee=m(D).length===e.resources.length,Pe=m(L).length===e.resources.length-m(D).length;return!ee&&Pe});return Tt(Fe,ee=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${ee}px`)},{immediate:!0}),Tt(_e,ee=>{E.value=Math.max(ee.length,1)}),qt(()=>{window.addEventListener("resize",U),U()}),Gr(()=>{window.removeEventListener("resize",U)}),{areFileExtensionsShown:T,emitTileClick:C,getRoute:R,showContextMenuOnBtnClick:P,showContextMenu:J,tileRefs:v,isResourceSelected:_,toggleTile:le,toggleSelection:me,getResourceCheckboxLabel:fe,selectSorting:Se,isSortFieldSelected:re,isResourceClickable:B,currentSortField:we,resourceIconSize:oe,ghostElementRef:g,dragItem:y,dragStart:F,dragSelection:Ae,fileDropped:O,setDropStyling:ae,ghostTilesCount:xe,getIndicators:Q,isFilePicker:d,isLocationPicker:f,isResourceDisabled:$,isSpaceResource:ie.isSpaceResource,areAllResourcesSelected:Me,disabledResourceIds:D,toggleSelectionAll:X,selectAllCheckboxLabel:w}},data(){return{ImageDimension:Vr}}}),q2={id:"tiles-view",class:"oc-px-m oc-pt-l"},V2={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},z2={key:0,class:"oc-tiles-sort"},W2={key:0,class:"oc-flex"},H2={class:"oc-tiles-footer"};function G2(e,t,r,n,o,i){const s=de("oc-checkbox"),l=de("oc-icon"),c=de("oc-button"),u=de("oc-filter-chip"),a=de("oc-status-indicators"),f=de("context-menu-quick-action"),d=de("resource-tile"),b=de("oc-list"),E=de("resource-ghost-element"),S=ur("oc-tooltip");return te(),ve("div",q2,[pe("div",V2,[at(be(s,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:e.selectAllCheckboxLabel,"label-hidden":!0,disabled:e.resources.length===e.disabledResourceIds.length,"model-value":e.areAllResourcesSelected,onClick:Tr(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[S,e.selectAllCheckboxLabel]]),e.sortFields.length?(te(),ve("div",z2,[be(u,{class:"oc-tiles-sort-filter-chip","filter-label":e.currentSortField.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.sortFields,(T,w)=>(te(),Ce(c,{key:w,appearance:"raw",size:"medium","justify-content":"space-between",class:K.normalizeClass(["oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"oc-tiles-sort-filter-chip-item-active":e.currentSortField===T,"oc-mt-xs":w>0}]),onClick:y=>e.selectSorting(T)},{default:Te(()=>[pe("span",null,K.toDisplayString(T.label),1),T===e.currentSortField?(te(),ve("div",W2,[be(l,{name:"check"})])):ke("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):ke("",!0)]),be(b,{class:"oc-tiles"},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.resources,T=>(te(),ve("li",{key:T.id,class:"oc-tiles-item has-item-context-menu"},[be(d,{ref_for:!0,ref:w=>e.tileRefs.tiles[T.id]=w,resource:T,"resource-route":e.getRoute(T),"is-resource-selected":e.isResourceSelected(T),"is-resource-clickable":e.isResourceClickable(T),"is-resource-disabled":e.isResourceDisabled(T),"is-extension-displayed":e.areFileExtensionsShown,"resource-icon-size":e.resourceIconSize,draggable:e.dragDrop,lazy:e.lazy,onVnodeMounted:w=>e.$emit("rowMounted",T,e.tileRefs.tiles[T.id],e.ImageDimension.Tile),onContextmenu:w=>e.showContextMenu(w,T,e.tileRefs.tiles[T.id]),onClick:w=>e.emitTileClick(T),onDragstart:w=>e.dragStart(T,w),onDragenter:Tr(w=>e.setDropStyling(T,!1,w),["prevent"]),onDragleave:Tr(w=>e.setDropStyling(T,!0,w),["prevent"]),onDrop:w=>e.fileDropped(T,w),onDragover:t[0]||(t[0]=w=>w.preventDefault()),onItemVisible:w=>e.$emit("itemVisible",T)},{selection:Te(()=>[!e.isLocationPicker&&!e.isFilePicker?(te(),Ce(s,{key:0,label:e.getResourceCheckboxLabel(T),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:!e.isSpaceResource(T)&&e.isResourceDisabled(T),"model-value":e.isResourceSelected(T),onClick:Tr(w=>e.toggleTile([T,w]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):ke("",!0)]),imageField:Te(()=>[Ke(e.$slots,"image",{resource:T})]),indicators:Te(()=>[e.getIndicators(T).length?(te(),Ce(a,{key:0,resource:T,indicators:e.getIndicators(T),"disable-handler":!e.isSpaceResource(T)&&e.isResourceDisabled(T)},null,8,["resource","indicators","disable-handler"])):ke("",!0)]),actions:Te(()=>[Ke(e.$slots,"actions",{resource:T})]),contextMenu:Te(()=>[e.isSpaceResource(T)||!e.isResourceDisabled(T)?(te(),Ce(f,{key:0,ref_for:!0,ref:w=>e.tileRefs.dropBtns[T.id]=w,item:T,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:w=>e.showContextMenuOnBtnClick(w,T,T.id)},{contextMenu:Te(()=>[Ke(e.$slots,"contextMenu",{resource:T})]),_:2},1032,["item","onQuickActionClicked"])):ke("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(te(!0),ve(Xe,null,kt(e.ghostTilesCount,T=>(te(),ve("li",{key:`ghost-tile-${T}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),e.dragItem?(te(),Ce(Wd,{key:0,to:"body"},[be(E,{ref:"ghostElementRef","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):ke("",!0),pe("div",H2,[Ke(e.$slots,"footer")])])}const K2=qe(U2,[["render",G2]]),Q2=je({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:r}){const n=We(),{current:o}=$e.useGettext(),i=Jt(),s=ce(),l=ce(e.items),c=ce(),u=ce(),a=ce(!1),f=ce(),d=`q_${e.filterName}`,b=rr(d),E=$=>$[e.idAttribute],S=()=>n.push({query:{...$i(m(i).query,[d]),...m(s)&&{[d]:E(m(s))}}}),T=$=>m(s)&&E(m(s))===E($),w=()=>{c.value=void 0,u.value=void 0},y=async $=>{w(),T($)?s.value=void 0:(s.value=$,m(f).hideDrop()),await S(),t("selectionChange",m(s))},g=()=>{s.value=void 0,a.value=!1,w(),t("selectionChange",m(s)),S()},v=()=>{l.value=e.items},A=()=>{a.value=!1},R=()=>{const $=St(m(b));if(!$)return;const D=e.items.find(H=>E(H)===$);if(D){s.value=D;return}if(m(C)){const H=$.replace("range:",""),X=Number(H.split(" - ")[0]),J=Number(H.split(" - ")[1]);c.value=Dt.DateTime.fromMillis(X),u.value=Dt.DateTime.fromMillis(J),s.value=m(_)}},C=V(()=>{var $;return($=St(m(b)))==null?void 0:$.startsWith("range:")}),P=V(()=>!m(c)||!m(u)?!1:m(c)<=m(u)),_=V(()=>{if(!m(c)||!m(u))return null;const $=ri(m(c),o,Dt.DateTime.DATE_SHORT),D=ri(m(u),o,Dt.DateTime.DATE_SHORT),H=m(c).toMillis(),X=m(u).toMillis();return{[e.idAttribute]:`range:${H} - ${X}`,[e.displayNameAttribute]:`${$} - ${D}`}}),L=async()=>{s.value=m(_),await S(),m(f).hideDrop(),t("selectionChange",m(s))},B=({date:$,error:D},H)=>{if(D){console.error(D);return}const X=H==="from"?c:u;if(!$){X.value=void 0;return}const J=H==="from"?$.startOf("day"):$.endOf("day");X.value=J};return r({setSelectedItemsBasedOnQuery:R}),qt(()=>{R()}),{clearFilter:g,displayedItems:l,isItemSelected:T,selectedItem:s,onShowDrop:v,onHideDrop:A,filterChip:f,toggleItemSelection:y,setSelectedItemsBasedOnQuery:R,fromDate:c,toDate:u,dateRangeValid:P,applyDateRangeFilter:L,dateRangeApplied:C,setDateRangeDate:B,dateRangeClicked:a,queryParam:d}}}),X2={class:"oc-flex oc-flex-middle oc-text-truncate"},Y2={class:"oc-text-truncate oc-ml-s"},J2={class:"oc-flex"},Z2={class:"oc-my-xs"},eD={class:"oc-flex oc-flex-middle oc-text-truncate"},tD={class:"oc-text-truncate oc-ml-s"},rD=["textContent"],nD={class:"oc-flex"},iD={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},oD=["textContent"],sD={class:"oc-mt-s"},aD={class:"date-filter-apply-btn"};function lD(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-button"),c=de("oc-list"),u=de("oc-datepicker"),a=de("oc-filter-chip");return te(),ve("div",{class:K.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[be(a,{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:Te(()=>[be(c,{class:K.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.displayedItems,(f,d)=>(te(),ve("li",{key:d,class:"oc-my-xs"},[be(l,{class:K.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:b=>e.toggleItemSelection(f)},{default:Te(()=>[pe("div",X2,[pe("div",Y2,[Ke(e.$slots,"item",{item:f})])]),pe("div",J2,[e.isItemSelected(f)?(te(),Ce(s,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),pe("li",Z2,[be(l,{class:K.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:Te(()=>[pe("div",eD,[pe("div",tD,[pe("span",{textContent:K.toDisplayString(e.$gettext("Custom date range"))},null,8,rD)])]),pe("div",nD,[e.dateRangeApplied?(te(),Ce(s,{key:0,name:"check"})):ke("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),pe("div",{class:K.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[pe("div",iD,[be(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Te(()=>[be(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),pe("span",{textContent:K.toDisplayString(e.$gettext("Custom date range"))},null,8,oD),be(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Te(()=>[be(s,{name:"close"})]),_:1},8,["aria-label"])]),pe("div",sD,[be(u,{label:e.$gettext("From"),type:"date","is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),be(u,{label:e.$gettext("To"),type:"date","is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),pe("div",aD,[be(l,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Te(()=>[Vt(K.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const cD=qe(Q2,[["render",lD]]),uD=je({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const r=We(),n=Jt(),o=ce(e.filterOptions[0].name),i=`q_${e.filterName}`,s=rr(i),l=u=>r.push({query:{...$i(m(n).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await l(u.name),t("toggleFilter",u)};return qt(()=>{const u=St(m(s));u&&e.filterOptions.some(({name:a})=>a===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:a})=>a===u)))}),{queryParam:i,activeOption:o,toggleFilter:c}}}),fD=["textContent"];function dD(e,t,r,n,o,i){const s=de("oc-button");return te(),ve("div",null,[pe("div",{class:K.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(te(!0),ve(Xe,null,kt(e.filterOptions,(l,c)=>(te(),Ce(s,{id:l.name,key:c,class:K.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:"raw-inverse","color-role":"surface",onClick:u=>e.toggleFilter(l)},{default:Te(()=>[pe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:K.toDisplayString(l.label)},null,8,fD)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const pD=qe(uD,[["render",dD]]),hD=je({name:"SpaceQuota",props:{spaceQuota:{type:Object,required:!0,default:()=>{}}},setup:()=>{const{current:e}=$e.useGettext();return{currentLanguage:e}},computed:{spaceStorageDetailsLabel(){return this.spaceQuota.total?this.$gettext("%{used} of %{total} used (%{percentage}% used)",{used:this.quotaUsed,total:this.quotaTotal,percentage:this.quotaUsagePercent.toString()}):this.$gettext("%{used} used (no restriction)",{used:this.quotaUsed})},quotaTotal(){return wr(this.spaceQuota.total,this.currentLanguage)},quotaUsed(){return wr(this.spaceQuota.used,this.currentLanguage)},quotaUsagePercent(){return parseFloat((this.spaceQuota.used/this.spaceQuota.total*100).toFixed(2))},quotaProgressColor(){switch(this.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}}}}),gD={class:"space-quota"},mD=["textContent"];function yD(e,t,r,n,o,i){const s=de("oc-progress");return te(),ve("div",gD,[pe("p",{class:"oc-mb-s oc-mt-rm",textContent:K.toDisplayString(e.spaceStorageDetailsLabel)},null,8,mD),be(s,{value:e.quotaUsagePercent,max:100,size:"small",color:e.quotaProgressColor},null,8,["value","color"])])}const C0=qe(hD,[["render",yD]]),bD=je({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Cn("resource"),r="check",n="file-copy",o=ce(n),i=ce(n),s=V(()=>yf(m(t).webDavPath)),l=V(()=>{var a;return(a=e.space)==null?void 0:a.getWebDavUrl({path:m(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(m(s)),o.value=r,setTimeout(()=>o.value=n,1500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(m(l)),i.value=r,setTimeout(()=>i.value=n,1500)},webDavPath:s,webDavUrl:l}}}),vD={class:"oc-flex"},wD=["textContent"],SD={class:"oc-flex"},ED=["textContent"];function TD(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-button"),c=ur("oc-tooltip");return te(),ve(Xe,null,[pe("dt",null,K.toDisplayString(e.$gettext("WebDAV path")),1),pe("dd",vD,[at(pe("div",{class:"oc-text-truncate",textContent:K.toDisplayString(e.webDavPath)},null,8,wD),[[c,e.webDavPath]]),at((te(),Ce(l,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Te(()=>[be(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),pe("dt",null,K.toDisplayString(e.$gettext("WebDAV URL")),1),pe("dd",SD,[at(pe("div",{class:"oc-text-truncate",textContent:K.toDisplayString(e.webDavUrl)},null,8,ED),[[c,e.webDavUrl]]),at((te(),Ce(l,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Te(()=>[be(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const F0=qe(bD,[["render",TD]]),AD=je({name:"SpaceDetails",components:{SpaceQuota:C0,WebDavDetails:F0},props:{showSpaceImage:{type:Boolean,required:!1,default:!0},showShareIndicators:{type:Boolean,required:!1,default:!0}},setup(){const e=bt(),t=Qe(),{resourceContentsText:r}=Qv({showSizeInformation:!1}),n=We(),{$gettext:o,current:i}=$e.useGettext(),{loadPreview:s,previewsLoading:l}=Wf(),c=Bt(),u=Cn("resource"),a=ce(""),{user:f}=Ge.storeToRefs(e),d=V(()=>c.linkShares.length),b=V(()=>t.areWebDavDetailsShown),E=V(()=>!lt(n,"files-spaces-projects")),S=V(()=>`${wr(m(u).size,i)}, ${m(r)}`);Tt(()=>m(u).spaceImageData,async()=>{if(!m(u).spaceImageData)return;const y=ie.buildSpaceImageResource(m(u));a.value=await s({space:m(u),resource:y,dimensions:Vr.Tile,processor:zs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const T=V(()=>ie.getSpaceManagers(m(u)).map(g=>{var A;const v=g.grantedTo.user||g.grantedTo.group;return v.id===((A=m(f))==null?void 0:A.id)?o("%{displayName} (me)",{displayName:v.displayName}):v.displayName}).join(", ")),w=V(()=>Eb(m(u).mdate,i));return{spaceImage:a,resource:u,linkShareCount:d,showWebDavDetails:b,user:f,resourceContentsText:r,showSize:E,size:S,previewsLoading:l,lastModifiedDate:w,ownerUsernames:T}},computed:{hasShares(){return this.hasMemberShares||this.hasLinkShares},shareLabel(){if(this.hasMemberShares&&!this.hasLinkShares)return this.memberShareLabel;if(!this.hasMemberShares&&this.hasLinkShares)return this.linkShareLabel;switch(this.memberShareCount){case 1:return this.$ngettext("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",this.linkShareCount,{linkShareCount:this.linkShareCount.toString()});default:return this.linkShareCount===1?this.$gettext("This space has %{memberShareCount} members and one link.",{memberShareCount:this.memberShareCount.toString()}):this.$gettext("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:this.memberShareCount.toString(),linkShareCount:this.linkShareCount.toString()})}},openSharesPanelHint(){return this.$gettext("Open share panel")},openSharesPanelLinkHint(){return this.$gettext("Open link list in share panel")},openSharesPanelMembersHint(){return this.$gettext("Open member list in share panel")},hasMemberShares(){return this.memberShareCount>0},hasLinkShares(){return this.linkShareCount>0},memberShareCount(){return Object.keys(this.resource.members).length},memberShareLabel(){return this.$ngettext("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",this.memberShareCount,{memberShareCount:this.memberShareCount.toString()})},linkShareLabel(){return this.$ngettext("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",this.linkShareCount,{linkShareCount:this.linkShareCount.toString()})}},methods:{expandSharesPanel(){Ye.publish(mt.setActivePanel,"space-share")}}}),RD={id:"oc-space-details-sidebar"},_D={class:"oc-space-details-sidebar-image oc-text-center"},ID={key:1,class:"oc-position-relative"},CD=["src"],FD={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},PD=["textContent"],xD=["textContent"],OD=["aria-label"];function kD(e,t,r,n,o,i){const s=de("oc-spinner"),l=de("oc-icon"),c=de("oc-button"),u=de("space-quota"),a=de("web-dav-details"),f=de("portal-target");return te(),ve("div",RD,[pe("div",_D,[e.previewsLoading?(te(),Ce(s,{key:0})):e.spaceImage?(te(),ve("div",ID,[pe("img",{src:e.spaceImage,alt:""},null,8,CD)])):(te(),Ce(l,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),e.showShareIndicators&&e.hasShares&&!e.resource.disabled?(te(),ve("div",FD,[e.hasMemberShares?(te(),Ce(c,{key:0,appearance:"raw","aria-label":e.openSharesPanelMembersHint,"no-hover":"",onClick:e.expandSharesPanel},{default:Te(()=>[be(l,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label","onClick"])):ke("",!0),e.hasLinkShares?(te(),Ce(c,{key:1,appearance:"raw","aria-label":e.openSharesPanelLinkHint,"no-hover":"",onClick:e.expandSharesPanel},{default:Te(()=>[be(l,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label","onClick"])):ke("",!0),pe("p",{textContent:K.toDisplayString(e.shareLabel)},null,8,PD),be(c,{appearance:"raw","aria-label":e.openSharesPanelHint,size:"small","no-hover":"",onClick:e.expandSharesPanel},{default:Te(()=>[pe("span",{class:"oc-text-small",textContent:K.toDisplayString(e.$gettext("Show"))},null,8,xD)]),_:1},8,["aria-label","onClick"])])):ke("",!0),pe("dl",{class:"details-list oc-m-rm","aria-label":e.$gettext("Overview of the information about the selected space")},[pe("dt",null,K.toDisplayString(e.$gettext("Last activity")),1),pe("dd",null,K.toDisplayString(e.lastModifiedDate),1),e.resource.description?(te(),ve(Xe,{key:0},[pe("dt",null,K.toDisplayString(e.$gettext("Subtitle")),1),pe("dd",null,K.toDisplayString(e.resource.description),1)],64)):ke("",!0),pe("dt",null,K.toDisplayString(e.$gettext("Manager")),1),pe("dd",null,K.toDisplayString(e.ownerUsernames),1),e.resource.disabled?ke("",!0):(te(),ve(Xe,{key:1},[pe("dt",null,K.toDisplayString(e.$gettext("Quota")),1),pe("dd",null,[be(u,{"space-quota":e.resource.spaceQuota},null,8,["space-quota"])])],64)),e.showSize?(te(),ve(Xe,{key:2},[pe("dt",null,K.toDisplayString(e.$gettext("Size")),1),pe("dd",null,K.toDisplayString(e.size),1)],64)):ke("",!0),e.showWebDavDetails?(te(),Ce(a,{key:3,space:e.resource},null,8,["space"])):ke("",!0),be(f,{name:"app.files.sidebar.space.details.table","slot-props":{space:e.resource,resource:e.resource},multiple:!0},null,8,["slot-props"])],8,OD)])}const ND=qe(AD,[["render",kD],["__scopeId","data-v-66f24fcb"]]),$D=je({name:"SpaceDetailsMultiple",props:{selectedSpaces:{type:Array,required:!0}},setup(e){const t=$e.useGettext(),{$gettext:r,$ngettext:n}=t,o=V(()=>{let d=0;return e.selectedSpaces.forEach(b=>{d+=b.spaceQuota.total}),wr(d,t.current)}),i=V(()=>{let d=0;return e.selectedSpaces.forEach(b=>{b.disabled||(d+=b.spaceQuota.remaining)}),wr(d,t.current)}),s=V(()=>{let d=0;return e.selectedSpaces.forEach(b=>{b.disabled||(d+=b.spaceQuota.used)}),wr(d,t.current)}),l=V(()=>e.selectedSpaces.filter(d=>!d.disabled).length),c=V(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=V(()=>r("Overview of the information about the selected spaces")),a=V(()=>n("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=[{term:r("Total quota:"),definition:m(o)},{term:r("Remaining quota:"),definition:m(i)},{term:r("Used quota:"),definition:m(s)},{term:r("Enabled:"),definition:m(l)},{term:r("Disabled:"),definition:m(c)}];return{detailsTableLabel:u,items:f,selectedSpacesString:a}}}),DD={id:"oc-spaces-details-multiple-sidebar"},LD={class:"spaces-preview oc-mb-l"},BD={class:"spaces-preview-body"},MD=["textContent"];function jD(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-definition-list");return te(),ve("div",DD,[pe("div",LD,[pe("div",BD,[be(s,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),pe("p",{class:"preview-text",textContent:K.toDisplayString(e.selectedSpacesString)},null,8,MD)])]),be(l,{"aria-label":e.detailsTableLabel,items:e.items},null,8,["aria-label","items"])])}const UD=qe($D,[["render",jD],["__scopeId","data-v-81b067a6"]]),qD=je({name:"SpaceNoSelection"}),VD={class:"oc-mt-xl"},zD={class:"oc-flex space-info oc-text-center"};function WD(e,t,r,n,o,i){const s=de("oc-icon"),l=ur("translate");return te(),ve("div",VD,[pe("div",zD,[be(s,{name:"layout-grid",size:"xxlarge"}),at((te(),ve("p",null,t[0]||(t[0]=[Vt("Select a space to view details")]))),[[l]])])])}const HD=qe(qD,[["render",WD]]),GD=je({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=ce(!1);let t;return qt(()=>{t=Ye.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Gr(()=>{Ye.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!lb(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}}}),KD={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},QD={key:0,class:"state-indicator oc-flex oc-flex-middle"},XD=["textContent"],YD={key:1,class:"state-indicator"},JD=["textContent"],ZD=["textContent"];function eL(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-button");return te(),ve("div",KD,[e.saved?(te(),ve("span",QD,[be(s,{name:"checkbox-circle"}),pe("span",{class:"oc-ml-s",textContent:K.toDisplayString(e.$gettext("Changes saved"))},null,8,XD)])):(te(),ve("span",YD,K.toDisplayString(e.unsavedChangesText),1)),pe("div",null,[be(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=c=>e.$emit("revert"))},{default:Te(()=>[pe("span",{textContent:K.toDisplayString(e.$gettext("Revert"))},null,8,JD)]),_:1},8,["disabled"]),be(l,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=c=>e.$emit("confirm"))},{default:Te(()=>[pe("span",{textContent:K.toDisplayString(e.$gettext("Save"))},null,8,ZD)]),_:1},8,["disabled"])])])}const tL=qe(GD,[["render",eL],["__scopeId","data-v-471483fe"]]),rL=eS(async()=>(await Promise.resolve().then(()=>YL)).default),nL=je({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Di(),r=xb(),n=V(()=>t.requestExtensions(e.extensionPoint)),o=r.extractDefaultExtensionIds(e.extensionPoint,m(n));return{extensions:V(()=>{if(e.extensionPoint.multiple||m(n).length<=1)return m(n);const s=r.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[m(n).find(l=>s.selectedExtensionIds.includes(l.id))||m(n)[0]]:[m(n)[0]]})}}});function iL(e,t,r,n,o,i){return te(!0),ve(Xe,null,kt(e.extensions,s=>(te(),Ce(Hn(s.content),{key:`custom-component-${s.id}`}))),128)}const oL=qe(nL,[["render",iL]]),sL=je({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:r}){const n=We(),o=Jt(),i=ce(),s=ce([]),l=ce(e.items),c=ce(null),u=ce(null),a=`q_${e.filterName}`,f=rr(a),d=R=>R[e.idAttribute],b=()=>n.push({query:{...$i(m(o).query,[a]),...!!m(s).length&&{[a]:m(s).reduce((R,C)=>(R+=`${d(C)}+`,R),"").slice(0,-1)}}}),E=R=>!!m(s).find(C=>d(C)===d(R)),S=async R=>{E(R)?s.value=m(s).filter(C=>d(C)!==d(R)):(e.allowMultiple||(s.value=[]),s.value.push(R)),await b(),t("selectionChange",m(s))},T=ce(),w=(R,C)=>{if(!(C||"").trim())return R;const _=new id(R,{...al,keys:e.filterableAttributes}).search(C).map(L=>L.item);return R.filter(L=>_.includes(L))},y=()=>{s.value=[],t("selectionChange",m(s)),b()},g=R=>{l.value=R},v=async()=>{var R;g(e.items),await Hr(),(R=m(i))==null||R.focus()};Tt(T,()=>{g(w(e.items,m(T))),m(u)&&(c.value=new sd(m(u)),m(c).unmark(),m(c).mark(m(T),{element:"span",className:"mark-highlight"}))});const A=()=>{const R=St(m(f));if(R){const C=R.split("+");s.value=e.items.filter(P=>C.includes(d(P)))}};return r({setSelectedItemsBasedOnQuery:A}),qt(()=>{A()}),{clearFilter:y,displayedItems:l,filterInputRef:i,filterTerm:T,isItemSelected:E,itemFilterListRef:u,queryParam:a,selectedItems:s,setDisplayedItems:g,showDrop:v,toggleItemSelection:S,setSelectedItemsBasedOnQuery:A}}}),aL={ref:"itemFilterListRef"},lL={class:"oc-flex oc-flex-middle oc-text-truncate"},cL={class:"oc-text-truncate oc-ml-s"},uL={class:"oc-flex"};function fL(e,t,r,n,o,i){const s=de("oc-text-input"),l=de("oc-checkbox"),c=de("oc-icon"),u=de("oc-button"),a=de("oc-list"),f=de("oc-filter-chip");return te(),ve("div",{class:K.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[be(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Te(()=>[e.showOptionFilter&&e.filterableAttributes.length?(te(),Ce(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):ke("",!0),pe("div",aL,[be(a,{class:"item-filter-list"},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.displayedItems,(d,b)=>(te(),ve("li",{key:b,class:"oc-my-xs"},[be(u,{class:K.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:E=>e.toggleItemSelection(d)},{default:Te(()=>[pe("div",lL,[e.allowMultiple?(te(),Ce(l,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":E=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=Tr(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):ke("",!0),pe("div",null,[Ke(e.$slots,"image",{item:d})]),pe("div",cL,[Ke(e.$slots,"item",{item:d})])]),pe("div",uL,[!e.allowMultiple&&e.isItemSelected(d)?(te(),Ce(c,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const dL=qe(sL,[["render",fL]]),pL=je({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const r=We(),n=Jt(),o=ce(!1),i=`q_${e.filterName}`,s=rr(i),l=()=>r.push({query:{...$i(m(n).query,[i]),...m(o)&&{[i]:"true"}}}),c=async()=>{o.value=!m(o),await l(),t("toggleFilter",m(o))};return qt(()=>{St(m(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function hL(e,t,r,n,o,i){const s=de("oc-filter-chip");return te(),ve("div",{class:K.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[be(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 gL=qe(pL,[["render",hL]]),mL=je({name:"LoadingIndicator",setup(){const e=ar();let t,r,n;const o=ce(e.isLoading),i=ce(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},l=()=>{i.value=e.currentProgress};return qt(()=>{t=Ye.subscribe(xn.add,s),r=Ye.subscribe(xn.remove,s),n=Ye.subscribe(xn.setProgress,l)}),Gr(()=>{Ye.unsubscribe(xn.add,t),Ye.unsubscribe(xn.remove,r),Ye.unsubscribe(xn.setProgress,n)}),{isLoading:o,currentProgress:i}}}),yL={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function bL(e,t,r,n,o,i){const s=de("oc-progress");return e.isLoading?(te(),ve("div",yL,[be(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):ke("",!0)}const vL=qe(mL,[["render",bL]]),wL=je({name:"NoContentMessage",props:{icon:{type:String,required:!0},iconFillType:{type:String,default:"fill"}}}),SL={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},EL={class:"oc-text-muted oc-text-xlarge"},TL={class:"oc-text-muted"};function AL(e,t,r,n,o,i){const s=de("oc-icon");return te(),ve("div",SL,[be(s,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),pe("div",EL,[Ke(e.$slots,"message")]),pe("div",TL,[Ke(e.$slots,"callToAction")])])}const RL=qe(wL,[["render",AL]]),_L=je({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function IL(e,t,r,n,o,i){const s=de("oc-pagination");return e.pages>1?(te(),Ce(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):ke("",!0)}const CL=qe(_L,[["render",IL]]),FL=je({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:r}=$e.useGettext(),n=rr("useScope"),o=ce(),i=ce(),s=V(()=>{var u;return r((u=o.value)==null?void 0:u.title)}),l=V(()=>[{id:En.currentFolder,title:r("Current folder"),enabled:e.currentFolderAvailable},{id:En.allFiles,title:r("All files"),enabled:!0}]);return Tt(()=>e.currentFolderAvailable,()=>{if(m(n)){if(m(n).toString()==="true"){o.value=m(l).find(({id:a})=>a===En.currentFolder);return}o.value=m(l).find(({id:a})=>a===En.allFiles);return}if(!e.currentFolderAvailable){o.value=m(l).find(({id:u})=>u===En.allFiles);return}if(m(i)){o.value=m(l).find(({id:u})=>u===m(i).id);return}o.value=m(l).find(({id:u})=>u===En.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:l}}}),PL={key:0},xL={key:0,class:"oc-flex"};function OL(e,t,r,n,o,i){const s=de("oc-icon"),l=de("oc-button"),c=de("oc-filter-chip");return te(),ve("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=Tr(()=>{},["stop"]))},[e.currentSelection?(te(),ve("div",PL,[be(c,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Te(()=>[(te(!0),ve(Xe,null,kt(e.locationOptions,(u,a)=>(te(),Ce(l,{key:a,appearance:"raw",size:"medium","justify-content":"space-between",class:K.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-secondary-container":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:f=>e.onOptionSelected(u)},{default:Te(()=>[pe("span",null,K.toDisplayString(u.title),1),u.id===e.currentSelection.id?(te(),ve("div",xL,[be(s,{name:"check"})])):ke("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):ke("",!0)])}const kL=qe(FL,[["render",OL]]),NL=je({name:"PortalTarget",components:{PortalTargetVue:wa.PortalTarget},props:{...wa.PortalTarget.props},setup(e){const t=V(()=>e);return qt(()=>{Ye.publish(pa.mounted,e)}),{properties:t}}});function $L(e,t,r,n,o,i){const s=de("portal-target-vue");return te(),Ce(s,K.normalizeProps(Ya(e.properties)),null,16)}const DL=qe(NL,[["render",$L]]),LL=({sortBy:e,sortDir:t})=>({groupingSettings:V(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(n){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(n.name.charAt(0)))?n.name.charAt(0)==="."?n.name.charAt(1).toLowerCase():n.name.charAt(0).toLowerCase():"#"},"Shared on":function(n){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(n.sdate)<i?"Older":Date.parse(n.sdate)>=o?"Recently":"Last month"},"Share owner":function(n){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=n==null?void 0:n.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(n){const o=n.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return m(e)==="name"&&m(t)==="desc"&&o.reverse(),o},"Shared on":function(n){const o=[],i=["Recently","Last month","Older"];for(const s of i){const l=n.find(c=>c.name.toLowerCase()===s.toLowerCase());l&&o.push(l)}return m(e)==="sdate"&&m(t)==="asc"&&o.reverse(),o},"Share owner":function(n){const o=n.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return m(e)==="owner"&&m(t)==="desc"&&o.reverse(),o}}}))}),BL={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é"}},ML={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"}},jL={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"}},UL={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"}},qL={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"}},VL={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:"Автопрокрутка"}},zL={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:"同期スクロール"}},WL={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"}},HL={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"},GL={"fr-FR":BL,"de-DE":ML,"it-IT":jL,"es-ES":UL,"pl-PL":qL,ru:VL,"jp-JP":zL,"id-ID":WL},KL=je({name:"TextEditor",components:{MdEditor:Bo.MdEditor,MdPreview:Bo.MdPreview},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const r=$e.useGettext(),{currentTheme:n}=oi(),o=V(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=V(()=>{var c;return e.markdownMode||["md","markdown"].includes((c=e.resource)==null?void 0:c.extension)||!m(o).showPreviewOnlyMd}),s=V(()=>m(n).isDark?"dark":"light");return Bo.config({editorConfig:{languageUserDefined:GL},editorExtensions:{screenfull:{instance:V0},cropper:{instance:z0}},markdownItPlugins(c){return[...c,{type:"xss",plugin:Bo.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:r,languages:HL,onUploadImg:async c=>{const a=(await Promise.all([...c].map(d=>new Promise((b,E)=>{const S=new FileReader;S.onload=()=>b(S.result),S.onerror=E,S.readAsDataURL(d)})))).map(d=>`![image](${d})`),f=`${m(e.currentContent)}
69
+ ${a.join(`
70
+
71
+ `)}
72
+ `;t("update:currentContent",f)}}}}),QL={id:"text-editor-container",class:"oc-height-1-1"};function XL(e,t,r,n,o,i){const s=de("md-preview"),l=de("md-editor");return te(),ve("div",QL,[e.isReadOnly?(te(),Ce(s,{key:0,id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":"",toolbars:[]},null,8,["model-value","language","theme"])):(te(),Ce(l,{key:1,id:"text-editor-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.isMarkdown?void 0:["revoke","next"],"toolbars-exclude":["save","katex","github","catalog","mermaid","prettier","fullscreen","htmlPreview","pageFullscreen"],"read-only":e.isReadOnly,"auto-focus":"",onOnChange:t[0]||(t[0]=c=>e.$emit("update:currentContent",c))},null,8,["model-value","on-upload-img","language","theme","preview","toolbars","read-only"]))])}const YL=Object.freeze(Object.defineProperty({__proto__:null,default:qe(KL,[["render",XL]])},Symbol.toStringTag,{value:"Module"}));j.ActionMenuItem=Gf,j.ApiError=lA,j.AppBar=Uk,j.AppLoadingSpinner=Mf,j.AppProviderService=zT,j.AppTopBar=Zv,j.AppWrapper=s0,j.AppWrapperRoute=XN,j.ArchiverService=cA,j.Auth=Mh,j.BatchActions=Xv,j.Cache=Il,j.ClientService=bA,j.ClipboardActions=ti,j.CompareSaveDialog=tL,j.ConflictDialog=sl,j.ContextActionMenu=Kf,j.ContextActions=Yv,j.ContextMenuQuickAction=Qf,j.CreateLinkModal=Cv,j.CreateShortcutModal=_v,j.CreateSpace=Wk,j.CustomComponentTarget=oL,j.DateFilter=cD,j.DatePickerModal=xN,j.EDITOR_MODE_CREATE=ox,j.EDITOR_MODE_EDIT=ix,j.EVENT_FILE_DROPPED=Df,j.EVENT_TROW_CONTEXTMENU=fx,j.EVENT_TROW_MOUNTED=Ev,j.EmojiPickerModal=qv,j.EventBus=jh,j.FileInfo=r0,j.FilePickerModal=Fv,j.FileSideBar=n0,j.FolderLoaderFavorites=Kh,j.FolderLoaderSharedViaLink=Qh,j.FolderLoaderSharedWithMe=Xh,j.FolderLoaderSharedWithOthers=Yh,j.FolderLoaderSpace=Gh,j.FolderLoaderTrashbin=Ky,j.FolderService=Qy,j.FolderViewModeConstants=Gt,j.HttpClient=Hl,j.ImageDimension=Vr,j.ImageType=ua,j.ItemFilter=dL,j.ItemFilterInline=pD,j.ItemFilterToggle=gL,j.Key=Uf,j.LinkRoleDropdown=Iv,j.LoadingEventTopics=xn,j.LoadingIndicator=vL,j.LoadingService=uI,j.MimeTypesToAppsSchema=Th,j.Modifier=qf,j.NoContentMessage=RL,j.Pagination=CL,j.PaginationConstants=Tn,j.PasswordPolicyService=tC,j.PortalTarget=DL,j.PortalTargetEventTopics=pa,j.PreviewService=HI,j.ProcessorType=zs,j.QuotaModal=Lv,j.QuotaSelect=Dv,j.RawConfigSchema=VF,j.ResolveStrategy=Ur,j.ResourceConflictModal=Rp,j.ResourceGhostElement=Xf,j.ResourceIcon=xo,j.ResourceLink=Lf,j.ResourceListItem=Oo,j.ResourceName=Bf,j.ResourcePreview=Rv,j.ResourceSize=a0,j.ResourceTable=I2,j.ResourceTile=I0,j.ResourceTiles=K2,j.ResourceTransfer=Ip,j.RuntimeError=Ci,j.SaveAsModal=xv,j.SearchBarFilter=kL,j.SearchLocationFilterConstants=En,j.SideBar=e0,j.SideBarEventTopics=mt,j.SortConstants=Jn,j.SortDir=Ft,j.SpaceDetails=ND,j.SpaceDetailsMultiple=UD,j.SpaceInfo=t0,j.SpaceMoveInfoModal=Ap,j.SpaceNoSelection=HD,j.SpaceQuota=C0,j.TextEditor=rL,j.ThemeConfig=qP,j.TransferType=hn,j.UnsavedChangesModal=i0,j.UppyService=nC,j.ViewOptions=Jv,j.VisibilityObserver=Tv,j.WebDavDetails=F0,j.WebThemeConfig=Zb,j.activeApp=_l,j.authContextValues=vT,j.blobToArrayBuffer=Cb,j.breadcrumbsFromPath=SF,j.buildRoutes=XP,j.buildUrl=ST,j.cacheService=Wl,j.canvasToBlob=Fb,j.cloneStateObject=Ep,j.concatBreadcrumbs=EF,j.contextQueryToFileContextProps=nv,j.contextRouteNameKey=Js,j.contextRouteParamsKey=Sf,j.contextRouteQueryKey=Ef,j.createDefaultFileIconMapping=Fp,j.createFileRouteOptions=Jr,j.createLocationCommon=Ai,j.createLocationPublic=Ri,j.createLocationShares=Or,j.createLocationSpaces=xr,j.createLocationTrash=_i,j.defaultFuseOptions=al,j.defineWebApplication=W0,j.determineResourceTableSortFields=Sh,j.determineResourceTilesSortFields=jT,j.dirname=ht.dirname,j.displayPositionedDropdown=To,j.encodePath=yf,j.eventBus=Ye,j.filterResources=QS,j.focusCheckbox=AT,j.folderService=Xy,j.formatDateFromDateTime=ri,j.formatDateFromHTTP=TF,j.formatDateFromISO=Eb,j.formatDateFromJSDate=Sb,j.formatDateFromRFC=AF,j.formatFileSize=wr,j.formatRelativeDateFromDateTime=Ao,j.formatRelativeDateFromHTTP=RF,j.formatRelativeDateFromISO=_F,j.formatRelativeDateFromJSDate=Tb,j.formatRelativeDateFromRFC=IF,j.getIndicators=Ro,j.getLocaleFromLanguage=Gs,j.getParentPaths=Ab,j.getSharedAncestorRoute=TT,j.getSharedDriveItem=ys,j.getSpacesByType=Io,j.isLocationActive=KP,j.isLocationCommonActive=At,j.isLocationPublicActive=Ar,j.isLocationSharesActive=Nt,j.isLocationSpacesActive=lt,j.isLocationTrashActive=Rr,j.isResourceBeeingMovedToSameLocation=_p,j.isSameResource=to,j.locationPublicLink=Al,j.locationPublicUpload=Rl,j.locationSharesViaLink=Tl,j.locationSharesWithMe=ms,j.locationSharesWithOthers=El,j.locationSpacesGeneric=Sl,j.objectKeys=WI,j.queryItemAsString=St,j.renameResource=ll,j.resolveFileNameDuplicate=jr,j.resourceIconMappingInjectionKey=Cp,j.routeToContextQuery=Zs,j.sortFields=Eh,j.sortHelper=vh,j.sortSpaceMembers=ev,j.translateSortFields=UT,j.triggerDownloadWithFilename=zl,j.useAbility=dr,j.useActionsShowDetails=XO,j.useActiveApp=wT,j.useActiveLocation=Sn,j.useAppConfig=fh,j.useAppDefaults=uv,j.useAppFileHandling=Tf,j.useAppFolderHandling=ov,j.useAppMeta=_f,j.useAppNavigation=iv,j.useAppProviderService=JO,j.useAppsStore=Zr,j.useArchiverService=gv,j.useAuthService=Af,j.useAuthStore=Yn,j.useBreadcrumbsFromPath=ZO,j.useCanBeOpenedWithSecureView=Vf,j.useCanListShares=vv,j.useCanListVersions=Hv,j.useCanShare=wv,j.useCapabilityStore=tr,j.useClientService=Je,j.useClipboard=If,j.useClipboardStore=_o,j.useConfigStore=ot,j.useCreateSpace=Bi,j.useDeleteWorker=fv,j.useDocumentTitle=sv,j.useDownloadFile=mv,j.useDriveResolver=cv,j.useEmbedMode=ni,j.useEventBus=Fo,j.useExtensionPreferencesStore=xb,j.useExtensionRegistry=Di,j.useFileActions=qr,j.useFileActionsCopy=na,j.useFileActionsCopyPermanentLink=Cf,j.useFileActionsCreateLink=wO,j.useFileActionsCreateNewFile=ux,j.useFileActionsCreateNewFolder=cx,j.useFileActionsCreateNewShortcut=Kx,j.useFileActionsCreateSpaceFromResource=$f,j.useFileActionsDelete=oa,j.useFileActionsDeleteResources=hv,j.useFileActionsDisableSync=ia,j.useFileActionsDownloadArchive=sa,j.useFileActionsDownloadFile=Po,j.useFileActionsEmptyTrashBin=Ff,j.useFileActionsEnableSync=ta,j.useFileActionsFavorite=Pf,j.useFileActionsMove=aa,j.useFileActionsNavigate=xf,j.useFileActionsOpenShortcut=Qx,j.useFileActionsOpenWithApp=Pv,j.useFileActionsPaste=yv,j.useFileActionsRename=la,j.useFileActionsRestore=ca,j.useFileActionsSaveAs=Ov,j.useFileActionsSetImage=bv,j.useFileActionsShowActions=lx,j.useFileActionsShowDetails=kf,j.useFileActionsShowShares=Nf,j.useFileActionsToggleHideShare=ra,j.useFileListHeaderPosition=ek,j.useFileRouteReplace=Qs,j.useFolderLink=ai,j.useGetMatchingSpace=sr,j.useGetResourceContext=Gv,j.useGroupingSettings=LL,j.useIsFilesAppActive=On,j.useIsSearchActive=ls,j.useIsTopBarSticky=jf,j.useKeyboardActions=zv,j.useLinkTypes=fa,j.useLoadPreview=Wf,j.useLoadingService=ar,j.useLocalStorage=wf,j.useMessages=it,j.useModals=yt,j.useOpenEmptyEditor=YO,j.useOpenWithDefaultApp=Mv,j.usePagination=rk,j.usePasswordPolicyService=Wv,j.usePasteWorker=dv,j.usePortalTarget=ok,j.usePreviewService=Of,j.useRequest=av,j.useRequestHeaders=ea,j.useResourceContents=Qv,j.useResourceRouteResolver=da,j.useResourcesStore=Qe,j.useRestoreWorker=pv,j.useRoute=Jt,j.useRouteMeta=tv,j.useRouteName=Xs,j.useRouteParam=Ys,j.useRouteQuery=rr,j.useRouteQueryPersisted=wn,j.useRouter=We,j.useScrollTo=Sv,j.useSearch=Rf,j.useSelectedResources=Hf,j.useService=yn,j.useSharesStore=Bt,j.useSideBar=Rb,j.useSort=$T,j.useSpaceActionsDelete=kv,j.useSpaceActionsDisable=Nv,j.useSpaceActionsDuplicate=$v,j.useSpaceActionsEditDescription=OO,j.useSpaceActionsEditQuota=Bv,j.useSpaceActionsEditReadmeContent=zO,j.useSpaceActionsNavigateToTrash=HO,j.useSpaceActionsRename=jv,j.useSpaceActionsRestore=Uv,j.useSpaceActionsSetIcon=QO,j.useSpaceActionsShowMembers=WO,j.useSpaceHelpers=si,j.useSpacesLoading=lv,j.useSpacesStore=ut,j.useThemeStore=oi,j.useTileSize=Kv,j.useTokenTimerWorker=tx,j.useUpload=ck,j.useUserStore=bt,j.useViewMode=sk,j.useViewSize=ak,j.useViewSizeMax=zf,j.useWebWorkersStore=Co,j.useWindowOpen=Vv,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});