Liferay.Loader.define("journal-web@5.0.151/js/SelectDDMStructureButton",["module","exports","require","frontend-js-web"],(function(e,t,r){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({namespace:e,removeButton:t,selectDDMStructureURL:r,workflowDefinitions:o,workflowEnabled:c}){const a=Liferay.SearchContainer.get("".concat(e,"ddmStructuresSearchContainer")),d=document.getElementById("".concat(e,"selectDDMStructure")),handleSelectDDMStructureButtonClick=()=>{(0,n.openSelectionModal)({height:"70vh",iframeBodyCssClass:"",onSelect:e=>{if(e){const r=JSON.parse(e.value),n=t.replace(/REMOVE_BUTTON_ROW_ID/g,r.ddmstructureid);c?a.addRow([r.name,o.replace(/WORKFLOW_NAME/g,"workflowDefinition"+r.ddmstructureid),n],r.ddmstructureid):a.addRow([r.name,n],r.ddmstructureid),a.updateDataStore()}},selectEventName:"".concat(e,"selectDDMStructure"),title:Liferay.Language.get("structures"),url:r})};return a.get("contentBox").delegate("click",(e=>{const t=e.currentTarget,r=t.ancestor("tr");a.deleteRow(r,t.attr("data-rowId"))}),".modify-link"),d.addEventListener("click",handleSelectDDMStructureButtonClick),{dispose(){d.removeEventListener("click",handleSelectDDMStructureButtonClick)}}};var n=r("frontend-js-web")}));
//# sourceMappingURL=SelectDDMStructureButton.js.map