async function fileuploader(options = {}) {
const form = Object.assign(file(options), {
value: options.remoteFile ? undefined : options.default
});
if (options.remoteFile)
fetch(options.remoteFile)
.then(f => {
form.value = f;
form.dispatchEvent(new CustomEvent("input", { bubbles: true }));
})
.catch(e => {
form.value = e;
form.dispatchEvent(new CustomEvent("input", { bubbles: true }));
});
form.className = "fileuploader";
form.appendChild(style());
return form;
}