function workerify(code) {
    let blob = new Blob([code], {type: 'application/javascript'});
    return new Worker(URL.createObjectURL(blob));
}

import MachineWASMWorker from './machine-wasm.worker.js?worker&inline';

function GetMachineWASMWorker() {
    // vite makes this into a constructor, but in webpack we get the raw buffer
    if ((typeof MachineWASMWorker) === "function") {
        return new MachineWASMWorker();
    } else {
        return workerify(MachineWASMWorker);
    }
}

globalThis.GetMachineWASMWorker = GetMachineWASMWorker;

export * from './common.js';
