"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const isVariantLabel = require("./dist-es-render-utils-is-variant-label.cjs");
const variantProps = require("./dist-es-render-utils-variant-props.cjs");
const numVariantProps = variantProps.variantProps.length;
function getVariantContext(visualElement) {
  if (!visualElement)
    return void 0;
  if (!visualElement.isControllingVariants) {
    const context2 = visualElement.parent ? getVariantContext(visualElement.parent) || {} : {};
    if (visualElement.props.initial !== void 0) {
      context2.initial = visualElement.props.initial;
    }
    return context2;
  }
  const context = {};
  for (let i = 0; i < numVariantProps; i++) {
    const name = variantProps.variantProps[i];
    const prop = visualElement.props[name];
    if (isVariantLabel.isVariantLabel(prop) || prop === false) {
      context[name] = prop;
    }
  }
  return context;
}
exports.getVariantContext = getVariantContext;
//# sourceMappingURL=dist-es-render-utils-get-variant-context.cjs.map
