"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[36172],{15532:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(296540),n=a(927099),r=a(699784),i=a(360113);const c=({has_fan:e,fan_level:t})=>e&&Number.isFinite(t)?l.createElement(i.A,null,l.createElement(n.A,{color:"secondary",size:"body"},l.createElement(r.sA,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_LEVEL"})),l.createElement(n.A,{color:"tertiary",size:"body"},t)):null},45481:(e,t,a)=>{a.d(t,{A:()=>s});var l=a(296540),n=a(271856),r=a(927099),i=a(888170),c=a(823858),m=a(699784),o=a(360113);const s=({has_temperature:e,overheating:t,general_temperature:a})=>e&&Number.isFinite(a)?l.createElement(o.A,null,l.createElement(r.A,{color:"secondary",size:"body"},l.createElement(m.sA,{id:"COMMON_TEMPERATURE"})),l.createElement(r.A,{color:"tertiary",size:"body"},l.createElement(l.Fragment,null,l.createElement(m.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:a}}),t?l.createElement(n.A,{description:l.createElement(m.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_OVERHEATING"}),width:180,position:"left",className:"ml-1",style:{display:"inline-block",verticalAlign:"text-bottom"}},l.createElement(c.A,{style:{color:i.Ay["color-danger"]}})):null))):null},167308:(e,t,a)=>{a.d(t,{Ay:()=>v,eY:()=>A,t8:()=>p});var l=a(296540),n=a(979106),r=a(217439),i=a(132196),c=a(362412),m=a(566723),o=a(294303),s=a(689965),E=a(699784),d=a(506698),_=a(436540);const u=i.AH`
  width: unset;
`,A="group",p=({activeItem:e,addGroupOption:t})=>{const{formatMessage:a}=(0,E.tz)(),{switchId:r,setSwitchId:i}=(0,d.y)(),m=(0,l.useCallback)(e=>i(e.id),[i]),o=[...t?[{id:A,label:a({id:"COMMON_GROUP"})}]:[],...Object.keys(e.devicesData).map((e,t)=>({id:e,label:a({id:"COMMON_SWITCH_N"},{n:t+1})}))];return o.length>_.e?l.createElement(c.A,{variant:"secondary",width:"100%",portal:!0,options:o.map(({id:e,label:t})=>({value:e,label:t})),value:r,onChange:({value:e})=>{i(e)},placeholder:a({id:"SETTINGS_TRAFFIC_ROUTES_INTERFACE_SELECT"})}):l.createElement(n.A,{tabs:o,onSelectTab:m,selectedTab:r,variant:"filter",className:u})},v=e=>l.createElement(s.A,null,l.createElement(o.A,{flexDirection:"column",height:"100%",gap:m.Ln,alignItems:"start"},l.createElement(r.A,{weight:"bold",size:"medium"},l.createElement(E.sA,{id:"COMMON_STACKED_SWITCHES"})),l.createElement(p,{...e})))},217884:(e,t,a)=>{var l;a.d(t,{b:()=>l}),function(e){e.MASTER="MASTER",e.BACKUP="BACKUP",e.MEMBER="MEMBER"}(l||(l={}))},236172:(e,t,a)=>{a.r(t),a.d(t,{default:()=>k});var l=a(296540),n=a(860631);a(217884);var r=a(578819),i=a(780811),c=a(927806),m=a(837612),o=a(602197),s=a(812454),E=a(146784),d=a(294303),_=a(689965),u=a(999063),A=a(45481),p=a(927099),v=a(699784),I=a(360113);const O=({isDeviceOffline:e})=>l.createElement(I.A,null,l.createElement(p.A,{color:"secondary",size:"body"},l.createElement(v.sA,{id:"COMMON_STATUS"})),l.createElement(p.A,{color:"tertiary",size:"body"},l.createElement(v.sA,{id:e?"COMMON_OFFLINE":"COMMON_ONLINE"})));var f=a(32753),h=a(723544),N=a(507976),C=a(400242),g=a(15532),y=a(500045);const b=({ip:e,lan_ip:t,ipv6:a,mac:n,displayable_version:r,uptime:i,has_temperature:c,has_fan:m,overheating:o,general_temperature:s,fan_level:p,systemStatsMem:v,fan_table:I,local_uplink_port:b,isDeviceOffline:M,hide_uplink:D})=>l.createElement(_.A,null,l.createElement(d.A,{height:"100%",flexDirection:"column"},D?null:l.createElement(N.A,{local_uplink_port:b}),void 0===M?null:l.createElement(O,{isDeviceOffline:M}),l.createElement(C.A,{ip:e,lan_ip:t}),l.createElement(E.A,{ipv6_address:a}),l.createElement(h.A,{mac:n}),l.createElement(y.A,{displayable_version:r}),l.createElement(u.A,{uptime:i}),l.createElement(A.A,{has_temperature:c,overheating:o,general_temperature:s}),I?null:l.createElement(g.A,{has_fan:m,fan_level:p}),l.createElement(f.A,{systemStatsMem:v})));var M=a(506698),D=a(167308),T=a(889879),S=a(720282),x=a(13524),w=a(442728);const R=({activeItem:e,selectedSwitchData:t})=>{const a=Object.values(e.devicesData)[0],E=(0,l.useMemo)(()=>(0,i.aK8)((0,m.S9)(t)||o.g.DISCONNECTED),[t]),d=(0,l.useMemo)(()=>(({mac:e},t)=>{const a=t.devicesData?.[e],l=a?.uplink?.uplink_mac;return!(!l||t.devicesData[l])})(t,e),[t,e]),{port_idx:_}=(0,c.q$)(t)||{},{mac:u,type:A,model:p,port_table:v,total_used_power:I,total_max_power:O,detailed_states:{device_near_power_limit:f,device_near_effective_power_limit:h}={device_near_power_limit:!1,device_near_effective_power_limit:!1},uptime:N,has_temperature:C,overheating:g,general_temperature:y,fan_level:M,fan_table:R,has_fan:P,"system-stats":k}=t;return l.createElement(l.Fragment,null,l.createElement(s.A,{activeItem:a,multipleDisplayedDevicesData:Object.values(e.devicesData),showPortOverview:!0,isStacking:!0}),l.createElement(b,{ip:a.ip,lan_ip:a.lan_ip,ipv6:a.ipv6,displayable_version:a.displayable_version}),l.createElement(D.Ay,{activeItem:e}),l.createElement(S.A,{psu_table:t?.psu_table,fan_table:t?.fan_table}),E?null:l.createElement(l.Fragment,null,(0,r.b0)(v)?l.createElement(T.A,{mac:u,type:A,model:p,device_near_power_limit:f,device_near_effective_power_limit:h,total_used_power:I,total_max_power:O,isPoeAdapter:(0,n.Y6)(t)}):null,l.createElement(w.A,{activeItem:t})),l.createElement(b,{mac:u,uptime:N,has_temperature:C,has_fan:P,overheating:g,general_temperature:y,fan_level:M,fan_table:R,systemStatsMem:k?.mem,local_uplink_port:_,isDeviceOffline:E,hide_uplink:!d}),!E&&d?l.createElement(x.A,{activeItem:t}):null)},P=({activeItem:e})=>{const{switchId:t}=(0,M.y)(),a=e.devicesData[t];return a?l.createElement(R,{activeItem:e,selectedSwitchData:a}):null},k=({activeItem:e})=>l.createElement(M.u,{initialSwitchId:Object.keys(e.devicesData)[0]},l.createElement(P,{activeItem:e}))},418328:(e,t,a)=>{a.d(t,{A:()=>g});var l=a(296540),n=a(325898),r=a(271856),i=a(822336),c=a(773412),m=a(84385),o=a(217439),s=a(823858),E=a(71479),d=a(998837),_=a(178233),u=a(566723),A=a(294303),p=a(532114),v=a(699784),I=a(757167),O=a(53765);const f=(0,E.A)(A.A)`
  justify-content: space-between;
`,h=(0,E.A)(m.A)`
  margin: 0 6px;
  height: 10px;
`,N=(0,E.A)(s.A)`
  margin: 0 6px;
`,C=({index:e,item:t})=>l.createElement(O.m,null,l.createElement(O.Y,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:""}},e+1),t.temp?Object.entries(t.temp).map(([e,t])=>l.createElement(O.Y,{id:"DEVICE_TEMPERATURE_SENSOR",values:{index:+e+1},key:e},t?.toFixed(1)||l.createElement(v.sA,{id:"COMMON_FALLBACK"})," ",l.createElement(v.sA,{id:"COMMON_UNIT_CELSIUS"}))):null,t.fanSpeed?l.createElement(O.Y,{id:"DEVICE_FAN_SPEED"},t.fanSpeed," ",l.createElement(v.sA,{id:"COMMON_UNIT_RPM"})):null),g=({psuTable:e=[],marginBottom:t})=>{const{motifPalette:{neutral00:a,warning:m},motifPalette:s}=(0,d.u)(),{motif:E}=(0,n.A)(),{formatMessage:O}=(0,v.tz)(),g=(0,l.useMemo)(()=>e.map(({power:t,power_capacity:n,temp:d,fan:u,present:g,online:y,label:b},M)=>{const D=n||550,T=Math.ceil(parseFloat(t)/D*100),S={variant:(0,I.NH)(T),value:T,temp:d,fanSpeed:u?.[0],online:y,present:g},x=e?.[M]?.power;return l.createElement(A.A,{flexDirection:"column",key:b},l.createElement(f,null,l.createElement(o.A,{color:"text-2",size:"medium"},l.createElement(v.sA,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:M+1}})),l.createElement(A.A,{justifyContent:"space-between",alignItems:"center"},S.present?l.createElement(l.Fragment,null,S.online||S.value?null:l.createElement(r.A,{description:O({id:"DEVICE_USW_MC_PSU_OFFLINE_TOOLTIP"},{index:M+1}),portal:!0},l.createElement(N,{size:"original",variant:"fill",color:m,fill:a})),S.online?l.createElement(l.Fragment,null,l.createElement(o.A,{color:"text-3",size:"medium"},l.createElement(v.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:`${Math.ceil(parseFloat(x))}/${D}`}})),l.createElement(h,{orientation:"vertical",color:s.neutral04}),l.createElement(p.A,{size:"medium",colorOverride:S.value?s[S.variant]:i.Ay[`desktop-color-text-3-${E}`]},(0,_.A)(S.value))):null):l.createElement(o.A,{color:"text-3",size:"medium"},l.createElement(v.sA,{id:"DEVICE_NOT_INSTALLED"})))),l.createElement(r.A,{description:S.present?l.createElement(C,{index:M,item:S}):null,width:250},l.createElement(c.A,{items:[S],rounded:!0})))}),[e]);return l.createElement(A.A,{flexDirection:"column",marginBottom:t??u.kI,gap:u.kc},g)}},436540:(e,t,a)=>{a.d(t,{e:()=>l});const l=5},506698:(e,t,a)=>{a.d(t,{u:()=>r,y:()=>i});var l=a(296540);const n=(0,l.createContext)({}),r=({children:e,initialSwitchId:t})=>{const[a,r]=(0,l.useState)(t),i=(0,l.useMemo)(()=>({switchId:a,setSwitchId:r}),[a]);return l.createElement(n.Provider,{value:i},e)},i=()=>(0,l.useContext)(n)},507976:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(296540),n=a(927099),r=a(699784),i=a(360113);const c=({local_uplink_port:e})=>e?l.createElement(i.A,null,l.createElement(n.A,{color:"secondary",size:"body"},l.createElement(r.sA,{id:"COMMON_CONNECTED_VIA"})),l.createElement(n.A,{color:"tertiary",size:"body"},l.createElement(r.sA,{id:"COMMON_LOCAL_UPLINK_PORT",values:{portIdx:e}}))):null},532114:(e,t,a)=>{a.d(t,{A:()=>n});var l=a(217439);const n=(0,a(71479).A)(l.A,{shouldForwardProp:e=>"colorOverride"!==e})`
  ${({colorOverride:e})=>e?`color: ${e} !important`:""};
`},720282:(e,t,a)=>{a.d(t,{A:()=>P});var l=a(296540),n=a(231755),r=a(566723),i=a(86571),c=a(294303),m=a(689965),o=a(271856),s=a(822336),E=a(217439),d=a(920360),_=a(823858),u=a(71479),A=a(311785),p=a(699784);const v=1,I=2,O=4;var f,h=a(53765);!function(e){e.ORANGE="orange",e.RED="red"}(f||(f={}));const N=(e,t)=>(e.index||0)-(t.index||0),C=(0,u.A)(d.A)`
  color: ${({theme:e})=>s.Ay[`desktop-color-neutral-00-${e.themeName}`]};
`,g=(0,u.A)(_.A,(0,A.A)("color"))`
  color: ${({theme:e,color:t})=>s.Ay[`desktop-color-${t}-06-${e.themeName}`]};
`,y=(0,u.A)(c.A)`
  width: ${r.S2};
  height: ${r.S2};
  border-radius: 4px;
  background-color: ${({theme:e})=>s.Ay[`desktop-color-green-06-${e.themeName}`]};
`,b=(0,u.A)(y)`
  background-color: ${({theme:e})=>s.Ay[`desktop-color-neutral-03-${e.themeName}`]};
`,M=({fan:{index:e,speed:t}})=>l.createElement(h.m,null,l.createElement(h.Y,{id:"DEVICE_FAN"},e),l.createElement(h.Y,{id:"DEVICE_LEVEL"},t)),D=({fan:e})=>l.createElement(o.A,{description:l.createElement(M,{fan:e}),width:100},l.createElement(y,{justifyContent:"center",alignItems:"center"},l.createElement(C,null))),T=({index:e,messageId:t,color:a=f.ORANGE})=>l.createElement(o.A,{description:l.createElement(p.sA,{id:t,values:{index:e}}),width:199},l.createElement(b,{justifyContent:"center",alignItems:"center"},l.createElement(g,{color:a,size:"original",variant:"fill"}))),S=({fan:e})=>{switch(!0){case!e.present:return l.createElement(T,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:f.RED});case!!(e.critical_state&v):return l.createElement(T,{index:e.index,messageId:"DEVICE_FAN_SPEED_TOO_HIGH"});case!!(e.critical_state&I):return l.createElement(T,{index:e.index,messageId:"DEVICE_FAN_STOPPED"});case!!(e.critical_state&O):return l.createElement(T,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:f.RED});default:return l.createElement(D,{fan:e})}},x=({fan:e})=>l.createElement(c.A,{flexDirection:"column",justifyContent:"center",alignItems:"center"},l.createElement(S,{fan:e}),l.createElement(E.A,{size:"small",color:"text-3"},e.present&&void 0!==e.speed?e.speed:l.createElement(p.sA,{id:"COMMON_FALLBACK"}))),w=({fan_table:e})=>l.createElement(c.A,{flexDirection:"row",justifyContent:"center",gap:r.S2},e.sort(N).map(e=>l.createElement(x,{key:e.index,fan:e})));var R=a(418328);const P=({psu_table:e=[],fan_table:t=[]})=>e.length>0?l.createElement(m.A,{type:m.I.ACCORDION,items:[{id:"powerSource",openByDefault:!0,label:l.createElement(i.A,{id:t.length?"DEVICE_HEADER_POWER_AND_FAN_UTILIZATION":"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>l.createElement(c.A,{flexDirection:"column",gap:r.Ln},l.createElement(R.A,{psuTable:e,marginBottom:0}),t.length?l.createElement(l.Fragment,null,l.createElement(n.A,null),l.createElement(w,{fan_table:t})):null)}]}):null}}]);