/* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v0.39.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.UnknownMacroPlaceholder = UnknownMacroPlaceholder;
require("./UnknownMacroPlaceholder.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _reactIntl = require("react-intl");
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
var _messages = require("./messages");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
// Unknown macro placeholder styling aligned with Legacy Content Macro (LCM) for consistent look
var neutralBorder = "var(--ds-background-neutral, #0515240F)";
var unknownMacroContainerStyles = null;

// Match LCM header exactly: lcmHeaderStyles from LegacyContentHeader/index.tsx
var unknownMacroHeaderStyles = null;

// Match LCM content area: white surface, text color inherits
var unknownMacroBodyStyles = null;
var unknownMacroPreStyles = null;
var formatParam = function formatParam(key, param) {
  var _param$value;
  var value = String((_param$value = param === null || param === void 0 ? void 0 : param.value) !== null && _param$value !== void 0 ? _param$value : '').trim();
  return "".concat(key, " = ").concat(value);
};
var EMPTY_MACRO_PARAMS = {};
function UnknownMacroPlaceholder(_ref) {
  var _extensionNode$parame, _extensionNode$parame2, _extensionNode$parame3, _extensionNode$parame4, _extensionNode$parame5, _extensionNode$parame6;
  var extensionNode = _ref.extensionNode;
  var intl = (0, _reactIntl.useIntl)();
  var macroTitle = ((_extensionNode$parame = extensionNode.parameters) === null || _extensionNode$parame === void 0 || (_extensionNode$parame = _extensionNode$parame.macroMetadata) === null || _extensionNode$parame === void 0 ? void 0 : _extensionNode$parame.title) || extensionNode.extensionKey;
  var bodyContent = (_extensionNode$parame2 = extensionNode.parameters) === null || _extensionNode$parame2 === void 0 || (_extensionNode$parame2 = _extensionNode$parame2.macroParams) === null || _extensionNode$parame2 === void 0 || (_extensionNode$parame2 = _extensionNode$parame2.__bodyContent) === null || _extensionNode$parame2 === void 0 ? void 0 : _extensionNode$parame2.value;
  var macroParamsOld = (_extensionNode$parame3 = (_extensionNode$parame4 = extensionNode.parameters) === null || _extensionNode$parame4 === void 0 ? void 0 : _extensionNode$parame4.macroParams) !== null && _extensionNode$parame3 !== void 0 ? _extensionNode$parame3 : {};
  var macroParams = (_extensionNode$parame5 = (_extensionNode$parame6 = extensionNode.parameters) === null || _extensionNode$parame6 === void 0 ? void 0 : _extensionNode$parame6.macroParams) !== null && _extensionNode$parame5 !== void 0 ? _extensionNode$parame5 : EMPTY_MACRO_PARAMS;
  var formatParamInline = function formatParamInline(key, param) {
    var _param$value2;
    var value = String((_param$value2 = param === null || param === void 0 ? void 0 : param.value) !== null && _param$value2 !== void 0 ? _param$value2 : '').trim();
    return "".concat(key, " = ").concat(value);
  };
  var memoizedVisibleParams = (0, _react.useMemo)(function () {
    return Object.entries(macroParams).filter(function (_ref2) {
      var _ref3 = (0, _slicedToArray2.default)(_ref2, 1),
        key = _ref3[0];
      return !key.startsWith('_');
    }).map(function (_ref4) {
      var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
        key = _ref5[0],
        param = _ref5[1];
      return formatParam(key, param);
    }).join(' | ');
  }, [macroParams]);
  var visibleParams = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedVisibleParams :
  // eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- intentional fallback for experiment off path
  Object.entries(macroParamsOld).filter(function (_ref6) {
    var _ref7 = (0, _slicedToArray2.default)(_ref6, 1),
      key = _ref7[0];
    return !key.startsWith('_');
  }).map(function (_ref8) {
    var _ref9 = (0, _slicedToArray2.default)(_ref8, 2),
      key = _ref9[0],
      param = _ref9[1];
    return formatParamInline(key, param);
  }).join(' | ');
  var headerText = visibleParams ? "".concat(intl.formatMessage(_messages.messages.unknownMacroHeader, {
    macroTitle: macroTitle
  }), " | ").concat(visibleParams) : intl.formatMessage(_messages.messages.unknownMacroHeader, {
    macroTitle: macroTitle
  });
  return /*#__PURE__*/React.createElement("section", {
    "aria-label": intl.formatMessage(_messages.messages.unknownMacroPlaceholderAriaLabel),
    className: (0, _runtime.ax)(["_19it7tl1 _2rko12b0 _1reo15vq _18m915vq _bfhkhp5a"]),
    style: {
      "--_98ihdp": (0, _runtime.ix)("1px solid ".concat(neutralBorder))
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: (0, _runtime.ax)(["_2rko14xi _11c8wadc _n7zl1q32 _bfhki8nm _ca0qu2gc _u5f3pxbi _n3td1b66 _19bvpxbi _kqswh2mm _154i1n1a"]),
    style: {
      "--_1e0q5w0": (0, _runtime.ix)("var(--ds-border-width, 1px)".concat(" solid ", neutralBorder))
    }
  }, headerText), /*#__PURE__*/React.createElement("div", {
    className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _bfhkvuon _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp"])
  }, /*#__PURE__*/React.createElement("pre", {
    className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _11c8fhey _o5721jtm _1nmz1hna _6z24egat"])
  }, bodyContent)));
}