/*! dom-to-image-more 23-04-2024 (giddy mod) */ !function(s){"use strict";const d=function(){let e=0;return{escape:function(e){return e.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(t){if(t.toBlob)return new Promise(function(e){t.toBlob(e)});return function(i){return new Promise(function(e){var t=u(i.toDataURL().split(",")[1]),n=t.length,o=new Uint8Array(n);for(let e=0;e0<=u.search(e)).length),c.impl.options.useCredentials&&(n.withCredentials=!0),c.impl.options.corsImg&&0===u.indexOf("http")&&-1===u.indexOf(window.location.origin)){var o="POST"===(c.impl.options.corsImg.method||"GET").toUpperCase()?"POST":"GET";n.open(o,(c.impl.options.corsImg.url||"").replace("#{cors}",u),!0);let t=!1;const s=c.impl.options.corsImg.headers||{},l=(Object.keys(s).forEach(function(e){-1!==s[e].indexOf("application/json")&&(t=!0),n.setRequestHeader(e,s[e])}),function(e){try{return JSON.parse(JSON.stringify(e))}catch(e){r("corsImg.data is missing or invalid")}}(c.impl.options.corsImg.data||""));Object.keys(l).forEach(function(e){"string"==typeof l[e]&&(l[e]=l[e].replace("#{cors}",u))}),n.send(t?JSON.stringify(l):l)}else n.open("GET",u,!0),n.send();let i;function r(e){console.error(e),t("")}c.impl.options.imagePlaceholder&&(o=c.impl.options.imagePlaceholder.split(/,/))&&o[1]&&(i=o[1])}));return e.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++},delay:function(n){return function(t){return new Promise(function(e){setTimeout(function(){e(t)},n)})}},asArray:function(t){var n=[],o=t.length;for(let e=0;et.style.removeProperty(e)),["left","right","top","bottom"].forEach(e=>{t.style.getPropertyValue(e)&&t.style.setProperty(e,"0px")})))}e(c,u)}function t(){const l=d.uid();function t(i){const r=m(c,i),s=r.getPropertyValue("content");if(""!==s&&"none"!==s){const t=u.getAttribute("class")||"",n=(u.setAttribute("class",t+" "+l),document.createElement("style"));function e(){const e=`.${l}:`+i,t=(r.cssText?n:o)();return document.createTextNode(e+`{${t}}`);function n(){return`${r.cssText} content: ${s};`}function o(){const e=d.asArray(r).map(t).join("; ");return e+";";function t(e){const t=r.getPropertyValue(e),n=r.getPropertyPriority(e)?" !important":"";return e+": "+t+n}}}n.appendChild(e()),u.appendChild(n)}}[":before",":after"].forEach(function(e){t(e)})}function n(){d.isHTMLTextAreaElement(c)&&(u.innerHTML=c.value),d.isHTMLInputElement(c)&&u.setAttribute("value",c.value)}function o(){d.isSVGElement(u)&&(u.setAttribute("xmlns","http://www.w3.org/2000/svg"),d.isSVGRectElement(u))&&["width","height"].forEach(function(e){const t=u.getAttribute(e);t&&u.style.setProperty(e,t)})}}}(e,i,null,t)}).then(p).then(g).then(function(t){i.bgcolor&&(t.style.backgroundColor=i.bgcolor);i.width&&(t.style.width=i.width+"px");i.height&&(t.style.height=i.height+"px");i.style&&Object.keys(i.style).forEach(function(e){t.style[e]=i.style[e]});let e=null;"function"==typeof i.onclone&&(e=i.onclone(t));return Promise.resolve(e).then(function(){return t})}).then(function(e){let n=i.width||d.width(e),o=i.height||d.height(e);return Promise.resolve(e).then(function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)}).then(d.escapeXhtml).then(function(e){var t=(d.isDimensionMissing(n)?' width="100%"':` width="${n}"`)+(d.isDimensionMissing(o)?' height="100%"':` height="${o}"`);return`${e}`}).then(function(e){return"data:image/svg+xml;charset=utf-8,"+e})}).then(function(e){for(;0{w=null,v={}},2e4)}(),e})}function r(i,r){return f(i,r=r||{}).then(d.makeImage).then(function(e){var t="number"!=typeof r.scale?1:r.scale,n=function(e,t){let n=r.width||d.width(e),o=r.height||d.height(e);d.isDimensionMissing(n)&&(n=d.isDimensionMissing(o)?300:2*o);d.isDimensionMissing(o)&&(o=n/2);e=document.createElement("canvas");e.width=n*t,e.height=o*t,r.bgcolor&&((t=e.getContext("2d")).fillStyle=r.bgcolor,t.fillRect(0,0,e.width,e.height));return e}(i,t),o=n.getContext("2d");return o.msImageSmoothingEnabled=!1,o.imageSmoothingEnabled=!1,e&&(o.scale(t,t),o.drawImage(e,0,0)),n})}let h=null;function p(n){return e.resolveAll().then(function(e){var t;return""!==e&&(t=document.createElement("style"),n.appendChild(t),t.appendChild(document.createTextNode(e))),n})}function g(e){return n.inlineAll(e).then(function(){return e})}function y(e,t,r,s,n){const l=c.impl.options.copyDefaultStyles?function(t,e){var e=function(e){var t=[];do{if(e.nodeType===a){var n=e.tagName;if(t.push(n),E.includes(n))break}}while(e=e.parentNode,e);return t}(e),n=function(e){return("relaxed"!==t.styleCaching?e:e.filter((e,t,n)=>0===t||t===n.length-1)).join(">")}(e);if(v[n])return v[n];var o=function(){if(h)return h.contentWindow;var e=document.characterSet||"UTF-8",t=document.doctype,t=t?(`":"";return(h=document.createElement("iframe")).id="domtoimage-sandbox-"+d.uid(),h.style.visibility="hidden",h.style.position="fixed",document.body.appendChild(h),function(e,t,n,o){try{return e.contentWindow.document.write(t+`${o}`),e.contentWindow}catch(e){}var i=document.createElement("meta");i.setAttribute("charset",n);try{var r=document.implementation.createHTMLDocument(o),s=(r.head.appendChild(i),t+r.documentElement.outerHTML);return e.setAttribute("srcdoc",s),e.contentWindow}catch(e){}return e.contentDocument.head.appendChild(i),e.contentDocument.title=o,e.contentWindow}(h,t,e,"domtoimage-sandbox");function n(e){var t;return e?((t=document.createElement("div")).innerText=e,t.innerHTML):""}}(),e=function(e,t){let n=e.body;do{var o=t.pop(),o=e.createElement(o);n.appendChild(o),n=o}while(0