import { html, nothing } from "lit";
import { Directive, directive } from "lit/directive.js";
class RefineToggleGuardDirective extends Directive {
    render({ hasError, firstRequestExecuted, hasItems }, content) {
        if (hasError) return nothing;
        if (!firstRequestExecuted) return html`
        <div
          part="placeholder"
          aria-hidden="true"
          class="bg-neutral mb-4 h-12 w-26 animate-pulse rounded"
        ></div>
      `;
        if (!hasItems) return nothing;
        return html`${content()}`;
    }
}
const refineToggleGuard = directive(RefineToggleGuardDirective);
export { refineToggleGuard };
