function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import React from "react";
import { FileMapView } from "../../../../MarkdownInputField/FileMapView";
import { normalizeFileMapPropsFromJson } from "./agenticUiEmbedUtils";
export var AgenticUiFileMapBlock = function AgenticUiFileMapBlock(param) {
    var attributes = param.attributes, children = param.children, element = param.element;
    var _normalizeFileMapPropsFromJson = normalizeFileMapPropsFromJson(element.value), fileList = _normalizeFileMapPropsFromJson.fileList, className = _normalizeFileMapPropsFromJson.className;
    var fileMap = new Map(fileList.map(function(f) {
        return [
            f.uuid || f.name,
            f
        ];
    }));
    return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({}, attributes), {
        contentEditable: false,
        "data-testid": "agentic-ui-filemap-block",
        style: {
            margin: '0.75em 0'
        }
    }), /*#__PURE__*/ React.createElement(FileMapView, {
        fileMap: fileMap,
        className: className
    }), /*#__PURE__*/ React.createElement("span", {
        "data-testid": "agentic-ui-filemap-hidden-children",
        style: {
            display: 'none'
        }
    }, children));
};
AgenticUiFileMapBlock.displayName = 'AgenticUiFileMapBlock';
export var ReadonlyAgenticUiFileMapBlock = /*#__PURE__*/ React.memo(AgenticUiFileMapBlock);
ReadonlyAgenticUiFileMapBlock.displayName = 'ReadonlyAgenticUiFileMapBlock';
