"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlideTextPM = void 0;
exports.makeSlideTextPM = makeSlideTextPM;
const core_1 = require("@vived/core");
const Entity_1 = require("../Entity");
class SlideTextPM extends core_1.AppObjectPM {
}
exports.SlideTextPM = SlideTextPM;
SlideTextPM.type = "SlideTextPM";
SlideTextPM.get = (appObjects) => (0, core_1.getSingletonComponent)(SlideTextPM.type, appObjects);
function makeSlideTextPM(appObject) {
    return new SlideTextPMImp(appObject);
}
class SlideTextPMImp extends SlideTextPM {
    get baseAppState() {
        return this.getCachedSingleton(Entity_1.BaseAppState.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, SlideTextPM.type);
        this.onAppStateChange = () => {
            if (!this.baseAppState)
                return;
            this.doUpdateView(this.baseAppState.slideText);
        };
        this.baseAppState?.addChangeObserver(this.onAppStateChange);
        this.onAppStateChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=SlideTextPM.js.map