"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("../../helpers.js"),s=require("@gem-sdk/system"),r=require("../common/helpers.js"),a=require("../common/styles.js"),i=require("../common/classes.js"),l=require("../settings/configs/translate.js");exports.default=({rawChildren:c,setting:d,styles:n,builderProps:o,pageContext:p,advanced:g,style:u,builderAttrs:m})=>{let{align:y}=n??{},{childItem:S,activeKey:f}=d??{},{uidState:v,settingState:C,stylesState:$,accordions:j}=r.getDataState({setting:d,styles:n,builderProps:o},c),h=s.createStateOrContext({uid:v,setting:C,styles:{...$}}),q=s.createClass(i.getContainerClasses(g?.cssClass)),x=s.createStyle({...a.getContainerStyles(u,n)}),A=s.createAttr({...m,"data-id":o?.uid??""}),I=s.createStyle({...e.makeStyleResponsive("jc",y)}),P=s.createClass({"gp-flex":!0}),R=s.createClass(i.extendClasses());return e.template`
    <gp-accordion ${A} class="${q}" style="${x}"
      gp-data='${JSON.stringify(h).replaceAll("'","&#039;")}'
        >
        <div class=" ${R}"></div>
      ${e.WrapRenderChildren({uid:o?.uid??"",customProps:c?.[0].customProps},c?.map((s,r)=>{if(s){let a=t.getDynamicSourceLocales({val:S?.[r],uid:o?.uid,settingId:t.createSettingId({id:l.Accordion?.childItem?.id,index:r}),pageContext:p??{},isCapitalize:d?.titleTypo?.attrs?.transform==="capitalize"});return e.template`
          <div class="${P}" style="${I}">
            ${e.RenderChildren({...s,index:r,title:a,accordions:j,parentSetting:d,parentStyle:n,parentUid:o?.uid,childrenIcon:d?.childConfig?.[r],activeKey:f})}
          </div>
            `}}))}
    </gp-accordion>
    ${e.RenderIf(e.isLocalEnv,`
    <script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-accordion-v7-5.js' | asset_url }}"
      defer="defer"></script>`,`
    <script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="${e.baseAssetURL}/assets-v2/gp-accordion-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
    `)}
  `};
