Liferay.Loader.define("analytics-reports-web@2.0.38/js/components/TotalCount",["module","exports","require","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../context/ConnectionContext","../context/StoreContext","../utils/numberFormat","./Hint"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("@liferay/frontend-js-react-web"),a=(u(n("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"))),o=u(n("../context/ConnectionContext")),l=n("../context/StoreContext"),c=n("../utils/numberFormat"),s=u(n("./Hint"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function u(e){return e&&e.__esModule?e:{default:e}}var f=function({className:e,dataProvider:t,label:n,percentage:i=!1,popoverHeader:u,popoverMessage:f,popoverPosition:d}){const{validAnalyticsConnection:p}=(0,a.useContext)(o.default),[y,m]=(0,r.useStateSafe)("-"),b=(0,a.useContext)(l.StoreDispatchContext),{languageTag:x,publishedToday:v}=(0,a.useContext)(l.StoreStateContext);(0,a.useEffect)((()=>{p&&t().then(m).catch((()=>{m("-"),b({type:"ADD_WARNING"})}))}),[b,t,m,p]);let j="-";return p&&!v&&(j="-"!==y?i?a.default.createElement("span",null,"".concat(y,"%")):(0,c.numberFormat)(x,y):y),a.default.createElement("div",{className:e},a.default.createElement("span",{className:"text-secondary"},n),a.default.createElement("span",{className:"text-secondary"},a.default.createElement(s.default,{message:f,position:d,title:u})),a.default.createElement("span",{className:"font-weight-bold inline-item-after"},j))};t.default=f}}));
//# sourceMappingURL=TotalCount.js.map