import{template as s,dataStringify as i,RenderIf as t,isLocalEnv as e,baseAssetURL as l}from"@gem-sdk/core";import{getSettingPreloadData as o}from"../../helpers.js";import r from"../../text/components/Text.liquid.js";import{createClass as a,createStyle as d,createAttr as p,If as c}from"@gem-sdk/system";import{getClassWraplistIcon as n,getClassColListIcon as m,getClassWrapItemIcon as $,getClassWrapIcon as g,getClassIcon as u,getClassTextItem as v}from"../common/classes.js";import{getStyleContainerIconlistMain as f,getStyleWraplistIcon as y,getStyleColListIcon as j,getStyleWrapIcon as h,getStyleWrapItemIcon as S,getStyleIcon as k,getStyleTypoText as q}from"../common/styles.js";import{getvalueMap as x,getTextIconTranslations as E,getTextIconNotFound as V}from"../common/helpers.js";let IconListV2=A=>{let{builderProps:I,builderAttrs:N,style:T,setting:_,styles:w,pageContext:G}=A,L=I?.builderData?.advanced,O=a({[I?.uid??""]:!0}),W=a(n()),b=a(m()),C=a($({builderProps:I})),D=a(g()),F=a(u()),M=a(v({setting:_})),P=d(f({styles:w,style:T,type:"liquid",advanced:L})),R=d(y({styles:w})),z=d(j({styles:w})),B=d(h({styles:w,setting:_})),H=d(S({styles:w})),J=d(k({styles:w,setting:_})),K=q({setting:_}),Q=p({...N}),U=V("liquid"),X=x({setting:_});return s`
    {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
    <gp-icon-list
      ${{...Q}}
      ${{...I}}
      data-id="${I?.uid}"
      style="${P}"
      className="${O}"
      gp-data='${i({position:w?.position,iconWidth:_?.iconWidth}).replaceAll("'","&#039;")}'
    >
      ${c(!X||!X.length,s`<div>${U}</div>`,s`
          <div class="${W}" style="${R}">
            <div class="${b}" style="${z}">
              ${X?.map((i,t)=>{let e=E({setting:_,builderProps:I,pageContext:G,key:t,type:"liquid"});return s`
                    <div
                      key="${t}"
                      data-index="${t}"
                      class="${C}"
                      style="${H}"
                    >
                      <div class="${D}" style="${B}">
                        <span
                          class="${F}"
                          style="${J}"
                        >
                          ${i}
                        </span>
                      </div>
                      ${r({setting:{text:e?.toString(),htmlTag:"div",options:{customClass:{wrapper:"gp-w-full"}},isForceValue:!0},styles:K,className:M})}
                    </div>`}).join(" ")}
            </div>
          </div>`)}
    </gp-icon-list>
    ${t(e,`<script ${o('class="gps-link" delay',"src")}="{{ 'gp-icon-list-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${o('class="gps-link" delay',"src")}="${l}/assets-v2/gp-icon-list-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};export{IconListV2 as default};
