export class Scaler extends HTMLElement { static observedAttributes = ["canvaswidth", "canvasheight"]; #shadowRoot; #scaledElement; #contentElement; attributeChangedCallback(name, oldValue, newValue) { const width = Number(this.getAttribute("canvaswidth")); const height = Number(this.getAttribute("canvasheight")); this.#contentElement.style.aspectRatio = `${width} / ${height}`; this.#scaledElement.style.width = `${width}px`; this.#scaledElement.style.height = `${height}px`; } constructor() { super(); this.#shadowRoot = this.attachShadow({ mode: "closed" }); this.#shadowRoot.innerHTML = `