"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[98752],{722682(e,t,n){n.d(t,{A:()=>l});var i=n(602086),s=n(716155);const l=(0,n(302405).w)(e=>(0,i.createElement)("svg",(0,s.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4Zm8 8a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-4Z",fill:"currentColor",className:e.twotonedclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4h4v4H4V4ZM3 4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4Zm9 8h4v4h-4v-4Zm-1 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-4Zm1.854-4.854L11.707 6H16v3.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5h-4.793l1.147-1.146a.5.5 0 0 0-.708-.708l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708ZM8.293 15H3.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0V14h4.293l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L8.293 15Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4Zm7 9a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-4Zm1.854-4.854L11.707 6H16v3.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5h-4.793l1.147-1.146a.5.5 0 0 0-.708-.708l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708ZM8.293 15H3.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0V14h4.293l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L8.293 15Z",fill:"currentColor",className:e.fillclassname})))},595778(e,t,n){n.d(t,{I:()=>s,U:()=>l});var i=n(751271);const s=(0,n(419284).Wj)(i.Ay["blue-0"]),l=100},446863(e,t,n){n.d(t,{H5:()=>r,Lq:()=>a,n0:()=>o});var i=n(909924),s=n(573534),l=n(172205);const o=e=>e[l.U.SHARED][s.N.PROPERTY_PANEL]?.[i.Io.TAB_GET_DATA_FUNCTION]||{},a=e=>e[l.U.SHARED][s.N.PROPERTY_PANEL]?.[i.Io.TAB_SUBMIT_FUNCTION]||{},r=e=>e[l.U.SHARED][s.N.PROPERTY_PANEL]?.[i.Io.TAB_RESET_FUNCTION]||{}},144312(e,t,n){n.d(t,{A:()=>o});var i=n(274934),s=n(548941),l=n(470070);const o=({show:e,children:t,position:n})=>(0,i.jsx)(s.A,{position:n||"topStart",description:e?(0,i.jsx)(l.sA,{id:"DEVICE_DISABLE_GLOBAL_SWITCH_SETTINGS"}):void 0,children:(0,i.jsx)("span",{children:t})})},535322(e,t,n){n.d(t,{A:()=>_,I:()=>i});var i,s=n(274934),l=n(505817),o=n(753583),a=n(247816),r=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const u=(0,a.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.Ay[n===r.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${r.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${r.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${l.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,h=(0,a.A)(o.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.Ay[n===r.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${r.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${r.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${l.Ay[`desktop-border-divider-${t}`]};`:""}
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,nested:t,theme:{themeName:n}})=>e||l.Ay[n===r.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${r.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${r.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,_=({type:e,marginBottom:t,margin:n,padding:l,flex:o,width:a,nested:r,...d})=>"items"in d?(0,s.jsx)(h,{marginBottom:t,margin:n,padding:l,flex:o,nested:r,...d}):(0,s.jsx)(u,{nested:r,width:a,marginBottom:t,margin:n,padding:l,flex:o,isButtonList:e===i.BUTTON_LIST,...d,children:d.children})},250266(e,t,n){n.d(t,{A:()=>c});var i=n(274934),s=n(602086),l=n(13790),o=n(409844),a=n(521376),r=n(309130),d=n(470070);const c=({children:e=null,title:t,titleValues:n,message:c,messageValues:m,handleConfirm:u=()=>null,handleClose:h=()=>null,handleCancel:_,isOpen:A,buttonVariant:g="primary",cancelButtonVariant:v="tertiary",cancelButtonMessage:b="COMMON_ACTION_CANCEL",buttonMessage:p="COMMON_ACTION_CONFIRM",buttonDisabled:x=!1,position:O="top",offset:w,showHeaderClose:f=!1,contentClassName:C="",body:S,titleBody:I,className:E,rootClose:N=!1,footerActions:j})=>{const k=(0,s.useCallback)(e=>{A&&(e.stopPropagation(),e.key===a.U.ENTER?u():e.key===a.U.ESCAPE&&h(!1))},[A,u,h]);(0,s.useEffect)(()=>(window.addEventListener("keydown",k,!0),()=>{window.removeEventListener("keydown",k,!0)}),[k]);const T=(0,s.useCallback)(()=>{h(!1),_?.()},[h,_]),y=(0,s.useCallback)(()=>{h(!1),u()},[h,u]),R=(0,s.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:b}),variant:v,onClick:T},{text:(0,i.jsx)(d.sA,{id:p}),disabled:x,variant:g,onClick:y}],[p,g,b,v,T,y,x]),L=(0,s.useCallback)(()=>{h(!1)},[h]),D=o.AH`
    ${t?"":`margin-top: ${r.xO}`}
  `;return(0,i.jsx)(l.A,{title:t?(0,i.jsx)(d.sA,{id:t,values:n}):I||null,...c?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.sA,{id:c,values:m}),S]})}:{body:S},position:O,portal:!0,offset:w,actions:j||R,showHeaderClose:f,contentClassName:o.AH`
        ${D}
        ${C}
      `,onRequestClose:L,isOpen:A,allowOverflow:!0,rootClose:N,className:E,children:e})}},341699(e,t,n){n.d(t,{HV:()=>l,pm:()=>o,vF:()=>s});var i=n(726831);const s=e=>`${i.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,l=e=>`${i.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`,o=()=>`${i.A.fabricsOrchestration}`},637084(e,t,n){n.d(t,{A:()=>p});var i=n(274934),s=n(602086),l=n(843871),o=n(977872),a=n(418398),r=n(396489),d=n.n(r),c=n(205521),m=n(232410),u=n(933671),h=n(260288),_=n(619619),A=n(702147),g=n(507792),v=n(621309);const b=(0,l.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:t})=>({powerSupervisor:(0,_.f)(e,(0,g.lD)(t,e))}),handleSubmit:(e,{resetForm:t})=>t({values:e}),validationSchema:A.Ay}),p=(0,a.Zz)((0,o.Ng)((e,{device:{mac:t}})=>({powerSupervisor:(0,m.x0)(t)(e)})))(b(({powerSupervisor:e,device:t,setFormDirty:n,setFormInvalid:l,validateForm:a,values:r,resetForm:m,initialValues:_,dirty:A,isValid:g,formName:b=h.r8})=>{const p=(0,o.wA)();return(0,s.useEffect)(()=>(p((0,c.uo)({[b]:()=>({})})),p((0,c.Oo)({[b]:()=>{d()(r,_)||a().then(t=>{Object.keys(t).length||p((0,v.A)(e?.id,r.powerSupervisor))})}})),p((0,c.rW)({[b]:m})),()=>{p((0,c.uo)({[b]:null})),p((0,c.Oo)({[b]:null})),p((0,c.rW)({[b]:null}))}),[p,m,r.powerSupervisor,b,a,e?.id,r,_]),(0,s.useEffect)(()=>{n?.(b,A),l?.(b,!g)},[n,A,l,g,b]),(0,i.jsx)(u.A,{device:t})}))},377764(e,t,n){n.d(t,{A:()=>C,R:()=>O});var i=n(274934),s=n(418398),l=n(977872),o=n(602086),a=n(843871),r=n(179102),d=n(421819),c=n(221835),m=n(513197),u=n(419284),h=n(586566),_=n(309130),A=n(100978),g=n(205521),v=n(470070),b=n(291935),p=n(857780),x=n(595778);const O="led",w=(0,a.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{led_override:e,led_override_color:t=x.I,led_override_color_brightness:n=x.U}={},mgmtSettings:i})=>({led_override:e||(!1===i.led_enabled?p.c_.OFF:p.c_.ON),led_override_color:t,led_override_color_brightness:n}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),f=e=>(0,i.jsxs)("span",{children:[e,"%"]}),C=(0,s.Zz)((0,l.Ng)(e=>({mgmtSettings:(0,b.$5)(e)})))(w(({activeItem:e,setFormDirty:t,setFormInvalid:n,dirty:s,isValid:a,values:b,resetForm:w,setFieldValue:C,formName:S=O,mgmtSettings:{led_enabled:I}})=>{const E=(0,l.wA)(),N=(0,h.lp)(e),j=(I&&e.led_override!==p.c_.OFF||e.led_override===p.c_.ON)&&N;(0,o.useEffect)(()=>(E((0,g.uo)({[S]:()=>b})),E((0,g.Oo)({[S]:()=>w({values:b})})),E((0,g.rW)({[S]:w})),()=>{E((0,g.uo)({[S]:null})),E((0,g.Oo)({[S]:null})),E((0,g.rW)({[S]:null}))}),[E,w,b,S]),(0,o.useEffect)(()=>{t(S,s),n(S,!a)},[t,n,s,a,S]);const k=(0,o.useCallback)(e=>{C("led_override_color",(0,u.E6)(e.toString())||x.I)},[C]);return(0,i.jsxs)(A.A,{gap:_.Ln,flexDirection:"column",children:[(0,i.jsx)(A.A,{width:"100%",justifyContent:"space-between",children:(0,i.jsx)(c.A,{id:"led_override",checked:p.c_.ON===b.led_override,onChange:()=>{C("led_override",b.led_override===p.c_.ON?p.c_.OFF:p.c_.ON)},children:(0,i.jsx)(r.A,{size:"medium",color:"text-2",children:(0,i.jsx)(v.sA,{id:"COMMON_LED"})})})}),j?(0,i.jsxs)(A.A,{flexDirection:"column",gap:12,children:[(0,i.jsx)(r.A,{size:"medium",children:(0,i.jsx)(v.sA,{id:"COMMON_BRIGHTNESS"})}),(0,i.jsx)(d.A,{size:"large",value:+b.led_override_color_brightness||100,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:f,onChange:({target:{value:e}})=>{C("led_override_color_brightness",e)}}),(0,i.jsx)(r.A,{size:"medium",color:"text-1",weight:"bold",children:(0,i.jsx)(v.sA,{id:"COMMON_COLOR"})}),(0,i.jsx)(m.A,{value:b?.led_override_color||x.I,onChange:k,sliders:[{id:"hue",channel:"hue"}],colorSpace:"hex",children:(0,i.jsx)("span",{children:(0,i.jsx)(v.sA,{id:"DEVICE_PROPERTIES_LABEL_HEX"})})})]}):null]})}))},419685(e,t,n){n.d(t,{A:()=>f});var i=n(274934),s=n(602086),l=n(262356),o=n(179102),a=n(221835),r=n(266824),d=n(247816),c=n(977872),m=n(669439),u=n(309130),h=n(793442),_=n(100978),A=n(470070),g=n(291935),v=n(598990),b=n(6276),p=n(341699);const x=(0,d.A)("div")`
  width: 100%;
  margin-bottom: ${u.Ln};
`,O=()=>{const e=(0,c.d4)(g.zu);return{isOrchestrated:(0,s.useMemo)(()=>(0,b.A)(e),[e]),globalSwitchSettings:e}},w=({globalSwitchSettings:e,children:t})=>{const n=(0,c.wA)(),l=(0,s.useCallback)(()=>{n((0,v.Np)("global_network")).then(e=>{(e?.data?.setting_keys||[]).length>0&&n((0,v.Uc)(void 0,{resolveWithExisting:!1}))})},[n]);return(0,i.jsx)(m.A,{placement:"top start",description:(0,i.jsxs)(_.A,{flexDirection:"column",width:"100%",children:[(0,i.jsx)(A.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS_MANAGED_BY_FABRIC"}),(0,i.jsxs)(_.A,{gap:u.YC,alignItems:"baseline",children:[(0,i.jsx)(h.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,p.vF)(e.cloud_template)}),(0,i.jsx)(o.A,{style:{textTransform:"lowercase"},size:"small",children:(0,i.jsx)(A.sA,{id:"COMMON_OR"})}),(0,i.jsx)(r.A,{variant:"destructive",fontSize:"inherit",onClick:l,children:(0,i.jsx)(A.sA,{id:"COMMON_DETACH"})})]})]}),children:(0,i.jsx)("div",{children:t})})},f={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,noStyledRow:n})=>{const{isOrchestrated:a,globalSwitchSettings:r}=O(),d=(0,s.useCallback)(({target:{checked:e}})=>{t(e)},[t]),c=(0,i.jsx)(l.A,{full:!0,checked:e,onChange:d,disabled:a,children:(0,i.jsx)(_.A,{width:"100%",alignItems:"center",children:(0,i.jsx)(o.A,{size:"medium",color:a?"disabled":void 0,children:(0,i.jsx)(A.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})})}),m=n?c:(0,i.jsx)(x,{children:c});return a?(0,i.jsx)(w,{globalSwitchSettings:r,children:m}):m},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,onChange:n,noStyledRow:l})=>{const{isOrchestrated:r,globalSwitchSettings:d}=O(),c=(0,s.useCallback)(({target:{checked:e}})=>{t(e),n?.(e)},[n,t]),m=(0,i.jsx)(a.A,{id:"global-switch-settings-checkbox",checked:e,onChange:c,disabled:r,children:(0,i.jsx)(o.A,{size:"medium",color:r?"disabled":void 0,children:(0,i.jsx)(A.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})}),u=l?m:(0,i.jsx)(x,{children:m});return r?(0,i.jsx)(w,{globalSwitchSettings:d,children:u}):u}}},336128(e,t,n){n.d(t,{A:()=>u});var i=n(274934),s=n(602086),l=n(179102),o=n(833466),a=n(309130),r=n(589650),d=n(120197),c=n(100978),m=n(470070);const u=(0,s.memo)(()=>(0,i.jsxs)(c.A,{flexDirection:"column",children:[(0,i.jsx)(l.A,{color:"text-3",size:"small",children:(0,i.jsx)(m.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,i.jsxs)(c.A,{height:o.b,alignItems:"center",gap:a.Ln,children:[(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:r.NL.DHCP,children:(0,i.jsx)(m.sA,{id:"COMMON_DHCP"})}),(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:r.NL.STATIC,children:(0,i.jsx)(m.sA,{id:"COMMON_STATIC"})})]})]}))},548403(e,t,n){n.d(t,{A:()=>f,H:()=>O});var i=n(274934),s=n(418398),l=n(977872),o=n(602086),a=n(843871),r=n(950804),d=n(309130),c=n(589650),m=n(977663),u=n(100978),h=n(205521),_=n(291935),A=n(197571),g=n(956978),v=n(34118),b=n(550521),p=n(21265),x=n(336128);const O="network",w=(0,a.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,ip:t,switch_vlan_enabled:n,mgmt_network_id:i,connection_network_id:s},nativeNetworks:l})=>({config_network:(0,g.frs)(e,t,l,s),mgmt_network_id:(0,g.ewD)(l,i),switch_vlan_enabled:n||!1}),handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,combinedClients:t})=>r.A.object().shape({config_network:(0,m.d)(e,t),mgmt_network_id:r.A.string(),lte_limit_enabled:r.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:r.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:r.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),f=(0,s.Zz)((0,l.Ng)(e=>({nativeNetworks:(0,A.Tn)(e),honeypotNetworksIps:(0,_.Yk)(e),combinedClients:(0,v.GB)(e)})),w)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:s,resetForm:a,isValid:r,initialValues:m,nativeNetworks:_=[],activeItem:A})=>{const g=(0,l.wA)();return(0,o.useEffect)(()=>{e(O,n),t(O,!r)},[e,t,n,r]),(0,o.useEffect)(()=>(g((0,h.uo)({[O]:()=>({config_network:s.config_network.type===c.NL.STATIC?s.config_network:{type:c.NL.DHCP,bonding_enabled:s.config_network.bonding_enabled},mgmt_network_id:s.mgmt_network_id})})),g((0,h.Oo)({[O]:()=>a({values:s})})),g((0,h.rW)({[O]:a})),()=>{g((0,h.uo)({[O]:null})),g((0,h.Oo)({[O]:null})),g((0,h.rW)({[O]:null}))}),[g,a,s,A.port_overrides,m.switch_vlan_enabled]),(0,i.jsxs)(u.A,{gap:d.S2,flexDirection:"column",children:[_.length>1?(0,i.jsx)(b.A,{nativeNetworks:_,mac:A.mac}):null,(0,i.jsx)(x.A,{}),s.config_network.type===c.NL.STATIC?(0,i.jsx)(p.A,{}):null]})})},476072(e,t,n){n.r(t),n.d(t,{default:()=>F});var i=n(274934),s=n(418398),l=n(977872),o=n(602086),a=n(159469),r=n(478961),d=n(309130),c=n(843871),m=n(318087),u=n(586566),h=n(183743),_=n(419685),A=n(144312),g=n(89469),v=n(120197),b=n(796091),p=n(205521),x=n(470070),O=n(291935);const w="advanced",f=(0,c.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{snmp_contact:e,snmp_location:t,flowctrl_enabled:n}})=>({snmpEnabled:Boolean(e||t),snmp_contact:e,snmp_location:t,flowctrl_enabled:n}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(({setFormDirty:e,setFormInvalid:t,dirty:n,setValues:s,values:a,resetForm:r,isValid:d,initialValues:c,activeItem:f,isGlobalSwitchSettingsEnabled:C,setGlobalSwitchSettingsEnabled:S})=>{const I=(0,l.wA)(),E=(0,l.d4)(O.zu),[N,j]=(0,o.useState)(null),k=(0,u.Tn)(f);return(0,o.useEffect)(()=>{e(w,n||C!==!E.switch_exclusions?.includes(f.mac)),t(w,!d)},[e,t,n,d,C,E.switch_exclusions,f.mac]),(0,o.useEffect)(()=>{const{snmpEnabled:e,snmp_location:t,snmp_contact:n}=a;return I((0,p.uo)({[w]:()=>({snmpEnabled:e,snmp_contact:e?n:"",snmp_location:e?t:"",flowctrl_enabled:a.flowctrl_enabled})})),I((0,p.Oo)({[w]:()=>r({values:a})})),I((0,p.rW)({[w]:r})),()=>{I((0,p.uo)({[w]:null})),I((0,p.Oo)({[w]:null})),I((0,p.rW)({[w]:null}))}},[I,r,a,f.port_overrides,c.switch_vlan_enabled,f.snmp_contact,f.snmp_location]),(0,i.jsxs)(g.A,{children:[(0,i.jsx)(_.A.Checkbox,{isGlobalSwitchSettingsEnabled:C,setGlobalSwitchSettingsEnabled:S,onChange:e=>{if(e){const e=(0,m.LE)(c,a),t=(0,m.LE)(a,c),n=Object.keys(t).reduce((e,t)=>(E[t]&&(e[t]=E[t]),e),{});s({...a,...n}),j(e)}else s({...a,...N}),j(null)},noStyledRow:!0}),(0,i.jsx)(b.A,{children:(0,i.jsx)(A.A,{show:C,children:(0,i.jsx)(v.A,{name:"flowctrl_enabled",type:"realCheckbox",checked:!k&&(C?E.flowctrl_enabled:a.flowctrl_enabled),disabled:C||k,tooltipMessage:(0,i.jsx)(x.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_FLOW_CONTROL_D"}),tooltipProps:{portal:!0},children:(0,i.jsx)(x.sA,{id:"COMMON_FLOW_CONTROL"})})})}),(0,u.A6)(f)?(0,i.jsx)(h.A,{}):null]})});var C=n(548403),S=n(377764),I=n(376892),E=n(100978),N=n(535322),j=n(700444),k=n(598990),T=n(446863),y=n(795206),R=n(637084),L=n(115114),D=n(532635),M=n(795928);const F=(0,s.Zz)((0,r.A)([M.UH,C.H,w])(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:s,isInvalid:r})=>{const c=(0,l.d4)(T.n0),m=(0,l.d4)(T.Lq),u=(0,l.d4)(T.H5),{_id:h,mac:_}=e,A=(0,l.wA)(),g=(0,l.d4)(O.zu),[v,b]=(0,o.useState)(!g.switch_exclusions?.includes(e.mac));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,i.jsx)(N.A,{type:N.I.ACCORDION,items:[{id:C.H,openByDefault:!0,label:(0,i.jsx)(I.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,i.jsx)(C.A,{activeItem:e,setFormDirty:t,setFormInvalid:n})}]}),(0,i.jsx)(N.A,{type:N.I.ACCORDION,items:[{id:w,openByDefault:!0,label:(0,i.jsx)(I.A,{id:"COMMON_ADVANCED"}),renderContent:()=>(0,i.jsx)(f,{activeItem:e,setFormDirty:t,setFormInvalid:n,isGlobalSwitchSettingsEnabled:v,setGlobalSwitchSettingsEnabled:b})}]}),(0,i.jsx)(R.A,{device:e,setFormDirty:t,setFormInvalid:n}),(0,i.jsx)(N.A,{type:N.I.ACCORDION,items:[{id:D.f,openByDefault:!0,label:(0,i.jsx)(I.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,i.jsxs)(E.A,{flexDirection:"column",gap:d.Ln,children:[(0,i.jsx)(S.A,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,i.jsx)(D.A,{activeItem:e})]})}]}),(0,i.jsx)(L.A,{isDirty:s,isInvalid:r,onFormSubmit:async()=>{if(v!==!g.switch_exclusions?.includes(e.mac)){const t=g.switch_exclusions.filter(t=>t!==e.mac);v||t.push(e.mac);try{await A((0,k.OD)({...g,switch_exclusions:t}))}catch{A((0,j.ox)({icon:a.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}}const t=Object.entries(c).reduce((e,[t,n])=>{if("function"==typeof n){const t=n();if("object"==typeof t&&t&&Object.keys(t).length)return{...e,...t}}return e},{});A((0,y.ex)(t,h,_,{failureToast:{icon:a.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(m).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{b(!g.switch_exclusions?.includes(e.mac)),Object.values(u).forEach(e=>{"function"==typeof e&&e()})}})]})}))},521376(e,t,n){var i;n.d(t,{U:()=>i}),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"}(i||(i={}))},478961(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(602086);const l=function(e){return t=>n=>{const[l,o]=(0,s.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[a,r]=(0,s.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,s.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),c=(0,s.useCallback)((e,t)=>{r(n=>({...n,[e]:t}))},[]),m=!!Object.values(l).find(e=>e),u=!!Object.values(a).find(e=>e);return(0,i.jsx)(t,{isDirty:m,isInvalid:u,formStates:l,setFormDirty:d,setFormInvalid:c,...n})}}}}]);