Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.115/designer/js/definition-builder/diagram-builder/components/sidebar/sections/timers/select-action/ActionTypeAction",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../DiagramBuilderContext","../../shared-components/BaseActionsInfo"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types"));var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=r("../../../../../DiagramBuilderContext"),i=_interopRequireDefault(r("../../shared-components/BaseActionsInfo"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _default=({actionData:e,actionSectionsIndex:t,actionType:r,setActionSections:a})=>{const{functionActionExecutors:c,selectedItem:u}=(0,n.useContext)(o.DiagramBuilderContext),l="timerActions"===e.actionType?e:null,[s,p]=(0,n.useState)((null==l?void 0:l.script)||""),[d,f]=(0,n.useState)((null==l?void 0:l.scriptLanguage)||"select-a-script-type"),y=[{label:Liferay.Language.get("groovy"),type:"script",value:"groovy"},{label:Liferay.Language.get("java"),type:"script",value:"java"}];(null==c?void 0:c.length)&&y.push(...c.map((e=>({label:e,type:"functionActionExecutor",value:e}))));const[b,g]=(0,n.useState)(y.find((e=>e.value===d))),[j,v]=(0,n.useState)((null==l?void 0:l.description)||""),[O,w]=(0,n.useState)((null==l?void 0:l.name)||""),[m,_]=(0,n.useState)((null==l?void 0:l.priority)||1);return n.default.createElement(i.default,{actionTypes:y,description:j,name:O,placeholderName:Liferay.Language.get("my-action"),placeholderScript:"${userName} sent you a ${entryType} for review in the workflow.",priority:m,script:s,scriptLanguage:d,selectedActionType:b,selectedItem:u,setDescription:v,setName:w,setPriority:_,setScript:p,setScriptLanguage:f,setSelectedActionType:g,updateActionInfo:e=>{e.name&&(e.script||"functionActionExecutor"===(null==b?void 0:b.type)&&""===e.script)&&a((n=>{const o=[...n];return o[t]=_objectSpread(_objectSpread(_objectSpread({},n[t]),e),{},{actionType:r}),o}))}})};t.default=_default}}));
//# sourceMappingURL=ActionTypeAction.js.map