"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[12935],{171623(e,i,o){var t;o.d(i,{A:()=>r}),function(e){e.AUTO="auto",e.POE="8023af",e.POE_PLUS="8023at",e.POE_PLUS_PLUS="poe-injector",e.ADAPTER="adapter"}(t||(t={}));const r=t},144312(e,i,o){o.d(i,{A:()=>l});var t=o(274934),r=o(125799),s=o(470070);const l=({show:e,children:i,position:o})=>(0,t.jsx)(r.A,{position:o||"topStart",description:e?(0,t.jsx)(s.sA,{id:"DEVICE_DISABLE_GLOBAL_SWITCH_SETTINGS"}):void 0,children:(0,t.jsx)("span",{children:i})})},612935(e,i,o){o.d(i,{A:()=>re,q:()=>H});var t=o(274934),r=o(418398),s=o(977872),l=o(602086),n=o(843871),d=o(125799),a=o(938984),_=o(599110),c=o(380768),p=o(853777),A=o(247816),m=o(590979),u=o(347625),E=o(244081),x=o(950804),b=o(42396),O=o(586566),h=o(449339),f=o(309130),j=o(144312),v=o(859513),R=o(120197),C=o(100978),I=o(205521),P=o(869332),S=o(771927),g=o(470070),w=o(448108),T=o(291935),D=o(598990),L=o(962586),N=o(463391),M=o(197571),U=o(956978),y=o(853109),k=o(857780),B=o(754924),F=o(558134),V=o(171623),W=o(795206),z=o(969288),G=o(183743),$=o(291508);const H="services",K=(0,A.A)(a.A)`
  align-items: center;
  justify-content: center;
  margin-bottom: ${f.Ln};
`,X=(0,A.A)(a.A)`
  flex: 1;
  margin-right: ${f.xO};
`,J=(0,A.A)("div",(0,$.A)("marginBottom","marginTop"))`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
  margin-top: ${({marginTop:e})=>e||0}px;
`,Y=(0,A.A)(C.A)`
  margin-bottom: ${e=>e.marginBottom||0}px;
  justify-content: space-between;
`,Q=(0,A.A)(p.A)`
  margin-bottom: 2px;
`,q=(0,A.A)(d.A,(0,$.A)("disabled"))`
  ${({disabled:e})=>e&&"opacity: 0.4; pointer-events: none;"}
`,Z=(0,A.A)("div")`
  margin-right: 6px;
`,ee=(0,A.A)("div")`
  > div {
    margin-top: ${f.YC};
    > span {
      line-height: 20px;
    }
  }
`,ie=(0,n.bk)({enableReinitialize:!0,mapPropsToValues:({switchDeviceData:{jumboframe_enabled:e=!1,flowctrl_enabled:i=!1,stp_version:o=w.uI.RSTP,stp_priority:t,dot1x_portctrl_enabled:r=!1,radiusprofile_id:s,dot1x_fallback_networkconf_id:l="",snmp_location:n="",snmp_contact:d="",lowpfmode_override:a,lowpfmode:_,outdoor_mode_override:c=k.Gi.DEFAULT,power_source_ctrl:p=V.A.AUTO,power_source_ctrl_enabled:A=!1},defaultRadiusProfile:m})=>({jumboframe_enabled:e,flowctrl_enabled:i,stp_version:o,stp_priority:(0,F.L3)(t),dot1x_portctrl_enabled:r,radiusprofile_id:s||m?._id||"",dot1x_fallback_networkconf_id:l,snmp_location:n,snmp_contact:d,snmpEnabled:Boolean(n||d),outdoor_mode_override:c,lowpfmode_override:a||_,power_source_ctrl:p,power_source_ctrl_enabled:A}),validationSchema:({defaultRadiusProfile:e})=>x.A.object().shape({flowctrl_enabled:x.A.boolean(),stp_version:x.A.string(),stp_priority:x.A.string(),dot1x_portctrl_enabled:x.A.boolean(),lowpfmode_override:x.A.boolean(),...G.U,radiusprofile_id:x.A.string().when("dot1x_portctrl_enabled",{is:!0,then:x.A.string().test({name:"isDefaultRadiusProfileEnabled",test:i=>i!==e._id||e.enabled,message:(0,t.jsx)(g.sA,{id:"COMMON_VALIDATION_VALID_DEFAULT_RADIUS_PROFILE"})})}),radiusProfiles:x.A.array().of(x.A.object()),radiusSettings:x.A.object(),dot1x_fallback_networkconf_id:x.A.string(),outdoor_mode_override:x.A.string(),power_source_ctrl:x.A.string(),power_source_ctrl_enabled:x.A.boolean()}),handleSubmit:()=>null}),oe=[{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_STP",value:"stp"},{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_RSTP",value:"rstp"},{label:"COMMON_DISABLED",value:"disabled"}],te=F.Ay.map(e=>({label:e,value:e})),re=(0,r.Zz)((0,s.Ng)((e,{activeItem:i})=>({nativeNetworks:(0,M.Tn)(e),switchDeviceData:(0,B.tG)(i.mac)(e),radiusOptions:(0,L.selectAllRadiusOptions)(e),radiusProfiles:(0,L.selectAllRadiusProfiles)(e),radiusSettings:(0,T.QC)(e),globalSwitchSettings:(0,T.zu)(e)}),{updateDevice:W.c8,fetchRadiusProfiles:N.fetchRadiusProfiles,fetchSettings:D.Uc}),ie,(0,b.A)(({fetchRadiusProfiles:e,fetchSettings:i})=>Promise.all([e(void 0,{crudCacheStrategy:{type:E.e.CACHE}}),i(void 0,{crudCacheStrategy:{type:E.e.CACHE}})])))(({activeItem:e,values:i,errors:o,resetForm:r,dirty:n,setFormDirty:A,setFormInvalid:E,setFieldValue:x,nativeNetworks:b=[],isValid:T,hideFlowControl:D,formName:N=H,globalSwitchSettings:M,isGlobalSwitchSettingsEnabled:F})=>{const{formatMessage:W}=(0,g.tz)(),$=(0,s.wA)(),ie=((0,U.Tbi)(e)||(0,U.moU)(e)&&(0,U.rm3)(e))&&F,re=(0,O.kL)(e.switch_caps?.feature_caps),se=(0,O.R8)(e.switch_caps?.feature_caps),le=(0,U.KKO)(e.model,"outdoorModeSupport"),ne=(0,U.moU)(e),de=(0,s.d4)(B.ID),ae=(0,O.CB)(e),_e=(0,y.$Y)({device:e,devices:de}),ce=e.lowpfmode,pe=(0,O.gU)(e,_e),Ae=(0,U.J2F)(e),me=(0,s.d4)(L.selectAllRadiusOptions),ue=(0,l.useCallback)(()=>{$((0,I.XP)({type:h.H.NETWORK,id:z.R6}))},[$]);(0,l.useEffect)(()=>{A(N,n),E(N,!T)},[E,A,n,T,N]),(0,l.useEffect)(()=>($((0,I.uo)({[N]:()=>({snmp_contact:i.snmpEnabled?i.snmp_contact:"",snmp_location:i.snmpEnabled?i.snmp_location:"",...ie?{}:{...!D&&{jumboframe_enabled:i.jumboframe_enabled,flowctrl_enabled:i.flowctrl_enabled},...re&&{stp_version:i.stp_version,stp_priority:i.stp_priority},...se&&{dot1x_portctrl_enabled:i.dot1x_portctrl_enabled},...i.dot1x_portctrl_enabled&&se&&{radiusprofile_id:i.radiusprofile_id,dot1x_fallback_networkconf_id:i.dot1x_fallback_networkconf_id}},...le&&{outdoor_mode_override:i.outdoor_mode_override},...ce&&{lowpfmode_override:i.lowpfmode_override},...ae&&{power_source_ctrl:i.power_source_ctrl,power_source_ctrl_enabled:i.power_source_ctrl!==V.A.AUTO}})})),$((0,I.Oo)({[N]:()=>r({values:i})})),$((0,I.rW)({[N]:r})),()=>{$((0,I.uo)({[N]:null})),$((0,I.Oo)({[N]:null})),$((0,I.rW)({[N]:null}))}),[e._id,$,r,i,N,se,re,ne,D,le,ae,ie,ce]);const Ee=(0,l.useMemo)(()=>b.map(e=>({value:e._id,label:e.name})),[b]);return(0,t.jsxs)(C.A,{width:"100%",flexDirection:"column",flex:"1 1 85%",children:[(0,t.jsx)(j.A,{show:ie,children:(0,t.jsxs)(C.A,{flexDirection:"column",children:[D?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y,{marginBottom:16,children:[(0,t.jsx)(X,{size:"medium",color:ie?"disabled":void 0,children:(0,t.jsx)(g.sA,{id:"COMMON_JUMBO_FRAMES"})}),(0,t.jsx)(R.A,{name:"jumboframe_enabled",type:"checkbox",checked:ie?M.jumboframe_enabled:i.jumboframe_enabled,disabled:ie})]}),(0,t.jsxs)(Y,{marginBottom:16,children:[(0,t.jsx)(X,{size:"medium",color:ie?"disabled":void 0,children:(0,t.jsx)(g.sA,{id:"COMMON_FLOW_CONTROL"})}),(0,t.jsx)(R.A,{name:"flowctrl_enabled",type:"checkbox",checked:ie?M.flowctrl_enabled:i.flowctrl_enabled,disabled:ie})]})]}),re?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{marginBottom:16,children:(0,t.jsx)(R.A,{label:"COMMON_DEVICE_CAP_SWITCH_CAP_STP",name:"stp_version",full:!0,type:"dropdown",variant:"secondary",translateOptions:!0,translateLabel:!0,options:oe,value:ie?M.stp_version:i.stp_version,disabled:ie})}),i.stp_version!==w.uI.DISABLED?(0,t.jsx)(J,{marginBottom:16,children:(0,t.jsx)(R.A,{label:"COMMON_PRIORITY",name:"stp_priority",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:te,translateLabel:!0,value:i.stp_priority,disabled:ie})}):null]}):null,se?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y,{marginBottom:16,children:[(0,t.jsx)(X,{size:"medium",color:ie?"disabled":void 0,children:(0,t.jsxs)(C.A,{alignItems:"center",children:[(0,t.jsx)(Z,{children:(0,t.jsx)(g.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X"})}),(0,t.jsx)(q,{width:200,description:(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_8021X_CONTROL_D"}),disabled:ie,children:(0,t.jsx)(Q,{size:"original",isActive:!0,disabled:ie})})]})}),(0,t.jsx)(R.A,{label:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X",name:"dot1x_portctrl_enabled",type:"checkbox",checked:ie?M.dot1x_portctrl_enabled:i.dot1x_portctrl_enabled,disabled:ie})]}),i.dot1x_portctrl_enabled?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(J,{marginBottom:8,children:[(0,t.jsx)(R.A,{label:"COMMON_RADIUS_PROFILE",name:"radiusprofile_id",type:"dropdown",variant:"secondary",full:!0,options:me,invalid:!!o.radiusprofile_id,translateLabel:!0,value:ie?M.radiusprofile_id:i.radiusprofile_id,disabled:ie}),o.radiusprofile_id?(0,t.jsx)(ee,{children:(0,t.jsx)(v.A,{align:"left",visible:!0,children:o.radiusprofile_id})}):null]}),(0,t.jsx)(Y,{marginBottom:16,children:(0,t.jsx)(_.A,{size:"small",type:"button",variant:"inline",onClick:()=>{$((0,I.XP)({type:h.H.CUSTOM_RADIUS_PROFILE,id:z.R6}))},...m.A.addDataTestId(m.A.TestId.SIDE_PANEL_TRIGGER),Icon:c.A,iconProps:{isActive:!0},children:(0,t.jsx)(a.A,{color:"inherit",size:"medium",children:(0,t.jsx)(g.sA,{id:"COMMON_CREATE_NEW_RADIUS_PROFILE"})})})}),(0,t.jsx)(J,{marginBottom:8,children:(0,t.jsx)(R.A,{label:"DEVICE_PROPERTIES_LABEL_FALLBACK_VLAN",name:"dot1x_fallback_networkconf_id",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:[{label:W({id:"COMMON_NONE"}),value:""},...Ee],translateLabel:!0,value:ie?M.dot1x_fallback_networkconf_id:i.dot1x_fallback_networkconf_id,disabled:ie})}),(0,t.jsx)(Y,{marginBottom:16,children:(0,t.jsx)(_.A,{size:"small",type:"button",variant:"inline",onClick:ue,...m.A.addDataTestId(m.A.TestId.SIDE_PANEL_TRIGGER),Icon:c.A,iconProps:{isActive:!0},children:(0,t.jsx)(a.A,{color:"inherit",size:"medium",children:(0,t.jsx)(g.sA,{id:"COMMON_CREATE_NEW_NETWORK"})})})})]}):null]}):null]})}),(0,O.A6)(e)?(0,t.jsx)(G.A,{}):null,ae?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K,{weight:"bold",children:(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_LABEL_POWER_SOURCE"})}),(0,t.jsx)(J,{marginBottom:le?24:0,children:(0,t.jsxs)(C.A,{gap:f.Ln,children:[(0,t.jsx)(R.A,{type:"radio",name:"power_source_ctrl",value:V.A.AUTO,children:(0,t.jsx)(a.A,{children:(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_AUTO"})})}),(0,t.jsx)(R.A,{type:"radio",name:"power_source_ctrl",value:V.A.POE,children:(0,t.jsx)(a.A,{children:(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_8023AF"})})}),(0,t.jsx)(R.A,{type:"radio",name:"power_source_ctrl",value:V.A.POE_PLUS_PLUS,children:(0,t.jsx)(a.A,{children:(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_INJECTOR"})})})]})})]}):null,le?(0,t.jsxs)(C.A,{justifyContent:"space-between",alignItems:"flex-start",children:[(0,t.jsxs)(C.A,{alignItems:"center",children:[(0,t.jsx)(a.A,{size:"medium",children:(0,t.jsx)(Z,{children:(0,t.jsx)(g.sA,{id:"COMMON_OUTDOOR_MODE"})})}),(0,t.jsx)(d.A,{width:200,description:(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_DESCRIPTION"}),children:(0,t.jsx)(p.A,{isActive:!0,size:"original"})})]}),(0,t.jsx)(R.A,{type:"checkbox",name:"outdoor_mode_override",value:i.outdoor_mode_override===k.Gi.ON,afterChange:e=>{Ae&&e?$((0,S.E)({title:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_CONFIRM_TITLE",message:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_CONFIRM_MESSAGE",onConfirm:()=>{$((0,P.AS)()),x("outdoor_mode_override",k.Gi.ON)}})):x("outdoor_mode_override",e?k.Gi.ON:k.Gi.OFF)}})]}):null,ce?(0,t.jsxs)(C.A,{justifyContent:"space-between",alignItems:"flex-start",children:[(0,t.jsxs)(C.A,{alignItems:"center",children:[(0,t.jsx)(a.A,{size:"medium",children:(0,t.jsx)(Z,{children:(0,t.jsx)(g.sA,{id:"COMMON_LOW_PERFORMANCE_MODE"})})}),(0,t.jsx)(d.A,{width:200,description:(0,t.jsx)(g.sA,{id:pe,values:{name:(0,u.Q)(e)}}),children:(0,t.jsx)(p.A,{isActive:!0,size:"original"})})]}),(0,t.jsx)(R.A,{type:"checkbox",name:"lowpfmode_override"})]}):null]})})},42396(e,i,o){o.d(i,{A:()=>s});var t=o(274934),r=o(602086);const s=(e,i=()=>null,o=null,s=!1)=>l=>class extends r.Component{isCanceled=!1;state={loaded:!1};UNSAFE_componentWillMount(){o&&performance.mark(`ufsdn.${o}:start`)}componentDidMount(){Promise.resolve(e(this.props)).then(()=>{this.isCanceled||(this.setState({loaded:!0}),o&&performance.measure(`ufsdn.${o}-rendered`,`ufsdn.${o}:start`))})}componentWillUnmount(){this.isCanceled=!0}render(){return s?(0,t.jsx)(l,{...this.props,isLoaded:this.state.loaded}):this.state.loaded?(0,t.jsx)(l,{...this.props}):(0,t.jsx)(i,{})}}}}]);