Liferay.Loader.define("@liferay/document-library-web@6.0.154/document_library/js/data-engine/panels/InfoPanel.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/loading-indicator","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react","../../../css/data_engine_info_panel.scss"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function InfoPanel({title:e,url:t}){const[n,d]=(0,o.useState)(!0),[s,c]=(0,o.useState)(""),u=(0,i.useIsMounted)();return(0,o.useEffect)((()=>{(0,l.fetch)(t).then((e=>e.text())).then((e=>{u()&&(c(e),d(!1))})).catch((e=>{}))}),[u,t]),o.default.createElement("div",{className:"dm-sidebar sidebar-sm"},o.default.createElement("div",{className:"sidebar-header"},o.default.createElement("div",{className:"autofit-row mb-3 sidebar-section"},o.default.createElement("div",{className:"component-title"},o.default.createElement("h2",{className:"text-truncate-inline"},e)),o.default.createElement(a.ClayButtonWithIcon,{"aria-label":(()=>"Details"===e?Liferay.Language.get("close-details-panel"):"Permissions"===e?Liferay.Language.get("close-permissions-panel"):"Additional Metadata Fields"===e?Liferay.Language.get("close-additional-metadata-fields-panel"):void 0)(),displayType:"unstyled",onClick:()=>{const e=document.querySelector(".ddm-form-builder--sidebar-open"),t=document.querySelector(".multi-panel-sidebar-content-open");e.classList.remove("ddm-form-builder--sidebar-open"),t.classList.remove("multi-panel-sidebar-content-open")},size:"sm",symbol:"times",tabIndex:"0",title:Liferay.Language.get("close")}))),o.default.createElement("div",{className:"sidebar-body"},n?o.default.createElement(r.default,null):o.default.createElement(InfoPanelBody,{content:s})))};var a=n("@frontend-taglib-clay$clayui/button"),r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("@frontend-taglib-clay$clayui/loading-indicator")),i=n("@liferay/frontend-js-react-web"),l=n("frontend-js-web"),o=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 n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=a?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(n,r,i):n[r]=e[r]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}n("../../../css/data_engine_info_panel.scss");class InfoPanelBody extends o.default.Component{constructor(e){super(e),this._ref=o.default.createRef()}componentDidMount(){this._ref.current&&((0,l.runScriptsInElement)(this._ref.current),this._ref.current.addEventListener("change",this._handleOnChange))}shouldComponentUpdate(){return!1}render(){return o.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.content},ref:this._ref})}}}}));
//# sourceMappingURL=InfoPanel.es.js.map