const createWidgetElements = (containerElement) => {
  const elements = {};

  const selectors = {
    widget: ".firevert-widget",
    bubble: ".firevert-bubble",
    accordion: ".firevert-powerwidget__accordion",
    powerWidget: ".firevert-powerwidget",
    powerWidgetContainer: ".firevert-powerwidget__container",
    widgetContainer: ".firevert-widget__container",
    closeButton: ".firevert-widget__close",
  };

  for (const [key, selector] of Object.entries(selectors)) {
    elements[key] = containerElement.querySelector(selector);
  }

  elements.accordionText = elements.accordion?.querySelector(
    ".firevert-powerwidget__accordion-text"
  );

  return elements;
};

export default createWidgetElements;
