"use strict";var i=require("@gem-sdk/system"),e=require("../../../../../../helpers.js");const a=`
  option-data="{{option.name | escape}}"
  option-value="{{value | escape}}"
  data-gp-option-value-id="{{value.id}}"
  data-gp-option-available="{{value.available}}"
  value="{{value | escape}}"
  class="option-value-wrapper"
  key="{{value | escape}}"
`;exports.renderBlankOption=i=>`<option value="blank" selected>${i??e.getStaticLocale("ProductVariants","please_select")}</option>`,exports.renderCombineVariants=(e,a,t)=>{let o='origin-price="{{variantItem.price}}" value="{{variantItem.id}}" key="{{variantItem.id}}"',n=`{{variantItem.title}} ${t?"- {{variantItem.price | money}}":""}`;return`{%- for variantItem in variants -%}
    ${i.If(e,i.LiquidIf("variantItem.available == false",i.LiquidIf("variantItem.id == variant.id",`<option origin-price="{{variantItem.price}}" disabled ${a?"selected":""} value="{{variantItem.id}}" key="{{variantItem.id}}">            
            ${n}
          </option>`,`<option ${o} disabled>
            ${n}
          </option>`),i.LiquidIf("variantItem.id == variant.id",`<option origin-price="{{variantItem.price}}" ${a?"selected":""} value="{{variantItem.id}}" key="{{variantItem.id}}">
            ${n}
          </option>`,`<option ${o}>
            ${n}
          </option>`)),i.LiquidIf("variantItem.id == variant.id",`<option origin-price="{{variantItem.price}}" ${a?"selected":""} value="{{variantItem.id}}" key="{{variantItem.id}}">
          ${n}
        </option>`,`<option ${o}>
          ${n}
        </option>`))}     
    {%- endfor -%}
  `},exports.renderDropdownOptions=(e,t)=>i.LiquidFor("value in values",`${i.Liquid(`{%- liquid
      assign option_disabled = true
      for variantItem in product.variants
        case option.position
          when 1
            if variantItem.available and variantItem.option1 == value
              assign option_disabled = false
            endif
          when 2
            if variantItem.available and variantItem.option2 == value
              assign option_disabled = false
            endif
          when 3
            if variantItem.available and variantItem.option3 == value
              assign option_disabled = false
            endif
        endcase
      endfor
    -%}`)}
    ${i.If(e,i.LiquidIf("option_disabled == true",i.LiquidIf("value == selectedValue",`<option disabled ${t?"selected":""} option-position="{{option.position}}"${a}>{{value}}</option>`,`<option disabled ${a}>{{value}}</option>`),i.LiquidIf("value == selectedValue",`<option ${t?"selected":""} option-position="{{option.position}}" ${a}>{{value}}</option>`,`<option ${a} option-position="{{option.position}}">{{value}}</option>`)),i.LiquidIf("value == selectedValue",`<option ${t?"selected":""} ${a} option-position="{{option.position}}">{{value}}</option>`,`<option ${a} option-position="{{option.position}}">{{value}}</option>`))}`);
