"undefined"==typeof PDFJS&&(("undefined"!=typeof window?window:this).PDFJS={}),PDFJS.version="0.8.765",PDFJS.build="88ec2bd",function(){"use strict";function e(e){K>=V&&PDFJS.LogManager.notify("info",e)}function t(e){K>=X&&PDFJS.LogManager.notify("warn",e)}function a(e){if(arguments.length>1){var t=["Error:"];t.push.apply(t,arguments),_.apply(null,t),e=[].join.call(arguments," ")}else _("Error: "+e);throw _(i()),PDFJS.LogManager.notify("error",e),new Error(e)}function r(e){t("TODO: "+e)}function i(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function c(e,t){e||a(t)}function n(e,t){if(!e)return!1;var a=e.indexOf(":");if(a<0)return t;var r=e.substr(0,a);switch(r){case"http":case"https":case"ftp":case"mailto":return!0;default:return!1}}function s(e,t){e||a(t)}function o(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!1}),a}function f(e){for(var t="",a=e.length,r=0;r=r.begin&&e=t.begin&&e=t.begin&&e=127&&e=dt&&e=0;r--)a+=e[r];return a}function j(e,t){for(var a=t.charsToGlyphs(e),r="",i=0,c=a.length;ie[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t},e.intersect=function(t,a){function r(e,t){return e-t}var i=[t[0],t[2],a[0],a[2]].sort(r),c=[t[1],t[3],a[1],a[3]].sort(r),n=[];return t=e.normalizeRect(t),a=e.normalizeRect(a),(i[0]===t[0]&&i[1]===a[0]||i[0]===a[0]&&i[1]===t[0])&&(n[0]=i[1],n[2]=i[2],(c[0]===t[1]&&c[1]===a[1]||c[0]===a[1]&&c[1]===t[1])&&(n[1]=c[1],n[3]=c[2],n))},e.sign=function(e){return e<0?-1:1},e.concatenateToArray=function(e,t){Array.prototype.push.apply(e,t)},e.prependToArray=function(e,t){Array.prototype.unshift.apply(e,t)},e.extendObj=function(e,t){for(var a in t)e[a]=t[a]},e.getInheritableProperty=function(e,t){for(;e&&!e.has(t);)e=e.get("Parent");return e?e.get(t):null},e.inherit=function(e,t,a){e.prototype=Object.create(t.prototype),e.prototype.constructor=e;for(var r in a)e.prototype[r]=a[r]},e.loadScript=function(e,t){var a=document.createElement("script"),r=!1;a.setAttribute("src",e),t&&(a.onload=function(){r||t(),r=!0}),document.getElementsByTagName("head")[0].appendChild(a)},e}(),ne=(PDFJS.PageViewport=function(){function e(e,t,a,r,i,c){this.viewBox=e,this.scale=t,this.rotation=a,this.offsetX=r,this.offsetY=i;var n,s,o,f,l=(e[2]+e[0])/2,h=(e[3]+e[1])/2;switch(a%=360,a=a<0?a+360:a){case 180:n=-1,s=0,o=0,f=1;break;case 90:n=0,s=1,o=1,f=0;break;case 270:n=0,s=-1,o=-1,f=0;break;default:n=1,s=0,o=0,f=-1}c&&(o=-o,f=-f);var u,d,g,m;0===n?(u=Math.abs(h-e[1])*t+r,d=Math.abs(l-e[0])*t+i,g=Math.abs(e[3]-e[1])*t,m=Math.abs(e[2]-e[0])*t):(u=Math.abs(l-e[0])*t+r,d=Math.abs(h-e[1])*t+i,g=Math.abs(e[2]-e[0])*t,m=Math.abs(e[3]-e[1])*t),this.transform=[n*t,s*t,o*t,f*t,u-n*t*l-o*t*h,d-s*t*l-f*t*h],this.width=g,this.height=m,this.fontScale=t}return e.prototype={clone:function(t){t=t||{};var a="scale"in t?t.scale:this.scale,r="rotation"in t?t.rotation:this.rotation;return new e(this.viewBox.slice(),a,r,this.offsetX,this.offsetY,t.dontFlip)},convertToViewportPoint:function(e,t){return ce.applyTransform([e,t],this.transform)},convertToViewportRectangle:function(e){var t=ce.applyTransform([e[0],e[1]],this.transform),a=ce.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],a[0],a[1]]},convertToPdfPoint:function(e,t){return ce.applyInverseTransform([e,t],this.transform)}},e}(),[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]),se=PDFJS.Promise=function(){function e(){this._status=a,this._handlers=[]}var a=0,r=1,i=2,c=500,n={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(e){e._status!=a&&(this.handlers=this.handlers.concat(e._handlers),e._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(;this.handlers.length>0;){var e=this.handlers.shift(),t=e.thisPromise._status,a=e.thisPromise._value;try{t===r?"function"==typeof e.onResolve&&(a=e.onResolve(a)):"function"==typeof e.onReject&&(a=e.onReject(a),t=r,e.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(e.thisPromise))}catch(c){t=i,a=c}e.nextPromise._updateStatus(t,a)}this.running=!1},addUnhandledRejection:function(e){this.unhandledRejections.push({promise:e,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(e){e._unhandledRejection=!1;for(var t=0;tc){var r=this.unhandledRejections[a].promise._value,i="Unhandled rejection: "+r;r.stack&&(i+="\n"+r.stack),t(i),this.unhandledRejections.splice(a),a--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),c))}};return e.all=function(t){function a(e){r._status!==i&&(n=[],r.reject(e))}var r=new e,c=t.length,n=[];if(0===c)return r.resolve(n),r;for(var s=0,o=t.length;sr&&(r=n.length)}for(var i=0,c=t.length;i>2,l=(3&n)<<4|s>>4,h=i+1>6:64,u=i+2=l||T<=0)return void e("Bad shading domain.");for(var M=f;M<=l;M+=T){var D=o.getRgb(S([M]),0),E=ce.makeCssRgb(D);R.push([(M-f)/O,E])}var P="transparent";if(r.has("Background")){var D=o.getRgb(r.get("Background"),0);P=ce.makeCssRgb(D)}u||(R.unshift([0,P]),R[1][0]+=le.SMALL_NUMBER),d||(R[R.length-1][0]-=le.SMALL_NUMBER,R.push([1,P])),this.colorStops=R}return r.fromIR=function(e){var t=e[1],a=e[2],r=e[3],i=e[4],c=e[5],n=e[6];return{type:"Pattern",getPattern:function(e){var s;t==oe.AXIAL?s=e.createLinearGradient(r[0],r[1],i[0],i[1]):t==oe.RADIAL&&(s=e.createRadialGradient(r[0],r[1],c,i[0],i[1],n));for(var o=0,f=a.length;o>o)*l),f&=(1<a?e=a:e0&&(f=a[s-1]);var l=t[1];s=0;--s){var u=l.pop(),d=2*s;ua[d+1]&&(u=a[d+1]),h[s]=u}return n.set(f,h),h}}}}(),de=function(){function e(){this.cache={},this.total=0}var t=1024;return e.prototype={has:function(e){return e in this.cache},get:function(e){return this.cache[e]},set:function(e,a){this.total=t&&a("PostScript function stack overflow."),this.stack.push(e)},pop:function(){return this.stack.length<=0&&a("PostScript function stack underflow."),this.stack.pop()},copy:function(e){this.stack.length+e>=t&&a("PostScript function stack overflow.");for(var r=this.stack,i=r.length-e,c=e-1;c>=0;c--,i++)r.push(r[i])},index:function(e){this.push(this.stack[this.stack.length-e-1])},roll:function(e,t){var a,r,i,c=this.stack,n=c.length-e,s=c.length-1,o=n+(t-Math.floor(t/e)*e);for(a=n,r=s;a0?c.push(r<>i);break;case"ceiling":r=c.pop(),c.push(Math.ceil(r));break;case"copy":r=c.pop(),c.copy(r);break;case"cos":r=c.pop(),c.push(Math.cos(r));break;case"cvi":r=0|c.pop(),c.push(r);break;case"cvr":break;case"div":i=c.pop(),r=c.pop(),c.push(r/i);break;case"dup":c.copy(1);break;case"eq":i=c.pop(),r=c.pop(),c.push(r==i);break;case"exch":c.roll(2,1);break;case"exp":i=c.pop(),r=c.pop(),c.push(Math.pow(r,i));break;case"false":c.push(!1);break;case"floor":r=c.pop(),c.push(Math.floor(r));break;case"ge":i=c.pop(),r=c.pop(),c.push(r>=i);break;case"gt":i=c.pop(),r=c.pop(),c.push(r>i);break;case"idiv":i=c.pop(),r=c.pop(),c.push(r/i|0);break;case"index":r=c.pop(),c.index(r);break;case"le":i=c.pop(),r=c.pop(),c.push(r<=i);break;case"ln":r=c.pop(),c.push(Math.log(r));break;case"log":r=c.pop(),c.push(Math.log(r)/Math.LN10);break;case"lt":i=c.pop(),r=c.pop(),c.push(r=0&&(t>=65&&t<=90||t>=97&&t<=122);)a+=String.fromCharCode(t);switch(a.toLowerCase()){case"if":return ve.IF;case"ifelse":return ve.IFELSE;default:return ve.getOperator(a)}},getNumber:function(){for(var e=this.currentChar,t=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t+=String.fromCharCode(e);var r=parseFloat(t);return isNaN(r)&&a("Invalid floating point number: "+r),r}},e}(),ke=function(){function e(e,t,a){var r=ce.getAxialAlignedBoundingBox(t,a),i=r[0],c=r[1],n=r[2],s=r[3];if(i===n||c===s)return[1,0,0,1,e[0],e[1]];var o=(e[2]-e[0])/(n-i),f=(e[3]-e[1])/(s-c);return[o,0,0,f,e[0]-i*o,e[1]-c*f]}function t(e){var t=e.get("AP");if(k(t)){var a,r=t.get("N");if(k(r)){var i=e.get("AS");i&&r.has(i.name)&&(a=r.get(i.name))}else a=r;return a}}function a(e){if(e.data)return void(this.data=e.data);var a=e.dict,r=this.data={};r.subtype=a.get("Subtype").name;var i=a.get("Rect");r.rect=ce.normalizeRect(i),r.annotationFlags=a.get("F");var c=a.get("C");if(w(c)&&3===c.length?r.color=c:r.color=[0,0,0],a.has("BS")){var n=a.get("BS");r.borderWidth=n.has("W")?n.get("W"):1}else{var s=a.get("Border")||[0,0,1];r.borderWidth=s[2]||0}this.appearance=t(a),r.hasAppearance=!!this.appearance}return a.prototype={getData:function(){return this.data},hasHtml:function(){return!1},getHtmlElement:function(e){throw new ae("getHtmlElement() should be implemented in subclass")},getEmptyContainer:function(e,t){c(!G,"getEmptyContainer() should be called from main thread"),t=t||this.data.rect;var a=document.createElement(e);return a.style.width=Math.ceil(t[2]-t[0])+"px",a.style.height=Math.ceil(t[3]-t[1])+"px",a},isViewable:function(){var e=this.data;return!(!e||e.annotationFlags&&34&e.annotationFlags||!e.rect)},loadResources:function(e){var t=new se;return this.appearance.dict.getAsync("Resources").then(function(a){if(!a)return void t.resolve();var r=new Ge(a.map,e,a.xref);r.load().then(function(){t.resolve(a)})}.bind(this)),t},getOperatorList:function(t){var a=new se;if(!this.appearance)return a.resolve(new lt),a;var r=this.data,i=this.appearance.dict,c=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),n=i.get("BBox")||[0,0,1,1],s=i.get("Matrix")||[1,0,0,1,0,0],o=e(r.rect,n,s);r.border;return c.then(function(e){var i=new lt;i.addOp(Y.beginAnnotation,[r.rect,o,s]), t.getOperatorList(this.appearance,e,i),i.addOp(Y.endAnnotation,[]),a.resolve(i)}.bind(this)),a}},a.getConstructor=function(e,t){if(e){if("Link"===e)return Ae;if("Text"===e)return Ce;if("Widget"===e){if(!t)return;return"Tx"===t?Se:xe}return a}},a.fromData=function(e){var t=e.subtype,r=e.fieldType,i=a.getConstructor(t,r);if(i)return new i({data:e})},a.fromRef=function(e,t){var i=e.fetchIfRef(t);if(k(i)){var c=i.get("Subtype");if(c=v(c)?c.name:""){var n=ce.getInheritableProperty(i,"FT");n=v(n)?n.name:"";var s=a.getConstructor(c,n);if(s){var o={dict:i,ref:t},f=new s(o);return f.isViewable()?f:void r("unimplemented annotation type: "+c)}}}},a.appendToOperatorList=function(e,t,a,r){function i(e){c.reject(e)}for(var c=new se,n=[],s=0,o=e.length;s=2&&c.onHeadersReceived&&(c.onHeadersReceived(),delete c.onHeadersReceived),4===n.readyState&&e in this.pendingRequests){if(delete this.pendingRequests[e],0===n.status&&/^https?:/i.test(this.url))return void(c.onError&&c.onError(n.status));var s=n.status||a,o=s===a&&c.expectedStatus===r;if(!o&&s!==c.expectedStatus)return void(c.onError&&c.onError(n.status));this.loadedRequests[e]=!0;var f=t(n);if(s===r){var l=n.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(l),u=parseInt(h[1],10);c.onDone({begin:u,chunk:f})}else c.onDone({begin:0,chunk:f})}}},hasPendingRequests:function(){for(var e in this.pendingRequests)return!0;return!1},getRequestXhr:function(e){return this.pendingRequests[e].xhr},isPendingRequest:function(e){return e in this.pendingRequests},isLoadedRequest:function(e){return e in this.loadedRequests},abortAllRequests:function(){for(var e in this.pendingRequests)this.abortRequest(0|e)},abortRequest:function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},e}(),Ie=function(){function e(e,t,a){this.bytes=new Uint8Array(e),this.start=0,this.pos=0,this.end=e,this.chunkSize=t,this.loadedChunks=[],this.numChunksLoaded=0,this.numChunks=Math.ceil(e/t),this.manager=a,this.initialDataLength=0}return e.prototype={getMissingChunks:function(){for(var e=[],t=0,a=this.numChunks;t=t||t<=this.initialDataLength))for(var a=this.chunkSize,r=Math.floor(e/a),i=Math.floor((t-1)/a)+1,c=r;c=this.end?-1:(this.ensureRange(e,e+1),this.bytes[this.pos++])},getBytes:function(e){var t=this.bytes,a=this.pos,r=this.end;if(!e)return this.ensureRange(a,r),t.subarray(a,r);var i=a+e;return i>r&&(i=r),this.ensureRange(a,i),this.pos=i,t.subarray(a,i)},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},getByteRange:function(e,t){return this.ensureRange(e,t),this.bytes.subarray(e,t)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(e,t,a){function r(){}r.prototype=Object.create(this),r.prototype.getMissingChunks=function(){for(var e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,r=[],i=t;i=0&&r+1!==c&&(t.push({beginChunk:a,endChunk:r+1}),a=c),i+1===e.length&&t.push({beginChunk:a,endChunk:c+1}),r=c}return t},onProgress:function(e){var t=this.stream.numChunksLoaded*this.chunkSize+e.loaded;this.msgHandler.send("DocProgress",{loaded:t,total:this.length})},onReceiveData:function(e){var t=e.chunk,a=e.begin,r=a+t.byteLength,i=this.getBeginChunk(a),c=this.getEndChunk(r);this.stream.onReceiveData(a,t),this.stream.allChunksLoaded()&&this.loadedStream.resolve(this.stream);for(var n=[],t=i;t=360?e%=360:e<0&&(e=(e%360+360)%360),o(this,"rotate",e)},getContentStream:function(){var e,t=this.content;if(w(t)){var a,r=this.xref,i=t.length,c=[];for(a=0;a0,"stream must have data"),this.pdfManager=e,this.stream=t;var r=new ze(this.stream,a,e);this.xref=r}function i(e,t,a,r){var i=e.pos,c=e.end,n="";i+a>c&&(a=c-i);for(var s=0;s0;)n-=r-"startxref".length,n<0&&(n=0),e.pos=n,c=i(e,"startxref",r,!0);if(c){e.skip(9);var s;do s=e.getByte();while(ra.isSpace(s));for(var f="";s>=32&&s<=57;)f+=String.fromCharCode(s),s=e.getByte();t=parseInt(f,10),isNaN(t)&&(t=0)}}return o(this,"startXRef",t)},get mainXRefEntriesOffset(){var e=0,t=this.linearization;return t&&(e=t.mainXRefEntriesOffset),o(this,"mainXRefEntriesOffset",e)},checkHeader:function(){var e=this.stream;if(e.reset(),i(e,"%PDF-",1024)){e.moveStart();for(var t,a=12,r="";(t=e.getByte())>32&&!(r.length>=a);)r+=String.fromCharCode(t);return void(this.pdfFormatVersion=r.substring(5))}},parseStartXRef:function(){var e=this.startXRef;this.xref.setStartXRef(e)},setup:function(e){this.xref.parse(e),this.catalog=new Ue(this.pdfManager,this.xref)},get numPages(){var e=this.linearization,t=e?e.numPages:this.catalog.numPages;return o(this,"numPages",t)},get documentInfo(){var t,a={PDFFormatVersion:this.pdfFormatVersion,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa};try{t=this.xref.trailer.get("Info")}catch(r){e("The document information dictionary is invalid.")}if(t){var i=c.entries;for(var n in i)if(t.has(n)){var s=t.get(n);i[n](s)?a[n]="string"!=typeof s?s:h(s):e('Bad value in document info for "'+n+'"')}}return o(this,"documentInfo",a)},get fingerprint(){var e,t=this.xref,a="";e=t.trailer.has("ID")?l(t.trailer.get("ID")[0]):it(this.stream.bytes.subarray(0,100),0,100);for(var r=0,i=e.length;r0;){var n=c.shift(),s=e.fetchIfRef(n.obj);if(null!==s){s.has("Title")||a("Invalid outline item");var o=s.get("A");o?o=o.get("D"):s.has("Dest")&&(o=s.getRaw("Dest"),v(o)&&(o=o.name));var f=s.get("Title"),l={dest:o,title:h(f),color:s.get("C")||[0,0,0],count:s.get("Count"),bold:!!(2&s.get("F")),italic:!!(1&s.get("F")),items:[]};n.parent.items.push(l),t=s.getRaw("First"),C(t)&&!i.has(t)&&(c.push({obj:t,parent:l}),i.put(t)),t=s.getRaw("Next"),C(t)&&!i.has(t)&&(c.push({obj:t,parent:n.parent}),i.put(t))}}}}return r.items.length>0?r.items:null},get numPages(){var e=this.toplevelPagesDict.get("Count");return s(m(e),"page count in top level pages object is not an integer"),o(this,"num",e)},get destinations(){function e(e){return k(e)?e.get("D"):e}var t,a,r=this.xref,i={},c=this.catDict.get("Names");if(c?t=c.getRaw("Dests"):this.catDict.has("Dests")&&(a=this.catDict.get("Dests")),a&&(c=a,c.forEach(function(t,a){a&&(i[t]=e(a))})),t){var n=new He(t,r),s=n.getAll();for(var f in s)s.hasOwnProperty(f)&&(i[f]=e(s[f]))}return o(this,"destinations",i)},get javaScript(){var e=this.xref,t=this.catDict.get("Names"),a=[];if(t&&t.has("JavaScript")){var r=new He(t.getRaw("JavaScript"),e),i=r.getAll();for(var c in i)if(i.hasOwnProperty(c)){var n=i[c];if(k(n)){var s=n.get("S");if(v(s)&&"JavaScript"===s.name){var l=n.get("JS");(b(l)||x(l))&&(x(l)&&(l=f(l.getBytes())),a.push(h(l)))}}}}return o(this,"javaScript",a)},cleanup:function(){this.fontCache.forEach(function(e){delete e.sent,delete e.translated}),this.fontCache.clear()},getPage:function(e){return e in this.pagePromises||(this.pagePromises[e]=this.getPageDict(e).then(function(t){var a=t[0],r=t[1];return new Re(this.pdfManager,this.xref,e,a,r,this.fontCache)}.bind(this))),this.pagePromises[e]},getPageDict:function(e){function t(){for(;r.length;){var s=r.pop();if(C(s))return void n.fetchAsync(s).then(function(c){return k(c,"Page")||k(c)&&!c.has("Kids")?void(e===i?a.resolve([c,s]):(i++,t())):(r.push(c),void t())}.bind(this),a.reject.bind(a));c(k(s),"page dictionary kid reference points to wrong type of object");var o=s.get("Count");if(i+o<=e)i+=o;else{var f=s.get("Kids");if(c(w(f),"page dictionary kids object is not an array"),o!==f.length)for(var l=f.length-1;l>=0;l--)r.push(f[l]);else r=[f[e-i]],i=e}}a.reject("Page index "+e+" not found.")}var a=new se,r=[this.catDict.getRaw("Pages")],i=0,n=this.xref;return t(),a},getPageIndex:function(e){function t(e){var t,r=0;return i.fetchAsync(e).then(function(e){return e?(t=e.getRaw("Parent"),e.getAsync("Parent")):null}).then(function(e){return e?e.getAsync("Kids"):null}).then(function(n){if(!n)return null;for(var s=[],o=!1,f=0;f0;){var l=f[0],h=f[1];for(m(l)&&m(h)||a("Invalid XRef range fields: "+l+", "+h),m(n)&&m(s)&&m(o)||a("Invalid XRef entry fields length: "+l+", "+h),t=i.entryNum;t=e.length);)a+=String.fromCharCode(r),r=e[t];return a}function t(e,t,a){for(var r=a.length,i=e.length,c=0;t=r)break;t++,c++}return c}var a=new Uint8Array([116,114,97,105,108,101,114]),r=new Uint8Array([115,116,97,114,116,120,114,101,102]),i=new Uint8Array([101,110,100,111,98,106]),c=new Uint8Array([47,88,82,101,102]),n=this.stream; n.pos=0;for(var s=n.getBytes(),o=n.start,f=s.length,l=[],h=[];o=f)break;u=s[o]}while(13!==u&&10!==u);else++o}for(var v=0,w=h.length;v0;){var c,n,s=t.fetchIfRef(i.shift());if(k(s))if(s.has("Kids")){var o=s.get("Kids");for(c=0,n=o.length;cc&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var n=r<=8?new Uint8Array(c):new Uint16Array(c),s=0;s255?255:i,a[r]=a[r+1]=a[r+2]=i},getRgbBuffer:function(e,t,a,r,i,c){for(var n=255/((1<255?255:i,a[r+1]=c<0?0:c>255?255:c,a[r+2]=n<0?0:n>255?255:n},getRgbBuffer:function(e,t,a,r,i,c){var n=3*a;if(8==c)return void r.set(e.subarray(t,t+n),i);for(var s=255/((1<255?255:f<0?0:f,r[i+1]=l>255?255:l<0?0:l,r[i+2]=h>255?255:h<0?0:h}function t(){this.name="DeviceCMYK",this.numComps=4,this.defaultColor=new Float32Array([0,0,0,1])}return t.prototype={getRgb:function(t,a){var r=new Uint8Array(3);return e(t,a,1,r,0),r},getRgbItem:function(t,a,r,i){e(t,a,1,r,i)},getRgbBuffer:function(t,a,r,i,c,n){for(var s=1/((1<>2)},isPassthrough:Je.prototype.isPassthrough,createRgbBuffer:Je.prototype.createRgbBuffer,isDefaultDecode:function(e){return Je.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},t}(),tt=function(){function t(t,i,c){this.name="CalGray",this.numComps=3,this.defaultColor=new Float32Array([0,0,0]),t||a("WhitePoint missing - required for color space CalGray"),i=i||[0,0,0],c=c||1,this.XW=t[0],this.YW=t[1],this.ZW=t[2],this.XB=i[0],this.YB=i[1],this.ZB=i[2],this.G=c,(this.XW<0||this.ZW<0||1!==this.YW)&&a("Invalid WhitePoint components for "+this.name+", no fallback available"),(this.XB<0||this.YB<0||this.ZB<0)&&(e("Invalid BlackPoint for "+this.name+", falling back to default"),this.XB=this.YB=this.ZB=0),0===this.XB&&0===this.YB&&0===this.ZB||r(this.name+", BlackPoint: XB: "+this.XB+", YB: "+this.YB+", ZB: "+this.ZB+", only default values are supported."),this.G<1&&(e("Invalid Gamma: "+this.G+" for "+this.name+", falling back to default"),this.G=1)}return t.prototype={getRgb:function(e,t){var a=new Uint8Array(3);return this.getRgbItem(e,t,a,0),a},getRgbItem:function(e,t,a,r){var i=e[t],c=Math.pow(i,this.G),n=(this.XW*c,this.YW*c),s=(this.ZW*c,n),o=Math.max(116*Math.pow(s,1/3)-16,0);a[r]=255*o/100,a[r+1]=255*o/100,a[r+2]=255*o/100},getRgbBuffer:function(e,t,a,r,i,c){for(var n=255/((1<this.amax||this.bmin>this.bmax)&&(e("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}function r(e){return e>=6/29?e*e*e:108/841*(e-4/29)}function i(e,t,a,r){return a+e*(r-a)/t}function c(e,t,a,c,n,s){var o=t[a],f=t[a+1],l=t[a+2];c!==!1&&(o=i(o,c,0,100),f=i(f,c,e.amin,e.amax),l=i(l,c,e.bmin,e.bmax)),f=f>e.amax?e.amax:fe.bmax?e.bmax:l1?1:h),n[s+1]=255*Math.sqrt(u<0?0:u>1?1:u),n[s+2]=255*Math.sqrt(d<0?0:d>1?1:d)}return t.prototype={getRgb:function(e,t){var a=new Uint8Array(3);return c(this,e,t,!1,a,0),a},getRgbItem:function(e,t,a,r){c(this,e,t,!1,a,r)},getRgbBuffer:function(e,t,a,r,i,n){for(var s=(1<>5&255,d[c++]=i>>13&255,d[c++]=i>>21&255,d[c++]=i>>>29&255,d[c++]=0,d[c++]=0,d[c++]=0;var g=new Int32Array(16);for(c=0;c>>32-S)|0,b=w}o=o+b|0,f=f+v|0,l=l+y|0,h=h+k|0}return new Uint8Array([255&o,o>>8&255,o>>16&255,o>>>24&255,255&f,f>>8&255,f>>16&255,f>>>24&255,255&l,l>>8&255,l>>16&255,l>>>24&255,255&h,h>>8&255,h>>16&255,h>>>24&255])}var t=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),a=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return e}(),ct=function(){function e(){}return e.prototype={decryptBlock:function(e){return e}},e}(),nt=function(){function e(e){var t=176,a=new Uint8Array(t);a.set(e);for(var r=16,n=1;r=1;--r){for(o=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=o,o=a[14],f=a[10],a[14]=a[6],a[10]=a[2],a[6]=o,a[2]=f,o=a[15],f=a[11],l=a[7],a[15]=a[3],a[11]=o,a[7]=f,a[3]=l,i=0;i<16;++i)a[i]=n[a[i]];for(i=0,c=16*r;i<16;++i,++c)a[i]^=t[c];for(i=0;i<16;i+=4){var h=s[a[i]],u=s[a[i+1]],d=s[a[i+2]],g=s[a[i+3]];o=h^u>>>8^u<<24^d>>>16^d<<16^g>>>24^g<<8,a[i]=o>>>24&255,a[i+1]=o>>16&255,a[i+2]=o>>8&255,a[i+3]=255&o}}for(o=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=o,o=a[14],f=a[10],a[14]=a[6],a[10]=a[2],a[6]=o,a[2]=f,o=a[15],f=a[11],l=a[7],a[15]=a[3],a[11]=o,a[7]=f,a[3]=l,i=0;i<16;++i)a[i]=n[a[i]],a[i]^=t[i];return a}function a(t){this.key=e(t),this.buffer=new Uint8Array(16),this.bufferPosition=0}function r(e,a){var r,i,c,n=e.length,s=this.buffer,o=this.bufferPosition,f=[],l=this.iv;for(r=0;r>8&255,u[d++]=i>>16&255,u[d++]=i>>>24&255,f=0,l=e.length;f=4&&!o&&(u[d++]=255,u[d++]=255,u[d++]=255,u[d++]=255);var g=it(u,0,d),m=s>>3;if(c>=3)for(f=0;f<50;++f)g=it(g,0,m);var p,b,v=g.subarray(0,m);if(c>=3){for(d=0;d<32;++d)u[d]=n[d];for(f=0,l=e.length;f>3;if(a>=3)for(i=0;i<50;++i)f=it(f,0,f.length);var h,u;if(a>=3){u=t;var d,g=new Uint8Array(l);for(i=19;i>=0;i--){for(d=0;d>8&255,n[i++]=e>>16&255,n[i++]=255&t,n[i++]=t>>8&255,r&&(n[i++]=115,n[i++]=65,n[i++]=108,n[i++]=84);var s=it(n,0,i);return s.subarray(0,Math.min(a.length+5,16))}function c(e,t,r,c,n){var s,o=e.get(t.name);return null!==o&&void 0!==o&&(s=o.get("CFM")),s&&"None"!=s.name?"V2"==s.name?function(){return new rt(i(r,c,n,!1))}:"AESV2"==s.name?function(){return new nt(i(r,c,n,!0))}:void a("Unknown crypto method"):function(){return new ct}}var n=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]),s=new De("Identity");return r.prototype={createCipherTransform:function(e,t){if(4==this.algorithm)return new st(c(this.cf,this.stmf,e,t,this.encryptionKey),c(this.cf,this.strf,e,t,this.encryptionKey));var a=i(e,t,this.encryptionKey,!1),r=function(){return new rt(a)};return new st(r,r)}},r}(),ft=function(){function i(e,t,a,r,i,c,n){this.state=new ut,this.stateStack=[],this.pdfManager=e,this.xref=t,this.handler=a,this.pageIndex=r,this.uniquePrefix=i,this.idCounters=c,this.fontCache=n}var n={w:{id:Y.setLineWidth,numArgs:1,variableArgs:!1},J:{id:Y.setLineCap,numArgs:1,variableArgs:!1},j:{id:Y.setLineJoin,numArgs:1,variableArgs:!1},M:{id:Y.setMiterLimit,numArgs:1,variableArgs:!1},d:{id:Y.setDash,numArgs:2,variableArgs:!1},ri:{id:Y.setRenderingIntent,numArgs:1,variableArgs:!1},i:{id:Y.setFlatness,numArgs:1,variableArgs:!1},gs:{id:Y.setGState,numArgs:1,variableArgs:!1},q:{id:Y.save,numArgs:0,variableArgs:!1},Q:{id:Y.restore,numArgs:0,variableArgs:!1},cm:{id:Y.transform,numArgs:6,variableArgs:!1},m:{id:Y.moveTo,numArgs:2,variableArgs:!1},l:{id:Y.lineTo,numArgs:2,variableArgs:!1},c:{id:Y.curveTo,numArgs:6,variableArgs:!1},v:{id:Y.curveTo2,numArgs:4,variableArgs:!1},y:{id:Y.curveTo3,numArgs:4,variableArgs:!1},h:{id:Y.closePath,numArgs:0,variableArgs:!1},re:{id:Y.rectangle,numArgs:4,variableArgs:!1},S:{id:Y.stroke,numArgs:0,variableArgs:!1},s:{id:Y.closeStroke,numArgs:0,variableArgs:!1},f:{id:Y.fill,numArgs:0,variableArgs:!1},F:{id:Y.fill,numArgs:0,variableArgs:!1},"f*":{id:Y.eoFill,numArgs:0,variableArgs:!1},B:{id:Y.fillStroke,numArgs:0,variableArgs:!1},"B*":{id:Y.eoFillStroke,numArgs:0,variableArgs:!1},b:{id:Y.closeFillStroke,numArgs:0,variableArgs:!1},"b*":{id:Y.closeEOFillStroke,numArgs:0,variableArgs:!1},n:{id:Y.endPath,numArgs:0,variableArgs:!1},W:{id:Y.clip,numArgs:0,variableArgs:!1},"W*":{id:Y.eoClip,numArgs:0,variableArgs:!1},BT:{id:Y.beginText,numArgs:0,variableArgs:!1},ET:{id:Y.endText,numArgs:0,variableArgs:!1},Tc:{id:Y.setCharSpacing,numArgs:1,variableArgs:!1},Tw:{id:Y.setWordSpacing,numArgs:1,variableArgs:!1},Tz:{id:Y.setHScale,numArgs:1,variableArgs:!1},TL:{id:Y.setLeading,numArgs:1,variableArgs:!1},Tf:{id:Y.setFont,numArgs:2,variableArgs:!1},Tr:{id:Y.setTextRenderingMode,numArgs:1,variableArgs:!1},Ts:{id:Y.setTextRise,numArgs:1,variableArgs:!1},Td:{id:Y.moveText,numArgs:2,variableArgs:!1},TD:{id:Y.setLeadingMoveText,numArgs:2,variableArgs:!1},Tm:{id:Y.setTextMatrix,numArgs:6,variableArgs:!1},"T*":{id:Y.nextLine,numArgs:0,variableArgs:!1},Tj:{id:Y.showText,numArgs:1,variableArgs:!1},TJ:{id:Y.showSpacedText,numArgs:1,variableArgs:!1},"'":{id:Y.nextLineShowText,numArgs:1,variableArgs:!1},'"':{id:Y.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1},d0:{id:Y.setCharWidth,numArgs:2,variableArgs:!1},d1:{id:Y.setCharWidthAndBounds,numArgs:6,variableArgs:!1},CS:{id:Y.setStrokeColorSpace,numArgs:1,variableArgs:!1},cs:{id:Y.setFillColorSpace,numArgs:1,variableArgs:!1},SC:{id:Y.setStrokeColor,numArgs:4,variableArgs:!0},SCN:{id:Y.setStrokeColorN,numArgs:33,variableArgs:!0},sc:{id:Y.setFillColor,numArgs:4,variableArgs:!0},scn:{id:Y.setFillColorN,numArgs:33,variableArgs:!0},G:{id:Y.setStrokeGray,numArgs:1,variableArgs:!1},g:{id:Y.setFillGray,numArgs:1,variableArgs:!1},RG:{id:Y.setStrokeRGBColor,numArgs:3,variableArgs:!1},rg:{id:Y.setFillRGBColor,numArgs:3,variableArgs:!1},K:{id:Y.setStrokeCMYKColor,numArgs:4,variableArgs:!1},k:{id:Y.setFillCMYKColor,numArgs:4,variableArgs:!1},sh:{id:Y.shadingFill,numArgs:1,variableArgs:!1},BI:{id:Y.beginInlineImage,numArgs:0,variableArgs:!1},ID:{id:Y.beginImageData,numArgs:0,variableArgs:!1},EI:{id:Y.endInlineImage,numArgs:1,variableArgs:!1},Do:{id:Y.paintXObject,numArgs:1,variableArgs:!1},MP:{id:Y.markPoint,numArgs:1,variableArgs:!1},DP:{id:Y.markPointProps,numArgs:2,variableArgs:!1},BMC:{id:Y.beginMarkedContent,numArgs:1,variableArgs:!1},BDC:{id:Y.beginMarkedContentProps,numArgs:2,variableArgs:!1},EMC:{id:Y.endMarkedContent,numArgs:0,variableArgs:!1},BX:{id:Y.beginCompat,numArgs:0,variableArgs:!1},EX:{id:Y.endCompat,numArgs:0,variableArgs:!1},BM:null,BD:null,"true":null,fa:null,fal:null,fals:null,"false":null,nu:null,nul:null,"null":null},o=1,f=2;return i.prototype={hasBlendModes:function(e){if(!k(e))return!1;for(var t=[e];t.length;){var a=t.shift(),r=a.get("ExtGState");if(k(r)){r=r.getAll();for(var i in r){var c=r[i],n=c.BM;if(v(n)&&"Normal"!==n.name)return!0}}var s=a.get("XObject");if(k(s)){s=s.getAll();for(var i in s){var o=s[i];if(x(o)){var f=o.dict.get("Resources");k(f)&&t.push(f)}}}}return!1},buildFormXObject:function(e,t,a,r){var i=t.dict.get("Matrix"),c=t.dict.get("BBox"),n=t.dict.get("Group");if(n){var s={matrix:i,bbox:c,smask:!!a,isolated:!1,knockout:!1},o=n.get("S");v(o)&&"Transparency"===o.name&&(s.isolated=n.get("I")||!1,s.knockout=n.get("K")||!1),r.addOp(Y.beginGroup,[s])}r.addOp(Y.paintFormXObjectBegin,[i,c]),this.getOperatorList(t,t.dict.get("Resources")||e,r),r.addOp(Y.paintFormXObjectEnd,[]),n&&r.addOp(Y.endGroup,[s])},buildPaintImageXObject:function(e,a,r,i){var c=this,n=a.dict,s=n.get("Width","W"),o=n.get("Height","H");if(PDFJS.maxImageSize!==-1&&s*o>PDFJS.maxImageSize)return void t("Image exceeded maximum allowed size and was removed.");var f=n.get("ImageMask","IM")||!1;if(f){var l=n.get("Width","W"),h=n.get("Height","H"),u=l+7>>3,d=a.getBytes(u*h),g=n.get("Decode","D"),m=!!g&&g[0]>0;return void i.addOp(Y.paintImageMaskXObject,[$t.createMask(d,l,h,m)])}var p=n.get("SMask","SM")||!1,b=n.get("Mask")||!1,v=200;if(r&&!p&&!b&&!(a instanceof la)&&s+oS.numArgs&&e("Command "+C+": expected [0,"+S.numArgs+"] args, but received "+m.length+" args");else{if(m.lengthS.numArgs&&e("Command "+C+": expected "+S.numArgs+" args, but received "+m.length+" args")}switch(C){case Y.setStrokeColorN:case Y.setFillColorN:if(m[m.length-1].code)break;var A,B=m[m.length-1];if(v(B)&&(A=d.get(B.name))){var I=x(A)?A.dict:A,q=I.get("PatternType");if(q==o){l.handleTilingType(C,m,i,A,I,c),m=[];continue}if(q==f){var L=I.get("Shading"),O=I.get("Matrix"),A=fe.parseShading(L,O,h,i);m=A.getIR()}else a("Unkown PatternType "+q)}break;case Y.paintXObject:if(m[0].code)break;var T=m[0].name,R=u.get(T);if(R){s(x(R),"XObject should be a stream");var M=R.dict.get("Subtype");if(s(v(M),"XObject should have a Name subtype"),"Form"==M.name){l.buildFormXObject(i,R,null,c),m=[];continue}if("Image"==M.name){l.buildPaintImageXObject(i,R,!1,c),m=[];continue}a("Unhandled XObject subtype "+M.name)}break;case Y.setFont:var D=l.handleSetFont(i,m,null,c);c.addDependency(D),m[0]=D;break;case Y.endInlineImage:l.buildPaintImageXObject(i,m[0],!0,c),m=[];continue;case Y.save:var E=this.state;this.stateStack.push(this.state),this.state=E.clone();break;case Y.restore:var P=this.stateStack.pop();P&&(this.state=P);break;case Y.showText:m[0]=this.handleText(m[0]);break;case Y.showSpacedText:for(var F=m[0],N=F.length,j=0;j0){var I=-C[A]/p.spaceWidth;if(I>o)for(I=Math.round(I);I--;)m+=" ";else I>n&&(m+=" ")}break;case"Tj":m+=j(g[0],p);break;case"'":m+=j(g[0],p);break;case'"':m+=j(g[2],p);break;case"Do":if(m="",g[0].code)break;u||(u=t.get("XObject")||new Pe);var q=g[0].name,L=u.get(q);if(!L)break;s(x(L),"XObject should be a stream");var O=L.dict.get("Subtype");if(s(v(O),"XObject should have a Name subtype"),"Form"!==O.name)break;a=this.getTextContent(L,L.dict.get("Resources")||t,a);break;case"gs":var T=g[0],R=t.get("ExtGState");if(!k(R)||!R.has(T.name))break;for(var M=R.get(T.name),D=0;D>1;a[n]=c}}return a},extractWidths:function(e,t,a,r){var i,c=[],n=0,s=[];if(r.composite){n=e.get("DW")||1e3;var o=e.get("W");if(o)for(var f=0,l=o.length;f>2,c);if(hn&&(u=Math.max(u,m),p+=g+2*s,m=0,g=0),d.push({transform:v,x:m,y:p,w:y.width,h:y.height}),m+=y.width+2*s,g=Math.max(g,y.height)}for(var k=Math.max(u,m)+s,x=p+g+s,S=new Uint8Array(k*x*4),C=k<<2,b=0;b=0;)A[q-4]=A[q],A[q-3]=A[q+1],A[q-2]=A[q+2],A[q-1]=A[q+3],A[q+B]=A[q+B-4],A[q+B+1]=A[q+B-3],A[q+B+2]=A[q+B-2],A[q+B+3]=A[q+B-1],q-=C}t(a,l,4*h,Y.paintInlineImageXObjectGroup),r.splice(l,4*h,[{width:k,height:x,data:S},d]),o=l,f=r.length}for(var T=10,R=100,o=0,f=r.length;o>2,R);if(h=a&&this.flush()):(this.fnArray.push(e),this.argsArray.push(t))},addDependency:function(e){e in this.dependencies||(this.dependencies[e]=!0,this.addOp(Y.dependency,[e]))},addDependencies:function(e){for(var t in e)this.addDependency(t)},addOpList:function(e){ce.extendObj(this.dependencies,e.dependencies);for(var t=0,a=e.length;t1?i[1]:i[0],i=i.split(/[-,_]/g)[0],this.isSerifFont=!!(r.flags&yt.Serif),this.isSymbolicFont=!!(r.flags&yt.Symbolic),this.isMonospace=!!(r.flags&yt.FixedPitch);var c=r.type;if(this.type=c,this.fallbackName=this.isMonospace?"monospace":this.isSerifFont?"serif":"sans-serif",this.differences=r.differences,this.widths=r.widths,this.defaultWidth=r.defaultWidth,this.composite=r.composite,this.wideChars=r.wideChars,this.hasEncoding=r.hasEncoding,this.cmap=r.cmap,this.fontMatrix=r.fontMatrix,"Type3"==r.type)return void(this.encoding=r.baseEncoding);if(this.loadCidToUnicode(r),this.cidEncoding=r.cidEncoding,this.vertical=r.vertical,this.vertical&&(this.vmetrics=r.vmetrics,this.defaultVMetrics=r.defaultVMetrics),r.toUnicode&&r.toUnicode.length>0?this.toUnicode=r.toUnicode:this.rebuildToUnicode(r),this.toFontChar=this.buildToFontChar(this.toUnicode),!t){var n=e.replace(/[,_]/g,"-");return n=wt[n]||xt[n]||n,this.bold=n.search(/bold/gi)!=-1,this.italic=n.search(/oblique/gi)!=-1||n.search(/italic/gi)!=-1,this.black=e.search(/Black/g)!=-1,this.remeasure=Object.keys(this.widths).length>0,this.encoding=r.baseEncoding,this.noUnicodeAdaptation=!0,this.loadedName=n.split("-")[0],void(this.loading=!1)}var s=r.subtype;"Type1C"==s&&"Type1"!=c&&"MMType1"!=c&&(c="Type1"),"CIDFontType0C"==s&&"CIDFontType0"!=c&&(c="CIDFontType0"),"OpenType"===s&&(c="OpenType");var o;switch(c){case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var f="Type1C"==s||"CIDFontType0C"==s?new Pt(t,r):new Et(e,t,r);U(r),o=this.convert(e,f,r);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",o=this.checkAndRepair(e,t,r);break;default:a("Font "+c+" is not supported")}this.data=o,this.fontMatrix=r.fontMatrix,this.widths=r.widths,this.defaultWidth=r.defaultWidth,this.encoding=r.baseEncoding,this.seacMap=r.seacMap,this.loading=!0}function c(e){for(var t=[],a=0,r=e.length;a=2;)a/=2,t++;a=2;for(var r=1;r>8&255)+String.fromCharCode(255&e)}function d(e){return e=e>32767?32767:e<-32768?-32768:e,String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)}function g(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)}function m(e,t,a){"true"==e&&(e=g(65536));var r=e;r+=u(a);var i=h(a),c=16*i;r+=u(c),r+=u(Math.log(i)/Math.log(2)),r+=u(16*a-c),t.file+=r,t.virtualOffset+=r.length}function v(e,t,a){for(var r=e.virtualOffset,i=a.length;3&a.length;)a.push(0);for(;3&e.virtualOffset;)e.virtualOffset++;for(var c=0,n=a.length,s=0;s65535?2:1,i="\0\0"+u(r)+"\0\0"+g(4+8*r),n=a.length-1;n>=0&&!(a[n][0]<=65535);--n);var s=n+1;a[n][0]<65535&&65535===a[n][1]&&(a[n][1]=65534);for(var o=a[n][1]<65535?1:0,f=s+o,l=2*f,d=2*h(f),m=Math.log(f)/Math.log(2),p=2*f-d,b="",v="",k="",w="",x="",S=0,n=0,C=s;n0&&(v+="ÿÿ",b+="ÿÿ",k+="\0",w+="\0\0");var D="\0\0"+u(l)+u(d)+u(m)+u(p)+v+"\0\0"+b+k+w+x,E="",P="";if(r>1){i+="\0\0\n"+g(4+8*r+4+D.length),E="";for(var n=0,C=a.length;nc)return!1;t.getBytes(6);var n=s(t.getBytes(2));return 0!==n&&(e.data[8]=e.data[9]=0,!0)}function S(e,t,r){r=r||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var i=0,c=0,n=0,s=0,o=null,f=0;if(t)for(var l=0;lh||!o)&&(o=h),f 123 are reserved for internal usage")}else o=0,f=255;var m=e.bbox||[0,0,0,0],p=r.unitsPerEm||1/(e.fontMatrix||W)[0],b=e.ascentScaled?1:p/pt,v=r.ascent||Math.round(b*(e.ascent||m[3])),y=r.descent||Math.round(b*(e.descent||m[1]));y>0&&e.descent>0&&m[1]<0&&(y=-y);var k=r.yMax||v,w=-r.yMin||-y;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+g(i)+g(c)+g(n)+g(s)+"*21*"+u(e.italicAngle?1:0)+u(o||e.firstChar)+u(f||e.lastChar)+u(v)+u(y)+"\0d"+u(k)+u(w)+"\0\0\0\0\0\0\0\0"+u(e.xHeight)+u(e.capHeight)+u(0)+u(o||e.firstChar)+"\0"}function C(e){var t=Math.floor(e.italicAngle*Math.pow(2,16));return"\0\0\0"+g(t)+"\0\0\0\0"+g(e.fixedPitch)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function A(e,t){t||(t=[[],[]]);for(var a=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||"",t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],r=[],i=0,c=a.length;i>1;r.getBytes(6);var C,A=[];for(C=0;C>1)-(S-C);I.offsetIndex=L,B=Math.max(B,L+I.end-I.start+1)}else I.offsetIndex=-1}for(var O=[],w=0;wi&&(e("The numOfMetrics ("+n+") should not be greater than the numGlyphs ("+i+")"),n=i,a.data[34]=(65280&n)>>8,a.data[35]=255&n);var o=i-n,f=o-(r.length-4*n>>1);if(f>0){t.pos=(t.start?t.start:0)+r.offset;for(var l="",h=0,u=r.length;hn.length?0:!c&&d>0?(r.set(n.subarray(0,u),i),r.set([0,0],i+u),r.set(n.subarray(g,y),i+u+2),y-=d,n.length-y>3&&(y=y+3&-4),y):n.length-y>3?(y=y+3&-4,r.set(n.subarray(0,y),i),y):(r.set(n,i),n.length)}function y(a,r,i){var c=a.data,n=l([c[0],c[1],c[2],c[3]]);n>>16!==1&&(e("Attempting to fix invalid version in head table: "+n),c[0]=0,c[1]=1,c[2]=0,c[3]=0);var o=s([c[50],c[51]]);if(o<0||o>1){e("Attempting to fix invalid indexToLocFormat in head table: "+o);var f=r+1;i===f<<1?(c[50]=0,c[51]=0):i===f<<2?(c[50]=0,c[51]=1):t("Could not fix indexToLocFormat: "+o)}}function w(e,t,a,r,i,c){var n,s,o;r?(n=4,s=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},o=function(e,t,a){e[t]=a>>>24&255,e[t+1]=a>>16&255,e[t+2]=a>>8&255,e[t+3]=255&a}):(n=2,s=function(e,t){return e[t]<<9|e[t+1]<<1},o=function(e,t,a){e[t]=a>>9&255,e[t+1]=a>>1&255});var f=e.data,l=n*(1+a);f.length!==l&&(f=new Uint8Array(l),f.set(e.data.subarray(0,l)),e.data=f);var h=t.data,u=h.length,d=new Uint8Array(u),g=s(f,0),m=0;o(f,0,m);for(var p=0,v=n;pu)o(f,v,m),g=y;else{var k=b(h,g,y,d,m,i);m+=k,o(f,v,m),g=y}}if(0===m){for(var w=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]),p=0,v=n;px+m?t.data=d.subarray(0,x+m):(t.data=new Uint8Array(x+m),t.data.set(d.subarray(0,m))),t.data.set(d.subarray(0,x),m),o(e.data,f.length-n,m+x)}else t.data=d.subarray(0,m)}function I(e,a,r){var c=(i.start?i.start:0)+e.offset;i.pos=c;var n=e.length,o=c+n,f=l(i.getBytes(4));i.getBytes(28);var h,u=!0;switch(f){case 65536:h=qt;break;case 131072:var d=s(i.getBytes(2));if(d!=r){u=!1;break}for(var g=[],m=0;m=32768){u=!1;break}g.push(p)}if(!u)break;for(var b=[];i.posc)){i.pos=v;var y=b.name;b.encoding?1:0;if(b.encoding){for(var k="",w=0,x=b.length;w0&&(c+=w-1)}}else{(u||g)&&(t("TT: nested FDEFs not allowed"),h=!0),u=!0,s=c;var k=o.pop();a.functionsDefined[k]={data:i,i:c}}else if(!u&&!g){var k=o[o.length-1];if(a.functionsUsed[k]=!0,k in a.functionsStackDeltas)o.length+=a.functionsStackDeltas[k];else if(k in a.functionsDefined&&l.indexOf(k)<0){f.push({data:i,i:c,stackTop:o.length-1}),l.push(k);var y=a.functionsDefined[k];if(!y)return t("TT: CALL non-existent function"),void(a.hintsValid=!1);i=y.data,c=y.i}}if(!u&&!g){var x=p<=142?M[p]:p>=192&&p<=223?-1:p>=224?-2:0;for(p>=113&&p<=117&&(r=o.pop(),r===r&&(x=2*-r));x<0&&o.length>0;)o.pop(),x++;for(;x>0;)o.push(NaN),x--}}a.tooComplexToFollowFunctions=h;var S=[i];c>i.length&&S.push(new Uint8Array(c-i.length)),s>n&&(t("TT: complementing a missing function tail"),S.push(new Uint8Array([34,45]))),T(e,S)}function O(e,a){if(!e.tooComplexToFollowFunctions)for(var r=0,i=e.functionsUsed.length;ra)return t("TT: invalid function id: "+r),void(e.hintsValid=!1);if(e.functionsUsed[r]&&!e.functionsDefined[r])return t("TT: undefined function: "+r),void(e.hintsValid=!1)}}function T(e,t){if(t.length>1){for(var a=0,r=0,i=t.length;r=65536&&N.maxp.length>=22){i.pos+=8;var W=s(i.getBytes(2));W>2&&(N.maxp.data[14]=0,N.maxp.data[15]=2),i.pos+=4,K=s(i.getBytes(2))}var J=!1;"CIDFontType2"==o.type&&o.toUnicode&&o.toUnicode[0]>"\0"&&(J=!0,V++,N.maxp.data[4]=V>>8,N.maxp.data[5]=255&V);var Y=R(N.fpgm,N.prep,N["cvt "],K);Y||(delete N.fpgm,delete N.prep,delete N["cvt "]);var _=Object.keys(N);_.sort(),P=_.length;var Z={file:"",virtualOffset:16*P};if(m(E.version,Z,P),p(i,N.hhea,N.hmtx,V),N.head||a('Required "head" table is not found'),y(N.head,V,z?N.loca.length:0),z){var Q=s([N.head.data[50],N.head.data[51]]);w(N.loca,N.glyf,V,Q,Y,J)}if(N.hhea||a('Required "hhea" table is not found'),0===N.hhea.data[10]&&0===N.hhea.data[11]&&(N.hhea.data[10]=255,N.hhea.data[11]=255),N.post){var $=I(N.post,o,V);$||(N.post=null)}var ee,te;if("CIDFontType2"==o.type){N.cmap||(N.cmap={tag:"cmap",data:null});var ae=o.cidToGidMap||[],re=[0];if(ae.length>0){for(var ie=ae.length-1;ie>=0;ie--){var ce=ae[ie];ce&&(re[ce]=ie)}for(var ne=ae.length,j=1;j=dt+gt)break;var he=ue++;this.toFontChar[le]=he,se[he]=!0,ee.push({unicode:he,code:le}),te.push(j)}}else{this.useToFontChar=!0;var ge=g(N.cmap,i,this.hasEncoding,this.isSymbolicFont);this.isSymbolicFont=ge.isSymbolicFont;for(var me=ge.platformId,pe=ge.encodingId,be=ge.mappings,ve=be.length,ee=[],te=[],j=0;j0&&(r=this.widths[s],n=this.vmetrics&&this.vmetrics[s]),this.noUnicodeAdaptation){a=this.toFontChar[e]||e;break}a=this.toFontChar[s]||s;break;case"CIDFontType2":if(this.unicodeToCID.length>0){var s=this.unicodeToCID[e]||e;r=this.widths[s],n=this.vmetrics&&this.vmetrics[s],a=e;break}a=this.toFontChar[e]||e;break;case"MMType1":case"Type1":var o=this.differences[e]||this.encoding[e];if(p(r)||(r=this.widths[o]),this.noUnicodeAdaptation){a=D(Qt[o]||e);break}a=this.glyphNameMap[o]||Qt[o]||e;break;case"Type3":var o=this.differences[e]||this.encoding[e];i=this.charProcOperatorList[o],a=e;break;case"TrueType":if(this.useToFontChar){a=this.toFontChar[e]||e;break}var o=this.differences[e]||this.encoding[e];if(o||(o=kt.StandardEncoding[e]),p(r)||(r=this.widths[o]),this.noUnicodeAdaptation){a=Qt[o]||e;break}if(!this.hasEncoding||this.isSymbolicFont){a=this.useToFontChar?this.toFontChar[e]:e;break}a=o in this.glyphNameMap?this.glyphNameMap[o]:Qt[o];break;default:t("Unsupported font type: "+this.type)}var f="toUnicode"in this?this.toUnicode[e]||e:e;"number"==typeof f&&(f=String.fromCharCode(f)),r=p(r)?r:this.defaultWidth,c=!!this.unicodeIsEnabled&&!this.unicodeIsEnabled[a];var l=null;if(this.seacMap&&this.seacMap[a]){var h=this.seacMap[a];a=h.baseUnicode,l={fontChar:String.fromCharCode(h.accentUnicode),offset:h.accentOffset}}return{fontChar:String.fromCharCode(a),unicode:f,accent:l,width:r,vmetric:n,disabled:c,operatorList:i}},charsToGlyphs:function(e){var a,r=this.charsCache;if(r&&(a=r[e]))return a;r||(r=this.charsCache=Object.create(null)),a=[];var i,c=e,n=this.cidEncoding;if(n&&(i=At[n],i?e=i(e):0!==n.indexOf("Uni")&&0!==n.indexOf("Identity-")&&t("Unsupported CMap: "+n)),!i&&this.cmap)for(var s=0;sr)return!0;for(var i=r-e,c=i;c>8&255,255&n):(n=65536*n|0,this.output.push(255,n>>24&255,n>>16&255,n>>8&255,255&n))}return this.output.push.apply(this.output,t),a?this.stack.splice(i,e):this.stack=[],!1}},e}(),Mt=function(){function e(e,t,a){for(var r=t,i=52845,c=22719,n=[],s="",o=e.length,f=0;f>8,r=(s+r)*i+c&65535;return n.slice(a)}function t(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}function a(t,a){a&&(t=new ca(e(t.getBytes(),r,4))),this.stream=t,this.nextChar()}var r=55665,i=4330;return a.prototype={readNumberArray:function(){this.getToken();for(var e=[];;){var t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e},readNumber:function(){var e=this.getToken();return parseFloat(e||0)},readInt:function(){var e=this.getToken();return 0|parseInt(e||0,10)},readBoolean:function(){var e=this.getToken();return"true"===e?1:0},nextChar:function(){return this.currentChar=this.stream.getByte()},getToken:function(){for(var e=!1,a=this.currentChar;;){if(a===-1)return null;if(e)10!==a&&13!==a||(e=!1);else if(37===a)e=!0;else if(!ra.isSpace(a))break;a=this.nextChar()}if(t(a))return this.nextChar(),String.fromCharCode(a);var r="";do r+=String.fromCharCode(a),a=this.nextChar();while(a>=0&&!ra.isSpace(a)&&!t(a));return r},extractFontProgram:function(){for(var t,a=this.stream,r=[],c=[],n={subrs:[],charstrings:[],properties:{privateData:{lenIV:4}}};null!==(t=this.getToken());)if("/"===t)switch(t=this.getToken()){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();;){if(t=this.getToken(),null===t||"end"===t)break;if("/"===t){var s=this.getToken(),o=this.readInt();this.getToken();var f=a.makeSubStream(a.pos,o),l=n.properties.privateData.lenIV,h=e(f.getBytes(),i,l);a.skip(o),this.nextChar(),t=this.getToken(),"noaccess"===t&&this.getToken(),c.push({glyph:s,encoded:h})}}break;case"Subrs":this.readInt();for(this.getToken();"dup"===(t=this.getToken());){var u=this.readInt(),o=this.readInt();this.getToken();var f=a.makeSubStream(a.pos,o),l=n.properties.privateData.lenIV,h=e(f.getBytes(),i,l);a.skip(o),this.nextChar(),t=this.getToken(),"noaccess"===t&&this.getToken(),r[u]=h}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var d=this.readNumberArray();d.length>0&&d.length%2===0&&bt&&(n.properties.privateData[t]=d);break;case"StemSnapH":case"StemSnapV":n.properties.privateData[t]=this.readNumberArray();break;case"StdHW":case"StdVW":n.properties.privateData[t]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":n.properties.privateData[t]=this.readNumber();break;case"ForceBold":n.properties.privateData[t]=this.readBoolean()}for(var g=0;g>8&255,255&h)}c.charset=new Kt((!1),0,[],f);var u=new zt;u.add([139,14]);for(var l=0;l0;v--)b[v]-=b[v-1];d.setByName(p,b)}}c.topDict.privateDict=d;for(var y=new zt,l=0,m=r.length;l>16):29===t?(t=e[i++],t=t<<8|e[i++],t=t<<8|e[i++],t=t<<8|e[i++]):t>=32&&t<=246?t-139:t>=247&&t<=250?256*(t-247)+e[i++]+108:t>=251&&t<=254?-(256*(t-251))-e[i++]-108:(a("255 is not a valid DICT command"),-1)}function r(){for(var t="",a=15,r=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],c=e.length;i>4,o=15&n;if(s==a)break;if(t+=r[s],o==a)break;t+=r[o]}return parseFloat(t)}for(var i=0,c=[],n=[],i=0,s=e.length;i126||91===o||93===o||40===o||41===o||123===o||125===o||60===o||62===o||47===o||37===o)?n[s]=95:n[s]=o}t.push(String.fromCharCode.apply(null,n))}return t},parseStringIndex:function(e){for(var t=new Ut,a=0,r=e.count;a>16,p+=2,f++):14==b?f>=4&&(f-=4,vt&&(r[s]=l.slice(f,f+4),d=!1)):b>=32&&b<=246?(l[f]=b-139,f++):b>=247&&b<=254?(l[f]=b<251?(b-247<<8)+g[p]+108:-(b-251<<8)-g[p]-108,p++,f++):255==b?(l[f]=(g[p]<<24|g[p+1]<<16|g[p+2]<<8|g[p+3])/65536,p+=4,f++):19==b||20==b?(u+=f>>1,p+=u+7>>3,f=0):v=i[b];if(v){if(v.stem&&(u+=f>>1),"min"in v&&!h&&f=this.bytes.length)return void this.emptyPrivateDictionary(e);var i=r+a,c=this.bytes.subarray(r,i),n=this.parseDict(c),s=this.createDict(Xt,n,e.strings);if(e.privateDict=s,s.getByName("Subrs")){var o=s.getByName("Subrs"),f=r+o;if(0===o||f>=this.bytes.length)return void this.emptyPrivateDictionary(e);var l=this.parseIndex(f);s.subrsIndex=l.obj}},parseCharsets:function(e,t,r,i){if(0===e)return new Kt((!0),Vt.ISO_ADOBE,Xe);if(1==e)return new Kt((!0),Vt.EXPERT,Ve);if(2==e)return new Kt((!0),Vt.EXPERT_SUBSET,Ke);var c=this.bytes,n=e,s=c[e++],o=[".notdef"];switch(t-=1,s){case 0:for(var f=0;f=0&&e<=390?Dt[e]:e-391<=this.strings.length?this.strings[e-391]:Dt[0]},add:function(e){this.strings.push(e)},get count(){return this.strings.length}},e}(),zt=function(){function e(){this.objects=[],this.length=0}return e.prototype={add:function(e){this.length+=e.length,this.objects.push(e)},set:function(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t},get:function(e){return this.objects[e]},get count(){return this.objects.length}},e}(),Ht=function(){function e(e,t){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=t,this.values={}}return e.prototype={setByKey:function(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;var a=this.types[e];return"num"!==a&&"sid"!==a&&"offset"!==a||(t=t[0]),this.values[e]=t,!0},setByName:function(e,t){e in this.nameToKeyMap||a('Invalid dictionary name "'+e+'"'),this.values[this.nameToKeyMap[e]]=t},hasName:function(e){return this.nameToKeyMap[e]in this.values},getByName:function(e){e in this.nameToKeyMap||a('Invalid dictionary name "'+e+'"');var t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]},removeByName:function(e){delete this.values[this.nameToKeyMap[e]]}},e.createTables=function(e){for(var t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]},a=0,r=e.length;a>24&255,i[h]=g>>16&255,i[u]=g>>8&255,i[d]=255&g}}},e}(),_t=function(){function e(e){for(var t=[],a=0,r=e.length;a=-107&&e<=107?t=[e+139]:e>=108&&e<=1131?(e=[e-108],t=[(e>>8)+247,255&e]):e>=-1131&&e<=-108?(e=-e-108,t=[(e>>8)+251,255&e]):t=e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e],t},compileHeader:function(e){return[e.major,e.minor,e.hdrSize,e.offSize]},compileNameIndex:function(t){for(var a=new zt,r=0,i=t.length;r>8&255,255&r],c=1,n=0;n>8&255,255&o):3===s?i.push(o>>16&255,o>>8&255,255&o):i.push(o>>>24&255,o>>16&255,o>>8&255,255&o),a[n]&&(o+=a[n].length);for(var n=(i.length,0);n>1),f=i+n+14,l=[],h=0;h>1;a>16;(e[n+2]<<24|e[n+3]<<16)>>16,(e[n+4]<<24|e[n+5]<<16)>>16,(e[n+6]<<24|e[n+7]<<16)>>16,(e[n+8]<<24|e[n+9]<<16)>>16;if(n+=10,o<0){var f=0,l=0;do{var h=e[n]<<8|e[n+1],u=e[n+2]<<8|e[n+3];n+=4;var d,g;1&h?(d=(e[n]<<24|e[n+1]<<16)>>16,g=(e[n+2]<<24|e[n+3]<<16)>>16,n+=4):(d=e[n++],g=e[n++]),2&h?(f=d,l=g):(f=0,l=0);var m=1,p=1,b=0,v=0;8&h?(m=p=(e[n]<<24|e[n+1]<<16)/1073741824,n+=2):64&h?(m=(e[n]<<24|e[n+1]<<16)/1073741824,p=(e[n+2]<<24|e[n+3]<<16)/1073741824,n+=4):128&h&&(m=(e[n]<<24|e[n+1]<<16)/1073741824,b=(e[n+2]<<24|e[n+3]<<16)/1073741824,v=(e[n+4]<<24|e[n+5]<<16)/1073741824,p=(e[n+6]<<24|e[n+7]<<16)/1073741824,n+=8);var y=a.glyphs[u];y&&(t.push("c.save();"),t.push("c.transform("+m+","+b+","+v+","+p+","+f+","+l+");"),s(y,t,a),t.push("c.restore();"))}while(32&h)}else{for(var k=[],w=0;w0;)C.push({flags:h})}for(var f=0,l=0,w=0;w>16,n+=2;break;case 2:f-=e[n++];break;case 18:f+=e[n++]}C[w].x=f}for(var w=0;w>16,n+=2;break;case 4:l-=e[n++];break;case 36:l+=e[n++]}C[w].y=l}for(var B=0,n=0;n>1,m=!0;break;case 3:d+=l.length>>1,m=!0;break;case 4:u+=l.pop(),i(h,u),m=!0;break;case 5:for(;l.length>0;)h+=l.shift(),u+=l.shift(),c(h,u);break;case 6:for(;l.length>0&&(h+=l.shift(),c(h,u),0!==l.length);)u+=l.shift(),c(h,u);break;case 7:for(;l.length>0&&(u+=l.shift(),c(h,u),0!==l.length);)h+=l.shift(),c(h,u);break;case 8:for(;l.length>0;){var b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+l.shift(),s(b,v,y,k,h,u)}break;case 10:var w=l.pop()+r.subrsBias,x=r.subrs[w];x&&f(x);break;case 11:return;case 12:switch(p=e[g++]){case 34:var b=h+l.shift(),y=b+l.shift(),S=u+l.shift();h=y+l.shift(),s(b,u,y,S,h,S);var b=h+l.shift(),y=b+l.shift();h=y+l.shift(),s(b,S,y,u,h,u);break;case 35:var b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+l.shift(),s(b,v,y,k,h,u);var b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+l.shift(),s(b,v,y,k,h,u),l.pop();break;case 36:var b=h+l.shift(),S=u+l.shift(),y=b+l.shift(),C=S+l.shift();h=y+l.shift(),s(b,S,y,C,h,C);var b=h+l.shift(),y=b+l.shift(),A=C+l.shift();h=y+l.shift(),s(b,C,y,A,h,u);break;case 37:var B=h,I=u,b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+l.shift(),s(b,v,y,k,h,u);var b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y,u=k,Math.abs(h-B)>Math.abs(u-I)?h+=l.shift():u+=l.shift(),s(b,v,y,k,h,u);break;default:a("unknown operator: 12 "+p)}break;case 14:if(l.length>=4){var q=l.pop(),L=l.pop();u=l.pop(),h=l.pop(),t.push("c.save();"),t.push("c.translate("+h+","+u+");");var O=n(r.cmap,String.fromCharCode(r.glyphNameMap[kt.StandardEncoding[q]]));o(r.glyphs[O],t,r),t.push("c.restore();"),O=n(r.cmap,String.fromCharCode(r.glyphNameMap[kt.StandardEncoding[L]])),o(r.glyphs[O],t,r)}return;case 18:d+=l.length>>1,m=!0;break;case 19:d+=l.length>>1,g+=d+7>>3,m=!0;break;case 20:d+=l.length>>1,g+=d+7>>3,m=!0;break;case 21:u+=l.pop(),h+=l.pop(),i(h,u),m=!0;break;case 22:h+=l.pop(),i(h,u),m=!0;break;case 23:d+=l.length>>1,m=!0;break;case 24:for(;l.length>2;){var b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+l.shift(),s(b,v,y,k,h,u)}h+=l.shift(),u+=l.shift(),c(h,u);break;case 25:for(;l.length>6;)h+=l.shift(),u+=l.shift(),c(h,u);var b=h+l.shift(),v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+l.shift(),s(b,v,y,k,h,u);break;case 26:for(l.length%2&&(h+=l.shift());l.length>0;){var b=h,v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y,u=k+l.shift(),s(b,v,y,k,h,u)}break;case 27:for(l.length%2&&(u+=l.shift());l.length>0;){var b=h+l.shift(),v=u,y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k,s(b,v,y,k,h,u)}break;case 28:l.push((e[g]<<24|e[g+1]<<16)>>16),g+=2;break;case 29:var w=l.pop()+r.gsubrsBias,x=r.gsubrs[w];x&&f(x);break;case 30:for(;l.length>0;){var b=h,v=u+l.shift(),y=b+l.shift(),k=v+l.shift();if(h=y+l.shift(),u=k+(1===l.length?l.shift():0),s(b,v,y,k,h,u),0===l.length)break;var b=h+l.shift(),v=u,y=b+l.shift(),k=v+l.shift();u=k+l.shift(),h=y+(1===l.length?l.shift():0),s(b,v,y,k,h,u)}break;case 31:for(;l.length>0;){var b=h+l.shift(),v=u,y=b+l.shift(),k=v+l.shift();if(u=k+l.shift(),h=y+(1===l.length?l.shift():0),s(b,v,y,k,h,u),0===l.length)break;var b=h,v=u+l.shift(),y=b+l.shift(),k=v+l.shift();h=y+l.shift(),u=k+(1===l.length?l.shift():0),s(b,v,y,k,h,u)}break;default:p<32&&a("unknown operator: "+p),p<247?l.push(p-139):p<251?l.push(256*(p-247)+e[g++]+108):p<255?l.push(256*-(p-251)-e[g++]-108):(l.push((e[g]<<24|e[g+1]<<16|e[g+2]<<8|e[g+3])/65536),g+=4)}m&&(l.length=0)}}var l=[],h=0,u=0,d=0;f(e)}function f(e){this.compiledGlyphs={},this.fontMatrix=e}function l(e,t,a){a=a||[488e-6,0,0,488e-6,0,0],f.call(this,a),this.glyphs=e,this.cmap=t,this.compiledGlyphs=[]}function h(e,t,a,r){a=a||[.001,0,0,.001,0,0],f.call(this,a),this.glyphs=e.glyphs,this.gsubrs=e.gsubrs||[],this.subrs=e.subrs||[],this.cmap=t,this.glyphNameMap=r||Qt,this.compiledGlyphs=[],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}var u="";return f.prototype={getPathJs:function(e){var t=n(this.cmap,e),a=this.compiledGlyphs[t];return a||(this.compiledGlyphs[t]=a=this.compileGlyph(this.glyphs[t])),a},compileGlyph:function(e){if(!e||0===e.length||14===e[0])return u;var t=[];return t.push("c.save();"),t.push("c.transform("+this.fontMatrix.join(",")+");"),t.push("c.scale(size, -size);"),this.compileGlyphImpl(e,t),t.push("c.restore();"),t.join("\n")},compileGlyphImpl:function(){a("Children classes should implement this.")},hasBuiltPath:function(e){var t=n(this.cmap,e);return t in this.compiledGlyphs}},ce.inherit(l,f,{compileGlyphImpl:function(e,t){s(e,t,this)}}),ce.inherit(h,f,{compileGlyphImpl:function(e,t){o(e,t,this)}}),{create:function(a){for(var n,s,o,f,u,d,g=new Uint8Array(a.data),m=t(g,4),p=0,b=12;pr?r:e}function c(e,t,i,n,s,o,f){this.image=i,i.getParams&&r("get params from actual stream");var l=i.dict;this.width=l.get("Width","W"),this.height=l.get("Height","H"),(this.width<1||this.height<1)&&a("Invalid image width: "+this.width+" or height: "+this.height),this.interpolate=l.get("Interpolate","I")||!1,this.imageMask=l.get("ImageMask","IM")||!1,this.matte=l.get("Matte")||!1;var h=i.bitsPerComponent;if(h||(h=l.get("BitsPerComponent","BPC"),h||(this.imageMask?h=1:a("Bits per component missing in image: "+this.imageMask))),this.bpc=h,!this.imageMask){var u=l.get("ColorSpace","CS");u||(r('JPX images (which don"t require color spaces'),u=new De("DeviceRGB")),this.colorSpace=Je.parse(u,e,t),this.numComps=this.colorSpace.numComps}if(this.decode=l.get("Decode","D"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode)||f&&!Je.isDefaultDecode(this.decode,1))){this.needsDecode=!0;var d=(1<>=1;return{data:o,width:t,height:a}},c.prototype={get drawWidth(){return this.smask?Math.max(this.width,this.smask.width):this.width},get drawHeight(){return this.smask?Math.max(this.height,this.smask.height):this.height},decodeBuffer:function(e){var t,a,r=this.bpc,c=(this.decode,this.numComps),t=this.decodeAddends,a=this.decodeCoefficients,n=(1<>=1,l<=0&&(h=e[n++],l=128),s[u]=+!!(h&l);else for(var g=0,h=0,u=0,d=c;u>m;s[u]=p<0?0:p>f?f:p,h&=(1<s[b+1]){d=255;break}}i[l]=d}}else a("Unknown mask format.");else{i=new Uint8Array(e*t);for(var l=0,h=e*t;l255?255:e)}var i=this.smask&&this.smask.matte;if(i)for(var c=this.colorSpace.getRgb(i,0),n=t*a*4,s=0;s>3,f=this.getImageBytes(n*o),l=0|f.length/o*a/n,h=this.getComponents(f),u=this.getOpacity(t,a,h);this.needsDecode&&this.decodeBuffer(h);var d=this.colorSpace.createRgbBuffer(h,0,i*n,s);i==t&&n==a||(d=c.resize(d,this.bpc,3,i,n,t,a));for(var g=0,m=0,p=t*l*4,b=0;b>3,s=this.getImageBytes(i*n),o=this.getComponents(s);this.needsDecode&&this.decodeBuffer(o);for(var f=r*i,l=255/((1<>")&&!z(this.buf1);)if(v(this.buf1)){var c=this.buf1.name;if(this.shift(),z(this.buf1))break;i.set(c,this.getObj(t))}else e("Malformed dictionary, key must be a name object"),this.shift();return z(this.buf1)&&a("End of file inside dictionary"),y(this.buf2,"stream")?this.allowStreams?this.makeStream(i,t):i:(this.shift(),i)}if(m(this.buf1)){var n=this.buf1;if(this.shift(),m(this.buf1)&&y(this.buf2,"R")){var s=new Fe(n,this.buf1);return this.shift(),this.shift(),s}return n}if(b(this.buf1)){var o=this.buf1;return this.shift(),t&&(o=t.decryptString(o)),o}var f=this.buf1;return this.shift(),f},makeInlineImage:function(e){for(var t=this.lexer,r=t.stream,i=new Pe;!y(this.buf1,"ID")&&!z(this.buf1);){v(this.buf1)||a("Dictionary key must be a name object");var c=this.buf1.name;if(this.shift(),z(this.buf1))break;i.set(c,this.getObj(e))}for(var n,s,o,f=r.pos,l=0;4!=l&&(n=r.getByte())!==-1;)switch(0|n){case 32:case 13:case 10:var h=r.peekBytes(5);for(s=0,o=h.length;s127)){l=0;break}l=3===l?4:0;break;case 69:l=2;break;case 73:l=2===l?3:0;break;default:l=0}var u=r.pos-4-f,d=r.makeSubStream(f,u,i);return e&&(d=e.createStream(d)),d=this.filter(d,i,u),d.dict=i,this.buf2=Ee.get("EI"),this.shift(),d},fetchIfRef:function(e){return C(e)?this.xref.fetch(e):e},makeStream:function(t,r){var i=this.lexer,c=i.stream;i.skipToNextLine();var n=c.pos-1,s=this.fetchIfRef(t.get("Length"));if(m(s)||(e("Bad "+s+" attribute in stream"),s=0),c.pos=n+s,i.nextChar(),this.shift(),this.shift(),!y(this.buf1,"endstream")){c.pos=n;for(var o=2048,f=9,l=[101,110,100,115,116,114,101,97,109],h=0,u=!1;c.pos=f){u=!0;break}}if(u){h+=d-f,c.pos+=d-f;break}h+=b,c.pos+=b}u||a("Missing endstream"), s=h,i.nextChar(),this.shift(),this.shift()}return this.shift(),c=c.makeSubStream(n,s,t),r&&(c=r.createStream(c)),c=this.filter(c,t,s),c.dict=t,c},filter:function(e,t,r){var i=this.fetchIfRef(t.get("Filter","F")),c=this.fetchIfRef(t.get("DecodeParms","DP"));if(v(i))return this.makeFilter(e,i.name,r,c);if(w(i))for(var n=i,s=c,o=0,f=n.length;o=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?(15&e)+9:-1}e.isSpace=function(e){return 32===e||9===e||13===e||10===e};var i=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,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,2,0,2,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,2,0,2,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,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];return e.prototype={nextChar:function(){return this.currentChar=this.stream.getByte()},getNumber:function(){for(var e=!1,r=this.currentChar,i=String.fromCharCode(r);(r=this.nextChar())>=0;)if(46!==r||e)if(45===r)t("Badly formated number");else if(r>=48&&r<=57)i+=String.fromCharCode(r);else{if(69!==r&&101!==r)break;e=!0}else i+=".",e=!0;var c=parseFloat(i);return isNaN(c)&&a("Invalid floating point number: "+c),c},getString:function(){for(var e=1,a=!1,r="",i=this.nextChar();;){var c=!1;switch(0|i){case-1:t("Unterminated string"),a=!0;break;case 40:++e,r+="(";break;case 41:0===--e?(this.nextChar(),a=!0):r+=")";break;case 92:switch(i=this.nextChar()){case-1:t("Unterminated string"),a=!0;break;case 110:r+="\n";break;case 114:r+="\r";break;case 116:r+="\t";break;case 98:r+="\b";break;case 102:r+="\f";break;case 92:case 40:case 41:r+=String.fromCharCode(i);break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var n=15&i;i=this.nextChar(),c=!0,i>=48&&i<=55&&(n=(n<<3)+(15&i),i=this.nextChar(),i>=48&&i<=55&&(c=!1,n=(n<<3)+(15&i))),r+=String.fromCharCode(n);break;case 10:case 13:break;default:r+=String.fromCharCode(i)}break;default:r+=String.fromCharCode(i)}if(a)break;c||(i=this.nextChar())}return r},getName:function(){for(var e,t="";(e=this.nextChar())>=0&&!i[e];)if(35===e){e=this.nextChar();var c=r(e);if(c!=-1){var n=r(this.nextChar());n==-1&&a("Illegal digit in hex char in name: "+n),t+=String.fromCharCode(c<<4|n)}else t+="#",t+=String.fromCharCode(e)}else t+=String.fromCharCode(e);return t.length>128&&a("Warning: name token is longer than allowed by the spec: "+t.length),new De(t)},getHexString:function(){for(var e,a,c="",n=this.currentChar,s=!0;;){if(n<0){t("Unterminated hex string");break}if(62===n){this.nextChar();break}if(1!==i[n]){if(s){if(e=r(n),e===-1){t('Ignoring invalid character "'+n+'" in hex string'),n=this.nextChar();continue}}else{if(a=r(n),a===-1){t('Ignoring invalid character "'+n+'" in hex string'),n=this.nextChar();continue}c+=String.fromCharCode(e<<4|a)}s=!s,n=this.nextChar()}else n=this.nextChar()}return c},getObj:function(){for(var e=!1,t=this.currentChar;;){if(t<0)return ta;if(e)10!==t&&13!=t||(e=!1);else if(37===t)e=!0;else if(1!==i[t])break;t=this.nextChar()}switch(0|t){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:return this.nextChar(),Ee.get("[");case 93:return this.nextChar(),Ee.get("]");case 60:return t=this.nextChar(),60===t?(this.nextChar(),Ee.get("<<")):this.getHexString();case 62:return t=this.nextChar(),62===t?(this.nextChar(),Ee.get(">>")):Ee.get(">");case 123:return this.nextChar(),Ee.get("{");case 125:return this.nextChar(),Ee.get("}");case 41:a("Illegal character: "+t)}for(var r=String.fromCharCode(t),c=this.knownCommands,n=(c&&r in c);(t=this.nextChar())>=0&&!i[t];){var s=r+String.fromCharCode(t);if(n&&!(s in c))break;128==r.length&&a("Command token too long: "+r.length),r=s,n=c&&r in c}return"true"==r||"false"!=r&&("null"==r?null:Ee.get(r))},skipToNextLine:function(){for(var e=(this.stream,this.currentChar);e>=0;){if(13===e){e=this.nextChar(),10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}},e}(),ia=function(){function e(e){this.parser=new aa(new ra(e),(!1),null);var t=this.parser.getObj(),a=this.parser.getObj(),r=this.parser.getObj();if(this.linDict=this.parser.getObj(),m(t)&&m(a)&&y(r,"obj")&&k(this.linDict)){var i=this.linDict.get("Linearized");p(i)&&i>0||(this.linDict=null)}}return e.prototype={getInt:function(e){var t,r=this.linDict;return k(r)&&m(t=r.get(e))&&t>0?t:void a('"'+e+'" field in linearization table is invalid')},getHint:function(e){var t,r,i=this.linDict;return k(i)&&w(t=i.get("H"))&&t.length>=2&&m(r=t[e])&&r>0?r:void a("Hints table in linearization table is invalid: "+e)},get length(){return k(this.linDict)?this.getInt("L"):0},get hintsOffset(){return this.getHint(0)},get hintsLength(){return this.getHint(1)},get hintsOffset2(){return this.getHint(2)},get hintsLenth2(){return this.getHint(3)},get objectNumberFirst(){return this.getInt("O")},get endFirst(){return this.getInt("E")},get numPages(){return this.getInt("N")},get mainXRefEntriesOffset(){return this.getInt("T")},get pageFirst(){return this.getInt("P")}},e}(),ca=function(){function e(e,t,a,r){this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+a||this.bytes.length,this.dict=r}return e.prototype={get length(){return this.end-this.start},getByte:function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},getBytes:function(e){var t=this.bytes,a=this.pos,r=this.end;if(!e)return t.subarray(a,r);var i=a+e;return i>r&&(i=r),this.pos=i,t.subarray(a,i)},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(t,a,r){return new e(this.bytes.buffer,t,a,r)},isStream:!0},e}(),na=(function(){function e(e){for(var t=e.length,a=new Uint8Array(t),r=0;rr&&(t=r)}else{for(;!this.eof;)this.readBlock();t=this.bufferLength,t||(this.buffer=new Uint8Array(0))}return this.pos=t,this.buffer.subarray(a,t)},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},makeSubStream:function(e,t,a){for(var r=e+t;this.bufferLength<=r&&!this.eof;)this.readBlock();return new ca(this.buffer,e,t,a)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0},getBaseStreams:function(){return this.str&&this.str.getBaseStreams?this.str.getBaseStreams():[]}},e}()),sa=(function(){function e(e){this.dict=e.dict,na.call(this)}return e.prototype=Object.create(na.prototype),e.prototype.readBlock=function(){var e=this.bufferLength;e+=1024;this.ensureBuffer(e);this.bufferLength=e},e.prototype.getBytes=function(e){var t,a=this.pos;if(e){for(this.ensureBuffer(a+e),t=a+e;!this.eof&&this.bufferLengthr&&(t=r)}else this.eof=!0,t=this.bufferLength;return this.pos=t,this.buffer.subarray(a,t)},e}(),function(){function e(e){this.streams=e,na.call(this)}return e.prototype=Object.create(na.prototype),e.prototype.readBlock=function(){var e=this.streams;if(0===e.length)return void(this.eof=!0);var t=e.shift(),a=t.getBytes(),r=this.bufferLength,i=r+a.length,c=this.ensureBuffer(i);c.set(a,r),this.bufferLength=i},e.prototype.getBaseStreams=function(){for(var e=[],t=0,a=this.streams.length;t>e,this.codeSize=r-=e,this.bytesPos=n,t},e.prototype.getCode=function(e){for(var t=e[0],r=e[1],i=this.codeSize,c=this.codeBuf,n=this.bytes,s=this.bytesPos;i>16,h=65535&f;return(0===i||i>l,this.codeSize=i-l,this.bytesPos=s,h},e.prototype.generateHuffmanTable=function(e){for(var t=e.length,a=0,r=0;ra&&(a=e[r]);for(var i=1<>=1;for(var r=l;r>=1,0===e){var s,o=this.bytes,f=this.bytesPos;"undefined"==typeof(s=o[f++])&&a("Bad block header in flate stream");var l=s;"undefined"==typeof(s=o[f++])&&a("Bad block header in flate stream"),l|=s<<8,"undefined"==typeof(s=o[f++])&&a("Bad block header in flate stream");var h=s;"undefined"==typeof(s=o[f++])&&a("Bad block header in flate stream"),h|=s<<8,h==(65535&~l)||0===l&&0===h||a("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var u=this.bufferLength,d=this.ensureBuffer(u+l),g=u+l;this.bufferLength=g;for(var m=u;m0;)B[x++]=O}p=this.generateHuffmanTable(B.subarray(0,v)),b=this.generateHuffmanTable(B.subarray(v,A))}else a("Unknown block type in flate stream");for(var d=this.buffer,R=d?d.length:0,M=this.bufferLength;;){var D=this.getCode(p);if(D<256)M+1>=R&&(d=this.ensureBuffer(M+1),R=d.length),d[M++]=D;else{if(256==D)return void(this.bufferLength=M);D-=257,D=r[D];var E=D>>16;E>0&&(E=this.getBits(E));var C=(65535&D)+E;D=this.getCode(b),D=i[D],E=D>>16,E>0&&(E=this.getBits(E));var P=(65535&D)+E;M+C>=R&&(d=this.ensureBuffer(M+C),R=d.length);for(var F=0;F15)&&a("Unsupported predictor: "+r),2===r?this.readBlock=this.readBlockTiff:this.readBlock=this.readBlockPng,this.str=e,this.dict=e.dict;var i=this.colors=t.get("Colors")||1,c=this.bits=t.get("BitsPerComponent")||8,n=this.columns=t.get("Columns")||1;return this.pixBytes=i*c+7>>3,this.rowBytes=n*i*c+7>>3,na.call(this),this}return e.prototype=Object.create(na.prototype),e.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,a=this.ensureBuffer(t+e),r=this.bits,i=this.colors,c=this.str.getBytes(e);if(this.eof=!c.length,!this.eof){var n=0,s=0,o=0,f=0,l=t;if(1===r)for(var h=0;h>i),n&=65535}else if(8===r){for(var h=0;h>o-r)&g,o-=r,s=s<=8&&(a[p++]=s>>f-8&255,f-=8);f>0&&(a[p++]=(s<<8-f)+(n&(1<<8-f)-1))}this.bufferLength+=e}},e.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),i=this.str.getBytes(e);if(this.eof=!i.length,!this.eof){var c=this.bufferLength,n=this.ensureBuffer(c+e),s=n.subarray(c-e,c);0===s.length&&(s=new Uint8Array(e));var o=c;switch(r){case 0:for(var f=0;f>1)+i[f];for(;f>1)+i[f]&255,o++;break;case 4:for(var f=0;f0,r=this.decrypt;e=r(e,!a);var i,c=this.bufferLength,n=e.length,s=this.ensureBuffer(c+n);for(i=0;i=0;--s)c[n+s]=255&f,f>>=8}},e}(),ma=function(){function e(e){this.str=e,this.dict=e.dict,this.firstDigit=-1,na.call(this)}return e.prototype=Object.create(na.prototype),e.prototype.readBlock=function(){var e=8e3,t=this.str.getBytes(e);if(!t.length)return void(this.eof=!0);for(var a=t.length+1>>1,r=this.ensureBuffer(this.bufferLength+a),i=this.bufferLength,c=this.firstDigit,n=0,s=t.length;n=48&&f<=57)o=15&f;else{if(!(f>=65&&f<=70||f>=97&&f<=102)){if(62===f){this.eof=!0;break}continue}o=(15&f)+9}c<0?c=o:(r[i++]=c<<4|o,c=-1)}c>=0&&this.eof&&(r[i++]=c<<4,c=-1),this.firstDigit=c,this.bufferLength=i},e}(),pa=function(){function e(e){this.str=e,this.dict=e.dict,na.call(this)}return e.prototype=Object.create(na.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(2);if(!e||e.length<2||128==e[0])return void(this.eof=!0);var t=this.bufferLength,a=e[0];if(a<128){var r=this.ensureBuffer(t+a+1);if(r[t++]=e[1],a>0){var i=this.str.getBytes(a);r.set(i,t),t+=a}}else{a=257-a;for(var c=e[1],r=this.ensureBuffer(t+a+1),n=0;n0&&(this.nextLine2D=!this.lookBits(1),this.eatBits(1)),na.call(this)}var a=-2,r=0,i=1,c=2,n=3,s=4,o=5,f=6,l=7,h=8,u=[[-1,-1],[-1,-1],[7,h],[7,l],[6,f],[6,f],[6,o],[6,o],[4,r],[4,r],[4,r],[4,r],[4,r],[4,r],[4,r],[4,r],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[3,n],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c],[1,c]],d=[[-1,-1],[12,a],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],g=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],m=[[-1,-1],[-1,-1],[12,a],[12,a],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],p=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],b=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];return t.prototype=Object.create(na.prototype),t.prototype.readBlock=function(){for(;!this.eof;){var e=this.lookChar();this.buf=ta,this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}},t.prototype.addPixels=function(t,a){var r=this.codingLine,i=this.codingPos;t>r[i]&&(t>this.columns&&(e("row is wrong length"),this.err=!0,t=this.columns),1&i^a&&++i,r[i]=t),this.codingPos=i},t.prototype.addPixelsNeg=function(t,a){var r=this.codingLine,i=this.codingPos;if(t>r[i])t>this.columns&&(e("row is wrong length"),this.err=!0,t=this.columns), 1&i^a&&++i,r[i]=t;else if(t0&&t=64);do b+=v=this.getWhiteCode();while(v>=64)}else{do p+=v=this.getWhiteCode();while(v>=64);do b+=v=this.getBlackCode();while(v>=64)}for(this.addPixels(g[this.codingPos]+p,a),g[this.codingPos]0?--t:++t;d[t]<=g[this.codingPos]&&d[t]0?--t:++t;d[t]<=g[this.codingPos]&&d[t]0?--t:++t;d[t]<=g[this.codingPos]&&d[t]=64)}else do p+=v=this.getWhiteCode();while(v>=64);this.addPixels(g[this.codingPos]+p,a),a^=1}this.byteAlign&&(this.inputBits&=-8);var k=!1;if(this.eoblock||this.row!=this.rows-1){for(p=this.lookBits(12);0===p;)this.eatBits(1),p=this.lookBits(12);1==p?(this.eatBits(12),k=!0):p==ta&&(this.eof=!0)}else this.eof=!0;if(!this.eof&&this.encoding>0&&(this.nextLine2D=!this.lookBits(1),this.eatBits(1)),this.eoblock&&k){if(p=this.lookBits(12),1==p){if(this.eatBits(12),this.encoding>0&&(this.lookBits(1),this.eatBits(1)),this.encoding>=0)for(var y=0;y<4;++y)p=this.lookBits(12),1!=p&&e("bad rtc code: "+p),this.eatBits(12),this.encoding>0&&(this.lookBits(1),this.eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(p=this.lookBits(13),p==ta)return this.eof=!0,null;if(p>>1==1)break;this.eatBits(1)}this.eatBits(12),this.encoding>0&&(this.eatBits(1),this.nextLine2D=!(1&p))}g[0]>0?this.outputBits=g[this.codingPos=0]:this.outputBits=g[this.codingPos=1],this.row++}if(this.outputBits>=8)this.buf=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&g[this.codingPos]u?(this.buf<<=u,1&this.codingPos||(this.buf|=255>>8-u),this.outputBits-=u,u=0):(this.buf<<=this.outputBits,1&this.codingPos||(this.buf|=255>>8-this.outputBits),u-=this.outputBits,this.outputBits=0,g[this.codingPos]0&&(this.buf<<=u,u=0));while(u)}return this.black&&(this.buf^=255),this.buf},t.prototype.findTableCode=function(e,t,a,r){for(var i=r||0,c=e;c<=t;++c){var n=this.lookBits(c);if(n==ta)return[!0,1,!1];if(c=i){var s=a[n-i];if(s[0]==c)return this.eatBits(c),[!0,s[1],!0]}}return[!1,0,!1]},t.prototype.getTwoDimCode=function(){var t,a=0;if(this.eoblock){if(a=this.lookBits(7),t=u[a],t&&t[0]>0)return this.eatBits(t[0]),t[1]}else{var r=this.findTableCode(1,7,u);if(r[0]&&r[2])return r[1]}return e("Bad two dim code"),ta},t.prototype.getWhiteCode=function(){var t,a=0;if(this.eoblock){if(a=this.lookBits(12),a==ta)return 1;if(t=a>>5===0?d[a]:g[a>>3],t[0]>0)return this.eatBits(t[0]),t[1]}else{var r=this.findTableCode(1,9,g);if(r[0])return r[1];if(r=this.findTableCode(11,12,d),r[0])return r[1]}return e("bad white code"),this.eatBits(1),1},t.prototype.getBlackCode=function(){var t,a;if(this.eoblock){if(t=this.lookBits(13),t==ta)return 1;if(a=t>>7===0?m[t]:t>>9===0&&t>>7!==0?p[(t>>1)-64]:b[t>>7],a[0]>0)return this.eatBits(a[0]),a[1]}else{var r=this.findTableCode(2,6,b);if(r[0])return r[1];if(r=this.findTableCode(7,12,p,64),r[0])return r[1];if(r=this.findTableCode(10,13,m),r[0])return r[1]}return e("bad black code"),this.eatBits(1),1},t.prototype.lookBits=function(e){for(var t;this.inputBits>16-e;this.inputBuf=(this.inputBuf<<8)+t,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e},t.prototype.eatBits=function(e){(this.inputBits-=e)<0&&(this.inputBits=0)},t}(),va=function(){function e(e,t){this.str=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;for(var a=4096,r={earlyChange:t,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0},i=0;i<256;++i)r.dictionaryValues[i]=i,r.dictionaryLengths[i]=1;this.lzwState=r,na.call(this)}return e.prototype=Object.create(na.prototype),e.prototype.readBits=function(e){for(var t=this.bitsCached,a=this.cachedData;t>>t&(1<0;if(y<256)g[0]=y,m=1;else{if(!(y>=258)){if(256==y){u=9,o=258,m=0;continue}this.eof=!0,delete this.lzwState;break}if(y=0;t--)g[t]=f[a],a=h[a];else g[m++]=g[0]}if(k&&(h[o]=d,l[o]=l[d]+1,f[o]=g[0],o++,u=o+s&o+s-1?u:0|Math.min(Math.log(o+s)/.6931471805599453+1,12)),d=y,p+=m,it;)t<<=1,a++;return a}function n(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz),e.x1=Math.ceil(t.Xsiz/e.XRsiz),e.y0=Math.ceil(t.YOsiz/e.YRsiz),e.y1=Math.ceil(t.Ysiz/e.YRsiz),e.width=e.x1-e.x0,e.height=e.y1-e.y0}function s(e,t){for(var a=e.SIZ,r=[],i=Math.ceil((a.Xsiz-a.XTOsiz)/a.XTsiz),c=Math.ceil((a.Ysiz-a.YTOsiz)/a.YTsiz),n=0;n0?Math.min(r.xcb,i.PPx-1):Math.min(r.xcb,i.PPx),i.ycb_=a>0?Math.min(r.ycb,i.PPy-1):Math.min(r.ycb,i.PPy),i}function f(e,t,a){var r=1<t.trx0?Math.ceil(t.trx1/r)-Math.floor(t.trx0/r):0,n=t.try1>t.try0?Math.ceil(t.try1/i)-Math.floor(t.try0/i):0,s=c*n,o=Math.floor(t.trx0/r)*r,f=Math.floor(t.try0/i)*i;t.precinctParameters={precinctXOffset:o,precinctYOffset:f,precinctWidth:r,precinctHeight:i,numprecinctswide:c,numprecinctshigh:n,numprecincts:s}}function l(e,t,a){for(var r=a.xcb_,i=a.ycb_,c=1<e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[f],a=t.precinctParameters.numprecincts;ue.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[o],a=t.precinctParameters.numprecincts;u>>l&(1<0;){var F=b.shift(),k=F.codeblock;"data"in k||(k.data=[]),k.data.push({data:t,start:a+f,end:a+f+F.dataLength,codingpasses:F.codingpasses}),f+=F.dataLength}}else n()}return f}function p(e,t,a,r,i,c,n,s,o,f){for(var l=.5,h=0,u=s.length;hE?(D+=D<0?D-l:D>0?D+l:0,M=1<0?1-m:0));var S=b.subbands[v],C=S.tbx1-S.tbx0,A=S.tby1-S.tby0,q=k[S.type],L=Math.pow(2,u+q-x)*(1+w/2048),O=f+x-1,T=new Float32Array(C*A);p(T,S.tbx0,S.tby0,C,A,L,O,S.codeblocks,l,h),d.push({width:C,height:A,items:T}),g++}var l=i.transformation,R=0===l?new B:new I,M=R.calculate(d,r.tcx0,r.tcy0);return{left:r.tcx0,top:r.tcy0,width:M.width,height:M.height,items:M.items}}function v(e){for(var t=e.SIZ,a=e.components,r=t.Csiz,i=[],c=0,n=e.tiles.length;c>2);u[g]=k,h[g]=y+k,d[g]=v+k}for(var f=0;f>A)+x;B[g]=I<0?0:I>255?255:I}o[f].items=B}i.push(o)}return i}function y(e,t){for(var a=e.SIZ,r=a.Csiz,i=e.tiles[t],c=0;c>5;for(var I=[];u>3,q.mu=0):(q.epsilon=e[u]>>3,q.mu=(7&e[u])<<8|e[u+1],u+=2),I.push(q)}S.SPqcds=I,f.mainHeader?f.QCD=S:(f.currentTile.QCD=S,f.currentTile.QCC=[]);break;case 65373:d=i(e,l);var L={};u=l+2;var O;f.SIZ.Csiz<257?O=e[u++]:(O=i(e,u),u+=2);var C,A,B=e[u++];switch(31&B){case 0:C=8,A=!0;break;case 1:C=16,A=!1;break;case 2:C=16,A=!0;break;default:throw"Invalid SQcd value "+B}L.noQuantization=8==C,L.scalarExpounded=A,L.guardBits=B>>5;for(var I=[];u>3,q.mu=0):(q.epsilon=e[u]>>3,q.mu=(7&e[u])<<8|e[u+1],u+=2),I.push(q)}L.SPqcds=I,f.mainHeader?f.QCC[O]=L:f.currentTile.QCC[O]=L;break;case 65362:d=i(e,l);var T={};u=l+2;var R=e[u++];T.entropyCoderWithCustomPrecincts=!!(1&R),T.sopMarkerUsed=!!(2&R),T.ephMarkerUsed=!!(4&R);T.progressionOrder=e[u++],T.layersCount=i(e,u),u+=2,T.multipleComponentTransform=e[u++],T.decompositionLevelsCount=e[u++],T.xcb=(15&e[u++])+2,T.ycb=(15&e[u++])+2;var M=e[u++];if(T.selectiveArithmeticCodingBypass=!!(1&M),T.resetContextProbabilities=!!(2&M),T.terminationOnEachCodingPass=!!(4&M),T.verticalyStripe=!!(8&M),T.predictableTermination=!!(16&M),T.segmentationSymbolUsed=!!(32&M),T.transformation=e[u++],T.entropyCoderWithCustomPrecincts){for(var D={};u>4})}T.precinctsSizes=D}if(T.sopMarkerUsed||T.ephMarkerUsed||T.selectiveArithmeticCodingBypass||T.resetContextProbabilities||T.terminationOnEachCodingPass||T.verticalyStripe||T.predictableTermination)throw"Unsupported COD options: "+H.JSON.stringify(T);f.mainHeader?f.COD=T:(f.currentTile.COD=T,f.currentTile.COC=[]);break;case 65424:d=i(e,l);var P={};P.index=i(e,l+2),P.length=r(e,l+4),P.dataEnd=P.length+l-2,P.partIndex=e[l+8],P.partsCount=e[l+9],f.mainHeader=!1,0===P.partIndex&&(P.COD=f.COD,P.COC=f.COC.slice(0),P.QCD=f.QCD,P.QCC=f.QCC.slice(0)),f.currentTile=P;break;case 65427:var P=f.currentTile;0===P.partIndex&&(y(f,P.index),g(f)),d=P.dataEnd-l,m(f,e,l,d);break;case 65380:d=i(e,l);break;default:throw"Unknown codestream code: "+h.toString(16)}l+=d}}catch(F){this.failOnCorruptedImage?a("JPX error: "+F):t("JPX error: "+F+". Trying to recover")}this.tiles=v(f),this.width=f.SIZ.Xsiz-f.SIZ.XOsiz,this.height=f.SIZ.Ysiz-f.SIZ.YOsiz,this.componentsCount=f.SIZ.Csiz}};var w=function(){function e(e,t){var a=c(Math.max(e,t))+1;this.levels=[];for(var r=0;r>=1,t>>=1,a++}a--;var i=this.levels[a];i.items[i.index]=r,this.currentLevel=a,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],a=t.items[t.index];if(e--,e<0)return this.value=a,!1;this.currentLevel=e;var t=this.levels[e];return t.items[t.index]=a,!0}},e}(),x=function(){function e(e,t,a){var r=c(Math.max(e,t))+1;this.levels=[];for(var i=0;ia)return this.currentLevel=r,this.propagateValues(),!1;e>>=1,t>>=1,r++}return this.currentLevel=r-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){for(var e=this.currentLevel,t=this.levels[e],a=t.items[t.index];--e>=0;){var t=this.levels[e];t.items[t.index]=a}},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],a=t.items[t.index];if(t.items[t.index]=255,e--,e<0)return!1;this.currentLevel=e;var t=this.levels[e];return t.items[t.index]=a,!0}},e}(),S=function(){function e(e,t,a){this.data=e,this.bp=t,this.dataEnd=a,this.chigh=e[t],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}var t=[{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}];return e.prototype={byteIn:function(){var e=this.data,t=this.bp;if(255==e[t]){var a=e[t+1];a>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t)}else t++,this.clow+=t65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(e){var a=t[e.index].qe;if(this.a-=a,this.chigh>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(32768&this.a))},exchangeMps:function(e){var a,r=t[e.index];return this.a0&&(t>0&&(a[c-r-1]+=16),t+10&&(a[c+r-1]+=16),t+10&&(a[c-1]+=1),t+1=a)break;if(!r[b]&&c[b]){var k=o[c[b]],w=s[k],x=e.readBit(w);if(x){var S=this.decodeSignBit(y,p);i[b]=S,r[b]=1,this.setNeighborsSignificance(y,p),n[b]|=u}f[b]++,n[b]|=h}}},decodeSignBit:function(t,a){var r=this.width,i=this.height,n=t*r+a,s=this.coefficentsMagnitude,o=this.coefficentsSign,f=e(a>0&&s[n-1],o[n-1],a+10&&s[n-r],o[n-r],t+1=a)break;var g=d*t+h;if(r[g]&&0===(s[g]&o)){var m=16;if(0!==(s[g]&f)){s[d*t+h]^=f;var p=i[g],b=(3&p)+(p>>2&3)+(p>>4&7);m=b>=1?15:14}var v=c[m],y=e.readBit(v);r[g]=r[g]<<1|y,n[g]++,s[g]|=o}}},runCleanupPass:function(){for(var e=this.decoder,t=this.width,a=this.height,r=this.neighborsSignificance,i=(this.significanceState,this.coefficentsMagnitude),c=this.coefficentsSign,n=this.contexts,s=this.contextLabelTable,o=this.bitsDecoded,f=this.processingFlags,l=1,h=2,u=t,d=2*t,g=3*t,m=0;m=a));w++,x+=t)if(!i[x]&&0===(f[x]&l)){var B=s[r[x]];b=n[B];var I=e.readBit(b);if(1==I){var C=this.decodeSignBit(v,p);c[x]=C,i[x]=1,this.setNeighborsSignificance(v,p),f[x]|=h}o[x]++}}},checkSegmentationSymbol:function(){var e=this.decoder,t=this.uniformContext,a=e.readBit(t)<<3|e.readBit(t)<<2|e.readBit(t)<<1|e.readBit(t);if(10!=a)throw"Invalid segmentation symbol"}},t}(),A=function(){function e(){}return e.prototype.calculate=function(e,t,a){for(var r=e[0],i=1,c=e.length,n=1;i0?-s:null:s}function i(e,t,a){for(var r=e.getContexts("IAID"),i=1,c=0;ct;)t<<=1,a++;return a}function n(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function s(e,t){var a=n(e,t);return 2147483648&a?a+4294967296:a}function f(e,t){return e[t]<<8|e[t+1]}function l(e,t){return e[t]<<24>>24}function h(e,t,r,i,c,n,s,o){e&&a("JBIG2 error: MMR encoding is not supported");for(var f=!!n,l=A[i].concat(s),h=l.length,u=new Int32Array(h),d=new Int32Array(h),g=0;g=t?C<<=1:C=C<<1|p[B][q]}var L=b.readBit(v,C);x[S]=L}}}return p}function u(e,t,r,i,c,n,s,o,f){var l=B[r].coding;0===r&&(l=l.concat([o[0]]));for(var h=l.length,u=new Int32Array(h),d=new Int32Array(h),g=0;g=e?R<<=1:R=R<<1|x[M][D]}for(var g=0;g=k||D<0||D>=y?R<<=1:R=R<<1|i[M][D]}var E=S.readBit(C,R);O[T]=E}}return x}function d(e,t,n,s,o,f,l,d,g,m,p){e&&a("JBIG2 error: huffman is not supported");for(var b=[],v=0,y=c(n.length+s),k=p.decoder,w=p.contextCache;b.length1&&a("JBIG2 error: number of instances > 1 is not supported");var q=i(w,k,y),L=r(w,"IARDX",k),O=r(w,"IARDY",k),T=q>1)+z,(U>>1)+H,!1,y,k)}var G=M-(1&m?0:N),X=T-(2&m?F:0);if(d){for(var V=0;V>5&7,u=[31&l],d=t+6;if(7==l){h=536870911&n(e,d-1),d+=3;var g=h+7>>3;for(u[0]=e[d++];--g>0;)u.push(e[d++])}else 5!=l&&6!=l||a("JBIG2 error: invalid referred-to flags");r.retainBits=u;for(var m=r.number<=256?1:r.number<=65536?2:4,p=[],v=0;v>>24&255,A[3]=k.height>>16&255,A[4]=k.height>>8&255,A[5]=255&k.height;for(var v=d,B=e.length;v>2&3,h.huffmanDWSelector=u>>4&3,h.bitmapSizeSelector=u>>6&1,h.aggregationInstancesSelector=u>>7&1,h.bitmapCodingContextUsed=!!(256&u),h.bitmapCodingContextRetained=!!(512&u),h.template=u>>10&3,h.refinementTemplate=u>>12&1,n+=2,!h.huffman){for(var d=0===h.template?4:1,g=[],m=0;m>2&3),p.referenceCorner=v>>4&3,p.transposed=!!(64&v),p.combinationOperator=v>>7&3,p.defaultPixelValue=v>>9&1,p.dsOffset=v<<17>>27,p.refinementTemplate=v>>15&1,p.huffman){var y=f(c,n);n+=2,p.huffmanFS=3&y,p.huffmanDS=y>>2&3,p.huffmanDT=y>>4&3,p.huffmanRefinementDW=y>>6&3,p.huffmanRefinementDH=y>>8&3,p.huffmanRefinementDX=y>>10&3,p.huffmanRefinementDY=y>>12&3,p.huffmanRefinementSizeSelector=!!(14&y)}if(p.refinement&&!p.refinementTemplate){for(var g=[],m=0;m<2;m++)g.push({x:l(c,n),y:l(c,n+1)}),n+=2;p.refinementAt=g}p.numberOfSymbolInstances=s(c,n),n+=4,p.huffman&&a("JBIG2 error: huffman is not supported"),r=[p,i.referredTo,c,n,o];break;case 38:case 39:var k={};k.info=b(c,n),n+=L;var w=c[n++];if(k.mmr=!!(1&w),k.template=w>>1&3,k.prediction=!!(8&w),!k.mmr){for(var d=0===k.template?4:1,g=[],m=0;m>2&1,x.combinationOperator=S>>3&3,x.requiresBuffer=!!(32&S),x.combinationOperatorOverride=!!(64&S),r=[x];break;case 49:break;case 50:break;case 51:break;case 62:break;default:a("JBIG2 error: segment type "+i.typeName+"("+i.type+") is not implemented")}var C="on"+i.typeName;C in t&&t[C].apply(t,r)}function y(e,t){for(var a=0,r=e.length;a>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}var t=[{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}];return e.prototype={byteIn:function(){var e=this.data,t=this.bp;if(255==e[t]){var a=e[t+1];a>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t)}else t++,this.clow+=t65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(e,a){var r,i=e[a]>>1,c=1&e[a],n=t[i],s=n.qe,o=n.nmps,f=n.nlps,l=n.switchFlag;if(this.a-=s,this.chigh>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(32768&this.a));return e[a]=i<<1|c,r}},e}();e.prototype={getContexts:function(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},t.prototype={get decoder(){var e=new S(this.data,this.start,this.end);return o(this,"decoder",e)},get contextCache(){var t=new e;return o(this,"contextCache",t)}};var C=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"patternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],A=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],B=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],I=[7379,1946,227,395],q=[32,8],L=17;return w.prototype={onPageInformation:function(e){this.currentPageInfo=e;for(var t=e.width+7>>3,a=new Uint8Array(t*e.height),r=e.defaultPixelValue?255:0,i=0,c=a.length;i>3,s=r.combinationOperatorOverride?e.combinationOperator:r.combinationOperator,o=this.buffer,f=0;f>(7&e.x),h=(f+e.y)*n+(e.x>>3);switch(s){case 0:for(var u=0;u>=1,l||(l=128,h++);break;case 2:for(var u=0;u>=1,l||(l=128,h++);break;default:a("JBIG2 error: operator "+s+" is not supported")}}},onImmediateGenericRegion:function(e,a,r,i){var c=e.info,n=new t(a,r,i),s=h(e.mmr,c.width,c.height,e.template,e.prediction,null,e.at,n);this.drawBitmap(c,s)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,r,i,c,n,s){var o;e.huffman&&a("JBIG2 error: huffman is not supported");var f=this.symbols;f||(this.symbols=f={});for(var l=[],h=0,u=i.length;h=0&&"ET"==g[B];--B)g[B]="EN";for(var B=b+1;B0&&(q=g[b-1]);var L=S;I+1M&&e(M)&&(T=M)}for(var M=O;M>=T;--M){for(var D=-1,b=0,R=k.length;b=0&&(i(d,D,b),D=-1):D<0&&(D=b);D>=0&&i(d,D,k.length)}for(var E="",b=0,R=d.length;b"!=P&&(E+=P)}return new c(E,h)}var s=["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"],o=["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"];return n}(),{"Adobe-CNS1-0":[[],[0,14335]],"Adobe-CNS1-1":[[],[0,17407]],"Adobe-CNS1-2":[[],[0,17663]],"Adobe-CNS1-3":[[],[0,18943]],"Adobe-CNS1-4":[[],[0,19199]],"Adobe-CNS1-5":[[],[0,19199]],"Adobe-CNS1-6":[[],[0,19199]],"Adobe-CNS1-UCS2":[[],[0,65535]],"B5-H":[[0,128],[41280,65278]],"B5-V":[[0,128],[41280,65278]],"B5pc-H":[[0,128,253,255],[41280,64766]],"B5pc-V":[[0,128,253,255],[41280,64766]],"CNS-EUC-H":[[0,128],[41377,65278],[],[2392957345,2392981246,2393022881,2393046782,2393088417,2393112318]],"CNS-EUC-V":[[0,128],[41377,65278],[],[2392957345,2392981246,2393022881,2393046782,2393088417,2393112318]],"CNS1-H":[[],[8481,32382]],"CNS1-V":[[],[8481,32382]],"CNS2-H":[[],[8481,32382]],"CNS2-V":[[],[8481,32382]],"ETen-B5-H":[[0,128],[41280,65278]],"ETen-B5-V":[[0,128],[41280,65278]],"ETenms-B5-H":[[0,128],[41280,65278]],"ETenms-B5-V":[[0,128],[41280,65278]],"ETHK-B5-H":[[0,128],[34624,65278]],"ETHK-B5-V":[[0,128],[34624,65278]],"HKdla-B5-H":[[0,128],[41280,65278]],"HKdla-B5-V":[[0,128],[41280,65278]],"HKdlb-B5-H":[[0,128],[36416,65278]],"HKdlb-B5-V":[[0,128],[36416,65278]],"HKgccs-B5-H":[[0,128],[35392,65278]],"HKgccs-B5-V":[[0,128],[35392,65278]],"HKm314-B5-H":[[0,128],[41280,65278]],"HKm314-B5-V":[[0,128],[41280,65278]],"HKm471-B5-H":[[0,128],[41280,65278]],"HKm471-B5-V":[[0,128],[41280,65278]],"HKscs-B5-H":[[0,128],[34624,65278]],"HKscs-B5-V":[[0,128],[34624,65278]],"UniCNS-UCS2-H":[[],[0,55295,57344,65535]],"UniCNS-UCS2-V":[[],[0,55295,57344,65535]],"UniCNS-UTF16-H":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniCNS-UTF16-V":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"Adobe-GB1-0":[[],[0,7935]],"Adobe-GB1-1":[[],[0,9983]],"Adobe-GB1-2":[[],[0,22271]],"Adobe-GB1-3":[[],[0,22527]],"Adobe-GB1-4":[[],[0,29183]],"Adobe-GB1-5":[[],[0,30463]],"Adobe-GB1-UCS2":[[],[0,65535]],"GB-EUC-H":[[0,128],[41377,65278]],"GB-EUC-V":[[0,128],[41377,65278]],"GB-H":[[],[8481,32382]],"GB-V":[[],[8481,32382]],"GBK-EUC-H":[[0,128],[33088,65278]],"GBK-EUC-V":[[0,128],[33088,65278]],"GBK2K-H":[[0,127],[33088,65278],[],[2167439664,4265213497]],"GBK2K-V":[[0,127],[33088,65278],[],[2167439664,4265213497]],"GBKp-EUC-H":[[0,128],[33088,65278]],"GBKp-EUC-V":[[0,128],[33088,65278]],"GBpc-EUC-H":[[0,128,253,255],[41377,64766]],"GBpc-EUC-V":[[0,128,253,255],[41377,64766]],"GBT-EUC-H":[[0,128],[41377,65278]],"GBT-EUC-V":[[0,128],[41377,65278]],"GBT-H":[[],[8481,32382]],"GBT-V":[[],[8481,32382]],"GBTpc-EUC-H":[[0,128,253,255],[41377,64766]],"GBTpc-EUC-V":[[0,128,253,255],[41377,64766]],"UniGB-UCS2-H":[[],[0,55295,57344,65535]],"UniGB-UCS2-V":[[],[0,55295,57344,65535]],"UniGB-UTF16-H":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniGB-UTF16-V":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"78-EUC-H":[[0,128],[36512,36575,41377,65278]],"78-EUC-V":[[0,128],[36512,36575,41377,65278]],"78-H":[[],[8481,32382]],"78-RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"78-RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],"78-V":[[],[8481,32382]],"78ms-RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"78ms-RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],"83pv-RKSJ-H":[[0,128,160,223,253,255],[33088,40956,57408,64764]],"90ms-RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"90ms-RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],"90msp-RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"90msp-RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],"90pv-RKSJ-H":[[0,128,160,223,253,255],[33088,40956,57408,64764]],"90pv-RKSJ-V":[[0,128,160,223,253,255],[33088,40956,57408,64764]],"Add-H":[[],[8481,32382]],"Add-RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"Add-RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],"Add-V":[[],[8481,32382]],"Adobe-Japan1-0":[[],[0,8447]],"Adobe-Japan1-1":[[],[0,8447]],"Adobe-Japan1-2":[[],[0,8959]],"Adobe-Japan1-3":[[],[0,9471]],"Adobe-Japan1-4":[[],[0,15615]],"Adobe-Japan1-5":[[],[0,20479]],"Adobe-Japan1-6":[[],[0,23295]],"Adobe-Japan1-UCS2":[[],[0,65535]],"Adobe-Japan2-0":[[],[0,6143]],"EUC-H":[[0,128],[36512,36575,41377,65278]],"EUC-V":[[0,128],[36512,36575,41377,65278]],"Ext-H":[[],[8481,32382]],"Ext-RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"Ext-RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],"Ext-V":[[],[8481,32382]],H:[[],[8481,32382]],Hankaku:[[0,255],[]],Hiragana:[[0,255],[]],"Hojo-EUC-H":[[],[],[9413025,9436926],[]],"Hojo-EUC-V":[[],[],[9413025,9436926],[]],"Hojo-H":[[],[8481,32382]],"Hojo-V":[[],[8481,32382]],Katakana:[[0,255],[]],"NWP-H":[[],[8481,32382]],"NWP-V":[[],[8481,32382]],"RKSJ-H":[[0,128,160,223],[33088,40956,57408,64764]],"RKSJ-V":[[0,128,160,223],[33088,40956,57408,64764]],Roman:[[0,255],[]],"UniHojo-UCS2-H":[[],[0,55295,57344,65535]],"UniHojo-UCS2-V":[[],[0,55295,57344,65535]],"UniHojo-UTF16-H":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniHojo-UTF16-V":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniJIS-UCS2-H":[[],[0,55295,57344,65535]],"UniJIS-UCS2-HW-H":[[],[0,55295,57344,65535]],"UniJIS-UCS2-HW-V":[[],[0,55295,57344,65535]],"UniJIS-UCS2-V":[[],[0,55295,57344,65535]],"UniJIS-UTF16-H":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniJIS-UTF16-V":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniJISPro-UCS2-HW-V":[[],[0,55295,57344,65535]],"UniJISPro-UCS2-V":[[],[0,55295,57344,65535]],V:[[],[8481,32382]],"WP-Symbol":[[0,255],[]],"Adobe-Korea1-0":[[],[0,9471]],"Adobe-Korea1-1":[[],[0,18175]],"Adobe-Korea1-2":[[],[0,18431]],"Adobe-Korea1-UCS2":[[],[0,65535]],"KSC-EUC-H":[[0,128],[41377,65278]],"KSC-EUC-V":[[0,128],[41377,65278]],"KSC-H":[[],[8481,32382]],"KSC-Johab-H":[[0,128],[33857,54270,55345,57086,57393,63998]],"KSC-Johab-V":[[0,128],[33857,54270,55345,57086,57393,63998]],"KSC-V":[[],[8481,32382]],"KSCms-UHC-H":[[0,128],[33089,65278]],"KSCms-UHC-HW-H":[[0,128],[33089,65278]],"KSCms-UHC-HW-V":[[0,128],[33089,65278]],"KSCms-UHC-V":[[0,128],[33089,65278]],"KSCpc-EUC-H":[[0,132,254,255],[41281,65022]],"KSCpc-EUC-V":[[0,132,254,255],[41281,65022]],"UniKS-UCS2-H":[[],[0,55295,57344,65535]],"UniKS-UCS2-V":[[],[0,55295,57344,65535]],"UniKS-UTF16-H":[[],[0,55295,57344,65535],[],[3623934976,3690979327]],"UniKS-UTF16-V":[[],[0,55295,57344,65535],[],[3623934976,3690979327]]}),Ia=function(){function e(){this.codespaceRanges=[[],[],[],[]],this.map=[],this.vertical=!1}return e.prototype={addCodespaceRange:function(e,t,a){this.codespaceRanges[e-1].push(t,a)},mapRange:function(e,t,a){for(var r=a.length-1;e<=t;)this.map[e]=a,a=a.substr(0,r)+String.fromCharCode(a.charCodeAt(r)+1),++e},mapRangeToArray:function(e,t,a){for(var r=0;e<=t;)this.map[e]=a[r++],++e},mapOne:function(e,t){this.map[e]=t},lookup:function(e){return this.map[e]},readCharCode:function(e,t){for(var a=0,r=this.codespaceRanges,i=this.codespaceRanges.length,c=0;c>>0;for(var n=r[c],s=0,o=n.length;s=f&&a<=l)return[a,c+1]}}return[0,1]}},e}(),qa=function(){function e(e,t){Ia.call(this),this.vertical=e,this.addCodespaceRange(t,0,65535),this.mapRange(0,65535,"\0")}return ce.inherit(e,Ia,{}),e}(),La=function(){function e(e){for(var t=0,a=0;a>>0}function r(e){b(e)||a("Malformed CMap: expected string.")}function i(e){m(e)||a("Malformed CMap: expected int.")}function c(t,a){for(;;){var i=a.getObj();if(z(i))break;if(y(i,"endbfchar"))return;r(i);var c=e(i);i=a.getObj(),r(i);var n=i;t.mapOne(c,n)}}function n(t,i){for(;;){var c=i.getObj();if(z(c))break;if(y(c,"endbfrange"))return;r(c);var n=e(c);c=i.getObj(),r(c);var s=e(c);if(c=i.getObj(),m(c)||b(c)){var o=m(c)?String.fromCharCode(c):c;t.mapRange(n,s,o)}else{if(!y(c,"["))break;c=i.getObj();for(var f=[];!y(c,"]")&&!z(c);)f.push(c),c=i.getObj();t.mapRangeToArray(n,s,f)}}a("Invalid bf range.")}function s(t,a){for(;;){var c=a.getObj();if(z(c))break;if(y(c,"endcidchar"))return;r(c);var n=e(c);c=a.getObj(),i(c);var s=String.fromCharCode(c);t.mapOne(n,s)}}function o(t,a){for(;;){var c=a.getObj();if(z(c))break;if(y(c,"endcidrange"))return;r(c);var n=e(c);c=a.getObj(),r(c);var s=e(c);c=a.getObj(),i(c);var o=String.fromCharCode(c);t.mapRange(n,s,o)}}function f(t,r){for(;;){var i=r.getObj();if(z(i))break;if(y(i,"endcodespacerange"))return;if(!b(i))break;var c=e(i);if(i=r.getObj(),!b(i))break;var n=e(i);t.addCodespaceRange(i.length,c,n)}a("Invalid codespace range.")}function l(e,t){e:for(;;){var a=t.getObj();if(z(a))break;if(y(a))switch(a.cmd){case"endcMap":break e;case"usecMap":break;case"begincodespacerange":f(e,t);break;case"beginbfchar":c(e,t);break;case"begincidchar":s(e,t);break;case"beginbfrange":n(e,t);break;case"begincidrange":o(e,t)}}}return{create:function(e){if(v(e))switch(e.name){case"Identity-H":return new qa((!1),2);case"Identity-V":return new qa((!0),2);default:if(e.name in Ba){var r=new Ia;return r.codespaceRanges=Ba[e.name],r}return null}else if(x(e)){var r=new Ia,i=new ra(e);try{l(r,i)}catch(c){t("Invalid CMap data. "+c)}return r}a("Encoding required.")}}}(),Oa=function(){function e(){}function t(e,t){for(var a,r,i=0,c=[],n=16;n>0&&!e[n-1];)n--;c.push({children:[],index:0});var s,o=c[0];for(a=0;a0;)o=c.pop();for(o.index++,c.push(o);c.length<=a;)c.push(s={children:[],index:0}),o.children[o.index]=s.children,o=s;i++}a+10)return R--,T>>R&1;if(T=e[t++],255==T){var a=e[t++];if(a)throw"unexpected marker: "+(T<<8|a).toString(16)}return R=7,T>>>7}function h(e){for(var t,a=e;null!==(t=l());){if(a=a[t],"number"==typeof a)return a;if("object"!=typeof a)throw"invalid huffman sequence"}return null}function u(e){for(var t=0;e>0;){var a=l();if(null===a)return;t=t<<1|a,e--}return t}function d(e){var t=u(e);return t>=1<>4;if(0!==s){i+=o;var f=c[i];t[f]=d(s),i++}else{if(o<15)break;i+=16}}}function m(e,t){var a=h(e.huffmanTableDC),r=0===a?0:d(a)<0)return void M--;for(var a=n,r=s;a<=r;){var i=h(e.huffmanTableAC),o=15&i,l=i>>4;if(0!==o){a+=l;var g=c[a];t[g]=d(o)*(1<>4;if(0===m)i<15?(M=u(i)+(1<=65488&&P<=65495))break;t+=2}return t-O}function r(e,t){function a(e,a,r){var i,c,g,m,p,b,v,y,k,w,x=t.quantizationTable,S=r;for(w=0;w<64;w++)S[w]=e[w]*x[w];for(w=0;w<8;++w){var C=8*w;0!=S[1+C]||0!=S[2+C]||0!=S[3+C]||0!=S[4+C]||0!=S[5+C]||0!=S[6+C]||0!=S[7+C]?(i=u*S[0+C]+128>>8,c=u*S[4+C]+128>>8,g=S[2+C],m=S[6+C],p=d*(S[1+C]-S[7+C])+128>>8,y=d*(S[1+C]+S[7+C])+128>>8,b=S[3+C]<<4,v=S[5+C]<<4,k=i-c+1>>1,i=i+c+1>>1,c=k,k=g*h+m*l+128>>8,g=g*l-m*h+128>>8,m=k,k=p-v+1>>1,p=p+v+1>>1,v=k,k=y+b+1>>1,b=y-b+1>>1,y=k,k=i-m+1>>1,i=i+m+1>>1,m=k,k=c-g+1>>1,c=c+g+1>>1,g=k,k=p*f+y*o+2048>>12,p=p*o-y*f+2048>>12,y=k,k=b*s+v*n+2048>>12,b=b*n-v*s+2048>>12,v=k,S[0+C]=i+y,S[7+C]=i-y,S[1+C]=c+v,S[6+C]=c-v,S[2+C]=g+b,S[5+C]=g-b,S[3+C]=m+p,S[4+C]=m-p):(k=u*S[0+C]+512>>10,S[0+C]=k,S[1+C]=k,S[2+C]=k,S[3+C]=k,S[4+C]=k,S[5+C]=k,S[6+C]=k,S[7+C]=k)}for(w=0;w<8;++w){var A=w;0!=S[8+A]||0!=S[16+A]||0!=S[24+A]||0!=S[32+A]||0!=S[40+A]||0!=S[48+A]||0!=S[56+A]?(i=u*S[0+A]+2048>>12,c=u*S[32+A]+2048>>12,g=S[16+A],m=S[48+A],p=d*(S[8+A]-S[56+A])+2048>>12,y=d*(S[8+A]+S[56+A])+2048>>12,b=S[24+A],v=S[40+A],k=i-c+1>>1,i=i+c+1>>1,c=k,k=g*h+m*l+2048>>12,g=g*l-m*h+2048>>12,m=k,k=p-v+1>>1,p=p+v+1>>1,v=k,k=y+b+1>>1,b=y-b+1>>1,y=k,k=i-m+1>>1,i=i+m+1>>1,m=k,k=c-g+1>>1,c=c+g+1>>1,g=k,k=p*f+y*o+2048>>12,p=p*o-y*f+2048>>12,y=k,k=b*s+v*n+2048>>12,b=b*n-v*s+2048>>12,v=k,S[0+A]=i+y,S[56+A]=i-y,S[8+A]=c+v,S[48+A]=c-v,S[16+A]=g+b,S[40+A]=g-b,S[24+A]=m+p,S[32+A]=m-p):(k=u*r[w+0]+8192>>14,S[0+A]=k,S[8+A]=k,S[16+A]=k,S[24+A]=k,S[32+A]=k,S[40+A]=k,S[48+A]=k,S[56+A]=k)}for(w=0;w<64;++w){var B=128+(S[w]+8>>4);a[w]=B<0?0:B>255?255:B}}for(var r,i,c=[],g=t.blocksPerLine,m=t.blocksPerColumn,p=g<<3,b=new Int32Array(64),v=new Uint8Array(64),y=0;y255?255:e}var c=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),n=4017,s=799,o=3406,f=2276,l=1567,h=3784,u=5793,d=2896;return e.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(e){function i(){var t=e[l]<<8|e[l+1];return l+=2,t}function n(){var t=i(),a=e.subarray(l,l+t-2);return l+=a.length,a}function s(e){var t,a,r=0,i=0;for(a in e.components)e.components.hasOwnProperty(a)&&(t=e.components[a],r>4===0)for(y=0;y<64;y++){var A=c[y];C[A]=e[l++]}else{if(S>>4!==1)throw"DQT: invalid table spec";for(y=0;y<64;y++){var A=c[y];C[A]=i()}}d[15&S]=C}break;case 65472:case 65473:case 65474:i(),o={},o.extended=65473===b,o.progressive=65474===b,o.precision=e[l++],o.scanLines=i(),o.samplesPerLine=i(),o.components={},o.componentsOrder=[];var B,I=e[l++];for(v=0;v>4,L=15&e[l+1],O=e[l+2];o.componentsOrder.push(B),o.components[B]={h:q,v:L,quantizationTable:d[O]},l+=3}s(o),g.push(o);break;case 65476:var T=i();for(v=2;v>4===0?p:m)[15&R]=t(M,E)}break;case 65501:i(),f=i();break;case 65498:var P,F=(i(),e[l++]),N=[];for(v=0;v>4],P.huffmanTableAC=m[15&j],N.push(P)}var U=e[l++],z=e[l++],H=e[l++],G=a(e,l,o,N,f,U,z,H>>4,15&H);l+=G;break;default:if(255==e[l-3]&&e[l-2]>=192&&e[l-2]<=254){l-=3;break}throw"unknown JPEG marker "+b.toString(16)}b=i()}if(1!=g.length)throw"only single frame JPEGs supported";this.width=o.samplesPerLine,this.height=o.scanLines,this.jfif=h,this.adobe=u,this.components=[];for(var v=0;v