1#!/usr/bin/env node2// Upload LOCAL files (rendered plates, cropped assets) into the site's Media Manager through3// the editor's own Media Manager dialog, then close it without changing the page.4//5// node scripts/copy/upload-media-manager.mjs <sectionId> <file> [<file> ...]6//7// Why: media.uploadFiles only accepts temporary wixmp chat URLs, and the REST8// generate-upload-url call can be refused for the CLI site token. Files that are already9// public on the web are simpler: POST /site-media/v1/files/import with the site token.10// How: adds a temporary Image to <sectionId>, runs its changeMedia edit action to open11// Media Manager, clicks "Upload Media", feeds input[data-hook="files-input"], waits for12// "Upload(s) Completed", closes the dialog and removes the temporary Image.13// Afterwards find the files with editorLLMApis.media.searchSiteFiles({ query: <name> }).