html2canvas.min.js
82.6 KB
/*!
* html2canvas 1.0.0-alpha.1 <https://html2canvas.hertzen.com>
* Copyright (c) 2017 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.html2canvas=t():e.html2canvas=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=21)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=/^#([a-f0-9]{3})$/i,a=function(e){var t=e.match(i);return!!t&&[parseInt(t[1][0]+t[1][0],16),parseInt(t[1][1]+t[1][1],16),parseInt(t[1][2]+t[1][2],16),null]},u=/^#([a-f0-9]{6})$/i,l=function(e){var t=e.match(u);return!!t&&[parseInt(t[1].substring(0,2),16),parseInt(t[1].substring(2,4),16),parseInt(t[1].substring(4,6),16),null]},s=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,c=function(e){var t=e.match(s);return!!t&&[Number(t[1]),Number(t[2]),Number(t[3]),null]},d=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/,f=function(e){var t=e.match(d);return!!(t&&t.length>4)&&[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]},h=function(e){return[Math.min(e[0],255),Math.min(e[1],255),Math.min(e[2],255),e.length>3?e[3]:null]},p=function(e){var t=m[e.toLowerCase()];return t||!1},g=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=Array.isArray(t)?h(t):a(t)||c(t)||f(t)||p(t)||l(t)||[0,0,0,null],o=r(n,4),i=o[0],u=o[1],s=o[2],d=o[3];this.r=i,this.g=u,this.b=s,this.a=d}return o(e,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba("+this.r+","+this.g+","+this.b+","+this.a+")":"rgb("+this.r+","+this.g+","+this.b+")"}}]),e}();t.default=g;var m={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]};t.TRANSPARENT=new g([0,0,0,0])},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.parseBoundCurves=t.calculatePaddingBoxPath=t.calculateBorderBoxPath=t.parsePathForBorder=t.parseDocumentSize=t.calculateContentBox=t.calculatePaddingBox=t.parseBounds=t.Bounds=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=r(n(6)),a=r(n(26)),u=t.Bounds=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.left=t,this.top=n,this.width=r,this.height=o}return o(e,null,[{key:"fromClientRect",value:function(t,n,r){return new e(t.left+n,t.top+r,t.width,t.height)}}]),e}(),l=(t.parseBounds=function(e,t,n){return u.fromClientRect(e.getBoundingClientRect(),t,n)},t.calculatePaddingBox=function(e,t){return new u(e.left+t[3].borderWidth,e.top+t[0].borderWidth,e.width-(t[1].borderWidth+t[3].borderWidth),e.height-(t[0].borderWidth+t[2].borderWidth))},t.calculateContentBox=function(e,t,n){var r=t[0].value,o=t[1].value,i=t[2].value,a=t[3].value;return new u(e.left+a+n[3].borderWidth,e.top+r+n[0].borderWidth,e.width-(n[1].borderWidth+n[3].borderWidth+a+o),e.height-(n[0].borderWidth+n[2].borderWidth+r+i))},t.parseDocumentSize=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var r=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),o=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new u(0,0,r,o)},t.parsePathForBorder=function(e,t){switch(t){case 0:return l(e.topLeftOuter,e.topLeftInner,e.topRightOuter,e.topRightInner);case 1:return l(e.topRightOuter,e.topRightInner,e.bottomRightOuter,e.bottomRightInner);case 2:return l(e.bottomRightOuter,e.bottomRightInner,e.bottomLeftOuter,e.bottomLeftInner);case 3:default:return l(e.bottomLeftOuter,e.bottomLeftInner,e.topLeftOuter,e.topLeftInner)}},function(e,t,n,r){var o=[];return e instanceof a.default?o.push(e.subdivide(.5,!1)):o.push(e),n instanceof a.default?o.push(n.subdivide(.5,!0)):o.push(n),r instanceof a.default?o.push(r.subdivide(.5,!0).reverse()):o.push(r),t instanceof a.default?o.push(t.subdivide(.5,!1).reverse()):o.push(t),o}),s=(t.calculateBorderBoxPath=function(e){return[e.topLeftOuter,e.topRightOuter,e.bottomRightOuter,e.bottomLeftOuter]},t.calculatePaddingBoxPath=function(e){return[e.topLeftInner,e.topRightInner,e.bottomRightInner,e.bottomLeftInner]},t.parseBoundCurves=function(e,t,n){var r=e.width/2,o=e.height/2,a=n[s.TOP_LEFT][0].getAbsoluteValue(e.width)<r?n[s.TOP_LEFT][0].getAbsoluteValue(e.width):r,u=n[s.TOP_LEFT][1].getAbsoluteValue(e.height)<o?n[s.TOP_LEFT][1].getAbsoluteValue(e.height):o,l=n[s.TOP_RIGHT][0].getAbsoluteValue(e.width)<r?n[s.TOP_RIGHT][0].getAbsoluteValue(e.width):r,d=n[s.TOP_RIGHT][1].getAbsoluteValue(e.height)<o?n[s.TOP_RIGHT][1].getAbsoluteValue(e.height):o,f=n[s.BOTTOM_RIGHT][0].getAbsoluteValue(e.width)<r?n[s.BOTTOM_RIGHT][0].getAbsoluteValue(e.width):r,h=n[s.BOTTOM_RIGHT][1].getAbsoluteValue(e.height)<o?n[s.BOTTOM_RIGHT][1].getAbsoluteValue(e.height):o,p=n[s.BOTTOM_LEFT][0].getAbsoluteValue(e.width)<r?n[s.BOTTOM_LEFT][0].getAbsoluteValue(e.width):r,g=n[s.BOTTOM_LEFT][1].getAbsoluteValue(e.height)<o?n[s.BOTTOM_LEFT][1].getAbsoluteValue(e.height):o,m=e.width-l,v=e.height-h,y=e.width-f,b=e.height-g;return{topLeftOuter:a>0||u>0?c(e.left,e.top,a,u,s.TOP_LEFT):new i.default(e.left,e.top),topLeftInner:a>0||u>0?c(e.left+t[3].borderWidth,e.top+t[0].borderWidth,Math.max(0,a-t[3].borderWidth),Math.max(0,u-t[0].borderWidth),s.TOP_LEFT):new i.default(e.left+t[3].borderWidth,e.top+t[0].borderWidth),topRightOuter:l>0||d>0?c(e.left+m,e.top,l,d,s.TOP_RIGHT):new i.default(e.left+e.width,e.top),topRightInner:l>0||d>0?c(e.left+Math.min(m,e.width+t[3].borderWidth),e.top+t[0].borderWidth,m>e.width+t[3].borderWidth?0:l-t[3].borderWidth,d-t[0].borderWidth,s.TOP_RIGHT):new i.default(e.left+e.width-t[1].borderWidth,e.top+t[0].borderWidth),bottomRightOuter:f>0||h>0?c(e.left+y,e.top+v,f,h,s.BOTTOM_RIGHT):new i.default(e.left+e.width,e.top+e.height),bottomRightInner:f>0||h>0?c(e.left+Math.min(y,e.width-t[3].borderWidth),e.top+Math.min(v,e.height+t[0].borderWidth),Math.max(0,f-t[1].borderWidth),h-t[2].borderWidth,s.BOTTOM_RIGHT):new i.default(e.left+e.width-t[1].borderWidth,e.top+e.height-t[2].borderWidth),bottomLeftOuter:p>0||g>0?c(e.left,e.top+b,p,g,s.BOTTOM_LEFT):new i.default(e.left,e.top+e.height),bottomLeftInner:p>0||g>0?c(e.left+t[3].borderWidth,e.top+b,Math.max(0,p-t[3].borderWidth),g-t[2].borderWidth,s.BOTTOM_LEFT):new i.default(e.left+t[3].borderWidth,e.top+e.height-t[2].borderWidth)}},{TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3}),c=function(e,t,n,r,o){var u=(Math.sqrt(2)-1)/3*4,l=n*u,c=r*u,d=e+n,f=t+r;switch(o){case s.TOP_LEFT:return new a.default(new i.default(e,f),new i.default(e,f-c),new i.default(d-l,t),new i.default(d,t));case s.TOP_RIGHT:return new a.default(new i.default(e,t),new i.default(e+l,t),new i.default(d,f-c),new i.default(d,f));case s.BOTTOM_RIGHT:return new a.default(new i.default(d,t),new i.default(d,t+c),new i.default(e+l,f),new i.default(e,f));case s.BOTTOM_LEFT:default:return new a.default(new i.default(d,f),new i.default(d-l,f),new i.default(e,t+c),new i.default(e,t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=t.LENGTH_TYPE={PX:0,PERCENTAGE:1},i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="%"===t.substr(t.length-1)?o.PERCENTAGE:o.PX;var n=parseFloat(t);isNaN(n)&&console.error('Invalid value given for Length: "'+t+'"'),this.value=isNaN(n)?0:n}return r(e,[{key:"isPercentage",value:function(){return this.type===o.PERCENTAGE}},{key:"getAbsoluteValue",value:function(e){return this.isPercentage()?e*(this.value/100):this.value}}],[{key:"create",value:function(t){return new e(t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PATH={VECTOR:0,BEZIER_CURVE:1,CIRCLE:2}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.contains=function(e,t){return 0!=(e&t)},t.copyCSSStyles=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);"content"!==r&&t.style.setProperty(r,e.getPropertyValue(r))}return t},t.SMALL_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.parseBackgroundImage=t.parseBackground=t.calculateBackgroundRepeatPath=t.calculateBackgroundPosition=t.calculateBackgroungPaintingArea=t.calculateBackgroundSize=t.BACKGROUND_ORIGIN=t.BACKGROUND_CLIP=t.BACKGROUND_SIZE=t.BACKGROUND_REPEAT=void 0;var o=r(n(0)),i=r(n(2)),a=r(n(25)),u=r(n(6)),l=n(1),s=t.BACKGROUND_REPEAT={REPEAT:0,NO_REPEAT:1,REPEAT_X:2,REPEAT_Y:3},c=t.BACKGROUND_SIZE={AUTO:0,CONTAIN:1,COVER:2,LENGTH:3},d=t.BACKGROUND_CLIP={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},f=t.BACKGROUND_ORIGIN=d,h=function e(t){switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t){case"contain":this.size=c.CONTAIN;break;case"cover":this.size=c.COVER;break;case"auto":this.size=c.AUTO;break;default:this.value=new i.default(t)}},p=(t.calculateBackgroundSize=function(e,t,n){var r=0,o=0,i=e.size;if(i[0].size===c.CONTAIN||i[0].size===c.COVER){var u=n.width/n.height,l=t.width/t.height;return u<l!=(i[0].size===c.COVER)?new a.default(n.width,n.width/l):new a.default(n.height*l,n.height)}return i[0].value&&(r=i[0].value.getAbsoluteValue(n.width)),i[0].size===c.AUTO&&i[1].size===c.AUTO?o=t.height:i[1].size===c.AUTO?o=r/t.width*t.height:i[1].value&&(o=i[1].value.getAbsoluteValue(n.height)),i[0].size===c.AUTO&&(r=o/t.height*t.width),new a.default(r,o)},new h("auto")),g=(t.calculateBackgroungPaintingArea=function(e,t){switch(t){case d.BORDER_BOX:return(0,l.calculateBorderBoxPath)(e);case d.PADDING_BOX:default:return(0,l.calculatePaddingBoxPath)(e)}},t.calculateBackgroundPosition=function(e,t,n){return new u.default(e[0].getAbsoluteValue(n.width-t.width),e[1].getAbsoluteValue(n.height-t.height))},t.calculateBackgroundRepeatPath=function(e,t,n,r,o){switch(e.repeat){case s.REPEAT_X:return[new u.default(Math.round(o.left),Math.round(r.top+t.y)),new u.default(Math.round(o.left+o.width),Math.round(r.top+t.y)),new u.default(Math.round(o.left+o.width),Math.round(n.height+r.top+t.y)),new u.default(Math.round(o.left),Math.round(n.height+r.top+t.y))];case s.REPEAT_Y:return[new u.default(Math.round(r.left+t.x),Math.round(o.top)),new u.default(Math.round(r.left+t.x+n.width),Math.round(o.top)),new u.default(Math.round(r.left+t.x+n.width),Math.round(o.height+o.top)),new u.default(Math.round(r.left+t.x),Math.round(o.height+o.top))];case s.NO_REPEAT:return[new u.default(Math.round(r.left+t.x),Math.round(r.top+t.y)),new u.default(Math.round(r.left+t.x+n.width),Math.round(r.top+t.y)),new u.default(Math.round(r.left+t.x+n.width),Math.round(r.top+t.y+n.height)),new u.default(Math.round(r.left+t.x),Math.round(r.top+t.y+n.height))];default:return[new u.default(Math.round(o.left),Math.round(o.top)),new u.default(Math.round(o.left+o.width),Math.round(o.top)),new u.default(Math.round(o.left+o.width),Math.round(o.height+o.top)),new u.default(Math.round(o.left),Math.round(o.height+o.top))]}},t.parseBackground=function(e,t){return{backgroundColor:new o.default(e.backgroundColor),backgroundImage:v(e,t),backgroundClip:g(e.backgroundClip),backgroundOrigin:m(e.backgroundOrigin)}},function(e){switch(e){case"padding-box":return d.PADDING_BOX;case"content-box":return d.CONTENT_BOX}return d.BORDER_BOX}),m=function(e){switch(e){case"padding-box":return f.PADDING_BOX;case"content-box":return f.CONTENT_BOX}return f.BORDER_BOX},v=function(e,t){var n=w(e.backgroundImage).map(function(e){if("url"===e.method){var n=t.loadImage(e.args[0]);e.args=n?[n]:[]}return e}),r=e.backgroundPosition.split(","),o=e.backgroundRepeat.split(","),i=e.backgroundSize.split(",");return n.map(function(e,t){var n=(i[t]||"auto").trim().split(" ").map(y),a=(r[t]||"auto").trim().split(" ").map(b);return{source:e,repeat:function(e){switch(e.trim()){case"no-repeat":return s.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return s.REPEAT_X;case"repeat-y":case"no-repeat repeat":return s.REPEAT_Y;case"repeat":return s.REPEAT}return console.error('Invalid background-repeat value "'+e+'"'),s.REPEAT}("string"==typeof o[t]?o[t]:o[0]),size:n.length<2?[n[0],p]:[n[0],n[1]],position:a.length<2?[a[0],a[0]]:[a[0],a[1]]}})},y=function(e){return"auto"===e?p:new h(e)},b=function(e){switch(e){case"bottom":case"right":return new i.default("100%");case"left":case"top":return new i.default("0%");case"auto":return new i.default("0")}return new i.default(e)},w=t.parseBackgroundImage=function(e){var t=/^\s$/,n=[],r=[],o="",i=null,a="",u=0,l=0,s=function(){var e="";if(o){'"'===a.substr(0,1)&&(a=a.substr(1,a.length-2)),a&&r.push(a.trim());var t=o.indexOf("-",1)+1;"-"===o.substr(0,1)&&t>0&&(e=o.substr(0,t).toLowerCase(),o=o.substr(t)),"none"!==(o=o.toLowerCase())&&n.push({prefix:e,method:o,args:r})}r=[],o=a=""};return e.split("").forEach(function(e){if(0!==u||!t.test(e)){switch(e){case'"':i?i===e&&(i=null):i=e;break;case"(":if(i)break;if(0===u)return void(u=1);l++;break;case")":if(i)break;if(1===u){if(0===l)return u=0,void s();l--}break;case",":if(i)break;if(0===u)return void s();if(1===u&&0===l&&!o.match(/^url$/i))return r.push(a.trim()),void(a="")}0===u?o+=e:a+=e}}),s(),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=r.PATH.VECTOR,this.x=t,this.y=n,isNaN(t)&&console.error("Invalid x value given for Vector"),isNaN(n)&&console.error("Invalid y value given for Vector")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),o=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},i={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n);var r=t.getBoundingClientRect(),o=Math.round(r.height);if(e.body.removeChild(n),123===o)return!0}}return!1}(document);return Object.defineProperty(i,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),n.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(i,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_BASE64_DRAWING(){return function(e){var t=function(e,t){var n=new Image,r=e.createElement("canvas"),o=r.getContext("2d");return new Promise(function(e){n.src=t;var i=function(){try{o.drawImage(n,0,0),r.toDataURL()}catch(t){return e(!1)}return e(!0)};n.onload=i,n.onerror=function(){return e(!1)},!0===n.complete&&setTimeout(function(){i()},500)})}(document,e);return Object.defineProperty(i,"SUPPORT_BASE64_DRAWING",{value:function(){return t}}),t}},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var n=t.getContext("2d");n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,100,100);var i=new Image,a=t.toDataURL();i.src=a;var u=(0,r.createForeignObjectSVG)(100,100,0,0,i);return n.fillStyle="red",n.fillRect(0,0,100,100),(0,r.loadSerializedSVG)(u).then(function(t){n.drawImage(t,0,0);var i=n.getImageData(0,0,100,100).data;n.fillStyle="red",n.fillRect(0,0,100,100);var u=e.createElement("div");return u.style.backgroundImage="url("+a+")",u.style.height="100px",o(i)?(0,r.loadSerializedSVG)((0,r.createForeignObjectSVG)(100,100,0,0,u)):Promise.reject(!1)}).then(function(e){return n.drawImage(e,0,0),o(n.getImageData(0,0,100,100).data)}).catch(function(e){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(i,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(i,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(i,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(i,"SUPPORT_CORS_XHR",{value:e}),e}};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextDecoration=t.TEXT_DECORATION_LINE=t.TEXT_DECORATION=t.TEXT_DECORATION_STYLE=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o=t.TEXT_DECORATION_STYLE={SOLID:0,DOUBLE:1,DOTTED:2,DASHED:3,WAVY:4},i=t.TEXT_DECORATION={NONE:null},a=t.TEXT_DECORATION_LINE={UNDERLINE:1,OVERLINE:2,LINE_THROUGH:3,BLINK:4},u=function(e){switch(e){case"underline":return a.UNDERLINE;case"overline":return a.OVERLINE;case"line-through":return a.LINE_THROUGH}return a.BLINK};t.parseTextDecoration=function(e){var t=function(e){return"none"===e?null:e.split(" ").map(u)}(e.textDecorationLine?e.textDecorationLine:e.textDecoration);if(null===t)return i.NONE;return{textDecorationLine:t,textDecorationColor:e.textDecorationColor?new r.default(e.textDecorationColor):null,textDecorationStyle:function(e){switch(e){case"double":return o.DOUBLE;case"dotted":return o.DOTTED;case"dashed":return o.DASHED;case"wavy":return o.WAVY}return o.SOLID}(e.textDecorationStyle)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBorder=t.BORDER_SIDES=t.BORDER_STYLE=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o=t.BORDER_STYLE={NONE:0,SOLID:1},i=t.BORDER_SIDES={TOP:0,RIGHT:1,BOTTOM:2,LEFT:3},a=Object.keys(i).map(function(e){return e.toLowerCase()});t.parseBorder=function(e){return a.map(function(t){var n=new r.default(e.getPropertyValue("border-"+t+"-color")),i=function(e){switch(e){case"none":return o.NONE}return o.SOLID}(e.getPropertyValue("border-"+t+"-style")),a=parseFloat(e.getPropertyValue("border-"+t+"-width"));return{borderColor:n,borderStyle:i,borderWidth:isNaN(a)?0:a}})}},function(e,t,n){"use strict";function r(e,t,n){return e.length>0?t+n.toUpperCase():e}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(15),a=n(17),u=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.parent=n,this.bounds=r}return o(e,null,[{key:"fromTextNode",value:function(t,n){var r=s(t.data,n.style.textTransform);return new e(r,n,(0,a.parseTextBounds)(r,n,t))}}]),e}();t.default=u;var l=/(^|\s|:|-|\(|\))([a-z])/g,s=function(e,t){switch(t){case i.TEXT_TRANSFORM.LOWERCASE:return e.toLowerCase();case i.TEXT_TRANSFORM.CAPITALIZE:return e.replace(l,r);case i.TEXT_TRANSFORM.UPPERCASE:return e.toUpperCase();default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(3),i=n(8),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.canvas=t||document.createElement("canvas")}return r(e,[{key:"render",value:function(e){this.ctx=this.canvas.getContext("2d"),this.options=e,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px",this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.ctx.textBaseline="bottom",e.logger.log("Canvas renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+this.options.scale)}},{key:"clip",value:function(e,t){var n=this;e.length&&(this.ctx.save(),e.forEach(function(e){n.path(e),n.ctx.clip()})),t(),e.length&&this.ctx.restore()}},{key:"drawImage",value:function(e,t,n){this.ctx.drawImage(e,t.left,t.top,t.width,t.height,n.left,n.top,n.width,n.height)}},{key:"drawShape",value:function(e,t){this.path(e),this.ctx.fillStyle=t.toString(),this.ctx.fill()}},{key:"fill",value:function(e){this.ctx.fillStyle=e.toString(),this.ctx.fill()}},{key:"getTarget",value:function(){return Promise.resolve(this.canvas)}},{key:"path",value:function(e){var t=this;this.ctx.beginPath(),Array.isArray(e)?e.forEach(function(e,n){var r=e.type===o.PATH.VECTOR?e:e.start;0===n?t.ctx.moveTo(r.x,r.y):t.ctx.lineTo(r.x,r.y),e.type===o.PATH.BEZIER_CURVE&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)}):this.ctx.arc(e.x+e.radius,e.y+e.radius,e.radius,0,2*Math.PI,!0),this.ctx.closePath()}},{key:"rectangle",value:function(e,t,n,r,o){this.ctx.fillStyle=o.toString(),this.ctx.fillRect(e,t,n,r)}},{key:"renderLinearGradient",value:function(e,t){var n=this.ctx.createLinearGradient(e.left+t.direction.x1,e.top+t.direction.y1,e.left+t.direction.x0,e.top+t.direction.y0);t.colorStops.forEach(function(e){n.addColorStop(e.stop,e.color.toString())}),this.ctx.fillStyle=n,this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRepeat",value:function(e,t,n,r,o){this.path(e),this.ctx.fillStyle=this.ctx.createPattern(this.resizeImage(t,n),"repeat"),this.ctx.translate(r,o),this.ctx.fill(),this.ctx.translate(-r,-o)}},{key:"renderTextNode",value:function(e,t,n,r,o){var a=this;this.ctx.font=[n.fontStyle,n.fontVariant,n.fontWeight,n.fontSize,n.fontFamily].join(" ").split(",")[0],e.forEach(function(e){if(a.ctx.fillStyle=t.toString(),o&&e.text.trim().length?o.slice(0).reverse().forEach(function(t){a.ctx.shadowColor=t.color.toString(),a.ctx.shadowOffsetX=t.offsetX*a.options.scale,a.ctx.shadowOffsetY=t.offsetY*a.options.scale,a.ctx.shadowBlur=t.blur,a.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height)}):a.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height),null!==r){var u=r.textDecorationColor||t;r.textDecorationLine.forEach(function(t){switch(t){case i.TEXT_DECORATION_LINE.UNDERLINE:var r=a.options.fontMetrics.getMetrics(n).baseline;a.rectangle(e.bounds.left,Math.round(e.bounds.top+r),e.bounds.width,1,u);break;case i.TEXT_DECORATION_LINE.OVERLINE:a.rectangle(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1,u);break;case i.TEXT_DECORATION_LINE.LINE_THROUGH:var o=a.options.fontMetrics.getMetrics(n).middle;a.rectangle(e.bounds.left,Math.ceil(e.bounds.top+o),e.bounds.width,1,u)}})}})}},{key:"resizeImage",value:function(e,t){if(e.width===t.width&&e.height===t.height)return e;var n=this.canvas.ownerDocument.createElement("canvas");n.width=t.width,n.height=t.height;return n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),n}},{key:"setOpacity",value:function(e){this.ctx.globalAlpha=e}},{key:"transform",value:function(e,t,n,r){this.ctx.save(),this.ctx.translate(e,t),this.ctx.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.ctx.translate(-e,-t),r(),this.ctx.restore()}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.start=n||Date.now(),this.id=t}return r(e,[{key:"child",value:function(t){return new e(t,this.start)}},{key:"log",value:function(){if(window.console&&window.console.log){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas ("+this.id+"):":"html2canvas:"].concat([].slice.call(t,0)))}}},{key:"error",value:function(){if(window.console&&window.console.error){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];Function.prototype.bind.call(window.console.error,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas ("+this.id+"):":"html2canvas:"].concat([].slice.call(t,0)))}}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),i=n(4),a=n(5),u=n(9),l=n(27),s=n(28),c=n(29),d=n(30),f=n(31),h=n(32),p=n(33),g=n(14),m=n(8),v=n(34),y=n(15),b=n(35),w=n(36),T=n(37),E=n(1),O=n(16),I=["INPUT","TEXTAREA","SELECT"],_=function(){function e(t,n,r,i){var _=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parent=n,this.index=i,this.childNodes=[];var P=t.ownerDocument.defaultView,N=P.pageXOffset,S=P.pageYOffset,C=P.getComputedStyle(t,null),x=(0,s.parseDisplay)(C.display),A="radio"===t.type||"checkbox"===t.type,L=(0,g.parsePosition)(C.position);this.style={background:A?O.INPUT_BACKGROUND:(0,a.parseBackground)(C,r),border:A?O.INPUT_BORDERS:(0,u.parseBorder)(C),borderRadius:(t instanceof P.HTMLInputElement||t instanceof HTMLInputElement)&&A?(0,O.getInputBorderRadius)(t):(0,l.parseBorderRadius)(C),color:A?O.INPUT_COLOR:new o.default(C.color),display:x,float:(0,c.parseCSSFloat)(C.float),font:(0,d.parseFont)(C),letterSpacing:(0,f.parseLetterSpacing)(C.letterSpacing),opacity:parseFloat(C.opacity),overflow:-1===I.indexOf(t.tagName)?(0,h.parseOverflow)(C.overflow):h.OVERFLOW.HIDDEN,padding:(0,p.parsePadding)(C),position:L,textDecoration:(0,m.parseTextDecoration)(C),textShadow:(0,v.parseTextShadow)(C.textShadow),textTransform:(0,y.parseTextTransform)(C.textTransform),transform:(0,b.parseTransform)(C),visibility:(0,w.parseVisibility)(C.visibility),zIndex:(0,T.parseZIndex)(L!==g.POSITION.STATIC?C.zIndex:"auto")},this.isTransformed()&&(t.style.transform="matrix(1,0,0,1,0,0)"),"IMG"===t.tagName&&t.addEventListener("load",function(){_.bounds=(0,E.parseBounds)(t,N,S),_.curvedBounds=(0,E.parseBoundCurves)(_.bounds,_.style.border,_.style.borderRadius)}),this.image=R(t,r),this.bounds=A?(0,O.reformatInputBounds)((0,E.parseBounds)(t,N,S)):(0,E.parseBounds)(t,N,S),this.curvedBounds=(0,E.parseBoundCurves)(this.bounds,this.style.border,this.style.borderRadius),this.name=t.tagName.toLowerCase()+(t.id?"#"+t.id:"")+t.className.toString().split(" ").map(function(e){return e.length?"."+e:""}).join("")}return r(e,[{key:"getClipPaths",value:function(){var e=this.parent?this.parent.getClipPaths():[];return this.style.overflow===h.OVERFLOW.HIDDEN||this.style.overflow===h.OVERFLOW.SCROLL?e.concat([(0,E.calculatePaddingBoxPath)(this.curvedBounds)]):e}},{key:"isInFlow",value:function(){return this.isRootElement()&&!this.isFloating()&&!this.isAbsolutelyPositioned()}},{key:"isVisible",value:function(){return!(0,i.contains)(this.style.display,s.DISPLAY.NONE)&&this.style.opacity>0&&this.style.visibility===w.VISIBILITY.VISIBLE}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==g.POSITION.STATIC&&this.style.position!==g.POSITION.RELATIVE}},{key:"isPositioned",value:function(){return this.style.position!==g.POSITION.STATIC}},{key:"isFloating",value:function(){return this.style.float!==c.FLOAT.NONE}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return(0,i.contains)(this.style.display,s.DISPLAY.INLINE)||(0,i.contains)(this.style.display,s.DISPLAY.INLINE_BLOCK)||(0,i.contains)(this.style.display,s.DISPLAY.INLINE_FLEX)||(0,i.contains)(this.style.display,s.DISPLAY.INLINE_GRID)||(0,i.contains)(this.style.display,s.DISPLAY.INLINE_LIST_ITEM)||(0,i.contains)(this.style.display,s.DISPLAY.INLINE_TABLE)}},{key:"isInlineBlockOrInlineTable",value:function(){return(0,i.contains)(this.style.display,s.DISPLAY.INLINE_BLOCK)||(0,i.contains)(this.style.display,s.DISPLAY.INLINE_TABLE)}}]),e}();t.default=_;var R=function(e,t){if(e instanceof e.ownerDocument.defaultView.SVGSVGElement||e instanceof SVGSVGElement){var n=new XMLSerializer;return t.loadImage("data:image/svg+xml,"+encodeURIComponent(n.serializeToString(e)))}switch(e.tagName){case"IMG":var r=e;return t.loadImage(r.currentSrc||r.src);case"CANVAS":var o=e;return t.loadCanvas(o);case"IFRAME":var i=e.getAttribute("data-html2canvas-internal-iframe-key");if(i)return i}return null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.POSITION={STATIC:0,RELATIVE:1,ABSOLUTE:2,FIXED:3,STICKY:4};t.parsePosition=function(e){switch(e){case"relative":return r.RELATIVE;case"absolute":return r.ABSOLUTE;case"fixed":return r.FIXED;case"sticky":return r.STICKY}return r.STATIC}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.TEXT_TRANSFORM={NONE:0,LOWERCASE:1,UPPERCASE:2,CAPITALIZE:3};t.parseTextTransform=function(e){switch(e){case"uppercase":return r.UPPERCASE;case"lowercase":return r.LOWERCASE;case"capitalize":return r.CAPITALIZE}return r.NONE}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.reformatInputBounds=t.inlineSelectElement=t.inlineTextAreaElement=t.inlineInputElement=t.getInputBorderRadius=t.INPUT_BACKGROUND=t.INPUT_BORDERS=t.INPUT_COLOR=void 0;var o=r(n(10)),i=n(5),a=n(9),u=r(n(41)),l=r(n(6)),s=r(n(0)),c=r(n(2)),d=(n(1),n(17),n(4)),f=(t.INPUT_COLOR=new s.default([42,42,42]),new s.default([165,165,165])),h=new s.default([222,222,222]),p={borderWidth:1,borderColor:f,borderStyle:a.BORDER_STYLE.SOLID},g=(t.INPUT_BORDERS=[p,p,p,p],t.INPUT_BACKGROUND={backgroundColor:h,backgroundImage:[],backgroundClip:i.BACKGROUND_CLIP.PADDING_BOX,backgroundOrigin:i.BACKGROUND_ORIGIN.PADDING_BOX},new c.default("50%")),m=[g,g],v=[m,m,m,m],y=new c.default("3px"),b=[y,y],w=[b,b,b,b],T=(t.getInputBorderRadius=function(e){return"radio"===e.type?v:w},t.inlineInputElement=function(e,t){if("radio"===e.type||"checkbox"===e.type){if(e.checked){var n=Math.min(t.bounds.width,t.bounds.height);t.childNodes.push("checkbox"===e.type?[new l.default(t.bounds.left+.39363*n,t.bounds.top+.79*n),new l.default(t.bounds.left+.16*n,t.bounds.top+.5549*n),new l.default(t.bounds.left+.27347*n,t.bounds.top+.44071*n),new l.default(t.bounds.left+.39694*n,t.bounds.top+.5649*n),new l.default(t.bounds.left+.72983*n,t.bounds.top+.23*n),new l.default(t.bounds.left+.84*n,t.bounds.top+.34085*n),new l.default(t.bounds.left+.39363*n,t.bounds.top+.79*n)]:new u.default(t.bounds.left+n/4,t.bounds.top+n/4,n/4))}}else T(E(e),e,t,!1)},t.inlineTextAreaElement=function(e,t){T(e.value,e,t,!0)},t.inlineSelectElement=function(e,t){var n=e.options[e.selectedIndex||0];T(n?n.text||"":"",e,t,!1)},t.reformatInputBounds=function(e){return e.width>e.height?(e.left+=(e.width-e.height)/2,e.width=e.height):e.width<e.height&&(e.top+=(e.height-e.width)/2,e.height=e.width),e},function(e,t,n,r){var i=t.ownerDocument.body;if(e.length>0&&i){var a=t.ownerDocument.createElement("html2canvaswrapper");(0,d.copyCSSStyles)(t.ownerDocument.defaultView.getComputedStyle(t,null),a),a.style.position="fixed",a.style.left=n.bounds.left+"px",a.style.top=n.bounds.top+"px",r||(a.style.whiteSpace="nowrap");var u=t.ownerDocument.createTextNode(e);a.appendChild(u),i.appendChild(a),n.childNodes.push(o.default.fromTextNode(u,n)),i.removeChild(a)}}),E=function(e){var t="password"===e.type?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextBounds=t.TextBounds=void 0;var r=n(38),o=n(1),i=n(8),a=function(e){return e&&e.__esModule?e:{default:e}}(n(7)),u=/[^\u0000-\u00ff]/,l=function(e){return r.ucs2.encode([e])},s=t.TextBounds=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.bounds=n},c=(t.parseTextBounds=function(e,t,n){for(var o=r.ucs2.decode(e),h=0!==t.style.letterSpacing||function(e){return u.test(e)}(e)?o.map(l):f(o),p=h.length,g=n.parentNode?n.parentNode.ownerDocument.defaultView:null,m=g?g.pageXOffset:0,v=g?g.pageYOffset:0,y=[],b=0,w=0;w<p;w++){var T=h[w];if(t.style.textDecoration!==i.TEXT_DECORATION.NONE||T.trim().length>0)if(a.default.SUPPORT_RANGE_BOUNDS)y.push(new s(T,d(n,b,T.length,m,v)));else{var E=n.splitText(T.length);y.push(new s(T,c(n,m,v))),n=E}else a.default.SUPPORT_RANGE_BOUNDS||(n=n.splitText(T.length));b+=T.length}return y},function(e,t,n){var r=e.ownerDocument.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var a=(0,o.parseBounds)(r,t,n);return r.firstChild&&i.replaceChild(r.firstChild,r),a}return new o.Bounds(0,0,0,0)}),d=function(e,t,n,r,i){var a=e.ownerDocument.createRange();return a.setStart(e,t),a.setEnd(e,t+n),o.Bounds.fromClientRect(a.getBoundingClientRect(),r,i)},f=function(e){for(var t=[],n=0,o=!1,i=void 0;e.length;)h(e[n])===o?((i=e.splice(0,n)).length&&t.push(r.ucs2.encode(i)),o=!o,n=0):n++,n>=e.length&&(i=e.splice(0,n)).length&&t.push(r.ucs2.encode(i));return t},h=function(e){return-1!==[32,13,10,9,45].indexOf(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t}return r(e,[{key:"render",value:function(e){var t=this;this.options=e,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=Math.floor(e.width)*e.scale,this.canvas.height=Math.floor(e.height)*e.scale,this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px",e.logger.log("ForeignObject renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+e.scale);var n=i(Math.max(e.windowWidth,e.width)*e.scale,Math.max(e.windowHeight,e.height)*e.scale,e.scrollX*e.scale,e.scrollY*e.scale,this.element);return a(n).then(function(n){return e.backgroundColor&&(t.ctx.fillStyle=e.backgroundColor.toString(),t.ctx.fillRect(0,0,e.width*e.scale,e.height*e.scale)),t.ctx.drawImage(n,-e.x*e.scale,-e.y*e.scale),t.canvas})}}]),e}();t.default=o;var i=t.createForeignObjectSVG=function(e,t,n,r,o){var i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"svg"),u=document.createElementNS(i,"foreignObject");return a.setAttributeNS(null,"width",e),a.setAttributeNS(null,"height",t),u.setAttributeNS(null,"width","100%"),u.setAttributeNS(null,"height","100%"),u.setAttributeNS(null,"x",n),u.setAttributeNS(null,"y",r),u.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(u),u.appendChild(o),a},a=t.loadSerializedSVG=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontMetrics=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4);t.FontMetrics=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={},this._document=t}return r(e,[{key:"_parseMetrics",value:function(e){var t=this._document.createElement("div"),n=this._document.createElement("img"),r=this._document.createElement("span"),i=this._document.body;if(!i)throw new Error("No document found for font metrics");t.style.visibility="hidden",t.style.fontFamily=e.fontFamily,t.style.fontSize=e.fontSize,t.style.margin="0",t.style.padding="0",i.appendChild(t),n.src=o.SMALL_IMAGE,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",r.style.fontFamily=e.fontFamily,r.style.fontSize=e.fontSize,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode("Hidden Text")),t.appendChild(r),t.appendChild(n);var a=n.offsetTop-r.offsetTop+2;t.removeChild(r),t.appendChild(this._document.createTextNode("Hidden Text")),t.style.lineHeight="normal",n.style.verticalAlign="super";var u=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:a,middle:u}}},{key:"getMetrics",value:function(e){return void 0===this._data[e.fontFamily+" "+e.fontSize]&&(this._data[e.fontFamily+" "+e.fontSize]=this._parseMetrics(e)),this._data[e.fontFamily+" "+e.fontSize]}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Proxy=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(7));t.Proxy=function(e,t){if(!t.proxy)return Promise.reject("No proxy defined");var n=t.proxy;return new Promise(function(o,i){var a=r.default.SUPPORT_CORS_XHR&&r.default.SUPPORT_RESPONSE_TYPE?"blob":"text",u=r.default.SUPPORT_CORS_XHR?new XMLHttpRequest:new XDomainRequest;if(u.onload=function(){if(u instanceof XMLHttpRequest)if(200===u.status)if("text"===a)o(u.response);else{var t=new FileReader;t.addEventListener("load",function(){return o(t.result)},!1),t.addEventListener("error",function(e){return i(e)},!1),t.readAsDataURL(u.response)}else i("Failed to proxy resource "+e.substring(0,256)+" with status code "+u.status);else o(u.responseText)},u.onerror=i,u.open("GET",n+"?url="+encodeURIComponent(e)+"&responseType="+a),"text"!==a&&u instanceof XMLHttpRequest&&(u.responseType=a),t.imageTimeout){var l=t.imageTimeout;u.timeout=l,u.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+e.substring(0,256))}}u.send()})}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=r(n(11)),u=r(n(12)),l=n(22),s=n(1),c=function(e,t){"object"===("undefined"==typeof console?"undefined":i(console))&&"function"==typeof console.log&&console.log("html2canvas 1.0.0-alpha.1");var n=t||{},r=new u.default,c=e.ownerDocument;if(!c)return Promise.reject("Provided element is not within a Document");var d=c.defaultView,f=d.pageXOffset,h=d.pageYOffset,p="HTML"===e.tagName||"BODY"===e.tagName?(0,s.parseDocumentSize)(c):(0,s.parseBounds)(e,f,h),g=p.width,m=p.height,v=p.left,y=p.top,b={async:!0,allowTaint:!1,imageTimeout:15e3,proxy:null,removeContainer:!0,foreignObjectRendering:!0,scale:d.devicePixelRatio||1,target:new a.default(n.canvas),x:v,y:y,width:Math.ceil(g),height:Math.ceil(m),windowWidth:d.innerWidth,windowHeight:d.innerHeight,scrollX:d.pageXOffset,scrollY:d.pageYOffset},w=(0,l.renderElement)(e,o({},b,n),r);return w.catch(function(e){throw r.error(e),e})};c.CanvasRenderer=a.default,e.exports=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.renderElement=void 0;var o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=(r(n(12)),n(23)),a=r(n(42)),u=r(n(18)),l=r(n(7)),s=n(1),c=n(45),d=n(19),f=n(0),h=r(f);t.renderElement=function e(t,n,r){var p=t.ownerDocument,g=new s.Bounds(n.scrollX,n.scrollY,n.windowWidth,n.windowHeight),m=p.documentElement?new h.default(getComputedStyle(p.documentElement).backgroundColor):f.TRANSPARENT,v=p.body?new h.default(getComputedStyle(p.body).backgroundColor):f.TRANSPARENT,y=t===p.documentElement?m.isTransparent()?v.isTransparent()?n.backgroundColor?new h.default(n.backgroundColor):null:v:m:n.backgroundColor?new h.default(n.backgroundColor):null;return(n.foreignObjectRendering?l.default.SUPPORT_FOREIGNOBJECT_DRAWING:Promise.resolve(!1)).then(function(l){return l?function(e){return r.log("Document cloned, using foreignObject rendering"),e.inlineFonts(p).then(function(){return e.resourceLoader.ready()}).then(function(){return new u.default(e.documentElement).render({backgroundColor:y,logger:r,scale:n.scale,x:n.x,y:n.y,width:n.width,height:n.height,windowWidth:n.windowWidth,windowHeight:n.windowHeight,scrollX:n.scrollX,scrollY:n.scrollY})})}(new c.DocumentCloner(t,n,r,!0,e)):(0,c.cloneWindow)(p,g,t,n,r,e).then(function(e){var t=o(e,3),u=t[0],l=t[1],s=t[2];r.log("Document cloned, using computed rendering");var c=(0,i.NodeParser)(l,s,r),h=l.ownerDocument;return y===c.container.style.background.backgroundColor&&(c.container.style.background.backgroundColor=f.TRANSPARENT),s.ready().then(function(e){!0===n.removeContainer&&(u.parentNode?u.parentNode.removeChild(u):r.log("Cannot detach cloned iframe as it is not in the DOM anymore"));var t=new d.FontMetrics(h);r.log("Starting renderer");var o={backgroundColor:y,fontMetrics:t,imageStore:e,logger:r,scale:n.scale,x:n.x,y:n.y,width:n.width,height:n.height};if(Array.isArray(n.target))return Promise.all(n.target.map(function(e){return new a.default(e,o).render(c)}));return new a.default(n.target,o).render(c)})})})}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.NodeParser=void 0;var o=r(n(24)),i=r(n(13)),a=r(n(10)),u=n(16),l=(t.NodeParser=function(e,t,n){n.log("Starting node parsing");var r=0,a=new i.default(e,null,t,r++),u=new o.default(a,null,!0);return s(e,a,u,t,r),n.log("Finished parsing node tree"),u},["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"]),s=function e(t,n,r,s,f){if(f>5e4)throw new Error("Recursion error while parsing node tree");for(var h,p=t.firstChild;p;p=h){h=p.nextSibling;var g=p.ownerDocument.defaultView;if(p instanceof g.Text||p instanceof Text||g.parent&&p instanceof g.parent.Text)p.data.trim().length>0&&n.childNodes.push(a.default.fromTextNode(p,n));else if(p instanceof g.HTMLElement||p instanceof HTMLElement||g.parent&&p instanceof g.parent.HTMLElement){if(-1===l.indexOf(p.nodeName)){var m=new i.default(p,n,s,f++);if(m.isVisible()){"INPUT"===p.tagName?(0,u.inlineInputElement)(p,m):"TEXTAREA"===p.tagName?(0,u.inlineTextAreaElement)(p,m):"SELECT"===p.tagName&&(0,u.inlineSelectElement)(p,m);var v="TEXTAREA"!==p.tagName,y=c(m,p);if(y||d(m)){var b=y||m.isPositioned()?r.getRealParentStackingContext():r,w=new o.default(m,b,y);b.contexts.push(w),v&&e(p,m,w,s,f)}else r.children.push(m),v&&e(p,m,r,s,f)}}}else if(p instanceof g.SVGSVGElement||p instanceof SVGSVGElement||g.parent&&p instanceof g.parent.SVGSVGElement){var T=new i.default(p,n,s,f++),E=c(T,p);if(E||d(T)){var O=E||T.isPositioned()?r.getRealParentStackingContext():r,I=new o.default(T,O,E);O.contexts.push(I)}else r.children.push(T)}}},c=function(e,t){return e.isRootElement()||e.isPositionedWithZIndex()||e.style.opacity<1||e.isTransformed()||f(e,t)},d=function(e){return e.isPositioned()||e.isFloating()},f=function(e,t){return"BODY"===t.nodeName&&e.parent instanceof i.default&&e.parent.style.background.backgroundColor.isTransparent()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(function(e){e&&e.__esModule}(n(13)),n(14),function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t,this.parent=n,this.contexts=[],this.children=[],this.treatAsRealStackingContext=r}return r(e,[{key:"getOpacity",value:function(){return this.parent?this.container.style.opacity*this.parent.getOpacity():this.container.style.opacity}},{key:"getRealParentStackingContext",value:function(){return!this.parent||this.treatAsRealStackingContext?this:this.parent.getRealParentStackingContext()}}]),e}());t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.width=t,this.height=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(n(6)),a=function(e,t,n){return new i.default(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},u=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=o.PATH.BEZIER_CURVE,this.start=t,this.startControl=n,this.endControl=r,this.end=i}return r(e,[{key:"subdivide",value:function(t,n){var r=a(this.start,this.startControl,t),o=a(this.startControl,this.endControl,t),i=a(this.endControl,this.end,t),u=a(r,o,t),l=a(o,i,t),s=a(u,l,t);return n?new e(this.start,r,u,s):new e(s,l,i,this.end)}},{key:"reverse",value:function(){return new e(this.end,this.endControl,this.startControl,this.start)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBorderRadius=void 0;var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),i=["top-left","top-right","bottom-right","bottom-left"];t.parseBorderRadius=function(e){return i.map(function(t){var n=e.getPropertyValue("border-"+t+"-radius").split(" ").map(o.default.create),i=r(n,2),a=i[0],u=i[1];return void 0===u?[a,a]:[a,u]})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.DISPLAY={NONE:1,BLOCK:2,INLINE:4,RUN_IN:8,FLOW:16,FLOW_ROOT:32,TABLE:64,FLEX:128,GRID:256,RUBY:512,SUBGRID:1024,LIST_ITEM:2048,TABLE_ROW_GROUP:4096,TABLE_HEADER_GROUP:8192,TABLE_FOOTER_GROUP:16384,TABLE_ROW:32768,TABLE_CELL:65536,TABLE_COLUMN_GROUP:1<<17,TABLE_COLUMN:1<<18,TABLE_CAPTION:1<<19,RUBY_BASE:1<<20,RUBY_TEXT:1<<21,RUBY_BASE_CONTAINER:1<<22,RUBY_TEXT_CONTAINER:1<<23,CONTENTS:1<<24,INLINE_BLOCK:1<<25,INLINE_LIST_ITEM:1<<26,INLINE_TABLE:1<<27,INLINE_FLEX:1<<28,INLINE_GRID:1<<29},o=function(e,t){return e|function(e){switch(e){case"block":return r.BLOCK;case"inline":return r.INLINE;case"run-in":return r.RUN_IN;case"flow":return r.FLOW;case"flow-root":return r.FLOW_ROOT;case"table":return r.TABLE;case"flex":return r.FLEX;case"grid":return r.GRID;case"ruby":return r.RUBY;case"subgrid":return r.SUBGRID;case"list-item":return r.LIST_ITEM;case"table-row-group":return r.TABLE_ROW_GROUP;case"table-header-group":return r.TABLE_HEADER_GROUP;case"table-footer-group":return r.TABLE_FOOTER_GROUP;case"table-row":return r.TABLE_ROW;case"table-cell":return r.TABLE_CELL;case"table-column-group":return r.TABLE_COLUMN_GROUP;case"table-column":return r.TABLE_COLUMN;case"table-caption":return r.TABLE_CAPTION;case"ruby-base":return r.RUBY_BASE;case"ruby-text":return r.RUBY_TEXT;case"ruby-base-container":return r.RUBY_BASE_CONTAINER;case"ruby-text-container":return r.RUBY_TEXT_CONTAINER;case"contents":return r.CONTENTS;case"inline-block":return r.INLINE_BLOCK;case"inline-list-item":return r.INLINE_LIST_ITEM;case"inline-table":return r.INLINE_TABLE;case"inline-flex":return r.INLINE_FLEX;case"inline-grid":return r.INLINE_GRID}return r.NONE}(t)};t.parseDisplay=function(e){return e.split(" ").reduce(o,0)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.FLOAT={NONE:0,LEFT:1,RIGHT:2,INLINE_START:3,INLINE_END:4};t.parseCSSFloat=function(e){switch(e){case"left":return r.LEFT;case"right":return r.RIGHT;case"inline-start":return r.INLINE_START;case"inline-end":return r.INLINE_END}return r.NONE}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.parseFont=function(e){return{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontVariant:e.fontVariant,fontWeight:function(e){switch(e){case"normal":return 400;case"bold":return 700}var t=parseInt(e,10);return isNaN(t)?400:t}(e.fontWeight)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.parseLetterSpacing=function(e){if("normal"===e)return 0;var t=parseInt(e,10);return isNaN(t)?0:t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.OVERFLOW={VISIBLE:0,HIDDEN:1,SCROLL:2,AUTO:3};t.parseOverflow=function(e){switch(e){case"hidden":return r.HIDDEN;case"scroll":return r.SCROLL;case"auto":return r.AUTO;case"visible":default:return r.VISIBLE}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadding=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),o=["top","right","bottom","left"];t.parsePadding=function(e){return o.map(function(t){return new r.default(e.getPropertyValue("padding-"+t))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTextShadow=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0)),o=/^([+-]|\d|\.)$/i;t.parseTextShadow=function(e){if("none"===e||"string"!=typeof e)return null;for(var t="",n=!1,i=[],a=[],u=0,l=null,s=function(){t.length&&(n?i.push(parseFloat(t)):l=new r.default(t)),n=!1,t=""},c=function(){i.length&&null!==l&&a.push({color:l,offsetX:i[0]||0,offsetY:i[1]||0,blur:i[2]||0}),i.splice(0,i.length),l=null},d=0;d<e.length;d++){var f=e[d];switch(f){case"(":t+=f,u++;break;case")":t+=f,u--;break;case",":0===u?(s(),c()):t+=f;break;case" ":0===u?s():t+=f;break;default:0===t.length&&o.test(f)&&(n=!0),t+=f}}return s(),c(),0===a.length?null:a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransform=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(2)),o=function(e){return parseFloat(e.trim())},i=/(matrix|matrix3d)\((.+)\)/,a=(t.parseTransform=function(e){var t=u(e.transform||e.webkitTransform||e.mozTransform||e.msTransform||e.oTransform);return null===t?null:{transform:t,transformOrigin:a(e.transformOrigin||e.webkitTransformOrigin||e.mozTransformOrigin||e.msTransformOrigin||e.oTransformOrigin)}},function(e){if("string"!=typeof e){var t=new r.default("0");return[t,t]}var n=e.split(" ").map(r.default.create);return[n[0],n[1]]}),u=function(e){if("none"===e||"string"!=typeof e)return null;var t=e.match(i);if(t){if("matrix"===t[1]){var n=t[2].split(",").map(o);return[n[0],n[1],n[2],n[3],n[4],n[5]]}var r=t[2].split(",").map(o);return[r[0],r[1],r[4],r[5],r[12],r[13]]}return null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.VISIBILITY={VISIBLE:0,HIDDEN:1,COLLAPSE:2};t.parseVisibility=function(e){switch(e){case"hidden":return r.HIDDEN;case"collapse":return r.COLLAPSE;case"visible":default:return r.VISIBLE}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.parseZIndex=function(e){var t="auto"===e;return{auto:t,order:t?0:parseInt(e,10)}}},function(e,t,n){(function(e,r){var o;!function(i){function a(e){throw new RangeError(C[e])}function u(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function l(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]);return r+u((e=e.replace(S,".")).split("."),t).join(".")}function s(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function c(e){return u(e,function(e){var t="";return e>65535&&(t+=L((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=L(e)}).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:b}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function h(e,t,n){var r=0;for(e=n?A(e/O):e>>1,e+=A(e/t);e>x*T>>1;r+=b)e=A(e/x);return A(r+(x+1)*e/(e+E))}function p(e){var t,n,r,o,i,u,l,s,f,p,g=[],m=e.length,v=0,E=_,O=I;for((n=e.lastIndexOf(R))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&a("not-basic"),g.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<m;){for(i=v,u=1,l=b;o>=m&&a("invalid-input"),((s=d(e.charCodeAt(o++)))>=b||s>A((y-v)/u))&&a("overflow"),v+=s*u,f=l<=O?w:l>=O+T?T:l-O,!(s<f);l+=b)u>A(y/(p=b-f))&&a("overflow"),u*=p;O=h(v-i,t=g.length+1,0==i),A(v/t)>y-E&&a("overflow"),E+=A(v/t),v%=t,g.splice(v++,0,E)}return c(g)}function g(e){var t,n,r,o,i,u,l,c,d,p,g,m,v,E,O,P=[];for(m=(e=s(e)).length,t=_,n=0,i=I,u=0;u<m;++u)(g=e[u])<128&&P.push(L(g));for(r=o=P.length,o&&P.push(R);r<m;){for(l=y,u=0;u<m;++u)(g=e[u])>=t&&g<l&&(l=g);for(l-t>A((y-n)/(v=r+1))&&a("overflow"),n+=(l-t)*v,t=l,u=0;u<m;++u)if((g=e[u])<t&&++n>y&&a("overflow"),g==t){for(c=n,d=b;p=d<=i?w:d>=i+T?T:d-i,!(c<p);d+=b)O=c-p,E=b-p,P.push(L(f(p+O%E,0))),c=A(O/E);P.push(L(f(c,0))),i=h(n,v,r==o),n=0,++r}++n,++t}return P.join("")}"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var m="object"==typeof r&&r;var v,y=2147483647,b=36,w=1,T=26,E=38,O=700,I=72,_=128,R="-",P=/^xn--/,N=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=b-w,A=Math.floor,L=String.fromCharCode;v={version:"1.4.1",ucs2:{decode:s,encode:c},decode:p,encode:g,toASCII:function(e){return l(e,function(e){return N.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return l(e,function(e){return P.test(e)?p(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return v}.call(t,n,t,e))||(e.exports=o)}()}).call(t,n(39)(e),n(40))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.default=function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=r.PATH.CIRCLE,this.x=t,this.y=n,this.radius=o,isNaN(t)&&console.error("Invalid x value given for Circle"),isNaN(n)&&console.error("Invalid y value given for Circle"),isNaN(o)&&console.error("Invalid radius value given for Circle")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),a=(n(19),n(43)),u=function(e){return e&&e.__esModule?e:{default:e}}(n(10)),l=n(5),s=n(9),c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=t,this.options=n,t.render(n)}return o(e,[{key:"renderNode",value:function(e){e.isVisible()&&(this.renderNodeBackgroundAndBorders(e),this.renderNodeContent(e))}},{key:"renderNodeContent",value:function(e){var t=this,n=function(){if(e.childNodes.length&&e.childNodes.forEach(function(n){if(n instanceof u.default){var r=n.parent.style;t.target.renderTextNode(n.bounds,r.color,r.font,r.textDecoration,r.textShadow)}else t.target.drawShape(n,e.style.color)}),e.image){var n=t.options.imageStore.get(e.image);if(n){var r=(0,i.calculateContentBox)(e.bounds,e.style.padding,e.style.border),o="number"==typeof n.width&&n.width>0?n.width:r.width,a="number"==typeof n.height&&n.height>0?n.height:r.height;o>0&&a>0&&t.target.clip([(0,i.calculatePaddingBoxPath)(e.curvedBounds)],function(){t.target.drawImage(n,new i.Bounds(0,0,o,a),r)})}}},r=e.getClipPaths();r.length?this.target.clip(r,n):n()}},{key:"renderNodeBackgroundAndBorders",value:function(e){var t=this,n=!e.style.background.backgroundColor.isTransparent()||e.style.background.backgroundImage.length,r=e.style.border.filter(function(e){return e.borderStyle!==s.BORDER_STYLE.NONE&&!e.borderColor.isTransparent()}),o=function(){var o=(0,l.calculateBackgroungPaintingArea)(e.curvedBounds,e.style.background.backgroundClip);n&&t.target.clip([o],function(){e.style.background.backgroundColor.isTransparent()||t.target.fill(e.style.background.backgroundColor),t.renderBackgroundImage(e)}),r.forEach(function(n,r){t.renderBorder(n,r,e.curvedBounds)})};if(n||r.length){var i=e.parent?e.parent.getClipPaths():[];i.length?this.target.clip(i,o):o()}}},{key:"renderBackgroundImage",value:function(e){var t=this;e.style.background.backgroundImage.slice(0).reverse().forEach(function(n){if("url"===n.source.method&&n.source.args.length)t.renderBackgroundRepeat(e,n);else{var r=(0,a.parseGradient)(n.source,e.bounds);if(r){var o=e.bounds;t.target.renderLinearGradient(o,r)}}})}},{key:"renderBackgroundRepeat",value:function(e,t){var n=this.options.imageStore.get(t.source.args[0]);if(n){var r=e.bounds,o=(0,i.calculatePaddingBox)(r,e.style.border),a=(0,l.calculateBackgroundSize)(t,n,r),u=e.style.background.backgroundOrigin===l.BACKGROUND_ORIGIN.BORDER_BOX?r:o,s=(0,l.calculateBackgroundPosition)(t.position,a,u),c=(0,l.calculateBackgroundRepeatPath)(t,s,a,u,r),d=Math.round(o.left+s.x),f=Math.round(o.top+s.y);this.target.renderRepeat(c,n,a,d,f)}}},{key:"renderBorder",value:function(e,t,n){this.target.drawShape((0,i.parsePathForBorder)(n,t),e.borderColor)}},{key:"renderStack",value:function(e){var t=this;if(e.container.isVisible()){var n=e.getOpacity();n!==this._opacity&&(this.target.setOpacity(e.getOpacity()),this._opacity=n);var r=e.container.style.transform;null!==r?this.target.transform(e.container.bounds.left+r.transformOrigin[0].value,e.container.bounds.top+r.transformOrigin[1].value,r.transform,function(){return t.renderStackContent(e)}):this.renderStackContent(e)}}},{key:"renderStackContent",value:function(e){var t=f(e),n=r(t,5),o=n[0],i=n[1],a=n[2],u=n[3],l=n[4],s=d(e),c=r(s,2),p=c[0],g=c[1];this.renderNodeBackgroundAndBorders(e.container),o.sort(h).forEach(this.renderStack,this),this.renderNodeContent(e.container),g.forEach(this.renderNode,this),u.forEach(this.renderStack,this),l.forEach(this.renderStack,this),p.forEach(this.renderNode,this),i.forEach(this.renderStack,this),a.sort(h).forEach(this.renderStack,this)}},{key:"render",value:function(e){var t=this;this.options.backgroundColor&&this.target.rectangle(0,0,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(e);var n=this.target.getTarget();return n.then(function(e){return t.options.logger.log("Render completed"),e})}}]),e}();t.default=c;var d=function(e){for(var t=[],n=[],r=e.children.length,o=0;o<r;o++){var i=e.children[o];i.isInlineLevel()?t.push(i):n.push(i)}return[t,n]},f=function(e){for(var t=[],n=[],r=[],o=[],i=[],a=e.contexts.length,u=0;u<a;u++){var l=e.contexts[u];l.container.isPositioned()||l.container.style.opacity<1||l.container.isTransformed()?l.container.style.zIndex.order<0?t.push(l):l.container.style.zIndex.order>0?r.push(l):n.push(l):l.container.isFloating()?o.push(l):i.push(l)}return[t,n,r,o,i]},h=function(e,t){return e.container.style.zIndex.order>t.container.style.zIndex.order?1:e.container.style.zIndex.order<t.container.style.zIndex.order?-1:e.container.index>t.container.index?1:-1}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.parseGradient=void 0;var o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=n(44),a=r(n(0)),u=r(n(2)),l=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,s=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,c=/(px)|%|( 0)$/i,d=/^(from|to)\((.+)\)$/i,f=(t.parseGradient=function(e,t){var n=e.args,r=e.method;e.prefix;return"linear-gradient"===r?f(n,t):"gradient"===r&&"linear"===n[0]?f(["to bottom"].concat(n.slice(3).map(function(e){return e.match(d)}).filter(function(e){return null!==e}).map(function(e){return e[2]})),t):void 0},function(e,t){for(var n=(0,i.parseAngle)(e[0]),r=l.test(e[0]),o=r||null!==n||s.test(e[0]),d=o?null!==n?h(n,t):r?g(e[0],t):m(e[0],t):h(Math.PI,t),f=[],p=o?1:0,v=p;v<e.length;v++){var y=e[v],b=c.test(y),w=y.lastIndexOf(" "),T=new a.default(b?y.substring(0,w):y),E=b?new u.default(y.substring(w+1)):v===p?new u.default("0%"):v===e.length-1?new u.default("100%"):null;f.push({color:T,stop:E})}for(var O=Math.min(Math.sqrt(Math.pow(Math.abs(d.x0)+Math.abs(d.x1),2)+Math.pow(Math.abs(d.y0)+Math.abs(d.y1),2)),2*t.width,2*t.height),I=f.map(function(e){var t=e.color,n=e.stop;return{color:t,stop:n?n.getAbsoluteValue(O)/O:null}}),_=I[0].stop,R=0;R<I.length;R++)if(null!==_){var P=I[R].stop;if(null===P){for(var N=R;null===I[N].stop;)N++;for(var S=N-R+1,C=(I[N].stop-_)/S;R<N;R++)_=I[R].stop=_+C}else _=P}return{direction:d,colorStops:I}}),h=function(e,t){var n=t.width,r=t.height,o=.5*n,i=.5*r,a=(Math.abs(n*Math.sin(e))+Math.abs(r*Math.cos(e)))/2,u=o+Math.sin(e)*a,l=i-Math.cos(e)*a;return{x0:u,x1:n-u,y0:l,y1:r-l}},p=function(e){return Math.acos(e.width/2/(Math.sqrt(Math.pow(e.width,2)+Math.pow(e.height,2))/2))},g=function(e,t){switch(e){case"bottom":case"to top":return h(0,t);case"left":case"to right":return h(Math.PI/2,t);case"right":case"to left":return h(3*Math.PI/2,t);case"top right":case"right top":case"to bottom left":case"to left bottom":return h(Math.PI+p(t),t);case"top left":case"left top":case"to bottom right":case"to right bottom":return h(Math.PI-p(t),t);case"bottom left":case"left bottom":case"to top right":case"to right top":return h(p(t),t);case"bottom right":case"right bottom":case"to top left":case"to left top":return h(2*Math.PI-p(t),t);case"top":case"to bottom":default:return h(Math.PI,t)}},m=function(e,t){var n=e.split(" ").map(parseFloat),r=o(n,2),i=r[0],a=r[1],u=i/100*t.width/(a/100*t.height);return h(Math.atan(isNaN(u)?1:u)+Math.PI/2,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;t.parseAngle=function(e){var t=e.match(r);if(t){var n=parseFloat(t[1]);switch(t[2].toLowerCase()){case"deg":return Math.PI*n/180;case"grad":return Math.PI/200*n;case"rad":return n;case"turn":return 2*Math.PI*n}}return null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.cloneWindow=t.DocumentCloner=void 0;var o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=n(20),l=r(n(46)),s=n(4),c=n(5),d=r(n(11)),f=t.DocumentCloner=function(){function e(t,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.referenceElement=t,this.scrolledElements=[],this.copyStyles=o,this.inlineImages=o,this.logger=r,this.options=n,this.renderer=i,this.resourceLoader=new l.default(n,r,window),this.documentElement=this.cloneNode(t.ownerDocument.documentElement)}return i(e,[{key:"inlineAllImages",value:function(e){var t=this;if(this.inlineImages&&e){var n=e.style;Promise.all((0,c.parseBackgroundImage)(n.backgroundImage).map(function(e){return"url"===e.method?t.resourceLoader.inlineImage(e.args[0]).then(function(e){return e&&"string"==typeof e.src?'url("'+e.src+'")':"none"}).catch(function(e){t.logger.log("Unable to load image",e)}):Promise.resolve(""+e.prefix+e.method+"("+e.args.join(",")+")")})).then(function(e){e.length>1&&(n.backgroundColor=""),n.backgroundImage=e.join(",")}),e instanceof HTMLImageElement&&this.resourceLoader.inlineImage(e.src).then(function(t){if(t&&e instanceof HTMLImageElement&&e.parentNode){var n=e.parentNode,r=(0,s.copyCSSStyles)(e.style,t.cloneNode(!1));n.replaceChild(r,e)}}).catch(function(e){t.logger.log("Unable to load image",e)})}}},{key:"inlineFonts",value:function(e){var t=this;return Promise.all(Array.from(e.styleSheets).map(function(n){return n.href?fetch(n.href).then(function(e){return e.text()}).then(function(e){return p(e,n.href)}).catch(function(e){return t.logger.log("Unable to load stylesheet",e),[]}):h(n,e)})).then(function(e){return e.reduce(function(e,t){return e.concat(t)},[])}).then(function(e){return Promise.all(e.map(function(e){return fetch(e.formats[0].src).then(function(e){return e.blob()}).then(function(e){return new Promise(function(t,n){var r=new FileReader;r.onerror=n,r.onload=function(){var e=r.result;t(e)},r.readAsDataURL(e)})}).then(function(t){return e.fontFace.setProperty("src",'url("'+t+'")'),"@font-face {"+e.fontFace.cssText+" "})}))}).then(function(n){var r=e.createElement("style");r.textContent=n.join("\n"),t.documentElement.appendChild(r)})}},{key:"createElementClone",value:function(e){var t=this;if(this.copyStyles&&e instanceof HTMLCanvasElement){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch(e){this.logger.log("Unable to clone canvas contents, canvas is tainted")}}if(e instanceof HTMLIFrameElement){var r=e.cloneNode(!1),o=P();r.setAttribute("data-html2canvas-internal-iframe-key",o);var i=(0,a.parseBounds)(e,0,0),u=i.width,l=i.height;return this.resourceLoader.cache[o]=S(e,this.options).then(function(e){return t.renderer(e,{async:t.options.async,allowTaint:t.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:t.options.imageTimeout,proxy:t.options.proxy,removeContainer:t.options.removeContainer,scale:t.options.scale,foreignObjectRendering:t.options.foreignObjectRendering,target:new d.default,width:u,height:l,x:0,y:0,windowWidth:e.ownerDocument.defaultView.innerWidth,windowHeight:e.ownerDocument.defaultView.innerHeight,scrollX:e.ownerDocument.defaultView.pageXOffset,scrollY:e.ownerDocument.defaultView.pageYOffset},t.logger.child(o))}).then(function(t){return new Promise(function(n,o){var i=document.createElement("img");i.onload=function(){return n(t)},i.onerror=o,i.src=t.toDataURL(),r.parentNode&&r.parentNode.replaceChild((0,s.copyCSSStyles)(e.ownerDocument.defaultView.getComputedStyle(e),i),r)})}),r}return e.cloneNode(!1)}},{key:"cloneNode",value:function(e){var t=e.nodeType===Node.TEXT_NODE?document.createTextNode(e.nodeValue):this.createElementClone(e),n=e.ownerDocument.defaultView;this.referenceElement===e&&t instanceof n.HTMLElement&&(this.clonedReferenceElement=t),t instanceof n.HTMLBodyElement&&I(t);for(var r=e.firstChild;r;r=r.nextSibling)r.nodeType===Node.ELEMENT_NODE&&"SCRIPT"===r.nodeName||this.copyStyles&&"STYLE"===r.nodeName||t.appendChild(this.cloneNode(r));if(e instanceof n.HTMLElement&&t instanceof n.HTMLElement)switch(this.inlineAllImages(m(e,t,b)),this.inlineAllImages(m(e,t,w)),!this.copyStyles||e instanceof HTMLIFrameElement||(0,s.copyCSSStyles)(e.ownerDocument.defaultView.getComputedStyle(e),t),this.inlineAllImages(t),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([e,e.scrollLeft,e.scrollTop]),e.nodeName){case"CANVAS":this.copyStyles||g(e,t);break;case"TEXTAREA":case"SELECT":t.value=e.value}return t}}]),e}(),h=function(e,t){return(e.cssRules?Array.from(e.cssRules):[]).filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).map(function(e){for(var n=(0,c.parseBackgroundImage)(e.style.getPropertyValue("src")),r=[],o=0;o<n.length;o++)if("url"===n[o].method&&n[o+1]&&"format"===n[o+1].method){var i=t.createElement("a");i.href=n[o].args[0],t.body&&t.body.appendChild(i);var a={src:i.href,format:n[o+1].args[0]};r.push(a)}return{formats:r.filter(function(e){return/^woff/i.test(e.format)}),fontFace:e.style}}).filter(function(e){return e.formats.length})},p=function(e,t){var n=document.implementation.createHTMLDocument(""),r=document.createElement("base");r.href=t;var o=document.createElement("style");return o.textContent=e,n.head&&n.head.appendChild(r),n.body&&n.body.appendChild(o),o.sheet?h(o.sheet,n):[]},g=function(e,t){try{t&&(t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e.getContext("2d").getImageData(0,0,e.width,e.height),0,0))}catch(e){}},m=function(e,t,n){var r=e.ownerDocument.defaultView.getComputedStyle(e,n);if(r&&r.content&&"none"!==r.content&&"-moz-alt-content"!==r.content&&"none"!==r.display){var o=v(r.content),i=o.match(y),a=t.ownerDocument.createElement(i?"img":"html2canvaspseudoelement");return i?a.src=v(i[1]):a.textContent=o,(0,s.copyCSSStyles)(r,a),a.className=T+" "+E,t.className+=n===b?" "+T:" "+E,n===b?t.insertBefore(a,t.firstChild):t.appendChild(a),a}},v=function(e){var t=e.substr(0,1);return t===e.substr(e.length-1)&&t.match(/['"]/)?e.substr(1,e.length-2):e},y=/^url\((.+)\)$/i,b=":before",w=":after",T="___html2canvas___pseudoelement_before",E="___html2canvas___pseudoelement_after",O='{\n content: "" !important;\n display: none !important;\n}',I=function(e){_(e,"."+T+b+O+"\n ."+E+w+O)},_=function(e,t){var n=e.ownerDocument.createElement("style");n.innerHTML=t,e.appendChild(n)},R=function(e){var t=o(e,3),n=t[0],r=t[1],i=t[2];n.scrollLeft=r,n.scrollTop=i},P=function(){return Math.ceil(Date.now()+1e7*Math.random()).toString(16)},N=/^data:text\/(.+);(base64)?,(.*)$/i,S=function(e,t){try{return Promise.resolve(e.contentWindow.document.documentElement)}catch(n){return t.proxy?(0,u.Proxy)(e.src,t).then(function(e){var t=e.match(N);return t?"base64"===t[2]?window.atob(decodeURIComponent(t[3])):decodeURIComponent(t[3]):Promise.reject()}).then(function(t){return C(e.ownerDocument,(0,a.parseBounds)(e,0,0)).then(function(e){var n=e.contentWindow.document;n.open(),n.write(t);var r=x(e).then(function(){return n.documentElement});return n.close(),r})}):Promise.reject()}},C=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",e.body?(e.body.appendChild(n),Promise.resolve(n)):Promise.reject("Body element not found in Document that is getting rendered")},x=function(e){var t=e.contentWindow,n=t.document;return new Promise(function(r,o){t.onload=e.onload=n.onreadystatechange=function(){var t=setInterval(function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),r(e))},50)}})};t.cloneWindow=function(e,t,n,r,o,i){var a=new f(n,r,o,!1,i),u=e.defaultView.pageXOffset,l=e.defaultView.pageYOffset;return C(e,t).then(function(r){var o=r.contentWindow,i=o.document,s=x(r).then(function(){return a.scrolledElements.forEach(R),o.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===t.top&&o.scrollX===t.left||(i.documentElement.style.top=-t.top+"px",i.documentElement.style.left=-t.left+"px",i.documentElement.style.position="absolute"),a.clonedReferenceElement instanceof o.HTMLElement||a.clonedReferenceElement instanceof e.defaultView.HTMLElement||a.clonedReferenceElement instanceof HTMLElement?Promise.resolve([r,a.clonedReferenceElement,a.resourceLoader]):Promise.reject("Error finding the "+n.nodeName+" in the cloned document")});return i.open(),i.write("<!DOCTYPE html><html></html>"),function(e,t,n){!e.defaultView||t===e.defaultView.pageXOffset&&n===e.defaultView.pageYOffset||e.defaultView.scrollTo(t,n)}(n.ownerDocument,u,l),i.replaceChild(i.adoptNode(a.documentElement),i.documentElement),i.close(),s})}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceStore=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(n(7)),a=n(20),u=function(){function e(t,n,o){r(this,e),this.options=t,this._window=o,this.origin=this.getOrigin(o.location.href),this.cache={},this.logger=n,this._index=0}return o(e,[{key:"loadImage",value:function(e){var t=this;if(this.hasResourceInCache(e))return e;if(p(e)){if(!0===this.options.allowTaint||i.default.SUPPORT_SVG_DRAWING)return this.addImage(e,e,!1)}else{if(!0===this.options.allowTaint||h(e)||this.isSameOrigin(e))return this.addImage(e,e,!1);if(!this.isSameOrigin(e)){if("string"==typeof this.options.proxy)return this.cache[e]=(0,a.Proxy)(e,this.options).then(function(e){return g(e,t.options.imageTimeout||0)}),e;if(!0===this.options.useCORS&&i.default.SUPPORT_CORS_IMAGES)return this.addImage(e,e,!0)}}}},{key:"inlineImage",value:function(e){var t=this;return f(e)?g(e,this.options.imageTimeout||0):this.hasResourceInCache(e)?this.cache[e]:this.isSameOrigin(e)||"string"!=typeof this.options.proxy?this.xhrImage(e):this.cache[e]=(0,a.Proxy)(e,this.options).then(function(e){return g(e,t.options.imageTimeout||0)})}},{key:"xhrImage",value:function(e){var t=this;return this.cache[e]=new Promise(function(n,r){var o=new XMLHttpRequest;if(o.onreadystatechange=function(){if(4===o.readyState)if(200!==o.status)r("Failed to fetch image "+e.substring(0,256)+" with status code "+o.status);else{var t=new FileReader;t.addEventListener("load",function(){var e=t.result;n(e)},!1),t.addEventListener("error",function(e){return r(e)},!1),t.readAsDataURL(o.response)}},o.responseType="blob",t.options.imageTimeout){var i=t.options.imageTimeout;o.timeout=i,o.ontimeout=function(){return r("Timed out ("+i+"ms) fetching "+e.substring(0,256))}}o.open("GET",e,!0),o.send()}).then(function(e){return g(e,t.options.imageTimeout||0)}),this.cache[e]}},{key:"loadCanvas",value:function(e){var t=String(this._index++);return this.cache[t]=Promise.resolve(e),t}},{key:"hasResourceInCache",value:function(e){return void 0!==this.cache[e]}},{key:"addImage",value:function(e,t,n){var r=this;this.logger.log("Added image "+e.substring(0,256));var o=function(e){return new Promise(function(o,i){var a=new Image;if(a.onload=function(){return o(a)},e&&!n||(a.crossOrigin="anonymous"),a.onerror=i,a.src=t,!0===a.complete&&setTimeout(function(){o(a)},500),r.options.imageTimeout){var u=r.options.imageTimeout;setTimeout(function(){return i("Timed out ("+u+"ms) fetching "+t.substring(0,256))},u)}})};return this.cache[e]=h(t)&&!p(t)?i.default.SUPPORT_BASE64_DRAWING(t).then(o):o(!0),e}},{key:"isSameOrigin",value:function(e){return this.getOrigin(e)===this.origin}},{key:"getOrigin",value:function(e){var t=this._link||(this._link=this._window.document.createElement("a"));return t.href=e,t.href=t.href,t.protocol+t.hostname+t.port}},{key:"ready",value:function(){var e=this,t=Object.keys(this.cache),n=t.map(function(t){return e.cache[t].catch(function(t){return e.logger.log("Unable to load image",t),null})});return Promise.all(n).then(function(n){return e.logger.log("Finished loading "+n.length+" images",n),new l(t,n)})}}]),e}();t.default=u;var l=t.ResourceStore=function(){function e(t,n){r(this,e),this._keys=t,this._resources=n}return o(e,[{key:"get",value:function(e){var t=this._keys.indexOf(e);return-1===t?null:this._resources[t]}}]),e}(),s=/^data:image\/svg\+xml/i,c=/^data:image\/.*;base64,/i,d=/^data:image\/.*/i,f=function(e){return d.test(e)},h=function(e){return c.test(e)},p=function(e){return"svg"===e.substr(-3).toLowerCase()||s.test(e)},g=function(e,t){return new Promise(function(n,r){var o=new Image;o.onload=function(){return n(o)},o.onerror=r,o.src=e,!0===o.complete&&setTimeout(function(){n(o)},500),t&&setTimeout(function(){return r("Timed out ("+t+"ms) loading image")},t)})}}])});