dispose() {
    for (const event of this.boundEvents_) {
      Blockly.browserEvents.unbind(event);
    }
    this.boundEvents_.length = 0;
    if (this.htmlDiv_) {
      this.htmlDiv_.remove();
    }
  }
Disposes of this modal.
Unlink from all DOM elements and remove all event listeners
to prevent memory leaks.