"use strict";var t=require("@gem-sdk/core");const e="<svg width='16' height='16' fill='currentColor' viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z\"/></svg>",r="<svg fill='currentColor' width='16' height='16' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z\"/></svg>",o=({isShow:t,iconExpand:o,iconCollapse:l,iconSvg:i})=>o&&t?o:l&&!t?l:"plus"===i?t?e:r:i;exports.BODY_CHILD_INDEX=0,exports.ICON_MINUS=e,exports.ICON_PLUS=r,exports.MINIMUM_CHILD=1,exports.composeIconSvg=o,exports.getDataState=(t,e)=>{let{setting:r={},styles:o={},builderProps:l}=t,{activeKey:i,iconSvg:s,expandItem:a,iconPosition:n,iconCollapseSize:c,iconGlobalSize:p,iconExpand:g,iconCollapse:S,layoutHeader:u,expandedMode:d,configIconSize:m}=r,{bgColor:v,color:h,headerBorder:C,width:I,fullWidth:w,textColor:x,itemHeaderSpacing:L,contentSizePadding:y,iconColor:M,headerContentPadding:N,widthHeightSize:z}=o,D="multiple"===d,H=a&&i?i.toString().toLowerCase().split(",").map(t=>parseInt(t.trim())-1).map(t=>t.toString()):[],U=D?[...H]:H;return{uidState:l?.uid,settingState:{iconSvg:s,isIconPlus:"plus"===s,activeKey:i,expanded:D,expandItem:a,iconPosition:n,iconGlobalSize:p,iconCollapse:S,iconExpand:g,iconCollapseSize:c,layoutHeader:u,expandedMode:d,configIconSize:m,parentUid:l?.uid,childListNumber:a?i?.toString().toLowerCase()==="all"?e?.map((t,e)=>e.toString()):U:[],chidlrenUid:e?.map(t=>t.uid)},stylesState:{bgColor:v,color:h,headerBorder:C,fullWidth:w,width:I,itemHeaderSpacing:L,textColor:x,iconColor:M,contentSizePadding:y,headerContentPadding:N,widthHeightSize:z},accordions:U}},exports.getParentSettings=(t={})=>{let{iconSvg:e,titleTypo:r,layoutHeader:o,iconGlobalSize:l,iconCollapseSize:i,iconCollapse:s,iconExpand:a,alignment:n,configIconSize:c,iconPosition:p}=t,g=r?{...r,attrs:{...r.attrs}}:void 0;return g?.attrs?.color&&delete g.attrs.color,{iconSvg:e,titleTypo:g,layoutHeader:o,iconGlobalSize:l,iconCollapseSize:i,iconCollapse:s,iconExpand:a,alignment:n,configIconSize:c,iconPosition:p}},exports.getSettingItemLiquid=e=>{let{index:r,accordions:l,parentSetting:i,parentStyle:s}=e,{titleTypo:a,iconCollapse:n,iconExpand:c,activeKey:p,expandItem:g,iconSvg:S}=i??{};delete a?.attrs?.color;let{itemContentSpacing:u,iconColor:d,contentSizePadding:m}=s??{},v=!!g&&(p?.toString()?.toLowerCase()==="all"||l?.includes(r?.toString()??"")),h=t.makeGlobalSize(m),C=o({isShow:v,iconExpand:c,iconCollapse:n,iconSvg:S});return{isShow:v,composeContentSizeStyle:()=>{let e={...m&&h.padding,...u?.type||m?{}:t.composeSize(u?.custom)};return v?e:t.removePaddingYInStyle(e)},collapsibleIcon:C,composeIconColor:(()=>{let e={normal:d?.normal??"transparent",hover:d?.hover??d?.active??d?.normal??"transparent",active:d?.active??"transparent"};return v?t.makeStyle({c:t.getSingleColorVariable(e?.active)}):t.getGlobalColorStateStyle("c",e)})(),makeIcon:C}};
