"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[23789],{953394(e,t,n){var r;n.d(t,{s:()=>r}),function(e){e.STANDARD="standard",e.USB="usb",e.LAN="lan",e.WAN="wan",e.RJ45="rj45",e.SURGE="surge"}(r||(r={}))},264752(e,t,n){n.d(t,{A:()=>A});var r=n(296540),i=n(217439),l=n(71479),a=n(566723),o=n(766624),c=n(294303);const s=(0,l.A)(i.A)`
  white-space: nowrap;
`,E=(0,l.A)(c.A)`
  align-items: center;
`,m=(0,l.A)(c.A)`
  width: ${a.Ln};
  justify-content: flex-start;
`,A=({indicator:e,description:t,isSingleLine:n,tooltipDescription:i})=>r.createElement(E,{marginRight:n?a.kc:0},r.createElement(m,null,e),r.createElement(s,{size:"small",color:"text-3"},t),i?r.createElement(o.A,{description:i}):null)},226712(e,t,n){n.d(t,{A:()=>M,T:()=>D});var r=n(296540),i=n(469733),l=n(822336),a=n(934846),o=n(95918),c=n(455806),s=n(383704),E=n(363334),m=n(794993),A=n(71479),d=n(382389),u=n(506327),p=n(903216),O=n(566723),_=n(294303),C=n(916537),h=n(966784),T=n(962669),S=n(578819),b=n(780811),P=n(532419),I=n(376272),y=n(60687),f=n(311785),g=n(264752);const N=(0,A.A)("div")`
  display: grid;
  grid-template-columns: repeat(3, minmax(min-content, 1fr));
  gap: ${O.YC};
  margin-top: ${O.kc};
`,v=(0,A.A)(_.A)`
  gap: ${O.kc};
  row-gap: ${O.YC};
  flex-wrap: wrap;
`,D=(0,A.A)(u.A,(0,f.A)("borderColor"))`
  flex-shrink: 0;
  border-radius: 0;
  border: ${({borderColor:e,theme:{themeName:t}})=>e&&`1px solid ${(0,h.oX)(e,t)}`};
`,R=(e,t)=>e===y.s.PASSTHROUGH?1:e===y.s.PASSIVE?2:e===y.s.POE?3:e===y.s.POE_PLUS?4:e===y.s.POE_PLUS_PLUS?5:6,M=({deviceMac:e,isSingleLine:t=!1,hidePoe:n=!1,hideDisabled:A=!1,hideDisconnected:u=!1,displayedSpeedList:O})=>{const{themeName:_}=(0,d.u)(),f=(0,i.useSelector)((0,r.useMemo)(()=>(0,P.tG)(e),[e])),{type:M,model:k}=f;return(0,r.useMemo)(()=>{const e=(0,T.MB)(f),i=(0,b.NuO)(f),d=(0,S._L)(f,i),P=A||(0,b.m_j)(f)||(0,b.Syn)(f)||(0,b.Fp0)(f),k=t?v:N,w=Array.from(d).sort(R).map(e=>{switch(!0){case e===y.s.POE_PLUS_PLUS_PLUS:return r.createElement(g.A,{key:e,description:r.createElement(C.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS_PLUS"}),indicator:r.createElement(a.A,{color:l.Ay[`desktop-color-neutral-08-${_}`]})});case e===y.s.POE_PLUS_PLUS:return r.createElement(g.A,{key:e,description:r.createElement(C.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}),indicator:r.createElement(o.A,{color:l.Ay[`desktop-color-neutral-08-${_}`]})});case e===y.s.POE_PLUS:return r.createElement(g.A,{key:e,description:r.createElement(C.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS"}),indicator:r.createElement(c.A,{color:l.Ay[`desktop-color-neutral-08-${_}`]})});case e===y.s.PASSTHROUGH||e===y.s.PASSIVE||e===y.s.POE:return r.createElement(g.A,{key:e,description:r.createElement(C.sA,{id:e===y.s.PASSIVE?"COMMON_DEVICE_POE_MODE_PASSIVE":"COMMON_DEVICE_POE_MODE_POE"}),indicator:r.createElement(s.A,{color:l.Ay[`desktop-color-neutral-08-${_}`]})});default:return null}});return r.createElement(k,null,e.filter(e=>!O||O.includes(e)).sort((e,t)=>e-t).map(e=>r.createElement(g.A,{key:e,description:(0,p.ir)(e),indicator:r.createElement(D,{color:(0,h.oX)((I.A[e]??I.A.DEFAULT).background,_)})})),u?null:r.createElement(g.A,{key:"disconnected",description:r.createElement(C.sA,{id:"COMMON_DISCONNECTED"}),indicator:r.createElement(D,{color:(0,h.oX)(I.A.DEFAULT.background,_)})}),P?null:r.createElement(g.A,{key:"disabled",description:r.createElement(C.sA,{id:"COMMON_DISABLED"}),indicator:r.createElement(D,{color:"transparent",borderColor:I.A.DEFAULT.background}),isSingleLine:t}),n?null:w,!(0,b.Tbi)({type:M})||(0,b.Syn)(f)||(0,b.Fp0)(f)?null:r.createElement(r.Fragment,null,r.createElement(g.A,{key:"aggregating",description:r.createElement(C.sA,{id:"COMMON_AGGREGATING"}),indicator:r.createElement(m.A,{color:l.Ay[`desktop-color-neutral-08-${_}`]})}),r.createElement(g.A,{key:"mirror",indicator:r.createElement(E.A,null),description:r.createElement(C.sA,{id:"DEVICE_PORT_STATE_MIRROR"}),tooltipDescription:r.createElement(C.sA,{id:"DEVICE_PORT_STATE_MIRROR_TOOLTIP"})})))},[k,n,A,O,_])}},369702(e,t,n){n.d(t,{A:()=>l});var r=n(296540),i=n(74750);const l=({children:e,...t})=>r.createElement(i.A,{variant:"secondary-emphasis",...t},e)},137625(e,t,n){n.d(t,{A:()=>s});var r=n(296540),i=n(353899),l=n(132196),a=n(372737),o=n(566723),c=n(916537);const s=({children:e=null,title:t,titleValues:n,message:s,messageValues:E,handleConfirm:m=()=>null,handleClose:A=()=>null,handleCancel:d,isOpen:u,buttonVariant:p="primary",cancelButtonVariant:O="tertiary",cancelButtonMessage:_="COMMON_ACTION_CANCEL",buttonMessage:C="COMMON_ACTION_CONFIRM",buttonDisabled:h=!1,position:T="top",offset:S,showHeaderClose:b=!1,contentClassName:P="",body:I,titleBody:y,className:f,rootClose:g=!1,footerActions:N})=>{const v=(0,r.useCallback)(e=>{u&&(e.stopPropagation(),e.key===a.U.ENTER?m():e.key===a.U.ESCAPE&&A(!1))},[u,m,A]);(0,r.useEffect)(()=>(window.addEventListener("keydown",v,!0),()=>{window.removeEventListener("keydown",v,!0)}),[v]);const D=(0,r.useCallback)(()=>{A(!1),d?.()},[A,d]),R=(0,r.useCallback)(()=>{A(!1),m()},[A,m]),M=(0,r.useMemo)(()=>[{text:r.createElement(c.sA,{id:_}),variant:O,onClick:D},{text:r.createElement(c.sA,{id:C}),disabled:h,variant:p,onClick:R}],[C,p,_,O,D,R,h]),k=(0,r.useCallback)(()=>{A(!1)},[A]),w=l.AH`
    ${t?"":`margin-top: ${o.xO}`}
  `;return r.createElement(i.A,{title:t?r.createElement(c.sA,{id:t,values:n}):y||null,...s?{body:r.createElement(r.Fragment,null,r.createElement(c.sA,{id:s,values:E}),I)}:{body:I},position:T,portal:!0,offset:S,actions:N||M,showHeaderClose:b,contentClassName:l.AH`
        ${w}
        ${P}
      `,onRequestClose:k,isOpen:u,allowOverflow:!0,rootClose:g,className:f},e)}},540446(e,t,n){n.d(t,{A:()=>o});var r=n(296540),i=n(86571),l=n(689965),a=n(346241);const o=(0,r.memo)(({mac:e,object:t})=>r.createElement(l.A,{type:l.I.ACCORDION,items:[{id:"systemPerformance",openByDefault:!1,label:r.createElement(i.A,{id:"DEVICE_PROPERTY_SYSTEM_STATISTICS"}),renderContent:()=>r.createElement(a.A,{mac:e,object:t})}]}))},405639(e,t,n){n.d(t,{A:()=>M});var r=n(296540),i=n(822336),l=n(469733),a=n(405442),o=n(217439),c=n(705145),s=n(668393),E=n(321971),m=n(970847),A=n(699948),d=n(297454),u=n(325882),p=n(808326),O=n(71479),_=n(180524),C=n(968906),h=n(960407),T=n(311785),S=n(860631),b=n(398300),P=n(566723),I=n(855019),y=n(294303),f=n(845030),g=n(916537),N=n(953394),v=n(825032);const D=(0,O.A)("div",(0,T.A)("cellSize","isEnabled","outletType","marginSize","verticalGap","centerIcon"))`
  width: ${({cellSize:e})=>e||"20px"};
  height: ${({cellSize:e})=>e||"20px"};
  align-items: center;
  border-radius: 2px;
  color: ${({theme:{themeName:e}})=>e===v.S.DARK?"#000":"#fff"};
  justify-content: center;
  display: flex;
  position: relative;

  ${({centerIcon:e,verticalGap:t})=>e&&t&&`transform: translateY(calc(50% + ${t} / 2))`};

  &:not(:first-child) {
    margin-left: ${({marginSize:e})=>e||"10px"};
  }

  div:last-child {
    right: -15px;
  }

  ${({outletType:e,isEnabled:t,theme:{themeName:n,motifPalette:{uBlue01:r}}})=>{switch(e){case N.s.RJ45:return`\n          background-color: ${r};\n          border: 1px solid ${i.Ay[`desktop-color-ublue-03-${n}`]};\n        `;case N.s.WAN:return`\n          background-color: ${i.Ay[`desktop-color-neutral-03-${n}`]};\n        `;default:return`\n          background-color: ${t?i.Ay[`desktop-color-green-06-${n}`]:i.Ay[`desktop-color-neutral-05-${n}`]};\n        `}}}
`,R=(0,O.A)("div",(0,T.A)("iconRotation"))`
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    ${({iconRotation:e})=>e?`transform: rotate(${e});`:""}
    max-width: 100%;
    max-height: 100%;
  }
`,M=({activeItemMac:e,cellData:t,marginSize:n,cellSize:i,verticalGap:O,iconRotation:T,centerIcon:v,showBatteryPowered:M,tooltipPlacement:k,disableOnPortClick:w,iconSize:L,isBatteryMode:U,tooltipOverride:x,disableTooltip:$,isEU:z,offline:V})=>{const j=(0,l.useDispatch)(),G=(0,l.useSelector)(h.oI),B=(0,S.TT)(t,"POWER_METER"),{outletType:F=N.s.STANDARD,index:W,name:H,outlet_power:Y,outlet_current:q,outlet_voltage:X,outlet_power_factor:J,cycle_enabled:K,relay_state:Q,surgeType:Z}=t,ee=[N.s.STANDARD,N.s.USB].includes(F),te=(0,r.useMemo)(()=>{if(!$)return x||(F===N.s.RJ45?Z?r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:Z===a.ME.IN?"DEVICE_SURGE_IN":"DEVICE_SURGE_OUT"})):null:F===N.s.WAN?r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"DEVICE_PROPERTIES_OUTLET_TOOLTIP_WAN_NO_STATUS_INFO"})):B&&F===N.s.STANDARD?r.createElement(y.A,{flexDirection:"column",justifyContent:"space-between",minWidth:180},r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_AC_OUTLET"})),r.createElement(o.A,{size:"inherit",color:"inherit"},W)),r.createElement(y.A,{justifyContent:"space-between",alignItems:"center",gap:P.kc},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_NAME"})),r.createElement(c.A,{size:"inherit",color:"inherit",isTruncated:!0},H)),r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_POWER"})),r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(Y||0).toFixed(2)}}))),r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_CURRENT"})),r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(q||0).toFixed(2)}}))),r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_VOLTAGE"})),r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(X||0).toFixed(2)}}))),r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_POWER_FACTOR"})),r.createElement(o.A,{size:"inherit",color:"inherit"},Number(J||0).toFixed(2)))):r.createElement(y.A,{flexDirection:"column",justifyContent:"space-between",minWidth:180},r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_OUTLET"})),r.createElement(o.A,{size:"inherit",color:"inherit"},W)),r.createElement(y.A,{justifyContent:"space-between",alignItems:"center",gap:P.kc},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"COMMON_NAME"})),r.createElement(c.A,{size:"inherit",color:"inherit",isTruncated:!0},H)),r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE_ENABLED"})),r.createElement(K?d.A:A.A,null)),r.createElement(y.A,{justifyContent:"space-between"},r.createElement(o.A,{size:"inherit",color:"inherit"},r.createElement(g.sA,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE"})),r.createElement(Q?d.A:A.A,null))))},[$,x,F,B,W,H,Y,q,X,J,K,Q,Z]),ne=(0,r.useMemo)(()=>{const e=z?u.A:E.A;switch(F){case N.s.STANDARD:return r.createElement(M?p.A:e,{size:L});case N.s.SURGE:return r.createElement(e,{size:L});case N.s.USB:return r.createElement(s.A,{size:L});case N.s.LAN:return null;case N.s.WAN:return r.createElement(m.A,{size:L});default:return null}},[z,F,M,L]),re=(0,r.useCallback)(t=>{t?.preventDefault?.(),t?.stopPropagation?.(),w||ee&&j((0,f.XP)({type:b.H.DEVICE,id:e,tab:G,subId:String(W),subPanel:I.uY.OUTLETS}))},[j,G,e,ee,W,w]),ie=M&&F===N.s.STANDARD;return r.createElement(_.A,{description:te,placement:k},r.createElement(D,{isEnabled:!(!Q||F===N.s.SURGE&&U||V),outletType:F||N.s.STANDARD,marginSize:n,cellSize:i,verticalGap:O,centerIcon:v,onClick:re,...C.A.addDataTestId(C.A.TestId.SIDE_PANEL_TRIGGER)},r.createElement(R,{iconRotation:ie?void 0:T},ne)))}},949810(e,t,n){n.d(t,{A:()=>b});var r=n(296540),i=n(217439),l=n(822336),a=n(823858),o=n(618983),c=n(71479),s=n(566723),E=n(294303),m=n(916537),A=n(170163),d=n(780811),u=n(837612),p=n(799552),O=n(377588),_=n(406816);const C=(0,c.A)("div")`
  display: flex;
  flex-direction: column;
`,h=(0,c.A)("div")`
  margin-top: ${s.Ln};
  padding-top: ${s.Ln};
  border-top: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};

  div:first-child {
    margin-bottom: ${s.xO};
  }
`,T=(0,c.A)(a.A)`
  color: ${({theme:{themeName:e}})=>l.Ay[`desktop-color-orange-06-${e}`]};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,S=(0,c.A)(o.A)`
  color: ${({theme:{themeName:e}})=>l.Ay[`desktop-color-green-06-${e}`]};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,b=({activeItem:e,activeItem:{outlet_table:t,outlet_ac_power_budget:n,outlet_ac_power_consumption:l,port_table:a},hidePorts:o,noDivider:c,gap:b=s.xO,legend:P,verticalLegend:I,tooltipPlacement:y="bottom end"})=>{const{usedPower:f,maxPower:g}=(0,r.useMemo)(()=>(0,A.hf)({outlet_table:t,outlet_ac_power_budget:n,outlet_ac_power_consumption:l}),[t,n,l]),N=(0,d.Tl7)(e)||(0,d.kYz)(e);return r.createElement(C,null,r.createElement(E.A,{justifyContent:"center",gap:b,alignItems:I?"center":void 0},r.createElement(E.A,{flexDirection:"column"},r.createElement(O.A,{disableOnPortClick:!0,activeItem:e,tooltipPlacement:y,isEU:(0,d.goQ)(e),offline:(0,d.aK8)((0,u.S9)(e))})),a&&!o?r.createElement("div",null,r.createElement(p.A,{activeItem:e,portSizeOverride:"19px",disableOnPortClick:N})):null,I),I?null:P||r.createElement(_.Ay,{activeItem:e,noTopBorder:c}),f>g?r.createElement(h,null,r.createElement(E.A,{justifyContent:"space-between"},r.createElement(T,null),r.createElement(i.A,{size:"small"},r.createElement(m.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_WARNING"}))),r.createElement(E.A,{justifyContent:"space-between"},r.createElement(S,null),r.createElement(i.A,{size:"small"},r.createElement(m.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_INFO"})))):null)}},683086(e,t,n){n.d(t,{A:()=>o});var r=n(296540),i=n(369702),l=n(916537),a=n(216211);const o=({mac:e})=>{const{handleGoToPortsPage:t}=(0,a.e)(),n=(0,r.useCallback)(()=>{t(e)},[t,e]);return r.createElement(i.A,{onClick:n,width:"full"},r.createElement(l.sA,{id:"COMMON_PORT_MANAGER"}))}},218234(e,t,n){n.d(t,{A:()=>d});var r=n(296540),i=n(71479),l=n(566723),a=n(294303),o=n(689965),c=n(226712),s=n(799552),E=n(683086);const m=(0,i.A)(a.A)`
  > div {
    width: 100%;
  }
`,A=({activeItem:e,activeItem:{port_table:t,mac:n},showFullScreenDiagramButton:i,disableOnPortClick:o,isStacking:m,multipleDisplayedDevicesData:A})=>{const d=0!==(t||[]).length;return r.createElement(r.Fragment,null,d?r.createElement(a.A,{position:"relative",flexDirection:"column"},r.createElement(a.A,{flexDirection:"column",justifyContent:"center"},m?(A||[]).map(e=>r.createElement(s.A,{activeItem:e,disableOnPortClick:i||o,isStacking:!0})):r.createElement(s.A,{activeItem:e,disableOnPortClick:i||o})),r.createElement(c.A,{deviceMac:n})):null,i&&d?r.createElement(a.A,{paddingTop:l.Ln,justifyContent:"center"},r.createElement(E.A,{mac:n})):null)},d=({useBubbleWrapper:e=!0,...t})=>e?r.createElement(m,null,r.createElement(o.A,{flex:"unset"},r.createElement(A,{...t}))):r.createElement(A,{...t})},804947(e,t,n){n.r(t),n.d(t,{default:()=>d});var r=n(296540),i=n(86571),l=n(689965),a=n(87250),o=n(275357),c=n(218234),s=n(949810),E=n(540739),m=n(13739),A=n(540446);const d=({activeItem:e,activeItem:{mac:t,model:n}})=>r.createElement(r.Fragment,null,r.createElement(l.A,{type:l.I.ACCORDION,items:[{id:"portsOverview",openByDefault:!0,label:r.createElement(i.A,{id:"DEVICE_PROPERTY_HEADER_PORTS"}),renderContent:()=>r.createElement(c.A,{activeItem:e,showFullScreenDiagramButton:!0,useBubbleWrapper:!1})}]}),r.createElement(l.A,{type:l.I.ACCORDION,items:[{id:"outletOverview",openByDefault:!0,label:r.createElement(i.A,{id:"COMMON_OUTLETS"}),renderContent:()=>r.createElement(s.A,{activeItem:e,hidePorts:!0})}]}),r.createElement(m.A,{mac:t,model:n,logType:E.F.DEVICE,ignoreActionableValues:[o.dl.DEVICE],label:"COMMON_HISTORY"}),r.createElement(A.A,{mac:t,object:a.qv.GW}))},766624(e,t,n){n.d(t,{A:()=>c});var r=n(296540),i=n(271856),l=n(709690),a=n(284428),o=n(566723);const c=({description:e,isInteractive:t,portal:n=!0,cursorType:c,title:s,position:E,width:m,iconProps:A,disabled:d=!1})=>{const u=(0,a.Im)()||d,p=(0,a.q)();return r.createElement(i.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:c,title:s,position:E,width:m,disableHover:p},r.createElement(l.A,{isActive:!0,size:"original",opacity:u?o.xN:void 0,...A}))}},451449(e,t,n){n.d(t,{I:()=>r});const r=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},284428(e,t,n){n.d(t,{Im:()=>c,iL:()=>s,mQ:()=>a,pv:()=>l,q:()=>o});var r=n(296540),i=n(451449);function l(){return(0,r.useContext)(i.I)}function a(){return l().fields}function o(){return l().tooltipPopovers}function c(){return l().tooltipIcons}function s(){return l().labels}}}]);