exports.__esModule=!0
var r=require("./battery/cjpeg.js")
exports.configBufferProcessorAsyncCjpeg=r.configBufferProcessorAsync
var e=require("./battery/gifsicle.js")
exports.configBufferProcessorAsyncGifsicle=e.configBufferProcessorAsync
var s=require("./battery/pngquant.js")
exports.configBufferProcessorAsyncPngquant=s.configBufferProcessorAsync
var o=require("./battery/svgo.js")
exports.configBufferProcessorAsyncSvgo=o.configBufferProcessorAsync
var c=require("./battery/cwebp.js")
exports.configBufferProcessorAsyncCwebp=c.configBufferProcessorAsync
var f=require("./function.js")
exports.fileTypeFromBuffer=f.fileTypeFromBuffer
exports.isSvg=f.isSvg
exports.configBufferProcessorAsync=async({onDetectFail:n=(async(r,e,s)=>{throw new Error(`unknown buffer type, detected ext: ${r}, buffer size: ${e.length}B`)}),configCjpeg:t,configGifsicle:i,configPngquant:g,configSvgo:u,configCwebp:a}={})=>{const y=await(0,r.configBufferProcessorAsync)(t)
const p=await(0,e.configBufferProcessorAsync)(i)
const B=await(0,s.configBufferProcessorAsync)(g)
const P=await(0,o.configBufferProcessorAsync)(u)
const A=await(0,c.configBufferProcessorAsync)(a)
return async r=>{const{ext:e}=await(0,f.fileTypeFromBuffer)(r)||{}
switch(e){case"jpg":return y(r)
case"gif":return p(r)
case"png":return B(r)
case"webp":return A(r)}const s=String(r)
return(0,f.isSvg)(s)?P(r,s):n(e,r,s)}}
