"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CnAddress = void 0;
const cn_ui_1 = require("@cainiaofe/cn-ui");
const react_1 = __importDefault(require("react"));
const mapStatus_1 = require("../../mapStatus.js");
const utils_1 = require("../../../index.js");
const { connect, useFieldSchema, mapProps } = cn_ui_1.formilyReact;
exports.CnAddress = connect((props) => {
    var _a, _b, _c, _d, _e;
    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, 'CnAddress');
    if (!((_d = ComponentUI === null || ComponentUI === void 0 ? void 0 : ComponentUI.component) === null || _d === void 0 ? void 0 : _d.realize)) {
        return null;
    }
    const Ele = (_e = ComponentUI === null || ComponentUI === void 0 ? void 0 : ComponentUI.component) === null || _e === void 0 ? void 0 : _e.realize();
    const isV2Valid = (0, utils_1.isV2PropsValid)();
    return (react_1.default.createElement(Ele, { ...props, className: "cn-ai-table-schema-field__item--full-width", popupContainer: document.getElementById(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.name), popupProps: {
            v2: isV2Valid && true,
        } }));
}, mapProps(mapStatus_1.mapStatus, {
    dataSource: true,
}));
exports.CnAddress.displayName = 'CnAddress';
