import { AppObjectPM, getSingletonComponent, } from "@vived/core";
import { BaseAppState } from "../Entity";
export class IsReviewingPM extends AppObjectPM {
}
IsReviewingPM.type = "IsReviewingPM";
IsReviewingPM.get = (appObjects) => getSingletonComponent(IsReviewingPM.type, appObjects);
export function makeIsReviewingPM(appObject) {
    return new IsReviewingPMImp(appObject);
}
class IsReviewingPMImp extends IsReviewingPM {
    get baseAppState() {
        return this.getCachedSingleton(BaseAppState.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    dispose() {
        super.dispose();
        this.baseAppState?.removeChangeObserver(this.onAppStateChange);
    }
    constructor(appObject) {
        super(appObject, IsReviewingPM.type);
        this.onAppStateChange = () => {
            if (!this.baseAppState)
                return;
            this.doUpdateView(this.baseAppState.isReviewing);
        };
        this.baseAppState?.addChangeObserver(this.onAppStateChange);
        this.onAppStateChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=IsReviewingPM.js.map