PageSourceSearch

https://www.subhanshumg.com/assets/exportSvgToPng-Cl8xvmSD.js

js subhanshumg.com collected 2026-10-08 08:06:56 UTC 2,676 bytes, 1 lines download raw bytes

1async function C(p,f){try{const o=p.cloneNode(!0),g=p.getBBox(),u=40,x=g.x-u,A=g.y-u,b=g.width+u*2,d=g.height+u*2;o.setAttribute("viewBox",`${x} ${A} ${b} ${d}`);const S=b/d;let w=b,v=d;S>16/9?v=w/(16/9):S<9/16&&(w=v/(16/9));const k=3,i=Math.min(w*k,4096),c=Math.min(v*k,4096);o.setAttribute("width",String(i)),o.setAttribute("height",String(c)),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const s=document.createElementNS("http://www.w3.org/2000/svg","rect");s.setAttribute("x",String(x)),s.setAttribute("y",String(A)),s.setAttribute("width",String(b)),s.setAttribute("height",String(d)),s.setAttribute("rx","16"),s.setAttribute("ry","16"),s.setAttribute("fill","#0d0d12"),o.insertBefore(s,o.firstChild);const T=p.querySelectorAll("*"),E=o.querySelectorAll("*");T.forEach((e,t)=>{const r=E[t+1];if(!r||!(r instanceof SVGElement))return;const n=window.getComputedStyle(e);["fill","stroke","stroke-width","stroke-dasharray","stroke-linecap","opacity","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","letter-spacing","visibility","fill-opacity","stroke-opacity"].forEach(L=>{const a=n.getPropertyValue(L);a&&a!=="none"&&a!=="normal"&&a!=="visible"&&r.style.setProperty(L,a)})}),o.querySelectorAll("foreignObject").forEach(e=>{var l;const t=e.getAttribute("x")||"0",r=e.getAttribute("y")||"0",n=document.createElementNS("http://www.w3.org/2000/svg","circle");n.setAttribute("cx",String(parseFloat(t)+9)),n.setAttribute("cy",String(parseFloat(r)+12)),n.setAttribute("r","6"),n.setAttribute("fill","rgba(255,255,255,0.15)"),(l=e.parentNode)==null||l.replaceChild(n,e)});let y=new XMLSerializer().serializeToString(o);y=y.replace(/var\(--[^)]+\)/g,e=>{const t=e.slice(4,-1).trim();return getComputedStyle(document.documentElement).getPropertyValue(t).trim()||"#888"});const R=new Blob([y],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(R),m=new Image;m.onload=()=>{const e=document.createElement("canvas");e.width=i,e.height=c;const t=e.getContext("2d"),r=32;t.beginPath(),t.moveTo(r,0),t.lineTo(i-r,0),t.quadraticCurveTo(i,0,i,r),t.lineTo(i,c-r),t.quadraticCurveTo(i,c,i-r,c),t.lineTo(r,c),t.quadraticCurveTo(0,c,0,c-r),t.lineTo(0,r),t.quadraticCurveTo(0,0,r,0),t.closePath(),t.clip(),t.drawImage(m,0,0,i,c),URL.revokeObjectURL(h),e.toBlob(n=>{if(!n)return;const l=document.createElement("a");l.href=URL.createObjectURL(n),l.download=`${f}.png`,l.click(),URL.revokeObjectURL(l.href)},"image/png")},m.onerror=()=>{URL.revokeObjectURL(h);const e=document.createElement("a");e.href=h,e.download=`${f}.svg`,e.click()},m.src=h}catch{}}export{C as exportSvgToPng};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.