"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEditorSlug = void 0;
/**
 * Get the user-editable portion of an entity's slug
 * @param entity
 * @returns
 */
const getEditorSlug = (entity) => {
    const slug = (entity.slug || "").toLowerCase();
    const orgUrlKey = (entity.orgUrlKey || "").toLowerCase();
    if (orgUrlKey) {
        return slug.replace(new RegExp(`${orgUrlKey}\\|`, "gi"), "");
    }
    else {
        return slug;
    }
};
exports.getEditorSlug = getEditorSlug;
//# sourceMappingURL=getEditorSlug.js.map