UNPKG

highcharts

Version:
43 lines 228 kB
!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={};t["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};/** @preserve * jsPDF - PDF Document creation from JavaScript * Version 1.2.68 Built on 2017-07-18T14:26:07.334Z * CommitID 38732db74a * * Copyright (c) 2010-2014 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF * 2010 Aaron Spike, https://github.com/acspike * 2012 Willow Systems Corporation, willow-systems.com * 2012 Pablo Hess, https://github.com/pablohess * 2012 Florian Jenett, https://github.com/fjenett * 2013 Warren Weckesser, https://github.com/warrenweckesser * 2013 Youssef Beddad, https://github.com/lifof * 2013 Lee Driscoll, https://github.com/lsdriscoll * 2013 Stefan Slonevskiy, https://github.com/stefslon * 2013 Jeremy Morel, https://github.com/jmorel * 2013 Christoph Hartmann, https://github.com/chris-rock * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria * 2014 James Makes, https://github.com/dollaruw * 2014 Diego Casorran, https://github.com/diegocr * 2014 Steven Spungin, https://github.com/Flamenco * 2014 Kenneth Glassey, https://github.com/Gavvers * * Licensed under the MIT License * * Contributor(s): * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, * kim3er, mfo, alnorth, Flamenco */ var e=function(e){function n(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 a in n[r]){var s=n[r][a];try{s[0].apply(t,i)}catch(c){e.console&&console.error("jsPDF PubSub Error",c.message,c)}s[1]&&o.push(a)}o.length&&o.forEach(this.unsubscribe)}}}function o(u,l,h,f){var d={};"object"===("undefined"==typeof u?"undefined":t["typeof"](u))&&(d=u,u=d.orientation,l=d.unit||l,h=d.format||h,f=d.compress||d.compressPdf||f),l=l||"mm",h=h||"a4",u=(""+(u||"P")).toLowerCase();var p,m,g,w,y,v,b,x,k,S,C,A=((""+h).toLowerCase(),!!f&&"function"==typeof Uint8Array),q=d.textColor||"0 g",_=d.drawColor||"0 G",P=d.fontSize||16,T=d.lineHeight||1.15,E=d.lineWidth||.200025,I=2,O=!1,F=[],B={},R={},j=[],D={},N={},z={},L={},M=null,U=0,H=[],W=[],X=[],V=[],Y=[],G=0,J=0,Q=0,K={},$={},Z=[],tt={title:"",subject:"",author:"",keywords:"",creator:""},et={},nt=new n(et),rt=function(t){return t.toFixed(2)},it=function(t){return t.toFixed(3)},ot=function(t){return("0"+parseInt(t)).slice(-2)},at=function(t){var e="00"+t;return e.substr(e.length-2)},st=function(t){O?H[g].push(t):(Q+=t.length+1,V.push(t))},ct=function(){return I++,F[I]=Q,st(I+" 0 obj"),I},ut=function(){var t=2*H.length+1;t+=Y.length;var e={objId:t,content:""};return Y.push(e),e},lt=function(){return I++,F[I]=function(){return Q},I},ht=function(t){F[t]=Q},ft=function(t){st("stream"),st(t),st("endstream")},dt=function(){var t,n,r,i,s,c,u,l,h;for(u=e.adler32cs||o.adler32cs,A&&"undefined"==typeof u&&(A=!1),t=1;U>=t;t++){if(ct(),l=(b=X[t].width)*m,h=(x=X[t].height)*m,st("<</Type /Page"),st("/Parent 1 0 R"),st("/Resources 2 0 R"),st("/MediaBox [0 0 "+rt(l)+" "+rt(h)+"]"),nt.publish("putPage",{pageNumber:t,page:H[t]}),st("/Contents "+(I+1)+" 0 R"),st(">>"),st("endobj"),n=H[t].join("\n"),n=new Rt(m,0,0,-m,0,x).toString()+" cm\n"+n,ct(),A){for(r=[],i=n.length;i--;)r[i]=n.charCodeAt(i);c=u.from(n),s=new a(6),s.append(new Uint8Array(r)),n=s.flush(),r=new Uint8Array(n.length+6),r.set(new Uint8Array([120,156])),r.set(n,2),r.set(new Uint8Array([255&c,c>>8&255,c>>16&255,c>>24&255]),n.length+2),n=String.fromCharCode.apply(null,r),st("<</Length "+n.length+" /Filter [/FlateDecode]>>")}else st("<</Length "+n.length+">>");ft(n),st("endobj")}F[1]=Q,st("1 0 obj"),st("<</Type /Pages");var f="/Kids [";for(i=0;U>i;i++)f+=3+2*i+" 0 R ";st(f+"]"),st("/Count "+U),st(">>"),st("endobj"),nt.publish("postPutPages")},pt=function(t){t.objectNumber=ct(),st("<</BaseFont/"+t.PostScriptName+"/Type/Font"),"string"==typeof t.encoding&&st("/Encoding/"+t.encoding),st("/Subtype/Type1>>"),st("endobj")},mt=function(){for(var t in B)B.hasOwnProperty(t)&&pt(B[t])},gt=function(t){t.objectNumber=ct(),st("<<"),st("/Type /XObject"),st("/Subtype /Form"),st("/BBox ["+[rt(t.x),rt(t.y),rt(t.x+t.width),rt(t.y+t.height)].join(" ")+"]"),st("/Matrix ["+t.matrix.toString()+"]");var e=t.pages[1].join("\n");st("/Length "+e.length),st(">>"),ft(e),st("endobj")},wt=function(){for(var t in K)K.hasOwnProperty(t)&&gt(K[t])},yt=function(t,e){var n,r=[],i=1/(e-1);for(n=0;1>n;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var o={offset:0,color:t[0].color};t.unshift(o)}if(1!=t[t.length-1].offset){var a={offset:1,color:t[t.length-1].color};t.push(a)}for(var s="",c=0,u=0;u<r.length;u++){for(n=r[u];n>t[c+1].offset;)c++;var l=t[c].offset,h=t[c+1].offset,f=(n-l)/(h-l),d=t[c].color,p=t[c+1].color;s+=at(Math.round((1-f)*d[0]+f*p[0]).toString(16))+at(Math.round((1-f)*d[1]+f*p[1]).toString(16))+at(Math.round((1-f)*d[2]+f*p[2]).toString(16))}return s.trim()},vt=function(t,e){e||(e=21);var n=ct(),r=yt(t.colors,e);st("<< /FunctionType 0"),st("/Domain [0.0 1.0]"),st("/Size ["+e+"]"),st("/BitsPerSample 8"),st("/Range [0.0 1.0 0.0 1.0 0.0 1.0]"),st("/Decode [0.0 1.0 0.0 1.0 0.0 1.0]"),st("/Length "+r.length),st("/Filter /ASCIIHexDecode"),st(">>"),ft(r),st("endobj"),t.objectNumber=ct(),st("<< /ShadingType "+t.type),st("/ColorSpace /DeviceRGB");var i="/Coords ["+it(parseFloat(t.coords[0]))+" "+it(parseFloat(t.coords[1]))+" ";i+=2===t.type?it(parseFloat(t.coords[2]))+" "+it(parseFloat(t.coords[3])):it(parseFloat(t.coords[2]))+" "+it(parseFloat(t.coords[3]))+" "+it(parseFloat(t.coords[4]))+" "+it(parseFloat(t.coords[5])),i+="]",st(i),t.matrix&&st("/Matrix ["+t.matrix.toString()+"]"),st("/Function "+n+" 0 R"),st("/Extend [true true]"),st(">>"),st("endobj")},bt=function(t){var e=ct();st("<<"),Pt(),st(">>"),st("endobj"),t.objectNumber=ct(),st("<< /Type /Pattern"),st("/PatternType 1"),st("/PaintType 1"),st("/TilingType 1"),st("/BBox ["+t.boundingBox.map(it).join(" ")+"]"),st("/XStep "+it(t.xStep)),st("/YStep "+it(t.yStep)),st("/Length "+t.stream.length),st("/Resources "+e+" 0 R"),t.matrix&&st("/Matrix ["+t.matrix.toString()+"]"),st(">>"),ft(t.stream),st("endobj")},xt=function(){var t;for(t in D)D.hasOwnProperty(t)&&(D[t]instanceof et.ShadingPattern?vt(D[t]):D[t]instanceof et.TilingPattern&&bt(D[t]))},kt=function(t){t.objectNumber=ct(),st("<<");for(var e in t)switch(e){case"opacity":st("/ca "+rt(t[e]))}st(">>"),st("endobj")},St=function(){var t;for(t in z)z.hasOwnProperty(t)&&kt(z[t])},Ct=function(){for(var t in K)K.hasOwnProperty(t)&&K[t].objectNumber>=0&&st("/"+t+" "+K[t].objectNumber+" 0 R");nt.publish("putXobjectDict")},At=function(){for(var t in D)D.hasOwnProperty(t)&&D[t]instanceof et.ShadingPattern&&D[t].objectNumber>=0&&st("/"+t+" "+D[t].objectNumber+" 0 R");nt.publish("putShadingPatternDict")},qt=function(){for(var t in D)D.hasOwnProperty(t)&&D[t]instanceof et.TilingPattern&&D[t].objectNumber>=0&&st("/"+t+" "+D[t].objectNumber+" 0 R");nt.publish("putTilingPatternDict")},_t=function(){var t;for(t in z)z.hasOwnProperty(t)&&z[t].objectNumber>=0&&st("/"+t+" "+z[t].objectNumber+" 0 R");nt.publish("putGStateDict")},Pt=function(){st("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),st("/Font <<");for(var t in B)B.hasOwnProperty(t)&&st("/"+t+" "+B[t].objectNumber+" 0 R");st(">>"),st("/Shading <<"),At(),st(">>"),st("/Pattern <<"),qt(),st(">>"),st("/ExtGState <<"),_t(),st(">>"),st("/XObject <<"),Ct(),st(">>")},Tt=function(){mt(),St(),wt(),xt(),nt.publish("putResources"),F[2]=Q,st("2 0 obj"),st("<<"),Pt(),st(">>"),st("endobj"),nt.publish("postPutResources")},Et=function(){nt.publish("putAdditionalObjects");for(var t=0;t<Y.length;t++){var e=Y[t];F[e.objId]=Q,st(e.objId+" 0 obj"),st(e.content),st("endobj")}I+=Y.length,nt.publish("postPutAdditionalObjects")},It=function(t,e,n){R.hasOwnProperty(e)||(R[e]={}),R[e][n]=t},Ot=function(t,e,n,r){var i="F"+(Object.keys(B).length+1).toString(10),o=B[i]={id:i,PostScriptName:t,fontName:e,fontStyle:n,encoding:r,metadata:{}};return It(i,e,n),nt.publish("addFont",o),i},Ft=function(){for(var t="helvetica",e="times",n="courier",r="normal",i="bold",o="italic",a="bolditalic",s="StandardEncoding",c="zapfdingbats",u=[["Helvetica",t,r],["Helvetica-Bold",t,i],["Helvetica-Oblique",t,o],["Helvetica-BoldOblique",t,a],["Courier",n,r],["Courier-Bold",n,i],["Courier-Oblique",n,o],["Courier-BoldOblique",n,a],["Times-Roman",e,r],["Times-Bold",e,i],["Times-Italic",e,o],["Times-BoldItalic",e,a],["ZapfDingbats",c]],l=0,h=u.length;h>l;l++){var f=Ot(u[l][0],u[l][1],u[l][2],s),d=u[l][0].split("-");It(f,d[0],d[1]||"")}nt.publish("addFonts",{fonts:B,dictionary:R})},Bt=function(t,e){return new Rt(t.a*e.a+t.b*e.c,t.a*e.b+t.b*e.d,t.c*e.a+t.d*e.c,t.c*e.b+t.d*e.d,t.e*e.a+t.f*e.c+e.e,t.e*e.b+t.f*e.d+e.f)},Rt=function(t,e,n,r,i,o){this.a=t,this.b=e,this.c=n,this.d=r,this.e=i,this.f=o};Rt.prototype={toString:function(){return[it(this.a),it(this.b),it(this.c),it(this.d),it(this.e),it(this.f)].join(" ")}};var jt=new Rt(1,0,0,1,0,0),Dt=function(){this.page=U,this.currentPage=g,this.pages=H.slice(0),this.pagedim=X.slice(0),this.pagesContext=W.slice(0),this.x=w,this.y=y,this.matrix=v,this.width=b,this.height=x,this.id="",this.objectNumber=-1};Dt.prototype={restore:function(){U=this.page,g=this.currentPage,W=this.pagesContext,X=this.pagedim,H=this.pages,w=this.x,y=this.y,v=this.matrix,b=this.width,x=this.height}};var Nt=function(t,e,n,r,i){Z.push(new Dt),U=g=0,H=[],w=t,y=e,v=i,Gt(n,r)},zt=function(t){if(!$[t]){var e=new Dt,n="Xo"+(Object.keys(K).length+1).toString(10);e.id=n,$[t]=n,K[n]=e,nt.publish("addFormObject",e),Z.pop().restore()}},Lt=function(t,e){if(!N[t]){var n=e instanceof et.ShadingPattern?"Sh":"P",r=n+(Object.keys(D).length+1).toString(10);e.id=r,N[t]=r,D[r]=e,nt.publish("addPattern",e)}},Mt=function(t,e){if(!t||!L[t]){var n=!1;for(var r in z)if(z.hasOwnProperty(r)&&z[r].equals(e)){n=!0;break}if(n)e=z[r];else{var i="GS"+(Object.keys(z).length+1).toString(10);z[i]=e,e.id=i}return t&&(L[t]=e.id),nt.publish("addGState",e),e}},Ut=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(n){var r=n.stack||"";~r.indexOf(" at ")&&(r=r.split(" at ")[1]);var i="Error in function "+r.split("\n")[0].split("<")[0]+": "+n.message;if(!e.console)throw new Error(i);e.console.error(i,n),e.alert&&alert(i)}},t.foo.bar=t,t.foo},Ht=function(t,e){var n,r,i,o,a,s,c,u,l;if(e=e||{},i=e.sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&B[p].metadata&&B[p].metadata[i]&&B[p].metadata[i].encoding&&(o=B[p].metadata[i].encoding,!a&&B[p].encoding&&(a=B[p].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(c=!1,s=[],n=0,r=t.length;r>n;n++)u=a[t.charCodeAt(n)],u?s.push(String.fromCharCode(u)):s.push(t[n]),s[n].charCodeAt(0)>>8&&(c=!0);t=s.join("")}for(n=t.length;void 0===c&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;r>n;n++){if(u=t.charCodeAt(n),l=u>>8,l>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(l),s.push(u-(l<<8))}return String.fromCharCode.apply(void 0,s)},Wt=function(t,e){return Ht(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Xt=function(){st("/Producer (jsPDF "+o.version+")");for(var t in tt)tt.hasOwnProperty(t)&&tt[t]&&st("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+Wt(tt[t])+")");var e=new Date,n=e.getTimezoneOffset(),r=0>n?"+":"-",i=Math.floor(Math.abs(n/60)),a=Math.abs(n%60),s=[r,ot(i),"'",ot(a),"'"].join("");st(["/CreationDate (D:",e.getFullYear(),ot(e.getMonth()+1),ot(e.getDate()),ot(e.getHours()),ot(e.getMinutes()),ot(e.getSeconds()),s,")"].join(""))},Vt=function(){switch(st("/Type /Catalog"),st("/Pages 1 0 R"),S||(S="fullwidth"),S){case"fullwidth":st("/OpenAction [3 0 R /FitH null]");break;case"fullheight":st("/OpenAction [3 0 R /FitV null]");break;case"fullpage":st("/OpenAction [3 0 R /Fit]");break;case"original":st("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+S;"%"===t.substr(t.length-1)&&(S=parseInt(S)/100),"number"==typeof S&&st("/OpenAction [3 0 R /XYZ null null "+rt(S)+"]")}switch(C||(C="continuous"),C){case"continuous":st("/PageLayout /OneColumn");break;case"single":st("/PageLayout /SinglePage");break;case"two":case"twoleft":st("/PageLayout /TwoColumnLeft");break;case"tworight":st("/PageLayout /TwoColumnRight")}k&&st("/PageMode /"+k),nt.publish("putCatalog")},Yt=function(){st("/Size "+(I+1)),st("/Root "+I+" 0 R"),st("/Info "+(I-1)+" 0 R")},Gt=function(t,e){"string"==typeof e&&e.toLowerCase();if("string"==typeof t){var n=t.toLowerCase();c.hasOwnProperty(n)&&(t=c[n][0]/m,e=c[n][1]/m)}Array.isArray(t)&&(e=t[1],t=t[0]),O=!0,H[++U]=[],X[U]={width:Number(t)||b,height:Number(e)||x},W[U]={},Kt(U)},Jt=function(){Gt.apply(this,arguments),st(rt(E)+" w"),st(_),0!==G&&st(G+" J"),0!==J&&st(J+" j"),nt.publish("addPage",{pageNumber:U})},Qt=function(t){t>0&&U>=t&&(H.splice(t,1),X.splice(t,1),U--,g>U&&(g=U),this.setPage(g))},Kt=function(t){t>0&&U>=t&&(g=t,b=X[t].width,x=X[t].height)},$t=function(t,e){var n;switch(t=void 0!==t?t:B[p].fontName,e=void 0!==e?e:B[p].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=R[t][e]}catch(r){}return n||(n=R.times[e],null==n&&(n=R.times.normal)),n},Zt=function(){O=!1,I=2,V=[],F=[],Y=[],st("%PDF-"+s),dt(),Et(),Tt(),ct(),st("<<"),Xt(),st(">>"),st("endobj"),ct(),st("<<"),Vt(),st(">>"),st("endobj");var t,e=Q,n="0000000000";for(st("xref"),st("0 "+(I+1)),st(n+" 65535 f "),t=1;I>=t;t++){var r=F[t];st("function"==typeof r?(n+F[t]()).slice(-10)+" 00000 n ":(n+F[t]).slice(-10)+" 00000 n ")}return st("trailer"),st("<<"),Yt(),st(">>"),st("startxref"),st(e),st("%%EOF"),O=!0,V.join("\n")},te=function(t){var e="n";return"D"===t?e="S":"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e},ee=function(t,e,n){if(t=te(t),!e)return void st(t);n||(n=jt);var r=N[e],i=D[r];if(i instanceof et.ShadingPattern)st("q"),st("W "+t),i.gState&&et.setGState(i.gState),st(n.toString()+" cm"),st("/"+r+" sh"),st("Q");else if(i instanceof et.TilingPattern){var o=new Rt(1,0,0,-1,0,x);n.matrix&&(o=Bt(n.matrix||jt,o),r=i.createClone(e,n.boundingBox,n.xStep,n.yStep,o).id),st("q"),st("/Pattern cs"),st("/"+r+" scn"),i.gState&&et.setGState(i.gState),st(t),st("Q")}},ne=function(){for(var t=Zt(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},re=function(){return new Blob([ne()],{type:"application/pdf"})},ie=Ut(function(t,n){var i="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(Zt()):0;switch(t){case void 0:return Zt();case"save":if(navigator.getUserMedia&&(void 0===e.URL||void 0===e.URL.createObjectURL))return et.output("dataurlnewwindow");r(re(),n),"function"==typeof r.unload&&e.setTimeout&&setTimeout(r.unload,911);break;case"arraybuffer":return ne();case"blob":return re();case"bloburi":case"bloburl":return e.URL&&e.URL.createObjectURL(re())||void 0;case"datauristring":case"dataurlstring":return i;case"dataurlnewwindow":var o=e.open(i);if(o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return e.document.location.href=i;default:throw new Error('Output type "'+t+'" is not supported.')}});switch(l){case"pt":m=1;break;case"mm":m=72/25.4000508;break;case"cm":m=72/2.54000508;break;case"in":m=72;break;case"px":m=96/72;break;case"pc":m=12;break;case"em":m=12;break;case"ex":m=6;break;default:throw"Invalid unit: "+l}et.internal={pdfEscape:Wt,getStyle:te,getFont:function(){return B[$t.apply(et,arguments)]},getFontSize:function(){return P},getLineHeight:function(){return P*T},write:function(t){st(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return rt(t)},getVerticalCoordinateString:function(t){return rt(t)},collections:{},newObject:ct,newAdditionalObject:ut,newObjectDeferred:lt,newObjectDeferredBegin:ht,putStream:ft,events:nt,scaleFactor:m,pageSize:{get width(){return b},get height(){return x}},output:function(t,e){return ie(t,e)},getNumberOfPages:function(){return H.length-1},pages:H,out:st,f2:rt,getPageInfo:function(t){var e=2*(t-1)+3;return{objId:e,pageNumber:t,pageContext:W[t]}},getCurrentPageInfo:function(){var t=2*(g-1)+3;return{objId:t,pageNumber:g,pageContext:W[g]}},getPDFVersion:function(){return s}},et.GState=function(e){var n="opacity";for(var r in e)e.hasOwnProperty(r)&&n.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1,this.equals=function(e){var n="id,objectNumber,equals";if(!e||("undefined"==typeof e?"undefined":t["typeof"](e))!==t["typeof"](this))return!1;var r=0;for(var i in this)if(!(n.indexOf(i)>=0)){if(this.hasOwnProperty(i)&&!e.hasOwnProperty(i))return!1;if(this[i]!==e[i])return!1;r++}for(var i in e)e.hasOwnProperty(i)&&n.indexOf(i)<0&&r--;return 0===r}},et.addGState=function(t,e){return Mt(t,e),this},et.addPage=function(){return Jt.apply(this,arguments),this},et.setPage=function(){return Kt.apply(this,arguments),this},et.insertPage=function(t){return this.addPage(),this.movePage(g,t),this},et.movePage=function(t,e){var n,r,i,o;if(t>e){for(i=H[t],r=X[t],n=W[t],o=t;o>e;o--)H[o]=H[o-1],X[o]=X[o-1],W[o]=W[o-1];H[e]=i,X[e]=r,W[e]=n,this.setPage(e)}else if(e>t){for(i=H[t],r=X[t],n=W[t],o=t;e>o;o++)H[o]=H[o+1],X[o]=X[o+1],W[o]=W[o+1];H[e]=i,X[e]=r,W[e]=n,this.setPage(e)}return this},et.deletePage=function(){return Qt.apply(this,arguments),this},et.setDisplayMode=function(t,e,n){return S=t,C=e,k=n,this},et.saveGraphicsState=function(){return st("q"),j.push({key:p,size:P}),this},et.restoreGraphicsState=function(){st("Q");var t=j.pop();return p=t.key,P=t.size,M=null,this},et.setCurrentTransformationMatrix=function(t){return st(t.toString()+" cm"),this},et.beginFormObject=function(t,e,n,r,i){return Nt(t,e,n,r,i),this},et.endFormObject=function(t){return zt(t),this},et.doFormObject=function(t,e){var n=K[$[t]];return st("q"),st(e.toString()+" cm"),st("/"+n.id+" Do"),st("Q"),this},et.getFormObject=function(t){var e=K[$[t]];return{x:e.x,y:e.y,width:e.width,height:e.height,matrix:e.matrix}},et.Matrix=Rt,et.matrixMult=Bt,et.unitMatrix=jt;var oe=function(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1};et.ShadingPattern=function(t,e,n,r,i){this.type="axial"===t?2:3,this.coords=e,this.colors=n,oe.call(this,r,i)},et.TilingPattern=function(t,e,n,r,i){this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,oe.call(this,r,i)},et.TilingPattern.prototype={createClone:function(t,e,n,r,i){var o=new et.TilingPattern(e||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);o.stream=this.stream;var a=t+"$$"+this.cloneIndex++ +"$$";return Lt(a,o),o}},et.addShadingPattern=function(t,e){return Lt(t,e),this},et.beginTilingPattern=function(t){Nt(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},et.endTilingPattern=function(t,e){e.stream=H[g].join("\n"),Lt(t,e),nt.publish("endTilingPattern",e),Z.pop().restore()},et.text=function(t,e,n,r,o,a){function s(t){return t=t.split(" ").join(Array(d.TabLen||9).join(" ")),Wt(t,r)}if("number"==typeof t){var c=n;n=e,e=t,t=c}"string"==typeof t&&(t=t.match(/[\n\r]/)?t.split(/\r\n|\r|\n/g):[t]),"string"==typeof o&&(a=o,o=null),"string"==typeof r&&(a=r,r=null),"number"==typeof r&&(o=r,r=null);var u;if(o&&"number"==typeof o){o*=Math.PI/180;var l=Math.cos(o),h=Math.sin(o);o=new Rt(l,h,-h,l,0,0)}else o||(o=jt);r=r||{},"noBOM"in r||(r.noBOM=!0),"autoencode"in r||(r.autoencode=!0);var f="",p=this.internal.getCurrentPageInfo().pageContext;if(!0===r.stroke?p.lastTextWasStroke!==!0&&(f="1 Tr\n",p.lastTextWasStroke=!0):(p.lastTextWasStroke&&(f="0 Tr\n"),p.lastTextWasStroke=!1),"undefined"==typeof 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 m=t.concat(),g=[],w=m.length;w--;)g.push(s(m.shift()));var y=Math.ceil((n-this._runningPageHeight)/(P*T));if(y>=0&&y<g.length+1,a){var v,b,x,k=P*T,S=t.map(function(t){return this.getStringUnitWidth(t)*P},this);if(x=Math.max.apply(Math,S),"center"===a)v=e-x/2,e-=S[0]/2;else{if("right"!==a)throw new Error('Unrecognized alignment option, use "center" or "right".');v=e-x,e-=S[0]}for(b=e,t=g[0]+") Tj\n",i=1,w=g.length;i<w;i++){var C=x-S[i];"center"===a&&(C/=2),t+=v-b+C+" -"+k+" Td ("+g[i],b=v+C,i<w-1&&(t+=") Tj\n")}}else t=g.join(") Tj\nT* (")}var A;u||(A=rt(n));var q=new Rt(1,0,0,-1,e,A);o=Bt(q,o);var _=o.toString()+" Tm";return st("BT\n"+P*T+" TL\n"+f+_+"\n("+t+") Tj\nET"),u&&this.text(u,e,n),this},et.lstext=function(t,e,n,r){for(var i=0,o=t.length;o>i;i++,e+=r)this.text(t[i],e,n)},et.line=function(t,e,n,r){return this.lines([[n-t,r-e]],t,e,[1,1],"D")},et.clip=function(){st("W"),st("S")},et.lines=function(t,e,n,r,i,o,a,s){var c,u,l,h,f,d,p,m,g,w,y;if("number"==typeof t){var v=n;n=e,e=t,t=v}for(r=r||[1,1],st(it(e)+" "+it(n)+" m "),c=r[0],u=r[1],h=t.length,w=e,y=n,l=0;h>l;l++)f=t[l],2===f.length?(w=f[0]*c+w,y=f[1]*u+y,st(it(w)+" "+it(y)+" l")):(d=f[0]*c+w,p=f[1]*u+y,m=f[2]*c+w,g=f[3]*u+y,w=f[4]*c+w,y=f[5]*u+y,st(it(d)+" "+it(p)+" "+it(m)+" "+it(g)+" "+it(w)+" "+it(y)+" c"));return o&&st("h"),ee(i,a,s),this},et.path=function(t,e,n,r){for(var i=0;i<t.length;i++){var o=t[i],a=o.c;switch(o.op){case"m":st(it(a[0])+" "+it(a[1])+" m");break;case"l":st(it(a[0])+" "+it(a[1])+" l");break;case"c":st([it(a[0]),it(a[1]),it(a[2]),it(a[3]),it(a[4]),it(a[5]),"c"].join(" "));break;case"h":st("h")}}return ee(e,n,r),this},et.rect=function(t,e,n,r,i,o,a){return st([rt(t),rt(e),rt(n),rt(-r),"re"].join(" ")),ee(i,o,a),this},et.triangle=function(t,e,n,r,i,o,a,s,c){return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],a,!0,s,c),this},et.roundedRect=function(t,e,n,r,i,o,a,s,c){var u=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),o=Math.min(o,.5*r),this.lines([[n-2*i,0],[i*u,0,i,o-o*u,i,o],[0,r-2*o],[0,o*u,-(i*u),o,-i,o],[-n+2*i,0],[-(i*u),0,-i,-(o*u),-i,-o],[0,-r+2*o],[0,-(o*u),i*u,-o,i,-o]],t+i,e,[1,1],a,!0,s,c),this},et.ellipse=function(t,e,n,r,i,o,a){var s=4/3*(Math.SQRT2-1)*n,c=4/3*(Math.SQRT2-1)*r;return st([rt(t+n),rt(e),"m",rt(t+n),rt(e-c),rt(t+s),rt(e-r),rt(t),rt(e-r),"c"].join(" ")),st([rt(t-s),rt(e-r),rt(t-n),rt(e-c),rt(t-n),rt(e),"c"].join(" ")),st([rt(t-n),rt(e+c),rt(t-s),rt(e+r),rt(t),rt(e+r),"c"].join(" ")),st([rt(t+s),rt(e+r),rt(t+n),rt(e+c),rt(t+n),rt(e),"c"].join(" ")),ee(i,o,a),this},et.circle=function(t,e,n,r,i,o){return this.ellipse(t,e,n,n,r,i,o)},et.setProperties=function(t){for(var e in tt)tt.hasOwnProperty(e)&&t[e]&&(tt[e]=t[e]);return this},et.setFontSize=function(t){return P=t,st("/"+p+" "+P+" Tf"),this},et.getFontSize=function(){return P},et.setFont=function(t,e){return p=$t(t,e),st("/"+p+" "+P+" Tf"),this},et.setFontStyle=et.setFontType=function(t){return p=$t(void 0,t),this},et.getFontList=function(){var t,e,n,r={};for(t in R)if(R.hasOwnProperty(t)){r[t]=n=[];for(e in R[t])R[t].hasOwnProperty(e)&&n.push(e)}return r},et.addFont=function(t,e,n){Ot(t,e,n,"StandardEncoding")},et.setLineWidth=function(t){return st(t.toFixed(2)+" w"),this},et.setDrawColor=function(t,e,n,r){var i;return i=void 0===e||void 0===r&&t===e===n?"string"==typeof t?t+" G":rt(t/255)+" G":void 0===r?"string"==typeof t?[t,e,n,"RG"].join(" "):[rt(t/255),rt(e/255),rt(n/255),"RG"].join(" "):"string"==typeof t?[t,e,n,r,"K"].join(" "):[rt(t),rt(e),rt(n),rt(r),"K"].join(" "),st(i),this},et.setFillColor=function(e,n,r,i){var o;return void 0===n||void 0===i&&e===n===r?o="string"==typeof e?e+" g":rt(e/255)+" g":void 0===i||"object"===("undefined"==typeof i?"undefined":t["typeof"](i))?(o="string"==typeof e?[e,n,r,"rg"].join(" "):[rt(e/255),rt(n/255),rt(r/255),"rg"].join(" "),i&&0===i.a&&(o=["255","255","255","rg"].join(" "))):o="string"==typeof e?[e,n,r,i,"k"].join(" "):[rt(e),rt(n),rt(r),rt(i),"k"].join(" "),st(o),this},et.setTextColor=function(t,e,n){if("string"==typeof t&&/^#[0-9A-Fa-f]{6}$/.test(t)){var r=parseInt(t.substr(1),16);t=r>>16&255,e=r>>8&255,n=255&r}return q=0===t&&0===e&&0===n||"undefined"==typeof e?it(t/255)+" g":[it(t/255),it(e/255),it(n/255),"rg"].join(" "),st(q),this},et.setGState=function(t){t="string"==typeof t?z[L[t]]:Mt(null,t),t.equals(M)||(st("/"+t.id+" gs"),M=t)},et.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},et.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 G=e,st(e+" J"),this},et.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 J=e,st(e+" j"),this},et.setLineMiterLimit=function(t){return st(rt(t)+" M"),this},et.setLineDashPattern=function(t,e){return st(["["+(void 0!==t[0]?t[0]:""),(void 0!==t[1]?t[1]:"")+"]",e,"d"].join(" ")),this},et.output=ie,et.save=function(t){et.output("save",t)};for(var ae in o.API)o.API.hasOwnProperty(ae)&&("events"===ae&&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))}(nt,o.API.events):et[ae]=o.API[ae]);return Ft(),p="F1",Jt(h,u),nt.publish("initialized"),et}var s="1.3",c={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]};return o.API={events:[]},o.version="1.2.68 2017-07-18T14:26:07.334Z:minint-e5ltq7i\vasilcenko","function"==typeof define&&define.amd?define("jsPDF",function(){return o}):"undefined"!=typeof module&&module.exports?module.exports=o:e.jsPDF=o,o}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this);/** * jsPDF AcroForm Plugin * Copyright (c) 2016 Alexander Weidt, https://github.com/BiggA94 * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ (window.AcroForm=function(t){var n=window.AcroForm;n.scale=function(t){return t*(r.internal.scaleFactor/1)},n.antiScale=function(t){return 1/r.internal.scaleFactor*t};var r={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null};e.API.acroformPlugin=r;var i=function(){for(var t in this.acroformPlugin.acroFormDictionaryRoot.Fields){var e=this.acroformPlugin.acroFormDictionaryRoot.Fields[t];e.hasAnnotation&&a.call(this,e)}},o=function(){if(this.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");this.acroformPlugin.acroFormDictionaryRoot=new n.AcroFormDictionary,this.acroformPlugin.internal=this.internal,this.acroformPlugin.acroFormDictionaryRoot._eventID=this.internal.events.subscribe("postPutResources",u),this.internal.events.subscribe("buildDocument",i),this.internal.events.subscribe("putCatalog",c),this.internal.events.subscribe("postPutPages",l)},a=function(t){var n={type:"reference",object:t};e.API.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(n)},s=function(t){this.acroformPlugin.printedOut&&(this.acroformPlugin.printedOut=!1,this.acroformPlugin.acroFormDictionaryRoot=null),this.acroformPlugin.acroFormDictionaryRoot||o.call(this),this.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},c=function(){"undefined"!=typeof this.acroformPlugin.acroFormDictionaryRoot?this.internal.write("/AcroForm "+this.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...")},u=function(){this.internal.events.unsubscribe(this.acroformPlugin.acroFormDictionaryRoot._eventID),delete this.acroformPlugin.acroFormDictionaryRoot._eventID,this.acroformPlugin.printedOut=!0},l=function(t){var e=!t;t||(this.internal.newObjectDeferredBegin(this.acroformPlugin.acroFormDictionaryRoot.objId),this.internal.out(this.acroformPlugin.acroFormDictionaryRoot.getString()));var t=t||this.acroformPlugin.acroFormDictionaryRoot.Kids;for(var r in t){var i=t[r],o=i.Rect;i.Rect&&(i.Rect=n.internal.calculateCoordinates.call(this,i.Rect)),this.internal.newObjectDeferredBegin(i.objId);var a="";if(a+=i.objId+" 0 obj\n",a+="<<\n"+i.getContent(),i.Rect=o,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=n.internal.calculateAppearanceStream.call(this,i);a+="/AP << /N "+s+" >>\n",this.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){a+="/AP << ";for(var c in i.appearanceStreamContent){var u=i.appearanceStreamContent[c];if(a+="/"+c+" ",a+="<< ",Object.keys(u).length>=1||Array.isArray(u))for(var r in u){var l=u[r];"function"==typeof l&&(l=l.call(this,i)),a+="/"+r+" "+l+" ",this.acroformPlugin.xForms.indexOf(l)>=0||this.acroformPlugin.xForms.push(l)}else{var l=u;"function"==typeof l&&(l=l.call(this,i)),a+="/"+r+" "+l+" \n",this.acroformPlugin.xForms.indexOf(l)>=0||this.acroformPlugin.xForms.push(l)}a+=" >>\n"}a+=">>\n"}a+=">>\nendobj\n",this.internal.out(a)}e&&h.call(this,this.acroformPlugin.xForms)},h=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?d.call(this,t):t instanceof n.ChoiceField?p.call(this,t):t instanceof n.Button?f.call(this,t):t instanceof n.ChildClass?s.call(this,t):t&&s.call(this,t),this};var f=function(t){var t=t||new n.Field;t.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)},d=function(t){var t=t||new n.Field;t.FT="/Tx";var e=t.Ff||0;t.multiline&&(e=4096|e),t.password&&(e=8192|e),t.fileSelect&&(e|=1<<20),t.doNotSpellCheck&&(e|=1<<22),t.doNotScroll&&(e|=1<<23),t.Ff=t.Ff||e,s.call(this,t)},p=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=window.AcroForm;n.internal={},n.createFormXObject=function(t){var e=new n.FormXObject,r=n.Appearance.internal.getHeight(t)||0,i=n.Appearance.internal.getWidth(t)||0;return e.BBox=[0,0,i,r],e},n.Appearance={CheckBox:{createAppearanceStream:function(){var t={N:{On:n.Appearance.CheckBox.YesNormal},D:{On:n.Appearance.CheckBox.YesPushDown,Off:n.Appearance.CheckBox.OffPushDown}};return t},createMK:function(){return"<< /CA (3)>>"},YesPushDown:function(t){var e=n.createFormXObject(t),r="";t.Q=1;var i=n.internal.calculateX(t,"3","ZapfDingbats",50);return r+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n BMC\n q\n 0 0 1 rg\n /F13 "+i.fontSize+" Tf 0 g\n BT\n",r+=i.text,r+="ET\n Q\n EMC\n",e.stream=r,e},YesNormal:function(t){var e=n.createFormXObject(t),r="";t.Q=1;var i=n.internal.calculateX(t,"3","ZapfDingbats",.9*n.Appearance.internal.getHeight(t));return r+="1 g\n0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\nf\nq\n0 0 1 rg\n0 0 "+(n.Appearance.internal.getWidth(t)-1)+" "+(n.Appearance.internal.getHeight(t)-1)+" re\nW\nn\n0 g\nBT\n/F13 "+i.fontSize+" Tf 0 g\n",r+=i.text,r+="ET\n Q\n",e.stream=r,e},OffPushDown:function(t){var e=n.createFormXObject(t),r="";return r+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n",e.stream=r,e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:n.Appearance.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=n.Appearance.RadioButton.Circle.YesNormal,e.D[t]=n.Appearance.RadioButton.Circle.YesPushDown,e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.getWidth(t)<=n.Appearance.internal.getHeight(t)?n.Appearance.internal.getWidth(t)/4:n.Appearance.internal.getHeight(t)/4;i*=.9;var o=n.Appearance.internal.Bezier_C;return r+="q\n1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+i+" 0 m\n"+i+" "+i*o+" "+i*o+" "+i+" 0 "+i+" c\n-"+i*o+" "+i+" -"+i+" "+i*o+" -"+i+" 0 c\n-"+i+" -"+i*o+" -"+i*o+" -"+i+" 0 -"+i+" c\n"+i*o+" -"+i+" "+i+" -"+i*o+" "+i+" 0 c\nf\nQ\n",e.stream=r,e},YesPushDown:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.getWidth(t)<=n.Appearance.internal.getHeight(t)?n.Appearance.internal.getWidth(t)/4:n.Appearance.internal.getHeight(t)/4;i*=.9;var o=n.Appearance.internal.Bezier_C;return r+="0.749023 g\n q\n 1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+2*i+" 0 m\n"+2*i+" "+2*i*o+" "+2*i*o+" "+2*i+" 0 "+2*i+" c\n-"+2*i*o+" "+2*i+" -"+2*i+" "+2*i*o+" -"+2*i+" 0 c\n-"+2*i+" -"+2*i*o+" -"+2*i*o+" -"+2*i+" 0 -"+2*i+" c\n"+2*i*o+" -"+2*i+" "+2*i+" -"+2*i*o+" "+2*i+" 0 c\n f\n Q\n 0 g\n q\n 1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+i+" 0 m\n"+i+" "+i*o+" "+i*o+" "+i+" 0 "+i+" c\n-"+i*o+" "+i+" -"+i+" "+i*o+" -"+i+" 0 c\n-"+i+" -"+i*o+" -"+i*o+" -"+i+" 0 -"+i+" c\n"+i*o+" -"+i+" "+i+" -"+i*o+" "+i+" 0 c\n f\n Q\n",e.stream=r,e},OffPushDown:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.getWidth(t)<=n.Appearance.internal.getHeight(t)?n.Appearance.internal.getWidth(t)/4:n.Appearance.internal.getHeight(t)/4;i*=.9;var o=n.Appearance.internal.Bezier_C;return r+="0.749023 g\n q\n 1 0 0 1 "+n.Appearance.internal.getWidth(t)/2+" "+n.Appearance.internal.getHeight(t)/2+" cm\n"+2*i+" 0 m\n"+2*i+" "+2*i*o+" "+2*i*o+" "+2*i+" 0 "+2*i+" c\n-"+2*i*o+" "+2*i+" -"+2*i+" "+2*i*o+" -"+2*i+" 0 c\n-"+2*i+" -"+2*i*o+" -"+2*i*o+" -"+2*i+" 0 -"+2*i+" c\n"+2*i*o+" -"+2*i+" "+2*i+" -"+2*i*o+" "+2*i+" 0 c\n f\n Q\n",e.stream=r,e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:n.Appearance.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=n.Appearance.RadioButton.Cross.YesNormal,e.D[t]=n.Appearance.RadioButton.Cross.YesPushDown,e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=n.createFormXObject(t),r="",i=n.Appearance.internal.calculateCross(t);return r+="q\n 1 1 "+(n.Appearance.internal.getWidth(t)-2)+" "+(n.Appearance.internal.getHeight(t)-2)+" re\n W\n n\n "+i.x1.x+" "+i.x1.y+" m\n "+i.x2.x+" "+i.x2.y+" l\n "+i.x4.x+" "+i.x4.y+" m\n "+i.x3.x+" "+i.x3.y+" l\n s\n Q\n",e.stream=r,e},YesPushDown:function(t){var e=n.createFormXObject(t),r=n.Appearance.internal.calculateCross(t),i="";return i+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n q\n 1 1 "+(n.Appearance.internal.getWidth(t)-2)+" "+(n.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=i,e},OffPushDown:function(t){var e=n.createFormXObject(t),r="";return r+="0.749023 g\n 0 0 "+n.Appearance.internal.getWidth(t)+" "+n.Appearance.internal.getHeight(t)+" re\n f\n",e.stream=r,e}}},createDefaultAppearanceStream:function(t){var e="";return e+="/Helv 12 Tf 0 g"}},n.Appearance.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=function(t,e){return t>e?e:t},r=n.Appearance.internal.getWidth(t),i=n.Appearance.internal.getHeight(t),o=e(r,i),a={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}};return a}},n.Appearance.internal.getWidth=function(t){return t.Rect[2]},n.Appearance.internal.getHeight=function(t){return t.Rect[3]},n.internal.inherit=function(t,e){Object.create||function(t){var e=function(){};return e.prototype=t,new e};t.prototype=Object.create(e.prototype),t.prototype.constructor=t},n.internal.arrayToPdfArray=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){var r=t[n].toString();e+=r,e+=n<t.length-1?" ":""}return e+="]"}},n.internal.toPdfString=function(t){return t=t||"",0!==t.indexOf("(")&&(t="("+t),")"!=t.substring(t.length-1)&&(t+="("),t},n.PDFObject=function(){var t;Object.defineProperty(this,"objId",{get:function(){return t||(this.internal?t=this.internal.newObjectDeferred():e.API.acroformPlugin.internal&&(t=e.API.acroformPlugin.internal.newObjectDeferred())),t||console.log("Couldn't create Object ID"),t},configurable:!1})},n.PDFObject.prototype.toString=function(){return this.objId+" 0 R"},n.PDFObject.prototype.getString=function(){var t=this.objId+" 0 obj\n<<",e=this.getContent();return t+=e+">>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="endstream\n"),t+="endobj\n"},n.PDFObject.prototype.getContent=function(){var t=function(t){var e="",r=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var i in r){var o=r[i],a=t[o];a&&(e+=Array.isArray(a)?"/"+o+" "+n.internal.arrayToPdfArray(a)+"\n":a instanceof n.PDFObject?"/"+o+" "+a.objId+" 0 R\n":"/"+o+" "+a+"\n")}return e},e="";return e+=t(this)},n.FormXObject=function(){n.PDFObject.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo;var t;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?t:null}})},n.internal.inherit(n.FormXObject,n.PDFObject),n.AcroFormDictionary=function(){n.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},n.internal.inherit(n.AcroFormDictionary,n.PDFObject),n.Field=function(){n.PDFObject.call(this);var t;Object.defineProperty(this,"Rect",{enumerable:!0,configurable:!1,get:function(){if(t){var e=t;return e}},set:function(e){t=e}});var e="";Object.defineProperty(this,"FT",{enumerable:!0,set:function(t){e=t},get:function(){return e}});var r;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,set:function(t){r=t},get:function(){if(!r||r.length<1){if(this instanceof n.ChildClass)return;return"(FieldObject"+n.Field.FieldNum++ +")"}return"("==r.substring(0,1)&&r.substring(r.length-1)?r:"("+r+")"}});var i;Object.defineProperty(this,"DA",{enumerable:!0,get:function(){return i?"("+i+")":void 0},set:function(t){i=t}});var o;Object.defineProperty(this,"DV",{enumerable:!0,configurable:!0,get:function(){return o?o:void 0},set:function(t){o=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})},n.Field.FieldNum=0,n.internal.inherit(n.Field,n.PDFObject),n.ChoiceField=function(){n.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:!1},configurable:!1}),this.hasAppearanceStream=!0,Object.defineProperty(this,"V",{get:function(){n.internal.toPdfString()}})},n.internal.inherit(n.ChoiceField,n.Field),window.ChoiceField=n.ChoiceField,n.ListBox=function(){n.ChoiceField.call(this)},n.internal.inherit(n.ListBox,n.ChoiceField),window.ListBox=n.ListBox,n.ComboBox=function(){n.ListBox.call(this),this.combo=!0},n.internal.inherit(n.ComboBox,n.ListBox),window.ComboBox=n.ComboBox,n.EditBox=function(){n.ComboBox.call(this),this.edit=!0},n.internal.inherit(n.EditBox,n.ComboBox),window.EditBox=n.EditBox,n.Button=function(){n.Field.call(this),this.FT="/Btn"},n.internal.inherit(n.Button,n.Field),window.Button=n.Button,n.PushButton=function(){n.Button.call(this),this.pushbutton=!0},n.internal.inherit(n.PushButton,n.Button),window.PushButton=n.PushButton,n.RadioButton=function(){n.Button.call(this),this.radio=!0;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"__Kids",{get:function(){return t}});var e;Object.defineProperty(this,"noToggleToOff",{enumerable:!1,get:function(){return e},set:function(t){e=t}})},n.internal.inherit(n.RadioButton,n.Button),window.RadioButton=n.RadioButton,n.ChildClass=function(t,e){n.Field.call(this),this.Parent=t,this._AppearanceType=n.Appearance.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(e),this.F=n.internal.setBitPosition(this.F,3,1),this.MK=this._AppearanceType.createMK(),this.AS="/Off",this._Name=e},n.internal.inherit(n.ChildClass,n.Field),n.RadioButton.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"createMK"in t))return void console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.__Kids){var n=this.__Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n._Name),n.MK=t.createMK()}},n.RadioButton.prototype.createOption=function(t){var r=this,i=(this.__Kids.length,new n.ChildClass(r,t));return this.__Kids.push(i),e.API.addField(i),i},n.CheckBox=function(){Button.call(this),this.appearanceStreamContent=n.Appearance.CheckBox.createAppearanceStream(),this.MK=n.Appearance.CheckBox.createMK(),this.AS="/On",this.V="/On"},n.internal.inherit(n.CheckBox,n.Button),window.CheckBox=n.CheckBox,n.TextField=function(){n.Field.call(this);var t;Object.defineProperty(this,"V",{get:function(){return t?"("+t+")":t},enumerable:!0,set:function(e){t=e}});var e;Object.defineProperty(this,"DV",{get:function(){return e?"("+e+")":e},enumerable:!0,set:function(t){e=t}});var r=!1;Object.defineProperty(this,"multiline",{enumerable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!1,get:function(){return this.V||this.DV}})},n.internal.inherit(n.TextField,n.Field),window.TextField=n.TextField,n.PasswordField=function(){TextField.call(this),Object.defineProperty(this,"password",{value:!0,enumerable:!1,configurable:!1,writable:!1})},n.internal.inherit(n.PasswordField,n.TextField),window.PasswordField=n.PasswordField,n.internal.calculateFontSpace=function(t,e,r){var r=r||"helvetica",i=n.internal.calculateFontSpace.canvas||(n.internal.calculateFontSpace.canvas=document.createElement("canvas")),o=i.getContext("2d");o.save();var a=e+" "+r;o.font=a;var s=o.measureText(t);o.fontcolor="black";var o=i.getContext("2d");s.height=1.5*o.measureText("3").width,o.restore();s.width;return s},n.internal.calculateX=function(t,e,r,i){var i=i||12,r=r||"helvetica",o={text:"",fontSize:""};e="("==e.substr(0,1)?e.substr(1):e,e=")"==e.substr(e.length-1)?e.substr(0,e.length-1):e;var a=e.split(" "),s=i,c=2,u=2,l=n.Appearance.internal.getHeight(t)||0;l=0>l?-l:l;var h=n.Appearance.internal.getWidth(t)||0;h=0>h?-h:h;var f=function(t,e,i){if(t+1<a.length){var o=e+" "+a[t+1],s=n.internal.calculateFontSpace(o,i+"px",r).width,c=h-2*u;return c>=s}return!1};s++;t:for(;;){var e="";s--;var d=n.internal.calculateFontSpace("3",s+"px",r).height,p=t.multiline?l-s:(l-d)/2;p+=c;var m=-u,g=m,w=p,y=0,v=0,b=0;if(0==s){s=12,e="(...) Tj\n",e+="% Width of Text: "+n.internal.calculateFontSpace(e,"1px").width+", FieldWidth:"+h+"\n";break}b=n.internal.calculateFontSpace(a[0]+" ",s+"px",r).width;var x="",k=0;for(var S in a){x+=a[S]+" ",x=" "==x.substr(x.length-1)?x.substr(0,x.length-1):x;var C=parseInt(S);b=n.internal.calculateFontSpace(x+" ",s+"px",r).width;var A=f(C,x,s),q=S>=a.length-1;if(!A||q){if(A||q){if(q)v=C;else if(t.multiline&&(d+c)*(k+2)+c>l)continue t}else{if(!t.multiline)continue t;if((d+c)*(k+2)+c>l)continue t;v=C}for(var _="",P=y;v>=P;P++)_+=a[P]+" ";switch(_=" "==_.substr(_.length-1)?_.substr(0,_.length-1):_,b=n.internal.calculateFontSpace(_,s+"px",r).width,t.Q){case 2:m=h-b-u;break;case 1:m=(h-b)/2;break;case 0:default:m=u}e+=m+" "+w+" Td\n",e+="("+_+") Tj\n",e+=-m+" 0 Td\n",w=-(s+c),g=m,b=0,y=v+1,k++,x=""}else x+=" "}break}return o.text=e,o.fontSize=s,o},n.internal.calculateAppearanceStream=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e="",r=t.V||t.DV,i=n.internal.calculateX(t,r);e+="/Tx BMC\nq\n/F1 "+i.fontSize+" Tf\n1 0 0 1 0 0 Tm\n",e+="BT\n",e+=i.text,e+="ET\n",e+="Q\nEMC\n";var o=new n.createFormXObject(t);o.stream=e;return o}},n.internal.calculateCoordinates=function(t,e,r,i){var o={};if(this.internal){var a=function(t){return t*this.internal.scaleFactor};Array.isArray(t)?(t[0]=n.scale(t[0]),t[1]=n.scale(t[1]),t[2]=n.scale(t[2]),t[3]=n.scale(t[3]),o.lowerLeft_X=0|t[0],o.lowerLeft_Y=a.call(this,this.internal.pageSize.height)-t[3]-t[1]|0,o.upperRight_X=t[0]+t[2]|0,o.upperRight_Y=a.call(this,this.internal.pageSize.height)-t[1]|0):(t=n.scale(t),e=n.scale(e),r=n.scale(r),i=n.scale(i),o.lowerLeft_X=0|t,o.lowerLeft_Y=this.internal.pageSize.height-e|0,o.upperRight_X=t+r|0,o.upperRight_Y=this.internal.pageSize.height-e+i|0)}else Array.isArray(t)?(o.lowerLeft_X=0|t[0],o.lowerLeft_Y=0|t[1],o.upperRight_X=t[0]+t[2]|0,o.upperRight_Y=t[1]+t[3]|0):(o.lowerLeft_X=0|t,o.lowerLeft_Y=0|e,o.upperRight_X=t+r|0,o.upperRight_Y=e+i|0);return[o.lowerLeft_X,o.lowerLeft_Y,o.upperRight_X,o.upperRight_Y]},n.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},n.internal.getBitPosition=function(t,e){t=t||0;var n=1;return n<<=e-1,t|n},n.internal.setBitPosition=function(t,e,n){t=t||0,n=n||1;var r=1;if(r<<=e-1,1==n)var t=t|r;else var t=t&~r;return t},/** * jsPDF addHTML PlugIn * Copyright (c) 2014 Diego Casorran * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ function(t){t.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,a=o.scaleFactor,s=o.pageSize.width,c=o.pageSize.height;if(r=r||{},r.onrendered=function(t){e=parseInt(e)||0,n=parseInt(n)||0;var o=r.dim||{},u=o.h||0,l=o.w||Math.min(s,t.width/a)-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(s*a,t.width),o.height=Math.min(c*a,t.height-r);var u=o.getContext("2d");u.drawImage(t,0,r,t.width,o.height,0,0,o.width,o.height);var f=[o,e,r?0:n,o.width/a,o.height/a,h,null,"SLOW"];if(this.addImage.apply(this,f),r+=o.height,r>=t.height)break;this.addPage()}i(l,r,null,f)}.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),m=[t,e,n,l,u,h,p,"SLOW"];this.addImage.apply(this,m),i(l,u,p,m)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"!=typeof rasterizeHTML){var u="drawDocument";return"string"==typeof t&&(u=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||s*a,rasterizeHTML[u](t,void 0,r).then(function(t){r.onrendered(t.image)},function(t){i(null,t)})}return null}}(e.API),function(e){var n="addImage_",r=["jpeg","jpg","png"],i=function k(t){var e=this.internal.newObject(),n=this.internal.write,r=this.internal.putStream;if(t.n=e,n("<</Type /XObject"),n("/Subtype /Image"),n("/Width "+t.w),n("/Height "+t.h),t.cs===this.color_spaces.INDEXED?n("/ColorSpace [/Indexed /Device