js-cfb/dist/cfb.min.js

3 lines
27 KiB
JavaScript
Raw Normal View History

/* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
2018-09-04 07:14:20 +00:00
var Base64=function r(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(e){var t="";var i=0,n=0,f=0,a=0,s=0,h=0,l=0;for(var o=0;o<e.length;){i=e.charCodeAt(o++);a=i>>2;n=e.charCodeAt(o++);s=(i&3)<<4|n>>4;f=e.charCodeAt(o++);h=(n&15)<<2|f>>6;l=f&63;if(isNaN(n)){h=l=64}else if(isNaN(f)){l=64}t+=r.charAt(a)+r.charAt(s)+r.charAt(h)+r.charAt(l)}return t},decode:function e(t){var i="";var n=0,f=0,a=0,s=0,h=0,l=0,o=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var u=0;u<t.length;){s=r.indexOf(t.charAt(u++));h=r.indexOf(t.charAt(u++));n=s<<2|h>>4;i+=String.fromCharCode(n);l=r.indexOf(t.charAt(u++));f=(h&15)<<4|l>>2;if(l!==64){i+=String.fromCharCode(f)}o=r.indexOf(t.charAt(u++));a=(l&3)<<6|o;if(o!==64){i+=String.fromCharCode(a)}}return i}}}();var has_buf=typeof Buffer!=="undefined"&&typeof process!=="undefined"&&typeof process.versions!=="undefined"&&process.versions.node;var Buffer_from=function(){};if(typeof Buffer!=="undefined"){var nbfs=!Buffer.from;if(!nbfs)try{Buffer.from("foo","utf8")}catch(e){nbfs=true}Buffer_from=nbfs?function(r,e){return e?new Buffer(r,e):new Buffer(r)}:Buffer.from.bind(Buffer);if(!Buffer.alloc)Buffer.alloc=function(r){return new Buffer(r)};if(!Buffer.allocUnsafe)Buffer.allocUnsafe=function(r){return new Buffer(r)}}function new_raw_buf(r){return has_buf?Buffer.alloc(r):new Array(r)}function new_unsafe_buf(r){return has_buf?Buffer.allocUnsafe(r):new Array(r)}var s2a=function e(r){if(has_buf)return Buffer_from(r,"binary");return r.split("").map(function(r){return r.charCodeAt(0)&255})};var chr0=/\u0000/g,chr1=/[\u0001-\u0006]/g;var __toBuffer=function(r){var e=[];for(var t=0;t<r[0].length;++t){e.push.apply(e,r[0][t])}return e};var ___toBuffer=__toBuffer;var __utf16le=function(r,e,t){var i=[];for(var n=e;n<t;n+=2)i.push(String.fromCharCode(__readUInt16LE(r,n)));return i.join("").replace(chr0,"")};var ___utf16le=__utf16le;var __hexlify=function(r,e,t){var i=[];for(var n=e;n<e+t;++n)i.push(("0"+r[n].toString(16)).slice(-2));return i.join("")};var ___hexlify=__hexlify;var __bconcat=function(r){if(Array.isArray(r[0]))return[].concat.apply([],r);var e=0,t=0;for(t=0;t<r.length;++t)e+=r[t].length;var i=new Uint8Array(e);for(t=0,e=0;t<r.length;e+=r[t].length,++t)i.set(r[t],e);return i};var bconcat=__bconcat;if(has_buf){__utf16le=function(r,e,t){if(!Buffer.isBuffer(r))return ___utf16le(r,e,t);return r.toString("utf16le",e,t).replace(chr0,"")};__hexlify=function(r,e,t){return Buffer.isBuffer(r)?r.toString("hex",e,e+t):___hexlify(r,e,t)};__toBuffer=function(r){return r[0].length>0&&Buffer.isBuffer(r[0][0])?Buffer.concat(r[0]):___toBuffer(r)};s2a=function(r){return Buffer_from(r,"binary")};bconcat=function(r){return Buffer.isBuffer(r[0])?Buffer.concat(r):__bconcat(r)}}var __readUInt8=function(r,e){return r[e]};var __readUInt16LE=function(r,e){return r[e+1]*(1<<8)+r[e]};var __readInt16LE=function(r,e){var t=r[e+1]*(1<<8)+r[e];return t<32768?t:(65535-t+1)*-1};var __readUInt32LE=function(r,e){return r[e+3]*(1<<24)+(r[e+2]<<16)+(r[e+1]<<8)+r[e]};var __readInt32LE=function(r,e){return(r[e+3]<<24)+(r[e+2]<<16)+(r[e+1]<<8)+r[e]};function ReadShift(r,e){var t,i,n=0;switch(r){case 1:t=__readUInt8(this,this.l);break;case 2:t=(e!=="i"?__readUInt16LE:__readInt16LE)(this,this.l);break;case 4:t=__readInt32LE(this,this.l);break;case 16:n=2;i=__hexlify(this,this.l,r);}this.l+=r;if(n===0)return t;return i}var __writeUInt32LE=function(r,e,t){r[t]=e&255;r[t+1]=e>>>8&255;r[t+2]=e>>>16&255;r[t+3]=e>>>24&255};var __writeInt32LE=function(r,e,t){r[t]=e&255;r[t+1]=e>>8&255;r[t+2]=e>>16&255;r[t+3]=e>>24&255};function WriteShift(r,e,t){var i=0,n=0;switch(t){case"hex":for(;n<r;++n){this[this.l++]=parseInt(e.slice(2*n,2*n+2),16)||0}return this;case"utf16le":var f=this.l+r;for(n=0;n<Math.min(e.length,r);++n){var a=e.charCodeAt(n);this[this.l++]=a&255;this[this.l++]=a>>8}while(this.l<f)this[this.l++]=0;return this;}switch(r){case 1:i=1;this[this.l]=e&255;break;case 2:i=2;this[this.l]=e&255;e>>>=8;this[this.l+1]=e&255;break;case 4:i=4;__writeUInt32LE(this,e,this.l);break;case-4:i=4;__writeInt32LE(this,e,this.