"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[37032,89965],{86571:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(296540),i=n(217439),a=n(699784);const o=({id:e,children:t,values:n})=>r.createElement(i.A,{color:"text-1",weight:"bold",size:"medium"},e?r.createElement(a.sA,{id:e,values:n}):null,t)},216211:(e,t,n)=>{n.d(t,{e:()=>p});var r=n(956347),i=n(469733),a=n(296540),o=n(15095),l=n(627440),c=n(431247),d=n(293016),s=n(649413),m=n(497470);const p=()=>{const e=(0,i.useDispatch)(),t=(0,r.W6)(),n=(0,o.A)(`${l.VO.PORTS}`);return{handleGoToPortsPage:(0,a.useCallback)((r,i,a)=>{if(r)if(e((0,m.gU)(!0)),e((0,m.U)((0,s.HN)(d.F7.DEVICE,[r]))),a&&(e((0,m.IU)(!0)),e((0,m.E1)(!1))),i){const t=(0,c.FS)(r,i);e((0,m.Ao)([t]))}else e((0,m.Ao)([]));t.push(n)},[n,t,e])}}},218234:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(296540),i=n(71479),a=n(566723),o=n(294303),l=n(689965),c=n(226712),d=n(799552),s=n(683086);const m=(0,i.A)(o.A)`
  > div {
    width: 100%;
  }
`,p=({activeItem:e,activeItem:{port_table:t,mac:n},showFullScreenDiagramButton:i,disableOnPortClick:l,isStacking:m,multipleDisplayedDevicesData:p})=>{const u=0!==(t||[]).length;return r.createElement(r.Fragment,null,u?r.createElement(o.A,{position:"relative",flexDirection:"column"},r.createElement(o.A,{flexDirection:"column",justifyContent:"center"},m?p.map(e=>r.createElement(d.A,{activeItem:e,disableOnPortClick:i||l,isStacking:!0})):r.createElement(d.A,{activeItem:e,disableOnPortClick:i||l})),r.createElement(c.A,{deviceMac:n})):null,i&&u?r.createElement(o.A,{paddingTop:a.Ln,justifyContent:"center"},r.createElement(s.A,{mac:n})):null)},u=({useBubbleWrapper:e=!0,...t})=>e?r.createElement(m,null,r.createElement(l.A,{flex:"unset"},r.createElement(p,{...t}))):r.createElement(p,{...t})},226712:(e,t,n)=>{n.d(t,{A:()=>I,j:()=>D});var r=n(469733),i=n(296540),a=n(927099),o=n(822336),l=n(118818),c=n(934846),d=n(95918),s=n(455806),m=n(383704),p=n(363334),u=n(794993),E=n(71479),A=n(998837),g=n(903216),h=n(566723),O=n(294303),k=n(699784),S=n(966784),P=n(962669),_=n(578819),b=n(780811),$=n(532419),f=n(376272),y=n(60687),L=n(264752);const v=(0,E.A)("div")`
  display: grid;
  grid-template-columns: repeat(3, minmax(min-content, 1fr));
  gap: ${h.YC};
  margin-top: ${h.kc};
`,C=(0,E.A)(O.A)`
  gap: ${h.kc};
  row-gap: ${h.YC};
  flex-wrap: wrap;
`,D=(0,E.A)(l.A,{shouldForwardProp:e=>!["background","color"].includes(e)})`
  background-color: ${({background:e,theme:{themeName:t}})=>(0,S.oX)(e,t)};
  border-radius: 0;
  border: ${({color:e,theme:{themeName:t}})=>e&&`1px solid ${(0,S.oX)(e,t)}`};
`,x=(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:(y.s.POE_PLUS_PLUS_PLUS,6),I=({deviceMac:e,isSingleLine:t=!1,hidePoe:n=!1,hideDisabled:l=!1,hideDisconnected:E=!1,displayedSpeedList:h})=>{const{themeName:O}=(0,A.u)(),S=(0,r.useSelector)((0,i.useMemo)(()=>(0,$.tG)(e),[e])),{type:I,model:M}=S;return(0,i.useMemo)(()=>{const e=(0,P.MB)(S),r=(0,b.NuO)(S),A=(0,_._L)(S,r),$=l||(0,b.m_j)(S)||(0,b.Syn)(S)||(0,b.Fp0)(S),M=t?C:v,N=Array.from(A).sort(x).map(e=>{switch(!0){case e===y.s.POE_PLUS_PLUS_PLUS:return i.createElement(L.A,{key:e,description:i.createElement(k.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS_PLUS"}),indicator:i.createElement(c.A,{color:o.Ay[`desktop-color-neutral-08-${O}`]})});case e===y.s.POE_PLUS_PLUS:return i.createElement(L.A,{key:e,description:i.createElement(k.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}),indicator:i.createElement(d.A,{color:o.Ay[`desktop-color-neutral-08-${O}`]})});case e===y.s.POE_PLUS:return i.createElement(L.A,{key:e,description:i.createElement(k.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS"}),indicator:i.createElement(s.A,{color:o.Ay[`desktop-color-neutral-08-${O}`]})});case e===y.s.PASSTHROUGH||e===y.s.PASSIVE||e===y.s.POE:return i.createElement(L.A,{key:e,description:i.createElement(k.sA,{id:e===y.s.PASSIVE?"COMMON_DEVICE_POE_MODE_PASSIVE":"COMMON_DEVICE_POE_MODE_POE"}),indicator:i.createElement(m.A,{color:o.Ay[`desktop-color-neutral-08-${O}`]})});default:return null}});return i.createElement(M,null,e.filter(e=>!h||h.includes(e)).sort((e,t)=>e-t).map(e=>i.createElement(L.A,{key:e,description:(0,g.ir)(e),indicator:i.createElement(D,{background:f.A[e]?.background||"transparent"})})),E?null:i.createElement(L.A,{key:"disconnected",description:i.createElement(k.sA,{id:"COMMON_DISCONNECTED"}),indicator:i.createElement(D,{background:f.A.DEFAULT.background})}),$?null:i.createElement(L.A,{key:"disabled",description:i.createElement(k.sA,{id:"COMMON_DISABLED"}),indicator:i.createElement(D,{background:"transparent",color:f.A.DEFAULT.background}),isSingleLine:t}),n?null:N,!(0,b.Tbi)({type:I})||(0,b.Syn)(S)||(0,b.Fp0)(S)?null:i.createElement(i.Fragment,null,i.createElement(L.A,{key:"aggregating",description:i.createElement(k.sA,{id:"COMMON_AGGREGATING"}),indicator:i.createElement(u.A,{color:o.Ay[`desktop-color-neutral-08-${O}`]})}),i.createElement(L.A,{key:"mirror",indicator:i.createElement(p.A,null),description:i.createElement(k.sA,{id:"DEVICE_PORT_STATE_MIRROR"}),tooltipDescription:i.createElement(a.A,null,i.createElement(k.sA,{id:"DEVICE_PORT_STATE_MIRROR_TOOLTIP"}))})))},[M,n,l,h,O])}},264752:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(296540),i=n(927099),a=n(71479),o=n(566723),l=n(766624),c=n(294303);const d=(0,a.A)(i.A)`
  white-space: nowrap;
`,s=(0,a.A)(c.A)`
  align-items: center;
`,m=(0,a.A)(c.A)`
  width: ${o.Ln};
  justify-content: flex-start;
`,p=({indicator:e,description:t,isSingleLine:n,tooltipDescription:i})=>r.createElement(s,{marginRight:n?o.kc:0},r.createElement(m,null,e),r.createElement(d,{size:"caption",color:"tertiary"},t),i?r.createElement(l.A,{description:i}):null)},369702:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(74750),i=n(296540);const a=({children:e,...t})=>i.createElement(r.A,{variant:"secondary-emphasis",...t},e)},683086:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(296540),i=n(369702),a=n(699784),o=n(216211);const l=({mac:e})=>{const{handleGoToPortsPage:t}=(0,o.e)(),n=(0,r.useCallback)(()=>{t(e)},[t,e]);return r.createElement(i.A,{onClick:n,width:"full"},r.createElement(a.sA,{id:"COMMON_PORT_MANAGER"}))}},689965:(e,t,n)=>{n.d(t,{A:()=>u,I:()=>r});var r,i=n(296540),a=n(822336),o=n(427853),l=n(71479),c=n(825032),d=n(566723),s=n(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const m=(0,l.A)(s.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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}})=>a.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,l.A)(o.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||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:t}})=>e||a.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${d.Ln} ${d.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,u=({type:e,marginBottom:t,margin:n,padding:a,flex:o,width:l,nested:c,...d})=>"items"in d?i.createElement(p,{marginBottom:t,margin:n,padding:a,flex:o,nested:c,...d}):i.createElement(m,{nested:c,width:l,marginBottom:t,margin:n,padding:a,flex:o,isButtonList:e===r.BUTTON_LIST,...d},d.children)},799552:(e,t,n)=>{n.d(t,{A:()=>O});var r=n(296540),i=n(23514),a=n(162420),o=n(71479),l=n(132196),c=n(566723),d=n(294303),s=n(699784),m=n(962669),p=n(780811),u=n(266714),E=n(335165);const A=(0,o.A)(d.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`,g=(0,o.A)("div",{shouldForwardProp:e=>!["portSize","portSizeOverride"].includes(e)})`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||E.J.large.size};
  flex-shrink: 0;
`,h=({spacing:e},t)=>l.AH`
  &:not(:first-child) {
    margin-top: ${c.YC};
  }
  &:nth-child(2n) {
    margin-top: ${e};
  }

  justify-content: ${t?"space-between":"unset"};
`,O=({activeItem:e,activeItem:{model:t},portSizeOverride:n,disableOnPortClick:o,isStacking:l})=>{const{diagram:c}=(0,p.joB)(t),O=c?.length?(0,m.sT)(c,e):(0,m.oJ)(e);if(!O||0===O.length)return r.createElement(A,null,r.createElement(a.A,{isActive:!0,className:"mr-2"}),r.createElement(s.sA,{id:"DEVICE_DIAGRAM_MISSING"}));const k=Number((0,i.A)(O.map(e=>e.length))),S=Object.values(E.J).find(e=>k<=e.threshold)||E.J.xsmall,P=S===E.J.xsmall;return r.createElement(r.Fragment,null,O.map((t,i)=>r.createElement(d.A,{"align-items":"flex-end",key:`PortLayoutRow-${i+1}`,className:h(S,l),flex:`1 1 ${n||S.size}`,gap:S?.spacing||E.J.large.spacing},t.map((t,a)=>{const l=`Port-${i+1}-${a+1}`,c=t&&e?.port_table?(0,p.NF$)(t.portNumber,e):null;return c?r.createElement(u.A,{cellData:c,activeItem:e,key:l,keyValue:l,portSize:S,portSizeOverride:n,disableOnPortClick:o}):P&&((e,t)=>{const n=!e[0]?.[t],r=0===e.length||!e[1]?.[t];if(!n||!r)return!1;if(t>0){const n=e[0]?.[t-1],r=e.length>1?e[1]?.[t-1]:null;if(!(n?.portType||"").includes("sfp")||!(r?.portType||"").includes("sfp"))return!1}return!0})(O,a)?null:r.createElement(g,{key:l,portSize:S,portSizeOverride:n})}))))}}}]);