"use strict";(globalThis.webpackChunkpojo_accessibility=globalThis.webpackChunkpojo_accessibility||[]).push([[1039],{7365(e,t,a){a.d(t,{PieChart:()=>f});var r=a(40730),i=a(2660),s=a(21164),n=a(17925),l=a(78398),o=a(37082),d=a(89968),c=a(94284),h=a(85848),u=a(95231),x=a(10790);const p=e=>{const{itemData:t,series:a}=e;return(0,x.jsxs)(c.A,{sx:{p:2,pb:1},children:[(0,x.jsx)(m,{variant:"body2",color:"text.tertiary",itemColor:a.data[t.dataIndex].color,children:a.data[t.dataIndex].featureTitle}),(0,x.jsx)(h.A,{variant:"h6",children:`${a.data[t.dataIndex].featureClicks} (${a.data[t.dataIndex].value}%)`})]})},m=(0,u.I)(h.A,{shouldForwardProp:e=>"itemColor"!==e})`
	position: relative;
	padding-left: 18px;
	&:before {
		content: '';
		position: absolute;
		left: 0;
		top: calc(50% - 5px);
		display: inline-block;
		width: 10px;
		height: 10px;
		border-radius: 50%;
		background-color: ${e=>e.itemColor};
	}
`;var g=a(86087),b=a(43331),v=a(44694);const f=()=>{const{stats:e}=(0,v.p)(),t=(0,g.useRef)(null),[a,c]=(0,g.useState)(null),h=()=>c(Number(t.current.offsetWidth)/4-32);(0,g.useEffect)(()=>(window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)),[]),(0,g.useEffect)(()=>{h()},[t]);const u=e.elements?.reduce((e,{event:t,total:a})=>(e[t]=(e[t]||0)+Number(a),e),{}),m=Object.entries(u).map(([e,t])=>({event:e,total:t})).sort((e,t)=>t.value-e.value),f=m.slice(0,6),j=m.slice(6).reduce((e,t)=>e+Number(t.total),0);j>0&&f.push({event:"other",total:j});const A=f.reduce((e,t)=>e+Number(t.total),0),k=f.map((e,t)=>{const a=parseFloat((e.total/A*100).toFixed(2));return{label:`${b.xT[e.event].chartsTitle}: ${a}%`,featureTitle:b.xT[e.event].chartsTitle,featureClicks:e.total,color:b.Ph[t],value:a}}),y=e.elements.length>0&&null!==a;return(0,x.jsxs)(r.A,{variant:"outlined",sx:{height:"100%"},ref:t,children:[(0,x.jsx)(i.A,{title:(0,x.jsx)(d.B,{}),sx:{pb:0}}),y&&(0,x.jsx)(n.r,{series:[{data:k,innerRadius:a<100?a-15:85,outerRadius:a<100?a:100,paddingAngle:0,cornerRadius:0,startAngle:0,endAngle:360,cx:a+48,cy:150}],sx:{[`& .${l.hM.root}`]:{fontSize:"2.875rem",lineHeight:1.43,letterSpacing:"0.01071em"},[`& .${s.O.mark}`]:{ry:10}},slots:{itemContent:p},slotProps:{legend:{itemMarkWidth:10,itemMarkHeight:10,markGap:8,itemGap:12,padding:32,labelStyle:{fontWeight:400,fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em"}}},height:300}),0===e.elements.length&&(0,x.jsx)(o.Y,{})]})}},84090(e,t,a){a.d(t,{LineChart:()=>m});var r=a(40730),i=a(2660),s=a(85848),n=a(26457),l=a(21094),o=a(55646),d=a(94284),c=a(38443),h=a(10790);const u=e=>{const{dataIndex:t,axis:a,series:r}=e;return r[0].data[t]?(0,h.jsxs)(d.A,{sx:{p:2,pb:1},children:[(0,h.jsx)(s.A,{variant:"body2",color:"text.tertiary",children:(0,c.dateI18n)("d F",a.data[t],!1)}),(0,h.jsx)(s.A,{variant:"h6",children:r[0].data[t]})]}):null};var x=a(37082),p=a(44694);const m=()=>{const e=(0,n.A)(),{stats:t}=(0,p.p)(),a=t.dates.reduce((e,t)=>e+Number(t.total),0),d=t.dates.length>0;return(0,h.jsxs)(r.A,{variant:"outlined",sx:{height:"100%"},children:[(0,h.jsx)(i.A,{title:(0,h.jsx)(o.f,{}),subheader:a>0?(0,h.jsx)(s.A,{variant:"h3",sx:{height:"50px"},children:a.toString()}):null,sx:{pb:0}}),d&&(0,h.jsx)(l.b,{series:[{type:"line",curve:"linear",data:t.dates.map(e=>e.total),color:e.palette.info.main}],xAxis:[{scaleType:"point",data:t.dates.map(e=>e.date),valueFormatter:(e,t)=>"tick"===t.location?(0,c.dateI18n)("d.m",e,!1):e}],slots:{axisContent:u},tooltip:{trigger:a?"axis":"none"},height:250}),0===t.dates.length&&(0,h.jsx)(x.Y,{})]})}}}]);