home/aissorg/public_html/admin/assets/js/jspdf.min.js 0000644 00000671552 15116256260 0016725 0 ustar 00 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.jspdf=e()}(this,function(){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},e=function(e){var n="1.3",r={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],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};function i(t){var n={};this.subscribe=function(t,e,r){if("function"!=typeof e)return!1;n.hasOwnProperty(t)||(n[t]={});var i=Math.random().toString(35);return n[t][i]=[e,!!r],i},this.unsubscribe=function(t){for(var e in n)if(n[e][t])return delete n[e][t],!0;return!1},this.publish=function(r){if(n.hasOwnProperty(r)){var i=Array.prototype.slice.call(arguments,1),o=[];for(var s in n[r]){var a=n[r][s];try{a[0].apply(t,i)}catch(t){e.console&&console.error("jsPDF PubSub Error",t.message,t)}a[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}}}function o(s,a,c,l){var u={};"object"===(void 0===s?"undefined":t(s))&&(s=(u=s).orientation,a=u.unit||a,c=u.format||c,l=u.compress||u.compressPdf||l),a=a||"mm",c=c||"a4",s=(""+(s||"P")).toLowerCase();(""+c).toLowerCase();var h,f,d,p,g,m,w,y,v,b,x=!!l&&"function"==typeof Uint8Array,k=u.textColor||"0 g",_=u.drawColor||"0 G",C=u.fontSize||16,S=u.lineHeight||1.15,T=u.lineWidth||.200025,I=2,P=!1,E=[],O={},F={},R=0,B=[],D=[],j=[],N=[],z=[],L=0,M=0,U=0,H={title:"",subject:"",author:"",keywords:"",creator:""},W={},X=new i(W),V=function(t){return t.toFixed(2)},Y=function(t){return t.toFixed(3)},G=function(t){return("0"+parseInt(t)).slice(-2)},J=function(t){P?B[p].push(t):(U+=t.length+1,N.push(t))},Q=function(){return E[++I]=U,J(I+" 0 obj"),I},K=function(t){J("stream"),J(t),J("endstream")},$=function(){for(var t in J("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),J("/Font <<"),O)O.hasOwnProperty(t)&&J("/"+t+" "+O[t].objectNumber+" 0 R");J(">>"),J("/XObject <<"),X.publish("putXobjectDict"),J(">>")},Z=function(){!function(){for(var t in O)O.hasOwnProperty(t)&&((e=O[t]).objectNumber=Q(),J("<>"),J("endobj"));var e}(),X.publish("putResources"),E[2]=U,J("2 0 obj"),J("<<"),$(),J(">>"),J("endobj"),X.publish("postPutResources")},tt=function(t,e,n){F.hasOwnProperty(e)||(F[e]={}),F[e][n]=t},et=function(t,e,n,r){var i="F"+(Object.keys(O).length+1).toString(10),o=O[i]={id:i,PostScriptName:t,fontName:e,fontStyle:n,encoding:r,metadata:{}};return tt(i,e,n),X.publish("addFont",o),i},nt=function(t,e){return function(t,e){var n,r,i,o,s,a,c,l,u;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&O[h].metadata&&O[h].metadata[i]&&O[h].metadata[i].encoding&&(o=O[h].metadata[i].encoding,!s&&O[h].encoding&&(s=O[h].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(c=!1,a=[],n=0,r=t.length;n>8&&(c=!0);t=a.join("")}for(n=t.length;void 0===c&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into Utm_2 BE");a.push(u),a.push(l-(u<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},rt=function(){(function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var i=t.toLowerCase();r.hasOwnProperty(i)&&(t=r[i][0]/f,e=r[i][1]/f)}if(Array.isArray(t)&&(e=t[1],t=t[0]),n){switch(n.substr(0,1)){case"l":e>t&&(n="s");break;case"p":t>e&&(n="s")}"s"===n&&(d=t,t=e,e=d)}P=!0,B[++R]=[],j[R]={width:Number(t)||g,height:Number(e)||m},D[R]={},it(R)}).apply(this,arguments),J(V(T*f)+" w"),J(_),0!==L&&J(L+" J"),0!==M&&J(M+" j"),X.publish("addPage",{pageNumber:R})},it=function(t){t>0&&t<=R&&(p=t,g=j[t].width,m=j[t].height)},ot=function(t,e){var n;switch(t=void 0!==t?t:O[h].fontName,e=void 0!==e?e:O[h].fontStyle,void 0!==t&&(t=t.toLowerCase()),t){case"sans-serif":case"verdana":case"arial":case"helvetica":t="helvetica";break;case"fixed":case"monospace":case"terminal":case"courier":t="courier";break;case"serif":case"cursive":case"fantasy":default:t="times"}try{n=F[t][e]}catch(t){}return n||null==(n=F.times[e])&&(n=F.times.normal),n},st=function(){P=!1,I=2,U=0,N=[],E=[],z=[],X.publish("buildDocument"),J("%PDF-"+n),function(){var t,n,r,i,s,a,c,l,u,h=[];for(c=e.adler32cs||o.adler32cs,x&&void 0===c&&(x=!1),t=1;t<=R;t++){if(h.push(Q()),l=(g=j[t].width)*f,u=(m=j[t].height)*f,J("<>"),J("endobj"),n=B[t].join("\n"),Q(),x){for(r=[],i=n.length;i--;)r[i]=n.charCodeAt(i);a=c.from(n),(s=new q(6)).append(new Uint8Array(r)),n=s.flush(),(r=new Uint8Array(n.length+6)).set(new Uint8Array([120,156])),r.set(n,2),r.set(new Uint8Array([255&a,a>>8&255,a>>16&255,a>>24&255]),n.length+2),n=String.fromCharCode.apply(null,r),J("<>")}else J("<>");K(n),J("endobj")}E[1]=U,J("1 0 obj"),J("<>"),J("endobj"),X.publish("postPutPages")}(),function(){X.publish("putAdditionalObjects");for(var t=0;t>"),J("endobj"),Q(),J("<<"),function(){switch(J("/Type /Catalog"),J("/Pages 1 0 R"),y||(y="fullwidth"),y){case"fullwidth":J("/OpenAction [3 0 R /FitH null]");break;case"fullheight":J("/OpenAction [3 0 R /FitV null]");break;case"fullpage":J("/OpenAction [3 0 R /Fit]");break;case"original":J("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+y;"%"===t.substr(t.length-1)&&(y=parseInt(y)/100),"number"==typeof y&&J("/OpenAction [3 0 R /XYZ null null "+V(y)+"]")}switch(v||(v="continuous"),v){case"continuous":J("/PageLayout /OneColumn");break;case"single":J("/PageLayout /SinglePage");break;case"two":case"twoleft":J("/PageLayout /TwoColumnLeft");break;case"tworight":J("/PageLayout /TwoColumnRight")}w&&J("/PageMode /"+w),X.publish("putCatalog")}(),J(">>"),J("endobj");var t,r=U,i="0000000000";for(J("xref"),J("0 "+(I+1)),J(i+" 65535 f "),t=1;t<=I;t++){var s=E[t];J("function"==typeof s?(i+E[t]()).slice(-10)+" 00000 n ":(i+E[t]).slice(-10)+" 00000 n ")}return J("trailer"),J("<<"),J("/Size "+(I+1)),J("/Root "+I+" 0 R"),J("/Info "+(I-1)+" 0 R"),J(">>"),J("startxref"),J(""+r),J("%%EOF"),P=!0,N.join("\n")},at=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e},ct=function(){for(var t=st(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},lt=function(){return new Blob([ct()],{type:"application/pdf"})},ut=((b=function(t,n){var r="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(st()):0;switch(t){case void 0:return st();case"save":if(navigator.getUserMedia&&(void 0===e.URL||void 0===e.URL.createObjectURL))return W.output("dataurlnewwindow");A(lt(),n),"function"==typeof A.unload&&e.setTimeout&&setTimeout(A.unload,911);break;case"arraybuffer":return ct();case"blob":return lt();case"bloburi":case"bloburl":return e.URL&&e.URL.createObjectURL(lt())||void 0;case"datauristring":case"dataurlstring":return r;case"dataurlnewwindow":var i=e.open(r);if(i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return e.document.location.href=r;default:throw new Error('Output type "'+t+'" is not supported.')}}).foo=function(){try{return b.apply(this,arguments)}catch(r){var t=r.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var n="Error in function "+t.split("\n")[0].split("<")[0]+": "+r.message;if(!e.console)throw new Error(n);e.console.error(n,r),e.alert&&alert(n)}},b.foo.bar=b,b.foo);switch(a){case"pt":f=1;break;case"mm":f=72/25.4000508;break;case"cm":f=72/2.54000508;break;case"in":f=72;break;case"px":f=96/72;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+a}for(var ht in W.internal={pdfEscape:nt,getStyle:at,getFont:function(){return O[ot.apply(W,arguments)]},getFontSize:function(){return C},getLineHeight:function(){return C*S},write:function(t){J(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return V(t*f)},getVerticalCoordinateString:function(t){return V((m-t)*f)},collections:{},newObject:Q,newAdditionalObject:function(){var t=2*B.length+1,e={objId:t+=z.length,content:""};return z.push(e),e},newObjectDeferred:function(){return E[++I]=function(){return U},I},newObjectDeferredBegin:function(t){E[t]=U},putStream:K,events:X,scaleFactor:f,pageSize:{get width(){return g},get height(){return m}},output:function(t,e){return ut(t,e)},getNumberOfPages:function(){return B.length-1},pages:B,out:J,f2:V,getPageInfo:function(t){return{objId:2*(t-1)+3,pageNumber:t,pageContext:D[t]}},getCurrentPageInfo:function(){return{objId:2*(p-1)+3,pageNumber:p,pageContext:D[p]}},getPDFVersion:function(){return n}},W.addPage=function(){return rt.apply(this,arguments),this},W.setPage=function(){return it.apply(this,arguments),this},W.insertPage=function(t){return this.addPage(),this.movePage(p,t),this},W.movePage=function(t,e){if(t>e){for(var n=B[t],r=j[t],i=D[t],o=t;o>e;o--)B[o]=B[o-1],j[o]=j[o-1],D[o]=D[o-1];B[e]=n,j[e]=r,D[e]=i,this.setPage(e)}else if(t0&&t<=R&&(B.splice(t,1),j.splice(t,1),p>--R&&(p=R),this.setPage(p))}.apply(this,arguments),this},W.setDisplayMode=function(t,e,n){return y=t,v=e,w=n,this},W.text=function(t,e,n,r,i,o){function s(t){return t=t.split("\t").join(Array(u.TabLen||9).join(" ")),nt(t,r)}"number"==typeof t&&(d=n,n=e,e=t,t=d),"string"==typeof t&&(t=t.match(/[\n\r]/)?t.split(/\r\n|\r|\n/g):[t]),"string"==typeof i&&(o=i,i=null),"string"==typeof r&&(o=r,r=null),"number"==typeof r&&(i=r,r=null);var a="",c="Td";if(i){i*=Math.PI/180;var l=Math.cos(i),p=Math.sin(i);a=[V(l),V(p),V(-1*p),V(l),""].join(" "),c="Tm"}"noBOM"in(r=r||{})||(r.noBOM=!0),"autoencode"in r||(r.autoencode=!0);var g,w="",y=this.internal.getCurrentPageInfo().pageContext;if(!0===r.stroke?!0!==y.lastTextWasStroke&&(w="1 Tr\n",y.lastTextWasStroke=!0):(y.lastTextWasStroke&&(w="0 Tr\n"),y.lastTextWasStroke=!1),void 0===this._runningPageHeight&&(this._runningPageHeight=0),"string"==typeof t)t=s(t);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');for(var v=t.concat(),b=[],x=v.length;x--;)b.push(s(v.shift()));var _=Math.ceil((m-n-this._runningPageHeight)*f/(C*S));if(0<=_&&b.length,o){var A,q,T,I=C*S,P=t.map(function(t){return this.getStringUnitWidth(t)*C/f},this);if(T=Math.max.apply(Math,P),"center"===o)A=e-T/2,e-=P[0]/2;else{if("right"!==o)throw new Error('Unrecognized alignment option, use "center" or "right".');A=e-T,e-=P[0]}q=e,t=b[0];var E=1;for(x=b.length;E>16&255,e=r>>8&255,n=255&r}return k=0===t&&0===e&&0===n||void 0===e?Y(t/255)+" g":[Y(t/255),Y(e/255),Y(n/255),"rg"].join(" "),this},W.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},W.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return L=e,J(e+" J"),this},W.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return M=e,J(e+" j"),this},W.output=ut,W.save=function(t){W.output("save",t)},o.API)o.API.hasOwnProperty(ht)&&("events"===ht&&o.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(X,o.API.events):W[ht]=o.API[ht]);return function(){for(var t=[["Helvetica","helvetica","normal"],["Helvetica-Bold","helvetica","bold"],["Helvetica-Oblique","helvetica","italic"],["Helvetica-BoldOblique","helvetica","bolditalic"],["Courier","courier","normal"],["Courier-Bold","courier","bold"],["Courier-Oblique","courier","italic"],["Courier-BoldOblique","courier","bolditalic"],["Times-Roman","times","normal"],["Times-Bold","times","bold"],["Times-Italic","times","italic"],["Times-BoldItalic","times","bolditalic"],["ZapfDingbats","zapfdingbats"]],e=0,n=t.length;e>\n",this.acroformPlugin.xForms.push(a)}if(i.appearanceStreamContent){for(var c in s+="/AP << ",i.appearanceStreamContent){var l=i.appearanceStreamContent[c];if(s+="/"+c+" ",s+="<< ",Object.keys(l).length>=1||Array.isArray(l))for(var r in l){var h;"function"==typeof(h=l[r])&&(h=h.call(this,i)),s+="/"+r+" "+h+" ",this.acroformPlugin.xForms.indexOf(h)>=0||this.acroformPlugin.xForms.push(h)}else"function"==typeof(h=l)&&(h=h.call(this,i)),s+="/"+r+" "+h+" \n",this.acroformPlugin.xForms.indexOf(h)>=0||this.acroformPlugin.xForms.push(h);s+=" >>\n"}s+=">>\n"}s+=">>\nendobj\n",this.internal.out(s)}e&&u.call(this,this.acroformPlugin.xForms)},u=function(t){for(var e in t){var n=e,r=t[e];this.internal.newObjectDeferredBegin(r&&r.objId);var i="";i+=r?r.getString():"",this.internal.out(i),delete t[n]}};t.addField=function(t){return t instanceof n.TextField?f.call(this,t):t instanceof n.ChoiceField?d.call(this,t):t instanceof n.Button?h.call(this,t):t instanceof n.ChildClass?s.call(this,t):t&&s.call(this,t),t.page=this.acroformPlugin.internal.getCurrentPageInfo().pageNumber,this};var h=function(t){(t=t||new n.Field).FT="/Btn";var e=t.Ff||0;t.pushbutton&&(e=n.internal.setBitPosition(e,17),delete t.pushbutton),t.radio&&(e=n.internal.setBitPosition(e,16),delete t.radio),t.noToggleToOff&&(e=n.internal.setBitPosition(e,15)),t.Ff=e,s.call(this,t)},f=function(t){(t=t||new n.Field).FT="/Tx";var e=t.Ff||0;t.multiline&&(e|=4096),t.password&&(e|=8192),t.fileSelect&&(e|=1<<20),t.doNotSpellCheck&&(e|=1<<22),t.doNotScroll&&(e|=1<<23),t.Ff=t.Ff||e,s.call(this,t)},d=function(t){var e=t||new n.Field;e.FT="/Ch";var r=e.Ff||0;e.combo&&(r=n.internal.setBitPosition(r,18),delete e.combo),e.edit&&(r=n.internal.setBitPosition(r,19),delete e.edit),e.sort&&(r=n.internal.setBitPosition(r,20),delete e.sort),e.multiSelect&&this.internal.getPDFVersion()>=1.4&&(r=n.internal.setBitPosition(r,22),delete e.multiSelect),e.doNotSpellCheck&&this.internal.getPDFVersion()>=1.4&&(r=n.internal.setBitPosition(r,23),delete e.doNotSpellCheck),e.Ff=r,s.call(this,e)}})(e.API);var n,i,o,s,a,c,l,u,h,f,d,p,m,w,y,v,x,k,_,C=window.AcroForm;C.internal={},C.createFormXObject=function(t){var e=new C.FormXObject,n=C.Appearance.internal.getHeight(t)||0,r=C.Appearance.internal.getWidth(t)||0;return e.BBox=[0,0,r,n],e},C.Appearance={CheckBox:{createAppearanceStream:function(){return{N:{On:C.Appearance.CheckBox.YesNormal},D:{On:C.Appearance.CheckBox.YesPushDown,Off:C.Appearance.CheckBox.OffPushDown}}},createMK:function(){return"<< /CA (3)>>"},YesPushDown:function(t){var e=C.createFormXObject(t),n="";t.Q=1;var r=C.internal.calculateX(t,"3","ZapfDingbats",50);return n+="0.749023 g\n 0 0 "+C.Appearance.internal.getWidth(t)+" "+C.Appearance.internal.getHeight(t)+" re\n f\n BMC\n q\n 0 0 1 rg\n /F13 "+r.fontSize+" Tf 0 g\n BT\n",n+=r.text,n+="ET\n Q\n EMC\n",e.stream=n,e},YesNormal:function(t){var e=C.createFormXObject(t),n="";t.Q=1;var r=C.internal.calculateX(t,"3","ZapfDingbats",.9*C.Appearance.internal.getHeight(t));return n+="1 g\n0 0 "+C.Appearance.internal.getWidth(t)+" "+C.Appearance.internal.getHeight(t)+" re\nf\nq\n0 0 1 rg\n0 0 "+(C.Appearance.internal.getWidth(t)-1)+" "+(C.Appearance.internal.getHeight(t)-1)+" re\nW\nn\n0 g\nBT\n/F13 "+r.fontSize+" Tf 0 g\n",n+=r.text,n+="ET\n Q\n",e.stream=n,e},OffPushDown:function(t){var e=C.createFormXObject(t),n="";return n+="0.749023 g\n 0 0 "+C.Appearance.internal.getWidth(t)+" "+C.Appearance.internal.getHeight(t)+" re\n f\n",e.stream=n,e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:C.Appearance.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=C.Appearance.RadioButton.Circle.YesNormal,e.D[t]=C.Appearance.RadioButton.Circle.YesPushDown,e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=C.createFormXObject(t),n="",r=C.Appearance.internal.getWidth(t)<=C.Appearance.internal.getHeight(t)?C.Appearance.internal.getWidth(t)/4:C.Appearance.internal.getHeight(t)/4;r*=.9;var i=C.Appearance.internal.Bezier_C;return n+="q\n1 0 0 1 "+C.Appearance.internal.getWidth(t)/2+" "+C.Appearance.internal.getHeight(t)/2+" cm\n"+r+" 0 m\n"+r+" "+r*i+" "+r*i+" "+r+" 0 "+r+" c\n-"+r*i+" "+r+" -"+r+" "+r*i+" -"+r+" 0 c\n-"+r+" -"+r*i+" -"+r*i+" -"+r+" 0 -"+r+" c\n"+r*i+" -"+r+" "+r+" -"+r*i+" "+r+" 0 c\nf\nQ\n",e.stream=n,e},YesPushDown:function(t){var e=C.createFormXObject(t),n="",r=C.Appearance.internal.getWidth(t)<=C.Appearance.internal.getHeight(t)?C.Appearance.internal.getWidth(t)/4:C.Appearance.internal.getHeight(t)/4,i=2*(r*=.9),o=i*C.Appearance.internal.Bezier_C,s=r*C.Appearance.internal.Bezier_C;return n+="0.749023 g\n q\n 1 0 0 1 "+C.Appearance.internal.getWidth(t)/2+" "+C.Appearance.internal.getHeight(t)/2+" cm\n"+i+" 0 m\n"+i+" "+o+" "+o+" "+i+" 0 "+i+" c\n-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c\n-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c\n"+o+" -"+i+" "+i+" -"+o+" "+i+" 0 c\n f\n Q\n 0 g\n q\n 1 0 0 1 "+C.Appearance.internal.getWidth(t)/2+" "+C.Appearance.internal.getHeight(t)/2+" cm\n"+r+" 0 m\n"+r+" "+s+" "+s+" "+r+" 0 "+r+" c\n-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c\n-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c\n"+s+" -"+r+" "+r+" -"+s+" "+r+" 0 c\n f\n Q\n",e.stream=n,e},OffPushDown:function(t){var e=C.createFormXObject(t),n="",r=C.Appearance.internal.getWidth(t)<=C.Appearance.internal.getHeight(t)?C.Appearance.internal.getWidth(t)/4:C.Appearance.internal.getHeight(t)/4,i=2*(r*=.9),o=i*C.Appearance.internal.Bezier_C;return n+="0.749023 g\n q\n 1 0 0 1 "+C.Appearance.internal.getWidth(t)/2+" "+C.Appearance.internal.getHeight(t)/2+" cm\n"+i+" 0 m\n"+i+" "+o+" "+o+" "+i+" 0 "+i+" c\n-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c\n-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c\n"+o+" -"+i+" "+i+" -"+o+" "+i+" 0 c\n f\n Q\n",e.stream=n,e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:C.Appearance.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=C.Appearance.RadioButton.Cross.YesNormal,e.D[t]=C.Appearance.RadioButton.Cross.YesPushDown,e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=C.createFormXObject(t),n="",r=C.Appearance.internal.calculateCross(t);return n+="q\n 1 1 "+(C.Appearance.internal.getWidth(t)-2)+" "+(C.Appearance.internal.getHeight(t)-2)+" re\n W\n n\n "+r.x1.x+" "+r.x1.y+" m\n "+r.x2.x+" "+r.x2.y+" l\n "+r.x4.x+" "+r.x4.y+" m\n "+r.x3.x+" "+r.x3.y+" l\n s\n Q\n",e.stream=n,e},YesPushDown:function(t){var e=C.createFormXObject(t),n=C.Appearance.internal.calculateCross(t),r="";return r+="0.749023 g\n 0 0 "+C.Appearance.internal.getWidth(t)+" "+C.Appearance.internal.getHeight(t)+" re\n f\n q\n 1 1 "+(C.Appearance.internal.getWidth(t)-2)+" "+(C.Appearance.internal.getHeight(t)-2)+" re\n W\n n\n "+n.x1.x+" "+n.x1.y+" m\n "+n.x2.x+" "+n.x2.y+" l\n "+n.x4.x+" "+n.x4.y+" m\n "+n.x3.x+" "+n.x3.y+" l\n s\n Q\n",e.stream=r,e},OffPushDown:function(t){var e=C.createFormXObject(t),n="";return n+="0.749023 g\n 0 0 "+C.Appearance.internal.getWidth(t)+" "+C.Appearance.internal.getHeight(t)+" re\n f\n",e.stream=n,e}}},createDefaultAppearanceStream:function(t){return"/Helv 0 Tf 0 g","/Helv 0 Tf 0 g"}},C.Appearance.internal={Bezier_C:.551915024494,calculateCross:function(t){var e,n,r=C.Appearance.internal.getWidth(t),i=C.Appearance.internal.getHeight(t),o=(e=r)>(n=i)?n:e;return{x1:{x:(r-o)/2,y:(i-o)/2+o},x2:{x:(r-o)/2+o,y:(i-o)/2},x3:{x:(r-o)/2,y:(i-o)/2},x4:{x:(r-o)/2+o,y:(i-o)/2+o}}}},C.Appearance.internal.getWidth=function(t){return t.Rect[2]},C.Appearance.internal.getHeight=function(t){return t.Rect[3]},C.internal.inherit=function(t,e){Object.create;t.prototype=Object.create(e.prototype),t.prototype.constructor=t},C.internal.arrayToPdfArray=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){e+=t[n].toString(),e+=n>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="endstream\n"),t+="endobj\n"},C.PDFObject.prototype.getContent=function(){var t="";return t+=function(t){var e="",n=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n){var i=n[r],o=t[i];o&&(Array.isArray(o)?e+="/"+i+" "+C.internal.arrayToPdfArray(o)+"\n":o instanceof C.PDFObject?e+="/"+i+" "+o.objId+" 0 R\n":e+="/"+i+" "+o+"\n")}return e}(this)},C.FormXObject=function(){var t;C.PDFObject.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo,Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==t?t.length:0}}),Object.defineProperty(this,"stream",{enumerable:!1,set:function(e){t=e},get:function(){return t||null}})},C.internal.inherit(C.FormXObject,C.PDFObject),C.AcroFormDictionary=function(){C.PDFObject.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!0,configurable:!0,get:function(){return t}}),this.DA},C.internal.inherit(C.AcroFormDictionary,C.PDFObject),C.Field=function(){var t;C.PDFObject.call(this),Object.defineProperty(this,"Rect",{enumerable:!0,configurable:!1,get:function(){if(t)return t},set:function(e){t=e}});var e,n,r,i="";Object.defineProperty(this,"FT",{enumerable:!0,set:function(t){i=t},get:function(){return i}}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,set:function(t){e=t},get:function(){if(!e||e.length<1){if(this instanceof C.ChildClass)return;return"(FieldObject"+C.Field.FieldNum+++")"}return"("==e.substring(0,1)&&e.substring(e.length-1)?e:"("+e+")"}}),Object.defineProperty(this,"DA",{enumerable:!0,get:function(){if(n)return"("+n+")"},set:function(t){n=t}}),Object.defineProperty(this,"DV",{enumerable:!0,configurable:!0,get:function(){if(r)return r},set:function(t){r=t}}),Object.defineProperty(this,"Type",{enumerable:!0,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,get:function(){return this.hasAnnotation?"/Widget":null}}),this.BG,Object.defineProperty(this,"hasAnnotation",{enumerable:!1,get:function(){return!!(this.Rect||this.BC||this.BG)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(this,"page",{enumerable:!1,configurable:!0,writable:!0})},C.Field.FieldNum=0,C.internal.inherit(C.Field,C.PDFObject),C.ChoiceField=function(){C.Field.call(this),this.FT="/Ch",this.Opt=[],this.V="()",this.TI=0,this.combo=!1,Object.defineProperty(this,"edit",{enumerable:!0,set:function(t){1==t?(this._edit=!0,this.combo=!0):this._edit=!1},get:function(){return!!this._edit&&this._edit},configurable:!1}),this.hasAppearanceStream=!0,Object.defineProperty(this,"V",{get:function(){C.internal.toPdfString()}})},C.internal.inherit(C.ChoiceField,C.Field),window.ChoiceField=C.ChoiceField,C.ListBox=function(){C.ChoiceField.call(this)},C.internal.inherit(C.ListBox,C.ChoiceField),window.ListBox=C.ListBox,C.ComboBox=function(){C.ListBox.call(this),this.combo=!0},C.internal.inherit(C.ComboBox,C.ListBox),window.ComboBox=C.ComboBox,C.EditBox=function(){C.ComboBox.call(this),this.edit=!0},C.internal.inherit(C.EditBox,C.ComboBox),window.EditBox=C.EditBox,C.Button=function(){C.Field.call(this),this.FT="/Btn"},C.internal.inherit(C.Button,C.Field),window.Button=C.Button,C.PushButton=function(){C.Button.call(this),this.pushbutton=!0},C.internal.inherit(C.PushButton,C.Button),window.PushButton=C.PushButton,C.RadioButton=function(){C.Button.call(this),this.radio=!0;var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!0,get:function(){if(e.length>0)return e}}),Object.defineProperty(this,"__Kids",{get:function(){return e}}),Object.defineProperty(this,"noToggleToOff",{enumerable:!1,get:function(){return t},set:function(e){t=e}})},C.internal.inherit(C.RadioButton,C.Button),window.RadioButton=C.RadioButton,C.ChildClass=function(t,e){C.Field.call(this),this.Parent=t,this._AppearanceType=C.Appearance.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(e),this.F=C.internal.setBitPosition(this.F,3,1),this.MK=this._AppearanceType.createMK(),this.AS="/Off",this._Name=e},C.internal.inherit(C.ChildClass,C.Field),C.RadioButton.prototype.setAppearance=function(t){if("createAppearanceStream"in t&&"createMK"in t)for(var e in this.__Kids){var n=this.__Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n._Name),n.MK=t.createMK()}else console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!")},C.RadioButton.prototype.createOption=function(t){this.__Kids.length;var n=new C.ChildClass(this,t);return this.__Kids.push(n),e.API.addField(n),n},C.CheckBox=function(){Button.call(this),this.appearanceStreamContent=C.Appearance.CheckBox.createAppearanceStream(),this.MK=C.Appearance.CheckBox.createMK(),this.AS="/On",this.V="/On"},C.internal.inherit(C.CheckBox,C.Button),window.CheckBox=C.CheckBox,C.TextField=function(){var t,e;C.Field.call(this),this.DA=C.Appearance.createDefaultAppearanceStream(),this.F=4,Object.defineProperty(this,"V",{get:function(){return t?"("+t+")":t},enumerable:!0,set:function(e){t=e}}),Object.defineProperty(this,"DV",{get:function(){return e?"("+e+")":e},enumerable:!0,set:function(t){e=t}});var n=!1;Object.defineProperty(this,"multiline",{enumerable:!1,get:function(){return n},set:function(t){n=t}});var r=!1;Object.defineProperty(this,"MaxLen",{enumerable:!0,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,get:function(){return this.V||this.DV}})},C.internal.inherit(C.TextField,C.Field),window.TextField=C.TextField,C.PasswordField=function(){TextField.call(this),Object.defineProperty(this,"password",{value:!0,enumerable:!1,configurable:!1,writable:!1})},C.internal.inherit(C.PasswordField,C.TextField),window.PasswordField=C.PasswordField,C.internal.calculateFontSpace=function(t,e,n){n=n||"helvetica";var r=C.internal.calculateFontSpace.canvas||(C.internal.calculateFontSpace.canvas=document.createElement("canvas"));(s=r.getContext("2d")).save();var i=e+" "+n;s.font=i;var o=s.measureText(t);s.fontcolor="black";var s=r.getContext("2d");o.height=1.5*s.measureText("3").width,s.restore();o.width;return o},C.internal.calculateX=function(t,e,n,r){r=r||12,n=n||"helvetica";var i={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" "),s=r,a=C.Appearance.internal.getHeight(t)||0;a=a<0?-a:a;var c=C.Appearance.internal.getWidth(t)||0;c=c<0?-c:c;var l=function(t,e,r){if(t+1=o.length-1;if(!x||k){if(x||k){if(k)g=b;else if(t.multiline&&(u+2)*(y+2)+2>a)continue t}else{if(!t.multiline)continue t;if((u+2)*(y+2)+2>a)continue t;g=b}for(var _="",A=p;A<=g;A++)_+=o[A]+" ";switch(_=" "==_.substr(_.length-1)?_.substr(0,_.length-1):_,m=C.internal.calculateFontSpace(_,s+"px",n).width,t.Q){case 2:f=c-m-2;break;case 1:f=(c-m)/2;break;case 0:default:f=2}e+=f+" "+d+" Td\n",e+="("+_+") Tj\n",e+=-f+" 0 Td\n",d=-(s+2),f,m=0,p=g+1,y++,w=""}else w+=" "}break}return i.text=e,i.fontSize=s,i},C.internal.calculateAppearanceStream=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e="",n=t.V||t.DV,r=C.internal.calculateX(t,n);e+="/Tx BMC\nq\n/F1 "+r.fontSize+" Tf\n1 0 0 1 0 0 Tm\n",e+="BT\n",e+=r.text,e+="ET\n",e+="Q\nEMC\n";var i=new C.createFormXObject(t);i.stream=e;return i}},C.internal.calculateCoordinates=function(t,e,n,r){var i={};if(this.internal){var o=function(t){return t*this.internal.scaleFactor};Array.isArray(t)?(t[0]=C.scale(t[0]),t[1]=C.scale(t[1]),t[2]=C.scale(t[2]),t[3]=C.scale(t[3]),i.lowerLeft_X=t[0]||0,i.lowerLeft_Y=o.call(this,this.internal.pageSize.height)-t[3]-t[1]||0,i.upperRight_X=t[0]+t[2]||0,i.upperRight_Y=o.call(this,this.internal.pageSize.height)-t[1]||0):(t=C.scale(t),e=C.scale(e),n=C.scale(n),r=C.scale(r),i.lowerLeft_X=t||0,i.lowerLeft_Y=this.internal.pageSize.height-e||0,i.upperRight_X=t+n||0,i.upperRight_Y=this.internal.pageSize.height-e+r||0)}else Array.isArray(t)?(i.lowerLeft_X=t[0]||0,i.lowerLeft_Y=t[1]||0,i.upperRight_X=t[0]+t[2]||0,i.upperRight_Y=t[1]+t[3]||0):(i.lowerLeft_X=t||0,i.lowerLeft_Y=e||0,i.upperRight_X=t+n||0,i.upperRight_Y=e+r||0);return[i.lowerLeft_X,i.lowerLeft_Y,i.upperRight_X,i.upperRight_Y]},C.internal.calculateColor=function(t,e,n){var r=new Array(3);return r.r=0|t,r.g=0|e,r.b=0|n,r},C.internal.getBitPosition=function(t,e){var n=1;return(t=t||0)|(n<<=e-1)},C.internal.setBitPosition=function(t,e,n){t=t||0;var r=1;if(r<<=e-1,1==(n=n||1))t=t|r;else t=t&~r;return t},e.API.addHTML=function(t,e,n,r,i){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof e&&(r=e,i=n),"function"==typeof r&&(i=r,r=null);var o=this.internal,s=o.scaleFactor,a=o.pageSize.width,c=o.pageSize.height;if((r=r||{}).onrendered=function(t){e=parseInt(e)||0,n=parseInt(n)||0;var o=r.dim||{},l=o.h||0,u=o.w||Math.min(a,t.width/s)-e,h="JPEG";if(r.format&&(h=r.format),t.height>c&&r.pagesplit){var f=function(){for(var r=0;;){var o=document.createElement("canvas");o.width=Math.min(a*s,t.width),o.height=Math.min(c*s,t.height-r),o.getContext("2d").drawImage(t,0,r,t.width,o.height,0,0,o.width,o.height);var l=[o,e,r?0:n,o.width/s,o.height/s,h,null,"SLOW"];if(this.addImage.apply(this,l),(r+=o.height)>=t.height)break;this.addPage()}i(u,r,null,l)}.bind(this);if("CANVAS"===t.nodeName){var d=new Image;d.onload=f,d.src=t.toDataURL("image/png"),t=d}else f()}else{var p=Math.random().toString(35),g=[t,e,n,u,l,h,p,"SLOW"];this.addImage.apply(this,g),i(u,l,p,g)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"!=typeof rasterizeHTML){var l="drawDocument";return"string"==typeof t&&(l=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||a*s,rasterizeHTML[l](t,void 0,r).then(function(t){r.onrendered(t.image)},function(t){i(null,t)})}return null},function(e){var n=["jpeg","jpg","png"],r=function t(e){var n=this.internal.newObject(),r=this.internal.write,i=this.internal.putStream;if(e.n=n,r("<>"),"trns"in e&&e.trns.constructor==Array){for(var o="",s=0,a=e.trns.length;s>"),i(e.data),r("endobj"),"smask"in e){var c="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,l={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:c,data:e.smask};"f"in e&&(l.f=e.f),t.call(this,l)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+e.pal.length+">>"),i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))),r("endobj"))},i=function(){var t=this.internal.collections.addImage_images;for(var e in t)r.call(this,t[e])},o=function(){var t,e=this.internal.collections.addImage_images,n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R")},s=function(e){return"object"===(void 0===e?"undefined":t(e))&&1===e.nodeType},a=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},e.sHashCode=function(t){return Array.prototype.reduce&&t.split("").reduce(function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t},0)},e.isString=function(t){return"string"==typeof t},e.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t)},e.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},e.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer},e.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))},e.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==s?n+=r[(252&(e=i[a]))>>2]+r[(3&e)<<4]+"==":2==s&&(n+=r[(64512&(e=i[a]<<8|i[a+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},e.createImageInfo=function(t,e,n,r,i,o,s,a,c,l,u,h,f){var d={alias:a,w:e,h:n,cs:r,bpc:i,i:s,data:t};return o&&(d.f=o),c&&(d.dp=c),l&&(d.trns=l),u&&(d.pal=u),h&&(d.smask=h),f&&(d.p=f),d},e.addImage=function(r,c,l,u,h,f,d,p,g){if("string"!=typeof c){var m=f;f=h,h=u,u=l,l=c,c=m}if("object"===(void 0===r?"undefined":t(r))&&!s(r)&&"imageData"in r){var w=r;r=w.imageData,c=w.format||c,l=w.x||l||0,u=w.y||u||0,h=w.w||h,f=w.h||f,d=w.alias||d,p=w.compression||p,g=w.rotation||w.angle||g}if(isNaN(l)||isNaN(u))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var y,v,b,x,k=function(){var t=this.internal.collections.addImage_images;return t||(this.internal.collections.addImage_images=t={},this.internal.events.subscribe("putResources",i),this.internal.events.subscribe("putXobjectDict",o)),t}.call(this);if(!(y=a(r,k))&&(s(r)&&(r=function(e,n,r){if("IMG"===e.nodeName&&e.hasAttribute("src")){var i=""+e.getAttribute("src");if(!r&&0===i.indexOf("data:image/"))return i;!n&&/\.png(?:[?#].*)?$/i.test(i)&&(n="png")}if("CANVAS"===e.nodeName)var o=e;else{(o=document.createElement("canvas")).width=e.clientWidth||e.width,o.height=e.clientHeight||e.height;var s=o.getContext("2d");if(!s)throw"addImage requires canvas to be supported by browser.";if(r){var a,c,l,u,h,f,d,p,g=Math.PI/180;"object"===(void 0===r?"undefined":t(r))&&(a=r.x,c=r.y,l=r.bg,r=r.angle),p=r*g,u=Math.abs(Math.cos(p)),h=Math.abs(Math.sin(p)),f=o.width,d=o.height,o.width=d*h+f*u,o.height=d*u+f*h,isNaN(a)&&(a=o.width/2),isNaN(c)&&(c=o.height/2),s.clearRect(0,0,o.width,o.height),s.fillStyle=l||"white",s.fillRect(0,0,o.width,o.height),s.save(),s.translate(a,c),s.rotate(p),s.drawImage(e,-f/2,-d/2),s.rotate(-p),s.translate(-a,-c),s.restore()}else s.drawImage(e,0,0,o.width,o.height)}return o.toDataURL("png"==(""+n).toLowerCase()?"image/png":"image/jpeg")}(r,c,g)),null==d&&(d="string"==typeof(x=r)&&e.sHashCode(x)),!(y=a(d,k)))){if(this.isString(r)){var _=this.extractInfoFromBase64DataURI(r);_?(c=_[2],r=atob(_[3])):137===r.charCodeAt(0)&&80===r.charCodeAt(1)&&78===r.charCodeAt(2)&&71===r.charCodeAt(3)&&(c="png")}if(c=(c||"JPEG").toLowerCase(),b=c,-1===n.indexOf(b))throw new Error("addImage currently only supports formats "+n+", not '"+c+"'");if(function(t){return"function"!=typeof e["process"+t.toUpperCase()]}(c))throw new Error("please ensure that the plugin for '"+c+"' support is added");if(this.supportsArrayBuffer()&&(r instanceof Uint8Array||(v=r,r=this.binaryStringToUint8Array(r))),!(y=this["process"+c.toUpperCase()](r,function(t){var e=0;return t&&(e=Object.keys?Object.keys(t).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(t)),e}(k),d,function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:e.image_compression.NONE}(p),v)))throw new Error("An unkwown error occurred whilst processing the image")}return function(t,e,n,r,i,o,s){var a=function(t,e,n){return t||e||(t=-96,e=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;n=a[0],r=a[1],s[o]=i,this.internal.write("q",c(n),"0 0",c(r),c(t),l(e+r),"cm /I"+i.i,"Do Q")}.call(this,l,u,h,f,y,y.i,k),this};var c=function(t,e){return t.subarray(e,e+5)};e.processJPEG=function(t,e,n,r,i){var o,s=this.color_spaces.DEVICE_RGB,a=this.decode.DCT_DECODE;return this.isString(t)?(o=function(t){var e;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r7)return{width:((e=c(t,i+5))[2]<<8)+e[3],height:(e[0]<<8)+e[1],numcomponents:e[4]};i+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")}(t),t=i||this.arrayBufferToBinaryString(t),this.createImageInfo(t,o.width,o.height,1==o.numcomponents?this.color_spaces.DEVICE_GRAY:s,8,a,e,n)):null)},e.processJPG=function(){return this.processJPEG.apply(this,arguments)}}(e.API),function(t){var n={annotations:[],f2:function(t){return t.toFixed(2)},notEmpty:function(t){if(void 0!==t&&""!=t)return!0}};e.API.annotationPlugin=n,e.API.events.push(["addPage",function(t){this.annotationPlugin.annotations[t.pageNumber]=[]}]),t.events.push(["putPage",function(t){for(var e=this.annotationPlugin.annotations[t.pageNumber],r=!1,i=0;i>",u.content=w;var d=u.objId+" 0 R";w="<>",h.content=w,this.internal.write(u.objId,"0 R",h.objId,"0 R");break;case"freetext":var p="/Rect ["+o(l.bounds.x*s)+" "+o((a-l.bounds.y)*s)+" "+o(l.bounds.x+l.bounds.w*s)+" "+o(a-(l.bounds.y+l.bounds.h)*s)+"] ",g=l.color||"#000000";w="<>",this.internal.write(w);break;case"link":if(l.options.name){var m=this.annotations._nameMap[l.options.name];l.options.pageNumber=m.page,l.options.top=m.y}else l.options.top||(l.options.top=0);p="/Rect ["+o(l.x*s)+" "+o((a-l.y)*s)+" "+o(l.x+l.w*s)+" "+o(a-(l.y+l.h)*s)+"] ";var w="";if(l.options.url)w="<>";else if(l.options.pageNumber){switch(w="<>",this.internal.write(w))}}this.internal.write("]")}}]),t.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t)}},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight();return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},t.getLineHeight=function(){return this.internal.getLineHeight()}}(e.API),e.API.autoPrint=function(){var t;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this},function(t){t.events.push(["initialized",function(){this.canvas.pdf=this}]),t.canvas={getContext:function(t){return this.pdf.context2d._canvas=this,this.pdf.context2d},style:{}},Object.defineProperty(t.canvas,"width",{get:function(){return this._width},set:function(t){this._width=t,this.getContext("2d").pageWrapX=t+1}}),Object.defineProperty(t.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t,this.getContext("2d").pageWrapY=t+1}})}(e.API),n=e.API,c={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},l=1,u=function(t,e,n,r,i){c={x:t,y:e,w:n,h:r,ln:i}},h=function(){return c},f={left:0,top:0,bottom:0},n.setHeaderFunction=function(t){a=t},n.getTextDimensions=function(t){var e,n;i=this.internal.getFont().fontName,o=this.table_font_size||this.internal.getFontSize(),s=this.internal.getFont().fontStyle,(n=document.createElement("font")).id="jsPDFCell";try{n.style.fontStyle=s}catch(t){n.style.fontWeight=s}n.style.fontName=i,n.style.fontSize=o+"pt";try{n.textContent=t}catch(e){n.innerText=t}return document.body.appendChild(n),e={w:(n.offsetWidth+1)*(19.049976/25.4),h:(n.offsetHeight+1)*(19.049976/25.4)},document.body.removeChild(n),e},n.cellAddPage=function(){var t=this.margins||f;this.addPage(),u(t.left,t.top,void 0,void 0),l+=1},n.cellInitialize=function(){c={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},l=1},n.cell=function(t,e,n,r,i,o,s){var a=h(),c=!1;if(void 0!==a.ln)if(a.ln===o)t=a.x+a.w,e=a.y;else{var l=this.margins||f;a.y+a.h+r+13>=this.internal.pageSize.height-l.bottom&&(this.cellAddPage(),c=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=h().y+h().h,c&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===s){i instanceof Array||(i=[i]);for(var d=0;do&&(o=i);return o},n.table=function(t,e,r,i,o){if(!r)throw"No data for PDF table";var s,a,u,h,d,p,g,m,w,y,v=[],b=[],x={},k={},_=[],C=[],A=!1,S=!0,q=12,T=f;if(T.width=this.internal.pageSize.width,o&&(!0===o.autoSize&&(A=!0),!1===o.printHeaders&&(S=!1),o.fontSize&&(q=o.fontSize),o.css&&void 0!==o.css["font-size"]&&(q=16*o.css["font-size"]),o.margins&&(T=o.margins)),this.lnMod=0,c={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},l=1,this.printHeaders=S,this.margins=T,this.setFontSize(q),this.table_font_size=q,null==i)v=Object.keys(r[0]);else if(i[0]&&"string"!=typeof i[0])for(a=0,u=i.length;ai&&(i=s)}return i},n.setTableHeaderRow=function(t){this.tableHeaderRow=t},n.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var n,r,i,o;if(this.printingHeaderRow=!0,void 0!==a){var s=a(this,l);u(s[0],s[1],s[2],s[3],-1)}this.setFontStyle("bold");var c=[];for(i=0,o=this.tableHeaderRow.length;i0&&this.setTableHeaderRow(c),this.setFontStyle("normal"),this.printingHeaderRow=!1},function(t){t.events.push(["initialized",function(){this.context2d.pdf=this,this.context2d.internal.pdf=this,this.context2d.ctx=new n,this.context2d.ctxStack=[],this.context2d.path=[]}]),t.context2d={pageWrapXEnabled:!1,pageWrapYEnabled:!1,pageWrapX:9999999,pageWrapY:9999999,ctx:new n,f2:function(t){return t.toFixed(2)},fillRect:function(t,e,n,r){if(!this._isFillTransparent()){t=this._wrapX(t),e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"f")}},strokeRect:function(t,e,n,r){if(!this._isStrokeTransparent()){t=this._wrapX(t),e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.pdf.rect(i.x,i.y,i.w,i.h,"s")}},clearRect:function(t,e,n,r){if(!this.ctx.ignoreClearRect){t=this._wrapX(t),e=this._wrapY(e);var i=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r});this.save(),this.setFillStyle("#ffffff"),this.pdf.rect(i.x,i.y,i.w,i.h,"f"),this.restore()}},save:function(){this.ctx._fontSize=this.pdf.internal.getFontSize();var t=new n;t.copy(this.ctx),this.ctxStack.push(this.ctx),this.ctx=t},restore:function(){this.ctx=this.ctxStack.pop(),this.setFillStyle(this.ctx.fillStyle),this.setStrokeStyle(this.ctx.strokeStyle),this.setFont(this.ctx.font),this.pdf.setFontSize(this.ctx._fontSize),this.setLineCap(this.ctx.lineCap),this.setLineWidth(this.ctx.lineWidth),this.setLineJoin(this.ctx.lineJoin)},rect:function(t,e,n,r){this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()},beginPath:function(){this.path=[]},closePath:function(){this.path.push({type:"close"})},_getRgba:function(t){var e={};if(this.internal.rxTransparent.test(t))e.r=0,e.g=0,e.b=0,e.a=0;else{var n=this.internal.rxRgb.exec(t);null!=n?(e.r=parseInt(n[1]),e.g=parseInt(n[2]),e.b=parseInt(n[3]),e.a=1):null!=(n=this.internal.rxRgba.exec(t))?(e.r=parseInt(n[1]),e.g=parseInt(n[2]),e.b=parseInt(n[3]),e.a=parseFloat(n[4])):(e.a=1,"#"!=t.charAt(0)&&((t=S.colorNameToHex(t))||(t="#000000")),4===t.length?(e.r=t.substring(1,2),e.r+=r,e.g=t.substring(2,3),e.g+=g,e.b=t.substring(3,4),e.b+=b):(e.r=t.substring(1,3),e.g=t.substring(3,5),e.b=t.substring(5,7)),e.r=parseInt(e.r,16),e.g=parseInt(e.g,16),e.b=parseInt(e.b,16))}return e.style=t,e},setFillStyle:function(t){var e,n,r,i;if(this.internal.rxTransparent.test(t))e=0,n=0,r=0,i=0;else{var o=this.internal.rxRgb.exec(t);null!=o?(e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=1):null!=(o=this.internal.rxRgba.exec(t))?(e=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=parseFloat(o[4])):(i=1,"#"!=t.charAt(0)&&((t=S.colorNameToHex(t))||(t="#000000")),4===t.length?(e=t.substring(1,2),e+=e,n=t.substring(2,3),n+=n,r=t.substring(3,4),r+=r):(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16))}this.ctx.fillStyle=t,this.ctx._isFillTransparent=0==i,this.ctx._fillOpacity=i,this.pdf.setFillColor(e,n,r,{a:i}),this.pdf.setTextColor(e,n,r,{a:i})},setStrokeStyle:function(t){var e=this._getRgba(t);this.ctx.strokeStyle=e.style,this.ctx._isStrokeTransparent=0==e.a,this.ctx._strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))},fillText:function(t,e,n,r){if(!this._isFillTransparent()){e=this._wrapX(e),n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0],n=i[1];var o=57.2958*this._matrix_rotation(this.ctx._transform);if(this.ctx._clip_path.length>0){var s;(s=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.pdf.internal.pages[1]).push("q");var a=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(null,!0),this.ctx._clip_path=this.path,this.path=a}this.pdf.text(t,e,this._getBaseline(n),null,o),this.ctx._clip_path.length>0&&s.push("Q")}},strokeText:function(t,e,n,r){if(!this._isStrokeTransparent()){e=this._wrapX(e),n=this._wrapY(n);var i=this._matrix_map_point(this.ctx._transform,[e,n]);e=i[0],n=i[1];var o=57.2958*this._matrix_rotation(this.ctx._transform);if(this.ctx._clip_path.length>0){var s;(s=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.pdf.internal.pages[1]).push("q");var a=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(null,!0),this.ctx._clip_path=this.path,this.path=a}this.pdf.text(t,e,this._getBaseline(n),{stroke:!0},o),this.ctx._clip_path.length>0&&s.push("Q")}},setFont:function(t){if(this.ctx.font=t,null!=(c=/\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+(.*)?/.exec(t))){var e=c[1],n=(c[2],c[3]),r=c[4],i=c[5],o=c[6];r="px"===i?Math.floor(parseFloat(r)):"em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(r)),this.pdf.setFontSize(r),"bold"===n||"700"===n?this.pdf.setFontStyle("bold"):"italic"===e?this.pdf.setFontStyle("italic"):this.pdf.setFontStyle("normal");var s,a=(h=o).toLowerCase().split(/\s*,\s*/);s=-1!=a.indexOf("arial")?"Arial":-1!=a.indexOf("verdana")?"Verdana":-1!=a.indexOf("helvetica")?"Helvetica":-1!=a.indexOf("sans-serif")?"sans-serif":-1!=a.indexOf("fixed")?"Fixed":-1!=a.indexOf("monospace")?"Monospace":-1!=a.indexOf("terminal")?"Terminal":-1!=a.indexOf("courier")?"Courier":-1!=a.indexOf("times")?"Times":-1!=a.indexOf("cursive")?"Cursive":-1!=a.indexOf("fantasy")?"Fantasy":(a.indexOf("serif"),"Serif"),l="bold"===n?"bold":"normal",this.pdf.setFont(s,l)}else{var c=/(\d+)(pt|px|em)\s+(\w+)\s*(\w+)?/.exec(t);if(null!=c){var l,u=c[1],h=(c[2],c[3]);(l=c[4])||(l="normal"),u="em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(u)),this.pdf.setFontSize(u),this.pdf.setFont(h,l)}}},setTextBaseline:function(t){this.ctx.textBaseline=t},getTextBaseline:function(){return this.ctx.textBaseline},setTextAlign:function(t){this.ctx.textAlign=t},getTextAlign:function(){return this.ctx.textAlign},setLineWidth:function(t){this.ctx.lineWidth=t,this.pdf.setLineWidth(t)},setLineCap:function(t){this.ctx.lineCap=t,this.pdf.setLineCap(t)},setLineJoin:function(t){this.ctx.lineJoin=t,this.pdf.setLineJoin(t)},moveTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"mt",x:t=n[0],y:e=n[1]};this.path.push(r)},_wrapX:function(t){return this.pageWrapXEnabled?t%this.pageWrapX:t},_wrapY:function(t){return this.pageWrapYEnabled?(this._gotoPage(this._page(t)),(t-this.lastBreak)%this.pageWrapY):t},transform:function(t,e,n,r,i,o){this.ctx._transform=[t,e,n,r,i,o]},setTransform:function(t,e,n,r,i,o){this.ctx._transform=[t,e,n,r,i,o]},_getTransform:function(){return this.ctx._transform},lastBreak:0,pageBreaks:[],_page:function(t){if(this.pageWrapYEnabled){this.lastBreak=0;for(var e=0,n=0,r=0;r=this.pageBreaks[r]){e++,0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r],n+=Math.floor(i/this.pageWrapY)}if(0===this.lastBreak)n+=Math.floor(t/this.pageWrapY)+1;return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"lt",x:t=n[0],y:e=n[1]};this.path.push(r)},bezierCurveTo:function(t,e,n,r,i,o){var s;t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r),i=this._wrapX(i),o=this._wrapY(o),i=(s=this._matrix_map_point(this.ctx._transform,[i,o]))[0],o=s[1];var a={type:"bct",x1:t=(s=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=s[1],x2:n=(s=this._matrix_map_point(this.ctx._transform,[n,r]))[0],y2:r=s[1],x:i,y:o};this.path.push(a)},quadraticCurveTo:function(t,e,n,r){var i;t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r),n=(i=this._matrix_map_point(this.ctx._transform,[n,r]))[0],r=i[1];var o={type:"qct",x1:t=(i=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=i[1],x:n,y:r};this.path.push(o)},arc:function(t,e,n,r,i,o){t=this._wrapX(t),e=this._wrapY(e);var s=this._matrix_map_point(this.ctx._transform,[t,e]),a={type:"arc",x:t=s[0],y:e=s[1],radius:n,startAngle:r,endAngle:i,anticlockwise:o};this.path.push(a)},drawImage:function(t,e,n,r,i,o,s,a,c){void 0!==o&&(e=o,n=s,r=a,i=c),e=this._wrapX(e),n=this._wrapY(n);var l,u=this._matrix_map_rect(this.ctx._transform,{x:e,y:n,w:r,h:i}),h=(this._matrix_map_rect(this.ctx._transform,{x:o,y:s,w:a,h:c}),/data:image\/(\w+).*/i.exec(t));l=null!=h?h[1]:"png",this.pdf.addImage(t,l,u.x,u.y,u.w,u.h)},_matrix_multiply:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=n*t[0]+r*t[2],l=i*t[0]+o*t[2],u=s*t[0]+a*t[2]+t[4];return r=n*t[1]+r*t[3],o=i*t[1]+o*t[3],a=s*t[1]+a*t[3]+t[5],[n=c,r,i=l,o,s=u,a]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=Math.sqrt(e*e+n*n),s=(e/=o)*r+(n/=o)*i;r-=e*s,i-=n*s;var a=Math.sqrt(r*r+i*i);return s/=a,e*(i/=a)0){var t;(t=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.pdf.internal.pages[1]).push("q");var e=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._stroke(!0),this.ctx._clip_path=this.path,this.path=e,this._stroke(!1),t.push("Q")}else this._stroke(!1)},_stroke:function(t){if(t||!this._isStrokeTransparent()){for(var e=[],n=this.path,r=0;r0){var e;(e=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.pdf.internal.pages[1]).push("q");var n=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(t,!0),this.ctx._clip_path=this.path,this.path=n,this._fill(t,!1),e.push("Q")}else this._fill(t,!1)},_fill:function(t,n){if(!this._isFillTransparent()){var r,i="function"==typeof this.pdf.internal.newObject2;r=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.pdf.internal.pages[1];var o=[],s=window.outIntercept;if(i)switch(this.ctx.globalCompositeOperation){case"normal":case"source-over":break;case"destination-in":case"destination-out":var a=this.pdf.internal.newStreamObject(),c=this.pdf.internal.newObject2();c.push("<>"),c.push(">>");var l="MASK"+c.objId;this.pdf.internal.addGraphicsState(l,c.objId);var u="/"+l+" gs";r.splice(0,0,"q"),r.splice(1,0,u),r.push("Q"),window.outIntercept=a;break;default:var h="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];h&&this.pdf.internal.out(h+" gs")}var f=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(f=this.ctx._fillOpacity),i){var d=this.pdf.internal.newObject2();d.push("<>");l="GS_O_"+d.objId;this.pdf.internal.addGraphicsState(l,d.objId),this.pdf.internal.out("/"+l+" gs")}for(var p=this.path,g=0;g>"),e.push(">>");var n="MASK"+e.objId;this.pdf.internal.addGraphicsState(n,e.objId);var r="/"+n+" gs";this.pdf.internal.out(r)}else console.log("jsPDF v2 not enabled")},clip:function(){if(this.ctx._clip_path.length>0)for(var t=0;ti)&&(o%=i);var s=n;(si)&&(s%=i);for(var a=[],c=Math.PI/2,l=r?-1:1,u=e,h=Math.min(i,Math.abs(s-o));h>1e-5;){var f=u+l*Math.min(h,c);a.push(this.createSmallArc(t,u,f)),h-=Math.abs(f-u),u=f}return a},e.internal.createSmallArc=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),o=t*Math.sin(r),s=i,a=-o,c=s*s+a*a,l=c+s*i+a*o,u=4/3*(Math.sqrt(2*c*l)-l)/(s*o-a*i),h=s-u*a,f=a+u*s,d=h,p=-f,g=r+e,m=Math.cos(g),w=Math.sin(g);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:h*m-f*w,y2:h*w+f*m,x3:d*m-p*w,y3:d*w+p*m,x4:t*Math.cos(n),y4:t*Math.sin(n)}}}(e.API),function(e){var n,r,i,o,s,a,c,l,u,h,f,d,p,g,m,w,y,v,b,x;n=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,r,i,o,s,a;for(n=0,r=t.length,e=void 0,i=!1,s=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!s&&-1!==n;)(e=t[n]=t[n].trimRight())&&(s=!0),n--;for(o=/\s+$/g,a=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[n]=e),n++;return t},d=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},p=function(t){var e;return(t="auto"===t?"0px":t).indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),void 0,16,(e=g[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[{css_line_height_string:t}])?g[t]=e/16:(e=parseFloat(t))?g[t]=e/16:3===(e=t.match(/([\d\.]+)(px)/)).length?g[t]=parseFloat(e[1])/16:g[t]=1},u=function(t){var e,n,r,i,u;return i=t,u=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(i,null):i.currentStyle?i.currentStyle:i.style,n=void 0,(e={})["font-family"]=d((r=function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),u[t]})("font-family"))||"times",e["font-style"]=o[r("font-style")]||"normal",e["text-align"]=s[r("text-align")]||"left","bold"===(n=a[r("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=p(r("font-size"))||1,e["line-height"]=p(r("line-height"))||1,e.display="inline"===r("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&p(r("margin-top"))||0,e["margin-bottom"]=n&&p(r("margin-bottom"))||0,e["padding-top"]=n&&p(r("padding-top"))||0,e["padding-bottom"]=n&&p(r("padding-bottom"))||0,e["margin-left"]=n&&p(r("margin-left"))||0,e["margin-right"]=n&&p(r("margin-right"))||0,e["padding-left"]=n&&p(r("padding-left"))||0,e["padding-right"]=n&&p(r("padding-right"))||0,e["page-break-before"]=r("page-break-before")||"auto",e.float=c[r("cssFloat")]||"none",e.clear=l[r("clear")]||"none",e.color=r("color"),e},m=function(t,e,n){var r,i,o,s;if(o=!1,i=void 0,s=void 0,void 0,r=n["#"+t.id])if("function"==typeof r)o=r(t,e);else for(i=0,s=r.length;!o&&i!==s;)o=r[i](t,e),i++;if(r=n[t.nodeName],!o&&r)if("function"==typeof r)o=r(t,e);else for(i=0,s=r.length;!o&&i!==s;)o=r[i](t,e),i++;return o},x=function(t,e){var n,r,i,o,s,a,c,l,u;for(n=[],r=[],i=0,u=t.rows[0].cells.length,c=t.clientWidth;ii.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(s));var I=u(s),P=i.x,E=12/i.pdf.internal.scaleFactor,O=(I["margin-left"]+I["padding-left"])*E,F=(I["margin-right"]+I["padding-right"])*E,R=(I["margin-top"]+I["padding-top"])*E,B=(I["margin-bottom"]+I["padding-bottom"])*E;void 0!==I.float&&"right"===I.float?P+=i.settings.width-s.width-F:P+=O,i.pdf.addImage(q,P,i.y+R,s.width,s.height),q=void 0,"right"===I.float||"left"===I.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!k[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===I.float?-s.width-O-F:0,i.y+s.height+R+B,s.width)),i.watchFunctions.push(function(t,e,n){return!(i.y0){i=i[0];var o=e.pdf.internal.write,s=e.y;e.pdf.internal.write=function(){},r(i,e,n);var a=Math.ceil(e.y-s)+5;e.y=s,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=a;for(var c=function(t){var o=void 0!==t?t.pageNumber:1,s=e.y;e.y=e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=a;for(var c=i.getElementsByTagName("span"),l=0;l-1&&(c[l].innerHTML=o),(" "+c[l].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(c[l].innerHTML="###jsPDFVarTotalPages###");r(i,e,n),e.pdf.margins_doc.bottom+=a,e.y=s},l=i.getElementsByTagName("span"),u=0;u-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",c,!1),c(),k.FOOTER=1}},b=function(t,e,n,i,o,s){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,r;return r="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),"position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",(n=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n.innerHTML='',document.body.appendChild(n),(e=window.frames[r]).document.open(),e.document.writeln(t),e.document.close(),e.document.body}(e.replace(/<\/?script[^>]*?>/gi,"")));var a,c=new f(t,n,i,o);return y.call(this,e,c,o.elementHandlers,function(t){v(e,c,o.elementHandlers),r(e,c,o.elementHandlers),c.pdf.internal.events.publish("htmlRenderingFinished"),a=c.dispose(),"function"==typeof s?s(a):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),a||{x:c.x,y:c.y}},(f=function(t,e,n,r){return this.pdf=t,this.x=e,this.y=n,this.settings=r,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},f.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},f.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(this.watchFunctions.length>0){for(var r=0;rg){for(c=this.pdf.splitTextToSize(a,g,u),d.push([c.shift(),m]);c.length;)d=[[c.shift(),m]],p.push(d);r=this.pdf.getStringUnitWidth(d[0][0],u)*u.fontSize/f}else d.push([a,m]),r+=l;if(void 0!==m["text-align"]&&("center"===m["text-align"]||"right"===m["text-align"]||"justify"===m["text-align"]))for(var w=0;w0&&(p[w][0][1]=n(p[w][0][1]));var v=g-y;if("right"===m["text-align"])p[w][0][1]["margin-left"]=v;else if("center"===m["text-align"])p[w][0][1]["margin-left"]=v/2;else if("justify"===m["text-align"]){var b=p[w][0][0].split(" ").length-1;p[w][0][1]["word-spacing"]=v/b,w===p.length-1&&(p[w][0][1]["word-spacing"]=0)}}return p},f.prototype.RenderTextFragment=function(t,e){var n,r;r=0,this.pdf.internal.pageSize.height-this.pdf.margins_doc.bottom0&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw"),this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(t)+") Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},f.prototype.getPdfColor=function(t){var e,n,r,i=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=i?(e=parseInt(i[1]),n=parseInt(i[2]),r=parseInt(i[3])):("#"!=t.charAt(0)&&((t=S.colorNameToHex(t))||(t="#000000")),e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),r=t.substring(5,7),r=parseInt(r,16)),"string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var o=parseInt(e.substr(1),16);e=o>>16&255,n=o>>8&255,r=255&o}var s=this.f3;return 0===e&&0===n&&0===r||void 0===n?s(e/255)+" g":[s(e/255),s(n/255),s(r/255),"rg"].join(" ")},f.prototype.f3=function(t){return t.toFixed(3)},f.prototype.renderParagraph=function(t){var e,n,r,i,o,s,a,c,l,u,f,d,p;if(r=h(this.paragraph.text),d=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle||{},this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},r.join("").trim()){a=this.splitFragmentsIntoLines(r,d),s=void 0,c=void 0,12,n=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,f=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n,u=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,f=((e["margin-top"]||0)+(e["padding-top"]||0))*n),l=this.pdf.internal.write,i=void 0,o=void 0,this.y+=f,l("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var g=0;a.length;){for(c=0,i=0,o=(s=a.shift()).length;i!==o;)s[i][0].trim()&&(c=Math.max(c,s[i][1]["line-height"],s[i][1]["font-size"]),p=7*s[i][1]["font-size"]),i++;var m=0,w=0;for(void 0!==s[0][1]["margin-left"]&&s[0][1]["margin-left"]>0&&(m=(w=this.pdf.internal.getCoordinateString(s[0][1]["margin-left"]))-g,g=w),l(m+Math.max(e["margin-left"]||0,0)*n,(-12*c).toFixed(2),"Td"),i=0,o=s.length;i!==o;)s[i][0]&&this.RenderTextFragment(s[i][0],s[i][1]),i++;if(this.y+=c*n,this.executeWatchFunctions(s[0][1])&&a.length>0){var y=[],v=[];a.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(y.push(t[e][0]+" "),v.push(t[e][1])),++e}),a=this.splitFragmentsIntoLines(h(y),v),l("ET","Q"),l("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-p/2),l("ET","Q"),this.y+=u}},f.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},f.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},f.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},a={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},o={normal:"normal",italic:"italic",oblique:"italic"},s={left:"left",right:"right",center:"center",justify:"justify"},c={none:"none",right:"right",left:"left"},l={none:"none",both:"both"},g={normal:1},e.fromHTML=function(t,e,n,r,i,o){return this.margins_doc=o||{top:0,bottom:0},r||(r={}),r.elementHandlers||(r.elementHandlers={}),b(this,t,isNaN(e)?4:e,isNaN(n)?4:n,r,i)}}(e.API),e.API.addJS=function(t){return m=t,this.internal.events.subscribe("postPutResources",function(t){d=this.internal.newObject(),this.internal.write("<< /Names [(EmbeddedJS) "+(d+1)+" 0 R] >>","endobj"),p=this.internal.newObject(),this.internal.write("<< /S /JavaScript /JS (",m,") >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==d&&void 0!==p&&this.internal.write("/Names <>")}),this},function(t){t.events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var n=t.outline.render().split(/\r\n/),r=0;r> endobj")}var h=t.internal.newObject();t.internal.write("<< /Names [ ");for(r=0;r>","endobj");t.internal.newObject();t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+namesOid+" 0 R"))}]),t.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}};t.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root),t.children.push(r),r},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(e){e.id=t.internal.newObjectDeferred();for(var n=0;n0&&(this.line("/First "+this.makeRef(t.children[0])),this.line("/Last "+this.makeRef(t.children[t.children.length-1]))),this.line("/Count "+this.count_r({count:0},t)),this.objEnd()},t.outline.renderItems=function(e){for(var n=0;n0&&this.line("/Prev "+this.makeRef(e.children[n-1])),n0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1])));var i=this.count=this.count_r({count:0},r);if(i>0&&this.line("/Count "+i),r.options&&r.options.pageNumber){var o=t.internal.getPageInfo(r.options.pageNumber);this.line("/Dest ["+o.objId+" 0 R /XYZ 0 "+this.ctx.pdf.internal.pageSize.height+" 0]")}this.objEnd()}for(n=0;n> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n>>24&255,b[v++]=g>>>16&255,b[v++]=g>>>8&255,b[v++]=255&g,t.arrayBufferToBinaryString(b)},r=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},i=function(t,e){for(var n,r=1,i=0,o=t.length,s=0;o>0;){o-=n=o>e?e:o;do{i+=r+=t[s++]}while(--n);r%=65521,i%=65521}return(i<<16|r)>>>0},o=function(t,e,n,r){for(var i,o,s,a=t.length/e,c=new Uint8Array(t.length+a),l=f(),u=0;u>>1)&255;return o},u=function(t,e,n){var r,i,o,s,a=[],c=0,l=t.length;for(a[0]=4;c>>w&255,w+=c.bits;b[k]=C>>>w&255}if(16===c.bits){y=(P=new Uint32Array(c.decodePixels().buffer)).length,v=new Uint8Array(y*(32/c.pixelBitlength)*c.colors),b=new Uint8Array(y*(32/c.pixelBitlength));for(var C,A=c.colors>1,S=(k=0,_=0,0);k>>0&255,A&&(v[_++]=C>>>16&255,C=P[k++],v[_++]=C>>>0&255),b[S++]=C>>>16&255;m=8}s!==t.image_compression.NONE&&e()?(r=n(v,c.width*c.colors,c.colors,s),d=n(b,c.width,1,s)):(r=v,d=b,g=null)}if(3===c.colorType&&(p=this.color_spaces.INDEXED,f=c.palette,c.transparency.indexed)){var q=c.transparency.indexed,T=0;for(k=0,y=q.length;k>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this},w=e.API,y=w.getCharWidthsArray=function(t,e){e||(e={});var n,r,i,o=e.widths?e.widths:this.internal.getFont().metadata.Unicode.widths,s=o.fof?o.fof:1,a=e.kerning?e.kerning:this.internal.getFont().metadata.Unicode.kerning,c=a.fof?a.fof:1,l=0,u=o[0]||s,h=[];for(n=0,r=t.length;nr&&(i.push(t.slice(c,o)),a=0,c=o),a+=e[o],o++;return c!==o&&i.push(t.slice(c,o)),i},_=function(t,e,n){n||(n={});var r,i,o,s,a,c,l=[],u=[l],h=n.textIndent||0,f=0,d=0,p=t.split(" "),g=y(" ",n)[0];if(c=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(c).join(" "),w=[];p.map(function(t){(t=t.split(/\s*\n/)).length>1?w=w.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):w.push(t[0])}),p=w,c=x(m,n)}for(o=0,s=p.length;oe||b){if(d>e){for(a=k(r,i,e-(h+f),e),l.push(a.shift()),l=[a.pop()];a.length;)u.push([a.shift()]);d=v(i.slice(r.length-l[0].length))}else l=[r];u.push(l),h=d+c,f=g}else l.push(r),h+=f+d,f=g}if(c)var _=function(t,e){return(e?m:"")+t.join(" ")};else _=function(t){return t.join(" ")};return u.map(_)},w.splitTextToSize=function(t,e,n){n||(n={});var r,i=n.fontSize||this.internal.getFontSize(),o=function(t){var e={0:1},n={};if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var r=this.internal.getFont(t.fontName,t.fontStyle);return r.metadata.Unicode?{widths:r.metadata.Unicode.widths||e,kerning:r.metadata.Unicode.kerning||n}:{widths:e,kerning:n}}.call(this,n);r=Array.isArray(t)?t:t.split(/\r?\n/);var s=1*this.internal.scaleFactor*e/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=n.lineIndent;var a,c,l=[];for(a=0,c=r.length;a',i=unescape(encodeURIComponent('')),o=unescape(encodeURIComponent(t)),s=unescape(encodeURIComponent(e)),a=unescape(encodeURIComponent("")),c=unescape(encodeURIComponent("")),l=o.length+s.length+a.length+i.length+c.length;r=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+l+" >>"),this.internal.write("stream"),this.internal.write(i+o+s+a+c),this.internal.write("endstream"),this.internal.write("endobj")}else r=""}),this.internal.events.subscribe("putCatalog",function(){r&&this.internal.write("/Metadata "+r+" 0 R")}),this}}(e.API),function(t){if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return void new Blob}catch(t){}var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},r=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},i=n.prototype,o=r.prototype,s=t.FileReaderSync,a=function(t){this.code=this[this.name=t]},c="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),l=c.length,u=t.URL||t.webkitURL||t,h=u.createObjectURL,f=u.revokeObjectURL,d=u,p=t.btoa,g=t.atob,m=t.ArrayBuffer,w=t.Uint8Array,y=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(r.fake=o.fake=!0;l--;)a.prototype[c[l]]=l+1;return u.createObjectURL||(d=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(y),n.origin=e&&e[1])),n}),d.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof r?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):p?e+";base64,"+p(t.data):e+","+encodeURIComponent(t.data)):h?h.call(u,t):void 0},d.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&f&&f.call(u,t)},i.append=function(t){var n=this.data;if(w&&(t instanceof m||t instanceof w)){for(var i="",o=new w(t),c=0,l=o.length;c1?e:this.data.length),n,this.encoding)},o.toString=function(){return"[object Blob]"},o.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,n){var r=n&&n.type||"",i=new e;if(t)for(var o=0,s=t.length;o>>16,i=0,o=e.length;i>>0},u=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i>>0},h={},f=h.Adler32=((i=(r=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0}).prototype={}).constructor=r,r.from=((t=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=l(1,t.toString())}).prototype=i,t),r.fromUtf8=((e=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var e=c(t.toString());this.checksum=l(1,e)}).prototype=i,e),o&&(r.fromBuffer=((n=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(!a(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=u(1,e)}).prototype=i,n)),i.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=l(this.checksum,t)},i.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=c(t.toString());return this.checksum=l(this.checksum,e)},o&&(i.updateBuffer=function(t){if(!a(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=u(this.checksum,e)}),i.clone=function(){return new f(this.checksum)},r);return h.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return l(1,t.toString())},h.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=c(t.toString());return l(1,e)},o&&(h.fromBuffer=function(t){if(!a(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return u(1,e)}),h});var S={_colorsTable:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},colorNameToHex:function(t){return t=t.toLowerCase(),void 0!==this._colorsTable[t]&&this._colorsTable[t]}},q=function(t){var e=15,n=30,r=19,i=256,o=i+1+29,s=2*o+1,a=256,c=16,l=17,u=18,h=16,f=-1,d=1,p=2,g=0,m=0,w=1,y=3,v=4,b=0,x=1,k=2,_=-2,C=-3,A=-5,S=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function q(){var t=this;function n(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}t.build_tree=function(r){var i,o,a,c=t.dyn_tree,l=t.stat_desc.static_tree,u=t.stat_desc.elems,h=-1;for(r.heap_len=0,r.heap_max=s,i=0;i=1;i--)r.pqdownheap(c,i);a=u;do{i=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(c,1),o=r.heap[1],r.heap[--r.heap_max]=i,r.heap[--r.heap_max]=o,c[2*a]=c[2*i]+c[2*o],r.depth[a]=Math.max(r.depth[i],r.depth[o])+1,c[2*i+1]=c[2*o+1]=a,r.heap[1]=a++,r.pqdownheap(c,1)}while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],function(n){var r,i,o,a,c,l,u=t.dyn_tree,h=t.stat_desc.static_tree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(a=0;a<=e;a++)n.bl_count[a]=0;for(u[2*n.heap[n.heap_max]+1]=0,r=n.heap_max+1;rp&&(a=p,g++),u[2*i+1]=a,i>t.max_code||(n.bl_count[a]++,c=0,i>=d&&(c=f[i-d]),l=u[2*i],n.opt_len+=l*(a+c),h&&(n.static_len+=l*(h[2*i+1]+c)));if(0!==g){do{for(a=p-1;0===n.bl_count[a];)a--;n.bl_count[a]--,n.bl_count[a+1]+=2,n.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(i=n.bl_count[a];0!==i;)(o=n.heap[--r])>t.max_code||(u[2*o+1]!=a&&(n.opt_len+=(a-u[2*o+1])*u[2*o],u[2*o+1]=a),i--)}}(r),function(t,r,i){var o,s,a,c=[],l=0;for(o=1;o<=e;o++)c[o]=l=l+i[o-1]<<1;for(s=0;s<=r;s++)0!==(a=t[2*s+1])&&(t[2*s]=n(c[a]++,a))}(c,t.max_code,r.bl_count)}}function T(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i}q._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],q.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],q.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],q.d_code=function(t){return t<256?S[t]:S[256+(t>>>7)]},q.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],q.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],q.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],T.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],T.static_l_desc=new T(T.static_ltree,q.extra_lbits,i+1,o,e),T.static_d_desc=new T(T.static_dtree,q.extra_dbits,0,n,e),T.static_bl_desc=new T(null,q.extra_blbits,0,r,7);var I=9,P=8;function E(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}var O=0,F=1,R=2,B=[new E(0,0,0,0,O),new E(4,4,8,4,F),new E(4,5,16,8,F),new E(4,6,32,32,F),new E(4,4,16,16,R),new E(8,16,32,32,R),new E(8,16,128,128,R),new E(8,32,128,256,R),new E(32,128,258,1024,R),new E(32,258,258,4096,R)],D=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],j=0,N=1,z=2,L=3,M=32,U=42,H=113,W=666,X=8,V=0,Y=1,G=2,J=3,Q=258,K=Q+J+1;function $(t,e,n,r){var i=t[2*e],o=t[2*n];return i>>8&255)}function Ht(t,e){var n,r=e;Rt>h-r?(Ut(Ft|=(n=t)<