"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[82665],{919304(e,t,i){i.d(t,{A:()=>a});var s=i(274934),r=i(602086),l=i(938984),n=i(470070),o=i(314229),d=i(664092);const a=({psu_table:e})=>{const t=(0,r.useMemo)(()=>(0,o.Rj)(e),[e]);return(0,s.jsx)(s.Fragment,{children:t.map(({status:e,statusColor:t,source:i,id:r},o)=>(0,s.jsxs)(d.A,{children:[(0,s.jsx)(l.A,{size:"medium",children:(0,s.jsx)(n.sA,{id:i,..."COMMON_POWER_SUPPLY_UNIT"===i&&{values:{psuIndex:o+1}}})}),(0,s.jsx)(l.A,{size:"medium",color:t,children:(0,s.jsx)(n.sA,{id:e})})]},r))})}},633797(e,t,i){i.d(t,{A:()=>h});var s=i(274934),r=i(903736),l=i.n(r),n=i(853777),o=i(600191),d=i(847399),a=i(247816),A=i(263705),c=i(309130),_=i(100978),E=i(291508);const x=(0,a.A)(_.A,(0,E.A)("borderColor","backgroundColor","dividerColor"))`
  background-color: ${({backgroundColor:e})=>e};
  border-left: 2px solid ${({borderColor:e})=>e};
  padding: ${c.Ln} ${c.Ln} ${c.Ln} 0;

  & + & {
    border-top: 1px solid ${({dividerColor:e})=>e};
  }
`,m=(0,a.A)(_.A)`
  min-width: 36px;
  max-width: 36px;
`,u=(e,{warning:t,neutral01:i,danger:r,info:a})=>{switch(e){case"warning":return{icon:(0,s.jsx)(o.A,{size:"medium",color:t,variant:"fill"}),backgroundColor:i,borderColor:t,dividerColor:l()(t).alpha(.2).css()};case"danger":return{icon:(0,s.jsx)(d.A,{size:"medium",color:r,variant:"fill"}),backgroundColor:i,borderColor:r,dividerColor:l()(r).alpha(.2).css()};default:return{icon:(0,s.jsx)(n.A,{isActive:!0,size:"original"}),backgroundColor:i,borderColor:a,dividerColor:l()(a).alpha(.2).css()}}},h=({level:e,children:t,overrideLevel:i})=>{const{motifPalette:r}=(0,A.u)(),{icon:l,backgroundColor:n,borderColor:o,dividerColor:d}={...u(e,r),...i};return(0,s.jsxs)(x,{flexDirection:"row",width:"100%",backgroundColor:n,borderColor:o,dividerColor:d,children:[(0,s.jsx)(m,{justifyContent:"center",children:l}),(0,s.jsx)(_.A,{flexDirection:"column",justifyContent:"center",children:t})]})}},682665(e,t,i){i.r(t),i.d(t,{default:()=>We});var s=i(274934),r=i(977872),l=i(376892),n=i(100978),o=i(535322),d=i(988191),a=i(853109),A=i(754924),c=i(602086),_=i(125799),E=i(938984),x=i(814557),m=i(367551),u=i(60016),h=i(599110),T=i(31881),j=i(773921),R=i(600191),N=i(847399),I=i(343954),C=i(247816),O=i(263705),p=i(590979),D=i(443502),P=i(347625),g=i(518074),v=i(741497),S=i(932004),b=i(706370),M=i(800615);const y=e=>e>=90?M.A:e>=70?g.A:e>=50?v.A:e>=30?S.A:b.A;var f=i(565527),w=i(309130),L=i(633797),U=i(815436),z=i(408402),B=i(869332),V=i(470070),G=i(314229),Y=i(434521),H=i(857780),k=i(45978);const $=(0,C.A)(n.A)`
  color: ${({theme:{themeName:e,motifPalette:t},batteryLevel:i,isConnected:s})=>s?t[`${(0,d.oU)(i||0)}06`]:x.Ay[`desktop-color-neutral-08-${e}`]};
`,W=({isConnected:e=!0,children:t,...i})=>(0,s.jsx)($,{isConnected:e,...i,children:t}),F=(0,C.A)(n.A)`
  margin-top: -${w.Ln};
  > div {
    margin-bottom: ${w.YC};
  }
`,K=(0,C.A)(E.A)`
  margin-left: ${w.kc};
`,X=(0,C.A)(m.A)`
  height: 10px;
  > div {
    height: 10px !important;
  }
`,Z=(0,C.A)(L.A)`
  margin-top: ${w.kc};
`,Q=(0,C.A)(h.A)`
  padding: 0;
`,q=(0,C.A)(n.A)`
  background-color: ${({theme:{themeName:e}})=>e===f.S.DARK?x.Ay[`desktop-color-neutral-02-${e}`]:x.Ay[`desktop-color-neutral-01-${e}`]};
  border-radius: ${x.Ay["desktop-radius-base"]};
  margin-bottom: ${w.Ln} !important;
`,J=(e,t)=>{if(t.batteryState===H.Rv.UPGRADING)return"DEVICE_BATTERY_STATE_UPGRADING";if((0,G.Pi)(e.psu_table)?.online)return"COMMON_ACTIVE";if(t.batteryState===H.Rv.CHARGING)return"DEVICE_BATTERY_STATE_CHARGING";const i=(0,Y.S9)(t);return i===k.g.CONNECTED?"COMMON_READY":i},ee=(e,t)=>t.batteryState===H.Rv.CHARGING?(0,s.jsx)(j.A,{variant:"fill"}):(0,d.Ny)(e,t)?(0,s.jsx)(I.A,{width:16,height:16}):(0,s.jsx)(N.A,{width:16,height:16}),te=e=>(0,s.jsx)(_.A,{description:(0,s.jsx)(V.sA,{id:"COMMON_ACTION_TEST_BATTERY_NOTICE"}),position:"topLeft",width:260,children:e}),ie=({activeItem:e,activeItem:{connected_battery_overrides:t,rps:i,mac:l}})=>{const{motifPalette:a,themeName:_}=(0,O.u)(),m=(0,r.wA)(),h=(0,r.d4)(A.ID),j=(0,d.xZ)(e,h);return j.length?(0,s.jsx)(o.A,{children:(0,s.jsxs)(F,{flexDirection:"column",children:[j.map(i=>{const r=(0,d.Ny)(e,i),l=(0,Y.S9)(i),o=i.batteryState===H.Rv.FULL?100:i.batteryLevel||0,A=y(o),m=r?a[`${(0,d.oU)(o)}06`]:x.Ay[`desktop-color-neutral-08-${_}`];return(0,s.jsxs)(c.Fragment,{children:[(0,s.jsxs)(n.A,{justifyContent:"space-between",marginTop:16,children:[(0,s.jsx)(u.A,{icon:(0,s.jsx)(W,{batteryLevel:o,isConnected:r,children:(0,s.jsx)(A,{height:20,width:24})}),iconSize:"large",textColor:"primary",text:(0,s.jsx)(E.A,{weight:"bold",size:"medium",color:"text-1",children:(0,s.jsx)(V.sA,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})}),textPlacement:"right"}),(0,s.jsx)(u.A,{icon:(0,s.jsx)(W,{batteryLevel:o,isConnected:r,children:ee(e,i)}),iconSize:"large",textColor:"primary",color:m,text:(0,s.jsx)(E.A,{size:"medium",color:"text-1",children:(0,s.jsx)(V.sA,{id:J(e,i)})}),textPlacement:"right"})]}),(0,s.jsx)(n.A,{children:(0,s.jsx)(E.A,{children:(0,P.Q)(i)})}),r&&o>=0?(0,s.jsxs)(n.A,{alignItems:"center",children:[(0,s.jsx)(X,{items:[{value:o,color:m}]}),i.batteryState!==H.Rv.CHARGING?(0,s.jsx)(W,{batteryLevel:o,isConnected:r,marginRight:-6,children:(0,s.jsx)(T.A,{})}):null,(0,s.jsxs)(K,{style:{color:m},children:[o,"%"]})]}):null,r||l===k.g.ADOPTING?null:(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(Z,{level:"danger",overrideLevel:{borderColor:"none",backgroundColor:x.Ay[`desktop-color-neutral-02-${_}`]},children:(0,s.jsx)(E.A,{children:(0,s.jsx)(V.sA,{id:"UPB_BATTERY_DISCONNECTED_DESCRIPTION",values:{count:t?.length||0}})})})})]},i.mac)}),i?.oring_poe_warning_flag?(0,s.jsxs)(q,{padding:"8px",gap:8,marginTop:4,children:[(0,s.jsx)(R.A,{color:D.PA.warning,size:"large",variant:"fill"}),(0,s.jsx)(E.A,{children:(0,s.jsx)(V.sA,{id:"UPB_BATTERY_CAPACITY_WARNING",values:{percent:i.oring_poe_warning_percentlabel}})})]}):null,1===j.length?(0,s.jsx)(n.A,{children:(0,s.jsx)(z.A,{condition:(0,Y.S9)(j[0])!==k.g.CONNECTED,wrapper:te,children:(0,s.jsx)(Q,{disabled:(0,Y.S9)(j[0])!==k.g.CONNECTED,variant:"link",onClick:()=>{m((0,B.to)({modalType:U.A.TEST_SMART_BATTERY,modalProps:{batteryMac:j[0].mac,hostMac:l}}))},...p.A.addDataTestId(p.A.TestId.MODAL_TRIGGER),children:(0,s.jsx)(V.sA,{id:"COMMON_ACTION_TEST_BATTERY"})})})}):null]})}):null};var se=i(898809),re=i(291508);const le=(0,C.A)(n.A,(0,re.A)("batteryLevel"))`
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: ${({theme:{motifPalette:e},batteryLevel:t})=>e[`${(0,d.oU)(t)}01`]};
  border: 1px solid
    ${({theme:{motifPalette:e},batteryLevel:t})=>e[`${(0,d.oU)(t)}06`]};
  color: ${({theme:{motifPalette:e},batteryLevel:t})=>e[`${(0,d.oU)(t)}06`]};
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 2px;
  margin-right: 10px;
  flex-shrink: 0;

  > svg {
    margin: -1px;
  }
`,ne=(0,C.A)(n.A)`
  margin-top: -2px;
`,oe=(0,C.A)(n.A)`
  position: absolute;
  right: -2px;
  bottom: -2px;
`,de=(0,C.A)(j.A)`
  border-radius: 50%;
  background-color: ${({theme:{themeName:e}})=>x.Ay[`desktop-color-neutral-00-${e}`]};
`,ae=e=>(e>d.aI.MEDIUM_TO_GOOD?(0,s.jsx)(de,{width:8,height:8,variant:"fill"}):null)||(e>d.aI.BAD_TO_MEDIUM?(0,s.jsx)(R.A,{width:9,height:9}):null)||(0,s.jsx)(N.A,{width:8,height:8}),Ae=({activeItem:e,activeItem:{psu_table:t,total_power_requirement:i}})=>{const l=(0,r.wA)(),a=(0,r.d4)(A.ID),_=(0,d.xZ)(e,a).filter(e=>(0,Y.kG)(e.state)===k.g.CONNECTED),x=(0,r.d4)(A.Nz),m=(0,r.d4)(A.CH),u=(0,c.useMemo)(()=>(0,G.Pi)(t),[t]),T=_[0]?.batteryLevel||100,j=_[0]?.timeToEmpty,R=_.length&&_.every(e=>!!e.battery?.capSupplyPowerWatt)?Math.ceil(_.reduce((e,t)=>e-(t.battery?.capSupplyPowerWatt||0),i||0)/((_[0]?.battery?.capSupplyPowerWatt||0)+1)):0,N=R>0,I=j&&_[0]?.batteryState===H.Rv.POWER_DELIVER;let C,O="";_.length>0?(O="COMMON_READY",C={host:(0,P.Q)(e)},N?O="UPB_BATTERY_PACK_EXPAND_NEEDED":_[0]?.isLowBattery?O="UPB_BATTERY_DEPLETED":u?.online&&(O="UPB_POWERING_DEVICE")):x.length>0?(O="UPB_BATTERY_READY_FOR_ADOPTION",C={count:x.length}):m.length>0&&(O="UPB_BATTERY_READY_TO_BE_ASSIGNED",C={count:m.length});const D=y(T);return O?(0,s.jsx)(o.A,{children:(0,s.jsxs)(n.A,{flexShrink:0,children:[(0,s.jsxs)(le,{batteryLevel:T,children:[(0,s.jsx)(D,{height:22,width:24}),(0,s.jsx)(oe,{children:ae(T)})]}),(0,s.jsxs)(n.A,{flexGrow:1,flexDirection:"column",children:[(0,s.jsxs)(n.A,{justifyContent:"space-between",children:[(0,s.jsx)(E.A,{weight:"bold",size:"medium",color:"text-1",children:(0,s.jsx)(V.sA,{id:O,values:C})}),x.length>0||m.length>0?(0,s.jsx)(ne,{alignItems:"flex-start",children:(0,s.jsx)(h.A,{variant:"link",onClick:()=>{l((0,B.to)({modalType:U.A.ASSIGN_SMART_BATTERY,modalProps:{activeMacs:(x.length?x:m).map(({mac:e})=>e),selectedHost:e}}))},...p.A.addDataTestId(p.A.TestId.MODAL_TRIGGER),children:(0,s.jsx)(V.sA,{id:x.length?"COMMON_ADOPT":"COMMON_ASSIGN"})})}):null]}),(0,s.jsxs)(n.A,{flexDirection:"column",justifyContent:"space-between",children:[N?(0,s.jsx)(E.A,{size:"small",color:"text-3",children:(0,s.jsx)(V.sA,{id:"UPB_BATTERY_PACK_EXPAND_NEEDED_DESCRIPTION",values:{host:(0,P.Q)(e),count:R}})}):null,I?(0,s.jsx)(E.A,{size:"small",color:"text-3",children:(0,s.jsx)(V.sA,{id:"UPB_BATTERY_LIFE",values:{life:(0,se.a3)(j,!0)}})}):null]})]})]})}):null};var ce=i(664092),_e=i(605076),Ee=i(521853),xe=i(513458);const me=(0,C.A)(xe.A)`
  margin-right: 5px;
`,ue=(0,C.A)(h.A)`
  padding: 0;
`,he=({battery:e})=>{const{motifPalette:t}=(0,O.u)(),i=(0,r.wA)(),l=(0,G.gy)(e.batteryState),o=e.batteryState===H.Rv.FULL?100:e.batteryLevel,a=(0,Y.LL)(e),A=(0,c.useMemo)(()=>[H.Rv.CHARGING,H.Rv.POWER_DELIVER,H.Rv.UPGRADING].includes(e.batteryState),[e.batteryState]),_=(0,c.useMemo)(()=>e.batteryState===H.Rv.FULL?"positive":[H.Rv.CHARGING,H.Rv.POWER_DELIVER,H.Rv.UPGRADING].includes(e.batteryState)?"notice":void 0,[e.batteryState]),x=Math.abs(Number(e.batteryMA*e.batteryMV)/1e6);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ce.A,{children:(0,s.jsx)(E.A,{size:"medium",weight:"bold",children:(0,P.Q)(e)})}),e.mac?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_MAC_ADDRESS"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:e.mac})})]}):null,(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_CHARGE_STATUS"})}),(0,s.jsxs)(n.A,{alignItems:"center",children:[(0,s.jsx)(me,{status:_,isPulsating:A}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:l})})]})]}),o?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_CAPACITY"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsxs)("span",{style:{color:t[`${(0,d.oU)(o)}06`]},children:[o,"%"]})})})]}):null,e.battery?.capMwh?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_STORAGE"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_UNIT_WATT_HOURS",values:{value:(e.battery.capMwh/1e3).toFixed(1)}})})})]}):null,e.batteryState===H.Rv.IDLE||Number.isNaN(x)?null:(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_POWER_USAGE"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:x.toFixed(1)}})})})]}),e.displayable_version?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_DEVICE_VERSION"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:e.displayable_version})})]}):null,(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_HEADER_UPDATE_STATUS"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,Y.g8)(e)?(0,s.jsx)(_e.A,{device:e,label:"COMMON_CLICK_TO_UPDATE"}):(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:Ee.A[a]})})})]}),e.batteryHealth&&e.health?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_HEALTH"})}),(0,s.jsx)(n.A,{alignItems:"center",children:(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)("span",{style:{color:t[`${(0,d.oU)(e.batteryHealth)}06`]},children:e.health})})})]}):null,(0,s.jsx)(n.A,{children:(0,s.jsx)(ue,{variant:"link",onClick:()=>{i((0,B.to)({modalType:U.A.MANAGE_SMART_BATTERY,modalProps:{activeItem:e}}))},...p.A.addDataTestId(p.A.TestId.MODAL_TRIGGER),children:(0,s.jsx)(V.sA,{id:"COMMON_ACTION_MANAGE_BATTERY"})})})]})},Te=(0,C.A)(n.A)`
  flex-direction: column;
  &:not(:last-child) {
    margin-bottom: 8px;
  }
`,je=({activeItem:e})=>{const t=(0,r.d4)(A.ID),i=(0,d.xZ)(e,t);return(0,s.jsx)(o.A,{type:o.I.ACCORDION,items:[{id:"externalBatteries",label:(0,s.jsx)(l.A,{id:"DEVICE_BATTERY_TYPE_EXTERNAL_PLURAL"}),openByDefault:!0,renderContent:()=>(0,s.jsx)(s.Fragment,{children:i.map(e=>(0,s.jsx)(Te,{children:(0,s.jsx)(he,{battery:e},e.mac)}))})}]})};var Re=i(437366),Ne=i(808202),Ie=i(203155),Ce=i(384780),Oe=i(383550),pe=i(919304),De=i(157622),Pe=i(878151),ge=i(956978);const ve=(0,C.A)("div")`
  margin-bottom: ${w.kc};
`,Se=(0,C.A)("div")`
  margin-top: ${w.Ln};
  margin-bottom: ${w.kc};
`,be={[H.f8.UNKNOWN]:"COMMON_UNKNOWN",[H.f8.GOOD]:"COMMON_GOOD",[H.f8.OVERHEAT]:"DEVICE_USW_MC_PSU_HEALTH_OVERHEAT",[H.f8.DEAD]:"DEVICE_USW_MC_PSU_HEALTH_DEAD",[H.f8.OVER_VOLTAGE]:"DEVICE_USW_MC_PSU_HEALTH_OVER_VOLTAGE",[H.f8.OVER_CURRENT]:"DEVICE_USW_MC_PSU_HEALTH_OVER_CURRENT"},Me={[H.zz.UNKNOWN]:"COMMON_UNKNOWN",[H.zz.CHARGING]:"DEVICE_BATTERY_STATE_CHARGING",[H.zz.DISCHARGING]:"DEVICE_BATTERY_STATE_DISCHARGING",[H.zz.NOT_CHARGING]:"DEVICE_BATTERY_STATE_NOT_CHARGING",[H.zz.FULL]:"COMMON_FULL"},ye={[H.D1.LI_LION]:"DEVICE_USW_MC_PSU_BATTERY_TYPE_LI_ION",[H.D1.PBAC]:"DEVICE_USW_MC_PSU_BATTERY_TYPE_PBAC",[H.D1.UNKNOWN]:"COMMON_UNKNOWN"},fe=({activeItem:e})=>{const t=(0,c.useMemo)(()=>(0,ge.C6C)({model:e.model}),[e.model]),i=(0,c.useMemo)(()=>[(0,G.L7)(e.psu_table),(0,G.Pi)(e.psu_table)].filter(Boolean),[e.psu_table]);return(0,s.jsx)(s.Fragment,{children:i.map(({index:e,psu_type:i,psu_caps:r,charge_status:l,capacity:n,technology:o,energy_full_design:d,charge_full_design:a,power:A,current:c,voltage:_,time_to_empty_avg:x,installation_time:m,health:u})=>(0,s.jsxs)("div",{children:[(0,G.pA)(i,r)?(0,s.jsx)(ve,{children:(0,s.jsx)(E.A,{size:"medium",weight:"bold",children:(0,s.jsx)(V.sA,{id:"DEVICE_BATTERY_TYPE_INTERNAL"})})}):(0,s.jsx)(Se,{children:(0,s.jsx)(E.A,{size:"medium",weight:"bold",children:(0,s.jsx)(V.sA,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})})}),(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_STATUS"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:l?Me[l]:"COMMON_UNKNOWN"})})]}),n?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_CAPACITY"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsxs)("span",{style:{color:De.A.getGradientColor(n/100)},children:[n,"%"]})})]}):null,!t&&o&&"Unknown"!==o?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_TYPE"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:ye[o]})})]}):null,d||a?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_STORAGE"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,d?{id:"COMMON_UNIT_WATT_HOURS",values:{value:d}}:{id:"COMMON_UNIT_AMPERE_HOURS",values:{value:a}})})]}):null,(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_POWER_USAGE"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(A).toFixed(1)}})})]}),t?null:(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_CURRENT"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(c).toFixed(1)}})})]}),t?null:(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_VOLTAGE"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(_).toFixed(1)}})})]}),x?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_TIME"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(Pe.A,{type:"uptime",size:"body",input:x})})]}):null,m?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_INSTALLATION_DATE"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(Pe.A,{type:"uptime",size:"body",input:m})})]}):null,u?(0,s.jsxs)(ce.A,{children:[(0,s.jsx)(E.A,{size:"medium",children:(0,s.jsx)(V.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_HEALTH_STATUS"})}),(0,s.jsx)(E.A,{color:"text-3",size:"medium",children:(0,s.jsx)(V.sA,{id:be[u]})})]}):null]},e))})};var we=i(241365),Le=i(399255),Ue=i(481894),ze=i(770445);const Be=(0,C.A)(n.A)`
  position: relative;
  border-bottom: 4px;
`,Ve=(0,C.A)(n.A)`
  margin-bottom: 16px;
  svg g:nth-child(2) {
    transform: translate(58px, 53px) !important;
  }
  g {
    > circle {
      transform: rotateX(180deg) rotateY(180deg);
    }
    text:nth-child(1) {
      font-size: 24px;
    }
    text:nth-child(2) {
      font-weight: 900;
    }
    circle:nth-child(2) {
      stroke: ${({theme:{motifPalette:{ui03:e}}})=>e};
    }
  }
`,Ge=(0,C.A)("div")`
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: ${({theme:{motifPalette:{ui04:e}}})=>e};
`,Ye=(0,C.A)("div")`
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: ${({theme:{motifPalette:{ui04:e}}})=>e};
`,He=(0,C.A)(E.A)`
  margin: 14px 0px;
`,ke=({activeItem:{outlet_ac_power_budget:e,outlet_ac_power_consumption:t,psu_table:i}})=>{const{spacer:r,thickness:l}=(0,Ue.A)(ze.e.SIDE_PANEL),{total:n,outlets:o,internalBattery:d,externalBattery:a}=(0,c.useMemo)(()=>(0,G.lJ)(e,t,i),[e,t,i]);return(0,s.jsxs)(Be,{flexFlow:"wrap",children:[(0,s.jsx)(Ge,{}),(0,s.jsx)(Ye,{}),(0,s.jsxs)(Ve,{flexDirection:"column",flex:"1 1 50%",alignItems:"center",children:[(0,s.jsx)(He,{size:"medium",weight:"bold",children:(0,s.jsx)(V.sA,{id:"COMMON_TOTAL"})}),(0,s.jsx)(Le.A,{title:`${n.usedPowerPercentage}%`,description:`${n.usedPower}/${n.maxPower}W`,size:116,spacer:r,thickness:l,items:[{id:"free",color:n.statusColor,value:n.usedPowerPercentage},{id:"used",color:we.Ay["white-6"],value:100-n.usedPowerPercentage}]})]}),(0,s.jsxs)(Ve,{flexDirection:"column",flex:"1 1 50%",alignItems:"center",children:[(0,s.jsx)(He,{size:"medium",weight:"bold",children:(0,s.jsx)(V.sA,{id:"COMMON_OUTLETS"})}),(0,s.jsx)(Le.A,{title:`${o.usedPowerPercentage}%`,description:`${o.usedPower}/${o.maxPower}W`,size:116,spacer:r,thickness:l,items:[{id:"free",color:o.statusColor,value:o.usedPowerPercentage},{id:"used",color:we.Ay["white-6"],value:100-o.usedPowerPercentage}]})]}),(0,s.jsxs)(Ve,{flexDirection:"column",flex:"1 1 50%",alignItems:"center",children:[(0,s.jsx)(He,{size:"medium",weight:"bold",children:(0,s.jsx)(V.sA,{id:"DEVICE_BATTERY_TYPE_INTERNAL"})}),(0,s.jsx)(Le.A,{title:`${d.usedPowerPercentage}%`,description:`${d.usedPower}/${d.maxPower}W`,size:116,spacer:r,thickness:l,items:[{id:"used",color:d.statusColor,value:d.usedPowerPercentage},{id:"free",color:we.Ay["white-6"],value:100-d.usedPowerPercentage}]})]}),(0,s.jsxs)(Ve,{flexDirection:"column",flex:"1 1 50%",alignItems:"center",children:[(0,s.jsx)(He,{size:"medium",weight:"bold",children:(0,s.jsx)(V.sA,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})}),(0,s.jsx)(Le.A,{title:`${a.usedPowerPercentage}%`,description:`${a.usedPower}/${a.maxPower}W`,size:116,spacer:r,thickness:l,items:[{id:"used",color:a.statusColor,value:a.usedPowerPercentage},{id:"free",color:we.Ay["white-6"],value:100-d.usedPowerPercentage}]})]})]})};var $e=i(216082);const We=({activeItem:e,activeItem:{name:t,type:i,model:c,mac:_,psu_table:E,total_max_power:x,total_used_power:m,detailed_states:{device_near_power_limit:u,device_near_effective_power_limit:h}={device_near_power_limit:!1,device_near_effective_power_limit:!1},ip:T,lan_ip:j,ipv6:R,displayable_version:N,uptime:I,has_temperature:C,overheating:O,general_temperature:p,has_fan:D,fan_level:P,"system-stats":g,shortname:v,deviceState:S,ethernet_overrides:b,port_table:M,uplink:y,device_mode_override:f}})=>{const{port_idx:w}=(0,a.q$)(e)||{};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Oe.A,{activeItem:e,showPortOverview:!0}),(0,s.jsx)(Ae,{activeItem:e}),(0,s.jsx)(Ne.A,{mac:_,type:i,model:c,device_near_power_limit:u,device_near_effective_power_limit:h,total_used_power:m,total_max_power:x}),(0,s.jsx)(n.A,{flexDirection:"column",children:(0,s.jsx)(ie,{activeItem:e})}),(0,s.jsx)(Ce.A,{activeItem:e}),(0,s.jsx)(Re.A,{name:t,model:c,type:i,local_uplink_port:w,ip:T,lan_ip:j,ethernet_overrides:b,port_table:M,ipv6:R,mac:_,displayable_version:N,uptime:I,has_temperature:C,has_fan:D,overheating:O,general_temperature:p,fan_level:P,systemStatsMem:g?.mem,deviceState:S,uplink:y,device_mode_override:f}),E?.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.A,{type:o.I.ACCORDION,items:[{id:"powerSource",openByDefault:!0,label:(0,s.jsx)(l.A,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_SOURCE"}),renderContent:()=>(0,s.jsx)(pe.A,{psu_table:E})}]}),(0,s.jsx)(o.A,{type:o.I.ACCORDION,multiOpen:!0,items:[{id:"battery",openByDefault:!0,label:(0,s.jsx)(l.A,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY"}),renderContent:()=>(0,s.jsx)(fe,{activeItem:e})}]}),(0,s.jsx)(o.A,{type:o.I.ACCORDION,items:[{id:"powerUtilization",openByDefault:!0,label:(0,s.jsx)(l.A,{id:"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>(0,s.jsx)(ke,{activeItem:e})}]})]}):null,(0,d.xZ)(e,(0,r.d4)(A.ID)).length?(0,s.jsx)(je,{activeItem:e}):null,(0,s.jsx)(Ie.A,{activeItem:e}),(0,s.jsx)($e.A,{shortname:v})]})}},770445(e,t,i){var s,r;i.d(t,{N:()=>r,e:()=>s}),function(e){e.DASHBOARD="dashboard",e.SIDE_PANEL="sidePanel"}(s||(s={})),function(e){e.DIAMETER="diameter",e.BORDER="border",e.PADDING="padding",e.SPACER="spacer",e.THICKNESS="thickness"}(r||(r={}))},481894(e,t,i){i.d(t,{A:()=>a});var s=i(602086),r=i(303853),l=i(588769),n=i(770445);const o=(e,t)=>{if(!e)return null;switch(t){case n.e.DASHBOARD:return e>=l.A.XXL.FROM?{[n.N.DIAMETER]:150,[n.N.BORDER]:null,[n.N.PADDING]:20,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.XL.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:16,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.L.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:12,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.ML.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:12,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.M.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:12,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.SM.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:12,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.S.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:12,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:e>=l.A.XS.FROM?{[n.N.DIAMETER]:130,[n.N.BORDER]:null,[n.N.PADDING]:12,[n.N.SPACER]:15,[n.N.THICKNESS]:10}:null;case n.e.SIDE_PANEL:return{[n.N.DIAMETER]:96,[n.N.BORDER]:null,[n.N.PADDING]:0,[n.N.SPACER]:10,[n.N.THICKNESS]:10};default:return null}},d={[n.N.DIAMETER]:null,[n.N.BORDER]:null,[n.N.PADDING]:null,[n.N.SPACER]:null,[n.N.THICKNESS]:null},a=e=>{const[t,i]=(0,s.useState)(o(document.body?.getBoundingClientRect()?.width,e)||d),{width:l}=(0,r.Ay)();return(0,s.useEffect)(()=>{const t=o(l,e);t&&i(t)},[l,e]),t}}}]);