"use strict";(globalThis.webpackChunksimple_history=globalThis.webpackChunksimple_history||[]).push([[600],{455:(e,t,i)=>{i.d(t,{a:()=>l});var n=i(887);function a(e){let t=function(e){let t=[],i="",n=0;for(let a=0;a<e.length;a++){let r=e[a];"("===r&&n++,")"===r&&(n=Math.max(0,n-1)),";"===r&&0===n?(t.push(i),i=""):i+=r}return i.trim()&&t.push(i),t.map((e=>e.trim())).filter(Boolean)}(e),i=null,n=null,a=null,r=[];for(let e of t){let t=e.indexOf(":");if(t<0)continue;let l=e.slice(0,t).trim().toLowerCase(),o=e.slice(t+1).trim();"box-shadow"===l?a=o:"filter"===l?i=o:"-webkit-filter"===l?n=o:r.push([l,o])}if(a){let e=function(e){let t=[],i="",n=0;for(let a=0;a<e.length;a++){let r=e[a];"("===r&&n++,")"===r&&(n=Math.max(0,n-1)),","===r&&0===n?(t.push(i.trim()),i=""):i+=r}i.trim()&&t.push(i.trim());let a=[];for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(?:\.\d+)?px/gi)||[],[i="0px",n="0px",r="0px"]=t,l=e.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/gi,"").trim().replace(/\s{2,}/g," "),o=!!l&&","!==l;a.push(`drop-shadow(${i} ${n} ${r}${o?` ${l}`:""})`)}return a.join(" ")}(a);e&&(i=i?`${i} ${e}`:e,n=n?`${n} ${e}`:e)}let l=[...r];return i&&l.push(["filter",i]),n&&l.push(["-webkit-filter",n]),l.map((([e,t])=>`${e}:${t}`)).join(";")}function r(e){if(!(0,n.b)()||!function(e){return"string"==typeof e&&/^data:image\/svg\+xml/i.test(e)}(e))return e;try{let t=function(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}(e);return function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}(function(e){return(e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,((e,t)=>e.replace(t,function(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,((e,t,i)=>`${t}{${a(i)}}`))}(t))))).replace(/style=(['"])([\s\S]*?)\1/gi,((e,t,i)=>`style=${t}${a(i)}${t}`))}(t))}catch{return e}}async function l(e,t){let{width:i,height:n,scale:a=1,dpr:l=1,meta:o={},backgroundColor:s}=t;e=r(e);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=e,await c.decode();let u,m,p=c.naturalWidth,d=c.naturalHeight,h=Number.isFinite(o.w0)?o.w0:p,f=Number.isFinite(o.h0)?o.h0:d,g=Number.isFinite(i),w=Number.isFinite(n);g&&w?(u=Math.max(1,i),m=Math.max(1,n)):g?(u=i,m=f*(i/Math.max(1,h))):w?(m=n,u=h*(n/Math.max(1,f))):(u=p,m=d),u*=a,m*=a;let y=document.createElement("canvas");y.width=u*l,y.height=m*l,y.style.width=`${u}px`,y.style.height=`${m}px`;let $=y.getContext("2d");return 1!==l&&$.scale(l,l),s&&($.save(),$.fillStyle=s,$.fillRect(0,0,u,m),$.restore()),$.drawImage(c,0,0,u,m),y}},276:(e,t,i)=>{i.d(t,{a:()=>a});var n=i(455);async function a(e,t){let i=t.type;if("svg"===i){let t=decodeURIComponent(e.split(",")[1]);return new Blob([t],{type:"image/svg+xml"})}let a=await(0,n.a)(e,t);return new Promise((e=>a.toBlob((t=>e(t)),`image/${i}`,t.quality)))}},600:(e,t,i)=>{i.d(t,{download:()=>r});var n=i(276),a=i(455);async function r(e,t){let i=(t?.format||t?.type||"").toLowerCase(),r="jpg"===i?"jpeg":i||"png",l=t?.filename||`snapdom.${r}`,o={...t||{},format:r,type:r};if(o.dpr=1,"svg"===r){let t=await(0,n.a)(e,{...o,type:"svg"}),i=URL.createObjectURL(t),a=document.createElement("a");return a.href=i,a.download=l,a.click(),void URL.revokeObjectURL(i)}let s=await(0,a.a)(e,o),c=document.createElement("a");c.href=s.toDataURL(`image/${r}`,t?.quality),c.download=l,c.click()}}}]);