import { runPython } from './python.js';
let initialization;
async function initialize() {
    const response = await fetch('/pyodide/condition.py');
    if (!response.ok) {
        throw new Error('Failed to fetch python code for conditions');
    }
    const code = await response.text();
    await runPython(code, { global: true });
}
export async function runCondition(operator, left, right) {
    if (!initialization)
        initialization = initialize();
    await initialization;
    return runPython(`
    op = OPERATIONS.get(operator)
    op(right, left)
  `, { context: { operator, left, right } });
}
//# sourceMappingURL=condition.js.map