'use strict';

const directive = require('./directive-8278ab14.cjs');

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

exports.customClassMap = customClassMap;
