2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-03-28 22:03:03 +00:00
! function ( e ) { if ( "object" == typeof exports && "undefined" != typeof module ) module . exports = e ( ) ; else if ( "function" == typeof define && define . amd ) { JSZip = e ( ) ; define ( [ ] , e ) } else { var f ; "undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof $ && $ . global ? f = $ . global : "undefined" != typeof self && ( f = self ) , f . JSZip = e ( ) } } ( function ( ) { var define , module , exports ; return function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; throw new Error ( "Cannot find module '" + o + "'" ) } var f = n [ o ] = { exports : { } } ; t [ o ] [ 0 ] . call ( f . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ? n : e ) } , f , f . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ( { 1 : [ function ( _dereq _ , module , exports ) { "use strict" ; var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; exports . encode = function ( input , utf8 ) { var output = "" ; var chr1 , chr2 , chr3 , enc1 , enc2 , enc3 , enc4 ; var i = 0 ; while ( i < input . length ) { chr1 = input . charCodeAt ( i ++ ) ; chr2 = input . charCodeAt ( i ++ ) ; chr3 = input . charCodeAt ( i ++ ) ; enc1 = chr1 >> 2 ; enc2 = ( chr1 & 3 ) << 4 | chr2 >> 4 ; enc3 = ( chr2 & 15 ) << 2 | chr3 >> 6 ; enc4 = chr3 & 63 ; if ( isNaN ( chr2 ) ) { enc3 = enc4 = 64 } else if ( isNaN ( chr3 ) ) { enc4 = 64 } output = output + _keyStr . charAt ( enc1 ) + _keyStr . charAt ( enc2 ) + _keyStr . charAt ( enc3 ) + _keyStr . charAt ( enc4 ) } return output } ; exports . decode = function ( input , utf8 ) { var output = "" ; var chr1 , chr2 , chr3 ; var enc1 , enc2 , enc3 , enc4 ; var i = 0 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; while ( i < input . length ) { enc1 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc2 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc3 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc4 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; chr1 = enc1 << 2 | enc2 >> 4 ; chr2 = ( enc2 & 15 ) << 4 | enc3 >> 2 ; chr3 = ( enc3 & 3 ) << 6 | enc4 ; output = output + String . fromCharCode ( chr1 ) ; if ( enc3 != 64 ) { output = output + String . fromCharCode ( chr2 ) } if ( enc4 != 64 ) { output = output + String . fromCharCode ( chr3 ) } } return output } } , { } ] , 2 : [ function ( _dereq _ , module , exports ) { "use strict" ; function CompressedObject ( ) { this . compressedSize = 0 ; this . uncompressedSize = 0 ; this . crc32 = 0 ; this . compressionMethod = null ; this . compressedContent = null } CompressedObject . prototype = { getContent : function ( ) { return null } , getCompressedContent : function ( ) { return null } } ; module . exports = CompressedObject } , { } ] , 3 : [ function ( _dereq _ , module , exports ) { "use strict" ; exports . STORE = { magic : "\0\0" , compress : function ( content ) { return content } , uncompress : function ( content ) { return content } , compressInputType : null , uncompressInputType : null } ; exports . DEFLATE = _dereq _ ( "./flate" ) } , { "./flate" : 8 } ] , 4 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "./utils" ) ; var table = [ 0 , 1996959894 , 3993919788 , 2567524794 , 124634137 , 1886057615 , 3915621685 , 2657392035 , 249268274 , 2044508324 , 3772115230 , 2547177864 , 162941995 , 2125561021 , 3887607047 , 2428444049 , 498536548 , 1789927666 , 4089016648 , 2227061214 , 450548861 , 1843258603 , 4107580753 , 2211677639 , 325883990 , 1684777152 , 4251122042 , 2321926636 , 335633487 , 1661365465 , 4195302755 , 2366115317 , 997073096 , 1281953886 , 3579855332 , 2724688242 , 1006888145 , 1258607687 , 3524101629 , 2768942443 , 901097722 , 1119000684 , 3686517206 , 2898065728 , 853044451 , 1172266101 , 3705015759 , 2882616665 , 651767980 , 1373503546 , 3369554304 , 3218104598 , 565507253 , 1454621731 , 3485111705 , 3099436303 , 671266974 , 1594198024 , 3322730930 , 2970347812 , 795835527 , 1483230225 , 3244367275 , 3060149565 , 1994146192 , 31158534 , 2563907772 , 4023717930 , 1907459465 , 112637215 , 2680153253 , 3904427059 , 2013776290 , 251722036 , 2517215374 , 3775830040 , 2137656763 , 141376813 , 2439277719 , 3865271297 , 1802195444 , 476864866 , 2238001368 , 4066508878 , 1812370925 , 453092731 , 2181625025 , 4111451223 , 1706088902 , 314042704 , 2344532202 , 4240017532 , 1658658271 , 366619977 , 2362670323 , 4224994405 , 1303535960 , 984961486 , 2747007092 , 3569037538 , 1256170817 , 1037604311 , 2765210733 , 3554079995 , 1131014506 , 879679996 , 2909243462 , 3663771856 , 1141124467 , 855842277 , 2852801631 , 3708648649 , 1342533948 , 654459306 , 3188396048 , 3373015174 , 1466479909 , 544179635 , 3110523913 , 3462522015 , 1591671054 , 702138776 , 2966460450 , 3352799412 , 1504918807 , 783551873 , 3082640443 , 3233442989 , 3988292384 , 2596254646 , 62317068 , 1957810842 , 3939845945 , 2647816111 , 81470997 , 1943803523 , 3814918930 , 2489596804 , 2
} return res } ; exports . findCompression = function ( compressionMethod ) { for ( var method in compressions ) { if ( ! compressions . hasOwnProperty ( method ) ) { continue } if ( compressions [ method ] . magic === compressionMethod ) { return compressions [ method ] } } return null } ; exports . isRegExp = function ( object ) { return Object . prototype . toString . call ( object ) === "[object RegExp]" } } , { "./compressions" : 3 , "./nodeBuffer" : 11 , "./support" : 17 } ] , 22 : [ function ( _dereq _ , module , exports ) { "use strict" ; var StringReader = _dereq _ ( "./stringReader" ) ; var NodeBufferReader = _dereq _ ( "./nodeBufferReader" ) ; var Uint8ArrayReader = _dereq _ ( "./uint8ArrayReader" ) ; var utils = _dereq _ ( "./utils" ) ; var sig = _dereq _ ( "./signature" ) ; var ZipEntry = _dereq _ ( "./zipEntry" ) ; var support = _dereq _ ( "./support" ) ; var jszipProto = _dereq _ ( "./object" ) ; function ZipEntries ( data , loadOptions ) { this . files = [ ] ; this . loadOptions = loadOptions ; if ( data ) { this . load ( data ) } } ZipEntries . prototype = { checkSignature : function ( expectedSignature ) { var signature = this . reader . readString ( 4 ) ; if ( signature !== expectedSignature ) { throw new Error ( "Corrupted zip or bug : unexpected signature " + "(" + utils . pretty ( signature ) + ", expected " + utils . pretty ( expectedSignature ) + ")" ) } } , readBlockEndOfCentral : function ( ) { this . diskNumber = this . reader . readInt ( 2 ) ; this . diskWithCentralDirStart = this . reader . readInt ( 2 ) ; this . centralDirRecordsOnThisDisk = this . reader . readInt ( 2 ) ; this . centralDirRecords = this . reader . readInt ( 2 ) ; this . centralDirSize = this . reader . readInt ( 4 ) ; this . centralDirOffset = this . reader . readInt ( 4 ) ; this . zipCommentLength = this . reader . readInt ( 2 ) ; this . zipComment = this . reader . readString ( this . zipCommentLength ) ; this . zipComment = jszipProto . utf8decode ( this . zipComment ) } , readBlockZip64EndOfCentral : function ( ) { this . zip64EndOfCentralSize = this . reader . readInt ( 8 ) ; this . versionMadeBy = this . reader . readString ( 2 ) ; this . versionNeeded = this . reader . readInt ( 2 ) ; this . diskNumber = this . reader . readInt ( 4 ) ; this . diskWithCentralDirStart = this . reader . readInt ( 4 ) ; this . centralDirRecordsOnThisDisk = this . reader . readInt ( 8 ) ; this . centralDirRecords = this . reader . readInt ( 8 ) ; this . centralDirSize = this . reader . readInt ( 8 ) ; this . centralDirOffset = this . reader . readInt ( 8 ) ; this . zip64ExtensibleData = { } ; var extraDataSize = this . zip64EndOfCentralSize - 44 , index = 0 , extraFieldId , extraFieldLength , extraFieldValue ; while ( index < extraDataSize ) { extraFieldId = this . reader . readInt ( 2 ) ; extraFieldLength = this . reader . readInt ( 4 ) ; extraFieldValue = this . reader . readString ( extraFieldLength ) ; this . zip64ExtensibleData [ extraFieldId ] = { id : extraFieldId , length : extraFieldLength , value : extraFieldValue } } } , readBlockZip64EndOfCentralLocator : function ( ) { this . diskWithZip64CentralDirStart = this . reader . readInt ( 4 ) ; this . relativeOffsetEndOfZip64CentralDir = this . reader . readInt ( 8 ) ; this . disksCount = this . reader . readInt ( 4 ) ; if ( this . disksCount > 1 ) { throw new Error ( "Multi-volumes zip are not supported" ) } } , readLocalFiles : function ( ) { var i , file ; for ( i = 0 ; i < this . files . length ; i ++ ) { file = this . files [ i ] ; this . reader . setIndex ( file . localHeaderOffset ) ; this . checkSignature ( sig . LOCAL _FILE _HEADER ) ; file . readLocalPart ( this . reader ) ; file . handleUTF8 ( ) } } , readCentralDir : function ( ) { var file ; this . reader . setIndex ( this . centralDirOffset ) ; while ( this . reader . readString ( 4 ) === sig . CENTRAL _FILE _HEADER ) { file = new ZipEntry ( { zip64 : this . zip64 } , this . loadOptions ) ; file . readCentralPart ( this . reader ) ; this . files . push ( file ) } } , readEndOfCentral : function ( ) { var offset = this . reader . lastIndexOfSignature ( sig . CENTRAL _DIRECTORY _END ) ; if ( offset === - 1 ) { throw new Error ( "Corrupted zip : can't find end of central directory" ) } this . reader . setIndex ( offset ) ; this . checkSignature ( sig . CENTRAL _DIRECTORY _END ) ; this . readBlockEndOfCentral ( ) ; if ( this . diskNumber === utils . MAX _VALUE _16BITS || this . diskWithCentralDirStart === utils . MAX _VALUE _16BITS || this . centralDirRecordsOnThisDisk === utils . MAX _VALUE _16BITS || this . centralDirRecords === utils . MAX _VALUE _16BITS || this . centralDirSize === utils . MAX _VALUE _32BITS || this . centralDirOffset === utils . MAX _VALUE _32BITS ) { this . zip64 = true ; offset = this . reader . lastIndexOfSignature ( sig . ZIP64 _CENTRAL _DIRECTORY _LOCATOR ) ; if ( offset === - 1 ) { throw new Error ( "Corrupted zip : can't find the ZIP64 end of central directory locator" ) } this . reader . setIndex ( offset ) ; this . checkSignature ( sig . ZIP64 _CENTRAL _D
var bflush ; for ( ; ; ) { if ( s . lookahead === 0 ) { fill _window ( s ) ; if ( s . lookahead === 0 ) { if ( flush === Z _NO _FLUSH ) { return BS _NEED _MORE } break } } s . match _length = 0 ; bflush = trees . _tr _tally ( s , 0 , s . window [ s . strstart ] ) ; s . lookahead -- ; s . strstart ++ ; if ( bflush ) { flush _block _only ( s , false ) ; if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } } s . insert = 0 ; if ( flush === Z _FINISH ) { flush _block _only ( s , true ) ; if ( s . strm . avail _out === 0 ) { return BS _FINISH _STARTED } return BS _FINISH _DONE } if ( s . last _lit ) { flush _block _only ( s , false ) ; if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } return BS _BLOCK _DONE } var Config = function ( good _length , max _lazy , nice _length , max _chain , func ) { this . good _length = good _length ; this . max _lazy = max _lazy ; this . nice _length = nice _length ; this . max _chain = max _chain ; this . func = func } ; var configuration _table ; configuration _table = [ new Config ( 0 , 0 , 0 , 0 , deflate _stored ) , new Config ( 4 , 4 , 8 , 4 , deflate _fast ) , new Config ( 4 , 5 , 16 , 8 , deflate _fast ) , new Config ( 4 , 6 , 32 , 32 , deflate _fast ) , new Config ( 4 , 4 , 16 , 16 , deflate _slow ) , new Config ( 8 , 16 , 32 , 32 , deflate _slow ) , new Config ( 8 , 16 , 128 , 128 , deflate _slow ) , new Config ( 8 , 32 , 128 , 256 , deflate _slow ) , new Config ( 32 , 128 , 258 , 1024 , deflate _slow ) , new Config ( 32 , 258 , 258 , 4096 , deflate _slow ) ] ; function lm _init ( s ) { s . window _size = 2 * s . w _size ; zero ( s . head ) ; s . max _lazy _match = configuration _table [ s . level ] . max _lazy ; s . good _match = configuration _table [ s . level ] . good _length ; s . nice _match = configuration _table [ s . level ] . nice _length ; s . max _chain _length = configuration _table [ s . level ] . max _chain ; s . strstart = 0 ; s . block _start = 0 ; s . lookahead = 0 ; s . insert = 0 ; s . match _length = s . prev _length = MIN _MATCH - 1 ; s . match _available = 0 ; s . ins _h = 0 } function DeflateState ( ) { this . strm = null ; this . status = 0 ; this . pending _buf = null ; this . pending _buf _size = 0 ; this . pending _out = 0 ; this . pending = 0 ; this . wrap = 0 ; this . gzhead = null ; this . gzindex = 0 ; this . method = Z _DEFLATED ; this . last _flush = - 1 ; this . w _size = 0 ; this . w _bits = 0 ; this . w _mask = 0 ; this . window = null ; this . window _size = 0 ; this . prev = null ; this . head = null ; this . ins _h = 0 ; this . hash _size = 0 ; this . hash _bits = 0 ; this . hash _mask = 0 ; this . hash _shift = 0 ; this . block _start = 0 ; this . match _length = 0 ; this . prev _match = 0 ; this . match _available = 0 ; this . strstart = 0 ; this . match _start = 0 ; this . lookahead = 0 ; this . prev _length = 0 ; this . max _chain _length = 0 ; this . max _lazy _match = 0 ; this . level = 0 ; this . strategy = 0 ; this . good _match = 0 ; this . nice _match = 0 ; this . dyn _ltree = new utils . Buf16 ( HEAP _SIZE * 2 ) ; this . dyn _dtree = new utils . Buf16 ( ( 2 * D _CODES + 1 ) * 2 ) ; this . bl _tree = new utils . Buf16 ( ( 2 * BL _CODES + 1 ) * 2 ) ; zero ( this . dyn _ltree ) ; zero ( this . dyn _dtree ) ; zero ( this . bl _tree ) ; this . l _desc = null ; this . d _desc = null ; this . bl _desc = null ; this . bl _count = new utils . Buf16 ( MAX _BITS + 1 ) ; this . heap = new utils . Buf16 ( 2 * L _CODES + 1 ) ; zero ( this . heap ) ; this . heap _len = 0 ; this . heap _max = 0 ; this . depth = new utils . Buf16 ( 2 * L _CODES + 1 ) ; zero ( this . depth ) ; this . l _buf = 0 ; this . lit _bufsize = 0 ; this . last _lit = 0 ; this . d _buf = 0 ; this . opt _len = 0 ; this . static _len = 0 ; this . matches = 0 ; this . insert = 0 ; this . bi _buf = 0 ; this . bi _valid = 0 } function deflateResetKeep ( strm ) { var s ; if ( ! strm || ! strm . state ) { return err ( strm , Z _STREAM _ERROR ) } strm . total _in = strm . total _out = 0 ; strm . data _type = Z _UNKNOWN ; s = strm . state ; s . pending = 0 ; s . pending _out = 0 ; if ( s . wrap < 0 ) { s . wrap = - s . wrap } s . status = s . wrap ? INIT _STATE : BUSY _STATE ; strm . adler = s . wrap === 2 ? 0 : 1 ; s . last _flush = Z _NO _FLUSH ; trees . _tr _init ( s ) ; return Z _OK } function deflateReset ( strm ) { var ret = deflateResetKeep ( strm ) ; if ( ret === Z _OK ) { lm _init ( strm . state ) } return ret } function deflateSetHeader ( strm , head ) { if ( ! strm || ! strm . state ) { return Z _STREAM _ERROR } if ( strm . state . wrap !== 2 ) { return Z _STREAM _ERROR } strm . state . gzhead = head ; return Z _OK } function deflateInit2 ( strm , level , method , windowBits , memLevel , strategy ) { if ( ! strm ) { return Z _STREAM _ERROR } var wrap = 1 ; if ( level === Z _DEFAULT _COMPRESSION ) { level = 6 } if ( windowBits < 0 ) { wrap = 0 ; windowBits = - windowBits } else if ( windowBits > 15 ) { wrap = 2 ; windowBits -= 16 } if ( memLevel < 1 || memLevel > MAX _MEM _LEVEL || method !== Z _DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z _FIXED ) { return err ( strm , Z _STREAM _ERROR ) } if ( windowBits === 8 ) { windowBits = 9 } var s = new DeflateState ; strm . state = s ; s . strm = strm ; s . wrap = wrap ; s . gzhead = null ; s . w _bits = windowBits ; s . w _size = 1 << s . w _bits ; s . w _mask = s . w _size - 1 ; s . hash _bits = memLevel + 7 ; s . hash _size = 1 << s . hash _bits ; s . hash _mask = s . hash _size - 1 ; s . hash _shift = ~ ~ ( ( s . hash _b
2017-04-16 07:31:21 +00:00
exports . inflateInfo = "pako inflate (from Nodeca project)" } , { "../utils/common" : 27 , "./adler32" : 29 , "./crc32" : 31 , "./inffast" : 34 , "./inftrees" : 36 } ] , 36 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "../utils/common" ) ; var MAXBITS = 15 ; var ENOUGH _LENS = 852 ; var ENOUGH _DISTS = 592 ; var CODES = 0 ; var LENS = 1 ; var DISTS = 2 ; var lbase = [ 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 13 , 15 , 17 , 19 , 23 , 27 , 31 , 35 , 43 , 51 , 59 , 67 , 83 , 99 , 115 , 131 , 163 , 195 , 227 , 258 , 0 , 0 ] ; var lext = [ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 17 , 17 , 17 , 17 , 18 , 18 , 18 , 18 , 19 , 19 , 19 , 19 , 20 , 20 , 20 , 20 , 21 , 21 , 21 , 21 , 16 , 72 , 78 ] ; var dbase = [ 1 , 2 , 3 , 4 , 5 , 7 , 9 , 13 , 17 , 25 , 33 , 49 , 65 , 97 , 129 , 193 , 257 , 385 , 513 , 769 , 1025 , 1537 , 2049 , 3073 , 4097 , 6145 , 8193 , 12289 , 16385 , 24577 , 0 , 0 ] ; var dext = [ 16 , 16 , 16 , 16 , 17 , 17 , 18 , 18 , 19 , 19 , 20 , 20 , 21 , 21 , 22 , 22 , 23 , 23 , 24 , 24 , 25 , 25 , 26 , 26 , 27 , 27 , 28 , 28 , 29 , 29 , 64 , 64 ] ; module . exports = function inflate _table ( type , lens , lens _index , codes , table , table _index , work , opts ) { var bits = opts . bits ; var len = 0 ; var sym = 0 ; var min = 0 , max = 0 ; var root = 0 ; var curr = 0 ; var drop = 0 ; var left = 0 ; var used = 0 ; var huff = 0 ; var incr ; var fill ; var low ; var mask ; var next ; var base = null ; var base _index = 0 ; var end ; var count = new utils . Buf16 ( MAXBITS + 1 ) ; var offs = new utils . Buf16 ( MAXBITS + 1 ) ; var extra = null ; var extra _index = 0 ; var here _bits , here _op , here _val ; for ( len = 0 ; len <= MAXBITS ; len ++ ) { count [ len ] = 0 } for ( sym = 0 ; sym < codes ; sym ++ ) { count [ lens [ lens _index + sym ] ] ++ } root = bits ; for ( max = MAXBITS ; max >= 1 ; max -- ) { if ( count [ max ] !== 0 ) { break } } if ( root > max ) { root = max } if ( max === 0 ) { table [ table _index ++ ] = 1 << 24 | 64 << 16 | 0 ; table [ table _index ++ ] = 1 << 24 | 64 << 16 | 0 ; opts . bits = 1 ; return 0 } for ( min = 1 ; min < max ; min ++ ) { if ( count [ min ] !== 0 ) { break } } if ( root < min ) { root = min } left = 1 ; for ( len = 1 ; len <= MAXBITS ; len ++ ) { left <<= 1 ; left -= count [ len ] ; if ( left < 0 ) { return - 1 } } if ( left > 0 && ( type === CODES || max !== 1 ) ) { return - 1 } offs [ 1 ] = 0 ; for ( len = 1 ; len < MAXBITS ; len ++ ) { offs [ len + 1 ] = offs [ len ] + count [ len ] } for ( sym = 0 ; sym < codes ; sym ++ ) { if ( lens [ lens _index + sym ] !== 0 ) { work [ offs [ lens [ lens _index + sym ] ] ++ ] = sym } } if ( type === CODES ) { base = extra = work ; end = 19 } else if ( type === LENS ) { base = lbase ; base _index -= 257 ; extra = lext ; extra _index -= 257 ; end = 256 } else { base = dbase ; extra = dext ; end = - 1 } huff = 0 ; sym = 0 ; len = min ; next = table _index ; curr = root ; drop = 0 ; low = - 1 ; used = 1 << root ; mask = used - 1 ; if ( type === LENS && used > ENOUGH _LENS || type === DISTS && used > ENOUGH _DISTS ) { return 1 } var i = 0 ; for ( ; ; ) { i ++ ; here _bits = len - drop ; if ( work [ sym ] < end ) { here _op = 0 ; here _val = work [ sym ] } else if ( work [ sym ] > end ) { here _op = extra [ extra _index + work [ sym ] ] ; here _val = base [ base _index + work [ sym ] ] } else { here _op = 32 + 64 ; here _val = 0 } incr = 1 << len - drop ; fill = 1 << curr ; min = fill ; do { fill -= incr ; table [ next + ( huff >> drop ) + fill ] = here _bits << 24 | here _op << 16 | here _val | 0 } while ( fill !== 0 ) ; incr = 1 << len - 1 ; while ( huff & incr ) { incr >>= 1 } if ( incr !== 0 ) { huff &= incr - 1 ; huff += incr } else { huff = 0 } sym ++ ; if ( -- count [ len ] === 0 ) { if ( len === max ) { break } len = lens [ lens _index + work [ sym ] ] } if ( len > root && ( huff & mask ) !== low ) { if ( drop === 0 ) { drop = root } next += min ; curr = len - drop ; left = 1 << curr ; while ( curr + drop < max ) { left -= count [ curr + drop ] ; if ( left <= 0 ) { break } curr ++ ; left <<= 1 } used += 1 << curr ; if ( type === LENS && used > ENOUGH _LENS || type === DISTS && used > ENOUGH _DISTS ) { return 1 } low = huff & mask ; table [ low ] = root << 24 | curr << 16 | next - table _index | 0 } } if ( huff !== 0 ) { table [ next + huff ] = len - drop << 24 | 64 << 16 | 0 } opts . bits = root ; return 0 } } , { "../utils/common" : 27 } ] , 37 : [ function ( _dereq _ , module , exports ) { "use strict" ; module . exports = { 2 : "need dictionary" , 1 : "stream end" , 0 : "" , "-1" : "file error" , "-2" : "stream error" , "-3" : "data error" , "-4" : "insufficient memory" , "-5" : "buffer error" , "-6" : "incompatible version" } } , { } ] , 38 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "../utils/common" ) ; var Z _FIXED = 4 ; var Z _BINARY = 0 ; var Z _TEXT = 1 ; var Z _UNKNOWN = 2 ; function zero ( buf ) { var len = buf . length ; while ( -- len >= 0 ) { buf [ len ] = 0 } } var STORED _BLOCK = 0 ; var STATIC _TREES = 1 ; var DYN _TREES = 2 ; var MIN _MATCH = 3 ; var MAX _MATCH = 258 ; var LENGTH _CODES = 29 ; var LITERALS = 256 ; var L _CODES = LITERALS + 1 + LENGTH _CODES ; var D _CODES = 30 ; var BL _CODES = 19 ; var HEAP _SIZE = 2 * L _CODES + 1 ; var MAX _BITS = 15 ; var Buf _size = 16 ; var MAX _BL _BITS = 7 ; var END _BLOCK = 256 ; var REP _3 _6 = 16 ; var REPZ _3 _10 = 17 ; var REPZ _11 _138 = 18 ; var extra _lbits = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 0 ] ; var extra _dbits = [ 0 , 0 , 0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 13 , 13 ] ; var extra _blbits = [ 0 , 0 , 0
} if ( r = fmt . match ( frac1 ) ) return write _num _f2 ( r , aval , sign ) ; if ( fmt . match ( /^#+0+$/ ) ) return sign + pad0 ( aval , fmt . length - fmt . indexOf ( "0" ) ) ; if ( r = fmt . match ( dec1 ) ) { o = ( "" + val ) . replace ( /^([^\.]+)$/ , "$1." + r [ 1 ] ) . replace ( /\.$/ , "." + r [ 1 ] ) ; o = o . replace ( /\.(\d*)$/ , function ( $$ , $1 ) { return "." + $1 + fill ( "0" , r [ 1 ] . length - $1 . length ) } ) ; return fmt . indexOf ( "0." ) !== - 1 ? o : o . replace ( /^0\./ , "." ) } fmt = fmt . replace ( /^#+([0.])/ , "$1" ) ; if ( r = fmt . match ( /^(0*)\.(#*)$/ ) ) { return sign + ( "" + aval ) . replace ( /\.(\d*[1-9])0*$/ , ".$1" ) . replace ( /^(-?\d*)$/ , "$1." ) . replace ( /^0\./ , r [ 1 ] . length ? "0." : "." ) } if ( r = fmt . match ( /^#,##0(\.?)$/ ) ) return sign + commaify ( "" + aval ) ; if ( r = fmt . match ( /^#,##0\.([#0]*0)$/ ) ) { return val < 0 ? "-" + write _num _int ( type , fmt , - val ) : commaify ( "" + val ) + "." + fill ( "0" , r [ 1 ] . length ) } if ( r = fmt . match ( /^#,#*,#0/ ) ) return write _num _int ( type , fmt . replace ( /^#,#*,/ , "" ) , val ) ; if ( r = fmt . match ( /^([0#]+)(\\?-([0#]+))+$/ ) ) { o = _strrev ( write _num _int ( type , fmt . replace ( /[\\-]/g , "" ) , val ) ) ; ri = 0 ; return _strrev ( _strrev ( fmt . replace ( /\\/g , "" ) ) . replace ( /[0#]/g , function ( x ) { return ri < o . length ? o . charAt ( ri ++ ) : x === "0" ? "0" : "" } ) ) } if ( fmt . match ( phone ) ) { o = write _num _int ( type , "##########" , val ) ; return "(" + o . substr ( 0 , 3 ) + ") " + o . substr ( 3 , 3 ) + "-" + o . substr ( 6 ) } var oa = "" ; if ( r = fmt . match ( /^([#0?]+)( ?)\/( ?)([#0?]+)/ ) ) { ri = Math . min ( r [ 4 ] . length , 7 ) ; ff = frac ( aval , Math . pow ( 10 , ri ) - 1 , false ) ; o = "" + sign ; oa = write _num ( "n" , r [ 1 ] , ff [ 1 ] ) ; if ( oa . charAt ( oa . length - 1 ) == " " ) oa = oa . substr ( 0 , oa . length - 1 ) + "0" ; o += oa + r [ 2 ] + "/" + r [ 3 ] ; oa = rpad _ ( ff [ 2 ] , ri ) ; if ( oa . length < r [ 4 ] . length ) oa = hashq ( r [ 4 ] . substr ( r [ 4 ] . length - oa . length ) ) + oa ; o += oa ; return o } if ( r = fmt . match ( /^# ([#0?]+)( ?)\/( ?)([#0?]+)/ ) ) { ri = Math . min ( Math . max ( r [ 1 ] . length , r [ 4 ] . length ) , 7 ) ; ff = frac ( aval , Math . pow ( 10 , ri ) - 1 , true ) ; return sign + ( ff [ 0 ] || ( ff [ 1 ] ? "" : "0" ) ) + " " + ( ff [ 1 ] ? pad _ ( ff [ 1 ] , ri ) + r [ 2 ] + "/" + r [ 3 ] + rpad _ ( ff [ 2 ] , ri ) : fill ( " " , 2 * ri + 1 + r [ 2 ] . length + r [ 3 ] . length ) ) } if ( r = fmt . match ( /^[#0?]+$/ ) ) { o = "" + val ; if ( fmt . length <= o . length ) return o ; return hashq ( fmt . substr ( 0 , fmt . length - o . length ) ) + o } if ( r = fmt . match ( /^([#0]+)\.([#0]+)$/ ) ) { o = "" + val . toFixed ( Math . min ( r [ 2 ] . length , 10 ) ) . replace ( /([^0])0+$/ , "$1" ) ; ri = o . indexOf ( "." ) ; var lres = fmt . indexOf ( "." ) - ri , rres = fmt . length - o . length - lres ; return hashq ( fmt . substr ( 0 , lres ) + o + fmt . substr ( fmt . length - rres ) ) } if ( r = fmt . match ( /^00,000\.([#0]*0)$/ ) ) { return val < 0 ? "-" + write _num _int ( type , fmt , - val ) : commaify ( "" + val ) . replace ( /^\d,\d{3}$/ , "0$&" ) . replace ( /^\d*$/ , function ( $$ ) { return "00," + ( $$ . length < 3 ? pad0 ( 0 , 3 - $$ . length ) : "" ) + $$ } ) + "." + pad0 ( 0 , r [ 1 ] . length ) } switch ( fmt ) { case "#,###" : var x = commaify ( "" + aval ) ; return x !== "0" ? sign + x : "" ; default : } throw new Error ( "unsupported format |" + fmt + "|" ) } return function write _num ( type , fmt , val ) { return ( val | 0 ) === val ? write _num _int ( type , fmt , val ) : write _num _flt ( type , fmt , val ) } } ( ) ; function split _fmt ( fmt ) { var out = [ ] ; var in _str = false , cc ; for ( var i = 0 , j = 0 ; i < fmt . length ; ++ i ) switch ( cc = fmt . charCodeAt ( i ) ) { case 34 : in _str = ! in _str ; break ; case 95 : case 42 : case 92 : ++ i ; break ; case 59 : out [ out . length ] = fmt . substr ( j , i - j ) ; j = i + 1 } out [ out . length ] = fmt . substr ( j ) ; if ( in _str === true ) throw new Error ( "Format |" + fmt + "| unterminated string " ) ; return out } SSF . _split = split _fmt ; var abstime = /\[[HhMmSs]*\]/ ; function fmt _is _date ( fmt ) { var i = 0 , cc = 0 , c = "" , o = "" ; while ( i < fmt . length ) { switch ( c = fmt . charAt ( i ) ) { case "G" : if ( isgeneral ( fmt , i ) ) i += 6 ; i ++ ; break ; case '"' : for ( ; ( cc = fmt . charCodeAt ( ++ i ) ) !== 34 && i < fmt . length ; ) ++ i ; ++ i ; break ; case "\\" : i += 2 ; break ; case "_" : i += 2 ; break ; case "@" : ++ i ; break ; case "B" : case "b" : if ( fmt . charAt ( i + 1 ) === "1" || fmt . charAt ( i + 1 ) === "2" ) return true ; case "M" : case "D" : case "Y" : case "H" : case "S" : case "E" : case "m" : case "d" : case "y" : case "h" : case "s" : case "e" : case "g" : return true ; case "A" : if ( fmt . substr ( i , 3 ) === "A/P" ) return true ; if ( fmt . substr ( i , 5 ) === "AM/PM" ) return true ; ++ i ; break ; case "[" : o = c ; while ( fmt . charAt ( i ++ ) !== "]" && i < fmt . length ) o += fmt . charAt ( i ) ; if ( o . match ( abstime ) ) return true ; break ; case "." : case "0" : case "#" : while ( i < fmt . length && ( "0#?.,E+-%" . indexOf ( c = fmt . charAt ( ++ i ) ) > - 1 || c == "\\" && fmt . charAt ( i + 1 ) == "-" && "0#" . indexOf ( fmt . charAt ( i + 2 ) ) > - 1 ) ) ; break ; case "?" : while ( fmt . charAt ( ++ i ) === c ) ; break ; case "*" : ++ i ; if ( fmt . charAt ( i ) == " " || fmt . charAt ( i ) == "*" ) ++ i ; break ; case "(" : case ")" : ++ i ; break ; case "1" : case "2" : case "3" : case "4" : case "5" : case "6" : case "7" : case "8" : case "9" : while ( i < fmt . length && "0123456789" . in
_ _utf16le = _ _ _utf16le = function utf16le _ ( b , s , e ) { var ss = [ ] ; for ( var i = s ; i < e ; i += 2 ) ss . push ( String . fromCharCode ( _ _readUInt16LE ( b , i ) ) ) ; return ss . join ( "" ) } ; var _ _hexlify , _ _ _hexlify ; _ _hexlify = _ _ _hexlify = function hexlify _ ( b , s , l ) { return b . slice ( s , s + l ) . map ( function ( x ) { return ( x < 16 ? "0" : "" ) + x . toString ( 16 ) } ) . join ( "" ) } ; var _ _utf8 , _ _ _utf8 ; _ _utf8 = _ _ _utf8 = function ( b , s , e ) { var ss = [ ] ; for ( var i = s ; i < e ; i ++ ) ss . push ( String . fromCharCode ( _ _readUInt8 ( b , i ) ) ) ; return ss . join ( "" ) } ; var _ _lpstr , _ _ _lpstr ; _ _lpstr = _ _ _lpstr = function lpstr _ ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len - 1 ) : "" } ; var _ _lpwstr , _ _ _lpwstr ; _ _lpwstr = _ _ _lpwstr = function lpwstr _ ( b , i ) { var len = 2 * _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len - 1 ) : "" } ; var _ _lpp4 , _ _ _lpp4 ; _ _lpp4 = _ _ _lpp4 = function lpp4 _ ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf16le ( b , i + 4 , i + 4 + len ) : "" } ; var _ _8lpp4 , _ _ _8lpp4 ; _ _8lpp4 = _ _ _8lpp4 = function lpp4 _8 ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len ) : "" } ; var _ _double , _ _ _double ; _ _double = _ _ _double = function ( b , idx ) { return read _double _le ( b , idx ) } ; var is _buf = function is _buf _a ( a ) { return Array . isArray ( a ) } ; if ( has _buf ) { _ _utf16le = function utf16le _b ( b , s , e ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _utf16le ( b , s , e ) ; return b . toString ( "utf16le" , s , e ) } ; _ _hexlify = function ( b , s , l ) { return Buffer . isBuffer ( b ) ? b . toString ( "hex" , s , s + l ) : _ _ _hexlify ( b , s , l ) } ; _ _lpstr = function lpstr _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpstr ( b , i ) ; var len = b . readUInt32LE ( i ) ; return len > 0 ? b . toString ( "utf8" , i + 4 , i + 4 + len - 1 ) : "" } ; _ _lpwstr = function lpwstr _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpwstr ( b , i ) ; var len = 2 * b . readUInt32LE ( i ) ; return b . toString ( "utf16le" , i + 4 , i + 4 + len - 1 ) } ; _ _lpp4 = function lpp4 _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpp4 ( b , i ) ; var len = b . readUInt32LE ( i ) ; return b . toString ( "utf16le" , i + 4 , i + 4 + len ) } ; _ _8lpp4 = function lpp4 _8b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _8lpp4 ( b , i ) ; var len = b . readUInt32LE ( i ) ; return b . toString ( "utf8" , i + 4 , i + 4 + len ) } ; _ _utf8 = function utf8 _b ( b , s , e ) { return b . toString ( "utf8" , s , e ) } ; _ _toBuffer = function ( bufs ) { return bufs [ 0 ] . length > 0 && Buffer . isBuffer ( bufs [ 0 ] [ 0 ] ) ? Buffer . concat ( bufs [ 0 ] ) : _ _ _toBuffer ( bufs ) } ; bconcat = function ( bufs ) { return Buffer . isBuffer ( bufs [ 0 ] ) ? Buffer . concat ( bufs ) : [ ] . concat . apply ( [ ] , bufs ) } ; _ _double = function double _ ( b , i ) { if ( Buffer . isBuffer ( b ) ) return b . readDoubleLE ( i ) ; return _ _ _double ( b , i ) } ; is _buf = function is _buf _b ( a ) { return Buffer . isBuffer ( a ) || Array . isArray ( a ) } } if ( typeof cptable !== "undefined" ) { _ _utf16le = function ( b , s , e ) { return cptable . utils . decode ( 1200 , b . slice ( s , e ) ) } ; _ _utf8 = function ( b , s , e ) { return cptable . utils . decode ( 65001 , b . slice ( s , e ) ) } ; _ _lpstr = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( current _codepage , b . slice ( i + 4 , i + 4 + len - 1 ) ) : "" } ; _ _lpwstr = function ( b , i ) { var len = 2 * _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 1200 , b . slice ( i + 4 , i + 4 + len - 1 ) ) : "" } ; _ _lpp4 = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 1200 , b . slice ( i + 4 , i + 4 + len ) ) : "" } ; _ _8lpp4 = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 65001 , b . slice ( i + 4 , i + 4 + len ) ) : "" } } var _ _readUInt8 = function ( b , idx ) { return b [ idx ] } ; var _ _readUInt16LE = function ( b , idx ) { return b [ idx + 1 ] * ( 1 << 8 ) + b [ idx ] } ; var _ _readInt16LE = function ( b , idx ) { var u = b [ idx + 1 ] * ( 1 << 8 ) + b [ idx ] ; return u < 32768 ? u : ( 65535 - u + 1 ) * - 1 } ; var _ _readUInt32LE = function ( b , idx ) { return b [ idx + 3 ] * ( 1 << 24 ) + ( b [ idx + 2 ] << 16 ) + ( b [ idx + 1 ] << 8 ) + b [ idx ] } ; var _ _readInt32LE = function ( b , idx ) { return b [ idx + 3 ] << 24 | b [ idx + 2 ] << 16 | b [ idx + 1 ] << 8 | b [ idx ] } ; var _ _ _unhexlify = function ( s ) { return s . match ( /../g ) . map ( function ( x ) { return parseInt ( x , 16 ) } ) } ; var _ _unhexlify = typeof Buffer !== "undefined" ? function ( s ) { return Buffer . isBuffer ( s ) ? new Buffer ( s , "hex" ) : _ _ _unhexlify ( s ) } : _ _ _unhexlify ; function ReadShift ( size , t ) { var o = "" , oI , oR , oo = [ ] , w , vv , i , loc ; switch ( t ) { case "dbcs" : loc = this . l ; if ( has _buf && Buffer . isBuffer ( this ) ) o = this . slice ( this . l , this . l + 2 * size ) . toString ( "utf16le" ) ; else for ( i = 0 ; i != size ; ++ i ) { o += String . fromCharCode ( _ _readUInt16LE ( this , loc ) ) ; loc += 2 } size *= 2 ; break ; case "utf8" : o = _ _utf8 ( this , this . l , this . l + size ) ; break ; case "utf16le" : size *= 2 ; o = _ _utf16le ( this , this . l , this . l + size ) ; break ; case "wstr" : if ( typeof cptable !== "undefined" ) o = cptable . utils . dec
"xmlns:cp" : XMLNS . CORE _PROPS , "xmlns:dc" : XMLNS . dc , "xmlns:dcterms" : XMLNS . dcterms , "xmlns:dcmitype" : XMLNS . dcmitype , "xmlns:xsi" : XMLNS . xsi } ) ; function cp _doit ( f , g , h , o , p ) { if ( p [ f ] != null || g == null || g === "" ) return ; p [ f ] = g ; o [ o . length ] = h ? writextag ( f , g , h ) : writetag ( f , g ) } function write _core _props ( cp , _opts ) { var opts = _opts || { } ; var o = [ XML _HEADER , CORE _PROPS _XML _ROOT ] , p = { } ; if ( ! cp && ! opts . Props ) return o . join ( "" ) ; if ( cp ) { if ( cp . CreatedDate != null ) cp _doit ( "dcterms:created" , typeof cp . CreatedDate === "string" ? cp . CreatedDate : write _w3cdtf ( cp . CreatedDate , opts . WTF ) , { "xsi:type" : "dcterms:W3CDTF" } , o , p ) ; if ( cp . ModifiedDate != null ) cp _doit ( "dcterms:modified" , typeof cp . ModifiedDate === "string" ? cp . ModifiedDate : write _w3cdtf ( cp . ModifiedDate , opts . WTF ) , { "xsi:type" : "dcterms:W3CDTF" } , o , p ) } for ( var i = 0 ; i != CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] ; var v = opts . Props && opts . Props [ f [ 1 ] ] != null ? opts . Props [ f [ 1 ] ] : cp ? cp [ f [ 1 ] ] : null ; if ( v === true ) v = "1" ; else if ( v === false ) v = "0" ; else if ( typeof v == "number" ) v = String ( v ) ; if ( v != null ) cp _doit ( f [ 0 ] , v , null , o , p ) } if ( o . length > 2 ) { o [ o . length ] = "</cp:coreProperties>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } var EXT _PROPS = [ [ "Application" , "Application" , "string" ] , [ "AppVersion" , "AppVersion" , "string" ] , [ "Company" , "Company" , "string" ] , [ "DocSecurity" , "DocSecurity" , "string" ] , [ "Manager" , "Manager" , "string" ] , [ "HyperlinksChanged" , "HyperlinksChanged" , "bool" ] , [ "SharedDoc" , "SharedDoc" , "bool" ] , [ "LinksUpToDate" , "LinksUpToDate" , "bool" ] , [ "ScaleCrop" , "ScaleCrop" , "bool" ] , [ "HeadingPairs" , "HeadingPairs" , "raw" ] , [ "TitlesOfParts" , "TitlesOfParts" , "raw" ] ] ; XMLNS . EXT _PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" ; RELS . EXT _PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" ; function parse _ext _props ( data , p ) { var q = { } ; if ( ! p ) p = { } ; EXT _PROPS . forEach ( function ( f ) { switch ( f [ 2 ] ) { case "string" : p [ f [ 1 ] ] = ( data . match ( matchtag ( f [ 0 ] ) ) || [ ] ) [ 1 ] ; break ; case "bool" : p [ f [ 1 ] ] = ( data . match ( matchtag ( f [ 0 ] ) ) || [ ] ) [ 1 ] === "true" ; break ; case "raw" : var cur = data . match ( new RegExp ( "<" + f [ 0 ] + "[^>]*>(.*)</" + f [ 0 ] + ">" ) ) ; if ( cur && cur . length > 0 ) q [ f [ 1 ] ] = cur [ 1 ] ; break } } ) ; if ( q . HeadingPairs && q . TitlesOfParts ) { var v = parseVector ( q . HeadingPairs ) ; var parts = parseVector ( q . TitlesOfParts ) . map ( function ( x ) { return x . v } ) ; var idx = 0 , len = 0 ; for ( var i = 0 ; i !== v . length ; i += 2 ) { len = + v [ i + 1 ] . v ; switch ( v [ i ] . v ) { case "Worksheets" : case "工作表" : case "Листы" : case "ワークシート" : case "גליונות עבודה" : case "Arbeitsblätter" : case "Çalı şma Sayfaları " : case "Feuilles de calcul" : case "Fogli di lavoro" : case "Folhas de cálculo" : case "Planilhas" : case "Werkbladen" : p . Worksheets = len ; p . SheetNames = parts . slice ( idx , idx + len ) ; break ; case "Named Ranges" : case "Benannte Bereiche" : p . NamedRanges = len ; p . DefinedNames = parts . slice ( idx , idx + len ) ; break ; case "Charts" : case "Diagramme" : p . Chartsheets = len ; p . ChartNames = parts . slice ( idx , idx + len ) ; break } idx += len } } return p } var EXT _PROPS _XML _ROOT = writextag ( "Properties" , null , { xmlns : XMLNS . EXT _PROPS , "xmlns:vt" : XMLNS . vt } ) ; function write _ext _props ( cp , opts ) { var o = [ ] , p = { } , W = writextag ; if ( ! cp ) cp = { } ; cp . Application = "SheetJS" ; o [ o . length ] = XML _HEADER ; o [ o . length ] = EXT _PROPS _XML _ROOT ; EXT _PROPS . forEach ( function ( f ) { if ( cp [ f [ 1 ] ] === undefined ) return ; var v ; switch ( f [ 2 ] ) { case "string" : v = String ( cp [ f [ 1 ] ] ) ; break ; case "bool" : v = cp [ f [ 1 ] ] ? "true" : "false" ; break } if ( v !== undefined ) o [ o . length ] = W ( f [ 0 ] , v ) } ) ; o [ o . length ] = W ( "HeadingPairs" , W ( "vt:vector" , W ( "vt:variant" , "<vt:lpstr>Worksheets</vt:lpstr>" ) + W ( "vt:variant" , W ( "vt:i4" , String ( cp . Worksheets ) ) ) , { size : 2 , baseType : "variant" } ) ) ; o [ o . length ] = W ( "TitlesOfParts" , W ( "vt:vector" , cp . SheetNames . map ( function ( s ) { return "<vt:lpstr>" + escapexml ( s ) + "</vt:lpstr>" } ) . join ( "" ) , { size : cp . Worksheets , baseType : "lpstr" } ) ) ; if ( o . length > 2 ) { o [ o . length ] = "</Properties>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } XMLNS . CUST _PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" ; RELS . CUST _PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" ; var custregex = /<[^>]+>[^<]*/g ; function parse _cust _props ( data , opts ) { var p = { } , name = "" ; var m = data . match ( custregex ) ; if ( m ) for ( var i = 0 ; i != m . length ; ++ i ) { var x = m [ i ] , y = parsexmltag ( x ) ; switch ( y [ 0 ] ) { case "<?xml" : bre
var parse _Window2 = parsenoop ; var parse _Backup = parsebool ; var parse _Blank = parse _XLSCell ; var parse _BottomMargin = parse _Xnum ; var parse _BuiltInFnGroupCount = parseuint16 ; var parse _CalcCount = parseuint16 ; var parse _CalcDelta = parse _Xnum ; var parse _CalcIter = parsebool ; var parse _CalcMode = parseuint16 ; var parse _CalcPrecision = parsebool ; var parse _CalcRefMode = parsenoop2 ; var parse _CalcSaveRecalc = parsebool ; var parse _CodePage = parseuint16 ; var parse _Compat12 = parsebool ; var parse _Date1904 = parsebool ; var parse _DefColWidth = parseuint16 ; var parse _DSF = parsenoop2 ; var parse _EntExU2 = parsenoop2 ; var parse _EOF = parsenoop2 ; var parse _Excel9File = parsenoop2 ; var parse _FeatHdr = parsenoop2 ; var parse _FontX = parseuint16 ; var parse _Footer = parse _XLHeaderFooter ; var parse _GridSet = parseuint16 ; var parse _HCenter = parsebool ; var parse _Header = parse _XLHeaderFooter ; var parse _HideObj = parse _HideObjEnum ; var parse _InterfaceEnd = parsenoop2 ; var parse _LeftMargin = parse _Xnum ; var parse _Mms = parsenoop2 ; var parse _ObjProtect = parsebool ; var parse _Password = parseuint16 ; var parse _PrintGrid = parsebool ; var parse _PrintRowCol = parsebool ; var parse _PrintSize = parseuint16 ; var parse _Prot4Rev = parsebool ; var parse _Prot4RevPass = parseuint16 ; var parse _Protect = parsebool ; var parse _RefreshAll = parsebool ; var parse _RightMargin = parse _Xnum ; var parse _RRTabId = parseuint16a ; var parse _ScenarioProtect = parsebool ; var parse _Scl = parseuint16a ; var parse _String = parse _XLUnicodeString ; var parse _SxBool = parsebool ; var parse _TopMargin = parse _Xnum ; var parse _UsesELFs = parsebool ; var parse _VCenter = parsebool ; var parse _WinProtect = parsebool ; var parse _WriteProtect = parsenoop ; var parse _VerticalPageBreaks = parsenoop ; var parse _HorizontalPageBreaks = parsenoop ; var parse _Selection = parsenoop ; var parse _Continue = parsenoop ; var parse _Pane = parsenoop ; var parse _Pls = parsenoop ; var parse _DCon = parsenoop ; var parse _DConRef = parsenoop ; var parse _DConName = parsenoop ; var parse _XCT = parsenoop ; var parse _CRN = parsenoop ; var parse _FileSharing = parsenoop ; var parse _Uncalced = parsenoop ; var parse _Template = parsenoop ; var parse _Intl = parsenoop ; var parse _WsBool = parsenoop ; var parse _Sort = parsenoop ; var parse _Sync = parsenoop ; var parse _LPr = parsenoop ; var parse _DxGCol = parsenoop ; var parse _FnGroupName = parsenoop ; var parse _FilterMode = parsenoop ; var parse _AutoFilterInfo = parsenoop ; var parse _AutoFilter = parsenoop ; var parse _ScenMan = parsenoop ; var parse _SCENARIO = parsenoop ; var parse _SxView = parsenoop ; var parse _Sxvd = parsenoop ; var parse _SXVI = parsenoop ; var parse _SxIvd = parsenoop ; var parse _SXLI = parsenoop ; var parse _SXPI = parsenoop ; var parse _DocRoute = parsenoop ; var parse _RecipName = parsenoop ; var parse _SXDI = parsenoop ; var parse _SXDB = parsenoop ; var parse _SXFDB = parsenoop ; var parse _SXDBB = parsenoop ; var parse _SXNum = parsenoop ; var parse _SxErr = parsenoop ; var parse _SXInt = parsenoop ; var parse _SXString = parsenoop ; var parse _SXDtr = parsenoop ; var parse _SxNil = parsenoop ; var parse _SXTbl = parsenoop ; var parse _SXTBRGIITM = parsenoop ; var parse _SxTbpg = parsenoop ; var parse _ObProj = parsenoop ; var parse _SXStreamID = parsenoop ; var parse _DBCell = parsenoop ; var parse _SXRng = parsenoop ; var parse _SxIsxoper = parsenoop ; var parse _BookBool = parsenoop ; var parse _DbOrParamQry = parsenoop ; var parse _OleObjectSize = parsenoop ; var parse _SXVS = parsenoop ; var parse _BkHim = parsenoop ; var parse _MsoDrawingGroup = parsenoop ; var parse _MsoDrawing = parsenoop ; var parse _MsoDrawingSelection = parsenoop ; var parse _PhoneticInfo = parsenoop ; var parse _SxRule = parsenoop ; var parse _SXEx = parsenoop ; var parse _SxFilt = parsenoop ; var parse _SxDXF = parsenoop ; var parse _SxItm = parsenoop ; var parse _SxName = parsenoop ; var parse _SxSelect = parsenoop ; var parse _SXPair = parsenoop ; var parse _SxFmla = parsenoop ; var parse _SxFormat = parsenoop ; var parse _SXVDEx = parsenoop ; var parse _SXFormula = parsenoop ; var parse _SXDBEx = parsenoop ; var parse _RRDInsDel = parsenoop ; var parse _RRDHead = parsenoop ; var parse _RRDChgCell = parsenoop ; var parse _RRDRenSheet = parsenoop ; var parse _RRSort = parsenoop ; var parse _RRDMove = parsenoop ; var parse _RRFormat = parsenoop ; var parse _RRAutoFmt = parsenoop ; var parse _RRInsertSh = parsenoop ; var parse _RRDMoveBegin = parsenoop ; var parse _RRDMoveEnd = parsenoop ; var parse _RRDInsDelBegin = parsenoop ; var parse _RRDInsDelEnd = parsenoop ; var parse _RRDConflict = parsenoop ; var parse _RRDDefN
var s = [ ] ; var pass = false ; recordhopper ( data , function hopper _sst ( val , R _n , RT ) { switch ( RT ) { case 159 : s . Count = val [ 0 ] ; s . Unique = val [ 1 ] ; break ; case 19 : s . push ( val ) ; break ; case 160 : return true ; case 35 : pass = true ; break ; case 36 : pass = false ; break ; default : if ( R _n . indexOf ( "Begin" ) > 0 ) { } else if ( R _n . indexOf ( "End" ) > 0 ) { } if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R _n ) } } ) ; return s } function write _BrtBeginSst ( sst , o ) { if ( ! o ) o = new _buf ( 8 ) ; o . write _shift ( 4 , sst . Count ) ; o . write _shift ( 4 , sst . Unique ) ; return o } var write _BrtSSTItem = write _RichStr ; function write _sst _bin ( sst , opts ) { var ba = buf _array ( ) ; write _record ( ba , "BrtBeginSst" , write _BrtBeginSst ( sst ) ) ; for ( var i = 0 ; i < sst . length ; ++ i ) write _record ( ba , "BrtSSTItem" , write _BrtSSTItem ( sst [ i ] ) ) ; write _record ( ba , "BrtEndSst" ) ; return ba . end ( ) } function _JS2ANSI ( str ) { if ( typeof cptable !== "undefined" ) return cptable . utils . encode ( 1252 , str ) ; var o = [ ] , oo = str . split ( "" ) ; for ( var i = 0 ; i < oo . length ; ++ i ) o [ i ] = oo [ i ] . charCodeAt ( 0 ) ; return o } function parse _CRYPTOVersion ( blob , length ) { var o = { } ; o . Major = blob . read _shift ( 2 ) ; o . Minor = blob . read _shift ( 2 ) ; return o } function parse _DataSpaceVersionInfo ( blob , length ) { var o = { } ; o . id = blob . read _shift ( 0 , "lpp4" ) ; o . R = parse _CRYPTOVersion ( blob , 4 ) ; o . U = parse _CRYPTOVersion ( blob , 4 ) ; o . W = parse _CRYPTOVersion ( blob , 4 ) ; return o } function parse _DataSpaceMapEntry ( blob ) { var len = blob . read _shift ( 4 ) ; var end = blob . l + len - 4 ; var o = { } ; var cnt = blob . read _shift ( 4 ) ; var comps = [ ] ; while ( cnt -- > 0 ) { var rc = { } ; rc . t = blob . read _shift ( 4 ) ; rc . v = blob . read _shift ( 0 , "lpp4" ) ; comps . push ( rc ) } o . name = blob . read _shift ( 0 , "lpp4" ) ; o . comps = comps ; return o } function parse _DataSpaceMap ( blob , length ) { var o = [ ] ; blob . l += 4 ; var cnt = blob . read _shift ( 4 ) ; while ( cnt -- > 0 ) o . push ( parse _DataSpaceMapEntry ( blob ) ) ; return o } function parse _DataSpaceDefinition ( blob , length ) { var o = [ ] ; blob . l += 4 ; var cnt = blob . read _shift ( 4 ) ; while ( cnt -- > 0 ) o . push ( blob . read _shift ( 0 , "lpp4" ) ) ; return o } function parse _TransformInfoHeader ( blob , length ) { var o = { } ; var len = blob . read _shift ( 4 ) ; var tgt = blob . l + len - 4 ; blob . l += 4 ; o . id = blob . read _shift ( 0 , "lpp4" ) ; o . name = blob . read _shift ( 0 , "lpp4" ) ; o . R = parse _CRYPTOVersion ( blob , 4 ) ; o . U = parse _CRYPTOVersion ( blob , 4 ) ; o . W = parse _CRYPTOVersion ( blob , 4 ) ; return o } function parse _Primary ( blob , length ) { var hdr = parse _TransformInfoHeader ( blob ) ; hdr . ename = blob . read _shift ( 0 , "8lpp4" ) ; hdr . blksz = blob . read _shift ( 4 ) ; hdr . cmode = blob . read _shift ( 4 ) ; if ( blob . read _shift ( 4 ) != 4 ) throw new Error ( "Bad !Primary record" ) ; return hdr } function parse _EncryptionHeader ( blob , length ) { var tgt = blob . l + length ; var o = { } ; o . Flags = blob . read _shift ( 4 ) & 63 ; blob . l += 4 ; o . AlgID = blob . read _shift ( 4 ) ; var valid = false ; switch ( o . AlgID ) { case 26126 : case 26127 : case 26128 : valid = o . Flags == 36 ; break ; case 26625 : valid = o . Flags == 4 ; break ; case 0 : valid = o . Flags == 16 || o . Flags == 4 || o . Flags == 36 ; break ; default : throw "Unrecognized encryption algorithm: " + o . AlgID } if ( ! valid ) throw new Error ( "Encryption Flags/AlgID mismatch" ) ; o . AlgIDHash = blob . read _shift ( 4 ) ; o . KeySize = blob . read _shift ( 4 ) ; o . ProviderType = blob . read _shift ( 4 ) ; blob . l += 8 ; o . CSPName = blob . read _shift ( tgt - blob . l >> 1 , "utf16le" ) . slice ( 0 , - 1 ) ; blob . l = tgt ; return o } function parse _EncryptionVerifier ( blob , length ) { var o = { } ; blob . l += 4 ; o . Salt = blob . slice ( blob . l , blob . l + 16 ) ; blob . l += 16 ; o . Verifier = blob . slice ( blob . l , blob . l + 16 ) ; blob . l += 16 ; var sz = blob . read _shift ( 4 ) ; o . VerifierHash = blob . slice ( blob . l , blob . l + sz ) ; blob . l += sz ; return o } function parse _EncryptionInfo ( blob , length ) { var vers = parse _CRYPTOVersion ( blob ) ; switch ( vers . Minor ) { case 2 : return parse _EncInfoStd ( blob , vers ) ; case 3 : return parse _EncInfoExt ( blob , vers ) ; case 4 : return parse _EncInfoAgl ( blob , vers ) } throw new Error ( "ECMA-376 Encryped file unrecognized Version: " + vers . Minor ) } function parse _EncInfoStd ( blob , vers ) { var flags = blob . read _shift ( 4 ) ; if ( ( flags & 63 ) != 36 ) throw new Error ( "EncryptionInfo mismatch" ) ; var sz = blob . read _shift ( 4 ) ; var tgt = blob . l + sz ; var hdr = parse _EncryptionHeader ( blob , sz ) ; var verifier = parse _EncryptionVerifier ( blob , blob . length - blob . l ) ; return { t : "Std" , h : hdr , v : verifier } } function parse _EncInfoExt ( blob , vers ) { throw new Error ( "File is password-protected: ECMA-376 Extensible" ) } function parse _EncInfoAgl ( blob , vers ) { throw new Error ( "File is password-protected: ECMA-376 Agile" ) } function parse _RC4CryptoHeader ( blo
o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>' ; o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = "</a:bgFillStyleLst>" ; o [ o . length ] = "</a:fmtScheme>" ; o [ o . length ] = "</a:themeElements>" ; o [ o . length ] = "<a:objectDefaults>" ; o [ o . length ] = "<a:spDef>" ; o [ o . length ] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>' ; o [ o . length ] = "</a:spDef>" ; o [ o . length ] = "<a:lnDef>" ; o [ o . length ] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>' ; o [ o . length ] = "</a:lnDef>" ; o [ o . length ] = "</a:objectDefaults>" ; o [ o . length ] = "<a:extraClrSchemeLst/>" ; o [ o . length ] = "</a:theme>" ; return o . join ( "" ) } function parse _Theme ( blob , length , opts ) { var dwThemeVersion = blob . read _shift ( 4 ) ; if ( dwThemeVersion === 124226 ) return ; blob . l += length - 4 } function parse _ColorTheme ( blob , length ) { return blob . read _shift ( 4 ) } function parse _FullColorExt ( blob , length ) { var o = { } ; o . xclrType = blob . read _shift ( 2 ) ; o . nTintShade = blob . read _shift ( 2 ) ; switch ( o . xclrType ) { case 0 : blob . l += 4 ; break ; case 1 : o . xclrValue = parse _IcvXF ( blob , 4 ) ; break ; case 2 : o . xclrValue = parse _LongRGBA ( blob , 4 ) ; break ; case 3 : o . xclrValue = parse _ColorTheme ( blob , 4 ) ; break ; case 4 : blob . l += 4 ; break } blob . l += 8 ; return o } function parse _IcvXF ( blob , length ) { return parsenoop ( blob , length ) } function parse _XFExtGradient ( blob , length ) { return parsenoop ( blob , length ) } function parse _ExtProp ( blob , length ) { var extType = blob . read _shift ( 2 ) ; var cb = blob . read _shift ( 2 ) ; var o = [ extType ] ; switch ( extType ) { case 4 : case 5 : case 7 : case 8 : case 9 : case 10 : case 11 : case 13 : o [ 1 ] = parse _FullColorExt ( blob , cb ) ; break ; case 6 : o [ 1 ] = parse _XFExtGradient ( blob , cb ) ; break ; case 14 : case 15 : o [ 1 ] = blob . read _shift ( cb === 5 ? 1 : 2 ) ; break ; default : throw new Error ( "Unrecognized ExtProp type: " + extType + " " + cb ) } return o } function parse _XFExt ( blob , length ) { var end = blob . l + length ; blob . l += 2 ; var ixfe = blob . read _shift ( 2 ) ; blob . l += 2 ; var cexts = blob . read _shift ( 2 ) ; var ext = [ ] ; while ( cexts -- > 0 ) ext . push ( parse _ExtProp ( blob , end - blob . l ) ) ; return { ixfe : ixfe , ext : ext } } function update _xfext ( xf , xfext ) { xfext . forEach ( function ( xfe ) { switch ( xfe [ 0 ] ) { case 4 : break ; case 5 : break ; case 6 : break ; case 7 : break ; case 8 : break ; case 9 : break ; case 10 : break ; case 11 : break ; case 13 : break ; case 14 : break ; case 15 : break } } ) } function parse _cc _xml ( data , opts ) { var d = [ ] ; if ( ! data ) return d ; var l = 0 , i = 1 ; ( data . match ( tagregex ) || [ ] ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; switch ( y [ 0 ] ) { case "<?xml" : break ; case "<calcChain" : case "<calcChain>" : case "</calcChain>" : break ; case "<c" : delete y [ 0 ] ; if ( y . i ) i = y . i ; else y . i = i ; d . push ( y ) ; break } } ) ; return d } function write _cc _xml ( data , opts ) { } function parse _BrtCalcChainItem$ ( data , length ) { var out = { } ; out . i = data . read _shift ( 4 ) ; var cell = { } ; cell . r = data . read _shift ( 4 ) ; cell . c = data . read _shift ( 4 ) ; out . r = encode _cell ( cell ) ; var flags = data . read _shift ( 1 ) ; if ( flags & 2 ) out . l = "1" ; if ( flags & 8 ) out . a = "1" ; return out } function parse _cc _bin ( data , opts ) { var out = [ ] ; var pass = false ; recordhopper ( data , function hopper _cc ( val , R _n , RT ) { switch ( RT ) { case 63 : out . push ( val ) ; break ; default : if ( ( R _n || "" ) . indexOf ( "Begin" ) > 0 ) { } else if ( ( R _n || "" ) . indexOf ( "End" ) > 0 ) { } else if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R _n ) } } ) ; return out } function write _cc _bin ( data , opts ) { } RELS . IMG = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" ; RELS . DRAW = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" ; function parse _drawing ( data , rels ) { if ( ! data ) return "??" ; var id = ( data . match ( /<c:chart [^>]*r:id="([^"]*)"/ ) || [ "" , "" ] ) [ 1 ] ; return rels [ "!id" ] [ id ] . Target } var _shapeid = 1024 ; function write _comments _vml ( rId , comments ) { var csize = [ 21600 , 21600 ] ;
break ; case 5 : _left = false ; case 1 : sp = fill ( "\r" , f [ 1 ] [ 1 ] ) ; break ; default : sp = "" ; if ( opts . WTF ) throw new Error ( "Unexpected PtgAttrSpaceType " + f [ 1 ] [ 0 ] ) } stack . push ( ( _left ? sp : "" ) + stack . pop ( ) + ( _left ? "" : sp ) ) ; last _sp = - 1 } } if ( stack . length > 1 && opts . WTF ) throw new Error ( "bad formula stack" ) ; return stack [ 0 ] } function parse _XLSBParsedFormula ( data , length , opts ) { var end = data . l + length ; var cce = data . read _shift ( 4 ) ; var rgce = parse _Rgce ( data , cce , opts ) ; var cb = data . read _shift ( 4 ) ; var rgcb = cb > 0 ? parse _RgbExtra ( data , cb , rgce , opts ) : null ; return [ rgce , rgcb ] } var parse _XLSBArrayParsedFormula = parse _XLSBParsedFormula ; var parse _XLSBCellParsedFormula = parse _XLSBParsedFormula ; var parse _XLSBNameParsedFormula = parse _XLSBParsedFormula ; var parse _XLSBSharedParsedFormula = parse _XLSBParsedFormula ; var PtgDataType = { 1 : "REFERENCE" , 2 : "VALUE" , 3 : "ARRAY" } ; var Cetab = { 0 : "BEEP" , 1 : "OPEN" , 2 : "OPEN.LINKS" , 3 : "CLOSE.ALL" , 4 : "SAVE" , 5 : "SAVE.AS" , 6 : "FILE.DELETE" , 7 : "PAGE.SETUP" , 8 : "PRINT" , 9 : "PRINTER.SETUP" , 10 : "QUIT" , 11 : "NEW.WINDOW" , 12 : "ARRANGE.ALL" , 13 : "WINDOW.SIZE" , 14 : "WINDOW.MOVE" , 15 : "FULL" , 16 : "CLOSE" , 17 : "RUN" , 22 : "SET.PRINT.AREA" , 23 : "SET.PRINT.TITLES" , 24 : "SET.PAGE.BREAK" , 25 : "REMOVE.PAGE.BREAK" , 26 : "FONT" , 27 : "DISPLAY" , 28 : "PROTECT.DOCUMENT" , 29 : "PRECISION" , 30 : "A1.R1C1" , 31 : "CALCULATE.NOW" , 32 : "CALCULATION" , 34 : "DATA.FIND" , 35 : "EXTRACT" , 36 : "DATA.DELETE" , 37 : "SET.DATABASE" , 38 : "SET.CRITERIA" , 39 : "SORT" , 40 : "DATA.SERIES" , 41 : "TABLE" , 42 : "FORMAT.NUMBER" , 43 : "ALIGNMENT" , 44 : "STYLE" , 45 : "BORDER" , 46 : "CELL.PROTECTION" , 47 : "COLUMN.WIDTH" , 48 : "UNDO" , 49 : "CUT" , 50 : "COPY" , 51 : "PASTE" , 52 : "CLEAR" , 53 : "PASTE.SPECIAL" , 54 : "EDIT.DELETE" , 55 : "INSERT" , 56 : "FILL.RIGHT" , 57 : "FILL.DOWN" , 61 : "DEFINE.NAME" , 62 : "CREATE.NAMES" , 63 : "FORMULA.GOTO" , 64 : "FORMULA.FIND" , 65 : "SELECT.LAST.CELL" , 66 : "SHOW.ACTIVE.CELL" , 67 : "GALLERY.AREA" , 68 : "GALLERY.BAR" , 69 : "GALLERY.COLUMN" , 70 : "GALLERY.LINE" , 71 : "GALLERY.PIE" , 72 : "GALLERY.SCATTER" , 73 : "COMBINATION" , 74 : "PREFERRED" , 75 : "ADD.OVERLAY" , 76 : "GRIDLINES" , 77 : "SET.PREFERRED" , 78 : "AXES" , 79 : "LEGEND" , 80 : "ATTACH.TEXT" , 81 : "ADD.ARROW" , 82 : "SELECT.CHART" , 83 : "SELECT.PLOT.AREA" , 84 : "PATTERNS" , 85 : "MAIN.CHART" , 86 : "OVERLAY" , 87 : "SCALE" , 88 : "FORMAT.LEGEND" , 89 : "FORMAT.TEXT" , 90 : "EDIT.REPEAT" , 91 : "PARSE" , 92 : "JUSTIFY" , 93 : "HIDE" , 94 : "UNHIDE" , 95 : "WORKSPACE" , 96 : "FORMULA" , 97 : "FORMULA.FILL" , 98 : "FORMULA.ARRAY" , 99 : "DATA.FIND.NEXT" , 100 : "DATA.FIND.PREV" , 101 : "FORMULA.FIND.NEXT" , 102 : "FORMULA.FIND.PREV" , 103 : "ACTIVATE" , 104 : "ACTIVATE.NEXT" , 105 : "ACTIVATE.PREV" , 106 : "UNLOCKED.NEXT" , 107 : "UNLOCKED.PREV" , 108 : "COPY.PICTURE" , 109 : "SELECT" , 110 : "DELETE.NAME" , 111 : "DELETE.FORMAT" , 112 : "VLINE" , 113 : "HLINE" , 114 : "VPAGE" , 115 : "HPAGE" , 116 : "VSCROLL" , 117 : "HSCROLL" , 118 : "ALERT" , 119 : "NEW" , 120 : "CANCEL.COPY" , 121 : "SHOW.CLIPBOARD" , 122 : "MESSAGE" , 124 : "PASTE.LINK" , 125 : "APP.ACTIVATE" , 126 : "DELETE.ARROW" , 127 : "ROW.HEIGHT" , 128 : "FORMAT.MOVE" , 129 : "FORMAT.SIZE" , 130 : "FORMULA.REPLACE" , 131 : "SEND.KEYS" , 132 : "SELECT.SPECIAL" , 133 : "APPLY.NAMES" , 134 : "REPLACE.FONT" , 135 : "FREEZE.PANES" , 136 : "SHOW.INFO" , 137 : "SPLIT" , 138 : "ON.WINDOW" , 139 : "ON.DATA" , 140 : "DISABLE.INPUT" , 142 : "OUTLINE" , 143 : "LIST.NAMES" , 144 : "FILE.CLOSE" , 145 : "SAVE.WORKBOOK" , 146 : "DATA.FORM" , 147 : "COPY.CHART" , 148 : "ON.TIME" , 149 : "WAIT" , 150 : "FORMAT.FONT" , 151 : "FILL.UP" , 152 : "FILL.LEFT" , 153 : "DELETE.OVERLAY" , 155 : "SHORT.MENUS" , 159 : "SET.UPDATE.STATUS" , 161 : "COLOR.PALETTE" , 162 : "DELETE.STYLE" , 163 : "WINDOW.RESTORE" , 164 : "WINDOW.MAXIMIZE" , 166 : "CHANGE.LINK" , 167 : "CALCULATE.DOCUMENT" , 168 : "ON.KEY" , 169 : "APP.RESTORE" , 170 : "APP.MOVE" , 171 : "APP.SIZE" , 172 : "APP.MINIMIZE" , 173 : "APP.MAXIMIZE" , 174 : "BRING.TO.FRONT" , 175 : "SEND.TO.BACK" , 185 : "MAIN.CHART.TYPE" , 186 : "OVERLAY.CHART.TYPE" , 187 : "SELECT.END" , 188 : "OPEN.MAIL" , 189 : "SEND.MAIL" , 190 : "STANDARD.FONT" , 191 : "CONSOLIDATE" , 192 : "SORT.SPECIAL" , 193 : "GALLERY.3D.AREA" , 194 : "GALLERY.3D.COLUMN" , 195 : "GALLERY.3D.LINE" , 196 : "GALLERY.3D.PIE" , 197 : "VIEW.3D" , 198 : "GOAL.SEEK" , 199 : "WORKGROUP" , 200 : "FILL.GROUP" , 201 : "UPDATE.LINK" , 202 : "PROMOTE" , 203 : "DEMOTE" , 204 : "SHOW.DETAIL" , 206 : "UNGROUP" , 207 : "OBJECT.PROPERTIES" , 208 : "SAVE.NEW.OBJECT" , 209 : "SHARE" , 210 : "SHARE.NAME" , 211 : "DUPLICATE" , 212 : "APPLY.STYLE" , 213 : "ASSIGN.TO.OBJECT" , 214 : "OBJECT.PROTECTION" , 215 : "HIDE.OBJECT" , 216 : "SET.EXTRACT" , 217 : "CREATE.PUBLISHER" , 218 : "SUBSCRIBE.TO" , 219 : "ATTRIBUTES" , 220 : "SHOW.TOOLBAR" , 222 : "PRINT.PREVIEW" , 223 : " EDIT . COL
var o = [ ] , r = [ ] , range = safe _decode _range ( ws [ "!ref" ] ) , cell , ref , rr = "" , cols = [ ] , R = 0 , C = 0 , rows = ws [ "!rows" ] ; var dense = Array . isArray ( ws ) ; for ( C = range . s . c ; C <= range . e . c ; ++ C ) cols [ C ] = encode _col ( C ) ; for ( R = range . s . r ; R <= range . e . r ; ++ R ) { r = [ ] ; rr = encode _row ( R ) ; for ( C = range . s . c ; C <= range . e . c ; ++ C ) { ref = cols [ C ] + rr ; var _cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ ref ] ; if ( _cell === undefined ) continue ; if ( ( cell = write _ws _xml _cell ( _cell , ref , ws , opts , idx , wb ) ) != null ) r . push ( cell ) } if ( r . length > 0 ) { var params = { r : rr } ; if ( rows && rows [ R ] ) { var row = rows [ R ] ; if ( row . hidden ) params . hidden = 1 ; var height = - 1 ; if ( row . hpx ) height = px2pt ( row . hpx ) ; else if ( row . hpt ) height = row . hpt ; if ( height > - 1 ) { params . ht = height ; params . customHeight = 1 } } o [ o . length ] = writextag ( "row" , r . join ( "" ) , params ) } } return o . join ( "" ) } var WS _XML _ROOT = writextag ( "worksheet" , null , { xmlns : XMLNS . main [ 0 ] , "xmlns:r" : XMLNS . r } ) ; function write _ws _xml ( idx , opts , wb , rels ) { var o = [ XML _HEADER , WS _XML _ROOT ] ; var s = wb . SheetNames [ idx ] , sidx = 0 , rdata = "" ; var ws = wb . Sheets [ s ] ; if ( ws == null ) ws = { } ; var ref = ws [ "!ref" ] ; if ( ref == null ) ref = "A1" ; if ( ! rels ) rels = { } ; ws [ "!comments" ] = [ ] ; ws [ "!drawing" ] = [ ] ; o [ o . length ] = writextag ( "sheetPr" , null , { codeName : escapexml ( wb . SheetNames [ idx ] ) } ) ; o [ o . length ] = writextag ( "dimension" , null , { ref : ref } ) ; if ( opts . sheetFormat ) o [ o . length ] = writextag ( "sheetFormatPr" , null , { defaultRowHeight : opts . sheetFormat . defaultRowHeight || "16" , baseColWidth : opts . sheetFormat . baseColWidth || "10" } ) ; if ( ws [ "!cols" ] != null && ws [ "!cols" ] . length > 0 ) o [ o . length ] = write _ws _xml _cols ( ws , ws [ "!cols" ] ) ; o [ sidx = o . length ] = "<sheetData/>" ; ws [ "!links" ] = [ ] ; if ( ws [ "!ref" ] != null ) { rdata = write _ws _xml _data ( ws , opts , idx , wb , rels ) ; if ( rdata . length > 0 ) o [ o . length ] = rdata } if ( o . length > sidx + 1 ) { o [ o . length ] = "</sheetData>" ; o [ sidx ] = o [ sidx ] . replace ( "/>" , ">" ) } if ( ws [ "!protect" ] != null ) o [ o . length ] = write _ws _xml _protection ( ws [ "!protect" ] ) ; if ( ws [ "!autofilter" ] != null ) o [ o . length ] = write _ws _xml _autofilter ( ws [ "!autofilter" ] ) ; if ( ws [ "!merges" ] != null && ws [ "!merges" ] . length > 0 ) o [ o . length ] = write _ws _xml _merges ( ws [ "!merges" ] ) ; var relc = - 1 , rel , rId = - 1 ; if ( ws [ "!links" ] . length > 0 ) { o [ o . length ] = "<hyperlinks>" ; ws [ "!links" ] . forEach ( function ( l ) { if ( ! l [ 1 ] . Target ) return ; rId = add _rels ( rels , - 1 , escapexml ( l [ 1 ] . Target ) . replace ( /#.*$/ , "" ) , RELS . HLINK ) ; rel = { ref : l [ 0 ] , "r:id" : "rId" + rId } ; if ( ( relc = l [ 1 ] . Target . indexOf ( "#" ) ) > - 1 ) rel . location = escapexml ( l [ 1 ] . Target . substr ( relc + 1 ) ) ; if ( l [ 1 ] . Tooltip ) rel . tooltip = escapexml ( l [ 1 ] . Tooltip ) ; o [ o . length ] = writextag ( "hyperlink" , null , rel ) } ) ; o [ o . length ] = "</hyperlinks>" } delete ws [ "!links" ] ; var hfidx = o . length ; o [ o . length ] = "" ; if ( ws [ "!drawing" ] . length > 0 ) { rId = add _rels ( rels , - 1 , "../drawings/drawing" + ( idx + 1 ) + ".xml" , RELS . DRAW ) ; ws [ "!drawing" ] . rid = rId ; o [ o . length ] = writextag ( "drawing" , null , { "r:id" : "rId" + rId } ) } else delete ws [ "!drawing" ] ; if ( ws [ "!comments" ] . length > 0 ) { rId = add _rels ( rels , - 1 , "../drawings/vmlDrawing" + ( idx + 1 ) + ".vml" , RELS . VML ) ; o [ o . length ] = writextag ( "legacyDrawing" , null , { "r:id" : "rId" + rId } ) ; ws [ "!legacy" ] = rId } if ( o . length > 2 ) { o [ o . length ] = "</worksheet>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } function parse _BrtRowHdr ( data , length ) { var z = [ ] ; z . r = data . read _shift ( 4 ) ; data . l += length - 4 ; return z } function write _BrtRowHdr ( R , range , ws ) { var o = new _buf ( 17 + 8 * 16 ) ; o . write _shift ( 4 , R ) ; o . write _shift ( 4 , 0 ) ; o . write _shift ( 2 , 320 ) ; o . write _shift ( 2 , 0 ) ; o . write _shift ( 1 , 0 ) ; var ncolspan = 0 , lcs = o . l ; o . l += 4 ; var caddr = { r : R , c : 0 } ; for ( var i = 0 ; i < 16 ; ++ i ) { if ( range . s . c > i + 1 << 10 || range . e . c < i << 10 ) continue ; var first = - 1 , last = - 1 ; for ( var j = i << 10 ; j < i + 1 << 10 ; ++ j ) { caddr . c = j ; var cell = Array . isArray ( ws ) ? ( ws [ caddr . r ] || [ ] ) [ caddr . c ] : ws [ encode _cell ( caddr ) ] ; if ( cell ) { if ( first < 0 ) first = j ; last = j } } if ( first < 0 ) continue ; ++ ncolspan ; o . write _shift ( 4 , first ) ; o . write _shift ( 4 , last ) } var l = o . l ; o . l = lcs ; o . write _shift ( 4 , ncolspan ) ; o . l = l ; return o . length > o . l ? o . slice ( 0 , o . l ) : o } function write _row _header ( ba , ws , range , R ) { var o = write _BrtRowHdr ( R , range , ws ) ; if ( o . length > 17 ) write _record ( ba , "BrtRowHdr" , o ) } var parse _BrtWsDim = parse _UncheckedRfX ; var write _BrtWsDim = write _UncheckedRfX ; function parse _BrtWsProp ( data , length ) { var z = { } ; data . l += 19 ; z . name = parse _XLSBCodeName ( data , length - 19 ) ; return z } function write _BrtWsProp ( str , o ) { if ( o == null ) o = new _buf ( 80 + 4 * str . length ) ; for ( var i = 0 ; i < 11 ; ++ i ) o . write _shift ( 1 , 0 ) ; o . write _shift ( - 4 , - 1 ) ; o . write _shift ( - 4 , - 1 ) ; write _XLSBCodeName ( st
} function parse _ds ( data , name , opts , rels , wb , themes , styles ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _ds _bin ( data , opts , rels , wb , themes , styles ) ; return parse _ds _xml ( data , opts , rels , wb , themes , styles ) } function parse _sty ( data , name , themes , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _sty _bin ( data , themes , opts ) ; return parse _sty _xml ( data , themes , opts ) } function parse _theme ( data , name , opts ) { return parse _theme _xml ( data , opts ) } function parse _sst ( data , name , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _sst _bin ( data , opts ) ; return parse _sst _xml ( data , opts ) } function parse _cmnt ( data , name , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _comments _bin ( data , opts ) ; return parse _comments _xml ( data , opts ) } function parse _cc ( data , name , opts ) { if ( name . slice ( - 4 ) === ".bin" ) return parse _cc _bin ( data , opts ) ; return parse _cc _xml ( data , opts ) } function write _wb ( wb , name , opts ) { return ( name . slice ( - 4 ) === ".bin" ? write _wb _bin : write _wb _xml ) ( wb , opts ) } function write _ws ( data , name , opts , wb , rels ) { return ( name . slice ( - 4 ) === ".bin" ? write _ws _bin : write _ws _xml ) ( data , opts , wb , rels ) } function write _cs ( data , name , opts , wb , rels ) { return ( name . slice ( - 4 ) === ".bin" ? write _cs _bin : write _cs _xml ) ( data , opts , wb , rels ) } function write _sty ( data , name , opts ) { return ( name . slice ( - 4 ) === ".bin" ? write _sty _bin : write _sty _xml ) ( data , opts ) } function write _sst ( data , name , opts ) { return ( name . slice ( - 4 ) === ".bin" ? write _sst _bin : write _sst _xml ) ( data , opts ) } function write _cmnt ( data , name , opts ) { return ( name . slice ( - 4 ) === ".bin" ? write _comments _bin : write _comments _xml ) ( data , opts ) } var attregexg2 = /([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g ; var attregex2 = /([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/ ; var _chr = function ( c ) { return String . fromCharCode ( c ) } ; function xlml _parsexmltag ( tag , skip _root ) { var words = tag . split ( /\s+/ ) ; var z = [ ] ; if ( ! skip _root ) z [ 0 ] = words [ 0 ] ; if ( words . length === 1 ) return z ; var m = tag . match ( attregexg2 ) , y , j , w , i ; if ( m ) for ( i = 0 ; i != m . length ; ++ i ) { y = m [ i ] . match ( attregex2 ) ; if ( ( j = y [ 1 ] . indexOf ( ":" ) ) === - 1 ) z [ y [ 1 ] ] = y [ 2 ] . substr ( 1 , y [ 2 ] . length - 2 ) ; else { if ( y [ 1 ] . substr ( 0 , 6 ) === "xmlns:" ) w = "xmlns" + y [ 1 ] . substr ( 6 ) ; else w = y [ 1 ] . substr ( j + 1 ) ; z [ w ] = y [ 2 ] . substr ( 1 , y [ 2 ] . length - 2 ) } } return z } function xlml _parsexmltagobj ( tag ) { var words = tag . split ( /\s+/ ) ; var z = { } ; if ( words . length === 1 ) return z ; var m = tag . match ( attregexg2 ) , y , j , w , i ; if ( m ) for ( i = 0 ; i != m . length ; ++ i ) { y = m [ i ] . match ( attregex2 ) ; if ( ( j = y [ 1 ] . indexOf ( ":" ) ) === - 1 ) z [ y [ 1 ] ] = y [ 2 ] . substr ( 1 , y [ 2 ] . length - 2 ) ; else { if ( y [ 1 ] . substr ( 0 , 6 ) === "xmlns:" ) w = "xmlns" + y [ 1 ] . substr ( 6 ) ; else w = y [ 1 ] . substr ( j + 1 ) ; z [ w ] = y [ 2 ] . substr ( 1 , y [ 2 ] . length - 2 ) } } return z } function xlml _format ( format , value ) { var fmt = XLMLFormatMap [ format ] || unescapexml ( format ) ; if ( fmt === "General" ) return SSF . _general ( value ) ; return SSF . format ( fmt , value ) } function xlml _set _custprop ( Custprops , Rn , cp , val ) { var oval = val ; switch ( ( cp [ 0 ] . match ( /dt:dt="([\w.]+)"/ ) || [ "" , "" ] ) [ 1 ] ) { case "boolean" : oval = parsexmlbool ( val ) ; break ; case "i2" : case "int" : oval = parseInt ( val , 10 ) ; break ; case "r4" : case "float" : oval = parseFloat ( val ) ; break ; case "date" : case "dateTime.tz" : oval = parseDate ( val ) ; break ; case "i8" : case "string" : case "fixed" : case "uuid" : case "bin.base64" : break ; default : throw new Error ( "bad custprop:" + cp [ 0 ] ) } Custprops [ unescapexml ( Rn [ 3 ] ) ] = oval } function safe _format _xlml ( cell , nf , o ) { if ( cell . t === "z" ) return ; try { if ( cell . t === "e" ) { cell . w = cell . w || BErr [ cell . v ] } else if ( nf === "General" ) { if ( cell . t === "n" ) { if ( ( cell . v | 0 ) === cell . v ) cell . w = SSF . _general _int ( cell . v ) ; else cell . w = SSF . _general _num ( cell . v ) } else cell . w = SSF . _general ( cell . v ) } else cell . w = xlml _format ( nf || "General" , cell . v ) ; var z = XLMLFormatMap [ nf ] || nf || "General" ; if ( o . cellNF ) cell . z = z ; if ( o . cellDates && cell . t == "n" && SSF . is _date ( z ) ) { var _d = SSF . parse _date _code ( cell . v ) ; if ( _d ) { cell . t = "d" ; cell . v = new Date ( Date . UTC ( _d . y , _d . m - 1 , _d . d , _d . H , _d . M , _d . S , _d . u ) ) } } } catch ( e ) { if ( o . WTF ) throw e } } function process _style _xlml ( styles , stag , opts ) { if ( opts . cellStyles ) { if ( stag . Interior ) { var I = stag . Interior ; if ( I . Pattern ) I . patternType = XLMLPatternTypeMap [ I . Pattern ] || I . Pattern } } styles [ stag . ID ] = stag } function parse _xlml _data ( xml , ss , data , cell , base , styles , csty , row , arrayf , o ) { var nf = "General" , sid = cell . StyleID , S = { } ; o = o || { } ; var interiors = [ ] ; var i = 0 ; if ( sid === undefined && row ) sid = row . StyleID ; if ( sid === undefined && csty ) sid = csty . StyleID ; while ( styles [ sid ] !== undefined ) { if (
} ; if ( val . itab > 0 ) last _lbl . Sheet = val . itab - 1 ; supbooks . names . push ( last _lbl ) ; if ( ! supbooks [ 0 ] ) supbooks [ 0 ] = [ ] ; supbooks [ supbooks . length - 1 ] . push ( val ) ; if ( val . Name == "\r" && val . itab > 0 ) if ( val . rgce && val . rgce [ 0 ] && val . rgce [ 0 ] [ 0 ] && val . rgce [ 0 ] [ 0 ] [ 0 ] == "PtgArea3d" ) FilterDatabases [ val . itab - 1 ] = { ref : encode _range ( val . rgce [ 0 ] [ 0 ] [ 1 ] [ 2 ] ) } ; break ; case "ExternSheet" : if ( supbooks . length == 0 ) { supbooks [ 0 ] = [ ] ; supbooks [ 0 ] . XTI = [ ] } supbooks [ supbooks . length - 1 ] . XTI = supbooks [ supbooks . length - 1 ] . XTI . concat ( val ) ; supbooks . XTI = supbooks . XTI . concat ( val ) ; break ; case "NameCmt" : if ( opts . biff < 8 ) break ; last _lbl . Comment = val [ 1 ] ; break ; case "Protect" : out [ "!protect" ] = val ; break ; case "Password" : if ( val !== 0 && opts . WTF ) console . error ( "Password verifier: " + val ) ; break ; case "Prot4Rev" : case "Prot4RevPass" : break ; case "BoundSheet8" : { Directory [ val . pos ] = val ; opts . snames . push ( val . name ) } break ; case "EOF" : { if ( -- file _depth ) break ; if ( range . e ) { if ( range . e . r > 0 && range . e . c > 0 ) { range . e . r -- ; range . e . c -- ; out [ "!ref" ] = encode _range ( range ) ; range . e . r ++ ; range . e . c ++ } if ( mergecells . length > 0 ) out [ "!merges" ] = mergecells ; if ( objects . length > 0 ) out [ "!objects" ] = objects ; if ( colinfo . length > 0 ) out [ "!cols" ] = colinfo ; if ( rowinfo . length > 0 ) out [ "!rows" ] = rowinfo ; Workbook . Sheets . push ( wsprops ) } if ( cur _sheet === "" ) Preamble = out ; else Sheets [ cur _sheet ] = out ; out = options . dense ? [ ] : { } } break ; case "BOF" : { if ( opts . biff !== 8 ) { } else if ( RecordType === 9 ) opts . biff = 2 ; else if ( RecordType === 521 ) opts . biff = 3 ; else if ( RecordType === 1033 ) opts . biff = 4 ; else if ( val . BIFFVer === 1280 ) opts . biff = 5 ; else if ( val . BIFFVer === 1536 ) opts . biff = 8 ; else if ( val . BIFFVer === 2 ) opts . biff = 2 ; else if ( val . BIFFVer === 7 ) opts . biff = 2 ; if ( file _depth ++ ) break ; cell _valid = true ; out = options . dense ? [ ] : { } ; if ( opts . biff < 5 ) { if ( cur _sheet === "" ) cur _sheet = "Sheet1" ; range = { s : { r : 0 , c : 0 } , e : { r : 0 , c : 0 } } ; var fakebs8 = { pos : blob . l - length , name : cur _sheet } ; Directory [ fakebs8 . pos ] = fakebs8 ; opts . snames . push ( cur _sheet ) } else cur _sheet = ( Directory [ s ] || { name : "" } ) . name ; if ( val . dt == 32 ) out [ "!type" ] = "chart" ; mergecells = [ ] ; objects = [ ] ; array _formulae = [ ] ; opts . arrayf = array _formulae ; colinfo = [ ] ; rowinfo = [ ] ; defwidth = defheight = 0 ; seencol = false ; wsprops = { Hidden : ( Directory [ s ] || { hs : 0 } ) . hs , name : cur _sheet } } break ; case "Number" : case "BIFF2NUM" : case "BIFF2INT" : { if ( out [ "!type" ] == "chart" ) if ( options . dense ? ( out [ val . r ] || [ ] ) [ val . c ] : out [ encode _cell ( { c : val . c , r : val . r } ) ] ) ++ val . c ; temp _val = { ixfe : val . ixfe , XF : XFs [ val . ixfe ] , v : val . val , t : "n" } ; safe _format _xf ( temp _val , options , wb . opts . Date1904 ) ; addcell ( { c : val . c , r : val . r } , temp _val , options ) } break ; case "BoolErr" : { temp _val = { ixfe : val . ixfe , XF : XFs [ val . ixfe ] , v : val . val , t : val . t } ; safe _format _xf ( temp _val , options , wb . opts . Date1904 ) ; addcell ( { c : val . c , r : val . r } , temp _val , options ) } break ; case "RK" : { temp _val = { ixfe : val . ixfe , XF : XFs [ val . ixfe ] , v : val . rknum , t : "n" } ; safe _format _xf ( temp _val , options , wb . opts . Date1904 ) ; addcell ( { c : val . c , r : val . r } , temp _val , options ) } break ; case "MulRk" : { for ( var j = val . c ; j <= val . C ; ++ j ) { var ixfe = val . rkrec [ j - val . c ] [ 0 ] ; temp _val = { ixfe : ixfe , XF : XFs [ ixfe ] , v : val . rkrec [ j - val . c ] [ 1 ] , t : "n" } ; safe _format _xf ( temp _val , options , wb . opts . Date1904 ) ; addcell ( { c : j , r : val . r } , temp _val , options ) } } break ; case "Formula" : { if ( val . val == "String" ) { last _formula = val ; break } temp _val = { v : val . val , ixfe : val . cell . ixfe , t : val . tt } ; temp _val . XF = XFs [ temp _val . ixfe ] ; if ( options . cellFormula ) { var _f = val . formula ; if ( _f && _f [ 0 ] && _f [ 0 ] [ 0 ] && _f [ 0 ] [ 0 ] [ 0 ] == "PtgExp" ) { var _fr = _f [ 0 ] [ 0 ] [ 1 ] [ 0 ] , _fc = _f [ 0 ] [ 0 ] [ 1 ] [ 1 ] ; var _fe = encode _cell ( { r : _fr , c : _fc } ) ; if ( shared _formulae [ _fe ] ) temp _val . f = "" + stringify _formula ( val . formula , range , val . cell , supbooks , opts ) ; else temp _val . F = ( ( options . dense ? ( out [ _fr ] || [ ] ) [ _fc ] : out [ _fe ] ) || { } ) . F } else temp _val . f = "" + stringify _formula ( val . formula , range , val . cell , supbooks , opts ) } safe _format _xf ( temp _val , options , wb . opts . Date1904 ) ; addcell ( val . cell , temp _val , options ) ; last _formula = val } break ; case "String" : { if ( last _formula ) { last _formula . val = val ; temp _val = { v : val , ixfe : last _formula . cell . ixfe , t : "s" } ; temp _val . XF = XFs [ temp _val . ixfe ] ; if ( options . cellFormula ) { temp _val . f = "" + stringify _formula ( last _formula . formula , range , last _formula . cell , supbooks , opts ) } safe _format _xf ( temp _val , options , wb . opts . Date1904 ) ; addcell ( last _formula . cell , temp _val , options ) ; last _formula = null } else throw new Error ( "String record expects Formula" ) } break ; case "Array" : { array _formulae . push ( val ) ; var
f : parsenoop } , 560 : { n : "BrtBeginSXCondFmts" , f : parsenoop } , 561 : { n : "BrtEndSXCondFmts" , f : parsenoop } , 562 : { n : "BrtBkHim" , f : parsenoop } , 564 : { n : "BrtColor" , f : parsenoop } , 565 : { n : "BrtBeginIndexedColors" , f : parsenoop } , 566 : { n : "BrtEndIndexedColors" , f : parsenoop } , 569 : { n : "BrtBeginMRUColors" , f : parsenoop } , 570 : { n : "BrtEndMRUColors" , f : parsenoop } , 572 : { n : "BrtMRUColor" , f : parsenoop } , 573 : { n : "BrtBeginDVals" , f : parsenoop } , 574 : { n : "BrtEndDVals" , f : parsenoop } , 577 : { n : "BrtSupNameStart" , f : parsenoop } , 578 : { n : "BrtSupNameValueStart" , f : parsenoop } , 579 : { n : "BrtSupNameValueEnd" , f : parsenoop } , 580 : { n : "BrtSupNameNum" , f : parsenoop } , 581 : { n : "BrtSupNameErr" , f : parsenoop } , 582 : { n : "BrtSupNameSt" , f : parsenoop } , 583 : { n : "BrtSupNameNil" , f : parsenoop } , 584 : { n : "BrtSupNameBool" , f : parsenoop } , 585 : { n : "BrtSupNameFmla" , f : parsenoop } , 586 : { n : "BrtSupNameBits" , f : parsenoop } , 587 : { n : "BrtSupNameEnd" , f : parsenoop } , 588 : { n : "BrtEndSupBook" , f : parsenoop } , 589 : { n : "BrtCellSmartTagProperty" , f : parsenoop } , 590 : { n : "BrtBeginCellSmartTag" , f : parsenoop } , 591 : { n : "BrtEndCellSmartTag" , f : parsenoop } , 592 : { n : "BrtBeginCellSmartTags" , f : parsenoop } , 593 : { n : "BrtEndCellSmartTags" , f : parsenoop } , 594 : { n : "BrtBeginSmartTags" , f : parsenoop } , 595 : { n : "BrtEndSmartTags" , f : parsenoop } , 596 : { n : "BrtSmartTagType" , f : parsenoop } , 597 : { n : "BrtBeginSmartTagTypes" , f : parsenoop } , 598 : { n : "BrtEndSmartTagTypes" , f : parsenoop } , 599 : { n : "BrtBeginSXFilters" , f : parsenoop } , 600 : { n : "BrtEndSXFilters" , f : parsenoop } , 601 : { n : "BrtBeginSXFILTER" , f : parsenoop } , 602 : { n : "BrtEndSXFilter" , f : parsenoop } , 603 : { n : "BrtBeginFills" , f : parsenoop } , 604 : { n : "BrtEndFills" , f : parsenoop } , 605 : { n : "BrtBeginCellWatches" , f : parsenoop } , 606 : { n : "BrtEndCellWatches" , f : parsenoop } , 607 : { n : "BrtCellWatch" , f : parsenoop } , 608 : { n : "BrtBeginCRErrs" , f : parsenoop } , 609 : { n : "BrtEndCRErrs" , f : parsenoop } , 610 : { n : "BrtCrashRecErr" , f : parsenoop } , 611 : { n : "BrtBeginFonts" , f : parsenoop } , 612 : { n : "BrtEndFonts" , f : parsenoop } , 613 : { n : "BrtBeginBorders" , f : parsenoop } , 614 : { n : "BrtEndBorders" , f : parsenoop } , 615 : { n : "BrtBeginFmts" , f : parsenoop } , 616 : { n : "BrtEndFmts" , f : parsenoop } , 617 : { n : "BrtBeginCellXFs" , f : parsenoop } , 618 : { n : "BrtEndCellXFs" , f : parsenoop } , 619 : { n : "BrtBeginStyles" , f : parsenoop } , 620 : { n : "BrtEndStyles" , f : parsenoop } , 625 : { n : "BrtBigName" , f : parsenoop } , 626 : { n : "BrtBeginCellStyleXFs" , f : parsenoop } , 627 : { n : "BrtEndCellStyleXFs" , f : parsenoop } , 628 : { n : "BrtBeginComments" , f : parsenoop } , 629 : { n : "BrtEndComments" , f : parsenoop } , 630 : { n : "BrtBeginCommentAuthors" , f : parsenoop } , 631 : { n : "BrtEndCommentAuthors" , f : parsenoop } , 632 : { n : "BrtCommentAuthor" , f : parse _BrtCommentAuthor } , 633 : { n : "BrtBeginCommentList" , f : parsenoop } , 634 : { n : "BrtEndCommentList" , f : parsenoop } , 635 : { n : "BrtBeginComment" , f : parse _BrtBeginComment } , 636 : { n : "BrtEndComment" , f : parsenoop } , 637 : { n : "BrtCommentText" , f : parse _BrtCommentText } , 638 : { n : "BrtBeginOleObjects" , f : parsenoop } , 639 : { n : "BrtOleObject" , f : parsenoop } , 640 : { n : "BrtEndOleObjects" , f : parsenoop } , 641 : { n : "BrtBeginSxrules" , f : parsenoop } , 642 : { n : "BrtEndSxRules" , f : parsenoop } , 643 : { n : "BrtBeginActiveXControls" , f : parsenoop } , 644 : { n : "BrtActiveX" , f : parsenoop } , 645 : { n : "BrtEndActiveXControls" , f : parsenoop } , 646 : { n : "BrtBeginPCDSDTCEMembersSortBy" , f : parsenoop } , 648 : { n : "BrtBeginCellIgnoreECs" , f : parsenoop } , 649 : { n : "BrtCellIgnoreEC" , f : parsenoop } , 650 : { n : "BrtEndCellIgnoreECs" , f : parsenoop } , 651 : { n : "BrtCsProp" , f : parsenoop } , 652 : { n : "BrtCsPageSetup" , f : parsenoop } , 653 : { n : "BrtBeginUserCsViews" , f : parsenoop } , 654 : { n : "BrtEndUserCsViews" , f : parsenoop } , 655 : { n : "BrtBeginUserCsView" , f : parsenoop } , 656 : { n : "BrtEndUserCsView" , f : parsenoop } , 657 : { n : "BrtBeginPcdSFCIEntries" , f : parsenoop } , 658 : { n : "BrtEndPCDSFCIEntries" , f : parsenoop } , 659 : { n : "BrtPCDSFCIEntry" , f : parsenoop } , 660 : { n : "BrtBeginListParts" , f : parsenoop } , 661 : { n : "BrtListPart" , f : parsenoop } , 662 : { n : "BrtEndListParts" , f : parsenoop } , 663 : { n : "BrtSheetCalcProp" , f : parsenoop } , 664 : { n : "BrtBeginFnGroup" , f : parsenoop } , 665 : { n : "BrtFnGroup" , f : parsenoop } , 666 : { n : "BrtEndFnGroup" , f : parsenoop } , 667 : { n : "BrtSupAddin" , f : parsenoop } , 668 : { n : "BrtSXTDMPOrder" , f : parsenoop } , 669 : { n : "BrtCsProtection" , f : parsenoop } , 671 : { n : "BrtBeginWsSortMap" , f : parsenoop } , 672 : { n : "BrtEndWsSortMap" , f : parsenoop } , 673 : { n : "BrtBeginRRSort" , f : parsenoop } , 674 : { n : "BrtEndRRSort" , f : parsenoop } , 675 : { n : "BrtRRSortItem" , f : parsenoop } , 676 : { n : "BrtFileSharingIso" , f : parsenoop } , 677 : { n : " Brt
if ( ( RS = + tag . rowspan ) > 0 || CS > 1 ) merges . push ( { s : { r : R , c : C } , e : { r : R + ( RS || 1 ) - 1 , c : C + CS - 1 } } ) ; if ( ! m . length ) { C += CS ; continue } m = unescapexml ( m ) . replace ( /[\r\n]/g , "" ) ; if ( range . s . r > R ) range . s . r = R ; if ( range . e . r < R ) range . e . r = R ; if ( range . s . c > C ) range . s . c = C ; if ( range . e . c < C ) range . e . c = C ; if ( opts . dense ) { if ( ! ws [ R ] ) ws [ R ] = [ ] ; if ( Number ( m ) == Number ( m ) ) ws [ R ] [ C ] = { t : "n" , v : + m } ; else ws [ R ] [ C ] = { t : "s" , v : m } } else { var coord = encode _cell ( { r : R , c : C } ) ; if ( Number ( m ) == Number ( m ) ) ws [ coord ] = { t : "n" , v : + m } ; else ws [ coord ] = { t : "s" , v : m } } C += CS } } ws [ "!ref" ] = encode _range ( range ) ; return ws } function html _to _book ( str , opts ) { return sheet _to _workbook ( html _to _sheet ( str , opts ) , opts ) } function make _html _row ( ws , r , R , o ) { var M = ws [ "!merges" ] || [ ] ; var oo = [ ] ; for ( var C = r . s . c ; C <= r . e . c ; ++ C ) { var RS = 0 , CS = 0 ; for ( var j = 0 ; j < M . length ; ++ j ) { if ( M [ j ] . s . r > R || M [ j ] . s . c > C ) continue ; if ( M [ j ] . e . r < R || M [ j ] . e . c < C ) continue ; if ( M [ j ] . s . r < R || M [ j ] . s . c < C ) { RS = - 1 ; break } RS = M [ j ] . e . r - M [ j ] . s . r + 1 ; CS = M [ j ] . e . c - M [ j ] . s . c + 1 ; break } if ( RS < 0 ) continue ; var coord = encode _cell ( { r : R , c : C } ) ; var cell = o . dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ coord ] ; if ( ! cell || cell . v == null ) { oo . push ( "<td></td>" ) ; continue } var w = cell . h || escapexml ( cell . w || ( format _cell ( cell ) , cell . w ) || "" ) ; var sp = { } ; if ( RS > 1 ) sp . rowspan = RS ; if ( CS > 1 ) sp . colspan = CS ; oo . push ( writextag ( "td" , w , sp ) ) } return "<tr>" + oo . join ( "" ) + "</tr>" } function sheet _to _html ( ws , opts ) { var o = [ ] ; var r = decode _range ( ws [ "!ref" ] ) ; o . dense = Array . isArray ( ws ) ; for ( var R = r . s . r ; R <= r . e . r ; ++ R ) o . push ( make _html _row ( ws , r , R , o ) ) ; return "<html><body><table>" + o . join ( "" ) + "</table></body></html>" } return { to _workbook : html _to _book , to _sheet : html _to _sheet , _row : make _html _row , from _sheet : sheet _to _html } } ( ) ; function parse _dom _table ( table , _opts ) { var opts = _opts || { } ; if ( DENSE != null ) opts . dense = DENSE ; var ws = opts . dense ? [ ] : { } ; var rows = table . getElementsByTagName ( "tr" ) ; var range = { s : { r : 0 , c : 0 } , e : { r : rows . length - 1 , c : 0 } } ; var merges = [ ] , midx = 0 ; var R = 0 , _C = 0 , C = 0 , RS = 0 , CS = 0 ; for ( ; R < rows . length ; ++ R ) { var row = rows [ R ] ; var elts = row . children ; for ( _C = C = 0 ; _C < elts . length ; ++ _C ) { var elt = elts [ _C ] , v = elts [ _C ] . innerText ; for ( midx = 0 ; midx < merges . length ; ++ midx ) { var m = merges [ midx ] ; if ( m . s . c == C && m . s . r <= R && R <= m . e . r ) { C = m . e . c + 1 ; midx = - 1 } } CS = + elt . getAttribute ( "colspan" ) || 1 ; if ( ( RS = + elt . getAttribute ( "rowspan" ) ) > 0 || CS > 1 ) merges . push ( { s : { r : R , c : C } , e : { r : R + ( RS || 1 ) - 1 , c : C + CS - 1 } } ) ; var o = { t : "s" , v : v } ; if ( v != null && v . length && ! isNaN ( Number ( v ) ) ) o = { t : "n" , v : Number ( v ) } ; if ( opts . dense ) { if ( ! ws [ R ] ) ws [ R ] = [ ] ; ws [ R ] [ C ] = o } else ws [ encode _cell ( { c : C , r : R } ) ] = o ; if ( range . e . c < C ) range . e . c = C ; C += CS } } ws [ "!merges" ] = merges ; ws [ "!ref" ] = encode _range ( range ) ; return ws } function table _to _book ( table , opts ) { return sheet _to _workbook ( parse _dom _table ( table , opts ) , opts ) } var parse _content _xml = function ( ) { var parse _text _p = function ( text , tag ) { return unescapexml ( text . replace ( /<text:s\/>/g , " " ) . replace ( /<[^>]*>/g , "" ) ) } ; var number _formats = { day : [ "d" , "dd" ] , month : [ "m" , "mm" ] , year : [ "y" , "yy" ] , hours : [ "h" , "hh" ] , minutes : [ "m" , "mm" ] , seconds : [ "s" , "ss" ] , "am-pm" : [ "A/P" , "AM/PM" ] , "day-of-week" : [ "ddd" , "dddd" ] } ; return function pcx ( d , _opts ) { var opts = _opts || { } ; if ( DENSE != null && opts . dense == null ) opts . dense = DENSE ; var str = xlml _normalize ( d ) ; var state = [ ] , tmp ; var tag ; var NFtag = { name : "" } , NF = "" , pidx = 0 ; var sheetag ; var rowtag ; var Sheets = { } , SheetNames = [ ] ; var ws = opts . dense ? [ ] : { } ; var Rn , q ; var ctag = { value : "" } ; var textp = "" , textpidx = 0 , textptag ; var R = - 1 , C = - 1 , range = { s : { r : 1e6 , c : 1e7 } , e : { r : 0 , c : 0 } } ; var number _format _map = { } ; var merges = [ ] , mrange = { } , mR = 0 , mC = 0 ; var arrayf = [ ] ; var comments = [ ] , comment = { } ; var creator = "" , creatoridx = 0 ; var rept = 1 , isstub = false ; var i = 0 ; xlmlregex . lastIndex = 0 ; str = str . replace ( /<!--([^\u2603]*?)-->/gm , "" ) . replace ( /<!DOCTYPE[^\[]*\[[^\]]*\]>/gm , "" ) ; while ( Rn = xlmlregex . exec ( str ) ) switch ( Rn [ 3 ] = Rn [ 3 ] . replace ( /_.*$/ , "" ) ) { case "table" : case "工作表" : if ( Rn [ 1 ] === "/" ) { if ( range . e . c >= range . s . c && range . e . r >= range . s . r ) ws [ "!ref" ] = encode _range ( range ) ; if ( merges . length ) ws [ "!merges" ] = merges ; sheetag . name = utf8read ( sheetag [ "名称" ] || sheetag . name ) ; SheetNames . push ( sheetag . name ) ; Sheets [ sheetag . name ] = ws } else if ( Rn [ 0 ] . charAt ( Rn [ 0 ] . length - 2 ) !== "/" ) { sheetag = parsexmltag ( Rn [ 0 ] , false ) ; R = C = - 1 ; range . s . r = range . s . c = 1e7 ; range . e . r = range . e . c = 0 ; ws = opts . dense ? [ ] : { } ; merges = [ ] } break ; case "table-row" : case "行" : if ( Rn [ 1 ] === "/" ) break ; rowtag = parsexmltag ( Rn [ 0 ] , false ) ; if ( rowtag [ " <EFBFBD> <EFBFBD>
return c . charCodeAt ( 0 ) } ) } } throw new Error ( "Unrecognized type " + opts . type ) } function write _binary _type ( out , opts ) { switch ( opts . type ) { case "base64" : case "binary" : var bstr = "" ; for ( var i = 0 ; i < out . length ; ++ i ) bstr += String . fromCharCode ( out [ i ] ) ; return opts . type == "base64" ? Base64 . encode ( bstr ) : bstr ; case "file" : return _fs . writeFileSync ( opts . file , out ) ; case "buffer" : return out ; default : throw new Error ( "Unrecognized type " + opts . type ) } } function writeSync ( wb , opts ) { check _wb ( wb ) ; var o = opts || { } ; switch ( o . bookType || "xlsb" ) { case "xml" : case "xlml" : return write _string _type ( write _xlml ( wb , o ) , o ) ; case "slk" : case "sylk" : return write _string _type ( write _slk _str ( wb , o ) , o ) ; case "html" : return write _string _type ( write _htm _str ( wb , o ) , o ) ; case "txt" : return write _bstr _type ( write _txt _str ( wb , o ) , o ) ; case "csv" : return write _string _type ( write _csv _str ( wb , o ) , o ) ; case "dif" : return write _string _type ( write _dif _str ( wb , o ) , o ) ; case "prn" : return write _string _type ( write _prn _str ( wb , o ) , o ) ; case "fods" : return write _string _type ( write _ods ( wb , o ) , o ) ; case "biff2" : return write _binary _type ( write _biff _buf ( wb , o ) , o ) ; case "xlsx" : case "xlsm" : case "xlsb" : case "ods" : return write _zip _type ( wb , o ) ; default : throw new Error ( "Unrecognized bookType |" + o . bookType + "|" ) } } function resolve _book _type ( o ) { if ( ! o . bookType ) switch ( o . file . slice ( o . file . lastIndexOf ( "." ) ) . toLowerCase ( ) ) { case ".xlsx" : o . bookType = "xlsx" ; break ; case ".xlsm" : o . bookType = "xlsm" ; break ; case ".xlsb" : o . bookType = "xlsb" ; break ; case ".fods" : o . bookType = "fods" ; break ; case ".xlml" : o . bookType = "xlml" ; break ; case ".sylk" : o . bookType = "sylk" ; break ; case ".html" : o . bookType = "html" ; break ; case ".xls" : o . bookType = "biff2" ; break ; case ".xml" : o . bookType = "xml" ; break ; case ".ods" : o . bookType = "ods" ; break ; case ".csv" : o . bookType = "csv" ; break ; case ".txt" : o . bookType = "txt" ; break ; case ".dif" : o . bookType = "dif" ; break ; case ".prn" : o . bookType = "prn" ; break ; case ".slk" : o . bookType = "sylk" ; break ; case ".htm" : o . bookType = "html" ; break } } function writeFileSync ( wb , filename , opts ) { var o = opts || { } ; o . type = "file" ; o . file = filename ; resolve _book _type ( o ) ; return writeSync ( wb , o ) } function writeFileAsync ( filename , wb , opts , cb ) { var o = opts || { } ; o . type = "file" ; o . file = filename ; resolve _book _type ( o ) ; o . type = "buffer" ; var _cb = cb ; if ( ! ( _cb instanceof Function ) ) _cb = opts ; return _fs . writeFile ( filename , writeSync ( wb , o ) , _cb ) } function decode _row ( rowstr ) { return parseInt ( unfix _row ( rowstr ) , 10 ) - 1 } function encode _row ( row ) { return "" + ( row + 1 ) } function fix _row ( cstr ) { return cstr . replace ( /([A-Z]|^)(\d+)$/ , "$1$$$2" ) } function unfix _row ( cstr ) { return cstr . replace ( /\$(\d+)$/ , "$1" ) } function decode _col ( colstr ) { var c = unfix _col ( colstr ) , d = 0 , i = 0 ; for ( ; i !== c . length ; ++ i ) d = 26 * d + c . charCodeAt ( i ) - 64 ; return d - 1 } function encode _col ( col ) { var s = "" ; for ( ++ col ; col ; col = Math . floor ( ( col - 1 ) / 26 ) ) s = String . fromCharCode ( ( col - 1 ) % 26 + 65 ) + s ; return s } function fix _col ( cstr ) { return cstr . replace ( /^([A-Z])/ , "$$$1" ) } function unfix _col ( cstr ) { return cstr . replace ( /^\$([A-Z])/ , "$1" ) } function split _cell ( cstr ) { return cstr . replace ( /(\$?[A-Z]*)(\$?\d*)/ , "$1,$2" ) . split ( "," ) } function decode _cell ( cstr ) { var splt = split _cell ( cstr ) ; return { c : decode _col ( splt [ 0 ] ) , r : decode _row ( splt [ 1 ] ) } } function encode _cell ( cell ) { return encode _col ( cell . c ) + encode _row ( cell . r ) } function fix _cell ( cstr ) { return fix _col ( fix _row ( cstr ) ) } function unfix _cell ( cstr ) { return unfix _col ( unfix _row ( cstr ) ) } function decode _range ( range ) { var x = range . split ( ":" ) . map ( decode _cell ) ; return { s : x [ 0 ] , e : x [ x . length - 1 ] } } function encode _range ( cs , ce ) { if ( typeof ce === "undefined" || typeof ce === "number" ) { return encode _range ( cs . s , cs . e ) } if ( typeof cs !== "string" ) cs = encode _cell ( cs ) ; if ( typeof ce !== "string" ) ce = encode _cell ( ce ) ; return cs == ce ? cs : cs + ":" + ce } function safe _decode _range ( range ) { var o = { s : { c : 0 , r : 0 } , e : { c : 0 , r : 0 } } ; var idx = 0 , i = 0 , cc = 0 ; var len = range . length ; for ( idx = 0 ; i < len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 64 ) < 1 || cc > 26 ) break ; idx = 26 * idx + cc } o . s . c = -- idx ; for ( idx = 0 ; i < len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 48 ) < 0 || cc > 9 ) break ; idx = 10 * idx + cc } o . s . r = -- idx ; if ( i === len || range . charCodeAt ( ++ i ) === 58 ) { o . e . c = o . s . c ; o . e . r = o . s . r ; return o } for ( idx = 0 ; i != len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 64 ) < 1 || cc > 26 ) break ; idx = 26 * idx + cc } o . e . c = -- idx ; for ( idx = 0 ; i != len ; ++ i ) { if ( ( cc = range . charCodeAt ( i ) - 48 ) < 0 || cc > 9 ) break ; idx = 10 * idx + cc } o . e . r = -- idx ; return o } function safe _format _