"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[28776],{699352(e,t,n){n.d(t,{A:()=>s});var r=n(602086),o=n(716155);const s=(0,n(302405).w)(e=>(0,r.createElement)("svg",(0,o.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})))},535322(e,t,n){n.d(t,{A:()=>I,I:()=>r});var r,o=n(274934),s=n(505817),a=n(753583),i=n(247816),l=n(565527),c=n(309130),d=n(100978),A=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const u=(0,i.A)(d.A,(0,A.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${s.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${c.Ln}`:c.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||c.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}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,E=(0,i.A)(a.A,(0,A.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${s.Ay[`desktop-border-divider-${t}`]};`:""}
  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,nested:t,theme:{themeName:n}})=>e||s.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${c.Ln} ${c.Ln};
      }
    }
  }
`,I=({type:e,marginBottom:t,margin:n,padding:s,flex:a,width:i,nested:l,...c})=>"items"in c?(0,o.jsx)(E,{marginBottom:t,margin:n,padding:s,flex:a,nested:l,...c}):(0,o.jsx)(u,{nested:l,width:i,marginBottom:t,margin:n,padding:s,flex:a,isButtonList:e===r.BUTTON_LIST,...c,children:c.children})},28776(e,t,n){n.r(t),n.d(t,{default:()=>Ge});var r=n(274934),o=n(535322),s=n(337960),a=n(247816),i=n(100978),l=n(309130);const c=(0,a.A)(i.A)`
  flex-direction: column;
  gap: ${l.kc};
`,d=(0,a.A)(i.A)`
  flex-direction: column;
  gap: ${l.Ln};
`;var A=n(602086),u=n(977872),E=(n(590979),n(470070)),I=n(205521),_=n(449339),m=n(505817);(0,a.A)(i.A)`
  border-radius: ${l.YC};
  background: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
  border: 1px solid
    ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-03-${e}`]};
  padding: ${l.xO};
`;const C=(0,A.memo)(()=>{const e=(0,u.wA)();return(0,A.useCallback)(()=>{e((0,I.XP)({type:_.H.DEVICE_UPDATES,id:"any"}))},[e]),null});var O=n(179102),D=n(263705),R=n(820633),N=n(897166),S=n(570801),p=(n(565527),n(291508));const h=(0,a.A)(i.A,(0,p.A)("showRevert"))`
  flex-direction: column;
  gap: ${l.YC};
  .${"DASHBOARD_WIFI_DOCTOR_OVERVIEW_HEADER_REVERT_ICON_CLASS_NAME"} {
    ${({showRevert:e})=>e?"\n    pointer-events: none;\n    opacity: 0.4;\n    ":""}
  }
`,g=((0,a.A)(i.A)`
  flex-direction: column;
  gap: ${l.Ln};
`,(0,a.A)(i.A)`
  align-items: center;
  gap: ${l.YC};
`,e=>e.some(({[s.Me.OPTIMIZATION_STATUS]:e})=>e===s.CK.IN_PROGRESS)),M=e=>e.every(({[s.Me.OPTIMIZATION_STATUS]:e})=>e===s.CK.COMPLETED);var T=n(647313),L=n(83985);const x=(0,a.A)(i.A)`
  flex-direction: column;
  border-radius: ${l.YC};
  border: 1px solid
    ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-03-${e}`]};
  gap: ${l.kc};
  padding: ${l.kc};
`,P=(0,a.A)(i.A)`
  height: 120px;
  flex-direction: column;
  gap: ${l.kc};
  border-radius: ${l.YC};
  background: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
  padding: ${l.kc};
  justify-content: space-between;
  textarea {
    border: 1px solid
      ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
    background: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
    resize: none;
    outline: none;
    height: 100px;
    color: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-text-1-${e}`]};
  }
`,$=(0,a.A)(i.A)`
  align-items: center;
  gap: ${l.kc};
`,f=((0,A.memo)(({setShowRevert:e})=>{const{formatMessage:t}=(0,E.tz)(),[n,o]=(0,A.useState)(""),[s,a]=(0,A.useState)(!0),i=(0,A.useCallback)(()=>{e(!1)},[e]),l=(0,A.useCallback)(()=>{e(!1)},[e]),c=(0,A.useCallback)(({target:{value:e}})=>{o(e)},[]),d=(0,A.useCallback)(e=>{a(e)},[]);return(0,r.jsxs)(x,{children:[(0,r.jsxs)(P,{children:[(0,r.jsx)("textarea",{placeholder:t({id:"DASHBOARD_WIFI_DOCTOR_REVERT_PLACEHOLDER"}),onChange:c,spellCheck:!1}),(0,r.jsx)(T.A,{label:t({id:"DASHBOARD_INCLUDE_SUPPORT_FILE"}),onChange:d,isSelected:s})]}),(0,r.jsxs)($,{children:[(0,r.jsx)(L.A,{type:"button",onClick:i,size:"small",children:(0,r.jsx)(E.sA,{id:"COMMON_ACTION_REVERT_NOW"})}),(0,r.jsx)(L.A,{type:"button",onClick:l,variant:"tertiary-neutral",size:"small",children:(0,r.jsx)(E.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})}),(0,A.memo)(({[s.Ss.ACTIONS]:e})=>{const[t,n]=(0,A.useState)(!1),o=((0,D.u)(),(0,u.d4)(R.zi)),a=(0,u.d4)(S.BQ),i=(0,u.d4)(N.hq),l=(0,A.useMemo)(()=>M(e),[e]);return(0,A.useMemo)(()=>new Intl.DateTimeFormat(o,{hourCycle:a,timeZone:i,month:"long",day:"numeric",year:"numeric"}),[o,a,i]),(0,A.useCallback)(()=>{n(!0)},[]),(0,r.jsxs)(h,{showRevert:t,children:[(0,r.jsx)(O.A,{weight:"bold",size:"medium",color:"text-1",children:(0,r.jsx)(E.sA,{id:l?"DASHBOARD_WIFI_OPTIMIZATION_COMPLETE":"DASHBOARD_WIFI_OPTIMIZATION_AVAILABLE"})}),(0,r.jsxs)(O.A,{size:"medium",color:"text-3",children:[(0,r.jsx)(E.sA,{id:l?"DASHBOARD_RECOMMENDED_OPTIMIZATIONS_APPLIED":"DASHBOARD_RECOMMENDED_OPTIMIZATIONS"}),l?"":":"]})]})})),k=(0,a.A)(i.A)`
  flex-direction: column;
  gap: ${l.kc};
`;var b=n(301764),v=n(716155);const j=(0,n(302405).w)(e=>(0,A.createElement)("svg",(0,v.d)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,A.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,A.createElement)("path",{d:"M20 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:"currentColor",className:e.twotonedclassname}),(0,A.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 B=n(517300);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: ${l.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 s.CK.IN_PROGRESS:return m.Ay[`desktop-color-ublue-06-${t}`];case s.CK.FAILED:return m.Ay[`desktop-color-red-06-${t}`];case s.CK.COMPLETED:return m.Ay[`desktop-color-green-06-${t}`];default:return m.Ay[`desktop-color-ublue-06-${t}`]}},y=(0,a.A)(i.A,(0,p.A)("optimizationStatus"))`
  width: ${l.S2};
  height: ${l.S2};
  justify-content: center;
  align-items: center;
  border-radius: ${l.fS};
  position: relative;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    background-color: ${((e,t)=>{switch(e){case s.CK.COMPLETED:return m.Ay[`desktop-color-green-01-${t}`];case s.CK.FAILED:return m.Ay[`desktop-color-red-01-${t}`];default:return m.Ay[`desktop-color-ublue-01-${t}`]}})(e,t)};\n    border: 1px solid ${((e,t)=>{switch(e){case s.CK.COMPLETED:return m.Ay[`desktop-color-green-02-${t}`];case s.CK.FAILED:return m.Ay[`desktop-color-red-02-${t}`];default:return m.Ay[`desktop-color-ublue-02-${t}`]}})(e,t)};\n    ${((e,t)=>e===s.CK.IN_PROGRESS?w("optimization",m.Ay[`desktop-color-ublue-06-${t}`]):"")(e,t)}\n  `}
`,K=(0,A.memo)(({[s.Me.OPTIMIZATION_STATUS]:e})=>{const t=(0,A.useMemo)(()=>(e=>{switch(e){case s.CK.IN_PROGRESS:return j;case s.CK.FAILED:return B.A;case s.CK.COMPLETED:return b.A;default:return j}})(e),[e]);return(0,r.jsx)(y,{optimizationStatus:e,children:(0,r.jsx)(t,{color:U(e,(0,D.u)().themeName),size:"medium"})})}),G=(0,a.A)(i.A)`
  background-color: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
  border-radius: ${l.kc};
  padding: ${l.kc};
  flex-direction: column;
  gap: ${l.xO};
`,W=(0,a.A)(i.A)`
  justify-content: space-between;
  align-items: center;
`,V=(0,a.A)(i.A)`
  gap: ${l.kc};
  align-items: center;
`;var z=n(322596),F=n(794941),X=n(372261);const H=(0,a.A)(i.A)`
  width: 100%;
  height: 100%;
  flex-direction: column;
  thead {
    background: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
  }
  max-height: 351px;
  overflow: auto;
`;var Z,Y,Q;!function(e){e.DEVICE="DEVICE",e.VERSION="VERSION"}(Z||(Z={})),function(e){e.UPGRADABLE_DEVICES_COLUMN="upgradableDevicesColumn"}(Y||(Y={})),function(e){e.UPGRADABLE_DEVICE="upgradableDevice"}(Q||(Q={}));const q=({[Y.UPGRADABLE_DEVICES_COLUMN]:e})=>(0,r.jsx)(E.sA,{id:le[e]});var J=n(775250),ee=n(347625),te=n(974390);const ne=(e,t)=>{switch(e){case s.CK.COMPLETED:return m.Ay[`desktop-color-green-06-${t}`];case s.CK.FAILED:return m.Ay[`desktop-color-red-06-${t}`];case s.CK.IN_PROGRESS:return m.Ay[`desktop-color-ublue-06-${t}`];default:return m.Ay[`desktop-color-neutral-06-${t}`]}},re=(0,a.A)(i.A)`
  align-items: center;
  gap: ${l.YC};
  padding: 0 0 0 2px;
`,oe=(0,a.A)(i.A,(0,p.A)("optimizationStatus"))`
  width: ${l.Ln};
  min-width: ${l.Ln};
  height: ${l.Ln};
  min-height: ${l.Ln};
  justify-content: center;
  align-items: center;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    border: 1px solid ${((e,t)=>{switch(e){case s.CK.COMPLETED:return m.Ay[`desktop-color-green-02-${t}`];case s.CK.FAILED:return m.Ay[`desktop-color-red-02-${t}`];case s.CK.IN_PROGRESS:return m.Ay[`desktop-color-ublue-02-${t}`];default:return m.Ay[`desktop-color-neutral-06-${t}`]}})(e,t)};\n    background-color: ${((e,t)=>{switch(e){case s.CK.COMPLETED:return m.Ay[`desktop-color-green-01-${t}`];case s.CK.FAILED:return m.Ay[`desktop-color-red-01-${t}`];case s.CK.IN_PROGRESS:return m.Ay[`desktop-color-ublue-01-${t}`];default:return"transparent"}})(e,t)};\n    ${((e,t)=>e===s.CK.IN_PROGRESS?w("upgradableDevice",m.Ay[`desktop-color-ublue-06-${t}`]):"")(e,t)}\n  `};

  border-radius: ${l.fS};
  position: relative;
  margin: 4px;
`;var se=n(294381),ae=n(87449);const ie=(0,a.A)(i.A)`
  align-items: center;
  gap: ${l.YC};
`,le={[Z.DEVICE]:"COMMON_DEVICE",[Z.VERSION]:"COMMON_VERSION"},ce={[Z.DEVICE]:({[Y.UPGRADABLE_DEVICES_COLUMN]:e})=>(0,r.jsx)(q,{upgradableDevicesColumn:e}),[Z.VERSION]:({[Y.UPGRADABLE_DEVICES_COLUMN]:e})=>(0,r.jsx)(q,{upgradableDevicesColumn:e})},de={[Z.DEVICE]:{size:110,minSize:110,maxSize:1/0},[Z.VERSION]:{size:90,minSize:90,maxSize:1/0}},Ae={[Z.DEVICE]:({[Q.UPGRADABLE_DEVICE]:{[s.j0.MAC]:e,[s.j0.MODEL]:t,[s.j0.NAME]:n,[s.j0.OPTIMIZATION_STATUS]:o}})=>{const a=(0,A.useMemo)(()=>(e=>{switch(e){case s.CK.IN_PROGRESS:return j;case s.CK.FAILED:return B.A;case s.CK.COMPLETED:return b.A;default:return j}})(o),[o]);return(0,r.jsxs)(re,{children:[(0,r.jsx)(oe,{optimizationStatus:o,children:(0,r.jsx)(a,{color:ne(o,(0,D.u)().themeName),size:"small"})}),(0,r.jsx)(te.A,{model:t,width:20,height:20}),(0,r.jsx)(J.A,{isTruncated:!0,size:"medium",color:"text-2",children:(0,ee.Q)({mac:e,model:t,name:n})})]})},[Z.VERSION]:({[Q.UPGRADABLE_DEVICE]:{[s.j0.CURRENT_VERSION]:e,[s.j0.UPGRADABLE_VERSION]:t}})=>(0,r.jsxs)(ie,{children:[(0,r.jsx)(O.A,{size:"medium",color:"text-2",children:(0,ae.coerce)(e)?.version||(0,r.jsx)(E.sA,{id:"COMMON_UNKNOWN"})}),(0,r.jsx)(se.A,{size:"original",style:{transform:"rotate(-90deg)"}}),(0,r.jsx)(O.A,{size:"medium",color:"text-2",children:(0,ae.coerce)(t)?.version||(0,r.jsx)(E.sA,{id:"COMMON_UNKNOWN"})})]})},ue=Object.values(Z),Ee=e=>e,Ie=({header:{id:e}})=>ce[e]({[Y.UPGRADABLE_DEVICES_COLUMN]:e}),_e=e=>de[e],me=({column:{id:e},getValue:t})=>Ae[e]({[Q.UPGRADABLE_DEVICE]:t()}),Ce={stickyHeader:!0,columns:ue.map(e=>({id:e,accessorFn:Ee,header:Ie,cell:me,..._e(e),enableResizing:!1,enableSorting:!1}))},Oe=(0,A.memo)(({[s.Me.UPGRADABLE_DEVICES]:e})=>(0,r.jsx)(H,{children:(0,r.jsx)(X.A,{data:e,...Ce})})),De=(0,A.memo)(({[s.Me.ID]:e,[s.Me.UPGRADABLE_DEVICES]:t})=>e===s.iR.UPDATE_DEVICE_FIRMWARE&&t.length?(0,r.jsx)(Oe,{upgradable_devices:t}):null);var Re,Ne=n(699352);!function(e){e.ID="id",e.UPGRADABLE_DEVICES="upgradable_devices",e.IS_EXPANDED="isExpanded",e.SET_IS_EXPANDED="setIsExpanded"}(Re||(Re={}));const Se=(0,A.memo)(({[Re.IS_EXPANDED]:e,[Re.SET_IS_EXPANDED]:t})=>{const n=(0,A.useCallback)(()=>{t(e=>!e)},[t]);return(0,r.jsx)(Ne.A,{style:{cursor:"pointer",transform:"rotate("+(e?"0deg":"180deg")},onClick:n,size:"original"})}),pe=(0,A.memo)(({[Re.ID]:e,[Re.UPGRADABLE_DEVICES]:t,[Re.IS_EXPANDED]:n,[Re.SET_IS_EXPANDED]:o})=>(0,A.useMemo)(()=>e===s.iR.UPDATE_DEVICE_FIRMWARE&&t.length>0,[e,t.length])?(0,r.jsx)(Se,{isExpanded:n,setIsExpanded:o}):null),he=(0,A.memo)(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:t,[s.Me.UPGRADABLE_DEVICES]:n})=>{const[o,a]=(0,A.useState)(!1);return(0,r.jsxs)(G,{children:[(0,r.jsxs)(W,{children:[(0,r.jsxs)(V,{children:[(0,r.jsx)(K,{optimization_status:t}),(0,r.jsx)(O.A,{size:"medium",color:"text-2",children:F.V[e][z.a.GET_LABEL]({[z.K.UPGRADABLE_DEVICES]:n})})]}),(0,r.jsx)(pe,{id:e,upgradable_devices:n,isExpanded:o,setIsExpanded:a})]}),o?(0,r.jsx)(De,{id:e,upgradable_devices:n}):null]})}),ge=(0,A.memo)(({[s.Ss.ACTIONS]:e})=>(0,r.jsx)(k,{children:e.map(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:t,[s.Me.UPGRADABLE_DEVICES]:n=[]})=>(0,r.jsx)(he,{id:e,optimization_status:t,upgradable_devices:n},e))}));var Me=n(934899);const Te=(0,a.A)(i.A)`
  flex-direction: column;
`,Le=e=>{const t=e.find(({[s.Me.OPTIMIZATION_STATUS]:e})=>e===s.CK.IN_PROGRESS);if(t){if(t[s.Me.ID]===s.iR.UPDATE_DEVICE_FIRMWARE){const e=t[s.Me.UPGRADABLE_DEVICES].find(({[s.j0.OPTIMIZATION_STATUS]:e})=>e===s.CK.IN_PROGRESS);return e?(0,r.jsx)(E.sA,{id:F.V[s.iR.UPDATE_DEVICE_FIRMWARE][z.a.DESCRIPTION],values:{deviceName:(0,ee.Q)({mac:e[s.j0.MAC],model:e[s.j0.MODEL],name:e[s.j0.NAME]})}}):null}return(0,r.jsx)(E.sA,{id:F.V[t[s.Me.ID]][z.a.DESCRIPTION]})}return null},xe=(0,A.memo)(({[s.Ss.ACTIONS]:e})=>{const{percentage:t,optimizationInProgress:n}=(0,A.useMemo)(()=>{return{percentage:(t=e.reduce((e,{[s.Me.ID]:t,[s.Me.UPGRADABLE_DEVICES]:n=[]})=>t===s.iR.UPDATE_DEVICE_FIRMWARE?e+n.length:e+1,0),n=e.reduce((e,{[s.Me.ID]:t,[s.Me.UPGRADABLE_DEVICES]:n=[],[s.Me.OPTIMIZATION_STATUS]:r})=>t===s.iR.UPDATE_DEVICE_FIRMWARE?e+n.filter(({[s.j0.OPTIMIZATION_STATUS]:e})=>e!==s.CK.COMPLETED).length:e+(r!==s.CK.COMPLETED?1:0),0),t>0?100-Math.round(n/t*100):0),optimizationInProgress:g(e)};var t,n},[e]);return 100!==t&&n?(0,r.jsxs)(Te,{children:[(0,r.jsx)(Me.A,{value:t,variant:"primary",size:"large"}),(0,r.jsxs)(J.A,{isTruncated:!0,size:"medium",color:"text-3",children:[Le(e),"..."]})]}):null});var Pe=n(669439),$e=n(947414),fe=n(774366),ke=n(29472),be=n(571766);const ve=(0,n(401042).T7)("wifi-doctor/optimization"),je=`${ve}/start`,Be=`${ve}/stop`;var we,Ue=n(968021),ye=n(146215);!function(e){e.LABEL="label",e.ON_CLICK="onClick"}(we||(we={}));const Ke=(0,A.memo)(({[s.Ss.ACTIONS]:e,[s.Ss.IN_PROGRESS]:t,[s.Ss.IN_PROGRESS_IN_SITE]:n})=>{const o=(0,u.wA)(),[a,i]=(0,A.useState)(!1),{formatMessage:l}=(0,E.tz)(),c=(0,A.useCallback)(()=>{i(!0)},[]),d=(0,A.useCallback)(()=>{c(),o((0,ke.vB)(be.aC,null,null,fe.A.POST,je,{},null,{}))},[o,c]),I=(0,A.useCallback)(()=>{c(),o((0,ke.vB)(be.aC,null,null,fe.A.POST,Be,{},null,{}))},[o,c]),_=(0,A.useMemo)(()=>{return g(t=e)||M(t)?g(e)?s.CK.IN_PROGRESS:M(e)?s.CK.COMPLETED:void 0:s.CK.PENDING;var t},[e]),{[we.LABEL]:m,[we.ON_CLICK]:C}=(0,A.useMemo)(()=>{switch(_){case s.CK.PENDING:return{[we.LABEL]:l({id:"DASHBOARD_CLICK_TO_OPTIMIZE"}),[we.ON_CLICK]:d};case s.CK.IN_PROGRESS:return{[we.LABEL]:l({id:"COMMON_STOP"}),[we.ON_CLICK]:I};case s.CK.COMPLETED:return{[we.LABEL]:"",[we.ON_CLICK]:$e.P1};default:return{[we.LABEL]:"",[we.ON_CLICK]:$e.P1}}},[_,l,d,I]),O=(0,Ue.A)(_);(0,A.useEffect)(()=>{O!==_&&i(!1)},[_,O]);const D=n&&!t,R=(0,A.useMemo)(()=>_===s.CK.PENDING&&e.some(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:t})=>e===s.iR.UPDATE_DEVICE_FIRMWARE&&t===s.CK.PENDING),[e,_]),N=(0,A.useCallback)((e=$e.P1)=>(0,r.jsx)(L.A,{type:"button",size:"medium",onClick:e,isDisabled:D||a,children:m}),[m,D,a]);return m?(0,r.jsx)(Pe.A,{description:D?(0,r.jsx)(E.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_ONE_PER_SITE"}):void 0,children:R?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ye.A,{shouldCloseOnInteractOutside:!0,onConfirm:C,trigger:N(),title:(0,r.jsx)(E.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_TITLE"}),message:(0,r.jsx)(E.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_DESCRIPTION"})})}):N(C)}):null}),Ge=({activeItem:{[s.Ss.ACTIONS]:e,[s.Ss.IN_PROGRESS]:t,[s.Ss.IN_PROGRESS_IN_SITE]:n}})=>{const a=(e=>{const[t,n]=(0,A.useState)(e),r=(0,A.useRef)(e),o=(0,A.useRef)(null);return(0,A.useEffect)(()=>{o.current&&(clearTimeout(o.current),o.current=null);const t=new Map(r.current.map(e=>[e[s.Me.ID],e]));return e.some(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:n})=>{const r=t.get(e);return!!r&&r[s.Me.OPTIMIZATION_STATUS]!==n})?o.current=setTimeout(()=>{n(e),r.current=e},2500):(n(e),r.current=e),()=>{o.current&&clearTimeout(o.current)}},[e]),t})(e);return(0,r.jsxs)(c,{children:[(0,r.jsx)(C,{}),(0,r.jsx)(o.A,{children:(0,r.jsxs)(d,{children:[(0,r.jsx)(f,{actions:a}),(0,r.jsx)(ge,{actions:a}),(0,r.jsx)(xe,{actions:a}),(0,r.jsx)(Ke,{actions:a,in_progress:t,in_progress_in_site:n})]})})]})}},521376(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={}))},968021(e,t,n){n.d(t,{A:()=>o});var r=n(602086);const o=e=>{const t=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},372261(e,t,n){n.d(t,{A:()=>C});var r,o,s,a,i,l=n(274934),c=n(602086);!function(e){e.TABLE="table"}(r||(r={})),function(e){e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId"}(o||(o={})),function(e){e.ON_KEY_DOWN="onKeyDown",e.INCOMING_ROW_PROPS="incomingRowProps",e.HAS_ON_ROW_CLICK="hasOnRowClick"}(s||(s={})),function(e){e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex"}(a||(a={})),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={}));var d=n(199244),A=n(202730),u=n(147045);var E=n(521376);const I=e=>e?.children?.[1]?.children;var _=n(884144);const m=(0,n(247816).A)(_.A)`
  tr {
    outline: none;
  }
`,C=({data:e=[],rowProps:t,onRowClick:n,..._})=>{const C=(0,c.useRef)(null),O=(0,c.useRef)(null),{[o.ROW_ID_MAP_BY_INDEX]:D,[o.INDEX_MAP_BY_ROW_ID]:R}=(({[r.TABLE]:e})=>{const[t,n]=(0,c.useState)(()=>e?I(e):void 0);(0,c.useEffect)(()=>{e&&n(I(e))},[e]);const{[o.ROW_ID_MAP_BY_INDEX]:s,[o.INDEX_MAP_BY_ROW_ID]:a}=(0,c.useMemo)(()=>{const e=new Map,n=new Map,r=t?.length;if(t&&r)for(let o=0;o<r;o+=1){const r=t[o].getAttribute(d.i);r&&(e.set(r,o),n.set(o,r))}return{[o.ROW_ID_MAP_BY_INDEX]:e,[o.INDEX_MAP_BY_ROW_ID]:n}},[t]);return{[o.ROW_ID_MAP_BY_INDEX]:s,[o.INDEX_MAP_BY_ROW_ID]:a}})({[r.TABLE]:C.current}),N=(e=>{const t=(0,c.useRef)(new Map),n=(0,c.useRef)(void 0);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),S=(({[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]:o,[i.MULTI_SELECT_MODE]:s})=>{const a=(0,c.useCallback)(e=>{e.preventDefault()},[]),l=(0,c.useCallback)(()=>{const t=e.current.get(n.get(o.current+1));t&&(r?.(t),o.current+=1)},[n,o,r,e]),d=(0,c.useCallback)(()=>{const t=e.current.get(n.get(o.current-1));t&&(r?.(t),o.current-=1)},[n,o,r,e]);return(0,c.useCallback)((e,{id:n})=>e=>{if(!s&&r){const r=t.get(n);if(Number.isFinite(r))switch(null===o.current&&(o.current=r),e.key){case E.U.ARROW_DOWN:a(e),l();break;case E.U.ARROW_UP:a(e),d()}}},[r,o,s,a,t,l,d])})({[i.DATA_MAP_REFERENCE]:N,[i.ROW_ID_MAP_BY_INDEX]:D,[i.INDEX_MAP_BY_ROW_ID]:R,[i.INCOMING_ON_ROW_CLICK]:n,[i.LOCAL_CURRENT_INDEX]:O,[i.MULTI_SELECT_MODE]:_.multiSelectMode}),p=(({[s.INCOMING_ROW_PROPS]:e,[s.ON_KEY_DOWN]:t,[s.HAS_ON_ROW_CLICK]:n})=>(0,c.useCallback)((r,o)=>({...n?{[u.L]:A.b.SIDE_PANEL_TRIGGER}:{},...e?.(r,o),[d.i]:r.id,tabIndex:0,onKeyDown:t(r,o)}),[e,t,n]))({[s.INCOMING_ROW_PROPS]:t,[s.ON_KEY_DOWN]:S,[s.HAS_ON_ROW_CLICK]:Boolean(n)}),h=(({[a.INCOMING_ON_ROW_CLICK]:e,[a.LOCAL_CURRENT_INDEX]:t})=>{const n=(0,c.useCallback)(n=>{t.current=null,e?.(n)},[e,t]);return e?n:void 0})({[a.INCOMING_ON_ROW_CLICK]:n,[a.LOCAL_CURRENT_INDEX]:O});return(0,l.jsx)(m,{ref:C,data:e,rowProps:p,onRowClick:h,tableHeight:e.length?"100%":void 0,virtualize:!0,virtualizeColumn:!0,overscan:7,overscanColumn:1,stickyHeader:!0,..._})}},199244(e,t,n){n.d(t,{i:()=>r});const r="data-row-id"}}]);