Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/edit_sxp_blueprint/query_builder_tab/QuerySXPElements",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/tooltip","liferay!frontend-js-react-web$react","../../shared/JSONSXPElement","../../shared/sxp_element/index","../../utils/constants","../../utils/sessionStorage","../../utils/utils"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=m(a("@frontend-taglib-clay$clayui/button")),n=m(a("@frontend-taglib-clay$clayui/icon")),i=m(a("@frontend-taglib-clay$clayui/layout")),r=a("@frontend-taglib-clay$clayui/tooltip"),u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=y();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=l?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(a,n,i):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),s=m(a("../../shared/JSONSXPElement")),o=m(a("../../shared/sxp_element/index")),d=a("../../utils/constants"),c=a("../../utils/sessionStorage"),f=a("../../utils/utils");function y(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return y=function(){return e},e}function m(e){return e&&e.__esModule?e:{default:e}}function p({elementInstances:e,entityJSON:t,errors:a=[],isSubmitting:y,indexFields:m,onBlur:p,onChange:g,onDeleteSXPElement:b,onChangeAddSXPElementVisibility:E,searchableTypes:S,setFieldTouched:h,setFieldValue:x,touched:P=[]}){const[L,_]=(0,u.useState)(!1);return u.default.createElement("div",{className:"query-sxp-elements"},u.default.createElement(i.default.Row,{className:"configuration-header",justify:"between"},u.default.createElement(i.default.Col,{size:6},Liferay.Language.get("query-elements")),u.default.createElement(i.default.Col,{size:6},u.default.createElement("div",{className:"builder-actions"},u.default.createElement(l.default,{"aria-label":Liferay.Language.get("collapse-all"),className:"collapse-button",displayType:"unstyled",onClick:()=>_(!L)},L?Liferay.Language.get("expand-all"):Liferay.Language.get("collapse-all")),u.default.createElement(r.ClayTooltipProvider,null,u.default.createElement(l.default,{"aria-label":Liferay.Language.get("add-query-element"),displayType:"primary",monospaced:!0,onClick:()=>{(0,c.setStorageAddSXPElementSidebar)(),E()},small:!0,title:Liferay.Language.get("add-query-element")},u.default.createElement(n.default,{symbol:"plus"})))))),0===e.length?u.default.createElement("div",{className:"sheet"},u.default.createElement("div",{className:"selected-sxp-elements-empty-text"},Liferay.Language.get("add-elements-to-optimize-search-results-for-your-use-cases"))):e.map((({id:e,sxpElement:l,uiConfigurationValues:n},i)=>(0,f.isCustomJSONSXPElement)(n)?u.default.createElement(s.default,{collapseAll:L,error:a[i],id:e,index:i,isSubmitting:y,key:e,onDeleteSXPElement:b,prefixedId:"".concat(d.SXP_ELEMENT_PREFIX.QUERY,"-").concat(i),setFieldTouched:h,setFieldValue:x,sxpElement:l,touched:P[i],uiConfigurationValues:n}):u.default.createElement(o.default,{collapseAll:L,entityJSON:t,error:a[i],id:e,index:i,indexFields:m,isSubmitting:y,key:e,onBlur:p,onChange:g,onDeleteSXPElement:b,prefixedId:"".concat(d.SXP_ELEMENT_PREFIX.QUERY,"-").concat(i),searchableTypes:S,setFieldTouched:h,setFieldValue:x,sxpElement:l,touched:P[i],uiConfigurationValues:n}))))}var g=u.default.memo(p);t.default=g}}));
//# sourceMappingURL=QuerySXPElements.js.map