"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("./common/classes.js"),n=require("../../../helpers.js");exports.default=a=>{let{pageContext:o,rawChildren:r}=a,{productItemClass:i,gpProductClass:c}=t.getClass(a);return e.template`
      <gp-product
        gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape  }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }},  "formId": "{{ product_form_id }}"}'
        gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(n.filterPageContext(o))}}'
        class="${c}"

      >
        {%- form 'product', product, id: product_form_id, class: 'form contents ${i}',  data-type: 'add-to-cart-form', autocomplete: 'off' -%}
        <input type="hidden" name="id" value="{{ variant.id }}" />
        <input type="hidden" min="1" name="quantity"  value="{{ quantity }}" />
        <button type="submit" onclick="return false;" style="display:none;"></button>
          ${e.template`
      ${r?.map((t,n)=>{if(t)return e.template`
            ${e.RenderChildren({...t,index:n})}
          `}).join("")}
    `}
        {%- endform -%}
      </gp-product>
  `};
