{
  "version": 3,
  "sources": ["/cdn/shop/t/43/assets/eq-custom-loop.js?test=780"],
  "sourcesContent": ["\r\nconst showLoader = () => {\r\n  $(`.eq-loading-spinner-outer`).removeClass(\"eq-hide\");\r\n};\r\n\r\nconst removeLoader = () => {\r\n  if(didLoadCustomerData) {\r\n    $(`.eq-loading-spinner-outer`).addClass(\"eq-hide\");\r\n  }\r\n};\r\nlet didLoadCustomerData = false;\r\nconst getSubscriptionByShopifyId = (data, subscriptionId) => {\r\n    if (!data || !Array.isArray(data.data)) return null;\r\n\r\n    return (\r\n      data.data.find(\r\n        (item) => item.shopify_subscription_id == subscriptionId\r\n      ) || null\r\n    );\r\n  };\r\n\r\n  const getLoopSubscriptionIdFromURL = () => {\r\n    const url = window.location.href;\r\n    const parts = window.location.pathname.split(\"/\").filter(Boolean);\r\n\r\n    const index = parts.indexOf(\"subscription\");\r\n    return index !== -1 ? parts[index + 1] : null;\r\n  };\r\n\r\n  let subscriptionId = getLoopSubscriptionIdFromURL();\r\n\r\n  let checkCustomerLoopLoaded = window.setInterval(() => {\r\n    if(typeof loopProps === 'object') {\r\n      clearInterval(checkCustomerLoopLoaded);\r\n      getCustomerDetails();\r\n    }\r\n  },200);\r\n\r\n\r\nconst getCustomerDetails = async () => {\r\n  showLoader();\r\n  console.log(`EQ -- Fetching customer data for ID: ${loopProps.customer.shopifyId}`);\r\n  $.getJSON(\r\n    `https://api.nuudafood.com/v2/customer/${loopProps.customer.shopifyId}`,\r\n    function (data) {\r\n      window.loopdata = {};\r\n      window.loopdata.loopId = subscriptionId;\r\n      window.loopdata.subscription_data = getSubscriptionByShopifyId(\r\n        data,\r\n        subscriptionId\r\n      );\r\n      console.log(`EQ -- Fetched customer data:`, window.loopdata);\r\n      didLoadCustomerData = true;\r\n      removeLoader();\r\n    }\r\n  );\r\n}\r\n    \r\n  \r\n\r\n\r\nconst onElementLoaded = (selector, callback) => {\r\n  const el = document.querySelector(selector);\r\n  if (el) {\r\n    callback(el);\r\n    return;\r\n  }\r\n\r\n  const observer = new MutationObserver(() => {\r\n    const el = document.querySelector(selector);\r\n    if (el) {\r\n      callback(el);\r\n      observer.disconnect(); // stop after first success\r\n    }\r\n  });\r\n\r\n  observer.observe(document.documentElement, {\r\n    childList: true,\r\n    subtree: true,\r\n  });\r\n};\r\n\r\nconst hmacSig = document.querySelector(\r\n  'input[name=\"rsjUGp1vCkuxtEPc3gDfWu9SLwc77zOl\"]'\r\n).value;\r\n\r\nconst hmacTimeLine = document.querySelector(\r\n  'input[name=\"ytJOsuNxqh1bu7NzBRIo8loJcMkbb8lU\"]'\r\n).value;\r\n\r\nif (!localStorage.getItem(\"loop_head_gen_token\")) {\r\n  localStorage.setItem(\r\n    \"loop_head_gen_token\",\r\n    \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyVHlwZSI6IkNVU1RPTUVSIiwidXNlcklkIjoyNzIwNzExOTgsInVzZXJTaG9waWZ5SWQiOjc1NjA4MTYyMzA0MzYsInN0b3JlSWQiOjEzMDYzLCJteXNob3BpZnlEb21haW4iOiJlcS1sb29wLXRlc3Rpbmctc3RvcmUubXlzaG9waWZ5LmNvbSIsImNvbnRleHQiOiJFTUFJTCIsImlhdCI6MTc1OTEyNTA0OCwiZXhwIjoxNzU5NDcwNjQ4fQ.c6UFxkxC7SO_ZpRNOI0mlSRP581Oim__j_cSPQIRjn0\"\r\n  );\r\n}\r\n\r\n(function () {\r\n  // --- STYLES ---\r\n  /**\r\n   * Injects all necessary CSS into the document's <head>.\r\n   * This includes styles for modals, sidebars, product lists, and the new button loader.\r\n   */\r\n  function injectModalStyles() {\r\n    const styles = `\r\n\t\t\t/* --- Overlay for both Modal and Sidebar --- */\r\n\t\t\t.loop-background,\r\n\t\t\t.loop-background>.loop-container\r\n\t\t\t{\r\n\t\t\t\tbackground-color: #F6EBDE !important;\r\n\t\t\t}\r\n\t\t\t.custom-modal-overlay {\r\n\t\t\t\tposition: fixed; top: 0; left: 0; width: 100%; height: 100%;\r\n\t\t\t\tbackground: rgba(0, 0, 0, 0.6);\r\n\t\t\t\tz-index: 1000;\r\n\t\t\t\topacity: 0;\r\n\t\t\t\ttransition: opacity 0.3s ease-in-out;\r\n\t\t\t}\r\n\t\t\t.custom-modal-overlay.visible {\r\n\t\t\t\topacity: 1;\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t/* --- Single Product Modal --- */\r\n\t\t\t.custom-modal-content {\r\n\t\t\t\tbackground: white; padding: 25px; border-radius: 8px; width: 90%;\r\n\t\t\t\tmax-width: 450px; position: absolute; top: 50%; left: 50%;\r\n\t\t\t\ttransform: translate(-50%, -50%);\r\n\t\t\t}\r\n\t\t\t.custom-modal-close {\r\n\t\t\t\tposition: absolute; top: 10px; right: 15px; border: none;\r\n\t\t\t\tbackground: transparent; font-size: 24px; cursor: pointer;\r\n\t\t\t}\r\n\t\t\t.custom-modal-header {\r\n\t\t\t\tdisplay: flex; align-items: center; border-bottom: 1px solid #eee;\r\n\t\t\t\tpadding-bottom: 15px; margin-bottom: 15px;\r\n\t\t\t}\r\n\t\t\t.custom-modal-header img {\r\n\t\t\t\twidth: 60px; height: 60px; object-fit: cover;\r\n\t\t\t\tmargin-right: 15px; border-radius: 5px;\r\n\t\t\t}\r\n\t\t\t.custom-modal-header h4 { margin: 0; font-size: 16px; }\r\n\t\t\t.custom-modal-body .form-group { margin-bottom: 15px; }\r\n\t\t\t.custom-modal-body label {\r\n\t\t\t\tdisplay: block; margin-bottom: 5px; font-weight: 600; font-size: 14px;\r\n\t\t\t}\r\n\t\t\t.custom-modal-body input[type=\"number\"] {\r\n\t\t\t\twidth: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;\r\n\t\t\t}\r\n\t\t\t.custom-modal-body .checkbox-group { display: flex; align-items: center; }\r\n\t\t\t.custom-modal-body input[type=\"checkbox\"] { margin-right: 10px; }\r\n\t\t\t.custom-modal-footer {\r\n\t\t\t\tdisplay: flex; justify-content: flex-end; gap: 10px; margin-top: 20px;\r\n\t\t\t}\r\n\t\t\t.custom-modal-footer button {\r\n\t\t\t\tpadding: 10px 20px; border-radius: 5px; cursor: pointer; border: 1px solid transparent;\r\n\t\t\t\tposition: relative; /* Required for loader positioning */\r\n\t\t\t}\r\n\t\t\t.custom-modal-footer .btn-cancel { background: #f0f0f0; border-color: #ccc; }\r\n\t\t\t.custom-modal-footer .btn-submit { background: black; color: white; }\r\n\r\n\t\t\t/* --- Sidebar for Multi-Product Selection --- */\r\n\t\t\t.custom-sidebar {\r\n\t\t\t\tposition: fixed; top: 0; right: 0; width: 400px; max-width: 90vw;\r\n\t\t\t\theight: 100%; background: white; box-shadow: -2px 0 8px rgba(0,0,0,0.1);\r\n\t\t\t\ttransform: translateX(100%); transition: transform 0.3s ease-in-out;\r\n\t\t\t\tdisplay: flex; flex-direction: column; z-index: 1001;\r\n\t\t\t}\r\n\t\t\t.custom-sidebar.open { transform: translateX(0); }\r\n\t\t\t.sidebar-header {\r\n\t\t\t\tpadding: 15px 20px; border-bottom: 1px solid #eee; display: flex;\r\n\t\t\t\tjustify-content: space-between; align-items: flex-start; flex-direction: column;\r\n\t\t\t}\r\n\t\t\t.sidebar-header h4 { margin: 0; font-size: 18px; }\r\n\t\t\t.sidebar-body { flex-grow: 1; overflow-y: auto; padding: 10px 20px; }\r\n\t\t\t.sidebar-footer {\r\n\t\t\t\tpadding: 15px 20px; border-top: 1px solid #eee; background: #f9f9f9;\r\n\t\t\t}\r\n\t\t\t.product-selection-row {\r\n\t\t\t\tdisplay: flex; align-items: center; padding: 10px 0;\r\n\r\n\t\t\t}\r\n\t\t\t.product-selection-row:last-child { border-bottom: none; }\r\n\t\t\t.product-selection-row img {\r\n\t\t\t\twidth: 50px; height: 50px; object-fit: cover; margin-right: 15px; border-radius: 4px;\r\n\t\t\t}\r\n\t\t\t.product-selection-row .product-info { flex-grow: 1; }\r\n\t\t\t.product-selection-row .product-title { font-weight: 600; font-size: 14px; }\r\n\t\t\t.product-selection-row .product-price { font-size: 12px; color: #666; }\r\n\t\t\t.product-selection-row .product-controls { display: flex; align-items: center; }\r\n\t\t\t.product-selection-row input[type=\"checkbox\"] { margin-right: 15px; transform: scale(1.2); }\r\n\t\t\t.product-selection-row input[type=\"number\"] {\r\n\t\t\t\twidth: 60px; padding: 5px; text-align: center; border: 1px solid #ccc; border-radius: 4px;\r\n\t\t\t}\r\n\t\t\t.product-wrap {\r\n\t\t\t\tborder-bottom: 1px solid gray;\r\n\t\t\t\tpadding: 10px 0;\r\n\t\t\t}\r\n\r\n\t\t\t   .manage-product-row {\r\n                display: flex; align-items: center; padding: 12px 0;\r\n                transition: opacity 0.3s ease;\r\n            }\r\n            .manage-product-row img {\r\n                width: 50px; height: 50px; object-fit: cover;\r\n                margin-right: 15px; border-radius: 4px;\r\n            }\r\n            .manage-product-row .product-info { flex-grow: 1; }\r\n            .manage-product-row .product-controls { display: flex; align-items: center; gap: 15px; }\r\n            .manage-product-row .quantity-input {\r\n                width: 55px; padding: 6px; text-align: center;\r\n                border: 1px solid #ccc; border-radius: 4px;\r\n            }\r\n            .btn-remove-item {\r\n                background: transparent; border: none; cursor: pointer; padding: 5px;\r\n            }\r\n            .btn-remove-item svg { width: 18px; height: 18px; fill: #888; transition: fill 0.2s ease; }\r\n            .btn-remove-item:hover svg { fill: #d00; }\r\n\r\n\t\t\t/* --- General/Shared UI Elements --- */\r\n            .custom-modal-close {\r\n\t\t\t\tborder: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; padding: 0;\r\n\t\t\t}\r\n\t\t\t.custom-modal-footer {\r\n\t\t\t\tdisplay: flex; justify-content: flex-end; gap: 10px; margin-top: 20px;\r\n\t\t\t}\r\n\t\t\t.custom-modal-footer button {\r\n\t\t\t\tpadding: 10px 20px; border-radius: 5px; cursor: pointer; border: 1px solid transparent; font-weight: 600;\r\n\t\t\t}\r\n\t\t\t.custom-modal-footer .btn-cancel { background: #f0f0f0; border-color: #ccc; }\r\n\t\t\t.custom-modal-footer .btn-submit { background: black; color: white; }\r\n            .btn-submit:disabled { background: #555; cursor: not-allowed; }\r\n\r\n            /* --- NEW: Button Loader --- */\r\n\t\t\t.btn-submit.loading {\r\n\t\t\t\tcolor: transparent; /* Hide text */\r\n\t\t\t\tpointer-events: none;\r\n\t\t\t}\r\n\t\t\t.btn-submit.loading::after {\r\n\t\t\t\tcontent: '';\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\ttop: 50%; left: 50%;\r\n\t\t\t\twidth: 20px; height: 20px;\r\n\t\t\t\tmargin-top: -10px; margin-left: -10px;\r\n\t\t\t\tborder: 2px solid rgba(255, 255, 255, 0.5);\r\n\t\t\t\tborder-top-color: #fff;\r\n\t\t\t\tborder-radius: 50%;\r\n\t\t\t\tanimation: spin 0.8s linear infinite;\r\n\t\t\t}\r\n\t\t\t@keyframes spin { to { transform: rotate(360deg); } }\r\n\r\n            /* --- NEW: Main Page Subscription Products Display --- */\r\n            .subscription-item-list {\r\n\t\t\t\tmargin: 10px 0; padding: 10px; background-color: #f9f9f9; border-radius: 5px;\r\n\t\t\t\tborder: 1px solid gray;\r\n\t\t\t}\r\n            .subscription-item { display: flex; align-items: center; padding: 8px 5px; border-bottom: 1px solid #f0f0f0; }\r\n            .subscription-item:last-child { border-bottom: none; }\r\n            .subscription-item img { width: 40px; height: 40px; margin-right: 10px; border-radius: 4px; }\r\n            .manage-products-btn {\r\n                display: block; width: 100%; padding: 10px; margin-top: 10px;\r\n                background-color: #e9e9e9; border: 1px solid #ccc; border-radius: 5px;\r\n                cursor: pointer; text-align: center; font-weight: 600; transition: background-color 0.2s ease;\r\n            }\r\n            .manage-products-btn:hover { background-color: #ddd; }\r\n\r\n\t\t\t/* --- NEW: Custom Confirmation Popup --- */\r\n\t\t\t.custom-confirm-overlay {\r\n\t\t\t\tposition: fixed; top: 0; left: 0; width: 100%; height: 100%;\r\n\t\t\t\tbackground: rgba(0, 0, 0, 0.6); z-index: 2000;\r\n\t\t\t\tdisplay: flex; align-items: center; justify-content: center;\r\n\t\t\t\topacity: 0; transition: opacity 0.2s ease;\r\n\t\t\t}\r\n\t\t\t.custom-confirm-modal {\r\n\t\t\t\t padding: 25px; border-radius: 8px;\r\n\t\t\t\twidth: 90%; max-width: 100%; text-align: center;\r\n\t\t\t\ttransform: scale(0.9); transition: transform 0.2s ease;\r\n\t\t\t\tbackground-color: #fff;\r\n\t\t\t}\r\n\t\t\t.custom-confirm-overlay.visible { opacity: 1; }\r\n\t\t\t.custom-confirm-overlay.visible .custom-confirm-modal { transform: scale(1); }\r\n\t\t\t.custom-confirm-message { font-size: 16px; margin: 0; }\r\n\t\t\t.custom-confirm-buttons { display: flex; justify-content: center; gap: 10px;margin-top: 20px; }\r\n\t\t\t.custom-confirm-buttons button {\r\n\t\t\t\tpadding: 10px 20px; border-radius: 5px; cursor: pointer;\r\n\t\t\t\tborder: 1px solid transparent; font-weight: 600;\r\n\t\t\t}\r\n\t\t\t.popup-overlay {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\tjustify-content: center;\r\n\t\t\t\talign-items: center;\r\n\t\t\t}\r\n\r\n\t\t\t.popup-card {\r\n\t\t\t\tborder-radius: 8px;\r\n\t\t\t\twidth: 90%;\r\n\t\t\t\ttransform: scale(0.8);\r\n\t\t\t\ttransition: transform 0.3s ease;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\toverflow: auto;\r\n\t\t\t\tpadding: 0 20px 20px;\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tscroll-snap-type: x mandatory;\r\n\t\t\t}\r\n\r\n\t\t\t.popup-overlay.show .popup-card {\r\n\t\t\t\ttransform: scale(1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\t.popup-header {\r\n\t\t\t\tposition: sticky;\r\n\t\t\t\tleft: 0;\r\n\t\t\t\ttop: 0;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\talign-items: center;\r\n\t\t\t\tjustify-content: space-between;\r\n\t\t\t\tpadding: 20px 0;\r\n\t\t\t}\r\n\r\n\r\n\t\t\t.popup-products {\r\n\t\t\t\tdisplay: flex;\r\n\t\t\t\twhite-space: nowrap;\r\n\t\t\t\tmargin: 0 -6px;\r\n\t\t\t}\r\n\r\n\t\t\t.popup-product-item {\r\n\t\t\t\tposition: relative;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tmax-width: 25%;\r\n\t\t\t\tflex-shrink: 0;\r\n\t\t\t\tpadding: 0 6px 0;\r\n\t\t\t\twhite-space: normal;\r\n\t\t\t\tword-wrap: break-word;\r\n\t\t\t\tscroll-snap-align: center;\r\n\t\t\t}\r\n\t\t\t.popup-product-item .select-swap {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tborder-radius: 12px;\r\n\t\t\t}\r\n\t\t\t.popup-product-info h4 {\r\n\t\t\t\tmargin: 10px 0;\r\n\t\t\t\tfont-family: Mabry Pro,sans-serif;\r\n\t\t\t\ttext-align: left;\r\n\t\t\t}\r\n\t\t\t.popup-product-info p{\r\n\t\t\t\ttext-align: left;\r\n\t\t\t\tmargin-bottom: 10px;\r\n\t\t\t}\r\n\r\n\t\t\t.image-product {\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding-top: 100%;\r\n\t\t\t}\r\n\r\n\t\t\t.popup-product-item img {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\tdisplay: block;\r\n\t\t\t\tposition: absolute;\r\n\t\t\t\ttop: 0;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tobject-fit: cover;\r\n\t\t\t}\r\n\r\n\t\t\t@media only screen and (max-width: 575px) {\r\n\t\t\t\t.popup-header {\r\n\t\t\t\t\tpadding: 10px 0;\r\n\t\t\t\t}\r\n\t\t\t\t.popup-product-item {\r\n\t\t\t\t\tmax-width: 100%;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t`;\r\n    const styleSheet = document.createElement(\"style\");\r\n    styleSheet.type = \"text/css\";\r\n    styleSheet.innerText = styles;\r\n    document.head.appendChild(styleSheet);\r\n  }\r\n\r\n  // --- Action Functions & Modal/Sidebar Logic ---\r\n\r\n  /**\r\n   * NEW: Shows a custom confirmation dialog.\r\n   * @param {string} message - The message to display to the user.\r\n   * @returns {Promise<boolean>} - A promise that resolves to true if confirmed, false otherwise.\r\n   */\r\n  function showConfirmation(message, showConfirmationButtons = false) {\r\n    return new Promise((resolve) => {\r\n      const overlay = document.createElement(\"div\");\r\n      overlay.className = \"custom-confirm-overlay\";\r\n\r\n      const modal = document.createElement(\"div\");\r\n      modal.className = \"custom-confirm-modal\";\r\n\r\n      const msg = document.createElement(\"p\");\r\n      msg.className = \"custom-confirm-message\";\r\n      msg.innerHTML = message;\r\n\t  \r\n      const btnContainer = document.createElement(\"div\");\r\n      btnContainer.className = \"custom-confirm-buttons\";\r\n\r\n      const confirmBtn = document.createElement(\"button\");\r\n      confirmBtn.textContent = \"Confirm\";\r\n      confirmBtn.className = \"btn-submit\";\r\n\r\n      const cancelBtn = document.createElement(\"button\");\r\n      cancelBtn.textContent = \"Cancel\";\r\n      cancelBtn.className = \"btn-cancel\";\r\n\r\n      btnContainer.appendChild(cancelBtn);\r\n      btnContainer.appendChild(confirmBtn);\r\n      modal.appendChild(msg);\r\n\t  if(showConfirmationButtons) {\r\n      \tmodal.appendChild(btnContainer);\r\n\t  }\r\n\r\n      overlay.appendChild(modal);\r\n      document.body.appendChild(overlay);\r\n\r\n      // Animate in\r\n      setTimeout(() => overlay.classList.add(\"visible\"), 10);\r\n\r\n      const close = (confirmation) => {\r\n        overlay.classList.remove(\"visible\");\r\n        setTimeout(() => {\r\n          overlay.remove();\r\n          resolve(confirmation);\r\n        }, 200); // Wait for animation\r\n      };\r\n\r\n      confirmBtn.addEventListener(\"click\", () => close(true));\r\n      cancelBtn.addEventListener(\"click\", () => close(false));\r\n      overlay.addEventListener(\"click\", (e) => {\r\n        if (e.target === overlay) close(false);\r\n      });\r\n    });\r\n  }\r\n\r\n  /**\r\n   * Toggles the loading state of a button, showing a spinner and disabling it.\r\n   * @param {HTMLButtonElement} button - The button element to target.\r\n   * @param {boolean} isLoading - The desired loading state.\r\n   */\r\n  function toggleButtonLoader(button, isLoading) {\r\n    if (button) {\r\n      button.disabled = isLoading;\r\n      button.classList.toggle(\"loading\", isLoading);\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Closes any active modal or sidebar and removes its overlay.\r\n   * @param {boolean} [isSidebar=false] - Set to true if closing a sidebar to handle its specific animation.\r\n   */\r\n  function closeModal(isSidebar = false) {\r\n    const overlay = document.querySelector(\".custom-modal-overlay\");\r\n    if (overlay) {\r\n      overlay.classList.remove(\"visible\");\r\n      if (isSidebar) {\r\n        const sidebar = overlay.querySelector(\".custom-sidebar\");\r\n        if (sidebar) sidebar.classList.remove(\"open\");\r\n      }\r\n      setTimeout(() => overlay.remove(), 300); // Wait for animations to finish\r\n    }\r\n  }\r\n\r\n  /**\r\n   * Opens a modal to add a single product to a subscription.\r\n   * @param {object} product - The product data { id, title, img }.\r\n   * @param {object} schedule - The subscription schedule data.\r\n   */\r\n  function openProductModal(product, schedule) {\r\n    const overlay = document.createElement(\"div\");\r\n    overlay.className = \"custom-modal-overlay\";\r\n    overlay.innerHTML = `\r\n\t\t\t<div class=\"custom-modal-content\">\r\n\t\t\t\t<button class=\"custom-modal-close\">&times;</button>\r\n\t\t\t\t<div class=\"custom-modal-header\">\r\n\t\t\t\t\t<img src=\"${product.img}\">\r\n\t\t\t\t\t<h4>Add to Subscription #${product.title}</h4>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"custom-modal-footer\">\r\n\t\t\t\t\t<button class=\"btn-cancel\">Cancel</button>\r\n\t\t\t\t\t<button class=\"btn-submit\">Add to Subscription</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t`;\r\n    document.body.appendChild(overlay);\r\n    setTimeout(() => overlay.classList.add(\"visible\"), 10);\r\n\r\n    const submitBtn = overlay.querySelector(\".btn-submit\");\r\n\r\n    overlay\r\n      .querySelector(\".custom-modal-close\")\r\n      .addEventListener(\"click\", () => closeModal());\r\n    overlay\r\n      .querySelector(\".btn-cancel\")\r\n      .addEventListener(\"click\", () => closeModal());\r\n    overlay.addEventListener(\"click\", (e) => {\r\n      if (e.target === overlay) closeModal();\r\n    });\r\n\r\n    submitBtn.addEventListener(\"click\", async () => {\r\n      toggleButtonLoader(submitBtn, true);\r\n\r\n      const existingItems = schedule.productVariants.map((variant) => ({\r\n        productVariantShopifyId: variant.shopifyId,\r\n        quantity: 1,\r\n        not_interested: false,\r\n        remove: false,\r\n      }));\r\n      const newItem = {\r\n        productVariantShopifyId: product.id,\r\n        quantity: 1,\r\n        not_interested: false,\r\n        remove: false,\r\n      };\r\n\r\n      const payload = {\r\n        shopify_subscription_id: schedule.shopify_subscription_id,\r\n        items: [...existingItems, newItem],\r\n        sequence: schedule.sequence,\r\n        quantity: 1,\r\n      };\r\n\r\n      // --- Restored original HMAC and timestamp for this specific API call ---\r\n      const hmac = hmacSig;\r\n      const timestamp = hmacTimeLine;\r\n      const headers = new Headers();\r\n      headers.append(\"Content-Type\", \"application/json\");\r\n      headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n      headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n      try {\r\n        const response = await fetch(\r\n          \"https://api.nuudafood.com/v2/subscription/update-bundle\",\r\n          {\r\n            method: \"PUT\",\r\n            headers,\r\n            body: JSON.stringify(payload),\r\n          }\r\n        );\r\n        const result = await response.json();\r\n        if (response.ok) {\r\n          // Or response.status === 200\r\n          window.location.reload();\r\n        }\r\n        closeModal();\r\n        await renderCustomUI(); // Refresh the entire UI to show the new product\r\n      } catch (err) {\r\n        console.error(\"API Error:\", err);\r\n      } finally {\r\n        toggleButtonLoader(submitBtn, false);\r\n      }\r\n    });\r\n  }\r\n\r\n  async function fetchUpsellProducts(search = \"\") {\r\n    const hmac = hmacSig;\r\n    const timestamp = hmacTimeLine;\r\n    const headers = new Headers();\r\n    headers.append(\"Content-Type\", \"application/json\");\r\n    headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n    headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n    let allProducts = [];\r\n    let hasNextPage = true;\r\n    let endCursor = null;\r\n\r\n    while (hasNextPage) {\r\n      const url = new URL(\"https://api.nuudafood.com/v2/products\");\r\n      url.searchParams.set(\"first\", 100);\r\n      if (endCursor) url.searchParams.set(\"after\", endCursor);\r\n      if (search) url.searchParams.set(\"search\", search);\r\n\r\n      const response = await fetch(url.toString(), {\r\n        method: \"GET\",\r\n        headers,\r\n        redirect: \"follow\",\r\n      });\r\n\r\n      const resJson = await response.json();\r\n\r\n      if (resJson.data && resJson.data.edges && resJson.data.edges.length > 0) {\r\n        const edges = resJson.data.edges;\r\n        const pageInfo = resJson.data.pageInfo;\r\n\r\n        allProducts = allProducts.concat(edges);\r\n\r\n        hasNextPage = pageInfo.hasNextPage ?? false;\r\n        endCursor = pageInfo.endCursor ?? null;\r\n      } else {\r\n        hasNextPage = false;\r\n      }\r\n    }\r\n\r\n    return allProducts;\r\n  }\r\n\r\n  // Fetch Disliked Product\r\n  let dislikedProducts = []; // <-- Global variable\r\n\r\n  async function fetchDislikedProducts(subscriptionId) {\r\n    const myHeaders = new Headers();\r\n    myHeaders.append(\"x-shopify-api-hmac-h\", hmacSig);\r\n    myHeaders.append(\"x-shopify-api-timestamp\", hmacTimeLine);\r\n    myHeaders.append(\"Content-Type\", \"application/json\");\r\n\r\n    const requestOptions = {\r\n      method: \"GET\",\r\n      headers: myHeaders,\r\n      redirect: \"follow\",\r\n    };\r\n\r\n    try {\r\n      const response = await fetch(\r\n        `https://api.nuudafood.com/v2/subscription/get-dislike-products/${subscriptionId}`,\r\n        requestOptions\r\n      );\r\n      const result = await response.json();\r\n      if (result.success && result.data) {\r\n        dislikedProducts = result.data.map((p) => p.product_id); // store product_id\r\n      } else {\r\n        dislikedProducts = [];\r\n      }\r\n    } catch (err) {\r\n      console.error(\"Error fetching disliked products:\", err);\r\n      dislikedProducts = [];\r\n    }\r\n  }\r\n\r\n  window.handleDislike = async function (productId, shopify_subscription_id) {\r\n    const confirmed = await showConfirmation(\r\n      \"Are you sure you're not interested in this product?\",\r\n\t  true\r\n    );\r\n    if (!confirmed) return;\r\n\r\n    const productEl = document.getElementById(`product-${productId}`);\r\n    if (productEl) {\r\n      productEl.remove();\r\n    }\r\n\r\n    const payload = {\r\n      subscription_id: Number(shopify_subscription_id),\r\n      shopifyId: Number(productId),\r\n    };\r\n\r\n    const hmac = hmacSig;\r\n    const timestamp = hmacTimeLine;\r\n\r\n    const headers = new Headers();\r\n    headers.append(\"Content-Type\", \"application/json\");\r\n    headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n    headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n    try {\r\n      const response = await fetch(\r\n        \"https://api.nuudafood.com/v2/subscription/dislike-product\",\r\n        {\r\n          method: \"POST\",\r\n          headers,\r\n          body: JSON.stringify(payload),\r\n        }\r\n      );\r\n      if (response.ok) {\r\n        window.location.reload();\r\n      }\r\n      const result = await response.json();\r\n    } catch (err) {\r\n      console.error(\"API Error:\", err);\r\n    }\r\n  };\r\n\r\n  window.handleSwap = async function (\r\n    productId,\r\n    shopify_subscription_id,\r\n    scheduleIndex\r\n  ) {\r\n    if(subscriptionId === null) {\r\n      subscriptionId = getLoopSubscriptionIdFromURL();\r\n      await getCustomerDetails();\r\n    }\r\n    \r\n    let htmlMarkUp = ` <div class=\"popup-overlay show\">\r\n\t\t\t<div class=\"popup-card\">\r\n\t\t\t\t<div class=\"popup-header\">\r\n\t\t\t\t\t<h3>Swap your product</h3>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"popup-products\">`;\r\n\r\n\tlet existsInBreakfast = window.loopdata.subscription_data.suggested_products.breakfast\r\n\t.some(item =>\r\n\t\tString(item.id) === productId ||\r\n\t\t(item.metadata?.variants || []).some(v => String(v.id) === productId)\r\n\t);\r\n\r\n\tlet existsInLunch = window.loopdata.subscription_data.suggested_products.main_meals\r\n\t.some(item =>\r\n\t\tString(item.id) === productId ||\r\n\t\t(item.metadata?.variants || []).some(v => String(v.id) === productId)\r\n\t);\r\n\r\n\tlet productsForSwap = [];\r\n\tif(existsInBreakfast) {\r\n\t\tproductsForSwap = window.loopdata.subscription_data.suggested_products.breakfast;\r\n\t} else {\r\n\t\tproductsForSwap = window.loopdata.subscription_data.suggested_products.main_meals;\r\n\t}\r\n\r\n    $(productsForSwap).each(\r\n      (index, product) => {\r\n\t\tif(product?.metadata?.image) {\r\n        htmlMarkUp += `\r\n\t\t\t\t<div class=\"popup-product-item\">\r\n\t\t\t\t\t<a href=\"${product?.full_url}\">\r\n\t\t\t\t\t\t<div class=\"image-product\">\r\n\t\t\t\t\t\t<img src=\"${product?.metadata?.image}\" alt=\"${product?.metadata?.title}\">\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"popup-product-info\">\r\n\t\t\t\t\t\t<h4>${product?.metadata?.title}</h4>\r\n\t\t\t\t\t\t<p><span>\u00A3</span>${product?.metadata?.variants[0]?.price}</p>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t\t<button class=\"select-swap btn btn--primary data-swapbtn\" data-swapbutton\r\n\t\t\t\t\tdata-current-variant=\"${productId}\" \r\n\t\t\t\t\tdata-variant-to-swapwith=\"${product?.metadata?.variants[0].id}\"\r\n\t\t\t\t\tdata-schedule-index=\"${scheduleIndex}\"\r\n\t\t\t\t\tdata-subscription-id=\"${shopify_subscription_id}\"\r\n\t\t\t\t\t>Select</button>\r\n\t\t\t\t</div>`;\r\n\t\t}\r\n      }\r\n    );\r\n\r\n    htmlMarkUp += `\r\n    \t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>`;\r\n\r\n    const confirmed = await showConfirmation(htmlMarkUp, false);\r\n    if (!confirmed) return;\r\n  };\r\n\r\n  /**\r\n   * Opens a sidebar for adding multiple products to the subscription.\r\n   * @param {object} schedule - The subscription schedule data.\r\n   */\r\n\r\n  function extractVariantId(fullId) {\r\n    return fullId.split(\"/\").pop();\r\n  }\r\n\r\n  async function openVariantSidebar(product, schedule) {\r\n    console.log(product, \"prod\");\r\n\r\n    const existing = document.querySelector(\".variant-sidebar-overlay\");\r\n    if (existing) existing.remove();\r\n\r\n    const overlay = document.createElement(\"div\");\r\n    overlay.className = \"variant-sidebar-overlay\";\r\n    Object.assign(overlay.style, {\r\n      position: \"fixed\",\r\n      top: \"0\",\r\n      left: \"0\",\r\n      width: \"100%\",\r\n      height: \"100%\",\r\n      zIndex: \"555555\",\r\n      background: \"rgba(0,0,0,0.5)\",\r\n      display: \"flex\",\r\n      justifyContent: \"flex-end\",\r\n    });\r\n\r\n    overlay.innerHTML = `\r\n\t\t<div class=\"variant-sidebar\" style=\"position: relative;\r\n\t    display: flex;\r\n\t    flex-direction: column;\r\n\t    height: 100vh;\r\n\t    max-width: 400px;\r\n\t    width: 100%;\r\n\t    background: #fff;\r\n\t    padding: 0;\">\r\n\t\t\t<div class=\"variant-sidebar-header\" style=\"display: flex;\r\n\t    justify-content: space-between;\r\n\t    font-size: 22px;\r\n\t    background: #fff;\r\n\t    width: 100%;\r\n\t    padding: 10px;\">\r\n\t\t\t\t<h4>Select Product</h4>\r\n\t\t\t\t<button class=\"variant-close\">&times;</button>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"variant-sidebar-body\" style=\"flex: 1; overflow: auto; padding: 20px 10px 80px;\">\r\n\t\t\t\t<img src=\"${product.image}\" alt=\"${\r\n      product.title\r\n    }\" style=\"max-width: 90%; margin-bottom: 10px;\">\r\n\t\t\t\t<h4>${product.title}</h4>\r\n\t\t\t\t<select class=\"variant-select loop-form-select pe-4\" style=\"width: 100%; margin-bottom: 10px;\">\r\n\t\t\t\t\t${product?.variants\r\n            ?.map(\r\n              (v) =>\r\n                `<option value=\"${v.id}\" data-price=\"${v.price}\">${v.title} - \u00A3${v.price}</option>`\r\n            )\r\n            .join(\"\")}\r\n\t\t\t\t</select>\r\n\t\t\t\t<div class=\"variant-price\" style=\"font-weight: bold; margin-bottom: 10px;\">\u00A3${\r\n          product?.variants[0]?.price\r\n        }</div>\r\n\t\t\t\t<div class=\"variant-description\" id=\"variant-description\"></div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"variant-sidebar-footer\" style=\"padding: 10px; background: #fff; display: flex; justify-content: space-between;\">\r\n\t\t\t\t<button class=\"btn-cancel\" style=\"width: 100%;\">Cancel</button>\r\n\t\t\t\t<button class=\"btn-confirm loop-btn loop-btn-primary loop-btn-size-lg\" style=\"width: 100%;\">Confirm</button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t`;\r\n\r\n    document.body.appendChild(overlay);\r\n    document.body.style.overflow = \"hidden\";\r\n\r\n    const sidebar = overlay.querySelector(\".variant-sidebar\");\r\n\r\n    const descriptionContainer = sidebar.querySelector(\"#variant-description\");\r\n    descriptionContainer.innerHTML =\r\n      product.descriptionHtml || \"<p>No description available</p>\";\r\n\r\n    setTimeout(() => {\r\n      overlay.classList.add(\"visible\");\r\n      sidebar.classList.add(\"open\");\r\n    }, 10);\r\n\r\n    const closeSidebar = () => {\r\n      overlay.remove();\r\n      document.body.style.overflow = \"\";\r\n    };\r\n\r\n    overlay\r\n      .querySelector(\".variant-close\")\r\n      .addEventListener(\"click\", closeSidebar);\r\n    overlay\r\n      .querySelector(\".btn-cancel\")\r\n      .addEventListener(\"click\", closeSidebar);\r\n\r\n    // close when clicking outside sidebar\r\n    overlay.addEventListener(\"click\", (e) => {\r\n      if (e.target === overlay) closeSidebar();\r\n    });\r\n\r\n    const select = overlay.querySelector(\".variant-select\");\r\n    const priceBox = overlay.querySelector(\".variant-price\");\r\n\r\n    if (\r\n      product.variants.length === 1 &&\r\n      product.variants[0].title === \"Default Title\"\r\n    ) {\r\n      select.style.display = \"none\";\r\n    } else {\r\n      select.style.display = \"block\";\r\n    }\r\n\r\n    priceBox.textContent = `\u00A3${product.variants[0].price}`;\r\n\r\n    select.addEventListener(\"change\", (e) => {\r\n      const selectedOption = e.target.selectedOptions[0];\r\n      priceBox.textContent = `\u00A3${selectedOption.dataset.price}`;\r\n    });\r\n\r\n    // select.addEventListener('change', (e) => {\r\n    // \tconst selectedOption = e.target.selectedOptions[0];\r\n    // \tpriceBox.textContent = `\u00A3${selectedOption.dataset.price}`;\r\n    // });\r\n\r\n    overlay\r\n      .querySelector(\".btn-confirm\")\r\n      .addEventListener(\"click\", async () => {\r\n        showLoader();\r\n        const selectedOption = select.selectedOptions[0];\r\n        const variantId = parseInt(selectedOption.value, 10);\r\n\r\n        const payload = {\r\n          shopify_subscription_id: schedule.shopify_subscription_id,\r\n          items: [\r\n            ...schedule.productVariants.map((v) => ({\r\n              productVariantShopifyId: v.shopifyId,\r\n              quantity: 1,\r\n              not_interested: false,\r\n              remove: false,\r\n            })),\r\n            {\r\n              productVariantShopifyId: variantId,\r\n              quantity: 1,\r\n              not_interested: false,\r\n              remove: false,\r\n            },\r\n          ],\r\n          sequence: schedule.sequence,\r\n          quantity: 1,\r\n        };\r\n\r\n        const headers = new Headers();\r\n        headers.append(\"Content-Type\", \"application/json\");\r\n        headers.append(\"x-shopify-api-hmac-h\", hmacSig);\r\n        headers.append(\"x-shopify-api-timestamp\", hmacTimeLine);\r\n\r\n        try {\r\n          const response = await fetch(\r\n            \"https://api.nuudafood.com/v2/subscription/update-bundle\",\r\n            {\r\n              method: \"PUT\",\r\n              headers,\r\n              body: JSON.stringify(payload),\r\n            }\r\n          );\r\n          const result = await response.json();          \r\n          if (response.ok) window.location.reload();\r\n          //removeLoader();\r\n          closeSidebar();\r\n        } catch (err) {\r\n          console.error(\"API Error:\", err);\r\n        }\r\n      });\r\n  }\r\n\r\n  async function openBundleSidebar(schedule) {\r\n    await fetchDislikedProducts(schedule.shopify_subscription_id);\r\n\r\n    document.body.style.overflow = \"hidden\";\r\n    const overlay = document.createElement(\"div\");\r\n    overlay.className = \"custom-modal-overlay\";\r\n    overlay.innerHTML = `\r\n\t\t\t<div class=\"custom-sidebar\">\r\n\t\t\t<div class=\"sidebar-header\">\r\n\t\t\t\t<h4>Add Products to Bundle</h4>\r\n\t\t\t\t<input type=\"text\" id=\"sidebar-product-search\" placeholder=\"Search for products...\" class=\"loop-form-input\">\r\n\t\t\t\t<button class=\"custom-modal-close\">&times;</button>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"sidebar-body\" id=\"sidebar-product-list\">\r\n\t\t\t\t<p>Loading products...</p>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t</div>\r\n\t\t`;\r\n    document.body.appendChild(overlay);\r\n\r\n    const sidebar = overlay.querySelector(\".custom-sidebar\");\r\n    const sidebarBody = sidebar.querySelector(\"#sidebar-product-list\");\r\n    const searchInput = sidebar.querySelector(\"#sidebar-product-search\");\r\n\r\n    setTimeout(() => {\r\n      overlay.classList.add(\"visible\");\r\n      sidebar.classList.add(\"open\");\r\n    }, 10);\r\n\r\n    const result = await fetchUpsellProducts();\r\n    let allProducts = [];\r\n\r\n    const renderProducts = (productsToRender) => {\r\n      const filteredProducts = productsToRender.filter(\r\n        (p) => !p.variants.some((v) => dislikedProducts.includes(String(v.id)))\r\n      );\r\n\r\n      if (filteredProducts.length > 0) {\r\n        sidebarBody.innerHTML = filteredProducts\r\n          .map((p) => {\r\n            const firstVariant = p.variants[0];\r\n\r\n            return `\r\n\t\t\t\t<div id=\"product-${p.product_id}\" class=\"product-wrap\">\r\n\t\t\t\t\t<div class=\"product-selection-row\" \r\n\t\t\t\t\t\tdata-product-id=\"${firstVariant.id}\" \r\n\t\t\t\t\t\tdata-product='${JSON.stringify(p).replace(/'/g, \"&apos;\")}'>\r\n\t\t\t\t\t\t<img src=\"${p.image}\" alt=\"${p.title}\">\r\n\t\t\t\t\t\t<div class=\"product-info\">\r\n\t\t\t\t\t\t\t<div class=\"product-title\">${p.title}</div>\r\n\t\t\t\t\t\t\t<div class=\"product-price\">\u00A3${firstVariant.price}</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<button class=\"loop-btn loop-btn-outline data-not-interested-button\"\r\n\t\t\t\t\t\tstyle=\"font-size: 12px;\"\r\n\t\t\t\t\t\tonclick=\"handleDislike('${firstVariant.id}', '${\r\n              schedule.shopify_subscription_id\r\n            }')\">\r\n\t\t\t\t\t\tNot interested\r\n\t\t\t\t\t</button>\r\n\t\t\t\t\t<button class=\"variant-btn\" data-product='${JSON.stringify(p).replace(\r\n            /'/g,\r\n            \"&apos;\"\r\n          )}'>\r\n\t\t\t\t\t\tChoose Variant\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t`;\r\n          })\r\n          .join(\"\");\r\n      } else {\r\n        sidebarBody.innerHTML = \"<p>No matching products found.</p>\";\r\n      }\r\n\r\n      // attach click for variant selection\r\n      sidebarBody.querySelectorAll(\".variant-btn\").forEach((btn) => {\r\n        btn.addEventListener(\"click\", (e) => {\r\n          const product = JSON.parse(\r\n            e.target.dataset.product.replace(/&apos;/g, \"'\")\r\n          );\r\n          console.log(product, \"prodata\");\r\n          openVariantSidebar(product, schedule);\r\n        });\r\n      });\r\n    };\r\n\r\n    if (result.length > 0) {\r\n      // allProducts = result.map(({ node }) => {\r\n      // \tconsole.log(allProducts, node, '1234');\r\n      // \tfor(const variantsLoop of node.variants.edges) {\r\n      // \tconst firstVariant = node.variants.edges[0]?.node ?? {};\r\n      // \tconst firstImage = node.images.edges[0]?.node ?? {};\r\n\r\n      // \treturn {\r\n      // \t\tvariant_shopify_id: firstVariant.id.split('/').pop(),\r\n      // \t\tproduct_title: node.title,\r\n      // \t\tprice: firstVariant.price,\r\n      // \t\timage:\r\n      // \t\t\tfirstImage.src ||\r\n      // \t\t\t'https://cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png',\r\n      // \t};\r\n      // \t}\r\n\r\n      // });\r\n      result.forEach(({ node }) => {\r\n        const firstImage =\r\n          node?.images?.edges[0]?.node?.src ??\r\n          \"https://cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png\";\r\n\r\n        const variants = node.variants.edges.map(({ node: v }) => ({\r\n          id: v.id.split(\"/\").pop(),\r\n          title: v.title,\r\n          price: v.price,\r\n          image: v?.image?.edges?.[0]?.node?.src ?? firstImage,\r\n        }));\r\n\r\n        allProducts.push({\r\n          product_id: node.id.split(\"/\").pop(),\r\n          title: node.title,\r\n          image: firstImage,\r\n          variants,\r\n          descriptionHtml: node.descriptionHtml || \"\",\r\n        });\r\n      });\r\n\r\n      renderProducts(allProducts);\r\n    } else {\r\n      sidebarBody.innerHTML = \"<p>No products found.</p>\";\r\n    }\r\n\r\n    searchInput.addEventListener(\"input\", (e) => {\r\n      const searchTerm = e.target.value.toLowerCase();\r\n      const filteredProducts = allProducts.filter(\r\n        (product) =>\r\n          product.title.toLowerCase().includes(searchTerm) ||\r\n          product.variants.some((v) =>\r\n            v.title.toLowerCase().includes(searchTerm)\r\n          )\r\n      );\r\n      renderProducts(filteredProducts);\r\n    });\r\n\r\n    sidebar\r\n      .querySelector(\".custom-modal-close\")\r\n      .addEventListener(\"click\", () => {\r\n        closeModal(true);\r\n        document.body.style.overflow = \"auto\";\r\n      });\r\n    overlay.addEventListener(\"click\", (e) => {\r\n      if (e.target === overlay) {\r\n        closeModal(true);\r\n        document.body.style.overflow = \"auto\";\r\n      }\r\n    });\r\n  }\r\n\r\n  /**\r\n   * Opens a sidebar for managing (removing) products from the subscription.\r\n   * @param {object} schedule - The subscription schedule data.\r\n   * @param {object} productsMap - A map of product IDs to product details.\r\n   */\r\n  function openManageSidebar(schedule, productsMap, index) {\r\n    const overlay = document.createElement(\"div\");\r\n    overlay.className = `custom-modal-overlay data-schedule-index-${index}`;\r\n    overlay.innerHTML = `\r\n\t\t\t<div class=\"custom-sidebar manage-sidebar\">\r\n\t\t\t\t<div class=\"sidebar-header\">\r\n\t\t\t\t\t<div class=\"header-top\">\r\n\t\t\t\t\t\t<h4>Manage Your Products</h4>\r\n\t\t\t\t\t\t<button class=\"custom-modal-close\">&times;</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"sidebar-body\"></div>\r\n\t\t\t\t<div class=\"sidebar-footer\">\r\n\t\t\t\t\t<div class=\"custom-modal-footer\">\r\n\t\t\t\t\t\t<button class=\"btn-cancel\">Cancel</button>\r\n\t\t\t\t\t\t<button class=\"btn-submit\" id=\"update-remove-bundle\">Remove From Subscription</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t`;\r\n    document.body.appendChild(overlay);\r\n\r\n    const sidebar = overlay.querySelector(\".custom-sidebar\");\r\n    const sidebarBody = sidebar.querySelector(\".sidebar-body\");\r\n    const submitBtn = document.getElementById(\"update-remove-bundle\");\r\n\r\n    let currentItems = JSON.parse(JSON.stringify(schedule.productVariants));\r\n\r\n    const renderManageableProducts = () => {\r\n      const itemsInSubscription = currentItems.filter((item) => !item.remove);\r\n      if (itemsInSubscription.length === 0) {\r\n        sidebarBody.innerHTML =\r\n          '<p style=\"text-align:center; padding: 20px; color: #666;\">There are no products in this subscription.</p>';\r\n        submitBtn.disabled = true;\r\n        return;\r\n      }\r\n\r\n      sidebarBody.innerHTML = itemsInSubscription\r\n        .map((variant) => {\r\n          const product = productsMap[variant.shopifyId];\r\n          if (!product) return \"\";\r\n          return `\r\n\t\t\t\t\t<div class=\"product-wrap\">\r\n\t\t\t\t\t\t<div class=\"manage-product-row d-flex align-items-center\" data-variant-id=\"${variant.shopifyId}\">\r\n\t\t\t\t\t\t\t<input type=\"checkbox\" class=\"product-checkbox\">\r\n\t\t\t\t\t\t\t<img src=\"${product.imageURL}\" alt=\"${product.title}\" style=\"width:50px; height:50px; object-fit:cover; margin:0 10px;\">\r\n\t\t\t\t\t\t\t<div class=\"product-info\">\r\n\t\t\t\t\t\t\t\t<div>${product.title}</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<button class=\"loop-btn loop-btn-outline\"\r\n\t\t\t\t\t\t\tstyle=\"font-size: 12px;\"\r\n\t\t\t\t\t\t\tonclick=\"handleSwap('${variant.shopifyId}', '${schedule.shopify_subscription_id}', '${index}')\">\r\n\t\t\t\t\t\t\tSwap Product\r\n\t\t\t\t\t\t</button>\r\n\r\n\t\t\t\t\t\t<button class=\"loop-btn loop-btn-outline data-not-interested-button\"\r\n\t\t\t\t\t\t\tstyle=\"font-size: 12px;\"\r\n\t\t\t\t\t\t\tonclick=\"handleDislike('${variant.shopifyId}', '${schedule.shopify_subscription_id}')\">\r\n\t\t\t\t\t\t\tNot interested\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t`;\r\n        })\r\n        .join(\"\");\r\n    };\r\n\r\n    sidebar\r\n      .querySelector(\".custom-modal-close\")\r\n      .addEventListener(\"click\", () => closeModal(true));\r\n    sidebar\r\n      .querySelector(\".btn-cancel\")\r\n      .addEventListener(\"click\", () => closeModal(true));\r\n    overlay.addEventListener(\"click\", (e) => {\r\n      if (e.target === overlay) closeModal(true);\r\n    });\r\n\r\n    submitBtn.addEventListener(\"click\", async () => {\r\n      showLoader();\r\n      const itemsToKeep = [];\r\n      const itemsToRemove = [];\r\n\r\n      sidebar.querySelectorAll(\".manage-product-row\").forEach((row) => {\r\n        const variantId = parseInt(row.dataset.variantId, 10);\r\n        const isChecked = row.querySelector(\".product-checkbox\").checked;\r\n\r\n        const item = {\r\n          productVariantShopifyId: variantId,\r\n          quantity: 1, // Assuming quantity 1 for now\r\n        };\r\n\r\n        if (isChecked) {\r\n          itemsToRemove.push({ ...item, remove: true });\r\n        } else {\r\n          itemsToKeep.push({ ...item, remove: false });\r\n        }\r\n      });\r\n\r\n      if (itemsToRemove.length === 0) {\r\n        console.error(\"Please select products to remove.\");\r\n        return;\r\n      }\r\n\r\n      toggleButtonLoader(submitBtn, true);\r\n\r\n      const payload = {\r\n        shopify_subscription_id: schedule.shopify_subscription_id,\r\n        items: [...itemsToKeep, ...itemsToRemove], // Send all items with their 'remove' status\r\n        sequence: schedule.sequence,\r\n        quantity: 1,\r\n      };\r\n\r\n      // --- Restored original HMAC and timestamp for this specific API call ---\r\n      const hmac = hmacSig;\r\n      const timestamp = hmacTimeLine;\r\n      const headers = new Headers();\r\n      headers.append(\"Content-Type\", \"application/json\");\r\n      headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n      headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n      try {\r\n        const response = await fetch(\r\n          \"https://api.nuudafood.com/v2/subscription/update-bundle\",\r\n          {\r\n            method: \"PUT\",\r\n            headers,\r\n            body: JSON.stringify(payload),\r\n          }\r\n        );\r\n\r\n        const result = await response.json();\r\n        if (response.ok) {\r\n          window.location.reload();\r\n        }\r\n        console.error(\"Subscription updated successfully!\");\r\n        closeModal(true);\r\n      } catch (error) {\r\n        console.error(\"API Error:\", error);\r\n      } finally {\r\n        toggleButtonLoader(submitBtn, false);\r\n      }\r\n    });\r\n\r\n    renderManageableProducts();\r\n    setTimeout(() => {\r\n      overlay.classList.add(\"visible\");\r\n      sidebar.classList.add(\"open\");\r\n    }, 10);\r\n  }\r\n\r\n  /**\r\n   * Creates the block displaying the next order date.\r\n   * @param {object} product - The schedule data.\r\n   * @returns {HTMLElement} The created block element.\r\n   */\r\n  function formatDate(dateString) {\r\n    const options = { year: \"numeric\", month: \"long\", day: \"numeric\" };\r\n    const date = new Date(dateString);\r\n    return date.toLocaleDateString(undefined, options);\r\n  }\r\n\r\n  /**\r\n   * Creates the horizontal scrolling ribbon of upsell products.\r\n   * @param {object} schedule - The subscription schedule data.\r\n   * @param {number} index - A unique index for element IDs.\r\n   * @param {Array} upsellProducts - The list of products to show.\r\n   * @returns {HTMLElement} The ribbon element.\r\n   */\r\n\r\n  async function createUpsellRibbon(schedule, index, upsellProducts) {\r\n    await fetchDislikedProducts(schedule.shopify_subscription_id);\r\n\r\n    // Filter out disliked products\r\n    const filteredProducts = upsellProducts.filter(\r\n      (p) => !p.variants.some((v) => dislikedProducts.includes(String(v.id)))\r\n    );\r\n\r\n    const productsToShow = filteredProducts.slice(0, 10);\r\n    const ribbon = document.createElement(\"div\");\r\n    ribbon.className = `loop-banner-ribbon eq-loop-upsell-ribbon-${index}`;\r\n    if (index === 0) {\r\n      ribbon.style.backgroundColor = \"#3E451F\";\r\n    } else if (index === 1) {\r\n      ribbon.style.backgroundColor = \"#FFBFAC\";\r\n    } else {\r\n      ribbon.style.backgroundColor = \"#21382D\";\r\n    }\r\n\r\n    ribbon.id = `loop-upsell-ribbon-clone-${index}`;\r\n\r\n    const upsellProductMap = {};\r\n    productsToShow.forEach((p) => {\r\n      upsellProductMap[p.variant_shopify_id] = p;\r\n    });\r\n\r\n    const productsHTML = productsToShow\r\n      .map(\r\n        (p) => `\r\n\t\t\t<div class=\"me-2\" id=\"loop-upsell-ribbon-product-${\r\n        p.variant_shopify_id\r\n      }-clone-${index}\">\r\n\t\t\t\t<div\r\n\t\t\t\t\tclass=\"loop-card loop-card-upsell loop-pointer\"\r\n\t\t\t\t\tstyle=\"min-width: 300px;\"\r\n\t\t\t\t\tdata-product-id=\"${p.variant_shopify_id}\"\r\n\t\t\t\t\tdata-product-title=\"${p.title}\"\r\n\t\t\t\t\tdata-product-img=\"${p.image}\"\r\n\t\t\t\t>\r\n\t\t\t\t<div class=\"loop-card-body\">\r\n\t\t\t\t\t<div class=\"d-flex\">\r\n\t\t\t\t\t<div class=\"d-flex justify-content-center align-items-center flex-shrink-0 loop-image-product-sm me-3 flex-shrink-0\">\r\n\t\t\t\t\t\t<img src=\"${\r\n              p.image ||\r\n              \"https://cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png\"\r\n            }\" style=\"object-fit: contain; max-width: 100%; max-height: 100%;\">\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"d-flex flex-column justify-content-between flex-grow-1 py-1\">\r\n\t\t\t\t\t\t<div class=\"loop-text-p1\">${p.title}</div>\r\n\t\t\t\t\t\t<div class=\"d-flex justify-content-between\">\r\n\t\t\t\t\t\t<div class=\"d-flex align-items-baseline\">\r\n\t\t\t\t\t\t\t<div class=\"loop-text-p2 loop-text-muted my-1\">\u00A3${p.variants[0].price}</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"d-flex justify-content-center align-items-center loop-add-product-btn-icon\" style=\"background: rgb(0, 0, 0); border-radius: 50%; height: 25px; width: 25px;\">\r\n\t\t\t\t\t\t\t<svg width=\"12\" height=\"12\" viewBox=\"0 0 9 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"height: 12px; width: 12px;\"><path d=\"M0.5 5H4V8.5C4 8.63261 4.05268 8.75979 4.14645 8.85355C4.24021 8.94732 4.36739 9 4.5 9C4.63261 9 4.75979 8.94732 4.85355 8.85355C4.94732 8.75979 5 8.63261 5 8.5V5H8.5C8.63261 5 8.75979 4.94732 8.85355 4.85355C4.94732 4.75979 9 4.63261 9 4.5C9 4.36739 8.94732 4.24021 8.85355 4.14645C8.75979 4.05268 8.63261 4 8.5 4H5V0.5C5 0.367392 4.94732 0.240215 4.85355 0.146447C4.75979 0.0526785 4.63261 0 4.5 0C4.36739 0 4.24021 0.0526785 4.146447 0.146447C4.05268 0.240215 4 0.367392 4 0.5V4H0.5C0.367392 4 0.240215 4.05268 0.146447 4.14645C0.0526785 4.24021 0 4.36739 0 4.5C0 4.63261 0.0526785 4.75979 0.146447 4.85355C0.240215 4.94732 0.367392 5 0.5 5Z\" fill=\"white\"></path></svg>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t`\r\n      )\r\n      .join(\"\");\r\n\r\n    ribbon.innerHTML = `\r\n\t\t<div class=\"loop-card-upsell-header\">Goes well with your next order...</div>\r\n\t\t<div class=\"loop-scroll-container\" style=\"position: relative;\">\r\n\t\t\t<div class=\"my-3 d-flex overflow-scroll loop-hide-scrollbar\">\r\n\t\t\t\t${productsHTML}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<button class=\"loop-btn loop-btn-upsell loop-upsell-view-more-btn\">See more products</button>\r\n\t`;\r\n\r\n    ribbon.querySelectorAll(\".loop-card-upsell\").forEach((card) => {\r\n      card.addEventListener(\"click\", () => {\r\n        const productId = card.dataset.productId;\r\n        const product = upsellProductMap[productId];\r\n        if (!product) {\r\n          console.error(\"Product not found\", productId);\r\n          return;\r\n        }\r\n        openVariantSidebar(product, schedule);\r\n      });\r\n    });\r\n\r\n    ribbon\r\n      .querySelector(\".loop-upsell-view-more-btn\")\r\n      .addEventListener(\"click\", () => {\r\n        openBundleSidebar(schedule);\r\n      });\r\n\r\n    return ribbon;\r\n  }\r\n\r\n  /**\r\n   * Renders the block showing the current items in the subscription, with a \"Manage\" button.\r\n   * @param {object} schedule - The subscription schedule data.\r\n   * @param {object} productsMap - A map of product IDs to product details.\r\n   * @returns {HTMLElement} The subscription details element.\r\n   */\r\n  function renderSubscriptionsBelowRibbons(schedule, productsMap, index) {\r\n    const wrapper = document.createElement(\"div\");\r\n    wrapper.style.margin = \"15px 0\";\r\n\r\n    const header = document.createElement(\"h4\");\r\n    if (index === 0) {\r\n      header.textContent = `Your next delivery`;\r\n    } else if (index === 1) {\r\n      header.textContent = `Your delivery after that`;\r\n    } else {\r\n      header.textContent = `Your delivery after that`;\r\n    }\r\n\r\n    header.style.marginBottom = \"10px\";\r\n    header.style.fontWeight = \"600\";\r\n    header.style.fontSize = \"20px\";\r\n    wrapper.appendChild(header);\r\n\r\n    const card = document.createElement(\"div\");\r\n    card.className = \"loop-card-line d-flex h-100 loop-pointer\";\r\n    card.style.padding = \"10px\";\r\n    card.style.border = \"1px solid #ddd\";\r\n    card.style.borderRadius = \"8px\";\r\n    card.style.marginBottom = \"10px\";\r\n\r\n    const imageDiv = document.createElement(\"div\");\r\n    imageDiv.className =\r\n      \"d-flex justify-content-center align-items-center flex-shrink-0 loop-image-product me-4\";\r\n    imageDiv.style.position = \"relative\";\r\n\r\n    const firstValidVariant = schedule.productVariants.find((v) => !v.remove);\r\n    const firstProduct = firstValidVariant\r\n      ? productsMap[firstValidVariant.shopifyId]\r\n      : null;\r\n\r\n    if (firstProduct) {\r\n      const img = document.createElement(\"img\");\r\n      img.src = firstProduct.imageURLDummy;\r\n      img.style.objectFit = \"contain\";\r\n      img.style.maxWidth = \"100%\";\r\n      img.style.maxHeight = \"100%\";\r\n      imageDiv.appendChild(img);\r\n\r\n      const badge = document.createElement(\"span\");\r\n      badge.className = \"badge\";\r\n      badge.textContent = firstValidVariant.quantity || 1;\r\n      badge.style.cssText =\r\n        \"position: absolute; top: -5px; right: -5px; background: #333; color: #fff; font-size: 12px; padding: 2px 5px; border-radius: 50%;\";\r\n      imageDiv.appendChild(badge);\r\n    }\r\n    card.appendChild(imageDiv);\r\n\r\n    const contentDiv = document.createElement(\"div\");\r\n    contentDiv.className = \"d-flex flex-column flex-grow-1\";\r\n\r\n    const productsListDiv = document.createElement(\"div\");\r\n    productsListDiv.className = \"my-2\";\r\n    let scheduleTotalPrice = 0;\r\n    schedule.productVariants.forEach((variant) => {\r\n      if (variant.remove) return; // Don't show removed items\r\n      const prod = productsMap[variant.shopifyId];\r\n      if (!prod) return;\r\n      const pDiv = document.createElement(\"div\");\r\n      pDiv.className = \"loop-text-p2 loop-text-muted\";\r\n      pDiv.textContent = `- ${prod.title} ${\r\n        prod?.fetchedData?.data?.title &&\r\n        prod.fetchedData.data.title !== \"Default Title\"\r\n          ? `(${prod.fetchedData.data.title})`\r\n          : \"\"\r\n      } x ${variant.quantity || 1}`;\r\n      let variantPrice =\r\n        prod?.fetchedData?.data?.product?.variants?.edges?.[0]?.node?.price;\r\n      variantPrice = Number(variantPrice).toFixed(2);\r\n      pDiv.textContent += ` ${\r\n        prod?.fetchedData?.data?.product?.variants?.edges?.[0]?.node?.price\r\n          ? ` - \u00A3${prod.fetchedData.data.product.variants.edges[0].node.price}`\r\n          : \"\"\r\n      }`;\r\n      productsListDiv.appendChild(pDiv);\r\n      scheduleTotalPrice += parseFloat(variantPrice) * (variant.quantity || 1);\r\n      /*\r\n      console.log(`scheduleTotalPrice ==> ${scheduleTotalPrice} `);\r\n      */\r\n    });\r\n    contentDiv.appendChild(productsListDiv);\r\n\r\n    const bottomDiv = document.createElement(\"div\");\r\n    bottomDiv.className =\r\n      \"d-flex justify-content-between align-items-center loop-line-card-bottom-content\";\r\n    bottomDiv.style.marginTop = \"auto\";\r\n\r\n    const priceDiv = document.createElement(\"div\");\r\n    priceDiv.className =\r\n      \"loop-text-p2 loop-text-muted loop-line-card-price-wrapper mt-2\";\r\n    const formattedTotal = Number(\r\n      scheduleTotalPrice - scheduleTotalPrice * 0.1\r\n    ).toFixed(2);\r\n    priceDiv.innerHTML = `Total: <strong style=\"font-weight:900\">\u00A3${formattedTotal}</strong> <strike> \u00A3${scheduleTotalPrice.toFixed(\r\n      2\r\n    )}</strike>`;\r\n    bottomDiv.appendChild(priceDiv);\r\n\r\n    const editBtn = document.createElement(\"button\");\r\n    editBtn.className = `loop-btn loop-btn-primary \r\n\t\t\tloop-btn-size-sm \r\n\t\t\tloop-btn-width-sm \r\n\t\t\tloop-line-edit-btn mt-2\r\n\t\t\teq-nuuda-btn-style \r\n\t\t\tdata-index=\"${index}\"`;\r\n    editBtn.textContent = \"Edit\";\r\n    editBtn.addEventListener(\"click\", () =>\r\n      openManageSidebar(schedule, productsMap, index)\r\n    );\r\n    bottomDiv.appendChild(editBtn);\r\n\r\n    contentDiv.appendChild(bottomDiv);\r\n    card.appendChild(contentDiv);\r\n    wrapper.appendChild(card);\r\n\r\n    return wrapper;\r\n  }\r\n\r\n  /**\r\n   * Main render function. It fetches fresh data, clears the container, and re-renders the entire UI.\r\n   */\r\n\r\n  async function fetchProductByVariantId(variantId) {\r\n    const hmac = hmacSig;\r\n    const timestamp = hmacTimeLine;\r\n    const headers = new Headers();\r\n    headers.append(\"Content-Type\", \"application/json\");\r\n    headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n    headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n    try {\r\n      const response = await fetch(\r\n        `https://api.nuudafood.com/v2/products/variant/${variantId}`,\r\n        {\r\n          method: \"GET\",\r\n          headers,\r\n        }\r\n      );\r\n\r\n      if (!response.ok) {\r\n        throw new Error(`HTTP error! status: ${response.status}`);\r\n      }\r\n\r\n      const result = await response.json();\r\n\r\n      return result; // return the fetched product data\r\n    } catch (error) {\r\n      console.error(\"API Error:\", error);\r\n      return null; // return null so caller can handle failure\r\n    }\r\n  }\r\n\r\n  async function fetchProductByProductId(productId) {\r\n    const hmac = hmacSig;\r\n    const timestamp = hmacTimeLine;\r\n    const headers = new Headers();\r\n    headers.append(\"Content-Type\", \"application/json\");\r\n    headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n    headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n    try {\r\n      const response = await fetch(\r\n        `https://api.nuudafood.com/v2/products/${variantId}`,\r\n        {\r\n          method: \"GET\",\r\n          headers,\r\n        }\r\n      );\r\n\r\n      if (!response.ok) {\r\n        throw new Error(`HTTP error! status: ${response.status}`);\r\n      }\r\n\r\n      const result = await response.json();\r\n\r\n      return result; // return the fetched product data\r\n    } catch (error) {\r\n      console.error(\"API Error:\", error);\r\n      return null; // return null so caller can handle failure\r\n    }\r\n  }\r\n\r\n  async function renderCustomUI() {\r\n    const schedules = JSON.parse(localStorage.getItem(\"loopSchedules\"));\r\n    const ribbonAnchor = document.getElementById(\"loop-upsell-ribbon\");\r\n\r\n    if (!schedules?.data || !ribbonAnchor) {\r\n      console.error(\r\n        \"Could not find schedules data or the anchor element #loop-upsell-ribbon.\"\r\n      );\r\n      return;\r\n    }\r\n\r\n    const upsellResult = await fetchUpsellProducts();\r\n    let upsellProducts = [];\r\n\r\n    upsellResult.forEach(({ node }) => {\r\n      const firstImage =\r\n        node?.images?.edges[0]?.node?.src ??\r\n        \"https://cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png\";\r\n\r\n      const variants = node.variants.edges.map(({ node: v }) => ({\r\n        id: v?.id.split(\"/\").pop(),\r\n        title: v?.title,\r\n        price: v?.price,\r\n        image: v?.image?.edges?.[0]?.node?.src ?? firstImage,\r\n      }));\r\n\r\n      upsellProducts.push({\r\n        variant_shopify_id: node?.id?.split(\"/\")?.pop(),\r\n        title: node?.title,\r\n        image: firstImage,\r\n        variants,\r\n        descriptionHtml: node?.descriptionHtml || \"\",\r\n      });\r\n    });\r\n\r\n    const productsMap = {};\r\n    const allFetches = schedules.data.flatMap((schedule) =>\r\n      schedule.productVariants.map((variant) =>\r\n        (async () => {\r\n          const productData = await fetchProductByVariantId(variant.shopifyId);\r\n          productsMap[variant.shopifyId] = {\r\n            title: productData.data?.product?.title || \"Unknown\",\r\n            imageURL:\r\n              productData.data?.product?.images?.edges[0]?.node?.src ||\r\n              \"https://cdn.shopify.com/s/files/1/0849/9884/8808/files/nuudafood.com-shot.jpg?v=1764761641\",\r\n            imageURLDummy:\r\n              \"https://cdn.shopify.com/s/files/1/0849/9884/8808/files/nuudafood.com-shot.jpg?v=1764761641\",\r\n            price: productData?.price || \"0.00\",\r\n            fetchedData: productData,\r\n          };\r\n        })()\r\n      )\r\n    );\r\n\r\n    await Promise.all(allFetches);\r\n\r\n    schedules.data.sort((a, b) => a.sequence - b.sequence);\r\n\r\n    let container = document.getElementById(\"custom-subscriptions-container\");\r\n    if (!container) {\r\n      container = document.createElement(\"div\");\r\n      container.id = \"custom-subscriptions-container\";\r\n      container.style.cssText =\r\n        \"margin-top:15px; padding: 8px; border-top: 1px solid #e0e0e0;\";\r\n      ribbonAnchor.insertAdjacentElement(\"afterend\", container);\r\n    }\r\n    container.innerHTML = \"\";\r\n\r\n    for (const [index, schedule] of schedules.data.entries()) {\r\n      const scheduleHeader = document.createElement(\"h4\");\r\n      scheduleHeader.style.cssText =\r\n        \"margin: 40px 0 10px; font-size:24px; font-weight:600\";\r\n      scheduleHeader.textContent = `Your Personalised Meal Plan #${schedule.shopify_subscription_id}`;\r\n      /*\r\n\t\t\tcontainer.appendChild(scheduleHeader);\t\t\t\r\n\t\t\tcontainer.appendChild(createProductBlock(schedule));\r\n\t\t\t*/\r\n      container.appendChild(\r\n        renderSubscriptionsBelowRibbons(schedule, productsMap, index)\r\n      );\r\n\r\n      container.appendChild(\r\n        await createUpsellRibbon(schedule, index, upsellProducts)\r\n      );\r\n    }\r\n\r\n\tremoveLoader();\r\n  }\r\n\r\n  /**\r\n   * Waits for a target element to appear in the DOM, then triggers the main render function.\r\n   */\r\n  function initWhenReady() {\r\n    const targetId = \"loop-upsell-ribbon\";\r\n    const observer = new MutationObserver((mutations, obs) => {\r\n      if (document.getElementById(targetId)) {\r\n        fetchSchedulesAndRender(); // Initial fetch and render\r\n        obs.disconnect(); // Stop observing once found\r\n        subscriptionId = getLoopSubscriptionIdFromURL();\r\n        getCustomerDetails();\r\n        showLoader();\r\n      }\r\n    });\r\n    observer.observe(document.body, {\r\n      childList: true,\r\n      subtree: true,\r\n    });\r\n  }\r\n\r\n  /**\r\n   * Fetches the initial subscription schedule data from the API and stores it.\r\n   */\r\n  async function fetchSchedulesAndRender() {\r\n    const getSubscriptionIdURL = window.location.href;\r\n    const match = getSubscriptionIdURL.match(/\\/subscription\\/(\\d+)/);\r\n    const subscriptionIdRegex = match ? match[1] : null;\r\n    if (!subscriptionIdRegex) {\r\n      console.error(\"Subscription ID not found in URL.\");\r\n      return;\r\n    }\r\n\r\n    // --- Restored original HMAC and timestamp for this specific API call ---\r\n    const hmac = hmacSig;\r\n    const timestamp = hmacTimeLine;\r\n    const apiUrl = `https://api.nuudafood.com/v2/subscription/${subscriptionIdRegex}`;\r\n    const headers = new Headers();\r\n    headers.append(\"x-shopify-api-hmac-h\", hmac);\r\n    headers.append(\"x-shopify-api-timestamp\", timestamp);\r\n\r\n    try {\r\n      const response = await fetch(apiUrl, { method: \"GET\", headers: headers });\r\n      if (!response.ok) {\r\n        throw new Error(`API returned status: ${response.status}`);\r\n      }\r\n      const result = await response.json();\r\n      // Store data in localStorage to be used by the render function\r\n      if (result.data != null) {\r\n        localStorage.setItem(\"loopSchedules\", JSON.stringify({data: result.data.Schedules}));\r\n        // if(result.data.quiz_answers && !result.data.quiz_answers[\"How often would you like meals delivered?\"]) {\r\n        //   localStorage.setItem(\"loopUpdatedQuizAnswers\", JSON.stringify(result.data.quiz_answers));\r\n        // } else {\r\n          localStorage.setItem(\"loopQuizAnswers\", JSON.stringify(result.data.quiz_answers));\r\n        // }\r\n      } else {\r\n        localStorage.removeItem(\"loopSchedules\");\r\n        localStorage.removeItem(\"loopQuizAnswers\");\r\n      }\r\n      if (!document.body.classList.contains('nuuda-personalized-meal-planpage')) {\r\n        document.body.classList.add(\"nuuda-personalized-meal-planpage\");\r\n        await renderCustomUI();\r\n      }\r\n      addPersonalisedHeroSection();\r\n      removeLoader();\r\n    } catch (err) {\r\n      console.error(\"API fetch error:\", err);\r\n    }\r\n  }\r\n\r\n  window.fetchSchedulesAndRender = fetchSchedulesAndRender;\r\n\r\n  // --- Script Execution ---\r\n  injectModalStyles();\r\n  initWhenReady();\r\n})();\r\n\r\n// Usage\r\nonElementLoaded(\"#loop-cp-subscription-detail-order-actions\", (element) => {\r\n  addPauseBtn();\r\n  addUpdatePreferenceBtn();\r\n  updateLoopSubscriptionPlanText();\r\n});\r\n\r\nconst addPauseBtn = () => {\r\n  const originalBtn = document.querySelector(\"#loop-order-card-reschedule-btn\");\r\n  if (!originalBtn) return;\r\n  // Clone the button\r\n  const newBtn = originalBtn.cloneNode(true);\r\n  // Set new ID and text\r\n  newBtn.id = \"eq-loop-custom-pause-btn\";\r\n  newBtn.textContent = \"Pause\";\r\n  newBtn.classList = `loop-btn loop-btn-outline loop-btn-size-lg loop-btn-order mx-2`;\r\n  // Append right next to original button\r\n  originalBtn.insertAdjacentElement(\"afterend\", newBtn);\r\n  // Add click handler to trigger Loop Pause\r\n  newBtn.addEventListener(\"click\", () => {\r\n    const loopPauseBtn = document.querySelector(\"#loop-pause-btn\");\r\n    if (loopPauseBtn) {\r\n      loopPauseBtn.click(); // \uD83D\uDC49 triggers real pause button\r\n    } else {\r\n      console.warn(\"Pause button #loop-pause-btn not found\");\r\n    }\r\n  });\r\n};\r\n\r\nconst addUpdatePreferenceBtn = () => {\r\n  const pauseBtn = document.querySelector(\"#eq-loop-custom-pause-btn\");\r\n  if (!pauseBtn) return;\r\n  // Clone the button\r\n  const updatePreferenceBtn = pauseBtn.cloneNode(true);\r\n  // Set new ID and text\r\n  updatePreferenceBtn.id = \"eq-loop-custom-update-preferences-btn\";\r\n  updatePreferenceBtn.textContent = document.getElementById('quizModal').dataset.updatePreferences;\r\n  updatePreferenceBtn.classList = `loop-btn loop-btn-outline loop-btn-size-lg loop-btn-order mx-2`;\r\n  // Append right next to original button\r\n  pauseBtn.insertAdjacentElement(\"afterend\", updatePreferenceBtn);\r\n  // Add click handler to trigger Loop Pause\r\n  updatePreferenceBtn.addEventListener(\"click\", () => {\r\n    const modal = document.getElementById(\"quizModal\");    \r\n    modal.style.display = \"flex\";\r\n    document.body.classList.add(\"quiz-preference-open\");\r\n\r\n    closeBtn.addEventListener(\"click\", () => {\r\n      modal.style.display = \"none\"; // hide modal\r\n      document.body.classList.remove(\"quiz-preference-open\");\r\n    });\r\n\r\n    // optional: click outside to close\r\n    modal.addEventListener(\"click\", (e) => {\r\n      if (e.target === modal) {\r\n        modal.style.display = \"none\";\r\n        document.body.classList.remove(\"quiz-preference-open\");\r\n      }\r\n    });\r\n  });\r\n};\r\n\r\nfunction getSuggestedProductsFromQuiz() {\r\n  const miniQuizRaw = localStorage.getItem(\"octane_mini_quiz\");\r\n\tif (!miniQuizRaw) {\r\n\t\treturn;\r\n\t}\r\n\r\n  const miniQuizData = JSON.parse(miniQuizRaw);\r\n  const miniQuizBlocks = miniQuizData?.state?.info?.product_blocks || [];\r\n  let miniQuizBlocksResult = {\r\n    breakfast: [],\r\n    main_meals: []\r\n  };\r\n  let categoryIndex = 0;\r\n\r\n  miniQuizBlocks.forEach(block => {\r\n    if (!block?.containers || Array.isArray(block.containers)) return;\r\n\r\n    const products = Object.values(block.containers);\r\n    const list = products.map(p => {\r\n      const d = p?.data || {};\r\n      console.log('d', d)\r\n      const variant = d?.variants?.[0] || {};\r\n\r\n      return {\r\n        id: d.id || null,\r\n        title: d.product_title ?? d.title ?? \"\",\r\n        price: String(variant.price_formatted ?? d.price_formatted ?? 0),\r\n        image: d.image ?? \"\",\r\n        full_url: d.full_url ?? \"\",\r\n        serves: \"\",\r\n        count: 0,\r\n        quantity: 1\r\n      };\r\n    });\r\n\r\n    const category = categoryIndex === 0 ? \"breakfast\" : \"main_meals\";\r\n    miniQuizBlocksResult[category] = list;\r\n\r\n    categoryIndex++;\r\n  });\r\n\r\n  return miniQuizBlocksResult;\r\n}\r\n\r\n// Once the quiz from the modal has been finished, we are updating the suugested products via API\r\ndocument.addEventListener(\"octane.quiz.completed\", function(e) {\r\n  const quizModal = document.getElementById(\"quizModal\");\r\n  const isVisibleQuizModal = quizModal && quizModal.style.display !== \"none\";\r\n  if (isVisibleQuizModal) {\r\n    document.querySelector('#quizModal .quiz-questions').style.display = 'none';\r\n    try {\r\n      localStorage.setItem(\"octane_mini_quiz\", JSON.stringify(e.detail || {}))\r\n      const items = getSuggestedProductsFromQuiz();\r\n      console.log('items=>', items, items.breakfast.length, items.main_meals.length);\r\n\r\n      const updateSuggestedHeaders = new Headers(); \r\n      updateSuggestedHeaders.append(\"Content-Type\", \"application/json\");\r\n      updateSuggestedHeaders.append(\"x-shopify-api-hmac-h\", hmacSig);\r\n      updateSuggestedHeaders.append(\"x-shopify-api-timestamp\", hmacTimeLine);\r\n\r\n      // old answers from storage\r\n      const raw = localStorage.getItem('loopQuizAnswers');\r\n      const oldAnswers = raw ? JSON.parse(raw) : {};\r\n\r\n      // updated answers from event\r\n      const updatedAnswers = e.detail.answers || {};\r\n\r\n      // merge\r\n      const mergedAnswers = {\r\n        ...oldAnswers,\r\n        ...updatedAnswers\r\n      };\r\n\r\n      const Useremail = window.loopProps.customer.email;\r\n      const miniQuizPayload = {\r\n        \"email\": Useremail,\r\n        \"items\": items,\r\n        \"quiz_answers\": mergedAnswers\r\n      };\r\n\r\n      fetch(\"https://api.nuudafood.com/v2/subscription/update-suggested-products\", {\r\n        method: \"PUT\",\r\n        headers: updateSuggestedHeaders,\r\n        body: JSON.stringify(miniQuizPayload)\r\n      })\r\n      .then(async (res) => {\r\n        const text = await res.text();\r\n        console.log(\"RAW API RESPONSE:\", text, res);\r\n\r\n        if (res.status = 200) {\r\n          document.querySelector('#quizModal .quiz-questions').style.display = 'none';\r\n          document.querySelector('#quizModal .thank-you-content').style.display = 'flex';\r\n          document.querySelector('#quizModal').classList.add = 'thank-you-active';\r\n          document.getElementById('eq-loop-custom-update-preferences-btn').disabled = true;\r\n          fetchSchedulesAndRender();\r\n        }\r\n      })\r\n      .catch(err => {\r\n          console.error(\"API Error:\", err);\r\n      });\r\n    } catch (err) {\r\n      console.warn(\"Could not save Octane quiz data\", err);\r\n    }\r\n  }\r\n});\r\n\r\ndocument.addEventListener(\"octane.quiz.questionLoaded\", function (event) {\r\n  const quizModal = document.getElementById(\"quizModal\");\r\n  const isVisibleQuizModal = quizModal && quizModal.style.display !== \"none\";\r\n  // if (isVisibleQuizModal) {\r\n  if (window.loopProps) {\r\n    document.dispatchEvent(new CustomEvent('octane.quiz.action.submit_optin', { detail: { email: window.loopProps.customer.email } }));\r\n  }\r\n  // }\r\n}, false);\r\n\r\nconst updateLoopSubscriptionPlanText = () => {\r\n  const planTextElement = document.querySelector(\r\n    \"#loop-cp-subscription-detail-frequency .loop-h3\"\r\n  );\r\n  if (!planTextElement) return;\r\n  planTextElement.textContent = \"Delivery Frequency\";\r\n};\r\n\r\nconst addPersonalisedHeroSection = () => {    \r\n  const subscriptionBackBtn = document.querySelector(\"#loop-cp-subscription-detail-back-btn\");\r\n  const octaneInner = document.querySelector(\".octane-inner\");\r\n\r\n  if (!subscriptionBackBtn || !octaneInner) return;\r\n\r\n  /* ---------------- STORAGE ---------------- */\r\n\r\n  const rawQuiz = localStorage.getItem('loopQuizAnswers');\r\n  if (!rawQuiz) return;\r\n\r\n  let quizData = {};\r\n  let updatedData = {};\r\n\r\n  try {\r\n    quizData = JSON.parse(rawQuiz) || {};\r\n  } catch (e) {\r\n    console.error('Invalid loopQuizAnswers JSON', e);\r\n    return;\r\n  }\r\n\r\n  const rawUpdated = localStorage.getItem('loopUpdatedQuizAnswers');\r\n\r\n  if (rawUpdated) {\r\n    try {\r\n      updatedData = JSON.parse(rawUpdated) || {};\r\n    } catch (e) {\r\n      console.warn('Invalid loopUpdatedQuizAnswers JSON', e);\r\n    }\r\n  }\r\n\r\n  /* ---------------- MOVE HERO ---------------- */\r\n\r\n  document.querySelector('.octane-hero')?.remove();\r\n\r\n  const heroSection = document.createElement(\"div\");\r\n  heroSection.className = \"octane-hero loop-grid-item\";\r\n  heroSection.dataset.sectionId = \"personalised-hero\";\r\n\r\n  heroSection.appendChild(octaneInner);\r\n  subscriptionBackBtn.insertAdjacentElement(\"afterend\", heroSection);\r\n\r\n  document.querySelector('.octane-inner').style.display = '';\r\n\r\n  /* ---------------- CORE ANSWERS ---------------- */\r\n\r\n  const answers = quizData;\r\n\r\n  /* NAME */\r\n  const nameEl = document.getElementById('octaneUserName');\r\n  if (nameEl && answers[\"Octane: Type a free-form response\"] || answers[\"Octane: Name\"]) {\r\n    nameEl.innerText = answers[\"Octane: Type a free-form response\"] || answers[\"Octane: Name\"];\r\n  }\r\n\r\n  /* DELIVERY */\r\n  const delivery =\r\n    answers[\"Octane: How often would you like meals delivered?\"] ||\r\n    answers[\"How often would you like meals delivered?\"];\r\n\r\n  if (delivery) {\r\n    const deliveryEl = document.querySelector('#octaneDelivery span');\r\n    if (deliveryEl) deliveryEl.innerText = delivery.toUpperCase();\r\n  }\r\n\r\n  /* DURATION */\r\n  const days =\r\n    answers[\"Octane: How many days per week would you like NUUDA?\"] ||\r\n    answers[\"Octane: How many days per week would you like meals?\"] ||\r\n    answers[\"Octane: How many mouths are you feeding?\"];\r\n\r\n  if (days) {\r\n    const durationEl = document.querySelector('#octaneDuration span');\r\n    if (durationEl) durationEl.innerText = days;\r\n  }\r\n\r\n  /* ---------------- GOALS ---------------- */\r\n\r\n  const goalsEl = document.getElementById('octaneGoals');\r\n  if (!goalsEl) return;\r\n\r\n  const goalKeysRaw = goalsEl.dataset.octaneGoals || '';\r\n\r\n  const goalKeys = goalKeysRaw\r\n    .split(',')\r\n    .map(key => key.trim())\r\n    .filter(Boolean);\r\n\r\n  const goalsContainer = goalsEl;\r\n  goalsContainer.innerHTML = '';\r\n\r\n  const goalMap = [];\r\n\r\n  // pull value per key \u2192 updated first, fallback original\r\n  // goalKeys.forEach(key => {\r\n  //   const value =\r\n  //     updatedData[key] !== undefined\r\n  //       ? updatedData[key]\r\n  //       : quizData[key];\r\n\r\n  //   if (value) goalMap.push(value);\r\n  // });\r\n\r\n  goalKeys.forEach(key => {\r\n    let value =\r\n      updatedData[key] !== undefined\r\n        ? updatedData[key]\r\n        : quizData[key];\r\n\r\n        console.log('key',key)\r\n    // Special condition\r\n    if (key === \"Octane: Common Allergens\") {\r\n      const allergyAnswer =\r\n        updatedData[\"Octane: Do you have any allergens or ingredients you want to exclude from your plan?\"] ??\r\n        quizData[\"Octane: Do you have any allergens or ingredients you want to exclude from your plan?\"] ??\r\n        updatedData[\"Octane: Any dietary requirements or allergies we should respect?\"] ??\r\n        quizData[\"Octane: Any dietary requirements or allergies we should respect?\"];\r\n\r\n        console.log('allergyAnswer',allergyAnswer)\r\n      if (!(allergyAnswer === \"yes\" || allergyAnswer === \"Yes\")) {\r\n        value = undefined; // ignore this key\r\n      }\r\n    }\r\n\r\n    if (value) goalMap.push(value);\r\n  });\r\n\r\n  console.log('goalMap',goalMap);\r\n  // render\r\n  goalMap.forEach(goal => {\r\n    if (!goal) return;\r\n\r\n    goal.toString().split(',').forEach(item => {\r\n      const div = document.createElement('div');\r\n      div.className = 'octane-goal';\r\n      div.innerText = item.trim();\r\n      goalsContainer.appendChild(div);\r\n    });\r\n  });\r\n};\r\n\r\n$(document).ready(function () {\r\n  $(document).on(`click`, `.data-swapbtn`, (e) => {\r\n    let dataCurrentVariantToSwap = $(e.target).attr(`data-current-variant`);\r\n    let dataCurrentVariantToSwapWith = $(e.target).attr(\r\n      `data-variant-to-swapwith`\r\n    );\r\n    let dataScheduleIndex = $(e.target).attr(`data-schedule-index`);\r\n    let dataSubscriptionId = $(e.target).attr(`data-subscription-id`);\r\n    const url = \"https://api.nuudafood.com/v2/subscription/swap-product\";\r\n    let sequence = Number(dataScheduleIndex) + 1;\r\n    const payload = {\r\n      shopify_subscription_id: Number(dataSubscriptionId),\r\n      items: [\r\n        {\r\n          productVariantShopifyId: Number(dataCurrentVariantToSwapWith),\r\n          quantity: 1, // adjust if needed\r\n        },\r\n        {\r\n          productVariantShopifyId: Number(dataCurrentVariantToSwap),\r\n           n: 1, // adjust if needed\r\n          remove: true,\r\n        },\r\n      ],\r\n      sequence: Number(sequence),\r\n    };\r\n\tshowLoader();\r\n    $.ajax({\r\n      url: url,\r\n      method: \"POST\",\r\n      data: JSON.stringify(payload),\r\n      contentType: \"application/json; charset=utf-8\",\r\n      dataType: \"json\",\r\n      success: function (response) {\r\n        console.log(\"Swap API Success:\", response);\t\r\n\t\t    fetchSchedulesAndRender();\r\n        $(`.custom-modal-overlay.visible`).removeClass('visible');\r\n        $(`.custom-confirm-overlay.visible`).removeClass('visible');\r\n        window.location.reload();\r\n      },\r\n\r\n      error: function (xhr, status, error) {\r\n        console.error(\"Swap API Error:\", status, error, xhr.responseText);\r\n      },\r\n    });\r\n  });\r\n  //1764\r\n\r\n});\r\n"],
  "mappings": "AACA,MAAM,WAAa,IAAM,CACvB,EAAE,2BAA2B,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