"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[61724],{620627(e,t,i){i.d(t,{A:()=>m});var s=i(274934),l=i(179102),r=i(247816),o=i(309130),n=i(100978),a=i(535322);const c=(0,r.A)("div")`
  margin-right: ${o.kc};
`,d=(0,r.A)("div")`
  margin-left: ${o.kc};
`,m=({icon:e,closeIcon:t,nested:i,children:r,...o})=>(0,s.jsx)(a.A,{nested:i,...o,children:(0,s.jsxs)(n.A,{children:[(0,s.jsx)(c,{children:e}),(0,s.jsx)(l.A,{size:"medium",children:r}),t?(0,s.jsx)(d,{children:t}):null]})})},748094(e,t,i){i.d(t,{A:()=>_});var s=i(274934),l=i(505817),r=i(602086),o=i(526744),n=i(179102),a=i(247368),c=i(711950),d=i(517300),m=i(263705),x=i(613842),A=i(470070),p=i(620627),u=i(100978);const _=(0,r.memo)(({children:e,customIcon:t,link:i,nested:_,extra:j,variant:O="warning",...E})=>{const{themeName:h}=(0,m.u)(),T=(0,r.useMemo)(()=>{switch(O){case"warning":return(0,s.jsx)(c.A,{size:"original",color:l.Ay[`desktop-color-orange-06-${h}`],variant:"fill"});case"info":return(0,s.jsx)(a.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return(0,s.jsx)(d.A,{size:"medium",color:l.Ay[`desktop-color-red-06-${h}`],variant:"fill"})}},[O,h,t]),I=(0,r.useCallback)(()=>{x.A.open(i)},[i]);return(0,s.jsx)(p.A,{icon:T,nested:_,...E,children:(0,s.jsxs)(u.A,{flexDirection:"column",alignItems:"flex-start",children:[(0,s.jsx)(n.A,{children:e}),(0,s.jsx)(n.A,{children:i?(0,s.jsx)(o.A,{type:"button",variant:"inline",onClick:I,children:(0,s.jsx)(A.sA,{id:"COMMON_LEARN_MORE"})}):null}),j]})})})},25511(e,t,i){i.d(t,{x:()=>l});var s=i(630502);const l=e=>{switch(e){case s.e.INITIALIZING:return"COMMON_INITIALIZING";case s.e.DISCONNECTED:return"COMMON_DISCONNECTED";case s.e.SEARCHING:return"COMMON_SEARCHING";case s.e.BOUND:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_BOUND";case s.e.STANDBY:return"COMMON_ENABLED";case s.e.POWER_DELIVERING:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_POWER_DELIVERING";case s.e.OUT_OF_POWER_BUDGET:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_OUT_OF_POWER_BUDGET";case s.e.POWER_OVERLOAD:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_POWER_OVERLOAD";case s.e.BLOCKED:return"COMMON_BLOCKED";default:return"COMMON_UNKNOWN"}}},732025(e,t,i){i.d(t,{A:()=>a});var s=i(274934),l=i(602086),r=i(376892),o=i(535322),n=i(560151);const a=(0,l.memo)(({mac:e,object:t})=>(0,s.jsx)(o.A,{type:o.I.ACCORDION,items:[{id:"systemPerformance",openByDefault:!1,label:(0,s.jsx)(r.A,{id:"DEVICE_PROPERTY_SYSTEM_STATISTICS"}),renderContent:()=>(0,s.jsx)(n.A,{mac:e,object:t})}]}))},713053(e,t,i){i.d(t,{Ay:()=>C,Jv:()=>I,RH:()=>T,cs:()=>E});var s=i(274934),l=i(602086),r=i(505817),o=i(179102),n=i(164714),a=i(882316),c=i(711950),d=i(98526),m=i(247816),x=i(263705),A=i(306212),p=i(309130),u=i(100978),_=i(470070),j=i(956978),O=i(291508);const E=(0,m.A)("div",(0,O.A)("noTopBorder"))`
  display: grid;
  grid-template-columns: repeat(3, minmax(min-content, 1fr));
  grid-gap: ${p.YC};
  margin-top: ${p.Ln};
  ${({noTopBorder:e,theme:{themeName:t}})=>e?"":`\n  padding-top: ${p.Ln};\n  border-top: ${r.Ay[`desktop-border-divider-${t}`]};\n  `}
`,h=(0,m.A)(u.A)`
  color: ${({theme:{motifPalette:{text02:e}}})=>e};

  > span {
    white-space: nowrap;
  }
`,T=(0,m.A)(A.A,(0,O.A)("background","borderColor"))`
  background-color: ${e=>e.background};
  border-radius: 1px;
  border: ${({borderColor:e})=>e&&`1px solid ${e}`};
`,I=({label:e,icon:t})=>(0,s.jsxs)(h,{alignItems:"center",gap:p.YC,children:[(0,s.jsx)(u.A,{width:16,justifyContent:"center",children:t}),(0,s.jsx)(o.A,{size:"small",color:"text-3",children:e})]}),C=(0,l.memo)(({activeItem:e,noTopBorder:t})=>{const i=(0,j.Tl7)(e),l=(0,j.kYz)(e),o=(0,j.aR8)(e),m=(0,j.FeX)(e),{themeName:A,motifPalette:{lime06:p}}=(0,x.u)();return(0,s.jsxs)(E,{noTopBorder:t,children:[(0,s.jsx)(I,{icon:(0,s.jsx)(T,{status:"positive"}),label:(0,s.jsx)(_.sA,{id:"COMMON_ENABLED"})}),(0,s.jsx)(I,{icon:(0,s.jsx)(T,{borderColor:r.Ay[`desktop-color-neutral-04-${A}`],background:"transparent"}),label:(0,s.jsx)(_.sA,{id:"COMMON_DISABLED"})}),i||l||o||m?(0,s.jsx)(I,{icon:(0,s.jsx)(T,{background:r.Ay[`desktop-color-neutral-07-${A}`]}),label:(0,s.jsx)(_.sA,{id:"COMMON_DISCONNECTED"})}):null,l?(0,s.jsx)(I,{icon:(0,s.jsx)(T,{background:r.Ay[`desktop-color-neutral-03-${A}`]}),label:(0,s.jsx)(_.sA,{id:"DEVICE_OUTLET_STATE_NO_STATUS"})}):null,i||l?(0,s.jsx)(I,{icon:(0,s.jsx)(T,{background:p}),label:(0,s.jsx)(_.sA,{id:"DEVICE_PORT_STATE_MBPS",values:{speed:"100/10"}})}):null,o||m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(I,{icon:(0,s.jsx)(a.A,{size:"small",color:r.Ay[`desktop-color-neutral-08-${A}`]}),label:(0,s.jsx)(_.sA,{id:"DEVICE_OUTLET_STATE_DELIVERING"})}),(0,s.jsx)(I,{icon:(0,s.jsx)(c.A,{size:"small",color:r.Ay[`desktop-color-orange-06-${A}`]}),label:(0,s.jsx)(_.sA,{id:"DEVICE_OUTLET_STATE_WARNING"})}),(0,s.jsx)(I,{icon:(0,s.jsx)(T,{status:"destructive"}),label:(0,s.jsx)(_.sA,{id:"DEVICE_OUTLET_STATE_ERROR"})})]}):null,m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(I,{icon:(0,s.jsx)(n.A,{size:"small",color:r.Ay[`desktop-color-neutral-08-${A}`]}),label:(0,s.jsx)(_.sA,{id:"DEVICE_OUTLET_STATE_HIGH_PRIORITY"})}),(0,s.jsx)(I,{icon:(0,s.jsx)(d.A,{size:"small",color:r.Ay[`desktop-color-neutral-08-${A}`]}),label:(0,s.jsx)(_.sA,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})})]}):null]})})},332522(e,t,i){i.d(t,{A:()=>f});var s=i(274934),l=i(602086),r=i(492399),o=i(247816),n=i(977872),a=i(669439),c=i(586566),d=i(309130),m=i(510906),x=i(682662);const A={xlarge:{threshold:10,size:"24px",spacing:d.kc,marginSize:d.YC,iconSize:"original"},large:{threshold:12,size:"18px",spacing:"10px",marginSize:"10px",iconSize:"original"},medium:{threshold:15,size:"18px",spacing:"10px",marginSize:"3px",iconSize:"medium"},xxsmall:{threshold:34,size:"8px",spacing:"2px",marginSize:"2px",iconSize:"small"}};var p=i(100978),u=i(708861),_=i(340820),j=i(188481),O=i(163727),E=i(197571),h=i(940229),T=i(873247),I=i(461731),C=i(225889),b=i(820510),g=i(470070);const v=({battpool:{device_total_power_output:e,device_output_current:t,device_output_voltage:i,device_total_power_factor:l},outletsFrom:r,outletsTo:o,outletsType:n})=>(0,s.jsxs)(b.m,{children:[(0,s.jsxs)(b.Y,{id:"DEVICE_PROPERTIES_AC_OUTLETS",children:[r,"-",o]}),(0,s.jsx)(b.Y,{id:"DEVICE_OUTLET_PROTECTION_TYPE",children:(0,s.jsx)(g.sA,{id:n===j.s.SURGE?"DEVICE_SURGE":"DEVICE_SURGE_AND_BATTERY"})}),e?(0,s.jsx)(b.Y,{id:"COMMON_POWER",children:(0,s.jsx)(g.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(e).toFixed(2)}})}):null,t?(0,s.jsx)(b.Y,{id:"COMMON_CURRENT",children:(0,s.jsx)(g.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(t).toFixed(2)}})}):null,i?(0,s.jsx)(b.Y,{id:"COMMON_VOLTAGE",children:(0,s.jsx)(g.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(i).toFixed(2)}})}):null,l?(0,s.jsx)(b.Y,{id:"DEVICE_HEADER_POWER_FACTOR",children:Number(l).toFixed(2)}):null]});var S=i(291508);const R=(0,o.A)(p.A,(0,S.A)("verticalGap"))`
  &:not(:first-child) {
    margin-top: ${({verticalGap:e})=>e};
  }
`,P=(0,o.A)("div",(0,S.A)("marginSize","cellSize"))`
  width: ${({cellSize:e})=>e};
  height: ${({cellSize:e})=>e};

  &:not(:first-child) {
    margin-left: ${({marginSize:e})=>e};
  }
`,N=({data:e,activeItem:t,size:i,iconSize:l,outletSize:r,marginSize:o,spacing:n,disableTooltip:a,disableOnPortClick:c,tooltipPlacement:d,showBatteryPowered:A,isEU:p,offline:u,networkPort:_})=>e.outletType===j.s.LAN&&_?(0,s.jsx)(m.A,{extendedPort:_,centerIcon:e.centerIcon,marginLeft:o,portSize:r,portSizeOverride:i,disableOnPortClick:Boolean(c),tooltipPlacement:d}):(0,s.jsx)(x.A,{activeItemMac:t.mac,cellData:e,marginSize:o,cellSize:i,iconSize:l,iconRotation:e.iconRotation,centerIcon:e.centerIcon,verticalGap:n,disableOnPortClick:c,isBatteryMode:t.vbms_table?.is_battery_mode,tooltipPlacement:d,disableTooltip:a,showBatteryPowered:A,isEU:p,offline:u}),M=({outletData:e,rowIndex:t,dataIndex:i,activeItem:l,size:r,marginSize:o,outletSize:n,iconSize:m,spacing:x,outlets:A,vertical:u,tooltipPlacement:_,isEU:E,offline:h})=>{const T=Array.isArray(A[e.outletType])?A[e.outletType].sort((e,t)=>e-t):[],I=e.outletType===j.s.SURGE&&l.vbms_table?.is_battery_mode,C=(0,c.sQ)(e,O.A.AUTO_RELAY)&&!I,b=_||(u?0===i?"left":"right":0===t?"top":"bottom");return(0,s.jsx)(a.A,{description:C?(0,s.jsx)(v,{battpool:l.vbms_table?.battpool||{},outletsFrom:T[0],outletsTo:T.at(-1),outletsType:e.outletType}):void 0,placement:b,offset:8,children:(0,s.jsx)(p.A,{flexDirection:u?"column":"row",alignItems:"flex-end",gap:d.YC,children:e.subOutlets?.map(a=>a?(0,s.jsx)(N,{data:e,activeItem:l,size:r,outletSize:n,iconSize:m,marginSize:e.marginLeft||o,spacing:x,disableTooltip:!0,disableOnPortClick:!0,showBatteryPowered:e.showBatteryPowered,tooltipPlacement:_,isEU:E,offline:h},`SubOutlet-${t+1}-${i+1}-${a}`):(0,s.jsx)(P,{cellSize:r,marginSize:o},`OutletSpacer-${t+1}-${i+1}-${a}`))})})},f=(0,l.memo)(({activeItem:e,disableOnPortClick:t,sizeOverride:i,tooltipPlacement:o,isEU:a=!1,offline:c})=>{const{outletsDiagram:d=[],primaryOutletGroupCount:m=0,outlets:x={}}=(0,_.j)(e.model),p=d.length?(0,u.FP)(d,e.model):(0,u.ST)(m,e.model),j=(0,r.A)(p.map(e=>e.length))||0,O=(i?A[i]:Object.values(A).find(e=>j<=e.threshold))||A.small,{size:b,spacing:g,iconSize:v=0,marginSize:S}=O,f=(0,n.d4)(T.wD),z=(0,n.d4)(E.wf),D=(0,n.d4)(I.G),y=(0,l.useMemo)(()=>(0,h.Vi)(e,f,[],[],z,!1,D,void 0),[e,f,z,D]);return(p||[]).length?(0,s.jsx)(s.Fragment,{children:p.map((i,l)=>(0,s.jsx)(R,{"align-items":"flex-end",verticalGap:g,children:i.map((i,r)=>{if(!i)return(0,s.jsx)(P,{cellSize:b,marginSize:S},`OutletSpacer-${l+1}-${r+1}-spacer`);const n={...i,...(0,u.o3)(e,void 0,i.outletNumber)||{}},d=y.find(e=>e.port_idx===n.portIdx);return n.subOutlets&&n.subOutlets.length>1?(0,s.jsx)(M,{outletData:n,rowIndex:l,dataIndex:r,activeItem:e,size:b,marginSize:n.marginLeft||S,outletSize:O,iconSize:v,spacing:g,outlets:x,vertical:n.vertical,isEU:a,offline:c},`MultiCell-${l+1}-${r+1}`):(0,s.jsx)(N,{data:n,activeItem:e,size:b,outletSize:O,iconSize:v,marginSize:n.marginLeft||S,spacing:g,tooltipPlacement:o,disableOnPortClick:t||n.nonClickable,isEU:a,showBatteryPowered:n.showBatteryPowered,offline:c,networkPort:d},`SingleCell-${l+1}-${r+1}`)})},`OutletLayoutRow-${l+1}`))}):(0,s.jsx)(C.A,{})},({activeItem:e,isEU:t,offline:i},{activeItem:s,isEU:l,offline:r})=>e.model===s.model&&e.outlet_table===s.outlet_table&&e.outlet_overrides===s.outlet_overrides&&t===l&&i===r)},503160(e,t,i){i.d(t,{A:()=>M});var s=i(274934),l=i(602086),r=i(977872),o=i(548941),n=i(179102),a=i(775250),c=i(247816),d=i(673730),m=i(347625),x=i(590979),A=i(254585),p=i(449339),u=i(309130),_=i(589650),j=i(223104),O=i(100978),E=i(205521),h=i(470070),T=i(708861),I=i(630502),C=i(754924),b=i(373578),g=i(25511),v=i(291508);const S=(0,c.A)(o.A,(0,v.A)("color","isTableItem"))`
  width: ${({isTableItem:e})=>e?"20px":"90px"};
  height: ${({isTableItem:e})=>e?"20px":"18px"};
  align-items: center;
  background-color: ${({color:e,theme:{motifPalette:t}})=>t[e]};
  border-radius: 2px;
  color: #fff;
  justify-content: center;
  display: flex;
  position: relative;
  ${({isTableItem:e})=>e&&"margin-right: 8px;"}

  border: ${({theme:{motifPalette:e},borderColor:t})=>t?`1px solid ${e[t]}`:"none"};

  &:not(:first-child) {
    margin-left: ${u.YC};
  }
`,R=(0,c.A)("div")`
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    max-width: 70%;
    max-height: 70%;
  }
`,P=(0,c.A)("div")`
  width: initial;
  position: relative;
  height: 100%;

  > div {
    position: initial;
    width: 18px;
  }
`,N=(0,c.A)(n.A)`
  max-width: 140px;
`,M=({activeItemMac:e,cellData:t,isTableItem:i=!1,multiIcon:o,disableOnPortClick:c})=>{const v=(0,r.wA)(),M=(0,r.d4)(A.oI),f=(0,r.d4)(C.ID).find(e=>e.mac===t.peer?.mac),z=(0,m.Q)(f),D=(0,m.Lm)(f?.model)||t.peer?.model,y=(0,T.Yf)(t),w=(0,T.Yk)(t),L=(0,T.AD)(t),$=(0,T.y$)(t),k=(0,l.useCallback)(i=>{i?.preventDefault?.(),i?.stopPropagation?.(),c||v((0,E.XP)({type:p.H.DEVICE,id:e,tab:M,subPanel:_.uY.RPS_OUTLETS,subId:String(t.port_idx)}))},[v,M,e,t.port_idx,c]);return(0,s.jsx)(S,{color:L,borderColor:$,onClick:k,width:f?240:200,isTableItem:i,...x.A.addDataTestId(x.A.TestId.SIDE_PANEL_TRIGGER),description:(0,s.jsxs)(O.A,{flexDirection:"column",justifyContent:"space-between",width:"100%",children:[t?.port_state===I.e.OUT_OF_POWER_BUDGET?(0,s.jsx)(O.A,{marginBottom:u.kc,children:(0,s.jsx)(n.A,{size:"small",weight:"bold",children:(0,s.jsx)(h.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_OUT_OF_POWER_BUDGET_DESCRIPTION",values:{peer:z||(0,s.jsx)(h.sA,{id:"COMMON_DEVICE"})}})})}):null,(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_PORT"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:t.port_idx})]}),(0,s.jsxs)(O.A,{justifyContent:"space-between",alignItems:"center",gap:u.YC,children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_NAME"})}),(0,s.jsx)(a.A,{size:"small",color:"text-2",isTruncated:!0,children:t?.name})]}),t?.port_mode?(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_MODE"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,d.Z)(t.port_mode)})]}):null,t?.port_state?(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_STATE"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:(0,g.x)(t.port_state)})})]}):null,t?.up?b.A.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)(O.A,{justifyContent:"space-between",children:(0,s.jsx)(n.A,{size:"small",color:"text-2",weight:"bold",children:(0,s.jsx)(h.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:e}})})}),(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_CURRENT"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:t[`power_${e}v_current`]}})})]}),(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_VOLTAGE"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:t[`power_${e}v_voltage`]}})})]}),(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_POWER"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t[`power_${e}v_power`]}})})]})]},e)):null,t.peer||f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(O.A,{justifyContent:"space-between",children:(0,s.jsx)(n.A,{size:"small",color:"text-2",weight:"bold",children:(0,s.jsx)(h.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER"})})}),z||t.peer?.hostname?(0,s.jsxs)(O.A,{justifyContent:"space-between",gap:u.YC,children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_NAME"})}),(0,s.jsx)(N,{size:"small",color:"text-2",isTruncated:!0,children:z||t.peer?.hostname})]}):null,t.peer.mac?(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_MAC"})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:t.peer.mac})]}):null,D?(0,s.jsxs)(O.A,{justifyContent:"space-between",gap:u.YC,children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_MODEL"})}),(0,s.jsx)(N,{size:"small",color:"text-2",isTruncated:!0,children:D})]}):null,b.A.map(e=>(0,s.jsxs)(O.A,{justifyContent:"space-between",children:[(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER_POWER_REQUIRED",values:{voltage:e}})}),(0,s.jsx)(n.A,{size:"small",color:"text-2",children:(0,s.jsx)(h.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t.peer?.[`power_required_${e}v`]}})})]},e))]}):null]}),portal:!0,children:o?(0,s.jsx)(s.Fragment,{children:w.map(e=>(0,s.jsx)(P,{children:(0,s.jsx)(j.A,{icon:e,smallerIcons:!0})},e))}):(0,s.jsx)(R,{children:t.port_mode!==I.c.DISABLED?(0,s.jsx)(j.A,{icon:y,smallerIcons:!0}):null})})}},21573(e,t,i){i.d(t,{A:()=>A});var s=i(274934),l=i(247816),r=i(309130),o=i(100978),n=i(708861),a=i(340820),c=i(225889),d=i(503160);const m=(0,l.A)(o.A)`
  &:not(:first-child) {
    margin-top: ${r.YC};
  }
`,x=(0,l.A)("div")`
  width: 5px;
`,A=({activeItem:e,activeItem:{model:t,mac:i},multiIcon:l,disableOnPortClick:r})=>{const{rps:{diagram:o,primaryPortGroupCount:A}}=(0,a.j)(t),p=o.length?(0,n.FP)(o,e.model):(0,n.ST)(A,e.model);return p&&0!==p.length?(0,s.jsx)(s.Fragment,{children:p.map((t,o)=>(0,s.jsx)(m,{justifyContent:"center",width:"100%",children:t.map((t,a)=>t?(0,s.jsx)(d.A,{activeItemMac:i,cellData:(0,n.Z4)(e,t.outletNumber),multiIcon:l,disableOnPortClick:r},`RpsOutlet-${o+1}-${a+1}`):(0,s.jsx)(x,{},`RpsOutletSpacer-${o+1}-${a+1}`))},`RpsOutletLayoutRow-${o+1}`))}):(0,s.jsx)(c.A,{})}},261724(e,t,i){i.r(t),i.d(t,{default:()=>X});var s=i(274934),l=i(532565),r=i(535322),o=i(412160),n=i(100978),a=i(309130),c=i(732025),d=i(376892),m=i(470070),x=i(602086),A=i(179102),p=i(247816),u=i(505817),_=i(708861),j=i(630502),O=i(156007),E=i(503160),h=i(25511),T=i(418398),I=i(977872),C=i(843871),b=i(548941),g=i(34167),v=i(247368),S=i(83985),R=i(159469),P=i(950804),N=i(748094),M=i(120197),f=i(648576),z=i(205521),D=i(795206);const y=(0,C.bk)({enableReinitialize:!0,mapPropsToValues:({outletInfo:{name:e,port_mode:t}})=>({name:e||"",portModeAuto:t===j.c.AUTO}),validationSchema:P.A.object().shape({name:P.A.string().label("COMMON_NAME").max(32),portModeAuto:P.A.boolean()}),handleSubmit:({portModeAuto:e,...t},{props:{outletInfo:i,updateDeviceWithIdEndpoint:s,activeItem:{rps_override:l,mac:r,_id:o},onSubmitSuccess:n}})=>{s({rps_override:{...l,rps_port_table:[{port_idx:i.port_idx,port_mode:e?j.c.AUTO:j.c.DISABLED,...t},...(l?.rps_port_table||[]).filter(e=>e.port_idx!==i.port_idx)||[]]}},o,r,{failureToast:{icon:R.C.danger,message:"DEVICE_OUTLET_FORM_SAVE_ERROR"},mergeAndOverrideKeys:["rps_override"],extend:!0}).then(()=>{n?.()})}}),w=(0,T.Zz)((0,I.Ng)((e,{activeItem:t,subId:i})=>({outletInfo:(0,_.Z4)(t,i?+i:void 0)}),{updateDeviceWithIdEndpoint:D.ex,showPropertyPanel:z.XP}),y)(({activeItem:e,dirty:t,submitForm:i,outletInfo:l,onFormCancel:o})=>{const c=(0,I.wA)();return(0,s.jsxs)(r.A,{padding:"0",marginBottom:"0",children:[(0,s.jsx)(n.A,{marginBottom:a.Ln,children:(0,s.jsx)(M.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME"})}),(0,s.jsxs)(n.A,{marginBottom:a.Ln,alignItems:"center",children:[(0,s.jsx)(M.A,{type:"realCheckbox",name:"portModeAuto",children:(0,s.jsx)(m.sA,{id:"COMMON_OUTLET_POWER"})}),(0,s.jsx)(b.A,{style:{marginLeft:a.YC},width:208,description:(0,s.jsx)(m.sA,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"}),children:(0,s.jsx)(v.A,{isActive:!0,size:"original"})})]}),(0,s.jsxs)(N.A,{variant:"info",nested:!0,padding:a.kc,margin:"0",children:[(0,s.jsxs)(A.A,{weight:"bold",children:[(0,s.jsx)(m.sA,{id:"DEVICE_PROPERTIES_RPS_PORT_RECOVERY"}),". "]}),(0,s.jsx)(m.sA,{id:"DEVICE_PROPERTIES_RPS_PORT_RECOVERY_DESCRIPTION"})]}),(0,s.jsx)(n.A,{marginTop:a.Ln,marginBottom:a.Ln,justifyContent:"space-between",alignItems:"center",children:(0,s.jsx)(f.Ay,{variant:"link",disabled:!l.port_error_disabled,onClick:()=>c((0,D.C4)(e,l)),Icon:(0,s.jsx)(g.A,{}),children:(0,s.jsx)(m.sA,{id:"DEVICE_ACTIONS_PORT_RECOVERY"})})}),(0,s.jsxs)(n.A,{alignItems:"flex-start",gap:a.kc,children:[(0,s.jsx)(S.A,{variant:"emphasis",onPress:i,size:"small",isDisabled:!t,children:(0,s.jsx)(m.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})}),(0,s.jsx)(S.A,{variant:"neutral",onPress:o,size:"small",children:(0,s.jsx)(m.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})}),L=(0,p.A)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,$=(0,p.A)("div")`
  display: grid;
  width: 100%;
  grid-template-columns: 52px 1fr 110px; // status, name, state
  gap: ${a.kc};
  text-align: left;
  padding: ${a.YC};
  border-bottom: ${({theme:{themeName:e}})=>u.Ay[`desktop-border-divider-${e}`]};
  &.active {
    background-color: ${({theme:{themeName:e}})=>u.Ay[`desktop-color-ublue-01-${e}`]};
  }
  &:not(:first-child) {
    cursor: pointer;
    &:hover {
      background-color: ${({theme:{themeName:e}})=>u.Ay[`desktop-color-neutral-01-${e}`]};
    }
  }
`,k=(0,p.A)(n.A)`
  overflow: hidden;
  align-items: center;
`,U=(0,p.A)("div")`
  margin-top: ${a.kc};
  margin-bottom: ${a.kc};
  border-radius: 8px;
  border: ${({theme:{themeName:e}})=>u.Ay[`desktop-border-divider-${e}`]};
  padding: ${a.Ln};
`,V=({activeItem:e})=>{const t=e.rps?.rps_port_table?.map(({port_idx:t})=>({id:t,...(0,_.Z4)(e,t)})),[i,l]=(0,x.useState)(void 0),r=(0,x.useRef)(new Map),o=(0,x.useCallback)(e=>{if(e===i)return void l(void 0);l(e);const t=r.current.get(e);t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"center"})},10)},[i]);return t?.length?(0,s.jsxs)(L,{children:[(0,s.jsxs)($,{children:[(0,s.jsx)(n.A,{}),(0,s.jsx)(k,{children:(0,s.jsx)(A.A,{color:"inherit",variant:"body-primary",weight:"bold",children:(0,s.jsx)(m.sA,{id:"COMMON_NAME"})})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(A.A,{color:"inherit",variant:"body-primary",weight:"bold",children:(0,s.jsx)(m.sA,{id:"COMMON_STATUS"})})})]}),t?.map(t=>{let a;return t.port_mode===j.c.DISABLED&&(a="COMMON_DISABLED"),t.port_state&&(a=(0,h.x)(t.port_state)),(0,s.jsxs)(x.Fragment,{children:[(0,s.jsxs)($,{ref:e=>{e?r.current.set(t.port_idx,e):r.current.delete(t.port_idx)},onClick:()=>o(t.port_idx),className:i===t.port_idx?"active":"",children:[(0,s.jsxs)(n.A,{children:[(0,s.jsx)(E.A,{activeItemMac:e.mac,cellData:t,isTableItem:!0}),(0,s.jsx)(A.A,{size:"medium",children:t.port_idx})]}),(0,s.jsx)(k,{children:(0,s.jsx)(O.A,{size:"medium",children:t.name})}),(0,s.jsx)(n.A,{children:(0,s.jsxs)(O.A,{size:"medium",children:[(0,s.jsx)(m.sA,{id:a||"COMMON_INITIALIZING"}),a?null:"..."]})})]}),i===t.port_idx?(0,s.jsx)(U,{children:(0,s.jsx)(w,{activeItem:e,subId:String(t.port_idx),onFormCancel:()=>l(void 0),onSubmitSuccess:()=>l(void 0)})}):null]},t.port_idx)})]}):null};var B=i(392184);const Y=({activeItem:e})=>{const{formatMessage:t}=(0,m.tz)();return(0,s.jsx)(r.A,{type:r.I.ACCORDION,items:[{id:"ports",label:(0,s.jsx)(d.A,{id:"COMMON_PORTS"}),openByDefault:!0,renderContent:()=>(0,s.jsxs)(n.A,{gap:a.Ln,flexDirection:"column",children:[(0,s.jsx)(V,{activeItem:e}),(0,s.jsx)(B.A,{hidePorts:!0,activeItem:e,overrideNameHeader:t({id:"COMMON_OUTLETS"})})]})}]})};var G=i(713053),F=i(21573),W=i(320018),H=i(113592),Z=i(332522),K=i(251323);const X=({activeItem:e,activeItem:{mac:t,model:i,port_table:d}})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.A,{children:(0,s.jsxs)(n.A,{flexDirection:"column",children:[(0,s.jsxs)(n.A,{justifyContent:"center",gap:a.Er,children:[(0,s.jsx)(n.A,{flexDirection:"column",alignItems:"center",children:(0,s.jsx)(F.A,{activeItem:e,multiIcon:!0,disableOnPortClick:!0})}),(0,s.jsxs)(n.A,{justifyContent:"center",gap:a.YC,alignItems:"flex-end",children:[(0,s.jsx)(Z.A,{activeItem:e,disableOnPortClick:!0,sizeOverride:"large",tooltipPlacement:"bottom end"}),d?(0,s.jsx)(K.A,{activeItem:e,portSizeOverride:"18px",disableOnPortClick:!0}):null]})]}),(0,s.jsx)(G.Ay,{activeItem:e})]})}),(0,s.jsx)(Y,{activeItem:e}),(0,s.jsx)(W.A,{mac:t,model:i,logType:H.F.DEVICE,ignoreActionableValues:[o.dl.DEVICE],label:"COMMON_HISTORY",hideClientTabs:!0}),(0,s.jsx)(c.A,{mac:t,object:l.qv.SW})]})}}]);