"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[9854],{595778(e,t,i){i.d(t,{I:()=>r,U:()=>s});var n=i(751271);const r=(0,i(419284).Wj)(n.Ay["blue-0"]),s=100},323019(e,t,i){i.d(t,{A3:()=>h,Fw:()=>m,RA:()=>c,XH:()=>A,lp:()=>u});var n=i(222102),r=i(586566),s=i(291935),o=i(197571),l=i(147433),a=i(754924);const d=(0,n.Mz)(a.U$,e=>new Set((e.ethernet_overrides??[]).filter(({disabled:e,networkgroup:t})=>!e&&!!t).map(({networkgroup:e})=>e))),c=(0,n.Mz)(o.a3,d,(e,t)=>e.find(e=>!!e.wan_smartq_enabled&&((e,t)=>!!e.ifname||!!e.wan_networkgroup&&t.has(e.wan_networkgroup))(e,t))),A=(0,n.Mz)(s.bL,c,(e,t)=>e&&!t),h=(0,n.Mz)(a.U$,e=>(0,r.$F)(e)),u=(0,n.Mz)(a.U$,e=>(0,r.$F)(e)&&(e.hardware_offload??!0)),m=(0,n.Mz)(a.U$,e=>(0,r.WM)(e.fw2_caps,l.A.HWOFFLOAD_QOS_AND_SMART_QUEUE))},446863(e,t,i){i.d(t,{H5:()=>a,Lq:()=>l,n0:()=>o});var n=i(909924),r=i(573534),s=i(172205);const o=e=>e[s.U.SHARED][r.N.PROPERTY_PANEL]?.[n.Io.TAB_GET_DATA_FUNCTION]||{},l=e=>e[s.U.SHARED][r.N.PROPERTY_PANEL]?.[n.Io.TAB_SUBMIT_FUNCTION]||{},a=e=>e[s.U.SHARED][r.N.PROPERTY_PANEL]?.[n.Io.TAB_RESET_FUNCTION]||{}},680598(e,t,i){var n;i.d(t,{K:()=>n}),function(e){e.ALL="all",e.ACL_RULES="acl-rules",e.DNS_RECORDS="dns-records",e.FIREWALL="firewall",e.NAT_RULES="nat-rules",e.POLICY_BASED_ROUTES="policy-based-routes",e.PORT_FORWARDING="port-forwarding",e.QOS_RULES="qos-rules",e.STATIC_ROUTES="static-routes"}(n||(n={}))},535322(e,t,i){i.d(t,{A:()=>m,I:()=>n});var n,r=i(274934),s=i(505817),o=i(753583),l=i(247816),a=i(565527),d=i(309130),c=i(100978),A=i(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const h=(0,l.A)(c.A,(0,A.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:i}})=>e||s.Ay[i===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${s.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}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,l.A)(o.A,(0,A.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:i}})=>e||s.Ay[i===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${s.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:i}})=>e||s.Ay[i===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,m=({type:e,marginBottom:t,margin:i,padding:s,flex:o,width:l,nested:a,...d})=>"items"in d?(0,r.jsx)(u,{marginBottom:t,margin:i,padding:s,flex:o,nested:a,...d}):(0,r.jsx)(h,{nested:a,width:l,marginBottom:t,margin:i,padding:s,flex:o,isButtonList:e===n.BUTTON_LIST,...d,children:d.children})},250266(e,t,i){i.d(t,{A:()=>c});var n=i(274934),r=i(602086),s=i(13790),o=i(409844),l=i(521376),a=i(309130),d=i(470070);const c=({children:e=null,title:t,titleValues:i,message:c,messageValues:A,handleConfirm:h=()=>null,handleClose:u=()=>null,handleCancel:m,isOpen:_,buttonVariant:g="primary",cancelButtonVariant:x="tertiary",cancelButtonMessage:C="COMMON_ACTION_CANCEL",buttonMessage:b="COMMON_ACTION_CONFIRM",buttonDisabled:p=!1,position:O="top",offset:v,showHeaderClose:E=!1,contentClassName:f="",body:S,titleBody:j,className:I,rootClose:N=!1,footerActions:w})=>{const R=(0,r.useCallback)(e=>{_&&(e.stopPropagation(),e.key===l.U.ENTER?h():e.key===l.U.ESCAPE&&u(!1))},[_,h,u]);(0,r.useEffect)(()=>(window.addEventListener("keydown",R,!0),()=>{window.removeEventListener("keydown",R,!0)}),[R]);const T=(0,r.useCallback)(()=>{u(!1),m?.()},[u,m]),D=(0,r.useCallback)(()=>{u(!1),h()},[u,h]),y=(0,r.useMemo)(()=>[{text:(0,n.jsx)(d.sA,{id:C}),variant:x,onClick:T},{text:(0,n.jsx)(d.sA,{id:b}),disabled:p,variant:g,onClick:D}],[b,g,C,x,T,D,p]),$=(0,r.useCallback)(()=>{u(!1)},[u]),k=o.AH`
    ${t?"":`margin-top: ${a.xO}`}
  `;return(0,n.jsx)(s.A,{title:t?(0,n.jsx)(d.sA,{id:t,values:i}):j||null,...c?{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.sA,{id:c,values:A}),S]})}:{body:S},position:O,portal:!0,offset:v,actions:w||y,showHeaderClose:E,contentClassName:o.AH`
        ${k}
        ${f}
      `,onRequestClose:$,isOpen:_,allowOverflow:!0,rootClose:N,className:I,children:e})}},341699(e,t,i){i.d(t,{HV:()=>s,pm:()=>o,vF:()=>r});var n=i(726831);const r=e=>`${n.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,s=e=>`${n.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`,o=()=>`${n.A.fabricsOrchestration}`},637084(e,t,i){i.d(t,{A:()=>b});var n=i(274934),r=i(602086),s=i(843871),o=i(977872),l=i(418398),a=i(396489),d=i.n(a),c=i(205521),A=i(232410),h=i(933671),u=i(260288),m=i(619619),_=i(702147),g=i(507792),x=i(621309);const C=(0,s.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:t})=>({powerSupervisor:(0,m.f)(e,(0,g.lD)(t,e))}),handleSubmit:(e,{resetForm:t})=>t({values:e}),validationSchema:_.Ay}),b=(0,l.Zz)((0,o.Ng)((e,{device:{mac:t}})=>({powerSupervisor:(0,A.x0)(t)(e)})))(C(({powerSupervisor:e,device:t,setFormDirty:i,setFormInvalid:s,validateForm:l,values:a,resetForm:A,initialValues:m,dirty:_,isValid:g,formName:C=u.r8})=>{const b=(0,o.wA)();return(0,r.useEffect)(()=>(b((0,c.uo)({[C]:()=>({})})),b((0,c.Oo)({[C]:()=>{d()(a,m)||l().then(t=>{Object.keys(t).length||b((0,x.A)(e?.id,a.powerSupervisor))})}})),b((0,c.rW)({[C]:A})),()=>{b((0,c.uo)({[C]:null})),b((0,c.Oo)({[C]:null})),b((0,c.rW)({[C]:null}))}),[b,A,a.powerSupervisor,C,l,e?.id,a,m]),(0,r.useEffect)(()=>{i?.(C,_),s?.(C,!g)},[i,_,s,g,C]),(0,n.jsx)(h.A,{device:t})}))},419685(e,t,i){i.d(t,{A:()=>E});var n=i(274934),r=i(602086),s=i(262356),o=i(179102),l=i(221835),a=i(266824),d=i(247816),c=i(977872),A=i(669439),h=i(309130),u=i(793442),m=i(100978),_=i(470070),g=i(291935),x=i(598990),C=i(6276),b=i(341699);const p=(0,d.A)("div")`
  width: 100%;
  margin-bottom: ${h.Ln};
`,O=()=>{const e=(0,c.d4)(g.zu);return{isOrchestrated:(0,r.useMemo)(()=>(0,C.A)(e),[e]),globalSwitchSettings:e}},v=({globalSwitchSettings:e,children:t})=>{const i=(0,c.wA)(),s=(0,r.useCallback)(()=>{i((0,x.Np)("global_network")).then(e=>{(e?.data?.setting_keys||[]).length>0&&i((0,x.Uc)(void 0,{resolveWithExisting:!1}))})},[i]);return(0,n.jsx)(A.A,{placement:"top start",description:(0,n.jsxs)(m.A,{flexDirection:"column",width:"100%",children:[(0,n.jsx)(_.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS_MANAGED_BY_FABRIC"}),(0,n.jsxs)(m.A,{gap:h.YC,alignItems:"baseline",children:[(0,n.jsx)(u.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,b.vF)(e.cloud_template)}),(0,n.jsx)(o.A,{style:{textTransform:"lowercase"},size:"small",children:(0,n.jsx)(_.sA,{id:"COMMON_OR"})}),(0,n.jsx)(a.A,{variant:"destructive",fontSize:"inherit",onClick:s,children:(0,n.jsx)(_.sA,{id:"COMMON_DETACH"})})]})]}),children:(0,n.jsx)("div",{children:t})})},E={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,noStyledRow:i})=>{const{isOrchestrated:l,globalSwitchSettings:a}=O(),d=(0,r.useCallback)(({target:{checked:e}})=>{t(e)},[t]),c=(0,n.jsx)(s.A,{full:!0,checked:e,onChange:d,disabled:l,children:(0,n.jsx)(m.A,{width:"100%",alignItems:"center",children:(0,n.jsx)(o.A,{size:"medium",color:l?"disabled":void 0,children:(0,n.jsx)(_.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})})}),A=i?c:(0,n.jsx)(p,{children:c});return l?(0,n.jsx)(v,{globalSwitchSettings:a,children:A}):A},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,onChange:i,noStyledRow:s})=>{const{isOrchestrated:a,globalSwitchSettings:d}=O(),c=(0,r.useCallback)(({target:{checked:e}})=>{t(e),i?.(e)},[i,t]),A=(0,n.jsx)(l.A,{id:"global-switch-settings-checkbox",checked:e,onChange:c,disabled:a,children:(0,n.jsx)(o.A,{size:"medium",color:a?"disabled":void 0,children:(0,n.jsx)(_.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})}),h=s?A:(0,n.jsx)(p,{children:A});return a?(0,n.jsx)(v,{globalSwitchSettings:d,children:h}):h}}},604355(e,t,i){i.d(t,{A:()=>k});var n=i(274934),r=i(977872),s=i(602086),o=i(843871),l=i(526744),a=i(590979),d=i(669439),c=i(244081),A=i(724081),h=i(449339),u=i(927728),m=i(250266),_=i(120197),g=i(376527),x=i(100978),C=i(205521),b=i(470070),p=i(680598),O=i(291935),v=i(598990),E=i(179890),f=i(77157),S=i(553732),j=i(615019),I=i(818028),N=i(62749),w=i(323019),R=i(969288);const T="hardware_offload",D=(0,o.bk)({enableReinitialize:!0,mapPropsToValues:({hardware_offload:e=!0})=>({[T]:e}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),y=({disabled:e})=>{const[t,i]=(0,s.useState)(!1),{setFieldValue:r,values:l}=(0,o.j7)();return(0,n.jsx)(m.A,{title:"DEVICE_HARDWARE_ACCELERATION_PROMPT_TITLE",message:"DEVICE_HARDWARE_ACCELERATION_PROMPT_DESCRIPTION",buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",showHeaderClose:!0,rootClose:!0,handleCancel:()=>{i(!1)},handleClose:()=>{i(!1)},handleConfirm:()=>{i(!1),r(T,!1)},isOpen:t,children:(0,n.jsx)(_.A,{name:T,type:"realCheckbox",tooltipMessage:(0,n.jsx)(b.sA,{id:"DEVICE_HARDWARE_ACCELERATION_TOOLTIP"}),value:l[T],onChange:({target:{checked:e}})=>{e?r(T,!0):i(!0)},disabled:e,children:(0,n.jsx)(b.sA,{id:"COMMON_HARDWARE_ACCELERATION"})})})},$=()=>{const e=(0,r.wA)(),t=(0,r.d4)(O.Dd),i=(0,r.d4)(E.l),o=(0,r.d4)(w.Fw),m=(0,r.d4)(I.K2),_=(0,r.d4)(w.RA);(0,s.useEffect)(()=>{e((0,N.uL)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}))},[e]);const T=!!_&&!o,D=i.some(e=>e.enabled)&&!o,$=t.enabled,k=(0,s.useMemo)(()=>m.some(e=>e.ip_version===j.hz.IPV6),[m]),L=T||D||$||k;return(0,A.A)([(0,f.X6)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}),(0,v.Uc)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}),(0,S.Sk)(void 0,{crudCacheStrategy:{type:c.e.CACHE}})],(0,n.jsx)(d.A,{description:L?(0,n.jsxs)(x.A,{flexDirection:"column",children:[(0,n.jsx)(b.sA,{id:"DEVICE_HARDWARE_ACCELERATION_DISABLED_BY"}),(0,n.jsxs)(u.A,{children:[T?(0,n.jsx)("li",{children:(0,n.jsx)(l.A,{variant:"inline",onClick:()=>{e((0,C.XP)({type:h.H.WAN,id:_?._id}))},...a.A.addDataTestId(a.A.TestId.SIDE_PANEL_TRIGGER),children:(0,n.jsx)(b.sA,{id:"COMMON_SMART_QUEUES"})})}):null,D?(0,n.jsx)("li",{children:(0,n.jsx)(g.A,{size:"inherit",to:`${R.E0}?${R.XU}=${p.K.QOS_RULES}`,children:(0,n.jsx)(b.sA,{id:"COMMON_QOS"})})}):null,$?(0,n.jsx)("li",{children:(0,n.jsx)(g.A,{size:"inherit",to:`${R.bB}/${R.Uy.TRAFFIC_LOGGING}`,children:(0,n.jsx)(b.sA,{id:"COMMON_NETFLOW"})})}):null,k?(0,n.jsx)("li",{children:(0,n.jsx)(g.A,{size:"inherit",to:`${R.E0}?${R.XU}=${p.K.NAT_RULES}`,children:(0,n.jsx)(b.sA,{id:"COMMON_IPV6_NAT"})})}):null]})]}):null,children:(0,n.jsx)("span",{children:(0,n.jsx)(y,{disabled:L})})}))},k=D(({dirty:e,isValid:t,values:i,setFormDirty:o,setFormInvalid:l,resetForm:a,formName:d="hardwareAcceleration"})=>{const c=(0,r.wA)();return(0,s.useEffect)(()=>(c((0,C.uo)({[d]:()=>i})),c((0,C.Oo)({[d]:()=>a({values:i})})),c((0,C.rW)({[d]:a})),()=>{c((0,C.uo)({[d]:null})),c((0,C.Oo)({[d]:null})),c((0,C.rW)({[d]:null}))}),[c,a,i,d]),(0,s.useEffect)(()=>{o(d,e),l(d,!t)},[o,e,l,t,d]),(0,n.jsx)($,{})})},554598(e,t,i){i.d(t,{A:()=>c});var n=i(274934),r=i(728091),s=i(179102),o=i(470070),l=i(100978),a=i(595778),d=i(662986);const c=({value:e=a.U,onChange:t})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.A,{flexDirection:"column",width:"100%",children:[(0,n.jsx)(l.A,{flexDirection:"row",alignItems:"center",children:(0,n.jsx)(s.A,{variant:"caption",children:(0,n.jsx)(o.sA,{id:"COMMON_BRIGHTNESS"})})}),(0,n.jsx)(r.A,{value:e,minValue:1,onChange:t})]}),(0,n.jsx)(l.A,{flexDirection:"column",children:(0,n.jsx)(s.A,{variant:"body-primary",children:(0,d.A)(e)})})]})},785616(e,t,i){i.d(t,{A:()=>g});var n=i(274934),r=i(602086),s=i(513197),o=i(419284),l=i(100978),a=i(565823),d=i(247816),c=i(291508);const A=(0,d.A)(l.A)`
  cursor: pointer;
`,h=(0,d.A)("div",(0,c.A)("color"))`
  background-color: ${({color:e})=>e};
  border-radius: 3px;
  width: 34px;
  height: 20px;
`,u=({color:e})=>(0,n.jsxs)(A,{width:"55px",height:"24px",padding:"2px 0",alignItems:"center",justifyContent:"space-between",flexShrink:0,children:[(0,n.jsx)(h,{color:e}),(0,n.jsx)(a.A,{})]});var m=i(595778);const _=[{id:"hue",channel:"hue"}],g=({value:e,onChange:t})=>{const i=(0,r.useCallback)(e=>{t((0,o.E6)(e.toString())||m.I)},[t]),a=e||m.I;return(0,n.jsx)(l.A,{flexDirection:"column",children:(0,n.jsx)(s.A,{value:a,onChange:i,sliders:_,colorSpace:"hex",children:(0,n.jsx)("span",{children:(0,n.jsx)(u,{color:a})})})})}},663216(e,t,i){i.d(t,{Ay:()=>v,Cg:()=>p});var n=i(274934),r=i(418398),s=i(977872),o=i(602086),l=i(487763),a=i(843871),d=i(950804),c=i(586566),A=i(309130),h=i(120197),u=i(100978),m=i(205521),_=i(470070),g=i(857780),x=i(595778),C=i(554598),b=i(785616);const p="screen",O=(0,a.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:e,formName:t=p})=>({[t]:{led_override:e.led_override||g.c_.ON,led_override_color_brightness:e.led_override_color_brightness||x.U,led_override_color:e.led_override_color||x.I}}),validationSchema:d.A.object().shape({led_override:d.A.string(),led_override_color_brightness:d.A.number(),led_override_color:d.A.string()}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),v=(0,r.Zz)(O)(({activeItem:e,setFormDirty:t,values:i,dirty:r,resetForm:a,setFieldValue:d,formName:O=p,disableLedOverrideColor:v,disableLedBrightnessField:E})=>{const f=(0,s.wA)(),S=(0,c.lp)(e);(0,o.useEffect)(()=>{t(O,r)},[t,r,O]),(0,o.useEffect)(()=>(f((0,m.uo)({[O]:()=>{const e=(0,l.A)(i,O);return{...i[O],...e}}})),f((0,m.Oo)({[O]:()=>{a({values:i})}})),f((0,m.rW)({[O]:a})),()=>{f((0,m.uo)({[O]:null})),f((0,m.Oo)({[O]:null})),f((0,m.rW)({[O]:null}))}),[f,O,a,i]);const j=(0,o.useCallback)(e=>{d(`${O}.led_override_color`,e)},[d,O]);return(0,n.jsxs)(u.A,{alignItems:"center",marginBottom:A.Ln,gap:A.Ln,children:[(0,n.jsx)(u.A,{children:(0,n.jsx)(h.A,{name:"led_override",type:"realCheckbox",checked:i[O].led_override===g.c_.ON,onChange:({target:{checked:e}})=>{d(`${O}.led_override`,e?g.c_.ON:g.c_.OFF)},children:(0,n.jsx)(_.sA,{id:"COMMON_LED"})})}),S&&!v?(0,n.jsx)(b.A,{value:i[O].led_override_color||x.I,onChange:j}):null,!E&&S?(0,n.jsx)(C.A,{value:i[O].led_override_color_brightness??x.U,onChange:e=>{d(`${O}.led_override_color_brightness`,e)}}):null]})})},309854(e,t,i){i.r(t),i.d(t,{default:()=>w});var n=i(274934),r=i(418398),s=i(977872),o=i(602086),l=i(159469),a=i(478961),d=i(630849),c=i(586566),A=i(309130),h=i(376892),u=i(100978),m=i(535322),_=i(700444),g=i(291935),x=i(598990),C=i(446863),b=i(956978),p=i(795206),O=i(637084),v=i(115114),E=i(604355),f=i(419685),S=i(322784),j=i(663216),I=i(532635),N=i(795928);const w=(0,r.Zz)((0,a.A)([N.UH,j.Cg,S.q,I.f]))(({activeItem:e,setFormDirty:t,setFormInvalid:i,isDirty:r,isInvalid:a})=>{const w=(0,s.d4)(C.Lq),R=(0,s.d4)(C.H5),T=(0,s.d4)(C.n0),D=(0,s.wA)(),y=(0,d.I)(),$=(0,s.d4)(g.zu),[k,L]=(0,o.useState)(!$.switch_exclusions?.includes(e.mac)),M=r||k!==!$.switch_exclusions?.includes(e.mac);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:i}),(0,n.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:j.Cg,openByDefault:!0,label:(0,n.jsx)(h.A,{id:"COMMON_LED"}),renderContent:()=>(0,n.jsx)(j.Ay,{activeItem:e,setFormDirty:t})}]}),(0,n.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:S.q,openByDefault:!0,label:(0,n.jsx)(h.A,{id:"COMMON_ADVANCED"}),renderContent:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.A,{flexDirection:"column",gap:A.Ln,children:[(0,c.$F)(e)?(0,n.jsx)(E.A,{hardware_offload:e.hardware_offload,setFormDirty:t,setFormInvalid:i}):null,(0,b.Dh3)(e)?null:(0,n.jsx)(f.A.Checkbox,{isGlobalSwitchSettingsEnabled:k,setGlobalSwitchSettingsEnabled:L})]}),(0,n.jsx)(S.A,{activeItem:e,setFormDirty:t,setFormInvalid:i,isGlobalSwitchSettingsEnabled:k})]})}]}),(0,n.jsx)(O.A,{device:e,setFormDirty:t,setFormInvalid:i}),(0,n.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:I.f,openByDefault:!0,label:(0,n.jsx)(h.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,n.jsx)(I.A,{activeItem:e})}]}),(0,n.jsx)(v.A,{isDirty:M,isInvalid:a,onFormSubmit:async()=>{if(k!==!$.switch_exclusions?.includes(e.mac)){const t=$.switch_exclusions.filter(t=>t!==e.mac);k||t.push(e.mac);try{await D((0,x.OD)({...$,switch_exclusions:t}))}catch{return void D((0,_.ox)({icon:l.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}}const t=Object.entries(T).reduce((e,[t,i])=>{if("function"==typeof i){const t=i();if("object"==typeof t&&t&&Object.keys(t).length)return{...e,...t}}return e},{});D((0,p.ex)(t,e._id,e.mac,{extend:!0})).then(()=>{Object.values(w).forEach(e=>{"function"==typeof e&&e()})}).catch(y)},onFormCancel:()=>{Object.values(R).forEach(e=>{"function"==typeof e&&e()})}})]})})},521376(e,t,i){var n;i.d(t,{U:()=>n}),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"}(n||(n={}))},478961(e,t,i){i.d(t,{A:()=>s});var n=i(274934),r=i(602086);const s=function(e){return t=>i=>{const[s,o]=(0,r.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[l,a]=(0,r.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,r.useCallback)((e,t)=>{o(i=>({...i,[e]:t}))},[]),c=(0,r.useCallback)((e,t)=>{a(i=>({...i,[e]:t}))},[]),A=!!Object.values(s).find(e=>e),h=!!Object.values(l).find(e=>e);return(0,n.jsx)(t,{isDirty:A,isInvalid:h,formStates:s,setFormDirty:d,setFormInvalid:c,...i})}}}}]);