Liferay.Loader.define("@liferay/content-dashboard-web@2.0.73/js/components/SidebarPanelInfoView/Share",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,r,t){var n;window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=t("frontend-js-web"),a=((n=t("liferay!frontend-js-react-web$prop-types"))&&n.__esModule,function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}t.default=e,r&&r.set(e,t);return t}(t("liferay!frontend-js-react-web$react")));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}var c=({fetchSharingButtonURL:e,onError:r})=>{const t=(0,a.useRef)(null);return(0,a.useEffect)((()=>{t.current&&(0,o.fetch)(e).then((r=>{if(!r.ok)throw new Error("Failed to fetch ".concat(e));return r.text()})).then((e=>{t.current.innerHTML=e,(0,o.runScriptsInElement)(t.current)})).catch((e=>{r&&r()}))}),[e,r]),a.default.createElement("span",{ref:t})};r.default=c}}));
//# sourceMappingURL=Share.js.map