"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZSpaceIsSupportedPM = void 0;
exports.makeZSpaceIsSupportedPM = makeZSpaceIsSupportedPM;
const core_1 = require("@vived/core");
const ZSpaceEntity_1 = require("../Entities/ZSpaceEntity");
class ZSpaceIsSupportedPM extends core_1.AppObjectPM {
}
exports.ZSpaceIsSupportedPM = ZSpaceIsSupportedPM;
ZSpaceIsSupportedPM.type = "ZSpaceIsSupportedPM";
ZSpaceIsSupportedPM.get = (appObjects) => (0, core_1.getSingletonComponent)(ZSpaceIsSupportedPM.type, appObjects);
function makeZSpaceIsSupportedPM(appObject) {
    return new ZSpaceIsSupportedPMImp(appObject);
}
class ZSpaceIsSupportedPMImp extends ZSpaceIsSupportedPM {
    get zSpaceEntity() {
        return this.getCachedSingleton(ZSpaceEntity_1.ZSpaceEntity.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, ZSpaceIsSupportedPM.type);
        this.onZSpaceChange = () => {
            if (!this.zSpaceEntity)
                return;
            this.doUpdateView(this.zSpaceEntity.isSupported);
        };
        this.zSpaceEntity?.addChangeObserver(this.onZSpaceChange);
        this.onZSpaceChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=ZSpaceIsSupportedPM.js.map