"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core");const BoldSubscriptions=({setting:e,advanced:r})=>{let{widgetType:t,align:s,appBlockId:i}=e??{};return core.template`
    <div
      class="${r?.cssClass}"
      style="${{...core.makeStyleResponsive("ta",s)}}"
    >
      {% assign widget = '${t}' %}
      {% if widget == 'v1' %}
        <div class="ro_widget"></div>
      {% else %}
        {% assign app_blocks = section.blocks | where: "type", "@app" %}
        {% for block in app_blocks %}
          {% if block.type == '@app' and block.id contains '${i}' %}
            {% render block %}
          {% endif %}
        {% endfor %}
        <script>
          function renderPrices() {
            try {
              setTimeout(() => {
                if (BOLD && BOLD.BsubWidget) {
                  BOLD.BsubWidget._renderPrices();
                }
              }, 50);
            } catch (e) {
              console.error("Failed to render prices:", e);
            }
          }
          const events = ["gp:product-change-variant", "gp:product-change-quantity"];
          events.forEach(event => {
            window.removeEventListener(event, renderPrices);
            window.addEventListener(event, renderPrices);
          });
        </script>
      {% endif %}
    </div>
  `};exports.default=BoldSubscriptions;
