PageSourceSearch

https://turnsheet.ai/assets/smoothingService-CiDNu-fq.js

js turnsheet.ai collected 2026-10-05 14:39:04 UTC 1,624 bytes, 1 lines download raw bytes

1const A={strength:.85,radius:3,edgeThreshold:50,alphaThreshold:128};function M(t,n,h,g,a,f,i,e){const r=f*f*3;for(let s=0;s<g;s++)for(let l=0;l<h;l++){const o=(s*h+l)*4;if(t[o+3]<i){n[o]=t[o],n[o+1]=t[o+1],n[o+2]=t[o+2],n[o+3]=t[o+3];continue}const c=t[o],w=t[o+1],p=t[o+2];let y=0,T=0,E=0,m=0;for(let x=-a;x<=a;x++){const D=s+x;if(!(D<0||D>=g))for(let I=-a;I<=a;I++){const b=l+I;if(b<0||b>=h)continue;const d=(D*h+b)*4;if(t[d+3]<i)continue;const F=t[d]-c,R=t[d+1]-w,L=t[d+2]-p,U=F*F+R*R+L*L;if(U<=r){const u=1-U/r;y+=t[d]*u,T+=t[d+1]*u,E+=t[d+2]*u,m+=u}}}m>0?(n[o]=Math.round(c*(1-e)+y/m*e),n[o+1]=Math.round(w*(1-e)+T/m*e),n[o+2]=Math.round(p*(1-e)+E/m*e)):(n[o]=c,n[o+1]=w,n[o+2]=p),n[o+3]=t[o+3]}}async function P(t,n){const h={...A,...n};let g=t;if(t.startsWith("http://")||t.startsWith("https://"))try{const a=await fetch(t);if(!a.ok)throw new Error(`Fetch failed: ${a.status}`);const f=await a.blob();g=await new Promise((i,e)=>{const r=new FileReader;r.onloadend=()=>i(r.result),r.onerror=e,r.readAsDataURL(f)})}catch(a){throw new Error(`Failed to fetch image for smoothing: ${a}`)}return new Promise((a,f)=>{const i=new Image;i.onload=()=>{const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const r=e.getContext("2d");r.drawImage(i,0,0);const s=r.getImageData(0,0,e.width,e.height),l=s.data,o=new Uint8ClampedArray(l.length);M(l,o,e.width,e.height,h.radius,h.edgeThreshold,h.alphaThreshold,h.strength);for(let c=0;c<o.length;c++)l[c]=o[c];r.putImageData(s,0,0),a(e.toDataURL("image/png"))},i.onerror=()=>f(new Error("Failed to load image for smoothing")),i.src=g})}export{P as smoothImage};

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.