Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/pages/RuleEditor.es",["module","exports","require","./RuleEditor.scss","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","data-engine-taglib","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.RuleEditor=function RuleEditor(t){var r;let{onCancel:i,onSave:u,rule:c}=t,f=_objectWithoutProperties(t,["onCancel","onSave","rule"]);const[d,s]=(0,l.useState)(!0);return l.default.createElement(a.default,{className:"form-rule-builder",onSubmit:e=>e.preventDefault()},l.default.createElement("div",{className:"form-rule-builder-header"},l.default.createElement("h2",{className:"text-default"},Liferay.Language.get("rule")),l.default.createElement("h4",{className:"text-default"},Liferay.Language.get("define-condition-and-action-to-change-fields-and-elements-on-the-form"))),l.default.createElement(o.RuleEditor,_extends({onChange:t=>{let{logicalOperator:r}=t,n=_objectWithoutProperties(t,["logicalOperator"]);e.rule=_objectSpread(_objectSpread({},n),{},{"logical-operator":r})},onValidator:e=>s(!e),rule:null!==(r=e.rule)&&void 0!==r?r:c},f)),l.default.createElement("div",{className:"form-rule-builder-footer"},l.default.createElement(n.default.Group,{spaced:!0},l.default.createElement(n.default,{disabled:d,displayType:"primary",onClick:()=>{u(e.rule),e.rule=void 0}},Liferay.Language.get("save")),l.default.createElement(n.default,{displayType:"secondary",onClick:()=>{e.rule=void 0,i()}},Liferay.Language.get("cancel")))))},r("./RuleEditor.scss");var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/form")),o=r("data-engine-taglib"),l=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 a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));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 _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}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}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,a=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const e={rule:void 0}}}));
//# sourceMappingURL=RuleEditor.es.js.map