HEX
Server: Apache/2.4.65 (Unix) OpenSSL/1.1.1f
System: Linux dsserver6 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
User: studiomoguls (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/studiomoguls/webapps/Studio-mogulsc-clone/wp-content/plugins/arprice/js/html2canvas.js
(function(t,e,n,o,r,i,s){function a(t,e,n,o){return f(t,t,n,o,e).then(function(r){P("Document cloned");var i="["+Ut+"='true']";t.querySelector(i).removeAttribute(Ut);var s=r.contentWindow,a=s.document.querySelector(i),h="function"==typeof e.onclone?Promise.resolve(e.onclone(s.document)):Promise.resolve(!0);return h.then(function(){return c(a,r,e,n,o)})})}function c(t,n,o,r,i){var s=n.contentWindow,a=new Lt(s.document),c=new R(o,a),d=W(t),f="view"===o.type?r:p(s.document),g="view"===o.type?i:l(s.document),m=new Vt(f,g,c,o,e),y=new H(t,m,a,c,o);return y.ready.then(function(){P("Finished rendering");var e;return e="view"===o.type?u(m.canvas,{width:m.canvas.width,height:m.canvas.height,top:0,left:0,x:0,y:0}):t===s.document.body||t===s.document.documentElement||null!=o.canvas?m.canvas:u(m.canvas,{width:null!=o.width?o.width:d.width,height:null!=o.height?o.height:d.height,top:d.top,left:d.left,x:s.pageXOffset,y:s.pageYOffset}),h(n,o),e})}function h(t,e){e.removeContainer&&(t.parentNode.removeChild(t),P("Cleaned up container"))}function u(t,n){var o=e.createElement("canvas"),r=Math.min(t.width-1,Math.max(0,n.left)),i=Math.min(t.width,Math.max(1,n.left+n.width)),s=Math.min(t.height-1,Math.max(0,n.top)),a=Math.min(t.height,Math.max(1,n.top+n.height));return o.width=n.width,o.height=n.height,P("Cropping canvas at:","left:",n.left,"top:",n.top,"width:",i-r,"height:",a-s),P("Resulting crop with width",n.width,"and height",n.height," with x",r,"and y",s),o.getContext("2d").drawImage(t,r,s,i-r,a-s,n.x,n.y,i-r,a-s),o}function p(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function l(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function d(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}function f(t,e,n,o,r){v(t);var i=t.documentElement.cloneNode(!0),s=e.createElement("iframe");return s.className="html2canvas-container",s.style.visibility="hidden",s.style.position="fixed",s.style.left="-10000px",s.style.top="0px",s.style.border="0",s.width=n,s.height=o,s.scrolling="no",e.body.appendChild(s),new Promise(function(e){var n=s.contentWindow.document;s.contentWindow.onload=s.onload=function(){var i=setInterval(function(){n.body.childNodes.length>0&&(w(t,n),clearInterval(i),"view"===r.type&&s.contentWindow.scrollTo(o,a),e(s))},50)};var o=t.defaultView.pageXOffset,a=t.defaultView.pageYOffset;n.open(),n.write("<!DOCTYPE html><html></html>"),g(t,o,a),n.replaceChild(r.javascriptEnabled===!0?n.adoptNode(i):b(n.adoptNode(i)),n.documentElement),n.close()})}function g(t,e,n){e===t.defaultView.pageXOffset&&n===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,n)}function m(e,n,o,r,i,s){return new St(e,n,t.document).then(y(e)).then(function(t){return f(t,o,r,i,s)})}function y(t){return function(n){var o,r=new DOMParser;try{o=r.parseFromString(n,"text/html")}catch(i){P("DOMParser not supported, falling back to createHTMLDocument"),o=e.implementation.createHTMLDocument("");try{o.open(),o.write(n),o.close()}catch(s){P("createHTMLDocument write not supported, falling back to document.body.innerHTML"),o.body.innerHTML=n}}var a=o.querySelector("base");if(!a||!a.href.host){var c=o.createElement("base");c.href=t,o.head.insertBefore(c,o.head.firstChild)}return o}}function v(t){[].slice.call(t.querySelectorAll("canvas"),0).forEach(function(t){t.setAttribute(Xt,"canvas-"+Yt++)})}function w(t,e){[].slice.call(t.querySelectorAll("["+Xt+"]"),0).forEach(function(t){try{var n=e.querySelector("["+Xt+'="'+t.getAttribute(Xt)+'"]');n&&(n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(o){P("Unable to copy canvas content from",t,o)}t.removeAttribute(Xt)})}function b(t){return[].slice.call(t.childNodes,0).filter(x).forEach(function(e){"SCRIPT"===e.tagName?t.removeChild(e):b(e)}),t}function x(t){return t.nodeType===Node.ELEMENT_NODE}function E(t){var n=e.createElement("a");return n.href=t,n.href=n.href,n}function T(t){if(this.src=t,P("DummyImageContainer for",t),!this.promise||!this.image){P("Initiating DummyImageContainer"),T.prototype.image=new Image;var e=this.image;T.prototype.promise=new Promise(function(t,n){e.onload=t,e.onerror=n,e.src=d(),e.complete===!0&&t(e)})}}function C(t,n){var o,r,i=e.createElement("div"),s=e.createElement("img"),a=e.createElement("span"),c="Hidden Text";i.style.visibility="hidden",i.style.fontFamily=t,i.style.fontSize=n,i.style.margin=0,i.style.padding=0,e.body.appendChild(i),s.src=d(),s.width=1,s.height=1,s.style.margin=0,s.style.padding=0,s.style.verticalAlign="baseline",a.style.fontFamily=t,a.style.fontSize=n,a.style.margin=0,a.style.padding=0,a.appendChild(e.createTextNode(c)),i.appendChild(a),i.appendChild(s),o=s.offsetTop-a.offsetTop+1,i.removeChild(a),i.appendChild(e.createTextNode(c)),i.style.lineHeight="normal",s.style.verticalAlign="super",r=s.offsetTop-i.offsetTop+1,e.body.removeChild(i),this.baseline=o,this.lineWidth=1,this.middle=r}function S(){this.data={}}function I(t,e,n){this.image=null,this.src=t;var o=this,r=W(t);this.promise=(e?new Promise(function(e){"about:blank"===t.contentWindow.document.URL||null==t.contentWindow.document.documentElement?t.contentWindow.onload=t.onload=function(){e(t)}:e(t)}):this.proxyLoad(n.proxy,r,n)).then(function(t){return html2canvas(t.contentWindow.document.documentElement,{type:"view",width:t.width,height:t.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return o.image=t})}function k(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=Promise.resolve(!0)}function O(t,e){this.src=t,this.image=new Image;var n=this;this.tainted=null,this.promise=new Promise(function(o,r){n.image.onload=o,n.image.onerror=r,e&&(n.image.crossOrigin="anonymous"),n.image.src=t,n.image.complete===!0&&o(n.image)})}function R(e,n){this.link=null,this.options=e,this.support=n,this.origin=this.getOrigin(t.location.href)}function A(t){k.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse().forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,n=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=n,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(this.stepRegExp);return{color:e[1],stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(n,o){return null!==n.stop?(t.stop=(n.stop-this.colorStops[e-1].stop)/(o+1)+this.colorStops[e-1].stop,!0):!1},this)},this)}function P(){t.html2canvas.logging&&t.console&&t.console.log&&Function.prototype.bind.call(t.console.log,t.console).apply(t.console,[Date.now()-t.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}function M(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function D(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function L(t){return t&&"matrix"===t[1]?t[2].split(",").map(function(t){return parseFloat(t.trim())}):void 0}function _(t){return-1!==t.toString().indexOf("%")}function N(t){var e,n,o,r,i,s,a,c=" \r\n	",h=[],u=0,p=0,l=function(){e&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)),n&&a.push(n),"-"===e.substr(0,1)&&(r=e.indexOf("-",1)+1)>0&&(o=e.substr(0,r),e=e.substr(r)),h.push({prefix:o,method:e.toLowerCase(),value:i,args:a,image:null})),a=[],e=o=n=i=""};return a=[],e=o=n=i="",t.split("").forEach(function(t){if(!(0===u&&c.indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===u)return u=1,void(i+=t);p++;break;case")":if(s)break;if(1===u){if(0===p)return u=0,i+=t,void l();p--}break;case",":if(s)break;if(0===u)return void l();if(1===u&&0===p&&!e.match(/^url$/i))return a.push(n),n="",void(i+=t)}i+=t,0===u?e+=t:n+=t}}),l(),h}function B(t){return t.replace("px","")}function F(t){return parseFloat(t)}function W(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect(),n=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+n,left:e.left,width:n,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}}function j(t){var e=t.offsetParent?j(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}}function H(t,e,n,o,r){P("Starting NodeParser"),this.renderer=e,this.options=r,this.range=null,this.support=n,this.renderQueue=[],this.stack=new Dt(!0,1,t.ownerDocument,null);var i=new M(t,null);if(t===t.ownerDocument.documentElement){var s=new M(this.renderer.isTransparent(i.css("backgroundColor"))?t.ownerDocument.body:t.ownerDocument.documentElement,null);e.rectangle(0,0,e.width,e.height,s.css("backgroundColor"))}i.visibile=i.isElementVisible(),this.createPseudoHideStyles(t.ownerDocument),this.disableAnimations(t.ownerDocument),this.nodes=bt([i].concat(this.getChildren(i)).filter(function(t){return t.visible=t.isElementVisible()}).map(this.getPseudoElements,this)),this.fontMetrics=new S,P("Fetched nodes, total:",this.nodes.length),P("Calculate overflow clips"),this.calculateOverflowClips(),P("Start fetching images"),this.images=o.fetch(this.nodes.filter(pt)),this.ready=this.images.ready.then(mt(function(){return P("Images loaded, starting parsing"),P("Creating stacking contexts"),this.createStackingContexts(),P("Sorting stacking contexts"),this.sortStackingContexts(this.stack),this.parse(this.stack),P("Render queue created with "+this.renderQueue.length+" items"),new Promise(mt(function(t){r.async?"function"==typeof r.async?r.async.call(this,this.renderQueue,t):this.renderQueue.length>0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t():(this.renderQueue.forEach(this.paint,this),t())},this))},this))}function V(t){return t.parent&&t.parent.clip.length}function z(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function U(){}function X(t,e,n,o){return t.map(function(r,i){if(r.width>0){var s=e.left,a=e.top,c=e.width,h=e.height-t[2].width;switch(i){case 0:h=t[0].width,r.args=Q({c1:[s,a],c2:[s+c,a],c3:[s+c-t[1].width,a+h],c4:[s+t[3].width,a+h]},o[0],o[1],n.topLeftOuter,n.topLeftInner,n.topRightOuter,n.topRightInner);break;case 1:s=e.left+e.width-t[1].width,c=t[1].width,r.args=Q({c1:[s+c,a],c2:[s+c,a+h+t[2].width],c3:[s,a+h],c4:[s,a+t[0].width]},o[1],o[2],n.topRightOuter,n.topRightInner,n.bottomRightOuter,n.bottomRightInner);break;case 2:a=a+e.height-t[2].width,h=t[2].width,r.args=Q({c1:[s+c,a+h],c2:[s,a+h],c3:[s+t[3].width,a],c4:[s+c-t[3].width,a]},o[2],o[3],n.bottomRightOuter,n.bottomRightInner,n.bottomLeftOuter,n.bottomLeftInner);break;case 3:c=t[3].width,r.args=Q({c1:[s,a+h+t[2].width],c2:[s,a],c3:[s+c,a+t[0].width],c4:[s+c,a+h]},o[3],o[0],n.bottomLeftOuter,n.bottomLeftInner,n.topLeftOuter,n.topLeftInner)}}return r})}function Y(t,e,n,o){var r=4*((Math.sqrt(2)-1)/3),i=n*r,s=o*r,a=t+n,c=e+o;return{topLeft:q({x:t,y:c},{x:t,y:c-s},{x:a-i,y:e},{x:a,y:e}),topRight:q({x:t,y:e},{x:t+i,y:e},{x:a,y:c-s},{x:a,y:c}),bottomRight:q({x:a,y:e},{x:a,y:e+s},{x:t+i,y:c},{x:t,y:c}),bottomLeft:q({x:a,y:c},{x:a-i,y:c},{x:t,y:e+s},{x:t,y:e})}}function G(t,e,n){var o=t.left,r=t.top,i=t.width,s=t.height,a=e[0][0],c=e[0][1],h=e[1][0],u=e[1][1],p=e[2][0],l=e[2][1],d=e[3][0],f=e[3][1],g=i-h,m=s-l,y=i-p,v=s-f;return{topLeftOuter:Y(o,r,a,c).topLeft.subdivide(.5),topLeftInner:Y(o+n[3].width,r+n[0].width,Math.max(0,a-n[3].width),Math.max(0,c-n[0].width)).topLeft.subdivide(.5),topRightOuter:Y(o+g,r,h,u).topRight.subdivide(.5),topRightInner:Y(o+Math.min(g,i+n[3].width),r+n[0].width,g>i+n[3].width?0:h-n[3].width,u-n[0].width).topRight.subdivide(.5),bottomRightOuter:Y(o+y,r+m,p,l).bottomRight.subdivide(.5),bottomRightInner:Y(o+Math.min(y,i-n[3].width),r+Math.min(m,s+n[0].width),Math.max(0,p-n[1].width),l-n[2].width).bottomRight.subdivide(.5),bottomLeftOuter:Y(o,r+v,d,f).bottomLeft.subdivide(.5),bottomLeftInner:Y(o+n[3].width,r+v,Math.max(0,d-n[3].width),f-n[2].width).bottomLeft.subdivide(.5)}}function q(t,e,n,o){var r=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:t,startControl:e,endControl:n,end:o,subdivide:function(i){var s=r(t,e,i),a=r(e,n,i),c=r(n,o,i),h=r(s,a,i),u=r(a,c,i),p=r(h,u,i);return[q(t,s,h,p),q(p,u,c,o)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,n.x,n.y,o.x,o.y])},curveToReversed:function(o){o.push(["bezierCurve",n.x,n.y,e.x,e.y,t.x,t.y])}}}function Q(t,e,n,o,r,i,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",o[1].start.x,o[1].start.y]),o[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),n[0]>0||n[1]>0?(a.push(["line",i[0].start.x,i[0].start.y]),i[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",r[1].end.x,r[1].end.y]),r[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function $(t,e,n,o,r,i,s){e[0]>0||e[1]>0?(t.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(t),o[1].curveTo(t)):t.push(["line",i,s]),(n[0]>0||n[1]>0)&&t.push(["line",r[0].start.x,r[0].start.y])}function J(t){return t.cssInt("zIndex")<0}function K(t){return t.cssInt("zIndex")>0}function Z(t){return 0===t.cssInt("zIndex")}function tt(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function et(t){return t instanceof Dt}function nt(t){return t.node.data.trim().length>0}function ot(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function rt(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var n=t.css("border"+e+"Radius"),o=n.split(" ");return o.length<=1&&(o[1]=o[0]),o.map(yt)})}function it(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function st(t){var e=t.css("position"),n=-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto";return"auto"!==n}function at(t){return"static"!==t.css("position")}function ct(t){return"none"!==t.css("float")}function ht(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function ut(t){var e=this;return function(){return!t.apply(e,arguments)}}function pt(t){return t.node.nodeType===Node.ELEMENT_NODE}function lt(t){return t.isPseudoElement===!0}function dt(t){return t.node.nodeType===Node.TEXT_NODE}function ft(t){return function(e,n){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(n.cssInt("zIndex")+t.indexOf(n)/t.length)}}function gt(t){return t.getOpacity()<1}function mt(t,e){return function(){return t.apply(e,arguments)}}function yt(t){return parseInt(t,10)}function vt(t){return t.width}function wt(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function bt(t){return[].concat.apply([],t)}function xt(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function Et(e){for(var n,o=[],r=0,i=!1;e.length;)Tt(e[r])===i?(n=e.splice(0,r),n.length&&o.push(t.html2canvas.punycode.ucs2.encode(n)),i=!i,r=0):r++,r>=e.length&&(n=e.splice(0,r),n.length&&o.push(t.html2canvas.punycode.ucs2.encode(n)));return o}function Tt(t){return-1!==[32,13,10,9,45].indexOf(t)}function Ct(t){return/[^\u0000-\u00ff]/.test(t)}function St(t,e,n){var o=Ot(qt),r=Rt(e,t,o);return qt?Ht(r):kt(n,r,o).then(function(t){return Nt(t.content)})}function It(t,e,n){var o=Ot(Qt),r=Rt(e,t,o);return Qt?Promise.resolve(r):kt(n,r,o).then(function(t){return"data:"+t.type+";base64,"+t.content})}function kt(e,n,o){return new Promise(function(r,i){var s=e.createElement("script"),a=function(){delete t.html2canvas.proxy[o],e.body.removeChild(s)};t.html2canvas.proxy[o]=function(t){a(),r(t)},s.src=n,s.onerror=function(t){a(),i(t)},e.body.appendChild(s)})}function Ot(t){return t?"":"html2canvas_"+Date.now()+"_"+ ++Gt+"_"+Math.round(1e5*Math.random())}function Rt(t,e,n){return t+"?url="+encodeURIComponent(e)+(n.length?"&callback=html2canvas.proxy."+n:"")}function At(t,n){var o=(e.createElement("script"),e.createElement("a"));o.href=t,t=o.href,this.src=t,this.image=new Image;var r=this;this.promise=new Promise(function(o,i){r.image.crossOrigin="Anonymous",r.image.onload=o,r.image.onerror=i,new It(t,n,e).then(function(t){r.image.src=t})["catch"](i)})}function Pt(t,e,n){M.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===n}function Mt(t,e,n,o,r){this.width=t,this.height=e,this.images=n,this.options=o,this.document=r}function Dt(t,e,n,o){M.call(this,n,o),this.ownStacking=t,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*e}function Lt(t){this.rangeBounds=this.testRangeBounds(t),this.cors=this.testCORS(),this.svg=this.testSVG()}function _t(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric().then(function(){return e.isInline(t)?Promise.resolve(e.inlineFormatting(t)):Ht(t)}).then(function(t){return new Promise(function(n){html2canvas.fabric.loadSVGFromString(t,e.createCanvas.call(e,n))})})}function Nt(t){var e,n,o,r,i,s,a,c,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=t.length,p="";for(e=0;u>e;e+=4)n=h.indexOf(t[e]),o=h.indexOf(t[e+1]),r=h.indexOf(t[e+2]),i=h.indexOf(t[e+3]),s=n<<2|o>>4,a=(15&o)<<4|r>>2,c=(3&r)<<6|i,p+=64===r?String.fromCharCode(s):64===i||-1===i?String.fromCharCode(s,a):String.fromCharCode(s,a,c);return p}function Bt(t,e){this.src=t,this.image=null;var n=this;this.promise=e?new Promise(function(e,o){n.image=new Image,n.image.onload=e,n.image.onerror=o,n.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),n.image.complete===!0&&e(n.image)}):this.hasFabric().then(function(){return new Promise(function(e){html2canvas.fabric.parseSVGDocument(t,n.createCanvas.call(n,e))})})}function Ft(t,e){M.call(this,t,e)}function Wt(t,e,n){return t.length>0?e+n.toUpperCase():void 0}function jt(t){k.apply(this,arguments),this.type="linear"===t.args[0]?this.TYPES.LINEAR:this.TYPES.RADIAL}function Ht(t){return new Promise(function(e,n){var o=new XMLHttpRequest;o.open("GET",t),o.onload=function(){200===o.status?e(o.responseText):n(new Error(o.statusText))},o.onerror=function(){n(new Error("Network Error"))},o.send()})}function Vt(t,e){Mt.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),this.options.canvas||(this.canvas.width=t,this.canvas.height=e),this.ctx=this.canvas.getContext("2d"),this.options.background&&this.rectangle(0,0,t,e,this.options.background),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},P("Initialized CanvasRenderer with size",t,"x",e)}function zt(t){return t.length>0}if(!function(){var n,o,i,s;!function(){var t={},e={};n=function(e,n,o){t[e]={deps:n,callback:o}},s=i=o=function(n){function r(t){if("."!==t.charAt(0))return t;for(var e=t.split("/"),o=n.split("/").slice(0,-1),r=0,i=e.length;i>r;r++){var s=e[r];if(".."===s)o.pop();else{if("."===s)continue;o.push(s)}}return o.join("/")}if(s._eak_seen=t,e[n])return e[n];if(e[n]={},!t[n])throw new Error("Could not find module "+n);for(var i,a=t[n],c=a.deps,h=a.callback,u=[],p=0,l=c.length;l>p;p++)"exports"===c[p]?u.push(i={}):u.push(o(r(c[p])));var d=h.apply(this,u);return e[n]=i||d}}(),n("promise/all",["./utils","exports"],function(t,e){"use strict";function n(t){var e=this;if(!o(t))throw new TypeError("You must pass an array to all.");return new e(function(e,n){function o(t){return function(e){i(t,e)}}function i(t,n){a[t]=n,0===--c&&e(a)}var s,a=[],c=t.length;0===c&&e([]);for(var h=0;h<t.length;h++)s=t[h],s&&r(s.then)?s.then(o(h),n):i(h,s)})}var o=t.isArray,r=t.isFunction;e.all=n}),n("promise/asap",["exports"],function(n){"use strict";function o(){return function(){process.nextTick(a)}}function i(){var t=0,n=new p(a),o=e.createTextNode("");return n.observe(o,{characterData:!0}),function(){o.data=t=++t%2}}function s(){return function(){l.setTimeout(a,1)}}function a(){for(var t=0;t<d.length;t++){var e=d[t],n=e[0],o=e[1];n(o)}d=[]}function c(t,e){var n=d.push([t,e]);1===n&&h()}var h,u="undefined"!=typeof t?t:{},p=u.MutationObserver||u.WebKitMutationObserver,l="undefined"!=typeof r?r:this,d=[];h="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?o():p?i():s(),n.asap=c}),n("promise/cast",["exports"],function(t){"use strict";function e(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=this;return new e(function(e){e(t)})}t.cast=e}),n("promise/config",["exports"],function(t){"use strict";function e(t,e){return 2!==arguments.length?n[t]:void(n[t]=e)}var n={instrument:!1};t.config=n,t.configure=e}),n("promise/polyfill",["./promise","./utils","exports"],function(e,n,o){"use strict";function r(){var e="Promise"in t&&"cast"in t.Promise&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var e;return new t.Promise(function(t){e=t}),s(e)}();e||(t.Promise=i)}var i=e.Promise,s=n.isFunction;o.polyfill=r}),n("promise/promise",["./config","./utils","./cast","./all","./race","./resolve","./reject","./asap","exports"],function(t,e,n,o,r,i,s,a,c){"use strict";function h(t){if(!E(t))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof h))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],u(t,this)}function u(t,e){function n(t){g(e,t)}function o(t){y(e,t)}try{t(n,o)}catch(r){o(r)}}function p(t,e,n,o){var r,i,s,a,c=E(n);if(c)try{r=n(o),s=!0}catch(h){a=!0,i=h}else r=o,s=!0;f(e,r)||(c&&s?g(e,r):a?y(e,i):t===P?g(e,r):t===M&&y(e,r))}function l(t,e,n,o){var r=t._subscribers,i=r.length;r[i]=e,r[i+P]=n,r[i+M]=o}function d(t,e){for(var n,o,r=t._subscribers,i=t._detail,s=0;s<r.length;s+=3)n=r[s],o=r[s+e],p(e,n,o,i);t._subscribers=null}function f(t,e){var n,o=null;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(x(e)&&(o=e.then,E(o)))return o.call(e,function(o){return n?!0:(n=!0,void(e!==o?g(t,o):m(t,o)))},function(e){return n?!0:(n=!0,void y(t,e))}),!0}catch(r){return n?!0:(y(t,r),!0)}return!1}function g(t,e){t===e?m(t,e):f(t,e)||m(t,e)}function m(t,e){t._state===R&&(t._state=A,t._detail=e,b.async(v,t))}function y(t,e){t._state===R&&(t._state=A,t._detail=e,b.async(w,t))}function v(t){d(t,t._state=P)}function w(t){d(t,t._state=M)}var b=t.config,x=(t.configure,e.objectOrFunction),E=e.isFunction,T=(e.now,n.cast),C=o.all,S=r.race,I=i.resolve,k=s.reject,O=a.asap;b.async=O;var R=void 0,A=0,P=1,M=2;h.prototype={constructor:h,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(t,e){var n=this,o=new this.constructor(function(){});if(this._state){var r=arguments;b.async(function(){p(n._state,o,r[n._state-1],n._detail)})}else l(this,o,t,e);return o},"catch":function(t){return this.then(null,t)}},h.all=C,h.cast=T,h.race=S,h.resolve=I,h.reject=k,c.Promise=h}),n("promise/race",["./utils","exports"],function(t,e){"use strict";function n(t){var e=this;if(!o(t))throw new TypeError("You must pass an array to race.");return new e(function(e,n){for(var o,r=0;r<t.length;r++)o=t[r],o&&"function"==typeof o.then?o.then(e,n):e(o)})}var o=t.isArray;e.race=n}),n("promise/reject",["exports"],function(t){"use strict";function e(t){var e=this;return new e(function(e,n){n(t)})}t.reject=e}),n("promise/resolve",["exports"],function(t){"use strict";function e(t){var e=this;return new e(function(e){e(t)})}t.resolve=e}),n("promise/utils",["exports"],function(t){"use strict";function e(t){return n(t)||"object"==typeof t&&null!==t}function n(t){return"function"==typeof t}function o(t){return"[object Array]"===Object.prototype.toString.call(t)}var r=Date.now||function(){return(new Date).getTime()};t.objectOrFunction=e,t.isFunction=n,t.isArray=o,t.now=r}),o("promise/polyfill").polyfill()}(),"function"!=typeof Object.create||"function"!=typeof e.createElement("canvas").getContext)return void(t.html2canvas=function(){return Promise.reject("No canvas support")});!function(t){function e(t){throw RangeError(L[t])}function s(t,e){for(var n=t.length,o=[];n--;)o[n]=e(t[n]);return o}function a(t,e){var n=t.split("@"),o="";n.length>1&&(o=n[0]+"@",t=n[1]);var r=t.split(D),i=s(r,e).join(".");return o+i}function c(t){for(var e,n,o=[],r=0,i=t.length;i>r;)e=t.charCodeAt(r++),e>=55296&&56319>=e&&i>r?(n=t.charCodeAt(r++),56320==(64512&n)?o.push(((1023&e)<<10)+(1023&n)+65536):(o.push(e),r--)):o.push(e);return o}function h(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=B(t>>>10&1023|55296),t=56320|1023&t),e+=B(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:T}function p(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function l(t,e,n){var o=0;for(t=n?N(t/k):t>>1,t+=N(t/e);t>_*S>>1;o+=T)t=N(t/_);return N(o+(_+1)*t/(t+I))}function d(t){var n,o,r,i,s,a,c,p,d,f,g=[],m=t.length,y=0,v=R,w=O;for(o=t.lastIndexOf(A),0>o&&(o=0),r=0;o>r;++r)t.charCodeAt(r)>=128&&e("not-basic"),g.push(t.charCodeAt(r));for(i=o>0?o+1:0;m>i;){for(s=y,a=1,c=T;i>=m&&e("invalid-input"),p=u(t.charCodeAt(i++)),(p>=T||p>N((E-y)/a))&&e("overflow"),y+=p*a,d=w>=c?C:c>=w+S?S:c-w,!(d>p);c+=T)f=T-d,a>N(E/f)&&e("overflow"),a*=f;n=g.length+1,w=l(y-s,n,0==s),N(y/n)>E-v&&e("overflow"),v+=N(y/n),y%=n,g.splice(y++,0,v)}return h(g)}function f(t){var n,o,r,i,s,a,h,u,d,f,g,m,y,v,w,b=[];for(t=c(t),m=t.length,n=R,o=0,s=O,a=0;m>a;++a)g=t[a],128>g&&b.push(B(g));for(r=i=b.length,i&&b.push(A);m>r;){for(h=E,a=0;m>a;++a)g=t[a],g>=n&&h>g&&(h=g);for(y=r+1,h-n>N((E-o)/y)&&e("overflow"),o+=(h-n)*y,n=h,a=0;m>a;++a)if(g=t[a],n>g&&++o>E&&e("overflow"),g==n){for(u=o,d=T;f=s>=d?C:d>=s+S?S:d-s,!(f>u);d+=T)w=u-f,v=T-f,b.push(B(p(f+w%v,0))),u=N(w/v);b.push(B(p(u,0))),s=l(o,y,r==i),o=0,++r}++o,++n}return b.join("")}function g(t){return a(t,function(t){return P.test(t)?d(t.slice(4).toLowerCase()):t})}function m(t){return a(t,function(t){return M.test(t)?"xn--"+f(t):t})}var y="object"==typeof o&&o&&!o.nodeType&&o,v="object"==typeof n&&n&&!n.nodeType&&n,w="object"==typeof r&&r;w.global!==w&&w.window!==w&&w.self!==w||(t=w);var b,x,E=2147483647,T=36,C=1,S=26,I=38,k=700,O=72,R=128,A="-",P=/^xn--/,M=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=T-C,N=Math.floor,B=String.fromCharCode;if(b={version:"1.3.1",ucs2:{decode:c,encode:h},decode:d,encode:f,toASCII:m,toUnicode:g},"function"==typeof i&&"object"==typeof i.amd&&i.amd)i("punycode",function(){return b});else if(y&&v)if(n.exports==y)v.exports=b;else for(x in b)b.hasOwnProperty(x)&&(y[x]=b[x]);else t.punycode=b}(this);var Ut="data-html2canvas-node",Xt="data-html2canvas-canvas-clone",Yt=0;t.html2canvas=function(n,o){if(o=o||{},o.logging&&(t.html2canvas.logging=!0,t.html2canvas.start=Date.now()),o.async="undefined"==typeof o.async?!0:o.async,o.allowTaint="undefined"==typeof o.allowTaint?!1:o.allowTaint,o.removeContainer="undefined"==typeof o.removeContainer?!0:o.removeContainer,o.javascriptEnabled="undefined"==typeof o.javascriptEnabled?!1:o.javascriptEnabled,o.imageTimeout="undefined"==typeof o.imageTimeout?1e4:o.imageTimeout,"string"==typeof n)return"string"!=typeof o.proxy?Promise.reject("Proxy must be used when rendering url"):m(E(n),o.proxy,e,t.innerWidth,t.innerHeight,o).then(function(e){return c(e.contentWindow.document.documentElement,e,o,t.innerWidth,t.innerHeight)});var r=(n===s?[e.documentElement]:n.length?n:[n])[0];return r.setAttribute(Ut,"true"),a(r.ownerDocument,o,r.ownerDocument.defaultView.innerWidth,r.ownerDocument.defaultView.innerHeight).then(function(t){return"function"==typeof o.onrendered&&(P("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),o.onrendered(t)),t})},t.html2canvas.punycode=this.punycode,t.html2canvas.proxy={},S.prototype.getMetrics=function(t,e){return this.data[t+"-"+e]===s&&(this.data[t+"-"+e]=new C(t,e)),this.data[t+"-"+e]},I.prototype.proxyLoad=function(t,e,n){var o=this.src;return m(o.src,t,o.ownerDocument,e.width,e.height,n)},k.prototype.TYPES={LINEAR:1,RADIAL:2},R.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this),e},R.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this),t},R.prototype.addImage=function(t,e){return function(n){n.args.forEach(function(o){this.imageExists(t,o)||(t.splice(0,0,e.call(this,n)),P("Added image #"+t.length,"string"==typeof o?o.substring(0,100):o))},this)}},R.prototype.hasImageBackground=function(t){return"none"!==t.method},R.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new O(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||this.options.allowTaint===!0||this.isSVG(e)?new O(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new O(e,!0):this.options.proxy?new At(e,this.options.proxy):new T(e):new _t(e)}return"linear-gradient"===t.method?new A(t):"gradient"===t.method?new jt(t):"svg"===t.method?new Bt(t.args[0],this.support.svg):"IFRAME"===t.method?new I(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new T(t)},R.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase()||_t.prototype.isInline(t)},R.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})},R.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin},R.prototype.getOrigin=function(t){var n=this.link||(this.link=e.createElement("a"));return n.href=t,n.href=n.href,n.protocol+n.hostname+n.port},R.prototype.getPromise=function(t){return this.timeout(t,this.options.imageTimeout)["catch"](function(){var e=new T(t.src);return e.promise.then(function(e){t.image=e})})},R.prototype.get=function(t){var e=null;return this.images.some(function(n){return(e=n).src===t})?e:null},R.prototype.fetch=function(t){return this.images=t.reduce(mt(this.findBackgroundImage,this),this.findImages(t)),this.images.forEach(function(t,e){t.promise.then(function(){P("Succesfully loaded image #"+(e+1),t)},function(n){P("Failed loading image #"+(e+1),t,n)})}),this.ready=Promise.all(this.images.map(this.getPromise,this)),P("Finished searching images"),this},R.prototype.timeout=function(t,e){var n;return Promise.race([t.promise,new Promise(function(o,r){n=setTimeout(function(){P("Timed out loading image",t),r(t)},e)})]).then(function(t){return clearTimeout(n),t})},A.prototype=Object.create(k.prototype),A.prototype.stepRegExp=/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/,M.prototype.cloneTo=function(t){
t.visible=this.visible,t.borders=this.borders,t.bounds=this.bounds,t.clip=this.clip,t.backgroundClip=this.backgroundClip,t.computedStyles=this.computedStyles,t.styles=this.styles,t.backgroundImages=this.backgroundImages,t.opacity=this.opacity},M.prototype.getOpacity=function(){return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},M.prototype.assignStack=function(t){this.stack=t,t.children.push(this)},M.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},M.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[t]||(this.styles[t]=this.computedStyles[t])},M.prototype.prefixedCss=function(t){var e=["webkit","moz","ms","o"],n=this.css(t);return n===s&&e.some(function(e){return n=this.css(e+t.substr(0,1).toUpperCase()+t.substr(1)),n!==s},this),n===s?null:n},M.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)},M.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e},M.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e},M.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal"}return t},M.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null},M.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=N(this.css("backgroundImage")))},M.prototype.cssList=function(t,e){var n=(this.css(t)||"").split(",");return n=n[e||0]||n[0]||"auto",n=n.trim().split(" "),1===n.length&&(n=[n[0],n[0]]),n},M.prototype.parseBackgroundSize=function(t,e,n){var o,r,i=this.cssList("backgroundSize",n);if(_(i[0]))o=t.width*parseFloat(i[0])/100;else{if(/contain|cover/.test(i[0])){var s=t.width/t.height,a=e.width/e.height;return a>s^"contain"===i[0]?{width:t.height*a,height:t.height}:{width:t.width,height:t.width/a}}o=parseInt(i[0],10)}return r="auto"===i[0]&&"auto"===i[1]?e.height:"auto"===i[1]?o/e.width*e.height:_(i[1])?t.height*parseFloat(i[1])/100:parseInt(i[1],10),"auto"===i[0]&&(o=r/e.height*e.width),{width:o,height:r}},M.prototype.parseBackgroundPosition=function(t,e,n,o){var r,i,s=this.cssList("backgroundPosition",n);return r=_(s[0])?(t.width-(o||e).width)*(parseFloat(s[0])/100):parseInt(s[0],10),i="auto"===s[1]?r/e.width*e.height:_(s[1])?(t.height-(o||e).height)*parseFloat(s[1])/100:parseInt(s[1],10),"auto"===s[0]&&(r=i/e.height*e.width),{left:r,top:i}},M.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]},M.prototype.parseTextShadows=function(){var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var n=t.match(this.TEXT_SHADOW_PROPERTY),o=0;n&&o<n.length;o++){var r=n[o].match(this.TEXT_SHADOW_VALUES);e.push({color:r[0],offsetX:r[1]?parseFloat(r[1].replace("px","")):0,offsetY:r[2]?parseFloat(r[2].replace("px","")):0,blur:r[3]?r[3].replace("px",""):0})}return e},M.prototype.parseTransform=function(){if(!this.transformData)if(this.hasTransform()){var t=this.parseBounds(),e=this.prefixedCss("transformOrigin").split(" ").map(B).map(F);e[0]+=t.left,e[1]+=t.top,this.transformData={origin:e,matrix:this.parseTransformMatrix()}}else this.transformData={origin:[0,0],matrix:[1,0,0,1,0,0]};return this.transformData},M.prototype.parseTransformMatrix=function(){if(!this.transformMatrix){var t=this.prefixedCss("transform"),e=t?L(t.match(this.MATRIX_PROPERTY)):null;this.transformMatrix=e?e:[1,0,0,1,0,0]}return this.transformMatrix},M.prototype.parseBounds=function(){return this.bounds||(this.bounds=this.hasTransform()?j(this.node):W(this.node))},M.prototype.hasTransform=function(){return"1,0,0,1,0,0"!==this.parseTransformMatrix().join(",")||this.parent&&this.parent.hasTransform()},M.prototype.getValue=function(){var t=this.node.value||"";return t="SELECT"===this.node.tagName?D(this.node):t,0===t.length?this.node.placeholder||"":t},M.prototype.MATRIX_PROPERTY=/(matrix)\((.+)\)/,M.prototype.TEXT_SHADOW_PROPERTY=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g,M.prototype.TEXT_SHADOW_VALUES=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g,M.prototype.CLIP=/^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/,H.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(pt(t)){lt(t)&&t.appendToDOM(),t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],n=t.parseClip();n&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push([["rect",t.bounds.left+n.left,t.bounds.top+n.top,n.right-n.left,n.bottom-n.top]]),t.clip=V(t)?t.parent.clip.concat(e):e,t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip,lt(t)&&t.cleanDOM()}else dt(t)&&(t.clip=V(t)?t.parent.clip:[]);lt(t)||(t.bounds=null)},this)},H.prototype.asyncRenderer=function(t,e,n){n=n||Date.now(),this.paint(t[this.renderIndex++]),t.length===this.renderIndex?e():n+20>Date.now()?this.asyncRenderer(t,e,n):setTimeout(mt(function(){this.asyncRenderer(t,e)},this),0)},H.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+Pt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+Pt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},H.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},H.prototype.createStyles=function(t,e){var n=t.createElement("style");n.innerHTML=e,t.body.appendChild(n)},H.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var n=this.getPseudoElement(t,":before"),o=this.getPseudoElement(t,":after");n&&e.push(n),o&&e.push(o)}return bt(e)},H.prototype.getPseudoElement=function(t,n){var o=t.computedStyle(n);if(!o||!o.content||"none"===o.content||"-moz-alt-content"===o.content||"none"===o.display)return null;for(var r=xt(o.content),i="url"===r.substr(0,3),s=e.createElement(i?"img":"html2canvaspseudoelement"),a=new Pt(s,t,n),c=o.length-1;c>=0;c--){var h=z(o.item(c));s.style[h]=o[h]}if(s.className=Pt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+Pt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return s.src=N(r)[0].args[0],[a];var u=e.createTextNode(r);return s.appendChild(u),[a,new Ft(u,a)]},H.prototype.getChildren=function(t){return bt([].filter.call(t.node.childNodes,it).map(function(e){var n=[e.nodeType===Node.TEXT_NODE?new Ft(e,t):new M(e,t)].filter(wt);return e.nodeType===Node.ELEMENT_NODE&&n.length&&"TEXTAREA"!==e.tagName?n[0].isElementVisible()?n.concat(this.getChildren(n[0])):[]:n},this))},H.prototype.newStackingContext=function(t,e){var n=new Dt(e,t.getOpacity(),t.node,t.parent);t.cloneTo(n);var o=e?n.getParentStack(this):n.parent.stack;o.contexts.push(n),t.stack=n},H.prototype.createStackingContexts=function(){this.nodes.forEach(function(t){pt(t)&&(this.isRootElement(t)||gt(t)||st(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform())?this.newStackingContext(t,!0):pt(t)&&(at(t)&&Z(t)||ht(t)||ct(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack)},this)},H.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&this.renderer.isTransparent(t.parent.css("backgroundColor"))},H.prototype.isRootElement=function(t){return null===t.parent},H.prototype.sortStackingContexts=function(t){t.contexts.sort(ft(t.contexts.slice(0))),t.contexts.forEach(this.sortStackingContexts,this)},H.prototype.parseTextBounds=function(t){return function(e,n,o){if("none"!==t.parent.css("textDecoration").substr(0,4)||0!==e.trim().length){if(this.support.rangeBounds&&!t.parent.hasTransform()){var r=o.slice(0,n).join("").length;return this.getRangeBounds(t.node,r,e.length)}if(t.node&&"string"==typeof t.node.data){var i=t.node.splitText(e.length),s=this.getWrapperBounds(t.node,t.parent.hasTransform());return t.node=i,s}}else this.support.rangeBounds&&!t.parent.hasTransform()||(t.node=t.node.splitText(e.length));return{}}},H.prototype.getWrapperBounds=function(t,e){var n=t.ownerDocument.createElement("html2canvaswrapper"),o=t.parentNode,r=t.cloneNode(!0);n.appendChild(t.cloneNode(!0)),o.replaceChild(n,t);var i=e?j(n):W(n);return o.replaceChild(r,n),i},H.prototype.getRangeBounds=function(t,e,n){var o=this.range||(this.range=t.ownerDocument.createRange());return o.setStart(t,e),o.setEnd(t,e+n),o.getBoundingClientRect()},H.prototype.parse=function(t){var e=t.contexts.filter(J),n=t.children.filter(pt),o=n.filter(ut(ct)),r=o.filter(ut(at)).filter(ut(tt)),i=n.filter(ut(at)).filter(ct),s=o.filter(ut(at)).filter(tt),a=t.contexts.concat(o.filter(at)).filter(Z),c=t.children.filter(dt).filter(nt),h=t.contexts.filter(K);e.concat(r).concat(i).concat(s).concat(a).concat(c).concat(h).forEach(function(t){this.renderQueue.push(t),et(t)&&(this.parse(t),this.renderQueue.push(new U))},this)},H.prototype.paint=function(t){try{t instanceof U?this.renderer.ctx.restore():dt(t)?(lt(t.parent)&&t.parent.appendToDOM(),this.paintText(t),lt(t.parent)&&t.parent.cleanDOM()):this.paintNode(t)}catch(e){P(e)}},H.prototype.paintNode=function(t){et(t)&&(this.renderer.setOpacity(t.opacity),this.renderer.ctx.save(),t.hasTransform()&&this.renderer.setTransform(t.parseTransform())),"INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t)},H.prototype.paintElement=function(t){var e=t.parseBounds();this.renderer.clip(t.backgroundClip,function(){this.renderer.renderBackground(t,e,t.borders.borders.map(vt))},this),this.renderer.clip(t.clip,function(){this.renderer.renderBorders(t.borders.borders)},this),this.renderer.clip(t.backgroundClip,function(){switch(t.node.nodeName){case"svg":case"IFRAME":var n=this.images.get(t.node);n?this.renderer.renderImage(t,e,t.borders,n):P("Error loading <"+t.node.nodeName+">",t.node);break;case"IMG":var o=this.images.get(t.node.src);o?this.renderer.renderImage(t,e,t.borders,o):P("Error loading <img>",t.node.src);break;case"CANVAS":this.renderer.renderImage(t,e,t.borders,{image:t.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(t)}},this)},H.prototype.paintCheckbox=function(t){var e=t.parseBounds(),n=Math.min(e.width,e.height),o={width:n-1,height:n-1,top:e.top,left:e.left},r=[3,3],i=[r,r,r,r],s=[1,1,1,1].map(function(t){return{color:"#A5A5A5",width:t}}),a=G(o,i,s);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(o.left+1,o.top+1,o.width-2,o.height-2,"#DEDEDE"),this.renderer.renderBorders(X(s,o,a,i)),t.node.checked&&(this.renderer.font("#424242","normal","normal","bold",n-3+"px","arial"),this.renderer.text("?",o.left+n/6,o.top+n-1))},this)},H.prototype.paintRadio=function(t){var e=t.parseBounds(),n=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,n,"#DEDEDE",1,"#A5A5A5"),t.node.checked&&this.renderer.circle(Math.ceil(e.left+n/4)+1,Math.ceil(e.top+n/4)+1,Math.floor(n/2),"#424242")},this)},H.prototype.paintFormValue=function(t){if(t.getValue().length>0){var e=t.node.ownerDocument,n=e.createElement("html2canvaswrapper"),o=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];o.forEach(function(e){try{n.style[e]=t.css(e)}catch(o){P("html2canvas: Parse: Exception caught in renderFormValue: "+o.message)}});var r=t.parseBounds();n.style.position="fixed",n.style.left=r.left+"px",n.style.top=r.top+"px",n.textContent=t.getValue(),e.body.appendChild(n),this.paintText(new Ft(n.firstChild,t)),e.body.removeChild(n)}},H.prototype.paintText=function(e){e.applyTextTransform();var n=t.html2canvas.punycode.ucs2.decode(e.node.data),o=this.options.letterRendering&&!ot(e)||Ct(e.node.data)?n.map(function(e){return t.html2canvas.punycode.ucs2.encode([e])}):Et(n),r=e.parent.fontWeight(),i=e.parent.css("fontSize"),s=e.parent.css("fontFamily"),a=e.parent.parseTextShadows();this.renderer.font(e.parent.css("color"),e.parent.css("fontStyle"),e.parent.css("fontVariant"),r,i,s),a.length?this.renderer.fontShadow(a[0].color,a[0].offsetX,a[0].offsetY,a[0].blur):this.renderer.clearShadow(),this.renderer.clip(e.parent.clip,function(){o.map(this.parseTextBounds(e),this).forEach(function(t,n){t&&(this.renderer.text(o[n],t.left,t.bottom),this.renderTextDecoration(e.parent,t,this.fontMetrics.getMetrics(s,i)))},this)},this)},H.prototype.renderTextDecoration=function(t,e,n){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+n.baseline+n.lineWidth),e.width,1,t.css("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.css("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+n.middle+n.lineWidth),e.width,1,t.css("color"))}},H.prototype.parseBorders=function(t){var e=t.parseBounds(),n=rt(t),o=["Top","Right","Bottom","Left"].map(function(e){return{width:t.cssInt("border"+e+"Width"),color:t.css("border"+e+"Color"),args:null}}),r=G(e,n,o);return{clip:this.parseBackgroundClip(t,r,o,n,e),borders:X(o,e,r,n)}},H.prototype.parseBackgroundClip=function(t,e,n,o,r){var i=t.css("backgroundClip"),s=[];switch(i){case"content-box":case"padding-box":$(s,o[0],o[1],e.topLeftInner,e.topRightInner,r.left+n[3].width,r.top+n[0].width),$(s,o[1],o[2],e.topRightInner,e.bottomRightInner,r.left+r.width-n[1].width,r.top+n[0].width),$(s,o[2],o[3],e.bottomRightInner,e.bottomLeftInner,r.left+r.width-n[1].width,r.top+r.height-n[2].width),$(s,o[3],o[0],e.bottomLeftInner,e.topLeftInner,r.left+n[3].width,r.top+r.height-n[2].width);break;default:$(s,o[0],o[1],e.topLeftOuter,e.topRightOuter,r.left,r.top),$(s,o[1],o[2],e.topRightOuter,e.bottomRightOuter,r.left+r.width,r.top),$(s,o[2],o[3],e.bottomRightOuter,e.bottomLeftOuter,r.left+r.width,r.top+r.height),$(s,o[3],o[0],e.bottomLeftOuter,e.topLeftOuter,r.left,r.top+r.height)}return s};var Gt=0,qt="withCredentials"in new XMLHttpRequest,Qt="crossOrigin"in new Image;Pt.prototype.cloneTo=function(t){Pt.prototype.cloneTo.call(this,t),t.isPseudoElement=!0,t.before=this.before},Pt.prototype=Object.create(M.prototype),Pt.prototype.appendToDOM=function(){this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass()},Pt.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")},Pt.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},Pt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",Pt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",Mt.prototype.renderImage=function(t,e,n,o){var r=t.cssInt("paddingLeft"),i=t.cssInt("paddingTop"),s=t.cssInt("paddingRight"),a=t.cssInt("paddingBottom"),c=n.borders,h=e.width-(c[1].width+c[3].width+r+s),u=e.height-(c[0].width+c[2].width+i+a);this.drawImage(o,0,0,o.image.width||h,o.image.height||u,e.left+r+c[3].width,e.top+i+c[0].width,h,u)},Mt.prototype.renderBackground=function(t,e,n){e.height>0&&e.width>0&&(this.renderBackgroundColor(t,e),this.renderBackgroundImage(t,e,n))},Mt.prototype.renderBackgroundColor=function(t,e){var n=t.css("backgroundColor");this.isTransparent(n)||this.rectangle(e.left,e.top,e.width,e.height,t.css("backgroundColor"))},Mt.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)},Mt.prototype.renderBorder=function(t){this.isTransparent(t.color)||null===t.args||this.drawShape(t.args,t.color)},Mt.prototype.renderBackgroundImage=function(t,e,n){var o=t.parseBackgroundImages();o.reverse().forEach(function(o,r,i){switch(o.method){case"url":var s=this.images.get(o.args[0]);s?this.renderBackgroundRepeating(t,e,s,i.length-(r+1),n):P("Error loading background-image",o.args[0]);break;case"linear-gradient":case"gradient":var a=this.images.get(o.value);a?this.renderBackgroundGradient(a,e,n):P("Error loading background-image",o.args[0]);break;case"none":break;default:P("Unknown background-image type",o.args[0])}},this)},Mt.prototype.renderBackgroundRepeating=function(t,e,n,o,r){var i=t.parseBackgroundSize(e,n.image,o),s=t.parseBackgroundPosition(e,n.image,o,i),a=t.parseBackgroundRepeat(o);switch(a){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(n,s,i,e,e.left+r[3],e.top+s.top+r[0],99999,i.height,r);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(n,s,i,e,e.left+s.left+r[3],e.top+r[0],i.width,99999,r);break;case"no-repeat":this.backgroundRepeatShape(n,s,i,e,e.left+s.left+r[3],e.top+s.top+r[0],i.width,i.height,r);break;default:this.renderBackgroundRepeat(n,s,i,{top:e.top,left:e.left},r[3],r[0])}},Mt.prototype.isTransparent=function(t){return!t||"transparent"===t||"rgba(0, 0, 0, 0)"===t},Dt.prototype=Object.create(M.prototype),Dt.prototype.getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack},Lt.prototype.testRangeBounds=function(t){var e,n,o,r,i=!1;return t.createRange&&(e=t.createRange(),e.getBoundingClientRect&&(n=t.createElement("boundtest"),n.style.height="123px",n.style.display="block",t.body.appendChild(n),e.selectNode(n),o=e.getBoundingClientRect(),r=o.height,123===r&&(i=!0),t.body.removeChild(n))),i},Lt.prototype.testCORS=function(){return"undefined"!=typeof(new Image).crossOrigin},Lt.prototype.testSVG=function(){var t=new Image,n=e.createElement("canvas"),o=n.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{o.drawImage(t,0,0),n.toDataURL()}catch(r){return!1}return!0},_t.prototype.hasFabric=function(){return html2canvas.fabric?Promise.resolve():Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},_t.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)},_t.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")},_t.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)},_t.prototype.createCanvas=function(t){var e=this;return function(n,o){var r=new html2canvas.fabric.StaticCanvas("c");e.image=r.lowerCanvasEl,r.setWidth(o.width).setHeight(o.height).add(html2canvas.fabric.util.groupSVGElements(n,o)).renderAll(),t(r.lowerCanvasEl)}},_t.prototype.decode64=function(e){return"function"==typeof t.atob?t.atob(e):Nt(e)},Bt.prototype=Object.create(_t.prototype),Ft.prototype=Object.create(M.prototype),Ft.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))},Ft.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,Wt);case"uppercase":return e.toUpperCase();default:return e}},jt.prototype=Object.create(k.prototype),Vt.prototype=Object.create(Mt.prototype),Vt.prototype.setFillStyle=function(t){return this.ctx.fillStyle=t,this.ctx},Vt.prototype.rectangle=function(t,e,n,o,r){this.setFillStyle(r).fillRect(t,e,n,o)},Vt.prototype.circle=function(t,e,n,o){this.setFillStyle(o),this.ctx.beginPath(),this.ctx.arc(t+n/2,e+n/2,n/2,0,2*Math.PI,!0),this.ctx.closePath(),this.ctx.fill()},Vt.prototype.circleStroke=function(t,e,n,o,r,i){this.circle(t,e,n,o),this.ctx.strokeStyle=i,this.ctx.stroke()},Vt.prototype.drawShape=function(t,e){this.shape(t),this.setFillStyle(e).fill()},Vt.prototype.taints=function(t){if(null===t.tainted){this.taintCtx.drawImage(t.image,0,0);try{this.taintCtx.getImageData(0,0,1,1),t.tainted=!1}catch(n){this.taintCtx=e.createElement("canvas").getContext("2d"),t.tainted=!0}}return t.tainted},Vt.prototype.drawImage=function(t,e,n,o,r,i,s,a,c){this.taints(t)&&!this.options.allowTaint||this.ctx.drawImage(t.image,e,n,o,r,i,s,a,c)},Vt.prototype.clip=function(t,e,n){this.ctx.save(),t.filter(zt).forEach(function(t){this.shape(t).clip()},this),e.call(n),this.ctx.restore()},Vt.prototype.shape=function(t){return this.ctx.beginPath(),t.forEach(function(t,e){"rect"===t[0]?this.ctx.rect.apply(this.ctx,t.slice(1)):this.ctx[0===e?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1))},this),this.ctx.closePath(),this.ctx},Vt.prototype.font=function(t,e,n,o,r,i){this.setFillStyle(t).font=[e,n,o,r,i].join(" ").split(",")[0]},Vt.prototype.fontShadow=function(t,e,n,o){this.setVariable("shadowColor",t).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",n).setVariable("shadowBlur",o)},Vt.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)")},Vt.prototype.setOpacity=function(t){this.ctx.globalAlpha=t},Vt.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]),this.ctx.transform.apply(this.ctx,t.matrix),this.ctx.translate(-t.origin[0],-t.origin[1])},Vt.prototype.setVariable=function(t,e){return this.variables[t]!==e&&(this.variables[t]=this.ctx[t]=e),this},Vt.prototype.text=function(t,e,n){this.ctx.fillText(t,e,n)},Vt.prototype.backgroundRepeatShape=function(t,e,n,o,r,i,s,a,c){var h=[["line",Math.round(r),Math.round(i)],["line",Math.round(r+s),Math.round(i)],["line",Math.round(r+s),Math.round(a+i)],["line",Math.round(r),Math.round(a+i)]];this.clip([h],function(){this.renderBackgroundRepeat(t,e,n,o,c[3],c[0])},this)},Vt.prototype.renderBackgroundRepeat=function(t,e,n,o,r,i){var s=Math.round(o.left+e.left+r),a=Math.round(o.top+e.top+i);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,n),"repeat")),this.ctx.translate(s,a),this.ctx.fill(),this.ctx.translate(-s,-a)},Vt.prototype.renderBackgroundGradient=function(t,e){if(t instanceof A){var n=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){n.addColorStop(t.stop,t.color)}),this.rectangle(e.left,e.top,e.width,e.height,n)}},Vt.prototype.resizeImage=function(t,n){var o=t.image;if(o.width===n.width&&o.height===n.height)return o;var r,i=e.createElement("canvas");return i.width=n.width,i.height=n.height,r=i.getContext("2d"),r.drawImage(o,0,0,o.width,o.height,0,0,n.width,n.height),i}}).call({},window,document);