Liferay.Loader.define("@liferay/object-web@1.0.132/js/components/ManagementToolbar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/management-toolbar","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$react","./ModalEditExternalReferenceCode"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function ManagementToolbar({backURL:e,externalReferenceCode:t,hasPublishObjectPermission:a,hasUpdateObjectDefinitionPermission:f,isApproved:s,label:m,objectDefinitionId:y,portletNamespace:b,screenNavigationCategoryKey:g,system:p}){const[E,v]=(0,u.useState)(t),[L,j]=(0,u.useState)(!1),{observer:C,onClose:R}=(0,c.useModal)({onClose:()=>j(!1)}),submitObjectDefinition=e=>{var t;const a=document.getElementById("".concat(b,"fm"));var l;e||(null==a||null===(l=a.querySelector("#".concat(b,"cmd")))||void 0===l||l.setAttribute("value","publish"));null==a||null===(t=a.querySelector("#".concat(b,"externalReferenceCode")))||void 0===t||t.setAttribute("value",E),null==a||a.submit()};return u.default.createElement(u.default.Fragment,null,u.default.createElement(r.default,{className:"border-bottom"},u.default.createElement(r.default.ItemList,null,u.default.createElement("div",{className:"border-right ml-sm-2 mr-3 pr-3"},u.default.createElement("h3",{className:"mb-0 text-truncate"},m),u.default.createElement("strong",{className:(0,i.default)(p?"label-info":"label-warning","label")},p?Liferay.Language.get("system"):Liferay.Language.get("custom"))),u.default.createElement("div",null,u.default.createElement("div",null,u.default.createElement("span",{className:"text-secondary"},"".concat(Liferay.Language.get("id"),":")),u.default.createElement("strong",{className:"ml-2"},y)),u.default.createElement("div",{className:"mt-1"},u.default.createElement("span",{className:"text-secondary"},"".concat(Liferay.Language.get("erc"),":")),u.default.createElement("strong",{className:"ml-2"},E),u.default.createElement("span",{className:"ml-3 text-secondary",title:Liferay.Language.get("internal-key-to-reference-the-object-definition")},u.default.createElement(n.default,{symbol:"question-circle"})),u.default.createElement(l.default,{className:"ml-3 p-0 text-secondary",displayType:"unstyled",onClick:()=>j(!0)},u.default.createElement(n.default,{symbol:"pencil"}))))),(!g||"details"===g)&&u.default.createElement(r.default.ItemList,null,u.default.createElement(l.default.Group,{key:1,spaced:!0},u.default.createElement(l.default,{displayType:"unstyled",id:"".concat(b,"cancel"),name:"cancel",onClick:()=>(0,o.navigate)(e)},Liferay.Language.get("cancel")),u.default.createElement(l.default,{disabled:!f,displayType:"secondary",id:"".concat(b,"save"),name:"save",onClick:()=>submitObjectDefinition(!0)},Liferay.Language.get("save")),!s&&u.default.createElement(l.default,{disabled:!a,id:"".concat(b,"publish"),name:"publish",onClick:()=>submitObjectDefinition(!1)},Liferay.Language.get("publish"))))),L&&u.default.createElement(d.default,{externalReferenceCode:E,objectDefinitionId:y,observer:C,onClose:R,setExternalReferenceCode:v}))};var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/management-toolbar")),c=a("@frontend-taglib-clay$clayui/modal"),i=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),o=a("frontend-js-web"),u=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();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 r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=_interopRequireDefault(a("./ModalEditExternalReferenceCode"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=ManagementToolbar.js.map