/*!
 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Kr=function(e,A){return Kr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var B in r)Object.prototype.hasOwnProperty.call(r,B)&&(t[B]=r[B])},Kr(e,A)};function tA(e,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");Kr(e,A);function t(){this.constructor=e}e.prototype=A===null?Object.create(A):(t.prototype=A.prototype,new t)}var mr=function(){return mr=Object.assign||function(A){for(var t,r=1,B=arguments.length;r<B;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(A[n]=t[n])}return A},mr.apply(this,arguments)};function P(e,A,t,r){function B(n){return n instanceof t?n:new t(function(s){s(n)})}return new(t||(t=Promise))(function(n,s){function i(Q){try{o(r.next(Q))}catch(g){s(g)}}function a(Q){try{o(r.throw(Q))}catch(g){s(g)}}function o(Q){Q.done?n(Q.value):B(Q.value).then(i,a)}o((r=r.apply(e,[])).next())})}function _(e,A){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,B,n,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(o){return function(Q){return a([o,Q])}}function a(o){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,B&&(n=o[0]&2?B.return:o[0]?B.throw||((n=B.return)&&n.call(B),0):B.next)&&!(n=n.call(B,o[1])).done)return n;switch(B=0,n&&(o=[o[0]&2,n.value]),o[0]){case 0:case 1:n=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,B=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!n||o[1]>n[0]&&o[1]<n[3])){t.label=o[1];break}if(o[0]===6&&t.label<n[1]){t.label=n[1],n=o;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(o);break}n[2]&&t.ops.pop(),t.trys.pop();continue}o=A.call(e,t)}catch(Q){o=[6,Q],B=0}finally{r=n=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var cA=(function(){function e(A,t,r,B){this.left=A,this.top=t,this.width=r,this.height=B}return e.prototype.add=function(A,t,r,B){return new e(this.left+A,this.top+t,this.width+r,this.height+B)},e.fromClientRect=function(A,t){return new e(t.left+A.windowBounds.left,t.top+A.windowBounds.top,t.width,t.height)},e.fromDOMRectList=function(A,t){var r=Array.from(t).find(function(B){return B.width!==0});return r?new e(r.left+A.windowBounds.left,r.top+A.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e})(),je=function(e,A){return cA.fromClientRect(e,A.getBoundingClientRect())},sn=function(e){var A=e.body,t=e.documentElement;if(!A||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(A.scrollWidth,t.scrollWidth),Math.max(A.offsetWidth,t.offsetWidth),Math.max(A.clientWidth,t.clientWidth)),B=Math.max(Math.max(A.scrollHeight,t.scrollHeight),Math.max(A.offsetHeight,t.offsetHeight),Math.max(A.clientHeight,t.clientHeight));return new cA(0,0,r,B)},ze=function(e){for(var A=[],t=0,r=e.length;t<r;){var B=e.charCodeAt(t++);if(B>=55296&&B<=56319&&t<r){var n=e.charCodeAt(t++);(n&64512)===56320?A.push(((B&1023)<<10)+(n&1023)+65536):(A.push(B),t--)}else A.push(B)}return A},S=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return"";for(var r=[],B=-1,n="";++B<t;){var s=e[B];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",an=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var ue=0;ue<Bt.length;ue++)an[Bt.charCodeAt(ue)]=ue;var nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zA=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var le=0;le<nt.length;le++)zA[nt.charCodeAt(le)]=le;var on=function(e){var A=e.length*.75,t=e.length,r,B=0,n,s,i,a;e[e.length-1]==="="&&(A--,e[e.length-2]==="="&&A--);var o=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&typeof Uint8Array.prototype.slice!="undefined"?new ArrayBuffer(A):new Array(A),Q=Array.isArray(o)?o:new Uint8Array(o);for(r=0;r<t;r+=4)n=zA[e.charCodeAt(r)],s=zA[e.charCodeAt(r+1)],i=zA[e.charCodeAt(r+2)],a=zA[e.charCodeAt(r+3)],Q[B++]=n<<2|s>>4,Q[B++]=(s&15)<<4|i>>2,Q[B++]=(i&3)<<6|a&63;return o},Qn=function(e){for(var A=e.length,t=[],r=0;r<A;r+=2)t.push(e[r+1]<<8|e[r]);return t},gn=function(e){for(var A=e.length,t=[],r=0;r<A;r+=4)t.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return t},bA=5,jr=11,ar=2,wn=jr-bA,tB=65536>>bA,cn=1<<bA,ir=cn-1,Cn=1024>>bA,un=tB+Cn,ln=un,fn=32,Un=ln+fn,Fn=65536>>jr,hn=1<<wn,dn=hn-1,st=function(e,A,t){return e.slice?e.slice(A,t):new Uint16Array(Array.prototype.slice.call(e,A,t))},En=function(e,A,t){return e.slice?e.slice(A,t):new Uint32Array(Array.prototype.slice.call(e,A,t))},Hn=function(e,A){var t=on(e),r=Array.isArray(t)?gn(t):new Uint32Array(t),B=Array.isArray(t)?Qn(t):new Uint16Array(t),n=24,s=st(B,n/2,r[4]/2),i=r[5]===2?st(B,(n+r[4])/2):En(r,Math.ceil((n+r[4])/4));return new pn(r[0],r[1],r[2],r[3],s,i)},pn=(function(){function e(A,t,r,B,n,s){this.initialValue=A,this.errorValue=t,this.highStart=r,this.highValueIndex=B,this.index=n,this.data=s}return e.prototype.get=function(A){var t;if(A>=0){if(A<55296||A>56319&&A<=65535)return t=this.index[A>>bA],t=(t<<ar)+(A&ir),this.data[t];if(A<=65535)return t=this.index[tB+(A-55296>>bA)],t=(t<<ar)+(A&ir),this.data[t];if(A<this.highStart)return t=Un-Fn+(A>>jr),t=this.index[t],t+=A>>bA&dn,t=this.index[t],t=(t<<ar)+(A&ir),this.data[t];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",In=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var fe=0;fe<at.length;fe++)In[at.charCodeAt(fe)]=fe;var vn=" ",it=50,yn=1,BB=2,nB=3,Kn=4,mn=5,ot=7,sB=8,Qt=9,FA=10,Lr=11,gt=12,Dr=13,Ln=14,$A=15,br=16,Ue=17,WA=18,Dn=19,wt=20,xr=21,ZA=22,or=23,SA=24,j=25,Ae=26,ee=27,OA=28,bn=29,LA=30,xn=31,Fe=32,he=33,Tr=34,Sr=35,Or=36,Qe=37,Mr=38,Me=39,Ge=40,Qr=41,aB=42,Tn=43,Sn=[9001,65288],iB="!",I="×",de="÷",Gr=Hn(vn),QA=[LA,Or],Rr=[yn,BB,nB,mn],oB=[FA,sB],ct=[ee,Ae],On=Rr.concat(oB),Ct=[Mr,Me,Ge,Tr,Sr],Mn=[$A,Dr],Gn=function(e,A){A===void 0&&(A="strict");var t=[],r=[],B=[];return e.forEach(function(n,s){var i=Gr.get(n);if(i>it?(B.push(!0),i-=it):B.push(!1),["normal","auto","loose"].indexOf(A)!==-1&&[8208,8211,12316,12448].indexOf(n)!==-1)return r.push(s),t.push(br);if(i===Kn||i===Lr){if(s===0)return r.push(s),t.push(LA);var a=t[s-1];return On.indexOf(a)===-1?(r.push(r[s-1]),t.push(a)):(r.push(s),t.push(LA))}if(r.push(s),i===xn)return t.push(A==="strict"?xr:Qe);if(i===aB||i===bn)return t.push(LA);if(i===Tn)return n>=131072&&n<=196605||n>=196608&&n<=262141?t.push(Qe):t.push(LA);t.push(i)}),[r,t,B]},gr=function(e,A,t,r){var B=r[t];if(Array.isArray(e)?e.indexOf(B)!==-1:e===B)for(var n=t;n<=r.length;){n++;var s=r[n];if(s===A)return!0;if(s!==FA)break}if(B===FA)for(var n=t;n>0;){n--;var i=r[n];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var a=t;a<=r.length;){a++;var s=r[a];if(s===A)return!0;if(s!==FA)break}if(i!==FA)break}return!1},ut=function(e,A){for(var t=e;t>=0;){var r=A[t];if(r===FA)t--;else return r}return 0},Rn=function(e,A,t,r,B){if(t[r]===0)return I;var n=r-1;if(Array.isArray(B)&&B[n]===!0)return I;var s=n-1,i=n+1,a=A[n],o=s>=0?A[s]:0,Q=A[i];if(a===BB&&Q===nB)return I;if(Rr.indexOf(a)!==-1)return iB;if(Rr.indexOf(Q)!==-1||oB.indexOf(Q)!==-1)return I;if(ut(n,A)===sB)return de;if(Gr.get(e[n])===Lr||(a===Fe||a===he)&&Gr.get(e[i])===Lr||a===ot||Q===ot||a===Qt||[FA,Dr,$A].indexOf(a)===-1&&Q===Qt||[Ue,WA,Dn,SA,OA].indexOf(Q)!==-1||ut(n,A)===ZA||gr(or,ZA,n,A)||gr([Ue,WA],xr,n,A)||gr(gt,gt,n,A))return I;if(a===FA)return de;if(a===or||Q===or)return I;if(Q===br||a===br)return de;if([Dr,$A,xr].indexOf(Q)!==-1||a===Ln||o===Or&&Mn.indexOf(a)!==-1||a===OA&&Q===Or||Q===wt||QA.indexOf(Q)!==-1&&a===j||QA.indexOf(a)!==-1&&Q===j||a===ee&&[Qe,Fe,he].indexOf(Q)!==-1||[Qe,Fe,he].indexOf(a)!==-1&&Q===Ae||QA.indexOf(a)!==-1&&ct.indexOf(Q)!==-1||ct.indexOf(a)!==-1&&QA.indexOf(Q)!==-1||[ee,Ae].indexOf(a)!==-1&&(Q===j||[ZA,$A].indexOf(Q)!==-1&&A[i+1]===j)||[ZA,$A].indexOf(a)!==-1&&Q===j||a===j&&[j,OA,SA].indexOf(Q)!==-1)return I;if([j,OA,SA,Ue,WA].indexOf(Q)!==-1)for(var g=n;g>=0;){var w=A[g];if(w===j)return I;if([OA,SA].indexOf(w)!==-1)g--;else break}if([ee,Ae].indexOf(Q)!==-1)for(var g=[Ue,WA].indexOf(a)!==-1?s:n;g>=0;){var w=A[g];if(w===j)return I;if([OA,SA].indexOf(w)!==-1)g--;else break}if(Mr===a&&[Mr,Me,Tr,Sr].indexOf(Q)!==-1||[Me,Tr].indexOf(a)!==-1&&[Me,Ge].indexOf(Q)!==-1||[Ge,Sr].indexOf(a)!==-1&&Q===Ge||Ct.indexOf(a)!==-1&&[wt,Ae].indexOf(Q)!==-1||Ct.indexOf(Q)!==-1&&a===ee||QA.indexOf(a)!==-1&&QA.indexOf(Q)!==-1||a===SA&&QA.indexOf(Q)!==-1||QA.concat(j).indexOf(a)!==-1&&Q===ZA&&Sn.indexOf(e[i])===-1||QA.concat(j).indexOf(Q)!==-1&&a===WA)return I;if(a===Qr&&Q===Qr){for(var f=t[n],c=1;f>0&&(f--,A[f]===Qr);)c++;if(c%2!==0)return I}return a===Fe&&Q===he?I:de},Vn=function(e,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var t=Gn(e,A.lineBreak),r=t[0],B=t[1],n=t[2];(A.wordBreak==="break-all"||A.wordBreak==="break-word")&&(B=B.map(function(i){return[j,LA,aB].indexOf(i)!==-1?Qe:i}));var s=A.wordBreak==="keep-all"?n.map(function(i,a){return i&&e[a]>=19968&&e[a]<=40959}):void 0;return[r,B,s]},Nn=(function(){function e(A,t,r,B){this.codePoints=A,this.required=t===iB,this.start=r,this.end=B}return e.prototype.slice=function(){return S.apply(void 0,this.codePoints.slice(this.start,this.end))},e})(),Xn=function(e,A){var t=ze(e),r=Vn(t,A),B=r[0],n=r[1],s=r[2],i=t.length,a=0,o=0;return{next:function(){if(o>=i)return{done:!0,value:null};for(var Q=I;o<i&&(Q=Rn(t,n,B,++o,s))===I;);if(Q!==I||o===i){var g=new Nn(t,Q,a,o);return a=o,{value:g,done:!1}}return{done:!0,value:null}}}},_n=1,Jn=2,ce=4,lt=8,Ne=10,ft=47,ne=92,Pn=9,kn=32,Ee=34,qA=61,Yn=35,Wn=36,Zn=37,He=39,pe=40,jA=41,qn=95,Z=45,jn=33,zn=60,$n=62,As=64,es=91,rs=93,ts=61,Bs=123,Ie=63,ns=125,Ut=124,ss=126,as=128,Ft=65533,wr=42,DA=43,is=44,os=58,Qs=59,ge=46,gs=0,ws=8,cs=11,Cs=14,us=31,ls=127,nA=-1,QB=48,gB=97,wB=101,fs=102,Us=117,Fs=122,cB=65,CB=69,uB=70,hs=85,ds=90,J=function(e){return e>=QB&&e<=57},Es=function(e){return e>=55296&&e<=57343},MA=function(e){return J(e)||e>=cB&&e<=uB||e>=gB&&e<=fs},Hs=function(e){return e>=gB&&e<=Fs},ps=function(e){return e>=cB&&e<=ds},Is=function(e){return Hs(e)||ps(e)},vs=function(e){return e>=as},ve=function(e){return e===Ne||e===Pn||e===kn},Xe=function(e){return Is(e)||vs(e)||e===qn},ht=function(e){return Xe(e)||J(e)||e===Z},ys=function(e){return e>=gs&&e<=ws||e===cs||e>=Cs&&e<=us||e===ls},UA=function(e,A){return e!==ne?!1:A!==Ne},ye=function(e,A,t){return e===Z?Xe(A)||UA(A,t):Xe(e)?!0:!!(e===ne&&UA(e,A))},cr=function(e,A,t){return e===DA||e===Z?J(A)?!0:A===ge&&J(t):J(e===ge?A:e)},Ks=function(e){var A=0,t=1;(e[A]===DA||e[A]===Z)&&(e[A]===Z&&(t=-1),A++);for(var r=[];J(e[A]);)r.push(e[A++]);var B=r.length?parseInt(S.apply(void 0,r),10):0;e[A]===ge&&A++;for(var n=[];J(e[A]);)n.push(e[A++]);var s=n.length,i=s?parseInt(S.apply(void 0,n),10):0;(e[A]===CB||e[A]===wB)&&A++;var a=1;(e[A]===DA||e[A]===Z)&&(e[A]===Z&&(a=-1),A++);for(var o=[];J(e[A]);)o.push(e[A++]);var Q=o.length?parseInt(S.apply(void 0,o),10):0;return t*(B+i*Math.pow(10,-s))*Math.pow(10,a*Q)},ms={type:2},Ls={type:3},Ds={type:4},bs={type:13},xs={type:8},Ts={type:21},Ss={type:9},Os={type:10},Ms={type:11},Gs={type:12},Rs={type:14},Ke={type:23},Vs={type:1},Ns={type:25},Xs={type:24},_s={type:26},Js={type:27},Ps={type:28},ks={type:29},Ys={type:31},Vr={type:32},lB=(function(){function e(){this._value=[]}return e.prototype.write=function(A){this._value=this._value.concat(ze(A))},e.prototype.read=function(){for(var A=[],t=this.consumeToken();t!==Vr;)A.push(t),t=this.consumeToken();return A},e.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case Ee:return this.consumeStringToken(Ee);case Yn:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),B=this.peekCodePoint(2);if(ht(t)||UA(r,B)){var n=ye(t,r,B)?Jn:_n,s=this.consumeName();return{type:5,value:s,flags:n}}break;case Wn:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),bs;break;case He:return this.consumeStringToken(He);case pe:return ms;case jA:return Ls;case wr:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Rs;break;case DA:if(cr(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case is:return Ds;case Z:var i=A,a=this.peekCodePoint(0),o=this.peekCodePoint(1);if(cr(i,a,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(ye(i,a,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(a===Z&&o===$n)return this.consumeCodePoint(),this.consumeCodePoint(),Xs;break;case ge:if(cr(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case ft:if(this.peekCodePoint(0)===wr)for(this.consumeCodePoint();;){var Q=this.consumeCodePoint();if(Q===wr&&(Q=this.consumeCodePoint(),Q===ft))return this.consumeToken();if(Q===nA)return this.consumeToken()}break;case os:return _s;case Qs:return Js;case zn:if(this.peekCodePoint(0)===jn&&this.peekCodePoint(1)===Z&&this.peekCodePoint(2)===Z)return this.consumeCodePoint(),this.consumeCodePoint(),Ns;break;case As:var g=this.peekCodePoint(0),w=this.peekCodePoint(1),f=this.peekCodePoint(2);if(ye(g,w,f)){var s=this.consumeName();return{type:7,value:s}}break;case es:return Ps;case ne:if(UA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case rs:return ks;case ts:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),xs;break;case Bs:return Ms;case ns:return Gs;case Us:case hs:var c=this.peekCodePoint(0),C=this.peekCodePoint(1);return c===DA&&(MA(C)||C===Ie)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case Ut:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Ss;if(this.peekCodePoint(0)===Ut)return this.consumeCodePoint(),Ts;break;case ss:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),Os;break;case nA:return Vr}return ve(A)?(this.consumeWhiteSpace(),Ys):J(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):Xe(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:S(A)}},e.prototype.consumeCodePoint=function(){var A=this._value.shift();return typeof A=="undefined"?-1:A},e.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},e.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},e.prototype.consumeUnicodeRangeToken=function(){for(var A=[],t=this.consumeCodePoint();MA(t)&&A.length<6;)A.push(t),t=this.consumeCodePoint();for(var r=!1;t===Ie&&A.length<6;)A.push(t),t=this.consumeCodePoint(),r=!0;if(r){var B=parseInt(S.apply(void 0,A.map(function(a){return a===Ie?QB:a})),16),n=parseInt(S.apply(void 0,A.map(function(a){return a===Ie?uB:a})),16);return{type:30,start:B,end:n}}var s=parseInt(S.apply(void 0,A),16);if(this.peekCodePoint(0)===Z&&MA(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var i=[];MA(t)&&i.length<6;)i.push(t),t=this.consumeCodePoint();var n=parseInt(S.apply(void 0,i),16);return{type:30,start:s,end:n}}else return{type:30,start:s,end:s}},e.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return A.toLowerCase()==="url"&&this.peekCodePoint(0)===pe?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===pe?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},e.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===nA)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===He||t===Ee){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===nA||this.peekCodePoint(0)===jA)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Ke)}for(;;){var B=this.consumeCodePoint();if(B===nA||B===jA)return{type:22,value:S.apply(void 0,A)};if(ve(B))return this.consumeWhiteSpace(),this.peekCodePoint(0)===nA||this.peekCodePoint(0)===jA?(this.consumeCodePoint(),{type:22,value:S.apply(void 0,A)}):(this.consumeBadUrlRemnants(),Ke);if(B===Ee||B===He||B===pe||ys(B))return this.consumeBadUrlRemnants(),Ke;if(B===ne)if(UA(B,this.peekCodePoint(0)))A.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Ke;else A.push(B)}},e.prototype.consumeWhiteSpace=function(){for(;ve(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(A===jA||A===nA)return;UA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(A){for(var t=5e4,r="";A>0;){var B=Math.min(t,A);r+=S.apply(void 0,this._value.splice(0,B)),A-=B}return this._value.shift(),r},e.prototype.consumeStringToken=function(A){var t="",r=0;do{var B=this._value[r];if(B===nA||B===void 0||B===A)return t+=this.consumeStringSlice(r),{type:0,value:t};if(B===Ne)return this._value.splice(0,r),Vs;if(B===ne){var n=this._value[r+1];n!==nA&&n!==void 0&&(n===Ne?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):UA(B,n)&&(t+=this.consumeStringSlice(r),t+=S(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},e.prototype.consumeNumber=function(){var A=[],t=ce,r=this.peekCodePoint(0);for((r===DA||r===Z)&&A.push(this.consumeCodePoint());J(this.peekCodePoint(0));)A.push(this.consumeCodePoint());r=this.peekCodePoint(0);var B=this.peekCodePoint(1);if(r===ge&&J(B))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),t=lt;J(this.peekCodePoint(0));)A.push(this.consumeCodePoint());r=this.peekCodePoint(0),B=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((r===CB||r===wB)&&((B===DA||B===Z)&&J(n)||J(B)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),t=lt;J(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[Ks(A),t]},e.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),t=A[0],r=A[1],B=this.peekCodePoint(0),n=this.peekCodePoint(1),s=this.peekCodePoint(2);if(ye(B,n,s)){var i=this.consumeName();return{type:15,number:t,flags:r,unit:i}}return B===Zn?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(MA(A)){for(var t=S(A);MA(this.peekCodePoint(0))&&t.length<6;)t+=S(this.consumeCodePoint());ve(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||Es(r)||r>1114111?Ft:r}return A===nA?Ft:A},e.prototype.consumeName=function(){for(var A="";;){var t=this.consumeCodePoint();if(ht(t))A+=S(t);else if(UA(t,this.peekCodePoint(0)))A+=S(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),A}},e})(),fB=(function(){function e(A){this._tokens=A}return e.create=function(A){var t=new lB;return t.write(A),new e(t.read())},e.parseValue=function(A){return e.create(A).parseComponentValue()},e.parseValues=function(A){return e.create(A).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===31;)A=this.consumeToken();if(A.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var t=this.consumeComponentValue();do A=this.consumeToken();while(A.type===31);if(A.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var A=[];;){var t=this.consumeComponentValue();if(t.type===32)return A;A.push(t),A.push()}},e.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},e.prototype.consumeSimpleBlock=function(A){for(var t={type:A,values:[]},r=this.consumeToken();;){if(r.type===32||Zs(r,A))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},e.prototype.consumeFunction=function(A){for(var t={name:A.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var A=this._tokens.shift();return typeof A=="undefined"?Vr:A},e.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},e})(),Ce=function(e){return e.type===15},kA=function(e){return e.type===17},D=function(e){return e.type===20},Ws=function(e){return e.type===0},Nr=function(e,A){return D(e)&&e.value===A},UB=function(e){return e.type!==31},PA=function(e){return e.type!==31&&e.type!==4},sA=function(e){var A=[],t=[];return e.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");A.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&A.push(t),A},Zs=function(e,A){return A===11&&e.type===12||A===28&&e.type===29?!0:A===2&&e.type===3},pA=function(e){return e.type===17||e.type===15},M=function(e){return e.type===16||pA(e)},FB=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},X={type:17,number:0,flags:ce},zr={type:16,number:50,flags:ce},hA={type:16,number:100,flags:ce},re=function(e,A,t){var r=e[0],B=e[1];return[b(r,A),b(typeof B!="undefined"?B:r,t)]},b=function(e,A){if(e.type===16)return e.number/100*A;if(Ce(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},hB="deg",dB="grad",EB="rad",HB="turn",$e={name:"angle",parse:function(e,A){if(A.type===15)switch(A.unit){case hB:return Math.PI*A.number/180;case dB:return Math.PI/200*A.number;case EB:return A.number;case HB:return Math.PI*2*A.number}throw new Error("Unsupported angle type")}},pB=function(e){return e.type===15&&(e.unit===hB||e.unit===dB||e.unit===EB||e.unit===HB)},IB=function(e){var A=e.filter(D).map(function(t){return t.value}).join(" ");switch(A){case"to bottom right":case"to right bottom":case"left top":case"top left":return[X,X];case"to top":case"bottom":return AA(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[X,hA];case"to right":case"left":return AA(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[hA,hA];case"to bottom":case"top":return AA(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[hA,X];case"to left":case"right":return AA(270)}return 0},AA=function(e){return Math.PI*e/180},EA={name:"color",parse:function(e,A){if(A.type===18){var t=qs[A.name];if(typeof t=="undefined")throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return t(e,A.values)}if(A.type===5){if(A.value.length===3){var r=A.value.substring(0,1),B=A.value.substring(1,2),n=A.value.substring(2,3);return dA(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),1)}if(A.value.length===4){var r=A.value.substring(0,1),B=A.value.substring(1,2),n=A.value.substring(2,3),s=A.value.substring(3,4);return dA(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(A.value.length===6){var r=A.value.substring(0,2),B=A.value.substring(2,4),n=A.value.substring(4,6);return dA(parseInt(r,16),parseInt(B,16),parseInt(n,16),1)}if(A.value.length===8){var r=A.value.substring(0,2),B=A.value.substring(2,4),n=A.value.substring(4,6),s=A.value.substring(6,8);return dA(parseInt(r,16),parseInt(B,16),parseInt(n,16),parseInt(s,16)/255)}}if(A.type===20){var i=wA[A.value.toUpperCase()];if(typeof i!="undefined")return i}return wA.TRANSPARENT}},HA=function(e){return(255&e)===0},R=function(e){var A=255&e,t=255&e>>8,r=255&e>>16,B=255&e>>24;return A<255?"rgba("+B+","+r+","+t+","+A/255+")":"rgb("+B+","+r+","+t+")"},dA=function(e,A,t,r){return(e<<24|A<<16|t<<8|Math.round(r*255)<<0)>>>0},dt=function(e,A){if(e.type===17)return e.number;if(e.type===16){var t=A===3?1:255;return A===3?e.number/100*t:Math.round(e.number/100*t)}return 0},Et=function(e,A){var t=A.filter(PA);if(t.length===3){var r=t.map(dt),B=r[0],n=r[1],s=r[2];return dA(B,n,s,1)}if(t.length===4){var i=t.map(dt),B=i[0],n=i[1],s=i[2],a=i[3];return dA(B,n,s,a)}return 0};function Cr(e,A,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(A-e)*t*6+e:t<1/2?A:t<2/3?(A-e)*6*(2/3-t)+e:e}var Ht=function(e,A){var t=A.filter(PA),r=t[0],B=t[1],n=t[2],s=t[3],i=(r.type===17?AA(r.number):$e.parse(e,r))/(Math.PI*2),a=M(B)?B.number/100:0,o=M(n)?n.number/100:0,Q=typeof s!="undefined"&&M(s)?b(s,1):1;if(a===0)return dA(o*255,o*255,o*255,1);var g=o<=.5?o*(a+1):o+a-o*a,w=o*2-g,f=Cr(w,g,i+1/3),c=Cr(w,g,i),C=Cr(w,g,i-1/3);return dA(f*255,c*255,C*255,Q)},qs={hsl:Ht,hsla:Ht,rgb:Et,rgba:Et},se=function(e,A){return EA.parse(e,fB.create(A).parseComponentValue())},wA={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},js={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(t){if(D(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},zs={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ar=function(e,A){var t=EA.parse(e,A[0]),r=A[1];return r&&M(r)?{color:t,stop:r}:{color:t,stop:null}},pt=function(e,A){var t=e[0],r=e[e.length-1];t.stop===null&&(t.stop=X),r.stop===null&&(r.stop=hA);for(var B=[],n=0,s=0;s<e.length;s++){var i=e[s].stop;if(i!==null){var a=b(i,A);a>n?B.push(a):B.push(n),n=a}else B.push(null)}for(var o=null,s=0;s<B.length;s++){var Q=B[s];if(Q===null)o===null&&(o=s);else if(o!==null){for(var g=s-o,w=B[o-1],f=(Q-w)/(g+1),c=1;c<=g;c++)B[o+c-1]=f*c;o=null}}return e.map(function(C,H){var h=C.color;return{color:h,stop:Math.max(Math.min(1,B[H]/A),0)}})},$s=function(e,A,t){var r=A/2,B=t/2,n=b(e[0],A)-r,s=B-b(e[1],t);return(Math.atan2(s,n)+Math.PI*2)%(Math.PI*2)},Aa=function(e,A,t){var r=typeof e=="number"?e:$s(e,A,t),B=Math.abs(A*Math.sin(r))+Math.abs(t*Math.cos(r)),n=A/2,s=t/2,i=B/2,a=Math.sin(r-Math.PI/2)*i,o=Math.cos(r-Math.PI/2)*i;return[B,n-o,n+o,s-a,s+a]},rA=function(e,A){return Math.sqrt(e*e+A*A)},It=function(e,A,t,r,B){var n=[[0,0],[0,A],[e,0],[e,A]];return n.reduce(function(s,i){var a=i[0],o=i[1],Q=rA(t-a,r-o);return(B?Q<s.optimumDistance:Q>s.optimumDistance)?{optimumCorner:i,optimumDistance:Q}:s},{optimumDistance:B?1/0:-1/0,optimumCorner:null}).optimumCorner},ea=function(e,A,t,r,B){var n=0,s=0;switch(e.size){case 0:e.shape===0?n=s=Math.min(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-B)):e.shape===1&&(n=Math.min(Math.abs(A),Math.abs(A-r)),s=Math.min(Math.abs(t),Math.abs(t-B)));break;case 2:if(e.shape===0)n=s=Math.min(rA(A,t),rA(A,t-B),rA(A-r,t),rA(A-r,t-B));else if(e.shape===1){var i=Math.min(Math.abs(t),Math.abs(t-B))/Math.min(Math.abs(A),Math.abs(A-r)),a=It(r,B,A,t,!0),o=a[0],Q=a[1];n=rA(o-A,(Q-t)/i),s=i*n}break;case 1:e.shape===0?n=s=Math.max(Math.abs(A),Math.abs(A-r),Math.abs(t),Math.abs(t-B)):e.shape===1&&(n=Math.max(Math.abs(A),Math.abs(A-r)),s=Math.max(Math.abs(t),Math.abs(t-B)));break;case 3:if(e.shape===0)n=s=Math.max(rA(A,t),rA(A,t-B),rA(A-r,t),rA(A-r,t-B));else if(e.shape===1){var i=Math.max(Math.abs(t),Math.abs(t-B))/Math.max(Math.abs(A),Math.abs(A-r)),g=It(r,B,A,t,!1),o=g[0],Q=g[1];n=rA(o-A,(Q-t)/i),s=i*n}break}return Array.isArray(e.size)&&(n=b(e.size[0],r),s=e.size.length===2?b(e.size[1],B):n),[n,s]},ra=function(e,A){var t=AA(180),r=[];return sA(A).forEach(function(B,n){if(n===0){var s=B[0];if(s.type===20&&s.value==="to"){t=IB(B);return}else if(pB(s)){t=$e.parse(e,s);return}}var i=Ar(e,B);r.push(i)}),{angle:t,stops:r,type:1}},me=function(e,A){var t=AA(180),r=[];return sA(A).forEach(function(B,n){if(n===0){var s=B[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=IB(B);return}else if(pB(s)){t=($e.parse(e,s)+AA(270))%AA(360);return}}var i=Ar(e,B);r.push(i)}),{angle:t,stops:r,type:1}},ta=function(e,A){var t=AA(180),r=[],B=1,n=0,s=3,i=[];return sA(A).forEach(function(a,o){var Q=a[0];if(o===0){if(D(Q)&&Q.value==="linear"){B=1;return}else if(D(Q)&&Q.value==="radial"){B=2;return}}if(Q.type===18){if(Q.name==="from"){var g=EA.parse(e,Q.values[0]);r.push({stop:X,color:g})}else if(Q.name==="to"){var g=EA.parse(e,Q.values[0]);r.push({stop:hA,color:g})}else if(Q.name==="color-stop"){var w=Q.values.filter(PA);if(w.length===2){var g=EA.parse(e,w[1]),f=w[0];kA(f)&&r.push({stop:{type:16,number:f.number*100,flags:f.flags},color:g})}}}}),B===1?{angle:(t+AA(180))%AA(360),stops:r,type:B}:{size:s,shape:n,stops:r,position:i,type:B}},vB="closest-side",yB="farthest-side",KB="closest-corner",mB="farthest-corner",LB="circle",DB="ellipse",bB="cover",xB="contain",Ba=function(e,A){var t=0,r=3,B=[],n=[];return sA(A).forEach(function(s,i){var a=!0;if(i===0){var o=!1;a=s.reduce(function(g,w){if(o)if(D(w))switch(w.value){case"center":return n.push(zr),g;case"top":case"left":return n.push(X),g;case"right":case"bottom":return n.push(hA),g}else(M(w)||pA(w))&&n.push(w);else if(D(w))switch(w.value){case LB:return t=0,!1;case DB:return t=1,!1;case"at":return o=!0,!1;case vB:return r=0,!1;case bB:case yB:return r=1,!1;case xB:case KB:return r=2,!1;case mB:return r=3,!1}else if(pA(w)||M(w))return Array.isArray(r)||(r=[]),r.push(w),!1;return g},a)}if(a){var Q=Ar(e,s);B.push(Q)}}),{size:r,shape:t,stops:B,position:n,type:2}},Le=function(e,A){var t=0,r=3,B=[],n=[];return sA(A).forEach(function(s,i){var a=!0;if(i===0?a=s.reduce(function(Q,g){if(D(g))switch(g.value){case"center":return n.push(zr),!1;case"top":case"left":return n.push(X),!1;case"right":case"bottom":return n.push(hA),!1}else if(M(g)||pA(g))return n.push(g),!1;return Q},a):i===1&&(a=s.reduce(function(Q,g){if(D(g))switch(g.value){case LB:return t=0,!1;case DB:return t=1,!1;case xB:case vB:return r=0,!1;case yB:return r=1,!1;case KB:return r=2,!1;case bB:case mB:return r=3,!1}else if(pA(g)||M(g))return Array.isArray(r)||(r=[]),r.push(g),!1;return Q},a)),a){var o=Ar(e,s);B.push(o)}}),{size:r,shape:t,stops:B,position:n,type:2}},na=function(e){return e.type===1},sa=function(e){return e.type===2},$r={name:"image",parse:function(e,A){if(A.type===22){var t={url:A.value,type:0};return e.cache.addImage(A.value),t}if(A.type===18){var r=TB[A.name];if(typeof r=="undefined")throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return r(e,A.values)}throw new Error("Unsupported image type "+A.type)}};function aa(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!TB[e.name])}var TB={"linear-gradient":ra,"-moz-linear-gradient":me,"-ms-linear-gradient":me,"-o-linear-gradient":me,"-webkit-linear-gradient":me,"radial-gradient":Ba,"-moz-radial-gradient":Le,"-ms-radial-gradient":Le,"-o-radial-gradient":Le,"-webkit-radial-gradient":Le,"-webkit-gradient":ta},ia={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(A.length===0)return[];var t=A[0];return t.type===20&&t.value==="none"?[]:A.filter(function(r){return PA(r)&&aa(r)}).map(function(r){return $r.parse(e,r)})}},oa={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,A){return A.map(function(t){if(D(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Qa={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,A){return sA(A).map(function(t){return t.filter(M)}).map(FB)}},ga={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,A){return sA(A).map(function(t){return t.filter(D).map(function(r){return r.value}).join(" ")}).map(wa)}},wa=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},JA;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(JA||(JA={}));var ca={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,A){return sA(A).map(function(t){return t.filter(Ca)})}},Ca=function(e){return D(e)||M(e)},er=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ua=er("top"),la=er("right"),fa=er("bottom"),Ua=er("left"),rr=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(A,t){return FB(t.filter(M))}}},Fa=rr("top-left"),ha=rr("top-right"),da=rr("bottom-right"),Ea=rr("bottom-left"),tr=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},Ha=tr("top"),pa=tr("right"),Ia=tr("bottom"),va=tr("left"),Br=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,t){return Ce(t)?t.number:0}}},ya=Br("top"),Ka=Br("right"),ma=Br("bottom"),La=Br("left"),Da={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ba={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,A){switch(A){case"rtl":return 1;case"ltr":default:return 0}}},xa={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,A){return A.filter(D).reduce(function(t,r){return t|Ta(r.value)},0)}},Ta=function(e){switch(e){case"block":case"-webkit-box":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},Sa={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Oa={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,A){return A.type===20&&A.value==="normal"?0:A.type===17||A.type===15?A.number:0}},_e;(function(e){e.NORMAL="normal",e.STRICT="strict"})(_e||(_e={}));var Ma={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"strict":return _e.STRICT;case"normal":default:return _e.NORMAL}}},Ga={name:"line-height",initialValue:"normal",prefix:!1,type:4},vt=function(e,A){return D(e)&&e.value==="normal"?1.2*A:e.type===17?A*e.number:M(e)?b(e,A):A},Ra={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,A){return A.type===20&&A.value==="none"?null:$r.parse(e,A)}},Va={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,A){switch(A){case"inside":return 0;case"outside":default:return 1}}},Xr={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},nr=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Na=nr("top"),Xa=nr("right"),_a=nr("bottom"),Ja=nr("left"),Pa={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,A){return A.filter(D).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},ka={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"break-word":return"break-word";case"normal":default:return"normal"}}},sr=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Ya=sr("top"),Wa=sr("right"),Za=sr("bottom"),qa=sr("left"),ja={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,A){switch(A){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},za={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},$a={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.length===1&&Nr(A[0],"none")?[]:sA(A).map(function(t){for(var r={color:wA.TRANSPARENT,offsetX:X,offsetY:X,blur:X},B=0,n=0;n<t.length;n++){var s=t[n];pA(s)?(B===0?r.offsetX=s:B===1?r.offsetY=s:r.blur=s,B++):r.color=EA.parse(e,s)}return r})}},Ai={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},ei={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,A){if(A.type===20&&A.value==="none")return null;if(A.type===18){var t=Bi[A.name];if(typeof t=="undefined")throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return t(A.values)}return null}},ri=function(e){var A=e.filter(function(t){return t.type===17}).map(function(t){return t.number});return A.length===6?A:null},ti=function(e){var A=e.filter(function(a){return a.type===17}).map(function(a){return a.number}),t=A[0],r=A[1];A[2],A[3];var B=A[4],n=A[5];A[6],A[7],A[8],A[9],A[10],A[11];var s=A[12],i=A[13];return A[14],A[15],A.length===16?[t,r,B,n,s,i]:null},Bi={matrix:ri,matrix3d:ti},yt={type:16,number:50,flags:ce},ni=[yt,yt],si={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,A){var t=A.filter(M);return t.length!==2?ni:[t[0],t[1]]}},ai={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,A){switch(A){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},ae;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(ae||(ae={}));var ii={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"break-all":return ae.BREAK_ALL;case"keep-all":return ae.KEEP_ALL;case"normal":default:return ae.NORMAL}}},oi={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,A){if(A.type===20)return{auto:!0,order:0};if(kA(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},SB={name:"time",parse:function(e,A){if(A.type===15)switch(A.unit.toLowerCase()){case"s":return 1e3*A.number;case"ms":return A.number}throw new Error("Unsupported time type")}},Qi={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,A){return kA(A)?A.number:1}},gi={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wi={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,A){return A.filter(D).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},ci={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,A){var t=[],r=[];return A.forEach(function(B){switch(B.type){case 20:case 0:t.push(B.value);break;case 17:t.push(B.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(B){return B.indexOf(" ")===-1?B:"'"+B+"'"})}},Ci={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},ui={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,A){if(kA(A))return A.number;if(D(A))switch(A.value){case"bold":return 700;case"normal":default:return 400}return 400}},li={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.filter(D).map(function(t){return t.value})}},fi={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,A){switch(A){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},G=function(e,A){return(e&A)!==0},Ui={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,A){if(A.length===0)return[];var t=A[0];return t.type===20&&t.value==="none"?[]:A}},Fi={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(A.length===0)return null;var t=A[0];if(t.type===20&&t.value==="none")return null;for(var r=[],B=A.filter(UB),n=0;n<B.length;n++){var s=B[n],i=B[n+1];if(s.type===20){var a=i&&kA(i)?i.number:1;r.push({counter:s.value,increment:a})}}return r}},hi={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(A.length===0)return[];for(var t=[],r=A.filter(UB),B=0;B<r.length;B++){var n=r[B],s=r[B+1];if(D(n)&&n.value!=="none"){var i=s&&kA(s)?s.number:0;t.push({counter:n.value,reset:i})}}return t}},di={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,A){return A.filter(Ce).map(function(t){return SB.parse(e,t)})}},Ei={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,A){if(A.length===0)return null;var t=A[0];if(t.type===20&&t.value==="none")return null;var r=[],B=A.filter(Ws);if(B.length%2!==0)return null;for(var n=0;n<B.length;n+=2){var s=B[n].value,i=B[n+1].value;r.push({open:s,close:i})}return r}},Kt=function(e,A,t){if(!e)return"";var r=e[Math.min(A,e.length-1)];return r?t?r.open:r.close:""},Hi={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,A){return A.length===1&&Nr(A[0],"none")?[]:sA(A).map(function(t){for(var r={color:255,offsetX:X,offsetY:X,blur:X,spread:X,inset:!1},B=0,n=0;n<t.length;n++){var s=t[n];Nr(s,"inset")?r.inset=!0:pA(s)?(B===0?r.offsetX=s:B===1?r.offsetY=s:B===2?r.blur=s:r.spread=s,B++):r.color=EA.parse(e,s)}return r})}},pi={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,A){var t=[0,1,2],r=[];return A.filter(D).forEach(function(B){switch(B.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(function(B){r.indexOf(B)===-1&&r.push(B)}),r}},Ii={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},vi={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,A){return Ce(A)?A.number:0}},yi=(function(){function e(A,t){var r,B;this.animationDuration=U(A,di,t.animationDuration),this.backgroundClip=U(A,js,t.backgroundClip),this.backgroundColor=U(A,zs,t.backgroundColor),this.backgroundImage=U(A,ia,t.backgroundImage),this.backgroundOrigin=U(A,oa,t.backgroundOrigin),this.backgroundPosition=U(A,Qa,t.backgroundPosition),this.backgroundRepeat=U(A,ga,t.backgroundRepeat),this.backgroundSize=U(A,ca,t.backgroundSize),this.borderTopColor=U(A,ua,t.borderTopColor),this.borderRightColor=U(A,la,t.borderRightColor),this.borderBottomColor=U(A,fa,t.borderBottomColor),this.borderLeftColor=U(A,Ua,t.borderLeftColor),this.borderTopLeftRadius=U(A,Fa,t.borderTopLeftRadius),this.borderTopRightRadius=U(A,ha,t.borderTopRightRadius),this.borderBottomRightRadius=U(A,da,t.borderBottomRightRadius),this.borderBottomLeftRadius=U(A,Ea,t.borderBottomLeftRadius),this.borderTopStyle=U(A,Ha,t.borderTopStyle),this.borderRightStyle=U(A,pa,t.borderRightStyle),this.borderBottomStyle=U(A,Ia,t.borderBottomStyle),this.borderLeftStyle=U(A,va,t.borderLeftStyle),this.borderTopWidth=U(A,ya,t.borderTopWidth),this.borderRightWidth=U(A,Ka,t.borderRightWidth),this.borderBottomWidth=U(A,ma,t.borderBottomWidth),this.borderLeftWidth=U(A,La,t.borderLeftWidth),this.boxShadow=U(A,Hi,t.boxShadow),this.color=U(A,Da,t.color),this.direction=U(A,ba,t.direction),this.display=U(A,xa,t.display),this.float=U(A,Sa,t.cssFloat),this.fontFamily=U(A,ci,t.fontFamily),this.fontSize=U(A,Ci,t.fontSize),this.fontStyle=U(A,fi,t.fontStyle),this.fontVariant=U(A,li,t.fontVariant),this.fontWeight=U(A,ui,t.fontWeight),this.letterSpacing=U(A,Oa,t.letterSpacing),this.lineBreak=U(A,Ma,t.lineBreak),this.lineHeight=U(A,Ga,t.lineHeight),this.listStyleImage=U(A,Ra,t.listStyleImage),this.listStylePosition=U(A,Va,t.listStylePosition),this.listStyleType=U(A,Xr,t.listStyleType),this.marginTop=U(A,Na,t.marginTop),this.marginRight=U(A,Xa,t.marginRight),this.marginBottom=U(A,_a,t.marginBottom),this.marginLeft=U(A,Ja,t.marginLeft),this.opacity=U(A,Qi,t.opacity);var n=U(A,Pa,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0],this.overflowWrap=U(A,ka,t.overflowWrap),this.paddingTop=U(A,Ya,t.paddingTop),this.paddingRight=U(A,Wa,t.paddingRight),this.paddingBottom=U(A,Za,t.paddingBottom),this.paddingLeft=U(A,qa,t.paddingLeft),this.paintOrder=U(A,pi,t.paintOrder),this.position=U(A,za,t.position),this.textAlign=U(A,ja,t.textAlign),this.textDecorationColor=U(A,gi,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=U(A,wi,(B=t.textDecorationLine)!==null&&B!==void 0?B:t.textDecoration),this.textShadow=U(A,$a,t.textShadow),this.textTransform=U(A,Ai,t.textTransform),this.transform=U(A,ei,t.transform),this.transformOrigin=U(A,si,t.transformOrigin),this.visibility=U(A,ai,t.visibility),this.webkitTextStrokeColor=U(A,Ii,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=U(A,vi,t.webkitTextStrokeWidth),this.wordBreak=U(A,ii,t.wordBreak),this.zIndex=U(A,oi,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return HA(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return G(this.display,4)||G(this.display,33554432)||G(this.display,268435456)||G(this.display,536870912)||G(this.display,67108864)||G(this.display,134217728)},e})(),Ki=(function(){function e(A,t){this.content=U(A,Ui,t.content),this.quotes=U(A,Ei,t.quotes)}return e})(),mt=(function(){function e(A,t){this.counterIncrement=U(A,Fi,t.counterIncrement),this.counterReset=U(A,hi,t.counterReset)}return e})(),U=function(e,A,t){var r=new lB,B=t!==null&&typeof t!="undefined"?t.toString():A.initialValue;r.write(B);var n=new fB(r.read());switch(A.type){case 2:var s=n.parseComponentValue();return A.parse(e,D(s)?s.value:A.initialValue);case 0:return A.parse(e,n.parseComponentValue());case 1:return A.parse(e,n.parseComponentValues());case 4:return n.parseComponentValue();case 3:switch(A.format){case"angle":return $e.parse(e,n.parseComponentValue());case"color":return EA.parse(e,n.parseComponentValue());case"image":return $r.parse(e,n.parseComponentValue());case"length":var i=n.parseComponentValue();return pA(i)?i:X;case"length-percentage":var a=n.parseComponentValue();return M(a)?a:X;case"time":return SB.parse(e,n.parseComponentValue())}break}},mi="data-html2canvas-debug",Li=function(e){var A=e.getAttribute(mi);switch(A){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},_r=function(e,A){var t=Li(e);return t===1||A===t},aA=(function(){function e(A,t){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,_r(t,3),this.styles=new yi(A,window.getComputedStyle(t,null)),kr(t)&&(this.styles.animationDuration.some(function(r){return r>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=je(this.context,t),_r(t,4)&&(this.flags|=16)}return e})(),Di=" ",Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",te=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var De=0;De<Lt.length;De++)te[Lt.charCodeAt(De)]=De;var bi=function(e){var A=e.length*.75,t=e.length,r,B=0,n,s,i,a;e[e.length-1]==="="&&(A--,e[e.length-2]==="="&&A--);var o=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&typeof Uint8Array.prototype.slice!="undefined"?new ArrayBuffer(A):new Array(A),Q=Array.isArray(o)?o:new Uint8Array(o);for(r=0;r<t;r+=4)n=te[e.charCodeAt(r)],s=te[e.charCodeAt(r+1)],i=te[e.charCodeAt(r+2)],a=te[e.charCodeAt(r+3)],Q[B++]=n<<2|s>>4,Q[B++]=(s&15)<<4|i>>2,Q[B++]=(i&3)<<6|a&63;return o},xi=function(e){for(var A=e.length,t=[],r=0;r<A;r+=2)t.push(e[r+1]<<8|e[r]);return t},Ti=function(e){for(var A=e.length,t=[],r=0;r<A;r+=4)t.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return t},xA=5,At=11,ur=2,Si=At-xA,OB=65536>>xA,Oi=1<<xA,lr=Oi-1,Mi=1024>>xA,Gi=OB+Mi,Ri=Gi,Vi=32,Ni=Ri+Vi,Xi=65536>>At,_i=1<<Si,Ji=_i-1,Dt=function(e,A,t){return e.slice?e.slice(A,t):new Uint16Array(Array.prototype.slice.call(e,A,t))},Pi=function(e,A,t){return e.slice?e.slice(A,t):new Uint32Array(Array.prototype.slice.call(e,A,t))},ki=function(e,A){var t=bi(e),r=Array.isArray(t)?Ti(t):new Uint32Array(t),B=Array.isArray(t)?xi(t):new Uint16Array(t),n=24,s=Dt(B,n/2,r[4]/2),i=r[5]===2?Dt(B,(n+r[4])/2):Pi(r,Math.ceil((n+r[4])/4));return new Yi(r[0],r[1],r[2],r[3],s,i)},Yi=(function(){function e(A,t,r,B,n,s){this.initialValue=A,this.errorValue=t,this.highStart=r,this.highValueIndex=B,this.index=n,this.data=s}return e.prototype.get=function(A){var t;if(A>=0){if(A<55296||A>56319&&A<=65535)return t=this.index[A>>xA],t=(t<<ur)+(A&lr),this.data[t];if(A<=65535)return t=this.index[OB+(A-55296>>xA)],t=(t<<ur)+(A&lr),this.data[t];if(A<this.highStart)return t=Ni-Xi+(A>>At),t=this.index[t],t+=A>>xA&Ji,t=this.index[t],t=(t<<ur)+(A&lr),this.data[t];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wi=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var be=0;be<bt.length;be++)Wi[bt.charCodeAt(be)]=be;var Zi=1,fr=2,Ur=3,xt=4,Tt=5,qi=7,St=8,Fr=9,hr=10,Ot=11,Mt=12,Gt=13,Rt=14,dr=15,ji=function(e){for(var A=[],t=0,r=e.length;t<r;){var B=e.charCodeAt(t++);if(B>=55296&&B<=56319&&t<r){var n=e.charCodeAt(t++);(n&64512)===56320?A.push(((B&1023)<<10)+(n&1023)+65536):(A.push(B),t--)}else A.push(B)}return A},zi=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return"";for(var r=[],B=-1,n="";++B<t;){var s=e[B];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},$i=ki(Di),z="×",Er="÷",Ao=function(e){return $i.get(e)},eo=function(e,A,t){var r=t-2,B=A[r],n=A[t-1],s=A[t];if(n===fr&&s===Ur)return z;if(n===fr||n===Ur||n===xt||s===fr||s===Ur||s===xt)return Er;if(n===St&&[St,Fr,Ot,Mt].indexOf(s)!==-1||(n===Ot||n===Fr)&&(s===Fr||s===hr)||(n===Mt||n===hr)&&s===hr||s===Gt||s===Tt||s===qi||n===Zi)return z;if(n===Gt&&s===Rt){for(;B===Tt;)B=A[--r];if(B===Rt)return z}if(n===dr&&s===dr){for(var i=0;B===dr;)i++,B=A[--r];if(i%2===0)return z}return Er},ro=function(e){var A=ji(e),t=A.length,r=0,B=0,n=A.map(Ao);return{next:function(){if(r>=t)return{done:!0,value:null};for(var s=z;r<t&&(s=eo(A,n,++r))===z;);if(s!==z||r===t){var i=zi.apply(null,A.slice(B,r));return B=r,{value:i,done:!1}}return{done:!0,value:null}}}},to=function(e){for(var A=ro(e),t=[],r;!(r=A.next()).done;)r.value&&t.push(r.value.slice());return t},Bo=function(e){var A=123;if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height=A+"px",r.style.display="block",e.body.appendChild(r),t.selectNode(r);var B=t.getBoundingClientRect(),n=Math.round(B.height);if(e.body.removeChild(r),n===A)return!0}}return!1},no=function(e){var A=e.createElement("boundtest");A.style.width="50px",A.style.display="block",A.style.fontSize="12px",A.style.letterSpacing="0px",A.style.wordSpacing="0px",e.body.appendChild(A);var t=e.createRange();A.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=A.firstChild,B=ze(r.data).map(function(a){return S(a)}),n=0,s={},i=B.every(function(a,o){t.setStart(r,n),t.setEnd(r,n+a.length);var Q=t.getBoundingClientRect();n+=a.length;var g=Q.x>s.x||Q.y>s.y;return s=Q,o===0?!0:g});return e.body.removeChild(A),i},so=function(){return typeof new Image().crossOrigin!="undefined"},ao=function(){return typeof new XMLHttpRequest().responseType=="string"},io=function(e){var A=new Image,t=e.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;A.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(A,0,0),t.toDataURL()}catch(B){return!1}return!0},Vt=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},oo=function(e){var A=e.createElement("canvas"),t=100;A.width=t,A.height=t;var r=A.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var B=new Image,n=A.toDataURL();B.src=n;var s=Jr(t,t,0,0,B);return r.fillStyle="red",r.fillRect(0,0,t,t),Nt(s).then(function(i){r.drawImage(i,0,0);var a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var o=e.createElement("div");return o.style.backgroundImage="url("+n+")",o.style.height=t+"px",Vt(a)?Nt(Jr(t,t,0,0,o)):Promise.reject(!1)}).then(function(i){return r.drawImage(i,0,0),Vt(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},Jr=function(e,A,t,r,B){var n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),i=document.createElementNS(n,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",A.toString()),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",r.toString()),i.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(i),i.appendChild(B),s},Nt=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){return A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},N={get SUPPORT_RANGE_BOUNDS(){var e=Bo(document);return Object.defineProperty(N,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=N.SUPPORT_RANGE_BOUNDS&&no(document);return Object.defineProperty(N,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=io(document);return Object.defineProperty(N,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?oo(document):Promise.resolve(!1);return Object.defineProperty(N,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=so();return Object.defineProperty(N,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=ao();return Object.defineProperty(N,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(N,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl!="undefined"&&Intl.Segmenter);return Object.defineProperty(N,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},ie=(function(){function e(A,t){this.text=A,this.bounds=t}return e})(),Qo=function(e,A,t,r){var B=co(A,t),n=[],s=0;return B.forEach(function(i){if(t.textDecorationLine.length||i.trim().length>0)if(N.SUPPORT_RANGE_BOUNDS){var a=Xt(r,s,i.length).getClientRects();if(a.length>1){var o=et(i),Q=0;o.forEach(function(w){n.push(new ie(w,cA.fromDOMRectList(e,Xt(r,Q+s,w.length).getClientRects()))),Q+=w.length})}else n.push(new ie(i,cA.fromDOMRectList(e,a)))}else{var g=r.splitText(i.length);n.push(new ie(i,go(e,r))),r=g}else N.SUPPORT_RANGE_BOUNDS||(r=r.splitText(i.length));s+=i.length}),n},go=function(e,A){var t=A.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(A.cloneNode(!0));var B=A.parentNode;if(B){B.replaceChild(r,A);var n=je(e,r);return r.firstChild&&B.replaceChild(r.firstChild,r),n}}return cA.EMPTY},Xt=function(e,A,t){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var B=r.createRange();return B.setStart(e,A),B.setEnd(e,A+t),B},et=function(e){if(N.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(A.segment(e)).map(function(t){return t.segment})}return to(e)},wo=function(e,A){if(N.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(e)).map(function(r){return r.segment})}return uo(e,A)},co=function(e,A){return A.letterSpacing!==0?et(e):wo(e,A)},Co=[32,160,4961,65792,65793,4153,4241],uo=function(e,A){for(var t=Xn(e,{lineBreak:A.lineBreak,wordBreak:A.overflowWrap==="break-word"?"break-word":A.wordBreak}),r=[],B,n=function(){if(B.value){var s=B.value.slice(),i=ze(s),a="";i.forEach(function(o){Co.indexOf(o)===-1?a+=S(o):(a.length&&r.push(a),r.push(S(o)),a="")}),a.length&&r.push(a)}};!(B=t.next()).done;)n();return r},lo=(function(){function e(A,t,r){this.text=fo(t.data,r.textTransform),this.textBounds=Qo(A,this.text,r,t)}return e})(),fo=function(e,A){switch(A){case 1:return e.toLowerCase();case 3:return e.replace(Uo,Fo);case 2:return e.toUpperCase();default:return e}},Uo=/(^|\s|:|-|\(|\))([a-z])/g,Fo=function(e,A,t){return e.length>0?A+t.toUpperCase():e},MB=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.src=r.currentSrc||r.src,B.intrinsicWidth=r.naturalWidth,B.intrinsicHeight=r.naturalHeight,B.context.cache.addImage(B.src),B}return A})(aA),GB=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.canvas=r,B.intrinsicWidth=r.width,B.intrinsicHeight=r.height,B}return A})(aA),RB=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this,n=new XMLSerializer,s=je(t,r);return r.setAttribute("width",s.width+"px"),r.setAttribute("height",s.height+"px"),B.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(r)),B.intrinsicWidth=r.width.baseVal.value,B.intrinsicHeight=r.height.baseVal.value,B.context.cache.addImage(B.svg),B}return A})(aA),VB=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.value=r.value,B}return A})(aA),Pr=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.start=r.start,B.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,B}return A})(aA),ho=[{type:15,flags:0,unit:"px",number:3}],Eo=[{type:16,flags:0,number:50}],Ho=function(e){return e.width>e.height?new cA(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new cA(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},po=function(e){var A=e.type===Io?new Array(e.value.length+1).join("•"):e.value;return A.length===0?e.placeholder||"":A},Je="checkbox",Pe="radio",Io="password",_t=707406591,rt=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;switch(B.type=r.type.toLowerCase(),B.checked=r.checked,B.value=po(r),(B.type===Je||B.type===Pe)&&(B.styles.backgroundColor=3739148031,B.styles.borderTopColor=B.styles.borderRightColor=B.styles.borderBottomColor=B.styles.borderLeftColor=2779096575,B.styles.borderTopWidth=B.styles.borderRightWidth=B.styles.borderBottomWidth=B.styles.borderLeftWidth=1,B.styles.borderTopStyle=B.styles.borderRightStyle=B.styles.borderBottomStyle=B.styles.borderLeftStyle=1,B.styles.backgroundClip=[0],B.styles.backgroundOrigin=[0],B.bounds=Ho(B.bounds)),B.type){case Je:B.styles.borderTopRightRadius=B.styles.borderTopLeftRadius=B.styles.borderBottomRightRadius=B.styles.borderBottomLeftRadius=ho;break;case Pe:B.styles.borderTopRightRadius=B.styles.borderTopLeftRadius=B.styles.borderBottomRightRadius=B.styles.borderBottomLeftRadius=Eo;break}return B}return A})(aA),NB=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this,n=r.options[r.selectedIndex||0];return B.value=n&&n.text||"",B}return A})(aA),XB=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.value=r.value,B}return A})(aA),_B=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;B.src=r.src,B.width=parseInt(r.width,10)||0,B.height=parseInt(r.height,10)||0,B.backgroundColor=B.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){B.tree=PB(t,r.contentWindow.document.documentElement);var n=r.contentWindow.document.documentElement?se(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):wA.TRANSPARENT,s=r.contentWindow.document.body?se(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):wA.TRANSPARENT;B.backgroundColor=HA(n)?HA(s)?B.styles.backgroundColor:s:n}}catch(i){}return B}return A})(aA),vo=["OL","UL","MENU"],Re=function(e,A,t,r){for(var B=A.firstChild,n=void 0;B;B=n)if(n=B.nextSibling,kB(B)&&B.data.trim().length>0)t.textNodes.push(new lo(e,B,t.styles));else if(_A(B))if(qB(B)&&B.assignedNodes)B.assignedNodes().forEach(function(i){return Re(e,i,t,r)});else{var s=JB(e,B);s.styles.isVisible()&&(yo(B,s,r)?s.flags|=4:Ko(s.styles)&&(s.flags|=2),vo.indexOf(B.tagName)!==-1&&(s.flags|=8),t.elements.push(s),B.slot,B.shadowRoot?Re(e,B.shadowRoot,s,r):!ke(B)&&!YB(B)&&!Ye(B)&&Re(e,B,s,r))}},JB=function(e,A){return Yr(A)?new MB(e,A):WB(A)?new GB(e,A):YB(A)?new RB(e,A):mo(A)?new VB(e,A):Lo(A)?new Pr(e,A):Do(A)?new rt(e,A):Ye(A)?new NB(e,A):ke(A)?new XB(e,A):ZB(A)?new _B(e,A):new aA(e,A)},PB=function(e,A){var t=JB(e,A);return t.flags|=4,Re(e,A,t,t),t},yo=function(e,A,t){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||tt(e)&&t.styles.isTransparent()},Ko=function(e){return e.isPositioned()||e.isFloating()},kB=function(e){return e.nodeType===Node.TEXT_NODE},_A=function(e){return e.nodeType===Node.ELEMENT_NODE},kr=function(e){return _A(e)&&typeof e.style!="undefined"&&!Ve(e)},Ve=function(e){return typeof e.className=="object"},mo=function(e){return e.tagName==="LI"},Lo=function(e){return e.tagName==="OL"},Do=function(e){return e.tagName==="INPUT"},bo=function(e){return e.tagName==="HTML"},YB=function(e){return e.tagName==="svg"},tt=function(e){return e.tagName==="BODY"},WB=function(e){return e.tagName==="CANVAS"},Jt=function(e){return e.tagName==="VIDEO"},Yr=function(e){return e.tagName==="IMG"},ZB=function(e){return e.tagName==="IFRAME"},Pt=function(e){return e.tagName==="STYLE"},xo=function(e){return e.tagName==="SCRIPT"},ke=function(e){return e.tagName==="TEXTAREA"},Ye=function(e){return e.tagName==="SELECT"},qB=function(e){return e.tagName==="SLOT"},kt=function(e){return e.tagName.indexOf("-")>0},To=(function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(A){var t=this.counters[A];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(A){var t=this.counters[A];return t||[]},e.prototype.pop=function(A){var t=this;A.forEach(function(r){return t.counters[r].pop()})},e.prototype.parse=function(A){var t=this,r=A.counterIncrement,B=A.counterReset,n=!0;r!==null&&r.forEach(function(i){var a=t.counters[i.counter];a&&i.increment!==0&&(n=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=i.increment)});var s=[];return n&&B.forEach(function(i){var a=t.counters[i.counter];s.push(i.counter),a||(a=t.counters[i.counter]=[]),a.push(i.reset)}),s},e})(),Yt={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"]},Wt={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},So={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Oo={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},GA=function(e,A,t,r,B,n){return e<A||e>t?we(e,B,n.length>0):r.integers.reduce(function(s,i,a){for(;e>=i;)e-=i,s+=r.values[a];return s},"")+n},jB=function(e,A,t,r){var B="";do t||e--,B=r(e)+B,e/=A;while(e*A>=A);return B},T=function(e,A,t,r,B){var n=t-A+1;return(e<0?"-":"")+(jB(Math.abs(e),n,r,function(s){return S(Math.floor(s%n)+A)})+B)},mA=function(e,A,t){t===void 0&&(t=". ");var r=A.length;return jB(Math.abs(e),r,!1,function(B){return A[Math.floor(B%r)]})+t},NA=1,lA=2,fA=4,Be=8,gA=function(e,A,t,r,B,n){if(e<-9999||e>9999)return we(e,4,B.length>0);var s=Math.abs(e),i=B;if(s===0)return A[0]+i;for(var a=0;s>0&&a<=4;a++){var o=s%10;o===0&&G(n,NA)&&i!==""?i=A[o]+i:o>1||o===1&&a===0||o===1&&a===1&&G(n,lA)||o===1&&a===1&&G(n,fA)&&e>100||o===1&&a>1&&G(n,Be)?i=A[o]+(a>0?t[a-1]:"")+i:o===1&&a>0&&(i=t[a-1]+i),s=Math.floor(s/10)}return(e<0?r:"")+i},Zt="十百千萬",qt="拾佰仟萬",jt="マイナス",Hr="마이너스",we=function(e,A,t){var r=t?". ":"",B=t?"、":"",n=t?", ":"",s=t?" ":"";switch(A){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var i=T(e,48,57,!0,r);return i.length<4?"0"+i:i;case 4:return mA(e,"〇一二三四五六七八九",B);case 6:return GA(e,1,3999,Yt,3,r).toLowerCase();case 7:return GA(e,1,3999,Yt,3,r);case 8:return T(e,945,969,!1,r);case 9:return T(e,97,122,!1,r);case 10:return T(e,65,90,!1,r);case 11:return T(e,1632,1641,!0,r);case 12:case 49:return GA(e,1,9999,Wt,3,r);case 35:return GA(e,1,9999,Wt,3,r).toLowerCase();case 13:return T(e,2534,2543,!0,r);case 14:case 30:return T(e,6112,6121,!0,r);case 15:return mA(e,"子丑寅卯辰巳午未申酉戌亥",B);case 16:return mA(e,"甲乙丙丁戊己庚辛壬癸",B);case 17:case 48:return gA(e,"零一二三四五六七八九",Zt,"負",B,lA|fA|Be);case 47:return gA(e,"零壹貳參肆伍陸柒捌玖",qt,"負",B,NA|lA|fA|Be);case 42:return gA(e,"零一二三四五六七八九",Zt,"负",B,lA|fA|Be);case 41:return gA(e,"零壹贰叁肆伍陆柒捌玖",qt,"负",B,NA|lA|fA|Be);case 26:return gA(e,"〇一二三四五六七八九","十百千万",jt,B,0);case 25:return gA(e,"零壱弐参四伍六七八九","拾百千万",jt,B,NA|lA|fA);case 31:return gA(e,"영일이삼사오육칠팔구","십백천만",Hr,n,NA|lA|fA);case 33:return gA(e,"零一二三四五六七八九","十百千萬",Hr,n,0);case 32:return gA(e,"零壹貳參四五六七八九","拾百千",Hr,n,NA|lA|fA);case 18:return T(e,2406,2415,!0,r);case 20:return GA(e,1,19999,Oo,3,r);case 21:return T(e,2790,2799,!0,r);case 22:return T(e,2662,2671,!0,r);case 22:return GA(e,1,10999,So,3,r);case 23:return mA(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return mA(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return T(e,3302,3311,!0,r);case 28:return mA(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",B);case 29:return mA(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",B);case 34:return T(e,3792,3801,!0,r);case 37:return T(e,6160,6169,!0,r);case 38:return T(e,4160,4169,!0,r);case 39:return T(e,2918,2927,!0,r);case 40:return T(e,1776,1785,!0,r);case 43:return T(e,3046,3055,!0,r);case 44:return T(e,3174,3183,!0,r);case 45:return T(e,3664,3673,!0,r);case 46:return T(e,3872,3881,!0,r);case 3:default:return T(e,48,57,!0,r)}},zB="data-html2canvas-ignore",zt=(function(){function e(A,t,r){if(this.context=A,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new To,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(A,t){var r=this,B=Mo(A,t);if(!B.contentWindow)return Promise.reject("Unable to find iframe window");var n=A.defaultView.pageXOffset,s=A.defaultView.pageYOffset,i=B.contentWindow,a=i.document,o=Vo(B).then(function(){return P(r,void 0,void 0,function(){var Q,g;return _(this,function(w){switch(w.label){case 0:return this.scrolledElements.forEach(Jo),i&&(i.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(i.scrollY!==t.top||i.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(i.scrollX-t.left,i.scrollY-t.top,0,0))),Q=this.options.onclone,g=this.clonedReferenceElement,typeof g=="undefined"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:w.sent(),w.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Ro(a)]:[3,4];case 3:w.sent(),w.label=4;case 4:return typeof Q=="function"?[2,Promise.resolve().then(function(){return Q(a,g)}).then(function(){return B})]:[2,B]}})})});return a.open(),a.write(Xo(document.doctype)+"<html></html>"),_o(this.referenceElement.ownerDocument,n,s),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),o},e.prototype.createElementClone=function(A){if(_r(A,2),WB(A))return this.createCanvasClone(A);if(Jt(A))return this.createVideoClone(A);if(Pt(A))return this.createStyleClone(A);var t=A.cloneNode(!1);return Yr(t)&&(Yr(A)&&A.currentSrc&&A.currentSrc!==A.src&&(t.src=A.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),kt(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(A){var t=document.createElement("html2canvascustomelement");return pr(A.style,t),t},e.prototype.createStyleClone=function(A){try{var t=A.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(n,s){return s&&typeof s.cssText=="string"?n+s.cssText:n},""),B=A.cloneNode(!1);return B.textContent=r,B}}catch(n){if(this.context.logger.error("Unable to access cssRules property",n),n.name!=="SecurityError")throw n}return A.cloneNode(!1)},e.prototype.createCanvasClone=function(A){var t;if(this.options.inlineImages&&A.ownerDocument){var r=A.ownerDocument.createElement("img");try{return r.src=A.toDataURL(),r}catch(o){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var B=A.cloneNode(!1);try{B.width=A.width,B.height=A.height;var n=A.getContext("2d"),s=B.getContext("2d");if(s)if(!this.options.allowTaint&&n)s.putImageData(n.getImageData(0,0,A.width,A.height),0,0);else{var i=(t=A.getContext("webgl2"))!==null&&t!==void 0?t:A.getContext("webgl");if(i){var a=i.getContextAttributes();(a==null?void 0:a.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}s.drawImage(A,0,0)}return B}catch(o){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return B},e.prototype.createVideoClone=function(A){var t=A.ownerDocument.createElement("canvas");t.width=A.offsetWidth,t.height=A.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(A,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch(n){this.context.logger.info("Unable to clone video as it is tainted",A)}var B=A.ownerDocument.createElement("canvas");return B.width=A.offsetWidth,B.height=A.offsetHeight,B},e.prototype.appendChildNode=function(A,t,r){(!_A(t)||!xo(t)&&!t.hasAttribute(zB)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!_A(t)||!Pt(t))&&A.appendChild(this.cloneNode(t,r))},e.prototype.cloneChildNodes=function(A,t,r){for(var B=this,n=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;n;n=n.nextSibling)if(_A(n)&&qB(n)&&typeof n.assignedNodes=="function"){var s=n.assignedNodes();s.length&&s.forEach(function(i){return B.appendChildNode(t,i,r)})}else this.appendChildNode(t,n,r)},e.prototype.cloneNode=function(A,t){if(kB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var r=A.ownerDocument.defaultView;if(r&&_A(A)&&(kr(A)||Ve(A))){var B=this.createElementClone(A);B.style.transitionProperty="none";var n=r.getComputedStyle(A),s=r.getComputedStyle(A,":before"),i=r.getComputedStyle(A,":after");this.referenceElement===A&&kr(B)&&(this.clonedReferenceElement=B),tt(B)&&Yo(B);var a=this.counters.parse(new mt(this.context,n)),o=this.resolvePseudoContent(A,B,s,oe.BEFORE);kt(A)&&(t=!0),Jt(A)||this.cloneChildNodes(A,B,t),o&&B.insertBefore(o,B.firstChild);var Q=this.resolvePseudoContent(A,B,i,oe.AFTER);return Q&&B.appendChild(Q),this.counters.pop(a),(n&&(this.options.copyStyles||Ve(A))&&!ZB(A)||t)&&pr(n,B),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([B,A.scrollLeft,A.scrollTop]),(ke(A)||Ye(A))&&(ke(B)||Ye(B))&&(B.value=A.value),B}return A.cloneNode(!1)},e.prototype.resolvePseudoContent=function(A,t,r,B){var n=this;if(r){var s=r.content,i=t.ownerDocument;if(!(!i||!s||s==="none"||s==="-moz-alt-content"||r.display==="none")){this.counters.parse(new mt(this.context,r));var a=new Ki(this.context,r),o=i.createElement("html2canvaspseudoelement");pr(r,o),a.content.forEach(function(g){if(g.type===0)o.appendChild(i.createTextNode(g.value));else if(g.type===22){var w=i.createElement("img");w.src=g.value,w.style.opacity="1",o.appendChild(w)}else if(g.type===18){if(g.name==="attr"){var f=g.values.filter(D);f.length&&o.appendChild(i.createTextNode(A.getAttribute(f[0].value)||""))}else if(g.name==="counter"){var c=g.values.filter(PA),C=c[0],H=c[1];if(C&&D(C)){var h=n.counters.getCounterValue(C.value),F=H&&D(H)?Xr.parse(n.context,H.value):3;o.appendChild(i.createTextNode(we(h,F,!1)))}}else if(g.name==="counters"){var K=g.values.filter(PA),C=K[0],p=K[1],H=K[2];if(C&&D(C)){var d=n.counters.getCounterValues(C.value),l=H&&D(H)?Xr.parse(n.context,H.value):3,v=p&&p.type===0?p.value:"",y=d.map(function(k){return we(k,l,!1)}).join(v);o.appendChild(i.createTextNode(y))}}}else if(g.type===20)switch(g.value){case"open-quote":o.appendChild(i.createTextNode(Kt(a.quotes,n.quoteDepth++,!0)));break;case"close-quote":o.appendChild(i.createTextNode(Kt(a.quotes,--n.quoteDepth,!1)));break;default:o.appendChild(i.createTextNode(g.value))}}),o.className=Wr+" "+Zr;var Q=B===oe.BEFORE?" "+Wr:" "+Zr;return Ve(t)?t.className.baseValue+=Q:t.className+=Q,o}}},e.destroy=function(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1},e})(),oe;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(oe||(oe={}));var Mo=function(e,A){var t=e.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=A.width.toString(),t.height=A.height.toString(),t.scrolling="no",t.setAttribute(zB,"true"),e.body.appendChild(t),t},Go=function(e){return new Promise(function(A){if(e.complete){A();return}if(!e.src){A();return}e.onload=A,e.onerror=A})},Ro=function(e){return Promise.all([].slice.call(e.images,0).map(Go))},Vo=function(e){return new Promise(function(A,t){var r=e.contentWindow;if(!r)return t("No window assigned for iframe");var B=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var n=setInterval(function(){B.body.childNodes.length>0&&B.readyState==="complete"&&(clearInterval(n),A(e))},50)}})},No=["all","d","content"],pr=function(e,A){for(var t=e.length-1;t>=0;t--){var r=e.item(t);No.indexOf(r)===-1&&A.style.setProperty(r,e.getPropertyValue(r))}return A},Xo=function(e){var A="";return e&&(A+="<!DOCTYPE ",e.name&&(A+=e.name),e.internalSubset&&(A+=e.internalSubset),e.publicId&&(A+='"'+e.publicId+'"'),e.systemId&&(A+='"'+e.systemId+'"'),A+=">"),A},_o=function(e,A,t){e&&e.defaultView&&(A!==e.defaultView.pageXOffset||t!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(A,t)},Jo=function(e){var A=e[0],t=e[1],r=e[2];A.scrollLeft=t,A.scrollTop=r},Po=":before",ko=":after",Wr="___html2canvas___pseudoelement_before",Zr="___html2canvas___pseudoelement_after",$t=`{
    content: "" !important;
    display: none !important;
}`,Yo=function(e){Wo(e,"."+Wr+Po+$t+`
         .`+Zr+ko+$t)},Wo=function(e,A){var t=e.ownerDocument;if(t){var r=t.createElement("style");r.textContent=A,e.appendChild(r)}},$B=(function(){function e(){}return e.getOrigin=function(A){var t=e._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},e.isSameOrigin=function(A){return e.getOrigin(A)===e._origin},e.setContext=function(A){e._link=A.document.createElement("a"),e._origin=e.getOrigin(A.location.href)},e._origin="about:blank",e})(),Zo=(function(){function e(A,t){this.context=A,this._options=t,this._cache={}}return e.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(vr(A)||$o(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},e.prototype.match=function(A){return this._cache[A]},e.prototype.loadImage=function(A){return P(this,void 0,void 0,function(){var t,r,B,n,s=this;return _(this,function(i){switch(i.label){case 0:return t=$B.isSameOrigin(A),r=!Ir(A)&&this._options.useCORS===!0&&N.SUPPORT_CORS_IMAGES&&!t,B=!Ir(A)&&!t&&!vr(A)&&typeof this._options.proxy=="string"&&N.SUPPORT_CORS_XHR&&!r,!t&&this._options.allowTaint===!1&&!Ir(A)&&!vr(A)&&!B&&!r?[2]:(n=A,B?[4,this.proxy(n)]:[3,2]);case 1:n=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,o){var Q=new Image;Q.onload=function(){return a(Q)},Q.onerror=o,(AQ(n)||r)&&(Q.crossOrigin="anonymous"),Q.src=n,Q.complete===!0&&setTimeout(function(){return a(Q)},500),s._options.imageTimeout>0&&setTimeout(function(){return o("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(A){return typeof this._cache[A]!="undefined"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(A){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var B=A.substring(0,256);return new Promise(function(n,s){var i=N.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(i==="text")n(a.response);else{var g=new FileReader;g.addEventListener("load",function(){return n(g.result)},!1),g.addEventListener("error",function(w){return s(w)},!1),g.readAsDataURL(a.response)}else s("Failed to proxy resource "+B+" with status code "+a.status)},a.onerror=s;var o=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+o+"url="+encodeURIComponent(A)+"&responseType="+i),i!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=i),t._options.imageTimeout){var Q=t._options.imageTimeout;a.timeout=Q,a.ontimeout=function(){return s("Timed out ("+Q+"ms) proxying "+B)}}a.send()})},e})(),qo=/^data:image\/svg\+xml/i,jo=/^data:image\/.*;base64,/i,zo=/^data:image\/.*/i,$o=function(e){return N.SUPPORT_SVG_DRAWING||!eQ(e)},Ir=function(e){return zo.test(e)},AQ=function(e){return jo.test(e)},vr=function(e){return e.substr(0,4)==="blob"},eQ=function(e){return e.substr(-3).toLowerCase()==="svg"||qo.test(e)},u=(function(){function e(A,t){this.type=0,this.x=A,this.y=t}return e.prototype.add=function(A,t){return new e(this.x+A,this.y+t)},e})(),RA=function(e,A,t){return new u(e.x+(A.x-e.x)*t,e.y+(A.y-e.y)*t)},xe=(function(){function e(A,t,r,B){this.type=1,this.start=A,this.startControl=t,this.endControl=r,this.end=B}return e.prototype.subdivide=function(A,t){var r=RA(this.start,this.startControl,A),B=RA(this.startControl,this.endControl,A),n=RA(this.endControl,this.end,A),s=RA(r,B,A),i=RA(B,n,A),a=RA(s,i,A);return t?new e(this.start,r,s,a):new e(a,i,n,this.end)},e.prototype.add=function(A,t){return new e(this.start.add(A,t),this.startControl.add(A,t),this.endControl.add(A,t),this.end.add(A,t))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e})(),$=function(e){return e.type===1},rQ=(function(){function e(A){var t=A.styles,r=A.bounds,B=re(t.borderTopLeftRadius,r.width,r.height),n=B[0],s=B[1],i=re(t.borderTopRightRadius,r.width,r.height),a=i[0],o=i[1],Q=re(t.borderBottomRightRadius,r.width,r.height),g=Q[0],w=Q[1],f=re(t.borderBottomLeftRadius,r.width,r.height),c=f[0],C=f[1],H=[];H.push((n+a)/r.width),H.push((c+g)/r.width),H.push((s+C)/r.height),H.push((o+w)/r.height);var h=Math.max.apply(Math,H);h>1&&(n/=h,s/=h,a/=h,o/=h,g/=h,w/=h,c/=h,C/=h);var F=r.width-a,K=r.height-w,p=r.width-g,d=r.height-C,l=t.borderTopWidth,v=t.borderRightWidth,y=t.borderBottomWidth,E=t.borderLeftWidth,O=b(t.paddingTop,A.bounds.width),k=b(t.paddingRight,A.bounds.width),q=b(t.paddingBottom,A.bounds.width),L=b(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||s>0?x(r.left+E/3,r.top+l/3,n-E/3,s-l/3,m.TOP_LEFT):new u(r.left+E/3,r.top+l/3),this.topRightBorderDoubleOuterBox=n>0||s>0?x(r.left+F,r.top+l/3,a-v/3,o-l/3,m.TOP_RIGHT):new u(r.left+r.width-v/3,r.top+l/3),this.bottomRightBorderDoubleOuterBox=g>0||w>0?x(r.left+p,r.top+K,g-v/3,w-y/3,m.BOTTOM_RIGHT):new u(r.left+r.width-v/3,r.top+r.height-y/3),this.bottomLeftBorderDoubleOuterBox=c>0||C>0?x(r.left+E/3,r.top+d,c-E/3,C-y/3,m.BOTTOM_LEFT):new u(r.left+E/3,r.top+r.height-y/3),this.topLeftBorderDoubleInnerBox=n>0||s>0?x(r.left+E*2/3,r.top+l*2/3,n-E*2/3,s-l*2/3,m.TOP_LEFT):new u(r.left+E*2/3,r.top+l*2/3),this.topRightBorderDoubleInnerBox=n>0||s>0?x(r.left+F,r.top+l*2/3,a-v*2/3,o-l*2/3,m.TOP_RIGHT):new u(r.left+r.width-v*2/3,r.top+l*2/3),this.bottomRightBorderDoubleInnerBox=g>0||w>0?x(r.left+p,r.top+K,g-v*2/3,w-y*2/3,m.BOTTOM_RIGHT):new u(r.left+r.width-v*2/3,r.top+r.height-y*2/3),this.bottomLeftBorderDoubleInnerBox=c>0||C>0?x(r.left+E*2/3,r.top+d,c-E*2/3,C-y*2/3,m.BOTTOM_LEFT):new u(r.left+E*2/3,r.top+r.height-y*2/3),this.topLeftBorderStroke=n>0||s>0?x(r.left+E/2,r.top+l/2,n-E/2,s-l/2,m.TOP_LEFT):new u(r.left+E/2,r.top+l/2),this.topRightBorderStroke=n>0||s>0?x(r.left+F,r.top+l/2,a-v/2,o-l/2,m.TOP_RIGHT):new u(r.left+r.width-v/2,r.top+l/2),this.bottomRightBorderStroke=g>0||w>0?x(r.left+p,r.top+K,g-v/2,w-y/2,m.BOTTOM_RIGHT):new u(r.left+r.width-v/2,r.top+r.height-y/2),this.bottomLeftBorderStroke=c>0||C>0?x(r.left+E/2,r.top+d,c-E/2,C-y/2,m.BOTTOM_LEFT):new u(r.left+E/2,r.top+r.height-y/2),this.topLeftBorderBox=n>0||s>0?x(r.left,r.top,n,s,m.TOP_LEFT):new u(r.left,r.top),this.topRightBorderBox=a>0||o>0?x(r.left+F,r.top,a,o,m.TOP_RIGHT):new u(r.left+r.width,r.top),this.bottomRightBorderBox=g>0||w>0?x(r.left+p,r.top+K,g,w,m.BOTTOM_RIGHT):new u(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=c>0||C>0?x(r.left,r.top+d,c,C,m.BOTTOM_LEFT):new u(r.left,r.top+r.height),this.topLeftPaddingBox=n>0||s>0?x(r.left+E,r.top+l,Math.max(0,n-E),Math.max(0,s-l),m.TOP_LEFT):new u(r.left+E,r.top+l),this.topRightPaddingBox=a>0||o>0?x(r.left+Math.min(F,r.width-v),r.top+l,F>r.width+v?0:Math.max(0,a-v),Math.max(0,o-l),m.TOP_RIGHT):new u(r.left+r.width-v,r.top+l),this.bottomRightPaddingBox=g>0||w>0?x(r.left+Math.min(p,r.width-E),r.top+Math.min(K,r.height-y),Math.max(0,g-v),Math.max(0,w-y),m.BOTTOM_RIGHT):new u(r.left+r.width-v,r.top+r.height-y),this.bottomLeftPaddingBox=c>0||C>0?x(r.left+E,r.top+Math.min(d,r.height-y),Math.max(0,c-E),Math.max(0,C-y),m.BOTTOM_LEFT):new u(r.left+E,r.top+r.height-y),this.topLeftContentBox=n>0||s>0?x(r.left+E+L,r.top+l+O,Math.max(0,n-(E+L)),Math.max(0,s-(l+O)),m.TOP_LEFT):new u(r.left+E+L,r.top+l+O),this.topRightContentBox=a>0||o>0?x(r.left+Math.min(F,r.width+E+L),r.top+l+O,F>r.width+E+L?0:a-E+L,o-(l+O),m.TOP_RIGHT):new u(r.left+r.width-(v+k),r.top+l+O),this.bottomRightContentBox=g>0||w>0?x(r.left+Math.min(p,r.width-(E+L)),r.top+Math.min(K,r.height+l+O),Math.max(0,g-(v+k)),w-(y+q),m.BOTTOM_RIGHT):new u(r.left+r.width-(v+k),r.top+r.height-(y+q)),this.bottomLeftContentBox=c>0||C>0?x(r.left+E+L,r.top+d,Math.max(0,c-(E+L)),C-(y+q),m.BOTTOM_LEFT):new u(r.left+E+L,r.top+r.height-(y+q))}return e})(),m;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(m||(m={}));var x=function(e,A,t,r,B){var n=4*((Math.sqrt(2)-1)/3),s=t*n,i=r*n,a=e+t,o=A+r;switch(B){case m.TOP_LEFT:return new xe(new u(e,o),new u(e,o-i),new u(a-s,A),new u(a,A));case m.TOP_RIGHT:return new xe(new u(e,A),new u(e+s,A),new u(a,o-i),new u(a,o));case m.BOTTOM_RIGHT:return new xe(new u(a,A),new u(a,A+i),new u(e+s,o),new u(e,o));case m.BOTTOM_LEFT:default:return new xe(new u(a,o),new u(a-s,o),new u(e,A+i),new u(e,A))}},We=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},tQ=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Ze=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},BQ=(function(){function e(A,t,r){this.offsetX=A,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e})(),Te=(function(){function e(A,t){this.path=A,this.target=t,this.type=1}return e})(),nQ=(function(){function e(A){this.opacity=A,this.type=2,this.target=6}return e})(),sQ=function(e){return e.type===0},An=function(e){return e.type===1},aQ=function(e){return e.type===2},AB=function(e,A){return e.length===A.length?e.some(function(t,r){return t===A[r]}):!1},iQ=function(e,A,t,r,B){return e.map(function(n,s){switch(s){case 0:return n.add(A,t);case 1:return n.add(A+r,t);case 2:return n.add(A+r,t+B);case 3:return n.add(A,t+B)}return n})},en=(function(){function e(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e})(),rn=(function(){function e(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new rQ(this.container),this.container.styles.opacity<1&&this.effects.push(new nQ(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,B=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new BQ(r,B,n))}if(this.container.styles.overflowX!==0){var s=We(this.curves),i=Ze(this.curves);AB(s,i)?this.effects.push(new Te(s,6)):(this.effects.push(new Te(s,2)),this.effects.push(new Te(i,4)))}}return e.prototype.getEffects=function(A){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,B=this.effects.slice(0);r;){var n=r.effects.filter(function(a){return!An(a)});if(t||r.container.styles.position!==0||!r.parent){if(B.unshift.apply(B,n),t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=We(r.curves),i=Ze(r.curves);AB(s,i)||B.unshift(new Te(i,6))}}else B.unshift.apply(B,n);r=r.parent}return B.filter(function(a){return G(a.target,A)})},e})(),qr=function(e,A,t,r){e.container.elements.forEach(function(B){var n=G(B.flags,4),s=G(B.flags,2),i=new rn(B,e);G(B.styles.display,2048)&&r.push(i);var a=G(B.flags,8)?[]:r;if(n||s){var o=n||B.styles.isPositioned()?t:A,Q=new en(i);if(B.styles.isPositioned()||B.styles.opacity<1||B.styles.isTransformed()){var g=B.styles.zIndex.order;if(g<0){var w=0;o.negativeZIndex.some(function(c,C){return g>c.element.container.styles.zIndex.order?(w=C,!1):w>0}),o.negativeZIndex.splice(w,0,Q)}else if(g>0){var f=0;o.positiveZIndex.some(function(c,C){return g>=c.element.container.styles.zIndex.order?(f=C+1,!1):f>0}),o.positiveZIndex.splice(f,0,Q)}else o.zeroOrAutoZIndexOrTransformedOrOpacity.push(Q)}else B.styles.isFloating()?o.nonPositionedFloats.push(Q):o.nonPositionedInlineLevel.push(Q);qr(i,Q,n?Q:t,a)}else B.styles.isInlineLevel()?A.inlineLevel.push(i):A.nonInlineLevel.push(i),qr(i,A,t,a);G(B.flags,8)&&tn(B,a)})},tn=function(e,A){for(var t=e instanceof Pr?e.start:1,r=e instanceof Pr?e.reversed:!1,B=0;B<A.length;B++){var n=A[B];n.container instanceof VB&&typeof n.container.value=="number"&&n.container.value!==0&&(t=n.container.value),n.listValue=we(t,n.container.styles.listStyleType,!0),t+=r?-1:1}},oQ=function(e){var A=new rn(e,null),t=new en(A),r=[];return qr(A,t,t,r),tn(A.container,r),t},eB=function(e,A){switch(A){case 0:return eA(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return eA(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return eA(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return eA(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},QQ=function(e,A){switch(A){case 0:return eA(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return eA(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return eA(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return eA(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},gQ=function(e,A){switch(A){case 0:return eA(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return eA(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return eA(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return eA(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},wQ=function(e,A){switch(A){case 0:return Se(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Se(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Se(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return Se(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Se=function(e,A){var t=[];return $(e)?t.push(e.subdivide(.5,!1)):t.push(e),$(A)?t.push(A.subdivide(.5,!0)):t.push(A),t},eA=function(e,A,t,r){var B=[];return $(e)?B.push(e.subdivide(.5,!1)):B.push(e),$(t)?B.push(t.subdivide(.5,!0)):B.push(t),$(r)?B.push(r.subdivide(.5,!0).reverse()):B.push(r),$(A)?B.push(A.subdivide(.5,!1).reverse()):B.push(A),B},Bn=function(e){var A=e.bounds,t=e.styles;return A.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},qe=function(e){var A=e.styles,t=e.bounds,r=b(A.paddingLeft,t.width),B=b(A.paddingRight,t.width),n=b(A.paddingTop,t.width),s=b(A.paddingBottom,t.width);return t.add(r+A.borderLeftWidth,n+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+r+B),-(A.borderTopWidth+A.borderBottomWidth+n+s))},cQ=function(e,A){return e===0?A.bounds:e===2?qe(A):Bn(A)},CQ=function(e,A){return e===0?A.bounds:e===2?qe(A):Bn(A)},yr=function(e,A,t){var r=cQ(XA(e.styles.backgroundOrigin,A),e),B=CQ(XA(e.styles.backgroundClip,A),e),n=uQ(XA(e.styles.backgroundSize,A),t,r),s=n[0],i=n[1],a=re(XA(e.styles.backgroundPosition,A),r.width-s,r.height-i),o=lQ(XA(e.styles.backgroundRepeat,A),a,n,r,B),Q=Math.round(r.left+a[0]),g=Math.round(r.top+a[1]);return[o,Q,g,s,i]},VA=function(e){return D(e)&&e.value===JA.AUTO},Oe=function(e){return typeof e=="number"},uQ=function(e,A,t){var r=A[0],B=A[1],n=A[2],s=e[0],i=e[1];if(!s)return[0,0];if(M(s)&&i&&M(i))return[b(s,t.width),b(i,t.height)];var a=Oe(n);if(D(s)&&(s.value===JA.CONTAIN||s.value===JA.COVER)){if(Oe(n)){var o=t.width/t.height;return o<n!=(s.value===JA.COVER)?[t.width,t.width/n]:[t.height*n,t.height]}return[t.width,t.height]}var Q=Oe(r),g=Oe(B),w=Q||g;if(VA(s)&&(!i||VA(i))){if(Q&&g)return[r,B];if(!a&&!w)return[t.width,t.height];if(w&&a){var f=Q?r:B*n,c=g?B:r/n;return[f,c]}var C=Q?r:t.width,H=g?B:t.height;return[C,H]}if(a){var h=0,F=0;return M(s)?h=b(s,t.width):M(i)&&(F=b(i,t.height)),VA(s)?h=F*n:(!i||VA(i))&&(F=h/n),[h,F]}var K=null,p=null;if(M(s)?K=b(s,t.width):i&&M(i)&&(p=b(i,t.height)),K!==null&&(!i||VA(i))&&(p=Q&&g?K/r*B:t.height),p!==null&&VA(s)&&(K=Q&&g?p/B*r:t.width),K!==null&&p!==null)return[K,p];throw new Error("Unable to calculate background-size for element")},XA=function(e,A){var t=e[A];return typeof t=="undefined"?e[0]:t},lQ=function(e,A,t,r,B){var n=A[0],s=A[1],i=t[0],a=t[1];switch(e){case 2:return[new u(Math.round(r.left),Math.round(r.top+s)),new u(Math.round(r.left+r.width),Math.round(r.top+s)),new u(Math.round(r.left+r.width),Math.round(a+r.top+s)),new u(Math.round(r.left),Math.round(a+r.top+s))];case 3:return[new u(Math.round(r.left+n),Math.round(r.top)),new u(Math.round(r.left+n+i),Math.round(r.top)),new u(Math.round(r.left+n+i),Math.round(r.height+r.top)),new u(Math.round(r.left+n),Math.round(r.height+r.top))];case 1:return[new u(Math.round(r.left+n),Math.round(r.top+s)),new u(Math.round(r.left+n+i),Math.round(r.top+s)),new u(Math.round(r.left+n+i),Math.round(r.top+s+a)),new u(Math.round(r.left+n),Math.round(r.top+s+a))];default:return[new u(Math.round(B.left),Math.round(B.top)),new u(Math.round(B.left+B.width),Math.round(B.top)),new u(Math.round(B.left+B.width),Math.round(B.height+B.top)),new u(Math.round(B.left),Math.round(B.height+B.top))]}},fQ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",rB="Hidden Text",UQ=(function(){function e(A){this._data={},this._document=A}return e.prototype.parseMetrics=function(A,t){var r=this._document.createElement("div"),B=this._document.createElement("img"),n=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=A,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),B.src=fQ,B.width=1,B.height=1,B.style.margin="0",B.style.padding="0",B.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(rB)),r.appendChild(n),r.appendChild(B);var i=B.offsetTop-n.offsetTop+2;r.removeChild(n),r.appendChild(this._document.createTextNode(rB)),r.style.lineHeight="normal",B.style.verticalAlign="super";var a=B.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:i,middle:a}},e.prototype.getMetrics=function(A,t){var r=A+" "+t;return typeof this._data[r]=="undefined"&&(this._data[r]=this.parseMetrics(A,t)),this._data[r]},e})(),nn=(function(){function e(A,t){this.context=A,this.options=t}return e})(),FQ=1e4,hQ=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B._activeEffects=[],B.canvas=r.canvas?r.canvas:document.createElement("canvas"),B.ctx=B.canvas.getContext("2d"),r.canvas||(B.canvas.width=Math.floor(r.width*r.scale),B.canvas.height=Math.floor(r.height*r.scale),B.canvas.style.width=r.width+"px",B.canvas.style.height=r.height+"px"),B.fontMetrics=new UQ(document),B.ctx.scale(B.options.scale,B.options.scale),B.ctx.translate(-r.x,-r.y),B.ctx.textBaseline="bottom",B._activeEffects=[],B.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),B}return A.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(B){return r.applyEffect(B)})},A.prototype.applyEffect=function(t){this.ctx.save(),aQ(t)&&(this.ctx.globalAlpha=t.opacity),sQ(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),An(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(t){return P(this,void 0,void 0,function(){var r;return _(this,function(B){switch(B.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:B.sent(),B.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(t){return P(this,void 0,void 0,function(){return _(this,function(r){switch(r.label){case 0:return G(t.container.flags,16),t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(t,r,B){var n=this;if(r===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+B);else{var s=et(t.text);s.reduce(function(i,a){return n.ctx.fillText(a,i,t.bounds.top+B),i+n.ctx.measureText(a).width},t.bounds.left)}},A.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),B=IQ(t.fontFamily).join(", "),n=Ce(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,r,t.fontWeight,n,B].join(" "),B,n]},A.prototype.renderTextNode=function(t,r){return P(this,void 0,void 0,function(){var B,n,s,i,a,o,Q,g,w=this;return _(this,function(f){return B=this.createFontStyle(r),n=B[0],s=B[1],i=B[2],this.ctx.font=n,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(s,i),o=a.baseline,Q=a.middle,g=r.paintOrder,t.textBounds.forEach(function(c){g.forEach(function(C){switch(C){case 0:w.ctx.fillStyle=R(r.color),w.renderTextWithLetterSpacing(c,r.letterSpacing,o);var H=r.textShadow;H.length&&c.text.trim().length&&(H.slice(0).reverse().forEach(function(h){w.ctx.shadowColor=R(h.color),w.ctx.shadowOffsetX=h.offsetX.number*w.options.scale,w.ctx.shadowOffsetY=h.offsetY.number*w.options.scale,w.ctx.shadowBlur=h.blur.number,w.renderTextWithLetterSpacing(c,r.letterSpacing,o)}),w.ctx.shadowColor="",w.ctx.shadowOffsetX=0,w.ctx.shadowOffsetY=0,w.ctx.shadowBlur=0),r.textDecorationLine.length&&(w.ctx.fillStyle=R(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(h){switch(h){case 1:w.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top+o),c.bounds.width,1);break;case 2:w.ctx.fillRect(c.bounds.left,Math.round(c.bounds.top),c.bounds.width,1);break;case 3:w.ctx.fillRect(c.bounds.left,Math.ceil(c.bounds.top+Q),c.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&c.text.trim().length&&(w.ctx.strokeStyle=R(r.webkitTextStrokeColor),w.ctx.lineWidth=r.webkitTextStrokeWidth,w.ctx.lineJoin=window.chrome?"miter":"round",w.ctx.strokeText(c.text,c.bounds.left,c.bounds.top+o)),w.ctx.strokeStyle="",w.ctx.lineWidth=0,w.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(t,r,B){if(B&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var n=qe(t),s=Ze(r);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(B,0,0,t.intrinsicWidth,t.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(t){return P(this,void 0,void 0,function(){var r,B,n,s,i,a,F,F,o,Q,g,w,p,f,c,d,C,H,h,F,K,p,d;return _(this,function(l){switch(l.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,B=t.curves,n=r.styles,s=0,i=r.textNodes,l.label=1;case 1:return s<i.length?(a=i[s],[4,this.renderTextNode(a,n)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof MB))return[3,8];l.label=5;case 5:return l.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return F=l.sent(),this.renderReplacedElement(r,B,F),[3,8];case 7:return l.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof GB&&this.renderReplacedElement(r,B,r.canvas),!(r instanceof RB))return[3,12];l.label=9;case 9:return l.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return F=l.sent(),this.renderReplacedElement(r,B,F),[3,12];case 11:return l.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof _B&&r.tree?(o=new A(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,o.render(r.tree)]):[3,14];case 13:Q=l.sent(),r.width&&r.height&&this.ctx.drawImage(Q,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),l.label=14;case 14:if(r instanceof rt&&(g=Math.min(r.bounds.width,r.bounds.height),r.type===Je?r.checked&&(this.ctx.save(),this.path([new u(r.bounds.left+g*.39363,r.bounds.top+g*.79),new u(r.bounds.left+g*.16,r.bounds.top+g*.5549),new u(r.bounds.left+g*.27347,r.bounds.top+g*.44071),new u(r.bounds.left+g*.39694,r.bounds.top+g*.5649),new u(r.bounds.left+g*.72983,r.bounds.top+g*.23),new u(r.bounds.left+g*.84,r.bounds.top+g*.34085),new u(r.bounds.left+g*.39363,r.bounds.top+g*.79)]),this.ctx.fillStyle=R(_t),this.ctx.fill(),this.ctx.restore()):r.type===Pe&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+g/2,r.bounds.top+g/2,g/4,0,Math.PI*2,!0),this.ctx.fillStyle=R(_t),this.ctx.fill(),this.ctx.restore())),dQ(r)&&r.value.length){switch(w=this.createFontStyle(n),p=w[0],f=w[1],c=this.fontMetrics.getMetrics(p,f).baseline,this.ctx.font=p,this.ctx.fillStyle=R(n.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=HQ(r.styles.textAlign),d=qe(r),C=0,r.styles.textAlign){case 1:C+=d.width/2;break;case 2:C+=d.width;break}H=d.add(C,0,0,-d.height/2+1),this.ctx.save(),this.path([new u(d.left,d.top),new u(d.left+d.width,d.top),new u(d.left+d.width,d.top+d.height),new u(d.left,d.top+d.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new ie(r.value,H),n.letterSpacing,c),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!G(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(h=r.styles.listStyleImage,h.type!==0)return[3,18];F=void 0,K=h.url,l.label=15;case 15:return l.trys.push([15,17,,18]),[4,this.context.cache.match(K)];case 16:return F=l.sent(),this.ctx.drawImage(F,r.bounds.left-(F.width+10),r.bounds.top),[3,18];case 17:return l.sent(),this.context.logger.error("Error loading list-style-image "+K),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(p=this.createFontStyle(n)[0],this.ctx.font=p,this.ctx.fillStyle=R(n.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",d=new cA(r.bounds.left,r.bounds.top+b(r.styles.paddingTop,r.bounds.width),r.bounds.width,vt(n.lineHeight,n.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new ie(t.listValue,d),n.letterSpacing,vt(n.lineHeight,n.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),l.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(t){return P(this,void 0,void 0,function(){var r,B,h,n,s,h,i,a,h,o,Q,h,g,w,h,f,c,h,C,H,h;return _(this,function(F){switch(F.label){case 0:return G(t.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:F.sent(),r=0,B=t.negativeZIndex,F.label=2;case 2:return r<B.length?(h=B[r],[4,this.renderStack(h)]):[3,5];case 3:F.sent(),F.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:F.sent(),n=0,s=t.nonInlineLevel,F.label=7;case 7:return n<s.length?(h=s[n],[4,this.renderNode(h)]):[3,10];case 8:F.sent(),F.label=9;case 9:return n++,[3,7];case 10:i=0,a=t.nonPositionedFloats,F.label=11;case 11:return i<a.length?(h=a[i],[4,this.renderStack(h)]):[3,14];case 12:F.sent(),F.label=13;case 13:return i++,[3,11];case 14:o=0,Q=t.nonPositionedInlineLevel,F.label=15;case 15:return o<Q.length?(h=Q[o],[4,this.renderStack(h)]):[3,18];case 16:F.sent(),F.label=17;case 17:return o++,[3,15];case 18:g=0,w=t.inlineLevel,F.label=19;case 19:return g<w.length?(h=w[g],[4,this.renderNode(h)]):[3,22];case 20:F.sent(),F.label=21;case 21:return g++,[3,19];case 22:f=0,c=t.zeroOrAutoZIndexOrTransformedOrOpacity,F.label=23;case 23:return f<c.length?(h=c[f],[4,this.renderStack(h)]):[3,26];case 24:F.sent(),F.label=25;case 25:return f++,[3,23];case 26:C=0,H=t.positiveZIndex,F.label=27;case 27:return C<H.length?(h=H[C],[4,this.renderStack(h)]):[3,30];case 28:F.sent(),F.label=29;case 29:return C++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(t){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(t.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},A.prototype.formatPath=function(t){var r=this;t.forEach(function(B,n){var s=$(B)?B.start:B;n===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),$(B)&&r.ctx.bezierCurveTo(B.startControl.x,B.startControl.y,B.endControl.x,B.endControl.y,B.end.x,B.end.y)})},A.prototype.renderRepeat=function(t,r,B,n){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(B,n),this.ctx.fill(),this.ctx.translate(-B,-n)},A.prototype.resizeImage=function(t,r,B){var n;if(t.width===r&&t.height===B)return t;var s=(n=this.canvas.ownerDocument)!==null&&n!==void 0?n:document,i=s.createElement("canvas");i.width=Math.max(1,r),i.height=Math.max(1,B);var a=i.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,B),i},A.prototype.renderBackgroundImage=function(t){return P(this,void 0,void 0,function(){var r,B,n,s,i,a;return _(this,function(o){switch(o.label){case 0:r=t.styles.backgroundImage.length-1,B=function(Q){var g,w,f,O,Y,W,L,V,y,c,O,Y,W,L,V,C,H,h,F,K,p,d,l,v,y,E,O,k,q,L,V,CA,Y,W,IA,BA,uA,vA,yA,iA,KA,oA;return _(this,function(TA){switch(TA.label){case 0:if(Q.type!==0)return[3,5];g=void 0,w=Q.url,TA.label=1;case 1:return TA.trys.push([1,3,,4]),[4,n.context.cache.match(w)];case 2:return g=TA.sent(),[3,4];case 3:return TA.sent(),n.context.logger.error("Error loading background-image "+w),[3,4];case 4:return g&&(f=yr(t,r,[g.width,g.height,g.width/g.height]),O=f[0],Y=f[1],W=f[2],L=f[3],V=f[4],y=n.ctx.createPattern(n.resizeImage(g,L,V),"repeat"),n.renderRepeat(O,y,Y,W)),[3,6];case 5:na(Q)?(c=yr(t,r,[null,null,null]),O=c[0],Y=c[1],W=c[2],L=c[3],V=c[4],C=Aa(Q.angle,L,V),H=C[0],h=C[1],F=C[2],K=C[3],p=C[4],d=document.createElement("canvas"),d.width=L,d.height=V,l=d.getContext("2d"),v=l.createLinearGradient(h,K,F,p),pt(Q.stops,H).forEach(function(YA){return v.addColorStop(YA.stop,R(YA.color))}),l.fillStyle=v,l.fillRect(0,0,L,V),L>0&&V>0&&(y=n.ctx.createPattern(d,"repeat"),n.renderRepeat(O,y,Y,W))):sa(Q)&&(E=yr(t,r,[null,null,null]),O=E[0],k=E[1],q=E[2],L=E[3],V=E[4],CA=Q.position.length===0?[zr]:Q.position,Y=b(CA[0],L),W=b(CA[CA.length-1],V),IA=ea(Q,Y,W,L,V),BA=IA[0],uA=IA[1],BA>0&&uA>0&&(vA=n.ctx.createRadialGradient(k+Y,q+W,0,k+Y,q+W,BA),pt(Q.stops,BA*2).forEach(function(YA){return vA.addColorStop(YA.stop,R(YA.color))}),n.path(O),n.ctx.fillStyle=vA,BA!==uA?(yA=t.bounds.left+.5*t.bounds.width,iA=t.bounds.top+.5*t.bounds.height,KA=uA/BA,oA=1/KA,n.ctx.save(),n.ctx.translate(yA,iA),n.ctx.transform(1,0,0,KA,0,0),n.ctx.translate(-yA,-iA),n.ctx.fillRect(k,oA*(q-iA)+iA,L,V*oA),n.ctx.restore()):n.ctx.fill())),TA.label=6;case 6:return r--,[2]}})},n=this,s=0,i=t.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return s<i.length?(a=i[s],[5,B(a)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(t,r,B){return P(this,void 0,void 0,function(){return _(this,function(n){return this.path(eB(B,r)),this.ctx.fillStyle=R(t),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(t,r,B,n){return P(this,void 0,void 0,function(){var s,i;return _(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,B,n)]:[3,2];case 1:return a.sent(),[2];case 2:return s=QQ(n,B),this.path(s),this.ctx.fillStyle=R(t),this.ctx.fill(),i=gQ(n,B),this.path(i),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(t){return P(this,void 0,void 0,function(){var r,B,n,s,i,a,o,Q,g=this;return _(this,function(w){switch(w.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,B=!HA(r.backgroundColor)||r.backgroundImage.length,n=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=EQ(XA(r.backgroundClip,0),t.curves),B||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),HA(r.backgroundColor)||(this.ctx.fillStyle=R(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:w.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){g.ctx.save();var c=We(t.curves),C=f.inset?0:FQ,H=iQ(c,-C+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(g.path(c),g.ctx.clip(),g.mask(H)):(g.mask(c),g.ctx.clip(),g.path(H)),g.ctx.shadowOffsetX=f.offsetX.number+C,g.ctx.shadowOffsetY=f.offsetY.number,g.ctx.shadowColor=R(f.color),g.ctx.shadowBlur=f.blur.number,g.ctx.fillStyle=f.inset?R(f.color):"rgba(0,0,0,1)",g.ctx.fill(),g.ctx.restore()}),w.label=2;case 2:i=0,a=0,o=n,w.label=3;case 3:return a<o.length?(Q=o[a],Q.style!==0&&!HA(Q.color)&&Q.width>0?Q.style!==2?[3,5]:[4,this.renderDashedDottedBorder(Q.color,Q.width,i,t.curves,2)]:[3,11]):[3,13];case 4:return w.sent(),[3,11];case 5:return Q.style!==3?[3,7]:[4,this.renderDashedDottedBorder(Q.color,Q.width,i,t.curves,3)];case 6:return w.sent(),[3,11];case 7:return Q.style!==4?[3,9]:[4,this.renderDoubleBorder(Q.color,Q.width,i,t.curves)];case 8:return w.sent(),[3,11];case 9:return[4,this.renderSolidBorder(Q.color,i,t.curves)];case 10:w.sent(),w.label=11;case 11:i++,w.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(t,r,B,n,s){return P(this,void 0,void 0,function(){var i,a,o,Q,g,w,f,c,C,H,h,F,K,p,d,l,d,l;return _(this,function(v){return this.ctx.save(),i=wQ(n,B),a=eB(n,B),s===2&&(this.path(a),this.ctx.clip()),$(a[0])?(o=a[0].start.x,Q=a[0].start.y):(o=a[0].x,Q=a[0].y),$(a[1])?(g=a[1].end.x,w=a[1].end.y):(g=a[1].x,w=a[1].y),B===0||B===2?f=Math.abs(o-g):f=Math.abs(Q-w),this.ctx.beginPath(),s===3?this.formatPath(i):this.formatPath(a.slice(0,2)),c=r<3?r*3:r*2,C=r<3?r*2:r,s===3&&(c=r,C=r),H=!0,f<=c*2?H=!1:f<=c*2+C?(h=f/(2*c+C),c*=h,C*=h):(F=Math.floor((f+C)/(c+C)),K=(f-F*c)/(F-1),p=(f-(F+1)*c)/F,C=p<=0||Math.abs(C-K)<Math.abs(C-p)?K:p),H&&(s===3?this.ctx.setLineDash([0,c+C]):this.ctx.setLineDash([c,C])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=R(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&($(a[0])&&(d=a[3],l=a[0],this.ctx.beginPath(),this.formatPath([new u(d.end.x,d.end.y),new u(l.start.x,l.start.y)]),this.ctx.stroke()),$(a[1])&&(d=a[1],l=a[2],this.ctx.beginPath(),this.formatPath([new u(d.end.x,d.end.y),new u(l.start.x,l.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(t){return P(this,void 0,void 0,function(){var r;return _(this,function(B){switch(B.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=R(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=oQ(t),[4,this.renderStack(r)];case 1:return B.sent(),this.applyEffects([]),[2,this.canvas]}})})},A})(nn),dQ=function(e){return e instanceof XB||e instanceof NB?!0:e instanceof rt&&e.type!==Pe&&e.type!==Je},EQ=function(e,A){switch(e){case 0:return We(A);case 2:return tQ(A);case 1:default:return Ze(A)}},HQ=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},pQ=["-apple-system","system-ui"],IQ=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(A){return pQ.indexOf(A)===-1}):e},vQ=(function(e){tA(A,e);function A(t,r){var B=e.call(this,t,r)||this;return B.canvas=r.canvas?r.canvas:document.createElement("canvas"),B.ctx=B.canvas.getContext("2d"),B.options=r,B.canvas.width=Math.floor(r.width*r.scale),B.canvas.height=Math.floor(r.height*r.scale),B.canvas.style.width=r.width+"px",B.canvas.style.height=r.height+"px",B.ctx.scale(B.options.scale,B.options.scale),B.ctx.translate(-r.x,-r.y),B.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),B}return A.prototype.render=function(t){return P(this,void 0,void 0,function(){var r,B;return _(this,function(n){switch(n.label){case 0:return r=Jr(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,yQ(r)];case 1:return B=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=R(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(B,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A})(nn),yQ=function(e){return new Promise(function(A,t){var r=new Image;r.onload=function(){A(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},KQ=(function(){function e(A){var t=A.id,r=A.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.debug=="function"||this.info.apply(this,A))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&typeof window!="undefined"&&window.console},e.prototype.warn=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.warn=="function"||this.info.apply(this,A))},e.prototype.error=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.error=="function"||this.info.apply(this,A))},e.instances={},e})(),mQ=(function(){function e(A,t){var r;this.windowBounds=t,this.instanceName="#"+e.instanceCount++,this.logger=new KQ({id:this.instanceName,enabled:A.logging}),this.cache=(r=A.cache)!==null&&r!==void 0?r:new Zo(this,A)}return e.instanceCount=1,e})(),bQ=function(e,A){return A===void 0&&(A={}),LQ(e,A)};typeof window!="undefined"&&$B.setContext(window);var LQ=function(e,A){return P(void 0,void 0,void 0,function(){var t,r,B,n,s,i,a,o,Q,g,w,f,c,C,H,h,F,K,p,d,v,l,v,y,E,O,k,q,L,V,CA,Y,W,IA,BA,uA,vA,yA,iA,KA;return _(this,function(oA){switch(oA.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=e.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return B={allowTaint:(y=A.allowTaint)!==null&&y!==void 0?y:!1,imageTimeout:(E=A.imageTimeout)!==null&&E!==void 0?E:15e3,proxy:A.proxy,useCORS:(O=A.useCORS)!==null&&O!==void 0?O:!1},n=mr({logging:(k=A.logging)!==null&&k!==void 0?k:!0,cache:A.cache},B),s={windowWidth:(q=A.windowWidth)!==null&&q!==void 0?q:r.innerWidth,windowHeight:(L=A.windowHeight)!==null&&L!==void 0?L:r.innerHeight,scrollX:(V=A.scrollX)!==null&&V!==void 0?V:r.pageXOffset,scrollY:(CA=A.scrollY)!==null&&CA!==void 0?CA:r.pageYOffset},i=new cA(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),a=new mQ(n,i),o=(Y=A.foreignObjectRendering)!==null&&Y!==void 0?Y:!1,Q={allowTaint:(W=A.allowTaint)!==null&&W!==void 0?W:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:o,copyStyles:o},a.logger.debug("Starting document clone with size "+i.width+"x"+i.height+" scrolled to "+-i.left+","+-i.top),g=new zt(a,e,Q),w=g.clonedReferenceElement,w?[4,g.toIFrame(t,i)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=oA.sent(),c=tt(w)||bo(w)?sn(w.ownerDocument):je(a,w),C=c.width,H=c.height,h=c.left,F=c.top,K=DQ(a,w,A.backgroundColor),p={canvas:A.canvas,backgroundColor:K,scale:(BA=(IA=A.scale)!==null&&IA!==void 0?IA:r.devicePixelRatio)!==null&&BA!==void 0?BA:1,x:((uA=A.x)!==null&&uA!==void 0?uA:0)+h,y:((vA=A.y)!==null&&vA!==void 0?vA:0)+F,width:(yA=A.width)!==null&&yA!==void 0?yA:Math.ceil(C),height:(iA=A.height)!==null&&iA!==void 0?iA:Math.ceil(H)},o?(a.logger.debug("Document cloned, using foreign object rendering"),v=new vQ(a,p),[4,v.render(w)]):[3,3];case 2:return d=oA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+h+","+F+" with size "+C+"x"+H+" using computed rendering"),a.logger.debug("Starting DOM parsing"),l=PB(a,w),K===l.styles.backgroundColor&&(l.styles.backgroundColor=wA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+p.x+","+p.y+" with size "+p.width+"x"+p.height),v=new hQ(a,p),[4,v.render(l)];case 4:d=oA.sent(),oA.label=5;case 5:return(!((KA=A.removeContainer)!==null&&KA!==void 0)||KA)&&(zt.destroy(f)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,d]}})})},DQ=function(e,A,t){var r=A.ownerDocument,B=r.documentElement?se(e,getComputedStyle(r.documentElement).backgroundColor):wA.TRANSPARENT,n=r.body?se(e,getComputedStyle(r.body).backgroundColor):wA.TRANSPARENT,s=typeof t=="string"?se(e,t):t===null?wA.TRANSPARENT:4294967295;return A===r.documentElement?HA(B)?HA(n)?s:n:B:s};export{bQ as default};
