



export function jsVar(variableName) {
    if (!(window["neoGlobalEnqueueBackendNeoDuplicateFull"] || window["neoGlobalEnqueueFrontendNeoDuplicateFull"])) { throw new Error("The neoWP JS variables have not been initialized yet. Problem with the enqueue global?"); }
    if (window["neoGlobalEnqueueBackendNeoDuplicateFull"]  && window["neoGlobalEnqueueBackendNeoDuplicateFull"][variableName]  !== undefined) { return window["neoGlobalEnqueueBackendNeoDuplicateFull"][variableName]; }
    if (window["neoGlobalEnqueueFrontendNeoDuplicateFull"] && window["neoGlobalEnqueueFrontendNeoDuplicateFull"][variableName] !== undefined) { return window["neoGlobalEnqueueFrontendNeoDuplicateFull"][variableName]; }
    throw new Error("Missing JS variable: " + variableName + ". Make sure it is registered via enqueue_js_variable_backend(...) or enqueue_js_variable_frontend(...).");
}


export function jsVarExists(variableName) {
    if (!(window["neoGlobalEnqueueBackendNeoDuplicateFull"] || window["neoGlobalEnqueueFrontendNeoDuplicateFull"])) { throw new Error("The neoWP JS variables have not been initialized yet. Problem with the enqueue global?"); }
    return (window["neoGlobalEnqueueBackendNeoDuplicateFull"] || window["neoGlobalEnqueueFrontendNeoDuplicateFull"])?.[variableName] !== undefined;
}
