!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n||self).flatDropFiles={})}(this,function(n){function e(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function t(n,e,i){if(!n.s){if(i instanceof r){if(!i.s)return void(i.o=t.bind(null,n,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(t.bind(null,n,e),t.bind(null,n,2));n.s=e,n.v=i;var o=n.o;o&&o(n)}}var r=/*#__PURE__*/function(){function n(){}return n.prototype.then=function(e,r){var i=new n,o=this.s;if(o){var u=1&o?e:r;if(u){try{t(i,1,u(this.v))}catch(n){t(i,2,n)}return i}return this}return this.o=function(n){try{var o=n.v;1&n.s?t(i,1,e?e(o):o):r?t(i,1,r(o)):t(i,2,o)}catch(n){t(i,2,n)}},i},n}();function i(n){return n instanceof r&&1&n.s}var o=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|"));function u(n){return new Promise(function(e,t){n.file(e,t)})}function f(n){return n&&n.getAsFileSystemHandle?n.getAsFileSystemHandle().catch(function(n){return console.error(n),null}):Promise.resolve(null)}function a(n,e,o){return void 0===o&&(o=""),n.isFile?function(n,e,t){return Promise.all([u(n),f(e)]).then(function(n){var e=n[0],r=n[1];return r&&(e.handle=r),e.path=t+e.name,e})}(n,e,o).then(function(n){return[n]}):n.isDirectory?function(n,e){try{var o,u=n.createReader(),f=e+n.name+"/",c=[],l=function(n,e){var o;do{var u=n();if(u&&u.then){if(!i(u)){o=!0;break}u=u.v}var f=e();if(i(f)&&(f=f.v),!f)return u}while(!f.then);var a=new r,c=t.bind(null,a,2);return(o?u.then(l):f.then(s)).then(void 0,c),a;function l(r){for(u=r;i(f=e())&&(f=f.v),f;){if(f.then)return void f.then(s).then(void 0,c);if((u=n())&&u.then){if(!i(u))return void u.then(l).then(void 0,c);u=u.v}}t(a,1,u)}function s(r){if(r){do{if((u=n())&&u.then){if(!i(u))return void u.then(l).then(void 0,c);u=u.v}if(i(r=e())&&(r=r.v),!r)return void t(a,1,u)}while(!r.then);r.then(s).then(void 0,c)}else t(a,1,u)}}(function(){return Promise.resolve(function(n,e){try{return Promise.resolve(function(n){return new Promise(function(e,t){n.readEntries(e,t)})}(n).then(function(n){var t=n.map(function(n){return a(n,void 0,e)});return Promise.all(t).then(function(n){return n.flat()})}))}catch(n){return Promise.reject(n)}}(u,f)).then(function(n){c=c.concat(o=n)})},function(){return o.length>0});return Promise.resolve(l&&l.then?l.then(function(){return c}):c)}catch(n){return Promise.reject(n)}}(n,o):Promise.resolve([])}n.getFilesFromDataTransferItems=function(n){for(var t,r=[],i=function(n,t){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(r)return(r=r.call(n)).next.bind(r);if(Array.isArray(n)||(r=function(n,t){if(n){if("string"==typeof n)return e(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(n,t):void 0}}(n))){r&&(n=r);var i=0;return function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n);!(t=i()).done;){var u=t.value,f=u.webkitGetAsEntry();f&&r.push([f,u])}return Promise.all(r.map(function(n){return a(n[0],n[1])})).then(function(n){return n.flat().filter(function(n){return!o.test(n.name)})})}});
//# sourceMappingURL=flatdropfiles.umd.js.map
