"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[40463],{15532:(e,t,a)=>{a.d(t,{A:()=>i});var r=a(296540),n=a(927099),o=a(699784),l=a(360113);const i=({has_fan:e,fan_level:t})=>e&&Number.isFinite(t)?r.createElement(l.A,null,r.createElement(n.A,{color:"secondary",size:"body"},r.createElement(o.sA,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_LEVEL"})),r.createElement(n.A,{color:"tertiary",size:"body"},t)):null},32753:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(296540),n=a(927099),o=a(699784),l=a(780811),i=a(360113);const c=({systemStatsMem:e,compact:t=!1})=>{const a=(0,l.HBQ)(e);return a?r.createElement(i.A,{compact:t},r.createElement(n.A,{color:"secondary",size:"body"},r.createElement(o.sA,{id:"DEVICE_PROPERTY_OVERVIEW_MEMORY_USAGE"})),r.createElement(n.A,{color:"tertiary",size:"body"},a,"%")):null}},45481:(e,t,a)=>{a.d(t,{A:()=>m});var r=a(296540),n=a(271856),o=a(927099),l=a(888170),i=a(823858),c=a(699784),s=a(360113);const m=({has_temperature:e,overheating:t,general_temperature:a})=>e&&Number.isFinite(a)?r.createElement(s.A,null,r.createElement(o.A,{color:"secondary",size:"body"},r.createElement(c.sA,{id:"COMMON_TEMPERATURE"})),r.createElement(o.A,{color:"tertiary",size:"body"},r.createElement(r.Fragment,null,r.createElement(c.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:a}}),t?r.createElement(n.A,{description:r.createElement(c.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_OVERHEATING"}),width:180,position:"left",className:"ml-1",style:{display:"inline-block",verticalAlign:"text-bottom"}},r.createElement(i.A,{style:{color:l.Ay["color-danger"]}})):null))):null},56437:(e,t,a)=>{var r,n;a.d(t,{c:()=>n,e:()=>r}),function(e){e.INITIALIZING="initializing",e.DISCONNECTED="disconnected",e.SEARCHING="searching",e.BOUND="bound",e.STANDBY="standby",e.POWER_DELIVERING="power_delivering",e.OUT_OF_POWER_BUDGET="out_of_power_budget",e.POWER_OVERLOAD="power_overload",e.BLOCKED="blocked"}(r||(r={})),function(e){e.AUTO="auto",e.MANUAL="manual",e.DISABLED="disabled"}(n||(n={}))},71265:(e,t,a)=>{a.d(t,{R:()=>E,k:()=>_});var r=a(280258),n=a(190497),o=a(953048),l=a(175522),i=a(936621),c=a(305988);const s=[...new Set([r.H,l.Q.join(l.A),o.Zt,i.F,n.nc,c.Vr])],m={numeric:!0,sensitivity:"base"},E=(e,t)=>{const a=[];for(let r=e;r<=t;r+=1)a.push({value:r,label:String(r)});return a},_=e=>({value:t,label:a},{value:r,label:n})=>s.includes(t?.toString())||s.includes(r?.toString())?1/0:a?.toString().localeCompare(n?.toString(),e,m)??-1},124092:(e,t,a)=>{a.d(t,{A:()=>R});var r=a(469733),n=a(296540),o=a(962926),l=a(705145),i=a(71479),c=a(132196),s=a(6510),m=a(130851),E=a(566723),_=a(294303),d=a(6176);const p=c.AH`
  margin-bottom: ${E.Ln};
  margin-top: ${E.Ln};
`,u=(0,i.A)("div")`
  align-self: center;
  overflow: hidden;
  word-break: break-word;
`,A=(0,i.A)("img")`
  width: 40px;
  height: 40px;
  object-fit: contain;
`,R=({children:e,description:t,meshingDescription:a,isOffline:i,activeItem:R,style:T,className:v,isStacking:g})=>{const f=(0,r.useSelector)(m.p);return n.createElement(o.A,{className:(0,c.cx)(p,v),sections:[n.createElement("div",null,n.createElement(_.A,{gap:E.kc},g?n.createElement(A,{src:`${f}/topology/stacking.png`,alt:"stacked"}):n.createElement(d.A,{model:R.model,width:40,height:40}),n.createElement(u,{style:T},n.createElement(l.A,{color:i?"text-3":"text-1",weight:"bold",isTruncated:!0},(0,s.Lm)(R.model)),t)),a,e)]})}},136283:(e,t,a)=>{a.d(t,{A:()=>R});var r=a(296540),n=a(903992),o=a(793336),l=a(722860);const i=(0,l.c)(n.A),c=r.memo(({headerIcon:e,title:t,motif:a="light"})=>{if(!e&&!t)return null;const o=e;return r.createElement("div",{className:i("title",`title-${a}`)},void 0!==o&&(l=o,c={className:n.A.headerIcon},r.isValidElement(l)?r.cloneElement(l,c):l?r.createElement(l,c):null),t);var l,c}),s=(0,l.c)(n.A),m=r.memo(({className:e,header:t,headerIcon:a,title:n,onRequestClose:l,motif:i,closeIconProps:m})=>{if(void 0!==t){if(r.isValidElement(t))return r.cloneElement(t);{const a=t;return r.createElement(a,{className:e,onRequestClose:l})}}return r.createElement("header",{className:s.concat(e)("header",n&&"hasTitle")},r.createElement(c,{headerIcon:a,title:n,motif:i}),void 0!==l&&r.createElement("button",{onClick:l,className:s("closeButton"),type:"button"},r.createElement(o.A,{...m,actionable:!0,motif:i,className:s("closeIcon",`closeIcon-${i}`)})))});var E=a(325898),_=a(758649),d=a(676933);const p=(0,l.c)(n.A),u=r.memo(e=>{const{className:t,footer:a,actions:o,onRequestClose:l,motif:i}=e,{motif:c}=(0,E.A)(i);if(a){if(r.isValidElement(a))return r.cloneElement(a,{onRequestClose:l});{const e=a;return r.createElement(e,{className:t,onRequestClose:l})}}if(!o)return null;const s=({text:e,ref:t,...a},n)=>r.createElement(_.A,{ref:t,key:n,motif:c,...a},e),m=[];return o.forEach((e,t)=>{Array.isArray(e)?(t&&m.push(r.createElement("div",{key:`spacer-${t}`,className:n.A.footerActionSpacer})),m.push(...e.map((e,a)=>s(e,`${t}_${a}`)))):m.push(s(e,t.toString()))}),r.createElement("footer",{className:p.concat(t)("footer",`footer-${c}`)},r.createElement(d.A,{className:n.A.footerButtonGroup},m))}),A=(0,l.c)(n.A),R=e=>{const{headerClassName:t,contentClassName:a,footerClassName:n,className:o,overlayClassName:l,rendererClassName:i,...c}=e,{actions:s,allowOverflow:_,children:d,flushContent:p,footer:R,header:T,motif:v,title:g}=c,{motif:f}=(0,E.A)(v);return r.createElement(r.Fragment,null,r.createElement(m,{className:t,...c,motif:f}),r.createElement("div",{className:A.concat(a)("content",`content-${f}`,p&&"content-flush",!T&&!g&&!p&&"content-noHeader",!R&&!s&&!p&&"content-noFooter",_&&"content-allowOverflow")},d),r.createElement(u,{className:n,...c}))}},167579:(e,t,a)=>{a.d(t,{A:()=>r});const r=[12,54]},170163:(e,t,a)=>{a.d(t,{ST:()=>R,FP:()=>T,o3:()=>_,Z4:()=>f,Ib:()=>A,I:()=>d,F9:()=>y,eV:()=>b,Yk:()=>I,y$:()=>N,AD:()=>C,Yf:()=>h,eq:()=>g,hf:()=>v});var r=a(847439),n=a(967431),o=a(101617),l=a(860631),i=a(325752),c=a(953394),s=a(56437),m=a(167579);var E=a(557260);const _=(e,t=0,a=void 0)=>{let r=(e.outlet_table||[])[t]||{index:t,has_relay:!1,has_metering:!1,relay_state:!1,cycle_enabled:!1},n=(e.outlet_overrides||[])[t]||{};return void 0!==a&&(r=(e.outlet_table||[]).find(e=>e.index===a),n=(e.outlet_overrides||[]).find(e=>e.index===a)),(0,l.sQ)(e,E.A.AUTO_RELAY)&&e.vbms_table?.battpool?{...r}:{...r,...n}},d=(e,t)=>e&&Object.keys(e).find(a=>e[a]&&e[a].includes(t))||c.s.STANDARD,p=(e,t)=>{return(o[e]?.outlets?.meta||{})[(a=t,a.toString().padStart(2,"0"))]||{};var a},u=e=>{if(e){if(Array.isArray(e))return e;let t;const a=String(e);if(/^[0-9]+$/.test(a)?t={start:0,end:parseInt(a,10)}:/^([0-9]+)-([0-9]+)$/.test(a)&&(t={start:parseInt(a.split("-")[0],10),end:parseInt(a.split("-")[1],10)}),t)return(0,r.A)(t.end-t.start+1,e=>e+t.start)}return[]},A=e=>{const t=o[e]?.outlets;return{[c.s.STANDARD]:u(t?.[c.s.STANDARD]),[c.s.USB]:u(t?.[c.s.USB]),[c.s.LAN]:u(t?.[c.s.LAN]),[c.s.RJ45]:u(t?.[c.s.RJ45]),[c.s.WAN]:u(t?.[c.s.WAN]),[c.s.SURGE]:u(t?.[c.s.SURGE])}},R=(e,t)=>{const a=A(t);let n=2;e<=5&&(n=1);const o=Math.ceil(e/n);return(0,r.A)(n,e=>(0,r.A)(o,r=>{const o=r*n+e+1,l=d(a,o),i=p(t,o);return o?{outletNumber:o,outletType:l,iconRotation:i.rotation,centerIcon:i.center,portIdx:i.portIdx,nonClickable:i.nonClickable,marginLeft:i.marginLeft}:void 0}))},T=(e,t)=>{const a=A(t);return e.map(e=>e.split(" ").map(e=>{const r=e.split("-"),n=parseInt(r[0],10);if(Number.isNaN(n))return;const{rotation:o,center:l,portIdx:i,nonClickable:s,marginLeft:m,surgeType:E,vertical:_}=p(t,n);return{outletNumber:n,outletType:d(a,n),iconRotation:o,centerIcon:l,portIdx:i,nonClickable:s,surgeType:E,marginLeft:m,subOutlets:r.length>1?r.map(e=>"__"===e?void 0:parseInt(e,10)):void 0,vertical:_,showBatteryPowered:Boolean(a[c.s.STANDARD]?.length&&a[c.s.SURGE]?.length)}}))},v=({outlet_table:e=[],outlet_ac_power_budget:t=String(1875),outlet_ac_power_consumption:a=String(0)})=>{const r=(0,n.A)(Number(t),2),o=(0,n.A)(Number(a),2);let l=0;e.forEach(({outlet_current:e})=>{l+=Number(e)||0});const i={usedPower:o,maxPower:r,totalCurrent:(0,n.A)(l,2),usedPowerPercentage:o/r*100,barVariant:"primary"};return i.usedPowerPercentage>81&&(i.barVariant="warning"),i},g=(e,t)=>{if(t)switch(e.index){case 1:return 3;case 2:return 4;case 3:return 1;case 4:return 2}},f=({rps:e,rps_override:t},a=0)=>({...(e?.rps_port_table||[]).find(e=>e?.port_idx===a)||{},...(t?.rps_port_table||[]).find(e=>e?.port_idx===a)||{}}),h=e=>{switch(!0){case e?.port_state===s.e.OUT_OF_POWER_BUDGET:case e?.port_state===s.e.BLOCKED:case e?.anomalies>0:return i.FZ.WARNING;case e?.power_delivering:return i.FZ.POWER_DELIVERING;case e?.high_priority:return i.FZ.HIGH_PRIORITY;default:return}},I=e=>{const t=[];return e.port_mode===s.c.DISABLED||([s.e.OUT_OF_POWER_BUDGET,s.e.BLOCKED].includes(e?.port_state)||e?.anomalies>0?t.push(i.FZ.WARNING):(e?.power_delivering&&t.push(i.FZ.POWER_DELIVERING),e?.high_priority&&t.push(i.FZ.HIGH_PRIORITY),(e?.power_12v_batt_guard||e?.power_54v_batt_guard)&&t.push(i.FZ.BATTERY_PROTECTED))),t},C=e=>e?.anomalies&&0!==e?.anomalies||e?.port_error_disabled?"red06":e.port_state===s.e.OUT_OF_POWER_BUDGET?"neutral00":e?.power_active||e.port_mode===s.c.DISABLED?e?.power_active&&e.port_mode!==s.c.DISABLED?"success":e.port_mode===s.c.DISABLED?"":"neutral04":"neutral07",N=e=>{if(!(e?.anomalies&&0!==e?.anomalies||e?.port_error_disabled))return e.port_state===s.e.OUT_OF_POWER_BUDGET?"neutral05":e.port_mode===s.c.DISABLED?"neutral04":void 0},O=(e,t)=>({id:t?.port_idx,peer:t?.peer,powerRequired:t?.port_state===s.e.STANDBY?Number(t?.peer?.[`power_required_${e}v`]||0):Number(t?.[`power_${e}v_power`]||0)}),y=e=>m.A.map(t=>{const a={voltage:t,utilizationActive:!1,backup:{sum:0,total:0,ports:[]},delivering:{sum:0,total:0,ports:[]}};return(e?.rps_port_table||[]).forEach(e=>{e?.port_state===s.e.STANDBY&&e?.peer[`power_required_max_${t}v`]>0&&(a.backup.ports.push(O(t,e)),a.backup.sum+=e?.peer[`power_required_${t}v`]||0),e?.port_state===s.e.POWER_DELIVERING&&e?.[`power_${t}v_power`]>0&&a.delivering.ports.push(O(t,e))}),a.backup.total=Math.max(e?.[`power_supply_${t}v`],a.backup.sum),a.delivering.sum=e?.[`power_delivering_${t}v`],a.delivering.total=e?.[`power_supply_${t}v`],(a.delivering.sum||a.backup.sum)&&(a.utilizationActive=!0),a}),b=(e,t)=>{const a=y(e),r=t?.[0]?.relay_state?+(t?.[0]?.outlet_power||0):0,n=a.findIndex(e=>e.voltage===m.A[1]);return r&&n>-1&&(a[n].utilizationActive=!0,a[n].delivering.sum+=r,a[n].delivering.outlet={id:"1",powerRequired:r}),a}},175522:(e,t,a)=>{a.d(t,{A:()=>n,Q:()=>o});var r=a(416348);const n="_",o=[r.ZM,r.Je]},205830:(e,t,a)=>{a.d(t,{A:()=>E});var r=a(296540),n=a(217439),o=a(83438),l=a(566723),i=a(294303),c=a(699784),s=a(780811),m=a(360113);const E=({sys_stats:e,flexProps:t,withTooltip:a,compact:E=!1})=>{const _=(0,s.eiG)(e);return _?r.createElement(m.A,{flexProps:t,compact:E},r.createElement(n.A,{color:"text-2",size:"medium"},r.createElement(c.sA,{id:"COMMON_LOAD_AVERAGE"})),a?r.createElement(i.A,{alignItems:"center",gap:l.YC},r.createElement(n.A,{color:"text-3",size:"medium"},_),r.createElement(o.A,{description:r.createElement(c.sA,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE_TOOLTIP"}),placement:"top left"})):r.createElement(n.A,{color:"text-3",size:"medium"},_)):null}},211908:(e,t,a)=>{a.d(t,{A:()=>U});var r=a(469733),n=a(296540),o=a(353899),l=a(758649),i=a(742920),c=a(421130),s=a(675359),m=a(699784),E=a(801081),_=a(25553),d=a(87485),p=a(264963);const u=e=>(0,E.Mz)((e=>(0,_.uh)((0,p.lX)({queryParams:{mac:e}})))(e),e=>(0,d.i6)(e)?.devices||[]);var A,R,T=a(768195),v=a(546391);!function(e){e.EXISTING="existing",e.NEW="new"}(A||(A={})),function(e){e.MAC="mac",e.TYPE="type",e.MODEL="model"}(R||(R={}));var g,f=a(238761),h=a(271856),I=a(438628),C=a(162420),N=a(400261),O=a(874807);!function(e){e.DEVICE_REPLACEMENT_MODE="deviceReplacementMode",e.SET_DEVICE_REPLACEMENT_MODE="setDeviceReplacementMode",e.NEW_MAC="newMac",e.SET_NEW_MAC="setNewMac",e.EXISTING_MAC="existingMac",e.SET_EXISTING_MAC="setExistingMac",e.REPLACEMENT_CANDIDATES="replacementCandidates",e.ERROR="error",e.RESET_ERROR="resetError"}(g||(g={}));const y={[g.DEVICE_REPLACEMENT_MODE]:void 0,[g.SET_DEVICE_REPLACEMENT_MODE]:O.P1,[g.NEW_MAC]:void 0,[g.SET_NEW_MAC]:O.P1,[g.EXISTING_MAC]:void 0,[g.SET_EXISTING_MAC]:O.P1,[g.REPLACEMENT_CANDIDATES]:[],[g.ERROR]:void 0,[g.RESET_ERROR]:O.P1},b=(0,n.createContext)(y);const L=a(132196).AH`
  height: 54px;
`;var D=a(71479),B=a(566723),M=a(294303);const k=(0,D.A)(M.A)`
  align-items: center;
  gap: ${B.YC};
`,S=(0,n.memo)(()=>{const{newMac:e,setNewMac:t,error:a,resetError:r}=(0,n.useContext)(b),o=(0,n.useCallback)(({target:{value:e}})=>{t((0,N.Z)(e)),r()},[t,r]);return n.createElement(I.A,{className:L,value:e,onChange:o,onFocus:r,variant:"secondary",label:n.createElement(k,null,n.createElement(m.sA,{id:"COMMON_MAC_ADDRESS"}),n.createElement(h.A,{portal:!0,width:"100%",maxWidth:248,description:n.createElement(m.sA,{id:"DEVICE_REPLACEMENT_MAC_LOCATION"})},n.createElement(C.A,{isActive:!0}))),width:"100%",invalid:a})});var P=a(362412),w=a(6176);const x=(0,n.memo)(()=>{const{replacementCandidates:e,existingMac:t,setExistingMac:a,error:r,resetError:o}=(0,n.useContext)(b),l=(0,n.useMemo)(()=>e.map(({mac:e,model:t,name:a})=>({label:a,value:e,image:n.createElement(w.A,{model:t}),additionalInfo:e})),[e]),i=(0,n.useCallback)(({value:e})=>{a(String(e)),o()},[a,o]);return n.createElement(P.A.Sorted,{value:t,label:n.createElement(m.sA,{id:"COMMON_DEVICE"}),width:"100%",searchable:!0,onChange:i,onFocus:o,maxHeight:228,options:l,invalid:r})}),K=(0,D.A)(M.A)`
  flex-direction: column;
  gap: ${B.kc};
`,z=(0,n.memo)(()=>{const{replacementCandidates:e,deviceReplacementMode:t,setDeviceReplacementMode:a,resetError:r}=(0,n.useContext)(b),o=(0,n.useMemo)(()=>e.length?[{id:A.EXISTING,children:n.createElement(m.sA,{id:"COMMON_EXISTING"}),onChange:()=>{a(A.EXISTING),r()},checked:t===A.EXISTING},{id:A.NEW,children:n.createElement(m.sA,{id:"COMMON_NEW"}),onChange:()=>{a(A.NEW),r()},checked:t===A.NEW}]:[],[e.length,t,a,r]);return n.createElement(K,null,n.createElement(f.A,{direction:"row",items:o}),t===A.EXISTING?n.createElement(x,null):null,t===A.NEW?n.createElement(S,null):null)}),V=(0,D.A)(M.A)`
  align-items: center;
  gap: ${B.YC};
  width: fit-content;
`;var G=a(252093);const W={[T.gQ.INCOMPATIBLE_REPLACEMENT]:"DEVICE_REPLACEMENT_DEVICE_INCOMPATIBLE_REPLACEMENT_ERROR",[T.gQ.REPLACEMENT_ALREADY_ASSIGNED]:"DEVICE_REPLACEMENT_DEVICE_REPLACEMENT_ALREADY_ASSIGNED_ERROR"},F=({mac:e,hideTooltip:t=!1})=>{const{formatMessage:a}=(0,m.tz)(),c=(0,r.useDispatch)(),[E,_]=(0,n.useState)(!1),[d,R]=(0,n.useState)(!1),[f,h]=(0,n.useState)(A.NEW),[I,C]=(0,n.useState)(""),[N,O]=(0,n.useState)(""),[y,L]=(0,n.useState)(void 0),D=(0,r.useSelector)((0,n.useMemo)(()=>u(e),[e])),B=(0,n.useCallback)(()=>{_(!0)},[]),M=(0,n.useCallback)(()=>{_(!1),C(""),O(""),R(!1),h(A.NEW),L(void 0)},[]),k=(0,n.useCallback)(()=>{switch(f){case A.EXISTING:return N;case A.NEW:return I;default:return}},[f,N,I]),S=(0,n.useCallback)(()=>{c((0,s.ox)({icon:i.C.success,message:"DEVICE_REPLACEMENT_DEVICE_SET",duration:3e3})),M()},[c,M]),P=(0,n.useCallback)(e=>{switch(e.apiData?.replacement_state){case T.gQ.INCOMPATIBLE_REPLACEMENT:case T.gQ.REPLACEMENT_ALREADY_ASSIGNED:L(a({id:W[e.apiData.replacement_state]}));break;case T.gQ.CANNOT_REPLACE:default:c((0,s.ox)({icon:i.C.danger,message:"DEVICE_FAILED_TO_SET_REPLACEMENT_DEVICE",duration:3e3}))}},[c,a]),w=(0,n.useCallback)(()=>{R(!1)},[]),x=(0,n.useCallback)(()=>{R(!0),c((0,p.uC)(e,k())).then(S).catch(P).finally(w)},[c,S,P,e,k,w]),K=(0,n.useMemo)(()=>Boolean(k().match(v.b8)),[k]),F=(0,n.useMemo)(()=>[{text:n.createElement(m.sA,{id:"COMMON_ACTION_CANCEL"}),variant:"tertiary",onClick:M},{text:n.createElement(m.sA,{id:"COMMON_ACTION_APPLY"}),variant:"primary",onClick:x,disabled:!K||d,loader:d?"spinner":void 0}],[M,x,K,d]),U=(0,n.useCallback)(()=>{L(void 0)},[L]),$=(0,n.useMemo)(()=>({[g.DEVICE_REPLACEMENT_MODE]:f,[g.SET_DEVICE_REPLACEMENT_MODE]:h,[g.NEW_MAC]:I,[g.SET_NEW_MAC]:C,[g.EXISTING_MAC]:N,[g.SET_EXISTING_MAC]:O,[g.REPLACEMENT_CANDIDATES]:D,[g.ERROR]:y,[g.RESET_ERROR]:U}),[f,I,N,D,y,U]);return(0,n.useEffect)(()=>{c((0,p.lX)({queryParams:{mac:e}}))},[c,e]),n.createElement(b.Provider,{value:$},n.createElement(o.A,{allowOverflow:!0,title:n.createElement(m.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"}),body:n.createElement(z,null),position:"top",portal:!0,actions:F,isOpen:E,onRequestClose:M},n.createElement(V,null,n.createElement(l.A,{type:"button",variant:"inline",size:"medium",onClick:B},n.createElement(m.sA,{id:"DEVICE_SET_REPLACEMENT_DEVICE"})),t?null:n.createElement(G.A,{messageId:"DEVICE_SET_REPLACEMENT_DEVICE_DESCRIPTION",variant:"outline"}))))},U=(0,n.memo)(({model:e,type:t,...a})=>(0,c.G)({type:t,model:e})?n.createElement(F,{type:t,model:e,...a}):null)},252093:(e,t,a)=>{a.d(t,{A:()=>i});var r=a(296540),n=a(271856),o=a(162420),l=a(699784);const i=({messageId:e,tooltipClassName:t,values:a,isInteractive:i,portal:c,variant:s="twoTone",size:m="medium"})=>r.createElement(n.A,{description:r.createElement(l.sA,{id:e,values:a}),width:210,isInteractive:i,portal:c,tooltipClassName:t},r.createElement(o.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:m}))},264963:(e,t,a)=>{a.d(t,{X2:()=>d,lX:()=>E,uC:()=>_});var r=a(516693),n=a(691189),o=a(742920),l=a(887831);const i="/v2/api/site/{site}/device/:mac:",c=`${i}/replacement-candidates`,s=`${i}/replace?replacementDeviceMac=:replacement-mac:`,m=`${i}/replace`,E=(e={},t={})=>(0,n.Kd)("replacementCandidates",`${c.replace(":mac:",e.queryParams?.mac)}`,e.queryParams?.mac,e,{...t,idField:"mac"}),_=(e,t)=>a=>a((0,n.vB)(r.aC,null,null,l.A.POST,s.replace(":mac:",e).replace(":replacement-mac:",t),{},null,{})),d=e=>t=>t((0,n.vB)(r.aC,null,null,l.A.DELETE,m.replace(":mac:",e),{},null,{failureToast:()=>({icon:o.C.danger,message:"COMMON_UNKNOWN_ERROR"})}))},284428:(e,t,a)=>{a.d(t,{Im:()=>c,iL:()=>s,mQ:()=>l,pv:()=>o,q:()=>i});var r=a(296540),n=a(451449);function o(){return(0,r.useContext)(n.I)}function l(){return o().fields}function i(){return o().tooltipPopovers}function c(){return o().tooltipIcons}function s(){return o().labels}},362412:(e,t,a)=>{a.d(t,{A:()=>E});var r=a(469733),n=a(296540),o=a(436331),l=a(805837),i=a(282556),c=a(71265);const s=e=>n.createElement(o.A,{renderOption:l.q,...e}),m=e=>n.createElement(s,{...e});m.Sorted=e=>{const t=(0,r.useSelector)(i.zi),a=(0,n.useMemo)(()=>(0,c.k)(t),[t]);return n.createElement(s,{...e,sortBy:a})};const E=m},400261:(e,t,a)=>{a.d(t,{Z:()=>n});var r=a(546391);const n=e=>e?e.replace(r.SD,"").replace(r.fA,"$&:").substring(0,17).toLowerCase():e},421130:(e,t,a)=>{a.d(t,{G:()=>i});var r=a(780811),n=a(768195);const o=[n.bq.USW,n.bq.UAP],l=[n.W4.UDBA69F],i=({type:e,model:t})=>(o.includes(e)||l.includes(t))&&!(0,r.tNJ)({model:t})},451449:(e,t,a)=>{a.d(t,{I:()=>r});const r=(0,a(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},470962:(e,t,a)=>{a.d(t,{A:()=>d});var r=a(296540),n=a(217439),o=a(823858),l=a(998837),i=a(566723),c=a(224948),s=a(349107),m=a(294303),E=a(699784),_=a(765562);const d=(0,r.memo)(({children:e})=>r.createElement(c.A,{icon:r.createElement(o.A,{size:"original",color:(0,l.u)().motifPalette.warning,variant:"fill"})},r.createElement(m.A,{flexDirection:"column",gap:i.kc},r.createElement(n.A,{size:"medium",color:"text-2"},r.createElement(E.sA,{id:"COMMON_DEVICE_OFFLINE_WARNING",values:{b:E.b,link:r.createElement(s.A,{href:_.A.offlineArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}})),e)))},676933:(e,t,a)=>{a.d(t,{A:()=>o});var r=a(296540);(0,a(349005).A)(".buttonGroup__ALLyOzkO{align-items:center;display:flex;margin:0}.cozy__ALLyOzkO>*{margin-left:16px}.cozy__ALLyOzkO>:first-child{margin-left:0}.cozy__ALLyOzkO.vertical__ALLyOzkO>*{margin:8px 0 0}.cozy__ALLyOzkO.vertical__ALLyOzkO>:first-child{margin-top:0}.comfy__ALLyOzkO>*{margin:0}.comfy__ALLyOzkO.vertical__ALLyOzkO>*{margin:16px 0 0}.comfy__ALLyOzkO.vertical__ALLyOzkO>:first-child{margin-top:0}.smash__ALLyOzkO>*{margin:0}.joined__ALLyOzkO{border-radius:20px;overflow:hidden}.joined__ALLyOzkO>*{border-radius:0}.playerControls__ALLyOzkO{background-color:#f9fafa;border-radius:20px;padding:0 42px}.playerControls__ALLyOzkO.vertical__ALLyOzkO{padding:42px 0}.vertical__ALLyOzkO{flex-direction:column;justify-content:center}");const n=(0,a(722860).c)({buttonGroup:"buttonGroup__ALLyOzkO",cozy:"cozy__ALLyOzkO",vertical:"vertical__ALLyOzkO",comfy:"comfy__ALLyOzkO",smash:"smash__ALLyOzkO",joined:"joined__ALLyOzkO",playerControls:"playerControls__ALLyOzkO"}),o=({variant:e,vertical:t,children:a,className:o,...l})=>r.createElement("div",{className:n.concat(o)("buttonGroup",e&&e,t&&"vertical"),...l},a);o.defaultProps={variant:"cozy",vertical:!1}},766624:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(296540),n=a(271856),o=a(709690),l=a(284428),i=a(566723);const c=({description:e,isInteractive:t,portal:a=!0,cursorType:c,title:s,position:m,width:E,iconProps:_,disabled:d=!1})=>{const p=(0,l.Im)()||d,u=(0,l.q)();return r.createElement(n.A,{description:e,portal:a,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:c,title:s,position:m,width:E,disableHover:u},r.createElement(o.A,{isActive:!0,size:"original",opacity:p?i.xN:void 0,..._}))}},772317:(e,t,a)=>{a.d(t,{A:()=>N});var r,n=a(592563),o=a(296540),l=a(469733),i=a(217439),c=a(187483),s=a(699784),m=a(689965),E=a(86571),_=a(801081);!function(e){e.OPEN_MODAL="openModal"}(r||(r={}));const d=(0,_.Mz)(c.zn,e=>void 0!==e[r.OPEN_MODAL]);var p=a(523275),u=a(840279),A=a(919952);const R=e=>e[A.U.UIDB]||(0,p.A)(),T=(0,_.Mz)(R,({version:e})=>Boolean(e)),v=(0,_.Mz)(R,({devices:e})=>e||(0,u.A)());var g=a(765562),f=a(79871);const h=()=>{const e=(0,l.useDispatch)(),t=(0,l.useSelector)(T);return(0,o.useEffect)(()=>{t||(async()=>{const t=await fetch(g.A.fingerprintPublicDatabasePath),a=await t.json();e((0,f.$)(a))})()},[t,e]),t},I=({uidbDevice:e})=>{const t=(0,l.useSelector)(c.zn),a=t?.[r.OPEN_MODAL];return a?o.createElement(n.A,{onClick:()=>a(e)},o.createElement(i.A,{size:"medium",color:"inherit"},o.createElement(s.sA,{id:"DEVICE_SHOW_DETAILS"}))):null},C=({shortname:e})=>{const t=(0,l.useSelector)((e=>(0,_.Mz)(v,t=>t.find(t=>t.shortnames?.includes(e))||(0,p.A)()))(e));return h(),t?.compliance?o.createElement(m.A,{type:m.I.ACCORDION,items:[{id:"compliance",label:o.createElement(E.A,{id:"COMMON_COMPLIANCE"}),renderContent:()=>o.createElement(I,{uidbDevice:t}),openByDefault:!0}]}):null},N=({shortname:e})=>(0,l.useSelector)(d)?o.createElement(C,{shortname:e}):null},812454:(e,t,a)=>{a.d(t,{A:()=>V});var r=a(296540),n=a(71479),o=a(566723),l=a(218234),i=a(294303),c=a(217439),s=a(998837),m=a(842630),E=a(224948),_=a(699784),d=a(469733),p=a(824182),u=a(264963),A=a(822336),R=a(705145);const T=(0,n.A)(i.A)`
  flex-direction: column;
  margin-top: ${o.kc};
  padding-top: ${o.kc};
  border-top: ${({theme:{themeName:e}})=>A.Ay[`desktop-border-divider-${e}`]};
`,v=(0,n.A)(i.A)`
  width: 100%;
  justify-content: space-between;
`,g=(0,n.A)(i.A)`
  gap: ${o.Ln};
  align-items: center;
`,f=(0,n.A)(R.A)`
  max-width: 150px;
`,h=(0,r.memo)(({mac:e,replacementMac:t})=>{const a=(0,d.useDispatch)(),[n,o]=(0,r.useState)(!1),l=(0,r.useCallback)(()=>{o(!0),a((0,u.X2)(e)).finally(()=>{o(!1)})},[a,e]);return r.createElement(T,null,r.createElement(v,null,r.createElement(f,{isTruncated:!0,size:"medium",color:"text-2"},r.createElement(_.sA,{id:"DEVICE_REPLACEMENT_DEVICE"})),r.createElement(g,null,r.createElement(c.A,{size:"medium",color:"text-3"},t),r.createElement(p.A,{actionable:!0,onClick:l,disabled:n}))))}),I=(0,n.A)(i.A)`
  flex-direction: column;
  gap: ${o.kc};
`;var C=a(709690),N=a(823858),O=a(768195);const y=({state:e},{uBlue06:t,orange06:a})=>{switch(e){case O.gQ.WAITING_FOR_REPLACEMENT:return r.createElement(C.A,{size:"original",color:t,variant:"fill"});case O.gQ.WAITING_FOR_REPLACED_DEVICE_DISCONNECT:case O.gQ.INCOMPATIBLE_REPLACEMENT:case O.gQ.REPLACEMENT_ALREADY_ASSIGNED:case O.gQ.CANNOT_REPLACE:default:return r.createElement(N.A,{size:"original",color:a,variant:"fill"})}},b=({state:e})=>{switch(e){case O.gQ.WAITING_FOR_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACEMENT";case O.gQ.WAITING_FOR_REPLACED_DEVICE_DISCONNECT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACED_DEVICE_DISCONNECT";case O.gQ.INCOMPATIBLE_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_INCOMPATIBLE_REPLACEMENT";case O.gQ.REPLACEMENT_ALREADY_ASSIGNED:case O.gQ.CANNOT_REPLACE:default:return"DEVICE_REPLACEMENT_PENDING_CANNOT_REPLACE"}},L=(0,r.memo)(({mac:e,replacement:t})=>{const{motifPalette:a}=(0,s.u)();return t?.device_mac?r.createElement(m.A,null,r.createElement(E.A,{icon:y(t,a)},r.createElement(I,null,r.createElement(c.A,{size:"medium",color:"text-2"},r.createElement(_.sA,{id:b(t),values:{b:_.b}}))),r.createElement(h,{mac:e,replacementMac:t.device_mac}))):null});var D=a(211908),B=a(188912),M=a(470962),k=a(281884),S=a(130648),P=a(392699),w=a(124092),x=a(236037),K=a(683086);const z=(0,n.A)(i.A)`
  & > :first-child {
    margin-top: ${o.kc};
  }
`,V=({activeItem:e,activeItem:{deviceState:t,uplink:a,mac:n,model:i,type:c,replacement:s},showPortOverview:m,hidePortsButton:E,isStacking:_,multipleDisplayedDevicesData:d,overviewChildren:p,children:u})=>{const A=(0,r.useMemo)(()=>(0,k.H)(t,a?.type),[t,a?.type]),R=Boolean(e?.port_table?.length),T=m&&R;return r.createElement(r.Fragment,null,r.createElement(w.A,{activeItem:e,isOffline:A===P.v.OFFLINE,description:r.createElement(B.A,{activeItem:e,connectionStatus:A}),meshingDescription:r.createElement(S.A,{activeItem:e,connectionStatus:A}),isStacking:_},p,T?r.createElement("div",{style:{marginTop:o.Ln}},r.createElement(l.A,{activeItem:e,disableOnPortClick:!0,showFullScreenDiagramButton:!1,useBubbleWrapper:!1,multipleDisplayedDevicesData:d,isStacking:_})):null,r.createElement(z,{gap:o.kc,flexDirection:"column"},r.createElement(x.A,{activeItem:e}),!E&&R?r.createElement(K.A,{mac:n}):null),u),A===P.v.OFFLINE?r.createElement(M.A,null,s?.device_mac?null:r.createElement(D.A,{mac:n,model:i,type:c})):null,r.createElement(L,{mac:n,replacement:s}))}},842630:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(469733),n=a(296540),o=a(602021);const l=({children:e=null})=>(0,r.useSelector)(o.EL)?null:n.createElement(n.Fragment,null,e)},873138:(e,t,a)=>{a.r(t),a.d(t,{default:()=>I});var r=a(296540),n=a(86571),o=a(689965),l=a(170163),i=a(927099),c=a(773412),s=a(71479),m=a(566723),E=a(294303),_=a(699784);const d=(0,s.A)("div")`
  margin-bottom: ${m.xO};
`,p=({rpsPortUtilization:e=[]})=>r.createElement(r.Fragment,null,e.map(e=>r.createElement(r.Fragment,{key:e.voltage},["backup","delivering"].map(t=>r.createElement(r.Fragment,{key:t},e[t].ports.map(a=>r.createElement(d,{key:a.id},r.createElement(E.A,{justifyContent:"space-between"},r.createElement(i.A,{size:"body",weight:"bold"},r.createElement(_.sA,{id:`DEVICE_PROPERTIES_RPS_UTILIZATION_BAR_HEADING_${t.toUpperCase()}`,values:{voltage:e.voltage,portId:a.id}})),r.createElement(i.A,{size:"body"},r.createElement(_.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TOTAL_WATTS_VALUE",values:{sum:a.powerRequired,max:e[t].total}}))),r.createElement(c.A,{items:[{variant:"primary",value:a.powerRequired/e[t].total*100}],height:12,rounded:!0}))))))));var u=a(812454),A=a(999063),R=a(45481),T=a(32753),v=a(205830),g=a(15532);const f=({has_temperature:e,overheating:t,general_temperature:a,has_fan:n,fan_level:l,uptime:i,sys_stats:c,systemStatsMem:s})=>r.createElement(o.A,null,r.createElement(E.A,{flexDirection:"column"},r.createElement(R.A,{has_temperature:e,overheating:t,general_temperature:a}),r.createElement(g.A,{has_fan:n,fan_level:l}),r.createElement(A.A,{uptime:i}),r.createElement(T.A,{systemStatsMem:s}),r.createElement(v.A,{sys_stats:c})));var h=a(772317);const I=({activeItem:e,activeItem:{rps:t,has_temperature:a,overheating:i,general_temperature:c,has_fan:s,fan_level:m,uptime:E,sys_stats:_,"system-stats":d,shortname:A}})=>{const R=(0,r.useMemo)(()=>(0,l.F9)(t),[t]);return r.createElement(r.Fragment,null,r.createElement(u.A,{activeItem:e}),r.createElement(f,{has_temperature:a,overheating:i,general_temperature:c,has_fan:s,fan_level:m,uptime:E,sys_stats:_,systemStatsMem:d?.mem}),R.length?r.createElement(o.A,{type:o.I.ACCORDION,items:[{id:"powerUtilization",openByDefault:!0,label:r.createElement(n.A,{id:"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>r.createElement(p,{rpsPortUtilization:R})}]}):null,r.createElement(h.A,{shortname:A}))}},903992:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(349005),n={overlay:"overlay__B4Kpm1RT","overlay-light":"overlay-light__B4Kpm1RT","overlay-dark":"overlay-dark__B4Kpm1RT","overlay-afterOpen":"overlay-afterOpen__B4Kpm1RT","overlay-beforeClose":"overlay-beforeClose__B4Kpm1RT","overlay-noSlide":"overlay-noSlide__B4Kpm1RT",modal:"modal__B4Kpm1RT","modal-light":"modal-light__B4Kpm1RT","modal-dark":"modal-dark__B4Kpm1RT","modal-allowOverflow":"modal-allowOverflow__B4Kpm1RT","modal-slide":"modal-slide__B4Kpm1RT","modal-afterOpen":"modal-afterOpen__B4Kpm1RT","modal-beforeClose":"modal-beforeClose__B4Kpm1RT","modal-full":"modal-full__B4Kpm1RT","modal-small":"modal-small__B4Kpm1RT","modal-medium":"modal-medium__B4Kpm1RT","modal-large":"modal-large__B4Kpm1RT","modal-height-small":"modal-height-small__B4Kpm1RT","modal-height-medium":"modal-height-medium__B4Kpm1RT","modal-height-large":"modal-height-large__B4Kpm1RT",header:"header__B4Kpm1RT",title:"title__B4Kpm1RT","title-light":"title-light__B4Kpm1RT","title-dark":"title-dark__B4Kpm1RT",headerIcon:"headerIcon__B4Kpm1RT",closeButton:"closeButton__B4Kpm1RT",closeIcon:"closeIcon__B4Kpm1RT","closeIcon-light":"closeIcon-light__B4Kpm1RT","closeIcon-dark":"closeIcon-dark__B4Kpm1RT",hasTitle:"hasTitle__B4Kpm1RT",content:"content__B4Kpm1RT","content-light":"content-light__B4Kpm1RT","content-dark":"content-dark__B4Kpm1RT","content-allowOverflow":"content-allowOverflow__B4Kpm1RT","content-flush":"content-flush__B4Kpm1RT","content-noFooter":"content-noFooter__B4Kpm1RT","content-noHeader":"content-noHeader__B4Kpm1RT",footer:"footer__B4Kpm1RT",footerButtonGroup:"footerButtonGroup__B4Kpm1RT",footerActionSpacer:"footerActionSpacer__B4Kpm1RT",fadeIn:"fadeIn__B4Kpm1RT",springUp:"springUp__B4Kpm1RT"};(0,r.A)("@keyframes fadeIn__B4Kpm1RT{0%{opacity:0}to{opacity:1}}@keyframes springUp__B4Kpm1RT{0%{transform:scale(.5)}70%{transform:scale(1.005)}to{transform:scale(1)}}.overlay__B4Kpm1RT{align-items:center;bottom:0;display:flex;justify-content:center;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transition:opacity .1s ease-in;z-index:1000}.overlay-light__B4Kpm1RT{background-color:hsla(0,0%,8%,.4)}.overlay-dark__B4Kpm1RT{background-color:hsla(0,0%,8%,.6)}.overlay-afterOpen__B4Kpm1RT{opacity:1}.overlay-beforeClose__B4Kpm1RT{opacity:0;transition:opacity .1s ease-out}.overlay-noSlide__B4Kpm1RT{transition-delay:0ms}.modal__B4Kpm1RT{border-radius:8px;display:flex;flex-direction:column;max-height:80%;max-width:80%;outline:none;position:relative}.modal-light__B4Kpm1RT{background-color:#fff;box-shadow:0 12px 48px 0 rgba(33,35,39,.12),0 0 1px 0 rgba(33,35,39,.08);color:#50565e}.modal-dark__B4Kpm1RT{background-color:#131416;box-shadow:0 12px 48px 0 #000,0 0 1px 0 hsla(214,8%,98%,.08);color:#dee0e3}.modal__B4Kpm1RT:not(.modal-allowOverflow__B4Kpm1RT){overflow-x:hidden;overflow-y:auto}.modal-slide__B4Kpm1RT{opacity:0;transform:scale(.5);transition:opacity .1s ease-in,transform .32s cubic-bezier(.2,1.2,.6,1)}.modal-afterOpen__B4Kpm1RT{opacity:1;transform:scale(1)}.modal-beforeClose__B4Kpm1RT{opacity:0;transform:scale(.5);transition:opacity .1s ease-out,transform reverse .1s cubic-bezier(.2,1.2,.6,1)}.modal-full__B4Kpm1RT{width:100%}.modal-small__B4Kpm1RT{width:400px}.modal-medium__B4Kpm1RT{width:600px}.modal-large__B4Kpm1RT{width:800px}.modal-height-small__B4Kpm1RT{height:288px}.modal-height-medium__B4Kpm1RT{height:576px}.modal-height-large__B4Kpm1RT{height:864px}.header__B4Kpm1RT{flex:none}.title__B4Kpm1RT{align-items:center;display:flex;flex-grow:1;flex-shrink:1;font-family:var(--desktop-font-family-default);font-size:var(--desktop-font-size-medium);font-weight:var(--desktop-font-weight-semibold);line-height:20px;width:0}.title-light__B4Kpm1RT{color:#212327}.title-dark__B4Kpm1RT{color:#f9fafa}.headerIcon__B4Kpm1RT{margin-right:12px}.closeButton__B4Kpm1RT{background:none;border:none;cursor:pointer;padding:0;position:absolute;right:20px;top:20px}.closeButton__B4Kpm1RT .closeIcon__B4Kpm1RT{height:20px;width:20px}.closeButton__B4Kpm1RT .closeIcon-light__B4Kpm1RT{color:#808893}.closeButton__B4Kpm1RT .closeIcon-dark__B4Kpm1RT{color:#b7bcc2}.hasTitle__B4Kpm1RT.header__B4Kpm1RT{align-items:center;display:flex;margin-top:0;padding:20px 48px 0 20px}.content__B4Kpm1RT{display:flex;flex:1;flex-direction:column;font-family:var(--desktop-font-family-default);font-size:var(--desktop-font-size-medium);font-weight:var(--desktop-font-weight-regular);height:100%;line-height:20px}.content-light__B4Kpm1RT{color:#50565e}.content-dark__B4Kpm1RT{color:#dee0e3}.content__B4Kpm1RT::-webkit-scrollbar{height:14px;width:14px}.content-light__B4Kpm1RT::-webkit-scrollbar-thumb{background-color:rgba(33,35,39,.08)}.content-dark__B4Kpm1RT::-webkit-scrollbar-thumb{background-color:hsla(214,8%,98%,.08)}.content__B4Kpm1RT::-webkit-scrollbar-thumb{background-clip:content-box;border:4px solid transparent;border-radius:14px;min-height:20px}.content__B4Kpm1RT::-webkit-scrollbar-track{background:transparent;border-radius:14px}.content__B4Kpm1RT::-webkit-scrollbar-corner{background-color:transparent}.content__B4Kpm1RT:not(.content-allowOverflow__B4Kpm1RT){overflow:auto;overflow:overlay}.content__B4Kpm1RT:not(.content-flush__B4Kpm1RT){padding:16px 20px}.content-noFooter__B4Kpm1RT{margin-bottom:28px}.content-noHeader__B4Kpm1RT{margin-top:28px}.footer__B4Kpm1RT{padding:0 20px 20px}.footerButtonGroup__B4Kpm1RT{flex-grow:1;justify-content:flex-end}.footerActionSpacer__B4Kpm1RT{flex:1 1 0}")},953394:(e,t,a)=>{var r;a.d(t,{s:()=>r}),function(e){e.STANDARD="standard",e.USB="usb",e.LAN="lan",e.WAN="wan",e.RJ45="rj45",e.SURGE="surge"}(r||(r={}))}}]);