updateLoopPart(element2, arrayPath, changedValue, changedIndex) {
      const loopInfo = this.loops.get(element2);
      if (!loopInfo) return;
      const { template, itemName, indexName, parentNode } = loopInfo;
      const array = this.model.store.get(arrayPath);
      if (!Array.isArray(array)) return;
      const generated = Array.from(
        parentNode.querySelectorAll(`[data-generated-for="${arrayPath}"]`)
      );
      if (changedIndex === void 0 || generated.length !== array.length) {
        return this.updateLoop(element2);
      }
      const elementToUpdate = generated[changedIndex];
      if (elementToUpdate) {
        const newNode = template.cloneNode(true);
        this.domManager.processTemplateNode(newNode, {
          [itemName]: array[changedIndex],
          [indexName || "index"]: changedIndex
        });
        while (elementToUpdate.firstChild) {
          elementToUpdate.removeChild(elementToUpdate.firstChild);
        }
        while (newNode.firstChild) {
          elementToUpdate.appendChild(newNode.firstChild);
        }
        Array.from(newNode.attributes).forEach((attr) => {
          elementToUpdate.setAttribute(attr.name, attr.value);
        });
      }
    }
Partially updates a single DOM element within a loop based on changes in
the associated array. Specifically:
- If the changed index is provided, updates only the element at that index.
- If no changed index is provided or if the array length does not match
  the number of generated elements, falls back to a full loop update.

@param {HTMLElement} element - The loop's original template element.
@param {string} arrayPath - The path to the array in the data store associated with this loop.
@param {*} changedValue - The updated value in the array (optional).
@param {number} changedIndex - The index of the updated value in the array (optional).