import { formilyReact } from '@cainiaofe/cn-ui';
import React from 'react';
import { mapStatus } from '../../mapStatus.js';
const { connect, useFieldSchema, mapProps } = formilyReact;
export const TimeZoneRangeDatePicker = connect((props) => {
    var _a, _b, _c, _d;
    const fieldSchema = useFieldSchema();
    const ComponentUI = (_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.cnLowCodeUtils) === null || _a === void 0 ? void 0 : _a.filterItem) === null || _b === void 0 ? void 0 : _b.getRunTimeItem) === null || _c === void 0 ? void 0 : _c.call(_b, 'CnTimeZoneRangeDatePicker');
    // 优先使用 formComponent，如果没有则尝试从 component.realize 获取（拓展组件）
    let FormComponent = ComponentUI === null || ComponentUI === void 0 ? void 0 : ComponentUI.formComponent;
    if (!FormComponent && ((_d = ComponentUI === null || ComponentUI === void 0 ? void 0 : ComponentUI.component) === null || _d === void 0 ? void 0 : _d.realize)) {
        FormComponent = ComponentUI.component.realize();
    }
    if (!FormComponent) {
        return null;
    }
    return (React.createElement(FormComponent, { ...props, defaultVisible: true, className: "cn-ai-table-schema-field__item--full-width cn-ai-table-schema-field__item--timezone-range-date", popupContainer: document.getElementById(String((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.name) || '')) }));
}, mapProps(mapStatus, {
    dataSource: true,
}));
TimeZoneRangeDatePicker.displayName = 'CnTimeZoneRangeDatePicker';
