"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[58257],{639188(e,t,n){n.d(t,{VG:()=>l,Vm:()=>a,z7:()=>r});const l=80,r="22:00",a="08:00"},889764(e,t,n){n.d(t,{H5:()=>c,Lq:()=>o,n0:()=>i});var l=n(849513),r=n(276907),a=n(919952);const i=e=>e[a.U.SHARED][r.N.PROPERTY_PANEL]?.[l.Io.TAB_GET_DATA_FUNCTION]||{},o=e=>e[a.U.SHARED][r.N.PROPERTY_PANEL]?.[l.Io.TAB_SUBMIT_FUNCTION]||{},c=e=>e[a.U.SHARED][r.N.PROPERTY_PANEL]?.[l.Io.TAB_RESET_FUNCTION]||{}},998386(e,t,n){n.d(t,{H:()=>a,v:()=>r});var l=n(765562);const r=e=>`${l.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,a=e=>`${l.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`},624657(e,t,n){n.d(t,{A:()=>g});var l=n(296540),r=n(951272),a=n(469733),i=n(82960),o=n(845030),c=n(678419),s=n(934969),m=n(92069),d=n(256896),_=n(505102),u=n(694595),E=n(757666);const A=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:t})=>({powerSupervisor:(0,d.f)(e,(0,u.lD)(t,e))}),handleSubmit:(e,{resetForm:t})=>t({values:e}),validationSchema:_.A}),g=(0,i.Zz)((0,a.connect)((e,{device:{mac:t}})=>({powerSupervisor:(0,c.x0)(t)(e)})))(A(({powerSupervisor:e,device:t,setFormDirty:n,setFormInvalid:r,validateForm:i,values:c,resetForm:d,dirty:_,isValid:u,formName:A=m.r8})=>{const g=(0,a.useDispatch)();return(0,l.useEffect)(()=>(g((0,o.uo)({[A]:()=>({})})),g((0,o.Oo)({[A]:()=>{i().then(t=>{Object.keys(t).length||g((0,E.A)(e?.id,c.powerSupervisor))})}})),g((0,o.rW)({[A]:d})),()=>{g((0,o.uo)({[A]:null})),g((0,o.Oo)({[A]:null})),g((0,o.rW)({[A]:null}))}),[g,d,c,A]),(0,l.useEffect)(()=>{n?.(A,_),r?.(A,!u)},[n,_,r,u,A]),l.createElement(s.wf,{device:t},l.createElement(s.Rb,{device:t}))}))},505102(e,t,n){n.d(t,{A:()=>a,q:()=>r});var l=n(870443);const r=l.A.object().shape({power_sources:l.A.array().transform(e=>e.filter(e=>e.power_source_mac)).of(l.A.object().shape({client_psu_index:l.A.number().required(),power_source_mac:l.A.string().label("COMMON_POWER_SOURCE").required(),power_source_index:l.A.string().label("COMMON_OUTLET").required()})).label("COMMON_POWER_SOURCE").min(1)}).optional(),a=l.A.object().shape({powerSupervisor:r})},152e3(e,t,n){n.d(t,{A:()=>C});var l=n(296540),r=n(436017),a=n(217439),i=n(314714),o=n(592563),c=n(71479),s=n(469733),m=n(180524),d=n(566723),_=n(349107),u=n(294303),E=n(916537),A=n(302167),g=n(457311),h=n(446367),b=n(998386);const O=(0,c.A)("div")`
  width: 100%;
  margin-bottom: ${d.Ln};
`,p=()=>{const e=(0,s.useSelector)(A.zu);return{isOrchestrated:(0,l.useMemo)(()=>(0,h.A)(e),[e]),globalSwitchSettings:e}},v=({globalSwitchSettings:e,children:t})=>{const n=(0,s.useDispatch)(),r=(0,l.useCallback)(()=>{n((0,g.Np)("global_network")).then(e=>{(e?.data?.setting_keys||[]).length>0&&n((0,g.Uc)(void 0,{resolveWithExisting:!1}))})},[n]);return l.createElement(m.A,{placement:"top start",description:l.createElement(u.A,{flexDirection:"column",width:"100%"},l.createElement(E.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS_MANAGED_BY_FABRIC"}),l.createElement(u.A,{gap:d.YC,alignItems:"baseline"},l.createElement(_.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,b.v)(e.cloud_template)}),l.createElement(a.A,{style:{textTransform:"lowercase"},size:"small"},l.createElement(E.sA,{id:"COMMON_OR"})),l.createElement(o.A,{variant:"destructive",fontSize:"inherit",onClick:r},l.createElement(E.sA,{id:"COMMON_DETACH"}))))},l.createElement("div",null,t))},C={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,noStyledRow:n})=>{const{isOrchestrated:i,globalSwitchSettings:o}=p(),c=(0,l.useCallback)(({target:{checked:e}})=>{t(e)},[t]),s=l.createElement(r.A,{full:!0,checked:e,onChange:c,disabled:i},l.createElement(u.A,{width:"100%",alignItems:"center"},l.createElement(a.A,{size:"medium",color:i?"disabled":void 0},l.createElement(E.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})))),m=n?s:l.createElement(O,null,s);return i?l.createElement(v,{globalSwitchSettings:o},m):m},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,onChange:n,noStyledRow:r})=>{const{isOrchestrated:o,globalSwitchSettings:c}=p(),s=(0,l.useCallback)(({target:{checked:e}})=>{t(e),n?.(e)},[n,t]),m=l.createElement(i.A,{id:"global-switch-settings-checkbox",checked:e,onChange:s,disabled:o},l.createElement(a.A,{size:"medium",color:o?"disabled":void 0},l.createElement(E.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"}))),d=r?m:l.createElement(O,null,m);return o?l.createElement(v,{globalSwitchSettings:c},d):d}}},389651(e,t,n){n.d(t,{A:()=>b});var l=n(469733),r=n(296540),a=n(951272),i=n(217439),o=n(71479),c=n(834042),s=n(566723),m=n(143811),d=n(916537),_=n(198494),u=n(766624),E=n(294303);const A=(0,o.A)(E.A)`
  margin-bottom: 24px;
`,g=e=>{const[t,n]=e.split(":");return 60*Number(t)+Number(n)},h=e=>`${Math.floor(e/c.t).toString().padStart(2,"0")}:${(e%c.t).toString().padStart(2,"0")}`,b=(0,r.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:t},setFieldValue:n}=(0,a.j7)(),{formatMessage:o}=(0,d.tz)(),b=(0,l.useSelector)(_.jc),O=(0,r.useMemo)(()=>(0,c.gy)(b,15,o),[b,o]),p=(0,r.useMemo)(()=>"string"==typeof e?g(e):e,[e]),v=(0,r.useMemo)(()=>"string"==typeof t?g(t):t,[t]),C=(0,r.useCallback)(({value:e})=>{n("lcm_night_mode_begins",h(+e))},[n]),I=(0,r.useCallback)(({value:e})=>{n("lcm_night_mode_ends",h(+e))},[n]);return!p&&0!==p||!v&&0!==v?null:r.createElement(r.Fragment,null,r.createElement(E.A,{justifyContent:"flex-start",marginBottom:s.kc,alignItems:"center",gap:s.YC},r.createElement(i.A,{color:"text-1",size:"medium"},r.createElement(d.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})),r.createElement(u.A,{description:r.createElement(d.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})})),r.createElement(A,{justifyContent:"space-between",flexDirection:"column"},r.createElement(E.A,{gap:s.Ln},r.createElement(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:O.some(({value:e})=>e===p)?void 0:(0,c.oP)({formatMessage:o,minuteOfDay:p,use24HourFormat:b}),translatePlaceholder:!1,options:O,value:p,onChange:C,full:!0}),r.createElement(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:O.some(({value:e})=>e===v)?void 0:(0,c.oP)({formatMessage:o,minuteOfDay:v,use24HourFormat:b}),translatePlaceholder:!1,options:O,value:v,onChange:I,full:!0}))))})},949810(e,t,n){n.d(t,{A:()=>C});var l=n(296540),r=n(217439),a=n(822336),i=n(823858),o=n(618983),c=n(71479),s=n(566723),m=n(294303),d=n(916537),_=n(170163),u=n(780811),E=n(837612),A=n(799552),g=n(377588),h=n(406816);const b=(0,c.A)("div")`
  display: flex;
  flex-direction: column;
`,O=(0,c.A)("div")`
  margin-top: ${s.Ln};
  padding-top: ${s.Ln};
  border-top: ${({theme:{themeName:e}})=>a.Ay[`desktop-border-divider-${e}`]};

  div:first-child {
    margin-bottom: ${s.xO};
  }
`,p=(0,c.A)(i.A)`
  color: ${({theme:{themeName:e}})=>a.Ay[`desktop-color-orange-06-${e}`]};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,v=(0,c.A)(o.A)`
  color: ${({theme:{themeName:e}})=>a.Ay[`desktop-color-green-06-${e}`]};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,C=({activeItem:e,activeItem:{outlet_table:t,outlet_ac_power_budget:n,outlet_ac_power_consumption:a,port_table:i},hidePorts:o,noDivider:c,gap:C=s.xO,legend:I,verticalLegend:S,tooltipPlacement:f="bottom end"})=>{const{usedPower:M,maxPower:N}=(0,l.useMemo)(()=>(0,_.hf)({outlet_table:t,outlet_ac_power_budget:n,outlet_ac_power_consumption:a}),[t,n,a]),y=(0,u.Tl7)(e)||(0,u.kYz)(e);return l.createElement(b,null,l.createElement(m.A,{justifyContent:"center",gap:C,alignItems:S?"center":void 0},l.createElement(m.A,{flexDirection:"column"},l.createElement(g.A,{disableOnPortClick:!0,activeItem:e,tooltipPlacement:f,isEU:(0,u.goQ)(e),offline:(0,u.aK8)((0,E.S9)(e))})),i&&!o?l.createElement("div",null,l.createElement(A.A,{activeItem:e,portSizeOverride:"19px",disableOnPortClick:y})):null,S),S?null:I||l.createElement(h.Ay,{activeItem:e,noTopBorder:c}),M>N?l.createElement(O,null,l.createElement(m.A,{justifyContent:"space-between"},l.createElement(p,null),l.createElement(r.A,{size:"small"},l.createElement(d.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_WARNING"}))),l.createElement(m.A,{justifyContent:"space-between"},l.createElement(v,null),l.createElement(r.A,{size:"small"},l.createElement(d.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_INFO"})))):null)}},279675(e,t,n){n.d(t,{W:()=>D,A:()=>F});var l=n(82960),r=n(469733),a=n(296540),i=n(951272),o=n(429252),c=n.n(o),s=n(802),m=n(217439),d=n(71479),_=n(870443),u=n(566723),E=n(766624),A=n(389651),g=n(822336),h=n(870829),b=n(311785),O=n(294303),p=n(916537);const v=[0,90,180,270],C=(0,d.A)(O.A,(0,b.A)("isActive"))`
  border: 1px solid
    ${({theme:{themeName:e},isActive:t})=>t?g.Ay[`desktop-color-ublue-06-${e}`]:g.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${g.Ay["desktop-radius-base"]};
  cursor: pointer;
`,I=(0,d.A)(h.A,(0,b.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,S=({degree:e,isActive:t,onClick:n})=>a.createElement(C,{padding:`${u.YC} ${u.kc}`,flex:1,gap:u.YC,alignItems:"center",isActive:t,onClick:n},a.createElement(I,{isActive:t,degree:e}),a.createElement(m.A,{color:"text-2"},e?`${e}°`:a.createElement(p.sA,{id:"COMMON_NONE"}))),f=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,i.j7)();return a.createElement("div",null,a.createElement(m.A,{color:"text-3",size:"small"},a.createElement(p.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})),a.createElement(O.A,{gap:u.kc,marginTop:u.YC,marginBottom:u.Ln},v.map(n=>a.createElement(S,{key:n,degree:n,isActive:n===e,onClick:()=>{t("lcm_orientation_override",n)}}))))};var M=n(143811),N=n(845030),y=n(302167),T=n(457311),R=n(602021),w=n(639188);const D="lcmScreen",P=(0,d.A)(O.A)`
  &:not(:last-child) {
    margin-bottom: ${u.S2};
  }
`,k=(0,i.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:n=w.VG,lcm_brightness_override:l=!1,lcm_night_mode_enabled:r=!1,lcm_night_mode_begins:a=w.z7,lcm_night_mode_ends:i=w.Vm,lcm_orientation_override:o}})=>({lcm:e,lcm_brightness:n,lcm_brightness_override:l,lcm_night_mode_enabled:r,lcm_night_mode_begins:a,lcm_night_mode_ends:i,..."lcm_orientation_override"in t?{lcm_orientation_override:o}:{}}),validationSchema:_.A.object().shape({lcm:_.A.object().shape({sync:_.A.boolean()}),lcm_brightness_override:_.A.boolean(),lcm_brightness:_.A.number().label("COMMON_BRIGHTNESS").min(1).max(100).required(),lcm_night_mode_enabled:_.A.boolean(),lcm_night_mode_begins:_.A.string(),lcm_night_mode_ends:_.A.string(),lcm_orientation_override:_.A.number()}),handleSubmit:()=>null}),x=e=>a.createElement(m.A,{size:"medium"},e),F=(0,l.Zz)((0,r.connect)(e=>({lcmSettings:(0,y.ml)(e)}),{}),k)(({values:e,setFieldValue:t,resetForm:n,setFormDirty:l,setFormInvalid:i,dirty:o,isValid:d,initialValues:_,activeItem:g,hideRackMultiScreenSync:h=!1})=>{const b=(0,r.useDispatch)(),v=(0,r.useSelector)(R.EL);return(0,a.useEffect)(()=>{l(D,o),i(D,!d)},[l,i,d,o]),(0,a.useEffect)(()=>(b((0,N.uo)({[D]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==w.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,N.Oo)({[D]:()=>{c()(_.lcm,e.lcm)||b((0,T.vd)(e.lcm)),n({values:e})}})),b((0,N.rW)({[D]:n})),()=>{b((0,N.uo)({[D]:null})),b((0,N.Oo)({[D]:null})),b((0,N.rW)({[D]:null}))}),[b,n,e,_.lcm]),a.createElement(a.Fragment,null,a.createElement(P,{justifyContent:"space-between"},a.createElement(m.A,{color:"text-1",size:"medium"},a.createElement(p.sA,{id:"COMMON_BRIGHTNESS"})),a.createElement(s.A,{width:"50%",value:e.lcm_brightness||w.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:x,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:v})),"lcm_orientation_override"in g?a.createElement(f,null):null,a.createElement(A.A,null),h?null:a.createElement(P,{justifyContent:"space-between",alignItems:"center"},a.createElement(O.A,{alignItems:"center",gap:u.kc},a.createElement(O.A,{alignItems:"center"},a.createElement(M.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),a.createElement(m.A,{color:"text-1",size:"medium"},a.createElement(p.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"}))),a.createElement(E.A,{description:a.createElement(p.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})}))))})},858257(e,t,n){n.r(t),n.d(t,{default:()=>T});var l=n(82960),r=n(469733),a=n(296540),i=n(592510),o=n(742920),c=n(422969),s=n(449688),m=n(96512),d=n(86571),_=n(689965),u=n(675359),E=n(302167),A=n(457311),g=n(889764),h=n(347524),b=n(171073),O=n(624657),p=n(279675),v=n(949810),C=n(329109),I=n(152e3),S=n(45062),f=n(943089),M=n(263262),N=n(956619),y=n(89124);const T=(0,l.Zz)((0,s.A)([y.UH,p.W,S.q,M.g]))(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:l,isInvalid:s})=>{const T=(0,r.useSelector)(g.n0),R=(0,r.useSelector)(g.Lq),w=(0,r.useSelector)(g.H5),D=(0,r.useSelector)(E.zu),P=(0,r.useDispatch)(),[k,x]=(0,a.useState)(!D.switch_exclusions?.includes(e.mac)),F=(0,m.I)(),L=l||k!==!D.switch_exclusions?.includes(e.mac),$=(0,a.useCallback)(async()=>{if(k!==!D.switch_exclusions?.includes(e.mac)){const t=D.switch_exclusions.filter(t=>t!==e.mac);k||t.push(e.mac);try{await P((0,A.OD)({...D,switch_exclusions:t}))}catch{return void P((0,u.ox)({icon:o.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}}const t=Object.entries(T).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},{}),{lcm:n,...l}=t;P((0,b.ex)(l,e._id,e.mac,{extend:!0})).then(()=>{Object.values(R).forEach(e=>{"function"==typeof e&&e()})}).catch(F)},[k,D,e.mac,e._id,T,P,F,R]),V=(0,a.useCallback)(()=>{x(!D.switch_exclusions?.includes(e.mac)),Object.values(w).forEach(e=>{"function"==typeof e&&e()})},[D.switch_exclusions,e.mac,w]);return(0,c.A)([(0,h.u)(void 0,{crudCacheStrategy:{type:i.e.CACHE}})],a.createElement(a.Fragment,null,a.createElement(y.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n}),a.createElement(_.A,{type:_.I.ACCORDION,items:[{id:"outlets",openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_OUTLETS"}),renderContent:()=>a.createElement(a.Fragment,null,a.createElement(v.A,{activeItem:e,hidePorts:!0}),a.createElement(f.A,{hidePorts:!0,activeItem:e}))}]}),a.createElement(_.A,{type:_.I.ACCORDION,items:[{id:p.W,openByDefault:!0,label:a.createElement(d.A,{id:"DEVICE_PROPERTY_HEADER_TOUCHSCREEN"}),renderContent:()=>a.createElement(p.A,{activeItem:e,setFormDirty:t,setFormInvalid:n})}]}),a.createElement(_.A,{type:_.I.ACCORDION,items:[{id:S.q,openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_SERVICES"}),renderContent:()=>a.createElement(a.Fragment,null,a.createElement(I.A.Toggle,{isGlobalSwitchSettingsEnabled:k,setGlobalSwitchSettingsEnabled:x}),a.createElement(S.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,isGlobalSwitchSettingsEnabled:k}))}]}),a.createElement(O.A,{device:e,setFormDirty:t,setFormInvalid:n}),a.createElement(_.A,{type:_.I.ACCORDION,items:[{id:M.g,openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>a.createElement(M.A,{activeItem:e,setFormDirty:t,setFormInvalid:n})}]}),a.createElement(_.A,{type:_.I.ACCORDION,items:[{id:"manage",openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>a.createElement(N.A,{activeItem:e})}]}),a.createElement(C.A,{isDirty:L,isInvalid:s,onFormSubmit:$,onFormCancel:V})))})},449688(e,t,n){n.d(t,{A:()=>r});var l=n(296540);const r=function(e){return t=>n=>{const[r,a]=(0,l.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[i,o]=(0,l.useState)(Object.fromEntries(e.map(e=>[e,!1]))),c=(0,l.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[]),s=(0,l.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),m=!!Object.values(r).find(e=>e),d=!!Object.values(i).find(e=>e);return l.createElement(t,{isDirty:m,isInvalid:d,formStates:r,setFormDirty:c,setFormInvalid:s,...n})}}},834042(e,t,n){n.d(t,{EJ:()=>s,gy:()=>o,oP:()=>i,pi:()=>a,q8:()=>c,t:()=>r});var l=n(621690);const r=60,a=24,i=({minuteOfDay:e,use24HourFormat:t,formatMessage:n})=>{const l=Math.floor(e/60);return`${String(t?l:l%12||12).padStart(2,"0")}:${String(e%r).padStart(2,"0")}${t?"":` ${n({id:l>=12?"COMMON_PM":"COMMON_AM"})}`}`},o=(e,t,n)=>{const a=Math.max(1,Math.min(60,Math.floor(60/t))),o=Math.floor(60/a);return(0,l.A)(0,24).flatMap(t=>(0,l.A)(a).map(l=>{const a=l*o;return{label:i({use24HourFormat:e,formatMessage:n,minuteOfDay:t*r+a}),value:60*t+ +a}}))},c=e=>6e4*Math.round(e/6e4),s=(e,t)=>{const n=+(e/1e3).toFixed(1),l=+(n/1e3).toFixed(1),r=+(n/6e4).toFixed(1);return n<1e3?`${n} ${t({id:"COMMON_UNIT_MS"})}`:l<60?`${l} ${t({id:"COMMON_UNIT_S"})}`:`${r} ${t({id:"COMMON_UNIT_MIN"})}`}}}]);