mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-12 02:17:21 +08:00
6 lines
162 KiB
JavaScript
6 lines
162 KiB
JavaScript
|
(function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A=A||self,A.html2canvas=e())})(this,function(){"use strict";function A(A,e){function t(){this.constructor=A}B(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}function e(A,e,t,r){return new(t||(t=Promise))(function(n,B){function s(A){try{i(r.next(A))}catch(A){B(A)}}function o(A){try{i(r.throw(A))}catch(A){B(A)}}function i(A){A.done?n(A.value):new t(function(e){e(A.value)}).then(s,o)}i((r=r.apply(A,e||[])).next())})}function t(A,e){function t(A){return function(e){return r([A,e])}}function r(t){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,B&&(s=2&t[0]?B.return:t[0]?B.throw||((s=B.return)&&s.call(B),0):B.next)&&!(s=s.call(B,t[1])).done)return s;switch(B=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return i.label++,{value:t[1],done:!1};case 5:i.label++,B=t[1],t=[0];continue;case 7:t=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(6===t[0]||2===t[0])){i=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){i.label=t[1];break}if(6===t[0]&&i.label<s[1]){i.label=s[1],s=t;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(t);break}s[2]&&i.ops.pop(),i.trys.pop();continue}t=e.call(A,i)}catch(A){t=[6,A],B=0}finally{n=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}var n,B,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function r(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}function n(A){return A.type!==l.FUNCTION||Qn[A.name]}for(var B=function(A,e){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])},B(A,e)},s=function(){return s=Object.assign||function(A){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t],e)Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n]);return A},s.apply(this,arguments)},o=function(){function A(A,e,t,r){this.left=A,this.top=e,this.width=t,this.height=r}return A.prototype.add=function(e,t,r,n){return new A(this.left+e,this.top+t,this.width+r,this.height+n)},A.fromClientRect=function(e){return new A(e.left,e.top,e.width,e.height)},A}(),i=function(A){return o.fromClientRect(A.getBoundingClientRect())},a=function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),n=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new o(0,0,r,n)},c=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var B=A.charCodeAt(t++);56320==(64512&B)?e.push(((1023&n)<<10)+(1023&B)+65536):(e.push(n),t--)}else e.push(n)}return e},Q=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,B="";++n<t;){var s=A[n];s<=65535?r.push(s):(s-=65536,r.push(55296+(s>>10),s%1024+56320)),(n+1===t||r.length>16384)&&(B+=String.fromCharCode.apply(String,r),r.length=0)}return B},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w="undefined"==typeof Uint8Array?[]:new Uint8Array(256),U=0;U<u.length;U++)w[u.charCodeAt(U)]=U;var l,C=function(A){var e,t,r,n,B,s=.75*A.length,o=A.length,i=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),c=Array.isArray(a)?a:new Uint8Array(a);for(e=0;e<o;e+=4)t=w[A.charCodeAt(e)],r=w[A.charCodeAt(e+1)],n=w[A.charCodeAt(e+2)],B=w[A.charCodeAt(e+3)],c[i++]=t<<2|r>>4,c[i++]
|
|||
|
}(),y="KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUE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eQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsI
|
|||
|
void 0===e&&(e="strict");var t=[],r=[],n=[];return A.forEach(function(A,B){var s=LA.get(A);if(s>_?(n.push(!0),s-=_):n.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(B),t.push(AA);if(s===z||s===Y){if(0===B)return r.push(B),t.push(UA);var o=t[B-1];return-1===SA.indexOf(o)?(r.push(r[B-1]),t.push(o)):(r.push(B),t.push(UA))}return r.push(B),s===lA?t.push("strict"===e?BA:HA):s===KA?t.push(UA):s===wA?t.push(UA):s===IA?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(HA):t.push(UA):void t.push(s)}),[r,t,n]},PA=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){B++;var s=r[B];if(s===e)return!0;if(s!==W)break}if(n===W)for(B=t;B>0;){B--;var o=r[B];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var i=t;i<=r.length;){i++;s=r[i];if(s===e)return!0;if(s!==W)break}if(o!==W)break}return!1},xA=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==W)return r;t--}return 0},VA=function(A,e,t,r,n){if(0===t[r])return mA;var B=r-1;if(Array.isArray(n)&&!0===n[B])return mA;var s=B-1,o=B+1,i=e[B],a=s>=0?e[s]:0,c=e[o];if(i===x&&c===V)return mA;if(-1!==vA.indexOf(i))return TA;if(-1!==vA.indexOf(c))return mA;if(-1!==DA.indexOf(c))return mA;if(xA(B,e)===G)return RA;if(LA.get(A[B])===Y&&(c===HA||c===CA||c===gA))return mA;if(i===J||c===J)return mA;if(i===k)return mA;if(-1===[W,Z,$].indexOf(i)&&c===k)return mA;if(-1!==[eA,tA,rA,iA,uA].indexOf(c))return mA;if(xA(B,e)===sA)return mA;if(PA(oA,sA,B,e))return mA;if(PA([eA,tA],BA,B,e))return mA;if(PA(q,q,B,e))return mA;if(i===W)return RA;if(i===oA||c===oA)return mA;if(c===AA||i===AA)return RA;if(-1!==[Z,$,BA].indexOf(c)||i===j)return mA;if(a===hA&&-1!==yA.indexOf(i))return mA;if(i===uA&&c===hA)return mA;if(c===nA&&-1!==OA.concat(nA,rA,aA,HA,CA,gA).indexOf(i))return mA;if(-1!==OA.indexOf(c)&&i===aA||-1!==OA.indexOf(i)&&c===aA)return mA;if(i===QA&&-1!==[HA,CA,gA].indexOf(c)||-1!==[HA,CA,gA].indexOf(i)&&c===cA)return mA;if(-1!==OA.indexOf(i)&&-1!==bA.indexOf(c)||-1!==bA.indexOf(i)&&-1!==OA.indexOf(c))return mA;if(-1!==[QA,cA].indexOf(i)&&(c===aA||-1!==[sA,$].indexOf(c)&&e[o+1]===aA)||-1!==[sA,$].indexOf(i)&&c===aA||i===aA&&-1!==[aA,uA,iA].indexOf(c))return mA;if(-1!==[aA,uA,iA,eA,tA].indexOf(c))for(var Q=B;Q>=0;){var u=e[Q];if(u===aA)return mA;if(-1===[uA,iA].indexOf(u))break;Q--}if(-1!==[QA,cA].indexOf(c))for(Q=-1!==[eA,tA].indexOf(i)?s:B;Q>=0;){u=e[Q];if(u===aA)return mA;if(-1===[uA,iA].indexOf(u))break;Q--}if(dA===i&&-1!==[dA,fA,EA,FA].indexOf(c)||-1!==[fA,EA].indexOf(i)&&-1!==[fA,pA].indexOf(c)||-1!==[pA,FA].indexOf(i)&&c===pA)return mA;if(-1!==MA.indexOf(i)&&-1!==[nA,cA].indexOf(c)||-1!==MA.indexOf(c)&&i===QA)return mA;if(-1!==OA.indexOf(i)&&-1!==OA.indexOf(c))return mA;if(i===iA&&-1!==OA.indexOf(c))return mA;if(-1!==OA.concat(aA).indexOf(i)&&c===sA||-1!==OA.concat(aA).indexOf(c)&&i===tA)return mA;if(i===NA&&c===NA){for(var w=t[B],U=1;w>0&&(w--,e[w]===NA);)U++;if(U%2!=0)return mA}return i===CA&&c===gA?mA:RA},zA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=_A(A,e.lineBreak),r=t[0],n=t[1],B=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(n=n.map(function(A){return-1!==[aA,UA,KA].indexOf(A)?HA:A}));var s="keep-all"===e.wordBreak?B.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):void 0;return[r,n,s]},XA=function(){function A(A,e,t,r){this.codePoints=A,this.required=e===TA,this.start=t,this.end=r}return A.prototype.slice=function(){return Q.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),JA=function(A,e){var t=c(A),r=zA(t,e),n=r[0],B=r[1],s=r[2],o=t.length,i=0,a=0;return{next:function(){if(a>=o)return{done:!0,value:null};for(var A=mA;a<o&&(A=VA(t,B,n,++a,s))===mA;);if(A!==mA||a===o){var e=new XA(t,A,i,a);return i=a,{value:e,done:!1}}return{done:!0,value:null}}}};(function(A){A[A.STRING_TOKEN=0]="STRING_TOKEN",A[A.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",A[A.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",A[A.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",A[A.COMMA_TOKEN=4]="COMMA_TOKEN",A[A.HASH_TOKEN=5]="HASH_TOKEN",A[A.DELIM_TOKEN=6]="DELIM_TOK
|
|||
|
A.destroy=function(e){delete A._caches[e]},A.open=function(e){var t=A._caches[e];if(void 0!==t)return t;throw new Error('Cache with key "'+e+'" not found')},A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A.getInstance=function(){var e=A._current;if(null===e)throw new Error("No cache instance attached");return e},A.attachInstance=function(e){A._current=e},A.detachInstance=function(){A._current=null},A._caches={},A._origin="about:blank",A._current=null,A}(),yr=function(){function A(A,e){this.id=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:Jr(A)||Vr(A)?(this._cache[A]=this.loadImage(A),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return e(this,void 0,void 0,function(){var e,r,n,B,s=this;return t(this,function(t){switch(t.label){case 0:return e=Mr.isSameOrigin(A),r=!zr(A)&&!0===this._options.useCORS&&br.SUPPORT_CORS_IMAGES&&!e,n=!zr(A)&&!e&&"string"==typeof this._options.proxy&&br.SUPPORT_CORS_XHR&&!r,e||!1!==this._options.allowTaint||zr(A)||n||r?(B=A,n?[4,this.proxy(B)]:[3,2]):[2];case 1:B=t.sent(),t.label=2;case 2:return Sr.getInstance(this.id).debug("Added image "+A.substring(0,256)),[4,new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(Xr(B)||r)&&(t.crossOrigin="anonymous"),t.src=B,!0===t.complete&&setTimeout(function(){return A(t)},500),s._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,t.sent()]}})})},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var r=A.substring(0,256);return new Promise(function(n,B){var s=br.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;if(o.onload=function(){if(200===o.status)if("text"===s)n(o.response);else{var A=new FileReader;A.addEventListener("load",function(){return n(A.result)},!1),A.addEventListener("error",function(A){return B(A)},!1),A.readAsDataURL(o.response)}else B("Failed to proxy resource "+r+" with status code "+o.status)},o.onerror=B,o.open("GET",t+"?url="+encodeURIComponent(A)+"&responseType="+s),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout){var i=e._options.imageTimeout;o.timeout=i,o.ontimeout=function(){return B("Timed out ("+i+"ms) proxying "+r)}}o.send()})},A}(),_r=/^data:image\/svg\+xml/i,Pr=/^data:image\/.*;base64,/i,xr=/^data:image\/.*/i,Vr=function(A){return br.SUPPORT_SVG_DRAWING||!Gr(A)},zr=function(A){return xr.test(A)},Xr=function(A){return Pr.test(A)},Jr=function(A){return"blob"===A.substr(0,4)},Gr=function(A){return"svg"===A.substr(-3).toLowerCase()||_r.test(A)},kr=function(A){var e=Br(180),t=[],r=lr.LINEAR_GRADIENT,n=nn.CIRCLE,B=Bn.FARTHEST_CORNER,s=[];return Vt(A).forEach(function(A,e){var n=A[0];if(0===e){if(Mt(n)&&"linear"===n.value)return void(r=lr.LINEAR_GRADIENT);if(Mt(n)&&"radial"===n.value)return void(r=lr.RADIAL_GRADIENT)}if(n.type===l.FUNCTION)if("from"===n.name){var B=sr.parse(n.values[0]);t.push({stop:kt,color:B})}else if("to"===n.name){B=sr.parse(n.values[0]);t.push({stop:Yt,color:B})}else if("color-stop"===n.name){var s=n.values.filter(xt);if(2===s.length){B=sr.parse(s[1]);var o=s[0];St(o)&&t.push({stop:{type:l.PERCENTAGE_TOKEN,number:100*o.number,flags:o.flags},color:B})}}}),r===lr.LINEAR_GRADIENT?{angle:(e+Br(180))%Br(360),stops:t,type:r}:{size:B,shape:n,stops:t,position:s,type:r}},Wr="closest-side",Yr="farthest-side",qr="closest-corner",Zr="farthest-corner",jr="circle",$r="ellipse",An="cover",en="contain",tn=function(A){var e=nn.CIRCLE,t=Bn.FARTHEST_CORNER,r=[],n=[];return Vt(A).forEach(function(A,B){var s=!0;if
|
|||
|
;var r=A.contentWindow.document.documentElement?Rs(getComputedStyle(A.contentWindow.document.documentElement).backgroundColor):Ur.TRANSPARENT,n=A.contentWindow.document.body?Rs(getComputedStyle(A.contentWindow.document.body).backgroundColor):Ur.TRANSPARENT;t.backgroundColor=or(r)?or(n)?t.styles.backgroundColor:n:r}}catch(A){}return t}return A(t,e),t}(rs),Os=["OL","UL","MENU"],vs=function(A,e,t){for(var r=A.firstChild,n=void 0;r;r=n)if(n=r.nextSibling,ys(r)&&r.data.trim().length>0)e.textNodes.push(new cs(r,e.styles));else if(_s(r)){var B=Ds(r);B.styles.isVisible()&&(Ss(r,B,t)?B.flags|=4:Ms(B.styles)&&(B.flags|=2),-1!==Os.indexOf(r.tagName)&&(B.flags|=8),e.elements.push(B),$s(r)||Gs(r)||Ao(r)||vs(r,B,t))}},Ds=function(A){return Ys(A)?new Us(A):Ws(A)?new ls(A):Gs(A)?new Cs(A):Vs(A)?new gs(A):zs(A)?new Es(A):Xs(A)?new Is(A):Ao(A)?new Ts(A):$s(A)?new ms(A):qs(A)?new Ls(A):new rs(A)},bs=function(A){var e=Ds(A);return e.flags|=4,vs(A,e,e),e},Ss=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||ks(A)&&t.styles.isTransparent()},Ms=function(A){return A.isPositioned()||A.isFloating()},ys=function(A){return A.nodeType===Node.TEXT_NODE},_s=function(A){return A.nodeType===Node.ELEMENT_NODE},Ps=function(A){return void 0!==A.style},xs=function(A){return"object"==typeof A.className},Vs=function(A){return"LI"===A.tagName},zs=function(A){return"OL"===A.tagName},Xs=function(A){return"INPUT"===A.tagName},Js=function(A){return"HTML"===A.tagName},Gs=function(A){return"svg"===A.tagName},ks=function(A){return"BODY"===A.tagName},Ws=function(A){return"CANVAS"===A.tagName},Ys=function(A){return"IMG"===A.tagName},qs=function(A){return"IFRAME"===A.tagName},Zs=function(A){return"STYLE"===A.tagName},js=function(A){return"SCRIPT"===A.tagName},$s=function(A){return"TEXTAREA"===A.tagName},Ao=function(A){return"SELECT"===A.tagName},eo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},A.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,r=A.counterReset,n=!0;null!==t&&t.forEach(function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(n=!1,t[Math.max(0,t.length-1)]+=A.increment)});var B=[];return n&&r.forEach(function(A){var t=e.counters[A.counter];B.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)}),B},A}(),to={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"]},ro={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},no={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Bo={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},so=function(A,e,t,r,n,B){return A<e||A>t?Fo(A,n,B.length>0):r.integers.reduce(function(e,t,n){for(;A>=t;)A-=t,e+=r.values[n];return e},"")+B},oo=function(A,e,t,r){var n="";do{t||A--,n=r(A)+n,A/=e}while(A*e>=e);return n},io=function(A,e,t,r,n){var B=t-e+1;return(A<0?"-":"")+(oo(Math.abs(A),B,r,function(A){return Q(Math.floor(A%B)+e)})+n)},ao=function(A,e,t){void 0===
|
|||
|
this.ctx.textAlign=fi(e.styles.textAlign),E=oi(e),w=0,e.styles.textAlign){case cB.CENTER:w+=E.width/2;break;case cB.RIGHT:w+=E.width}U=E.add(w,0,0,-E.height/2+1),this.ctx.save(),this.path([new Po(E.left,E.top),new Po(E.left+E.width,E.top),new Po(E.left+E.width,E.top+E.height),new Po(E.left,E.top+E.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new ns(e.value,U),B.letterSpacing),this.ctx.restore(),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"}if(!GB(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(l=e.styles.listStyleImage,l.type!==lr.URL)return[3,18];C=void 0,g=l.url,t.label=15;case 15:return t.trys.push([15,17,,18]),[4,this.options.cache.match(g)];case 16:return C=t.sent(),this.ctx.drawImage(C,e.bounds.left-(C.width+10),e.bounds.top),[3,18];case 17:return t.sent(),Sr.getInstance(this.options.id).error("Error loading list-style-image "+g),[3,18];case 18:return[3,20];case 19:r.listValue&&e.styles.listStyleType!==$n.NONE&&(this.ctx.font=this.createFontStyle(B)[0],this.ctx.fillStyle=ir(B.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",E=new o(e.bounds.left,e.bounds.top+Zt(e.styles.paddingTop,e.bounds.width),e.bounds.width,Zn(B.lineHeight,B.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new ns(r.listValue,E),B.letterSpacing),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),t.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(A){return e(this,void 0,void 0,function(){var e,r,n,B,s,o,i,a,c,Q,u,w,U,l,C;return t(this,function(t){switch(t.label){case 0:return[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:t.sent(),e=0,r=A.negativeZIndex,t.label=2;case 2:return e<r.length?(C=r[e],[4,this.renderStack(C)]):[3,5];case 3:t.sent(),t.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:t.sent(),n=0,B=A.nonInlineLevel,t.label=7;case 7:return n<B.length?(C=B[n],[4,this.renderNode(C)]):[3,10];case 8:t.sent(),t.label=9;case 9:return n++,[3,7];case 10:s=0,o=A.nonPositionedFloats,t.label=11;case 11:return s<o.length?(C=o[s],[4,this.renderStack(C)]):[3,14];case 12:t.sent(),t.label=13;case 13:return s++,[3,11];case 14:i=0,a=A.nonPositionedInlineLevel,t.label=15;case 15:return i<a.length?(C=a[i],[4,this.renderStack(C)]):[3,18];case 16:t.sent(),t.label=17;case 17:return i++,[3,15];case 18:c=0,Q=A.inlineLevel,t.label=19;case 19:return c<Q.length?(C=Q[c],[4,this.renderNode(C)]):[3,22];case 20:t.sent(),t.label=21;case 21:return c++,[3,19];case 22:u=0,w=A.zeroOrAutoZIndexOrTransformedOrOpacity,t.label=23;case 23:return u<w.length?(C=w[u],[4,this.renderStack(C)]):[3,26];case 24:t.sent(),t.label=25;case 25:return u++,[3,23];case 26:U=0,l=A.positiveZIndex,t.label=27;case 27:return U<l.length?(C=l[U],[4,this.renderStack(C)]):[3,30];case 28:t.sent(),t.label=29;case 29:return U++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},A.prototype.formatPath=function(A){var e=this;A.forEach(function(A,t){var r=zo(A)?A.start:A;0===t?e.ctx.moveTo(r.x,r.y):e.ctx.lineTo(r.x,r.y),zo(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},A.prototype.renderRepeat=function(A,e,t,r){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,r),this.ctx.fill(),this.ctx.translate(-t,-r)},A.prototype.resizeImage=function(A,e,t){if(A.width===e&&A.height===t)return A;var r=this.canvas.ownerDocument.createElement("canvas");r.width=e,r.height=t;var n=r.getContext("2d");return n.drawImage(A,0,0,A.width,A.height,0,0,e,t),r},A.prototype.renderBackgroundImage=function(A){return e(this,void 0,void 0,function(){var e,r,n,B,s,o;return t(this,function(i){switch(i.label){case 0:e=A.styles.backgroundImage.length-1,r=function(r){var B
|