Liferay.Loader.define("@liferay/content-dashboard-web@2.0.73/js/ContentDashboardManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){let{portletNamespace:a}=t,o=function(e,t){if(null==e)return{};var a,l,o=function(e,t){if(null==e)return{};var a,l,o={},n=Object.keys(e);for(l=0;l<n.length;l++)a=n[l],t.indexOf(a)>=0||(o[a]=e[a]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)a=n[l],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}(t,["portletNamespace"]);return n(n({},o),{},{onFilterDropdownItemClick(t,{item:o={}}){const{data:n}=o;if(!Object.keys(n).length)return;const{action:r,dialogTitle:c,selectEventName:i,selectItemURL:d,multiple:u,size:g=e.size}=n;var p;"selectAssetCategory"===r?(p=n,(0,l.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),height:"70vh",iframeBodyCssClass:"",multiple:!0,onSelect:e=>{if(e){const t=Object.keys(e).filter((t=>!e[t].unchecked));let o=null==p?void 0:p.redirectURL;t.forEach((t=>{o=(0,l.addParams)("".concat(a,"assetCategoryId=").concat(e[t].categoryId),o)})),(0,l.navigate)(o)}},selectEventName:"".concat(a,"selectedAssetCategory"),size:"md",title:null==p?void 0:p.dialogTitle,url:null==p?void 0:p.selectAssetCategoryURL})):"selectAssetTag"===r?(e=>{(0,l.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),height:"70vh",multiple:!0,onSelect:t=>{if(t){const o=t.map((e=>e.value));let n=null==e?void 0:e.redirectURL;o.forEach((e=>{n=(0,l.addParams)("".concat(a,"assetTagId=").concat(e),n)})),(0,l.navigate)(n)}},selectEventName:"".concat(a,"selectedAssetTag"),size:"lg",title:null==e?void 0:e.dialogTitle,url:null==e?void 0:e.selectTagURL})})(n):"selectAuthor"===r?(e=>{(0,l.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),height:"70vh",multiple:!0,onSelect:t=>{if(t){let o=null==e?void 0:e.redirectURL;t.forEach((e=>{o=(0,l.addParams)("".concat(a,"authorIds=").concat(e.id),o)})),(0,l.navigate)(o)}},selectEventName:"".concat(a,"selectedAuthorItem"),size:"lg",title:null==e?void 0:e.dialogTitle,url:null==e?void 0:e.selectAuthorURL})})(n):"selectContentDashboardItemSubtype"===r?(e=>{(0,l.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),height:"70vh",multiple:!0,onSelect:t=>{let o=null==e?void 0:e.redirectURL;t.forEach((e=>{o=(0,l.addParams)("".concat(a,"contentDashboardItemSubtypePayload=").concat(JSON.stringify(e)),o)})),(0,l.navigate)(o)},selectEventName:"".concat(a,"selectedContentDashboardItemSubtype"),size:"md",title:null==e?void 0:e.dialogTitle,url:null==e?void 0:e.selectContentDashboardItemSubtypeURL})})(n):"selectScope"===r?(e=>{(0,l.openSelectionModal)({height:"70vh",id:"".concat(a,"selectedScopeIdItem"),onSelect:t=>{(0,l.navigate)((0,l.addParams)("".concat(a,"scopeId=").concat(t.groupid),null==e?void 0:e.redirectURL))},selectEventName:"".concat(a,"selectedScopeIdItem"),size:"lg",title:null==e?void 0:e.dialogTitle,url:null==e?void 0:e.selectScopeURL})})(n):(0,l.openSelectionModal)({buttonAddLabel:e.buttonAddLabel,height:e.modalHeight,iframeBodyCssClass:e.iframeBodyCssClass,multiple:"true"===u,onSelect:e=>s({data:n,portletNamespace:a,selection:e}),selectEventName:a+i,size:g,title:c,url:d})}})};var l=a("frontend-js-web");function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}function n(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e={buttonAddLabel:Liferay.Language.get("select"),iframeBodyCssClass:"",modalHeight:"70vh",size:"md"},c=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e&&!Object.prototype.hasOwnProperty.call(e,"currentTarget"),i=({data:e,portletNamespace:t,selection:a})=>{const{itemValueKey:o,redirectURL:n,urlParamName:r}=e;return[a].reduce(((e,t)=>e.concat(t)),[]).reduce(((e,a)=>{let n;return n=o?a[o]:"string"==typeof a?a:JSON.stringify(a),(0,l.addParams)("".concat(t).concat(r,"=").concat(n),e)}),n)},s=({data:e,portletNamespace:t,selection:a})=>{c(a)&&(a=Object.values(a).filter((e=>!e.unchecked))),(0,l.navigate)(i({data:e,portletNamespace:t,selection:a}))}}}));
//# sourceMappingURL=ContentDashboardManagementToolbarPropsTransformer.js.map