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 n}from"@gem-sdk/system";import{getClassWraplistIcon as c,getClassColListIcon as m,getClassWrapItemIcon as $,getClassWrapIcon as u,getClassIcon as g,getClassTextItem as v}from"../common/classes.js";import{getStyleContainerIconlistMain as y,getStyleWraplistIcon as f,getStyleColListIcon as j,getStyleWrapIcon as h,getStyleWrapItemIcon as q,getStyleIcon as x,getStyleTypoText as S}from"../common/styles.js";import{getvalueMap as k,getTextIconTranslations as E,getTextIconNotFound as V}from"../common/helpers.js";let IconListV2=A=>{let{builderProps:I,builderAttrs:L,style:N,setting:T,styles:_,pageContext:w}=A,C=I?.builderData?.advanced,G=a({[I?.uid??""]:!0}),O=a(c()),W=a(m()),b=a($({builderProps:I})),D=a(u()),F=a(g()),M=a(v({setting:T})),P=d(y({styles:_,style:N,type:"liquid",advanced:C})),R=d(f({styles:_,uid:I?.uid??"",pageContext:w,type:"Liquid"})),z=d(j({styles:_,setting:T})),B=d(h({styles:_,setting:T})),H=d(q({styles:_})),J=d(x({styles:_,setting:T})),K=S({setting:T}),Q=p({...L}),U=V("liquid"),X=k({setting:T});return s`
    {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
    <gp-icon-list
      ${{...Q}}
      ${{...I}}
      data-id="${I?.uid}"
      style="${P}"
      className="${G}"
      gp-data='${i({position:_?.position,iconWidth:T?.iconWidth}).replaceAll("'","&#039;")}'
    >
      ${n(!X||!X.length,s`<div>${U}</div>`,s`
          <div class="${O}" style="${R}">
            <div class="${W}" style="${z}">
              ${X?.map((i,t)=>{let e=E({setting:T,builderProps:I,pageContext:w,key:t,type:"liquid"});return s`
                    <div
                      key="${t}"
                      data-index="${t}"
                      class="${b}"
                      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};
