import { r as registerInstance, c as createEvent } from './index-BIwHMk6j.js';
import { H, b as n } from './index.esm-CMeGYws2.js';
import { H as HighlightFeedItemHandler } from './highlight-item.handler-BWMpG2bS.js';

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
        r = Reflect.decorate(decorators, target, key, desc);
    else
        for (var i = decorators.length - 1; i >= 0; i--)
            if (d = decorators[i])
                r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const COMMAND_ID = 'limebb-feed.highlight-item';
/**
 * Command to highlight a feed item.
 *
 * This command is used to highlight a specific item in the feed, making it
 * stand out visually. It is typically used when you want to draw attention to
 * a particular item, such as after a new item is added or when redirecting
 * from an external view to a specific post in the feed.
 *
 * The command takes the `itemId` as a parameter, which is the unique
 * identifier of the feed item to be highlighted. If the item with the
 * specified ID does not exist in the feed, the command will throw an error and
 * will fail.
 *
 * @beta
 */
let HighlightFeedItemCommand = class HighlightFeedItemCommand {
    constructor(itemId) {
        this.itemId = itemId;
    }
};
HighlightFeedItemCommand = __decorate([
    H({
        id: COMMAND_ID,
    })
], HighlightFeedItemCommand);

const CrmComponentsLoader = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.loaded = createEvent(this, "loaded");
    }
    connectedCallback() { }
    async componentWillLoad() {
        const highlightFeedItemHandler = new HighlightFeedItemHandler();
        this.platform.register(HighlightFeedItemHandler.SERVICE_NAME, highlightFeedItemHandler);
        this.commandBus.register(HighlightFeedItemCommand, highlightFeedItemHandler);
        this.loaded.emit();
    }
    componentWillUpdate() { }
    disconnectedCallback() { }
    get commandBus() {
        return this.platform.get(n.CommandBus);
    }
};

export { CrmComponentsLoader as limebb_loader };
