import{u as useSelector,j as jsxRuntimeExports,n as hidePanel}from"./js-core.esm4.js";import{e as selectIsEditMode,h as selectActiveStep,p as panelId,g as actions,S as SHARED_TEXT}from"./js-core.esm86.js";import"./js-core.esm15.js";import{S as Stack,d as Tooltip}from"./js-core.esm9.js";import{B as Button}from"./js-core.esm7.js";import{u as useDispatch}from"./js-core.esm12.js";(e=>{e.SKIP="SKIP",e.NEXT="NEXT",e.BACK="BACK",e.CANCEL="CANCEL",e.CREATE_PACKAGE="CREATE_PACKAGE",e.UPDATE_PACKAGE="UPDATE_PACKAGE"})(ENextButtonType=ENextButtonType||{});var ENextButtonType,PanelControls=function(e){var t=e.disableNext,s=e.disableBack,a=e.onClickNext,n=e.onClickBack,o=e.nextButtonType,i=void 0===o?"NEXT":o,o=e.invalidFields,e=void 0!==o&&o,r=useDispatch(),o=useSelector(selectIsEditMode),c=useSelector(selectActiveStep);return jsxRuntimeExports.jsxs(Stack,{sx:{position:"absolute",bottom:"30px",right:"30px",display:"flex",gap:"15px"},direction:"row",children:[jsxRuntimeExports.jsx(Button,{"data-testid":"rc-package-manager-back-btn",sx:{color:"#2A323C"},onClick:function(){n&&n(),r(1===c?hidePanel(panelId):actions.stepper.backStep())},disabled:s,children:o||1===c?SHARED_TEXT.panel.cancel():SHARED_TEXT.panel.back()}),jsxRuntimeExports.jsx(Tooltip,{placement:"top",title:t&&e?SHARED_TEXT.panel.someFieldsInvalidMessage():t?SHARED_TEXT.panel.incompleteFieldsMessage():"",children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(Button,{"data-testid":"rc-package-manager-next-btn",onClick:function(){r(actions.stepper.nextStep()),a&&a()},variant:"contained",disabled:t,children:(()=>{switch(i){case"NEXT":return SHARED_TEXT.panel.next();case"SKIP":return SHARED_TEXT.panel.skip();case"CREATE_PACKAGE":return SHARED_TEXT.panel.createPackage();case"UPDATE_PACKAGE":return SHARED_TEXT.panel.updatePackage();default:return null}})()})})})]})};export{ENextButtonType as E,PanelControls as P};
