2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-03-25 22:18:50 +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 { if ( typeof self == "undefined" && typeof app != "undefined" ) self = app ; 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 , 393
code = str . charCodeAt ( i ) ; res += "\\x" + ( code < 16 ? "0" : "" ) + code . toString ( 16 ) . toUpperCase ( ) } 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 direct
if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } return BS _BLOCK _DONE } function deflate _huff ( s , flush ) { 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 . h
exports . inflate = inflate ; exports . inflateEnd = inflateEnd ; exports . inflateGetHeader = inflateGetHeader ; 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 _dbi
} 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
} ; 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 ) } ; _ _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 ) ) : "" } } 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 . decode ( current _codepage , this . slice ( this . l , this . l + 2 * size ) ) ; else return ReadShift . call ( this , size , "dbcs" ) ; size = 2 * size ; break ; case "lpstr" : o = _ _lpstr ( this , this . l ) ; size = 5 + o . length ; break ; case "lpwstr" : o = _ _lpwstr ( this , this . l ) ; size = 5 + o . length ; if ( o [ o . length - 1 ] == "\0" ) size += 2 ; break ; case "cstr" : size = 0 ; o = "" ; while ( ( w = _ _readUInt8 ( this , this . l + size ++ ) ) !== 0 ) oo . push ( _getchar ( w ) ) ; o = oo . join ( "" ) ; break ; case "wstr" : size = 0 ; o = "" ; while ( ( w = _ _readUInt16LE ( this , this . l + size ) ) !== 0 ) { oo . push ( _getchar ( w ) ) ; size += 2 } size += 2 ; o = oo . join ( "" ) ; break ; case "dbcs-cont" : o = "" ; loc = this . l ; for ( i = 0 ; i != size ; ++ i ) { if ( this . lens && this . lens . indexOf ( loc ) !== - 1 ) { w = _ _readUInt8 ( this , loc ) ; this . l = loc + 1 ; vv = ReadShift . call ( this , size - i , w ? "dbcs-cont" : "sbcs-cont" ) ; return oo . join ( "" ) + vv } oo . push ( _getchar ( _ _readUInt16LE ( this , loc ) ) ) ; loc += 2 } o = oo . join ( "" ) ; size *= 2 ; break ; case "sbcs-cont" : o = "" ; loc = this . l ; for ( i = 0 ; i != size ; ++ i ) { if ( this . lens && this . lens . indexOf ( loc ) !== - 1 ) { w = _ _readUInt8 ( this , loc ) ; this . l = loc + 1 ; vv = ReadShift . call ( this , size - i , w ? "dbcs-cont" : "sbcs-cont" ) ; return oo . join ( "" ) + vv } oo . push ( _getchar ( _ _readUInt8 ( this , loc ) ) ) ; loc += 1 } o = oo . join ( "" ) ; break ; default : switch ( size ) { case 1 : oI = _ _readUInt8 ( this , this . l ) ; this . l ++ ; return oI ; case 2 : oI = ( t === "i" ? _ _readInt16LE : _ _readUInt16LE ) ( this , this . l ) ; this . l += 2 ; return oI ; case 4 : if ( t === "i" || ( this [ this . l + 3 ] & 128 ) === 0 ) { oI = _ _readInt32LE ( this , this . l ) ; this . l += 4 ; return oI } else { oR = _ _readUInt32LE ( this , this . l ) ; this . l += 4 } return oR ; case 8 : if ( t === "f" ) { oR = _ _double ( this , this . l ) ; this . l += 8 ; return oR } case 16 : o = _ _hexlify ( this , this . l , size ) ; break } } this . l += size ; return o } var _ _writeUInt16LE = function ( b , val , idx ) { b [ id
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" : break ; case "<Properties" : break ; case "<property" : name = y . name ; break ; case "</property>" : name = null ; break ; default : if ( x . indexOf ( "<vt:" ) === 0 ) { var toks = x . split ( ">" ) ; var type = toks [ 0 ] . substring ( 4 ) , text = toks [ 1 ] ; switch ( type ) { case "lpstr" : case "lpwstr" : case "bstr" : case "lpwstr" : p [ name ] = unescapexml ( text ) ; break ; case "bool" : p [ name ] = parsexmlbool ( text , "<vt:bool>" ) ; break ; case "i1" : case "i2" : case "i4" : case "i8" : case "int" : case "uint" : p [ name ] = parseInt ( text , 10 ) ; break ; case "r4" : case "r8" : case "decimal" : p [ name ] = parseFloat ( text ) ; break ; case "filetime" : case "date" : p [ name ] = parseDate ( text ) ; break ; case "cy" : case "error" : p [ name ] = unescapexml ( text ) ; break ; default : if ( opts . WTF && typeof console !== "undefined" ) console . warn ( "Unexpected" , x , type , toks ) } } else if ( x . substr ( 0 , 2 ) === "</" ) { } else if ( opts . WTF ) throw new Error ( x ) } } return p } var CUST _PROPS _XML _ROOT = writextag ( "Properties" , null , { xmlns : XMLNS . CUST _PROPS , "xmlns:vt" : XMLNS . vt } ) ; function write _cust _props ( cp , opts ) { var o = [ XML _HEADER , CUST _PROPS _XML _ROOT ] ; if ( ! cp ) return o . join ( "" ) ; var pid = 1 ; keys ( cp ) . forEach ( function custprop ( k ) { ++ pid ; o [ o . length ] = writextag ( "property" , write _vt ( cp [ k ] ) , { fmtid : "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" , pid : pid , name : k } ) } ) ; if ( o . length > 2 ) { o [ o . length ] = "</Properties>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } function xlml _set _prop ( Props , tag , val ) { switch ( tag ) { case "Description" : tag = "Comments" ; break ; case "Created" : tag = "CreatedDate" ; break ; case "LastSaved" : tag = "ModifiedDate" ; break } Props [ tag ] = val } var XLMLDocumentProperties = [ [ "Title" , "Title" ] , [ "Subject" , "Subject" ] , [ "Author" , "Author" ] , [ "Keywords" , "Keywords" ] , [ "Comments" , "Description" ] , [ "LastAuthor" , "LastAuthor" ] , [ "CreatedDate" , "Created" , "date" ] , [ "ModifiedDate" , "LastSaved" , "date" ] , [ "Category" , "Category" ] , [ "Manager" , "Manager" ] , [ "Company" , "Company" ] , [ "AppVersion" , "Version" ] ] ; function xlml _write _docprops ( Props ) { var T = "DocumentProperties" ; var o = [ ] ; XLMLDocumentProperties . forEach ( function ( p ) { if ( ! Props [ p [ 0 ] ] ) return ; var m = Props [ p [ 0 ] ] ; switch ( p [ 2 ] ) { case "date" : m = new Date ( m ) . toISOString ( ) ; break } o . push ( writetag ( p [ 1 ] , m ) ) } ) ; return "<" + T + ' xmlns="' + XLMLNS . o + '">' + o . join ( "" ) + "</" + T + ">" } function xlml _write _custprops ( Props , Custprops ) { var T = "CustomDocumentProperties" ; var o = [ ] ; if ( Props ) keys ( Props ) . forEach ( function ( k ) { if ( ! Props . hasOwnProperty ( k ) ) return ; for ( var i = 0 ; i < XLMLDocumentProperties . length ; ++ i ) if ( k == XLMLDocumentProperties [ i ] [ 0 ] ) return ; var m = Props [ k ] ; var t = "string" ; if ( typeof m == "number" ) { t = "float" ; m = String ( m ) } else if ( m === true || m === false ) { t = "boolean" ; m = m ? "1" : "0" } else m = String ( m ) ; o . push ( writextag ( escapexmltag ( k ) , m , { "dt:dt" : t } ) ) } ) ; if ( Custprops ) keys ( Custprops ) . forEach ( function ( k ) { if ( ! Custprops . hasOwnProperty ( k ) ) return ; var m = Custprops [ k ] ; var t = "string" ; if ( typeof m == "number" ) { t = "float" ; m = String ( m ) } else if ( m === true || m === false ) { t = "boolean" ; m = m ? "1" : "0" } else if ( m instanceof Date ) { t = "dateTime.tz" ; m = m . toISOString ( ) } else m = String ( m ) ; o . push ( writextag ( escapexmltag ( k ) , m , { "dt:dt" : t } ) ) } ) ; return "<" + T + ' xmlns="' + XLMLNS . o + '">' + o . join ( "" ) + "</" + T + ">" } function parse _FILETIME ( blob ) { var dwLowDateTime = blob . read _shift ( 4 ) , dwHighDateTime = blob . read _shift ( 4 ) ; return new Date ( ( dwHighDateTime / 1e7 * Math . pow ( 2 , 32 ) + dwLowDateTime / 1e7 - 11644473600 ) * 1e3 ) . toISOString ( ) . replace ( /\.000/ , "" ) } function parse _lpstr ( blob , type , pad ) { var str = blob . read _shift ( 0 , "lpstr" ) ; if ( pad ) blob . l += 4 - ( str . length + 1 & 3 ) & 3 ; return str } function parse _lpwstr ( blob , type , pad ) { var str = blob . read _shift ( 0 , "lpwstr" ) ; if ( pad ) blob . l += 4 - ( str . length + 1 & 3 ) & 3 ; return str } function parse _VtStringBase ( blob , stringType , pad ) { if ( stringType === 31 ) return parse _lpwstr ( blob ) ; return parse _lpstr ( blob , stringType , pad ) } function parse _VtS
var parse _UserSViewBegin = parsenoop ; var parse _UserSViewEnd = parsenoop ; var parse _RRDUserView = parsenoop ; var parse _Qsi = parsenoop ; var parse _CondFmt = parsenoop ; var parse _CF = parsenoop ; var parse _DVal = parsenoop ; var parse _DConBin = parsenoop ; var parse _Lel = parsenoop ; var parse _XLSCodeName = parse _XLUnicodeString ; var parse _SXFDBType = parsenoop ; var parse _ObNoMacros = parsenoop ; var parse _Dv = parsenoop ; var parse _Index = parsenoop ; var parse _Table = parsenoop ; var parse _BigName = parsenoop ; var parse _ContinueBigName = parsenoop ; var parse _WebPub = parsenoop ; var parse _QsiSXTag = parsenoop ; var parse _DBQueryExt = parsenoop ; var parse _ExtString = parsenoop ; var parse _TxtQry = parsenoop ; var parse _Qsir = parsenoop ; var parse _Qsif = parsenoop ; var parse _RRDTQSIF = parsenoop ; var parse _OleDbConn = parsenoop ; var parse _WOpt = parsenoop ; var parse _SXViewEx = parsenoop ; var parse _SXTH = parsenoop ; var parse _SXPIEx = parsenoop ; var parse _SXVDTEx = parsenoop ; var parse _SXViewEx9 = parsenoop ; var parse _ContinueFrt = parsenoop ; var parse _RealTimeData = parsenoop ; var parse _ChartFrtInfo = parsenoop ; var parse _FrtWrapper = parsenoop ; var parse _StartBlock = parsenoop ; var parse _EndBlock = parsenoop ; var parse _StartObject = parsenoop ; var parse _EndObject = parsenoop ; var parse _CatLab = parsenoop ; var parse _YMult = parsenoop ; var parse _SXViewLink = parsenoop ; var parse _PivotChartBits = parsenoop ; var parse _FrtFontList = parsenoop ; var parse _SheetExt = parsenoop ; var parse _BookExt = parsenoop ; var parse _SXAddl = parsenoop ; var parse _CrErr = parsenoop ; var parse _HFPicture = parsenoop ; var parse _Feat = parsenoop ; var parse _DataLabExt = parsenoop ; var parse _DataLabExtContents = parsenoop ; var parse _CellWatch = parsenoop ; var parse _FeatHdr11 = parsenoop ; var parse _Feature11 = parsenoop ; var parse _DropDownObjIds = parsenoop ; var parse _ContinueFrt11 = parsenoop ; var parse _DConn = parsenoop ; var parse _List12 = parsenoop ; var parse _Feature12 = parsenoop ; var parse _CondFmt12 = parsenoop ; var parse _CF12 = parsenoop ; var parse _CFEx = parsenoop ; var parse _AutoFilter12 = parsenoop ; var parse _ContinueFrt12 = parsenoop ; var parse _MDTInfo = parsenoop ; var parse _MDXStr = parsenoop ; var parse _MDXTuple = parsenoop ; var parse _MDXSet = parsenoop ; var parse _MDXProp = parsenoop ; var parse _MDXKPI = parsenoop ; var parse _MDB = parsenoop ; var parse _PLV = parsenoop ; var parse _DXF = parsenoop ; var parse _TableStyles = parsenoop ; var parse _TableStyle = parsenoop ; var parse _TableStyleElement = parsenoop ; var parse _NamePublish = parsenoop ; var parse _NameCmt = parsenoop ; var parse _SortData = parsenoop ; var parse _GUIDTypeLib = parsenoop ; var parse _FnGrp12 = parsenoop ; var parse _NameFnGrp12 = parsenoop ; var parse _HeaderFooter = parsenoop ; var parse _CrtLayout12 = parsenoop ; var parse _CrtMlFrt = parsenoop ; var parse _CrtMlFrtContinue = parsenoop ; var parse _ShapePropsStream = parsenoop ; var parse _TextPropsStream = parsenoop ; var parse _RichTextStream = parsenoop ; var parse _CrtLayout12A = parsenoop ; var parse _Units = parsenoop ; var parse _Chart = parsenoop ; var parse _Series = parsenoop ; var parse _DataFormat = parsenoop ; var parse _LineFormat = parsenoop ; var parse _MarkerFormat = parsenoop ; var parse _AreaFormat = parsenoop ; var parse _PieFormat = parsenoop ; var parse _AttachedLabel = parsenoop ; var parse _SeriesText = parsenoop ; var parse _ChartFormat = parsenoop ; var parse _Legend = parsenoop ; var parse _SeriesList = parsenoop ; var parse _Bar = parsenoop ; var parse _Line = parsenoop ; var parse _Pie = parsenoop ; var parse _Area = parsenoop ; var parse _Scatter = parsenoop ; var parse _CrtLine = parsenoop ; var parse _Axis = parsenoop ; var parse _Tick = parsenoop ; var parse _ValueRange = parsenoop ; var parse _CatSerRange = parsenoop ; var parse _AxisLine = parsenoop ; var parse _CrtLink = parsenoop ; var parse _DefaultText = parsenoop ; var parse _Text = parsenoop ; var parse _ObjectLink = parsenoop ; var parse _Frame = parsenoop ; var parse _Begin = parsenoop ; var parse _End = parsenoop ; var parse _PlotArea = parsenoop ; var parse _Chart3d = parsenoop ; var parse _PicF = parsenoop ; var parse _DropBar = parsenoop ; var parse _Radar = parsenoop ; var parse _Surf = parsenoop ; var parse _RadarArea = parsenoop ; var parse _AxisParent = parsenoop ; var parse _LegendException = parsenoop ; var parse _ShtProps = parsenoop ; var parse _SerToCrt = parsenoop ; var parse _AxesUsed = parsenoop ; var parse _SBaseRef = parsenoop ; var parse _SerParent = parsenoop ; var parse _SerAuxTrend = parsenoop ; var parse _IFmtRecord = parsenoop ; var parse _Pos = parse
o [ o . length ] = '<a:folHlink><a:srgbClr val="800080"/></a:folHlink>' ; o [ o . length ] = "</a:clrScheme>" ; o [ o . length ] = '<a:fontScheme name="Office">' ; o [ o . length ] = "<a:majorFont>" ; o [ o . length ] = '<a:latin typeface="Cambria"/>' ; o [ o . length ] = '<a:ea typeface=""/>' ; o [ o . length ] = '<a:cs typeface=""/>' ; o [ o . length ] = '<a:font script="Jpan" typeface="M S Pゴシック"/>' ; o [ o . length ] = '<a:font script="Hang" typeface="맑은 고딕"/>' ; o [ o . length ] = '<a:font script="Hans" typeface="宋体"/>' ; o [ o . length ] = '<a:font script="Hant" typeface="新細明體"/>' ; o [ o . length ] = '<a:font script="Arab" typeface="Times New Roman"/>' ; o [ o . length ] = '<a:font script="Hebr" typeface="Times New Roman"/>' ; o [ o . length ] = '<a:font script="Thai" typeface="Tahoma"/>' ; o [ o . length ] = '<a:font script="Ethi" typeface="Nyala"/>' ; o [ o . length ] = '<a:font script="Beng" typeface="Vrinda"/>' ; o [ o . length ] = '<a:font script="Gujr" typeface="Shruti"/>' ; o [ o . length ] = '<a:font script="Khmr" typeface="MoolBoran"/>' ; o [ o . length ] = '<a:font script="Knda" typeface="Tunga"/>' ; o [ o . length ] = '<a:font script="Guru" typeface="Raavi"/>' ; o [ o . length ] = '<a:font script="Cans" typeface="Euphemia"/>' ; o [ o . length ] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>' ; o [ o . length ] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>' ; o [ o . length ] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>' ; o [ o . length ] = '<a:font script="Thaa" typeface="MV Boli"/>' ; o [ o . length ] = '<a:font script="Deva" typeface="Mangal"/>' ; o [ o . length ] = '<a:font script="Telu" typeface="Gautami"/>' ; o [ o . length ] = '<a:font script="Taml" typeface="Latha"/>' ; o [ o . length ] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>' ; o [ o . length ] = '<a:font script="Orya" typeface="Kalinga"/>' ; o [ o . length ] = '<a:font script="Mlym" typeface="Kartika"/>' ; o [ o . length ] = '<a:font script="Laoo" typeface="DokChampa"/>' ; o [ o . length ] = '<a:font script="Sinh" typeface="Iskoola Pota"/>' ; o [ o . length ] = '<a:font script="Mong" typeface="Mongolian Baiti"/>' ; o [ o . length ] = '<a:font script="Viet" typeface="Times New Roman"/>' ; o [ o . length ] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>' ; o [ o . length ] = '<a:font script="Geor" typeface="Sylfaen"/>' ; o [ o . length ] = "</a:majorFont>" ; o [ o . length ] = "<a:minorFont>" ; o [ o . length ] = '<a:latin typeface="Calibri"/>' ; o [ o . length ] = '<a:ea typeface=""/>' ; o [ o . length ] = '<a:cs typeface=""/>' ; o [ o . length ] = '<a:font script="Jpan" typeface="M S Pゴシック"/>' ; o [ o . length ] = '<a:font script="Hang" typeface="맑은 고딕"/>' ; o [ o . length ] = '<a:font script="Hans" typeface="宋体"/>' ; o [ o . length ] = '<a:font script="Hant" typeface="新細明體"/>' ; o [ o . length ] = '<a:font script="Arab" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Hebr" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Thai" typeface="Tahoma"/>' ; o [ o . length ] = '<a:font script="Ethi" typeface="Nyala"/>' ; o [ o . length ] = '<a:font script="Beng" typeface="Vrinda"/>' ; o [ o . length ] = '<a:font script="Gujr" typeface="Shruti"/>' ; o [ o . length ] = '<a:font script="Khmr" typeface="DaunPenh"/>' ; o [ o . length ] = '<a:font script="Knda" typeface="Tunga"/>' ; o [ o . length ] = '<a:font script="Guru" typeface="Raavi"/>' ; o [ o . length ] = '<a:font script="Cans" typeface="Euphemia"/>' ; o [ o . length ] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>' ; o [ o . length ] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>' ; o [ o . length ] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>' ; o [ o . length ] = '<a:font script="Thaa" typeface="MV Boli"/>' ; o [ o . length ] = '<a:font script="Deva" typeface="Mangal"/>' ; o [ o . length ] = '<a:font script="Telu" typeface="Gautami"/>' ; o [ o . length ] = '<a:font script="Taml" typeface="Latha"/>' ; o [ o . length ] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>' ; o [ o . length ] = '<a:font script="Orya" typeface="Kalinga"/>' ; o [ o . length ] = '<a:font script="Mlym" typeface="Kartika"/>' ; o [ o . length ] = '<a:font script="Laoo" typeface="DokChampa"/>' ; o [ o . length ] = '<a:font script="Sinh" typeface="Iskoola Pota"/>' ; o [ o . length ] = '<a:font script="Mong" typeface="Mongolian Baiti"/>' ; o [ o . length ] = '<a:font script="Viet" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>' ; o [ o . length ] = '<a:font script="Geor" typeface="Sylfaen"/>' ; o [ o . length ] = "</a:minorFont>" ; o [ o . length ] = "
stack . push ( sname + "!" + encode _cell ( c ) ) ; break ; case "PtgFunc" : case "PtgFuncVar" : var argc = f [ 1 ] [ 0 ] , func = f [ 1 ] [ 1 ] ; if ( ! argc ) argc = 0 ; var args = argc == 0 ? [ ] : stack . slice ( - argc ) ; stack . length -= argc ; if ( func === "User" ) func = args . shift ( ) ; stack . push ( func + "(" + args . join ( "," ) + ")" ) ; break ; case "PtgBool" : stack . push ( f [ 1 ] ? "TRUE" : "FALSE" ) ; break ; case "PtgInt" : stack . push ( f [ 1 ] ) ; break ; case "PtgNum" : stack . push ( String ( f [ 1 ] ) ) ; break ; case "PtgStr" : stack . push ( '"' + f [ 1 ] + '"' ) ; break ; case "PtgErr" : stack . push ( f [ 1 ] ) ; break ; case "PtgAreaN" : type = f [ 1 ] [ 0 ] ; r = shift _range _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _range _xls ( r , opts ) ) ; break ; case "PtgArea" : type = f [ 1 ] [ 0 ] ; r = shift _range _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _range _xls ( r , opts ) ) ; break ; case "PtgArea3d" : type = f [ 1 ] [ 0 ] ; ixti = f [ 1 ] [ 1 ] ; r = f [ 1 ] [ 2 ] ; sname = supbooks && supbooks [ 1 ] ? supbooks [ 1 ] [ ixti + 1 ] : "**MISSING**" ; stack . push ( sname + "!" + encode _range ( r ) ) ; break ; case "PtgAttrSum" : stack . push ( "SUM(" + stack . pop ( ) + ")" ) ; break ; case "PtgAttrSemi" : break ; case "PtgName" : nameidx = f [ 1 ] [ 2 ] ; var lbl = supbooks [ 0 ] [ nameidx ] ; var name = lbl ? lbl . Name : "**MISSING**" + String ( nameidx ) ; if ( name in XLSXFutureFunctions ) name = XLSXFutureFunctions [ name ] ; stack . push ( name ) ; break ; case "PtgNameX" : var bookidx = f [ 1 ] [ 1 ] ; nameidx = f [ 1 ] [ 2 ] ; var externbook ; if ( opts . biff == 5 ) { if ( bookidx < 0 ) bookidx = - bookidx ; if ( supbooks [ bookidx ] ) externbook = supbooks [ bookidx ] [ nameidx ] } else { if ( supbooks [ bookidx + 1 ] ) externbook = supbooks [ bookidx + 1 ] [ nameidx ] ; else if ( supbooks [ bookidx - 1 ] ) externbook = supbooks [ bookidx - 1 ] [ nameidx ] } if ( ! externbook ) externbook = { body : "??NAMEX??" } ; stack . push ( externbook . body ) ; break ; case "PtgParen" : var lp = "(" , rp = ")" ; if ( last _sp >= 0 ) { sp = "" ; switch ( formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) { case 2 : lp = fill ( " " , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + lp ; break ; case 3 : lp = fill ( "\r" , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + lp ; break ; case 4 : rp = fill ( " " , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + rp ; break ; case 5 : rp = fill ( "\r" , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) + rp ; break ; default : if ( opts . WTF ) throw new Error ( "Unexpected PtgAttrSpaceType " + formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) } last _sp = - 1 } stack . push ( lp + stack . pop ( ) + rp ) ; break ; case "PtgRefErr" : stack . push ( "#REF!" ) ; break ; case "PtgRefErr3d" : stack . push ( "#REF!" ) ; break ; case "PtgExp" : c = { c : f [ 1 ] [ 1 ] , r : f [ 1 ] [ 0 ] } ; var q = { c : cell . c , r : cell . r } ; if ( supbooks . sharedf [ encode _cell ( c ) ] ) { var parsedf = supbooks . sharedf [ encode _cell ( c ) ] ; stack . push ( stringify _formula ( parsedf , _range , q , supbooks , opts ) ) } else { var fnd = false ; for ( e1 = 0 ; e1 != supbooks . arrayf . length ; ++ e1 ) { e2 = supbooks . arrayf [ e1 ] ; if ( c . c < e2 [ 0 ] . s . c || c . c > e2 [ 0 ] . e . c ) continue ; if ( c . r < e2 [ 0 ] . s . r || c . r > e2 [ 0 ] . e . r ) continue ; stack . push ( stringify _formula ( e2 [ 1 ] , _range , q , supbooks , opts ) ) ; fnd = true ; break } if ( ! fnd ) stack . push ( f [ 1 ] ) } break ; case "PtgArray" : stack . push ( "{" + stringify _array ( f [ 1 ] ) + "}" ) ; break ; case "PtgMemArea" : break ; case "PtgAttrSpace" : case "PtgAttrSpaceSemi" : last _sp = ff ; break ; case "PtgTbl" : break ; case "PtgMemErr" : break ; case "PtgMissArg" : stack . push ( "" ) ; break ; case "PtgAreaErr" : stack . push ( "#REF!" ) ; break ; case "PtgMemFunc" : break ; default : throw new Error ( "Unrecognized Formula Token: " + String ( f ) ) } var PtgNonDisp = [ "PtgAttrSpace" , "PtgAttrSpaceSemi" , "PtgAttrGoto" ] ; if ( last _sp >= 0 && PtgNonDisp . indexOf ( formula [ 0 ] [ ff ] [ 0 ] ) == - 1 ) { f = formula [ 0 ] [ last _sp ] ; var _left = true ; switch ( f [ 1 ] [ 0 ] ) { case 4 : _left = false ; case 0 : sp = fill ( " " , f [ 1 ] [ 1 ] ) ; 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 : " WIND
break ; case "d" : if ( ! opts . cellDates ) { p . v = datenum ( parseDate ( p . v ) ) ; p . t = "n" } break ; case "e" : p . w = p . v ; p . v = RBErr [ p . v ] ; break } fmtid = fillid = 0 ; if ( do _format && tag . s !== undefined ) { cf = styles . CellXf [ tag . s ] ; if ( cf != null ) { if ( cf . numFmtId != null ) fmtid = cf . numFmtId ; if ( opts . cellStyles && cf . fillId != null ) fillid = cf . fillId } } safe _format ( p , fmtid , fillid , opts , themes , styles ) ; if ( opts . cellDates && do _format && p . t == "n" && SSF . is _date ( SSF . _table [ fmtid ] ) ) { var _d = SSF . parse _date _code ( p . v ) ; if ( _d ) { p . t = "d" ; p . v = new Date ( Date . UTC ( _d . y , _d . m - 1 , _d . d , _d . H , _d . M , _d . S , _d . u ) ) } } s [ tag . r ] = p } } } } ( ) ; function write _ws _xml _data ( ws , opts , idx , wb ) { var o = [ ] , r = [ ] , range = safe _decode _range ( ws [ "!ref" ] ) , cell , ref , rr = "" , cols = [ ] , R = 0 , C = 0 ; 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 ; if ( ws [ ref ] === undefined ) continue ; if ( ( cell = write _ws _xml _cell ( ws [ ref ] , ref , ws , opts , idx , wb ) ) != null ) r . push ( cell ) } if ( r . length > 0 ) o [ o . length ] = writextag ( "row" , r . join ( "" ) , { r : rr } ) } 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 ) { var o = [ XML _HEADER , WS _XML _ROOT ] ; var s = wb . SheetNames [ idx ] , sidx = 0 , rdata = "" ; var ws = wb . Sheets [ s ] ; if ( ws === undefined ) ws = { } ; var ref = ws [ "!ref" ] ; if ( ref === undefined ) ref = "A1" ; o [ o . length ] = writextag ( "dimension" , null , { ref : ref } ) ; if ( ws [ "!cols" ] !== undefined && ws [ "!cols" ] . length > 0 ) o [ o . length ] = write _ws _xml _cols ( ws , ws [ "!cols" ] ) ; o [ sidx = o . length ] = "<sheetData/>" ; if ( ws [ "!ref" ] !== undefined ) { rdata = write _ws _xml _data ( ws , opts , idx , wb ) ; if ( rdata . length > 0 ) o [ o . length ] = rdata } if ( o . length > sidx + 1 ) { o [ o . length ] = "</sheetData>" ; o [ sidx ] = o [ sidx ] . replace ( "/>" , ">" ) } if ( ws [ "!merges" ] !== undefined && ws [ "!merges" ] . length > 0 ) o [ o . length ] = write _ws _xml _merges ( ws [ "!merges" ] ) ; 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 ; if ( ws [ encode _cell ( caddr ) ] ) { 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 parse _BrtCellBlank ( data , length ) { var cell = parse _XLSBCell ( data ) ; return [ cell ] } function write _BrtCellBlank ( cell , ncell , o ) { if ( o == null ) o = new _buf ( 8 ) ; return write _XLSBCell ( ncell , o ) } function parse _BrtCellBool ( data , length ) { var cell = parse _XLSBCell ( data ) ; var fBool = data . read _shift ( 1 ) ; return [ cell , fBool , "b" ] } function write _BrtCellBool ( cell , ncell , o ) { if ( o == null ) o = new _buf ( 9 ) ; write _XLSBCell ( ncell , o ) ; o . write _shift ( 1 , cell . v ? 1 : 0 ) ; return o } function parse _BrtCellError ( data , length ) { var cell = parse _XLSBCell ( data ) ; var bError = data . read _shift ( 1 ) ; return [ cell , bError , "e" ] } function parse _BrtCellIsst ( data , length ) { var cell = parse _XLSBCell ( data ) ; var isst = data . read _shift ( 4 ) ; return [ cell , isst , "s" ] } function write _BrtCellIsst ( cell , ncell , o ) { if ( o == null ) o = new _buf ( 12 ) ; write _XLSBCell ( ncell , o ) ; o . write _shift ( 4 , ncell . v ) ; return o } function parse _BrtCellReal ( data , length ) { var cell = parse _XLSBCell ( data ) ; var value = parse _Xnum ( data ) ; return [ cell , value , "n" ] } function write _BrtCellReal ( cell , ncell , o ) { if ( o == null ) o = new _buf ( 16 ) ; write _XLSBCell ( ncell , o ) ; write _Xnum ( cell . v , o ) ; return o } function parse _BrtCellRk ( data , length ) { var cell = parse _XLSBCell ( data ) ; var value = parse _RkNumber ( data ) ; return [ cell , value , "n" ] } function write _BrtCellRk ( cell , ncell , o ) { if ( o == null ) o = new _buf ( 12 ) ; write _XLSBCell ( ncell , o ) ; write _RkNumber ( cell . v , o ) ; return o } function parse _BrtC
var rr = r + ( parseInt ( cell . MergeDown , 10 ) | 0 ) ; mergecells . push ( { s : { c : c , r : r } , e : { c : cc , r : rr } } ) } if ( ! opts . sheetStubs ) { if ( cell . MergeAcross ) c = cc + 1 ; else ++ c } else if ( cell . MergeAcross || cell . MergeDown ) { for ( var cma = c ; cma <= cc ; ++ cma ) { for ( var cmd = r ; cmd <= rr ; ++ cmd ) { if ( cma > c || cmd > r ) cursheet [ encode _col ( cma ) + encode _row ( cmd ) ] = { t : "z" } } } c = cc + 1 } else ++ c } else { cell = xlml _parsexmltagobj ( Rn [ 0 ] ) ; if ( cell . Index ) c = + cell . Index - 1 ; if ( c < refguess . s . c ) refguess . s . c = c ; if ( c > refguess . e . c ) refguess . e . c = c ; if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) ++ c ; comments = [ ] } break ; case "Row" : if ( Rn [ 1 ] === "/" || Rn [ 0 ] . slice ( - 2 ) === "/>" ) { if ( r < refguess . s . r ) refguess . s . r = r ; if ( r > refguess . e . r ) refguess . e . r = r ; if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) { row = xlml _parsexmltag ( Rn [ 0 ] ) ; if ( row . Index ) r = + row . Index - 1 } c = 0 ; ++ r } else { row = xlml _parsexmltag ( Rn [ 0 ] ) ; if ( row . Index ) r = + row . Index - 1 } break ; case "Worksheet" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) ; sheetnames . push ( sheetname ) ; if ( refguess . s . r <= refguess . e . r && refguess . s . c <= refguess . e . c ) cursheet [ "!ref" ] = encode _range ( refguess ) ; if ( mergecells . length ) cursheet [ "!merges" ] = mergecells ; if ( cstys . length > 0 ) cursheet [ "!cols" ] = cstys ; if ( rowinfo . length > 0 ) cursheet [ "!rows" ] = rowinfo ; sheets [ sheetname ] = cursheet } else { refguess = { s : { r : 2e6 , c : 2e6 } , e : { r : 0 , c : 0 } } ; r = c = 0 ; state . push ( [ Rn [ 3 ] , false ] ) ; tmp = xlml _parsexmltag ( Rn [ 0 ] ) ; sheetname = unescapexml ( tmp . Name ) ; cursheet = { } ; mergecells = [ ] ; arrayf = [ ] ; rowinfo = [ ] } break ; case "Table" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) } else if ( Rn [ 0 ] . slice ( - 2 ) == "/>" ) break ; else { table = xlml _parsexmltag ( Rn [ 0 ] ) ; state . push ( [ Rn [ 3 ] , false ] ) ; cstys = [ ] ; seencol = false } break ; case "Style" : if ( Rn [ 1 ] === "/" ) process _style _xlml ( styles , stag , opts ) ; else stag = xlml _parsexmltag ( Rn [ 0 ] ) ; break ; case "NumberFormat" : stag . nf = unescapexml ( xlml _parsexmltag ( Rn [ 0 ] ) . Format || "General" ) ; if ( XLMLFormatMap [ stag . nf ] ) stag . nf = XLMLFormatMap [ stag . nf ] ; for ( var ssfidx = 0 ; ssfidx != 392 ; ++ ssfidx ) if ( SSF . _table [ ssfidx ] == stag . nf ) break ; if ( ssfidx == 392 ) for ( ssfidx = 57 ; ssfidx != 392 ; ++ ssfidx ) if ( SSF . _table [ ssfidx ] == null ) { SSF . load ( stag . nf , ssfidx ) ; break } break ; case "Column" : if ( state [ state . length - 1 ] [ 0 ] !== "Table" ) break ; csty = xlml _parsexmltag ( Rn [ 0 ] ) ; csty . wpx = parseInt ( csty . Width , 10 ) ; if ( ! seencol && csty . wpx > 10 ) { seencol = true ; find _mdw _wpx ( csty . wpx ) ; for ( var _col = 0 ; _col < cstys . length ; ++ _col ) if ( cstys [ _col ] ) process _col ( cstys [ _col ] ) } if ( seencol ) process _col ( csty ) ; cstys [ csty . Index - 1 || cstys . length ] = csty ; for ( var i = 0 ; i < + csty . Span ; ++ i ) cstys [ cstys . length ] = dup ( csty ) ; break ; case "NamedRange" : break ; case "NamedCell" : break ; case "B" : break ; case "I" : break ; case "U" : break ; case "S" : break ; case "Sub" : break ; case "Sup" : break ; case "Span" : break ; case "Border" : break ; case "Alignment" : break ; case "Borders" : break ; case "Font" : if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) break ; else if ( Rn [ 1 ] === "/" ) ss += str . slice ( fidx , Rn . index ) ; else fidx = Rn . index + Rn [ 0 ] . length ; break ; case "Interior" : if ( ! opts . cellStyles ) break ; stag . Interior = xlml _parsexmltag ( Rn [ 0 ] ) ; break ; case "Protection" : break ; case "Author" : case "Title" : case "Description" : case "Created" : case "Keywords" : case "Subject" : case "Category" : case "Company" : case "LastAuthor" : case "LastSaved" : case "LastPrinted" : case "Version" : case "Revision" : case "TotalTime" : case "HyperlinkBase" : case "Manager" : if ( Rn [ 0 ] . slice ( - 2 ) === "/>" ) break ; else if ( Rn [ 1 ] === "/" ) xlml _set _prop ( Props , Rn [ 3 ] , str . slice ( pidx , Rn . index ) ) ; else pidx = Rn . index + Rn [ 0 ] . length ; break ; case "Paragraphs" : break ; case "Styles" : case "Workbook" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) } else state . push ( [ Rn [ 3 ] , false ] ) ; break ; case "Comment" : if ( Rn [ 1 ] === "/" ) { if ( ( tmp = state . pop ( ) ) [ 0 ] !== Rn [ 3 ] ) throw new Error ( "Bad state: " + tmp . join ( "|" ) ) ; xlml _clean _comment ( comment ) ; comments . push ( comment ) } else { state . push ( [ Rn [ 3 ] , false ] ) ; tmp = xlml _parsexmltag ( Rn [ 0 ] ) ; comment = { a : tmp . Author } } break ; case "Name" : break ; case "ComponentOptions" : case "DocumentProperties" : case "CustomDocumentProperties" : case "OfficeDocumentSettings" : case "PivotTable" : case "PivotCache" : case "Names" : case "MapInfo" : case "PageBreaks" : case "QueryTable" : case "DataValidation" : case "AutoFilter" : case "Sorting" : case "Schema" : case "data" : case "ConditionalFormatting" : case "SmartTagType" : case "SmartTags" : case "ExcelWorkbook" : case "WorkbookOptions" : case
return Number ( a ) - Number ( b ) } ) . map ( function ( x ) { return Directory [ x ] . name } ) ; var sheetnames = sheetnamesraw . slice ( ) ; wb . Directory = sheetnamesraw ; wb . SheetNames = sheetnamesraw ; if ( ! options . bookSheets ) wb . Sheets = Sheets ; wb . Preamble = Preamble ; wb . Strings = sst ; wb . SSF = SSF . get _table ( ) ; if ( opts . enc ) wb . Encryption = opts . enc ; wb . Metadata = { } ; if ( country !== undefined ) wb . Metadata . Country = country ; return wb } function parse _xlscfb ( cfb , options ) { if ( ! options ) options = { } ; fix _read _opts ( options ) ; reset _cp ( ) ; var CompObj , Summary , Workbook ; if ( cfb . FullPaths ) { CompObj = cfb . find ( "!CompObj" ) ; Summary = cfb . find ( "!SummaryInformation" ) ; Workbook = cfb . find ( "/Workbook" ) } else { prep _blob ( cfb , 0 ) ; Workbook = { content : cfb } } if ( ! Workbook ) Workbook = cfb . find ( "/Book" ) ; var CompObjP , SummaryP , WorkbookP ; if ( CompObj ) CompObjP = parse _compobj ( CompObj ) ; if ( options . bookProps && ! options . bookSheets ) WorkbookP = { } ; else { if ( Workbook ) WorkbookP = parse _workbook ( Workbook . content , options , ! ! Workbook . find ) ; else throw new Error ( "Cannot find Workbook stream" ) } if ( cfb . FullPaths ) parse _props ( cfb ) ; var props = { } ; for ( var y in cfb . Summary ) props [ y ] = cfb . Summary [ y ] ; for ( y in cfb . DocSummary ) props [ y ] = cfb . DocSummary [ y ] ; WorkbookP . Props = WorkbookP . Custprops = props ; if ( options . bookFiles ) WorkbookP . cfb = cfb ; return WorkbookP } function parse _props ( cfb ) { var DSI = cfb . find ( "!DocumentSummaryInformation" ) ; if ( DSI ) try { cfb . DocSummary = parse _PropertySetStream ( DSI , DocSummaryPIDDSI ) } catch ( e ) { } var SI = cfb . find ( "!SummaryInformation" ) ; if ( SI ) try { cfb . Summary = parse _PropertySetStream ( SI , SummaryPIDSI ) } catch ( e ) { } } var XLSBRecordEnum = { 0 : { n : "BrtRowHdr" , f : parse _BrtRowHdr } , 1 : { n : "BrtCellBlank" , f : parse _BrtCellBlank } , 2 : { n : "BrtCellRk" , f : parse _BrtCellRk } , 3 : { n : "BrtCellError" , f : parse _BrtCellError } , 4 : { n : "BrtCellBool" , f : parse _BrtCellBool } , 5 : { n : "BrtCellReal" , f : parse _BrtCellReal } , 6 : { n : "BrtCellSt" , f : parse _BrtCellSt } , 7 : { n : "BrtCellIsst" , f : parse _BrtCellIsst } , 8 : { n : "BrtFmlaString" , f : parse _BrtFmlaString } , 9 : { n : "BrtFmlaNum" , f : parse _BrtFmlaNum } , 10 : { n : "BrtFmlaBool" , f : parse _BrtFmlaBool } , 11 : { n : "BrtFmlaError" , f : parse _BrtFmlaError } , 16 : { n : "BrtFRTArchID$" , f : parse _BrtFRTArchID$ } , 19 : { n : "BrtSSTItem" , f : parse _RichStr } , 20 : { n : "BrtPCDIMissing" , f : parsenoop } , 21 : { n : "BrtPCDINumber" , f : parsenoop } , 22 : { n : "BrtPCDIBoolean" , f : parsenoop } , 23 : { n : "BrtPCDIError" , f : parsenoop } , 24 : { n : "BrtPCDIString" , f : parsenoop } , 25 : { n : "BrtPCDIDatetime" , f : parsenoop } , 26 : { n : "BrtPCDIIndex" , f : parsenoop } , 27 : { n : "BrtPCDIAMissing" , f : parsenoop } , 28 : { n : "BrtPCDIANumber" , f : parsenoop } , 29 : { n : "BrtPCDIABoolean" , f : parsenoop } , 30 : { n : "BrtPCDIAError" , f : parsenoop } , 31 : { n : "BrtPCDIAString" , f : parsenoop } , 32 : { n : "BrtPCDIADatetime" , f : parsenoop } , 33 : { n : "BrtPCRRecord" , f : parsenoop } , 34 : { n : "BrtPCRRecordDt" , f : parsenoop } , 35 : { n : "BrtFRTBegin" , f : parsenoop } , 36 : { n : "BrtFRTEnd" , f : parsenoop } , 37 : { n : "BrtACBegin" , f : parsenoop } , 38 : { n : "BrtACEnd" , f : parsenoop } , 39 : { n : "BrtName" , f : parse _BrtName } , 40 : { n : "BrtIndexRowBlock" , f : parsenoop } , 42 : { n : "BrtIndexBlock" , f : parsenoop } , 43 : { n : "BrtFont" , f : parse _BrtFont } , 44 : { n : "BrtFmt" , f : parse _BrtFmt } , 45 : { n : "BrtFill" , f : parsenoop } , 46 : { n : "BrtBorder" , f : parsenoop } , 47 : { n : "BrtXF" , f : parse _BrtXF } , 48 : { n : "BrtStyle" , f : parsenoop } , 49 : { n : "BrtCellMeta" , f : parsenoop } , 50 : { n : "BrtValueMeta" , f : parsenoop } , 51 : { n : "BrtMdb" , f : parsenoop } , 52 : { n : "BrtBeginFmd" , f : parsenoop } , 53 : { n : "BrtEndFmd" , f : parsenoop } , 54 : { n : "BrtBeginMdx" , f : parsenoop } , 55 : { n : "BrtEndMdx" , f : parsenoop } , 56 : { n : "BrtBeginMdxTuple" , f : parsenoop } , 57 : { n : "BrtEndMdxTuple" , f : parsenoop } , 58 : { n : "BrtMdxMbrIstr" , f : parsenoop } , 59 : { n : "BrtStr" , f : parsenoop } , 60 : { n : "BrtColInfo" , f : parse _ColInfo } , 62 : { n : "BrtCellRString" , f : parsenoop } , 63 : { n : "BrtCalcChainItem$" , f : parse _BrtCalcChainItem$ } , 64 : { n : "BrtDVal" , f : parsenoop } , 65 : { n : "BrtSxvcellNum" , f : parsenoop } , 66 : { n : "BrtSxvcellStr" , f : parsenoop } , 67 : { n : "BrtSxvcellBool" , f : parsenoop } , 68 : { n : "BrtSxvcellErr" , f : parsenoop } , 69 : { n : "BrtSxvcellDate" , f : parsenoop } , 70 : { n : "BrtSxvcellNil" , f : parsenoop } , 128 : { n : "BrtFileVersion" , f : parsenoop } , 129 : { n : "BrtBeginSheet" , f : parsenoop } , 130 : { n : "BrtEndSheet" , f : parsenoop } , 131 : { n : "BrtBeginBook" , f : parsenoop , p : 0 } , 132 : { n : "BrtEndBook" , f : parsenoop } , 133 : { n : "BrtBeginWsViews" , f : parsenoop } , 134 : { n : "BrtEndWsViews" , f : parsenoop } , 135 : { n : "BrtBeginBookViews" , f : parsenoop } , 136 : { n : "BrtEndBookViews" , f : parsenoop } , 137 : { n : "BrtBeginWsView" , f : pars
n : "BrtBeginTimelineStyles" , f : parsenoop } , 2099 : { n : "BrtEndTimelineStyles" , f : parsenoop } , 2100 : { n : "BrtBeginTimelineStyleElements" , f : parsenoop } , 2101 : { n : "BrtEndTimelineStyleElements" , f : parsenoop } , 2102 : { n : "BrtDxf15" , f : parsenoop } , 2103 : { n : "BrtBeginDxfs15" , f : parsenoop } , 2104 : { n : "brtEndDxfs15" , f : parsenoop } , 2105 : { n : "BrtSlicerCacheHideItemsWithNoData" , f : parsenoop } , 2106 : { n : "BrtBeginItemUniqueNames" , f : parsenoop } , 2107 : { n : "BrtEndItemUniqueNames" , f : parsenoop } , 2108 : { n : "BrtItemUniqueName" , f : parsenoop } , 2109 : { n : "BrtBeginExtConn15" , f : parsenoop } , 2110 : { n : "BrtEndExtConn15" , f : parsenoop } , 2111 : { n : "BrtBeginOledbPr15" , f : parsenoop } , 2112 : { n : "BrtEndOledbPr15" , f : parsenoop } , 2113 : { n : "BrtBeginDataFeedPr15" , f : parsenoop } , 2114 : { n : "BrtEndDataFeedPr15" , f : parsenoop } , 2115 : { n : "BrtTextPr15" , f : parsenoop } , 2116 : { n : "BrtRangePr15" , f : parsenoop } , 2117 : { n : "BrtDbCommand15" , f : parsenoop } , 2118 : { n : "BrtBeginDbTables15" , f : parsenoop } , 2119 : { n : "BrtEndDbTables15" , f : parsenoop } , 2120 : { n : "BrtDbTable15" , f : parsenoop } , 2121 : { n : "BrtBeginDataModel" , f : parsenoop } , 2122 : { n : "BrtEndDataModel" , f : parsenoop } , 2123 : { n : "BrtBeginModelTables" , f : parsenoop } , 2124 : { n : "BrtEndModelTables" , f : parsenoop } , 2125 : { n : "BrtModelTable" , f : parsenoop } , 2126 : { n : "BrtBeginModelRelationships" , f : parsenoop } , 2127 : { n : "BrtEndModelRelationships" , f : parsenoop } , 2128 : { n : "BrtModelRelationship" , f : parsenoop } , 2129 : { n : "BrtBeginECTxtWiz15" , f : parsenoop } , 2130 : { n : "BrtEndECTxtWiz15" , f : parsenoop } , 2131 : { n : "BrtBeginECTWFldInfoLst15" , f : parsenoop } , 2132 : { n : "BrtEndECTWFldInfoLst15" , f : parsenoop } , 2133 : { n : "BrtBeginECTWFldInfo15" , f : parsenoop } , 2134 : { n : "BrtFieldListActiveItem" , f : parsenoop } , 2135 : { n : "BrtPivotCacheIdVersion" , f : parsenoop } , 2136 : { n : "BrtSXDI15" , f : parsenoop } , 65535 : { n : "" , f : parsenoop } } ; var evert _RE = evert _key ( XLSBRecordEnum , "n" ) ; var XLSRecordEnum = { 3 : { n : "BIFF2NUM" , f : parse _BIFF2NUM } , 4 : { n : "BIFF2STR" , f : parse _BIFF2STR } , 6 : { n : "Formula" , f : parse _Formula } , 9 : { n : "BOF" , f : parse _BOF } , 10 : { n : "EOF" , f : parse _EOF } , 12 : { n : "CalcCount" , f : parse _CalcCount } , 13 : { n : "CalcMode" , f : parse _CalcMode } , 14 : { n : "CalcPrecision" , f : parse _CalcPrecision } , 15 : { n : "CalcRefMode" , f : parse _CalcRefMode } , 16 : { n : "CalcDelta" , f : parse _CalcDelta } , 17 : { n : "CalcIter" , f : parse _CalcIter } , 18 : { n : "Protect" , f : parse _Protect } , 19 : { n : "Password" , f : parse _Password } , 20 : { n : "Header" , f : parse _Header } , 21 : { n : "Footer" , f : parse _Footer } , 23 : { n : "ExternSheet" , f : parse _ExternSheet } , 24 : { n : "Lbl" , f : parse _Lbl } , 25 : { n : "WinProtect" , f : parse _WinProtect } , 26 : { n : "VerticalPageBreaks" , f : parse _VerticalPageBreaks } , 27 : { n : "HorizontalPageBreaks" , f : parse _HorizontalPageBreaks } , 28 : { n : "Note" , f : parse _Note } , 29 : { n : "Selection" , f : parse _Selection } , 34 : { n : "Date1904" , f : parse _Date1904 } , 35 : { n : "ExternName" , f : parse _ExternName } , 38 : { n : "LeftMargin" , f : parse _LeftMargin } , 39 : { n : "RightMargin" , f : parse _RightMargin } , 40 : { n : "TopMargin" , f : parse _TopMargin } , 41 : { n : "BottomMargin" , f : parse _BottomMargin } , 42 : { n : "PrintRowCol" , f : parse _PrintRowCol } , 43 : { n : "PrintGrid" , f : parse _PrintGrid } , 47 : { n : "FilePass" , f : parse _FilePass } , 49 : { n : "Font" , f : parse _Font } , 51 : { n : "PrintSize" , f : parse _PrintSize } , 60 : { n : "Continue" , f : parse _Continue } , 61 : { n : "Window1" , f : parse _Window1 } , 64 : { n : "Backup" , f : parse _Backup } , 65 : { n : "Pane" , f : parse _Pane } , 66 : { n : "CodePage" , f : parse _CodePage } , 77 : { n : "Pls" , f : parse _Pls } , 80 : { n : "DCon" , f : parse _DCon } , 81 : { n : "DConRef" , f : parse _DConRef } , 82 : { n : "DConName" , f : parse _DConName } , 85 : { n : "DefColWidth" , f : parse _DefColWidth } , 89 : { n : "XCT" , f : parse _XCT } , 90 : { n : "CRN" , f : parse _CRN } , 91 : { n : "FileSharing" , f : parse _FileSharing } , 92 : { n : "WriteAccess" , f : parse _WriteAccess } , 93 : { n : "Obj" , f : parse _Obj } , 94 : { n : "Uncalced" , f : parse _Uncalced } , 95 : { n : "CalcSaveRecalc" , f : parse _CalcSaveRecalc } , 96 : { n : "Template" , f : parse _Template } , 97 : { n : "Intl" , f : parse _Intl } , 99 : { n : "ObjProtect" , f : parse _ObjProtect } , 125 : { n : "ColInfo" , f : parse _ColInfo } , 128 : { n : "Guts" , f : parse _Guts } , 129 : { n : "WsBool" , f : parse _WsBool } , 130 : { n : "GridSet" , f : parse _GridSet } , 131 : { n : "HCenter" , f : parse _HCenter } , 132 : { n : "VCenter" , f : parse _VCenter } , 133 : { n : "BoundSheet8" , f : parse _BoundSheet8 } , 134 : { n : "WriteProtect" , f : parse _WriteProtect } , 140 : { n : "Country" , f : parse _Country } , 141 : { n : "HideObj" , f : parse _HideObj } , 144 : { n : "Sort" , f : parse _Sort } , 146 : { n : "Palette" , f : parse _Palette } , 151 : { n : "Sync" , f : parse _Sync } , 152 : { n : "LPr" , f : parse _LPr } , 153 : { n : "DxGCol" , f : parse _DxGCol
o . push ( " <office:body>\n" ) ; o . push ( " <office:spreadsheet>\n" ) ; for ( var i = 0 ; i != wb . SheetNames . length ; ++ i ) o . push ( write _ws ( wb . Sheets [ wb . SheetNames [ i ] ] , wb , i , opts ) ) ; o . push ( " </office:spreadsheet>\n" ) ; o . push ( " </office:body>\n" ) ; if ( opts . bookType == "fods" ) o . push ( "</office:document>" ) ; else o . push ( "</office:document-content>" ) ; return o . join ( "" ) } } ( ) ; function write _csv _str ( wb , o ) { var idx = 0 ; for ( var i = 0 ; i < wb . SheetNames . length ; ++ i ) if ( wb . SheetNames [ i ] == o . sheet ) idx = i ; if ( idx == 0 && ! ! o . sheet && wb . SheetNames [ 0 ] != o . sheet ) throw new Error ( "Sheet not found: " + o . sheet ) ; return sheet _to _csv ( wb . Sheets [ wb . SheetNames [ idx ] ] , o ) } function parse _ods ( zip , opts ) { opts = opts || { } ; var ods = ! ! safegetzipfile ( zip , "objectdata" ) ; if ( ods ) var manifest = parse _manifest ( getzipdata ( zip , "META-INF/manifest.xml" ) , opts ) ; var content = getzipstr ( zip , "content.xml" ) ; if ( ! content ) throw new Error ( "Missing content.xml in " + ( ods ? "ODS" : "UOF" ) + " file" ) ; return parse _content _xml ( ods ? content : utf8read ( content ) , opts ) } function parse _fods ( data , opts ) { return parse _content _xml ( data , opts ) } function write _ods ( wb , opts ) { if ( opts . bookType == "fods" ) return write _content _xml ( wb , opts ) ; var zip = new jszip ; var f = "" ; var manifest = [ ] ; var rdf = [ ] ; f = "mimetype" ; zip . file ( f , "application/vnd.oasis.opendocument.spreadsheet" ) ; f = "content.xml" ; zip . file ( f , write _content _xml ( wb , opts ) ) ; manifest . push ( [ f , "text/xml" ] ) ; rdf . push ( [ f , "ContentFile" ] ) ; f = "manifest.rdf" ; zip . file ( f , write _rdf ( rdf , opts ) ) ; manifest . push ( [ f , "application/rdf+xml" ] ) ; f = "META-INF/manifest.xml" ; zip . file ( f , write _manifest ( manifest , opts ) ) ; return zip } function fix _opts _func ( defaults ) { return function fix _opts ( opts ) { for ( var i = 0 ; i != defaults . length ; ++ i ) { var d = defaults [ i ] ; if ( opts [ d [ 0 ] ] === undefined ) opts [ d [ 0 ] ] = d [ 1 ] ; if ( d [ 2 ] === "n" ) opts [ d [ 0 ] ] = Number ( opts [ d [ 0 ] ] ) } } } var fix _read _opts = fix _opts _func ( [ [ "cellNF" , false ] , [ "cellHTML" , true ] , [ "cellFormula" , true ] , [ "cellStyles" , false ] , [ "cellDates" , false ] , [ "sheetStubs" , false ] , [ "sheetRows" , 0 , "n" ] , [ "bookDeps" , false ] , [ "bookSheets" , false ] , [ "bookProps" , false ] , [ "bookFiles" , false ] , [ "bookVBA" , false ] , [ "password" , "" ] , [ "WTF" , false ] ] ) ; var fix _write _opts = fix _opts _func ( [ [ "cellDates" , false ] , [ "bookSST" , false ] , [ "bookType" , "xlsx" ] , [ "compression" , false ] , [ "WTF" , false ] ] ) ; function safe _parse _wbrels ( wbrels , sheets ) { if ( ! wbrels ) return 0 ; try { wbrels = sheets . map ( function pwbr ( w ) { return [ w . name , wbrels [ "!id" ] [ w . id ] . Target ] } ) } catch ( e ) { return null } return ! wbrels || wbrels . length === 0 ? null : wbrels } function safe _parse _ws ( zip , path , relsPath , sheet , sheetRels , sheets , opts , wb , themes , styles ) { try { sheetRels [ sheet ] = parse _rels ( getzipstr ( zip , relsPath , true ) , path ) ; sheets [ sheet ] = parse _ws ( getzipdata ( zip , path ) , path , opts , sheetRels [ sheet ] , wb , themes , styles ) } catch ( e ) { if ( opts . WTF ) throw e } } var nodirs = function nodirs ( x ) { return x . slice ( - 1 ) != "/" } ; function parse _zip ( zip , opts ) { make _ssf ( SSF ) ; opts = opts || { } ; fix _read _opts ( opts ) ; reset _cp ( ) ; if ( safegetzipfile ( zip , "META-INF/manifest.xml" ) ) return parse _ods ( zip , opts ) ; if ( safegetzipfile ( zip , "objectdata.xml" ) ) return parse _ods ( zip , opts ) ; var entries = keys ( zip . files ) . filter ( nodirs ) . sort ( ) ; var dir = parse _ct ( getzipstr ( zip , "[Content_Types].xml" ) , opts ) ; var xlsb = false ; var sheets , binname ; if ( dir . workbooks . length === 0 ) { binname = "xl/workbook.xml" ; if ( getzipdata ( zip , binname , true ) ) dir . workbooks . push ( binname ) } if ( dir . workbooks . length === 0 ) { binname = "xl/workbook.bin" ; if ( ! getzipfile ( zip , binname , true ) ) throw new Error ( "Could not find workbook" ) ; dir . workbooks . push ( binname ) ; xlsb = true } if ( dir . workbooks [ 0 ] . slice ( - 3 ) == "bin" ) xlsb = true ; if ( xlsb ) set _cp ( 1200 ) ; var themes = { } ; var styles = { } ; if ( ! opts . bookSheets && ! opts . bookProps ) { strs = [ ] ; if ( dir . sst ) strs = parse _sst ( getzipdata ( zip , dir . sst . replace ( /^\// , "" ) ) , dir . sst , opts ) ; if ( opts . cellStyles && dir . themes . length ) themes = parse _theme ( getzipstr ( zip , dir . themes [ 0 ] . replace ( /^\// , "" ) , true ) || "" , dir . themes [ 0 ] , opts ) ; if ( dir . style ) styles = parse _sty ( getzipdata ( zip , dir . style . replace ( /^\// , "" ) ) , dir . style , themes , opts ) } var wb = parse _wb ( getzipdata ( zip , dir . workbooks [ 0 ] . replace ( /^\// , "" ) ) , dir . workbooks [ 0 ] , opts ) ; var props = { } , propdata = "" ; if ( dir . coreprops . length !== 0 ) { propdata = getzipstr ( zip , dir . coreprops [ 0 ] . replace ( /^\// , "" ) , true ) ; if ( propdata ) props = parse _core _props ( propdata ) ; if ( dir . extprops . length !== 0 ) { propdata