Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/plugins/field-sidebar/components/ElementSetList.es",["module","exports","require","data-engine-js-components-web","data-engine-taglib","liferay!frontend-js-react-web$react"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("data-engine-js-components-web"),a=n("data-engine-taglib"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("liferay!frontend-js-react-web$react"));function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const EmptyPanel=({searchTerm:e})=>i.default.createElement("div",{className:"mt-2"},i.default.createElement(a.EmptyState,{emptyState:{description:Liferay.Language.get("there-are-no-element-sets-yet"),title:Liferay.Language.get("there-are-no-element-sets")},keywords:e,small:!0}));var _default=({searchTerm:e=""})=>{const{fieldSetDefinitionURL:t,portletNamespace:n}=(0,r.useConfig)(),{activePage:o,editingLanguageId:l,elementSets:s,pages:c}=(0,r.useFormState)(),d=(0,r.useForm)(),f=a.SearchUtils.getSearchRegex(e),u=s.filter((({name:e})=>f.test(e)));return u.length?i.default.createElement("div",{className:"mt-3"},u.map(((e,f)=>{const u={definitionURL:t,editingLanguageId:l,elementSetId:e.id,elementSets:s,namespace:n};return i.default.createElement(a.FieldType,{dragType:"elementSet:add",icon:"forms",key:f,label:e.name,onDoubleClick:()=>{const e={pageIndex:o,rowIndex:c[o].rows.length};d((0,r.elementSetAdded)(function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({indexes:e},u)))},payload:u})}))):i.default.createElement(EmptyPanel,{searchTerm:e})};t.default=_default}}));
//# sourceMappingURL=ElementSetList.es.js.map