/** * html2pdf.js v0.9.0 * Copyright (c) 2018 Erik Koopmans * Released under the MIT License. */ !function(A,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):A.html2pdf=t()}(this,function(){"use strict";function A(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function t(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}function e(A,t){return t={exports:{}},A(t,t.exports),t.exports}var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=(e(function(t,e){t.exports=function(){function t(A){return"function"==typeof A}function e(){var A=setTimeout;return function(){return A(r,1)}}function r(){for(var A=0;A>"),G("endobj"),e=S[t].join("\n"),Y(),C){for(r=[],i=e.length;i--;)r[i]=e.charCodeAt(i);a=c.from(e),(o=new s(6)).append(new Uint8Array(r)),e=o.flush(),(r=new Uint8Array(e.length+6)).set(new Uint8Array([120,156])),r.set(e,2),r.set(new Uint8Array([255&a,a>>8&255,a>>16&255,a>>24&255]),e.length+2),e=String.fromCharCode.apply(null,r),G("<>")}else G("<>");J(e),G("endobj")}x[1]=R,G("1 0 obj"),G("<>"),G("endobj"),z.publish("postPutPages")},Z=function(A){A.objectNumber=Y(),G("<>"),G("endobj")},$=function(){G("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),G("/Font <<");for(var A in _)_.hasOwnProperty(A)&&G("/"+A+" "+_[A].objectNumber+" 0 R");G(">>"),G("/XObject <<"),z.publish("putXobjectDict"),G(">>")},AA=function(){(function(){for(var A in _)_.hasOwnProperty(A)&&Z(_[A])})(),z.publish("putResources"),x[2]=R,G("2 0 obj"),G("<<"),$(),G(">>"),G("endobj"),z.publish("postPutResources")},tA=function(A,t,e){I.hasOwnProperty(t)||(I[t]={}),I[t][e]=A},eA=function(A,t,e,n){var r="F"+(Object.keys(_).length+1).toString(10),i=_[r]={id:r,PostScriptName:A,fontName:t,fontStyle:e,encoding:n,metadata:{}};return tA(r,t,e),z.publish("addFont",i),r},nA=function(A,t){return function(A,t){var e,n,r,i,o,a,s,c,l;if(t=t||{},r=t.sourceEncoding||"Unicode",o=t.outputEncoding,(t.autoencode||o)&&_[h].metadata&&_[h].metadata[r]&&_[h].metadata[r].encoding&&(i=_[h].metadata[r].encoding,!o&&_[h].encoding&&(o=_[h].encoding),!o&&i.codePages&&(o=i.codePages[0]),"string"==typeof o&&(o=i[o]),o)){for(s=!1,a=[],e=0,n=A.length;e>8&&(s=!0);A=a.join("")}for(e=A.length;void 0===s&&0!==e;)A.charCodeAt(e-1)>>8&&(s=!0),e--;if(!s)return A;for(a=t.noBOM?[]:[254,255],e=0,n=A.length;e>8)>>8)throw new Error("Character at position "+e+" of string '"+A+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(l),a.push(c-(l<<8))}return String.fromCharCode.apply(void 0,a)}(A,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},rA=function(){(function(A,t){var e="string"==typeof t&&t.toLowerCase();if("string"==typeof A){var n=A.toLowerCase();i.hasOwnProperty(n)&&(A=i[n][0]/d,t=i[n][1]/d)}if(Array.isArray(A)&&(t=A[1],A=A[0]),e){switch(e.substr(0,1)){case"l":t>A&&(e="s");break;case"p":A>t&&(e="s")}"s"===e&&(f=A,A=t,t=f)}H=!0,S[++T]=[],O[T]={width:Number(A)||p,height:Number(t)||g},N[T]={},iA(T)}).apply(this,arguments),G(X(E*d)+" w"),G(v),0!==L&&G(L+" J"),0!==D&&G(D+" j"),z.publish("addPage",{pageNumber:T})},iA=function(A){A>0&&A<=T&&(B=A,p=O[A].width,g=O[A].height)},oA=function(A,t){var e;switch(A=void 0!==A?A:_[h].fontName,t=void 0!==t?t:_[h].fontStyle,void 0!==A&&(A=A.toLowerCase()),A){case"sans-serif":case"verdana":case"arial":case"helvetica":A="helvetica";break;case"fixed":case"monospace":case"terminal":case"courier":A="courier";break;case"serif":case"cursive":case"fantasy":default:A="times"}try{e=I[A][t]}catch(A){}return e||null==(e=I.times[t])&&(e=I.times.normal),e},aA=function(){H=!1,b=2,R=0,k=[],x=[],P=[],z.publish("buildDocument"),G("%PDF-"+r),W(),function(){z.publish("putAdditionalObjects");for(var A=0;A>"),G("endobj"),Y(),G("<<"),function(){switch(G("/Type /Catalog"),G("/Pages 1 0 R"),m||(m="fullwidth"),m){case"fullwidth":G("/OpenAction [3 0 R /FitH null]");break;case"fullheight":G("/OpenAction [3 0 R /FitV null]");break;case"fullpage":G("/OpenAction [3 0 R /Fit]");break;case"original":G("/OpenAction [3 0 R /XYZ null null 1]");break;default:var A=""+m;"%"===A.substr(A.length-1)&&(m=parseInt(m)/100),"number"==typeof m&&G("/OpenAction [3 0 R /XYZ null null "+X(m)+"]")}switch(Q||(Q="continuous"),Q){case"continuous":G("/PageLayout /OneColumn");break;case"single":G("/PageLayout /SinglePage");break;case"two":case"twoleft":G("/PageLayout /TwoColumnLeft");break;case"tworight":G("/PageLayout /TwoColumnRight")}w&&G("/PageMode /"+w),z.publish("putCatalog")}(),G(">>"),G("endobj");var A,t=R,e="0000000000";for(G("xref"),G("0 "+(b+1)),G(e+" 65535 f "),A=1;A<=b;A++){var i=x[A];G("function"==typeof i?(e+x[A]()).slice(-10)+" 00000 n ":(e+x[A]).slice(-10)+" 00000 n ")}return G("trailer"),G("<<"),G("/Size "+(b+1)),G("/Root "+b+" 0 R"),G("/Info "+(b-1)+" 0 R"),G(">>"),G("startxref"),G(""+t),G("%%EOF"),H=!0,k.join("\n")},sA=function(A){var t="S";return"F"===A?t="f":"FD"===A||"DF"===A?t="B":"f"!==A&&"f*"!==A&&"B"!==A&&"B*"!==A||(t=A),t},cA=function(){for(var A=aA(),t=A.length,e=new ArrayBuffer(t),n=new Uint8Array(e);t--;)n[t]=A.charCodeAt(t);return e},lA=function(){return new Blob([cA()],{type:"application/pdf"})},uA=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!A.console)throw new Error(n);A.console.error(n,t),A.alert&&alert(n)}},t.foo.bar=t,t.foo}(function(t,e){var n="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(aA()):0;switch(t){case void 0:return aA();case"save":if(navigator.getUserMedia&&(void 0===A.URL||void 0===A.URL.createObjectURL))return M.output("dataurlnewwindow");o(lA(),e),"function"==typeof o.unload&&A.setTimeout&&setTimeout(o.unload,911);break;case"arraybuffer":return cA();case"blob":return lA();case"bloburi":case"bloburl":return A.URL&&A.URL.createObjectURL(lA())||void 0;case"datauristring":case"dataurlstring":return n;case"dataurlnewwindow":var r=A.open(n);if(r||"undefined"==typeof safari)return r;case"datauri":case"dataurl":return A.document.location.href=n;default:throw new Error('Output type "'+t+'" is not supported.')}}),hA=function(A){return!0===Array.isArray(q)&&q.indexOf(A)>-1};switch(a){case"pt":d=1;break;case"mm":d=72/25.4000508;break;case"cm":d=72/2.54000508;break;case"in":d=72;break;case"px":d=1==hA("px_scaling")?.75:96/72;break;case"pc":case"em":d=12;break;case"ex":d=6;break;default:throw"Invalid unit: "+a}M.internal={pdfEscape:nA,getStyle:sA,getFont:function(){return _[oA.apply(M,arguments)]},getFontSize:function(){return U},getLineHeight:function(){return U*F},write:function(A){G(1===arguments.length?A:Array.prototype.join.call(arguments," "))},getCoordinateString:function(A){return X(A*d)},getVerticalCoordinateString:function(A){return X((g-A)*d)},collections:{},newObject:Y,newAdditionalObject:function(){var A=2*S.length+1,t={objId:A+=P.length,content:""};return P.push(t),t},newObjectDeferred:function(){return b++,x[b]=function(){return R},b},newObjectDeferredBegin:function(A){x[A]=R},putStream:J,events:z,scaleFactor:d,pageSize:{get width(){return p},get height(){return g}},output:function(A,t){return uA(A,t)},getNumberOfPages:function(){return S.length-1},pages:S,out:G,f2:X,getPageInfo:function(A){return{objId:2*(A-1)+3,pageNumber:A,pageContext:N[A]}},getCurrentPageInfo:function(){return{objId:2*(B-1)+3,pageNumber:B,pageContext:N[B]}},getPDFVersion:function(){return r},hasHotfix:hA},M.addPage=function(){return rA.apply(this,arguments),this},M.setPage=function(){return iA.apply(this,arguments),this},M.insertPage=function(A){return this.addPage(),this.movePage(B,A),this},M.movePage=function(A,t){if(A>t){for(var e=S[A],n=O[A],r=N[A],i=A;i>t;i--)S[i]=S[i-1],O[i]=O[i-1],N[i]=N[i-1];S[t]=e,O[t]=n,N[t]=r,this.setPage(t)}else if(A0&&A<=T&&(S.splice(A,1),O.splice(A,1),B>--T&&(B=T),this.setPage(B))}.apply(this,arguments),this},M.setDisplayMode=function(A,t,e){if(m=A,Q=t,w=e,-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(e))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+e+'" is not recognized.');return this},M.text=function(A,t,e,n,r,i){function o(A){return A=A.split("\t").join(Array(u.TabLen||9).join(" ")),nA(A,n)}"number"==typeof A&&(f=e,e=t,t=A,A=f),"string"==typeof A&&(A=A.match(/[\n\r]/)?A.split(/\r\n|\r|\n/g):[A]),"string"==typeof r&&(i=r,r=null),"string"==typeof n&&(i=n,n=null),"number"==typeof n&&(r=n,n=null);var a="",s="Td";if(r){r*=Math.PI/180;var c=Math.cos(r),l=Math.sin(r);a=[X(c),X(l),X(-1*l),X(c),""].join(" "),s="Tm"}"noBOM"in(n=n||{})||(n.noBOM=!0),"autoencode"in n||(n.autoencode=!0);var B="",p=this.internal.getCurrentPageInfo().pageContext;if(!0===n.stroke?!0!==p.lastTextWasStroke&&(B="1 Tr\n",p.lastTextWasStroke=!0):(p.lastTextWasStroke&&(B="0 Tr\n"),p.lastTextWasStroke=!1),void 0===this._runningPageHeight&&(this._runningPageHeight=0),"string"==typeof A)A=o(A);else{if("[object Array]"!==Object.prototype.toString.call(A))throw new Error('Type of text must be string or Array. "'+A+'" is not recognized.');for(var w=A.concat(),m=[],Q=w.length;Q--;)m.push(o(w.shift()));if(i){var C,v,E,b=U*F,H=A.map(function(A){return this.getStringUnitWidth(A)*U/d},this);if(E=Math.max.apply(Math,H),"center"===i)C=t-E/2,t-=H[0]/2;else{if("right"!==i)throw new Error('Unrecognized alignment option, use "center" or "right".');C=t-E,t-=H[0]}v=t,A=m[0];for(var x=1,Q=m.length;x>16&255,t=n>>8&255,e=255&n}return y=0===A&&0===t&&0===e||void 0===t?V(A/255)+" g":[V(A/255),V(t/255),V(e/255),"rg"].join(" "),this},M.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},M.setLineCap=function(A){var t=this.CapJoinStyles[A];if(void 0===t)throw new Error("Line cap style of '"+A+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return L=t,G(t+" J"),this},M.setLineJoin=function(A){var t=this.CapJoinStyles[A];if(void 0===t)throw new Error("Line join style of '"+A+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return D=t,G(t+" j"),this},M.output=uA,M.save=function(A){M.output("save",A)};for(var dA in n.API)n.API.hasOwnProperty(dA)&&("events"===dA&&n.API.events.length?function(A,t){var e,n,r;for(r=t.length-1;-1!==r;r--)e=t[r][0],n=t[r][1],A.subscribe.apply(A,[e].concat("function"==typeof n?[n]:n))}(z,n.API.events):M[dA]=n.API[dA]);return function(){for(var A=[["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"]],t=0,e=A.length;t>\n",this.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){o+="/AP << ";for(var s in r.appearanceStreamContent){var c=r.appearanceStreamContent[s];if(o+="/"+s+" ",o+="<< ",Object.keys(c).length>=1||Array.isArray(c))for(var n in c)"function"==typeof(u=c[n])&&(u=u.call(this,r)),o+="/"+n+" "+u+" ",this.acroformPlugin.xForms.indexOf(u)>=0||this.acroformPlugin.xForms.push(u);else{var u=c;"function"==typeof u&&(u=u.call(this,r)),o+="/"+n+" "+u+" \n",this.acroformPlugin.xForms.indexOf(u)>=0||this.acroformPlugin.xForms.push(u)}o+=" >>\n"}o+=">>\n"}o+=">>\nendobj\n",this.internal.out(o)}e&&l.call(this,this.acroformPlugin.xForms)},l=function(A){for(var t in A){var e=t,n=A[t];this.internal.newObjectDeferredBegin(n&&n.objId);var r="";r+=n?n.getString():"",this.internal.out(r),delete A[e]}};A.addField=function(A){return A instanceof t.TextField?h.call(this,A):A instanceof t.ChoiceField?d.call(this,A):A instanceof t.Button?u.call(this,A):A instanceof t.ChildClass?o.call(this,A):A&&o.call(this,A),A.page=this.acroformPlugin.internal.getCurrentPageInfo().pageNumber,this};var u=function(A){(A=A||new t.Field).FT="/Btn";var e=A.Ff||0;A.pushbutton&&(e=t.internal.setBitPosition(e,17),delete A.pushbutton),A.radio&&(e=t.internal.setBitPosition(e,16),delete A.radio),A.noToggleToOff&&(e=t.internal.setBitPosition(e,15)),A.Ff=e,o.call(this,A)},h=function(A){(A=A||new t.Field).FT="/Tx";var e=A.Ff||0;A.multiline&&(e|=4096),A.password&&(e|=8192),A.fileSelect&&(e|=1<<20),A.doNotSpellCheck&&(e|=1<<22),A.doNotScroll&&(e|=1<<23),A.Ff=A.Ff||e,o.call(this,A)},d=function(A){var e=A||new t.Field;e.FT="/Ch";var n=e.Ff||0;e.combo&&(n=t.internal.setBitPosition(n,18),delete e.combo),e.edit&&(n=t.internal.setBitPosition(n,19),delete e.edit),e.sort&&(n=t.internal.setBitPosition(n,20),delete e.sort),e.multiSelect&&this.internal.getPDFVersion()>=1.4&&(n=t.internal.setBitPosition(n,22),delete e.multiSelect),e.doNotSpellCheck&&this.internal.getPDFVersion()>=1.4&&(n=t.internal.setBitPosition(n,23),delete e.doNotSpellCheck),e.Ff=n,o.call(this,e)}})(r.API);var i=window.AcroForm;i.internal={},i.createFormXObject=function(A){var t=new i.FormXObject,e=i.Appearance.internal.getHeight(A)||0,n=i.Appearance.internal.getWidth(A)||0;return t.BBox=[0,0,n,e],t},i.Appearance={CheckBox:{createAppearanceStream:function(){return{N:{On:i.Appearance.CheckBox.YesNormal},D:{On:i.Appearance.CheckBox.YesPushDown,Off:i.Appearance.CheckBox.OffPushDown}}},createMK:function(){return"<< /CA (3)>>"},YesPushDown:function(A){var t=i.createFormXObject(A),e="";A.Q=1;var n=i.internal.calculateX(A,"3","ZapfDingbats",50);return e+="0.749023 g\n 0 0 "+i.Appearance.internal.getWidth(A)+" "+i.Appearance.internal.getHeight(A)+" re\n f\n BMC\n q\n 0 0 1 rg\n /F13 "+n.fontSize+" Tf 0 g\n BT\n",e+=n.text,e+="ET\n Q\n EMC\n",t.stream=e,t},YesNormal:function(A){var t=i.createFormXObject(A),e="";A.Q=1;var n=i.internal.calculateX(A,"3","ZapfDingbats",.9*i.Appearance.internal.getHeight(A));return e+="1 g\n0 0 "+i.Appearance.internal.getWidth(A)+" "+i.Appearance.internal.getHeight(A)+" re\nf\nq\n0 0 1 rg\n0 0 "+(i.Appearance.internal.getWidth(A)-1)+" "+(i.Appearance.internal.getHeight(A)-1)+" re\nW\nn\n0 g\nBT\n/F13 "+n.fontSize+" Tf 0 g\n",e+=n.text,e+="ET\n Q\n",t.stream=e,t},OffPushDown:function(A){var t=i.createFormXObject(A),e="";return e+="0.749023 g\n 0 0 "+i.Appearance.internal.getWidth(A)+" "+i.Appearance.internal.getHeight(A)+" re\n f\n",t.stream=e,t}},RadioButton:{Circle:{createAppearanceStream:function(A){var t={D:{Off:i.Appearance.RadioButton.Circle.OffPushDown},N:{}};return t.N[A]=i.Appearance.RadioButton.Circle.YesNormal,t.D[A]=i.Appearance.RadioButton.Circle.YesPushDown,t},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(A){var t=i.createFormXObject(A),e="",n=i.Appearance.internal.getWidth(A)<=i.Appearance.internal.getHeight(A)?i.Appearance.internal.getWidth(A)/4:i.Appearance.internal.getHeight(A)/4;n*=.9;var r=i.Appearance.internal.Bezier_C;return e+="q\n1 0 0 1 "+i.Appearance.internal.getWidth(A)/2+" "+i.Appearance.internal.getHeight(A)/2+" cm\n"+n+" 0 m\n"+n+" "+n*r+" "+n*r+" "+n+" 0 "+n+" c\n-"+n*r+" "+n+" -"+n+" "+n*r+" -"+n+" 0 c\n-"+n+" -"+n*r+" -"+n*r+" -"+n+" 0 -"+n+" c\n"+n*r+" -"+n+" "+n+" -"+n*r+" "+n+" 0 c\nf\nQ\n",t.stream=e,t},YesPushDown:function(A){var t=i.createFormXObject(A),e="",n=i.Appearance.internal.getWidth(A)<=i.Appearance.internal.getHeight(A)?i.Appearance.internal.getWidth(A)/4:i.Appearance.internal.getHeight(A)/4,r=2*(n*=.9),o=r*i.Appearance.internal.Bezier_C,a=n*i.Appearance.internal.Bezier_C;return e+="0.749023 g\n q\n 1 0 0 1 "+i.Appearance.internal.getWidth(A)/2+" "+i.Appearance.internal.getHeight(A)/2+" cm\n"+r+" 0 m\n"+r+" "+o+" "+o+" "+r+" 0 "+r+" c\n-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c\n-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c\n"+o+" -"+r+" "+r+" -"+o+" "+r+" 0 c\n f\n Q\n 0 g\n q\n 1 0 0 1 "+i.Appearance.internal.getWidth(A)/2+" "+i.Appearance.internal.getHeight(A)/2+" cm\n"+n+" 0 m\n"+n+" "+a+" "+a+" "+n+" 0 "+n+" c\n-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c\n-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c\n"+a+" -"+n+" "+n+" -"+a+" "+n+" 0 c\n f\n Q\n",t.stream=e,t},OffPushDown:function(A){var t=i.createFormXObject(A),e="",n=i.Appearance.internal.getWidth(A)<=i.Appearance.internal.getHeight(A)?i.Appearance.internal.getWidth(A)/4:i.Appearance.internal.getHeight(A)/4,r=2*(n*=.9),o=r*i.Appearance.internal.Bezier_C;return e+="0.749023 g\n q\n 1 0 0 1 "+i.Appearance.internal.getWidth(A)/2+" "+i.Appearance.internal.getHeight(A)/2+" cm\n"+r+" 0 m\n"+r+" "+o+" "+o+" "+r+" 0 "+r+" c\n-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c\n-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c\n"+o+" -"+r+" "+r+" -"+o+" "+r+" 0 c\n f\n Q\n",t.stream=e,t}},Cross:{createAppearanceStream:function(A){var t={D:{Off:i.Appearance.RadioButton.Cross.OffPushDown},N:{}};return t.N[A]=i.Appearance.RadioButton.Cross.YesNormal,t.D[A]=i.Appearance.RadioButton.Cross.YesPushDown,t},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(A){var t=i.createFormXObject(A),e="",n=i.Appearance.internal.calculateCross(A);return e+="q\n 1 1 "+(i.Appearance.internal.getWidth(A)-2)+" "+(i.Appearance.internal.getHeight(A)-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",t.stream=e,t},YesPushDown:function(A){var t=i.createFormXObject(A),e=i.Appearance.internal.calculateCross(A),n="";return n+="0.749023 g\n 0 0 "+i.Appearance.internal.getWidth(A)+" "+i.Appearance.internal.getHeight(A)+" re\n f\n q\n 1 1 "+(i.Appearance.internal.getWidth(A)-2)+" "+(i.Appearance.internal.getHeight(A)-2)+" re\n W\n n\n "+e.x1.x+" "+e.x1.y+" m\n "+e.x2.x+" "+e.x2.y+" l\n "+e.x4.x+" "+e.x4.y+" m\n "+e.x3.x+" "+e.x3.y+" l\n s\n Q\n",t.stream=n,t},OffPushDown:function(A){var t=i.createFormXObject(A),e="";return e+="0.749023 g\n 0 0 "+i.Appearance.internal.getWidth(A)+" "+i.Appearance.internal.getHeight(A)+" re\n f\n",t.stream=e,t}}},createDefaultAppearanceStream:function(A){var t="";return t+="/Helv 0 Tf 0 g"}},i.Appearance.internal={Bezier_C:.551915024494,calculateCross:function(A){var t=i.Appearance.internal.getWidth(A),e=i.Appearance.internal.getHeight(A),n=function(A,t){return A>e?e:A}(t);return{x1:{x:(t-n)/2,y:(e-n)/2+n},x2:{x:(t-n)/2+n,y:(e-n)/2},x3:{x:(t-n)/2,y:(e-n)/2},x4:{x:(t-n)/2+n,y:(e-n)/2+n}}}},i.Appearance.internal.getWidth=function(A){return A.Rect[2]},i.Appearance.internal.getHeight=function(A){return A.Rect[3]},i.internal.inherit=function(A,t){A.prototype=Object.create(t.prototype),A.prototype.constructor=A},i.internal.arrayToPdfArray=function(A){if(Array.isArray(A)){var t=" [";for(var e in A)t+=A[e].toString(),t+=e>\n",this.stream&&(A+="stream\n",A+=this.stream,A+="endstream\n"),A+="endobj\n"},i.PDFObject.prototype.getContent=function(){var A="";return A+=function(A){var t="",e=Object.keys(A).filter(function(A){return"content"!=A&&"appearanceStreamContent"!=A&&"_"!=A.substring(0,1)});for(var n in e){var r=e[n],o=A[r];o&&(Array.isArray(o)?t+="/"+r+" "+i.internal.arrayToPdfArray(o)+"\n":o instanceof i.PDFObject?t+="/"+r+" "+o.objId+" 0 R\n":t+="/"+r+" "+o+"\n")}return t}(this)},i.FormXObject=function(){i.PDFObject.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo;var A;Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==A?A.length:0}}),Object.defineProperty(this,"stream",{enumerable:!1,set:function(t){A=t},get:function(){return A||null}})},i.internal.inherit(i.FormXObject,i.PDFObject),i.AcroFormDictionary=function(){i.PDFObject.call(this);var A=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return A.length>0?A:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!0,configurable:!0,get:function(){return A}}),this.DA},i.internal.inherit(i.AcroFormDictionary,i.PDFObject),i.Field=function(){i.PDFObject.call(this);var A;Object.defineProperty(this,"Rect",{enumerable:!0,configurable:!1,get:function(){if(A)return A},set:function(t){A=t}});var t="";Object.defineProperty(this,"FT",{enumerable:!0,set:function(A){t=A},get:function(){return t}});var e;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,set:function(A){e=A},get:function(){if(!e||e.length<1){if(this instanceof i.ChildClass)return;return"(FieldObject"+i.Field.FieldNum+++")"}return"("==e.substring(0,1)&&e.substring(e.length-1)?e:"("+e+")"}});var n;Object.defineProperty(this,"DA",{enumerable:!0,get:function(){if(n)return"("+n+")"},set:function(A){n=A}});var r;Object.defineProperty(this,"DV",{enumerable:!0,configurable:!0,get:function(){if(r)return r},set:function(A){r=A}}),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})},i.Field.FieldNum=0,i.internal.inherit(i.Field,i.PDFObject),i.ChoiceField=function(){i.Field.call(this),this.FT="/Ch",this.Opt=[],this.V="()",this.TI=0,this.combo=!1,Object.defineProperty(this,"edit",{enumerable:!0,set:function(A){1==A?(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(){i.internal.toPdfString()}})},i.internal.inherit(i.ChoiceField,i.Field),window.ChoiceField=i.ChoiceField,i.ListBox=function(){i.ChoiceField.call(this)},i.internal.inherit(i.ListBox,i.ChoiceField),window.ListBox=i.ListBox,i.ComboBox=function(){i.ListBox.call(this),this.combo=!0},i.internal.inherit(i.ComboBox,i.ListBox),window.ComboBox=i.ComboBox,i.EditBox=function(){i.ComboBox.call(this),this.edit=!0},i.internal.inherit(i.EditBox,i.ComboBox),window.EditBox=i.EditBox,i.Button=function(){i.Field.call(this),this.FT="/Btn"},i.internal.inherit(i.Button,i.Field),window.Button=i.Button,i.PushButton=function(){i.Button.call(this),this.pushbutton=!0},i.internal.inherit(i.PushButton,i.Button),window.PushButton=i.PushButton,i.RadioButton=function(){i.Button.call(this),this.radio=!0;var A=[];Object.defineProperty(this,"Kids",{enumerable:!0,get:function(){if(A.length>0)return A}}),Object.defineProperty(this,"__Kids",{get:function(){return A}});var t;Object.defineProperty(this,"noToggleToOff",{enumerable:!1,get:function(){return t},set:function(A){t=A}})},i.internal.inherit(i.RadioButton,i.Button),window.RadioButton=i.RadioButton,i.ChildClass=function(A,t){i.Field.call(this),this.Parent=A,this._AppearanceType=i.Appearance.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(t),this.F=i.internal.setBitPosition(this.F,3,1),this.MK=this._AppearanceType.createMK(),this.AS="/Off",this._Name=t},i.internal.inherit(i.ChildClass,i.Field),i.RadioButton.prototype.setAppearance=function(A){if("createAppearanceStream"in A&&"createMK"in A)for(var t in this.__Kids){var e=this.__Kids[t];e.appearanceStreamContent=A.createAppearanceStream(e._Name),e.MK=A.createMK()}else console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!")},i.RadioButton.prototype.createOption=function(A){var t=new i.ChildClass(this,A);return this.__Kids.push(t),r.API.addField(t),t},i.CheckBox=function(){Button.call(this),this.appearanceStreamContent=i.Appearance.CheckBox.createAppearanceStream(),this.MK=i.Appearance.CheckBox.createMK(),this.AS="/On",this.V="/On"},i.internal.inherit(i.CheckBox,i.Button),window.CheckBox=i.CheckBox,i.TextField=function(){i.Field.call(this),this.DA=i.Appearance.createDefaultAppearanceStream(),this.F=4;var A;Object.defineProperty(this,"V",{get:function(){return A?"("+A+")":A},enumerable:!0,set:function(t){A=t}});var t;Object.defineProperty(this,"DV",{get:function(){return t?"("+t+")":t},enumerable:!0,set:function(A){t=A}});var e=!1;Object.defineProperty(this,"multiline",{enumerable:!1,get:function(){return e},set:function(A){e=A}});var n=!1;Object.defineProperty(this,"MaxLen",{enumerable:!0,get:function(){return n},set:function(A){n=A}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,get:function(){return this.V||this.DV}})},i.internal.inherit(i.TextField,i.Field),window.TextField=i.TextField,i.PasswordField=function(){TextField.call(this),Object.defineProperty(this,"password",{value:!0,enumerable:!1,configurable:!1,writable:!1})},i.internal.inherit(i.PasswordField,i.TextField),window.PasswordField=i.PasswordField,i.internal.calculateFontSpace=function(A,t,e){var e=e||"helvetica",n=i.internal.calculateFontSpace.canvas||(i.internal.calculateFontSpace.canvas=document.createElement("canvas"));(a=n.getContext("2d")).save();var r=t+" "+e;a.font=r;var o=a.measureText(A);a.fontcolor="black";var a=n.getContext("2d");return o.height=1.5*a.measureText("3").width,a.restore(),o},i.internal.calculateX=function(A,t,e,n){var n=n||12,e=e||"helvetica",r={text:"",fontSize:""},o=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" "),a=n,s=i.Appearance.internal.getHeight(A)||0;s=s<0?-s:s;var c=i.Appearance.internal.getWidth(A)||0;c=c<0?-c:c,a++;A:for(;;){t="";a--;var l=i.internal.calculateFontSpace("3",a+"px",e).height,u=A.multiline?s-a:(s-l)/2,h=-2,d=u+=2,f=0,B=0,p=0;if(0==a){a=12,t="(...) Tj\n",t+="% Width of Text: "+i.internal.calculateFontSpace(t,"1px").width+", FieldWidth:"+c+"\n";break}p=i.internal.calculateFontSpace(o[0]+" ",a+"px",e).width;var g="",w=0;for(var m in o){g=" "==(g+=o[m]+" ").substr(g.length-1)?g.substr(0,g.length-1):g;var Q=parseInt(m);p=i.internal.calculateFontSpace(g+" ",a+"px",e).width;var C=function(A,t,n){if(A+1=o.length-1;if(!C||y){if(C||y){if(y)B=Q;else if(A.multiline&&(l+2)*(w+2)+2>s)continue A}else{if(!A.multiline)continue A;if((l+2)*(w+2)+2>s)continue A;B=Q}for(var v="",U=f;U<=B;U++)v+=o[U]+" ";switch(v=" "==v.substr(v.length-1)?v.substr(0,v.length-1):v,p=i.internal.calculateFontSpace(v,a+"px",e).width,A.Q){case 2:h=c-p-2;break;case 1:h=(c-p)/2;break;case 0:default:h=2}t+=h+" "+d+" Td\n",t+="("+v+") Tj\n",t+=-h+" 0 Td\n",d=-(a+2),p=0,f=B+1,w++,g=""}else g+=" "}break}return r.text=t,r.fontSize=a,r},i.internal.calculateAppearanceStream=function(A){if(A.appearanceStreamContent)return A.appearanceStreamContent;if(A.V||A.DV){var t="",e=A.V||A.DV,n=i.internal.calculateX(A,e);t+="/Tx BMC\nq\n/F1 "+n.fontSize+" Tf\n1 0 0 1 0 0 Tm\n",t+="BT\n",t+=n.text,t+="ET\n",t+="Q\nEMC\n";var r=new i.createFormXObject(A);return r.stream=t,r}},i.internal.calculateCoordinates=function(A,t,e,n){var r={};if(this.internal){var o=function(A){return A*this.internal.scaleFactor};Array.isArray(A)?(A[0]=i.scale(A[0]),A[1]=i.scale(A[1]),A[2]=i.scale(A[2]),A[3]=i.scale(A[3]),r.lowerLeft_X=A[0]||0,r.lowerLeft_Y=o.call(this,this.internal.pageSize.height)-A[3]-A[1]||0,r.upperRight_X=A[0]+A[2]||0,r.upperRight_Y=o.call(this,this.internal.pageSize.height)-A[1]||0):(A=i.scale(A),t=i.scale(t),e=i.scale(e),n=i.scale(n),r.lowerLeft_X=A||0,r.lowerLeft_Y=this.internal.pageSize.height-t||0,r.upperRight_X=A+e||0,r.upperRight_Y=this.internal.pageSize.height-t+n||0)}else Array.isArray(A)?(r.lowerLeft_X=A[0]||0,r.lowerLeft_Y=A[1]||0,r.upperRight_X=A[0]+A[2]||0,r.upperRight_Y=A[1]+A[3]||0):(r.lowerLeft_X=A||0,r.lowerLeft_Y=t||0,r.upperRight_X=A+e||0,r.upperRight_Y=t+n||0);return[r.lowerLeft_X,r.lowerLeft_Y,r.upperRight_X,r.upperRight_Y]},i.internal.calculateColor=function(A,t,e){var n=new Array(3);return n.r=0|A,n.g=0|t,n.b=0|e,n},i.internal.getBitPosition=function(A,t){var e=1;return e<<=t-1,(A=A||0)|e},i.internal.setBitPosition=function(A,t,e){A=A||0;var n=1;if(n<<=t-1,1==(e=e||1))A|=n;else A=A&~n;return A},r.API.addHTML=function(A,t,e,n,r){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 t&&(n=t,r=e),"function"==typeof n&&(r=n,n=null);var i=this.internal,o=i.scaleFactor,a=i.pageSize.width,s=i.pageSize.height;if(n=n||{},n.onrendered=function(A){t=parseInt(t)||0,e=parseInt(e)||0;var i=n.dim||{},c=i.h||0,l=i.w||Math.min(a,A.width/o)-t,u="JPEG";if(n.format&&(u=n.format),A.height>s&&n.pagesplit){var h=function(){for(var n=0;;){var i=document.createElement("canvas");i.width=Math.min(a*o,A.width),i.height=Math.min(s*o,A.height-n),i.getContext("2d").drawImage(A,0,n,A.width,i.height,0,0,i.width,i.height);var c=[i,t,n?0:e,i.width/o,i.height/o,u,null,"SLOW"];if(this.addImage.apply(this,c),(n+=i.height)>=A.height)break;this.addPage()}r(l,n,null,c)}.bind(this);if("CANVAS"===A.nodeName){var d=new Image;d.onload=h,d.src=A.toDataURL("image/png"),A=d}else h()}else{var f=Math.random().toString(35),B=[A,t,e,l,c,u,f,"SLOW"];this.addImage.apply(this,B),r(l,c,f,B)}}.bind(this),"undefined"!=typeof html2canvas&&!n.rstz)return html2canvas(A,n);if("undefined"!=typeof rasterizeHTML){var c="drawDocument";return"string"==typeof A&&(c=/^http/.test(A)?"drawURL":"drawHTML"),n.width=n.width||a*o,rasterizeHTML[c](A,void 0,n).then(function(A){n.onrendered(A.image)},function(A){r(null,A)})}return null},function(A){var t=["jpeg","jpg","png"],n=function A(t){var e=this.internal.newObject(),n=this.internal.write,r=this.internal.putStream;if(t.n=e,n("<>"),"trns"in t&&t.trns.constructor==Array){for(var i="",o=0,a=t.trns.length;o>"),r(t.data),n("endobj"),"smask"in t){var s="/Predictor "+t.p+" /Colors 1 /BitsPerComponent "+t.bpc+" /Columns "+t.w,c={w:t.w,h:t.h,cs:"DeviceGray",bpc:t.bpc,dp:s,data:t.smask};"f"in t&&(c.f=t.f),A.call(this,c)}t.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),n("<< /Length "+t.pal.length+">>"),r(this.arrayBufferToBinaryString(new Uint8Array(t.pal))),n("endobj"))},r=function(){var A=this.internal.collections.addImage_images;for(var t in A)n.call(this,A[t])},i=function(){var A,t=this.internal.collections.addImage_images,e=this.internal.write;for(var n in t)e("/I"+(A=t[n]).i,A.n,"0","R")},o=function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in A.image_compression?t:A.image_compression.NONE},a=function(){var A=this.internal.collections.addImage_images;return A||(this.internal.collections.addImage_images=A={},this.internal.events.subscribe("putResources",r),this.internal.events.subscribe("putXobjectDict",i)),A},s=function(t){return"string"==typeof t&&A.sHashCode(t)},c=function(t){return"function"!=typeof A["process"+t.toUpperCase()]},l=function(A){return"object"===(void 0===A?"undefined":e(A))&&1===A.nodeType},u=function(A,t){var e;if(t)for(var n in t)if(A===t[n].alias){e=t[n];break}return e},h=function(A,t,e,n,r,i,o){var a=function(A,t,e){return A||t||(A=-96,t=-96),A<0&&(A=-1*e.w*72/A/this.internal.scaleFactor),t<0&&(t=-1*e.h*72/t/this.internal.scaleFactor),0===A&&(A=t*e.w/e.h),0===t&&(t=A*e.h/e.w),[A,t]}.call(this,e,n,r),s=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;e=a[0],n=a[1],o[i]=r,this.internal.write("q",s(e),"0 0",s(n),s(A),c(t+n),"cm /I"+r.i,"Do Q")};A.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"},A.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"},A.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},A.sHashCode=function(A){return Array.prototype.reduce&&A.split("").reduce(function(A,t){return(A=(A<<5)-A+t.charCodeAt(0))&A},0)},A.isString=function(A){return"string"==typeof A},A.extractInfoFromBase64DataURI=function(A){return/^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(A)},A.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},A.isArrayBuffer=function(A){return!!this.supportsArrayBuffer()&&A instanceof ArrayBuffer},A.isArrayBufferView=function(A){return!!this.supportsArrayBuffer()&&"undefined"!=typeof Uint32Array&&(A instanceof Int8Array||A instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&A instanceof Uint8ClampedArray||A instanceof Int16Array||A instanceof Uint16Array||A instanceof Int32Array||A instanceof Uint32Array||A instanceof Float32Array||A instanceof Float64Array)},A.binaryStringToUint8Array=function(A){for(var t=A.length,e=new Uint8Array(t),n=0;n>12,e=(4032&r)>>6,n=63&r,i+=o[(16515072&r)>>18]+o[t]+o[e]+o[n];return 1==c?(t=(3&(r=a[l]))<<4,i+=o[(252&r)>>2]+o[t]+"=="):2==c&&(t=(1008&(r=a[l]<<8|a[l+1]))>>4,e=(15&r)<<2,i+=o[(64512&r)>>10]+o[t]+o[e]+"="),i},A.createImageInfo=function(A,t,e,n,r,i,o,a,s,c,l,u,h){var d={alias:a,w:t,h:e,cs:n,bpc:r,i:o,data:A};return i&&(d.f=i),s&&(d.dp=s),c&&(d.trns=c),l&&(d.pal=l),u&&(d.smask=u),h&&(d.p=h),d},A.addImage=function(A,n,r,i,d,f,B,p,g){if("string"!=typeof n){var w=f;f=d,d=i,i=r,r=n,n=w}if("object"===(void 0===A?"undefined":e(A))&&!l(A)&&"imageData"in A){var m=A;A=m.imageData,n=m.format||n,r=m.x||r||0,i=m.y||i||0,d=m.w||d,f=m.h||f,B=m.alias||B,p=m.compression||p,g=m.rotation||m.angle||g}if(isNaN(r)||isNaN(i))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var Q,C=a.call(this);if(!(Q=u(A,C))){var y;if(l(A)&&(A=function(A,t,n){if("IMG"===A.nodeName&&A.hasAttribute("src")){var r=""+A.getAttribute("src");if(!n&&0===r.indexOf("data:image/"))return r;!t&&/\.png(?:[?#].*)?$/i.test(r)&&(t="png")}if("CANVAS"===A.nodeName)var i=A;else{(i=document.createElement("canvas")).width=A.clientWidth||A.width,i.height=A.clientHeight||A.height;var o=i.getContext("2d");if(!o)throw"addImage requires canvas to be supported by browser.";if(n){var a,s,c,l,u,h,d,f,B=Math.PI/180;"object"===(void 0===n?"undefined":e(n))&&(a=n.x,s=n.y,c=n.bg,n=n.angle),f=n*B,l=Math.abs(Math.cos(f)),u=Math.abs(Math.sin(f)),h=i.width,d=i.height,i.width=d*u+h*l,i.height=d*l+h*u,isNaN(a)&&(a=i.width/2),isNaN(s)&&(s=i.height/2),o.clearRect(0,0,i.width,i.height),o.fillStyle=c||"white",o.fillRect(0,0,i.width,i.height),o.save(),o.translate(a,s),o.rotate(f),o.drawImage(A,-h/2,-d/2),o.rotate(-f),o.translate(-a,-s),o.restore()}else o.drawImage(A,0,0,i.width,i.height)}return i.toDataURL("png"==(""+t).toLowerCase()?"image/png":"image/jpeg")}(A,n,g)),function(A){return void 0===A||null===A}(B)&&(B=s(A)),!(Q=u(B,C))){if(this.isString(A)){var v=this.extractInfoFromBase64DataURI(A);v?(n=v[2],A=atob(v[3])):137===A.charCodeAt(0)&&80===A.charCodeAt(1)&&78===A.charCodeAt(2)&&71===A.charCodeAt(3)&&(n="png")}if(n=(n||"JPEG").toLowerCase(),function(A){return-1===t.indexOf(A)}(n))throw new Error("addImage currently only supports formats "+t+", not '"+n+"'");if(c(n))throw new Error("please ensure that the plugin for '"+n+"' support is added");if(this.supportsArrayBuffer()&&(A instanceof Uint8Array||(y=A,A=this.binaryStringToUint8Array(A))),!(Q=this["process"+n.toUpperCase()](A,function(A){var t=0;return A&&(t=Object.keys?Object.keys(A).length:function(A){var t=0;for(var e in A)A.hasOwnProperty(e)&&t++;return t}(A)),t}(C),B,o(p),y)))throw new Error("An unkwown error occurred whilst processing the image")}}return h.call(this,r,i,d,f,Q,Q.i,C),this};var d=function(A,t){return A.subarray(t,t+5)};A.processJPEG=function(A,t,e,n,r){var i,o=this.color_spaces.DEVICE_RGB,a=this.decode.DCT_DECODE;return this.isString(A)?(i=function(A){var t,e,n;if(255===!A.charCodeAt(0)||216===!A.charCodeAt(1)||255===!A.charCodeAt(2)||224===!A.charCodeAt(3)||!A.charCodeAt(6)==="J".charCodeAt(0)||!A.charCodeAt(7)==="F".charCodeAt(0)||!A.charCodeAt(8)==="I".charCodeAt(0)||!A.charCodeAt(9)==="F".charCodeAt(0)||0===!A.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var r=256*A.charCodeAt(4)+A.charCodeAt(5),i=4,o=A.length;i7)return t=d(A,a+5),e=(t[2]<<8)+t[3],n=(t[0]<<8)+t[1],r=t[4],{width:e,height:n,numcomponents:r};a+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")}(A),A=r||this.arrayBufferToBinaryString(A),this.createImageInfo(A,i.width,i.height,1==i.numcomponents?this.color_spaces.DEVICE_GRAY:o,8,a,t,e)):null)},A.processJPG=function(){return this.processJPEG.apply(this,arguments)}}(r.API),function(A){var t={annotations:[],f2:function(A){return A.toFixed(2)},notEmpty:function(A){if(void 0!==A&&""!=A)return!0}};r.API.annotationPlugin=t,r.API.events.push(["addPage",function(A){this.annotationPlugin.annotations[A.pageNumber]=[]}]),A.events.push(["putPage",function(A){for(var e=this.annotationPlugin.annotations[A.pageNumber],n=!1,r=0;r>",l.content=g;var d=l.objId+" 0 R";g="<>";else if(c.options.pageNumber)switch(g="<>",this.internal.write(g))}}this.internal.write("]")}}]),A.createAnnotation=function(A){switch(A.type){case"link":this.link(A.bounds.x,A.bounds.y,A.bounds.w,A.bounds.h,A);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(A)}},A.link=function(A,t,e,n,r){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:A,y:t,w:e,h:n,options:r,type:"link"})},A.textWithLink=function(A,t,e,n){var r=this.getTextWidth(A),i=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(A,t,e),e+=.2*i,this.link(t,e-i,r,i,n),r},A.getTextWidth=function(A){var t=this.internal.getFontSize();return this.getStringUnitWidth(A)*t/this.internal.scaleFactor},A.getLineHeight=function(){return this.internal.getLineHeight()}}(r.API),r.API.autoPrint=function(){var A;return this.internal.events.subscribe("postPutResources",function(){A=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+A+" 0 R")}),this},function(A){A.events.push(["initialized",function(){this.canvas.pdf=this}]),A.canvas={getContext:function(A){return this.pdf.context2d._canvas=this,this.pdf.context2d},style:{}},Object.defineProperty(A.canvas,"width",{get:function(){return this._width},set:function(A){this._width=A,this.getContext("2d").pageWrapX=A+1}}),Object.defineProperty(A.canvas,"height",{get:function(){return this._height},set:function(A){this._height=A,this.getContext("2d").pageWrapY=A+1}})}(r.API),function(A){var t,e,n,r,i={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},o=1,a=function(A,t,e,n,r){i={x:A,y:t,w:e,h:n,ln:r}},s=function(){return i},c={left:0,top:0,bottom:0};A.setHeaderFunction=function(A){r=A},A.getTextDimensions=function(A){t=this.internal.getFont().fontName,e=this.table_font_size||this.internal.getFontSize(),n=this.internal.getFont().fontStyle;var r,i;(i=document.createElement("font")).id="jsPDFCell";try{i.style.fontStyle=n}catch(A){i.style.fontWeight=n}i.style.fontName=t,i.style.fontSize=e+"pt";try{i.textContent=A}catch(t){i.innerText=A}return document.body.appendChild(i),r={w:(i.offsetWidth+1)*(19.049976/25.4),h:(i.offsetHeight+1)*(19.049976/25.4)},document.body.removeChild(i),r},A.cellAddPage=function(){var A=this.margins||c;this.addPage(),a(A.left,A.top,void 0,void 0),o+=1},A.cellInitialize=function(){i={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},o=1},A.cell=function(A,t,e,n,r,i,o){var l=s(),u=!1;if(void 0!==l.ln)if(l.ln===i)A=l.x+l.w,t=l.y;else{var h=this.margins||c;l.y+l.h+n+13>=this.internal.pageSize.height-h.bottom&&(this.cellAddPage(),u=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(i,!0)),t=s().y+s().h,u&&(t=23)}if(void 0!==r[0])if(this.printingHeaderRow?this.rect(A,t,e,n,"FD"):this.rect(A,t,e,n),"right"===o){r instanceof Array||(r=[r]);for(var d=0;di&&(i=r);return i},A.table=function(t,e,n,r,a){if(!n)throw"No data for PDF table";var s,l,u,h,d,f,B,p,g,w,m=[],Q=[],C={},y={},v=[],U=[],F=!1,E=!0,b=12,H=c;if(H.width=this.internal.pageSize.width,a&&(!0===a.autoSize&&(F=!0),!1===a.printHeaders&&(E=!1),a.fontSize&&(b=a.fontSize),a.css&&void 0!==a.css["font-size"]&&(b=16*a.css["font-size"]),a.margins&&(H=a.margins)),this.lnMod=0,i={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},o=1,this.printHeaders=E,this.margins=H,this.setFontSize(b),this.table_font_size=b,void 0===r||null===r)m=Object.keys(n[0]);else if(r[0]&&"string"!=typeof r[0])for(l=0,u=r.length;lr&&(r=o)}return r},A.setTableHeaderRow=function(A){this.tableHeaderRow=A},A.printHeaderRow=function(A,t){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var e,n,i,s;if(this.printingHeaderRow=!0,void 0!==r){var c=r(this,o);a(c[0],c[1],c[2],c[3],-1)}this.setFontStyle("bold");var l=[];for(i=0,s=this.tableHeaderRow.length;i0&&this.setTableHeaderRow(l),this.setFontStyle("normal"),this.printingHeaderRow=!1}}(r.API),function(A){function t(){this._isStrokeTransparent=!1,this._strokeOpacity=1,this.strokeStyle="#000000",this.fillStyle="#000000",this._isFillTransparent=!1,this._fillOpacity=1,this.font="12pt times",this.textBaseline="alphabetic",this.textAlign="start",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this._transform=[1,0,0,1,0,0],this.globalCompositeOperation="normal",this.globalAlpha=1,this._clip_path=[],this.ignoreClearRect=!1,this.copy=function(A){this._isStrokeTransparent=A._isStrokeTransparent,this._strokeOpacity=A._strokeOpacity,this.strokeStyle=A.strokeStyle,this._isFillTransparent=A._isFillTransparent,this._fillOpacity=A._fillOpacity,this.fillStyle=A.fillStyle,this.font=A.font,this.lineWidth=A.lineWidth,this.lineJoin=A.lineJoin,this.lineCap=A.lineCap,this.textBaseline=A.textBaseline,this.textAlign=A.textAlign,this._fontSize=A._fontSize,this._transform=A._transform.slice(0),this.globalCompositeOperation=A.globalCompositeOperation,this.globalAlpha=A.globalAlpha,this._clip_path=A._clip_path.slice(0),this.ignoreClearRect=A.ignoreClearRect}}A.events.push(["initialized",function(){this.context2d.pdf=this,this.context2d.internal.pdf=this,this.context2d.ctx=new t,this.context2d.ctxStack=[],this.context2d.path=[]}]),A.context2d={pageWrapXEnabled:!1,pageWrapYEnabled:!1,pageWrapX:9999999,pageWrapY:9999999,ctx:new t,f2:function(A){return A.toFixed(2)},fillRect:function(A,t,e,n){if(!this._isFillTransparent()){A=this._wrapX(A),t=this._wrapY(t);var r=this._matrix_map_rect(this.ctx._transform,{x:A,y:t,w:e,h:n});this.pdf.rect(r.x,r.y,r.w,r.h,"f")}},strokeRect:function(A,t,e,n){if(!this._isStrokeTransparent()){A=this._wrapX(A),t=this._wrapY(t);var r=this._matrix_map_rect(this.ctx._transform,{x:A,y:t,w:e,h:n});this.pdf.rect(r.x,r.y,r.w,r.h,"s")}},clearRect:function(A,t,e,n){if(!this.ctx.ignoreClearRect){A=this._wrapX(A),t=this._wrapY(t);var r=this._matrix_map_rect(this.ctx._transform,{x:A,y:t,w:e,h:n});this.save(),this.setFillStyle("#ffffff"),this.pdf.rect(r.x,r.y,r.w,r.h,"f"),this.restore()}},save:function(){this.ctx._fontSize=this.pdf.internal.getFontSize();var A=new t;A.copy(this.ctx),this.ctxStack.push(this.ctx),this.ctx=A},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(A,t,e,n){this.moveTo(A,t),this.lineTo(A+e,t),this.lineTo(A+e,t+n),this.lineTo(A,t+n),this.lineTo(A,t),this.closePath()},beginPath:function(){this.path=[]},closePath:function(){this.path.push({type:"close"})},_getRGBA:function(A){var t,e,n,r;if(!A)return{r:0,g:0,b:0,a:0,style:A};if(this.internal.rxTransparent.test(A))t=0,e=0,n=0,r=0;else{var i=this.internal.rxRgb.exec(A);null!=i?(t=parseInt(i[1]),e=parseInt(i[2]),n=parseInt(i[3]),r=1):null!=(i=this.internal.rxRgba.exec(A))?(t=parseInt(i[1]),e=parseInt(i[2]),n=parseInt(i[3]),r=parseFloat(i[4])):(r=1,"#"!=A.charAt(0)&&((A=a.colorNameToHex(A))||(A="#000000")),4===A.length?(t=A.substring(1,2),t+=t,e=A.substring(2,3),e+=e,n=A.substring(3,4),n+=n):(t=A.substring(1,3),e=A.substring(3,5),n=A.substring(5,7)),t=parseInt(t,16),e=parseInt(e,16),n=parseInt(n,16))}return{r:t,g:e,b:n,a:r,style:A}},setFillStyle:function(A){var t=this._getRGBA(A);this.ctx.fillStyle=A,this.ctx._isFillTransparent=0===t.a,this.ctx._fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})},setStrokeStyle:function(A){var t=this._getRGBA(A);this.ctx.strokeStyle=t.style,this.ctx._isStrokeTransparent=0===t.a,this.ctx._strokeOpacity=t.a,0===t.a?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))},fillText:function(A,t,e,n){if(!this._isFillTransparent()){t=this._wrapX(t),e=this._wrapY(e);var r=this._matrix_map_point(this.ctx._transform,[t,e]);t=r[0],e=r[1];var i=57.2958*this._matrix_rotation(this.ctx._transform);if(this.ctx._clip_path.length>0){var o;(o=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).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}var s=1;try{s=this._matrix_decompose(this._getTransform()).scale[0]}catch(A){console.warn(A)}if(s<.01)this.pdf.text(A,t,this._getBaseline(e),null,i);else{var c=this.pdf.internal.getFontSize();this.pdf.setFontSize(c*s),this.pdf.text(A,t,this._getBaseline(e),null,i),this.pdf.setFontSize(c)}this.ctx._clip_path.length>0&&o.push("Q")}},strokeText:function(A,t,e,n){if(!this._isStrokeTransparent()){t=this._wrapX(t),e=this._wrapY(e);var r=this._matrix_map_point(this.ctx._transform,[t,e]);t=r[0],e=r[1];var i=57.2958*this._matrix_rotation(this.ctx._transform);if(this.ctx._clip_path.length>0){var o;(o=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).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}var s=1;try{s=this._matrix_decompose(this._getTransform()).scale[0]}catch(A){console.warn(A)}if(1===s)this.pdf.text(A,t,this._getBaseline(e),{stroke:!0},i);else{var c=this.pdf.internal.getFontSize();this.pdf.setFontSize(c*s),this.pdf.text(A,t,this._getBaseline(e),{stroke:!0},i),this.pdf.setFontSize(c)}this.ctx._clip_path.length>0&&o.push("Q")}},setFont:function(A){this.ctx.font=A;var t=/\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+(.*)?/;if(null!=(l=t.exec(A))){var e=l[1],n=l[3],r=l[4],i=l[5],o=l[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 a,s=(h=o).toLowerCase().split(/\s*,\s*/);a=-1!=s.indexOf("arial")?"Arial":-1!=s.indexOf("verdana")?"Verdana":-1!=s.indexOf("helvetica")?"Helvetica":-1!=s.indexOf("sans-serif")?"sans-serif":-1!=s.indexOf("fixed")?"Fixed":-1!=s.indexOf("monospace")?"Monospace":-1!=s.indexOf("terminal")?"Terminal":-1!=s.indexOf("courier")?"Courier":-1!=s.indexOf("times")?"Times":-1!=s.indexOf("cursive")?"Cursive":-1!=s.indexOf("fantasy")?"Fantasy":(s.indexOf("serif"),"Serif");var c;c="bold"===n?"bold":"normal",this.pdf.setFont(a,c)}else{var l=(t=/\s*(\d+)(pt|px|em)\s+([\w "]+)\s*([\w "]+)?/).exec(A);if(null!=l){var u=l[1],h=l[3];(c=l[4])||(c="normal"),u="em"===i?Math.floor(parseFloat(r)*this.pdf.getFontSize()):Math.floor(parseFloat(u)),this.pdf.setFontSize(u),this.pdf.setFont(h,c)}}},setTextBaseline:function(A){this.ctx.textBaseline=A},getTextBaseline:function(){return this.ctx.textBaseline},setTextAlign:function(A){this.ctx.textAlign=A},getTextAlign:function(){return this.ctx.textAlign},setLineWidth:function(A){this.ctx.lineWidth=A,this.pdf.setLineWidth(A)},setLineCap:function(A){this.ctx.lineCap=A,this.pdf.setLineCap(A)},setLineJoin:function(A){this.ctx.lineJoin=A,this.pdf.setLineJoin(A)},moveTo:function(A,t){A=this._wrapX(A),t=this._wrapY(t);var e=this._matrix_map_point(this.ctx._transform,[A,t]),n={type:"mt",x:A=e[0],y:t=e[1]};this.path.push(n)},_wrapX:function(A){return this.pageWrapXEnabled?A%this.pageWrapX:A},_wrapY:function(A){return this.pageWrapYEnabled?(this._gotoPage(this._page(A)),(A-this.lastBreak)%this.pageWrapY):A},transform:function(A,t,e,n,r,i){this.ctx._transform=[A,t,e,n,r,i]},setTransform:function(A,t,e,n,r,i){this.ctx._transform=[A,t,e,n,r,i]},_getTransform:function(){return this.ctx._transform},lastBreak:0,pageBreaks:[],_page:function(A){if(this.pageWrapYEnabled){this.lastBreak=0;for(var t=0,e=0,n=0;n=this.pageBreaks[n]){t++,0===this.lastBreak&&e++;var r=this.pageBreaks[n]-this.lastBreak;this.lastBreak=this.pageBreaks[n],e+=i=Math.floor(r/this.pageWrapY)}if(0===this.lastBreak){var i=Math.floor(A/this.pageWrapY)+1;e+=i}return e+t}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(A){},lineTo:function(A,t){A=this._wrapX(A),t=this._wrapY(t);var e=this._matrix_map_point(this.ctx._transform,[A,t]),n={type:"lt",x:A=e[0],y:t=e[1]};this.path.push(n)},bezierCurveTo:function(A,t,e,n,r,i){A=this._wrapX(A),t=this._wrapY(t),e=this._wrapX(e),n=this._wrapY(n),r=this._wrapX(r),i=this._wrapY(i);var o;r=(o=this._matrix_map_point(this.ctx._transform,[r,i]))[0],i=o[1];var a={type:"bct",x1:A=(o=this._matrix_map_point(this.ctx._transform,[A,t]))[0],y1:t=o[1],x2:e=(o=this._matrix_map_point(this.ctx._transform,[e,n]))[0],y2:n=o[1],x:r,y:i};this.path.push(a)},quadraticCurveTo:function(A,t,e,n){A=this._wrapX(A),t=this._wrapY(t),e=this._wrapX(e),n=this._wrapY(n);var r;e=(r=this._matrix_map_point(this.ctx._transform,[e,n]))[0],n=r[1];var i={type:"qct",x1:A=(r=this._matrix_map_point(this.ctx._transform,[A,t]))[0],y1:t=r[1],x:e,y:n};this.path.push(i)},arc:function(A,t,e,n,r,i){if(A=this._wrapX(A),t=this._wrapY(t),!this._matrix_is_identity(this.ctx._transform)){var o=this._matrix_map_point(this.ctx._transform,[A,t]);A=o[0],t=o[1];var a=this._matrix_map_point(this.ctx._transform,[0,0]),s=this._matrix_map_point(this.ctx._transform,[0,e]);e=Math.sqrt(Math.pow(s[0]-a[0],2)+Math.pow(s[1]-a[1],2))}var c={type:"arc",x:A,y:t,radius:e,startAngle:n,endAngle:r,anticlockwise:i};this.path.push(c)},drawImage:function(A,t,e,n,r,i,o,a,s){void 0!==i&&(t=i,e=o,n=a,r=s),t=this._wrapX(t),e=this._wrapY(e);var c,l=this._matrix_map_rect(this.ctx._transform,{x:t,y:e,w:n,h:r}),u=(this._matrix_map_rect(this.ctx._transform,{x:i,y:o,w:a,h:s}),/data:image\/(\w+).*/i.exec(A));c=null!=u?u[1]:"png",this.pdf.addImage(A,c,l.x,l.y,l.w,l.h)},_matrix_multiply:function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=e*A[0]+n*A[2],c=r*A[0]+i*A[2],l=o*A[0]+a*A[2]+A[4];return n=e*A[1]+n*A[3],i=r*A[1]+i*A[3],a=o*A[1]+a*A[3]+A[5],e=s,r=c,o=l,[e,n,r,i,o,a]},_matrix_rotation:function(A){return Math.atan2(A[2],A[0])},_matrix_decompose:function(A){var t=A[0],e=A[1],n=A[2],r=A[3],i=Math.sqrt(t*t+e*e),o=(t/=i)*n+(e/=i)*r;n-=t*o,r-=e*o;var a=Math.sqrt(n*n+r*r);return n/=a,r/=a,o/=a,t*r0){var A;(A=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var t=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._stroke(!0),this.ctx._clip_path=this.path,this.path=t,this._stroke(!1),A.push("Q")}else this._stroke(!1)},_stroke:function(A){if(A||!this._isStrokeTransparent()){for(var t=[],e=this.path,n=0;n0){var t;(t=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage()).push("q");var e=this.path;this.path=this.ctx._clip_path,this.ctx._clip_path=[],this._fill(A,!0),this.ctx._clip_path=this.path,this.path=e,this._fill(A,!1),t.push("Q")}else this._fill(A,!1)},_fill:function(A,t){if(!this._isFillTransparent()){var n,r="function"==typeof this.pdf.internal.newObject2;n=window.outIntercept?"group"===window.outIntercept.type?window.outIntercept.stream:window.outIntercept:this.internal.getCurrentPage();var i=[],o=window.outIntercept;if(r)switch(this.ctx.globalCompositeOperation){case"normal":case"source-over":break;case"destination-in":case"destination-out":var a=this.pdf.internal.newStreamObject(),s=this.pdf.internal.newObject2();s.push("<>"),s.push(">>"),d="MASK"+s.objId,this.pdf.internal.addGraphicsState(d,s.objId);var c="/"+d+" gs";n.splice(0,0,"q"),n.splice(1,0,c),n.push("Q"),window.outIntercept=a;break;default:var l="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];l&&this.pdf.internal.out(l+" gs")}var u=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(u=this.ctx._fillOpacity),r){var h=this.pdf.internal.newObject2();h.push("<>");var d="GS_O_"+h.objId;this.pdf.internal.addGraphicsState(d,h.objId),this.pdf.internal.out("/"+d+" gs")}for(var f=this.path,B=0;B>"),t.push(">>");var e="MASK"+t.objId;this.pdf.internal.addGraphicsState(e,t.objId);var n="/"+e+" gs";this.pdf.internal.out(n)}else console.log("jsPDF v2 not enabled")},clip:function(){if(this.ctx._clip_path.length>0)for(var A=0;Ar)&&(o%=r),o<0&&(o=r+o);t>e;)t-=r;var a=Math.abs(e-t);a1e-5;){var u=l+c*Math.min(a,i);s.push(this.createSmallArc(A,l,u)),a-=Math.abs(u-l),l=u}return s},e.internal.getCurrentPage=function(){return this.pdf.internal.pages[this.pdf.internal.getCurrentPageInfo().pageNumber]},e.internal.createSmallArc=function(A,t,e){var n=(e-t)/2,r=A*Math.cos(n),i=A*Math.sin(n),o=r,a=-i,s=o*o+a*a,c=s+o*r+a*i,l=4/3*(Math.sqrt(2*s*c)-c)/(o*i-a*r),u=o-l*a,h=a+l*o,d=u,f=-h,B=n+t,p=Math.cos(B),g=Math.sin(B);return{x1:A*Math.cos(t),y1:A*Math.sin(t),x2:u*p-h*g,y2:u*g+h*p,x3:d*p-f*g,y3:d*g+f*p,x4:A*Math.cos(e),y4:A*Math.sin(e)}}}(r.API),function(A){var t,n,r,i,o,s,c,l,u,h,d,f,B,p,g,w,m,Q,C,y;t=function(){function A(){}return function(t){return A.prototype=t,new A}}(),h=function(A){var t,e,n,r,i,o,a;for(e=0,n=A.length,t=void 0,r=!1,o=!1;!r&&e!==n;)(t=A[e]=A[e].trimLeft())&&(r=!0),e++;for(e=n-1;n&&!o&&-1!==e;)(t=A[e]=A[e].trimRight())&&(o=!0),e--;for(i=/\s+$/g,a=!0,e=0;e!==n;)"\u2028"!=A[e]&&(t=A[e].replace(/\s+/g," "),a&&(t=t.trimLeft()),t&&(a=i.test(t)),A[e]=t),e++;return A},f=function(A){var t,e,n;for(t=void 0,e=(n=A.split(",")).shift();!t&&e;)t=r[e.trim().toLowerCase()],e=n.shift();return t},B=function(A){(A="auto"===A?"0px":A).indexOf("em")>-1&&!isNaN(Number(A.replace("em","")))&&(A=18.719*Number(A.replace("em",""))+"px"),A.indexOf("pt")>-1&&!isNaN(Number(A.replace("pt","")))&&(A=1.333*Number(A.replace("pt",""))+"px");var t;return(t=p[A])?t:void 0!==(t={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[{css_line_height_string:A}])?p[A]=t/16:(t=parseFloat(A))?p[A]=t/16:3===(t=A.match(/([\d\.]+)(px)/)).length?p[A]=parseFloat(t[1])/16:p[A]=1},u=function(A){var t,e,n;return n=function(t){var e;return e=function(A){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(A,null):A.currentStyle?A.currentStyle:A.style}(A),function(A){return A=A.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()}),e[A]}}(),t={},e=void 0,t["font-family"]=f(n("font-family"))||"times",t["font-style"]=i[n("font-style")]||"normal",t["text-align"]=o[n("text-align")]||"left","bold"===(e=s[n("font-weight")]||"normal")&&("normal"===t["font-style"]?t["font-style"]=e:t["font-style"]=e+t["font-style"]),t["font-size"]=B(n("font-size"))||1,t["line-height"]=B(n("line-height"))||1,t.display="inline"===n("display")?"inline":"block",e="block"===t.display,t["margin-top"]=e&&B(n("margin-top"))||0,t["margin-bottom"]=e&&B(n("margin-bottom"))||0,t["padding-top"]=e&&B(n("padding-top"))||0,t["padding-bottom"]=e&&B(n("padding-bottom"))||0,t["margin-left"]=e&&B(n("margin-left"))||0,t["margin-right"]=e&&B(n("margin-right"))||0,t["padding-left"]=e&&B(n("padding-left"))||0,t["padding-right"]=e&&B(n("padding-right"))||0,t["page-break-before"]=n("page-break-before")||"auto",t.float=c[n("cssFloat")]||"none",t.clear=l[n("clear")]||"none",t.color=n("color"),t},g=function(A,t,e){var n,r,i,o,a;if(i=!1,r=void 0,o=void 0,n=e["#"+A.id])if("function"==typeof n)i=n(A,t);else for(r=0,o=n.length;!i&&r!==o;)i=n[r](A,t),r++;if(n=e[A.nodeName],!i&&n)if("function"==typeof n)i=n(A,t);else for(r=0,o=n.length;!i&&r!==o;)i=n[r](A,t),r++;for(a=A.className?A.className.split(" "):[],r=0;rr.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(o));var x=u(o),_=r.x,I=12/r.pdf.internal.scaleFactor,T=(x["margin-left"]+x["padding-left"])*I,S=(x["margin-right"]+x["padding-right"])*I,N=(x["margin-top"]+x["padding-top"])*I,O=(x["margin-bottom"]+x["padding-bottom"])*I;void 0!==x.float&&"right"===x.float?_+=r.settings.width-o.width-S:_+=T,r.pdf.addImage(b,_,r.y+N,o.width,o.height),b=void 0,"right"===x.float||"left"===x.float?(r.watchFunctions.push(function(A,t,e,n){return r.y>=t?(r.x+=A,r.settings.width+=e,!0):!!(n&&1===n.nodeType&&!v[n.nodeName]&&r.x+n.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width)&&(r.x+=A,r.y=t,r.settings.width+=e,!0)}.bind(this,"left"===x.float?-o.width-T-S:0,r.y+o.height+N+O,o.width)),r.watchFunctions.push(function(A,t,e){return!(r.y0){r=r[0];var i=t.pdf.internal.write,o=t.y;t.pdf.internal.write=function(){},n(r,t,e);var a=Math.ceil(t.y-o)+5;t.y=o,t.pdf.internal.write=i,t.pdf.margins_doc.bottom+=a;for(var s=function(A){var i=void 0!==A?A.pageNumber:1,o=t.y;t.y=t.pdf.internal.pageSize.height-t.pdf.margins_doc.bottom,t.pdf.margins_doc.bottom-=a;for(var s=r.getElementsByTagName("span"),c=0;c-1&&(s[c].innerHTML=i),(" "+s[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(s[c].innerHTML="###jsPDFVarTotalPages###");n(r,t,e),t.pdf.margins_doc.bottom+=a,t.y=o},c=r.getElementsByTagName("span"),l=0;l-1&&t.pdf.internal.events.subscribe("htmlRenderingFinished",t.pdf.putTotalPages.bind(t.pdf,"###jsPDFVarTotalPages###"),!0);t.pdf.internal.events.subscribe("addPage",s,!1),s(),v.FOOTER=1}},C=function(A,t,e,r,i,o){if(!t)return!1;"string"==typeof t||t.parentNode||(t=""+t.innerHTML),"string"==typeof t&&(t=function(A){var t,e,n,r;return n="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),r="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;",e=document.createElement("div"),e.style.cssText=r,e.innerHTML='