2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-04-16 07:31:21 +00:00
var XLSX = { } ; ( function make _xlsx ( XLSX ) { XLSX . version = "0.9.11" ; var current _codepage = 1200 , current _cptable ; if ( typeof module !== "undefined" && typeof require !== "undefined" ) { if ( typeof cptable === "undefined" ) cptable = require ( "./dist/cpexcel.js" ) ; current _cptable = cptable [ current _codepage ] } function reset _cp ( ) { set _cp ( 1200 ) } var set _cp = function ( cp ) { current _codepage = cp } ; function char _codes ( data ) { var o = [ ] ; for ( var i = 0 , len = data . length ; i < len ; ++ i ) o [ i ] = data . charCodeAt ( i ) ; return o } var debom = function ( data ) { var c1 = data . charCodeAt ( 0 ) , c2 = data . charCodeAt ( 1 ) ; if ( c1 == 255 && c2 == 254 ) return data . substr ( 2 ) ; if ( c1 == 254 && c2 == 255 ) return data . substr ( 2 ) ; if ( c1 == 65279 ) return data . substr ( 1 ) ; return data } ; var _getchar = function _gc1 ( x ) { return String . fromCharCode ( x ) } ; if ( typeof cptable !== "undefined" ) { set _cp = function ( cp ) { current _codepage = cp ; current _cptable = cptable [ cp ] } ; debom = function ( data ) { if ( data . charCodeAt ( 0 ) === 255 && data . charCodeAt ( 1 ) === 254 ) { return cptable . utils . decode ( 1200 , char _codes ( data . substr ( 2 ) ) ) } return data } ; _getchar = function _gc2 ( x ) { if ( current _codepage === 1200 ) return String . fromCharCode ( x ) ; return cptable . utils . decode ( current _codepage , [ x & 255 , x >> 8 ] ) [ 0 ] } } var DENSE = null ; var Base64 = function make _b64 ( ) { var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; return { encode : function ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 , e1 , e2 , e3 , e4 ; for ( var i = 0 ; i < input . length ; ) { c1 = input . charCodeAt ( i ++ ) ; c2 = input . charCodeAt ( i ++ ) ; c3 = input . charCodeAt ( i ++ ) ; e1 = c1 >> 2 ; e2 = ( c1 & 3 ) << 4 | c2 >> 4 ; e3 = ( c2 & 15 ) << 2 | c3 >> 6 ; e4 = c3 & 63 ; if ( isNaN ( c2 ) ) { e3 = e4 = 64 } else if ( isNaN ( c3 ) ) { e4 = 64 } o += map . charAt ( e1 ) + map . charAt ( e2 ) + map . charAt ( e3 ) + map . charAt ( e4 ) } return o } , decode : function b64 _decode ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 ; var e1 , e2 , e3 , e4 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; for ( var i = 0 ; i < input . length ; ) { e1 = map . indexOf ( input . charAt ( i ++ ) ) ; e2 = map . indexOf ( input . charAt ( i ++ ) ) ; e3 = map . indexOf ( input . charAt ( i ++ ) ) ; e4 = map . indexOf ( input . charAt ( i ++ ) ) ; c1 = e1 << 2 | e2 >> 4 ; c2 = ( e2 & 15 ) << 4 | e3 >> 2 ; c3 = ( e3 & 3 ) << 6 | e4 ; o += String . fromCharCode ( c1 ) ; if ( e3 != 64 ) { o += String . fromCharCode ( c2 ) } if ( e4 != 64 ) { o += String . fromCharCode ( c3 ) } } return o } } } ( ) ; var has _buf = typeof Buffer !== "undefined" && typeof process !== "undefined" && typeof process . versions !== "undefined" && process . versions . node ; function new _raw _buf ( len ) { return new ( has _buf ? Buffer : Array ) ( len ) } function s2a ( s ) { if ( has _buf ) return new Buffer ( s , "binary" ) ; return s . split ( "" ) . map ( function ( x ) { return x . charCodeAt ( 0 ) & 255 } ) } var bconcat = function ( bufs ) { return [ ] . concat . apply ( [ ] , bufs ) } ; var chr0 = /\u0000/g , chr1 = /[\u0001-\u0006]/ ; var SSF = { } ; var make _ssf = function make _ssf ( SSF ) { SSF . version = "0.9.0" ; function _strrev ( x ) { var o = "" , i = x . length - 1 ; while ( i >= 0 ) o += x . charAt ( i -- ) ; return o } function fill ( c , l ) { var o = "" ; while ( o . length < l ) o += c ; return o } function pad0 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( " " , d - t . length ) + t } function rpad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : t + fill ( " " , d - t . length ) } function pad0r1 ( v , d ) { var t = "" + Math . round ( v ) ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad0r2 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } var p2 _32 = Math . pow ( 2 , 32 ) ; function pad0r ( v , d ) { if ( v > p2 _32 || v < - p2 _32 ) return pad0r1 ( v , d ) ; var i = Math . round ( v ) ; return pad0r2 ( i , d ) } function isgeneral ( s , i ) { i = i || 0 ; return s . length >= 7 + i && ( s . charCodeAt ( i ) | 32 ) === 103 && ( s . charCodeAt ( i + 1 ) | 32 ) === 101 && ( s . charCodeAt ( i + 2 ) | 32 ) === 110 && ( s . charCodeAt ( i + 3 ) | 32 ) === 101 && ( s . charCodeAt ( i + 4 ) | 32 ) === 114 && ( s . charCodeAt ( i + 5 ) | 32 ) === 97 && ( s . charCodeAt ( i + 6 ) | 32 ) === 108 } var opts _fmt = [ [ "date1904" , 0 ] , [ "output" , "" ] , [ "WTF" , false ] ] ; function fixopts ( o ) { for ( var y = 0 ; y != opts _fmt . length ; ++ y ) if ( o [ opts _fmt [ y ] [ 0 ] ] === undefined ) o [ opts _fmt [ y ] [ 0 ] ] = opts _fmt [ y ] [ 1 ] } SSF . opts = opts _fmt ; var table _fmt = { 0 : "General" , 1 : "0" , 2 : "0.00" , 3 : "#,##0" , 4 : "#,##0.00" , 9 : "0%" , 10 : "0.00%" , 11 : "0.00E+00" , 12 : "# ?/?" , 13 : "# ??/??" , 14 : "m/d/yy" , 15 : "d-mmm-yy" , 16 : "d-mmm" , 17 : "mmm-yy" , 18 : "h:mm AM/PM" , 19 : "h:mm:ss AM/PM" , 20 : "h:mm" , 21 : "h:mm:ss" , 22 : "m/d/yy h:mm" , 37 : "#,##0 ;(#,##0)" , 38 : "#,##0 ;[Red](#,##0)" , 39 : "#,##0.00;(#,##0.00)" , 40 : "#,##0.00;[Red](#,##0.00)" , 45 : "mm:ss" , 46 : "[h]:mm:ss" , 47 : "mmss.0" , 48 : "##0.0E+0" , 49 : "@" , 56 : '"上午/下午 "hh"時"mm"分"ss"秒 "' , 6553
if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] } if ( C !== - 1 ) dad [ C ] = i ; if ( L !== - 1 ) { dad [ L ] = dad [ i ] ; q . push ( L ) } if ( R !== - 1 ) { dad [ R ] = dad [ i ] ; q . push ( R ) } } for ( i = 1 ; i !== pl ; ++ i ) if ( dad [ i ] === i ) { if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] ; else if ( L !== - 1 && dad [ L ] !== L ) dad [ i ] = dad [ L ] } for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type === 0 ) continue ; j = dad [ i ] ; if ( j === 0 ) FP [ i ] = FP [ 0 ] + "/" + FP [ i ] ; else while ( j !== 0 ) { FP [ i ] = FP [ j ] + "/" + FP [ i ] ; j = dad [ j ] } dad [ i ] = 0 } FP [ 0 ] += "/" ; for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type !== 2 ) FP [ i ] += "/" ; FPD [ FP [ i ] ] = FI [ i ] } } function make _find _path ( FullPaths , Paths , FileIndex , files , root _name ) { var UCFullPaths = new Array ( FullPaths . length ) ; var UCPaths = new Array ( Paths . length ) , i ; for ( i = 0 ; i < FullPaths . length ; ++ i ) UCFullPaths [ i ] = FullPaths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; for ( i = 0 ; i < Paths . length ; ++ i ) UCPaths [ i ] = Paths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; return function find _path ( path ) { var k ; if ( path . charCodeAt ( 0 ) === 47 ) { k = true ; path = root _name + path } else k = path . indexOf ( "/" ) !== - 1 ; var UCPath = path . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; var w = k === true ? UCFullPaths . indexOf ( UCPath ) : UCPaths . indexOf ( UCPath ) ; if ( w === - 1 ) return null ; return k === true ? FileIndex [ w ] : files [ Paths [ w ] ] } } function sleuth _fat ( idx , cnt , sectors , ssz , fat _addrs ) { var q ; if ( idx === ENDOFCHAIN ) { if ( cnt !== 0 ) throw new Error ( "DIFAT chain shorter than expected" ) } else if ( idx !== - 1 ) { var sector = sectors [ idx ] , m = ( ssz >>> 2 ) - 1 ; if ( ! sector ) return ; for ( var i = 0 ; i < m ; ++ i ) { if ( ( q = _ _readInt32LE ( sector , i * 4 ) ) === ENDOFCHAIN ) break ; fat _addrs . push ( q ) } sleuth _fat ( _ _readInt32LE ( sector , ssz - 4 ) , cnt - 1 , sectors , ssz , fat _addrs ) } } function get _sector _list ( sectors , start , fat _addrs , ssz , chkd ) { var sl = sectors . length ; var buf , buf _chain ; if ( ! chkd ) chkd = new Array ( sl ) ; var modulus = ssz - 1 , j , jj ; buf = [ ] ; buf _chain = [ ] ; for ( j = start ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } return { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } function make _sector _list ( sectors , dir _start , fat _addrs , ssz ) { var sl = sectors . length , sector _list = new Array ( sl ) ; var chkd = new Array ( sl ) , buf , buf _chain ; var modulus = ssz - 1 , i , j , k , jj ; for ( i = 0 ; i < sl ; ++ i ) { buf = [ ] ; k = i + dir _start ; if ( k >= sl ) k -= sl ; if ( chkd [ k ] === true ) continue ; buf _chain = [ ] ; for ( j = k ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } sector _list [ k ] = { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } return sector _list } function read _directory ( dir _start , sector _list , sectors , Paths , nmfs , files , FileIndex ) { var blob ; var minifat _store = 0 , pl = Paths . length ? 2 : 0 ; var sector = sector _list [ dir _start ] . data ; var i = 0 , namelen = 0 , name , o , ctime , mtime ; for ( ; i < sector . length ; i += 128 ) { blob = sector . slice ( i , i + 128 ) ; prep _blob ( blob , 64 ) ; namelen = blob . read _shift ( 2 ) ; if ( namelen === 0 ) continue ; name = _ _utf16le ( blob , 0 , namelen - pl ) ; Paths . push ( name ) ; o = { name : name , type : blob . read _shift ( 1 ) , color : blob . read _shift ( 1 ) , L : blob . read _shift ( 4 , "i" ) , R : blob . read _shift ( 4 , "i" ) , C : blob . read _shift ( 4 , "i" ) , clsid : blob . read _shift ( 16 ) , state : blob . read _shift ( 4 , "i" ) } ; ctime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( ctime !== 0 ) { o . ctime = ctime ; o . ct = read _date ( blob , blob . l - 8 ) } mtime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( mtime !== 0 ) { o . mtime = mtime ; o . mt = read _date ( blob , blob . l - 8 ) } o . start = blob . read _shift ( 4 , "i" ) ; o . size = blob . read _shift ( 4 , "i" ) ; if ( o . type === 5 ) { minifat _store = o . start ; if ( nmfs > 0 && minifat _store !== ENDOFCHAIN ) sector _list [ minifat _store ] . name = "!StreamData" } else if ( o . size >= 4096 ) { o . storage = "fat" ; if ( sector _list [ o . start ] === undefined ) sector _list [ o . start ] = get _sector _list ( sectors , o . start , sector _list . fat _addrs , sector _list . ssz ) ; sector _list [ o . start ] . name = o . name ; o . content = sector _list [ o . start ] . data . slice ( 0 , o . size ) ; prep _blob ( o . content , 0 ) } else { o . storage = "minifat" ; if ( minifat _store !== ENDOFCHAIN && o . start !== ENDOFCHAIN ) { o . content = sector _list [ minifat _store ] . data . slice ( o . start * MSSZ , o . start * MSSZ + o . size ) ; prep _blob ( o . content , 0 ) } } files [ name ] = o ; FileIndex . p
var d = data . read _shift ( 1 ) ; data . l ++ ; var out = { fItalic : d & 2 , fStrikeout : d & 8 , fOutline : d & 16 , fShadow : d & 32 , fCondense : d & 64 , fExtend : d & 128 } ; return out } { var VT _EMPTY = 0 ; var VT _NULL = 1 ; var VT _I2 = 2 ; var VT _I4 = 3 ; var VT _R4 = 4 ; var VT _R8 = 5 ; var VT _CY = 6 ; var VT _DATE = 7 ; var VT _BSTR = 8 ; var VT _ERROR = 10 ; var VT _BOOL = 11 ; var VT _VARIANT = 12 ; var VT _DECIMAL = 14 ; var VT _I1 = 16 ; var VT _UI1 = 17 ; var VT _UI2 = 18 ; var VT _UI4 = 19 ; var VT _I8 = 20 ; var VT _UI8 = 21 ; var VT _INT = 22 ; var VT _UINT = 23 ; var VT _LPSTR = 30 ; var VT _LPWSTR = 31 ; var VT _FILETIME = 64 ; var VT _BLOB = 65 ; var VT _STREAM = 66 ; var VT _STORAGE = 67 ; var VT _STREAMED _Object = 68 ; var VT _STORED _Object = 69 ; var VT _BLOB _Object = 70 ; var VT _CF = 71 ; var VT _CLSID = 72 ; var VT _VERSIONED _STREAM = 73 ; var VT _VECTOR = 4096 ; var VT _ARRAY = 8192 ; var VT _STRING = 80 ; var VT _USTR = 81 ; var VT _CUSTOM = [ VT _STRING , VT _USTR ] } var DocSummaryPIDDSI = { 1 : { n : "CodePage" , t : VT _I2 } , 2 : { n : "Category" , t : VT _STRING } , 3 : { n : "PresentationFormat" , t : VT _STRING } , 4 : { n : "ByteCount" , t : VT _I4 } , 5 : { n : "LineCount" , t : VT _I4 } , 6 : { n : "ParagraphCount" , t : VT _I4 } , 7 : { n : "SlideCount" , t : VT _I4 } , 8 : { n : "NoteCount" , t : VT _I4 } , 9 : { n : "HiddenCount" , t : VT _I4 } , 10 : { n : "MultimediaClipCount" , t : VT _I4 } , 11 : { n : "Scale" , t : VT _BOOL } , 12 : { n : "HeadingPair" , t : VT _VECTOR | VT _VARIANT } , 13 : { n : "DocParts" , t : VT _VECTOR | VT _LPSTR } , 14 : { n : "Manager" , t : VT _STRING } , 15 : { n : "Company" , t : VT _STRING } , 16 : { n : "LinksDirty" , t : VT _BOOL } , 17 : { n : "CharacterCount" , t : VT _I4 } , 19 : { n : "SharedDoc" , t : VT _BOOL } , 22 : { n : "HLinksChanged" , t : VT _BOOL } , 23 : { n : "AppVersion" , t : VT _I4 , p : "version" } , 26 : { n : "ContentType" , t : VT _STRING } , 27 : { n : "ContentStatus" , t : VT _STRING } , 28 : { n : "Language" , t : VT _STRING } , 29 : { n : "Version" , t : VT _STRING } , 255 : { } } ; var SummaryPIDSI = { 1 : { n : "CodePage" , t : VT _I2 } , 2 : { n : "Title" , t : VT _STRING } , 3 : { n : "Subject" , t : VT _STRING } , 4 : { n : "Author" , t : VT _STRING } , 5 : { n : "Keywords" , t : VT _STRING } , 6 : { n : "Comments" , t : VT _STRING } , 7 : { n : "Template" , t : VT _STRING } , 8 : { n : "LastAuthor" , t : VT _STRING } , 9 : { n : "RevNumber" , t : VT _STRING } , 10 : { n : "EditTime" , t : VT _FILETIME } , 11 : { n : "LastPrinted" , t : VT _FILETIME } , 12 : { n : "CreatedDate" , t : VT _FILETIME } , 13 : { n : "ModifiedDate" , t : VT _FILETIME } , 14 : { n : "PageCount" , t : VT _I4 } , 15 : { n : "WordCount" , t : VT _I4 } , 16 : { n : "CharCount" , t : VT _I4 } , 17 : { n : "Thumbnail" , t : VT _CF } , 18 : { n : "ApplicationName" , t : VT _LPSTR } , 19 : { n : "DocumentSecurity" , t : VT _I4 } , 255 : { } } ; var SpecialProperties = { 2147483648 : { n : "Locale" , t : VT _UI4 } , 2147483651 : { n : "Behavior" , t : VT _UI4 } , 1919054434 : { } } ; ( function ( ) { for ( var y in SpecialProperties ) if ( SpecialProperties . hasOwnProperty ( y ) ) DocSummaryPIDDSI [ y ] = SummaryPIDSI [ y ] = SpecialProperties [ y ] } ) ( ) ; var CountryEnum = { 1 : "US" , 2 : "CA" , 3 : "" , 7 : "RU" , 20 : "EG" , 30 : "GR" , 31 : "NL" , 32 : "BE" , 33 : "FR" , 34 : "ES" , 36 : "HU" , 39 : "IT" , 41 : "CH" , 43 : "AT" , 44 : "GB" , 45 : "DK" , 46 : "SE" , 47 : "NO" , 48 : "PL" , 49 : "DE" , 52 : "MX" , 55 : "BR" , 61 : "AU" , 64 : "NZ" , 66 : "TH" , 81 : "JP" , 82 : "KR" , 84 : "VN" , 86 : "CN" , 90 : "TR" , 105 : "JS" , 213 : "DZ" , 216 : "MA" , 218 : "LY" , 351 : "PT" , 354 : "IS" , 358 : "FI" , 420 : "CZ" , 886 : "TW" , 961 : "LB" , 962 : "JO" , 963 : "SY" , 964 : "IQ" , 965 : "KW" , 966 : "SA" , 971 : "AE" , 972 : "IL" , 974 : "QA" , 981 : "IR" , 65535 : "US" } ; var XLSFillPattern = [ null , "solid" , "mediumGray" , "darkGray" , "lightGray" , "darkHorizontal" , "darkVertical" , "darkDown" , "darkUp" , "darkGrid" , "darkTrellis" , "lightHorizontal" , "lightVertical" , "lightDown" , "lightUp" , "lightGrid" , "lightTrellis" , "gray125" , "gray0625" ] ; function rgbify ( arr ) { return arr . map ( function ( x ) { return [ x >> 16 & 255 , x >> 8 & 255 , x & 255 ] } ) } var XLSIcv = rgbify ( [ 0 , 16777215 , 16711680 , 65280 , 255 , 16776960 , 16711935 , 65535 , 0 , 16777215 , 16711680 , 65280 , 255 , 16776960 , 16711935 , 65535 , 8388608 , 32768 , 128 , 8421376 , 8388736 , 32896 , 12632256 , 8421504 , 10066431 , 10040166 , 16777164 , 13434879 , 6684774 , 16744576 , 26316 , 13421823 , 128 , 16711935 , 16776960 , 65535 , 8388736 , 8388608 , 32896 , 255 , 52479 , 13434879 , 13434828 , 16777113 , 10079487 , 16751052 , 13408767 , 16764057 , 3368703 , 3394764 , 10079232 , 16763904 , 16750848 , 16737792 , 6710937 , 9868950 , 13158 , 3381606 , 13056 , 3355392 , 10040064 , 10040166 , 3355545 , 3355443 , 16777215 , 0 ] ) ; var ct2type = { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" : "workbooks" , "application/vnd.ms-excel.binIndexWs" : "TODO" , "application/vnd.ms-excel.intlmacrosheet" : "TODO" , "application/vnd.ms-excel.binIndexMs" : "TODO" , "application/vnd.openxmlformats-package.core-properties+xml" : "coreprops" , "application/vnd.openxmlformats-officedocument.custom-properties+xml" : "custprops" , " application / vnd . ope
var retval ; if ( opts ) { if ( opts . biff >= 2 && opts . biff <= 5 ) return blob . read _shift ( cch , "sbcs-cont" ) ; if ( opts . biff >= 12 ) return blob . read _shift ( cch , "dbcs-cont" ) } var fHighByte = blob . read _shift ( 1 ) ; if ( fHighByte === 0 ) { retval = blob . read _shift ( cch , "sbcs-cont" ) } else { retval = blob . read _shift ( cch , "dbcs-cont" ) } return retval } function parse _XLUnicodeString ( blob , length , opts ) { var cch = blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ; if ( cch === 0 ) { blob . l ++ ; return "" } return parse _XLUnicodeStringNoCch ( blob , cch , opts ) } function parse _XLUnicodeString2 ( blob , length , opts ) { if ( opts . biff > 5 ) return parse _XLUnicodeString ( blob , length , opts ) ; var cch = blob . read _shift ( 1 ) ; if ( cch === 0 ) { blob . l ++ ; return "" } return blob . read _shift ( cch , "sbcs-cont" ) } var parse _ControlInfo = parsenoop ; var parse _URLMoniker = function ( blob , length ) { var len = blob . read _shift ( 4 ) , start = blob . l ; var extra = false ; if ( len > 24 ) { blob . l += len - 24 ; if ( blob . read _shift ( 16 ) === "795881f43b1d7f48af2c825dc4852763" ) extra = true ; blob . l = start } var url = blob . read _shift ( ( extra ? len - 24 : len ) >> 1 , "utf16le" ) . replace ( chr0 , "" ) ; if ( extra ) blob . l += 24 ; return url } ; var parse _FileMoniker = function ( blob , length ) { var cAnti = blob . read _shift ( 2 ) ; var ansiLength = blob . read _shift ( 4 ) ; var ansiPath = blob . read _shift ( ansiLength , "cstr" ) ; var endServer = blob . read _shift ( 2 ) ; var versionNumber = blob . read _shift ( 2 ) ; var cbUnicodePathSize = blob . read _shift ( 4 ) ; if ( cbUnicodePathSize === 0 ) return ansiPath . replace ( /\\/g , "/" ) ; var cbUnicodePathBytes = blob . read _shift ( 4 ) ; var usKeyValue = blob . read _shift ( 2 ) ; var unicodePath = blob . read _shift ( cbUnicodePathBytes >> 1 , "utf16le" ) . replace ( chr0 , "" ) ; return unicodePath } ; var parse _HyperlinkMoniker = function ( blob , length ) { var clsid = blob . read _shift ( 16 ) ; length -= 16 ; switch ( clsid ) { case "e0c9ea79f9bace118c8200aa004ba90b" : return parse _URLMoniker ( blob , length ) ; case "0303000000000000c000000000000046" : return parse _FileMoniker ( blob , length ) ; default : throw new Error ( "Unsupported Moniker " + clsid ) } } ; var parse _HyperlinkString = function ( blob , length ) { var len = blob . read _shift ( 4 ) ; var o = blob . read _shift ( len , "utf16le" ) . replace ( chr0 , "" ) ; return o } ; var parse _Hyperlink = function ( blob , length ) { var end = blob . l + length ; var sVer = blob . read _shift ( 4 ) ; if ( sVer !== 2 ) throw new Error ( "Unrecognized streamVersion: " + sVer ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 2 ; var displayName , targetFrameName , moniker , oleMoniker , location , guid , fileTime ; if ( flags & 16 ) displayName = parse _HyperlinkString ( blob , end - blob . l ) ; if ( flags & 128 ) targetFrameName = parse _HyperlinkString ( blob , end - blob . l ) ; if ( ( flags & 257 ) === 257 ) moniker = parse _HyperlinkString ( blob , end - blob . l ) ; if ( ( flags & 257 ) === 1 ) oleMoniker = parse _HyperlinkMoniker ( blob , end - blob . l ) ; if ( flags & 8 ) location = parse _HyperlinkString ( blob , end - blob . l ) ; if ( flags & 32 ) guid = blob . read _shift ( 16 ) ; if ( flags & 64 ) fileTime = parse _FILETIME ( blob , 8 ) ; blob . l = end ; var target = targetFrameName || moniker || oleMoniker ; if ( location ) target += "#" + location ; return { Target : target } } ; function parse _LongRGBA ( blob , length ) { var r = blob . read _shift ( 1 ) , g = blob . read _shift ( 1 ) , b = blob . read _shift ( 1 ) , a = blob . read _shift ( 1 ) ; return [ r , g , b , a ] } function parse _LongRGB ( blob , length ) { var x = parse _LongRGBA ( blob , length ) ; x [ 3 ] = 0 ; return x } function parse _XLSCell ( blob , length ) { var rw = blob . read _shift ( 2 ) ; var col = blob . read _shift ( 2 ) ; var ixfe = blob . read _shift ( 2 ) ; return { r : rw , c : col , ixfe : ixfe } } function parse _frtHeader ( blob ) { var rt = blob . read _shift ( 2 ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 8 ; return { type : rt , flags : flags } } function parse _OptXLUnicodeString ( blob , length , opts ) { return length === 0 ? "" : parse _XLUnicodeString2 ( blob , length , opts ) } var HIDEOBJENUM = [ "SHOWALL" , "SHOWPLACEHOLDER" , "HIDEALL" ] ; var parse _HideObjEnum = parseuint16 ; function parse _XTI ( blob , length ) { var iSupBook = blob . read _shift ( 2 ) , itabFirst = blob . read _shift ( 2 , "i" ) , itabLast = blob . read _shift ( 2 , "i" ) ; return [ iSupBook , itabFirst , itabLast ] } function parse _RkRec ( blob , length ) { var ixfe = blob . read _shift ( 2 ) ; var RK = parse _RkNumber ( blob ) ; return [ ixfe , RK ] } function parse _AddinUdf ( blob , length , opts ) { blob . l += 4 ; length -= 4 ; var l = blob . l + length ; var udfName = parse _ShortXLUnicodeString ( blob , length , opts ) ; var cb = blob . read _shift ( 2 ) ; l -= blob . l ; if ( cb !== l ) throw new Error ( "Malformed AddinUdf: padding = " + l + " != " + cb ) ; blob . l += cb ; return udfName } function parse _Ref8U ( blob , length ) { var rwFirst = blob . read _shift ( 2 ) ; var rw
} function sylk _to _workbook ( str , opts ) { return sheet _to _workbook ( sylk _to _sheet ( str , opts ) , opts ) } function write _ws _cell _sylk ( cell , ws , R , C , opts ) { var o = "C;Y" + ( R + 1 ) + ";X" + ( C + 1 ) + ";K" ; switch ( cell . t ) { case "n" : o += cell . v ; break ; case "b" : o += cell . v ? "TRUE" : "FALSE" ; break ; case "e" : o += cell . w || cell . v ; break ; case "d" : o += '"' + ( cell . w || cell . v ) + '"' ; break ; case "s" : o += '"' + cell . v . replace ( /"/g , "" ) + '"' ; break } return o } function sheet _to _sylk ( ws , opts ) { var preamble = [ "ID;PWXL;N;E" ] , o = [ ] ; preamble . push ( "P;PGeneral" ) ; var r = decode _range ( ws [ "!ref" ] ) , cell ; var dense = Array . isArray ( ws ) ; for ( var R = r . s . r ; R <= r . e . r ; ++ R ) { for ( var C = r . s . c ; C <= r . e . c ; ++ C ) { var coord = encode _cell ( { r : R , c : C } ) ; cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ coord ] ; if ( ! cell || cell . v == null ) continue ; o . push ( write _ws _cell _sylk ( cell , ws , R , C , opts ) ) } } preamble . push ( "F;P0;DG0G8;M255" ) ; var RS = "\r\n" ; return preamble . join ( RS ) + RS + o . join ( RS ) + RS + "E" + RS } return { to _workbook : sylk _to _workbook , to _sheet : sylk _to _sheet , from _sheet : sheet _to _sylk } } ( ) ; var DIF = function ( ) { function dif _to _aoa ( d , opts ) { switch ( opts . type ) { case "base64" : return dif _to _aoa _str ( Base64 . decode ( d ) , opts ) ; case "binary" : return dif _to _aoa _str ( d , opts ) ; case "buffer" : return dif _to _aoa _str ( d . toString ( "binary" ) , opts ) ; case "array" : return dif _to _aoa _str ( cc2str ( d ) , opts ) } throw new Error ( "Unrecognized type " + opts . type ) } function dif _to _aoa _str ( str , opts ) { var records = str . split ( "\n" ) , R = - 1 , C = - 1 , ri = 0 , arr = [ ] ; for ( ; ri !== records . length ; ++ ri ) { if ( records [ ri ] . trim ( ) === "BOT" ) { arr [ ++ R ] = [ ] ; C = 0 ; continue } if ( R < 0 ) continue ; var metadata = records [ ri ] . trim ( ) . split ( "," ) ; var type = metadata [ 0 ] , value = metadata [ 1 ] ; ++ ri ; var data = records [ ri ] . trim ( ) ; switch ( + type ) { case - 1 : if ( data === "BOT" ) { arr [ ++ R ] = [ ] ; C = 0 ; continue } else if ( data !== "EOD" ) throw new Error ( "Unrecognized DIF special command " + data ) ; break ; case 0 : if ( data === "TRUE" ) arr [ R ] [ C ] = true ; else if ( data === "FALSE" ) arr [ R ] [ C ] = false ; else if ( + value == + value ) arr [ R ] [ C ] = + value ; else if ( ! isNaN ( new Date ( value ) . getDate ( ) ) ) arr [ R ] [ C ] = new Date ( value ) ; else arr [ R ] [ C ] = value ; ++ C ; break ; case 1 : data = data . substr ( 1 , data . length - 2 ) ; arr [ R ] [ C ++ ] = data !== "" ? data : null ; break } if ( data === "EOD" ) break } return arr } function dif _to _sheet ( str , opts ) { return aoa _to _sheet ( dif _to _aoa ( str , opts ) , opts ) } function dif _to _workbook ( str , opts ) { return sheet _to _workbook ( dif _to _sheet ( str , opts ) , opts ) } var sheet _to _dif = function ( ) { var push _field = function pf ( o , topic , v , n , s ) { o . push ( topic ) ; o . push ( v + "," + n ) ; o . push ( '"' + s . replace ( /"/g , '""' ) + '"' ) } ; var push _value = function po ( o , type , v , s ) { o . push ( type + "," + v ) ; o . push ( type == 1 ? '"' + s . replace ( /"/g , '""' ) + '"' : s ) } ; return function sheet _to _dif ( ws , opts ) { var o = [ ] ; var r = decode _range ( ws [ "!ref" ] ) , cell ; var dense = Array . isArray ( ws ) ; push _field ( o , "TABLE" , 0 , 1 , "sheetjs" ) ; push _field ( o , "VECTORS" , 0 , r . e . r - r . s . r + 1 , "" ) ; push _field ( o , "TUPLES" , 0 , r . e . c - r . s . c + 1 , "" ) ; push _field ( o , "DATA" , 0 , 0 , "" ) ; for ( var R = r . s . r ; R <= r . e . r ; ++ R ) { push _value ( o , - 1 , 0 , "BOT" ) ; for ( var C = r . s . c ; C <= r . e . c ; ++ C ) { var coord = encode _cell ( { r : R , c : C } ) ; cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ coord ] ; if ( ! cell || cell . v == null ) { push _value ( o , 1 , 0 , "" ) ; continue } switch ( cell . t ) { case "n" : push _value ( o , 0 , cell . v , "V" ) ; break ; case "b" : push _value ( o , 0 , cell . v ? 1 : 0 , cell . v ? "TRUE" : "FALSE" ) ; break ; case "s" : push _value ( o , 1 , 0 , cell . v ) ; break ; default : push _value ( o , 1 , 0 , "" ) } } } push _value ( o , - 1 , 0 , "EOD" ) ; var RS = "\r\n" ; var oo = o . join ( RS ) ; return oo } } ( ) ; return { to _workbook : dif _to _workbook , to _sheet : dif _to _sheet , from _sheet : sheet _to _dif } } ( ) ; var PRN = function ( ) { function set _text _arr ( data , arr , R , C ) { if ( data === "TRUE" ) arr [ R ] [ C ] = true ; else if ( data === "FALSE" ) arr [ R ] [ C ] = false ; else if ( data === "" ) { } else if ( + data == + data ) arr [ R ] [ C ] = + data ; else arr [ R ] [ C ] = data } function prn _to _aoa _str ( f , opts ) { var arr = [ ] ; if ( ! f || f . length === 0 ) return arr ; var lines = f . split ( /[\r\n]/ ) ; var L = lines . length - 1 ; while ( L >= 0 && lines [ L ] . length === 0 ) -- L ; var start = 10 , idx = 0 ; var R = 0 ; for ( ; R <= L ; ++ R ) { idx = lines [ R ] . indexOf ( " " ) ; if ( idx == - 1 ) idx = lines [ R ] . length ; else idx ++ ; start = Math . max ( start , idx ) } for ( R = 0 ; R <= L ; ++ R ) { arr [ R ] = [ ] ; var C = 0 ; set _text _arr ( lines [ R ] . slice ( 0 , start ) . trim ( ) , arr , R , C ) ; for ( C = 1 ; C <= ( lines [ R ] . length - start ) / 10 + 1 ; ++ C ) set _text _arr ( lines [ R ] . slice ( start + ( C - 1 ) * 10 , start + C * 10 ) . trim ( ) , arr , R , C ) } return arr } function dsv _to _sheet _str ( str , opts ) { var o = opts || { } ; var sep = "" ; if ( DENSE != null && o . dense == null ) o . dense = DENSE ; var ws = o . dense ?
} if ( y . rgb ) font . color . rgb = y . rgb ; break ; case "<color/>" : case "</color>" : break ; default : if ( opts && opts . WTF ) throw new Error ( "unrecognized " + y [ 0 ] + " in fonts" ) } } ) } function parse _numFmts ( t , styles , opts ) { styles . NumberFmt = [ ] ; var k = keys ( SSF . _table ) ; for ( var i = 0 ; i < k . length ; ++ i ) styles . NumberFmt [ k [ i ] ] = SSF . _table [ k [ i ] ] ; var m = t [ 0 ] . match ( tagregex ) ; if ( ! m ) return ; for ( i = 0 ; i < m . length ; ++ i ) { var y = parsexmltag ( m [ i ] ) ; switch ( y [ 0 ] ) { case "<numFmts" : case "</numFmts>" : case "<numFmts/>" : case "<numFmts>" : break ; case "<numFmt" : { var f = unescapexml ( utf8read ( y . formatCode ) ) , j = parseInt ( y . numFmtId , 10 ) ; styles . NumberFmt [ j ] = f ; if ( j > 0 ) SSF . load ( f , j ) } break ; case "</numFmt>" : break ; default : if ( opts . WTF ) throw new Error ( "unrecognized " + y [ 0 ] + " in numFmts" ) } } } function write _numFmts ( NF , opts ) { var o = [ "<numFmts>" ] ; [ [ 5 , 8 ] , [ 23 , 26 ] , [ 41 , 44 ] , [ 50 , 392 ] ] . forEach ( function ( r ) { for ( var i = r [ 0 ] ; i <= r [ 1 ] ; ++ i ) if ( NF [ i ] != null ) o [ o . length ] = writextag ( "numFmt" , null , { numFmtId : i , formatCode : escapexml ( NF [ i ] ) } ) } ) ; if ( o . length === 1 ) return "" ; o [ o . length ] = "</numFmts>" ; o [ 0 ] = writextag ( "numFmts" , null , { count : o . length - 2 } ) . replace ( "/>" , ">" ) ; return o . join ( "" ) } function parse _cellXfs ( t , styles , opts ) { styles . CellXf = [ ] ; var xf ; t [ 0 ] . match ( tagregex ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; switch ( y [ 0 ] ) { case "<cellXfs" : case "<cellXfs>" : case "<cellXfs/>" : case "</cellXfs>" : break ; case "<xf" : xf = y ; delete xf [ 0 ] ; if ( xf . numFmtId ) xf . numFmtId = parseInt ( xf . numFmtId , 10 ) ; if ( xf . fillId ) xf . fillId = parseInt ( xf . fillId , 10 ) ; styles . CellXf . push ( xf ) ; break ; case "</xf>" : break ; case "<alignment" : case "<alignment/>" : var alignment = { } ; if ( y . vertical ) alignment . vertical = y . vertical ; if ( y . horizontal ) alignment . horizontal = y . horizontal ; if ( y . textRotation != null ) alignment . textRotation = y . textRotation ; if ( y . indent ) alignment . indent = y . indent ; if ( y . wrapText ) alignment . wrapText = y . wrapText ; xf . alignment = alignment ; break ; case "</alignment>" : break ; case "<protection" : case "</protection>" : case "<protection/>" : break ; case "<extLst" : case "</extLst>" : break ; case "<ext" : break ; default : if ( opts . WTF ) throw new Error ( "unrecognized " + y [ 0 ] + " in cellXfs" ) } } ) } function write _cellXfs ( cellXfs ) { var o = [ ] ; o [ o . length ] = writextag ( "cellXfs" , null ) ; cellXfs . forEach ( function ( c ) { o [ o . length ] = writextag ( "xf" , null , c ) } ) ; o [ o . length ] = "</cellXfs>" ; if ( o . length === 2 ) return "" ; o [ 0 ] = writextag ( "cellXfs" , null , { count : o . length - 2 } ) . replace ( "/>" , ">" ) ; return o . join ( "" ) } var parse _sty _xml = function make _pstyx ( ) { var numFmtRegex = /<numFmts([^>]*)>.*<\/numFmts>/ ; var cellXfRegex = /<cellXfs([^>]*)>.*<\/cellXfs>/ ; var fillsRegex = /<fills([^>]*)>.*<\/fills>/ ; var fontsRegex = /<fonts([^>]*)>.*<\/fonts>/ ; var bordersRegex = /<borders([^>]*)>.*<\/borders>/ ; return function parse _sty _xml ( data , themes , opts ) { var styles = { } ; if ( ! data ) return styles ; var t ; if ( t = data . match ( numFmtRegex ) ) parse _numFmts ( t , styles , opts ) ; if ( t = data . match ( fontsRegex ) ) parse _fonts ( t , styles , themes , opts ) ; if ( t = data . match ( fillsRegex ) ) parse _fills ( t , styles , themes , opts ) ; if ( t = data . match ( bordersRegex ) ) parse _borders ( t , styles , themes , opts ) ; if ( t = data . match ( cellXfRegex ) ) parse _cellXfs ( t , styles , opts ) ; return styles } } ( ) ; var STYLES _XML _ROOT = writextag ( "styleSheet" , null , { xmlns : XMLNS . main [ 0 ] , "xmlns:vt" : XMLNS . vt } ) ; RELS . STY = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" ; function write _sty _xml ( wb , opts ) { var o = [ XML _HEADER , STYLES _XML _ROOT ] , w ; if ( wb . SSF && ( w = write _numFmts ( wb . SSF ) ) != null ) o [ o . length ] = w ; o [ o . length ] = '<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>' ; o [ o . length ] = '<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>' ; o [ o . length ] = '<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>' ; o [ o . length ] = '<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>' ; if ( w = write _cellXfs ( opts . cellXfs ) ) o [ o . length ] = w ; o [ o . length ] = '<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>' ; o [ o . length ] = '<dxfs count="0"/>' ; o [ o . length ] = '<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>' ; if ( o . length > 2 ) { o [ o . length ] = "</styleSheet>" ; o [ 1 ] = o [ 1 ] . replace ( " / >
var type = ( blob [ blob . l ++ ] & 96 ) >> 5 ; var ixti = blob . read _shift ( 2 ) ; var w = 8 ; if ( opts ) switch ( opts . biff ) { case 5 : blob . l += 12 ; w = 6 ; break ; case 12 : w = 12 ; break } blob . l += w ; return [ type , ixti ] } function parse _PtgAreaN ( blob , length , opts ) { var type = ( blob [ blob . l ++ ] & 96 ) >> 5 ; var area = parse _RgceAreaRel ( blob , opts && opts . biff > 8 ? 12 : 8 , opts ) ; return [ type , area ] } function parse _PtgArray ( blob , length , opts ) { var type = ( blob [ blob . l ++ ] & 96 ) >> 5 ; blob . l += opts . biff == 2 ? 6 : opts . biff == 12 ? 14 : 7 ; return [ type ] } function parse _PtgAttrBaxcel ( blob , length ) { var bitSemi = blob [ blob . l + 1 ] & 1 ; var bitBaxcel = 1 ; blob . l += 4 ; return [ bitSemi , bitBaxcel ] } function parse _PtgAttrChoose ( blob , length , opts ) { blob . l += 2 ; var offset = blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ; var o = [ ] ; for ( var i = 0 ; i <= offset ; ++ i ) o . push ( blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ) ; return o } function parse _PtgAttrGoto ( blob , length , opts ) { var bitGoto = blob [ blob . l + 1 ] & 255 ? 1 : 0 ; blob . l += 2 ; return [ bitGoto , blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ] } function parse _PtgAttrIf ( blob , length , opts ) { var bitIf = blob [ blob . l + 1 ] & 255 ? 1 : 0 ; blob . l += 2 ; return [ bitIf , blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ] } function parse _PtgAttrIfError ( blob , length ) { var bitIf = blob [ blob . l + 1 ] & 255 ? 1 : 0 ; blob . l += 2 ; return [ bitIf , blob . read _shift ( 2 ) ] } function parse _PtgAttrSemi ( blob , length , opts ) { var bitSemi = blob [ blob . l + 1 ] & 255 ? 1 : 0 ; blob . l += opts && opts . biff == 2 ? 3 : 4 ; return [ bitSemi ] } function parse _PtgAttrSpaceType ( blob , length ) { var type = blob . read _shift ( 1 ) , cch = blob . read _shift ( 1 ) ; return [ type , cch ] } function parse _PtgAttrSpace ( blob , length ) { blob . read _shift ( 2 ) ; return parse _PtgAttrSpaceType ( blob , 2 ) } function parse _PtgAttrSpaceSemi ( blob , length ) { blob . read _shift ( 2 ) ; return parse _PtgAttrSpaceType ( blob , 2 ) } function parse _PtgRef ( blob , length , opts ) { var ptg = blob [ blob . l ] & 31 ; var type = ( blob [ blob . l ] & 96 ) >> 5 ; blob . l += 1 ; var loc = parse _RgceLoc ( blob , 0 , opts ) ; return [ type , loc ] } function parse _PtgRefN ( blob , length , opts ) { var type = ( blob [ blob . l ] & 96 ) >> 5 ; blob . l += 1 ; var loc = parse _RgceLocRel ( blob , 0 , opts ) ; return [ type , loc ] } function parse _PtgRef3d ( blob , length , opts ) { var type = ( blob [ blob . l ] & 96 ) >> 5 ; blob . l += 1 ; var ixti = blob . read _shift ( 2 ) ; var loc = parse _RgceLoc ( blob , 0 , opts ) ; return [ type , ixti , loc ] } function parse _PtgFunc ( blob , length , opts ) { var ptg = blob [ blob . l ] & 31 ; var type = ( blob [ blob . l ] & 96 ) >> 5 ; blob . l += 1 ; var iftab = blob . read _shift ( opts && opts . biff <= 3 ? 1 : 2 ) ; return [ FtabArgc [ iftab ] , Ftab [ iftab ] , type ] } function parse _PtgFuncVar ( blob , length , opts ) { blob . l ++ ; var cparams = blob . read _shift ( 1 ) , tab = opts && opts . biff <= 3 ? [ 0 , blob . read _shift ( 1 ) ] : parsetab ( blob ) ; return [ cparams , ( tab [ 0 ] === 0 ? Ftab : Cetab ) [ tab [ 1 ] ] ] } function parsetab ( blob , length ) { return [ blob [ blob . l + 1 ] >> 7 , blob . read _shift ( 2 ) & 32767 ] } function parse _PtgAttrSum ( blob , length , opts ) { blob . l += opts && opts . biff == 2 ? 3 : 4 ; return } var parse _PtgConcat = parseread1 ; function parse _PtgExp ( blob , length , opts ) { blob . l ++ ; if ( opts && opts . biff == 12 ) return [ blob . read _shift ( 4 , "i" ) , 0 ] ; var row = blob . read _shift ( 2 ) ; var col = blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ; return [ row , col ] } function parse _PtgErr ( blob , length ) { blob . l ++ ; return BErr [ blob . read _shift ( 1 ) ] } function parse _PtgInt ( blob , length ) { blob . l ++ ; return blob . read _shift ( 2 ) } function parse _PtgBool ( blob , length ) { blob . l ++ ; return blob . read _shift ( 1 ) !== 0 } function parse _PtgNum ( blob , length ) { blob . l ++ ; return parse _Xnum ( blob , 8 ) } function parse _PtgStr ( blob , length , opts ) { blob . l ++ ; return parse _ShortXLUnicodeString ( blob , length - 1 , opts ) } function parse _SerAr ( blob , biff ) { var val = [ blob . read _shift ( 1 ) ] ; if ( biff == 12 ) switch ( val [ 0 ] ) { case 2 : val [ 0 ] = 4 ; break ; case 4 : val [ 0 ] = 16 ; break ; case 0 : val [ 0 ] = 1 ; break ; case 1 : val [ 0 ] = 2 ; break } switch ( val [ 0 ] ) { case 4 : val [ 1 ] = parsebool ( blob , 1 ) ? "TRUE" : "FALSE" ; blob . l += 7 ; break ; case 16 : val [ 1 ] = BErr [ blob [ blob . l ] ] ; blob . l += 8 ; break ; case 0 : blob . l += 8 ; break ; case 1 : val [ 1 ] = parse _Xnum ( blob , 8 ) ; break ; case 2 : val [ 1 ] = parse _XLUnicodeString2 ( blob , 0 , { biff : biff > 0 && biff < 8 ? 2 : biff } ) ; break } return val } function parse _PtgExtraMem ( blob , cce ) { var count = blob . read _shift ( 2 ) ; var out = [ ] ; for ( var i = 0 ; i != count ; ++ i ) out . push ( parse _Ref8U ( blob , 8 ) ) ; return out } function parse _PtgExtraArray ( blob , length , opts ) { var rows = 0 , cols = 0 ; if ( opts . biff == 12 ) { rows = blob . read _shift ( 4 ) ; cols = blob . read _shift ( 4 ) } else { cols = 1 + blob . read _shift ( 1 ) ; rows = 1 + blob . read _shift ( 2 ) } if ( opts . biff >= 2 && opts . biff < 8 ) { -- rows ; if ( -- cols == 0 ) cols
189 : 3 , 190 : 1 , 195 : 3 , 196 : 3 , 197 : 1 , 198 : 1 , 199 : 3 , 201 : 1 , 207 : 4 , 210 : 3 , 211 : 1 , 212 : 2 , 213 : 2 , 214 : 1 , 215 : 1 , 229 : 1 , 230 : 1 , 231 : 1 , 232 : 1 , 233 : 1 , 234 : 1 , 235 : 3 , 244 : 1 , 247 : 4 , 252 : 2 , 257 : 1 , 261 : 1 , 271 : 1 , 273 : 4 , 274 : 2 , 275 : 2 , 276 : 2 , 277 : 3 , 278 : 3 , 279 : 1 , 280 : 3 , 281 : 3 , 282 : 3 , 283 : 1 , 284 : 1 , 285 : 2 , 286 : 4 , 287 : 3 , 288 : 2 , 289 : 4 , 290 : 3 , 291 : 3 , 292 : 3 , 293 : 4 , 294 : 1 , 295 : 3 , 296 : 1 , 297 : 3 , 298 : 1 , 299 : 2 , 300 : 3 , 301 : 3 , 302 : 4 , 303 : 2 , 304 : 2 , 305 : 2 , 306 : 2 , 307 : 2 , 308 : 2 , 309 : 3 , 310 : 2 , 311 : 2 , 312 : 2 , 313 : 2 , 314 : 2 , 315 : 2 , 316 : 4 , 325 : 2 , 326 : 2 , 327 : 2 , 328 : 2 , 331 : 2 , 332 : 2 , 337 : 2 , 342 : 1 , 343 : 1 , 346 : 2 , 347 : 1 , 350 : 4 , 351 : 3 , 352 : 1 , 353 : 2 , 360 : 1 , 368 : 1 , 369 : 1 , 370 : 1 , 371 : 1 , 372 : 1 , 373 : 1 , 374 : 1 , 375 : 1 , 376 : 1 , 377 : 1 , 378 : 1 , 382 : 3 , 385 : 1 , 392 : 1 , 393 : 1 , 396 : 2 , 397 : 2 , 398 : 2 , 399 : 1 , 400 : 1 , 401 : 1 , 402 : 1 , 403 : 1 , 404 : 1 , 405 : 1 , 406 : 1 , 407 : 1 , 408 : 1 , 409 : 1 , 410 : 1 , 414 : 4 , 415 : 1 , 416 : 1 , 417 : 2 , 420 : 1 , 421 : 1 , 422 : 2 , 424 : 1 , 425 : 2 , 426 : 2 , 427 : 2 , 428 : 2 , 430 : 3 , 438 : 3 , 439 : 3 , 440 : 3 , 443 : 2 , 444 : 2 , 445 : 2 , 446 : 2 , 447 : 6 , 448 : 6 , 449 : 2 , 450 : 2 , 464 : 2 , 468 : 3 , 476 : 2 , 479 : 1 , 480 : 2 , 65535 : 0 } ; var XLSXFutureFunctions = { "_xlfn.ACOT" : "ACOT" , "_xlfn.ACOTH" : "ACOTH" , "_xlfn.AGGREGATE" : "AGGREGATE" , "_xlfn.ARABIC" : "ARABIC" , "_xlfn.AVERAGEIF" : "AVERAGEIF" , "_xlfn.AVERAGEIFS" : "AVERAGEIFS" , "_xlfn.BASE" : "BASE" , "_xlfn.BETA.DIST" : "BETA.DIST" , "_xlfn.BETA.INV" : "BETA.INV" , "_xlfn.BINOM.DIST" : "BINOM.DIST" , "_xlfn.BINOM.DIST.RANGE" : "BINOM.DIST.RANGE" , "_xlfn.BINOM.INV" : "BINOM.INV" , "_xlfn.BITAND" : "BITAND" , "_xlfn.BITLSHIFT" : "BITLSHIFT" , "_xlfn.BITOR" : "BITOR" , "_xlfn.BITRSHIFT" : "BITRSHIFT" , "_xlfn.BITXOR" : "BITXOR" , "_xlfn.CEILING.MATH" : "CEILING.MATH" , "_xlfn.CEILING.PRECISE" : "CEILING.PRECISE" , "_xlfn.CHISQ.DIST" : "CHISQ.DIST" , "_xlfn.CHISQ.DIST.RT" : "CHISQ.DIST.RT" , "_xlfn.CHISQ.INV" : "CHISQ.INV" , "_xlfn.CHISQ.INV.RT" : "CHISQ.INV.RT" , "_xlfn.CHISQ.TEST" : "CHISQ.TEST" , "_xlfn.COMBINA" : "COMBINA" , "_xlfn.CONFIDENCE.NORM" : "CONFIDENCE.NORM" , "_xlfn.CONFIDENCE.T" : "CONFIDENCE.T" , "_xlfn.COT" : "COT" , "_xlfn.COTH" : "COTH" , "_xlfn.COUNTIFS" : "COUNTIFS" , "_xlfn.COVARIANCE.P" : "COVARIANCE.P" , "_xlfn.COVARIANCE.S" : "COVARIANCE.S" , "_xlfn.CSC" : "CSC" , "_xlfn.CSCH" : "CSCH" , "_xlfn.DAYS" : "DAYS" , "_xlfn.DECIMAL" : "DECIMAL" , "_xlfn.ECMA.CEILING" : "ECMA.CEILING" , "_xlfn.ERF.PRECISE" : "ERF.PRECISE" , "_xlfn.ERFC.PRECISE" : "ERFC.PRECISE" , "_xlfn.EXPON.DIST" : "EXPON.DIST" , "_xlfn.F.DIST" : "F.DIST" , "_xlfn.F.DIST.RT" : "F.DIST.RT" , "_xlfn.F.INV" : "F.INV" , "_xlfn.F.INV.RT" : "F.INV.RT" , "_xlfn.F.TEST" : "F.TEST" , "_xlfn.FILTERXML" : "FILTERXML" , "_xlfn.FLOOR.MATH" : "FLOOR.MATH" , "_xlfn.FLOOR.PRECISE" : "FLOOR.PRECISE" , "_xlfn.FORMULATEXT" : "FORMULATEXT" , "_xlfn.GAMMA" : "GAMMA" , "_xlfn.GAMMA.DIST" : "GAMMA.DIST" , "_xlfn.GAMMA.INV" : "GAMMA.INV" , "_xlfn.GAMMALN.PRECISE" : "GAMMALN.PRECISE" , "_xlfn.GAUSS" : "GAUSS" , "_xlfn.HYPGEOM.DIST" : "HYPGEOM.DIST" , "_xlfn.IFNA" : "IFNA" , "_xlfn.IFERROR" : "IFERROR" , "_xlfn.IMCOSH" : "IMCOSH" , "_xlfn.IMCOT" : "IMCOT" , "_xlfn.IMCSC" : "IMCSC" , "_xlfn.IMCSCH" : "IMCSCH" , "_xlfn.IMSEC" : "IMSEC" , "_xlfn.IMSECH" : "IMSECH" , "_xlfn.IMSINH" : "IMSINH" , "_xlfn.IMTAN" : "IMTAN" , "_xlfn.ISFORMULA" : "ISFORMULA" , "_xlfn.ISO.CEILING" : "ISO.CEILING" , "_xlfn.ISOWEEKNUM" : "ISOWEEKNUM" , "_xlfn.LOGNORM.DIST" : "LOGNORM.DIST" , "_xlfn.LOGNORM.INV" : "LOGNORM.INV" , "_xlfn.MODE.MULT" : "MODE.MULT" , "_xlfn.MODE.SNGL" : "MODE.SNGL" , "_xlfn.MUNIT" : "MUNIT" , "_xlfn.NEGBINOM.DIST" : "NEGBINOM.DIST" , "_xlfn.NETWORKDAYS.INTL" : "NETWORKDAYS.INTL" , "_xlfn.NIGBINOM" : "NIGBINOM" , "_xlfn.NORM.DIST" : "NORM.DIST" , "_xlfn.NORM.INV" : "NORM.INV" , "_xlfn.NORM.S.DIST" : "NORM.S.DIST" , "_xlfn.NORM.S.INV" : "NORM.S.INV" , "_xlfn.NUMBERVALUE" : "NUMBERVALUE" , "_xlfn.PDURATION" : "PDURATION" , "_xlfn.PERCENTILE.EXC" : "PERCENTILE.EXC" , "_xlfn.PERCENTILE.INC" : "PERCENTILE.INC" , "_xlfn.PERCENTRANK.EXC" : "PERCENTRANK.EXC" , "_xlfn.PERCENTRANK.INC" : "PERCENTRANK.INC" , "_xlfn.PERMUTATIONA" : "PERMUTATIONA" , "_xlfn.PHI" : "PHI" , "_xlfn.POISSON.DIST" : "POISSON.DIST" , "_xlfn.QUARTILE.EXC" : "QUARTILE.EXC" , "_xlfn.QUARTILE.INC" : "QUARTILE.INC" , "_xlfn.QUERYSTRING" : "QUERYSTRING" , "_xlfn.RANK.AVG" : "RANK.AVG" , "_xlfn.RANK.EQ" : "RANK.EQ" , "_xlfn.RRI" : "RRI" , "_xlfn.SEC" : "SEC" , "_xlfn.SECH" : "SECH" , "_xlfn.SHEET" : "SHEET" , "_xlfn.SHEETS" : "SHEETS" , "_xlfn.SKEW.P" : "SKEW.P" , "_xlfn.STDEV.P" : "STDEV.P" , "_xlfn.STDEV.S" : "STDEV.S" , "_xlfn.SUMIFS" : "SUMIFS" , "_xlfn.T.DIST" : "T.DIST" , "_xlfn.T.DIST.2T" : "T.DIST.2T" , "_xlfn.T.DIST.RT" : "T.DIST.RT" , "_xlfn.T.INV" : "T.INV" , "_xlfn.T.INV.2T" : "T.INV.2T" , "_xlfn.T.TEST" : "T.TEST" , "
o . t = "str" ; write _record ( ba , "BrtCellSt" , write _BrtCellSt ( cell , o ) ) } return ; case "n" : if ( cell . v == ( cell . v | 0 ) && cell . v > - 1e3 && cell . v < 1e3 ) write _record ( ba , "BrtCellRk" , write _BrtCellRk ( cell , o ) ) ; else write _record ( ba , "BrtCellReal" , write _BrtCellReal ( cell , o ) ) ; if ( olddate ) { cell . t = "d" ; cell . v = olddate } return ; case "b" : o . t = "b" ; write _record ( ba , "BrtCellBool" , write _BrtCellBool ( cell , o ) ) ; return ; case "e" : o . t = "e" ; break } write _record ( ba , "BrtCellBlank" , write _BrtCellBlank ( cell , o ) ) } function write _CELLTABLE ( ba , ws , idx , opts , wb ) { var range = safe _decode _range ( ws [ "!ref" ] || "A1" ) , ref , rr = "" , cols = [ ] ; write _record ( ba , "BrtBeginSheetData" ) ; var dense = Array . isArray ( ws ) ; for ( var R = range . s . r ; R <= range . e . r ; ++ R ) { rr = encode _row ( R ) ; write _row _header ( ba , ws , range , R ) ; for ( var C = range . s . c ; C <= range . e . c ; ++ C ) { if ( R === range . s . r ) cols [ C ] = encode _col ( C ) ; ref = cols [ C ] + rr ; var cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ ref ] ; if ( ! cell ) continue ; write _ws _bin _cell ( ba , cell , R , C , opts , ws ) } } write _record ( ba , "BrtEndSheetData" ) } function write _MERGECELLS ( ba , ws ) { if ( ! ws || ! ws [ "!merges" ] ) return ; write _record ( ba , "BrtBeginMergeCells" , write _BrtBeginMergeCells ( ws [ "!merges" ] . length ) ) ; ws [ "!merges" ] . forEach ( function ( m ) { write _record ( ba , "BrtMergeCell" , write _BrtMergeCell ( m ) ) } ) ; write _record ( ba , "BrtEndMergeCells" ) } function write _COLINFOS ( ba , ws , idx , opts , wb ) { if ( ! ws || ! ws [ "!cols" ] ) return ; write _record ( ba , "BrtBeginColInfos" ) ; ws [ "!cols" ] . forEach ( function ( m , i ) { if ( m ) write _record ( ba , "BrtColInfo" , write _BrtColInfo ( i , m ) ) } ) ; write _record ( ba , "BrtEndColInfos" ) } function write _HLINKS ( ba , ws , rels ) { ws [ "!links" ] . forEach ( function ( l ) { if ( ! l [ 1 ] . Target ) return ; var rId = add _rels ( rels , - 1 , l [ 1 ] . Target . replace ( /#.*$/ , "" ) , RELS . HLINK ) ; write _record ( ba , "BrtHLink" , write _BrtHLink ( l , rId ) ) } ) ; delete ws [ "!links" ] } function write _LEGACYDRAWING ( ba , ws , idx , rels ) { if ( ws [ "!comments" ] . length > 0 ) { var rId = add _rels ( rels , - 1 , "../drawings/vmlDrawing" + ( idx + 1 ) + ".vml" , RELS . VML ) ; write _record ( ba , "BrtLegacyDrawing" , write _RelID ( "rId" + rId ) ) ; ws [ "!legacy" ] = rId } } function write _AUTOFILTER ( ba , ws ) { if ( ! ws [ "!autofilter" ] ) return ; write _record ( ba , "BrtBeginAFilter" , write _UncheckedRfX ( decode _range ( ws [ "!autofilter" ] . ref ) ) ) ; write _record ( ba , "BrtEndAFilter" ) } function write _SHEETPROTECT ( ba , ws ) { if ( ! ws [ "!protect" ] ) return ; write _record ( ba , "BrtSheetProtection" , write _BrtSheetProtection ( ws [ "!protect" ] ) ) } function write _ws _bin ( idx , opts , wb , rels ) { var ba = buf _array ( ) ; var s = wb . SheetNames [ idx ] , ws = wb . Sheets [ s ] || { } ; var r = safe _decode _range ( ws [ "!ref" ] || "A1" ) ; ws [ "!links" ] = [ ] ; ws [ "!comments" ] = [ ] ; write _record ( ba , "BrtBeginSheet" ) ; write _record ( ba , "BrtWsProp" , write _BrtWsProp ( s ) ) ; write _record ( ba , "BrtWsDim" , write _BrtWsDim ( r ) ) ; write _COLINFOS ( ba , ws , idx , opts , wb ) ; write _CELLTABLE ( ba , ws , idx , opts , wb ) ; write _SHEETPROTECT ( ba , ws ) ; write _AUTOFILTER ( ba , ws ) ; write _MERGECELLS ( ba , ws ) ; write _HLINKS ( ba , ws , rels ) ; if ( ws [ "!margins" ] ) write _record ( ba , "BrtMargins" , write _BrtMargins ( ws [ "!margins" ] ) ) ; write _LEGACYDRAWING ( ba , ws , idx , rels ) ; write _record ( ba , "BrtEndSheet" ) ; return ba . end ( ) } function parse _numCache ( data ) { var col = [ ] ; ( data . match ( /<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm ) || [ ] ) . forEach ( function ( pt ) { var q = pt . match ( /<c:pt idx="(.*?)"><c:v>(.*)<\/c:v><\/c:pt>/ ) ; if ( ! q ) return ; col [ + q [ 1 ] ] = + q [ 2 ] } ) ; var nf = unescapexml ( ( data . match ( /<c:formatCode>(.*?)<\/c:formatCode>/ ) || [ "" , "General" ] ) [ 1 ] ) ; return [ col , nf ] } function parse _chart ( data , name , opts , rels , wb , csheet ) { var cs = csheet || { "!type" : "chart" } ; if ( ! data ) return csheet ; var C = 0 , R = 0 , col = "A" ; var refguess = { s : { r : 2e6 , c : 2e6 } , e : { r : 0 , c : 0 } } ; ( data . match ( /<c:numCache>.*?<\/c:numCache>/gm ) || [ ] ) . forEach ( function ( nc ) { var cache = parse _numCache ( nc ) ; refguess . s . r = refguess . s . c = 0 ; refguess . e . c = C ; col = encode _col ( C ) ; cache [ 0 ] . forEach ( function ( n , i ) { cs [ col + encode _row ( i ) ] = { t : "n" , v : n , z : cache [ 1 ] } ; R = i } ) ; if ( refguess . e . r < R ) refguess . e . r = R ; ++ C } ) ; if ( C > 0 ) cs [ "!ref" ] = encode _range ( refguess ) ; return cs } RELS . CS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet" ; var CS _XML _ROOT = writextag ( "chartsheet" , null , { xmlns : XMLNS . main [ 0 ] , "xmlns:r" : XMLNS . r } ) ; function parse _cs _xml ( data , opts , rels , wb , themes , styles ) { if ( ! data ) return data ; if ( ! rels ) rels = { "!id" : { } } ; var s = { "!type" : "chart" , "!chart" : null , "!rel" : "" } ; var m ; if ( m = data . match ( /drawing r:id="(.*?)"/ ) ) s [ "!rel" ] = m [ 1 ] ; if ( rels [ "!id" ] [ s [ "!rel" ] ] ) s [ " !
if ( pagemargins . Top ) cursheet [ "!margins" ] . top = pagemargins . Top ; if ( pagemargins . Left ) cursheet [ "!margins" ] . left = pagemargins . Left ; if ( pagemargins . Right ) cursheet [ "!margins" ] . right = pagemargins . Right ; if ( pagemargins . Bottom ) cursheet [ "!margins" ] . bottom = pagemargins . Bottom ; break ; case "Unsynced" : break ; case "Print" : break ; case "Panes" : break ; case "Scale" : break ; case "Pane" : break ; case "Number" : break ; case "Layout" : break ; case "PageSetup" : break ; case "Selected" : break ; case "ProtectObjects" : break ; case "EnableSelection" : break ; case "ProtectScenarios" : break ; case "ValidPrinterInfo" : break ; case "HorizontalResolution" : break ; case "VerticalResolution" : break ; case "NumberofCopies" : break ; case "ActiveRow" : break ; case "ActiveCol" : break ; case "ActivePane" : break ; case "TopRowVisible" : break ; case "TopRowBottomPane" : break ; case "LeftColumnVisible" : break ; case "LeftColumnRightPane" : break ; case "FitToPage" : break ; case "RangeSelection" : break ; case "PaperSizeIndex" : break ; case "PageLayoutZoom" : break ; case "PageBreakZoom" : break ; case "FilterOn" : break ; case "DoNotDisplayGridlines" : break ; case "SplitHorizontal" : break ; case "SplitVertical" : break ; case "FreezePanes" : break ; case "FrozenNoSplit" : break ; case "FitWidth" : break ; case "FitHeight" : break ; case "CommentsLayout" : break ; case "Zoom" : break ; case "LeftToRight" : break ; case "Gridlines" : break ; case "AllowSort" : break ; case "AllowFilter" : break ; case "AllowInsertRows" : break ; case "AllowDeleteRows" : break ; case "AllowInsertCols" : break ; case "AllowDeleteCols" : break ; case "AllowInsertHyperlinks" : break ; case "AllowFormatCells" : break ; case "AllowSizeCols" : break ; case "AllowSizeRows" : break ; case "NoSummaryRowsBelowDetail" : break ; case "TabColorIndex" : break ; case "DoNotDisplayHeadings" : break ; case "ShowPageLayoutZoom" : break ; case "NoSummaryColumnsRightDetail" : break ; case "BlackAndWhite" : break ; case "DoNotDisplayZeros" : break ; case "DisplayPageBreak" : break ; case "RowColHeadings" : break ; case "DoNotDisplayOutline" : break ; case "NoOrientation" : break ; case "AllowUsePivotTables" : break ; case "ZeroHeight" : break ; case "ViewableRange" : break ; case "Selection" : break ; case "ProtectContents" : break ; default : seen = false } break ; case "PivotTable" : case "PivotCache" : switch ( Rn [ 3 ] ) { case "ImmediateItemsOnDrop" : break ; case "ShowPageMultipleItemLabel" : break ; case "CompactRowIndent" : break ; case "Location" : break ; case "PivotField" : break ; case "Orientation" : break ; case "LayoutForm" : break ; case "LayoutSubtotalLocation" : break ; case "LayoutCompactRow" : break ; case "Position" : break ; case "PivotItem" : break ; case "DataType" : break ; case "DataField" : break ; case "SourceName" : break ; case "ParentField" : break ; case "PTLineItems" : break ; case "PTLineItem" : break ; case "CountOfSameItems" : break ; case "Item" : break ; case "ItemType" : break ; case "PTSource" : break ; case "CacheIndex" : break ; case "ConsolidationReference" : break ; case "FileName" : break ; case "Reference" : break ; case "NoColumnGrand" : break ; case "NoRowGrand" : break ; case "BlankLineAfterItems" : break ; case "Hidden" : break ; case "Subtotal" : break ; case "BaseField" : break ; case "MapChildItems" : break ; case "Function" : break ; case "RefreshOnFileOpen" : break ; case "PrintSetTitles" : break ; case "MergeLabels" : break ; case "DefaultVersion" : break ; case "RefreshName" : break ; case "RefreshDate" : break ; case "RefreshDateCopy" : break ; case "VersionLastRefresh" : break ; case "VersionLastUpdate" : break ; case "VersionUpdateableMin" : break ; case "VersionRefreshableMin" : break ; case "Calculation" : break ; default : seen = false } break ; case "PageBreaks" : switch ( Rn [ 3 ] ) { case "ColBreaks" : break ; case "ColBreak" : break ; case "RowBreaks" : break ; case "RowBreak" : break ; case "ColStart" : break ; case "ColEnd" : break ; case "RowEnd" : break ; default : seen = false } break ; case "AutoFilter" : switch ( Rn [ 3 ] ) { case "AutoFilterColumn" : break ; case "AutoFilterCondition" : break ; case "AutoFilterAnd" : break ; case "AutoFilterOr" : break ; default : seen = false } break ; case "QueryTable" : switch ( Rn [ 3 ] ) { case "Id" : break ; case "AutoFormatFont" : break ; case "AutoFormatPattern" : break ; case "QuerySource" : break ; case "QueryType" : break ; case "EnableRedirections" : break ; case "RefreshedInXl9" : break ; case "URLString" : break ; case "HTMLTables" : break ; case "Connection" : break ; case "CommandText" : break ; case "RefreshInfo" : break ; case "NoTitles" : break ; case "NextId" : break ; case "ColumnInfo" : break ; case "OverwriteCells" : break ; case "DoNotPromptForFile" : break ; case "TextWizardSettings" : break ; case "Source" : bre
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 : parsenoop } , 138 : { n : "BrtEndWsView" , f : parsenoop } , 139 : { n : "BrtBeginCsViews" , f : parsenoop } , 140 : { n : "BrtEndCsViews" , f : parsenoop } , 141 : { n : "BrtBeginCsView" , f : parsenoop } , 142 : { n : "BrtEndCsView" , f : parsenoop } , 143 : { n : "BrtBeginBundleShs" , f : parsenoop } , 144 : { n : "BrtEndBundleShs" , f : parsenoop } , 145 : { n : "BrtBeginSheetData" , f : parsenoop } , 146 : { n : "BrtEndSheetData" , f : parsenoop } , 147 : { n : "BrtWsProp" , f : parse _BrtWsProp } , 148 : { n : "BrtWsDim" , f : parse _BrtWsDim , p : 16 } , 151 : { n : "BrtPane" , f : parsenoop } , 152 : { n : "BrtSel" , f : parsenoop } , 153 : { n : "BrtWbProp" , f : parse _BrtWbProp } , 154 : { n : "BrtWbFactoid" , f : parsenoop } , 155 : { n : "BrtFileRecover" , f : parsenoop } , 156 : { n : "BrtBundleSh" , f : parse _BrtBundleSh } , 157 : { n : "BrtCalcProp" , f : parsenoop } , 158 : { n : "BrtBookView" , f : parsenoop } , 159 : { n : "BrtBeginSst" , f : parse _BrtBeginSst } , 160 : { n : "BrtEndSst" , f : parsenoop } , 161 : { n : "BrtBeginAFilter" , f : parse _UncheckedRfX } , 162 : { n : "BrtEndAFilter" , f : parsenoop } , 163 : { n : "BrtBeginFilterColumn" , f : parsenoop } , 164 : { n : "BrtEndFilterColumn" , f : parsenoop } , 165 : { n : "BrtBeginFilters" , f : parsenoop } , 166 : { n : "BrtEndFilters" , f : parsenoop } , 167 : { n : "BrtFilter" , f : parsenoop } , 168 : { n : "BrtColorFilter" , f : parsenoop } , 169 : { n : "BrtIconFilter" , f : parsenoop } , 170 : { n : "BrtTop10Filter" , f : parsenoop } , 171 : { n : "BrtDynamicFilter" , f : parsenoop } , 172 : { n : "BrtBeginCustomFilters" , f : parsenoop } , 173 : { n : "BrtEndCustomFilters" , f : parsenoop } , 174 : { n : "BrtCustomFilter" , f : parsenoop } , 175 : { n : "BrtAFilterDateGroupItem" , f : parsenoop } , 176 : { n : "BrtMergeCell" , f : parse _BrtMergeCell } , 177 : { n : "BrtBeginMergeCells" , f : parsenoop } , 178 : { n : "BrtEndMergeCells" , f : parsenoop } , 179 : { n : "BrtBeginPivotCacheDef" , f : parsenoop } , 180 : { n : "BrtEndPivotCacheDef" , f : parsenoop } , 181 : { n : "BrtBeginPCDFields" , f : parsenoop } , 182 : { n : "BrtEndPCDFields" , f : parsenoop } , 183 : { n : "BrtBeginPCDField" , f : parsenoop } , 184 : { n : "BrtEndPCDField" , f : parsenoop } , 185 : { n : "BrtBeginPCDSource" , f : parsenoop } , 186 : { n : "BrtEndPCDSource" , f : parsenoop } , 187 : { n : "BrtBeginPCDSRange" , f : parsenoop } , 188 : { n : "BrtEndPCDSRange" , f : parsenoop } , 189 : { n : "BrtBeginPCDFAtbl" , f : parsenoop } , 190 : { n : "BrtEndPCDFAtbl" , f : parsenoop } , 191 : { n : "BrtBeginPCDIRun" , f : parsenoop } , 192 : { n : "BrtEndPCDIRun" , f : parsenoop } , 193 : { n : "BrtBeginPivotCacheRecords" , f : parsenoop } , 194 : { n : "BrtEndPivotCacheRecords" , f : parsenoop } , 195 : { n : "BrtBeginPCDHierarchies" , f : parsenoop } , 196 : { n : "BrtEndPCDHierarchies" , f : parsenoop } , 197 : { n : "BrtBeginPCDHierarchy" , f : parsenoop } , 198 : { n : "BrtEndPCDHierarchy" , f : parsenoop } , 199 : { n : "BrtBeginPCDHFieldsUsage" , f : parsenoop } , 200 : { n : "BrtEndPCDHFieldsUsage" , f : parsenoop } , 201 : { n : "BrtBeginExtConnection" , f : parsenoop } , 202 : { n : "BrtEndExtConnection" , f : parsenoop } , 203 : { n : "BrtBeginECDbProps" , f : parsenoop } , 204 : { n : "BrtEndECDbProps" , f : parsenoop } , 205 : { n : "BrtBeginECOlapProps" , f : parsenoop } , 206 : { n : "BrtEndECOlapProps" , f : parsenoop } , 207 : { n : "BrtBeginPCDSConsol" , f : parsenoop } , 208 : { n : "BrtEndPCDSConsol" , f : parsenoop } , 209 : { n : "BrtBeginPCDSCPages" , f : parsenoop } , 210 : { n : "BrtEndPCDSCPages" , f : parsenoop } , 211 : { n : "BrtBeginPCDSCPage" , f : parsenoop } , 212 : { n : "BrtEndPCDSCPage" , f : parsenoop } , 213 : { n : "BrtBeginPCDSCPItem" , f : parsenoop } , 214 : { n : "BrtEndPCDSCPItem" , f : parsen
} , 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 } , 154 : { n : "FnGroupName" , f : parse _FnGroupName } , 155 : { n : "FilterMode" , f : parse _FilterMode } , 156 : { n : "BuiltInFnGroupCount" , f : parse _BuiltInFnGroupCount } , 157 : { n : "AutoFilterInfo" , f : parse _AutoFilterInfo } , 158 : { n : "AutoFilter" , f : parse _AutoFilter } , 160 : { n : "Scl" , f : parse _Scl } , 161 : { n : "Setup" , f : parse _Setup } , 174 : { n : "ScenMan" , f : parse _ScenMan } , 175 : { n : "SCENARIO" , f : parse _SCENARIO } , 176 : { n : "SxView" , f : parse _SxView } , 177 : { n : "Sxvd" , f : parse _Sxvd } , 178 : { n : "SXVI" , f : parse _SXVI } , 180 : { n : "SxIvd" , f : parse _SxIvd } , 181 : { n : "SXLI" , f : parse _SXLI } , 182 : { n : "SXPI" , f : parse _SXPI } , 184 : { n : "DocRoute" , f : parse _DocRoute } , 185 : { n : "RecipName" , f : parse _RecipName } , 189 : { n : "MulRk" , f : parse _MulRk } , 190 : { n : "MulBlank" , f : parse _MulBlank } , 193 : { n : "Mms" , f : parse _Mms } , 197 : { n : "SXDI" , f : parse _SXDI } , 198 : { n : "SXDB" , f : parse _SXDB } , 199 : { n : "SXFDB" , f : parse _SXFDB } , 200 : { n : "SXDBB" , f : parse _SXDBB } , 201 : { n : "SXNum" , f : parse _SXNum } , 202 : { n : "SxBool" , f : parse _SxBool } , 203 : { n : "SxErr" , f : parse _SxErr } , 204 : { n : "SXInt" , f : parse _SXInt } , 205 : { n : "SXString" , f : parse _SXString } , 206 : { n : "SXDtr" , f : parse _SXDtr } , 207 : { n : "SxNil" , f : parse _SxNil } , 208 : { n : "SXTbl" , f : parse _SXTbl } , 209 : { n : "SXTBRGIITM" , f : parse _SXTBRGIITM } , 210 : { n : "SxTbpg" , f : parse _SxTbpg } , 211 : { n : "ObProj" , f : parse _ObProj } , 213 : { n : "SXStreamID" , f : parse _SXStreamID } , 215 : { n : "DBCell" , f : parse _DBCell } , 216 : { n : "SXRng" , f : parse _SXRng } , 217 : { n : "SxIsxoper" , f : parse _SxIsxoper } , 218 : { n : "BookBool" , f : parse _BookBool } , 220 : { n : "DbOrParamQry" , f : parse _DbOrParamQry } , 221 : { n : "ScenarioProtect" , f : parse _ScenarioProtect } , 222 : { n : "OleObjectSize" , f : parse _OleObjectSize } , 224 : { n : "XF" , f : parse _XF } , 225 : { n : "InterfaceHdr" , f : parse _InterfaceHdr } , 226 : { n : "InterfaceEnd" , f : parse _InterfaceEnd } , 227 : { n : "SXVS" , f : parse _SXVS } , 229 : { n : "MergeCells" , f : parse _MergeCells } , 233 : { n : "BkHim" , f : parse _BkHim } , 235 : { n : "MsoDrawingGroup" , f : parse _MsoDrawingGroup } , 236 : { n : "MsoDrawing" , f : parse _MsoDrawing } , 237 : { n : "MsoDrawingSelection" , f : parse _MsoDrawingSelection } , 239 : { n : "PhoneticInfo" , f : parse _PhoneticInfo } , 240 : { n : "SxRule" , f : parse _SxRule } , 241 : { n : "SXEx" , f : parse _SXEx } , 242 : { n : "SxFilt" , f : parse _SxFilt } , 244 : { n : "SxDXF" , f : parse _SxDXF } , 245 : { n : "SxItm" , f : parse _SxItm } , 246 : { n : "SxName" , f : parse _SxName } , 247 : { n : "SxSelect" , f : parse _SxSelect } , 248 : { n : "SXPair" , f : parse _SXPair } , 249 : { n : "SxFmla" , f : parse _SxFmla } , 251 : { n : "SxFormat" , f : parse _SxFormat } , 252 : { n : "SST" , f : parse _SST } , 253 : { n : "LabelSst" , f : parse _LabelSst } , 255 : { n : "ExtSST" , f : parse _ExtSST } , 256 : { n : "SXVDEx" , f : parse _SXVDEx } , 259 : { n : "SXFormula" , f : parse _SXFormula } , 290 : { n : "SXDBEx" , f : parse _SXDBEx } , 311 : { n : "RRDInsDel" , f : parse _RRDInsDel } , 312 : { n : "RRDHead" , f : parse _RRDHead } , 315 : { n : "RRDChgCell" , f : parse _RRDChgCell } , 317 : { n : "RRTabId" , f : parse _RRTabId } , 318 : { n : "RRDRenSheet" , f : parse _RRDRenSheet } , 319 : { n : "RRSort" , f : parse _RRSort } , 320 : { n : "RRDMove" , f : parse _RRDMove } , 330 : { n : "RRFormat" , f : parse _RRFormat } , 331 : { n : "RRAutoFmt" , f : parse _RRAutoFmt } , 333 : { n : "RRInsertSh" , f : parse _RRInsertSh } , 334 : { n : "RRDMoveBegin" , f : parse _RRDMoveBegin } , 335 : { n : "RRDMoveEnd" , f : parse _RRDMoveEnd } , 336 : { n : "RRDInsDelBegin" , f : parse _RRDInsDelBegin } , 337 : { n : "RRDInsDelEnd" , f : parse _RRDInsD
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 _obj _str ( factory ) { return function write _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 factory . from _sheet ( wb . Sheets [ wb . SheetNames [ idx ] ] , o ) } } var write _htm _str = write _obj _str ( HTML _ ) ; var write _csv _str = write _obj _str ( { from _sheet : sheet _to _csv } ) ; var write _slk _str = write _obj _str ( SYLK ) ; var write _dif _str = write _obj _str ( DIF ) ; var write _prn _str = write _obj _str ( PRN ) ; var write _txt _str = write _obj _str ( { from _sheet : sheet _to _txt } ) ; 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 get _sheet _type ( n ) { if ( RELS . WS . indexOf ( n ) > - 1 ) return "sheet" ; if ( RELS . CS && n == RELS . CS ) return "chart" ; if ( RELS . DS && n == RELS . DS ) return "dialog" ; if ( RELS . MS && n == RELS . MS ) return "macro" ; if ( ! n || ! n . length ) return "sheet" ; return n } function safe _parse _wbrels ( wbrels , sheets ) { if ( ! wbrels ) return 0 ; try { wbrels = sheets . map ( function pwbr ( w ) { if ( ! w . id ) w . id = w . strRelID ; return [ w . name , wbrels [ "!id" ] [ w . id ] . Target , get _sheet _type ( wbrels [ "!id" ] [ w . id ] . Type ) ] } ) } catch ( e ) { return null } return ! wbrels || wbrels . length === 0 ? null : wbrels } function safe _parse _sheet ( zip , path , relsPath , sheet , sheetRels , sheets , stype , opts , wb , themes , styles ) { try { sheetRels [ sheet ] = parse _rels ( getzipstr ( zip , relsPath , true ) , path ) ; var data = getzipdata ( zip , path ) ; switch ( stype ) { case "sheet" : sheets [ sheet ] = parse _ws ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; case "chart" : var cs = parse _cs ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; sheets [ sheet ] = cs ; if ( ! cs || ! cs [ "!chart" ] ) break ; var dfile = resolve _path ( cs [ "!chart" ] . Target , path ) ; var drelsp = get _rels _path ( dfile ) ; var draw = parse _drawing ( getzipstr ( zip , dfile , true ) , parse _rels ( getzipstr ( zip , drelsp , true ) , dfile ) ) ; var chartp = resolve _path ( draw , dfile ) ; var crelsp = get _rels _path ( chartp ) ; cs = parse _chart ( getzipstr ( zip , chartp , true ) , chartp , opts , parse _rels ( getzipstr ( zip , crelsp , true ) , chartp ) , wb , cs ) ; break ; case "macro" : sheets [ sheet ] = parse _ms ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break ; case "dialog" : sheets [ sheet ] = parse _ds ( data , path , opts , sheetRels [ sheet ] , wb , themes , styles ) ; break } } 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