import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { Value, registerWidget } from '../Value';
import { IndentLevelContext, RenderContext, indent } from '../widgetUtils';
registerWidget('union', ({ value }) => {
    const level = React.useContext(IndentLevelContext);
    return (_jsx(RenderContext.Provider, { value: "inline", children: value.value.map((v, index) => {
            return (_jsxs(React.Fragment, { children: [' ', value.value.length > 3 && (_jsxs(_Fragment, { children: [_jsx("br", {}), indent(level + 1)] })), index !== 0 && _jsx("span", { className: "token punctuation", children: " |\u00A0" }), _jsx(IndentLevelContext.Provider, { value: level + 1, children: _jsx(Value, { value: v }) })] }, index));
        }) }));
});
