"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[92784],{535322(e,i,t){t.d(i,{A:()=>h,I:()=>r});var r,n=t(274934),s=t(814557),o=t(158885),d=t(247816),l=t(565527),a=t(309130),c=t(100978),x=t(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const m=(0,d.A)(c.A,(0,x.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:i,theme:{themeName:t}})=>e||s.Ay[t===l.S.DARK?`desktop-color-neutral-${i?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${i?"01":"00"}-${l.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:i})=>i||(e?`0 ${a.Ln}`:a.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||a.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,d.A)(o.A,(0,x.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:i,theme:{themeName:t}})=>e||s.Ay[t===l.S.DARK?`desktop-color-neutral-${i?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${i?"01":"00"}-${l.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:i})=>i||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:i}})=>e||s.Ay[i===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${a.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${a.Ln} ${a.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:i,margin:t,padding:s,flex:o,width:d,nested:l,...a})=>"items"in a?(0,n.jsx)(p,{marginBottom:i,margin:t,padding:s,flex:o,nested:l,...a}):(0,n.jsx)(m,{nested:l,width:d,marginBottom:i,margin:t,padding:s,flex:o,isButtonList:e===r.BUTTON_LIST,...a,children:a.children})},250266(e,i,t){t.d(i,{A:()=>c});var r=t(274934),n=t(602086),s=t(696264),o=t(409844),d=t(521376),l=t(309130),a=t(470070);const c=({children:e=null,title:i,titleValues:t,message:c,messageValues:x,handleConfirm:m=()=>null,handleClose:p=()=>null,handleCancel:h,isOpen:u,buttonVariant:A="primary",cancelButtonVariant:_="tertiary",cancelButtonMessage:O="COMMON_ACTION_CANCEL",buttonMessage:E="COMMON_ACTION_CONFIRM",buttonDisabled:j=!1,position:f="top",offset:g,showHeaderClose:C=!1,contentClassName:T="",body:I,titleBody:k,className:b,rootClose:S=!1,footerActions:R})=>{const P=(0,n.useCallback)(e=>{u&&(e.stopPropagation(),e.key===d.U.ENTER?m():e.key===d.U.ESCAPE&&p(!1))},[u,m,p]);(0,n.useEffect)(()=>(window.addEventListener("keydown",P,!0),()=>{window.removeEventListener("keydown",P,!0)}),[P]);const N=(0,n.useCallback)(()=>{p(!1),h?.()},[p,h]),L=(0,n.useCallback)(()=>{p(!1),m()},[p,m]),$=(0,n.useMemo)(()=>[{text:(0,r.jsx)(a.sA,{id:O}),variant:_,onClick:N},{text:(0,r.jsx)(a.sA,{id:E}),disabled:j,variant:A,onClick:L}],[E,A,O,_,N,L,j]),v=(0,n.useCallback)(()=>{p(!1)},[p]),M=o.AH`
    ${i?"":`margin-top: ${l.xO}`}
  `;return(0,r.jsx)(s.A,{title:i?(0,r.jsx)(a.sA,{id:i,values:t}):k||null,...c?{body:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.sA,{id:c,values:x}),I]})}:{body:I},position:f,portal:!0,offset:g,actions:R||$,showHeaderClose:C,contentClassName:o.AH`
        ${M}
        ${T}
      `,onRequestClose:v,isOpen:u,allowOverflow:!0,rootClose:S,className:b,children:e})}},225889(e,i,t){t.d(i,{A:()=>a});var r=t(274934),n=t(853777),s=t(938984),o=t(470070),d=t(100978),l=t(309130);const a=()=>(0,r.jsxs)(d.A,{gap:l.kc,children:[(0,r.jsx)(n.A,{isActive:!0}),(0,r.jsx)(s.A,{size:"small",children:(0,r.jsx)(o.sA,{id:"DEVICE_DIAGRAM_MISSING"})})]})},510906(e,i,t){t.d(i,{A:()=>C});var r=t(274934),n=t(977872),s=t(602086),o=t(938984),d=t(669439),l=t(590979),a=t(254585),c=t(449339),x=t(589650),m=t(684209),p=t(223104),h=t(250266),u=t(408402),A=t(205521),_=t(470070),O=t(95546),E=t(956978),j=t(795206),f=t(917236),g=t(818981);const C=({extendedPort:e,keyValue:i,portSize:t,portSizeOverride:C,disableOnPortClick:T=!1,centerIcon:I,marginLeft:k,tooltipPlacement:b="bottom"})=>{const S=(0,n.wA)(),R=(0,n.d4)(a.oI),P=(0,n.d4)(a.rw),[N,L]=(0,s.useState)(!1),{device:$}=e,{mac:v,model:M}=$,D=(0,s.useCallback)(()=>{S((0,j.Fx)($,e.port_idx)),L(!1)},[S,$,e.port_idx]),w=Boolean(e.poe_enable&&!(0,E.ioy)($));return(0,r.jsx)(u.A,{condition:w,wrapper:i=>(0,r.jsx)(h.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:e.port_idx},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:L,handleConfirm:D,isOpen:N,rootClose:!0,body:(0,r.jsx)(o.A,{size:"inherit",children:(0,r.jsx)(_.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:e.port_idx}})}),children:i}),children:(0,r.jsx)(d.A,{description:(0,r.jsx)(f.A,{portData:e,showPowerCycleHeader:w,portName:e.name,device:P}),delay:0,closeDelay:0,isDisabled:N,placement:b,className:g.K5,children:(0,r.jsxs)(g.Dn,{onClick:i=>w?(L(!0),null):T||e.masked?null:(i?.preventDefault?.(),i?.stopPropagation?.(),S((0,A.XP)({type:c.H.DEVICE,id:v,tab:R,subPanel:x.uY.PORTS,subId:String(e.port_idx)}))),...l.A.addDataTestId(l.A.TestId.SIDE_PANEL_TRIGGER),children:[(0,r.jsx)(g.MM,{centerIcon:I,marginLeft:k,colorInfo:(0,m.PI)(e),portSize:t,portSizeOverride:C,hasTransparentBorder:(0,O._R)(e.port_idx,M),children:(0,r.jsx)(p.A,{icon:e.icon,smallerIcons:!0})}),(0,O.jw)(e.port_idx,M)?(0,r.jsx)(g.lh,{}):null]})},i)})}},251323(e,i,t){t.d(i,{A:()=>b});var r=t(274934),n=t(602086),s=t(492399),o=t(247816),d=t(409844),l=t(977872),a=t(940229),c=t(956978),x=t(576024),m=t(100978),p=t(309130),h=t(873247),u=t(874866),A=t(160286),_=t(197571),O=t(167933),E=t(68105),j=t(461731),f=t(994177),g=t(225889),C=t(262170),T=t(510906),I=t(818981);(0,o.A)(m.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`;const k=({spacing:e},i)=>d.AH`
  &:not(:first-child) {
    margin-top: ${p.YC};
  }
  &:nth-child(2n) {
    margin-top: ${e};
  }

  justify-content: ${i?"space-between":"unset"};
`,b=({activeItem:e,portSizeOverride:i,disableOnPortClick:t,isStacking:o})=>{const{model:d}=e,{diagram:p}=(0,f.j)(d),b=p?.length?(0,x.sT)(p,e):(0,x.oJ)(e),S=Number((0,s.A)((b||[]).map(e=>e.length))),R=Object.values(C.J).find(e=>S<=e.threshold)||C.J.xsmall,P=R===C.J.xsmall,N=(0,c.ez9)(e)||(0,c.gE3)(e),L=(0,l.d4)(h.wD),$=(0,l.d4)(u.D),v=(0,l.d4)(A.D5),M=(0,l.d4)(_.wf),D=(0,l.d4)(O.pB),w=(0,l.d4)(j.G),z=(0,l.d4)(E.qS),y=(0,n.useMemo)(()=>(0,a.Vi)(e,L,$,v,M,D,w,z),[e,L,$,v,M,D,w,z]);return b&&0!==b.length?(0,r.jsx)(r.Fragment,{children:b.map((e,n)=>(0,r.jsx)(m.A,{"align-items":"flex-end",className:k(R,o),flex:`1 1 ${i||R.size}`,gap:R?.spacing||C.J.large.spacing,children:e.map((e,s)=>{const o=`Port-${n+1}-${s+1}`,d=e&&y.find(i=>i.port_idx===e.portNumber);return d?(0,r.jsx)(T.A,{extendedPort:d,keyValue:o,portSize:R,portSizeOverride:i,disableOnPortClick:Boolean(t)},o):N||P&&((e,i)=>{if(e[0]?.[i]||0!==e.length&&e[1]?.[i])return!1;if(i>0){const t=e[0]?.[i-1],r=e.length>1?e[1]?.[i-1]:null;if(!(t?.portType||"").includes("sfp")||!(r?.portType||"").includes("sfp"))return!1}return!0})(b,s)?null:(0,r.jsx)(I.hK,{portSize:R,portSizeOverride:i},o)})},`PortLayoutRow-${n+1}`))}):(0,r.jsx)(g.A,{})}},917236(e,i,t){t.d(i,{A:()=>C});var r=t(274934),n=t(977872),s=t(814557),o=t(878151),d=t(938984),l=t(95032),a=t(247816),c=t(347625),x=t(309130),m=t(100978),p=t(470070),h=t(873247),u=t(576024),A=t(95546),_=t(235279),O=t(754924);const E=(0,a.A)("div")`
  display: flex;
  justify-content: space-between;
  gap: ${x.YC};

  & > :last-child {
    max-width: 60%;
    text-align: right;
  }
`,j=(0,a.A)(m.A)`
  margin-bottom: ${x.kc};
  padding-bottom: ${x.kc};
  border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};
`,f=(0,a.A)(l.A)`
  white-space: nowrap;
`,g=e=>(0,r.jsx)(f,{size:"small",...e}),C=({portData:e,portName:i,showPowerCycleHeader:t=!1,device:s})=>{const{ifname:l,port_idx:a,tx_bytes:f,rx_bytes:C,sfp_txfault:T,sfp_rxfault:I,sfp_vendor:k,sfp_serial:b,sfp_part:S,sfp_rev:R,sfp_compliance:P,sfp_voltage:N,sfp_current:L,sfp_txpower:$,sfp_rxpower:v,sfp_temperature:M}=e||{},{formatMessage:D}=(0,p.tz)(),w=(0,n.d4)(h.wD),z=(0,A.Hn)(e,w),y=(0,n.d4)(O.ID),V=(0,u.Uz)(e.port_idx,s.mac,s.downlink_table,y),B=(0,u.RK)(e,s,y),U=e&&(0,A.d4)(e)&&e.sfp_found,W=(0,u.xx)(e,D),H=(0,u.m3)(e,D),F=(0,_.Ki)(e),K=[];return U&&(T&&K.push(D({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX_FAULT"})),I&&K.push(D({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX_FAULT"}))),(0,r.jsxs)(m.A,{flexDirection:"column",minWidth:100,children:[t?(0,r.jsx)(j,{children:(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_ACTIONS_PORT_CLICK_TO_POWER_CYCLE"})})}):null,(0,r.jsxs)(m.A,{gap:x.YC,flexDirection:"column",children:[e.masked||!a&&!l?null:(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_PORT"})}),(0,r.jsx)(g,{motif:"dark",children:(0,u.LS)(e,s.model)})]}),i?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_NAME"})}),(0,r.jsx)(g,{motif:"dark",isTruncated:!0,children:i})]}):null,W?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_SPEED"})}),(0,r.jsx)(g,{motif:"dark",isTruncated:!0,children:W})]}):null,H||K.length>0?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_STATUS"})}),(0,r.jsxs)(g,{motif:"dark",isTruncated:!0,children:[H,K.length>0?(0,r.jsx)(d.A,{color:"destructive",children:K.join(", ")}):null]})]}):null,f&&f>0?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_TX"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(o.A,{type:"bytes",input:f,motif:"dark"})})]}):null,C&&C>0?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_RX"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(o.A,{type:"bytes",input:C,motif:"dark"})})]}):null,F?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:F,values:{power:e.poe_power}})})]}):null,z?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PROFILE"})}),(0,r.jsx)(g,{motif:"dark",isTruncated:!0,children:z})]}):null,V?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_DOWNLINK"})}),(0,r.jsx)(g,{motif:"dark",isTruncated:!0,children:(0,c.Q)(V)})]}):null,B?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_UPLINK"})}),(0,r.jsx)(g,{motif:"dark",isTruncated:!0,children:(0,c.Q)(B)})]}):null,U?(0,r.jsxs)(r.Fragment,{children:[k?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_VENDOR"})}),(0,r.jsx)(g,{motif:"dark",children:String(k)})]}):null,b?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_SERIAL"})}),(0,r.jsx)(g,{motif:"dark",children:String(b)})]}):null,S?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PART_NUMBER"})}),(0,r.jsx)(g,{motif:"dark",children:String(S)})]}):null,R?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_REV"})}),(0,r.jsx)(g,{motif:"dark",children:String(R)})]}):null,P?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_COMPLIANCE"})}),(0,r.jsx)(g,{motif:"dark",isTruncated:!0,children:String(P)})]}):null,N?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_VOLTAGE"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE",values:{voltage:Number(N||0).toFixed(2)}})})]}):null,L?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_CURRENT"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:+L}})})]}):null,M?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"COMMON_TEMPERATURE"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:Number(M).toFixed(1)}})})]}):null,Number($)?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_OUTPUT_POWER"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number($).toFixed(2)}})})]}):null,Number(v)?(0,r.jsxs)(E,{children:[(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_INPUT_POWER"})}),(0,r.jsx)(g,{motif:"dark",children:(0,r.jsx)(p.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(v).toFixed(2)}})})]}):null]}):null]})]})}},818981(e,i,t){t.d(i,{Dn:()=>u,K5:()=>A,MM:()=>m,hK:()=>p,lh:()=>h});var r=t(814557),n=t(247816),s=t(409844),o=t(309130),d=t(262170),l=t(100978),a=t(940229),c=t(940563),x=t(291508);const m=(0,n.A)(l.A,(0,x.A)("colorInfo","portSize","portSizeOverride","isDisabled","centerIcon","hasTransparentBorder"))`
  height: ${({portSizeOverride:e,portSize:i})=>e||i?.size||d.J.large.size};
  width: ${({portSizeOverride:e,portSize:i})=>e||i?.size||d.J.large.size};
  ${({portSize:e})=>e?.marginSize?`margin-left: ${e.marginSize}`:""};
  ${({portSize:e,marginLeft:i})=>e?.marginSize||i?`margin-left: ${i||e?.marginSize};`:""};
  align-items: center;
  border-radius: 2px;
  justify-content: center;
  position: relative;
  pointer-events: auto;
  z-index: 3;

  ${({colorInfo:e,theme:{themeName:i}})=>e.background===c.A.DISABLED.background&&`border: ${(0,a.oX)(e.border,i)} 1px solid;`}
  background-color: ${({colorInfo:e,theme:{themeName:i}})=>(0,a.oX)(e.background,i)};
  color: ${({colorInfo:e,theme:{themeName:i}})=>(0,a.oX)(e.text,i)};

  /* Fix hover area of combo ports */
  ${({hasTransparentBorder:e})=>e&&"\n      position: relative;\n      &:before {\n        content: '';\n        position: absolute;\n        top: -3px;\n        right: -3px;\n        bottom: -3px;\n        left: -3px;   \n        background: transparent;\n        z-index: 2; \n      }\n  "}

  ${({centerIcon:e,portSize:i})=>e&&i?.spacing&&`transform: translateY(calc(50% + ${i?.spacing} / 2))`};
`,p=(0,n.A)("div",(0,x.A)("portSize","portSizeOverride"))`
  width: ${({portSizeOverride:e,portSize:i})=>e||i?.size||d.J.large.size};
  flex-shrink: 0;
`,h=(0,n.A)("div",(0,x.A)("size"))`
  position: absolute;
  width: calc(${d.J.large.size} + ${d.J.large.size} + 8px);
  height: calc(${d.J.large.size} + 4px);
  top: -2px;
  left: -2px;
  z-index: 1;
  background: ${({theme:{themeName:e}})=>r.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${o.YC};
  border: 1px solid
    ${({theme:{themeName:e}})=>r.Ay[`desktop-color-ublue-04-${e}`]};
`,u=(0,n.A)(l.A)`
  position: relative;
  cursor: pointer;
`,A=s.AH`
  [data-uic-component='Tooltip.Arrow'] {
    pointer-events: none;
  }
`},262170(e,i,t){t.d(i,{J:()=>n});var r=t(309130);const n={large:{threshold:12,size:"24px",spacing:r.YC},medium:{threshold:15,size:"16px",spacing:r.YC},small:{threshold:20,size:"12px",spacing:r.YC},xsmall:{threshold:50,size:"11px",spacing:"1px"}}},521376(e,i,t){var r;t.d(i,{U:()=>r}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(r||(r={}))}}]);