"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[22223],{576983(e,s,t){t.d(s,{A:()=>a});const a={k:{MAX:999999,MIN:64},M:{MAX:1e3,MIN:1}}},157738(e,s,t){t.d(s,{Gn:()=>C,Kh:()=>g,PN:()=>h,_$:()=>m,rt:()=>M});var a=t(943126),l=t(396489),i=t.n(l),o=t(980439),n=t(53614),r=t(110372),d=t(64222),_=t(380592),c=t(423564),A=t(95546),p=t(857780),O=t(132952),u=t(826022);const m=(e,s,t,a)=>s!==p.sg.CUSTOM?[]:a.map(e=>e._id).filter(s=>!e.includes(s)&&s!==t),C=e=>e.tagged_vlan_mgmt===p.sg.BLOCK_ALL&&e.native_networkconf_id===d.F,g=(e,s,t,a=[])=>{const{speed:l,full_duplex:d,autoneg:A}=_.A[e.portSpeed];let g=e.egressRateLimitUnit===o.A[1].value?1e3*(e.egress_rate_limit_kbps??0):e.egress_rate_limit_kbps;g=e.egress_rate_limit_kbps_enabled?g:void 0;const h=e.op_mode===r.RC.MIRROR?e.mirror_port_idx:void 0,M=e.poe_mode!==r.Gu.OFF,T=m(e.taggedVlans,e.tagged_vlan_mgmt,e.native_networkconf_id,s),b=C(e),E=e.portDisabled||e.macFilteringEnabled||b,x=((e,s,t,a)=>{const l=e.find(e=>e._id===a),i=!!l&&(0,c.nz)(l);return s?t??p.sg.AUTO:i?t===p.sg.CUSTOM?p.sg.AUTO:t??p.sg.AUTO:p.sg.BLOCK_ALL})(s,t,e.tagged_vlan_mgmt,e.native_networkconf_id),N=(0,u.iw)(x,e.native_networkconf_id,e.taggedVlans,a)?e.multicast_router_mode:p.bK.NONE,j=N===p.bK.CUSTOM?e.multicast_router_networkconf_ids?.filter(s=>(0,u.iw)(x,e.native_networkconf_id,e.taggedVlans,[s]))??[]:[];return{speed:l,full_duplex:d,autoneg:A,egress_rate_limit_kbps:g,mirror_port_idx:h,port_poe:M,excluded_networkconf_ids:T??void 0,port_security_enabled:E,tagged_vlan_mgmt:x,multicast_router_mode:N,multicast_router_networkconf_ids:j,qos_profile:i()(e.qos_profile,O.a$)?void 0:e.qos_profile,fec_mode:(0,n.K4)(e),aggregate_members:e.op_mode===r.RC.AGGREGATE||e.op_mode===r.RC.ROUTED_AGGREGATE?e.aggregate_members:[],stp_edge_state:e.stp_edge_state,stp_uplink:e.stp_uplink,routed_networkconf_id:e.op_mode===r.RC.ROUTED||e.op_mode===r.RC.ROUTED_AGGREGATE?e.routed_networkconf_id:void 0}},h=(e,s,t,l)=>{const i=t.map(e=>(0,A.q9)(e).portIdx),o=l.ethernet_table.filter(e=>i.includes(e.port_idx)).map(e=>e.name),n=C(e)||e.portDisabled,r=(0,a.A)(s||[]);return o.forEach(s=>{const t=r.find(e=>e.ifname===s);t?(t.disabled=n,e.vlanGroupId&&(t.networkgroup=e.vlanGroupId)):e.vlanGroupId&&r.push({ifname:s,disabled:n,networkgroup:e.vlanGroupId})}),r},M=(e,s,t,a)=>{const l=Math.min(...e.aggregate_members||[]);if(l&&Number.isFinite(l)){const a=s.port_overrides?.find(s=>s.aggregate_members?.some(t=>e.aggregate_members?.includes(t)&&s.port_idx!==l));return[...s.port_overrides?.filter(s=>(null==s.port_idx||!e.aggregate_members.includes(s.port_idx))&&s.port_idx!==a?.port_idx)||[],(0,n.SC)(e,s.port_table??[],l,t)]}return[...a.map(a=>({...(0,n.SC)(e,s.port_table??[],a,t)})),...(s.port_overrides||[]).filter(e=>null!=e.port_idx&&!a.includes(e.port_idx))]}},547967(e,s,t){t.d(s,{AC:()=>p,D7:()=>O,Ie:()=>b,JL:()=>g,JX:()=>T,KY:()=>u,O2:()=>A,Op:()=>c,Rm:()=>m,e$:()=>h,t7:()=>C,yr:()=>M});var a=t(938984),l=t(814557),i=t(247816),o=t(409844),n=t(291508),r=t(61322),d=t(309130),_=t(100978);const c=(0,i.A)(_.A,(0,n.A)("inline","wrap"))`
  position: relative;
  flex: ${({inline:e})=>e?"1 1 0":"0 0 100%"};
  align-items: flex-start;
  flex-flow: ${({wrap:e})=>"row "+(e?"wrap":"nowrap")};
  gap: ${d.kc};
`,A=(0,i.A)(_.A,(0,n.A)("editMaxHeight","editFieldWrap"))`
  flex-direction: column;
  max-height: ${({editMaxHeight:e})=>`${e||300}px`};
  overflow-y: auto;
  overflow-x: hidden;
  gap: ${d.YC};

  ${({editFieldWrap:e,theme:{themeName:s}})=>e?`\n    gap: 0;\n\n    > * {\n      border-bottom: ${l.Ay[`desktop-border-divider-${s}`]};\n      padding-bottom: ${d.kc};\n      padding-top: ${d.kc};\n    }\n\n    > *:first-child {\n      padding-top: 0;\n    }\n\n    > *:last-child {\n      border-bottom: none;\n      padding-bottom: 0;\n    }\n  `:""}
`,p=(0,i.A)("div",(0,n.A)("isWindowsTable","rows","tableMaxHeight","marginTop"))`
  width: 100%;
  // windows table inherits height from parent container
  height: ${({rows:e,isWindowsTable:s})=>s&&`${r.I.ROW_HEIGHT*e+r.I.HEADER_HEIGHT}`}px;
  max-height: ${({tableMaxHeight:e})=>e?`${e}px`:"auto"};
  margin-top: ${({marginTop:e})=>e||d.Ln};

  table {
    td {
      max-width: 170px;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
`,O=(0,i.A)(a.A)`
  margin-right: ${d.YC};
`,u=o.AH`
  :first-of-type {
    padding: 0 ${d.fS} 0 0px;
  }
`,m="drag-and-drop-table-row-placeholder",C=(0,i.A)(_.A)`
  flex-direction: column;

  /* Adjust weird padding on the right side for the ID column when right aligned (drag & drop table) */
  table > thead > tr > th:last-of-type {
    padding-right: ${d.kc};
  }

  /* Add missing border between drag and drop groups (tbody elements) */
  table > tbody {
    border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};
  }
  /* Last cell in table is hover content which is not used in this table */
  table > tbody[data-rbd-droppable-context-id] td:not(:last-of-type),
  table > thead > tr > th {
    /* Align drag & drop table cell padding to regular table padding */
    padding-right: ${d.kc} !important;
  }
  /* Align drop zone placeholder row when a row is dragged to matched the CSS overrides for drag and drop table we use */
  table .${m} {
    display: flex;
  }
`,g=o.AH`
  /* This is default for the table rows, so we need it for the header. */
  display: flex;
  width: 100%;

  > th:first-child {
    /* Since we flex the header, we must specify this to align with the table rows. */
    width: 24px;
  }
  > th:not(:first-child) {
    /* Something inside UIC sets the padding to 8px for table header and 5px for table rows. This aligns it to make flex work. */
    padding-right: ${d.kc} !important;
  }
`,h=o.AH`
  /* Override the padding-right of the first column to align with manage + drop modes. */
  > th:first-child {
    padding-right: ${d.kc} !important;
  }
  > th:first-child:has(> label) {
    padding-right: 1px !important;
    width: 36px;
  }
`,M=o.AH`
  /* UIC already does this for some table states, like drag and drop and when in manage mode. If we just use this ALWAYS, we're avoiding many issues related to using different alignment techniques in different places. */
  display: flex;
`,T=o.AH`
  tbody {
    display: flex;
    flex-direction: column;
  }
`;function b(e,s){return o.AH`
    width: ${s.width?`${s.width}px`:"auto"};
    min-width: ${s.minWidth?`${s.minWidth}px`:"0px"};
    flex: ${s.growthFactor||0} !important;
    padding-left: ${d.kc} !important;
    padding-right: ${d.kc} !important;
  `}},256468(e,s,t){var a;t.d(s,{EE:()=>i,Uh:()=>a,Vf:()=>l}),function(e){e.SINGLE="single",e.PLURAL="plural"}(a||(a={}));const l="editActive",i=20},96693(e,s,t){t.d(s,{r:()=>o});var a=t(274934),l=t(364905),i=t(470070);const o=[{id:l.C.AUTO,label:(0,a.jsx)(i.sA,{id:"COMMON_VALUE_AUTO"})},{id:l.C.MANUAL,label:(0,a.jsx)(i.sA,{id:"COMMON_VALUE_MANUAL"})}]},645951(e,s,t){t.d(s,{A:()=>r});var a=t(274934),l=t(938984),i=t(309130),o=t(470070),n=t(100978);const r=({messages:e=[]})=>e.length?(0,a.jsx)(n.A,{flexDirection:"column",gap:i.kc,children:e.map(([e,s={}])=>(0,a.jsx)(l.A,{color:"inherit",size:"inherit",children:(0,a.jsx)(o.sA,{id:e,values:s})},e))}):null},454928(e,s,t){t.d(s,{A:()=>i});var a=t(274934),l=t(947414);const i=({children:e})=>(0,a.jsx)("span",{onClick:e=>{e.stopPropagation()},role:"button",tabIndex:0,onKeyDown:l.P1,children:e})},753959(e,s,t){t.d(s,{A:()=>r});var a=t(274934),l=t(814557),i=t(853777),o=t(263705),n=t(612389);const r=({children:e,icon:s,background:t,...r})=>{const{themeName:d}=(0,o.u)();return(0,a.jsx)(n.A,{icon:s||(0,a.jsx)(i.A,{variant:"fill",size:"original",color:l.Ay[`desktop-color-ublue-06-${d}`]}),description:e,background:t,...r})}},549741(e,s,t){t.d(s,{A:()=>d});var a=t(274934),l=t(470070),i=t(969819),o=t(927728);const n={wifi:"COMMON_VLAN_CONFLICT_MULTI_WIFI_SINGLE_VLAN",vno:"COMMON_VLAN_CONFLICT_MULTI_VNO_SINGLE_VLAN",mixed:"COMMON_VLAN_CONFLICT_MULTI_MIXED_SINGLE_VLAN"},r={wifi:"COMMON_VLAN_CONFLICT_MULTI_WIFI_MULTI_VLAN",vno:"COMMON_VLAN_CONFLICT_MULTI_VNO_MULTI_VLAN",mixed:"COMMON_VLAN_CONFLICT_MULTI_MIXED_MULTI_VLAN"},d=({conflicts:e,singleKeyMap:s})=>{if(1===e.length){const{reason:t,entityName:i,networkName:o,switchName:n,portIdx:r}=e[0];return(0,a.jsx)(l.sA,{id:s[t],values:{entityName:i,networkName:o,switchName:n,port:r}})}const t=(e=>{const s=e.some(e=>e.reason===i.US.WIFI),t=e.some(e=>e.reason===i.US.VNO||e.reason===i.US.MGMT);return s&&t?"mixed":s?"wifi":"vno"})(e),d=[...new Set(e.map(e=>e.networkName))];if(1===d.length)return(0,a.jsx)(l.sA,{id:n[t],values:{networkName:d[0]}});const _=d.slice(0,5),c=d.length-5;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.sA,{id:r[t]}),(0,a.jsxs)(o.A,{children:[_.map(e=>(0,a.jsx)("li",{children:e},e)),c>0?(0,a.jsx)("li",{children:(0,a.jsx)(l.sA,{id:"COMMON_X_MORE",values:{count:c}})}):null]})]})}},250266(e,s,t){t.d(s,{A:()=>_});var a=t(274934),l=t(602086),i=t(696264),o=t(409844),n=t(521376),r=t(309130),d=t(470070);const _=({children:e=null,title:s,titleValues:t,message:_,messageValues:c,handleConfirm:A=()=>null,handleClose:p=()=>null,handleCancel:O,isOpen:u,buttonVariant:m="primary",cancelButtonVariant:C="tertiary",cancelButtonMessage:g="COMMON_ACTION_CANCEL",buttonMessage:h="COMMON_ACTION_CONFIRM",buttonDisabled:M=!1,position:T="top",offset:b,showHeaderClose:E=!1,contentClassName:x="",body:N,titleBody:j,className:v,rootClose:R=!1,footerActions:L})=>{const S=(0,l.useCallback)(e=>{u&&(e.stopPropagation(),e.key===n.U.ENTER?A():e.key===n.U.ESCAPE&&p(!1))},[u,A,p]);(0,l.useEffect)(()=>(window.addEventListener("keydown",S,!0),()=>{window.removeEventListener("keydown",S,!0)}),[S]);const f=(0,l.useCallback)(()=>{p(!1),O?.()},[p,O]),I=(0,l.useCallback)(()=>{p(!1),A()},[p,A]),P=(0,l.useMemo)(()=>[{text:(0,a.jsx)(d.sA,{id:g}),variant:C,onClick:f},{text:(0,a.jsx)(d.sA,{id:h}),disabled:M,variant:m,onClick:I}],[h,m,g,C,f,I,M]),D=(0,l.useCallback)(()=>{p(!1)},[p]),k=o.AH`
    ${s?"":`margin-top: ${r.xO}`}
  `;return(0,a.jsx)(i.A,{title:s?(0,a.jsx)(d.sA,{id:s,values:t}):j||null,..._?{body:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.sA,{id:_,values:c}),N]})}:{body:N},position:T,portal:!0,offset:b,actions:L||P,showHeaderClose:E,contentClassName:o.AH`
        ${k}
        ${x}
      `,onRequestClose:D,isOpen:u,allowOverflow:!0,rootClose:R,className:v,children:e})}},708406(e,s,t){t.d(s,{A:()=>r});var a=t(814557),l=t(247816),i=t(309130),o=t(100978),n=t(291508);const r=(0,l.A)(o.A,(0,n.A)("selected","disabled","allowGreyscale","noMargin"))`
  height: 32px;
  border-radius: ${a.Ay["desktop-radius-base"]};
  padding: ${i.YC} ${i.kc};
  margin-right: ${({noMargin:e})=>e?0:i.kc};
  border: ${({theme:{themeName:e}})=>a.Ay[`desktop-border-divider-${e}`]};
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: ${i.kc};
  user-select: none;

  ${({selected:e,theme:{themeName:s}})=>e&&`border-color: ${a.Ay[`desktop-color-ublue-06-${s}`]};`}
  ${({disabled:e,allowGreyscale:s,selected:t})=>e||s&&!t?`> * { opacity: ${i.xN}; }`:void 0}
  ${({disabled:e})=>e&&"pointer-events: none;"}
  ${({allowGreyscale:e,selected:s})=>e&&!s&&"filter: grayscale(100%);"}
`},859513(e,s,t){t.d(s,{A:()=>_});var a=t(274934),l=t(814557),i=t(247816),o=t(409844),n=t(470070),r=t(291508);const d=(0,i.A)("div",(0,r.A)("align"))`
  ${({align:e})=>e&&`text-align: ${e}`};
  color: ${({theme:{themeName:e}})=>l.Ay[`desktop-color-red-06-${e}`]};
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
  line-height: 20px;
`,_=({align:e="left",children:s=null,className:t=null,translation:l=null,visible:i=!1})=>i?(0,a.jsxs)(d,{align:e,className:(0,o.cx)(t),children:[l?(0,a.jsx)(n.sA,{id:l}):null,s]}):null},779770(e,s,t){t.d(s,{A:()=>m});var a=t(274934),l=t(756782),i=t(470070),o=t(602086),n=t(977872),r=t(843871),d=t(383061),_=t(409844),c=t(717101),A=t(96693),p=t(897166);const O=_.AH`
  margin: unset;
`,u=({disabled:e})=>{const{values:s,setValues:t}=(0,r.j7)(),l=(0,n.d4)(p.EL),i=(0,o.useCallback)(e=>{const a=(0,c.A)(s,e);t(a)},[t,s]);return(0,a.jsx)(d.A,{variant:"capsule",tabs:A.r,selectedTab:s.setting_preference,onSelectTab:e=>i(e.id),disabled:e||l,tabsClassName:O})},m=({disabled:e})=>(0,a.jsx)(l.A,{title:(0,a.jsx)(i.sA,{id:"COMMON_ADVANCED"}),titleAction:(0,a.jsx)(u,{disabled:e})})},205066(e,s,t){t.d(s,{A:()=>oe});var a=t(274934),l=t(877840),i=t(756782),o=t(470070),n=t(602086),r=t(943126),d=t(843871),_=t(309130),c=t(787481),A=t(597750),p=t(120197),O=t(164487),u=t(250266),m=t(100978),C=t(501558),g=t(132952),h=t(64222),M=t(857780),T=t(977872),b=t(787161),E=t(43009),x=t(247816),N=t(291508),j=t(890932),v=t(565527),R=t(291935),L=t(146215),S=t(598990),f=t(708406);const I=(0,x.A)("div",(0,N.A)("columns"))`
  display: grid;
  grid-template-columns: repeat(${({columns:e})=>e}, 1fr);
  width: 100%;
  gap: ${_.YC};
`,P=(0,x.A)("img")`
  width: 100%;
  max-width: 100%;
  object-fit: contain;
`,D=({disabled:e,isPtpSupported:s=!1})=>{const t=(0,T.wA)(),{values:l,setFieldValue:i}=(0,d.j7)(),r=(0,T.d4)(j.p),c=(0,T.d4)(R.zu),A=(0,n.useCallback)(e=>{i("avManufacturer",e),i("qos_profile.qos_profile_mode",(g.BR[e]||[])[0])},[i]),O=(0,n.useCallback)(()=>t((0,S.OD)({...c,jumboframe_enabled:!0})),[t,c]),u=(0,n.useMemo)(()=>(g.BR[l.avManufacturer]||[]).map(e=>({label:g.XB[e],value:e})),[l.avManufacturer]),{motif:h}=(0,E.A)(),M=h===v.S.DARK?"dark":"light",x=(0,n.useMemo)(()=>s?9:8,[s]),N=(0,n.useMemo)(()=>9===x?3:4,[x]);return(0,a.jsxs)(m.A,{flexDirection:"column",gap:_.kc,width:"100%",children:[(0,a.jsxs)(I,{columns:N,children:[(0,a.jsx)(f.A,{onClick:()=>A(C.CC.UNIFI),selected:l.avManufacturer===C.CC.UNIFI,allowGreyscale:!0,width:"100%",disabled:e,children:(0,a.jsx)(b.A,{size:"small"})}),(0,a.jsx)(f.A,{onClick:()=>A(C.CC.DANTE),selected:l.avManufacturer===C.CC.DANTE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/dante.svg`,height:13})}),(0,a.jsx)(f.A,{onClick:()=>A(C.CC.QSYS),selected:l.avManufacturer===C.CC.QSYS,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/qsys.svg`,height:13})}),(0,a.jsx)(f.A,{onClick:()=>A(C.CC.NDI),selected:l.avManufacturer===C.CC.NDI,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/ndi.svg`,height:11})}),c.jumboframe_enabled||l.avManufacturer===C.CC.SDVOE?(0,a.jsx)(f.A,{onClick:()=>A(C.CC.SDVOE),selected:l.avManufacturer===C.CC.SDVOE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/sd.svg`,height:19})}):(0,a.jsx)(L.A,{title:(0,a.jsx)(o.sA,{id:"PORTS_ENABLE_JUMBO_FRAMES_TITLE"}),message:(0,a.jsx)(o.sA,{id:"PORTS_ENABLE_JUMBO_FRAMES_SDVOE_MESSAGE"}),onConfirm:async()=>{await O(),A(C.CC.SDVOE)},onClose:()=>A(C.CC.SDVOE),confirmButtonVariant:"emphasis",confirmButtonLabel:"COMMON_ACTION_ENABLE",cancelButtonLabel:"PORTS_KEEP_DISABLED",trigger:(0,a.jsx)(f.A,{allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/sd.svg`,height:19})})}),(0,a.jsx)(f.A,{onClick:()=>A(C.CC.SHURE),selected:l.avManufacturer===C.CC.SHURE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/shure.svg`,height:9})}),(0,a.jsx)(f.A,{onClick:()=>A(C.CC.AES67),selected:l.avManufacturer===C.CC.AES67,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/aes.svg`,height:16})}),(0,a.jsx)(f.A,{onClick:()=>A(C.CC.CRESTON),selected:l.avManufacturer===C.CC.CRESTON,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/crestron.svg`,height:8})}),s?(0,a.jsx)(f.A,{onClick:()=>A(C.CC.SMPTE),selected:l.avManufacturer===C.CC.SMPTE,allowGreyscale:!0,noMargin:!0,width:"100%",disabled:e,children:(0,a.jsx)(P,{src:`${r}/avManufacturers/${M}/smpte.svg`,height:14})}):null]}),u.length>1?(0,a.jsx)(p.A,{name:"qos_profile.qos_profile_mode",type:"dropdown",portal:!0,variant:"secondary",options:u,translateOptions:!0,full:!0,disabled:e}):null]})};var k,w=t(125799),F=t(104669),y=t(599110),U=t(318087),V=t(590979),q=t(815436),G=t(869332),$=t(334160),H=t(792929),B=t(834700);!function(e){e.MATCH_PROTOCOL="matchProtocol",e.MATCH_TYPE="matchType",e.REMARK="remark",e.QUEUE="queue"}(k||(k={}));const K={[k.MATCH_PROTOCOL]:"COMMON_PROTOCOL",[k.MATCH_TYPE]:"PORTS_QOS_POLICY_MATCH_TYPE",[k.REMARK]:"PORTS_QOS_POLICY_REMARK",[k.QUEUE]:"PORTS_QOS_POLICY_QUEUE"},W=[{id:k.MATCH_PROTOCOL,label:(0,a.jsx)(o.sA,{id:K[k.MATCH_PROTOCOL]}),minWidth:60,renderCell:({matchProtocol:e})=>"number"==typeof e?e:(0,a.jsx)(o.sA,{id:(0,B.Wi)(e)})},{id:k.MATCH_TYPE,label:(0,a.jsx)(o.sA,{id:K[k.MATCH_TYPE]}),minWidth:100,renderCell:({matchType:e})=>e},{id:k.REMARK,label:(0,a.jsx)(o.sA,{id:K[k.REMARK]}),minWidth:100,renderCell:({remark:e})=>e},{id:k.QUEUE,label:(0,a.jsx)(o.sA,{id:K[k.QUEUE]}),minWidth:60,renderCell:({queue:e})=>e}],Y=(0,n.memo)(({addCallback:e,disabled:s})=>{const{values:t,setFieldValue:l}=(0,d.j7)(),{qos_profile:i}=t,{qos_policies:r}=i||{},c=(0,$.JS)(r||[]),A=(0,T.wA)(),p=(0,n.useCallback)(e=>{if(s)return;const t=(r??[]).filter((s,t)=>t!==e);l("qos_profile.qos_policies",t)},[s,l,r]),O=(0,n.useCallback)(({id:e})=>s?null:(0,a.jsx)(m.A,{width:"100%",justifyContent:"flex-end",paddingRight:_.Ln,alignItems:"center",children:(0,a.jsx)(y.A,{color:"danger",type:"button",variant:"inline",onClick:()=>p(e),children:(0,a.jsx)(o.sA,{id:"COMMON_ACTION_REMOVE"})})}),[s,p]),u=(0,n.useCallback)(t=>{if(s)return;const a=r?.[t.id];A((0,G.to)({modalType:q.A.QOS_POLICY_MODAL,modalProps:{addCallback:e,existingItem:a,existingItemIndex:t.id}}))},[e,s,A,r]);return(0,a.jsx)(m.A,{opacity:s?_.xN:void 0,pointerEvents:s?"none":void 0,children:(0,a.jsx)(H.A,{items:c,idField:"id",truncateHeaderCells:!0,columns:W,disableColumnFilters:!0,renderHoverContent:O,onRowClick:u})})}),z=({disabled:e})=>{const{values:s,setFieldValue:t,errors:l,touched:i,submitCount:c}=(0,d.j7)(),A=(0,T.wA)(),p=(0,U.t$)("qosEnabled",l,i,c),O=!e&&(s.qos_profile?.qos_policies?.length??0)>=g.aW,u=(0,n.useCallback)((e,a)=>{const l=(0,$.Dz)(e),i=(0,r.A)(s.qos_profile?.qos_policies)||[];if(void 0!==a)return i[a]=l,void t("qos_profile.qos_policies",i.sort((e,s)=>(s.qos_marking?.queue||0)-(e.qos_marking?.queue||0)));t("qos_profile.qos_policies",[...i,l].sort((e,s)=>(s.qos_marking?.queue||0)-(e.qos_marking?.queue||0)))},[t,s.qos_profile?.qos_policies]),C=(0,n.useCallback)(()=>{A((0,G.to)({modalType:q.A.QOS_POLICY_MODAL,modalProps:{addCallback:u}}))},[u,A]),h=(0,n.useMemo)(()=>(0,a.jsx)(w.A,{description:O?(0,a.jsx)(o.sA,{id:"PORTS_QOS_POLICIES_LIMIT_REACHED",values:{limit:g.aW}}):null,portal:!0,children:(0,a.jsx)(y.A,{variant:"inline",onClick:C,type:"button",size:"medium",disabled:e||O,...V.A.addDataTestId(V.A.TestId.MODAL_TRIGGER),children:(0,a.jsx)(o.sA,{id:"COMMON_CREATE_NEW"})})}),[C,e,O]);return s.qosEnabled?(0,a.jsxs)(m.A,{flexDirection:"column",gap:_.kc,children:[s.qos_profile?.qos_policies?.length?(0,a.jsxs)(m.A,{gap:_.kc,flexDirection:"column",children:[(0,a.jsx)(Y,{addCallback:u,disabled:e}),e?null:h]}):h,p?(0,a.jsx)(F.A,{isInvalid:!0,label:p}):null]}):null};var Q;!function(e){e.OFF="OFF",e.PRO_AV="PRO_AV",e.CUSTOM="CUSTOM"}(Q||(Q={}));const X=({disabled:e,isPtpSupported:s=!1})=>{const{values:t,setValues:l}=(0,d.j7)(),[i,T]=(0,n.useState)(!1),b=t.proAvEnabled?Q.PRO_AV:t.qosEnabled?Q.CUSTOM:Q.OFF,E=(0,n.useCallback)(e=>{if(e===Q.OFF)l({...t,proAvEnabled:!1,avManufacturer:void 0,qos_profile:(0,r.A)(g.a$),qosEnabled:!1});else if(e===Q.PRO_AV){const e=t.avManufacturer??C.CC.UNIFI;l({...t,proAvEnabled:!0,avManufacturer:e,qos_profile:{...(0,r.A)(g.a$),qos_profile_mode:(g.BR[e]||[])[0]??C.If.UNIFI_PLAY},qosEnabled:!1})}else e===Q.CUSTOM&&l({...t,proAvEnabled:!1,avManufacturer:void 0,qos_profile:(0,r.A)(g.a$),qosEnabled:!0})},[t,l]),x=(0,n.useCallback)(()=>{t.tagged_vlan_mgmt!==M.sg.BLOCK_ALL?T(!0):E(Q.PRO_AV)},[t.tagged_vlan_mgmt,E]),N=(0,n.useCallback)(()=>{T(!1);const e=t.avManufacturer??C.CC.UNIFI;l({...t,proAvEnabled:!0,tagged_vlan_mgmt:M.sg.BLOCK_ALL,taggedVlans:[],voice_networkconf_id:h.F,voiceNetworkConfEnabled:!1,avManufacturer:e,qos_profile:{...(0,r.A)(g.a$),qos_profile_mode:(g.BR[e]||[])[0]??C.If.UNIFI_PLAY},qosEnabled:!1})},[t,l]),j=(0,n.useCallback)(()=>{T(!1),E(Q.PRO_AV)},[E]);return(0,a.jsxs)(m.A,{flexDirection:"column",gap:_.kc,children:[(0,a.jsxs)(A.A,{children:[(0,a.jsx)(O.A,{tooltip:(0,a.jsx)(o.sA,{id:"PORTS_QOS_MODE_TOOLTIP"}),children:(0,a.jsx)(o.sA,{id:"PORTS_QOS_MODE"})}),(0,a.jsxs)(c.A,{children:[(0,a.jsx)(p.A,{value:Q.OFF,type:"radio",name:"qosModeRadio",checked:b===Q.OFF,onChange:()=>E(Q.OFF),disabled:e,children:(0,a.jsx)(o.sA,{id:"COMMON_OFF"})}),(0,a.jsx)(u.A,{title:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_TITLE",message:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_MESSAGE",buttonMessage:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_BLOCK",cancelButtonMessage:"PORTS_PRO_AV_BLOCK_TAGGED_VLANS_KEEP_CURRENT",isOpen:i,handleConfirm:N,handleClose:()=>T(!1),handleCancel:j,children:(0,a.jsx)(p.A,{value:Q.PRO_AV,type:"radio",name:"qosModeRadio",checked:b===Q.PRO_AV,onChange:x,disabled:e,tooltipMessage:(0,a.jsx)(o.sA,{id:"PORTS_PRO_AV_RADIO_TOOLTIP"}),children:(0,a.jsx)(o.sA,{id:"COMMON_PRO_AV"})})}),(0,a.jsx)(p.A,{value:Q.CUSTOM,type:"radio",name:"qosModeRadio",checked:b===Q.CUSTOM,onChange:()=>E(Q.CUSTOM),disabled:e,children:(0,a.jsx)(o.sA,{id:"COMMON_CUSTOM"})})]})]}),b===Q.PRO_AV?(0,a.jsx)(D,{disabled:e,isPtpSupported:s}):null,b===Q.CUSTOM?(0,a.jsx)(z,{disabled:e}):null]})};var J=t(846294),Z=t(110372),ee=t(195021);const se=({disabled:e,showPercentage:s})=>{const{values:t,setFieldValue:i,initialValues:n,errors:r,touched:u,submitCount:C}=(0,d.j7)(),g=(0,U.t$)("stormControlEnabled",r,u,C),h=t.proAvEnabled;return(0,a.jsxs)(m.A,{flexDirection:"column",gap:_.kc,children:[(0,a.jsx)(ee.l2,{children:(0,a.jsx)(p.A,{name:"stormControlEnabled",type:"realCheckbox",checked:t.stormControlEnabled,onChange:({target:{checked:e}})=>{i("stormControlEnabled",e),e||(i("stormctrl_ucast_enabled",!1),i("stormctrl_mcast_enabled",!1),i("stormctrl_bcast_enabled",!1),i("stormctrl_ucast_rate",n.stormctrl_ucast_rate),i("stormctrl_mcast_rate",n.stormctrl_mcast_rate),i("stormctrl_bcast_rate",n.stormctrl_bcast_rate),i("stormctrl_ucast_level",n.stormctrl_ucast_level),i("stormctrl_mcast_level",n.stormctrl_mcast_level),i("stormctrl_bcast_level",n.stormctrl_bcast_level))},tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_STORM_CONTROL_TOOLTIP"}),disabled:e,children:(0,a.jsx)(o.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_STORM_CONTROL"})})}),t.stormControlEnabled?(0,a.jsxs)(a.Fragment,{children:[s?(0,a.jsxs)(A.A,{paddingLeft:_.S2,children:[(0,a.jsx)(l.A,{isDisabled:!!e,children:(0,a.jsx)(O.A,{htmlFor:"stormctrl_type",tooltip:(0,a.jsx)(o.sA,{id:"PORTS_STORM_CONTROL_MODE_TOOLTIP"}),children:(0,a.jsx)(o.sA,{id:"COMMON_MODE"})})}),(0,a.jsxs)(c.A,{children:[(0,a.jsx)(p.A,{value:Z.d5.LEVEL,type:"radio",name:"stormctrl_type",checked:t.stormctrl_type===Z.d5.LEVEL,disabled:e,children:(0,a.jsx)(o.sA,{id:"COMMON_PERCENTAGE"})}),(0,a.jsx)(p.A,{value:Z.d5.RATE,type:"radio",name:"stormctrl_type",checked:t.stormctrl_type===Z.d5.RATE,disabled:e,children:(0,a.jsx)(o.sA,{id:"COMMON_RATE"})})]})]}):null,(0,a.jsxs)(m.A,{gap:_.Ln,justifyContent:"space-between",paddingLeft:_.S2,children:[(0,a.jsx)(ee.l2,{children:(0,a.jsx)(p.A,{disabled:e,name:"stormctrl_ucast_enabled",type:"realCheckbox",checked:t.stormctrl_ucast_enabled,onChange:({target:{checked:e}})=>{i("stormctrl_ucast_enabled",e),e||(i("stormctrl_ucast_rate",n.stormctrl_ucast_rate),i("stormctrl_ucast_level",n.stormctrl_ucast_level))},tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_STORM_CONTROL_UNICAST_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UCAST_LABEL"})})}),t.stormctrl_ucast_enabled?(0,a.jsx)(p.A,s&&t.stormctrl_type===Z.d5.LEVEL?{name:"stormctrl_ucast_level",type:"number",value:t.stormctrl_ucast_level,variant:"secondary",contentAfter:"%",min:1,max:100,full:!0,className:ee.rH,disabled:e}:{name:"stormctrl_ucast_rate",type:"number",variant:"secondary",contentAfter:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UNIT"}),full:!0,className:ee.rH,disabled:e}):null]}),(0,a.jsxs)(m.A,{gap:_.Ln,justifyContent:"space-between",paddingLeft:_.S2,children:[(0,a.jsx)(ee.l2,{children:(0,a.jsx)(J.A,{reason:h?(0,a.jsx)(o.sA,{id:"PORTS_MULTICAST_SET_BY_AV"}):void 0,children:(0,a.jsx)(m.A,{children:(0,a.jsx)(p.A,{disabled:e,name:"stormctrl_mcast_enabled",type:"realCheckbox",checked:t.stormctrl_mcast_enabled&&!h,onChange:({target:{checked:e}})=>{i("stormctrl_mcast_enabled",e),e||(i("stormctrl_mcast_rate",n.stormctrl_mcast_rate),i("stormctrl_mcast_level",n.stormctrl_mcast_level))},tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_STORM_CONTROL_MULTICAST_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"COMMON_MULTICAST"})})})})}),t.stormctrl_mcast_enabled&&!h?(0,a.jsx)(p.A,s&&t.stormctrl_type===Z.d5.LEVEL?{name:"stormctrl_mcast_level",type:"number",value:t.stormctrl_mcast_level,variant:"secondary",contentAfter:"%",min:1,max:100,full:!0,className:ee.rH,disabled:e}:{name:"stormctrl_mcast_rate",type:"number",variant:"secondary",contentAfter:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UNIT"}),full:!0,className:ee.rH,disabled:e}):null]}),(0,a.jsxs)(m.A,{gap:_.Ln,justifyContent:"space-between",paddingLeft:_.S2,children:[(0,a.jsx)(ee.l2,{children:(0,a.jsx)(p.A,{disabled:e,name:"stormctrl_bcast_enabled",checked:t.stormctrl_bcast_enabled,type:"realCheckbox",onChange:({target:{checked:e}})=>{i("stormctrl_bcast_enabled",e),e||(i("stormctrl_bcast_rate",n.stormctrl_bcast_rate),i("stormctrl_bcast_level",n.stormctrl_bcast_level))},tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_STORM_CONTROL_BROADCAST_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_BCAST_LABEL"})})}),t.stormctrl_bcast_enabled?(0,a.jsx)(p.A,s&&t.stormctrl_type===Z.d5.LEVEL?{name:"stormctrl_bcast_level",type:"number",value:t.stormctrl_bcast_level,variant:"secondary",contentAfter:"%",min:1,max:100,full:!0,className:ee.rH,disabled:e}:{name:"stormctrl_bcast_rate",type:"number",variant:"secondary",contentAfter:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_STORMCTRL_UNIT"}),full:!0,className:ee.rH,disabled:e}):null]})]}):null,g&&t.stormControlEnabled?(0,a.jsx)(F.A,{isInvalid:!0,label:g}):null]})},te=({disabled:e})=>{const{values:s,initialValues:t,setFieldValue:l}=(0,d.j7)();return(0,a.jsxs)(ee.l2,{justifyContent:"space-between",width:"100%",children:[(0,a.jsx)(p.A,{name:"egress_rate_limit_kbps_enabled",type:"realCheckbox",disabled:e,onChange:({target:{checked:e}})=>{l("egress_rate_limit_kbps_enabled",e),e||l("egress_rate_limit_kbps",t.egress_rate_limit_kbps)},tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_EGRESS_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_EGRESS_RATE_LIMIT"})}),s.egress_rate_limit_kbps_enabled?(0,a.jsx)(p.A,{name:"egress_rate_limit_kbps",type:"number",variant:"secondary",className:ee.rH,contentAfter:(0,a.jsx)(o.sA,{id:"COMMON_SPEED_METRICS_MBPS"}),min:1,max:1e3,full:!0}):null]})};var ae=t(669439);const le=({disabled:e,disableReason:s,overrideValue:t})=>{const{values:l}=(0,d.j7)(),i=t??l.flow_control_enabled;return(0,a.jsx)(m.A,{flexDirection:"column",gap:_.kc,children:(0,a.jsx)(ae.A,{description:e?s:void 0,children:(0,a.jsx)(ee.l2,{children:(0,a.jsx)(p.A,{name:"flow_control_enabled",type:"realCheckbox",tooltipMessage:s?void 0:(0,a.jsx)(o.sA,{id:"COMMON_FLOW_CONTROL_TOOLTIP"}),disabled:e,checked:i,children:(0,a.jsx)(o.sA,{id:"COMMON_FLOW_CONTROL"})})})})})},ie=({disabled:e,disableReason:s,preserveCheckedState:t})=>{const{values:l}=(0,d.j7)(),i=!(s&&!t)&&(l.precision_time_protocol_enabled??!1);return(0,a.jsx)(J.A,{reason:e?void 0:s,isInteractive:!0,position:"topStart",children:(0,a.jsx)(ee.l2,{children:(0,a.jsx)(p.A,{name:"precision_time_protocol_enabled",type:"realCheckbox",tooltipMessage:e||s?void 0:(0,a.jsx)(o.sA,{id:"PORTS_PTP_ENABLED_TOOLTIP"}),tooltipProps:{portal:!0},checked:i,children:(0,a.jsx)(o.sA,{id:"PORTS_PTP_ENABLED"})})})})},oe=({disabled:e,isPtpSupported:s,showPercentage:t,showQos:n=!0,showStormControl:r=!0,showEgressRateLimit:d=!0,showFlowControl:_=!0,showPtp:c=!1,ptpDisableReason:A,isPtpTransparentClock:p,flowControlDisableReason:O,flowControlOverrideValue:u})=>(0,a.jsx)(l.A,{isDisabled:!!e,children:(0,a.jsxs)(i.A,{title:(0,a.jsx)(o.sA,{id:n?"PORTS_PROAV_AND_TRAFFIC_CONTROL":"PORTS_TRAFFIC_CONTROL"}),children:[n?(0,a.jsx)(X,{disabled:e,isPtpSupported:s}):null,c?(0,a.jsx)(ie,{disabled:e,disableReason:A,preserveCheckedState:p}):null,r?(0,a.jsx)(se,{disabled:e,showPercentage:t}):null,d?(0,a.jsx)(te,{disabled:e}):null,_?(0,a.jsx)(le,{disabled:e,disableReason:O,overrideValue:u}):null]})})},599777(e,s,t){t.d(s,{A:()=>U});var a=t(274934),l=t(877840),i=t(756782),o=t(470070),n=t(602086),r=t(409844),d=t(843871),_=t(859513),c=t(200500),A=t(977872),p=t(954702),O=t(489714),u=t(431421),m=t(833886),C=t(260334),g=t(100978),h=t(811918),M=t(680163),T=t(34118),b=t(754924);const E=({addressList:e,changeAddressListCallback:s,disabled:t})=>{const{formatMessage:l}=(0,o.tz)(),i=(0,C.L_)(),[r,d]=(0,n.useState)(!1),_=(0,A.d4)(b.ID),E=(0,A.d4)(T.GB),x=(0,n.useMemo)(()=>[{id:"name",label:(0,a.jsx)(o.sA,{id:"COMMON_NAME"}),sortable:!1,renderCell:e=>(0,u.K)(_,E,e.item_id)}],[E,_]),N=(0,n.useMemo)(()=>({getDuplicationMessage:()=>l({id:"DEVICE_PORT_FORM_MAC_MUST_BE_UNIQUE"}),validate:e=>{const s=m.V.safeParse(e);return!!s.success||i(s.error.issues[0]?.message)}}),[l,i]),j=(0,n.useCallback)(e=>{s(e)},[s]),v=(0,n.useCallback)(s=>{d(!1),j((0,c.A)([...e,...s.map(e=>(0,O.Z)(e))]))},[e,j]);return(0,a.jsxs)(g.A,{width:"100%",children:[(0,a.jsx)(M.A,{disabled:t,labels:{fieldLabel:"COMMON_MAC_ADDRESS",modalTitle:(0,a.jsx)(o.sA,{id:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS"}),modalFieldPlaceholder:l({id:"SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"})},fieldValidation:N,extraFieldConfig:{placeholder:l({id:"COMMON_PLACEHOLDER_EG"},{value:"ab:cd:ef:12:34:56"}),translatePlaceholder:!1,parser:e=>(0,O.Z)((Array.isArray(e)?e[0]?.target?.value:void 0)??"")},extraDisplayColumns:x,value:e,onChange:j,invalid:!1,actions:(0,a.jsx)(p.A,{type:"button",onPress:()=>d(!0),fontSize:"medium",children:(0,a.jsx)(o.sA,{id:"COMMON_ADD_CLIENT"})})}),r?(0,a.jsx)(h.A,{onClose:()=>{d(!1)},onSubmit:v}):null]})};var x=t(120197);const N=r.AH`
  align-items: start;
`,j=({disabled:e,isPortMacFilteringSupported:s})=>{const{values:t,setFieldValue:l,errors:i,submitCount:r}=(0,d.j7)(),c=!!t.macFilteringEnabled,A=(0,n.useCallback)(()=>{c?(l("macFilteringEnabled",!1),l("port_security_mac_address",[])):l("macFilteringEnabled",!0)},[c,l]),p=(0,n.useCallback)(e=>{l("port_security_mac_address",e)},[l]);return s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{name:"portSecurityRestricted",type:"realCheckbox",checked:c,onChange:A,disabled:e,tooltipMessage:(0,a.jsx)(o.sA,{id:"PORTS_MAC_ADDRESS_FILTER_TOOLTIP"}),children:(0,a.jsx)(o.sA,{id:"COMMON_MAC_ADDRESS_FILTER"})}),c?(0,a.jsxs)(g.A,{flexDirection:"column",className:N,children:[(0,a.jsx)(E,{changeAddressListCallback:p,addressList:t.port_security_mac_address??[],disabled:!!e}),(0,a.jsx)(_.A,{visible:i&&!!r&&!!i.port_security_mac_address,children:i.port_security_mac_address})]}):null]}):null};var v=t(309130),R=t(846294),L=t(164487),S=t(110372),f=t(808764),I=t(195021);const P=[{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_AUTO",value:S.Je.AUTO},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_FORCE_AUTHORIZED",value:S.Je.FORCE_AUTHORIZED},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_FORCE_UNAUTHORIZED",value:S.Je.FORCE_UNAUTHORIZED},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_MAC_BASED",value:S.Je.MAC_BASED},{label:"COMMON_PORTS_FORM_FIELD_DOT1X_CTRL_OPTION_MULTI_HOST",value:S.Je.MULTI_HOST}],D=({disabled:e,dot1xDisabledReason:s})=>{const{values:{dot1x_ctrl:t},setFieldValue:i,initialValues:n}=(0,d.j7)(),r=e||!!s;return(0,a.jsxs)(g.A,{flexDirection:"column",gap:v.Ln,children:[(0,a.jsx)(R.A,{reason:s,isInteractive:!0,position:"topStart",children:(0,a.jsx)(x.A,{name:"dot1x_ctrl",checked:t,label:(0,a.jsx)(l.A,{isDisabled:!!r,children:(0,a.jsx)(L.A,{tooltip:(0,a.jsx)(o.sA,{id:"PORTS_DOT1X_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X"})})}),type:"dropdown",options:P,translateOptions:!0,disabled:r,variant:"secondary",onChange:(e,s)=>{i("dot1x_ctrl",s),s!==S.Je.MAC_BASED&&i("dot1x_idle_timeout",n.dot1x_idle_timeout)},full:!0})}),t===S.Je.MAC_BASED?(0,a.jsx)(x.A,{name:"dot1x_idle_timeout",label:"COMMON_PORTS_FORM_FIELD_IDLE_TIMEOUT_LABEL",type:"number",variant:"secondary",contentAfter:(0,a.jsx)(o.sA,{id:"COMMON_UNIT_SEC"}),min:f.S.MIN,max:f.S.MAX,full:!0,className:I.rH,disabled:r}):null]})};var k=t(853777),w=t(612389),F=t(956978);const y=({disabled:e,model:s})=>{const{values:t}=(0,d.j7)(),l=t.isolation&&(0,F.CIk)({model:s});return(0,a.jsxs)(g.A,{flexDirection:"column",gap:v.kc,children:[(0,a.jsx)(I.l2,{children:(0,a.jsx)(x.A,{name:"isolation",type:"realCheckbox",tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_PORT_ISOLATION_DESC"}),disabled:e,children:(0,a.jsx)(o.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_PORT_ISOLATION"})})}),l?(0,a.jsx)(w.A,{icon:(0,a.jsx)(k.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,a.jsx)(o.sA,{id:"COMMON_PORT_ISOLATION_ALERT",values:{hyphen:(0,a.jsx)(a.Fragment,{children:"‑"})}})}):null]})},U=({disabled:e,showSecurityMac:s=!0,isPortMacFilteringSupported:t,showDot1x:n=!0,dot1xDisabledReason:r,showIsolation:d=!0,model:_})=>(0,a.jsx)(l.A,{isDisabled:!!e,children:(0,a.jsxs)(i.A,{title:(0,a.jsx)(o.sA,{id:"PORTS_PORT_SECURITY"}),children:[s?(0,a.jsx)(j,{disabled:e,isPortMacFilteringSupported:t}):null,n?(0,a.jsx)(D,{disabled:e,dot1xDisabledReason:r}):null,d?(0,a.jsx)(y,{disabled:e,model:_}):null]})})},823074(e,s,t){t.d(s,{A:()=>F});var a=t(274934),l=t(877840),i=t(756782),o=t(470070),n=t(602086),r=t(843871),d=t(645951),_=t(120197),c=t(64222),A=t(195021);const p=({disabled:e})=>{const{setFieldValue:s,values:t}=(0,r.j7)(),l=(0,n.useCallback)(({target:{checked:e}})=>{s("lldpmed_enabled",e),t.lldpmed_enabled&&(s("voiceNetworkConfEnabled",!1),s("voice_networkconf_id",c.F))},[s,t.lldpmed_enabled]);return(0,a.jsx)(A.l2,{width:"100%",children:(0,a.jsx)(_.A,{name:"lldpmed_enabled",type:"realCheckbox",disabled:e,onChange:l,tooltipMessage:(0,a.jsx)(d.A,{messages:[["COMMON_LLDP_MED_TOOLTIP_1"],["COMMON_LLDP_MED_TOOLTIP_2"]]}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_LLDP_MED"})})})};var O=t(977872),u=t(846294),m=t(309130),C=t(100978),g=t(743492);const h=({disabled:e})=>{const{values:s,setFieldValue:t}=(0,r.j7)(),l=(0,O.d4)((0,g.c)(s.native_networkconf_id,s.taggedVlans,s.tagged_vlan_mgmt)),i=!e&&0===l.length&&s.voice_networkconf_id===c.F,d=!e&&!s.lldpmed_enabled,{disableReason:p,fieldDisabled:h}=(0,n.useMemo)(()=>{const s=i||d||e;return{disableReason:d?(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_DISABLED_LLDP"}):i?(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_DISABLED_NO_OPTIONS"}):void 0,fieldDisabled:s}},[e,i,d]);return(0,a.jsxs)(C.A,{flexDirection:"column",gap:m.kc,children:[(0,a.jsx)(u.A,{reason:e?void 0:p,fitContent:!0,children:(0,a.jsx)(A.l2,{width:"100%",children:(0,a.jsx)(_.A,{name:"voiceNetworkConfEnabled",type:"realCheckbox",disabled:h,onChange:({target:{checked:e}})=>{t("voiceNetworkConfEnabled",e),e||t("voice_networkconf_id",c.F)},tooltipMessage:h?void 0:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_LABEL_DESC_1"}),tooltipProps:{portal:!0},checked:s.voiceNetworkConfEnabled,children:(0,a.jsx)(o.sA,{id:"COMMON_PORTS_FORM_FIELD_VOICE_NETWORKCONF_ID_LABEL"})})})}),s.voiceNetworkConfEnabled?(0,a.jsx)(_.A,{searchable:!0,name:"voice_networkconf_id",options:l,type:"dropdown",sortedOptions:!0,full:!0,variant:"secondary"}):null]})};var M=t(594005),T=t(318087),b=t(101134),E=t(531302),x=t(502129),N=t(104997),j=t(423564),v=t(197571),R=t(969288),L=t(857780),S=t(787481),f=t(291935),I=t(826022);const P=({disabled:e})=>{const s=(0,O.d4)(v.Ct),t=(0,b.A)(`${N.VO.SETTINGS}/${R.Cs}`),{values:l,setFieldValue:i,errors:d,touched:c,submitCount:p}=(0,r.j7)(),g=(0,O.d4)(f.s4),{multicast_router_networkconf_ids:h,multicast_router_mode:P}=l,D=!g.enabled,k=(0,n.useMemo)(()=>s.filter(e=>(g.network_ids||[]).includes(e._id)&&(0,j.H2)(e)).sort(M.Cv).map(e=>{const s=!(0,I.iw)(l.tagged_vlan_mgmt,l.native_networkconf_id,l.taggedVlans,[e._id])&&!l.multicast_router_networkconf_ids?.includes(e._id);return{label:(0,j.gm)(e),additionalInfo:(0,j.mC)(e),value:e._id,disabled:s,tooltipDescription:s?(0,a.jsx)(o.sA,{id:"COMMON_VLAN_NOT_CONFIGURED_FOR_PORT"}):null,tooltipPortal:!0}}),[s,g.network_ids,l.tagged_vlan_mgmt,l.native_networkconf_id,l.multicast_router_networkconf_ids,l.taggedVlans]),w=(0,n.useMemo)(()=>(0,I.iw)(l.tagged_vlan_mgmt,l.native_networkconf_id,l.taggedVlans,g.network_ids),[l.tagged_vlan_mgmt,l.native_networkconf_id,l.taggedVlans,g.network_ids]),F=(0,T.t$)("multicast_router_networkconf_ids",d,c,p),y=D?(0,a.jsx)(o.sA,{id:"PORTS_IGMP_MULTICAST_ROUTER_PORT_DISABLED_DESCRIPTION",values:{link:(0,a.jsx)(x.A,{to:t,children:(0,a.jsx)(o.sA,{id:"COMMON_IGMP_SNOOPING"})})}}):w||l.multicast_router_mode!==L.bK.NONE?null:(0,a.jsx)(o.sA,{id:"COMMON_MULTICAST_ROUTER_PORT_NETWORK_MISMATCH_DESCRIPTION"});return(0,a.jsx)(C.A,{flexDirection:"column",gap:m.kc,width:"100%",children:(0,a.jsxs)(u.A,{reason:y,isInteractive:!0,position:"topStart",children:[(0,a.jsx)(A.l2,{justifyContent:"space-between",width:"100%",children:(0,a.jsx)(_.A,{type:"realCheckbox",full:!0,disabled:e,name:"multicast_router_mode",label:"COMMON_MULTICAST_ROUTER_PORT",checked:P!==L.bK.NONE,tooltipMessage:(0,a.jsx)(o.sA,{id:"COMMON_MULTICAST_ROUTER_PORTS_TOOLTIP"}),tooltipProps:{portal:!0},afterChange:e=>{i("multicast_router_mode",e?L.bK.ALL:L.bK.NONE)},children:(0,a.jsx)(o.sA,{id:"COMMON_MULTICAST_ROUTER_PORT"})})}),P!==L.bK.NONE?(0,a.jsxs)(S.A,{children:[(0,a.jsx)(_.A,{value:L.bK.ALL,type:"radio",name:"multicast_router_mode",disabled:e||D,children:(0,a.jsx)(o.sA,{id:"COMMON_ALL_IGMP_VLANS"})}),(0,a.jsx)(_.A,{value:L.bK.CUSTOM,type:"radio",name:"multicast_router_mode",disabled:e||D,children:(0,a.jsx)(o.sA,{id:"COMMON_CUSTOM"})})]}):null,P===L.bK.CUSTOM?(0,a.jsx)(C.A,{width:"100%",flexDirection:"column",children:(0,a.jsx)(E.A,{options:k,disabled:e||D,isDefaultOpen:0===h?.length,list:h,onChange:e=>{i("multicast_router_networkconf_ids",e)},validationMessage:F,isFullWidth:!0,truncateLabels:!0,triggerButtonText:"COMMON_ACTION_SELECT_VLANS"})}):null]})})};var D=t(995089),k=t(98870);const w=({disabled:e})=>(0,a.jsx)(A.l2,{children:(0,a.jsx)(_.A,{name:"port_keepalive_enabled",type:"realCheckbox",disabled:e,tooltipMessage:(0,a.jsx)(d.A,{messages:[["COMMON_KEEP_ALIVE_TOOLTIP"],["COMMON_KEEP_ALIVE_TOOLTIP_2"]]}),tooltipProps:{portal:!0},children:(0,a.jsx)(o.sA,{id:"PORTS_NON_STP_LOOP_PROTECTION"})})}),F=({disabled:e,showStp:s,showStpUplink:t,showBpduGuard:n,isRuntimeUplink:r,showKeepAliveLoopProtection:d,showLldpMed:_=!0,showVoiceNetwork:c=!0,showMulticastRouterPort:A=!0,showEee:O=!0,eeeDisableReason:u,eeeOverrideValue:m})=>(0,a.jsx)(l.A,{isDisabled:!!e,children:(0,a.jsxs)(i.A,{title:(0,a.jsx)(o.sA,{id:"COMMON_SERVICES"}),children:[s?(0,a.jsx)(k.A,{disabled:e,showBpduGuard:n,showUplink:t,isRuntimeUplink:r}):null,d?(0,a.jsx)(w,{disabled:e}):null,O?(0,a.jsx)(D.A,{disabled:e,disableReason:u,overrideValue:m}):null,_?(0,a.jsx)(p,{disabled:e}):null,c?(0,a.jsx)(h,{disabled:e}):null,A?(0,a.jsx)(P,{disabled:e}):null]})})},766783(e,s,t){t.d(s,{HX:()=>g,Ib:()=>u,l8:()=>C,mH:()=>m,tI:()=>p,tn:()=>h,v7:()=>c,xc:()=>A});var a=t(274934),l=t(950804),i=t(470070),o=t(110372),n=t(977890),r=t(576983),d=t(808764),_=t(857780);const c=e=>l.A.number().when(["stormctrl_type",`stormctrl_${e}_enabled`],{is:(e,s)=>e===o.d5.RATE&&s,then:l.A.number().label(`COMMON_PORTS_FORM_FIELD_STORMCTRL_${e.toUpperCase()}_LABEL`).min(n.A.MIN).max(n.A.MAX).integer().required()}),A=e=>l.A.number().when(["stormctrl_type",`stormctrl_${e}_enabled`],{is:(e,s)=>e===o.d5.LEVEL&&s,then:l.A.number().label(`COMMON_PORTS_FORM_FIELD_STORMCTRL_${e.toUpperCase()}_LABEL`).min(n.r.MIN).max(n.r.MAX).integer().required()}),p=l.A.number().when("dot1x_ctrl",{is:e=>e===o.Je.MAC_BASED,then:l.A.number().label("COMMON_PORTS_FORM_FIELD_IDLE_TIMEOUT_LABEL").min(d.S.MIN).max(d.S.MAX).required()}),O=(e=!1)=>{const s=e?r.A.M:r.A.k;return(0,a.jsx)(i.sA,{id:"COMMON_VALIDATION_HINT_RANGE",values:{min:s.MIN,max:s.MAX}})},u=l.A.number().when(["egress_rate_limit_kbps_enabled"],{is:!0,then:l.A.number().required(O(!0)).min(r.A.M.MIN,O(!0)).max(r.A.M.MAX,O(!0))}),m=l.A.array().of(l.A.string()).test({name:"dontAllowEmptyTaggedVlansWhileCustom",test:(e,s)=>s.parent.tagged_vlan_mgmt!==_.sg.CUSTOM||s.parent.taggedVlans?.length>0||s.createError({message:(0,a.jsx)(i.sA,{id:"PORTS_FORM_TAGGED_VLANS_VALIDATION"})})}),C=l.A.bool().test({name:"lldpmedEnabledValid",test:(e,s)=>!(!e&&s.parent.op_mode===o.RC.SWITCH&&s.parent.voice_networkconf_id),message:(0,a.jsx)(i.sA,{id:"COMMON_PORTS_FORM_FIELD_LLDPMED_ENABLED_VALIDATION_REQUIRED"})}),g=l.A.boolean().test({name:"atLeastOneQosRule",test:(e,s)=>!(e&&!((s.parent.qos_profile?.qos_policies?.length??0)>0))||s.createError({message:(0,a.jsx)(i.sA,{id:"PORTS_FORM_VALIDATION_QOS_AT_LEAST_ONE_POLICY"})})}),h=l.A.bool().test({name:"atLeastOneStormCtrlEnabled",test:(e,s)=>{if(!e)return!0;const{stormctrl_bcast_enabled:t,stormctrl_ucast_enabled:l,stormctrl_mcast_enabled:o}=s.parent;return!!(t||l||o)||s.createError({message:(0,a.jsx)(i.sA,{id:"PORTS_FORM_VALIDATION_STORMCTRL_AT_LEAST_ONE_ENABLED"})})}})},995089(e,s,t){t.d(s,{A:()=>c});var a=t(274934),l=t(843871),i=t(669439),o=t(309130),n=t(120197),r=t(100978),d=t(470070),_=t(195021);const c=({disabled:e,disableReason:s,overrideValue:t})=>{const{values:c}=(0,l.j7)(),A=t??c.eee_enabled??!1;return(0,a.jsx)(r.A,{flexDirection:"column",gap:o.kc,children:(0,a.jsx)(i.A,{description:e?s:void 0,children:(0,a.jsx)(_.l2,{children:(0,a.jsx)(n.A,{name:"eee_enabled",type:"realCheckbox",tooltipMessage:s?void 0:(0,a.jsx)(d.sA,{id:"COMMON_ENERGY_EFFICIENT_ETHERNET_TOOLTIP"}),disabled:e,checked:A,children:(0,a.jsx)(d.sA,{id:"COMMON_ENERGY_EFFICIENT_ETHERNET"})})})})})}},188768(e,s,t){t.d(s,{A:()=>r});var a=t(274934),l=t(733360),i=t(951005),o=t(120197),n=t(470070);const r=({disabled:e,networkGroup:s})=>{const{formatMessage:t}=(0,n.tz)(),r=!!s&&(0,l.pg)(s),d=s?"PORTS_NAME_WITH_INTERFACE":"COMMON_NAME",_=s?{networkGroup:r?(0,l.qY)(s,t):(0,i.bR)(s,t)}:{};return(0,a.jsx)(o.A,{disabled:e,full:!0,name:"name",placeholder:"COMMON_DEFAULT",variant:"secondary",label:d,labelValues:_,translateLabel:!0})}},975052(e,s,t){t.d(s,{A:()=>g});var a=t(274934),l=t(602086),i=t(977872),o=t(943126),n=t(843871),r=t(767822),d=t(594005),_=t(877840),c=t(645951),A=t(164487),p=t(120197),O=t(470070),u=t(64222),m=t(423564),C=t(197571);const g=({disabled:e,hideTooltip:s})=>{const{formatMessage:t}=(0,O.tz)(),g=(0,i.d4)(C.SB),{values:h,setFieldValue:M}=(0,n.j7)(),T=(0,l.useMemo)(()=>[...(0,o.A)(g).sort(d.Cv).map(e=>({label:(0,m.gm)(e),value:e._id,additionalInfo:(0,m.mC)(e)})),{label:t({id:"COMMON_NONE"}),value:u.F}],[g,t]);return(0,a.jsx)(p.A,{disabled:e,full:!0,name:"native_networkconf_id",onChange:({value:e})=>{M("native_networkconf_id",e),h.taggedVlans?.includes(e)&&M("taggedVlans",h.taggedVlans?.filter(s=>s!==e)),h.voice_networkconf_id===e&&(M("voice_networkconf_id",u.F),M("voiceNetworkConfEnabled",!1))},options:T,renderOption:r.q,searchable:!0,type:"dropdown",variant:"secondary",label:(0,a.jsx)(_.A,{isDisabled:!!e,children:(0,a.jsx)(A.A,{tooltip:s?null:(0,a.jsx)(c.A,{messages:[["COMMON_PORTS_FORM_NATIVE_LABEL_DESC"],["COMMON_PORTS_FORM_NATIVE_LABEL_DESC_2"]]}),children:(0,a.jsx)(O.sA,{id:"COMMON_PORTS_NATIVE_VLAN_NETWORKS"})})})})}},508526(e,s,t){t.d(s,{A:()=>M});var a,l=t(274934),i=t(602086),o=t(843871),n=t(853777),r=t(599110),d=t(309130),_=t(120197),c=t(787481),A=t(612389),p=t(100978),O=t(877840),u=t(846294),m=t(470070),C=t(364905),g=t(717101),h=t(857780);!function(e){e.EDGE="edge",e.UPLINK="uplink"}(a||(a={}));const M=({disabled:e,showBpduGuard:s=!0,isRuntimeUplink:t})=>{const{values:M,setValues:T}=(0,o.j7)(),b=M.setting_preference===C.C.AUTO,E=M.stp_edge_state===h.MV.ENABLED,x=!!t&&!E,N=E&&(!M.stp_port_mode||s&&!M.stp_bpdu_guard_enabled),j=(0,i.useCallback)(()=>{if(b){const e=(0,g.A)(M,C.C.MANUAL);return T(e),e}return M},[b,M,T]),v=(0,i.useCallback)(e=>{if(e===a.EDGE){const e=j();T({...e,stp_edge_state:h.MV.ENABLED,stp_port_mode:!0,stp_uplink:!1,...s?{stp_bpdu_guard_enabled:!0}:{}})}else T({...M,stp_edge_state:h.MV.AUTO,...s?{stp_bpdu_guard_enabled:!1}:{}})},[j,T,M,s]),R=(0,i.useCallback)(()=>{const e=j();T({...e,stp_port_mode:!0,stp_edge_state:h.MV.ENABLED,...s?{stp_bpdu_guard_enabled:!0}:{}})},[j,T,s]);return(0,l.jsx)(O.A,{isDisabled:!!e,children:(0,l.jsxs)(p.A,{flexDirection:"column",gap:d.kc,children:[(0,l.jsxs)(c.A,{children:[(0,l.jsx)(_.A,{value:a.UPLINK,type:"radio",name:"port_mode_edge",checked:!E,afterChange:()=>v(a.UPLINK),children:(0,l.jsx)(m.sA,{id:"COMMON_UPLINK"})}),(0,l.jsx)(u.A,{reason:x?(0,l.jsx)(m.sA,{id:"PORTS_PORT_MODE_EDGE_DISABLED_UPLINK"}):null,children:(0,l.jsx)(_.A,{value:a.EDGE,type:"radio",name:"port_mode_edge",checked:E,tooltipMessage:(0,l.jsx)(m.sA,{id:"PORTS_PORT_MODE_EDGE_TOOLTIP"}),tooltipProps:{portal:!0},afterChange:()=>v(a.EDGE),children:(0,l.jsx)(m.sA,{id:"COMMON_DEVICE_EDGE"})})})]}),N?(0,l.jsx)(A.A,{icon:(0,l.jsx)(n.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,l.jsx)(m.sA,{id:"PORTS_PORT_MODE_EDGE_MISMATCH",values:{link:(0,l.jsx)(r.A,{type:"button",variant:"inline",onClick:R,children:(0,l.jsx)(m.sA,{id:"PORTS_PORT_MODE_EDGE_RESTORE"})})}})}):null]})})}},426795(e,s,t){t.d(s,{A:()=>T});var a=t(274934),l=t(602086),i=t(843871),o=t(853777),n=t(309130),r=t(645951),d=t(859513),_=t(120197),c=t(100978),A=t(612389),p=t(470070),O=t(110372),u=t(380592),m=t(41770),C=t(857780),g=t(501558),h=t(533909),M=t(195021);const T=({disabled:e,optionsOverride:s,showFec:t,media:T,showMixedSpeedWarning:b})=>{const{values:E,setFieldValue:x,errors:N,setValues:j}=(0,i.j7)(),v=Object.keys(u.A).map(h.MT),R=(0,l.useCallback)(e=>{const{value:s}=e,{autoneg:t,full_duplex:a,speed:l}=u.A[s],i=m.e.includes(s)?(0,h.Tg)(l):C._t.DISABLED;j({...E,autoneg:t,full_duplex:a,speed:l,portSpeed:s,fec_mode:i})},[j,E]),L=E.portconf_id||!s?v:s,S=(0,l.useMemo)(()=>{const e=L.filter(e=>e.value!==O.n5.PORTSPEED_AUTO_NEG),s=(0,h.it)(e.map(e=>e.value)),t=new Map(e.map(e=>[e.value,e]));return s.map(e=>t.get(e))},[L]),f=(0,l.useCallback)(e=>{e.currentTarget.checked?R({value:O.n5.PORTSPEED_AUTO_NEG}):S[0]&&R({value:S[0].value})},[S,R]);(0,l.useEffect)(()=>{if(!L.some(e=>e.value===E.portSpeed)){const{autoneg:e,full_duplex:s,speed:t}=u.A[O.n5.PORTSPEED_AUTO_NEG];j({...E,autoneg:e,full_duplex:s,speed:t,portSpeed:O.n5.PORTSPEED_AUTO_NEG})}},[L,j,E,E.portconf_id]);const I=E.portSpeed===O.n5.PORTSPEED_AUTO_NEG,P=t&&L.some(e=>m.e.includes(e.value));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.A,{flexDirection:"column",width:"100%",children:[(0,a.jsx)(M.l2,{children:(0,a.jsx)(_.A,{name:"autoneg",checked:I,type:"realCheckbox",disabled:e,onChange:f,tooltipMessage:P?(0,a.jsx)(p.sA,{id:T===g.kC.QSFP28?"COMMON_PORTS_FORM_FIELD_PORT_SPEED_TOOLTIP_QSFP_FEC":"COMMON_PORTS_FORM_FIELD_PORT_SPEED_TOOLTIP_FEC"}):void 0,children:(0,a.jsx)(p.sA,{id:"COMMON_AUTO_NEGOTIATE_LINK_SPEED"})})}),I?null:(0,a.jsx)(_.A,{name:"portSpeed",options:S,translateOptions:!0,type:"dropdown",full:!0,variant:"secondary",onChange:R,disabled:e}),(0,a.jsx)(d.A,{visible:!!N.portSpeed,children:N.portSpeed}),b&&E.portSpeed===O.n5.PORTSPEED_FULL_25G?(0,a.jsx)(A.A,{marginTop:n.kc,icon:(0,a.jsx)(o.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,a.jsx)(p.sA,{id:"COMMON_PORT_FORM_LINK_SPEED_SFP28_ALERT"})}):null,I?null:(0,a.jsx)(A.A,{marginTop:n.kc,icon:(0,a.jsx)(o.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,a.jsx)(p.sA,{id:"COMMON_PORT_FORM_LINK_SPEED_NON_AUTO_NEG_ALERT"})})]}),m.e.includes(E.portSpeed)&&t?(0,a.jsxs)(c.A,{flexDirection:"column",children:[(0,a.jsx)(M.l2,{children:(0,a.jsx)(_.A,{name:"fec_mode_enabled",checked:E.fec_mode!==C._t.DISABLED,type:"realCheckbox",disabled:e,onChange:({target:{checked:e}})=>{x("fec_mode",e?(0,h.Tg)(u.A[E.portSpeed].speed):C._t.DISABLED)},tooltipMessage:(0,a.jsx)(r.A,{messages:[["COMMON_PORTS_FORM_FIELD_PORT_SPEED_FEC_TOOLTIP_1"],["COMMON_PORTS_FORM_FIELD_PORT_SPEED_FEC_TOOLTIP_2"]]}),children:(0,a.jsx)(p.sA,{id:"COMMON_PORTS_FORM_FIELD_PORT_SPEED_FEC_LABEL"})})}),E.fec_mode!==C._t.DISABLED?(0,a.jsx)(_.A,{searchable:!0,name:"fec_mode",disabled:e,options:m.p[E.portSpeed],type:"dropdown",full:!0,variant:"secondary"}):null]}):null]})}},918597(e,s,t){t.d(s,{A:()=>m});var a=t(274934),l=t(602086),i=t(977872),o=t(843871),n=t(787481),r=t(597750),d=t(120197),_=t(877840),c=t(164487),A=t(470070),p=t(64222),O=t(197571),u=t(857780);const m=({disabled:e})=>{const{values:s,setValues:t}=(0,o.j7)(),m=(0,i.d4)(O.nT),C=!!s.portDisabled,g=(0,l.useCallback)(e=>{const a={portDisabled:!e,macFilteringEnabled:!1};e||(a.port_security_mac_address=[],a.tagged_vlan_mgmt=u.sg.BLOCK_ALL,a.taggedVlans=[],a.voice_networkconf_id=p.F,a.voiceNetworkConfEnabled=!1,a.native_networkconf_id=p.F),e&&s.portDisabled&&m?._id&&(a.port_security_mac_address=[],a.tagged_vlan_mgmt=u.sg.AUTO,a.native_networkconf_id=m._id),t({...s,...a})},[m?._id,t,s]);return(0,a.jsxs)(r.A,{children:[(0,a.jsx)(_.A,{isDisabled:!!e,children:(0,a.jsx)(c.A,{children:(0,a.jsx)(A.sA,{id:"PORTS_PORT_STATE"})})}),(0,a.jsxs)(n.A,{children:[(0,a.jsx)(d.A,{value:"true",type:"radio",name:"portStateRadio",checked:!C,onChange:()=>g(!0),disabled:e,children:(0,a.jsx)(A.sA,{id:"COMMON_ACTIVE"})}),(0,a.jsx)(d.A,{value:"false",type:"radio",name:"portStateRadio",checked:C,onChange:()=>g(!1),disabled:e,children:(0,a.jsx)(A.sA,{id:"COMMON_DISABLED"})})]})]})}},816648(e,s,t){t.d(s,{L:()=>i});var a=t(834700),l=t(501558);const i={qos_marking:{cos_code:l.hQ.BACKGROUND,dscp_code:l.ee.DEFAULT,ip_precedence_code:l.lF.ROUTINE,queue:0},qos_matching:{cos_code:l.hQ.BACKGROUND,dscp_code:l.ee.DEFAULT,ip_precedence_code:l.lF.ROUTINE,protocol:a.aS.ALL},enableDestinationPort:!1,enableSourcePort:!1,enableQosMarking:!1,matchingTrafficType:l.ev.DSCP,markingTrafficType:l.ev.DSCP,protocolNumber:0}},334160(e,s,t){t.d(s,{Dz:()=>_,JS:()=>d,zN:()=>c});var a=t(834700),l=t(254590),i=t(501558),o=t(132952),n=t(816648);const r=e=>void 0!==e.cos_code?`CoS ${e.cos_code} (${o.e8[e.cos_code]})`:void 0!==e.dscp_code?`DSCP ${e.dscp_code}${o.HH[e.dscp_code]?` (${o.HH[e.dscp_code]})`:""}`:void 0!==e.ip_precedence_code?`IPP ${e.ip_precedence_code} (${o.Dc[e.ip_precedence_code]})`:l.L,d=e=>e.map((e,s)=>({matchProtocol:e.qos_matching.protocol??a.aS.ALL,matchType:r(e.qos_matching),remark:r(e.qos_marking),queue:e.qos_marking.queue,id:s})),_=e=>{const s={qos_marking:{...e.qos_marking},qos_matching:{...e.qos_matching}};switch(e.qos_matching.protocol===a.aS.ALL&&(delete s.qos_matching.src_port,delete s.qos_matching.dst_port,delete s.qos_matching.protocol),e.qos_matching.protocol===a.aS.NUMBER&&(s.qos_matching.protocol=e.protocolNumber),e.enableDestinationPort||delete s.qos_matching.dst_port,e.enableSourcePort||delete s.qos_matching.src_port,e.markingTrafficType){case i.ev.DSCP:delete s.qos_marking.cos_code,delete s.qos_marking.ip_precedence_code;break;case i.ev.COS:delete s.qos_marking.dscp_code,delete s.qos_marking.ip_precedence_code}switch(e.matchingTrafficType){case i.ev.DSCP:delete s.qos_matching.cos_code,delete s.qos_matching.ip_precedence_code;break;case i.ev.IP_PRECEDENCE:delete s.qos_matching.dscp_code,delete s.qos_matching.cos_code;break;case i.AC:delete s.qos_matching.dscp_code,delete s.qos_matching.cos_code,delete s.qos_matching.ip_precedence_code}return e.enableQosMarking||(delete s.qos_marking.cos_code,delete s.qos_marking.dscp_code,delete s.qos_marking.ip_precedence_code),s},c=e=>{const s={qos_marking:{cos_code:e.qos_marking.cos_code||n.L.qos_marking.cos_code,dscp_code:e.qos_marking.dscp_code||n.L.qos_marking.dscp_code,ip_precedence_code:e.qos_marking.ip_precedence_code||n.L.qos_marking.ip_precedence_code,queue:e.qos_marking.queue||n.L.qos_marking.queue},qos_matching:{protocol:"number"==typeof e?.qos_matching?.protocol?a.aS.NUMBER:e.qos_matching.protocol||n.L.qos_matching.protocol,cos_code:e.qos_matching.cos_code||n.L.qos_matching.cos_code,dscp_code:e.qos_matching.dscp_code||n.L.qos_matching.dscp_code,ip_precedence_code:e.qos_matching.ip_precedence_code||n.L.qos_matching.ip_precedence_code,dst_port:e.qos_matching.dst_port||n.L.qos_matching.dst_port,src_port:e.qos_matching.src_port||n.L.qos_matching.src_port}};return s.enableDestinationPort=void 0!==e.qos_matching.dst_port,s.enableSourcePort=void 0!==e.qos_matching.src_port,s.enableQosMarking=void 0!==e.qos_marking.cos_code||void 0!==e.qos_marking.dscp_code||void 0!==e.qos_marking.ip_precedence_code,s.markingTrafficType=void 0!==e.qos_marking.cos_code?i.ev.COS:i.ev.DSCP,s.matchingTrafficType=void 0!==e.qos_matching.dscp_code?i.ev.DSCP:void 0!==e.qos_matching.ip_precedence_code?i.ev.IP_PRECEDENCE:i.AC,s.protocolNumber="number"==typeof e.qos_matching.protocol?e.qos_matching.protocol:0,s}},98870(e,s,t){t.d(s,{A:()=>T,c:()=>M});var a=t(274934),l=t(602086),i=t(843871),o=t(645951),n=t(120197),r=t(470070),d=t(309130),_=t(100978),c=t(857780),A=t(877840),p=t(846294),O=t(146215),u=t(748290),m=t(454928),C=t(309675),g=t(753959),h=t(195021);const M=(0,a.jsx)(o.A,{messages:[["COMMON_SPANNING_TREE_TOOLTIP"],["COMMON_SPANNING_TREE_TOOLTIP_2"]]}),T=({disabled:e,showBpduGuard:s,showUplink:t,isRuntimeUplink:o})=>{const{values:T,setValues:b,setFieldValue:E}=(0,i.j7)(),x=(0,l.useCallback)(e=>{e||b({...T,stp_port_mode:e,stp_edge_state:c.MV.AUTO,stp_uplink:u.ZV.stp_uplink,stp_bpdu_guard_enabled:u.ZV.stp_bpdu_guard_enabled})},[T,b]);(0,l.useEffect)(()=>{o&&T.stp_bpdu_guard_enabled&&E("stp_bpdu_guard_enabled",!1)},[o,T.stp_bpdu_guard_enabled,E]);const N=!!o,j=T.stp_edge_state===c.MV.ENABLED,v=(0,l.useMemo)(()=>(0,a.jsx)(_.A,{flexDirection:"column",gap:d.kc,children:(0,a.jsx)(n.A,{name:"stp_bpdu_guard_enabled",type:"realCheckbox",checked:T.stp_bpdu_guard_enabled,tooltipMessage:(0,a.jsx)(r.sA,{id:"PORTS_BPDU_GUARD_TOOLTIP"}),tooltipProps:{portal:!0},onChange:()=>{T.stp_bpdu_guard_enabled&&E("stp_bpdu_guard_enabled",!1)},children:(0,a.jsx)(m.A,{children:(0,a.jsx)(r.sA,{id:"PORTS_BPDU_GUARD"})})})}),[T.stp_bpdu_guard_enabled,E]);return(0,a.jsx)(A.A,{isDisabled:!!e,children:(0,a.jsxs)(_.A,{flexDirection:"column",gap:d.kc,children:[(0,a.jsx)(h.l2,{children:(0,a.jsx)(n.A,{name:"stp_port_mode",type:"realCheckbox",checked:T.stp_port_mode,tooltipMessage:M,tooltipProps:{portal:!0},afterChange:x,children:(0,a.jsx)(r.sA,{id:"COMMON_STP"})})}),t?(0,a.jsx)(A.A,{isDisabled:!T.stp_port_mode||j,children:(0,a.jsx)(h.l2,{justifyContent:"space-between",width:"100%",children:(0,a.jsx)(n.A,{name:"stp_uplink",type:"realCheckbox",checked:T.stp_uplink,tooltipMessage:(0,a.jsx)(r.sA,{id:"PORTS_STP_UPLINK_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,a.jsx)(r.sA,{id:"PORTS_STP_UPLINK"})})})}):null,s?(0,a.jsx)(A.A,{isDisabled:!T.stp_port_mode,children:(0,a.jsx)(h.l2,{children:(0,a.jsxs)(p.A,{reason:N&&!T.stp_bpdu_guard_enabled?(0,a.jsx)(r.sA,{id:"PORTS_BPDU_GUARD_DISABLED_UPLINK"}):null,children:[!T.stp_port_mode||T.stp_bpdu_guard_enabled||N?v:(0,a.jsx)(O.A,{message:(0,a.jsx)(r.sA,{id:"PORTS_BPDU_GUARD_ENABLE_CONFIRMATION_MESSAGE"}),title:(0,a.jsx)(r.sA,{id:"PORTS_BPDU_GUARD_ENABLE_CONFIRMATION_TITLE"}),confirmButtonLabel:"COMMON_ACTION_CONFIRM",onConfirm:()=>{E("stp_bpdu_guard_enabled",!0)},trigger:(0,a.jsx)("div",{children:v})}),j&&!T.stp_bpdu_guard_enabled?(0,a.jsx)(g.A,{icon:(0,a.jsx)(C.A,{}),marginTop:d.YC,children:(0,a.jsx)(r.sA,{id:"PORTS_BPDU_GUARD_EDGE_RECOMMENDATION_MESSAGE"})}):null]})})}):null]})})}},289107(e,s,t){t.d(s,{A:()=>S});var a=t(274934),l=t(602086),i=t(237725),o=t(977872),n=t(843871),r=t(599110),d=t(938984),_=t(853777),c=t(318087),A=t(309130),p=t(645951),O=t(787481),u=t(531302),m=t(164487),C=t(120197),g=t(100978),h=t(612389),M=t(104997),T=t(470070),b=t(976458),E=t(64222),x=t(197571),N=t(857780),j=t(119208),v=t(969288),R=t(877840),L=t(743492);const S=({disabled:e,isVlanTaggingSupported:s,showSwitchVlanLimit:t,showApVlanLimit:S})=>{const f=(0,i.W6)(),{site:I}=(0,i.g)(),P=(0,o.d4)(b.Xt),D=(0,i.tW)(P,{site:I}),{values:{native_networkconf_id:k,tagged_vlan_mgmt:w,voice_networkconf_id:F,taggedVlans:y,portconf_id:U},setFieldValue:V,errors:q,touched:G,submitCount:$,values:H,setValues:B}=(0,n.j7)(),K=(0,o.d4)((0,x.lq)(k)),W=(0,o.d4)((0,L.y)(k)),Y=(0,l.useCallback)(e=>{const s={};s.tagged_vlan_mgmt=e,s.taggedVlans=[],s.voice_networkconf_id=E.F,s.voiceNetworkConfEnabled=!1,B({...H,...s})},[B,H]),z=(0,l.useCallback)(e=>{Y(e)},[Y]),Q=(0,l.useCallback)(()=>{f.push(`${D}/${M.VO.SETTINGS}/${v.E5}`)},[f,D]),X=0===W?.length||!s;return(0,l.useEffect)(()=>{w===N.sg.CUSTOM&&X&&!U&&Y(N.sg.AUTO)},[w,X,Y,U]),(0,l.useEffect)(()=>{s||U||K||V("tagged_vlan_mgmt",N.sg.BLOCK_ALL)},[s,K,V,U,k]),(0,a.jsxs)(a.Fragment,{children:[s?null:(0,a.jsx)(h.A,{icon:(0,a.jsx)(_.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,a.jsx)(T.sA,{id:"PORTS_FORM_VLAN_TAGGING_NOT_SUPPORTED"})}),(0,a.jsxs)(g.A,{flexDirection:"column",children:[(0,a.jsx)(R.A,{isDisabled:e,children:(0,a.jsx)(m.A,{tooltip:(0,a.jsx)(p.A,{messages:[["COMMON_PORTS_FORM_TAGGED_VLAN_MODE_DESC"],["COMMON_PORTS_FORM_TAGGED_VLAN_MODE_DESC_2"],["COMMON_PORTS_FORM_TAGGED_VLAN_MODE_DESC_3"]]}),children:(0,a.jsx)(T.sA,{id:"COMMON_PORTS_TAGGED_VLAN_MANAGEMENT"})})}),(0,a.jsxs)(O.A,{children:[(0,a.jsx)(C.A,{value:N.sg.AUTO,type:"radio",name:"tagged_vlan_mgmt",onChange:()=>z(N.sg.AUTO),disabled:e||!s&&!K,children:(0,a.jsx)(T.sA,{id:"COMMON_ALLOW_ALL"})}),(0,a.jsx)(C.A,{value:N.sg.BLOCK_ALL,type:"radio",name:"tagged_vlan_mgmt",onChange:()=>z(N.sg.BLOCK_ALL),disabled:e,children:(0,a.jsx)(T.sA,{id:"COMMON_BLOCK_ALL"})}),(0,a.jsx)(C.A,{value:N.sg.CUSTOM,type:"radio",name:"tagged_vlan_mgmt",disabled:e||X,onChange:()=>z(N.sg.CUSTOM),children:(0,a.jsx)(T.sA,{id:"COMMON_CUSTOM"})})]}),t?(0,a.jsx)(h.A,{marginTop:A.kc,icon:(0,a.jsx)(_.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,a.jsx)(T.sA,{id:"PORTS_DEVICE_VLAN_LIMIT_INFO",values:{limit:j.Oz}})}):null,S?(0,a.jsx)(h.A,{marginTop:A.kc,icon:(0,a.jsx)(_.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,a.jsx)(T.sA,{id:"PORTS_DEVICE_VLAN_LIMIT_INFO",values:{limit:j.pC}})}):null]}),w===N.sg.CUSTOM?(0,a.jsx)(g.A,{flexDirection:"column",children:(0,a.jsx)(u.A,{options:W,list:y,onChange:e=>{const s={};s.taggedVlans=e,e.includes(F)||(s.voice_networkconf_id=E.F,s.voiceNetworkConfEnabled=!1),B({...H,...s})},disabled:e,triggerButtonText:"COMMON_ACTION_SELECT_VLANS",validationMessage:(0,c.t$)("taggedVlans",q,G,$),truncateLabels:!0,label:(0,a.jsx)(T.sA,{id:"COMMON_TAGGED_VLANS"}),tooltipDescription:(0,a.jsxs)(g.A,{flexDirection:"column",gap:A.xO,children:[(0,a.jsx)(d.A,{color:"text-1",size:"small",children:(0,a.jsx)(T.sA,{id:"COMMON_PORTS_FORM_TAGGED_VLANS_DESC"})}),(0,a.jsx)(d.A,{color:"text-1",size:"small",children:(0,a.jsx)(T.sA,{id:"COMMON_PORTS_FORM_TAGGED_VLANS_DESC_2",values:{link:(0,a.jsx)(r.A,{type:"button",variant:"inline",onClick:Q,children:(0,a.jsx)(T.sA,{id:"COMMON_ETHERNET_PORT_PROFILE"})})}})})]}),tooltipProps:{portal:!0,isInteractive:!0}})}):null]})}},195021(e,s,t){t.d(s,{EV:()=>d,l2:()=>n,rH:()=>r});var a=t(247816),l=t(409844),i=t(309130),o=t(100978);const n=(0,a.A)(o.A)`
  min-height: ${i.fS};
  align-items: center;
  align-self: flex-start;
`,r=l.AH`
  max-width: 130px;
  width: 130px;
`,d=l.AH`
  > div {
    margin: 0 !important;
  }
`},743492(e,s,t){t.d(s,{c:()=>d,y:()=>r});var a=t(222102),l=t(594005),i=t(423564),o=t(197571),n=t(857780);const r=e=>(0,a.Mz)(o.Tn,s=>s.filter(s=>s._id!==e&&!(0,i.$X)(s)).sort(l.Cv).map(e=>({label:(0,i.gm)(e),value:e._id,additionalInfo:(0,i.mC)(e)}))),d=(e,s,t)=>(0,a.Mz)(o.Tn,a=>a.filter(a=>(s.includes(a._id)||t===n.sg.AUTO)&&e!==a._id&&!(0,i.uH)(a)&&!(0,i.$X)(a)).sort(l.Cv).map(e=>({label:(0,i.gm)(e),value:e._id,additionalInfo:(0,i.mC)(e)})))},521376(e,s,t){var a;t.d(s,{U:()=>a}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(a||(a={}))},61322(e,s,t){t.d(s,{I:()=>a});const a={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,s,t,a){return Math.min((a||this.ROW_HEIGHT)*e+(t??this.HEADER_HEIGHT),(a||this.ROW_HEIGHT)*s+(t??this.HEADER_HEIGHT))},getEditContainerHeight(e,s,t){return Math.min((t||this.EDIT_FIELD_HEIGHT)*e,(t||this.EDIT_FIELD_HEIGHT)*s)}}},846294(e,s,t){t.d(s,{A:()=>d});var a=t(274934),l=t(125799),i=t(409844),o=t(184931),n=t(877840);const r=i.AH`
  width: fit-content;
`,d=({reasons:e,reason:s,children:t,isInteractive:i,noWrap:d,position:_,fitContent:c})=>{const A=(0,o.pv)(),p=[s,...e||[]].filter(Boolean)[0]||null,O=!!p;return(0,a.jsx)(n.A,{isDisabled:{fields:O,labels:O,tooltipIcons:O,tooltipPopovers:!A.fields&&O},children:(0,a.jsx)(l.A,{description:A.fields?null:p,portal:!0,isInteractive:i,noWrap:d,position:_,className:c?r:void 0,children:t})})}},431421(e,s,t){t.d(s,{K:()=>o});var a=t(254590),l=t(831433),i=t(347625);const o=(e,s,t)=>{const o=e.find(e=>e.mac===t);if(o){const e=(0,i.Q)(o);if(e&&e!==t)return e;const s=(0,i.Lm)(o.model);if(s)return s}const n=s.find(e=>"mac"in e&&e.mac===t);if(n){const e=(0,l.tn)(n);if(e&&e!==t)return e}return a.L}},717101(e,s,t){t.d(s,{A:()=>a});const a=function(e,s){const t={...e.advancedConfigSwap},a={...e,advancedConfigSwap:{}};return Object.keys(t).forEach(e=>{const s=t[e];t[e]=a[e],a[e]=s}),a.advancedConfigSwap=t,a.setting_preference=s,a}}}]);