(window.webpackJsonpunifiNetworkUi=window.webpackJsonpunifiNetworkUi||[]).push([[20],{2780:function(e,t,a){"use strict";a.r(t);var i,r=a(0),n=a.n(r),l=a(4),c=a(434),o=a(1571),d=a(960);!function(e){e.WIFI_3="WIFI_3",e.WIFI_4="WIFI_4",e.WIFI_5="WIFI_5",e.WIFI_6="WIFI_6"}(i||(i={}));var m=a(9),s=a(27),b=a(8),u=a(54),O=a(120),p=a(1573);let E=null;const h=Object(u.b)((e,t)=>e.model.lastFetchTime===t.model.lastFetchTime&&e.queryParams.start===t.queryParams.start&&e.queryParams.end===t.queryParams.end&&e.queryParams.apMac===t.queryParams.apMac)(Object(m.a)(e=>{return i=Object(c.f)(e),r=Object(c.c)(e),t={start:i.startDate.getTime(),end:i.endDate.getTime(),apMac:r},{model:(a=Object(b.w)(d.b,e.models,{queryParams:t},{idField:d.a}),!a.isLoading&&a.lastFetchTime?(E=Object.assign({},t),a):Object(b.w)(d.b,e.models,{queryParams:E},{idField:d.a})),queryParams:t};var t,a,i,r},e=>e),e=>e),I=Object(m.a)(h,({model:e})=>Object(s.c)(e)[0]),_=Object(m.a)(I,e=>{var t;return(null===(t=null==e?void 0:e.clients_over_standard)||void 0===t?void 0:t.aggregation)||[]}),g=Object(m.a)(_,Object(p.a)(O.d.WIFI_STANDARD),(e,t)=>e.filter(({standard:e})=>null==t?void 0:t.includes(e)));var C=a(256),v=a(5),j=a(22),T=a(1),N=a(474),f=a(55),S=a(47),w=a(1037),y=a(3),M=a(82),x=a(217);const P=Object(y.c)(N.a,{shouldForwardProp:e=>"color"!==e})`
  background-color: ${({color:e})=>e};
  margin-right: 8px;
`,W=Object(y.c)(v.a)`
  border: 1px solid ${({theme:e})=>e.motifPalette.neutral03};
`,R={[i.WIFI_3]:"#39CC64",[i.WIFI_4]:"#46C7FD",[i.WIFI_5]:"#A252E3",[i.WIFI_6]:"#006FFF"},A=[{count:0,standard:i.WIFI_3},{count:0,standard:i.WIFI_4},{count:0,standard:i.WIFI_5},{count:0,standard:i.WIFI_6}];var F=()=>{const e=Object(l.useSelector)(g),{motif:t}=Object(f.a)(),a=Object(r.useMemo)(()=>{return((t=e.reduce((e,{count:t})=>e+t,0))?e.filter(({count:e})=>Boolean(e)):A).map(({standard:e,count:a})=>({count:a,value:a/t*100,color:R[e],legend:n.a.createElement(v.a,{key:`${e}_${a}`,alignItems:"center",marginRight:16},n.a.createElement(P,{color:R[e]}),n.a.createElement(M.b,{styleNumber:1},e.toLowerCase().replace("wifi_","WiFi ")))}));var t},[e]);return n.a.createElement(W,{width:"100%",flexDirection:"column",boxSizing:"border-box",borderRadius:12,padding:"16px",marginBottom:16},n.a.createElement(S.a,{size:"body",weight:"bold",color:"secondary"},n.a.createElement(T.b,{id:"COMMON_STANDARD"})),n.a.createElement(w.a,{style:{margin:"10px 0",borderRadius:"4px",height:"8px",backgroundColor:(t===x.a.LIGHT)+" ? '#d6d9e2' : #333543"},items:Object(r.useMemo)(()=>a.map(({value:e,color:t,count:a})=>({value:e,color:t,count:a})),[a]),itemTooltip:Object(r.useCallback)(({count:e})=>({topMargin:4,tooltipProps:{position:"top"},message:n.a.createElement(v.a,{justifyContent:"space-between"},n.a.createElement(S.a,{size:"caption",color:"secondary"},n.a.createElement(T.b,{id:"COMMON_CLIENTS"})),n.a.createElement(S.a,{size:"caption",color:"secondary"},e)),width:165}),[])}),n.a.createElement(v.a,{flexDirection:"row-reverse",justifyContent:"flex-end"},Object(r.useMemo)(()=>a.map(({legend:e})=>e),[a])))},D=a(1670),L=a(173),H=a(25),k=a(10),X=a(1208),$=a(910),V=a(227),q=a(31),U=a(1195),B=a(123),Y=a(341),z=a(92),G=a(107),J=a(76),K=a(34),Q=a(253),Z=a(2853),ee=a(109),te=a(904),ae=a(787),ie=a(49),re=a(985),ne=a(132),le=a(218),ce=a(1656),oe=a(108),de=a(46),me=a(42),se=a(1141);const be=Object(y.c)(v.a)`
  > div > div {
    margin-left: unset;
    max-width: unset;
  }
`,ue=[{id:se.b.CLIENT,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.CLIENT]})),minWidth:140,renderCell:({client:e})=>n.a.createElement(v.a,{alignItems:"center",overflow:"hidden"},n.a.createElement(v.a,{height:25,minWidth:25,maxWidth:25,justifyContent:"center",alignItems:"center",marginRight:12},n.a.createElement(le.a,{client:e})),n.a.createElement(M.b,{styleNumber:18,truncate:!0},(null==e?void 0:e.name)||n.a.createElement(T.b,{id:"COMMON_HYPHEN"}))),compare:Object(me.b)(({client:e})=>(null==e?void 0:e.name)||"-")},{id:se.b.AP_CONNECTED,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.AP_CONNECTED]})),minWidth:140,renderCell:({apConnected:e})=>n.a.createElement(v.a,{alignItems:"center",overflow:"hidden"},n.a.createElement(v.a,{alignItems:"center",justifyContent:"center",minWidth:25,minHeight:25,marginRight:12},n.a.createElement(oe.a,{width:25,height:25,deviceModel:null==e?void 0:e.model,deviceType:null==e?void 0:e.type,filesMap:"GRID"})),n.a.createElement(M.b,{styleNumber:18,truncate:!0},(null==e?void 0:e.name)||Object(de.e)(null==e?void 0:e.model)||n.a.createElement(T.b,{id:"COMMON_HYPHEN"}))),compare:Object(me.b)(({apConnected:e})=>(null==e?void 0:e.name)||Object(de.e)(null==e?void 0:e.model)||"-")},{id:se.b.STANDARD,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.STANDARD]})),minWidth:140,renderCell:({standard:e})=>{var t;return n.a.createElement(M.b,{styleNumber:18,truncate:!0},(null===(t=null==e?void 0:e.toLowerCase())||void 0===t?void 0:t.replace("wifi_","WiFi "))||n.a.createElement(T.b,{id:"COMMON_HYPHEN"}))},comapre:Object(me.b)(({standard:e})=>e)},{id:se.b.EXPERIENCE,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.EXPERIENCE]})),minWidth:140,renderCell:({satisfaction_avg:e})=>n.a.createElement(M.b,{styleNumber:18,colorOverride:re.a.getGradientColor(e/100)},e,"%"),compare:Object(me.b)(({satisfaction_avg:e})=>e)},{id:se.b.SIGNAL,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.SIGNAL]})),minWidth:140,renderCell:({signal_avg:e})=>e?n.a.createElement(v.a,{alignItems:"center"},n.a.createElement(be,{width:24,marginRight:12},n.a.createElement(ce.a,{signal:e})),n.a.createElement(M.b,{styleNumber:18},e," ",n.a.createElement(T.b,{id:"COMMON_UNIT_DBM"}))):n.a.createElement(M.b,{styleNumber:18},n.a.createElement(T.b,{id:"COMMON_HYPHEN"})),compare:Object(me.b)(({signal_avg:e})=>e)},{id:se.b.MIMO,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.MIMO]})),minWidth:140,renderCell:({mimo:e})=>n.a.createElement(M.b,{styleNumber:18,truncate:!0},e?`${e.slice(-1)}x${e.slice(-1)}`:n.a.createElement(T.b,{id:"COMMON_HYPHEN"})),compare:Object(me.b)(({mimo:e})=>e?e.slice(-1):"")},{id:se.b.RX_RATE,sortable:!0,minWidth:140,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.RX_RATE]})),renderCell:({rx_rate_avg:e=0})=>n.a.createElement(M.b,{styleNumber:18,truncate:!0},Object(ne.c)(e,"bitrate","SI",2)),compare:Object(me.b)(({rx_rate_avg:e=0})=>e)},{id:se.b.TX_RETRIES_DROPS,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.TX_RETRIES_DROPS]})),minWidth:180,renderCell:({tx_retries_percentage:e,tx_dropped_percentage:t})=>n.a.createElement(M.b,{styleNumber:18},e>=0?e+"%":n.a.createElement(T.b,{id:"COMMON_HYPHEN"})," / ",t>=0?t+"%":n.a.createElement(T.b,{id:"COMMON_HYPHEN"})),compare:Object(me.b)(({tx_retries_percentage:e,tx_dropped_percentage:t})=>Math.round((e+t)/2))},{id:se.b.ROAMING,sortable:!0,label:n.a.createElement(M.b,{styleNumber:34,colorOverride:"inherit",whiteSpace:"nowrap"},n.a.createElement(T.b,{id:se.c[se.b.ROAMING]})),minWidth:140,renderCell:({roams_count:e=0})=>n.a.createElement(M.b,{styleNumber:18},e),compare:Object(me.b)(({roams_count:e=0})=>e)}],Oe=Object(y.c)(v.a)`
  border: 1px solid ${({theme:{motifPalette:e}})=>e.neutral03};
`,pe=Object(y.c)(v.a)`
  border-bottom: 1px solid ${({theme:{motifPalette:e}})=>e.neutral03};
  @media ${K.a.VIEWPORT_XXXXL} {
    min-height: 56px;
  }
`;var Ee=({title:e,action:t,children:a,flexProps:i={}})=>n.a.createElement(Oe,Object.assign({width:"100%",flexDirection:"column",boxSizing:"border-box",borderRadius:6,position:"relative"},i),n.a.createElement(pe,{padding:"0 16px",minHeight:40,alignItems:"center",justifyContent:"space-between"},n.a.createElement(q.m,{styleNumber:16,whiteSpace:"nowrap"},n.a.createElement(T.b,{id:e})),t),a);const he=Object(y.c)(q.f)`
  height: 100%;
  > div {
    @media ${K.a.VIEWPORT_XS} {
      padding: 0 16px 24px 16px;
    }
    @media ${K.a.VIEWPORT_S} {
      padding: 0 16px 24px 16px;
    }
    @media ${K.a.VIEWPORT_M} {
      padding: 24px;
    }
    @media ${K.a.VIEWPORT_L} {
      padding: 0 16px 24px 16px;
    }
    @media ${K.a.VIEWPORT_XL} {
      padding: 0 16px 24px 16px;
    }
    @media ${K.a.VIEWPORT_XXL} {
      padding: 0 16px 24px 16px;
    }
    @media ${K.a.VIEWPORT_XXXL} {
      padding: 0 24px 24px 24px;
    }
    @media ${K.a.VIEWPORT_XXXXL} {
      padding: 0 24px 24px 24px;
    }
    > div:first-child {
      height: 100%;
    }
    > div:last-child > div:last-child > div:last-child {
      height: 90%;
      justify-content: center;
    }
  }
  table > thead > tr th svg {
    width: 16px;
    height: 16px;
  }
`;var Ie,_e,ge=Object(H.o)(({history:e,match:{params:t},statisticsDateRange:a,statisticsApMac:i,dispatch:o,onRestoreDefaults:d})=>{var m;const s=Object(l.useSelector)(X.b),b=Object(l.useSelector)(X.a),u=Object(l.useSelector)(c.d),O=Object(l.useSelector)(ee.k),p=(null===(m=Object(l.useSelector)(Object(ie.v)(B.a.WIFI_STATISTICS_CLIENT_DETAILS)))||void 0===m?void 0:m.initialColumns)||[],E=Object(r.useMemo)(()=>b.map(e=>({...e,id:e.client.mac,apConnected:(({type:e,model:t,name:a})=>({type:e,model:t,name:a}))(O.find(({mac:t})=>t===e.last_ap_mac)||{type:te.e.AP,model:te.d.U7HD,name:e.last_ap_mac})})),[b,O]);Object(r.useEffect)(()=>{o(Object(ae.a)(void 0,{crudCacheStrategy:{type:Q.a.CACHE}}))},[]);const h=Object(r.useCallback)(({id:a,client:i})=>{e.push(Object(H.i)(Z.b,{...t,id:a,panel:G.a.OVERVIEW})),o(Object(J.g)({type:"unifi_device_info"in i?z.c.UNIFI_DEVICE_CLIENT:z.c.CLIENT,mac:a}))},[t]),I=Object(r.useCallback)(({from:e,rowsPerPage:t})=>n.a.createElement(q.f,{overflow:"auto"},n.a.createElement(D.a,{items:E,rowLimit:t,rowOffset:e,columns:ue,columnOverride:p,disableColumnFilters:!0,disableHover:!0,disableSelection:!0,rowHeight:32,onRowClick:h,renderPlaceholder:()=>n.a.createElement(q.m,{styleNumber:18},n.a.createElement(T.b,{id:"WIFI_STAT_NO_ACTIVE_CLIENTS"}))})),[E,p,h]);return Object(V.a)([Object($.a)({start:a.startDate.getTime(),end:a.endDate.getTime(),apMac:i},void 0,{crudCacheStrategy:{type:Q.a.CACHE}})],!s.length||E.length&&p.length?n.a.createElement(Ee,{title:"WIFI_STAT_WATCH",flexProps:{height:"100%",overflow:"hidden"},action:n.a.createElement(k.O,{"data-testid":"watchlist-column-visibility",onClick:()=>o(Object(Y.k)(!0))})},n.a.createElement(he,{overflow:"hidden","data-testid":"watchlist-table"},n.a.createElement(U.a,{section:"COMMON_CLIENTS",tableType:B.a.WIFI_STATISTICS_CLIENT_DETAILS,itemCount:E.length,onRenderTable:I,onPageChanged:e=>{e!==u&&o(Object(Y.j)({pageNumber:e}))},rowOptions:[{value:"25",default:!0},{value:"50"},{value:"100"}],pageNumber:u,useDropdownTopPosition:!0}))):n.a.createElement(q.f,{height:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},n.a.createElement(q.f,{marginBottom:12},n.a.createElement(q.m,{styleNumber:35},n.a.createElement(T.b,{id:"COMMON_NO_MATCH"}))),n.a.createElement(q.f,{marginBottom:16},n.a.createElement(q.m,{styleNumber:18},n.a.createElement(T.b,{id:"WIFI_STAT_ADJUST"}))),n.a.createElement(L.a,{variant:"primary",onClick:()=>d()},n.a.createElement(T.b,{id:"COMMON_BUTTON_RESET_DISPLAY_OPTION"}))))}),Ce=a(2769),ve=a(3059),je=a(3044),Te=a(574),Ne=a.n(Te),fe=a(261),Se=a(366),we=a(213),ye=a(1198);const Me=Object(y.c)(v.a)`
  border-top: 1px solid ${({theme:e})=>e.motifPalette.neutral04};
`,xe=Object(y.c)(je.a)`
  cursor: pointer;
`,Pe=B.a.WIFI_STATISTICS_CLIENT_DETAILS,We=Object.values(se.b),Re=null===(_e=null===(Ie=null===ye.b||void 0===ye.b?void 0:ye.b.tables)||void 0===Ie?void 0:Ie[Pe])||void 0===_e?void 0:_e.initialColumns;var Ae=({dispatch:e})=>{var t;const a=Object(l.useSelector)(c.e),i=Object(l.useSelector)(Object(we.e)(Se.a.WIFI_MIMO)),o=Object(r.useMemo)(()=>i?We:We.filter(e=>e!==se.b.MIMO),[i]),d=(null===(t=Object(l.useSelector)(Object(ie.v)(Pe)))||void 0===t?void 0:t.initialColumns)||[],m=Object(r.useMemo)(()=>o.every(e=>d.includes(e)),[o,d]),s=()=>{e(Object(fe.j)(Pe,{initialColumns:d})),e(Object(Y.k)(!1))};return Object(r.useEffect)(()=>()=>{s()},[]),n.a.createElement(Ce.a,{width:256,in:a,header:n.a.createElement(v.a,{alignItems:"center"},n.a.createElement(xe,null)," ",n.a.createElement(v.a,{marginLeft:8},n.a.createElement(S.a,{size:"body",color:"secondary"},n.a.createElement(T.b,{id:"COMMON_CONTROL_PANEL_COLUMNS"})))),style:{border:"none"},onClose:s,side:"right"},n.a.createElement(v.a,{padding:"28px 0 0 0",flexDirection:"column",justifyContent:"space-between",height:"100%"},n.a.createElement(v.a,{padding:"0 24px"},n.a.createElement(ve.a,{spacing:"flush",variant:"list",items:Object(r.useMemo)(()=>[{full:!0,id:"showAllColumns",checked:m||!!d.length&&"mixed",children:n.a.createElement(T.b,{id:"COMMON_ALL"}),onChange:()=>e(Object(fe.j)(Pe,{initialColumns:m||d.length?[]:o},!0))},...o.map(t=>({full:!0,id:t,checked:d.includes(t),children:n.a.createElement(T.b,{id:se.c[t]}),onChange:({target:{checked:a}})=>e(Object(fe.j)(Pe,{initialColumns:a?[...d,t]:d.filter(e=>e!==t)},!0))}))],[o,d,m])})),n.a.createElement(Me,{minHeight:70,padding:"0 24px"},n.a.createElement(L.a,{"data-testid":"watchlist-columns-reset-defaults",variant:"inline",disabled:Object(r.useMemo)(()=>Ne()(Re,d),[d]),onClick:Object(r.useCallback)(()=>e(Object(fe.j)(Pe,{initialColumns:[...Re||[]]},!0)),[])},n.a.createElement(T.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_COLUMNS"})))))};t.default=({dispatch:e,onRestoreDefaults:t})=>{const a=Object(l.useSelector)(c.f),i=Object(l.useSelector)(c.c);return Object(j.g)([Object(o.a)({start:a.startDate.getTime(),end:a.endDate.getTime(),apMac:i},void 0,{crudCacheStrategy:{type:b.a.CACHE}}),Object(C.c)("wifiStatistics")],n.a.createElement(v.a,{width:"100%",height:"100%",flexDirection:"column",padding:"32px",overflow:"overlay",zIndex:10},n.a.createElement(F,null),n.a.createElement(ge,{statisticsDateRange:a,statisticsApMac:i,dispatch:e,onRestoreDefaults:t}),n.a.createElement(Ae,{dispatch:e})))}},2853:function(e,t,a){"use strict";a.d(t,"c",(function(){return c})),a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return d}));var i=a(0),r=a.n(i),n=a(1),l=a(1038);const c=[{id:l.b.trafficOverview,intlKey:"COMMON_TR_OW",label:r.a.createElement(n.b,{id:"COMMON_TR_OW"})},{id:l.b.wifiStatistics,intlKey:"STATISTICS_TAB_WIFI_STATS",label:r.a.createElement(n.b,{id:"STATISTICS_TAB_WIFI_STATS"})}],o=`/:site/statistics/${l.b.trafficOverview}/:subSection?/:appId?/properties/:id?/:panel?/:subPanel?/:subPanelId?`,d=`/:site/statistics/${l.b.wifiStatistics}/properties/:id?/:panel?/:subPanel?/:subPanelId?`}}]);