"use strict";var i=require("@gem-sdk/system"),e=require("@gem-sdk/core");exports.renderOptionValuesOld=s=>{let{renderVariantItem:t,variantPresetsLiquid:a}=s;return e.template`
    ${i.Liquid("{%- assign optionRendered = false -%}")}
    ${i.Liquid("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
    ${i.Liquid("{%- assign swatchesItems = swatches | split: '($1)' -%}")}

    ${i.Liquid(`{%- assign variantPresetString = "${a}" -%}
      {%- assign optionName = option.name | replace: "'", "&apos;" | replace: '"', "&quot;" -%}
      {%- assign items = variantPresetString | split: '($2)' -%}
      {%- assign type = 'dropdown' -%}
      {% for item in items %}
        {%- assign itemPreset = item | split: '($1)' -%}
        {% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
        {% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
      {% endfor %}`)}

    ${i.LiquidFor("swatchesItem in swatchesItems",`
      ${i.Liquid('{%- assign colorArraysString = "" -%}')}
      ${i.Liquid('{%- assign labelsString = "" -%}')}
      ${i.Liquid('{%- assign imageUrlsString = "" -%}')}
      ${i.Liquid("{%- assign attrItems = swatchesItem | split: '($3)' -%}")}

      ${i.LiquidFor("attrItem in attrItems",`
          ${i.Liquid("{%- assign attrs = attrItem | split: '($2)' -%}")}
          ${i.Liquid("{%- assign optionKey = attrs[0] -%}")}
          ${i.Liquid("{%- assign optionValue = attrs[1] -%}")}
          ${i.Liquid(`
            {% if optionKey == 'optionTitle' %}
              {% assign optionTitle = optionValue %}
            {% elsif optionKey == 'optionType' %}
              {% assign optionType = optionValue %}
            {% endif %}
          `)}

          ${i.LiquidIf('optionKey == "optionValues"',`
            ${i.Liquid("{%- assign opValueItems = optionValue | split: '($4)' -%}")}
            ${i.LiquidFor("opValueItem in opValueItems",`
                ${i.Liquid("{%- assign opValueItemAttrs = opValueItem | split: '($6)' -%}")}
                ${i.LiquidFor("opValueItemAttr in opValueItemAttrs",`
                    ${i.Liquid("{%- assign attrs = opValueItemAttr | split: '($5)' -%}")}
                    ${i.Liquid("{%- assign opValueItemKey = attrs[0] -%}")}
                    ${i.Liquid("{%- assign opValueItemValue = attrs[1] -%}")}

                    ${i.LiquidIf('opValueItemKey == "label"',`${i.Liquid("{%- assign labelsString = labelsString | append: opValueItemValue -%}")}
                       ${i.Liquid('{%- assign labelsString = labelsString | append: "($8)" -%}')}`)}

                    ${i.LiquidIf('opValueItemKey == "colors"',`${i.Liquid("{%- assign colorArraysString = colorArraysString | append: opValueItemValue -%}")}
                       ${i.Liquid('{%- assign colorArraysString = colorArraysString | append: "($8)" -%}')}`)}

                    ${i.LiquidIf('opValueItemKey == "imageUrl"',`${i.Liquid("{%- assign imageUrlsString = imageUrlsString | append: opValueItemValue -%}")}
                       ${i.Liquid('{%- assign imageUrlsString = imageUrlsString | append: "($8)" -%}')}`)}
                  `)}
              `)}
            `)}
        `)}

      ${i.Liquid("{%- assign labels = labelsString | split: '($8)' -%}")}
      ${i.Liquid("{%- assign colorStrings = colorArraysString | split: '($8)' -%}")}
      ${i.Liquid("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}

      ${i.LiquidIf("optionTitle == option.name",`
        ${i.Liquid("{%- assign optionRendered = true -%}")}
        ${t({showDropdown:!0})}
      `)}
    `)}

    ${i.LiquidIf("optionRendered == false",t({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
  `};
