(()=>{var e={550:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=550,e.exports=t}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e="https://unpkg.com/@ffmpeg/core@0.12.9/dist/umd/ffmpeg-core.js";var t;!function(e){e.LOAD="LOAD",e.EXEC="EXEC",e.FFPROBE="FFPROBE",e.WRITE_FILE="WRITE_FILE",e.READ_FILE="READ_FILE",e.DELETE_FILE="DELETE_FILE",e.RENAME="RENAME",e.CREATE_DIR="CREATE_DIR",e.LIST_DIR="LIST_DIR",e.DELETE_DIR="DELETE_DIR",e.ERROR="ERROR",e.DOWNLOAD="DOWNLOAD",e.PROGRESS="PROGRESS",e.LOG="LOG",e.MOUNT="MOUNT",e.UNMOUNT="UNMOUNT"}(t||(t={}));const a=new Error("unknown message type"),s=new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"),o=(new Error("called FFmpeg.terminate()"),new Error("failed to import ffmpeg-core.js"));let n;self.onmessage=async({data:{id:E,type:c,data:i}})=>{const p=[];let R;try{if(c!==t.LOAD&&!n)throw s;switch(c){case t.LOAD:R=await(async({coreURL:a,wasmURL:s,workerURL:E})=>{const c=!n;try{a||(a=e),importScripts(a)}catch{if(a&&a!==e||(a=e.replace("/umd/","/esm/")),self.createFFmpegCore=(await r(550)(a)).default,!self.createFFmpegCore)throw o}const i=a,p=s||a.replace(/.js$/g,".wasm"),R=E||a.replace(/.js$/g,".worker.js");return n=await self.createFFmpegCore({mainScriptUrlOrBlob:`${i}#${btoa(JSON.stringify({wasmURL:p,workerURL:R}))}`}),n.setLogger((e=>self.postMessage({type:t.LOG,data:e}))),n.setProgress((e=>self.postMessage({type:t.PROGRESS,data:e}))),c})(i);break;case t.EXEC:R=(({args:e,timeout:t=-1})=>{n.setTimeout(t),n.exec(...e);const r=n.ret;return n.reset(),r})(i);break;case t.FFPROBE:R=(({args:e,timeout:t=-1})=>{n.setTimeout(t),n.ffprobe(...e);const r=n.ret;return n.reset(),r})(i);break;case t.WRITE_FILE:R=(({path:e,data:t})=>(n.FS.writeFile(e,t),!0))(i);break;case t.READ_FILE:R=(({path:e,encoding:t})=>n.FS.readFile(e,{encoding:t}))(i);break;case t.DELETE_FILE:R=(({path:e})=>(n.FS.unlink(e),!0))(i);break;case t.RENAME:R=(({oldPath:e,newPath:t})=>(n.FS.rename(e,t),!0))(i);break;case t.CREATE_DIR:R=(({path:e})=>(n.FS.mkdir(e),!0))(i);break;case t.LIST_DIR:R=(({path:e})=>{const t=n.FS.readdir(e),r=[];for(const a of t){const t=n.FS.stat(`${e}/${a}`),s=n.FS.isDir(t.mode);r.push({name:a,isDir:s})}return r})(i);break;case t.DELETE_DIR:R=(({path:e})=>(n.FS.rmdir(e),!0))(i);break;case t.MOUNT:R=(({fsType:e,options:t,mountPoint:r})=>{const a=e,s=n.FS.filesystems[a];return!!s&&(n.FS.mount(s,t,r),!0)})(i);break;case t.UNMOUNT:R=(({mountPoint:e})=>(n.FS.unmount(e),!0))(i);break;default:throw a}}catch(e){return void self.postMessage({id:E,type:t.ERROR,data:e.toString()})}R instanceof Uint8Array&&p.push(R.buffer),self.postMessage({id:E,type:c,data:R},p)}})()})();