"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[66506],{115354(e,t,n){n.d(t,{A:()=>o});var i=n(602086),a=n(141992);const o=(0,n(272338).w)(e=>(0,i.createElement)("svg",(0,a.d)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.createElement)("rect",{x:3,y:3,width:18,height:18,rx:2,fill:"currentColor",className:e.twotonedclassname}),(0,i.createElement)("path",{d:"M5.781 5C5.35 5 5 5.336 5 5.75v3.5c0 .414.35.75.781.75H9.22c.431 0 .781-.336.781-.75v-3.5c0-.414-.35-.75-.781-.75H5.78Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Zm4-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4.714A2.728 2.728 0 0 1 4.635 2h14.732a2.728 2.728 0 0 1 2.635 2.726v14.547A2.728 2.728 0 0 1 19.274 22H4.727A2.728 2.728 0 0 1 2 19.285V4.714Zm3 .91C5 5.28 5.291 5 5.651 5h3.698c.36 0 .651.28.651.625v3.75a.638.638 0 0 1-.651.625H5.65A.638.638 0 0 1 5 9.375v-3.75Z",fill:"currentColor",className:e.fillclassname})))},815879(e,t,n){n.d(t,{A:()=>o});var i=n(602086),a=n(141992);const o=(0,n(272338).w)(e=>(0,i.createElement)("svg",(0,a.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})))},897015(e,t,n){n.d(t,{VG:()=>i,Vm:()=>o,z7:()=>a});const i=80,a="22:00",o="08:00"},446863(e,t,n){n.d(t,{H5:()=>l,Lq:()=>s,n0:()=>r});var i=n(909924),a=n(573534),o=n(172205);const r=e=>e[o.U.SHARED][a.N.PROPERTY_PANEL]?.[i.Io.TAB_GET_DATA_FUNCTION]||{},s=e=>e[o.U.SHARED][a.N.PROPERTY_PANEL]?.[i.Io.TAB_SUBMIT_FUNCTION]||{},l=e=>e[o.U.SHARED][a.N.PROPERTY_PANEL]?.[i.Io.TAB_RESET_FUNCTION]||{}},535322(e,t,n){n.d(t,{A:()=>h,I:()=>i});var i,a=n(274934),o=n(814557),r=n(158885),s=n(247816),l=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const _=(0,s.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,s.A)(r.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  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,theme:{themeName:t}})=>e||o.Ay[t===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:o,flex:r,width:s,nested:l,...d})=>"items"in d?(0,a.jsx)(u,{marginBottom:t,margin:n,padding:o,flex:r,nested:l,...d}):(0,a.jsx)(_,{nested:l,width:s,marginBottom:t,margin:n,padding:o,flex:r,isButtonList:e===i.BUTTON_LIST,...d,children:d.children})},250266(e,t,n){n.d(t,{A:()=>c});var i=n(274934),a=n(602086),o=n(696264),r=n(409844),s=n(521376),l=n(309130),d=n(470070);const c=({children:e=null,title:t,titleValues:n,message:c,messageValues:m,handleConfirm:_=()=>null,handleClose:u=()=>null,handleCancel:h,isOpen:A,buttonVariant:g="primary",cancelButtonVariant:p="tertiary",cancelButtonMessage:v="COMMON_ACTION_CANCEL",buttonMessage:b="COMMON_ACTION_CONFIRM",buttonDisabled:N=!1,position:C="top",offset:O,showHeaderClose:f=!1,contentClassName:x="",body:E,titleBody:I,className:M,rootClose:w=!1,footerActions:j})=>{const k=(0,a.useCallback)(e=>{A&&(e.stopPropagation(),e.key===s.U.ENTER?_():e.key===s.U.ESCAPE&&u(!1))},[A,_,u]);(0,a.useEffect)(()=>(window.addEventListener("keydown",k,!0),()=>{window.removeEventListener("keydown",k,!0)}),[k]);const T=(0,a.useCallback)(()=>{u(!1),h?.()},[u,h]),y=(0,a.useCallback)(()=>{u(!1),_()},[u,_]),R=(0,a.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:v}),variant:p,onClick:T},{text:(0,i.jsx)(d.sA,{id:b}),disabled:N,variant:g,onClick:y}],[b,g,v,p,T,y,N]),S=(0,a.useCallback)(()=>{u(!1)},[u]),L=r.AH`
    ${t?"":`margin-top: ${l.xO}`}
  `;return(0,i.jsx)(o.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}),E]})}:{body:E},position:C,portal:!0,offset:O,actions:j||R,showHeaderClose:f,contentClassName:r.AH`
        ${L}
        ${x}
      `,onRequestClose:S,isOpen:A,allowOverflow:!0,rootClose:w,className:M,children:e})}},637084(e,t,n){n.d(t,{A:()=>p});var i=n(274934),a=n(602086),o=n(843871),r=n(977872),s=n(418398),l=n(205521),d=n(232410),c=n(1469),m=n(260288),_=n(619619),u=n(876809),h=n(113454),A=n(621309);const g=(0,o.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:t})=>({powerSupervisor:(0,_.f)(e,(0,h.lD)(t,e))}),handleSubmit:(e,{resetForm:t})=>t({values:e}),validationSchema:u.A}),p=(0,s.Zz)((0,r.Ng)((e,{device:{mac:t}})=>({powerSupervisor:(0,d.x0)(t)(e)})))(g(({powerSupervisor:e,device:t,setFormDirty:n,setFormInvalid:o,validateForm:s,values:d,resetForm:_,dirty:u,isValid:h,formName:g=m.r8})=>{const p=(0,r.wA)();return(0,a.useEffect)(()=>(p((0,l.uo)({[g]:()=>({})})),p((0,l.Oo)({[g]:()=>{s().then(t=>{Object.keys(t).length||p((0,A.A)(e?.id,d.powerSupervisor))})}})),p((0,l.rW)({[g]:_})),()=>{p((0,l.uo)({[g]:null})),p((0,l.Oo)({[g]:null})),p((0,l.rW)({[g]:null}))}),[p,_,d.powerSupervisor,g,s,e?.id]),(0,a.useEffect)(()=>{n?.(g,u),o?.(g,!h)},[n,u,o,h,g]),(0,i.jsx)(c.A,{device:t})}))},876809(e,t,n){n.d(t,{A:()=>o,q:()=>a});var i=n(950804);const a=i.A.object().shape({power_sources:i.A.array().transform(e=>e.filter(e=>e.power_source_mac)).of(i.A.object().shape({client_psu_index:i.A.number().required(),power_source_mac:i.A.string().label("COMMON_POWER_SOURCE").required(),power_source_index:i.A.string().label("COMMON_OUTLET").required()})).label("COMMON_POWER_SOURCE").min(1)}).optional(),o=i.A.object().shape({powerSupervisor:a})},148561(e,t,n){n.d(t,{A:()=>I,g:()=>x});var i=n(274934),a=n(418398),o=n(977872),r=n(602086),s=n(843871),l=n(938984),d=n(950804),c=n(309130),m=n(589650),_=n(977663),u=n(120197),h=n(100978),A=n(205521),g=n(470070),p=n(291935),v=n(197571),b=n(956978),N=n(34118),C=n(550521),O=n(21265),f=n(336128);const x="network",E=(0,s.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:t,ip:n,switch_vlan_enabled:i,mgmt_network_id:a,connection_network_id:o},nativeNetworks:r})=>{const s=(0,b.U$e)(r,o);return{config_network:{type:e?.type||m.NL.DHCP,ip:e?.ip||n||"",netmask:e?.netmask||s?.netmask||"",gateway:e?.gateway||s?.ip||"",dns1:e?.dns1||s?.dns1||"",dns2:e?.dns2||s?.dns2||"",dnssuffix:e?.dnssuffix||"",bonding_enabled:e?.bonding_enabled||!1},mgmt_network_id:(0,b.ewD)(r,a),switch_vlan_enabled:i||!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,_.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")})})}),I=(0,a.Zz)((0,o.Ng)(e=>({nativeNetworks:(0,v.Tn)(e),honeypotNetworksIps:(0,p.Yk)(e),clients:(0,N.A8)(e)})),E)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:a,resetForm:s,isValid:d,initialValues:_,activeItem:p,nativeNetworks:v,hideNetworkOverride:N,formName:E=x})=>{const I=(0,o.wA)(),M=(0,b.iQS)(p.model),w=(0,b.C6C)(p);(0,r.useEffect)(()=>{e(x,n),t(x,!d)},[e,t,n,d]);const j=(0,b.moU)(p);(0,r.useEffect)(()=>(I((0,A.uo)({[E]:()=>{const e={config_network:a.config_network?.type===m.NL.STATIC?a.config_network:{type:m.NL.DHCP,bonding_enabled:a.config_network?.bonding_enabled},mgmt_network_id:a.mgmt_network_id};return M&&(e.switch_vlan_enabled=a.switch_vlan_enabled,_.switch_vlan_enabled&&!a.switch_vlan_enabled&&p.port_overrides?.length&&(e.port_overrides=(p.port_overrides||[]).map(({portconf_id:e,...t})=>t))),e}})),I((0,A.Oo)({[E]:()=>s({values:a})})),I((0,A.rW)({[E]:s})),()=>{I((0,A.uo)({[E]:null})),I((0,A.Oo)({[E]:null})),I((0,A.rW)({[E]:null}))}),[I,s,a,E,p.port_overrides,_.switch_vlan_enabled,M,w]);const k=!N&&!j&&v.length>1&&!(0,b.q82)({model:p.model})&&!(0,b.xQi)({model:p.model});return(0,i.jsxs)(h.A,{flexDirection:"column",gap:c.S2,children:[k?(0,i.jsx)(C.A,{nativeNetworks:v,activeItemMac:p.mac}):null,(0,i.jsx)(f.A,{}),a.config_network?.type===m.NL.STATIC?(0,i.jsx)(O.A,{}):null,(0,b.xyH)(p)||(0,b.Eyk)(p)||(0,b._iI)(p)||(0,b.W46)(p)?(0,i.jsx)(h.A,{children:(0,i.jsx)(u.A,{name:"config_network.bonding_enabled",type:"realCheckbox",children:(0,i.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})})}):null,M?(0,i.jsxs)(h.A,{flexDirection:"column",gap:c.kc,children:[(0,i.jsx)(l.A,{weight:"bold",size:"medium",children:(0,i.jsx)(g.sA,{id:"COMMON_VLAN"})}),(0,i.jsxs)(h.A,{justifyContent:"space-between",children:[(0,i.jsx)(l.A,{size:"medium",children:(0,i.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})}),(0,i.jsx)(u.A,{type:"checkbox",name:"switch_vlan_enabled"})]})]}):null,null]})})},505342(e,t,n){n.d(t,{A:()=>b});var i=n(274934),a=n(977872),o=n(602086),r=n(843871),s=n(938984),l=n(247816),d=n(641645),c=n(309130),m=n(120197),_=n(470070),u=n(570801),h=n(304151),A=n(100978);const g=(0,l.A)(A.A)`
  margin-bottom: 24px;
`,p=e=>{const[t,n]=e.split(":");return 60*Number(t)+Number(n)},v=e=>`${Math.floor(e/d.t).toString().padStart(2,"0")}:${(e%d.t).toString().padStart(2,"0")}`,b=(0,o.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:t},setFieldValue:n}=(0,r.j7)(),{formatMessage:l}=(0,_.tz)(),b=(0,a.d4)(u.jc),N=(0,o.useMemo)(()=>(0,d.gy)(b,15,l),[b,l]),C=(0,o.useMemo)(()=>"string"==typeof e?p(e):e,[e]),O=(0,o.useMemo)(()=>"string"==typeof t?p(t):t,[t]),f=(0,o.useCallback)(({value:e})=>{n("lcm_night_mode_begins",v(+e))},[n]),x=(0,o.useCallback)(({value:e})=>{n("lcm_night_mode_ends",v(+e))},[n]);return!C&&0!==C||!O&&0!==O?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(A.A,{justifyContent:"flex-start",marginBottom:c.kc,alignItems:"center",gap:c.YC,children:[(0,i.jsx)(s.A,{color:"text-1",size:"medium",children:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})}),(0,i.jsx)(h.A,{description:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})})]}),(0,i.jsx)(g,{justifyContent:"space-between",flexDirection:"column",children:(0,i.jsxs)(A.A,{gap:c.Ln,children:[(0,i.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:N.some(({value:e})=>e===C)?void 0:(0,d.oP)({formatMessage:l,minuteOfDay:C,use24HourFormat:b}),translatePlaceholder:!1,options:N,value:C,onChange:f,full:!0}),(0,i.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:N.some(({value:e})=>e===O)?void 0:(0,d.oP)({formatMessage:l,minuteOfDay:O,use24HourFormat:b}),translatePlaceholder:!1,options:N,value:O,onChange:x,full:!0})]})})]})})},115262(e,t,n){n.d(t,{A:()=>h});var i=n(274934),a=n(602086),o=n(977872),r=n(599110),s=n(969819),l=n(146215),d=n(470070),c=n(347625),m=n(423564),_=n(197571),u=n(754924);const h=({mac:e,mgmtNetworkId:t,onSubmit:n,isDisabled:h,renderInnerButton:A})=>{const g=((e,t)=>{const n=(0,o.d4)(u.Kh),i=(0,o.d4)(_.Tn),r=n.get(e),l=(0,s.ki)(r,t),{remotePort:d}=r?(0,s.uj)(r,n):{remotePort:void 0},h=d?.port_idx,A=r?.uplink?.uplink_mac??r?.last_uplink?.uplink_mac,g=A?n.get(A):void 0,p=(0,c.Q)(g??{mac:A}),v=i.find(e=>e._id===t),b=v?(0,m.gm)(v):t||"";return(0,a.useMemo)(()=>{if(l.hasConflict&&null!=h)return{networkName:b,switchName:p,port:h}},[l.hasConflict,h,b,p])})(e,t),p=(0,i.jsx)(r.A,{name:"submit",variant:"primary",type:"submit",onClick:n,disabled:h,children:(0,i.jsx)(d.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})});return g?(0,i.jsx)(l.A,{title:(0,i.jsx)(d.sA,{id:"COMMON_NETWORK_OVERRIDE_CONFIRM_TITLE"}),message:(0,i.jsx)(d.sA,{id:"COMMON_NETWORK_OVERRIDE_CONFIRM_DEVICE",values:{networkName:g.networkName,switchName:g.switchName,port:g.port}}),onConfirm:n,confirmButtonLabel:"COMMON_ACTION_PROCEED",trigger:A?A(()=>{},h):(0,i.jsx)(r.A,{name:"submit",variant:"primary",type:"button",disabled:h,children:(0,i.jsx)(d.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})})}):(0,i.jsx)(i.Fragment,{children:A?A(n,h):p})}},336128(e,t,n){n.d(t,{A:()=>_});var i=n(274934),a=n(602086),o=n(938984),r=n(833466),s=n(309130),l=n(589650),d=n(120197),c=n(100978),m=n(470070);const _=(0,a.memo)(()=>(0,i.jsxs)(c.A,{flexDirection:"column",children:[(0,i.jsx)(o.A,{color:"text-3",size:"small",children:(0,i.jsx)(m.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,i.jsxs)(c.A,{height:r.b,alignItems:"center",gap:s.Ln,children:[(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:l.NL.DHCP,children:(0,i.jsx)(m.sA,{id:"COMMON_DHCP"})}),(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:l.NL.STATIC,children:(0,i.jsx)(m.sA,{id:"COMMON_STATIC"})})]})]}))},451700(e,t,n){n.d(t,{W:()=>R,A:()=>P});var i=n(274934),a=n(418398),o=n(977872),r=n(602086),s=n(843871),l=n(396489),d=n.n(l),c=n(925845),m=n(938984),_=n(247816),u=n(950804),h=n(309130),A=n(304151),g=n(505342),p=n(814557),v=n(115354),b=n(291508),N=n(100978),C=n(470070);const O=[0,90,180,270],f=(0,_.A)(N.A,(0,b.A)("isActive"))`
  border: 1px solid
    ${({theme:{themeName:e},isActive:t})=>t?p.Ay[`desktop-color-ublue-06-${e}`]:p.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${p.Ay["desktop-radius-base"]};
  cursor: pointer;
`,x=(0,_.A)(v.A,(0,b.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,E=({degree:e,isActive:t,onClick:n})=>(0,i.jsxs)(f,{padding:`${h.YC} ${h.kc}`,flex:1,gap:h.YC,alignItems:"center",isActive:t,onClick:n,children:[(0,i.jsx)(x,{isActive:t,degree:e}),(0,i.jsx)(m.A,{color:"text-2",children:e?`${e}°`:(0,i.jsx)(C.sA,{id:"COMMON_NONE"})})]}),I=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,s.j7)();return(0,i.jsxs)("div",{children:[(0,i.jsx)(m.A,{color:"text-3",size:"small",children:(0,i.jsx)(C.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})}),(0,i.jsx)(N.A,{gap:h.kc,marginTop:h.YC,marginBottom:h.Ln,children:O.map(n=>(0,i.jsx)(E,{degree:n,isActive:n===e,onClick:()=>{t("lcm_orientation_override",n)}},n))})]})};var M=n(120197),w=n(205521),j=n(291935),k=n(598990),T=n(897166),y=n(897015);const R="lcmScreen",S=(0,_.A)(N.A)`
  &:not(:last-child) {
    margin-bottom: ${h.S2};
  }
`,L=(0,s.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:n=y.VG,lcm_brightness_override:i=!1,lcm_night_mode_enabled:a=!1,lcm_night_mode_begins:o=y.z7,lcm_night_mode_ends:r=y.Vm,lcm_orientation_override:s}})=>({lcm:e,lcm_brightness:n,lcm_brightness_override:i,lcm_night_mode_enabled:a,lcm_night_mode_begins:o,lcm_night_mode_ends:r,..."lcm_orientation_override"in t?{lcm_orientation_override:s}:{}}),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}),D=e=>(0,i.jsx)(m.A,{size:"medium",children:e}),P=(0,a.Zz)((0,o.Ng)(e=>({lcmSettings:(0,j.ml)(e)}),{}),L)(({values:e,setFieldValue:t,resetForm:n,setFormDirty:a,setFormInvalid:s,dirty:l,isValid:_,initialValues:u,activeItem:p,hideRackMultiScreenSync:v=!1})=>{const b=(0,o.wA)(),O=(0,o.d4)(T.EL);return(0,r.useEffect)(()=>{a(R,l),s(R,!_)},[a,s,_,l]),(0,r.useEffect)(()=>(b((0,w.uo)({[R]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==y.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,w.Oo)({[R]:()=>{d()(u.lcm,e.lcm)||b((0,k.vd)(e.lcm)),n({values:e})}})),b((0,w.rW)({[R]:n})),()=>{b((0,w.uo)({[R]:null})),b((0,w.Oo)({[R]:null})),b((0,w.rW)({[R]:null}))}),[b,n,e,u.lcm]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(S,{justifyContent:"space-between",children:[(0,i.jsx)(m.A,{color:"text-1",size:"medium",children:(0,i.jsx)(C.sA,{id:"COMMON_BRIGHTNESS"})}),(0,i.jsx)(c.A,{width:"50%",value:e.lcm_brightness||y.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:D,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:O})]}),"lcm_orientation_override"in p?(0,i.jsx)(I,{}):null,(0,i.jsx)(g.A,{}),v?null:(0,i.jsx)(S,{justifyContent:"space-between",alignItems:"center",children:(0,i.jsxs)(N.A,{alignItems:"center",gap:h.kc,children:[(0,i.jsxs)(N.A,{alignItems:"center",children:[(0,i.jsx)(M.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),(0,i.jsx)(m.A,{color:"text-1",size:"medium",children:(0,i.jsx)(C.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"})})]}),(0,i.jsx)(A.A,{description:(0,i.jsx)(C.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})})]})})]})})},736627(e,t,n){n.r(t),n.d(t,{default:()=>w});var i,a=n(274934),o=n(418398),r=n(977872),s=n(602086),l=n(478961),d=n(630849),c=n(376892),m=n(535322),_=n(446863),u=n(291935),h=n(598990),A=n(714548),g=n(933007),p=n(956978),v=n(795206),b=n(586566),N=n(14683),C=n(637084),O=n(115114),f=n(115262),x=n(148561),E=n(532635),I=n(795928);!function(e){e.NAME="name",e.NETWORK="network",e.MANAGE_DEVICE="manage-device"}(i||(i={}));var M=n(451700);const w=(0,o.Zz)((0,l.A)([i.NAME,i.NETWORK,i.MANAGE_DEVICE,N.L]))(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:o,isInvalid:l})=>{const w=(0,r.d4)(_.Lq),j=(0,r.d4)(_.H5),k=(0,r.d4)(_.n0),T=(0,r.wA)(),y=(0,d.I)(),[R,S]=(0,s.useState)(!1),L=(0,s.useMemo)(()=>(0,p.w2f)({model:e.model}),[e.model]),D=(0,r.d4)(u.aN),[P,$]=(0,s.useState)(D);(0,s.useEffect)(()=>{$(D)},[D]),(0,s.useEffect)(()=>{(0,b.z6)(e.switch_caps?.feature_caps)&&T((0,h.Uc)())},[T,e.switch_caps?.feature_caps]);const F=(0,s.useCallback)(async()=>{S(!0);const t=Object.entries(k).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},{}),{ether_lighting:n,...i}=t,{etherlightingDeviceData:a,etherlightingSettingsToSubmit:o,hasEtherlightingChanges:r}=(0,A.E)({formData:{ether_lighting:n},etherlightingSettings:D,initialEtherlightingSettings:P}),s=[];(0,b.z6)(e.switch_caps?.feature_caps)&&r&&s.push(T((0,h.Ry)(o)).catch(y)),s.push(T((0,v.ex)({...i,ether_lighting:a},e._id,e.mac,{extend:!0})).catch(y)),Promise.all(s).then(()=>{Object.values(w).forEach(e=>{"function"==typeof e&&e()})}).finally(()=>{S(!1),L&&T((0,g.Hq)())})},[T,e._id,e.mac,e.switch_caps?.feature_caps,k,w,y,L,D,P]),V=(0,s.useCallback)(()=>{Object.values(j).forEach(e=>{"function"==typeof e&&e()})},[j]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(I.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n,formName:i.NAME,maxLength:30}),(0,b.z6)(e.switch_caps?.feature_caps)?(0,a.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:N.L,openByDefault:!0,label:(0,a.jsx)(c.A,{id:(0,b.Nr)(e)?"COMMON_PORT_LEDS":"COMMON_ETHERLIGHTING"}),renderContent:()=>(0,a.jsx)(N.A,{activeItem:e,etherlightingSettings:D,setFormDirty:t})}]}):null,(0,a.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:i.NETWORK,openByDefault:!0,label:(0,a.jsx)(c.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,a.jsx)(x.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,formName:i.NETWORK,hideNetworkOverride:L})}]}),(0,a.jsx)(C.A,{device:e,setFormDirty:t,setFormInvalid:n}),(0,a.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:i.MANAGE_DEVICE,openByDefault:!0,label:(0,a.jsx)(c.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.A,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,a.jsx)(E.A,{activeItem:e})]})}]}),(0,a.jsx)(O.A,{isDirty:o,isInvalid:l,isSubmitting:R,onFormSubmit:F,onFormCancel:V,applyButton:L?void 0:(0,a.jsx)(f.A,{mac:e.mac,mgmtNetworkId:k.network?.()?.mgmt_network_id,onSubmit:F,isDisabled:!o||l||R})})]})})},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:()=>o});var i=n(274934),a=n(602086);const o=function(e){return t=>n=>{const[o,r]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[s,l]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,a.useCallback)((e,t)=>{r(n=>({...n,[e]:t}))},[]),c=(0,a.useCallback)((e,t)=>{l(n=>({...n,[e]:t}))},[]),m=!!Object.values(o).find(e=>e),_=!!Object.values(s).find(e=>e);return(0,i.jsx)(t,{isDirty:m,isInvalid:_,formStates:o,setFormDirty:d,setFormInvalid:c,...n})}}},641645(e,t,n){n.d(t,{EJ:()=>d,gy:()=>s,oP:()=>r,pi:()=>o,q8:()=>l,t:()=>a});var i=n(477909);const a=60,o=24,r=({minuteOfDay:e,use24HourFormat:t,formatMessage:n})=>{const i=Math.floor(e/60);return`${String(t?i:i%12||12).padStart(2,"0")}:${String(e%a).padStart(2,"0")}${t?"":` ${n({id:i>=12?"COMMON_PM":"COMMON_AM"})}`}`},s=(e,t,n)=>{const o=Math.max(1,Math.min(60,Math.floor(60/t))),s=Math.floor(60/o);return(0,i.A)(0,24).flatMap(t=>(0,i.A)(o).map(i=>{const o=i*s;return{label:r({use24HourFormat:e,formatMessage:n,minuteOfDay:t*a+o}),value:60*t+ +o}}))},l=e=>6e4*Math.round(e/6e4),d=(e,t)=>{const n=+(e/1e3).toFixed(1),i=+(n/1e3).toFixed(1),a=+(n/6e4).toFixed(1);return n<1e3?`${n} ${t({id:"COMMON_UNIT_MS"})}`:i<60?`${i} ${t({id:"COMMON_UNIT_S"})}`:`${a} ${t({id:"COMMON_UNIT_MIN"})}`}}}]);