import{checkIconVisibility as t}from"./helpers.js";import{getSoldOutButtonStyles as e,getButtonStyle as a,getAddToCartButtonStyles as l}from"./styles.js";let getBaseButtonData=({style:e,styles:l,setting:n})=>{let{iconSvg:o,iconAlign:s,shouldClearSpace:i,enableHoverEffect:u}=n??{};return{iconVisible:t(l),buttonStyle:a(e,l),buttonSettings:{iconSvg:o,iconAlign:s,iconVisible:t(l),shouldClearSpace:i,enableHoverEffect:u}}},getSoldOutButtonData=t=>{let{buttonStyle:a,buttonSettings:l}=getBaseButtonData(t);return{buttonStyles:e(t.styles),buttonStyle:a,buttonSettings:{...l,htmlType:"button",label:t.label}}},getAddToCartButtonData=t=>{let e=l(t.styles),{buttonStyle:a,buttonSettings:n}=getBaseButtonData(t),o=e=>{let{isLiquid:a=!1}=e??{},l=a?{disabledLoading:!1,translate:t.setting?.translate?"label":void 0}:{loading:t.isLoading};return{...n,...l,htmlType:"submit",label:t.setting?.label}};return{buttonStyle:a,buttonStyles:e,getButtonSettings:o}};export{getAddToCartButtonData,getSoldOutButtonData};
