UNPKG

filestack-js

Version:

Official JavaScript library for Filestack

2 lines 482 kB
/*! For license information please see filestack.umd.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.filestack=e():t.filestack=e()}(self,(()=>(()=>{var __webpack_modules__={2:t=>{"use strict";t.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}},15:t=>{"use strict";t.exports=EvalError},157:t=>{"use strict";t.exports=Error},249:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";var Buffer=__webpack_require__(1545).hp;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:F(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var f="suspendedStart",d="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var x={};c(x,a,(function(){return this}));var w=Object.getPrototypeOf,k=w&&w(w(T([])));k&&k!==r&&n.call(k,a)&&(x=k);var _=b.prototype=v.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,s){var u=l(t[o],t,i);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==_typeof(p)&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function F(e,r,n){var o=f;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var c=l(e,r,n);if("normal"===c.type){if(o=n.done?m:d,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=l(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return g.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),c(_,u,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _createForOfIteratorHelper(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach((function(e){_defineProperty(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){asyncGeneratorStep(i,n,o,a,s,"next",t)}function s(t){asyncGeneratorStep(i,n,o,a,s,"throw",t)}a(void 0)}))}}var Token=__webpack_require__(4872),strtok3=__webpack_require__(4021),_require=__webpack_require__(1690),stringToBytes=_require.stringToBytes,tarHeaderChecksumMatches=_require.tarHeaderChecksumMatches,uint32SyncSafeToken=_require.uint32SyncSafeToken,supported=__webpack_require__(2),minimumBytes=4100;function fromStream(t){return _fromStream.apply(this,arguments)}function _fromStream(){return _fromStream=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,strtok3.fromStream(e);case 2:return r=t.sent,t.prev=3,t.next=6,fromTokenizer(r);case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,t.next=10,r.close();case 10:return t.finish(7);case 11:case"end":return t.stop()}}),t,null,[[3,,7,11]])}))),_fromStream.apply(this,arguments)}function fromBuffer(t){return _fromBuffer.apply(this,arguments)}function _fromBuffer(){return(_fromBuffer=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r,n;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)){t.next=2;break}throw new TypeError("Expected the `input` argument to be of type `Uint8Array` or `Buffer` or `ArrayBuffer`, got `".concat(_typeof(e),"`"));case 2:if((r=e instanceof Buffer?e:Buffer.from(e))&&r.length>1){t.next=5;break}return t.abrupt("return");case 5:return n=strtok3.fromBuffer(r),t.abrupt("return",fromTokenizer(n));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _check(t,e,r){r=_objectSpread({offset:0},r);var n,o=_createForOfIteratorHelper(e.entries());try{for(o.s();!(n=o.n()).done;){var i=_slicedToArray(n.value,2),a=i[0],s=i[1];if(r.mask){if(s!==(r.mask[a]&t[a+r.offset]))return!1}else if(s!==t[a+r.offset])return!1}}catch(t){o.e(t)}finally{o.f()}return!0}function fromTokenizer(t){return _fromTokenizer2.apply(this,arguments)}function _fromTokenizer2(){return(_fromTokenizer2=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.abrupt("return",_fromTokenizer(e));case 4:if(t.prev=4,t.t0=t.catch(0),t.t0 instanceof strtok3.EndOfStreamError){t.next=8;break}throw t.t0;case 8:case"end":return t.stop()}}),t,null,[[0,4]])})))).apply(this,arguments)}function _fromTokenizer(t){return _fromTokenizer3.apply(this,arguments)}function _fromTokenizer3(){return _fromTokenizer3=_asyncToGenerator(_regeneratorRuntime().mark((function t(e){var r,n,o,i,a,s,u,c,p,l,f,d,h,m,y,v,g,b,x,w,k,_,E,S,F,O,j,P,A,T;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Buffer.alloc(minimumBytes),n=function(t,e){return _check(r,t,e)},o=function(t,e){return n(stringToBytes(t),e)},e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),t.next=7,e.peekBuffer(r,{length:12,mayBeLess:!0});case 7:if(!n([66,77])){t.next=9;break}return t.abrupt("return",{ext:"bmp",mime:"image/bmp"});case 9:if(!n([11,119])){t.next=11;break}return t.abrupt("return",{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"});case 11:if(!n([120,1])){t.next=13;break}return t.abrupt("return",{ext:"dmg",mime:"application/x-apple-diskimage"});case 13:if(!n([77,90])){t.next=15;break}return t.abrupt("return",{ext:"exe",mime:"application/x-msdownload"});case 15:if(!n([37,33])){t.next=21;break}return t.next=18,e.peekBuffer(r,{length:24,mayBeLess:!0});case 18:if(!o("PS-Adobe-",{offset:2})||!o(" EPSF-",{offset:14})){t.next=20;break}return t.abrupt("return",{ext:"eps",mime:"application/eps"});case 20:return t.abrupt("return",{ext:"ps",mime:"application/postscript"});case 21:if(!n([31,160])&&!n([31,157])){t.next=23;break}return t.abrupt("return",{ext:"Z",mime:"application/x-compress"});case 23:if(!n([255,216,255])){t.next=25;break}return t.abrupt("return",{ext:"jpg",mime:"image/jpeg"});case 25:if(!n([73,73,188])){t.next=27;break}return t.abrupt("return",{ext:"jxr",mime:"image/vnd.ms-photo"});case 27:if(!n([31,139,8])){t.next=29;break}return t.abrupt("return",{ext:"gz",mime:"application/gzip"});case 29:if(!n([66,90,104])){t.next=31;break}return t.abrupt("return",{ext:"bz2",mime:"application/x-bzip2"});case 31:if(!o("ID3")){t.next=42;break}return t.next=34,e.ignore(6);case 34:return t.next=36,e.readToken(uint32SyncSafeToken);case 36:if(i=t.sent,!(e.position+i>e.fileInfo.size)){t.next=39;break}return t.abrupt("return",{ext:"mp3",mime:"audio/mpeg"});case 39:return t.next=41,e.ignore(i);case 41:return t.abrupt("return",fromTokenizer(e));case 42:if(!o("MP+")){t.next=44;break}return t.abrupt("return",{ext:"mpc",mime:"audio/x-musepack"});case 44:if(67!==r[0]&&70!==r[0]||!n([87,83],{offset:1})){t.next=46;break}return t.abrupt("return",{ext:"swf",mime:"application/x-shockwave-flash"});case 46:if(!n([71,73,70])){t.next=48;break}return t.abrupt("return",{ext:"gif",mime:"image/gif"});case 48:if(!o("FLIF")){t.next=50;break}return t.abrupt("return",{ext:"flif",mime:"image/flif"});case 50:if(!o("8BPS")){t.next=52;break}return t.abrupt("return",{ext:"psd",mime:"image/vnd.adobe.photoshop"});case 52:if(!o("WEBP",{offset:8})){t.next=54;break}return t.abrupt("return",{ext:"webp",mime:"image/webp"});case 54:if(!o("MPCK")){t.next=56;break}return t.abrupt("return",{ext:"mpc",mime:"audio/x-musepack"});case 56:if(!o("FORM")){t.next=58;break}return t.abrupt("return",{ext:"aif",mime:"audio/aiff"});case 58:if(!o("icns",{offset:0})){t.next=60;break}return t.abrupt("return",{ext:"icns",mime:"image/icns"});case 60:if(!n([80,75,3,4])){t.next=121;break}t.prev=61;case 62:if(!(e.position+30<e.fileInfo.size)){t.next=114;break}return t.next=65,e.readBuffer(r,{length:30});case 65:return a={compressedSize:r.readUInt32LE(18),uncompressedSize:r.readUInt32LE(22),filenameLength:r.readUInt16LE(26),extraFieldLength:r.readUInt16LE(28)},t.next=68,e.readToken(new Token.StringType(a.filenameLength,"utf-8"));case 68:return a.filename=t.sent,t.next=71,e.ignore(a.extraFieldLength);case 71:if("META-INF/mozilla.rsa"!==a.filename){t.next=73;break}return t.abrupt("return",{ext:"xpi",mime:"application/x-xpinstall"});case 73:if(!a.filename.endsWith(".rels")&&!a.filename.endsWith(".xml")){t.next=83;break}s=a.filename.split("/")[0],t.t0=s,t.next="_rels"===t.t0?78:"word"===t.t0?79:"ppt"===t.t0?80:"xl"===t.t0?81:82;break;case 78:return t.abrupt("break",83);case 79:return t.abrupt("return",{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"});case 80:return t.abrupt("return",{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"});case 81:return t.abrupt("return",{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});case 82:return t.abrupt("break",83);case 83:if(!a.filename.startsWith("xl/")){t.next=85;break}return t.abrupt("return",{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});case 85:if(!a.filename.startsWith("3D/")||!a.filename.endsWith(".model")){t.next=87;break}return t.abrupt("return",{ext:"3mf",mime:"model/3mf"});case 87:if("mimetype"!==a.filename||a.compressedSize!==a.uncompressedSize){t.next=98;break}return t.next=90,e.readToken(new Token.StringType(a.compressedSize,"utf-8"));case 90:u=t.sent,t.t1=u,t.next="application/epub+zip"===t.t1?94:"application/vnd.oasis.opendocument.text"===t.t1?95:"application/vnd.oasis.opendocument.spreadsheet"===t.t1?96:"application/vnd.oasis.opendocument.presentation"===t.t1?97:98;break;case 94:return t.abrupt("return",{ext:"epub",mime:"application/epub+zip"});case 95:return t.abrupt("return",{ext:"odt",mime:"application/vnd.oasis.opendocument.text"});case 96:return t.abrupt("return",{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"});case 97:return t.abrupt("return",{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"});case 98:if(0!==a.compressedSize){t.next=110;break}c=-1;case 100:if(!(c<0&&e.position<e.fileInfo.size)){t.next=108;break}return t.next=103,e.peekBuffer(r,{mayBeLess:!0});case 103:return c=r.indexOf("504B0304",0,"hex"),t.next=106,e.ignore(c>=0?c:r.length);case 106:t.next=100;break;case 108:t.next=112;break;case 110:return t.next=112,e.ignore(a.compressedSize);case 112:t.next=62;break;case 114:t.next=120;break;case 116:if(t.prev=116,t.t2=t.catch(61),t.t2 instanceof strtok3.EndOfStreamError){t.next=120;break}throw t.t2;case 120:return t.abrupt("return",{ext:"zip",mime:"application/zip"});case 121:if(!o("OggS")){t.next=140;break}return t.next=124,e.ignore(28);case 124:return p=Buffer.alloc(8),t.next=127,e.readBuffer(p);case 127:if(!_check(p,[79,112,117,115,72,101,97,100])){t.next=129;break}return t.abrupt("return",{ext:"opus",mime:"audio/opus"});case 129:if(!_check(p,[128,116,104,101,111,114,97])){t.next=131;break}return t.abrupt("return",{ext:"ogv",mime:"video/ogg"});case 131:if(!_check(p,[1,118,105,100,101,111,0])){t.next=133;break}return t.abrupt("return",{ext:"ogm",mime:"video/ogg"});case 133:if(!_check(p,[127,70,76,65,67])){t.next=135;break}return t.abrupt("return",{ext:"oga",mime:"audio/ogg"});case 135:if(!_check(p,[83,112,101,101,120,32,32])){t.next=137;break}return t.abrupt("return",{ext:"spx",mime:"audio/ogg"});case 137:if(!_check(p,[1,118,111,114,98,105,115])){t.next=139;break}return t.abrupt("return",{ext:"ogg",mime:"audio/ogg"});case 139:return t.abrupt("return",{ext:"ogx",mime:"application/ogg"});case 140:if(!n([80,75])||3!==r[2]&&5!==r[2]&&7!==r[2]||4!==r[3]&&6!==r[3]&&8!==r[3]){t.next=142;break}return t.abrupt("return",{ext:"zip",mime:"application/zip"});case 142:if(!(o("ftyp",{offset:4})&&96&r[8])){t.next=167;break}l=r.toString("binary",8,12).replace("\0"," ").trim(),t.t3=l,t.next="avif"===t.t3?147:"mif1"===t.t3?148:"msf1"===t.t3?149:"heic"===t.t3||"heix"===t.t3?150:"hevc"===t.t3||"hevx"===t.t3?151:"qt"===t.t3?152:"M4V"===t.t3||"M4VH"===t.t3||"M4VP"===t.t3?153:"M4P"===t.t3?154:"M4B"===t.t3?155:"M4A"===t.t3?156:"F4V"===t.t3?157:"F4P"===t.t3?158:"F4A"===t.t3?159:"F4B"===t.t3?160:"crx"===t.t3?161:162;break;case 147:return t.abrupt("return",{ext:"avif",mime:"image/avif"});case 148:return t.abrupt("return",{ext:"heic",mime:"image/heif"});case 149:return t.abrupt("return",{ext:"heic",mime:"image/heif-sequence"});case 150:return t.abrupt("return",{ext:"heic",mime:"image/heic"});case 151:return t.abrupt("return",{ext:"heic",mime:"image/heic-sequence"});case 152:return t.abrupt("return",{ext:"mov",mime:"video/quicktime"});case 153:return t.abrupt("return",{ext:"m4v",mime:"video/x-m4v"});case 154:return t.abrupt("return",{ext:"m4p",mime:"video/mp4"});case 155:return t.abrupt("return",{ext:"m4b",mime:"audio/mp4"});case 156:return t.abrupt("return",{ext:"m4a",mime:"audio/x-m4a"});case 157:return t.abrupt("return",{ext:"f4v",mime:"video/mp4"});case 158:return t.abrupt("return",{ext:"f4p",mime:"video/mp4"});case 159:return t.abrupt("return",{ext:"f4a",mime:"audio/mp4"});case 160:return t.abrupt("return",{ext:"f4b",mime:"audio/mp4"});case 161:return t.abrupt("return",{ext:"cr3",mime:"image/x-canon-cr3"});case 162:if(!l.startsWith("3g")){t.next=166;break}if(!l.startsWith("3g2")){t.next=165;break}return t.abrupt("return",{ext:"3g2",mime:"video/3gpp2"});case 165:return t.abrupt("return",{ext:"3gp",mime:"video/3gpp"});case 166:return t.abrupt("return",{ext:"mp4",mime:"video/mp4"});case 167:if(!o("MThd")){t.next=169;break}return t.abrupt("return",{ext:"mid",mime:"audio/midi"});case 169:if(!o("wOFF")||!n([0,1,0,0],{offset:4})&&!o("OTTO",{offset:4})){t.next=171;break}return t.abrupt("return",{ext:"woff",mime:"font/woff"});case 171:if(!o("wOF2")||!n([0,1,0,0],{offset:4})&&!o("OTTO",{offset:4})){t.next=173;break}return t.abrupt("return",{ext:"woff2",mime:"font/woff2"});case 173:if(!n([212,195,178,161])&&!n([161,178,195,212])){t.next=175;break}return t.abrupt("return",{ext:"pcap",mime:"application/vnd.tcpdump.pcap"});case 175:if(!o("DSD ")){t.next=177;break}return t.abrupt("return",{ext:"dsf",mime:"audio/x-dsf"});case 177:if(!o("LZIP")){t.next=179;break}return t.abrupt("return",{ext:"lz",mime:"application/x-lzip"});case 179:if(!o("fLaC")){t.next=181;break}return t.abrupt("return",{ext:"flac",mime:"audio/x-flac"});case 181:if(!n([66,80,71,251])){t.next=183;break}return t.abrupt("return",{ext:"bpg",mime:"image/bpg"});case 183:if(!o("wvpk")){t.next=185;break}return t.abrupt("return",{ext:"wv",mime:"audio/wavpack"});case 185:if(!o("%PDF")){t.next=195;break}return t.next=188,e.ignore(1350);case 188:return f=Buffer.alloc(Math.min(10485760,e.fileInfo.size)),t.next=192,e.readBuffer(f,{mayBeLess:!0});case 192:if(!f.includes(Buffer.from("AIPrivateData"))){t.next=194;break}return t.abrupt("return",{ext:"ai",mime:"application/postscript"});case 194:return t.abrupt("return",{ext:"pdf",mime:"application/pdf"});case 195:if(!n([0,97,115,109])){t.next=197;break}return t.abrupt("return",{ext:"wasm",mime:"application/wasm"});case 197:if(!n([73,73,42,0])){t.next=210;break}if(!o("CR",{offset:8})){t.next=200;break}return t.abrupt("return",{ext:"cr2",mime:"image/x-canon-cr2"});case 200:if(!n([28,0,254,0],{offset:8})&&!n([31,0,11,0],{offset:8})){t.next=202;break}return t.abrupt("return",{ext:"nef",mime:"image/x-nikon-nef"});case 202:if(!n([8,0,0,0],{offset:4})||!n([45,0,254,0],{offset:8})&&!n([39,0,254,0],{offset:8})){t.next=204;break}return t.abrupt("return",{ext:"dng",mime:"image/x-adobe-dng"});case 204:return r=Buffer.alloc(24),t.next=207,e.peekBuffer(r);case 207:if(!n([16,251,134,1],{offset:4})&&!n([8,0,0,0],{offset:4})||!n([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})){t.next=209;break}return t.abrupt("return",{ext:"arw",mime:"image/x-sony-arw"});case 209:return t.abrupt("return",{ext:"tif",mime:"image/tiff"});case 210:if(!n([77,77,0,42])){t.next=212;break}return t.abrupt("return",{ext:"tif",mime:"image/tiff"});case 212:if(!o("MAC ")){t.next=214;break}return t.abrupt("return",{ext:"ape",mime:"audio/ape"});case 214:if(!n([26,69,223,163])){t.next=233;break}return g=function(){return(g=_asyncToGenerator(_regeneratorRuntime().mark((function t(r,n){var o;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n>0)){t.next=11;break}return t.next=3,m();case 3:if(17026!==(o=t.sent).id){t.next=6;break}return t.abrupt("return",e.readToken(new Token.StringType(o.len,"utf-8")));case 6:return t.next=8,e.ignore(o.len);case 8:--n,t.next=0;break;case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)},v=function(t,e){return g.apply(this,arguments)},y=function(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function t(){var e,r,n;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return e=t.sent,t.next=5,d();case 5:return(r=t.sent)[0]^=128>>r.length-1,n=Math.min(6,r.length),t.abrupt("return",{id:e.readUIntBE(0,e.length),len:r.readUIntBE(r.length-n,n)});case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)},m=function(){return y.apply(this,arguments)},h=function(){return(h=_asyncToGenerator(_regeneratorRuntime().mark((function t(){var r,n,o,i;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.peekNumber(Token.UINT8);case 2:for(r=t.sent,n=128,o=0;!(r&n)&&0!==n;)++o,n>>=1;return i=Buffer.alloc(o+1),t.next=9,e.readBuffer(i);case 9:return t.abrupt("return",i);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)},d=function(){return h.apply(this,arguments)},t.next=223,m();case 223:return b=t.sent,t.next=226,v(1,b.len);case 226:x=t.sent,t.t4=x,t.next="webm"===t.t4?230:"matroska"===t.t4?231:232;break;case 230:return t.abrupt("return",{ext:"webm",mime:"video/webm"});case 231:return t.abrupt("return",{ext:"mkv",mime:"video/x-matroska"});case 232:return t.abrupt("return");case 233:if(!n([82,73,70,70])){t.next=240;break}if(!n([65,86,73],{offset:8})){t.next=236;break}return t.abrupt("return",{ext:"avi",mime:"video/vnd.avi"});case 236:if(!n([87,65,86,69],{offset:8})){t.next=238;break}return t.abrupt("return",{ext:"wav",mime:"audio/vnd.wave"});case 238:if(!n([81,76,67,77],{offset:8})){t.next=240;break}return t.abrupt("return",{ext:"qcp",mime:"audio/qcelp"});case 240:if(!o("SQLi")){t.next=242;break}return t.abrupt("return",{ext:"sqlite",mime:"application/x-sqlite3"});case 242:if(!n([78,69,83,26])){t.next=244;break}return t.abrupt("return",{ext:"nes",mime:"application/x-nintendo-nes-rom"});case 244:if(!o("Cr24")){t.next=246;break}return t.abrupt("return",{ext:"crx",mime:"application/x-google-chrome-extension"});case 246:if(!o("MSCF")&&!o("ISc(")){t.next=248;break}return t.abrupt("return",{ext:"cab",mime:"application/vnd.ms-cab-compressed"});case 248:if(!n([237,171,238,219])){t.next=250;break}return t.abrupt("return",{ext:"rpm",mime:"application/x-rpm"});case 250:if(!n([197,208,211,198])){t.next=252;break}return t.abrupt("return",{ext:"eps",mime:"application/eps"});case 252:if(!n([40,181,47,253])){t.next=254;break}return t.abrupt("return",{ext:"zst",mime:"application/zstd"});case 254:if(!n([79,84,84,79,0])){t.next=256;break}return t.abrupt("return",{ext:"otf",mime:"font/otf"});case 256:if(!o("#!AMR")){t.next=258;break}return t.abrupt("return",{ext:"amr",mime:"audio/amr"});case 258:if(!o("{\\rtf")){t.next=260;break}return t.abrupt("return",{ext:"rtf",mime:"application/rtf"});case 260:if(!n([70,76,86,1])){t.next=262;break}return t.abrupt("return",{ext:"flv",mime:"video/x-flv"});case 262:if(!o("IMPM")){t.next=264;break}return t.abrupt("return",{ext:"it",mime:"audio/x-it"});case 264:if(!(o("-lh0-",{offset:2})||o("-lh1-",{offset:2})||o("-lh2-",{offset:2})||o("-lh3-",{offset:2})||o("-lh4-",{offset:2})||o("-lh5-",{offset:2})||o("-lh6-",{offset:2})||o("-lh7-",{offset:2})||o("-lzs-",{offset:2})||o("-lz4-",{offset:2})||o("-lz5-",{offset:2})||o("-lhd-",{offset:2}))){t.next=266;break}return t.abrupt("return",{ext:"lzh",mime:"application/x-lzh-compressed"});case 266:if(!n([0,0,1,186])){t.next=271;break}if(!n([33],{offset:4,mask:[241]})){t.next=269;break}return t.abrupt("return",{ext:"mpg",mime:"video/MP1S"});case 269:if(!n([68],{offset:4,mask:[196]})){t.next=271;break}return t.abrupt("return",{ext:"mpg",mime:"video/MP2P"});case 271:if(!o("ITSF")){t.next=273;break}return t.abrupt("return",{ext:"chm",mime:"application/vnd.ms-htmlhelp"});case 273:if(!n([253,55,122,88,90,0])){t.next=275;break}return t.abrupt("return",{ext:"xz",mime:"application/x-xz"});case 275:if(!o("<?xml ")){t.next=277;break}return t.abrupt("return",{ext:"xml",mime:"application/xml"});case 277:if(!n([55,122,188,175,39,28])){t.next=279;break}return t.abrupt("return",{ext:"7z",mime:"application/x-7z-compressed"});case 279:if(!n([82,97,114,33,26,7])||0!==r[6]&&1!==r[6]){t.next=281;break}return t.abrupt("return",{ext:"rar",mime:"application/x-rar-compressed"});case 281:if(!o("solid ")){t.next=283;break}return t.abrupt("return",{ext:"stl",mime:"model/stl"});case 283:if(!o("BLENDER")){t.next=285;break}return t.abrupt("return",{ext:"blend",mime:"application/x-blender"});case 285:if(!o("!<arch>")){t.next=294;break}return t.next=288,e.ignore(8);case 288:return t.next=290,e.readToken(new Token.StringType(13,"ascii"));case 290:if("debian-binary"!==t.sent){t.next=293;break}return t.abrupt("return",{ext:"deb",mime:"application/x-deb"});case 293:return t.abrupt("return",{ext:"ar",mime:"application/x-unix-archive"});case 294:if(!n([137,80,78,71,13,10,26,10])){t.next=313;break}return k=function(){return(k=_asyncToGenerator(_regeneratorRuntime().mark((function t(){return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.readToken(Token.INT32_BE);case 2:return t.t0=t.sent,t.next=5,e.readToken(new Token.StringType(4,"binary"));case 5:return t.t1=t.sent,t.abrupt("return",{length:t.t0,type:t.t1});case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)},w=function(){return k.apply(this,arguments)},t.next=299,e.ignore(8);case 299:return t.next=301,w();case 301:if(!((_=t.sent).length<0)){t.next=304;break}return t.abrupt("return");case 304:t.t5=_.type,t.next="IDAT"===t.t5?307:"acTL"===t.t5?308:309;break;case 307:return t.abrupt("return",{ext:"png",mime:"image/png"});case 308:return t.abrupt("return",{ext:"apng",mime:"image/apng"});case 309:return t.next=311,e.ignore(_.length+4);case 311:if(e.position+8<e.fileInfo.size){t.next=299;break}case 312:return t.abrupt("return",{ext:"png",mime:"image/png"});case 313:if(!n([65,82,82,79,87,49,0,0])){t.next=315;break}return t.abrupt("return",{ext:"arrow",mime:"application/x-apache-arrow"});case 315:if(!n([103,108,84,70,2,0,0,0])){t.next=317;break}return t.abrupt("return",{ext:"glb",mime:"model/gltf-binary"});case 317:if(!(n([102,114,101,101],{offset:4})||n([109,100,97,116],{offset:4})||n([109,111,111,118],{offset:4})||n([119,105,100,101],{offset:4}))){t.next=319;break}return t.abrupt("return",{ext:"mov",mime:"video/quicktime"});case 319:if(!n([73,73,82,79,8,0,0,0,24])){t.next=321;break}return t.abrupt("return",{ext:"orf",mime:"image/x-olympus-orf"});case 321:if(!o("gimp xcf ")){t.next=323;break}return t.abrupt("return",{ext:"xcf",mime:"image/x-xcf"});case 323:if(!n([73,73,85,0,24,0,0,0,136,231,116,216])){t.next=325;break}return t.abrupt("return",{ext:"rw2",mime:"image/x-panasonic-rw2"});case 325:if(!n([48,38,178,117,142,102,207,17,166,217])){t.next=351;break}return S=function(){return(S=_asyncToGenerator(_regeneratorRuntime().mark((function t(){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Buffer.alloc(16),t.next=3,e.readBuffer(r);case 3:return t.t0=r,t.t1=Number,t.next=7,e.readToken(Token.UINT64_LE);case 7:return t.t2=t.sent,t.t3=(0,t.t1)(t.t2),t.abrupt("return",{id:t.t0,size:t.t3});case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)},E=function(){return S.apply(this,arguments)},t.next=330,e.ignore(30);case 330:if(!(e.position+24<e.fileInfo.size)){t.next=350;break}return t.next=333,E();case 333:if(F=t.sent,O=F.size-24,!_check(F.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){t.next=346;break}return j=Buffer.alloc(16),t.t6=O,t.next=340,e.readBuffer(j);case 340:if(O=t.t6-=t.sent,!_check(j,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43])){t.next=343;break}return t.abrupt("return",{ext:"asf",mime:"audio/x-ms-asf"});case 343:if(!_check(j,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43])){t.next=345;break}return t.abrupt("return",{ext:"asf",mime:"video/x-ms-asf"});case 345:return t.abrupt("break",350);case 346:return t.next=348,e.ignore(O);case 348:t.next=330;break;case 350:return t.abrupt("return",{ext:"asf",mime:"application/vnd.ms-asf"});case 351:if(!n([171,75,84,88,32,49,49,187,13,10,26,10])){t.next=353;break}return t.abrupt("return",{ext:"ktx",mime:"image/ktx"});case 353:if(!n([126,16,4])&&!n([126,24,4])||!n([48,77,73,69],{offset:4})){t.next=355;break}return t.abrupt("return",{ext:"mie",mime:"application/x-mie"});case 355:if(!n([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2})){t.next=357;break}return t.abrupt("return",{ext:"shp",mime:"application/x-esri-shape"});case 357:if(!n([0,0,0,12,106,80,32,32,13,10,135,10])){t.next=371;break}return t.next=360,e.ignore(20);case 360:return t.next=362,e.readToken(new Token.StringType(4,"ascii"));case 362:P=t.sent,t.t7=P,t.next="jp2 "===t.t7?366:"jpx "===t.t7?367:"jpm "===t.t7?368:"mjp2"===t.t7?369:370;break;case 366:return t.abrupt("return",{ext:"jp2",mime:"image/jp2"});case 367:return t.abrupt("return",{ext:"jpx",mime:"image/jpx"});case 368:return t.abrupt("return",{ext:"jpm",mime:"image/jpm"});case 369:return t.abrupt("return",{ext:"mj2",mime:"image/mj2"});case 370:return t.abrupt("return");case 371:if(!n([255,10])&&!n([0,0,0,12,74,88,76,32,13,10,135,10])){t.next=373;break}return t.abrupt("return",{ext:"jxl",mime:"image/jxl"});case 373:if(!n([0,0,1,186])&&!n([0,0,1,179])){t.next=375;break}return t.abrupt("return",{ext:"mpg",mime:"video/mpeg"});case 375:if(!n([0,1,0,0,0])){t.next=377;break}return t.abrupt("return",{ext:"ttf",mime:"font/ttf"});case 377:if(!n([0,0,1,0])){t.next=379;break}return t.abrupt("return",{ext:"ico",mime:"image/x-icon"});case 379:if(!n([0,0,2,0])){t.next=381;break}return t.abrupt("return",{ext:"cur",mime:"image/x-icon"});case 381:if(!n([208,207,17,224,161,177,26,225])){t.next=383;break}return t.abrupt("return",{ext:"cfb",mime:"application/x-cfb"});case 383:return t.next=385,e.peekBuffer(r,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0});case 385:if(!o("BEGIN:")){t.next=390;break}if(!o("VCARD",{offset:6})){t.next=388;break}return t.abrupt("return",{ext:"vcf",mime:"text/vcard"});case 388:if(!o("VCALENDAR",{offset:6})){t.next=390;break}return t.abrupt("return",{ext:"ics",mime:"text/calendar"});case 390:if(!o("FUJIFILMCCD-RAW")){t.next=392;break}return t.abrupt("return",{ext:"raf",mime:"image/x-fujifilm-raf"});case 392:if(!o("Extended Module:")){t.next=394;break}return t.abrupt("return",{ext:"xm",mime:"audio/x-xm"});case 394:if(!o("Creative Voice File")){t.next=396;break}return t.abrupt("return",{ext:"voc",mime:"audio/x-voc"});case 396:if(!(n([4,0,0,0])&&r.length>=16)){t.next=408;break}if(!((A=r.readUInt32LE(12))>12&&r.length>=A+16)){t.next=408;break}if(t.prev=399,T=r.slice(16,A+16).toString(),!JSON.parse(T).files){t.next=404;break}return t.abrupt("return",{ext:"asar",mime:"application/x-asar"});case 404:t.next=408;break;case 406:t.prev=406,t.t8=t.catch(399);case 408:if(!n([6,14,43,52,2,5,1,1,13,1,2,1,1,2])){t.next=410;break}return t.abrupt("return",{ext:"mxf",mime:"application/mxf"});case 410:if(!o("SCRM",{offset:44})){t.next=412;break}return t.abrupt("return",{ext:"s3m",mime:"audio/x-s3m"});case 412:if(!n([71],{offset:4})||!n([71],{offset:192})&&!n([71],{offset:196})){t.next=414;break}return t.abrupt("return",{ext:"mts",mime:"video/mp2t"});case 414:if(!n([66,79,79,75,77,79,66,73],{offset:60})){t.next=416;break}return t.abrupt("return",{ext:"mobi",mime:"application/x-mobipocket-ebook"});case 416:if(!n([68,73,67,77],{offset:128})){t.next=418;break}return t.abrupt("return",{ext:"dcm",mime:"application/dicom"});case 418:if(!n([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])){t.next=420;break}return t.abrupt("return",{ext:"lnk",mime:"application/x.ms.shortcut"});case 420:if(!n([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])){t.next=422;break}return t.abrupt("return",{ext:"alias",mime:"application/x.apple.alias"});case 422:if(!n([76,80],{offset:34})||!(n([0,0,1],{offset:8})||n([1,0,2],{offset:8})||n([2,0,2],{offset:8}))){t.next=424;break}return t.abrupt("return",{ext:"eot",mime:"application/vnd.ms-fontobject"});case 424:if(!n([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29])){t.next=426;break}return t.abrupt("return",{ext:"indd",mime:"application/x-indesign"});case 426:return t.next=428,e.peekBuffer(r,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0});case 428:if(!tarHeaderChecksumMatches(r)){t.next=430;break}return t.abrupt("return",{ext:"tar",mime:"application/x-tar"});case 430:if(!n([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0])){t.next=432;break}return t.abrupt("return",{ext:"skp",mime:"application/vnd.sketchup.skp"});case 432:if(!o("-----BEGIN PGP MESSAGE-----")){t.next=434;break}return t.abrupt("return",{ext:"pgp",mime:"application/pgp-encrypted"});case 434:if(!(r.length>=2&&n([255,224],{offset:0,mask:[255,224]}))){t.next=445;break}if(!n([16],{offset:1,mask:[22]})){t.next=439;break}if(!n([8],{offset:1,mask:[8]})){t.next=438;break}return t.abrupt("return",{ext:"aac",mime:"audio/aac"});case 438:return t.abrupt("return",{ext:"aac",mime:"audio/aac"});case 439:if(!n([2],{offset:1,mask:[6]})){t.next=441;break}return t.abrupt("return",{ext:"mp3",mime:"audio/mpeg"});case 441:if(!n([4],{offset:1,mask:[6]})){t.next=443;break}return t.abrupt("return",{ext:"mp2",mime:"audio/mpeg"});case 443:if(!n([6],{offset:1,mask:[6]})){t.next=445;break}return t.abrupt("return",{ext:"mp1",mime:"audio/mpeg"});case 445:case"end":return t.stop()}}),t,null,[[61,116],[399,406]])}))),_fromTokenizer3.apply(this,arguments)}var stream=function stream(readableStream){return new Promise((function(resolve,reject){var stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",_asyncToGenerator(_regeneratorRuntime().mark((function t(){var e,r,n,o;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new stream.PassThrough,r=stream.pipeline?stream.pipeline(readableStream,e,(function(){})):readableStream.pipe(e),n=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0),t.prev=3,t.next=6,fromBuffer(n);case 6:o=t.sent,e.fileType=o,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),reject(t.t0);case 13:resolve(r);case 14:case"end":return t.stop()}}),t,null,[[3,10]])}))))}))},fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:function(){return new Set(supported.extensions)}}),Object.defineProperty(fileType,"mimeTypes",{get:function(){return new Set(supported.mimeTypes)}}),module.exports=fileType},377:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o="undefined"!=typeof Symbol&&Symbol,i=r(4379);t.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"===n(o("foo"))&&"symbol"===n(Symbol("bar"))&&i()}},395:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}t=r.nmd(t);var o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Boolean]",u="[object Date]",c="[object Function]",p="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",h="[object Promise]",m="[object RegExp]",y="[object Set]",v="[object String]",g="[object Symbol]",b="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",k="[object Float32Array]",_="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",F="[object Int32Array]",O="[object Uint8Array]",j="[object Uint8ClampedArray]",P="[object Uint16Array]",A="[object Uint32Array]",T=/\w*$/,D=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,I={};I[a]=I["[object Array]"]=I[x]=I[w]=I[s]=I[u]=I[k]=I[_]=I[E]=I[S]=I[F]=I[l]=I[f]=I[d]=I[m]=I[y]=I[v]=I[g]=I[O]=I[j]=I[P]=I[A]=!0,I["[object Error]"]=I[c]=I[b]=!1;var L="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,B="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,N=L||B||Function("return this")(),z="object"==n(e)&&e&&!e.nodeType&&e,R=z&&"object"==n(t)&&t&&!t.nodeType&&t,U=R&&R.exports===z;function M(t,e){return t.set(e[0],e[1]),t}function q(t,e){return t.add(e),t}function $(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function G(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Z(t,e){return function(r){return t(e(r))}}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var W,Y=Array.prototype,K=Function.prototype,Q=Object.prototype,J=N["__core-js_shared__"],X=(W=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",tt=K.toString,et=Q.hasOwnProperty,rt=Q.toString,nt=RegExp("^"+tt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=U?N.Buffer:void 0,it=N.Symbol,at=N.Uint8Array,st=Z(Object.getPrototypeOf,Object),ut=Object.create,ct=Q.propertyIsEnumerable,pt=Y.splice,lt=Object.getOwnPropertySymbols,ft=ot?ot.isBuffer:void 0,dt=Z(Object.keys,Object),ht=Nt(N,"DataView"),mt=Nt(N,"Map"),yt=Nt(N,"Promise"),vt=Nt(N,"Set"),gt=Nt(N,"WeakMap"),bt=Nt(Object,"create"),xt=qt(ht),wt=qt(mt),kt=qt(yt),_t=qt(vt),Et=qt(gt),St=it?it.prototype:void 0,Ft=St?St.valueOf:void 0;function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function jt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Pt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function At(t){this.__data__=new jt(t)}function Tt(t,e,r){var n=t[e];et.call(t,e)&&$t(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Dt(t,e){for(var r=t.length;r--;)if($t(t[r][0],e))return r;return-1}function Ct(t,e,r,n,o,i,h){var b;if(n&&(b=i?n(t,o,i,h):n(t)),void 0!==b)return b;if(!Wt(t))return t;var D=Gt(t);if(D){if(b=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&et.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,b)}else{var C=Rt(t),L=C==c||C==p;if(Zt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(C==d||C==a||L&&!i){if(G(t))return i?t:{};if(b=function(t){return"function"!=typeof t.constructor||Mt(t)?{}:Wt(e=st(t))?ut(e):{};var e}(L?{}:t),!e)return function(t,e){return Lt(t,zt(t),e)}(t,function(t,e){return t&&Lt(e,Yt(e),t)}(b,t))}else{if(!I[C])return i?t:{};b=function(t,e,r,n){var o,i=t.constructor;switch(e){case x:return It(t);case s:case u:return new i(+t);case w:return function(t,e){var r=e?It(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case k:case _:case E:case S:case F:case O:case j:case P:case A:return function(t,e){var r=e?It(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case l:return function(t,e,r){return $(e?r(V(t),!0):V(t),M,new t.constructor)}(t,n,r);case f:case v:return new i(t);case m:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return function(t,e,r){return $(e?r(H(t),!0):H(t),q,new t.constructor)}(t,n,r);case g:return o=t,Ft?Object(Ft.call(o)):{}}}(t,C,Ct,e)}}h||(h=new At);var B=h.get(t);if(B)return B;if(h.set(t,b),!D)var N=r?function(t){return function(t,e,r){var n=e(t);return Gt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Yt,zt)}(t):Yt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r););}(N||t,(function(o,i){N&&(o=t[i=o]),Tt(b,i,Ct(o,e,r,n,i,t,h))})),b}function It(t){var e=new t.constructor(t.byteLength);return new at(e).set(new at(t)),e}function Lt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var a=e[o],s=n?n(r[a],t[a],a,r,t):void 0;Tt(r,a,void 0===s?t[a]:s)}return r}function Bt(t,e){var r,o,i=t.__data__;return("string"==(o=n(r=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Wt(t)||(e=t,X&&X in e))&&(Ht(t)||G(t)?nt:D).test(qt(t));var e}(r)?r:void 0}Ot.prototype.clear=function(){this.__data__=bt?bt(null):{}},Ot.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Ot.prototype.get=function(t){var e=this.__data__;if(bt){var r=e[t];return r===o?void 0:r}return et.call(e,t)?e[t]:void 0},Ot.prototype.has=function(t){var e=this.__data__;return bt?void 0!==e[t]:et.call(e,t)},Ot.prototype.set=function(t,e){return this.__data__[t]=bt&&void 0===e?o:e,this},jt.prototype.clear=function(){this.__data__=[]},jt.prototype.delete=function(t){var e=this.__data__,r=Dt(e,t);return!(r<0||(r==e.len