import { buildCustomEvent } from "../../../../utils/event-utils.js";
const interactiveItemContextEventName = 'atomic/resolveInteractiveResult';
class InteractiveItemContextController {
    get interactiveItem() {
        return this._interactiveItem;
    }
    hostConnected() {
        this._resolveInteractiveItemContext();
    }
    _resolveInteractiveItemContext() {
        const event = buildCustomEvent(interactiveItemContextEventName, (item)=>{
            this._interactiveItem = item;
            this.host.requestUpdate();
        });
        this.host.dispatchEvent(event);
    }
    constructor(host){
        this._interactiveItem = null;
        this.host = host;
        host.addController(this);
    }
}
export { InteractiveItemContextController };
