highcharts
Version:
JavaScript charting framework
46 lines • 241 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.jsPDF={})}(this,function(e){"use strict";var t;function re(t){return(re="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})(t)}
/** @license
* jsPDF - PDF Document creation from JavaScript
* Version 2.0.0 Built on 2019-01-22T15:32:38.220Z
* CommitID 0110a2202b
*
* Copyright (c) 2015-2018 yWorks GmbH, http://www.yworks.com
* 2015-2018 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
* 2010-2016 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
*/!function(t){if("object"!=typeof t.console){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=s.pop();)r[n]||(r[n]=i)}var a,c,u,h,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,s=0,a=0,c="",u=[];if(!t)return t;for(;e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[a++]=l.charAt(e)+l.charAt(n)+l.charAt(r)+l.charAt(i),s<t.length;);c=u.join("");var h=t.length%3;return(h?c.slice(0,h-3):c)+"===".slice(h||3)}),void 0===t.atob&&(t.atob=function(t){var e,n,r,i,o,s,a=0,c=0,u=[];if(!t)return t;for(t+="";e=(s=l.indexOf(t.charAt(a++))<<18|l.indexOf(t.charAt(a++))<<12|(i=l.indexOf(t.charAt(a++)))<<6|(o=l.indexOf(t.charAt(a++))))>>16&255,n=s>>8&255,r=255&s,u[c++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),a<t.length;);return u.join("")}),Array.prototype.map||(Array.prototype.map=function(t){if(null==this||"function"!=typeof t)throw new TypeError;for(var e=Object(this),n=e.length>>>0,r=new Array(n),i=1<arguments.length?arguments[1]:void 0,o=0;o<n;o++)o in e&&(r[o]=t.call(i,e[o],o,e));return r}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){if(null==this||"function"!=typeof t)throw new TypeError;for(var n=Object(this),r=n.length>>>0,i=0;i<r;i++)i in n&&t.call(e,n[i],i,n)}),Object.keys||(Object.keys=(a=Object.prototype.hasOwnProperty,c=!{toString:null}.propertyIsEnumerable("toString"),h=(u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(t){if("object"!=typeof t&&("function"!=typeof t||null===t))throw new TypeError;var e,n,r=[];for(e in t)a.call(t,e)&&r.push(e);if(c)for(n=0;n<h;n++)a.call(t,u[n])&&r.push(u[n]);return r})),"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var n=arguments[e];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}),String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")})}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")()),window,t=function(){function t(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})}var e=setTimeout;function r(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],h(t,this)}function i(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,o._immediateFn(function(){var t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){var e;try{e=t(n._value)}catch(t){return void a(r.promise,t)}s(r.promise,e)}else(1===n._state?s:a)(r.promise,n._value)})):n._deferreds.push(r)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void h((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){a(e,t)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function u(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function h(t,e){var n=!1;try{t(function(t){n||(n=!0,s(e,t))},function(t){n||(n=!0,a(e,t))})}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new u(t,e,n)),n},o.prototype.finally=t,o.all=function(e){return new o(function(r,i){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var o=Array.prototype.slice.call(e);if(0===o.length)return r([]);var s=o.length;function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}o[e]=t,0==--s&&r(o)}catch(t){i(t)}}for(var t=0;t<o.length;t++)a(t,o[t])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(n){return new o(function(t,e){e(n)})},o.race=function(i){return new o(function(t,e){for(var n=0,r=i.length;n<r;n++)i[n].then(t,e)})},o._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in n?n.Promise.prototype.finally||(n.Promise.prototype.finally=t):n.Promise=o},"object"==typeof e&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t();var n,w,r,C,c,I,P,p,d,F,i,o,s,a,u,h,l,f,g,q,j,T,m,y,v,b,x,S,_,k,A,O,B,D,E,R,U,z,M,N,L,H,W,G,V,Y,X,J,K,Q,Z,$,tt,et,nt,rt=function(Zt){var $t="1.3",te={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};function ee(o){var s={};this.subscribe=function(t,e,n){if("function"!=typeof e)return!1;s.hasOwnProperty(t)||(s[t]={});var r=Math.random().toString(35);return s[t][r]=[e,!!n],r},this.unsubscribe=function(t){for(var e in s)if(s[e][t])return delete s[e][t],!0;return!1},this.publish=function(t){if(s.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1),n=[];for(var r in s[t]){var i=s[t][r];try{i[0].apply(o,e)}catch(t){Zt.console&&console.error("jsPDF PubSub Error",t.message,t)}i[1]&&n.push(r)}n.length&&n.forEach(this.unsubscribe)}}}function ne(t,e,n,r){var i={};"object"===re(t)&&(t=(i=t).orientation,e=i.unit||e,n=i.format||n,r=i.compress||i.compressPdf||r),e=e||"mm",n=n||"a4",t=(""+(t||"P")).toLowerCase();(""+n).toLowerCase();var K,m,o,s,a,c,u,y,w,h,l,f,p,v=!!r&&"function"==typeof Uint8Array,Q=i.textColor||"0 g",d=i.drawColor||"0 G",Z=i.fontSize||16,$=i.charSpace||0,tt=i.R2L||!1,et=i.lineHeight||1.15,g=i.lineWidth||.200025,b="00000000000000000000000000000000",x=2,S=!1,_=[],nt={},k={},A=[],C={},I={},P={},F={},q=null,j=0,T=[],O=[],B=[],D=[],E=[],R=0,U=0,z=0,M={},N={},L=[],H={title:"",subject:"",author:"",keywords:"",creator:""},W={},G="compat",rt="advanced",it=G,ot=new ee(W),V=i.hotfixes||[],Y=function(t){var e,n=t.ch1,r=t.ch2,i=t.ch3,o=t.ch4,s=(t.precision,"draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof n&&"#"!==n.charAt(0)){var a=new RGBColor(n);a.ok&&(n=a.toHex())}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var c=parseInt(n.substr(1),16);n=c>>16&255,r=c>>8&255,i=255&c}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+s[0];else switch(t.precision){case 2:e=ct(n/255)+" "+s[0];break;case 3:default:e=ut(n/255)+" "+s[0]}else if(void 0===o||"object"===re(o)){if("string"==typeof n)e=[n,r,i,s[1]].join(" ");else switch(t.precision){case 2:e=[ct(n/255),ct(r/255),ct(i/255),s[1]].join(" ");break;default:case 3:e=[ut(n/255),ut(r/255),ut(i/255),s[1]].join(" ")}o&&0===o.a&&(e=["255","255","255",s[1]].join(" "))}else if("string"==typeof n)e=[n,r,i,o,s[2]].join(" ");else switch(t.precision){case 2:e=[ct(n),ct(r),ct(i),ct(o),s[2]].join(" ");break;case 3:default:e=[ut(n),ut(r),ut(i),ut(o),s[2]].join(" ")}return e},X=function(t){var e=function(t){return("0"+parseInt(t)).slice(-2)},n=t.getTimezoneOffset(),r=n<0?"+":"-",i=Math.floor(Math.abs(n/60)),o=Math.abs(n%60),s=[r,e(i),"'",e(o),"'"].join("");return["D:",t.getFullYear(),e(t.getMonth()+1),e(t.getDate()),e(t.getHours()),e(t.getMinutes()),e(t.getSeconds()),s].join("")},J=function(t){var e;return void 0===re(t)&&(t=new Date),e="object"===re(t)&&"[object Date]"===Object.prototype.toString.call(t)?X(t):/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t)?t:X(new Date),p=e},st=function(t){var e=p;return"jsDate"===t&&(e=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),s=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10),parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,s,0)}(p)),e},at=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),b=t},ct=function(t){return t.toFixed(2)},ut=function(t){return t.toFixed(3)},ht=function(t){return t.toFixed(16).replace(/0+$/,"")},lt=function(t){return it===G?t*m:it===rt?t:void 0},ft=function(t){return lt((e=t,it===G?w-e:it===rt?e:void 0));var e},pt=function(t){var e="00"+t;return e.substr(e.length-2)},dt=function(t){if(it!==rt)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},gt=function(t){t="string"==typeof t?t:t.toString(),S?T[s].push(t):(z+=t.length+1,D.push(t))},mt=function(){return _[++x]=z,gt(x+" 0 obj"),x},yt=function(t){gt("stream"),gt(t),gt("endstream")},wt=function(t){t.objectNumber=mt(),gt("<<"),gt("/Type /XObject"),gt("/Subtype /Form"),gt("/BBox ["+[ht(t.x),ht(t.y),ht(t.x+t.width),ht(t.y+t.height)].join(" ")+"]"),gt("/Matrix ["+t.matrix.toString()+"]");var e=t.pages[1].join("\n");gt("/Length "+e.length),gt(">>"),yt(e),gt("endobj")},vt=function(t,e){e||(e=21);var n=mt(),r=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;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 s={offset:1,color:t[t.length-1].color};t.push(s)}for(var a="",c=0,u=0;u<r.length;u++){for(n=r[u];n>t[c+1].offset;)c++;var h=t[c].offset,l=(n-h)/(t[c+1].offset-h),f=t[c].color,p=t[c+1].color;a+=pt(Math.round((1-l)*f[0]+l*p[0]).toString(16))+pt(Math.round((1-l)*f[1]+l*p[1]).toString(16))+pt(Math.round((1-l)*f[2]+l*p[2]).toString(16))}return a.trim()}(t.colors,e);gt("<< /FunctionType 0"),gt("/Domain [0.0 1.0]"),gt("/Size ["+e+"]"),gt("/BitsPerSample 8"),gt("/Range [0.0 1.0 0.0 1.0 0.0 1.0]"),gt("/Decode [0.0 1.0 0.0 1.0 0.0 1.0]"),gt("/Length "+r.length),gt("/Filter /ASCIIHexDecode"),gt(">>"),yt(r),gt("endobj"),t.objectNumber=mt(),gt("<< /ShadingType "+t.type),gt("/ColorSpace /DeviceRGB");var i="/Coords ["+ht(parseFloat(t.coords[0]))+" "+ht(parseFloat(t.coords[1]))+" ";2===t.type?i+=ht(parseFloat(t.coords[2]))+" "+ht(parseFloat(t.coords[3])):i+=ht(parseFloat(t.coords[2]))+" "+ht(parseFloat(t.coords[3]))+" "+ht(parseFloat(t.coords[4]))+" "+ht(parseFloat(t.coords[5])),gt(i+="]"),t.matrix&>("/Matrix ["+t.matrix.toString()+"]"),gt("/Function "+n+" 0 R"),gt("/Extend [true true]"),gt(">>"),gt("endobj")},bt=function(t){for(var e in t.objectNumber=mt(),gt("<<"),t)switch(e){case"opacity":gt("/ca "+ct(t[e]));break;case"stroke-opacity":gt("/CA "+ct(t[e]))}gt(">>"),gt("endobj")},xt=function(){for(var t in gt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),gt("/Font <<"),nt)nt.hasOwnProperty(t)&>("/"+t+" "+nt[t].objectNumber+" 0 R");gt(">>"),gt("/Shading <<"),function(){for(var t in C)C.hasOwnProperty(t)&&C[t]instanceof W.ShadingPattern&&0<=C[t].objectNumber&>("/"+t+" "+C[t].objectNumber+" 0 R");ot.publish("putShadingPatternDict")}(),gt(">>"),gt("/Pattern <<"),function(){for(var t in C)C.hasOwnProperty(t)&&C[t]instanceof W.TilingPattern&&0<=C[t].objectNumber&>("/"+t+" "+C[t].objectNumber+" 0 R");ot.publish("putTilingPatternDict")}(),gt(">>"),gt("/ExtGState <<"),function(){var t;for(t in P)P.hasOwnProperty(t)&&0<=P[t].objectNumber&>("/"+t+" "+P[t].objectNumber+" 0 R");ot.publish("putGStateDict")}(),gt(">>"),gt("/XObject <<"),function(){for(var t in M)M.hasOwnProperty(t)&&0<=M[t].objectNumber&>("/"+t+" "+M[t].objectNumber+" 0 R");ot.publish("putXobjectDict")}(),gt(">>")},St=function(){!function(){for(var t in nt)nt.hasOwnProperty(t)&&(e=nt[t],ot.publish("putFont",{font:e,out:gt,newObject:mt,putStream:yt}),!0!==e.isAlreadyPutted&&(e.objectNumber=mt(),gt("<<"),gt("/Type /Font"),gt("/BaseFont /"+e.postScriptName),gt("/Subtype /Type1"),"string"==typeof e.encoding&>("/Encoding /"+e.encoding),gt("/FirstChar 32"),gt("/LastChar 255"),gt(">>"),gt("endobj")));var e}(),function(){var t;for(t in P)P.hasOwnProperty(t)&&bt(P[t])}(),function(){for(var t in M)M.hasOwnProperty(t)&&wt(M[t])}(),function(){var t,e,n;for(t in C)C.hasOwnProperty(t)&&(C[t]instanceof W.ShadingPattern?vt(C[t]):C[t]instanceof W.TilingPattern&&(e=C[t],n=mt(),gt("<<"),xt(),gt(">>"),gt("endobj"),e.objectNumber=mt(),gt("<< /Type /Pattern"),gt("/PatternType 1"),gt("/PaintType 1"),gt("/TilingType 1"),gt("/BBox ["+e.boundingBox.map(ht).join(" ")+"]"),gt("/XStep "+ht(e.xStep)),gt("/YStep "+ht(e.yStep)),gt("/Length "+e.stream.length),gt("/Resources "+n+" 0 R"),e.matrix&>("/Matrix ["+e.matrix.toString()+"]"),gt(">>"),yt(e.stream),gt("endobj")))}(),ot.publish("putResources"),_[2]=z,gt("2 0 obj"),gt("<<"),xt(),gt(">>"),gt("endobj"),ot.publish("postPutResources")},_t=function(t,e,n){k.hasOwnProperty(e)||(k[e]={}),k[e][n]=t},kt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(nt).length+1).toString(10),s={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return ot.publish("addFont",{font:s,instance:this}),void 0!==o&&(nt[o]=s,_t(o,e,n)),o},At=function(t,e){return new Ct(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)},Ct=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};Ct.prototype={toString:function(){return[ht(this.a),ht(this.b),ht(this.c),ht(this.d),ht(this.e),ht(this.f)].join(" ")},inversed:function(){var t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,o=this.f,s=1/(t*r-e*n),a=r*s,c=-e*s,u=-n*s,h=t*s;return new Ct(a,c,u,h,-a*i-u*o,-c*i-h*o)}};var It=new Ct(1,0,0,1,0,0),Pt=function(){this.page=j,this.currentPage=s,this.pages=T.slice(0),this.pagedim=B.slice(0),this.pagesContext=O.slice(0),this.x=a,this.y=c,this.matrix=u,this.width=y,this.height=w,this.id="",this.objectNumber=-1};Pt.prototype={restore:function(){j=this.page,s=this.currentPage,O=this.pagesContext,B=this.pagedim,T=this.pages,a=this.x,c=this.y,u=this.matrix,y=this.width,w=this.height}};var Ft,qt=function(t,e,n,r,i){L.push(new Pt),j=s=0,T=[],a=t,c=e,u=i,Bt(n,r)},jt=function(t,e){if(!I[t]){var n=(e instanceof W.ShadingPattern?"Sh":"P")+(Object.keys(C).length+1).toString(10);e.id=n,I[t]=n,C[n]=e,ot.publish("addPattern",e)}},Tt=function(t,e){if(!t||!F[t]){var n=!1;for(var r in P)if(P.hasOwnProperty(r)&&P[r].equals(e)){n=!0;break}if(n)e=P[r];else{var i="GS"+(Object.keys(P).length+1).toString(10);(P[i]=e).id=i}return t&&(F[t]=e.id),ot.publish("addGState",e),e}},Ot=function(t,e){return function(t,e){var n,r,i,o,s,a,c,u,h;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&nt[K].metadata&&nt[K].metadata[i]&&nt[K].metadata[i].encoding&&(o=nt[K].metadata[i].encoding,!s&&nt[K].encoding&&(s=nt[K].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(c=!1,a=[],n=0,r=t.length;n<r;n++)(u=s[t.charCodeAt(n)])?a.push(String.fromCharCode(u)):a.push(t[n]),a[n].charCodeAt(0)>>8&&(c=!0);t=a.join("")}for(n=t.length;void 0===c&&0!==n;)t.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((h=(u=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(h),a.push(u-(h<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Bt=function(t,e){S=!0,T[++j]=[],B[j]={width:Number(t)||y,height:Number(e)||w},O[j]={},Et(j)},Dt=function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();te.hasOwnProperty(r)&&(t=te[r][0]/m,e=te[r][1]/m)}if(Array.isArray(t)&&(e=t[1],t=t[0]),n){switch(n.substr(0,1)){case"l":t<e&&(n="s");break;case"p":e<t&&(n="s")}"s"===n&&(o=t,t=e,e=o)}Bt(t,e),gt(ht(g*m)+" w"),gt(d),0!==R&>(R+" J"),0!==U&>(U+" j"),ot.publish("addPage",{pageNumber:j})},Et=function(t){0<t&&t<=j&&(y=B[s=t].width,w=B[t].height)},Rt=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:nt[K].fontName,e=void 0!==e?e:nt[K].fontStyle,r=t.toLowerCase(),void 0!==k[r]&&void 0!==k[r][e]?i=k[r][e]:void 0!==k[t]&&void 0!==k[t][e]?i=k[t][e]:!1===n.disableWarning&&console.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=k.times[e])&&(i=k.times.normal),i},Ut=function(){S=!1,x=2,z=0,D=[],_=[],E=[],ot.publish("buildDocument"),gt("%PDF-"+$t),gt("%ºß¬à"),function(){var t,e,n,r,i,o,s,a,c,u,h,l,f=[];for(s=Zt.adler32cs||ne.API.adler32cs,v&&void 0===s&&(v=!1),t=1;t<=j;t++){if(f.push(mt()),a=(y=B[t].width)*m,c=(w=B[t].height)*m,gt("<</Type /Page"),gt("/Parent 1 0 R"),gt("/Resources 2 0 R"),gt("/MediaBox [0 0 "+ht(a)+" "+ht(c)+"]"),ot.publish("putPage",{pageNumber:t,page:T[t]}),gt("/Contents "+(x+1)+" 0 R"),gt(">>"),gt("endobj"),e=T[t].join("\n"),it===rt&&(e+="\nQ"),mt(),v){for(n=[],r=e.length;r--;)n[r]=e.charCodeAt(r);o=s.from(e),e=(i=new Deflater(6)).append(new Uint8Array(n)),u=e,h=i.flush(),l=void 0,(l=new Uint8Array(u.byteLength+h.byteLength)).set(new Uint8Array(u),0),l.set(new Uint8Array(h),u.byteLength),e=l,(n=new Uint8Array(e.byteLength+6)).set(new Uint8Array([120,156])),n.set(e,2),n.set(new Uint8Array([255&o,o>>8&255,o>>16&255,o>>24&255]),e.byteLength+2);for(var p=[],d=0;65535*d<n.length;d++)p.push(String.fromCharCode.apply(null,n.subarray(65535*d,65535*(d+1))));e=p.join(""),gt("<</Length "+e.length+" /Filter [/FlateDecode]>>")}else gt("<</Length "+e.length+">>");yt(e),gt("endobj")}_[1]=z,gt("1 0 obj"),gt("<</Type /Pages");var g="/Kids [";for(r=0;r<j;r++)g+=f[r]+" 0 R ";gt(g+"]"),gt("/Count "+j),gt(">>"),gt("endobj"),ot.publish("postPutPages")}(),function(){ot.publish("putAdditionalObjects");for(var t=0;t<E.length;t++){var e=E[t];_[e.objId]=z,gt(e.objId+" 0 obj"),gt(e.content),gt("endobj")}x+=E.length,ot.publish("postPutAdditionalObjects")}(),St(),mt(),gt("<<"),function(){for(var t in gt("/Producer (jsPDF "+ne.version+")"),H)H.hasOwnProperty(t)&&H[t]&>("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+Ot(H[t])+")");gt("/CreationDate ("+p+")")}(),gt(">>"),gt("endobj"),mt(),gt("<<"),function(){switch(gt("/Type /Catalog"),gt("/Pages 1 0 R"),l||(l="fullwidth"),l){case"fullwidth":gt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":gt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":gt("/OpenAction [3 0 R /Fit]");break;case"original":gt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+l;"%"===t.substr(t.length-1)&&(l=parseInt(l)/100),"number"==typeof l&>("/OpenAction [3 0 R /XYZ null null "+ct(l)+"]")}switch(f||(f="continuous"),f){case"continuous":gt("/PageLayout /OneColumn");break;case"single":gt("/PageLayout /SinglePage");break;case"two":case"twoleft":gt("/PageLayout /TwoColumnLeft");break;case"tworight":gt("/PageLayout /TwoColumnRight")}h&>("/PageMode /"+h),ot.publish("putCatalog")}(),gt(">>"),gt("endobj");var t,e=z,n="0000000000";for(gt("xref"),gt("0 "+(x+1)),gt(n+" 65535 f "),t=1;t<=x;t++){var r=_[t];gt("function"==typeof r?(n+_[t]()).slice(-10)+" 00000 n ":(n+_[t]).slice(-10)+" 00000 n ")}return gt("trailer"),gt("<<"),gt("/Size "+(x+1)),gt("/Root "+x+" 0 R"),gt("/Info "+(x-1)+" 0 R"),gt("/ID [ <"+b+"> <"+b+"> ]"),gt(">>"),gt("startxref"),gt(""+e),gt("%%EOF"),S=!0,D.join("\n")},zt=function(t){var e=it===G?"S":"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},Mt=function(t,e,n){null===t||it===rt&&void 0===t||(t=zt(t),e?(n||(n={matrix:It}),n instanceof Ct&&(n={matrix:n}),n.key=e,n||(n=It),Nt(n,t)):gt(t))},Nt=function(t,e){var n=I[t.key],r=C[n];if(r instanceof W.ShadingPattern)gt("q"),gt(Lt(e)),r.gState&&W.setGState(r.gState),gt(t.matrix.toString()+" cm"),gt("/"+n+" sh"),gt("Q");else if(r instanceof W.TilingPattern){var i=new Ct(1,0,0,-1,0,w);t.matrix&&(i=At(t.matrix||It,i),n=r.createClone(t.key,t.boundingBox,t.xStep,t.yStep,i).id),gt("q"),gt("/Pattern cs"),gt("/"+n+" scn"),r.gState&&W.setGState(r.gState),gt(e),gt("Q")}},Lt=function(t){switch(t){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},Ht=function(){for(var t=Ut(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},Wt=function(){return new Blob([Ht()],{type:"application/pdf"})},Gt=((Ft=function(t,e){"string"==typeof e?e={filename:e}:(e=e||{}).filename=e.filename||"generated.pdf";var n="dataur"===(""+t).substr(0,6)?"data:application/pdf;filename="+e.filename+";base64,"+btoa(Ut()):0;switch(t){case void 0:return Ut();case"save":if("object"===("undefined"==typeof navigator?"undefined":re(navigator))&&navigator.getUserMedia&&(void 0===Zt.URL||void 0===Zt.URL.createObjectURL))return W.output("dataurlnewwindow");ie(Wt(),e.filename),"function"==typeof ie.unload&&Zt.setTimeout&&setTimeout(ie.unload,911);break;case"arraybuffer":return Ht();case"blob":return Wt();case"bloburi":case"bloburl":return Zt.URL&&Zt.URL.createObjectURL(Wt())||void 0;case"datauristring":case"dataurlstring":return n;case"dataurlnewwindow":var r='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring")+'"></iframe></body></html>',i=Zt.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return Zt.document.location.href=n;default:throw new Error('Output type "'+t+'" is not supported.')}}).foo=function(){try{return Ft.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(!Zt.console)throw new Error(n);Zt.console.error(n,t),Zt.alert&&alert(n)}},(Ft.foo.bar=Ft).foo),Vt=function(t){return!0===Array.isArray(V)&&-1<V.indexOf(t)};switch(e){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=1==Vt("px_scaling")?.75:96/72;break;case"pc":case"em":m=12;break;case"ex":m=6;break;default:throw"Invalid unit: "+e}function Yt(){this.saveGraphicsState(),gt(new Ct(m,0,0,-m,0,w*m).toString()+" cm"),this.setFontSize(this.getFontSize()/m),it=rt}function Xt(){this.restoreGraphicsState(),it=G}J(),at(),W.internal={pdfEscape:Ot,getStyle:zt,getFont:function(){return nt[Rt.apply(W,arguments)]},getFontSize:function(){return Z},getCharSpace:function(){return $},getTextColor:function(){var t=Q.split(" ");if(2===t.length&&"g"===t[1]){var e=parseFloat(t[0]);t=[e,e,e,"r"]}for(var n="#",r=0;r<3;r++)n+=("0"+Math.floor(255*parseFloat(t[r])).toString(16)).slice(-2);return n},getLineHeight:function(){return Z*et},write:function(t){gt(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return ht(lt(t))},getVerticalCoordinateString:function(t){return ht(ft(t))},collections:{},newObject:mt,newAdditionalObject:function(){var t=2*T.length+1,e={objId:t+=E.length,content:""};return E.push(e),e},newObjectDeferred:function(){return _[++x]=function(){return z},x},newObjectDeferredBegin:function(t){_[t]=z},putStream:yt,events:ot,scaleFactor:m,pageSize:{getWidth:function(){return y},getHeight:function(){return w}},output:function(t,e){return Gt(t,e)},getNumberOfPages:function(){return T.length-1},pages:T,out:gt,f2:ct,getPageInfo:function(t){return{objId:2*(t-1)+3,pageNumber:t,pageContext:O[t]}},getCurrentPageInfo:function(){return{objId:2*(s-1)+3,pageNumber:s,pageContext:O[s]}},getPDFVersion:function(){return $t},hasHotfix:Vt},W.advancedAPI=function(t){var e=it===G;return e&&Yt.call(this),"function"!=typeof t||(t(this),e&&Xt.call(this)),this},W.compatAPI=function(t){var e=it===rt;return e&&Xt.call(this),"function"!=typeof t||(t(this),e&&Yt.call(this)),this},W.isAdvancedAPI=function(){return it===rt},W.comment=function(t){return gt("#"+t),this},W.GState=function(t){var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&0<=e.indexOf(n)&&(this[n]=t[n]);this.id="",this.objectNumber=-1},W.GState.prototype.equals=function(t){var e="id,objectNumber,equals";if(!t||re(t)!==re(this))return!1;var n=0;for(var r in this)if(!(0<=e.indexOf(r))){if(this.hasOwnProperty(r)&&!t.hasOwnProperty(r))return!1;if(this[r]!==t[r])return!1;n++}for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)<0&&n--;return 0===n},W.addGState=function(t,e){return Tt(t,e),this},W.addPage=function(t,e){return Dt.apply(this,arguments),this},W.setPage=function(t){return Et.apply(this,arguments),this},W.insertPage=function(t){return this.addPage(),this.movePage(s,t),this},W.movePage=function(t,e){var n,r,i,o;if(e<t){for(i=T[t],r=B[t],n=O[t],o=t;e<o;o--)T[o]=T[o-1],B[o]=B[o-1],O[o]=O[o-1];T[e]=i,B[e]=r,O[e]=n,this.setPage(e)}else if(t<e){for(i=T[t],r=B[t],n=O[t],o=t;o<e;o++)T[o]=T[o+1],B[o]=B[o+1],O[o]=O[o+1];T[e]=i,B[e]=r,O[e]=n,this.setPage(e)}return this},W.deletePage=function(){return function(t){0<t&&t<=j&&(T.splice(t,1),B.splice(t,1),--j<s&&(s=j),this.setPage(s))}.apply(this,arguments),this},W.setCreationDate=function(t){return J(t),this},W.getCreationDate=function(t){return st(t)},W.setFileId=function(t){return at(t),this},W.getFileId=function(){return b},W.setDisplayMode=function(t,e,n){if(l=t,f=e,-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(h=n))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+n+'" is not recognized.');return this},W.saveGraphicsState=function(){return gt("q"),A.push({key:K,size:Z,color:Q}),this},W.restoreGraphicsState=function(){gt("Q");var t=A.pop();return K=t.key,Z=t.size,Q=t.color,q=null,this},W.setCurrentTransformationMatrix=function(t){return dt("setCurrentTransformationMatrix()"),gt(t.toString()+" cm"),this},W.beginFormObject=function(t,e,n,r,i){return dt("beginFormObject()"),qt(t,e,n,r,i),this},W.endFormObject=function(t){return dt("endFormObject()"),function(t){if(!N[t]){var e=new Pt,n="Xo"+(Object.keys(M).length+1).toString(10);e.id=n,N[t]=n,M[n]=e,ot.publish("addFormObject",e),L.pop().restore()}}(t),this},W.doFormObject=function(t,e){dt("doFormObject()");var n=M[N[t]];return gt("q"),gt(e.toString()+" cm"),gt("/"+n.id+" Do"),gt("Q"),this},W.getFormObject=function(t){var e=M[N[t]];return{x:e.x,y:e.y,width:e.width,height:e.height,matrix:e.matrix}},W.Matrix=Ct,W.matrixMult=At,W.unitMatrix=It;var Jt=function(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1};function Kt(t,e){"object"===re(e)?Nt(e,t):gt(t)}for(var Qt in W.ShadingPattern=function(t,e,n,r,i){dt("ShadingPattern"),this.type="axial"===t?2:3,this.coords=e,this.colors=n,Jt.call(this,r,i)},W.TilingPattern=function(t,e,n,r,i){dt("TilingPattern"),this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,Jt.call(this,r,i)},W.TilingPattern.prototype={createClone:function(t,e,n,r,i){var o=new W.TilingPattern(e||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);o.stream=this.stream;var s=t+"$$"+this.cloneIndex+++"$$";return jt(s,o),o}},W.addShadingPattern=function(t,e){return dt("addShadingPattern()"),jt(t,e),this},W.beginTilingPattern=function(t){dt("beginTilingPattern()"),qt(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},W.endTilingPattern=function(t,e){dt("endTilingPattern()"),e.stream=T[s].join("\n"),jt(t,e),ot.publish("endTilingPattern",e),L.pop().restore()},W.text=function(t,e,n,i,r){void 0!==r&&r instanceof Ct&&dt("The transform parameter of text() with a Matrix value");var o,s,a="",c=et,u=this;function h(t){for(var e,n=t.concat(),r=[],i=n.length;i--;)"string"==typeof(e=n.shift())?r.push(e):"[object Array]"===Object.prototype.toString.call(t)&&1===e.length?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function l(t,e){var n;if("string"==typeof t)n=e(t)[0];else if("[object Array]"===Object.prototype.toString.call(t)){for(var r,i,o=t.concat(),s=[],a=o.length;a--;)"string"==typeof(r=o.shift())?s.push(e(r)[0]):"[object Array]"===Object.prototype.toString.call(r)&&"string"===r[0]&&(i=e(r[0],r[1],r[2]),s.push([i[0],i[1],i[2]]));n=s}return n}"number"==typeof t&&(s=n,n=e,e=t,t=s);var f=arguments[3],p=r,d=arguments[5];"object"===re(f)&&null!==f||("string"==typeof p&&(d=p,p=null),"string"==typeof f&&(d=f,f=null),"number"==typeof f&&(p=f,f=null),i={flags:f,angle:p,align:d});var g=!1,m=!0;if("string"==typeof t)g=!0;else if("[object Array]"===Object.prototype.toString.call(t)){for(var y,w=t.concat(),v=[],b=w.length;b--;)("string"!=typeof(y=w.shift())||"[object Array]"===Object.prototype.toString.call(y)&&"string"!=typeof y[0])&&(m=!1);g=m}if(!1===g)throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');var x=nt[K].encoding;"WinAnsiEncoding"!==x&&"StandardEncoding"!==x||(t=l(t,function(t,e,n){return[(r=t,r=r.split("\t").join(Array(i.TabLen||9).join(" ")),Ot(r,f)),e,n];var r})),"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]),0<(D=i.maxWidth||0)&&("string"==typeof t?t=u.splitTextToSize(t,D):"[object Array]"===Object.prototype.toString.call(t)&&(t=u.splitTextToSize(t.join(" "),D)));var S={text:t,x:e,y:n,options:i,mutex:{pdfEscape:Ot,activeFontKey:K,fonts:nt,activeFontSize:Z}};ot.publish("preProcessText",S),t=S.text;var _=null;if((p=(i=S.options).angle)&&"number"==typeof p){p*=Math.PI/180,it===rt&&(p=-p);var k=Math.cos(p),A=Math.sin(p);_=new Ct(k,A,-A,k,0,0)}else p&&p instanceof Ct&&(_=p);void 0!==(B=i.charSpace)&&(a+=B+" Tc\n");i.lang;var C=-1,I=i.renderingMode||i.stroke,P=u.internal.getCurrentPageInfo().pageContext;switch(I){case 0:case!1:case"fill":C=0;break;case 1:case!0:case"stroke":C=1;break;case 2:case"fillThenStroke":C=2;break;case 3:case"invisible":C=3;break;case 4:case"fillAndAddForClipping":C=4;break;case 5:case"strokeAndAddPathForClipping":C=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":C=6;break;case 7:case"addToPathForClipping":C=7}var F=P.usedRenderingMode||-1;-1!==C?a+=C+" Tr\n":-1!==F&&(a+="0 Tr\n"),-1!==C&&(P.usedRenderingMode=C);d=i.align||"left";var q=Z*c,j=u.internal.pageSize.getWidth(),T=u.internal.scaleFactor,O=nt[K],B=i.charSpace||$,D=i.maxWidth||0,E=(f={},[]);if("[object Array]"===Object.prototype.toString.call(t)){var R,U;v=h(t);"left"!==d&&(U=v.map(function(t){return u.getStringUnitWidth(t,{font:O,charSpace:B,fontSize:Z})*Z/T}));var z,M=Math.max.apply(Math,U),N=0,L=0;if("right"===d){L=-U[0],t=[];var H=0;for(b=v.length;H<b;H++)M-U[H],R=0===H?z=0:(z=N-U[H],q),t.push([v[H],z,R]),N=U[H]}else if("center"===d){L=-U[0]/2,t=[];for(H=0,b=v.length;H<b;H++)(M-U[H])/2,R=0===H?z=0:(z=(N-U[H])/2,q),t.push([v[H],z,R]),N=U[H]}else if("left"===d){t=[];for(H=0,b=v.length;H<b;H++)t.push(v[H])}else{if("justify"!==d)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');t=[];for(D=0!==D?D:j,H=0,b=v.length;H<b;H++)R=(z=0)===H?0:q,H<b-1&&E.push((D-U[H])/(v[H].split(" ").length-1)),t.push([v[H],z,R])}}!0===("boolean"==typeof i.R2L?i.R2L:tt)&&(t=l(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]}));S={text:t,x:e,y:n,options:i,mutex:{pdfEscape:Ot,activeFontKey:K,fonts:nt,activeFontSize:Z}};ot.publish("postProcessText",S),t=S.text,o=S.mutex.isHex;v=h(t);t=[];var W,G,V,Y=0,X=(b=v.length,"");for(H=0;H<b;H++)X="","[object Array]"!==Object.prototype.toString.call(v[H])?(V=(o?"<":"(")+v[H]+(o?">":")"),Y=0):"[object Array]"===Object.prototype.toString.call(v[H])&&(W=v[H][1]*T,G=-v[H][2],V=(o?"<":"(")+v[H][0]+(o?">":")"),Y=1),void 0!==E&&void 0!==E[H]&&(X=E[H]+" Tw\n"),1===Y&&0<H?t.push(X+ht(W)+" "+ht(G)+" Td\n"+V):t.push(X+V);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),it===rt&&null===_&&(_=It),t=null!==_?(_="number"==typeof p?At(_,new Ct(1,0,0,1,lt(e),ft(n))):At(new Ct(1,0,0,1,lt(e),ft(n)),_),_=At(new Ct(1,0,0,1,L*T,0),_),it===rt&&(_=At(new Ct(1,0,0,-1,0,0),_)),_.toString()+" Tm\n"+t):ht(lt(e+L))+" "+ht(ft(n))+" Td\n"+t,t+=" Tj\n";var J="BT\n/"+K+" "+Z+" Tf\n"+(Z*c).toFixed(2)+" TL\n"+Q+"\n";return J+=a,J+=t,gt(J+="ET"),u},W.lstext=function(t,e,n,r){console.warn("jsPDF.lstext is deprecated");for(var i=0,o=t.length;i<o;i++,e+=r)this.text(t[i],e,n);return this},W.line=function(t,e,n,r){return it===G?this.lines([[n-t,r-e]],t,e,[1,1],"D"):this.lines([[n-t,r-e]],t,e,[1,1]).stroke()},W.moveTo=function(t,e){gt(ht(lt(t))+" "+ht(ft(e))+" m")},W.lineTo=function(t,e){gt(ht(lt(t))+" "+ht(ft(e))+" l")},W.curveTo=function(t,e,n,r,i,o){gt([ht(lt(t)),ht(ft(e)),ht(lt(n)),ht(ft(r)),ht(lt(i)),ht(ft(o)),"c"].join(" "))},W.close=function(){return gt("h"),this},W.stroke=function(){return gt("S"),this},W.fill=function(t){return Kt("f",t),this},W.fillEvenOdd=function(t){return Kt("f*",t),this},W.fillStroke=function(t){return Kt("B",t),this},W.fillStrokeEvenOdd=function(t){return Kt("B*",t),this},W.clip=function(){return it===G?(gt("W"),gt("S")):gt("W"),this},W.clipEvenOdd=function(){return gt("W*"),this},W.discardPath=function(){return gt("n"),this},W.clip_fixed=function(t){gt("evenodd"===t?"W*":"W"),gt("n")},W.lines=function(t,e,n,r,i,o,s,a){var c,u,h,l,f,p,d,g,m,y,w;if("number"==typeof t){var v=n;n=e,e=t,t=v}for(r=r||[1,1],this.moveTo(e,n),c=r[0],u=r[1],l=t.length,y=e,w=n,h=0;h<l;h++)2===(f=t[h]).length?(y=f[0]*c+y,w=f[1]*u+w,this.lineTo(y,w)):(p=f[0]*c+y,d=f[1]*u+w,g=f[2]*c+y,m=f[3]*u+w,y=f[4]*c+y,w=f[5]*u+w,this.curveTo(p,d,g,m,y,w));return o&&this.close(),Mt(i,s,a),this},W.path=function(t,e,n,r){for(var i=0;i<t.length;i++){var o=t[i],s=o.c;switch(o.op){case"m":this.moveTo(s[0],s[1]);break;case"l":this.lineTo(s[0],s[1]);break;case"c":this.curveTo.apply(this,s);break;case"h":this.close()}}return Mt(e,n,r),this},W.rect=function(t,e,n,r,i,o,s){return it===G&&(r=-r),gt([ht(lt(t)),ht(ft(e)),ht(lt(n)),ht(lt(r)),"re"].join(" ")),Mt(i,o,s),this},W.triangle=function(t,e,n,r,i,o,s,a,c){return this.lines([[n-t,r-e],[i-n,o-r],[t-i,e-o]],t,e,[1,1],s,!0,a,c),this},W.roundedRect=function(t,e,n,r,i,o,s,a,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],[2*i-n,0],[-i*u,0,-i,-o*u,-i,-o],[0,2*o-r],[0,-o*u,i*u,-o,i,-o]],t+i,e,[1,1],s,!0,a,c),this},W.ellipse=function(t,e,n,r,i,o,s){var a=4/3*(Math.SQRT2-1)*n,c=4/3*(Math.SQRT2-1)*r;return this.moveTo(t+n,e),this.curveTo(t+n,e-c,t+a,e-r,t,e-r),this.curveTo(t-a,e-r,t-n,e-c,t-n,e),this.curveTo(t-n,e+c,t-a,e+r,t,e+r),this.curveTo(t+a,e+r,t+n,e+c,t+n,e),Mt(i,o,s),this},W.circle=function(t,e,n,r,i,o){return this.ellipse(t,e,n,n,r,i,o)},W.setProperties=function(t){for(var e in H)H.hasOwnProperty(e)&&t[e]&&(H[e]=t[e]);return this},W.setFontSize=function(t){return gt("/"+K+" "+(Z=it===rt?t/m:t)+" Tf"),this},W.getFontSize=function(){return it===G?Z:Z*m},W.setFont=function(t,e){return K=Rt(t,e),gt("/"+K+" "+Z+" Tf"),this},W.setFontStyle=W.setFontType=function(t){return K=Rt(void 0,t),gt("/"+K+" "+Z+" Tf"),this},W.getFontList=function(){var t,e,n,r={};for(t in k)if(k.hasOwnProperty(t))for(e in r[t]=n=[],k[t])k[t].hasOwnProperty(e)&&n.push(e);return r},W.addFont=function(t,e,n,r){kt.call(this,t,e,n,r=r||"Identity-H")},W.setLineWidth=function(t){return gt(lt(t).toFixed(2)+" w"),this},W.setDrawColor=function(t,e,n,r){return gt(Y({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2})),this},W.setFillColor=function(t,e,n,r){return gt(Y({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2})),this},W.setTextColor=function(t,e,n,r){return Q=Y({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this},W.setCharSpace=function(t){return it===G?$=t:it===rt&&($=t/m),this},W.setR2L=function(t){return tt=t,this},W.setGState=function(t){(t="string"==typeof t?P[F[t]]:Tt(null,t)).equals(q)||(gt("/"+t.id+" gs"),q=t)},W.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},W.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return gt((R=e)+" J"),this},W.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return gt((U=e)+" j"),this},W.setLineMiterLimit=function(t){return gt(ht(t)+" M"),this},W.setLineDashPattern=function(t,e){return gt(["["+(void 0!==t[0]?t[0]:""),(void 0!==t[1]?t[1]:"")+"]",e,"d"].join(" ")),this},W.output=Gt,W.save=function(t){W.output("save",t)},ne.API)ne.API.hasOwnProperty(Qt)&&("events"===Qt&&ne.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))}(ot,ne.API.events):W[Qt]=ne.API[Qt]);return function(){for(var t="helvetica",e="times",n="courier",r="normal",i="bold",o="italic",s="bolditalic",a=[["Helvetica",t,r,"WinAnsiEncoding"],["Helvetica-Bold",t,i,"WinAnsiEncoding"],["Helvetica-Oblique",t,o,"WinAnsiEncoding"],["Helvetica-BoldOblique",t,s,"WinAnsiEncoding"],["Courier",n,r,"WinAnsiEncoding"],["Courier-Bold",n,i,"WinAnsiEncoding"],["Courier-Oblique",n,o,"WinAnsiEncoding"],["Courier-BoldOblique",n,s,"WinAnsiEncoding"],["Times-Roman",e,r,"WinAnsiEncoding"],["Times-Bold",e,i,"WinAnsiEncoding"],["Times-Italic",e,o,"WinAnsiEncoding"],["Times-BoldItalic",e,s,"WinAnsiEncoding"],["ZapfDingbats","zapfdingbats",r,null],["Symbol","symbol",r,null]],c=0,u=a.length;c<u;c++){var h=kt(a[c][0],a[c][1],a[c][2],a[c][3],!0),l=a[c][0].split("-");_t(h,l[0],l[1]||"")}ot.publish("addFonts",{fonts:nt,dictionary:k})}(),K="F1",Dt(n,t),ot.publish("initialized"),W}return ne.API={events:[]},ne.version="0.0.0","function"==typeof define&&define.amd?define(function(){return ne}):"undefined"!=typeof module&&module.exports?(module.exports=ne,module.exports.jsPDF=ne):Zt.jsPDF=ne,ne}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||"undefined"!=typeof global&&global||Function('return typeof this === "object" && this.content')()||Function("return this")());
/**
* @license
* Copyright (c) 2016 Alexander Weidt,
* https://github.com/BiggA94
*
* Licensed under the MIT License. http://opensource.org/licenses/mit-license
*/
/**
* @license
* Copyright (c) 2016 Alexander Weidt,
* https://github.com/BiggA94
*
* Licensed under the MIT License. http://opensource.org/licenses/mit-license
*/
!function(n,t){var h,s,e=1,r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},a=function(t){return t*(e/1)},c=function(t){var e=new C,n=M.internal.getHeight(t)||0,r=M.internal.getWidth(t)||0;return e.BBox=[0,0,r.toFixed(2),n.toFixed(2)],e},i=function(t,e,n){t=t||0;var r=1;if(r<<=e-1,1==(n=n||1))t=t|r;else t=t&~r;return t},o=function(t,e,n){n=n||1.3,t=t||0;return 1==e.readOnly&&(t=i(t,1)),1==e.required&&(t=i(t,2)),1==e.noExport&&(t=i(t,3)),1==e.multiline&&(t=i(t,13)),e.password&&(t=i(t,14)),e.noToggleToOff&&(t=i(t,15)),e.radio&&(t=i(t,16)),e.pushbutton&&(t=i(t,17)),e.combo&&(t=i(t,18)),e.edit&&(t=i(t,19)),e.sort&&(t=i(t,20)),e.fileSelect&&1.4<=n&&(t=i(t,21)),e.multiSelect&&1.4<=n&&(t=i(t,22)),e.doNotSpellCheck&&1.4<=n&&(t=i(t,23)),1==e.doNotScroll&&1.4<=n&&(t=i(t,24)),e.richText&&1.4<=n&&(t=i(t,25)),t},l=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o={};return Array.isArray(e)?(e[0]=a(e[0]),e[1]=a(e[1]),e[2]=a(e[2]),e[3]=a(e[3])):(e=a(e),n=a(n),r=a(r),i=a(i)),o.lowerLeft_X=e||0,o.lowerLeft_Y=a(s)-n-i||0,o.upperRight_X=e+r||0,o.upperRight_Y=a(s)-n||0,[o.lowerLeft_X.toFixed(2),o.lowerLeft_Y.toFixed(2),o.upperRight_X.toFixed(2),o.upperRight_Y.toFixed(2)]},f=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=u(t,n);e.push("/Tx BMC"),e.push("q"),e.push("/F1 "+r.fontSize.toFixed(2)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push("BT"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var i=new c(t);return i.stream=e.join("\n"),i}},u=function(t,e,i,n){n=n||12,i=i||"helvetica";var r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" "),s=n,a=M.internal.getHeight(t)||0;a=a<0?-a:a;var c=M.internal.getWidth(t)||0;c=c<0?-c:c;var u=function(t,e,n){if(t+1<o.length){var r=e+" "+o[t+1];return A(r,n+"px",i).width<=c-4}return!1};s++;t:for(;;){e="";var h=A("3",--s+"px",i).height,l=t.multiline?a-s:(a-h)/2,f=-2,p=l+=2,d=0,g=0,m=0;if(s<=0){s=12,e="(...) Tj\n",e+="% Width of Text: "+A(e,"1px").width+", FieldWidth:"+c+"\n";break}m=A(o[0]+" ",s+"px",i).width;var y="",w=0;for(var v in o)if(o.hasOwnProperty(v)){y=" "==(y+=o[v]+" ").substr(y.length-1)?y.substr(0,y.length-1):y;var b=parseInt(v);m=A(y+" ",s+"px",i).width;var x=u(b,y,s),S=v>=o.length-1;if(x&&!S){y+=" ";continue}if(x||S){if(S)g=b;else if(t.multiline&&a<(h+2)*(w+2)+2)continue t}else{if(!t.multiline)continue t;if(a<(h+2)*(w+2)+2)continue t;g=b}for(var _="",k=d;k<=g;k++)_+=o[k]+" ";switch(_=" "==_.substr(_.length-1)?_.substr(0,_.length-1):_,m=A(_,s+"px",i).width,t.Q){case 2:f=c-m-2;break;case 1:f=(c-m)/2;break;case 0:default:f=2}e+=f.toFixed(2)+" "+p.toFixed(2)+" Td\n",e+="("+_+") Tj\n",e+=-f.toFixed(2)+" 0 Td\n",p=-(s+2),m=0,d=g+1,w++,y=""}else;break}return r.text=e,r.fontSize=s,r},A=function(t,e,n){n=n||"helvetica";var r=h.internal.getFont(n),i=h.getStringUnitWidth(t,{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e);return{height:h.getStringUnitWidth("3",{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e)*1.5,width:i}},p={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},d=function(){var t=h.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.hasAnnotation&&m.call(h,n)}},g=function(t){h.internal.acroformPlugin.printedOut&&(h.internal.acroformPlugin.printedOut=!1,h.internal.acroformPlugin.acroFormDictionaryRoot=null),h.internal.acroformPlugin.acroFormDictionaryRoot||x.call(h),h.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},m=function(t){var e={type:"reference",object:t};h.annotationPlugin.annotations[h.internal.getPageInfo(t.page).pageNumber].push(e)},y=function(){void 0!==h.internal.acroformPlugin.acroFormDictionaryRoot?h.internal.write("/AcroForm "+h.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...")},w=function(){h.internal.events.unsubscribe(h.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete h.internal.acroformPlugin.acroFormDictionaryRoot._eventID,h.internal.acroformPlugin.printedOut=!0},v=function(t){var e=!t;t||(h.internal.newObjectDeferredBegin(h.internal.acroformPlugin.acroFormDictionaryRoot.objId),h.internal.out(h.internal.acroformPlugin.acroFormDictionaryRoot.getString()));t=t||h.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=r.Rect;r.Rect&&(r.Rect=l.call(this,r.Rect)),h.internal.newObjectDeferredBegin(r.objId);var o=r.objId+" 0 obj\n<<\n";if("object"===re(r)&&"function"==typeof r.getContent&&(o+=r.getContent()),r.Rect=i,r.hasAppearanceStream&&!r.appearanceStreamContent){var s=f.call(this,r);o+="/AP << /N "+s+" >>\n",h.internal.acroformPlugin.xForms.push(s)}if(r.appearanceStreamContent){for(var a in o+="/AP << ",r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(a)){var c=r.appearanceStreamContent[a];if(o+="/"+a+" ",o+="<< ",1<=Object.keys(c).length||Array.isArray(c))for(var n in c){var u;if(c.hasOwnProperty(n))"function"==typeof(u=c[n])&&(u=u.call(this,r)),o+="/"+n+" "+u+" ",0<=h.internal.acroformPlugin.xForms.indexOf(u)||h.internal.acroformPlugin.xForms.push(u)}else"function"==typeof(u=c)&&(u=u.call(this,r)),o+="/"+n+" "+u+" \n",0<=h.internal.acroformPlugin.xForms.indexOf(u)||h.internal.acroformPlugin.xForms.push(u);o+=" >>\n"}o+=">>\n"}o+=">>\nendobj\n",h.internal.out(o)}e&&b.call(this,h.internal.acroformPlugin.xForms)},b=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];h.internal.newObjectDeferredBegin(r&&r.objId);var i="";"object"===re(r)&&"function"==typeof r.getString&&(i=r.getString()),h.internal.out(i),delete t[n]}},x=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(h=this,P.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(p)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");e=h.internal.scaleFactor,s=h.internal.pageSize.getHeight(),h.internal.acroformPlugin.acroFormDictionaryRoot=new I,h.internal.acroformPlugin.acroFormDictionaryRoot._eventID=h.internal.events.subscribe("postPutResources",w),h.internal.events.subscribe("buildDocument",d),h.internal.events.subscribe("putCatalog",y),h.internal.events.subscribe("postPutPages",v),h.internal.acroformPlugin.isInitialized=!0}},S=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){if(t.hasOwnProperty(n))e+=t[n].toString(),e+=n<t.length-1?" ":""}return e+="]"}},_=function(t){return 0!==(t=t||"").indexOf("(")&&(t="("+t),")"!=t.substring(t.length-1)&&(t+=")"),t},k=function(){var t;Object.defineProperty(this,"objId",{get:function(){return t||(t=h.internal.newObjectDeferred()),t||console.log("Couldn't create Object ID"),t},configurable:!1})};k.prototype.toString=function(){return this.objId+" 0 R"},k.prototype.getString=function(){var t=this.objId+" 0 obj\n<<";return t+=this.getContent()+">>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="\nendstream\n"),t+="endobj\n"},k.prototype.getContent=function(){var t="";return t+=function(t){var e="",n=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n)if(n.hasOwnProperty(r)){var i=n[r],o=t[i];o&&(Array.isArray(o)?e+="/"+i+" "+S(o)+"\n":e+=o instanceof k?"/"+i+" "+o.objId+" 0 R\n":"/"+i+" "+o+"\n")}return e}(this)};var C=function(){var e;k.call(this),this.Type="/XObject",this.Subtype="/Form",