Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.85/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=(u(r("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();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=u(r("./TimerScale"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function u(e){return e&&e.__esModule?e:{default:e}}var o=({durationScaleValue:e,durationValue:t,recurrence:r,scaleHelpText:i,setTimerSections:u,timerIdentifier:o,timersIndex:c})=>{const[f,d]=(0,n.useState)(e||"second"),[s,m]=(0,n.useState)(t||"");return(0,n.useEffect)((()=>{f&&s&&u((e=>{const t=[...e],a=e.find((({identifier:e})=>e===o));return r?(a.recurrence=s,a.recurrenceScale=f):(a.duration=s,a.durationScale=f),t.splice(c,1,a),t}))}),[o,f,c,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:d,timerScale:f}),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=o}}));
//# sourceMappingURL=TimerFields.js.map