(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[25220],{146750(e,t,n){var a=n(199554);e.exports=function(e){var t=a(e);return t.setMinutes(0,0,0),t}},535322(e,t,n){"use strict";n.d(t,{A:()=>h,I:()=>a});var a,r=n(274934),i=n(814557),o=n(158885),s=n(247816),l=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const u=(0,s.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.Ln};
  ${({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}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,g=(0,s.A)(o.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.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||i.Ay[t===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:i,flex:o,width:s,nested:l,...d})=>"items"in d?(0,r.jsx)(g,{marginBottom:t,margin:n,padding:i,flex:o,nested:l,...d}):(0,r.jsx)(u,{nested:l,width:s,marginBottom:t,margin:n,padding:i,flex:o,isButtonList:e===a.BUTTON_LIST,...d,children:d.children})},325220(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>q});var a=n(274934),r=n(977872),i=n(602086),o=n(383061),s=n(241365),l=n(293668),d=n(345272),c=n(309130),m=n(376892),u=n(100978),g=n(535322),h=n(470070),p=n(532565),x=n(416233),A=n(412160),f=n(113592),b=n(320018),E=n(752572),I=n(396489),T=n.n(I),M=n(506411),N=n.n(M),S=n(146750),L=n.n(S),$=n(402868),y=n.n($),R=n(601334),_=n.n(R),O=n(89498),j=n(991331),C=n(938984),U=n(357159),k=n(247816),v=n(263705),D=n(409844),B=n(528116),Y=n(927027),w=n(358248),H=n(570801),K=n(291508);const P=(0,k.A)(C.A,(0,K.A)("legendcolor"))`
  display: block;
  position: relative;
  padding-left: 20px;
  margin-left: 15px;

  ::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1px;
    width: 12px;
    border-bottom: 1px ${({legendcolor:e})=>`solid ${e}`};
  }

  :last-of-type {
    margin-right: 0;
  }
`,F=(0,E.A)(6,e=>({value:e,label:String(e)})).reverse(),V=({motifPalette:{text02:e}})=>D.AH`
  fill: ${e};
  font-size: 11px;
`,G=(0,v.b)((0,i.memo)(({mac:e,keys:t,heading:n,theme:o,colors:s,noLegend:l=!1,fetchReport:d,legend:c,reportType:m=p.qv.UBB})=>{const g=(0,r.d4)((0,i.useMemo)(()=>(0,w.dF)(e,d,m,t),[e,d,m,t])),x=(0,r.d4)(H.jc),{xAxis:A,startDate:f}=(0,i.useMemo)(()=>(e=>({xAxis:e,startDate:e[0].value}))(((e,t,n=6)=>new Array(n+1).fill(0).map((a,r)=>{return i=N()(e,24/n*(n-r)),{label:y()(i,t),value:i.getTime()};var i}))(L()(_()(Date.now(),1)).getTime(),x?"H:ss":"ha")),[x]),b=(0,i.useMemo)(()=>{const e={},n=(0,O.Hf)(g.filter(e=>e.time>f).map(e=>({...e,x:e.time})),B.UE.MINUTES.grain);return n[0]&&t[0]in n[0]&&n.forEach(n=>{t.forEach((t,a)=>{e[t]||(e[t]={key:t,lineColor:s[a],maxY:0,data:[]}),e[t].data.push({x:n.x,y:n[t]})})}),e},[s,g,t,f]),E=(0,i.useMemo)(()=>{return(e=Math.max(...t.flatMap(e=>b[e]?b[e].data.map(e=>e.y||0):0),4))>5?(0,Y.Y)(e,6):F;var e},[b,t]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u.A,{justifyContent:"space-between",marginBottom:20,children:[(0,a.jsx)(C.A,{size:"medium",weight:"bold",color:"text-1",children:(0,a.jsx)(h.sA,{id:n})}),l?null:(0,a.jsx)(u.A,{justifyContent:"flex-end",children:(0,a.jsx)(u.A,{children:c.map((e,t)=>(0,a.jsx)(P,{size:"medium",legendcolor:s[t],children:(0,a.jsx)(h.sA,{id:e})},e))})})]}),(0,a.jsx)(u.A,{children:(0,a.jsx)(U.A,{xAxis:A,yAxis:E,width:336,height:150,margin:[0,0,20,35],labelClassName:V(o),children:(e,n,r)=>(0,a.jsx)(a.Fragment,{children:t.map(t=>b[t]&&b[t].data.length?(0,a.jsx)(j.A,{data:b[t].data,maxY:r,mouseData:n,getCoordinates:e,variant:"gradientArea",lineColor:b[t].lineColor,dashed:!1,hideMissingData:!0},b[t].key):null)})})})]})},(e,t)=>e.mac===t.mac&&T()(e.keys,t.keys))),q=({activeItem:{mac:e,peer_ubb:t={},radio_table:n=[],model:E}})=>{const{formatMessage:I}=(0,h.tz)(),T=(0,r.wA)(),M=(0,i.useMemo)(()=>(n||[]).map(({name:e,radio:t})=>({id:e,label:`${I({id:(0,l.dI)(t)})}`})),[n,I]),N=(0,i.useMemo)(()=>[{id:e,label:(0,a.jsx)(h.sA,{id:"COMMON_AP"})},{id:t.mac,label:(0,a.jsx)(h.sA,{id:"DEVICE_TYPE_UBB_STATION"})}],[e,t.mac]),[S,L]=(0,i.useState)(e),[$,y]=(0,i.useState)(n?.[0]?.name||d._),{droppedStatKeys:R,retriesStatKeys:_}=(0,i.useMemo)(()=>({retriesStatKeys:[`${$}-tx_retries`],droppedStatKeys:[`${$}-rx_dropped`,`${$}-tx_dropped`]}),[$]);(0,i.useEffect)(()=>{T((0,x.aN)(S,p.qv.UBB))},[T,S]),(0,i.useEffect)(()=>{T((0,x.jU)(S,p.qv.UBB,R)),T((0,x.lV)(S,p.qv.UBB,_))},[T,R,_,S]);const O=(0,i.useCallback)(({id:e})=>{L(e)},[L]),j=(0,i.useCallback)(({id:e})=>{y(e)},[y]),C=(0,i.useMemo)(()=>[{id:"statistics",openByDefault:!0,label:(0,a.jsx)(m.A,{children:(0,a.jsx)(h.sA,{id:"DEVICE_PROPERTY_SYSTEM_STATISTICS"})}),renderContent:()=>(0,a.jsxs)(u.A,{flexDirection:"column",gap:c.Ln,children:[(0,a.jsx)(u.A,{width:"fit-content",children:(0,a.jsx)(o.A,{variant:"filter",tabs:N,onSelectTab:O})}),(0,a.jsx)(G,{mac:S,keys:["cpu","mem"],colors:[s.Ay["orange-1"],s.Ay["blue-3"]],heading:"DEVICE_PROPERTIES_LABEL_USAGE_PERCENT",fetchReport:x.aN,legend:["COMMON_CPU","COMMON_MEMORY"]}),(0,a.jsx)(u.A,{width:"fit-content",children:(0,a.jsx)(o.A,{variant:"filter",tabs:M,onSelectTab:j})}),(0,a.jsx)(G,{mac:S,keys:R,colors:[s.Ay["purple-1"],s.Ay["purple-1"]],noLegend:!0,fetchReport:x.jU,heading:"DEVICE_PROPERTIES_LABEL_DROPPED"}),(0,a.jsx)(G,{mac:S,keys:_,colors:[s.Ay["purple-1"]],noLegend:!0,fetchReport:x.lV,heading:"DEVICE_PROPERTIES_LABEL_RETRIES"})]})}],[M,R,_,S,N,O,j]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.A,{mac:e,model:E,logType:f.F.DEVICE,label:"COMMON_HISTORY",ignoreActionableValues:[A.dl.DEVICE],hideClientTabs:!0}),(0,a.jsx)(g.A,{type:g.I.ACCORDION,items:C})]})}},927027(e,t,n){"use strict";n.d(t,{Y:()=>r,v:()=>i});var a=n(752572);const r=(e,t,n=!1)=>{const r=t-1;let i=Math.ceil(e);if(Number.isNaN(i))return[];const o=i%r;return 0!==o&&(i+=r-o),(0,a.A)(t,e=>{return{value:t=e?Math.ceil(e*(i/r)):0,label:n?e%2==0&&String(t)||null:String(t)};var t}).reverse()},i=(e,t)=>{const[n]=e,a=[n],r=e.length-1;for(let n=1;n<t-1;n+=1){const i=n*r/(t-1),o=Math.floor(i).toFixed();a[n]=Math.round(e[o]+(e[Math.ceil(i).toFixed()]-e[o])*(+i-+o))}return a[t-1]=e[r],a}},528116(e,t,n){"use strict";n.d(t,{$V:()=>s,UE:()=>o,Vi:()=>l});var a=n(368741),r=n.n(a),i=n(232087);const o={NONE:{url:null,grain:null,grainInSeconds:null,translationKey:null},MINUTES:{url:i.FE.MINUTES,grain:3e5,grainInSeconds:300,translationKey:"GRANULARITY_5_MINUTES"},HOURLY:{url:i.FE.HOURLY,grain:36e5,grainInSeconds:3600,translationKey:"GRANULARITY_HOURLY"},DAILY:{url:i.FE.DAILY,grain:864e5,grainInSeconds:86400,translationKey:"GRANULARITY_DAILY"},MONTHLY:{url:i.FE.MONTHLY,grain:2592e6,grainInSeconds:2592e3,translationKey:"GRANULARITY_MONTHLY"}},s=(e,t,n,a)=>{const i=r()(t,e);return n&&(i<1||a&&i<=1)?o.MINUTES:i<=7?o.HOURLY:i<120?o.DAILY:o.MONTHLY},l=(e,t)=>{switch(e){case i.FE.DAILY:return`1${t({id:"COMMON_UNIT_D"})}`;case i.FE.HOURLY:return`1${t({id:"COMMON_UNIT_H"})}`;case i.FE.MINUTES:return`5${t({id:"COMMON_UNIT_MIN"})}`;default:return""}}}}]);