1import{f as m,g as w}from"./fetch-public.js";async function b(n){try{const s=await(await m(w(n.url))).blob(),o=n.extension||"png",a=URL.createObjectURL(s),r=new Image;r.src=a,await new Promise((l,c)=>{r.onload=()=>l(),r.onerror=()=>c(new Error("ç»åã®èªã¿è¾¼ã¿ã«å¤±æãã¾ããã"))});const e=document.createElement("canvas");e.width=r.width,e.height=r.height;const i=e.getContext("2d");i==null||i.drawImage(r,0,0),URL.revokeObjectURL(a);const d=await(await new Promise(l=>{e.toBlob(c=>{if(c)l(c);else throw new Error("ç»åã®å¤æã«å¤±æãã¾ããã")},`image/${o}`)})).arrayBuffer();return{name:`${n.name?n.name:"file"}.${o}`,data:new Uint8Array(d)}}catch(t){throw console.error(t),new Error("ãã¡ã¤ã«ã®åå¾ã«å¤±æãã¾ããã")}}function f(n){return n.replace(/[\\/:*?"<>|]/g,"_")}const u=async(n,t)=>{if(!t){console.error("ç»åãåå¨ãã¾ãã");return}const s=f(n||"file");try{const o=await b({url:t,name:s,extension:"png"}),a=new Uint8Array(o.data.byteLength);a.set(o.data);const r=new Blob([a],{type:"image/png"}),e=document.createElement("a");e.href=URL.createObjectURL(r),e.download=o.name,e.rel="noopener",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(e.href)}catch(o){console.error(o)}};export{b as c,u as d};
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.