import { E } from './index-5X9ujrWL.js';
import { e, i, t } from './directive-BKuZRRPO.js';

class CustomStyleMapDirective extends i {
  constructor(partInfo) {
    super(partInfo);
    if (partInfo.type !== 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 E;
    }
    return ` ${styles.join("; ")} `;
  }
}
const customStyleMap = e(CustomStyleMapDirective);

export { customStyleMap as c };
