"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[74913],{346100(e,t,s){s.d(t,{A:()=>n});const n={POWER_CYCLE_ON_AC_RECOVERY:2,POWER_BUZZER:4,SAFE_SHUTDOWN_AND_POWER_CYCLE_TIME:8,SMART_POWER_EMERGENCY_POWER_OFF:16}},177445(e,t,s){s.d(t,{A:()=>a});var n=s(602086),i=s(977872),r=s(223597),o=s(34118);const a=({client:{id:e,type:t,status:s,blocked:a},props:l,children:c})=>{const d=(0,n.useMemo)(()=>t===r.sK.VPN?r.N7.VPN:t===r.sK.TELEPORT?r.N7.TELEPORT:a?r.N7.BLOCKED:s===r.S2.OFFLINE?r.N7.OFFLINE:r.N7.ACTIVE,[t,a,s]),_=(0,i.d4)((0,n.useMemo)(()=>(0,o.kV)(e,l,d),[e,l,d]));return c((0,n.useMemo)(()=>_,[_]))}},752104(e,t,s){s.d(t,{A:()=>i,Q:()=>r});var n=s(765567);const i="_",r=[n.ZM,n.Je]},453007(e,t,s){s.d(t,{A:()=>o});var n=s(179102),i=s(247816),r=s(291508);const o=(0,i.A)(n.A,(0,r.A)("colorOverride"))`
  ${({colorOverride:e})=>e?`color: ${e} !important`:""};
`},809465(e,t,s){s.d(t,{A:()=>u});var n=s(274934),i=s(602086),r=s(977872),o=s(179102),a=s(266824),l=s(613842),c=s(976458),d=s(591256),_=s(726831);const u=(0,i.memo)(({size:e="inherit",children:t})=>{const s=(0,r.d4)(c.y$),u=(0,r.d4)(d.PO),A=(0,i.useCallback)(()=>{s?s({appId:"network"}):l.A.open(`${_.A.accountSupportForm}?console=${u}&application=network`)},[s,u]);return(0,n.jsx)(a.A,{fontSize:"medium",type:"button",onPress:A,children:(0,n.jsx)(o.A,{size:e,color:"inherit",children:t})})})},555612(e,t,s){s.d(t,{A:()=>_});var n=s(274934),i=s(602086),r=s(281572),o=s(711950),a=s(247816),l=s(470070),c=s(669439);const d=(0,a.A)(o.A)`
  color: #ffffff;
`,_=(0,i.memo)(({isDisabled:e,showLoader:t,showWarning:s,showWarningIcon:i,warning:o,label:a="COMMON_ACTION_APPLY_CHANGES",onSubmit:_,form:u})=>(0,n.jsx)(c.A,{description:s?o??(0,n.jsx)(l.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,children:(0,n.jsx)(r.A,{disabled:e,type:"submit",onClick:_,variant:"primary",Icon:s||i?(0,n.jsx)(d,{variant:"fill"}):null,loader:t?"loading":void 0,form:u,children:(0,n.jsx)(l.sA,{id:a})})}))},164487(e,t,s){s.d(t,{A:()=>c});var n=s(274934),i=s(903952),r=s(184931),o=s(309130),a=s(304151),l=s(100978);const c=({tooltip:e,htmlFor:t,children:s,labelProps:c,wrapperProps:d,tooltipProps:_})=>{const u=(0,r.iL)();return(0,n.jsxs)(l.A,{alignItems:"center",gap:o.YC,...d,children:[(0,n.jsx)(i.A,{as:"label",htmlFor:t,color:"tertiary",...c,style:{opacity:u?o.xN:void 0,...c?.style},children:s}),e?(0,n.jsx)(a.A,{description:e,..._}):null]})}},89469(e,t,s){s.d(t,{A:()=>a});var n=s(274934),i=s(602086),r=s(309130),o=s(100978);const a=(0,i.forwardRef)((e,t)=>(0,n.jsx)(o.A,{ref:t,flexDirection:"column",gap:r.kc,width:"100%",...e}))},115114(e,t,s){s.d(t,{A:()=>d});var n=s(274934),i=s(388294),r=s(247816),o=s(409844),a=s(751636);const l=(0,r.A)("div")`
  height: 66px;
`,c=o.AH`
  padding: 0px !important;
`,d=({isDirty:e,onFormSubmit:t,onFormCancel:s,isInvalid:r,...o})=>e?(0,n.jsx)(i.A,{children:(0,n.jsx)(a.A,{isDirty:e,onFormCancel:s,onFormSubmit:t,isInvalid:r,className:c,...o})}):(0,n.jsx)(l,{})},254193(e,t,s){s.d(t,{A:()=>l});var n=s(274934),i=s(602086),r=s(266824),o=s(244183),a=s(316628);const l=({value:e})=>{const t=(0,a.A)(),s=(0,i.useCallback)(()=>t(e),[e,t]);return(0,n.jsx)(r.A,{onPress:s,variant:"neutral",children:(0,n.jsx)(o.A,{size:"original"})})}},382583(e,t,s){s.d(t,{A:()=>u});var n=s(274934),i=s(602086),r=s(179102),o=s(775250),a=s(977872),l=s(156007),c=s(470070),d=s(197571),_=s(664092);const u=({connection_network_id:e})=>{const t=(0,a.d4)(d.Tn),s=(0,i.useMemo)(()=>e?t.find(t=>t._id===e):void 0,[t,e]);return s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(_.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(c.sA,{id:"COMMON_NETWORK"})}),(0,n.jsx)(l.A,{color:"text-3",size:"medium",flexProps:{justifyContent:"flex-end"},children:s.name})]}),null!=s.vlan?(0,n.jsxs)(_.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(c.sA,{id:"COMMON_VLAN_ID"})}),(0,n.jsx)(o.A,{color:"text-3",size:"medium",isTruncated:!0,children:s.vlan})]}):null]}):null}},446722(e,t,s){s.d(t,{A:()=>d});var n=s(274934),i=s(548941),r=s(179102),o=s(751271),a=s(711950),l=s(470070),c=s(664092);const d=({has_temperature:e=!1,overheating:t=!1,general_temperature:s})=>e&&Number.isFinite(s)?(0,n.jsxs)(c.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(l.sA,{id:"COMMON_TEMPERATURE"})}),(0,n.jsx)(r.A,{color:"text-3",size:"medium",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:s}}),t?(0,n.jsx)(i.A,{description:(0,n.jsx)(l.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_OVERHEATING"}),width:180,position:"left",className:"ml-1",style:{display:"inline-block",verticalAlign:"text-bottom"},children:(0,n.jsx)(a.A,{style:{color:o.Ay["color-danger"]}})}):null]})})]}):null},751636(e,t,s){s.d(t,{A:()=>d});var n=s(274934),i=s(526744),r=s(470070),o=s(247816),a=s(291508),l=s(309130);const c=(0,o.A)("footer",(0,a.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${l.S2} ${l.fS};
  gap: ${l.kc};
`,d=({allowCancel:e,isDirty:t,isInvalid:s,isSubmitting:o,onFormSubmit:a,onFormReset:l,onFormCancel:d,className:_,submitButtonText:u,customButton:A,applyButton:m,hideCancelButton:E,form:x,testConfigFooter:I})=>(0,n.jsx)(c,{className:_,hasFormResetButton:!!l,children:I||(0,n.jsxs)(n.Fragment,{children:[A,E?null:(0,n.jsx)(i.A,{name:"cancel",variant:"default",type:"button",onClick:d,disabled:!e&&!t,children:(0,n.jsx)(r.sA,{id:"COMMON_ACTION_CANCEL"})}),l?(0,n.jsx)(i.A,{name:"reset",variant:"default",type:"button",onClick:l,disabled:!t,children:(0,n.jsx)(r.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,m||(0,n.jsx)(i.A,{name:"submit",variant:"primary",type:"submit",onClick:a,disabled:!t||s||o,form:x,children:(0,n.jsx)(r.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})})]})})},773351(e,t,s){s.d(t,{A:()=>N});var n=s(274934),i=s(602086),r=s(179102),o=s(505817),a=s(711950),l=s(377067),c=s(247816),d=s(309130),_=s(100978),u=s(470070),A=s(708861),m=s(956978),E=s(434521),x=s(251323),I=s(332522),p=s(713053);const C=(0,c.A)("div")`
  display: flex;
  flex-direction: column;
`,O=(0,c.A)("div")`
  margin-top: ${d.Ln};
  padding-top: ${d.Ln};
  border-top: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};

  div:first-child {
    margin-bottom: ${d.xO};
  }
`,h=(0,c.A)(a.A)`
  color: ${({theme:{themeName:e}})=>o.Ay[`desktop-color-orange-06-${e}`]};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,j=(0,c.A)(l.A)`
  color: ${({theme:{themeName:e}})=>o.Ay[`desktop-color-green-06-${e}`]};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,N=({activeItem:e,activeItem:{outlet_table:t,outlet_ac_power_budget:s,outlet_ac_power_consumption:o,port_table:a},hidePorts:l,noDivider:c,gap:N=d.xO,legend:v,verticalLegend:g,tooltipPlacement:R="bottom end"})=>{const{usedPower:D,maxPower:S}=(0,i.useMemo)(()=>(0,A.hf)({outlet_table:t,outlet_ac_power_budget:s,outlet_ac_power_consumption:o}),[t,s,o]),M=(0,m.Tl7)(e)||(0,m.kYz)(e);return(0,n.jsxs)(C,{children:[(0,n.jsxs)(_.A,{justifyContent:"center",gap:N,alignItems:g?"center":void 0,children:[(0,n.jsx)(_.A,{flexDirection:"column",children:(0,n.jsx)(I.A,{disableOnPortClick:!0,activeItem:e,tooltipPlacement:R,isEU:(0,m.goQ)(e),offline:(0,m.aK8)((0,E.S9)(e))})}),a&&!l?(0,n.jsx)("div",{children:(0,n.jsx)(x.A,{activeItem:e,portSizeOverride:"19px",disableOnPortClick:M})}):null,g]}),g?null:v||(0,n.jsx)(p.Ay,{activeItem:e,noTopBorder:c}),D>S?(0,n.jsxs)(O,{children:[(0,n.jsxs)(_.A,{justifyContent:"space-between",children:[(0,n.jsx)(h,{}),(0,n.jsx)(r.A,{size:"small",children:(0,n.jsx)(u.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_WARNING"})})]}),(0,n.jsxs)(_.A,{justifyContent:"space-between",children:[(0,n.jsx)(j,{}),(0,n.jsx)(r.A,{size:"small",children:(0,n.jsx)(u.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_INFO"})})]})]}):null]})}},666461(e,t,s){s.d(t,{Ay:()=>E,u6:()=>m});var n=s(274934),i=s(505817),r=s(413402),o=s(247816),a=s(263705),l=s(309130),c=s(100978),d=s(470070),_=s(713053);const u=()=>{const{themeName:e,motifPalette:{lime06:t,uBlue01:s}}=(0,a.u)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.Jv,{icon:(0,n.jsx)(_.RH,{status:"positive"}),label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.sA,{id:"COMMON_ENABLED"})," / ",(0,n.jsx)(d.sA,{id:"COMMON_MEDIA_GE"})]})}),(0,n.jsx)(_.Jv,{icon:(0,n.jsx)(_.RH,{color:t}),label:(0,n.jsx)(d.sA,{id:"COMMON_MEDIA_FE"})}),(0,n.jsx)(_.Jv,{icon:(0,n.jsx)(_.RH,{color:i.Ay[`desktop-color-neutral-05-${e}`]}),label:(0,n.jsx)(d.sA,{id:"DEVICE_NOT_POWERED"})}),(0,n.jsx)(_.Jv,{icon:(0,n.jsx)(r.A,{color:i.Ay[`desktop-color-neutral-08-${e}`]}),label:(0,n.jsx)(d.sA,{id:"DEVICE_BATTERY_BACKED"})}),(0,n.jsx)(_.Jv,{icon:(0,n.jsx)(_.RH,{borderColor:i.Ay[`desktop-color-ublue-03-${e}`],background:s}),label:(0,n.jsx)(d.sA,{id:"DEVICE_SURGE_NETWORK"})})]})},A=(0,o.A)(_.cs)`
  grid-template-columns: repeat(4, minmax(min-content, 0.5fr));
`,m=()=>(0,n.jsx)(A,{noTopBorder:!0,children:(0,n.jsx)(u,{})}),E=()=>(0,n.jsx)(c.A,{flexDirection:"column",gap:l.YC,children:(0,n.jsx)(u,{})})},803240(e,t,s){s.r(t),s.d(t,{default:()=>Ts});var n=s(274934),i=s(142757),r=s(347625),o=s(309130),a=s(505817),l=s(179102),c=s(711950),d=s(263705),_=s(470070),u=s(100978);const A=({name:e})=>{const{themeName:t}=(0,d.u)();return(0,n.jsxs)(u.A,{gap:o.kc,children:[(0,n.jsx)(c.A,{size:"original",color:a.Ay[`desktop-color-orange-06-${t}`],variant:"fill"}),(0,n.jsx)(l.A,{size:"medium",color:"text-1",children:(0,n.jsx)(_.sA,{id:"DEVICE_WARNING_BATTERY_IN_USE",values:{device:e}})})]})};var m=s(535322),E=s(956978),x=s(853109),I=s(934899),p=s(651172),C=s(717622),O=s(453007),h=s(857780);const j={[h.W4.USWDA23]:60,[h.W4.USWDA24]:60,[h.W4.USWDA25]:100,[h.W4.USWDA26]:100},N=({current:e,max:t,model:s=""})=>{const{themeName:i}=(0,d.u)(),r=j[s]||0,c=e<r,A=c?r:e,m=t?100*A/t:0,E=a.Ay[`${(e=>{switch(!0){case e<80:return"desktop-color-green-06";case e<110:return"desktop-color-lime-06";case e<120:return"desktop-color-orange-06";case e>=120:return"desktop-color-red-06";default:return"desktop-color-green-06"}})(m)}-${i}`];return(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.kc,children:[(0,n.jsxs)(u.A,{justifyContent:"space-between",children:[(0,n.jsxs)(C.A,{variant:"medium",children:[(0,n.jsx)(_.sA,{id:"DEVICE_SURGE"})," / ",(0,n.jsx)(_.sA,{id:"DEVICE_HEADER_POWER_UTILIZATION"})]}),(0,n.jsx)(u.A,{gap:o.YC,alignItems:"baseline",children:(0,n.jsxs)(u.A,{gap:o.YC,alignItems:"center",children:[(0,n.jsx)(l.A,{size:"medium",color:"text-3",children:(0,n.jsx)(_.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:[c?"<":"",A.toFixed(2),"/",t].join("")}})}),(0,n.jsx)(p.A,{orientation:"vertical",style:{height:16},color:a.Ay[`desktop-color-neutral-03-${i}`]}),(0,n.jsxs)(O.A,{size:"medium",colorOverride:E,children:[c?"0-":"",`${Math.round(m)}%`]})]})})]}),(0,n.jsx)(I.A,{size:8,variant:"success",value:m,color:E})]})};var v=s(773351),g=s(203155),R=s(383550),D=s(977872),S=s(42220),M=s(630849),T=s(121713),b=s(455425),P=s(795206),f=s(115114),y=s(146215),L=s(555612);const w=({form:e,isDirty:t,isSubmitting:s,willTriggerImmediateShutdown:i,isBatteryMode:r,submitForm:o})=>{const a=(0,n.jsx)(L.A,{showWarningIcon:i,isDisabled:!t||s,showLoader:s,form:i?void 0:e,onSubmit:i?e=>{e.preventDefault()}:void 0});return i?(0,n.jsx)(y.A,{title:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_TRIGGER_POINT_EXCEEDS_ESTIMATE_TITLE"}),message:(0,n.jsx)(_.sA,{id:r?"DEVICE_UPS_TRIGGER_POINT_EXCEEDS_ESTIMATE_ON_BATTERY_WARNING":"DEVICE_UPS_TRIGGER_POINT_EXCEEDS_ESTIMATE_ON_AC_WARNING"}),trigger:(0,n.jsx)("span",{children:a}),onConfirm:o,confirmButtonLabel:"COMMON_ACTION_PROCEED"}):a};var V=s(325461);const k=V.Ay.object({outlet_power_cycle_on_ac_recovery_enabled:V.Ay.boolean().optional(),outlet_power_cycle_on_ac_recovery_seconds:V.Ay.number().int().min(60).max(600),ups_shutdown_remaining_minutes:V.Ay.number().int().min(2).max(15)}),U="upsTowerOverviewForm",W=({children:e,activeItem:{_id:t,mac:s,outlet_power_cycle_on_ac_recovery_enabled:i,outlet_power_cycle_on_ac_recovery_seconds:r,ups_shutdown_remaining_minutes:o},estimatedRuntimeSeconds:a,isBatteryMode:l})=>{const c=(0,D.wA)(),d=(0,M.I)(),_=(0,T.m)({schema:k,defaultValues:{outlet_power_cycle_on_ac_recovery_enabled:i,outlet_power_cycle_on_ac_recovery_seconds:r??60,ups_shutdown_remaining_minutes:o??5}}),{control:u,handleSubmit:A,formState:{isDirty:m,isSubmitting:E},reset:x}=_,I=(0,S.FH)({control:u,name:"ups_shutdown_remaining_minutes"}),p=void 0!==a&&a>0&&(I??0)*b.gG>=a,C=A(async e=>c((0,P.ex)(e,t,s,{extend:!0})).catch(d).then(()=>x(e)));return(0,n.jsxs)("form",{id:U,onSubmit:C,children:[(0,n.jsx)(S.Op,{..._,children:e}),(0,n.jsx)(f.A,{form:U,isDirty:m,onFormCancel:x,isSubmitting:E,applyButton:(0,n.jsx)(w,{form:U,isDirty:m,isSubmitting:E,isBatteryMode:l,willTriggerImmediateShutdown:p,submitForm:C})})]})};var G=s(906701),B=s(893762),F=s(446722),z=s(382583),$=s(948803),H=s(924453),Y=s(665367),X=s(597377),K=s(643334),Q=s(664092);const q=({battpool:{device_total_power_output:e,device_output_current:t,device_output_voltage:s,device_total_power_factor:i}})=>(0,n.jsxs)(n.Fragment,{children:[e?(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_POWER"})}),(0,n.jsx)(l.A,{color:"text-3",size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(e).toFixed(2)}})})]}):null,t?(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_CURRENT"})}),(0,n.jsx)(l.A,{color:"text-3",size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(t).toFixed(2)}})})]}):null,s?(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_VOLTAGE"})}),(0,n.jsx)(l.A,{color:"text-3",size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(s).toFixed(2)}})})]}):null,i?(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"DEVICE_HEADER_POWER_FACTOR"})}),(0,n.jsx)(l.A,{color:"text-3",size:"medium",children:Number(i).toFixed(2)})]}):null]}),J=({name:e,model:t,ip:s,lan_ip:i,ipv6:r,mac:o,connection_network_id:a,displayable_version:l,uptime:c,has_temperature:d,overheating:_,general_temperature:A,vbms_table:m,type:E,local_uplink_port:x,deviceState:I,ethernet_overrides:p,port_table:C,uplink:O,device_mode_override:h})=>(0,n.jsxs)(u.A,{flexDirection:"column",children:[(0,n.jsx)($.A,{model:t}),(0,n.jsx)(Y.A,{local_uplink_port:x}),(0,n.jsx)(X.A,{ip:s,lan_ip:i,type:E,ethernet_overrides:p,port_table:C,uplink:O,device_mode_override:h}),(0,n.jsx)(G.A,{ipv6_address:r}),(0,n.jsx)(z.A,{connection_network_id:a}),(0,n.jsx)(H.A,{mac:o}),(0,n.jsx)(K.A,{name:e,model:t,mac:o,type:E,displayable_version:l,uptime:c,deviceState:I}),(0,n.jsx)(B.A,{uptime:c}),m?.battpool?(0,n.jsx)(q,{battpool:m.battpool}):null,(0,n.jsx)(F.A,{has_temperature:d,overheating:_,general_temperature:A})]});var Z=s(666461),ee=s(889835),te=s(798282),se=s(685746),ne=s(611682),ie=s(862375),re=s(247816),oe=s(898809);const ae=(0,re.A)(ee.A)`
  width: 16px;
  height: 16px;
`,le=({battpool:e,noBattery:t,isCharging:s})=>t?(0,n.jsx)(_.sA,{id:"COMMON_DISCONNECTED"}):s&&100===e.batteryLevel?(0,n.jsx)(_.sA,{id:"COMMON_READY"}):s?(0,n.jsx)(_.sA,{id:"DEVICE_BATTERY_STATE_CHARGING"}):e.batteryLevel<=0||!e.timeToRemain?(0,n.jsx)(_.sA,{id:"DEVICE_BATTERY_STATE_EMPTY"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.sA,{id:"RPS_BATTERY_TIME_UNITE_EMPTY"}),": ",(0,oe.Ay)(e.timeToRemain,e.timeToRemain>b.gG?[oe.Au.DAYS,oe.Au.HOURS,oe.Au.MINUTES]:[oe.Au.SECONDS]).join("")||0]}),ce=({battpool:e,noBattery:t,badBattery:s,isCharging:i=!1})=>{const{themeName:r}=(0,d.u)();return t||s?(0,n.jsx)(ne.A,{variant:"fill",color:a.Ay[`desktop-color-red-06-${r}`],size:"original"}):i&&e.batteryLevel<100?(0,n.jsx)(ae,{variant:"success",children:(0,n.jsx)(se.A,{color:"white"})}):i&&100===e.batteryLevel?(0,n.jsx)(ie.A,{variant:"fill",color:a.Ay[`desktop-color-green-06-${r}`],size:"original"}):null},de=({battpool:e={},bms_run_anomaly:t=0,isCharging:s=!1})=>{const{themeName:r}=(0,d.u)(),c=0===e.readycnt,A=!!(0,i.g$)(t);return(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.YC,children:[(0,n.jsxs)(u.A,{justifyContent:"space-between",children:[(0,n.jsxs)(u.A,{alignItems:"center",gap:o.YC,children:[(0,n.jsx)(C.A,{variant:"medium",children:(0,n.jsx)(_.sA,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY"})}),(0,n.jsx)(ce,{battpool:e,noBattery:c,badBattery:A,isCharging:s})]}),A?null:(0,n.jsxs)(u.A,{gap:o.YC,alignItems:"center",children:[(0,n.jsx)(l.A,{size:"medium",color:"text-3",children:(0,n.jsx)(le,{battpool:e,noBattery:c,isCharging:s})}),(0,n.jsx)(te.A,{orientation:"vertical",style:{height:16},color:a.Ay[`desktop-color-neutral-03-${r}`]}),(0,n.jsxs)(l.A,{size:"medium",color:e.batteryLevel<20?"notice":"positive",children:[Math.round(e.batteryLevel||0),"%"]})]})]}),A?(0,n.jsx)(l.A,{size:"medium",color:"text-1",children:(0,n.jsx)(_.sA,{id:"DEVICE_BATTERY_STATE_BAD_BATTERY_WARNING"})}):null]})},_e=({battpool:e={},bms_run_anomaly:t=0,isCharging:s=!1})=>(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.kc,children:[(0,n.jsx)(de,{battpool:e,bms_run_anomaly:t,isCharging:s}),(0,n.jsx)(I.A,{value:e.batteryLevel||0,size:8,variant:e.batteryLevel>=45?"success":"danger"})]});var ue=s(748094),Ae=s(809465);const me=({messageId:e,values:t})=>(0,n.jsx)(ue.A,{marginBottom:"none",children:(0,n.jsx)(_.sA,{id:e,values:t})}),Ee=()=>(0,n.jsx)(Ae.A,{children:(0,n.jsx)(_.sA,{id:"COMMON_CONTACT_SUPPORT"})}),xe=({errorCode:e})=>(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.Ln,children:[(0,i.Yx)(e)?(0,n.jsx)(me,{messageId:"DEVICE_WARNING_UPS_SHORT_CIRCUIT"}):null,(0,i.rS)(e)||(0,i.hH)(e)||(0,i.uc)(e)?(0,n.jsx)(me,{messageId:"DEVICE_WARNING_UPS_DEVICE_FAILURE",values:{link:(0,n.jsx)(Ee,{})}}):null]});var Ie,pe,Ce,Oe,he=s(602086),je=s(548941),Ne=s(247368),ve=s(244081),ge=s(724081),Re=s(376892),De=s(222102),Se=s(15989),Me=s(401042),Te=s(571766),be=s(29472),Pe=s(774366);!function(e){e.STATE="state",e.MODEL="model",e.NAME="name",e.CONSOLE_MAC="console_mac",e.UPS_MAC="ups_mac",e.ICON="icon",e.SQUARE_WAVE_INCOMPATIBLE="square_wave_incompatible"}(Ie||(Ie={})),function(e){e.PAIRED="paired",e.UNPAIRED="unpaired",e.UPGRADE_NEEDED="upgrade_needed",e.TOKEN_INVALID="token_invalid",e.OFFLINE="offline"}(pe||(pe={})),function(e){e.CONSOLE_MAC="console_mac",e.USERNAME="username",e.PASSWORD="password",e.UPS_MAC="ups_mac"}(Ce||(Ce={})),function(e){e.CONSOLE_MAC="console_mac"}(Oe||(Oe={}));const fe="/v2/api/ups",ye=`${fe}/consoles`,Le=`${fe}/pair`,we=`${fe}/unpair`,Ve=Ce.CONSOLE_MAC,ke=(e={},t={})=>(0,be.t9)("safeShutdownPairing",ye,e,{idField:Ve,...t}),Ue=(0,Se.uh)(ke()),We=(0,De.Mz)(Ue,Me.kh);var Ge=s(167933),Be=s(262016),Fe=s(586566),ze=s(346100),$e=s(728091),He=s(699709),Ye=s(833466),Xe=s(968373),Ke=s(16805),Qe=s(625133),qe=s(164487);const Je=e=>Math.max(1,Math.min(10,e)),Ze=({smart_power_caps:e=0,estimatedRuntimeSeconds:t})=>{const{themeName:s}=(0,d.u)(),{control:i}=(0,S.xW)(),r=(0,S.FH)({control:i,name:"outlet_power_cycle_on_ac_recovery_enabled"}),{field:c}=(0,S.as)({control:i,name:"outlet_power_cycle_on_ac_recovery_seconds"}),A=(0,Fe.TM)({smart_power_caps:e},ze.A.POWER_CYCLE_ON_AC_RECOVERY),m=(0,Fe.TM)({smart_power_caps:e},ze.A.SAFE_SHUTDOWN_AND_POWER_CYCLE_TIME),E=Je(Math.round((c.value??0)/60)),x=(0,he.useCallback)(e=>{Number.isFinite(e)&&c.onChange(60*Je(Math.round(e)))},[c]),I=(0,he.useCallback)(e=>x(Array.isArray(e)?e[0]:e),[x]),p=(0,he.useCallback)(e=>x(Number(e.target.value)),[x]);return(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.kc,children:[m?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Re.A,{id:"DEVICE_UPS_TRIGGER_POINT"}),(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.kc,children:[(0,n.jsx)(l.A,{variant:"body-primary",children:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_SHUTDOWN_REMAINING"})}),(0,n.jsxs)(u.A,{gap:o.kc,alignItems:"flex-start",children:[(0,n.jsx)(u.A,{height:Ye.b,alignItems:"center",flex:1,children:(0,n.jsx)(Xe.A,{control:i,name:"ups_shutdown_remaining_minutes",minValue:2,maxValue:15,step:1})}),(0,n.jsx)(u.A,{alignItems:"flex-start",width:120,children:(0,n.jsx)(Ke.A,{control:i,name:"ups_shutdown_remaining_minutes",min:2,max:15,step:1,contentAfter:(0,n.jsx)(_.sA,{id:"COMMON_MIN"})})})]}),null!=t&&t>0?(0,n.jsx)(u.A,{background:a.Ay[`desktop-color-neutral-01-${s}`],borderRadius:4,padding:`${o.kc} ${o.xO}`,children:(0,n.jsx)(l.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_ESTIMATED_RUNTIME_AT_CURRENT_LOAD",values:{duration:(0,oe.Ay)(t,t>b.gG?[oe.Au.DAYS,oe.Au.HOURS,oe.Au.MINUTES]:[oe.Au.SECONDS]).join(""),value:e=>(0,n.jsx)(l.A,{size:"medium",color:"text-3",children:e})}})})}):null]})]}):null,A?(0,n.jsx)(Qe.A,{control:i,name:"outlet_power_cycle_on_ac_recovery_enabled",tooltip:(0,n.jsx)(_.sA,{id:"DEVICE_AUTO_RECOVERY_POWER_CYCLE_TOOLTIP"}),children:(0,n.jsx)(l.A,{size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:"DEVICE_AUTO_RECOVERY_POWER_CYCLE"})})}):null,m&&r?(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.YC,children:[(0,n.jsx)(qe.A,{tooltip:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_POWER_RESTORE_DELAY_TOOLTIP"}),children:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_POWER_RESTORE_DELAY"})}),(0,n.jsxs)(u.A,{gap:o.kc,alignItems:"flex-start",children:[(0,n.jsx)(u.A,{height:Ye.b,alignItems:"center",flex:1,children:(0,n.jsx)($e.A,{value:E,minValue:1,maxValue:10,step:1,onChange:I,style:{width:"100%"}})}),(0,n.jsx)(u.A,{alignItems:"flex-start",width:120,children:(0,n.jsx)(He.A,{type:"number",variant:"secondary",width:"100%",value:E,min:1,max:10,step:1,onChange:p,contentAfter:(0,n.jsx)(_.sA,{id:"COMMON_MIN"})})})]})]}):null]})};var et,tt=s(266824),st=s(669439),nt=s(372261),it=s(159469),rt=s(700444);!function(e){e.DEVICE_MAC="deviceMac",e.DEVICE_MODEL="deviceModel",e.DEVICE_IS_PURE_SINE_WAVE="deviceIsPureSineWave",e.PAIRING_DEVICE="pairingDevice",e.SET_PAIRING_DEVICE="setPairingDevice",e.PAIRING_STEP="pairingStep",e.SET_PAIRING_STEP="setPairingStep",e.ON_PAIR="onPair"}(et||(et={}));var ot=s(947414);const at=(0,he.createContext)({[et.DEVICE_MAC]:void 0,[et.DEVICE_MODEL]:void 0,[et.DEVICE_IS_PURE_SINE_WAVE]:void 0,[et.PAIRING_DEVICE]:void 0,[et.SET_PAIRING_DEVICE]:ot.P1,[et.PAIRING_STEP]:void 0,[et.SET_PAIRING_STEP]:ot.P1,[et.ON_PAIR]:ot.P1});var lt=s(570801);const ct=(0,De.Mz)(lt.IG,lt.fR,(e,t)=>e||t),dt=[pe.PAIRED,pe.OFFLINE];var _t=s(207953);const ut=(0,re.A)(u.A)`
  width: 100%;
  height: 100%;

  ${_t.nr?"\n    table td:nth-child(3) > div {\n      margin-top: 0 !important;\n    }\n  ":""}
`;var At;!function(e){e.DEVICE="device",e.STATUS="status"}(At||(At={}));var mt=s(793442),Et=s(726831);const xt=()=>(0,n.jsx)(je.A,{portal:!0,isInteractive:!0,cursorType:"pointer",description:(0,n.jsx)(_.sA,{id:"DEVICE_PAIR_UPGRADE_NEEDED_MESSAGE",values:{update:(0,n.jsx)(mt.A,{href:Et.A.unifiOsUpdateManager,customText:(0,_.tz)().formatMessage({id:"COMMON_ACTION_UPDATE"}).toLowerCase()})}}),children:(0,n.jsx)(tt.A,{type:"button",fontSize:"medium",isDisabled:!0,children:(0,n.jsx)(_.sA,{id:"DEVICE_CLICK_TO_PAIR"})})});var It=s(775250),pt=s(304151);const Ct=({safeShutdownPair:e,tokenInvalid:t=!1})=>{const s=(0,D.d4)(ct),{[et.PAIRING_DEVICE]:i,[et.ON_PAIR]:r}=(0,he.useContext)(at),o=(0,he.useCallback)(()=>{r(e)},[r,e]);return(0,n.jsx)(st.A,{description:s?void 0:(0,n.jsx)(_.sA,{id:"COMMON_ONLY_OWNER_OR_SUPER_ADMIN_CAN_PERFORM_THIS_ACTION"}),children:(0,n.jsx)(tt.A,{style:{maxWidth:"100%"},type:"button",fontSize:"medium",onPress:o,isDisabled:Boolean(i?.[Ie.CONSOLE_MAC])||!s,children:(0,n.jsx)(It.A,{color:"inherit",size:"inherit",isTruncated:!0,children:(0,n.jsx)(_.sA,{id:t?"DEVICE_AUTHORIZATION_EXPIRED":"DEVICE_CLICK_TO_PAIR"})})})})},Ot=({deviceModel:e,consoleName:t})=>(0,n.jsxs)(u.A,{gap:o.YC,children:[(0,n.jsx)(l.E,{size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:"DEVICE_NOT_COMPATIBLE"})}),(0,n.jsx)(pt.A,{description:(0,n.jsx)(_.sA,{id:"DEVICE_SINE_WAVE_NOT_SUPPORTED_TOOLTIP",values:{device:e?(0,r.Lm)(e):(0,n.jsx)(_.sA,{id:"COMMON_FALLBACK"}),console:t}})})]}),ht=({safeShutdownPair:e,tokenInvalid:t=!1,deviceModel:s,deviceIsPureSineWave:i=!1})=>!i&&e[Ie.SQUARE_WAVE_INCOMPATIBLE]?(0,n.jsx)(Ot,{deviceModel:s,consoleName:e[Ie.NAME]}):(0,n.jsx)(Ct,{safeShutdownPair:e,tokenInvalid:t}),jt=({safeShutdownPair:e})=>(0,n.jsx)(ht,{safeShutdownPair:e,tokenInvalid:!0}),Nt=()=>(0,n.jsxs)(l.A,{size:"medium",color:"text-3",children:[(0,n.jsx)(_.sA,{id:"DEVICE_PAIRING"}),".."]}),vt=({safeShutdownPair:e})=>{const{[et.DEVICE_MAC]:t,[et.ON_PAIR]:s}=(0,he.useContext)(at),i=(0,he.useCallback)(()=>{s(e)},[s,e]);return t===e[Ie.UPS_MAC]?(0,n.jsx)(l.A,{size:"medium",color:"green-06",children:(0,n.jsx)(_.sA,{id:"DEVICE_PAIRED"})}):(0,n.jsx)(tt.A,{type:"button",fontSize:"medium",onPress:i,children:(0,n.jsx)(_.sA,{id:"DEVICE_TAKE_OVER"})})},gt=()=>(0,n.jsx)(l.A,{size:"medium",color:"text-3",children:(0,n.jsx)(_.sA,{id:"COMMON_CONSOLE_OFFLINE"})});var Rt=s(974390),Dt=s(650632),St=s(156007);const Mt=(0,re.A)(u.A)`
  gap: ${o.YC};
  align-items: center;
`,Tt={accessorFn:e=>e,enableResizing:!1,enableSorting:!1},bt=[{...Tt,id:At.DEVICE,size:190,header:()=>(0,n.jsx)(_.sA,{id:"COMMON_DEVICE"}),cell:({getValue:e})=>{return t=e(),(0,n.jsxs)(Mt,{children:[Object.keys(t[Ie.ICON]||{}).length?(0,n.jsx)(Dt.A,{width:25,height:25,client:t[Ie.ICON]}):(0,n.jsx)(Rt.A,{model:t[Ie.MODEL],width:25,height:25}),(0,n.jsx)(St.A,{size:"medium",color:"text-2",children:(0,r.Q)({name:t[Ie.NAME],model:t[Ie.MODEL],mac:t[Ie.CONSOLE_MAC]})})]});var t}},{...Tt,id:At.STATUS,size:140,header:()=>(0,n.jsx)(_.sA,{id:"COMMON_STATUS"}),cell:({getValue:e})=>((e,{[et.PAIRING_DEVICE]:t,[et.DEVICE_MODEL]:s,[et.DEVICE_IS_PURE_SINE_WAVE]:i})=>{if(t?.[Ie.CONSOLE_MAC]===e[Ie.CONSOLE_MAC])return(0,n.jsx)(Nt,{});switch(e[Ie.STATE]){case pe.PAIRED:return(0,n.jsx)(vt,{safeShutdownPair:e});case pe.UNPAIRED:return(0,n.jsx)(ht,{safeShutdownPair:e,deviceModel:s,deviceIsPureSineWave:i});case pe.UPGRADE_NEEDED:return(0,n.jsx)(xt,{});case pe.TOKEN_INVALID:return(0,n.jsx)(jt,{safeShutdownPair:e});case pe.OFFLINE:return(0,n.jsx)(gt,{});default:return null}})(e(),(0,he.useContext)(at))}],Pt=({safeShutdownPairs:e})=>{const[t,s]=(0,he.useState)(!1),i=(0,D.wA)(),{[et.DEVICE_MAC]:r}=(0,he.useContext)(at),o=(0,D.d4)(ct),a=(0,he.useCallback)(e=>()=>{var t;s(!0),i((t={[Oe.CONSOLE_MAC]:e},(0,be.vB)(Te.aC,null,null,Pe.A.POST,we,{},t))).then(()=>{i(ke())}).catch(({msg:e})=>{i((0,rt.ox)({icon:it.C.danger,message:e||"COMMON_NOTICE_REQUEST_ERROR"}))}).finally(()=>{s(!1)})},[i]),l=(0,he.useCallback)(({rowId:e})=>(0,n.jsx)(st.A,{description:o?void 0:(0,n.jsx)(_.sA,{id:"COMMON_ONLY_OWNER_OR_SUPER_ADMIN_CAN_PERFORM_THIS_ACTION"}),children:(0,n.jsx)(tt.A,{variant:"destructive",type:"button",fontSize:"medium",onPress:a(e),isDisabled:t||!o,children:(0,n.jsx)(_.sA,{id:"DEVICE_UNPAIR"})})}),[a,t,o]),c=(0,he.useMemo)(()=>o?e.map(e=>({...e,...dt.includes(e[Ie.STATE])&&e[Ie.UPS_MAC]===r?{_rowHoverContent:l}:{}})):e,[o,e,r,l]),d=(0,he.useCallback)(e=>e[Ie.CONSOLE_MAC],[]);return(0,n.jsx)(ut,{children:(0,n.jsx)(nt.A,{data:c,columns:bt,getRowId:d,stickyHeader:!1})})};var ft=s(285837),yt=s(83985),Lt=s(877840),wt=s(565527);const Vt=(0,re.A)(u.A)`
  gap: ${o.kc};
  background-color: ${({theme:{themeName:e}})=>a.Ay[`desktop-color-neutral-${e===wt.S.DARK?"03":"02"}-${e}`]};
  border-radius: ${a.Ay["desktop-radius-base"]};
  padding: ${o.kc};
`,kt=({messageId:e})=>(0,n.jsxs)(Vt,{children:[(0,n.jsx)(Ne.A,{size:"original",isActive:!0,variant:"fill"}),(0,n.jsx)(l.A,{size:"medium",color:"text-2",children:(0,n.jsx)(_.sA,{id:e,values:{name:(0,he.useContext)(at)[et.PAIRING_DEVICE]?.[Ie.NAME]}})})]});var Ut;!function(e){e.SIX_DIGIT_CODE="sixDigitCode"}(Ut||(Ut={}));var Wt=s(241792);const Gt=Wt.Ik({[Ut.SIX_DIGIT_CODE]:Wt.Yj().min(6)}),Bt={[Ut.SIX_DIGIT_CODE]:""},Ft=(0,re.A)(u.A)`
  flex-direction: column;
  gap: ${o.tr};
  padding: ${o.kc};
`,zt=(0,re.A)(u.A)`
  gap: ${o.kc};
`,$t=()=>{const[e,t]=(0,he.useState)(!1),{[et.SET_PAIRING_DEVICE]:s}=(0,he.useContext)(at),{control:i}=(0,T.m)({schema:Gt,defaultValues:Bt}),{isValid:r}=(0,S.lN)({control:i}),o=(0,he.useCallback)(()=>{t(!0)},[]),a=(0,he.useCallback)(()=>{s(void 0)},[s]),l=(0,he.useCallback)(e=>t=>{e(t)},[]),c=(0,he.useCallback)(({field:{value:e,onChange:t,onBlur:s},fieldState:{invalid:i}})=>(0,n.jsx)(ft.A,{tokens:6,type:"number",value:e,onChange:l(t),invalid:i,onBlur:s}),[l]);return(0,n.jsx)(Lt.A,{isDisabled:e,children:(0,n.jsxs)(Ft,{children:[(0,n.jsx)(kt,{messageId:"SHARED_MFA_DESCRIPTION_TOTP"}),(0,n.jsx)(S.xI,{control:i,name:Ut.SIX_DIGIT_CODE,render:c}),(0,n.jsxs)(zt,{children:[(0,n.jsx)(yt.A,{size:"small",type:"button",onPress:o,isDisabled:!r||e,children:(0,n.jsx)(_.sA,{id:"COMMON_ACTION_CONFIRM"})}),(0,n.jsx)(yt.A,{size:"small",variant:"tertiary-neutral",type:"button",onPress:a,children:(0,n.jsx)(_.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})})};var Ht,Yt=s(635891),Xt=s(260334);!function(e){e.USERNAME="username",e.PASSWORD="password"}(Ht||(Ht={}));const Kt={[Ht.USERNAME]:"",[Ht.PASSWORD]:""},Qt=(0,re.A)(u.A)`
  flex-direction: column;
  gap: ${o.kc};
  padding: ${o.kc};
`,qt=(0,re.A)(u.A)`
  gap: ${o.kc};
`,Jt=()=>{const e=(0,D.wA)(),{formatMessage:t}=(0,_.tz)(),[s,i]=(0,he.useState)(!1),{[et.DEVICE_MAC]:r,[et.PAIRING_DEVICE]:o,[et.SET_PAIRING_DEVICE]:a,[et.SET_PAIRING_STEP]:l}=(0,he.useContext)(at),c=(0,he.useMemo)(()=>(e=>Wt.Ik({[Ht.USERNAME]:Wt.Yj().nonempty({message:(0,Xt.rn)("COMMON_VALIDATION_REQUIRED",{name:`${e({id:"COMMON_LABEL_USERNAME"})} ${e({id:"COMMON_OR"})} ${e({id:"COMMON_EMAIL"})}`})}),[Ht.PASSWORD]:Wt.Yj({message:(0,Xt.rn)("COMMON_MIN_CHARS",{min:3})}).min(3)}))(t),[t]),{control:d,trigger:u}=(0,T.m)({schema:c,defaultValues:Kt}),{isValid:A}=(0,S.lN)({control:d}),m=(0,S.FH)({control:d,name:Ht.USERNAME}),E=(0,S.FH)({control:d,name:Ht.PASSWORD}),x=(0,he.useCallback)(()=>{var t;m&&E&&(i(!0),e((t={[Ce.CONSOLE_MAC]:(o||{})?.[Ie.CONSOLE_MAC],[Ce.USERNAME]:m,[Ce.PASSWORD]:E,[Ce.UPS_MAC]:r},(0,be.vB)(Te.aC,null,null,Pe.A.POST,Le,{},t))).then(()=>{e(ke()),l(void 0),a(void 0)}).catch(({msg:t})=>{e((0,rt.ox)({icon:it.C.danger,message:t||"COMMON_NOTICE_REQUEST_ERROR"}))}).finally(()=>{i(!1)}))},[e,o,m,E,r,l,a]),I=(0,he.useCallback)(()=>{a(void 0)},[a]),p=(0,he.useCallback)(async(e,t)=>{t.onChange(e),await u(t.name)},[u]);return(0,n.jsx)(Lt.A,{isDisabled:s,children:(0,n.jsxs)(Qt,{children:[(0,n.jsx)(kt,{messageId:"DEVICE_PAIRING_LOGIN_FORM_BANNER"}),(0,n.jsx)(Yt.A,{control:d,name:Ht.USERNAME,label:(0,n.jsxs)("span",{children:[(0,n.jsx)(_.sA,{id:"COMMON_LABEL_USERNAME"})," ",(0,n.jsx)(_.sA,{id:"COMMON_OR"})," ",(0,n.jsx)(_.sA,{id:"COMMON_EMAIL"})]}),onChange:p}),(0,n.jsx)(Yt.A,{control:d,name:Ht.PASSWORD,label:(0,n.jsx)(_.sA,{id:"COMMON_PASSWORD"}),onChange:p,passwordToggle:!0}),(0,n.jsxs)(qt,{children:[(0,n.jsx)(yt.A,{size:"small",type:"button",onPress:x,isDisabled:!A||s,children:(0,n.jsx)(_.sA,{id:"DEVICE_PAIR"})}),(0,n.jsx)(yt.A,{size:"small",variant:"tertiary-neutral",type:"button",onPress:I,children:(0,n.jsx)(_.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})})};var Zt;!function(e){e.LOGIN="login",e.MFA="mfa"}(Zt||(Zt={}));const es=(0,re.A)(u.A)`
  background-color: ${({theme:{themeName:e}})=>a.Ay[`desktop-color-neutral-${e===wt.S.DARK?"02":"01"}-${e}`]};
`,ts=()=>{const{[et.PAIRING_DEVICE]:e,[et.PAIRING_STEP]:t}=(0,he.useContext)(at),s=(0,he.useMemo)(()=>{switch(t){case Zt.LOGIN:return(0,n.jsx)(Jt,{});case Zt.MFA:return(0,n.jsx)($t,{});default:return null}},[t]);return e&&s?(0,n.jsx)(es,{children:s}):null},ss=(0,re.A)(u.A)`
  flex-direction: column;
  gap: ${o.kc};
`,ns=(0,re.A)(u.A)`
  flex-direction: column;
  gap: ${o.Ln};
`,is=(0,re.A)("div")`
  li > div[role='button']:focus {
    box-shadow: inset 0 0 0 1px ${({theme:{themeName:e}})=>a.Ay[`desktop-color-focusvisible-${e}`]};
  }
`,rs=(0,re.A)(u.A)`
  align-items: center;
  gap: ${o.YC};
`,os=({mac:e,model:t,safeShutdownPairs:s,is_pure_sine_wave:i})=>{const{themeName:r}=(0,d.u)(),[c,A]=(0,he.useState)(void 0),[m,E]=(0,he.useState)(void 0),x=(0,he.useCallback)(e=>{A(e),E(Zt.LOGIN)},[A,E]),I=(0,he.useMemo)(()=>({[et.DEVICE_MAC]:e,[et.DEVICE_MODEL]:t,[et.DEVICE_IS_PURE_SINE_WAVE]:i,[et.PAIRING_DEVICE]:c,[et.SET_PAIRING_DEVICE]:A,[et.PAIRING_STEP]:m,[et.SET_PAIRING_STEP]:E,[et.ON_PAIR]:x}),[c,m,e,t,i,x]);return(0,n.jsx)(at.Provider,{value:I,children:(0,n.jsxs)(ss,{children:[s.length>0?(0,n.jsx)(Pt,{safeShutdownPairs:s}):(0,n.jsx)(u.A,{background:a.Ay[`desktop-color-neutral-01-${r}`],borderRadius:4,padding:`${o.kc} ${o.xO}`,children:(0,n.jsx)(l.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_NO_PAIRABLE_DEVICES"})})}),(0,n.jsx)(ts,{})]})})},as=(0,he.memo)(({mac:e,model:t,is_pure_sine_wave:s,smart_power_caps:i,estimatedRuntimeSeconds:r})=>{const o=(0,D.d4)(Ge.rQ),a=(0,D.d4)(We),l=(0,Fe.TM)({smart_power_caps:i},ze.A.SAFE_SHUTDOWN_AND_POWER_CYCLE_TIME),c=(0,he.useMemo)(()=>[{id:os.toString(),openByDefault:!0,label:(0,n.jsxs)(rs,{children:[(0,n.jsx)(Re.A,{id:"DEVICE_SAFE_SHUTDOWN_PAIRING"}),(0,n.jsx)(je.A,{portal:!0,isInteractive:!0,description:(0,n.jsx)(_.sA,{id:l?"DEVICE_SAFE_SHUTDOWN_PAIRING_TOOLTIP_TRIGGER_POINT":"DEVICE_SAFE_SHUTDOWN_PAIRING_TOOLTIP"}),children:(0,n.jsx)("span",{children:(0,n.jsx)(Ne.A,{isActive:!0,size:"original"})})})]}),renderContent:()=>(0,n.jsxs)(ns,{children:[(0,n.jsx)(os,{mac:e,model:t,is_pure_sine_wave:s,safeShutdownPairs:a}),(0,n.jsx)(Ze,{smart_power_caps:i,estimatedRuntimeSeconds:r})]})}],[l,e,t,s,a,i,r]);return(0,ge.A)([(0,Be.m)(void 0,{crudCacheStrategy:{type:ve.e.CACHE}}),ke(void 0,{crudCacheStrategy:{type:ve.e.CACHE}})],o?(0,n.jsx)(is,{children:(0,n.jsx)(m.A,{type:m.I.ACCORDION,items:c})}):null)});var ls=s(890932);const cs={[h.W4.USWDA23]:"/device/upsTower/reset.png",[h.W4.USWDA24]:"/device/upsTower/reset.png",[h.W4.USWDA25]:"/device/ups2U/reset.png",[h.W4.USWDA26]:"/device/ups2U/reset.png"},ds=({model:e})=>{const{themeName:t}=(0,d.u)();return(0,n.jsxs)(u.A,{flexDirection:"column",alignItems:"center",children:[(0,n.jsx)(ue.A,{variant:"warning",flex:1,padding:`${o.Ln} 0`,children:(0,n.jsx)(_.sA,{id:"DEVICE_WARNING_UPS_DEVICE_OVERLOAD"})}),(0,n.jsx)(u.A,{justifyContent:"center",alignItems:"center",children:(0,n.jsx)(u.A,{width:"104px",height:"104px",justifyContent:"center",alignItems:"center",borderRadius:"50%",overflow:"hidden",background:a.Ay[`desktop-color-neutral-01-${t}`],border:`solid 1px ${a.Ay[`desktop-color-neutral-03-${t}`]}`,children:(0,n.jsx)("img",{src:`${(0,D.d4)(ls.p)}${cs[e]||"/device/upsTower/reset.png"}`,height:104,alt:"reset"})})})]})};var _s=s(658519),us=s(858056),As=s(590979),ms=s(449339),Es=s(589650),xs=s(205521),Is=s(89469),ps=s(254193);const Cs=({username:e})=>(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{color:"text-2",size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_LABEL_USERNAME"})}),(0,n.jsxs)(u.A,{alignItems:"center",gap:o.YC,children:[(0,n.jsx)(It.A,{color:"text-3",size:"medium",isTruncated:!0,children:e}),(0,n.jsx)(ps.A,{value:e})]})]});var Os=s(29834),hs=s(858548);const js=(0,re.A)(It.A)`
  -webkit-text-security: disc;
  text-security: disc;
`,Ns=({password:e})=>{const[t,s]=(0,he.useState)(!1);return(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{color:"text-2",size:"medium",children:(0,n.jsx)(_.sA,{id:"COMMON_PASSWORD"})}),(0,n.jsxs)(u.A,{alignItems:"center",gap:o.YC,children:[(0,n.jsx)(t?It.A:js,{color:"text-3",size:"medium",isTruncated:!0,children:e}),(0,n.jsx)(tt.A,{onPress:()=>s(!t),variant:"neutral",children:(0,n.jsx)(t?hs.A:Os.A,{size:"original"})})]})]})},vs=({id:e,port:t})=>{const s=e&&t?`${e}:${t}`:void 0;return(0,n.jsxs)(Q.A,{children:[(0,n.jsxs)(l.A,{color:"text-2",size:"medium",children:[(0,n.jsx)(_.sA,{id:"COMMON_ID"})," / ",(0,n.jsx)(_.sA,{id:"COMMON_PORT"})]}),(0,n.jsx)(u.A,{alignItems:"center",gap:o.YC,children:s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(It.A,{color:"text-3",size:"medium",isTruncated:!0,children:s}),(0,n.jsx)(ps.A,{value:s})]}):null})]})},gs=({label:e,children:t})=>(0,n.jsxs)(Q.A,{children:[(0,n.jsx)(l.A,{color:"text-2",size:"medium",children:e}),(0,n.jsxs)(u.A,{alignItems:"center",gap:o.YC,children:[(0,n.jsx)(It.A,{color:"text-3",size:"medium",isTruncated:!0,children:t}),(0,n.jsx)(ps.A,{value:t})]})]}),Rs=({nut_server:e,nut_client_table:t=[],mac:s})=>{const i=(0,D.wA)(),{id:r,port:a,credential_required:c,username:d,password:A}=e,E=(0,he.useCallback)(()=>{i((0,xs.XP)({type:ms.H.DEVICE,id:s,tab:Es.BC.SETTINGS}))},[i,s]);return(0,n.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:"nutServer",openByDefault:!0,renderLabel:()=>(0,n.jsxs)(u.A,{gap:o.YC,alignItems:"center",children:[(0,n.jsx)(l.A,{variant:"heading-medium",children:(0,n.jsx)(_.sA,{id:"DEVICE_HEADER_NUTSERVER"})}),(0,n.jsx)(tt.A,{onPress:E,...As.A.addDataTestId(As.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(_s.A,{size:"original"})})]}),renderContent:()=>(0,n.jsxs)(u.A,{flexDirection:"column",children:[(0,n.jsx)(vs,{id:r,port:a}),c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Cs,{username:d}),(0,n.jsx)(Ns,{password:A})]}):null,t?.length?(0,n.jsxs)(Is.A,{children:[(0,n.jsx)(us.A,{size:"medium",children:(0,n.jsx)(_.sA,{id:"DEVICE_NUT_CLIENTS"})}),(0,n.jsx)(u.A,{flexDirection:"column",children:t.slice().sort((e,t)=>(e.index||0)-(t.index||0)).map(({index:e,name:t,ip:s})=>(0,n.jsx)(gs,{label:t,children:s},e))})]}):null]})}]})},Ds=()=>(0,n.jsxs)(u.A,{gap:o.kc,children:[(0,n.jsx)(c.A,{size:"original",color:a.Ay[`desktop-color-orange-06-${(0,d.u)().themeName}`],variant:"fill"}),(0,n.jsx)(l.A,{size:"medium",color:"text-1",children:(0,n.jsx)(_.sA,{id:"DEVICE_UPS_TOWER_BUZZ_WARNING",values:{b:_.b}})})]});var Ss=s(216082),Ms=s(260067);const Ts=({activeItem:e,activeItem:{name:t,type:s,model:a,ip:l,lan_ip:c,ipv6:d,mac:_,displayable_version:I,uptime:p,vbms_table:C={},nut_server:O={},nut_client_table:h=[],_id:j,outlet_power_cycle_on_ac_recovery_enabled:D,outlet_enabled:S,shortname:M,radio_table:T,radio_table_stats:b,vap_table:P,support_wifi6e:f,deviceState:y,ethernet_overrides:L,port_table:w,uplink:V,device_mode_override:k}})=>(0,n.jsxs)(W,{activeItem:{_id:j,mac:_,outlet_power_cycle_on_ac_recovery_enabled:D,outlet_power_cycle_on_ac_recovery_seconds:e.outlet_power_cycle_on_ac_recovery_seconds,ups_shutdown_remaining_minutes:e.ups_shutdown_remaining_minutes},isBatteryMode:Boolean(C?.is_battery_mode),estimatedRuntimeSeconds:C?.battpool?.timeToRemain,children:[C?.is_battery_mode?(0,n.jsx)(m.A,{children:(0,E.Snx)(e)?(0,n.jsx)(Ds,{}):(0,n.jsx)(A,{name:(0,r.Q)(e)})}):null,C?.bms_run_anomaly?(0,n.jsx)(xe,{errorCode:C.bms_run_anomaly}):null,(0,n.jsx)(R.A,{activeItem:e,hidePortsButton:!0,hideUpdate:Boolean(C?.is_battery_mode)||!S,overviewChildren:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ms.A,{type:e.type,mac:e.mac,radio_table:T,radio_table_stats:b,vap_table:P,support_wifi6e:f,deviceState:y}),(0,n.jsx)(u.A,{marginTop:o.Ln,alignItems:"center",justifyContent:"center",children:(0,i.Md)(C?.bms_run_anomaly||0)?(0,n.jsx)(ds,{model:a}):(0,n.jsx)(u.A,{flexDirection:"column",gap:o.Ln,children:(0,n.jsx)(v.A,{activeItem:e,gap:o.Yc,hidePorts:!0,tooltipPlacement:"top",noDivider:!0,...(0,E.Snx)(e)?{verticalLegend:(0,n.jsx)(Z.Ay,{})}:{},...(0,E.uaO)(e)||(0,E.vqp)(e)?{legend:(0,n.jsx)(Z.u6,{})}:{}})})})]})}),O?.enabled?(0,n.jsx)(Rs,{mac:_,nut_server:O,nut_client_table:h}):null,C?.battpool?(0,n.jsx)(m.A,{children:(0,n.jsxs)(u.A,{flexDirection:"column",gap:o.kc,children:[(0,n.jsx)(N,{current:C.battpool.device_total_power_output||0,max:C.battpool.device_total_power_budget||0,model:a}),(0,n.jsx)(_e,{battpool:C.battpool||{},bms_run_anomaly:C.bms_run_anomaly||0,isCharging:!C.is_battery_mode})]})}):null,(0,n.jsx)(as,{mac:e.mac,model:e.model,is_pure_sine_wave:e.is_pure_sine_wave,smart_power_caps:e.smart_power_caps,estimatedRuntimeSeconds:C?.battpool?.timeToRemain}),(0,n.jsx)(m.A,{children:(0,n.jsx)(J,{name:t,ethernet_overrides:L,port_table:w,type:s,model:a,ip:l,lan_ip:c,ipv6:d,mac:_,connection_network_id:e.connection_network_id,displayable_version:I,uptime:p,vbms_table:C,local_uplink_port:(0,x.q$)(e)?.port_idx,uplink:V,device_mode_override:k})}),(0,n.jsx)(g.A,{activeItem:e}),(0,n.jsx)(Ss.A,{shortname:M})]})},696049(e,t,s){s.d(t,{H:()=>n});const n=""},833466(e,t,s){s.d(t,{b:()=>n});const n=32},61322(e,t,s){s.d(t,{I:()=>n});const n={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,s,n){return Math.min((n||this.ROW_HEIGHT)*e+(s??this.HEADER_HEIGHT),(n||this.ROW_HEIGHT)*t+(s??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,s){return Math.min((s||this.EDIT_FIELD_HEIGHT)*e,(s||this.EDIT_FIELD_HEIGHT)*t)}}},121713(e,t,s){s.d(t,{m:()=>m});var n=s(602086),i=s(977872),r=s(42220),o=s(369289),a=s(721533),l=s(700444),c=s(159469),d=s(260334);const _=(e,t=[])=>{if(!e||"object"!=typeof e)return[];const s=e;return[...Object.keys(s).filter(e=>"ref"!==e).flatMap(e=>_(s[e],[...t,e])),..."string"==typeof s.message&&s.message?[{path:s.ref?.name??t.join("."),message:s.message}]:[]]},u=e=>[...Array.from(document.getElementsByName(e)),document.getElementById(e),document.querySelector(`label[for="${e}"]`),document.querySelector(`[data-field-error="${e}"]`)].find(e=>e instanceof HTMLElement&&null!==e.offsetParent)??null,A=e=>{const t=(e.split(".").pop()??e).replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):e};function m({schema:e,defaultValues:t,presets:s,mode:m="onTouched"}){const E=(0,i.wA)(),x=(0,d.L_)(),I=(0,n.useMemo)(()=>s?(0,o.A)(s,e=>e.defaultValues):{},[s]),p=(0,n.useMemo)(()=>({...t,...I}),[I,t]),C=(0,r.mN)({resolver:(0,a.u)(e),shouldFocusError:!0,defaultValues:p,shouldUseNativeValidation:!1,mode:m}),O=(0,n.useRef)(p);O.current=p;const h=(0,n.useRef)(null),{submitCount:j}=C.formState;(0,n.useEffect)(()=>{const e=h.current;if(h.current=null,!e)return;const t=_(e),s=t[0],n=s?.path??Object.keys(e)[0];if(n)try{const e=t.map(e=>u(e.path)).find(Boolean)??(t.length?null:u(n));if(e)e.scrollIntoView?.({behavior:"smooth",block:"center"}),e.focus?.({preventScroll:!0});else{const e=s&&x(s.message);E((0,l.ox)(s&&e?{icon:c.C.danger,title:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE",translateTitle:!0,message:"COMMON_VALIDATION_HIDDEN_FIELDS_DETAIL",values:{field:A(s.path),message:e}}:{icon:c.C.danger,message:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE"}))}}catch{}},[j,E,x]);const N=(0,n.useCallback)((...e)=>{const[t,...s]=e;return C.reset(t?{...t,...I}:O.current,...s)},[I,C]);return{...C,reset:N,formState:{...C.formState,isDirty:!!Object.keys(C.formState.dirtyFields).length,isSubmitting:C.formState.isSubmitting,defaultValues:C.formState.defaultValues},handleSubmit:(...e)=>C.handleSubmit(e[0],(t,...s)=>{h.current=t,e[1]?.(t,...s)})}}},877840(e,t,s){s.d(t,{A:()=>a});var n=s(274934),i=s(602086),r=s(184931),o=s(712642);const a=({isDisabled:e,isAdditive:t=!0,children:s})=>{const a=(0,r.pv)(),l=(0,i.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),c=(0,i.useMemo)(()=>({fields:t?l.fields||a.fields:l.fields,labels:t?l.labels||a.labels:l.labels,tooltipIcons:t?l.tooltipIcons||a.tooltipIcons:l.tooltipIcons,tooltipPopovers:t?l.tooltipPopovers||a.tooltipPopovers:l.tooltipPopovers}),[t,l.fields,l.labels,l.tooltipIcons,l.tooltipPopovers,a.fields,a.labels,a.tooltipIcons,a.tooltipPopovers]);return(0,n.jsx)(o.I.Provider,{value:c,children:s})}},260334(e,t,s){s.d(t,{L_:()=>d,MS:()=>c,rn:()=>l});var n=s(602086),i=s(949812),r=s(765282),o=s(470070);const a="{::}",l=(e,t)=>`${e}${a}${JSON.stringify(t??{})}`,c=(e,t)=>{if("string"!=typeof t)return;const[s,...n]=t.split(a);if(!s||!n.length)return t;let i={};try{i=Object.fromEntries(Object.entries(JSON.parse(n.join(a))).map(([t,s])=>[t,"string"==typeof s?c(e,s):s]))}catch{}return e.formatMessage({id:s},i)};function d(){const{formatMessage:e}=(0,o.tz)();return(0,n.useCallback)(t=>c({formatMessage:e},t),[e])}i.pJ((e,t)=>e.message?{message:e.message}:e.code===r.eq.too_small&&"string"===e.type?{message:l("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===r.eq.too_big&&"string"===e.type?{message:l("COMMON_MAX_CHARS",{name:l("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===r.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:l("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===r.eq.too_small&&"array"===e.type?{message:l("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===r.eq.invalid_type&&"undefined"===e.received?{message:l("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===r.eq.invalid_type&&"number"===e.expected?{message:l("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},625133(e,t,s){s.d(t,{A:()=>d});var n=s(274934),i=s(42220),r=s(221835),o=s(309130),a=s(304151),l=s(100978),c=s(184931);const d=function({control:e,name:t,children:s,tooltip:d,tooltipProps:_,onToggle:u,renderCheckbox:A,inputClassName:m,isDisabled:E,isChecked:x}){const I=(0,c.mQ)()||E;return(0,n.jsx)(i.xI,{control:e,name:t,render:({field:e})=>{const t=(0,n.jsx)(r.A,{id:e.name,onChange:({target:{checked:t}})=>{e.onChange(t),u?.(t)},checked:x??!!e.value,disabled:I,inputClassName:m,children:s});return(0,n.jsxs)(l.A,{gap:o.YC,alignItems:"center",children:[A?A(t,e):t,d?(0,n.jsx)(a.A,{description:d,..._}):null]})}})}},16805(e,t,s){s.d(t,{A:()=>c});var n=s(274934),i=s(42220),r=s(699709),o=s(309130),a=s(260334),l=s(184931);const c=function({control:e,name:t,label:s,placeholder:c,tooltip:d,tooltipProps:_,contentAfter:u,arrowSize:A,min:m,max:E,step:x,value:I,variant:p="secondary",iconBefore:C,onAfterChange:O,onChange:h}){const j=(0,l.mQ)(),N=(0,a.L_)();return(0,n.jsx)(i.xI,{control:e,name:t,render:({field:{ref:e,...a},fieldState:l,formState:v})=>(0,n.jsx)(r.A,{type:"number",variant:p,width:"100%",...a,value:I??a.value??"",onChange:e=>{h?h(e,v):a.onChange(e.target.value?.length?+e.target.value:null),O?.(e)},disabled:j,invalid:l.invalid?N((0,i.Jt)(v.errors,t)?.message)||!0:void 0,labelTooltip:d,labelTooltipProps:{style:{opacity:j?o.xN:void 0,..._?.style},..._},label:s,placeholder:c,arrowSize:A,contentAfter:u,iconBefore:C,step:x,min:m,max:E})})}},968373(e,t,s){s.d(t,{A:()=>a});var n=s(274934),i=s(728091),r=s(42220),o=s(184931);const a=({control:e,name:t,...s})=>{const{field:a}=(0,r.as)({control:e,name:t}),l=(0,o.mQ)(),c="number"==typeof s.minValue&&"number"==typeof a.value?Math.max(s.minValue,a.value):a.value,d="number"==typeof s.maxValue&&"number"==typeof c?Math.min(s.maxValue,c):c;return(0,n.jsx)(i.A,{...s,style:{width:"100%"},value:d,onChange:e=>{const t=Array.isArray(e)?e[0]:e;"number"!=typeof t||t===a.value||Number.isNaN(t)||a.onChange(t)},isDisabled:l})}},635891(e,t,s){s.d(t,{A:()=>d});var n=s(274934),i=s(42220),r=s(699709),o=s(775250),a=s(309130),l=s(260334),c=s(184931);const d=function({control:e,name:t,label:s,placeholder:d,tooltip:_,tooltipProps:u,autoFocus:A,motif:m,onChange:E,onBlur:x,onAfterChange:I,onPaste:p,onKeyDown:C,passwordToggle:O,type:h,helperMessage:j,autoComplete:N,contentBefore:v,contentAfter:g,onFocus:R,value:D,invalid:S}){const M=(0,c.mQ)(),T=(0,c.Im)(),b=(0,c.q)(),P=(0,l.L_)();return(0,n.jsx)(i.xI,{control:e,name:t,render:({field:e,fieldState:l,formState:c})=>(0,n.jsx)(r.A,{type:h||(O?"password":"text"),variant:"secondary",width:"100%",autoFocus:A,...e,onChange:t=>{E?E(t,e,c):e.onChange(t),I?.(t)},onBlur:t=>{x?x(t,e,c):e.onBlur()},onFocus:R,onPaste:p,disabled:M,value:D??e.value?.toString(),invalid:S||(l.invalid?(0,n.jsxs)(o.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[P((0,i.Jt)(c.errors,t)?.message)||!0," "]}):void 0),label:s,placeholder:d,labelTooltip:_,labelTooltipProps:{style:{opacity:T?a.xN:void 0,pointerEvents:b?"none":void 0,...u?.style},...u},motif:m,passwordToggle:O,helperMessage:j,autoComplete:N,onKeyDown:C,contentBefore:v,contentAfter:g})})}},237887(e,t,s){s.d(t,{A:()=>u});var n=s(274934),i=s(602086),r=s(977872),o=s(310075),a=s(711892),l=s(820633),c=s(308111);const d=e=>(0,n.jsx)(o.A,{renderOption:a.q,...e}),_=e=>(0,n.jsx)(d,{...e});_.Sorted=e=>{const t=(0,r.d4)(l.zi),s=(0,i.useMemo)(()=>(0,c.k)(t),[t]);return(0,n.jsx)(d,{...e,sortBy:s})};const u=_},308111(e,t,s){s.d(t,{R:()=>_,k:()=>u});var n=s(696049),i=s(350068),r=s(177173),o=s(752104),a=s(64222),l=s(230853);const c=[...new Set([n.H,o.Q.join(o.A),r.Zt,a.F,i.nc,l.Vr])],d={numeric:!0,sensitivity:"base"},_=(e,t)=>{const s=[];for(let n=e;n<=t;n+=1)s.push({value:n,label:String(n)});return s},u=e=>({value:t,label:s},{value:n,label:i})=>c.includes(t?.toString())||c.includes(n?.toString())?1/0:s?.toString().localeCompare(i?.toString(),e,d)??-1},372261(e,t,s){s.d(t,{A:()=>I});var n,i,r,o,a,l=s(274934),c=s(602086);!function(e){e.TABLE="table"}(n||(n={})),function(e){e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId"}(i||(i={})),function(e){e.ON_KEY_DOWN="onKeyDown",e.INCOMING_ROW_PROPS="incomingRowProps",e.HAS_ON_ROW_CLICK="hasOnRowClick"}(r||(r={})),function(e){e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex"}(o||(o={})),function(e){e.DATA_MAP_REFERENCE="dataMapReference",e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId",e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex",e.MULTI_SELECT_MODE="multiSelectMode"}(a||(a={}));var d=s(199244),_=s(202730),u=s(147045);var A=s(521376);const m=e=>e?.children?.[1]?.children;var E=s(884144);const x=(0,s(247816).A)(E.A)`
  tr {
    outline: none;
  }
`,I=({data:e=[],rowProps:t,onRowClick:s,...E})=>{const I=(0,c.useRef)(null),p=(0,c.useRef)(null),{[i.ROW_ID_MAP_BY_INDEX]:C,[i.INDEX_MAP_BY_ROW_ID]:O}=(({[n.TABLE]:e})=>{const[t,s]=(0,c.useState)(()=>e?m(e):void 0);(0,c.useEffect)(()=>{e&&s(m(e))},[e]);const{[i.ROW_ID_MAP_BY_INDEX]:r,[i.INDEX_MAP_BY_ROW_ID]:o}=(0,c.useMemo)(()=>{const e=new Map,s=new Map,n=t?.length;if(t&&n)for(let i=0;i<n;i+=1){const n=t[i].getAttribute(d.i);n&&(e.set(n,i),s.set(i,n))}return{[i.ROW_ID_MAP_BY_INDEX]:e,[i.INDEX_MAP_BY_ROW_ID]:s}},[t]);return{[i.ROW_ID_MAP_BY_INDEX]:r,[i.INDEX_MAP_BY_ROW_ID]:o}})({[n.TABLE]:I.current}),h=(e=>{const t=(0,c.useRef)(new Map),s=(0,c.useRef)(void 0);if(s.current!==e){s.current=e,t.current.clear();const n=e.length;for(let s=0;s<n;s+=1)t.current.set(e[s].id,e[s])}return t})(e),j=(({[a.DATA_MAP_REFERENCE]:e,[a.ROW_ID_MAP_BY_INDEX]:t,[a.INDEX_MAP_BY_ROW_ID]:s,[a.INCOMING_ON_ROW_CLICK]:n,[a.LOCAL_CURRENT_INDEX]:i,[a.MULTI_SELECT_MODE]:r})=>{const o=(0,c.useCallback)(e=>{e.preventDefault()},[]),l=(0,c.useCallback)(()=>{const t=e.current.get(s.get(i.current+1));t&&(n?.(t),i.current+=1)},[s,i,n,e]),d=(0,c.useCallback)(()=>{const t=e.current.get(s.get(i.current-1));t&&(n?.(t),i.current-=1)},[s,i,n,e]);return(0,c.useCallback)((e,{id:s})=>e=>{if(!r&&n){const n=t.get(s);if(Number.isFinite(n))switch(null===i.current&&(i.current=n),e.key){case A.U.ARROW_DOWN:o(e),l();break;case A.U.ARROW_UP:o(e),d()}}},[n,i,r,o,t,l,d])})({[a.DATA_MAP_REFERENCE]:h,[a.ROW_ID_MAP_BY_INDEX]:C,[a.INDEX_MAP_BY_ROW_ID]:O,[a.INCOMING_ON_ROW_CLICK]:s,[a.LOCAL_CURRENT_INDEX]:p,[a.MULTI_SELECT_MODE]:E.multiSelectMode}),N=(({[r.INCOMING_ROW_PROPS]:e,[r.ON_KEY_DOWN]:t,[r.HAS_ON_ROW_CLICK]:s})=>(0,c.useCallback)((n,i)=>({...s?{[u.L]:_.b.SIDE_PANEL_TRIGGER}:{},...e?.(n,i),[d.i]:n.id,tabIndex:0,onKeyDown:t(n,i)}),[e,t,s]))({[r.INCOMING_ROW_PROPS]:t,[r.ON_KEY_DOWN]:j,[r.HAS_ON_ROW_CLICK]:Boolean(s)}),v=(({[o.INCOMING_ON_ROW_CLICK]:e,[o.LOCAL_CURRENT_INDEX]:t})=>{const s=(0,c.useCallback)(s=>{t.current=null,e?.(s)},[e,t]);return e?s:void 0})({[o.INCOMING_ON_ROW_CLICK]:s,[o.LOCAL_CURRENT_INDEX]:p});return(0,l.jsx)(x,{ref:I,data:e,rowProps:N,onRowClick:v,tableHeight:e.length?"100%":void 0,virtualize:!0,virtualizeColumn:!0,overscan:7,overscanColumn:1,stickyHeader:!0,...E})}},199244(e,t,s){s.d(t,{i:()=>n});const n="data-row-id"},207953(e,t,s){s.d(t,{gm:()=>r,nr:()=>o});var n=s(473541);const i=s.n(n)().getParser(window.navigator.userAgent).getBrowserName().toLowerCase(),r="firefox"===i,o="safari"===i}}]);