function mutableForm(form) { const view = html`<div>${form}`; linkProperties(form, view, ['output'], ['value']); view.form = form; const input = form.input; const setBoxes = (n, v) => { const checked = new Set(v); n.forEach(n => n.checked = checked.has(n.value)); };-const isCheckbox = input instanceof RadioNodeList && input[0].type === 'checkbox'; const setValue = isCheckbox ? setBoxes : (n, v) => n.value = v;+const setValue = input instanceof RadioNodeList && input[0].type === 'checkbox' ? setBoxes : input instanceof HTMLInputElement && input.type === 'checkbox' ? (n, v) => {n.checked = !!v} : (n, v) => {n.value = v};Object.defineProperty(view, 'value', { enumerable: true, get: () => form.value, set: v => { setValue(input, v);-const name = input instanceof RadioNodeList ? 'change' : 'input';+const name = input instanceof RadioNodeList || input instanceof HTMLInputElement && input.type === 'checkbox' ? 'change' : 'input';form.dispatchEvent(new Event(name, {bubbles: true})); } }); return view; }