import { isHandleEnabled } from '../../NodeContext'; import type { NodeDef } from '../../NodeRegistry'; import { asEntity } from '../../values'; import { bool, obj } from '../shared'; export const IsEnabled: NodeDef = { type: 'IsEnabled', label: 'Is enabled', category: 'data', description: 'Whether an object is switched on – "own" is its own switch, "result" also requires every parent to be on.', inputs: [obj('object')], outputs: [bool('result'), bool('own', 'own switch')], params: [], run: (_ctx, inputs) => { const target = asEntity(inputs.object); if (!target) return { outputs: { result: false, own: false } }; return { outputs: { result: isHandleEnabled(target), own: target.props.enabled !== false } }; }, };