@pdftron/webviewer
Version:
[WebViewer](https://www.apryse.com/webviewer) is a powerful JavaScript Document SDK and UI Component Library that is a part of the [Apryse PDF SDK](https://www.apryse.com). It provides a slick, out-of-the-box responsive UI that interacts with the core lib
1 lines • 1.46 MB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[81],{1410:function(r,e,n){var t;const a=n(1908);!function(i){"use strict";var c=void 0!==c?c:{};function o(r){return r<16?"0"+Math.max(0,r).toString(16):Math.min(255,r).toString(16)}function s(r,e,n,t){r=r%360+360*(r<0);var a=n+(n<.5?n:1-n)*(e=isNaN(r)||isNaN(e)?0:e),i=2*n-a;return p(u(r>=240?r-240:r+120,i,a),u(r,i,a),u(r<120?r+240:r-120,i,a),t)}function u(r,e,n){return 255*(r<60?e+(n-e)*r/60:r<180?n:r<240?e+(n-e)*(240-r)/60:e)}r.exports?r.exports=c:void 0===(t=function(){return c}.call(e,n,e,r))||(r.exports=t);var X="\\s*([+-]?\\d+)\\s*",l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",P="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",K=new RegExp("^rgb\\("+[X,X,X]+"\\)$"),m=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),d=new RegExp("^rgba\\("+[X,X,X,l]+"\\)$"),h=new RegExp("^rgba\\("+[P,P,P,l]+"\\)$"),f=new RegExp("^hsl\\("+[l,P,P]+"\\)$"),g=new RegExp("^hsla\\("+[l,P,P,l]+"\\)$"),p=function(r,e,n,t){return{c:"#"+o(r)+o(e)+o(n),a:t}},A=function(r){var e,n=(r+"").trim().toLowerCase();return(e=K.exec(n))?p(e[1],e[2],e[3],1):(e=m.exec(n))?p(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(n))?p(e[1],e[2],e[3],e[4]):(e=h.exec(n))?p(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=f.exec(n))?s(e[1],e[2]/100,e[3]/100):(e=g.exec(n))?s(e[1],e[2]/100,e[3]/100,e[4]):{c:r,a:1}};c.PdfContext=function(r,e){if(null==r)throw new Error("Stream must be provided.");var n=this,t=new a(e);this.stream=t.pipe(r),this.doc=t,this.stack=[];var i=1,c="10px Helvetica";this.textAlign="left",this.textBaseline="alphabetic";var o=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z]+?)\s*$/i,s={style:"normal",size:10,family:"Helvetica",weight:"normal"};Object.defineProperty(this,"fillStyle",{get:function(){return n.doc.fillColor()},set:function(r){var e=A(r);n.doc.fillColor(e.c,e.a)}}),Object.defineProperty(this,"strokeStyle",{get:function(){return n.doc.strokeColor()},set:function(r){var e=A(r);n.doc.strokeColor(e.c,e.a)}}),Object.defineProperty(this,"lineWidth",{get:function(){return i},set:function(r){i=r,n.doc.lineWidth(r)}}),Object.defineProperty(this,"lineCap",{get:function(){return n.doc.lineCap()},set:function(r){n.doc.lineCap(r)}}),Object.defineProperty(this,"lineJoin",{get:function(){return n.doc.lineJoin()},set:function(r){n.doc.lineJoin(r)}}),Object.defineProperty(this,"globalAlpha",{get:function(){return n.doc.opacity()},set:function(r){r>=0&&r<=1&&n.doc.opacity(r)}}),Object.defineProperty(this,"font",{get:function(){return c},set:function(r){c=r;var e,t=null===(e=o.exec(n.font))?s:{style:e[1]||"normal",size:parseInt(e[4])||10,family:e[6]||"Helvetica",weight:e[3]||"normal"};n.doc.fontSize(t.size),n.doc.font(t.family),n.lineHeight=this.doc.currentLineHeight(!1)}}),n.lineHeight=this.doc.currentLineHeight(!1),this.font=c,this.strokeStyle="rgb(0,0,0)",this.fillStyle="rgb(0,0,0)"},c.PdfContext.prototype.addToPath=function(r,e){this.stack.push({command:r,params:e})},c.PdfContext.prototype.restorePath=function(){this.stack.forEach(r=>{this.doc[r.command].apply(this.doc,r.params)})},c.PdfContext.prototype.end=function(){this.addToPath("end",arguments),this.doc.end()},c.PdfContext.prototype.save=function(){this.doc.save()},c.PdfContext.prototype.restore=function(){this.doc.restore()},c.PdfContext.prototype.scale=function(r,e){this.doc.scale(r,e)},c.PdfContext.prototype.rotate=function(r){var e=180*r/Math.PI;this.doc.rotate(e)},c.PdfContext.prototype.translate=function(r,e){this.doc.translate(r,e)},c.PdfContext.prototype.beginPath=function(){this.addToPath("endPath",arguments),this.doc.endPath()},c.PdfContext.prototype.moveTo=function(r,e){this.addToPath("moveTo",arguments),this.doc.moveTo(r,e)},c.PdfContext.prototype.closePath=function(){this.addToPath("closePath"),this.doc.closePath()},c.PdfContext.prototype.lineTo=function(r,e){this.addToPath("lineTo",arguments),this.doc.lineTo(r,e)},c.PdfContext.prototype.stroke=function(){this.doc.stroke(),this.restorePath()},c.PdfContext.prototype.fill=function(){this.doc.fill(),this.restorePath()},c.PdfContext.prototype.rect=function(r,e,n,t){this.addToPath("rect",arguments),this.doc.rect(r,e,n,t)},c.PdfContext.prototype.fillRect=function(r,e,n,t){this.doc.endPath(),this.doc.rect(r,e,n,t),this.doc.fill(),this.restorePath()},c.PdfContext.prototype.strokeRect=function(r,e,n,t){this.doc.endPath(),this.doc.rect(r,e,n,t),this.doc.stroke(),this.restorePath()},c.PdfContext.prototype.clearRect=function(r,e,n,t){this.addToPath("clearRect",arguments);var a=this.doc.fillColor();this.doc.fillColor("white"),this.doc.rect(r,e,n,t),this.doc.fill(),this.doc.fillColor(a)},c.PdfContext.prototype.arc=function(r,e,n,t,a,i){this.addToPath("arc",arguments);var c=Math.PI,o=2*c,s=1e-6,u=o-s;r=+r,e=+e;var X=(n=+n)*Math.cos(t),l=n*Math.sin(t),P=r+X,K=e+l,m=1^i,d=i?t-a:a-t;if(n<0)throw new Error("negative radius: "+n);var h="";h+="M"+P+","+K,n&&(d<0&&(d=d%o+o),d>u?h+="A"+n+","+n+",0,1,"+m+","+(r-X)+","+(e-l)+"A"+n+","+n+",0,1,"+m+","+P+","+K:d>s&&(h+="A"+n+","+n+",0,"+ +(d>=c)+","+m+","+(r+n*Math.cos(a))+","+(e+n*Math.sin(a))),this.doc.path(h))},c.PdfContext.prototype.bezierCurveTo=function(r,e,n,t,a,i){this.addToPath("bezierCurveTo",arguments),this.doc.bezierCurveTo(r,e,n,t,a,i)},c.PdfContext.prototype.quadraticCurveTo=function(r,e,n,t){this.addToPath("quadraticCurveTo",arguments),this.doc.quadraticCurveTo(r,e,n,t)},c.PdfContext.prototype.createLinearGradient=function(r,e,n,t){var a=this.doc.linearGradient(r,e,n,t);return a.addColorStop=function(r,e){var n=A(e);a.stop(r,n.c,n.a)},a},c.PdfContext.prototype.createRadialGradient=function(r,e,n,t,a,i){var c=this.doc.radialGradient(r,e,n,t,a,i);return c.addColorStop=function(r,e){var n=A(e);c.stop(r,n.c,n.a)},c},c.PdfContext.prototype.adjustTextX=function(r,e){if("start"!==this.textAlign||"left"!==this.textAlign){var n=this.doc.widthOfString(r);"right"===this.textAlign||"end"===this.textAlign?e-=n:"center"===this.textAlign&&(e-=n/2)}return e},c.PdfContext.prototype.adjustTextY=function(r,e){var n=this.lineHeight;return"bottom"===this.textBaseline?e-=n:"middle"===this.textBaseline?e-=n/2:"alphabetic"===this.textBaseline&&(e-=n/2+1),e},c.PdfContext.prototype.fillText=function(r,e,n){e=this.adjustTextX(r,e),n=this.adjustTextY(r,n),this.doc.text(r,e,n,{lineBreak:!1,stroke:!1,fill:!0})},c.PdfContext.prototype.strokeText=function(r,e,n){this.addToPath("strokeText",arguments),e=this.adjustTextX(r,e),n=this.adjustTextY(r,n),this.doc.text(r,e,n,{lineBreak:!1,stroke:!0,fill:!1})},c.PdfContext.prototype.measureText=function(r){return r=""+r,{width:this.doc.widthOfString(r),height:this.lineHeight}},c.PdfContext.prototype.clip=function(){this.doc.clip()},c.PdfContext.prototype.drawImage=function(r){var e,n,t,a,i=Array.prototype.slice.call(arguments);r=i[0];if(3===i.length)e=i[1],n=i[2],t=r.width,a=r.height;else if(5===i.length)e=i[1],n=i[2],t=i[3],a=i[4],r.width,r.height;else{if(9!==i.length)throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);i[1],i[2],i[3],i[4],e=i[5],n=i[6],t=i[7],a=i[8]}if("IMG"===r.nodeName){var c=document.createElement("canvas");c.width=r.width,c.height=r.height,c.getContext("2d").drawImage(r,0,0);var o=c.toDataURL("image/png");this.doc.image(o,e,n,{width:t,height:a})}else this.doc.image(r,e,n,{width:t,height:a})},c.PdfContext.prototype.setTransform=function(){console.log("setTransform not implemented")},c.PdfContext.prototype.createPattern=function(r,e){console.log("createPattern not implemented")},c.PdfContext.prototype.setLineDash=function(r){console.log("setLineDash not implemented")},c.PdfContext.prototype.drawFocusRing=function(){console.log("drawFocusRing not implemented")},c.PdfContext.prototype.createImageData=function(){console.log("drawFocusRing not implemented")},c.PdfContext.prototype.getImageData=function(){console.log("getImageData not implemented")},c.PdfContext.prototype.putImageData=function(){console.log("putImageData not implemented")},c.PdfContext.prototype.globalCompositeOperation=function(){console.log("globalCompositeOperation not implemented")},c.PdfContext.prototype.arcTo=function(r,e,n,t,a){console.log("arcTo not implemented")}}("undefined"!=typeof window&&window)},1908:function(r,e,n){(function(e){r.exports=function r(e,n,t){function a(c,o){if(!n[c]){if(!e[c]){if(i)return i(c,!0);var s=new Error("Cannot find module '"+c+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[c]={exports:{}};e[c][0].call(u.exports,(function(r){return a(e[c][1][r]||r)}),u,u.exports,r,e,n,t)}return n[c].exports}for(var i=!1,c=0;c<t.length;c++)a(t[c]);return a}({1:[function(r,e,n){(function(n){(function(){"use strict";var t=r("stream"),a=r("fs"),i=r("zlib"),c=r("crypto-js"),o=r("fontkit"),s=r("events"),u=r("linebreak"),X=r("png-js");class l{toString(){throw new Error("Must be implemented by subclasses")}}class P{constructor(r={}){this._items={},this.limits="boolean"!=typeof r.limits||r.limits}add(r,e){return this._items[r]=e}get(r){return this._items[r]}toString(){const r=Object.keys(this._items).sort((r,e)=>this._compareKeys(r,e)),e=["<<"];if(this.limits&&r.length>1){const n=r[0],t=r[r.length-1];e.push(" /Limits "+h.convert([this._dataForKey(n),this._dataForKey(t)]))}e.push(` /${this._keysName()} [`);for(let n of r)e.push(` ${h.convert(this._dataForKey(n))} ${h.convert(this._items[n])}`);return e.push("]"),e.push(">>"),e.join("\n")}_compareKeys(){throw new Error("Must be implemented by subclasses")}_keysName(){throw new Error("Must be implemented by subclasses")}_dataForKey(){throw new Error("Must be implemented by subclasses")}}const K=(r,e)=>(Array(e+1).join("0")+r).slice(-e),m=/[\n\r\t\b\f()\\]/g,d={"\n":"\\n","\r":"\\r","\t":"\\t","\b":"\\b","\f":"\\f","\\":"\\\\","(":"\\(",")":"\\)"};class h{static convert(r,e=null){if("string"==typeof r)return"/"+r;if(r instanceof String){let t,a=r,i=!1;for(let r=0,e=a.length;r<e;r++)if(a.charCodeAt(r)>127){i=!0;break}return t=i?function(r){const e=r.length;if(1&e)throw new Error("Buffer length must be even");for(let n=0,t=e-1;n<t;n+=2){const e=r[n];r[n]=r[n+1],r[n+1]=e}return r}(n.from("\ufeff"+a,"utf16le")):n.from(a.valueOf(),"ascii"),a=e?e(t).toString("binary"):t.toString("binary"),a=a.replace(m,r=>d[r]),`(${a})`}if(n.isBuffer(r))return`<${r.toString("hex")}>`;if(r instanceof l||r instanceof P)return r.toString();if(r instanceof Date){let t="D:"+K(r.getUTCFullYear(),4)+K(r.getUTCMonth()+1,2)+K(r.getUTCDate(),2)+K(r.getUTCHours(),2)+K(r.getUTCMinutes(),2)+K(r.getUTCSeconds(),2)+"Z";return e&&(t=e(n.from(t,"ascii")).toString("binary"),t=t.replace(m,r=>d[r])),`(${t})`}if(Array.isArray(r))return`[${r.map(r=>h.convert(r,e)).join(" ")}]`;if("[object Object]"==={}.toString.call(r)){const n=["<<"];for(let t in r){const a=r[t];n.push(`/${t} ${h.convert(a,e)}`)}return n.push(">>"),n.join("\n")}return"number"==typeof r?h.number(r):""+r}static number(r){if(r>-1e21&&r<1e21)return Math.round(1e6*r)/1e6;throw new Error("unsupported number: "+r)}}class f extends l{constructor(r,e,n={}){super(),this.document=r,this.id=e,this.data=n,this.gen=0,this.compress=this.document.compress&&!this.data.Filter,this.uncompressedLength=0,this.buffer=[]}write(r){if(n.isBuffer(r)||(r=n.from(r+"\n","binary")),this.uncompressedLength+=r.length,null==this.data.Length&&(this.data.Length=0),this.buffer.push(r),this.data.Length+=r.length,this.compress)return this.data.Filter="FlateDecode"}end(r){return r&&this.write(r),this.finalize()}finalize(){this.offset=this.document._offset;const r=this.document._security?this.document._security.getEncryptFn(this.id,this.gen):null;this.buffer.length&&(this.buffer=n.concat(this.buffer),this.compress&&(this.buffer=i.deflateSync(this.buffer)),r&&(this.buffer=r(this.buffer)),this.data.Length=this.buffer.length),this.document._write(`${this.id} ${this.gen} obj`),this.document._write(h.convert(this.data,r)),this.buffer.length&&(this.document._write("stream"),this.document._write(this.buffer),this.buffer=[],this.document._write("\nendstream")),this.document._write("endobj"),this.document._refEnd(this)}toString(){return`${this.id} ${this.gen} R`}}const g={top:72,left:72,bottom:72,right:72},p={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]};class A{constructor(r,e={}){this.document=r,this.size=e.size||"letter",this.layout=e.layout||"portrait","number"==typeof e.margin?this.margins={top:e.margin,left:e.margin,bottom:e.margin,right:e.margin}:this.margins=e.margins||g;const n=Array.isArray(this.size)?this.size:p[this.size.toUpperCase()];this.width=n["portrait"===this.layout?0:1],this.height=n["portrait"===this.layout?1:0],this.content=this.document.ref(),this.resources=this.document.ref({ProcSet:["PDF","Text","ImageB","ImageC","ImageI"]}),this.dictionary=this.document.ref({Type:"Page",Parent:this.document._root.data.Pages,MediaBox:[0,0,this.width,this.height],Contents:this.content,Resources:this.resources}),this.markings=[]}get fonts(){const r=this.resources.data;return null!=r.Font?r.Font:r.Font={}}get xobjects(){const r=this.resources.data;return null!=r.XObject?r.XObject:r.XObject={}}get ext_gstates(){const r=this.resources.data;return null!=r.ExtGState?r.ExtGState:r.ExtGState={}}get patterns(){const r=this.resources.data;return null!=r.Pattern?r.Pattern:r.Pattern={}}get colorSpaces(){const r=this.resources.data;return r.ColorSpace||(r.ColorSpace={})}get annotations(){const r=this.dictionary.data;return null!=r.Annots?r.Annots:r.Annots=[]}get structParentTreeKey(){const r=this.dictionary.data;return null!=r.StructParents?r.StructParents:r.StructParents=this.document.createStructParentTreeNextKey()}maxY(){return this.height-this.margins.bottom}write(r){return this.content.write(r)}end(){return this.dictionary.end(),this.resources.end(),this.content.end()}}class v extends P{_compareKeys(r,e){return r.localeCompare(e)}_keysName(){return"Names"}_dataForKey(r){return new String(r)}}function y(r,e){if(r<e[0])return!1;let n=0,t=e.length/2;for(;n<=t;){const a=Math.floor((n+t)/2),i=2*a;if(r>=e[i]&&r<=e[i+1])return!0;r>e[i+1]?n=a+1:t=a-1}return!1}const C=[545,545,564,591,686,687,751,767,848,863,880,883,886,889,891,893,895,899,907,907,909,909,930,930,975,975,1015,1023,1159,1159,1231,1231,1270,1271,1274,1279,1296,1328,1367,1368,1376,1376,1416,1416,1419,1424,1442,1442,1466,1466,1477,1487,1515,1519,1525,1547,1549,1562,1564,1566,1568,1568,1595,1599,1622,1631,1774,1775,1791,1791,1806,1806,1837,1839,1867,1919,1970,2304,2308,2308,2362,2363,2382,2383,2389,2391,2417,2432,2436,2436,2445,2446,2449,2450,2473,2473,2481,2481,2483,2485,2490,2491,2493,2493,2501,2502,2505,2506,2510,2518,2520,2523,2526,2526,2532,2533,2555,2561,2563,2564,2571,2574,2577,2578,2601,2601,2609,2609,2612,2612,2615,2615,2618,2619,2621,2621,2627,2630,2633,2634,2638,2648,2653,2653,2655,2661,2677,2688,2692,2692,2700,2700,2702,2702,2706,2706,2729,2729,2737,2737,2740,2740,2746,2747,2758,2758,2762,2762,2766,2767,2769,2783,2785,2789,2800,2816,2820,2820,2829,2830,2833,2834,2857,2857,2865,2865,2868,2869,2874,2875,2884,2886,2889,2890,2894,2901,2904,2907,2910,2910,2914,2917,2929,2945,2948,2948,2955,2957,2961,2961,2966,2968,2971,2971,2973,2973,2976,2978,2981,2983,2987,2989,2998,2998,3002,3005,3011,3013,3017,3017,3022,3030,3032,3046,3059,3072,3076,3076,3085,3085,3089,3089,3113,3113,3124,3124,3130,3133,3141,3141,3145,3145,3150,3156,3159,3167,3170,3173,3184,3201,3204,3204,3213,3213,3217,3217,3241,3241,3252,3252,3258,3261,3269,3269,3273,3273,3278,3284,3287,3293,3295,3295,3298,3301,3312,3329,3332,3332,3341,3341,3345,3345,3369,3369,3386,3389,3396,3397,3401,3401,3406,3414,3416,3423,3426,3429,3440,3457,3460,3460,3479,3481,3506,3506,3516,3516,3518,3519,3527,3529,3531,3534,3541,3541,3543,3543,3552,3569,3573,3584,3643,3646,3676,3712,3715,3715,3717,3718,3721,3721,3723,3724,3726,3731,3736,3736,3744,3744,3748,3748,3750,3750,3752,3753,3756,3756,3770,3770,3774,3775,3781,3781,3783,3783,3790,3791,3802,3803,3806,3839,3912,3912,3947,3952,3980,3983,3992,3992,4029,4029,4045,4046,4048,4095,4130,4130,4136,4136,4139,4139,4147,4149,4154,4159,4186,4255,4294,4303,4345,4346,4348,4351,4442,4446,4515,4519,4602,4607,4615,4615,4679,4679,4681,4681,4686,4687,4695,4695,4697,4697,4702,4703,4743,4743,4745,4745,4750,4751,4783,4783,4785,4785,4790,4791,4799,4799,4801,4801,4806,4807,4815,4815,4823,4823,4847,4847,4879,4879,4881,4881,4886,4887,4895,4895,4935,4935,4955,4960,4989,5023,5109,5120,5751,5759,5789,5791,5873,5887,5901,5901,5909,5919,5943,5951,5972,5983,5997,5997,6001,6001,6004,6015,6109,6111,6122,6143,6159,6159,6170,6175,6264,6271,6314,7679,7836,7839,7930,7935,7958,7959,7966,7967,8006,8007,8014,8015,8024,8024,8026,8026,8028,8028,8030,8030,8062,8063,8117,8117,8133,8133,8148,8149,8156,8156,8176,8177,8181,8181,8191,8191,8275,8278,8280,8286,8292,8297,8306,8307,8335,8351,8370,8399,8427,8447,8507,8508,8524,8530,8580,8591,9167,9215,9255,9279,9291,9311,9471,9471,9748,9749,9752,9752,9854,9855,9866,9984,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10079,10080,10133,10135,10160,10160,10175,10191,10220,10223,11008,11903,11930,11930,12020,12031,12246,12271,12284,12287,12352,12352,12439,12440,12544,12548,12589,12592,12687,12687,12728,12783,12829,12831,12868,12880,12924,12926,13004,13007,13055,13055,13175,13178,13278,13279,13311,13311,19894,19967,40870,40959,42125,42127,42183,44031,55204,55295,64046,64047,64107,64255,64263,64274,64280,64284,64311,64311,64317,64317,64319,64319,64322,64322,64325,64325,64434,64466,64832,64847,64912,64913,64968,64975,65021,65023,65040,65055,65060,65071,65095,65096,65107,65107,65127,65127,65132,65135,65141,65141,65277,65278,65280,65280,65471,65473,65480,65481,65488,65489,65496,65497,65501,65503,65511,65511,65519,65528,65536,66303,66335,66335,66340,66351,66379,66559,66598,66599,66638,118783,119030,119039,119079,119081,119262,119807,119893,119893,119965,119965,119968,119969,119971,119972,119975,119976,119981,119981,119994,119994,119996,119996,120001,120001,120004,120004,120070,120070,120075,120076,120085,120085,120093,120093,120122,120122,120127,120127,120133,120133,120135,120137,120145,120145,120484,120487,120778,120781,120832,131069,173783,194559,195102,196605,196608,262141,262144,327677,327680,393213,393216,458749,458752,524285,524288,589821,589824,655357,655360,720893,720896,786429,786432,851965,851968,917501,917504,917504,917506,917535,917632,983037],b=r=>y(r,C),W=[173,173,847,847,6150,6150,6155,6155,6156,6156,6157,6157,8203,8203,8204,8204,8205,8205,8288,8288,65024,65024,65025,65025,65026,65026,65027,65027,65028,65028,65029,65029,65030,65030,65031,65031,65032,65032,65033,65033,65034,65034,65035,65035,65036,65036,65037,65037,65038,65038,65039,65039,65279,65279],B=[160,160,5760,5760,8192,8192,8193,8193,8194,8194,8195,8195,8196,8196,8197,8197,8198,8198,8199,8199,8200,8200,8201,8201,8202,8202,8203,8203,8239,8239,8287,8287,12288,12288],N=[128,159,1757,1757,1807,1807,6158,6158,8204,8204,8205,8205,8232,8232,8233,8233,8288,8288,8289,8289,8290,8290,8291,8291,8298,8303,65279,65279,65529,65532,119155,119162],x=[64976,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1114110,1114111],O=[0,31,127,127,832,832,833,833,8206,8206,8207,8207,8234,8234,8235,8235,8236,8236,8237,8237,8238,8238,8298,8298,8299,8299,8300,8300,8301,8301,8302,8302,8303,8303,12272,12283,55296,57343,57344,63743,65529,65529,65530,65530,65531,65531,65532,65532,65533,65533,917505,917505,917536,917631,983040,1048573,1048576,1114109],w=r=>y(r,B)||y(r,O)||y(r,N)||y(r,x),k=[1470,1470,1472,1472,1475,1475,1488,1514,1520,1524,1563,1563,1567,1567,1569,1594,1600,1610,1645,1647,1649,1749,1757,1757,1765,1766,1786,1790,1792,1805,1808,1808,1810,1836,1920,1957,1969,1969,8207,8207,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65020,65136,65140,65142,65276],T=r=>y(r,k),U=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,544,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,1013,1024,1154,1162,1230,1232,1269,1272,1273,1280,1295,1329,1366,1369,1375,1377,1415,1417,1417,2307,2307,2309,2361,2365,2368,2377,2380,2384,2384,2392,2401,2404,2416,2434,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2494,2496,2503,2504,2507,2508,2519,2519,2524,2525,2527,2529,2534,2545,2548,2554,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2622,2624,2649,2652,2654,2654,2662,2671,2674,2676,2691,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2752,2761,2761,2763,2764,2768,2768,2784,2784,2790,2799,2818,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2878,2880,2880,2887,2888,2891,2892,2903,2903,2908,2909,2911,2913,2918,2928,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3007,3009,3010,3014,3016,3018,3020,3031,3031,3047,3058,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3137,3140,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3262,3264,3268,3271,3272,3274,3275,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3392,3398,3400,3402,3404,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3535,3537,3544,3551,3570,3572,3585,3632,3634,3635,3648,3654,3663,3675,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3792,3801,3804,3805,3840,3863,3866,3892,3894,3894,3896,3896,3902,3911,3913,3946,3967,3967,3973,3973,3976,3979,4030,4037,4039,4044,4047,4047,4096,4129,4131,4135,4137,4138,4140,4140,4145,4145,4152,4152,4160,4183,4256,4293,4304,4344,4347,4347,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4961,4988,5024,5108,5121,5750,5761,5786,5792,5872,5888,5900,5902,5905,5920,5937,5941,5942,5952,5969,5984,5996,5998,6e3,6016,6070,6078,6085,6087,6088,6100,6106,6108,6108,6112,6121,6160,6169,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8206,8206,8305,8305,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8509,8511,8517,8521,8544,8579,9014,9082,9109,9109,9372,9449,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12588,12593,12686,12688,12727,12784,12828,12832,12867,12896,12923,12927,12976,12992,13003,13008,13054,13056,13174,13179,13277,13280,13310,13312,19893,19968,40869,40960,42124,44032,55203,55296,64045,64048,64106,64256,64262,64275,64279,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,66304,66334,66336,66339,66352,66378,66560,66597,66600,66637,118784,119029,119040,119078,119082,119142,119146,119154,119171,119172,119180,119209,119214,119261,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,12e4,120002,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120483,120488,120777,131072,173782,194560,195101,983040,1048573,1048576,1114109],_=r=>y(r,U),Y=r=>y(r,B),S=r=>y(r,W),R=r=>r.codePointAt(0);function E(r){const e=[],n=r.length;for(let t=0;t<n;t+=1){const a=r.charCodeAt(t);if(a>=55296&&a<=56319&&n>t+1){const n=r.charCodeAt(t+1);if(n>=56320&&n<=57343){e.push(1024*(a-55296)+n-56320+65536),t+=1;continue}}e.push(a)}return e}class L{static generateFileID(r={}){let e=r.CreationDate.getTime()+"\n";for(let n in r)r.hasOwnProperty(n)&&(e+=`${n}: ${r[n].valueOf()}\n`);return z(c.MD5(e))}static generateRandomWordArray(r){return c.lib.WordArray.random(r)}static create(r,e={}){return e.ownerPassword||e.userPassword?new L(r,e):null}constructor(r,e={}){if(!e.ownerPassword&&!e.userPassword)throw new Error("None of owner password and user password is defined.");this.document=r,this._setupEncryption(e)}_setupEncryption(r){switch(r.pdfVersion){case"1.4":case"1.5":this.version=2;break;case"1.6":case"1.7":this.version=4;break;case"1.7ext3":this.version=5;break;default:this.version=1}const e={Filter:"Standard"};switch(this.version){case 1:case 2:case 4:this._setupEncryptionV1V2V4(this.version,e,r);break;case 5:this._setupEncryptionV5(e,r)}this.dictionary=this.document.ref(e)}_setupEncryptionV1V2V4(r,e,n){let t,a;switch(r){case 1:t=2,this.keyBits=40,a=function(r={}){let e=-64;return r.printing&&(e|=4),r.modifying&&(e|=8),r.copying&&(e|=16),r.annotating&&(e|=32),e}(n.permissions);break;case 2:t=3,this.keyBits=128,a=D(n.permissions);break;case 4:t=4,this.keyBits=128,a=D(n.permissions)}const i=F(n.userPassword),o=n.ownerPassword?F(n.ownerPassword):i,s=function(r,e,n,t){let a=t,i=r>=3?51:1;for(let r=0;r<i;r++)a=c.MD5(a);const o=a.clone();o.sigBytes=e/8;let s=n;i=r>=3?20:1;for(let r=0;r<i;r++){const e=Math.ceil(o.sigBytes/4);for(let n=0;n<e;n++)o.words[n]=a.words[n]^(r|r<<8|r<<16|r<<24);s=c.RC4.encrypt(s,o).ciphertext}return s}(t,this.keyBits,i,o);let u;var X;this.encryptionKey=function(r,e,n,t,a,i){let o=t.clone().concat(a).concat(c.lib.WordArray.create([I(i)],4)).concat(c.lib.WordArray.create(n));const s=r>=3?51:1;for(let r=0;r<s;r++)o=c.MD5(o),o.sigBytes=e/8;return o}(t,this.keyBits,this.document._id,i,s,a),2===t?(X=this.encryptionKey,u=c.RC4.encrypt(F(),X).ciphertext):u=function(r,e){const n=e.clone();let t=c.MD5(F().concat(c.lib.WordArray.create(r)));for(let r=0;r<20;r++){const a=Math.ceil(n.sigBytes/4);for(let t=0;t<a;t++)n.words[t]=e.words[t]^(r|r<<8|r<<16|r<<24);t=c.RC4.encrypt(t,n).ciphertext}return t.concat(c.lib.WordArray.create(null,16))}(this.document._id,this.encryptionKey),e.V=r,r>=2&&(e.Length=this.keyBits),4===r&&(e.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV2",Length:this.keyBits/8}},e.StmF="StdCF",e.StrF="StdCF"),e.R=t,e.O=z(s),e.U=z(u),e.P=a}_setupEncryptionV5(r,e){this.keyBits=256;const n=D(e.permissions),t=V(e.userPassword),a=e.ownerPassword?V(e.ownerPassword):t;this.encryptionKey=(0,L.generateRandomWordArray)(32);const i=function(r,e){const n=e(8),t=e(8);return c.SHA256(r.clone().concat(n)).concat(n).concat(t)}(t,L.generateRandomWordArray),o=function(r,e,n){const t=c.SHA256(r.clone().concat(e)),a={mode:c.mode.CBC,padding:c.pad.NoPadding,iv:c.lib.WordArray.create(null,16)};return c.AES.encrypt(n,t,a).ciphertext}(t,c.lib.WordArray.create(i.words.slice(10,12),8),this.encryptionKey),s=function(r,e,n){const t=n(8),a=n(8);return c.SHA256(r.clone().concat(t).concat(e)).concat(t).concat(a)}(a,i,L.generateRandomWordArray),u=function(r,e,n,t){const a=c.SHA256(r.clone().concat(e).concat(n)),i={mode:c.mode.CBC,padding:c.pad.NoPadding,iv:c.lib.WordArray.create(null,16)};return c.AES.encrypt(t,a,i).ciphertext}(a,c.lib.WordArray.create(s.words.slice(10,12),8),i,this.encryptionKey),X=function(r,e,n){const t=c.lib.WordArray.create([I(r),4294967295,1415668834],12).concat(n(4)),a={mode:c.mode.ECB,padding:c.pad.NoPadding};return c.AES.encrypt(t,e,a).ciphertext}(n,this.encryptionKey,L.generateRandomWordArray);r.V=5,r.Length=this.keyBits,r.CF={StdCF:{AuthEvent:"DocOpen",CFM:"AESV3",Length:this.keyBits/8}},r.StmF="StdCF",r.StrF="StdCF",r.R=5,r.O=z(s),r.OE=z(u),r.U=z(i),r.UE=z(o),r.P=n,r.Perms=z(X)}getEncryptFn(r,e){let n,t;if(this.version<5&&(n=this.encryptionKey.clone().concat(c.lib.WordArray.create([(255&r)<<24|(65280&r)<<8|r>>8&65280|255&e,(65280&e)<<16],5))),1===this.version||2===this.version){let r=c.MD5(n);return r.sigBytes=Math.min(16,this.keyBits/8+5),e=>z(c.RC4.encrypt(c.lib.WordArray.create(e),r).ciphertext)}t=4===this.version?c.MD5(n.concat(c.lib.WordArray.create([1933667412],4))):this.encryptionKey;const a=L.generateRandomWordArray(16),i={mode:c.mode.CBC,padding:c.pad.Pkcs7,iv:a};return r=>z(a.clone().concat(c.AES.encrypt(c.lib.WordArray.create(r),t,i).ciphertext))}end(){this.dictionary.end()}}function D(r={}){let e=-3904;return"lowResolution"===r.printing&&(e|=4),"highResolution"===r.printing&&(e|=2052),r.modifying&&(e|=8),r.copying&&(e|=16),r.annotating&&(e|=32),r.fillingForms&&(e|=256),r.contentAccessibility&&(e|=512),r.documentAssembly&&(e|=1024),e}function F(r=""){const e=n.alloc(32),t=r.length;let a=0;for(;a<t&&a<32;){const n=r.charCodeAt(a);if(n>255)throw new Error("Password contains one or more invalid characters.");e[a]=n,a++}for(;a<32;)e[a]=q[a-t],a++;return c.lib.WordArray.create(e)}function V(r=""){r=unescape(encodeURIComponent(function(r,e={}){if("string"!=typeof r)throw new TypeError("Expected string.");if(0===r.length)return"";const n=E(r).map(r=>Y(r)?32:r).filter(r=>!S(r)),t=String.fromCodePoint.apply(null,n).normalize("NFKC"),a=E(t);if(a.some(w))throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3");if(!0!==e.allowUnassigned&&a.some(b))throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5");const i=a.some(T),c=a.some(_);if(i&&c)throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6");const o=T(R(t[0])),s=T(R((r=>r[r.length-1])(t)));if(i&&(!o||!s))throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6");return t}(r)));const e=Math.min(127,r.length),t=n.alloc(e);for(let n=0;n<e;n++)t[n]=r.charCodeAt(n);return c.lib.WordArray.create(t)}function I(r){return(255&r)<<24|(65280&r)<<8|r>>8&65280|r>>24&255}function z(r){const e=[];for(let n=0;n<r.sigBytes;n++)e.push(r.words[Math.floor(n/4)]>>8*(3-n%4)&255);return n.from(e)}const q=[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],{number:M}=h;class j{constructor(r){this.doc=r,this.stops=[],this.embedded=!1,this.transform=[1,0,0,1,0,0]}stop(r,e,n){if(null==n&&(n=1),e=this.doc._normalizeColor(e),0===this.stops.length)if(3===e.length)this._colorSpace="DeviceRGB";else if(4===e.length)this._colorSpace="DeviceCMYK";else{if(1!==e.length)throw new Error("Unknown color space");this._colorSpace="DeviceGray"}else if("DeviceRGB"===this._colorSpace&&3!==e.length||"DeviceCMYK"===this._colorSpace&&4!==e.length||"DeviceGray"===this._colorSpace&&1!==e.length)throw new Error("All gradient stops must use the same color space");return n=Math.max(0,Math.min(1,n)),this.stops.push([r,e,n]),this}setTransform(r,e,n,t,a,i){return this.transform=[r,e,n,t,a,i],this}embed(r){let e;const n=this.stops.length;if(0===n)return;this.embedded=!0,this.matrix=r;const t=this.stops[n-1];t[0]<1&&this.stops.push([1,t[1],t[2]]);const a=[],i=[],c=[];for(let r=0;r<n-1;r++)i.push(0,1),r+2!==n&&a.push(this.stops[r+1][0]),e=this.doc.ref({FunctionType:2,Domain:[0,1],C0:this.stops[r+0][1],C1:this.stops[r+1][1],N:1}),c.push(e),e.end();1===n?e=c[0]:(e=this.doc.ref({FunctionType:3,Domain:[0,1],Functions:c,Bounds:a,Encode:i}),e.end()),this.id="Sh"+ ++this.doc._gradCount;const o=this.shader(e);o.end();const s=this.doc.ref({Type:"Pattern",PatternType:2,Shading:o,Matrix:this.matrix.map(M)});if(s.end(),this.stops.some(r=>r[2]<1)){let r=this.opacityGradient();r._colorSpace="DeviceGray";for(let e of this.stops)r.stop(e[0],[e[2]]);r=r.embed(this.matrix);const e=[0,0,this.doc.page.width,this.doc.page.height],n=this.doc.ref({Type:"XObject",Subtype:"Form",FormType:1,BBox:e,Group:{Type:"Group",S:"Transparency",CS:"DeviceGray"},Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Pattern:{Sh1:r}}});n.write("/Pattern cs /Sh1 scn"),n.end(e.join(" ")+" re f");const t=this.doc.ref({Type:"ExtGState",SMask:{Type:"Mask",S:"Luminosity",G:n}});t.end();const a=this.doc.ref({Type:"Pattern",PatternType:1,PaintType:1,TilingType:2,BBox:e,XStep:e[2],YStep:e[3],Resources:{ProcSet:["PDF","Text","ImageB","ImageC","ImageI"],Pattern:{Sh1:s},ExtGState:{Gs1:t}}});a.write("/Gs1 gs /Pattern cs /Sh1 scn"),a.end(e.join(" ")+" re f"),this.doc.page.patterns[this.id]=a}else this.doc.page.patterns[this.id]=s;return s}apply(r){const[e,n,t,a,i,c]=this.doc._ctm,[o,s,u,X,l,P]=this.transform,K=[e*o+t*s,n*o+a*s,e*u+t*X,n*u+a*X,e*l+t*P+i,n*l+a*P+c];this.embedded&&K.join(" ")===this.matrix.join(" ")||this.embed(K),this.doc._setColorSpace("Pattern",r);const m=r?"SCN":"scn";return this.doc.addContent(`/${this.id} ${m}`)}}class G extends j{constructor(r,e,n,t,a){super(r),this.x1=e,this.y1=n,this.x2=t,this.y2=a}shader(r){return this.doc.ref({ShadingType:2,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.x2,this.y2],Function:r,Extend:[!0,!0]})}opacityGradient(){return new G(this.doc,this.x1,this.y1,this.x2,this.y2)}}class J extends j{constructor(r,e,n,t,a,i,c){super(r),this.doc=r,this.x1=e,this.y1=n,this.r1=t,this.x2=a,this.y2=i,this.r2=c}shader(r){return this.doc.ref({ShadingType:3,ColorSpace:this._colorSpace,Coords:[this.x1,this.y1,this.r1,this.x2,this.y2,this.r2],Function:r,Extend:[!0,!0]})}opacityGradient(){return new J(this.doc,this.x1,this.y1,this.r1,this.x2,this.y2,this.r2)}}var H={PDFGradient:j,PDFLinearGradient:G,PDFRadialGradient:J};const Z=["DeviceCMYK","DeviceRGB"];var Q={PDFTilingPattern:class{constructor(r,e,n,t,a){this.doc=r,this.bBox=e,this.xStep=n,this.yStep=t,this.stream=a}createPattern(){const r=this.doc.ref();r.end();const[e,n,t,a,i,c]=this.doc._ctm,[o,s,u,X,l,P]=[1,0,0,1,0,0],K=[e*o+t*s,n*o+a*s,e*u+t*X,n*u+a*X,e*l+t*P+i,n*l+a*P+c],m=this.doc.ref({Type:"Pattern",PatternType:1,PaintType:2,TilingType:2,BBox:this.bBox,XStep:this.xStep,YStep:this.yStep,Matrix:K.map(r=>+r.toFixed(5)),Resources:r});return m.end(this.stream),m}embedPatternColorSpaces(){Z.forEach(r=>{const e=this.getPatternColorSpaceId(r);if(this.doc.page.colorSpaces[e])return;const n=this.doc.ref(["Pattern",r]);n.end(),this.doc.page.colorSpaces[e]=n})}getPatternColorSpaceId(r){return"CsP"+r}embed(){this.id||(this.doc._patternCount=this.doc._patternCount+1,this.id="P"+this.doc._patternCount,this.pattern=this.createPattern()),this.doc.page.patterns[this.id]||(this.doc.page.patterns[this.id]=this.pattern)}apply(r,e){this.embedPatternColorSpaces(),this.embed();const n=this.doc._normalizeColor(e);if(!n)throw Error(`invalid pattern color. (value: ${e})`);const t=this.getPatternColorSpaceId(this.doc._getColorSpace(n));this.doc._setColorSpace(t,r);const a=r?"SCN":"scn";return this.doc.addContent(`${n.join(" ")} /${this.id} ${a}`)}}};const{PDFGradient:$,PDFLinearGradient:rr,PDFRadialGradient:er}=H,{PDFTilingPattern:nr}=Q;var tr={initColor(){return this._opacityRegistry={},this._opacityCount=0,this._patternCount=0,this._gradCount=0},_normalizeColor(r){if("string"==typeof r)if("#"===r.charAt(0)){4===r.length&&(r=r.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i,"#$1$1$2$2$3$3"));const e=parseInt(r.slice(1),16);r=[e>>16,e>>8&255,255&e]}else ar[r]&&(r=ar[r]);return Array.isArray(r)?(3===r.length?r=r.map(r=>r/255):4===r.length&&(r=r.map(r=>r/100)),r):null},_setColor(r,e){return r instanceof $?(r.apply(e),!0):Array.isArray(r)&&r[0]instanceof nr?(r[0].apply(e,r[1]),!0):this._setColorCore(r,e)},_setColorCore(r,e){if(!(r=this._normalizeColor(r)))return!1;const n=e?"SCN":"scn",t=this._getColorSpace(r);return this._setColorSpace(t,e),r=r.join(" "),this.addContent(`${r} ${n}`),!0},_setColorSpace(r,e){const n=e?"CS":"cs";return this.addContent(`/${r} ${n}`)},_getColorSpace:r=>4===r.length?"DeviceCMYK":"DeviceRGB",fillColor(r,e){return this._setColor(r,!1)&&this.fillOpacity(e),this._fillColor=[r,e],this},strokeColor(r,e){return this._setColor(r,!0)&&this.strokeOpacity(e),this},opacity(r){return this._doOpacity(r,r),this},fillOpacity(r){return this._doOpacity(r,null),this},strokeOpacity(r){return this._doOpacity(null,r),this},_doOpacity(r,e){let n,t;if(null==r&&null==e)return;null!=r&&(r=Math.max(0,Math.min(1,r))),null!=e&&(e=Math.max(0,Math.min(1,e)));const a=`${r}_${e}`;return this._opacityRegistry[a]?[n,t]=this._opacityRegistry[a]:(n={Type:"ExtGState"},null!=r&&(n.ca=r),null!=e&&(n.CA=e),n=this.ref(n),n.end(),t="Gs"+ ++this._opacityCount,this._opacityRegistry[a]=[n,t]),this.page.ext_gstates[t]=n,this.addContent(`/${t} gs`)},linearGradient(r,e,n,t){return new rr(this,r,e,n,t)},radialGradient(r,e,n,t,a,i){return new er(this,r,e,n,t,a,i)},pattern(r,e,n,t){return new nr(this,r,e,n,t)}},ar={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let ir,cr,or,sr,ur,Xr;ir=cr=or=sr=ur=Xr=0;const lr={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},Pr={M:(r,e)=>(ir=e[0],cr=e[1],or=sr=null,ur=ir,Xr=cr,r.moveTo(ir,cr)),m:(r,e)=>(ir+=e[0],cr+=e[1],or=sr=null,ur=ir,Xr=cr,r.moveTo(ir,cr)),C:(r,e)=>(ir=e[4],cr=e[5],or=e[2],sr=e[3],r.bezierCurveTo(...e)),c:(r,e)=>(r.bezierCurveTo(e[0]+ir,e[1]+cr,e[2]+ir,e[3]+cr,e[4]+ir,e[5]+cr),or=ir+e[2],sr=cr+e[3],ir+=e[4],cr+=e[5]),S:(r,e)=>(null===or&&(or=ir,sr=cr),r.bezierCurveTo(ir-(or-ir),cr-(sr-cr),e[0],e[1],e[2],e[3]),or=e[0],sr=e[1],ir=e[2],cr=e[3]),s:(r,e)=>(null===or&&(or=ir,sr=cr),r.bezierCurveTo(ir-(or-ir),cr-(sr-cr),ir+e[0],cr+e[1],ir+e[2],cr+e[3]),or=ir+e[0],sr=cr+e[1],ir+=e[2],cr+=e[3]),Q:(r,e)=>(or=e[0],sr=e[1],ir=e[2],cr=e[3],r.quadraticCurveTo(e[0],e[1],ir,cr)),q:(r,e)=>(r.quadraticCurveTo(e[0]+ir,e[1]+cr,e[2]+ir,e[3]+cr),or=ir+e[0],sr=cr+e[1],ir+=e[2],cr+=e[3]),T:(r,e)=>(null===or?(or=ir,sr=cr):(or=ir-(or-ir),sr=cr-(sr-cr)),r.quadraticCurveTo(or,sr,e[0],e[1]),or=ir-(or-ir),sr=cr-(sr-cr),ir=e[0],cr=e[1]),t:(r,e)=>(null===or?(or=ir,sr=cr):(or=ir-(or-ir),sr=cr-(sr-cr)),r.quadraticCurveTo(or,sr,ir+e[0],cr+e[1]),ir+=e[0],cr+=e[1]),A:(r,e)=>(Kr(r,ir,cr,e),ir=e[5],cr=e[6]),a:(r,e)=>(e[5]+=ir,e[6]+=cr,Kr(r,ir,cr,e),ir=e[5],cr=e[6]),L:(r,e)=>(ir=e[0],cr=e[1],or=sr=null,r.lineTo(ir,cr)),l:(r,e)=>(ir+=e[0],cr+=e[1],or=sr=null,r.lineTo(ir,cr)),H:(r,e)=>(ir=e[0],or=sr=null,r.lineTo(ir,cr)),h:(r,e)=>(ir+=e[0],or=sr=null,r.lineTo(ir,cr)),V:(r,e)=>(cr=e[0],or=sr=null,r.lineTo(ir,cr)),v:(r,e)=>(cr+=e[0],or=sr=null,r.lineTo(ir,cr)),Z:r=>(r.closePath(),ir=ur,cr=Xr),z:r=>(r.closePath(),ir=ur,cr=Xr)},Kr=function(r,e,n,t){const[a,i,c,o,s,u,X]=t,l=mr(u,X,a,i,o,s,c,e,n);for(let e of l){const n=dr(...e);r.bezierCurveTo(...n)}},mr=function(r,e,n,t,a,i,c,o,s){const u=c*(Math.PI/180),X=Math.sin(u),l=Math.cos(u);n=Math.abs(n),t=Math.abs(t),or=l*(o-r)*.5+X*(s-e)*.5,sr=l*(s-e)*.5-X*(o-r)*.5;let P=or*or/(n*n)+sr*sr/(t*t);P>1&&(P=Math.sqrt(P),n*=P,t*=P);const K=l/n,m=X/n,d=-X/t,h=l/t,f=K*o+m*s,g=d*o+h*s,p=K*r+m*e,A=d*r+h*e;let v=1/((p-f)*(p-f)+(A-g)*(A-g))-.25;v<0&&(v=0);let y=Math.sqrt(v);i===a&&(y=-y);const C=.5*(f+p)-y*(A-g),b=.5*(g+A)+y*(p-f),W=Math.atan2(g-b,f-C);let B=Math.atan2(A-b,p-C)-W;B<0&&1===i?B+=2*Math.PI:B>0&&0===i&&(B-=2*Math.PI);const N=Math.ceil(Math.abs(B/(.5*Math.PI+.001))),x=[];for(let r=0;r<N;r++){const e=W+r*B/N,a=W+(r+1)*B/N;x[r]=[C,b,e,a,n,t,X,l]}return x},dr=function(r,e,n,t,a,i,c,o){const s=o*a,u=-c*i,X=c*a,l=o*i,P=.5*(t-n),K=8/3*Math.sin(.5*P)*Math.sin(.5*P)/Math.sin(P),m=r+Math.cos(n)-K*Math.sin(n),d=e+Math.sin(n)+K*Math.cos(n),h=r+Math.cos(t),f=e+Math.sin(t),g=h+K*Math.sin(t),p=f-K*Math.cos(t);return[s*m+u*d,X*m+l*d,s*g+u*p,X*g+l*p,s*h+u*f,X*h+l*f]},{number:hr}=h,fr=(Math.sqrt(2)-1)/3*4;var gr={initVector(){return this._ctm=[1,0,0,1,0,0],this._ctmStack=[]},save(){return this._ctmStack.push(this._ctm.slice()),this.addContent("q")},restore(){return this._ctm=this._ctmStack.pop()||[1,0,0,1,0,0],this.addContent("Q")},closePath(){return this.addContent("h")},lineWidth(r){return this.addContent(hr(r)+" w")},_CAP_STYLES:{BUTT:0,ROUND:1,SQUARE:2},lineCap(r){return"string"==typeof r&&(r=this._CAP_STYLES[r.toUpperCase()]),this.addContent(r+" J")},_JOIN_STYLES:{MITER:0,ROUND:1,BEVEL:2},lineJoin(r){return"string"==typeof r&&(r=this._JOIN_STYLES[r.toUpperCase()]),this.addContent(r+" j")},miterLimit(r){return this.addContent(hr(r)+" M")},dash(r,e={}){const n=r;if(Array.isArray(r)||(r=[r,e.space||r]),!r.every(r=>Number.isFinite(r)&&r>0))throw new Error(`dash(${JSON.stringify(n)}, ${JSON.stringify(e)}) invalid, lengths must be numeric and greater than zero`);return r=r.map(hr).join(" "),this.addContent(`[${r}] ${hr(e.phase||0)} d`)},undash(){return this.addContent("[] 0 d")},moveTo(r,e){return this.addContent(`${hr(r)} ${hr(e)} m`)},lineTo(r,e){return this.addContent(`${hr(r)} ${hr(e)} l`)},bezierCurveTo(r,e,n,t,a,i){return this.addContent(`${hr(r)} ${hr(e)} ${hr(n)} ${hr(t)} ${hr(a)} ${hr(i)} c`)},quadraticCurveTo(r,e,n,t){return this.addContent(`${hr(r)} ${hr(e)} ${hr(n)} ${hr(t)} v`)},rect(r,e,n,t){return this.addContent(`${hr(r)} ${hr(e)} ${hr(n)} ${hr(t)} re`)},roundedRect(r,e,n,t,a){null==a&&(a=0);const i=(a=Math.min(a,.5*n,.5*t))*(1-fr);return this.moveTo(r+a,e),this.lineTo(r+n-a,e),this.bezierCurveTo(r+n-i,e,r+n,e+i,r+n,e+a),this.lineTo(r+n,e+t-a),this.bezierCurveTo(r+n,e+t-i,r+n-i,e+t,r+n-a,e+t),this.lineTo(r+a,e+t),this.bezierCurveTo(r+i,e+t,r,e+t-i,r,e+t-a),this.lineTo(r,e+a),this.bezierCurveTo(r,e+i,r+i,e,r+a,e),this.closePath()},ellipse(r,e,n,t){null==t&&(t=n);const a=n*fr,i=t*fr,c=(r-=n)+2*n,o=(e-=t)+2*t,s=r+n,u=e+t;return this.moveTo(r,u),this.bezierCurveTo(r,u-i,s-a,e,s,e),this.bezierCurveTo(s+a,e,c,u-i,c,u),this.bezierCurveTo(c,u+i,s+a,o,s,o),this.bezierCurveTo(s-a,o,r,u+i,r,u),this.closePath()},circle(r,e,n){return this.ellipse(r,e,n)},arc(r,e,n,t,a,i){null==i&&(i=!1);const c=2*Math.PI,o=.5*Math.PI;let s=a-t;Math.abs(s)>c?s=c:0!==s&&i!==s<0&&(s=(i?-1:1)*c+s);const u=Math.ceil(Math.abs(s)/o),X=s/u,l=X/o*fr*n;let P=t,K=-Math.sin(P)*l,m=Math.cos(P)*l,d=r+Math.cos(P)*n,h=e+Math.sin(P)*n;this.moveTo(d,h);for(let t=0;t<u;t++){const t=d+K,a=h+m;P+=X,d=r+Math.cos(P)*n,h=e+Math.sin(P)*n,K=-Math.sin(P)*l,m=Math.cos(P)*l;const i=d-K,c=h-m;this.bezierCurveTo(t,a,i,c,d,h)}return this},polygon(...r){this.moveTo(...r.shift()||[]);for(let e of r)this.lineTo(...e||[]);return this.closePath()},path(r){return class{static apply(r,e){!function(r,e){ir=cr=or=sr=ur=Xr=0;for(let n=0;n<r.length;n++){const t=r[n];"function"==typeof Pr[t.cmd]&&Pr[t.cmd](e,t.args)}}(function(r){let e;const n=[];let t=[],a="",i=!1,c=0;for(let o of r)if(null!=lr[o])c=lr[o],e&&(a.length>0&&(t[t.length]=+a),n[n.length]={cmd:e,args:t},t=[],a="",i=!1),e=o;else if([" ",","].includes(o)||"-"===o&&a.length>0&&"e"!==a[a.length-1]||"."===o&&i){if(0===a.length)continue;t.length===c?(n[n.length]={cmd:e,args:t},t=[+a],"M"===e&&(e="L"),"m"===e&&(e="l")):t[t.length]=+a,i="."===o,a=["-","."].includes(o)?o:""}else a+=o,"."===o&&(i=!0);return a.length>0&&(t.length===c?(n[n.length]={cmd:e,args:t},t=[+a],"M"===e&&(e="L"),"m"===e&&(e="l")):t[t.length]=+a),n[n.length]={cmd:e,args:t},n}(e),r)}}.apply(this,r),this},_windingRule:r=>/even-?odd/.test(r)?"*":"",fill(r,e){return/(even-?odd)|(non-?zero)/.test(r)&&(e=r,r=null),r&&this.fillColor(r),this.addContent("f"+this._windingRule(e))},stroke(r){return r&&this.strokeColor(r),this.addContent("S")},fillAndStroke(r,e,n){null==e&&(e=r);const t=/(even-?odd)|(non-?zero)/;return t.test(r)&&(n=r,r=null),t.test(e)&&(n=e,e=r),r&&(this.fillColor(r),this.strokeColor(e)),this.addContent("B"+this._windingRule(n))},clip(r){return this.addContent("W"+this._windingRule(r))},endPath(){return this.addContent("n")},transform(r,e,n,t,a,i){const c=this._ctm,[o,s,u,X,l,P]=c;c[0]=o*r+u*e,c[1]=s*r+X*e,c[2]=o*n+u*t,c[3]=s*n+X*t,c[4]=o*a+u*i+l,c[5]=s*a+X*i+P;const K=[r,e,n,t,a,i].map(r=>hr(r)).join(" ");return this.addContent(K+" cm")},translate(r,e){return this.transform(1,0,0,1,r,e)},rotate(r,e={}){let n;const t=r*Math.PI/180,a=Math.cos(t),i=Math.sin(t);let c=n=0;if(null!=e.origin){[c,n]=e.origin;const r=c*i+n*a;c-=c*a-n*i,n-=r}return this.transform(a,i,-i,a,c,n)},scale(r,e,n={}){let t;null==e&&(e=r),"object"==typeof e&&(n=e,e=r);let a=t=0;return null!=n.origin&&([a,t]=n.origin,a-=r*a,t-=e*t),this.transform(r,0,0,e,a,t)}};const pr={402:131,8211:150,8212:151,8216:145,8217:146,8218:130,8220:147,8221:148,8222:132,8224:134,8225:135,8226:149,8230:133,8364:128,8240:137,8249:139,8250:155,710:136,8482:153,338:140,339:156,732:152,352:138,353:154,376:159,381:142,382:158},Ar=" .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n .notdef .notdef .notdef .notdef\n \n space exclam quotedbl numbersign\n dollar percent ampersand quotesingle\n parenleft parenright asterisk plus\n comma hyphen period slash\n zero one two three\n four five six seven\n eight nine colon semicolon\n less equal greater question\n \n at A B C\n D E F G\n H I J K\n L M N O\n P Q R S\n T U V W\n X Y Z bracketleft\n backslash bracketright as