"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[84575],{595778(e,i,t){t.d(i,{I:()=>s,U:()=>n});var l=t(241365);const s=(0,t(419284).Wj)(l.Ay["blue-0"]),n=100},171623(e,i,t){var l;t.d(i,{A:()=>s}),function(e){e.AUTO="auto",e.POE="8023af",e.POE_PLUS="8023at",e.POE_PLUS_PLUS="poe-injector",e.ADAPTER="adapter"}(l||(l={}));const s=l},144312(e,i,t){t.d(i,{A:()=>o});var l=t(274934),s=t(125799),n=t(470070);const o=({show:e,children:i,position:t})=>(0,l.jsx)(s.A,{position:t||"topStart",description:e?(0,l.jsx)(n.sA,{id:"DEVICE_DISABLE_GLOBAL_SWITCH_SETTINGS"}):void 0,children:(0,l.jsx)("span",{children:i})})},645951(e,i,t){t.d(i,{A:()=>d});var l=t(274934),s=t(938984),n=t(309130),o=t(470070),r=t(100978);const d=({messages:e=[]})=>e.length?(0,l.jsx)(r.A,{flexDirection:"column",gap:n.kc,children:e.map(([e,i={}])=>(0,l.jsx)(s.A,{color:"inherit",size:"inherit",children:(0,l.jsx)(o.sA,{id:e,values:i})},e))}):null},454928(e,i,t){t.d(i,{A:()=>n});var l=t(274934),s=t(947414);const n=({children:e})=>(0,l.jsx)("span",{onClick:e=>{e.stopPropagation()},role:"button",tabIndex:0,onKeyDown:s.P1,children:e})},753959(e,i,t){t.d(i,{A:()=>d});var l=t(274934),s=t(814557),n=t(853777),o=t(263705),r=t(612389);const d=({children:e,icon:i,background:t,...d})=>{const{themeName:a}=(0,o.u)();return(0,l.jsx)(r.A,{icon:i||(0,l.jsx)(n.A,{variant:"fill",size:"original",color:s.Ay[`desktop-color-ublue-06-${a}`]}),description:e,background:t,...d})}},787481(e,i,t){t.d(i,{A:()=>r});var l=t(274934),s=t(833466),n=t(309130),o=t(100978);const r=e=>(0,l.jsx)(o.A,{paddingTop:n.YC,paddingBottom:n.YC,gap:n.Ln,rowGap:n.YC,flexWrap:"wrap",minHeight:s.b,alignItems:"center",...e})},341699(e,i,t){t.d(i,{HV:()=>n,pm:()=>o,vF:()=>s});var l=t(726831);const s=e=>`${l.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,n=e=>`${l.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`,o=()=>`${l.A.fabricsOrchestration}`},98870(e,i,t){t.d(i,{A:()=>E,c:()=>j});var l=t(274934),s=t(602086),n=t(843871),o=t(645951),r=t(120197),d=t(470070),a=t(309130),c=t(100978),_=t(857780),A=t(877840),p=t(846294),m=t(146215),x=t(748290),h=t(454928),u=t(309675),b=t(753959),g=t(195021);const j=(0,l.jsx)(o.A,{messages:[["COMMON_SPANNING_TREE_TOOLTIP"],["COMMON_SPANNING_TREE_TOOLTIP_2"]]}),E=({disabled:e,showBpduGuard:i,showUplink:t,isRuntimeUplink:o})=>{const{values:E,setValues:O,setFieldValue:f}=(0,n.j7)(),C=(0,s.useCallback)(e=>{e||O({...E,stp_port_mode:e,stp_edge_state:_.MV.AUTO,stp_uplink:x.ZV.stp_uplink,stp_bpdu_guard_enabled:x.ZV.stp_bpdu_guard_enabled})},[E,O]);(0,s.useEffect)(()=>{o&&E.stp_bpdu_guard_enabled&&f("stp_bpdu_guard_enabled",!1)},[o,E.stp_bpdu_guard_enabled,f]);const v=!!o,I=E.stp_edge_state===_.MV.ENABLED,S=(0,s.useMemo)(()=>(0,l.jsx)(c.A,{flexDirection:"column",gap:a.kc,children:(0,l.jsx)(r.A,{name:"stp_bpdu_guard_enabled",type:"realCheckbox",checked:E.stp_bpdu_guard_enabled,tooltipMessage:(0,l.jsx)(d.sA,{id:"PORTS_BPDU_GUARD_TOOLTIP"}),tooltipProps:{portal:!0},onChange:()=>{E.stp_bpdu_guard_enabled&&f("stp_bpdu_guard_enabled",!1)},children:(0,l.jsx)(h.A,{children:(0,l.jsx)(d.sA,{id:"PORTS_BPDU_GUARD"})})})}),[E.stp_bpdu_guard_enabled,f]);return(0,l.jsx)(A.A,{isDisabled:!!e,children:(0,l.jsxs)(c.A,{flexDirection:"column",gap:a.kc,children:[(0,l.jsx)(g.l2,{children:(0,l.jsx)(r.A,{name:"stp_port_mode",type:"realCheckbox",checked:E.stp_port_mode,tooltipMessage:j,tooltipProps:{portal:!0},afterChange:C,children:(0,l.jsx)(d.sA,{id:"COMMON_STP"})})}),t?(0,l.jsx)(A.A,{isDisabled:!E.stp_port_mode||I,children:(0,l.jsx)(g.l2,{justifyContent:"space-between",width:"100%",children:(0,l.jsx)(r.A,{name:"stp_uplink",type:"realCheckbox",checked:E.stp_uplink,tooltipMessage:(0,l.jsx)(d.sA,{id:"PORTS_STP_UPLINK_TOOLTIP"}),tooltipProps:{portal:!0},children:(0,l.jsx)(d.sA,{id:"PORTS_STP_UPLINK"})})})}):null,i?(0,l.jsx)(A.A,{isDisabled:!E.stp_port_mode,children:(0,l.jsx)(g.l2,{children:(0,l.jsxs)(p.A,{reason:v&&!E.stp_bpdu_guard_enabled?(0,l.jsx)(d.sA,{id:"PORTS_BPDU_GUARD_DISABLED_UPLINK"}):null,children:[!E.stp_port_mode||E.stp_bpdu_guard_enabled||v?S:(0,l.jsx)(m.A,{message:(0,l.jsx)(d.sA,{id:"PORTS_BPDU_GUARD_ENABLE_CONFIRMATION_MESSAGE"}),title:(0,l.jsx)(d.sA,{id:"PORTS_BPDU_GUARD_ENABLE_CONFIRMATION_TITLE"}),confirmButtonLabel:"COMMON_ACTION_CONFIRM",onConfirm:()=>{f("stp_bpdu_guard_enabled",!0)},trigger:(0,l.jsx)("div",{children:S})}),I&&!E.stp_bpdu_guard_enabled?(0,l.jsx)(b.A,{icon:(0,l.jsx)(u.A,{}),marginTop:a.YC,children:(0,l.jsx)(d.sA,{id:"PORTS_BPDU_GUARD_EDGE_RECOMMENDATION_MESSAGE"})}):null]})})}):null]})})}},195021(e,i,t){t.d(i,{EV:()=>a,l2:()=>r,rH:()=>d});var l=t(247816),s=t(409844),n=t(309130),o=t(100978);const r=(0,l.A)(o.A)`
  min-height: ${n.fS};
  align-items: center;
  align-self: flex-start;
`,d=s.AH`
  max-width: 130px;
  width: 130px;
`,a=s.AH`
  > div {
    margin: 0 !important;
  }
`},277660(e,i,t){t.d(i,{A:()=>a});var l=t(274934),s=t(125799),n=t(938984),o=t(831721),r=t(309130),d=t(100978);const a=({label:e,tooltip:i,tooltipProps:t,style:a})=>(0,l.jsxs)(d.A,{alignItems:"center",gap:r.YC,style:a,children:[(0,l.jsx)(n.A,{size:"small",color:"text-3",children:e}),i?(0,l.jsx)(s.A,{description:i,portal:!0,style:{display:"flex",alignItems:"center"},...t,children:(0,l.jsx)(o.A,{size:"original",isActive:!0})}):null]})},419685(e,i,t){t.d(i,{A:()=>f});var l=t(274934),s=t(602086),n=t(770698),o=t(938984),r=t(762705),d=t(954702),a=t(247816),c=t(977872),_=t(669439),A=t(309130),p=t(793442),m=t(100978),x=t(470070),h=t(291935),u=t(598990),b=t(6276),g=t(341699);const j=(0,a.A)("div")`
  width: 100%;
  margin-bottom: ${A.Ln};
`,E=()=>{const e=(0,c.d4)(h.zu);return{isOrchestrated:(0,s.useMemo)(()=>(0,b.A)(e),[e]),globalSwitchSettings:e}},O=({globalSwitchSettings:e,children:i})=>{const t=(0,c.wA)(),n=(0,s.useCallback)(()=>{t((0,u.Np)("global_network")).then(e=>{(e?.data?.setting_keys||[]).length>0&&t((0,u.Uc)(void 0,{resolveWithExisting:!1}))})},[t]);return(0,l.jsx)(_.A,{placement:"top start",description:(0,l.jsxs)(m.A,{flexDirection:"column",width:"100%",children:[(0,l.jsx)(x.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS_MANAGED_BY_FABRIC"}),(0,l.jsxs)(m.A,{gap:A.YC,alignItems:"baseline",children:[(0,l.jsx)(p.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,g.vF)(e.cloud_template)}),(0,l.jsx)(o.A,{style:{textTransform:"lowercase"},size:"small",children:(0,l.jsx)(x.sA,{id:"COMMON_OR"})}),(0,l.jsx)(d.A,{variant:"destructive",fontSize:"inherit",onClick:n,children:(0,l.jsx)(x.sA,{id:"COMMON_DETACH"})})]})]}),children:(0,l.jsx)("div",{children:i})})},f={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:i,noStyledRow:t})=>{const{isOrchestrated:r,globalSwitchSettings:d}=E(),a=(0,s.useCallback)(({target:{checked:e}})=>{i(e)},[i]),c=(0,l.jsx)(n.A,{full:!0,checked:e,onChange:a,disabled:r,children:(0,l.jsx)(m.A,{width:"100%",alignItems:"center",children:(0,l.jsx)(o.A,{size:"medium",color:r?"disabled":void 0,children:(0,l.jsx)(x.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})})}),_=t?c:(0,l.jsx)(j,{children:c});return r?(0,l.jsx)(O,{globalSwitchSettings:d,children:_}):_},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:i,onChange:t,noStyledRow:n})=>{const{isOrchestrated:d,globalSwitchSettings:a}=E(),c=(0,s.useCallback)(({target:{checked:e}})=>{i(e),t?.(e)},[t,i]),_=(0,l.jsx)(r.A,{id:"global-switch-settings-checkbox",checked:e,onChange:c,disabled:d,children:(0,l.jsx)(o.A,{size:"medium",color:d?"disabled":void 0,children:(0,l.jsx)(x.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})}),A=n?_:(0,l.jsx)(j,{children:_});return d?(0,l.jsx)(O,{globalSwitchSettings:a,children:A}):A}}},554598(e,i,t){t.d(i,{A:()=>c});var l=t(274934),s=t(725989),n=t(938984),o=t(470070),r=t(100978),d=t(595778),a=t(662986);const c=({value:e=d.U,onChange:i})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(r.A,{flexDirection:"column",width:"100%",children:[(0,l.jsx)(r.A,{flexDirection:"row",alignItems:"center",children:(0,l.jsx)(n.A,{variant:"caption",children:(0,l.jsx)(o.sA,{id:"COMMON_BRIGHTNESS"})})}),(0,l.jsx)(s.A,{value:e,minValue:1,onChange:i})]}),(0,l.jsx)(r.A,{flexDirection:"column",children:(0,l.jsx)(n.A,{variant:"body-primary",children:(0,a.A)(e)})})]})},785616(e,i,t){t.d(i,{A:()=>h});var l=t(274934),s=t(602086),n=t(60927),o=t(419284),r=t(100978),d=t(420528),a=t(247816),c=t(291508);const _=(0,a.A)(r.A)`
  cursor: pointer;
`,A=(0,a.A)("div",(0,c.A)("color"))`
  background-color: ${({color:e})=>e};
  border-radius: 3px;
  width: 34px;
  height: 20px;
`,p=({color:e})=>(0,l.jsxs)(_,{width:"55px",height:"24px",padding:"2px 0",alignItems:"center",justifyContent:"space-between",flexShrink:0,children:[(0,l.jsx)(A,{color:e}),(0,l.jsx)(d.A,{})]});var m=t(595778);const x=[{id:"hue",channel:"hue"}],h=({value:e,onChange:i})=>{const t=(0,s.useCallback)(e=>{i((0,o.E6)(e.toString())||m.I)},[i]),d=e||m.I;return(0,l.jsx)(r.A,{flexDirection:"column",children:(0,l.jsx)(n.A,{value:d,onChange:t,sliders:x,colorSpace:"hex",children:(0,l.jsx)("span",{children:(0,l.jsx)(p,{color:d})})})})}},663216(e,i,t){t.d(i,{Ay:()=>O,Cg:()=>j});var l=t(274934),s=t(418398),n=t(977872),o=t(602086),r=t(487763),d=t(843871),a=t(950804),c=t(586566),_=t(309130),A=t(120197),p=t(100978),m=t(205521),x=t(470070),h=t(857780),u=t(595778),b=t(554598),g=t(785616);const j="screen",E=(0,d.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:e,formName:i=j})=>({[i]:{led_override:e.led_override||h.c_.ON,led_override_color_brightness:e.led_override_color_brightness||u.U,led_override_color:e.led_override_color||u.I}}),validationSchema:a.A.object().shape({led_override:a.A.string(),led_override_color_brightness:a.A.number(),led_override_color:a.A.string()}),handleSubmit:(e,{resetForm:i})=>{i({values:e})}}),O=(0,s.Zz)(E)(({activeItem:e,setFormDirty:i,values:t,dirty:s,resetForm:d,setFieldValue:a,formName:E=j,disableLedOverrideColor:O,disableLedBrightnessField:f})=>{const C=(0,n.wA)(),v=(0,c.lp)(e);(0,o.useEffect)(()=>{i(E,s)},[i,s,E]),(0,o.useEffect)(()=>(C((0,m.uo)({[E]:()=>{const e=(0,r.A)(t,E);return{...t[E],...e}}})),C((0,m.Oo)({[E]:()=>{d({values:t})}})),C((0,m.rW)({[E]:d})),()=>{C((0,m.uo)({[E]:null})),C((0,m.Oo)({[E]:null})),C((0,m.rW)({[E]:null}))}),[C,E,d,t]);const I=(0,o.useCallback)(e=>{a(`${E}.led_override_color`,e)},[a,E]);return(0,l.jsxs)(p.A,{alignItems:"center",marginBottom:_.Ln,gap:_.Ln,children:[(0,l.jsx)(p.A,{children:(0,l.jsx)(A.A,{name:"led_override",type:"realCheckbox",checked:t[E].led_override===h.c_.ON,onChange:({target:{checked:e}})=>{a(`${E}.led_override`,e?h.c_.ON:h.c_.OFF)},children:(0,l.jsx)(x.sA,{id:"COMMON_LED"})})}),v&&!O?(0,l.jsx)(g.A,{value:t[E].led_override_color||u.I,onChange:I}):null,!f&&v?(0,l.jsx)(b.A,{value:t[E].led_override_color_brightness??u.U,onChange:e=>{a(`${E}.led_override_color_brightness`,e)}}):null]})})},115262(e,i,t){t.d(i,{A:()=>m});var l=t(274934),s=t(602086),n=t(977872),o=t(599110),r=t(969819),d=t(146215),a=t(470070),c=t(347625),_=t(423564),A=t(197571),p=t(754924);const m=({mac:e,mgmtNetworkId:i,onSubmit:t,isDisabled:m,renderInnerButton:x})=>{const h=((e,i)=>{const t=(0,n.d4)(p.Kh),l=(0,n.d4)(A.Tn),o=t.get(e),d=(0,r.ki)(o,i),{remotePort:a}=o?(0,r.uj)(o,t):{remotePort:void 0},m=a?.port_idx,x=o?.uplink?.uplink_mac??o?.last_uplink?.uplink_mac,h=x?t.get(x):void 0,u=(0,c.Q)(h??{mac:x}),b=l.find(e=>e._id===i),g=b?(0,_.gm)(b):i||"";return(0,s.useMemo)(()=>{if(d.hasConflict&&null!=m)return{networkName:g,switchName:u,port:m}},[d.hasConflict,m,g,u])})(e,i),u=(0,l.jsx)(o.A,{name:"submit",variant:"primary",type:"submit",onClick:t,disabled:m,children:(0,l.jsx)(a.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})});return h?(0,l.jsx)(d.A,{title:(0,l.jsx)(a.sA,{id:"COMMON_NETWORK_OVERRIDE_CONFIRM_TITLE"}),message:(0,l.jsx)(a.sA,{id:"COMMON_NETWORK_OVERRIDE_CONFIRM_DEVICE",values:{networkName:h.networkName,switchName:h.switchName,port:h.port}}),onConfirm:t,confirmButtonLabel:"COMMON_ACTION_PROCEED",trigger:x?x(()=>{},m):(0,l.jsx)(o.A,{name:"submit",variant:"primary",type:"button",disabled:m,children:(0,l.jsx)(a.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})})}):(0,l.jsx)(l.Fragment,{children:x?x(t,m):u})}},336128(e,i,t){t.d(i,{A:()=>A});var l=t(274934),s=t(602086),n=t(938984),o=t(833466),r=t(309130),d=t(589650),a=t(120197),c=t(100978),_=t(470070);const A=(0,s.memo)(()=>(0,l.jsxs)(c.A,{flexDirection:"column",children:[(0,l.jsx)(n.A,{color:"text-3",size:"small",children:(0,l.jsx)(_.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,l.jsxs)(c.A,{height:o.b,alignItems:"center",gap:r.Ln,children:[(0,l.jsx)(a.A,{name:"config_network.type",type:"radio",value:d.NL.DHCP,children:(0,l.jsx)(_.sA,{id:"COMMON_DHCP"})}),(0,l.jsx)(a.A,{name:"config_network.type",type:"radio",value:d.NL.STATIC,children:(0,l.jsx)(_.sA,{id:"COMMON_STATIC"})})]})]}))},396223(e,i,t){t.d(i,{A:()=>de,x:()=>Q});var l=t(274934),s=t(418398),n=t(977872),o=t(602086),r=t(843871),d=t(125799),a=t(938984),c=t(599110),_=t(853777),A=t(247816),p=t(669439),m=t(590979),x=t(318087),h=t(244081),u=t(950804),b=t(42396),g=t(586566),j=t(449339),E=t(309130),O=t(277660),f=t(98870),C=t(144312),v=t(859513),I=t(787481),S=t(120197),N=t(793442),T=t(100978),P=t(612389),R=t(205521),w=t(470070),k=t(589170),L=t(448108),M=t(291935),D=t(598990),y=t(962586),U=t(463391),V=t(197571),B=t(956978),G=t(857780),F=t(754924),z=t(558134),W=t(171623),H=t(795206),$=t(969288),Y=t(726831),K=t(89469),X=t(183743),Z=t(419685),J=t(291508);const Q="advanced",q=(0,A.A)(a.A)`
  flex: 1;
  margin-right: 12px;
`,ee=(0,A.A)("div",(0,J.A)("marginBottom","marginTop"))`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
  margin-top: ${({marginTop:e})=>e||0}px;
`,ie=(0,A.A)(_.A)`
  margin-bottom: 2px;
`,te=(0,A.A)(d.A,(0,J.A)("disabled"))`
  top: 0.5px;
  ${({disabled:e})=>e&&"opacity: 0.4; pointer-events: none;"}
`,le=(0,A.A)("div")`
  margin-right: 6px;
`,se=(0,A.A)("div")`
  > div {
    margin-top: 4px;
    > span {
      line-height: 20px;
    }
  }
`,ne=({showStackingWarning:e,children:i})=>(0,l.jsx)(p.A,{description:e?(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_DISABLED_WARNING_STACKING"}):void 0,children:(0,l.jsx)("span",{children:i})}),oe=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({switchDeviceData:e,defaultRadiusProfile:i,customRadiusProfiles:t,globalSwitchSettings:l,isGlobalSwitchSettingsEnabled:s})=>{const n=((0,B.Tbi)(e)||(0,B.moU)(e)&&(0,B.rm3)(e))&&s,{jumboframe_enabled:o=!1,flowctrl_enabled:r=!1,stp_version:d=L.uI.RSTP,stp_priority:a,dot1x_portctrl_enabled:c=!1,radiusprofile_id:_=i._id||"",dot1x_fallback_networkconf_id:A="",snmp_location:p="",snmp_contact:m="",lowpfmode_override:x=e.lowpfmode,outdoor_mode_override:h=G.Gi.DEFAULT,power_source_ctrl:u=W.A.AUTO,power_source_ctrl_enabled:b=!1}=e,g=()=>n?l.radiusprofile_id===i._id:_===i._id,j=(0,z.L3)(a);return{jumboframe_enabled:n?l.jumboframe_enabled:o,flowctrl_enabled:n?l.flowctrl_enabled:r,stp_version:n?l.stp_version:d,stp_priority:j,dot1x_localProfile:g(),dot1x_portctrl_enabled:n?l.dot1x_portctrl_enabled:c,radiusprofile_id:g()?t.length?t[0]._id:void 0:_,dot1x_fallback_networkconf_enabled:Boolean(n?l.dot1x_fallback_networkconf_id:A),dot1x_fallback_networkconf_id:n?l.dot1x_fallback_networkconf_id??"":A,snmp_location:p,snmp_contact:m,snmpEnabled:Boolean(p||m),outdoor_mode_override:h,lowpfmode_override:x,power_source_ctrl:u,power_source_ctrl_enabled:b}},validationSchema:({defaultRadiusProfile:e})=>u.A.object().shape({jumboframe_enabled:u.A.boolean(),flowctrl_enabled:u.A.boolean(),stp_version:u.A.string(),stp_priority:u.A.string(),dot1x_portctrl_enabled:u.A.boolean(),...X.U,lowpfmode_override:u.A.boolean(),dot1x_localProfile:u.A.boolean(),radiusprofile_id:u.A.string().when(["dot1x_portctrl_enabled","dot1x_localProfile"],{is:(e,i)=>e&&i,then:u.A.string().test({name:"isDefaultRadiusProfileEnabled",test:i=>i!==e._id||e.enabled,message:(0,l.jsx)(w.sA,{id:"COMMON_VALIDATION_VALID_DEFAULT_RADIUS_PROFILE"})})}).when(["dot1x_portctrl_enabled","dot1x_localProfile"],{is:(e,i)=>e&&!i,then:u.A.string().test({name:"isFallbackVlanValid",test:e=>e&&""!==e,message:(0,l.jsx)(w.sA,{id:"COMMON_VALIDATION_SELECT_A_NETWORK"})})}),radiusProfiles:u.A.array().of(u.A.object()),radiusSettings:u.A.object(),dot1x_fallback_networkconf_enabled:u.A.boolean(),dot1x_fallback_networkconf_id:u.A.string().when(["dot1x_fallback_networkconf_enabled"],{is:e=>e,then:u.A.string().required((0,l.jsx)(w.sA,{id:"COMMON_VALIDATION_SELECT_A_NETWORK"}))}),outdoor_mode_override:u.A.string(),power_source_ctrl:u.A.string(),power_source_ctrl_enabled:u.A.boolean()}),handleSubmit:()=>null}),re=z.Ay.map(e=>({label:e,value:e})),de=(0,s.Zz)((0,n.Ng)((e,{activeItem:i})=>({nativeNetworks:(0,V.Tn)(e),switchDeviceData:(0,F.tG)(i.mac)(e),defaultRadiusProfile:(0,y.selectDefaultRadiusProfile)(e),customRadiusProfiles:(0,y.selectCustomRadiusProfiles)(e),globalSwitchSettings:(0,M.zu)(e)}),{updateDevice:H.c8,fetchRadiusProfiles:U.fetchRadiusProfiles,fetchSettings:D.Uc}),oe,(0,b.A)(({fetchRadiusProfiles:e,fetchSettings:i})=>Promise.all([e(void 0,{crudCacheStrategy:{type:h.e.CACHE}}),i(void 0,{crudCacheStrategy:{type:h.e.CACHE}})])))(({activeItem:e,values:i,errors:t,resetForm:s,dirty:r,setValues:d,setFormDirty:A,setFormInvalid:p,nativeNetworks:h=[],initialValues:u,isValid:b,hideFlowControl:M,globalSwitchSettings:D,isGlobalSwitchSettingsEnabled:U,setGlobalSwitchSettingsEnabled:V,formikSubmitCount:G})=>{(0,w.tz)();const F=(0,n.wA)(),z=((0,B.Tbi)(e)||(0,B.moU)(e)&&(0,B.rm3)(e)||(0,B.QQG)(e))&&U,H=(0,g.kL)(e.switch_caps?.feature_caps),J=(0,g.R8)(e.switch_caps?.feature_caps),oe=(0,B.KKO)(e.model,"outdoorModeSupport"),de=(0,g.Pw)(e),ae=(0,g.CB)(e),[ce,_e]=(0,o.useState)(null),Ae=(0,n.d4)(y.selectCustomRadiusProfileOptions),pe=(0,n.d4)(y.selectDefaultRadiusProfile),me=(0,o.useCallback)(()=>{F((0,R.XP)({type:j.H.NETWORK,id:$.R6}))},[F]);(0,o.useEffect)(()=>{A(Q,r),p(Q,!b)},[p,A,r,b]),(0,o.useEffect)(()=>(F((0,R.uo)({[Q]:()=>({snmp_contact:i.snmpEnabled?i.snmp_contact:"",snmp_location:i.snmpEnabled?i.snmp_location:"",...z?{...H&&D.stp_version!==L.uI.DISABLED&&{stp_priority:i.stp_priority}}:{...!M&&{jumboframe_enabled:i.jumboframe_enabled,flowctrl_enabled:i.flowctrl_enabled},...H&&{stp_version:i.stp_version,stp_priority:i.stp_priority},...J&&{dot1x_localProfile:i.dot1x_localProfile,dot1x_portctrl_enabled:i.dot1x_portctrl_enabled},...i.dot1x_portctrl_enabled&&J&&{radiusprofile_id:i.dot1x_localProfile?pe._id:i.radiusprofile_id,dot1x_fallback_networkconf_enabled:""!==i.dot1x_fallback_networkconf_id,dot1x_fallback_networkconf_id:i.dot1x_fallback_networkconf_id}},...oe&&{outdoor_mode_override:i.outdoor_mode_override},...de&&{lowpfmode_override:i.lowpfmode_override},...ae&&{power_source_ctrl:i.power_source_ctrl,power_source_ctrl_enabled:i.power_source_ctrl!==W.A.AUTO}})})),F((0,R.Oo)({[Q]:()=>null})),F((0,R.rW)({[Q]:s})),()=>{F((0,R.uo)({[Q]:null})),F((0,R.Oo)({[Q]:null})),F((0,R.rW)({[Q]:null}))}),[e._id,s,i,J,H,M,oe,z,de,F,D.stp_version,ae]);const xe=(0,o.useMemo)(()=>h.map(e=>({value:e._id,label:e.name})),[h]),he=46===e.total_max_power,ue=(0,g.Tn)(e),be=e.mclag_group_id&&!U;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Z.A.Checkbox,{isGlobalSwitchSettingsEnabled:U,setGlobalSwitchSettingsEnabled:V,onChange:e=>{if(e){const e=(0,x.LE)(u,i),t=(0,x.LE)(i,u),l=Object.keys(t).reduce((e,i)=>(D[i]&&(e[i]=D[i]),e),{});d({...i,...l}),_e(e)}else d({...i,...ce}),_e(null)}}),be?(0,l.jsx)(P.A,{marginBottom:E.Ln,icon:(0,l.jsx)(_.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_MCLAG_SYNC_WARNING"})}):null,(0,l.jsxs)(T.A,{width:"100%",flexDirection:"column",flex:"1 1 85%",children:[(0,l.jsxs)(T.A,{flexDirection:"column",children:[M?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.A,{show:z,children:(0,l.jsxs)(T.A,{flexDirection:"row",marginBottom:E.Ln,children:[(0,l.jsx)(S.A,{name:"jumboframe_enabled",type:"realCheckbox",checked:z?D.jumboframe_enabled:i.jumboframe_enabled,disabled:z,children:(0,l.jsxs)(T.A,{justifyContent:"space-between",alignItems:"center",marginRight:E.Ln,children:[(0,l.jsx)(q,{size:"medium",color:z?"disabled":void 0,children:(0,l.jsx)(w.sA,{id:"COMMON_JUMBO_FRAMES"})}),(0,l.jsx)(te,{portal:!0,tooltipClassName:"tooltip-position-fixer",width:200,disabled:z,description:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_JUMBO_FRAMES_D"}),children:(0,l.jsx)(ie,{isActive:!0,size:"original"})})]})}),(0,l.jsx)(ne,{showStackingWarning:!z&&ue,children:(0,l.jsx)(S.A,{name:"flowctrl_enabled",type:"realCheckbox",checked:!ue&&(z?D.flowctrl_enabled:i.flowctrl_enabled),disabled:z||ue,children:(0,l.jsxs)(T.A,{justifyContent:"space-between",alignItems:"center",children:[(0,l.jsx)(q,{size:"medium",color:z||ue?"disabled":void 0,children:(0,l.jsx)(w.sA,{id:"COMMON_FLOW_CONTROL"})}),(0,l.jsx)(te,{portal:!0,tooltipClassName:"tooltip-position-fixer",width:200,disabled:z||ue,description:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_FLOW_CONTROL_D"}),children:(0,l.jsx)(ie,{isActive:!0,size:"original"})})]})})})]})}),(0,B.CIk)(e)&&(z?D.flowctrl_enabled:i.flowctrl_enabled)?(0,l.jsx)(P.A,{marginBottom:J?E.Ln:0,icon:(0,l.jsx)(_.A,{isActive:!0,size:"original",variant:"fill"}),description:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_FLOW_CONTROL_INFO",values:{link:(0,l.jsx)(N.A,{href:Y.A.flowControl,id:"COMMON_LEARN_MORE",noWrap:!0})}})}):null]}),(0,l.jsx)(C.A,{show:z,children:J?(0,l.jsxs)(T.A,{gap:E.kc,flexDirection:"column",marginBottom:E.Ln,children:[(0,l.jsx)(S.A,{label:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X",name:"dot1x_portctrl_enabled",type:"realCheckbox",checked:z?D.dot1x_portctrl_enabled:i.dot1x_portctrl_enabled,disabled:z,children:(0,l.jsx)(T.A,{justifyContent:"space-between",alignItems:"center",children:(0,l.jsx)(q,{size:"medium",color:z?"disabled":void 0,children:(0,l.jsxs)(T.A,{alignItems:"center",children:[(0,l.jsx)(le,{children:(0,l.jsx)(w.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X"})}),(0,l.jsx)(te,{width:200,description:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_8021X_CONTROL_D"}),disabled:z,children:(0,l.jsx)(ie,{size:"original",isActive:!0,disabled:z})})]})})})}),i.dot1x_portctrl_enabled?(0,l.jsxs)(T.A,{gap:E.kc,flexDirection:"column",children:[(0,l.jsxs)(T.A,{gap:E.YC,flexDirection:"column",children:[(0,l.jsxs)(T.A,{gap:E.YC,flexDirection:"row",alignItems:"center",children:[(0,l.jsx)(O.A,{style:{opacity:z?k.pH:1},label:(0,l.jsx)(w.sA,{id:"COMMON_CREDENTIAL_SOURCE"}),tooltipProps:{disableHover:z}}),(0,l.jsx)(te,{width:200,description:(0,l.jsx)(w.sA,{id:"COMMON_CREDENTIAL_SOURCE_DESCRIPTION"}),disabled:z,children:(0,l.jsx)(ie,{size:"original",isActive:!0,disabled:z})})]}),(0,l.jsxs)(I.A,{children:[(0,l.jsx)(S.A,{type:"radio",name:"dot1x_localProfile",value:!0,disabled:z,children:(0,l.jsx)(w.sA,{id:"COMMON_LOCAL"})}),(0,l.jsx)(S.A,{type:"radio",name:"dot1x_localProfile",value:!1,disabled:z,children:(0,l.jsx)(w.sA,{id:"COMMON_EXTERNAL_RADIUS_SERVER"})})]})]}),(0,l.jsx)(v.A,{visible:!!t.radiusprofile_id&&G>0,children:t.radiusprofile_id}),i.dot1x_localProfile?null:(0,l.jsx)(l.Fragment,{children:0===Ae.length?(0,l.jsx)(T.A,{alignItems:"center",children:(0,l.jsx)(c.A,{type:"button",size:"medium",variant:"inline",onClick:()=>{F((0,R.XP)({type:j.H.CUSTOM_RADIUS_PROFILE,id:$.R6}))},...m.A.addDataTestId(m.A.TestId.SIDE_PANEL_TRIGGER),children:(0,l.jsx)(w.sA,{id:"COMMON_CONNECT_RADIUS_SERVER"})})}):(0,l.jsxs)(T.A,{flexDirection:"row",gap:E.kc,children:[(0,l.jsxs)(T.A,{flex:1,children:[(0,l.jsx)(S.A,{label:"COMMON_RADIUS_PROFILE",name:"radiusprofile_id",type:"dropdown",variant:"secondary",full:!0,options:Ae,invalid:!!t.radiusprofile_id,translateLabel:!0,value:z?D.radiusprofile_id:i.radiusprofile_id,disabled:z}),t.radiusprofile_id?(0,l.jsx)(se,{children:(0,l.jsx)(v.A,{align:"left",visible:!0,children:t.radiusprofile_id})}):null]}),(0,l.jsx)(c.A,{disabled:z,style:{marginTop:24},size:"small",type:"button",variant:"inline",onClick:()=>{F((0,R.XP)({type:j.H.CUSTOM_RADIUS_PROFILE,id:$.R6}))},...m.A.addDataTestId(m.A.TestId.SIDE_PANEL_TRIGGER),children:(0,l.jsx)(a.A,{color:"inherit",size:"medium",children:(0,l.jsx)(w.sA,{id:"COMMON_NEW"})})})]})}),(0,l.jsxs)(K.A,{children:[(0,l.jsx)(S.A,{name:"dot1x_fallback_networkconf_enabled",type:"realCheckbox",disabled:z,onChange:e=>{const i=e.target.checked;d(e=>({...e,dot1x_fallback_networkconf_id:i?e.dot1x_fallback_networkconf_id:"",dot1x_fallback_networkconf_enabled:i}))},tooltipMessage:(0,l.jsx)(w.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS_FALLBACK_VLAN_TOOLTIP"}),children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_LABEL_FALLBACK_VLAN"})}),i.dot1x_fallback_networkconf_enabled?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(T.A,{gap:E.kc,alignItems:"center",children:[(0,l.jsx)(S.A,{name:"dot1x_fallback_networkconf_id",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:xe,translateLabel:!0,value:z?D.dot1x_fallback_networkconf_id:i.dot1x_fallback_networkconf_id,disabled:z}),(0,l.jsx)(c.A,{disabled:z,size:"small",type:"button",variant:"inline",onClick:me,children:(0,l.jsx)(a.A,{color:"inherit",size:"medium",children:(0,l.jsx)(w.sA,{id:"COMMON_NEW"})})})]}),(0,l.jsx)(v.A,{visible:!!t.dot1x_fallback_networkconf_id&&G>0,children:t.dot1x_fallback_networkconf_id})]}):null]})]}):null]}):null}),H?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.A,{show:z,children:(0,l.jsxs)(ee,{marginBottom:E.Ln,children:[(0,l.jsxs)(T.A,{alignItems:"center",marginBottom:E.kc,width:"fit-content",children:[(0,l.jsx)(q,{size:"medium",color:z?"disabled":void 0,children:(0,l.jsx)(w.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_STP"})}),(0,l.jsx)(te,{portal:!0,tooltipClassName:"tooltip-position-fixer",disabled:z,description:f.c,children:(0,l.jsx)(ie,{isActive:!0,size:"original"})})]}),(0,l.jsxs)(T.A,{alignItems:"center",gap:E.Ln,children:[(0,l.jsx)(S.A,{name:"stp_version",type:"radio",value:L.uI.STP,checked:L.uI.STP===(z?D:i).stp_version,disabled:z,children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_STP"})}),(0,l.jsx)(S.A,{name:"stp_version",type:"radio",value:L.uI.RSTP,checked:L.uI.RSTP===(z?D:i).stp_version,disabled:z,children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_RSTP"})}),(0,l.jsx)(S.A,{name:"stp_version",type:"radio",value:L.uI.DISABLED,checked:L.uI.DISABLED===(z?D:i).stp_version,disabled:z,children:(0,l.jsx)(w.sA,{id:"COMMON_DISABLED"})})]})]})}),(z?D:i).stp_version!==L.uI.DISABLED?(0,l.jsx)(T.A,{marginTop:E.Ln,flexDirection:"column",children:(0,l.jsx)(S.A,{label:"COMMON_PRIORITY",name:"stp_priority",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:re,translateLabel:!0,value:i.stp_priority})}):null]}):null]}),(0,g.A6)(e)?(0,l.jsx)(T.A,{marginTop:E.Ln,flexDirection:"column",children:(0,l.jsx)(X.A,{})}):null,ae&&!he?(0,l.jsxs)(T.A,{marginTop:E.Ln,flexDirection:"column",children:[(0,l.jsx)(a.A,{color:"text-3",size:"small",children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_LABEL_POWER_SOURCE"})}),(0,l.jsxs)(T.A,{alignItems:"center",whiteSpace:"nowrap",gap:E.Ln,children:[(0,l.jsx)(S.A,{type:"radio",name:"power_source_ctrl",value:W.A.AUTO,children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_AUTO"})}),(0,l.jsx)(S.A,{type:"radio",name:"power_source_ctrl",value:W.A.POE,children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_8023AF"})}),(0,l.jsx)(S.A,{type:"radio",name:"power_source_ctrl",value:W.A.POE_PLUS_PLUS,children:(0,l.jsx)(w.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_INJECTOR"})})]})]}):null]})]})})},451700(e,i,t){t.d(i,{W:()=>k,A:()=>y});var l=t(274934),s=t(418398),n=t(977872),o=t(602086),r=t(843871),d=t(396489),a=t.n(d),c=t(925845),_=t(938984),A=t(247816),p=t(950804),m=t(309130),x=t(304151),h=t(505342),u=t(814557),b=t(115354),g=t(291508),j=t(100978),E=t(470070);const O=[0,90,180,270],f=(0,A.A)(j.A,(0,g.A)("isActive"))`
  border: 1px solid
    ${({theme:{themeName:e},isActive:i})=>i?u.Ay[`desktop-color-ublue-06-${e}`]:u.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${u.Ay["desktop-radius-base"]};
  cursor: pointer;
`,C=(0,A.A)(b.A,(0,g.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,v=({degree:e,isActive:i,onClick:t})=>(0,l.jsxs)(f,{padding:`${m.YC} ${m.kc}`,flex:1,gap:m.YC,alignItems:"center",isActive:i,onClick:t,children:[(0,l.jsx)(C,{isActive:i,degree:e}),(0,l.jsx)(_.A,{color:"text-2",children:e?`${e}°`:(0,l.jsx)(E.sA,{id:"COMMON_NONE"})})]}),I=()=>{const{values:{lcm_orientation_override:e},setFieldValue:i}=(0,r.j7)();return(0,l.jsxs)("div",{children:[(0,l.jsx)(_.A,{color:"text-3",size:"small",children:(0,l.jsx)(E.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})}),(0,l.jsx)(j.A,{gap:m.kc,marginTop:m.YC,marginBottom:m.Ln,children:O.map(t=>(0,l.jsx)(v,{degree:t,isActive:t===e,onClick:()=>{i("lcm_orientation_override",t)}},t))})]})};var S=t(120197),N=t(205521),T=t(291935),P=t(598990),R=t(897166),w=t(897015);const k="lcmScreen",L=(0,A.A)(j.A)`
  &:not(:last-child) {
    margin-bottom: ${m.S2};
  }
`,M=(0,r.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:i,activeItem:{lcm_brightness:t=w.VG,lcm_brightness_override:l=!1,lcm_night_mode_enabled:s=!1,lcm_night_mode_begins:n=w.z7,lcm_night_mode_ends:o=w.Vm,lcm_orientation_override:r}})=>({lcm:e,lcm_brightness:t,lcm_brightness_override:l,lcm_night_mode_enabled:s,lcm_night_mode_begins:n,lcm_night_mode_ends:o,..."lcm_orientation_override"in i?{lcm_orientation_override:r}:{}}),validationSchema:p.A.object().shape({lcm:p.A.object().shape({sync:p.A.boolean()}),lcm_brightness_override:p.A.boolean(),lcm_brightness:p.A.number().label("COMMON_BRIGHTNESS").min(1).max(100).required(),lcm_night_mode_enabled:p.A.boolean(),lcm_night_mode_begins:p.A.string(),lcm_night_mode_ends:p.A.string(),lcm_orientation_override:p.A.number()}),handleSubmit:()=>null}),D=e=>(0,l.jsx)(_.A,{size:"medium",children:e}),y=(0,s.Zz)((0,n.Ng)(e=>({lcmSettings:(0,T.ml)(e)}),{}),M)(({values:e,setFieldValue:i,resetForm:t,setFormDirty:s,setFormInvalid:r,dirty:d,isValid:A,initialValues:p,activeItem:u,hideRackMultiScreenSync:b=!1})=>{const g=(0,n.wA)(),O=(0,n.d4)(R.EL);return(0,o.useEffect)(()=>{s(k,d),r(k,!A)},[s,r,A,d]),(0,o.useEffect)(()=>(g((0,N.uo)({[k]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==w.VG,lcm_night_mode_begins:e.lcm_night_mode_begins,lcm_night_mode_ends:e.lcm_night_mode_ends,..."lcm_orientation_override"in e?{lcm_orientation_override:e.lcm_orientation_override}:{}})})),g((0,N.Oo)({[k]:()=>{a()(p.lcm,e.lcm)||g((0,P.vd)(e.lcm)),t({values:e})}})),g((0,N.rW)({[k]:t})),()=>{g((0,N.uo)({[k]:null})),g((0,N.Oo)({[k]:null})),g((0,N.rW)({[k]:null}))}),[g,t,e,p.lcm]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L,{justifyContent:"space-between",children:[(0,l.jsx)(_.A,{color:"text-1",size:"medium",children:(0,l.jsx)(E.sA,{id:"COMMON_BRIGHTNESS"})}),(0,l.jsx)(c.A,{width:"50%",value:e.lcm_brightness||w.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:D,onChange:e=>{i("lcm_brightness",+e.target.value)},disabled:O})]}),"lcm_orientation_override"in u?(0,l.jsx)(I,{}):null,(0,l.jsx)(h.A,{}),b?null:(0,l.jsx)(L,{justifyContent:"space-between",alignItems:"center",children:(0,l.jsxs)(j.A,{alignItems:"center",gap:m.kc,children:[(0,l.jsxs)(j.A,{alignItems:"center",children:[(0,l.jsx)(S.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),(0,l.jsx)(_.A,{color:"text-1",size:"medium",children:(0,l.jsx)(E.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"})})]}),(0,l.jsx)(x.A,{description:(0,l.jsx)(E.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})})]})})]})})},846294(e,i,t){t.d(i,{A:()=>a});var l=t(274934),s=t(125799),n=t(409844),o=t(184931),r=t(877840);const d=n.AH`
  width: fit-content;
`,a=({reasons:e,reason:i,children:t,isInteractive:n,noWrap:a,position:c,fitContent:_})=>{const A=(0,o.pv)(),p=[i,...e||[]].filter(Boolean)[0]||null,m=!!p;return(0,l.jsx)(r.A,{isDisabled:{fields:m,labels:m,tooltipIcons:m,tooltipPopovers:!A.fields&&m},children:(0,l.jsx)(s.A,{description:A.fields?null:p,portal:!0,isInteractive:n,noWrap:a,position:c,className:_?d:void 0,children:t})})}},42396(e,i,t){t.d(i,{A:()=>n});var l=t(274934),s=t(602086);const n=(e,i=()=>null,t=null,n=!1)=>o=>class extends s.Component{isCanceled=!1;state={loaded:!1};UNSAFE_componentWillMount(){t&&performance.mark(`ufsdn.${t}:start`)}componentDidMount(){Promise.resolve(e(this.props)).then(()=>{this.isCanceled||(this.setState({loaded:!0}),t&&performance.measure(`ufsdn.${t}-rendered`,`ufsdn.${t}:start`))})}componentWillUnmount(){this.isCanceled=!0}render(){return n?(0,l.jsx)(o,{...this.props,isLoaded:this.state.loaded}):this.state.loaded?(0,l.jsx)(o,{...this.props}):(0,l.jsx)(i,{})}}}}]);