"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[59491],{799329(e,t,i){i.d(t,{A:()=>r});var n=i(602086),s=i(141992);const r=(0,i(272338).w)(e=>(0,n.createElement)("svg",(0,s.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{d:"M6.5 4.5c0 1.649 1.09 3.03 2.651 4.642.31.32.849.097.849-.348V2.5a.48.48 0 0 0-.5-.487c-1.696.097-3 .724-3 2.487Zm9 2c-1.648 0-3.03 1.09-4.64 2.651a.495.495 0 0 0 .347.849H17.5a.48.48 0 0 0 .486-.5c-.096-1.696-.723-3-2.486-3Zm-11 7c1.648 0 3.03-1.09 4.64-2.651A.495.495 0 0 0 8.794 10H2.5a.48.48 0 0 0-.487.5c.097 1.696.724 3 2.487 3Zm6.349-2.64c1.56 1.611 2.651 2.993 2.651 4.641 0 1.763-1.304 2.39-3 2.487a.48.48 0 0 1-.5-.487v-6.293c0-.445.539-.668.849-.348Z",fill:"currentColor",className:e.twotonedclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 4.5c0 1.649 1.09 3.03 2.651 4.642.31.32.849.097.849-.348V2.5a.48.48 0 0 0-.5-.487c-1.696.097-3 .724-3 2.487Zm1 0c0 .953.496 1.852 1.5 3.006V3.07c-.474.074-.82.205-1.05.372-.251.181-.45.462-.45 1.058Zm8 2c-1.648 0-3.03 1.09-4.64 2.651a.495.495 0 0 0 .347.849H17.5a.48.48 0 0 0 .486-.5c-.096-1.696-.723-3-2.486-3Zm0 1c-.952 0-1.851.496-3.005 1.5h4.435c-.074-.474-.205-.82-.372-1.05-.181-.251-.462-.45-1.058-.45Zm-11 6c1.648 0 3.03-1.09 4.64-2.651A.495.495 0 0 0 8.794 10H2.5a.48.48 0 0 0-.487.5c.097 1.696.724 3 2.487 3ZM3.07 11h4.435C6.35 12.004 5.452 12.5 4.5 12.5c-.596 0-.877-.199-1.058-.45-.167-.23-.298-.576-.372-1.05Zm7.779-.14c1.56 1.611 2.651 2.993 2.651 4.641 0 1.763-1.304 2.39-3 2.487a.48.48 0 0 1-.5-.487v-6.293c0-.445.539-.668.849-.348ZM11 12.496v4.435c.474-.075.82-.205 1.05-.372.251-.181.45-.462.45-1.058 0-.952-.496-1.851-1.5-3.005Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{d:"M6.5 4.5c0 1.649 1.09 3.03 2.651 4.642.31.32.849.097.849-.348V2.5a.48.48 0 0 0-.5-.487c-1.696.097-3 .724-3 2.487Zm9 2c-1.648 0-3.03 1.09-4.64 2.651a.495.495 0 0 0 .347.849H17.5a.48.48 0 0 0 .486-.5c-.096-1.696-.723-3-2.486-3Zm-11 7c1.648 0 3.03-1.09 4.64-2.651A.495.495 0 0 0 8.794 10H2.5a.48.48 0 0 0-.487.5c.097 1.696.724 3 2.487 3Zm6.349-2.64c1.56 1.611 2.651 2.993 2.651 4.641 0 1.763-1.304 2.39-3 2.487a.48.48 0 0 1-.5-.487v-6.293c0-.445.539-.668.849-.348Z",fill:"currentColor",className:e.fillclassname})))},846485(e,t,i){var n;i.d(t,{b:()=>n}),function(e){e.MASTER="MASTER",e.BACKUP="BACKUP",e.MEMBER="MEMBER"}(n||(n={}))},453007(e,t,i){i.d(t,{A:()=>a});var n=i(938984),s=i(247816),r=i(291508);const a=(0,s.A)(n.A,(0,r.A)("colorOverride"))`
  ${({colorOverride:e})=>e?`color: ${e} !important`:""};
`},241092(e,t,i){i.d(t,{A:()=>T});var n=i(274934),s=i(558948),r=i(309130),a=i(376892),l=i(100978),o=i(535322),c=i(125799),d=i(814557),m=i(938984),_=i(799329),p=i(600191),u=i(247816),x=i(291508),A=i(470070);var h,j=i(820510);!function(e){e.ORANGE="orange",e.RED="red"}(h||(h={}));const v=(e,t)=>(e.index||0)-(t.index||0),E=(0,u.A)(_.A)`
  color: ${({theme:e})=>d.Ay[`desktop-color-neutral-00-${e.themeName}`]};
`,O=(0,u.A)(p.A,(0,x.A)("color"))`
  color: ${({theme:e,color:t})=>d.Ay[`desktop-color-${t}-06-${e.themeName}`]};
`,I=(0,u.A)(l.A)`
  width: ${r.S2};
  height: ${r.S2};
  border-radius: 4px;
  background-color: ${({theme:e})=>d.Ay[`desktop-color-green-06-${e.themeName}`]};
`,C=(0,u.A)(I)`
  background-color: ${({theme:e})=>d.Ay[`desktop-color-neutral-03-${e.themeName}`]};
`,f=({fan:{index:e,speed:t}})=>(0,n.jsxs)(j.m,{children:[(0,n.jsx)(j.Y,{id:"DEVICE_FAN",children:e}),(0,n.jsx)(j.Y,{id:"DEVICE_LEVEL",children:t})]}),g=({fan:e})=>(0,n.jsx)(c.A,{description:(0,n.jsx)(f,{fan:e}),width:100,children:(0,n.jsx)(I,{justifyContent:"center",alignItems:"center",children:(0,n.jsx)(E,{})})}),N=({index:e,messageId:t,color:i=h.ORANGE})=>(0,n.jsx)(c.A,{description:(0,n.jsx)(A.sA,{id:t,values:{index:e}}),width:199,children:(0,n.jsx)(C,{justifyContent:"center",alignItems:"center",children:(0,n.jsx)(O,{color:i,size:"original",variant:"fill"})})}),M=({fan:e})=>{switch(!0){case!e.present:return(0,n.jsx)(N,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:h.RED});case!!(1&e.critical_state):return(0,n.jsx)(N,{index:e.index,messageId:"DEVICE_FAN_SPEED_TOO_HIGH"});case!!(2&e.critical_state):return(0,n.jsx)(N,{index:e.index,messageId:"DEVICE_FAN_STOPPED"});case!!(4&e.critical_state):return(0,n.jsx)(N,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:h.RED});default:return(0,n.jsx)(g,{fan:e})}},w=({fan:e})=>(0,n.jsxs)(l.A,{flexDirection:"column",justifyContent:"center",alignItems:"center",children:[(0,n.jsx)(M,{fan:e}),(0,n.jsx)(m.A,{size:"small",color:"text-3",children:e.present&&void 0!==e.speed?e.speed:(0,n.jsx)(A.sA,{id:"COMMON_FALLBACK"})})]}),b=({fan_table:e})=>(0,n.jsx)(l.A,{flexDirection:"row",justifyContent:"center",gap:r.S2,children:e.sort(v).map(e=>(0,n.jsx)(w,{fan:e},e.index))});var y=i(203071);const T=({psu_table:e=[],fan_table:t=[]})=>e.length>0?(0,n.jsx)(o.A,{type:o.I.ACCORDION,items:[{id:"powerSource",openByDefault:!0,label:(0,n.jsx)(a.A,{id:t.length?"DEVICE_HEADER_POWER_AND_FAN_UTILIZATION":"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>(0,n.jsxs)(l.A,{flexDirection:"column",gap:r.Ln,children:[(0,n.jsx)(y.A,{psuTable:e,marginBottom:0}),t.length?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.A,{}),(0,n.jsx)(b,{fan_table:t})]}):null]})}]}):null},665367(e,t,i){i.d(t,{A:()=>l});var n=i(274934),s=i(938984),r=i(470070),a=i(664092);const l=({local_uplink_port:e})=>e?(0,n.jsxs)(a.A,{children:[(0,n.jsx)(s.A,{color:"text-2",size:"medium",children:(0,n.jsx)(r.sA,{id:"COMMON_CONNECTED_VIA"})}),(0,n.jsx)(s.A,{color:"text-3",size:"medium",children:(0,n.jsx)(r.sA,{id:"COMMON_LOCAL_UPLINK_PORT",values:{portIdx:e}})})]}):null},203071(e,t,i){i.d(t,{A:()=>g});var n=i(274934),s=i(602086),r=i(43009),a=i(125799),l=i(814557),o=i(367551),c=i(900302),d=i(938984),m=i(600191),_=i(247816),p=i(263705),u=i(662986),x=i(309130),A=i(100978),h=i(453007),j=i(470070),v=i(314229),E=i(820510);const O=(0,_.A)(A.A)`
  justify-content: space-between;
`,I=(0,_.A)(c.A)`
  margin: 0 6px;
  height: 10px;
`,C=(0,_.A)(m.A)`
  margin: 0 6px;
`,f=({index:e,item:t})=>(0,n.jsxs)(E.m,{children:[(0,n.jsx)(E.Y,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:""},children:e+1}),t.temp?Object.entries(t.temp).map(([e,t])=>(0,n.jsxs)(E.Y,{id:"DEVICE_TEMPERATURE_SENSOR",values:{index:+e+1},children:[t?.toFixed(1)||(0,n.jsx)(j.sA,{id:"COMMON_FALLBACK"})," ",(0,n.jsx)(j.sA,{id:"COMMON_UNIT_CELSIUS"})]},e)):null,t.fanSpeed?(0,n.jsxs)(E.Y,{id:"DEVICE_FAN_SPEED",children:[t.fanSpeed," ",(0,n.jsx)(j.sA,{id:"COMMON_UNIT_RPM"})]}):null]}),g=({psuTable:e=[],marginBottom:t})=>{const{themeName:i,motifPalette:c}=(0,p.u)(),{motif:m}=(0,r.A)(),{formatMessage:_}=(0,j.tz)(),E=(0,s.useMemo)(()=>e.map(({power:t,power_capacity:s,temp:r,fan:p,present:x,online:E,label:g},N)=>{const M=s||550,w=Math.ceil(Number.parseFloat(t)/M*100),b={variant:(0,v.NH)(w),value:w,temp:r,fanSpeed:p?.[0],online:E,present:x},y=e?.[N]?.power;return(0,n.jsxs)(A.A,{flexDirection:"column",children:[(0,n.jsxs)(O,{children:[(0,n.jsx)(d.A,{color:"text-2",size:"medium",children:(0,n.jsx)(j.sA,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:N+1}})}),(0,n.jsx)(A.A,{justifyContent:"space-between",alignItems:"center",children:b.present?(0,n.jsxs)(n.Fragment,{children:[b.online||b.value?null:(0,n.jsx)(a.A,{description:_({id:"DEVICE_USW_MC_PSU_OFFLINE_TOOLTIP"},{index:N+1}),portal:!0,children:(0,n.jsx)(C,{size:"original",variant:"fill",color:l.Ay[`desktop-color-orange-06-${i}`],fill:l.Ay[`desktop-color-neutral-00-${i}`]})}),b.online?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.A,{color:"text-3",size:"medium",children:(0,n.jsx)(j.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:`${Math.ceil(Number.parseFloat(y))}/${M}`}})}),(0,n.jsx)(I,{orientation:"vertical",color:l.Ay[`desktop-color-neutral-04-${i}`]}),(0,n.jsx)(h.A,{size:"medium",colorOverride:b.value?c[b.variant]:l.Ay[`desktop-color-text-3-${m}`],children:(0,u.A)(b.value)})]}):null]}):(0,n.jsx)(d.A,{color:"text-3",size:"medium",children:(0,n.jsx)(j.sA,{id:"DEVICE_NOT_INSTALLED"})})})]}),(0,n.jsx)(a.A,{description:b.present?(0,n.jsx)(f,{index:N,item:b}):null,width:250,children:(0,n.jsx)(o.A,{items:[b],rounded:!0})})]},g)}),[e]);return(0,n.jsx)(A.A,{flexDirection:"column",marginBottom:t??x.kI,gap:x.kc,children:E})}},384780(e,t,i){i.d(t,{A:()=>$});var n=i(274934),s=i(814557),r=i(977872),a=i(602086),l=i(125799),o=i(792929),c=i(600191),d=i(263705),m=i(244081),_=i(112104),p=i(61322),u=i(449339),x=i(974390),A=i(650632),h=i(535322),j=i(205521),v=i(347625),E=i(754924),O=i(223597),I=i(34118),C=i(239627),f=i(645682),g=i(254590),N=i(857780);const M=({name:e,mac:t,model:i})=>e===t&&i?i:e,w=e=>{switch(e?.uplink?.type){case N.au.WIRE:return e?.connection_network_name||g.L;case N.au.WIRELESS:return e?.connection_network_name||e?.uplink?.essid||g.L;default:return g.L}};var b,y=i(599110),T=i(594005),D=i(309130),S=i(421314);!function(e){e.NAME="name",e.PORT="port",e.NETWORK="network"}(b||(b={}));const k={[b.NAME]:"COMMON_NAME",[b.PORT]:"COMMON_PORT",[b.NETWORK]:"COMMON_NETWORK"};var R=i(100978),P=i(470070),L=i(850352);const z=({port:e,mac:t})=>{const{handleGoToPortsPage:i}=(0,L.e)();return(0,n.jsx)(y.A,{variant:"inline",type:"button",size:"medium",onClick:()=>{i(t,e)},children:e})},$=({activeItem:e})=>{const{themeName:t}=(0,d.u)(),i=(0,r.wA)(),g=(0,r.d4)(E.ID),N=(0,a.useMemo)(()=>((e,t)=>(e||[]).map(e=>{const i=t.find(({mac:t})=>t===e.mac||t===e.ap_mac);return i?{...e,id:i._id,name:(0,v.Q)(i),activeItem:i,model:(0,v.Lm)(i.model)}:null}).filter(Boolean))(e.downlink_table,g),[e.downlink_table,g]),y=(0,r.d4)((0,I.Ax)(e.mac)).filter(e=>e.type===O.sK.WIRED);(0,a.useEffect)(()=>{i((0,C.$3)(void 0,{crudCacheStrategy:{type:m.e.CACHE}}))},[i]);const L=(0,a.useMemo)(()=>y.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,n.jsx)(A.A,{client:e}),isClient:!0})),[y]),$=(0,a.useMemo)(()=>N.map(({id:e,name:i,mac:r,port_idx:a,activeItem:o})=>({id:`${e}${a}`,name:M({name:i,mac:o.mac,model:o.model}),mac:r,network:w(o),port:a,image:(0,n.jsx)(x.A,{model:o.model}),isClient:!1,warning:o.detailed_states?.negotiated_low_uplink_port_speed?(0,n.jsx)(l.A,{portal:!0,description:(0,n.jsx)(f.A,{color:"text-1"}),children:(0,n.jsx)(c.A,{size:"medium",color:s.Ay[`desktop-color-orange-06-${t}`]})}):void 0,stacking_group_id:o.stacking_group_id})),[N,s.Ay[`desktop-color-orange-06-${t}`]]),F=(0,a.useMemo)(()=>Array.prototype.concat.apply([],[L,$]),[$,L]),U=(0,a.useMemo)(()=>(({mac:e})=>[{id:b.NAME,label:(0,n.jsx)(P.sA,{id:k[b.NAME]}),renderCell:({image:e,name:t})=>(0,n.jsxs)(R.A,{alignItems:"center",justifyContent:"center",width:"100%",children:[(0,n.jsx)(R.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px",children:e}),(0,n.jsx)(S.A,{color:"inherit",size:"medium",style:{width:"170px",paddingLeft:"6px",paddingRight:"6px"},children:t})]}),width:170,compare:(0,T.l0)(({name:e})=>e)},{id:b.NETWORK,label:(0,n.jsx)(P.sA,{id:k[b.NETWORK]}),renderCell:({network:e})=>(0,n.jsx)(S.A,{color:"inherit",size:"medium",children:e}),width:112,compare:(0,T.l0)(({network:e})=>e)},{id:b.PORT,align:"right",label:(0,n.jsx)(P.sA,{id:k[b.PORT]}),renderCell:({port:t,warning:i})=>(0,n.jsxs)(R.A,{justifyContent:"flex-end",alignItems:"center",flexGrow:1,children:[(0,n.jsx)(R.A,{marginTop:-2,marginRight:D.YC,children:i}),(0,n.jsx)(z,{port:t,mac:e})]}),width:54,compare:(0,T.l0)(({port:e})=>e)}])({mac:e.mac}),[e.mac]),H=(0,a.useCallback)(({mac:e,isClient:t,stacking_group_id:n})=>{i((0,j.XP)({type:t?u.H.CLIENT:n?u.H.STACKING:u.H.DEVICE,id:n||e}))},[i]),{rowLimit:V,renderFooter:W}=(0,_.A)(F.length,{defaultCount:10});return F.length?(0,n.jsx)(h.A,{children:(0,n.jsx)(o.A,{items:F,columns:U,idField:"id",initialSortBy:"port",initiallySortAscending:!0,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:H,rowLimit:V,renderFooter:()=>W,rowHeight:p.I.ROW_HEIGHT,truncateHeaderCells:!0})}):null}},203155(e,t,i){i.d(t,{A:()=>C});var n=i(274934),s=i(376892),r=i(535322),a=i(977872),l=i(602086),o=i(938984),c=i(95032),d=i(878151),m=i(599110),_=i(590979),p=i(320509),u=i(449339),x=i(100978),A=i(205521),h=i(470070),j=i(853109),v=i(754924),E=i(664092),O=i(631692);const I=({activeItem:e})=>{const{speed:t,rx_packets:i,rx_bytes:s,tx_packets:r,tx_bytes:I}=(0,j.q$)(e)||{},C=(0,a.d4)((0,l.useMemo)(()=>(0,v.I4)(e.mac),[e.mac])),{poe_power:f=null,port_poe:g=!1}=(0,j.$Y)({device:e,uplink:C})||{},N=(0,a.wA)(),{formatMessage:M}=(0,h.tz)(),w=(0,l.useCallback)(()=>{N((0,A.XP)({type:u.H.DEVICE,id:C?.mac}))},[N,C?.mac]);return(0,n.jsxs)(x.A,{height:"100%",flexDirection:"column",children:[C?.mac?(0,n.jsxs)(E.A,{children:[(0,n.jsx)(o.A,{size:"medium",children:(0,n.jsx)(h.sA,{id:"COMMON_DEVICE"})}),(0,n.jsx)(m.A,{type:"button",variant:"inline",onClick:w,..._.A.addDataTestId(_.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(c.A,{color:"inherit",size:"medium",isTruncated:!0,children:(0,j.Jz)(e,C,M)})})]}):null,(0,n.jsx)(O.A,{portSpeed:t}),g&&Number(f)>0?(0,n.jsxs)(E.A,{children:[(0,n.jsx)(o.A,{size:"medium",children:(0,n.jsx)(h.sA,{id:"DEVICE_PROPERTY_UPLINK_POWER"})}),(0,n.jsx)(o.A,{size:"medium",color:"text-3",children:(0,n.jsx)(h.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:f}})})]}):null,i&&s?(0,n.jsxs)(E.A,{children:[(0,n.jsx)(o.A,{size:"medium",children:(0,n.jsx)(h.sA,{id:"COMMON_DOWN_PKTS_BYTES"})}),(0,n.jsxs)(o.A,{size:"medium",color:"text-3",children:[(0,n.jsx)(d.A,{type:"number",input:i,size:"body",color:"tertiary"})," / ",(0,p.z3)(s)]})]}):null,r&&I?(0,n.jsxs)(E.A,{children:[(0,n.jsx)(o.A,{size:"medium",children:(0,n.jsx)(h.sA,{id:"COMMON_UP_PKTS_BYTES"})}),(0,n.jsxs)(o.A,{size:"medium",color:"text-3",children:[(0,n.jsx)(d.A,{type:"number",input:r,size:"body",color:"tertiary"})," / ",(0,p.z3)(I)]})]}):null]})},C=({activeItem:e})=>(0,n.jsx)(r.A,{type:r.I.ACCORDION,items:[{id:"uplink",openByDefault:!0,label:(0,n.jsx)(s.A,{id:"COMMON_PARENT_DEVICE"}),renderContent:()=>(0,n.jsx)(I,{activeItem:e})}]})},924337(e,t,i){i.d(t,{Ay:()=>j,eY:()=>A,t8:()=>h});var n=i(274934),s=i(602086),r=i(383061),a=i(938984),l=i(409844),o=i(237887),c=i(309130),d=i(100978),m=i(535322),_=i(470070),p=i(262457),u=i(754005);const x=l.AH`
  width: unset;
`,A="group",h=({activeItem:e,addGroupOption:t})=>{const{formatMessage:i}=(0,_.tz)(),{switchId:a,setSwitchId:l}=(0,p.y)(),c=(0,s.useCallback)(e=>l(e.id),[l]),d=[...t?[{id:A,label:i({id:"COMMON_GROUP"})}]:[],...Object.keys(e.devicesData).map((e,t)=>({id:e,label:i({id:"COMMON_SWITCH_N"},{n:t+1})}))];return d.length>u.e?(0,n.jsx)(o.A,{variant:"secondary",width:"100%",portal:!0,options:d.map(({id:e,label:t})=>({value:e,label:t})),value:a,onChange:({value:e})=>{l(e)},placeholder:i({id:"SETTINGS_TRAFFIC_ROUTES_INTERFACE_SELECT"})}):(0,n.jsx)(r.A,{tabs:d,onSelectTab:c,selectedTab:a,variant:"filter",className:x})},j=e=>(0,n.jsx)(m.A,{children:(0,n.jsxs)(d.A,{flexDirection:"column",height:"100%",gap:c.Ln,alignItems:"start",children:[(0,n.jsx)(a.A,{weight:"bold",size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_STACKED_SWITCHES"})}),(0,n.jsx)(h,{...e})]})})},754005(e,t,i){i.d(t,{e:()=>n});const n=5},659491(e,t,i){i.r(t),i.d(t,{default:()=>R});var n=i(274934),s=i(586566);i(846485);var r=i(469890),a=i(956978),l=i(853109),o=i(434521),c=i(45978),d=i(383550),m=i(906701),_=i(100978),p=i(535322),u=i(893762),x=i(446722),A=i(938984),h=i(470070),j=i(664092);const v=({isDeviceOffline:e})=>(0,n.jsxs)(j.A,{children:[(0,n.jsx)(A.A,{color:"text-2",size:"medium",children:(0,n.jsx)(h.sA,{id:"COMMON_STATUS"})}),(0,n.jsx)(A.A,{color:"text-3",size:"medium",children:(0,n.jsx)(h.sA,{id:e?"COMMON_OFFLINE":"COMMON_ONLINE"})})]});var E=i(725870),O=i(924453),I=i(665367),C=i(597377),f=i(418193),g=i(643334);const N=({name:e,model:t,ip:i,lan_ip:s,ipv6:r,mac:a,displayable_version:l,uptime:o,has_temperature:c,has_fan:d,overheating:A,general_temperature:h,fan_level:j,systemStatsMem:N,fan_table:M,local_uplink_port:w,isDeviceOffline:b,hide_uplink:y,type:T,deviceState:D,ethernet_overrides:S,port_table:k,uplink:R,device_mode_override:P})=>(0,n.jsx)(p.A,{children:(0,n.jsxs)(_.A,{height:"100%",flexDirection:"column",children:[y?null:(0,n.jsx)(I.A,{local_uplink_port:w}),void 0===b?null:(0,n.jsx)(v,{isDeviceOffline:b}),(0,n.jsx)(C.A,{ip:i,lan_ip:s,type:T,ethernet_overrides:S,port_table:k,uplink:R,device_mode_override:P}),(0,n.jsx)(m.A,{ipv6_address:r}),(0,n.jsx)(O.A,{mac:a}),(0,n.jsx)(g.A,{name:e,model:t,mac:a,type:T,displayable_version:l,uptime:o,deviceState:D}),(0,n.jsx)(u.A,{uptime:o}),(0,n.jsx)(x.A,{has_temperature:c,overheating:A,general_temperature:h}),M?null:(0,n.jsx)(f.A,{has_fan:d,fan_level:j}),(0,n.jsx)(E.A,{systemStatsMem:N})]})});var M=i(262457),w=i(924337),b=i(808202),y=i(241092),T=i(203155),D=i(384780);const S=({activeItem:e,selectedSwitchData:t})=>{const i=Object.values(e.devicesData)[0],m=(0,o.S9)(t),_=(0,a.aK8)(m||c.g.DISCONNECTED),p=(({mac:e},t)=>{const i=t.devicesData?.[e],n=i?.uplink?.uplink_mac;return!(!n||t.devicesData[n])})(t,e),{port_idx:u}=(0,l.q$)(t)||{},{mac:x,type:A,model:h,port_table:j,total_used_power:v,total_max_power:E,detailed_states:{device_near_power_limit:O,device_near_effective_power_limit:I}={device_near_power_limit:!1,device_near_effective_power_limit:!1},uptime:C,has_temperature:f,overheating:g,general_temperature:M,fan_level:S,fan_table:k,has_fan:R,"system-stats":P,uplink:L,device_mode_override:z}=t;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.A,{activeItem:i,multipleDisplayedDevicesData:Object.values(e.devicesData),showPortOverview:!0,isStacking:!0}),(0,n.jsx)(N,{ip:i.ip,lan_ip:i.lan_ip,ipv6:i.ipv6,displayable_version:i.displayable_version,ethernet_overrides:i.ethernet_overrides,port_table:i.port_table,uplink:i.uplink,device_mode_override:i.device_mode_override}),(0,n.jsx)(w.Ay,{activeItem:e}),(0,n.jsx)(y.A,{psu_table:t?.psu_table,fan_table:t?.fan_table}),_?null:(0,n.jsxs)(n.Fragment,{children:[(0,r.b0)(j)?(0,n.jsx)(b.A,{mac:x,type:A,model:h,device_near_power_limit:O,device_near_effective_power_limit:I,total_used_power:v,total_max_power:E,isPoeAdapter:(0,s.Y6)(t)}):null,(0,n.jsx)(D.A,{activeItem:t})]}),(0,n.jsx)(N,{ethernet_overrides:t.ethernet_overrides,port_table:t.port_table,mac:x,uptime:C,has_temperature:f,has_fan:R,overheating:g,general_temperature:M,fan_level:S,fan_table:k,systemStatsMem:P?.mem,local_uplink_port:u,isDeviceOffline:_,hide_uplink:!p,uplink:L,device_mode_override:z}),!_&&p?(0,n.jsx)(T.A,{activeItem:t}):null]})},k=({activeItem:e})=>{const{switchId:t}=(0,M.y)(),i=e.devicesData[t];return i?(0,n.jsx)(S,{activeItem:e,selectedSwitchData:i}):null},R=({activeItem:e})=>(0,n.jsx)(M.u,{initialSwitchId:Object.keys(e.devicesData)[0],children:(0,n.jsx)(k,{activeItem:e})})},262457(e,t,i){i.d(t,{u:()=>a,y:()=>l});var n=i(274934),s=i(602086);const r=(0,s.createContext)({}),a=({children:e,initialSwitchId:t})=>{const[i,a]=(0,s.useState)(t),l=(0,s.useMemo)(()=>({switchId:i,setSwitchId:a}),[i]);return(0,n.jsx)(r.Provider,{value:l,children:e})},l=()=>(0,s.useContext)(r)}}]);