"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[23920],{175875:(e,t,l)=>{l.d(t,{A:()=>i});var n=l(469733),a=l(296540),o=l(718073),c=l(592563),r=l(602021),s=l(294303);const i=(0,a.forwardRef)(({allowReadOnly:e,disabledReason:t,...l},i)=>{const E=(0,n.useSelector)(r.EL)&&!e;return a.createElement(s.A,{alignItems:"center"},a.createElement(o.A,{description:t,placement:"left"},a.createElement(c.A,{fontSize:"medium",type:"button",...l,isDisabled:E||l.isDisabled||!!t,ref:i})))})},197562:(e,t,l)=>{l.d(t,{A:()=>o});var n=l(71479),a=l(566723);const o=(0,n.A)("div")`
  height: 100%;
  flex: 1;
  overflow: scroll;
  margin-left: ${a.Ln};
  padding: ${a.Ln} 0 0 0;
`},267094:(e,t,l)=>{l.d(t,{A:()=>i});var n=l(296540),a=l(71479),o=l(294303);const c=(0,a.A)(o.A,{shouldForwardProp:e=>"isMaximized"!==e})`
  flex-direction: column;
  ${({isMaximized:e})=>e?"\n  min-height: 0;\n  ":""}
`;var r=l(362584),s=l(528552);const i=({children:e})=>{const{[r.A.IS_MAXIMIZED]:t}=(0,n.useContext)(s.A);return n.createElement(c,{isMaximized:t},e)}},496739:(e,t,l)=>{l.r(t),l.d(t,{default:()=>_n});var n=l(956347),a=l(469733),o=l(296540),c=l(136048),r=l(592510),s=l(834959),i=l(413357),E=l(582724),m=l(860923),u=l(627440),d=l(632169),A=l(998146),_=l(745667),C=l(83344),I=l(457311),O=l(634229),N=l(171073),T=l(765268),S=l(984652),D=l(328403),M=l(300477),p=l(742920),h=l(130851),g=l(398300),b=l(6176),f=l(465860),R=l(845030),v=l(675359),P=l(699784),V=l(477544),U=l(198494),y=l(780811),L=l(573363),k=l(959341),F=l(566723),B=l(349107),w=l(294303),x=l(691189);var G=l(215454),Y=l(851681),W=l(765562);const z=/[^\\\\]*$/g,H={"java.exe":"COMMON_JAVA","javaw.exe":"COMMON_JAVAW"},K=()=>{const e=(0,a.useDispatch)(),{formatMessage:t,formatList:l}=(0,P.tz)(),n=(0,a.useSelector)(G.iP);(0,o.useEffect)(()=>{n===Y.gy.WINDOWS&&e((0,x.Kd)("warnings","/v2/api/site/{site}/warnings")).then(({data:n})=>{const a=n.missing_windows_defender_firewall_rules?.map(({is_enabled:e,is_present:t,program:l})=>(!e||!t)&&H[l?.match(z)?.[0]]).filter(Boolean);a.length&&e((0,v.ox)({id:"DEVICE_ADOPTION_UPDATE_NETWORK_RULES",icon:p.C.warning,title:t({id:"DEVICE_ADOPTION_ACCESS_NEEDED"}),details:o.createElement(w.A,{marginBottom:F.YC},o.createElement("div",null,t({id:"DEVICE_ADOPTION_UPDATE_NETWORK_RULES"},{applications:l(a.map(e=>t({id:e}))),link:o.createElement(B.A.Simplified,{href:W.A.windowsFirewallRules,message:t({id:"COMMON_LEARN_MORE"})})}))),duration:0,onClose:()=>e((0,v.uU)("DEVICE_ADOPTION_UPDATE_NETWORK_RULES"))}))})},[])};var $=l(801081),j=l(189601),X=l(532419);const J=(0,j.WY)()((0,$.Mz)(X.ID,e=>e.map(({mac:e,adopted:t})=>({mac:e,adopted:t}))),e=>e),Q=/:/g,Z=()=>{const{formatMessage:e}=(0,P.tz)(),t=(0,n.W6)(),l=(0,a.useDispatch)(),c=(0,a.useSelector)(U.GP),r=(0,a.useSelector)(J),{devicesToAdopt:s}=t.location.state||{devicesToAdopt:null},i=(0,a.useSelector)(V.hX),E=(0,a.useSelector)(h.p),m=(0,a.useSelector)(L.A),u=(0,a.useSelector)(U.ay);return K(),(0,o.useEffect)(()=>{if(c&&s&&r.length)try{const t=JSON.parse(window.atob(s)).map(({mac:e})=>r.find(({mac:t,adopted:l})=>!l&&t.replace(Q,"").toUpperCase()===e.replace(Q,"").toUpperCase())).filter(Boolean);if(!t.length)throw new Error("ON_LOAD_BATCH_ADOPT_NO_DEVICES");{const n=t.map(({mac:e})=>e);(0,f.A)(n,{dispatch:l}).then(()=>{if(!i){const n=t.filter(y.G5G);n.length&&l((({device:e,dispatch:t,imagePath:l,deviceModelMap:n,selfTheme:a,formatMessage:c})=>{const r=(0,M.A)();return(0,v.ox)({icon:o.createElement("div",null,o.createElement(b.C,{model:e?.model,width:53,height:53,imagePath:l,deviceModelMap:n,theme:a})),title:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_TITLE",message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_MESSAGE",primaryButton:{label:c({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{t((0,v.uU)(r)),t((0,R.XP)({type:g.H.WIFI,id:k.R6}))}},translateTitle:!0},r)})({device:n[0],imagePath:E,deviceModelMap:m,selfTheme:u,dispatch:l,formatMessage:e}))}l((0,N.At)(n,!0))})}}catch(e){l((0,v.ox)({icon:p.C.danger,message:"ON_LOAD_BATCH_ADOPT_NO_DEVICES"}))}finally{t.replace({pathname:t.location.pathname,state:Object.assign(t.location.state,{devicesToAdopt:null})})}},[c,s,l,i,E,m,u,t,r,e]),null};var q=l(6510),ee=l(126457);const te=({device:{name:e,model:t,mac:l,upgrade_to_firmware:n},history:c,location:r})=>{const s=(0,a.useDispatch)(),i=(0,o.useCallback)(()=>{c.push(r.pathname.split("/device-upgrade")[0]),s((0,ee.AS)())},[c,r.pathname,s]),E=(0,o.useMemo)(()=>(0,q.Q)({name:e,mac:l,model:t}),[e,l,t]),m=(0,o.useCallback)(()=>{s((0,N.xv)({titleValues:{deviceName:E},messageValues:{deviceName:E,toVersion:n},onConfirm:()=>{s((0,N.Pv)(l,E))},onCancel:()=>{i()}}))},[n,l,E,s,i]);return(0,o.useEffect)(()=>(n?m():i(),()=>{i()}),[]),null},le=({history:e,location:t,match:l})=>{const n=(0,a.useSelector)((0,o.useMemo)(()=>(0,X._i)(l.params.id),[l.params.id]));return n?o.createElement(te,{device:n,history:e,location:t,match:l}):null};var ne=l(862296),ae=l(249304),oe=l(604482),ce=l(197562),re=l(816271),se=l(387098),ie=l(855019),Ee=l(105540),me=l(601021),ue=l(290234),de=l(962315),Ae=l(778851),_e=l(187483),Ce=l(293547),Ie=l(602197),Oe=l(211368);const Ne=(0,j.WY)()((0,$.Mz)(X.ID,e=>{const t=[],l=e.length;for(let n=0;n<l;n+=1){const{state:l,mac:a}=e[n];Oe.q[l]===Ie.g.UPGRADING&&t.push(a)}return t}),e=>e),Te=()=>{const e=(0,a.useSelector)(Ne),t=(0,a.useSelector)(_e.W1),l=(0,a.useSelector)(_e.YL),n=(0,a.useSelector)(_e.TP),c=(0,a.useSelector)(X.bc);(0,o.useEffect)(()=>{if(c){const a=(0,Ae.ns)(t,l,n);(0,Ce.UM)((0,de.A)((0,Ce.sQ)(a),e),a)}},[c,e,t,l,n])};var Se=l(606388),De=l(413786),Me=l(435325),pe=l(262086),he=l(200826),ge=l(789768),be=l(874098),fe=l(83604),Re=l(71479);const ve=(0,Re.A)("div")`
  width: 100%;
  table {
    position: relative;
    &:after {
      content: '';
      display: block;
      position: absolute;
      right: -16px;
      width: 16px;
      height: 1px;
    }
  }
`,Pe=({children:e,className:t})=>o.createElement(ve,{className:t},e);var Ve=l(269672),Ue=l(758649),ye=l(733712),Le=l(59308),ke=l(458973),Fe=l(684342),Be=l(674638),we=l(760980);const xe=({searchTags:e,hasAnyDevice:t,handleSearchReset:l,handleResetDisplayOptions:n})=>{switch(!0){case Boolean(e.length):return o.createElement(ye.A,{title:o.createElement(P.sA,{id:"COMMON_NO_MATCH"}),description:o.createElement(P.sA,{id:"DEVICE_EMPTY_SEARCH_NO_DEVICES_DETAILS",values:{button:o.createElement(Ue.A,{type:"button",variant:"inline",onClick:l},o.createElement(P.sA,{id:"COMMON_REMOVE_FILTERS_BUTTON_TEXT"}))}})});case t:return o.createElement(ye.A,{title:o.createElement(P.sA,{id:"COMMON_NO_MATCH"}),description:o.createElement(P.sA,{id:"DEVICE_EMPTY_FILTER_NO_DEVICES_DETAILS",values:{button:o.createElement(Ue.A,{type:"button",variant:"inline",onClick:n},o.createElement(P.sA,{id:"COMMON_RESET_THEM_BUTTON_TEXT"}))}})});default:return o.createElement(ye.A,{title:o.createElement(P.sA,{id:"COMMON_NO_DEVICES_TITLE"}),description:o.createElement(P.sA,{id:"COMMON_NO_DEVICES_DETAILS"})})}},Ge=({hasAnyDeviceSelector:e,searchModelName:t})=>{const l=(0,a.useSelector)(e),n=(0,a.useSelector)((0,o.useMemo)(()=>(0,Le.f)(t),[t])),c=(0,a.useDispatch)(),r=(0,o.useCallback)(()=>{c(e=>{e((0,we.D6)(Be.R));const t={[ae.l.UNIFI_DEVICE]:{columnSize:Fe.l[ae.l.UNIFI_DEVICE],initialColumns:pe.GO}};Fe.t.forEach(e=>{t[e]={columnSize:Fe.l[ae.l.UNIFI_DEVICE]}}),e((0,ge.zF)(t))})},[c]),s=(0,o.useCallback)(()=>{const e=document.querySelector("input[role=combobox]");e&&e.focus(),c((0,ke.sV)(t))},[c,t]);return o.createElement(w.A,{width:"100%",flexDirection:"column"},o.createElement(xe,{searchTags:n,hasAnyDevice:l,handleSearchReset:s,handleResetDisplayOptions:r}))},Ye=(0,o.memo)(()=>o.createElement(w.A,{height:"100%",padding:`${F.Ln} ${F.Ln} ${F.S2}`,overflow:"auto",flexDirection:"column"},o.createElement(Pe,null,o.createElement(fe.A,{data:[],columns:(0,ue.D)()})),o.createElement(Ge,{hasAnyDeviceSelector:Me.yW,searchModelName:Ve.U4.UNIFI_DEVICES})));var We=l(902923),ze=l(598274),He=l(602021),Ke=l(837612);const $e=(0,Re.A)("div")`
  position: absolute;
  top: -${F.xO};
  bottom: -${F.xO};
  left: calc(100% - 400px); /* The restart confirm dialog width */
  right: 0;
`,je=(0,Re.A)("div")`
  z-index: 1;
`,Xe=(0,o.memo)(({mac:e})=>{const t=(0,a.useSelector)((0,o.useMemo)(()=>(0,X.tG)(e),[e])),[l,n]=(0,o.useState)(!1);return o.createElement(w.A,{padding:F.YC,gap:F.kc,position:"relative",onMouseLeave:l?()=>{n(!1)}:void 0},o.createElement(je,null,o.createElement(ze.A,{device:t})),o.createElement(je,null,o.createElement(We.i,{device:t,isConfirmOpen:l,setIsConfirmOpen:n})),l?o.createElement($e,null):null)}),Je=({rowId:e})=>o.createElement(Xe,{mac:e}),Qe=e=>e.product_line===De.p1.NETWORK&&(0,Ke.YP)(e)?{...e,_rowHoverContent:Je}:e,Ze=e=>(0,a.useSelector)(He.EL)?e:e.map(Qe);var qe=l(873010),et=l(927099),tt=l(318787),lt=l(29896),nt=l(415246),at=l(305988);const ot=[pe.o$.STATUS_BALL,pe.o$.TYPE,pe.o$.NAME],ct=at.W2[nt.xz.TABLES][ae.l.UNIFI_DEVICE].columns;const rt=l(984297).E,st={overflow:"visible",padding:"0px"},it=(0,Re.A)("div")`
  &:not(:first-child) {
    margin-top: ${F.Ln};
  }
  table {
    margin-top: ${F.Ln};
  }
`,Et=({tableType:e,icon:t,header:l,data:n,columns:a,columnVisibility:c,activeRows:r,onRowClick:s,onColumnDrop:i})=>{const E=(0,o.useRef)(null),[m,u]=(0,lt.A)(e),[d,A]=(0,tt.A)(e);return n.length?o.createElement(it,{ref:E},o.createElement(w.A,{alignItems:"center",position:"sticky",left:0,width:"fit-content"},t||null,o.createElement(et.A,{size:"body",color:"tertiary"},l)),o.createElement(fe.A,{className:rt,data:n,columns:a,rowStyle:F.gc,columnVisibility:c,columnPinningLeftState:ot,onRowClick:s,activeRows:r,onColumnSizingChange:u,initialColumnSize:m,onSort:A,sorting:d,virtualize:!0,parentRef:E,columnDnD:!0,staticDnD:ot,onColumnDrop:i,tableHeight:"100%",virtualizeColumn:!0,overscanColumn:1})):null},mt={style:{marginRight:F.xO},variant:"bgRoundedSquare",size:"large"},ut={[ae.l.UNIFI_DEVICE_NETWORK]:{icon:(0,o.createElement)(qe.m8[De.p1.NETWORK],mt)},[ae.l.UNIFI_DEVICE_PROTECT]:{icon:(0,o.createElement)(qe.m8[De.p1.PROTECT],mt)},[ae.l.UNIFI_DEVICE_TALK]:{icon:(0,o.createElement)(qe.m8[De.p1.TALK],mt)},[ae.l.UNIFI_DEVICE_ACCESS]:{icon:(0,o.createElement)(qe.m8[De.p1.ACCESS],mt)},[ae.l.UNIFI_DEVICE_CONNECT]:{icon:(0,o.createElement)(qe.m8[De.p1.CONNECT],mt)},[ae.l.UNIFI_DEVICE_APOLLO]:{icon:(0,o.createElement)(qe.m8[De.p1.APOLLO],mt)},[ae.l.UNIFI_DEVICE_DRIVE]:{icon:(0,o.createElement)(qe.m8[De.p1.DRIVE],mt)},[ae.l.UNIFI_DEVICE_UNMANAGED]:{}},dt=Object.keys(ut),At=({columnVisibility:e,columns:t,activeRows:l,onRowClick:n,onColumnDrop:c})=>{const r=(0,a.useSelector)(Me.Q9),s=(0,a.useSelector)(Me.L_),i=(0,a.useSelector)(Me.mw),E=(0,a.useSelector)(Me.yQ),m=(0,a.useSelector)(Me.AL),u=(0,a.useSelector)(Me.Jz),d=(0,a.useSelector)(Me.WT),A=(0,a.useSelector)(Me.gi),_=Ze(r),C={[ae.l.UNIFI_DEVICE_NETWORK]:_,[ae.l.UNIFI_DEVICE_PROTECT]:s,[ae.l.UNIFI_DEVICE_TALK]:i,[ae.l.UNIFI_DEVICE_ACCESS]:E,[ae.l.UNIFI_DEVICE_CONNECT]:m,[ae.l.UNIFI_DEVICE_APOLLO]:u,[ae.l.UNIFI_DEVICE_DRIVE]:d,[ae.l.UNIFI_DEVICE_UNMANAGED]:A},I=(0,o.useMemo)(()=>t.filter(({id:e})=>e!==pe.o$.APPLICATION),[t]);return o.createElement(o.Fragment,null,dt.map(t=>o.createElement(Et,{tableType:t,key:t,icon:ut[t].icon,header:t!==ae.l.UNIFI_DEVICE_UNMANAGED?o.createElement(P.sA,{id:"UNIFI_NUMBER_OF_DEVICES",values:{number:C[t].length}}):o.createElement(P.sA,{id:"UNIFI_DEVICE_HEADER_UNIFI_UNMANAGED"}),data:C[t],columns:I,columnVisibility:e,activeRows:l,onRowClick:n,onColumnDrop:c})))},_t=(0,$.Mz)(_e.W1,Me.Hj,(e,t)=>!(e||t>50));var Ct,It=l(736388);!function(e){e.DEVICES="devices"}(Ct||(Ct={}));var Ot=l(861878),Nt=l(17441),Tt=l(9535),St=l(445054),Dt=l(580176),Mt=l(118033),pt=l(960407);const ht=(0,o.memo)(()=>{const e=(0,n.W6)(),{search:t}=(0,n.zy)(),l=(0,a.useDispatch)(),c=(0,a.useSelector)(He.EL),r=(0,a.useSelector)(pt.LK),s=(0,o.useCallback)(()=>{l((0,R.XP)({type:g.H.DEVICE_UPDATES,id:"any"}))},[l]);return(0,o.useEffect)(()=>{const l=new URLSearchParams(t);l.has(k.Ej)&&(setTimeout(s,100),l.delete(k.Ej),e.push({search:l.toString()}))},[e,t,s]),c?null:o.createElement(Ot.A,{onPress:s,labelId:"COMMON_DEVICE_UPDATES_AND_SETTINGS",disabled:r===g.H.DEVICE_UPDATES})}),gt=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(Mt.fG),l=(0,o.useCallback)(()=>{e((0,we.D6)(Be.R))},[e]),n=(0,St.A)({leftFilterPageId:oe.g1.DEVICES,leftFilterColumnsId:Ct.DEVICES}),c=(0,o.useCallback)(()=>{e((0,Dt.GD)({leftFilterPageId:oe.g1.DEVICES,leftFilterColumnsId:Ct.DEVICES}))},[e]);return o.createElement(Nt.A,null,o.createElement(Tt.A,{onClear:l,disabled:t}),o.createElement(ht,null),o.createElement(Ot.A,{onPress:c,labelId:"COMMON_CUSTOMIZE_COLUMNS",disabled:n}))});var bt=l(312583);const ft=Object.values(pe.o$).filter(e=>e!==pe.o$.STATUS_BALL),Rt=(0,o.memo)(()=>o.createElement(bt.A,{leftFilterPageId:oe.g1.DEVICES,columns:ft,columnLabels:pe.xJ,tableType:ae.l.UNIFI_DEVICE}));var vt=l(264863),Pt=l(267094),Vt=l(1758),Ut=l(445535),yt=l(235746),Lt=l(972735);const kt=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(Mt.O2),l=(0,a.useSelector)(X.BS),n=(0,o.useCallback)(t=>{Array.isArray(t)&&e((0,we.ml)(t))},[e]),c=(0,o.useMemo)(()=>t[0]!==t[1]?o.createElement(P.sA,{id:"COMMON_GENERIC_FROM_TO",values:{from:Lt.DL[t[0]],to:Lt.DL[t[1]]}}):(()=>{switch(t[0]){case Lt.WV[yt.v.MIN].value:return o.createElement(P.sA,{id:"COMMON_NONE"});case Lt.WV[yt.v.ONE_DAY].value:case Lt.WV[yt.v.THREE_DAYS].value:case Lt.WV[yt.v.ONE_WEEK].value:case Lt.WV[yt.v.ONE_MONTH].value:return Lt.DL[t[0]];case Lt.WV[yt.v.ALL].value:return o.createElement(P.sA,{id:"COMMON_ALL"});default:return null}})(),[t]);return l?o.createElement(Ut.A,{label:o.createElement(P.sA,{id:"COMMON_UPTIME"}),hasPaddedContent:!0},o.createElement(Vt.A,{value:t,onChange:n,minValue:Lt.KP,maxValue:Lt.SQ,marks:Lt.E7,step:Lt.m7,labelEnd:c,caption:o.createElement(P.sA,{id:"COMMON_MIN"}),captionEnd:o.createElement(P.sA,{id:"COMMON_ALL"})})):null});var Ft,Bt=l(156870),wt=l(773033);!function(e){e.ID="id",e.NAME="name",e.COUNT="count"}(Ft||(Ft={}));var xt=l(291357),Gt=l(241212);const Yt={[xt.b.GATEWAY]:{id:xt.b.GATEWAY,condition:Gt.xi,label:"COMMON_GATEWAY",sortIndex:0},[xt.b.SWITCH]:{id:xt.b.SWITCH,condition:Gt.JM,label:"COMMON_SWITCH",sortIndex:1},[xt.b.ACCESS_POINT]:{id:xt.b.ACCESS_POINT,condition:Gt.xn,label:"COMMON_ACCESS_POINT",sortIndex:2},[xt.b.MODEM]:{id:xt.b.MODEM,condition:Gt.pI,label:"COMMON_MODEM",sortIndex:3},[xt.b.CLOUD_KEY]:{id:xt.b.CLOUD_KEY,condition:Gt.FY,label:"COMMON_CLOUD_KEY",sortIndex:4},[xt.b.SMART_POWER]:{id:xt.b.SMART_POWER,condition:Gt.LW,label:"COMMON_SMART_POWER",sortIndex:5},[xt.b.BRIDGE]:{id:xt.b.BRIDGE,condition:Gt.kZ,label:"COMMON_BRIDGE",sortIndex:6},[xt.b.CELLULAR_MODEM]:{id:xt.b.CELLULAR_MODEM,condition:Gt.pJ,label:"COMMON_CELLULAR_MODEM",sortIndex:7},[xt.b.ENTERPRISE_AUDIO_VIDEO]:{id:xt.b.ENTERPRISE_AUDIO_VIDEO,condition:Gt.H0,label:"COMMON_ENTERPRISE_AUDIO_VIDEO",sortIndex:8},[xt.b.NON_NETWORK_DEVICES]:{id:xt.b.NON_NETWORK_DEVICES,condition:Gt.hg,label:"COMMON_NON_NETWORK_DEVICES",sortIndex:9}},Wt=(e,t)=>Yt[e[Ft.ID]].sortIndex-Yt[t[Ft.ID]].sortIndex,zt=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),{formatMessage:t}=(0,P.tz)(),l=(0,a.useSelector)((0,o.useMemo)(()=>(e=>(0,j.WY)()((0,$.Mz)(Me.Qi,(0,Me.a5)([xt.K.TYPES]),(t,l)=>{const n={},a=Object.values(Yt),o=t.length;for(let l=0;l<o;l+=1){const o=t[l],c=a.filter(({condition:e})=>e(o));for(let t=0;t<c.length;t+=1){const{id:l,label:a}=c[t];l&&!n[l]&&(n[l]={[Ft.ID]:l,[Ft.NAME]:e({id:a}),[Ft.COUNT]:0})}}const c=l.length;for(let e=0;e<c;e+=1){const t=l[e],o=a.filter(({condition:e})=>e(t));for(let e=0;e<o.length;e+=1){const{id:t}=o[e];t&&n[t]&&(n[t]={...n[t],[Ft.COUNT]:n[t][Ft.COUNT]+1})}}return n}),e=>e))(t),[t])),n=(0,a.useSelector)(Mt.Vs),c=(0,o.useMemo)(()=>Object.values(l),[l]),r=(0,o.useMemo)(()=>c.map(e=>e[Ft.ID]),[c]),s=(0,o.useMemo)(()=>new Set(n),[n]),i=(0,o.useMemo)(()=>new Set(c.filter(e=>!n.includes(e[Ft.ID])&&!l[e[Ft.ID]][Ft.COUNT]).map(e=>e[Ft.ID])),[c,l,n]),E=(0,o.useCallback)(t=>{e((0,we.H_)(Array.from(t)))},[e]),m=(0,o.useMemo)(()=>c.sort(Wt).map(e=>({id:e[Ft.ID],type:"CHECKBOX",title:e[Ft.NAME],checkboxProps:{count:e[Ft.COUNT],isTruncated:!0},children:[]})),[c]);return(0,wt.A)(n,r,we.H_),c.length?o.createElement(Ut.A,{label:o.createElement(P.sA,{id:"COMMON_UNIFI_DEVICES"})},o.createElement(Bt.A.Simplified,{items:m,selectedKeys:s,disabledKeys:i,onSelectionChange:E})):null});var Ht,Kt=l(784465),$t=l(888964),jt=l(893594),Xt=l(108666),Jt=l(659552),Qt=l(801156);!function(e){e.ID="id",e.NAME="name",e.COUNT="count"}(Ht||(Ht={}));const Zt=(0,j.WY)()((0,$.Mz)((0,Me.a5)([xt.K.TAGS]),Jt._,(e,t)=>{const l={},n=t.length;for(let e=0;e<n;e+=1){const n=t[e];l[n[Qt.Ko._ID]]={[Ht.ID]:n[Qt.Ko._ID],[Ht.NAME]:n[Qt.Ko.NAME],[Ht.COUNT]:0}}const a=e.length;for(let t=0;t<a;t+=1){const n=e[t];if(n.device_tags?.length){const e=n.device_tags.length;for(let t=0;t<e;t+=1){const e=n.device_tags[t];l[e]&&(l[e]={...l[e],[Ht.COUNT]:l[e][Ht.COUNT]+1})}}}return l}),e=>e),qt=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(U.Io),l=(0,a.useSelector)(Zt),n=(0,a.useSelector)(Mt.pM),c=(0,o.useMemo)(()=>Object.values(l),[l]),s=(0,o.useMemo)(()=>c.map(e=>e[Ht.ID]),[c]),i=(0,o.useMemo)(()=>c.sort((e,t)=>e[Ht.NAME].localeCompare(t[Ht.NAME])),[c]),m=(0,o.useMemo)(()=>i.map(e=>({id:e[Ht.ID],type:"CHECKBOX",title:e[Ht.NAME],checkboxProps:{count:e[Ht.COUNT],isTruncated:!0},children:[]})),[i]),u=(0,o.useMemo)(()=>n.length===c.length?"all":new Set(n),[n,c]),d=(0,o.useMemo)(()=>new Set(c.filter(e=>!n.includes(e[Ht.ID])&&!l[e[Ht.ID]][Ht.COUNT]).map(e=>e[Ht.ID])),[c,l,n]),A=(0,o.useCallback)(t=>{e((0,we.xD)(Array.from(t)))},[e]),_=(0,o.useCallback)(t=>{e((0,we.xD)(Array.from(t)))},[e]),C=(0,o.useCallback)(()=>{e((0,we.xD)([]))},[e]);return(0,wt.A)(n,s,we.xD),(0,E.A)([(0,Kt.uu)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})],o.createElement(jt.A,{leftFilterPanelId:$t.R.DEVICES_TAGS,items:m,selectedKeys:u,disabledKeys:d,onSelectionChange:A,onSelectAll:_,onDeselectAll:C,labelId:"COMMON_DEVICE_TAGS",labelBubbleId:t?"COMMON_FABRIC":void 0,creatorMode:!0,tagId:Xt.a.DEVICES}))});var el;!function(e){e.ID="id",e.NAME="name",e.COUNT="count"}(el||(el={}));var tl=l(243700),ll=l(886374);const nl={[tl.d.ONLINE]:{id:tl.d.ONLINE,condition:ll.I0,label:"COMMON_ONLINE",sortIndex:0},[tl.d.ISOLATED]:{id:tl.d.ISOLATED,condition:ll.aR,label:"COMMON_ISOLATED",sortIndex:1},[tl.d.UPDATE_AVAILABLE]:{id:tl.d.UPDATE_AVAILABLE,condition:ll.NE,label:"COMMON_UPDATE_AVAILABLE",sortIndex:2},[tl.d.CONNECTION_INTERRUPTED]:{id:tl.d.CONNECTION_INTERRUPTED,condition:ll.$t,label:"COMMON_DEVICE_STATE_CONNECTION_INTERRUPTED",sortIndex:3},[tl.d.PENDING_ADOPTION]:{id:tl.d.PENDING_ADOPTION,condition:ll.CS,label:"COMMON_DEVICE_STATE_PENDING",sortIndex:4},[tl.d.MANAGED_BY_ANOTHER_CONSOLE]:{id:tl.d.MANAGED_BY_ANOTHER_CONSOLE,condition:ll.Br,label:"COMMON_DEVICE_STATE_MANAGED_BY_OTHER",sortIndex:5},[tl.d.OFFLINE]:{id:tl.d.OFFLINE,condition:ll.gf,label:"COMMON_OFFLINE",sortIndex:6}},al=(e,t)=>nl[e[el.ID]].sortIndex-nl[t[el.ID]].sortIndex,ol=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),{formatMessage:t}=(0,P.tz)(),l=(0,a.useSelector)((0,o.useMemo)(()=>(e=>(0,j.WY)()((0,$.Mz)(Me.Qi,(0,Me.a5)([xt.K.STATUS]),(t,l)=>{const n={},a=Object.values(nl),o=t.length;for(let l=0;l<o;l+=1){const o=t[l],c=a.filter(({condition:e})=>e(o));for(let t=0;t<c.length;t+=1){const{id:l,label:a}=c[t];l&&!n[l]&&(n[l]={[el.ID]:l,[el.NAME]:e({id:a}),[el.COUNT]:0})}}const c=l.length;for(let e=0;e<c;e+=1){const t=l[e],o=a.filter(({condition:e})=>e(t));for(let e=0;e<o.length;e+=1){const{id:t}=o[e];t&&n[t]&&(n[t]={...n[t],[el.COUNT]:n[t][el.COUNT]+1})}}return n}),e=>e))(t),[t])),n=(0,a.useSelector)(Mt.gm),c=(0,o.useMemo)(()=>Object.values(l),[l]),r=(0,o.useMemo)(()=>c.map(e=>e[el.ID]),[c]),s=(0,o.useMemo)(()=>c.sort(al).map(e=>({id:e[el.ID],type:"CHECKBOX",title:e[el.NAME],checkboxProps:{count:e[el.COUNT],isTruncated:!0},children:[]})),[c]),i=(0,o.useMemo)(()=>new Set(n),[n]),E=(0,o.useMemo)(()=>new Set(c.filter(e=>!n.includes(e[el.ID])&&!l[e[el.ID]][el.COUNT]).map(e=>e[el.ID])),[n,l,c]),m=(0,o.useCallback)(t=>{e((0,we.ym)(Array.from(t)))},[e]);return(0,wt.A)(n,r,we.ym),c.length?o.createElement(Ut.A,{label:o.createElement(P.sA,{id:"COMMON_STATUS"})},o.createElement(Bt.A.Simplified,{items:s,selectedKeys:i,disabledKeys:E,onSelectionChange:m})):null});var cl=l(974546),rl=l(451919),sl=l(451860),il=l(840279),El=l(639775),ml=l(879077);const ul=["mac","search_type","search_status","search_name","search_model_name","search_ip","search_connection","search_network","search_experience","search_product_line",...sl.r],dl=new cl.A.Document({tokenize:"full",cache:500,encode:El.Rd,document:{store:ul,id:"mac",index:ul}}),Al=(0,o.memo)(()=>{const{location:{state:e}}=(0,n.W6)(),t=(0,o.useRef)(e?.[Ve.Gd.SEARCH_INITIAL_TAGS]),{formatMessage:l}=(0,P.tz)(),[c,r]=(0,o.useState)(!1),s=(0,o.useCallback)(()=>r(!0),[]),i=(0,o.useCallback)(()=>r(!1),[]),E=(0,a.useSelector)((0,o.useMemo)(()=>(0,Le.f)(Ve.U4.UNIFI_DEVICES),[])),m=(0,a.useSelector)((0,o.useMemo)(()=>Boolean(E.length)||Boolean(t.current)||c?(0,Me.X$)(l):il.A,[l,c,t,E.length])),u=(0,o.useMemo)(()=>((e,t)=>[(0,El.Vj)(e,[["search_type",t({id:"COMMON_ACCESS_POINT"})],["search_type",t({id:"COMMON_GATEWAY"})],["search_type",t({id:"COMMON_SWITCH"})]]),(0,El.Vj)(e,[["search_status",t({id:"COMMON_ONLINE"})],["search_status",t({id:"COMMON_OFFLINE"})],["search_status",t({id:"COMMON_DEVICE_STATE_PENDING"})]]),(0,El.Vj)(e,[["search_connection",t({id:"COMMON_WIRED"})]]),(0,El.Vj)(e,[["search_product_line","UniFi Protect"],["search_product_line","UniFi Access"],["search_product_line","UniFi Network"]])].filter(Boolean))(m,l),[m,l]);return o.createElement(ml.A,{lsKey:rl.UZ.UNIFI_DEVICES_SEARCH,getInitialSuggestions:u,searchModelName:Ve.U4.UNIFI_DEVICES,searchIndex:dl,enabledColumns:ul,recordIdKey:"mac",onFocus:s,onBlur:i,initialTags:t.current,records:m})});var _l;!function(e){e.ID="id",e.NAME="name",e.COUNT="count"}(_l||(_l={}));const Cl=(0,j.WY)()((0,$.Mz)(Me.Qi,(0,Me.a5)([xt.K.MODELS]),(e,t)=>{const l={},n=e.length;for(let t=0;t<n;t+=1){const n=e[t];n.model&&!l[n.model]&&(l[n.model]={[_l.ID]:n.model,[_l.NAME]:(0,q.Lm)(n.model),[_l.COUNT]:0})}const a=t.length;for(let e=0;e<a;e+=1){const n=t[e];n.model&&l[n.model]&&(l[n.model]={...l[n.model],[_l.COUNT]:l[n.model][_l.COUNT]+1})}return l}),e=>e),Il=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(Cl),l=(0,a.useSelector)(Mt.Kt),n=(0,o.useMemo)(()=>Object.values(t),[t]),c=(0,o.useMemo)(()=>n.map(e=>e[_l.ID]),[n]),r=(0,o.useMemo)(()=>l.length===n.length?"all":new Set(l),[l,n]),s=(0,o.useMemo)(()=>new Set(n.filter(e=>!l.includes(e[_l.ID])&&!t[e[_l.ID]][_l.COUNT]).map(e=>e[_l.ID])),[n,t,l]),i=(0,o.useCallback)(t=>{e((0,we.mc)(Array.from(t)))},[e]),E=(0,o.useMemo)(()=>n.sort((e,t)=>t[_l.COUNT]-e[_l.COUNT]).map(e=>({id:e[_l.ID],type:"CHECKBOX",title:e[_l.NAME],checkboxProps:{count:e[_l.COUNT],isTruncated:!0},children:[]})),[n]),m=(0,o.useCallback)(t=>{e((0,we.mc)(Array.from(t)))},[e]),u=(0,o.useCallback)(()=>{e((0,we.mc)([]))},[e]);return(0,wt.A)(l,c,we.mc),n.length?o.createElement(Ut.A,{id:$t.R.DEVICES_MODELS,label:o.createElement(P.sA,{id:"COMMON_MODELS"})},o.createElement(Bt.A,{id:$t.R.DEVICES_MODELS,items:E,selectedKeys:r,disabledKeys:s,onSelectionChange:i,onSelectAll:m,onDeselectAll:u})):null});var Ol=l(109558),Nl=l(891891);const Tl=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(Mt.EZ),l=(0,a.useSelector)(X.BS),n=(0,o.useCallback)(t=>{Array.isArray(t)&&e((0,we.Es)(t))},[e]),c=(0,o.useMemo)(()=>t[0]!==t[1]?o.createElement(P.sA,{id:"COMMON_GENERIC_FROM_TO",values:{from:Nl.lc[t[0]],to:Nl.lc[t[1]]}}):(()=>{switch(t[0]){case Nl.el[Ol.f.MIN].value:return o.createElement(P.sA,{id:"COMMON_NONE"});case Nl.el[Ol.f.THREE_DAYS].value:case Nl.el[Ol.f.ONE_WEEK].value:case Nl.el[Ol.f.ONE_MONTH].value:case Nl.el[Ol.f.SIX_MONTHS].value:case Nl.el[Ol.f.ONE_YEAR].value:return Nl.lc[t[0]];case Nl.el[Ol.f.ALL].value:return o.createElement(P.sA,{id:"COMMON_ALL"});default:return null}})(),[t]);return l?o.createElement(Ut.A,{label:o.createElement(P.sA,{id:"DEVICE_INSTALL_DATE"}),hasPaddedContent:!0},o.createElement(Vt.A,{value:t,onChange:n,minValue:Nl.Ao,maxValue:Nl.gv,marks:Nl.mi,step:Nl.CX,labelEnd:c,caption:o.createElement(P.sA,{id:"COMMON_MIN"}),captionEnd:o.createElement(P.sA,{id:"COMMON_ALL"})})):null});var Sl,Dl=l(595235),Ml=l(306644),pl=l(231226);!function(e){e.READY_TO_ADOPT="READY_TO_ADOPT",e.READY_TO_UPDATE="READY_TO_UPDATE",e.SMART_BATTERY_ASSIGNMENT="SMART_BATTERY_ASSIGNMENT",e.SMART_BATTERY_ADOPTION="SMART_BATTERY_ADOPTION"}(Sl||(Sl={}));const hl=(0,$.Mz)(pl.Eo,X.X7,(e,t)=>t.length>0&&(!e||e.limit>=e.adopted+t.length)),gl=(0,$.Mz)(X.J1,e=>e>0),bl=(0,$.Mz)(X.G7,X.Vo,(e,t)=>Boolean(e)&&Boolean(t)),fl=(0,$.Mz)(X.F4,X.Vo,(e,t)=>Boolean(e)&&Boolean(t)),Rl=(0,$.Mz)(hl,gl,bl,fl,(e,t,l,n)=>({[Sl.READY_TO_ADOPT]:e,[Sl.READY_TO_UPDATE]:t,[Sl.SMART_BATTERY_ADOPTION]:l,[Sl.SMART_BATTERY_ASSIGNMENT]:n}));var vl=l(217439),Pl=l(592563),Vl=l(776309);const Ul="DEVICE_BANNER_MAIN_ICON_CLASSNAME";var yl=l(822336);const Ll=(0,Re.A)(w.A)`
  flex-direction: column;
  gap: ${F.kc};
  .${Ul} {
    margin-right: ${F.kc};
  }
`,kl=(0,Re.A)(w.A)`
  background: ${({theme:{themeName:e}})=>yl.Ay[`desktop-color-neutral-01-${e}`]};
  padding: 6px ${F.kc};
  width: 100%;
`,Fl=(0,Re.A)(w.A)`
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
`;var Bl;!function(e){e.ADOPTION="adoption",e.ASSIGNMENT="assignment"}(Bl||(Bl={}));const wl={[Bl.ADOPTION]:{smartBatteriesSelector:X.Nz,smartBatteriesMacsSelector:X.RL,title:"DEVICE_ACTIONS_ADOPT_DEVICE_READY_TO_ADOPT",actionLabel:"COMMON_ADOPT"},[Bl.ASSIGNMENT]:{smartBatteriesSelector:X.CH,smartBatteriesMacsSelector:X.k,title:"DEVICE_ACTIONS_ADOPT_DEVICE_READY_TO_ASSIGN",actionLabel:"COMMON_ASSIGN"}},xl=({smartBatteryNotificationType:e,onClick:t,deviceBannersExpanded:l})=>{const n=(0,a.useDispatch)(),{smartBatteriesSelector:c,smartBatteriesMacsSelector:r,title:s,actionLabel:i}=(0,o.useMemo)(()=>wl[e],[e]),E=(0,a.useSelector)(c),m=(0,a.useSelector)(r),u=(0,o.useCallback)(()=>{t({[Bl.ADOPTION]:Sl.SMART_BATTERY_ADOPTION,[Bl.ASSIGNMENT]:Sl.SMART_BATTERY_ASSIGNMENT}[e]),n((0,ee.to)({modalType:Vl.A.ASSIGN_SMART_BATTERY,modalProps:{activeMacs:m}}))},[n,m,t,e]);return o.createElement(o.Fragment,null,o.createElement(b.A,{model:E[0].model,width:24,height:24,className:Ul}),o.createElement(Fl,null,o.createElement(vl.A,null,o.createElement(P.sA,{id:s,values:{deviceName:(0,q.Q)(E[0]),count:E.length,b:P.b}})),l?o.createElement(Pl.A,{type:"button",fontSize:"medium",onPress:u},o.createElement(P.sA,{id:i})):null))},Gl=({onClick:e,deviceBannersExpanded:t})=>o.createElement(xl,{smartBatteryNotificationType:Bl.ASSIGNMENT,onClick:e,deviceBannersExpanded:t}),Yl=({onClick:e,deviceBannersExpanded:t})=>o.createElement(xl,{smartBatteryNotificationType:Bl.ADOPTION,onClick:e,deviceBannersExpanded:t});var Wl=l(951272),zl=l(271856),Hl=l(673582),Kl=l(302167),$l=l(945362);const jl=(0,o.memo)(({onClick:e,deviceBannersExpanded:t})=>{const l=(0,a.useDispatch)(),n=(0,a.useSelector)(X.J1),c=(0,a.useSelector)(Kl.$5),r={initialValues:{...c},onSubmit:e=>{c.auto_upgrade!==e.auto_upgrade&&l((0,I.G2)(e))}},s=(0,o.useCallback)(()=>{l((0,$l.O)()),e(Sl.READY_TO_UPDATE)},[l,e]),i=(0,o.useCallback)((e,t)=>()=>{e("auto_upgrade",!0),t()},[]);return o.createElement(o.Fragment,null,o.createElement(Hl.A,{size:"original",isActive:!0,className:Ul}),o.createElement(Fl,null,o.createElement(vl.A,{size:"medium"},o.createElement(P.sA,{id:"DEVICE_ACTIONS_BULK_UPDATE",values:{count:n}})),t?o.createElement(Wl.l1,{...r},({handleSubmit:e,setFieldValue:t})=>o.createElement(w.A,{justifyContent:"center",alignItems:"flex-start",flexDirection:"column"},o.createElement(zl.A,{cursorType:"pointer",noWrap:!0,description:o.createElement(P.sA,{id:"DEVICE_UPDATE_ALL_TOOLTIP"})},o.createElement(Pl.A,{type:"button",fontSize:"medium",onPress:s},o.createElement(P.sA,{id:n>1?"COMMON_ACTION_UPDATE_ALL":"COMMON_ACTION_UPDATE"}))),c.auto_upgrade?null:o.createElement(Pl.A,{type:"button",fontSize:"medium",onPress:i(t,e)},o.createElement(P.sA,{id:"COMMON_ENABLE_AUTO_UPDATE"})))):null))});var Xl=l(75585);const Jl=(0,o.memo)(({deviceBannersExpanded:e,onClick:t})=>{const l=(0,a.useDispatch)(),n=(0,a.useSelector)(X.X7),c=(0,o.useCallback)(()=>{(0,f.A)(n,{dispatch:l}).then(()=>{t(Sl.READY_TO_ADOPT),l((0,N.At)(n,!0))})},[l,n,t]);return o.createElement(o.Fragment,null,o.createElement(Xl.A,{size:"original",isActive:!0,className:Ul}),o.createElement(Fl,null,o.createElement(vl.A,{size:"medium",color:"text-2"},o.createElement(P.sA,{id:"DEVICE_ACTIONS_BULK_ADOPT",values:{count:n.length}})),e?o.createElement(Pl.A,{type:"button",fontSize:"medium",onPress:c},o.createElement(P.sA,{id:n.length>1?"COMMON_ACTION_ADOPT_ALL":"COMMON_ADOPT"})):null))}),Ql={[Sl.READY_TO_ADOPT]:Jl,[Sl.READY_TO_UPDATE]:jl,[Sl.SMART_BATTERY_ADOPTION]:Yl,[Sl.SMART_BATTERY_ASSIGNMENT]:Gl},Zl=(0,o.memo)(()=>{const e=(0,a.useSelector)(U.Go),[t,l]=(0,o.useState)(e),n=(0,a.useSelector)(Rl),c=(0,o.useMemo)(()=>Object.entries(n).find(([e,t])=>t)?.[0],[n]),[s,i]=(0,o.useState)({[Sl.READY_TO_ADOPT]:!1,[Sl.READY_TO_UPDATE]:!1,[Sl.SMART_BATTERY_ADOPTION]:!1,[Sl.SMART_BATTERY_ASSIGNMENT]:!1}),m=(0,o.useCallback)(e=>{i(t=>({...t,[e]:!0}))},[]),u=(0,o.useCallback)(()=>{l(e=>!e)},[]),d=(0,o.useMemo)(()=>Ql[c],[c]),A=(0,o.useMemo)(()=>t?Dl.A:Ml.A,[t]);return(0,E.A)([(0,I.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,T.O)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})],d&&!s[c]?o.createElement(Ll,null,o.createElement(kl,null,o.createElement(d,{deviceBannersExpanded:t,onClick:m}),o.createElement(A,{size:"original",actionable:!0,onClick:u}))):null)});var ql=l(436017),en=l(231755);const tn=(0,Re.A)(w.A)`
  flex-direction: column;
  gap: ${F.YC};
`,ln=(0,o.memo)(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(_t),{custom:l}=(0,he.A)(ae.l.UNIFI_DEVICE),n=(0,o.useCallback)(({target:{checked:t}})=>{e((0,ge.yT)(ae.l.UNIFI_DEVICE,{custom:{groupByApplication:t}}))},[e]);return t?o.createElement(tn,null,o.createElement(en.A,null),o.createElement(ql.A,{onChange:n,checked:l?.groupByApplication,full:!0,size:"small"},o.createElement(vl.A,{style:{marginLeft:F.kc},size:"small",color:"text-1",weight:"bold"},o.createElement(P.sA,{id:"COMMON_GROUP_BY_APPLICATION"}))),o.createElement(en.A,null)):null}),nn=(0,o.memo)(()=>o.createElement(o.Fragment,null,o.createElement(vt.A,null,o.createElement(Al,null),o.createElement(Zl,null)),o.createElement(Pt.A,null,o.createElement(vt.A,null,o.createElement(ln,null)),o.createElement(ol,null),o.createElement(qt,null),o.createElement(zt,null),o.createElement(Il,null),o.createElement(kt,null),o.createElement(Tl,null)))),an=(0,o.memo)(()=>o.createElement(It.A,{leftFilterPageId:oe.g1.DEVICES,leftFilterColumnsId:Ct.DEVICES,footer:o.createElement(gt,null),columns:o.createElement(Rt,null),editor:void 0},o.createElement(nn,null)));var on=l(905410),cn=l(259120),rn=l(919952),sn=l(731128);const En=(0,$.Mz)(e=>e[rn.U.DEVICE_PAGE],e=>e[sn.u.PAGE_NUMBER]);var mn=l(439059);const un=[{value:25,default:!0},{value:50},{value:100}],dn=({columns:e,columnVisibility:t,activeRows:l,onRowClick:n,onColumnDrop:c})=>{const r=(0,o.useRef)(null),s=(0,a.useDispatch)(),i=(0,a.useSelector)(Me.b2),E=Ze(i),m=(0,a.useSelector)(En),[u,d]=(0,lt.A)(ae.l.UNIFI_DEVICE),[A,_]=(0,tt.A)(ae.l.UNIFI_DEVICE),C=(0,cn.A)({tagId:Xt.a.DEVICES,data:E}),I=(0,o.useCallback)(e=>{s((e=>({type:mn.o,pageNumber:e}))(e))},[s]);return o.createElement(w.A,{width:"100%",height:"100%",ref:r},o.createElement(on.A,{section:"COMMON_DEVICES",itemCount:i.length,tableType:ae.l.UNIFI_DEVICE,onRenderTable:({rowsPerPage:a,pageNumber:s})=>o.createElement(fe.A,{className:rt,data:E,columns:e,rowStyle:F.gc,columnVisibility:t,columnPinningLeftState:ot,activeRows:l,onRowClick:n,onColumnSizingChange:d,initialColumnSize:u,onSort:_,sorting:A,parentRef:r,pageIndex:s,pageSize:a,columnDnD:!0,staticDnD:ot,onColumnDrop:c,withOverflow:!0,tableHeight:"100%",virtualizeColumn:!0,overscanColumn:1,...C}),onPageChanged:I,pageNumber:m,wrapperFlexProps:st,rowOptions:un}))},An=(0,o.memo)(()=>{const e=(0,n.W6)(),{search:t}=(0,n.zy)(),l=(0,a.useSelector)(X.U$),c=(0,a.useSelector)(ne.RE),r=(0,a.useSelector)(Me.hm),s=(0,a.useDispatch)();Te();const i=(0,a.useSelector)(_t),{initialColumns:E=[],custom:m,columnOrder:u}=(0,he.A)(ae.l.UNIFI_DEVICE);(0,o.useEffect)(()=>{const n=new URLSearchParams(t);n.has(k.zs)&&l&&(setTimeout(()=>{s((0,R.XP)({type:g.H.DEVICE,id:l.mac,tab:ie.BC.SETTINGS}))},100),n.delete(k.zs),e.push({search:n.toString()}))},[s,e,t,l]);const d=(0,o.useCallback)(({device_type:e,product_line:t,mac:l,stacking_group_id:n})=>{s((0,me.p)(!1)),s((0,R.XP)({type:n?g.H.STACKING:(0,Se.cW)({device_type:e,product_line:t})?e===De.iU.CLIENT&&g.H.UNIFI_DEVICE_CLIENT||g.H.DEVICE:g.H.UNIFI_DEVICE_CLIENT,id:n||l}))},[s]),A=(0,o.useCallback)(e=>{s((0,ge.yT)(ae.l.UNIFI_DEVICE,{columnOrder:(0,se.F)((0,ue.D)(c),e,u)}))},[s,u,c]),_=(0,o.useMemo)(()=>(0,ue.D)(c).sort((e,t)=>u.findIndex(t=>t===e.id)-u.findIndex(e=>e===t.id)),[u,c]),C=(0,o.useMemo)(()=>E.length?ct.reduce((e,t)=>(e[t]=t===pe.o$.STATUS_BALL||E.includes(t),e),{}):{},[E]);(0,o.useEffect)(()=>{if(e.location.state){const{id:t,openSidePanel:l,type:n,tab:a}=e.location.state;t&&l&&n&&(s((0,R.XP)({type:n,id:t,tab:a})),delete e.location.state.openSidePanel,delete e.location.state.id,delete e.location.state.type)}},[s,e.location.state]);const I=(0,o.useMemo)(()=>!!i&&m?.groupByApplication,[i,m?.groupByApplication]),O=(0,re.A)([g.H.DEVICE,g.H.UNIFI_DEVICE_CLIENT]),N=(0,a.useSelector)(be.MQ);return o.createElement(Ee.A,{leftFilterPageId:oe.g1.DEVICES,content:o.createElement(an,null),overflow:"hidden"},r&&E.length?o.createElement(ce.A,null,I&&!N?o.createElement(At,{columns:_,columnVisibility:C,onRowClick:d,onColumnDrop:A,activeRows:O}):o.createElement(dn,{columns:_,columnVisibility:C,onRowClick:d,onColumnDrop:A,activeRows:O})):o.createElement(Ye,null))}),_n=(0,o.memo)(({path:e})=>{const t=(0,a.useDispatch)();return(0,o.useEffect)(()=>{t((0,T.O)()),t((0,N.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,D.Yo)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,d.uy)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,O.Sk)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,I.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,S.$3)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,_.hh)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,A.G)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[t]),(0,E.A)([(0,C.T)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}),(0,i.Zi)(s.B.DEVICES),(0,i.Zi)(s.B.CLIENTS),(0,i.Zi)(s.B.UNIFI_DEVICES)],o.createElement(m.A,null,o.createElement(n.dO,null,o.createElement(c.F,null,o.createElement(An,null)),o.createElement(c.F,{path:`${e}/device-upgrade/:id/`,render:e=>o.createElement(le,{...e})})),o.createElement(Z,null)),{trackingName:u.VO.DEVICES})})},535362:(e,t,l)=>{l.d(t,{A:()=>N});var n=l(469733),a=l(296540),o=l(314714),c=l(566723),r=l(699784),s=l(575593),i=l(949909),E=l(578819),m=l(780811),u=l(837612),d=l(602197),A=l(171073),_=l(175875),C=l(147606),I=l(294303);const O=({device:e,disabled:t,confirmTitle:l,confirmMessage:O,confirmButtonMessage:N,hidePoe:T,customName:S,unit_id:D})=>{const M=(0,n.useDispatch)(),p=(0,n.useSelector)((0,s.p)(i.S.API_DEVICE_RESTART)),[h,g]=(0,a.useState)(!1),b=S||e.name||e.mac,f=(0,m.Tbi)(e)&&(0,E.b0)(e.port_table),R=(0,u.S9)(e),v=R!==d.g.CONNECTED&&R!==d.g.RFSCANNING,P=f||(0,m.moU)(e),V=!e.bypassConfirmRestart,U=P||V,y=(0,a.useCallback)(()=>{M((0,A.CP)(e,h?"hard":"soft",D))},[M,e,h,D]);return p?a.createElement(C.A,{title:a.createElement(r.sA,{id:l||"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",values:{deviceName:b}}),message:a.createElement(a.Fragment,null,a.createElement(r.sA,{id:O||"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",values:{deviceName:b}}),f&&!T?a.createElement(I.A,{paddingTop:c.kc},a.createElement(o.A,{checked:h,id:"hardReboot",onChange:()=>{g(e=>!e)}},a.createElement(r.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"}))):null),confirmButtonLabel:a.createElement(r.sA,{id:N||"DEVICE_ACTIONS_RESTART"}),confirmButtonVariant:"destructive",onConfirm:y,trigger:U?a.createElement(_.A,{isDisabled:v||t},a.createElement(r.sA,{id:"DEVICE_ACTIONS_RESTART"})):null}):null},N=(0,a.memo)(({device:e,disabled:t,confirmTitle:l,confirmMessage:n,confirmButtonMessage:o,hidePoe:c,customName:r,unit_id:s})=>a.createElement(O,{device:e,disabled:t,confirmTitle:l,confirmMessage:n,confirmButtonMessage:o,hidePoe:c,customName:r,unit_id:s}))},575593:(e,t,l)=>{l.d(t,{p:()=>s});var n=l(801081),a=l(215454),o=l(602021),c=l(198494),r=l(949909);const s=e=>(0,n.Mz)(o.ah,a.pw,o.dK,c.fR,(t,l,n,a)=>{switch(e){case r.S.API_DEVICE_ADOPT:case r.S.API_DEVICE_RESTART:return n||t.includes(e);case r.S.API_WIDGET_OS_STATS:return a||l.includes(e);default:return n}})},598274:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(469733),a=l(296540),o=l(71479),c=l(699784),r=l(780811),s=l(837612),i=l(602197),E=l(171073),m=l(734707);const u=(0,o.A)(m.Ay)`
  padding: 0;
  white-space: nowrap;
`,d=({device:e,labelId:t,disabled:l})=>{const o=(0,n.useDispatch)(),m=(0,s.S9)(e),d=(0,a.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),(0,r.YdF)({type:e.type})&&Boolean(e.peer_ubb?.mac)&&o((0,E.VO)({locating:e.peer_ubb.locating,mac:e.peer_ubb.mac,name:e.peer_ubb.name,model:e.peer_ubb.model})),o((0,E.VO)({locating:e.locating,mac:e.mac,name:e.name,model:e.model}))},[o,e.type,e.mac,e.name,e.model,e.locating,e.peer_ubb?.mac,e.peer_ubb?.name,e.peer_ubb?.model,e.peer_ubb?.locating]);return a.createElement(u,{variant:"link",onClick:d,disabled:l||m!==i.g.CONNECTED},a.createElement(c.sA,{id:e.locating?"DEVICE_ACTIONS_LOCATE_STOP":t||"DEVICE_ACTIONS_LOCATE"}))}},773033:(e,t,l)=>{l.d(t,{A:()=>c});var n=l(469733),a=l(296540),o=l(212178);const c=(e,t,l)=>{const c=(0,n.useDispatch)(),r=[JSON.stringify(e),JSON.stringify(t)].join(),s=(0,o.A)(r);return(0,a.useEffect)(()=>{if(r!==s){const n=[],a=e.length;for(let l=0;l<a;l+=1){const a=e[l];t.includes(a)||n.push(a)}n.length&&c(l(e.filter(e=>!n.includes(e))))}},[r,s,e,t,l,c]),null}},902923:(e,t,l)=>{l.d(t,{A:()=>D,i:()=>S});var n=l(469733),a=l(296540),o=l(314714),c=l(71479),r=l(566723),s=l(137625),i=l(294303),E=l(699784),m=l(575593),u=l(949909),d=l(578819),A=l(780811),_=l(837612),C=l(602197),I=l(171073),O=l(535362),N=l(734707);const T=(0,c.A)(N.Ay)`
  padding: 0;
`,S=({device:e,isConfirmOpen:t,setIsConfirmOpen:l,disabled:c})=>{const O=(0,n.useDispatch)(),N=(0,n.useSelector)((0,m.p)(u.S.API_DEVICE_RESTART)),[S,D]=(0,a.useState)(!1),M=e.name||e.mac,p=(0,A.Tbi)(e)&&(0,d.b0)(e.port_table),h=(0,_.S9)(e),g=h!==C.g.CONNECTED&&h!==C.g.RFSCANNING,b=(0,a.useCallback)(()=>{O((0,I.CP)(e,S?"hard":"soft"))},[O,e,S]);return N?a.createElement(s.A,{isOpen:t,title:"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",titleValues:{deviceName:M},message:"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",messageValues:{deviceName:M},...p?{body:a.createElement(i.A,{paddingTop:r.kc},a.createElement(o.A,{checked:S,id:"hardReboot",onChange:()=>{D(e=>!e)}},a.createElement(E.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"})))}:{},buttonMessage:"DEVICE_ACTIONS_RESTART",buttonVariant:"danger",handleConfirm:b,handleClose:()=>{l(!1)}},a.createElement(T,{variant:"link",onClick:t=>{t.preventDefault(),t.stopPropagation();const n=p||(0,A.moU)(e),a=!e.bypassConfirmRestart;n||a?l(!0):O((0,I.CP)(e))},disabled:g||c},a.createElement(E.sA,{id:"DEVICE_ACTIONS_RESTART"}))):null},D=(0,a.memo)(({device:e,disabled:t})=>a.createElement(O.A,{device:e,disabled:t}))},949909:(e,t,l)=>{var n;l.d(t,{S:()=>n}),function(e){e.API_DEVICE_ADOPT="API_DEVICE_ADOPT",e.API_DEVICE_RESTART="API_DEVICE_RESTART",e.API_WIDGET_OS_STATS="API_WIDGET_OS_STATS"}(n||(n={}))}}]);