Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.115/designer/js/definition-builder/diagram-builder/components/sidebar/sections/timers/TimerFields",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","./TimerScale"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r("@frontend-taglib-clay$clayui/form"),n=(_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),l=_interopRequireDefault(r("./TimerScale"));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}}var _default=({durationScaleValue:e,durationValue:t,recurrence:r,scaleHelpText:i,setTimerSections:u,timerIdentifier:c,timersIndex:o})=>{const[d,f]=(0,n.useState)(e||"second"),[s,m]=(0,n.useState)(t||"");return(0,n.useEffect)((()=>{d&&s&&u((e=>{const t=[...e],a=e.find((({identifier:e})=>e===c));return r?(a.recurrence=s,a.recurrenceScale=d):(a.duration=s,a.durationScale=d),t.splice(o,1,a),t}))}),[c,d,o,s]),n.default.createElement("div",{className:"form-group-autofit timer-inputs"},n.default.createElement("div",{className:"form-group-item"},n.default.createElement("label",{htmlFor:"timerScale"},Liferay.Language.get("scale"),!r&&n.default.createElement("span",{className:"ml-1 mr-1 text-warning"},"*")),n.default.createElement(l.default,{setTimerScale:f,timerScale:d}),i&&n.default.createElement("div",{className:"help-text"},i)),n.default.createElement("div",{className:"form-group-item"},n.default.createElement("label",{htmlFor:"timerValue"},Liferay.Language.get("duration"),!r&&n.default.createElement("span",{className:"ml-1 mr-1 text-warning"},"*")),n.default.createElement(a.ClayInput,{min:"0",onChange:({target:e})=>m(e.value),onWheel:e=>e.target.blur(),step:"1",type:"number",value:s})))};t.default=_default}}));
//# sourceMappingURL=TimerFields.js.map