import { x as g } from "./lit-element.jLBm65_O.js";
import { o as l } from "./unsafe-html.Dff7-rCx.js";
function p(e) {
  return e.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
}
function o(e) {
  return e.replace(
    /[&<>"']/g,
    (t) => ({
      '"': "&quot;",
      "&": "&amp;",
      "'": "&#39;",
      "<": "&lt;",
      ">": "&gt;"
    })[t] ?? t
  );
}
function a(e, t) {
  const r = t?.toLowerCase().split(/\s+/).filter(Boolean) ?? [];
  if (r.length === 0)
    return o(e);
  const i = r.map(p), s = new RegExp(`(${i.join("|")})`, "gi");
  return e.split(s).map((n) => r.includes(n.toLowerCase()) ? `<strong>${o(n)}</strong>` : o(n)).join("");
}
function m(e, t) {
  return g`${l(a(e, t))}`;
}
export {
  a,
  m as g
};
