/*! For license information please see if-defined.js.LICENSE.txt */
import{AttributePart,directive}from"../lit-html.js";const previousValues=new WeakMap;export const ifDefined=directive((e=>t=>{const i=previousValues.get(t);if(void 0===e&&t instanceof AttributePart){if(void 0!==i||!previousValues.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==i&&t.setValue(e);previousValues.set(t,e)}));