/*!
* html2canvas 1.0.0-rc.0
* Copyright (c) 2019 Niklas von Hertzen
* Released under MIT License
*/
!function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.html2canvas=e():A.html2canvas=e()}(window,function(){return function(A){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return A[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=A,t.c=e,t.d=function(A,e,r){t.o(A,e)||Object.defineProperty(A,e,{enumerable:!0,get:r})},t.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},t.t=function(A,e){if(1&e&&(A=t(A)),8&e)return A;if(4&e&&"object"==typeof A&&A&&A.__esModule)return A;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:A}),2&e&&"string"!=typeof A)for(var n in A)t.d(r,n,function(e){return A[e]}.bind(null,n));return r},t.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(e,"a",e),e},t.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},t.p="",t(t.s=5)}([function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(1);Object.defineProperty(e,"toCodePoints",{enumerable:!0,get:function(){return r.toCodePoints}}),Object.defineProperty(e,"fromCodePoint",{enumerable:!0,get:function(){return r.fromCodePoint}});var n=t(2);Object.defineProperty(e,"LineBreaker",{enumerable:!0,get:function(){return n.LineBreaker}})},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toCodePoints=function(A){for(var e=[],t=0,r=A.length;t=55296&&n<=56319&&t>10),n%1024+56320)),(t+1===A||e.length>16384)&&(r+=String.fromCharCode.apply(String,e),e.length=0)}return r};for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),B=0;B>4,Q[B++]=(15&o)<<4|a>>2,Q[B++]=(3&a)<<6|63&i;return c},e.polyUint16Array=function(A){for(var e=A.length,t=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:"strict",t=[],r=[],n=[];return A.forEach(function(A,B){var s=X.get(A);if(s>a?(n.push(!0),s-=a):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(B),t.push(16);if(4===s||11===s){if(0===B)return r.push(B),t.push(E);var o=t[B-1];return-1===V.indexOf(o)?(r.push(r[B-1]),t.push(o)):(r.push(B),t.push(E))}return r.push(B),31===s?t.push("strict"===e?g:y):s===D?t.push(E):29===s?t.push(E):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(y):t.push(E):void t.push(s)}),[r,t,n]},_=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){var s=r[++B];if(s===e)return!0;if(s!==i)break}if(n===i)for(var o=t;o>0;){var a=r[--o];if(Array.isArray(A)?-1!==A.indexOf(a):A===a)for(var c=t;c<=r.length;){var Q=r[++c];if(Q===e)return!0;if(Q!==i)break}if(a!==i)break}return!1},P=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==i)return r;t--}return 0},G=function(A,e,t,r,n){if(0===t[r])return T;var B=r-1;if(Array.isArray(n)&&!0===n[B])return T;var s=B-1,o=B+1,a=e[B],E=s>=0?e[s]:0,D=e[o];if(2===a&&3===D)return T;if(-1!==L.indexOf(a))return M;if(-1!==L.indexOf(D))return T;if(-1!==O.indexOf(D))return T;if(8===P(B,e))return S;if(11===X.get(A[B])&&(D===y||D===p||D===K))return T;if(7===a||7===D)return T;if(9===a)return T;if(-1===[i,c,Q].indexOf(a)&&9===D)return T;if(-1!==[l,w,u,C,f].indexOf(D))return T;if(P(B,e)===F)return T;if(_(23,F,B,e))return T;if(_([l,w],g,B,e))return T;if(_(12,12,B,e))return T;if(a===i)return S;if(23===a||23===D)return T;if(16===D||16===a)return S;if(-1!==[c,Q,g].indexOf(D)||14===a)return T;if(36===E&&-1!==J.indexOf(a))return T;if(a===f&&36===D)return T;if(D===U&&-1!==z.concat(U,u,h,y,p,K).indexOf(a))return T;if(-1!==z.indexOf(D)&&a===h||-1!==z.indexOf(a)&&D===h)return T;if(a===H&&-1!==[y,p,K].indexOf(D)||-1!==[y,p,K].indexOf(a)&&D===d)return T;if(-1!==z.indexOf(a)&&-1!==x.indexOf(D)||-1!==x.indexOf(a)&&-1!==z.indexOf(D))return T;if(-1!==[H,d].indexOf(a)&&(D===h||-1!==[F,Q].indexOf(D)&&e[o+1]===h)||-1!==[F,Q].indexOf(a)&&D===h||a===h&&-1!==[h,f,C].indexOf(D))return T;if(-1!==[h,f,C,l,w].indexOf(D))for(var V=B;V>=0;){var R=e[V];if(R===h)return T;if(-1===[f,C].indexOf(R))break;V--}if(-1!==[H,d].indexOf(D))for(var G=-1!==[l,w].indexOf(a)?s:B;G>=0;){var W=e[G];if(W===h)return T;if(-1===[f,C].indexOf(W))break;G--}if(N===a&&-1!==[N,v,m,b].indexOf(D)||-1!==[v,m].indexOf(a)&&-1!==[v,I].indexOf(D)||-1!==[I,b].indexOf(a)&&D===I)return T;if(-1!==k.indexOf(a)&&-1!==[U,d].indexOf(D)||-1!==k.indexOf(D)&&a===H)return T;if(-1!==z.indexOf(a)&&-1!==z.indexOf(D))return T;if(a===C&&-1!==z.indexOf(D))return T;if(-1!==z.concat(h).indexOf(a)&&D===F||-1!==z.concat(h).indexOf(D)&&a===w)return T;if(41===a&&41===D){for(var Y=t[B],q=1;Y>0&&41===e[--Y];)q++;if(q%2!=0)return T}return a===p&&D===K?T:S},W=(e.lineBreakAtIndex=function(A,e){if(0===e)return T;if(e>=A.length)return M;var t=R(A),r=n(t,2),B=r[0],s=r[1];return G(A,s,B,e)},function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=R(A,e.lineBreak),r=n(t,3),B=r[0],s=r[1],o=r[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(s=s.map(function(A){return-1!==[h,E,D].indexOf(A)?y:A})),[B,s,"keep-all"===e.wordBreak?o.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):null]}),Y=(e.inlineBreakOpportunities=function(A,e){var t=(0,o.toCodePoints)(A),r=T,B=W(t,e),s=n(B,3),a=s[0],i=s[1],c=s[2];return t.forEach(function(A,e){r+=(0,o.fromCodePoint)(A)+(e>=t.length-1?M:G(t,i,a,e+1,c))}),r},function(){function A(e,t,r,n){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._codePoints=e,this.required=t===M,this.start=r,this.end=n}return r(A,[{key:"slice",value:function(){return o.fromCodePoint.apply(void 0,function(A){if(Array.isArray(A)){for(var e=0,t=Array(A.length);e=c)return{done:!0};for(var A=T;l>B,c=e.UTRIE2_DATA_BLOCK_LENGTH=1<>B,w=e.UTRIE2_INDEX_2_BMP_LENGTH=i+l,u=e.UTRIE2_UTF8_2B_INDEX_2_OFFSET=w,U=e.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,g=e.UTRIE2_INDEX_1_OFFSET=u+U,F=e.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>s,C=e.UTRIE2_INDEX_2_BLOCK_LENGTH=1<=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>B])<>B)])<>s),e=this.index[e],e+=A>>B&h,e=((e=this.index[e])<4)&&[Number(e[1]),Number(e[2]),Number(e[3]),Number(e[4])]},w=function(A){return[Math.min(A[0],255),Math.min(A[1],255),Math.min(A[2],255),A.length>3?A[3]:null]},u=function(A){return g[A.toLowerCase()]||!1},U=function(){function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A);var t=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(Array.isArray(e)?w(e):s(e)||c(e)||l(e)||u(e)||a(e)||[0,0,0,null],4),r=t[0],n=t[1],B=t[2],o=t[3];this.r=r,this.g=n,this.b=B,this.a=o}return function(A,e,t){e&&n(A.prototype,e)}(A,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}}]),A}(),g={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]},F=new U([0,0,0,0]),C=function(A){switch(A){case"underline":return 1;case"overline":return 2;case"line-through":return 3}return 4},h=function(A){var e=function(A){return"none"===A?null:A.split(" ").map(C)}(A.textDecorationLine?A.textDecorationLine:A.textDecoration);return null===e?null:{textDecorationLine:e,textDecorationColor:A.textDecorationColor?new U(A.textDecorationColor):null,textDecorationStyle:function(A){switch(A){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4}return 0}(A.textDecorationStyle)}};function d(A,e){for(var t=0;t=0;t--){var r=A.item(t);"content"!==r&&e.style.setProperty(r,A.getPropertyValue(r))}return e};function y(A,e){for(var t=0;t1&&(r/=l,n/=l,B/=l,s/=l,o/=l,a/=l,i/=l,c/=l);var w=A.width-B,u=A.height-a,U=A.width-o,g=A.height-c;return{topLeftOuter:r>0||n>0?_(A.left,A.top,r,n,R.TOP_LEFT):new M(A.left,A.top),topLeftInner:r>0||n>0?_(A.left+e[3].borderWidth,A.top+e[0].borderWidth,Math.max(0,r-e[3].borderWidth),Math.max(0,n-e[0].borderWidth),R.TOP_LEFT):new M(A.left+e[3].borderWidth,A.top+e[0].borderWidth),topRightOuter:B>0||s>0?_(A.left+w,A.top,B,s,R.TOP_RIGHT):new M(A.left+A.width,A.top),topRightInner:B>0||s>0?_(A.left+Math.min(w,A.width+e[3].borderWidth),A.top+e[0].borderWidth,w>A.width+e[3].borderWidth?0:B-e[3].borderWidth,s-e[0].borderWidth,R.TOP_RIGHT):new M(A.left+A.width-e[1].borderWidth,A.top+e[0].borderWidth),bottomRightOuter:o>0||a>0?_(A.left+U,A.top+u,o,a,R.BOTTOM_RIGHT):new M(A.left+A.width,A.top+A.height),bottomRightInner:o>0||a>0?_(A.left+Math.min(U,A.width-e[3].borderWidth),A.top+Math.min(u,A.height+e[0].borderWidth),Math.max(0,o-e[1].borderWidth),a-e[2].borderWidth,R.BOTTOM_RIGHT):new M(A.left+A.width-e[1].borderWidth,A.top+A.height-e[2].borderWidth),bottomLeftOuter:i>0||c>0?_(A.left,A.top+g,i,c,R.BOTTOM_LEFT):new M(A.left,A.top+A.height),bottomLeftInner:i>0||c>0?_(A.left+e[3].borderWidth,A.top+g,Math.max(0,i-e[3].borderWidth),c-e[2].borderWidth,R.BOTTOM_LEFT):new M(A.left+e[3].borderWidth,A.top+A.height-e[2].borderWidth)}},R={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3},_=function(A,e,t,r,n){var B=(Math.sqrt(2)-1)/3*4,s=t*B,o=r*B,a=A+t,i=e+r;switch(n){case R.TOP_LEFT:return new X(new M(A,i),new M(A,i-o),new M(a-s,e),new M(a,e));case R.TOP_RIGHT:return new X(new M(A,e),new M(A+s,e),new M(a,i-o),new M(a,i));case R.BOTTOM_RIGHT:return new X(new M(a,e),new M(a,e+o),new M(A+s,i),new M(A,i));case R.BOTTOM_LEFT:default:return new X(new M(a,i),new M(a-s,i),new M(A,e+o),new M(A,e))}},P=["top","right","bottom","left"],G=function(A){return P.map(function(e){return new v(A.getPropertyValue("padding-".concat(e)))})},W={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},Y=W,q=function A(e){switch(function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),e){case"contain":this.size=1;break;case"cover":this.size=2;break;case"auto":this.size=0;break;default:this.value=new v(e)}},j=new q("auto"),Z=function(A,e,t,r){var n=function(A,e){return new L(A.left+e[3].borderWidth,A.top+e[0].borderWidth,A.width-(e[1].borderWidth+e[3].borderWidth),A.height-(e[0].borderWidth+e[2].borderWidth))}(e,r);switch(A){case Y.BORDER_BOX:return e;case Y.CONTENT_BOX:var B=t[3].getAbsoluteValue(e.width),s=t[1].getAbsoluteValue(e.width),o=t[0].getAbsoluteValue(e.width),a=t[2].getAbsoluteValue(e.width);return new L(n.left+B,n.top+o,n.width-B-s,n.height-o-a);case Y.PADDING_BOX:default:return n}},$=function(A,e,t){return new M(A[0].getAbsoluteValue(t.width-e.width),A[1].getAbsoluteValue(t.height-e.height))},AA=function(A,e){return{backgroundColor:new U(A.backgroundColor),backgroundImage:rA(A,e),backgroundClip:eA(A.backgroundClip),backgroundOrigin:tA(A.backgroundOrigin)}},eA=function(A){switch(A){case"padding-box":return W.PADDING_BOX;case"content-box":return W.CONTENT_BOX}return W.BORDER_BOX},tA=function(A){switch(A){case"padding-box":return Y.PADDING_BOX;case"content-box":return Y.CONTENT_BOX}return Y.BORDER_BOX},rA=function(A,e){var t=sA(A.backgroundImage).map(function(A){if("url"===A.method){var t=e.loadImage(A.args[0]);A.args=t?[t]:[]}return A}),r=A.backgroundPosition.split(","),n=A.backgroundRepeat.split(","),B=A.backgroundSize.split(",");return t.map(function(A,e){var t=(B[e]||"auto").trim().split(" ").map(nA),s=(r[e]||"auto").trim().split(" ").map(BA);return{source:A,repeat:function(A){switch(("string"==typeof n[e]?n[e]:n[0]).trim()){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":return 0}return 0}(),size:t.length<2?[t[0],j]:[t[0],t[1]],position:s.length<2?[s[0],s[0]]:[s[0],s[1]]}})},nA=function(A){return"auto"===A?j:new q(A)},BA=function(A){switch(A){case"bottom":case"right":return new v("100%");case"left":case"top":return new v("0%");case"auto":return new v("0")}return new v(A)},sA=function(A){var e=/^\s$/,t=[],r=[],n="",B=null,s="",o=0,a=0,i=function(){var A="";if(n){'"'===s.substr(0,1)&&(s=s.substr(1,s.length-2)),s&&r.push(s.trim());var e=n.indexOf("-",1)+1;"-"===n.substr(0,1)&&e>0&&(A=n.substr(0,e).toLowerCase(),n=n.substr(e)),"none"!==(n=n.toLowerCase())&&t.push({prefix:A,method:n,args:r})}r=[],n=s=""};return A.split("").forEach(function(A){if(0!==o||!e.test(A)){switch(A){case'"':B?B===A&&(B=null):B=A;break;case"(":if(B)break;if(0===o)return void(o=1);a++;break;case")":if(B)break;if(1===o){if(0===a)return o=0,void i();a--}break;case",":if(B)break;if(0===o)return void i();if(1===o&&0===a&&!n.match(/^url$/i))return r.push(s.trim()),void(s="")}0===o?n+=A:s+=A}}),i(),t},oA=Object.keys({TOP:0,RIGHT:1,BOTTOM:2,LEFT:3}).map(function(A){return A.toLowerCase()}),aA=function(A){return oA.map(function(e){var t=new U(A.getPropertyValue("border-".concat(e,"-color"))),r=function(A){switch(A){case"none":return 0}return 1}(A.getPropertyValue("border-".concat(e,"-style"))),n=parseFloat(A.getPropertyValue("border-".concat(e,"-width")));return{borderColor:t,borderStyle:r,borderWidth:isNaN(n)?0:n}})};var iA=["top-left","top-right","bottom-right","bottom-left"],cA=function(A){return iA.map(function(e){var t=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(A.getPropertyValue("border-".concat(e,"-radius")).split(" ").map(v.create),2),r=t[0],n=t[1];return void 0===n?[r,r]:[r,n]})},QA={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},lA=function(A,e){return A|function(A){switch(e){case"block":return QA.BLOCK;case"inline":return QA.INLINE;case"run-in":return QA.RUN_IN;case"flow":return QA.FLOW;case"flow-root":return QA.FLOW_ROOT;case"table":return QA.TABLE;case"flex":return QA.FLEX;case"grid":return QA.GRID;case"ruby":return QA.RUBY;case"subgrid":return QA.SUBGRID;case"list-item":return QA.LIST_ITEM;case"table-row-group":return QA.TABLE_ROW_GROUP;case"table-header-group":return QA.TABLE_HEADER_GROUP;case"table-footer-group":return QA.TABLE_FOOTER_GROUP;case"table-row":return QA.TABLE_ROW;case"table-cell":return QA.TABLE_CELL;case"table-column-group":return QA.TABLE_COLUMN_GROUP;case"table-column":return QA.TABLE_COLUMN;case"table-caption":return QA.TABLE_CAPTION;case"ruby-base":return QA.RUBY_BASE;case"ruby-text":return QA.RUBY_TEXT;case"ruby-base-container":return QA.RUBY_BASE_CONTAINER;case"ruby-text-container":return QA.RUBY_TEXT_CONTAINER;case"contents":return QA.CONTENTS;case"inline-block":return QA.INLINE_BLOCK;case"inline-list-item":return QA.INLINE_LIST_ITEM;case"inline-table":return QA.INLINE_TABLE;case"inline-flex":return QA.INLINE_FLEX;case"inline-grid":return QA.INLINE_GRID}return QA.NONE}()},wA=function(A){return A.split(" ").reduce(lA,0)},uA=function(A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0},UA=function(A){return{fontFamily:A.fontFamily,fontSize:A.fontSize,fontStyle:A.fontStyle,fontVariant:A.fontVariant,fontWeight:function(A){switch(A){case"normal":return 400;case"bold":return 700}var e=parseInt(A,10);return isNaN(e)?400:e}(A.fontWeight)}},gA=function(A){if("normal"===A)return 0;var e=parseFloat(A);return isNaN(e)?0:e},FA=function(A){switch(A){case"strict":return"strict";case"normal":default:return"normal"}},CA=function(A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}},hA=function(A){var e=sA(A.getPropertyValue("list-style-image"));return{listStyleType:CA(A.getPropertyValue("list-style-type")),listStyleImage:e.length?e[0]:null,listStylePosition:dA(A.getPropertyValue("list-style-position"))}},dA=function(A){switch(A){case"inside":return 0;case"outside":default:return 1}},HA=["top","right","bottom","left"],fA=function(A){return HA.map(function(e){return new v(A.getPropertyValue("margin-".concat(e)))})},EA={VISIBLE:0,HIDDEN:1,SCROLL:2,AUTO:3},pA=function(A){switch(A){case"hidden":return EA.HIDDEN;case"scroll":return EA.SCROLL;case"auto":return EA.AUTO;case"visible":default:return EA.VISIBLE}},KA=function(A){switch(A){case"break-word":return 1;case"normal":default:return 0}},mA={STATIC:0,RELATIVE:1,ABSOLUTE:2,FIXED:3,STICKY:4},bA=function(A){switch(A){case"relative":return mA.RELATIVE;case"absolute":return mA.ABSOLUTE;case"fixed":return mA.FIXED;case"sticky":return mA.STICKY}return mA.STATIC},yA=/^([+-]|\d|\.)$/i,NA=function(A){if("none"===A||"string"!=typeof A)return null;for(var e="",t=!1,r=[],n=[],B=0,s=null,o=function(){e.length&&(t?r.push(parseFloat(e)):s=new U(e)),t=!1,e=""},a=function(){r.length&&null!==s&&n.push({color:s,offsetX:r[0]||0,offsetY:r[1]||0,blur:r[2]||0}),r.splice(0,r.length),s=null},i=0;i";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(RA,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_BASE64_DRAWING(){return function(A){var e=function(A,e){var t=new Image,r=A.createElement("canvas"),n=r.getContext("2d");return new Promise(function(A){t.src=e;var B=function(){try{n.drawImage(t,0,0),r.toDataURL()}catch(e){return A(!1)}return A(!0)};t.onload=B,t.onerror=function(){return A(!1)},!0===t.complete&&setTimeout(function(){B()},500)})}(document,A);return Object.defineProperty(RA,"SUPPORT_BASE64_DRAWING",{value:function(){return e}}),e}},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas");e.width=100,e.height=100;var t=e.getContext("2d");t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,100,100);var r=new Image,n=e.toDataURL();r.src=n;var B=VA(100,100,0,0,r);return t.fillStyle="red",t.fillRect(0,0,100,100),kA(B).then(function(e){t.drawImage(e,0,0);var r=t.getImageData(0,0,100,100).data;t.fillStyle="red",t.fillRect(0,0,100,100);var B=A.createElement("div");return B.style.backgroundImage="url(".concat(n,")"),B.style.height="".concat(100,"px"),JA(r)?kA(VA(100,100,0,0,B)):Promise.reject(!1)}).then(function(A){return t.drawImage(A,0,0),JA(t.getImageData(0,0,100,100).data)}).catch(function(A){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(RA,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(RA,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(RA,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(RA,"SUPPORT_CORS_XHR",{value:A}),A}},_A=RA,PA=t(0),GA=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.text=e,this.bounds=t},WA=function(A,e,t){var r=A.ownerDocument.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var n=A.parentNode;if(n){n.replaceChild(r,A);var B=O(r,e,t);return r.firstChild&&n.replaceChild(r.firstChild,r),B}return new L(0,0,0,0)},YA=function(A,e,t,r,n){var B=A.ownerDocument.createRange();return B.setStart(A,e),B.setEnd(A,e+t),L.fromClientRect(B.getBoundingClientRect(),r,n)};function qA(A,e){for(var t=0;t0)if(_A.SUPPORT_RANGE_BOUNDS)a.push(new GA(Q,YA(t,i,Q.length,s,o)));else{var l=t.splitText(Q.length);a.push(new GA(Q,WA(t,s,o))),t=l}else _A.SUPPORT_RANGE_BOUNDS||(t=t.splitText(Q.length));i+=Q.length}return a}(r,t,e))}}]),A}(),ZA=/(^|\s|:|-|\(|\))([a-z])/g,$A=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ZA,Ae);case 2:return A.toUpperCase();default:return A}};function Ae(A,e,t){return A.length>0?e+t.toUpperCase():A}var ee=function A(e,t,n){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.type=r.CIRCLE,this.x=e,this.y=t,this.radius=n},te=new U([42,42,42]),re=new U([165,165,165]),ne=new U([222,222,222]),Be={borderWidth:1,borderColor:re,borderStyle:1},se=[Be,Be,Be,Be],oe={backgroundColor:ne,backgroundImage:[],backgroundClip:W.PADDING_BOX,backgroundOrigin:Y.PADDING_BOX},ae=new v("50%"),ie=[ae,ae],ce=[ie,ie,ie,ie],Qe=new v("3px"),le=[Qe,Qe],we=[le,le,le,le],ue=function(A){return"radio"===A.type?ce:we},Ue=function(A,e){if("radio"===A.type||"checkbox"===A.type){if(A.checked){var t=Math.min(e.bounds.width,e.bounds.height);e.childNodes.push("checkbox"===A.type?[new M(e.bounds.left+.39363*t,e.bounds.top+.79*t),new M(e.bounds.left+.16*t,e.bounds.top+.5549*t),new M(e.bounds.left+.27347*t,e.bounds.top+.44071*t),new M(e.bounds.left+.39694*t,e.bounds.top+.5649*t),new M(e.bounds.left+.72983*t,e.bounds.top+.23*t),new M(e.bounds.left+.84*t,e.bounds.top+.34085*t),new M(e.bounds.left+.39363*t,e.bounds.top+.79*t)]:new ee(e.bounds.left+t/4,e.bounds.top+t/4,t/4))}}else he(de(A),A,e,!1)},ge=function(A,e){he(A.value,A,e,!0)},Fe=function(A,e){var t=A.options[A.selectedIndex||0];he(t&&t.text||"",A,e,!1)},Ce=function(A){return A.width>A.height?(A.left+=(A.width-A.height)/2,A.width=A.height):A.width0&&n){var B=e.ownerDocument.createElement("html2canvaswrapper");b(e.ownerDocument.defaultView.getComputedStyle(e,null),B),B.style.position="absolute",B.style.left="".concat(t.bounds.left,"px"),B.style.top="".concat(t.bounds.top,"px"),r||(B.style.whiteSpace="nowrap");var s=e.ownerDocument.createTextNode(A);B.appendChild(s),n.appendChild(B),t.childNodes.push(jA.fromTextNode(s,t)),n.removeChild(B)}},de=function(A){var e="password"===A.type?new Array(A.value.length+1).join("•"):A.value;return 0===e.length?A.placeholder||"":e},He=["OL","UL","MENU"],fe=function(A){var e=A.parent;if(!e)return null;do{if(-1!==He.indexOf(e.tagName))return e;e=e.parent}while(e);return A.parent},Ee=function(A,e,t){var r=e.style.listStyle;if(r){var n,B=A.ownerDocument.defaultView.getComputedStyle(A,null),s=A.ownerDocument.createElement("html2canvaswrapper");switch(b(B,s),s.style.position="absolute",s.style.bottom="auto",s.style.display="block",s.style.letterSpacing="normal",r.listStylePosition){case 1:s.style.left="auto",s.style.right="".concat(A.ownerDocument.defaultView.innerWidth-e.bounds.left-e.style.margin[1].getAbsoluteValue(e.bounds.width)+7,"px"),s.style.textAlign="right";break;case 0:s.style.left="".concat(e.bounds.left-e.style.margin[3].getAbsoluteValue(e.bounds.width),"px"),s.style.right="auto",s.style.textAlign="left"}var o=e.style.margin[0].getAbsoluteValue(e.bounds.width),a=r.listStyleImage;if(a)if("url"===a.method){var i=A.ownerDocument.createElement("img");i.src=a.args[0],s.style.top="".concat(e.bounds.top-o,"px"),s.style.width="auto",s.style.height="auto",s.appendChild(i)}else{var c=.5*parseFloat(e.style.font.fontSize);s.style.top="".concat(e.bounds.top-o+e.bounds.height-1.5*c,"px"),s.style.width="".concat(c,"px"),s.style.height="".concat(c,"px"),s.style.backgroundImage=B.listStyleImage}else"number"==typeof e.listIndex&&(n=A.ownerDocument.createTextNode(Me(e.listIndex,r.listStyleType,!0)),s.appendChild(n),s.style.top="".concat(e.bounds.top-o,"px"));var Q=A.ownerDocument.body;Q.appendChild(s),n?(e.childNodes.push(jA.fromTextNode(n,e)),Q.removeChild(s)):e.childNodes.push(new Xe(s,e,t,0))}},pe={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Ke={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},me={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},be={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ye=function(A,e,t,r,n,B){return At?Me(A,n,B.length>0):r.integers.reduce(function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e},"")+B},Ne=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},ve=function(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(Ne(Math.abs(A),B,r,function(A){return Object(PA.fromCodePoint)(Math.floor(A%B)+e)})+n)},Ie=function(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",r=e.length;return Ne(Math.abs(A),r,!1,function(A){return e[Math.floor(A%r)]})+t},De=function(A,e,t,r,n,B){if(A<-9999||A>9999)return Me(A,4,n.length>0);var s=Math.abs(A),o=n;if(0===s)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var i=s%10;0===i&&K(B,1)&&""!==o?o=e[i]+o:i>1||1===i&&0===a||1===i&&1===a&&K(B,2)||1===i&&1===a&&K(B,4)&&A>100||1===i&&a>1&&K(B,8)?o=e[i]+(a>0?t[a-1]:"")+o:1===i&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o},Me=function(A,e,t){var r=t?". ":"",n=t?"、":"",B=t?", ":"";switch(e){case 0:return"•";case 1:return"◦";case 2:return"◾";case 5:var s=ve(A,48,57,!0,r);return s.length<4?"0".concat(s):s;case 4:return Ie(A,"〇一二三四五六七八九",n);case 6:return ye(A,1,3999,pe,3,r).toLowerCase();case 7:return ye(A,1,3999,pe,3,r);case 8:return ve(A,945,969,!1,r);case 9:return ve(A,97,122,!1,r);case 10:return ve(A,65,90,!1,r);case 11:return ve(A,1632,1641,!0,r);case 12:case 49:return ye(A,1,9999,Ke,3,r);case 35:return ye(A,1,9999,Ke,3,r).toLowerCase();case 13:return ve(A,2534,2543,!0,r);case 14:case 30:return ve(A,6112,6121,!0,r);case 15:return Ie(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return Ie(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return De(A,"零一二三四五六七八九","十百千萬","負",n,14);case 47:return De(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",n,15);case 42:return De(A,"零一二三四五六七八九","十百千萬","负",n,14);case 41:return De(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",n,15);case 26:return De(A,"〇一二三四五六七八九","十百千万","マイナス",n,0);case 25:return De(A,"零壱弐参四伍六七八九","拾百千万","マイナス",n,7);case 31:return De(A,"영일이삼사오육칠팔구","십백천만","마이너스",B,7);case 33:return De(A,"零一二三四五六七八九","十百千萬","마이너스",B,0);case 32:return De(A,"零壹貳參四五六七八九","拾百千","마이너스",B,7);case 18:return ve(A,2406,2415,!0,r);case 20:return ye(A,1,19999,be,3,r);case 21:return ve(A,2790,2799,!0,r);case 22:return ve(A,2662,2671,!0,r);case 22:return ye(A,1,10999,me,3,r);case 23:return Ie(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ie(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ve(A,3302,3311,!0,r);case 28:return Ie(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return Ie(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return ve(A,3792,3801,!0,r);case 37:return ve(A,6160,6169,!0,r);case 38:return ve(A,4160,4169,!0,r);case 39:return ve(A,2918,2927,!0,r);case 40:return ve(A,1776,1785,!0,r);case 43:return ve(A,3046,3055,!0,r);case 44:return ve(A,3174,3183,!0,r);case 45:return ve(A,3664,3673,!0,r);case 46:return ve(A,3872,3881,!0,r);case 3:default:return ve(A,48,57,!0,r)}};function Te(A,e){for(var t=0;t0&&0===this.style.visibility}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==mA.STATIC&&this.style.position!==mA.RELATIVE}},{key:"isPositioned",value:function(){return this.style.position!==mA.STATIC}},{key:"isFloating",value:function(){return 0!==this.style.float}},{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 K(this.style.display,QA.INLINE)||K(this.style.display,QA.INLINE_BLOCK)||K(this.style.display,QA.INLINE_FLEX)||K(this.style.display,QA.INLINE_GRID)||K(this.style.display,QA.INLINE_LIST_ITEM)||K(this.style.display,QA.INLINE_TABLE)}},{key:"isInlineBlockOrInlineTable",value:function(){return K(this.style.display,QA.INLINE_BLOCK)||K(this.style.display,QA.INLINE_TABLE)}}]),A}(),ze=function(A,e){if(A instanceof A.ownerDocument.defaultView.SVGSVGElement||A instanceof SVGSVGElement){var t=new XMLSerializer;return e.loadImage("data:image/svg+xml,".concat(encodeURIComponent(t.serializeToString(A))))}switch(A.tagName){case"IMG":var r=A;return e.loadImage(r.currentSrc||r.src);case"CANVAS":var n=A;return e.loadCanvas(n);case"IFRAME":var B=A.getAttribute("data-html2canvas-internal-iframe-key");if(B)return B}return null};function Le(A,e){for(var t=0;tA.optimumDistance)?{optimumCorner:n,optimumDistance:B}:A},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},at=function(A,e,t,r,n){var B=t.x,s=t.y,o=0,a=0;switch(A){case"closest-side":0===e?o=a=Math.min(Math.abs(B),Math.abs(B-n.width),Math.abs(s),Math.abs(s-n.height)):1===e&&(o=Math.min(Math.abs(B),Math.abs(B-n.width)),a=Math.min(Math.abs(s),Math.abs(s-n.height)));break;case"closest-corner":if(0===e)o=a=Math.min(m(B,s),m(B,s-n.height),m(B-n.width,s),m(B-n.width,s-n.height));else if(1===e){var i=Math.min(Math.abs(s),Math.abs(s-n.height))/Math.min(Math.abs(B),Math.abs(B-n.width)),c=ot(n,B,s,!0);a=i*(o=m(c.x-B,(c.y-s)/i))}break;case"farthest-side":0===e?o=a=Math.max(Math.abs(B),Math.abs(B-n.width),Math.abs(s),Math.abs(s-n.height)):1===e&&(o=Math.max(Math.abs(B),Math.abs(B-n.width)),a=Math.max(Math.abs(s),Math.abs(s-n.height)));break;case"farthest-corner":if(0===e)o=a=Math.max(m(B,s),m(B,s-n.height),m(B-n.width,s),m(B-n.width,s-n.height));else if(1===e){var Q=Math.max(Math.abs(s),Math.abs(s-n.height))/Math.max(Math.abs(B),Math.abs(B-n.width)),l=ot(n,B,s,!1);a=Q*(o=m(l.x-B,(l.y-s)/Q))}break;default:o=r.x||0,a=void 0!==r.y?r.y:o}return{x:o,y:a}},it=function(A){var e="",t="",r="",n="",B=0,s=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,o=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,a=A[B].match(s);a&&B++;var i=A[B].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);i&&(e=i[1]||"","contain"===(r=i[2]||"")?r="closest-side":"cover"===r&&(r="farthest-corner"),B++);var c=A[B].match(o);c&&B++;var Q=A[B].match(s);Q&&B++;var l=A[B].match(o);l&&B++;var w=Q||a;w&&w[1]&&(n=w[1]+(/^\d+$/.test(w[1])?"px":""),w[2]&&(n+=" "+w[2]+(/^\d+$/.test(w[2])?"px":"")));var u=l||c;return u&&(t=u[0],u[1]||(t+="px")),!n||e||t||r||(t=n,n=""),n&&(n="at ".concat(n)),[[e,r,t,n].filter(function(A){return!!A}).join(" ")].concat(A.slice(B))},ct=function(A){return A.map(function(A){return A.match(je)}).map(function(e,t){if(!e)return A[t];switch(e[1]){case"from":return"".concat(e[4]," 0%");case"to":return"".concat(e[4]," 100%");case"color-stop":return"%"===e[3]?"".concat(e[4]," ").concat(e[2]):"".concat(e[4]," ").concat(100*parseFloat(e[2]),"%")}})};function Qt(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function lt(A,e){for(var t=0;t0?t.width:r.width,B="number"==typeof t.height&&t.height>0?t.height:r.height;n>0&&B>0&&e.target.clip([k(A.curvedBounds)],function(){e.target.drawImage(t,new L(0,0,n,B),r)})}}},r=A.getClipPaths();r.length?this.target.clip(r,t):t()}},{key:"renderNodeBackgroundAndBorders",value:function(A){var e=this,t=!A.style.background.backgroundColor.isTransparent()||A.style.background.backgroundImage.length,r=A.style.border.some(function(A){return 0!==A.borderStyle&&!A.borderColor.isTransparent()}),n=function(){var r=function(A,e){switch(e){case W.BORDER_BOX:return function(A){return[A.topLeftOuter,A.topRightOuter,A.bottomRightOuter,A.bottomLeftOuter]}(A);case W.PADDING_BOX:default:return k(A)}}(A.curvedBounds,A.style.background.backgroundClip);t&&e.target.clip([r],function(){A.style.background.backgroundColor.isTransparent()||e.target.fill(A.style.background.backgroundColor),e.renderBackgroundImage(A)}),A.style.border.forEach(function(t,r){0===t.borderStyle||t.borderColor.isTransparent()||e.renderBorder(t,r,A.curvedBounds)})};if(t||r){var B=A.parent?A.parent.getClipPaths():[];B.length?this.target.clip(B,n):n()}}},{key:"renderBackgroundImage",value:function(A){var e=this;A.style.background.backgroundImage.slice(0).reverse().forEach(function(t){"url"===t.source.method&&t.source.args.length?e.renderBackgroundRepeat(A,t):/gradient/i.test(t.source.method)&&e.renderBackgroundGradient(A,t)})}},{key:"renderBackgroundRepeat",value:function(A,e){var t=this.options.imageStore.get(e.source.args[0]);if(t){var r=Z(A.style.background.backgroundOrigin,A.bounds,A.style.padding,A.style.border),n=function(A,e,t){var r=0,n=0,B=A.size;if(1===B[0].size||2===B[0].size){var s=t.width/t.height,o=e.width/e.height;return s0?r.push(a):t.push(a):a.container.isFloating()?n.push(a):B.push(a)}return[e,t,r,n,B]},gt=function(A,e){return A.container.style.zIndex.order>e.container.style.zIndex.order?1:A.container.style.zIndex.ordere.container.index?1:-1},Ft=function(A,e){if(!e.proxy)return Promise.reject(null);var t=e.proxy;return new Promise(function(r,n){var B=_A.SUPPORT_CORS_XHR&&_A.SUPPORT_RESPONSE_TYPE?"blob":"text",s=_A.SUPPORT_CORS_XHR?new XMLHttpRequest:new XDomainRequest;if(s.onload=function(){if(s instanceof XMLHttpRequest)if(200===s.status)if("text"===B)r(s.response);else{var A=new FileReader;A.addEventListener("load",function(){return r(A.result)},!1),A.addEventListener("error",function(A){return n(A)},!1),A.readAsDataURL(s.response)}else n("");else r(s.responseText)},s.onerror=n,s.open("GET","".concat(t,"?url=").concat(encodeURIComponent(A),"&responseType=").concat(B)),"text"!==B&&s instanceof XMLHttpRequest&&(s.responseType=B),e.imageTimeout){var o=e.imageTimeout;s.timeout=o,s.ontimeout=function(){return n("")}}s.send()})};function Ct(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(A,e){for(var t=0;t0&&t.push({type:1,value:i[0]});break;case"counter":if(i.length>0){var l={type:3,name:i[0]};i.length>1&&(l.format=i[1]),t.push(l)}break;case"counters":if(i.length>0){var w={type:4,name:i[0]};i.length>1&&(w.glue=i[1]),i.length>2&&(w.format=i[2]),t.push(w)}break;case"url":i.length>0&&t.push({type:2,value:i[0]})}s=!1,o=""}break;case",":n?o+=Q:s&&(i.push(o),o="");break;case" ":case"\t":n?o+=Q:o&&(Tt(t,o),o="");break;default:o+=Q}"\\"!==Q&&(B=!1)}return o&&Tt(t,o),e&&(e[A]=t),t},Tt=function(A,e){switch(e){case"open-quote":A.push({type:5});break;case"close-quote":A.push({type:6})}},St=function(A,e,t){var r=A.quotes?A.quotes.split(/\s+/):["'\"'","'\"'"],n=2*t;return n>=r.length&&(n=r.length-2),e||++n,r[n].replace(/^["']|["']$/g,"")},Xt=function(A,e,t){for(var r=A.length,n="",B=0;B0&&(n+=e||""),n+=Me(A[B],CA(t||"decimal"),!1);return n};function zt(A,e){for(var t=0;t1&&(t.backgroundColor=""),t.backgroundImage=A.join(",")}),A instanceof HTMLImageElement&&this.resourceLoader.inlineImage(A.src).then(function(e){if(e&&A instanceof HTMLImageElement&&A.parentNode){var t=A.parentNode,r=b(A.style,e.cloneNode(!1));t.replaceChild(r,A)}}).catch(function(A){})}}},{key:"inlineFonts",value:function(A){var e=this;return Promise.all(Array.from(A.styleSheets).map(function(e){return e.href?fetch(e.href).then(function(A){return A.text()}).then(function(A){return xt(A,e.href)}).catch(function(A){return[]}):Ot(e,A)})).then(function(A){return A.reduce(function(A,e){return A.concat(e)},[])}).then(function(A){return Promise.all(A.map(function(A){return fetch(A.formats[0].src).then(function(A){return A.blob()}).then(function(A){return new Promise(function(e,t){var r=new FileReader;r.onerror=t,r.onload=function(){var A=r.result;e(A)},r.readAsDataURL(A)})}).then(function(e){return A.fontFace.setProperty("src",'url("'.concat(e,'")')),"@font-face {".concat(A.fontFace.cssText," ")})}))}).then(function(t){var r=A.createElement("style");r.textContent=t.join("\n"),e.documentElement.appendChild(r)})}},{key:"createElementClone",value:function(A){var e=this;if(this.copyStyles&&A instanceof HTMLCanvasElement){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(A){}}if(A instanceof HTMLIFrameElement){var r=A.cloneNode(!1),n=qt();r.setAttribute("data-html2canvas-internal-iframe-key",n);var B=O(A,0,0),s=B.width,o=B.height;return this.resourceLoader.cache[n]=Zt(A,this.options).then(function(A){return e.renderer(A,{async:e.options.async,allowTaint:e.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:e.options.imageTimeout,logging:e.options.logging,proxy:e.options.proxy,removeContainer:e.options.removeContainer,scale:e.options.scale,foreignObjectRendering:e.options.foreignObjectRendering,useCORS:e.options.useCORS,target:new f,width:s,height:o,x:0,y:0,windowWidth:A.ownerDocument.defaultView.innerWidth,windowHeight:A.ownerDocument.defaultView.innerHeight,scrollX:A.ownerDocument.defaultView.pageXOffset,scrollY:A.ownerDocument.defaultView.pageYOffset},e.logger.child(n))}).then(function(e){return new Promise(function(t,n){var B=document.createElement("img");B.onload=function(){return t(e)},B.onerror=function(A){"data:,"==B.src?t(e):n(A)},B.src=e.toDataURL(),r.parentNode&&r.parentNode.replaceChild(b(A.ownerDocument.defaultView.getComputedStyle(A),B),r)})}),r}try{if(A instanceof HTMLStyleElement&&A.sheet&&A.sheet.cssRules){var a=[].slice.call(A.sheet.cssRules,0).reduce(function(A,e){return e&&e.cssText?A+e.cssText:A},""),i=A.cloneNode(!1);return i.textContent=a,i}}catch(A){if(this.logger.log("Unable to access cssRules property"),"SecurityError"!==A.name)throw this.logger.log(A),A}return A.cloneNode(!1)}},{key:"cloneNode",value:function(A){var e=A.nodeType===Node.TEXT_NODE?document.createTextNode(A.nodeValue):this.createElementClone(A),t=A.ownerDocument.defaultView,r=A instanceof t.HTMLElement?t.getComputedStyle(A):null,n=A instanceof t.HTMLElement?t.getComputedStyle(A,":before"):null,B=A instanceof t.HTMLElement?t.getComputedStyle(A,":after"):null;this.referenceElement===A&&e instanceof t.HTMLElement&&(this.clonedReferenceElement=e),e instanceof t.HTMLBodyElement&&Gt(e);for(var s=function(A,e){if(!A||!A.counterReset||"none"===A.counterReset)return[];for(var t=[],r=A.counterReset.split(/\s*,\s*/),n=r.length,B=0;B0&&"complete"===t.readyState&&(clearInterval(e),r(A))},50)}})};var er=function A(e,t,r){var n=e.ownerDocument,B=new L(t.scrollX,t.scrollY,t.windowWidth,t.windowHeight),s=n.documentElement?new U(getComputedStyle(n.documentElement).backgroundColor):F,o=n.body?new U(getComputedStyle(n.body).backgroundColor):F,a=e===n.documentElement?s.isTransparent()?o.isTransparent()?t.backgroundColor?new U(t.backgroundColor):null:o:s:t.backgroundColor?new U(t.backgroundColor):null;return(t.foreignObjectRendering?_A.SUPPORT_FOREIGNOBJECT_DRAWING:Promise.resolve(!1)).then(function(s){return s?function(A){return A.inlineFonts(n).then(function(){return A.resourceLoader.ready()}).then(function(){var B=new xA(A.documentElement),s=n.defaultView,o=s.pageXOffset,i=s.pageYOffset,c="HTML"===e.tagName||"BODY"===e.tagName?x(n):O(e,o,i),Q=c.width,l=c.height,w=c.left,u=c.top;return B.render({backgroundColor:a,logger:r,scale:t.scale,x:"number"==typeof t.x?t.x:w,y:"number"==typeof t.y?t.y:u,width:"number"==typeof t.width?t.width:Math.ceil(Q),height:"number"==typeof t.height?t.height:Math.ceil(l),windowWidth:t.windowWidth,windowHeight:t.windowHeight,scrollX:t.scrollX,scrollY:t.scrollY})})}(new Lt(e,t,r,!0,A)):function(A,e,t,r,n,B){var s=new Lt(t,r,n,!1,B),o=A.defaultView.pageXOffset,a=A.defaultView.pageYOffset;return $t(A,e).then(function(n){var B=n.contentWindow,i=B.document,c=Ar(n).then(function(){s.scrolledElements.forEach(Yt),B.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||B.scrollY===e.top&&B.scrollX===e.left||(i.documentElement.style.top=-e.top+"px",i.documentElement.style.left=-e.left+"px",i.documentElement.style.position="absolute");var t=Promise.resolve([n,s.clonedReferenceElement,s.resourceLoader]),o=r.onclone;return s.clonedReferenceElement instanceof B.HTMLElement||s.clonedReferenceElement instanceof A.defaultView.HTMLElement||s.clonedReferenceElement instanceof HTMLElement?"function"==typeof o?Promise.resolve().then(function(){return o(i)}).then(function(){return t}):t:Promise.reject("")});return i.open(),i.write("".concat(function(A){var e="";return A&&(e+=""),e}(document.doctype),"")),function(A,e,t){!A.defaultView||e===A.defaultView.pageXOffset&&t===A.defaultView.pageYOffset||A.defaultView.scrollTo(e,t)}(t.ownerDocument,o,a),i.replaceChild(i.adoptNode(s.documentElement),i.documentElement),i.close(),c})}(n,B,e,t,r,A).then(function(A){var e=function(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=[],r=!0,n=!1,B=void 0;try{for(var s,o=A[Symbol.iterator]();!(r=(s=o.next()).done)&&(t.push(s.value),!e||t.length!==e);r=!0);}catch(A){n=!0,B=A}finally{try{r||null==o.return||o.return()}finally{if(n)throw B}}return t}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(A,3),B=e[0],s=e[1],o=e[2],i=function(A,e,t){var r=0,n=new Xe(A,null,e,r++),B=new Oe(n,null,!0);return function A(e,t,r,n,B){for(var s,o=e.firstChild;o;o=s){s=o.nextSibling;var a=o.ownerDocument.defaultView;if(o instanceof a.Text||o instanceof Text||a.parent&&o instanceof a.parent.Text)o.data.trim().length>0&&t.childNodes.push(jA.fromTextNode(o,t));else if(o instanceof a.HTMLElement||o instanceof HTMLElement||a.parent&&o instanceof a.parent.HTMLElement){if(-1===xe.indexOf(o.nodeName)){var i=new Xe(o,t,n,B++);if(i.isVisible()){"INPUT"===o.tagName?Ue(o,i):"TEXTAREA"===o.tagName?ge(o,i):"SELECT"===o.tagName?Fe(o,i):i.style.listStyle&&-1!==i.style.listStyle.listStyleType&&Ee(o,i,n);var c="TEXTAREA"!==o.tagName,Q=Ve(i,o);if(Q||ke(i)){var l=Q||i.isPositioned()?r.getRealParentStackingContext():r,w=new Oe(i,l,Q);l.contexts.push(w),c&&A(o,i,w,n,B)}else r.children.push(i),c&&A(o,i,r,n,B)}}}else if(o instanceof a.SVGSVGElement||o instanceof SVGSVGElement||a.parent&&o instanceof a.parent.SVGSVGElement){var u=new Xe(o,t,n,B++),U=Ve(u,o);if(U||ke(u)){var g=U||u.isPositioned()?r.getRealParentStackingContext():r,F=new Oe(u,g,U);g.contexts.push(F)}else r.children.push(u)}}}(A,n,B,e,1),B}(s,o),c=s.ownerDocument;return a===i.container.style.background.backgroundColor&&(i.container.style.background.backgroundColor=F),o.ready().then(function(A){var e=new _e(c),o=c.defaultView,Q=o.pageXOffset,l=o.pageYOffset,w="HTML"===s.tagName||"BODY"===s.tagName?x(n):O(s,Q,l),u=w.width,U=w.height,g=w.left,F=w.top,C={backgroundColor:a,fontMetrics:e,imageStore:A,logger:r,scale:t.scale,x:"number"==typeof t.x?t.x:g,y:"number"==typeof t.y?t.y:F,width:"number"==typeof t.width?t.width:Math.ceil(u),height:"number"==typeof t.height?t.height:Math.ceil(U)};if(Array.isArray(t.target))return Promise.all(t.target.map(function(A){return new wt(A,C).render(i)}));var h=new wt(t.target,C).render(i);return!0===t.removeContainer&&B.parentNode&&B.parentNode.removeChild(B),h})})})};function tr(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}var rr=function(A,e){var t=e||{},r=new p("boolean"!=typeof t.logging||t.logging);r.log("html2canvas ".concat("1.0.0-rc.0"));var n=A.ownerDocument;if(!n)return Promise.reject("Provided element is not within a Document");var B=n.defaultView,s={async:!0,allowTaint:!1,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,scale:B.devicePixelRatio||1,target:new f(t.canvas),useCORS:!1,windowWidth:B.innerWidth,windowHeight:B.innerHeight,scrollX:B.pageXOffset,scrollY:B.pageYOffset};return er(A,function(A){for(var e=1;e