const setup = (root) => { root.parts = {} root.querySelectorAll("[part-id]").forEach( element => { root.parts[element.getAttribute("part-id")] = element }) root.clone = function() { return setup(this.cloneNode(true)) } return root } export const template = (strings, ...args) => { let buf = [] for (i=0;i