!function(t){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{vare;"undefined"!=typeofwindow?e=window:"undefined"!=typeofglobal?e=global:"undefined"!=typeofself&&(e=self),e.Filer=t()}}(function(){vart;returnfunctione(t,n,r){functioni(a,s){if(!n[a]){if(!t[a]){varu="function"==typeofrequire&&require;if(!s&&u)returnu(a,!0);if(o)returno(a,!0);throwError("Cannot find module '"+a+"'")}varf=n[a]={exports:{}};t[a][0].call(f.exports,function(e){varn=t[a][1][e];returni(n?n:e)},f,f.exports,e,t,n,r)}returnn[a].exports}for(varo="function"==typeofrequire&&require,a=0;r.length>a;a++)i(r[a]);returni}({1:[function(e,n){(function(e){(function(){functionr(t){vare=!1;returnfunction(){if(e)throwError("Callback was already called.");e=!0,t.apply(i,arguments)}}vari,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){returni.async=o,a};vars=function(t,e){if(t.forEach)returnt.forEach(e);for(varn=0;t.length>n;n+=1)e(t[n],n,t)},u=function(t,e){if(t.map)returnt.map(e);varn=[];returns(t,function(t,r,i){n.push(e(t,r,i))}),n},f=function(t,e,n){returnt.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},c=function(t){if(Object.keys)returnObject.keys(t);vare=[];for(varnint)t.hasOwnProperty(n)&&e.push(n);returne};void0!==e&&e.nextTick?(a.nextTick=e.nextTick,a.setImmediate="undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeofsetImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,e,n){if(n=n||function(){},!t.length)returnn();vari=0;s(t,function(o){e(o,r(function(e){e?(n(e),n=function(){}):(i+=1,i>=t.length&&n(null))}))})},a.forEach=a.each,a.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)returnn();varr=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,e,n,r){vari=l(e);i.apply(null,[t,n,r])},a.forEachLimit=a.eachLimit;varl=function(t){returnfunction(e,n,r){if(r=r||function(){},!e.length||0>=t)returnr();vari=0,o=0,a=0;(functions(){if(i>=e.length)returnr();for(;t>a&&e.length>o;)o+=1,a+=1,n(e[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=e.length?r():s())})})()}},d=function(t){returnfunction(){vare=Array.prototype.slice.call(arguments);returnt.apply(null,[a.each].concat(e))}},h=function(t,e){returnfunction(){varn=Array.prototype.slice.call(arguments);returne.apply(null,[l(t)].concat(n))}},p=function(t){returnfunction(){vare=Array.prototype.slice.call(arguments);returnt.apply(null,[a.eachSeries].concat(e))}},g=function(t,e,n,r){vari=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n,r){i[t.index]=r,e(n)})},function(t){r(t,i)})};a.map=d(g),a.mapSeries=p(g),a.mapLimit=function(t,e,n,r){returnm(e)(t,n,r)};varm=function(t){returnh(t,g)};a.reduce=function(t,e,n,r){a.eachSeries(t,function(t,r){n(e,t,function(t,n){e=n,r(t)})},function(t){r(t,e)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,e,n,r){vari=u(t,function(t){returnt}).reverse();a.reduce(i,e,n,r)},a.foldr=a.reduceRight;varv=function(t,e,n,r){vari=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n&&i.push(t),e()})},function(){r(u(i.sort(function(t,e){returnt.index-e.index}),function(t){returnt.value}))})};a.filter=d(v),a.filterSeries=p(v),a.select=a.filter,a.selectSeries=a.filterSeries;vary=function(t,e,n,r){vari=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n||i.push(t),e()})},function(){r(u(i.sort(function(t,e){returnt.index-e.index}),function(t){returnt.value}))})};a.reject=d(y),a.rejectSeries=p(y);varb=function(t,e,n,r){t(e,function(t,e){n(t,function(n){n?(r(t),r=function(){}):e()})},function(){r()})};a.detect=d(b),a.detectSeries=p(b),a.some=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t&&(n(!0),n=function(){}),r()})},f
break;default:throwError("Unknown encoding")}returni},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.equals=function(t){returnY(r.isBuffer(t),"Argument must be a Buffer"),0===r.compare(this,t)},r.prototype.compare=function(t){returnY(r.isBuffer(t),"Argument must be a Buffer"),r.compare(this,t)},r.prototype.copy=function(t,e,n,i){varo=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){Y(i>=n,"sourceEnd < sourceStart"),Y(e>=0&&t.length>e,"targetStart out of bounds"),Y(n>=0&&o.length>n,"sourceStart out of bounds"),Y(i>=0&&o.length>=i,"sourceEnd out of bounds"),i>this.length&&(i=this.length),i-n>t.length-e&&(i=t.length-e+n);vara=i-n;if(100>a||!r._useTypedArrays)for(vars=0;a>s;s++)t[s+e]=this[s+n];elset._set(this.subarray(n,n+a),e)}},r.prototype.slice=function(t,e){varn=this.length;if(t=C(t,n,0),e=C(e,n,n),r._useTypedArrays)returnr._augment(this.subarray(t,e));for(vari=e-t,o=newr(i,void0,!0),a=0;i>a;a++)o[a]=this[a+t];returno},r.prototype.get=function(t){returnconsole.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){returnconsole.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.readUInt8=function(t,e){returne||(Y(void0!==t&&null!==t,"missing offset"),Y(this.length>t,"Trying to read beyond buffer length")),t>=this.length?void0:this[t]},r.prototype.readUInt16LE=function(t,e){returnm(this,t,!0,e)},r.prototype.readUInt16BE=function(t,e){returnm(this,t,!1,e)},r.prototype.readUInt32LE=function(t,e){returnv(this,t,!0,e)},r.prototype.readUInt32BE=function(t,e){returnv(this,t,!1,e)},r.prototype.readInt8=function(t,e){if(e||(Y(void0!==t&&null!==t,"missing offset"),Y(this.length>t,"Trying to read beyond buffer length")),!(t>=this.length)){varn=128&this[t];returnn?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,e){returny(this,t,!0,e)},r.prototype.readInt16BE=function(t,e){returny(this,t,!1,e)},r.prototype.readInt32LE=function(t,e){returnb(this,t,!0,e)},r.prototype.readInt32BE=function(t,e){returnb(this,t,!1,e)},r.prototype.readFloatLE=function(t,e){return_(this,t,!0,e)},r.prototype.readFloatBE=function(t,e){return_(this,t,!1,e)},r.prototype.readDoubleLE=function(t,e){returnw(this,t,!0,e)},r.prototype.readDoubleBE=function(t,e){returnw(this,t,!1,e)},r.prototype.writeUInt8=function(t,e,n){returnn||(Y(void0!==t&&null!==t,"missing value"),Y(void0!==e&&null!==e,"missing offset"),Y(this.length>e,"trying to write beyond buffer length"),P(t,255)),e>=this.length?void0:(this[e]=t,e+1)},r.prototype.writeUInt16LE=function(t,e,n){returnE(this,t,e,!0,n)},r.prototype.writeUInt16BE=function(t,e,n){returnE(this,t,e,!1,n)},r.prototype.writeUInt32LE=function(t,e,n){returnI(this,t,e,!0,n)},r.prototype.writeUInt32BE=function(t,e,n){returnI(this,t,e,!1,n)},r.prototype.writeInt8=function(t,e,n){returnn||(Y(void0!==t&&null!==t,"missing value"),Y(void0!==e&&null!==e,"missing offset"),Y(this.length>e,"Trying to write beyond buffer length"),V(t,127,-128)),e>=this.length?void0:(t>=0?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n),e+1)},r.prototype.writeInt16LE=function(t,e,n){returnx(this,t,e,!0,n)},r.prototype.writeInt16BE=function(t,e,n){returnx(this,t,e,!1,n)},r.prototype.writeInt32LE=function(t,e,n){returnk(this,t,e,!0,n)},r.prototype.writeInt32BE=function(t,e,n){returnk(this,t,e,!1,n)},r.prototype.writeFloatLE=function(t,e,n){returnA(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){returnA(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){returnS(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){returnS(this,t,e,!1,n)},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),Y(n>=e,"end < start"),n!==e&&0!==this.length){Y(e>=0&&this.length>e,"start out of bounds"),Y(n>=0&&this.length>=n,"end out of bounds");varr;if("number"==typeoft)for(r=e;n>r;r++)this[r]=t;else{vari=L(""+t),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}returnthi
}},e.exports=n},{"./nodeBufferReader":19,"./signature":21,"./stringReader":22,"./support":23,"./uint8ArrayReader":24,"./utils":25,"./zipEntry":27}],27:[function(t,e){"use strict";functionn(t,e){this.options=t,this.loadOptions=e}varr=t("./stringReader"),i=t("./utils"),o=t("./compressedObject"),a=t("./object");n.prototype={isEncrypted:function(){return1===(1&this.bitFlag)},useUTF8:function(){return2048===(2048&this.bitFlag)},prepareCompressedContent:function(t,e,n){returnfunction(){varr=t.index;t.setIndex(e);vari=t.readData(n);returnt.setIndex(r),i}},prepareContent:function(t,e,n,r,o){returnfunction(){vart=i.transformTo(r.uncompressInputType,this.getCompressedContent()),e=r.uncompress(t);if(e.length!==o)throwError("Bug : uncompressed data size mismatch");returne}},readLocalPart:function(t){vare,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(n),-1==this.compressedSize||-1==this.uncompressedSize)throwError("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(e=i.findCompression(this.compressionMethod),null===e)throwError("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=newo,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throwError("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readString(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throwError("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){vart=newr(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){vare,n,r,i=t.index;for(this.extraFields=this.extraFields||{};t.index<i+this.extraFieldsLength;)e=t.readInt(2),n=t.readInt(2),r=t.readString(n),this.extraFields[e]={id:e,length:n,value:r}},handleUTF8:function(){if(this.useUTF8())this.fileName=a.utf8decode(this.fileName),this.fileComment=a.utf8decode(this.fileComment);else{vart=this.findExtraFieldUnicodePath();null!==t&&(this.fileName=t)}},findExtraFieldUnicodePath:function(){vart=this.extraFields[28789];if(t){vare=newr(t.value);return1!==e.readInt(1)?null:a.crc32(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readString(t.length-5))}returnnull}},e.exports=n},{"./compressedObject":11,"./object":20,"./stringReader":22,"./utils":25}],28:[function(t,e){"use strict";varn=t("./lib/utils/common").assign,r=t("./lib/deflate"),i=t("./lib/inflate"),o=t("./lib/zlib/constants"),a={};n(a,r,i,o),e.exports=a},{"./lib/deflate":29,"./lib/inflate":30,".
while(Ee&&u>m);if(512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,Ee)breakt}elsen.head&&(n.head.name=null);n.length=0,n.mode=Z;caseZ:if(4096&n.flags){if(0===u)breakt;m=0;doEe=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.comment+=String.fromCharCode(Ee));while(Ee&&u>m);if(512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,Ee)breakt}elsen.head&&(n.head.comment=null);n.mode=Y;caseY:if(512&n.flags){for(;16>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(d!==(65535&n.check)){t.msg="header crc mismatch",n.mode=le;break}d=0,h=0}n.head&&(n.head.hcrc=1&n.flags>>9,n.head.done=!0),t.adler=n.check=0,n.mode=W;break;caseX:for(;32>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}t.adler=n.check=r(d),d=0,h=0,n.mode=H;caseH:if(0===n.havedict)returnt.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,C;t.adler=n.check=1,n.mode=W;caseW:if(e===A||e===S)breakt;caseq:if(n.last){d>>>=7&h,h-=7&h,n.mode=ue;break}for(;3>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}switch(n.last=1&d,d>>>=1,h-=1,3&d){case0:n.mode=K;break;case1:if(c(n),n.mode=ee,e===S){d>>>=2,h-=2;breakt}break;case2:n.mode=Q;break;case3:t.msg="invalid block type",n.mode=le}d>>>=2,h-=2;break;caseK:for(d>>>=7&h,h-=7&h;32>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if((65535&d)!==(65535^d>>>16)){t.msg="invalid stored block lengths",n.mode=le;break}if(n.length=65535&d,d=0,h=0,n.mode=J,e===S)breakt;caseJ:n.mode=G;caseG:if(m=n.length){if(m>u&&(m=u),m>f&&(m=f),0===m)breakt;v.arraySet(o,i,a,m,s),u-=m,a+=m,f-=m,s+=m,n.length-=m;break}n.mode=W;break;caseQ:for(;14>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(n.nlen=(31&d)+257,d>>>=5,h-=5,n.ndist=(31&d)+1,d>>>=5,h-=5,n.ncode=(15&d)+4,d>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=le;break}n.have=0,n.mode=$;case$:for(;n.have<n.ncode;){for(;3>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}n.lens[Oe[n.have++]]=7&d,d>>>=3,h-=3}for(;19>n.have;)n.lens[Oe[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,xe={bits:n.lenbits},Ie=w(E,n.lens,0,19,n.lencode,0,n.work,xe),n.lenbits=xe.bits,Ie){t.msg="invalid code lengths set",n.mode=le;break}n.have=0,n.mode=te;casete:for(;n.have<n.nlen+n.ndist;){for(;Ae=n.lencode[d&(1<<n.lenbits)-1],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=me);){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(16>ye)d>>>=me,h-=me,n.lens[n.have++]=ye;else{if(16===ye){for(ke=me+2;ke>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(d>>>=me,h-=me,0===n.have){t.msg="invalid bit length repeat",n.mode=le;break}Ee=n.lens[n.have-1],m=3+(3&d),d>>>=2,h-=2}elseif(17===ye){for(ke=me+3;ke>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}d>>>=me,h-=me,Ee=0,m=3+(7&d),d>>>=3,h-=3}else{for(ke=me+7;ke>h;){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}d>>>=me,h-=me,Ee=0,m=11+(127&d),d>>>=7,h-=7}if(n.have+m>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=le;break}for(;m--;)n.lens[n.have++]=Ee}}if(n.mode===le)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=le;break}if(n.lenbits=9,xe={bits:n.lenbits},Ie=w(I,n.lens,0,n.nlen,n.lencode,0,n.work,xe),n.lenbits=xe.bits,Ie){t.msg="invalid literal/lengths set",n.mode=le;break}if(n.distbits=6,n.distcode=n.distdyn,xe={bits:n.distbits},Ie=w(x,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,xe),n.distbits=xe.bits,Ie){t.msg="invalid distances set",n.mode=le;break}if(n.mode=ee,e===S)breakt;caseee:n.mode=ne;casene:if(u>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,_(t,g),s=t.next_out,o=t.output,f=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,d=n.hold,h=n.bits,n.mode===W&&(n.back=-1);break}for(n.back=0;Ae=n.lencode[d&(1<<n.lenbits)-1],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=me);){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}if(ve&&0===(240&ve)){for(be=me,_e=ve,we=ye;Ae=n.lencode[we+((d&(1<<be+_e)-1)>>be)],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=be+me);){if(0===u)breakt;u--,d+=i[a++]<<h,h+=8}d>>>=be,h-=be,n.back+=be}if(d>>>=me,h-=me,n.back+=me,n.length=ye,0===ve){n.mode=se;break}if(32&ve){n.back=-1,n.mode=W;break}if(64&ve){t.msg="invalid literal/length code",n.mode=le;break}n.extra=15&ve,n.mode=re;casere:if(n
}}o=arguments[arguments.length-1],z(n,o)&&(r=B(r),r||o(newUe.EINVAL("flags is not valid")),d(e,n,r,a))}functionF(t,e,n,r){pe(t.openFiles).has(n)?(t.releaseDescriptor(n),r(null)):r(newUe.EBADF)}functionM(t,e,n,r,i){z(n,i)&&a(e,n,r,i)}functionU(t,e,n,i,o){o=arguments[arguments.length-1],z(n,o)&&c(e,n,r(o))}functionP(t,e,n,i){z(n,i)&&l(e,n,r(i))}functionV(t,e,n,r){functioni(e,n){if(e)r(e);else{vari=newXe(n,t.name);r(null,i)}}z(n,r)&&m(e,n,i)}functionZ(t,e,n,r){functioni(e,n){if(e)r(e);else{vari=newXe(n,t.name);r(null,i)}}varo=t.openFiles[n];o?v(e,o,i):r(newUe.EBADF)}functionY(t,e,n,i,o){z(n,o)&&z(i,o)&&b(e,n,i,r(o))}functionX(t,e,n,i){z(n,i)&&_(e,n,r(i))}functionH(t,e,n,i,o,a,s,u){functionf(t,e){u(t,e||0,i)}o=void0===o?0:o,a=void0===a?i.length-o:a,u=arguments[arguments.length-1];varc=t.openFiles[n];c?pe(c.flags).contains(Te)?g(e,c,i,o,a,s,r(f)):u(newUe.EBADF("descriptor does not permit reading")):u(newUe.EBADF)}functionW(t,e,r,i,o){if(o=arguments[arguments.length-1],i=L(i,null,"r"),z(r,o)){vara=B(i.flag||"r");a||o(newUe.EINVAL("flags is not valid")),d(e,r,a,function(s,u){if(s)returno(s);varf=newVe(r,u.id,a,0),c=t.allocDescriptor(f);v(e,f,function(r,a){if(r)returno(r);vars=newXe(a,t.name),u=s.size,l=newn(u);l.fill(0),g(e,f,l,0,u,0,function(e){if(e)returno(e);t.releaseDescriptor(c);varn;n="utf8"===i.encoding?Me.decode(l):l,o(null,n)})})})}}functionq(t,e,n,i,o,a,s,u){u=arguments[arguments.length-1],o=void0===o?0:o,a=void0===a?i.length-o:a;varf=t.openFiles[n];f?pe(f.flags).contains(Ce)?a>i.length-o?u(newUe.EIO("intput buffer is too small")):p(e,f,i,o,a,s,r(u)):u(newUe.EBADF("descriptor does not permit writing")):u(newUe.EBADF)}functionK(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=L(i,"utf8","w"),z(n,o)){vara=B(i.flag||"w");a||o(newUe.EINVAL("flags is not valid")),r=r||"","number"==typeofr&&(r=""+r),"string"==typeofr&&"utf8"===i.encoding&&(r=Me.encode(r)),d(e,n,a,function(i,s){if(i)returno(i);varu=newVe(n,s.id,a,0),f=t.allocDescriptor(u);h(e,u,r,0,r.length,function(e){returne?o(e):(t.releaseDescriptor(f),o(null),void0)})})}}functionJ(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=L(i,"utf8","a"),z(n,o)){vara=B(i.flag||"a");a||o(newUe.EINVAL("flags is not valid")),r=r||"","number"==typeofr&&(r=""+r),"string"==typeofr&&"utf8"===i.encoding&&(r=Me.encode(r)),d(e,n,a,function(i,s){if(i)returno(i);varu=newVe(n,s.id,a,s.size),f=t.allocDescriptor(u);p(e,u,r,0,r.length,u.position,function(e){returne?o(e):(t.releaseDescriptor(f),o(null),void0)})})}}functionG(t,e,n,r){functioni(t){r(t?!1:!0)}V(t,e,n,i)}functionQ(t,e,n,i,o){z(n,o)&&C(e,n,i,r(o))}function$(t,e,n,i,o){vara=t.openFiles[n];a?R(e,a,i,r(o)):o(newUe.EBADF)}functionte(t,e,n,i,o,a,s){"function"==typeofa&&(s=a,a=null),z(n,s)&&O(e,n,i,o,a,r(s))}functionee(t,e,n,i,o,a,s){"function"==typeofa&&(s=a,a=null);varu=t.openFiles[n];u?pe(u.flags).contains(Ce)?T(e,u,i,o,a,r(s)):s(newUe.EBADF("descriptor does not permit writing")):s(newUe.EBADF)}functionne(t,e,n,i,o){z(n,o)&&N(e,n,i,r(o))}functionre(t,e,n,i,o){vara=t.openFiles[n];a?pe(a.flags).contains(Ce)?D(e,a,i,r(o)):o(newUe.EBADF("descriptor does not permit writing")):o(newUe.EBADF)}functionie(t,e,n,r,i,o){functiona(t,e){t?o(t):0>e.size+r?o(newUe.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}vars=t.openFiles[n];s||o(newUe.EBADF),"SET"===i?0>r?o(newUe.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(newUe.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?v(e,s,a):o(newUe.EINVAL("whence argument is not a proper value"))}functionoe(t,e,n,i){z(n,i)&&w(e,n,r(i))}functionae(t,e,n,i,o,a){if(z(n,a)){vars=Date.now();i=i?i:s,o=o?o:s,A(e,n,i,o,r(a))}}functionse(t,e,n,i,o,a){vars=Date.now();i=i?i:s,o=o?o:s;varu=t.openFiles[n];u?pe(u.flags).contains(Ce)?S(e,u,i,o,r(a)):a(newUe.EBADF("descriptor does not permit writing")):a(newUe.EBADF)}functionue(t,e,n,i,o){functiona(t){t?o(t):_(e,n,r(o))}z(n,o)