

import { observeClick } from "./_global--observer.js";
import { jsVar } from "./_global--enqueue-loader.js";
import { neoLoadInterfaceFunc } from "./_global--interface.js";


observeClick(".neo-motion--create-starter-button", async (buttonNode) => {
    buttonNode.disabled = true;
    let wasSaved = false;
    new (await neoLoadInterfaceFunc("neo-draw", "neo-draw--editor-dialog.js", "InterfaceEditorDialog20250302"))()
        .imgUrl(jsVar("neoMotionStarterImageUrl"))
        .forceNew()
        .forceFilename("neo-motion.svg")
        .on("save", () => { wasSaved = true; })
        .on("close", () => { buttonNode.disabled = false; if (wasSaved) { location.href = jsVar("neoMotionMediaLibraryUrl"); } })
        .open();
});
