"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[35965],{141046:(e,t,o)=>{o.d(t,{A:()=>r});const r=(e,t)=>!!t.current&&e.composedPath().includes(t.current)},158216:(e,t,o)=>{o.d(t,{K:()=>r});const r=(e,t)=>e?"COMMON_DEVICE_AUTONEG_FULL":t?"COMMON_DEVICE_DUPLEX_FULL":"COMMON_DEVICE_DUPLEX_HALF"},319826:(e,t,o)=>{o.d(t,{$3:()=>C,SD:()=>v,b5:()=>I,nR:()=>P,sD:()=>w,yz:()=>N});var r=o(296540),n=o(566401),a=o(927099),i=o(71479),l=o(316144),s=o(137298),d=o(6510),p=o(266714),m=o(294303),c=o(6176),u=o(703447),_=o(699784),E=o(768941),f=o(962669),A=o(757167),x=o(552020),O=o(780811),h=(o(154828),o(951106));const g=(0,i.A)(a.A)`
  padding-left: 10px;
  color: inherit;
  font-size: inherit;
`,C=({activeItem:e,networkGroups:t,rest:o})=>{const{diagram:a}=(0,O.joB)(e.model),i=[(0,O.D6h)(e),(0,O.bf1)(e),(0,O.Bh_)(e)],{uplinkItems:E,...C}=o||{},I=(0,O.Tl7)(e)||(0,O.kYz)(e)||(0,O.vqp)(e),N=a.length?(0,f.sT)(a,e):(0,f.oJ)(e);return N?N.flat().reduce((o,a)=>{if(!a)return o;const f=(0,O.NF$)(a.portNumber,e);if((0,n.A)(f))return o;const N=r.createElement(m.A,{alignItems:"center"},r.createElement(p.A,{cellData:f,activeItem:e,style:{minWidth:20},...C}),r.createElement(g,{truncate:!0},f.port_idx)),w=r.createElement(m.A,{alignItems:"center"},r.createElement(p.A,{cellData:f,activeItem:e,style:{minWidth:20},disableOnPortClick:I,...C}),r.createElement(g,{truncate:!0},((e,t)=>{if(t.poe_caps&&!(0,O.C6C)(e)){const e=(0,x.Ki)(t);return e?r.createElement(_.sA,{id:e,values:{power:t.poe_power}}):""}return t.up?(0,s.ap)(t?.speed||0)||r.createElement(_.sA,{id:"DEVICE_PORT_STATE_CONNECTED"}):t.enable?r.createElement(_.sA,{id:"COMMON_DISCONNECTED"}):r.createElement(_.sA,{id:"COMMON_DISABLED"})})(e,f))),P=(0,l.nL)(f.ifname,e,t),v="Internal"===P?.label,b=P?.id?.startsWith("LAN")||v,k=E?.find(e=>e.portIdx===f.port_idx)?.connected[0];let R=r.createElement(m.A,null);if(k){const e="device_id"in k?(0,d.Q)(k):(0,h.tn)(k),t="device_id"in k?r.createElement(c.A,{model:k.model,width:18,height:22}):r.createElement(m.A,{height:26,minWidth:22,maxWidth:22,justifyContent:"center",alignItems:"center"},r.createElement(u.A,{client:k}));R=r.createElement(m.A,{alignItems:"center"},r.createElement(m.A,{alignItems:"center",marginRight:"14px"},t),r.createElement(m.A,{alignItems:"center",flex:1},e))}const S={...f,id:f.port_idx?.toString()||f.ifname,defaultNetworkGroupLabel:(0,O.Xq1)(e,f),disabled:f.masked||(0,A.dC)(f.ifname),isInternalPort:v,isLanPort:b,isWanPort:!b,networkGroup:P?.id,portUplinkItemName:R,portStatus:w,portSymbol:N};return i.every(e=>!e)&&(S.macFilters=f.port_security_mac_address?.length),o.push(S),o},[]).sort(({port_idx:e},{port_idx:t})=>e-t):[]},I=e=>e.isWanPort,N=e=>e.isLanPort,w=e=>e.filter(({disabled:e})=>!e).map(({port_idx:e})=>String(e)),P=(e,t)=>e.map(e=>{const o=t.find(t=>e.port_idx===t.portIdx);if(!o)return e;const{rx_broadcast:r,rx_bytes:n,rx_dropped:a,rx_errors:i,rx_multicast:l,rx_packets:s,tx_broadcast:d,tx_bytes:p,tx_dropped:m,tx_errors:c,tx_multicast:u,tx_packets:_}=o;return{...e,rx_broadcast:r,rx_bytes:n,rx_dropped:a,rx_errors:i,rx_multicast:l,rx_packets:s,tx_broadcast:d,tx_bytes:p,tx_dropped:m,tx_errors:c,tx_multicast:u,tx_packets:_}}),v=e=>{const{isPoeOffSupported:t,isPoePassthroughSupported:o,isPoePassive24Supported:r,isPoeAutoSupported:n}=e,a=[];return t&&a.push(E.Gu.OFF),o&&a.push(E.Gu.PASSTHROUGH),!o&&r&&a.push(E.Gu.PASSIVE_24V),!o&&n&&a.push(E.Gu.AUTO),a}},353899:(e,t,o)=>{o.d(t,{A:()=>u});var r=o(296540);(0,o(349005).A)(".tooltip-container__vRGVdKCu{display:inline-block}.tooltip__vRGVdKCu{border-radius:8px;cursor:default;padding:0}.tooltip__vRGVdKCu .content__vRGVdKCu{padding-bottom:12px;padding-top:8px}.modal-header__vRGVdKCu{font-family:var(--desktop-font-family-default);font-size:var(--desktop-font-size-medium);font-weight:var(--desktop-font-weight-semibold);line-height:20px}");var n=o(722860),a=o(159318),i=o(325898),l=o(141046),s=o(271856),d=o(255905),p=o(136283);const m=(0,n.c)({"tooltip-container":"tooltip-container__vRGVdKCu",tooltip:"tooltip__vRGVdKCu",content:"content__vRGVdKCu","modal-header":"modal-header__vRGVdKCu"}),c=100*a.Uq["desktop-sizing-base"],u=e=>{const{children:t,position:o,portal:n,offset:a,autoPosition:u,tooltipClassName:_,width:E=c,title:f,headerClassName:A,contentClassName:x,footerClassName:O,body:h,actions:g=[],allowOverflow:C,onRequestClose:I,showHeaderClose:N=!0,motif:w,rootClose:P=!0,isOpen:v,className:b,style:k,...R}=e,S=(0,r.useRef)(null),y=(0,r.useRef)(null),[T,D]=(0,r.useState)(!1),{motif:G}=(0,i.A)(w),F="boolean"==typeof v,M=g.map(({onClick:e,...t})=>({...t,onClick:t=>e&&e(t,D)})),L={padding:0,margin:0,...k},V=(0,r.useCallback)(e=>I?I(e,D):D(!1),[I,D]);return(0,r.useEffect)(()=>{const e=e=>{!(0,l.A)(e,y)&&P&&V(e)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[F,V,P]),r.createElement(s.A,{ref:y,isOpen:F?v:T,className:m.concat(b)("tooltip-container"),tooltipClassName:m.concat(_)("tooltip"),maxWidth:c,width:E,onClick:e=>{F||(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),D(!0))},position:o,portal:n,offset:a,motif:G,autoPosition:u,isInteractive:!0,description:r.createElement("div",{ref:S,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:L},r.createElement(d.A.Provider,{value:{motif:"dark"}},r.createElement(p.A,{title:f,headerClassName:m.concat(A)("modal-header"),contentClassName:m.concat(x)("content"),footerClassName:O,actions:M,allowOverflow:C,onRequestClose:N?V:void 0},h))),...R},t)}},373229:(e,t,o)=>{o.d(t,{A:()=>d});var r=o(296540),n=o(758649),a=o(71479),i=o(566723),l=o(699784);const s=(0,a.A)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${i.S2} ${i.fS};
  gap: ${i.kc};
`,d=({allowCancel:e,isDirty:t,isInvalid:o,isSubmitting:a,onFormSubmit:i,onFormReset:d,onFormCancel:p,className:m,submitButtonText:c,customButton:u,applyButton:_,applyButtonFirst:E,hideCancelButton:f,form:A})=>{const x=(0,r.useMemo)(()=>_||r.createElement(n.A,{name:"submit",variant:"primary",type:"submit",onClick:i,disabled:!t||o||a,form:A},r.createElement(l.sA,{id:c||"COMMON_ACTION_APPLY_CHANGES"})),[_,A,t,o,a,i,c]);return r.createElement(s,{className:m,hasFormResetButton:!!d},E?x:u,f?null:r.createElement(n.A,{name:"cancel",variant:"default",type:"button",onClick:p,disabled:!e&&!t},r.createElement(l.sA,{id:"COMMON_ACTION_CANCEL"})),d?r.createElement(n.A,{name:"reset",variant:"default",type:"button",onClick:d,disabled:!t},r.createElement(l.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULTS"})):null,E?u:x)}},594903:(e,t,o)=>{o.d(t,{A:()=>d});var r=o(296540);(0,o(349005).A)(".wrapper__6wOqtxX9{display:flex;flex-direction:column}.wrapper-disable__6wOqtxX9{opacity:.3;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.header__6wOqtxX9{align-items:center;display:flex;min-height:32px}.header-light__6wOqtxX9{border-color:#eef0f1}.header-dark__6wOqtxX9{border-color:#34383d}.headerText__6wOqtxX9{display:flex;flex:0 2 256px;font-family:var(--desktop-font-family-default);font-size:var(--desktop-font-size-medium);font-weight:var(--desktop-font-weight-semibold);line-height:20px;padding-right:calc(16px + 2%)}.headerText-light__6wOqtxX9{color:#212327}.headerText-dark__6wOqtxX9{color:#f9fafa}.content__6wOqtxX9{margin-top:28px}.titleContent__6wOqtxX9{align-items:flex-start;display:flex;flex:0 1 345px;justify-content:flex-start}");var n=o(722860),a=o(394756),i=o(325898),l=o(772776);const s=(0,n.c)({wrapper:"wrapper__6wOqtxX9","wrapper-disable":"wrapper-disable__6wOqtxX9",header:"header__6wOqtxX9","header-light":"header-light__6wOqtxX9","header-dark":"header-dark__6wOqtxX9",headerText:"headerText__6wOqtxX9","headerText-light":"headerText-light__6wOqtxX9","headerText-dark":"headerText-dark__6wOqtxX9",content:"content__6wOqtxX9",titleContent:"titleContent__6wOqtxX9"}),d=e=>{const{title:t,titleContent:o,content:n,className:d,containerClassName:p,disable:m,motif:c,style:u,..._}=(0,a.b)(e),{motif:E}=(0,i.A)(c),f=(0,l.p)(e);return r.createElement("div",{className:s.concat(d)("wrapper",{"wrapper-disable":m}),style:{...u,...f},..._},r.createElement("div",{className:s("header",`header-${E}`)},r.createElement("span",{className:s("headerText",`headerText-${E}`)},t),o&&r.createElement("div",{className:s("titleContent")},o)),n&&r.createElement("div",{className:s.concat(p)("content")},n))};d.displayName="SettingsGridTitle"},684271:(e,t,o)=>{o.r(t),o.d(t,{default:()=>se});var r=o(868238),n=o(469733),a=o(296540),i=o(951272),l=o(927099),s=o(823858),d=o(71479),p=o(316144),m=o(742920),c=o(513180),u=o(870443),_=o(960407),E=o(398300),f=o(566723),A=o(855019),x=o(294303),O=o(845030),h=o(699784),g=o(319826),C=o(233187),I=o(366188),N=o(780811),w=o(392290),P=o(171073),v=o(604561),b=o(822336),k=o(594903),R=o(842151),S=o(350312),y=o(373229),T=o(143811),D=o(768941),G=o(578819);const F=(0,d.A)(l.A)`
  line-height: 2.4em;
`,M=(0,d.A)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,L=({wanPortData:e})=>{const{formatMessage:t}=(0,h.tz)(),{portIdx:o,networkGroup:r,speed:n,...i}=e,s=(0,G.kO)(i),d=`ports[${o-1}].poe_mode`,p=(0,a.useMemo)(()=>{const{isPoeOffSupported:e,isPoePassthroughSupported:o,isPoeAutoSupported:r,isPoePlusPlusSupported:n,isPoePlusSupported:a}=s,i=[];if(e&&i.push({label:t({id:"COMMON_DEVICE_POE_MODE_OFF"}),value:D.Gu.OFF}),!o&&r){let e="";e=t(n?{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}:a?{id:"COMMON_DEVICE_POE_MODE_AUTO"}:{id:"COMMON_DEVICE_POE_MODE_POE"}),i.push({label:e,value:D.Gu.AUTO})}return i},[t,s]);return a.createElement(x.A,{justifyContent:"space-between",alignItems:"center",marginBottom:24},a.createElement(x.A,{padding:"0 8px",flexDirection:"column"},a.createElement(l.A,{size:"caption",color:"tertiary"},a.createElement(h.sA,{id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",values:{port:o,networkGroup:r}})),a.createElement(F,{size:"body",color:"primary"},a.createElement(h.sA,{id:"COMMON_DEVICE_POE_MODE_POE"}))),a.createElement(M,null,a.createElement(T.A,{name:d,type:"dropdown",variant:"secondary",options:p,full:!0})))};var V=o(489391),W=o(137298),U=o(860631),q=o(431247),X=o(158216);const B=(0,d.A)(x.A,{shouldForwardProp:e=>"omitSpacing"!==e})`
  margin-bottom: ${f.S2};
  ${({omitSpacing:e})=>e?"":`&:nth-of-type(3) {\n    padding-top: ${f.S2};\n  }`}
`,$=(0,d.A)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,z=({activeItem:e,port:t,groupOptions:o,speedOptions:r,group:n,omitSpacing:i})=>{const l=(0,N.Dh3)(e)||!(0,N.oWO)(e)&&!(0,U.jP)(e),{bindWith:s}=(0,p.Nk)(e.model,t.ifname);return a.createElement(B,{justifyContent:"space-between",omitSpacing:i},a.createElement($,null,a.createElement(T.A,{type:"dropdown",variant:"secondary",name:`ports[${t.portIdx-1}].networkGroup`,label:(0,N.lRq)(e)||(0,N.GJ5)(e)?"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP_SHORT":"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",translateLabel:!0,translateLabelValues:{port:(0,N.oWO)(e)?(0,N.joB)(e.model).ports[t.ifname]:t.portIdx,networkGroup:n},options:o,readOnly:l,validated:!0,full:!0})),r.length>0?a.createElement($,null,a.createElement(T.A,{label:"DEVICE_PROPERTIES_GATEWAY_PORTS_SPEED_DUPLEX",name:`ports[${t.portIdx-1}].speed`,type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:r,disabled:!!s&&s!==t.ifname})):null)},j=[8,9,10,11],K=(e,t,o)=>!t.some(({networkGroup:t})=>t===e)||e===o.networkGroup,H=({activeItem:e,ports:t})=>{const{formatMessage:o}=(0,h.tz)(),r=(0,n.useSelector)(_.n6),i=(0,n.useSelector)(I.LV),l=(0,N.UiL)(e)||(0,N.oaW)(e),s=(0,U.iw)(e),d=(0,N.lRq)(e),m=(0,N.oWO)(e),c=(0,a.useCallback)(({ifname:t})=>((0,p.Nk)(e.model,t)?.supportedValues||[]).filter(e=>!!v.A.linkNegotiationOptions[e]).map(e=>{const{speed:t=0,full_duplex:o=!1,autoneg:r}=v.A.linkNegotiationOptions[e],{value:n,unit:a}=(0,V.cS)((0,W.N8)(t),"bitrate"),i=`${n}${a}`;return{label:(0,X.K)(r,o),value:JSON.stringify({speed:t,full_duplex:o}),values:!r&&{speed:i}}}),[e.model]),u=(0,a.useMemo)(()=>r!==A.uj.WAN||s?i.filter(({id:e})=>e.startsWith("LAN")):[],[r,s,i]),E=(0,a.useMemo)(()=>o({id:"COMMON_DISABLED"}),[o]),f=(0,a.useCallback)(e=>[...[...i.filter(({id:e})=>e.startsWith("WAN")&&e!==C._4.WAN_LTE_FAILOVER),...u].filter(({id:o})=>s&&!m&&!!o.startsWith("LAN")||K(o,t,e)).map(({id:e})=>({value:e,label:e})),{value:w.zJ,label:E}],[E,s,m,u,i,t]),x=(0,a.useMemo)(()=>t.filter(({isWanPort:e,media:t})=>r!==A.uj.WAN&&s?!(0,q.d4)({media:t}):e).sort((e,t)=>e.portIdx-t.portIdx),[s,t,r]),O=(0,a.useMemo)(()=>t.filter(({media:e})=>!(r===A.uj.WAN&&!l||!s)&&(0,q.d4)({media:e})),[s,l,t,r]);return l&&s?a.createElement(a.Fragment,null,t.filter(({portIdx:e})=>j.includes(e)).map(t=>a.createElement(z,{activeItem:e,port:t,groupOptions:f(t),speedOptions:c(t),group:t.media||t.defaultNetworkGroupLabel,key:t.portIdx,omitSpacing:!0}))):a.createElement(a.Fragment,null,x.map(t=>a.createElement(z,{activeItem:e,port:t,groupOptions:f(t),speedOptions:c(t),group:t.defaultNetworkGroupLabel||E,key:t.portIdx,omitSpacing:!d})),O.map(t=>a.createElement(z,{activeItem:e,port:t,groupOptions:f(t),speedOptions:c(t),group:t.media||t.defaultNetworkGroupLabel,key:t.portIdx,omitSpacing:!d})))},J=(0,d.A)(x.A)`
  position: relative;
  margin: -18px -30px 40px;
  padding: 12px 0;
  border-bottom: ${({theme:{themeName:e}})=>b.Ay[`desktop-border-divider-${e}`]};

  svg {
    position: absolute;
    left: 24px;
  }
`,Y=(0,d.A)(y.A,{shouldForwardProp:e=>!["isFullPage"].includes(e)})`
  ${({isFullPage:e})=>e&&"\n    width: 100%;\n    justify-content: flex-end;  \n    gap:10px;\n  "};
`,Q=(0,d.A)(k.A)`
  & > div > span {
    flex: 1;
  }
`,Z=(0,d.A)(l.A)`
  width: 100%;
  text-align: center;
`,ee=(0,d.A)(x.A)`
  width: 100%;
  padding: 16px 30px;
`,te=(0,d.A)(x.A)`
  margin-bottom: 24px;
`,oe=(0,d.A)(s.A)`
  margin-right: 8px;
  color: ${({theme:{motifPalette:{warning:e}}})=>e};
`,re=({activeItem:e,submitForm:t,resetForm:o,values:r,dirty:i,setFieldValue:s,errors:d,isFullPage:p,onFormCloseAction:m})=>{const c=(0,n.useDispatch)(),u=(0,n.useSelector)(_.oI),f=(0,n.useSelector)(I.LV),{networkGroups:A}=(0,N.joB)(e.model),x=()=>{o(),m?m():c((0,O.XP)({type:E.H.DEVICE,id:e.mac,tab:u}))},g=r.ports.filter(({isWanPort:e,port_poe:t})=>e&&t),C=(0,a.useMemo)(()=>r.ports.some(e=>JSON.parse(e.speed||"{}").speed),[r.ports]);return a.createElement(a.Fragment,null,a.createElement(ee,{flexDirection:"column",flex:"1 1 85%"},p?a.createElement(R.A,{padding:"none"},a.createElement(Q,{title:a.createElement(h.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"})})):a.createElement(J,{alignItems:"center"},a.createElement(S.A,{onClick:x,style:{cursor:"pointer"}}),a.createElement(Z,{size:"body",weight:"bold"},a.createElement(h.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"}))),a.createElement(H,{activeItem:e,ports:r.ports}),(0,a.isValidElement)(d.ports)?d.ports:null,C?a.createElement(te,null,a.createElement(oe,{width:19,height:19}),a.createElement(l.A,{size:"body"},a.createElement(h.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_SPEED_WARNING"}))):null,g.length>0?a.createElement(a.Fragment,null,a.createElement(k.A,{title:a.createElement(h.sA,{id:"DEVICE_PORT_PROFILE_OVERRIDE"})}),g.map(e=>a.createElement(L,{key:e.id,wanPortData:e}))):null),a.createElement(Y,{isDirty:i,onFormSubmit:t,onFormCancel:x,onFormReset:()=>{s("ports",r.ports.map(e=>{const t=f.find(t=>t.id===A[e.ifname]);return{...e,networkGroup:t?.id||w.zJ,autoneg:!0,speed:JSON.stringify({speed:0,full_duplex:!1})}}))},submitButtonText:p?null:"COMMON_ACTION_APPLY",allowCancel:!0,isFullPage:!!p}))},ne=(0,d.A)(s.A)`
  margin-right: ${f.kc};
  color: ${({theme:{motifPalette:{danger:e}}})=>e};
`,ae=[1,2,6],ie=(0,i.bk)({enableReinitialize:!0,mapPropsToValues:({networkGroups:e,activeItem:t})=>{const o=(0,g.$3)({activeItem:t,networkGroups:e});return{ports:o.sort((e,t)=>e.portIdx-t.portIdx).map((e,r)=>{const{supportedValues:n=[],bindWith:a}=(0,p.Nk)(t.model,e.ifname),i=!("autoneg"in e?e.autoneg:v.A.autoneg)&&e.speed&&e.full_duplex?{speed:e.speed,full_duplex:e.full_duplex}:{speed:0,full_duplex:!1};if(a){const e=o.find(e=>e.ifname===a);i.speed=e.speed,i.full_duplex=e.full_duplex}const l=JSON.stringify(i),{portName:s,portStatus:d,portSymbol:m,portUplinkItemName:c,...u}=e;return{...u,networkGroup:e.networkGroup||w.zJ,...n.length?{speed:l}:{},itemIndex:r}})}},validationSchema:({intl:{formatMessage:e},activeItem:t,params:o})=>{const r=o?.subPanelId===A.uj.ALL;return u.A.object().shape({ports:u.A.array().of(u.A.object().shape({networkGroup:u.A.string().label(e({id:"COMMON_INTERFACE"})).oneOf([c.C.WAN,c.C.WAN2,w.zJ,...(0,p.m9)(t)]).required()})).test("has-default-network-groups",a.createElement(x.A,{marginBottom:f.S2},a.createElement(ne,{width:19,height:19}),a.createElement(l.A,null,a.createElement(h.sA,{id:r?"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_OR_LAN_WARNING":"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_WARNING"}))),e=>e.some(e=>e.networkGroup===c.C.WAN)&&(!r||e.some(e=>e.networkGroup===C._4.LAN)))})},handleSubmit:({ports:e},{props:{networkGroups:t,updateDeviceWithIdEndpoint:o,showPropertyPanel:r,activeItem:{_id:n,port_overrides:a=[],mac:i},activeItem:l,onFormCloseAction:s,intl:{formatMessage:d},propertyPanelActiveItemTab:p}})=>{const c=(0,g.$3)({activeItem:l,networkGroups:t}),u=d({id:"DEVICE_PROPERTY_HEADER_PORTS"}),_=(0,N.ziy)({model:l.model}),f=_?e.filter(e=>ae.includes(e.portIdx)):e,A=_?(a||[]).filter(e=>ae.includes(e.port_idx)):a,x=[...f.map(e=>{const{speed:t,full_duplex:o}=JSON.parse(e.speed),{speed:r,full_duplex:n,...a}=A?.find(t=>t.port_idx===e.portIdx)||{};return{...a,...t?{speed:t,full_duplex:o}:{},...e.poe_mode!==c[e.portIdx-1].poe_mode?{poe_mode:e.poe_mode}:{},port_idx:e.portIdx,autoneg:!t}}),...(A||[])?.filter(e=>!f.some(t=>t.portIdx===e.port_idx))||[]],O=[];c.forEach(e=>{if(e.ifname.startsWith("eth")){const t=f.find(t=>t.ifname===e.ifname);if(t){if(t.networkGroup===w.zJ)return;O.push({ifname:t.ifname,networkgroup:t.networkGroup})}else e.networkGroup&&O.push({ifname:e.ifname,networkgroup:e.networkGroup})}}),o({port_overrides:x,ethernet_overrides:O},n,i,{failureToast:{icon:m.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:u}},mergeAndOverrideKeys:["port_overrides","ethernet_overrides"],extend:!0}).then(()=>{s?s():r({type:E.H.DEVICE,id:l.mac,tab:p})})}}),le={updateDeviceWithIdEndpoint:P.ex,showPropertyPanel:O.XP},se=(0,r.Zz)(h.j4,(0,n.connect)((e,{onFormCloseAction:t})=>({networkGroups:(0,I.LV)(e),onFormCloseAction:t,propertyPanelActiveItemTab:(0,_.oI)(e)}),le),ie)(re)}}]);