//#region src/elements/TimegroupController.ts
var TimegroupController = class {
	constructor(host, child) {
		this.host = host;
		this.child = child;
		this.host.addController(this);
	}
	remove() {
		this.host.removeController(this);
	}
	hostDisconnected() {
		this.host.removeController(this);
	}
	hostUpdated() {
		Promise.resolve().then(() => {
			if ("mode" in this.child && "isRootTimegroup" in this.child) {
				this.child.requestUpdate();
				return;
			}
			this.child.requestUpdate();
			const newChildTimeMs = this.host.currentTimeMs - (this.child.startTimeMs ?? 0);
			this.child.currentTimeMs = newChildTimeMs;
		});
	}
};

//#endregion
export { TimegroupController };
//# sourceMappingURL=TimegroupController.js.map