"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Text_liquid=require("../../text/components/Text.liquid.js"),helpers=require("../common/helpers.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js");const AccordionItem=e=>{let{parentUid:s,childrenIcon:t,rawChildren:l,index:a,builderProps:r,title:o}=e,{iconSvg:c,titleTypo:n,layoutHeader:i,iconGlobalSize:y,iconCollapseSize:d,iconCollapse:m,iconExpand:p,alignment:g,configIconSize:$,iconPosition:C}=helpers.getParentSettings(e.parentSetting)??{},{isShow:u,composeContentSizeStyle:S,collapsibleIcon:v,composeIconColor:x,makeIcon:I}=helpers.getSettingItemLiquid(e),h=system.createClass(classes.getItemContainerClasses),q=system.createClass(classes.getDropdownClasses(e.parentStyle,{isShow:u,uniqueId:s,makeIcon:I,index:a})),f=system.createStyle(styles.getIconGlobalSize(y)),_=system.createClass(classes.getIconClasses),D=system.createClass(classes.getIconRotateClasses(e.parentStyle,{isShow:u,iconExpand:p,iconSvg:c,iconCollapse:m})),T=system.createClass(classes.getContentClasses(s)),w=system.createClass(classes.getGapClasses),R=system.createStyle(styles.getItemContainerStyles(e.parentStyle,!1)),j=system.createStyle(styles.getDropdownStyles(e.parentStyle,{isShow:u,iconPosition:C})),L=system.createStyle(styles.getDropdownTextStyles(e.parentStyle?.textColor,u)),M=system.createStyle(styles.getIconRotateStyles(e.parentStyle,u,d)),b=system.createStyle(styles.getGapStyles(y,g)),G=system.createClass(core.composeClasses("gp-inline-flex")),N=system.createClass(u?{...core.composeClasses("!gp-text-[var(--icon-active-color)]"),...classes.getLayoutIconClasses}:classes.getLayoutIconClasses),k=system.createStyle(styles.getIconStyles(x,$)),A=system.createClass(classes.getRenderChildrenClasses(e.parentStyle,{isShow:u,hasTransitionedIn:!1,isMounted:!1})),F=system.createStyle({...styles.getTemplateRow(u),...styles.getRenderChildrenStyles()}),H=system.createClass(core.composeClasses("gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0")),O=()=>l&&l.length>=helpers.MINIMUM_CHILD?core.RenderChildren({...l[helpers.BODY_CHILD_INDEX]}):"";return core.template`
  <div class="${h}" style="${R}">
    <div data-index="${a?.toString()}" class="${T}">
      <div aria-hidden uid="${r?.uid}" id="${r?.uid}" data-index="${a?.toString()}"
        class="${q}" style="${j}">
        ${system.If(!!v,core.template`
          <div class="${_}">
            <span style="${M}"
            data-index="${a}"
            class="${D}">
              ${v}
            </span>
          </div>
          `)}
        <div class="${w}" style="${b}">
          ${system.If("before-text"===i,core.template`
          <div class="${G}" style="${{...f}}">
            <span
              class="${N}"
              style="${k}">
              ${t??""}</span>
          </div>
          `)}
          ${Text_liquid.default({style:{...L},styles:{typo:n},setting:{htmlTag:"div",text:o,excludeFlex:!0,isForceValue:!0},className:"gp-overflow-hidden gp-accordion-text-content group-hover:[color:var(--text-hover-color)!important]"})}
          ${system.If("after-text"===i,core.template`
          <div class="${G}" style="${{...f}}">
            <span
              class="${N}"
              style="${k}">
              ${t??""}</span>
          </div>
          `)}
        </div>
      </div>
      <div data-index="${a}" data-show="${u}" class="${A}" style="${F}">
        <div data-index="${a}" class="${H}" style="${S()}">
          ${O()}
        </div>
      </div>
    </div>
  </div>
  `};exports.default=AccordionItem;
