(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define("pdfjs-dist/build/pdf.worker",["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.pdfjsDistBuildPdfWorker={})}})(this,function(exports){"use strict";var pdfjsVersion="1.6.210";var pdfjsBuild="4ce2356";var pdfjsFilePath=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:null;var pdfjsLibs={};(function pdfjsWrapper(){(function(root,factory){{factory(root.pdfjsCoreArithmeticDecoder={})}})(this,function(exports){var ArithmeticDecoder=function ArithmeticDecoderClosure(){var QeTable=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];function ArithmeticDecoder(data,start,end){this.data=data;this.bp=start;this.dataEnd=end;this.chigh=data[start];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}ArithmeticDecoder.prototype={byteIn:function ArithmeticDecoder_byteIn(){var data=this.data;var bp=this.bp;if(data[bp]===255){var b1=data[bp+1];if(b1>143){this.clow+=65280;this.ct=8}else{bp++;this.clow+=data[bp]<<9;this.ct=7;this.bp=bp}}else{bp++;this.clow+=bp65535){this.chigh+=this.clow>>16;this.clow&=65535}},readBit:function ArithmeticDecoder_readBit(contexts,pos){var cx_index=contexts[pos]>>1,cx_mps=contexts[pos]&1;var qeTableIcx=QeTable[cx_index];var qeIcx=qeTableIcx.qe;var d;var a=this.a-qeIcx;if(this.chigh>15&1;this.clow=this.clow<<1&65535;this.ct--}while((a&32768)===0);this.a=a;contexts[pos]=cx_index<<1|cx_mps;return d}};return ArithmeticDecoder}();exports.ArithmeticDecoder=ArithmeticDecoder});(function(root,factory){{factory(root.pdfjsCoreBidi={})}})(this,function(exports){var baseTypes=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","ON","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"];var arabicTypes=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"];function isOdd(i){return(i&1)!==0}function isEven(i){return(i&1)===0}function findUnequal(arr,start,value){for(var j=start,jj=arr.length;j=0;--j){if(types[j]!=="ET"){break}types[j]="EN"}for(j=i+1;j0){before=types[i-1]}var after=eor;if(end+1level&&isOdd(level)){lowestOddLevel=level}}for(level=highestLevel;level>=lowestOddLevel;--level){var start=-1;for(i=0,ii=levels.length;i=0){reverseValues(chars,start,i);start=-1}}else if(start<0){start=i}}if(start>=0){reverseValues(chars,start,levels.length)}}for(i=0,ii=chars.length;i"){chars[i]=""}}return createBidiText(chars.join(""),isLTR)}exports.bidi=bidi});(function(root,factory){{factory(root.pdfjsCoreCharsets={})}})(this,function(exports){var ISOAdobeCharset=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"];var ExpertCharset=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];var ExpertSubsetCharset=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];exports.ISOAdobeCharset=ISOAdobeCharset;exports.ExpertCharset=ExpertCharset;exports.ExpertSubsetCharset=ExpertSubsetCharset});(function(root,factory){{factory(root.pdfjsCoreEncodings={})}})(this,function(exports){var ExpertEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];var MacExpertEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall"];var MacRomanEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"];var StandardEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"];var WinAnsiEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"];var SymbolSetEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt"];var ZapfDingbatsEncoding=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191"];function getEncoding(encodingName){switch(encodingName){case"WinAnsiEncoding":return WinAnsiEncoding;case"StandardEncoding":return StandardEncoding;case"MacRomanEncoding":return MacRomanEncoding;case"SymbolSetEncoding":return SymbolSetEncoding;case"ZapfDingbatsEncoding":return ZapfDingbatsEncoding;case"ExpertEncoding":return ExpertEncoding;case"MacExpertEncoding":return MacExpertEncoding;default:return null}}exports.WinAnsiEncoding=WinAnsiEncoding;exports.StandardEncoding=StandardEncoding;exports.MacRomanEncoding=MacRomanEncoding;exports.SymbolSetEncoding=SymbolSetEncoding;exports.ZapfDingbatsEncoding=ZapfDingbatsEncoding;exports.ExpertEncoding=ExpertEncoding;exports.getEncoding=getEncoding});(function(root,factory){{factory(root.pdfjsSharedUtil={})}})(this,function(exports){var globalScope=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:this;var FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];var TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};var ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};var AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};var AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};var AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864}; var AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};var StreamType={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9};var FontType={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10};var VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};var OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};var verbosity=VERBOSITY_LEVELS.warnings;function setVerbosityLevel(level){verbosity=level}function getVerbosityLevel(){return verbosity}function info(msg){if(verbosity>=VERBOSITY_LEVELS.infos){console.log("Info: "+msg)}}function warn(msg){if(verbosity>=VERBOSITY_LEVELS.warnings){console.log("Warning: "+msg)}}function deprecated(details){console.log("Deprecated API usage: "+details)}function error(msg){if(verbosity>=VERBOSITY_LEVELS.errors){console.log("Error: "+msg);console.log(backtrace())}throw new Error(msg)}function backtrace(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function assert(cond,msg){if(!cond){error(msg)}}var UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"};function isSameOrigin(baseUrl,otherUrl){try{var base=new URL(baseUrl);if(!base.origin||base.origin==="null"){return false}}catch(e){return false}var other=new URL(otherUrl,base);return base.origin===other.origin}function isValidUrl(url,allowRelative){if(!url||typeof url!=="string"){return false}var protocol=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url);if(!protocol){return allowRelative}protocol=protocol[0].toLowerCase();switch(protocol){case"http":case"https":case"ftp":case"mailto":case"tel":return true;default:return false}}function shadow(obj,prop,value){Object.defineProperty(obj,prop,{value:value,enumerable:true,configurable:true,writable:false});return value}function getLookupTableFactory(initializer){var lookup;return function(){if(initializer){lookup=Object.create(null);initializer(lookup);initializer=null}return lookup}}var PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var PasswordException=function PasswordExceptionClosure(){function PasswordException(msg,code){this.name="PasswordException";this.message=msg;this.code=code}PasswordException.prototype=new Error;PasswordException.constructor=PasswordException;return PasswordException}();var UnknownErrorException=function UnknownErrorExceptionClosure(){function UnknownErrorException(msg,details){this.name="UnknownErrorException";this.message=msg;this.details=details}UnknownErrorException.prototype=new Error;UnknownErrorException.constructor=UnknownErrorException;return UnknownErrorException}();var InvalidPDFException=function InvalidPDFExceptionClosure(){function InvalidPDFException(msg){this.name="InvalidPDFException";this.message=msg}InvalidPDFException.prototype=new Error;InvalidPDFException.constructor=InvalidPDFException;return InvalidPDFException}();var MissingPDFException=function MissingPDFExceptionClosure(){function MissingPDFException(msg){this.name="MissingPDFException";this.message=msg}MissingPDFException.prototype=new Error;MissingPDFException.constructor=MissingPDFException;return MissingPDFException}();var UnexpectedResponseException=function UnexpectedResponseExceptionClosure(){function UnexpectedResponseException(msg,status){this.name="UnexpectedResponseException";this.message=msg;this.status=status}UnexpectedResponseException.prototype=new Error;UnexpectedResponseException.constructor=UnexpectedResponseException;return UnexpectedResponseException}();var NotImplementedException=function NotImplementedExceptionClosure(){function NotImplementedException(msg){this.message=msg}NotImplementedException.prototype=new Error;NotImplementedException.prototype.name="NotImplementedException";NotImplementedException.constructor=NotImplementedException;return NotImplementedException}();var MissingDataException=function MissingDataExceptionClosure(){function MissingDataException(begin,end){this.begin=begin;this.end=end;this.message="Missing data ["+begin+", "+end+")"}MissingDataException.prototype=new Error;MissingDataException.prototype.name="MissingDataException";MissingDataException.constructor=MissingDataException;return MissingDataException}();var XRefParseException=function XRefParseExceptionClosure(){function XRefParseException(msg){this.message=msg}XRefParseException.prototype=new Error;XRefParseException.prototype.name="XRefParseException";XRefParseException.constructor=XRefParseException;return XRefParseException}();var NullCharactersRegExp=/\x00/g;function removeNullCharacters(str){if(typeof str!=="string"){warn("The argument for removeNullCharacters must be a string.");return str}return str.replace(NullCharactersRegExp,"")}function bytesToString(bytes){assert(bytes!==null&&typeof bytes==="object"&&bytes.length!==undefined,"Invalid argument for bytesToString");var length=bytes.length;var MAX_ARGUMENT_COUNT=8192;if(length>24&255,value>>16&255,value>>8&255,value&255)}function log2(x){var n=1,i=0;while(x>n){n<<=1;i++}return i}function readInt8(data,start){return data[start]<<24>>24}function readUint16(data,offset){return data[offset]<<8|data[offset+1]}function readUint32(data,offset){return(data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3])>>>0}function isLittleEndian(){var buffer8=new Uint8Array(2);buffer8[0]=1;var buffer16=new Uint16Array(buffer8.buffer);return buffer16[0]===1}function isEvalSupported(){try{new Function("");return true}catch(e){return false}}var Uint32ArrayView=function Uint32ArrayViewClosure(){function Uint32ArrayView(buffer,length){this.buffer=buffer;this.byteLength=buffer.length;this.length=length===undefined?this.byteLength>>2:length;ensureUint32ArrayViewProps(this.length)}Uint32ArrayView.prototype=Object.create(null);var uint32ArrayViewSetters=0;function createUint32ArrayProp(index){return{get:function(){var buffer=this.buffer,offset=index<<2;return(buffer[offset]|buffer[offset+1]<<8|buffer[offset+2]<<16|buffer[offset+3]<<24)>>>0},set:function(value){var buffer=this.buffer,offset=index<<2;buffer[offset]=value&255;buffer[offset+1]=value>>8&255;buffer[offset+2]=value>>16&255;buffer[offset+3]=value>>>24&255}}}function ensureUint32ArrayViewProps(length){while(uint32ArrayViewSettersrect[2]){r[0]=rect[2];r[2]=rect[0]}if(rect[1]>rect[3]){r[1]=rect[3];r[3]=rect[1]}return r};Util.intersect=function Util_intersect(rect1,rect2){function compare(a,b){return a-b}var orderedX=[rect1[0],rect1[2],rect2[0],rect2[2]].sort(compare),orderedY=[rect1[1],rect1[3],rect2[1],rect2[3]].sort(compare),result=[];rect1=Util.normalizeRect(rect1);rect2=Util.normalizeRect(rect2);if(orderedX[0]===rect1[0]&&orderedX[1]===rect2[0]||orderedX[0]===rect2[0]&&orderedX[1]===rect1[0]){result[0]=orderedX[1];result[2]=orderedX[2]}else{return false}if(orderedY[0]===rect1[1]&&orderedY[1]===rect2[1]||orderedY[0]===rect2[1]&&orderedY[1]===rect1[1]){result[1]=orderedY[1];result[3]=orderedY[2]}else{return false}return result};Util.sign=function Util_sign(num){return num<0?-1:1};var ROMAN_NUMBER_MAP=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];Util.toRoman=function Util_toRoman(number,lowerCase){assert(isInt(number)&&number>0,"The number should be a positive integer.");var pos,romanBuf=[];while(number>=1e3){number-=1e3;romanBuf.push("M")}pos=number/100|0;number%=100;romanBuf.push(ROMAN_NUMBER_MAP[pos]);pos=number/10|0;number%=10;romanBuf.push(ROMAN_NUMBER_MAP[10+pos]);romanBuf.push(ROMAN_NUMBER_MAP[20+number]);var romanStr=romanBuf.join("");return lowerCase?romanStr.toLowerCase():romanStr};Util.appendToArray=function Util_appendToArray(arr1,arr2){Array.prototype.push.apply(arr1,arr2)};Util.prependToArray=function Util_prependToArray(arr1,arr2){Array.prototype.unshift.apply(arr1,arr2)};Util.extendObj=function extendObj(obj1,obj2){for(var key in obj2){obj1[key]=obj2[key]}};Util.getInheritableProperty=function Util_getInheritableProperty(dict,name){while(dict&&!dict.has(name)){dict=dict.get("Parent")}if(!dict){return null}return dict.get(name)};Util.inherit=function Util_inherit(sub,base,prototype){sub.prototype=Object.create(base.prototype);sub.prototype.constructor=sub;for(var prop in prototype){sub.prototype[prop]=prototype[prop]}};Util.loadScript=function Util_loadScript(src,callback){var script=document.createElement("script");var loaded=false;script.setAttribute("src",src);if(callback){script.onload=function(){if(!loaded){callback()}loaded=true}}document.getElementsByTagName("head")[0].appendChild(script)};return Util}();var PageViewport=function PageViewportClosure(){function PageViewport(viewBox,scale,rotation,offsetX,offsetY,dontFlip){this.viewBox=viewBox;this.scale=scale;this.rotation=rotation;this.offsetX=offsetX;this.offsetY=offsetY;var centerX=(viewBox[2]+viewBox[0])/2;var centerY=(viewBox[3]+viewBox[1])/2;var rotateA,rotateB,rotateC,rotateD;rotation=rotation%360;rotation=rotation<0?rotation+360:rotation;switch(rotation){case 180:rotateA=-1;rotateB=0;rotateC=0;rotateD=1;break;case 90:rotateA=0;rotateB=1;rotateC=1;rotateD=0;break;case 270:rotateA=0;rotateB=-1;rotateC=-1;rotateD=0;break;default:rotateA=1;rotateB=0;rotateC=0;rotateD=-1;break}if(dontFlip){rotateC=-rotateC;rotateD=-rotateD}var offsetCanvasX,offsetCanvasY;var width,height;if(rotateA===0){offsetCanvasX=Math.abs(centerY-viewBox[1])*scale+offsetX;offsetCanvasY=Math.abs(centerX-viewBox[0])*scale+offsetY;width=Math.abs(viewBox[3]-viewBox[1])*scale;height=Math.abs(viewBox[2]-viewBox[0])*scale}else{offsetCanvasX=Math.abs(centerX-viewBox[0])*scale+offsetX;offsetCanvasY=Math.abs(centerY-viewBox[1])*scale+offsetY;width=Math.abs(viewBox[2]-viewBox[0])*scale;height=Math.abs(viewBox[3]-viewBox[1])*scale}this.transform=[rotateA*scale,rotateB*scale,rotateC*scale,rotateD*scale,offsetCanvasX-rotateA*scale*centerX-rotateC*scale*centerY,offsetCanvasY-rotateB*scale*centerX-rotateD*scale*centerY];this.width=width;this.height=height;this.fontScale=scale}PageViewport.prototype={clone:function PageViewPort_clone(args){args=args||{};var scale="scale"in args?args.scale:this.scale;var rotation="rotation"in args?args.rotation:this.rotation;return new PageViewport(this.viewBox.slice(),scale,rotation,this.offsetX,this.offsetY,args.dontFlip)},convertToViewportPoint:function PageViewport_convertToViewportPoint(x,y){return Util.applyTransform([x,y],this.transform)},convertToViewportRectangle:function PageViewport_convertToViewportRectangle(rect){var tl=Util.applyTransform([rect[0],rect[1]],this.transform);var br=Util.applyTransform([rect[2],rect[3]],this.transform);return[tl[0],tl[1],br[0],br[1]]},convertToPdfPoint:function PageViewport_convertToPdfPoint(x,y){return Util.applyInverseTransform([x,y],this.transform)}};return PageViewport}();var PDFStringTranslateTable=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToPDFString(str){var i,n=str.length,strBuf=[];if(str[0]==="þ"&&str[1]==="ÿ"){for(i=2;i0){var handler=this.handlers.shift();var nextStatus=handler.thisPromise._status;var nextValue=handler.thisPromise._value;try{if(nextStatus===STATUS_RESOLVED){if(typeof handler.onResolve==="function"){nextValue=handler.onResolve(nextValue)}}else if(typeof handler.onReject==="function"){nextValue=handler.onReject(nextValue);nextStatus=STATUS_RESOLVED;if(handler.thisPromise._unhandledRejection){this.removeUnhandeledRejection(handler.thisPromise)}}}catch(ex){nextStatus=STATUS_REJECTED;nextValue=ex}handler.nextPromise._updateStatus(nextStatus,nextValue);if(Date.now()>=timeoutAt){break}}if(this.handlers.length>0){setTimeout(this.runHandlers.bind(this),0);return}this.running=false},addUnhandledRejection:function addUnhandledRejection(promise){this.unhandledRejections.push({promise:promise,time:Date.now()});this.scheduleRejectionCheck()},removeUnhandeledRejection:function removeUnhandeledRejection(promise){promise._unhandledRejection=false;for(var i=0;iREJECTION_TIMEOUT){var unhandled=this.unhandledRejections[i].promise._value;var msg="Unhandled rejection: "+unhandled;if(unhandled.stack){msg+="\n"+unhandled.stack}warn(msg);this.unhandledRejections.splice(i);i--}}if(this.unhandledRejections.length){this.scheduleRejectionCheck()}}.bind(this),REJECTION_TIMEOUT)}};function Promise(resolver){this._status=STATUS_PENDING;this._handlers=[];try{resolver.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}Promise.all=function Promise_all(promises){var resolveAll,rejectAll;var deferred=new Promise(function(resolve,reject){resolveAll=resolve;rejectAll=reject});var unresolved=promises.length;var results=[];if(unresolved===0){resolveAll(results);return deferred}function reject(reason){if(deferred._status===STATUS_REJECTED){return}results=[];rejectAll(reason)}for(var i=0,ii=promises.length;ilongest){longest=name.length}}for(i=0,ii=times.length;i>2,d2=(b1&3)<<4|b2>>4;var d3=i+1>6:64;var d4=i+232&&unicode<127&&[34,35,60,62,63,96].indexOf(unicode)===-1){return c}return encodeURIComponent(c)}function percentEscapeQuery(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,96].indexOf(unicode)===-1){return c}return encodeURIComponent(c)}var EOF,ALPHA=/[a-zA-Z]/,ALPHANUMERIC=/[a-zA-Z0-9\+\-\.]/;function parse(input,stateOverride,base){function err(message){errors.push(message)}var state=stateOverride||"scheme start",cursor=0,buffer="",seenAt=false,seenBracket=false,errors=[];loop:while((input[cursor-1]!==EOF||cursor===0)&&!this._isInvalid){var c=input[cursor];switch(state){case"scheme start":if(c&&ALPHA.test(c)){buffer+=c.toLowerCase();state="scheme"}else if(!stateOverride){buffer="";state="no scheme";continue}else{err("Invalid scheme.");break loop}break;case"scheme":if(c&&ALPHANUMERIC.test(c)){buffer+=c.toLowerCase()}else if(":"===c){this._scheme=buffer;buffer="";if(stateOverride){break loop}if(isRelativeScheme(this._scheme)){this._isRelative=true}if("file"===this._scheme){state="relative"}else if(this._isRelative&&base&&base._scheme===this._scheme){state="relative or authority"}else if(this._isRelative){state="authority first slash"}else{state="scheme data"}}else if(!stateOverride){buffer="";cursor=0;state="no scheme";continue}else if(EOF===c){break loop}else{err("Code point not allowed in scheme: "+c);break loop}break;case"scheme data":if("?"===c){this._query="?";state="query"}else if("#"===c){this._fragment="#";state="fragment"}else{if(EOF!==c&&" "!==c&&"\n"!==c&&"\r"!==c){this._schemeData+=percentEscape(c)}}break;case"no scheme":if(!base||!isRelativeScheme(base._scheme)){err("Missing scheme.");invalid.call(this)}else{state="relative";continue}break;case"relative or authority":if("/"===c&&"/"===input[cursor+1]){state="authority ignore slashes"}else{err("Expected /, got: "+c);state="relative";continue}break;case"relative":this._isRelative=true;if("file"!==this._scheme){this._scheme=base._scheme}if(EOF===c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._username=base._username;this._password=base._password;break loop}else if("/"===c||"\\"===c){if("\\"===c){err("\\ is an invalid code point.")}state="relative slash"}else if("?"===c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query="?";this._username=base._username;this._password=base._password;state="query"}else if("#"===c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._fragment="#";this._username=base._username;this._password=base._password;state="fragment"}else{var nextC=input[cursor+1];var nextNextC=input[cursor+2];if("file"!==this._scheme||!ALPHA.test(c)||nextC!==":"&&nextC!=="|"||EOF!==nextNextC&&"/"!==nextNextC&&"\\"!==nextNextC&&"?"!==nextNextC&&"#"!==nextNextC){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password;this._path=base._path.slice();this._path.pop()}state="relative path";continue}break;case"relative slash":if("/"===c||"\\"===c){if("\\"===c){err("\\ is an invalid code point.") }if("file"===this._scheme){state="file host"}else{state="authority ignore slashes"}}else{if("file"!==this._scheme){this._host=base._host;this._port=base._port;this._username=base._username;this._password=base._password}state="relative path";continue}break;case"authority first slash":if("/"===c){state="authority second slash"}else{err("Expected '/', got: "+c);state="authority ignore slashes";continue}break;case"authority second slash":state="authority ignore slashes";if("/"!==c){err("Expected '/', got: "+c);continue}break;case"authority ignore slashes":if("/"!==c&&"\\"!==c){state="authority";continue}else{err("Expected authority, got: "+c)}break;case"authority":if("@"===c){if(seenAt){err("@ already seen.");buffer+="%40"}seenAt=true;for(var i=0;i=bytesLength){error("Invalid CFF header")}else if(offset!==0){info("cff data is shifted");bytes=bytes.subarray(offset);this.bytes=bytes}var major=bytes[0];var minor=bytes[1];var hdrSize=bytes[2];var offSize=bytes[3];var header=new CFFHeader(major,minor,hdrSize,offSize);return{obj:header,endPos:hdrSize}},parseDict:function CFFParser_parseDict(dict){var pos=0;function parseOperand(){var value=dict[pos++];if(value===30){return parseFloatOperand()}else if(value===28){value=dict[pos++];value=(value<<24|dict[pos++]<<16)>>16;return value}else if(value===29){value=dict[pos++];value=value<<8|dict[pos++];value=value<<8|dict[pos++];value=value<<8|dict[pos++];return value}else if(value>=32&&value<=246){return value-139}else if(value>=247&&value<=250){return(value-247)*256+dict[pos++]+108}else if(value>=251&&value<=254){return-((value-251)*256)-dict[pos++]-108}else{error("255 is not a valid DICT command")}return-1}function parseFloatOperand(){var str="";var eof=15;var lookup=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];var length=dict.length;while(pos>4;var b2=b&15;if(b1===eof){break}str+=lookup[b1];if(b2===eof){break}str+=lookup[b2]}return parseFloat(str)}var operands=[];var entries=[];pos=0;var end=dict.length;while(pos126||c===91||c===93||c===40||c===41||c===123||c===125||c===60||c===62||c===47||c===37||c===35){data[j]=95;continue}data[j]=c}names.push(bytesToString(data))}return names},parseStringIndex:function CFFParser_parseStringIndex(index){var strings=new CFFStrings;for(var i=0,ii=index.count;iMAX_SUBR_NESTING){return false}var stackSize=state.stackSize;var stack=state.stack;var length=data.length;for(var j=0;j>16;j+=2;stackSize++}else if(value===14){if(stackSize>=4){stackSize-=4;if(this.seacAnalysisEnabled){state.seac=stack.slice(stackSize,stackSize+4);return false}}validationCommand=CharstringValidationData[value]}else if(value>=32&&value<=246){stack[stackSize]=value-139;stackSize++}else if(value>=247&&value<=254){stack[stackSize]=value<251?(value-247<<8)+data[j]+108:-(value-251<<8)-data[j]-108;j++;stackSize++}else if(value===255){stack[stackSize]=(data[j]<<24|data[j+1]<<16|data[j+2]<<8|data[j+3])/65536;j+=4;stackSize++}else if(value===19||value===20){state.hints+=stackSize>>1;j+=state.hints+7>>3;stackSize%=2;validationCommand=CharstringValidationData[value]}else if(value===10||value===29){var subrsIndex;if(value===10){subrsIndex=localSubrIndex}else{subrsIndex=globalSubrIndex}if(!subrsIndex){validationCommand=CharstringValidationData[value];warn("Missing subrsIndex for "+validationCommand.id);return false}var bias=32768;if(subrsIndex.count<1240){bias=107}else if(subrsIndex.count<33900){bias=1131}var subrNumber=stack[--stackSize]+bias;if(subrNumber<0||subrNumber>=subrsIndex.count){validationCommand=CharstringValidationData[value];warn("Out of bounds subrIndex for "+validationCommand.id);return false}state.stackSize=stackSize;state.callDepth++;var valid=this.parseCharString(state,subrsIndex.get(subrNumber),localSubrIndex,globalSubrIndex);if(!valid){return false}state.callDepth--;stackSize=state.stackSize;continue}else if(value===11){state.stackSize=stackSize;return true}else{validationCommand=CharstringValidationData[value]}if(validationCommand){if(validationCommand.stem){state.hints+=stackSize>>1}if("min"in validationCommand){if(!state.undefStack&&stackSize=2&&validationCommand.stem){stackSize%=2}else if(stackSize>1){warn("Found too many parameters for stack-clearing command")}if(stackSize>0&&stack[stackSize-1]>=0){state.width=stack[stackSize-1]}}if("stackDelta"in validationCommand){if("stackFn"in validationCommand){validationCommand.stackFn(stack,stackSize)}stackSize+=validationCommand.stackDelta}else if(validationCommand.stackClearing){stackSize=0}else if(validationCommand.resetStack){stackSize=0;state.undefStack=false}else if(validationCommand.undefStack){stackSize=0;state.undefStack=true;state.firstStackClearing=false}}}state.stackSize=stackSize;return true},parseCharStrings:function CFFParser_parseCharStrings(charStrings,localSubrIndex,globalSubrIndex,fdSelect,fdArray){var seacs=[];var widths=[];var count=charStrings.count;for(var i=0;i=fdArray.length){warn("Invalid fd index for glyph index.");valid=false}if(valid){localSubrToUse=fdArray[fdIndex].privateDict.subrsIndex}}else if(localSubrIndex){localSubrToUse=localSubrIndex}if(valid){valid=this.parseCharString(state,charstring,localSubrToUse,globalSubrIndex)}if(state.width!==null){widths[i]=state.width}if(state.seac!==null){seacs[i]=state.seac}if(!valid){charStrings.set(i,new Uint8Array([14]))}}return{charStrings:charStrings,seacs:seacs,widths:widths}},emptyPrivateDictionary:function CFFParser_emptyPrivateDictionary(parentDict){var privateDict=this.createDict(CFFPrivateDict,[],parentDict.strings);parentDict.setByKey(18,[0,0]);parentDict.privateDict=privateDict},parsePrivateDict:function CFFParser_parsePrivateDict(parentDict){if(!parentDict.hasName("Private")){this.emptyPrivateDictionary(parentDict);return}var privateOffset=parentDict.getByName("Private");if(!isArray(privateOffset)||privateOffset.length!==2){parentDict.removeByName("Private");return}var size=privateOffset[0];var offset=privateOffset[1];if(size===0||offset>=this.bytes.length){this.emptyPrivateDictionary(parentDict);return}var privateDictEnd=offset+size;var dictData=this.bytes.subarray(offset,privateDictEnd);var dict=this.parseDict(dictData);var privateDict=this.createDict(CFFPrivateDict,dict,parentDict.strings);parentDict.privateDict=privateDict;if(!privateDict.getByName("Subrs")){return}var subrsOffset=privateDict.getByName("Subrs");var relativeOffset=offset+subrsOffset;if(subrsOffset===0||relativeOffset>=this.bytes.length){this.emptyPrivateDictionary(parentDict);return}var subrsIndex=this.parseIndex(relativeOffset);privateDict.subrsIndex=subrsIndex.obj},parseCharsets:function CFFParser_parseCharsets(pos,length,strings,cid){if(pos===0){return new CFFCharset(true,CFFCharsetPredefinedTypes.ISO_ADOBE,ISOAdobeCharset)}else if(pos===1){return new CFFCharset(true,CFFCharsetPredefinedTypes.EXPERT,ExpertCharset)}else if(pos===2){return new CFFCharset(true,CFFCharsetPredefinedTypes.EXPERT_SUBSET,ExpertSubsetCharset)}var bytes=this.bytes;var start=pos;var format=bytes[pos++];var charset=[".notdef"];var id,count,i;length-=1;switch(format){case 0:for(i=0;i=0&&index<=390){return CFFStandardStrings[index]}if(index-391<=this.strings.length){return this.strings[index-391]}return CFFStandardStrings[0]},add:function CFFStrings_add(value){this.strings.push(value)},get count(){return this.strings.length}};return CFFStrings}();var CFFIndex=function CFFIndexClosure(){function CFFIndex(){this.objects=[];this.length=0}CFFIndex.prototype={add:function CFFIndex_add(data){this.length+=data.length;this.objects.push(data)},set:function CFFIndex_set(index,data){this.length+=data.length-this.objects[index].length;this.objects[index]=data},get:function CFFIndex_get(index){return this.objects[index]},get count(){return this.objects.length}};return CFFIndex}();var CFFDict=function CFFDictClosure(){function CFFDict(tables,strings){this.keyToNameMap=tables.keyToNameMap;this.nameToKeyMap=tables.nameToKeyMap;this.defaults=tables.defaults;this.types=tables.types;this.opcodes=tables.opcodes;this.order=tables.order;this.strings=strings;this.values=Object.create(null)}CFFDict.prototype={setByKey:function CFFDict_setByKey(key,value){if(!(key in this.keyToNameMap)){return false}if(value.length===0){return true}var type=this.types[key];if(type==="num"||type==="sid"||type==="offset"){value=value[0];if(isNaN(value)){warn("Invalid CFFDict value: "+value+", for key: "+key+".");return true}}this.values[key]=value;return true},setByName:function CFFDict_setByName(name,value){if(!(name in this.nameToKeyMap)){error('Invalid dictionary name "'+name+'"')}this.values[this.nameToKeyMap[name]]=value},hasName:function CFFDict_hasName(name){return this.nameToKeyMap[name]in this.values},getByName:function CFFDict_getByName(name){if(!(name in this.nameToKeyMap)){error('Invalid dictionary name "'+name+'"')}var key=this.nameToKeyMap[name];if(!(key in this.values)){return this.defaults[key] }return this.values[key]},removeByName:function CFFDict_removeByName(name){delete this.values[this.nameToKeyMap[name]]}};CFFDict.createTables=function CFFDict_createTables(layout){var tables={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(var i=0,ii=layout.length;i=this.fdSelect.length){return-1}return this.fdSelect[glyphIndex]}};return CFFFDSelect}();var CFFOffsetTracker=function CFFOffsetTrackerClosure(){function CFFOffsetTracker(){this.offsets=Object.create(null)}CFFOffsetTracker.prototype={isTracking:function CFFOffsetTracker_isTracking(key){return key in this.offsets},track:function CFFOffsetTracker_track(key,location){if(key in this.offsets){error("Already tracking location of "+key)}this.offsets[key]=location},offset:function CFFOffsetTracker_offset(value){for(var key in this.offsets){this.offsets[key]+=value}},setEntryLocation:function CFFOffsetTracker_setEntryLocation(key,values,output){if(!(key in this.offsets)){error("Not tracking location of "+key)}var data=output.data;var dataOffset=this.offsets[key];var size=5;for(var i=0,ii=values.length;i>24&255;data[offset2]=value>>16&255;data[offset3]=value>>8&255;data[offset4]=value&255}}};return CFFOffsetTracker}();var CFFCompiler=function CFFCompilerClosure(){function CFFCompiler(cff){this.cff=cff}CFFCompiler.prototype={compile:function CFFCompiler_compile(){var cff=this.cff;var output={data:[],length:0,add:function CFFCompiler_add(data){this.data=this.data.concat(data);this.length=this.data.length}};var header=this.compileHeader(cff.header);output.add(header);var nameIndex=this.compileNameIndex(cff.names);output.add(nameIndex);if(cff.isCIDFont){if(cff.topDict.hasName("FontMatrix")){var base=cff.topDict.getByName("FontMatrix");cff.topDict.removeByName("FontMatrix");for(var i=0,ii=cff.fdArray.length;i=-107&&value<=107){code=[value+139]}else if(value>=108&&value<=1131){value=value-108;code=[(value>>8)+247,value&255]}else if(value>=-1131&&value<=-108){value=-value-108;code=[(value>>8)+251,value&255]}else if(value>=-32768&&value<=32767){code=[28,value>>8&255,value&255]}else{code=[29,value>>24&255,value>>16&255,value>>8&255,value&255]}return code},compileHeader:function CFFCompiler_compileHeader(header){return[header.major,header.minor,header.hdrSize,header.offSize]},compileNameIndex:function CFFCompiler_compileNameIndex(names){var nameIndex=new CFFIndex;for(var i=0,ii=names.length;i>8&255,count&255];var lastOffset=1,i;for(i=0;i>8&255,relativeOffset&255)}else if(offsetSize===3){data.push(relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255)}else{data.push(relativeOffset>>>24&255,relativeOffset>>16&255,relativeOffset>>8&255,relativeOffset&255)}if(objects[i]){relativeOffset+=objects[i].length}}for(i=0;i=this.end?this.numChunks:Math.floor(position/this.chunkSize);var curChunk;for(curChunk=beginChunk;curChunk=end){return}if(end<=this.progressiveDataLength){return}var chunkSize=this.chunkSize;var beginChunk=Math.floor(begin/chunkSize);var endChunk=Math.floor((end-1)/chunkSize)+1;for(var chunk=beginChunk;chunk=this.end){return-1}this.ensureByte(pos);return this.bytes[this.pos++]},getUint16:function ChunkedStream_getUint16(){var b0=this.getByte();var b1=this.getByte();if(b0===-1||b1===-1){return-1}return(b0<<8)+b1},getInt32:function ChunkedStream_getInt32(){var b0=this.getByte();var b1=this.getByte();var b2=this.getByte();var b3=this.getByte();return(b0<<24)+(b1<<16)+(b2<<8)+b3},getBytes:function ChunkedStream_getBytes(length){var bytes=this.bytes;var pos=this.pos;var strEnd=this.end;if(!length){this.ensureRange(pos,strEnd);return bytes.subarray(pos,strEnd)}var end=pos+length;if(end>strEnd){end=strEnd}this.ensureRange(pos,end);this.pos=end;return bytes.subarray(pos,end)},peekByte:function ChunkedStream_peekByte(){var peekedByte=this.getByte();this.pos--;return peekedByte},peekBytes:function ChunkedStream_peekBytes(length){var bytes=this.getBytes(length);this.pos-=bytes.length;return bytes},getByteRange:function ChunkedStream_getBytes(begin,end){this.ensureRange(begin,end);return this.bytes.subarray(begin,end)},skip:function ChunkedStream_skip(n){if(!n){n=1}this.pos+=n},reset:function ChunkedStream_reset(){this.pos=this.start},moveStart:function ChunkedStream_moveStart(){this.start=this.pos},makeSubStream:function ChunkedStream_makeSubStream(start,length,dict){this.ensureRange(start,start+length);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){var chunkSize=this.chunkSize;var beginChunk=Math.floor(this.start/chunkSize);var endChunk=Math.floor((this.end-1)/chunkSize)+1;var missingChunks=[];for(var chunk=beginChunk;chunk=0&&prevChunk+1!==chunk){groupedChunks.push({beginChunk:beginChunk,endChunk:prevChunk+1});beginChunk=chunk}if(i+1===chunks.length){groupedChunks.push({beginChunk:beginChunk,endChunk:chunk+1})}prevChunk=chunk}return groupedChunks},onProgress:function ChunkedStreamManager_onProgress(args){var bytesLoaded=this.stream.numChunksLoaded*this.chunkSize+args.loaded;this.msgHandler.send("DocProgress",{loaded:bytesLoaded,total:this.length})},onReceiveData:function ChunkedStreamManager_onReceiveData(args){var chunk=args.chunk;var isProgressive=args.begin===undefined;var begin=isProgressive?this.progressiveDataLength:args.begin;var end=begin+chunk.byteLength;var beginChunk=Math.floor(begin/this.chunkSize);var endChunk=end>>0}var sign=readBits(1);var value=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);return sign===0?value:value>0?-value:null}function decodeIAID(contextCache,decoder,codeLength){var contexts=contextCache.getContexts("IAID");var prev=1;for(var i=0;i=sbb_left&&j=sbb_top){contextLabel=contextLabel<<1&reuseMask;for(k=0;k=0&&j0=0){bit=bitmap[i0][j0];if(bit){contextLabel|=bit<=width){contextLabel<<=1}else{contextLabel=contextLabel<<1|bitmap[i0][j0]}}for(k=0;k=referenceHeight||j0<0||j0>=referenceWidth){contextLabel<<=1}else{contextLabel=contextLabel<<1|referenceBitmap[i0][j0]}}var pixel=decoder.readBit(contexts,contextLabel);row[j]=pixel}}return bitmap}function decodeSymbolDictionary(huffman,refinement,symbols,numberOfNewSymbols,numberOfExportedSymbols,huffmanTables,templateIndex,at,refinementTemplateIndex,refinementAt,decodingContext){if(huffman){error("JBIG2 error: huffman is not supported")}var newSymbols=[];var currentHeight=0;var symbolCodeLength=log2(symbols.length+numberOfNewSymbols);var decoder=decodingContext.decoder;var contextCache=decodingContext.contextCache;while(newSymbols.length1){bitmap=decodeTextRegion(huffman,refinement,currentWidth,currentHeight,0,numberOfInstances,1,symbols.concat(newSymbols),symbolCodeLength,0,0,1,0,huffmanTables,refinementTemplateIndex,refinementAt,decodingContext)}else{var symbolId=decodeIAID(contextCache,decoder,symbolCodeLength);var rdx=decodeInteger(contextCache,"IARDX",decoder);var rdy=decodeInteger(contextCache,"IARDY",decoder);var symbol=symbolId>1)+rdx,(rdh>>1)+rdy,false,refinementAt,decodingContext)}var offsetT=t-(referenceCorner&1?0:symbolHeight);var offsetS=currentS-(referenceCorner&2?symbolWidth:0);var s2,t2,symbolRow;if(transposed){for(s2=0;s2>5&7;var retainBits=[referredFlags&31];var position=start+6;if(referredFlags===7){referredToCount=readUint32(data,position-1)&536870911;position+=3;var bytes=referredToCount+7>>3;retainBits[0]=data[position++];while(--bytes>0){retainBits.push(data[position++])}}else if(referredFlags===5||referredFlags===6){error("JBIG2 error: invalid referred-to flags")}segmentHeader.retainBits=retainBits;var referredToSegmentNumberSize=segmentHeader.number<=256?1:segmentHeader.number<=65536?2:4;var referredTo=[];var i,ii;for(i=0;i>>24&255;searchPattern[3]=genericRegionInfo.height>>16&255;searchPattern[4]=genericRegionInfo.height>>8&255;searchPattern[5]=genericRegionInfo.height&255;for(i=position,ii=data.length;i>2&3;dictionary.huffmanDWSelector=dictionaryFlags>>4&3;dictionary.bitmapSizeSelector=dictionaryFlags>>6&1;dictionary.aggregationInstancesSelector=dictionaryFlags>>7&1;dictionary.bitmapCodingContextUsed=!!(dictionaryFlags&256);dictionary.bitmapCodingContextRetained=!!(dictionaryFlags&512);dictionary.template=dictionaryFlags>>10&3;dictionary.refinementTemplate=dictionaryFlags>>12&1;position+=2;if(!dictionary.huffman){atLength=dictionary.template===0?4:1;at=[];for(i=0;i>2&3);textRegion.referenceCorner=textRegionSegmentFlags>>4&3;textRegion.transposed=!!(textRegionSegmentFlags&64);textRegion.combinationOperator=textRegionSegmentFlags>>7&3;textRegion.defaultPixelValue=textRegionSegmentFlags>>9&1;textRegion.dsOffset=textRegionSegmentFlags<<17>>27;textRegion.refinementTemplate=textRegionSegmentFlags>>15&1;if(textRegion.huffman){var textRegionHuffmanFlags=readUint16(data,position);position+=2;textRegion.huffmanFS=textRegionHuffmanFlags&3;textRegion.huffmanDS=textRegionHuffmanFlags>>2&3;textRegion.huffmanDT=textRegionHuffmanFlags>>4&3;textRegion.huffmanRefinementDW=textRegionHuffmanFlags>>6&3;textRegion.huffmanRefinementDH=textRegionHuffmanFlags>>8&3;textRegion.huffmanRefinementDX=textRegionHuffmanFlags>>10&3;textRegion.huffmanRefinementDY=textRegionHuffmanFlags>>12&3;textRegion.huffmanRefinementSizeSelector=!!(textRegionHuffmanFlags&14)}if(textRegion.refinement&&!textRegion.refinementTemplate){at=[];for(i=0;i<2;i++){at.push({x:readInt8(data,position),y:readInt8(data,position+1)});position+=2}textRegion.refinementAt=at}textRegion.numberOfSymbolInstances=readUint32(data,position);position+=4;if(textRegion.huffman){error("JBIG2 error: huffman is not supported")}args=[textRegion,header.referredTo,data,position,end];break;case 38:case 39:var genericRegion={};genericRegion.info=readRegionSegmentInformation(data,position);position+=RegionSegmentInformationFieldLength;var genericRegionSegmentFlags=data[position++];genericRegion.mmr=!!(genericRegionSegmentFlags&1);genericRegion.template=genericRegionSegmentFlags>>1&3;genericRegion.prediction=!!(genericRegionSegmentFlags&8);if(!genericRegion.mmr){atLength=genericRegion.template===0?4:1;at=[];for(i=0;i>2&1;pageInfo.combinationOperator=pageSegmentFlags>>3&3;pageInfo.requiresBuffer=!!(pageSegmentFlags&32);pageInfo.combinationOperatorOverride=!!(pageSegmentFlags&64);args=[pageInfo];break;case 49:break;case 50:break;case 51:break;case 62:break;default:error("JBIG2 error: segment type "+header.typeName+"("+header.type+") is not implemented")}var callbackName="on"+header.typeName;if(callbackName in visitor){visitor[callbackName].apply(visitor,args)}}function processSegments(segments,visitor){for(var i=0,ii=segments.length;i>3;var buffer=new Uint8Array(rowSize*info.height);if(info.defaultPixelValue){for(var i=0,ii=buffer.length;i>3;var combinationOperator=pageInfo.combinationOperatorOverride?regionInfo.combinationOperator:pageInfo.combinationOperator;var buffer=this.buffer;var mask0=128>>(regionInfo.x&7);var offset0=regionInfo.y*rowSize+(regionInfo.x>>3);var i,j,mask,offset;switch(combinationOperator){case 0:for(i=0;i>=1;if(!mask){mask=128;offset++}}offset0+=rowSize}break;case 2:for(i=0;i>=1;if(!mask){mask=128;offset++}}offset0+=rowSize}break;default:error("JBIG2 error: operator "+combinationOperator+" is not supported")}},onImmediateGenericRegion:function SimpleSegmentVisitor_onImmediateGenericRegion(region,data,start,end){var regionInfo=region.info;var decodingContext=new DecodingContext(data,start,end);var bitmap=decodeBitmap(region.mmr,regionInfo.width,regionInfo.height,region.template,region.prediction,null,region.at,decodingContext);this.drawBitmap(regionInfo,bitmap)},onImmediateLosslessGenericRegion:function SimpleSegmentVisitor_onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function SimpleSegmentVisitor_onSymbolDictionary(dictionary,currentSegment,referredSegments,data,start,end){var huffmanTables;if(dictionary.huffman){error("JBIG2 error: huffman is not supported")}var symbols=this.symbols;if(!symbols){this.symbols=symbols={}}var inputSymbols=[];for(var i=0,ii=referredSegments.length;i0&&!codeLengths[length-1]){length--}code.push({children:[],index:0});var p=code[0],q;for(i=0;i0){p=code.pop()}p.index++;code.push(p);while(code.length<=i){code.push(q={children:[],index:0});p.children[p.index]=q.children;p=q}k++}if(i+10){bitsCount--;return bitsData>>bitsCount&1}bitsData=data[offset++];if(bitsData===255){var nextByte=data[offset++];if(nextByte){error("JPEG error: unexpected marker "+(bitsData<<8|nextByte).toString(16))}}bitsCount=7;return bitsData>>>7}function decodeHuffman(tree){var node=tree;while(true){node=node[readBit()];if(typeof node==="number"){return node}if(typeof node!=="object"){error("JPEG error: invalid huffman sequence")}}}function receive(length){var n=0;while(length>0){n=n<<1|readBit();length--}return n}function receiveAndExtend(length){if(length===1){return readBit()===1?1:-1}var n=receive(length);if(n>=1<>4;if(s===0){if(r<15){break}k+=16;continue}k+=r;var z=dctZigZag[k];component.blockData[offset+z]=receiveAndExtend(s);k++}}function decodeDCFirst(component,offset){var t=decodeHuffman(component.huffmanTableDC);var diff=t===0?0:receiveAndExtend(t)<0){eobrun--;return}var k=spectralStart,e=spectralEnd;while(k<=e){var rs=decodeHuffman(component.huffmanTableAC);var s=rs&15,r=rs>>4;if(s===0){if(r<15){eobrun=receive(r)+(1<>4;if(s===0){if(r<15){eobrun=receive(r)+(1<=65488&&marker<=65495){offset+=2}else{break}}return offset-startOffset}function quantizeAndInverse(component,blockBufferOffset,p){var qt=component.quantizationTable,blockData=component.blockData;var v0,v1,v2,v3,v4,v5,v6,v7;var p0,p1,p2,p3,p4,p5,p6,p7;var t;if(!qt){error("JPEG error: missing required Quantization Table.")}for(var row=0;row<64;row+=8){p0=blockData[blockBufferOffset+row];p1=blockData[blockBufferOffset+row+1];p2=blockData[blockBufferOffset+row+2];p3=blockData[blockBufferOffset+row+3];p4=blockData[blockBufferOffset+row+4];p5=blockData[blockBufferOffset+row+5];p6=blockData[blockBufferOffset+row+6];p7=blockData[blockBufferOffset+row+7];p0*=qt[row];if((p1|p2|p3|p4|p5|p6|p7)===0){t=dctSqrt2*p0+512>>10;p[row]=t;p[row+1]=t;p[row+2]=t;p[row+3]=t;p[row+4]=t;p[row+5]=t;p[row+6]=t;p[row+7]=t;continue}p1*=qt[row+1];p2*=qt[row+2];p3*=qt[row+3];p4*=qt[row+4];p5*=qt[row+5];p6*=qt[row+6];p7*=qt[row+7];v0=dctSqrt2*p0+128>>8;v1=dctSqrt2*p4+128>>8;v2=p2;v3=p6;v4=dctSqrt1d2*(p1-p7)+128>>8;v7=dctSqrt1d2*(p1+p7)+128>>8;v5=p3<<4;v6=p5<<4;v0=v0+v1+1>>1;v1=v0-v1;t=v2*dctSin6+v3*dctCos6+128>>8;v2=v2*dctCos6-v3*dctSin6+128>>8;v3=t;v4=v4+v6+1>>1;v6=v4-v6;v7=v7+v5+1>>1;v5=v7-v5;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=v4*dctSin3+v7*dctCos3+2048>>12;v4=v4*dctCos3-v7*dctSin3+2048>>12;v7=t;t=v5*dctSin1+v6*dctCos1+2048>>12;v5=v5*dctCos1-v6*dctSin1+2048>>12;v6=t;p[row]=v0+v7;p[row+7]=v0-v7;p[row+1]=v1+v6;p[row+6]=v1-v6;p[row+2]=v2+v5;p[row+5]=v2-v5;p[row+3]=v3+v4;p[row+4]=v3-v4}for(var col=0;col<8;++col){p0=p[col];p1=p[col+8];p2=p[col+16];p3=p[col+24];p4=p[col+32];p5=p[col+40];p6=p[col+48];p7=p[col+56];if((p1|p2|p3|p4|p5|p6|p7)===0){t=dctSqrt2*p0+8192>>14;t=t<-2040?0:t>=2024?255:t+2056>>4;blockData[blockBufferOffset+col]=t;blockData[blockBufferOffset+col+8]=t;blockData[blockBufferOffset+col+16]=t;blockData[blockBufferOffset+col+24]=t;blockData[blockBufferOffset+col+32]=t;blockData[blockBufferOffset+col+40]=t;blockData[blockBufferOffset+col+48]=t;blockData[blockBufferOffset+col+56]=t;continue}v0=dctSqrt2*p0+2048>>12;v1=dctSqrt2*p4+2048>>12;v2=p2;v3=p6;v4=dctSqrt1d2*(p1-p7)+2048>>12;v7=dctSqrt1d2*(p1+p7)+2048>>12;v5=p3;v6=p5;v0=(v0+v1+1>>1)+4112;v1=v0-v1;t=v2*dctSin6+v3*dctCos6+2048>>12;v2=v2*dctCos6-v3*dctSin6+2048>>12;v3=t;v4=v4+v6+1>>1;v6=v4-v6;v7=v7+v5+1>>1;v5=v7-v5;v0=v0+v3+1>>1;v3=v0-v3;v1=v1+v2+1>>1;v2=v1-v2;t=v4*dctSin3+v7*dctCos3+2048>>12;v4=v4*dctCos3-v7*dctSin3+2048>>12;v7=t;t=v5*dctSin1+v6*dctCos1+2048>>12;v5=v5*dctCos1-v6*dctSin1+2048>>12;v6=t;p0=v0+v7;p7=v0-v7;p1=v1+v6;p6=v1-v6;p2=v2+v5;p5=v2-v5;p3=v3+v4;p4=v3-v4;p0=p0<16?0:p0>=4080?255:p0>>4;p1=p1<16?0:p1>=4080?255:p1>>4;p2=p2<16?0:p2>=4080?255:p2>>4;p3=p3<16?0:p3>=4080?255:p3>>4;p4=p4<16?0:p4>=4080?255:p4>>4;p5=p5<16?0:p5>=4080?255:p5>>4;p6=p6<16?0:p6>=4080?255:p6>>4;p7=p7<16?0:p7>=4080?255:p7>>4;blockData[blockBufferOffset+col]=p0;blockData[blockBufferOffset+col+8]=p1;blockData[blockBufferOffset+col+16]=p2;blockData[blockBufferOffset+col+24]=p3;blockData[blockBufferOffset+col+32]=p4;blockData[blockBufferOffset+col+40]=p5;blockData[blockBufferOffset+col+48]=p6;blockData[blockBufferOffset+col+56]=p7}}function buildComponentData(frame,component){var blocksPerLine=component.blocksPerLine;var blocksPerColumn=component.blocksPerColumn;var computationBuffer=new Int16Array(64);for(var blockRow=0;blockRow=255?255:a}JpegImage.prototype={parse:function parse(data){function readUint16(){var value=data[offset]<<8|data[offset+1];offset+=2;return value}function readDataBlock(){var length=readUint16();var array=data.subarray(offset,offset+length-2);offset+=array.length;return array}function prepareComponents(frame){var mcusPerLine=Math.ceil(frame.samplesPerLine/8/frame.maxH);var mcusPerColumn=Math.ceil(frame.scanLines/8/frame.maxV);for(var i=0;i>4===0){for(j=0;j<64;j++){z=dctZigZag[j];tableData[z]=data[offset++]}}else if(quantizationTableSpec>>4===1){for(j=0;j<64;j++){z=dctZigZag[j];tableData[z]=readUint16()}}else{error("JPEG error: DQT - invalid table spec")}quantizationTables[quantizationTableSpec&15]=tableData}break;case 65472:case 65473:case 65474:if(frame){error("JPEG error: Only single frame JPEGs supported")}readUint16();frame={};frame.extended=fileMarker===65473;frame.progressive=fileMarker===65474;frame.precision=data[offset++];frame.scanLines=readUint16();frame.samplesPerLine=readUint16();frame.components=[];frame.componentIds={};var componentsCount=data[offset++],componentId;var maxH=0,maxV=0;for(i=0;i>4;var v=data[offset+1]&15;if(maxH>4===0?huffmanTablesDC:huffmanTablesAC)[huffmanTableSpec&15]=buildHuffmanTable(codeLengths,huffmanValues)}break;case 65501:readUint16();resetInterval=readUint16();break;case 65498:var scanLength=readUint16();var selectorsCount=data[offset++];var components=[],component;for(i=0;i>4];component.huffmanTableAC=huffmanTablesAC[tableSpec&15];components.push(component)}var spectralStart=data[offset++];var spectralEnd=data[offset++];var successiveApproximation=data[offset++];var processed=decodeScan(data,offset,frame,components,resetInterval,spectralStart,spectralEnd,successiveApproximation>>4,successiveApproximation&15);offset+=processed;break;case 65535:if(data[offset]!==255){offset--}break;default:if(data[offset-3]===255&&data[offset-2]>=192&&data[offset-2]<=254){offset-=3;break}error("JPEG error: unknown marker "+fileMarker.toString(16))}fileMarker=readUint16()}this.width=frame.samplesPerLine;this.height=frame.scanLines;this.jfif=jfif;this.adobe=adobe;this.components=[];for(i=0;i>8)+transform[k+1]}}}return data},_isColorConversionNeeded:function isColorConversionNeeded(){if(this.adobe&&this.adobe.transformCode){return true}else if(this.numComponents===3){if(!this.adobe&&this.colorTransform===0){return false}return true}else{if(!this.adobe&&this.colorTransform===1){return true}return false}},_convertYccToRgb:function convertYccToRgb(data){var Y,Cb,Cr;for(var i=0,length=data.length;i=0?255:r<=min?0:255+r*scale|0;data[offset++]=g>=0?255:g<=min?0:255+g*scale|0;data[offset++]=b>=0?255:b<=min?0:255+b*scale|0}return data},getData:function getData(width,height,forceRGBoutput){if(this.numComponents>4){error("JPEG error: Unsupported color mode")}var data=this._getLinearizedBlockData(width,height);if(this.numComponents===1&&forceRGBoutput){var dataLength=data.length;var rgbData=new Uint8Array(dataLength*3);var offset=0;for(var i=0;i>24&255,tbox>>16&255,tbox>>8&255,tbox&255);warn("Unsupported header type "+tbox+" ("+headerType+")");break}if(jumpDataLength){position+=dataLength}}},parseImageProperties:function JpxImage_parseImageProperties(stream){var newByte=stream.getByte();while(newByte>=0){var oldByte=newByte;newByte=stream.getByte();var code=oldByte<<8|newByte;if(code===65361){stream.skip(4);var Xsiz=stream.getInt32()>>>0;var Ysiz=stream.getInt32()>>>0;var XOsiz=stream.getInt32()>>>0;var YOsiz=stream.getInt32()>>>0;stream.skip(16);var Csiz=stream.getUint16();this.width=Xsiz-XOsiz;this.height=Ysiz-YOsiz;this.componentsCount=Csiz;this.bitsPerComponent=8;return}}error("JPX Error: No size marker found in JPX stream")},parseCodestream:function JpxImage_parseCodestream(data,start,end){var context={};var doNotRecover=false;try{var position=start;while(position+1>5;spqcds=[];while(j>3;spqcd.mu=0}else{spqcd.epsilon=data[j]>>3;spqcd.mu=(data[j]&7)<<8|data[j+1];j+=2}spqcds.push(spqcd)}qcd.SPqcds=spqcds;if(context.mainHeader){context.QCD=qcd}else{context.currentTile.QCD=qcd;context.currentTile.QCC=[]}break;case 65373:length=readUint16(data,position);var qcc={};j=position+2;var cqcc;if(context.SIZ.Csiz<257){cqcc=data[j++]}else{cqcc=readUint16(data,j);j+=2}sqcd=data[j++];switch(sqcd&31){case 0:spqcdSize=8;scalarExpounded=true;break;case 1:spqcdSize=16;scalarExpounded=false;break;case 2:spqcdSize=16;scalarExpounded=true;break;default:throw new Error("Invalid SQcd value "+sqcd)}qcc.noQuantization=spqcdSize===8;qcc.scalarExpounded=scalarExpounded;qcc.guardBits=sqcd>>5;spqcds=[];while(j>3;spqcd.mu=0}else{spqcd.epsilon=data[j]>>3;spqcd.mu=(data[j]&7)<<8|data[j+1];j+=2}spqcds.push(spqcd)}qcc.SPqcds=spqcds;if(context.mainHeader){context.QCC[cqcc]=qcc}else{context.currentTile.QCC[cqcc]=qcc}break;case 65362:length=readUint16(data,position);var cod={};j=position+2;var scod=data[j++];cod.entropyCoderWithCustomPrecincts=!!(scod&1);cod.sopMarkerUsed=!!(scod&2);cod.ephMarkerUsed=!!(scod&4);cod.progressionOrder=data[j++];cod.layersCount=readUint16(data,j);j+=2;cod.multipleComponentTransform=data[j++];cod.decompositionLevelsCount=data[j++];cod.xcb=(data[j++]&15)+2;cod.ycb=(data[j++]&15)+2;var blockStyle=data[j++];cod.selectiveArithmeticCodingBypass=!!(blockStyle&1);cod.resetContextProbabilities=!!(blockStyle&2);cod.terminationOnEachCodingPass=!!(blockStyle&4);cod.verticalyStripe=!!(blockStyle&8);cod.predictableTermination=!!(blockStyle&16);cod.segmentationSymbolUsed=!!(blockStyle&32);cod.reversibleTransformation=data[j++];if(cod.entropyCoderWithCustomPrecincts){var precinctsSizes=[];while(j>4})}cod.precinctsSizes=precinctsSizes}var unsupported=[];if(cod.selectiveArithmeticCodingBypass){unsupported.push("selectiveArithmeticCodingBypass")}if(cod.resetContextProbabilities){unsupported.push("resetContextProbabilities")}if(cod.terminationOnEachCodingPass){unsupported.push("terminationOnEachCodingPass")}if(cod.verticalyStripe){unsupported.push("verticalyStripe")}if(cod.predictableTermination){unsupported.push("predictableTermination")}if(unsupported.length>0){doNotRecover=true;throw new Error("Unsupported COD options ("+unsupported.join(", ")+")")}if(context.mainHeader){context.COD=cod}else{context.currentTile.COD=cod;context.currentTile.COC=[]}break;case 65424:length=readUint16(data,position);tile={};tile.index=readUint16(data,position+2);tile.length=readUint32(data,position+4);tile.dataEnd=tile.length+position-2;tile.partIndex=data[position+8];tile.partsCount=data[position+9];context.mainHeader=false;if(tile.partIndex===0){tile.COD=context.COD;tile.COC=context.COC.slice(0);tile.QCD=context.QCD;tile.QCC=context.QCC.slice(0)}context.currentTile=tile;break;case 65427:tile=context.currentTile;if(tile.partIndex===0){initializeTile(context,tile.index);buildPackets(context)}length=tile.dataEnd-position;parseTilePackets(context,data,position,length);break;case 65365:case 65367:case 65368:case 65380:length=readUint16(data,position);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is "+"not implemented");default:throw new Error("Unknown codestream code: "+code.toString(16))}position+=length}}catch(e){if(doNotRecover||this.failOnCorruptedImage){error("JPX Error: "+e.message)}else{warn("JPX: Trying to recover from: "+e.message)}}this.tiles=transformComponents(context);this.width=context.SIZ.Xsiz-context.SIZ.XOsiz;this.height=context.SIZ.Ysiz-context.SIZ.YOsiz;this.componentsCount=context.SIZ.Csiz}};function calculateComponentDimensions(component,siz){component.x0=Math.ceil(siz.XOsiz/component.XRsiz);component.x1=Math.ceil(siz.Xsiz/component.XRsiz);component.y0=Math.ceil(siz.YOsiz/component.YRsiz);component.y1=Math.ceil(siz.Ysiz/component.YRsiz);component.width=component.x1-component.x0;component.height=component.y1-component.y0}function calculateTileGrids(context,components){var siz=context.SIZ;var tile,tiles=[];var numXtiles=Math.ceil((siz.Xsiz-siz.XTOsiz)/siz.XTsiz);var numYtiles=Math.ceil((siz.Ysiz-siz.YTOsiz)/siz.YTsiz);for(var q=0;q0?Math.min(codOrCoc.xcb,result.PPx-1):Math.min(codOrCoc.xcb,result.PPx);result.ycb_=r>0?Math.min(codOrCoc.ycb,result.PPy-1):Math.min(codOrCoc.ycb,result.PPy);return result}function buildPrecincts(context,resolution,dimensions){var precinctWidth=1<resolution.trx0?Math.ceil(resolution.trx1/precinctWidth)-Math.floor(resolution.trx0/precinctWidth):0;var numprecinctshigh=resolution.try1>resolution.try0?Math.ceil(resolution.try1/precinctHeight)-Math.floor(resolution.try0/precinctHeight):0;var numprecincts=numprecinctswide*numprecinctshigh;resolution.precinctParameters={precinctWidth:precinctWidth,precinctHeight:precinctHeight,numprecinctswide:numprecinctswide,numprecinctshigh:numprecinctshigh,numprecincts:numprecincts,precinctWidthInSubband:precinctWidthInSubband,precinctHeightInSubband:precinctHeightInSubband}}function buildCodeblocks(context,subband,dimensions){var xcb_=dimensions.xcb_;var ycb_=dimensions.ycb_;var codeblockWidth=1<>xcb_;var cby0=subband.tby0>>ycb_;var cbx1=subband.tbx1+codeblockWidth-1>>xcb_;var cby1=subband.tby1+codeblockHeight-1>>ycb_;var precinctParameters=subband.resolution.precinctParameters;var codeblocks=[];var precincts=[];var i,j,codeblock,precinctNumber;for(j=cby0;jprecinct.cbxMax){precinct.cbxMax=i}if(jprecinct.cbyMax){precinct.cbyMax=j}}else{precincts[precinctNumber]=precinct={cbxMin:i,cbyMin:j,cbxMax:i,cbyMax:j}}codeblock.precinct=precinct}}subband.codeblockParameters={codeblockWidth:xcb_,codeblockHeight:ycb_,numcodeblockwide:cbx1-cbx0+1,numcodeblockhigh:cby1-cby0+1};subband.codeblocks=codeblocks;subband.precincts=precincts}function createPacket(resolution,precinctNumber,layerNumber){var precinctCodeblocks=[];var subbands=resolution.subbands;for(var i=0,ii=subbands.length;icomponent.codingStyleParameters.decompositionLevelsCount){continue}var resolution=component.resolutions[r];var numprecincts=resolution.precinctParameters.numprecincts;for(;kcomponent.codingStyleParameters.decompositionLevelsCount){continue}var resolution=component.resolutions[r];var numprecincts=resolution.precinctParameters.numprecincts;for(;kcomponent.codingStyleParameters.decompositionLevelsCount){continue}var resolution=component.resolutions[r];var numprecincts=resolution.precinctParameters.numprecincts;if(p>=numprecincts){continue}for(;l=0;--r){var resolution=component.resolutions[r];var widthCurrentResolution=scale*resolution.precinctParameters.precinctWidth;var heightCurrentResolution=scale*resolution.precinctParameters.precinctHeight;minWidthCurrentComponent=Math.min(minWidthCurrentComponent,widthCurrentResolution);minHeightCurrentComponent=Math.min(minHeightCurrentComponent,heightCurrentResolution);maxNumWideCurrentComponent=Math.max(maxNumWideCurrentComponent,resolution.precinctParameters.numprecinctswide);maxNumHighCurrentComponent=Math.max(maxNumHighCurrentComponent,resolution.precinctParameters.numprecinctshigh);sizePerResolution[r]={width:widthCurrentResolution,height:heightCurrentResolution};scale<<=1}minWidth=Math.min(minWidth,minWidthCurrentComponent);minHeight=Math.min(minHeight,minHeightCurrentComponent);maxNumWide=Math.max(maxNumWide,maxNumWideCurrentComponent);maxNumHigh=Math.max(maxNumHigh,maxNumHighCurrentComponent);sizePerComponent[c]={resolutions:sizePerResolution,minWidth:minWidthCurrentComponent,minHeight:minHeightCurrentComponent,maxNumWide:maxNumWideCurrentComponent,maxNumHigh:maxNumHighCurrentComponent}}return{components:sizePerComponent,minWidth:minWidth,minHeight:minHeight,maxNumWide:maxNumWide,maxNumHigh:maxNumHigh}}function buildPackets(context){var siz=context.SIZ;var tileIndex=context.currentTile.index;var tile=context.tiles[tileIndex];var componentsCount=siz.Csiz;for(var c=0;c>>bufferSize&(1<0){var packetItem=queue.shift();codeblock=packetItem.codeblock;if(codeblock["data"]===undefined){codeblock.data=[]}codeblock.data.push({data:data,start:offset+position,end:offset+position+packetItem.dataLength,codingpasses:packetItem.codingpasses});position+=packetItem.dataLength}}return position}function copyCoefficients(coefficients,levelWidth,levelHeight,subband,delta,mb,reversible,segmentationSymbolUsed){var x0=subband.tbx0;var y0=subband.tby0;var width=subband.tbx1-subband.tbx0;var codeblocks=subband.codeblocks;var right=subband.type.charAt(0)==="H"?1:0;var bottom=subband.type.charAt(1)==="H"?levelWidth:0;for(var i=0,ii=codeblocks.length;i=mb){coefficients[pos]=n}else{coefficients[pos]=n*(1<0?1-i:0)}else{mu=spqcds[b].mu;epsilon=spqcds[b].epsilon;b++}var subband=resolution.subbands[j];var gainLog2=SubbandsGainLog2[subband.type];var delta=reversible?1:Math.pow(2,precision+gainLog2-epsilon)*(1+mu/2048);var mb=guardBits+epsilon-1;copyCoefficients(coefficients,width,height,subband,delta,mb,reversible,segmentationSymbolUsed)}subbandCoefficients.push({width:width,height:height,items:coefficients})}var result=transform.calculate(subbandCoefficients,component.tcx0,component.tcy0);return{left:component.tcx0,top:component.tcy0,width:result.width,height:result.height,items:result.items}}function transformComponents(context){var siz=context.SIZ;var components=context.components;var componentsCount=siz.Csiz;var resultImages=[];for(var i=0,ii=context.tiles.length;i=max?255:r>>shift;out[pos++]=g<=0?0:g>=max?255:g>>shift;out[pos++]=b<=0?0:b>=max?255:b>>shift}}else{for(j=0;j>2);r=g+y2;b=g+y1;out[pos++]=r<=0?0:r>=max?255:r>>shift;out[pos++]=g<=0?0:g>=max?255:g>>shift;out[pos++]=b<=0?0:b>=max?255:b>>shift}}if(fourComponents){for(j=0,pos=3;j=maxK?255:k+offset>>shift}}}else{for(c=0;c=max?255:val+offset>>shift;pos+=componentsCount}}}resultImages.push(result)}return resultImages}function initializeTile(context,tileIndex){var siz=context.SIZ;var componentsCount=siz.Csiz;var tile=context.tiles[tileIndex];for(var c=0;c>=1;j>>=1;currentLevel++}currentLevel--;level=this.levels[currentLevel];level.items[level.index]=value;this.currentLevel=currentLevel;delete this.value},incrementValue:function TagTree_incrementValue(){var level=this.levels[this.currentLevel];level.items[level.index]++},nextLevel:function TagTree_nextLevel(){var currentLevel=this.currentLevel;var level=this.levels[currentLevel];var value=level.items[level.index];currentLevel--;if(currentLevel<0){this.value=value;return false}this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return true}};return TagTree}();var InclusionTree=function InclusionTreeClosure(){function InclusionTree(width,height,defaultValue){var levelsLength=log2(Math.max(width,height))+1;this.levels=[];for(var i=0;istopValue){this.currentLevel=currentLevel;this.propagateValues();return false}i>>=1;j>>=1;currentLevel++}this.currentLevel=currentLevel-1;return true},incrementValue:function InclusionTree_incrementValue(stopValue){var level=this.levels[this.currentLevel];level.items[level.index]=stopValue+1;this.propagateValues()},propagateValues:function InclusionTree_propagateValues(){var levelIndex=this.currentLevel;var level=this.levels[levelIndex];var currentValue=level.items[level.index];while(--levelIndex>=0){level=this.levels[levelIndex];level.items[level.index]=currentValue}},nextLevel:function InclusionTree_nextLevel(){var currentLevel=this.currentLevel;var level=this.levels[currentLevel];var value=level.items[level.index];level.items[level.index]=255;currentLevel--;if(currentLevel<0){return false}this.currentLevel=currentLevel;level=this.levels[currentLevel];level.items[level.index]=value;return true}};return InclusionTree}();var BitModel=function BitModelClosure(){var UNIFORM_CONTEXT=17;var RUNLENGTH_CONTEXT=18;var LLAndLHContextsLabel=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]);var HLContextLabel=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]);var HHContextLabel=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function BitModel(width,height,subband,zeroBitPlanes,mb){this.width=width;this.height=height;this.contextLabelTable=subband==="HH"?HHContextLabel:subband==="HL"?HLContextLabel:LLAndLHContextsLabel;var coefficientCount=width*height;this.neighborsSignificance=new Uint8Array(coefficientCount);this.coefficentsSign=new Uint8Array(coefficientCount);this.coefficentsMagnitude=mb>14?new Uint32Array(coefficientCount):mb>6?new Uint16Array(coefficientCount):new Uint8Array(coefficientCount);this.processingFlags=new Uint8Array(coefficientCount);var bitsDecoded=new Uint8Array(coefficientCount);if(zeroBitPlanes!==0){for(var i=0;i0;var right=column+10){i=index-width;if(left){neighborsSignificance[i-1]+=16}if(right){neighborsSignificance[i+1]+=16}neighborsSignificance[i]+=4}if(row+1=height){break}processingFlags[index]&=processedInverseMask;if(coefficentsMagnitude[index]||!neighborsSignificance[index]){continue}var contextLabel=labels[neighborsSignificance[index]];var decision=decoder.readBit(contexts,contextLabel);if(decision){var sign=this.decodeSignBit(i,j,index);coefficentsSign[index]=sign;coefficentsMagnitude[index]=1;this.setNeighborsSignificance(i,j,index);processingFlags[index]|=firstMagnitudeBitMask}bitsDecoded[index]++;processingFlags[index]|=processedMask}}}},decodeSignBit:function BitModel_decodeSignBit(row,column,index){var width=this.width,height=this.height;var coefficentsMagnitude=this.coefficentsMagnitude;var coefficentsSign=this.coefficentsSign;var contribution,sign0,sign1,significance1;var contextLabel,decoded;significance1=column>0&&coefficentsMagnitude[index-1]!==0;if(column+10&&coefficentsMagnitude[index-width]!==0;if(row+1=0){contextLabel=9+contribution;decoded=this.decoder.readBit(this.contexts,contextLabel)}else{contextLabel=9-contribution;decoded=this.decoder.readBit(this.contexts,contextLabel)^1}return decoded},runMagnitudeRefinementPass:function BitModel_runMagnitudeRefinementPass(){var decoder=this.decoder;var width=this.width,height=this.height;var coefficentsMagnitude=this.coefficentsMagnitude;var neighborsSignificance=this.neighborsSignificance;var contexts=this.contexts;var bitsDecoded=this.bitsDecoded;var processingFlags=this.processingFlags;var processedMask=1;var firstMagnitudeBitMask=2;var length=width*height;var width4=width*4;for(var index0=0,indexNext;index0>1;offset=offset|0;var j,n,current,next;var alpha=-1.586134342059924;var beta=-.052980118572961;var gamma=.882911075530934;var delta=.443506852043971;var K=1.230174104914001;var K_=1/K;j=offset-3;for(n=len+4;n--;j+=2){x[j]*=K_}j=offset-2;current=delta*x[j-1];for(n=len+3;n--;j+=2){next=delta*x[j+1];x[j]=K*x[j]-current-next;if(n--){j+=2;current=delta*x[j+1];x[j]=K*x[j]-current-next}else{break}}j=offset-1;current=gamma*x[j-1];for(n=len+2;n--;j+=2){next=gamma*x[j+1];x[j]-=current+next;if(n--){j+=2;current=gamma*x[j+1];x[j]-=current+next}else{break}}j=offset;current=beta*x[j-1];for(n=len+1;n--;j+=2){next=beta*x[j+1];x[j]-=current+next;if(n--){j+=2;current=beta*x[j+1];x[j]-=current+next}else{break}}if(len!==0){j=offset+1;current=alpha*x[j-1];for(n=len;n--;j+=2){next=alpha*x[j+1];x[j]-=current+next;if(n--){j+=2;current=alpha*x[j+1];x[j]-=current+next}else{break}}}};return IrreversibleTransform}();var ReversibleTransform=function ReversibleTransformClosure(){function ReversibleTransform(){Transform.call(this)}ReversibleTransform.prototype=Object.create(Transform.prototype);ReversibleTransform.prototype.filter=function reversibleTransformFilter(x,offset,length){var len=length>>1;offset=offset|0;var j,n;for(j=offset,n=len+1;n--;j+=2){x[j]-=x[j-1]+x[j+1]+2>>2}for(j=offset+1,n=len;n--;j+=2){x[j]+=x[j-1]+x[j+1]>>1}};return ReversibleTransform}();return JpxImage}();exports.JpxImage=JpxImage});(function(root,factory){{factory(root.pdfjsCoreMetrics={},root.pdfjsSharedUtil)}})(this,function(exports,sharedUtil){var getLookupTableFactory=sharedUtil.getLookupTableFactory;var getMetrics=getLookupTableFactory(function(t){t["Courier"]=600;t["Courier-Bold"]=600;t["Courier-BoldOblique"]=600;t["Courier-Oblique"]=600;t["Helvetica"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=278;t["quotedbl"]=355;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=667;t["quoteright"]=222;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=278;t["semicolon"]=278;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=556;t["at"]=1015;t["A"]=667;t["B"]=667;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=500;t["K"]=667;t["L"]=556;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=278;t["backslash"]=278;t["bracketright"]=278;t["asciicircum"]=469;t["underscore"]=556;t["quoteleft"]=222;t["a"]=556;t["b"]=556;t["c"]=500;t["d"]=556;t["e"]=556;t["f"]=278;t["g"]=556;t["h"]=556;t["i"]=222;t["j"]=222;t["k"]=500;t["l"]=222;t["m"]=833;t["n"]=556;t["o"]=556;t["p"]=556;t["q"]=556;t["r"]=333;t["s"]=500;t["t"]=278;t["u"]=556;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=500;t["braceleft"]=334;t["bar"]=260;t["braceright"]=334;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=191;t["quotedblleft"]=333;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=500;t["fl"]=500;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=537;t["bullet"]=350;t["quotesinglbase"]=222;t["quotedblbase"]=333;t["quotedblright"]=333;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=556;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=222;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=556;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=667;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=500;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=500;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=222;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=500;t["scedilla"]=500;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=556;t["acircumflex"]=556;t["Amacron"]=667;t["rcaron"]=333;t["ccedilla"]=500;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=643;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=667;t["Abreve"]=667;t["multiply"]=584;t["uacute"]=556;t["Tcaron"]=611;t["partialdiff"]=476;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=500;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=260;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=333;t["omacron"]=556;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=222;t["tcaron"]=317;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=667;t["Adieresis"]=667;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=222;t["Oacute"]=778;t["oacute"]=556;t["amacron"]=556;t["sacute"]=500;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=556;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=556;t["igrave"]=278;t["ohungarumlaut"]=556;t["Eogonek"]=667;t["dcroat"]=556;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=299;t["Kcommaaccent"]=667;t["Lacute"]=556;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=556;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=556;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=556;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=556;t["Ccaron"]=722;t["ugrave"]=556;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=333;t["Ntilde"]=722;t["otilde"]=556;t["Rcommaaccent"]=722;t["Lcommaaccent"]=556;t["Atilde"]=667;t["Aogonek"]=667;t["Aring"]=667;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=500;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=556;t["tcommaaccent"]=278;t["logicalnot"]=584;t["odieresis"]=556;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=556;t["eth"]=556;t["zcaron"]=500;t["ncommaaccent"]=556;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Helvetica-Bold"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=333;t["quotedbl"]=474;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=722;t["quoteright"]=278;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333; t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=333;t["semicolon"]=333;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=611;t["at"]=975;t["A"]=722;t["B"]=722;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=556;t["K"]=722;t["L"]=611;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=584;t["underscore"]=556;t["quoteleft"]=278;t["a"]=556;t["b"]=611;t["c"]=556;t["d"]=611;t["e"]=556;t["f"]=333;t["g"]=611;t["h"]=611;t["i"]=278;t["j"]=278;t["k"]=556;t["l"]=278;t["m"]=889;t["n"]=611;t["o"]=611;t["p"]=611;t["q"]=611;t["r"]=389;t["s"]=556;t["t"]=333;t["u"]=611;t["v"]=556;t["w"]=778;t["x"]=556;t["y"]=556;t["z"]=500;t["braceleft"]=389;t["bar"]=280;t["braceright"]=389;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=238;t["quotedblleft"]=500;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=611;t["fl"]=611;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=556;t["bullet"]=350;t["quotesinglbase"]=278;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=611;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=611;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=722;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=556;t["scommaaccent"]=556;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=611;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=556;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=556;t["scedilla"]=556;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=611;t["acircumflex"]=556;t["Amacron"]=722;t["rcaron"]=389;t["ccedilla"]=556;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=743;t["Umacron"]=722;t["uring"]=611;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=584;t["uacute"]=611;t["Tcaron"]=611;t["partialdiff"]=494;t["ydieresis"]=556;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=556;t["nacute"]=611;t["umacron"]=611;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=280;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=389;t["omacron"]=611;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=278;t["tcaron"]=389;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=278;t["Oacute"]=778;t["oacute"]=611;t["amacron"]=556;t["sacute"]=556;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=611;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=611;t["igrave"]=278;t["ohungarumlaut"]=611;t["Eogonek"]=667;t["dcroat"]=611;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=400;t["Kcommaaccent"]=722;t["Lacute"]=611;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=611;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=611;t["ntilde"]=611;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=611;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=611;t["Ccaron"]=722;t["ugrave"]=611;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=722;t["otilde"]=611;t["Rcommaaccent"]=722;t["Lcommaaccent"]=611;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=556;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=611;t["tcommaaccent"]=333;t["logicalnot"]=584;t["odieresis"]=611;t["udieresis"]=611;t["notequal"]=549;t["gcommaaccent"]=611;t["eth"]=611;t["zcaron"]=500;t["ncommaaccent"]=611;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Helvetica-BoldOblique"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=333;t["quotedbl"]=474;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=722;t["quoteright"]=278;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=333;t["semicolon"]=333;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=611;t["at"]=975;t["A"]=722;t["B"]=722;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=556;t["K"]=722;t["L"]=611;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=584;t["underscore"]=556;t["quoteleft"]=278;t["a"]=556;t["b"]=611;t["c"]=556;t["d"]=611;t["e"]=556;t["f"]=333;t["g"]=611;t["h"]=611;t["i"]=278;t["j"]=278;t["k"]=556;t["l"]=278;t["m"]=889;t["n"]=611;t["o"]=611;t["p"]=611;t["q"]=611;t["r"]=389;t["s"]=556;t["t"]=333;t["u"]=611;t["v"]=556;t["w"]=778;t["x"]=556;t["y"]=556;t["z"]=500;t["braceleft"]=389;t["bar"]=280;t["braceright"]=389;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=238;t["quotedblleft"]=500;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=611;t["fl"]=611;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=556;t["bullet"]=350;t["quotesinglbase"]=278;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=611;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=611;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=722;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=556;t["scommaaccent"]=556;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=611;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=556;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=556;t["scedilla"]=556;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=611;t["acircumflex"]=556;t["Amacron"]=722;t["rcaron"]=389;t["ccedilla"]=556;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=743;t["Umacron"]=722;t["uring"]=611;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=584;t["uacute"]=611;t["Tcaron"]=611;t["partialdiff"]=494;t["ydieresis"]=556;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=556;t["nacute"]=611;t["umacron"]=611;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=280;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=389;t["omacron"]=611;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=278;t["tcaron"]=389;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=278;t["Oacute"]=778;t["oacute"]=611;t["amacron"]=556;t["sacute"]=556;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=611;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=611;t["igrave"]=278;t["ohungarumlaut"]=611;t["Eogonek"]=667;t["dcroat"]=611;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=400;t["Kcommaaccent"]=722;t["Lacute"]=611;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=611;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=611;t["ntilde"]=611;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=611;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=611;t["Ccaron"]=722;t["ugrave"]=611;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=722;t["otilde"]=611;t["Rcommaaccent"]=722;t["Lcommaaccent"]=611;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=556;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=611;t["tcommaaccent"]=333;t["logicalnot"]=584;t["odieresis"]=611;t["udieresis"]=611;t["notequal"]=549;t["gcommaaccent"]=611;t["eth"]=611;t["zcaron"]=500;t["ncommaaccent"]=611;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Helvetica-Oblique"]=getLookupTableFactory(function(t){t["space"]=278;t["exclam"]=278;t["quotedbl"]=355;t["numbersign"]=556;t["dollar"]=556;t["percent"]=889;t["ampersand"]=667;t["quoteright"]=222;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=389;t["plus"]=584;t["comma"]=278;t["hyphen"]=333;t["period"]=278;t["slash"]=278;t["zero"]=556;t["one"]=556;t["two"]=556;t["three"]=556;t["four"]=556;t["five"]=556;t["six"]=556;t["seven"]=556;t["eight"]=556;t["nine"]=556;t["colon"]=278;t["semicolon"]=278;t["less"]=584;t["equal"]=584;t["greater"]=584;t["question"]=556;t["at"]=1015;t["A"]=667;t["B"]=667;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=722;t["I"]=278;t["J"]=500;t["K"]=667;t["L"]=556;t["M"]=833;t["N"]=722;t["O"]=778;t["P"]=667;t["Q"]=778;t["R"]=722;t["S"]=667;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=944;t["X"]=667;t["Y"]=667;t["Z"]=611;t["bracketleft"]=278;t["backslash"]=278;t["bracketright"]=278;t["asciicircum"]=469;t["underscore"]=556;t["quoteleft"]=222;t["a"]=556;t["b"]=556;t["c"]=500;t["d"]=556;t["e"]=556;t["f"]=278;t["g"]=556;t["h"]=556;t["i"]=222;t["j"]=222;t["k"]=500;t["l"]=222;t["m"]=833;t["n"]=556;t["o"]=556;t["p"]=556;t["q"]=556;t["r"]=333;t["s"]=500;t["t"]=278;t["u"]=556;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=500;t["braceleft"]=334;t["bar"]=260;t["braceright"]=334;t["asciitilde"]=584;t["exclamdown"]=333;t["cent"]=556;t["sterling"]=556;t["fraction"]=167;t["yen"]=556;t["florin"]=556;t["section"]=556;t["currency"]=556;t["quotesingle"]=191;t["quotedblleft"]=333;t["guillemotleft"]=556;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=500;t["fl"]=500;t["endash"]=556;t["dagger"]=556;t["daggerdbl"]=556;t["periodcentered"]=278;t["paragraph"]=537;t["bullet"]=350;t["quotesinglbase"]=222;t["quotedblbase"]=333;t["quotedblright"]=333;t["guillemotright"]=556;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=611;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=370;t["Lslash"]=556;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=365;t["ae"]=889;t["dotlessi"]=278;t["lslash"]=222;t["oslash"]=611;t["oe"]=944;t["germandbls"]=611;t["Idieresis"]=278;t["eacute"]=556;t["abreve"]=556;t["uhungarumlaut"]=556;t["ecaron"]=556;t["Ydieresis"]=667;t["divide"]=584;t["Yacute"]=667;t["Acircumflex"]=667;t["aacute"]=556;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=500;t["ecircumflex"]=556;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=556;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=737;t["Emacron"]=667;t["ccaron"]=500;t["aring"]=556;t["Ncommaaccent"]=722;t["lacute"]=222;t["agrave"]=556;t["Tcommaaccent"]=611;t["Cacute"]=722;t["atilde"]=556;t["Edotaccent"]=667;t["scaron"]=500;t["scedilla"]=500;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=556;t["acircumflex"]=556;t["Amacron"]=667;t["rcaron"]=333;t["ccedilla"]=500;t["Zdotaccent"]=611;t["Thorn"]=667;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=667;t["dcaron"]=643;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=333;t["Ograve"]=778;t["Agrave"]=667;t["Abreve"]=667;t["multiply"]=584;t["uacute"]=556;t["Tcaron"]=611;t["partialdiff"]=476;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=556;t["edieresis"]=556;t["cacute"]=500;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=278;t["plusminus"]=584;t["brokenbar"]=260;t["registered"]=737;t["Gbreve"]=778;t["Idotaccent"]=278;t["summation"]=600;t["Egrave"]=667;t["racute"]=333;t["omacron"]=556;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=222;t["tcaron"]=317;t["eogonek"]=556;t["Uogonek"]=722;t["Aacute"]=667;t["Adieresis"]=667;t["egrave"]=556;t["zacute"]=500;t["iogonek"]=222;t["Oacute"]=778;t["oacute"]=556;t["amacron"]=556;t["sacute"]=500;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=556;t["twosuperior"]=333;t["Odieresis"]=778;t["mu"]=556;t["igrave"]=278;t["ohungarumlaut"]=556;t["Eogonek"]=667;t["dcroat"]=556;t["threequarters"]=834;t["Scedilla"]=667;t["lcaron"]=299;t["Kcommaaccent"]=667;t["Lacute"]=556;t["trademark"]=1e3;t["edotaccent"]=556;t["Igrave"]=278;t["Imacron"]=278;t["Lcaron"]=556;t["onehalf"]=834;t["lessequal"]=549;t["ocircumflex"]=556;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=556;t["gbreve"]=556;t["onequarter"]=834;t["Scaron"]=667;t["Scommaaccent"]=667;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=556;t["Ccaron"]=722;t["ugrave"]=556;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=333;t["Ntilde"]=722;t["otilde"]=556;t["Rcommaaccent"]=722;t["Lcommaaccent"]=556;t["Atilde"]=667;t["Aogonek"]=667;t["Aring"]=667;t["Otilde"]=778;t["zdotaccent"]=500;t["Ecaron"]=667;t["Iogonek"]=278;t["kcommaaccent"]=500;t["minus"]=584;t["Icircumflex"]=278;t["ncaron"]=556;t["tcommaaccent"]=278;t["logicalnot"]=584;t["odieresis"]=556;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=556;t["eth"]=556;t["zcaron"]=500;t["ncommaaccent"]=556;t["onesuperior"]=333;t["imacron"]=278;t["Euro"]=556});t["Symbol"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["universal"]=713;t["numbersign"]=500;t["existential"]=549;t["percent"]=833;t["ampersand"]=778;t["suchthat"]=439;t["parenleft"]=333;t["parenright"]=333;t["asteriskmath"]=500;t["plus"]=549;t["comma"]=250;t["minus"]=549;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=278;t["semicolon"]=278;t["less"]=549;t["equal"]=549;t["greater"]=549;t["question"]=444;t["congruent"]=549;t["Alpha"]=722;t["Beta"]=667;t["Chi"]=722;t["Delta"]=612;t["Epsilon"]=611;t["Phi"]=763;t["Gamma"]=603;t["Eta"]=722;t["Iota"]=333;t["theta1"]=631;t["Kappa"]=722;t["Lambda"]=686;t["Mu"]=889;t["Nu"]=722;t["Omicron"]=722;t["Pi"]=768;t["Theta"]=741;t["Rho"]=556;t["Sigma"]=592;t["Tau"]=611;t["Upsilon"]=690;t["sigma1"]=439;t["Omega"]=768;t["Xi"]=645;t["Psi"]=795;t["Zeta"]=611;t["bracketleft"]=333;t["therefore"]=863;t["bracketright"]=333;t["perpendicular"]=658;t["underscore"]=500;t["radicalex"]=500;t["alpha"]=631;t["beta"]=549;t["chi"]=549;t["delta"]=494;t["epsilon"]=439;t["phi"]=521;t["gamma"]=411;t["eta"]=603;t["iota"]=329;t["phi1"]=603;t["kappa"]=549;t["lambda"]=549;t["mu"]=576;t["nu"]=521;t["omicron"]=549;t["pi"]=549;t["theta"]=521;t["rho"]=549;t["sigma"]=603;t["tau"]=439;t["upsilon"]=576;t["omega1"]=713;t["omega"]=686;t["xi"]=493;t["psi"]=686;t["zeta"]=494;t["braceleft"]=480;t["bar"]=200;t["braceright"]=480;t["similar"]=549;t["Euro"]=750;t["Upsilon1"]=620;t["minute"]=247;t["lessequal"]=549;t["fraction"]=167;t["infinity"]=713;t["florin"]=500;t["club"]=753;t["diamond"]=753;t["heart"]=753;t["spade"]=753;t["arrowboth"]=1042;t["arrowleft"]=987;t["arrowup"]=603;t["arrowright"]=987;t["arrowdown"]=603;t["degree"]=400;t["plusminus"]=549;t["second"]=411;t["greaterequal"]=549;t["multiply"]=549;t["proportional"]=713;t["partialdiff"]=494;t["bullet"]=460;t["divide"]=549;t["notequal"]=549;t["equivalence"]=549;t["approxequal"]=549;t["ellipsis"]=1e3;t["arrowvertex"]=603;t["arrowhorizex"]=1e3;t["carriagereturn"]=658;t["aleph"]=823;t["Ifraktur"]=686;t["Rfraktur"]=795;t["weierstrass"]=987;t["circlemultiply"]=768;t["circleplus"]=768;t["emptyset"]=823;t["intersection"]=768;t["union"]=768;t["propersuperset"]=713;t["reflexsuperset"]=713;t["notsubset"]=713;t["propersubset"]=713;t["reflexsubset"]=713;t["element"]=713;t["notelement"]=713;t["angle"]=768;t["gradient"]=713;t["registerserif"]=790;t["copyrightserif"]=790;t["trademarkserif"]=890;t["product"]=823;t["radical"]=549;t["dotmath"]=250;t["logicalnot"]=713;t["logicaland"]=603;t["logicalor"]=603;t["arrowdblboth"]=1042;t["arrowdblleft"]=987;t["arrowdblup"]=603;t["arrowdblright"]=987;t["arrowdbldown"]=603;t["lozenge"]=494;t["angleleft"]=329;t["registersans"]=790;t["copyrightsans"]=790;t["trademarksans"]=786;t["summation"]=713;t["parenlefttp"]=384;t["parenleftex"]=384;t["parenleftbt"]=384;t["bracketlefttp"]=384;t["bracketleftex"]=384;t["bracketleftbt"]=384;t["bracelefttp"]=494;t["braceleftmid"]=494;t["braceleftbt"]=494;t["braceex"]=494;t["angleright"]=329;t["integral"]=274;t["integraltp"]=686;t["integralex"]=686;t["integralbt"]=686;t["parenrighttp"]=384;t["parenrightex"]=384;t["parenrightbt"]=384;t["bracketrighttp"]=384;t["bracketrightex"]=384;t["bracketrightbt"]=384;t["bracerighttp"]=494;t["bracerightmid"]=494;t["bracerightbt"]=494;t["apple"]=790});t["Times-Roman"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["quotedbl"]=408;t["numbersign"]=500;t["dollar"]=500;t["percent"]=833;t["ampersand"]=778;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=564;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=278;t["semicolon"]=278;t["less"]=564;t["equal"]=564;t["greater"]=564;t["question"]=444;t["at"]=921;t["A"]=722;t["B"]=667;t["C"]=667;t["D"]=722;t["E"]=611;t["F"]=556;t["G"]=722;t["H"]=722;t["I"]=333;t["J"]=389;t["K"]=722;t["L"]=611;t["M"]=889;t["N"]=722;t["O"]=722;t["P"]=556;t["Q"]=722;t["R"]=667;t["S"]=556;t["T"]=611;t["U"]=722;t["V"]=722;t["W"]=944;t["X"]=722;t["Y"]=722;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=469;t["underscore"]=500;t["quoteleft"]=333;t["a"]=444;t["b"]=500;t["c"]=444;t["d"]=500;t["e"]=444;t["f"]=333;t["g"]=500;t["h"]=500;t["i"]=278;t["j"]=278;t["k"]=500;t["l"]=278;t["m"]=778;t["n"]=500;t["o"]=500;t["p"]=500;t["q"]=500;t["r"]=333;t["s"]=389;t["t"]=278;t["u"]=500;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=444;t["braceleft"]=480;t["bar"]=200;t["braceright"]=480;t["asciitilde"]=541;t["exclamdown"]=333;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=180;t["quotedblleft"]=444;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=556;t["fl"]=556;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=453;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=444;t["quotedblright"]=444;t["guillemotright"]=500;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=444;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=889;t["ordfeminine"]=276;t["Lslash"]=611;t["Oslash"]=722;t["OE"]=889;t["ordmasculine"]=310;t["ae"]=667;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=722;t["germandbls"]=500;t["Idieresis"]=333;t["eacute"]=444;t["abreve"]=444;t["uhungarumlaut"]=500;t["ecaron"]=444;t["Ydieresis"]=722;t["divide"]=564;t["Yacute"]=722;t["Acircumflex"]=722;t["aacute"]=444;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=444;t["Uacute"]=722;t["uogonek"]=500;t["Edieresis"]=611;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=760;t["Emacron"]=611;t["ccaron"]=444;t["aring"]=444;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=444;t["Tcommaaccent"]=611;t["Cacute"]=667;t["atilde"]=444;t["Edotaccent"]=611;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=667;t["Gcommaaccent"]=722;t["ucircumflex"]=500;t["acircumflex"]=444;t["Amacron"]=722;t["rcaron"]=333;t["ccedilla"]=444;t["Zdotaccent"]=611;t["Thorn"]=556;t["Omacron"]=722;t["Racute"]=667;t["Sacute"]=556;t["dcaron"]=588;t["Umacron"]=722;t["uring"]=500;t["threesuperior"]=300;t["Ograve"]=722;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=564;t["uacute"]=500;t["Tcaron"]=611;t["partialdiff"]=476;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=611;t["adieresis"]=444;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=500;t["umacron"]=500;t["Ncaron"]=722;t["Iacute"]=333;t["plusminus"]=564;t["brokenbar"]=200;t["registered"]=760;t["Gbreve"]=722;t["Idotaccent"]=333;t["summation"]=600;t["Egrave"]=611;t["racute"]=333;t["omacron"]=500;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=667;t["lcommaaccent"]=278;t["tcaron"]=326;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=444;t["zacute"]=444;t["iogonek"]=278;t["Oacute"]=722;t["oacute"]=500;t["amacron"]=444;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=722;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=500;t["twosuperior"]=300;t["Odieresis"]=722;t["mu"]=500;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=611;t["dcroat"]=500;t["threequarters"]=750;t["Scedilla"]=556;t["lcaron"]=344;t["Kcommaaccent"]=722;t["Lacute"]=611;t["trademark"]=980;t["edotaccent"]=444;t["Igrave"]=333;t["Imacron"]=333;t["Lcaron"]=611;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=500;t["Uhungarumlaut"]=722;t["Eacute"]=611;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=556;t["Scommaaccent"]=556;t["Ohungarumlaut"]=722;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=667;t["ugrave"]=500;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=333;t["Ntilde"]=722;t["otilde"]=500;t["Rcommaaccent"]=667;t["Lcommaaccent"]=611;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=722;t["zdotaccent"]=444;t["Ecaron"]=611;t["Iogonek"]=333;t["kcommaaccent"]=500;t["minus"]=564;t["Icircumflex"]=333;t["ncaron"]=500;t["tcommaaccent"]=278;t["logicalnot"]=564;t["odieresis"]=500;t["udieresis"]=500;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=444;t["ncommaaccent"]=500;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["Times-Bold"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["quotedbl"]=555;t["numbersign"]=500;t["dollar"]=500;t["percent"]=1e3;t["ampersand"]=833;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=570;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=333;t["semicolon"]=333;t["less"]=570;t["equal"]=570;t["greater"]=570;t["question"]=500;t["at"]=930;t["A"]=722;t["B"]=667;t["C"]=722;t["D"]=722;t["E"]=667;t["F"]=611;t["G"]=778;t["H"]=778;t["I"]=389;t["J"]=500;t["K"]=778;t["L"]=667;t["M"]=944;t["N"]=722;t["O"]=778;t["P"]=611;t["Q"]=778;t["R"]=722;t["S"]=556;t["T"]=667;t["U"]=722;t["V"]=722;t["W"]=1e3;t["X"]=722;t["Y"]=722;t["Z"]=667;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=581;t["underscore"]=500;t["quoteleft"]=333;t["a"]=500;t["b"]=556;t["c"]=444;t["d"]=556;t["e"]=444;t["f"]=333;t["g"]=500;t["h"]=556;t["i"]=278;t["j"]=333;t["k"]=556;t["l"]=278;t["m"]=833;t["n"]=556;t["o"]=500;t["p"]=556;t["q"]=556;t["r"]=444;t["s"]=389;t["t"]=333;t["u"]=556;t["v"]=500;t["w"]=722;t["x"]=500;t["y"]=500;t["z"]=444;t["braceleft"]=394;t["bar"]=220;t["braceright"]=394;t["asciitilde"]=520;t["exclamdown"]=333;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=278;t["quotedblleft"]=500;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=556;t["fl"]=556;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=540;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=500;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=500;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=1e3;t["ordfeminine"]=300;t["Lslash"]=667;t["Oslash"]=778;t["OE"]=1e3;t["ordmasculine"]=330;t["ae"]=722;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=722;t["germandbls"]=556;t["Idieresis"]=389;t["eacute"]=444;t["abreve"]=500;t["uhungarumlaut"]=556;t["ecaron"]=444;t["Ydieresis"]=722;t["divide"]=570;t["Yacute"]=722;t["Acircumflex"]=722;t["aacute"]=500;t["Ucircumflex"]=722;t["yacute"]=500;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=500;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=747;t["Emacron"]=667;t["ccaron"]=444;t["aring"]=500;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=500;t["Tcommaaccent"]=667;t["Cacute"]=722;t["atilde"]=500;t["Edotaccent"]=667;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=722;t["Gcommaaccent"]=778;t["ucircumflex"]=556;t["acircumflex"]=500;t["Amacron"]=722;t["rcaron"]=444;t["ccedilla"]=444;t["Zdotaccent"]=667;t["Thorn"]=611;t["Omacron"]=778;t["Racute"]=722;t["Sacute"]=556;t["dcaron"]=672;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=300;t["Ograve"]=778;t["Agrave"]=722;t["Abreve"]=722;t["multiply"]=570;t["uacute"]=556;t["Tcaron"]=667;t["partialdiff"]=494;t["ydieresis"]=500;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=500;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=389;t["plusminus"]=570;t["brokenbar"]=220;t["registered"]=747;t["Gbreve"]=778;t["Idotaccent"]=389;t["summation"]=600;t["Egrave"]=667;t["racute"]=444;t["omacron"]=500;t["Zacute"]=667;t["Zcaron"]=667;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=722;t["lcommaaccent"]=278;t["tcaron"]=416;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=722;t["Adieresis"]=722;t["egrave"]=444;t["zacute"]=444;t["iogonek"]=278;t["Oacute"]=778;t["oacute"]=500;t["amacron"]=500;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=778;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=556;t["twosuperior"]=300;t["Odieresis"]=778;t["mu"]=556;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=667;t["dcroat"]=556;t["threequarters"]=750;t["Scedilla"]=556;t["lcaron"]=394;t["Kcommaaccent"]=778;t["Lacute"]=667;t["trademark"]=1e3;t["edotaccent"]=444;t["Igrave"]=389;t["Imacron"]=389;t["Lcaron"]=667;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=556;t["Scommaaccent"]=556;t["Ohungarumlaut"]=778;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=722;t["ugrave"]=556;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=444;t["Ntilde"]=722;t["otilde"]=500;t["Rcommaaccent"]=722;t["Lcommaaccent"]=667;t["Atilde"]=722;t["Aogonek"]=722;t["Aring"]=722;t["Otilde"]=778;t["zdotaccent"]=444;t["Ecaron"]=667;t["Iogonek"]=389;t["kcommaaccent"]=556;t["minus"]=570;t["Icircumflex"]=389;t["ncaron"]=556;t["tcommaaccent"]=333;t["logicalnot"]=570;t["odieresis"]=500;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=444;t["ncommaaccent"]=556;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["Times-BoldItalic"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=389;t["quotedbl"]=555;t["numbersign"]=500;t["dollar"]=500;t["percent"]=833;t["ampersand"]=778;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=570;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=333;t["semicolon"]=333;t["less"]=570;t["equal"]=570;t["greater"]=570;t["question"]=500;t["at"]=832;t["A"]=667;t["B"]=667;t["C"]=667;t["D"]=722;t["E"]=667;t["F"]=667;t["G"]=722;t["H"]=778;t["I"]=389;t["J"]=500;t["K"]=667;t["L"]=611;t["M"]=889;t["N"]=722;t["O"]=722;t["P"]=611;t["Q"]=722;t["R"]=667;t["S"]=556;t["T"]=611;t["U"]=722;t["V"]=667;t["W"]=889;t["X"]=667;t["Y"]=611;t["Z"]=611;t["bracketleft"]=333;t["backslash"]=278;t["bracketright"]=333;t["asciicircum"]=570;t["underscore"]=500;t["quoteleft"]=333;t["a"]=500;t["b"]=500;t["c"]=444;t["d"]=500;t["e"]=444;t["f"]=333;t["g"]=500;t["h"]=556;t["i"]=278;t["j"]=278;t["k"]=500;t["l"]=278;t["m"]=778;t["n"]=556;t["o"]=500;t["p"]=500;t["q"]=500;t["r"]=389;t["s"]=389;t["t"]=278;t["u"]=556;t["v"]=444;t["w"]=667;t["x"]=500;t["y"]=444;t["z"]=389;t["braceleft"]=348;t["bar"]=220;t["braceright"]=348;t["asciitilde"]=570;t["exclamdown"]=389;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=278;t["quotedblleft"]=500;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=556;t["fl"]=556;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=500;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=500;t["quotedblright"]=500;t["guillemotright"]=500;t["ellipsis"]=1e3;t["perthousand"]=1e3;t["questiondown"]=500;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=1e3;t["AE"]=944;t["ordfeminine"]=266;t["Lslash"]=611;t["Oslash"]=722;t["OE"]=944;t["ordmasculine"]=300;t["ae"]=722;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=722;t["germandbls"]=500;t["Idieresis"]=389;t["eacute"]=444;t["abreve"]=500;t["uhungarumlaut"]=556;t["ecaron"]=444;t["Ydieresis"]=611;t["divide"]=570;t["Yacute"]=611;t["Acircumflex"]=667;t["aacute"]=500;t["Ucircumflex"]=722;t["yacute"]=444;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722; t["Udieresis"]=722;t["aogonek"]=500;t["Uacute"]=722;t["uogonek"]=556;t["Edieresis"]=667;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=747;t["Emacron"]=667;t["ccaron"]=444;t["aring"]=500;t["Ncommaaccent"]=722;t["lacute"]=278;t["agrave"]=500;t["Tcommaaccent"]=611;t["Cacute"]=667;t["atilde"]=500;t["Edotaccent"]=667;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=494;t["Rcaron"]=667;t["Gcommaaccent"]=722;t["ucircumflex"]=556;t["acircumflex"]=500;t["Amacron"]=667;t["rcaron"]=389;t["ccedilla"]=444;t["Zdotaccent"]=611;t["Thorn"]=611;t["Omacron"]=722;t["Racute"]=667;t["Sacute"]=556;t["dcaron"]=608;t["Umacron"]=722;t["uring"]=556;t["threesuperior"]=300;t["Ograve"]=722;t["Agrave"]=667;t["Abreve"]=667;t["multiply"]=570;t["uacute"]=556;t["Tcaron"]=611;t["partialdiff"]=494;t["ydieresis"]=444;t["Nacute"]=722;t["icircumflex"]=278;t["Ecircumflex"]=667;t["adieresis"]=500;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=556;t["umacron"]=556;t["Ncaron"]=722;t["Iacute"]=389;t["plusminus"]=570;t["brokenbar"]=220;t["registered"]=747;t["Gbreve"]=722;t["Idotaccent"]=389;t["summation"]=600;t["Egrave"]=667;t["racute"]=389;t["omacron"]=500;t["Zacute"]=611;t["Zcaron"]=611;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=667;t["lcommaaccent"]=278;t["tcaron"]=366;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=667;t["Adieresis"]=667;t["egrave"]=444;t["zacute"]=389;t["iogonek"]=278;t["Oacute"]=722;t["oacute"]=500;t["amacron"]=500;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=722;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=500;t["twosuperior"]=300;t["Odieresis"]=722;t["mu"]=576;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=667;t["dcroat"]=500;t["threequarters"]=750;t["Scedilla"]=556;t["lcaron"]=382;t["Kcommaaccent"]=667;t["Lacute"]=611;t["trademark"]=1e3;t["edotaccent"]=444;t["Igrave"]=389;t["Imacron"]=389;t["Lcaron"]=611;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=556;t["Uhungarumlaut"]=722;t["Eacute"]=667;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=556;t["Scommaaccent"]=556;t["Ohungarumlaut"]=722;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=667;t["ugrave"]=556;t["radical"]=549;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=722;t["otilde"]=500;t["Rcommaaccent"]=667;t["Lcommaaccent"]=611;t["Atilde"]=667;t["Aogonek"]=667;t["Aring"]=667;t["Otilde"]=722;t["zdotaccent"]=389;t["Ecaron"]=667;t["Iogonek"]=389;t["kcommaaccent"]=500;t["minus"]=606;t["Icircumflex"]=389;t["ncaron"]=556;t["tcommaaccent"]=278;t["logicalnot"]=606;t["odieresis"]=500;t["udieresis"]=556;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=389;t["ncommaaccent"]=556;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["Times-Italic"]=getLookupTableFactory(function(t){t["space"]=250;t["exclam"]=333;t["quotedbl"]=420;t["numbersign"]=500;t["dollar"]=500;t["percent"]=833;t["ampersand"]=778;t["quoteright"]=333;t["parenleft"]=333;t["parenright"]=333;t["asterisk"]=500;t["plus"]=675;t["comma"]=250;t["hyphen"]=333;t["period"]=250;t["slash"]=278;t["zero"]=500;t["one"]=500;t["two"]=500;t["three"]=500;t["four"]=500;t["five"]=500;t["six"]=500;t["seven"]=500;t["eight"]=500;t["nine"]=500;t["colon"]=333;t["semicolon"]=333;t["less"]=675;t["equal"]=675;t["greater"]=675;t["question"]=500;t["at"]=920;t["A"]=611;t["B"]=611;t["C"]=667;t["D"]=722;t["E"]=611;t["F"]=611;t["G"]=722;t["H"]=722;t["I"]=333;t["J"]=444;t["K"]=667;t["L"]=556;t["M"]=833;t["N"]=667;t["O"]=722;t["P"]=611;t["Q"]=722;t["R"]=611;t["S"]=500;t["T"]=556;t["U"]=722;t["V"]=611;t["W"]=833;t["X"]=611;t["Y"]=556;t["Z"]=556;t["bracketleft"]=389;t["backslash"]=278;t["bracketright"]=389;t["asciicircum"]=422;t["underscore"]=500;t["quoteleft"]=333;t["a"]=500;t["b"]=500;t["c"]=444;t["d"]=500;t["e"]=444;t["f"]=278;t["g"]=500;t["h"]=500;t["i"]=278;t["j"]=278;t["k"]=444;t["l"]=278;t["m"]=722;t["n"]=500;t["o"]=500;t["p"]=500;t["q"]=500;t["r"]=389;t["s"]=389;t["t"]=278;t["u"]=500;t["v"]=444;t["w"]=667;t["x"]=444;t["y"]=444;t["z"]=389;t["braceleft"]=400;t["bar"]=275;t["braceright"]=400;t["asciitilde"]=541;t["exclamdown"]=389;t["cent"]=500;t["sterling"]=500;t["fraction"]=167;t["yen"]=500;t["florin"]=500;t["section"]=500;t["currency"]=500;t["quotesingle"]=214;t["quotedblleft"]=556;t["guillemotleft"]=500;t["guilsinglleft"]=333;t["guilsinglright"]=333;t["fi"]=500;t["fl"]=500;t["endash"]=500;t["dagger"]=500;t["daggerdbl"]=500;t["periodcentered"]=250;t["paragraph"]=523;t["bullet"]=350;t["quotesinglbase"]=333;t["quotedblbase"]=556;t["quotedblright"]=556;t["guillemotright"]=500;t["ellipsis"]=889;t["perthousand"]=1e3;t["questiondown"]=500;t["grave"]=333;t["acute"]=333;t["circumflex"]=333;t["tilde"]=333;t["macron"]=333;t["breve"]=333;t["dotaccent"]=333;t["dieresis"]=333;t["ring"]=333;t["cedilla"]=333;t["hungarumlaut"]=333;t["ogonek"]=333;t["caron"]=333;t["emdash"]=889;t["AE"]=889;t["ordfeminine"]=276;t["Lslash"]=556;t["Oslash"]=722;t["OE"]=944;t["ordmasculine"]=310;t["ae"]=667;t["dotlessi"]=278;t["lslash"]=278;t["oslash"]=500;t["oe"]=667;t["germandbls"]=500;t["Idieresis"]=333;t["eacute"]=444;t["abreve"]=500;t["uhungarumlaut"]=500;t["ecaron"]=444;t["Ydieresis"]=556;t["divide"]=675;t["Yacute"]=556;t["Acircumflex"]=611;t["aacute"]=500;t["Ucircumflex"]=722;t["yacute"]=444;t["scommaaccent"]=389;t["ecircumflex"]=444;t["Uring"]=722;t["Udieresis"]=722;t["aogonek"]=500;t["Uacute"]=722;t["uogonek"]=500;t["Edieresis"]=611;t["Dcroat"]=722;t["commaaccent"]=250;t["copyright"]=760;t["Emacron"]=611;t["ccaron"]=444;t["aring"]=500;t["Ncommaaccent"]=667;t["lacute"]=278;t["agrave"]=500;t["Tcommaaccent"]=556;t["Cacute"]=667;t["atilde"]=500;t["Edotaccent"]=611;t["scaron"]=389;t["scedilla"]=389;t["iacute"]=278;t["lozenge"]=471;t["Rcaron"]=611;t["Gcommaaccent"]=722;t["ucircumflex"]=500;t["acircumflex"]=500;t["Amacron"]=611;t["rcaron"]=389;t["ccedilla"]=444;t["Zdotaccent"]=556;t["Thorn"]=611;t["Omacron"]=722;t["Racute"]=611;t["Sacute"]=500;t["dcaron"]=544;t["Umacron"]=722;t["uring"]=500;t["threesuperior"]=300;t["Ograve"]=722;t["Agrave"]=611;t["Abreve"]=611;t["multiply"]=675;t["uacute"]=500;t["Tcaron"]=556;t["partialdiff"]=476;t["ydieresis"]=444;t["Nacute"]=667;t["icircumflex"]=278;t["Ecircumflex"]=611;t["adieresis"]=500;t["edieresis"]=444;t["cacute"]=444;t["nacute"]=500;t["umacron"]=500;t["Ncaron"]=667;t["Iacute"]=333;t["plusminus"]=675;t["brokenbar"]=275;t["registered"]=760;t["Gbreve"]=722;t["Idotaccent"]=333;t["summation"]=600;t["Egrave"]=611;t["racute"]=389;t["omacron"]=500;t["Zacute"]=556;t["Zcaron"]=556;t["greaterequal"]=549;t["Eth"]=722;t["Ccedilla"]=667;t["lcommaaccent"]=278;t["tcaron"]=300;t["eogonek"]=444;t["Uogonek"]=722;t["Aacute"]=611;t["Adieresis"]=611;t["egrave"]=444;t["zacute"]=389;t["iogonek"]=278;t["Oacute"]=722;t["oacute"]=500;t["amacron"]=500;t["sacute"]=389;t["idieresis"]=278;t["Ocircumflex"]=722;t["Ugrave"]=722;t["Delta"]=612;t["thorn"]=500;t["twosuperior"]=300;t["Odieresis"]=722;t["mu"]=500;t["igrave"]=278;t["ohungarumlaut"]=500;t["Eogonek"]=611;t["dcroat"]=500;t["threequarters"]=750;t["Scedilla"]=500;t["lcaron"]=300;t["Kcommaaccent"]=667;t["Lacute"]=556;t["trademark"]=980;t["edotaccent"]=444;t["Igrave"]=333;t["Imacron"]=333;t["Lcaron"]=611;t["onehalf"]=750;t["lessequal"]=549;t["ocircumflex"]=500;t["ntilde"]=500;t["Uhungarumlaut"]=722;t["Eacute"]=611;t["emacron"]=444;t["gbreve"]=500;t["onequarter"]=750;t["Scaron"]=500;t["Scommaaccent"]=500;t["Ohungarumlaut"]=722;t["degree"]=400;t["ograve"]=500;t["Ccaron"]=667;t["ugrave"]=500;t["radical"]=453;t["Dcaron"]=722;t["rcommaaccent"]=389;t["Ntilde"]=667;t["otilde"]=500;t["Rcommaaccent"]=611;t["Lcommaaccent"]=556;t["Atilde"]=611;t["Aogonek"]=611;t["Aring"]=611;t["Otilde"]=722;t["zdotaccent"]=389;t["Ecaron"]=611;t["Iogonek"]=333;t["kcommaaccent"]=444;t["minus"]=675;t["Icircumflex"]=333;t["ncaron"]=500;t["tcommaaccent"]=278;t["logicalnot"]=675;t["odieresis"]=500;t["udieresis"]=500;t["notequal"]=549;t["gcommaaccent"]=500;t["eth"]=500;t["zcaron"]=389;t["ncommaaccent"]=500;t["onesuperior"]=300;t["imacron"]=278;t["Euro"]=500});t["ZapfDingbats"]=getLookupTableFactory(function(t){t["space"]=278;t["a1"]=974;t["a2"]=961;t["a202"]=974;t["a3"]=980;t["a4"]=719;t["a5"]=789;t["a119"]=790;t["a118"]=791;t["a117"]=690;t["a11"]=960;t["a12"]=939;t["a13"]=549;t["a14"]=855;t["a15"]=911;t["a16"]=933;t["a105"]=911;t["a17"]=945;t["a18"]=974;t["a19"]=755;t["a20"]=846;t["a21"]=762;t["a22"]=761;t["a23"]=571;t["a24"]=677;t["a25"]=763;t["a26"]=760;t["a27"]=759;t["a28"]=754;t["a6"]=494;t["a7"]=552;t["a8"]=537;t["a9"]=577;t["a10"]=692;t["a29"]=786;t["a30"]=788;t["a31"]=788;t["a32"]=790;t["a33"]=793;t["a34"]=794;t["a35"]=816;t["a36"]=823;t["a37"]=789;t["a38"]=841;t["a39"]=823;t["a40"]=833;t["a41"]=816;t["a42"]=831;t["a43"]=923;t["a44"]=744;t["a45"]=723;t["a46"]=749;t["a47"]=790;t["a48"]=792;t["a49"]=695;t["a50"]=776;t["a51"]=768;t["a52"]=792;t["a53"]=759;t["a54"]=707;t["a55"]=708;t["a56"]=682;t["a57"]=701;t["a58"]=826;t["a59"]=815;t["a60"]=789;t["a61"]=789;t["a62"]=707;t["a63"]=687;t["a64"]=696;t["a65"]=689;t["a66"]=786;t["a67"]=787;t["a68"]=713;t["a69"]=791;t["a70"]=785;t["a71"]=791;t["a72"]=873;t["a73"]=761;t["a74"]=762;t["a203"]=762;t["a75"]=759;t["a204"]=759;t["a76"]=892;t["a77"]=892;t["a78"]=788;t["a79"]=784;t["a81"]=438;t["a82"]=138;t["a83"]=277;t["a84"]=415;t["a97"]=392;t["a98"]=392;t["a99"]=668;t["a100"]=668;t["a89"]=390;t["a90"]=390;t["a93"]=317;t["a94"]=317;t["a91"]=276;t["a92"]=276;t["a205"]=509;t["a85"]=509;t["a206"]=410;t["a86"]=410;t["a87"]=234;t["a88"]=234;t["a95"]=334;t["a96"]=334;t["a101"]=732;t["a102"]=544;t["a103"]=544;t["a104"]=910;t["a106"]=667;t["a107"]=760;t["a108"]=760;t["a112"]=776;t["a111"]=595;t["a110"]=694;t["a109"]=626;t["a120"]=788;t["a121"]=788;t["a122"]=788;t["a123"]=788;t["a124"]=788;t["a125"]=788;t["a126"]=788;t["a127"]=788;t["a128"]=788;t["a129"]=788;t["a130"]=788;t["a131"]=788;t["a132"]=788;t["a133"]=788;t["a134"]=788;t["a135"]=788;t["a136"]=788;t["a137"]=788;t["a138"]=788;t["a139"]=788;t["a140"]=788;t["a141"]=788;t["a142"]=788;t["a143"]=788;t["a144"]=788;t["a145"]=788;t["a146"]=788;t["a147"]=788;t["a148"]=788;t["a149"]=788;t["a150"]=788;t["a151"]=788;t["a152"]=788;t["a153"]=788;t["a154"]=788;t["a155"]=788;t["a156"]=788;t["a157"]=788;t["a158"]=788;t["a159"]=788;t["a160"]=894;t["a161"]=838;t["a163"]=1016;t["a164"]=458;t["a196"]=748;t["a165"]=924;t["a192"]=748;t["a166"]=918;t["a167"]=927;t["a168"]=928;t["a169"]=928;t["a170"]=834;t["a171"]=873;t["a172"]=828;t["a173"]=924;t["a162"]=924;t["a174"]=917;t["a175"]=930;t["a176"]=931;t["a177"]=463;t["a178"]=883;t["a179"]=836;t["a193"]=836;t["a180"]=867;t["a199"]=867;t["a181"]=696;t["a200"]=696;t["a182"]=874;t["a201"]=874;t["a183"]=760;t["a184"]=946;t["a197"]=771;t["a185"]=865;t["a194"]=771;t["a198"]=888;t["a186"]=967;t["a195"]=888;t["a187"]=831;t["a188"]=873;t["a189"]=927;t["a190"]=970;t["a191"]=918})});exports.getMetrics=getMetrics});(function(root,factory){{factory(root.pdfjsCoreMurmurHash3={},root.pdfjsSharedUtil)}})(this,function(exports,sharedUtil){var Uint32ArrayView=sharedUtil.Uint32ArrayView;var MurmurHash3_64=function MurmurHash3_64Closure(seed){var MASK_HIGH=4294901760;var MASK_LOW=65535;function MurmurHash3_64(seed){var SEED=3285377520;this.h1=seed?seed&4294967295:SEED;this.h2=seed?seed&4294967295:SEED}var alwaysUseUint32ArrayView=false;try{new Uint32Array(new Uint8Array(5).buffer,0,1)}catch(e){alwaysUseUint32ArrayView=true}MurmurHash3_64.prototype={update:function MurmurHash3_64_update(input){var useUint32ArrayView=alwaysUseUint32ArrayView;var i;if(typeof input==="string"){var data=new Uint8Array(input.length*2);var length=0;for(i=0;i>>8;data[length++]=code&255}}}else if(input instanceof Uint8Array){data=input;length=data.length}else if(typeof input==="object"&&"length"in input){data=input;length=data.length;useUint32ArrayView=true}else{throw new Error("Wrong data format in MurmurHash3_64_update. "+"Input must be a string or array.")}var blockCounts=length>>2;var tailLength=length-blockCounts*4;var dataUint32=useUint32ArrayView?new Uint32ArrayView(data,blockCounts):new Uint32Array(data.buffer,0,blockCounts);var k1=0;var k2=0;var h1=this.h1;var h2=this.h2;var C1=3432918353;var C2=461845907;var C1_LOW=C1&MASK_LOW;var C2_LOW=C2&MASK_LOW;for(i=0;i>>17;k1=k1*C2&MASK_HIGH|k1*C2_LOW&MASK_LOW;h1^=k1;h1=h1<<13|h1>>>19;h1=h1*5+3864292196}else{k2=dataUint32[i];k2=k2*C1&MASK_HIGH|k2*C1_LOW&MASK_LOW;k2=k2<<15|k2>>>17;k2=k2*C2&MASK_HIGH|k2*C2_LOW&MASK_LOW;h2^=k2;h2=h2<<13|h2>>>19;h2=h2*5+3864292196}}k1=0;switch(tailLength){case 3:k1^=data[blockCounts*4+2]<<16;case 2:k1^=data[blockCounts*4+1]<<8;case 1:k1^=data[blockCounts*4];k1=k1*C1&MASK_HIGH|k1*C1_LOW&MASK_LOW;k1=k1<<15|k1>>>17;k1=k1*C2&MASK_HIGH|k1*C2_LOW&MASK_LOW;if(blockCounts&1){h1^=k1}else{h2^=k1}}this.h1=h1;this.h2=h2;return this},hexdigest:function MurmurHash3_64_hexdigest(){var h1=this.h1;var h2=this.h2;h1^=h2>>>1;h1=h1*3981806797&MASK_HIGH|h1*36045&MASK_LOW;h2=h2*4283543511&MASK_HIGH|((h2<<16|h1>>>16)*2950163797&MASK_HIGH)>>>16;h1^=h2>>>1;h1=h1*444984403&MASK_HIGH|h1*60499&MASK_LOW;h2=h2*3301882366&MASK_HIGH|((h2<<16|h1>>>16)*3120437893&MASK_HIGH)>>>16;h1^=h2>>>1;for(var i=0,arr=[h1,h2],str="";i>>0).toString(16);while(hex.length<8){hex="0"+hex}str+=hex}return str}};return MurmurHash3_64}();exports.MurmurHash3_64=MurmurHash3_64});(function(root,factory){{factory(root.pdfjsCorePrimitives={},root.pdfjsSharedUtil)}})(this,function(exports,sharedUtil){var isArray=sharedUtil.isArray;var Name=function NameClosure(){function Name(name){this.name=name}Name.prototype={};var nameCache=Object.create(null);Name.get=function Name_get(name){var nameValue=nameCache[name];return nameValue?nameValue:nameCache[name]=new Name(name)};return Name}();var Cmd=function CmdClosure(){function Cmd(cmd){this.cmd=cmd}Cmd.prototype={};var cmdCache=Object.create(null);Cmd.get=function Cmd_get(cmd){var cmdValue=cmdCache[cmd];return cmdValue?cmdValue:cmdCache[cmd]=new Cmd(cmd)};return Cmd}();var Dict=function DictClosure(){var nonSerializable=function nonSerializableClosure(){return nonSerializable};function Dict(xref){this.map=Object.create(null);this.xref=xref;this.objId=null;this.__nonSerializable__=nonSerializable}Dict.prototype={assignXref:function Dict_assignXref(newXref){this.xref=newXref},get:function Dict_get(key1,key2,key3){var value;var xref=this.xref;if(typeof(value=this.map[key1])!=="undefined"||key1 in this.map||typeof key2==="undefined"){return xref?xref.fetchIfRef(value):value}if(typeof(value=this.map[key2])!=="undefined"||key2 in this.map||typeof key3==="undefined"){return xref?xref.fetchIfRef(value):value}value=this.map[key3]||null;return xref?xref.fetchIfRef(value):value},getAsync:function Dict_getAsync(key1,key2,key3){var value;var xref=this.xref;if(typeof(value=this.map[key1])!=="undefined"||key1 in this.map||typeof key2==="undefined"){if(xref){return xref.fetchIfRefAsync(value)}return Promise.resolve(value)}if(typeof(value=this.map[key2])!=="undefined"||key2 in this.map||typeof key3==="undefined"){if(xref){return xref.fetchIfRefAsync(value)}return Promise.resolve(value)}value=this.map[key3]||null;if(xref){return xref.fetchIfRefAsync(value)}return Promise.resolve(value)},getArray:function Dict_getArray(key1,key2,key3){var value=this.get(key1,key2,key3);var xref=this.xref;if(!isArray(value)||!xref){return value}value=value.slice();for(var i=0,ii=value.length;i=65520&&code<=65535){return 0}else if(code>=62976&&code<=63743){return getSpecialPUASymbols()[code]||code}return code}function getUnicodeForGlyph(name,glyphsUnicodeMap){var unicode=glyphsUnicodeMap[name];if(unicode!==undefined){return unicode}if(!name){return-1}if(name[0]==="u"){var nameLen=name.length,hexStr;if(nameLen===7&&name[1]==="n"&&name[2]==="i"){hexStr=name.substr(3)}else if(nameLen>=5&&nameLen<=7){hexStr=name.substr(1)}else{return-1}if(hexStr===hexStr.toUpperCase()){unicode=parseInt(hexStr,16);if(unicode>=0){return unicode}}}return-1}var UnicodeRanges=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}]; function getUnicodeRangeFor(value){for(var i=0,ii=UnicodeRanges.length;i=range.begin&&value=range.begin&&value=range.begin&&value=0;ii--){s+=chars[ii]}return s}exports.mapSpecialUnicodeValues=mapSpecialUnicodeValues;exports.reverseIfRtl=reverseIfRtl;exports.getUnicodeRangeFor=getUnicodeRangeFor;exports.getNormalizedUnicodes=getNormalizedUnicodes;exports.getUnicodeForGlyph=getUnicodeForGlyph});(function(root,factory){{factory(root.pdfjsCoreStream={},root.pdfjsSharedUtil,root.pdfjsCorePrimitives,root.pdfjsCoreJbig2,root.pdfjsCoreJpg,root.pdfjsCoreJpx)}})(this,function(exports,sharedUtil,corePrimitives,coreJbig2,coreJpg,coreJpx){var Util=sharedUtil.Util;var error=sharedUtil.error;var info=sharedUtil.info;var isInt=sharedUtil.isInt;var isArray=sharedUtil.isArray;var createObjectURL=sharedUtil.createObjectURL;var shadow=sharedUtil.shadow;var warn=sharedUtil.warn;var isSpace=sharedUtil.isSpace;var Dict=corePrimitives.Dict;var isDict=corePrimitives.isDict;var Jbig2Image=coreJbig2.Jbig2Image;var JpegImage=coreJpg.JpegImage;var JpxImage=coreJpx.JpxImage;var Stream=function StreamClosure(){function Stream(arrayBuffer,start,length,dict){this.bytes=arrayBuffer instanceof Uint8Array?arrayBuffer:new Uint8Array(arrayBuffer);this.start=start||0;this.pos=this.start;this.end=start+length||this.bytes.length;this.dict=dict}Stream.prototype={get length(){return this.end-this.start},get isEmpty(){return this.length===0},getByte:function Stream_getByte(){if(this.pos>=this.end){return-1}return this.bytes[this.pos++]},getUint16:function Stream_getUint16(){var b0=this.getByte();var b1=this.getByte();if(b0===-1||b1===-1){return-1}return(b0<<8)+b1},getInt32:function Stream_getInt32(){var b0=this.getByte();var b1=this.getByte();var b2=this.getByte();var b3=this.getByte();return(b0<<24)+(b1<<16)+(b2<<8)+b3},getBytes:function Stream_getBytes(length){var bytes=this.bytes;var pos=this.pos;var strEnd=this.end;if(!length){return bytes.subarray(pos,strEnd)}var end=pos+length;if(end>strEnd){end=strEnd}this.pos=end;return bytes.subarray(pos,end)},peekByte:function Stream_peekByte(){var peekedByte=this.getByte();this.pos--;return peekedByte},peekBytes:function Stream_peekBytes(length){var bytes=this.getBytes(length);this.pos-=bytes.length;return bytes},skip:function Stream_skip(n){if(!n){n=1}this.pos+=n},reset:function Stream_reset(){this.pos=this.start},moveStart:function Stream_moveStart(){this.start=this.pos},makeSubStream:function Stream_makeSubStream(start,length,dict){return new Stream(this.bytes.buffer,start,length,dict)},isStream:true};return Stream}();var StringStream=function StringStreamClosure(){function StringStream(str){var length=str.length;var bytes=new Uint8Array(length);for(var n=0;nbufEnd){end=bufEnd}}else{while(!this.eof){this.readBlock()}end=this.bufferLength}this.pos=end;return this.buffer.subarray(pos,end)},peekByte:function DecodeStream_peekByte(){var peekedByte=this.getByte();this.pos--;return peekedByte},peekBytes:function DecodeStream_peekBytes(length){var bytes=this.getBytes(length);this.pos-=bytes.length;return bytes},makeSubStream:function DecodeStream_makeSubStream(start,length,dict){var end=start+length;while(this.bufferLength<=end&&!this.eof){this.readBlock()}return new Stream(this.buffer,start,length,dict)},skip:function DecodeStream_skip(n){if(!n){n=1}this.pos+=n},reset:function DecodeStream_reset(){this.pos=0},getBaseStreams:function DecodeStream_getBaseStreams(){if(this.str&&this.str.getBaseStreams){return this.str.getBaseStreams()}return[]}};return DecodeStream}();var StreamsSequenceStream=function StreamsSequenceStreamClosure(){function StreamsSequenceStream(streams){this.streams=streams;DecodeStream.call(this,null)}StreamsSequenceStream.prototype=Object.create(DecodeStream.prototype);StreamsSequenceStream.prototype.readBlock=function streamSequenceStreamReadBlock(){var streams=this.streams;if(streams.length===0){this.eof=true;return}var stream=streams.shift();var chunk=stream.getBytes();var bufferLength=this.bufferLength;var newLength=bufferLength+chunk.length;var buffer=this.ensureBuffer(newLength);buffer.set(chunk,bufferLength);this.bufferLength=newLength};StreamsSequenceStream.prototype.getBaseStreams=function StreamsSequenceStream_getBaseStreams(){var baseStreams=[];for(var i=0,ii=this.streams.length;i>bits;this.codeSize=codeSize-=bits;return b};FlateStream.prototype.getCode=function FlateStream_getCode(table){var str=this.str;var codes=table[0];var maxLen=table[1];var codeSize=this.codeSize;var codeBuf=this.codeBuf;var b;while(codeSize>16;var codeVal=code&65535;if(codeLen<1||codeSize>codeLen;this.codeSize=codeSize-codeLen;return codeVal};FlateStream.prototype.generateHuffmanTable=function flateStreamGenerateHuffmanTable(lengths){var n=lengths.length;var maxLen=0;var i;for(i=0;imaxLen){maxLen=lengths[i]}}var size=1<>=1}for(i=code2;i>=1;if(hdr===0){var b;if((b=str.getByte())===-1){error("Bad block header in flate stream")}var blockLen=b;if((b=str.getByte())===-1){error("Bad block header in flate stream")}blockLen|=b<<8;if((b=str.getByte())===-1){error("Bad block header in flate stream")}var check=b;if((b=str.getByte())===-1){error("Bad block header in flate stream")}check|=b<<8;if(check!==(~blockLen&65535)&&(blockLen!==0||check!==0)){error("Bad uncompressed block length in flate stream")}this.codeBuf=0;this.codeSize=0;var bufferLength=this.bufferLength;buffer=this.ensureBuffer(bufferLength+blockLen);var end=bufferLength+blockLen;this.bufferLength=end;if(blockLen===0){if(str.peekByte()===-1){this.eof=true}}else{for(var n=bufferLength;n0){codeLengths[i++]=what}}litCodeTable=this.generateHuffmanTable(codeLengths.subarray(0,numLitCodes));distCodeTable=this.generateHuffmanTable(codeLengths.subarray(numLitCodes,codes))}else{error("Unknown block type in flate stream")}buffer=this.buffer;var limit=buffer?buffer.length:0;var pos=this.bufferLength;while(true){var code1=this.getCode(litCodeTable);if(code1<256){if(pos+1>=limit){buffer=this.ensureBuffer(pos+1);limit=buffer.length}buffer[pos++]=code1;continue}if(code1===256){this.bufferLength=pos;return}code1-=257;code1=lengthDecode[code1];var code2=code1>>16;if(code2>0){code2=this.getBits(code2)}len=(code1&65535)+code2;code1=this.getCode(distCodeTable);code1=distDecode[code1];code2=code1>>16;if(code2>0){code2=this.getBits(code2)}var dist=(code1&65535)+code2;if(pos+len>=limit){buffer=this.ensureBuffer(pos+len);limit=buffer.length}for(var k=0;k15)){error("Unsupported predictor: "+predictor)}if(predictor===2){this.readBlock=this.readBlockTiff}else{this.readBlock=this.readBlockPng}this.str=str;this.dict=str.dict;var colors=this.colors=params.get("Colors")||1;var bits=this.bits=params.get("BitsPerComponent")||8;var columns=this.columns=params.get("Columns")||1;this.pixBytes=colors*bits+7>>3;this.rowBytes=columns*colors*bits+7>>3;DecodeStream.call(this,maybeLength);return this}PredictorStream.prototype=Object.create(DecodeStream.prototype);PredictorStream.prototype.readBlockTiff=function predictorStreamReadBlockTiff(){var rowBytes=this.rowBytes;var bufferLength=this.bufferLength;var buffer=this.ensureBuffer(bufferLength+rowBytes);var bits=this.bits;var colors=this.colors;var rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(this.eof){return}var inbuf=0,outbuf=0;var inbits=0,outbits=0;var pos=bufferLength;var i;if(bits===1){for(i=0;i>colors)&255;inbuf&=65535}}else if(bits===8){for(i=0;i>inbits-bits)&bitMask;inbits-=bits;outbuf=outbuf<=8){buffer[k++]=outbuf>>outbits-8&255;outbits-=8}}}if(outbits>0){buffer[k++]=(outbuf<<8-outbits)+(inbuf&(1<<8-outbits)-1)}}this.bufferLength+=rowBytes};PredictorStream.prototype.readBlockPng=function predictorStreamReadBlockPng(){var rowBytes=this.rowBytes;var pixBytes=this.pixBytes;var predictor=this.str.getByte();var rawBytes=this.str.getBytes(rowBytes);this.eof=!rawBytes.length;if(this.eof){return}var bufferLength=this.bufferLength;var buffer=this.ensureBuffer(bufferLength+rowBytes);var prevRow=buffer.subarray(bufferLength-rowBytes,bufferLength);if(prevRow.length===0){prevRow=new Uint8Array(rowBytes)}var i,j=bufferLength,up,c;switch(predictor){case 0:for(i=0;i>1)+rawBytes[i]}for(;i>1)+rawBytes[i]&255;j++}break;case 4:for(i=0;i1){warn("JBIG2 - 'DecodeParms' array with multiple elements "+"not supported.")}decodeParams=decodeParams[0]}if(decodeParams&&decodeParams.has("JBIG2Globals")){var globalsStream=decodeParams.get("JBIG2Globals");var globals=globalsStream.getBytes();chunks.push({data:globals,start:0,end:globals.length})}chunks.push({data:this.bytes,start:0,end:this.bytes.length});var data=jbig2Image.parseChunks(chunks);var dataLength=data.length;for(var i=0;i0;var decrypt=this.decrypt;chunk=decrypt(chunk,!hasMoreData);var bufferLength=this.bufferLength;var i,n=chunk.length;var buffer=this.ensureBuffer(bufferLength+n);for(i=0;i=0;--i){buffer[bufferLength+i]=t&255;t>>=8}}};return Ascii85Stream}();var AsciiHexStream=function AsciiHexStreamClosure(){function AsciiHexStream(str,maybeLength){this.str=str;this.dict=str.dict;this.firstDigit=-1;if(maybeLength){maybeLength=.5*maybeLength}DecodeStream.call(this,maybeLength)}AsciiHexStream.prototype=Object.create(DecodeStream.prototype);AsciiHexStream.prototype.readBlock=function AsciiHexStream_readBlock(){var UPSTREAM_BLOCK_SIZE=8e3;var bytes=this.str.getBytes(UPSTREAM_BLOCK_SIZE);if(!bytes.length){this.eof=true;return}var maxDecodeLength=bytes.length+1>>1;var buffer=this.ensureBuffer(this.bufferLength+maxDecodeLength);var bufferLength=this.bufferLength;var firstDigit=this.firstDigit;for(var i=0,ii=bytes.length;i=48&&ch<=57){digit=ch&15}else if(ch>=65&&ch<=70||ch>=97&&ch<=102){digit=(ch&15)+9}else if(ch===62){this.eof=true;break}else{continue}if(firstDigit<0){firstDigit=digit}else{buffer[bufferLength++]=firstDigit<<4|digit;firstDigit=-1}}if(firstDigit>=0&&this.eof){buffer[bufferLength++]=firstDigit<<4;firstDigit=-1}this.firstDigit=firstDigit;this.bufferLength=bufferLength};return AsciiHexStream}();var RunLengthStream=function RunLengthStreamClosure(){function RunLengthStream(str,maybeLength){this.str=str;this.dict=str.dict;DecodeStream.call(this,maybeLength)}RunLengthStream.prototype=Object.create(DecodeStream.prototype);RunLengthStream.prototype.readBlock=function RunLengthStream_readBlock(){var repeatHeader=this.str.getBytes(2);if(!repeatHeader||repeatHeader.length<2||repeatHeader[0]===128){this.eof=true;return}var buffer;var bufferLength=this.bufferLength;var n=repeatHeader[0];if(n<128){buffer=this.ensureBuffer(bufferLength+n+1);buffer[bufferLength++]=repeatHeader[1];if(n>0){var source=this.str.getBytes(n);buffer.set(source,bufferLength);bufferLength+=n}}else{n=257-n;var b=repeatHeader[1];buffer=this.ensureBuffer(bufferLength+n+1);for(var i=0;i0){this.nextLine2D=!this.lookBits(1);this.eatBits(1)}DecodeStream.call(this,maybeLength)}CCITTFaxStream.prototype=Object.create(DecodeStream.prototype);CCITTFaxStream.prototype.readBlock=function CCITTFaxStream_readBlock(){while(!this.eof){var c=this.lookChar();this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=c}};CCITTFaxStream.prototype.addPixels=function ccittFaxStreamAddPixels(a1,blackPixels){var codingLine=this.codingLine;var codingPos=this.codingPos;if(a1>codingLine[codingPos]){if(a1>this.columns){info("row is wrong length");this.err=true;a1=this.columns}if(codingPos&1^blackPixels){++codingPos}codingLine[codingPos]=a1}this.codingPos=codingPos};CCITTFaxStream.prototype.addPixelsNeg=function ccittFaxStreamAddPixelsNeg(a1,blackPixels){var codingLine=this.codingLine;var codingPos=this.codingPos;if(a1>codingLine[codingPos]){if(a1>this.columns){info("row is wrong length");this.err=true;a1=this.columns}if(codingPos&1^blackPixels){++codingPos}codingLine[codingPos]=a1}else if(a10&&a1=64);do{code2+=code3=this.getWhiteCode()}while(code3>=64)}else{do{code1+=code3=this.getWhiteCode()}while(code3>=64);do{code2+=code3=this.getBlackCode()}while(code3>=64)}this.addPixels(codingLine[this.codingPos]+code1,blackPixels);if(codingLine[this.codingPos]0){--refPos}else{++refPos}while(refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]0){--refPos}else{++refPos}while(refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]0){--refPos}else{++refPos}while(refLine[refPos]<=codingLine[this.codingPos]&&refLine[refPos]=64)}else{do{code1+=code3=this.getWhiteCode()}while(code3>=64)}this.addPixels(codingLine[this.codingPos]+code1,blackPixels);blackPixels^=1}}var gotEOL=false;if(this.byteAlign){this.inputBits&=~7}if(!this.eoblock&&this.row===this.rows-1){this.eof=true}else{code1=this.lookBits(12);if(this.eoline){while(code1!==ccittEOF&&code1!==1){this.eatBits(1);code1=this.lookBits(12)}}else{while(code1===0){this.eatBits(1);code1=this.lookBits(12)}}if(code1===1){this.eatBits(12);gotEOL=true}else if(code1===ccittEOF){this.eof=true}}if(!this.eof&&this.encoding>0){this.nextLine2D=!this.lookBits(1);this.eatBits(1)}if(this.eoblock&&gotEOL&&this.byteAlign){code1=this.lookBits(12);if(code1===1){this.eatBits(12);if(this.encoding>0){this.lookBits(1);this.eatBits(1)}if(this.encoding>=0){for(i=0;i<4;++i){code1=this.lookBits(12);if(code1!==1){info("bad rtc code: "+code1)}this.eatBits(12);if(this.encoding>0){this.lookBits(1);this.eatBits(1)}}}this.eof=true}}else if(this.err&&this.eoline){while(true){code1=this.lookBits(13);if(code1===ccittEOF){this.eof=true;return null}if(code1>>1===1){break}this.eatBits(1)}this.eatBits(12);if(this.encoding>0){this.eatBits(1);this.nextLine2D=!(code1&1)}}if(codingLine[0]>0){this.outputBits=codingLine[this.codingPos=0]}else{this.outputBits=codingLine[this.codingPos=1]}this.row++}var c;if(this.outputBits>=8){c=this.codingPos&1?0:255;this.outputBits-=8;if(this.outputBits===0&&codingLine[this.codingPos]bits){c<<=bits;if(!(this.codingPos&1)){c|=255>>8-bits}this.outputBits-=bits;bits=0}else{c<<=this.outputBits;if(!(this.codingPos&1)){c|=255>>8-this.outputBits}bits-=this.outputBits;this.outputBits=0;if(codingLine[this.codingPos]0){c<<=bits;bits=0}}}while(bits)}if(this.black){c^=255}return c};CCITTFaxStream.prototype.findTableCode=function ccittFaxStreamFindTableCode(start,end,table,limit){var limitValue=limit||0;for(var i=start;i<=end;++i){var code=this.lookBits(i);if(code===ccittEOF){return[true,1,false]}if(i=limitValue){var p=table[code-limitValue];if(p[0]===i){this.eatBits(i);return[true,p[1],true]}}}return[false,0,false]};CCITTFaxStream.prototype.getTwoDimCode=function ccittFaxStreamGetTwoDimCode(){var code=0;var p;if(this.eoblock){code=this.lookBits(7);p=twoDimTable[code];if(p&&p[0]>0){this.eatBits(p[0]);return p[1]}}else{var result=this.findTableCode(1,7,twoDimTable);if(result[0]&&result[2]){return result[1]}}info("Bad two dim code");return ccittEOF};CCITTFaxStream.prototype.getWhiteCode=function ccittFaxStreamGetWhiteCode(){var code=0;var p;if(this.eoblock){code=this.lookBits(12);if(code===ccittEOF){return 1}if(code>>5===0){p=whiteTable1[code]}else{p=whiteTable2[code>>3]}if(p[0]>0){this.eatBits(p[0]);return p[1]}}else{var result=this.findTableCode(1,9,whiteTable2);if(result[0]){return result[1]}result=this.findTableCode(11,12,whiteTable1);if(result[0]){return result[1]}}info("bad white code");this.eatBits(1);return 1};CCITTFaxStream.prototype.getBlackCode=function ccittFaxStreamGetBlackCode(){var code,p;if(this.eoblock){code=this.lookBits(13);if(code===ccittEOF){return 1}if(code>>7===0){p=blackTable1[code]}else if(code>>9===0&&code>>7!==0){p=blackTable2[(code>>1)-64]}else{p=blackTable3[code>>7]}if(p[0]>0){this.eatBits(p[0]);return p[1]}}else{var result=this.findTableCode(2,6,blackTable3);if(result[0]){return result[1]}result=this.findTableCode(7,12,blackTable2,64);if(result[0]){return result[1]}result=this.findTableCode(10,13,blackTable1);if(result[0]){return result[1]}}info("bad black code");this.eatBits(1);return 1};CCITTFaxStream.prototype.lookBits=function CCITTFaxStream_lookBits(n){var c;while(this.inputBits>16-n}this.inputBuf=this.inputBuf<<8|c;this.inputBits+=8}return this.inputBuf>>this.inputBits-n&65535>>16-n};CCITTFaxStream.prototype.eatBits=function CCITTFaxStream_eatBits(n){if((this.inputBits-=n)<0){this.inputBits=0}};return CCITTFaxStream}();var LZWStream=function LZWStreamClosure(){function LZWStream(str,maybeLength,earlyChange){this.str=str;this.dict=str.dict;this.cachedData=0;this.bitsCached=0;var maxLzwDictionarySize=4096;var lzwState={earlyChange:earlyChange,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(maxLzwDictionarySize),dictionaryLengths:new Uint16Array(maxLzwDictionarySize),dictionaryPrevCodes:new Uint16Array(maxLzwDictionarySize),currentSequence:new Uint8Array(maxLzwDictionarySize),currentSequenceLength:0};for(var i=0;i<256;++i){lzwState.dictionaryValues[i]=i;lzwState.dictionaryLengths[i]=1}this.lzwState=lzwState;DecodeStream.call(this,maybeLength)}LZWStream.prototype=Object.create(DecodeStream.prototype);LZWStream.prototype.readBits=function LZWStream_readBits(n){var bitsCached=this.bitsCached;var cachedData=this.cachedData;while(bitsCached>>bitsCached&(1<0;if(code<256){currentSequence[0]=code;currentSequenceLength=1}else if(code>=258){if(code=0;j--){currentSequence[j]=dictionaryValues[q];q=dictionaryPrevCodes[q]}}else{currentSequence[currentSequenceLength++]=currentSequence[0]}}else if(code===256){codeLength=9;nextCode=258;currentSequenceLength=0;continue}else{this.eof=true;delete this.lzwState;break}if(hasPrev){dictionaryPrevCodes[nextCode]=prevCode;dictionaryLengths[nextCode]=dictionaryLengths[prevCode]+1;dictionaryValues[nextCode]=currentSequence[0];nextCode++;codeLength=nextCode+earlyChange&nextCode+earlyChange-1?codeLength:Math.min(Math.log(nextCode+earlyChange)/.6931471805599453+1,12)|0}prevCode=code;decodedLength+=currentSequenceLength;if(estimatedDecodedSize>5&255;padded[i++]=length>>13&255;padded[i++]=length>>21&255;padded[i++]=length>>>29&255;padded[i++]=0;padded[i++]=0;padded[i++]=0;var w=new Int32Array(16);for(i=0;i>>32-rotate)|0;a=tmp}h0=h0+a|0;h1=h1+b|0;h2=h2+c|0;h3=h3+d|0}return new Uint8Array([h0&255,h0>>8&255,h0>>16&255,h0>>>24&255,h1&255,h1>>8&255,h1>>16&255,h1>>>24&255,h2&255,h2>>8&255,h2>>16&255,h2>>>24&255,h3&255,h3>>8&255,h3>>16&255,h3>>>24&255])}return hash}();var Word64=function Word64Closure(){function Word64(highInteger,lowInteger){this.high=highInteger|0;this.low=lowInteger|0}Word64.prototype={and:function Word64_and(word){this.high&=word.high;this.low&=word.low},xor:function Word64_xor(word){this.high^=word.high;this.low^=word.low},or:function Word64_or(word){this.high|=word.high;this.low|=word.low},shiftRight:function Word64_shiftRight(places){if(places>=32){this.low=this.high>>>places-32|0;this.high=0}else{this.low=this.low>>>places|this.high<<32-places;this.high=this.high>>>places|0}},shiftLeft:function Word64_shiftLeft(places){if(places>=32){this.high=this.low<>>32-places;this.low=this.low<>>places|high<<32-places;this.high=high>>>places|low<<32-places},not:function Word64_not(){this.high=~this.high;this.low=~this.low},add:function Word64_add(word){var lowAdd=(this.low>>>0)+(word.low>>>0);var highAdd=(this.high>>>0)+(word.high>>>0);if(lowAdd>4294967295){highAdd+=1}this.low=lowAdd|0;this.high=highAdd|0},copyTo:function Word64_copyTo(bytes,offset){bytes[offset]=this.high>>>24&255;bytes[offset+1]=this.high>>16&255;bytes[offset+2]=this.high>>8&255;bytes[offset+3]=this.high&255;bytes[offset+4]=this.low>>>24&255;bytes[offset+5]=this.low>>16&255;bytes[offset+6]=this.low>>8&255;bytes[offset+7]=this.low&255},assign:function Word64_assign(word){this.high=word.high;this.low=word.low}};return Word64}();var calculateSHA256=function calculateSHA256Closure(){function rotr(x,n){return x>>>n|x<<32-n}function ch(x,y,z){return x&y^~x&z}function maj(x,y,z){return x&y^x&z^y&z}function sigma(x){return rotr(x,2)^rotr(x,13)^rotr(x,22)}function sigmaPrime(x){return rotr(x,6)^rotr(x,11)^rotr(x,25)}function littleSigma(x){return rotr(x,7)^rotr(x,18)^x>>>3}function littleSigmaPrime(x){return rotr(x,17)^rotr(x,19)^x>>>10}var k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function hash(data,offset,length){var h0=1779033703,h1=3144134277,h2=1013904242,h3=2773480762,h4=1359893119,h5=2600822924,h6=528734635,h7=1541459225;var paddedLength=Math.ceil((length+9)/64)*64;var padded=new Uint8Array(paddedLength);var i,j,n;for(i=0;i>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;var w=new Uint32Array(64);for(i=0;i>24&255,h0>>16&255,h0>>8&255,h0&255,h1>>24&255,h1>>16&255,h1>>8&255,h1&255,h2>>24&255,h2>>16&255,h2>>8&255,h2&255,h3>>24&255,h3>>16&255,h3>>8&255,h3&255,h4>>24&255,h4>>16&255,h4>>8&255,h4&255,h5>>24&255,h5>>16&255,h5>>8&255,h5&255,h6>>24&255,h6>>16&255,h6>>8&255,h6&255,h7>>24&255,h7>>16&255,h7>>8&255,h7&255])}return hash}();var calculateSHA512=function calculateSHA512Closure(){function ch(result,x,y,z,tmp){result.assign(x);result.and(y);tmp.assign(x);tmp.not();tmp.and(z);result.xor(tmp)}function maj(result,x,y,z,tmp){result.assign(x);result.and(y);tmp.assign(x);tmp.and(z);result.xor(tmp);tmp.assign(y);tmp.and(z);result.xor(tmp)}function sigma(result,x,tmp){result.assign(x);result.rotateRight(28);tmp.assign(x);tmp.rotateRight(34);result.xor(tmp);tmp.assign(x);tmp.rotateRight(39);result.xor(tmp)}function sigmaPrime(result,x,tmp){result.assign(x);result.rotateRight(14);tmp.assign(x);tmp.rotateRight(18);result.xor(tmp);tmp.assign(x);tmp.rotateRight(41);result.xor(tmp)}function littleSigma(result,x,tmp){result.assign(x);result.rotateRight(1);tmp.assign(x);tmp.rotateRight(8);result.xor(tmp);tmp.assign(x);tmp.shiftRight(7);result.xor(tmp)}function littleSigmaPrime(result,x,tmp){result.assign(x);result.rotateRight(19);tmp.assign(x);tmp.rotateRight(61);result.xor(tmp);tmp.assign(x);tmp.shiftRight(6);result.xor(tmp)}var k=[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)];function hash(data,offset,length,mode384){mode384=!!mode384;var h0,h1,h2,h3,h4,h5,h6,h7;if(!mode384){h0=new Word64(1779033703,4089235720);h1=new Word64(3144134277,2227873595);h2=new Word64(1013904242,4271175723);h3=new Word64(2773480762,1595750129);h4=new Word64(1359893119,2917565137);h5=new Word64(2600822924,725511199);h6=new Word64(528734635,4215389547);h7=new Word64(1541459225,327033209)}else{h0=new Word64(3418070365,3238371032);h1=new Word64(1654270250,914150663);h2=new Word64(2438529370,812702999);h3=new Word64(355462360,4144912697);h4=new Word64(1731405415,4290775857);h5=new Word64(2394180231,1750603025);h6=new Word64(3675008525,1694076839);h7=new Word64(1203062813,3204075428)}var paddedLength=Math.ceil((length+17)/128)*128;var padded=new Uint8Array(paddedLength);var i,j,n;for(i=0;i>>29&255;padded[i++]=length>>21&255;padded[i++]=length>>13&255;padded[i++]=length>>5&255;padded[i++]=length<<3&255;var w=new Array(80);for(i=0;i<80;i++){w[i]=new Word64(0,0)}var a=new Word64(0,0),b=new Word64(0,0),c=new Word64(0,0);var d=new Word64(0,0),e=new Word64(0,0),f=new Word64(0,0);var g=new Word64(0,0),h=new Word64(0,0);var t1=new Word64(0,0),t2=new Word64(0,0);var tmp1=new Word64(0,0),tmp2=new Word64(0,0),tmp3;for(i=0;i=1;--i){t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}for(j=0;j<16;j+=4){var s0=mix[state[j]],s1=mix[state[j+1]],s2=mix[state[j+2]],s3=mix[state[j+3]];t=s0^s1>>>8^s1<<24^s2>>>16^s2<<16^s3>>>24^s3<<8;state[j]=t>>>24&255;state[j+1]=t>>16&255;state[j+2]=t>>8&255;state[j+3]=t&255}}t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]];state[j]^=key[j]}return state}function encrypt128(input,key){var t,u,v,k;var state=new Uint8Array(16);state.set(input);for(j=0;j<16;++j){state[j]^=key[j]}for(i=1;i<10;i++){for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(var j=0;j<16;j+=4){var s0=state[j+0],s1=state[j+1];var s2=state[j+2],s3=state[j+3];t=s0^s1^s2^s3;state[j+0]^=t^mixCol[s0^s1];state[j+1]^=t^mixCol[s1^s2];state[j+2]^=t^mixCol[s2^s3];state[j+3]^=t^mixCol[s3^s0]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}}for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(j=0,k=160;j<16;++j,++k){state[j]^=key[k]}return state}function AES128Cipher(key){this.key=expandKey128(key);this.buffer=new Uint8Array(16);this.bufferPosition=0}function decryptBlock2(data,finalize){var i,j,ii,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv;for(i=0;i=ii;--i){if(lastBlock[i]!==psLen){psLen=0;break}}outputLength-=psLen;result[result.length-1]=lastBlock.subarray(0,16-psLen)}}var output=new Uint8Array(outputLength);for(i=0,j=0,ii=result.length;i=256){r=(r^27)&255}}for(var n=0;n<4;++n){result[j]=t1^=result[j-32];j++;result[j]=t2^=result[j-32];j++;result[j]=t3^=result[j-32];j++;result[j]=t4^=result[j-32];j++}}return result}function decrypt256(input,key){var state=new Uint8Array(16);state.set(input);var i,j,k;var t,u,v;for(j=0,k=224;j<16;++j,++k){state[j]^=key[k]}for(i=13;i>=1;--i){t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}for(j=0;j<16;j+=4){var s0=mix[state[j]],s1=mix[state[j+1]],s2=mix[state[j+2]],s3=mix[state[j+3]];t=s0^s1>>>8^s1<<24^s2>>>16^s2<<16^s3>>>24^s3<<8;state[j]=t>>>24&255;state[j+1]=t>>16&255;state[j+2]=t>>8&255;state[j+3]=t&255}}t=state[13];state[13]=state[9];state[9]=state[5];state[5]=state[1];state[1]=t;t=state[14];u=state[10];state[14]=state[6];state[10]=state[2];state[6]=t;state[2]=u;t=state[15];u=state[11];v=state[7];state[15]=state[3];state[11]=t;state[7]=u;state[3]=v;for(j=0;j<16;++j){state[j]=inv_s[state[j]];state[j]^=key[j]}return state}function encrypt256(input,key){var t,u,v,k;var state=new Uint8Array(16);state.set(input);for(j=0;j<16;++j){state[j]^=key[j]}for(i=1;i<14;i++){for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(var j=0;j<16;j+=4){var s0=state[j+0],s1=state[j+1];var s2=state[j+2],s3=state[j+3];t=s0^s1^s2^s3;state[j+0]^=t^mixCol[s0^s1];state[j+1]^=t^mixCol[s1^s2];state[j+2]^=t^mixCol[s2^s3];state[j+3]^=t^mixCol[s3^s0]}for(j=0,k=i*16;j<16;++j,++k){state[j]^=key[k]}}for(j=0;j<16;++j){state[j]=s[state[j]]}v=state[1];state[1]=state[5];state[5]=state[9];state[9]=state[13];state[13]=v;v=state[2];u=state[6];state[2]=state[10];state[6]=state[14];state[10]=v;state[14]=u;v=state[3];u=state[7];t=state[11];state[3]=state[15];state[7]=v;state[11]=u;state[15]=t;for(j=0,k=224;j<16;++j,++k){state[j]^=key[k]}return state}function AES256Cipher(key){this.key=expandKey256(key);this.buffer=new Uint8Array(16);this.bufferPosition=0}function decryptBlock2(data,finalize){var i,j,ii,sourceLength=data.length,buffer=this.buffer,bufferLength=this.bufferPosition,result=[],iv=this.iv;for(i=0;i=ii;--i){if(lastBlock[i]!==psLen){psLen=0;break}}outputLength-=psLen;result[result.length-1]=lastBlock.subarray(0,16-psLen)}}var output=new Uint8Array(outputLength);for(i=0,j=0,ii=result.length;ii-32){var arrayLength=password.length+k.length+userBytes.length;var k1=new Uint8Array(arrayLength*64);var array=concatArrays(password,k);array=concatArrays(array,userBytes);for(var j=0,pos=0;j<64;j++,pos+=arrayLength){k1.set(array,pos)}var cipher=new AES128Cipher(k.subarray(0,16));e=cipher.encrypt(k1,k.subarray(16,32));var remainder=0;for(var z=0;z<16;z++){remainder*=256%3;remainder%=3;remainder+=(e[z]>>>0)%3;remainder%=3}if(remainder===0){k=calculateSHA256(e,0,e.length)}else if(remainder===1){k=calculateSHA384(e,0,e.length)}else if(remainder===2){k=calculateSHA512(e,0,e.length)}i++}return k.subarray(0,32)}function PDF20(){}function compareByteArrays(array1,array2){if(array1.length!==array2.length){return false}for(var i=0;i>8&255;hashData[i++]=flags>>16&255;hashData[i++]=flags>>>24&255;for(j=0,n=fileId.length;j=4&&!encryptMetadata){hashData[i++]=255;hashData[i++]=255;hashData[i++]=255;hashData[i++]=255}var hash=calculateMD5(hashData,0,i);var keyLengthInBytes=keyLength>>3;if(revision>=3){for(j=0;j<50;++j){hash=calculateMD5(hash,0,keyLengthInBytes)}}var encryptionKey=hash.subarray(0,keyLengthInBytes);var cipher,checkData;if(revision>=3){for(i=0;i<32;++i){hashData[i]=defaultPasswordBytes[i]}for(j=0,n=fileId.length;j>3;if(revision>=3){for(j=0;j<50;++j){hash=calculateMD5(hash,0,hash.length)}}var cipher,userPassword;if(revision>=3){userPassword=ownerPassword;var derivedKey=new Uint8Array(keyLengthInBytes),k;for(j=19;j>=0;j--){for(k=0;k=4){this.cf=dict.get("CF");this.stmf=dict.get("StmF")||identityName;this.strf=dict.get("StrF")||identityName;this.eff=dict.get("EFF")||this.stmf}}function buildObjectKey(num,gen,encryptionKey,isAes){var key=new Uint8Array(encryptionKey.length+9),i,n;for(i=0,n=encryptionKey.length;i>8&255;key[i++]=num>>16&255;key[i++]=gen&255;key[i++]=gen>>8&255;if(isAes){key[i++]=115;key[i++]=65;key[i++]=108;key[i++]=84}var hash=calculateMD5(key,0,i);return hash.subarray(0,Math.min(encryptionKey.length+5,16))}function buildCipherConstructor(cf,name,num,gen,key){var cryptFilter=cf.get(name.name);var cfm;if(cryptFilter!==null&&cryptFilter!==undefined){cfm=cryptFilter.get("CFM")}if(!cfm||cfm.name==="None"){return function cipherTransformFactoryBuildCipherConstructorNone(){return new NullCipher}}if("V2"===cfm.name){return function cipherTransformFactoryBuildCipherConstructorV2(){return new ARCFourCipher(buildObjectKey(num,gen,key,false))}}if("AESV2"===cfm.name){return function cipherTransformFactoryBuildCipherConstructorAESV2(){return new AES128Cipher(buildObjectKey(num,gen,key,true))}}if("AESV3"===cfm.name){return function cipherTransformFactoryBuildCipherConstructorAESV3(){return new AES256Cipher(key)}}error("Unknown crypto method")}CipherTransformFactory.prototype={createCipherTransform:function CipherTransformFactory_createCipherTransform(num,gen){if(this.algorithm===4||this.algorithm===5){return new CipherTransform(buildCipherConstructor(this.cf,this.stmf,num,gen,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,num,gen,this.encryptionKey))}var key=buildObjectKey(num,gen,this.encryptionKey,false);var cipherConstructor=function buildCipherCipherConstructor(){return new ARCFourCipher(key)};return new CipherTransform(cipherConstructor,cipherConstructor)}};return CipherTransformFactory}();exports.AES128Cipher=AES128Cipher;exports.AES256Cipher=AES256Cipher;exports.ARCFourCipher=ARCFourCipher;exports.CipherTransformFactory=CipherTransformFactory;exports.PDF17=PDF17;exports.PDF20=PDF20;exports.calculateMD5=calculateMD5;exports.calculateSHA256=calculateSHA256;exports.calculateSHA384=calculateSHA384;exports.calculateSHA512=calculateSHA512});(function(root,factory){{factory(root.pdfjsCoreFontRenderer={},root.pdfjsSharedUtil,root.pdfjsCoreStream,root.pdfjsCoreGlyphList,root.pdfjsCoreEncodings,root.pdfjsCoreCFFParser)}})(this,function(exports,sharedUtil,coreStream,coreGlyphList,coreEncodings,coreCFFParser){var Util=sharedUtil.Util;var bytesToString=sharedUtil.bytesToString;var error=sharedUtil.error;var Stream=coreStream.Stream;var getGlyphsUnicode=coreGlyphList.getGlyphsUnicode;var StandardEncoding=coreEncodings.StandardEncoding;var CFFParser=coreCFFParser.CFFParser;var FontRendererFactory=function FontRendererFactoryClosure(){function getLong(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]}function getUshort(data,offset){return data[offset]<<8|data[offset+1]}function parseCmap(data,start,end){var offset=getUshort(data,start+2)===1?getLong(data,start+8):getLong(data,start+16);var format=getUshort(data,start+offset);var length,ranges,p,i;if(format===4){length=getUshort(data,start+offset+2);var segCount=getUshort(data,start+offset+6)>>1;p=start+offset+14;ranges=[];for(i=0;i>1;if(code>16;var flags;var x=0,y=0;i+=10;if(numberOfContours<0){do{flags=code[i]<<8|code[i+1];var glyphIndex=code[i+2]<<8|code[i+3];i+=4;var arg1,arg2;if(flags&1){arg1=(code[i]<<24|code[i+1]<<16)>>16;arg2=(code[i+2]<<24|code[i+3]<<16)>>16;i+=4}else{arg1=code[i++];arg2=code[i++]}if(flags&2){x=arg1;y=arg2}else{x=0;y=0}var scaleX=1,scaleY=1,scale01=0,scale10=0;if(flags&8){scaleX=scaleY=(code[i]<<24|code[i+1]<<16)/1073741824;i+=2}else if(flags&64){scaleX=(code[i]<<24|code[i+1]<<16)/1073741824;scaleY=(code[i+2]<<24|code[i+3]<<16)/1073741824;i+=4}else if(flags&128){scaleX=(code[i]<<24|code[i+1]<<16)/1073741824;scale01=(code[i+2]<<24|code[i+3]<<16)/1073741824;scale10=(code[i+4]<<24|code[i+5]<<16)/1073741824;scaleY=(code[i+6]<<24|code[i+7]<<16)/1073741824;i+=8}var subglyph=font.glyphs[glyphIndex];if(subglyph){cmds.push({cmd:"save"});cmds.push({cmd:"transform",args:[scaleX,scale01,scale10,scaleY,x,y]});compileGlyf(subglyph,cmds,font);cmds.push({cmd:"restore"})}}while(flags&32)}else{var endPtsOfContours=[];var j,jj;for(j=0;j0){points.push({flags:flags})}}for(j=0;j>16;i+=2;break;case 2:x-=code[i++];break;case 18:x+=code[i++];break}points[j].x=x}for(j=0;j>16;i+=2;break;case 4:y-=code[i++];break;case 36:y+=code[i++];break}points[j].y=y}var startPoint=0;for(i=0;i>1;stackClean=true;break;case 3:stems+=stack.length>>1;stackClean=true;break;case 4:y+=stack.pop();moveTo(x,y);stackClean=true;break;case 5:while(stack.length>0){x+=stack.shift();y+=stack.shift();lineTo(x,y)}break;case 6:while(stack.length>0){x+=stack.shift();lineTo(x,y);if(stack.length===0){break}y+=stack.shift();lineTo(x,y)}break;case 7:while(stack.length>0){y+=stack.shift();lineTo(x,y);if(stack.length===0){break}x+=stack.shift();lineTo(x,y)}break;case 8:while(stack.length>0){xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 10:n=stack.pop()+font.subrsBias;subrCode=font.subrs[n];if(subrCode){parse(subrCode)}break;case 11:return;case 12:v=code[i++];switch(v){case 34:xa=x+stack.shift();xb=xa+stack.shift();y1=y+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y,xb,y1,x,y1);xa=x+stack.shift();xb=xa+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y1,xb,y,x,y);break;case 35:xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);stack.pop();break;case 36:xa=x+stack.shift();y1=y+stack.shift();xb=xa+stack.shift();y2=y1+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y1,xb,y2,x,y2);xa=x+stack.shift();xb=xa+stack.shift();y3=y2+stack.shift();x=xb+stack.shift();bezierCurveTo(xa,y2,xb,y3,x,y);break;case 37:var x0=x,y0=y;xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb;y=yb;if(Math.abs(x-x0)>Math.abs(y-y0)){x+=stack.shift()}else{y+=stack.shift()}bezierCurveTo(xa,ya,xb,yb,x,y);break;default:error("unknown operator: 12 "+v)}break;case 14:if(stack.length>=4){var achar=stack.pop();var bchar=stack.pop();y=stack.pop();x=stack.pop();cmds.push({cmd:"save"});cmds.push({cmd:"translate",args:[x,y]});var cmap=lookupCmap(font.cmap,String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]]));compileCharString(font.glyphs[cmap.glyphId],cmds,font);cmds.push({cmd:"restore"});cmap=lookupCmap(font.cmap,String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]]));compileCharString(font.glyphs[cmap.glyphId],cmds,font)}return;case 18:stems+=stack.length>>1;stackClean=true;break;case 19:stems+=stack.length>>1;i+=stems+7>>3;stackClean=true;break;case 20:stems+=stack.length>>1;i+=stems+7>>3;stackClean=true;break;case 21:y+=stack.pop();x+=stack.pop();moveTo(x,y);stackClean=true;break;case 22:x+=stack.pop();moveTo(x,y);stackClean=true;break;case 23:stems+=stack.length>>1;stackClean=true;break;case 24:while(stack.length>2){xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y)}x+=stack.shift();y+=stack.shift();lineTo(x,y);break;case 25:while(stack.length>6){x+=stack.shift();y+=stack.shift();lineTo(x,y)}xa=x+stack.shift();ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y);break;case 26:if(stack.length%2){x+=stack.shift()}while(stack.length>0){xa=x;ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb;y=yb+stack.shift();bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 27:if(stack.length%2){y+=stack.shift()}while(stack.length>0){xa=x+stack.shift();ya=y;xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb;bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 28:stack.push((code[i]<<24|code[i+1]<<16)>>16);i+=2;break;case 29:n=stack.pop()+font.gsubrsBias;subrCode=font.gsubrs[n];if(subrCode){parse(subrCode)}break;case 30:while(stack.length>0){xa=x;ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y);if(stack.length===0){break}xa=x+stack.shift();ya=y;xb=xa+stack.shift();yb=ya+stack.shift();y=yb+stack.shift();x=xb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y)}break;case 31:while(stack.length>0){xa=x+stack.shift();ya=y;xb=xa+stack.shift();yb=ya+stack.shift();y=yb+stack.shift();x=xb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y);if(stack.length===0){break}xa=x;ya=y+stack.shift();xb=xa+stack.shift();yb=ya+stack.shift();x=xb+stack.shift();y=yb+(stack.length===1?stack.shift():0);bezierCurveTo(xa,ya,xb,yb,x,y)}break;default:if(v<32){error("unknown operator: "+v)}if(v<247){stack.push(v-139)}else if(v<251){stack.push((v-247)*256+code[i++]+108)}else if(v<255){stack.push(-(v-251)*256-code[i++]-108)}else{stack.push((code[i]<<24|code[i+1]<<16|code[i+2]<<8|code[i+3])/65536);i+=4}break}if(stackClean){stack.length=0}}}parse(code)}var noop="";function CompiledFont(fontMatrix){this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null);this.fontMatrix=fontMatrix}CompiledFont.prototype={getPathJs:function(unicode){var cmap=lookupCmap(this.cmap,unicode);var fn=this.compiledGlyphs[cmap.glyphId];if(!fn){fn=this.compileGlyph(this.glyphs[cmap.glyphId]);this.compiledGlyphs[cmap.glyphId]=fn}if(this.compiledCharCodeToGlyphId[cmap.charCode]===undefined){this.compiledCharCodeToGlyphId[cmap.charCode]=cmap.glyphId}return fn},compileGlyph:function(code){if(!code||code.length===0||code[0]===14){return noop}var cmds=[];cmds.push({cmd:"save"});cmds.push({cmd:"transform",args:this.fontMatrix.slice()});cmds.push({cmd:"scale",args:["size","-size"]});this.compileGlyphImpl(code,cmds);cmds.push({cmd:"restore"});return cmds},compileGlyphImpl:function(){error("Children classes should implement this.")},hasBuiltPath:function(unicode){var cmap=lookupCmap(this.cmap,unicode);return this.compiledGlyphs[cmap.glyphId]!==undefined&&this.compiledCharCodeToGlyphId[cmap.charCode]!==undefined}};function TrueTypeCompiled(glyphs,cmap,fontMatrix){fontMatrix=fontMatrix||[488e-6,0,0,488e-6,0,0];CompiledFont.call(this,fontMatrix);this.glyphs=glyphs;this.cmap=cmap}Util.inherit(TrueTypeCompiled,CompiledFont,{compileGlyphImpl:function(code,cmds){compileGlyf(code,cmds,this)}});function Type2Compiled(cffInfo,cmap,fontMatrix,glyphNameMap){fontMatrix=fontMatrix||[.001,0,0,.001,0,0];CompiledFont.call(this,fontMatrix);this.glyphs=cffInfo.glyphs;this.gsubrs=cffInfo.gsubrs||[];this.subrs=cffInfo.subrs||[];this.cmap=cmap;this.glyphNameMap=glyphNameMap||getGlyphsUnicode();this.gsubrsBias=this.gsubrs.length<1240?107:this.gsubrs.length<33900?1131:32768;this.subrsBias=this.subrs.length<1240?107:this.subrs.length<33900?1131:32768}Util.inherit(Type2Compiled,CompiledFont,{compileGlyphImpl:function(code,cmds){compileCharString(code,cmds,this)}});return{create:function FontRendererFactory_create(font,seacAnalysisEnabled){var data=new Uint8Array(font.data);var cmap,glyf,loca,cff,indexToLocFormat,unitsPerEm;var numTables=getUshort(data,4);for(var i=0,p=12;i>")&&!isEOF(this.buf1)){if(!isName(this.buf1)){info("Malformed dictionary: key must be a name object");this.shift();continue}var key=this.buf1.name;this.shift();if(isEOF(this.buf1)){break}dict.set(key,this.getObj(cipherTransform))}if(isEOF(this.buf1)){if(!this.recoveryMode){error("End of file inside dictionary")}return dict}if(isCmd(this.buf2,"stream")){return this.allowStreams?this.makeStream(dict,cipherTransform):dict}this.shift();return dict;default:return buf1}}if(isInt(buf1)){var num=buf1;if(isInt(this.buf1)&&isCmd(this.buf2,"R")){var ref=new Ref(num,this.buf1);this.shift();this.shift();return ref}return num}if(isString(buf1)){var str=buf1;if(cipherTransform){str=cipherTransform.decryptString(str)}return str}return buf1},findDefaultInlineStreamEnd:function Parser_findDefaultInlineStreamEnd(stream){var E=69,I=73,SPACE=32,LF=10,CR=13;var startPos=stream.pos,state=0,ch,i,n,followingBytes;while((ch=stream.getByte())!==-1){if(state===0){state=ch===E?1:0}else if(state===1){state=ch===I?2:0}else{assert(state===2);if(ch===SPACE||ch===LF||ch===CR){n=5;followingBytes=stream.peekBytes(n);for(i=0;i127)){state=0;break}}if(state===2){break}}else{state=0}}}return stream.pos-4-startPos},findDCTDecodeInlineStreamEnd:function Parser_findDCTDecodeInlineStreamEnd(stream){var startPos=stream.pos,foundEOI=false,b,markerLength,length;while((b=stream.getByte())!==-1){if(b!==255){continue}switch(stream.getByte()){case 0:break;case 255:stream.skip(-1);break;case 217:foundEOI=true;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:markerLength=stream.getUint16();if(markerLength>2){stream.skip(markerLength-2)}else{stream.skip(-2)}break}if(foundEOI){break}}length=stream.pos-startPos;if(b===-1){warn("Inline DCTDecode image stream: "+"EOI marker not found, searching for /EI/ instead.");stream.skip(-length);return this.findDefaultInlineStreamEnd(stream)}this.inlineStreamSkipEI(stream);return length},findASCII85DecodeInlineStreamEnd:function Parser_findASCII85DecodeInlineStreamEnd(stream){var TILDE=126,GT=62;var startPos=stream.pos,ch,length;while((ch=stream.getByte())!==-1){if(ch===TILDE&&stream.peekByte()===GT){stream.skip();break}}length=stream.pos-startPos;if(ch===-1){warn("Inline ASCII85Decode image stream: "+"EOD marker not found, searching for /EI/ instead.");stream.skip(-length);return this.findDefaultInlineStreamEnd(stream)}this.inlineStreamSkipEI(stream);return length},findASCIIHexDecodeInlineStreamEnd:function Parser_findASCIIHexDecodeInlineStreamEnd(stream){var GT=62;var startPos=stream.pos,ch,length;while((ch=stream.getByte())!==-1){if(ch===GT){break}}length=stream.pos-startPos;if(ch===-1){warn("Inline ASCIIHexDecode image stream: "+"EOD marker not found, searching for /EI/ instead.");stream.skip(-length);return this.findDefaultInlineStreamEnd(stream)}this.inlineStreamSkipEI(stream);return length},inlineStreamSkipEI:function Parser_inlineStreamSkipEI(stream){var E=69,I=73;var state=0,ch;while((ch=stream.getByte())!==-1){if(state===0){state=ch===E?1:0}else if(state===1){state=ch===I?2:0}else if(state===2){break}}},makeInlineImage:function Parser_makeInlineImage(cipherTransform){var lexer=this.lexer;var stream=lexer.stream;var dict=new Dict(this.xref);while(!isCmd(this.buf1,"ID")&&!isEOF(this.buf1)){if(!isName(this.buf1)){error("Dictionary key must be a name object")}var key=this.buf1.name;this.shift();if(isEOF(this.buf1)){break}dict.set(key,this.getObj(cipherTransform))}var filter=dict.get("Filter","F"),filterName;if(isName(filter)){filterName=filter.name}else if(isArray(filter)&&isName(filter[0])){filterName=filter[0].name}var startPos=stream.pos,length,i,ii;if(filterName==="DCTDecode"||filterName==="DCT"){length=this.findDCTDecodeInlineStreamEnd(stream)}else if(filterName==="ASCII85Decide"||filterName==="A85"){length=this.findASCII85DecodeInlineStreamEnd(stream)}else if(filterName==="ASCIIHexDecode"||filterName==="AHx"){length=this.findASCIIHexDecodeInlineStreamEnd(stream)}else{length=this.findDefaultInlineStreamEnd(stream)}var imageStream=stream.makeSubStream(startPos,length,dict);var adler32;if(length=ENDSTREAM_SIGNATURE_LENGTH){found=true;break}i++}if(found){skipped+=i;stream.pos+=i;break}skipped+=scanLength;stream.pos+=scanLength}if(!found){error("Missing endstream")}length=skipped;lexer.nextChar();this.shift();this.shift()}this.shift();stream=stream.makeSubStream(pos,length,dict);if(cipherTransform){stream=cipherTransform.createStream(stream,length)}stream=this.filter(stream,dict,length);stream.dict=dict;return stream},filter:function Parser_filter(stream,dict,length){var filter=dict.get("Filter","F");var params=dict.get("DecodeParms","DP");if(isName(filter)){return this.makeFilter(stream,filter.name,length,params)}var maybeLength=length;if(isArray(filter)){var filterArray=filter;var paramsArray=params;for(var i=0,ii=filterArray.length;i=48&&ch<=57){return ch&15}if(ch>=65&&ch<=70||ch>=97&&ch<=102){return(ch&15)+9}return-1}Lexer.prototype={nextChar:function Lexer_nextChar(){return this.currentChar=this.stream.getByte()},peekChar:function Lexer_peekChar(){return this.stream.peekByte()},getNumber:function Lexer_getNumber(){var ch=this.currentChar;var eNotation=false;var divideBy=0;var sign=1;if(ch===45){sign=-1;ch=this.nextChar();if(ch===45){ch=this.nextChar()}}else if(ch===43){ch=this.nextChar()}if(ch===46){divideBy=10;ch=this.nextChar()}if(ch<48||ch>57){error("Invalid number: "+String.fromCharCode(ch));return 0}var baseValue=ch-48;var powerValue=0;var powerValueSign=1;while((ch=this.nextChar())>=0){if(48<=ch&&ch<=57){var currentDigit=ch-48;if(eNotation){powerValue=powerValue*10+currentDigit}else{if(divideBy!==0){divideBy*=10}baseValue=baseValue*10+currentDigit}}else if(ch===46){if(divideBy===0){divideBy=1}else{break}}else if(ch===45){warn("Badly formatted number")}else if(ch===69||ch===101){ch=this.peekChar();if(ch===43||ch===45){powerValueSign=ch===45?-1:1;this.nextChar()}else if(ch<48||ch>57){break}eNotation=true}else{break}}if(divideBy!==0){baseValue/=divideBy}if(eNotation){baseValue*=Math.pow(10,powerValueSign*powerValue)}return sign*baseValue},getString:function Lexer_getString(){var numParen=1;var done=false;var strBuf=this.strBuf;strBuf.length=0;var ch=this.nextChar();while(true){var charBuffered=false;switch(ch|0){case-1:warn("Unterminated string");done=true;break;case 40:++numParen;strBuf.push("(");break;case 41:if(--numParen===0){this.nextChar();done=true}else{strBuf.push(")")}break;case 92:ch=this.nextChar();switch(ch){case-1:warn("Unterminated string");done=true;break;case 110:strBuf.push("\n");break;case 114:strBuf.push("\r");break;case 116:strBuf.push(" ");break;case 98:strBuf.push("\b");break;case 102:strBuf.push("\f");break;case 92:case 40:case 41:strBuf.push(String.fromCharCode(ch));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var x=ch&15;ch=this.nextChar();charBuffered=true;if(ch>=48&&ch<=55){x=(x<<3)+(ch&15);ch=this.nextChar();if(ch>=48&&ch<=55){charBuffered=false;x=(x<<3)+(ch&15)}}strBuf.push(String.fromCharCode(x));break;case 13:if(this.peekChar()===10){this.nextChar()}break;case 10:break;default:strBuf.push(String.fromCharCode(ch));break}break;default:strBuf.push(String.fromCharCode(ch));break}if(done){break}if(!charBuffered){ch=this.nextChar()}}return strBuf.join("")},getName:function Lexer_getName(){var ch,previousCh;var strBuf=this.strBuf;strBuf.length=0;while((ch=this.nextChar())>=0&&!specialChars[ch]){if(ch===35){ch=this.nextChar();if(specialChars[ch]){warn("Lexer_getName: "+"NUMBER SIGN (#) should be followed by a hexadecimal number.");strBuf.push("#");break}var x=toHexDigit(ch);if(x!==-1){previousCh=ch;ch=this.nextChar();var x2=toHexDigit(ch);if(x2===-1){warn("Lexer_getName: Illegal digit ("+String.fromCharCode(ch)+") in hexadecimal number.");strBuf.push("#",String.fromCharCode(previousCh));if(specialChars[ch]){break}strBuf.push(String.fromCharCode(ch));continue}strBuf.push(String.fromCharCode(x<<4|x2))}else{strBuf.push("#",String.fromCharCode(ch))}}else{strBuf.push(String.fromCharCode(ch))}}if(strBuf.length>127){warn("name token is longer than allowed by the spec: "+strBuf.length)}return Name.get(strBuf.join(""))},getHexString:function Lexer_getHexString(){var strBuf=this.strBuf;strBuf.length=0;var ch=this.currentChar;var isFirstHex=true;var firstDigit;var secondDigit;while(true){if(ch<0){warn("Unterminated hex string");break}else if(ch===62){this.nextChar();break}else if(specialChars[ch]===1){ch=this.nextChar();continue}else{if(isFirstHex){firstDigit=toHexDigit(ch);if(firstDigit===-1){warn('Ignoring invalid character "'+ch+'" in hex string');ch=this.nextChar();continue}}else{secondDigit=toHexDigit(ch);if(secondDigit===-1){warn('Ignoring invalid character "'+ch+'" in hex string');ch=this.nextChar();continue}strBuf.push(String.fromCharCode(firstDigit<<4|secondDigit))}isFirstHex=!isFirstHex;ch=this.nextChar()}}return strBuf.join("")},getObj:function Lexer_getObj(){var comment=false;var ch=this.currentChar;while(true){if(ch<0){return EOF}if(comment){if(ch===10||ch===13){comment=false}}else if(ch===37){comment=true}else if(specialChars[ch]!==1){break}ch=this.nextChar()}switch(ch|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return Cmd.get("[");case 93:this.nextChar();return Cmd.get("]");case 60:ch=this.nextChar();if(ch===60){this.nextChar();return Cmd.get("<<")}return this.getHexString();case 62:ch=this.nextChar();if(ch===62){this.nextChar();return Cmd.get(">>")}return Cmd.get(">");case 123:this.nextChar();return Cmd.get("{");case 125:this.nextChar();return Cmd.get("}");case 41:error("Illegal character: "+ch);break}var str=String.fromCharCode(ch);var knownCommands=this.knownCommands;var knownCommandFound=knownCommands&&knownCommands[str]!==undefined;while((ch=this.nextChar())>=0&&!specialChars[ch]){var possibleCommand=str+String.fromCharCode(ch);if(knownCommandFound&&knownCommands[possibleCommand]===undefined){break}if(str.length===128){error("Command token too long: "+str.length)}str=possibleCommand;knownCommandFound=knownCommands&&knownCommands[str]!==undefined}if(str==="true"){return true}if(str==="false"){return false}if(str==="null"){return null}return Cmd.get(str)},skipToNextLine:function Lexer_skipToNextLine(){var ch=this.currentChar;while(ch>=0){if(ch===13){ch=this.nextChar();if(ch===10){this.nextChar()}break}else if(ch===10){this.nextChar();break}ch=this.nextChar()}}};return Lexer}();var Linearization={create:function LinearizationCreate(stream){function getInt(name,allowZeroValue){var obj=linDict.get(name);if(isInt(obj)&&(allowZeroValue?obj>=0:obj>0)){return obj}throw new Error('The "'+name+'" parameter in the linearization '+"dictionary is invalid.")}function getHints(){var hints=linDict.get("H"),hintsLength,item;if(isArray(hints)&&((hintsLength=hints.length)===2||hintsLength===4)){for(var index=0;index0)){throw new Error("Hint ("+index+") in the linearization dictionary is invalid.")}}return hints}throw new Error("Hint array in the linearization dictionary is invalid.")}var parser=new Parser(new Lexer(stream),false,null);var obj1=parser.getObj();var obj2=parser.getObj();var obj3=parser.getObj();var linDict=parser.getObj();var obj,length;if(!(isInt(obj1)&&isInt(obj2)&&isCmd(obj3,"obj")&&isDict(linDict)&&isNum(obj=linDict.get("Linearized"))&&obj>0)){return null}else if((length=getInt("L"))!==stream.length){throw new Error('The "L" parameter in the linearization dictionary '+"does not equal the stream length.")}return{length:length,hints:getHints(),objectNumberFirst:getInt("O"),endFirst:getInt("E"),numPages:getInt("N"),mainXRefEntriesOffset:getInt("T"),pageFirst:linDict.has("P")?getInt("P",true):0}}};exports.EOF=EOF;exports.Lexer=Lexer;exports.Linearization=Linearization;exports.Parser=Parser;exports.isEOF=isEOF});(function(root,factory){{factory(root.pdfjsCoreType1Parser={},root.pdfjsSharedUtil,root.pdfjsCoreStream,root.pdfjsCoreEncodings)}})(this,function(exports,sharedUtil,coreStream,coreEncodings){var warn=sharedUtil.warn;var isSpace=sharedUtil.isSpace;var Stream=coreStream.Stream;var getEncoding=coreEncodings.getEncoding;var HINTING_ENABLED=false;var Type1CharString=function Type1CharStringClosure(){var COMMAND_MAP={hstem:[1],vstem:[3],vmoveto:[4],rlineto:[5],hlineto:[6],vlineto:[7],rrcurveto:[8],callsubr:[10],flex:[12,35],drop:[12,18],endchar:[14],rmoveto:[21],hmoveto:[22],vhcurveto:[30],hvcurveto:[31]};function Type1CharString(){this.width=0;this.lsb=0;this.flexing=false;this.output=[];this.stack=[]}Type1CharString.prototype={convert:function Type1CharString_convert(encoded,subrs,seacAnalysisEnabled){var count=encoded.length;var error=false;var wx,sbx,subrNumber;for(var i=0;istackLength){return true}var start=stackLength-howManyArgs;for(var i=start;i>8&255,value&255)}else{value=65536*value|0;this.output.push(255,value>>24&255,value>>16&255,value>>8&255,value&255)}}this.output.push.apply(this.output,command);if(keepStack){this.stack.splice(start,howManyArgs)}else{this.stack.length=0}return false}};return Type1CharString}();var Type1Parser=function Type1ParserClosure(){var EEXEC_ENCRYPT_KEY=55665;var CHAR_STRS_ENCRYPT_KEY=4330;function isHexDigit(code){return code>=48&&code<=57||code>=65&&code<=70||code>=97&&code<=102}function decrypt(data,key,discardNumber){if(discardNumber>=data.length){return new Uint8Array(0)}var r=key|0,c1=52845,c2=22719,i,j;for(i=0;i>8;r=(value+r)*c1+c2&(1<<16)-1}return decrypted}function decryptAscii(data,key,discardNumber){var r=key|0,c1=52845,c2=22719;var count=data.length,maybeLength=count>>>1;var decrypted=new Uint8Array(maybeLength);var i,j;for(i=0,j=0;i>8;r=(value+r)*c1+c2&(1<<16)-1}}return Array.prototype.slice.call(decrypted,discardNumber,j)}function isSpecial(c){return c===47||c===91||c===93||c===123||c===125||c===40||c===41}function Type1Parser(stream,encrypted,seacAnalysisEnabled){if(encrypted){var data=stream.getBytes();var isBinary=!(isHexDigit(data[0])&&isHexDigit(data[1])&&isHexDigit(data[2])&&isHexDigit(data[3]));stream=new Stream(isBinary?decrypt(data,EEXEC_ENCRYPT_KEY,4):decryptAscii(data,EEXEC_ENCRYPT_KEY,4))}this.seacAnalysisEnabled=!!seacAnalysisEnabled;this.stream=stream;this.nextChar()}Type1Parser.prototype={readNumberArray:function Type1Parser_readNumberArray(){this.getToken();var array=[];while(true){var token=this.getToken();if(token===null||token==="]"||token==="}"){break}array.push(parseFloat(token||0))}return array},readNumber:function Type1Parser_readNumber(){var token=this.getToken();return parseFloat(token||0)},readInt:function Type1Parser_readInt(){var token=this.getToken();return parseInt(token||0,10)|0},readBoolean:function Type1Parser_readBoolean(){var token=this.getToken();return token==="true"?1:0},nextChar:function Type1_nextChar(){return this.currentChar=this.stream.getByte()},getToken:function Type1Parser_getToken(){var comment=false;var ch=this.currentChar;while(true){if(ch===-1){return null}if(comment){if(ch===10||ch===13){comment=false}}else if(ch===37){comment=true}else if(!isSpace(ch)){break}ch=this.nextChar()}if(isSpecial(ch)){this.nextChar();return String.fromCharCode(ch)}var token="";do{token+=String.fromCharCode(ch);ch=this.nextChar()}while(ch>=0&&!isSpace(ch)&&!isSpecial(ch));return token},extractFontProgram:function Type1Parser_extractFontProgram(){var stream=this.stream;var subrs=[],charstrings=[];var privateData=Object.create(null);privateData["lenIV"]=4;var program={subrs:[],charstrings:[],properties:{privateData:privateData}};var token,length,data,lenIV,encoded;while((token=this.getToken())!==null){if(token!=="/"){continue}token=this.getToken();switch(token){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();while(true){token=this.getToken();if(token===null||token==="end"){break}if(token!=="/"){continue}var glyph=this.getToken();length=this.readInt();this.getToken();data=stream.makeSubStream(stream.pos,length);lenIV=program.properties.privateData["lenIV"];encoded=decrypt(data.getBytes(),CHAR_STRS_ENCRYPT_KEY,lenIV);stream.skip(length);this.nextChar();token=this.getToken();if(token==="noaccess"){this.getToken()}charstrings.push({glyph:glyph,encoded:encoded})}break;case"Subrs":var num=this.readInt();this.getToken();while((token=this.getToken())==="dup"){var index=this.readInt();length=this.readInt();this.getToken();data=stream.makeSubStream(stream.pos,length);lenIV=program.properties.privateData["lenIV"];encoded=decrypt(data.getBytes(),CHAR_STRS_ENCRYPT_KEY,lenIV);stream.skip(length);this.nextChar();token=this.getToken();if(token==="noaccess"){this.getToken()}subrs[index]=encoded}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var blueArray=this.readNumberArray();if(blueArray.length>0&&blueArray.length%2===0&&HINTING_ENABLED){program.properties.privateData[token]=blueArray}break;case"StemSnapH":case"StemSnapV":program.properties.privateData[token]=this.readNumberArray();break;case"StdHW":case"StdVW":program.properties.privateData[token]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":program.properties.privateData[token]=this.readNumber();break;case"ForceBold":program.properties.privateData[token]=this.readBoolean();break}}for(var i=0;i>>0;var codespaceRange=codespaceRanges[n];for(var k=0,kk=codespaceRange.length;k=low&&c<=high){out.charcode=c;out.length=n+1;return}}}out.charcode=0;out.length=1},get length(){return this._map.length},get isIdentityCMap(){if(!(this.name==="Identity-H"||this.name==="Identity-V")){return false}if(this._map.length!==65536){return false}for(var i=0;i<65536;i++){if(this._map[i]!==i){return false}}return true}};return CMap}();var IdentityCMap=function IdentityCMapClosure(){function IdentityCMap(vertical,n){CMap.call(this);this.vertical=vertical;this.addCodespaceRange(n,0,65535)}Util.inherit(IdentityCMap,CMap,{});IdentityCMap.prototype={addCodespaceRange:CMap.prototype.addCodespaceRange,mapCidRange:function(low,high,dstLow){error("should not call mapCidRange")},mapBfRange:function(low,high,dstLow){error("should not call mapBfRange")},mapBfRangeToArray:function(low,high,array){error("should not call mapBfRangeToArray")},mapOne:function(src,dst){error("should not call mapCidOne")},lookup:function(code){return isInt(code)&&code<=65535?code:undefined},contains:function(code){return isInt(code)&&code<=65535},forEach:function(callback){for(var i=0;i<=65535;i++){callback(i,i)}},charCodeOf:function(value){return isInt(value)&&value<=65535?value:-1},getMap:function(){var map=new Array(65536);for(var i=0;i<=65535;i++){map[i]=i}return map},readCharCode:CMap.prototype.readCharCode,get length(){return 65536},get isIdentityCMap(){error("should not access .isIdentityCMap")}};return IdentityCMap}();var BinaryCMapReader=function BinaryCMapReaderClosure(){function fetchBinaryData(url){return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url,true);request.responseType="arraybuffer";request.onreadystatechange=function(){if(request.readyState===XMLHttpRequest.DONE){if(!request.response||request.status!==200&&request.status!==0){reject(new Error("Unable to get binary cMap at: "+url))}else{resolve(new Uint8Array(request.response))}}};request.send(null)})}function hexToInt(a,size){var n=0;for(var i=0;i<=size;i++){n=n<<8|a[i]}return n>>>0}function hexToStr(a,size){if(size===1){return String.fromCharCode(a[0],a[1])}if(size===3){return String.fromCharCode(a[0],a[1],a[2],a[3])}return String.fromCharCode.apply(null,a.subarray(0,size+1))}function addHex(a,b,size){var c=0;for(var i=size;i>=0;i--){c+=a[i]+b[i];a[i]=c&255;c>>=8}}function incHex(a,size){var c=1;for(var i=size;i>=0&&c>0;i--){c+=a[i];a[i]=c&255;c>>=8}}var MAX_NUM_SIZE=16;var MAX_ENCODED_NUM_SIZE=19;function BinaryCMapStream(data){this.buffer=data;this.pos=0;this.end=data.length;this.tmpBuf=new Uint8Array(MAX_ENCODED_NUM_SIZE)}BinaryCMapStream.prototype={readByte:function(){if(this.pos>=this.end){return-1}return this.buffer[this.pos++]},readNumber:function(){var n=0;var last;do{var b=this.readByte();if(b<0){error("unexpected EOF in bcmap")}last=!(b&128);n=n<<7|b&127}while(!last);return n},readSigned:function(){var n=this.readNumber();return n&1?~(n>>>1):n>>>1},readHex:function(num,size){num.set(this.buffer.subarray(this.pos,this.pos+size+1));this.pos+=size+1},readHexNumber:function(num,size){var last;var stack=this.tmpBuf,sp=0;do{var b=this.readByte();if(b<0){error("unexpected EOF in bcmap")}last=!(b&128);stack[sp++]=b&127}while(!last);var i=size,buffer=0,bufferSize=0;while(i>=0){while(bufferSize<8&&stack.length>0){buffer=stack[--sp]<>=8;bufferSize-=8}},readHexSigned:function(num,size){this.readHexNumber(num,size);var sign=num[size]&1?255:0;var c=0;for(var i=0;i<=size;i++){c=(c&1)<<8|num[i];num[i]=c>>1^sign}},readString:function(){var len=this.readNumber();var s="";for(var i=0;i=0){var type=b>>5;if(type===7){switch(b&31){case 0:stream.readString();break;case 1:useCMap=stream.readString();break}continue}var sequence=!!(b&16);var dataSize=b&15;assert(dataSize+1<=MAX_NUM_SIZE);var ucs2DataSize=1;var subitemsCount=stream.readNumber();var i;switch(type){case 0:stream.readHex(start,dataSize);stream.readHexNumber(end,dataSize);addHex(end,start,dataSize);cMap.addCodespaceRange(dataSize+1,hexToInt(start,dataSize),hexToInt(end,dataSize));for(i=1;i>>0}function expectString(obj){if(!isString(obj)){error("Malformed CMap: expected string.")}}function expectInt(obj){if(!isInt(obj)){error("Malformed CMap: expected int.")}}function parseBfChar(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endbfchar")){return}expectString(obj);var src=strToInt(obj);obj=lexer.getObj();expectString(obj);var dst=obj;cMap.mapOne(src,dst)}}function parseBfRange(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endbfrange")){return}expectString(obj);var low=strToInt(obj);obj=lexer.getObj();expectString(obj);var high=strToInt(obj);obj=lexer.getObj();if(isInt(obj)||isString(obj)){var dstLow=isInt(obj)?String.fromCharCode(obj):obj;cMap.mapBfRange(low,high,dstLow)}else if(isCmd(obj,"[")){obj=lexer.getObj();var array=[];while(!isCmd(obj,"]")&&!isEOF(obj)){array.push(obj);obj=lexer.getObj()}cMap.mapBfRangeToArray(low,high,array)}else{break}}error("Invalid bf range.")}function parseCidChar(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endcidchar")){return}expectString(obj);var src=strToInt(obj);obj=lexer.getObj();expectInt(obj);var dst=obj;cMap.mapOne(src,dst)}}function parseCidRange(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endcidrange")){return}expectString(obj);var low=strToInt(obj);obj=lexer.getObj();expectString(obj);var high=strToInt(obj);obj=lexer.getObj();expectInt(obj);var dstLow=obj;cMap.mapCidRange(low,high,dstLow)}}function parseCodespaceRange(cMap,lexer){while(true){var obj=lexer.getObj();if(isEOF(obj)){break}if(isCmd(obj,"endcodespacerange")){return}if(!isString(obj)){break}var low=strToInt(obj);obj=lexer.getObj();if(!isString(obj)){break}var high=strToInt(obj);cMap.addCodespaceRange(obj.length,low,high)}error("Invalid codespace range.")}function parseWMode(cMap,lexer){var obj=lexer.getObj();if(isInt(obj)){cMap.vertical=!!obj}}function parseCMapName(cMap,lexer){var obj=lexer.getObj();if(isName(obj)&&isString(obj.name)){cMap.name=obj.name}}function parseCMap(cMap,lexer,builtInCMapParams,useCMap){var previous;var embededUseCMap;objLoop:while(true){try{var obj=lexer.getObj();if(isEOF(obj)){break}else if(isName(obj)){if(obj.name==="WMode"){parseWMode(cMap,lexer)}else if(obj.name==="CMapName"){parseCMapName(cMap,lexer)}previous=obj}else if(isCmd(obj)){switch(obj.cmd){case"endcmap":break objLoop;case"usecmap":if(isName(previous)){embededUseCMap=previous.name}break;case"begincodespacerange":parseCodespaceRange(cMap,lexer);break;case"beginbfchar":parseBfChar(cMap,lexer);break;case"begincidchar":parseCidChar(cMap,lexer);break;case"beginbfrange":parseBfRange(cMap,lexer);break;case"begincidrange":parseCidRange(cMap,lexer);break}}}catch(ex){if(ex instanceof MissingDataException){throw ex}warn("Invalid cMap data: "+ex);continue}}if(!useCMap&&embededUseCMap){useCMap=embededUseCMap}if(useCMap){return extendCMap(cMap,builtInCMapParams,useCMap)}return Promise.resolve(cMap)}function extendCMap(cMap,builtInCMapParams,useCMap){return createBuiltInCMap(useCMap,builtInCMapParams).then(function(newCMap){cMap.useCMap=newCMap;if(cMap.numCodespaceRanges===0){var useCodespaceRanges=cMap.useCMap.codespaceRanges;for(var i=0;i=this.firstChar&&v<=this.lastChar?v:-1},amend:function(map){error("Should not call amend()")}};return IdentityToUnicodeMap}();var OpenTypeFileBuilder=function OpenTypeFileBuilderClosure(){function writeInt16(dest,offset,num){dest[offset]=num>>8&255;dest[offset+1]=num&255}function writeInt32(dest,offset,num){dest[offset]=num>>24&255;dest[offset+1]=num>>16&255;dest[offset+2]=num>>8&255;dest[offset+3]=num&255}function writeData(dest,offset,data){var i,ii;if(data instanceof Uint8Array){dest.set(data,offset)}else if(typeof data==="string"){for(i=0,ii=data.length;imaxPower2){maxPower2<<=1;log2++}var searchRange=maxPower2*entrySize;return{range:searchRange,entry:log2,rangeShift:entrySize*entriesCount-searchRange}};var OTF_HEADER_SIZE=12;var OTF_TABLE_ENTRY_SIZE=16;OpenTypeFileBuilder.prototype={toArray:function OpenTypeFileBuilder_toArray(){var sfnt=this.sfnt;var tables=this.tables;var tablesNames=Object.keys(tables);tablesNames.sort();var numTables=tablesNames.length;var i,j,jj,table,tableName;var offset=OTF_HEADER_SIZE+numTables*OTF_TABLE_ENTRY_SIZE;var tableOffsets=[offset];for(i=0;i>>0;offset+=paddedLength;tableOffsets.push(offset)}var file=new Uint8Array(offset);for(i=0;i>>0}writeInt32(file,offset+4,checksum);writeInt32(file,offset+8,tableOffsets[i]);writeInt32(file,offset+12,tables[tableName].length);offset+=OTF_TABLE_ENTRY_SIZE}return file},addTable:function OpenTypeFileBuilder_addTable(tag,data){if(tag in this.tables){throw new Error("Table "+tag+" already exists")}this.tables[tag]=data}};return OpenTypeFileBuilder}();var ProblematicCharRanges=new Int32Array([0,32,127,161,173,174,1536,1920,2208,4256,6016,6144,7168,7248,8192,8208,8209,8210,8232,8240,8287,8304,9676,9677,12288,12289,43616,43648,65520,65536]);var Font=function FontClosure(){function Font(name,file,properties){var charCode,glyphName,unicode;this.name=name;this.loadedName=properties.loadedName;this.isType3Font=properties.isType3Font;this.sizes=[];this.missingFile=false;this.glyphCache=Object.create(null);var names=name.split("+");names=names.length>1?names[1]:names[0];names=names.split(/[-,_]/g)[0];this.isSerifFont=!!(properties.flags&FontFlags.Serif);this.isSymbolicFont=!!(properties.flags&FontFlags.Symbolic);this.isMonospace=!!(properties.flags&FontFlags.FixedPitch);var type=properties.type;var subtype=properties.subtype;this.type=type;this.fallbackName=this.isMonospace?"monospace":this.isSerifFont?"serif":"sans-serif";this.differences=properties.differences;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.composite=properties.composite;this.wideChars=properties.wideChars;this.cMap=properties.cMap;this.ascent=properties.ascent/PDF_GLYPH_SPACE_UNITS;this.descent=properties.descent/PDF_GLYPH_SPACE_UNITS;this.fontMatrix=properties.fontMatrix;this.bbox=properties.bbox;this.toUnicode=properties.toUnicode;this.toFontChar=[];if(properties.type==="Type3"){for(charCode=0;charCode<256;charCode++){this.toFontChar[charCode]=this.differences[charCode]||properties.defaultEncoding[charCode]}this.fontType=FontType.TYPE3;return}this.cidEncoding=properties.cidEncoding;this.vertical=properties.vertical;if(this.vertical){this.vmetrics=properties.vmetrics;this.defaultVMetrics=properties.defaultVMetrics}var glyphsUnicodeMap;if(!file||file.isEmpty){if(file){warn('Font file is empty in "'+name+'" ('+this.loadedName+")")}this.missingFile=true;var fontName=name.replace(/[,_]/g,"-");var stdFontMap=getStdFontMap(),nonStdFontMap=getNonStdFontMap();var isStandardFont=!!stdFontMap[fontName]||!!(nonStdFontMap[fontName]&&stdFontMap[nonStdFontMap[fontName]]);fontName=stdFontMap[fontName]||nonStdFontMap[fontName]||fontName;this.bold=fontName.search(/bold/gi)!==-1;this.italic=fontName.search(/oblique/gi)!==-1||fontName.search(/italic/gi)!==-1;this.black=name.search(/Black/g)!==-1;this.remeasure=Object.keys(this.widths).length>0;if(isStandardFont&&type==="CIDFontType2"&&properties.cidEncoding.indexOf("Identity-")===0){var GlyphMapForStandardFonts=getGlyphMapForStandardFonts();var map=[];for(charCode in GlyphMapForStandardFonts){map[+charCode]=GlyphMapForStandardFonts[charCode]}if(/ArialBlack/i.test(name)){var SupplementalGlyphMapForArialBlack=getSupplementalGlyphMapForArialBlack();for(charCode in SupplementalGlyphMapForArialBlack){map[+charCode]=SupplementalGlyphMapForArialBlack[charCode]}}var isIdentityUnicode=this.toUnicode instanceof IdentityToUnicodeMap;if(!isIdentityUnicode){this.toUnicode.forEach(function(charCode,unicodeCharCode){map[+charCode]=unicodeCharCode})}this.toFontChar=map;this.toUnicode=new ToUnicodeMap(map)}else if(/Symbol/i.test(fontName)){this.toFontChar=buildToFontChar(SymbolSetEncoding,getGlyphsUnicode(),properties.differences)}else if(/Dingbats/i.test(fontName)){if(/Wingdings/i.test(name)){warn("Non-embedded Wingdings font, falling back to ZapfDingbats.")}this.toFontChar=buildToFontChar(ZapfDingbatsEncoding,getDingbatsGlyphsUnicode(),properties.differences)}else if(isStandardFont){this.toFontChar=buildToFontChar(properties.defaultEncoding,getGlyphsUnicode(),properties.differences)}else{glyphsUnicodeMap=getGlyphsUnicode();this.toUnicode.forEach(function(charCode,unicodeCharCode){if(!this.composite){glyphName=properties.differences[charCode]||properties.defaultEncoding[charCode];unicode=getUnicodeForGlyph(glyphName,glyphsUnicodeMap);if(unicode!==-1){unicodeCharCode=unicode}}this.toFontChar[charCode]=unicodeCharCode}.bind(this))}this.loadedName=fontName.split("-")[0];this.loading=false;this.fontType=getFontType(type,subtype);return}if(subtype==="Type1C"){if(type!=="Type1"&&type!=="MMType1"){if(isTrueTypeFile(file)){subtype="TrueType"}else{type="Type1"}}else if(isOpenTypeFile(file)){type=subtype="OpenType"}}if(subtype==="CIDFontType0C"&&type!=="CIDFontType0"){type="CIDFontType0"}if(subtype==="OpenType"){type="OpenType"}if(type==="CIDFontType0"){if(isType1File(file)){subtype="CIDFontType0"}else if(isOpenTypeFile(file)){type=subtype="OpenType"}else{subtype="CIDFontType0C"}}var data;switch(type){case"MMType1":info("MMType1 font ("+name+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var cff=subtype==="Type1C"||subtype==="CIDFontType0C"?new CFFFont(file,properties):new Type1Font(name,file,properties);adjustWidths(properties);data=this.convert(name,cff,properties);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";data=this.checkAndRepair(name,file,properties);if(this.isOpenType){adjustWidths(properties);type="OpenType"}break;default:error("Font "+type+" is not supported");break}this.data=data;this.fontType=getFontType(type,subtype);this.fontMatrix=properties.fontMatrix;this.widths=properties.widths;this.defaultWidth=properties.defaultWidth;this.toUnicode=properties.toUnicode;this.encoding=properties.baseEncoding;this.seacMap=properties.seacMap;this.loading=true}Font.getFontID=function(){var ID=1;return function Font_getFontID(){return String(ID++)}}();function int16(b0,b1){return(b0<<8)+b1}function signedInt16(b0,b1){var value=(b0<<8)+b1;return value&1<<15?value-65536:value}function int32(b0,b1,b2,b3){return(b0<<24)+(b1<<16)+(b2<<8)+b3}function string16(value){return String.fromCharCode(value>>8&255,value&255)}function safeString16(value){value=value>32767?32767:value<-32768?-32768:value;return String.fromCharCode(value>>8&255,value&255)}function isTrueTypeFile(file){var header=file.peekBytes(4);return readUint32(header,0)===65536}function isOpenTypeFile(file){var header=file.peekBytes(4);return bytesToString(header)==="OTTO"}function isType1File(file){var header=file.peekBytes(2);if(header[0]===37&&header[1]===33){return true}if(header[0]===128&&header[1]===1){return true}return false}function buildToFontChar(encoding,glyphsUnicodeMap,differences){var toFontChar=[],unicode;for(var i=0,ii=encoding.length;i>1;if(code=numGlyphs){continue}codes.push({fontCharCode:charCode|0,glyphId:glyphs[charCode]})}codes.sort(function fontGetRangesSort(a,b){return a.fontCharCode-b.fontCharCode});var ranges=[];var length=codes.length;for(var n=0;n65535?2:1;var cmap="\x00\x00"+string16(numTables)+"\x00"+"\x00"+string32(4+numTables*8);var i,ii,j,jj;for(i=ranges.length-1;i>=0;--i){if(ranges[i][0]<=65535){break}}var bmpLength=i+1;if(ranges[i][0]<65535&&ranges[i][1]===65535){ranges[i][1]=65534}var trailingRangesCount=ranges[i][1]<65535?1:0;var segCount=bmpLength+trailingRangesCount;var searchParams=OpenTypeFileBuilder.getSearchParams(segCount,2);var startCount="";var endCount="";var idDeltas="";var idRangeOffsets="";var glyphsIds="";var bias=0;var range,start,end,codes;for(i=0,ii=bmpLength;i0){endCount+="ÿÿ";startCount+="ÿÿ";idDeltas+="\x00";idRangeOffsets+="\x00\x00"}var format314="\x00\x00"+string16(2*segCount)+string16(searchParams.range)+string16(searchParams.entry)+string16(searchParams.rangeShift)+endCount+"\x00\x00"+startCount+idDeltas+idRangeOffsets+glyphsIds;var format31012="";var header31012="";if(numTables>1){cmap+="\x00"+"\x00\n"+string32(4+numTables*8+4+format314.length);format31012="";for(i=0,ii=ranges.length;ilastChar){return false}stream.getBytes(6);var usWinAscent=stream.getUint16();if(usWinAscent===0){return false}os2.data[8]=os2.data[9]=0;return true}function createOS2Table(properties,charstrings,override){override=override||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var ulUnicodeRange1=0;var ulUnicodeRange2=0;var ulUnicodeRange3=0;var ulUnicodeRange4=0;var firstCharIndex=null;var lastCharIndex=0;if(charstrings){for(var code in charstrings){code|=0;if(firstCharIndex>code||!firstCharIndex){firstCharIndex=code}if(lastCharIndex 123 are reserved for internal usage")}}}else{firstCharIndex=0;lastCharIndex=255}var bbox=properties.bbox||[0,0,0,0];var unitsPerEm=override.unitsPerEm||1/(properties.fontMatrix||FONT_IDENTITY_MATRIX)[0];var scale=properties.ascentScaled?1:unitsPerEm/PDF_GLYPH_SPACE_UNITS;var typoAscent=override.ascent||Math.round(scale*(properties.ascent||bbox[3]));var typoDescent=override.descent||Math.round(scale*(properties.descent||bbox[1]));if(typoDescent>0&&properties.descent>0&&bbox[1]<0){typoDescent=-typoDescent}var winAscent=override.yMax||typoAscent;var winDescent=-override.yMin||-typoDescent;return"\x00"+"$"+"ô"+"\x00"+"\x00\x00"+"Š"+"»"+"\x00\x00"+"\x00Œ"+"Š"+"»"+"\x00\x00"+"ß"+"\x001"+""+"\x00\x00"+"\x00\x00"+String.fromCharCode(properties.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+string32(ulUnicodeRange1)+string32(ulUnicodeRange2)+string32(ulUnicodeRange3)+string32(ulUnicodeRange4)+"*21*"+string16(properties.italicAngle?1:0)+string16(firstCharIndex||properties.firstChar)+string16(lastCharIndex||properties.lastChar)+string16(typoAscent)+string16(typoDescent)+"\x00d"+string16(winAscent)+string16(winDescent)+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"+string16(properties.xHeight)+string16(properties.capHeight)+string16(0)+string16(firstCharIndex||properties.firstChar)+"\x00"}function createPostTable(properties){var angle=Math.floor(properties.italicAngle*Math.pow(2,16));return"\x00\x00\x00"+string32(angle)+"\x00\x00"+"\x00\x00"+string32(properties.fixedPitch)+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"+"\x00\x00\x00\x00"}function createNameTable(name,proto){if(!proto){proto=[[],[]]}var strings=[proto[0][0]||"Original licence",proto[0][1]||name,proto[0][2]||"Unknown",proto[0][3]||"uniqueID",proto[0][4]||name,proto[0][5]||"Version 0.11",proto[0][6]||"",proto[0][7]||"Unknown",proto[0][8]||"Unknown",proto[0][9]||"Unknown"];var stringsUnicode=[];var i,ii,j,jj,str;for(i=0,ii=strings.length;i>>0;var offset=file.getInt32()>>>0;var length=file.getInt32()>>>0;var previousPosition=file.pos;file.pos=file.start?file.start:0;file.skip(offset);var data=file.getBytes(length);file.pos=previousPosition;if(tag==="head"){data[8]=data[9]=data[10]=data[11]=0;data[17]|=32}return{tag:tag,checksum:checksum,length:length,offset:offset,data:data}}function readOpenTypeHeader(ttf){return{version:bytesToString(ttf.getBytes(4)),numTables:ttf.getUint16(),searchRange:ttf.getUint16(),entrySelector:ttf.getUint16(),rangeShift:ttf.getUint16()}}function readCmapTable(cmap,font,isSymbolicFont,hasEncoding){if(!cmap){warn("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:false}}var segment;var start=(font.start?font.start:0)+cmap.offset;font.pos=start;var version=font.getUint16();var numTables=font.getUint16();var potentialTable;var canBreak=false;for(var i=0;i>>0;var useTable=false;if(platformId===0&&encodingId===0){useTable=true}else if(platformId===1&&encodingId===0){useTable=true}else if(platformId===3&&encodingId===1&&(!isSymbolicFont&&hasEncoding||!potentialTable)){useTable=true;if(!isSymbolicFont){canBreak=true}}else if(isSymbolicFont&&platformId===3&&encodingId===0){useTable=true;canBreak=true}if(useTable){potentialTable={platformId:platformId,encodingId:encodingId,offset:offset}}if(canBreak){break}}if(potentialTable){font.pos=start+potentialTable.offset}if(!potentialTable||font.peekByte()===-1){warn("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:false}}var format=font.getUint16();var length=font.getUint16();var language=font.getUint16();var hasShortCmap=false;var mappings=[];var j,glyphId;if(format===0){for(j=0;j<256;j++){var index=font.getByte();if(!index){continue}mappings.push({charCode:j,glyphId:index})}hasShortCmap=true}else if(format===4){var segCount=font.getUint16()>>1;font.getBytes(6);var segIndex,segments=[];for(segIndex=0;segIndex>1)-(segCount-segIndex);segment.offsetIndex=offsetIndex;offsetsCount=Math.max(offsetsCount,offsetIndex+segment.end-segment.start+1)}var offsets=[];for(j=0;jnumGlyphs){info("The numOfMetrics ("+numOfMetrics+") should not be "+"greater than the numGlyphs ("+numGlyphs+")");numOfMetrics=numGlyphs;header.data[34]=(numOfMetrics&65280)>>8;header.data[35]=numOfMetrics&255}var numOfSidebearings=numGlyphs-numOfMetrics;var numMissing=numOfSidebearings-(metrics.length-numOfMetrics*4>>1);if(numMissing>0){var entries=new Uint8Array(metrics.length+numMissing*2);entries.set(metrics.data);metrics.data=entries}}function sanitizeGlyph(source,sourceStart,sourceEnd,dest,destStart,hintsValid){if(sourceEnd-sourceStart<=12){return 0}var glyf=source.subarray(sourceStart,sourceEnd);var contoursCount=glyf[0]<<8|glyf[1];if(contoursCount&32768){dest.set(glyf,destStart);return glyf.length}var i,j=10,flagsCount=0;for(i=0;iglyf.length){return 0}if(!hintsValid&&instructionsLength>0){dest.set(glyf.subarray(0,instructionsStart),destStart);dest.set([0,0],destStart+instructionsStart);dest.set(glyf.subarray(instructionsEnd,glyphDataLength),destStart+instructionsStart+2);glyphDataLength-=instructionsLength;if(glyf.length-glyphDataLength>3){glyphDataLength=glyphDataLength+3&~3}return glyphDataLength}if(glyf.length-glyphDataLength>3){glyphDataLength=glyphDataLength+3&~3;dest.set(glyf.subarray(0,glyphDataLength),destStart);return glyphDataLength}dest.set(glyf,destStart);return glyf.length}function sanitizeHead(head,numGlyphs,locaLength){var data=head.data;var version=int32(data[0],data[1],data[2],data[3]);if(version>>16!==1){info("Attempting to fix invalid version in head table: "+version);data[0]=0;data[1]=1;data[2]=0;data[3]=0}var indexToLocFormat=int16(data[50],data[51]);if(indexToLocFormat<0||indexToLocFormat>1){info("Attempting to fix invalid indexToLocFormat in head table: "+indexToLocFormat);var numGlyphsPlusOne=numGlyphs+1;if(locaLength===numGlyphsPlusOne<<1){data[50]=0;data[51]=0}else if(locaLength===numGlyphsPlusOne<<2){data[50]=0;data[51]=1}else{warn("Could not fix indexToLocFormat: "+indexToLocFormat)}}}function sanitizeGlyphLocations(loca,glyf,numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry){var itemSize,itemDecode,itemEncode;if(isGlyphLocationsLong){itemSize=4;itemDecode=function fontItemDecodeLong(data,offset){return data[offset]<<24|data[offset+1]<<16|data[offset+2]<<8|data[offset+3]};itemEncode=function fontItemEncodeLong(data,offset,value){data[offset]=value>>>24&255;data[offset+1]=value>>16&255;data[offset+2]=value>>8&255;data[offset+3]=value&255}}else{itemSize=2;itemDecode=function fontItemDecode(data,offset){return data[offset]<<9|data[offset+1]<<1};itemEncode=function fontItemEncode(data,offset,value){data[offset]=value>>9&255;data[offset+1]=value>>1&255}}var locaData=loca.data;var locaDataSize=itemSize*(1+numGlyphs);if(locaData.length!==locaDataSize){locaData=new Uint8Array(locaDataSize);locaData.set(loca.data.subarray(0,locaDataSize));loca.data=locaData}var oldGlyfData=glyf.data;var oldGlyfDataLength=oldGlyfData.length;var newGlyfData=new Uint8Array(oldGlyfDataLength);var startOffset=itemDecode(locaData,0);var writeOffset=0;var missingGlyphData=Object.create(null);itemEncode(locaData,0,writeOffset);var i,j;for(i=0,j=itemSize;ioldGlyfDataLength&&(oldGlyfDataLength+3&~3)===endOffset){endOffset=oldGlyfDataLength}if(endOffset>oldGlyfDataLength){itemEncode(locaData,j,writeOffset);startOffset=endOffset;continue}if(startOffset===endOffset){missingGlyphData[i]=true}var newLength=sanitizeGlyph(oldGlyfData,startOffset,endOffset,newGlyfData,writeOffset,hintsValid);writeOffset+=newLength;itemEncode(locaData,j,writeOffset);startOffset=endOffset}if(writeOffset===0){var simpleGlyph=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(i=0,j=itemSize;ifirstEntryLength+writeOffset){glyf.data=newGlyfData.subarray(0,firstEntryLength+writeOffset)}else{glyf.data=new Uint8Array(firstEntryLength+writeOffset);glyf.data.set(newGlyfData.subarray(0,writeOffset))}glyf.data.set(newGlyfData.subarray(0,firstEntryLength),writeOffset);itemEncode(loca.data,locaData.length-itemSize,writeOffset+firstEntryLength)}else{glyf.data=newGlyfData.subarray(0,writeOffset)}return missingGlyphData}function readPostScriptTable(post,properties,maxpNumGlyphs){var start=(font.start?font.start:0)+post.offset;font.pos=start;var length=post.length,end=start+length;var version=font.getInt32();font.getBytes(28);var glyphNames;var valid=true;var i;switch(version){case 65536:glyphNames=MacStandardGlyphOrdering;break;case 131072:var numGlyphs=font.getUint16();if(numGlyphs!==maxpNumGlyphs){valid=false;break}var glyphNameIndexes=[];for(i=0;i=32768){valid=false;break}glyphNameIndexes.push(index)}if(!valid){break}var customNames=[];var strBuf=[];while(font.posend){continue}font.pos=pos;var nameIndex=record.name;if(record.encoding){var str="";for(var j=0,jj=record.length;j0){i+=offset-1}}}if(!inFDEF&&!inELSE){var stackDelta=op<=142?TTOpsStackDeltas[op]:op>=192&&op<=223?-1:op>=224?-2:0;if(op>=113&&op<=117){n=stack.pop();if(n===n){stackDelta=-n*2}}while(stackDelta<0&&stack.length>0){stack.pop();stackDelta++}while(stackDelta>0){stack.push(NaN);stackDelta--}}}ttContext.tooComplexToFollowFunctions=tooComplexToFollowFunctions;var content=[data];if(i>data.length){content.push(new Uint8Array(i-data.length))}if(lastDeff>lastEndf){warn("TT: complementing a missing function tail");content.push(new Uint8Array([34,45]))}foldTTTable(table,content)}function checkInvalidFunctions(ttContext,maxFunctionDefs){if(ttContext.tooComplexToFollowFunctions){return}if(ttContext.functionsDefined.length>maxFunctionDefs){warn("TT: more functions defined than expected");ttContext.hintsValid=false;return}for(var j=0,jj=ttContext.functionsUsed.length;jmaxFunctionDefs){warn("TT: invalid function id: "+j);ttContext.hintsValid=false;return}if(ttContext.functionsUsed[j]&&!ttContext.functionsDefined[j]){warn("TT: undefined function: "+j);ttContext.hintsValid=false;return}}}function foldTTTable(table,content){if(content.length>1){var newLength=0;var j,jj;for(j=0,jj=content.length;j=65536&&tables["maxp"].length>=22){font.pos+=8;var maxZones=font.getUint16();if(maxZones>2){tables["maxp"].data[14]=0;tables["maxp"].data[15]=2}font.pos+=4;maxFunctionDefs=font.getUint16()}var dupFirstEntry=false;if(properties.type==="CIDFontType2"&&properties.toUnicode&&properties.toUnicode.get(0)>"\x00"){dupFirstEntry=true;numGlyphs++;tables["maxp"].data[4]=numGlyphs>>8;tables["maxp"].data[5]=numGlyphs&255}var hintsValid=sanitizeTTPrograms(tables["fpgm"],tables["prep"],tables["cvt "],maxFunctionDefs);if(!hintsValid){delete tables["fpgm"];delete tables["prep"];delete tables["cvt "]}sanitizeMetrics(font,tables["hhea"],tables["hmtx"],numGlyphs);if(!tables["head"]){error('Required "head" table is not found')}sanitizeHead(tables["head"],numGlyphs,isTrueType?tables["loca"].length:0);var missingGlyphs=Object.create(null);if(isTrueType){var isGlyphLocationsLong=int16(tables["head"].data[50],tables["head"].data[51]);missingGlyphs=sanitizeGlyphLocations(tables["loca"],tables["glyf"],numGlyphs,isGlyphLocationsLong,hintsValid,dupFirstEntry)}if(!tables["hhea"]){error('Required "hhea" table is not found')}if(tables["hhea"].data[10]===0&&tables["hhea"].data[11]===0){tables["hhea"].data[10]=255;tables["hhea"].data[11]=255}var metricsOverride={unitsPerEm:int16(tables["head"].data[18],tables["head"].data[19]),yMax:int16(tables["head"].data[42],tables["head"].data[43]),yMin:signedInt16(tables["head"].data[38],tables["head"].data[39]),ascent:int16(tables["hhea"].data[4],tables["hhea"].data[5]),descent:signedInt16(tables["hhea"].data[6],tables["hhea"].data[7])};this.ascent=metricsOverride.ascent/metricsOverride.unitsPerEm;this.descent=metricsOverride.descent/metricsOverride.unitsPerEm;if(tables["post"]){var valid=readPostScriptTable(tables["post"],properties,numGlyphs);if(!valid){tables["post"]=null}}var charCodeToGlyphId=[],charCode;var toUnicode=properties.toUnicode,widths=properties.widths;var skipToUnicode=toUnicode instanceof IdentityToUnicodeMap||toUnicode.length===65536;function hasGlyph(glyphId,charCode,widthCode){if(!missingGlyphs[glyphId]){return true}if(!skipToUnicode&&charCode>=0&&toUnicode.has(charCode)){return true}if(widths&&widthCode>=0&&isNum(widths[widthCode])){return true}return false}if(properties.type==="CIDFontType2"){var cidToGidMap=properties.cidToGidMap||[];var isCidToGidMapEmpty=cidToGidMap.length===0;properties.cMap.forEach(function(charCode,cid){assert(cid<=65535,"Max size of CID is 65,535");var glyphId=-1;if(isCidToGidMapEmpty){glyphId=cid}else if(cidToGidMap[cid]!==undefined){glyphId=cidToGidMap[cid]}if(glyphId>=0&&glyphId0&&hasGlyph(glyphId,-1,-1)){charCodeToGlyphId[charCode]=glyphId;found=true}}if(!found){charCodeToGlyphId[charCode]=0}}}else if(cmapPlatformId===0&&cmapEncodingId===0){for(i=0;i=0){charCodeToGlyphId[charCode]=glyphId}else{charCodeToGlyphId[charCode]=0}}}else if(!!(properties.flags&FontFlags.Symbolic)){for(charCode in builtInEncoding){charCodeToGlyphId[charCode]=builtInEncoding[charCode]}}else{baseEncoding=StandardEncoding;for(charCode=0;charCode=0){charCodeToGlyphId[charCode]=glyphId}else{charCodeToGlyphId[charCode]=0}}}var differences=properties.differences,glyphsUnicodeMap;if(differences){for(charCode in differences){var glyphName=differences[charCode];glyphId=glyphNames.indexOf(glyphName);if(glyphId===-1){if(!glyphsUnicodeMap){glyphsUnicodeMap=getGlyphsUnicode()}var standardGlyphName=recoverGlyphName(glyphName,glyphsUnicodeMap);if(standardGlyphName!==glyphName){glyphId=glyphNames.indexOf(standardGlyphName)}}if(glyphId>=0){charCodeToGlyphId[charCode]=glyphId}else{charCodeToGlyphId[charCode]=0}}}return charCodeToGlyphId}var Type1Font=function Type1FontClosure(){function findBlock(streamBytes,signature,startIndex){var streamBytesLength=streamBytes.length;var signatureLength=signature.length;var scanLength=streamBytesLength-signatureLength;var i=startIndex,j,found=false;while(i=signatureLength){i+=j;while(i=0){builtInEncoding[charCode]=glyphId}}}return type1FontGlyphMapping(properties,builtInEncoding,glyphNames)},getSeacs:function Type1Font_getSeacs(charstrings){var i,ii;var seacMap=[];for(i=0,ii=charstrings.length;i>8&255,index&255)}cff.charset=new CFFCharset(false,0,[],charsetArray);var charStringsIndex=new CFFIndex;charStringsIndex.add([139,14]);for(i=0;i0;j--){value[j]-=value[j-1]}}privateDict.setByName(field,value)}cff.topDict.privateDict=privateDict;var subrIndex=new CFFIndex;for(i=0,ii=subrs.length;i=0&&(ch>=65&&ch<=90||ch>=97&&ch<=122)){strBuf.push(String.fromCharCode(ch))}var str=strBuf.join("");switch(str.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(str)}},getNumber:function PostScriptLexer_getNumber(){var ch=this.currentChar;var strBuf=this.strBuf;strBuf.length=0;strBuf[0]=String.fromCharCode(ch);while((ch=this.nextChar())>=0){if(ch>=48&&ch<=57||ch===45||ch===46){strBuf.push(String.fromCharCode(ch))}else{break}}var value=parseFloat(strBuf.join(""));if(isNaN(value)){error("Invalid floating point number: "+value)}return value}};return PostScriptLexer}();exports.PostScriptLexer=PostScriptLexer;exports.PostScriptParser=PostScriptParser});(function(root,factory){{factory(root.pdfjsCoreFunction={},root.pdfjsSharedUtil,root.pdfjsCorePrimitives,root.pdfjsCorePsParser)}})(this,function(exports,sharedUtil,corePrimitives,corePsParser){var error=sharedUtil.error;var info=sharedUtil.info;var isArray=sharedUtil.isArray;var isBool=sharedUtil.isBool;var isDict=corePrimitives.isDict;var isStream=corePrimitives.isStream;var PostScriptLexer=corePsParser.PostScriptLexer;var PostScriptParser=corePsParser.PostScriptParser;var PDFFunction=function PDFFunctionClosure(){var CONSTRUCT_SAMPLED=0;var CONSTRUCT_INTERPOLATED=2;var CONSTRUCT_STICHED=3;var CONSTRUCT_POSTSCRIPT=4;return{getSampleArray:function PDFFunction_getSampleArray(size,outputSize,bps,str){var i,ii;var length=1;for(i=0,ii=size.length;i>codeSize)*sampleMul;codeBuf&=(1<max){v=max}else if(v0){dmin=bounds[i-1]}var dmax=domain[1];if(i>1;var numInputs=domain.length>>1;var evaluator=new PostScriptEvaluator(code);var cache=Object.create(null);var MAX_CACHE_SIZE=2048*4;var cache_available=MAX_CACHE_SIZE;var tmpBuf=new Float32Array(numInputs);return function constructPostScriptFromIRResult(src,srcOffset,dest,destOffset){var i,value;var key="";var input=tmpBuf;for(i=0;ibound){value=bound}}output[i]=value}if(cache_available>0){cache_available--;cache[key]=output}dest.set(output,destOffset)}}}}();function isPDFFunction(v){var fnDict;if(typeof v!=="object"){return false}else if(isDict(v)){fnDict=v}else if(isStream(v)){fnDict=v.dict}else{return false}return fnDict.has("FunctionType")}var PostScriptStack=function PostScriptStackClosure(){var MAX_STACK_SIZE=100;function PostScriptStack(initialStack){this.stack=!initialStack?[]:Array.prototype.slice.call(initialStack,0)}PostScriptStack.prototype={push:function PostScriptStack_push(value){if(this.stack.length>=MAX_STACK_SIZE){error("PostScript function stack overflow.")}this.stack.push(value)},pop:function PostScriptStack_pop(){if(this.stack.length<=0){error("PostScript function stack underflow.")}return this.stack.pop()},copy:function PostScriptStack_copy(n){if(this.stack.length+n>=MAX_STACK_SIZE){error("PostScript function stack overflow.")}var stack=this.stack;for(var i=stack.length-n,j=n-1;j>=0;j--,i++){stack.push(stack[i])}},index:function PostScriptStack_index(n){this.push(this.stack[this.stack.length-n-1])},roll:function PostScriptStack_roll(n,p){var stack=this.stack;var l=stack.length-n;var r=stack.length-1,c=l+(p-Math.floor(p/n)*n),i,j,t;for(i=l,j=r;i0){stack.push(a<>b)}break;case"ceiling":a=stack.pop();stack.push(Math.ceil(a));break;case"copy":a=stack.pop();stack.copy(a);break;case"cos":a=stack.pop();stack.push(Math.cos(a));break;case"cvi":a=stack.pop()|0;stack.push(a);break;case"cvr":break;case"div":b=stack.pop();a=stack.pop();stack.push(a/b);break;case"dup":stack.copy(1);break;case"eq":b=stack.pop();a=stack.pop();stack.push(a===b);break;case"exch":stack.roll(2,1);break;case"exp":b=stack.pop();a=stack.pop();stack.push(Math.pow(a,b));break;case"false":stack.push(false);break;case"floor":a=stack.pop();stack.push(Math.floor(a));break;case"ge":b=stack.pop();a=stack.pop();stack.push(a>=b);break;case"gt":b=stack.pop();a=stack.pop();stack.push(a>b);break;case"idiv":b=stack.pop();a=stack.pop();stack.push(a/b|0);break;case"index":a=stack.pop();stack.index(a);break;case"le":b=stack.pop();a=stack.pop();stack.push(a<=b);break;case"ln":a=stack.pop();stack.push(Math.log(a));break;case"log":a=stack.pop();stack.push(Math.log(a)/Math.LN10);break;case"lt":b=stack.pop();a=stack.pop();stack.push(a=max){return new AstLiteral(max)}else if(num1.max<=max){return num1}return new AstMin(num1,max)}function PostScriptCompiler(){}PostScriptCompiler.prototype={compile:function PostScriptCompiler_compile(code,domain,range){var stack=[];var i,ii;var instructions=[];var inputSize=domain.length>>1,outputSize=range.length>>1;var lastRegister=0;var n,j;var num1,num2,ast1,ast2,tmpVar,item;for(i=0;iexpr.min){out.unshift("Math.max(",min,", ");out.push(")")}if(maxnumComponentColors&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){var allColors=bpc<=8?new Uint8Array(numComponentColors):new Uint16Array(numComponentColors);var key;for(i=0;i255?255:c;dest[destOffset]=dest[destOffset+1]=dest[destOffset+2]=c},getRgbBuffer:function DeviceGrayCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var scale=255/((1<255?255:r;dest[destOffset+1]=g<0?0:g>255?255:g;dest[destOffset+2]=b<0?0:b>255?255:b},getRgbBuffer:function DeviceRgbCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){if(bits===8&&alpha01===0){dest.set(src.subarray(srcOffset,srcOffset+count*3),destOffset);return}var scale=255/((1<255?255:r<0?0:r;dest[destOffset+1]=g>255?255:g<0?0:g;dest[destOffset+2]=b>255?255:b<0?0:b}function DeviceCmykCS(){this.name="DeviceCMYK";this.numComps=4;this.defaultColor=new Float32Array([0,0,0,1])}DeviceCmykCS.prototype={getRgb:ColorSpace.prototype.getRgb,getRgbItem:function DeviceCmykCS_getRgbItem(src,srcOffset,dest,destOffset){convertToRgb(src,srcOffset,1,dest,destOffset)},getRgbBuffer:function DeviceCmykCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var scale=1/((1<8){return Math.pow((L+16)/116,3)}return L*DECODE_L_CONSTANT}function compensateBlackPoint(sourceBlackPoint,XYZ_Flat,result){if(sourceBlackPoint[0]===0&&sourceBlackPoint[1]===0&&sourceBlackPoint[2]===0){result[0]=XYZ_Flat[0];result[1]=XYZ_Flat[1];result[2]=XYZ_Flat[2];return}var zeroDecodeL=decodeL(0);var X_DST=zeroDecodeL;var X_SRC=decodeL(sourceBlackPoint[0]);var Y_DST=zeroDecodeL;var Y_SRC=decodeL(sourceBlackPoint[1]);var Z_DST=zeroDecodeL;var Z_SRC=decodeL(sourceBlackPoint[2]);var X_Scale=(1-X_DST)/(1-X_SRC);var X_Offset=1-X_Scale;var Y_Scale=(1-Y_DST)/(1-Y_SRC);var Y_Offset=1-Y_Scale;var Z_Scale=(1-Z_DST)/(1-Z_SRC);var Z_Offset=1-Z_Scale;result[0]=XYZ_Flat[0]*X_Scale+X_Offset;result[1]=XYZ_Flat[1]*Y_Scale+Y_Offset;result[2]=XYZ_Flat[2]*Z_Scale+Z_Offset}function normalizeWhitePointToFlat(sourceWhitePoint,XYZ_In,result){if(sourceWhitePoint[0]===1&&sourceWhitePoint[2]===1){result[0]=XYZ_In[0];result[1]=XYZ_In[1];result[2]=XYZ_In[2];return}var LMS=result;matrixProduct(BRADFORD_SCALE_MATRIX,XYZ_In,LMS);var LMS_Flat=tempNormalizeMatrix;convertToFlat(sourceWhitePoint,LMS,LMS_Flat);matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX,LMS_Flat,result)}function normalizeWhitePointToD65(sourceWhitePoint,XYZ_In,result){var LMS=result;matrixProduct(BRADFORD_SCALE_MATRIX,XYZ_In,LMS);var LMS_D65=tempNormalizeMatrix;convertToD65(sourceWhitePoint,LMS,LMS_D65);matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX,LMS_D65,result)}function convertToRgb(cs,src,srcOffset,dest,destOffset,scale){var A=adjustToRange(0,1,src[srcOffset]*scale);var B=adjustToRange(0,1,src[srcOffset+1]*scale);var C=adjustToRange(0,1,src[srcOffset+2]*scale);var AGR=Math.pow(A,cs.GR);var BGG=Math.pow(B,cs.GG);var CGB=Math.pow(C,cs.GB);var X=cs.MXA*AGR+cs.MXB*BGG+cs.MXC*CGB;var Y=cs.MYA*AGR+cs.MYB*BGG+cs.MYC*CGB;var Z=cs.MZA*AGR+cs.MZB*BGG+cs.MZC*CGB;var XYZ=tempConvertMatrix1;XYZ[0]=X;XYZ[1]=Y;XYZ[2]=Z;var XYZ_Flat=tempConvertMatrix2;normalizeWhitePointToFlat(cs.whitePoint,XYZ,XYZ_Flat);var XYZ_Black=tempConvertMatrix1;compensateBlackPoint(cs.blackPoint,XYZ_Flat,XYZ_Black);var XYZ_D65=tempConvertMatrix2;normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX,XYZ_Black,XYZ_D65);var SRGB=tempConvertMatrix1;matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX,XYZ_D65,SRGB);var sR=sRGBTransferFunction(SRGB[0]);var sG=sRGBTransferFunction(SRGB[1]);var sB=sRGBTransferFunction(SRGB[2]);dest[destOffset]=Math.round(sR*255);dest[destOffset+1]=Math.round(sG*255);dest[destOffset+2]=Math.round(sB*255)}CalRGBCS.prototype={getRgb:function CalRGBCS_getRgb(src,srcOffset){var rgb=new Uint8Array(3);this.getRgbItem(src,srcOffset,rgb,0);return rgb},getRgbItem:function CalRGBCS_getRgbItem(src,srcOffset,dest,destOffset){convertToRgb(this,src,srcOffset,dest,destOffset,1)},getRgbBuffer:function CalRGBCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var scale=1/((1<this.amax||this.bmin>this.bmax){info("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}function fn_g(x){if(x>=6/29){return x*x*x}else{return 108/841*(x-4/29)}}function decode(value,high1,low2,high2){return low2+value*(high2-low2)/high1}function convertToRgb(cs,src,srcOffset,maxVal,dest,destOffset){var Ls=src[srcOffset];var as=src[srcOffset+1];var bs=src[srcOffset+2];if(maxVal!==false){Ls=decode(Ls,maxVal,0,100);as=decode(as,maxVal,cs.amin,cs.amax);bs=decode(bs,maxVal,cs.bmin,cs.bmax)}as=as>cs.amax?cs.amax:ascs.bmax?cs.bmax:bs=1?255:Math.sqrt(r)*255|0;dest[destOffset+1]=g<=0?0:g>=1?255:Math.sqrt(g)*255|0;dest[destOffset+2]=b<=0?0:b>=1?255:Math.sqrt(b)*255|0}LabCS.prototype={getRgb:ColorSpace.prototype.getRgb,getRgbItem:function LabCS_getRgbItem(src,srcOffset,dest,destOffset){convertToRgb(this,src,srcOffset,false,dest,destOffset)},getRgbBuffer:function LabCS_getRgbBuffer(src,srcOffset,count,dest,destOffset,bits,alpha01){var maxVal=(1<max?max:value}function resizeImageMask(src,bpc,w1,h1,w2,h2){var length=w2*h2;var dest=bpc<=8?new Uint8Array(length):bpc<=16?new Uint16Array(length):new Uint32Array(length);var xRatio=w1/w2;var yRatio=h1/h2;var i,j,py,newIndex=0,oldIndex;var xScaled=new Uint16Array(w2);var w1Scanline=w1;for(i=0;i>3)*height;var actualLength=imgArray.byteLength;var haveFullData=computedLength===actualLength;var data,i;if(imageIsFromDecodeStream&&(!inverseDecode||haveFullData)){data=imgArray}else if(!inverseDecode){data=new Uint8Array(actualLength);data.set(imgArray)}else{data=new Uint8Array(computedLength);data.set(imgArray);for(i=actualLength;i>7&1;output[i+1]=buf>>6&1;output[i+2]=buf>>5&1;output[i+3]=buf>>4&1;output[i+4]=buf>>3&1;output[i+5]=buf>>2&1;output[i+6]=buf>>1&1;output[i+7]=buf&1;i+=8}if(i>=1}}}}else{var bits=0;buf=0;for(i=0,ii=length;i>remainingBits;output[i]=value<0?0:value>max?max:value;buf=buf&(1<mask[maskOffset+1]){opacity=255;break}}alphaBuf[i]=opacity}}else{error("Unknown mask format.")}}if(alphaBuf){for(i=0,j=3,ii=width*actualHeight;i=255?255:r|0;buffer[i+1]=g<=0?0:g>=255?255:g|0;buffer[i+2]=b<=0?0:b>=255?255:b|0}},createImageData:function PDFImage_createImageData(forceRGBA){var drawWidth=this.drawWidth;var drawHeight=this.drawHeight;var imgData={width:drawWidth,height:drawHeight};var numComps=this.numComps;var originalWidth=this.width;var originalHeight=this.height;var bpc=this.bpc;var rowBytes=originalWidth*numComps*bpc+7>>3;var imgArray;if(!forceRGBA){var kind;if(this.colorSpace.name==="DeviceGray"&&bpc===1){kind=ImageKind.GRAYSCALE_1BPP}else if(this.colorSpace.name==="DeviceRGB"&&bpc===8&&!this.needsDecode){kind=ImageKind.RGB_24BPP}if(kind&&!this.smask&&!this.mask&&drawWidth===originalWidth&&drawHeight===originalHeight){imgData.kind=kind;imgArray=this.getImageBytes(originalHeight*rowBytes);if(this.image instanceof DecodeStream){imgData.data=imgArray}else{var newArray=new Uint8Array(imgArray.length);newArray.set(imgArray);imgData.data=newArray}if(this.needsDecode){assert(kind===ImageKind.GRAYSCALE_1BPP);var buffer=imgData.data;for(var i=0,ii=buffer.length;i>3;var imgArray=this.getImageBytes(height*rowBytes);var comps=this.getComponents(imgArray);var i,length;if(bpc===1){length=width*height;if(this.needsDecode){for(i=0;i0){var i=queue.shift();var outlineDict=xref.fetchIfRef(i.obj);if(outlineDict===null){continue}assert(outlineDict.has("Title"),"Invalid outline item");var actionDict=outlineDict.get("A"),dest=null,url=null;if(actionDict){var destEntry=actionDict.get("D");if(destEntry){dest=destEntry}else{var uriEntry=actionDict.get("URI");if(isString(uriEntry)&&isValidUrl(uriEntry,false)){url=uriEntry}}}else if(outlineDict.has("Dest")){dest=outlineDict.getRaw("Dest");if(isName(dest)){dest=dest.name}}var title=outlineDict.get("Title");var flags=outlineDict.get("F")||0;var color=outlineDict.getArray("C"),rgbColor=blackColor;if(isArray(color)&&color.length===3&&(color[0]!==0||color[1]!==0||color[2]!==0)){rgbColor=ColorSpace.singletons.rgb.getRgb(color,0)}var outlineItem={dest:dest,url:url,title:stringToPDFString(title),color:rgbColor,count:outlineDict.get("Count"),bold:!!(flags&2),italic:!!(flags&1),items:[]};i.parent.items.push(outlineItem);obj=outlineDict.getRaw("First");if(isRef(obj)&&!processed.has(obj)){queue.push({obj:obj,parent:outlineItem});processed.put(obj)}obj=outlineDict.getRaw("Next");if(isRef(obj)&&!processed.has(obj)){queue.push({obj:obj,parent:i.parent});processed.put(obj)}}return root.items.length>0?root.items:null},get numPages(){var obj=this.toplevelPagesDict.get("Count");assert(isInt(obj),"page count in top level pages object is not an integer");return shadow(this,"num",obj)},get destinations(){function fetchDestination(dest){return isDict(dest)?dest.get("D"):dest}var xref=this.xref;var dests={},nameTreeRef,nameDictionaryRef;var obj=this.catDict.get("Names");if(obj&&obj.has("Dests")){nameTreeRef=obj.getRaw("Dests")}else if(this.catDict.has("Dests")){nameDictionaryRef=this.catDict.get("Dests")}if(nameDictionaryRef){obj=nameDictionaryRef;obj.forEach(function catalogForEach(key,value){if(!value){return}dests[key]=fetchDestination(value)})}if(nameTreeRef){var nameTree=new NameTree(nameTreeRef,xref);var names=nameTree.getAll();for(var name in names){dests[name]=fetchDestination(names[name])}}return shadow(this,"destinations",dests)},getDestination:function Catalog_getDestination(destinationId){function fetchDestination(dest){return isDict(dest)?dest.get("D"):dest}var xref=this.xref;var dest=null,nameTreeRef,nameDictionaryRef;var obj=this.catDict.get("Names");if(obj&&obj.has("Dests")){nameTreeRef=obj.getRaw("Dests")}else if(this.catDict.has("Dests")){nameDictionaryRef=this.catDict.get("Dests")}if(nameDictionaryRef){var value=nameDictionaryRef.get(destinationId);if(value){dest=fetchDestination(value)}}if(nameTreeRef){var nameTree=new NameTree(nameTreeRef,xref);dest=fetchDestination(nameTree.get(destinationId))}return dest},get pageLabels(){var obj=null;try{obj=this.readPageLabels()}catch(ex){if(ex instanceof MissingDataException){throw ex}warn("Unable to read page labels.")}return shadow(this,"pageLabels",obj)},readPageLabels:function Catalog_readPageLabels(){var obj=this.catDict.getRaw("PageLabels");if(!obj){return null}var pageLabels=new Array(this.numPages);var style=null;var prefix="";var start=1;var numberTree=new NumberTree(obj,this.xref);var nums=numberTree.getAll();var currentLabel="",currentIndex=1;for(var i=0,ii=this.numPages;i=0;last--){nodesToVisit.push(kids[last])}}}capability.reject("Page index "+pageIndex+" not found.")}next();return capability.promise},getPageIndex:function Catalog_getPageIndex(pageRef){var xref=this.xref;function pagesBeforeRef(kidRef){var total=0;var parentRef;return xref.fetchAsync(kidRef).then(function(node){if(isRefsEqual(kidRef,pageRef)&&!isDict(node,"Page")&&!(isDict(node)&&!node.has("Type")&&node.has("Contents"))){throw new Error("The reference does not point to a /Page Dict.")}if(!node){return null}assert(isDict(node),"node must be a Dict.");parentRef=node.getRaw("Parent");return node.getAsync("Parent")}).then(function(parent){if(!parent){return null}assert(isDict(parent),"parent must be a Dict.");return parent.getAsync("Kids")}).then(function(kids){if(!kids){return null}var kidPromises=[];var found=false;for(var i=0;i0){var first=entryRanges[0];var n=entryRanges[1];if(!isInt(first)||!isInt(n)){error("Invalid XRef range fields: "+first+", "+n)}if(!isInt(typeFieldWidth)||!isInt(offsetFieldWidth)||!isInt(generationFieldWidth)){error("Invalid XRef entry fields length: "+first+", "+n)}for(i=streamState.entryNum;i=data.length){break}token+=String.fromCharCode(ch);ch=data[offset]}return token}function skipUntil(data,offset,what){var length=what.length,dataLength=data.length;var skipped=0;while(offset=length){break}offset++;skipped++}return skipped}var objRegExp=/^(\d+)\s+(\d+)\s+obj\b/;var trailerBytes=new Uint8Array([116,114,97,105,108,101,114]);var startxrefBytes=new Uint8Array([115,116,97,114,116,120,114,101,102]);var endobjBytes=new Uint8Array([101,110,100,111,98,106]);var xrefBytes=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var stream=this.stream;stream.pos=0;var buffer=stream.getBytes();var position=stream.start,length=buffer.length;var trailers=[],xrefStms=[];while(position=length){break}ch=buffer[position]}while(ch!==LF&&ch!==CR);continue}var token=readToken(buffer,position);var m;if(token.indexOf("xref")===0&&(token.length===4||/\s/.test(token[4]))){position+=skipUntil(buffer,position,trailerBytes);trailers.push(position); position+=skipUntil(buffer,position,startxrefBytes)}else if(m=objRegExp.exec(token)){if(typeof this.entries[m[1]]==="undefined"){this.entries[m[1]]={offset:position-stream.start,gen:m[2]|0,uncompressed:true}}var contentLength=skipUntil(buffer,position,endobjBytes)+7;var content=buffer.subarray(position,position+contentLength);var xrefTagOffset=skipUntil(content,0,xrefBytes);if(xrefTagOffset0){var i,n;var obj=xref.fetchIfRef(queue.shift());if(!isDict(obj)){continue}if(obj.has("Kids")){var kids=obj.get("Kids");for(i=0,n=kids.length;iMAX_LEVELS){warn('Search depth limit reached for "'+this._type+'" tree.');return null}var kids=kidsOrEntries.get("Kids");if(!isArray(kids)){return null}l=0;r=kids.length-1;while(l<=r){m=l+r>>1;var kid=xref.fetchIfRef(kids[m]);var limits=kid.get("Limits");if(keyxref.fetchIfRef(limits[1])){l=m+1}else{kidsOrEntries=xref.fetchIfRef(kids[m]);break}}if(l>r){return null}}var entries=kidsOrEntries.get(this._type);if(isArray(entries)){l=0;r=entries.length-2;while(l<=r){m=l+r&~1;var currentKey=xref.fetchIfRef(entries[m]);if(keycurrentKey){l=m+2}else{return xref.fetchIfRef(entries[m+1])}}}return null}};return NameOrNumberTree}();var NameTree=function NameTreeClosure(){function NameTree(root,xref){this.root=root;this.xref=xref;this._type="Names"}Util.inherit(NameTree,NameOrNumberTree,{});return NameTree}();var NumberTree=function NumberTreeClosure(){function NumberTree(root,xref){this.root=root;this.xref=xref;this._type="Nums"}Util.inherit(NumberTree,NameOrNumberTree,{});return NumberTree}();var FileSpec=function FileSpecClosure(){function FileSpec(root,xref){if(!root||!isDict(root)){return}this.xref=xref;this.root=root;if(root.has("FS")){this.fs=root.get("FS")}this.description=root.has("Desc")?stringToPDFString(root.get("Desc")):"";if(root.has("RF")){warn("Related file specifications are not supported")}this.contentAvailable=true;if(!root.has("EF")){this.contentAvailable=false;warn("Non-embedded file specifications are not supported")}}function pickPlatformItem(dict){if(dict.has("UF")){return dict.get("UF")}else if(dict.has("F")){return dict.get("F")}else if(dict.has("Unix")){return dict.get("Unix")}else if(dict.has("Mac")){return dict.get("Mac")}else if(dict.has("DOS")){return dict.get("DOS")}else{return null}}FileSpec.prototype={get filename(){if(!this._filename&&this.root){var filename=pickPlatformItem(this.root)||"unnamed";this._filename=stringToPDFString(filename).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename},get content(){if(!this.contentAvailable){return null}if(!this.contentRef&&this.root){this.contentRef=pickPlatformItem(this.root.get("EF"))}var content=null;if(this.contentRef){var xref=this.xref;var fileObj=xref.fetchIfRef(this.contentRef);if(fileObj&&isStream(fileObj)){content=fileObj.getBytes()}else{warn("Embedded file specification points to non-existing/invalid "+"content")}}else{warn("Embedded file specification does not have a content")}return content},get serializable(){return{filename:this.filename,content:this.content}}};return FileSpec}();var ObjectLoader=function(){function mayHaveChildren(value){return isRef(value)||isDict(value)||isArray(value)||isStream(value)}function addChildren(node,nodesToVisit){var value;if(isDict(node)||isStream(node)){var map;if(isDict(node)){map=node.map}else{map=node.dict.map}for(var key in map){value=map[key];if(mayHaveChildren(value)){nodesToVisit.push(value)}}}else if(isArray(node)){for(var i=0,ii=node.length;i=t1||step<=0){info("Bad shading domain.");return}var color=new Float32Array(cs.numComps),ratio=new Float32Array(1);var rgbColor;for(var i=t0;i<=t1;i+=step){ratio[0]=i;fn(ratio,0,color,0);rgbColor=cs.getRgb(color,0);var cssColor=Util.makeCssRgb(rgbColor[0],rgbColor[1],rgbColor[2]);colorStops.push([(i-t0)/diff,cssColor])}var background="transparent";if(dict.has("Background")){rgbColor=cs.getRgb(dict.get("Background"),0);background=Util.makeCssRgb(rgbColor[0],rgbColor[1],rgbColor[2])}if(!extendStart){colorStops.unshift([0,background]);colorStops[1][0]+=Shadings.SMALL_NUMBER}if(!extendEnd){colorStops[colorStops.length-1][0]-=Shadings.SMALL_NUMBER;colorStops.push([1,background])}this.colorStops=colorStops}RadialAxial.prototype={getIR:function RadialAxial_getIR(){var coordsArr=this.coordsArr;var shadingType=this.shadingType;var type,p0,p1,r0,r1;if(shadingType===ShadingType.AXIAL){p0=[coordsArr[0],coordsArr[1]];p1=[coordsArr[2],coordsArr[3]];r0=null;r1=null;type="axial"}else if(shadingType===ShadingType.RADIAL){p0=[coordsArr[0],coordsArr[1]];p1=[coordsArr[3],coordsArr[4]];r0=coordsArr[2];r1=coordsArr[5];type="radial"}else{error("getPattern type unknown: "+shadingType)}var matrix=this.matrix;if(matrix){p0=Util.applyTransform(p0,matrix);p1=Util.applyTransform(p1,matrix);if(shadingType===ShadingType.RADIAL){var scale=Util.singularValueDecompose2dScale(matrix);r0*=scale[0];r1*=scale[1]}}return["RadialAxial",type,this.colorStops,p0,p1,r0,r1]}};return RadialAxial}();Shadings.Mesh=function MeshClosure(){function MeshStreamReader(stream,context){this.stream=stream;this.context=context;this.buffer=0;this.bufferLength=0;var numComps=context.numComps;this.tmpCompsBuf=new Float32Array(numComps);var csNumComps=context.colorSpace.numComps;this.tmpCsCompsBuf=context.colorFn?new Float32Array(csNumComps):this.tmpCompsBuf}MeshStreamReader.prototype={get hasData(){if(this.stream.end){return this.stream.pos0){return true}var nextByte=this.stream.getByte();if(nextByte<0){return false}this.buffer=nextByte;this.bufferLength=8;return true},readBits:function MeshStreamReader_readBits(n){var buffer=this.buffer;var bufferLength=this.bufferLength;if(n===32){if(bufferLength===0){return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0}buffer=buffer<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();var nextByte=this.stream.getByte();this.buffer=nextByte&(1<>bufferLength)>>>0}if(n===8&&bufferLength===0){return this.stream.getByte()}while(bufferLength>bufferLength},align:function MeshStreamReader_align(){this.buffer=0;this.bufferLength=0},readFlag:function MeshStreamReader_readFlag(){return this.readBits(this.context.bitsPerFlag)},readCoordinate:function MeshStreamReader_readCoordinate(){var bitsPerCoordinate=this.context.bitsPerCoordinate;var xi=this.readBits(bitsPerCoordinate);var yi=this.readBits(bitsPerCoordinate);var decode=this.context.decode;var scale=bitsPerCoordinate<32?1/((1<x?x:minX;minY=minY>y?y:minY;maxX=maxX=2,"Invalid VerticesPerRow");decodeType5Shading(this,reader,verticesPerRow);break;case ShadingType.COONS_PATCH_MESH:decodeType6Shading(this,reader);patchMesh=true;break;case ShadingType.TENSOR_PATCH_MESH:decodeType7Shading(this,reader);patchMesh=true;break;default:error("Unsupported mesh type.");break}if(patchMesh){updateBounds(this);for(var i=0,ii=this.figures.length;imaxImageSize){warn("Image exceeded maximum allowed size and was removed.");return}var imageMask=dict.get("ImageMask","IM")||false;var imgData,args;if(imageMask){var width=dict.get("Width","W");var height=dict.get("Height","H");var bitStrideLength=width+7>>3;var imgArray=image.getBytes(bitStrideLength*height);var decode=dict.getArray("Decode","D");var inverseDecode=!!decode&&decode[0]>0;imgData=PDFImage.createMask(imgArray,width,height,image instanceof DecodeStream,inverseDecode);imgData.cached=true;args=[imgData];operatorList.addOp(OPS.paintImageMaskXObject,args);if(cacheKey){imageCache[cacheKey]={fn:OPS.paintImageMaskXObject,args:args}}return}var softMask=dict.get("SMask","SM")||false;var mask=dict.get("Mask")||false;var SMALL_IMAGE_DIMENSIONS=200;if(inline&&!softMask&&!mask&&!(image instanceof JpegStream)&&w+h0){operatorList.addOp(OPS.setGState,[gStateObj])}})},loadFont:function PartialEvaluator_loadFont(fontName,font,xref,resources){function errorFont(){return Promise.resolve(new TranslatedFont("g_font_error",new ErrorFont("Font "+fontName+" is not available"),font))}var fontRef;if(font){assert(isRef(font));fontRef=font}else{var fontRes=resources.get("Font");if(fontRes){fontRef=fontRes.getRaw(fontName)}else{warn("fontRes not available");return errorFont()}}if(!fontRef){warn("fontRef not available");return errorFont()}if(this.fontCache.has(fontRef)){return this.fontCache.get(fontRef)}font=xref.fetchIfRef(fontRef);if(!isDict(font)){return errorFont()}if(font.translated){return font.translated}var fontCapability=createPromiseCapability();var preEvaluatedFont=this.preEvaluateFont(font,xref);var descriptor=preEvaluatedFont.descriptor;var fontRefIsRef=isRef(fontRef),fontID;if(fontRefIsRef){fontID=fontRef.toString()}if(isDict(descriptor)){if(!descriptor.fontAliases){descriptor.fontAliases=Object.create(null)}var fontAliases=descriptor.fontAliases;var hash=preEvaluatedFont.hash;if(fontAliases[hash]){var aliasFontRef=fontAliases[hash].aliasRef;if(fontRefIsRef&&aliasFontRef&&this.fontCache.has(aliasFontRef)){this.fontCache.putAlias(fontRef,aliasFontRef);return this.fontCache.get(fontRef)}}else{fontAliases[hash]={fontID:Font.getFontID()}}if(fontRefIsRef){fontAliases[hash].aliasRef=fontRef}fontID=fontAliases[hash].fontID}if(fontRefIsRef){this.fontCache.put(fontRef,fontCapability.promise)}else{if(!fontID){fontID=(this.uniquePrefix||"F_")+ ++this.idCounters.obj}this.fontCache.put("id_"+fontID,fontCapability.promise)}assert(fontID,'The "fontID" must be defined.');font.loadedName="g_"+this.pdfManager.docId+"_f"+fontID;font.translated=fontCapability.promise;var translatedPromise;try{translatedPromise=this.translateFont(preEvaluatedFont,xref)}catch(e){translatedPromise=Promise.reject(e)}var self=this;translatedPromise.then(function(translatedFont){if(translatedFont.fontType!==undefined){var xrefFontStats=xref.stats.fontTypes;xrefFontStats[translatedFont.fontType]=true}fontCapability.resolve(new TranslatedFont(font.loadedName,translatedFont,font))},function(reason){self.handler.send("UnsupportedFeature",{featureId:UNSUPPORTED_FEATURES.font});try{var descriptor=preEvaluatedFont.descriptor;var fontFile3=descriptor&&descriptor.get("FontFile3");var subtype=fontFile3&&fontFile3.get("Subtype");var fontType=getFontType(preEvaluatedFont.type,subtype&&subtype.name);var xrefFontStats=xref.stats.fontTypes;xrefFontStats[fontType]=true}catch(ex){}fontCapability.resolve(new TranslatedFont(font.loadedName,new ErrorFont(reason instanceof Error?reason.message:reason),font))});return fontCapability.promise},buildPath:function PartialEvaluator_buildPath(operatorList,fn,args){var lastIndex=operatorList.length-1;if(!args){args=[]}if(lastIndex<0||operatorList.fnArray[lastIndex]!==OPS.constructPath){operatorList.addOp(OPS.constructPath,[[fn],args])}else{var opArgs=operatorList.argsArray[lastIndex];opArgs[0].push(fn);Array.prototype.push.apply(opArgs[1],args)}},handleColorN:function PartialEvaluator_handleColorN(operatorList,fn,args,cs,patterns,resources,task,xref){var patternName=args[args.length-1];var pattern;if(isName(patternName)&&(pattern=patterns.get(patternName.name))){var dict=isStream(pattern)?pattern.dict:pattern;var typeNum=dict.get("PatternType");if(typeNum===TILING_PATTERN){var color=cs.base?cs.base.getRgb(args,0):null;return this.handleTilingType(fn,color,resources,pattern,dict,operatorList,task)}else if(typeNum===SHADING_PATTERN){var shading=dict.get("Shading");var matrix=dict.getArray("Matrix");pattern=Pattern.parseShading(shading,matrix,xref,resources,this.handler);operatorList.addOp(fn,pattern.getIR());return Promise.resolve()}else{return Promise.reject("Unknown PatternType: "+typeNum)}}operatorList.addOp(fn,args);return Promise.resolve()},getOperatorList:function PartialEvaluator_getOperatorList(stream,task,resources,operatorList,initialState){var self=this;var xref=this.xref;var imageCache=Object.create(null);assert(operatorList);resources=resources||Dict.empty;var xobjs=resources.get("XObject")||Dict.empty;var patterns=resources.get("Pattern")||Dict.empty;var stateManager=new StateManager(initialState||new EvalState);var preprocessor=new EvaluatorPreprocessor(stream,xref,stateManager);var timeSlotManager=new TimeSlotManager;return new Promise(function promiseBody(resolve,reject){var next=function(promise){promise.then(function(){try{promiseBody(resolve,reject)}catch(ex){reject(ex)}},reject)};task.ensureNotTerminated();timeSlotManager.reset();var stop,operation={},i,ii,cs;while(!(stop=timeSlotManager.check())){operation.args=null;if(!preprocessor.read(operation)){break}var args=operation.args;var fn=operation.fn;switch(fn|0){case OPS.paintXObject:if(args[0].code){break}var name=args[0].name;if(!name){warn("XObject must be referred to by name.");continue}if(imageCache[name]!==undefined){operatorList.addOp(imageCache[name].fn,imageCache[name].args);args=null;continue}var xobj=xobjs.get(name);if(xobj){assert(isStream(xobj),"XObject should be a stream");var type=xobj.dict.get("Subtype");assert(isName(type),"XObject should have a Name subtype");if(type.name==="Form"){stateManager.save();next(self.buildFormXObject(resources,xobj,null,operatorList,task,stateManager.state.clone()).then(function(){stateManager.restore()}));return}else if(type.name==="Image"){self.buildPaintImageXObject(resources,xobj,false,operatorList,name,imageCache);args=null;continue}else if(type.name==="PS"){info("Ignored XObject subtype PS");continue}else{error("Unhandled XObject subtype "+type.name)}}break;case OPS.setFont:var fontSize=args[1];next(self.handleSetFont(resources,args,null,operatorList,task,stateManager.state).then(function(loadedName){operatorList.addDependency(loadedName);operatorList.addOp(OPS.setFont,[loadedName,fontSize])}));return;case OPS.endInlineImage:var cacheKey=args[0].cacheKey;if(cacheKey){var cacheEntry=imageCache[cacheKey];if(cacheEntry!==undefined){operatorList.addOp(cacheEntry.fn,cacheEntry.args);args=null;continue}}self.buildPaintImageXObject(resources,args[0],true,operatorList,cacheKey,imageCache);args=null;continue;case OPS.showText:args[0]=self.handleText(args[0],stateManager.state);break;case OPS.showSpacedText:var arr=args[0];var combinedGlyphs=[];var arrLength=arr.length;var state=stateManager.state;for(i=0;i0){glyphHeight=glyphHeight*textState.fontMatrix[3];tsm[3]*=glyphHeight}}var trm=Util.transform(textState.ctm,Util.transform(textState.textMatrix,tsm));textContentItem.transform=trm;if(!font.vertical){textContentItem.width=0;textContentItem.height=Math.sqrt(trm[2]*trm[2]+trm[3]*trm[3]);textContentItem.vertical=false}else{textContentItem.width=Math.sqrt(trm[0]*trm[0]+trm[1]*trm[1]);textContentItem.height=0;textContentItem.vertical=true}var a=textState.textLineMatrix[0];var b=textState.textLineMatrix[1];var scaleLineX=Math.sqrt(a*a+b*b);a=textState.ctm[0];b=textState.ctm[1];var scaleCtmX=Math.sqrt(a*a+b*b);textContentItem.textAdvanceScale=scaleCtmX*scaleLineX;textContentItem.lastAdvanceWidth=0;textContentItem.lastAdvanceHeight=0;var spaceWidth=font.spaceWidth/1e3*textState.fontSize;if(spaceWidth){textContentItem.spaceWidth=spaceWidth;textContentItem.fakeSpaceMin=spaceWidth*SPACE_FACTOR;textContentItem.fakeMultiSpaceMin=spaceWidth*MULTI_SPACE_FACTOR;textContentItem.fakeMultiSpaceMax=spaceWidth*MULTI_SPACE_FACTOR_MAX;textContentItem.textRunBreakAllowed=!font.isMonospace}else{textContentItem.spaceWidth=0;textContentItem.fakeSpaceMin=Infinity;textContentItem.fakeMultiSpaceMin=Infinity;textContentItem.fakeMultiSpaceMax=0;textContentItem.textRunBreakAllowed=false}textContentItem.initialized=true;return textContentItem}function replaceWhitespace(str){var i=0,ii=str.length,code;while(i=32&&code<=127){i++}return i0){addFakeSpaces(wordSpacing,textChunk.str)}}var tx=0;var ty=0;if(!font.vertical){var w0=glyphWidth*textState.fontMatrix[0];tx=(w0*textState.fontSize+charSpacing)*textState.textHScale;width+=tx}else{var w1=glyphWidth*textState.fontMatrix[0];ty=w1*textState.fontSize+charSpacing;height+=ty}textState.translateTextMatrix(tx,ty);textChunk.str.push(glyphUnicode)}if(!font.vertical){textChunk.lastAdvanceWidth=width;textChunk.width+=width*textChunk.textAdvanceScale}else{textChunk.lastAdvanceHeight=height;textChunk.height+=Math.abs(height*textChunk.textAdvanceScale)}return textChunk}function addFakeSpaces(width,strBuf){if(width0){strBuf.push(" ")}}function flushTextContentItem(){if(!textContentItem.initialized){return}textContent.items.push(runBidiTransform(textContentItem));textContentItem.initialized=false;textContentItem.str.length=0}var timeSlotManager=new TimeSlotManager;return new Promise(function promiseBody(resolve,reject){var next=function(promise){promise.then(function(){try{promiseBody(resolve,reject)}catch(ex){reject(ex)}},reject)};task.ensureNotTerminated();timeSlotManager.reset();var stop,operation={},args=[];while(!(stop=timeSlotManager.check())){args.length=0;operation.args=args;if(!preprocessor.read(operation)){break}textState=stateManager.state;var fn=operation.fn;args=operation.args;var advance,diff;switch(fn|0){case OPS.setFont:var fontNameArg=args[0].name,fontSizeArg=args[1];if(textState.font&&fontNameArg===textState.fontName&&fontSizeArg===textState.fontSize){break}flushTextContentItem();textState.fontName=fontNameArg;textState.fontSize=fontSizeArg;next(handleSetFont(fontNameArg,null));return;case OPS.setTextRise:flushTextContentItem();textState.textRise=args[0];break;case OPS.setHScale:flushTextContentItem();textState.textHScale=args[0]/100;break;case OPS.setLeading:flushTextContentItem();textState.leading=args[0];break;case OPS.moveText:var isSameTextLine=!textState.font?false:(textState.font.vertical?args[0]:args[1])===0;advance=args[0]-args[1];if(combineTextItems&&isSameTextLine&&textContentItem.initialized&&advance>0&&advance<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(args[0],args[1]);textContentItem.width+=args[0]-textContentItem.lastAdvanceWidth;textContentItem.height+=args[1]-textContentItem.lastAdvanceHeight;diff=args[0]-textContentItem.lastAdvanceWidth-(args[1]-textContentItem.lastAdvanceHeight);addFakeSpaces(diff,textContentItem.str);break}flushTextContentItem();textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case OPS.setLeadingMoveText:flushTextContentItem();textState.leading=-args[1];textState.translateTextLineMatrix(args[0],args[1]);textState.textMatrix=textState.textLineMatrix.slice();break;case OPS.nextLine:flushTextContentItem();textState.carriageReturn();break;case OPS.setTextMatrix:advance=textState.calcTextLineMatrixAdvance(args[0],args[1],args[2],args[3],args[4],args[5]);if(combineTextItems&&advance!==null&&textContentItem.initialized&&advance.value>0&&advance.value<=textContentItem.fakeMultiSpaceMax){textState.translateTextLineMatrix(advance.width,advance.height);textContentItem.width+=advance.width-textContentItem.lastAdvanceWidth;textContentItem.height+=advance.height-textContentItem.lastAdvanceHeight;diff=advance.width-textContentItem.lastAdvanceWidth-(advance.height-textContentItem.lastAdvanceHeight);addFakeSpaces(diff,textContentItem.str);break}flushTextContentItem();textState.setTextMatrix(args[0],args[1],args[2],args[3],args[4],args[5]);textState.setTextLineMatrix(args[0],args[1],args[2],args[3],args[4],args[5]);break;case OPS.setCharSpacing:textState.charSpacing=args[0];break;case OPS.setWordSpacing:textState.wordSpacing=args[0];break;case OPS.beginText:flushTextContentItem();textState.textMatrix=IDENTITY_MATRIX.slice();textState.textLineMatrix=IDENTITY_MATRIX.slice();break;case OPS.showSpacedText:var items=args[0];var offset;for(var j=0,jj=items.length;jtextContentItem.fakeMultiSpaceMax;if(!breakTextRun){textContentItem.height+=offset}}else{advance=-advance;offset=advance*(textState.textHScale*textState.textMatrix[0]+textState.textMatrix[1]);textState.translateTextMatrix(advance,0);breakTextRun=textContentItem.textRunBreakAllowed&&advance>textContentItem.fakeMultiSpaceMax;if(!breakTextRun){textContentItem.width+=offset}}if(breakTextRun){flushTextContentItem()}else if(advance>0){addFakeSpaces(advance,textContentItem.str)}}}break;case OPS.showText:buildTextContentItem(args[0]);break;case OPS.nextLineShowText:flushTextContentItem();textState.carriageReturn();buildTextContentItem(args[0]);break;case OPS.nextLineSetSpacingShowText:flushTextContentItem();textState.wordSpacing=args[0];textState.charSpacing=args[1];textState.carriageReturn();buildTextContentItem(args[2]);break;case OPS.paintXObject:flushTextContentItem(); if(args[0].code){break}if(!xobjs){xobjs=resources.get("XObject")||Dict.empty}var name=args[0].name;if(xobjsCache.key===name){if(xobjsCache.texts){Util.appendToArray(textContent.items,xobjsCache.texts.items);Util.extendObj(textContent.styles,xobjsCache.texts.styles)}break}var xobj=xobjs.get(name);if(!xobj){break}assert(isStream(xobj),"XObject should be a stream");var type=xobj.dict.get("Subtype");assert(isName(type),"XObject should have a Name subtype");if("Form"!==type.name){xobjsCache.key=name;xobjsCache.texts=null;break}stateManager.save();var matrix=xobj.dict.getArray("Matrix");if(isArray(matrix)&&matrix.length===6){stateManager.transform(matrix)}next(self.getTextContent(xobj,task,xobj.dict.get("Resources")||resources,stateManager,normalizeWhitespace,combineTextItems).then(function(formTextContent){Util.appendToArray(textContent.items,formTextContent.items);Util.extendObj(textContent.styles,formTextContent.styles);stateManager.restore();xobjsCache.key=name;xobjsCache.texts=formTextContent}));return;case OPS.setGState:flushTextContentItem();var dictName=args[0];var extGState=resources.get("ExtGState");if(!isDict(extGState)||!isName(dictName)){break}var gState=extGState.get(dictName.name);if(!isDict(gState)){break}var gStateFont=gState.get("Font");if(gStateFont){textState.fontName=null;textState.fontSize=gStateFont[1];next(handleSetFont(null,gStateFont[0]));return}break}}if(stop){next(deferred);return}flushTextContentItem();resolve(textContent)})},extractDataStructures:function PartialEvaluator_extractDataStructures(dict,baseDict,xref,properties){var toUnicode=dict.get("ToUnicode")||baseDict.get("ToUnicode");var toUnicodePromise=toUnicode?this.readToUnicode(toUnicode):Promise.resolve(undefined);if(properties.composite){var cidSystemInfo=dict.get("CIDSystemInfo");if(isDict(cidSystemInfo)){properties.cidSystemInfo={registry:cidSystemInfo.get("Registry"),ordering:cidSystemInfo.get("Ordering"),supplement:cidSystemInfo.get("Supplement")}}var cidToGidMap=dict.get("CIDToGIDMap");if(isStream(cidToGidMap)){properties.cidToGidMap=this.readCidToGidMap(cidToGidMap)}}var differences=[];var baseEncodingName=null;var encoding;if(dict.has("Encoding")){encoding=dict.get("Encoding");if(isDict(encoding)){baseEncodingName=encoding.get("BaseEncoding");baseEncodingName=isName(baseEncodingName)?baseEncodingName.name:null;if(encoding.has("Differences")){var diffEncoding=encoding.get("Differences");var index=0;for(var j=0,jj=diffEncoding.length;j0;properties.dict=dict;return toUnicodePromise.then(function(toUnicode){properties.toUnicode=toUnicode;return this.buildToUnicode(properties)}.bind(this)).then(function(toUnicode){properties.toUnicode=toUnicode;return properties})},buildToUnicode:function PartialEvaluator_buildToUnicode(properties){properties.hasIncludedToUnicodeMap=!!properties.toUnicode&&properties.toUnicode.length>0;if(properties.hasIncludedToUnicodeMap){return Promise.resolve(properties.toUnicode)}var toUnicode,charcode,glyphName;if(!properties.composite){toUnicode=[];var encoding=properties.defaultEncoding.slice();var baseEncodingName=properties.baseEncodingName;var differences=properties.differences;for(charcode in differences){glyphName=differences[charcode];if(glyphName===".notdef"){continue}encoding[charcode]=glyphName}var glyphsUnicodeMap=getGlyphsUnicode();for(charcode in encoding){glyphName=encoding[charcode];if(glyphName===""){continue}else if(glyphsUnicodeMap[glyphName]===undefined){var code=0;switch(glyphName[0]){case"G":if(glyphName.length===3){code=parseInt(glyphName.substr(1),16)}break;case"g":if(glyphName.length===5){code=parseInt(glyphName.substr(1),16)}break;case"C":case"c":if(glyphName.length>=3){code=+glyphName.substr(1)}break;default:var unicode=getUnicodeForGlyph(glyphName,glyphsUnicodeMap);if(unicode!==-1){code=unicode}}if(code){if(baseEncodingName&&code===+charcode){var baseEncoding=getEncoding(baseEncodingName);if(baseEncoding&&(glyphName=baseEncoding[charcode])){toUnicode[charcode]=String.fromCharCode(glyphsUnicodeMap[glyphName]);continue}}toUnicode[charcode]=String.fromCharCode(code)}continue}toUnicode[charcode]=String.fromCharCode(glyphsUnicodeMap[glyphName])}return Promise.resolve(new ToUnicodeMap(toUnicode))}if(properties.composite&&(properties.cMap.builtInCMap&&!(properties.cMap instanceof IdentityCMap)||properties.cidSystemInfo.registry==="Adobe"&&(properties.cidSystemInfo.ordering==="GB1"||properties.cidSystemInfo.ordering==="CNS1"||properties.cidSystemInfo.ordering==="Japan1"||properties.cidSystemInfo.ordering==="Korea1"))){var registry=properties.cidSystemInfo.registry;var ordering=properties.cidSystemInfo.ordering;var ucs2CMapName=Name.get(registry+"-"+ordering+"-UCS2");return CMapFactory.create(ucs2CMapName,this.options.cMapOptions,null).then(function(ucs2CMap){var cMap=properties.cMap;toUnicode=[];cMap.forEach(function(charcode,cid){assert(cid<=65535,"Max size of CID is 65,535");var ucs2=ucs2CMap.lookup(cid);if(ucs2){toUnicode[charcode]=String.fromCharCode((ucs2.charCodeAt(0)<<8)+ucs2.charCodeAt(1))}});return new ToUnicodeMap(toUnicode)})}return Promise.resolve(new IdentityToUnicodeMap(properties.firstChar,properties.lastChar))},readToUnicode:function PartialEvaluator_readToUnicode(toUnicode){var cmapObj=toUnicode;if(isName(cmapObj)){return CMapFactory.create(cmapObj,this.options.cMapOptions,null).then(function(cmap){if(cmap instanceof IdentityCMap){return new IdentityToUnicodeMap(0,65535)}return new ToUnicodeMap(cmap.getMap())})}else if(isStream(cmapObj)){return CMapFactory.create(cmapObj,this.options.cMapOptions,null).then(function(cmap){if(cmap instanceof IdentityCMap){return new IdentityToUnicodeMap(0,65535)}var map=new Array(cmap.length);cmap.forEach(function(charCode,token){var str=[];for(var k=0;k>1;result[code]=glyphID}return result},extractWidths:function PartialEvaluator_extractWidths(dict,xref,descriptor,properties){var glyphsWidths=[];var defaultWidth=0;var glyphsVMetrics=[];var defaultVMetrics;var i,ii,j,jj,start,code,widths;if(properties.composite){defaultWidth=dict.get("DW")||1e3;widths=dict.get("W");if(widths){for(i=0,ii=widths.length;i=CHUNK_SIZE){this.flush()}else if(this.fnArray.length>=CHUNK_SIZE_ABOUT&&(fn===OPS.restore||fn===OPS.endText)){this.flush()}}},addDependency:function(dependency){if(dependency in this.dependencies){return}this.dependencies[dependency]=true;this.addOp(OPS.dependency,[dependency])},addDependencies:function(dependencies){for(var key in dependencies){this.addDependency(key)}},addOpList:function(opList){Util.extendObj(this.dependencies,opList.dependencies);for(var i=0,ii=opList.length;inumArgs){nonProcessedArgs.push(args.shift());argsLength--}while(argsLengthnumArgs){info("Command "+fn+": expected [0,"+numArgs+"] args, but received "+argsLength+" args")}this.preprocessCommand(fn,args);operation.fn=fn;operation.args=args;return true}else{if(isEOF(obj)){return false}if(obj!==null){if(!args){args=[]}args.push(obj);assert(args.length<=33,"Too many arguments")}}}},preprocessCommand:function EvaluatorPreprocessor_preprocessCommand(fn,args){switch(fn|0){case OPS.save:this.stateManager.save();break;case OPS.restore:this.stateManager.restore();break;case OPS.transform:this.stateManager.transform(args);break}}};return EvaluatorPreprocessor}();var QueueOptimizer=function QueueOptimizerClosure(){function addState(parentState,pattern,fn){var state=parentState;for(var i=0,ii=pattern.length-1;iMAX_WIDTH){maxX=Math.max(maxX,currentX);currentY+=maxLineHeight+2*IMAGE_PADDING;currentX=0;maxLineHeight=0}map.push({transform:transform,x:currentX,y:currentY,w:img.width,h:img.height});currentX+=img.width+2*IMAGE_PADDING;maxLineHeight=Math.max(maxLineHeight,img.height)}var imgWidth=Math.max(maxX,currentX)+IMAGE_PADDING;var imgHeight=currentY+maxLineHeight+IMAGE_PADDING;var imgData=new Uint8Array(imgWidth*imgHeight*4);var imgRowSize=imgWidth<<2;for(q=0;q=0){data[offset-4]=data[offset];data[offset-3]=data[offset+1];data[offset-2]=data[offset+2];data[offset-1]=data[offset+3];data[offset+rowSize]=data[offset+rowSize-4];data[offset+rowSize+1]=data[offset+rowSize-3];data[offset+rowSize+2]=data[offset+rowSize-2];data[offset+rowSize+3]=data[offset+rowSize-1];offset-=imgRowSize}}fnArray.splice(iFirstSave,count*4,OPS.paintInlineImageXObjectGroup);argsArray.splice(iFirstSave,count*4,[{width:imgWidth,height:imgHeight,kind:ImageKind.RGBA_32BPP,data:imgData},map]);return iFirstSave+1});addState(InitialState,[OPS.save,OPS.transform,OPS.paintImageMaskXObject,OPS.restore],function foundImageMaskGroup(context){var MIN_IMAGES_IN_MASKS_BLOCK=10;var MAX_IMAGES_IN_MASKS_BLOCK=100;var MAX_SAME_IMAGES_IN_MASKS_BLOCK=1e3;var fnArray=context.fnArray,argsArray=context.argsArray;var curr=context.iCurr;var iFirstSave=curr-3;var iFirstTransform=curr-2;var iFirstPIMXO=curr-1;var i=iFirstSave+4;var ii=fnArray.length;while(i+3=4&&fnArray[iFirstBeginText-4]===fnArray[iFirstSetFont]&&fnArray[iFirstBeginText-3]===fnArray[iFirstSetTextMatrix]&&fnArray[iFirstBeginText-2]===fnArray[iFirstShowText]&&fnArray[iFirstBeginText-1]===fnArray[iFirstEndText]&&argsArray[iFirstBeginText-4][0]===firstSetFontArg0&&argsArray[iFirstBeginText-4][1]===firstSetFontArg1){count++;iFirst-=5}var iEndText=iFirst+4;for(var q=1;q0?flags:0},hasFlag:function Annotation_hasFlag(flag){return this._hasFlag(this.flags,flag)},setRectangle:function Annotation_setRectangle(rectangle){if(isArray(rectangle)&&rectangle.length===4){this.rectangle=Util.normalizeRect(rectangle)}else{this.rectangle=[0,0,0,0]}},setColor:function Annotation_setColor(color){var rgbColor=new Uint8Array(3);if(!isArray(color)){this.color=rgbColor;return}switch(color.length){case 0:this.color=null;break;case 1:ColorSpace.singletons.gray.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;case 3:ColorSpace.singletons.rgb.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;case 4:ColorSpace.singletons.cmyk.getRgbItem(color,0,rgbColor,0);this.color=rgbColor;break;default:this.color=rgbColor;break}},setBorderStyle:function Annotation_setBorderStyle(borderStyle){this.borderStyle=new AnnotationBorderStyle;if(!isDict(borderStyle)){return}if(borderStyle.has("BS")){var dict=borderStyle.get("BS");var dictType=dict.get("Type");if(!dictType||isName(dictType,"Border")){this.borderStyle.setWidth(dict.get("W"));this.borderStyle.setStyle(dict.get("S"));this.borderStyle.setDashArray(dict.getArray("D"))}}else if(borderStyle.has("Border")){var array=borderStyle.getArray("Border");if(isArray(array)&&array.length>=3){this.borderStyle.setHorizontalCornerRadius(array[0]);this.borderStyle.setVerticalCornerRadius(array[1]);this.borderStyle.setWidth(array[2]);if(array.length===4){this.borderStyle.setDashArray(array[3])}}}else{this.borderStyle.setWidth(0)}},_preparePopup:function Annotation_preparePopup(dict){if(!dict.has("C")){this.data.color=null}this.data.hasPopup=dict.has("Popup");this.data.title=stringToPDFString(dict.get("T")||"");this.data.contents=stringToPDFString(dict.get("Contents")||"")},loadResources:function Annotation_loadResources(keys){return new Promise(function(resolve,reject){this.appearance.dict.getAsync("Resources").then(function(resources){if(!resources){resolve();return}var objectLoader=new ObjectLoader(resources.map,keys,resources.xref);objectLoader.load().then(function(){resolve(resources)},reject)},reject)}.bind(this))},getOperatorList:function Annotation_getOperatorList(evaluator,task,renderForms){if(!this.appearance){return Promise.resolve(new OperatorList)}var data=this.data;var appearanceDict=this.appearance.dict;var resourcesPromise=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]);var bbox=appearanceDict.getArray("BBox")||[0,0,1,1];var matrix=appearanceDict.getArray("Matrix")||[1,0,0,1,0,0];var transform=getTransformMatrix(data.rect,bbox,matrix);var self=this;return resourcesPromise.then(function(resources){var opList=new OperatorList;opList.addOp(OPS.beginAnnotation,[data.rect,transform,matrix]);return evaluator.getOperatorList(self.appearance,task,resources,opList).then(function(){opList.addOp(OPS.endAnnotation,[]);self.appearance.reset();return opList})})}};Annotation.appendToOperatorList=function Annotation_appendToOperatorList(annotations,opList,partialEvaluator,task,intent,renderForms){var annotationPromises=[];for(var i=0,n=annotations.length;i0){var isValid=true;var allZeros=true;for(var i=0,len=dashArray.length;i=0;if(!validNumber){isValid=false;break}else if(element>0){allZeros=false}}if(isValid&&!allZeros){this.dashArray=dashArray}else{this.width=0}}else if(dashArray){this.width=0}},setHorizontalCornerRadius:function AnnotationBorderStyle_setHorizontalCornerRadius(radius){if(radius===(radius|0)){this.horizontalCornerRadius=radius}},setVerticalCornerRadius:function AnnotationBorderStyle_setVerticalCornerRadius(radius){if(radius===(radius|0)){this.verticalCornerRadius=radius}}};return AnnotationBorderStyle}();var WidgetAnnotation=function WidgetAnnotationClosure(){function WidgetAnnotation(params){Annotation.call(this,params);var dict=params.dict;var data=this.data;data.annotationType=AnnotationType.WIDGET;data.fieldValue=stringToPDFString(Util.getInheritableProperty(dict,"V")||"");data.alternativeText=stringToPDFString(dict.get("TU")||"");data.defaultAppearance=Util.getInheritableProperty(dict,"DA")||"";var fieldType=Util.getInheritableProperty(dict,"FT");data.fieldType=isName(fieldType)?fieldType.name:null;this.fieldResources=Util.getInheritableProperty(dict,"DR")||Dict.empty;data.fieldFlags=Util.getInheritableProperty(dict,"Ff");if(!isInt(data.fieldFlags)||data.fieldFlags<0){data.fieldFlags=0}if(data.fieldType==="Sig"){this.setFlags(AnnotationFlag.HIDDEN)}var fieldName=[];var namedItem=dict;var ref=params.ref;while(namedItem){var parent=namedItem.get("Parent");var parentRef=namedItem.getRaw("Parent");var name=namedItem.get("T");if(name){fieldName.unshift(stringToPDFString(name))}else if(parent&&ref){var kids=parent.get("Kids");var j,jj;for(j=0,jj=kids.length;j2){alignment=null}this.data.textAlignment=alignment;var maximumLength=Util.getInheritableProperty(params.dict,"MaxLen");if(!isInt(maximumLength)||maximumLength<0){maximumLength=null}this.data.maxLen=maximumLength;this.data.readOnly=this.hasFieldFlag(AnnotationFieldFlag.READONLY);this.data.multiLine=this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);this.data.comb=this.hasFieldFlag(AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(AnnotationFieldFlag.FILESELECT)&&this.data.maxLen!==null}Util.inherit(TextWidgetAnnotation,WidgetAnnotation,{getOperatorList:function TextWidgetAnnotation_getOperatorList(evaluator,task,renderForms){var operatorList=new OperatorList;if(renderForms){return Promise.resolve(operatorList)}if(this.appearance){return Annotation.prototype.getOperatorList.call(this,evaluator,task,renderForms)}if(!this.data.defaultAppearance){return Promise.resolve(operatorList)}var stream=new Stream(stringToBytes(this.data.defaultAppearance));return evaluator.getOperatorList(stream,task,this.fieldResources,operatorList).then(function(){return operatorList})}});return TextWidgetAnnotation}();var TextAnnotation=function TextAnnotationClosure(){var DEFAULT_ICON_SIZE=22;function TextAnnotation(parameters){Annotation.call(this,parameters);this.data.annotationType=AnnotationType.TEXT;if(this.data.hasAppearance){this.data.name="NoIcon"}else{this.data.rect[1]=this.data.rect[3]-DEFAULT_ICON_SIZE;this.data.rect[2]=this.data.rect[0]+DEFAULT_ICON_SIZE;this.data.name=parameters.dict.has("Name")?parameters.dict.get("Name").name:"Note"}this._preparePopup(parameters.dict)}Util.inherit(TextAnnotation,Annotation,{});return TextAnnotation}();var LinkAnnotation=function LinkAnnotationClosure(){function LinkAnnotation(params){Annotation.call(this,params);var dict=params.dict;var data=this.data;data.annotationType=AnnotationType.LINK;var action=dict.get("A"),url,dest;if(action&&isDict(action)){var linkType=action.get("S").name;switch(linkType){case"URI":url=action.get("URI");if(isName(url)){url="/"+url.name}else if(url){url=addDefaultProtocolToUrl(url)}break;case"GoTo":dest=action.get("D");break;case"GoToR":var urlDict=action.get("F");if(isDict(urlDict)){url=urlDict.get("F")||null}else if(isString(urlDict)){url=urlDict}var remoteDest=action.get("D");if(remoteDest){if(isName(remoteDest)){remoteDest=remoteDest.name}if(isString(url)){var baseUrl=url.split("#")[0];if(isString(remoteDest)){url=baseUrl+"#"+(/^\d+$/.test(remoteDest)?"nameddest=":"")+remoteDest}else if(isArray(remoteDest)){url=baseUrl+"#"+JSON.stringify(remoteDest)}}}var newWindow=action.get("NewWindow");if(isBool(newWindow)){data.newWindow=newWindow}break;case"Named":data.action=action.get("N").name;break;default:warn("unrecognized link type: "+linkType)}}else if(dict.has("Dest")){dest=dict.get("Dest")}if(url){if(isValidUrl(url,false)){data.url=tryConvertUrlEncoding(url)}}if(dest){data.dest=isName(dest)?dest.name:dest}}function addDefaultProtocolToUrl(url){if(isString(url)&&url.indexOf("www.")===0){return"http://"+url}return url}function tryConvertUrlEncoding(url){try{return stringToUTF8String(url)}catch(e){return url}}Util.inherit(LinkAnnotation,Annotation,{});return LinkAnnotation}();var PopupAnnotation=function PopupAnnotationClosure(){function PopupAnnotation(parameters){Annotation.call(this,parameters);this.data.annotationType=AnnotationType.POPUP;var dict=parameters.dict;var parentItem=dict.get("Parent");if(!parentItem){warn("Popup annotation has a missing or invalid parent annotation.");return}this.data.parentId=dict.getRaw("Parent").toString();this.data.title=stringToPDFString(parentItem.get("T")||"");this.data.contents=stringToPDFString(parentItem.get("Contents")||"");if(!parentItem.has("C")){this.data.color=null}else{this.setColor(parentItem.getArray("C"));this.data.color=this.color}if(!this.viewable){var parentFlags=parentItem.get("F");if(this._isViewable(parentFlags)){this.setFlags(parentFlags)}}}Util.inherit(PopupAnnotation,Annotation,{});return PopupAnnotation}();var HighlightAnnotation=function HighlightAnnotationClosure(){function HighlightAnnotation(parameters){Annotation.call(this,parameters);this.data.annotationType=AnnotationType.HIGHLIGHT;this._preparePopup(parameters.dict);this.data.borderStyle.setWidth(0)}Util.inherit(HighlightAnnotation,Annotation,{});return HighlightAnnotation}();var UnderlineAnnotation=function UnderlineAnnotationClosure(){function UnderlineAnnotation(parameters){Annotation.call(this,parameters);this.data.annotationType=AnnotationType.UNDERLINE;this._preparePopup(parameters.dict);this.data.borderStyle.setWidth(0)}Util.inherit(UnderlineAnnotation,Annotation,{});return UnderlineAnnotation}();var SquigglyAnnotation=function SquigglyAnnotationClosure(){function SquigglyAnnotation(parameters){Annotation.call(this,parameters);this.data.annotationType=AnnotationType.SQUIGGLY;this._preparePopup(parameters.dict);this.data.borderStyle.setWidth(0)}Util.inherit(SquigglyAnnotation,Annotation,{});return SquigglyAnnotation}();var StrikeOutAnnotation=function StrikeOutAnnotationClosure(){function StrikeOutAnnotation(parameters){Annotation.call(this,parameters);this.data.annotationType=AnnotationType.STRIKEOUT;this._preparePopup(parameters.dict);this.data.borderStyle.setWidth(0)}Util.inherit(StrikeOutAnnotation,Annotation,{});return StrikeOutAnnotation}();var FileAttachmentAnnotation=function FileAttachmentAnnotationClosure(){function FileAttachmentAnnotation(parameters){Annotation.call(this,parameters);var file=new FileSpec(parameters.dict.get("FS"),parameters.xref);this.data.annotationType=AnnotationType.FILEATTACHMENT;this.data.file=file.serializable;this._preparePopup(parameters.dict)}Util.inherit(FileAttachmentAnnotation,Annotation,{});return FileAttachmentAnnotation}();exports.Annotation=Annotation;exports.AnnotationBorderStyle=AnnotationBorderStyle;exports.AnnotationFactory=AnnotationFactory});(function(root,factory){{factory(root.pdfjsCoreDocument={},root.pdfjsSharedUtil,root.pdfjsCorePrimitives,root.pdfjsCoreStream,root.pdfjsCoreObj,root.pdfjsCoreParser,root.pdfjsCoreCrypto,root.pdfjsCoreEvaluator,root.pdfjsCoreAnnotation)}})(this,function(exports,sharedUtil,corePrimitives,coreStream,coreObj,coreParser,coreCrypto,coreEvaluator,coreAnnotation){var MissingDataException=sharedUtil.MissingDataException;var Util=sharedUtil.Util;var assert=sharedUtil.assert;var error=sharedUtil.error;var info=sharedUtil.info;var isArray=sharedUtil.isArray;var isArrayBuffer=sharedUtil.isArrayBuffer;var isString=sharedUtil.isString;var shadow=sharedUtil.shadow;var stringToBytes=sharedUtil.stringToBytes;var stringToPDFString=sharedUtil.stringToPDFString;var warn=sharedUtil.warn;var isSpace=sharedUtil.isSpace;var Dict=corePrimitives.Dict;var isDict=corePrimitives.isDict;var isName=corePrimitives.isName;var isStream=corePrimitives.isStream;var NullStream=coreStream.NullStream;var Stream=coreStream.Stream;var StreamsSequenceStream=coreStream.StreamsSequenceStream;var Catalog=coreObj.Catalog;var ObjectLoader=coreObj.ObjectLoader;var XRef=coreObj.XRef;var Linearization=coreParser.Linearization;var calculateMD5=coreCrypto.calculateMD5;var OperatorList=coreEvaluator.OperatorList;var PartialEvaluator=coreEvaluator.PartialEvaluator;var Annotation=coreAnnotation.Annotation;var AnnotationFactory=coreAnnotation.AnnotationFactory;var Page=function PageClosure(){var LETTER_SIZE_MEDIABOX=[0,0,612,792];function Page(pdfManager,xref,pageIndex,pageDict,ref,fontCache){this.pdfManager=pdfManager;this.pageIndex=pageIndex;this.pageDict=pageDict;this.xref=xref;this.ref=ref;this.fontCache=fontCache;this.uniquePrefix="p"+this.pageIndex+"_";this.idCounters={obj:0};this.evaluatorOptions=pdfManager.evaluatorOptions;this.resourcesPromise=null}Page.prototype={getPageProp:function Page_getPageProp(key){return this.pageDict.get(key)},getInheritedPageProp:function Page_getInheritedPageProp(key){var dict=this.pageDict,valueArray=null,loopCount=0;var MAX_LOOP_COUNT=100;while(dict){var value=dict.get(key);if(value){if(!valueArray){valueArray=[]}valueArray.push(value)}if(++loopCount>MAX_LOOP_COUNT){warn("Page_getInheritedPageProp: maximum loop count exceeded.");break}dict=dict.get("Parent")}if(!valueArray){return Dict.empty}if(valueArray.length===1||!isDict(valueArray[0])||loopCount>MAX_LOOP_COUNT){return valueArray[0]}return Dict.merge(this.xref,valueArray)},get content(){return this.getPageProp("Contents")},get resources(){return shadow(this,"resources",this.getInheritedPageProp("Resources"))},get mediaBox(){var obj=this.getInheritedPageProp("MediaBox");if(!isArray(obj)||obj.length!==4){obj=LETTER_SIZE_MEDIABOX}return shadow(this,"mediaBox",obj)},get view(){var mediaBox=this.mediaBox;var cropBox=this.getInheritedPageProp("CropBox");if(!isArray(cropBox)||cropBox.length!==4){return shadow(this,"view",mediaBox)}cropBox=Util.intersect(cropBox,mediaBox);if(!cropBox){return shadow(this,"view",mediaBox)}return shadow(this,"view",cropBox)},get rotate(){var rotate=this.getInheritedPageProp("Rotate")||0;if(rotate%90!==0){rotate=0}else if(rotate>=360){rotate=rotate%360}else if(rotate<0){rotate=(rotate%360+360)%360}return shadow(this,"rotate",rotate)},getContentStream:function Page_getContentStream(){var content=this.content;var stream;if(isArray(content)){var xref=this.xref;var i,n=content.length;var streams=[];for(i=0;i0,"stream must have data");this.pdfManager=pdfManager;this.stream=stream;var xref=new XRef(this.stream,password,pdfManager);this.xref=xref}function find(stream,needle,limit,backwards){var pos=stream.pos;var end=stream.end;var strBuf=[];if(pos+limit>end){limit=end-pos}for(var n=0;n0){pos-=step-"startxref".length;if(pos<0){pos=0}stream.pos=pos;found=find(stream,"startxref",step,true)}if(found){stream.skip(9);var ch;do{ch=stream.getByte()}while(isSpace(ch));var str="";while(ch>=32&&ch<=57){str+=String.fromCharCode(ch);ch=stream.getByte()}startXRef=parseInt(str,10);if(isNaN(startXRef)){startXRef=0}}}return shadow(this,"startXRef",startXRef)},get mainXRefEntriesOffset(){var mainXRefEntriesOffset=0;var linearization=this.linearization;if(linearization){mainXRefEntriesOffset=linearization.mainXRefEntriesOffset}return shadow(this,"mainXRefEntriesOffset",mainXRefEntriesOffset)},checkHeader:function PDFDocument_checkHeader(){var stream=this.stream;stream.reset();if(find(stream,"%PDF-",1024)){stream.moveStart();var MAX_VERSION_LENGTH=12;var version="",ch;while((ch=stream.getByte())>32){if(version.length>=MAX_VERSION_LENGTH){break}version+=String.fromCharCode(ch)}if(!this.pdfFormatVersion){this.pdfFormatVersion=version.substring(5)}return}},parseStartXRef:function PDFDocument_parseStartXRef(){var startXRef=this.startXRef; this.xref.setStartXRef(startXRef)},setup:function PDFDocument_setup(recoveryMode){this.xref.parse(recoveryMode);var self=this;var pageFactory={createPage:function(pageIndex,dict,ref,fontCache){return new Page(self.pdfManager,self.xref,pageIndex,dict,ref,fontCache)}};this.catalog=new Catalog(this.pdfManager,this.xref,pageFactory)},get numPages(){var linearization=this.linearization;var num=linearization?linearization.numPages:this.catalog.numPages;return shadow(this,"numPages",num)},get documentInfo(){var docInfo={PDFFormatVersion:this.pdfFormatVersion,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa};var infoDict;try{infoDict=this.xref.trailer.get("Info")}catch(err){info("The document information dictionary is invalid.")}if(infoDict){var validEntries=DocumentInfoValidators.entries;for(var key in validEntries){if(infoDict.has(key)){var value=infoDict.get(key);if(validEntries[key](value)){docInfo[key]=typeof value!=="string"?value:stringToPDFString(value)}else{info('Bad value in document info for "'+key+'"')}}}}return shadow(this,"documentInfo",docInfo)},get fingerprint(){var xref=this.xref,hash,fileID="";var idArray=xref.trailer.get("ID");if(idArray&&isArray(idArray)&&idArray[0]&&isString(idArray[0])&&idArray[0]!==EMPTY_FINGERPRINT){hash=stringToBytes(idArray[0])}else{if(this.stream.ensureRange){this.stream.ensureRange(0,Math.min(FINGERPRINT_FIRST_BYTES,this.stream.end))}hash=calculateMD5(this.stream.bytes.subarray(0,FINGERPRINT_FIRST_BYTES),0,FINGERPRINT_FIRST_BYTES)}for(var i=0,n=hash.length;i0){this._queuedChunks.push(initialData)}this._msgHandler=msgHandler;this._isRangeSupported=!params.disableRange;this._isStreamingSupported=!params.disableStream;this._contentLength=params.length;this._fullRequestReader=null;this._rangeReaders=[];msgHandler.on("OnDataRange",this._onReceiveData.bind(this));msgHandler.on("OnDataProgress",this._onProgress.bind(this))}PDFWorkerStream.prototype={_onReceiveData:function PDFWorkerStream_onReceiveData(args){if(args.begin===undefined){if(this._fullRequestReader){this._fullRequestReader._enqueue(args.chunk)}else{this._queuedChunks.push(args.chunk)}}else{var found=this._rangeReaders.some(function(rangeReader){if(rangeReader._begin!==args.begin){return false}rangeReader._enqueue(args.chunk);return true});assert(found)}},_onProgress:function PDFWorkerStream_onProgress(evt){if(this._rangeReaders.length>0){var firstReader=this._rangeReaders[0];if(firstReader.onProgress){firstReader.onProgress({loaded:evt.loaded})}}},_removeRangeReader:function PDFWorkerStream_removeRangeReader(reader){var i=this._rangeReaders.indexOf(reader);if(i>=0){this._rangeReaders.splice(i,1)}},getFullReader:function PDFWorkerStream_getFullReader(){assert(!this._fullRequestReader);var queuedChunks=this._queuedChunks;this._queuedChunks=null;return new PDFWorkerStreamReader(this,queuedChunks)},getRangeReader:function PDFWorkerStream_getRangeReader(begin,end){var reader=new PDFWorkerStreamRangeReader(this,begin,end);this._msgHandler.send("RequestDataRange",{begin:begin,end:end});this._rangeReaders.push(reader);return reader},cancelAllRequests:function PDFWorkerStream_cancelAllRequests(reason){if(this._fullRequestReader){this._fullRequestReader.cancel(reason)}var readers=this._rangeReaders.slice(0);readers.forEach(function(rangeReader){rangeReader.cancel(reason)})}};function PDFWorkerStreamReader(stream,queuedChunks){this._stream=stream;this._done=false;this._queuedChunks=queuedChunks||[];this._requests=[];this._headersReady=Promise.resolve();stream._fullRequestReader=this;this.onProgress=null}PDFWorkerStreamReader.prototype={_enqueue:function PDFWorkerStreamReader_enqueue(chunk){if(this._done){return}if(this._requests.length>0){var requestCapability=this._requests.shift();requestCapability.resolve({value:chunk,done:false});return}this._queuedChunks.push(chunk)},get headersReady(){return this._headersReady},get isRangeSupported(){return this._stream._isRangeSupported},get isStreamingSupported(){return this._stream._isStreamingSupported},get contentLength(){return this._stream._contentLength},read:function PDFWorkerStreamReader_read(){if(this._queuedChunks.length>0){var chunk=this._queuedChunks.shift();return Promise.resolve({value:chunk,done:false})}if(this._done){return Promise.resolve({value:undefined,done:true})}var requestCapability=createPromiseCapability();this._requests.push(requestCapability);return requestCapability.promise},cancel:function PDFWorkerStreamReader_cancel(reason){this._done=true;this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[]}};function PDFWorkerStreamRangeReader(stream,begin,end){this._stream=stream;this._begin=begin;this._end=end;this._queuedChunk=null;this._requests=[];this._done=false;this.onProgress=null}PDFWorkerStreamRangeReader.prototype={_enqueue:function PDFWorkerStreamRangeReader_enqueue(chunk){if(this._done){return}if(this._requests.length===0){this._queuedChunk=chunk}else{var requestsCapability=this._requests.shift();requestsCapability.resolve({value:chunk,done:false});this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[]}this._done=true;this._stream._removeRangeReader(this)},get isStreamingSupported(){return false},read:function PDFWorkerStreamRangeReader_read(){if(this._queuedChunk){return Promise.resolve({value:this._queuedChunk,done:false})}if(this._done){return Promise.resolve({value:undefined,done:true})}var requestCapability=createPromiseCapability();this._requests.push(requestCapability);return requestCapability.promise},cancel:function PDFWorkerStreamRangeReader_cancel(reason){this._done=true;this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[];this._stream._removeRangeReader(this)}};return PDFWorkerStream}();var PDFNetworkStream;function setPDFNetworkStreamClass(cls){PDFNetworkStream=cls}var WorkerMessageHandler={setup:function wphSetup(handler,port){var testMessageProcessed=false;handler.on("test",function wphSetupTest(data){if(testMessageProcessed){return}testMessageProcessed=true;if(!(data instanceof Uint8Array)){handler.send("test","main",false);return}var supportTransfers=data[0]===255;handler.postMessageTransfers=supportTransfers;var xhr=new XMLHttpRequest;var responseExists="response"in xhr;try{var dummy=xhr.responseType}catch(e){responseExists=false}if(!responseExists){handler.send("test",false);return}handler.send("test",{supportTypedArray:true,supportTransfers:supportTransfers})});handler.on("configure",function wphConfigure(data){setVerbosityLevel(data.verbosity)});handler.on("GetDocRequest",function wphSetupDoc(data){return WorkerMessageHandler.createDocumentHandler(data,port)})},createDocumentHandler:function wphCreateDocumentHandler(docParams,port){var pdfManager;var terminated=false;var cancelXHRs=null;var WorkerTasks=[];var docId=docParams.docId;var workerHandlerName=docParams.docId+"_worker";var handler=new MessageHandler(workerHandlerName,docId,port);handler.postMessageTransfers=docParams.postMessageTransfers;function ensureNotTerminated(){if(terminated){throw new Error("Worker was terminated")}}function startWorkerTask(task){WorkerTasks.push(task)}function finishWorkerTask(task){task.finish();var i=WorkerTasks.indexOf(task);WorkerTasks.splice(i,1)}function loadDocument(recoveryMode){var loadDocumentCapability=createPromiseCapability();var parseSuccess=function parseSuccess(){var numPagesPromise=pdfManager.ensureDoc("numPages");var fingerprintPromise=pdfManager.ensureDoc("fingerprint");var encryptedPromise=pdfManager.ensureXRef("encrypt");Promise.all([numPagesPromise,fingerprintPromise,encryptedPromise]).then(function onDocReady(results){var doc={numPages:results[0],fingerprint:results[1],encrypted:!!results[2]};loadDocumentCapability.resolve(doc)},parseFailure)};var parseFailure=function parseFailure(e){loadDocumentCapability.reject(e)};pdfManager.ensureDoc("checkHeader",[]).then(function(){pdfManager.ensureDoc("parseStartXRef",[]).then(function(){pdfManager.ensureDoc("parse",[recoveryMode]).then(parseSuccess,parseFailure)},parseFailure)},parseFailure);return loadDocumentCapability.promise}function getPdfManager(data,evaluatorOptions){var pdfManagerCapability=createPromiseCapability();var pdfManager;var source=data.source;if(source.data){try{pdfManager=new LocalPdfManager(docId,source.data,source.password,evaluatorOptions);pdfManagerCapability.resolve(pdfManager)}catch(ex){pdfManagerCapability.reject(ex)}return pdfManagerCapability.promise}var pdfStream;try{if(source.chunkedViewerLoading){pdfStream=new PDFWorkerStream(source,handler)}else{assert(PDFNetworkStream,"pdfjs/core/network module is not loaded");pdfStream=new PDFNetworkStream(data)}}catch(ex){pdfManagerCapability.reject(ex);return pdfManagerCapability.promise}var fullRequest=pdfStream.getFullReader();fullRequest.headersReady.then(function(){if(!fullRequest.isStreamingSupported||!fullRequest.isRangeSupported){fullRequest.onProgress=function(evt){handler.send("DocProgress",{loaded:evt.loaded,total:evt.total})}}if(!fullRequest.isRangeSupported){return}var disableAutoFetch=source.disableAutoFetch||fullRequest.isStreamingSupported;pdfManager=new NetworkPdfManager(docId,pdfStream,{msgHandler:handler,url:source.url,password:source.password,length:fullRequest.contentLength,disableAutoFetch:disableAutoFetch,rangeChunkSize:source.rangeChunkSize},evaluatorOptions);pdfManagerCapability.resolve(pdfManager);cancelXHRs=null}).catch(function(reason){pdfManagerCapability.reject(reason);cancelXHRs=null});var cachedChunks=[],loaded=0;var flushChunks=function(){var pdfFile=arraysToBytes(cachedChunks);if(source.length&&pdfFile.length!==source.length){warn("reported HTTP length is different from actual")}try{pdfManager=new LocalPdfManager(docId,pdfFile,source.password,evaluatorOptions);pdfManagerCapability.resolve(pdfManager)}catch(ex){pdfManagerCapability.reject(ex)}cachedChunks=[]};var readPromise=new Promise(function(resolve,reject){var readChunk=function(chunk){try{ensureNotTerminated();if(chunk.done){if(!pdfManager){flushChunks()}cancelXHRs=null;return}var data=chunk.value;loaded+=arrayByteLength(data);if(!fullRequest.isStreamingSupported){handler.send("DocProgress",{loaded:loaded,total:Math.max(loaded,fullRequest.contentLength||0)})}if(pdfManager){pdfManager.sendProgressiveData(data)}else{cachedChunks.push(data)}fullRequest.read().then(readChunk,reject)}catch(e){reject(e)}};fullRequest.read().then(readChunk,reject)});readPromise.catch(function(e){pdfManagerCapability.reject(e);cancelXHRs=null});cancelXHRs=function(){pdfStream.cancelAllRequests("abort")};return pdfManagerCapability.promise}var setupDoc=function(data){var onSuccess=function(doc){ensureNotTerminated();handler.send("GetDoc",{pdfInfo:doc})};var onFailure=function(e){if(e instanceof PasswordException){if(e.code===PasswordResponses.NEED_PASSWORD){handler.send("NeedPassword",e)}else if(e.code===PasswordResponses.INCORRECT_PASSWORD){handler.send("IncorrectPassword",e)}}else if(e instanceof InvalidPDFException){handler.send("InvalidPDF",e)}else if(e instanceof MissingPDFException){handler.send("MissingPDF",e)}else if(e instanceof UnexpectedResponseException){handler.send("UnexpectedResponse",e)}else{handler.send("UnknownError",new UnknownErrorException(e.message,e.toString()))}};ensureNotTerminated();var cMapOptions={url:data.cMapUrl===undefined?null:data.cMapUrl,packed:data.cMapPacked===true};var evaluatorOptions={forceDataSchema:data.disableCreateObjectURL,maxImageSize:data.maxImageSize===undefined?-1:data.maxImageSize,disableFontFace:data.disableFontFace,cMapOptions:cMapOptions};getPdfManager(data,evaluatorOptions).then(function(newPdfManager){if(terminated){newPdfManager.terminate();throw new Error("Worker was terminated")}pdfManager=newPdfManager;handler.send("PDFManagerReady",null);pdfManager.onLoadedStream().then(function(stream){handler.send("DataLoaded",{length:stream.bytes.byteLength})})}).then(function pdfManagerReady(){ensureNotTerminated();loadDocument(false).then(onSuccess,function loadFailure(ex){ensureNotTerminated();if(!(ex instanceof XRefParseException)){if(ex instanceof PasswordException){pdfManager.passwordChanged().then(pdfManagerReady)}onFailure(ex);return}pdfManager.requestLoadedStream();pdfManager.onLoadedStream().then(function(){ensureNotTerminated();loadDocument(true).then(onSuccess,onFailure)})},onFailure)},onFailure)};handler.on("GetPage",function wphSetupGetPage(data){return pdfManager.getPage(data.pageIndex).then(function(page){var rotatePromise=pdfManager.ensure(page,"rotate");var refPromise=pdfManager.ensure(page,"ref");var viewPromise=pdfManager.ensure(page,"view");return Promise.all([rotatePromise,refPromise,viewPromise]).then(function(results){return{rotate:results[0],ref:results[1],view:results[2]}})})});handler.on("GetPageIndex",function wphSetupGetPageIndex(data){var ref=new Ref(data.ref.num,data.ref.gen);var catalog=pdfManager.pdfDocument.catalog;return catalog.getPageIndex(ref)});handler.on("GetDestinations",function wphSetupGetDestinations(data){return pdfManager.ensureCatalog("destinations")});handler.on("GetDestination",function wphSetupGetDestination(data){return pdfManager.ensureCatalog("getDestination",[data.id])});handler.on("GetPageLabels",function wphSetupGetPageLabels(data){return pdfManager.ensureCatalog("pageLabels")});handler.on("GetAttachments",function wphSetupGetAttachments(data){return pdfManager.ensureCatalog("attachments")});handler.on("GetJavaScript",function wphSetupGetJavaScript(data){return pdfManager.ensureCatalog("javaScript")});handler.on("GetOutline",function wphSetupGetOutline(data){return pdfManager.ensureCatalog("documentOutline")});handler.on("GetMetadata",function wphSetupGetMetadata(data){return Promise.all([pdfManager.ensureDoc("documentInfo"),pdfManager.ensureCatalog("metadata")])});handler.on("GetData",function wphSetupGetData(data){pdfManager.requestLoadedStream();return pdfManager.onLoadedStream().then(function(stream){return stream.bytes})});handler.on("GetStats",function wphSetupGetStats(data){return pdfManager.pdfDocument.xref.stats});handler.on("UpdatePassword",function wphSetupUpdatePassword(data){pdfManager.updatePassword(data)});handler.on("GetAnnotations",function wphSetupGetAnnotations(data){return pdfManager.getPage(data.pageIndex).then(function(page){return pdfManager.ensure(page,"getAnnotationsData",[data.intent])})});handler.on("RenderPageRequest",function wphSetupRenderPage(data){var pageIndex=data.pageIndex;pdfManager.getPage(pageIndex).then(function(page){var task=new WorkerTask("RenderPageRequest: page "+pageIndex);startWorkerTask(task);var pageNum=pageIndex+1;var start=Date.now();page.getOperatorList(handler,task,data.intent,data.renderInteractiveForms).then(function(operatorList){finishWorkerTask(task);info("page="+pageNum+" - getOperatorList: time="+(Date.now()-start)+"ms, len="+operatorList.totalLength)},function(e){finishWorkerTask(task);if(task.terminated){return}handler.send("UnsupportedFeature",{featureId:UNSUPPORTED_FEATURES.unknown});var minimumStackMessage="worker.js: while trying to getPage() and getOperatorList()";var wrappedException;if(typeof e==="string"){wrappedException={message:e,stack:minimumStackMessage}}else if(typeof e==="object"){wrappedException={message:e.message||e.toString(),stack:e.stack||minimumStackMessage}}else{wrappedException={message:"Unknown exception type: "+typeof e,stack:minimumStackMessage}}handler.send("PageError",{pageNum:pageNum,error:wrappedException,intent:data.intent})})})},this);handler.on("GetTextContent",function wphExtractText(data){var pageIndex=data.pageIndex;var normalizeWhitespace=data.normalizeWhitespace;var combineTextItems=data.combineTextItems;return pdfManager.getPage(pageIndex).then(function(page){var task=new WorkerTask("GetTextContent: page "+pageIndex);startWorkerTask(task);var pageNum=pageIndex+1;var start=Date.now();return page.extractTextContent(task,normalizeWhitespace,combineTextItems).then(function(textContent){finishWorkerTask(task);info("text indexing: page="+pageNum+" - time="+(Date.now()-start)+"ms");return textContent},function(reason){finishWorkerTask(task);if(task.terminated){return}throw reason})})});handler.on("Cleanup",function wphCleanup(data){return pdfManager.cleanup()});handler.on("Terminate",function wphTerminate(data){terminated=true;if(pdfManager){pdfManager.terminate();pdfManager=null}if(cancelXHRs){cancelXHRs()}var waitOn=[];WorkerTasks.forEach(function(task){waitOn.push(task.finished);task.terminate()});return Promise.all(waitOn).then(function(){handler.destroy();handler=null})});handler.on("Ready",function wphReady(data){setupDoc(docParams);docParams=null});return workerHandlerName}};function initializeWorker(){if(!("console"in globalScope)){var consoleTimer={};var workerConsole={log:function log(){var args=Array.prototype.slice.call(arguments);globalScope.postMessage({targetName:"main",action:"console_log",data:args})},error:function error(){var args=Array.prototype.slice.call(arguments);globalScope.postMessage({targetName:"main",action:"console_error",data:args});throw"pdf.js execution error"},time:function time(name){consoleTimer[name]=Date.now()},timeEnd:function timeEnd(name){var time=consoleTimer[name];if(!time){error("Unknown timer name "+name)}this.log("Timer:",name,Date.now()-time)}};globalScope.console=workerConsole}var handler=new MessageHandler("worker","main",self);WorkerMessageHandler.setup(handler,self);handler.send("ready",null)}if(typeof window==="undefined"&&!(typeof module!=="undefined"&&module.require)){initializeWorker()}exports.setPDFNetworkStreamClass=setPDFNetworkStreamClass;exports.WorkerTask=WorkerTask;exports.WorkerMessageHandler=WorkerMessageHandler});var NetworkManager=function NetworkManagerClosure(){var OK_RESPONSE=200;var PARTIAL_CONTENT_RESPONSE=206;function NetworkManager(url,args){this.url=url;args=args||{};this.isHttp=/^https?:/i.test(url);this.httpHeaders=this.isHttp&&args.httpHeaders||{};this.withCredentials=args.withCredentials||false;this.getXhr=args.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null);this.loadedRequests=Object.create(null)}function getArrayBuffer(xhr){var data=xhr.response;if(typeof data!=="string"){return data}var length=data.length;var array=new Uint8Array(length);for(var i=0;i=2&&pendingRequest.onHeadersReceived){pendingRequest.onHeadersReceived();delete pendingRequest.onHeadersReceived}if(xhr.readyState!==4){return}if(!(xhrId in this.pendingRequests)){return}delete this.pendingRequests[xhrId];if(xhr.status===0&&this.isHttp){if(pendingRequest.onError){pendingRequest.onError(xhr.status)}return}var xhrStatus=xhr.status||OK_RESPONSE;var ok_response_on_range_request=xhrStatus===OK_RESPONSE&&pendingRequest.expectedStatus===PARTIAL_CONTENT_RESPONSE;if(!ok_response_on_range_request&&xhrStatus!==pendingRequest.expectedStatus){if(pendingRequest.onError){pendingRequest.onError(xhr.status)}return}this.loadedRequests[xhrId]=true;var chunk=getArrayBuffer(xhr);if(xhrStatus===PARTIAL_CONTENT_RESPONSE){var rangeHeader=xhr.getResponseHeader("Content-Range");var matches=/bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader);var begin=parseInt(matches[1],10);pendingRequest.onDone({begin:begin,chunk:chunk})}else if(pendingRequest.onProgressiveData){pendingRequest.onDone(null)}else if(chunk){pendingRequest.onDone({begin:0,chunk:chunk})}else if(pendingRequest.onError){pendingRequest.onError(xhr.status)}},hasPendingRequests:function NetworkManager_hasPendingRequests(){for(var xhrId in this.pendingRequests){return true}return false},getRequestXhr:function NetworkManager_getXhr(xhrId){return this.pendingRequests[xhrId].xhr},isStreamingRequest:function NetworkManager_isStreamingRequest(xhrId){return!!this.pendingRequests[xhrId].onProgressiveData},isPendingRequest:function NetworkManager_isPendingRequest(xhrId){return xhrId in this.pendingRequests},isLoadedRequest:function NetworkManager_isLoadedRequest(xhrId){return xhrId in this.loadedRequests},abortAllRequests:function NetworkManager_abortAllRequests(){for(var xhrId in this.pendingRequests){this.abortRequest(xhrId|0)}},abortRequest:function NetworkManager_abortRequest(xhrId){var xhr=this.pendingRequests[xhrId].xhr;delete this.pendingRequests[xhrId];xhr.abort()}};return NetworkManager}();(function(root,factory){{factory(root.pdfjsCoreNetwork={},root.pdfjsSharedUtil,root.pdfjsCoreWorker)}})(this,function(exports,sharedUtil,coreWorker){var assert=sharedUtil.assert;var createPromiseCapability=sharedUtil.createPromiseCapability;var isInt=sharedUtil.isInt;var MissingPDFException=sharedUtil.MissingPDFException;var UnexpectedResponseException=sharedUtil.UnexpectedResponseException;function PDFNetworkStream(options){this._options=options;var source=options.source;this._manager=new NetworkManager(source.url,{httpHeaders:source.httpHeaders,withCredentials:source.withCredentials});this._rangeChunkSize=source.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}PDFNetworkStream.prototype={_onRangeRequestReaderClosed:function PDFNetworkStream_onRangeRequestReaderClosed(reader){var i=this._rangeRequestReaders.indexOf(reader);if(i>=0){this._rangeRequestReaders.splice(i,1)}},getFullReader:function PDFNetworkStream_getFullReader(){assert(!this._fullRequestReader);this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._options);return this._fullRequestReader},getRangeReader:function PDFNetworkStream_getRangeReader(begin,end){var reader=new PDFNetworkStreamRangeRequestReader(this._manager,begin,end);reader.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(reader);return reader},cancelAllRequests:function PDFNetworkStream_cancelAllRequests(reason){if(this._fullRequestReader){this._fullRequestReader.cancel(reason)}var readers=this._rangeRequestReaders.slice(0);readers.forEach(function(reader){reader.cancel(reason)})}};function PDFNetworkStreamFullRequestReader(manager,options){this._manager=manager;var source=options.source;var args={onHeadersReceived:this._onHeadersReceived.bind(this),onProgressiveData:source.disableStream?null:this._onProgressiveData.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=source.url;this._fullRequestId=manager.requestFull(args);this._headersReceivedCapability=createPromiseCapability();this._disableRange=options.disableRange||false;this._contentLength=source.length;this._rangeChunkSize=source.rangeChunkSize;if(!this._rangeChunkSize&&!this._disableRange){this._disableRange=true }this._isStreamingSupported=false;this._isRangeSupported=false;this._cachedChunks=[];this._requests=[];this._done=false;this._storedError=undefined;this.onProgress=null}PDFNetworkStreamFullRequestReader.prototype={_validateRangeRequestCapabilities:function PDFNetworkStreamFullRequestReader_validateRangeRequestCapabilities(){if(this._disableRange){return false}var networkManager=this._manager;var fullRequestXhrId=this._fullRequestId;var fullRequestXhr=networkManager.getRequestXhr(fullRequestXhrId);if(fullRequestXhr.getResponseHeader("Accept-Ranges")!=="bytes"){return false}var contentEncoding=fullRequestXhr.getResponseHeader("Content-Encoding")||"identity";if(contentEncoding!=="identity"){return false}var length=fullRequestXhr.getResponseHeader("Content-Length");length=parseInt(length,10);if(!isInt(length)){return false}this._contentLength=length;if(length<=2*this._rangeChunkSize){return false}return true},_onHeadersReceived:function PDFNetworkStreamFullRequestReader_onHeadersReceived(){if(this._validateRangeRequestCapabilities()){this._isRangeSupported=true}var networkManager=this._manager;var fullRequestXhrId=this._fullRequestId;if(networkManager.isStreamingRequest(fullRequestXhrId)){this._isStreamingSupported=true}else if(this._isRangeSupported){networkManager.abortRequest(fullRequestXhrId)}this._headersReceivedCapability.resolve()},_onProgressiveData:function PDFNetworkStreamFullRequestReader_onProgressiveData(chunk){if(this._requests.length>0){var requestCapability=this._requests.shift();requestCapability.resolve({value:chunk,done:false})}else{this._cachedChunks.push(chunk)}},_onDone:function PDFNetworkStreamFullRequestReader_onDone(args){if(args){this._onProgressiveData(args.chunk)}this._done=true;if(this._cachedChunks.length>0){return}this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[]},_onError:function PDFNetworkStreamFullRequestReader_onError(status){var url=this._url;var exception;if(status===404||status===0&&/^file:/.test(url)){exception=new MissingPDFException('Missing PDF "'+url+'".')}else{exception=new UnexpectedResponseException("Unexpected server response ("+status+') while retrieving PDF "'+url+'".',status)}this._storedError=exception;this._headersReceivedCapability.reject(exception);this._requests.forEach(function(requestCapability){requestCapability.reject(exception)});this._requests=[];this._cachedChunks=[]},_onProgress:function PDFNetworkStreamFullRequestReader_onProgress(data){if(this.onProgress){this.onProgress({loaded:data.loaded,total:data.lengthComputable?data.total:this._contentLength})}},get isRangeSupported(){return this._isRangeSupported},get isStreamingSupported(){return this._isStreamingSupported},get contentLength(){return this._contentLength},get headersReady(){return this._headersReceivedCapability.promise},read:function PDFNetworkStreamFullRequestReader_read(){if(this._storedError){return Promise.reject(this._storedError)}if(this._cachedChunks.length>0){var chunk=this._cachedChunks.shift();return Promise.resolve(chunk)}if(this._done){return Promise.resolve({value:undefined,done:true})}var requestCapability=createPromiseCapability();this._requests.push(requestCapability);return requestCapability.promise},cancel:function PDFNetworkStreamFullRequestReader_cancel(reason){this._done=true;this._headersReceivedCapability.reject(reason);this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[];if(this._manager.isPendingRequest(this._fullRequestId)){this._manager.abortRequest(this._fullRequestId)}this._fullRequestReader=null}};function PDFNetworkStreamRangeRequestReader(manager,begin,end){this._manager=manager;var args={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=manager.requestRange(begin,end,args);this._requests=[];this._queuedChunk=null;this._done=false;this.onProgress=null;this.onClosed=null}PDFNetworkStreamRangeRequestReader.prototype={_close:function PDFNetworkStreamRangeRequestReader_close(){if(this.onClosed){this.onClosed(this)}},_onDone:function PDFNetworkStreamRangeRequestReader_onDone(data){var chunk=data.chunk;if(this._requests.length>0){var requestCapability=this._requests.shift();requestCapability.resolve({value:chunk,done:false})}else{this._queuedChunk=chunk}this._done=true;this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[];this._close()},_onProgress:function PDFNetworkStreamRangeRequestReader_onProgress(evt){if(!this.isStreamingSupported&&this.onProgress){this.onProgress({loaded:evt.loaded})}},get isStreamingSupported(){return false},read:function PDFNetworkStreamRangeRequestReader_read(){if(this._queuedChunk!==null){var chunk=this._queuedChunk;this._queuedChunk=null;return Promise.resolve({value:chunk,done:false})}if(this._done){return Promise.resolve({value:undefined,done:true})}var requestCapability=createPromiseCapability();this._requests.push(requestCapability);return requestCapability.promise},cancel:function PDFNetworkStreamRangeRequestReader_cancel(reason){this._done=true;this._requests.forEach(function(requestCapability){requestCapability.resolve({value:undefined,done:true})});this._requests=[];if(this._manager.isPendingRequest(this._requestId)){this._manager.abortRequest(this._requestId)}this._close()}};coreWorker.setPDFNetworkStreamClass(PDFNetworkStream);exports.PDFNetworkStream=PDFNetworkStream;exports.NetworkManager=NetworkManager})}).call(pdfjsLibs);exports.WorkerMessageHandler=pdfjsLibs.pdfjsCoreWorker.WorkerMessageHandler});