"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[11494],{346100(e,t,n){n.d(t,{A:()=>r});const r={POWER_CYCLE_ON_AC_RECOVERY:2,POWER_BUZZER:4,SAFE_SHUTDOWN_AND_POWER_CYCLE_TIME:8,SMART_POWER_EMERGENCY_POWER_OFF:16}},897015(e,t,n){n.d(t,{VG:()=>r,Vm:()=>s,z7:()=>i});const r=80,i="22:00",s="08:00"},595778(e,t,n){n.d(t,{I:()=>i,U:()=>s});var r=n(751271);const i=(0,n(419284).Wj)(r.Ay["blue-0"]),s=100},380287(e,t,n){var r,i;n.d(t,{E:()=>r,m:()=>i}),function(e){e.INIT="init",e.CONNECT="connect",e.DISCONNECT="disconnect",e.FOUND="found",e.BIND="bind",e.READY="ready",e.UPDATE="update",e.UNKNOWN="unknown"}(r||(r={})),function(e){e[e.LOW=2]="LOW",e[e.MEDIUM=1]="MEDIUM",e[e.HIGH=0]="HIGH"}(i||(i={}))},446863(e,t,n){n.d(t,{H5:()=>a,Lq:()=>l,n0:()=>o});var r=n(909924),i=n(573534),s=n(172205);const o=e=>e[s.U.SHARED][i.N.PROPERTY_PANEL]?.[r.Io.TAB_GET_DATA_FUNCTION]||{},l=e=>e[s.U.SHARED][i.N.PROPERTY_PANEL]?.[r.Io.TAB_SUBMIT_FUNCTION]||{},a=e=>e[s.U.SHARED][i.N.PROPERTY_PANEL]?.[r.Io.TAB_RESET_FUNCTION]||{}},535322(e,t,n){n.d(t,{A:()=>A,I:()=>r});var r,i=n(274934),s=n(505817),o=n(753583),l=n(247816),a=n(565527),d=n(309130),_=n(100978),c=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const m=(0,l.A)(_.A,(0,c.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===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,c.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===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:n}})=>e||s.Ay[n===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};
      }
    }
  }
`,A=({type:e,marginBottom:t,margin:n,padding:s,flex:o,width:l,nested:a,...d})=>"items"in d?(0,i.jsx)(u,{marginBottom:t,margin:n,padding:s,flex:o,nested:a,...d}):(0,i.jsx)(m,{nested:a,width:l,marginBottom:t,margin:n,padding:s,flex:o,isButtonList:e===r.BUTTON_LIST,...d,children:d.children})},250266(e,t,n){n.d(t,{A:()=>_});var r=n(274934),i=n(602086),s=n(13790),o=n(409844),l=n(521376),a=n(309130),d=n(470070);const _=({children:e=null,title:t,titleValues:n,message:_,messageValues:c,handleConfirm:m=()=>null,handleClose:u=()=>null,handleCancel:A,isOpen:E,buttonVariant:h="primary",cancelButtonVariant:v="tertiary",cancelButtonMessage:g="COMMON_ACTION_CANCEL",buttonMessage:b="COMMON_ACTION_CONFIRM",buttonDisabled:O=!1,position:I="top",offset:x,showHeaderClose:p=!1,contentClassName:C="",body:N,titleBody:j,className:R,rootClose:f=!1,footerActions:T})=>{const M=(0,i.useCallback)(e=>{E&&(e.stopPropagation(),e.key===l.U.ENTER?m():e.key===l.U.ESCAPE&&u(!1))},[E,m,u]);(0,i.useEffect)(()=>(window.addEventListener("keydown",M,!0),()=>{window.removeEventListener("keydown",M,!0)}),[M]);const S=(0,i.useCallback)(()=>{u(!1),A?.()},[u,A]),D=(0,i.useCallback)(()=>{u(!1),m()},[u,m]),y=(0,i.useMemo)(()=>[{text:(0,r.jsx)(d.sA,{id:g}),variant:v,onClick:S},{text:(0,r.jsx)(d.sA,{id:b}),disabled:O,variant:h,onClick:D}],[b,h,g,v,S,D,O]),L=(0,i.useCallback)(()=>{u(!1)},[u]),w=o.AH`
    ${t?"":`margin-top: ${a.xO}`}
  `;return(0,r.jsx)(s.A,{title:t?(0,r.jsx)(d.sA,{id:t,values:n}):j||null,..._?{body:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.sA,{id:_,values:c}),N]})}:{body:N},position:I,portal:!0,offset:x,actions:T||y,showHeaderClose:p,contentClassName:o.AH`
        ${w}
        ${C}
      `,onRequestClose:L,isOpen:E,allowOverflow:!0,rootClose:f,className:R,children:e})}},787481(e,t,n){n.d(t,{A:()=>l});var r=n(274934),i=n(833466),s=n(309130),o=n(100978);const l=e=>(0,r.jsx)(o.A,{paddingTop:s.YC,paddingBottom:s.YC,gap:s.Ln,rowGap:s.YC,flexWrap:"wrap",minHeight:i.b,alignItems:"center",...e})},859513(e,t,n){n.d(t,{A:()=>_});var r=n(274934),i=n(505817),s=n(247816),o=n(409844),l=n(470070),a=n(291508);const d=(0,s.A)("div",(0,a.A)("align"))`
  ${({align:e})=>e&&`text-align: ${e}`};
  color: ${({theme:{themeName:e}})=>i.Ay[`desktop-color-red-06-${e}`]};
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
  line-height: 20px;
`,_=({align:e="left",children:t=null,className:n=null,translation:i=null,visible:s=!1})=>s?(0,r.jsxs)(d,{align:e,className:(0,o.cx)(n),children:[i?(0,r.jsx)(l.sA,{id:i}):null,t]}):null},377764(e,t,n){n.d(t,{A:()=>C,R:()=>I});var r=n(274934),i=n(418398),s=n(977872),o=n(602086),l=n(843871),a=n(179102),d=n(421819),_=n(221835),c=n(513197),m=n(419284),u=n(586566),A=n(309130),E=n(100978),h=n(205521),v=n(470070),g=n(291935),b=n(857780),O=n(595778);const I="led",x=(0,l.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{led_override:e,led_override_color:t=O.I,led_override_color_brightness:n=O.U}={},mgmtSettings:r})=>({led_override:e||(!1===r.led_enabled?b.c_.OFF:b.c_.ON),led_override_color:t,led_override_color_brightness:n}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),p=e=>(0,r.jsxs)("span",{children:[e,"%"]}),C=(0,i.Zz)((0,s.Ng)(e=>({mgmtSettings:(0,g.$5)(e)})))(x(({activeItem:e,setFormDirty:t,setFormInvalid:n,dirty:i,isValid:l,values:g,resetForm:x,setFieldValue:C,formName:N=I,mgmtSettings:{led_enabled:j}})=>{const R=(0,s.wA)(),f=(0,u.lp)(e),T=(j&&e.led_override!==b.c_.OFF||e.led_override===b.c_.ON)&&f;(0,o.useEffect)(()=>(R((0,h.uo)({[N]:()=>g})),R((0,h.Oo)({[N]:()=>x({values:g})})),R((0,h.rW)({[N]:x})),()=>{R((0,h.uo)({[N]:null})),R((0,h.Oo)({[N]:null})),R((0,h.rW)({[N]:null}))}),[R,x,g,N]),(0,o.useEffect)(()=>{t(N,i),n(N,!l)},[t,n,i,l,N]);const M=(0,o.useCallback)(e=>{C("led_override_color",(0,m.E6)(e.toString())||O.I)},[C]);return(0,r.jsxs)(E.A,{gap:A.Ln,flexDirection:"column",children:[(0,r.jsx)(E.A,{width:"100%",justifyContent:"space-between",children:(0,r.jsx)(_.A,{id:"led_override",checked:b.c_.ON===g.led_override,onChange:()=>{C("led_override",g.led_override===b.c_.ON?b.c_.OFF:b.c_.ON)},children:(0,r.jsx)(a.A,{size:"medium",color:"text-2",children:(0,r.jsx)(v.sA,{id:"COMMON_LED"})})})}),T?(0,r.jsxs)(E.A,{flexDirection:"column",gap:12,children:[(0,r.jsx)(a.A,{size:"medium",children:(0,r.jsx)(v.sA,{id:"COMMON_BRIGHTNESS"})}),(0,r.jsx)(d.A,{size:"large",value:+g.led_override_color_brightness||100,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:p,onChange:({target:{value:e}})=>{C("led_override_color_brightness",e)}}),(0,r.jsx)(a.A,{size:"medium",color:"text-1",weight:"bold",children:(0,r.jsx)(v.sA,{id:"COMMON_COLOR"})}),(0,r.jsx)(c.A,{value:g?.led_override_color||O.I,onChange:M,sliders:[{id:"hue",channel:"hue"}],colorSpace:"hex",children:(0,r.jsx)("span",{children:(0,r.jsx)(v.sA,{id:"DEVICE_PROPERTIES_LABEL_HEX"})})})]}):null]})}))},148561(e,t,n){n.d(t,{A:()=>j,g:()=>C});var r=n(274934),i=n(418398),s=n(977872),o=n(602086),l=n(843871),a=n(179102),d=n(950804),_=n(309130),c=n(589650),m=n(977663),u=n(120197),A=n(100978),E=n(205521),h=n(470070),v=n(291935),g=n(197571),b=n(956978),O=n(34118),I=n(550521),x=n(21265),p=n(336128);const C="network",N=(0,l.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:t,ip:n,switch_vlan_enabled:r,mgmt_network_id:i,connection_network_id:s},nativeNetworks:o})=>({config_network:(0,b.frs)(e,n,o,s),mgmt_network_id:(0,b.ewD)(o,i),switch_vlan_enabled:r||!1,...((0,b.C6C)({model:t}),{})}),handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,clients:t})=>d.A.object().shape({config_network:(0,m.d)(e,t),mgmt_network_id:d.A.string(),lte_limit_enabled:d.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:d.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:d.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),j=(0,i.Zz)((0,s.Ng)(e=>({nativeNetworks:(0,g.Tn)(e),honeypotNetworksIps:(0,v.Yk)(e),clients:(0,O.A8)(e)})),N)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:i,resetForm:l,isValid:d,initialValues:m,activeItem:v,nativeNetworks:g,hideNetworkOverride:O,formName:N=C})=>{const j=(0,s.wA)(),R=(0,b.iQS)(v.model),f=(0,b.C6C)(v);(0,o.useEffect)(()=>{e(C,n),t(C,!d)},[e,t,n,d]);const T=(0,b.moU)(v);(0,o.useEffect)(()=>(j((0,E.uo)({[N]:()=>{const e={config_network:i.config_network?.type===c.NL.STATIC?i.config_network:{type:c.NL.DHCP,bonding_enabled:i.config_network?.bonding_enabled},mgmt_network_id:i.mgmt_network_id};return R&&(e.switch_vlan_enabled=i.switch_vlan_enabled,m.switch_vlan_enabled&&!i.switch_vlan_enabled&&v.port_overrides?.length&&(e.port_overrides=(v.port_overrides||[]).map(({portconf_id:e,...t})=>t))),e}})),j((0,E.Oo)({[N]:()=>l({values:i})})),j((0,E.rW)({[N]:l})),()=>{j((0,E.uo)({[N]:null})),j((0,E.Oo)({[N]:null})),j((0,E.rW)({[N]:null}))}),[j,l,i,N,v.port_overrides,m.switch_vlan_enabled,R,f]);const M=!O&&!T&&g.length>1&&!(0,b.q82)({model:v.model})&&!(0,b.xQi)({model:v.model});return(0,r.jsxs)(A.A,{flexDirection:"column",gap:_.S2,children:[M?(0,r.jsx)(I.A,{nativeNetworks:g,mac:v.mac}):null,(0,r.jsx)(p.A,{}),i.config_network?.type===c.NL.STATIC?(0,r.jsx)(x.A,{}):null,(0,b.xyH)(v)||(0,b.Eyk)(v)||(0,b._iI)(v)||(0,b.W46)(v)?(0,r.jsx)(A.A,{children:(0,r.jsx)(u.A,{name:"config_network.bonding_enabled",type:"realCheckbox",children:(0,r.jsx)(h.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})})}):null,R?(0,r.jsxs)(A.A,{flexDirection:"column",gap:_.kc,children:[(0,r.jsx)(a.A,{weight:"bold",size:"medium",children:(0,r.jsx)(h.sA,{id:"COMMON_VLAN"})}),(0,r.jsxs)(A.A,{justifyContent:"space-between",children:[(0,r.jsx)(a.A,{size:"medium",children:(0,r.jsx)(h.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})}),(0,r.jsx)(u.A,{type:"checkbox",name:"switch_vlan_enabled"})]})]}):null,null]})})},505342(e,t,n){n.d(t,{A:()=>b});var r=n(274934),i=n(977872),s=n(602086),o=n(843871),l=n(179102),a=n(247816),d=n(641645),_=n(309130),c=n(120197),m=n(470070),u=n(570801),A=n(304151),E=n(100978);const h=(0,a.A)(E.A)`
  margin-bottom: 24px;
`,v=e=>{const[t,n]=e.split(":");return 60*Number(t)+Number(n)},g=e=>`${Math.floor(e/d.t).toString().padStart(2,"0")}:${(e%d.t).toString().padStart(2,"0")}`,b=(0,s.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:t},setFieldValue:n}=(0,o.j7)(),{formatMessage:a}=(0,m.tz)(),b=(0,i.d4)(u.jc),O=(0,s.useMemo)(()=>(0,d.gy)(b,15,a),[b,a]),I=(0,s.useMemo)(()=>"string"==typeof e?v(e):e,[e]),x=(0,s.useMemo)(()=>"string"==typeof t?v(t):t,[t]),p=(0,s.useCallback)(({value:e})=>{n("lcm_night_mode_begins",g(+e))},[n]),C=(0,s.useCallback)(({value:e})=>{n("lcm_night_mode_ends",g(+e))},[n]);return!I&&0!==I||!x&&0!==x?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(E.A,{justifyContent:"flex-start",marginBottom:_.kc,alignItems:"center",gap:_.YC,children:[(0,r.jsx)(l.A,{color:"text-1",size:"medium",children:(0,r.jsx)(m.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})}),(0,r.jsx)(A.A,{description:(0,r.jsx)(m.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})})]}),(0,r.jsx)(h,{justifyContent:"space-between",flexDirection:"column",children:(0,r.jsxs)(E.A,{gap:_.Ln,children:[(0,r.jsx)(c.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:O.some(({value:e})=>e===I)?void 0:(0,d.oP)({formatMessage:a,minuteOfDay:I,use24HourFormat:b}),translatePlaceholder:!1,options:O,value:I,onChange:p,full:!0}),(0,r.jsx)(c.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:O.some(({value:e})=>e===x)?void 0:(0,d.oP)({formatMessage:a,minuteOfDay:x,use24HourFormat:b}),translatePlaceholder:!1,options:O,value:x,onChange:C,full:!0})]})})]})})},336128(e,t,n){n.d(t,{A:()=>m});var r=n(274934),i=n(602086),s=n(179102),o=n(833466),l=n(309130),a=n(589650),d=n(120197),_=n(100978),c=n(470070);const m=(0,i.memo)(()=>(0,r.jsxs)(_.A,{flexDirection:"column",children:[(0,r.jsx)(s.A,{color:"text-3",size:"small",children:(0,r.jsx)(c.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,r.jsxs)(_.A,{height:o.b,alignItems:"center",gap:l.Ln,children:[(0,r.jsx)(d.A,{name:"config_network.type",type:"radio",value:a.NL.DHCP,children:(0,r.jsx)(c.sA,{id:"COMMON_DHCP"})}),(0,r.jsx)(d.A,{name:"config_network.type",type:"radio",value:a.NL.STATIC,children:(0,r.jsx)(c.sA,{id:"COMMON_STATIC"})})]})]}))},451700(e,t,n){n.d(t,{W:()=>y,A:()=>F});var r=n(274934),i=n(418398),s=n(977872),o=n(602086),l=n(843871),a=n(396489),d=n.n(a),_=n(421819),c=n(179102),m=n(247816),u=n(950804),A=n(309130),E=n(304151),h=n(505342),v=n(505817),g=n(595521),b=n(291508),O=n(100978),I=n(470070);const x=[0,90,180,270],p=(0,m.A)(O.A,(0,b.A)("isActive"))`
  border: 1px solid
    ${({theme:{themeName:e},isActive:t})=>t?v.Ay[`desktop-color-ublue-06-${e}`]:v.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${v.Ay["desktop-radius-base"]};
  cursor: pointer;
`,C=(0,m.A)(g.A,(0,b.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,N=({degree:e,isActive:t,onClick:n})=>(0,r.jsxs)(p,{padding:`${A.YC} ${A.kc}`,flex:1,gap:A.YC,alignItems:"center",isActive:t,onClick:n,children:[(0,r.jsx)(C,{isActive:t,degree:e}),(0,r.jsx)(c.A,{color:"text-2",children:e?`${e}°`:(0,r.jsx)(I.sA,{id:"COMMON_NONE"})})]}),j=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,l.j7)();return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.A,{color:"text-3",size:"small",children:(0,r.jsx)(I.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})}),(0,r.jsx)(O.A,{gap:A.kc,marginTop:A.YC,marginBottom:A.Ln,children:x.map(n=>(0,r.jsx)(N,{degree:n,isActive:n===e,onClick:()=>{t("lcm_orientation_override",n)}},n))})]})};var R=n(120197),f=n(205521),T=n(291935),M=n(598990),S=n(897166),D=n(897015);const y="lcmScreen",L=(0,m.A)(O.A)`
  &:not(:last-child) {
    margin-bottom: ${A.S2};
  }
`,w=(0,l.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:n=D.VG,lcm_brightness_override:r=!1,lcm_night_mode_enabled:i=!1,lcm_night_mode_begins:s=D.z7,lcm_night_mode_ends:o=D.Vm,lcm_orientation_override:l}})=>({lcm:e,lcm_brightness:n,lcm_brightness_override:r,lcm_night_mode_enabled:i,lcm_night_mode_begins:s,lcm_night_mode_ends:o,..."lcm_orientation_override"in t?{lcm_orientation_override:l}:{}}),validationSchema:u.A.object().shape({lcm:u.A.object().shape({sync:u.A.boolean()}),lcm_brightness_override:u.A.boolean(),lcm_brightness:u.A.number().label("COMMON_BRIGHTNESS").min(1).max(100).required(),lcm_night_mode_enabled:u.A.boolean(),lcm_night_mode_begins:u.A.string(),lcm_night_mode_ends:u.A.string(),lcm_orientation_override:u.A.number()}),handleSubmit:()=>null}),k=e=>(0,r.jsx)(c.A,{size:"medium",children:e}),F=(0,i.Zz)((0,s.Ng)(e=>({lcmSettings:(0,T.ml)(e)}),{}),w)(({values:e,setFieldValue:t,resetForm:n,setFormDirty:i,setFormInvalid:l,dirty:a,isValid:m,initialValues:u,activeItem:v,hideRackMultiScreenSync:g=!1})=>{const b=(0,s.wA)(),x=(0,s.d4)(S.EL);return(0,o.useEffect)(()=>{i(y,a),l(y,!m)},[i,l,m,a]),(0,o.useEffect)(()=>(b((0,f.uo)({[y]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==D.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}:{}})})),b((0,f.Oo)({[y]:()=>{d()(u.lcm,e.lcm)||b((0,M.vd)(e.lcm)),n({values:e})}})),b((0,f.rW)({[y]:n})),()=>{b((0,f.uo)({[y]:null})),b((0,f.Oo)({[y]:null})),b((0,f.rW)({[y]:null}))}),[b,n,e,u.lcm]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(L,{justifyContent:"space-between",children:[(0,r.jsx)(c.A,{color:"text-1",size:"medium",children:(0,r.jsx)(I.sA,{id:"COMMON_BRIGHTNESS"})}),(0,r.jsx)(_.A,{width:"50%",value:e.lcm_brightness||D.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:k,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:x})]}),"lcm_orientation_override"in v?(0,r.jsx)(j,{}):null,(0,r.jsx)(h.A,{}),g?null:(0,r.jsx)(L,{justifyContent:"space-between",alignItems:"center",children:(0,r.jsxs)(O.A,{alignItems:"center",gap:A.kc,children:[(0,r.jsxs)(O.A,{alignItems:"center",children:[(0,r.jsx)(R.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),(0,r.jsx)(c.A,{color:"text-1",size:"medium",children:(0,r.jsx)(I.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"})})]}),(0,r.jsx)(E.A,{description:(0,r.jsx)(I.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})})]})})]})})},987429(e,t,n){n.r(t),n.d(t,{default:()=>ae});var r=n(274934),i=n(418398),s=n(977872),o=n(602086),l=n(11125),a=n(142757),d=n(347625),_=n(478961),c=n(630849),m=n(376892),u=n(470070),A=n(446863),E=n(795206),h=n(434521),v=n(45978),g=n(996052),b=n(80345),O=n(449339),I=n(89469),x=n(586566),p=n(115114),C=n(389592),N=n(612935),j=n(148561),R=n(532635),f=n(377764),T=n(795928),M=n(535322),S=n(843871),D=n(179102),y=n(950804),L=n(309130),w=n(721398),k=n(120197),F=n(100978),P=n(408402),V=n(205521),$=n(796091);const U="nut_server",B=(0,S.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({nut_server:e={port:3493}})=>({nut_server:e}),validationSchema:y.A.object().shape({nut_server:y.A.object().shape({enabled:y.A.boolean(),id:y.A.string().label("DEVICE_PROPERTIES_LABEL_NUT_SERVER_ID").when("enabled",{is:!0,then:y.A.string().max(31).required()}),port:y.A.number().label("DEVICE_PROPERTIES_LABEL_NUT_SERVER_PORT").when("enabled",{is:!0,then:y.A.number().required()}),credential_required:y.A.boolean(),username:y.A.string().label("COMMON_LABEL_USERNAME").when("credential_required",{is:!0,then:y.A.string().max(31).required()}),password:y.A.string().label("COMMON_PASSWORD").when("credential_required",{is:!0,then:y.A.string().max(31).required()})})}),handleSubmit:()=>null}),W=(0,i.Zz)(B)(({values:e,resetForm:t,setFieldValue:n,validateField:i,setFieldTouched:l,setFormDirty:a,setFormInvalid:d,dirty:_,isValid:c,initialValues:m,deviceName:A})=>{const E=(0,s.wA)();return(0,o.useEffect)(()=>{a(U,_),d(U,!c)},[a,d,c,_]),(0,o.useEffect)(()=>(E((0,V.uo)({[U]:()=>({nut_server:{enabled:e.nut_server?.enabled||!1,id:e.nut_server?.id||"",port:e.nut_server?.port||3493,credential_required:e.nut_server?.credential_required||!1,username:e.nut_server?.username||"",password:e.nut_server?.password||""}})})),E((0,V.Oo)({[U]:()=>t({values:e})})),E((0,V.rW)({[U]:t})),()=>{E((0,V.uo)({[U]:null})),E((0,V.Oo)({[U]:null})),E((0,V.rW)({[U]:null}))}),[E,t,e,m.nut_server]),(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(F.A,{flexDirection:"column",gap:L.kc,children:[(0,r.jsxs)($.A,{children:[(0,r.jsx)(k.A,{type:"realCheckbox",name:"nut_server.enabled",onChange:()=>{n("nut_server.enabled",!e.nut_server?.enabled).then(()=>{l("nut_server.id",!0),i("nut_server.port")})},children:(0,r.jsx)(D.A,{variant:"body-primary",children:(0,r.jsx)(u.sA,{id:"DEVICE_PROPERTIES_LABEL_NUT_SERVER"})})}),(0,r.jsx)(w.A,{variant:"outline",messageId:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_DESCRIPTION"})]}),(0,r.jsxs)(P.A,{condition:!e?.nut_server?.enabled,children:[(0,r.jsxs)(F.A,{flexDirection:"row",alignItems:"flex-start",gap:L.kc,children:[(0,r.jsx)(k.A,{variant:"secondary",name:"nut_server.id",label:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_ID",full:!0}),(0,r.jsx)(k.A,{variant:"secondary",name:"nut_server.port",type:"number",label:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_PORT",width:160})]}),(0,r.jsx)($.A,{children:(0,r.jsx)(k.A,{type:"realCheckbox",name:"nut_server.credential_required",onChange:()=>{n("nut_server.credential_required",!e.nut_server?.credential_required).then(()=>{l("nut_server.username",!0),l("nut_server.password",!0),i("nut_server.username"),i("nut_server.password")})},tooltipMessage:(0,r.jsx)(u.sA,{id:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_CREDENTIAL_REQUIRED_DESCRIPTION",values:{deviceName:A}}),children:(0,r.jsx)(u.sA,{id:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_CREDENTIAL_REQUIRED"})})}),(0,r.jsxs)(P.A,{condition:!e?.nut_server?.credential_required,children:[(0,r.jsx)(F.A,{flexDirection:"row",children:(0,r.jsx)(k.A,{autoComplete:"off",variant:"secondary",name:"nut_server.username",label:"COMMON_LABEL_USERNAME",full:!0})}),(0,r.jsx)(F.A,{flexDirection:"row",children:(0,r.jsx)(k.A,{name:"nut_server.password",type:"password",label:"COMMON_PASSWORD",autoComplete:"new-password",variant:"secondary",isNewInput:!0,passwordToggle:!0,full:!0})})]})]})]})})});var G=n(146215),H=n(897166),z=n(346100),Y=n(380287),q=n(164487),Z=n(787481);const K="emergencyPowerOff",Q="vbms_override.epo_enabled",J=[Y.m.HIGH,Y.m.MEDIUM,Y.m.LOW],X={[Y.m.HIGH]:"COMMON_HIGH",[Y.m.MEDIUM]:"COMMON_MEDIUM",[Y.m.LOW]:"COMMON_LOW"},ee=e=>(0,x.TM)({smart_power_caps:e?.smart_power_caps},z.A.SMART_POWER_EMERGENCY_POWER_OFF),te=(0,S.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:e})=>({vbms_override:{input_thd_level:e?.vbms_override?.input_thd_level||Y.m.HIGH,...ee(e)?{epo_enabled:e?.vbms_override?.epo_enabled||!1}:{}}}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(({setFormDirty:e,setFormInvalid:t,setFieldValue:n,dirty:i,isValid:l,values:a,resetForm:d,formName:_=K,activeItem:c})=>{const m=(0,s.wA)(),A=(0,s.d4)(H.EL),E=(0,o.useMemo)(()=>ee(c),[c]),h=a.vbms_override.epo_enabled,v=(0,o.useCallback)(e=>(0,r.jsx)($.A,{children:(0,r.jsx)(k.A,{type:"realCheckbox",name:Q,disabled:A,onChange:e,tooltipMessage:(0,r.jsx)(u.sA,{id:"DEVICE_EMERGENCY_POWER_OFF_TOOLTIP"}),children:(0,r.jsx)(D.A,{variant:"body-primary",children:(0,r.jsx)(u.sA,{id:"DEVICE_EMERGENCY_POWER_OFF"})})})}),[A]);return(0,o.useEffect)(()=>(m((0,V.uo)({[_]:()=>E?a:void 0})),m((0,V.Oo)({[_]:()=>d({values:a})})),m((0,V.rW)({[_]:d})),()=>{m((0,V.uo)({[_]:null})),m((0,V.Oo)({[_]:null})),m((0,V.rW)({[_]:null}))}),[m,d,a,_,E]),(0,o.useEffect)(()=>{e(_,i),t(_,!l)},[e,t,i,l,_]),E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(r.Fragment,{children:h?v(({target:{checked:e}})=>{n(Q,e)}):(0,r.jsx)(G.A,{trigger:v(()=>{}),title:(0,r.jsx)(u.sA,{id:"DEVICE_EMERGENCY_POWER_OFF_CONFIRM_TITLE"}),message:(0,r.jsx)(u.sA,{id:"DEVICE_EMERGENCY_POWER_OFF_CONFIRM_MESSAGE"}),confirmButtonLabel:"COMMON_ACTION_CONFIRM",cancelButtonLabel:"COMMON_ACTION_CANCEL",onConfirm:()=>n(Q,!0)})}),(0,r.jsxs)(F.A,{flexDirection:"column",children:[(0,r.jsx)(q.A,{tooltip:(0,r.jsx)(u.sA,{id:"DEVICE_GRID_VOLTAGE_SENSITIVITY_TOOLTIP"}),children:(0,r.jsx)(u.sA,{id:"DEVICE_GRID_VOLTAGE_SENSITIVITY"})}),(0,r.jsx)(Z.A,{children:J.map(e=>(0,r.jsx)(k.A,{name:"vbms_override.input_thd_level",type:"radio",value:e,children:(0,r.jsx)(u.sA,{id:X[e]})},e))})]})]}):null}),ne="beep",re=(0,S.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{beep_enabled:e}={}})=>({beep_enabled:e||!1}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),ie=({setFormDirty:e,setFormInvalid:t,dirty:n,isValid:i,values:l,resetForm:a,formName:d=ne})=>{const _=(0,s.wA)();return(0,o.useEffect)(()=>(_((0,V.uo)({[d]:()=>l})),_((0,V.Oo)({[d]:()=>a({values:l})})),_((0,V.rW)({[d]:a})),()=>{_((0,V.uo)({[d]:null})),_((0,V.Oo)({[d]:null})),_((0,V.rW)({[d]:null}))}),[_,a,l,d]),(0,o.useEffect)(()=>{e(d,n),t(d,!i)},[e,t,n,i,d]),(0,r.jsx)($.A,{children:(0,r.jsx)(k.A,{type:"realCheckbox",name:"beep_enabled",tooltipMessage:(0,r.jsx)(u.sA,{id:"DEVICE_POWER_OFF_BUZZER_TOOLTIP"}),children:(0,r.jsx)(u.sA,{id:"DEVICE_POWER_OFF_BUZZER"})})})},se=re(e=>{const{activeItem:{smart_power_caps:t=0}}=e;return(0,o.useMemo)(()=>(0,x.TM)({smart_power_caps:t},z.A.POWER_BUZZER),[t])?(0,r.jsx)(ie,{...e}):null});var oe=n(451700);const le=["disableManualFwUpdateWithReason","disableDowngradeWithReason","disableLocateWithReason","disableRestartWithReason","disableRemotePowerOffWithReason","disableCopyConfigWithReason"].reduce((e,t)=>(e[t]=(0,r.jsx)(u.sA,{id:"DEVICE_WARNING_UPS_DEVICE_OVERLOAD"}),e),{}),ae=(0,i.Zz)((0,_.A)([T.UH,ne,oe.W,j.g,N.q,R.f,U,K]))(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:i,isInvalid:_})=>{const u=(0,s.d4)(A.n0),N=(0,s.d4)(A.Lq),S=(0,s.d4)(A.H5),{_id:D,mac:y}=e,L=(0,s.wA)(),w=(0,c.I)(),k=(0,o.useCallback)(async e=>{const t="string"==typeof e?e:void 0,n=Object.entries(u).reduce((e,[t,n])=>{if("function"==typeof n){const t=n();if("object"==typeof t&&t&&Object.keys(t).length)return(0,l.A)(e,t,(e,t)=>Array.isArray(t)?t:void 0)}return e},{}),{lcm:r,...i}=n;await L((0,E.ex)(i,D,y,{extend:!0},t)).then(()=>{Object.values(N).forEach(e=>{"function"==typeof e&&e()})}).catch(w)},[u,L,D,y,N,w]),F=()=>{Object.values(S).forEach(e=>{"function"==typeof e&&e()})},P=(0,C.A)(u,j.g),V=(0,o.useCallback)(({[b.rx.TEST_CONFIG_ID]:e})=>k(e),[k]),{[b.$U.TEST_CONFIG_FOOTER]:$,[b.$U.IS_TESTING]:U}=(0,g.A)({[b.e_.DEVICE]:e,[b.e_.MGMT_NETWORK_ID]:P,[b.e_.IS_INVALID]:_,[b.e_.SUBMIT]:V,[b.e_.ON_CANCEL]:F,[b.e_.PANEL_TYPE]:O.H.DEVICE}),B=e.outlet_enabled,G=(0,a.Md)(e.vbms_table?.bms_run_anomaly||0),H=(0,h.S9)(e)!==v.g.CONNECTED,z=(0,o.useMemo)(()=>(0,d.Q)({model:e.model,name:e.name,mac:e.mac}),[e.model,e.name,e.mac]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,r.jsx)(M.A,{type:M.I.ACCORDION,items:[{id:j.g,openByDefault:!0,label:(0,r.jsx)(m.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,r.jsx)(j.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,hideNetworkOverride:!0})}]}),(0,r.jsx)(M.A,{type:M.I.ACCORDION,items:[{id:"ups_settings",openByDefault:!0,label:(0,r.jsx)(m.A,{id:"DEVICE_UPS_SETTINGS"}),renderContent:()=>(0,r.jsxs)(I.A,{children:[(0,r.jsx)(W,{setFormDirty:t,setFormInvalid:n,nut_server:e?.nut_server,deviceName:z}),(0,r.jsx)(se,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,r.jsx)(te,{activeItem:e,setFormDirty:t,setFormInvalid:n})]})}]}),(0,r.jsx)(M.A,{type:M.I.ACCORDION,items:[{id:R.f,openByDefault:!0,label:(0,r.jsx)(m.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,r.jsxs)(I.A,{children:[(0,x.j0)(e)?(0,r.jsx)(oe.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,hideRackMultiScreenSync:!0}):(0,r.jsx)(f.A,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,r.jsx)(R.A,{activeItem:e,hideManualFwUpdate:e.vbms_table?.is_battery_mode||!B||H,hideDowngrade:e.vbms_table?.is_battery_mode||!B||H,hideLocate:!B,hideRestart:!B,hideReplacementDevice:!B,...G?le:{}})]})}]}),(0,r.jsx)(p.A,{isDirty:i||U,isInvalid:_,onFormSubmit:k,onFormCancel:F,testConfigFooter:$})]})})},521376(e,t,n){var r;n.d(t,{U:()=>r}),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"}(r||(r={}))},478961(e,t,n){n.d(t,{A:()=>s});var r=n(274934),i=n(602086);const s=function(e){return t=>n=>{const[s,o]=(0,i.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[l,a]=(0,i.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,i.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),_=(0,i.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[]),c=!!Object.values(s).find(e=>e),m=!!Object.values(l).find(e=>e);return(0,r.jsx)(t,{isDirty:c,isInvalid:m,formStates:s,setFormDirty:d,setFormInvalid:_,...n})}}},641645(e,t,n){n.d(t,{EJ:()=>d,gy:()=>l,oP:()=>o,pi:()=>s,q8:()=>a,t:()=>i});var r=n(477909);const i=60,s=24,o=({minuteOfDay:e,use24HourFormat:t,formatMessage:n})=>{const r=Math.floor(e/60);return`${String(t?r:r%12||12).padStart(2,"0")}:${String(e%i).padStart(2,"0")}${t?"":` ${n({id:r>=12?"COMMON_PM":"COMMON_AM"})}`}`},l=(e,t,n)=>{const s=Math.max(1,Math.min(60,Math.floor(60/t))),l=Math.floor(60/s);return(0,r.A)(0,24).flatMap(t=>(0,r.A)(s).map(r=>{const s=r*l;return{label:o({use24HourFormat:e,formatMessage:n,minuteOfDay:t*i+s}),value:60*t+ +s}}))},a=e=>6e4*Math.round(e/6e4),d=(e,t)=>{const n=+(e/1e3).toFixed(1),r=+(n/1e3).toFixed(1),i=+(n/6e4).toFixed(1);return n<1e3?`${n} ${t({id:"COMMON_UNIT_MS"})}`:r<60?`${r} ${t({id:"COMMON_UNIT_S"})}`:`${i} ${t({id:"COMMON_UNIT_MIN"})}`}}}]);