=0&&o[e]<=1){let n=getCurveValue(o[e],l);na&&(a=n)}return[n,t,r,a]},this.getPointAtLength=function(e){if(isEqual(e,0))return this.startPoint;if(isEqual(e,this.totalLength))return this.endPoint;if(!(e<0||e>this.totalLength))for(let n=1;n<=s;n++){let t=K[n-1],r=K[n];if(t<=e&&e<=r){let a=(n-(r-e)/(r-t))/s,i=getCurveValue(a,u),o=getCurveValue(a,l),c=getCurveValue(a,X),K=getCurveValue(a,P);return[i,o,Math.atan2(K,c)]}}}},K=function(e,n,t,r){this.totalLength=Math.sqrt((t-e)*(t-e)+(r-n)*(r-n)),this.startPoint=[e,n,Math.atan2(r-n,t-e)],this.endPoint=[t,r,Math.atan2(r-n,t-e)],this.getBoundingBox=function(){return[Math.min(this.startPoint[0],this.endPoint[0]),Math.min(this.startPoint[1],this.endPoint[1]),Math.max(this.startPoint[0],this.endPoint[0]),Math.max(this.startPoint[1],this.endPoint[1])]},this.getPointAtLength=function(e){if(e>=0&&e<=this.totalLength){let n=e/this.totalLength||0;return[this.startPoint[0]+n*(this.endPoint[0]-this.startPoint[0]),this.startPoint[1]+n*(this.endPoint[1]-this.startPoint[1]),this.startPoint[2]]}}},d=function(){this.pathCommands=[],this.pathSegments=[],this.startPoint=null,this.endPoint=null,this.totalLength=0;let n,t,r,a=0,i=0,o=0,c=0;this.move=function(e,n){return a=o=e,i=c=n,null},this.line=function(e,n){let t=new K(o,c,e,n);return o=e,c=n,t},this.curve=function(e,n,t,r,a,i){let s=new P(o,c,e,n,t,r,a,i);return o=a,c=i,s},this.close=function(){let e=new K(o,c,a,i);return o=a,c=i,e},this.addCommand=function(e){this.pathCommands.push(e);let n=this[e[0]].apply(this,e.slice(3));n&&(n.hasStart=e[1],n.hasEnd=e[2],this.startPoint=this.startPoint||n.startPoint,this.endPoint=n.endPoint,this.pathSegments.push(n),this.totalLength+=n.totalLength)},this.M=function(e,t){return this.addCommand(["move",!0,!0,e,t]),n="M",this},this.m=function(e,n){return this.M(o+e,c+n)},this.Z=this.z=function(){return this.addCommand(["close",!0,!0]),n="Z",this},this.L=function(e,t){return this.addCommand(["line",!0,!0,e,t]),n="L",this},this.l=function(e,n){return this.L(o+e,c+n)},this.H=function(e){return this.L(e,c)},this.h=function(e){return this.L(o+e,c)},this.V=function(e){return this.L(o,e)},this.v=function(e){return this.L(o,c+e)},this.C=function(e,a,i,o,c,s){return this.addCommand(["curve",!0,!0,e,a,i,o,c,s]),n="C",t=i,r=o,this},this.c=function(e,n,t,r,a,i){return this.C(o+e,c+n,o+t,c+r,o+a,c+i)},this.S=function(e,a,i,s){return this.C(o+("C"===n?o-t:0),c+("C"===n?c-r:0),e,a,i,s)},this.s=function(e,a,i,s){return this.C(o+("C"===n?o-t:0),c+("C"===n?c-r:0),o+e,c+a,o+i,c+s)},this.Q=function(e,a,i,s){let u=o+2/3*(e-o),l=c+2/3*(a-c),X=i+2/3*(e-i),P=s+2/3*(a-s);return this.addCommand(["curve",!0,!0,u,l,X,P,i,s]),n="Q",t=e,r=a,this},this.q=function(e,n,t,r){return this.Q(o+e,c+n,o+t,c+r)},this.T=function(e,a){return this.Q(o+("Q"===n?o-t:0),c+("Q"===n?c-r:0),e,a)},this.t=function(e,a){return this.Q(o+("Q"===n?o-t:0),c+("Q"===n?c-r:0),o+e,c+a)},this.A=function(e,t,r,a,i,s,u){if(isEqual(e,0)||isEqual(t,0))this.addCommand(["line",!0,!0,s,u]);else{r*=Math.PI/180,e=Math.abs(e),t=Math.abs(t),a=1*!!a,i=1*!!i;let n=Math.cos(r)*(o-s)/2+Math.sin(r)*(c-u)/2,l=Math.cos(r)*(c-u)/2-Math.sin(r)*(o-s)/2,X=n*n/(e*e)+l*l/(t*t);X>1&&(e*=Math.sqrt(X),t*=Math.sqrt(X));let P=Math.sqrt(Math.max(0,e*e*t*t-e*e*l*l-t*t*n*n)/(e*e*l*l+t*t*n*n)),K=(a===i?-1:1)*P*e*l/t,d=(a===i?1:-1)*P*t*n/e,m=Math.cos(r)*K-Math.sin(r)*d+(o+s)/2,h=Math.sin(r)*K+Math.cos(r)*d+(c+u)/2,f=Math.atan2((l-d)/t,(n-K)/e),g=Math.atan2((-l-d)/t,(-n-K)/e);0===i&&g-f>0?g-=2*Math.PI:1===i&&g-f<0&&(g+=2*Math.PI);let p=Math.ceil(Math.abs(g-f)/(Math.PI/$));for(let n=0;ne[2]&&(e[2]=n[2]),n[1]e[3]&&(e[3]=n[3]);var n;return e[0]===1/0&&(e[0]=0),e[1]===1/0&&(e[1]=0),e[2]===-1/0&&(e[2]=0),e[3]===-1/0&&(e[3]=0),e},this.getPointAtLength=function(e){if(e>=0&&e<=this.totalLength){let n;for(let t=0;ta.selector.specificity||(n[e]=a.css[e],t[e]=a.selector.specificity)}return n}(e),this.allowedChildren=[],this.attr=function(n){if("function"==typeof e.getAttribute)return e.getAttribute(n)},this.resolveUrl=function(e){let t=(e||"").match(/^\s*(?:url\("(.*)#(.*)"\)|url\('(.*)#(.*)'\)|url\((.*)#(.*)\)|(.*)#(.*))\s*$/)||[],r=t[1]||t[3]||t[5]||t[7],a=t[2]||t[4]||t[6]||t[8];if(a){if(!r){let e=n.getElementById(a);if(e)return-1===this.stack.indexOf(e)?e:void H('SVGtoPDF: loop of circular references for id "'+a+'"')}if(Q){let e=ne[r];if(!e){(function isArrayLike(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length})(e=Q(r))||(e=[e]);for(let n=0;n=0&&t[3]>=0?t:n},this.getPercent=function(e,n){let t=this.attr(e),r=new X((t||"").trim()),a=r.matchNumber();return a?(r.match("%")&&(a*=.01),r.matchAll()?n:Math.max(0,Math.min(1,a))):n},this.chooseValue=function(e){for(let e=0;e=0&&(t=i);break;case"stroke-miterlimit":null!=(i=parseFloat(n))&&i>=1&&(t=i);break;case"word-spacing":case"letter-spacing":t=this.computeLength(n,this.getViewport());break;case"stroke-dashoffset":if(null!=(t=this.computeLength(n,this.getViewport()))&&t<0){let e=this.get("stroke-dasharray");for(let n=0;n0?e:this.ref?this.ref.getChildren():[]},this.getPaint=function(n,t,a,i){let o="userSpaceOnUse"!==this.attr("patternUnits"),c="objectBoundingBox"===this.attr("patternContentUnits"),s=this.getLength("x",o?1:this.getParentVWidth(),0),u=this.getLength("y",o?1:this.getParentVHeight(),0),l=this.getLength("width",o?1:this.getParentVWidth(),0),X=this.getLength("height",o?1:this.getParentVHeight(),0);c&&!o?(s=(s-n[0])/(n[2]-n[0])||0,u=(u-n[1])/(n[3]-n[1])||0,l=l/(n[2]-n[0])||0,X=X/(n[3]-n[1])||0):!c&&o&&(s=n[0]+s*(n[2]-n[0]),u=n[1]+u*(n[3]-n[1]),l*=n[2]-n[0],X*=n[3]-n[1]);let P=this.getViewbox("viewBox",[0,0,l,X]),K=multiplyMatrix(parseAspectRatio((this.attr("preserveAspectRatio")||"").trim(),l,X,P[2],P[3],0),[1,0,0,1,-P[0],-P[1]]),d=parseTranform(this.attr("patternTransform"));if(c&&(d=multiplyMatrix([n[2]-n[0],0,0,n[3]-n[1],n[0],n[1]],d)),(d=validateMatrix(d=multiplyMatrix(d,[1,0,0,1,s,u])))&&(K=validateMatrix(K))&&(l=validateNumber(l))&&(X=validateNumber(X))){let n=docBeginGroup([0,0,l,X]);return e.transform.apply(e,K),this.drawChildren(a,i),docEndGroup(n),[docCreatePattern(n,l,X,d),t]}return r?[r[0],r[1]*t]:void 0},this.getVWidth=function(){let e="userSpaceOnUse"!==this.attr("patternUnits"),n=this.getLength("width",e?1:this.getParentVWidth(),0);return this.getViewbox("viewBox",[0,0,n,0])[2]},this.getVHeight=function(){let e="userSpaceOnUse"!==this.attr("patternUnits"),n=this.getLength("height",e?1:this.getParentVHeight(),0);return this.getViewbox("viewBox",[0,0,0,n])[3]}},W=function(n,t,r){m.call(this,n,t),this.allowedChildren=["stop"],this.ref=function(){let e=this.getUrl("href")||this.getUrl("xlink:href");if(e&&e.nodeName===n.nodeName)return new W(e,t,r)}.call(this);let a=this.attr;this.attr=function(e){let n=a.call(this,e);return null!=n||"href"===e||"xlink:href"===e?n:this.ref?this.ref.attr(e):null};let i=this.getChildren;this.getChildren=function(){let e=i.call(this);return e.length>0?e:this.ref?this.ref.getChildren():[]},this.getPaint=function(n,t,a,i){let c=this.getChildren();if(0===c.length)return;if(1===c.length){let e=c[0],n=e.get("stop-color");if("none"===n)return;return opacityToColor(n,e.get("stop-opacity")*t,i)}let s,u,l,X,P,K,d="userSpaceOnUse"!==this.attr("gradientUnits"),m=parseTranform(this.attr("gradientTransform")),h=this.attr("spreadMethod"),f=0,g=0,p=1;if(d&&(m=multiplyMatrix([n[2]-n[0],0,0,n[3]-n[1],n[0],n[1]],m)),m=validateMatrix(m)){if("linearGradient"===this.name)u=this.getLength("x1",d?1:this.getVWidth(),0),l=this.getLength("x2",d?1:this.getVWidth(),d?1:this.getVWidth()),X=this.getLength("y1",d?1:this.getVHeight(),0),P=this.getLength("y2",d?1:this.getVHeight(),0);else{l=this.getLength("cx",d?1:this.getVWidth(),d?.5:.5*this.getVWidth()),P=this.getLength("cy",d?1:this.getVHeight(),d?.5:.5*this.getVHeight()),K=this.getLength("r",d?1:this.getViewport(),d?.5:.5*this.getViewport()),u=this.getLength("fx",d?1:this.getVWidth(),l),X=this.getLength("fy",d?1:this.getVHeight(),P),K<0&&H("SvgElemGradient: negative r value");let e=Math.sqrt(Math.pow(l-u,2)+Math.pow(P-X,2)),n=1;e>K&&(u=l+(u-l)*(n=K/e),X=P+(X-P)*n),K=Math.max(K,e*n*(1+1e-6))}if("reflect"===h||"repeat"===h){let e=inverseMatrix(m),t=transformPoint([n[0],n[1]],e),r=transformPoint([n[2],n[1]],e),a=transformPoint([n[2],n[3]],e),i=transformPoint([n[0],n[3]],e);"linearGradient"===this.name?(f=Math.max((t[0]-l)*(l-u)+(t[1]-P)*(P-X),(r[0]-l)*(l-u)+(r[1]-P)*(P-X),(a[0]-l)*(l-u)+(a[1]-P)*(P-X),(i[0]-l)*(l-u)+(i[1]-P)*(P-X))/(Math.pow(l-u,2)+Math.pow(P-X,2)),g=Math.max((t[0]-u)*(u-l)+(t[1]-X)*(X-P),(r[0]-u)*(u-l)+(r[1]-X)*(X-P),(a[0]-u)*(u-l)+(a[1]-X)*(X-P),(i[0]-u)*(u-l)+(i[1]-X)*(X-P))/(Math.pow(l-u,2)+Math.pow(P-X,2))):f=Math.sqrt(Math.max(Math.pow(t[0]-l,2)+Math.pow(t[1]-P,2),Math.pow(r[0]-l,2)+Math.pow(r[1]-P,2),Math.pow(a[0]-l,2)+Math.pow(a[1]-P,2),Math.pow(i[0]-l,2)+Math.pow(i[1]-P,2)))/K-1,f=Math.ceil(f+.5),p=(g=Math.ceil(g+.5))+1+f}s="linearGradient"===this.name?e.linearGradient(u-g*(l-u),X-g*(P-X),l+f*(l-u),P+f*(P-X)):e.radialGradient(u,X,0,l,P,K+f*K);for(let e=0;e0&&s.stop((e+0)/p,l[0],l[1]),s.stop((e+n)/(f+g+1),l[0],l[1]),a===c.length-1&&n<1&&s.stop((e+1)/p,l[0],l[1])}}return s.setTransform.apply(s,m),[s,1]}return r?[r[0],r[1]*t]:void 0}},x=function(n,t){h.call(this,n,t),this.dashScale=1,this.getBoundingShape=function(){return this.shape},this.getTransformation=function(){return this.get("transform")},this.drawInDocument=function(n,t){if("hidden"!==this.get("visibility")&&this.shape){if(e.save(),this.transform(),this.clip(),n)this.shape.insertInDocument(),docFillColor(o.white),e.fill(this.get("clip-rule"));else{let r;this.mask()&&(r=docBeginGroup(getPageBBox()));let a=this.shape.getSubPaths(),i=this.getFill(n,t),o=this.getStroke(n,t),c=this.get("stroke-width"),s=this.get("stroke-linecap");if(i||o){if(i&&docFillColor(i),o){for(let n=0;n0&&a[n].startPoint&&a[n].startPoint.length>1){let t=a[n].startPoint[0],r=a[n].startPoint[1];docFillColor(o),"square"===s?e.rect(t-.5*c,r-.5*c,c,c):"round"===s&&e.circle(t,r,.5*c),e.fill()}let n=this.get("stroke-dasharray"),t=this.get("stroke-dashoffset");if(isNotEqual(this.dashScale,1)){for(let e=0;e0&&a[e].insertInDocument();i&&o?e.fillAndStroke(this.get("fill-rule")):i?e.fill(this.get("fill-rule")):o&&e.stroke()}let u=this.get("marker-start"),l=this.get("marker-mid"),X=this.get("marker-end");if("none"!==u||"none"!==l||"none"!==X){let e=this.shape.getMarkers();if("none"!==u&&new U(u,null).drawMarker(!1,t,e[0],c),"none"!==l)for(let n=1;n0&&i>0?o&&c?(o=Math.min(o,.5*a),c=Math.min(c,.5*i),this.shape=(new d).M(t+o,r).L(t+a-o,r).A(o,c,0,0,1,t+a,r+c).L(t+a,r+i-c).A(o,c,0,0,1,t+a-o,r+i).L(t+o,r+i).A(o,c,0,0,1,t,r+i-c).L(t,r+c).A(o,c,0,0,1,t+o,r).Z()):this.shape=(new d).M(t,r).L(t+a,r).L(t+a,r+i).L(t,r+i).Z():this.shape=new d},w=function(e,n){x.call(this,e,n);let t=this.getLength("cx",this.getVWidth(),0),r=this.getLength("cy",this.getVHeight(),0),a=this.getLength("r",this.getViewport(),0);this.shape=a>0?(new d).M(t+a,r).A(a,a,0,0,1,t-a,r).A(a,a,0,0,1,t+a,r).Z():new d},O=function(e,n){x.call(this,e,n);let t=this.getLength("cx",this.getVWidth(),0),r=this.getLength("cy",this.getVHeight(),0),a=this.getLength("rx",this.getVWidth(),0),i=this.getLength("ry",this.getVHeight(),0);this.shape=a>0&&i>0?(new d).M(t+a,r).A(a,i,0,0,1,t-a,r).A(a,i,0,0,1,t+a,r).Z():new d},k=function(e,n){x.call(this,e,n);let t=this.getLength("x1",this.getVWidth(),0),r=this.getLength("y1",this.getVHeight(),0),a=this.getLength("x2",this.getVWidth(),0),i=this.getLength("y2",this.getVHeight(),0);this.shape=(new d).M(t,r).L(a,i)},T=function(e,n){x.call(this,e,n);let t=this.getNumberList("points");this.shape=new d;for(let e=0;e0?t:void 0,this.dashScale=void 0!==this.pathLength?this.shape.totalLength/this.pathLength:1},U=function(n,t){f.call(this,n,t);let r=this.getLength("markerWidth",this.getParentVWidth(),3),a=this.getLength("markerHeight",this.getParentVHeight(),3),i=this.getViewbox("viewBox",[0,0,r,a]);this.getVWidth=function(){return i[2]},this.getVHeight=function(){return i[3]},this.drawMarker=function(n,t,o,c){e.save();let s=this.attr("orient"),u=this.attr("markerUnits"),l="auto"===s?o[2]:(parseFloat(s)||0)*Math.PI/180,X="userSpaceOnUse"===u?1:c;e.transform(Math.cos(l)*X,Math.sin(l)*X,-Math.sin(l)*X,Math.cos(l)*X,o[0],o[1]);let P,K=this.getLength("refX",this.getVWidth(),0),d=this.getLength("refY",this.getVHeight(),0),m=parseAspectRatio(this.attr("preserveAspectRatio"),r,a,i[2],i[3],.5);"hidden"===this.get("overflow")&&e.rect(m[0]*(i[0]+i[2]/2-K)-r/2,m[3]*(i[1]+i[3]/2-d)-a/2,r,a).clip(),e.transform.apply(e,m),e.translate(-K,-d),this.get("opacity")<1&&!n&&(P=docBeginGroup(getPageBBox())),this.drawChildren(n,t),P&&(docEndGroup(P),e.fillOpacity(this.get("opacity")),docInsertGroup(P)),e.restore()}},Y=function(n,t){f.call(this,n,t),this.useMask=function(n){let t=docBeginGroup(getPageBBox());e.save(),"objectBoundingBox"===this.attr("clipPathUnits")&&e.transform(n[2]-n[0],0,0,n[3]-n[1],n[0],n[1]),this.clip(),this.drawChildren(!0,!1),e.restore(),docEndGroup(t),docApplyMask(t,!0)}},R=function(n,t){f.call(this,n,t),this.useMask=function(n){let t,r,a,i,o=docBeginGroup(getPageBBox());e.save(),"userSpaceOnUse"===this.attr("maskUnits")?(t=this.getLength("x",this.getVWidth(),-.1*(n[2]-n[0])+n[0]),r=this.getLength("y",this.getVHeight(),-.1*(n[3]-n[1])+n[1]),a=this.getLength("width",this.getVWidth(),1.2*(n[2]-n[0])),i=this.getLength("height",this.getVHeight(),1.2*(n[3]-n[1]))):(t=this.getLength("x",this.getVWidth(),-.1)*(n[2]-n[0])+n[0],r=this.getLength("y",this.getVHeight(),-.1)*(n[3]-n[1])+n[1],a=this.getLength("width",this.getVWidth(),1.2)*(n[2]-n[0]),i=this.getLength("height",this.getVHeight(),1.2)*(n[3]-n[1])),e.rect(t,r,a,i).clip(),"objectBoundingBox"===this.attr("maskContentUnits")&&e.transform(n[2]-n[0],0,0,n[3]-n[1],n[0],n[1]),this.clip(),this.drawChildren(!1,!0),e.restore(),docEndGroup(o),docApplyMask(o,!0)}},F=function(n,t){h.call(this,n,t),this.allowedChildren=["tspan","#text","#cdata-section","a"],this.isText=!0,this.getBoundingShape=function(){let e=new d;for(let n=0;n Tj")}e.addContent("ET")}}}var c,s,u,l,X,P,K,d,m;"line-through"===this.get("text-decoration")&&this.decorate(.05*this._font.size,.5*(getAscent(this._font.font,this._font.size)+getDescent(this._font.font,this._font.size)),n,t)},this.decorate=function(n,t,r,a){let i=this.getFill(r,a),o=this.getStroke(r,a);i&&docFillColor(i),o&&(docStrokeColor(o),e.lineWidth(this.get("stroke-width")).miterLimit(this.get("stroke-miterlimit")).lineJoin(this.get("stroke-linejoin")).lineCap(this.get("stroke-linecap")).dash(this.get("stroke-dasharray"),{phase:this.get("stroke-dashoffset")}));for(let r=0,a=this._pos;r0?e:this.pathObject.totalLength,this.pathScale=this.pathObject.totalLength/this.pathLength}else if((t=this.getUrl("href")||this.getUrl("xlink:href"))&&"path"===t.nodeName){let e=new S(t,this);this.pathObject=e.shape.clone().transform(e.get("transform")),this.pathLength=this.chooseValue(e.pathLength,this.pathObject.totalLength),this.pathScale=this.pathObject.totalLength/this.pathLength}},I=function(n,t){F.call(this,n,t),this.allowedChildren=["textPath","tspan","#text","#cdata-section","a"],function(t){let r,a,i="",o=n.textContent,c=[],s=[],u=0,l=0;function doAnchoring(){if(s.length){let e=s[s.length-1],n=s[0],t=e.x+e.width-n.x,i={startltr:0,middleltr:.5,endltr:1,startrtl:1,middlertl:.5,endrtl:0}[r+a]*t||0;for(let e=0;et||o<0)e._pos[i].hidden=!0;else{let t=n.getPointAtLength(o*r);isNotEqual(r,1)&&(e._pos[i].scale*=r,e._pos[i].width*=r),e._pos[i].x=t[0]-.5*e._pos[i].width*Math.cos(t[2])-e._pos[i].y*Math.sin(t[2]),e._pos[i].y=t[1]-.5*e._pos[i].width*Math.sin(t[2])+e._pos[i].y*Math.cos(t[2]),e._pos[i].rotate=t[2]+e._pos[i].rotate,e._pos[i].continuous=!1}}}else for(let n=0;n0&&t<1/0)for(let n=0;n=2){let t=(n-(o-i))/(e.length-1);for(let n=0;n0?r-4:r,l=0;l>16&255,c[s++]=n>>8&255,c[s++]=255&n;2===o&&(n=a[e.charCodeAt(l)]<<2|a[e.charCodeAt(l+1)]>>4,c[s++]=255&n);1===o&&(n=a[e.charCodeAt(l)]<<10|a[e.charCodeAt(l+1)]<<4|a[e.charCodeAt(l+2)]>>2,c[s++]=n>>8&255,c[s++]=255&n);return c},n.fromByteArray=function fromByteArray(e){for(var n,t=e.length,a=t%3,i=[],o=0,c=t-a;oc?c:o+16383));1===a?(n=e[t-1],i.push(r[n>>2]+r[n<<4&63]+"==")):2===a&&(n=(e[t-2]<<8)+e[t-1],i.push(r[n>>10]+r[n>>4&63]+r[n<<2&63]+"="));return i.join("")};for(var r=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,s=o.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return-1===t&&(t=n),[t,t===n?0:4-t%4]}function encodeChunk(e,n,t){for(var a,i,o=[],c=n;c>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,n){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},function(e,n,t){"use strict";(function(n,r){var a=t(43);e.exports=Readable;var i,o=t(90);Readable.ReadableState=ReadableState;t(39).EventEmitter;var c=function(e,n){return e.listeners(n).length},s=t(92),u=t(44).Buffer,l=n.Uint8Array||function(){};var X=t(33);X.inherits=t(19);var P=t(154),K=void 0;K=P&&P.debuglog?P.debuglog("stream"):function(){};var d,m=t(155),h=t(93);X.inherits(Readable,s);var f=["error","close","destroy","pause","resume"];function ReadableState(e,n){e=e||{};var r=n instanceof(i=i||t(20));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,o=e.readableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(o||0===o)?o:c,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=t(94).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function Readable(e){if(i=i||t(20),!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function readableAddChunk(e,n,t,r,a){var i,o=e._readableState;null===n?(o.reading=!1,function onEofChunk(e,n){if(n.ended)return;if(n.decoder){var t=n.decoder.end();t&&t.length&&(n.buffer.push(t),n.length+=n.objectMode?1:t.length)}n.ended=!0,emitReadable(e)}(e,o)):(a||(i=function chunkInvalid(e,n){var t;(function _isUint8Array(e){return u.isBuffer(e)||e instanceof l})(n)||"string"==typeof n||void 0===n||e.objectMode||(t=new TypeError("Invalid non-string/buffer chunk"));return t}(o,n)),i?e.emit("error",i):o.objectMode||n&&n.length>0?("string"==typeof n||o.objectMode||Object.getPrototypeOf(n)===u.prototype||(n=function _uint8ArrayToBuffer(e){return u.from(e)}(n)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):addChunk(e,o,n,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!t?(n=o.decoder.write(n),o.objectMode||0!==n.length?addChunk(e,o,n,!1):maybeReadMore(e,o)):addChunk(e,o,n,!1))):r||(o.reading=!1));return function needMoreData(e){return!e.ended&&(e.needReadable||e.lengthn.highWaterMark&&(n.highWaterMark=function computeNewHighWaterMark(e){return e>=g?e=g:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=n.length?e:n.ended?n.length:(n.needReadable=!0,0))}function emitReadable(e){var n=e._readableState;n.needReadable=!1,n.emittedReadable||(K("emitReadable",n.flowing),n.emittedReadable=!0,n.sync?a.nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){K("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,n){n.readingMore||(n.readingMore=!0,a.nextTick(maybeReadMore_,e,n))}function maybeReadMore_(e,n){for(var t=n.length;!n.reading&&!n.flowing&&!n.ended&&n.length=n.length?(t=n.decoder?n.buffer.join(""):1===n.buffer.length?n.buffer.head.data:n.buffer.concat(n.length),n.buffer.clear()):t=function fromListPartial(e,n,t){var r;ei.length?i.length:e;if(o===i.length?a+=i:a+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?n.head=t.next:n.head=n.tail=null):(n.head=t,t.data=i.slice(o));break}++r}return n.length-=r,a}(e,n):function copyFromBuffer(e,n){var t=u.allocUnsafe(e),r=n.head,a=1;r.data.copy(t),e-=r.data.length;for(;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++a,r.next?n.head=r.next:n.head=n.tail=null):(n.head=r,r.data=i.slice(o));break}++a}return n.length-=a,t}(e,n);return r}(e,n.buffer,n.decoder),t);var t}function endReadable(e){var n=e._readableState;if(n.length>0)throw new Error('"endReadable()" called on non-empty stream');n.endEmitted||(n.ended=!0,a.nextTick(endReadableNT,n,e))}function endReadableNT(e,n){e.endEmitted||0!==e.length||(e.endEmitted=!0,n.readable=!1,n.emit("end"))}function indexOf(e,n){for(var t=0,r=e.length;t=n.highWaterMark||n.ended))return K("read: emitReadable",n.length,n.ended),0===n.length&&n.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,n))&&n.ended)return 0===n.length&&endReadable(this),null;var r,a=n.needReadable;return K("need readable",a),(0===n.length||n.length-e0?fromList(e,n):null)?(n.needReadable=!0,e=0):n.length-=e,0===n.length&&(n.ended||(n.needReadable=!0),t!==e&&n.ended&&endReadable(this)),null!==r&&this.emit("data",r),r},Readable.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(e,n){var t=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,K("pipe count=%d opts=%j",i.pipesCount,n);var s=(!n||!1!==n.end)&&e!==r.stdout&&e!==r.stderr?onend:unpipe;function onunpipe(n,r){K("onunpipe"),n===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,function cleanup(){K("cleanup"),e.removeListener("close",onclose),e.removeListener("finish",onfinish),e.removeListener("drain",u),e.removeListener("error",onerror),e.removeListener("unpipe",onunpipe),t.removeListener("end",onend),t.removeListener("end",unpipe),t.removeListener("data",ondata),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u()}())}function onend(){K("onend"),e.end()}i.endEmitted?a.nextTick(s):t.once("end",s),e.on("unpipe",onunpipe);var u=function pipeOnDrain(e){return function(){var n=e._readableState;K("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,0===n.awaitDrain&&c(e,"data")&&(n.flowing=!0,flow(e))}}(t);e.on("drain",u);var l=!1;var X=!1;function ondata(n){K("ondata"),X=!1,!1!==e.write(n)||X||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==indexOf(i.pipes,e))&&!l&&(K("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,X=!0),t.pause())}function onerror(n){K("onerror",n),unpipe(),e.removeListener("error",onerror),0===c(e,"error")&&e.emit("error",n)}function onclose(){e.removeListener("finish",onfinish),unpipe()}function onfinish(){K("onfinish"),e.removeListener("close",onclose),unpipe()}function unpipe(){K("unpipe"),t.unpipe(e)}return t.on("data",ondata),function prependListener(e,n,t){if("function"==typeof e.prependListener)return e.prependListener(n,t);e._events&&e._events[n]?o(e._events[n])?e._events[n].unshift(t):e._events[n]=[t,e._events[n]]:e.on(n,t)}(e,"error",onerror),e.once("close",onclose),e.once("finish",onfinish),e.emit("pipe",t),i.flowing||(K("pipe resume"),t.resume()),e},Readable.prototype.unpipe=function(e){var n=this._readableState,t={hasUnpiped:!1};if(0===n.pipesCount)return this;if(1===n.pipesCount)return e&&e!==n.pipes?this:(e||(e=n.pipes),n.pipes=null,n.pipesCount=0,n.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var r=n.pipes,a=n.pipesCount;n.pipes=null,n.pipesCount=0,n.flowing=!1;for(var i=0;i>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function utf8FillLast(e){var n=this.lastTotal-this.lastNeed,t=function utf8CheckExtraBytes(e,n,t){if(128!=(192&n[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&n.length>1){if(128!=(192&n[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&n.length>2&&128!=(192&n[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,n,0,e.length),void(this.lastNeed-=e.length))}function utf16Text(e,n){if((e.length-n)%2==0){var t=e.toString("utf16le",n);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",n,e.length-1)}function utf16End(e){var n=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return n+this.lastChar.toString("utf16le",0,t)}return n}function base64Text(e,n){var t=(e.length-n)%3;return 0===t?e.toString("base64",n):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",n,e.length-t))}function base64End(e){var n=e&&e.length?this.write(e):"";return this.lastNeed?n+this.lastChar.toString("base64",0,3-this.lastNeed):n}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}n.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(e){if(0===e.length)return"";var n,t;if(this.lastNeed){if(void 0===(n=this.fillLast(e)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0)return a>0&&(e.lastNeed=a-1),a;if(--r=0)return a>0&&(e.lastNeed=a-2),a;if(--r=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,n);if(!this.lastNeed)return e.toString("utf8",n);this.lastTotal=t;var r=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",n,r)},StringDecoder.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,n,t){"use strict";e.exports=Transform;var r=t(20),a=t(33);function afterTransform(e,n){var t=this._transformState;t.transforming=!1;var r=t.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));t.writechunk=null,t.writecb=null,null!=n&&this.push(n),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length
* @license MIT
*/
function compare(e,n){if(e===n)return 0;for(var t=e.length,r=n.length,a=0,i=Math.min(t,r);a=0;l--)if(X[l]!==P[l])return!1;for(l=X.length-1;l>=0;l--)if(s=X[l],!_deepEqual(e[s],n[s],t,a))return!1;return!0}(e,n,t,a))}return t?e===n:e==n}function isArguments(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function expectedException(e,n){if(!e||!n)return!1;if("[object RegExp]"==Object.prototype.toString.call(n))return n.test(e);try{if(e instanceof n)return!0}catch(e){}return!Error.isPrototypeOf(n)&&!0===n.call({},e)}function _throws(e,n,t,a){var i;if("function"!=typeof n)throw new TypeError('"block" argument must be a function');"string"==typeof t&&(a=t,t=null),i=function _tryBlock(e){var n;try{e()}catch(e){n=e}return n}(n),a=(t&&t.name?" ("+t.name+").":".")+(a?" "+a:"."),e&&!i&&fail(i,t,"Missing expected exception"+a);var o="string"==typeof a,c=!e&&i&&!t;if((!e&&r.isError(i)&&o&&expectedException(i,t)||c)&&fail(i,t,"Got unwanted exception"+a),e&&i&&t&&!expectedException(i,t)||!e&&i)throw i}c.AssertionError=function AssertionError(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function getMessage(e){return truncate(inspect(e.actual),128)+" "+e.operator+" "+truncate(inspect(e.expected),128)}(this),this.generatedMessage=!0);var n=e.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var t=new Error;if(t.stack){var r=t.stack,a=getName(n),i=r.indexOf("\n"+a);if(i>=0){var o=r.indexOf("\n",i+1);r=r.substring(o+1)}this.stack=r}}},r.inherits(c.AssertionError,Error),c.fail=fail,c.ok=ok,c.equal=function equal(e,n,t){e!=n&&fail(e,n,t,"==",c.equal)},c.notEqual=function notEqual(e,n,t){e==n&&fail(e,n,t,"!=",c.notEqual)},c.deepEqual=function deepEqual(e,n,t){_deepEqual(e,n,!1)||fail(e,n,t,"deepEqual",c.deepEqual)},c.deepStrictEqual=function deepStrictEqual(e,n,t){_deepEqual(e,n,!0)||fail(e,n,t,"deepStrictEqual",c.deepStrictEqual)},c.notDeepEqual=function notDeepEqual(e,n,t){_deepEqual(e,n,!1)&&fail(e,n,t,"notDeepEqual",c.notDeepEqual)},c.notDeepStrictEqual=function notDeepStrictEqual(e,n,t){_deepEqual(e,n,!0)&&fail(e,n,t,"notDeepStrictEqual",notDeepStrictEqual)},c.strictEqual=function strictEqual(e,n,t){e!==n&&fail(e,n,t,"===",c.strictEqual)},c.notStrictEqual=function notStrictEqual(e,n,t){e===n&&fail(e,n,t,"!==",c.notStrictEqual)},c.throws=function(e,n,t){_throws(!0,e,n,t)},c.doesNotThrow=function(e,n,t){_throws(!1,e,n,t)},c.ifError=function(e){if(e)throw e};var u=Object.keys||function(e){var n=[];for(var t in e)a.call(e,t)&&n.push(t);return n}}).call(this,t(9))},function(e,n,t){"use strict";e.exports=function adler32(e,n,t,r){for(var a=65535&e|0,i=e>>>16&65535|0,o=0;0!==t;){t-=o=t>2e3?2e3:t;do{i=i+(a=a+n[r++]|0)|0}while(--o);a%=65521,i%=65521}return a|i<<16|0}},function(e,n,t){"use strict";var r=function makeTable(){for(var e,n=[],t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;n[t]=e}return n}();e.exports=function crc32(e,n,t,a){var i=r,o=a+t;e^=-1;for(var c=a;c>>8^i[255&(e^n[c])];return-1^e}},function(e,n,t){var r;e.exports=(r=t(3),function(e){var n=r,t=n.lib,a=t.WordArray,i=t.Hasher,o=n.algo,c=[],s=[];!function(){function isPrime(n){for(var t=e.sqrt(n),r=2;r<=t;r++)if(!(n%r))return!1;return!0}function getFractionalBits(e){return 4294967296*(e-(0|e))|0}for(var n=2,t=0;t<64;)isPrime(n)&&(t<8&&(c[t]=getFractionalBits(e.pow(n,.5))),s[t]=getFractionalBits(e.pow(n,1/3)),t++),n++}();var u=[],l=o.SHA256=i.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(e,n){for(var t=this._hash.words,r=t[0],a=t[1],i=t[2],o=t[3],c=t[4],l=t[5],X=t[6],P=t[7],K=0;K<64;K++){if(K<16)u[K]=0|e[n+K];else{var d=u[K-15],m=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,h=u[K-2],f=(h<<15|h>>>17)^(h<<13|h>>>19)^h>>>10;u[K]=m+u[K-7]+f+u[K-16]}var g=r&a^r&i^a&i,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=P+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&l^~c&X)+s[K]+u[K];P=X,X=l,l=c,c=o+v|0,o=i,i=a,a=r,r=v+(p+g)|0}t[0]=t[0]+r|0,t[1]=t[1]+a|0,t[2]=t[2]+i|0,t[3]=t[3]+o|0,t[4]=t[4]+c|0,t[5]=t[5]+l|0,t[6]=t[6]+X|0,t[7]=t[7]+P|0},_doFinalize:function(){var n=this._data,t=n.words,r=8*this._nDataBytes,a=8*n.sigBytes;return t[a>>>5]|=128<<24-a%32,t[14+(a+64>>>9<<4)]=e.floor(r/4294967296),t[15+(a+64>>>9<<4)]=r,n.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=i._createHelper(l),n.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)},function(e,n,t){var r;e.exports=(r=t(3),t(47),function(){var e=r,n=e.lib.Hasher,t=e.x64,a=t.Word,i=t.WordArray,o=e.algo;function X64Word_create(){return a.create.apply(a,arguments)}var c=[X64Word_create(1116352408,3609767458),X64Word_create(1899447441,602891725),X64Word_create(3049323471,3964484399),X64Word_create(3921009573,2173295548),X64Word_create(961987163,4081628472),X64Word_create(1508970993,3053834265),X64Word_create(2453635748,2937671579),X64Word_create(2870763221,3664609560),X64Word_create(3624381080,2734883394),X64Word_create(310598401,1164996542),X64Word_create(607225278,1323610764),X64Word_create(1426881987,3590304994),X64Word_create(1925078388,4068182383),X64Word_create(2162078206,991336113),X64Word_create(2614888103,633803317),X64Word_create(3248222580,3479774868),X64Word_create(3835390401,2666613458),X64Word_create(4022224774,944711139),X64Word_create(264347078,2341262773),X64Word_create(604807628,2007800933),X64Word_create(770255983,1495990901),X64Word_create(1249150122,1856431235),X64Word_create(1555081692,3175218132),X64Word_create(1996064986,2198950837),X64Word_create(2554220882,3999719339),X64Word_create(2821834349,766784016),X64Word_create(2952996808,2566594879),X64Word_create(3210313671,3203337956),X64Word_create(3336571891,1034457026),X64Word_create(3584528711,2466948901),X64Word_create(113926993,3758326383),X64Word_create(338241895,168717936),X64Word_create(666307205,1188179964),X64Word_create(773529912,1546045734),X64Word_create(1294757372,1522805485),X64Word_create(1396182291,2643833823),X64Word_create(1695183700,2343527390),X64Word_create(1986661051,1014477480),X64Word_create(2177026350,1206759142),X64Word_create(2456956037,344077627),X64Word_create(2730485921,1290863460),X64Word_create(2820302411,3158454273),X64Word_create(3259730800,3505952657),X64Word_create(3345764771,106217008),X64Word_create(3516065817,3606008344),X64Word_create(3600352804,1432725776),X64Word_create(4094571909,1467031594),X64Word_create(275423344,851169720),X64Word_create(430227734,3100823752),X64Word_create(506948616,1363258195),X64Word_create(659060556,3750685593),X64Word_create(883997877,3785050280),X64Word_create(958139571,3318307427),X64Word_create(1322822218,3812723403),X64Word_create(1537002063,2003034995),X64Word_create(1747873779,3602036899),X64Word_create(1955562222,1575990012),X64Word_create(2024104815,1125592928),X64Word_create(2227730452,2716904306),X64Word_create(2361852424,442776044),X64Word_create(2428436474,593698344),X64Word_create(2756734187,3733110249),X64Word_create(3204031479,2999351573),X64Word_create(3329325298,3815920427),X64Word_create(3391569614,3928383900),X64Word_create(3515267271,566280711),X64Word_create(3940187606,3454069534),X64Word_create(4118630271,4000239992),X64Word_create(116418474,1914138554),X64Word_create(174292421,2731055270),X64Word_create(289380356,3203993006),X64Word_create(460393269,320620315),X64Word_create(685471733,587496836),X64Word_create(852142971,1086792851),X64Word_create(1017036298,365543100),X64Word_create(1126000580,2618297676),X64Word_create(1288033470,3409855158),X64Word_create(1501505948,4234509866),X64Word_create(1607167915,987167468),X64Word_create(1816402316,1246189591)],s=[];!function(){for(var e=0;e<80;e++)s[e]=X64Word_create()}();var u=o.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,n){for(var t=this._hash.words,r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],l=t[5],X=t[6],P=t[7],K=r.high,d=r.low,m=a.high,h=a.low,f=i.high,g=i.low,p=o.high,v=o.low,A=u.high,y=u.low,b=l.high,C=l.low,B=X.high,W=X.low,x=P.high,N=P.low,w=K,O=d,k=m,T=h,_=f,S=g,U=p,Y=v,R=A,F=y,L=b,E=C,D=B,I=W,V=x,M=N,z=0;z<80;z++){var G=s[z];if(z<16)var q=G.high=0|e[n+2*z],H=G.low=0|e[n+2*z+1];else{var j=s[z-15],J=j.high,Z=j.low,Q=(J>>>1|Z<<31)^(J>>>8|Z<<24)^J>>>7,$=(Z>>>1|J<<31)^(Z>>>8|J<<24)^(Z>>>7|J<<25),ee=s[z-2],ne=ee.high,te=ee.low,re=(ne>>>19|te<<13)^(ne<<3|te>>>29)^ne>>>6,ae=(te>>>19|ne<<13)^(te<<3|ne>>>29)^(te>>>6|ne<<26),ie=s[z-7],oe=ie.high,ce=ie.low,se=s[z-16],ue=se.high,le=se.low;q=(q=(q=Q+oe+((H=$+ce)>>>0<$>>>0?1:0))+re+((H+=ae)>>>0>>0?1:0))+ue+((H+=le)>>>0>>0?1:0),G.high=q,G.low=H}var Xe,Pe=R&L^~R&D,Ke=F&E^~F&I,de=w&k^w&_^k&_,me=O&T^O&S^T&S,he=(w>>>28|O<<4)^(w<<30|O>>>2)^(w<<25|O>>>7),fe=(O>>>28|w<<4)^(O<<30|w>>>2)^(O<<25|w>>>7),ge=(R>>>14|F<<18)^(R>>>18|F<<14)^(R<<23|F>>>9),pe=(F>>>14|R<<18)^(F>>>18|R<<14)^(F<<23|R>>>9),ve=c[z],Ae=ve.high,ye=ve.low,be=V+ge+((Xe=M+pe)>>>0>>0?1:0),Ce=fe+me;V=D,M=I,D=L,I=E,L=R,E=F,R=U+(be=(be=(be=be+Pe+((Xe+=Ke)>>>0>>0?1:0))+Ae+((Xe+=ye)>>>0>>0?1:0))+q+((Xe+=H)>>>0>>0?1:0))+((F=Y+Xe|0)>>>0>>0?1:0)|0,U=_,Y=S,_=k,S=T,k=w,T=O,w=be+(he+de+(Ce>>>0>>0?1:0))+((O=Xe+Ce|0)>>>0>>0?1:0)|0}d=r.low=d+O,r.high=K+w+(d>>>0>>0?1:0),h=a.low=h+T,a.high=m+k+(h>>>0>>0?1:0),g=i.low=g+S,i.high=f+_+(g>>>0>>0?1:0),v=o.low=v+Y,o.high=p+U+(v>>>0>>0?1:0),y=u.low=y+F,u.high=A+R+(y>>>0>>0?1:0),C=l.low=C+E,l.high=b+L+(C>>>0>>0?1:0),W=X.low=W+I,X.high=B+D+(W>>>0>>0?1:0),N=P.low=N+M,P.high=x+V+(N>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,n=e.words,t=8*this._nDataBytes,r=8*e.sigBytes;return n[r>>>5]|=128<<24-r%32,n[30+(r+128>>>10<<5)]=Math.floor(t/4294967296),n[31+(r+128>>>10<<5)]=t,e.sigBytes=4*n.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=n._createHelper(u),e.HmacSHA512=n._createHmacHelper(u)}(),r.SHA512)},function(e,n,t){(function(){var n,r,a;r=t(30).Number,a=t(16),n=function(){function ArrayT(e,n,t){this.type=e,this.length=n,this.lengthType=null!=t?t:"count"}return ArrayT.prototype.decode=function(e,n){var t,i,o,c,s,u;if(o=e.pos,c=[],t=n,null!=this.length&&(i=a.resolveLength(this.length,e,n)),this.length instanceof r&&(Object.defineProperties(c,{parent:{value:n},_startOffset:{value:o},_currentOffset:{value:0,writable:!0},_length:{value:i}}),t=c),null==i||"bytes"===this.lengthType)for(s=null!=i?e.pos+i:(null!=n?n._length:void 0)?n._startOffset+n._length:e.length;e.poss;)r.f(e,t=o[s++],n[t]);return e}},function(e,n,t){var r=t(23),a=t(22),i=t(217)(!1),o=t(74)("IE_PROTO");e.exports=function(e,n){var t,c=a(e),s=0,u=[];for(t in c)t!=o&&r(c,t)&&u.push(t);for(;n.length>s;)r(c,t=n[s++])&&(~i(u,t)||u.push(t));return u}},function(e,n,t){var r=t(73),a=Math.max,i=Math.min;e.exports=function(e,n){return(e=r(e))<0?a(e+n,0):i(e,n)}},function(e,n,t){e.exports={default:t(225),__esModule:!0}},function(e,n,t){var r=t(66);e.exports=Array.isArray||function isArray(e){return"Array"==r(e)}},function(e,n,t){var r=t(109),a=t(76).concat("length","prototype");n.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return r(e,a)}},function(e,n,t){"use strict";n.__esModule=!0,n.default=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}},function(e,n,t){"use strict";n.__esModule=!0;var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(t(84));n.default=function(){function defineProperties(e,n){for(var t=0;t1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function has(e){return!!h(d(this,n),e)}}),P&&r(l.prototype,"size",{get:function(){return d(this,n)[m]}}),l},def:function(e,n,t){var r,a,i=h(e,n);return i?i.v=t:(e._l=i={i:a=K(n,!0),k:n,v:t,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==a&&(e._i[a]=i)),e},getEntry:h,setStrong:function(e,n,t){u(e,n,function(e,t){this._t=d(e,n),this._k=t,this._l=void 0},function(){for(var e=this._k,n=this._l;n&&n.r;)n=n.p;return this._t&&(this._l=n=n?n.n:this._t._f)?l(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(this._t=void 0,l(1))},t?"entries":"values",!t,!0),X(n)}}},function(e,n,t){var r=t(17);e.exports=function(e,n,t){for(var a in n)t&&e[a]?e[a]=n[a]:r(e,a,n[a]);return e}},function(e,n){e.exports=function(e,n,t,r){if(!(e instanceof n)||void 0!==r&&r in e)throw TypeError(t+": incorrect invocation!");return e}},function(e,n,t){var r=t(18);e.exports=function(e,n,t,a){try{return a?n(r(t)[0],t[1]):n(t)}catch(n){var i=e.return;throw void 0!==i&&r(i.call(e)),n}}},function(e,n,t){var r=t(31),a=t(8)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[a]===e)}},function(e,n,t){"use strict";var r=t(13),a=t(6),i=t(54),o=t(24),c=t(17),s=t(117),u=t(55),l=t(118),X=t(12),P=t(53),K=t(11).f,d=t(242)(0),m=t(10);e.exports=function(e,n,t,h,f,g){var p=r[e],v=p,A=f?"set":"add",y=v&&v.prototype,b={};return m&&"function"==typeof v&&(g||y.forEach&&!o(function(){(new v).entries().next()}))?(v=n(function(n,t){l(n,v,e,"_c"),n._c=new p,null!=t&&u(t,f,n[A],n)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var n="add"==e||"set"==e;e in y&&(!g||"clear"!=e)&&c(v.prototype,e,function(t,r){if(l(this,v,e),!n&&g&&!X(t))return"get"==e&&void 0;var a=this._c[e](0===t?0:t,r);return n?this:a})}),g||K(v.prototype,"size",{get:function(){return this._c.size}})):(v=h.getConstructor(n,e,f,A),s(v.prototype,t),i.NEED=!0),P(v,e),b[e]=v,a(a.G+a.W+a.F,b),g||h.setStrong(v,e,f),v}},function(e,n,t){var r=t(78),a=t(246);e.exports=function(e){return function toJSON(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return a(this)}}},function(e,n,t){"use strict";var r=t(6);e.exports=function(e){r(r.S,e,{of:function of(){for(var e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return new this(n)}})}},function(e,n,t){"use strict";var r=t(6),a=t(105),i=t(25),o=t(55);e.exports=function(e){r(r.S,e,{from:function from(e){var n,t,r,c,s=arguments[1];return a(this),(n=void 0!==s)&&a(s),null==e?new this:(t=[],n?(r=0,c=i(s,arguments[2],2),o(e,!1,function(e){t.push(c(e,r++))})):o(e,!1,t.push,t),new this(t))}})}},function(e,n,t){var r,a;a=t(86),r=function(){function UnicodeTrie(e){var n,t,r;(n="function"==typeof e.readUInt32BE&&"function"==typeof e.slice)||e instanceof Uint8Array?(n?(this.highStart=e.readUInt32BE(0),this.errorValue=e.readUInt32BE(4),t=e.readUInt32BE(8),e=e.slice(12)):(r=new DataView(e.buffer),this.highStart=r.getUint32(0),this.errorValue=r.getUint32(4),t=r.getUint32(8),e=e.subarray(12)),e=a(e,new Uint8Array(t)),e=a(e,new Uint8Array(t)),this.data=new Uint32Array(e.buffer)):(this.data=e.data,this.highStart=e.highStart,this.errorValue=e.errorValue)}return 11,5,6,32,64,63,2,32,31,2048,32,2080,2080,32,2112,4,UnicodeTrie.prototype.get=function(e){var n;return e<0||e>1114111?this.errorValue:e<55296||e>56319&&e<=65535?(n=(this.data[e>>5]<<2)+(31&e),this.data[n]):e<=65535?(n=(this.data[2048+(e-55296>>5)]<<2)+(31&e),this.data[n]):e>11)],n=((n=this.data[n+(e>>5&63)])<<2)+(31&e),this.data[n]):this.data[this.data.length-4]},UnicodeTrie}(),e.exports=r},function(e,n,t){var r=t(127).BrotliInput,a=t(127).BrotliOutput,i=t(298),o=t(128),c=t(129).HuffmanCode,s=t(129).BrotliBuildHuffmanTable,u=t(301),l=t(302),X=t(303),P=8,K=16,d=256,m=704,h=26,f=6,g=2,p=8,v=255,A=1080,y=18,b=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),C=16,B=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),W=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),x=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);function DecodeWindowBits(e){var n;return 0===e.readBits(1)?16:(n=e.readBits(3))>0?17+n:(n=e.readBits(3))>0?8+n:17}function DecodeVarLenUint8(e){if(e.readBits(1)){var n=e.readBits(3);return 0===n?1:e.readBits(n)+(1<1&&0===i)throw new Error("Invalid size byte");a.meta_block_length|=i<<8*r}}else for(r=0;r4&&0===o)throw new Error("Invalid size nibble");a.meta_block_length|=o<<4*r}return++a.meta_block_length,a.input_end||a.is_metadata||(a.is_uncompressed=e.readBits(1)),a}function ReadSymbol(e,n,t){var r;return t.fillBitWindow(),(r=e[n+=t.val_>>>t.bit_pos_&v].bits-p)>0&&(t.bit_pos_+=p,n+=e[n].value,n+=t.val_>>>t.bit_pos_&(1<>=1,++l;for(m=0;m0;++m){var A,C=b[m],B=0;r.fillBitWindow(),B+=r.val_>>>r.bit_pos_&15,r.bit_pos_+=v[B].bits,A=v[B].value,h[C]=A,0!==A&&(f-=32>>A,++g)}if(1!==g&&0!==f)throw new Error("[ReadHuffmanCode] invalid num_codes or space");!function ReadHuffmanCodeLengths(e,n,t,r){for(var a=0,i=P,o=0,u=0,l=32768,X=[],d=0;d<32;d++)X.push(new c(0,0));for(s(X,0,5,e,y);a0;){var m,h=0;if(r.readMoreInput(),r.fillBitWindow(),h+=r.val_>>>r.bit_pos_&31,r.bit_pos_+=X[h].bits,(m=255&X[h].value)>m);else{var f,g,p=m-14,v=0;if(m===K&&(v=i),u!==v&&(o=0,u=v),f=o,o>0&&(o-=2,o<<=p),a+(g=(o+=r.readBits(p)+3)-f)>n)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var A=0;A>>5]),this.htrees=new Uint32Array(n)}function DecodeContextMap(e,n){var t,r,a={num_htrees:null,context_map:null},i=0;n.readMoreInput();var o=a.num_htrees=DecodeVarLenUint8(n)+1,s=a.context_map=new Uint8Array(e);if(o<=1)return a;for(n.readBits(1)&&(i=n.readBits(4)+1),t=[],r=0;r=e)throw new Error("[DecodeContextMap] i >= context_map_size");s[r]=0,++r}else s[r]=u-i,++r}return n.readBits(1)&&function InverseMoveToFrontTransform(e,n){var t,r=new Uint8Array(256);for(t=0;t<256;++t)r[t]=t;for(t=0;t=e&&(c-=e),r[t]=c,a[s+(1&i[u])]=c,++i[u]}function CopyUncompressedBlockToOutput(e,n,t,r,a,o){var c,s=a+1,u=t&a,l=o.pos_&i.IBUF_MASK;if(n<8||o.bit_pos_+(n<<3)0;)o.readMoreInput(),r[u++]=o.readBits(8),u===s&&(e.write(r,s),u=0);else{if(o.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;o.bit_pos_<32;)r[u]=o.val_>>>o.bit_pos_,o.bit_pos_+=8,++u,--n;if(l+(c=o.bit_end_pos_-o.bit_pos_>>3)>i.IBUF_MASK){for(var X=i.IBUF_MASK+1-l,P=0;P=s){e.write(r,s),u-=s;for(P=0;P=s;){if(c=s-u,o.input_.read(r,u,c)n.buffer.length){var oe=new Uint8Array(B+G);oe.set(n.buffer),n.buffer=oe}if(W=ie.input_end,U=ie.is_uncompressed,ie.is_metadata)for(JumpToByteBoundary(b);G>0;--G)b.readMoreInput(),b.readBits(8);else if(0!==G)if(U)b.bit_pos_=b.bit_pos_+7&-8,CopyUncompressedBlockToOutput(n,G,B,K,P,b),B+=G;else{for(t=0;t<3;++t)j[t]=DecodeVarLenUint8(b)+1,j[t]>=2&&(ReadHuffmanCode(j[t]+2,v,t*A,b),ReadHuffmanCode(h,y,t*A,b),q[t]=ReadBlockLength(y,t*A,b),Z[t]=1);for(b.readMoreInput(),F=(1<<(Y=b.readBits(2)))-1,L=(R=C+(b.readBits(4)<0;){var ue,le,Xe,Pe,Ke,de,me,he,fe,ge,pe,ve;for(b.readMoreInput(),0===q[1]&&(DecodeBlockType(j[1],v,1,H,J,Z,b),q[1]=ReadBlockLength(y,A,b),z=T[1].htrees[H[1]]),--q[1],(le=(ue=ReadSymbol(T[1].codes,z,b))>>6)>=2?(le-=2,me=-1):me=0,Xe=l.kInsertRangeLut[le]+(ue>>3&7),Pe=l.kCopyRangeLut[le]+(7&ue),Ke=l.kInsertLengthPrefixCode[Xe].offset+b.readBits(l.kInsertLengthPrefixCode[Xe].nbits),de=l.kCopyLengthPrefixCode[Pe].offset+b.readBits(l.kCopyLengthPrefixCode[Pe].nbits),O=K[B-1&P],k=K[B-2&P],fe=0;fe4?3:de-2))],(me=ReadSymbol(T[2].codes,T[2].htrees[te],b))>=R)ve=(me-=R)&F,me=R+((Ae=(2+(1&(me>>=Y))<<(pe=1+(me>>1)))-4)+b.readBits(pe)<(x=B=o.minDictionaryWordLength&&de<=o.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+B+" distance: "+he+" len: "+de+" bytes left: "+G);var Ae=o.offsetsByLength[de],ye=he-x-1,be=o.sizeBitsByLength[de],Ce=ye>>be;if(Ae+=(ye&(1<=p){n.write(K,s);for(var We=0;We0&&(N[3&w]=he,++w),de>G)throw new Error("Invalid backward reference. pos: "+B+" distance: "+he+" len: "+de+" bytes left: "+G);for(fe=0;fethis.buffer.length&&(t=this.buffer.length-this.pos);for(var r=0;rthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(e.subarray(0,n),this.pos),this.pos+=n,n},n.BrotliOutput=BrotliOutput},function(e,n,t){var r=t(299);n.init=function(){n.dictionary=r.init()},n.offsetsByLength=new Uint32Array([0,0,0,0,0,4096,9216,21504,35840,44032,53248,63488,74752,87040,93696,100864,104704,106752,108928,113536,115968,118528,119872,121280,122016]),n.sizeBitsByLength=new Uint8Array([0,0,0,0,10,10,11,11,10,10,10,10,10,9,9,8,7,7,8,7,7,6,6,5,5]),n.minDictionaryWordLength=4,n.maxDictionaryWordLength=24},function(e,n){function HuffmanCode(e,n){this.bits=e,this.value=n}n.HuffmanCode=HuffmanCode;var t=15;function GetNextKey(e,n){for(var t=1<>=1;return(e&t-1)+t}function ReplicateValue(e,n,t,r,a){do{e[n+(r-=t)]=new HuffmanCode(a.bits,a.value)}while(r>0)}function NextTableBitSize(e,n,r){for(var a=1<0;--f[o])ReplicateValue(e,n+s,u,K,new HuffmanCode(255&o,65535&m[c++])),s=GetNextKey(s,o);for(X=d-1,l=-1,o=r+1,u=2;o<=t;++o,u<<=1)for(;f[o]>0;--f[o])(s&X)!==l&&(n+=K,d+=K=1<<(P=NextTableBitSize(f,o,r)),e[h+(l=s&X)]=new HuffmanCode(P+r&255,n-h-l&65535)),ReplicateValue(e,n+(s>>r),u,K,new HuffmanCode(o-r&255,65535&m[c++])),s=GetNextKey(s,o);return d}},function(e,n,t){"use strict";t.d(n,"d",function(){return PdfSolidBrush}),t.d(n,"a",function(){return Color}),t.d(n,"c",function(){return PdfPen}),t.d(n,"b",function(){return PdfDashPattern});var r=t(42);class PdfSolidBrush{constructor(e){this.color=e}}class Color{constructor(e,n,t,r=1){this.r=e,this.g=n,this.b=t,this.a=r}static fromString(e){const n=r.get.rgb(e);return n?new Color(n[0],n[1],n[2],n[3]):new Color(0,0,0)}toArray(){return[this.r,this.g,this.b]}toString(){return r.to.hex([this.r,this.g,this.b])}}class PdfPen{constructor(e,n,t){this.color=e,this.width=n,this.dashPattern=t}}class PdfDashPattern{constructor(...e){this.steps=e}}},function(e,n,t){"use strict";t.d(n,"a",function(){return PdfFont});class PdfFont{constructor(e,n,t="normal",r="normal"){this.fontFamily=e,this.fontSize=n,this.fontStyle=t,this.fontWeight=r}}},function(e,n){},function(e,n){},function(e,n,t){"use strict";var r=t(135),a=t(138),i=t.n(a),o=t(88),c=t.n(o),s=t(42),u=t(14),l=t(40),X=t(57),P=function(e,n,t,r){return new(t||(t=Promise))(function(a,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?a(e.value):function adopt(e){return e instanceof t?e:new t(function(n){n(e)})}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,n||[])).next())})};const K={normal:"400",bold:"700"},d=(e,n,t,r)=>({name:(e||"").toLowerCase().trim().replace(/^"|"$/g,"").trim(),style:(n||"normal").toLowerCase(),weight:parseInt(K[t]||t)||parseInt(K.normal),postscriptName:r}),m=e=>`${e.name}|${e.style}|${e.weight}`,h=[{name:"helvetica",style:"normal",weight:400,uid:"Helvetica",registered:!0,source:""},{name:"helvetica",style:"normal",weight:700,uid:"Helvetica-Bold",registered:!0,source:""},{name:"helvetica",style:"italic",weight:400,uid:"Helvetica-Oblique",registered:!0,source:""},{name:"helvetica",style:"italic",weight:700,uid:"Helvetica-BoldOblique",registered:!0,source:""},{name:"times",style:"normal",weight:400,uid:"Times-Roman",registered:!0,source:""},{name:"times",style:"normal",weight:700,uid:"Times-Bold",registered:!0,source:""},{name:"times",style:"italic",weight:400,uid:"Times-Italic",registered:!0,source:""},{name:"times",style:"italic",weight:700,uid:"Times-BoldItalic",registered:!0,source:""},{name:"courier",style:"normal",weight:400,uid:"Courier",registered:!0,source:""},{name:"courier",style:"normal",weight:700,uid:"Courier-Bold",registered:!0,source:""},{name:"courier",style:"italic",weight:400,uid:"Courier-Oblique",registered:!0,source:""},{name:"courier",style:"italic",weight:700,uid:"Courier-BoldOblique",registered:!0,source:""},{name:"symbol",style:"normal",weight:400,uid:"Symbol",registered:!0,source:""},{name:"zapfdingbats",style:"normal",weight:700,uid:"ZapfDingbats",registered:!0,source:""}],f=new RegExp("^(arial|tahoma|calibri|verdana|geneva|roboto|open sans|noto sans|lato|pt sans|ubuntu)","i"),g=new RegExp("^(times|merriweather|lora|pt serif|noto serif|crimson text|bitter|arvo)","i"),p=new RegExp("^(courier|lucida console|inconsolata|space mono|monaco|consolas)","i");function getDefaultFontUid(e="sans-serif",n="normal",t=400,r="Helvetica"){let a;switch(f.test(e)?e="sans-serif":g.test(e)?e="serif":p.test(e)&&(e="monospace"),e){case"serif":a="Times";break;case"monospace":a="Courier";break;case"dingbat":a="ZapfDingbats";break;case"symbol":a="Symbol";break;default:a=r}const i=h.find(e=>e.name===a.toLowerCase()&&e.weight===(t<=400?400:700)&&e.style===("italic"===n||"oblique"===n?"italic":"normal"));return i?i.uid:r}const v=getDefaultFontUid();class fontRegistrar_FontRegistrar{constructor(e,n=[]){this._doc=e,this._fonts=[],this._substitutions={},this._extDefaultFont=null,this._loadedSources={},n.forEach(e=>{e.name.split(",").forEach(n=>{const t=d(n,e.style,e.weight,e.postscriptName),r=Object.assign(Object.assign({},t),{uid:m(t),source:e.source,registered:!1});this._fonts.push(r),e.useAsDefault&&(this._extDefaultFont=r)})})}getFontName(e,n,t){var r;return P(this,void 0,void 0,function*(){const a=e.split(",").map(e=>d(e,n,t)),i=a[0],o=m(i);if(this._substitutions[o])return this._substitutions[o];const c=this._fonts.find(e=>e.uid===o);if(c){if(!c.registered){let a=void 0;try{const i="string"==typeof c.source?[c.source]:c.source;let o="";for(const e of i)if(o=e,a=null===(r=yield X.a.arrayBufferAsync(e))||void 0===r?void 0:r.data)break;if(!a)throw new Error;this._doc.registerFont(c.uid,a,c.postscriptName),this._loadedSources[c.uid]={source:o,postscriptName:c.postscriptName}}catch(r){return this._fonts.splice(this._fonts.indexOf(c),1),this._extDefaultFont&&c.uid===this._extDefaultFont.uid&&(this._extDefaultFont=null),yield this.getFontName(e,n,t)}c.registered=!0}return this._substitutions[o]={uid:c.uid},this._substitutions[o]}const s=this.searchForSimilar(i);if(s){const e={uid:(yield this.getFontName(s.name,s.style,s.weight.toString())).uid};return i.weight>s.weight&&(e.fauxBold=!0),"italic"!==i.style&&"oblique"!==i.style||i.style===s.style||(e.oblique=!0),this._substitutions[o]=e,e}if(a.length>1){const e=yield this.getFontName(a.slice(1).map(e=>e.name).join(","),n,t);return this._substitutions[o]=e,e}const u=getDefaultFontUid(i.name,i.style,i.weight,this._extDefaultFont?this._extDefaultFont.uid:v);if(this._extDefaultFont&&this._extDefaultFont.uid==u){const e=yield this.getFontName(this._extDefaultFont.name,i.style,i.weight.toString());this._substitutions[o]=e}else this._substitutions[o]={uid:u};return this._substitutions[o]})}searchForSimilar(e){const n=this._fonts.filter(n=>n.name===e.name);if(n.length>0){if("italic"===e.style||"oblique"===e.style){const e=n.find(e=>"italic"===e.style||"oblique"===e.style);if(e)return e}return n[0]}return null}dumpLoadedFonts(){console.log("Loaded fonts:"),Object.entries(this._loadedSources).forEach(([e,n])=>{console.log(`"${e}" loaded from "${n.source}"${n.postscriptName?` (postscriptName: ${n.postscriptName})`:""}`)}),console.log("Font substitutions:"),Object.entries(this._substitutions).forEach(([e,n])=>{e!==n.uid&&console.log(`"${e}" => "${n.uid}"${n.fauxBold?" fauxBold":""}${n.oblique?" oblique":""}`)})}}t.d(n,"a",function(){return document_PdfDocument});var A=function(e,n,t,r){return new(t||(t=Promise))(function(a,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r.throw(e))}catch(e){i(e)}}function step(e){e.done?a(e.value):function adopt(e){return e instanceof t?e:new t(function(n){n(e)})}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,n||[])).next())})};const y=e=>new r.a(e);class document_PdfDocument{constructor(e){this.options=e,this._formsInitialized=!1,this._lineHeightsCache={};const n={margins:e.pageSettings.margins,layout:e.pageSettings.layout,size:[e.pageSettings.size.width,e.pageSettings.size.height],info:Object.assign({Producer:"GrapeCity",Creator:"GrapeCity"},e.info?{Author:e.info.author||"",Title:e.info.title||"",Keywords:e.info.keywords||"",Subject:e.info.subject||""}:{}),bufferPages:!0};n.pdfVersion=e.pdfVersion||"1.4",e.security&&(e.security.userPassword&&(n.userPassword=e.security.userPassword),e.security.ownerPassword&&(n.ownerPassword=e.security.ownerPassword,e.security.permissions&&(n.permissions=Object.assign(Object.assign({},e.security.permissions),{printing:"none"===e.security.permissions.printing?void 0:e.security.permissions.printing})))),this._doc=y(n),this._paths=new PdfPaths(this._doc),this._fontRegistrar=new fontRegistrar_FontRegistrar(this._doc,e.fonts);const t=this._doc.pipe(i()());t.on("finish",()=>{var n;(null===(n=e.debug)||void 0===n?void 0:n.dumpFonts)&&this._fontRegistrar.dumpLoadedFonts();const r=t.toBlob("application/pdf");e.onEnded({blob:r})})}get document(){return this}get outline(){return this._doc.outline}switchToPage(e){return this._doc.switchToPage(e)}get pagesCount(){return this._doc.bufferedPageRange().start+this._doc.bufferedPageRange().count}restoreState(){this._doc.restore()}saveState(){this._doc.save()}rotate(e,n){this._doc.rotate(e,{origin:[n.x,n.y]})}translate(e,n){this._doc.translate(e,n)}scale(e,n,t){this._doc.scale(e,n,{origin:[t.x,t.y]})}get paths(){return this._paths}link(e,n){if("number"==typeof n){const t={Subtype:"Link",Dest:[n,"XYZ",null,null,null]};this._doc.annotate(e.x,e.y,e.width,e.height,t)}else this._doc.link(e.x,e.y,e.width,e.height,n)}getLineHeight(e){return A(this,void 0,void 0,function*(){const n=yield this._fontRegistrar.getFontName(e.fontFamily,e.fontStyle,e.fontWeight),t=`${n.uid}|${e.fontSize}`;if(this._lineHeightsCache[t])return this._lineHeightsCache[t];try{this._doc.font(n.uid)}catch(e){this._doc.font(v)}const r=this._doc.fontSize(e.fontSize).heightOfString("1");return this._lineHeightsCache[t]=r,r})}drawText(e,n,t,r){return A(this,void 0,void 0,function*(){const a=yield this._fontRegistrar.getFontName(r.font.fontFamily,r.font.fontStyle,r.font.fontWeight);try{this._doc.font(a.uid)}catch(e){this._doc.font(v)}const i=e.replace(/\t|^\u200B$/g," ");this._doc.fillColor(r.brush.color.toArray(),r.brush.color.a).strokeColor(r.brush.color.toArray(),r.brush.color.a).fontSize(r.font.fontSize).lineWidth(.03*r.font.fontSize).undash();const o=Math.max(r.width,r.font.fontSize),c=r.align&&"left"!==r.align,s={width:o,height:r.height,align:r.align,strike:r.strike,underline:r.underline,lineBreak:!0,characterSpacing:r.characterSpacing,oblique:a.oblique,stroke:a.fauxBold,fill:!0,lineGap:r.lineGap,baseline:r.baseline},u=c||!r.charWrap&&r.lineBreak?0:this._doc.widthOfString(i,s);if(!c&&!r.lineBreak&&u>o&&(s.width=Number.MAX_SAFE_INTEGER,s.lineBreak=!1),r.charWrap&&!c&&u>o){const e=[...i],r=Object.assign(Object.assign({},s),{continued:e.length>1});this._doc.text(e[0],n,t,r);for(let n=1;n1&&this._doc.text(e[e.length-1],s)}else if("center"===r.align){const e=i.split("\n");this._doc.text("",n,t,s),e.forEach(e=>{""!==e?this._doc.text(e,s):this._doc.moveDown()})}else this._doc.text(i,n,t,s)})}drawSvg(e,n,t,r){return A(this,void 0,void 0,function*(){if(!e)return;const a=e.startsWith("data:image/svg+xml;base64,")?Object(u.a)(e.replace("data:image/svg+xml;base64,","")):e,i=Object(l.d)(a),o="100%"===i.width?r.areaWidth:r.width,X="100%"===i.height?r.areaHeight:r.height,P=y(),K={};try{c()(P,a,0,0,{width:o,height:X,fontCallback:(e,n,t)=>{const r=m(d(e,t?"italic":"normal",n?"bold":"normal"));return K[r]={name:e,style:t?"italic":"normal",weight:n?"bold":"normal"},getDefaultFontUid()}})}catch(e){return}const h=Object.keys(K);for(let e=0;e{if(!n)return e;const t=s.get.rgb(n.toLowerCase());return t?[[t[0],t[1],t[2]],t[3]]:e},fontCallback:(e,n,t)=>{const r=m(d(e,t?"italic":"normal",n?"bold":"normal"));return K[r].resolvedUid||getDefaultFontUid()}})})}drawImage(e,n,t,r){r.width&&r.height&&r.stretchProportionally&&(r.fit=[r.width,r.height],r.height=void 0,r.width=void 0),this._doc.image(e,n,t,r)}addPage(e){return this._doc.addPage({margins:e.margins,layout:e.layout,size:[e.size.width,e.size.height]}),this.options.onPageAdded(),this._doc}end(){this.options.autoPrint&&Object(l.c)(this),this._doc.end()}formText(e,n,t,r,a,i){this._formsInitialized||(this._doc.initForm(),this._formsInitialized=!0),this._doc.formText(e,n,t,r,a,i)}}class PdfPaths{constructor(e){this._doc=e}rect(e,n,t,r){return this._doc.rect(e,n,t,r),this}roundedRect(e,n,t,r,a){return this._doc.roundedRect(e,n,t,r,a),this}ellipse(e,n,t,r){return this._doc.ellipse(e,n,t,r),this}fill(e){return this._doc.fillOpacity(e.a).fill(e.toArray()),this}closePath(){return this._doc.closePath(),this}clip(){return this._doc.clip(),this}stroke(e){return e.dashPattern?this._doc.dash(e.dashPattern.steps[0],{space:e.dashPattern.steps[1]}):this._doc.undash(),this._doc.lineWidth(e.width).opacity(e.color.a).stroke(e.color.toArray()),this}moveTo(e,n){return this._doc.moveTo(e,n),this}lineTo(e,n){return this._doc.lineTo(e,n),this}arc(e,n,t,r,a,i=!0){const o=r/180*Math.PI,c=a/180*Math.PI,s=e+t*Math.cos(o),u=n+t*Math.sin(o),l=e+t*Math.cos(c),X=n+t*Math.sin(c),P=`${i?"L":"M"} ${s},${u} A ${t},${t} 0 ${c-o>Math.PI||o>c?"1":"0"},1 ${l},${X}`;return this._doc.path(P),this}}},function(e,n,t){"use strict";(function(e,r){var i=t(38),o=t.n(i),u=t(1),X=t.n(u),P=t(27),K=t.n(P),d=t(0),f=t.n(d),g=t(59),p=t.n(g),y=t(39),b=t(136),B=t.n(b),W=t(137),x=t.n(W);function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,n){for(var t=0;t1){var t=e[0],r=e[e.length-1];n.push(" /Limits ".concat(Y.convert([new String(t),new String(r)])))}n.push(" /Names [");var a=!0,i=!1,o=void 0;try{for(var c,s=e[Symbol.iterator]();!(a=(c=s.next()).done);a=!0){var u=c.value;n.push(" ".concat(Y.convert(new String(u))," ").concat(Y.convert(this._items[u])))}}catch(e){i=!0,o=e}finally{try{a||null==s.return||s.return()}finally{if(i)throw o}}return n.push("]"),n.push(">>"),n.join("\n")}}]),PDFNameTree}(),O=function pad(e,n){return(Array(n+1).join("0")+e).slice(-n)},k=/[\n\r\t\b\f\(\)\\]/g,_={"\n":"\\n","\r":"\\r","\t":"\\t","\b":"\\b","\f":"\\f","\\":"\\\\","(":"\\(",")":"\\)"},U=function swapBytes(e){var n=e.length;if(1&n)throw new Error("Buffer length must be even");for(var t=0,r=n-1;t1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof n)return"/".concat(n);if(n instanceof String){for(var r,a=n,i=!1,o=0,c=a.length;o127){i=!0;break}return r=i?U(e.from("\ufeff".concat(a),"utf16le")):e.from(a.valueOf(),"ascii"),a=(a=t?t(r).toString("binary"):r.toString("binary")).replace(k,function(e){return _[e]}),"(".concat(a,")")}if(e.isBuffer(n))return"<".concat(n.toString("hex"),">");if(n instanceof N||n instanceof w)return n.toString();if(n instanceof Date){var s="D:".concat(O(n.getUTCFullYear(),4))+O(n.getUTCMonth()+1,2)+O(n.getUTCDate(),2)+O(n.getUTCHours(),2)+O(n.getUTCMinutes(),2)+O(n.getUTCSeconds(),2)+"Z";return t&&(s=(s=t(new e(s,"ascii")).toString("binary")).replace(k,function(e){return _[e]})),"(".concat(s,")")}if(Array.isArray(n)){var u=n.map(function(e){return PDFObject.convert(e,t)}).join(" ");return"[".concat(u,"]")}if("[object Object]"==={}.toString.call(n)){var l=["<<"];for(var X in n){var P=n[X];l.push("/".concat(X," ").concat(PDFObject.convert(P,t)))}return l.push(">>"),l.join("\n")}return"number"==typeof n?PDFObject.number(n):"".concat(n)}},{key:"number",value:function number(e){if(e>-1e21&&e<1e21)return Math.round(1e6*e)/1e6;throw new Error("unsupported number: ".concat(e))}}]),PDFObject}(),R=function(n){function PDFReference(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _classCallCheck(this,PDFReference),(t=_possibleConstructorReturn(this,_getPrototypeOf(PDFReference).call(this))).document=e,t.id=n,t.data=r,t.gen=0,t.compress=t.document.compress&&!t.data.Filter,t.uncompressedLength=0,t.buffer=[],t}return _inherits(PDFReference,N),_createClass(PDFReference,[{key:"write",value:function write(n){if(e.isBuffer(n)||(n=new e(n+"\n","binary")),this.uncompressedLength+=n.length,null==this.data.Length&&(this.data.Length=0),this.buffer.push(n),this.data.Length+=n.length,this.compress)return this.data.Filter="FlateDecode"}},{key:"end",value:function end(e){return e&&this.write(e),this.finalize()}},{key:"finalize",value:function finalize(){this.offset=this.document._offset;var n=this.document._security?this.document._security.getEncryptFn(this.id,this.gen):null;this.buffer.length&&(this.buffer=e.concat(this.buffer),this.compress&&(this.buffer=K.a.deflateSync(this.buffer)),n&&(this.buffer=n(this.buffer)),this.data.Length=this.buffer.length),this.document._write("".concat(this.id," ").concat(this.gen," obj")),this.document._write(Y.convert(this.data,n)),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)}},{key:"toString",value:function toString(){return"".concat(this.id," ").concat(this.gen," R")}}]),PDFReference}(),F={top:72,left:72,bottom:72,right:72},E={"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]},D=function(){function PDFPage(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,PDFPage),this.document=e,this.size=n.size||"letter",this.layout=n.layout||"portrait","number"==typeof n.margin?this.margins={top:n.margin,left:n.margin,bottom:n.margin,right:n.margin}:this.margins=n.margins||F;var t=Array.isArray(this.size)?this.size:E[this.size.toUpperCase()];this.width=t["portrait"===this.layout?0:1],this.height=t["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})}return _createClass(PDFPage,[{key:"maxY",value:function maxY(){return this.height-this.margins.bottom}},{key:"write",value:function write(e){return this.content.write(e)}},{key:"end",value:function end(){return this.dictionary.end(),this.resources.end(),this.content.end()}},{key:"fonts",get:function get(){var e=this.resources.data;return null!=e.Font?e.Font:e.Font={}}},{key:"xobjects",get:function get(){var e=this.resources.data;return null!=e.XObject?e.XObject:e.XObject={}}},{key:"ext_gstates",get:function get(){var e=this.resources.data;return null!=e.ExtGState?e.ExtGState:e.ExtGState={}}},{key:"patterns",get:function get(){var e=this.resources.data;return null!=e.Pattern?e.Pattern:e.Pattern={}}},{key:"annotations",get:function get(){var e=this.dictionary.data;return null!=e.Annots?e.Annots:e.Annots=[]}}]),PDFPage}();function inRange(e,n){if(e