/*! For license information please see richdocuments-fileActions.js.LICENSE.txt */ (()=>{var e={55950:(e,t,n)=>{"use strict";const r=n(92322),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(76692),{safeRe:a,t:s}=n(15208),l=n(29901),{compareIdentifiers:c}=n(3229);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],i=e.build[t];if(r("build compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return c(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?a[s.PRERELEASELOOSE]:a[s.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},38064:(e,t,n)=>{"use strict";const r=n(55950);e.exports=(e,t)=>new r(e,t).major},68690:(e,t,n)=>{"use strict";const r=n(55950);e.exports=(e,t,n=!1)=>{if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}},38711:(e,t,n)=>{"use strict";const r=n(68690);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},76692:e=>{"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},92322:(e,t,n)=>{"use strict";var r=n(65606);const i="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=i},3229:e=>{"use strict";const t=/^[0-9]+$/,n=(e,n)=>{if("number"==typeof e&&"number"==typeof n)return e===n?0:en(t,e)}},29901:e=>{"use strict";const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},15208:(e,t,n)=>{"use strict";const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=n(76692),a=n(92322),s=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],p=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[d,i]],m=(e,t,n)=>{const r=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=f++;a(e,i,t),p[e]=i,c[i]=t,u[i]=r,s[i]=new RegExp(t,n?"g":void 0),l[i]=new RegExp(r,n?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),m("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NONNUMERICIDENTIFIER]}|${c[p.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${d}+`),m("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),m("FULL",`^${c[p.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),m("LOOSE",`^${c[p.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),m("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${c[p.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[p.COERCEPLAIN]+`(?:${c[p.PRERELEASE]})?`+`(?:${c[p.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[p.COERCE],!0),m("COERCERTLFULL",c[p.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},70580:e=>{"use strict";var t=/["'&<>]/;e.exports=function(e){var n,r=""+e,i=t.exec(r);if(!i)return r;var o="",a=0,s=0;for(a=i.index;a{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,l=[],c=!1,u=-1;function p(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&f())}function f(){if(!c){var e=a(p);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u1)for(var n=1;n{"use strict";var e=n(38064),t=n(38711);class r{bus;constructor(n){"function"==typeof n.getVersion&&t(n.getVersion())?e(n.getVersion())!==e(this.getVersion())&&console.warn("Proxying an event bus of version "+n.getVersion()+" with "+this.getVersion()):console.warn("Proxying an event bus with an unknown or invalid version"),this.bus=n}getVersion(){return"3.3.3"}subscribe(e,t){this.bus.subscribe(e,t)}unsubscribe(e,t){this.bus.unsubscribe(e,t)}emit(e,...t){this.bus.emit(e,...t)}}class i{handlers=new Map;getVersion(){return"3.3.3"}subscribe(e,t){this.handlers.set(e,(this.handlers.get(e)||[]).concat(t))}unsubscribe(e,t){this.handlers.set(e,(this.handlers.get(e)||[]).filter((e=>e!==t)))}emit(e,...t){(this.handlers.get(e)||[]).forEach((e=>{try{e(t[0])}catch(e){console.error("could not invoke event listener",e)}}))}}let o,a=null;function s(){return null!==a?a:"undefined"==typeof window?new Proxy({},{get:()=>()=>console.error("Window not available, EventBus can not be established!")}):(window.OC?._eventBus&&void 0===window._nc_event_bus&&(console.warn("found old event bus instance at OC._eventBus. Update your version!"),window._nc_event_bus=window.OC._eventBus),a=void 0!==window?._nc_event_bus?new r(window._nc_event_bus):window._nc_event_bus=new i,a)}class l{static GLOBAL_SCOPE_VOLATILE="nextcloud_vol";static GLOBAL_SCOPE_PERSISTENT="nextcloud_per";scope;wrapped;constructor(e,t,n){this.scope=`${n?l.GLOBAL_SCOPE_PERSISTENT:l.GLOBAL_SCOPE_VOLATILE}_${btoa(e)}_`,this.wrapped=t}scopeKey(e){return`${this.scope}${e}`}setItem(e,t){this.wrapped.setItem(this.scopeKey(e),t)}getItem(e){return this.wrapped.getItem(this.scopeKey(e))}removeItem(e){this.wrapped.removeItem(this.scopeKey(e))}clear(){Object.keys(this.wrapped).filter((e=>e.startsWith(this.scope))).map(this.wrapped.removeItem.bind(this.wrapped))}}class c{appId;persisted=!1;clearedOnLogout=!1;constructor(e){this.appId=e}persist(e=!0){return this.persisted=e,this}clearOnLogout(e=!0){return this.clearedOnLogout=e,this}build(){return new l(this.appId,this.persisted?window.localStorage:window.sessionStorage,!this.clearedOnLogout)}}const u=[];var p,f;p="csrf-token-update",f=e=>{o=e.token,u.forEach((e=>{try{e(o)}catch(e){console.error("Error updating CSRF token observer",e)}}))},s().subscribe(p,f);(d="public",new c(d)).persist().build();var d;let h;function m(e,t){return e?e.getAttribute(t):null}var E=(e=>(e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warn=2]="Warn",e[e.Error=3]="Error",e[e.Fatal=4]="Fatal",e))(E||{});class g{context;constructor(e){this.context=e||{}}formatMessage(e,t,n){let r="["+E[t].toUpperCase()+"] ";return n&&n.app&&(r+=n.app+": "),"string"==typeof e?r+e:(r+=`Unexpected ${e.name}`,e.message&&(r+=` "${e.message}"`),t===E.Debug&&e.stack&&(r+=`\n\nStack trace:\n${e.stack}`),r)}log(e,t,n){if(!("number"==typeof this.context?.level&&e{"complete"===document.readyState||"interactive"===document.readyState?(e.context.level=window._oc_config?.loglevel??E.Warn,window._oc_debug&&(e.context.level=E.Debug),document.removeEventListener("readystatechange",t)):document.addEventListener("readystatechange",t)};return t(),this}build(){return void 0===this.context.level&&this.detectLogLevel(),this.factory(this.context)}}function N(){return new I(T)}window._nc_files_scope??={},window._nc_files_scope.v4_0??={};const b=window._nc_files_scope.v4_0,A=N().setApp("@nextcloud/files").detectUser().build();Object.freeze({Folder:"folder",File:"file"}),Object.freeze({NONE:0,READ:1,UPDATE:2,CREATE:4,WRITE:4,DELETE:8,SHARE:16,ALL:31}),Object.freeze({NEW:"new",FAILED:"failed",LOADING:"loading",LOCKED:"locked"});var y=class extends EventTarget{dispatchTypedEvent(e,t){return super.dispatchEvent(t)}};const{entries:w,setPrototypeOf:v,isFrozen:_,getPrototypeOf:L,getOwnPropertyDescriptor:R}=Object;let{freeze:O,seal:S,create:D}=Object,{apply:C,construct:x}="undefined"!=typeof Reflect&&Reflect;O||(O=function(e){return e}),S||(S=function(e){return e}),C||(C=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?t-1:0),r=1;r1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:U;v&&v(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(_(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Z(e){for(let t=0;t/gm),de=S(/\$\{[\w\W]*/gm),he=S(/^data-[\-\w.\u00B7-\uFFFF]+$/),me=S(/^aria-[\-\w]+$/),Ee=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ge=S(/^(?:\w+script|data):/i),Te=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ie=S(/^html$/i),Ne=S(/^[a-z][.\w]*(-[.\w]+)+$/i);var be=Object.freeze({__proto__:null,ARIA_ATTR:me,ATTR_WHITESPACE:Te,CUSTOM_ELEMENT:Ne,DATA_ATTR:he,DOCTYPE_NAME:Ie,ERB_EXPR:fe,IS_ALLOWED_URI:Ee,IS_SCRIPT_OR_DATA:ge,MUSTACHE_EXPR:pe,TMPLIT_EXPR:de});const Ae=1,ye=3,we=7,ve=8,_e=9,Le=function(){return"undefined"==typeof window?null:window};var Re=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Le();const n=t=>e(t);if(n.version="3.3.0",n.removed=[],!t||!t.document||t.document.nodeType!==_e||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:h}=t,m=c.prototype,E=Q(m,"cloneNode"),g=Q(m,"remove"),T=Q(m,"nextSibling"),I=Q(m,"childNodes"),N=Q(m,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let b,A="";const{implementation:y,createNodeIterator:v,createDocumentFragment:_,getElementsByTagName:L}=r,{importNode:R}=i;let S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof w&&"function"==typeof N&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:C,ERB_EXPR:x,TMPLIT_EXPR:Y,DATA_ATTR:q,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe,CUSTOM_ELEMENT:de}=be;let{IS_ALLOWED_URI:he}=be,me=null;const ge=K({},[...ee,...te,...ne,...ie,...ae]);let Te=null;const Ne=K({},[...se,...le,...ce,...ue]);let Re=Object.seal(D(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Se=null;const De=Object.seal(D(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ce=!0,xe=!0,ke=!1,Me=!0,$e=!1,Pe=!0,Fe=!1,Ue=!1,Ge=!1,ze=!1,je=!1,He=!1,Be=!0,Xe=!1,We=!0,Ve=!1,Ye={},qe=null;const Ke=K({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ze=null;const Je=K({},["audio","video","img","source","image","track"]);let Qe=null;const et=K({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xhtml";let it=rt,ot=!1,at=null;const st=K({},[tt,nt,rt],G);let lt=K({},["mi","mo","mn","ms","mtext"]),ct=K({},["annotation-xml"]);const ut=K({},["title","style","font","a","script"]);let pt=null;const ft=["application/xhtml+xml","text/html"];let dt=null,ht=null;const mt=r.createElement("form"),Et=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ht||ht!==e){if(e&&"object"==typeof e||(e={}),e=J(e),pt=-1===ft.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,dt="application/xhtml+xml"===pt?G:U,me=X(e,"ALLOWED_TAGS")?K({},e.ALLOWED_TAGS,dt):ge,Te=X(e,"ALLOWED_ATTR")?K({},e.ALLOWED_ATTR,dt):Ne,at=X(e,"ALLOWED_NAMESPACES")?K({},e.ALLOWED_NAMESPACES,G):st,Qe=X(e,"ADD_URI_SAFE_ATTR")?K(J(et),e.ADD_URI_SAFE_ATTR,dt):et,Ze=X(e,"ADD_DATA_URI_TAGS")?K(J(Je),e.ADD_DATA_URI_TAGS,dt):Je,qe=X(e,"FORBID_CONTENTS")?K({},e.FORBID_CONTENTS,dt):Ke,Oe=X(e,"FORBID_TAGS")?K({},e.FORBID_TAGS,dt):J({}),Se=X(e,"FORBID_ATTR")?K({},e.FORBID_ATTR,dt):J({}),Ye=!!X(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,$e=e.SAFE_FOR_TEMPLATES||!1,Pe=!1!==e.SAFE_FOR_XML,Fe=e.WHOLE_DOCUMENT||!1,ze=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,Ge=e.FORCE_BODY||!1,Be=!1!==e.SANITIZE_DOM,Xe=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,Ve=e.IN_PLACE||!1,he=e.ALLOWED_URI_REGEXP||Ee,it=e.NAMESPACE||rt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,Re=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Et(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Re.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Et(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Re.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Re.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$e&&(xe=!1),je&&(ze=!0),Ye&&(me=K({},ae),Te=[],!0===Ye.html&&(K(me,ee),K(Te,se)),!0===Ye.svg&&(K(me,te),K(Te,le),K(Te,ue)),!0===Ye.svgFilters&&(K(me,ne),K(Te,le),K(Te,ue)),!0===Ye.mathMl&&(K(me,ie),K(Te,ce),K(Te,ue))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?De.tagCheck=e.ADD_TAGS:(me===ge&&(me=J(me)),K(me,e.ADD_TAGS,dt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?De.attributeCheck=e.ADD_ATTR:(Te===Ne&&(Te=J(Te)),K(Te,e.ADD_ATTR,dt))),e.ADD_URI_SAFE_ATTR&&K(Qe,e.ADD_URI_SAFE_ATTR,dt),e.FORBID_CONTENTS&&(qe===Ke&&(qe=J(qe)),K(qe,e.FORBID_CONTENTS,dt)),We&&(me["#text"]=!0),Fe&&K(me,["html","head","body"]),me.table&&(K(me,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw V('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=e.TRUSTED_TYPES_POLICY,A=b.createHTML("")}else void 0===b&&(b=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(h,o)),null!==b&&"string"==typeof A&&(A=b.createHTML(""));O&&O(e),ht=e}},Tt=K({},[...te,...ne,...re]),It=K({},[...ie,...oe]),Nt=function(e){P(n.removed,{element:e});try{N(e).removeChild(e)}catch(t){g(e)}},bt=function(e,t){try{P(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){P(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ze||je)try{Nt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},At=function(e){let t=null,n=null;if(Ge)e=""+e;else{const t=z(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===pt&&it===rt&&(e=''+e+"");const i=b?b.createHTML(e):e;if(it===rt)try{t=(new d).parseFromString(i,pt)}catch(e){}if(!t||!t.documentElement){t=y.createDocument(it,"template",null);try{t.documentElement.innerHTML=ot?A:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),it===rt?L.call(t,Fe?"html":"body")[0]:Fe?t.documentElement:o},yt=function(e){return v.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof l&&e instanceof l};function _t(e,t,r){k(e,(e=>{e.call(n,t,r,ht)}))}const Lt=function(e){let t=null;if(_t(S.beforeSanitizeElements,e,null),wt(e))return Nt(e),!0;const r=dt(e.nodeName);if(_t(S.uponSanitizeElement,e,{tagName:r,allowedTags:me}),Pe&&e.hasChildNodes()&&!vt(e.firstElementChild)&&W(/<[/\w!]/g,e.innerHTML)&&W(/<[/\w!]/g,e.textContent))return Nt(e),!0;if(e.nodeType===we)return Nt(e),!0;if(Pe&&e.nodeType===ve&&W(/<[/\w]/g,e.data))return Nt(e),!0;if(!(De.tagCheck instanceof Function&&De.tagCheck(r))&&(!me[r]||Oe[r])){if(!Oe[r]&&Ot(r)){if(Re.tagNameCheck instanceof RegExp&&W(Re.tagNameCheck,r))return!1;if(Re.tagNameCheck instanceof Function&&Re.tagNameCheck(r))return!1}if(We&&!qe[r]){const t=N(e)||e.parentNode,n=I(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=E(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,T(e))}}}return Nt(e),!0}return e instanceof c&&!function(e){let t=N(e);t&&t.tagName||(t={namespaceURI:it,tagName:"template"});const n=U(e.tagName),r=U(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===rt?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(Tt[n]):e.namespaceURI===tt?t.namespaceURI===rt?"math"===n:t.namespaceURI===nt?"math"===n&&ct[r]:Boolean(It[n]):e.namespaceURI===rt?!(t.namespaceURI===nt&&!ct[r])&&!(t.namespaceURI===tt&&!lt[r])&&!It[n]&&(ut[n]||!Tt[n]):!("application/xhtml+xml"!==pt||!at[e.namespaceURI]))}(e)?(Nt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!W(/<\/no(script|embed|frames)/i,e.innerHTML)?($e&&e.nodeType===ye&&(t=e.textContent,k([C,x,Y],(e=>{t=j(t,e," ")})),e.textContent!==t&&(P(n.removed,{element:e.cloneNode()}),e.textContent=t)),_t(S.afterSanitizeElements,e,null),!1):(Nt(e),!0)},Rt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in r||n in mt))return!1;if(xe&&!Se[t]&&W(q,t));else if(Ce&&W(Z,t));else if(De.attributeCheck instanceof Function&&De.attributeCheck(t,e));else if(!Te[t]||Se[t]){if(!(Ot(e)&&(Re.tagNameCheck instanceof RegExp&&W(Re.tagNameCheck,e)||Re.tagNameCheck instanceof Function&&Re.tagNameCheck(e))&&(Re.attributeNameCheck instanceof RegExp&&W(Re.attributeNameCheck,t)||Re.attributeNameCheck instanceof Function&&Re.attributeNameCheck(t,e))||"is"===t&&Re.allowCustomizedBuiltInElements&&(Re.tagNameCheck instanceof RegExp&&W(Re.tagNameCheck,n)||Re.tagNameCheck instanceof Function&&Re.tagNameCheck(n))))return!1}else if(Qe[t]);else if(W(he,j(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==H(n,"data:")||!Ze[e]){if(ke&&!W(pe,j(n,fe,"")));else if(n)return!1}else;return!0},Ot=function(e){return"annotation-xml"!==e&&z(e,de)},St=function(e){_t(S.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||wt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:s,value:l}=o,c=dt(a),u=l;let p="value"===a?u:B(u);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,_t(S.uponSanitizeAttribute,e,r),p=r.attrValue,!Xe||"id"!==c&&"name"!==c||(bt(a,e),p="user-content-"+p),Pe&&W(/((--!?|])>)|<\/(style|title|textarea)/i,p)){bt(a,e);continue}if("attributename"===c&&z(p,"href")){bt(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){bt(a,e);continue}if(!Me&&W(/\/>/i,p)){bt(a,e);continue}$e&&k([C,x,Y],(e=>{p=j(p,e," ")}));const f=dt(e.nodeName);if(Rt(f,c,p)){if(b&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(s);else switch(h.getAttributeType(f,c)){case"TrustedHTML":p=b.createHTML(p);break;case"TrustedScriptURL":p=b.createScriptURL(p)}if(p!==u)try{s?e.setAttributeNS(s,a,p):e.setAttribute(a,p),wt(e)?Nt(e):$(n.removed)}catch(t){bt(a,e)}}else bt(a,e)}_t(S.afterSanitizeAttributes,e,null)},Dt=function e(t){let n=null;const r=yt(t);for(_t(S.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)_t(S.uponSanitizeShadowNode,n,null),Lt(n),St(n),n.content instanceof a&&e(n.content);_t(S.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,c=null;if(ot=!e,ot&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw V("toString is not a function");if("string"!=typeof(e=e.toString()))throw V("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ue||gt(t),n.removed=[],"string"==typeof e&&(Ve=!1),Ve){if(e.nodeName){const t=dt(e.nodeName);if(!me[t]||Oe[t])throw V("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=At("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),o.nodeType===Ae&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!ze&&!$e&&!Fe&&-1===e.indexOf("<"))return b&&He?b.createHTML(e):e;if(r=At(e),!r)return ze?null:He?A:""}r&&Ge&&Nt(r.firstChild);const u=yt(Ve?e:r);for(;s=u.nextNode();)Lt(s),St(s),s.content instanceof a&&Dt(s.content);if(Ve)return e;if(ze){if(je)for(c=_.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(Te.shadowroot||Te.shadowrootmode)&&(c=R.call(i,c,!0)),c}let p=Fe?r.outerHTML:r.innerHTML;return Fe&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&W(Ie,r.ownerDocument.doctype.name)&&(p="\n"+p),$e&&k([C,x,Y],(e=>{p=j(p,e," ")})),b&&He?b.createHTML(p):p},n.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},n.clearConfig=function(){ht=null,Ue=!1},n.isValidAttribute=function(e,t,n){ht||gt({});const r=dt(e),i=dt(t);return Rt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&P(S[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=M(S[e],t);return-1===n?void 0:F(S[e],n,1)[0]}return $(S[e])},n.removeHooks=function(e){S[e]=[]},n.removeAllHooks=function(){S={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Oe=n(70580);function Se(e){return{translations:globalThis._oc_l10n_registry_translations[e]??{},pluralFunction:globalThis._oc_l10n_registry_plural_functions[e]??(e=>e)}}function De(e,t,n,r,i){const o="object"==typeof n?n:void 0,a="number"==typeof r?r:"number"==typeof n?n:void 0,s={escape:!0,sanitize:!0,..."object"==typeof i?i:"object"==typeof r?r:{}},l=e=>e,c=(s.sanitize?Re.sanitize:l)||l,u=s.escape?Oe:l,p=e=>"string"==typeof e||"number"==typeof e;let f=(i?.bundle??Se(e)).translations[t]||t;return f=Array.isArray(f)?f[0]:f,c("object"==typeof o||void 0!==a?(d=o,h=a,f.replace(/%n/g,""+h).replace(/{([^{}]*)}/g,((e,t)=>{if(void 0===d||!(t in d))return u(e);const n=d[t];return p(n)?u(`${n}`):"object"==typeof n&&p(n.value)?(!1!==n.escape?Oe:l)(`${n.value}`):u(e)}))):f);var d,h}globalThis._nc_l10n_locale??="undefined"!=typeof document&&document.documentElement.dataset.locale||Intl.DateTimeFormat().resolvedOptions().locale.replaceAll(/-/g,"_"),globalThis._nc_l10n_language??="undefined"!=typeof document&&document.documentElement.lang||(globalThis.navigator?.language??"en"),globalThis._oc_l10n_registry_translations??={},globalThis._oc_l10n_registry_plural_functions??={};class Ce extends y{}function xe(){return b.registry??=new Ce,b.registry}const ke=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});Object.freeze({UploadFromDevice:0,CreateNew:1,Other:2});Object.freeze({ReservedName:"reserved name",Character:"character",Extension:"extension"});Error;Object.freeze({Name:"basename",Modified:"mtime",Size:"size"});var Me=function(){try{return function(e,t,n){const r=`#initial-state-${e}-${t}`;if(window._nc_initial_state?.has(r))return window._nc_initial_state.get(r);window._nc_initial_state||(window._nc_initial_state=new Map);const i=document.querySelector(r);if(null===i){if(void 0!==n)return n;throw new Error(`Could not find initial state ${t} of ${e}`)}try{const e=JSON.parse(atob(i.value));return window._nc_initial_state.set(r,e),e}catch(r){if(console.error("[@nextcloud/initial-state] Could not parse initial state",{key:t,app:e,error:r}),void 0!==n)return n;throw new Error(`Could not parse initial state ${t} of ${e}`,{cause:r})}}("core","capabilities")}catch(e){return console.debug("Could not find capabilities initial state fall back to _oc_capabilities"),"_oc_capabilities"in window?window._oc_capabilities:{}}}(),$e=new(function(){function e(){this.capabilities=Me.richdocuments}return e.prototype.getCapabilities=function(){return this.capabilities},e.prototype.setCapabilities=function(e){this.capabilities=e},e.prototype.updateCapability=function(e,t){this.capabilities[e]=t},e}()),Pe=function(){return $e.getCapabilities()};var Fe;(function(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(void 0!==e.destructive&&"boolean"!=typeof e.destructive)throw new Error("Invalid destructive flag");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(ke).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function");if("hotkey"in e&&void 0!==e.hotkey){if("object"!=typeof e.hotkey)throw new Error("Invalid hotkey configuration");if("string"!=typeof e.hotkey.key||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if("string"!=typeof e.hotkey.description||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}})(Fe={id:"office-open-pdf",iconSvgInline:()=>'\n\n \n'.replaceAll(/#(fff|0{6})/g,"currentColor"),displayName:()=>De("richdocuments","Edit with {productName}",{productName:Pe().productName}),enabled:({nodes:e})=>{if(1!==e.length)return!1;const t="application/pdf"===e[0].mime,n=Pe().mimetypesNoDefaultOpen;return t&&n.includes("application/pdf")},exec:({nodes:e})=>{const t=e[0];OCA.Viewer&&OCA.Viewer.openWith("richdocuments",{path:t.path})}}),b.fileActions??=new Map,b.fileActions.has(Fe.id)?A.error(`FileAction ${Fe.id} already registered`,{action:Fe}):(b.fileActions.set(Fe.id,Fe),xe().dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:Fe})))})()})(); //# sourceMappingURL=richdocuments-fileActions.js.map?v=e358da7c900a9606b281