"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const tslib_es6 = require("../../../../../../../tslib@2.6.2/node_modules/tslib/tslib.es6.js");
const React = require("react");
const process = require("../../utils/process.js");
const definitions = require("./definitions.js");
const heyListen_es = require("../../../../../../../hey-listen@1.0.8/node_modules/hey-listen/dist/hey-listen.es.js");
const LazyContext = require("../../context/LazyContext.js");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
var featureNames = Object.keys(definitions.featureDefinitions);
var numFeatures = featureNames.length;
function useFeatures(props, visualElement, preloadedFeatures) {
  var features = [];
  var lazyContext = React.useContext(LazyContext.LazyContext);
  if (!visualElement)
    return null;
  if (process.env !== "production" && preloadedFeatures && lazyContext.strict) {
    heyListen_es.invariant(false, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.");
  }
  for (var i = 0; i < numFeatures; i++) {
    var name_1 = featureNames[i];
    var _a = definitions.featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component;
    if (isEnabled(props) && Component) {
      features.push(React__namespace.createElement(Component, tslib_es6.__assign({ key: name_1 }, props, { visualElement })));
    }
  }
  return features;
}
exports.useFeatures = useFeatures;
//# sourceMappingURL=use-features.js.map
