"use strict";
const React = require("react");
const omit = require("../omit.js");
var __assign = globalThis && globalThis.__assign || function() {
  __assign = Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p))
          t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
function useMergeProps(componentProps, defaultProps, globalComponentConfig) {
  var _ignorePropsFromGlobal = componentProps._ignorePropsFromGlobal;
  var _defaultProps = React.useMemo(function() {
    return __assign(__assign({}, defaultProps), _ignorePropsFromGlobal ? {} : globalComponentConfig);
  }, [defaultProps, globalComponentConfig, _ignorePropsFromGlobal]);
  var props = React.useMemo(function() {
    var mProps = omit(componentProps, ["_ignorePropsFromGlobal"]);
    for (var propName in _defaultProps) {
      if (mProps[propName] === void 0) {
        mProps[propName] = _defaultProps[propName];
      }
    }
    return mProps;
  }, [componentProps, _defaultProps]);
  return props;
}
module.exports = useMergeProps;
//# sourceMappingURL=useMergeProps.js.map
