import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
//import { show } from '@visma/formula/lib/useDynamicElements';
import ArrayField from '@visma/rjsf-core/lib/components/fields/ArrayField';
import { injectIntl } from 'react-intl';

var withMultipleFilesAsList = function withMultipleFilesAsList(Base) {
  var _Base$WrappedComponen;

  return /*#__PURE__*/function (_ref) {
    _inherits(ArrayField, _ref);

    var _super = _createSuper(ArrayField);

    function ArrayField() {
      _classCallCheck(this, ArrayField);

      return _super.apply(this, arguments);
    }

    _createClass(ArrayField, [{
      key: "renderFiles",
      value: function renderFiles() {
        return this.renderNormalArray();
      }
    }]);

    return ArrayField;
  }((_Base$WrappedComponen = Base.WrappedComponent) !== null && _Base$WrappedComponen !== void 0 ? _Base$WrappedComponen : Base);
}; // const withFilterFields = (Base) =>
//   class ArrayField extends (Base.WrappedComponent ?? Base) {
//     renderArrayFieldItem(props) {
//       return super.renderArrayFieldItem(
//         props.itemSchema.type === 'object'
//           ? {
//               ...props,
//               itemSchema: {
//                 ...props.itemSchema,
//                 properties: pickBy(
//                   props.itemSchema.properties,
//                   (property, id) =>
//                     show(
//                       props.itemData || {},
//                       props.itemUiSchema?.[id]?.['ui:options']?.element || {}
//                     )
//                 ),
//               },
//             }
//           : props
//       );
//     }
//   };


export default (function () {
  var _ref2, _Base;

  var Base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ArrayField;
  return _ref2 = (_Base = Base, withMultipleFilesAsList(_Base)), //withFilterFields |>
  injectIntl(_ref2);
});
//# sourceMappingURL=ArrayField.js.map