'use strict';

const shared_tailwindElement_index = require('./index-38fa78cb.cjs');
const directive = require('./directive-8278ab14.cjs');

class CustomStyleMapDirective extends directive.i {
  constructor(partInfo) {
    super(partInfo);
    if (partInfo.type !== directive.t.ATTRIBUTE || partInfo.name !== "style" || partInfo.strings?.length > 2) {
      throw new Error(
        "`customStyleMap()` can only be used in the `style` attribute and must be the only part in the attribute."
      );
    }
  }
  render(styleInfoList) {
    const styles = Object.keys(styleInfoList).filter((key) => styleInfoList[key]);
    if (styles.length === 0) {
      return shared_tailwindElement_index.E;
    }
    return ` ${styles.join("; ")} `;
  }
}
const customStyleMap = directive.e(CustomStyleMapDirective);

exports.customStyleMap = customStyleMap;
