<?php
namespace NeoMotionBeta\NeoDraw; if (!defined("ABSPATH")) { die("neoWP direct access not allowed"); }




\NeoMotionBeta\NeoGlobal\register_backend_page("neo-draw--icon-library", fn () => \NeoMotionBeta\NeoGlobal\current_user_can__neo_draw(), function () {
    ?>
    <html>
    <head>
        <title>Add Library</title>
        <script type="module">
            import { domLoaded } from "<?php echo esc_url(\NeoMotionBeta\NeoGlobal\plugin_url()) ?>/_global--observer.js";






            const channel = new BroadcastChannel("neo-draw--iframe");

            channel.addEventListener("message", (event) => {
                if (event.data.action === "addLibraryConfirm") {
                    window.close();
                }
            });

            domLoaded(() => {
                channel.postMessage({
                    action: "addLibrary",
                    hash: location.hash
                });
            });
        </script>
    </head>

    <body>
        Adding the library...
    </body>

    </html>
<?php });
