Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ViewObjectDefinitions/objectDefinitionUtil",["module","exports","require","@liferay/object-js-components-web","frontend-js-web","../../utils/fds","../../utils/string"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteFolder=async function deleteFolder(e,t){await o.API.deleteFolder(Number(e)).then((()=>{Liferay.Util.openToast({message:(0,n.sub)(Liferay.Language.get("x-was-deleted-successfully"),"<strong>".concat(t,"</strong>"))})}))},t.deleteObjectDefinition=async function deleteObjectDefinition(e,t){await o.API.deleteObjectDefinitions(Number(e)).then((()=>{Liferay.Util.openToast({message:(0,n.sub)(Liferay.Language.get("x-was-deleted-successfully"),"<strong>".concat(t,"</strong>"))})}))},t.getFolderActions=function getFolderActions(e,t,r,o){const l=(0,i.formatActionURL)(t,e),s=[{label:Liferay.Language.get("import-object"),onClick:()=>{},symbolLeft:"import",value:"importObject"},{type:"divider"}];(null==o?void 0:o.update)&&(s.unshift({type:"divider"}),s.unshift({label:Liferay.Language.get("edit-label-and-erc"),onClick:()=>r((e=>_objectSpread(_objectSpread({},e),{},{editFolder:!0}))),symbolLeft:"pencil",value:"editFolder"}));(null==o?void 0:o.permissions)&&s.push({label:Liferay.Language.get("folder-permissions"),onClick:()=>{(0,n.openModal)({title:Liferay.Language.get("permissions"),url:l})},symbolLeft:"password-policies",value:"folderPermissions"});(null==o?void 0:o.delete)&&(s.push({type:"divider"}),s.push({label:Liferay.Language.get("delete-folder"),onClick:()=>r((e=>_objectSpread(_objectSpread({},e),{},{deleteFolder:!0}))),symbolLeft:"trash",value:"deleteFolder"}));return s},t.normalizeName=function normalizeName(e){const t=e.split(" "),r=t.map((e=>(0,l.firstLetterUppercase)(e))).join("");return(0,l.removeAllSpecialCharacters)(r)};var o=r("@liferay/object-js-components-web"),n=r("frontend-js-web"),i=r("../../utils/fds"),l=r("../../utils/string");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}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}}}));
//# sourceMappingURL=objectDefinitionUtil.js.map