"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[80656],{306644(e,t,n){n.d(t,{A:()=>o});var r=n(296540),a=n(629318);const o=(0,n(51946).w)(e=>(0,r.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,r.createElement)("path",{d:"M15 12a.498.498 0 0 0-.16-.366L10.7 7.785a1.001 1.001 0 0 0-1.4 0l-4.14 3.848a.5.5 0 0 0 .68.733L10 8.5l.013.013 4.147 3.853A.5.5 0 0 0 15 12Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{d:"M15.25 12a.75.75 0 0 0-.239-.55l-4.139-3.846a1.25 1.25 0 0 0-1.744 0L4.99 11.45a.75.75 0 0 0 1.021 1.099L10 8.84l3.989 3.708a.75.75 0 0 0 1.261-.55Z",fill:"currentColor",className:e.fillclassname})))},143748(e,t,n){n.d(t,{A:()=>E});var r=n(296540),a=n(888170),o=n(509796),l=n(125832);const i=16.5,c=(0,n(722860).c)(l.A);function s({motif:e="light",parent:t,expanded:n,child:l,hideLines:s,lastChild:E,rowHeight:u=32,onClick:d,position:A}){const m={width:"32px",height:1},I=a.Ay.motifs[e].neutral04;if(t)return r.createElement(o.A,{className:c("hierarchyGlyphIcon"),value:n?"minus":"plus",motif:e,isExpanded:n,onClick:d});if(s)return null;if((E||l)&&"top"===A){const e=u/2;return r.createElement("svg",{...m,height:e+.5},r.createElement("line",{stroke:I,strokeWidth:1,x1:i,y1:.5,x2:i,y2:e}),r.createElement("line",{stroke:I,strokeWidth:1,x1:i,y1:e,x2:32,y2:e}))}return E||l?r.createElement("svg",{...m},r.createElement("line",{stroke:I,strokeWidth:1,x1:"15.5",y1:"0.5",x2:"32",y2:"0.5"})):null}function E(e){const{className:t="",motif:n="light",hideCellBorder:a,tag:o="td",lastChild:l,expanded:i,parent:E,position:u="center",hideLines:d,...A}=e;return r.createElement(o,{className:c.concat(t)(!a&&"borderedCell",!a&&`borderedCell-${n}`,"hierarchyGlyph",`hierarchyGlyph-${n}`,i&&!d&&"hierarchyGlyph-expanded",l&&"hierarchyGlyph-lastChild",E&&"hierarchyGlyph-parent","top"===u&&"top")},r.createElement(s,{motif:n,lastChild:l,expanded:i,parent:E,position:u,...A}))}E.defaultProps={child:!1,lastChild:!1,expanded:!1,parent:!1,hideLines:!1,hideCellBorder:!1,motif:"light"}},88502(e,t,n){n.d(t,{A:()=>c});var r=n(469733),a=n(963169),o=n(413914),l=n(624489),i=n(897254);const c=()=>{const e=(0,r.useSelector)(l.V);(0,a.A)(o.E.DASHBOARD,void 0,(e=>({history_seconds:e[i.GB.HISTORY_SECONDS]}))(e))}},689965(e,t,n){n.d(t,{A:()=>m,I:()=>r});var r,a=n(296540),o=n(822336),l=n(963724),i=n(71479),c=n(825032),s=n(566723),E=n(294303),u=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const d=(0,i.A)(E.A,(0,u.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(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  `:""}
`,A=(0,i.A)(l.A,(0,u.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===c.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===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${s.Ln} ${s.Ln};
      }
    }
  }
`,m=({type:e,marginBottom:t,margin:n,padding:o,flex:l,width:i,nested:c,...s})=>"items"in s?a.createElement(A,{marginBottom:t,margin:n,padding:o,flex:l,nested:c,...s}):a.createElement(d,{nested:c,width:i,marginBottom:t,margin:n,padding:o,flex:l,isButtonList:e===r.BUTTON_LIST,...s},s.children)},299563(e,t,n){n.r(t),n.d(t,{default:()=>Ge});var r=n(296540),a=n(689965),o=n(930005),l=n(88502),i=n(71479),c=n(294303),s=n(566723);const E=(0,i.A)(c.A)`
  flex-direction: column;
  gap: ${s.kc};
`,u=(0,i.A)(c.A)`
  flex-direction: column;
  gap: ${s.Ln};
`;var d=n(469733),A=(n(968906),n(916537)),m=n(845030),I=n(398300),_=n(822336);(0,i.A)(c.A)`
  border-radius: ${s.YC};
  background: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-02-${e}`]};
  border: 1px solid ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-03-${e}`]};
  padding: ${s.xO};
`;const C=(0,r.memo)(()=>{const e=(0,d.useDispatch)();return(0,r.useCallback)(()=>{e((0,m.XP)({type:I.H.DEVICE_UPDATES,id:"any"}))},[e]),null});var O=n(217439),D=n(382389),p=n(282556),N=n(602021),R=n(198494),h=(n(825032),n(311785));const g=(0,i.A)(c.A,(0,h.A)("showRevert"))`
  flex-direction: column;
  gap: ${s.YC};
  .${"DASHBOARD_WIFI_DOCTOR_OVERVIEW_HEADER_REVERT_ICON_CLASS_NAME"} {
    ${({showRevert:e})=>e?"\n    pointer-events: none;\n    opacity: 0.4;\n    ":""}
  }
`,S=((0,i.A)(c.A)`
  flex-direction: column;
  gap: ${s.Ln};
`,(0,i.A)(c.A)`
  align-items: center;
  gap: ${s.YC};
`,e=>e.some(({[o.Me.OPTIMIZATION_STATUS]:e})=>e===o.CK.IN_PROGRESS)),M=e=>e.every(({[o.Me.OPTIMIZATION_STATUS]:e})=>e===o.CK.COMPLETED);var T=n(411700),f=n(74750);const P=(0,i.A)(c.A)`
  flex-direction: column;
  border-radius: ${s.YC};
  border: 1px solid ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-03-${e}`]};
  gap: ${s.kc};
  padding: ${s.kc};
`,L=(0,i.A)(c.A)`
  height: 120px;
  flex-direction: column;
  gap: ${s.kc};
  border-radius: ${s.YC};
  background: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-02-${e}`]};
  padding: ${s.kc};
  justify-content: space-between;
  textarea {
    border: 1px solid ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-02-${e}`]};
    background: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-02-${e}`]};
    resize: none;
    outline: none;
    height: 100px;
    color: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-text-1-${e}`]};
  }
`,k=(0,i.A)(c.A)`
  align-items: center;
  gap: ${s.kc};
`,$=((0,r.memo)(({setShowRevert:e})=>{const{formatMessage:t}=(0,A.tz)(),[n,a]=(0,r.useState)(""),[o,l]=(0,r.useState)(!0),i=(0,r.useCallback)(()=>{e(!1)},[e]),c=(0,r.useCallback)(()=>{e(!1)},[e]),s=(0,r.useCallback)(({target:{value:e}})=>{a(e)},[]),E=(0,r.useCallback)(e=>{l(e)},[]);return r.createElement(P,null,r.createElement(L,null,r.createElement("textarea",{placeholder:t({id:"DASHBOARD_WIFI_DOCTOR_REVERT_PLACEHOLDER"}),onChange:s,spellCheck:!1}),r.createElement(T.A,{label:t({id:"DASHBOARD_INCLUDE_SUPPORT_FILE"}),onChange:E,isSelected:o})),r.createElement(k,null,r.createElement(f.A,{type:"button",onClick:i,size:"small"},r.createElement(A.sA,{id:"COMMON_ACTION_REVERT_NOW"})),r.createElement(f.A,{type:"button",onClick:c,variant:"tertiary-neutral",size:"small"},r.createElement(A.sA,{id:"COMMON_ACTION_CANCEL"}))))}),(0,r.memo)(({[o.Ss.ACTIONS]:e})=>{const[t,n]=(0,r.useState)(!1),a=((0,D.u)(),(0,d.useSelector)(p.zi)),l=(0,d.useSelector)(R.BQ),i=(0,d.useSelector)(N.hq),c=(0,r.useMemo)(()=>M(e),[e]);return(0,r.useMemo)(()=>new Intl.DateTimeFormat(a,{hourCycle:l,timeZone:i,month:"long",day:"numeric",year:"numeric"}),[a,l,i]),(0,r.useCallback)(()=>{n(!0)},[]),r.createElement(g,{showRevert:t},r.createElement(O.A,{weight:"bold",size:"medium",color:"text-1"},r.createElement(A.sA,{id:c?"DASHBOARD_WIFI_OPTIMIZATION_COMPLETE":"DASHBOARD_WIFI_OPTIMIZATION_AVAILABLE"})),r.createElement(O.A,{size:"medium",color:"text-3"},r.createElement(A.sA,{id:c?"DASHBOARD_RECOMMENDED_OPTIMIZATIONS_APPLIED":"DASHBOARD_RECOMMENDED_OPTIMIZATIONS"}),c?"":":"))})),b=(0,i.A)(c.A)`
  flex-direction: column;
  gap: ${s.kc};
`;var v=n(247016),B=n(629318);const x=(0,n(51946).w)(e=>(0,r.createElement)("svg",(0,B.d)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.495 2.427a.5.5 0 0 0-.983-.035L8.909 14.103 6.876 7.845a.5.5 0 0 0-.943-.024L4.526 11.5H2.5a.5.5 0 0 0 0 1h2.37a.5.5 0 0 0 .467-.321l1.025-2.68 2.162 6.655a.5.5 0 0 0 .964-.046L11.9 5.253l2.405 16.32a.5.5 0 0 0 .992-.017l1.25-11.056h1.516a2 2 0 1 0 0-1H16.1a.5.5 0 0 0-.497.444l-.868 7.683-2.24-15.2ZM20 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{d:"M20 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:"currentColor",className:e.twotonedclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.495 2.427a.5.5 0 0 0-.983-.035L8.909 14.103 6.876 7.845a.5.5 0 0 0-.943-.024L4.526 11.5H2.5a.5.5 0 0 0 0 1h2.37a.5.5 0 0 0 .467-.321l1.025-2.68 2.162 6.655a.5.5 0 0 0 .964-.046L11.9 5.253l2.405 16.32a.5.5 0 0 0 .99-.008L16.74 10.5h1.324a2 2 0 1 0 0-1H16.3a.5.5 0 0 0-.496.435l-1.034 7.93-2.275-15.438Z",fill:"currentColor",className:e.fillclassname})));var y=n(793336);const w=(e,t)=>`\n    @keyframes ${e} {\n      ${Array.from({length:100},(e,n)=>`\n      ${2*n}% {\n        background: conic-gradient(\n          from 0deg,\n          ${t} 0deg,\n          ${t} ${2*n*3.6}deg,\n          transparent ${2*n*3.6}deg,\n          transparent 360deg\n        );\n      }`).join("")}\n    }\n    &::before {\n      content: '';\n      position: absolute;\n      inset: -1px;\n      border-radius: ${s.fS};\n      animation: ${e} 1.5s ease-in-out infinite;\n      \n      -webkit-mask: \n        linear-gradient(#fff 0 0) content-box, \n        linear-gradient(#fff 0 0);\n      -webkit-mask-composite: xor;\n      mask: \n        linear-gradient(#fff 0 0) content-box, \n        linear-gradient(#fff 0 0);\n      mask-composite: exclude;\n      padding: 1px;\n      pointer-events: none;\n      z-index: 1;\n    }\n  `,U=(e,t)=>{switch(e){case o.CK.IN_PROGRESS:return _.Ay[`desktop-color-ublue-06-${t}`];case o.CK.FAILED:return _.Ay[`desktop-color-red-06-${t}`];case o.CK.COMPLETED:return _.Ay[`desktop-color-green-06-${t}`];default:return _.Ay[`desktop-color-ublue-06-${t}`]}},K=(0,i.A)(c.A,(0,h.A)("optimizationStatus"))`
  width: ${s.S2};
  height: ${s.S2};
  justify-content: center;
  align-items: center;
  border-radius: ${s.fS};
  position: relative;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    background-color: ${((e,t)=>{switch(e){case o.CK.COMPLETED:return _.Ay[`desktop-color-green-01-${t}`];case o.CK.FAILED:return _.Ay[`desktop-color-red-01-${t}`];default:return _.Ay[`desktop-color-ublue-01-${t}`]}})(e,t)};\n    border: 1px solid ${((e,t)=>{switch(e){case o.CK.COMPLETED:return _.Ay[`desktop-color-green-02-${t}`];case o.CK.FAILED:return _.Ay[`desktop-color-red-02-${t}`];default:return _.Ay[`desktop-color-ublue-02-${t}`]}})(e,t)};\n    ${((e,t)=>e===o.CK.IN_PROGRESS?w("optimization",_.Ay[`desktop-color-ublue-06-${t}`]):"")(e,t)}\n  `}
`,G=(0,r.memo)(({[o.Me.OPTIMIZATION_STATUS]:e})=>{const t=(0,r.useMemo)(()=>(e=>{switch(e){case o.CK.IN_PROGRESS:return x;case o.CK.FAILED:return y.A;case o.CK.COMPLETED:return v.A;default:return x}})(e),[e]);return r.createElement(K,{optimizationStatus:e},r.createElement(t,{color:U(e,(0,D.u)().themeName),size:"medium"}))}),W=(0,i.A)(c.A)`
  background-color: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-02-${e}`]};
  border-radius: ${s.kc};
  padding: ${s.kc};
  flex-direction: column;
  gap: ${s.xO};
`,V=(0,i.A)(c.A)`
  justify-content: space-between;
  align-items: center;
`,z=(0,i.A)(c.A)`
  gap: ${s.kc};
  align-items: center;
`;var F=n(240131),X=n(208236),Y=n(511752);const Z=(0,i.A)(c.A)`
  width: 100%;
  height: 100%;
  flex-direction: column;
  thead {
    background: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-02-${e}`]};
  }
  max-height: 351px;
  overflow: auto;
`;var H,j,J;!function(e){e.DEVICE="DEVICE",e.VERSION="VERSION"}(H||(H={})),function(e){e.UPGRADABLE_DEVICES_COLUMN="upgradableDevicesColumn"}(j||(j={})),function(e){e.UPGRADABLE_DEVICE="upgradableDevice"}(J||(J={}));const Q=({[j.UPGRADABLE_DEVICES_COLUMN]:e})=>r.createElement(A.sA,{id:ce[e]});var q=n(705145),ee=n(6510),te=n(6176);const ne=(e,t)=>{switch(e){case o.CK.COMPLETED:return _.Ay[`desktop-color-green-06-${t}`];case o.CK.FAILED:return _.Ay[`desktop-color-red-06-${t}`];case o.CK.IN_PROGRESS:return _.Ay[`desktop-color-ublue-06-${t}`];default:return _.Ay[`desktop-color-neutral-06-${t}`]}},re=(0,i.A)(c.A)`
  align-items: center;
  gap: ${s.YC};
  padding: 0 0 0 2px;
`,ae=(0,i.A)(c.A,(0,h.A)("optimizationStatus"))`
  width: ${s.Ln};
  min-width: ${s.Ln};
  height: ${s.Ln};
  min-height: ${s.Ln};
  justify-content: center;
  align-items: center;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    border: 1px solid ${((e,t)=>{switch(e){case o.CK.COMPLETED:return _.Ay[`desktop-color-green-02-${t}`];case o.CK.FAILED:return _.Ay[`desktop-color-red-02-${t}`];case o.CK.IN_PROGRESS:return _.Ay[`desktop-color-ublue-02-${t}`];default:return _.Ay[`desktop-color-neutral-06-${t}`]}})(e,t)};\n    background-color: ${((e,t)=>{switch(e){case o.CK.COMPLETED:return _.Ay[`desktop-color-green-01-${t}`];case o.CK.FAILED:return _.Ay[`desktop-color-red-01-${t}`];case o.CK.IN_PROGRESS:return _.Ay[`desktop-color-ublue-01-${t}`];default:return"transparent"}})(e,t)};\n    ${((e,t)=>e===o.CK.IN_PROGRESS?w("upgradableDevice",_.Ay[`desktop-color-ublue-06-${t}`]):"")(e,t)}\n  `};

  border-radius: ${s.fS};
  position: relative;
  margin: 4px;
`;var oe=n(275737),le=n(999589);const ie=(0,i.A)(c.A)`
  align-items: center;
  gap: ${s.YC};
`,ce={[H.DEVICE]:"COMMON_DEVICE",[H.VERSION]:"COMMON_VERSION"},se={[H.DEVICE]:({[j.UPGRADABLE_DEVICES_COLUMN]:e})=>r.createElement(Q,{upgradableDevicesColumn:e}),[H.VERSION]:({[j.UPGRADABLE_DEVICES_COLUMN]:e})=>r.createElement(Q,{upgradableDevicesColumn:e})},Ee={[H.DEVICE]:{size:110,minSize:110,maxSize:1/0},[H.VERSION]:{size:90,minSize:90,maxSize:1/0}},ue={[H.DEVICE]:({[J.UPGRADABLE_DEVICE]:{[o.j0.MAC]:e,[o.j0.MODEL]:t,[o.j0.NAME]:n,[o.j0.OPTIMIZATION_STATUS]:a}})=>{const l=(0,r.useMemo)(()=>(e=>{switch(e){case o.CK.IN_PROGRESS:return x;case o.CK.FAILED:return y.A;case o.CK.COMPLETED:return v.A;default:return x}})(a),[a]);return r.createElement(re,null,r.createElement(ae,{optimizationStatus:a},r.createElement(l,{color:ne(a,(0,D.u)().themeName),size:"small"})),r.createElement(te.A,{model:t,width:20,height:20}),r.createElement(q.A,{isTruncated:!0,size:"medium",color:"text-2"},(0,ee.Q)({mac:e,model:t,name:n})))},[H.VERSION]:({[J.UPGRADABLE_DEVICE]:{[o.j0.CURRENT_VERSION]:e,[o.j0.UPGRADABLE_VERSION]:t}})=>r.createElement(ie,null,r.createElement(O.A,{size:"medium",color:"text-2"},(0,le.coerce)(e)?.version||r.createElement(A.sA,{id:"COMMON_UNKNOWN"})),r.createElement(oe.A,{size:"original",style:{transform:"rotate(-90deg)"}}),r.createElement(O.A,{size:"medium",color:"text-2"},(0,le.coerce)(t)?.version||r.createElement(A.sA,{id:"COMMON_UNKNOWN"})))},de=Object.values(H),Ae=e=>e,me=({header:{id:e}})=>se[e]({[j.UPGRADABLE_DEVICES_COLUMN]:e}),Ie=e=>Ee[e],_e=({column:{id:e},getValue:t})=>ue[e]({[J.UPGRADABLE_DEVICE]:t()}),Ce={stickyHeader:!0,columns:de.map(e=>({id:e,accessorFn:Ae,header:me,cell:_e,...Ie(e),enableResizing:!1,enableSorting:!1}))},Oe=(0,r.memo)(({[o.Me.UPGRADABLE_DEVICES]:e})=>r.createElement(Z,null,r.createElement(Y.A,{data:e,...Ce}))),De=(0,r.memo)(({[o.Me.ID]:e,[o.Me.UPGRADABLE_DEVICES]:t})=>e===o.iR.UPDATE_DEVICE_FIRMWARE&&t.length?r.createElement(Oe,{upgradable_devices:t}):null);var pe,Ne=n(306644);!function(e){e.ID="id",e.UPGRADABLE_DEVICES="upgradable_devices",e.IS_EXPANDED="isExpanded",e.SET_IS_EXPANDED="setIsExpanded"}(pe||(pe={}));const Re=(0,r.memo)(({[pe.IS_EXPANDED]:e,[pe.SET_IS_EXPANDED]:t})=>{const n=(0,r.useCallback)(()=>{t(e=>!e)},[t]);return r.createElement(Ne.A,{style:{cursor:"pointer",transform:"rotate("+(e?"0deg":"180deg")},onClick:n,size:"original"})}),he=(0,r.memo)(({[pe.ID]:e,[pe.UPGRADABLE_DEVICES]:t,[pe.IS_EXPANDED]:n,[pe.SET_IS_EXPANDED]:a})=>(0,r.useMemo)(()=>e===o.iR.UPDATE_DEVICE_FIRMWARE&&t.length>0,[e,t.length])?r.createElement(Re,{isExpanded:n,setIsExpanded:a}):null),ge=(0,r.memo)(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:t,[o.Me.UPGRADABLE_DEVICES]:n})=>{const[a,l]=(0,r.useState)(!1);return r.createElement(W,null,r.createElement(V,null,r.createElement(z,null,r.createElement(G,{optimization_status:t}),r.createElement(O.A,{size:"medium",color:"text-2"},X.V[e][F.a.GET_LABEL]({[F.K.UPGRADABLE_DEVICES]:n}))),r.createElement(he,{id:e,upgradable_devices:n,isExpanded:a,setIsExpanded:l})),a?r.createElement(De,{id:e,upgradable_devices:n}):null)}),Se=(0,r.memo)(({[o.Ss.ACTIONS]:e})=>r.createElement(b,null,e.map(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:t,[o.Me.UPGRADABLE_DEVICES]:n=[]})=>r.createElement(ge,{key:e,id:e,optimization_status:t,upgradable_devices:n}))));var Me=n(930662);const Te=(0,i.A)(c.A)`
  flex-direction: column;
`,fe=(0,r.memo)(({[o.Ss.ACTIONS]:e})=>{const{percentage:t,optimizationInProgress:n}=(0,r.useMemo)(()=>{return{percentage:(t=e.reduce((e,{[o.Me.ID]:t,[o.Me.UPGRADABLE_DEVICES]:n=[]})=>t===o.iR.UPDATE_DEVICE_FIRMWARE?e+n.length:e+1,0),n=e.reduce((e,{[o.Me.ID]:t,[o.Me.UPGRADABLE_DEVICES]:n=[],[o.Me.OPTIMIZATION_STATUS]:r})=>t===o.iR.UPDATE_DEVICE_FIRMWARE?e+n.filter(({[o.j0.OPTIMIZATION_STATUS]:e})=>e!==o.CK.COMPLETED).length:e+(r!==o.CK.COMPLETED?1:0),0),t>0?100-Math.round(n/t*100):0),optimizationInProgress:S(e)};var t,n},[e]);return 100!==t&&n?r.createElement(Te,null,r.createElement(Me.A,{value:t,variant:"primary",size:"large"}),r.createElement(q.A,{isTruncated:!0,size:"medium",color:"text-3"},(e=>{const t=e.find(({[o.Me.OPTIMIZATION_STATUS]:e})=>e===o.CK.IN_PROGRESS);if(t){if(t[o.Me.ID]===o.iR.UPDATE_DEVICE_FIRMWARE){const e=t[o.Me.UPGRADABLE_DEVICES].find(({[o.j0.OPTIMIZATION_STATUS]:e})=>e===o.CK.IN_PROGRESS);return e?r.createElement(A.sA,{id:X.V[o.iR.UPDATE_DEVICE_FIRMWARE][F.a.DESCRIPTION],values:{deviceName:(0,ee.Q)({mac:e[o.j0.MAC],model:e[o.j0.MODEL],name:e[o.j0.NAME]})}}):null}return r.createElement(A.sA,{id:X.V[t[o.Me.ID]][F.a.DESCRIPTION]})}return null})(e),"...")):null});var Pe=n(180524),Le=n(874807),ke=n(887831),$e=n(691189),be=n(516693);const ve=`${n(771805).w}/wifi-doctor/optimization`,Be=`${ve}/start`,xe=`${ve}/stop`;var ye,we=n(212178),Ue=n(147606);!function(e){e.LABEL="label",e.ON_CLICK="onClick"}(ye||(ye={}));const Ke=(0,r.memo)(({[o.Ss.ACTIONS]:e,[o.Ss.IN_PROGRESS]:t,[o.Ss.IN_PROGRESS_IN_SITE]:n})=>{const a=(0,d.useDispatch)(),[l,i]=(0,r.useState)(!1),{formatMessage:c}=(0,A.tz)(),s=(0,r.useCallback)(()=>{i(!0)},[]),E=(0,r.useCallback)(()=>{s(),a((0,$e.vB)(be.aC,null,null,ke.A.POST,Be,{},null,{}))},[a,s]),u=(0,r.useCallback)(()=>{s(),a((0,$e.vB)(be.aC,null,null,ke.A.POST,xe,{},null,{}))},[a,s]),m=(0,r.useMemo)(()=>{return S(t=e)||M(t)?S(e)?o.CK.IN_PROGRESS:M(e)?o.CK.COMPLETED:void 0:o.CK.PENDING;var t},[e]),{[ye.LABEL]:I,[ye.ON_CLICK]:_}=(0,r.useMemo)(()=>{switch(m){case o.CK.PENDING:return{[ye.LABEL]:c({id:"DASHBOARD_CLICK_TO_OPTIMIZE"}),[ye.ON_CLICK]:E};case o.CK.IN_PROGRESS:return{[ye.LABEL]:c({id:"COMMON_STOP"}),[ye.ON_CLICK]:u};case o.CK.COMPLETED:return{[ye.LABEL]:"",[ye.ON_CLICK]:Le.P1};default:return{[ye.LABEL]:"",[ye.ON_CLICK]:Le.P1}}},[m,c,E,u]),C=(0,we.A)(m);(0,r.useEffect)(()=>{C!==m&&i(!1)},[m,C]);const O=n&&!t,D=(0,r.useMemo)(()=>m===o.CK.PENDING&&e.some(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:t})=>e===o.iR.UPDATE_DEVICE_FIRMWARE&&t===o.CK.PENDING),[e,m]),p=(0,r.useCallback)((e=Le.P1)=>r.createElement(f.A,{type:"button",size:"medium",onClick:e,isDisabled:O||l},I),[I,O,l]);return I?r.createElement(Pe.A,{description:O?r.createElement(A.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_ONE_PER_SITE"}):void 0},D?r.createElement(r.Fragment,null,r.createElement(Ue.A,{shouldCloseOnInteractOutside:!0,onConfirm:_,trigger:p(),title:r.createElement(A.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_TITLE"}),message:r.createElement(A.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_DESCRIPTION"})})):p(_)):null}),Ge=({activeItem:{[o.Ss.ACTIONS]:e,[o.Ss.IN_PROGRESS]:t,[o.Ss.IN_PROGRESS_IN_SITE]:n}})=>{(0,l.A)();const i=(e=>{const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(e),l=(0,r.useRef)(null);return(0,r.useEffect)(()=>{l.current&&(clearTimeout(l.current),l.current=null);const t=new Map(a.current.map(e=>[e[o.Me.ID],e]));return e.some(({[o.Me.ID]:e,[o.Me.OPTIMIZATION_STATUS]:n})=>{const r=t.get(e);return!!r&&r[o.Me.OPTIMIZATION_STATUS]!==n})?l.current=setTimeout(()=>{n(e),a.current=e},2500):(n(e),a.current=e),()=>{l.current&&clearTimeout(l.current)}},[e]),t})(e);return r.createElement(E,null,r.createElement(C,null),r.createElement(a.A,null,r.createElement(u,null,r.createElement($,{actions:i}),r.createElement(Se,{actions:i}),r.createElement(fe,{actions:i}),r.createElement(Ke,{actions:i,in_progress:t,in_progress_in_site:n}))))}},372737(e,t,n){var r;n.d(t,{U:()=>r}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(r||(r={}))},212178(e,t,n){n.d(t,{A:()=>a});var r=n(296540);const a=e=>{const t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},963169(e,t,n){n.d(t,{A:()=>d});var r=n(296540),a=n(469733),o=n(525512),l=n(687573),i=n(648092),c=n(523275),s=n(874807),E=n(906593),u=n(802125);const d=(e,t=s.P1,n=(0,c.A)(),d=!1)=>{const A=(0,a.useDispatch)(),m=(0,r.useMemo)(()=>JSON.stringify(n),[n]),I=(0,a.useSelector)(i.a),_=(0,r.useMemo)(()=>[I[E.Uz],...d?[I[E.o4]]:[]].filter(Boolean),[I,d]),C=(0,r.useCallback)(e=>(0,o.K6)(e,t),[t]),O=(0,r.useCallback)(e=>{(0,o.$N)(e)},[]);(0,r.useEffect)(()=>(_.forEach(t=>{t.send((0,u.f)(e,!0,JSON.parse(m)))}),()=>{_.forEach(t=>{t.send((0,u.f)(e,!1,JSON.parse(m)))})}),[A,e,m,_]),(0,r.useEffect)(()=>{const t=l._[e].map(C);return()=>{t.forEach(O)}},[A,e,C,O])}},802125(e,t,n){n.d(t,{f:()=>o});var r,a=n(434008);!function(e){e.TYPE="type",e.SUBSCRIPTION="subscription",e.ENABLED="enabled",e.META="meta"}(r||(r={}));const o=(e,t,n)=>({[r.TYPE]:a.uw.SUBSCRIBE,[r.SUBSCRIPTION]:e,[r.ENABLED]:t,[r.META]:n})},648092(e,t,n){n.d(t,{a:()=>c,m:()=>s});var r=n(801081),a=n(386234),o=n(276907),l=n(919952),i=n(434008);const c=(0,r.Mz)(e=>e[l.U.SHARED][o.N.WEB_SOCKET],e=>e?.[i.SC.POOL]||{}),s=(0,r.Mz)(c,e=>(0,a.UI)(t=>e[t]))},525512(e,t,n){n.d(t,{$N:()=>i,K6:()=>l,WM:()=>o});var r=n(300477);const a={},o=()=>a,l=(e,t,n=!1,o=null)=>{const l=o||(0,r.A)();return a[l]||(a[l]={eventKeys:Array.isArray(e)?e:[e],id:l,action:t,forSuperSite:n}),l},i=e=>{delete a[e]}},511752(e,t,n){n.d(t,{A:()=>m});var r,a,o,l,i,c=n(296540);!function(e){e.TABLE="table"}(r||(r={})),function(e){e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId"}(a||(a={})),function(e){e.ON_KEY_DOWN="onKeyDown",e.INCOMING_ROW_PROPS="incomingRowProps"}(o||(o={})),function(e){e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex"}(l||(l={})),function(e){e.DATA_MAP_REFERENCE="dataMapReference",e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId",e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex",e.MULTI_SELECT_MODE="multiSelectMode"}(i||(i={}));const s="data-row-id";var E=n(372737);const u=e=>e?.children?.[1]?.children;var d=n(762319);const A=(0,n(71479).A)(d.A)`
  tr {
    outline: none;
  }
`,m=({data:e=[],rowProps:t,onRowClick:n,...d})=>{const m=(0,c.useRef)(null),I=(0,c.useRef)(null),{[a.ROW_ID_MAP_BY_INDEX]:_,[a.INDEX_MAP_BY_ROW_ID]:C}=(({[r.TABLE]:e})=>{const[t,n]=(0,c.useState)(()=>e?u(e):void 0);(0,c.useEffect)(()=>{e&&n(u(e))},[e]);const{[a.ROW_ID_MAP_BY_INDEX]:o,[a.INDEX_MAP_BY_ROW_ID]:l}=(0,c.useMemo)(()=>{const e=new Map,n=new Map,r=t?.length;if(t&&r)for(let a=0;a<r;a+=1){const r=t[a].getAttribute(s);r&&(e.set(r,a),n.set(a,r))}return{[a.ROW_ID_MAP_BY_INDEX]:e,[a.INDEX_MAP_BY_ROW_ID]:n}},[t]);return{[a.ROW_ID_MAP_BY_INDEX]:o,[a.INDEX_MAP_BY_ROW_ID]:l}})({[r.TABLE]:m.current}),O=(e=>{const t=(0,c.useRef)(new Map),n=(0,c.useRef)();if(n.current!==e){n.current=e,t.current.clear();const r=e.length;for(let n=0;n<r;n+=1)t.current.set(e[n].id,e[n])}return t})(e),D=(({[i.DATA_MAP_REFERENCE]:e,[i.ROW_ID_MAP_BY_INDEX]:t,[i.INDEX_MAP_BY_ROW_ID]:n,[i.INCOMING_ON_ROW_CLICK]:r,[i.LOCAL_CURRENT_INDEX]:a,[i.MULTI_SELECT_MODE]:o})=>{const l=(0,c.useCallback)(e=>{e.preventDefault()},[]),s=(0,c.useCallback)(()=>{const t=e.current.get(n.get(a.current+1));t&&(r?.(t),a.current+=1)},[n,a,r,e]),u=(0,c.useCallback)(()=>{const t=e.current.get(n.get(a.current-1));t&&(r?.(t),a.current-=1)},[n,a,r,e]);return(0,c.useCallback)((e,{id:n})=>e=>{if(!o&&r){const r=t.get(n);if(Number.isFinite(r))switch(null===a.current&&(a.current=r),e.key){case E.U.ARROW_DOWN:l(e),s();break;case E.U.ARROW_UP:l(e),u()}}},[r,a,o,l,t,s,u])})({[i.DATA_MAP_REFERENCE]:O,[i.ROW_ID_MAP_BY_INDEX]:_,[i.INDEX_MAP_BY_ROW_ID]:C,[i.INCOMING_ON_ROW_CLICK]:n,[i.LOCAL_CURRENT_INDEX]:I,[i.MULTI_SELECT_MODE]:d.multiSelectMode}),p=(({[o.INCOMING_ROW_PROPS]:e,[o.ON_KEY_DOWN]:t})=>(0,c.useCallback)((n,r)=>({...e?.(n,r),[s]:n.id,tabIndex:0,onKeyDown:t(n,r)}),[e,t]))({[o.INCOMING_ROW_PROPS]:t,[o.ON_KEY_DOWN]:D}),N=(({[l.INCOMING_ON_ROW_CLICK]:e,[l.LOCAL_CURRENT_INDEX]:t})=>{const n=(0,c.useCallback)(n=>{t.current=null,e?.(n)},[e,t]);return e?n:void 0})({[l.INCOMING_ON_ROW_CLICK]:n,[l.LOCAL_CURRENT_INDEX]:I});return c.createElement(A,{ref:m,data:e,rowProps:p,onRowClick:N,tableHeight:e.length?"100%":void 0,virtualize:!0,virtualizeColumn:!0,overscan:6,overscanColumn:1,...d})}},383149(e,t,n){n.d(t,{A:()=>a});var r=n(885205);const a=function(e,t){return!(null==e||!e.length)&&(0,r.A)(e,t,0)>-1}},887809(e,t,n){n.d(t,{A:()=>r});const r=function(e,t,n){for(var r=-1,a=null==e?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}},458043(e,t,n){n.d(t,{A:()=>s});var r=n(8300),a=n(383149),o=n(887809),l=n(45572),i=n(552789),c=n(764099);const s=function(e,t,n,s){var E=-1,u=a.A,d=!0,A=e.length,m=[],I=t.length;if(!A)return m;n&&(t=(0,l.A)(t,(0,i.A)(n))),s?(u=o.A,d=!1):t.length>=200&&(u=c.A,d=!1,t=new r.A(t));e:for(;++E<A;){var _=e[E],C=null==n?_:n(_);if(_=s||0!==_?_:0,d&&C==C){for(var O=I;O--;)if(t[O]===C)continue e;m.push(_)}else u(t,C,s)||m.push(_)}return m}},144757(e,t,n){n.d(t,{A:()=>i});var r=n(458043),a=n(187671),o=n(224326),l=n(153533);const i=(0,o.A)(function(e,t){return(0,l.A)(e)?(0,r.A)(e,(0,a.A)(t,1,l.A,!0)):[]})}}]);