"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRoute = exports.reloadUrl = exports.clearUrl = exports.pushUrl = exports.getUrlForRoute = void 0;
const getUrlHandlingType = () => {
    if (window.remotion_isReadOnlyStudio) {
        return 'query-string';
    }
    return 'spa';
};
const getUrlForRoute = (route) => {
    if (getUrlHandlingType() === 'query-string') {
        return `${window.location.pathname}?${route}`;
    }
    return route;
};
exports.getUrlForRoute = getUrlForRoute;
const pushUrl = (url) => {
    window.history.pushState({}, 'Studio', (0, exports.getUrlForRoute)(url));
};
exports.pushUrl = pushUrl;
const clearUrl = () => {
    window.location.href = window.location.pathname;
};
exports.clearUrl = clearUrl;
const reloadUrl = () => {
    window.location.reload();
};
exports.reloadUrl = reloadUrl;
const getRoute = () => {
    if (getUrlHandlingType() === 'query-string') {
        return window.location.search.substring(1);
    }
    return window.location.pathname;
};
exports.getRoute = getRoute;
