"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[40336],{147433(e,t,n){n.d(t,{A:()=>i});const i={PCAP:4194304,HWOFFLOAD_QOS_AND_SMART_QUEUE:2147483648,SUPPORT_FILE:65536}},602381(e,t,n){var i,s;n.d(t,{Z:()=>s,e:()=>i}),function(e){e.WIRED="WIRED",e.WIRELESS="WIRELESS"}(i||(i={})),function(e){e.CAPTURING="CAPTURING",e.STOP_CAPTURING="STOP_CAPTURING",e.UPLOADING="UPLOADING",e.READY_TO_DOWNLOAD="READY_TO_DOWNLOAD",e.TIMEOUT="TIMEOUT"}(s||(s={}))},358935(e,t,n){n.d(t,{X2:()=>E,lX:()=>A,uC:()=>u});var i=n(571766),s=n(29472),r=n(159469),a=n(774366);const o=`${n(290454).w}/device/:mac:`,l=`${o}/replacement-candidates`,c=`${o}/replace?replacementDeviceMac=:replacement-mac:`,d=`${o}/replace`,A=(e={},t={})=>(0,s.Kd)("replacementCandidates",`${l.replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),u=(e,t)=>n=>n((0,s.vB)(i.aC,null,null,a.A.POST,c.replace(":mac:",e).replace(":replacement-mac:",t),{},null,{})),E=e=>t=>t((0,s.vB)(i.aC,null,null,a.A.DELETE,d.replace(":mac:",e),{},null,{failureToast:()=>({icon:r.C.danger,message:"COMMON_UNKNOWN_ERROR"})}))},752104(e,t,n){n.d(t,{A:()=>s,Q:()=>r});var i=n(765567);const s="_",r=[i.ZM,i.Je]},216082(e,t,n){n.d(t,{A:()=>h});var i,s=n(274934),r=n(954702),a=n(602086),o=n(977872),l=n(938984),c=n(976458),d=n(470070),A=n(535322),u=n(376892),E=n(222102);!function(e){e.OPEN_MODAL="openModal"}(i||(i={}));const _=(0,E.Mz)(c.zn,e=>void 0!==e[i.OPEN_MODAL]);var m=n(828373),p=n(367821);const C=({uidbDevice:e})=>{const t=(0,o.d4)(c.zn),n=t?.[i.OPEN_MODAL];return n?(0,s.jsx)(r.A,{onClick:()=>n(e),children:(0,s.jsx)(l.A,{size:"medium",color:"inherit",children:(0,s.jsx)(d.sA,{id:"DEVICE_SHOW_DETAILS"})})}):null},x=({shortname:e})=>{(0,p.A)();const t=(0,o.d4)((0,a.useMemo)(()=>(0,m.$E)(e),[e]));return t?.compliance?(0,s.jsx)(A.A,{type:A.I.ACCORDION,items:[{id:"compliance",label:(0,s.jsx)(u.A,{id:"COMMON_COMPLIANCE"}),renderContent:()=>(0,s.jsx)(C,{uidbDevice:t}),openByDefault:!0}]}):null},h=({shortname:e})=>(0,o.d4)(_)?(0,s.jsx)(x,{shortname:e}):null},189042(e,t,n){n.d(t,{A:()=>b});var i=n(274934),s=n(977872),r=n(602086),a=n(244081),o=n(586566),l=n(441318),c=n(996077),d=n(539453),A=n(553732),u=n(897166),E=n(147433),_=n(247816),m=n(669439),p=n(648175),C=n(470070),x=n(956978),h=n(434521),N=n(45978),M=n(147045);const v=(0,_.A)("span")`
  width: 100%;
`,O=({activeItem:e,onClick:t,disabledWithReason:n,[M.L]:s})=>{const r=(e=>{const t=(0,h.S9)(e);return e.disabled||t!==N.g.CONNECTED||!(0,x.sc7)(t)?"DEVICE_PCAP_DISABLED_TOOLTIP":null})(e)||n;return(0,i.jsx)(m.A,{description:r?(0,i.jsx)(C.sA,{id:r}):void 0,children:(0,i.jsx)(v,{...s&&{[M.L]:s},children:(0,i.jsx)(p.A,{onClick:t,isDisabled:!!r,width:"full",children:(0,i.jsx)(C.sA,{id:"COMMON_PACKET_CAPTURE"})})})})};var j=n(205521),T=n(449339),I=n(590979),R=n(231083),g=n(409844),w=n(309130),S=n(100978);const P=g.AH`
  &:empty {
    display: none;
  }
`,D=(0,_.A)("div")`
  flex: 1 1 0;
  min-width: 33%;
  box-sizing: border-box;
  padding-right: ${w.kc};

  &:last-child {
    padding-right: 0;
  }
`,f=({children:e,...t})=>(0,i.jsx)(S.A,{marginTop:w.kc,className:P,...t,children:r.Children.map(e,e=>e?(0,i.jsx)(D,{className:P,children:e}):null)}),b=({activeItem:e,showPortsButton:t,showCaptureButton:n})=>{const _=(0,s.wA)(),m=(0,s.d4)(u.vc),p=(0,s.d4)(l.ar),C=n&&m===e.mac&&p&&(0,o.W4)(e,E.A.PCAP),x=t&&e.port_table?.length>0;(0,r.useEffect)(()=>{_((0,A.Sk)(void 0,{crudCacheStrategy:{type:a.e.CACHE}})),_((0,d.hh)(void 0,{crudCacheStrategy:{type:a.e.CACHE}}))},[_]);const h=(0,r.useCallback)(()=>{_((0,j.XP)({type:T.H.PACKET_CAPTURE,id:e.mac,customData:{captureDeviceType:c.X.GATEWAY}}))},[_,e.mac]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(f,{children:[x?(0,i.jsx)(R.A,{mac:e.mac}):null,C?(0,i.jsx)(O,{activeItem:e,captureDeviceType:c.X.GATEWAY,onClick:h,...I.A.addDataTestId(I.A.TestId.SIDE_PANEL_TRIGGER)}):null]})})}},721398(e,t,n){n.d(t,{A:()=>o});var i=n(274934),s=n(125799),r=n(853777),a=n(470070);const o=({messageId:e,tooltipClassName:t,values:n,isInteractive:o,portal:l,variant:c="twoTone",size:d="medium"})=>(0,i.jsx)(s.A,{description:(0,i.jsx)(a.sA,{id:e,values:n}),width:210,isInteractive:o,portal:l,tooltipClassName:t,children:(0,i.jsx)(r.A,{isActive:!0,omitSvgMargin:!0,variant:c,size:d})})},996077(e,t,n){var i,s;n.d(t,{A:()=>i,X:()=>s}),function(e){e.DEFAULT="default",e.IN_PROGRESS="inProgress",e.READY="ready",e.DOWNLOADING="downloading",e.STOPPING="stopping"}(i||(i={})),function(e){e.AP="ap",e.GATEWAY="gateway"}(s||(s={}))},441318(e,t,n){n.d(t,{VQ:()=>j,ar:()=>I,ax:()=>R,r8:()=>g});var i=n(222102),s=n(430328),r=n(197719),a=n(254590),o=n(243436),l=n(910577),c=n(407386),d=n(423564),A=n(581814),u=n(197571),E=n(267142),_=n(644533),m=n(754924),p=n(544691),C=n(602381),x=n(996077);const h=[A.rR.CORPORATE,A.rR.GUEST],N=e=>void 0===e||e,M=({_id:e,name:t,enabled:n,ip_subnet:i,ipv6_subnet:s,wan_networkgroup:r,vpn_type:o,purpose:l,l2tp_interface:c,openvpn_interface:A,wireguard_interface:u,ipsec_interface:_,sdwan_hub_spoke_local_wan_id:m},p)=>({_id:e,enabled:N(n),name:t||a.L,ip_subnet:p?a.L:(0,d.Qe)({ip_subnet:i,ipv6_subnet:s},E.L),wan_networkgroup:r,vpn_type:o,ipsec_interface:_,l2tp_interface:c,openvpn_interface:A,purpose:l,sdwan_hub_spoke_local_wan_id:m,wireguard_interface:u}),v=(e,t)=>e?e===r.C.WAN?t.wan1:t[e.toLocaleLowerCase()]||{}:{},O=(e,t=C.e.WIRELESS)=>(0,i.Mz)(u.Ct,l.Ag,(0,p.a5)(e),m.fq,m.Dx,(e,n,i,s,r)=>{const a=n.reduce((e,{enabled:t,networkconf_id:n,ap_group_ids:s=[]})=>(t&&i.some(({_id:e})=>s.includes(e))&&e.push(n),e),[]);return e.reduce((e,n)=>(_.A.includes(n.purpose)&&(a.includes(n._id)||t===C.e.WIRED)&&e.push(M(n,(0,o.cH)({gateway_device:n.gateway_device,purpose:n.purpose},s,r))),e),[])}),j=(e,t=C.e.WIRELESS)=>(0,i.Mz)(O(e,t),e=>Boolean(e.length)),T=(0,s.WY)()((0,i.Mz)(u.Ct,m.U$,c.$D,m.AL,(e,t,n,i)=>[...e.reduce((e,n)=>(n&&t.network_table?.some(({_id:e})=>e===n._id)&&N(n.enabled)&&n.gateway_type!==A.xk.SWITCH&&h.includes(n.purpose)&&e.push(M(n)),e),[]),...n.reduce((e,{configuration:n={}})=>{if((({purpose:e,wan_networkgroup:t},n)=>{if(e!==A.rR.WAN)return!1;if(t===r.C.WAN_LTE_FAILOVER)return!0;const i=v(t,n);return!!i?.up})(n,t)){let s;if(n.wan_networkgroup===r.C.WAN_LTE_FAILOVER)s=i?.lte_ip;else{const e=v(n.wan_networkgroup,t);s=e?.ip}e.push({...M(n),...s?{ip_subnet:s}:{}})}return e},[])]),e=>e),I=(0,s.WY)()((0,i.Mz)(T,e=>Boolean(e.length)),e=>e),R=(e,t,n)=>{switch(t){case x.X.AP:return n===C.e.WIRELESS?O(e,n):(e=>(0,i.Mz)((0,m.tG)(e),u.Ct,m.fq,m.Dx,(e,t,n,i)=>{if(!e.connection_network_id)return[];const s=t.find(({_id:t})=>t===e.connection_network_id);return s?[M(s,(0,o.cH)({gateway_device:s.gateway_device,purpose:s.purpose},n,i))]:[]}))(e);case x.X.GATEWAY:return T;default:return()=>[]}},g=e=>(0,i.Mz)(l.Ag,t=>{const n=t.filter(t=>t.networkconf_id===e);return[...new Set(n.flatMap(e=>e.wlan_bands))]})},664613(e,t,n){n.d(t,{A:()=>A});var i=n(274934),s=n(938984),r=n(703639),a=n(309130),o=n(100978),l=n(470070),c=n(956978),d=n(664092);const A=({sys_stats:e,flexProps:t,withTooltip:n,compact:A=!1})=>{const u=(0,c.eiG)(e);return u?(0,i.jsxs)(d.A,{flexProps:t,compact:A,children:[(0,i.jsx)(s.A,{color:"text-2",size:"medium",children:(0,i.jsx)(l.sA,{id:"COMMON_LOAD_AVERAGE"})}),n?(0,i.jsxs)(o.A,{alignItems:"center",gap:a.YC,children:[(0,i.jsx)(s.A,{color:"text-3",size:"medium",children:u}),(0,i.jsx)(r.A,{description:(0,i.jsx)(l.sA,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE_TOOLTIP"}),placement:"top start"})]}):(0,i.jsx)(s.A,{color:"text-3",size:"medium",children:u})]}):null}},382583(e,t,n){n.d(t,{A:()=>u});var i=n(274934),s=n(602086),r=n(938984),a=n(95032),o=n(977872),l=n(421314),c=n(470070),d=n(197571),A=n(664092);const u=({connection_network_id:e})=>{const t=(0,o.d4)(d.Tn),n=(0,s.useMemo)(()=>e?t.find(t=>t._id===e):void 0,[t,e]);return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(A.A,{children:[(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:(0,i.jsx)(c.sA,{id:"COMMON_NETWORK"})}),(0,i.jsx)(l.A,{color:"text-3",size:"medium",flexProps:{justifyContent:"flex-end"},children:n.name})]}),null!=n.vlan?(0,i.jsxs)(A.A,{children:[(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:(0,i.jsx)(c.sA,{id:"COMMON_VLAN_ID"})}),(0,i.jsx)(a.A,{color:"text-3",size:"medium",isTruncated:!0,children:n.vlan})]}):null]}):null}},999837(e,t,n){n.d(t,{A:()=>Y});var i=n(274934),s=n(977872),r=n(602086),a=n(696264),o=n(599110),l=n(159469),c=n(706925),d=n(700444),A=n(470070),u=n(222102),E=n(656466),_=n(401042),m=n(358935);var p,C,x=n(857780),h=n(570866);!function(e){e.EXISTING="existing",e.NEW="new"}(p||(p={})),function(e){e.MAC="mac",e.TYPE="type",e.MODEL="model"}(C||(C={}));var N,M=n(990330),v=n(125799),O=n(843615),j=n(853777),T=n(489714),I=n(947414);!function(e){e.DEVICE_REPLACEMENT_MODE="deviceReplacementMode",e.SET_DEVICE_REPLACEMENT_MODE="setDeviceReplacementMode",e.NEW_MAC="newMac",e.SET_NEW_MAC="setNewMac",e.EXISTING_MAC="existingMac",e.SET_EXISTING_MAC="setExistingMac",e.REPLACEMENT_CANDIDATES="replacementCandidates",e.ERROR="error",e.RESET_ERROR="resetError"}(N||(N={}));const R=(0,r.createContext)({[N.DEVICE_REPLACEMENT_MODE]:void 0,[N.SET_DEVICE_REPLACEMENT_MODE]:I.P1,[N.NEW_MAC]:void 0,[N.SET_NEW_MAC]:I.P1,[N.EXISTING_MAC]:void 0,[N.SET_EXISTING_MAC]:I.P1,[N.REPLACEMENT_CANDIDATES]:[],[N.ERROR]:void 0,[N.RESET_ERROR]:I.P1}),g=n(409844).AH`
  height: 54px;
`;var w=n(247816),S=n(309130),P=n(100978);const D=(0,w.A)(P.A)`
  align-items: center;
  gap: ${S.YC};
`,f=(0,r.memo)(()=>{const{newMac:e,setNewMac:t,error:n,resetError:s}=(0,r.useContext)(R),a=(0,r.useCallback)(({target:{value:e}})=>{t((0,T.Z)(e)),s()},[t,s]);return(0,i.jsx)(O.A,{className:g,value:e,onChange:a,onFocus:s,variant:"secondary",label:(0,i.jsxs)(D,{children:[(0,i.jsx)(A.sA,{id:"COMMON_MAC_ADDRESS"}),(0,i.jsx)(v.A,{portal:!0,width:"100%",maxWidth:248,description:(0,i.jsx)(A.sA,{id:"DEVICE_REPLACEMENT_MAC_LOCATION"}),children:(0,i.jsx)(j.A,{isActive:!0})})]}),width:"100%",invalid:n})});var b=n(237887),L=n(974390);const y=(0,r.memo)(()=>{const{replacementCandidates:e,existingMac:t,setExistingMac:n,error:s,resetError:a}=(0,r.useContext)(R),o=(0,r.useMemo)(()=>e.map(({mac:e,model:t,name:n})=>({label:n,value:e,image:(0,i.jsx)(L.A,{model:t}),additionalInfo:e})),[e]),l=(0,r.useCallback)(({value:e})=>{n(String(e)),a()},[n,a]);return(0,i.jsx)(b.A.Sorted,{value:t,label:(0,i.jsx)(A.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,onChange:l,onFocus:a,maxHeight:228,options:o,invalid:s})}),k=(0,w.A)(P.A)`
  flex-direction: column;
  gap: ${S.kc};
`,W=(0,r.memo)(()=>{const{replacementCandidates:e,deviceReplacementMode:t,setDeviceReplacementMode:n,resetError:s}=(0,r.useContext)(R),a=(0,r.useMemo)(()=>e.length?[{id:p.EXISTING,children:(0,i.jsx)(A.sA,{id:"COMMON_EXISTING"}),onChange:()=>{n(p.EXISTING),s()},checked:t===p.EXISTING},{id:p.NEW,children:(0,i.jsx)(A.sA,{id:"COMMON_NEW"}),onChange:()=>{n(p.NEW),s()},checked:t===p.NEW}]:[],[e.length,t,n,s]);return(0,i.jsxs)(k,{children:[(0,i.jsx)(M.A,{direction:"row",items:a}),t===p.EXISTING?(0,i.jsx)(y,{}):null,t===p.NEW?(0,i.jsx)(f,{}):null]})}),z=(0,w.A)(P.A)`
  align-items: center;
  gap: ${S.YC};
  width: fit-content;
`;var G=n(721398);const V={[x.gQ.INCOMPATIBLE_REPLACEMENT]:"DEVICE_REPLACEMENT_DEVICE_INCOMPATIBLE_REPLACEMENT_ERROR",[x.gQ.REPLACEMENT_ALREADY_ASSIGNED]:"DEVICE_REPLACEMENT_DEVICE_REPLACEMENT_ALREADY_ASSIGNED_ERROR"},U=({mac:e,hideTooltip:t=!1})=>{const{formatMessage:n}=(0,A.tz)(),c=(0,s.wA)(),[C,M]=(0,r.useState)(!1),[v,O]=(0,r.useState)(!1),[j,T]=(0,r.useState)(p.NEW),[I,g]=(0,r.useState)(""),[w,S]=(0,r.useState)(""),[P,D]=(0,r.useState)(void 0),f=(0,s.d4)((0,r.useMemo)(()=>(e=>(0,u.Mz)((e=>(0,E.uh)((0,m.lX)({queryParams:{mac:e}})))(e),e=>(0,_.i6)(e)?.devices||[]))(e),[e])),b=(0,r.useCallback)(()=>{M(!0)},[]),L=(0,r.useCallback)(()=>{M(!1),g(""),S(""),O(!1),T(p.NEW),D(void 0)},[]),y=(0,r.useCallback)(()=>{switch(j){case p.EXISTING:return w;case p.NEW:return I;default:return}},[j,w,I]),k=(0,r.useCallback)(()=>{c((0,d.ox)({icon:l.C.success,message:"DEVICE_REPLACEMENT_DEVICE_SET",duration:3e3})),L()},[c,L]),U=(0,r.useCallback)(e=>{switch(e.apiData?.replacement_state){case x.gQ.INCOMPATIBLE_REPLACEMENT:case x.gQ.REPLACEMENT_ALREADY_ASSIGNED:D(n({id:V[e.apiData.replacement_state]}));break;default:c((0,d.ox)({icon:l.C.danger,message:"DEVICE_FAILED_TO_SET_REPLACEMENT_DEVICE",duration:3e3}))}},[c,n]),Y=(0,r.useCallback)(()=>{O(!1)},[]),X=(0,r.useCallback)(()=>{O(!0),c((0,m.uC)(e,y())).then(k).catch(U).finally(Y)},[c,k,U,e,y,Y]),B=(0,r.useMemo)(()=>Boolean(y().match(h.b8)),[y]),H=(0,r.useMemo)(()=>[{text:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:L},{text:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:X,disabled:!B||v,loader:v?"spinner":void 0}],[L,X,B,v]),F=(0,r.useCallback)(()=>{D(void 0)},[D]),K=(0,r.useMemo)(()=>({[N.DEVICE_REPLACEMENT_MODE]:j,[N.SET_DEVICE_REPLACEMENT_MODE]:T,[N.NEW_MAC]:I,[N.SET_NEW_MAC]:g,[N.EXISTING_MAC]:w,[N.SET_EXISTING_MAC]:S,[N.REPLACEMENT_CANDIDATES]:f,[N.ERROR]:P,[N.RESET_ERROR]:F}),[j,I,w,f,P,F]);return(0,r.useEffect)(()=>{c((0,m.lX)({queryParams:{mac:e}}))},[c,e]),(0,i.jsx)(R.Provider,{value:K,children:(0,i.jsx)(a.A,{allowOverflow:!0,title:(0,i.jsx)(A.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"}),body:(0,i.jsx)(W,{}),position:"top",portal:!0,actions:H,isOpen:C,onRequestClose:L,children:(0,i.jsxs)(z,{children:[(0,i.jsx)(o.A,{type:"button",variant:"inline",size:"medium",onClick:b,children:(0,i.jsx)(A.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"})}),t?null:(0,i.jsx)(G.A,{messageId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION",variant:"outline"})]})})})},Y=(0,r.memo)(({model:e,type:t,...n})=>(0,c.G)({type:t,model:e})?(0,i.jsx)(U,{type:t,model:e,...n}):null)},384780(e,t,n){n.d(t,{A:()=>z});var i=n(274934),s=n(814557),r=n(977872),a=n(602086),o=n(125799),l=n(792929),c=n(600191),d=n(263705),A=n(244081),u=n(112104),E=n(61322),_=n(449339),m=n(974390),p=n(650632),C=n(535322),x=n(205521),h=n(347625),N=n(754924),M=n(223597),v=n(34118),O=n(239627),j=n(645682),T=n(254590),I=n(857780);const R=({name:e,mac:t,model:n})=>e===t&&n?n:e,g=e=>{switch(e?.uplink?.type){case I.au.WIRE:return e?.connection_network_name||T.L;case I.au.WIRELESS:return e?.connection_network_name||e?.uplink?.essid||T.L;default:return T.L}};var w,S=n(599110),P=n(594005),D=n(309130),f=n(421314);!function(e){e.NAME="name",e.PORT="port",e.NETWORK="network"}(w||(w={}));const b={[w.NAME]:"COMMON_NAME",[w.PORT]:"COMMON_PORT",[w.NETWORK]:"COMMON_NETWORK"};var L=n(100978),y=n(470070),k=n(850352);const W=({port:e,mac:t})=>{const{handleGoToPortsPage:n}=(0,k.e)();return(0,i.jsx)(S.A,{variant:"inline",type:"button",size:"medium",onClick:()=>{n(t,e)},children:e})},z=({activeItem:e})=>{const{themeName:t}=(0,d.u)(),n=(0,r.wA)(),T=(0,r.d4)(N.ID),I=(0,a.useMemo)(()=>((e,t)=>(e||[]).map(e=>{const n=t.find(({mac:t})=>t===e.mac||t===e.ap_mac);return n?{...e,id:n._id,name:(0,h.Q)(n),activeItem:n,model:(0,h.Lm)(n.model)}:null}).filter(Boolean))(e.downlink_table,T),[e.downlink_table,T]),S=(0,r.d4)((0,v.Ax)(e.mac)).filter(e=>e.type===M.sK.WIRED);(0,a.useEffect)(()=>{n((0,O.$3)(void 0,{crudCacheStrategy:{type:A.e.CACHE}}))},[n]);const k=(0,a.useMemo)(()=>S.map(e=>({id:`${e.id}${e.sw_port}`,name:e.display_name,mac:e.mac,network:e.network_name,port:e.sw_port,image:(0,i.jsx)(p.A,{client:e}),isClient:!0})),[S]),z=(0,a.useMemo)(()=>I.map(({id:e,name:n,mac:r,port_idx:a,activeItem:l})=>({id:`${e}${a}`,name:R({name:n,mac:l.mac,model:l.model}),mac:r,network:g(l),port:a,image:(0,i.jsx)(m.A,{model:l.model}),isClient:!1,warning:l.detailed_states?.negotiated_low_uplink_port_speed?(0,i.jsx)(o.A,{portal:!0,description:(0,i.jsx)(j.A,{color:"text-1"}),children:(0,i.jsx)(c.A,{size:"medium",color:s.Ay[`desktop-color-orange-06-${t}`]})}):void 0,stacking_group_id:l.stacking_group_id})),[I,s.Ay[`desktop-color-orange-06-${t}`]]),G=(0,a.useMemo)(()=>Array.prototype.concat.apply([],[k,z]),[z,k]),V=(0,a.useMemo)(()=>(({mac:e})=>[{id:w.NAME,label:(0,i.jsx)(y.sA,{id:b[w.NAME]}),renderCell:({image:e,name:t})=>(0,i.jsxs)(L.A,{alignItems:"center",justifyContent:"center",width:"100%",children:[(0,i.jsx)(L.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px",children:e}),(0,i.jsx)(f.A,{color:"inherit",size:"medium",style:{width:"170px",paddingLeft:"6px",paddingRight:"6px"},children:t})]}),width:170,compare:(0,P.l0)(({name:e})=>e)},{id:w.NETWORK,label:(0,i.jsx)(y.sA,{id:b[w.NETWORK]}),renderCell:({network:e})=>(0,i.jsx)(f.A,{color:"inherit",size:"medium",children:e}),width:112,compare:(0,P.l0)(({network:e})=>e)},{id:w.PORT,align:"right",label:(0,i.jsx)(y.sA,{id:b[w.PORT]}),renderCell:({port:t,warning:n})=>(0,i.jsxs)(L.A,{justifyContent:"flex-end",alignItems:"center",flexGrow:1,children:[(0,i.jsx)(L.A,{marginTop:-2,marginRight:D.YC,children:n}),(0,i.jsx)(W,{port:t,mac:e})]}),width:54,compare:(0,P.l0)(({port:e})=>e)}])({mac:e.mac}),[e.mac]),U=(0,a.useCallback)(({mac:e,isClient:t,stacking_group_id:i})=>{n((0,x.XP)({type:t?_.H.CLIENT:i?_.H.STACKING:_.H.DEVICE,id:i||e}))},[n]),{rowLimit:Y,renderFooter:X}=(0,u.A)(G.length,{defaultCount:10});return G.length?(0,i.jsx)(C.A,{children:(0,i.jsx)(l.A,{items:G,columns:V,idField:"id",initialSortBy:"port",initiallySortAscending:!0,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:U,rowLimit:Y,renderFooter:()=>X,rowHeight:E.I.ROW_HEIGHT,truncateHeaderCells:!0})}):null}},23377(e,t,n){n.d(t,{A:()=>S});var i=n(274934),s=n(977872),r=n(602086),a=n(383061),o=n(237887),l=n(733360),c=n(197719),d=n(309130),A=n(100978),u=n(535322),E=n(470070),_=n(407386),m=n(51411),p=n(853109),C=n(886140),x=n(127347);var h=n(87052),N=n(938984),M=n(878151),v=n(320509),O=n(570203),j=n(635187),T=n(664092),I=n(631692),R=n(924453),g=n(906701);const w=({uplinkAttrs:e,configuration:t={wan_dns1:void 0,wan_dns2:void 0,wan_dhcpv6_pd_size:void 0,wan_type_v6:void 0,wan_prefixlen:void 0},details:n={},gatewayPort:{ipv6:s=[]}={}})=>{const{ip:r,speed:a,rx_packets:o,rx_bytes:l,tx_packets:c,tx_bytes:d,"rx_bytes-r":u,"tx_bytes-r":_,mac:m}=e||{};return(0,i.jsxs)(A.A,{height:"100%",flexDirection:"column",children:[r?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{size:"medium",children:(0,i.jsx)(E.sA,{id:"COMMON_IP_ADDRESS"})}),(0,i.jsx)(N.A,{size:"medium",color:"text-3",children:r})]}):null,s.length?(0,i.jsx)(g.A,{ipv6_address:s,wan_dhcpv6_pd_size:t.wan_type_v6===O.c.SLAAC||t.wan_type_v6===O.c.DHCPV6?t.wan_dhcpv6_pd_size:void 0}):null,(0,i.jsx)(R.A,{mac:m}),(0,i.jsx)(I.A,{portSpeed:a}),n.service_provider?.name?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{size:"medium",children:(0,i.jsx)(E.sA,{id:"COMMON_ISP"})}),(0,i.jsx)(N.A,{size:"medium",color:"text-3",children:n.service_provider.name})]}):null,(0,i.jsxs)(i.Fragment,{children:[t.wan_dns1?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{color:"text-2",size:"medium",children:(0,i.jsx)(E.sA,{id:"COMMON_DNS_SERVER_N",values:{n:1}})}),(0,i.jsx)(N.A,{color:"text-3",size:"medium",children:t.wan_dns1})]}):null,t.wan_dns2?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{color:"text-2",size:"medium",children:(0,i.jsx)(E.sA,{id:"COMMON_DNS_SERVER_N",values:{n:2}})}),(0,i.jsx)(N.A,{color:"text-3",size:"medium",children:t.wan_dns2})]}):null]}),o&&l?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{size:"medium",children:(0,i.jsx)(E.sA,{id:"COMMON_DOWN_PKTS_BYTES"})}),(0,i.jsxs)(N.A,{size:"medium",color:"text-3",children:[(0,h.A)(o,{spacer:j.HY})," / ",(0,v.z3)(l)]})]}):null,c&&d?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{size:"medium",children:(0,i.jsx)(E.sA,{id:"COMMON_UP_PKTS_BYTES"})}),(0,i.jsxs)(N.A,{size:"medium",color:"text-3",children:[(0,h.A)(c,{spacer:j.HY})," / ",(0,v.z3)(d)]})]}):null,(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{size:"medium",children:(0,i.jsx)(E.sA,{id:"DEVICE_PROPERTY_UPLINK_DOWN_ACTIVITY"})}),(0,i.jsx)(N.A,{size:"medium",color:"text-3",children:void 0!==u?(0,i.jsx)(M.A,{type:"bytes",input:u,options:"bitrate",size:"body",color:"inherit"}):(0,i.jsx)(E.sA,{id:"COMMON_FALLBACK"})})]}),(0,i.jsxs)(T.A,{children:[(0,i.jsx)(N.A,{size:"medium",children:(0,i.jsx)(E.sA,{id:"DEVICE_PROPERTY_UPLINK_UP_ACTIVITY"})}),(0,i.jsx)(N.A,{size:"medium",color:"text-3",children:void 0!==_?(0,i.jsx)(M.A,{type:"bytes",input:_,options:"bitrate",size:"body",color:"inherit"}):(0,i.jsx)(E.sA,{id:"COMMON_FALLBACK"})})]})]})},S=({activeItem:e})=>{const{formatMessage:t}=(0,E.tz)(),n=((e,t)=>{const n=(e.port_table||[]).filter(({up:e})=>e);return Object.values(x.s).reduce((i,s)=>{const r=1===(0,l.si)(s)?c.C.WAN:s.toUpperCase();if(n.find(({ifname:t})=>t===(0,m.KF)(r,{ethernet_overrides:e.ethernet_overrides,model:e.model,usg_caps:e.usg_caps,usg2_caps:e.usg2_caps}))||(a=e[s],a?.type===C.YT)){const n=(0,p.q$)(e,s);n&&i.push({wanNetworkGroup:r,uplinkAttrs:n,...(()=>{const{configuration:e={},details:n={}}=t.find(({configuration:{wan_networkgroup:e}})=>e===r)||{};return{configuration:e,details:n}})(),gatewayPort:e[s]})}var a;return i},[])})(e,(0,s.d4)(_.ht)),h=(0,r.useMemo)(()=>n.map(({wanNetworkGroup:e})=>({id:e,label:t({id:"COMMON_NETWORK_PURPOSE_WANX"},{number:(0,l.si)(e)})})),[t,n]),N=(0,r.useMemo)(()=>n.map(({wanNetworkGroup:e,configuration:t={}})=>({value:e,label:t.name||"",additionalInfo:(0,i.jsx)(E.sA,{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:(0,l.si)(e)}})})),[n]),[M,v]=(0,r.useState)(n?.[0]?.wanNetworkGroup||c.C.WAN),O=n.length<=4,j=(0,r.useMemo)(()=>n.find(({wanNetworkGroup:e})=>e===M)||{},[n,M]),T=(0,r.useMemo)(()=>[{id:"wan",openByDefault:!0,label:(0,i.jsx)(E.sA,1===h.length?{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:1}}:{id:"COMMON_NETWORK_PURPOSE_WAN"}),renderContent:()=>(0,i.jsxs)(i.Fragment,{children:[h.length>1?(0,i.jsx)(A.A,{paddingBottom:d.kc,inline:O,children:O?(0,i.jsx)(a.A,{tabs:h,variant:"filter",onSelectTab:({id:e})=>{v(e)},selectedTab:M}):(0,i.jsx)(o.A,{options:N,width:"100%",variant:"secondary",value:M,onChange:({value:e})=>{v(e)}})}):null,(0,i.jsx)(w,{...j})]})}],[h,O,N,M,v,j]);return j?(0,i.jsx)(u.A,{type:u.I.ACCORDION,items:T}):null}},66177(e,t,n){n.d(t,{A:()=>_});var i=n(274934),s=n(906701),r=n(100978),a=n(535322),o=n(893762),l=n(382583),c=n(725870),d=n(924453),A=n(664613),u=n(597377),E=n(643334);const _=({name:e,model:t,ip:n,ipv6:_,lan_ip:m,mac:p,connection_network_id:C,displayable_version:x,uptime:h,sys_stats:N,systemStatsMem:M,type:v,deviceState:O,ethernet_overrides:j,port_table:T,uplink:I,device_mode_override:R})=>(0,i.jsx)(a.A,{children:(0,i.jsxs)(r.A,{height:"100%",flexDirection:"column",children:[(0,i.jsx)(u.A,{ip:n,lan_ip:m,type:v,ethernet_overrides:j,port_table:T,uplink:I,device_mode_override:R}),(0,i.jsx)(s.A,{ipv6_address:_}),(0,i.jsx)(l.A,{connection_network_id:C}),(0,i.jsx)(d.A,{mac:p}),(0,i.jsx)(E.A,{name:e,model:t,mac:p,type:v,displayable_version:x,uptime:h,deviceState:O}),(0,i.jsx)(o.A,{uptime:h}),(0,i.jsx)(c.A,{systemStatsMem:M}),(0,i.jsx)(A.A,{sys_stats:N})]})})},696049(e,t,n){n.d(t,{H:()=>i});const i=""},367821(e,t,n){n.d(t,{A:()=>l});var i=n(602086),s=n(977872),r=n(726831),a=n(575478),o=n(828373);const l=()=>{const e=(0,s.wA)(),t=(0,s.d4)(o.eo);return(0,i.useEffect)(()=>{t||(async()=>{const t=await fetch(r.A.fingerprintPublicDatabasePath),n=await t.json();e((0,a.$)(n))})()},[t,e]),t}},828373(e,t,n){n.d(t,{$E:()=>d,eo:()=>l});var i=n(222102),s=n(271656),r=n(720770),a=n(172205);const o=e=>e[a.U.UIDB]||(0,s.A)(),l=(0,i.Mz)(o,({version:e})=>Boolean(e)),c=(0,i.Mz)(o,({devices:e})=>e||(0,r.A)()),d=e=>(0,i.Mz)(c,t=>t.find(({shortnames:t})=>e&&(t||[]).includes(e))||(0,s.A)());(0,i.Mz)(c,e=>{const t=new Map;for(let n=0;n<e.length;n+=1){const i=e[n].power?.baseConsumption;if(void 0!==i){const{shortnames:s}=e[n];for(let e=0;e<(s||[]).length;e+=1)t.set(s[e],i)}}return t})},706925(e,t,n){n.d(t,{G:()=>o});var i=n(956978),s=n(857780);const r=[s.bq.USW,s.bq.UAP,s.bq.USP],a=[s.W4.UDBA69F],o=({type:e,model:t})=>(r.includes(e)||a.includes(t))&&!(0,i.tNJ)({model:t})},237887(e,t,n){n.d(t,{A:()=>u});var i=n(274934),s=n(602086),r=n(977872),a=n(693371),o=n(767822),l=n(820633),c=n(308111);const d=e=>(0,i.jsx)(a.A,{renderOption:o.q,...e}),A=e=>(0,i.jsx)(d,{...e});A.Sorted=e=>{const t=(0,r.d4)(l.zi),n=(0,s.useMemo)(()=>(0,c.k)(t),[t]);return(0,i.jsx)(d,{...e,sortBy:n})};const u=A},308111(e,t,n){n.d(t,{R:()=>A,k:()=>u});var i=n(696049),s=n(350068),r=n(177173),a=n(752104),o=n(64222),l=n(332530);const c=[...new Set([i.H,a.Q.join(a.A),r.Zt,o.F,s.nc,l.Vr])],d={numeric:!0,sensitivity:"base"},A=(e,t)=>{const n=[];for(let i=e;i<=t;i+=1)n.push({value:i,label:String(i)});return n},u=e=>({value:t,label:n},{value:i,label:s})=>c.includes(t?.toString())||c.includes(i?.toString())?1/0:n?.toString().localeCompare(s?.toString(),e,d)??-1},489714(e,t,n){n.d(t,{Z:()=>s});var i=n(570866);const s=e=>e?e.replace(i.SD,"").replace(i.fA,"$&:").substring(0,17).toLowerCase():e}}]);