nextcloud/dist/files_trashbin-main.js

3 lines
44 KiB
JavaScript
Raw Normal View History

/*! For license information please see files_trashbin-main.js.LICENSE.txt */
(()=>{"use strict";var t,e={70274:(t,e,i)=>{var n=i(85072),r=i.n(n),s=i(97825),o=i.n(s),a=i(77659),l=i.n(a),u=i(55056),d=i.n(u),c=i(10540),h=i.n(c),p=i(41113),f=i.n(p),g=i(98290),m={};m.styleTagTransform=f(),m.setAttributes=d(),m.insert=l().bind(null,"head"),m.domAPI=o(),m.insertStyleElement=h(),r()(g.A,m),g.A&&g.A.locals&&g.A.locals;var w=i(53334),v=i(51651),b=i(21777),x=i(84697),y=i(43627),N=i(71089),E=i(66656),_=i(44719);i(36117),i(2568);const A=null===(T=(0,b.HW)())?(0,x.YK)().setApp("files").build():(0,x.YK)().setApp("files").setUid(T.uid).build();var T,O=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(O||{}),I=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(I||{});const P=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],C={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};var S=(t=>(t.Folder="folder",t.File="file",t))(S||{});const D=function(t,e){return null!==t.match(e)},V=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch(t){throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=I.NONE&&t.permissions<=I.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&D(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes((0,y.join)(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(k).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var k=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(k||{});class j{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(j.prototype)).filter((t=>"function"==typeof t[1].get&&"__proto__"!==t[0])).map((t=>t[0]));handler={set:(t,e,i)=>!this.readonlyAttributes.includes(e)&&(this.updateMtime(),Reflect.set(t,e,i)),deleteProperty:(t,e)=>!this.readonlyAttributes.includes(e)&&(this.updateMtime(),Reflect.deleteProperty(t,e)),get:(t,e,i)=>this.readonlyAttributes.includes(e)?(A.warn(`Accessing "Node.attributes.${e}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,e)):Reflect.get(t,e,i)};constructor(t,e){V(t,e||this._knownDavService),this._data={...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),this._data.mtime=t.mtime,e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,N.O0)(this.source.slice(t.length))}get basename(){return(0,y.basename)(this.source)}get extension(){return(0,y.extname)(this.so
//# sourceMappingURL=files_trashbin-main.js.map?v=8760607b5354c9f44295