"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[4185,89965],{86571:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(296540),r=a(217439),o=a(699784);const l=({id:e,children:t,values:a})=>n.createElement(r.A,{color:"text-1",weight:"bold",size:"medium"},e?n.createElement(o.sA,{id:e,values:a}):null,t)},216211:(e,t,a)=>{a.d(t,{e:()=>_});var n=a(956347),r=a(469733),o=a(296540),l=a(15095),s=a(627440),i=a(431247),c=a(293016),m=a(649413),u=a(497470);const _=()=>{const e=(0,r.useDispatch)(),t=(0,n.W6)(),a=(0,l.A)(`${s.VO.PORTS}`);return{handleGoToPortsPage:(0,o.useCallback)((n,r,o)=>{if(n)if(e((0,u.gU)(!0)),e((0,u.U)((0,m.HN)(c.F7.DEVICE,[n]))),o&&(e((0,u.IU)(!0)),e((0,u.E1)(!1))),r){const t=(0,i.FS)(n,r);e((0,u.Ao)([t]))}else e((0,u.Ao)([]));t.push(a)},[a,t,e])}}},276035:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(296540),r=a(402210),o=a(314714),l=a(874807),s=a(699784),i=a(132196),c=a(566723);const m=i.AH`
  margin-left: ${c.kc};
  min-width: 16px;
  height: 16px;
  width: fit-content;
`;var u=a(705145),_=a(71479),T=a(294303);const S=(0,_.A)(T.A)`
  border-radius: ${c.YC};
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  height: ${c.S2};
`,d=(0,_.A)(u.A)`
  width: 100%;
`,E=(0,_.A)(u.A)`
  margin-left: ${c.kc};
`,p=({id:e,onChange:t,checked:a,translationId:i,translationValues:c,children:u,disabled:_,count:T,countType:p,countVariant:R})=>{const A=0===T||"text"===R,C=(0,n.useCallback)(e=>{_||(e.stopPropagation(),e.preventDefault(),t())},[t,_]);return n.createElement(S,{onClick:C},n.createElement(o.A,{checked:a,id:e,onChange:l.P1,disabled:_}),n.createElement(d,{color:_?"text-4":"text-2",size:"medium",isTruncated:!0},i?n.createElement(s.sA,{id:i,values:c}):null,u),R?n.createElement(E,{color:_?"text-4":"text-3",size:"small"},A?T:n.createElement(r.A,{type:p,value:+T,className:m,size:"small"})):null)}},307330:(e,t,a)=>{a.d(t,{I:()=>r});var n=a(564985);const r=[n.sx.RADIO_NG,n.sx.RADIO_NA,n.sx.RADIO_6E,n.sx.RADIO_AD]},370080:(e,t,a)=>{a.d(t,{A:()=>S});var n=a(296540),r=a(231755),o=a(433068),l=a(689965),s=a(608935),i=a(564985),c=a(566723),m=a(294303),u=a(86571);const _=(0,s.uQ)([i.sx.RADIO_6E,i.sx.RADIO_NA,i.sx.RADIO_NG]).orderByRadio,T=({device:e})=>n.createElement(l.A,{type:l.I.ACCORDION,items:[{id:"airtime-insights",openByDefault:!0,label:n.createElement(u.A,{id:"DEVICE_KEY_METRICS"}),renderContent:()=>n.createElement(m.A,{flexDirection:"column",gap:c.Ln},e.radio_table?.sort(_)?.map((t,a,l)=>n.createElement(n.Fragment,null,n.createElement(o.A,{radioTableEntry:t,device:e,key:t.name,showBand:!0}),a!==l.length-1?n.createElement(r.A,null):null)))}]}),S=(0,n.memo)(({device:e})=>e.radio_table?.length?n.createElement(T,{device:e}):null)},608935:(e,t,a)=>{a.d(t,{Rm:()=>l,fU:()=>o,uQ:()=>r});var n=a(307330);const r=e=>{const t=(t,a)=>e.indexOf(t)-e.indexOf(a);return{orderRadios:t,orderByRadio:(e,a)=>t(e.radio,a.radio)}},{orderRadios:o,orderByRadio:l}=r(n.I)},659910:(e,t,a)=>{a.d(t,{A:()=>He});var n=a(296540),r=a(689965),o=a(469733),l=a(294303),s=a(566723),i=a(340936),c=a(964238),m=a(936344),u=a(217439),_=a(998837),T=a(853699),S=a(699784),d=a(290480),E=a(814803),p=a(577962),R=a(233847),A=a(801081),C=a(346010),D=a(686950),O=a(656372),M=a(402150);const x=(e,t,a)=>(0,A.Mz)((0,E.UO)(e,a),e=>{const a=(0,C.Au)(t);return e.map(({time:e,duration:t,mem:n,cpu:r,...o})=>({cpu:r,mem:n,time:e,duration:t,rx_crypts_6e:o[a[D.L.RX_CRYPTS_6E]]||0,rx_crypts_na:o[a[D.L.RX_CRYPTS_NA]]||0,rx_crypts_ng:o[a[D.L.RX_CRYPTS_NG]]||0,rx_frags_6e:o[a[D.L.RX_FRAGS_6E]]||0,rx_frags_na:o[a[D.L.RX_FRAGS_NA]]||0,rx_frags_ng:o[a[D.L.RX_FRAGS_NG]]||0,rx_errors_6e:o[a[D.L.RX_ERRORS_6E]]||0,rx_errors_na:o[a[D.L.RX_ERRORS_NA]]||0,rx_errors_ng:o[a[D.L.RX_ERRORS_NG]]||0,...(0,M.Px)(O.l_,!1,o)}))});var g=a(661867),X=a(991295),h=a(178233),P=a(282637);const I=({statsKey:e})=>{const{motifPalette:t}=(0,_.u)();switch(e){case d.Ss.RX_BYTES:case d.Ss.TX_BYTES:case d.Ss.TX_RETRIES:return n.createElement(P.Wx,{color:t[p.tD[e]]});default:return n.createElement(P.Zo,{color:t[p.tD[e]]})}},L=({timestamp:e,values:t,interval:a})=>{const{cpu:r,mem:o}=t||{};return n.createElement(l.A,{width:"100%",flexDirection:"column",gap:s.YC},n.createElement(X.XF,{timestamp:e,interval:a}),n.createElement(X.m0,{translationId:"COMMON_CPU",value:(0,h.A)(Math.round(r)),pip:n.createElement(I,{statsKey:d.Ss.CPU})}),n.createElement(X.m0,{translationId:"COMMON_MEMORY",value:(0,h.A)(Math.round(o)),pip:n.createElement(I,{statsKey:d.Ss.MEM})}))};var v=a(800828),f=a(71479),N=a(311785);const b=(0,f.A)(l.A,(0,N.A)("wrap"))`
  flex: 1;
  overflow-x: auto;
  flex-shrink: 0;
  flex-wrap: ${({wrap:e})=>e?"wrap":"nowrap"};
  gap: ${s.kc};
  min-height: ${s.fS};
  max-height: ${s.fS};
  align-items: center;
`;var U=a(276035),y=a(157766);const F=190,k={[d.Ss.MEM]:"COMMON_MEMORY",[d.Ss.CPU]:"COMMON_CPU",[d.Ss.TX_RETRIES]:"COMMON_TX_RETRIES",[d.Ss.CU_TOTAL]:"COMMON_AIRTIME",[d.Ss.RX_BYTES]:"COMMON_DOWNLOAD",[d.Ss.TX_BYTES]:"COMMON_UPLOAD",[d.Ss.NUM_STA]:"COMMON_CLIENTS",[d.Ss.TX_PACKETS]:"COMMON_UPLOAD_PACKETS",[d.Ss.RX_PACKETS]:"COMMON_DOWNLOAD_PACKETS",[d.Ss.TX_DROPPED]:"COMMON_TX_DROPS",[d.Ss.TX_ERRORS]:"COMMON_TX_ERRORS",[d.Ss.RX_DROPPED]:"COMMON_RX_DROPS",[d.Ss.RX_ERRORS]:"COMMON_RX_ERRORS",[d.Ss.RX_FRAGS]:"COMMON_RX_FRAGS",[d.Ss.RX_CRYPTS]:"COMMON_RX_CRYPTS",[d.Ss.WIFI_TX_ATTEMPTS]:"COMMON_WIFI_TX_ATTEMPTS",[d.Ss.WIFI_TX_DROPPED]:"COMMON_WIFI_TX_DROPPED"},w=[{id:d.Bo.ALL,label:n.createElement(S.sA,{id:"COMMON_ALL"})},{id:d.Bo.NG,label:n.createElement(S.sA,{id:"COMMON_RADIO_BAND_NG"})},{id:d.Bo.NA,label:n.createElement(S.sA,{id:"COMMON_RADIO_BAND_NA"})},{id:d.Bo.SIXE,label:n.createElement(S.sA,{id:"COMMON_RADIO_BAND_6E"})}],Y=[d.Ss.CPU,d.Ss.MEM,d.Ss.CU_TOTAL,d.Ss.NUM_STA,d.Ss.RX_BYTES,d.Ss.TX_BYTES,d.Ss.RX_PACKETS,d.Ss.TX_PACKETS,d.Ss.TX_RETRIES,d.Ss.WIFI_TX_DROPPED,d.Ss.RX_DROPPED,d.Ss.TX_ERRORS,d.Ss.TX_DROPPED,d.Ss.RX_ERRORS,d.Ss.RX_FRAGS,d.Ss.RX_CRYPTS],B=({allowedFilters:e})=>{const t=(0,o.useSelector)(E.MS),a=(0,n.useMemo)(()=>(e||Object.keys(t)).reduce((e,t)=>(e[t]=!0,e),{}),[e,t]),r=(0,o.useDispatch)(),i=(0,n.useCallback)(e=>()=>{r((0,y.fC)({...t,[e]:!t[e]}))},[r,t]);return n.createElement(l.A,null,n.createElement(b,{wrap:!0},Y.map(e=>a[e]?n.createElement(U.A,{key:e,checked:t[e],id:e,onChange:i(e)},n.createElement(l.A,{alignItems:"center",gap:s.YC},n.createElement(I,{statsKey:e}),n.createElement(S.sA,{id:k[e]}))):null)))},K=[d.Ss.CPU,d.Ss.MEM],$=({compact:e=!1,mac:t,inputRadioNames:a,inputDataRange:r})=>{const A=(0,o.useSelector)(E.yD),C=(0,o.useSelector)(E.K9),D=(0,o.useSelector)(E.Bl),O=(0,o.useSelector)(x(t||A,a||C,r||D)),M=(0,o.useSelector)(E.MS),h=(0,n.useMemo)(()=>e||K.every(e=>!M[e]),[e,M]),P=(0,n.useMemo)(()=>r||D,[r,D]),I=(0,n.useRef)({minTop:0,maxTop:0}),{motifPalette:f}=(0,_.u)(),N=(0,n.useRef)(null),{ref:b,width:U=0,height:y=0}=(0,i.A)(),k=(0,n.useMemo)(()=>(0,T.$V)(P.startDate,P.endDate,!0,!0),[P.endDate,P.startDate]),{start:w,end:Y}=(0,n.useMemo)(()=>(0,R.Qi)(P.startDate,P.endDate,k.grain),[P.endDate,k.grain,P.startDate]),$=(0,v.A)(w,Y,U,!1,P.preset),{cpuData:V,memData:W}=(0,n.useMemo)(()=>O.reduce((e,{time:t,mem:a,cpu:n})=>{const r={[d.Ss.CPU]:n,[d.Ss.MEM]:a};return e.cpuData.push({x:t,y:n,custom:r}),e.memData.push({x:t,y:a,custom:r}),e},{cpuData:[],memData:[]}),[O]),G=(0,n.useMemo)(()=>(0,g.Q0)(M,K,h),[h,M]),H=(0,n.useMemo)(()=>h?(0,g.SU)(K):M,[h,M]),z=(0,n.useCallback)(({top:e,left:t,x:a,hidden:r,custom:o},l)=>{const s=(0,g.xn)(o||{},H),i=(0,g.Jn)(s),c=(0,g.zR)(s);l!==i&&l!==c||(I.current={maxTop:l===i?e||0:I.current.maxTop||0,minTop:l===c?e||0:I.current.minTop||0});const m=(0,g.lZ)(I.current.maxTop,I.current.minTop,e);return n.createElement(X.JM,{top:e,left:t,hidden:r,chartWidth:U,chartHeight:y,timestamp:a,tooltipTopPositionCompensator:m,values:o,innerColor:f[p.tD[l]],tooltipRenderCondition:G===l,interval:k.grain,TooltipComponent:L})},[H,U,y,f,G,k.grain]),J=(0,n.useCallback)(e=>t=>z(t,e),[z]),Q=(0,n.useCallback)((e,t,a)=>n.createElement(n.Fragment,null,h||M[d.Ss.CPU]?n.createElement(c.A,{data:V,maxY:a,mouseData:t,getCoordinates:e,lineColor:f[p.tD[d.Ss.CPU]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:N?N.current:void 0,renderTooltip:J(d.Ss.CPU)}):null,h||M[d.Ss.MEM]?n.createElement(c.A,{data:W,maxY:a,mouseData:t,getCoordinates:e,lineColor:f[p.tD[d.Ss.MEM]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:N?N.current:void 0,renderTooltip:J(d.Ss.MEM)}):null),[h,V,M,W,J,f]);return n.createElement(l.A,{gap:s.kc,flexDirection:"column"},n.createElement(l.A,{alignItems:"center",gap:s.xO},n.createElement(u.A,{weight:"bold"},n.createElement(S.sA,{id:"COMMON_SYSTEM_UTILIZATION"})),e?null:n.createElement(B,{allowedFilters:K})),n.createElement(l.A,{width:"100%",minHeight:F,position:"relative",ref:b},n.createElement(m.A,{xAxis:$,width:U,height:y,yAxis:e?p.b4:p.Pv,margin:e?p.JD:p.PT},Q),n.createElement("div",{ref:N})))};var V=a(195462),W=a(282556),G=a(924012);const H=({timestamp:e,values:t,interval:a})=>{const{tx_bytes:r,rx_bytes:i,tx_packets:c,rx_packets:m}=t||{},u=(0,o.useSelector)(W.zi),_=(0,n.useMemo)(()=>Intl.NumberFormat(u,{notation:"compact"}),[u]);return n.createElement(l.A,{width:"100%",flexDirection:"column",gap:s.YC},n.createElement(X.XF,{timestamp:e,interval:a}),n.createElement(X.m0,{translationId:"COMMON_TX_PACKETS",value:_.format(c),pip:n.createElement(I,{statsKey:d.Ss.TX_PACKETS})}),n.createElement(X.m0,{translationId:"COMMON_RX_PACKETS",value:_.format(m),pip:n.createElement(I,{statsKey:d.Ss.RX_PACKETS})}),n.createElement(X.m0,{translationId:"COMMON_UPLOAD_TRAFFIC",value:(0,G.CB)(r).toString(),pip:n.createElement(I,{statsKey:d.Ss.TX_BYTES})}),n.createElement(X.m0,{translationId:"COMMON_DOWNLOAD_TRAFFIC",value:(0,G.CB)(i).toString(),pip:n.createElement(I,{statsKey:d.Ss.RX_BYTES})}))},z=[d.Ss.RX_PACKETS,d.Ss.TX_PACKETS,d.Ss.RX_BYTES,d.Ss.TX_BYTES],J=({compact:e=!1,mac:t,inputRadio:a,inputRadioNames:r,inputDataRange:A})=>{const C=(0,o.useSelector)(E.DN),D=(0,o.useSelector)(E.yD),O=(0,o.useSelector)(E.K9),M=(0,o.useSelector)(E.Bl),h=(0,o.useSelector)(x(t||D,r||O,A||M)),P=(0,o.useSelector)(E.MS),I=(0,o.useSelector)(W.zi),L=(0,n.useMemo)(()=>e||z.every(e=>!P[e]),[e,P]),f=(0,n.useMemo)(()=>A||M,[A,M]),N=a||C,b=(0,n.useRef)({minTop:0,maxTop:0}),{motifPalette:U}=(0,_.u)(),y=(0,n.useRef)(null),{ref:k,width:w=0,height:Y=0}=(0,i.A)(),K=(0,n.useMemo)(()=>(0,T.$V)(f.startDate,f.endDate,!0,!0),[f.endDate,f.startDate]),{start:$,end:J}=(0,n.useMemo)(()=>(0,R.Qi)(f.startDate,f.endDate,K.grain),[f.endDate,K.grain,f.startDate]),Q=(0,v.A)($,J,w,!1,f.preset),{uploadBytesData:j,downloadBytesData:Z,downloadPacketsData:q,uploadPacketsData:ee,maxValue:te,maxValue2:ae}=(0,n.useMemo)(()=>h.reduce((e,{time:t,mem:a,cpu:n,duration:r,...o})=>{const l=(0,R.Lr)(o,N),s={[d.Ss.RX_PACKETS]:l[d.Ss.RX_PACKETS],[d.Ss.TX_PACKETS]:l[d.Ss.TX_PACKETS],[d.Ss.RX_BYTES]:l[d.Ss.RX_BYTES],[d.Ss.TX_BYTES]:l[d.Ss.TX_BYTES]};return e.maxValue=Math.max(e.maxValue,L||P[d.Ss.RX_PACKETS]?l[d.Ss.RX_PACKETS]:0,L||P[d.Ss.TX_PACKETS]?l[d.Ss.TX_PACKETS]:0),e.maxValue2=Math.max(e.maxValue2,L||P[d.Ss.RX_BYTES]?l[d.Ss.RX_BYTES]:0,L||P[d.Ss.TX_BYTES]?l[d.Ss.TX_BYTES]:0),e.downloadBytesData.push({x:t,y:l[d.Ss.RX_BYTES],custom:s}),e.uploadBytesData.push({x:t,y:l[d.Ss.TX_BYTES],custom:s}),e.downloadPacketsData.push({x:t,y:l[d.Ss.RX_PACKETS],custom:s}),e.uploadPacketsData.push({x:t,y:l[d.Ss.TX_PACKETS],custom:s}),e},{downloadBytesData:[],uploadBytesData:[],downloadPacketsData:[],uploadPacketsData:[],maxValue:p.Rg,maxValue2:p.Rg}),[h,L,P,N]),ne=(0,G.CB)(ae||1),re=(0,n.useMemo)(()=>(0,g.Q0)(P,z,L),[L,P]),oe=(0,n.useMemo)(()=>L?(0,g.SU)(z):P,[L,P]),le=(0,n.useCallback)(({top:e,left:t,x:a,hidden:r,custom:o},l)=>{const s=Math.ceil(te+.1*te),i=Math.ceil(ne.bytes+.1*ne.bytes),c=(0,g.xn)({[d.Ss.RX_BYTES]:(o?.rx_bytes||0)/i,[d.Ss.TX_BYTES]:(o?.tx_bytes||0)/i,[d.Ss.RX_PACKETS]:(o?.rx_packets||0)/s,[d.Ss.TX_PACKETS]:(o?.tx_packets||0)/s},oe),m=(0,g.Jn)(c),u=(0,g.zR)(c),_=Y-30,T=_-20;b.current={maxTop:_-Math.round(c[m]*T),minTop:_-Math.round(c[u]*T)};const S=(0,g.lZ)(b.current.maxTop,b.current.minTop,e)||0;return n.createElement(X.JM,{top:e,left:t,hidden:r,chartWidth:w,chartHeight:Y,timestamp:a,tooltipTopPositionCompensator:S,lineStart:b.current.maxTop,lineEnd:b.current.minTop,values:o,innerColor:U[p.tD[l]],tooltipRenderCondition:re===l,interval:K.grain,TooltipComponent:H})},[te,ne.bytes,oe,Y,w,U,re,K.grain]),se=(0,n.useCallback)(e=>t=>le(t,e),[le]),ie=(0,n.useMemo)(()=>(0,V.Y)(Math.ceil(te+.1*te),e?3:10).map(({value:e},t)=>{const a=Intl.NumberFormat(I,{notation:"compact"}).formatToParts(+e);return!t&&a.some(e=>"compact"===e.type)?{value:e,label:a.filter(e=>"compact"===e.type).map(e=>e.value).join("")}:{value:e,label:Intl.NumberFormat(I,{notation:"compact"}).formatToParts(+e).filter(e=>"compact"!==e.type).map(e=>e.value).join("")}}),[e,I,te]),ce=(0,n.useMemo)(()=>{const t=(0,G.CB)(ne.bytes,ne.power).value;return(0,V.Y)(Math.ceil(ne.bytes+.1*ne.bytes),e?3:10).map(({value:e},a)=>{if(!a)return{value:e,label:ne.unit};const n=(0,G.CB)(+e,ne.power).value;let r;return r=t<10?n.toFixed(1):Math.round(n).toString(),{value:e,label:`${r}`}})},[e,ne]),me=(0,n.useCallback)((e,t,a)=>n.createElement(n.Fragment,null,L||P[d.Ss.RX_BYTES]?n.createElement(c.A,{data:Z,maxY:a,mouseData:t,getCoordinates:e,lineColor:U[p.tD[d.Ss.RX_BYTES]],variant:"gradientArea",interpolation:"linear",dashed:!0,allowCustomDots:!0,tooltipPortal:y?y.current:void 0,renderTooltip:se(d.Ss.RX_BYTES)}):null,L||P[d.Ss.TX_BYTES]?n.createElement(c.A,{data:j,maxY:a,mouseData:t,getCoordinates:e,lineColor:U[p.tD[d.Ss.TX_BYTES]],variant:"gradientArea",interpolation:"linear",dashed:!0,allowCustomDots:!0,tooltipPortal:y?y.current:void 0,renderTooltip:se(d.Ss.TX_BYTES)}):null,L||P[d.Ss.RX_PACKETS]?n.createElement(c.A,{data:q,maxY:a,forY2Axis:!0,mouseData:t,getCoordinates:e,lineColor:U[p.tD[d.Ss.RX_PACKETS]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:y?y.current:void 0,renderTooltip:se(d.Ss.RX_PACKETS)}):null,L||P[d.Ss.TX_PACKETS]?n.createElement(c.A,{data:ee,maxY:a,forY2Axis:!0,mouseData:t,getCoordinates:e,lineColor:U[p.tD[d.Ss.TX_PACKETS]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:y?y.current:void 0,renderTooltip:se(d.Ss.TX_PACKETS)}):null),[L,Z,q,P,se,U,j,ee]);return n.createElement(l.A,{gap:s.kc,flexDirection:"column",paddingRight:s.xO},n.createElement(l.A,{alignItems:"center",gap:s.xO},n.createElement(u.A,{weight:"bold"},n.createElement(S.sA,{id:"COMMON_CLIENT_ACTIVITY"})),e?null:n.createElement(B,{allowedFilters:z})),n.createElement(l.A,{width:"100%",height:"100%",minHeight:F,position:"relative",ref:k},n.createElement(m.A,{xAxis:Q,width:w-16,height:Y,yAxis:ce,y2Axis:ie,margin:e?p.JD:p.PT},me),n.createElement("div",{ref:y})))},Q=({timestamp:e,values:t,interval:a})=>{const{rx_crypts:r,rx_dropped:i,rx_errors:c,rx_frags:m,tx_dropped:u,tx_errors:_,wifi_tx_dropped:T,tx_retries:S}=t||{},E=(0,o.useSelector)(W.zi),p=(0,n.useMemo)(()=>Intl.NumberFormat(E,{notation:"compact"}),[E]);return n.createElement(l.A,{width:"100%",flexDirection:"column",gap:s.YC},n.createElement(X.XF,{timestamp:e,interval:a}),n.createElement(X.m0,{translationId:"COMMON_TX_RETRIES",value:(0,h.A)(Math.round(S)),pip:n.createElement(I,{statsKey:d.Ss.TX_RETRIES})}),n.createElement(X.m0,{translationId:"COMMON_WIFI_TX_DROPPED",value:(0,h.A)(T),pip:n.createElement(I,{statsKey:d.Ss.WIFI_TX_DROPPED})}),n.createElement(X.m0,{translationId:"COMMON_TX_DROPS",value:p.format(u),pip:n.createElement(I,{statsKey:d.Ss.TX_DROPPED})}),n.createElement(X.m0,{translationId:"COMMON_TX_ERRORS",value:p.format(_),pip:n.createElement(I,{statsKey:d.Ss.TX_ERRORS})}),n.createElement(X.m0,{translationId:"COMMON_RX_DROPS",value:p.format(i),pip:n.createElement(I,{statsKey:d.Ss.RX_DROPPED})}),n.createElement(X.m0,{translationId:"COMMON_RX_ERRORS",value:p.format(c),pip:n.createElement(I,{statsKey:d.Ss.RX_ERRORS})}),n.createElement(X.m0,{translationId:"COMMON_RX_FRAGS",value:p.format(m),pip:n.createElement(I,{statsKey:d.Ss.RX_FRAGS})}),n.createElement(X.m0,{translationId:"COMMON_RX_CRYPTS",value:p.format(r),pip:n.createElement(I,{statsKey:d.Ss.RX_CRYPTS})}))},j=[d.Ss.TX_RETRIES,d.Ss.WIFI_TX_DROPPED,d.Ss.TX_DROPPED,d.Ss.TX_ERRORS,d.Ss.RX_DROPPED,d.Ss.RX_ERRORS,d.Ss.RX_FRAGS,d.Ss.RX_CRYPTS],Z=({compact:e=!1,mac:t,inputRadio:a,inputRadioNames:r,inputDataRange:A})=>{const C=(0,o.useSelector)(E.DN),D=(0,o.useSelector)(E.yD),O=(0,o.useSelector)(E.K9),M=(0,o.useSelector)(E.Bl),h=(0,o.useSelector)(x(t||D,r||O,A||M)),P=(0,o.useSelector)(E.MS),I=(0,n.useRef)({minTop:0,maxTop:0}),{motifPalette:L}=(0,_.u)(),f=(0,n.useRef)(null),{ref:N,width:b=0,height:U=0}=(0,i.A)(),y=(0,n.useMemo)(()=>A||M,[A,M]),k=a||C,w=(0,n.useMemo)(()=>(0,T.$V)(y.startDate,y.endDate,!0,!0),[y.endDate,y.startDate]),{start:Y,end:K}=(0,n.useMemo)(()=>(0,R.Qi)(y.startDate,y.endDate,w.grain),[y.endDate,w.grain,y.startDate]),$=(0,o.useSelector)(W.zi),G=(0,n.useMemo)(()=>j.every(e=>!P[e]),[P]),H=(0,v.A)(Y,K,b,!1,A?.preset||y.preset),{rxCryptsData:z,rxDroppedData:J,rxErrorsData:Z,rxFragsData:q,txDroppedData:ee,txErrorsData:te,wifiTxDroppedData:ae,maxValue:ne,txRetriesData:re}=(0,n.useMemo)(()=>({...h.reduce((e,{time:t,mem:a,cpu:n,duration:r,...o})=>{const l=(0,R.m1)(o,k),s=(0,g.lD)(l[d.Ss.TX_RETRIES],l[d.Ss.WIFI_TX_ATTEMPTS],l[d.Ss.WIFI_TX_DROPPED]),i=(0,g.wd)(l[d.Ss.WIFI_TX_ATTEMPTS],l[d.Ss.WIFI_TX_DROPPED]),c={[d.Ss.TX_RETRIES]:s,[d.Ss.TX_DROPPED]:l[d.Ss.TX_DROPPED]||0,[d.Ss.TX_ERRORS]:l[d.Ss.TX_ERRORS]||0,[d.Ss.RX_DROPPED]:l[d.Ss.RX_DROPPED]||0,[d.Ss.RX_ERRORS]:l[d.Ss.RX_ERRORS]||0,[d.Ss.RX_FRAGS]:l[d.Ss.RX_FRAGS]||0,[d.Ss.RX_CRYPTS]:l[d.Ss.RX_CRYPTS]||0,[d.Ss.WIFI_TX_DROPPED]:i||0};return e.maxValue=Math.max(e.maxValue,(G||P[d.Ss.RX_CRYPTS])&&l[d.Ss.RX_CRYPTS]||0,(G||P[d.Ss.RX_DROPPED])&&l[d.Ss.RX_DROPPED]||0,(G||P[d.Ss.RX_ERRORS])&&l[d.Ss.RX_ERRORS]||0,(G||P[d.Ss.RX_FRAGS])&&l[d.Ss.RX_FRAGS]||0,(G||P[d.Ss.TX_DROPPED])&&l[d.Ss.TX_DROPPED]||0,(G||P[d.Ss.TX_ERRORS])&&l[d.Ss.TX_ERRORS]||0),e.txRetriesData.push({x:t,y:s,custom:c}),e.rxCryptsData.push({x:t,y:l[d.Ss.RX_CRYPTS]||0,custom:c}),e.rxDroppedData.push({x:t,y:l[d.Ss.RX_DROPPED]||0,custom:c}),e.rxErrorsData.push({x:t,y:l[d.Ss.RX_ERRORS]||0,custom:c}),e.rxFragsData.push({x:t,y:l[d.Ss.RX_FRAGS]||0,custom:c}),e.txDroppedData.push({x:t,y:l[d.Ss.TX_DROPPED]||0,custom:c}),e.txErrorsData.push({x:t,y:l[d.Ss.TX_ERRORS]||0,custom:c}),e.wifiTxDroppedData.push({x:t,y:i,custom:c}),e},{rxCryptsData:[],rxDroppedData:[],rxErrorsData:[],rxFragsData:[],txDroppedData:[],txErrorsData:[],wifiTxDroppedData:[],txRetriesData:[],maxValue:10})}),[h,G,P,k]),oe=(0,n.useMemo)(()=>(0,g.Q0)(P,j,G),[G,P]),le=(0,n.useMemo)(()=>G?(0,g.SU)(j):P,[G,P]),se=(0,n.useMemo)(()=>(0,V.Y)(Math.ceil(ne+.1*ne),e?3:10).map(({value:e},t)=>{const a=Intl.NumberFormat($,{notation:"compact"}).formatToParts(+e);return t||"compact"!==a[a.length-1]?.type?{value:e,label:a.filter(e=>"compact"!==e.type).map(e=>e.value).join("")}:{value:e,label:a[a.length-1].value}}),[e,$,ne]),ie=(0,n.useCallback)(({top:e,left:t,x:a,hidden:r,custom:o},l)=>{const s=Number(se[0].value),i=(0,g.xn)(o||{},le);Object.keys(i).forEach(e=>{[d.Ss.TX_RETRIES,d.Ss.WIFI_TX_DROPPED].includes(e)?i[e]/=100:i[e]/=s});const c=(0,g.Jn)(i),m=(0,g.zR)(i),u=U-30,_=u-20;I.current={maxTop:u-Math.round(i[c]*_),minTop:u-Math.round(i[m]*_)};const T=(0,g.lZ)(I.current.maxTop,I.current.minTop,e);return n.createElement(X.JM,{top:e,left:t,hidden:r,chartWidth:b,chartHeight:U,timestamp:a,tooltipTopPositionCompensator:T,lineStart:I.current.maxTop,lineEnd:I.current.minTop,values:o,innerColor:L[p.tD[l]],tooltipRenderCondition:oe===l,interval:w.grain,TooltipComponent:Q})},[se,le,U,b,L,oe,w.grain]),ce=(0,n.useCallback)(e=>t=>ie(t,e),[ie]),me=(0,n.useCallback)((e,t,a)=>n.createElement(n.Fragment,null,G||P[d.Ss.TX_RETRIES]?n.createElement(c.A,{data:re,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.TX_RETRIES]],variant:"line",dashed:!0,interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.TX_RETRIES)}):null,G||P[d.Ss.WIFI_TX_DROPPED]?n.createElement(c.A,{data:ae,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.WIFI_TX_DROPPED]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.WIFI_TX_DROPPED)}):null,G||P[d.Ss.RX_CRYPTS]?n.createElement(c.A,{data:z,forY2Axis:!0,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.RX_CRYPTS]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.RX_CRYPTS)}):null,G||P[d.Ss.RX_DROPPED]?n.createElement(c.A,{data:J,forY2Axis:!0,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.RX_DROPPED]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.RX_DROPPED)}):null,G||P[d.Ss.RX_ERRORS]?n.createElement(c.A,{data:Z,forY2Axis:!0,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.RX_ERRORS]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.RX_ERRORS)}):null,G||P[d.Ss.RX_FRAGS]?n.createElement(c.A,{data:q,forY2Axis:!0,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.RX_FRAGS]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.RX_FRAGS)}):null,G||P[d.Ss.TX_ERRORS]?n.createElement(c.A,{data:te,forY2Axis:!0,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.TX_ERRORS]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.TX_ERRORS)}):null,G||P[d.Ss.TX_DROPPED]?n.createElement(c.A,{data:ee,forY2Axis:!0,maxY:a,mouseData:t,getCoordinates:e,lineColor:L[p.tD[d.Ss.TX_DROPPED]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:f?f.current:void 0,renderTooltip:ce(d.Ss.TX_DROPPED)}):null),[G,P,ce,z,J,Z,q,L,ee,te,re,ae]);return n.createElement(l.A,{gap:s.kc,flexDirection:"column",paddingRight:s.xO},n.createElement(l.A,{alignItems:"center",gap:s.xO},n.createElement(u.A,{weight:"bold"},n.createElement(S.sA,{id:"COMMON_NETWORK_PERFORMANCE"})),e?null:n.createElement(B,{allowedFilters:j})),n.createElement(l.A,{width:"100%",height:"100%",minHeight:F,position:"relative",ref:N},n.createElement(m.A,{xAxis:H,width:b-16,yAxis:e?p.b4:p.Pv,height:U,y2Axis:se,margin:e?p.JD:p.PT},me),n.createElement("div",{ref:f})))};var q=a(885529),ee=a(424226),te=a(939703),ae=a(825032);const ne={[ae.S.DARK]:(0,te.J2)("#9B9DA7",.25),[ae.S.LIGHT]:(0,te.J2)("#B6B9C4",.25)};var re=a(572112),oe=a(779005),le=a(365468);const se=({timestamp:e,values:t,interval:a})=>{const{num_sta:r,cu_total:o}=t||{};return n.createElement(l.A,{width:"100%",flexDirection:"column",gap:s.YC},n.createElement(X.XF,{timestamp:e,interval:a}),n.createElement(X.m0,{translationId:"COMMON_AIRTIME",value:(0,h.A)(Math.round(o)),pip:n.createElement(I,{statsKey:d.Ss.CU_TOTAL})}),n.createElement(X.m0,{translationId:"COMMON_CLIENTS",value:r,pip:n.createElement(I,{statsKey:d.Ss.NUM_STA})}))},ie=[d.Ss.CU_TOTAL,d.Ss.NUM_STA],ce=({compact:e=!1,mac:t,inputRadio:a,inputRadioNames:r,inputDataRange:A})=>{const C=(0,o.useSelector)(E.DN),D=(0,o.useSelector)(E.yD),O=(0,o.useSelector)(E.K9),M=(0,o.useSelector)(E.Bl),h=(0,o.useSelector)(x(t||D,r||O,A||M)),P=(0,o.useSelector)(E.MS),I=(0,n.useMemo)(()=>e||ie.every(e=>!P[e]),[e,P]),L=(0,n.useMemo)(()=>A||M,[A,M]),f=a||C,{themeName:N,motifPalette:b}=(0,_.u)(),U=(0,n.useRef)({minTop:0,maxTop:0}),y=(0,n.useRef)(null),{ref:k,width:w=0,height:Y=0}=(0,i.A)(),K=(0,n.useMemo)(()=>(0,T.$V)(L.startDate,L.endDate,!0,!0),[L.endDate,L.startDate]),{start:$,end:H}=(0,n.useMemo)(()=>(0,R.Qi)(L.startDate,L.endDate,K.grain),[L.endDate,K.grain,L.startDate]),z=(0,o.useSelector)(W.zi),J=(0,n.useMemo)(()=>Intl.NumberFormat(z,{notation:"compact"}),[z]),Q=(0,v.A)($,H,w,!1,L.preset),j=(0,n.useMemo)(()=>w>re.A[oe.L.ML].FROM?4:1,[w]),Z=(0,n.useMemo)(()=>h.reduce((e,{num_sta_6e:t,num_sta_na:a,num_sta_ng:n})=>Math.max(e,t+a+n),0),[h]),te=Z<le.XO?le.ug:100*Math.ceil((Z+1)/100),{clientCountData:ae,clientStackedCountData:ce,cuTotalData:me}=(0,n.useMemo)(()=>{const e=Math.min(h.length,le.ON*j),t=(H-$)/e,a=Z>le.U0,{maxValue:n,clientCountData:r,cuTotalData:o}=h.reduce((e,{time:t,mem:a,cpu:n,duration:r,...o},l)=>{const s=(0,R.XT)(o,f),i=s[d.Ss.CU_TOTAL]>100?(e.cuTotalData[e.cuTotalData.length-1]||{}).y:s[d.Ss.CU_TOTAL],c={[d.Ss.CU_TOTAL]:s[d.Ss.CU_TOTAL],[d.Ss.NUM_STA]:s[d.Ss.NUM_STA]};return e.maxValue=Math.max(e.maxValue),e.cuTotalData.push({x:t,y:i,custom:c}),l!==h.length-1&&e.clientCountData.push({x:t,y:s[d.Ss.NUM_STA],num_sta:s[d.Ss.NUM_STA]}),e},{clientCountData:[],maxValue:p.Rg,cuTotalData:[]}),l=(0,G.CB)(n||1),s=l.bytes/te,i=a?[]:(0,G.OF)(r,$,t,s,e);return{maxByteValue:l,clientCountData:r.map(e=>({...e,y:e.y*s})),clientStackedCountData:i,cuTotalData:o}},[h,H,Z,te,j,f,$]),ue=(0,n.useMemo)(()=>(0,g.Q0)(P,ie,I),[I,P]),_e=(0,n.useMemo)(()=>I?(0,g.SU)(ie):P,[I,P]),Te=(0,n.useCallback)(({top:e,left:t,x:a,hidden:r,custom:o},l)=>{const s=(0,g.xn)({[d.Ss.CU_TOTAL]:o?.cu_total||0},_e),i=(0,g.Jn)(s),c=(0,g.zR)(s);l!==i&&l!==c||(U.current={maxTop:l===i?e||0:U.current.maxTop||0,minTop:l===c?e||0:U.current.minTop||0});const m=(0,g.lZ)(U.current.maxTop,U.current.minTop,e);return n.createElement(X.JM,{top:e,left:t,hidden:r,chartWidth:w,chartHeight:Y,timestamp:a,tooltipTopPositionCompensator:m,values:o,innerColor:b[p.tD[l]],tooltipRenderCondition:ue===l,interval:K.grain,TooltipComponent:se})},[_e,w,Y,b,ue,K.grain]),Se=(0,n.useCallback)(e=>t=>Te(t,e),[Te]),de=(0,n.useMemo)(()=>(0,V.Y)(te,e?3:11,!0).map(({value:e},t)=>({value:e,label:0===t?n.createElement("g",{transform:"translate(0 -10)"},n.createElement(ee.A,null)):(e||0===e)&&J.format(+e)||null})),[e,J,te]),Ee=(0,n.useCallback)((e,t,a,r,o)=>n.createElement(n.Fragment,null,I||P[d.Ss.NUM_STA]?n.createElement(q.A,{data:ce.length?ce:ae,getCoordinates:e,color:ne[N],hideStroke:!0,disableHoverHighlight:!0,width:o.width,height:o.height,stackedBarSpacing:1,variant:ce.length?"stacked":"grouped",barFullWidth:!0,key:ce.length+te}):null,I||P[d.Ss.CU_TOTAL]?n.createElement(c.A,{data:me,maxY:a,mouseData:t,getCoordinates:e,lineColor:b[p.tD[d.Ss.CU_TOTAL]],variant:"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:y?y.current:void 0,renderTooltip:Se(d.Ss.CU_TOTAL)}):null),[I,ae,ce,me,P,te,Se,b,N]);return n.createElement(l.A,{gap:s.kc,flexDirection:"column",paddingRight:s.xO},n.createElement(l.A,{alignItems:"center",gap:s.xO},n.createElement(u.A,{weight:"bold"},n.createElement(S.sA,{id:"COMMON_CLIENT_HISTORY"})),e?null:n.createElement(B,{allowedFilters:ie})),n.createElement(l.A,{width:"100%",minHeight:F,position:"relative",ref:k},n.createElement(m.A,{xAxis:Q,width:w-16,height:Y,yAxis:e?p.b4:p.Pv,y2Axis:de,margin:e?p.JD:p.PT},Ee),n.createElement("div",{ref:y})))};var me,ue=a(170459),_e=a(582724),Te=a(592510),Se=a(822336),de=a(633297),Ee=a(13994);!function(e){e[e.TOTAL_MULTICAST=d.Ss.TOTAL_MULTICAST]="TOTAL_MULTICAST",e[e.TOTAL_TX_MULTICAST=d.Ss.TOTAL_TX_MULTICAST]="TOTAL_TX_MULTICAST",e[e.TX_PACKETS=d.Ss.TX_PACKETS]="TX_PACKETS",e[e.RX_PACKETS=d.Ss.RX_PACKETS]="RX_PACKETS",e[e.CU_SELF_RX=d.Ss.CU_SELF_RX]="CU_SELF_RX",e[e.CU_SELF_TX=d.Ss.CU_SELF_TX]="CU_SELF_TX",e[e.CU_INTERF=d.Ss.CU_INTERF]="CU_INTERF"}(me||(me={}));var pe=a(386753);const Re=(e,t,a)=>(0,A.Mz)((0,pe.t)(e,t),e=>{const n=(0,O.Io)(t.startDate,t.endDate),r={};return{...e.reduce((e,{time:t,duration:o,...l})=>{const s=((e,t)=>{switch(t){case d.Bo.NA:return{[me.TOTAL_MULTICAST]:e.total_mcast_bcast_na,[me.TOTAL_TX_MULTICAST]:e.total_tx_mcast_bcast_na,[me.TX_PACKETS]:e.tx_packets_na,[me.RX_PACKETS]:e.rx_packets_na,[me.CU_SELF_RX]:e.cu_self_rx_na,[me.CU_SELF_TX]:e.cu_self_tx_na,[me.CU_INTERF]:e.cu_interf_na};case d.Bo.NG:return{[me.TOTAL_MULTICAST]:e.total_mcast_bcast_ng,[me.TOTAL_TX_MULTICAST]:e.total_tx_mcast_bcast_ng,[me.TX_PACKETS]:e.tx_packets_ng,[me.RX_PACKETS]:e.rx_packets_ng,[me.CU_SELF_RX]:e.cu_self_rx_ng,[me.CU_SELF_TX]:e.cu_self_tx_ng,[me.CU_INTERF]:e.cu_interf_ng};case d.Bo.SIXE:return{[me.TOTAL_MULTICAST]:e.total_mcast_bcast_6e,[me.TOTAL_TX_MULTICAST]:e.total_tx_mcast_bcast_6e,[me.TX_PACKETS]:e.tx_packets_6e,[me.RX_PACKETS]:e.rx_packets_6e,[me.CU_SELF_RX]:e.cu_self_rx_6e,[me.CU_SELF_TX]:e.cu_self_tx_6e,[me.CU_INTERF]:e.cu_interf_6e};case d.Bo.ALL:return{[me.TOTAL_MULTICAST]:e.total_mcast_bcast_na+e.total_mcast_bcast_ng+e.total_mcast_bcast_6e,[me.TOTAL_TX_MULTICAST]:e.total_tx_mcast_bcast_na+e.total_tx_mcast_bcast_ng+e.total_tx_mcast_bcast_6e,[me.TX_PACKETS]:e.tx_packets_na+e.tx_packets_ng+e.tx_packets_6e,[me.RX_PACKETS]:e.rx_packets_na+e.rx_packets_ng+e.rx_packets_6e,[me.CU_SELF_RX]:e.cu_self_rx_na+e.cu_self_rx_ng+e.cu_self_rx_6e,[me.CU_SELF_TX]:e.cu_self_tx_na+e.cu_self_tx_ng+e.cu_self_tx_6e,[me.CU_INTERF]:e.cu_interf_na+e.cu_interf_ng+e.cu_interf_6e};default:return{[me.TOTAL_MULTICAST]:0,[me.TOTAL_TX_MULTICAST]:0,[me.TX_PACKETS]:0,[me.RX_PACKETS]:0,[me.CU_SELF_RX]:0,[me.CU_SELF_TX]:0,[me.CU_INTERF]:0}}})(l,a),i=s[me.TX_PACKETS],c=s[d.Ss.CU_INTERF],m=(0,g.Wo)(s[me.TOTAL_MULTICAST],s[me.TX_PACKETS],s[me.RX_PACKETS]),u=s[d.Ss.CU_SELF_RX],_=s[d.Ss.CU_SELF_TX],S=s[d.Ss.TOTAL_TX_MULTICAST];!r[me.TOTAL_MULTICAST]&&s[me.TOTAL_MULTICAST]&&(r[me.TOTAL_MULTICAST]=!0);const E={[me.TOTAL_MULTICAST]:m,[me.TOTAL_TX_MULTICAST]:S,[me.TX_PACKETS]:i,[d.Ss.DURATION]:T.UE[n]?.grain||o,[me.CU_SELF_RX]:u,[me.CU_SELF_TX]:_,[me.CU_INTERF]:c};return e[me.TOTAL_MULTICAST].push({x:t,y:m,custom:E}),e},{[me.TOTAL_MULTICAST]:[]}),availableChartData:r}}),Ae="purple-06";var Ce=a(79100);const De=({timestamp:e,values:{[me.TOTAL_MULTICAST]:t=0,[me.TOTAL_TX_MULTICAST]:a=0,[me.TX_PACKETS]:r=0,[me.CU_SELF_RX]:o=0,[me.CU_SELF_TX]:i=0,[me.CU_INTERF]:c=0},interval:m})=>{const{themeName:T}=(0,_.u)(),{formatNumber:d}=(0,S.tz)(),E=(0,ue.TP)(t,i,o,c);return n.createElement(l.A,{width:"100%",flexDirection:"column",gap:s.kc},n.createElement(X.XF,{timestamp:e,interval:m}),n.createElement(X.m0,{translationId:"DEVICE_TOTAL_TX_PKTS",value:d(r,{notation:"compact"}),valueWeight:"bold"}),n.createElement(X.m0,{translationId:"COMMON_STATUS_MULTICAST",pip:n.createElement(P.Ay,{color:Se.Ay[`desktop-color-${Ae}-${T}`]}),value:n.createElement("span",null,d(a,{notation:"compact"})," (",(0,h.A)(Math.round(t)),")")}),E===ue.tH.WARNING?n.createElement(u.A,{size:"small",color:"notice"},n.createElement(S.sA,{id:"DEVICE_HIGH_MULTICAST"})):null,E===ue.tH.HEALTHY?n.createElement(u.A,{size:"small",color:"text-2"},n.createElement(S.sA,{id:"DEVICE_MULTICAST_HEALTHY"})):null)},Oe=({dataRange:e,radio:t,mac:a=d.TE.ALL,maxY:r=p.Rg,preset:m=d.sw.ONE_DAY})=>{const{motifPalette:E,themeName:A}=(0,_.u)(),C=(0,n.useRef)(null),D=(0,n.useRef)(null),{width:O=0,height:M=0}=(0,i.A)({ref:D}),{grain:x}=(0,n.useMemo)(()=>(0,T.$V)(e.startDate,e.endDate,!0,!0),[e.endDate,e.startDate]),{start:g,end:h}=(0,n.useMemo)(()=>(0,R.Qi)(e.startDate,e.endDate,x),[e.endDate,x,e.startDate]),P=(0,v.A)(g,h,O,!1,m),{availableChartData:I,...L}=(0,o.useSelector)(Re(a,e,t)),{...f}=(0,n.useMemo)(()=>{const e=L[me.TOTAL_MULTICAST]?.length||0,t=Math.min(e,64),a=(h-g)/t;return{[me.TOTAL_MULTICAST]:(0,de.Hf)(L[me.TOTAL_MULTICAST],x),interval:a}},[L,h,g,x]),N=(0,n.useCallback)(({top:e,left:t,x:a,hidden:r,custom:o={}})=>n.createElement(Ee.A,{width:X.E,topA:e,leftA:t,topB:e,chartWidth:O,chartHeight:M,hidden:r,description:n.createElement(De,{timestamp:a,values:o,interval:x}),innerColor:Se.Ay[`desktop-color-${Ae}-${A}`],tooltipRenderCondition:!0}),[O,M,x,E]),b=(0,n.useCallback)((e,t)=>n.createElement(n.Fragment,null,I[me.TOTAL_MULTICAST]?n.createElement(c.A,{data:f[me.TOTAL_MULTICAST],maxY:r,mouseData:t,getCoordinates:e,lineColor:Se.Ay[`desktop-color-${Ae}-${A}`],variant:"line",interpolation:"linear",hideMissingDataLine:!0,tooltipPortal:C?C.current:void 0,renderTooltip:N}):null),[E,N,f]);return I[me.TOTAL_MULTICAST]?n.createElement(l.A,{gap:s.kc,flexDirection:"column"},n.createElement(l.A,{alignItems:"center",gap:s.xO},n.createElement(u.A,{weight:"bold"},n.createElement(S.sA,{id:"COMMON_STATUS_MULTICAST"}))),n.createElement(l.A,{flexDirection:"row",justifyContent:"space-between",gap:s.kc},n.createElement(Ce.Ay,{height:F-Ce.N1,maxY:r,xAxis:P,tooltipContainerRef:C,chartRef:D},b))):null};var Me=a(149188),xe=a(497336),ge=a.n(xe),Xe=a(48450),he=a(208288),Pe=a(309447),Ie=a(814942),Le=a.n(Ie),ve=a(609392),fe=a(919952),Ne=a(32593);const be=e=>e[fe.U.AP_SIDE_PANEL_STATS],Ue=(0,A.Mz)(be,e=>e[Ne.e.DATE_RANGE]),ye=(0,A.Mz)(be,e=>e[Ne.e.RADIO]);var Fe=a(833634);const ke=()=>{const{formatMessage:e}=(0,S.tz)(),t=(0,o.useDispatch)(),[a,r]=(0,n.useState)(!1),l=(0,o.useSelector)(Ue),i=(0,n.useCallback)(e=>{t((0,Fe.$z)({...e}))},[t]),c=(0,n.useMemo)(()=>({startsAtLabel:e({id:"COMMON_STARTS_AT"}),endsAtLabel:e({id:"COMMON_ENDS_AT"}),applyButton:e({id:"COMMON_ACTION_APPLY"}),cancelButton:e({id:"COMMON_ACTION_CANCEL"})}),[e]),{startValue:m,endValue:u}=(0,n.useMemo)(()=>l.startDate&&l.endDate?{startValue:(0,he.A)(l.startDate,"CalendarDateTime"),endValue:(0,he.A)(Le()(l.endDate,1),"CalendarDateTime")}:{},[l.endDate,l.startDate]),[_,T]=(0,n.useState)({start:m,end:u}),[d,E]=(0,n.useState)(!1),p=(0,n.useCallback)(e=>{T(e),E(Boolean(e))},[]),R=(0,n.useCallback)(e=>{e&&!_&&Boolean(m)&&Boolean(u)&&T({start:m,end:u}),e||d||T(null),r(e)},[d,m,u,_,r]),A=(0,n.useCallback)(()=>{r(!1)},[]),C=(0,n.useCallback)(()=>{E(!1),T(null)},[]),D=(0,n.useCallback)(e=>{e&&(0,ve.Q)(e)&&i({startDate:new Date(e.start.toString()),endDate:new Date(e.end.toString())}),A()},[i,A]),{maxValue:O,minValue:M}=(0,n.useMemo)(()=>({maxValue:(0,he.A)(ge()(new Date),"CalendarDateTime"),minValue:(0,he.A)(new Date(0),"CalendarDateTime")}),[]);(0,n.useEffect)(()=>{const{startDate:e,endDate:t}=l;e&&t?T({start:(0,he.A)(e,"CalendarDateTime"),end:(0,he.A)(Le()(t,1),"CalendarDateTime")}):(T(null),E(!1))},[l]);const x=(0,n.useMemo)(()=>({start:(0,he.A)(l.startDate,"CalendarDateTime"),end:(0,he.A)(l.endDate,"CalendarDateTime")}),[l.endDate,l.startDate]),g=(0,n.useMemo)(()=>({isOpen:a,value:_,defaultValue:x,localizationTexts:c,onOpenChange:R,onCancel:A,onChange:p,onClear:C,onSave:D,minValue:M,maxValue:O,isClearable:!0,shouldCloseOnSelect:!1,presets:[],"aria-label":"AP Side Panel Stats Calendar"}),[a,_,x,c,R,A,p,C,D,M,O]);return n.createElement(Xe.X,{...g},n.createElement(Pe.A,{variant:"secondary-neutral",style:{borderRadius:s.kc}},n.createElement(Me.A,null)))};var we=a(979106),Ye=a(780811);const Be=(0,f.A)(we.A)`
  width: auto;
  flex: none;
  & > div {
    margin: unset;
  }
`,Ke=({device:e})=>{const t=(0,o.useDispatch)(),a=(0,o.useSelector)(ye),r=(0,Ye.J2F)(e),l=(0,n.useMemo)(()=>e?.radio_table?.map(({radio:e})=>e)||[],[e?.radio_table]),s=(0,n.useMemo)(()=>e.mac===d.TE.ALL?w.filter(({id:e})=>e!==d.Bo.SIXE||r):w.filter(({id:e})=>l.includes(e)||e===d.Bo.ALL),[l,r,e.mac]),i=(0,n.useCallback)(({id:e})=>{t((0,Fe.jO)(e))},[t]);return n.createElement(Be,{variant:"filter",selectedTab:a,onSelectTab:i,tabs:s})};var $e=a(638334);const Ve=(e,t)=>{const a=(0,$e.w)(e,t);return a<=1?d.sw.ONE_DAY:a<=7?d.sw.ONE_WEEK:d.sw.ONE_MONTH},We=({device:e})=>{const t=(0,o.useDispatch)(),{startDate:a,endDate:r}=(0,o.useSelector)(Ue),i=(0,o.useSelector)(ye),c=(0,ue.M1)(e.radio_table),m={[i]:c[i]},u=i===d.Bo.ALL?c:m,_=(0,n.useMemo)(()=>({startDate:a,endDate:r,preset:Ve(a,r)}),[a,r]);return(0,n.useEffect)(()=>{i===d.Bo.ALL||c[i]||t((0,Fe.jO)(d.Bo.ALL))},[t,c,i]),(0,_e.A)([(0,O.e9)({start:a,end:r,mac:e.mac},c,{crudCacheStrategy:{type:Te.e.CACHE}})],n.createElement(l.A,{flexDirection:"column",gap:s.Ln},n.createElement(l.A,{alignItems:"center",justifyContent:"space-between"},n.createElement(Ke,{device:e}),n.createElement(ke,null)),n.createElement(Oe,{dataRange:_,radio:i,mac:e.mac,preset:_.preset}),n.createElement($,{mac:e.mac,inputRadioNames:u,inputDataRange:_,compact:!0}),n.createElement(ce,{mac:e.mac,inputRadio:i,inputRadioNames:u,inputDataRange:_,compact:!0}),n.createElement(J,{mac:e.mac,inputRadio:i,inputRadioNames:u,inputDataRange:_,compact:!0}),n.createElement(Z,{mac:e.mac,inputRadio:i,inputRadioNames:u,inputDataRange:_,compact:!0})),{renderKey:`${a.getTime()}-${r.getTime()}`,trackingName:"ap-side-panel-stats"})};var Ge=a(86571);const He=(0,n.memo)(({device:e})=>{const t=(0,n.useMemo)(()=>[{id:"ap-stats-insights",label:n.createElement(Ge.A,{id:"COMMON_STATS"}),renderContent:()=>n.createElement(We,{device:e})}],[e]);return n.createElement(r.A,{type:r.I.ACCORDION,items:t})})},689965:(e,t,a)=>{a.d(t,{A:()=>T,I:()=>n});var n,r=a(296540),o=a(822336),l=a(427853),s=a(71479),i=a(825032),c=a(566723),m=a(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const u=(0,s.A)(m.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:a}})=>e||o.Ay[a===i.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:a})=>a||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,_=(0,s.A)(l.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:a}})=>e||o.Ay[a===i.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||o.Ay[t===i.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${c.Ln} ${c.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,T=({type:e,marginBottom:t,margin:a,padding:o,flex:l,width:s,nested:i,...c})=>"items"in c?r.createElement(_,{marginBottom:t,margin:a,padding:o,flex:l,nested:i,...c}):r.createElement(u,{nested:i,width:s,marginBottom:t,margin:a,padding:o,flex:l,isButtonList:e===n.BUTTON_LIST,...c},c.children)}}]);