"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[49005],{25202(e,t,s){s.d(t,{A:()=>o});var n=s(602086),r=s(141992);const o=(0,s(272338).w)(e=>(0,n.createElement)("svg",(0,r.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{d:"M4 3.5a.5.5 0 0 0-1 0v13a.5.5 0 0 0 1 0v-13Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m11.708 15.5 4.793-4.794.354-.353a.5.5 0 0 0 0-.707l-5.138-5.138-.009-.008a.5.5 0 0 0-.707.707l.009.008 4.284 4.284H6.5a.501.501 0 0 0-.002 1.003l2.013.008h6.77L11 14.793a.5.5 0 0 0 .707.707Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{d:"M4.5 3.75a.75.75 0 1 0-1.5 0v12.5a.75.75 0 0 0 1.5 0V3.75Zm7.03.778a.751.751 0 0 0-.53 1.28l3.411 3.413H6.75a.75.75 0 1 0 0 1.5h7.718L11 14.188a.75.75 0 0 0 1.06 1.06l4.72-4.719a.75.75 0 0 0 0-1.061l-4.72-4.72a.745.745 0 0 0-.53-.22Z",fill:"currentColor",className:e.fillclassname})))},448567(e,t,s){s.d(t,{A:()=>d});var n=s(602086),r=s(241365),o=s(553313),i=s(757147);const a=16.5,l=(0,s(999803).c)(i.A);function c({motif:e="light",parent:t,expanded:s,child:i,hideLines:c,lastChild:d,rowHeight:u=32,onClick:m,position:A}){const p={width:"32px",height:1},h=r.Ay.motifs[e].neutral04;if(t)return n.createElement(o.A,{className:l("hierarchyGlyphIcon"),value:s?"minus":"plus",motif:e,isExpanded:s,onClick:m});if(c)return null;if((d||i)&&"top"===A){const e=u/2;return n.createElement("svg",{...p,height:e+.5},n.createElement("line",{stroke:h,strokeWidth:1,x1:a,y1:.5,x2:a,y2:e}),n.createElement("line",{stroke:h,strokeWidth:1,x1:a,y1:e,x2:32,y2:e}))}return d||i?n.createElement("svg",{...p},n.createElement("line",{stroke:h,strokeWidth:1,x1:"15.5",y1:"0.5",x2:"32",y2:"0.5"})):null}function d(e){const{className:t="",motif:s="light",hideCellBorder:r,tag:o="td",lastChild:i,expanded:a,parent:d,position:u="center",hideLines:m,...A}=e;return n.createElement(o,{className:l.concat(t)(!r&&"borderedCell",!r&&`borderedCell-${s}`,"hierarchyGlyph",`hierarchyGlyph-${s}`,a&&!m&&"hierarchyGlyph-expanded",i&&"hierarchyGlyph-lastChild",d&&"hierarchyGlyph-parent","top"===u&&"top")},n.createElement(c,{motif:s,lastChild:i,expanded:a,parent:d,position:u,...A}))}d.defaultProps={child:!1,lastChild:!1,expanded:!1,parent:!1,hideLines:!1,hideCellBorder:!1,motif:"light"}},602569(e,t,s){s.d(t,{A:()=>A});var n=s(602086),r=s(255949),o=s(478556),i=s(169762),a=s(999803),l=s(43009);const c=(0,a.c)(i.A),d=n.forwardRef((e,t)=>{const{className:s,motif:r,...o}=e,{motif:i}=(0,l.A)(r);return n.createElement("div",{ref:t,slot:"header","data-uic-component":"Disclosure.StaticHeader",className:c.concat(s)("header",`header-${i}`),...o})});d.displayName="DisclosureStaticHeader";var u=s(459009),m=s(558948);const A=n.forwardRef((e,t)=>{const{label:s,caption:i,symbol:a,tooltipProps:l,children:c,size:A,isDisabled:p,hasDivider:h=!0,hasPaddedContent:x=!0,...E}=e;return n.createElement(r.A,{ref:t,isDisabled:p,isExpanded:!0,"data-uic-component":"Disclosure_Static",...E},n.createElement(n.Fragment,null,n.createElement(d,null,n.createElement(u.A,{label:s,caption:i,symbol:a,tooltipProps:l,isDisabled:p,size:A,width:"auto"})),c&&n.createElement(o.A,{hasPaddedContent:x,hasDivider:h},c),h&&n.createElement(m.A,null)))});A.displayName="Disclosure_Static"},887041(e,t,s){s.d(t,{A:()=>o});var n=s(602086),r=s(275607);const o=({children:e})=>{const[t,s]=n.useState(null),o=null!==t,i=n.useCallback(e=>{s(e)},[]),a=n.useCallback(e=>{s(e)},[]),l=n.useCallback(()=>{s(null)},[]),c=n.useMemo(()=>({isMaximized:o,maximizedId:t,maximize:a,minimize:l}),[o,t,a,l]),d="function"==typeof e?e({isMaximized:o,maximizedId:t,maximize:a,minimize:l}):e;return n.createElement(r.zX.Provider,{value:c},n.createElement(r.YC.Provider,{value:i},d))}},263413(e,t,s){s.d(t,{A:()=>r});var n=s(143979);const r=e=>e.start&&e.end?{start:(0,n.gw)(e.start),end:(0,n.gw)(e.end)}:null},469583(e,t,s){s.r(t),s.d(t,{default:()=>Vi});var n=s(274934),r=s(247816),o=s(244081),i=s(213920),a=s(222361),l=s(401004),c=s(724081),d=s(309130),u=s(429622),m=s(645648),A=s(100978),p=s(104997),h=s(838701),x=s(539453),E=s(101267),_=s(598990),C=s(548794),g=s(350762),O=s(553732),f=s(794535),N=s(747030),S=s(789803),T=s(795206),M=s(239627),I=s(652236),v=s(602086),b=s(977872),j=s(279740),D=s(749888),P=s(720770),y=s(968021),k=s(95546),w=s(20049),R=s(10695),L=s(107178),$=s(814557),F=s(938984),U=s(600191),V=s(113963),H=s(491396),G=s(263705),z=s(590979),W=s(303853),B=s(291508),K=s(589650),Y=s(85908),X=s(205521),Z=s(470070),q=s(127927),Q=s(207399),J=s(588769),ee=s(449339),te=s(20768);const se=(0,r.A)(A.A,(0,B.A)("isVisible"))`
  background-color: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-neutral-01-${e}`]};
  gap: ${d.kc};
  padding: 6px ${d.kc};
  display: ${({isVisible:e})=>e?"flex":"none"};
`,ne=(0,r.A)(A.A,(0,B.A)("elementWidth"))`
  position: absolute;
  border-radius: ${d.YC};
  width: fit-content;
  max-width: ${325}px;
  top: 0;
  max-height: ${320}px;
  overflow-y: auto;
  background-color: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-neutral-01-${e}`]};
  box-shadow: ${({theme:{themeName:e}})=>$.Ay[`desktop-shadow-low-${e}`]};
  z-index: 1;

  /* 
  Horizontal placement of this element is done through "right" property.
  1. Move element to middle of the page.
  2. Subtract half of the element width to center it.
  3. SPACE_16 is an extra constant to align with the page tabs.
  4. There is a constant relevant to scrollbar width - we dont want the element to jump left and right when scrollbar appears. This compentates the element& scrollbar widths movements.
  */
  right: ${({elementWidth:e,isOverflowing:t})=>`calc(50% + ${d.Ln} - ${e/2}px - ${t?16:0}px)`};
  @media ${J.A.VIEWPORT_M_DOWN} {
    right: 0;
  }

  opacity: ${({elementWidth:e})=>e>0?1:0};
`,re=(0,r.A)(A.A)`
  flex-direction: column;
  width: 100%;
`,oe=()=>(0,n.jsx)(U.A,{variant:"fill",size:"original",color:$.Ay[`desktop-color-red-06-${(0,G.u)().themeName}`]}),ie=()=>(0,n.jsx)(U.A,{variant:"fill",size:"original",color:$.Ay[`desktop-color-orange-06-${(0,G.u)().themeName}`]}),ae=({issue:e,onClick:t})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q.g[e.anomaly]===q.Q.CRITICAL?oe:ie,{}),(0,n.jsxs)(F.A,{size:"medium",color:"text-2",style:{cursor:t?"pointer":"default"},onClick:t?()=>t(e.port_idx):void 0,...z.A.addDataTestId(z.A.TestId.SIDE_PANEL_TRIGGER),children:[(0,n.jsx)(Z.sA,{id:"COMMON_PORT_NUMBER",values:{portNumber:e.port_idx}}),": ",(0,n.jsx)(Z.sA,{id:Y.l3[e.anomaly]})]})]}),le=({deviceIssues:e,isExpanded:t,setIsExpanded:s,onPortClick:r})=>{const o=e.some(e=>Q.g[e.anomaly]===q.Q.CRITICAL);return(0,n.jsxs)(re,{children:[(0,n.jsxs)(se,{cursor:"pointer",onClick:()=>{s(!t)},isVisible:!0,children:[(0,n.jsx)(o?oe:ie,{}),(0,n.jsx)(F.A,{size:"medium",color:"text-2",children:(0,n.jsx)(Z.sA,{id:"DEVICE_PORT_STATE_ISSUES_TITLE"})}),(0,n.jsx)(t?V.A:H.A,{size:"original"})]}),t?e.map(e=>(0,n.jsx)(se,{isVisible:t,children:(0,n.jsx)(ae,{issue:e,onClick:r})},e.port_idx+e.anomaly)):null]})},ce=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.I_),s=(0,b.d4)(w.tI),r=(0,v.useRef)(null),{width:o}=(0,W.Ay)(r.current),[i,a]=(0,v.useState)(!1),l=t=>{if(!s)return;const n=(0,k.FS)(s,t);e((0,R.Ao)([n])),e((0,X.XP)({type:ee.H.PORTS,id:te.D,tab:K.BC.INSIGHTS,onClose:()=>e((0,R.Ao)([])),preventReopen:!0}))};return t.length?(0,n.jsx)(ne,{elementWidth:o,ref:r,isOverflowing:i&&t.length+1>10,children:1===t.length?(0,n.jsx)(se,{isVisible:!0,children:(0,n.jsx)(ae,{issue:t[0],onClick:l})}):(0,n.jsx)(le,{deviceIssues:t,isExpanded:i,setIsExpanded:a,onPortClick:l})}):null},de=()=>{const e=(0,L.A)(a.g1.PORT_MANAGEMENT);return(0,n.jsx)(A.A,{alignItems:"start",minHeight:30,marginTop:2,marginBottom:2,position:"relative",paddingLeft:e?0:d.kc,children:(0,n.jsx)(ce,{})})};var ue=s(125799),me=s(95032),Ae=s(347625);const pe=(0,v.createContext)(null),he=({children:e})=>{const[t,s]=(0,v.useState)(1),[r,o]=(0,v.useState)(0),i=(0,v.useRef)(1),a=(0,v.useRef)(0),l=(0,v.useMemo)(()=>({sharedScale:t,sharedOffset:r,setSharedScale:s,setSharedOffset:o,cachedScaleRef:i,cachedOffsetRef:a}),[t,r]);return(0,n.jsx)(pe.Provider,{value:l,children:e})},xe=()=>{const e=(0,v.useContext)(pe);if(!e)throw new Error("useDiagramScaleContext must be used within DiagramScaleProvider");return e};var Ee=s(576024),_e=s(994177),Ce=s(754924),ge=s(225889),Oe=s(598987),fe=s(24490),Ne=s(670830),Se=s(831433),Te=s(114530),Me=s(513458),Ie=s(565527),ve=s(774385),be=s(641671);const je=(0,r.A)(A.A,(0,B.A)("hide"))`
  align-items: center;
  justify-content: center;
  width: ${Y.Dq}px;
  height: ${Y.Dq}px;
  border-radius: ${d.YC};
  padding: ${d.YC};
  background: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-neutral-01-${e}`]};
  cursor: pointer;
  position: relative;
  ${(0,Te.g)(Y.Dq)}
`,De=(0,r.A)(Me.A)`
  width: ${d.YC};
  height: ${d.YC};
  position: absolute;
  top: ${d.YC};
  left: ${d.YC};
`,Pe=({connectedDevice:e,connectedClient:t,hide:s,wanProviderAsn:r,wanProviderName:o,onClick:i,isActive:a})=>{const{themeName:l}=(0,G.u)();return e||t||o?(0,n.jsxs)(je,{hide:s,onClick:i,...z.A.addDataTestId(z.A.TestId.SIDE_PANEL_TRIGGER),children:[a?null:(0,n.jsx)(De,{color:l===Ie.S.DARK?$.Ay[`desktop-color-neutral-04-${l}`]:$.Ay[`desktop-color-neutral-08-${l}`]}),(0,n.jsx)(A.A,{opacity:a?void 0:ve.q,children:(0,n.jsx)(be.A,{size:32,connectedClient:t,connectedDevice:e,wanProviderAsn:r,wanProviderName:o})})]}):null};var ye=s(748027),ke=s(419284),we=s(684209),Re=s(536273),Le=s(223104),$e=s(940229);const Fe=(0,we.xn)(10),Ue=(0,r.A)(A.A,(0,B.A)("color","isDisabled","isLocating","disableSelectionEvents"))`
  align-items: center;
  color: ${({theme:{themeName:e},color:t})=>$.Ay[`desktop-color-${t}-${e}`]};
  justify-content: center;
  position: relative;
  pointer-events: auto;
  border-radius: ${$.Ay["desktop-radius-base"]};
  cursor: ${({disableSelectionEvents:e})=>e?"default":"pointer"};
  ${({isDisabled:e})=>e?"\n    pointer-events: none;\n    opacity: 0.4;\n  ":""}
  ${({isLocating:e})=>e?ye.AH`
          animation: ${Fe} 1s cubic-bezier(0.5, 1, 0, 1) infinite alternate;
        `:""}
`,Ve=(0,r.A)("div",(0,B.A)("stacked"))`
  position: relative;
  width: ${Y.Dq}px;
  height: ${Y.Dq}px;
`,He={0:{top:0,left:0,topSelected:0,leftSelected:0,topHovered:0,leftHovered:0,height:Y.Dq,width:Y.Dq,heightSelected:Y.Dq,widthSelected:Y.Dq,heightHovered:Y.Dq,widthHovered:Y.Dq},1:{top:-1.75,left:3,topSelected:-6,leftSelected:3.22,topHovered:-2.75,leftHovered:4,height:37,width:37,heightSelected:40,widthSelected:41,heightHovered:37,widthHovered:37},2:{top:-3.75,left:8,topSelected:-9,leftSelected:7.22,topHovered:-5.75,leftHovered:10,height:36,width:34,heightSelected:40,widthSelected:40,heightHovered:36,widthHovered:34}},Ge=(0,r.A)("div",(0,B.A)("background","border","order","isSelected","isHovered","isStacked"))`
  position: absolute;
  transform: translate(
    ${({order:e,isSelected:t,isHovered:s})=>He[e][t?"leftSelected":s?"leftHovered":"left"]}px,
    ${({order:e,isSelected:t,isHovered:s})=>He[e][t?"topSelected":s?"topHovered":"top"]}px
  );

  width: ${({order:e,isSelected:t,isHovered:s})=>He[e][t?"widthSelected":s?"widthHovered":"width"]}px;
  height: ${({order:e,isSelected:t,isHovered:s})=>He[e][t?"heightSelected":s?"heightHovered":"height"]}px;

  border: ${({order:e})=>0!==e?"none":"1px solid"} ${({border:e})=>e};
  border-radius: ${d.YC};
  background: ${({background:e})=>e};
  z-index: ${({order:e})=>3-e};
  transition:
    all 0.2s ease-out,
    outline 0s,
    outline-offset 0s;

  filter: ${({isHovered:e,order:t})=>e&&0===t?"brightness(0.9)":"none"};
  ${({isSelected:e,order:t,theme:{themeName:s}})=>e&&0===t?`\n      outline: 2px solid ${$.Ay[`desktop-color-ublue-06-${s}`]}; \n      outline-offset: 1px;\n      `:""}
`,ze=(0,r.A)("div")`
  position: absolute;
  right: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: ${4};
`,We=(0,r.A)(F.A)`
  position: absolute;
  text-align: left;
  bottom: 0px;
  left: 4px;
  pointer-events: none;
  z-index: 4;
`,Be=(0,r.A)("div")`
  position: absolute;
  width: ${2*Y.Dq+16}px;
  height: ${Y.Dq+8}px;
  top: -${d.YC};
  left: -${d.YC};
  z-index: -1;
  background: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${d.kc};
  border: 1px solid
    ${({theme:{themeName:e}})=>$.Ay[`desktop-color-ublue-04-${e}`]};
`,Ke=(0,v.memo)(({port:e,isFirstPortInMcLagLinks:t,isFirstPortInStackingLink:s,isFirstPortWan:r,isFirstPortManagement:o,isFirstRow:i})=>{const a=(0,b.wA)(),l=(0,b.d4)(w.x$),c=(0,b.d4)(w.UH),d=(0,b.d4)(w.O2),u=(0,b.d4)(w.pN),m=(0,b.d4)(w.XS),[A,p]=(0,v.useState)(!1),h=(0,b.d4)(w.QR),x=m,E=(0,b.d4)((0,v.useMemo)(()=>(0,w.JX)(e.port_idx||0,e.device.mac),[e.port_idx,e.device.mac])),{background:_,border:C,text:g,stackBackground:O=_,stackBackgroundDark:f=_}=(0,v.useMemo)(()=>(0,we.PI)(e),[e]),N=Boolean(e.isInTargetDevice||e.isInMcLink),S=m?Boolean(e.port_idx&&u.includes(e.port_idx)):Boolean(e.port_idx&&d.has((0,k.FS)(e.device.mac,e.port_idx))),T=!(0,Te.s)({port:e,selectedPorts:c,isPortSelected:S,isStatsOpen:h,isEditingAggregation:m,aggregationPickedPorts:u,firstPort:{isWan:r,isManagement:o,isMcLag:t,isInStackingLink:s},thisPort:{isMcLag:N,isInStackingLink:Boolean(e.isInStackingLink)}}),M=(0,v.useCallback)(t=>{if(t.stopPropagation(),!x&&!T&&e.port_idx){const s=(0,k.FS)(e.device.mac,e.port_idx);a((0,R.Ao)(t.metaKey||t.ctrlKey?(0,$e.QP)(s,c):(0,$e.Um)(s)))}},[a,x,T,e.device.mac,e.port_idx,c]),I=Boolean(e.aggregationGroup||e.lag_idx),j=A||Boolean(e.lag_idx)&&e.lag_idx===l,D=(0,v.useCallback)(()=>{x||(e.lag_idx&&a((0,R.L$)(e.lag_idx)),p(!0))},[a,x,e.lag_idx]),P=(0,v.useCallback)(()=>{x||(a((0,R.L$)(null)),p(!1))},[a,x]),y=(0,G.u)(),{card1Background:L,card2Background:$}=(0,v.useMemo)(()=>{const e=(0,ke.YR)((0,ke.wQ)((0,$e.oX)(_,y.themeName)),(0,ke.wQ)((0,$e.oX)("dark"===y.themeName?f:O,y.themeName)),50),t=(0,ke.YR)((0,ke.wQ)((0,$e.oX)(_,y.themeName)),(0,ke.wQ)((0,$e.oX)("dark"===y.themeName?f:O,y.themeName)),100);return{card1Background:(0,ke.qi)(e),card2Background:(0,ke.qi)(t)}},[_,O,f,y.themeName]);return(0,n.jsx)(Re.A,{port:e,position:i?"top":"bottom",children:(0,n.jsxs)(Ue,{onClick:M,color:g,isDisabled:T,isLocating:E,disableSelectionEvents:x,onMouseEnter:D,onMouseLeave:P,children:[(0,n.jsxs)(Ve,{stacked:I,children:[(0,n.jsx)(Ge,{order:0,background:(0,$e.oX)(_,y.themeName),border:(0,$e.oX)(C,y.themeName),isSelected:S,isHovered:j}),I?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ge,{order:1,background:L,border:(0,$e.oX)(C,y.themeName),isSelected:S,isHovered:j}),(0,n.jsx)(Ge,{order:2,background:$,border:(0,$e.oX)(C,y.themeName),isSelected:S,isHovered:j})]}):null]}),(0,n.jsx)(ze,{children:(0,n.jsx)(Le.A,{icon:e.icon})}),(0,n.jsx)(We,{size:"small",color:"inherit",children:(0,Ee.LS)(e,e.device?.model)}),(0,k.s_)(e.port_idx,e.device?.model)?(0,n.jsx)(Be,{}):null]})})}),Ye=(0,r.A)(A.A,(0,B.A)("hide"))`
  ${(0,Te.g)(20)};
`,Xe=({poe_enable:e,poe_power:t,hide:s})=>{const r=(0,Ee.lG)({poe_enable:e,poe_power:t});return r?(0,n.jsx)(Ye,{hide:s,children:(0,n.jsx)(F.A,{color:"text-3",size:"xsmall",children:r})}):null},Ze=(0,r.A)(me.A)`
  text-align: center;
  cursor: pointer;
  max-width: ${Y.Dq}px;
`,qe=(0,r.A)(A.A,(0,B.A)("hide","isActive"))`
  ${(0,Te.g)(20)};
  cursor: pointer;
  max-width: ${Y.Dq}px;
  opacity: ${({isActive:e})=>e?1:ve.q};
`,Qe=({onClick:e,hide:t,label:s,isActive:r})=>(0,n.jsx)(qe,{hide:t,onClick:e,isActive:r,...z.A.addDataTestId(z.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(Ze,{isTruncated:!0,size:"xsmall",weight:"bold",color:"text-2",children:s})}),Je=(0,r.A)(A.A,(0,B.A)("isFirstRow","disableGap"))`
  flex-direction: ${({isFirstRow:e})=>e?"column-reverse":"column"};
  justify-content: flex-start;
  align-items: center;
  gap: ${({disableGap:e})=>e?0:d.YC};
  position: relative;
  max-width: ${Y.Dq}px;
`,et=(0,r.A)(A.A,(0,B.A)("hide","isActive"))`
  width: 1px;
  height: ${8}px;
  opacity: ${({isActive:e})=>e?1:0};
  background: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-neutral-04-${e}`]};
  ${(0,Te.g)(8)}
`,tt=(0,r.A)("div",(0,B.A)("isPoeCapable"))`
  height: ${({isPoeCapable:e})=>{const t=12+Y.Dq+4+14;return e?t+4+14:t}}px;
`,st=(0,v.memo)(({isFirstRow:e,port:t,hideOptionalElements:s,topConnectionMac:r,setTopConnectionMac:o,topConnectionMacWithPoe:i,setTopConnectionMacWithPoe:a,isFirstSelectedPortWan:l,isFirstSelectedPortManagement:c,isFirstSelectedPortInMcLag:d,isFirstSelectedPortInStackingLink:u})=>{const m=(0,b.wA)(),{wanConfiguration:p,wanProviderAsn:h,wanProviderName:x,lastConnectionClient:E,lastConnectionDevice:_,lastConnectionIsp:C,lastConnectionMac:g,isSomethingConnected:O,wasSomethingConnected:f}=(0,Oe.A)(t),N=x?{name:x,asn:h}:C?{name:C.isp_name,asn:C.isp_asn}:void 0,S=(0,v.useMemo)(()=>g?(0,Ne.r)(g):()=>{},[g]),T=(0,b.d4)(S),I=(0,b.d4)(w.Hz),j=(0,v.useMemo)(()=>p?ee.H.ISP:_?ee.H.DEVICE:T?ee.H.UNIFI_DEVICE_CLIENT:E?ee.H.CLIENT:void 0,[_,E,T,p]),D=(0,v.useCallback)(e=>{e.stopPropagation();const t=p?.configuration?.wan_networkgroup||g;t&&(E&&j===ee.H.CLIENT&&m((0,M.W6)(t,!0)),m((0,X.XP)({type:j,id:t})))},[m,E,g,j,p?.configuration?.wan_networkgroup]),P=N?.name||(0,Ae.Q)(_)||(0,Se.tn)(E),y=O?void 0:E?.last_seen||_?.last_seen||C?.last_seen,k=!e,R=y?"text-3":"text-2",L=Boolean((0,Ee.lG)({poe_enable:t.poe_enable,poe_power:t.poe_power})),$=Boolean(t.port_poe);return(0,v.useEffect)(()=>{e&&(O||f||I)&&(r!==t.device.mac&&o(t.device.mac),i!==t.device.mac&&(L||I&&$)&&a(t.device.mac))},[t.device.mac,r,o,i,a,O,f,e,L,I,$]),(0,n.jsxs)(Je,{isFirstRow:e,disableGap:s,children:[(0,n.jsx)(A.A,{children:(0,n.jsx)(Ke,{port:t,isFirstPortInMcLagLinks:d,isFirstPortInStackingLink:u,isFirstPortWan:l,isFirstPortManagement:c,isFirstRow:e})}),O||f?(0,n.jsx)(fe.A,{label:P,lastSeen:y,isUpsideDown:k,isTooltipAllowed:Boolean(P),children:(0,n.jsxs)(Je,{isFirstRow:e,disableGap:s,children:[(0,n.jsx)(et,{hide:s,isActive:O}),(0,n.jsx)(Pe,{connectedDevice:_,connectedClient:E,wanProviderAsn:N?.asn,wanProviderName:N?.name,hide:s,onClick:D,isActive:O}),(0,n.jsx)(Qe,{label:P,onClick:D,hide:s,textColor:R,isActive:O}),(0,n.jsx)(Xe,{poe_enable:t.poe_enable,poe_power:t.poe_power,hide:s})]})}):I&&!s?(0,n.jsx)(tt,{isPoeCapable:$}):null]})}),nt=(0,r.A)(A.A)`
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: ${d.kc};
`,rt=(0,r.A)(A.A)`
  gap: ${d.kc};
`,ot=(0,r.A)("div")`
  width: ${38}px;
`,it=(0,r.A)(A.A,(0,B.A)("scale"))`
  transform: scale(${({scale:e})=>e});
  justify-content: center;
  align-self: center;
`,at=(0,r.A)(A.A)`
  flex-direction: column;
  gap: ${d.kc};
`,lt=(0,r.A)(A.A)`
  min-height: 32px;
`,ct=(0,r.A)(A.A)`
  gap: ${d.YC};
  align-items: center;
`;var dt=s(239875),ut=s(254585),mt=s(570801);const At=({children:e,scale:t,spaceOffset:s})=>(0,n.jsx)("div",{style:{marginRight:s,transitionDuration:"0.2s",alignItems:"center"},children:(0,n.jsx)(A.A,{gap:d.kc,flexDirection:"column",overflow:"visible",children:(0,n.jsx)(it,{scale:t,children:e})})}),pt=({children:e,cachedScaleRef:t,cachedOffsetRef:s,onScaleOffsetChange:r})=>{const{spaceOffset:o,containerRef:i,contentRef:a,scale:l}=((e,t)=>{const s=(0,v.useRef)(null),n=(0,v.useRef)(null),r=Boolean(s.current)&&Boolean(n.current),{width:o=0}=(0,dt.A)({ref:n}),{width:i=0}=(0,dt.A)({ref:s}),[a,l]=(0,v.useState)(t.current),c=(0,v.useRef)(0),d=(0,v.useRef)(0),u=o>0&&i>0?Math.min((o-16)/i,1):e.current,m=(0,b.d4)(w.UH),A=(0,b.d4)(ut.WS),p=Boolean(m.length)||A,h=(0,b.d4)(w.QR),x=(0,b.d4)(w.kq),E=(0,b.d4)(mt.P),_=(0,b.d4)(ut.S5),C=416+(E&&_.length>1&&A?40:0);return(0,v.useEffect)(()=>{o>0&&i>0&&(e.current=u)},[u,o,i,e]),(0,v.useEffect)(()=>{if(!r)return;if(!p||h)return c.current=0,l(0),d.current=0,void(t.current=0);const e=e=>{c.current=e,t.current=e,l(e)};requestAnimationFrame(()=>{const t=s.current?.getBoundingClientRect(),r=n.current?.getBoundingClientRect();if(!t||!r)return;const o=c.current,i=d.current,a=C-i;if(i>0&&0!==a)return e(Math.max(0,o+a)),void(d.current=C);const l=window.innerWidth-t.right+o,u=window.innerWidth-r.right,m=C-l;if(m>0){const t=Math.min(m,l-u);e(m-t+2*t)}else e(0);d.current=C})},[p,h,r,x,C,t]),{spaceOffset:a,scale:u,containerRef:n,contentRef:s}})(t,s);return(0,v.useEffect)(()=>{r?.(l,o)},[l,o,r]),(0,n.jsx)("div",{ref:i,style:{marginRight:o,transitionDuration:"0.2s",alignItems:"center"},children:(0,n.jsx)(A.A,{gap:d.kc,flexDirection:"column",overflow:"visible",children:(0,n.jsx)(it,{scale:l,ref:a,children:e})})})},ht=(0,r.A)(A.A)`
  flex-direction: column;
  justify-content: start;
  gap: ${d.kc};
`,xt=(0,r.A)(A.A)`
  gap: ${d.kc};
`,Et=(0,r.A)("div")`
  width: ${Y.Dq}px;
`,_t=(0,r.A)(A.A,(0,B.A)("isDiagramTopRowExpanded","hasPoeLabel"))`
  align-items: start;
  position: relative;
  min-width: ${d.xO};
  padding-top: ${({isDiagramTopRowExpanded:e,hasPoeLabel:t})=>(e?100:40)+(t?24:0)}px;
`,Ct=(0,r.A)(me.A)`
  transform: rotate(-90deg) translate(-50%, 0);
  transform-origin: left center;
  position: absolute;
  left: 0;
  width: max-content;
  && {
    max-width: 95px;
  }
`,gt=(0,v.memo)(({deviceMac:e,isFirst:t,showDeviceName:s})=>{const r=(0,b.d4)(Ce.Kh).get(e),{sharedScale:o,sharedOffset:i,setSharedScale:a,setSharedOffset:l,cachedScaleRef:c,cachedOffsetRef:d}=xe(),u=(0,b.d4)(w.OF),m=(0,v.useMemo)(()=>u.filter(t=>t.device.mac===e),[u,e]),p=(0,b.d4)(w.Hd),h=(0,b.d4)(w.pZ),x=(0,b.d4)(w.IP),E=(0,b.d4)(w.uq),_=(0,b.d4)(w.Qz),[C,g]=(0,v.useState)(""),[O,f]=(0,v.useState)(""),N=(0,v.useMemo)(()=>{if(!r?.model)return!1;const{diagram:e}=(0,_e.j)(r.model);return!!e},[r?.model]),S=(0,v.useMemo)(()=>{if(!r?.model)return(0,P.A)();const{diagram:e}=(0,_e.j)(r.model);if(!e)return(0,P.A)();const t=e.length?(0,Ee.sT)(e,r):(0,Ee.oJ)(r);if(!t)return(0,P.A)();const s=new Map(m.map(e=>[e.port_idx,e]));return t.map((e,t)=>(0,n.jsx)(xt,{children:e.map((e,r)=>{const o=`PortDiagramLayoutCell-${t+1}-${r+1}`,i=s.get(e?.portNumber);return i?(0,n.jsx)(st,{port:i,isFirstRow:0===t,hideOptionalElements:p,setTopConnectionMac:g,topConnectionMac:C,setTopConnectionMacWithPoe:f,topConnectionMacWithPoe:O,isFirstSelectedPortWan:h,isFirstSelectedPortManagement:x,isFirstSelectedPortInMcLag:E,isFirstSelectedPortInStackingLink:_},o):(0,n.jsx)(Et,{},o)})},`PortDiagramLayoutRow-${t+1}`))},[m,r,p,C,O,h,x,E,_]),T=(0,v.useCallback)((e,t)=>{o!==e&&a(e),i!==t&&l(t)},[o,i,a,l]);if(!N)return(0,n.jsx)(ge.A,{});if(0===m.length)return null;if(!S||0===S.length)return null;const M=(0,Ae.Q)({name:r?.name,model:r?.model,mac:r?.mac});return t?(0,n.jsx)(pt,{cachedScaleRef:c,cachedOffsetRef:d,onScaleOffsetChange:T,children:(0,n.jsxs)(A.A,{children:[s?(0,n.jsx)(_t,{isDiagramTopRowExpanded:C===e&&!p,hasPoeLabel:O===e&&!p,children:(0,n.jsx)(ue.A,{portal:!0,description:M,position:"top",noWrap:!0,children:(0,n.jsx)(Ct,{size:"small",color:"text-3",isTruncated:!0,children:M})})}):null,(0,n.jsx)(ht,{children:S})]})}):(0,n.jsx)(At,{scale:o,spaceOffset:i,children:(0,n.jsxs)(A.A,{children:[s?(0,n.jsx)(_t,{isDiagramTopRowExpanded:C===e&&!p,hasPoeLabel:O===e&&!p,children:(0,n.jsx)(ue.A,{portal:!0,description:M,position:"top",noWrap:!0,children:(0,n.jsx)(Ct,{size:"small",color:"text-3",isTruncated:!0,children:M})})}):null,(0,n.jsx)(ht,{children:S})]})})});var Ot=s(730095),ft=s(455425),Nt=s(222102),St=s(656466),Tt=s(401042),Mt=s(547617);const It=e=>(0,Nt.Mz)((e=>(0,St.uh)((0,Mt.R)(e)))(e),Tt.kh);var vt,bt=s(34087),jt=s(827360),Dt=s(68736);!function(e){e.ANOMALY="ANOMALY",e.DEVICE_CONNECTED="DEVICE_CONNECTED",e.DEVICE_DISCONNECTED="DEVICE_DISCONNECTED",e.CLIENT_CONNECTED="CLIENT_CONNECTED",e.CLIENT_DISCONNECTED="CLIENT_DISCONNECTED",e.INTERNET_CONNECTED="INTERNET_CONNECTED",e.INTERNET_DISCONNECTED="INTERNET_DISCONNECTED",e.NETWORK_OFFLINE="NETWORK_OFFLINE",e.NETWORK_UPDATED="NETWORK_UPDATED",e.DEVICE_OFFLINE="DEVICE_OFFLINE",e.POWER_CYCLE_TRIGGERED="POWER_CYCLE_TRIGGERED"}(vt||(vt={}));const Pt={[q.Q.CRITICAL]:jt.nS.ERROR,[q.Q.DEGRADED]:jt.nS.WARNING,[q.Q.NONE]:jt.nS.INFO},yt={[q.t.NETWORK_LOOP_DETECTED_BY_STP]:jt.Bx.LOOP,[q.t.NETWORK_LOOP_DETECTED_BY_KEEPALIVE]:jt.Bx.LOOP},kt=e=>e.external_id?`${e.type}-${e.external_id}`:`${e.type}-${e.timestamp}-${e.end_timestamp??e.timestamp}`,wt=(e,t)=>{const s={};return null!=e.anomaly_type&&(s.anomalyType=e.anomaly_type),null!=e.name&&(s.name=e.name),null!=e.port_idx&&(s.portIdx=e.port_idx),t&&e.deviceMac&&t[e.deviceMac]&&(s.deviceName=t[e.deviceMac]),s},Rt={[vt.DEVICE_CONNECTED]:{type:jt.Bx.DEVICE_CONNECTED,priority:jt.nS.INFO},[vt.DEVICE_DISCONNECTED]:{type:jt.Bx.DEVICE_DISCONNECTED,priority:jt.nS.NEUTRAL},[vt.CLIENT_CONNECTED]:{type:jt.Bx.CLIENT_CONNECTED,priority:jt.nS.INFO},[vt.CLIENT_DISCONNECTED]:{type:jt.Bx.CLIENT_DISCONNECTED,priority:jt.nS.NEUTRAL},[vt.INTERNET_CONNECTED]:{type:jt.Bx.INTERNET_CONNECTED,priority:jt.nS.SUCCESS},[vt.INTERNET_DISCONNECTED]:{type:jt.Bx.INTERNET_DISCONNECTED,priority:jt.nS.NEUTRAL},[vt.POWER_CYCLE_TRIGGERED]:{type:jt.Bx.POWER_CYCLE,priority:jt.nS.ACTION}},Lt=e=>e.external_id||`${e.timestamp}-${e.type}-${e.port_idx??""}`;var $t=s(653547),Ft=s(348185),Ut=s(79777),Vt=s(648552),Ht=s(166941);const Gt=[],zt=[],Wt=[],Bt=[],Kt=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w._h),s=(e=>{const t=(0,b.d4)(Ut.a),s=(0,v.useMemo)(()=>t[Vt.Uz],[t]),[n,r]=(0,v.useState)(Gt),o=(0,v.useMemo)(()=>JSON.stringify(e),[e]),i=(0,v.useCallback)((e,t)=>{const s=Array.isArray(e)?e:[e];0!==s.length&&r(e=>{const t=new Map;for(const s of e)t.set(Lt(s),s);for(const e of s)t.set(Lt(e),e);return Array.from(t.values())})},[]);return(0,v.useEffect)(()=>{const e=JSON.parse(o);if(s&&0!==e.length){for(const t of e)s.send((0,Ht.f)(Ft.E.PORTS_TIMELINE,!0,{device_mac:t}));return()=>{for(const t of e)s.send((0,Ht.f)(Ft.E.PORTS_TIMELINE,!1,{device_mac:t}))}}},[s,o]),(0,v.useEffect)(()=>{const e=(0,$t.K6)(Ft._.PORTS_TIMELINE_EVENT,i);return()=>(0,$t.$N)(e)},[i]),(0,v.useEffect)(()=>{r(Gt)},[o]),n})(t),n=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(s.length>0&&s.length!==n.current){n.current=s.length;const r=Date.now();for(const s of t)e((0,bt.N)(s,r-ft.jU,r))}},[e,t,s.length]);const r=(0,b.d4)(w.Kw),o=(0,v.useMemo)(()=>{if(0===t.length)return()=>Bt;if(1===t.length){const e=It(t[0]);return t=>e(t)}const e=t.map(e=>It(e));return(0,Nt.Mz)(e,(...e)=>{const s=[];for(let n=0;n<e.length;n+=1){const r=t[n],o=e[n];for(let e=0;e<o.length;e+=1)s.push({...o[e],deviceMac:r})}return s})},[t]),i=(0,b.d4)(o),{trackEvents:a,iconEvents:l}=(0,v.useMemo)(()=>{const e=((e,t)=>{if(0===t.length)return e;const s=new Map;for(const t of e)s.set(Lt(t),t);for(const e of t)s.has(Lt(e))||s.set(Lt(e),e);return Array.from(s.values())})(i,s);return 0===e.length?{trackEvents:zt,iconEvents:Wt}:((e,t)=>{const s=[],n=[],r=t?new Set:void 0;return e.forEach((e,o)=>{const i=`${e.type}-${e.timestamp}-${o}`,a=Rt[e.type];if(a){const{trackEvent:r,iconEvent:o}=(0,Dt.h)(i,a.type,a.priority,e.timestamp,wt(e,t));return s.push(r),void n.push(o)}switch(e.type){case vt.ANOMALY:{const r=(e=>{if(!e)return jt.nS.WARNING;const t=Q.g[e];return t?Pt[t]:jt.nS.WARNING})(e.anomaly_type),o=(l=e.anomaly_type)&&yt[l]||jt.Bx.WARNING,a=jt.Zn[o],{trackEvent:c,iconEvent:d}=(0,Dt.q)(i,o,r,e.timestamp,e.end_timestamp,wt(e,t),{openEnded:a});s.push(c),n.push(d);break}case vt.NETWORK_OFFLINE:case vt.DEVICE_OFFLINE:{if(e.type===vt.NETWORK_OFFLINE&&r){const t=kt(e);if(r.has(t))break;r.add(t)}const o=e.type===vt.NETWORK_OFFLINE?jt.Bx.NETWORK_OFFLINE:jt.Bx.DEVICE_OFFLINE,{trackEvent:a,iconEvent:l}=(0,Dt.q)(i,o,jt.nS.NEUTRAL,e.timestamp,e.end_timestamp,wt(e,t),{openEnded:!e.end_timestamp,pattern:"hatch"});s.push(a),n.push(l);break}case vt.NETWORK_UPDATED:{if(r){const t=kt(e);if(r.has(t))break;r.add(t)}const{trackEvent:o,iconEvent:a}=(0,Dt.q)(i,jt.Bx.NETWORK_UPDATED,jt.nS.INFO,e.timestamp,e.end_timestamp,wt(e,t));s.push(o),n.push(a);break}}var l}),{trackEvents:s,iconEvents:n}})(e,r)},[i,s,r]);return{trackEvents:a,iconEvents:l}},Yt=ft.vl/2,Xt=(0,v.memo)(()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.XI),s=(0,b.d4)(w.Hm),r=(0,b.d4)(w.aX),{trackEvents:o,iconEvents:i}=Kt(),a=r?Date.now()-r:void 0,l=(0,v.useRef)(0),c=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(c.current),[]);const d=(0,v.useCallback)(t=>{const s=Date.now(),n=s-l.current;clearTimeout(c.current),n>=Yt?(e((0,R.DH)(t)),l.current=s):c.current=setTimeout(()=>{e((0,R.DH)(t)),l.current=Date.now()},Yt-n)},[e]),u=(0,v.useCallback)(t=>{e((0,R.j$)(t))},[e]);return(0,n.jsx)(Ot.A,{selectedTimestamp:t,onTimestampSelect:d,isLive:s,onLiveChange:u,events:o,iconEvents:i,maxPastMs:a})});var Zt=s(286988);var qt=s(251905),Qt=s(177173);var Jt=s(271656),es=s(873247),ts=s(197571),ss=s(727337),ns=s(432180),rs=s(304151),os=s(645951),is=s(423564),as=s(883717),ls=s(170427),cs=s(16845),ds=s(430624),us=s(669439),ms=s(160286),As=s(461731),ps=s(874866),hs=s(167933),xs=s(68105);const Es=(0,r.A)(me.A)`
  max-width: 120px;
`,_s=({portNumber:e})=>{const t=(0,b.d4)(w.aq),s=(0,b.d4)(es.wD),r=(0,b.d4)(ps.D),o=(0,b.d4)(ms.D5),{portData:i,originalPortName:a}=(0,ss.E)(t,e,s),l=(0,b.d4)(ts.wf),c=(0,b.d4)(hs.pB),u=(0,b.d4)(As.G),m=(0,b.d4)(xs.qS),p=(0,$e.vT)(i,t,r,o,l,c,u,m),{wanProviderName:h,lastConnectionClient:x,lastConnectionDevice:E,isSomethingConnected:_}=(0,Oe.A)(p),C=h??(E?(0,Ae.Q)(E):(0,Se.tn)(x));return(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.YC,width:"100%",children:[(0,n.jsx)(A.A,{gap:d.kc,alignItems:"center",width:"100%",children:(0,n.jsxs)(me.A,{color:"inherit",weight:"bold",size:"inherit",isTruncated:!0,children:[e,a?` | ${a}`:""]})}),_?(0,n.jsxs)(A.A,{justifyContent:"space-between",gap:d.fS,alignItems:"center",children:[(0,n.jsx)(me.A,{color:"inherit",size:"small",style:{whiteSpace:"nowrap"},children:(0,n.jsx)(Z.sA,{id:"COMMON_CONNECTED_TO"})}),(0,n.jsxs)(A.A,{alignItems:"center",gap:d.YC,minWidth:0,children:[(0,n.jsx)(be.A,{size:20,connectedClient:x,connectedDevice:E,wanProviderName:h}),(0,n.jsx)(Es,{color:"inherit",size:"small",isTruncated:!0,children:C})]})]}):null]})};var Cs=s(45523);const gs=(0,r.A)(A.A,(0,B.A)("background","border"))`
  justify-content: center;
  width: ${38}px;
  height: ${38}px;
  border-radius: ${d.YC};
  border: 1px solid ${({border:e})=>e};
  background: ${({background:e})=>e};
  align-items: center;
`,Os=(0,v.memo)(({isTagged:e,isWanPort:t,isNative:s,portNumber:r,networkId:o,rowIndex:i,isDisabled:a})=>{const{themeName:l}=(0,G.u)(),{background:c,border:d,text:u}=(0,v.useMemo)(()=>{let n;switch(!0){case t:n=cs.vL.WAN;break;case a:n=cs.vL.DISABLED;break;case s:n=cs.vL.UNTAGGED_NATIVE;break;case e:n=cs.vL.TAGGED;break;default:n=cs.vL.BLOCKED}const{background:r,border:o,text:i}=Cs.k[n];return{background:r,border:o,text:i}},[t,a,s,e]);return(0,n.jsx)(us.A,{description:(0,n.jsx)(_s,{portNumber:r}),placement:0===i?"top":"bottom",delay:0,closeDelay:0,children:(0,n.jsx)(gs,{background:(0,$e.oX)(c,l),border:(0,$e.oX)(d,l),color:(0,$e.oX)(u,l),children:t?(0,n.jsx)(ds.A,{size:"original",color:(0,$e.oX)(u,l)}):null})},`${r}-${o}`)}),fs=(0,r.A)(A.A)`
  & > *:not(:last-child) {
    border-bottom: ${({theme:{themeName:e}})=>$.Ay[`desktop-border-divider-${e}`]};
  }
`,Ns=(0,r.A)(A.A)`
  &:not(:last-child) {
    padding-bottom: ${d.kc};
  }
  &:not(:first-child) {
    padding-top: ${d.kc};
  }
`,Ss=({network:e,rowLayouts:t,model:s,values:r,scale:o,spaceOffset:i})=>(0,n.jsx)(At,{scale:o,spaceOffset:i,children:(0,n.jsx)(nt,{children:(t||[]).map((t,o)=>(0,n.jsx)(rt,{children:t.map((t,i)=>{const a=`PortDiagramLayoutCell-${o+1}-${i+1}`;if(!t)return(0,n.jsx)(ot,{},a);const l=+(0,Ee.Cu)({port_idx:t.portNumber},s),c=r.taggedNetworks[l]?.[e._id];return c?(0,n.jsx)(Os,{isNative:c[cs.at.IS_NETWORK_NATIVE_ON_PORT],isWanPort:c[cs.at.IS_WAN_PORT],isTagged:c[cs.at.IS_TAGGED],isDisabled:c[cs.at.IS_DISABLED],portNumber:l,rowIndex:o,networkId:e._id},a):(0,n.jsx)(ot,{},a)})},`PortDiagramLayoutRow-${o+1}`))})}),Ts=({rowLayouts:e,model:t,values:s})=>{const{themeName:r}=(0,G.u)(),{formatMessage:o}=(0,Z.tz)(),{sharedScale:i,sharedOffset:a}=xe(),l=(0,b.d4)(ts.Tn).sort((e,t)=>(e.vlan??0)-(t.vlan??0)),[c,u]=(0,v.useState)(""),[m,p]=(0,v.useState)([]),h=(0,v.useMemo)(()=>l.map(e=>({id:e._id,vlan:e.vlan??0,name:e.name,subnet:(0,is.mC)(e)??"",label:e.name})),[l]),x=(0,v.useMemo)(()=>h.filter(({id:e,name:t,subnet:s,vlan:n})=>(t?.toLowerCase().includes(c.toLowerCase())||s?.toLowerCase().includes(c.toLowerCase())||n?.toString().toLowerCase().includes(c.toLowerCase()))&&!m.some(t=>t.id===e)),[h,m,c]),E=(0,v.useCallback)(e=>{if(m.some(({id:t})=>t===e))return;const t=h.find(({id:t})=>t===e);t&&p(e=>e.concat([{id:t.id,label:t.label}]))},[h,m]),_=(0,v.useCallback)(e=>{p(t=>t.filter(({id:t})=>t!==e))},[]);return(0,n.jsxs)(A.A,{flexDirection:"column",maxWidth:"100%",width:"100%",children:[(0,n.jsx)(lt,{children:(0,n.jsxs)(A.A,{gap:d.kc,width:"100%",flexWrap:"wrap",alignItems:"center",children:[(0,n.jsxs)(ct,{children:[(0,n.jsx)(F.A,{size:"medium",weight:"bold",color:"text-1",style:{whiteSpace:"nowrap"},children:(0,n.jsx)(Z.sA,{id:"PORTS_VLANS_SECTION_TITLE"})}),(0,n.jsx)(rs.A,{description:(0,n.jsx)(os.A,{messages:[["PORTS_VLANS_SECTION_TITLE_DESC_1"],["PORTS_VLANS_SECTION_TITLE_DESC_2"],["PORTS_VLANS_SECTION_TITLE_DESC_3"]]})})]}),(0,n.jsx)(ls.A,{description:(0,n.jsx)(Z.sA,{id:"COMMON_TAGGED"}),indicator:(0,n.jsx)(as.T,{color:(0,$e.oX)(Cs.k.TAGGED.background,r)})}),(0,n.jsx)(ls.A,{description:(0,n.jsx)(Z.sA,{id:"COMMON_BLOCKED"}),indicator:(0,n.jsx)(as.T,{color:(0,$e.oX)(Cs.k.BLOCKED.background,r)})}),(0,n.jsx)(ls.A,{description:(0,n.jsx)(Z.sA,{id:"COMMON_NATIVE"}),indicator:(0,n.jsx)(as.T,{color:(0,$e.oX)(Cs.k.UNTAGGED_NATIVE.background,r)})}),(0,n.jsx)(A.A,{flexGrow:1}),(0,n.jsx)(ns.A,{selectOnEnter:!0,value:c,tags:m,searchResults:x,onClear:(e,t)=>{u("")},onReset:()=>{u(""),p([])},onChange:(e,t)=>{u(t)},onAddTag:E,onRemoveTag:_,placeholder:m.length?"":o({id:"PORTS_VLANS_SECTION_SEARCH"}),maxResultsHeight:300})]})}),(0,n.jsx)(at,{children:(0,n.jsx)(fs,{flexDirection:"column",children:l.filter(e=>!m.length||m.map(e=>e.id).includes(e._id)).map(r=>(0,n.jsxs)(Ns,{flexDirection:"column",gap:d.YC,children:[(0,n.jsxs)(A.A,{justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(F.A,{size:"medium",color:"text-2",children:(0,is.gm)(r)}),(0,n.jsx)(F.A,{size:"medium",color:"text-3",children:(0,is.mC)(r)})]}),(0,n.jsx)(Ss,{network:r,rowLayouts:e,model:t,values:s,scale:i,spaceOffset:a})]},r._id))})})]})},Ms=(0,r.A)(A.A,(0,B.A)("background","border"))`
  position: relative;
  justify-content: center;
  width: ${38}px;
  height: ${38}px;
  border-radius: ${d.YC};
  border: 1px solid ${({border:e})=>e};
  background: ${({background:e})=>e};
  align-items: center;
`,Is=(0,v.memo)(({nativeNetworkVlanId:e,isWanPort:t,portNumber:s,rowIndex:r})=>{const{themeName:o}=(0,G.u)(),{background:i,border:a,text:l}=t?Cs.k[cs.vL.WAN]:Cs.k[cs.vL.NATIVE];return(0,n.jsx)(us.A,{description:(0,n.jsx)(_s,{portNumber:s}),placement:0===r?"top":"bottom",delay:0,closeDelay:0,children:(0,n.jsx)(Ms,{background:(0,$e.oX)(i,o),border:(0,$e.oX)(a,o),children:t?(0,n.jsx)(ds.A,{size:"original",color:(0,$e.oX)(l,o)}):(0,n.jsx)(F.A,{size:"small",color:"text-1",children:e})})},`${s}-${r}`)}),vs=({rowLayouts:e,model:t,values:s})=>{const{sharedScale:r,sharedOffset:o}=xe();return(0,n.jsxs)(A.A,{flexDirection:"column",maxWidth:"100%",width:"100%",children:[(0,n.jsx)(lt,{children:(0,n.jsxs)(ct,{children:[(0,n.jsx)(F.A,{size:"medium",weight:"bold",color:"text-1",style:{whiteSpace:"nowrap"},children:(0,n.jsx)(Z.sA,{id:"PORTS_VLANS_NATIVE_TITLE"})}),(0,n.jsx)(rs.A,{description:(0,n.jsx)(os.A,{messages:[["PORTS_VLANS_NATIVE_TITLE_DESC_1"],["PORTS_VLANS_NATIVE_TITLE_DESC_2"]]})})]})}),(0,n.jsx)(at,{children:(0,n.jsx)(At,{scale:r,spaceOffset:o,children:(0,n.jsx)(nt,{children:(e||[]).map((e,r)=>(0,n.jsx)(rt,{children:e.map((e,o)=>{const i=`PortDiagramLayoutCell-${r+1}-${o+1}`;if(!e)return(0,n.jsx)(ot,{},i);const a=+(0,Ee.Cu)({port_idx:e.portNumber},t),l=s.nativeNetwork[a];return l?(0,n.jsx)(Is,{isWanPort:l[cs.dv.IS_WAN_PORT],nativeNetworkVlanId:l[cs.dv.DISPLAYED_VLAN_ID],isDisabled:l[cs.dv.IS_DISABLED],portNumber:a,rowIndex:r},i):(0,n.jsx)(ot,{},i)})},`PortDiagramLayoutRow-${r+1}`))})})})]})},bs=(0,r.A)(A.A,(0,B.A)("isNarrow"))`
  flex-direction: column;
  gap: ${d.kc};
  padding-bottom: 3px;
  min-width: ${440}px;
  width: 100%;
  align-items: center;
  align-self: ${({isNarrow:e})=>e?"start":"center"};
`,js=()=>{const[e,t]=(0,v.useState)(!1),s=(0,v.useRef)(null),r=(0,b.d4)(w.w2),o=(0,b.d4)(Ce.ID),i=(0,b.d4)(w.jv),a=(0,b.d4)(w.Sg),l=(0,v.useMemo)(()=>r[0]?o.find(e=>e.mac===r[0])??(0,Jt.A)():(0,Jt.A)(),[r,o]),c=(0,v.useMemo)(()=>{if(!i||0===a.length)return l;const e=a.find(e=>e.mac===r[0]);return e?((e,t)=>({...t,port_table:e.ports,ethernet_overrides:e.ethernet_overrides,model:e.model,name:e.name,type:e.type,mac:e.mac}))(e,l):l},[i,a,l,r]),d=c?.model,u=d?(0,_e.j)(d).diagram??[]:[],m=(0,b.d4)(es.wD),A=(0,b.d4)(ts.Tn),p=(0,b.d4)(ts.nT)?._id,h=(0,v.useMemo)(()=>(0,ss.Np)(c,m,A,p),[p,c,A,m]),x=u.length?(0,Ee.sT)(u,c):(0,Ee.oJ)(c);return(0,v.useEffect)(()=>{const e=s.current;if(!e)return;const n=new ResizeObserver(e=>{const[s]=e,{width:n}=s.contentRect;t(n<=440)});return n.observe(e),()=>{n.disconnect()}},[]),(0,n.jsx)(bs,{ref:s,isNarrow:e,flexDirection:"column",paddingBottom:3,minWidth:440,width:"100%",alignItems:"center",children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(vs,{rowLayouts:x,model:d,values:h}),(0,n.jsx)(Ts,{rowLayouts:x,model:d,values:h})]}):null})};var Ds=s(490820),Ps=s(587389),ys=s(409844),ks=s(396489),ws=s.n(ks),Rs=s(722837),Ls=s(567082),$s=s(591917),Fs=s(83570),Us=s(579875),Vs=s(703842),Hs=s(588497),Gs=s(963945),zs=s(367828),Ws=s(897166),Bs=s(94411),Ks=s(54013),Ys=s(332530),Xs=s(729736),Zs=s(17211),qs=s(570866),Qs=s(882355);const Js=["","k","M","G","T","P","E","Z","Y"],en=e=>e>=J.A.XXL.TO?25:e>=J.A.L.TO?13:e>=J.A.M.TO?7:4,tn={[Qs.l.ONE_DAY]:{frequency:en,label:({index:e,value:t,selfUse24HourTime:s,selfHourCycle:n,documentWidth:r,siteTimezone:o,language:i,formatMessage:a})=>e!==en(r)-1?new Intl.DateTimeFormat(i,{hourCycle:n,hour:"numeric",timeZone:o,...s&&{minute:"numeric"}}).format(t).toUpperCase():a({id:"COMMON_NOW"})},[Qs.l.ONE_WEEK]:{frequency:()=>7,label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{weekday:"short"}).format(e)},[Qs.l.ONE_MONTH]:{frequency:(e,t)=>Math.ceil(t/(e>=J.A.XL.TO?1:e>=J.A.M.TO?2:4)),label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)},[Qs.j]:{frequency:()=>10,label:({value:e,selfHourCycle:t,siteTimezone:s,language:n})=>new Intl.DateTimeFormat(n,{hourCycle:t,month:"short",day:"numeric",hour:"numeric",minute:"numeric",timeZone:s}).format(e).replace(qs.sO,e=>e.toUpperCase())}};class sn extends Xs.Un{constructor(e,t){super(e,"bytes","SI",t),this.unit=`${Js[this.power]}W`}toString(){return Number.isFinite(this.bytes)?((e,t)=>{const s=Math.abs(e);return s<10?`${e.toFixed(2)} ${t}`:s<100?`${e.toFixed(1)} ${t}`:`${e.toFixed(0)} ${t}`})(this.value,this.unit):""}}class nn extends Xs.Un{constructor(e,t){super(e,"bytes","SI",t),this.unit=`${Js[this.power]}Pkts`}}class rn extends Xs.Un{constructor(e,t){super(e,"bytes","SI",t),this.unit=`${Js[this.power]}Wh`}}const on=e=>(t,s)=>{const{source:n,usage:r}=e;switch(n){case Hs.I0.PACKETS:case Hs.I0.ERRORS:case Hs.I0.DROPPED:return new nn(t,s);case Hs.I0.POE:return new sn(t,s);case Hs.I0.USAGE:return r===Hs.AM.BPS?(0,Xs.cS)(t,"bitrate","SI",s):(0,Xs.cS)(t,void 0,void 0,s);default:return(0,Xs.cS)(t,void 0,void 0,s)}},an=()=>{const e=(0,b.wA)(),{themeName:t}=(0,G.u)(),s=(0,b.d4)(w.zD),n=(0,v.useMemo)(()=>(e=>[$.Ay[`desktop-color-navy-06-${e}`],$.Ay[`desktop-color-navy-04-${e}`],$.Ay[`desktop-color-aqua-04-${e}`],$.Ay[`desktop-color-green-04-${e}`],$.Ay[`desktop-color-green-06-${e}`],$.Ay[`desktop-color-green-08-${e}`],$.Ay[`desktop-color-lime-06-${e}`],$.Ay[`desktop-color-yellow-06-${e}`],$.Ay[`desktop-color-purple-06-${e}`],$.Ay[`desktop-color-yellow-09-${e}`],$.Ay[`desktop-color-lime-07-${e}`],$.Ay[`desktop-color-aqua-06-${e}`],$.Ay[`desktop-color-green-09-${e}`],$.Ay[`desktop-color-navy-05-${e}`],$.Ay[`desktop-color-green-05-${e}`],$.Ay[`desktop-color-lime-09-${e}`],$.Ay[`desktop-color-ublue-05-${e}`],$.Ay[`desktop-color-purple-04-${e}`],$.Ay[`desktop-color-yellow-07-${e}`],$.Ay[`desktop-color-ublue-04-${e}`],$.Ay[`desktop-color-ublue-06-${e}`],$.Ay[`desktop-color-lime-05-${e}`],$.Ay[`desktop-color-ublue-09-${e}`],$.Ay[`desktop-color-lime-04-${e}`],$.Ay[`desktop-color-navy-09-${e}`],$.Ay[`desktop-color-orange-07-${e}`],$.Ay[`desktop-color-green-10-${e}`],$.Ay[`desktop-color-yellow-04-${e}`],$.Ay[`desktop-color-ublue-08-${e}`],$.Ay[`desktop-color-purple-05-${e}`],$.Ay[`desktop-color-orange-09-${e}`],$.Ay[`desktop-color-lime-08-${e}`],$.Ay[`desktop-color-ublue-10-${e}`],$.Ay[`desktop-color-orange-06-${e}`],$.Ay[`desktop-color-aqua-09-${e}`],$.Ay[`desktop-color-yellow-05-${e}`],$.Ay[`desktop-color-orange-05-${e}`],$.Ay[`desktop-color-purple-07-${e}`],$.Ay[`desktop-color-navy-08-${e}`],$.Ay[`desktop-color-purple-08-${e}`],$.Ay[`desktop-color-aqua-08-${e}`],$.Ay[`desktop-color-orange-08-${e}`],$.Ay[`desktop-color-orange-10-${e}`],$.Ay[`desktop-color-green-07-${e}`],$.Ay[`desktop-color-navy-07-${e}`],$.Ay[`desktop-color-aqua-07-${e}`],$.Ay[`desktop-color-navy-10-${e}`],$.Ay[`desktop-color-orange-04-${e}`],$.Ay[`desktop-color-aqua-05-${e}`],$.Ay[`desktop-color-aqua-10-${e}`],$.Ay[`desktop-color-ublue-07-${e}`],$.Ay[`desktop-color-yellow-08-${e}`],$.Ay[`desktop-color-yellow-10-${e}`]])(t),[t]),r=(0,v.useCallback)(t=>{const r={...s};t.forEach(e=>{r[e]=(0,$e.O)(e,t,r,n),Object.keys(r).forEach(t=>{r[t]===r[e]&&t!==e&&delete r[t]})}),e((0,R.Ao)(t)),e((0,R.hl)(r))},[s,e,n]);return(0,v.useMemo)(()=>({setSelectedPortsAndAssignColors:r}),[r])};var ln=s(594005),cn=s(64222),dn=s(43210),un=s(265799),mn=s(693714),An=s(48282),pn=s(407440),hn=s(229674),xn=s(398839),En=s(56809),_n=s(988135),Cn=s(820633);const gn=({sfp_voltage:e})=>{const t=(0,b.d4)(Cn.zi),s=(0,En.b)(e),r=(0,_n.L)(s||0,t,3);return(0,n.jsx)(xn.cp,{value:(0,n.jsx)(Z.sA,{id:s?"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE":"COMMON_FALLBACK",values:{voltage:r}})})},On=["UBNT","Ubiquiti","UbiquitiNetworks"],fn=({sfp_vendor:e})=>{const t=On.includes(s=e)?"Ubiquiti Inc.":s;var s;return(0,n.jsx)(xn.cp,{value:t})},Nn=({sfp_temperature:e})=>{const t=(0,b.d4)(Cn.zi),s=(0,En.b)(e),r=(0,_n.L)(s||0,t,3);return(0,n.jsx)(xn.cp,{value:(0,n.jsx)(Z.sA,{id:s?"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE":"COMMON_FALLBACK",values:{temperature:r}})})},Sn=({io_power:e})=>{const t=(0,b.d4)(Cn.zi),s=(0,En.b)(e),r=(0,_n.L)(s||0,t,3);return(0,n.jsx)(xn.cp,{value:(0,n.jsx)(Z.sA,{id:s?"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER":"COMMON_FALLBACK",values:{power:r}})})},Tn=({sfp_current:e})=>{const t=(0,b.d4)(Cn.zi),s=(0,En.b)(e),r=(0,_n.L)(s||0,t,3);return(0,n.jsx)(xn.cp,{value:(0,n.jsx)(Z.sA,{id:s?"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT":"COMMON_FALLBACK",values:{current:r}})})},Mn=['No SFP Inserted"',"Unknown"],In=e=>Mn.includes(e)?void 0:e,vn=({sfp_compliance:e})=>(0,n.jsx)(xn.cp,{value:In(e)}),bn=e=>[{id:dn.d1.PORT,accessorFn:ln.Fo,maxSize:e?void 0:un.ve,...e?dn.sP[dn.d1.PORT]:{size:un.ve},header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.PORT]}),cell:({row:{original:t}})=>(0,n.jsx)(pn.A,{port:t,isInteractive:!1,showDevice:e}),compare:hn.o$},{id:dn.d1.NAME,accessorFn:ln.Fo,...dn.sP[dn.d1.NAME],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.NAME]}),cell:({row:{original:e}})=>(0,n.jsx)(xn.cp,{value:e.name,color:e.color}),compare:(0,ln.l0)(({name:e})=>e)},hn.QW,{id:dn.d1.NATIVE_VLAN,accessorFn:ln.Fo,...dn.sP[dn.d1.NATIVE_VLAN],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.NATIVE_VLAN]}),cell:({row:{original:e}})=>(0,n.jsx)(An.A,{nativeNetworkConfIdSubstituted:e.nativeNetworkConfIdSubstituted}),compare:(0,ln.l0)(({nativeNetworkConfIdSubstituted:e})=>e===cn.F?-1/0:e)},{id:dn.d1.SPEED,accessorFn:ln.Fo,...dn.sP[dn.d1.SPEED],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.SPEED]}),cell:({row:{original:e}})=>(0,n.jsx)(mn.A,{speed:e.speed,autoneg:e.autoneg,up:e.up}),compare:(0,ln.l0)(({speed:e})=>e)},{id:dn.d1.VENDOR,accessorFn:ln.Fo,...dn.sP[dn.d1.VENDOR],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.VENDOR]}),cell:({row:{original:e}})=>(0,n.jsx)(fn,{sfp_vendor:e.sfp_vendor||void 0}),compare:(0,ln.l0)(({sfp_vendor:e})=>e)},{id:dn.d1.SERIAL,accessorFn:ln.Fo,...dn.sP[dn.d1.SERIAL],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.SERIAL]}),cell:({row:{original:e}})=>(0,n.jsx)(xn.cp,{value:e.sfp_serial||void 0}),compare:(0,ln.l0)(({sfp_serial:e})=>e)},{id:dn.d1.PART_NUMBER,accessorFn:ln.Fo,...dn.sP[dn.d1.PART_NUMBER],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.PART_NUMBER]}),cell:({row:{original:e}})=>(0,n.jsx)(xn.cp,{value:e.sfp_part||void 0}),compare:(0,ln.l0)(({sfp_part:e})=>e)},{id:dn.d1.COMPLIANCE,accessorFn:ln.Fo,...dn.sP[dn.d1.COMPLIANCE],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.COMPLIANCE]}),cell:({row:{original:e}})=>(0,n.jsx)(vn,{sfp_compliance:e.sfp_compliance||void 0}),compare:(0,ln.l0)(({sfp_compliance:e})=>In(e||void 0))},{id:dn.d1.TEMPERATURE,accessorFn:ln.Fo,...dn.sP[dn.d1.TEMPERATURE],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.TEMPERATURE]}),cell:({row:{original:e}})=>(0,n.jsx)(Nn,{sfp_temperature:e.sfp_temperature}),compare:(0,ln.l0)(({sfp_temperature:e})=>e)},{id:dn.d1.OUTPUT_POWER,accessorFn:ln.Fo,...dn.sP[dn.d1.OUTPUT_POWER],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.OUTPUT_POWER]}),cell:({row:{original:e}})=>(0,n.jsx)(Sn,{io_power:e.sfp_txpower}),compare:(0,ln.l0)(({sfp_txpower:e})=>e)},{id:dn.d1.INPUT_POWER,accessorFn:ln.Fo,...dn.sP[dn.d1.INPUT_POWER],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.INPUT_POWER]}),cell:({row:{original:e}})=>(0,n.jsx)(Sn,{io_power:e.sfp_rxpower}),compare:(0,ln.l0)(({sfp_rxpower:e})=>e)},{id:dn.d1.VOLTAGE,accessorFn:ln.Fo,...dn.sP[dn.d1.VOLTAGE],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.VOLTAGE]}),cell:({row:{original:e}})=>(0,n.jsx)(gn,{sfp_voltage:e.sfp_voltage}),compare:(0,ln.l0)(({sfp_voltage:e})=>e)},{id:dn.d1.CURRENT,accessorFn:ln.Fo,...dn.sP[dn.d1.CURRENT],header:()=>(0,n.jsx)(Z.sA,{id:dn.Cz[dn.d1.CURRENT]}),cell:({row:{original:e}})=>(0,n.jsx)(Tn,{sfp_current:e.sfp_current}),compare:(0,ln.l0)(({sfp_current:e})=>e)}];var jn=s(599110),Dn=s(250266),Pn=s(255045),yn=s(262984),kn=s(434521);const wn=(0,r.A)("div")`
  position: absolute;
  top: -${d.xO};
  bottom: -${d.xO};
  left: calc(100% - 400px); /* The restart confirm dialog width */
  right: 0;
`,Rn=(0,r.A)("div")`
  z-index: 1;
`,Ln=(0,v.memo)(({port:e})=>{const{port_idx:t,device:s}=e,{mac:r,name:o}=s,i=(0,b.wA)(),a=(0,b.d4)(w.qq),{resetPortStatistics:l}=(0,yn.X)(),c=a.some(e=>e.includeDevices?.includes(r)),u=!e.states.includes(Pn.Vd.MANAGEMENT)&&(0,$e.cd)(s.switch_caps?.feature_caps,s.deviceState),m=(0,$e.ug)(e),p=(0,$e.CQ)(e),[h,x]=(0,v.useState)(!1),E=(0,b.d4)((0,w.JX)(t,r)),[_,C]=(0,v.useState)(E),g=(0,v.useCallback)(()=>{i((0,T.Fx)({mac:r,name:o},t))},[i,r,o,t]),O=(0,v.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),C(!_),i((0,T.cj)({mac:r,name:s.name},[t],_))},[s.name,i,_,r,t]),f=(0,v.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),x(!0)},[]),N=(0,kn.wk)(s.deviceState),S=(0,v.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),l(r,t,p,N)},[r,t,l,p,N]);return(0,v.useEffect)(()=>{C(E)},[E]),u||m||c?(0,n.jsxs)(A.A,{padding:d.YC,gap:d.kc,position:"relative",onMouseLeave:h?()=>x(!1):void 0,children:[m?(0,n.jsx)(Rn,{children:(0,n.jsx)(Dn.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:t},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:x,handleConfirm:g,isOpen:h,rootClose:!0,body:(0,n.jsx)(F.A,{size:"inherit",children:(0,n.jsx)(Z.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:t}})}),children:(0,n.jsx)(A.A,{alignItems:"center",children:(0,n.jsx)(jn.A,{variant:"inline",onClick:f,type:"button",size:"medium",children:(0,n.jsx)(Z.sA,{id:"COMMON_POWER_CYCLE"})})})})}):null,u?(0,n.jsx)(Rn,{children:(0,n.jsx)(jn.A,{variant:"inline",onClick:O,type:"button",size:"medium",children:(0,n.jsx)(Z.sA,{id:_?"DEVICE_ACTIONS_LOCATE_STOP":"DEVICE_ACTIONS_LOCATE"})})}):null,c?(0,n.jsx)(Rn,{children:(0,n.jsx)(jn.A,{variant:"inline",onClick:S,type:"button",size:"medium",children:(0,n.jsx)(Z.sA,{id:"COMMON_RESET_STATISTICS"})})}):null,h?(0,n.jsx)(wn,{}):null]}):null}),$n=e=>({})=>(0,n.jsx)(Ln,{port:e});var Fn;!function(e){e.CLASSIC="CLASSIC",e.SFP_ANALYZER="SFP_ANALYZER"}(Fn||(Fn={}));var Un=s(227170),Vn=s(943126),Hn=s(427724);const Gn=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.t),s=(0,b.d4)(w.EW),n=(0,v.useCallback)(()=>{e((0,R.Ao)([]));const t=(0,Vn.A)(Qt.Fs);e((0,R.Ff)(t))},[e]),r=(0,v.useMemo)(()=>(0,Hn.Kn)(t),[t]),o=(0,v.useMemo)(()=>(0,qt.Ac)(s),[s]),i=(0,v.useMemo)(()=>r&&o,[r,o]);return(0,v.useMemo)(()=>({areFiltersInitial:i,resetPortsFilters:n}),[i,n])},zn=({allPortsCount:e})=>{const{resetPortsFilters:t}=Gn(),s=(0,v.useMemo)(()=>(0,n.jsx)(Un.A,e?{title:(0,n.jsx)(Z.sA,{id:"COMMON_NO_MATCH"}),description:(0,n.jsx)(Z.sA,{id:"PORTS_EMPTY_FILTER_NO_PORTS_DETAILS",values:{button:(0,n.jsx)(jn.A,{type:"button",variant:"inline",onClick:t,children:(0,n.jsx)(Z.sA,{id:"COMMON_RESET_THEM_BUTTON_TEXT"})})}})}:{title:(0,n.jsx)(Z.sA,{id:"PORTS_TABLE_EMPTY_HEADER"})}),[e,t]);return(0,n.jsx)(A.A,{width:"100%",flexDirection:"column",children:s})},Wn=ys.AH`
  div:has(> * > * > .${Vs.k}) {
    overflow: visible;
  }
`,Bn=(0,r.A)(A.A)`
  height: 100%;
  min-height: 400px;
  width: 100%;
  overflow: hidden;
  flex-direction: column;
  flex-grow: 1;
`,Kn=ys.AH`
  overflow-x: scroll;
`,Yn={height:"unset",padding:"0",overflow:"unset"},Xn=Ys.W2[Ks.xz.TABLES][Rs.l.PORTS].columns,Zn=(0,w.IS)([]),qn=new Set(Ds.qq),Qn=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<t.length;s+=1){const n=e[s],r=t[s];if(n!==r){if(n.id!==r.id)return!1;for(const e of Object.keys(r))if(!qn.has(e)){if("last_connection"===e){const e=n.last_connection,t=r.last_connection;if(e?.mac!==t?.mac||e?.connected!==t?.connected)return!1;continue}if((null!=n[e]||null!=r[e])&&!ws()(n[e],r[e]))return!1}}}return!0},Jn=(0,v.memo)(()=>{const e=(0,b.wA)(),t=(0,G.u)(),{formatMessage:s}=(0,Z.tz)(),r=(0,b.d4)(w.ZN),o=(0,b.d4)(w.vR),i=(0,b.d4)(w.UH),a=(0,b.d4)(w.O2),l=(0,b.d4)(w.cW),c=(0,b.d4)(w.yZ),u=(0,b.d4)(w.hb),{initialColumns:m}=(0,Bs.A)(Rs.l.PORTS),A=(0,b.d4)(w.TP),p=(0,b.d4)(w.X5),h=(0,b.d4)(w.zD),x=(0,b.d4)(Ws.EL),E=(0,b.d4)(w.XS),_=(0,b.d4)(w.QR),C=(0,b.d4)(Zn,Qn),{setSelectedPortsAndAssignColors:g}=an(),O=(0,Gs.D)()===zs.o.SFP_ANALYZER,f=O?Fn.SFP_ANALYZER:Fn.CLASSIC,N=(0,b.d4)(w.x4),S=(0,b.d4)(ps.D),T=(0,v.useMemo)(()=>{const e=S.find(e=>e.stacking&&e.peers.bottom===N||e.stacking&&e.peers.top===N);return e?.peers.top===N?e?.peers.bottom:e?.peers.top},[S,N]),[M,I]=(0,$s.A)(f===Fn.CLASSIC?Rs.l.PORTS:Rs.l.SFP_PORTS),[j,D]=(0,Ls.A)(O?Rs.l.SFP_PORTS:Rs.l.PORTS),P=(0,v.useMemo)(()=>{if(x)return null;const e=new Map;for(const t of C)e.set(t.id,$n(t));return e},[C,x]),y=(0,v.useMemo)(()=>{if(_)return C.map(e=>({...e,color:p.mode===Hs.Mz.BY_PORT&&a.has(e.id)?h[e.id]:void 0,disabled:!1,_rowHoverContent:P?.get(e.id)}));const e=new Set(u.selectablePortsSingleSelection||[]);return C.map(t=>{const s=a.has(t.id),n=e.has(t.id),r=!(t.device.mac===N)&&!(t.device.mac===T)&&Boolean(N);return{...t,color:void 0,disabled:!s&&!n||r||E,_rowHoverContent:P?.get(t.id)}})},[_,C,p.mode,a,h,N,P,u.selectablePortsSingleSelection,T,E]),k=(0,v.useCallback)(t=>{_?g(t):e((0,R.Ao)(t))},[_,g,e]),L=(0,v.useCallback)(t=>{t.disabled||(_?g([t.id]):e((0,R.Ao)((0,$e.Um)(t.id))))},[_,g,e]),$=(0,v.useMemo)(()=>{const e=Xn.reduce((e,t)=>(e[t]=m.includes(t),e),{});return l||un.lj.forEach(t=>{e[t]=!1}),c||un.v0.forEach(t=>{e[t]=!1}),e},[l,c,m]),F=(0,v.useCallback)(t=>{e((0,R.DE)(t))},[e]),U=(0,v.useMemo)(()=>(0,hn.oE)(t,s,A),[t,s,A]),V=(0,v.useMemo)(()=>bn(A),[A]),H=(0,v.useRef)(null),z=(0,v.useCallback)(({rowsPerPage:e,pageNumber:t})=>(0,n.jsx)(Ps.A,{ref:H,columns:f===Fn.CLASSIC?U:V,columnVisibility:f===Fn.CLASSIC?$:void 0,data:m?.length?y:[],initialColumnSize:M,onColumnSizingChange:I,multiSelectMode:!0,onChangeSelection:k,onRowClick:L,enableRowSelection:e=>!e.disabled,selection:i,isSelectAllVisible:_,rowStyle:d.gc,onSort:D,sorting:j,rowDisabledClassName:"",pageIndex:t,pageSize:e,className:`${Fs.E} ${Wn}`,withOverflow:!0,virtualizeColumn:!0,overscanColumn:1},f===Fn.CLASSIC?`ports-${A}`:"sfp"),[f,A,U,V,$,m?.length,y,M,I,k,L,i,_,D,j]);return Boolean(C.length&&m?.length)?(0,n.jsx)(Us.A,{itemCount:C.length,tableType:Rs.l.SFP_PORTS,onRenderTable:z,onPageChanged:F,rowOptions:un.j8,pageNumber:o,wrapperFlexProps:Yn,paginationTableContainerClassName:Kn}):(0,n.jsxs)(Bn,{children:[(0,n.jsx)(Ps.A,{data:[],columns:U,columnVisibility:$,tableHeight:"auto",className:Fs.E,multiSelectMode:!0,isSelectAllVisible:!1},`ports-empty-${A}`),(0,n.jsx)(zn,{allPortsCount:r})]})});var er=s(430328),tr=s(733360),sr=s(585565),nr=s(415466),rr=s(358248),or=s(416233),ir=s(627056);const ar=(0,Nt.Mz)(w._h,Ws.vc,(e,t)=>e.includes(t)),lr=(0,er.WY)((e,t)=>e.lastFetchTime===t.lastFetchTime||null===t.lastFetchTime)((0,Nt.Mz)(rr.Od,w.Ky,w._h,(e,t,s)=>{const n={data:{attrs:or.$r,start:t.startDate.getTime(),end:t.endDate.getTime(),macs:s}};return(0,St.JC)(rr.Pd,e,n)}),e=>e),cr=(0,er.WY)((e,t)=>e.lastFetchTime===t.lastFetchTime||null===t.lastFetchTime)((0,Nt.Mz)(rr.yN,w.Ky,w._h,(e,t,s)=>{const n={data:{attrs:or.Tj,start:t.startDate.getTime(),end:t.endDate.getTime(),macs:s}};return(0,St.JC)(rr.Zk,e,n)}),e=>e),dr=(0,Nt.Mz)(lr,Tt.kh),ur=(0,Nt.Mz)(cr,Tt.kh),mr=/(\d+)-(.+)/,Ar=(0,Nt.Mz)(dr,ur,w.UH,ar,nr.BG,w.QR,(e,t,s,n,r,o)=>{if(!s||0===s.length||!o)return[];const i=new Set(s),a=n?r.filter(e=>e.port_info?.port_idx).sort((e,t)=>e.id.localeCompare(t.id)):[],l=new Map;n&&t.length>0&&t.forEach((t,s)=>{if(!t)return;const n=e[s]?.oid;if(!n)return;const r={};a.forEach(({id:e,port_info:{port_idx:s}})=>{const o=(0,k.FS)(n,s);if(!i.has(o))return;const a=(0,sr.X)(e);ir.M6.forEach(e=>{const s=t[`${a}-${e}`];null!=s&&(r[e]=(r[e]||0)+s)})}),l.set(s,r)});const c=new Map,d=new Map;e.forEach((e,t)=>{const s=e.oid,n=e.time;d.has(n)||d.set(n,e.duration);let r=c.get(n);r||(r={timestamp:n,tx_bytes:0,rx_bytes:0,tx_rate:0,rx_rate:0,tx_packets:0,rx_packets:0,tx_broadcast:0,rx_broadcast:0,tx_multicast:0,rx_multicast:0,tx_dropped:0,rx_dropped:0,tx_errors:0,rx_errors:0,poe_power:0,poe_energy:0},c.set(n,r)),Object.keys(e).forEach(t=>{const n=t.match(mr);if(n){const[,o,a]=n,l=(0,k.FS)(s,+o);i.has(l)&&void 0!==r[a]&&(r[a]+=e[t])}});const o=l.get(t);o&&ir.M6.forEach(e=>{void 0!==o[e]&&(r[e]+=o[e])})});const u=[];return c.forEach((e,t)=>{const s=d.get(t)||0;u.push({...e,tx_rate:(0,Zs.tI)(e.tx_bytes,s),rx_rate:(0,Zs.tI)(e.rx_bytes,s),poe_energy:e.poe_power*s/ft.$_})}),u.sort((e,t)=>e.timestamp-t.timestamp),u}),pr=(0,Nt.Mz)(Ar,e=>{const t=(e,t)=>e.reduce((e,s)=>(s[t]||0)+e,0);return{tx_bytes:t(e,"tx_bytes"),rx_bytes:t(e,"rx_bytes"),tx_rate:t(e,"tx_rate")/(e.length||1),rx_rate:t(e,"rx_rate")/(e.length||1),tx_packets:t(e,"tx_packets"),rx_packets:t(e,"rx_packets"),tx_broadcast:t(e,"tx_broadcast"),rx_broadcast:t(e,"rx_broadcast"),tx_multicast:t(e,"tx_multicast"),rx_multicast:t(e,"rx_multicast"),poe_power:t(e,"poe_power")/(e.length||1),poe_energy:t(e,"poe_energy"),tx_errors:t(e,"tx_errors"),rx_errors:t(e,"rx_errors"),tx_dropped:t(e,"tx_dropped"),rx_dropped:t(e,"rx_dropped")}}),hr=(0,Nt.Mz)(dr,ur,w.UH,w.X5,ar,nr.nB,w.QR,(e,t,s,n,r,o,i)=>{if(!s||0===s.length||!i)return[];const a=(e=>{const t=(e=>{let t="";return e.source===Hs.I0.USAGE&&(e.usage===Hs.AM.BPS&&(t="rate"),e.usage===Hs.AM.BYTES&&(t="bytes")),e.source===Hs.I0.PACKETS&&(e.packets===Hs.uO.ALL&&(t="packets"),e.packets===Hs.uO.BROADCAST&&(t="broadcast"),e.packets===Hs.uO.MULTICAST&&(t="multicast")),t})(e);return(s,n,r)=>{const o="number"==typeof n?`port_${n}`:`wan${n}`;if(e.source===Hs.I0.USAGE&&e.usage===Hs.AM.BPS){const t=s[`${o}-tx_bytes`]||0,n=s[`${o}-rx_bytes`]||0;if(!r)return 0;if(e.direction===Hs.O_.ALL)return(0,Zs.tI)(t+n,r);if(e.direction===Hs.O_.UPLINK)return(0,Zs.tI)(t,r);if(e.direction===Hs.O_.DOWNLINK)return(0,Zs.tI)(n,r)}if(e.source===Hs.I0.POE)return s[`${o}-poe_power`]||0;if(e.source===Hs.I0.ERRORS){const t=s[`${o}-tx_errors`]||0,n=s[`${o}-rx_errors`]||0;if(e.direction===Hs.O_.ALL)return t+n;if(e.direction===Hs.O_.UPLINK)return t;if(e.direction===Hs.O_.DOWNLINK)return n}if(e.source===Hs.I0.DROPPED){const t=s[`${o}-tx_dropped`]||0,n=s[`${o}-rx_dropped`]||0;if(e.direction===Hs.O_.ALL)return t+n;if(e.direction===Hs.O_.UPLINK)return t;if(e.direction===Hs.O_.DOWNLINK)return n}const i=s[`${o}-tx_${t}`]||0,a=s[`${o}-rx_${t}`]||0;return e.direction===Hs.O_.ALL?i+a:e.direction===Hs.O_.UPLINK?i:e.direction===Hs.O_.DOWNLINK?a:0}})(n),l=new Map;e.forEach((e,n)=>{const{duration:i,oid:c}=e,d=e.time,u=t[n];let m=l.get(d);m||(m={timestamp:d,duration:i,portsData:{}},l.set(d,m));for(let t=0;t<s.length;t+=1){const n=s[t],{deviceMac:l,portIdx:d}=(0,k.q9)(n);if(l===c){const t=o[d];if(r&&u&&t){const e=(0,tr.si)(t.id);m.portsData[n]=a(u,e<2?"":e.toString(),i)}else m.portsData[n]=a(e,d,i)}}});const c=[];return l.forEach(({timestamp:e,duration:t,portsData:s})=>{c.push({timestamp:e,duration:t,...s})}),c.sort((e,t)=>e.timestamp-t.timestamp),c}),xr=(0,Nt.Mz)(hr,w.X5,(e,t)=>{const s=on(t),n=Object.keys(e[0]||{}).filter(e=>"timestamp"!==e&&"duration"!==e);let r=e.reduce((e,s)=>{const r=n.reduce((e,n)=>{let r=s[n];return t.source===Hs.I0.POE&&(r=r*s.duration/ft.$_),e+r},0);return e+r},0);return t.source===Hs.I0.USAGE&&t.usage===Hs.AM.BPS&&(r/=e.length||1),t.source===Hs.I0.POE?{total:new rn(r)}:{total:s(r)}});var Er=s(703233),_r=s(33134);const Cr=(0,r.A)(F.A)`
  white-space: nowrap;
`,gr=({summary:e})=>{const t=(0,G.u)();return(0,n.jsxs)(A.A,{gap:d.kc,alignItems:"center",justifyContent:"end",children:[e.rx?(0,n.jsxs)(Cr,{size:"medium",style:{color:(0,ke.gB)(t)},children:[(0,n.jsx)(_r.A,{}),e.rx.toString()]}):null,e.tx?(0,n.jsxs)(Cr,{size:"medium",style:{color:(0,ke.mN)(t)},children:[(0,n.jsx)(Er.A,{}),e.tx.toString()]}):null,e.total?(0,n.jsx)(Cr,{size:"medium",color:"text-1",children:e.total.toString()}):null]})};var Or=s(383061);const fr=[{id:Hs.AM.BPS,label:(0,n.jsx)(Z.sA,{id:"COMMON_BPS"})},{id:Hs.AM.BYTES,label:(0,n.jsx)(Z.sA,{id:"COMMON_BYTES"})}],Nr=()=>{const e=(0,b.wA)(),{usage:t}=(0,b.d4)(w.X5);return(0,n.jsx)(Or.A,{className:jr,tabs:fr,selectedTab:t,onSelectTab:({id:t})=>(t=>{e((0,R.H4)({usage:t}))})(t),variant:"filter"})},Sr=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.cW),{source:s}=(0,b.d4)(w.X5);((e,t)=>{const s=(0,b.wA)();(0,v.useEffect)(()=>{e||t!==Hs.I0.POE||s((0,R.H4)({source:ir.ON}))},[e,s])})(t,s);const r=(0,v.useMemo)(()=>[{id:Hs.I0.PACKETS,label:(0,n.jsx)(Z.sA,{id:"COMMON_PACKETS"})},{id:Hs.I0.USAGE,label:(0,n.jsx)(Z.sA,{id:"COMMON_USAGE"})},{id:Hs.I0.POE,label:(0,n.jsx)(Z.sA,{id:"COMMON_DEVICE_POE_MODE_POE"}),disabled:!t},{id:Hs.I0.ERRORS,label:(0,n.jsx)(Z.sA,{id:"COMMON_ERRORS"})},{id:Hs.I0.DROPPED,label:(0,n.jsx)(Z.sA,{id:"COMMON_DROPPED"})}],[t]);return(0,n.jsx)(Or.A,{className:jr,tabs:r,selectedTab:s,onSelectTab:({id:t})=>(t=>{e((0,R.H4)({source:t}))})(t),variant:"filter"})},Tr=[{id:Hs.uO.ALL,label:(0,n.jsx)(Z.sA,{id:"COMMON_ALL"})},{id:Hs.uO.BROADCAST,label:(0,n.jsx)(Z.sA,{id:"COMMON_STATUS_BROADCAST"})},{id:Hs.uO.MULTICAST,label:(0,n.jsx)(Z.sA,{id:"COMMON_MULTICAST"})}],Mr=()=>{const e=(0,b.wA)(),{packets:t}=(0,b.d4)(w.X5);return(0,n.jsx)(Or.A,{className:jr,tabs:Tr,selectedTab:t,onSelectTab:({id:t})=>(t=>{e((0,R.H4)({packets:t}))})(t),variant:"filter"})},Ir=[{id:Hs.Mz.AVERAGE,label:(0,n.jsx)(Z.sA,{id:"COMMON_TOTAL"})},{id:Hs.Mz.BY_PORT,label:(0,n.jsx)(Z.sA,{id:"PORTS_BY_PORT"})}],vr=()=>{const e=(0,b.wA)(),{mode:t}=(0,b.d4)(w.X5);return(0,n.jsx)(Or.A,{className:jr,tabs:Ir,selectedTab:t,onSelectTab:({id:t})=>(t=>{e((0,R.H4)({mode:t}))})(t),variant:"filter"})},br=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.X5),{direction:s,source:r}=t,o=(0,v.useMemo)(()=>{const e=r===Hs.I0.ERRORS||r===Hs.I0.DROPPED;return[{id:Hs.O_.ALL,label:(0,n.jsx)(Z.sA,{id:"COMMON_ALL"})},{id:Hs.O_.DOWNLINK,label:(0,n.jsx)(Z.sA,{id:e?"COMMON_RECEIVE":"COMMON_DOWNLOAD"})},{id:Hs.O_.UPLINK,label:(0,n.jsx)(Z.sA,{id:e?"COMMON_TRANSMIT":"COMMON_UPLOAD"})}]},[r]);return(0,n.jsx)(Or.A,{className:jr,tabs:o,selectedTab:s,onSelectTab:({id:t})=>(t=>{e((0,R.H4)({direction:t}))})(t),variant:"filter"})},jr=ys.AH`
  flex: unset;
  width: auto;
  flex-shrink: 0;
`,Dr=({summary:e})=>{const{source:t}=(0,b.d4)(w.X5);return(0,n.jsxs)(A.A,{gap:d.kc,overflow:"auto",children:[(0,n.jsx)(vr,{}),(0,n.jsx)(Sr,{}),t===Hs.I0.PACKETS?(0,n.jsx)(Mr,{}):null,t===Hs.I0.USAGE?(0,n.jsx)(Nr,{}):null,t!==Hs.I0.POE?(0,n.jsx)(br,{}):null,(0,n.jsx)(A.A,{flexGrow:1}),(0,n.jsx)(gr,{summary:e})]})};var Pr=s(357159),yr=s(528116),kr=s(927027),wr=s(844993),Rr=s(618965),Lr=s(964978),$r=s(122109);const Fr={Bytes:(0,r.A)(F.A)`
    color: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-aqua-06-${e}`]};
  `,Icon:void 0},Ur=(0,r.A)(A.A)`
  flex-direction: column;
  padding-bottom: ${d.kc};
  border-bottom: 1px solid
    ${({theme:{themeName:e}})=>$.Ay[`desktop-color-neutral-10-${e}`]};
`,Vr=(0,r.A)(A.A)`
  g {
    transition: unset;
  }
`,Hr=(0,r.A)("div",(0,B.A)("color"))`
  width: ${d.kc};
  height: ${d.kc};
  background: ${({color:e})=>e};
`,Gr=(0,r.A)(A.A,(0,B.A)("columnCount"))`
  display: grid;
  grid-template-columns: repeat(${({columnCount:e})=>e}, 1fr);
  column-gap: ${d.S2};
  width: 100%;
`,zr=({portIdx:e,value:t,graphDataSeries:s,color:r})=>{const o=s.getFormattedValue(t);return(0,n.jsxs)(A.A,{justifyContent:"space-between",alignItems:"baseline",width:"100%",gap:d.YC,children:[(0,n.jsxs)(A.A,{gap:d.YC,alignItems:"center",children:[(0,n.jsx)(Hr,{color:r}),(0,n.jsx)(F.A,{size:"small",color:"text-2",children:(0,n.jsx)(Z.sA,{id:"COMMON_PORT_NUMBER",values:{portNumber:e}})})]}),(0,n.jsx)(F.A,{size:"small",children:o.toString()})]})},Wr=({value:e,direction:t,source:s,graphDataSeries:r})=>{const o=(0,v.useMemo)(()=>((e,t)=>e===Hs.I0.POE?Fr:t===Hs.O_.UPLINK?Lr.A:$r.A)(s,t),[t,s]),i=(0,v.useMemo)(()=>((e,t)=>e===Hs.I0.POE?"COMMON_POWER":e===Hs.I0.ERRORS||e===Hs.I0.DROPPED?t===Hs.O_.UPLINK?"COMMON_TRANSMIT":"COMMON_RECEIVE":t===Hs.O_.UPLINK?"COMMON_UPLOAD":"COMMON_DOWNLOAD")(s,t),[t,s]),a=r.getFormattedValue(e);return(0,n.jsxs)(A.A,{justifyContent:"space-between",width:"100%",children:[(0,n.jsx)(F.A,{size:"small",color:"text-2",children:(0,n.jsx)(Z.sA,{id:i})}),(0,n.jsxs)(A.A,{children:[o.Icon?(0,n.jsx)(o.Icon,{}):null,(0,n.jsx)(o.Bytes,{size:"small",children:a.toString()})]})]})},Br=({hidden:e,top:t,left:s,x:r,chartWidth:o,chartHeight:i,selfHourCycle:a,tooltipPropsCollection:l,showDateWithTime:c,language:u,graphDataSeries:m,settings:p,gradientColor:h,graphDataCollection:x,seriesIndex:E,duration:_})=>{const{mode:C}=p,{themeName:g}=(0,G.u)(),O=(0,b.d4)(w.zD),f=(0,v.useMemo)(()=>(e=>{switch(e){case Hs.I0.POE:return(0,n.jsx)(Z.sA,{id:"COMMON_POWER"});case Hs.I0.PACKETS:return(0,n.jsx)(Z.sA,{id:"COMMON_PACKETS"});case Hs.I0.USAGE:return(0,n.jsx)(Z.sA,{id:"COMMON_USAGE"});case Hs.I0.ERRORS:return(0,n.jsx)(Z.sA,{id:"COMMON_ERRORS"});case Hs.I0.DROPPED:return(0,n.jsx)(Z.sA,{id:"COMMON_DROPPED"});default:return null}})(p.source),[p.source]),N=(0,v.useMemo)(()=>Object.values(x).find(e=>e.timestamp===r),[x,r]),S=(0,v.useMemo)(()=>{const e=s<Math.round(o/2);return{left:Math.round(s+(e?8:-8)),top:Math.round(t),position:e?"rightTop":"leftTop"}},[s,t,o]),T=(0,v.useMemo)(()=>((e,t,s,n,r)=>{const o=new Intl.DateTimeFormat(t,{day:"numeric",month:"short",year:"numeric",...s&&{hour:"numeric",minute:"numeric",hourCycle:n}}).format(e);return r?`${o} - ${new Intl.DateTimeFormat(t,s?{hour:"numeric",minute:"numeric",hourCycle:n}:{day:"numeric",month:"short",year:"numeric"}).format(r)}`:o})(r,u,c,a,r+Number(_||0)),[r,u,c,a,_]),M=(0,v.useMemo)(()=>N?C===Hs.Mz.BY_PORT?((e,t,s)=>(0,n.jsx)(Gr,{columnCount:Math.ceil(Object.values(e.data).length/18),children:Object.values(e.data).sort((e,t)=>(0,k.q9)(e.key).portIdx-(0,k.q9)(t.key).portIdx).map(r=>{const o=t[r.key],i=s[r.key],{portIdx:a}=(0,k.q9)(r.key);return(0,n.jsx)(zr,{value:o,color:i,graphDataSeries:e,portIdx:a},r.key)})}))(m,N,O):((e,t,s)=>{const r=e.data.series1,o=e.data.series2,i=o&&t[o.key];return(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.YC,children:[r?(0,n.jsx)(Wr,{direction:Hs.O_.UPLINK,graphDataSeries:e,value:r&&t[r.key],source:s}):null,o?(0,n.jsx)(Wr,{direction:Hs.O_.DOWNLINK,graphDataSeries:e,value:i,source:s}):null]})})(m,N,p.source):null,[N,m,C,p.source,O]),I=(0,v.useMemo)(()=>(0,n.jsx)(Vr,{position:"absolute",top:0,left:0,children:(0,n.jsx)("svg",{width:o,height:i,children:s&&t?(0,n.jsx)(wr.A,{hasAnimation:!1,x:s,y:Math.round(t),color:h,innerRadius:4,outterRadius:8}):null})}),[i,o,h,s,t]),j=(0,v.useMemo)(()=>{const e=Math.min(t,l.min);return{top:e,height:Math.max(t,l.max)-e,left:s-1}},[t,l,s]);return 0===E?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Rr.A,{hidden:e,left:S.left,top:S.top,topMargin:4,width:"auto",tooltipProps:{maxWidth:"auto",position:S.position},description:(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,whiteSpace:"nowrap",children:[(0,n.jsxs)(Ur,{children:[(0,n.jsx)(F.A,{color:"text-1",weight:"bold",size:"medium",children:f}),(0,n.jsx)(F.A,{color:"text-3",size:"small",children:T})]}),(0,n.jsx)(A.A,{flexDirection:"column",children:M})]})}),(0,n.jsx)(A.A,{zIndex:1,width:1,borderLeft:`2px dashed ${$.Ay[`desktop-color-neutral-04-${g}`]}`,top:j.top,height:j.height,left:j.left,position:"absolute"}),I]}):I};var Kr=s(991331);const Yr=({graphDataCollection:e,graphDataKey:t,getCoordinates:s,mouseData:r,maxY:o,tooltipContainer:i,seriesIndex:a,renderTooltip:l})=>{const c=(0,G.u)(),{mode:d}=(0,b.d4)(w.X5),u=(0,b.d4)(w.zD),m=(e=>`${e}GradientId`)(t),A=d===Hs.Mz.AVERAGE?((e,t)=>e.includes("rx")||e.includes("poe_power")?(0,ke.gB)(t):(0,ke.mN)(t))(t,c):u[t]||(0,ke.mN)(c),p=(0,v.useMemo)(()=>e.map(({timestamp:e,...s})=>({x:e,y:s[t]})),[e,t]),h=(0,v.useCallback)(()=>(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:m,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,n.jsx)("stop",{offset:"0%",stopColor:A,stopOpacity:.5}),(0,n.jsx)("stop",{offset:"100%",stopColor:A,stopOpacity:.1})]})}),[m,A]),x=(0,v.useCallback)(e=>l?l(e,A,a):void 0,[l,A,a]);return(0,n.jsx)(Kr.A,{data:p,maxY:o,mouseData:r,getCoordinates:s,lineColor:A,variant:d===Hs.Mz.AVERAGE?"gradientArea":"line",interpolation:"linear",allowCustomDots:!0,tooltipPortal:i?i.current:void 0,customGradientId:m,renderCustomGradient:h,renderTooltip:x})},Xr=(0,r.A)(A.A,(0,B.A)("chartWidth","preset"))`
  #x-labels > g:last-child {
    ${({preset:e,chartWidth:t})=>!e&&`transform: translateX(${t-45}px) !important;`}
  }
`,Zr=({graphDataCollection:e=[],graphDataSeries:t,graphContainerHeight:s})=>{const{formatMessage:r}=(0,Z.tz)(),{width:o}=(0,W.Ay)(),i=(0,v.useRef)(null),a=(0,v.useRef)({min:0,max:0,left:0}),{ref:l,width:c=0}=(0,dt.A)(),{startDate:d,endDate:u,preset:m}=(0,b.d4)(w.Ky),p=(0,b.d4)(mt.jc),h=(0,b.d4)(mt.BQ),x=(0,b.d4)(Ws.hq),E=(0,b.d4)(Cn.zi),_=(0,b.d4)(w.X5),C=(0,b.d4)(w.UH),g=(0,v.useMemo)(()=>(0,yr.$V)(d,u,!0,!0),[u,d]),O=(0,v.useMemo)(()=>(0,or.Io)(d,u),[u,d]),f=(0,yr.Vi)(O,r),N=(0,v.useMemo)(()=>Math.floor(Math.abs(new Date(u).getTime()-new Date(d).getTime())/ft.jU),[d,u]),S=s<400,T=(0,v.useMemo)(()=>{let s=1;const n=Object.values(t.data).map(e=>e.key);return e.forEach(e=>{Object.keys(e).forEach(t=>{"timestamp"!==t&&"number"==typeof e[t]&&n.includes(t)&&(s=Math.max(s,e[t]))})}),t.getFormattedValue(s)},[e,t]),M=(0,v.useMemo)(()=>!(_.source===Hs.I0.USAGE&&_.usage===Hs.AM.BPS)&&_.source!==Hs.I0.POE&&_.source!==Hs.I0.ERRORS&&_.source!==Hs.I0.DROPPED,[_.usage,_.source]),I=(0,v.useCallback)(({hidden:r,left:o=0,top:i=0,x:l=0,y:d},u,m)=>(a.current={min:a.current.left===o?Math.min(i,a.current.min):i,max:a.current.left===o?Math.max(i,a.current.max):i,left:o},(0,n.jsx)(Br,{hidden:r,left:o,top:i,tooltipPropsCollection:a.current,x:l,y:d,duration:g.grain,chartHeight:s,chartWidth:c,selfHourCycle:h,settings:_,showDateWithTime:N<=7,language:E,graphDataSeries:t,gradientColor:u,graphDataCollection:e,seriesIndex:m})),[g.grain,s,c,h,_,N,E,t,e]),j=(0,v.useMemo)(()=>((e,t)=>{const s=Math.ceil((t-e)/36e5),n=s/24;return(s=>(0,kr.v)([e,t],tn[s].frequency(o,N)).map((e,t)=>({label:tn[s].label({index:t,value:e,selfHourCycle:h,selfUse24HourTime:p,documentWidth:o,siteTimezone:x,language:E,formatMessage:r}),value:e})))(null===m||m===Qs.l.ONE_DAY&&s<13||m===Qs.l.ONE_WEEK&&n<5||m===Qs.l.ONE_MONTH&&n<10?Qs.j:m)})(e[0]?.timestamp||d.getTime(),e.length>1&&e.at(-1)?.timestamp||u.getTime()),[e,h,p,d,u,m,x,E,o,N,r]),D=(0,v.useMemo)(()=>{return e=T.bytes,(0,kr.Y)(Math.ceil(e+1/(S?5:10)*e),S?6:11);var e},[T.bytes,S]),P=(0,v.useCallback)(({value:e},s)=>{if(s!==(S?5:10))return`${t.getFormattedValue(+e,T.power).value.toFixed(1)}`},[T.power,t,S]),y=(0,v.useCallback)((s,r,o)=>(0,n.jsx)(n.Fragment,{children:Object.keys(t.data).map((a,l)=>{const{key:c,label:d}=t.data[a];return(0,n.jsx)(Yr,{graphDataCollection:e,graphDataKey:c,graphDataLabel:d,getCoordinates:s,mouseData:r,maxY:o,tooltipContainer:i,renderTooltip:I,seriesIndex:l},c)})}),[t.data,e,I]);return(0,n.jsxs)(Xr,{width:"100%",position:"relative",preset:m,chartWidth:c,children:[(0,n.jsx)(A.A,{width:"100%",position:"relative",ref:l,children:(0,n.jsx)(Pr.A,{xAxis:j,yAxis:D,width:c,yAxisTitle:M?`${T.unit} / ${f}`:T.unit,height:s,renderYLabel:P,children:C.length?y:void 0})}),(0,n.jsx)("div",{ref:i})]})},qr=({settings:e})=>{const t=(0,b.d4)(w.UH),s=(0,b.d4)(hr),r=(0,b.d4)(xr),o=((e,t)=>{const s={getFormattedValue:on(t),data:{}};return e.forEach(e=>{s.data[e]={key:e,label:`COMMON_PORT ${e}`}}),s})(t,e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Dr,{summary:r}),(0,n.jsx)(Zr,{graphDataCollection:s,graphDataSeries:o,graphContainerHeight:ir.F$})]})},Qr=({settings:e})=>{const t=(0,b.d4)(pr),s=(0,b.d4)(Ar),r=((e,t)=>{const{DOWNLINK:s,UPLINK:n,ALL:r}=Hs.O_,o=on(t),i={getFormattedValue:o,data:{}},{rx_broadcast:a,rx_bytes:l,rx_multicast:c,rx_packets:d,rx_rate:u,tx_broadcast:m,tx_bytes:A,tx_multicast:p,tx_packets:h,tx_rate:x,tx_errors:E,rx_errors:_,tx_dropped:C,rx_dropped:g,poe_energy:O}=e;return t.source===Hs.I0.ERRORS&&(i.summary={tx:o(E),rx:o(_),total:o(E+_)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_errors",label:"COMMON_ERRORS"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_errors",label:"COMMON_ERRORS"})),t.source===Hs.I0.DROPPED&&(i.summary={tx:o(C),rx:o(g),total:o(C+g)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_dropped",label:"COMMON_DROPPED"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_dropped",label:"COMMON_DROPPED"})),t.source===Hs.I0.USAGE&&(t.usage===Hs.AM.BPS&&(i.summary={tx:o(x),rx:o(u),total:o((x+u)/2)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_rate",label:"COMMON_RATE"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_rate",label:"COMMON_RATE"})),t.usage===Hs.AM.BYTES&&(i.summary={tx:o(A),rx:o(l),total:o(A+l)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_bytes",label:"COMMON_USAGE"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_bytes",label:"COMMON_USAGE"}))),t.source===Hs.I0.PACKETS&&(t.packets===Hs.uO.ALL&&(i.summary={tx:o(h),rx:o(d),total:o(h+d)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_packets",label:"COMMON_PACKETS"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_packets",label:"COMMON_PACKETS"})),t.packets===Hs.uO.BROADCAST&&(i.summary={tx:o(m),rx:o(a),total:o(m+a)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_broadcast",label:"COMMON_PACKETS"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_broadcast",label:"COMMON_PACKETS"})),t.packets===Hs.uO.MULTICAST&&(i.summary={tx:o(p),rx:o(c),total:o(p+c)},[n,r].includes(t.direction)&&(i.data.series1={key:"tx_multicast",label:"COMMON_PACKETS"}),[s,r].includes(t.direction)&&(i.data.series2={key:"rx_multicast",label:"COMMON_PACKETS"}))),t.source===Hs.I0.POE&&(i.summary={total:new rn(O)},i.data.series1={key:"poe_power",label:"COMMON_POE_USAGE"}),i})(t,e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Dr,{summary:r.summary}),(0,n.jsx)(Zr,{graphDataCollection:s,graphDataSeries:r,graphContainerHeight:ir.F$})]})},Jr=(0,r.A)(A.A)`
  flex-direction: column;
  width: 100%;
  border-radius: ${d.YC};
`,eo=(0,v.memo)(()=>{const e=(0,b.wA)(),t=(0,b.d4)(w._h),s=(0,b.d4)(w.Ky),r=(0,b.d4)(w.X5),o=(0,b.d4)(ar),[i,a]=(0,v.useState)([]),[l,c]=(0,v.useState)(null),[d,u]=(0,v.useState)(null),{startDate:m,endDate:A}=s,p=(0,v.useMemo)(()=>!(!t.length||(0,D.L)(i,t)&&m===l&&A===d),[i,t,m,l,A,d]);return(0,v.useEffect)(()=>{p&&(a(t),c(m),u(A),e((0,R.qV)({deviceMacs:t,dateRange:{startDate:m,endDate:A,preset:s.preset},isGatewaySelected:o})))},[p,e,m,A,t,o,s.preset]),(0,n.jsx)(Jr,{children:(0,n.jsx)(r.mode===Hs.Mz.AVERAGE?Qr:qr,{settings:r})})});var to=s(376527),so=s(969288),no=s(212635);const ro=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.OA),{type:s,id:r}=(0,v.useMemo)(()=>(0,qt.Se)(t),[t]),o=s===no.F7.MC_LAG,i=s===no.F7.STACKING_GROUP,a=(0,v.useMemo)(()=>r?`${so.Rm}/${r}`:so.Rm,[r]),l=(0,v.useMemo)(()=>r?`${so.vc}/${r}`:so.vc,[r]),c=(0,b.d4)(w.Hd),u=(0,b.d4)(w.hb),m=(0,b.d4)(w.UH),p=(0,b.d4)(w.XS),h=(0,v.useCallback)(()=>{e((0,R.Ao)([]))},[e]),x=(0,v.useCallback)(()=>{e((0,R.Ao)([m,u.selectablePortsBulkSelection].flat()))},[e,u.selectablePortsBulkSelection,m]),E=!u.selectablePortsBulkSelection.length,_=(0,v.useCallback)(()=>{e((0,R.xj)(!c))},[e,c]);return(0,n.jsxs)(A.A,{gap:d.kc,alignItems:"center",children:[o?(0,n.jsx)(to.A,{to:a,size:"small",children:(0,n.jsx)(Z.sA,{id:"PORTS_EDIT_MC_LAG"})}):null,i?(0,n.jsx)(to.A,{to:l,size:"small",children:(0,n.jsx)(Z.sA,{id:"PORTS_EDIT_STACKING"})}):null,m.length?(0,n.jsx)(jn.A,{size:"small",type:"button",variant:"inline",onClick:h,children:(0,n.jsx)(Z.sA,{id:"COMMON_ACTION_DESELECT_ALL"})}):null,E||p?null:(0,n.jsx)(jn.A,{size:"small",type:"button",variant:"inline",onClick:x,children:(0,n.jsx)(Z.sA,{id:"COMMON_ACTION_SELECT_ALL"})}),(0,n.jsx)(jn.A,{size:"small",type:"button",variant:"inline",onClick:_,children:(0,n.jsx)(Z.sA,{id:c?"PORTS_SHOW_CONNECTED_DEVICES":"PORTS_HIDE_CONNECTED_DEVICES"})})]})},oo=(0,r.A)(A.A)`
  gap: ${d.Ln};
  height: 100%;
  overflow: hidden;
`,io=(0,r.A)("div")`
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100%;
`,ao=(0,r.A)("div")`
  container-type: inline-size;
`,lo=(0,r.A)("div")`
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: ${d.YC};

  > :nth-child(2) {
    flex-wrap: nowrap;
  }

  @container (max-width: 950px) {
    grid-template-columns: 1fr;

    > :first-child {
      order: 1;
    }

    > :nth-child(2) {
      flex-wrap: wrap;
    }
  }
`,co=(0,v.memo)(()=>{const e=(0,b.d4)(w.w2),t=(0,b.d4)(w.tI),s=(0,b.d4)(w.OA),r=(0,b.d4)(w.Mi),o=(0,b.d4)(w.QR),i=(0,b.d4)(w.$X),a=(0,b.d4)(w.kq),l=(0,b.d4)(w.Hz);(()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.QR),s=(0,b.d4)(w.Bt)||(0,P.A)(),n=(0,b.d4)(w.Fk),r=(0,b.d4)(w.UH),o=(0,y.A)(r);(0,v.useEffect)(()=>{if(!(0,D.L)(r,o)&&!t){const t=r.filter(e=>!o?.includes(e))||[],i=o?.filter(e=>!r.includes(e))||[],a=new Set,l=new Set;t.forEach(e=>{const{aggregationGroup:t,device:r}=s.find(t=>t.id===e)||{};if(t){const e=t.lag_idx;if(n){const t=s.find(t=>t.aggregationGroup?.lag_idx===e&&t.device.mac!==r.mac);t&&a.add({...t.aggregationGroup,deviceMac:t.device.mac})}a.add({...t,deviceMac:r.mac})}}),i.forEach(e=>{const{aggregationGroup:t,device:r}=s.find(t=>t.id===e)||{};if(t){const e=t.lag_idx;if(n){const t=s.find(t=>t.aggregationGroup?.lag_idx===e&&t.device.mac!==r.mac);t&&l.add({...t.aggregationGroup,deviceMac:t.device.mac})}l.add({...t,deviceMac:r.mac})}});const c=Array.from(a).reduce((e,t)=>[...e,...t.aggregate_members.map(e=>(0,k.FS)(t.deviceMac,e))],[]),d=Array.from(l).reduce((e,t)=>[...e,...t.aggregate_members.map(e=>(0,k.FS)(t.deviceMac,e))],[]);let u=[...r].filter(e=>!d.includes(e));u=new Array(...new Set([...u,...c])),0===u.length&&1===r.length&&(u=[...r]),(0,D.L)(u,r)||e((0,R.Ao)(u))}},[r,o,e,t,n,s])})(),(0,j.A)(t||""),(()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.OA),s=(0,b.d4)(w.Jm);(0,v.useEffect)(()=>{e((0,R.U)(t))},[e]),(0,v.useEffect)(()=>s?(e((0,R.gU)(!1)),()=>null):()=>{e((0,Zt.p)(!1)),e((0,R.Ao)([]))},[e])})(),(()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.$X),s=(0,b.d4)(w.wJ),n=(0,$e.Ki)(s);(0,v.useEffect)(()=>{!n&&t&&e((0,R.JL)(!1))},[n,t,e])})(),((e,t)=>{const s=(0,b.wA)();(0,v.useEffect)(()=>{if(e.length>0&&t&&t!==Qt.Zt&&!e.find(e=>e.value===t)){const{deviceMacs:n}=(0,qt.Se)(t),r=e.find(e=>n.some(t=>e.includeDevices?.includes(t)));r?(s((0,R.U)(r.value)),s((0,R.gU)(!0))):s((0,R.U)(Qt.Zt))}},[e,t,s])})(r,s),(()=>{const e=(0,b.wA)(),t=(0,b.d4)(ut.WS),s=(0,b.d4)(ut.it),n=(0,b.d4)(w.QR);(0,v.useEffect)(()=>{t&&s!==ee.H.PORTS&&!n&&e((0,R.Ao)([]))},[e,t,s,n])})();const c=(0,n.jsxs)(he,{children:[t&&a?(0,n.jsxs)(A.A,{flexDirection:"column",children:[i?(0,n.jsx)(A.A,{minHeight:"34px"}):(0,n.jsx)(de,{}),(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,children:[e.map((t,s)=>(0,n.jsx)(gt,{deviceMac:t,isFirst:0===s,showDeviceName:e.length>1},t)),(0,n.jsx)(ao,{children:(0,n.jsxs)(lo,{children:[(0,n.jsx)("div",{children:i?null:(0,n.jsx)(ro,{})}),(0,n.jsx)(as.A,{isSingleLine:!0,deviceMac:t})]})})]})]}):null,o?(0,n.jsx)(eo,{}):null,i?(0,n.jsx)(js,{}):null,i?null:(0,n.jsx)(Ds.uA,{children:(0,n.jsx)(Jn,{})})]});return l&&e.length>0?(0,n.jsxs)(oo,{children:[(0,n.jsx)(Xt,{}),(0,n.jsx)(io,{children:c})]}):c});var uo=s(558948),mo=s(692),Ao=s(479086),po=s(770698);const ho=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.Mi),s=(0,b.d4)(w.OA),n=(0,b.d4)(w.N0),r=(0,b.d4)(w.K6),o=(0,b.d4)((0,w.IS)([])),{setSelectedPortsAndAssignColors:i}=an(),a=(0,v.useMemo)(()=>n?.[0],[n]),l=(0,v.useCallback)(()=>{e((0,R.JL)(!1)),e((0,R.IU)(!1)),e((0,R.E1)(!0)),e((0,R.Ao)([]))},[e]),c=(0,v.useCallback)(t=>{e((0,R.JL)(t)),t&&(1===r.length?e((0,R.is)([r[0]])):a&&e((0,R.is)([a.mac])))},[e,a,r]),d=(0,v.useCallback)(t=>{e((0,R.E1)(t))},[e]),u=(0,v.useCallback)(t=>{e((0,R.T6)(t)),t&&(e((0,R.Ao)([])),e((0,X.K5)()))},[e]),m=(0,v.useCallback)(n=>{const l=s===Qt.Zt,c=t[0];if(n&&l&&e((0,R.U)(c?.value)),e((0,R.IU)(n)),n){const e=l?c?.includeDevices?.[0]:1===r.length?r[0]:a?.mac;if(e){const t=o.filter(t=>t.device.mac===e).map(e=>e.id);i(t)}}n||e((0,R.Ao)([])),e((0,X.K5)())},[t,e,o,a?.mac,s,r,i]);return(0,v.useMemo)(()=>({handleReturnToPortsView:l,handleStatsChange:m,handleVlansChange:c,handleDeviceDiagramChange:d,handleTimeMachineChange:u}),[l,m,c,d,u])},xo=()=>{const{handleVlansChange:e}=ho(),t=(0,b.d4)(w.$X),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(po.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(F.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(Z.sA,{id:"PORTS_VLANS_DIAGRAM"})})})},Eo=()=>{const{handleTimeMachineChange:e}=ho(),t=(0,b.d4)(w.Hz),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(po.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(F.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(Z.sA,{id:"COMMON_TIME_MACHINE"})})})},_o=()=>{const{handleStatsChange:e}=ho(),t=(0,b.d4)(w.QR),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(po.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(F.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(Z.sA,{id:"COMMON_STATS"})})})},Co=()=>{const{handleDeviceDiagramChange:e}=ho(),t=(0,b.d4)(w.kq),s=(0,v.useCallback)(t=>{e(t.target.checked)},[e]);return(0,n.jsx)(po.A,{onChange:s,checked:t,full:!0,size:"small",children:(0,n.jsx)(F.A,{weight:"bold",size:"small",color:"text-1",children:(0,n.jsx)(Z.sA,{id:"PORTS_PORT_DIAGRAM"})})})};var go=s(800528),Oo=s(14084),fo=s(373616),No=s(501454),So=s(444971),To=s(252445),Mo=s(561247),Io=s(141992);const vo=(0,s(272338).w)(e=>(0,v.createElement)("svg",(0,Io.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,v.createElement)("path",{d:"M13 8.25a.501.501 0 0 0-.332.126L10 10.75l-.02-.02-2.648-2.353a.5.5 0 1 0-.665.747l2.638 2.346a1.001 1.001 0 0 0 1.39 0l2.637-2.345A.5.5 0 0 0 13 8.25Z",fill:"currentColor",className:e.baseclassname}),(0,v.createElement)("path",{d:"M13 8a.743.743 0 0 0-.498.19L10 10.414 7.498 8.19a.75.75 0 0 0-.997 1.121l2.634 2.342c.234.224.54.347.865.347.325 0 .631-.123.865-.347l2.633-2.343A.75.75 0 0 0 13 8Z",fill:"currentColor",className:e.fillclassname}))),bo=ys.AH`
  display: none;
`,jo=(0,n.jsxs)(A.A,{alignItems:"center",children:[(0,n.jsx)(me.A,{size:"medium",color:"inherit",children:(0,n.jsx)(Z.sA,{id:"COMMON_RESET_STATISTICS"})}),(0,n.jsx)(vo,{})]}),Do=()=>{const{formatMessage:e}=(0,Z.tz)(),t=(0,b.d4)(w.aq),{mac:s,port_table:r}=t||{},o=!!t&&(0,kn.wk)((0,kn.S9)(t)),[i,a]=(0,v.useState)([]),{resetMultiplePortStatistics:l}=(0,yn.X)(),c=(0,v.useCallback)(e=>{const t=e.map(e=>({port_idx:Number(e),value:(0,$e.CQ)(r?.find(t=>t.port_idx===Number(e))||{})}));l(s,t,o),a([])},[s,r,l,o]),d=(0,v.useMemo)(()=>(r||[]).map(e=>({label:e.name||"",value:e.port_idx,id:e.port_idx})),[r]),u=(0,v.useCallback)(e=>{e&&a(d.map(({value:e})=>e))},[d]),m=(0,v.useCallback)((e,t)=>{a(e?[...i,t]:i.filter(e=>e!==t))},[i]),A=(0,v.useCallback)(e=>{a(e?d.map(({value:e})=>e):[])},[d]);return(0,n.jsx)(Mo.A.Popover,{options:d,onSave:c,value:i,onOpenChange:u,searchPlaceholder:e({id:"COMMON_SEARCH"}),saveButtonText:e({id:"COMMON_ACTION_RESET"}),cancelButtonText:e({id:"COMMON_ACTION_CANCEL"}),onOptionCheck:m,onChangeSelectAll:A,saveButtonProps:{disabled:0===i.length},renderToggle:()=>(0,n.jsx)(Mo.A.Trigger,{options:d,editSelectionsButtonStyle:{margin:0},editSelectionsButtonText:jo,chipContainerClassName:bo})})},Po=({options:e})=>{const[t,s]=(0,v.useState)([]),r=(0,b.d4)(Ce.ID),o=(0,v.useRef)(r),{resetSwitchStatistics:i}=(0,yn.X)(),a=(0,v.useCallback)(t=>{const n=[];t.forEach(t=>{const s=e.find(e=>e.value===t);if(!s?.includeDevices)return;const{includeDevices:r}=s;r.forEach(e=>{const t=o.current?.find(t=>t.mac===e);if(!t)return;const{name:s}=t,r=(0,kn.wk)((0,kn.S9)(t));n.push(i(`${e}`,s,t.port_table||[],r))})}),Promise.all(n),s([])},[e,i]),{formatMessage:l}=(0,Z.tz)(),c=(0,v.useCallback)(t=>{t&&s(e.map(e=>e.value))},[e]),d=(0,v.useCallback)((e,n)=>{s(e?[...t,n]:t.filter(e=>e!==n))},[t]),u=(0,v.useCallback)(t=>{s(t?e.map(({value:e})=>e):[])},[e]);return(0,n.jsx)(Mo.A.Popover,{options:e,onSave:a,onOpenChange:c,value:t,onOptionCheck:d,onChangeSelectAll:u,searchPlaceholder:l({id:"COMMON_SEARCH"}),saveButtonText:l({id:"COMMON_ACTION_RESET"}),cancelButtonText:l({id:"COMMON_ACTION_CANCEL"}),saveButtonProps:{disabled:0===t.length},renderToggle:()=>(0,n.jsx)(Mo.A.Trigger,{options:e,value:t,onChange:a,editSelectionsButtonStyle:{margin:0},editSelectionsButtonText:jo,chipContainerClassName:bo})})},yo=()=>(0,n.jsx)(Mo.A.Trigger,{options:[],editSelectionsButtonStyle:{margin:0},editSelectionsButtonText:jo,chipContainerClassName:bo,buttonProps:{disabled:!0}}),ko=()=>{const e=(0,b.d4)(w.tI),t=(0,b.d4)(w.qq);if(e){const s=t.some(({includeDevices:t})=>t?.includes(e));return(0,n.jsx)(s?Do:yo,{})}return 0===t.length?null:(0,n.jsx)(Po,{options:t})},wo=()=>{const e=(0,b.wA)(),{formatList:t}=(0,Z.tz)(),s=(0,b.d4)((0,w.IS)([])),r=(0,v.useMemo)(()=>{const e={};return s.forEach(t=>{const{mac:s}=t.device;e[s]||(e[s]=!0)}),Object.keys(e)},[s]),o=(0,b.d4)((0,Ce.nH)(r)).map(({mac:e,name:t,locating_ports:n})=>({mac:e,name:t,locatingPorts:n?.filter(t=>s.find(s=>s.device.mac===e&&s.port_idx===t))||[]})).filter(({locatingPorts:e})=>e.length>0),i=(0,v.useCallback)(()=>{const s=o.map(({mac:s,locatingPorts:n,name:r})=>e((0,T.cj)({mac:s,name:r},n,!0,t(n))));Promise.all(s)},[e,t,o]);return 0===o.length?null:(0,n.jsx)(jn.A,{type:"button",size:"medium",variant:"inline",onClick:i,children:(0,n.jsx)(Z.sA,{id:"DEVICE_ACTIONS_LOCATE_STOP"})})},Ro=()=>(0,n.jsxs)(A.A,{width:"100%",alignItems:"center",gap:d.kc,children:[(0,n.jsx)(ko,{}),(0,n.jsx)(wo,{})]});var Lo;!function(e){e.PORTS="ports"}(Lo||(Lo={}));const $o=(0,v.memo)(()=>{const e=(0,b.wA)(),{areFiltersInitial:t,resetPortsFilters:s}=Gn(),r=(0,Gs.D)()===zs.o.SFP_ANALYZER,o=(0,So.A)({leftFilterPageId:a.g1.PORT_MANAGEMENT,leftFilterColumnsId:Lo.PORTS}),i=(0,v.useCallback)(()=>{e((0,To.GD)({leftFilterPageId:a.g1.PORT_MANAGEMENT,leftFilterColumnsId:Lo.PORTS}))},[e]);return(0,n.jsxs)(fo.A,{children:[(0,n.jsx)(Ro,{}),(0,n.jsx)(No.A,{onClear:s,disabled:t}),r?null:(0,n.jsx)(Oo.A,{onPress:i,labelId:"COMMON_CUSTOMIZE_COLUMNS",disabled:o})]})});var Fo=s(846371),Uo=s(436910),Vo=s(919095);const Ho=[Uo.E[Qs.l.ONE_DAY],Uo.E[Qs.l.ONE_WEEK],Uo.E[Qs.l.ONE_MONTH]],Go=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.Ky),s=(0,v.useCallback)(t=>{e((0,R.m$)(t))},[e]),[r,o]=(0,v.useState)({startDate:t.startDate,endDate:t.endDate}),i=(0,v.useCallback)(({id:e})=>{const t=Ho.find(t=>t.id===e);t?s({...t.getRange(new Date),preset:e}):r&&s({...r,preset:Qs.j})},[r,s]),a=(0,v.useMemo)(()=>Ho.map(({id:e,message:t,messageValues:s})=>({id:e,label:(0,n.jsx)(Z.sA,{id:t,values:s})})).concat({id:Qs.j,label:(0,n.jsx)(Fo.A,{})}),[]),l=(0,v.useCallback)(e=>{o(e),s({...e,preset:Qs.j})},[s]);return(0,n.jsx)(Vo.A,{presets:a,selectedPreset:t.preset,range:r,onSelectTab:i,onSelectCustomRange:l,showCalendar:t.preset===Qs.j})};var zo=s(530110);const Wo=(0,v.memo)(()=>{const e=(0,b.d4)(w.cW),t=(0,b.d4)(w.yZ),s=(0,v.useMemo)(()=>Object.values(un.YH).filter(s=>!(!e&&un.lj.includes(s)||!t&&un.v0.includes(s))),[e,t]);return(0,n.jsx)(zo.A,{leftFilterPageId:a.g1.PORT_MANAGEMENT,columns:s,columnLabels:un.Fi,tableType:Rs.l.PORTS})});var Bo=s(161004),Ko=s(115238),Yo=s(233288),Xo=s(894357),Zo=s(795186);const qo={[no.y5.PARTICIPANT]:"COMMON_PARTICIPANT",[no.y5.EDGE]:"COMMON_DEVICE_EDGE",[no.y5.BLOCKED]:"COMMON_BLOCKED",[no.y5.DISABLED]:"COMMON_DISABLED"},Qo={[no.y5.PARTICIPANT]:1,[no.y5.EDGE]:2,[no.y5.BLOCKED]:3,[no.y5.DISABLED]:4},Jo=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatMessage:t,formatNumber:s}=(0,Z.tz)(),r=(0,b.d4)(e=>(0,Xo.e)(e).stp),o=(0,b.d4)(w.Sh),i=(0,v.useMemo)(()=>Object.values(r),[r]),a=(0,v.useMemo)(()=>i.map(e=>e[Zo.x.ID]),[i]),l=(0,v.useCallback)(t=>{e((0,R.I9)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,R.I9)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,R.I9)([]))},[e]),u=(0,v.useMemo)(()=>i.sort((e,t)=>Qo[e[Zo.x.ID]]-Qo[t[Zo.x.ID]]).map(e=>({id:e[Zo.x.ID],type:"CHECKBOX",title:`${t({id:qo[e[Zo.x.ID]]})} (${s(e[Zo.x.COUNT])})`,children:[]})),[i,t,s]),m=(0,v.useMemo)(()=>o.length===i.length?"all":new Set(o),[o,i.length]),A=(0,v.useMemo)(()=>new Set(i.filter(e=>!o.includes(e[Zo.x.ID])&&!r[e[Zo.x.ID]][Zo.x.COUNT]).map(e=>e[Zo.x.ID])),[i,r,o]);return(0,Ko.A)(o,a,R.I9),i.length?(0,n.jsx)(Yo.A,{label:(0,n.jsx)(Z.sA,{id:"COMMON_STP"}),isSingleColumn:!0,children:(0,n.jsx)(Bo.A,{items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,onDeselectAll:d,shouldAlwaysUseSimplifiedPicker:!0})}):null}),ei={[no.fA.AVAILABLE]:"COMMON_NOT_CONNECTED",[no.fA.IN_USE]:"COMMON_IN_USE",[no.fA.CRITICAL]:"COMMON_CRITICAL",[no.fA.WARNING]:"COMMON_WARNING"},ti={[no.fA.IN_USE]:1,[no.fA.AVAILABLE]:2,[no.fA.CRITICAL]:3,[no.fA.WARNING]:4},si=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatMessage:t,formatNumber:s}=(0,Z.tz)(),r=(0,b.d4)(e=>(0,Xo.e)(e).status),o=(0,b.d4)(w.ji),i=(0,v.useMemo)(()=>Object.values(r),[r]),a=(0,v.useMemo)(()=>i.map(e=>e[Zo.x.ID]),[i]),l=(0,v.useCallback)(t=>{e((0,R.HF)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,R.HF)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,R.HF)([]))},[e]),u=(0,v.useMemo)(()=>i.sort((e,t)=>ti[e[Zo.x.ID]]-ti[t[Zo.x.ID]]).map(e=>({id:e[Zo.x.ID],type:"CHECKBOX",title:`${t({id:ei[e[Zo.x.ID]]})} (${s(e[Zo.x.COUNT])})`,children:[]})),[i,t,s]),m=(0,v.useMemo)(()=>o.length===i.length?"all":new Set(o),[o,i.length]),A=(0,v.useMemo)(()=>new Set(i.filter(e=>!o.includes(e[Zo.x.ID])&&!r[e[Zo.x.ID]][Zo.x.COUNT]).map(e=>e[Zo.x.ID])),[i,r,o]);return(0,Ko.A)(o,a,R.HF),i.length?(0,n.jsx)(Yo.A,{label:(0,n.jsx)(Z.sA,{id:"COMMON_STATUS"}),isSingleColumn:!0,children:(0,n.jsx)(Bo.A,{items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,onDeselectAll:d,shouldAlwaysUseSimplifiedPicker:!0})}):null}),ni={[no.rW.NONE]:"COMMON_NONE",[no.rW.POE]:"COMMON_DEVICE_POE_MODE_POE",[no.rW.POE_PLUS]:"COMMON_DEVICE_POE_MODE_POE_PLUS",[no.rW.POE_PLUS_PLUS]:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS",[no.rW.POE_PLUS_PLUS_PLUS]:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS_PLUS",[no.rW.POE_PASSTHROUGH]:"COMMON_DEVICE_POE_MODE_PASSTHROUGH",[no.rW.POE_PASSIVE_24V]:"COMMON_DEVICE_POE_MODE_PASSIVE"},ri={[no.rW.NONE]:1,[no.rW.POE]:2,[no.rW.POE_PLUS]:3,[no.rW.POE_PLUS_PLUS]:4,[no.rW.POE_PLUS_PLUS_PLUS]:5,[no.rW.POE_PASSTHROUGH]:5,[no.rW.POE_PASSIVE_24V]:6},oi=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatNumber:t,formatMessage:s}=(0,Z.tz)(),r=(0,b.d4)(e=>(0,Xo.e)(e).poe),o=(0,b.d4)(w.px),i=(0,v.useMemo)(()=>Object.values(r),[r]),a=(0,v.useMemo)(()=>i.map(e=>e[Zo.x.ID]),[i]),l=(0,v.useCallback)(t=>{e((0,R.PJ)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,R.PJ)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,R.PJ)([]))},[e]),u=(0,v.useMemo)(()=>i.sort((e,t)=>ri[e[Zo.x.ID]]-ri[t[Zo.x.ID]]).map(e=>({id:e[Zo.x.ID],type:"CHECKBOX",title:`${s({id:ni[e[Zo.x.ID]]})} (${t(e[Zo.x.COUNT])})`,children:[]})),[i,t,s]),m=(0,v.useMemo)(()=>o.length===i.length?"all":new Set(o),[o,i.length]),A=(0,v.useMemo)(()=>new Set(i.filter(e=>!o.includes(e[Zo.x.ID])&&!r[e[Zo.x.ID]][Zo.x.COUNT]).map(e=>e[Zo.x.ID])),[i,r,o]);return(0,Ko.A)(o,a,R.PJ),i.length?(0,n.jsx)(Yo.A,{label:(0,n.jsx)(Z.sA,{id:"COMMON_DEVICE_POE_MODE_POE"}),isSingleColumn:!0,children:(0,n.jsx)(Bo.A,{items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,shouldAlwaysUseSimplifiedPicker:!0,onDeselectAll:d})}):null});var ii=s(300842),ai=s(561547);const li=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatNumber:t,formatMessage:s}=(0,Z.tz)(),r=(0,b.d4)(e=>(0,Xo.e)(e).nativeVlan),o=(0,b.d4)(w.l9),i=(0,v.useMemo)(()=>Object.values(r),[r]),a=(0,v.useMemo)(()=>i.map(e=>e[Zo.x.ID]),[i]),l=(0,v.useCallback)(t=>{e((0,R.t4)(Array.from(t||[])))},[e]),c=(0,v.useCallback)(t=>{e((0,R.t4)(Array.from(t||[])))},[e]),d=(0,v.useCallback)(()=>{e((0,R.t4)([]))},[e]),u=(0,v.useMemo)(()=>i.sort((e,t)=>e[Zo.x.ID]===Xo.C?1:t[Zo.x.ID]===Xo.C?-1:(e[Zo.x.VLAN_ID]??1)-(t[Zo.x.VLAN_ID]??1)).map(e=>{const n=e[Zo.x.NAME],r=n===Xo.C?s({id:"COMMON_NONE"}):n;return{id:e[Zo.x.ID],type:"CHECKBOX",title:`${r} (${t(e[Zo.x.COUNT])})`,children:[]}}),[i,t,s]),m=(0,v.useMemo)(()=>o.length===i.length?"all":new Set(o),[o,i.length]),A=(0,v.useMemo)(()=>new Set(i.filter(e=>!o.includes(e[Zo.x.ID])&&!r[e[Zo.x.ID]][Zo.x.COUNT]).map(e=>e[Zo.x.ID])),[i,r,o]);return(0,Ko.A)(o,a,R.t4),i.length?(0,n.jsx)(ii.A,{id:ai.R.PORTS_NATIVE_VLAN,label:(0,n.jsx)(Z.sA,{id:"COMMON_PORTS_NATIVE_VLAN"}),children:(0,n.jsx)(Bo.A,{id:ai.R.PORTS_NATIVE_VLAN,items:u,selectedKeys:m,disabledKeys:A,onSelectionChange:l,onSelectAll:c,onDeselectAll:d})}):null});var ci=s(108825),di=s(951061),ui=s(725989),mi=s(514692);const Ai=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.uC),s=(0,mi.xO)(t)||(0,mi.fX)(),[r,o]=(0,v.useState)([s.min,s.max]),i=(0,v.useMemo)(()=>(0,di.A)(t=>{const s=(0,mi.N1)({min:t[0],max:t[1]});e((0,R.uN)(s))},500),[e]);(0,v.useEffect)(()=>{o([s.min,s.max])},[s.min,s.max]);const a=(0,v.useCallback)(e=>{Array.isArray(e)&&2===e.length&&(o([e[0],e[1]]),i([e[0],e[1]]))},[i]);(0,v.useEffect)(()=>()=>{i.cancel()},[i]);const l=(0,v.useMemo)(()=>(0,n.jsx)(Z.sA,{id:"COMMON_GENERIC_FROM_TO",values:{from:r[0],to:r[1]}}),[r]);return(0,n.jsx)(ii.A,{label:(0,n.jsx)(Z.sA,{id:"PORTS_AI_ANOMALY_SCORE"}),children:(0,n.jsx)(A.A,{flex:1,width:"100%",paddingLeft:d.kc,children:(0,n.jsx)(ui.A,{defaultValue:[s.min,s.max],value:r,onChange:a,caption:0,captionEnd:100,labelEnd:l,style:{width:"100%"}})})})},pi=(0,v.memo)(()=>{const e=(0,b.wA)(),{formatMessage:t}=(0,Z.tz)(),s=(0,b.d4)(w.N0),r=(0,b.d4)(w.K6),o=(0,b.d4)(w.$X),i=(0,b.d4)(w.UH),a=(0,v.useMemo)(()=>s.map(e=>({id:e.mac,type:"CHECKBOX",title:(0,Ae.Q)(e)+(e.isOffline?` (${t({id:"COMMON_OFFLINE"})})`:""),checkboxProps:{isTruncated:!0},children:[]})),[s,t]),l=(0,v.useMemo)(()=>new Set(r),[r]),c=(0,v.useCallback)(t=>{const s=Array.from(t||[]);if(!(o&&0===s.length&&r.length>0)&&(e((0,R.is)(s)),0!==s.length)){const t=i.filter(e=>{const t=(0,k.q9)(e).deviceMac;return s.includes(t)});t.length!==i.length&&e((0,R.Ao)(t))}},[e,o,r.length,i]),d=(0,v.useCallback)(t=>{e((0,R.is)(Array.from(t||[])))},[e]),u=(0,v.useCallback)(()=>{o&&r.length>0||e((0,R.is)([]))},[e,o,r]);return s.length>1?(0,n.jsx)(ii.A,{id:ai.R.PORTS_NATIVE_VLAN,label:(0,n.jsx)(Z.sA,{id:"COMMON_SWITCHES"}),children:(0,n.jsx)(Bo.A,{id:ai.R.PORTS_NATIVE_VLAN,items:a,selectedKeys:l,onSelectionChange:c,onSelectAll:d,onDeselectAll:u,shouldAlwaysUseSimplifiedPicker:!0,selectionMode:o?"single":"multiple"})}):null});var hi=s(241365),xi=s(767822),Ei=s(451904),_i=s(237887),Ci=s(754237),gi=s(974390),Oi=s(87449),fi=s(462440),Ni=s(898826),Si=s(365236),Ti=s(648576),Mi=s(436890),Ii=s(451336),vi=s(562896),bi=s(159911),ji=s(643022);const Di=(0,r.A)("div",(0,B.A)("connectionStatus"))`
  height: ${({connectionStatus:e})=>e===vi.v.OFFLINE?"unset":d.S2};
  flex-wrap: ${({connectionStatus:e})=>e===vi.v.OFFLINE?"wrap":"unset"};
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: ${({connectionStatus:e})=>e===vi.v.OFFLINE?"unset":d.YC};
  * {
    line-height: ${d.Er} !important;
    font-size: 13px !important;
    flex-flow: nowrap !important;
    }
  {/* Target "Connected To" */}
  div > span {
    color: ${({theme:{themeName:e}})=>$.Ay[`desktop-color-neutral-10-${e}`]} !important;
  }
  {/* Target flex container */}
  & > div {
    justify-content: space-between;
    width: ${({connectionStatus:e})=>e===vi.v.OFFLINE?"unset":"100%"};
    min-height: 24px;
  }
`,Pi=({device:e,stackingGroupModelName:t})=>{const s=(0,b.d4)(w.gR),r=(0,b.d4)(w.w2),o=(0,b.d4)(w.OA),i=(0,b.wA)(),a=t||(0,Ae.Lm)(e?.model||""),{type:l}=(0,qt.Se)(o),c=l===no.F7.MC_LAG&&r.length>1,u=(0,v.useCallback)(()=>{if(s)return void i((0,X.XP)({type:ee.H.STACKING,id:s}));const e=r[0];e&&i((0,X.XP)({type:ee.H.DEVICE,id:e,tab:K.BC.SETTINGS}))},[s,r,i]);return e&&e.model?(0,n.jsxs)(A.A,{alignItems:"center",gap:d.kc,height:d.S2,justifyContent:"space-between",children:[(0,n.jsx)(F.A,{size:"medium",color:"text-2",children:(0,n.jsx)(Z.sA,{id:"COMMON_MODEL"})}),(0,n.jsxs)(A.A,{alignItems:"center",gap:d.YC,children:[(0,n.jsx)(F.A,{size:"medium",color:"text-3",children:a}),(0,n.jsx)(us.A,{description:c?(0,n.jsx)(Z.sA,{id:"PORTS_FIRST_SELECT_SWITCH"}):null,children:(0,n.jsx)(Ni.A,{size:"small",variant:"neutral",onPress:u,isDisabled:c,...z.A.addDataTestId(z.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(fi.A,{})})})]})]}):null},yi=({firstSelectedDeviceMac:e})=>{const t=(0,b.d4)((0,Ce.tG)(e)),s=(0,b.d4)(w._h),{onUpgradeDevice:r,showButton:o,isPending:i,hasFlashStorageWarning:a,deviceName:l,fromVersion:c,toVersion:u}=(0,Si.S)(t),m=o&&1===s.length;if(!t.displayable_version)return null;const p=(0,Oi.coerce)(t.upgrade_to_firmware)?.version;return(0,n.jsxs)(A.A,{gap:d.kc,alignItems:"center",justifyContent:"space-between",height:d.S2,children:[(0,n.jsx)(F.A,{size:"medium",color:"text-2",children:(0,n.jsx)(Z.sA,{id:"COMMON_VERSION"})}),(0,n.jsxs)(A.A,{gap:d.kc,children:[(0,n.jsx)(F.A,{size:"medium",color:"text-3",children:t.displayable_version}),m?(0,n.jsx)(Mi.A,{hasFlashStorageWarning:a,deviceName:l,fromVersion:c,toVersion:u,onConfirm:r,trigger:(0,n.jsx)("div",{children:(0,n.jsx)(ji.A,{fromVersion:t.displayable_version,toVersion:t.upgrade_to_firmware,model:t.model,children:(0,n.jsx)(Ti.Ay,{variant:"inline",disabled:i,size:"medium",children:(0,n.jsx)(Z.sA,{id:"COMMON_ACTION_UPDATE_TO",values:{version:p}})})})})}):null]})]})},ki=({firstSelectedDeviceMac:e})=>{const t=(0,b.d4)((0,Ce.tG)(e)),{uplink:s}=t,r=(0,v.useMemo)(()=>(0,bi.H)((0,kn.S9)(t),s?.type),[t,s?.type]),o=Boolean(t.wan_networkgroup)||Boolean(s?.uplink_device_name),i=(0,kn.YP)(t);return o&&i?(0,n.jsx)(Di,{connectionStatus:r,children:(0,n.jsx)(Ii.A,{activeItem:{...t,deviceState:(0,kn.S9)(t)},connectionStatus:r,uplinkNameMaxWidth:r===vi.v.CONNECTED?142:116},t.mac)}):null},wi=()=>{const e=(0,b.d4)(w.IY),t=(0,b.d4)(w.w2),s=(0,b.d4)(w.OA),r=t[0],o=(0,b.d4)(w._h),i=(0,v.useMemo)(()=>{const{type:e}=(0,qt.Se)(s);return e},[s]),a=(0,v.useMemo)(()=>i===no.F7.MC_LAG,[i]),l=(0,v.useMemo)(()=>i===no.F7.STACKING_GROUP,[i]),c=(0,b.d4)((0,v.useMemo)(()=>(0,Ce.nH)(t),[t])),u=(0,b.d4)((0,v.useMemo)(()=>(0,Ce.nH)(o),[o])),{formatMessage:m}=(0,Z.tz)(),p=m({id:"PORTS_STACKING_MODEL_POE_SUFFIX"}),h=(0,v.useMemo)(()=>l&&0!==u.length?((e,t)=>{if(0===e.length)return null;const s=e.map(e=>(0,Ae.Lm)(e.model)),n=Array.from(new Set(s));if(1===n.length)return n[0];const r=n.some(e=>e.toLowerCase().includes("poe")),o=n.some(e=>!e.toLowerCase().includes("poe"));if(r&&o){const e=n.find(e=>!e.toLowerCase().includes("poe"));if(e)return`${e} ${t}`}return n[0]})(u,p):null,[l,u,p]),x=(0,v.useMemo)(()=>a&&c[0]?c[0]:l&&u.length>0&&u[0]?u[0]:e?.device?e.device:null,[a,l,c,u,e]);return(0,n.jsxs)(A.A,{flexDirection:"column",paddingLeft:d.kc,paddingRight:d.kc,gap:d.kc,children:[(0,n.jsxs)(A.A,{flexDirection:"column",children:[(0,n.jsx)(Pi,{device:x,stackingGroupModelName:h}),(0,n.jsx)(yi,{firstSelectedDeviceMac:r}),(0,n.jsx)(ki,{firstSelectedDeviceMac:r})]}),(0,n.jsx)(uo.A,{orientation:"horizontal"})]})},Ri=(0,r.A)(_i.A)`
  z-index: ${hi.Ay["z-index-side-panel"]-1};
`,Li=(0,r.A)("div",(0,B.A)("isOffline","themeName"))`
  ${({isOffline:e,themeName:t})=>e?`\n    color: ${hi.Ay.motifs[t].text03} !important;\n  `:""}
`,$i=()=>{const e=(0,b.wA)(),t=(0,b.d4)(w.OA),s=(0,b.d4)(w.Mi),r=(0,b.d4)(w.$X),o=(0,b.d4)(w.QR),i=(0,b.d4)(w.fD),{setSelectedPortsAndAssignColors:a}=an(),{formatMessage:l}=(0,Z.tz)(),{themeName:c}=(0,G.u)(),u=(0,v.useCallback)(t=>{if(e((0,R.Ao)([])),e((0,R.U)(t)),e((0,R.E1)(t!==Qt.Zt)),t===Qt.Zt)return e((0,R.IU)(!1)),void e((0,R.JL)(!1));if(o){const{deviceMacs:e}=(0,qt.Se)(t),s=new Set(e),n=i.filter(e=>s.has(e.device.mac)).map(e=>e.id);n.length>0&&a(n)}if(r){const n=s.find(e=>e.value===t);if(n?.includeDevices?.length)return void e((0,R.is)([n?.includeDevices?.[0]]))}e((0,R.is)([]))},[e,r,o,i,a,s]),m=[{value:(0,qt.HN)(no.F7.ALL,[]),label:l({id:"COMMON_ALL_PORTS"}),image:(0,n.jsx)(Ei.A,{})},...s.map(e=>({value:e.value,label:e.label+(e.isOffline?` (${l({id:"COMMON_OFFLINE"})})`:""),isOffline:e.isOffline,image:e.hasError?(0,n.jsx)(U.A,{size:"original",variant:"fill",color:$.Ay[`desktop-color-red-06-${c}`],fill:$.Ay[`desktop-color-neutral-00-${c}`]}):e.hasWarning?(0,n.jsx)(U.A,{size:"original",variant:"fill",color:$.Ay[`desktop-color-orange-06-${c}`],fill:$.Ay[`desktop-color-neutral-00-${c}`]}):(0,n.jsx)(gi.A,{width:Qt.NK,height:Qt.NK,model:e.deviceProperties?.model})}))],p=(0,v.useCallback)(e=>(0,n.jsx)(Li,{isOffline:e.option.isOffline??!1,themeName:c,children:(0,n.jsx)(xi.q,{...e})}),[c]),h=(0,v.useCallback)(e=>{u(e.value)},[u]);return(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,children:[(0,n.jsx)(Ri,{variant:"secondary",searchable:!0,portal:!0,width:"full",onChange:h,options:m,renderOption:p,value:t,maxHeight:Ci.W}),t!==Qt.Zt?(0,n.jsx)(wi,{}):null]})},Fi=(0,v.memo)(()=>{const e=(0,Gs.D)()===zs.o.SFP_ANALYZER,t=(0,b.d4)(w.QR),s=(0,b.d4)(w.OA)===Qt.Zt,r=(0,b.d4)(w.$X),o=(0,b.d4)(w.wJ),i=(0,$e.Ki)(o),l=!r,c=!s&&!e,u=!s&&!e&&i,m=!e,p=!s,h=c||m||u||p;return(0,n.jsx)(mo.A,{columns:e?null:(0,n.jsx)(Wo,{}),leftFilterColumnsId:Lo.PORTS,footer:(0,n.jsx)($o,{leftFilterPageId:a.g1.PORT_MANAGEMENT}),leftFilterPageId:a.g1.PORT_MANAGEMENT,tabs:(0,n.jsx)(go.Ay,{}),children:(0,n.jsxs)(A.A,{flexDirection:"column",children:[(0,n.jsxs)(Ao.A,{children:[e?null:(0,n.jsx)($i,{}),e?null:(0,n.jsx)(pi,{}),h?(0,n.jsxs)(A.A,{flexDirection:"column",gap:d.kc,padding:d.kc,children:[(0,n.jsxs)(A.A,{flexDirection:"column",children:[c?(0,n.jsx)(Eo,{}):null,p?(0,n.jsx)(Co,{}):null,u?(0,n.jsx)(xo,{}):null,m?(0,n.jsx)(_o,{}):null]}),(0,n.jsx)(uo.A,{orientation:"horizontal"})]}):null,l?(0,n.jsx)(Ai,{}):null,t?(0,n.jsx)(Go,{}):null]}),l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ao.A,{children:(0,n.jsx)(Jo,{})}),e?null:(0,n.jsx)(li,{}),(0,n.jsxs)(Ao.A,{children:[(0,n.jsx)(si,{}),e?null:(0,n.jsx)(oi,{}),(0,n.jsx)(ci.Ay,{})]})]}):null]})})}),Ui=(0,r.A)(A.A)`
  flex-direction: column;
  gap: ${d.kc};
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  padding: ${d.xO} 0 0 ${d.Ln};
`,Vi=()=>((()=>{const e=(0,b.wA)(),t=(0,Gs.D)(),s=t===zs.o.SFP_ANALYZER,n=(0,v.useRef)(t);(0,v.useEffect)(()=>{e((0,R.EZ)(s)),s&&e((0,R.U)(Qt.Zt)),n.current!==t&&(e((0,R.Ff)({...Qt.Fs})),e((0,R.Ao)([])),e((0,R.JL)(!1)),e((0,R.IU)(!1)),e((0,R.T6)(!1)),n.current=t)},[e,s,t])})(),(0,c.A)([(0,l.Zi)(i.B.PORTS),(0,l.Zi)(i.B.DEVICES),(0,l.Zi)(i.B.SETTINGS),(0,f.J4)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,E.d9)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,M.$3)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,x.hh)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,h.F)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,T.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,_.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,g.kE)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,O.Sk)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,N.s)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,S.N)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,C.G)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,I.ot)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})],(0,n.jsx)(u.A,{mainPanelProps:{gap:d.Ln},children:(0,n.jsx)(m.A,{leftFilterPageId:a.g1.PORT_MANAGEMENT,content:(0,n.jsx)(Fi,{}),overflow:"hidden",paddingBottom:d.Ln,children:(0,n.jsx)(Ui,{children:(0,n.jsx)(co,{})})})}),{trackingName:p.VO.PORTS}))},170427(e,t,s){s.d(t,{A:()=>m});var n=s(274934),r=s(938984),o=s(247816),i=s(309130),a=s(304151),l=s(100978);const c=(0,o.A)(r.A)`
  white-space: nowrap;
`,d=(0,o.A)(l.A)`
  align-items: center;
`,u=(0,o.A)(l.A)`
  width: ${i.Ln};
  justify-content: flex-start;
`,m=({indicator:e,description:t,isSingleLine:s,tooltipDescription:r})=>(0,n.jsxs)(d,{marginRight:s?i.kc:0,children:[(0,n.jsx)(u,{children:e}),(0,n.jsx)(c,{size:"small",color:"text-3",children:t}),r?(0,n.jsx)(a.A,{description:r}):null]})},883717(e,t,s){s.d(t,{A:()=>y,T:()=>D});var n=s(274934),r=s(602086),o=s(977872),i=s(814557),a=s(248887),l=s(18391),c=s(760055),d=s(31881),u=s(920391),m=s(692972),A=s(247816),p=s(263705),h=s(513458),x=s(442175),E=s(309130),_=s(100978),C=s(470070),g=s(940229),O=s(576024),f=s(469890),N=s(956978),S=s(754924),T=s(940563),M=s(977782),I=s(291508),v=s(170427);const b=(0,A.A)("div")`
  display: grid;
  grid-template-columns: repeat(3, minmax(min-content, 1fr));
  gap: ${E.YC};
  margin-top: ${E.kc};
`,j=(0,A.A)(_.A)`
  gap: ${E.kc};
  row-gap: ${E.YC};
  flex-wrap: wrap;
`,D=(0,A.A)(h.A,(0,I.A)("borderColor"))`
  flex-shrink: 0;
  border-radius: 0;
  border: ${({borderColor:e,theme:{themeName:t}})=>e&&`1px solid ${(0,g.oX)(e,t)}`};
`,P=(e,t)=>e===M.s.PASSTHROUGH?1:e===M.s.PASSIVE?2:e===M.s.POE?3:e===M.s.POE_PLUS?4:e===M.s.POE_PLUS_PLUS?5:6,y=({deviceMac:e,isSingleLine:t=!1,hidePoe:s=!1,hideDisabled:A=!1,hideDisconnected:h=!1,displayedSpeedList:E})=>{const{themeName:_}=(0,p.u)(),I=(0,o.d4)((0,r.useMemo)(()=>(0,S.tG)(e),[e])),{type:y,model:k}=I;return(0,r.useMemo)(()=>{const e=(0,O.MB)(I),r=(0,N.NuO)(I),o=(0,f._L)(I,r),p=A||(0,N.m_j)(I)||(0,N.Syn)(I)||(0,N.Fp0)(I),S=t?j:b,k=Array.from(o).sort(P).map(e=>{switch(!0){case e===M.s.POE_PLUS_PLUS_PLUS:return(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS_PLUS"}),indicator:(0,n.jsx)(a.A,{color:i.Ay[`desktop-color-neutral-08-${_}`]})},e);case e===M.s.POE_PLUS_PLUS:return(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}),indicator:(0,n.jsx)(l.A,{color:i.Ay[`desktop-color-neutral-08-${_}`]})},e);case e===M.s.POE_PLUS:return(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:"COMMON_DEVICE_POE_MODE_POE_PLUS"}),indicator:(0,n.jsx)(c.A,{color:i.Ay[`desktop-color-neutral-08-${_}`]})},e);case e===M.s.PASSTHROUGH||e===M.s.PASSIVE||e===M.s.POE:return(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:e===M.s.PASSIVE?"COMMON_DEVICE_POE_MODE_PASSIVE":"COMMON_DEVICE_POE_MODE_POE"}),indicator:(0,n.jsx)(d.A,{color:i.Ay[`desktop-color-neutral-08-${_}`]})},e);default:return null}});return(0,n.jsxs)(S,{children:[e.filter(e=>!E||E.includes(e)).sort((e,t)=>e-t).map(e=>(0,n.jsx)(v.A,{description:(0,x.ir)(e),indicator:(0,n.jsx)(D,{color:(0,g.oX)((T.A[e]??T.A.DEFAULT).background,_)})},e)),h?null:(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:"COMMON_DISCONNECTED"}),indicator:(0,n.jsx)(D,{color:(0,g.oX)(T.A.DEFAULT.background,_)})},"disconnected"),p?null:(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:"COMMON_DISABLED"}),indicator:(0,n.jsx)(D,{color:"transparent",borderColor:T.A.DEFAULT.background}),isSingleLine:t},"disabled"),s?null:k,!(0,N.Tbi)({type:y})||(0,N.Syn)(I)||(0,N.Fp0)(I)?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.A,{description:(0,n.jsx)(C.sA,{id:"COMMON_AGGREGATING"}),indicator:(0,n.jsx)(m.A,{color:i.Ay[`desktop-color-neutral-08-${_}`]})},"aggregating"),(0,n.jsx)(v.A,{indicator:(0,n.jsx)(u.A,{}),description:(0,n.jsx)(C.sA,{id:"DEVICE_PORT_STATE_MIRROR"}),tooltipDescription:(0,n.jsx)(C.sA,{id:"DEVICE_PORT_STATE_MIRROR_TOOLTIP"})},"mirror")]})]})},[k,s,A,E,_])}},45523(e,t,s){s.d(t,{$:()=>o,k:()=>r});var n=s(16845);const r={[n.vL.DISABLED]:{background:"neutral-01",border:"neutral-04",text:"neutral-07"},[n.vL.NATIVE]:{background:"neutral-01",border:"neutral-04",text:"neutral-07"},[n.vL.TAGGED]:{background:"green-06",border:"green-06",text:"neutral-00"},[n.vL.BLOCKED]:{background:"neutral-05",border:"neutral-05",text:"neutral-00"},[n.vL.WAN]:{background:"neutral-00",border:"neutral-04",text:"neutral-07"},[n.vL.UNTAGGED_NATIVE]:{background:"ublue-04",border:"ublue-04",text:"neutral-00"}},o="-"},16845(e,t,s){var n,r,o;s.d(t,{at:()=>r,dv:()=>n,vL:()=>o}),function(e){e.DISPLAYED_VLAN_ID="nativeVlanId",e.IS_WAN_PORT="isWanPort",e.ADJUSTED_PORT_NUMBER="adjustedPortNumber",e.IS_MANAGED_BY_PORT_PROFILE="isManagedByPortProfile",e.IS_DISABLED="isDisabled"}(n||(n={})),function(e){e.IS_TAGGED="isTagged",e.IS_NETWORK_NATIVE_ON_PORT="isNetworkNativeOnPort",e.ADJUSTED_PORT_NUMBER="adjustedPortNumber",e.IS_WAN_PORT="isWanPort",e.IS_MANAGED_BY_PORT_PROFILE="isManagedByPortProfile",e.IS_DISABLED="isDisabled"}(r||(r={})),function(e){e.BLOCKED="BLOCKED",e.TAGGED="TAGGED",e.DISABLED="DISABLED",e.NATIVE="NATIVE",e.WAN="WAN",e.UNTAGGED_NATIVE="UNTAGGED_NATIVE"}(o||(o={}))},727337(e,t,s){s.d(t,{E:()=>d,Np:()=>m,SH:()=>u});var n=s(255045),r=s(940229),o=s(64222),i=s(95546),a=s(857780),l=s(16845),c=s(45523);const d=(e,t,s)=>{let n=e.port_table?.find(e=>e.port_idx===t),r=n?.portconf_id?s.find(e=>e._id===n?.portconf_id):void 0;const o=n?.name;let i=t;if(!n?.aggregate_members?.length){const o=e.port_table?.find(e=>e.aggregate_members?.includes(t)&&e.port_idx!==t);null!=o?.port_idx&&(i=o.port_idx,n=o,r=n?.portconf_id?s.find(e=>e._id===n?.portconf_id):void 0)}return{profile:r,portData:n,adjustedPortNumber:i,originalPortName:o}},u=(e,t)=>`${e?.vlan||(t||e&&e?.networkgroup!==a.vj.LAN?c.$:1)}`,m=(e,t,s,c)=>(e.port_table||[]).reduce((m,A)=>{if(null==A.port_idx)return m;const{profile:p,portData:h,adjustedPortNumber:x}=d(e,A.port_idx,t),E=p?p.native_networkconf_id:h?.native_networkconf_id,_=p?p.excluded_networkconf_ids:h?.excluded_networkconf_ids,C=p?p.tagged_vlan_mgmt:h?.tagged_vlan_mgmt,g=E===o.F,O=s.find(e=>e._id===E),f=(0,r.Ue)(h?.ifname,e)||(0,r.m)(e,A.port_idx),N=(0,r.Xq)(h?.ifname,e),S=C===a.sg.BLOCK_ALL,T=C===a.sg.AUTO,M=(0,r.$k)(h?.ifname,e),I=!!h&&(M.includes(n.Vd.INTERFACE_DISABLED)||(0,i.Rj)(h));m.nativeNetwork[A.port_idx]={excluded_networkconf_ids:_,native_networkconf_id:E??c,tagged_vlan_mgmt:C??a.sg.AUTO,[l.dv.DISPLAYED_VLAN_ID]:u(O,g),[l.dv.IS_WAN_PORT]:f,[l.dv.ADJUSTED_PORT_NUMBER]:x,[l.dv.IS_MANAGED_BY_PORT_PROFILE]:!!p,[l.dv.IS_DISABLED]:I};const v=s.reduce((e,t)=>{const s=(E??c)===t?._id&&N,n=!_?.includes(t._id),r=!s&&!S&&N&&(n||T);return e[t._id]={port_idx:A.port_idx,excluded_networkconf_ids:_,[l.at.IS_TAGGED]:r,[l.at.IS_NETWORK_NATIVE_ON_PORT]:s,[l.at.ADJUSTED_PORT_NUMBER]:x,[l.at.IS_WAN_PORT]:f,[l.at.IS_MANAGED_BY_PORT_PROFILE]:!!p,[l.at.IS_DISABLED]:I},e},{});return m.taggedNetworks[A.port_idx]=v,m},{nativeNetwork:{},taggedNetworks:{}})},800528(e,t,s){s.d(t,{Ay:()=>S});var n=s(274934),r=s(602086),o=s(237725),i=s(977872),a=s(141992),l=s(272338);const c=(0,l.w)(e=>(0,r.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 5h14v9h-2v2H5v-2H3V5Zm3.5 9a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7Z",fill:"currentColor",className:e.twotonedclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 14h2V5H3v9h2v2h10v-2Zm2 1a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-1h1Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{d:"M6 14.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 14h2V5H3v9h2v2h10v-2Zm2 1a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-1h1Z",fill:"currentColor",className:e.fillclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 5h14v9h-2v2H5v-2H3V5Zm3.5 9a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7Z",fill:"currentColor",className:e.fillclassname}))),d=(0,l.w)(e=>(0,r.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,r.createElement)("path",{d:"M2 5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5Z",fill:"currentColor",className:e.twotonedclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 5H3v8h12V5ZM3 4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3Zm4.765 2.559a.5.5 0 0 1 .514.026l3 2.02a.5.5 0 0 1-.004.833l-3 1.98A.5.5 0 0 1 7.5 11V7a.5.5 0 0 1 .265-.441Zm.735 1.38v2.132l1.599-1.055L8.5 7.939ZM17 6a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1h13V6Z",fill:"currentColor",className:e.baseclassname}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5Zm6.28 1.585A.5.5 0 0 0 7.5 7v4a.5.5 0 0 0 .775.417l3-1.98a.5.5 0 0 0 .004-.832l-3-2.02ZM17 6a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1h13V6Z",fill:"currentColor",className:e.fillclassname})));var u,m=s(504238),A=s(101134),p=s(85254),h=s(950681),x=s(367828),E=s(104997),_=s(470070),C=s(20049),g=s(963945);!function(e){e.MAIN="MAIN",e.SFP="SFP",e.AV_MANAGER="AV_MANAGER"}(u||(u={}));const O={[u.MAIN]:x.o.PORTS,[u.SFP]:x.o.SFP_ANALYZER,[u.AV_MANAGER]:x.o.AV_MANAGER},f={[x.o.PORTS]:u.MAIN,[x.o.SFP_ANALYZER]:u.SFP,[x.o.AV_MANAGER]:u.AV_MANAGER},N=[{icon:(0,n.jsx)(m.A,{size:"original"}),label:(0,n.jsx)(_.sA,{id:"COMMON_MAIN"}),id:u.MAIN},{icon:(0,n.jsx)(c,{size:"original"}),label:(0,n.jsx)(_.sA,{id:"COMMON_MEDIA_SFP"}),id:u.SFP},{icon:(0,n.jsx)(d,{size:"original"}),label:(0,n.jsx)(_.sA,{id:"COMMON_AV_MANAGER"}),id:u.AV_MANAGER}],S=(0,r.memo)(()=>{const e=(0,g.D)(),t=f[e]||u.MAIN,s=(()=>{const e=(0,A.A)(E.VO.PORTS),t=(0,A.A)(`${E.VO.PORTS}/${x.o.SFP_ANALYZER}`),s=(0,A.A)(`${E.VO.PORTS}/${x.o.AV_MANAGER}`),n=(0,o.W6)();return(0,r.useCallback)(r=>{switch(r){case x.o.SFP_ANALYZER:n.push(t);break;case x.o.AV_MANAGER:n.push(s);break;default:n.push(e)}},[n,e,t,s])})(),a=(()=>{const e=(0,g.D)()===x.o.SFP_ANALYZER,{upSfpCount:t}=(0,i.d4)(C.Dj),s=(0,i.d4)(C.CQ),n=(0,i.d4)(h.OA),o=(0,i.d4)(h.nZ),[a,l]=(0,r.useState)(n);(0,r.useEffect)(()=>{(t||e)&&l(!0)},[t,e]);const c=(0,r.useMemo)(()=>({[u.MAIN]:s,[u.SFP]:a,[u.AV_MANAGER]:o}),[s,a,o]);return(0,r.useMemo)(()=>N.filter(({id:e})=>c[e]),[c])})(),l=(0,r.useCallback)(e=>{const t=O[e.id];t&&s(t)},[s]);return a.length>1?(0,n.jsx)(p.A,{tabs:a,selectedTab:t,onSelectTab:l}):null})},108825(e,t,s){s.d(t,{Ay:()=>g,PB:()=>_});var n=s(274934),r=s(602086),o=s(977872),i=s(161004),a=s(115238),l=s(233288),c=s(470070),d=s(367828),u=s(20049),m=s(963945),A=s(10695),p=s(212635),h=s(795186),x=s(894357);const E=[p.f4.SFP,p.f4.SFPPLUS,p.f4.SFP28,p.f4.QSFP28],_={[p.f4.FE]:"COMMON_MEDIA_FE",[p.f4.GE]:"COMMON_MEDIA_GE",[p.f4.GE_2P5]:"COMMON_MEDIA_2P5GE",[p.f4.GE_10]:"COMMON_MEDIA_10GE",[p.f4.GE_25]:"COMMON_MEDIA_25GE",[p.f4.GE_40]:"COMMON_MEDIA_40GE",[p.f4.GE_100]:"COMMON_MEDIA_100GE",[p.f4.SFP]:"COMMON_MEDIA_SFP",[p.f4.SFPPLUS]:"COMMON_MEDIA_SFPPLUS",[p.f4.SFP28]:"COMMON_MEDIA_SFP28",[p.f4.QSFP28]:"COMMON_MEDIA_QSFP28"},C={[p.f4.FE]:1,[p.f4.GE]:2,[p.f4.GE_2P5]:3,[p.f4.GE_10]:4,[p.f4.GE_25]:5,[p.f4.GE_40]:6,[p.f4.GE_100]:7,[p.f4.SFP]:8,[p.f4.SFPPLUS]:9,[p.f4.SFP28]:10,[p.f4.QSFP28]:11},g=(0,r.memo)(()=>{const e=(0,o.wA)(),{formatNumber:t,formatMessage:s}=(0,c.tz)(),p=(0,o.d4)(e=>(0,x.e)(e).media),g=(0,o.d4)(u.T4),O=(0,r.useMemo)(()=>Object.values(p),[p]),f=(0,m.D)()===d.o.SFP_ANALYZER,N=(0,r.useMemo)(()=>O.map(e=>e[h.x.ID]),[O]),S=(0,r.useCallback)(t=>{e((0,A.Vw)(Array.from(t||[])))},[e]),T=(0,r.useCallback)(t=>{e((0,A.Vw)(Array.from(t||[])))},[e]),M=(0,r.useCallback)(()=>{e((0,A.Vw)([]))},[e]),I=(0,r.useMemo)(()=>O.filter(e=>!f||E.includes(e[h.x.ID])).sort((e,t)=>C[e[h.x.ID]]-C[t[h.x.ID]]).map(e=>({id:e[h.x.ID],type:"CHECKBOX",title:`${s({id:_[e[h.x.ID]]})} (${t(e[h.x.COUNT])})`,children:[]})),[O,f,s,t]),v=(0,r.useMemo)(()=>g.length===O.length?"all":new Set(g),[g,O.length]),b=(0,r.useMemo)(()=>new Set(O.filter(e=>!g.includes(e[h.x.ID])&&!p[e[h.x.ID]][h.x.COUNT]).map(e=>e[h.x.ID])),[O,p,g]);return(0,a.A)(g,N,A.Vw),O.length?(0,n.jsx)(l.A,{label:(0,n.jsx)(c.sA,{id:"COMMON_LINK_SPEED"}),isSingleColumn:!0,children:(0,n.jsx)(i.A,{shouldAlwaysUseSimplifiedPicker:!0,items:I,selectedKeys:v,disabledKeys:b,onSelectionChange:S,onSelectAll:T,onDeselectAll:M})}):null})},894357(e,t,s){s.d(t,{C:()=>d,e:()=>u});var n=s(222102),r=s(430328),o=s(20049),i=s(197571),a=s(212635),l=s(795186),c=s(64350);const d="__NONE__",u=(0,r.WY)()((0,n.Mz)(o.xP,(0,o.IS)([a.s9.PORTS_MEDIA]),(0,o.IS)([a.s9.PORTS_POE]),(0,o.IS)([a.s9.PORTS_NATIVE_VLAN]),(0,o.IS)([a.s9.PORTS_STATUS]),(0,o.IS)([a.s9.PORTS_STP]),i.Ct,o.Hz,(e,t,s,n,r,o,i,u)=>{const m={},A={},p={},h={},x={},E=e.length;for(let t=0;t<E;t+=1){const s=e[t],n=s.filterMedia;n.length&&n.forEach(e=>{m[e]||(m[e]={[l.x.ID]:e,[l.x.NAME]:e,[l.x.COUNT]:0})});const r=s.filterPoe;A[r]||(A[r]={[l.x.ID]:r,[l.x.NAME]:r,[l.x.COUNT]:0});const o=s?.nativeNetworkConfIdSubstituted;if(void 0!==o){const e=""===o,t=e?d:o;if(!p[t]){const s=o?i.find(({_id:e})=>e===o):void 0;p[t]={[l.x.ID]:t,[l.x.NAME]:e?d:s?.name,[l.x.COUNT]:0,[l.x.VLAN_ID]:s?.vlan??1}}}const a=s.filterStatus;a.length&&a.forEach(e=>{h[e]||(h[e]={[l.x.ID]:e,[l.x.NAME]:e,[l.x.COUNT]:0})}),(0,c.L0)(s).forEach(e=>{x[e]||(x[e]={[l.x.ID]:e,[l.x.NAME]:e,[l.x.COUNT]:0})})}u&&!h[a.fA.IN_USE]&&(h[a.fA.IN_USE]={[l.x.ID]:a.fA.IN_USE,[l.x.NAME]:a.fA.IN_USE,[l.x.COUNT]:0});const _=t.length;for(let e=0;e<_;e+=1){const s=t[e].filterMedia;s.length&&s.forEach(e=>{m[e]&&(m[e]={...m[e],[l.x.COUNT]:m[e][l.x.COUNT]+1})})}const C=s.length;for(let e=0;e<C;e+=1){const t=s[e].filterPoe;A[t]&&(A[t]={...A[t],[l.x.COUNT]:A[t][l.x.COUNT]+1})}const g=n.length;for(let e=0;e<g;e+=1){const t=n[e].nativeNetworkConfIdSubstituted;if(void 0!==t){const e=""===t?d:t;p[e]&&(p[e]={...p[e],[l.x.COUNT]:p[e][l.x.COUNT]+1})}}const O=r.length;for(let e=0;e<O;e+=1){const t=r[e].filterStatus;t.length&&t.forEach(e=>{h[e]&&(h[e]={...h[e],[l.x.COUNT]:h[e][l.x.COUNT]+1})})}const f=o.length;for(let e=0;e<f;e+=1)(0,c.L0)(o[e]).forEach(e=>{x[e]&&(x[e]={...x[e],[l.x.COUNT]:x[e][l.x.COUNT]+1})});return{media:m,poe:A,nativeVlan:p,status:h,stp:x}}),e=>e)},795186(e,t,s){var n;s.d(t,{x:()=>n}),function(e){e.COUNT="count",e.NAME="name",e.ID="id",e.VLAN_ID="vlan_id"}(n||(n={}))},963945(e,t,s){s.d(t,{D:()=>l});var n=s(237725),r=s(101134),o=s(367828),i=s(104997),a=s(331302);const l=()=>{const e=(0,r.A)(`${i.VO.PORTS}/${o.o.AV_MANAGER}`),t=Boolean((0,n.W5)(e)),s=(0,r.A)(`${i.VO.PORTS}/:${a.On}`),l=(0,n.W5)(s),c=l?.params?.[a.On];return t?o.o.AV_MANAGER:c===o.o.SFP_ANALYZER?o.o.SFP_ANALYZER:o.o.PORTS}},645951(e,t,s){s.d(t,{A:()=>l});var n=s(274934),r=s(938984),o=s(309130),i=s(470070),a=s(100978);const l=({messages:e=[]})=>e.length?(0,n.jsx)(a.A,{flexDirection:"column",gap:o.kc,children:e.map(([e,t={}])=>(0,n.jsx)(r.A,{color:"inherit",size:"inherit",children:(0,n.jsx)(i.sA,{id:e,values:t})},e))}):null},537417(e,t,s){s.d(t,{A:()=>r});var n=s(938984);const r=(0,s(247816).A)(n.A)`
  white-space: nowrap;
`},530110(e,t,s){s.d(t,{A:()=>N});var n=s(274934),r=s(602086),o=s(977872),i=s(396489),a=s.n(i),l=s(938984),c=s(954702),d=s(215202),u=s(722837),m=s(147328),A=s(486529),p=s(7476),h=s(252445),x=s(470070),E=s(570801),_=s(94411),C=s(332530),g=s(158402),O=s(39279),f=s(696766);const N=({leftFilterPageId:e,...t})=>{const s=(0,o.wA)(),i=(0,r.useRef)(null),N=(0,m.A)(i),S=A.l[t.tableType],T=Boolean(S),M=(0,_.A)(t.tableType),I=(0,o.d4)(E.Bm),v=(0,r.useCallback)(()=>{const e=C.W2.tables?.[t.tableType],n=[...e?.initialColumns||[]],r=e?.columnOrder,o={[t.tableType]:{initialColumns:n,...r?{columnOrder:r}:{},initialColumnSnapshot:n.reduce((e,t)=>(e[String(t)]=!0,e),{...e?.initialColumnSnapshot||{}})}};T&&(o[t.tableType].columnSize=S,t.tableType===u.l.UNIFI_DEVICE&&A.t.forEach(e=>{o[e]={columnSize:S}})),s((0,g.zF)(o))},[s,t.tableType,T,S]),b=(0,r.useCallback)(()=>{s((0,h.Zi)(e))},[s,e]),j=(0,r.useMemo)(()=>{const e=a()([...C.W2.tables?.[t.tableType]?.initialColumns||[]].sort(),[...M?.initialColumns||[]].sort()),s=a()(C.W2.tables?.[t.tableType]?.columnOrder,M?.columnOrder);if(T){let n=!M?.columnSize||a()(S,M?.columnSize);if(t.tableType===u.l.UNIFI_DEVICE){const e=A.t.every(e=>!I[e]?.columnSize||a()(S,I[e]?.columnSize));n=n&&e}return e&&s&&n}return e&&s},[t.tableType,M,T,I,S]);return(0,n.jsx)(f.CW,{hasOverflow:N,children:(0,n.jsxs)(f.kp,{ref:i,children:[(0,n.jsx)(d.D,{variant:"small",children:(0,n.jsx)(x.sA,{id:"COMMON_CUSTOMIZE_COLUMNS"})}),(0,n.jsx)(p.A,{...t}),(0,n.jsxs)(f.Ot,{children:[(0,n.jsx)(O.d$,{}),(0,n.jsx)(c.A,{type:"button",onPress:v,isDisabled:j,children:(0,n.jsx)(l.A,{size:"medium",color:"inherit",children:(0,n.jsx)(x.sA,{id:"COMMON_ACTION_RESTORE"})})}),(0,n.jsx)(c.A,{type:"button",onPress:b,children:(0,n.jsx)(l.A,{size:"medium",color:"inherit",children:(0,n.jsx)(x.sA,{id:"COMMON_ACTION_DONE"})})})]})]})})}},233288(e,t,s){s.d(t,{A:()=>u});var n=s(274934),r=s(300842),o=s(247816),i=s(291508),a=s(309130),l=s(100978);const c=(0,o.A)(l.A,(0,i.A)("columns"))`
  display: grid;
  grid-template-columns: ${({columns:e=2})=>`repeat(${e}, calc((100% - ${e-1} * ${a.kc}) / ${e}))`};
  user-select: none;
  column-gap: ${a.kc};
  max-width: 100%;
`,d=(0,o.A)(l.A)`
  display: flex;
  flex-direction: column;
  user-select: none;
  max-width: 100%;
`,u=({label:e,height:t,isSingleColumn:s=!1,columns:o,isEditorOpen:i=!1,initialExpanded:a=!0,isStatic:l=!1,children:u,hasPaddedContent:m=!1})=>(0,n.jsx)(r.A,{label:e,initialExpanded:a,isStatic:l,hasPaddedContent:m,isEditorOpen:i,children:(0,n.jsx)(s?d:c,{height:t,columns:o,children:u})})},373616(e,t,s){s.d(t,{A:()=>i});var n=s(274934),r=s(558844),o=s(479086);const i=({children:e})=>(0,n.jsx)(o.A,{children:(0,n.jsx)(r.y,{children:e})})},558844(e,t,s){s.d(t,{y:()=>i});var n=s(247816),r=s(309130),o=s(100978);const i=(0,n.A)(o.A)`
  flex-direction: column;
  gap: ${r.kc};
  margin: 0 0 ${r.Ln} ${r.kc};
`},479086(e,t,s){s.d(t,{A:()=>l});var n=s(274934),r=s(602086),o=s(757614),i=s(961231),a=s(614209);const l=({children:e})=>{const{[i.A.IS_MAXIMIZED]:t}=(0,r.useContext)(a.A);return(0,n.jsx)(o.A,{isHidden:t,children:e})}},115238(e,t,s){s.d(t,{A:()=>i});var n=s(602086),r=s(977872),o=s(968021);const i=(e,t,s)=>{const i=(0,r.wA)(),a=[JSON.stringify(e),JSON.stringify(t)].join(),l=(0,o.A)(a);(0,n.useEffect)(()=>{if(a!==l){const n=[],r=e.length;for(let s=0;s<r;s+=1){const r=e[s];t.includes(r)||n.push(r)}n.length&&i(s(e.filter(e=>!n.includes(e))))}},[a,l,e,t,s,i])}},85254(e,t,s){s.d(t,{A:()=>x});var n=s(274934),r=s(602086),o=s(383061),i=s(590979),a=s(202730),l=s(39279),c=s(247816),d=s(309130);const u=(0,c.A)("div")`
  > nav > button {
    display: flex;
    flex-direction: row;
    gap: ${d.YC};
  }
`;var m=s(409844);const A=m.AH`
  height: 32px;
`,p=m.AH`
  padding: ${d.YC} !important;
`,h=m.AH`
  padding: ${d.YC} ${d.Ln} !important;
`,x=({selectedTab:e,tabs:t,...s})=>{const c=t.length<=2,d=(0,r.useMemo)(()=>c?t:t.map(t=>e===t.id?t:{...t,label:void 0}),[t,e,c]);return d.length>1?(0,n.jsx)(l.T_,{...i.A.addDataTestId(a.b.LEFT_FILTER_PANEL_TABS),children:(0,n.jsx)(u,{children:(0,n.jsx)(o.A,{variant:"capsule",stretched:!0,className:A,tabsClassName:A,tabClassName:p,selectedTabClassName:c?void 0:h,tabs:d,selectedTab:e,...s})})}):null}},919095(e,t,s){s.d(t,{A:()=>h});var n=s(274934),r=s(602086),o=s(977872),i=s(383061),a=s(263413),l=s(775113),c=s(947414),d=s(309130),u=s(100978),m=s(897166),A=s(639262);const p=(0,s(247816).A)(A.A)`
  [data-uic-component='RangeCalendar.Container'] {
    padding: 0;
  }
`,h=({presets:e=[],selectedPreset:t,range:s,onSelectTab:A=c.P1,onSelectCustomRange:h=c.P1,showCalendar:x=!1})=>{const E=(0,o.d4)(m.hq),_=(0,r.useMemo)(()=>(0,l.A)(new Date,"ZonedDateTime",E),[E]),C=(0,r.useMemo)(()=>(0,a.A)({start:(0,l.A)(s?.startDate,"ZonedDateTime",E),end:(0,l.A)(s?.endDate,"ZonedDateTime",E)}),[s,E]),g=(0,r.useCallback)(({start:e,end:t})=>{h({startDate:e.toDate(E),endDate:t.toDate(E)})},[h,E]);return(0,n.jsxs)("div",{children:[e.length?(0,n.jsx)(i.A,{variant:"filter",tabs:e,selectedTab:t,onSelectTab:A,stretched:!0}):null,x?(0,n.jsx)(u.A,{marginTop:d.xO,children:(0,n.jsx)(p,{value:C,onChange:g,maxValue:_})}):null]})}},641671(e,t,s){s.d(t,{A:()=>l});var n=s(274934),r=s(579902),o=s(100978),i=s(974390),a=s(650632);const l=({connectedClient:e,connectedDevice:t,size:s,wanProviderAsn:l,wanProviderName:c})=>(0,n.jsxs)(n.Fragment,{children:[c?(0,n.jsx)(r.A,{asn:l,name:c,style:{userSelect:"none",display:"block",height:"20px",width:"20px",objectFit:"contain",margin:"0 auto"},useFallback:!0}):null,!c&&t?(0,n.jsx)(i.A,{model:t.model,width:s,height:s}):null,c||t||!e?null:(0,n.jsx)(o.A,{height:s,minWidth:s,maxWidth:s,justifyContent:"center",alignItems:"center",children:(0,n.jsx)(a.A,{client:e})})]})},225889(e,t,s){s.d(t,{A:()=>c});var n=s(274934),r=s(853777),o=s(938984),i=s(470070),a=s(100978),l=s(309130);const c=()=>(0,n.jsxs)(a.A,{gap:l.kc,children:[(0,n.jsx)(r.A,{isActive:!0}),(0,n.jsx)(o.A,{size:"small",children:(0,n.jsx)(i.sA,{id:"DEVICE_DIAGRAM_MISSING"})})]})},698950(e,t,s){s.d(t,{A:()=>p});var n=s(274934),r=s(247816),o=s(409844),i=s(291508),a=s(470070),l=s(309130),c=s(100978),d=s(537417);const u=(0,r.A)(c.A,(0,i.A)("alignLeft"))`
  ${({alignLeft:e})=>e?"max-width: 288px;":"max-width: 100%; justify-content: center;"}
  gap: ${l.YC};
  align-items: center;
`,m=o.AH`
  max-width: 50%;
`,A=o.AH`
  flex: 0 1 auto;
  min-width: 0;
`,p=({messageId:e,messageValues:t,buttonEl:s,alignLeft:r=!0,color:o="text-3",variant:i="body-primary"})=>(0,n.jsxs)(u,{alignLeft:r,children:[(0,n.jsx)(d.A,{variant:i,color:o,children:t?(0,n.jsx)(c.A,{maxWidth:288,whiteSpace:"nowrap",paddingRight:l.YC,children:(0,n.jsx)(a.sA,{id:e,values:t})}):(0,n.jsx)(a.sA,{id:e})}),s?(0,n.jsx)(c.A,{className:r?A:m,children:s}):null]})},488287(e,t,s){s.d(t,{A:()=>C});var n=s(274934),r=s(977872),o=s(602086),i=s(938984),a=s(590979),l=s(898809),c=s(309130),d=s(100978),u=s(449339),m=s(785068),A=s(205521),p=s(470070),h=s(754924),x=s(119425),E=s(698950),_=s(208583);const C=({last_uplink_mac:e,last_uplink_name:t,last_uplink_remote_port:s,disconnected_at:C,disabled:g,separatePortNumber:O,maxWidth:f})=>{const{formatMessage:N}=(0,p.tz)(),S=(0,r.wA)(),T=(0,r.d4)(h.CC),M=(0,_.Z)(e,T),I=(0,_.z)(t,s,M,N,O),v=(0,o.useCallback)(()=>{g||S((0,A.XP)({type:u.H.DEVICE,id:e}))},[g,S,e]);return(0,n.jsxs)(n.Fragment,{children:[M?(0,n.jsx)(E.A,{messageId:"COMMON_DEVICE_LAST_CONNECTED_TO",messageValues:{deviceWithPort:(0,n.jsx)(d.A,{width:"100%",overflow:"hidden",paddingLeft:c.YC,children:(0,n.jsx)(m.A,{onClick:v,disabled:g,...a.A.addDataTestId(a.A.TestId.SIDE_PANEL_TRIGGER),name:I,port:s,separatePortNumber:O,maxWidth:f})})}}):null,C?(0,n.jsx)("div",{children:(0,n.jsx)(i.A,{color:"text-3",children:(0,n.jsx)(x.A,{date:(0,l.gH)(C)})})}):null]})}},208583(e,t,s){s.d(t,{Z:()=>r,z:()=>o});var n=s(347625);const r=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,o=(e,t,s,r,o)=>{const i=!o&&t?` ${r({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${i}`:s?`${(0,n.Q)(s)}${i}`:r({id:"COMMON_FALLBACK"})}},783706(e,t,s){s.d(t,{A:()=>l});var n=s(274934),r=s(205240),o=s(956978),i=s(698950),a=s(949283);const l=({type:e,name:t,mac:s,uplink:l,state:c,model:d,disabled:u,alignLeft:m})=>(0,a.n)(c,l)?(0,n.jsx)(i.A,{messageId:(0,o.E4T)({model:d})?"COMMON_CONNECTED_TO":"DEVICE_MESHING_TO",alignLeft:m,buttonEl:(0,n.jsx)(r.E,{device:{type:e,name:t,mac:s,uplink:l},size:"medium",disabled:u})}):null},949283(e,t,s){s.d(t,{n:()=>a});var n=s(977872),r=s(45978),o=s(754924),i=s(313369);const a=(e,t)=>{const s=(0,n.d4)(o.CC),a=t.uplink_mac?s.find(({mac:e})=>e===t.uplink_mac):void 0,l=Boolean(t.signal);return i.q[e]===r.g.CONNECTED&&a&&l?a:void 0}},451336(e,t,s){s.d(t,{A:()=>d});var n=s(274934),r=s(783706),o=s(562896),i=s(488287),a=s(205240),l=s(698950);const c=({type:e,name:t,mac:s,uplink:r,disabled:o,maxWidth:i,peer_ubb:c,deviceState:d,ubb_pairing_state:u})=>(0,n.jsx)(l.A,{messageId:"COMMON_CONNECTED_TO",buttonEl:(0,n.jsx)(a.E,{device:{type:e,name:t,mac:s,uplink:r,peer_ubb:c,deviceState:d,ubb_pairing_state:u},maxWidth:i,disabled:o,separatePortNumber:!0})}),d=({connectionStatus:e,activeItem:{type:t,last_uplink:s,uplink:a,state:l,name:d,mac:u,model:m,disconnected_at:A,peer_ubb:p,deviceState:h,ubb_pairing_state:x},disabled:E,uplinkNameMaxWidth:_=195})=>{switch(e){case o.v.OFFLINE:return(0,n.jsx)(i.A,{last_uplink_mac:s?.uplink_mac,last_uplink_name:s?.uplink_device_name,last_uplink_remote_port:s?.uplink_remote_port,disconnected_at:A,disabled:E,separatePortNumber:!0,maxWidth:_});case o.v.MESHING:return(0,n.jsx)(r.A,{type:t,name:d,model:m,mac:u,uplink:a,state:l,disabled:E});case o.v.CONNECTED:return(0,n.jsx)(c,{type:t,name:d,mac:u,uplink:a,disabled:E,maxWidth:_,peer_ubb:p,deviceState:h,ubb_pairing_state:x});default:return null}}},562896(e,t,s){var n;s.d(t,{v:()=>n}),function(e){e.OFFLINE="offline",e.MESHING="meshing",e.CONNECTED_INTERRUPTED="connected-interrupted",e.CONNECTED="connected"}(n||(n={}))},159911(e,t,s){s.d(t,{H:()=>i});var n=s(956978),r=s(857780),o=s(562896);const i=(e,t)=>(0,n.aK8)(e)?o.v.OFFLINE:t===r.au.WIRELESS?o.v.MESHING:o.v.CONNECTED},643022(e,t,s){s.d(t,{A:()=>u});var n=s(274934),r=s(602086),o=s(87449),i=s(977872),a=s(599110),l=s(125799),c=s(470070),d=s(976458);const u=({model:e,fromVersion:t,toVersion:s,children:u})=>{const m=(0,i.d4)(d.qf),A=(0,o.coerce)(s)?.version||s,p=(0,r.useCallback)(()=>{A&&m?.(e,A)},[m,e,A]);return(0,n.jsx)(l.A,{isInteractive:!0,portal:!0,description:A&&s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:(0,n.jsx)(c.sA,{id:"COMMON_FROM_TO",values:{from:t,to:A,strong:c.ko}})}),void 0!==m?(0,n.jsx)(a.A,{variant:"inline",onClick:p,children:(0,n.jsx)(c.sA,{id:"COMMON_RELEASE_NOTES"})}):null]}):null,children:u})}},754237(e,t,s){s.d(t,{W:()=>r,k:()=>n});const n=34,r=12*n},279740(e,t,s){s.d(t,{A:()=>b});var n=s(602086),r=s(977872),o=s(244081),i=s(653547),a=s(348185),l=s(747922),c=s(79777),d=s(648552),u=s(795206),m=s(239627),A=s(45978),p=s(648126),h=s(223597);const x=new Map,E="device-watch-mode-listener",_=["mac","state"],C=["uplink_mac","type","unifi_device"],g=({mac:e,state:t},s)=>Boolean(e&&s)&&e!==s&&t===p.A[A.g.CONNECTED],O=e=>e.type!==h.sK.WIRELESS&&e.type!==h.sK.WIRED||e.unifi_device?void 0:e.uplink_mac;var f,N,S=s(222102),T=s(430328),M=s(897166),I=s(754924),v=s(34118);!function(e){e.DEVICE_MAC="device_mac",e.IS_WATCHED="is_watched",e.WATCHED_TIMEOUT="watched_timeout",e.UPDATE_INTERVAL_SECONDS="update_interval_seconds"}(f||(f={})),function(e){e.INSTANCES="instances",e.TIMEOUT="timeout"}(N||(N={}));const b=e=>{const t=(0,r.wA)(),s=(0,r.d4)((0,n.useMemo)(()=>{return t=e,(0,T.WY)()((0,S.Mz)((0,v.kV)(t,C),O),e=>e);var t},[e])),A=(0,n.useMemo)(()=>s||e,[s,e]),p=(0,r.d4)((0,n.useMemo)(()=>{return e=A,(0,T.WY)()((0,S.Mz)((0,I.bw)(e,_),M.vc,g),e=>e);var e},[A])),h=(0,r.d4)(c.a),b=(0,n.useMemo)(()=>h[d.Uz],[h]),j=(0,n.useCallback)(e=>{b.send({type:a.E.WATCH_DEVICE,device_mac:e})},[b]),D=(0,n.useCallback)(({[f.IS_WATCHED]:e,[f.WATCHED_TIMEOUT]:t,[f.DEVICE_MAC]:s})=>{if(e){const e=1e3*t;if(e>Date.now()){const t=x.get(s);t&&(t[N.TIMEOUT]=setTimeout(()=>{j(s)},(e=>Math.max(e-Date.now()-5e3,5e3))(e)))}}},[j]),P=(0,n.useCallback)(e=>(0,i.K6)(e,D,!1,(e=>`${E}::${e}`)(e)),[D]);(0,n.useEffect)(()=>{if(p){Object.keys((0,i.WM)()).some(e=>e.startsWith(E))||l._[a.E.WATCH_DEVICE].map(P);const e=x.get(A);e?e[N.INSTANCES]+=1:(j(A),x.set(A,{[N.INSTANCES]:1,[N.TIMEOUT]:void 0}))}return()=>{const e=x.get(A);e&&(e[N.INSTANCES]>1?e[N.INSTANCES]-=1:(clearTimeout(e[N.TIMEOUT]),x.delete(A)),x.size||Object.keys((0,i.WM)()).filter(e=>e.startsWith(E)).forEach(i.$N))}},[j,P,A,p]),(0,n.useEffect)(()=>{t((0,u.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}})),t((0,m.$3)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}))},[t])}},56809(e,t,s){s.d(t,{b:()=>n});const n=e=>{if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=Number.parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)?t:null}return null}},528116(e,t,s){s.d(t,{$V:()=>a,UE:()=>i,Vi:()=>l});var n=s(368741),r=s.n(n),o=s(232087);const i={NONE:{url:null,grain:null,grainInSeconds:null,translationKey:null},MINUTES:{url:o.FE.MINUTES,grain:3e5,grainInSeconds:300,translationKey:"GRANULARITY_5_MINUTES"},HOURLY:{url:o.FE.HOURLY,grain:36e5,grainInSeconds:3600,translationKey:"GRANULARITY_HOURLY"},DAILY:{url:o.FE.DAILY,grain:864e5,grainInSeconds:86400,translationKey:"GRANULARITY_DAILY"},MONTHLY:{url:o.FE.MONTHLY,grain:2592e6,grainInSeconds:2592e3,translationKey:"GRANULARITY_MONTHLY"}},a=(e,t,s,n)=>{const o=r()(t,e);return s&&(o<1||n&&o<=1)?i.MINUTES:o<=7?i.HOURLY:o<120?i.DAILY:i.MONTHLY},l=(e,t)=>{switch(e){case o.FE.DAILY:return`1${t({id:"COMMON_UNIT_D"})}`;case o.FE.HOURLY:return`1${t({id:"COMMON_UNIT_H"})}`;case o.FE.MINUTES:return`5${t({id:"COMMON_UNIT_MIN"})}`;default:return""}}}}]);