"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../helpers.js"),Text_liquid=require("../../text/components/Text.liquid.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),helpers=require("../common/helpers.js");const IconListV2=e=>{let{builderProps:s,builderAttrs:t,style:l,setting:a,styles:r,pageContext:i}=e,c=s?.builderData?.advanced,o=system.createClass({[s?.uid??""]:!0}),y=system.createClass(classes.getClassWraplistIcon()),n=system.createClass(classes.getClassColListIcon()),p=system.createClass(classes.getClassWrapItemIcon({builderProps:s})),d=system.createClass(classes.getClassWrapIcon()),g=system.createClass(classes.getClassIcon()),m=system.createClass(classes.getClassTextItem({setting:a})),u=system.createStyle(styles.getStyleContainerIconlistMain({styles:r,style:l,type:"liquid",advanced:c})),$=system.createStyle(styles.getStyleWraplistIcon({styles:r,uid:s?.uid??"",pageContext:i,type:"Liquid"})),S=system.createStyle(styles.getStyleColListIcon({styles:r,setting:a})),I=system.createStyle(styles.getStyleWrapIcon({styles:r,setting:a})),v=system.createStyle(styles.getStyleWrapItemIcon({styles:r})),C=system.createStyle(styles.getStyleIcon({styles:r,setting:a})),q=styles.getStyleTypoText({setting:a}),h=system.createAttr({...t}),x=helpers.getTextIconNotFound("liquid"),f=helpers.getvalueMap({setting:a});return core.template`
    {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
    <gp-icon-list
      ${{...h}}
      ${{...s}}
      data-id="${s?.uid}"
      style="${u}"
      className="${o}"
      gp-data='${core.dataStringify({position:r?.position,iconWidth:a?.iconWidth}).replaceAll("'","&#039;")}'
    >
      ${system.If(!f||!f.length,core.template`<div>${x}</div>`,core.template`
          <div class="${y}" style="${$}">
            <div class="${n}" style="${S}">
              ${f?.map((e,t)=>{let l=helpers.getTextIconTranslations({setting:a,builderProps:s,pageContext:i,key:t,type:"liquid"});return core.template`
                    <div
                      key="${t}"
                      data-index="${t}"
                      class="${p}"
                      style="${v}"
                    >
                      <div class="${d}" style="${I}">
                        <span
                          class="${g}"
                          style="${C}"
                        >
                          ${e}
                        </span>
                      </div>
                      ${Text_liquid.default({setting:{text:l?.toString(),htmlTag:"div",options:{customClass:{wrapper:"gp-w-full"}},isForceValue:!0},styles:q,className:m})}
                    </div>`}).join(" ")}
            </div>
          </div>`)}
    </gp-icon-list>
    ${core.RenderIf(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-icon-list-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-icon-list-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};exports.default=IconListV2;
