tianta/libs/thirdparty/zip.min.js

1 line
31 KiB
JavaScript
Raw Permalink Normal View History

2022-10-16 21:58:52 +08:00
!function(g){"use strict";var a,y="File format is not recognized.",o="File contains encrypted entry.",l="File is using Zip64 (4gb+ file size).",d="Error while reading zip file.",e="Error while reading file data.",h=524288,f="text/plain";try{a=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(t){}function i(){this.crc=-1}function _(){}function m(t,e){var i,n;return i=new ArrayBuffer(t),n=new Uint8Array(i),e&&n.set(e,0),{buffer:i,array:n,view:new DataView(i)}}function t(){}function n(n){var r,a=this;a.size=0,a.init=function(t,e){var i=new Blob([n],{type:f});(r=new s(i)).init(function(){a.size=r.size,t()},e)},a.readUint8Array=function(t,e,i,n){r.readUint8Array(t,e,i,n)}}function r(s){var _,i=this;i.size=0,i.init=function(t){for(var e=s.length;"="==s.charAt(e-1);)e--;_=s.indexOf(",")+1,i.size=Math.floor(.75*(e-_)),t()},i.readUint8Array=function(t,e,i){var n,r=m(e),a=4*Math.floor(t/3),o=4*Math.ceil((t+e)/3),l=g.atob(s.substring(a+_,o+_)),f=t-3*Math.floor(a/4);for(n=f;n<f+e;n++)r.array[n-f]=l.charCodeAt(n);i(r.array)}}function s(a){var e=this;e.size=0,e.init=function(t){e.size=a.size,t()},e.readUint8Array=function(t,e,i,n){var r=new FileReader;r.onload=function(t){i(new Uint8Array(t.target.result))},r.onerror=n;try{r.readAsArrayBuffer(function(t,e,i){if(e<0||i<0||e+i>t.size)throw new RangeError("offset:"+e+", length:"+i+", size:"+t.size);return t.slice?t.slice(e,e+i):t.webkitSlice?t.webkitSlice(e,e+i):t.mozSlice?t.mozSlice(e,e+i):t.msSlice?t.msSlice(e,e+i):void 0}(a,t,e))}catch(t){n(t)}}}function u(){}function c(n){var r;this.init=function(t){r=new Blob([],{type:f}),t()},this.writeUint8Array=function(t,e){r=new Blob([r,a?t:t.buffer],{type:f}),e()},this.getData=function(e,t){var i=new FileReader;i.onload=function(t){e(t.target.result)},i.onerror=t,i.readAsText(r,n)}}function b(e){var a="",o="";this.init=function(t){a+="data:"+(e||"")+";base64,",t()},this.writeUint8Array=function(t,e){var i,n=o.length,r=o;for(o="",i=0;i<3*Math.floor((n+t.length)/3)-n;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)o+=String.fromCharCode(t[i]);2<r.length?a+=g.btoa(r):o=r,e()},this.getData=function(t){t(a+g.btoa(o))}}function w(i){var n;this.init=function(t){n=new Blob([],{type:i}),t()},this.writeUint8Array=function(t,e){n=new Blob([n,a?t:t.buffer],{type:i}),e()},this.getData=function(t){t(n)}}function k(n,e,r,a,o,t,l,f,s,_){var d,u=0,c=0,b="input"===t,w="output"===t,x=new i;!function i(){var t;if((d=u*h)<o)e.readUint8Array(a+d,Math.min(h,o-d),function(t){var e;try{e=n.append(t,function(t){l&&l(d+t,o)})}catch(t){return void s(t)}e?(c+=e.length,r.writeUint8Array(e,function(){u++,setTimeout(i,1)},_),w&&x.append(e)):(u++,setTimeout(i,1)),b&&x.append(t),l&&l(d,o)},s);else{try{t=n.flush()}catch(t){return void s(t)}t?(w&&x.append(t),c+=t.length,r.writeUint8Array(t,function(){f(c,x.get())},_)):f(c,x.get())}}()}function p(t,e,i,n,r,a,o,l,f,s){k(new _,e,i,n,r,"input",l,o,f,s)}function x(t){var e,i,n="",r=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(e=0;e<t.length;e++)n+=127<(i=255&t.charCodeAt(e))?r[i-128]:String.fromCharCode(i);return n}function U(t){return decodeURIComponent(escape(t))}function A(t){var e,i="";for(e=0;e<t.length;e++)i+=String.fromCharCode(t[e]);return i}function z(t,e,i,n,r){t.version=e.view.getUint16(i,!0),t.bitFlag=e.view.getUint16(i+2,!0),t.compressionMethod=e.view.getUint16(i+4,!0),t.lastModDateRaw=e.view.getUint32(i+6,!0),t.lastModDate=function(t){var e=(4294901760&t)>>16,i=65535&t;try{return new Date(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&i)>>11