"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[4281],{203430:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Kt});var r=a(296540),n=a(469733),l=a(340936),i=a(582724),s=a(413357),c=a(834959),o=a(592510),m=a(984652),E=a(171073),A=a(580987),u=a(755528),d=a(71479),p=a(294303),h=a(566723);const C=(0,d.A)(p.A)`
  flex-direction: column;
  height: 100%;
  padding-top: ${h.xO};
  gap: ${h.Ln};
  overflow: hidden;
`;var S,y=a(762629);!function(e){e.RETRIES="retries",e.SIGNAL="signal",e.EVENTS="events",e.DOWNLOAD_PACKETS="downloadPackets",e.UPLOAD_PACKETS="uploadPackets",e.POE_USAGE="poeUsage"}(S||(S={}));const N={limit:200,separateConnectionSignalParam:!1,scope:void 0},g={[S.RETRIES]:!0,[S.SIGNAL]:!1,[S.EVENTS]:!0,[S.DOWNLOAD_PACKETS]:!1,[S.UPLOAD_PACKETS]:!1,[S.POE_USAGE]:!1},D={[S.RETRIES]:!1,[S.SIGNAL]:!0,[S.EVENTS]:!1,[S.DOWNLOAD_PACKETS]:!1,[S.UPLOAD_PACKETS]:!1,[S.POE_USAGE]:!0};var O=a(936344),M=a(656372),_=a(87250),T=a(212401),x=a(840279),z=a(468063),P=a(964238),f=a(998837),I=a(822336);const G={[S.RETRIES]:"green-06",[S.SIGNAL]:"aqua-06",[S.EVENTS]:"ublue-06",[S.DOWNLOAD_PACKETS]:"aqua-06",[S.UPLOAD_PACKETS]:"purple-06",[S.POE_USAGE]:"orange-06"},k=({userReport:e,getCoordinates:t,mouseData:a,maxY:n,yAxisMax:l,yAxisMin:i,y2AxisMax:s,y2AxisMin:c,chartHovered:o,tooltipContainer:m,analyzerGraphState:E,renderTooltip:d})=>{const p=(0,r.useContext)(u.A),{themeName:h}=(0,f.u)(),C=(0,r.useMemo)(()=>`${E}GradientId`,[E]),y=(0,r.useMemo)(()=>I.Ay[`desktop-color-${G[E]}-${h}`],[E,h]),N=(0,r.useCallback)(({txRetries:e,signal:t,tx_packets:a,rx_packets:r,poe_usage:n})=>{switch(E){case S.RETRIES:return e;case S.SIGNAL:return t||-100;case S.DOWNLOAD_PACKETS:return r;case S.UPLOAD_PACKETS:return a;case S.POE_USAGE:return n;default:return 0}},[E]),O=(0,r.useMemo)(()=>e.map(({time:e,signal:t=0,tx_retries:a=0,wifi_tx_attempts:r=0,wifi_tx_dropped:n=0,tx_packets:l=0,rx_packets:i=0,poe_usage:s=0})=>{return c=Math.round(100*a/(a+r+n||1)),{x:e,y:N({txRetries:c,signal:t,tx_packets:l,rx_packets:i,poe_usage:s}),custom:{txRetries:c,signalStrength:t,txPackets:l,rxPackets:i,poeUsage:s}};var c}),[e,N]),M=(0,r.useCallback)(e=>d(e,E,y),[d,y,E]);return r.createElement(P.A,{data:O,maxY:n,forY2Axis:D[E],yAxisMax:l,yAxisMin:i,y2AxisMax:s,y2AxisMin:c,mouseData:a,getCoordinates:t,lineColor:y,variant:"line",interpolation:"curved",dashed:g[E],tooltipPortal:m?.current,customGradientId:C,renderTooltip:M,showTooltip:o&&!p[A.z.ACTIVE_ROWS].length})};var L=a(584916),v=a(675556),R=a(874734);const w={[v.sw.THIRTY_MINUTES]:R.FE.MINUTES,[v.sw.ONE_HOUR]:R.FE.MINUTES,[v.sw.ONE_DAY]:R.FE.MINUTES,[v.sw.ONE_WEEK]:R.FE.HOURLY,[v.sw.ONE_MONTH]:R.FE.DAILY,[L.j]:R.FE.DAILY},U={[R.FE.MINUTES]:3e5,[R.FE.HOURLY]:36e5,[R.FE.DAILY]:864e5};var W=a(13994),H=a(217439),b=a(459449);const $=({timestamp:e,dayDifference:t,intervalSeconds:a,txRetries:n,signalStrength:l,analyzerDateTimeFormats:{full:i,short:s},analyzerGraphRetriesState:c,analyzerGraphSignalState:o})=>r.createElement(p.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:h.YC},r.createElement(p.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_DATE_TIME"})),r.createElement(H.A,{size:"small",color:"text-2"},i.format(e),t<=7&&a?r.createElement(r.Fragment,null," - ",s.format(e+1e3*a)):null)),c?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_TX_RETRIES"})),r.createElement(H.A,{size:"small",color:"text-2"},(-1===n?0:n).toFixed(1),"%")):null,o?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_SIGNAL_STRENGTH"})),r.createElement(H.A,{size:"small",color:"text-2"},l.toFixed(1)," ",r.createElement(b.sA,{id:"COMMON_UNIT_DBM"}))):null),V=({x:e,left:t,top:a,hidden:n,gradientColor:l,signalTooltipProps:i,analyzerGraphRetriesState:s,analyzerGraphSignalState:c,analyzerGraphState:o,dayDifference:m,chartHeight:E,chartWidth:A,txRetries:u,signalStrength:d,analyzerDateTimeFormats:p,intervalSeconds:h})=>r.createElement(W.A,{width:300,topA:a,leftA:t,topB:i.top,leftB:i.left,chartWidth:A,chartHeight:E,hidden:n,description:r.createElement($,{timestamp:e,dayDifference:m,intervalSeconds:h,txRetries:u,signalStrength:d,analyzerDateTimeFormats:p,analyzerGraphRetriesState:s,analyzerGraphSignalState:c}),innerColor:l,tooltipRenderCondition:![s,c].every(Boolean)||o===S.SIGNAL});var K=a(866816),F=a(500235);const Y=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
`;var B=a(118818);const Z=(0,d.A)(p.A)`
  flex-direction: column;
  gap: ${h.YC};
`,j=(0,d.A)(p.A)`
  gap: ${h.xO};
  > div:first-child {
    margin-top: 6px;
  }
`,X=(0,d.A)(p.A)`
  flex-direction: column;
  gap: 2px;
`;var Q=a(351063),q=a(758649),J=a(959341),ee=a(275357),te=a(845030),ae=a(398300);const re=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE]?.id}))},[t,e]),l=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.WIFI,id:e[ee.cr.WLAN]?.id||J.R6}))},[e,t]);return r.createElement(H.A,{size:"inherit",color:"inherit"},r.createElement(b.sA,{id:"ANALYZER_CONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ee.cr.WLAN]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:a},e[ee.cr.DEVICE]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"}))}}))};var ne=a(956347),le=a(928085);const ie=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,ne.W6)(),l=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE]?.id}))},[t,e]),i=e[ee.cr.WLAN]?.id,s=(0,le.A)(J._L),c=(0,r.useCallback)(()=>{i?(0,te.XP)({type:ae.H.WIFI,id:i}):a.push(s)},[a,i,s]);return r.createElement(H.A,{size:"inherit",color:"inherit"},r.createElement(b.sA,{id:"ANALYZER_DISCONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:c},e[ee.cr.WLAN]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ee.cr.DEVICE]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"}))}}))},se=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE_FROM]?.id}))},[t,e]),l=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE_TO]?.id}))},[t,e]);return r.createElement(H.A,{size:"inherit",color:"inherit"},r.createElement(b.sA,{id:"ANALYZER_ROAMED_EVENT",values:{deviceFrom:r.createElement(q.A,{type:"button",variant:"inline",onClick:a},e[ee.cr.DEVICE_FROM]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"})),deviceTo:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ee.cr.DEVICE_TO]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"}))}}))},ce=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE]?.id}))},[t,e]),l=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.NETWORK,id:e[ee.cr.NETWORK]?.id}))},[t,e]);return r.createElement(H.A,{size:"inherit",color:"inherit"},r.createElement(b.sA,{id:"ANALYZER_CONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ee.cr.NETWORK]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:a},e[ee.cr.DEVICE]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"}))}}))},oe=({parameters:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE]?.id}))},[t,e]),l=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.NETWORK,id:e[ee.cr.NETWORK]?.id}))},[t,e]);return r.createElement(H.A,{size:"inherit",color:"inherit"},r.createElement(b.sA,{id:"ANALYZER_DISCONNECTED_EVENT",values:{network:r.createElement(q.A,{type:"button",variant:"inline",onClick:l},e[ee.cr.NETWORK]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"})),device:r.createElement(q.A,{type:"button",variant:"inline",onClick:a},e[ee.cr.DEVICE]?.name||r.createElement(b.sA,{id:"COMMON_UNKNOWN"}))}}))},me=({log:{key:e,parameters:t}})=>Q.w0.includes(e)?r.createElement(re,{parameters:t}):Q.fq.includes(e)?r.createElement(ce,{parameters:t}):Q.en.includes(e)?r.createElement(ie,{parameters:t}):Q.pV.includes(e)?r.createElement(oe,{parameters:t}):Q.dD.includes(e)?r.createElement(se,{parameters:t}):null,Ee=({analyzerEventValue:e,analyzerDateTimeFormats:t})=>{const{themeName:a}=(0,f.u)();return r.createElement(Z,null,e.slice(0,5).map(e=>r.createElement(j,{key:e.id},r.createElement(B.A,{size:"smaller",color:`${I.Ay[`desktop-color-text-2-${a}`]}`}),r.createElement(X,null,r.createElement(me,{log:e}),r.createElement(H.A,{size:"inherit",color:"text-3"},t.tooltip.format(e.timestamp))))))},Ae=({analyzerEventValue:e,analyzerDateTimeFormats:t})=>e.length>1?r.createElement(Ee,{analyzerEventValue:e,analyzerDateTimeFormats:t}):r.createElement(me,{log:e[0]}),ue=(0,d.A)(p.A)`
  margin-bottom: ${h.kc};
`,de=({analyzerDateTimeFormats:e,timestamp:t})=>r.createElement(ue,null,e.tooltip.format(t)),pe=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  margin-top: ${h.kc};
`,he=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  margin-top: ${h.YC};
`,Ce=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  gap: ${h.YC};
`,Se=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,ye=({parameters:e})=>{const[t,a]=e[ee.cr.WIFI_STATS]?.name?.split(", -")||[];return r.createElement(Ce,null,t?r.createElement(Se,null,r.createElement(b.sA,{id:"COMMON_CHANNEL"}),r.createElement("div",null,t)):null,a?r.createElement(Se,null,r.createElement(b.sA,{id:"COMMON_SIGNAL"}),r.createElement("div",null,"-",a)):null)};var Ne=a(670),ge=a(438369);const De=(0,d.A)(p.A)`
  width: 100%;
  min-width: 260px;
  flex-direction: column;
  gap: ${h.YC};
`,Oe=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,Me=(0,d.A)(p.A)`
  gap: ${h.YC};
`,_e=(0,d.A)(p.A)`
  align-items: center;
`,Te=({parameters:e})=>{const t=(0,n.useDispatch)(),a=e[ee.cr.DURATION]?.name,l=e[ee.cr.DATA_DOWN]?.name,i=e[ee.cr.DATA_UP]?.name,s=e[ee.cr.DEVICE]?.name,c=e[ee.cr.SIGNAL_STRENGTH]?.name,o=(0,r.useCallback)(()=>{t((0,te.XP)({type:ae.H.DEVICE,id:e[ee.cr.DEVICE]?.id}))},[t,e]);return r.createElement(De,null,a?r.createElement(Oe,null,r.createElement(b.sA,{id:"COMMON_TIME_CONNECTED"}),r.createElement("div",null,a)):null,i||l?r.createElement(Oe,{gap:h.YC},r.createElement(b.sA,{id:"COMMON_DATA_USED"}),r.createElement(Me,null,l?r.createElement(_e,null,r.createElement(Ne.A.Icon,{size:"small"}),r.createElement(H.A,{size:"inherit",color:"traffic-down"},l)):null,i?r.createElement(_e,null,r.createElement(ge.A.Icon,{size:"small"}),r.createElement(H.A,{size:"inherit",color:"traffic-up"},i)):null)):null,s||c?r.createElement(Oe,null,r.createElement(b.sA,{id:"COMMON_LAST_CONNECTED"}),r.createElement("div",null,r.createElement(q.A,{type:"button",variant:"inline",onClick:o},s||r.createElement(b.sA,{id:"COMMON_UNKNOWN"}))," ",r.createElement("span",{style:{textTransform:"lowercase"}},r.createElement(b.sA,{id:"COMMON_AT"}))," ",c||r.createElement(b.sA,{id:"COMMON_FALLBACK"})," ",r.createElement(b.sA,{id:"COMMON_UNIT_DBM"}))):null)},xe=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  gap: ${h.YC};
`,ze=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,Pe=({parameters:e})=>{const{formatMessage:t}=(0,b.tz)(),a=e[ee.cr.WIFI_STATS]?.name?.split(", -")?.[0],n=e[ee.cr.SIGNAL_STRENGTH_FROM]?.name,l=e[ee.cr.SIGNAL_STRENGTH]?.name;return r.createElement(xe,null,a?r.createElement(ze,null,r.createElement(b.sA,{id:"COMMON_CHANNEL"}),r.createElement("div",null,a)):null,n&&l?r.createElement(ze,null,r.createElement(b.sA,{id:"COMMON_ROAMING_DECISION"}),r.createElement("div",null,`${n} ${t({id:"COMMON_UNIT_DBM"})} ${t({id:"COMMON_TO"})} ${l} ${t({id:"COMMON_UNIT_DBM"})}`)):null)},fe=(0,d.A)(p.A)`
  width: 100%;
  flex-direction: column;
  gap: ${h.YC};
`,Ie=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,Ge=({parameters:e})=>{const t=e[ee.cr.CONNECTION_SPEED]?.name,a=e[ee.cr.IP]?.name;return r.createElement(fe,null,t?r.createElement(Ie,null,r.createElement(b.sA,{id:"COMMON_LINK_SPEED"}),r.createElement("div",null,t)):null,a?r.createElement(Ie,null,r.createElement(b.sA,{id:"COMMON_IP_ADDRESS"}),r.createElement("div",null,a)):null)},ke=(0,d.A)(p.A)`
  width: 100%;
  min-width: 260px;
  flex-direction: column;
  gap: ${h.YC};
`,Le=(0,d.A)(p.A)`
  width: 100%;
  justify-content: space-between;
`,ve=(0,d.A)(p.A)`
  gap: ${h.YC};
`,Re=(0,d.A)(p.A)`
  align-items: center;
`,we=({parameters:e})=>{const t=e[ee.cr.DURATION]?.name,a=e[ee.cr.DATA_DOWN]?.name,n=e[ee.cr.DATA_UP]?.name;return r.createElement(ke,null,t?r.createElement(Le,null,r.createElement(b.sA,{id:"COMMON_TIME_CONNECTED"}),r.createElement("div",null,t)):null,n||a?r.createElement(Le,{gap:h.YC},r.createElement(b.sA,{id:"COMMON_DATA_USED"}),r.createElement(ve,null,a?r.createElement(Re,null,r.createElement(Ne.A.Icon,{size:"small"}),r.createElement(H.A,{size:"inherit",color:"traffic-down"},a)):null,n?r.createElement(Re,null,r.createElement(ge.A.Icon,{size:"small"}),r.createElement(H.A,{size:"inherit",color:"traffic-up"},n)):null)):null)},Ue=({log:{key:e,parameters:t}})=>Q.w0.includes(e)?r.createElement(ye,{parameters:t}):Q.fq.includes(e)?r.createElement(Ge,{parameters:t}):Q.en.includes(e)?r.createElement(Te,{parameters:t}):Q.pV.includes(e)?r.createElement(we,{parameters:t}):Q.dD.includes(e)?r.createElement(Pe,{parameters:t}):null,We=({analyzerEventValue:e})=>e.length>1?e.length>5?r.createElement(he,null,r.createElement(b.sA,{id:"COMMON_X_MORE",values:{count:e.length-5}})):null:r.createElement(pe,null,r.createElement(Ue,{log:e[0]})),He=({analyzerEventValue:e,analyzerDateTimeFormats:t})=>r.createElement(Y,null,1===e.length?r.createElement(de,{analyzerDateTimeFormats:t,timestamp:e[0].timestamp}):null,r.createElement(Ae,{analyzerEventValue:e,analyzerDateTimeFormats:t}),r.createElement(We,{analyzerEventValue:e}));var be=a(945132);const $e=e=>e===v.sw.ONE_DAY?be.$_/2:8*be.$_,Ve=({clientLogsQueryParams:e,wifiPerformanceDateRange:{startDate:t,endDate:a,preset:l},getCoordinates:i,analyzerDateTimeFormats:s})=>{const c=(0,r.useContext)(u.A),o=(0,n.useSelector)((0,r.useMemo)(()=>(0,F.p)(e),[e])),m=(0,r.useCallback)(e=>{c[A.z.SET_ACTIVE_ROWS](e)},[c]),E=(0,r.useCallback)(()=>{c[A.z.SET_ACTIVE_ROWS]([])},[c]),d=(0,r.useCallback)(e=>r.createElement(He,{analyzerEventValue:e,analyzerDateTimeFormats:s}),[s]),p=(0,r.useCallback)(e=>(0,r.createElement)(Q.Q8[e[0].key],{...Q.n0}),[]);return r.createElement(K.A,{logs:o,range:{startDate:t,endDate:a},getCoordinates:i,getLogsDescription:d,getLogsIcon:p,onMouseEnter:m,onMouseLeave:E,eventGroupingRange:$e(l)})},Ke=(0,d.A)(p.A)`
  width: 100%;
  position: relative;
  padding-right: ${h.xO};
`,Fe=e=>{const t=(0,r.useMemo)(()=>Math.round(.7*Math.round((e||0)/2)),[e]),a=(0,r.useMemo)(()=>t<400,[t]);return{chartHeight:t,isNarrowChart:a}};var Ye=a(638334),Be=a(366702),Ze=a(198494),je=a(602021),Xe=a(282556),Qe=a(195462),qe=a(854398);const Je=({preset:e,documentWidth:t,dayDifference:a,use24HourTime:r,siteTimezone:n,language:l,selfHourCycle:i,formatMessage:s,timestamps:c,startDate:o,endDate:m})=>{return E=c[0]||o.getTime(),A=c.length>1&&c[c.length-1]||m.getTime(),u=0===a?L.l.ONE_DAY:L.j,(0,Qe.v)([E,A],qe.P[e||u].frequency(t,a)).map((a,c)=>({label:qe.P[e||u].label({index:c,value:a,use24HourTime:r,siteTimezone:n,language:l,selfHourCycle:i,documentWidth:t,formatMessage:s}),value:a}));var E,A,u},et=({startDate:e,endDate:t,preset:a})=>{const{formatMessage:l}=(0,b.tz)(),{width:i}=(0,Be.A)(),s=(0,r.useMemo)(()=>(0,Ye.w)(e,t),[e,t]),c=(0,n.useSelector)(Ze.jc),o=(0,n.useSelector)(Ze.BQ),m=(0,n.useSelector)(je.hq),E=(0,n.useSelector)(Xe.zi);return{xAxis:Je({preset:a,documentWidth:i,dayDifference:s,use24HourTime:c,siteTimezone:m,language:E,selfHourCycle:o,formatMessage:l,startDate:e,endDate:t,timestamps:[]}),dayDifference:s}},tt=()=>{const e=(0,n.useSelector)(Ze.BQ),t=(0,n.useSelector)(je.hq),a=(0,n.useSelector)(Xe.zi);return(0,r.useMemo)(()=>({full:new Intl.DateTimeFormat(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t}),short:new Intl.DateTimeFormat(a,{hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t}),tooltip:new Intl.DateTimeFormat(a,{day:"numeric",month:"short",hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t})}),[e,t,a])},at=({isNarrowChart:e,isAnalyzerClientWireless:t,highestPackets:a,highestPoeUsage:l})=>{const i=(0,n.useSelector)(Xe.zi),{yAxis:s,y2Axis:c}=(0,r.useMemo)(()=>{const r=(0,Qe.Y)(t?-100:l?1.1*l:100,e?6:11,!e);return{yAxis:(0,Qe.Y)(t?100:a?1.1*a:100,e?6:11,!e),y2Axis:t?r.reverse():r}},[e,t,a,l]),o=(0,r.useMemo)(()=>Intl.NumberFormat(i,{notation:"compact",maximumFractionDigits:0}),[i]);return{yAxis:t?s:s.map(e=>({...e,label:o.format(+e.value)})),y2Axis:c}},rt=({isAnalyzerClientWireless:e})=>{const{formatMessage:t}=(0,b.tz)(),{yAxisTitle:a,y2AxisTitle:n}=(0,r.useMemo)(()=>({yAxisTitle:e?`${t({id:"COMMON_TX_RETRIES"})} (%)`:t({id:"COMMON_PACKETS"}),y2AxisTitle:t({id:e?"COMMON_UNIT_DBM":"COMMON_UNIT_W"})}),[t,e]);return{yAxisTitle:a,y2AxisTitle:n}},nt=({timestamp:e,dayDifference:t,intervalSeconds:a,txPackets:n,rxPackets:l,poeUsage:i,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o,analyzerDateTimeFormats:{full:m,short:E}})=>r.createElement(p.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:h.YC},r.createElement(p.A,{justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_DATE_TIME"})),r.createElement(H.A,{size:"small",color:"text-2"},m.format(e),t<=7&&a?r.createElement(r.Fragment,null," - ",E.format(e+1e3*a)):null)),s?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_DOWNLOAD_PACKETS"})),r.createElement(H.A,{size:"small",color:"text-2"},Math.round(l).toLocaleString())):null,c?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_UPLOAD_PACKETS"})),r.createElement(H.A,{size:"small",color:"text-2"},Math.round(n).toLocaleString())):null,o?r.createElement(p.A,{alignItems:"center",justifyContent:"space-between"},r.createElement(H.A,{size:"small",color:"text-1"},r.createElement(b.sA,{id:"COMMON_POE_USAGE"})),r.createElement(H.A,{size:"small",color:"text-2"},i.toFixed(1)," ",r.createElement(b.sA,{id:"COMMON_UNIT_W"}))):null),lt=({x:e,left:t,top:a,hidden:n,gradientColor:l,poeUsageTooltipProps:i,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o,analyzerGraphState:m,dayDifference:E,chartHeight:A,chartWidth:u,txPackets:d,rxPackets:p,poeUsage:h,analyzerDateTimeFormats:C,intervalSeconds:y})=>r.createElement(W.A,{width:300,topA:a,leftA:t,topB:i.top,leftB:i.left,chartWidth:u,chartHeight:A,hidden:n,description:r.createElement(nt,{timestamp:e,dayDifference:E,intervalSeconds:y,analyzerGraphDownloadPacketsState:s,analyzerGraphUploadPacketsState:c,analyzerGraphPoeUsageState:o,txPackets:d,rxPackets:p,poeUsage:h,analyzerDateTimeFormats:C}),innerColor:l,tooltipRenderCondition:![s,c].every(Boolean)||m===S.DOWNLOAD_PACKETS});var it=a(254476);const st=({isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:i,analyzerGraphWiredEventsState:s,analyzerGraphDownloadPacketsState:c,analyzerGraphUploadPacketsState:o,analyzerGraphPoeUsageState:m,clientLogsQueryParams:E,analyzerClientMac:A,analyzerContainerHeight:u})=>{const d=(0,n.useDispatch)(),p=(0,r.useRef)(null),h=(0,r.useRef)({left:0,top:0}),C=(0,r.useRef)({left:0,top:0}),{ref:y,width:N=0}=(0,l.A)(),g=[t,a,i].every(e=>!e),D=(0,n.useSelector)(z.Bl),{startDate:P,endDate:f,preset:I}=D,G=(0,r.useMemo)(()=>w[I],[I]),L=(0,r.useMemo)(()=>[A,P.getTime(),G,_.qv.USER],[A,P,G]),v=(0,n.useSelector)((0,r.useMemo)(()=>(0,T.aO)(...L),[L])),R=(0,n.useSelector)((0,r.useMemo)(()=>(0,it.hZ)(A),[A])),W=(0,r.useMemo)(()=>[R.mac,P.getTime(),R.port_idx,G],[R.mac,R.port_idx,P,G]),H=(0,n.useSelector)((0,r.useMemo)(()=>e?x.A:(0,T.A3)(...W),[e,W])),b=(0,r.useMemo)(()=>{const e={},t=v.length;for(let a=0;a<t;a+=1){const{time:t}=v[a];e[t]=H.find(e=>e.time===t)?.[`port_${R.port_idx}-poe_power`]||0}return e},[v,H,R.port_idx]),$=(0,r.useMemo)(()=>U[G],[G]),K=(0,r.useMemo)(()=>v.flatMap((e,t,a)=>{const r=a[t-1],n=r?Math.round((e.time-r.time)/$):null,l=b[e.time];return n>1?Array.from(Array(n).keys()).map(t=>({...e,signal:0,tx_retries:0,wifi_tx_attempts:0,wifi_tx_dropped:0,tx_packets:0,rx_packets:0,poe_usage:l,time:r.time+(t+1)*$})):[{...e,poe_usage:l}]}),[v,$,b]),{highestPackets:F,highestPoeUsage:Y}=(0,r.useMemo)(()=>{let e=0,t=0,a=0;for(let r=0;r<K.length;r+=1){const{tx_packets:n=0,rx_packets:l=0,poe_usage:i=0}=K[r];l>e&&(e=l),n>t&&(t=n),i>a&&(a=i)}return{highestPackets:Math.max(0,c?e:0,o?t:0),highestPoeUsage:Math.max(0,m?a:0)}},[K,o,c,m]),B=(0,r.useMemo)(()=>$/1e3,[$]),{chartHeight:Z,isNarrowChart:j}=Fe(u),{xAxis:X,dayDifference:Q}=et({startDate:P,endDate:f,preset:I}),{yAxis:q,y2Axis:J}=at({isNarrowChart:j,isAnalyzerClientWireless:e,highestPackets:F,highestPoeUsage:Y}),{y2AxisTitle:ee}=rt({isAnalyzerClientWireless:e}),te=tt(),ae=(0,r.useCallback)(({hidden:e,left:n=0,top:l=0,x:i,custom:s},c,o)=>(t&&a&&c===S.SIGNAL&&(h.current={left:n,top:l}),r.createElement(V,{hidden:e,left:n,top:l,signalTooltipProps:h.current,x:i,customTooltipProps:s,chartHeight:Z,chartWidth:N,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphState:c,gradientColor:o,dayDifference:Q,txRetries:s?.txRetries,signalStrength:s?.signalStrength,analyzerDateTimeFormats:te,intervalSeconds:B})),[te,Z,N,t,a,h,Q,B]),re=(0,r.useCallback)(({hidden:e,left:t=0,top:a=0,x:n,custom:l},i,s)=>(c&&o&&i===S.DOWNLOAD_PACKETS&&(C.current={left:t,top:a}),r.createElement(lt,{hidden:e,left:t,top:a,poeUsageTooltipProps:C.current,x:n,customTooltipProps:l,chartHeight:Z,chartWidth:N,analyzerGraphDownloadPacketsState:c,analyzerGraphUploadPacketsState:o,analyzerGraphPoeUsageState:m,analyzerGraphState:i,gradientColor:s,dayDifference:Q,txPackets:l?.txPackets,rxPackets:l?.rxPackets,poeUsage:l?.poeUsage,analyzerDateTimeFormats:te,intervalSeconds:B})),[te,Z,N,c,o,m,Q,B]),ne=(0,r.useCallback)((e,n,l,i,s,c)=>r.createElement(r.Fragment,null,t||g?r.createElement(k,{userReport:K,getCoordinates:e,mouseData:n,maxY:l,yAxisMax:i,yAxisMin:s,y2AxisMax:i,y2AxisMin:s,chartHovered:c,tooltipContainer:p,analyzerGraphState:S.RETRIES,renderTooltip:ae}):null,a||g?r.createElement(k,{userReport:K,getCoordinates:e,mouseData:n,maxY:l,yAxisMax:i,yAxisMin:s,y2AxisMax:i,y2AxisMin:s,chartHovered:c,tooltipContainer:p,analyzerGraphState:S.SIGNAL,renderTooltip:ae}):null),[K,t,a,ae,g]),le=(0,r.useCallback)((e,t,a,n,l,i)=>r.createElement(r.Fragment,null,c?r.createElement(k,{userReport:K,getCoordinates:e,mouseData:t,maxY:a,yAxisMax:n,yAxisMin:l,y2AxisMax:n,y2AxisMin:l,chartHovered:i,tooltipContainer:p,analyzerGraphState:S.DOWNLOAD_PACKETS,renderTooltip:re}):null,o?r.createElement(k,{userReport:K,getCoordinates:e,mouseData:t,maxY:a,yAxisMax:n,yAxisMin:l,y2AxisMax:n,y2AxisMin:l,chartHovered:i,tooltipContainer:p,analyzerGraphState:S.UPLOAD_PACKETS,renderTooltip:re}):null,m?r.createElement(k,{userReport:K,getCoordinates:e,mouseData:t,maxY:a,yAxisMax:n,yAxisMin:l,y2AxisMax:n,y2AxisMin:l,chartHovered:i,tooltipContainer:p,analyzerGraphState:S.POE_USAGE,renderTooltip:re}):null),[K,o,c,m,re]),ie=(0,r.useCallback)(t=>e&&(i||g)||!e&&s?r.createElement(Ve,{clientLogsQueryParams:E,wifiPerformanceDateRange:D,getCoordinates:t,analyzerDateTimeFormats:te}):null,[e,g,E,D,i,s,te]),se=(0,r.useCallback)((t,a,n,l,i,s,c,o,m,E)=>r.createElement(r.Fragment,null,e?ne(t,a,n,s,c,E):le(t,a,n,s,c,E),ie(t)),[e,ne,le,ie]);return(0,r.useEffect)(()=>{d((0,M.EG)(...L))},[d,L,e]),(0,r.useEffect)(()=>{e||d((0,M.Kz)(...W))},[d,W,e]),r.createElement(Ke,{ref:y},r.createElement(O.A,{key:L.join(),xAxis:X,yAxis:q,y2Axis:J,width:N,height:Z,y2AxisTitle:ee,margin:[20,48,20,24]},se),r.createElement("div",{ref:p}))},ct=(0,d.A)(p.A)`
  flex-direction: column;
`,ot=(0,d.A)(p.A)`
  align-items: center;
  width: 100%;
  gap: ${h.kc};
  height: 32px;
`;(0,d.A)(p.A)`
  gap: ${h.kc};
`,(0,d.A)(p.A)`
  align-items: center;
  gap: ${h.kc};
  border-radius: ${I.Ay["desktop-radius-base"]};
  background: ${({theme:{themeName:e}})=>I.Ay[`desktop-color-neutral-01-${e}`]};
  padding: ${h.YC} ${h.kc};
  cursor: pointer;
  > label {
    > div:first-child {
      margin-right: 0;
    }
  }
`,(0,d.A)(p.A)`
  gap: 2px;
`,(0,d.A)(p.A,{shouldForwardProp:e=>"legend"!==e&&"dotted"!==e})`
  width: ${({dotted:e})=>e?"3px":"8px"};
  height: 3px;
  background-color: ${({legend:e,theme:{themeName:t}})=>I.Ay[`desktop-color-${e}-${t}`]};
`;var mt,Et=a(170121);!function(e){e.ID="id",e.LABEL="label",e.LEGEND="legend",e.CHECKED="checked",e.DASHED="dashed"}(mt||(mt={}));const At=(0,d.A)(p.A)`
  gap: ${h.kc};
  align-items: center;
`,ut=(0,d.A)(p.A)`
  align-items: center;
  gap: ${h.kc};
  border-radius: ${I.Ay["desktop-radius-base"]};
  background: ${({theme:{themeName:e}})=>I.Ay[`desktop-color-neutral-01-${e}`]};
  padding: ${h.YC} ${h.kc};
  cursor: pointer;
  > label {
    > div:first-child {
      margin-right: 0;
    }
  }
`,dt=(0,d.A)(p.A)`
  gap: 2px;
`,pt=(0,d.A)(p.A,{shouldForwardProp:e=>"legend"!==e&&"dashed"!==e})`
  width: ${({dashed:e})=>e?"3px":"8px"};
  height: 3px;
  background-color: ${({legend:e,theme:{themeName:t}})=>I.Ay[`desktop-color-${e}-${t}`]};
`,ht=({id:e,label:t,legend:a,dashed:n})=>r.createElement(ut,{key:e},r.createElement(dt,null,r.createElement(pt,{legend:a,dashed:n}),n?r.createElement(pt,{legend:a,dashed:n}):null),r.createElement(H.A,{size:"medium",color:"text-2"},r.createElement(b.sA,{id:t}))),Ct=({isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:n,analyzerGraphWiredEventsState:l,analyzerGraphDownloadPacketsState:i,analyzerGraphUploadPacketsState:s,analyzerGraphPoeUsageState:c})=>{const o=(0,r.useMemo)(()=>[{[mt.ID]:S.RETRIES,[mt.LABEL]:"COMMON_TX_RETRIES",[mt.LEGEND]:G[S.RETRIES],[mt.CHECKED]:t,[mt.DASHED]:g[S.RETRIES]},{[mt.ID]:S.SIGNAL,[mt.LABEL]:"COMMON_SIGNAL_STRENGTH",[mt.LEGEND]:G[S.SIGNAL],[mt.CHECKED]:a,[mt.DASHED]:g[S.SIGNAL]},{[mt.ID]:S.EVENTS,[mt.LABEL]:"COMMON_EVENTS",[mt.LEGEND]:G[S.EVENTS],[mt.CHECKED]:n,[mt.DASHED]:g[S.EVENTS]}],[t,a,n]),m=(0,r.useMemo)(()=>[{[mt.ID]:S.DOWNLOAD_PACKETS,[mt.LABEL]:"COMMON_DOWNLOAD_PACKETS",[mt.LEGEND]:G[S.DOWNLOAD_PACKETS],[mt.CHECKED]:i,[mt.DASHED]:g[S.DOWNLOAD_PACKETS]},{[mt.ID]:S.UPLOAD_PACKETS,[mt.LABEL]:"COMMON_UPLOAD_PACKETS",[mt.LEGEND]:G[S.UPLOAD_PACKETS],[mt.CHECKED]:s,[mt.DASHED]:g[S.UPLOAD_PACKETS]},{[mt.ID]:S.POE_USAGE,[mt.LABEL]:"COMMON_POE_USAGE",[mt.LEGEND]:G[S.POE_USAGE],[mt.CHECKED]:c,[mt.DASHED]:g[S.POE_USAGE]},{[mt.ID]:S.EVENTS,[mt.LABEL]:"COMMON_EVENTS",[mt.LEGEND]:G[S.EVENTS],[mt.CHECKED]:l,[mt.DASHED]:g[S.EVENTS]}],[s,i,l,c]);return r.createElement(At,null,r.createElement(Et.A,{variant:"medium"},r.createElement(b.sA,{id:"COMMON_STATS"})),(e?o:m).map(ht))},St=({isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:n,analyzerGraphWiredEventsState:l,analyzerGraphDownloadPacketsState:i,analyzerGraphUploadPacketsState:s,analyzerGraphPoeUsageState:c})=>r.createElement(ot,null,r.createElement(Ct,{isAnalyzerClientWireless:e,analyzerGraphRetriesState:t,analyzerGraphSignalState:a,analyzerGraphWirelessEventsState:n,analyzerGraphWiredEventsState:l,analyzerGraphDownloadPacketsState:i,analyzerGraphUploadPacketsState:s,analyzerGraphPoeUsageState:c})),yt=(0,r.memo)(({analyzerClientMac:e,isAnalyzerClientWireless:t,clientLogsQueryParams:a,analyzerContainerHeight:l})=>{const i=(0,n.useSelector)(y.OP),s=(0,n.useSelector)(y.SX),c=(0,n.useSelector)(y.x2),o=(0,n.useSelector)(y.CB),m=(0,n.useSelector)(y.XX),E=(0,n.useSelector)(y.ou),A=(0,n.useSelector)(y.xj);return r.createElement(ct,null,r.createElement(St,{isAnalyzerClientWireless:t,analyzerGraphRetriesState:i,analyzerGraphSignalState:s,analyzerGraphWirelessEventsState:c,analyzerGraphWiredEventsState:o,analyzerGraphDownloadPacketsState:m,analyzerGraphUploadPacketsState:E,analyzerGraphPoeUsageState:A}),r.createElement(st,{isAnalyzerClientWireless:t,analyzerGraphRetriesState:i,analyzerGraphSignalState:s,analyzerGraphWirelessEventsState:c,analyzerGraphWiredEventsState:o,analyzerGraphDownloadPacketsState:m,analyzerGraphUploadPacketsState:E,analyzerGraphPoeUsageState:A,clientLogsQueryParams:a,analyzerClientMac:e,analyzerContainerHeight:l}))});var Nt,gt=a(666638),Dt=a(82226),Ot=a(481413);!function(e){e.DESCRIPTION="description",e.DATE="date"}(Nt||(Nt={}));var Mt=a(362156);const _t=({timestamp:e})=>r.createElement(Mt.A,{timestamp:e});var Tt=a(690033);const xt=e=>r.createElement(Tt.A.Actionable,{log:e}),zt={[Nt.DESCRIPTION]:xt,[Nt.DATE]:_t},Pt={[Nt.DESCRIPTION]:{size:700,minSize:700,maxSize:1/0},[Nt.DATE]:{size:80,minSize:80,maxSize:1/0}},ft={[Nt.DESCRIPTION]:"COMMON_DESCRIPTION",[Nt.DATE]:"COMMON_DATE_TIME"},It=e=>e,Gt=({header:{id:e}})=>r.createElement(b.sA,{id:ft[e]}),kt=e=>Pt[e],Lt=({column:{id:e},getValue:t})=>zt[e](t()),vt=Object.values(Nt).map(e=>({id:e,accessorFn:It,header:Gt,cell:Lt,...kt(e),enableResizing:!1,enableSorting:!1}));var Rt=a(596441);const wt="ANALYZER_LOG_TABLE_WRAPPER_CLASSNAME",Ut="ANALYZER_LOG_TABLE_HEADER_CLASSNAME",Wt="ANALYZER_LOG_TABLE_ROW_CLASSNAME",Ht=(0,d.A)(p.A)`
  width: 100%;
  height: 100%;
  overflow: auto;
  .${wt} {
    width: 100%;
  }
  .${Ut} {
    height: ${Rt.I.HEADER_HEIGHT}px;
    > tr {
      > th {
        padding-left: ${h.kc};
      }
    }
  }
  .${Wt} {
    > td {
      padding-left: ${h.kc};
      > div {
        white-space: pre-line;
      }
    }
  }
`,bt=()=>r.createElement(H.A,{size:"medium",color:"text-2"},r.createElement(b.sA,{id:"ANALYZER_NO_LOGS"})),$t=({clientLogsQueryParams:e})=>{const t=(0,n.useDispatch)(),a=(0,r.useRef)(null),l=(0,r.useContext)(u.A),{startDate:m,endDate:E}=(0,n.useSelector)(z.Bl),d=(0,n.useSelector)((0,r.useMemo)(()=>(0,F.p)(e),[e])),p=(0,r.useMemo)(()=>{const e=m.getTime(),t=E.getTime();return d.filter(({timestamp:a})=>(0,Ot.O)(a,e,t))},[d,m,E]);return(0,r.useEffect)(()=>{t((0,Dt.p)({crudCacheStrategy:{type:o.e.CACHE}},{queryParams:e}))},[e,t]),(0,i.A)([(0,s.Zi)(c.B.SYSTEM_LOG),(0,s.Zi)(c.B.LOG_MESSAGES),(0,s.Zi)(c.B.SYSTEM_LOG_ACTION),(0,s.Zi)(c.B.LOG_SECTION)],p.length?r.createElement(Ht,{ref:a},r.createElement(gt.A,{data:p,columns:vt,wrapperClassName:wt,parentRef:a,rowStyle:h.gc,headerClassName:Ut,rowClassName:Wt,renderPlaceholder:bt,virtualize:p.length>50,activeRows:l[A.z.ACTIVE_ROWS]})):null)},Vt=(0,r.memo)(({clientLogsQueryParams:e})=>r.createElement($t,{clientLogsQueryParams:e})),Kt=(0,r.memo)(()=>{const e=(0,n.useDispatch)(),{ref:t,height:a}=(0,l.A)(),[d,p]=(0,r.useState)([]),h=(0,n.useSelector)(y.rI),S=(0,n.useSelector)((0,r.useMemo)(()=>(0,it.e8)(h),[h])),g=(0,r.useMemo)(()=>({mac:h,...N}),[h]),D=(0,r.useMemo)(()=>({[A.z.ACTIVE_ROWS]:d,[A.z.SET_ACTIVE_ROWS]:p}),[d]);return(0,r.useEffect)(()=>{e((0,m.Ic)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})),e((0,E.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}))},[e]),(0,i.A)([(0,s.Zi)(c.B.ANALYZER),(0,m.$3)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})],r.createElement(C,{ref:t},r.createElement(u.A.Provider,{value:D},r.createElement(yt,{analyzerClientMac:h,isAnalyzerClientWireless:S,clientLogsQueryParams:g,analyzerContainerHeight:a}),r.createElement(Vt,{clientLogsQueryParams:g}))))})}}]);