(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{8430:function(A,e,t){
/*!
 * html2canvas 1.0.0-rc.7 <https://html2canvas.hertzen.com>
 * Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 */
A.exports=function(){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */var extendStatics=function(A,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)};function __extends(A,e){function __(){this.constructor=A}extendStatics(A,e),A.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function __assign(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n]);return A}).apply(this,arguments)};function __awaiter(A,e,t,r){return new(t||(t=Promise))((function(n,B){function fulfilled(A){try{step(r.next(A))}catch(A){B(A)}}function rejected(A){try{step(r.throw(A))}catch(A){B(A)}}function step(A){A.done?n(A.value):new t((function(e){e(A.value)})).then(fulfilled,rejected)}step((r=r.apply(A,e||[])).next())}))}function __generator(A,e){var t,r,n,B,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return B={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(B[Symbol.iterator]=function(){return this}),B;function verb(B){return function(o){return function step(B){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(n=2&B[0]?r.return:B[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,B[1])).done)return n;switch(r=0,n&&(B=[2&B[0],n.value]),B[0]){case 0:case 1:n=B;break;case 4:return s.label++,{value:B[1],done:!1};case 5:s.label++,r=B[1],B=[0];continue;case 7:B=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==B[0]&&2!==B[0])){s=0;continue}if(3===B[0]&&(!n||B[1]>n[0]&&B[1]<n[3])){s.label=B[1];break}if(6===B[0]&&s.label<n[1]){s.label=n[1],n=B;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(B);break}n[2]&&s.ops.pop(),s.trys.pop();continue}B=e.call(A,s)}catch(A){B=[6,A],r=0}finally{t=n=0}if(5&B[0])throw B[1];return{value:B[0]?B[1]:void 0,done:!0}}([B,o])}}}for(var A=function(){function Bounds(A,e,t,r){this.left=A,this.top=e,this.width=t,this.height=r}return Bounds.prototype.add=function(A,e,t,r){return new Bounds(this.left+A,this.top+e,this.width+t,this.height+r)},Bounds.fromClientRect=function(A){return new Bounds(A.left,A.top,A.width,A.height)},Bounds}(),parseBounds=function(e){return A.fromClientRect(e.getBoundingClientRect())},toCodePoints=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var B=A.charCodeAt(t++);56320==(64512&B)?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--)}else e.push(n)}return e},fromCodePoint=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,B="";++n<t;){var s=A[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===t||r.length>16384)&&(B+=String.fromCharCode.apply(String,r),r.length=0)}return B},e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;var n,slice16=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},B=function(){function Trie(A,e,t,r,n,B){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=n,this.data=B}return Trie.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},Trie}(),s=10,o=13,i=15,a=17,c=18,Q=19,u=20,w=21,U=22,l=24,C=25,g=26,E=27,F=28,h=30,d=32,H=33,f=34,p=35,N=37,K=38,I=39,m=40,T=42,R=function(A){var e,r,n,s=function(A){var e,r,n,B,s,o=.75*A.length,i=A.length,a=0;"="===A[A.length-1]&&(o--,"="===A[A.length-2]&&o--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),Q=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<i;e+=4)r=t[A.charCodeAt(e)],n=t[A.charCodeAt(e+1)],B=t[A.charCodeAt(e+2)],s=t[A.charCodeAt(e+3)],Q[a++]=r<<2|n>>4,Q[a++]=(15&n)<<4|B>>2,Q[a++]=(3&B)<<6|63&s;return c}(A),o=Array.isArray(s)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t}(s):new Uint32Array(s),i=Array.isArray(s)?function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t}(s):new Uint16Array(s),a=slice16(i,12,o[4]/2),c=2===o[5]?slice16(i,(24+o[4])/2):(e=o,r=Math.ceil((24+o[4])/4),e.slice?e.slice(r,n):new Uint32Array(Array.prototype.slice.call(e,r,n)));return new B(o[0],o[1],o[2],o[3],a,c)}("[encoded data, 50624 characters]"),L=[h,36],v=[1,2,3,5],O=[s,8],S=[E,g],D=v.concat(O),b=[K,I,m,f,p],M=[i,o],isAdjacentWithSpaceIgnored=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;){if((a=r[++B])===e)return!0;if(a!==s)break}if(n===s)for(B=t;B>0;){var o=r[--B];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var i=t;i<=r.length;){var a;if((a=r[++i])===e)return!0;if(a!==s)break}if(o!==s)break}return!1},previousNonSpaceClassType=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==s)return r;t--}return 0},_lineBreakAtIndex=function(A,e,t,r,n){if(0===t[r])return"×";var B=r-1;if(Array.isArray(n)&&!0===n[B])return"×";var h=B-1,T=B+1,D=e[B],_=h>=0?e[h]:0,y=e[T];if(2===D&&3===y)return"×";if(-1!==v.indexOf(D))return"!";if(-1!==v.indexOf(y))return"×";if(-1!==O.indexOf(y))return"×";if(8===previousNonSpaceClassType(B,e))return"÷";if(11===R.get(A[B])&&(y===N||y===d||y===H))return"×";if(7===D||7===y)return"×";if(9===D)return"×";if(-1===[s,o,i].indexOf(D)&&9===y)return"×";if(-1!==[a,c,Q,l,F].indexOf(y))return"×";if(previousNonSpaceClassType(B,e)===U)return"×";if(isAdjacentWithSpaceIgnored(23,U,B,e))return"×";if(isAdjacentWithSpaceIgnored([a,c],w,B,e))return"×";if(isAdjacentWithSpaceIgnored(12,12,B,e))return"×";if(D===s)return"÷";if(23===D||23===y)return"×";if(16===y||16===D)return"÷";if(-1!==[o,i,w].indexOf(y)||14===D)return"×";if(36===_&&-1!==M.indexOf(D))return"×";if(D===F&&36===y)return"×";if(y===u&&-1!==L.concat(u,Q,C,N,d,H).indexOf(D))return"×";if(-1!==L.indexOf(y)&&D===C||-1!==L.indexOf(D)&&y===C)return"×";if(D===E&&-1!==[N,d,H].indexOf(y)||-1!==[N,d,H].indexOf(D)&&y===g)return"×";if(-1!==L.indexOf(D)&&-1!==S.indexOf(y)||-1!==S.indexOf(D)&&-1!==L.indexOf(y))return"×";if(-1!==[E,g].indexOf(D)&&(y===C||-1!==[U,i].indexOf(y)&&e[T+1]===C)||-1!==[U,i].indexOf(D)&&y===C||D===C&&-1!==[C,F,l].indexOf(y))return"×";if(-1!==[C,F,l,a,c].indexOf(y))for(var P=B;P>=0;){if((x=e[P])===C)return"×";if(-1===[F,l].indexOf(x))break;P--}if(-1!==[E,g].indexOf(y))for(P=-1!==[a,c].indexOf(D)?h:B;P>=0;){var x;if((x=e[P])===C)return"×";if(-1===[F,l].indexOf(x))break;P--}if(K===D&&-1!==[K,I,f,p].indexOf(y)||-1!==[I,f].indexOf(D)&&-1!==[I,m].indexOf(y)||-1!==[m,p].indexOf(D)&&y===m)return"×";if(-1!==b.indexOf(D)&&-1!==[u,g].indexOf(y)||-1!==b.indexOf(y)&&D===E)return"×";if(-1!==L.indexOf(D)&&-1!==L.indexOf(y))return"×";if(D===l&&-1!==L.indexOf(y))return"×";if(-1!==L.concat(C).indexOf(D)&&y===U||-1!==L.concat(C).indexOf(y)&&D===c)return"×";if(41===D&&41===y){for(var z=t[B],V=1;z>0&&41===e[--z];)V++;if(V%2!=0)return"×"}return D===d&&y===H?"×":"÷"},cssFormattedClasses=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],r=[],n=[];return A.forEach((function(A,B){var s=R.get(A);if(s>50?(n.push(!0),s-=50):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(h);var o=t[B-1];return-1===D.indexOf(o)?(r.push(r[B-1]),t.push(o)):(r.push(B),t.push(h))}return r.push(B),31===s?t.push("strict"===e?w:N):s===T||29===s?t.push(h):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(N):t.push(h):void t.push(s)})),[r,t,n]}(A,e.lineBreak),r=t[0],n=t[1],B=t[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(n=n.map((function(A){return-1!==[C,h,T].indexOf(A)?N:A}))),[r,n,"keep-all"===e.wordBreak?B.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0]},_=function(){function Break(A,e,t,r){this.codePoints=A,this.required="!"===e,this.start=t,this.end=r}return Break.prototype.slice=function(){return fromCodePoint.apply(void 0,this.codePoints.slice(this.start,this.end))},Break}();!function(A){A[A.STRING_TOKEN=0]="STRING_TOKEN",A[A.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",A[A.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",A[A.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",A[A.COMMA_TOKEN=4]="COMMA_TOKEN",A[A.HASH_TOKEN=5]="HASH_TOKEN",A[A.DELIM_TOKEN=6]="DELIM_TOKEN",A[A.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",A[A.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",A[A.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",A[A.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",A[A.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",A[A.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",A[A.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",A[A.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",A[A.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",A[A.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",A[A.NUMBER_TOKEN=17]="NUMBER_TOKEN",A[A.FUNCTION=18]="FUNCTION",A[A.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",A[A.IDENT_TOKEN=20]="IDENT_TOKEN",A[A.COLUMN_TOKEN=21]="COLUMN_TOKEN",A[A.URL_TOKEN=22]="URL_TOKEN",A[A.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",A[A.CDC_TOKEN=24]="CDC_TOKEN",A[A.CDO_TOKEN=25]="CDO_TOKEN",A[A.COLON_TOKEN=26]="COLON_TOKEN",A[A.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",A[A.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",A[A.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",A[A.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",A[A.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",A[A.EOF_TOKEN=32]="EOF_TOKEN"}(n||(n={}));var isDigit=function(A){return A>=48&&A<=57},isHex=function(A){return isDigit(A)||A>=65&&A<=70||A>=97&&A<=102},isWhiteSpace=function(A){return 10===A||9===A||32===A},isNameStartCodePoint=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},isNameCodePoint=function(A){return isNameStartCodePoint(A)||isDigit(A)||45===A},isNonPrintableCodePoint=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},isValidEscape=function(A,e){return 92===A&&10!==e},isIdentifierStart=function(A,e,t){return 45===A?isNameStartCodePoint(e)||isValidEscape(e,t):!!isNameStartCodePoint(A)||!(92!==A||!isValidEscape(A,e))},isNumberStart=function(A,e,t){return 43===A||45===A?!!isDigit(e)||46===e&&isDigit(t):isDigit(46===A?e:A)},stringToNumber=function(A){var e=0,t=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(t=-1),e++);for(var r=[];isDigit(A[e]);)r.push(A[e++]);var n=r.length?parseInt(fromCodePoint.apply(void 0,r),10):0;46===A[e]&&e++;for(var B=[];isDigit(A[e]);)B.push(A[e++]);var s=B.length,o=s?parseInt(fromCodePoint.apply(void 0,B),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;43!==A[e]&&45!==A[e]||(45===A[e]&&(i=-1),e++);for(var a=[];isDigit(A[e]);)a.push(A[e++]);var c=a.length?parseInt(fromCodePoint.apply(void 0,a),10):0;return t*(n+o*Math.pow(10,-s))*Math.pow(10,i*c)},y={type:n.LEFT_PARENTHESIS_TOKEN},P={type:n.RIGHT_PARENTHESIS_TOKEN},x={type:n.COMMA_TOKEN},z={type:n.SUFFIX_MATCH_TOKEN},V={type:n.PREFIX_MATCH_TOKEN},X={type:n.COLUMN_TOKEN},J={type:n.DASH_MATCH_TOKEN},G={type:n.INCLUDE_MATCH_TOKEN},k={type:n.LEFT_CURLY_BRACKET_TOKEN},W={type:n.RIGHT_CURLY_BRACKET_TOKEN},Y={type:n.SUBSTRING_MATCH_TOKEN},q={type:n.BAD_URL_TOKEN},Z={type:n.BAD_STRING_TOKEN},j={type:n.CDO_TOKEN},$={type:n.CDC_TOKEN},AA={type:n.COLON_TOKEN},eA={type:n.SEMICOLON_TOKEN},tA={type:n.LEFT_SQUARE_BRACKET_TOKEN},rA={type:n.RIGHT_SQUARE_BRACKET_TOKEN},nA={type:n.WHITESPACE_TOKEN},BA={type:n.EOF_TOKEN},sA=function(){function Tokenizer(){this._value=[]}return Tokenizer.prototype.write=function(A){this._value=this._value.concat(toCodePoints(A))},Tokenizer.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==BA;)A.push(e),e=this.consumeToken();return A},Tokenizer.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(isNameCodePoint(e)||isValidEscape(t,r)){var B=isIdentifierStart(e,t,r)?2:1,s=this.consumeName();return{type:n.HASH_TOKEN,value:s,flags:B}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),z;break;case 39:return this.consumeStringToken(39);case 40:return y;case 41:return P;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Y;break;case 43:if(isNumberStart(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return x;case 45:var o=A,i=this.peekCodePoint(0),a=this.peekCodePoint(1);if(isNumberStart(o,i,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(isIdentifierStart(o,i,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(45===i&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),$;break;case 46:if(isNumberStart(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(42===c&&47===(c=this.consumeCodePoint()))return this.consumeToken();if(-1===c)return this.consumeToken()}break;case 58:return AA;case 59:return eA;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),j;break;case 64:var Q=this.peekCodePoint(0),u=this.peekCodePoint(1),w=this.peekCodePoint(2);if(isIdentifierStart(Q,u,w))return s=this.consumeName(),{type:n.AT_KEYWORD_TOKEN,value:s};break;case 91:return tA;case 92:if(isValidEscape(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return rA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),V;break;case 123:return k;case 125:return W;case 117:case 85:var U=this.peekCodePoint(0),l=this.peekCodePoint(1);return 43!==U||!isHex(l)&&63!==l||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),J;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),X;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),G;break;case-1:return BA}return isWhiteSpace(A)?(this.consumeWhiteSpace(),nA):isDigit(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):isNameStartCodePoint(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:n.DELIM_TOKEN,value:fromCodePoint(A)}},Tokenizer.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},Tokenizer.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},Tokenizer.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},Tokenizer.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();isHex(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t){var r=parseInt(fromCodePoint.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),B=parseInt(fromCodePoint.apply(void 0,A.map((function(A){return 63===A?70:A}))),16);return{type:n.UNICODE_RANGE_TOKEN,start:r,end:B}}var s=parseInt(fromCodePoint.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&isHex(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];isHex(e)&&o.length<6;)o.push(e),e=this.consumeCodePoint();return B=parseInt(fromCodePoint.apply(void 0,o),16),{type:n.UNICODE_RANGE_TOKEN,start:s,end:B}}return{type:n.UNICODE_RANGE_TOKEN,start:s,end:s}},Tokenizer.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:n.FUNCTION_TOKEN,value:A}):{type:n.IDENT_TOKEN,value:A}},Tokenizer.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:n.URL_TOKEN,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return t.type===n.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:n.URL_TOKEN,value:t.value}):(this.consumeBadUrlRemnants(),q)}for(;;){var r=this.consumeCodePoint();if(-1===r||41===r)return{type:n.URL_TOKEN,value:fromCodePoint.apply(void 0,A)};if(isWhiteSpace(r))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:n.URL_TOKEN,value:fromCodePoint.apply(void 0,A)}):(this.consumeBadUrlRemnants(),q);if(34===r||39===r||40===r||isNonPrintableCodePoint(r))return this.consumeBadUrlRemnants(),q;if(92===r){if(!isValidEscape(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),q;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},Tokenizer.prototype.consumeWhiteSpace=function(){for(;isWhiteSpace(this.peekCodePoint(0));)this.consumeCodePoint()},Tokenizer.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;isValidEscape(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},Tokenizer.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(6e4,A);e+=fromCodePoint.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},Tokenizer.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r=this._value[t];if(-1===r||void 0===r||r===A)return e+=this.consumeStringSlice(t),{type:n.STRING_TOKEN,value:e};if(10===r)return this._value.splice(0,t),Z;if(92===r){var B=this._value[t+1];-1!==B&&void 0!==B&&(10===B?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):isValidEscape(r,B)&&(e+=this.consumeStringSlice(t),e+=fromCodePoint(this.consumeEscapedCodePoint()),t=-1))}t++}},Tokenizer.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(43!==t&&45!==t||A.push(this.consumeCodePoint());isDigit(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&isDigit(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;isDigit(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===t||101===t)&&((43===r||45===r)&&isDigit(n)||isDigit(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;isDigit(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[stringToNumber(A),e]},Tokenizer.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),B=this.peekCodePoint(1),s=this.peekCodePoint(2);if(isIdentifierStart(r,B,s)){var o=this.consumeName();return{type:n.DIMENSION_TOKEN,number:e,flags:t,unit:o}}return 37===r?(this.consumeCodePoint(),{type:n.PERCENTAGE_TOKEN,number:e,flags:t}):{type:n.NUMBER_TOKEN,number:e,flags:t}},Tokenizer.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(isHex(A)){for(var e=fromCodePoint(A);isHex(this.peekCodePoint(0))&&e.length<6;)e+=fromCodePoint(this.consumeCodePoint());isWhiteSpace(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return-1===A?65533:A},Tokenizer.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(isNameCodePoint(e))A+=fromCodePoint(e);else{if(!isValidEscape(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=fromCodePoint(this.consumeEscapedCodePoint())}}},Tokenizer}(),oA=function(){function Parser(A){this._tokens=A}return Parser.create=function(A){var e=new sA;return e.write(A),new Parser(e.read())},Parser.parseValue=function(A){return Parser.create(A).parseComponentValue()},Parser.parseValues=function(A){return Parser.create(A).parseComponentValues()},Parser.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===n.WHITESPACE_TOKEN;)A=this.consumeToken();if(A.type===n.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(A.type===n.WHITESPACE_TOKEN);if(A.type===n.EOF_TOKEN)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},Parser.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(e.type===n.EOF_TOKEN)return A;A.push(e),A.push()}},Parser.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case n.LEFT_CURLY_BRACKET_TOKEN:case n.LEFT_SQUARE_BRACKET_TOKEN:case n.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(A.type);case n.FUNCTION_TOKEN:return this.consumeFunction(A)}return A},Parser.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(t.type===n.EOF_TOKEN||isEndingTokenFor(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},Parser.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:n.FUNCTION};;){var t=this.consumeToken();if(t.type===n.EOF_TOKEN||t.type===n.RIGHT_PARENTHESIS_TOKEN)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},Parser.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?BA:A},Parser.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},Parser}(),isDimensionToken=function(A){return A.type===n.DIMENSION_TOKEN},isNumberToken=function(A){return A.type===n.NUMBER_TOKEN},isIdentToken=function(A){return A.type===n.IDENT_TOKEN},isStringToken=function(A){return A.type===n.STRING_TOKEN},isIdentWithValue=function(A,e){return isIdentToken(A)&&A.value===e},nonWhiteSpace=function(A){return A.type!==n.WHITESPACE_TOKEN},nonFunctionArgSeparator=function(A){return A.type!==n.WHITESPACE_TOKEN&&A.type!==n.COMMA_TOKEN},parseFunctionArgs=function(A){var e=[],t=[];return A.forEach((function(A){if(A.type===n.COMMA_TOKEN){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}A.type!==n.WHITESPACE_TOKEN&&t.push(A)})),t.length&&e.push(t),e},isEndingTokenFor=function(A,e){return e===n.LEFT_CURLY_BRACKET_TOKEN&&A.type===n.RIGHT_CURLY_BRACKET_TOKEN||e===n.LEFT_SQUARE_BRACKET_TOKEN&&A.type===n.RIGHT_SQUARE_BRACKET_TOKEN||e===n.LEFT_PARENTHESIS_TOKEN&&A.type===n.RIGHT_PARENTHESIS_TOKEN},isLength=function(A){return A.type===n.NUMBER_TOKEN||A.type===n.DIMENSION_TOKEN},isLengthPercentage=function(A){return A.type===n.PERCENTAGE_TOKEN||isLength(A)},parseLengthPercentageTuple=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},iA={type:n.NUMBER_TOKEN,number:0,flags:4},aA={type:n.PERCENTAGE_TOKEN,number:50,flags:4},cA={type:n.PERCENTAGE_TOKEN,number:100,flags:4},getAbsoluteValueForTuple=function(A,e,t){var r=A[0],n=A[1];return[getAbsoluteValue(r,e),getAbsoluteValue(void 0!==n?n:r,t)]},getAbsoluteValue=function(A,e){if(A.type===n.PERCENTAGE_TOKEN)return A.number/100*e;if(isDimensionToken(A))switch(A.unit){case"rem":case"em":return 16*A.number;case"px":default:return A.number}return A.number},angle_parse=function(A){if(A.type===n.DIMENSION_TOKEN)switch(A.unit){case"deg":return Math.PI*A.number/180;case"grad":return Math.PI/200*A.number;case"rad":return A.number;case"turn":return 2*Math.PI*A.number}throw new Error("Unsupported angle type")},isAngle=function(A){return A.type===n.DIMENSION_TOKEN&&("deg"===A.unit||"grad"===A.unit||"rad"===A.unit||"turn"===A.unit)},parseNamedSide=function(A){switch(A.filter(isIdentToken).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[iA,iA];case"to top":case"bottom":return deg(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[iA,cA];case"to right":case"left":return deg(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[cA,cA];case"to bottom":case"top":return deg(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[cA,iA];case"to left":case"right":return deg(270)}return 0},deg=function(A){return Math.PI*A/180},color_parse=function(A){if(A.type===n.FUNCTION){var e=wA[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return e(A.values)}if(A.type===n.HASH_TOKEN){if(3===A.value.length){var t=A.value.substring(0,1),r=A.value.substring(1,2),B=A.value.substring(2,3);return pack(parseInt(t+t,16),parseInt(r+r,16),parseInt(B+B,16),1)}if(4===A.value.length){t=A.value.substring(0,1),r=A.value.substring(1,2),B=A.value.substring(2,3);var s=A.value.substring(3,4);return pack(parseInt(t+t,16),parseInt(r+r,16),parseInt(B+B,16),parseInt(s+s,16)/255)}if(6===A.value.length)return t=A.value.substring(0,2),r=A.value.substring(2,4),B=A.value.substring(4,6),pack(parseInt(t,16),parseInt(r,16),parseInt(B,16),1);if(8===A.value.length)return t=A.value.substring(0,2),r=A.value.substring(2,4),B=A.value.substring(4,6),s=A.value.substring(6,8),pack(parseInt(t,16),parseInt(r,16),parseInt(B,16),parseInt(s,16)/255)}if(A.type===n.IDENT_TOKEN){var o=UA[A.value.toUpperCase()];if(void 0!==o)return o}return UA.TRANSPARENT},isTransparent=function(A){return 0==(255&A)},asString=function(A){var e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?"rgba("+n+","+r+","+t+","+e/255+")":"rgb("+n+","+r+","+t+")"},pack=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0},getTokenColorValue=function(A,e){if(A.type===n.NUMBER_TOKEN)return A.number;if(A.type===n.PERCENTAGE_TOKEN){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},rgb=function(A){var e=A.filter(nonFunctionArgSeparator);if(3===e.length){var t=e.map(getTokenColorValue),r=t[0],n=t[1],B=t[2];return pack(r,n,B,1)}if(4===e.length){var s=e.map(getTokenColorValue),o=(r=s[0],n=s[1],B=s[2],s[3]);return pack(r,n,B,o)}return 0};function hue2rgb(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var QA,uA,hsl=function(A){var e=A.filter(nonFunctionArgSeparator),t=e[0],r=e[1],B=e[2],s=e[3],o=(t.type===n.NUMBER_TOKEN?deg(t.number):angle_parse(t))/(2*Math.PI),i=isLengthPercentage(r)?r.number/100:0,a=isLengthPercentage(B)?B.number/100:0,c=void 0!==s&&isLengthPercentage(s)?getAbsoluteValue(s,1):1;if(0===i)return pack(255*a,255*a,255*a,1);var Q=a<=.5?a*(i+1):a+i-a*i,u=2*a-Q,w=hue2rgb(u,Q,o+1/3),U=hue2rgb(u,Q,o),l=hue2rgb(u,Q,o-1/3);return pack(255*w,255*U,255*l,c)},wA={hsl:hsl,hsla:hsl,rgb:rgb,rgba:rgb},UA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(function(A){A[A.VALUE=0]="VALUE",A[A.LIST=1]="LIST",A[A.IDENT_VALUE=2]="IDENT_VALUE",A[A.TYPE_VALUE=3]="TYPE_VALUE",A[A.TOKEN_VALUE=4]="TOKEN_VALUE"})(QA||(QA={})),function(A){A[A.BORDER_BOX=0]="BORDER_BOX",A[A.PADDING_BOX=1]="PADDING_BOX",A[A.CONTENT_BOX=2]="CONTENT_BOX"}(uA||(uA={}));var lA,CA,gA,EA={name:"background-clip",initialValue:"border-box",prefix:!1,type:QA.LIST,parse:function(A){return A.map((function(A){if(isIdentToken(A))switch(A.value){case"padding-box":return uA.PADDING_BOX;case"content-box":return uA.CONTENT_BOX}return uA.BORDER_BOX}))}},FA={name:"background-color",initialValue:"transparent",prefix:!1,type:QA.TYPE_VALUE,format:"color"},parseColorStop=function(A){var e=color_parse(A[0]),t=A[1];return t&&isLengthPercentage(t)?{color:e,stop:t}:{color:e,stop:null}},processColorStops=function(A,e){var t=A[0],r=A[A.length-1];null===t.stop&&(t.stop=iA),null===r.stop&&(r.stop=cA);for(var n=[],B=0,s=0;s<A.length;s++){var o=A[s].stop;if(null!==o){var i=getAbsoluteValue(o,e);i>B?n.push(i):n.push(B),B=i}else n.push(null)}var a=null;for(s=0;s<n.length;s++){var c=n[s];if(null===c)null===a&&(a=s);else if(null!==a){for(var Q=s-a,u=(c-n[a-1])/(Q+1),w=1;w<=Q;w++)n[a+w-1]=u*w;a=null}}return A.map((function(A,t){return{color:A.color,stop:Math.max(Math.min(1,n[t]/e),0)}}))},calculateGradientDirection=function(A,e,t){var r="number"==typeof A?A:function(A,e,t){var r=e/2,n=t/2,B=getAbsoluteValue(A[0],e)-r,s=n-getAbsoluteValue(A[1],t);return(Math.atan2(s,B)+2*Math.PI)%(2*Math.PI)}(A,e,t),n=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),B=e/2,s=t/2,o=n/2,i=Math.sin(r-Math.PI/2)*o,a=Math.cos(r-Math.PI/2)*o;return[n,B-a,B+a,s-i,s+i]},distance=function(A,e){return Math.sqrt(A*A+e*e)},findCorner=function(A,e,t,r,n){return[[0,0],[0,e],[A,0],[A,e]].reduce((function(A,e){var B=e[0],s=e[1],o=distance(t-B,r-s);return(n?o<A.optimumDistance:o>A.optimumDistance)?{optimumCorner:e,optimumDistance:o}:A}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},prefixLinearGradient=function(A){var e=deg(180),t=[];return parseFunctionArgs(A).forEach((function(A,r){if(0===r){var B=A[0];if(B.type===n.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(B.value))return void(e=parseNamedSide(A));if(isAngle(B))return void(e=(angle_parse(B)+deg(270))%deg(360))}var s=parseColorStop(A);t.push(s)})),{angle:e,stops:t,type:lA.LINEAR_GRADIENT}},isGreenPixel=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},createForeignObjectSVG=function(A,e,t,r,n){var B="http://www.w3.org/2000/svg",s=document.createElementNS(B,"svg"),o=document.createElementNS(B,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},loadSerializedSVG=function(A){return new Promise((function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},hA={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var r=e.getBoundingClientRect(),n=Math.round(r.height);if(A.body.removeChild(t),123===n)return!0}}return!1}(document);return Object.defineProperty(hA,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(hA,"SUPPORT_SVG_DRAWING",{value:A}),A},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");if(!t)return Promise.reject(!1);t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,100,100);var r=new Image,n=e.toDataURL();r.src=n;var B=createForeignObjectSVG(100,100,0,0,r);return t.fillStyle="red",t.fillRect(0,0,100,100),loadSerializedSVG(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("+n+")",B.style.height="100px",isGreenPixel(r)?loadSerializedSVG(createForeignObjectSVG(100,100,0,0,B)):Promise.reject(!1)})).then((function(A){return t.drawImage(A,0,0),isGreenPixel(t.getImageData(0,0,100,100).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(hA,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(hA,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(hA,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(hA,"SUPPORT_CORS_XHR",{value:A}),A}},dA=function(){function Logger(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return Logger.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,[this.id,this.getTime()+"ms"].concat(A)):this.info.apply(this,A))},Logger.prototype.getTime=function(){return Date.now()-this.start},Logger.create=function(A){Logger.instances[A.id]=new Logger(A)},Logger.destroy=function(A){delete Logger.instances[A]},Logger.getInstance=function(A){var e=Logger.instances[A];if(void 0===e)throw new Error("No logger instance found with id "+A);return e},Logger.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,[this.id,this.getTime()+"ms"].concat(A))},Logger.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,[this.id,this.getTime()+"ms"].concat(A)):this.info.apply(this,A))},Logger.instances={},Logger}(),HA=function(){function CacheStorage(){}return CacheStorage.create=function(A,e){return CacheStorage._caches[A]=new fA(A,e)},CacheStorage.destroy=function(A){delete CacheStorage._caches[A]},CacheStorage.open=function(A){var e=CacheStorage._caches[A];if(void 0!==e)return e;throw new Error('Cache with key "'+A+'" not found')},CacheStorage.getOrigin=function(A){var e=CacheStorage._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},CacheStorage.isSameOrigin=function(A){return CacheStorage.getOrigin(A)===CacheStorage._origin},CacheStorage.setContext=function(A){CacheStorage._link=A.document.createElement("a"),CacheStorage._origin=CacheStorage.getOrigin(A.location.href)},CacheStorage.getInstance=function(){var A=CacheStorage._current;if(null===A)throw new Error("No cache instance attached");return A},CacheStorage.attachInstance=function(A){CacheStorage._current=A},CacheStorage.detachInstance=function(){CacheStorage._current=null},CacheStorage._caches={},CacheStorage._origin="about:blank",CacheStorage._current=null,CacheStorage}(),fA=function(){function Cache(A,e){this.id=A,this._options=e,this._cache={}}return Cache.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:isBlobImage(A)||isRenderable(A)?(this._cache[A]=this.loadImage(A),e):e},Cache.prototype.match=function(A){return this._cache[A]},Cache.prototype.loadImage=function(A){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,B=this;return __generator(this,(function(s){switch(s.label){case 0:return e=HA.isSameOrigin(A),t=!isInlineImage(A)&&!0===this._options.useCORS&&hA.SUPPORT_CORS_IMAGES&&!e,r=!isInlineImage(A)&&!e&&"string"==typeof this._options.proxy&&hA.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||isInlineImage(A)||r||t?(n=A,r?[4,this.proxy(n)]:[3,2]):[2];case 1:n=s.sent(),s.label=2;case 2:return dA.getInstance(this.id).debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var r=new Image;r.onload=function(){return A(r)},r.onerror=e,(isInlineBase64Image(n)||t)&&(r.crossOrigin="anonymous"),r.src=n,!0===r.complete&&setTimeout((function(){return A(r)}),500),B._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+B._options.imageTimeout+"ms) loading image")}),B._options.imageTimeout)}))];case 3:return[2,s.sent()]}}))}))},Cache.prototype.has=function(A){return void 0!==this._cache[A]},Cache.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Cache.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var r=A.substring(0,256);return new Promise((function(n,B){var s=hA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;if(o.onload=function(){if(200===o.status)if("text"===s)n(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return n(A.result)}),!1),A.addEventListener("error",(function(A){return B(A)}),!1),A.readAsDataURL(o.response)}else B("Failed to proxy resource "+r+" with status code "+o.status)},o.onerror=B,o.open("GET",t+"?url="+encodeURIComponent(A)+"&responseType="+s),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout){var i=e._options.imageTimeout;o.timeout=i,o.ontimeout=function(){return B("Timed out ("+i+"ms) proxying "+r)}}o.send()}))},Cache}(),pA=/^data:image\/svg\+xml/i,NA=/^data:image\/.*;base64,/i,KA=/^data:image\/.*/i,isRenderable=function(A){return hA.SUPPORT_SVG_DRAWING||!isSVG(A)},isInlineImage=function(A){return KA.test(A)},isInlineBase64Image=function(A){return NA.test(A)},isBlobImage=function(A){return"blob"===A.substr(0,4)},isSVG=function(A){return"svg"===A.substr(-3).toLowerCase()||pA.test(A)},prefixRadialGradient=function(A){var e=CA.CIRCLE,t=gA.FARTHEST_CORNER,r=[],n=[];return parseFunctionArgs(A).forEach((function(A,B){var s=!0;if(0===B?s=A.reduce((function(A,e){if(isIdentToken(e))switch(e.value){case"center":return n.push(aA),!1;case"top":case"left":return n.push(iA),!1;case"right":case"bottom":return n.push(cA),!1}else if(isLengthPercentage(e)||isLength(e))return n.push(e),!1;return A}),s):1===B&&(s=A.reduce((function(A,r){if(isIdentToken(r))switch(r.value){case"circle":return e=CA.CIRCLE,!1;case"ellipse":return e=CA.ELLIPSE,!1;case"contain":case"closest-side":return t=gA.CLOSEST_SIDE,!1;case"farthest-side":return t=gA.FARTHEST_SIDE,!1;case"closest-corner":return t=gA.CLOSEST_CORNER,!1;case"cover":case"farthest-corner":return t=gA.FARTHEST_CORNER,!1}else if(isLength(r)||isLengthPercentage(r))return Array.isArray(t)||(t=[]),t.push(r),!1;return A}),s)),s){var o=parseColorStop(A);r.push(o)}})),{size:t,shape:e,stops:r,position:n,type:lA.RADIAL_GRADIENT}};!function(A){A[A.URL=0]="URL",A[A.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",A[A.RADIAL_GRADIENT=2]="RADIAL_GRADIENT"}(lA||(lA={})),function(A){A[A.CIRCLE=0]="CIRCLE",A[A.ELLIPSE=1]="ELLIPSE"}(CA||(CA={})),function(A){A[A.CLOSEST_SIDE=0]="CLOSEST_SIDE",A[A.FARTHEST_SIDE=1]="FARTHEST_SIDE",A[A.CLOSEST_CORNER=2]="CLOSEST_CORNER",A[A.FARTHEST_CORNER=3]="FARTHEST_CORNER"}(gA||(gA={}));var IA,image_parse=function(A){if(A.type===n.URL_TOKEN){var e={url:A.value,type:lA.URL};return HA.getInstance().addImage(A.value),e}if(A.type===n.FUNCTION){var t=mA[A.name];if(void 0===t)throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return t(A.values)}throw new Error("Unsupported image type")},mA={"linear-gradient":function(A){var e=deg(180),t=[];return parseFunctionArgs(A).forEach((function(A,r){if(0===r){var B=A[0];if(B.type===n.IDENT_TOKEN&&"to"===B.value)return void(e=parseNamedSide(A));if(isAngle(B))return void(e=angle_parse(B))}var s=parseColorStop(A);t.push(s)})),{angle:e,stops:t,type:lA.LINEAR_GRADIENT}},"-moz-linear-gradient":prefixLinearGradient,"-ms-linear-gradient":prefixLinearGradient,"-o-linear-gradient":prefixLinearGradient,"-webkit-linear-gradient":prefixLinearGradient,"radial-gradient":function(A){var e=CA.CIRCLE,t=gA.FARTHEST_CORNER,r=[],n=[];return parseFunctionArgs(A).forEach((function(A,B){var s=!0;if(0===B){var o=!1;s=A.reduce((function(A,r){if(o)if(isIdentToken(r))switch(r.value){case"center":return n.push(aA),A;case"top":case"left":return n.push(iA),A;case"right":case"bottom":return n.push(cA),A}else(isLengthPercentage(r)||isLength(r))&&n.push(r);else if(isIdentToken(r))switch(r.value){case"circle":return e=CA.CIRCLE,!1;case"ellipse":return e=CA.ELLIPSE,!1;case"at":return o=!0,!1;case"closest-side":return t=gA.CLOSEST_SIDE,!1;case"cover":case"farthest-side":return t=gA.FARTHEST_SIDE,!1;case"contain":case"closest-corner":return t=gA.CLOSEST_CORNER,!1;case"farthest-corner":return t=gA.FARTHEST_CORNER,!1}else if(isLength(r)||isLengthPercentage(r))return Array.isArray(t)||(t=[]),t.push(r),!1;return A}),s)}if(s){var i=parseColorStop(A);r.push(i)}})),{size:t,shape:e,stops:r,position:n,type:lA.RADIAL_GRADIENT}},"-moz-radial-gradient":prefixRadialGradient,"-ms-radial-gradient":prefixRadialGradient,"-o-radial-gradient":prefixRadialGradient,"-webkit-radial-gradient":prefixRadialGradient,"-webkit-gradient":function(A){var e=deg(180),t=[],r=lA.LINEAR_GRADIENT,B=CA.CIRCLE,s=gA.FARTHEST_CORNER;return parseFunctionArgs(A).forEach((function(A,e){var B=A[0];if(0===e){if(isIdentToken(B)&&"linear"===B.value)return void(r=lA.LINEAR_GRADIENT);if(isIdentToken(B)&&"radial"===B.value)return void(r=lA.RADIAL_GRADIENT)}if(B.type===n.FUNCTION)if("from"===B.name){var s=color_parse(B.values[0]);t.push({stop:iA,color:s})}else if("to"===B.name)s=color_parse(B.values[0]),t.push({stop:cA,color:s});else if("color-stop"===B.name){var o=B.values.filter(nonFunctionArgSeparator);if(2===o.length){s=color_parse(o[1]);var i=o[0];isNumberToken(i)&&t.push({stop:{type:n.PERCENTAGE_TOKEN,number:100*i.number,flags:i.flags},color:s})}}})),r===lA.LINEAR_GRADIENT?{angle:(e+deg(180))%deg(360),stops:t,type:r}:{size:s,shape:B,stops:t,position:[],type:r}}},TA={name:"background-image",initialValue:"none",type:QA.LIST,prefix:!1,parse:function(A){if(0===A.length)return[];var e=A[0];return e.type===n.IDENT_TOKEN&&"none"===e.value?[]:A.filter((function(A){return nonFunctionArgSeparator(A)&&function isSupportedImage(A){return A.type!==n.FUNCTION||mA[A.name]}(A)})).map(image_parse)}},RA={name:"background-origin",initialValue:"border-box",prefix:!1,type:QA.LIST,parse:function(A){return A.map((function(A){if(isIdentToken(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},LA={name:"background-position",initialValue:"0% 0%",type:QA.LIST,prefix:!1,parse:function(A){return parseFunctionArgs(A).map((function(A){return A.filter(isLengthPercentage)})).map(parseLengthPercentageTuple)}};!function(A){A[A.REPEAT=0]="REPEAT",A[A.NO_REPEAT=1]="NO_REPEAT",A[A.REPEAT_X=2]="REPEAT_X",A[A.REPEAT_Y=3]="REPEAT_Y"}(IA||(IA={}));var vA,OA={name:"background-repeat",initialValue:"repeat",prefix:!1,type:QA.LIST,parse:function(A){return parseFunctionArgs(A).map((function(A){return A.filter(isIdentToken).map((function(A){return A.value})).join(" ")})).map(parseBackgroundRepeat)}},parseBackgroundRepeat=function(A){switch(A){case"no-repeat":return IA.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return IA.REPEAT_X;case"repeat-y":case"no-repeat repeat":return IA.REPEAT_Y;case"repeat":default:return IA.REPEAT}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(vA||(vA={}));var SA,DA={name:"background-size",initialValue:"0",prefix:!1,type:QA.LIST,parse:function(A){return parseFunctionArgs(A).map((function(A){return A.filter(isBackgroundSizeInfoToken)}))}},isBackgroundSizeInfoToken=function(A){return isIdentToken(A)||isLengthPercentage(A)},borderColorForSide=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:QA.TYPE_VALUE,format:"color"}},bA=borderColorForSide("top"),MA=borderColorForSide("right"),_A=borderColorForSide("bottom"),yA=borderColorForSide("left"),borderRadiusForSide=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:QA.LIST,parse:function(A){return parseLengthPercentageTuple(A.filter(isLengthPercentage))}}},PA=borderRadiusForSide("top-left"),xA=borderRadiusForSide("top-right"),zA=borderRadiusForSide("bottom-right"),VA=borderRadiusForSide("bottom-left");!function(A){A[A.NONE=0]="NONE",A[A.SOLID=1]="SOLID"}(SA||(SA={}));var XA,borderStyleForSide=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"none":return SA.NONE}return SA.SOLID}}},JA=borderStyleForSide("top"),GA=borderStyleForSide("right"),kA=borderStyleForSide("bottom"),WA=borderStyleForSide("left"),borderWidthForSide=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:QA.VALUE,prefix:!1,parse:function(A){return isDimensionToken(A)?A.number:0}}},YA=borderWidthForSide("top"),qA=borderWidthForSide("right"),ZA=borderWidthForSide("bottom"),jA=borderWidthForSide("left"),$A={name:"color",initialValue:"transparent",prefix:!1,type:QA.TYPE_VALUE,format:"color"},Ae={name:"display",initialValue:"inline-block",prefix:!1,type:QA.LIST,parse:function(A){return A.filter(isIdentToken).reduce((function(A,e){return A|parseDisplayValue(e.value)}),0)}},parseDisplayValue=function(A){switch(A){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};!function(A){A[A.NONE=0]="NONE",A[A.LEFT=1]="LEFT",A[A.RIGHT=2]="RIGHT",A[A.INLINE_START=3]="INLINE_START",A[A.INLINE_END=4]="INLINE_END"}(XA||(XA={}));var ee,te={name:"float",initialValue:"none",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"left":return XA.LEFT;case"right":return XA.RIGHT;case"inline-start":return XA.INLINE_START;case"inline-end":return XA.INLINE_END}return XA.NONE}},re={name:"letter-spacing",initialValue:"0",prefix:!1,type:QA.VALUE,parse:function(A){return A.type===n.IDENT_TOKEN&&"normal"===A.value?0:A.type===n.NUMBER_TOKEN||A.type===n.DIMENSION_TOKEN?A.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(ee||(ee={}));var ne,Be={name:"line-break",initialValue:"normal",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"strict":return ee.STRICT;case"normal":default:return ee.NORMAL}}},se={name:"line-height",initialValue:"normal",prefix:!1,type:QA.TOKEN_VALUE},oe={name:"list-style-image",initialValue:"none",type:QA.VALUE,prefix:!1,parse:function(A){return A.type===n.IDENT_TOKEN&&"none"===A.value?null:image_parse(A)}};!function(A){A[A.INSIDE=0]="INSIDE",A[A.OUTSIDE=1]="OUTSIDE"}(ne||(ne={}));var ie,ae={name:"list-style-position",initialValue:"outside",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"inside":return ne.INSIDE;case"outside":default:return ne.OUTSIDE}}};!function(A){A[A.NONE=-1]="NONE",A[A.DISC=0]="DISC",A[A.CIRCLE=1]="CIRCLE",A[A.SQUARE=2]="SQUARE",A[A.DECIMAL=3]="DECIMAL",A[A.CJK_DECIMAL=4]="CJK_DECIMAL",A[A.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",A[A.LOWER_ROMAN=6]="LOWER_ROMAN",A[A.UPPER_ROMAN=7]="UPPER_ROMAN",A[A.LOWER_GREEK=8]="LOWER_GREEK",A[A.LOWER_ALPHA=9]="LOWER_ALPHA",A[A.UPPER_ALPHA=10]="UPPER_ALPHA",A[A.ARABIC_INDIC=11]="ARABIC_INDIC",A[A.ARMENIAN=12]="ARMENIAN",A[A.BENGALI=13]="BENGALI",A[A.CAMBODIAN=14]="CAMBODIAN",A[A.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",A[A.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",A[A.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",A[A.DEVANAGARI=18]="DEVANAGARI",A[A.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",A[A.GEORGIAN=20]="GEORGIAN",A[A.GUJARATI=21]="GUJARATI",A[A.GURMUKHI=22]="GURMUKHI",A[A.HEBREW=22]="HEBREW",A[A.HIRAGANA=23]="HIRAGANA",A[A.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",A[A.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",A[A.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",A[A.KANNADA=27]="KANNADA",A[A.KATAKANA=28]="KATAKANA",A[A.KATAKANA_IROHA=29]="KATAKANA_IROHA",A[A.KHMER=30]="KHMER",A[A.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",A[A.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",A[A.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",A[A.LAO=34]="LAO",A[A.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",A[A.MALAYALAM=36]="MALAYALAM",A[A.MONGOLIAN=37]="MONGOLIAN",A[A.MYANMAR=38]="MYANMAR",A[A.ORIYA=39]="ORIYA",A[A.PERSIAN=40]="PERSIAN",A[A.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",A[A.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",A[A.TAMIL=43]="TAMIL",A[A.TELUGU=44]="TELUGU",A[A.THAI=45]="THAI",A[A.TIBETAN=46]="TIBETAN",A[A.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",A[A.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",A[A.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",A[A.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN",A[A.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"}(ie||(ie={}));var ce,Qe={name:"list-style-type",initialValue:"none",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"disc":return ie.DISC;case"circle":return ie.CIRCLE;case"square":return ie.SQUARE;case"decimal":return ie.DECIMAL;case"cjk-decimal":return ie.CJK_DECIMAL;case"decimal-leading-zero":return ie.DECIMAL_LEADING_ZERO;case"lower-roman":return ie.LOWER_ROMAN;case"upper-roman":return ie.UPPER_ROMAN;case"lower-greek":return ie.LOWER_GREEK;case"lower-alpha":return ie.LOWER_ALPHA;case"upper-alpha":return ie.UPPER_ALPHA;case"arabic-indic":return ie.ARABIC_INDIC;case"armenian":return ie.ARMENIAN;case"bengali":return ie.BENGALI;case"cambodian":return ie.CAMBODIAN;case"cjk-earthly-branch":return ie.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return ie.CJK_HEAVENLY_STEM;case"cjk-ideographic":return ie.CJK_IDEOGRAPHIC;case"devanagari":return ie.DEVANAGARI;case"ethiopic-numeric":return ie.ETHIOPIC_NUMERIC;case"georgian":return ie.GEORGIAN;case"gujarati":return ie.GUJARATI;case"gurmukhi":return ie.GURMUKHI;case"hebrew":return ie.HEBREW;case"hiragana":return ie.HIRAGANA;case"hiragana-iroha":return ie.HIRAGANA_IROHA;case"japanese-formal":return ie.JAPANESE_FORMAL;case"japanese-informal":return ie.JAPANESE_INFORMAL;case"kannada":return ie.KANNADA;case"katakana":return ie.KATAKANA;case"katakana-iroha":return ie.KATAKANA_IROHA;case"khmer":return ie.KHMER;case"korean-hangul-formal":return ie.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return ie.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return ie.KOREAN_HANJA_INFORMAL;case"lao":return ie.LAO;case"lower-armenian":return ie.LOWER_ARMENIAN;case"malayalam":return ie.MALAYALAM;case"mongolian":return ie.MONGOLIAN;case"myanmar":return ie.MYANMAR;case"oriya":return ie.ORIYA;case"persian":return ie.PERSIAN;case"simp-chinese-formal":return ie.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return ie.SIMP_CHINESE_INFORMAL;case"tamil":return ie.TAMIL;case"telugu":return ie.TELUGU;case"thai":return ie.THAI;case"tibetan":return ie.TIBETAN;case"trad-chinese-formal":return ie.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return ie.TRAD_CHINESE_INFORMAL;case"upper-armenian":return ie.UPPER_ARMENIAN;case"disclosure-open":return ie.DISCLOSURE_OPEN;case"disclosure-closed":return ie.DISCLOSURE_CLOSED;case"none":default:return ie.NONE}}},marginForSide=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:QA.TOKEN_VALUE}},ue=marginForSide("top"),we=marginForSide("right"),Ue=marginForSide("bottom"),le=marginForSide("left");!function(A){A[A.VISIBLE=0]="VISIBLE",A[A.HIDDEN=1]="HIDDEN",A[A.SCROLL=2]="SCROLL",A[A.AUTO=3]="AUTO"}(ce||(ce={}));var Ce,ge={name:"overflow",initialValue:"visible",prefix:!1,type:QA.LIST,parse:function(A){return A.filter(isIdentToken).map((function(A){switch(A.value){case"hidden":return ce.HIDDEN;case"scroll":return ce.SCROLL;case"auto":return ce.AUTO;case"visible":default:return ce.VISIBLE}}))}};!function(A){A.NORMAL="normal",A.BREAK_WORD="break-word"}(Ce||(Ce={}));var Ee,Fe={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"break-word":return Ce.BREAK_WORD;case"normal":default:return Ce.NORMAL}}},paddingForSide=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:QA.TYPE_VALUE,format:"length-percentage"}},he=paddingForSide("top"),de=paddingForSide("right"),He=paddingForSide("bottom"),fe=paddingForSide("left");!function(A){A[A.LEFT=0]="LEFT",A[A.CENTER=1]="CENTER",A[A.RIGHT=2]="RIGHT"}(Ee||(Ee={}));var pe,Ne={name:"text-align",initialValue:"left",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"right":return Ee.RIGHT;case"center":case"justify":return Ee.CENTER;case"left":default:return Ee.LEFT}}};!function(A){A[A.STATIC=0]="STATIC",A[A.RELATIVE=1]="RELATIVE",A[A.ABSOLUTE=2]="ABSOLUTE",A[A.FIXED=3]="FIXED",A[A.STICKY=4]="STICKY"}(pe||(pe={}));var Ke,Ie={name:"position",initialValue:"static",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"relative":return pe.RELATIVE;case"absolute":return pe.ABSOLUTE;case"fixed":return pe.FIXED;case"sticky":return pe.STICKY}return pe.STATIC}},me={name:"text-shadow",initialValue:"none",type:QA.LIST,prefix:!1,parse:function(A){return 1===A.length&&isIdentWithValue(A[0],"none")?[]:parseFunctionArgs(A).map((function(A){for(var e={color:UA.TRANSPARENT,offsetX:iA,offsetY:iA,blur:iA},t=0,r=0;r<A.length;r++){var n=A[r];isLength(n)?(0===t?e.offsetX=n:1===t?e.offsetY=n:e.blur=n,t++):e.color=color_parse(n)}return e}))}};!function(A){A[A.NONE=0]="NONE",A[A.LOWERCASE=1]="LOWERCASE",A[A.UPPERCASE=2]="UPPERCASE",A[A.CAPITALIZE=3]="CAPITALIZE"}(Ke||(Ke={}));var Te,Re={name:"text-transform",initialValue:"none",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"uppercase":return Ke.UPPERCASE;case"lowercase":return Ke.LOWERCASE;case"capitalize":return Ke.CAPITALIZE}return Ke.NONE}},Le={name:"transform",initialValue:"none",prefix:!0,type:QA.VALUE,parse:function(A){if(A.type===n.IDENT_TOKEN&&"none"===A.value)return null;if(A.type===n.FUNCTION){var e=ve[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return e(A.values)}return null}},ve={matrix:function(A){var e=A.filter((function(A){return A.type===n.NUMBER_TOKEN})).map((function(A){return A.number}));return 6===e.length?e:null},matrix3d:function(A){var e=A.filter((function(A){return A.type===n.NUMBER_TOKEN})).map((function(A){return A.number})),t=e[0],r=e[1],B=(e[2],e[3],e[4]),s=e[5],o=(e[6],e[7],e[8],e[9],e[10],e[11],e[12]),i=e[13];return e[14],e[15],16===e.length?[t,r,B,s,o,i]:null}},Oe={type:n.PERCENTAGE_TOKEN,number:50,flags:4},Se=[Oe,Oe],De={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:QA.LIST,parse:function(A){var e=A.filter(isLengthPercentage);return 2!==e.length?Se:[e[0],e[1]]}};!function(A){A[A.VISIBLE=0]="VISIBLE",A[A.HIDDEN=1]="HIDDEN",A[A.COLLAPSE=2]="COLLAPSE"}(Te||(Te={}));var be,Me={name:"visible",initialValue:"none",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"hidden":return Te.HIDDEN;case"collapse":return Te.COLLAPSE;case"visible":default:return Te.VISIBLE}}};!function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"}(be||(be={}));var _e,ye={name:"word-break",initialValue:"normal",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"break-all":return be.BREAK_ALL;case"keep-all":return be.KEEP_ALL;case"normal":default:return be.NORMAL}}},Pe={name:"z-index",initialValue:"auto",prefix:!1,type:QA.VALUE,parse:function(A){if(A.type===n.IDENT_TOKEN)return{auto:!0,order:0};if(isNumberToken(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},xe={name:"opacity",initialValue:"1",type:QA.VALUE,prefix:!1,parse:function(A){return isNumberToken(A)?A.number:1}},ze={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:QA.TYPE_VALUE,format:"color"},Ve={name:"text-decoration-line",initialValue:"none",prefix:!1,type:QA.LIST,parse:function(A){return A.filter(isIdentToken).map((function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(A){return 0!==A}))}},Xe={name:"font-family",initialValue:"",prefix:!1,type:QA.LIST,parse:function(A){var e=[],t=[];return A.forEach((function(A){switch(A.type){case n.IDENT_TOKEN:case n.STRING_TOKEN:e.push(A.value);break;case n.NUMBER_TOKEN:e.push(A.number.toString());break;case n.COMMA_TOKEN:t.push(e.join(" ")),e.length=0}})),e.length&&t.push(e.join(" ")),t.map((function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"}))}},Je={name:"font-size",initialValue:"0",prefix:!1,type:QA.TYPE_VALUE,format:"length"},Ge={name:"font-weight",initialValue:"normal",type:QA.VALUE,prefix:!1,parse:function(A){if(isNumberToken(A))return A.number;if(isIdentToken(A))switch(A.value){case"bold":return 700;case"normal":default:return 400}return 400}},ke={name:"font-variant",initialValue:"none",type:QA.LIST,prefix:!1,parse:function(A){return A.filter(isIdentToken).map((function(A){return A.value}))}};!function(A){A.NORMAL="normal",A.ITALIC="italic",A.OBLIQUE="oblique"}(_e||(_e={}));var We,Ye={name:"font-style",initialValue:"normal",prefix:!1,type:QA.IDENT_VALUE,parse:function(A){switch(A){case"oblique":return _e.OBLIQUE;case"italic":return _e.ITALIC;case"normal":default:return _e.NORMAL}}},contains=function(A,e){return 0!=(A&e)},qe={name:"content",initialValue:"none",type:QA.LIST,prefix:!1,parse:function(A){if(0===A.length)return[];var e=A[0];return e.type===n.IDENT_TOKEN&&"none"===e.value?[]:A}},Ze={name:"counter-increment",initialValue:"none",prefix:!0,type:QA.LIST,parse:function(A){if(0===A.length)return null;var e=A[0];if(e.type===n.IDENT_TOKEN&&"none"===e.value)return null;for(var t=[],r=A.filter(nonWhiteSpace),B=0;B<r.length;B++){var s=r[B],o=r[B+1];if(s.type===n.IDENT_TOKEN){var i=o&&isNumberToken(o)?o.number:1;t.push({counter:s.value,increment:i})}}return t}},je={name:"counter-reset",initialValue:"none",prefix:!0,type:QA.LIST,parse:function(A){if(0===A.length)return[];for(var e=[],t=A.filter(nonWhiteSpace),r=0;r<t.length;r++){var n=t[r],B=t[r+1];if(isIdentToken(n)&&"none"!==n.value){var s=B&&isNumberToken(B)?B.number:0;e.push({counter:n.value,reset:s})}}return e}},$e={name:"quotes",initialValue:"none",prefix:!0,type:QA.LIST,parse:function(A){if(0===A.length)return null;var e=A[0];if(e.type===n.IDENT_TOKEN&&"none"===e.value)return null;var t=[],r=A.filter(isStringToken);if(r.length%2!=0)return null;for(var B=0;B<r.length;B+=2){var s=r[B].value,o=r[B+1].value;t.push({open:s,close:o})}return t}},getQuote=function(A,e,t){if(!A)return"";var r=A[Math.min(e,A.length-1)];return r?t?r.open:r.close:""},At={name:"box-shadow",initialValue:"none",type:QA.LIST,prefix:!1,parse:function(A){return 1===A.length&&isIdentWithValue(A[0],"none")?[]:parseFunctionArgs(A).map((function(A){for(var e={color:255,offsetX:iA,offsetY:iA,blur:iA,spread:iA,inset:!1},t=0,r=0;r<A.length;r++){var n=A[r];isIdentWithValue(n,"inset")?e.inset=!0:isLength(n)?(0===t?e.offsetX=n:1===t?e.offsetY=n:2===t?e.blur=n:e.spread=n,t++):e.color=color_parse(n)}return e}))}},et=function(){function CSSParsedDeclaration(A){this.backgroundClip=parse(EA,A.backgroundClip),this.backgroundColor=parse(FA,A.backgroundColor),this.backgroundImage=parse(TA,A.backgroundImage),this.backgroundOrigin=parse(RA,A.backgroundOrigin),this.backgroundPosition=parse(LA,A.backgroundPosition),this.backgroundRepeat=parse(OA,A.backgroundRepeat),this.backgroundSize=parse(DA,A.backgroundSize),this.borderTopColor=parse(bA,A.borderTopColor),this.borderRightColor=parse(MA,A.borderRightColor),this.borderBottomColor=parse(_A,A.borderBottomColor),this.borderLeftColor=parse(yA,A.borderLeftColor),this.borderTopLeftRadius=parse(PA,A.borderTopLeftRadius),this.borderTopRightRadius=parse(xA,A.borderTopRightRadius),this.borderBottomRightRadius=parse(zA,A.borderBottomRightRadius),this.borderBottomLeftRadius=parse(VA,A.borderBottomLeftRadius),this.borderTopStyle=parse(JA,A.borderTopStyle),this.borderRightStyle=parse(GA,A.borderRightStyle),this.borderBottomStyle=parse(kA,A.borderBottomStyle),this.borderLeftStyle=parse(WA,A.borderLeftStyle),this.borderTopWidth=parse(YA,A.borderTopWidth),this.borderRightWidth=parse(qA,A.borderRightWidth),this.borderBottomWidth=parse(ZA,A.borderBottomWidth),this.borderLeftWidth=parse(jA,A.borderLeftWidth),this.boxShadow=parse(At,A.boxShadow),this.color=parse($A,A.color),this.display=parse(Ae,A.display),this.float=parse(te,A.cssFloat),this.fontFamily=parse(Xe,A.fontFamily),this.fontSize=parse(Je,A.fontSize),this.fontStyle=parse(Ye,A.fontStyle),this.fontVariant=parse(ke,A.fontVariant),this.fontWeight=parse(Ge,A.fontWeight),this.letterSpacing=parse(re,A.letterSpacing),this.lineBreak=parse(Be,A.lineBreak),this.lineHeight=parse(se,A.lineHeight),this.listStyleImage=parse(oe,A.listStyleImage),this.listStylePosition=parse(ae,A.listStylePosition),this.listStyleType=parse(Qe,A.listStyleType),this.marginTop=parse(ue,A.marginTop),this.marginRight=parse(we,A.marginRight),this.marginBottom=parse(Ue,A.marginBottom),this.marginLeft=parse(le,A.marginLeft),this.opacity=parse(xe,A.opacity);var e=parse(ge,A.overflow);this.overflowX=e[0],this.overflowY=e[e.length>1?1:0],this.overflowWrap=parse(Fe,A.overflowWrap),this.paddingTop=parse(he,A.paddingTop),this.paddingRight=parse(de,A.paddingRight),this.paddingBottom=parse(He,A.paddingBottom),this.paddingLeft=parse(fe,A.paddingLeft),this.position=parse(Ie,A.position),this.textAlign=parse(Ne,A.textAlign),this.textDecorationColor=parse(ze,A.textDecorationColor||A.color),this.textDecorationLine=parse(Ve,A.textDecorationLine),this.textShadow=parse(me,A.textShadow),this.textTransform=parse(Re,A.textTransform),this.transform=parse(Le,A.transform),this.transformOrigin=parse(De,A.transformOrigin),this.visibility=parse(Me,A.visibility),this.wordBreak=parse(ye,A.wordBreak),this.zIndex=parse(Pe,A.zIndex)}return CSSParsedDeclaration.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===Te.VISIBLE},CSSParsedDeclaration.prototype.isTransparent=function(){return isTransparent(this.backgroundColor)},CSSParsedDeclaration.prototype.isTransformed=function(){return null!==this.transform},CSSParsedDeclaration.prototype.isPositioned=function(){return this.position!==pe.STATIC},CSSParsedDeclaration.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},CSSParsedDeclaration.prototype.isFloating=function(){return this.float!==XA.NONE},CSSParsedDeclaration.prototype.isInlineLevel=function(){return contains(this.display,4)||contains(this.display,33554432)||contains(this.display,268435456)||contains(this.display,536870912)||contains(this.display,67108864)||contains(this.display,134217728)},CSSParsedDeclaration}(),tt=function tt(A){this.content=parse(qe,A.content),this.quotes=parse($e,A.quotes)},rt=function rt(A){this.counterIncrement=parse(Ze,A.counterIncrement),this.counterReset=parse(je,A.counterReset)},parse=function(A,e){var t=new sA,r=null!=e?e.toString():A.initialValue;t.write(r);var n=new oA(t.read());switch(A.type){case QA.IDENT_VALUE:var B=n.parseComponentValue();return A.parse(isIdentToken(B)?B.value:A.initialValue);case QA.VALUE:return A.parse(n.parseComponentValue());case QA.LIST:return A.parse(n.parseComponentValues());case QA.TOKEN_VALUE:return n.parseComponentValue();case QA.TYPE_VALUE:switch(A.format){case"angle":return angle_parse(n.parseComponentValue());case"color":return color_parse(n.parseComponentValue());case"image":return image_parse(n.parseComponentValue());case"length":var s=n.parseComponentValue();return isLength(s)?s:iA;case"length-percentage":var o=n.parseComponentValue();return isLengthPercentage(o)?o:iA}}throw new Error("Attempting to parse unsupported css format type "+A.format)},nt=function nt(A){this.styles=new et(window.getComputedStyle(A,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&isHTMLElementNode(A)&&(A.style.transform="none"),this.bounds=parseBounds(A),this.flags=0},Bt=function Bt(A,e){this.text=A,this.bounds=e},getWrapperBounds=function(e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var n=e.parentNode;if(n){n.replaceChild(r,e);var B=parseBounds(r);return r.firstChild&&n.replaceChild(r.firstChild,r),B}}return new A(0,0,0,0)},getRangeBounds=function(e,t,r){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var B=n.createRange();return B.setStart(e,t),B.setEnd(e,t+r),A.fromClientRect(B.getBoundingClientRect())},breakText=function(A,e){return 0!==e.letterSpacing?toCodePoints(A).map((function(A){return fromCodePoint(A)})):breakWords(A,e)},breakWords=function(A,e){for(var t,r=function(A,e){var t=toCodePoints(A),r=cssFormattedClasses(t,e),n=r[0],B=r[1],s=r[2],o=t.length,i=0,a=0;return{next:function(){if(a>=o)return{done:!0,value:null};for(var A="×";a<o&&"×"===(A=_lineBreakAtIndex(t,B,n,++a,s)););if("×"!==A||a===o){var e=new _(t,A,i,a);return i=a,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap===Ce.BREAK_WORD?"break-word":e.wordBreak}),n=[];!(t=r.next()).done;)t.value&&n.push(t.value.slice());return n},st=function st(A,e){this.text=transform$1(A.data,e.textTransform),this.textBounds=function(A,e,t){var r=breakText(A,e),n=[],B=0;return r.forEach((function(A){if(e.textDecorationLine.length||A.trim().length>0)if(hA.SUPPORT_RANGE_BOUNDS)n.push(new Bt(A,getRangeBounds(t,B,A.length)));else{var r=t.splitText(A.length);n.push(new Bt(A,getWrapperBounds(t))),t=r}else hA.SUPPORT_RANGE_BOUNDS||(t=t.splitText(A.length));B+=A.length})),n}(this.text,e,A)},transform$1=function(A,e){switch(e){case Ke.LOWERCASE:return A.toLowerCase();case Ke.CAPITALIZE:return A.replace(ot,capitalize);case Ke.UPPERCASE:return A.toUpperCase();default:return A}},ot=/(^|\s|:|-|\(|\))([a-z])/g,capitalize=function(A,e,t){return A.length>0?e+t.toUpperCase():A},it=function(A){function ImageElementContainer(e){var t=A.call(this,e)||this;return t.src=e.currentSrc||e.src,t.intrinsicWidth=e.naturalWidth,t.intrinsicHeight=e.naturalHeight,HA.getInstance().addImage(t.src),t}return __extends(ImageElementContainer,A),ImageElementContainer}(nt),at=function(A){function CanvasElementContainer(e){var t=A.call(this,e)||this;return t.canvas=e,t.intrinsicWidth=e.width,t.intrinsicHeight=e.height,t}return __extends(CanvasElementContainer,A),CanvasElementContainer}(nt),ct=function(A){function SVGElementContainer(e){var t=A.call(this,e)||this,r=new XMLSerializer;return t.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(e)),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,HA.getInstance().addImage(t.svg),t}return __extends(SVGElementContainer,A),SVGElementContainer}(nt),Qt=function(A){function LIElementContainer(e){var t=A.call(this,e)||this;return t.value=e.value,t}return __extends(LIElementContainer,A),LIElementContainer}(nt),ut=function(A){function OLElementContainer(e){var t=A.call(this,e)||this;return t.start=e.start,t.reversed="boolean"==typeof e.reversed&&!0===e.reversed,t}return __extends(OLElementContainer,A),OLElementContainer}(nt),wt=[{type:n.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],Ut=[{type:n.PERCENTAGE_TOKEN,flags:0,number:50}],lt="password",Ct=function(e){function InputElementContainer(t){var r,n,B,s=e.call(this,t)||this;switch(s.type=t.type.toLowerCase(),s.checked=t.checked,s.value=0===(n=(r=t).type===lt?new Array(r.value.length+1).join("•"):r.value).length?r.placeholder||"":n,"checkbox"!==s.type&&"radio"!==s.type||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=SA.SOLID,s.styles.backgroundClip=[uA.BORDER_BOX],s.styles.backgroundOrigin=[0],s.bounds=(B=s.bounds).width>B.height?new A(B.left+(B.width-B.height)/2,B.top,B.height,B.height):B.width<B.height?new A(B.left,B.top+(B.height-B.width)/2,B.width,B.width):B),s.type){case"checkbox":s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=wt;break;case"radio":s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=Ut}return s}return __extends(InputElementContainer,e),InputElementContainer}(nt),gt=function(A){function SelectElementContainer(e){var t=A.call(this,e)||this,r=e.options[e.selectedIndex||0];return t.value=r&&r.text||"",t}return __extends(SelectElementContainer,A),SelectElementContainer}(nt),Et=function(A){function TextareaElementContainer(e){var t=A.call(this,e)||this;return t.value=e.value,t}return __extends(TextareaElementContainer,A),TextareaElementContainer}(nt),parseColor=function(A){return color_parse(oA.create(A).parseComponentValue())},Ft=function(A){function IFrameElementContainer(e){var t=A.call(this,e)||this;t.src=e.src,t.width=parseInt(e.width,10)||0,t.height=parseInt(e.height,10)||0,t.backgroundColor=t.styles.backgroundColor;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement){t.tree=parseTree(e.contentWindow.document.documentElement);var r=e.contentWindow.document.documentElement?parseColor(getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):UA.TRANSPARENT,n=e.contentWindow.document.body?parseColor(getComputedStyle(e.contentWindow.document.body).backgroundColor):UA.TRANSPARENT;t.backgroundColor=isTransparent(r)?isTransparent(n)?t.styles.backgroundColor:n:r}}catch(A){}return t}return __extends(IFrameElementContainer,A),IFrameElementContainer}(nt),ht=["OL","UL","MENU"],parseNodeTree=function(A,e,t){for(var r=A.firstChild,n=void 0;r;r=n)if(n=r.nextSibling,isTextNode(r)&&r.data.trim().length>0)e.textNodes.push(new st(r,e.styles));else if(isElementNode(r)){var B=createContainer(r);B.styles.isVisible()&&(createsRealStackingContext(r,B,t)?B.flags|=4:createsStackingContext(B.styles)&&(B.flags|=2),-1!==ht.indexOf(r.tagName)&&(B.flags|=8),e.elements.push(B),isTextareaElement(r)||isSVGElement(r)||isSelectElement(r)||parseNodeTree(r,B,t))}},createContainer=function(A){return isImageElement(A)?new it(A):isCanvasElement(A)?new at(A):isSVGElement(A)?new ct(A):isLIElement(A)?new Qt(A):isOLElement(A)?new ut(A):isInputElement(A)?new Ct(A):isSelectElement(A)?new gt(A):isTextareaElement(A)?new Et(A):isIFrameElement(A)?new Ft(A):new nt(A)},parseTree=function(A){var e=createContainer(A);return e.flags|=4,parseNodeTree(A,e,e),e},createsRealStackingContext=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||isBodyElement(A)&&t.styles.isTransparent()},createsStackingContext=function(A){return A.isPositioned()||A.isFloating()},isTextNode=function(A){return A.nodeType===Node.TEXT_NODE},isElementNode=function(A){return A.nodeType===Node.ELEMENT_NODE},isHTMLElementNode=function(A){return isElementNode(A)&&void 0!==A.style&&!isSVGElementNode(A)},isSVGElementNode=function(A){return"object"==typeof A.className},isLIElement=function(A){return"LI"===A.tagName},isOLElement=function(A){return"OL"===A.tagName},isInputElement=function(A){return"INPUT"===A.tagName},isSVGElement=function(A){return"svg"===A.tagName},isBodyElement=function(A){return"BODY"===A.tagName},isCanvasElement=function(A){return"CANVAS"===A.tagName},isImageElement=function(A){return"IMG"===A.tagName},isIFrameElement=function(A){return"IFRAME"===A.tagName},isStyleElement=function(A){return"STYLE"===A.tagName},isScriptElement=function(A){return"SCRIPT"===A.tagName},isTextareaElement=function(A){return"TEXTAREA"===A.tagName},isSelectElement=function(A){return"SELECT"===A.tagName},dt=function(){function CounterState(){this.counters={}}return CounterState.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},CounterState.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},CounterState.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},CounterState.prototype.parse=function(A){var e=this,t=A.counterIncrement,r=A.counterReset,n=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(n=!1,t[Math.max(0,t.length-1)]+=A.increment)}));var B=[];return n&&r.forEach((function(A){var t=e.counters[A.counter];B.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),B},CounterState}(),Ht={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"]},ft={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},pt={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Nt={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},createAdditiveCounter=function(A,e,t,r,n,B){return A<e||A>t?createCounterText(A,n,B.length>0):r.integers.reduce((function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e}),"")+B},createCounterStyleWithSymbolResolver=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},createCounterStyleFromRange=function(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(createCounterStyleWithSymbolResolver(Math.abs(A),B,r,(function(A){return fromCodePoint(Math.floor(A%B)+e)}))+n)},createCounterStyleFromSymbols=function(A,e,t){void 0===t&&(t=". ");var r=e.length;return createCounterStyleWithSymbolResolver(Math.abs(A),r,!1,(function(A){return e[Math.floor(A%r)]}))+t},createCJKCounter=function(A,e,t,r,n,B){if(A<-9999||A>9999)return createCounterText(A,ie.CJK_DECIMAL,n.length>0);var s=Math.abs(A),o=n;if(0===s)return e[0]+o;for(var i=0;s>0&&i<=4;i++){var a=s%10;0===a&&contains(B,1)&&""!==o?o=e[a]+o:a>1||1===a&&0===i||1===a&&1===i&&contains(B,2)||1===a&&1===i&&contains(B,4)&&A>100||1===a&&i>1&&contains(B,8)?o=e[a]+(i>0?t[i-1]:"")+o:1===a&&i>0&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o},createCounterText=function(A,e,t){var r=t?". ":"",n=t?"、":"",B=t?", ":"",s=t?" ":"";switch(e){case ie.DISC:return"•"+s;case ie.CIRCLE:return"◦"+s;case ie.SQUARE:return"◾"+s;case ie.DECIMAL_LEADING_ZERO:var o=createCounterStyleFromRange(A,48,57,!0,r);return o.length<4?"0"+o:o;case ie.CJK_DECIMAL:return createCounterStyleFromSymbols(A,"〇一二三四五六七八九",n);case ie.LOWER_ROMAN:return createAdditiveCounter(A,1,3999,Ht,ie.DECIMAL,r).toLowerCase();case ie.UPPER_ROMAN:return createAdditiveCounter(A,1,3999,Ht,ie.DECIMAL,r);case ie.LOWER_GREEK:return createCounterStyleFromRange(A,945,969,!1,r);case ie.LOWER_ALPHA:return createCounterStyleFromRange(A,97,122,!1,r);case ie.UPPER_ALPHA:return createCounterStyleFromRange(A,65,90,!1,r);case ie.ARABIC_INDIC:return createCounterStyleFromRange(A,1632,1641,!0,r);case ie.ARMENIAN:case ie.UPPER_ARMENIAN:return createAdditiveCounter(A,1,9999,ft,ie.DECIMAL,r);case ie.LOWER_ARMENIAN:return createAdditiveCounter(A,1,9999,ft,ie.DECIMAL,r).toLowerCase();case ie.BENGALI:return createCounterStyleFromRange(A,2534,2543,!0,r);case ie.CAMBODIAN:case ie.KHMER:return createCounterStyleFromRange(A,6112,6121,!0,r);case ie.CJK_EARTHLY_BRANCH:return createCounterStyleFromSymbols(A,"子丑寅卯辰巳午未申酉戌亥",n);case ie.CJK_HEAVENLY_STEM:return createCounterStyleFromSymbols(A,"甲乙丙丁戊己庚辛壬癸",n);case ie.CJK_IDEOGRAPHIC:case ie.TRAD_CHINESE_INFORMAL:return createCJKCounter(A,"零一二三四五六七八九","十百千萬","負",n,14);case ie.TRAD_CHINESE_FORMAL:return createCJKCounter(A,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",n,15);case ie.SIMP_CHINESE_INFORMAL:return createCJKCounter(A,"零一二三四五六七八九","十百千萬","负",n,14);case ie.SIMP_CHINESE_FORMAL:return createCJKCounter(A,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",n,15);case ie.JAPANESE_INFORMAL:return createCJKCounter(A,"〇一二三四五六七八九","十百千万","マイナス",n,0);case ie.JAPANESE_FORMAL:return createCJKCounter(A,"零壱弐参四伍六七八九","拾百千万","マイナス",n,7);case ie.KOREAN_HANGUL_FORMAL:return createCJKCounter(A,"영일이삼사오육칠팔구","십백천만","마이너스",B,7);case ie.KOREAN_HANJA_INFORMAL:return createCJKCounter(A,"零一二三四五六七八九","十百千萬","마이너스",B,0);case ie.KOREAN_HANJA_FORMAL:return createCJKCounter(A,"零壹貳參四五六七八九","拾百千","마이너스",B,7);case ie.DEVANAGARI:return createCounterStyleFromRange(A,2406,2415,!0,r);case ie.GEORGIAN:return createAdditiveCounter(A,1,19999,Nt,ie.DECIMAL,r);case ie.GUJARATI:return createCounterStyleFromRange(A,2790,2799,!0,r);case ie.GURMUKHI:return createCounterStyleFromRange(A,2662,2671,!0,r);case ie.HEBREW:return createAdditiveCounter(A,1,10999,pt,ie.DECIMAL,r);case ie.HIRAGANA:return createCounterStyleFromSymbols(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case ie.HIRAGANA_IROHA:return createCounterStyleFromSymbols(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case ie.KANNADA:return createCounterStyleFromRange(A,3302,3311,!0,r);case ie.KATAKANA:return createCounterStyleFromSymbols(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case ie.KATAKANA_IROHA:return createCounterStyleFromSymbols(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case ie.LAO:return createCounterStyleFromRange(A,3792,3801,!0,r);case ie.MONGOLIAN:return createCounterStyleFromRange(A,6160,6169,!0,r);case ie.MYANMAR:return createCounterStyleFromRange(A,4160,4169,!0,r);case ie.ORIYA:return createCounterStyleFromRange(A,2918,2927,!0,r);case ie.PERSIAN:return createCounterStyleFromRange(A,1776,1785,!0,r);case ie.TAMIL:return createCounterStyleFromRange(A,3046,3055,!0,r);case ie.TELUGU:return createCounterStyleFromRange(A,3174,3183,!0,r);case ie.THAI:return createCounterStyleFromRange(A,3664,3673,!0,r);case ie.TIBETAN:return createCounterStyleFromRange(A,3872,3881,!0,r);case ie.DECIMAL:default:return createCounterStyleFromRange(A,48,57,!0,r)}},Kt=function(){function DocumentCloner(A,e){if(this.options=e,this.scrolledElements=[],this.referenceElement=A,this.counters=new dt,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement)}return DocumentCloner.prototype.toIFrame=function(A,e){var t=this,r=createIFrameContainer(A,e);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var n=A.defaultView.pageXOffset,B=A.defaultView.pageYOffset,s=r.contentWindow,o=s.document,i=iframeLoader(r).then((function(){return __awaiter(t,void 0,void 0,(function(){var A;return __generator(this,(function(t){switch(t.label){case 0:return this.scrolledElements.forEach(restoreNodeScroll),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(o.documentElement.style.top=-e.top+"px",o.documentElement.style.left=-e.left+"px",o.documentElement.style.position="absolute")),A=this.options.onclone,void 0===this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:o.fonts&&o.fonts.ready?[4,o.fonts.ready]:[3,2];case 1:t.sent(),t.label=2;case 2:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(o)})).then((function(){return r}))]:[2,r]}}))}))}));return o.open(),o.write(serializeDoctype(document.doctype)+"<html></html>"),restoreOwnerScroll(this.referenceElement.ownerDocument,n,B),o.replaceChild(o.adoptNode(this.documentElement),o.documentElement),o.close(),i},DocumentCloner.prototype.createElementClone=function(A){if(isCanvasElement(A))return this.createCanvasClone(A);if(isStyleElement(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return isImageElement(e)&&"lazy"===e.loading&&(e.loading="eager"),e},DocumentCloner.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(dA.getInstance(this.options.id).error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},DocumentCloner.prototype.createCanvasClone=function(A){if(this.options.inlineImages&&A.ownerDocument){var e=A.ownerDocument.createElement("img");try{return e.src=A.toDataURL(),e}catch(A){dA.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var t=A.cloneNode(!1);try{t.width=A.width,t.height=A.height;var r=A.getContext("2d"),n=t.getContext("2d");return n&&(r?n.putImageData(r.getImageData(0,0,A.width,A.height),0,0):n.drawImage(A,0,0)),t}catch(A){}return t},DocumentCloner.prototype.cloneNode=function(A){if(isTextNode(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var e=A.ownerDocument.defaultView;if(e&&isElementNode(A)&&(isHTMLElementNode(A)||isSVGElementNode(A))){var t=this.createElementClone(A),r=e.getComputedStyle(A),n=e.getComputedStyle(A,":before"),B=e.getComputedStyle(A,":after");this.referenceElement===A&&isHTMLElementNode(t)&&(this.clonedReferenceElement=t),isBodyElement(t)&&createPseudoHideStyles(t);for(var s=this.counters.parse(new rt(r)),o=this.resolvePseudoContent(A,t,n,We.BEFORE),i=A.firstChild;i;i=i.nextSibling)isElementNode(i)&&(isScriptElement(i)||i.hasAttribute("data-html2canvas-ignore")||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(i))||this.options.copyStyles&&isElementNode(i)&&isStyleElement(i)||t.appendChild(this.cloneNode(i));o&&t.insertBefore(o,t.firstChild);var a=this.resolvePseudoContent(A,t,B,We.AFTER);return a&&t.appendChild(a),this.counters.pop(s),r&&(this.options.copyStyles||isSVGElementNode(A))&&!isIFrameElement(A)&&copyCSSStyles(r,t),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([t,A.scrollLeft,A.scrollTop]),(isTextareaElement(A)||isSelectElement(A))&&(isTextareaElement(t)||isSelectElement(t))&&(t.value=A.value),t}return A.cloneNode(!1)},DocumentCloner.prototype.resolvePseudoContent=function(A,e,t,r){var B=this;if(t){var s=t.content,o=e.ownerDocument;if(o&&s&&"none"!==s&&"-moz-alt-content"!==s&&"none"!==t.display){this.counters.parse(new rt(t));var i=new tt(t),a=o.createElement("html2canvaspseudoelement");copyCSSStyles(t,a),i.content.forEach((function(e){if(e.type===n.STRING_TOKEN)a.appendChild(o.createTextNode(e.value));else if(e.type===n.URL_TOKEN){var t=o.createElement("img");t.src=e.value,t.style.opacity="1",a.appendChild(t)}else if(e.type===n.FUNCTION){if("attr"===e.name){var r=e.values.filter(isIdentToken);r.length&&a.appendChild(o.createTextNode(A.getAttribute(r[0].value)||""))}else if("counter"===e.name){var s=e.values.filter(nonFunctionArgSeparator),c=s[0],Q=s[1];if(c&&isIdentToken(c)){var u=B.counters.getCounterValue(c.value),w=Q&&isIdentToken(Q)?Qe.parse(Q.value):ie.DECIMAL;a.appendChild(o.createTextNode(createCounterText(u,w,!1)))}}else if("counters"===e.name){var U=e.values.filter(nonFunctionArgSeparator),l=(c=U[0],U[1]);if(Q=U[2],c&&isIdentToken(c)){var C=B.counters.getCounterValues(c.value),g=Q&&isIdentToken(Q)?Qe.parse(Q.value):ie.DECIMAL,E=l&&l.type===n.STRING_TOKEN?l.value:"",F=C.map((function(A){return createCounterText(A,g,!1)})).join(E);a.appendChild(o.createTextNode(F))}}}else if(e.type===n.IDENT_TOKEN)switch(e.value){case"open-quote":a.appendChild(o.createTextNode(getQuote(i.quotes,B.quoteDepth++,!0)));break;case"close-quote":a.appendChild(o.createTextNode(getQuote(i.quotes,--B.quoteDepth,!1)));break;default:a.appendChild(o.createTextNode(e.value))}})),a.className=mt+" "+Tt;var c=r===We.BEFORE?" "+mt:" "+Tt;return isSVGElementNode(e)?e.className.baseValue+=c:e.className+=c,a}}},DocumentCloner.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},DocumentCloner}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(We||(We={}));var It,createIFrameContainer=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute("data-html2canvas-ignore","true"),A.body.appendChild(t),t},iframeLoader=function(A){return new Promise((function(e,t){var r=A.contentWindow;if(!r)return t("No window assigned for iframe");var n=r.document;r.onload=A.onload=n.onreadystatechange=function(){r.onload=A.onload=n.onreadystatechange=null;var t=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(t),e(A))}),50)}}))},copyCSSStyles=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);"content"!==r&&e.style.setProperty(r,A.getPropertyValue(r))}return e},serializeDoctype=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},restoreOwnerScroll=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},restoreNodeScroll=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},mt="___html2canvas___pseudoelement_before",Tt="___html2canvas___pseudoelement_after",createPseudoHideStyles=function(A){createStyles(A,"."+mt+':before{\n    content: "" !important;\n    display: none !important;\n}\n         .'+Tt+':after{\n    content: "" !important;\n    display: none !important;\n}')},createStyles=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}};!function(A){A[A.VECTOR=0]="VECTOR",A[A.BEZIER_CURVE=1]="BEZIER_CURVE"}(It||(It={}));var Rt,equalPath=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},Lt=function(){function Vector(A,e){this.type=It.VECTOR,this.x=A,this.y=e}return Vector.prototype.add=function(A,e){return new Vector(this.x+A,this.y+e)},Vector}(),lerp=function(A,e,t){return new Lt(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},vt=function(){function BezierCurve(A,e,t,r){this.type=It.BEZIER_CURVE,this.start=A,this.startControl=e,this.endControl=t,this.end=r}return BezierCurve.prototype.subdivide=function(A,e){var t=lerp(this.start,this.startControl,A),r=lerp(this.startControl,this.endControl,A),n=lerp(this.endControl,this.end,A),B=lerp(t,r,A),s=lerp(r,n,A),o=lerp(B,s,A);return e?new BezierCurve(this.start,t,B,o):new BezierCurve(o,s,n,this.end)},BezierCurve.prototype.add=function(A,e){return new BezierCurve(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},BezierCurve.prototype.reverse=function(){return new BezierCurve(this.end,this.endControl,this.startControl,this.start)},BezierCurve}(),isBezierCurve=function(A){return A.type===It.BEZIER_CURVE},Ot=function Ot(A){var e=A.styles,t=A.bounds,r=getAbsoluteValueForTuple(e.borderTopLeftRadius,t.width,t.height),n=r[0],B=r[1],s=getAbsoluteValueForTuple(e.borderTopRightRadius,t.width,t.height),o=s[0],i=s[1],a=getAbsoluteValueForTuple(e.borderBottomRightRadius,t.width,t.height),c=a[0],Q=a[1],u=getAbsoluteValueForTuple(e.borderBottomLeftRadius,t.width,t.height),w=u[0],U=u[1],l=[];l.push((n+o)/t.width),l.push((w+c)/t.width),l.push((B+U)/t.height),l.push((i+Q)/t.height);var C=Math.max.apply(Math,l);C>1&&(n/=C,B/=C,o/=C,i/=C,c/=C,Q/=C,w/=C,U/=C);var g=t.width-o,E=t.height-Q,F=t.width-c,h=t.height-U,d=e.borderTopWidth,H=e.borderRightWidth,f=e.borderBottomWidth,p=e.borderLeftWidth,N=getAbsoluteValue(e.paddingTop,A.bounds.width),K=getAbsoluteValue(e.paddingRight,A.bounds.width),I=getAbsoluteValue(e.paddingBottom,A.bounds.width),m=getAbsoluteValue(e.paddingLeft,A.bounds.width);this.topLeftBorderBox=n>0||B>0?getCurvePoints(t.left,t.top,n,B,Rt.TOP_LEFT):new Lt(t.left,t.top),this.topRightBorderBox=o>0||i>0?getCurvePoints(t.left+g,t.top,o,i,Rt.TOP_RIGHT):new Lt(t.left+t.width,t.top),this.bottomRightBorderBox=c>0||Q>0?getCurvePoints(t.left+F,t.top+E,c,Q,Rt.BOTTOM_RIGHT):new Lt(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=w>0||U>0?getCurvePoints(t.left,t.top+h,w,U,Rt.BOTTOM_LEFT):new Lt(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||B>0?getCurvePoints(t.left+p,t.top+d,Math.max(0,n-p),Math.max(0,B-d),Rt.TOP_LEFT):new Lt(t.left+p,t.top+d),this.topRightPaddingBox=o>0||i>0?getCurvePoints(t.left+Math.min(g,t.width+p),t.top+d,g>t.width+p?0:o-p,i-d,Rt.TOP_RIGHT):new Lt(t.left+t.width-H,t.top+d),this.bottomRightPaddingBox=c>0||Q>0?getCurvePoints(t.left+Math.min(F,t.width-p),t.top+Math.min(E,t.height+d),Math.max(0,c-H),Q-f,Rt.BOTTOM_RIGHT):new Lt(t.left+t.width-H,t.top+t.height-f),this.bottomLeftPaddingBox=w>0||U>0?getCurvePoints(t.left+p,t.top+h,Math.max(0,w-p),U-f,Rt.BOTTOM_LEFT):new Lt(t.left+p,t.top+t.height-f),this.topLeftContentBox=n>0||B>0?getCurvePoints(t.left+p+m,t.top+d+N,Math.max(0,n-(p+m)),Math.max(0,B-(d+N)),Rt.TOP_LEFT):new Lt(t.left+p+m,t.top+d+N),this.topRightContentBox=o>0||i>0?getCurvePoints(t.left+Math.min(g,t.width+p+m),t.top+d+N,g>t.width+p+m?0:o-p+m,i-(d+N),Rt.TOP_RIGHT):new Lt(t.left+t.width-(H+K),t.top+d+N),this.bottomRightContentBox=c>0||Q>0?getCurvePoints(t.left+Math.min(F,t.width-(p+m)),t.top+Math.min(E,t.height+d+N),Math.max(0,c-(H+K)),Q-(f+I),Rt.BOTTOM_RIGHT):new Lt(t.left+t.width-(H+K),t.top+t.height-(f+I)),this.bottomLeftContentBox=w>0||U>0?getCurvePoints(t.left+p+m,t.top+h,Math.max(0,w-(p+m)),U-(f+I),Rt.BOTTOM_LEFT):new Lt(t.left+p+m,t.top+t.height-(f+I))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Rt||(Rt={}));var getCurvePoints=function(A,e,t,r,n){var B=(Math.sqrt(2)-1)/3*4,s=t*B,o=r*B,i=A+t,a=e+r;switch(n){case Rt.TOP_LEFT:return new vt(new Lt(A,a),new Lt(A,a-o),new Lt(i-s,e),new Lt(i,e));case Rt.TOP_RIGHT:return new vt(new Lt(A,e),new Lt(A+s,e),new Lt(i,a-o),new Lt(i,a));case Rt.BOTTOM_RIGHT:return new vt(new Lt(i,e),new Lt(i,e+o),new Lt(A+s,a),new Lt(A,a));case Rt.BOTTOM_LEFT:default:return new vt(new Lt(i,a),new Lt(i-s,a),new Lt(A,e+o),new Lt(A,e))}},calculateBorderBoxPath=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},calculatePaddingBoxPath=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},St=function St(A,e,t){this.type=0,this.offsetX=A,this.offsetY=e,this.matrix=t,this.target=6},Dt=function Dt(A,e){this.type=1,this.target=e,this.path=A},bt=function bt(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Mt=function(){function ElementPaint(A,e){if(this.container=A,this.effects=e.slice(0),this.curves=new Ot(A),null!==A.styles.transform){var t=A.bounds.left+A.styles.transformOrigin[0].number,r=A.bounds.top+A.styles.transformOrigin[1].number,n=A.styles.transform;this.effects.push(new St(t,r,n))}if(A.styles.overflowX!==ce.VISIBLE){var B=calculateBorderBoxPath(this.curves),s=calculatePaddingBoxPath(this.curves);equalPath(B,s)?this.effects.push(new Dt(B,6)):(this.effects.push(new Dt(B,2)),this.effects.push(new Dt(s,4)))}}return ElementPaint.prototype.getParentEffects=function(){var A=this.effects.slice(0);if(this.container.styles.overflowX!==ce.VISIBLE){var e=calculateBorderBoxPath(this.curves),t=calculatePaddingBoxPath(this.curves);equalPath(e,t)||A.push(new Dt(t,6))}return A},ElementPaint}(),parseStackTree=function(A,e,t,r){A.container.elements.forEach((function(n){var B=contains(n.flags,4),s=contains(n.flags,2),o=new Mt(n,A.getParentEffects());contains(n.styles.display,2048)&&r.push(o);var i=contains(n.flags,8)?[]:r;if(B||s){var a=B||n.styles.isPositioned()?t:e,c=new bt(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var Q=n.styles.zIndex.order;if(Q<0){var u=0;a.negativeZIndex.some((function(A,e){return Q>A.element.container.styles.zIndex.order?(u=e,!1):u>0})),a.negativeZIndex.splice(u,0,c)}else if(Q>0){var w=0;a.positiveZIndex.some((function(A,e){return Q>=A.element.container.styles.zIndex.order?(w=e+1,!1):w>0})),a.positiveZIndex.splice(w,0,c)}else a.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?a.nonPositionedFloats.push(c):a.nonPositionedInlineLevel.push(c);parseStackTree(o,c,B?c:t,i)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),parseStackTree(o,e,t,i);contains(n.flags,8)&&processListItems(n,i)}))},processListItems=function(A,e){for(var t=A instanceof ut?A.start:1,r=A instanceof ut&&A.reversed,n=0;n<e.length;n++){var B=e[n];B.container instanceof Qt&&"number"==typeof B.container.value&&0!==B.container.value&&(t=B.container.value),B.listValue=createCounterText(t,B.container.styles.listStyleType,!0),t+=r?-1:1}},createPathFromCurves=function(A,e,t,r){var n=[];return isBezierCurve(A)?n.push(A.subdivide(.5,!1)):n.push(A),isBezierCurve(t)?n.push(t.subdivide(.5,!0)):n.push(t),isBezierCurve(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),isBezierCurve(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},paddingBox=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},contentBox=function(A){var e=A.styles,t=A.bounds,r=getAbsoluteValue(e.paddingLeft,t.width),n=getAbsoluteValue(e.paddingRight,t.width),B=getAbsoluteValue(e.paddingTop,t.width),s=getAbsoluteValue(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,B+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+B+s))},calculateBackgroundRendering=function(A,e,t){var r=function(A,e){return 0===A?e.bounds:2===A?contentBox(e):paddingBox(e)}(getBackgroundValueForIndex(A.styles.backgroundOrigin,e),A),n=function(A,e){return A===uA.BORDER_BOX?e.bounds:A===uA.CONTENT_BOX?contentBox(e):paddingBox(e)}(getBackgroundValueForIndex(A.styles.backgroundClip,e),A),B=calculateBackgroundSize(getBackgroundValueForIndex(A.styles.backgroundSize,e),t,r),s=B[0],o=B[1],i=getAbsoluteValueForTuple(getBackgroundValueForIndex(A.styles.backgroundPosition,e),r.width-s,r.height-o);return[calculateBackgroundRepeatPath(getBackgroundValueForIndex(A.styles.backgroundRepeat,e),i,B,r,n),Math.round(r.left+i[0]),Math.round(r.top+i[1]),s,o]},isAuto=function(A){return isIdentToken(A)&&A.value===vA.AUTO},hasIntrinsicValue=function(A){return"number"==typeof A},calculateBackgroundSize=function(A,e,t){var r=e[0],n=e[1],B=e[2],s=A[0],o=A[1];if(isLengthPercentage(s)&&o&&isLengthPercentage(o))return[getAbsoluteValue(s,t.width),getAbsoluteValue(o,t.height)];var i=hasIntrinsicValue(B);if(isIdentToken(s)&&(s.value===vA.CONTAIN||s.value===vA.COVER))return hasIntrinsicValue(B)?t.width/t.height<B!=(s.value===vA.COVER)?[t.width,t.width/B]:[t.height*B,t.height]:[t.width,t.height];var a=hasIntrinsicValue(r),c=hasIntrinsicValue(n),Q=a||c;if(isAuto(s)&&(!o||isAuto(o)))return a&&c?[r,n]:i||Q?Q&&i?[a?r:n*B,c?n:r/B]:[a?r:t.width,c?n:t.height]:[t.width,t.height];if(i){var u=0,w=0;return isLengthPercentage(s)?u=getAbsoluteValue(s,t.width):isLengthPercentage(o)&&(w=getAbsoluteValue(o,t.height)),isAuto(s)?u=w*B:o&&!isAuto(o)||(w=u/B),[u,w]}var U=null,l=null;if(isLengthPercentage(s)?U=getAbsoluteValue(s,t.width):o&&isLengthPercentage(o)&&(l=getAbsoluteValue(o,t.height)),null===U||o&&!isAuto(o)||(l=a&&c?U/r*n:t.height),null!==l&&isAuto(s)&&(U=a&&c?l/n*r:t.width),null!==U&&null!==l)return[U,l];throw new Error("Unable to calculate background-size for element")},getBackgroundValueForIndex=function(A,e){var t=A[e];return void 0===t?A[0]:t},calculateBackgroundRepeatPath=function(A,e,t,r,n){var B=e[0],s=e[1],o=t[0],i=t[1];switch(A){case IA.REPEAT_X:return[new Lt(Math.round(r.left),Math.round(r.top+s)),new Lt(Math.round(r.left+r.width),Math.round(r.top+s)),new Lt(Math.round(r.left+r.width),Math.round(i+r.top+s)),new Lt(Math.round(r.left),Math.round(i+r.top+s))];case IA.REPEAT_Y:return[new Lt(Math.round(r.left+B),Math.round(r.top)),new Lt(Math.round(r.left+B+o),Math.round(r.top)),new Lt(Math.round(r.left+B+o),Math.round(r.height+r.top)),new Lt(Math.round(r.left+B),Math.round(r.height+r.top))];case IA.NO_REPEAT:return[new Lt(Math.round(r.left+B),Math.round(r.top+s)),new Lt(Math.round(r.left+B+o),Math.round(r.top+s)),new Lt(Math.round(r.left+B+o),Math.round(r.top+s+i)),new Lt(Math.round(r.left+B),Math.round(r.top+s+i))];default:return[new Lt(Math.round(n.left),Math.round(n.top)),new Lt(Math.round(n.left+n.width),Math.round(n.top)),new Lt(Math.round(n.left+n.width),Math.round(n.height+n.top)),new Lt(Math.round(n.left),Math.round(n.height+n.top))]}},_t=function(){function FontMetrics(A){this._data={},this._document=A}return FontMetrics.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),B=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",B.appendChild(t),r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode("Hidden Text")),t.appendChild(n),t.appendChild(r);var s=r.offsetTop-n.offsetTop+2;t.removeChild(n),t.appendChild(this._document.createTextNode("Hidden Text")),t.style.lineHeight="normal",r.style.verticalAlign="super";var o=r.offsetTop-t.offsetTop+2;return B.removeChild(t),{baseline:s,middle:o}},FontMetrics.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},FontMetrics}(),yt=function(){function CanvasRenderer(A){this._activeEffects=[],this.canvas=A.canvas?A.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options=A,A.canvas||(this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width=A.width+"px",this.canvas.style.height=A.height+"px"),this.fontMetrics=new _t(document),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x+A.scrollX,-A.y+A.scrollY),this.ctx.textBaseline="bottom",this._activeEffects=[],dA.getInstance(A.id).debug("Canvas renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale)}return CanvasRenderer.prototype.applyEffects=function(A,e){for(var t=this;this._activeEffects.length;)this.popEffect();A.filter((function(A){return contains(A.target,e)})).forEach((function(A){return t.applyEffect(A)}))},CanvasRenderer.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),function(A){return 1===A.type}(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},CanvasRenderer.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},CanvasRenderer.prototype.renderStack=function(A){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return(e=A.element.container.styles).isVisible()?(this.ctx.globalAlpha=e.opacity,[4,this.renderStackContent(A)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},CanvasRenderer.prototype.renderNode=function(A){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},CanvasRenderer.prototype.renderTextWithLetterSpacing=function(A,e){var t=this;0===e?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height):toCodePoints(A.text).map((function(A){return fromCodePoint(A)})).reduce((function(e,r){return t.ctx.fillText(r,e,A.bounds.top+A.bounds.height),e+t.ctx.measureText(r).width}),A.bounds.left)},CanvasRenderer.prototype.createFontStyle=function(A){var e=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),t=A.fontFamily.join(", "),r=isDimensionToken(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,r,t].join(" "),t,r]},CanvasRenderer.prototype.renderTextNode=function(A,e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,B,s=this;return __generator(this,(function(o){return t=this.createFontStyle(e),r=t[0],n=t[1],B=t[2],this.ctx.font=r,A.textBounds.forEach((function(A){s.ctx.fillStyle=asString(e.color),s.renderTextWithLetterSpacing(A,e.letterSpacing);var t=e.textShadow;t.length&&A.text.trim().length&&(t.slice(0).reverse().forEach((function(e){s.ctx.shadowColor=asString(e.color),s.ctx.shadowOffsetX=e.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=e.offsetY.number*s.options.scale,s.ctx.shadowBlur=e.blur.number,s.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)})),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),e.textDecorationLine.length&&(s.ctx.fillStyle=asString(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:var t=s.fontMetrics.getMetrics(n,B).baseline;s.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+t),A.bounds.width,1);break;case 2:s.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:var r=s.fontMetrics.getMetrics(n,B).middle;s.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+r),A.bounds.width,1)}})))})),[2]}))}))},CanvasRenderer.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var r=contentBox(A),n=calculatePaddingBoxPath(e);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},CanvasRenderer.prototype.renderNodeContent=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,B,s,o,i,a,c,Q,u,w,U,l,C;return __generator(this,(function(g){switch(g.label){case 0:this.applyEffects(e.effects,4),t=e.container,r=e.curves,B=t.styles,s=0,o=t.textNodes,g.label=1;case 1:return s<o.length?(i=o[s],[4,this.renderTextNode(i,B)]):[3,4];case 2:g.sent(),g.label=3;case 3:return s++,[3,1];case 4:if(!(t instanceof it))return[3,8];g.label=5;case 5:return g.trys.push([5,7,,8]),[4,this.options.cache.match(t.src)];case 6:return U=g.sent(),this.renderReplacedElement(t,r,U),[3,8];case 7:return g.sent(),dA.getInstance(this.options.id).error("Error loading image "+t.src),[3,8];case 8:if(t instanceof at&&this.renderReplacedElement(t,r,t.canvas),!(t instanceof ct))return[3,12];g.label=9;case 9:return g.trys.push([9,11,,12]),[4,this.options.cache.match(t.svg)];case 10:return U=g.sent(),this.renderReplacedElement(t,r,U),[3,12];case 11:return g.sent(),dA.getInstance(this.options.id).error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Ft&&t.tree?[4,new CanvasRenderer({id:this.options.id,scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,scrollX:0,scrollY:0,width:t.width,height:t.height,cache:this.options.cache,windowWidth:t.width,windowHeight:t.height}).render(t.tree)]:[3,14];case 13:a=g.sent(),t.width&&t.height&&this.ctx.drawImage(a,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),g.label=14;case 14:if(t instanceof Ct&&(c=Math.min(t.bounds.width,t.bounds.height),"checkbox"===t.type?t.checked&&(this.ctx.save(),this.path([new Lt(t.bounds.left+.39363*c,t.bounds.top+.79*c),new Lt(t.bounds.left+.16*c,t.bounds.top+.5549*c),new Lt(t.bounds.left+.27347*c,t.bounds.top+.44071*c),new Lt(t.bounds.left+.39694*c,t.bounds.top+.5649*c),new Lt(t.bounds.left+.72983*c,t.bounds.top+.23*c),new Lt(t.bounds.left+.84*c,t.bounds.top+.34085*c),new Lt(t.bounds.left+.39363*c,t.bounds.top+.79*c)]),this.ctx.fillStyle=asString(707406591),this.ctx.fill(),this.ctx.restore()):"radio"===t.type&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+c/2,t.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=asString(707406591),this.ctx.fill(),this.ctx.restore())),isTextInputElement(t)&&t.value.length){switch(this.ctx.font=this.createFontStyle(B)[0],this.ctx.fillStyle=asString(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign=canvasTextAlign(t.styles.textAlign),C=contentBox(t),Q=0,t.styles.textAlign){case Ee.CENTER:Q+=C.width/2;break;case Ee.RIGHT:Q+=C.width}u=C.add(Q,0,0,-C.height/2+1),this.ctx.save(),this.path([new Lt(C.left,C.top),new Lt(C.left+C.width,C.top),new Lt(C.left+C.width,C.top+C.height),new Lt(C.left,C.top+C.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Bt(t.value,u),B.letterSpacing),this.ctx.restore(),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"}if(!contains(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if((w=t.styles.listStyleImage).type!==lA.URL)return[3,18];U=void 0,l=w.url,g.label=15;case 15:return g.trys.push([15,17,,18]),[4,this.options.cache.match(l)];case 16:return U=g.sent(),this.ctx.drawImage(U,t.bounds.left-(U.width+10),t.bounds.top),[3,18];case 17:return g.sent(),dA.getInstance(this.options.id).error("Error loading list-style-image "+l),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==ie.NONE&&(this.ctx.font=this.createFontStyle(B)[0],this.ctx.fillStyle=asString(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",C=new A(t.bounds.left,t.bounds.top+getAbsoluteValue(t.styles.paddingTop,t.bounds.width),t.bounds.width,function(A,e){return isIdentToken(A)&&"normal"===A.value?1.2*e:A.type===n.NUMBER_TOKEN?e*A.number:isLengthPercentage(A)?getAbsoluteValue(A,e):e}(B.lineHeight,B.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Bt(e.listValue,C),B.letterSpacing),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),g.label=20;case 20:return[2]}}))}))},CanvasRenderer.prototype.renderStackContent=function(A){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,B,s,o,i,a,c,Q,u,w,U,l;return __generator(this,(function(C){switch(C.label){case 0:return[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:C.sent(),e=0,t=A.negativeZIndex,C.label=2;case 2:return e<t.length?(l=t[e],[4,this.renderStack(l)]):[3,5];case 3:C.sent(),C.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:C.sent(),r=0,n=A.nonInlineLevel,C.label=7;case 7:return r<n.length?(l=n[r],[4,this.renderNode(l)]):[3,10];case 8:C.sent(),C.label=9;case 9:return r++,[3,7];case 10:B=0,s=A.nonPositionedFloats,C.label=11;case 11:return B<s.length?(l=s[B],[4,this.renderStack(l)]):[3,14];case 12:C.sent(),C.label=13;case 13:return B++,[3,11];case 14:o=0,i=A.nonPositionedInlineLevel,C.label=15;case 15:return o<i.length?(l=i[o],[4,this.renderStack(l)]):[3,18];case 16:C.sent(),C.label=17;case 17:return o++,[3,15];case 18:a=0,c=A.inlineLevel,C.label=19;case 19:return a<c.length?(l=c[a],[4,this.renderNode(l)]):[3,22];case 20:C.sent(),C.label=21;case 21:return a++,[3,19];case 22:Q=0,u=A.zeroOrAutoZIndexOrTransformedOrOpacity,C.label=23;case 23:return Q<u.length?(l=u[Q],[4,this.renderStack(l)]):[3,26];case 24:C.sent(),C.label=25;case 25:return Q++,[3,23];case 26:w=0,U=A.positiveZIndex,C.label=27;case 27:return w<U.length?(l=U[w],[4,this.renderStack(l)]):[3,30];case 28:C.sent(),C.label=29;case 29:return w++,[3,27];case 30:return[2]}}))}))},CanvasRenderer.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},CanvasRenderer.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},CanvasRenderer.prototype.formatPath=function(A){var e=this;A.forEach((function(A,t){var r=isBezierCurve(A)?A.start:A;0===t?e.ctx.moveTo(r.x,r.y):e.ctx.lineTo(r.x,r.y),isBezierCurve(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},CanvasRenderer.prototype.renderRepeat=function(A,e,t,r){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,r),this.ctx.fill(),this.ctx.translate(-t,-r)},CanvasRenderer.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var r=this.canvas.ownerDocument.createElement("canvas");return r.width=e,r.height=t,r.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),r},CanvasRenderer.prototype.renderBackgroundImage=function(A){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,B,s;return __generator(this,(function(o){switch(o.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var n,B,s,o,i,a,c,Q,u,w,U,l,C,g,E,F,h,d,H,f,p,N,K,I,m,T,R,L,v,O,S;return __generator(this,(function(D){switch(D.label){case 0:if(t.type!==lA.URL)return[3,5];n=void 0,B=t.url,D.label=1;case 1:return D.trys.push([1,3,,4]),[4,r.options.cache.match(B)];case 2:return n=D.sent(),[3,4];case 3:return D.sent(),dA.getInstance(r.options.id).error("Error loading background-image "+B),[3,4];case 4:return n&&(s=calculateBackgroundRendering(A,e,[n.width,n.height,n.width/n.height]),F=s[0],N=s[1],K=s[2],H=s[3],f=s[4],g=r.ctx.createPattern(r.resizeImage(n,H,f),"repeat"),r.renderRepeat(F,g,N,K)),[3,6];case 5:t.type===lA.LINEAR_GRADIENT?(o=calculateBackgroundRendering(A,e,[null,null,null]),F=o[0],N=o[1],K=o[2],H=o[3],f=o[4],i=calculateGradientDirection(t.angle,H,f),a=i[0],c=i[1],Q=i[2],u=i[3],w=i[4],(U=document.createElement("canvas")).width=H,U.height=f,l=U.getContext("2d"),C=l.createLinearGradient(c,u,Q,w),processColorStops(t.stops,a).forEach((function(A){return C.addColorStop(A.stop,asString(A.color))})),l.fillStyle=C,l.fillRect(0,0,H,f),H>0&&f>0&&(g=r.ctx.createPattern(U,"repeat"),r.renderRepeat(F,g,N,K))):function(A){return A.type===lA.RADIAL_GRADIENT}(t)&&(E=calculateBackgroundRendering(A,e,[null,null,null]),F=E[0],h=E[1],d=E[2],H=E[3],f=E[4],p=0===t.position.length?[aA]:t.position,N=getAbsoluteValue(p[0],H),K=getAbsoluteValue(p[p.length-1],f),I=function(A,e,t,r,n){var B=0,s=0;switch(A.size){case gA.CLOSEST_SIDE:A.shape===CA.CIRCLE?B=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===CA.ELLIPSE&&(B=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-n)));break;case gA.CLOSEST_CORNER:if(A.shape===CA.CIRCLE)B=s=Math.min(distance(e,t),distance(e,t-n),distance(e-r,t),distance(e-r,t-n));else if(A.shape===CA.ELLIPSE){var o=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),i=findCorner(r,n,e,t,!0),a=i[0],c=i[1];s=o*(B=distance(a-e,(c-t)/o))}break;case gA.FARTHEST_SIDE:A.shape===CA.CIRCLE?B=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===CA.ELLIPSE&&(B=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-n)));break;case gA.FARTHEST_CORNER:if(A.shape===CA.CIRCLE)B=s=Math.max(distance(e,t),distance(e,t-n),distance(e-r,t),distance(e-r,t-n));else if(A.shape===CA.ELLIPSE){o=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r));var Q=findCorner(r,n,e,t,!1);a=Q[0],c=Q[1],s=o*(B=distance(a-e,(c-t)/o))}}return Array.isArray(A.size)&&(B=getAbsoluteValue(A.size[0],r),s=2===A.size.length?getAbsoluteValue(A.size[1],n):B),[B,s]}(t,N,K,H,f),m=I[0],T=I[1],m>0&&m>0&&(R=r.ctx.createRadialGradient(h+N,d+K,0,h+N,d+K,m),processColorStops(t.stops,2*m).forEach((function(A){return R.addColorStop(A.stop,asString(A.color))})),r.path(F),r.ctx.fillStyle=R,m!==T?(L=A.bounds.left+.5*A.bounds.width,v=A.bounds.top+.5*A.bounds.height,S=1/(O=T/m),r.ctx.save(),r.ctx.translate(L,v),r.ctx.transform(1,0,0,O,0,0),r.ctx.translate(-L,-v),r.ctx.fillRect(h,S*(d-v)+v,H,f*S),r.ctx.restore()):r.ctx.fill())),D.label=6;case 6:return e--,[2]}}))},r=this,n=0,B=A.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return n<B.length?(s=B[n],[5,t(s)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},CanvasRenderer.prototype.renderBorder=function(A,e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.path(function(A,e){switch(e){case 0:return createPathFromCurves(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return createPathFromCurves(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return createPathFromCurves(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);case 3:default:return createPathFromCurves(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}}(t,e)),this.ctx.fillStyle=asString(A),this.ctx.fill(),[2]}))}))},CanvasRenderer.prototype.renderNodeBackgroundAndBorders=function(A){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,B,s,o,i,a=this;return __generator(this,(function(c){switch(c.label){case 0:return this.applyEffects(A.effects,2),e=A.container.styles,t=!isTransparent(e.backgroundColor)||e.backgroundImage.length,r=[{style:e.borderTopStyle,color:e.borderTopColor},{style:e.borderRightStyle,color:e.borderRightColor},{style:e.borderBottomStyle,color:e.borderBottomColor},{style:e.borderLeftStyle,color:e.borderLeftColor}],n=calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(n),this.ctx.clip(),isTransparent(e.backgroundColor)||(this.ctx.fillStyle=asString(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:c.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){a.ctx.save();var t,r,n,B,s,o=calculateBorderBoxPath(A.curves),i=e.inset?0:1e4,c=(t=o,r=-i+(e.inset?1:-1)*e.spread.number,n=(e.inset?1:-1)*e.spread.number,B=e.spread.number*(e.inset?-2:2),s=e.spread.number*(e.inset?-2:2),t.map((function(A,e){switch(e){case 0:return A.add(r,n);case 1:return A.add(r+B,n);case 2:return A.add(r+B,n+s);case 3:return A.add(r,n+s)}return A})));e.inset?(a.path(o),a.ctx.clip(),a.mask(c)):(a.mask(o),a.ctx.clip(),a.path(c)),a.ctx.shadowOffsetX=e.offsetX.number+i,a.ctx.shadowOffsetY=e.offsetY.number,a.ctx.shadowColor=asString(e.color),a.ctx.shadowBlur=e.blur.number,a.ctx.fillStyle=e.inset?asString(e.color):"rgba(0,0,0,1)",a.ctx.fill(),a.ctx.restore()})),c.label=2;case 2:B=0,s=0,o=r,c.label=3;case 3:return s<o.length?(i=o[s]).style===SA.NONE||isTransparent(i.color)?[3,5]:[4,this.renderBorder(i.color,B,A.curves)]:[3,7];case 4:c.sent(),c.label=5;case 5:B++,c.label=6;case 6:return s++,[3,3];case 7:return[2]}}))}))},CanvasRenderer.prototype.render=function(A){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=asString(this.options.backgroundColor),this.ctx.fillRect(this.options.x-this.options.scrollX,this.options.y-this.options.scrollY,this.options.width,this.options.height)),r=new Mt(A,[]),n=new bt(r),parseStackTree(r,n,n,B=[]),processListItems(r.container,B),e=n,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([],2),[2,this.canvas]}var r,n,B}))}))},CanvasRenderer}(),isTextInputElement=function(A){return A instanceof Et||A instanceof gt||A instanceof Ct&&"radio"!==A.type&&"checkbox"!==A.type},calculateBackgroundCurvedPaintingArea=function(A,e){switch(A){case uA.BORDER_BOX:return calculateBorderBoxPath(e);case uA.CONTENT_BOX:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);case uA.PADDING_BOX:default:return calculatePaddingBoxPath(e)}},canvasTextAlign=function(A){switch(A){case Ee.CENTER:return"center";case Ee.RIGHT:return"right";case Ee.LEFT:default:return"left"}},Pt=function(){function ForeignObjectRenderer(A){this.canvas=A.canvas?A.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options=A,this.canvas.width=Math.floor(A.width*A.scale),this.canvas.height=Math.floor(A.height*A.scale),this.canvas.style.width=A.width+"px",this.canvas.style.height=A.height+"px",this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-A.x+A.scrollX,-A.y+A.scrollY),dA.getInstance(A.id).debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale)}return ForeignObjectRenderer.prototype.render=function(A){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return e=createForeignObjectSVG(Math.max(this.options.windowWidth,this.options.width)*this.options.scale,Math.max(this.options.windowHeight,this.options.height)*this.options.scale,this.options.scrollX*this.options.scale,this.options.scrollY*this.options.scale,A),[4,loadSerializedSVG$1(e)];case 1:return t=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=asString(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},ForeignObjectRenderer}(),loadSerializedSVG$1=function(A){return new Promise((function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))}))},parseColor$1=function(A){return color_parse(oA.create(A).parseComponentValue())};"undefined"!=typeof window&&HA.setContext(window);var renderElement=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var r,n,B,s,o,i,a,c,Q,u,w,U,l,C,g,E,F,h,d,H,f,p,N;return __generator(this,(function(K){switch(K.label){case 0:if(!(r=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(n=r.defaultView))throw new Error("Document is not attached to a Window");return B=(Math.round(1e3*Math.random())+Date.now()).toString(16),s=isBodyElement(e)||"HTML"===e.tagName?function(e){var t=e.body,r=e.documentElement;if(!t||!r)throw new Error("Unable to get document size");var n=Math.max(Math.max(t.scrollWidth,r.scrollWidth),Math.max(t.offsetWidth,r.offsetWidth),Math.max(t.clientWidth,r.clientWidth)),B=Math.max(Math.max(t.scrollHeight,r.scrollHeight),Math.max(t.offsetHeight,r.offsetHeight),Math.max(t.clientHeight,r.clientHeight));return new A(0,0,n,B)}(r):parseBounds(e),o=s.width,i=s.height,a=s.left,c=s.top,Q=__assign({},{allowTaint:!1,imageTimeout:15e3,proxy:void 0,useCORS:!1},t),u={backgroundColor:"#ffffff",cache:t.cache?t.cache:HA.create(B,Q),logging:!0,removeContainer:!0,foreignObjectRendering:!1,scale:n.devicePixelRatio||1,windowWidth:n.innerWidth,windowHeight:n.innerHeight,scrollX:n.pageXOffset,scrollY:n.pageYOffset,x:a,y:c,width:Math.ceil(o),height:Math.ceil(i),id:B},w=__assign({},u,Q,t),U=new A(w.scrollX,w.scrollY,w.windowWidth,w.windowHeight),dA.create({id:B,enabled:w.logging}),dA.getInstance(B).debug("Starting document clone"),l=new Kt(e,{id:B,onclone:w.onclone,ignoreElements:w.ignoreElements,inlineImages:w.foreignObjectRendering,copyStyles:w.foreignObjectRendering}),(C=l.clonedReferenceElement)?[4,l.toIFrame(r,U)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return g=K.sent(),E=r.documentElement?parseColor$1(getComputedStyle(r.documentElement).backgroundColor):UA.TRANSPARENT,F=r.body?parseColor$1(getComputedStyle(r.body).backgroundColor):UA.TRANSPARENT,h=t.backgroundColor,d="string"==typeof h?parseColor$1(h):null===h?UA.TRANSPARENT:4294967295,H=e===r.documentElement?isTransparent(E)?isTransparent(F)?d:F:E:d,f={id:B,cache:w.cache,canvas:w.canvas,backgroundColor:H,scale:w.scale,x:w.x,y:w.y,scrollX:w.scrollX,scrollY:w.scrollY,width:w.width,height:w.height,windowWidth:w.windowWidth,windowHeight:w.windowHeight},w.foreignObjectRendering?(dA.getInstance(B).debug("Document cloned, using foreign object rendering"),[4,new Pt(f).render(C)]):[3,3];case 2:return p=K.sent(),[3,5];case 3:return dA.getInstance(B).debug("Document cloned, using computed rendering"),HA.attachInstance(w.cache),dA.getInstance(B).debug("Starting DOM parsing"),N=parseTree(C),HA.detachInstance(),H===N.styles.backgroundColor&&(N.styles.backgroundColor=UA.TRANSPARENT),dA.getInstance(B).debug("Starting renderer"),[4,new yt(f).render(N)];case 4:p=K.sent(),K.label=5;case 5:return!0===w.removeContainer&&(Kt.destroy(g)||dA.getInstance(B).error("Cannot detach cloned iframe as it is not in the DOM anymore")),dA.getInstance(B).debug("Finished rendering"),dA.destroy(B),HA.destroy(B),[2,p]}}))}))};return function(A,e){return void 0===e&&(e={}),renderElement(A,e)}}()}}]);