(window.webpackJsonpunifiNetworkUi=window.webpackJsonpunifiNetworkUi||[]).push([[21],{1017:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return E}));var n=a(0),l=a(3),r=a(4),i=a(165);const c=e=>Object(i.a)(e,"shared.bodyStyle"),o={overflow:l.a`
  overflow: hidden;
`};function E(){const e=Object(r.useSelector)(c),t=Object.keys(e),[a,l]=Object(n.useState)(e);function i(e){Object.values(e).forEach(e=>document.body.classList.remove(e.style))}return Object(n.useEffect)(()=>{const n={};return t.forEach(t=>{const a=e[t];a&&(document.body.classList.contains(a.style)||document.body.classList.add(a.style),n[t]=a)}),i(a),l(n),()=>i(a)},[t.join()]),null}},1032:function(e,t,a){"use strict";var n;a.d(t,"a",(function(){return n})),function(e){e.TIMELINE="timeline",e.MAP="map",e.INSIGHTS="insights"}(n||(n={}))},1039:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),l=a.n(n),r=a(47),i=a(423);const c=({startTimestamp:e,size:t="body",color:a="inherit"})=>{const c=Object(n.useRef)(null),o=Object(n.useRef)(null),E=Object(n.useCallback)(()=>{c.current&&(c.current.innerText=e?Object(i.a)(Math.floor(Date.now()/1e3)-e).join(" "):"-",o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{E()},1e3))},[e]);return Object(n.useEffect)(()=>(e&&E(),()=>{o.current&&clearTimeout(o.current)}),[]),l.a.createElement(r.a,{size:t,color:a},l.a.createElement("span",{ref:c}))}},1041:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(4),i=a(3),c=a(481),o=a(25),E=a(57),s=a(6),m=a(15),d=a(107),_=a(1),b=a(47),u=a(851),O=a(124),p=a(131),I=a(46);const g=Object(i.c)("div")`
  display: table;
`,v=Object(i.c)("div")`
  display: table-row;

  > * {
    font-size: 11px;
    display: table-cell;
    white-space: nowrap;

    &:last-of-type {
      padding-left: 10px;
    }
  }
`;var C=Object(_.e)((function({deviceData:e,intl:t,portData:a,portData:{ifname:n,port_idx:i,portName:c,tx_bytes:o,rx_bytes:m,sfp_txfault:d,sfp_rxfault:C,sfp_vendor:R,sfp_serial:T,sfp_part:h,sfp_rev:D,sfp_compliance:P,sfp_voltage:y,sfp_current:f,sfp_txpower:S,sfp_rxpower:A,sfp_temperature:N}}){const j=Object(r.useSelector)(p.selectPortConf),L=Object(E.yb)(a,t,j),x=Object(r.useSelector)(O.u),M=Object(E.mb)(a,e,x),V=Object(E.Db)(a,e,x),w=a&&s.SFP_MEDIA_TYPES.includes(a.media)&&a.sfp_found,F=Object(E.Bb)(a,t),U=Object(E.wb)(a),z=[];return w&&(d&&z.push(t.formatMessage({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX_FAULT"})),C&&z.push(t.formatMessage({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX_FAULT"}))),l.a.createElement(g,null,!a.masked&&(i||n)&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PORT"})),l.a.createElement(b.a,null,Object(E.pb)(a))),c&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_NAME"})),l.a.createElement(b.a,null,c)),(F||z.length>0)&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_STATUS"})),l.a.createElement(b.a,null,F,z.length>0&&i%2==0&&l.a.createElement(b.a,{color:"danger"},z.join(", ")))),o>0&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX"})),l.a.createElement(u.a,{type:"bytes",input:o})),m>0&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX"})),l.a.createElement(u.a,{type:"bytes",input:m})),U&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"COMMON_DEVICE_POE_MODE_POE"})),l.a.createElement(b.a,null,U)),L&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PROFILE"})),l.a.createElement(b.a,null,L)),M&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_DOWNLINK"})),l.a.createElement(b.a,null,Object(I.c)(M))),V&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_UPLINK"})),l.a.createElement(b.a,null,Object(I.c)(V))),w&&l.a.createElement(l.a.Fragment,null,R&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_VENDOR"})),l.a.createElement(b.a,null,R)),T&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_SERIAL"})),l.a.createElement(b.a,null,T)),h&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PART_NUMBER"})),l.a.createElement(b.a,null,h)),D&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_REV"})),l.a.createElement(b.a,null,D)),P&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_COMPLIANCE"})),l.a.createElement(b.a,null,P)),y&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_VOLTAGE"})),l.a.createElement(b.a,null,l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE",values:{voltage:y}}))),f&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_CURRENT"})),l.a.createElement(b.a,null,l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:f}}))),N&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_LABEL"})),l.a.createElement(b.a,null,l.a.createElement(_.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:Number(N).toFixed(1)}}))),S&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_OUTPUT_POWER"})),l.a.createElement(b.a,null,l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:S}}))),A&&l.a.createElement(v,null,l.a.createElement(b.a,{color:"secondary"},l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_INPUT_POWER"})),l.a.createElement(b.a,null,l.a.createElement(_.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:A}})))))})),R=a(908),T=a(1657);const h=Object(i.c)(c.a,{shouldForwardProp:e=>!["color","portSize","portSizeOverride","isDisabled"].includes(e)})`
  height: ${({portSizeOverride:e,portSize:t})=>e||(null==t?void 0:t.size)||R.a.large.size};
  width: ${({portSizeOverride:e,portSize:t})=>e||(null==t?void 0:t.size)||R.a.large.size};
  align-items: center;
  background-color: ${({theme:e,color:t,isDisabled:a})=>a?"transparent":e.motifPalette[t]};
  ${({isDisabled:e,theme:t})=>e&&`border: ${t.motifPalette[s.SWITCH_PORT_SPEED_COLORS.DEFAULT]} 1px solid;`}
  border-radius: 2px;
  color: #fff;
  justify-content: center;
  display: flex;
  position: relative;
  pointer-events: auto;

  &:not(:first-child) {
    margin-left: ${({portSize:e})=>(null==e?void 0:e.spacing)||R.a.large.spacing};
  }
`,D=Object(i.c)("div",{shouldForwardProp:e=>!["portSize","portSizeOverride"].includes(e)})`
  width: ${({portSizeOverride:e,portSize:t})=>e||(null==t?void 0:t.size)||R.a.large.size};
  &:not(:first-child) {
    margin-left: ${({portSize:e})=>(null==e?void 0:e.spacing)||R.a.large.spacing};
  }
`,P=({tooltipOffset:e}=R.a.large)=>i.a`
  margin-left: ${e};
`;t.a=({cellData:e,deviceData:t,keyValue:a,portSize:n,portSizeOverride:i,...c})=>{const _=Object(E.xc)(Object(r.useSelector)(s.selectDevicesData),t),b=Object(E.ob)(e,t,Object(r.useSelector)(m.selectNetworkGroups),_),u=Object(E.lb)(t,e),O=e||{},p=Object(o.k)(),{path:I}=Object(o.n)(),{site:g,page:v,id:R,panel:y}=Object(o.m)();if(!e)return Object(s.isUdmBase)(t)||Object(s.isUdr)(t)?null:l.a.createElement(D,{key:a,portSize:n,portSizeOverride:i});const f=e=>Object(o.i)(I,{site:g,page:v,id:R,panel:y,subPanel:"ports",subPanelId:e});return l.a.createElement(h,Object.assign({color:u,portSize:n,portSizeOverride:i,isDisabled:!e.enable,message:l.a.createElement(C,{deviceData:t,portData:O}),position:"bottomRight",tooltipClassName:P(n),onClick:a=>!e.masked&&(e=>{var a,n;return null===(a=null==e?void 0:e.preventDefault)||void 0===a||a.call(e),null===(n=null==e?void 0:e.stopPropagation)||void 0===n||n.call(e),Object(E.He)(t)||Object(E.Ae)(t)?p.push(f(null==O?void 0:O.ifname)):"wan"===(null==O?void 0:O.network_name)||"wan2"===(null==O?void 0:O.network_name)?p.push(f(d.b.WAN)):(null==O?void 0:O.dns)?p.push(f(d.b.ALL)):p.push(f("aggregate"===O.op_mode?O.portIdx||O.port_idx||O.ifname:Object(E.pb)(O)))})(a),portal:!0,key:a},c),l.a.createElement(T.a,{icons:b}))}},1042:function(e,t,a){"use strict";var n=a(1653);a.d(t,"dismissUnifiCareActivation",(function(){return n.a})),a.d(t,"fetchUnifiCareDetails",(function(){return n.b}));a(854);var l=a(2612);a.d(t,"selectUnifiCareDetails",(function(){return l.a}));a(2613)},1169:function(e,t,a){"use strict";a.d(t,"a",(function(){return _})),a.d(t,"b",(function(){return b}));var n=a(865),l=a(9),r=a(20),i=a(1654),c=a(16),o=a(423),E=a(99),s=a(75),m=a(736),d=a(549);const _=(e,t,a=[])=>Object(l.a)(Object(i.b)(e,t),r.J,c.selectLocaleSettings,s.d,r.E,(e,t,n,l,r)=>{const{data:i,...c}=e,s=Object(E.d)(t,n,l);return{...c,data:i.map(({assoc_time:e,duration:t,_id:n,mac:l,satisfaction:i,name:c="",hostname:m=""})=>({id:n,date:Object(E.e)(1e3*e,s,d.a),start:Object(E.e)(1e3*e,s,r),duration:Object(o.c)(t,!0),experience:i,mac:l,hostname:m,name:c,client:a.find(e=>"mac"in e&&e.mac===l)}))}}),b=e=>Object(l.a)(t=>{var a,n,l,r;return null===(r=null===(l=null===(n=null===(a=t.models)||void 0===a?void 0:a[m.MODEL])||void 0===n?void 0:n.byId)||void 0===l?void 0:l[e])||void 0===r?void 0:r.record},r.J,c.selectLocaleSettings,s.d,r.E,(e,t,a,l,r)=>{if(!Object(n.a)(e)){const n=Object(E.d)(t,a,l),{assoc_time:i,duration:c,sw_port:s,mac:m,ip:_,satisfaction:b,hostname:u="",is_wired:O,name:p,_id:I}=e;return{id:I,date:i?Object(E.e)(1e3*i,n,d.a):"",duration:c?Object(o.c)(c,!0):"",start:i?Object(E.e)(1e3*i,n,r):"",end:i?Object(E.e)(1e3*i+1e3*c,n,r):"",mac:m,ip:_,port:s,experience:b,hostname:u,is_wired:O,name:p}}return e})},1172:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return l})),a.d(t,"a",(function(){return r}));const n="session",l="/api/s/{site}/stat/session",r="_id"},1183:function(e,t,a){"use strict";var n=a(1655);a.d(t,"fetchTraffic",(function(){return n.a}));var l=a(755);a.d(t,"DPI_CONVERTER_LIMIT",(function(){return l.a})),a.d(t,"UNKNOWN_APP_ID",(function(){return l.f}));var r=a(2619);a.d(t,"selectFormattedStaDpiData",(function(){return r.a}));a(2615),a(1194)},1194:function(e,t,a){"use strict";a.d(t,"b",(function(){return r})),a.d(t,"a",(function(){return i}));var n=a(84);const l=n.dpi.ruleMap,r=(e,t)=>+t+(+e<<16),i=e=>{const t=(a=e,l.applications[a]);var a;return t?t.name:void 0}},1201:function(e,t,a){"use strict";t.a={op_mode:"switch",dot1x_ctrl:"force_authorized",autoneg:!0,dot1x_idle_timeout:300,full_duplex:void 0,speed:void 0,lldpmed_enabled:!0,stp_port_mode:!0,stp_bpdu_guard:!1,stp_loopback_detection:!1,stp_root_guard:!1,egress_rate_limit_kbps_enabled:!1,port_security_enabled:!1,port_security_mac_address:[],linkNegotiationOptions:{autoneg:{id:"autoneg",label:"DEVICE_PROPERTIES_LINK_NEGOTIATION_AUTO",autoneg:!0,speed:void 0,full_duplex:void 0},"10000 FDX":{id:"10000 FDX",label:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:1e4,full_duplex:!0},"2500 FDX":{id:"2500 FDX",label:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:2500,full_duplex:!0},"1000 FDX":{id:"1000 FDX",label:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:1e3,full_duplex:!0},"100 FDX":{id:"100 FDX",label:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:100,full_duplex:!0},"100 HDX":{id:"100 HDX",label:"DEVICE_STATE_FLAG_WIRED_HALF_DUPLEX",autoneg:!1,speed:100,full_duplex:!1},"10 FDX":{id:"10 FDX",label:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:10,full_duplex:!0},"10 HDX":{id:"10 HDX",label:"DEVICE_STATE_FLAG_WIRED_HALF_DUPLEX",autoneg:!1,speed:10,full_duplex:!1}}}},1653:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return o}));var n=a(24),l=a(8),r=a(465),i=a(854);const c=()=>Object(l.s)(i.c,i.d,i.e),o=e=>t=>t(Object(l.b)(n.API_CALL,i.f.DISMISS_UNIFI_CARE_ACTIVATION_SUCCESS,i.f.DISMISS_UNIFI_CARE_ACTIVATION_ERROR,i.a,Object(r.a)(i.b,{mac:e})))},1654:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return c}));var n=a(8),l=a(1172);const r={method:"post",fetchConfig:{getAllPostData:!0},idField:l.a},i=(e,t)=>Object(n.p)(l.b,l.c,((e,t)=>({data:{[t?"ap_mac":"mac"]:e,_limit:t?20:5,_sort:"-assoc_time"}}))(e,t),r),c=(e,t)=>Object(n.z)(i(e,t))},1655:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return i}));var n=a(8),l=a(755);const r=(e,t)=>Object(n.s)(l.c,l.d,l.e,e,{...t,idField:"mac"}),i=(e,t)=>Object(n.z)(r(e,t))},1656:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(435),i=a(830);t.a=({signal:e})=>{return e?l.a.createElement(r.l,{height:4,items:[(t=Object(i.a)(e),{variant:t>=80?"success":t>=60?"warning":"danger",value:t})]}):null;var t}},1657:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(10),c=a(303),o=a(1658);const E=r.e`
  0% { opacity: 0; }
  40% { opacity: 1; }
  100% { opacity: 0; }
`,s=r.a`
  &:nth-child(1) {
    animation: ${E} 2s 0s infinite ease-in-out;
  }

  &:nth-child(2) {
    animation: ${E} 2s -1s infinite ease-in-out;
  }
`,m=r.e`
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  33%  { opacity: 1; }
  53%  { opacity: 0; }
  100% { opacity: 0; }
`,d=r.a`
  &:nth-child(1) {
    animation: ${m} 3s -1s infinite ease-in-out;
  }

  &:nth-child(2) {
    animation: ${m} 3s -2s infinite ease-in-out;
  }

  &:nth-child(3) {
    animation: ${m} 3s 0s infinite ease-in-out;
  }
`,_=Object(r.c)("div",{shouldForwardProp:e=>"iconsLength"!==e})`
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    max-width: 80%;
    max-height: 80%;
  }
  ${({iconsLength:e})=>2===e&&`\n  &:nth-child(1) {\n    animation: ${E} 2s 0s infinite ease-in-out;\n  }\n\n  &:nth-child(2) {\n    animation: ${E} 2s -1s infinite ease-in-out;\n  }`}

  ${({iconsLength:e})=>3===e&&`&:nth-child(1) {\n    animation: ${m} 3s -1s infinite ease-in-out;\n  }\n\n  &:nth-child(2) {\n    animation: ${m} 3s -2s infinite ease-in-out;\n  }\n\n  &:nth-child(3) {\n    animation: ${m} 3s 0s infinite ease-in-out;\n  }`}
`,b=Object(r.c)(i.X)`
  padding: 2px;
`;function u({icon:e}){const t={[c.a.DISCARDING]:i.u,[c.a.WAN]:b,[c.a.AGGREGATED]:o.a,[c.a.MIRROR]:i.K,[c.a.NETWORK]:i.Vc,[c.a.POE]:i.Tb,[c.a.POE_PLUS]:i.Pb,[c.a.POE_PLUS_PLUS]:i.Qb,[c.a.POWER_DELIVERING]:i.Tb,[c.a.HIGH_PRIORITY]:i.Ub,[c.a.SHIELD]:i.gc,[c.a.UPLINK]:i.k,[c.a.WAN_POE]:i.Mc,[c.a.WARNING]:i.a}[e];return t?l.a.createElement(t,{size:"original"}):null}t.a=({icons:e,...t})=>{let a="";return 2===e.length?a=s:3===e.length&&(a=d),l.a.createElement(l.a.Fragment,null,e.map(n=>n&&l.a.createElement(_,Object.assign({},t,{className:a,iconsLength:e.length,key:n}),l.a.createElement(u,{icon:n}))))}},1658:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(0),l=a.n(n);function r({width:e=18,height:t=18}){return l.a.createElement("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.a.createElement("path",{d:"M5.40001 4.8001C5.0688 4.8001 4.8 5.0689 4.8 5.4001C4.8 5.7313 5.0688 6.0001 5.40001 6.0001C5.7312 6.0001 6 5.7313 6 5.4001C6 5.0689 5.7312 4.8001 5.40001 4.8001ZM5.40001 3.6001C6.39361 3.6001 7.20001 4.4065 7.20001 5.4001C7.20001 6.3937 6.39361 7.2001 5.40001 7.2001C4.4064 7.2001 3.6 6.3937 3.6 5.4001C3.6 4.4065 4.4064 3.6001 5.40001 3.6001ZM5.40001 18.0001C5.0688 18.0001 4.8 18.2689 4.8 18.6001C4.8 18.9313 5.0688 19.2001 5.40001 19.2001C5.7312 19.2001 6 18.9313 6 18.6001C6 18.2689 5.7312 18.0001 5.40001 18.0001ZM5.40001 16.8001C6.39361 16.8001 7.20001 17.6065 7.20001 18.6001C7.20001 19.5937 6.39361 20.4001 5.40001 20.4001C4.4064 20.4001 3.6 19.5937 3.6 18.6001C3.6 17.6065 4.4064 16.8001 5.40001 16.8001ZM8.98595 6.0165H9.28595C10.4439 6.0165 11.3859 7.0173 11.3859 8.2449V15.7881C11.3859 17.0169 10.4439 18.0165 9.28595 18.0165H8.98595C8.65475 18.0165 8.38595 18.2853 8.38595 18.6165C8.38595 18.9477 8.65475 19.2165 8.98595 19.2165H9.28595C11.1051 19.2165 12.5859 17.6781 12.5859 15.7881V12.6005H19.6108L18.0167 14.1946C17.7823 14.4289 17.7823 14.8088 18.0167 15.0431C18.251 15.2775 18.6309 15.2775 18.8652 15.0431L21.4836 12.4248C21.7179 12.1905 21.7179 11.8106 21.4836 11.5762L18.8652 8.95787C18.6309 8.72355 18.251 8.72355 18.0167 8.95787C17.7823 9.19218 17.7823 9.57208 18.0167 9.80639L19.6104 11.4001H12.5859V8.2449C12.5859 6.3549 11.1051 4.8165 9.28595 4.8165H8.98595C8.65475 4.8165 8.38595 5.0853 8.38595 5.4165C8.38595 5.7477 8.65475 6.0165 8.98595 6.0165Z",fill:"currentColor"}))}},1659:function(e,t,a){"use strict";var n=a(0),l=a.n(n);t.a=({strength:e,color:t,inactiveColor:a="currentColor",width:n,height:r})=>l.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 27 26",width:n,height:r},l.a.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},l.a.createElement("rect",{fill:e>=1?t:a,x:"0",y:"16",width:"3",height:"10"}),l.a.createElement("rect",{fill:e>=2?t:a,x:"6",y:"12",width:"3",height:"14"}),l.a.createElement("rect",{fill:e>=3?t:a,x:"12",y:"8",width:"3",height:"18"}),l.a.createElement("rect",{fill:e>=4?t:a,x:"18",y:"4",width:"3",height:"22"}),l.a.createElement("rect",{fill:e>=5?t:a,x:"24",y:"0",width:"3",height:"26"})))},1660:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(750),l=a(1209),r=a(48);const i=[r.a["blue-1"],r.a["blue-2"],r.a["blue-3"],r.a["blue-light-3"],r.a["blue-light-4"],r.a["purple-2"],r.a["blue-light-2"],r.a["blue-light-5"]],c=(Object(l.b)().range(Object(n.a)(1,9).map(e=>r.a["scale-"+e])),(e=i)=>Object(l.b)(e))},1672:function(e,t,a){"use strict";a.d(t,"a",(function(){return h})),a.d(t,"e",(function(){return D})),a.d(t,"f",(function(){return P})),a.d(t,"d",(function(){return y})),a.d(t,"g",(function(){return A})),a.d(t,"c",(function(){return N})),a.d(t,"b",(function(){return j}));var n=a(0),l=a.n(n),r=a(1),i=a(47),c=a(474),o=a(3),E=a(10),s=a(169),m=a(168),d=a(5),_=a(363),b=a(183),u=a(99),O=a(428),p=a(1032),I=a(4),g=a(89),v=a(891);var C=({mac:e})=>{const t=Object(n.useMemo)(()=>Object(g.selectClientProps)(e,["mac","name","oui","fingerprint","type"]),[e]),a=Object(I.useSelector)(t);return e?l.a.createElement(v.a,{alt:null==a?void 0:a.name,client:a,defaultName:e}):l.a.createElement(r.b,{id:"COMMON_HYPHEN"})};const R=Object(o.c)(_.a)`
  margin-right: 6px;
`,T=Object(o.c)(E.hb)`
  margin-left: 4px;
  margin-right: 10px;
`,h=1230,D=(s.a["24_HOURS"],{[p.a.TIMELINE]:"",[p.a.MAP]:p.a.MAP,[p.a.INSIGHTS]:p.a.INSIGHTS}),P=[{id:p.a.TIMELINE,label:l.a.createElement(r.b,{id:"TM_EVENT_TIMELINE"})},{id:p.a.MAP,label:l.a.createElement(r.b,{id:"TM_EVENT_MAP"})}],y={client:"",traffic:!0,threats:!0,severity:[!1,!0,!0,!0,!0],transferSizeEnabled:!1,transferSizeMin:1e6,transferSizeMax:1e9},f=Object(o.c)(i.a,{shouldForwardProp:e=>"margin"!==e})`
  ${({margin:e})=>e?`margin: ${e};`:""}
`,S=Object(o.c)(c.a,{shouldForwardProp:e=>"customColor"!==e&&"noRightMargin"!==e})`
  background-color: ${({customColor:e})=>e};
  margin-right: ${({noRightMargin:e})=>e?"":"8px"};
  margin-left: 8px;
  margn-right: 4px;
`,A=[{id:"column-date",label:l.a.createElement(i.a,{color:"inherit",size:"body",weight:"bold"},l.a.createElement(r.b,{id:"COMMON_DATE_TIME"})),renderCell:({dateTime:e})=>l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:140},{id:"column-service",label:l.a.createElement(i.a,{color:"inherit",size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_SERVICE"})),renderCell:({service:e})=>l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:150},{id:"column-data-usage",label:l.a.createElement(i.a,{color:"inherit",size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_DATA_USAGE"})),renderCell:({dataUsage:e})=>l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:110},{id:"column-packets",label:l.a.createElement(i.a,{color:"inherit",size:"body",weight:"bold"},l.a.createElement(r.b,{id:"COMMON_WORD_PACKETS"})),renderCell:({packets:e})=>l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:110},{id:"column-down",label:l.a.createElement(i.a,{color:"inherit",size:"body",weight:"bold"},l.a.createElement(r.b,{id:"COMMON_WORD_DOWN"})),renderCell:({down:e})=>l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:110},{id:"column-up",label:l.a.createElement(i.a,{color:"inherit",size:"body",weight:"bold"},l.a.createElement(r.b,{id:"COMMON_WORD_UP"})),renderCell:({up:e})=>l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:110}],N=(e,t,a)=>[{id:"column-severity",renderLabel:()=>null,renderCell:({timestamp:e,inner_alert_severity:t,type:a})=>{const n=1e3*e>=(new Date).getTime()-6e4;return l.a.createElement(S,{noRightMargin:!0,variant:"honeypot"===a?"warning":m.m[t],pulsating:n})},minWidth:36},{id:"column-date",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"COMMON_DATE_TIME"})),renderCell:({timestamp:n})=>{const c=1e3*n>=(new Date).getTime()-6e4;return l.a.createElement(i.a,{size:"body",color:"secondary"},c?l.a.createElement(r.b,{id:"COMMON_NOW"}):Object(u.e)(new Date(1e3*n),e,`${t} ${a}`))},minWidth:140},{id:"column-origin",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_SOURCE_LOCATION"})),renderCell:({srcipGeo:e,usgipGeo:t,src_ip:a,type:n})=>{if("honeypot"===n)return l.a.createElement(d.a,{alignItems:"center"},!!a&&l.a.createElement(T,null),l.a.createElement(i.a,{size:"body",color:"secondary"},a||l.a.createElement(r.b,{id:"COMMON_HYPHEN"})));const c=[(null==e?void 0:e.country_name)?null==e?void 0:e.city:null==t?void 0:t.city,(null==e?void 0:e.country_name)||(null==t?void 0:t.country_name)].filter(e=>!!e).join(", ");return c?l.a.createElement(d.a,{alignItems:"center"},l.a.createElement(R,{countryCode:(null==e?void 0:e.country_code)||(null==t?void 0:t.country_code),width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}),l.a.createElement(i.a,{size:"body",color:"secondary"},c)):l.a.createElement(i.a,{size:"body",color:"secondary"},l.a.createElement(r.b,{id:"COMMON_HYPHEN"}))},minWidth:215},{id:"column-destination",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_DESTINATION_LOCATION"})),renderCell:({dstipGeo:e,usgipGeo:t,type:a})=>{const n=[(null==e?void 0:e.country_name)?null==e?void 0:e.city:null==t?void 0:t.city,(null==e?void 0:e.country_name)||(null==t?void 0:t.country_name)].filter(e=>!!e).join(", ");return n?l.a.createElement(d.a,{alignItems:"center"},l.a.createElement(R,{countryCode:(null==e?void 0:e.country_code)||(null==t?void 0:t.country_code),width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}),l.a.createElement(i.a,{size:"body",color:"secondary"},n)):l.a.createElement(i.a,{size:"body",color:"secondary"},l.a.createElement(r.b,{id:"COMMON_HYPHEN"}))},minWidth:215},{id:"column-service",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_SERVICE"})),renderCell:({inner_alert_signature:e,http:t,type:a,servicename:n})=>{var c;return l.a.createElement(i.a,{size:"body",color:"secondary"},"honeypot"===a?(null===(c=null==n?void 0:n.toUpperCase)||void 0===c?void 0:c.call(n))||l.a.createElement(r.b,{id:"COMMON_HYPHEN"}):(null==t?void 0:t.hostname)||e||l.a.createElement(r.b,{id:"COMMON_HYPHEN"}))},minWidth:150},{id:"column-category",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_CATEGORY"})),renderCell:({catname:e,type:t})=>l.a.createElement(i.a,{size:"body",color:"secondary"},l.a.createElement(r.b,{id:"honeypot"===t?"TM_IPS_HONEYPOT":(null===m.a||void 0===m.a?void 0:m.a[e])||"COMMON_HYPHEN"})),minWidth:140},{id:"column-activity",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_ACTIVITY"})),renderCell:({inner_alert_category:e,type:t,service:a,servicename:n=""})=>{var c;return l.a.createElement(i.a,{size:"body",color:"secondary"},"honeypot"===t?l.a.createElement(r.b,{id:"TM_IPS_HONEYPOT_ACTIVITY",values:{service:(null===(c=null==n?void 0:n.toUpperCase)||void 0===c?void 0:c.call(n))||"PORT "+a}}):e||l.a.createElement(r.b,{id:"COMMON_HYPHEN"}))},minWidth:300},{id:"column-data-usage",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_DATA_USAGE"})),renderCell:({flow:e,type:t})=>{var a,n;return l.a.createElement(i.a,{size:"body",color:"secondary"},"honeypot"===t?l.a.createElement(r.b,{id:"COMMON_HYPHEN"}):Object(b.a)((null!==(a=null==e?void 0:e.bytes_toclient)&&void 0!==a?a:0)+(null!==(n=null==e?void 0:e.bytes_toserver)&&void 0!==n?n:0)))},minWidth:110}],j=(e,t,a)=>[{id:"column-severity",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_DESTINATION_LOCATION"})),renderCell:({time:e,inner_alert_severity:t,dstipGeo:a,parent:n})=>{const c=e>=(new Date).getTime()-6e4;return n?l.a.createElement(d.a,{alignItems:"center"},(null==a?void 0:a.country_code)?l.a.createElement(R,{countryCode:a.country_code,width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}):null,l.a.createElement(i.a,{size:"body",color:"secondary"},null==a?void 0:a.country_name)):l.a.createElement(d.a,{alignItems:"center"},l.a.createElement(S,{variant:m.m[t],pulsating:c}),l.a.createElement(i.a,{size:"body",color:"secondary"},(null==a?void 0:a.city)||l.a.createElement(r.b,{id:"COMMON_HYPHEN"})))},minWidth:215},{id:"column-date",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"COMMON_DATE_TIME"})),renderCell:({time:n,parent:c})=>{const o=n>=(new Date).getTime()-6e4;return c?null:l.a.createElement(i.a,{size:"body",color:"secondary"},o?l.a.createElement(r.b,{id:"COMMON_NOW"}):Object(u.e)(new Date(n),e,`${t} ${a}`))},minWidth:140},{id:"column-source",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_SOURCE_LOCATION"})),renderCell:({time:e,inner_alert_severity:t,srcipGeo:a,usgipGeo:n,parent:c})=>{const o=[(null==a?void 0:a.country_name)?null==a?void 0:a.city:null==n?void 0:n.city,(null==a?void 0:a.country_name)||(null==n?void 0:n.country_name)].filter(e=>!!e).join(", ");return c?null:o?l.a.createElement(d.a,{alignItems:"center"},l.a.createElement(d.a,{alignItems:"center"},l.a.createElement(R,{countryCode:(null==a?void 0:a.country_code)||(null==n?void 0:n.country_code),width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}),l.a.createElement(i.a,{size:"body",color:"secondary"},o))):l.a.createElement(d.a,{alignItems:"center"},l.a.createElement(i.a,{size:"body",color:"secondary"},l.a.createElement(r.b,{id:"COMMON_HYPHEN"})))},minWidth:215},{id:"column-service",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_SERVICE"})),renderCell:({inner_alert_signature:e,http:t,parent:a,totalServices:n})=>a?l.a.createElement(i.a,{size:"body",color:"secondary"},n):l.a.createElement(i.a,{size:"body",color:"secondary"},(null==t?void 0:t.hostname)||e||l.a.createElement(r.b,{id:"COMMON_HYPHEN"})),minWidth:150},{id:"column-category",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_CATEGORY"})),renderCell:({catname:e,parent:t,totalCategories:a})=>t?l.a.createElement(i.a,{size:"body",color:"secondary"},a):l.a.createElement(i.a,{size:"body",color:"secondary"},l.a.createElement(r.b,{id:(null===m.a||void 0===m.a?void 0:m.a[e])||"COMMON_HYPHEN"})),minWidth:140},{id:"column-activity",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_ACTIVITY"})),renderCell:({inner_alert_category:e,parent:t})=>t?null:l.a.createElement(i.a,{size:"body",color:"secondary"},e),minWidth:300},{id:"column-data-usage",label:l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_DATA_USAGE"})),renderCell:({flow:e,parent:t,totalActivity:a})=>{var n,r;return l.a.createElement(i.a,{size:"body",color:"secondary"},Object(b.a)(t?a:(null!==(n=null==e?void 0:e.bytes_toclient)&&void 0!==n?n:0)+(null!==(r=null==e?void 0:e.bytes_toserver)&&void 0!==r?r:0)))},minWidth:110}];l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_EVENTS"})),l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_DOMAIN"})),l.a.createElement(i.a,{size:"body",weight:"bold"},l.a.createElement(r.b,{id:"TM_REQUESTS"}))},1675:function(e,t,a){"use strict";a.d(t,"a",(function(){return c})),a.d(t,"b",(function(){return o})),a.d(t,"c",(function(){return E}));var n=a(0),l=a.n(n),r=a(10),i=(a(507),a(31));const c=e=>Object.values(e).map(e=>{var t;return{mac:(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.src_mac)||"",count:e.length,activity:e.reduce((e,{flow:t})=>{var a,n;return e+(null!==(a=null==t?void 0:t.bytes_toclient)&&void 0!==a?a:0)+(null!==(n=null==t?void 0:t.bytes_toserver)&&void 0!==n?n:0)},0)}}),o=e=>Object.values(e).map(e=>{var t,a;return{domain:(null===(a=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.http)||void 0===a?void 0:a.hostname)||"Unknown",count:e.length}}),E=(e,t)=>[{value:"",label:t.formatMessage({id:"TM_ALL_CLIENTS"}),caption:(null==e?void 0:e.length)?t.formatMessage({id:"TM_TOTAL_CLIENTS"},{count:e.length}):void 0,image:l.a.createElement(i.f,{height:38,minWidth:38,maxWidth:38,justifyContent:"center",alignItems:"center"},l.a.createElement(r.wb,{width:"24px",height:"24px"}))},...e.map(e=>({value:e.mac,label:e.name,caption:e.ip,image:l.a.createElement(i.f,{height:38,minWidth:38,maxWidth:38,justifyContent:"center",alignItems:"center"},l.a.createElement(i.c,{client:e,alt:e.name}))}))]},1677:function(e,t,a){"use strict";a.d(t,"c",(function(){return c})),a.d(t,"e",(function(){return o})),a.d(t,"b",(function(){return m})),a.d(t,"a",(function(){return d})),a.d(t,"d",(function(){return _}));const n="#B8CBE6",l="#B8CBE6",r="#005fdc",i="rgba(0,0,0,0)",c={STYLE_URL:"mapbox://styles/mapbox/light-v9",STYLE_URL_DARK:"mapbox://styles/mapbox/dark-v10",POLYGON_SOURCE_LAYER:"ne_10m_admin_0_countries-1e3h4p",POLYGON_SOURCE_URL:"mapbox://scheinerbock.9qrc7it7",GLYPH_URL:"mapbox://fonts/scheinerbock/{fontstack}/{range}.pbf"},o={blockFills:"block-fill-polygons",blockOutlines:"block-outline-polygons",countryOutlines:"country-outline-polygons",clickFills:"click-fill-polygons",clickOutlines:"click-outline-polygons"},E={type:"vector",url:c.POLYGON_SOURCE_URL};function s(e,t){return{id:e,type:"fill",source:e,"source-layer":c.POLYGON_SOURCE_LAYER,paint:t}}const m={[o.blockFills]:E,[o.blockOutlines]:E,[o.countryOutlines]:E,[o.clickFills]:E,[o.clickOutlines]:E},d=[s(o.blockFills,{"fill-opacity":["case",["==",["feature-state","blocked"],!0],1,0],"fill-pattern":"pattern"}),s(o.clickFills,{"fill-opacity":["case",["==",["feature-state","clicked"],!0],.2,0],"fill-color":r}),s(o.blockOutlines,{"fill-opacity":["case",["==",["feature-state","blocked"],!0],1,0],"fill-outline-color":l,"fill-color":i}),s(o.clickOutlines,{"fill-opacity":["case",["==",["feature-state","clicked"],!0],1,0],"fill-outline-color":l,"fill-color":i}),s(o.countryOutlines,{"fill-opacity":1,"fill-outline-color":n,"fill-color":i})],_={France:"FR",Norway:"NO","S. Sudan":"SD",Somaliland:"SO",Baikonur:"KZ","Siachen Glacier":"IN",Akrotiri:"CY","Cyprus U.N. Buffer Zone":"CY","N. Cyprus":"CY",Dhekelia:"CY"}},208:function(e,t,a){"use strict";var n=a(3),l=a(0),r=a.n(l),i=a(173),c=a(185);const o=Object(n.c)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: 30px;
`,E=Object(n.c)(i.a)`
  font-weight: normal;
`;t.a=({allowCancel:e,isDirty:t,isInvalid:a,onFormSubmit:n,onFormReset:l,onFormCancel:i,className:s,submitButtonText:m})=>r.a.createElement(o,{className:s,hasFormResetButton:!!l},r.a.createElement(E,{name:"cancel",variant:"tertiary",type:"button",onClick:i,disabled:!e&&!t},r.a.createElement(c.a,{message:"COMMON_ACTION_CANCEL"})),l&&r.a.createElement(E,{name:"reset",variant:"tertiary",type:"button",pill:!1,onClick:l,disabled:!t},r.a.createElement(c.a,{message:"COMMON_ACTION_RESET_TO_DEFAULTS"})),r.a.createElement(E,{name:"submit",variant:"primary",type:"submit",pill:!1,onClick:n,disabled:!t||a},r.a.createElement(c.a,{message:m||"COMMON_ACTION_APPLY_CHANGES"})))},235:function(e,t,a){"use strict";var n,l,r;a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){return l})),a.d(t,"b",(function(){return r})),function(e){e.ELEMENTS="elements",e.STATUS="status"}(n||(n={})),function(e){e.GATEWAY="gateway",e.SWITCH="switch",e.ACCESS_POINT="access_point",e.SMART_POWER="smart_power",e.BUILDING_BRIDGE="building_bridge",e.ULTE="ulte"}(l||(l={})),function(e){e.ONLINE="online",e.OFFLINE="offline",e.ISOLATED="isolated",e.PENDING_ADOPTION="pending_adoption",e.MANAGED_BY_ANOTHER_CONSOLE="managed_by_another_console"}(r||(r={}))},2604:function(e,t,a){"use strict";var n=a(25),l=a(0),r=a.n(l),i=a(3),c=a(2769),o=a(4),E=a(1018),s=a(362),m=a(651),d=a(62),_=a(84),b=a(92),u=a(57),O=a(59);const p=(e,t)=>{if(!e)return null;if(t===b.c.DEVICE)return Object(u.De)(e)?b.b.USPP:Object(u.Ee)(e)?b.b.USPS:Object(u.re)(e)?b.b.LTE:Object(u.Be)(e)?b.b.USPPDUP:Object(u.He)(e)?b.b.UXG:Object(u.ne)(e)||Object(u.oe)(e)?b.b.UDMPRO:Object(u.ze)(e)?b.b.USAGGPRO:Object(u.T)(e)?b.b.UAP_IW:Object(u.db)(e)?b.b.USL8MP:Object(u.Yd)(e)?b.b.UAP6MP:Object(u.eb)(e)?b.b.USPRPS:Object(u.Ce)(e)?b.b.USPRPSP:Object(u.ge)(e)?b.b.UBBXG:Object(u.qe)(e)?b.b.UDW:(e=>(_.deviceModels[e.model]||{hybrid:void 0}).hybrid||e.type)(e);if(t===b.c.CLIENT)switch(e.type){case O.c.WIRED:case O.c.WIRELESS:return b.a.CLIENT;case O.c.TELEPORT:return b.a.TELEPORT;default:return null}return t};var I=a(866),g=a(491),v=a(76),C=a(227),R=a(256),T=a(47),h=a(10),D=a(1),P=a(29),y=a(5),f=a(108),S=a(218),A=a(737),N=a(891);var j=({data:{client_icon_device_id:e,client_icon_engine_id:t,client_name:a},name:n,withName:l=!1,width:i,height:c})=>{const o=l?N.a:S.a;return r.a.createElement(o,{client:{fingerprint:{dev_id:e,computed_engine:t},name:n||a,is_wired:!1},alt:n,width:i,height:c,topology:!0})},L=a(162),x=a(46),M=a(126),V=a(49),w=a(2621);const F=Object(i.c)("div")`
  margin-left: 8px;
`,U=Object(i.c)(T.a)`
  max-width: 200px;
`,z=Object(i.c)(T.a)`
  margin-left: 8px;
`,k=Object(i.c)(T.a)`
  margin-left: 8px;
`,B=Object(i.c)(y.a)`
  height: 25px;
  width: 25px;
  justify-content: center;
  align-items: center;
  position: relative;
`,W=Object(i.c)(A.a)`
  margin-right: 8px;
`,G=Object(i.c)(h.Rc)`
  margin-left: 8px;
`,H=({activeItem:{data:e}})=>{const t=Object(L.f)(e);return r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(B,null,(()=>{switch(e.type){case O.c.TELEPORT:return r.a.createElement(w.a,{type:"teleport"});case O.c.WIRED:case O.c.WIRELESS:default:return r.a.createElement(S.a,{client:e,alt:e.name})}})()),r.a.createElement(F,null,r.a.createElement(U,{size:"body",weight:"bold",truncate:!0},t)))},Y=r.a.memo(({activeItem:e})=>{var t,a;return r.a.createElement(y.a,{alignItems:"center"},Object(u.Ec)(e.data)&&r.a.createElement(W,{width:30,height:30}),r.a.createElement(B,null,r.a.createElement(f.c,{device:e.data})),r.a.createElement(F,null,r.a.createElement(U,{size:"body",weight:"bold",truncate:!0},Object(x.d)(e.data))),(null===(t=e.data)||void 0===t?void 0:t.model_in_eol)&&r.a.createElement(z,{color:"danger",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_LABEL_EOL"})),(null===(a=e.data)||void 0===a?void 0:a.model_in_lts)&&r.a.createElement(z,{color:"warning",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_LABEL_LTS"})),Object(u.Pd)(e.data)&&r.a.createElement(G,{size:"medium",isActive:!0}))},(e,t)=>{var a,n,l,r;return(null===(a=e.activeItem.data)||void 0===a?void 0:a.mac)===(null===(n=t.activeItem.data)||void 0===n?void 0:n.mac)&&(null===(l=e.activeItem.data)||void 0===l?void 0:l.name)===(null===(r=t.activeItem.data)||void 0===r?void 0:r.name)}),$=({activeItem:{data:e,data:{client_name:t}}})=>r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(B,null,r.a.createElement(j,{data:e,width:25,height:25})),r.a.createElement(F,null,r.a.createElement(U,{size:"body",weight:"bold",truncate:!0},t))),K=()=>{const e=Object(o.useSelector)(M.a);return r.a.createElement(y.a,{alignItems:"center"},r.a.createElement("img",{alt:"IPS Event",src:e+"/ipsEvent.png"}),r.a.createElement(k,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"TM_IPS_IDS_ALERT"})))},X=({activeItem:{data:e}})=>{const t=Object(o.useSelector)(V.y);return r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(k,{weight:"bold",size:"body"},r.a.createElement(D.a,{id:"TM_TRAFFIC_FROM_TO",values:{formattedDate:`${Object(P.format)(e.start_timestamp,t)} - ${Object(P.format)(e.end_timestamp,t)}`}})))},q=()=>r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(h.ib,null),r.a.createElement(k,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"TM_HONEYPOT_ALERT"})));var Z=({activeItem:e})=>{switch(e.type){case b.c.CLIENT:case b.c.UNIFI_DEVICE_CLIENT:return r.a.createElement(H,{activeItem:e});case b.c.DEVICE:return r.a.createElement(Y,{activeItem:e});case b.c.WIFI_MAN:return r.a.createElement($,{activeItem:e});case b.c.ISP_DETAILS:return r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(h.H,{width:25.25,height:25.25}),r.a.createElement(k,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_INTERNET"})));case b.c.THREAT_EVENT:return r.a.createElement(K,null);case b.c.TRAFFIC_STATS:return r.a.createElement(X,{activeItem:e});case b.c.HONEYPOT_ALERT:return r.a.createElement(q,null);default:return null}},J=a(2803);const Q=Object(i.c)("div")`
  position: relative;
`;var ee=({history:e,match:{params:{site:t,id:a,panel:n,page:l,subPage:i,subPageId:c,subSubPageId:E}},tabs:s})=>{const m=Object(o.useSelector)(Object(d.j)(t));return(null==s?void 0:s.length)?r.a.createElement(Q,null,r.a.createElement(J.a,{tabs:s,selectedTab:n,onSelectTab:t=>e.push(`${m}/${l}/${i?i+"/":""}${c?c+"/":""}${E?E+"/":""}properties/${a}/${t.id}`)})):null},te=a(115),ae=a(1659),ne=a(206),le=a(31);const re=Object(i.c)(le.f)`
  background-color: ${te.o.success};
  color: ${te.f};
  font-size: 11px;
`,ie=Object(i.c)("div")`
  font-weight: bold;
  margin-bottom: 4px;
`;var ce=({activeItem:e})=>{if("model"in e&&!(e=>"product_line"in e&&e.product_line!==ne.c.NETWORK)(e)){if(Object(u.re)(e)&&Object(u.ve)(e)){const t=Object(u.rc)(e);return r.a.createElement(re,{flex:"none",height:"50px",minHeight:"50px",padding:"8px 32px",position:"relative"},r.a.createElement(le.f,{alignItems:"center",justifyContent:"center",marginRight:16},r.a.createElement(ae.a,{width:18,height:18,strength:t,color:"currentColor",inactiveColor:te.e})),r.a.createElement(le.f,{flexDirection:"column",justifyContent:"center",flex:"1"},r.a.createElement(ie,null,r.a.createElement(D.b,{id:"DEVICE_ULTE_IS_ACTIVE_TITLE"})),r.a.createElement(D.b,{id:"DEVICE_ULTE_IS_ACTIVE_DETAILS"})))}}return null},oe=a(173),Ee=a(158),se=a(56),me=a(8),de=a(27);const _e="/api/s/{site}/cmd/stamgr",be=(e,t,a={})=>Object(me.o)(se.a.KICK_STA,_e,{mac:e},{...Object(de.a)("CLIENT_ACTIONS_RECONNECT_ERROR","CLIENT_ACTIONS_RECONNECT_NOTICE",{clientName:t}),...a});var ue=a(79),Oe=a(35);const pe=Object(i.c)(le.f)`
  padding: 24px 32px 0;
`,Ie=Object(i.c)("div")`
  margin-bottom: 16px;
  button {
    font-size: ${({theme:e})=>e.fontSize["font-size-body"]};
    font-weight: 700;
  }
`;var ge=({activeItem:e,dispatch:t})=>{var a,n;const i=null!==(n=null===(a=Object(o.useSelector)(V.C))||void 0===a?void 0:a.offlineClientTimeframe)&&void 0!==n?n:O.d.DAY,c=e.connected&&e.type===O.c.WIRELESS,E=e.connected&&Object(L.q)(e),s="authorized"in e&&e.authorized,m=E&&!1===s,d=E&&s,_=Object(l.useCallback)(e=>{const{connected:a}=e,n=Object(L.f)(e),l=["mac"in e&&e.mac];l&&t(Object(ue.a)({title:"CLIENT_ACTIONS_FORGET_CONFIRM_TITLE",titleValues:{clientName:n},message:"CLIENT_ACTIONS_FORGET_CONFIRM_MESSAGE",messageValues:{clientName:n},onConfirm:()=>{t(((e,t,a={})=>Object(me.o)(se.a.FORGET_STA,_e,{macs:e},{...Object(de.a)("CLIENT_ACTIONS_FORGET_ERROR","CLIENT_ACTIONS_FORGET_NOTICE",{clientName:t}),...a}))(l,n)).then(()=>t(Object(Oe.e)())).then(()=>t(Object(Ee.c)(l[0],a?O.a.ACTIVE:O.a.OFFLINE)))}}))},[t]),b=Object(l.useCallback)(e=>{const{connected:a}=e,n="mac"in e&&e.mac,l=Object(L.f)(e);n&&t(Object(ue.a)({title:"CLIENT_ACTIONS_BLOCK_CONFIRM_TITLE",titleValues:{clientName:l},message:"CLIENT_ACTIONS_BLOCK_CONFIRM_MESSAGE",messageValues:{clientName:l},onConfirm:()=>{t(((e,t,a={})=>Object(me.o)(se.a.BLOCK_STA,_e,{mac:e},{...Object(de.a)("CLIENT_ACTIONS_BLOCK_ERROR","CLIENT_ACTIONS_BLOCK_NOTICE",{clientName:t}),...a}))(n,l)).then(()=>t(Object(Oe.e)())).then(()=>{t(Object(Ee.c)(n,a?O.a.ACTIVE:O.a.OFFLINE)),t(Object(Ee.e)()),t(Object(Ee.h)({queryParams:{withinHours:i}}))})}}))},[t,i]),u=Object(l.useCallback)(e=>{const a="mac"in e&&e.mac,n=Object(L.f)(e);t(Object(ue.a)({title:"CLIENT_ACTIONS_UNBLOCK_CONFIRM_TITLE",titleValues:{clientName:n},message:"CLIENT_ACTIONS_UNBLOCK_CONFIRM_MESSAGE",messageValues:{clientName:n},onConfirm:()=>{t(((e,t,a={})=>Object(me.o)(se.a.UNBLOCK_STA,_e,{mac:e},{...Object(de.a)("CLIENT_ACTIONS_UNBLOCK_ERROR","CLIENT_ACTIONS_UNBLOCK_NOTICE",{clientName:t}),...a}))(a,n)).then(()=>t(Object(Oe.e)())).then(()=>{t(Object(Ee.c)(a,O.a.BLOCKED)),t(Object(Ee.h)({queryParams:{withinHours:i}})),t(Object(Ee.e)())})}}))},[t,i]),p=Object(l.useCallback)(e=>{const a=Object(L.f)(e),n="mac"in e&&e.mac;t(be(n,a))},[t]),I=Object(l.useCallback)(e=>{const a=Object(L.f)(e),n="mac"in e&&e.mac;t(((e,t,a={})=>Object(me.o)(se.a.AUTHORIZE_GUEST,_e,{mac:e},{...Object(de.a)("CLIENT_ACTIONS_AUTHORIZE_ERROR","CLIENT_ACTIONS_AUTHORIZE_NOTICE",{clientName:t}),...a}))(n,a))},[t]),g=Object(l.useCallback)(e=>{const a=Object(L.f)(e),n="mac"in e&&e.mac;t(((e,t,a={})=>Object(me.o)(se.a.UNAUTHORIZE_GUEST,_e,{mac:e},{...Object(de.a)("CLIENT_ACTIONS_UNAUTHORIZE_ERROR","CLIENT_ACTIONS_UNAUTHORIZE_NOTICE",{clientName:t}),...a}))(n,a))},[t]);return r.a.createElement(le.a,null,r.a.createElement(pe,{flexDirection:"column"},c&&r.a.createElement(Ie,null,r.a.createElement(oe.a,{variant:"inline",onClick:()=>p(e)},r.a.createElement(T.a,{size:"body",weight:"bold",color:"info"},r.a.createElement(D.b,{id:"COMMON_ACTION_RECONNECT"})))),m&&r.a.createElement(Ie,null,r.a.createElement(oe.a,{variant:"inline",onClick:()=>I(e)},r.a.createElement(T.a,{size:"body",weight:"bold",color:"info"},r.a.createElement(D.b,{id:"COMMON_ACTION_AUTHORIZE"})))),d&&r.a.createElement(Ie,null,r.a.createElement(oe.a,{variant:"inline",onClick:()=>g(e)},r.a.createElement(T.a,{size:"body",weight:"bold",color:"info"},r.a.createElement(D.b,{id:"COMMON_ACTION_UNAUTHORIZE"})))),e.blocked?r.a.createElement(Ie,null,r.a.createElement(oe.a,{variant:"inline",onClick:()=>u(e)},r.a.createElement(T.a,{size:"body",weight:"bold",color:"info"},r.a.createElement(D.b,{id:"COMMON_ACTION_UNBLOCK"})))):r.a.createElement(Ie,null,r.a.createElement(oe.a,{variant:"inline",onClick:()=>b(e)},r.a.createElement(T.a,{size:"body",weight:"bold",color:"danger"},r.a.createElement(D.b,{id:"COMMON_ACTION_BLOCK"})))),r.a.createElement(Ie,null,r.a.createElement(oe.a,{variant:"inline",onClick:()=>_(e)},r.a.createElement(T.a,{size:"body",weight:"bold",color:"danger"},r.a.createElement(D.b,{id:"COMMON_ACTION_FORGET"}))))))},ve=a(6),Ce=a(1106),Re=a(625);const Te=Object(i.c)(T.a)`
  line-height: 16px;
`;var he=({deviceModel:e})=>{const t=Object(o.useDispatch)();return r.a.createElement(oe.a,{variant:"inline",onClick:()=>t(Object(Re.c)(e)),iconPosition:"right"},r.a.createElement(y.a,null,r.a.createElement(Te,{size:"label",weight:"bold",color:"info"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_COMPLIANCE"}))))},De=a(138),Pe=a.n(De),ye=a(1132),fe=a(32),Se=a(124),Ae=a(271),Ne=a(647),je=a(18),Le=a(246),xe=a(272),Me=a(251),Ve=a(14),we=a(187),Fe=a(23),Ue=a(306),ze=a(20),ke=a(85),Be=a(74);const We=Object(i.c)(Be.a,{shouldForwardProp:e=>"disabled"!==e})`
  padding: 0;
  ${({disabled:e})=>e&&"pointer-events: none;"};
  color: ${({theme:e,disabled:t})=>t?e.motifPalette.red05:e.motifPalette.red06};

  &:hover {
    color: ${({theme:e,disabled:t})=>e.motifPalette.red05};
  }

  &:active {
    color: ${({theme:e,disabled:t})=>t?e.motifPalette.red05:e.motifPalette.red07};
  }
`;var Ge=Object(n.o)(({device:e,history:t,location:a})=>{const n=Object(o.useDispatch)(),[i,c]=Object(l.useState)(!1),E=Object(o.useSelector)(ze.s),s=Object(l.useCallback)(l=>{l.preventDefault(),l.stopPropagation(),n(Object(ve.confirmDeviceForget)({name:Object(x.d)(e),onConfirm:async()=>{c(!0);try{await n(Object(Ue.b)(e.mac)),n(Object(ke.deleteUnifiDeviceFromStore)(e.mac)),n(Object(ve.deleteDeviceFromStore)(e.mac)),c(!1),n(Object(v.f)()),t.push(a.pathname.split("/properties")[0])}catch(l){c(!1)}},onCancel:()=>{n(Object(Oe.e)()),c(!1)}}))},[e.mac,e.name,n,t,a.pathname]);return r.a.createElement(We,{disabled:E,variant:"link",onClick:s,loader:i?"spinner":null,type:"button"},r.a.createElement(D.b,{id:"COMMON_ACTION_FORGET"}))}),He=a(11),Ye=a(325);const $e=Object(i.c)(T.a)`
  line-height: 20px;
`;var Ke=()=>r.a.createElement(Ye.a,{level:"danger"},r.a.createElement($e,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_ADOPT_ERROR_CREDENTIALS_MESSAGE"})));const Xe=Object(i.c)("div")`
  margin-bottom: 32px;
`;var qe=()=>r.a.createElement(Xe,null);const Ze=Object(i.c)(T.a)`
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
`,Je=Object(i.c)("div")`
  margin-bottom: ${e=>e.marginBottom||0}px;
`,Qe=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  padding: 0 ${({theme:e})=>e.space[3]}px;
  line-height: 14px;
  white-space: nowrap;
`,et={username:"",password:""};var tt=Object(Ve.f)({mapPropsToValues:()=>et,validationSchema:Fe.a.object().shape({username:Fe.a.string().label("DEVICE_ADVANCED_ADOPTION_FORM_LABEL_USERNAME").required(),password:Fe.a.string().label("DEVICE_ADVANCED_ADOPTION_FORM_LABEL_PASSWORD").required()}),handleSubmit:(e,{props:{onSubmitAction:t}})=>{t({values:e})}})(({device:e,handleSubmit:t,isValid:a,dirty:n})=>{const i=!!(null==e?void 0:e.adoptable_when_upgraded),{adopt_state:c}=e,E=c===ve.AdoptState.ADOPT_LOGINFAIL,s=Object(ve.getDeviceState)(e),m=s===ve.DeviceState.ADOPTION_FAILED,[d,_]=Object(l.useState)(s===ve.DeviceState.ADOPTING),b=Object(o.useSelector)(we.f),u=Object(ve.isUlte)(e),O=Object(ve.isUBB)(e)&&!Object(ve.getIsUbbPeerAdoptable)(e),p=d||u&&!b||O;Object(l.useEffect)(()=>{_(s===ve.DeviceState.ADOPTING)},[s]);const I=()=>{a&&n&&(t(),_(!0))};return r.a.createElement("form",{autoComplete:"off",onSubmit:I},r.a.createElement(Ze,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_ADVANCED_ADOPTION_FORM_HEADER"})),E&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ke,null),r.a.createElement(qe,null)),r.a.createElement(Je,{marginBottom:24},r.a.createElement(He.Field,{name:"username",label:"DEVICE_ADVANCED_ADOPTION_FORM_LABEL_USERNAME",full:!0})),r.a.createElement(Je,{marginBottom:24},r.a.createElement(He.Field,{name:"password",type:"password",label:"DEVICE_ADVANCED_ADOPTION_FORM_LABEL_PASSWORD",full:!0})),r.a.createElement(y.a,{justifyContent:m?"space-between":"flex-end"},m&&r.a.createElement(Ge,{device:e}),r.a.createElement(Qe,{type:"submit",onClick:I,disabled:p||!a||!n,variant:"primary"},r.a.createElement(D.b,{id:i?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE":"DEVICE_ACTIONS_ADOPT"}))))});const at=Object(i.c)(T.a)`
  line-height: 20px;
  margin-bottom: 10px;
`;var nt=()=>r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(at,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ACTIONS_ADOPT_WARNING_MESSAGE"})));const lt=Object(i.c)(T.a)`
  line-height: 20px;
`;var rt=()=>r.a.createElement(Ye.a,{level:"info"},r.a.createElement(lt,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ADVANCED_ADOPTION_MESSAGE_CREDENTIALS_INFO"})));const it=Object(i.c)(T.a)`
  line-height: 20px;
  vertical-align: top;
`,ct=Object(i.c)("ul")`
  margin: 20px 0;
  padding-left: 18px;
  line-height: 20px;
`;var ot=()=>r.a.createElement(Ye.a,{level:"info"},r.a.createElement(it,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ADVANCED_ADOPTION_MESSAGE_READOPT_INFO_HEADER"})),r.a.createElement(ct,null,r.a.createElement("li",null,r.a.createElement(it,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ADVANCED_ADOPTION_MESSAGE_READOPT_INFO_P1"}))),r.a.createElement("li",null,r.a.createElement(it,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ADVANCED_ADOPTION_MESSAGE_READOPT_INFO_P2"}))),r.a.createElement("li",null,r.a.createElement(it,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ADVANCED_ADOPTION_MESSAGE_READOPT_INFO_P3"})))),r.a.createElement(it,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_ADVANCED_ADOPTION_MESSAGE_READOPT_INFO_SUMMARY"})));const Et=Object(i.c)(T.a)`
  line-height: 16px;
  margin-bottom: 10px;
`;var st=()=>r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(Et,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_ULTE_USG_REQUIRED"})));const mt=Object(i.c)(T.a)`
  line-height: 16px;
  margin-bottom: 10px;
`;var dt=()=>r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(mt,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_UBB_ADOPT_WARNING_MESSAGE"})));const _t=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  padding: 0 ${({theme:e})=>e.space[3]}px;
  line-height: 14px;
  white-space: nowrap;
`;var bt=Object(D.e)(({device:e,showForNonAdoptableGateway:t,intl:a,buttonProps:{...i}={}})=>{const c=Object(o.useSelector)(V.q)("API_DEVICE_ADOPT"),E=Object(o.useSelector)(Se.u),s=Object(o.useSelector)(Ne.e),m=Object(o.useSelector)(M.a),d=Object(o.useDispatch)(),_=Object(n.k)(),b=Object(u.H)(e),O=b===fe.f.ADOPTION_FAILED,p=Object(l.useMemo)(()=>Object(u.Nc)(e),[e]),I=Object(l.useMemo)(()=>Object(u.Mc)(e),[e.mac]),g=Object(l.useMemo)(()=>Object(u.Oc)(e),[e.mac]),v=!!(null==e?void 0:e.adoptable_when_upgraded),C=Object(u.kd)(e)&&!Object(u.ld)(E,e),R=Object(u.re)(e),T=R&&!Object(u.se)(E,e),h=R&&!(null==e?void 0:e.lte_imei),P=!p&&(I||g)&&c&&!(T||C&&!t),[S,A]=Object(l.useState)(b===fe.f.ADOPTING),[N,j]=Object(l.useState)(!1),L=R&&!s,x=Object(u.Td)(e)&&!Object(u.ab)(e),w=Object(Le.a)("wifi/network/form"),F=S||L||x,U=Object(o.useSelector)(xe.b),z=Object(o.useSelector)(Me.f);Object(l.useEffect)(()=>{A(b===fe.f.ADOPTING)},[b]),Object(l.useEffect)(()=>{j(!1)},[e.mac]);const k=t=>{function n(){R?(d(Object(Re.d)(e.mac,Object(u.we)(e)?"LTE_PRO_ADOPTION":"LTE_ADOPTION")),A(!1)):function(){if(e.discovered_by===ye.a.PROTOCOL_V2_ID)A(!1);else{if(g){const{values:a}=t;d(Object(Ae.b)(e,a)).then(A(!0))}else d(Object(Ae.a)(e)).then(A(!0));if(Object(u.Id)(e)){const t=Pe()();U||d(Object(je.a)({icon:r.a.createElement("div",null,r.a.createElement(f.b,{deviceType:null==e?void 0:e.type,deviceModel:null==e?void 0:e.model,publicImagePath:m,width:53,height:53})),title:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_TITLE",message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_MESSAGE",primaryButton:{label:a.formatMessage({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{_.push(w),d(Object(je.b)(t))}},translateTitle:!0},t)),z&&d(Object(je.a)({icon:r.a.createElement("div",null,r.a.createElement(f.b,{deviceType:null==e?void 0:e.type,deviceModel:null==e?void 0:e.model,publicImagePath:m,width:53,height:53})),title:a.formatMessage({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_TITLE"},{deviceName:null==e?void 0:e.hostname}),message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_MESSAGE",primaryButton:{label:a.formatMessage({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{_.push(w),d(Object(je.b)(t))}},translateTitle:!0},t))}}}()}function l(){const{elite:t}=e;if(t&&t.replacement_for_mac){const e=E.find(e=>e.mac===t.replacement_for_mac);d(Object(ue.a)({title:"DEVICE_APPLY_CONFIGURATION_HEADER",titleValues:{deviceName:e.name},message:"DEVICE_APPLY_CONFIGURATION_MESSAGE",messageValues:{deviceName:e.name},size:"small",onConfirm:()=>{d(Object(Oe.e)())},onCancel:()=>{d(Object(Oe.e)()),n()}}))}else n()}v?d(Object(ue.a)({title:"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_TITLE",titleValues:{deviceName:e.name},message:e.upgrade_to_firmware?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_VERSION_MESSAGE":"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_MESSAGE",messageValues:{fromVersion:e.version,toVersion:e.upgrade_to_firmware},size:"small",onConfirm:()=>{d(Object(Oe.e)()),l()},onCancel:()=>{d(Object(Oe.e)()),A(!1)}})):l()};return!P||h?null:r.a.createElement(y.a,{flexDirection:"column"},L&&r.a.createElement(r.a.Fragment,null,r.a.createElement(st,null),r.a.createElement(qe,null)),x&&r.a.createElement(r.a.Fragment,null,r.a.createElement(dt,null),r.a.createElement(qe,null)),O&&!g&&r.a.createElement(r.a.Fragment,null,r.a.createElement(nt,null),r.a.createElement(qe,null)),g&&!N&&r.a.createElement(r.a.Fragment,null,r.a.createElement(ot,null),r.a.createElement(qe,null)),g&&N&&r.a.createElement(r.a.Fragment,null,r.a.createElement(rt,null),r.a.createElement(qe,null),r.a.createElement(tt,{device:e,onSubmitAction:k}),r.a.createElement(qe,null)),I&&r.a.createElement(y.a,{justifyContent:O?"space-between":"flex-end"},O&&r.a.createElement(Ge,{device:e}),r.a.createElement(_t,Object.assign({variant:"primary",onClick:e=>{e.preventDefault(),e.stopPropagation(),k()},disabled:F},i),r.a.createElement(D.b,{id:v?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE":"DEVICE_ACTIONS_ADOPT"}))),g&&!N&&r.a.createElement(y.a,{justifyContent:O?"space-between":"flex-end"},O&&r.a.createElement(Ge,{device:e}),r.a.createElement(_t,{variant:"primary",onClick:()=>j(!0)},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_ADVANCED_ADOPTION"}))))});const ut=Object(i.c)(le.f)`
  padding: 0 32px;
`,Ot=Object(i.c)(le.f)`
  margin: 0 32px;
  padding: 14px;
  background: ${({theme:e})=>e.motifPalette.neutral01};
  border-radius: 4px;

  > svg {
    margin-right: 12px !important;
  }
`,pt=Object(i.c)(le.f)`
  padding: 24px 32px 0;
`,It=Object(i.c)(le.f)`
  margin-bottom: 16px;
`;var gt=({activeItem:e})=>{var t;const a=Object(ve.isGateway)(e),n=Object(o.useSelector)(ve.selectSiteGateway),i=Object(ve.isNonRemovableGateway)(n),c=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),E=null===(t=_.deviceModels[e.model])||void 0===t?void 0:t.compliance;return c?r.a.createElement(pt,{flexDirection:"column"},r.a.createElement(It,{justifyContent:"space-between"},r.a.createElement(Ce.a,{device:e,size:"body"}),E&&r.a.createElement(he,{deviceModel:e.model}))):r.a.createElement(r.a.Fragment,null,a&&r.a.createElement(Ot,null,r.a.createElement(h.cb,{isActive:!0,size:"original",variant:"fill"}),r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.a,{id:i?"DEVICE_ADOPT_SECOND_GATEWAY_WHEN_UDM_USED_INFO":"DEVICE_ADOPT_SECOND_GATEWAY_INFO",values:{gateway:Object(x.d)(n)}}))),r.a.createElement(ut,{justifyContent:"flex-end"},r.a.createElement(bt,{device:e})))},vt=a(853);const Ct=Object(i.c)("div")`
  margin-bottom: 16px;
  button {
    font-size: ${({theme:e})=>e.fontSize["font-size-body"]};
    font-weight: 700;
  }
`,Rt=Object(i.c)(T.a,{shouldForwardProp:e=>"isPending"!==e})`
  ${({isPending:e,theme:t})=>e&&"color: "+t.motifPalette.blueDisabled};
`;var Tt;!function(e){e.RECONNECTION="reconnection"}(Tt||(Tt={}));const ht=({actionPending:e,onClick:t,label:a})=>r.a.createElement(Ct,null,r.a.createElement(oe.a,{variant:"inline",disabled:e,onClick:t},r.a.createElement(Rt,{size:"body",weight:"bold",color:"info",isPending:e},r.a.createElement(D.b,{id:a}))));var Dt,Pt=({activeItem:e,dispatch:t})=>{const[a,n]=Object(l.useReducer)((e,t)=>Object.assign({},e,{[t.type]:t.pending}),{[Tt.RECONNECTION]:!1}),i=Object(l.useMemo)(()=>Object(vt.p)(e.mac,["uptime"]),[e.mac]),c=Object(o.useSelector)(i);return e.type===O.c.WIRELESS&&!!c?r.a.createElement(le.a,null,r.a.createElement(le.f,{padding:"24px 32px 0"},r.a.createElement(ht,{actionPending:a[Tt.RECONNECTION],label:"COMMON_ACTION_RECONNECT",onClick:()=>{t(be(e.mac,Object(x.d)(e))),n({type:Tt.RECONNECTION,pending:!0})}}))):null},yt=a(289);!function(e){e.REVOKE="revoke",e.DISCONNECT="disconnect"}(Dt||(Dt={}));var ft=({activeItem:{id:e,connected:t},dispatch:a})=>{const[n,i]=Object(l.useReducer)((e,t)=>Object.assign({},e,{[t.type]:t.disabled}),{[Dt.REVOKE]:!1,[Dt.DISCONNECT]:!1});return r.a.createElement(yt.a,null,r.a.createElement(y.a,{flexDirection:"column",padding:"24px 32px 0"},r.a.createElement(y.a,{marginBottom:16},r.a.createElement(oe.a,{disabled:n[Dt.REVOKE],color:"danger",variant:"inline",weight:"bold",size:"medium",onClick:()=>{i({type:Dt.REVOKE,disabled:!0}),a(Object(Ee.i)(e,t)).finally(()=>i({type:Dt.REVOKE,disabled:!1}))}},r.a.createElement(T.a,{size:"body",weight:"bold",color:"inherit"},r.a.createElement(D.b,{id:"COMMON_ACTION_REVOKE_ACCESS"})))),t?r.a.createElement(y.a,null,r.a.createElement(oe.a,{disabled:n[Dt.DISCONNECT],variant:"inline",weight:"bold",size:"medium",onClick:()=>{i({type:Dt.DISCONNECT,disabled:!0}),a(Object(Ee.d)(e)).finally(()=>i({type:Dt.DISCONNECT,disabled:!1}))}},r.a.createElement(T.a,{size:"body",weight:"bold",color:"inherit"},r.a.createElement(D.b,{id:"COMMON_ACTION_DISCONNECT"})))):null))};const St=Object(i.c)(y.a,{shouldForwardProp:e=>"isDefaultPanel"!==e})`
  ${({isDefaultPanel:e})=>!e&&"height: 100%;"}
  overflow-x: hidden;
  overflow-y: scroll;
  overflow-y: overlay;
`,At=Object(D.e)(e=>{const{match:{path:t,params:a},activeItem:{type:i,data:c},location:o,match:E,history:s,intl:m,content:d,dispatch:_}=e,p=i===b.c.DEVICE&&!Object(u.Nc)(c),{id:I,site:g,panel:v,page:C,subPanel:R,subPage:T}=a,h=v===(null==d?void 0:d.default),D=Object(l.useMemo)(()=>d.singlePanel?null:p?[{id:d.default,label:m.formatMessage({id:d.panels[d.default].title}),icon:d.panels[d.default].icon}]:Object.keys(d.panels).reduce((t,a)=>{const{disabled:n,title:l,icon:r}=d.panels[a];return n&&"function"==typeof n&&n({...e})||t.push({id:a,label:m.formatMessage({id:l}),icon:r}),t},[]),[e,d,p]),P=Object(l.useCallback)(()=>{const l=Object(n.i)(t,{id:I,site:g,page:C,panel:d.default,subPage:T}),i=d.panels[v];if(!i)return r.a.createElement(n.c,{to:l});const{component:o,disabled:E}=i;if(!0===E||"function"==typeof E&&E({...e})||p&&v!==d.default)return r.a.createElement(n.c,{to:l});if(R&&i.subpanel){const{component:e}=i.subpanel;return r.a.createElement(e,{activeItem:c,params:a,path:t,history:s})}return r.a.createElement(o,{activeItem:c,params:a,path:t,history:s,key:`${v}${R&&i.subpanel?"-subpanel":""}`})},[d,c,p,v,a,t,e,R,I,C,g,T]);return r.a.createElement(l.Suspense,{fallback:null},r.a.createElement(y.a,{height:"100%",flexDirection:"column"},!d.singlePanel&&!p&&r.a.createElement(ee,{activeItem:c,tabs:D,history:s,match:E,location:o}),r.a.createElement(ce,{activeItem:c}),r.a.createElement(St,{isDefaultPanel:h,flexDirection:"column"},P(),Object(l.useMemo)(()=>{if(h)switch(C){case"clients":switch(c.type){case O.c.WIRED:case O.c.WIRELESS:return r.a.createElement(ge,{activeItem:c,dispatch:_});case O.c.TELEPORT:return r.a.createElement(ft,{activeItem:c,dispatch:_})}break;case"topology":case"devices":switch(i){case b.c.DEVICE:return r.a.createElement(gt,{activeItem:c});case b.c.UNIFI_DEVICE_CLIENT:return r.a.createElement(Pt,{activeItem:c,dispatch:_});default:return null}default:return null}return null},[c,C,i,h]))))});var Nt=r.a.memo(e=>e.match&&r.a.createElement(At,Object.assign({},e)),(e,t)=>null===t.match),jt=a(107),Lt=a(89),xt=a(1671),Mt=a(985),Vt=a(1154),wt=a(104),Ft=a(183),Ut=a(331),zt=a(70);const kt=Object(i.c)(oe.a)`
  padding: 4px 0;
  margin: 0;
  height: initial;
  font-size: ${({theme:e})=>e.fontSize["font-size-body"]};
  width: auto;
`,Bt=i.a`
  justify-content: flex-start;
`;var Wt=({item:e,itemType:t,message:a})=>{const n=Object(o.useDispatch)();return r.a.createElement(kt,{wrapClassName:Bt,variant:"link",size:"small",onClick:()=>n(Object(Oe.g)({modalType:zt.a.REPORT_WIFI_EXPERIENCE,modalProps:{item:e,itemType:t}}))},r.a.createElement(D.b,{id:a||"COMMON_REPORT_WIFI_EXPERIENCE_BUTTON"}))},Gt=a(880),Ht=a(474),Yt=a(1039);const $t=Object(i.c)(y.a)`
  background-color: ${({theme:e})=>e.motifPalette.neutral01};
`,Kt=Object(i.c)(f.c)`
  margin: 0 20px 0 0;
`,Xt=Object(i.c)(Ht.a)`
  margin-right: 8px;
`;var qt=({client:e,uplinkDevice:t})=>r.a.createElement($t,{borderRadius:4,height:64,padding:"10px",alignItems:"center",justifyContent:"space-between",marginTop:20},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Kt,{device:t,filesMap:"TOPOLOGY",height:34}),r.a.createElement(Xt,{variant:"success"}),r.a.createElement(T.a,{size:"caption",weight:"bold"},Object(x.c)(t))),r.a.createElement(y.a,{alignItems:"center",marginTop:4},r.a.createElement(Yt.a,{startTimestamp:e.assoc_time,size:"caption",color:"tertiary"})));const Zt=Object(i.c)("div")`
  border-top: 1px ${({theme:e})=>e.motifPalette.ui04} solid;
  margin: 8px 0;
`,Jt=Object(i.c)(xt.a)`
  position: relative;
  margin: 4px 0;
  border-radius: 16px;
  height: 4px;
`;var Qt=({item:e,showGraph:t,headerTitle:a,itemType:n,canReport:i,uplinkDevice:c,padding:E})=>{const s="mac"in e?e.mac:void 0,m="is_wired"in e?e.is_wired:void 0,d="wired_rate_mbps"in e?e.wired_rate_mbps:void 0,_="uplink_mac"in e&&e.uplink_mac,b="sw_port"in e&&e.sw_port,u="eagerly_discovered"in e&&e.eagerly_discovered,O=Object(l.useMemo)(()=>_&&b?Object(Gt.a)(_,b):()=>{},[_,b]),p=Object(o.useSelector)(O),{satisfaction:I,known:g}=((e,t)=>(e=>!("satisfaction"in e))(e)||(e=>!("satisfaction"in e))(e)?Object(L.e)(t,e):(e=>"satisfaction"in e)(e)?{satisfaction:e.satisfaction,known:Object(wt.d)(e.satisfaction)}:null)(e,p),v=Object(wt.c)(I);return r.a.createElement(y.a,{width:"100%",flexDirection:"column",justifyContent:"center",padding:E||"16px 32px 0",flex:"0 0 auto"},r.a.createElement(y.a,{width:"100%",justifyContent:"space-between",alignItems:"baseline"},r.a.createElement(T.a,{size:"header-xs",weight:"bold"},r.a.createElement(D.b,{id:a})),e.uptime?m&&d>0?r.a.createElement(T.a,{size:"header-l",color:"primary"},r.a.createElement("span",{style:{color:Mt.a.getGradientColor(I/100),fontWeight:700}},`${Object(Ft.b)(d)} ${10===d||100===d?`(${d} Mbps)`:""}`)):m||g||!u?r.a.createElement(T.a,{size:"header-l",color:v,weight:"bold"},I,"%"):r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(T.a,{size:"header-xs",weight:"bold",color:"info"},r.a.createElement(D.b,{id:"COMMON_WORD_INITIALIZING"}),"...")):r.a.createElement(T.a,{size:"body",color:"disabled"},r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))),g&&!m?r.a.createElement(Vt.a,{variant:v,value:I,size:"medium"}):m||g||!u?null:r.a.createElement(Jt,{placement:"below",isLoading:!0}),i&&e.uptime&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{margin:"8px 0"},r.a.createElement(Wt,{item:e,itemType:n})),r.a.createElement(Zt,null)),t&&!m&&r.a.createElement(Ut.b,{mac:s,itemType:n}),(n===Ut.a.CLIENT||n===Ut.a.UNIFI_CLIENT)&&!m&&e.uptime&&r.a.createElement(qt,{uplinkDevice:c,client:e}))},ea=a(109),ta=a(851),aa=a(132),na=a(571);var la=({children:e,flexProps:t={}})=>r.a.createElement(y.a,Object.assign({width:"100%",marginBottom:4,justifyContent:"space-between"},t),e);var ra=({activeItem:e,fingerprintData:{fingerprint_device_vendor:t,fingerprint_device_os:a}})=>r.a.createElement(y.a,{padding:"26px 32px",flexDirection:"column",height:"100%"},e.ip&&e.connected?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.ip)):null,e.mac?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_MAC_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.mac)):null,t||e.oui?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_MANUFACTURER"})),r.a.createElement(T.a,{style:{maxWidth:"110px"},color:"secondary",size:"body",truncate:!0},t||e.oui)):null,a?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_OS"})),r.a.createElement(T.a,{color:"secondary",size:"body",truncate:!0},a)):null,(()=>{switch(e.type){case O.c.WIRED:return r.a.createElement(r.a.Fragment,null,e.assoc_time?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(Yt.a,{startTimestamp:e.assoc_time})):null,r.a.createElement(na.a,{client:e,props:["usage_bytes"]},({usage_bytes:e=null})=>e?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_ACTIVITY_24_HRS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(ta.a,{size:"body",type:"bytes",input:e}))):null),r.a.createElement(na.a,{client:e,props:["tx_packets","tx_bytes"]},({tx_packets:e=0,tx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null),r.a.createElement(na.a,{client:e,props:["rx_packets","rx_bytes"]},({rx_packets:e=0,rx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null));case O.c.WIRELESS:return r.a.createElement(r.a.Fragment,null,e.essid?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SSID"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.essid)):null,e.radio||e.channel?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_BAND"})," / ",r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.radio?Object(L.E)(e):r.a.createElement(D.b,{id:"COMMON_HYPHEN"}),r.a.createElement(r.a.Fragment,null," / "),e.channel?e.channel:r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))):null,r.a.createElement(na.a,{client:e,props:["signal"]},({signal:e=null})=>e?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e," ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"}))):null),e.radio_proto?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WIFI_STANDARD"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(L.F)(e))):null,e.mimo?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_MIMO"})," ",r.a.createElement(D.b,{id:"COMMON_CONF"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(L.D)(e))):null,e.assoc_time?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(Yt.a,{startTimestamp:e.assoc_time})):null,r.a.createElement(na.a,{client:e,props:["usage_bytes"]},({usage_bytes:e=null})=>e?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_ACTIVITY_24_HRS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(ta.a,{size:"body",type:"bytes",input:e}))):null),r.a.createElement(na.a,{client:e,props:["tx_rate"]},({tx_rate:e=0})=>e>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_RX_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(aa.c)(1e3*e/8,"bitrate","SI"))):null),r.a.createElement(na.a,{client:e,props:["rx_rate"]},({rx_rate:e=0})=>e>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_TX_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(aa.c)(1e3*e/8,"bitrate","SI"))):null),r.a.createElement(na.a,{client:e,props:["tx_packets","tx_bytes"]},({tx_packets:e=0,tx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null),r.a.createElement(na.a,{client:e,props:["rx_packets","rx_bytes"]},({rx_packets:e=0,rx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null));default:return null}})()),ia=a(533),ca=a(318),oa=a(141),Ea=a(1044),sa=a(17),ma=a(756),da=a(640);const _a=Object(i.c)(T.a)`
  white-space: nowrap;
`,ba=Object(i.c)(T.a)`
  max-width: 150px;
  line-height: 1.6 !important;
  text-align: right;
`,ua=Object(i.c)(oe.a)`
  padding: 0;
  border: 0;
  margin: 0;
  line-height: 1.6;
`;var Oa=({activeItem:e,uplinkDevice:t,fingerprintData:a,history:n})=>{const{mac:i,name:c,fingerprint:E,network_name:s}=e,m=Object(L.o)(E),{fingerprint_device_name:d}=a,_=Object(L.J)(e.fingerprint),b=Object(L.I)(e),u=Object(o.useDispatch)(),p=Object(o.useSelector)(oa.b),I=Object(da.a)("/devices/properties/:mac/"+jt.a.OVERVIEW),g=Object(l.useCallback)(()=>{const t=Object(L.f)(e);u(Object(ia.c)(i,p)).then(()=>{let a=O.a.ACTIVE;e.blocked?a=O.a.BLOCKED:e.uptime||(a=O.a.OFFLINE);const n=Object.assign({},"fingerprint"in e?e.fingerprint:{},{dev_id_override:void 0,has_override:!1});u(Object(Ee.l)(i,{fingerprint:n},a)),u(Object(je.a)({icon:sa.a.success,message:"REPORT_CLIENT_FINGERPRINT_REVERT_SUCCESS",values:{clientName:t}}))}).catch(()=>{u(Object(je.a)({icon:sa.a.danger,message:"REPORT_CLIENT_FINGERPRINT_REVERT_ERROR",values:{clientName:t}}))})},[i,e.type,c,E,p]);return Object(C.a)(Number.isInteger(m)?[Object(ca.e)(m)]:()=>Promise.resolve({}),r.a.createElement(y.a,{padding:"24px 32px 0 18px",flexDirection:"column",justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"row"},r.a.createElement(y.a,{maxWidth:"33%",minWidth:"33%",margin:"auto 4px auto 0",alignItems:"center",justifyContent:"center"},r.a.createElement(S.a,{client:e,alt:e.name,grid:!0})),r.a.createElement(y.a,{width:"100%",flexDirection:"column"},d&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_MODEL"})),r.a.createElement(ba,{color:"secondary",size:"body",truncate:!0},d)),s&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_NETWORK"})),r.a.createElement(ba,{color:"secondary",size:"body",truncate:!0},s)),(v=Object(L.s)(t,e))&&r.a.createElement(la,null,r.a.createElement(_a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:e.type===O.c.WIRED?"CLIENT_HEADER_WIRED":"CLIENT_HEADER_WIRELESS"})),r.a.createElement(ua,{title:v,variant:"link",size:"medium",weight:"normal",onClick:()=>{(null==t?void 0:t.mac)&&n.push(I.replace(":mac",t.mac))}},Object(ma.a)(v,16))),r.a.createElement(y.a,{marginTop:12},!_&&!b&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary"}),r.a.createElement(ua,{variant:"link",onClick:()=>u(Object(Ea.f)(i))},r.a.createElement(D.b,{id:Object(L.H)(e)?"CLIENT_PROPERTIES_VALUES_FINGERPRINT_ACTION_REPORT_WRONG":"CLIENT_PROPERTIES_VALUES_FINGERPRINT_ACTION_REPORT_MISSING"}))),_&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary"}),r.a.createElement(ua,{variant:"link",onClick:g},r.a.createElement(D.b,{id:"CLIENT_PROPERTIES_VALUES_FINGERPRINT_ACTION_REVERT"}))))))));var v};var pa=({activeItem:e,...t})=>{const a=Object(l.useMemo)(()=>Object(Lt.selectClientFingerprint)(e),[e.fingerprint]),n=Object(o.useSelector)(a),i="uplink_mac"in e?e.uplink_mac:void 0,c="sw_port"in e?e.sw_port:void 0,E=Object(l.useMemo)(()=>i&&c?Object(Gt.a)(i,c):()=>{},[i,c]),s=Object(o.useSelector)(E),m=Object(Lt.getClientExperienceFromPort)(s,e),d=Object(l.useMemo)(()=>e.uplink_mac?Object(ea.o)(e.uplink_mac,["type","name","model","mac"]):()=>{},[e.uplink_mac]),_=Object(o.useSelector)(d);return r.a.createElement(r.a.Fragment,null,r.a.createElement(Oa,{activeItem:e,fingerprintData:n,uplinkDevice:_,history:t.history}),Object(Lt.getIsClientConnected)(e)&&r.a.createElement(Qt,{item:e,clientExperience:m,headerTitle:e.type===Lt.ClientType.WIRED?"CLIENT_HEADER_WIRED_EXPERIENCE":"COMMON_WIFI_EXP",showGraph:e.type===Lt.ClientType.WIRELESS&&(null==m?void 0:m.known)&&e.connected,itemType:Ut.a.CLIENT,uplinkDevice:_,canReport:!0}),r.a.createElement(ra,{activeItem:e,fingerprintData:n}),!Object(Lt.getIsClientConnected)(e)&&e.type===Lt.ClientType.WIRELESS&&new Date(1e3*e.last_seen).getTime()>(new Date).getTime()-864e5&&r.a.createElement("div",{style:{padding:"32px 32px 32px 16px"}},r.a.createElement(Ut.b,{mac:e.mac,itemType:Ut.a.CLIENT})))},Ia=a(48),ga=a(2701),va=a(1169),Ca=a(736),Ra=a(186),Ta=a(22),ha=a(2629),Da=a(2788),Pa=a(2764),ya=a(1670),fa=a(1183);const Sa=Mt.a.getDiscreteColorScaler(fa.DPI_CONVERTER_LIMIT),Aa=Object(i.c)(T.a,{shouldForwardProp:e=>"isTotalRow"!==e})`
  ${({isTotalRow:e})=>e&&"font-weight: 700;"}
`,Na=Object(i.c)(y.a)`
  width: 100%;
  margin-top: 30px;
`,ja=Object(i.c)(Ht.a,{shouldForwardProp:e=>"index"!==e})`
  background-color: ${({index:e})=>Sa(e)} !important;
  margin-right: 8px;
`,La=Object(i.c)(y.a)`
  padding: 10px ${({contentPaddingX:e=30})=>e}px 30px;
  font-size: 24px;

  table {
    color: ${({theme:e})=>e.motifPalette.text02};

    & > tbody > tr:last-child > td {
      border-bottom: 0 !important;
    }
  }
`,xa=Object(i.c)(h.cb)`
  margin-right: ${({theme:e})=>e.spacing["spacing-l"]};
  color: ${({theme:e})=>e.motifPalette.icon01};
`,Ma=Object(i.c)(y.a)`
  .titleClassName {
    font-weight: bold;
    font-size: 14px;
    transform: translate(8px, 10px);
  }
  .descriptionClassName {
    font-weight: bold;
    transform: translate(0, -34px);
  }
  box-shadow: 0 0 0 7px ${({theme:e})=>e.motifPalette.neutral02};
  border-radius: 100%;
`,Va=Object(i.c)(h.fb)`
  position: absolute;
  top: 52%;
  left: 36px;
  color: ${({theme:e})=>{var t;return null===(t=e.motifPalette)||void 0===t?void 0:t.uBlue06}};
`,wa=Object(i.c)(h.gb)`
  position: absolute;
  top: 52%;
  left: 36px;
  color: ${({theme:e})=>{var t;return null===(t=e.motifPalette)||void 0===t?void 0:t.purple06}};
`,Fa=[{id:"labelInfo",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_TRAFFIC_TAB_USAGE"})),renderCell:({label:e,index:t})=>{const a="COMMON_TOTAL_TRAFFIC"===e;return r.a.createElement(y.a,{alignItems:"center",maxWidth:165},!a&&r.a.createElement(ja,{index:t}),r.a.createElement(Aa,{color:"inherit",truncate:!0,size:"body",isTotalRow:a},a?r.a.createElement(D.b,{id:e}):e))},minWidth:80,maxWidth:179},{id:"bytesParsed",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_TRAFFIC_TAB_BYTES"})),renderCell:({bytesParsed:e,totalBytes:t})=>r.a.createElement(Aa,{color:"inherit",truncate:!0,size:"body",isTotalRow:!!t},t||e),minWidth:50,maxWidth:83},{id:"pkts",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_TRAFFIC_TAB_PACKETS"})),renderCell:({pkts:e,totalPackets:t})=>r.a.createElement(Aa,{color:"inherit",truncate:!0,size:"body",isTotalRow:!!t},t||e),minWidth:50,maxWidth:83}];var Ua=Object(D.e)(({contentPaddingX:e,intl:t,mac:a})=>{const n=Object(o.useDispatch)(),i={data:{macs:[a],type:"by_app"}},c={method:"post",crudCacheStrategy:{interval:3e4,type:me.a.COMBINED}},{data:E}=Object(o.useSelector)(Object(fa.selectFormattedStaDpiData)(i,c)),s=E.filter(({app:e})=>e!==fa.UNKNOWN_APP_ID);Object(l.useEffect)(()=>(a&&n(Object(fa.fetchTraffic)(i,c)),()=>{n(Object(me.c)(Object(fa.fetchTraffic)(i,c)))}),[a]);const[m,d]=Object(aa.c)(null==s?void 0:s.reduce((e,t)=>e+((null==t?void 0:t.rx_bytes)||0),0)).split(" "),[_,b]=Object(aa.c)(null==s?void 0:s.reduce((e,t)=>e+((null==t?void 0:t.tx_bytes)||0),0)).split(" "),u=Object(Da.a)((E||[]).reduce((e,t)=>e+((null==t?void 0:t.packets)||0),0)),O=Object(aa.c)((E||[]).reduce((e,t)=>e+((null==t?void 0:t.bytes)||0),0)),p=[...s,{id:"COMMON_TOTAL_TRAFFIC",label:"COMMON_TOTAL_TRAFFIC",totalBytes:O,totalPackets:u}];return r.a.createElement(r.a.Fragment,null,s.length?r.a.createElement(r.a.Fragment,null,m&&_&&r.a.createElement(Na,{alignItems:"center",justifyContent:"space-around"},[{items:s.map(({id:e,index:t,rx_bytes:a})=>({id:e,value:a,color:Sa(t)})),title:`${m} ${d}`,Icon:Va},{items:s.map(({id:e,index:t,tx_bytes:a})=>({id:e,value:a,color:Sa(t)})),title:`${_} ${b}`,Icon:wa}].map(({items:e,title:a,Icon:n})=>r.a.createElement(Ma,{key:`${a}-${e.rx_bytes}-${e.tx_bytes}`,justifyContent:"center",alignItems:"center"},r.a.createElement(y.a,{position:"relative"},r.a.createElement(n,{size:"medium"})),r.a.createElement(Pa.a,{items:e,title:a,description:t.formatMessage({id:"COMMON_IDENTIFIED_TRAFFIC"}),titleClassName:"titleClassName",descriptionClassName:"descriptionClassName",size:140,thickness:3.5,spacer:.5})))),r.a.createElement(La,{marginTop:36,contentPaddingX:e,justifyContent:"flex-start",alignItems:"center"},r.a.createElement(ya.a,{items:p,disableColumnFilters:!0,columns:Fa,rowHeight:32,disableTextPointer:!0,disableSelection:!0,disableHover:!0}))):r.a.createElement(y.a,{padding:"30px",alignItems:"center",justifyContent:"center"},r.a.createElement(xa,null),r.a.createElement(D.b,{id:"CLIENT_PROPERTY_TRAFFIC_TAB_EMPTY"})))});const za=Object(i.c)(y.a)`
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  button {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
  }
`,ka=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`,Ba=Object(i.c)(y.a)`
  > {
    &:last-child {
      margin-bottom: 0;
    }
  }
`,Wa=Object(i.c)(h.f)`
  color: ${({theme:e})=>e.motifPalette.neutral08};
`;var Ga=({activeItem:e})=>{const t=Object(n.k)(),{subPanelId:a,subPanel:i}=Object(n.m)(),c=Object(l.useMemo)(()=>(null==e?void 0:e.uplink_mac)?Object(ve.selectDeviceRecordProperties)(e.uplink_mac,["ip","name","model","mac"]):()=>{},[null==e?void 0:e.uplink_mac]),E=Object(o.useSelector)(c),s=E&&Object(x.c)(E)||"",m=Object(o.useSelector)(Object(va.b)(a||i));return Object(Ta.g)([Object(Ca.fetchSession)(e.mac,!1)],r.a.createElement(r.a.Fragment,null,r.a.createElement(za,{position:"relative",padding:"12px 0",marginBottom:34,justifyContent:"center",width:"100%"},r.a.createElement(Ra.c,{name:"backButton",onClick:()=>t.push("../insights")},r.a.createElement(Wa,{size:"small"})),(null==m?void 0:m.date)&&r.a.createElement(T.a,{size:"body",color:"secondary",weight:"bold"},m.date)),r.a.createElement(y.a,{padding:"0 30px",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},r.a.createElement(Ba,{width:"100%",flexDirection:"column"},(null==m?void 0:m.start)&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_START"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m.start)),(null==m?void 0:m.end)&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_END"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m.end)),(null==m?void 0:m.duration)&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_DURATION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m.duration)),(null==E?void 0:E.ip)&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},E.ip)),(null==E?void 0:E.mac)&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_MAC_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},E.mac)),(null==E?void 0:E.mac)&&s&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_UPLINK"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(ha.a,{uplinkMac:E.mac,uplinkName:s}))),(null==m?void 0:m.port)&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_PORT"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m.port)),(null==m?void 0:m.experience)>=0&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:(null==m?void 0:m.is_wired)?"CLIENT_PROPERTY_HISTORY_TAB_CLIENT_EXPERIENCE":"COMMON_WIFI_EXP"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement("span",{style:{color:Ia.a["color-"+Object(wt.b)(null==m?void 0:m.experience)]}},null==m?void 0:m.experience,"%"))))),(null==m?void 0:m.mac)&&r.a.createElement(ka,{renderOnlyExpandedContent:!0,variant:"secondary",items:[{id:"dpi",label:r.a.createElement(D.b,{id:"COMMON_TRAFFIC_ID"}),openByDefault:!0,renderContent:()=>r.a.createElement(Ua,{mac:m.mac,contentPaddingX:0})}]})))};const Ha=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`,Ya=Object(i.c)(y.a)`
  table {
    th {
      padding-left: 0;
    }
    tr {
      :hover {
        cursor: pointer;
      }
    }
    td {
      padding-left: 0;
      padding-right: 25px;
    }
  }
`,$a=Object(i.c)("div")`
  padding-top: 20px;
`,Ka=Object(i.c)(h.cb)`
  margin-right: 10px;
`,Xa=Object(i.c)("div")`
  padding-top: 10px;
`,qa=[{id:"date",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_DATE"})),renderCell:({date:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:80},{id:"start",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_START"})),renderCell:({start:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:60},{id:"duration",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_DURATION"})),renderCell:({duration:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:80}],Za=[{id:"date",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_DATE"})),renderCell:({date:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:80},{id:"start",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_START"})),renderCell:({start:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:60},{id:"duration",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_DURATION"})),renderCell:({duration:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:80},{id:"wifiExperience",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_TABLE_HEADER_WIFI_EXP"})),renderCell:({experience:e})=>r.a.createElement(r.a.Fragment,null,e>=0?r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},r.a.createElement("span",{style:{color:Ia.a["color-"+Object(wt.b)(e)]}},e,"%")):r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"}))),minWidth:80}];var Ja=({activeItem:{mac:e,is_wired:t}})=>{const{data:a,isLoading:l,error:i}=Object(o.useSelector)(Object(Ca.selectFormattedSessionData)(e,!1,[])),c=Object(n.k)();return Object(Ta.g)([Object(Ca.fetchSession)(e,!1)],r.a.createElement(r.a.Fragment,null,r.a.createElement(Ha,{variant:"secondary",renderOnlyExpandedContent:!0,multiOpen:!0,items:[{id:"dpi",label:r.a.createElement(D.b,{id:"COMMON_TRAFFIC_ID"}),openByDefault:!0,renderContent:()=>r.a.createElement(Ua,{mac:e,contentPaddingX:0})},{id:"history",label:r.a.createElement(D.b,{id:"CLIENT_ACCORDION_HEADER_HISTORY"}),openByDefault:!0,renderContent:()=>r.a.createElement(Ya,{justifyContent:"flex-start",alignItems:"center"},!l&&a.length>0&&r.a.createElement(ya.a,{items:a,disableColumnFilters:!0,columns:t?qa:Za,onRowClick:({id:e})=>c.push("insights/"+e),rowHeight:30,renderFooter:()=>r.a.createElement(Xa,null,r.a.createElement(D.b,{id:"CLIENT_PROPERTY_FOOTER_RECORDS",values:{length:a.length}}))}),(!l||i)&&0===a.length&&r.a.createElement($a,null,r.a.createElement(Ka,null),r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HISTORY_TAB_EMPTY"})))}]})))};var Qa=function(e){return function(t){return class extends r.a.Component{constructor(){super(...arguments),this.state=e.reduce((e,t)=>({...e,dirty:{...e.dirty,[t]:!1},invalid:{...e.invalid,[t]:!1}}),{dirty:{},invalid:{}}),this.setFormDirty=(e,t)=>{const{dirty:a}=this.state;a[e]!==t&&this.setState({dirty:{...a,[e]:t}})},this.setFormInvalid=(e,t)=>{const{invalid:a}=this.state;a[e]!==t&&this.setState({invalid:{...a,[e]:t}})}}render(){const{dirty:e,invalid:a}=this.state,n=!!Object.values(e).find(e=>e),l=!!Object.values(a).find(e=>e);return r.a.createElement(t,Object.assign({isDirty:n,isInvalid:l,formStates:e,setFormDirty:this.setFormDirty,setFormInvalid:this.setFormInvalid},this.props))}}}},en=a(61),tn=a(7),an=a(250),nn=a(15),ln=a(689),rn=a(26),cn=a(481),on=a(19),En=a(127),sn=a(574),mn=a.n(sn),dn=a(9);const _n=Object(dn.b)(dn.c,(e,t)=>mn()(e.map(e=>(({name:e,radio_table:t,apGroups:a})=>({name:e,radio_table:t,apGroups:a}))(e)),t.map(e=>(({name:e,radio_table:t,apGroups:a})=>({name:e,radio_table:t,apGroups:a}))(e))))(Object(dn.a)(ve.selectAdoptedApDevices,En.selectAPGroupsData,(e,t)=>e.map(({name:e,type:a,model:n,mac:l,radio_table:r})=>({name:e,type:a,model:n,mac:l,radio_table:r,apGroups:t.filter(e=>e.device_macs.includes(l)).map(({name:e})=>e)}))),e=>e);var bn=a(1656),un=a(435);const On=[{id:"AP",minWidth:50,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_HEADER_AP"})),renderCell:e=>r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(y.a,{marginRight:16,width:25,height:25,alignItems:"center"},r.a.createElement(f.c,{device:e})),r.a.createElement(T.a,{size:"body",color:"inherit"},Object(x.d)(e)))},{id:"channel",minWidth:30,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),renderCell:({radio_table:e,clientRadio:t})=>{var a;return r.a.createElement(T.a,{color:"inherit",size:"body"},(null===(a=null==e?void 0:e.find(e=>e.radio===t))||void 0===a?void 0:a.channel)||r.a.createElement(D.b,{id:"COMMON_NA"}))}},{id:"signal",minWidth:30,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),renderCell:({clientSignal:e,clientUplinkMac:t,fixed_ap_mac:a})=>r.a.createElement(y.a,{alignItems:"center",width:"100%",height:"100%"},r.a.createElement(T.a,{color:"inherit",size:"body"},a!==t?null:e," ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"})),a!==t?r.a.createElement(un.i,{placement:"below",isLoading:!0}):r.a.createElement(bn.a,{signal:e}))}],pn=e=>[{id:"AP",minWidth:80,label:r.a.createElement(y.a,{position:"absolute",left:-32},r.a.createElement(T.a,{color:"primary",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_HEADER_AP"}))),renderCell:e=>r.a.createElement(y.a,{alignItems:"center",width:"100%"},r.a.createElement(y.a,{marginRight:12,width:25,height:25,alignItems:"center"},r.a.createElement(f.c,{device:e})),r.a.createElement(T.a,{size:"body",color:"secondary",truncate:!0},Object(x.d)(e)))},{id:"channel",minWidth:50,label:r.a.createElement(T.a,{color:"primary",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),renderCell:({radio_table:t})=>{var a;return r.a.createElement(T.a,{color:"secondary",size:"body"},e.type===Lt.ClientType.WIRELESS&&(null===(a=null==t?void 0:t.find(t=>(null==t?void 0:t.radio)===(null==e?void 0:e.radio)))||void 0===a?void 0:a.channel)||r.a.createElement(D.b,{id:"COMMON_NA"}))}},{id:"apGroups",minWidth:60,label:r.a.createElement(T.a,{color:"primary",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"CLIENT_HEADER_AP_GROUP"})),renderCell:({apGroups:e})=>(null==e?void 0:e.length)?r.a.createElement(T.a,{color:"secondary",size:"body"},e.length>1?r.a.createElement(cn.a,{message:r.a.createElement(y.a,{flexDirection:"column"},e.map(e=>r.a.createElement(T.a,null,e))),position:"top",width:146},r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_AP_GROUPS",values:{length:e.length}})):e[0]):r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"COMMON_HYPHEn"}))}];var In=({activeItem:e,setSelectAccessPoint:t})=>{const{setFieldValue:a,values:{fixed_ap_mac:n}}=Object(Ve.e)(),i=Object(o.useDispatch)(),c=Object(o.useSelector)(_n),[E,s]=Object(l.useState)(n);return Object(Ta.g)([Object(En.fetchAPGroups)(void 0,{crudCacheStrategy:{type:me.a.CACHE}})],r.a.createElement(y.a,{height:"100%",flexDirection:"column"},r.a.createElement(y.a,{flexDirection:"column",height:"100%"},r.a.createElement(un.k,{width:"100%",height:48,position:"relative",alignItems:"center",justifyContent:"center"},r.a.createElement(Ra.c,{name:"goBack",onClick:()=>t(!1)},r.a.createElement(un.a,{size:"medium"})),r.a.createElement(T.a,{size:"body",color:"header"},r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_SELECT_AP"}))),r.a.createElement(y.a,{height:"100%",padding:"24px 32px",flexDirection:"column",justifyContent:"space-between"},r.a.createElement(ya.a,{items:c,columns:pn(e),disableColumnFilters:!0,disableSort:!0,hideCellOverflow:!1,idField:"mac",rowHeight:32,multiSelectMode:!0,initialSelectedIds:[n||e.uplink_mac],maximumSelections:1,onChangeSelection:e=>s((null==e?void 0:e[0])||null),renderFooter:()=>r.a.createElement(y.a,{marginTop:16},r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_TABLE_FOOTER",values:{length:c.length}}))}),r.a.createElement(y.a,{justifyContent:"flex-end"},r.a.createElement(oe.a,{onClick:()=>t(!1)},r.a.createElement(D.b,{id:"COMMON_ACTION_CANCEL"})),r.a.createElement(oe.a,{variant:"primary",onClick:()=>{a("fixed_ap_mac",E),t(!1),i(Object(Oe.g)({modalType:zt.a.LOCK_CLIENT_TO_THIS_AP,modalProps:{onClose:()=>{a("fixed_ap_mac",n),i(Object(Oe.e)())},onContinue:()=>i(Object(Oe.e)())}}))},disabled:!E||E===n},r.a.createElement(D.b,{id:"COMMON_ACTION_SAVE_SELECTION"})))))))},gn=a(170),vn=a(179);var Cn=Object(D.e)(({activeItem:e,values:t,setSelectAccessPoint:a,intl:n})=>{const i=Object(l.useMemo)(()=>t.fixed_ap_enabled&&(t.fixed_ap_mac||e.uplink_mac)?Object(ve.selectDeviceRecordProperties)(t.fixed_ap_mac||e.uplink_mac,["name","type","model","mac","radio_table"]):()=>{},[t.fixed_ap_enabled,t.fixed_ap_mac,e.uplink_mac]),c=Object(o.useSelector)(i),E=Object(o.useSelector)(Object(gn.f)(gn.a.LOCK_AP)),s=Object(o.useSelector)(Object(gn.g)(gn.a.LOCK_AP,gn.b.NOT_ALL_DEVICES_SUPPORT_FEATURE)),m=Object(o.useSelector)(Object(gn.g)(gn.a.LOCK_AP,gn.b.NO_SUPPORTED_DEVICES_IN_SETUP)),d=!E&&!!s,_=E&&!!s,b=!E&&!!m,u=!t.fixed_ap_enabled&&!e.connected,O=Object(l.useMemo)(()=>{var e;return null===(e=null==s?void 0:s.required_versions)||void 0===e?void 0:e.map(({min_firmware_version:e,type:t})=>`${t} ${e} ${n.formatMessage({id:"COMMON_WORD_OR"}).toLowerCase()} ${n.formatMessage({id:"COMMON_WORD_LATER"}).toLowerCase()}`).join(", ")},[null==s?void 0:s.required_versions]);return e.type===Lt.ClientType.WIRELESS?r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center",marginTop:8,marginBottom:16},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_LOCK_TO_AP"})),r.a.createElement(y.a,{marginLeft:10},r.a.createElement(cn.a,{message:r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_LOCK_TO_AP_TOOLTIP"})),width:208},r.a.createElement(un.h,{isActive:!0}))),_&&r.a.createElement(cn.a,{portal:!0,message:r.a.createElement(T.a,null,r.a.createElement(D.a,{id:"CLIENT_LOCK_AP_ALREADY_CONFIGURED_SYSTEM",values:{unsupportedApList:O}})),width:208},r.a.createElement(un.e,null))),r.a.createElement(vn.a,{condition:d||b||u,wrapper:e=>r.a.createElement(cn.a,{portal:!0,width:208,message:r.a.createElement(T.a,null,u?r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_DISCONNECTED"}):r.a.createElement(D.a,{id:"CLIENT_LOCK_AP_FIRST_TIME_CONFIGURATION",values:{unsupportedApList:O}}))},e)},r.a.createElement(on.a,{type:"checkbox",id:"fixed_ap_enabled",name:"fixed_ap_enabled",disabled:d||b||u}))),t.fixed_ap_enabled&&!d&&!b&&!u&&r.a.createElement(ya.a,{items:[Object.assign({},c,{clientSignal:e.signal,clientRadio:e.radio,clientUplinkMac:e.uplink_mac,fixed_ap_mac:t.fixed_ap_mac})],disableColumnFilters:!0,disableHover:!0,disableSelection:!0,disableTextPointer:!0,disableSort:!0,idField:"mac",columns:On,rowHeight:32,renderFooter:()=>r.a.createElement(y.a,{marginTop:32},r.a.createElement(un.b,{variant:"inline",onClick:()=>a(!0)},r.a.createElement(D.b,{id:"CLIENT_LOCK_AP_SELECT_DIFF_AP"})))})):null});var Rn=({resetForm:e,submitForm:t,setFormDirty:a,dirty:n,isDirty:i,activeItem:c,intl:o,userGroups:E,values:s,canAssignFixedIp:m,networkData:d})=>{const[_,b]=Object(l.useState)(!1);Object(l.useEffect)(()=>{a("clientSettings",n)},[n]);const u=Object(l.useMemo)(()=>[{label:o.formatMessage({id:"CLIENT_MODAL_INPUT_BANDWIDTH_PROFILE_DEFAULT"}),value:""},...E],[E]);return r.a.createElement(y.a,{height:"100%",flexDirection:"column",justifyContent:"space-between"},_?r.a.createElement(In,{activeItem:c,setSelectAccessPoint:b}):r.a.createElement(y.a,{height:"100%",padding:"24px 32px",flexDirection:"column"},r.a.createElement(un.c,{marginBottom:24},r.a.createElement(un.j,{iconBefore:r.a.createElement(un.d,{size:"original"}),label:"CLIENT_PROPERTY_GENERAL_TAB_DETAILS_NAME",labelClassName:"labelClassName",validationMessageClassName:"validationMessageClassName",name:"name",full:!0,size:"body",disabled:"product_line"in c})),r.a.createElement(un.c,{marginBottom:24},r.a.createElement(un.f,{label:"CLIENT_PROPERTY_GENERAL_TAB_BANDWIDTH_PROFILE",variant:"secondary",name:"usergroup_id",type:"dropdown",full:!0,validated:!0,translateLabel:!0,options:u})),s.usergroup_id&&r.a.createElement(y.a,{marginBottom:16},r.a.createElement(un.h,{isActive:!0}),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_GENERAL_TAB_BANDWIDTH_PROFILE_INFO"}))),r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center",marginBottom:16},r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_GENERAL_TAB_USE_FIXED_IP"})),r.a.createElement(cn.a,{message:r.a.createElement(D.b,{id:"CLIENT_PROPERTY_GENERAL_TAB_FIXED_IP_TOOLTIP"}),width:200,className:"ml-2",position:"bottom",style:{display:"inline-block"}},r.a.createElement(h.cb,{hidden:m,width:20,height:20,isActive:!0})),r.a.createElement(on.a,{type:"checkbox",id:"use_fixedip",name:"use_fixedip",disabled:!m})),s.use_fixedip&&r.a.createElement(r.a.Fragment,null,r.a.createElement(un.c,{marginBottom:24},r.a.createElement(on.a,{type:"dropdown",variant:"secondary",full:!0,validated:!0,name:"network_id",label:o.formatMessage({id:"COMMON_NETWORK"}),options:d,fontSize:"body"})),r.a.createElement(un.c,{marginBottom:16},r.a.createElement(on.a,{label:"COMMON_IP_ADDRESS",size:"body",full:!0,name:"fixed_ip",variant:"secondary"}))),c.type===Lt.ClientType.WIRELESS&&r.a.createElement(Cn,{setSelectAccessPoint:b,values:s,activeItem:c})),_?null:r.a.createElement(un.g,{isDirty:i,onFormSubmit:t,onFormCancel:e}))};const Tn=Object(Ve.f)({mapPropsToValues:({activeItem:{name:e,hostname:t,usergroup_id:a,use_fixedip:n,network_id:l,fixed_ip:r,ip:i},activeItem:c,defaultNetworkDataId:o,clients:E})=>{var s;return{name:t===e?"":e,usergroup_id:a||"",use_fixedip:!!n,network_id:l||o,fixed_ip:r||i,clients:E,...c.type===Lt.ClientType.WIRELESS&&{fixed_ap_enabled:null!==(s=c.fixed_ap_enabled)&&void 0!==s&&s,fixed_ap_mac:c.fixed_ap_mac||c.uplink_mac}}},validationSchema:({networkData:e,activeItem:{user_id:t,type:a}})=>tn.a.lazy(({network_id:n,fixed_ip:l,clients:i})=>{var c;const o=(null===(c=null==e?void 0:e.find(e=>(null==e?void 0:e.value)===n))||void 0===c?void 0:c.ipSubnet)||void 0;return tn.a.object().shape({name:tn.a.string(),usergroup_id:tn.a.string(),use_fixedip:tn.a.bool(),network_id:tn.a.string(),fixed_ip:tn.a.string().when("use_fixedip",{is:!0,then:tn.a.string().label("COMMON_IP_ADDRESS").matches(rn.j,{message:r.a.createElement(D.b,{id:"COMMON_VALIDATION_VALID_IPV4"})}).unifiIpv4InSubnet(o,r.a.createElement(D.b,{id:"CLIENT_PROPERTY_GENERAL_TAB_INPUT_IP_ADDRESS_VALIDATION",values:{value:l,subnet:o}})).test("isFixedIPUnique",r.a.createElement(D.b,{id:"CLIENT_PROPERTY_GENERAL_TAB_INPUT_IP_ADDRESS_UNIQUE"}),e=>!e||i.filter(e=>"user_id"in e&&e.user_id!==t).every(t=>!("fixed_ip"in t)||!t.fixed_ip||e!==t.fixed_ip)).required()}),...a===Lt.ClientType.WIRELESS&&{fixed_ap_enabled:tn.a.bool(),fixed_ap_mac:tn.a.string().when("fixed_ap_enabled",{is:!0,then:tn.a.string().matches(rn.s,{message:r.a.createElement(D.b,{id:"COMMON_VALIDATION_VALID_MAC"})}).required()})}})}),handleSubmit:(e,{props:{activeItem:{user_id:t,mac:a,blocked:n,connected:l},createToast:r,updateClient:i,updateClientDataInStore:c},setSubmitting:o,resetForm:E})=>{const s=(({clients:e,...t})=>t.fixed_ap_enabled?t:(({fixed_ap_mac:e,...t})=>t)(t))(e);i(s,a,t).then(t=>{t.data&&r({icon:sa.a.success,message:"CLIENT_NOTICE_SAVE_SUCCESS"}),E({values:e}),c(a,s,n?Lt.ClientModelType.BLOCKED:l?Lt.ClientModelType.ACTIVE:Lt.ClientModelType.OFFLINE)}).catch(()=>{r({icon:sa.a.danger,message:"CLIENT_NOTICE_SAVE_ERROR"}),E()}).finally(()=>{o(!1)})}}),hn={createToast:je.a,updateClient:Lt.updateClient,fetchNetworks:nn.fetchNetworks,tabSubmitFunction:v.j,tabResetFunction:v.i,updateClientDataInStore:Lt.updateClientDataInStore};var Dn=Object(en.compose)(Object(o.connect)(e=>({userGroups:Object(an.selectUserGroupOptions)(e),networkData:Object(ln.d)(e),defaultNetworkDataId:Object(ln.c)(e),canAssignFixedIp:Object(ln.a)(e),clients:Object(Lt.selectNetworkContainerClientsData)(e)}),hn),D.e,Tn)(Rn);var Pn=Qa(["clientSettings"])(({activeItem:e,isDirty:t,setFormDirty:a})=>r.a.createElement(y.a,{height:"100%",flexDirection:"column",justifyContent:"space-between"},r.a.createElement(Dn,{activeItem:e,isDirty:t,setFormDirty:a})));var yn={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"CLIENT_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:pa},insights:{path:"/insights",title:"CLIENT_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:Ja,subpanel:{path:"/:subPanel",component:Ga}},settings:{path:"/settings",title:"CLIENT_PROPERTY_HEADER_SETTINGS",icon:h.S,component:Pn}}},fn=a(549),Sn=a(288),An=a(99),Nn=a(363);const jn=Object(i.c)(y.a)`
  margin-bottom: 4px;
  justify-content: space-between;
  padding: 5px 0;

  span:last-child {
    max-width: 220px;
    text-align: right;
  }
`,Ln=Object(i.c)(Nn.a)`
  margin-right: 6px;
`;var xn=({activeItem:e})=>{var t;const{timestamp:a,src_ip:n,service:l,servicename:i}=e,c=Object(o.useSelector)(ze.E),E=Object(o.useSelector)(Sn.c);return r.a.createElement(y.a,{flexDirection:"column",padding:"26px 32px"},r.a.createElement(T.a,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_OVERVIEW"})),r.a.createElement(jn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_DATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(An.e)(new Date(1e3*a),E,fn.a))),r.a.createElement(jn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_TIME"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(An.e)(new Date(1e3*a),E,c))),r.a.createElement(jn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_SOURCE_IP"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Ln,null),n))),i?r.a.createElement(jn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_SERVICE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null===(t=null==i?void 0:i.toUpperCase)||void 0===t?void 0:t.call(i))):null,l?r.a.createElement(jn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_PORT"})),r.a.createElement(T.a,{color:"secondary",size:"body"},l)):null)};var Mn={default:jt.a.OVERVIEW,singlePanel:!0,panels:{overview:{path:"/overview",component:xn}}},Vn=a(95),wn=a(101);const Fn=Object(i.c)(y.a)`
  margin-bottom: 4px;
  justify-content: space-between;
`,Un=Object(i.c)(y.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  margin-top: 7px;
`;var zn=({activeItem:e})=>{const t=Object(n.k)(),{site:a}=Object(n.m)(),l=Object(o.useSelector)(d.i),{uptime:i,ip:c,port_idx:E,configuration:{wan_provider_capabilities:s,wan_dns1:m,wan_dns2:_},details:{service_provider:b}}=e;return r.a.createElement(y.a,{flexDirection:"column"},(null==b?void 0:b.name)?r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_SERVICE_PROVIDER"})),r.a.createElement(T.a,{color:"secondary",size:"body"},b.name)):null,(null==b?void 0:b.city)?r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_LABEL_LOCATION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},b.city)):null,r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_DOWNLOAD_CAPACITY"})),r.a.createElement(ta.a,{type:"bytes",input:1e3*((null==s?void 0:s.download_kilobits_per_second)||0)/8,options:"bitrate",color:"secondary",size:"body"})),r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_UPLOAD_CAPACITY"})),r.a.createElement(ta.a,{type:"bytes",input:1e3*((null==s?void 0:s.upload_kilobits_per_second)||0)/8,options:"bitrate",color:"secondary",size:"body"})),-1!==i?r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(ta.a,{type:"uptime",input:i,color:"secondary",size:"body"})):null,c?r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_WAN_IP",values:{port_idx:E}})),r.a.createElement(T.a,{color:"secondary",size:"body"},c)):null,(m||_)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_DNS_SERVER_1"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m)),r.a.createElement(Fn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_DNS_SERVER_2"})),r.a.createElement(T.a,{color:"secondary",size:"body"},_))),r.a.createElement(Un,null,r.a.createElement(oe.a,{size:"small",type:"button",variant:"inline",onClick:()=>{const e=Object(n.i)(l,{site:a});t.push(`${e}${wn.a.internetSettings}`)}},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_LINK_INTERNET_SETTINGS"}))))},kn=a(2622);const Bn=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  font-weight: normal;
`;var Wn=({device:e,...t})=>{const a=Object(o.useSelector)(t=>Object(ve.getUplink)(Object(ve.selectDevicesData)(t),e)),l=Object(o.useSelector)(oa.b),i=Object(n.k)(),c=Object(o.useDispatch)(),E=Object(ve.getUplinkDisplayName)(e,a);return E?r.a.createElement(Bn,Object.assign({noWrap:!0,variant:"link",size:"small",onClick:e=>{e.preventDefault(),e.stopPropagation(),i.push(`/${l}/devices/properties/${a.mac}`),c(Object(v.g)({type:b.c.DEVICE,mac:a.mac}))}},t),E):null};const Gn=Object(i.c)(y.a)`
  margin-bottom: 4px;
  justify-content: space-between;
`;var Hn=()=>{const e=Object(o.useSelector)(ve.selectAvailableUlteDevice);return r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(Gn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_LTE_BACKUP"})),r.a.createElement(kn.b,{mac:e.mac})),r.a.createElement(Gn,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_UPLINK"})),r.a.createElement(Wn,{device:e})))};const Yn=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var $n=({activeItem:e})=>{const t=Object(o.useSelector)(Vn.g);return r.a.createElement(Yn,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(zn,{activeItem:e})},...t?[{id:"wanFailover",label:r.a.createElement(D.b,{id:"DASHBOARD_ISP_ACCORDION_TITLE_WAN_FAILOVER"}),renderContent:()=>r.a.createElement(Hn,null)}]:[]],multiOpen:!0})},Kn=a(146),Xn=a(753);const qn=Object(i.c)("div")`
  padding: 28px 30px;

  table {
    th {
      font-size: ${({theme:e})=>e.fontSizes[1]}px;
    }
  }
`,Zn=Object(i.c)(ta.a)`
  color: ${({theme:e})=>e.motifPalette.uBlue06};
`,Jn=Object(i.c)(ta.a)`
  color: ${({theme:e})=>e.motifPalette.purple06};
`,Qn=Object(i.c)(T.a)`
  color: inherit;
`,el=Object(i.c)("div")`
  margin: 20px 0;
`,tl=[{id:"time",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_DATE_TIME"})),renderCell:({time:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},r.a.createElement(Xn.a,{date:new Date(e)})),minWidth:150},{id:"xput_download",minWidth:100,renderLabel:()=>r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Qn,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_STATUS_DOWNLOAD"}))),renderCell:({xput_download:e})=>r.a.createElement(Zn,{size:"body",type:"bytes",options:"bitrate",input:1e6*e/8})},{id:"xput_upload",minWidth:100,renderLabel:()=>r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Qn,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_STATUS_UPLOAD"}))),renderCell:({xput_upload:e})=>r.a.createElement(Jn,{size:"body",type:"bytes",options:"bitrate",input:1e6*e/8})}];var al=({activeItem:e})=>{const t=Object(o.useDispatch)(),a=Object(o.useSelector)(Kn.selectSpeedTestReportData);return Object(l.useEffect)(()=>{t(Object(Kn.fetchSpeedTestReport)())},[e.mac,t]),r.a.createElement(qn,null,r.a.createElement(ya.a,{idField:"_id",hideCellOverflow:!1,columns:tl,disableColumnFilters:!0,items:a,renderFooter:()=>a.length>0?r.a.createElement(el,null,r.a.createElement(D.b,{id:"COMMON_TABLE_FOOTER",values:{length:a.length}})):r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_TABLE_NO_SPEED_TESTS"})}))};var nl={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DASHBOARD_ISP_PROPERTY_OVERVIEW",icon:h.Gb,component:$n},insights:{path:"/insights",title:"DASHBOARD_ISP_PROPERTY_INSIGHTS",icon:h.nc,component:al}}},ll=a(423);var rl=({activeItem:{uptime:e}})=>e>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(ll.a)(e))):null;var il=({activeItem:e})=>{var t,a;const n=null!==(t=e.link_capacity)&&void 0!==t?t:Object(ve.isUBB)(e)&&(null===(a=e.peer_ubb)||void 0===a?void 0:a.link_capacity);return n>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_CAPACITY"})),r.a.createElement(ta.a,{size:"body",type:"bytes",color:"secondary",input:1e6*n/8,options:"bitrate"})):null};var cl=({activeItem:e})=>{const t=Object(ve.getDeviceMemoryUsage)(e);return t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_MEMORY_USAGE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},t,"%")):null};const ol=Object(i.c)(cn.a)`
  margin-left: 4px;
  display: inline-block;
  vertical-align: text-bottom;
`,El=i.a`
  margin-right: -17px;
`,sl=({loadAvg:e})=>r.a.createElement(T.a,{color:"secondary",size:"body"},e);var ml=({activeItem:e,flexProps:t,withTooltip:a})=>{const n=(null==e?void 0:e.loadAvg)||Object(ve.getDeviceLoadAverage)(e);return n?r.a.createElement(la,{flexProps:t},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE"})),a?r.a.createElement("span",null,r.a.createElement(sl,{loadAvg:n}),r.a.createElement(ol,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE_TOOLTIP"}),width:200,position:"bottomRight",tooltipClassName:El,portal:!0},r.a.createElement(h.cb,{isActive:!0}))):r.a.createElement(sl,{loadAvg:n})):null},dl=({children:e})=>r.a.createElement(y.a,{height:"100%",flexDirection:"column"},e);var _l=({activeItem:{lte_ext_ant:e},flexProps:t})=>r.a.createElement(la,{flexProps:t},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_EXTERNAL_ANTENNA"})),!0===e||"enabled"===e?r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_ENABLED"})):r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_DISABLED"})));var bl=({activeItem:{lte_poe:e},flexProps:t})=>r.a.createElement(la,{flexProps:t},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_POE_PASSTHROUGH"})),r.a.createElement(T.a,{color:"secondary",size:"body"},!0===e||"enabled"===e?r.a.createElement(D.b,{id:"COMMON_ENABLED"}):r.a.createElement(D.b,{id:"COMMON_DISABLED"})));var ul=({activeItem:e})=>r.a.createElement(dl,null,[{C:il,flexProps:{}},{C:rl},{C:cl},{C:ml,flexProps:{}},{C:_l,flexProps:{}},{C:bl,flexProps:{}}].map(({C:t,flexProps:a={}})=>r.a.createElement(t,{activeItem:e,flexProps:a,key:t.name}))),Ol=a(165),pl=a(304),Il=a(156);const gl=Object(i.c)(cn.a)`
  width: fit-content;

  & > div > button > span > div {
    display: flex;

    & > span {
      margin: 0 !important;
    }
  }
`,vl=Object(i.c)(oe.a)`
  display: block;
  white-space: nowrap;
  height: 31px;
  padding: 0;
  color: ${({color:e})=>e};
  line-height: 14px;
`,Cl=Object(i.c)(h.b)`
  margin-right: 8px;
  color: ${te.o.warning};
`,Rl=Object(i.c)("div")`
  width: 170px;
  line-height: 18px;
`;var Tl=({mac:e,isUnreachable:t,isUnavailable:a})=>{const n=Object(o.useDispatch)(),i=t||a,c=t?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNREACHABLE_TOOLTIP":a?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNAVAILABLE_TOOLTIP":"LTE_ACTIONS_SUBSCRIPTION_CHECK_TOOLTIP",E=i?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNAVAILABLE":"LTE_ACTIONS_SUBSCRIPTION_CHECK",s=Object(l.useCallback)(()=>{i||n(Object(Re.f)([e]))},[i]);return r.a.createElement(gl,{position:"topRight",portal:!0,message:r.a.createElement(Rl,null,r.a.createElement(D.b,{id:c}))},r.a.createElement(vl,{variant:"inline",onClick:s,disabled:i},r.a.createElement(Cl,null),r.a.createElement(T.a,{size:"caption",color:i?"secondary":"info"},r.a.createElement(D.b,{id:E}))))},hl=a(142);const Dl=Object(i.c)("div")`
  text-align: center;
  background: ${({theme:e})=>e.motifPalette.ui12};
  padding: 32px 40px;
`,Pl=Object(i.c)(T.a)`
  font-size: 16px;
`,yl=Object(i.c)("div")`
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  // UNCOMMENT THIS WHEN GRAPH IS WORKING
  // margin-bottom: 16px;
`,fl=Object(i.c)(y.a)`
  margin-bottom: 8px;
  line-height: 1.5;
  text-align: left;
`,Sl=Object(i.c)(h.b)`
  margin-right: 8px;
  color: ${te.o.warning};
`,Al=Object(i.c)("div")`
  width: 16px;
  min-width: 16px;
  margin-right: 8px;
`,Nl=Object(i.c)("div")`
  display: inline-block;
`,jl=Object(i.c)("div")`
  margin-top: ${({theme:e})=>e.spacing["spacing-m"]};
`;var Ll=({device:e,params:t,path:a,history:i})=>{const{site:c,page:E,subPage:s}=t,m=Object(ve.isUltePro)(e),{license_state:d}=e,_=Object(ve.isAdopted)(e),b=Object(o.useDispatch)(),u=Object(ve.isUlte)(e)&&Object(Ol.a)(e,"lte_subscription_status")===ve.BILLING_SUBSCRIPTION_STATUS.PAST_DUE,O=Object(ve.isUlte)(e)&&Object(Ol.a)(e,"lte_subscription_status")===ve.BILLING_SUBSCRIPTION_STATUS.CANCELED,p=Object(o.useSelector)(Il.c),I=Object(hl.b)(p),g=`https://${I}/payments`,v=`https://${I}/subscriptions`,C=Object(ve.calculateUsage)(e),R=te.o[C.state],h="warning"===C.state||"danger"===C.state&&!C.hasOverages,P=C.hasOverages&&!C.isSuspended,y=Object(o.useSelector)(pl.d),f=Object(ve.isDeviceWithCountryLockedWarning)(y,e),S=Object(ve.isLicenseWithWarning)(e),A=Object(ve.isUlteDeviceNotConnectedToUlte)(e),N=Object(ve.isUlteDeviceNotRegisteredWithUlte)(e),j=Object(o.useSelector)(ze.A),L=Object(o.useSelector)(ze.o),x=Object(o.useSelector)(ze.t),M=Object(l.useMemo)(()=>L||x,[L,x]),V=Object(l.useMemo)(()=>Object(ve.isSubscriptionCheckRequired)(e),[e]),w=Object(l.useMemo)(()=>Object(ve.isSubscriptionApiUnreachable)(e),[e]),F=Object(l.useMemo)(()=>Object(ve.isUlte)(e)&&!!j&&!Object(ve.isDeviceOwner)(e,j),[e,j]),U=Object(l.useMemo)(()=>_&&M&&(V||w||F),[_,M,V,w,F]);return Object(l.useEffect)(()=>{Object.keys(y).length||b(pl.a)},[y,b]),_&&r.a.createElement(Dl,null,r.a.createElement(yl,null,r.a.createElement(Pl,null,r.a.createElement(D.b,{id:"DEVICE_DATA_USAGE_HEADER_LABEL"})),r.a.createElement(T.a,{color:"secondary",size:"header-l"},r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{style:{color:R}},Object(aa.c)(C.usedBytes,"bytes","JEDEC")),r.a.createElement("span",null,e.lte_soft_limit>0&&"/"),r.a.createElement("span",null,e.lte_soft_limit>0&&Object(aa.c)(C.softLimitBytes,"bytes","JEDEC"))))),r.a.createElement(yl,null,e.lte_soft_limit>0&&r.a.createElement(Vt.a,{variant:C.state,value:C.width,size:"medium"})),r.a.createElement(jl,null,h&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.b,{id:"DEVICE_DATA_USAGE_LTE_APPROACHING_LIMIT",values:{amount:C.width+"%"}})),P&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement("div",null,r.a.createElement(D.b,{id:"DEVICE_DATA_USAGE_LTE_OVER_SOFT_LIMIT",values:{softLimit:Object(aa.c)(C.softLimitBytes,"bytes","JEDEC"),hardLimit:Object(aa.c)(C.hardLimitBytes,"bytes","JEDEC")}}))),C.isSuspended&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.b,{id:"DEVICE_DATA_USAGE_LTE_OVER_HARD_LIMIT"})),"success"!==C.state&&r.a.createElement(fl,null,r.a.createElement(Al,null),r.a.createElement(Nl,null,r.a.createElement(D.b,{id:"DEVICE_DATA_USAGE_LTE_INCREASE_LIMIT"})," ",r.a.createElement(oe.a,{variant:"inline",onClick:t=>{t.preventDefault(),t.stopPropagation();const l=Object(n.i)(a,{id:e.mac,site:c,page:E,panel:"settings",subPage:s});i.push(l)}},r.a.createElement(D.b,{id:"DEVICE_DATA_USAGE_LTE_INCREASE_LIMIT_BUTTON"})))),(u||O)&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.a,{id:O?"DEVICE_DATA_USAGE_LTE_SERVICE_CANCELED":"DEVICE_DATA_USAGE_LTE_PAYMENT_OVERDUE",values:{billingUrl:g}})),f&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_NOTICE_COUNTRY_LOCKED_WARNING_BODY"})),S&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.a,{id:`DEVICE_PROPERTIES_NOTICE_LICENSE_${d.toUpperCase()}_BODY`,values:{url:v}})),A&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_NOTICE_ULTE_NOT_CONNECTED_WARNING_BODY"})),N&&r.a.createElement(fl,null,r.a.createElement(Sl,null),r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_NOTICE_ULTE_NOT_REGISTERED_WARNING_BODY"})),U&&!m&&r.a.createElement(Tl,{mac:e.mac,isApplicable:V,isUnreachable:w,isUnavailable:F})))};var xl=({activeItem:e})=>r.a.createElement(r.a.Fragment,null,r.a.createElement(Ul,{activeItem:e}),r.a.createElement(kl,{activeItem:e}),r.a.createElement($l,{activeItem:e,withLink:!0}),r.a.createElement(Hl,{activeItem:e,withLink:!0})),Ml=a(862),Vl=a(792),wl=a(75);const Fl=Object(i.c)(T.a)`
  line-height: 16px;
  margin-bottom: 10px;
`;var Ul=({activeItem:e})=>{const t=Object(o.useSelector)(wl.e),a=!!(t&&e.model_eol_version&&Object(Vl.a)(t,">= "+e.model_eol_version));return e.model_in_eol?r.a.createElement(Ye.a,{level:"warning"},a&&r.a.createElement(Fl,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_EOL_WARNING_NO_CONFIGURING",values:{date:r.a.createElement(Ml.b,{date:e.model_eol_date,dateFormat:"MMM D, YYYY"})}})),!a&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Fl,{size:"caption"},r.a.createElement(D.b,{id:e.model_eol_date?"DEVICE_PROPERTIES_EOL_WARNING":"DEVICE_PROPERTIES_EOL_WARNING_NO_DATE",values:{date:r.a.createElement(Ml.b,{date:e.model_eol_date,dateFormat:"MMM D, YYYY"})}})),!!e.model_eol_version&&r.a.createElement(Fl,{size:"caption",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_EOL_WARNING_CONTROLLER_UPGRADE",values:{controllerVersion:e.model_eol_version}}))),r.a.createElement("a",{href:wn.a.eolLearnMore,target:"_blank",rel:"noopener noreferrer"},r.a.createElement(D.b,{id:"COMMON_LEARN_MORE"}))):null};const zl=Object(i.c)(T.a)`
  line-height: 16px;
  margin-bottom: 10px;
`;var kl=({activeItem:e})=>e.model_in_lts?r.a.createElement(Ye.a,{level:"info"},r.a.createElement(zl,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LTS_WARNING",values:{date:r.a.createElement(Ml.b,{date:e.model_eol_date,dateFormat:"MMM D, YYYY"})}})),e.model_eol_version&&r.a.createElement(zl,{size:"caption",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LTS_WARNING_CONTROLLER_UPGRADE",values:{controllerVersion:e.model_eol_version}})),r.a.createElement("a",{href:wn.a.ltsLearnMore,target:"_blank",rel:"noopener noreferrer"},r.a.createElement(D.b,{id:"COMMON_LEARN_MORE"}))):null,Bl=a(892),Wl=a(893);const Gl=Object(i.c)(T.a)`
  line-height: 16px;
  margin-bottom: 10px;
`;var Hl=({activeItem:e,withLink:t,standalone:a})=>{const n=Object(o.useSelector)(Wl.b),l=Object(o.useSelector)(d.b),i=Object(o.useSelector)(d.f);return Object(C.a)([...i?[]:[Object(Bl.a)()]],!n&&Object(u.Ec)(e)?r.a.createElement(Ye.a,{level:"warning",standalone:a},r.a.createElement(Gl,{size:"caption",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_UNIFI_CARE_CLOUD_BACKUP_ENABLE_WARNING"})),t&&r.a.createElement(Gl,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_PROPERTIES_UNIFI_CARE_CLOUD_BACKUP_ENABLE_NAVIGATE",values:{url:l.replace(/\/network\/?/,wn.a.ucoreAdvancedSettings)}}))):null)};const Yl=Object(i.c)(T.a)`
  line-height: 16px;
  margin-bottom: 10px;
`;var $l=({activeItem:e,withLink:t,standalone:a})=>{const n=Object(o.useSelector)(Wl.a),l=Object(o.useSelector)(d.b),i=Object(o.useSelector)(d.f);return Object(C.a)([...i?[]:[Object(Bl.a)()]],!n&&Object(u.Ec)(e)?r.a.createElement(Ye.a,{level:"warning",standalone:a},r.a.createElement(Yl,{size:"caption",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_UNIFI_CARE_REMOTE_ACCESS_ENABLE_WARNING"})),t&&r.a.createElement(Yl,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_PROPERTIES_UNIFI_CARE_REMOTE_ACCESS_ENABLE_NAVIGATE",values:{url:l.replace(/\/network\/?/,wn.a.ucoreAdvancedSettings)}}))):null)},Kl=a(1638);const Xl=({value:e,valueUnit:t,translationId:a})=>void 0!==e&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:a})),"boolean"==typeof e?r.a.createElement(T.a,{color:"secondary",size:"body"},e?r.a.createElement(D.b,{id:"COMMON_ENABLED"}):r.a.createElement(D.b,{id:"COMMON_DISABLED"})):r.a.createElement(T.a,{color:"secondary",size:"body"},e,t&&" "+t));var ql=({activeItem:e,isUltePro:t})=>{const{lte_radio_mode:a,lte_rssi:n,lte_ecio:l,lte_io:i,lte_ip:c,lte_sinr:o,lte_rsrq:E,lte_rsrp:s,lte_snr:m,lte_rx_chan:d,lte_tx_chan:_,lte_rscp:b,lte_apn:u,lte_connected:O,lte_pdptype:p,lte_band:I,lte_networkoperator:g,lte_rat:v,lte_state:C,lte_signal:R,lte_imei:T,lte_iccid:h,lte_cell_id:D,lte_hard_limit:P,lte_soft_limit:f,total_tx_bytes:S,total_rx_bytes:A}=e,N=(a||"").toUpperCase(),j=Object(aa.c)(P,"bytes","JEDEC"),L=Object(aa.c)(f,"bytes","JEDEC");return r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(Xl,{value:c,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_IP"}),r.a.createElement(Xl,{value:u,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_APN"}),r.a.createElement(Xl,{value:p,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_PDP_TYPE"}),r.a.createElement(Xl,{value:Object(Kl.a)(O),translationId:"DEVICE_PROPERTIES_UNIFI_LTE_CONNECTED"}),r.a.createElement(Xl,{value:I,translationId:"COMMON_BAND"}),r.a.createElement(Xl,{value:D,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_CELL_ID"}),S&&r.a.createElement(Xl,{value:Object(aa.c)(S,"bytes","JEDEC"),translationId:"DEVICE_PROPERTIES_UNIFI_LTE_DATA_TRANSMITTED"}),A&&r.a.createElement(Xl,{value:Object(aa.c)(A,"bytes","JEDEC"),translationId:"DEVICE_PROPERTIES_UNIFI_LTE_DATA_RECEIVED"}),r.a.createElement(Xl,{value:g,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_NETWORK_OPERATOR"}),r.a.createElement(Xl,{value:v,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RAT"}),r.a.createElement(Xl,{value:Object(Kl.a)(C),translationId:"DEVICE_PROPERTIES_UNIFI_LTE_STATUS"}),r.a.createElement(Xl,{value:R,translationId:"COMMON_SIG_STR"}),N===fe.k.Lte&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Xl,{value:n,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RSSI"}),r.a.createElement(Xl,{value:E,valueUnit:"dB",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RSRQ"}),r.a.createElement(Xl,{value:s,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RSRP"}),r.a.createElement(Xl,{value:m,valueUnit:"dB",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_SNR"}),r.a.createElement(Xl,{value:d,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RX_CHANNEL"}),r.a.createElement(Xl,{value:_,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_TX_CHANNEL"})),(N===fe.k.Cdma||N===fe.k.Hdr)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Xl,{value:n,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RSSI"}),r.a.createElement(Xl,{value:l,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_ECIO"})),N===fe.k.Hdr&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Xl,{value:i,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_IO"}),r.a.createElement(Xl,{value:o,valueUnit:"dB",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_SINR"})),N===fe.k.Gsm&&r.a.createElement(Xl,{value:n,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RSSI"}),N===fe.k.Tdma&&r.a.createElement(Xl,{value:b,valueUnit:"dBm",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_RSCP"}),r.a.createElement(Xl,{value:T,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_IMEI"}),r.a.createElement(Xl,{value:h,translationId:"DEVICE_PROPERTIES_UNIFI_LTE_ICCID"}),Number(j)>0&&r.a.createElement(Xl,{value:j,valueUnit:"GB",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_DATA_LIMIT"}),Number(j)>0&&r.a.createElement(Xl,{value:L,valueUnit:"GB",translationId:"DEVICE_PROPERTIES_UNIFI_LTE_DATA_WARNING"}))};var Zl=({uplink:e,portSpeed:t})=>{const a=Number(t||(null==e?void 0:e.speed));return a>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_SPEED"})),r.a.createElement(T.a,{color:"secondary",size:"body"},`${Object(Ft.b)(a)} ${10===a||100===a?`(${a} Mbps)`:""}`)):null};const Jl=Object(i.c)(oe.a)`
  padding: 0;
  margin: 0;
  height: initial;
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
`;var Ql=function({activeItem:{uplink:{rx_bytes:e,"rx_bytes-r":t,rx_packets:a,speed:l,tx_bytes:i,"tx_bytes-r":c,tx_packets:E}={}},activeItem:s,isUltePro:m,params:d,path:_,history:u}){const{site:O,page:p,subPage:I}=d,g=Object(o.useSelector)(ve.selectDevicesData),C=t+c,R=Object(o.useSelector)(e=>Object(ve.getUplink)(Object(ve.selectDevicesData)(e),s)),h=Object(ve.getUplinkDisplayName)(s,R),P=Object(o.useDispatch)(),f=Object(ve.getUplinkRemotePort)(g,s);return r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK"})),r.a.createElement(Jl,{variant:"link",onClick:e=>{e.preventDefault(),e.stopPropagation();const t=Object(n.i)(_,{id:R.mac,site:O,page:p,panel:jt.a.OVERVIEW,subPage:I});u.push(t),P(Object(v.g)({type:b.c.DEVICE,mac:R.mac}))}},h)),r.a.createElement(Zl,{portSpeed:l}),m&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_POWER"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:(null==f?void 0:f.poe_power)||0}}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{size:"body"},a?a.toLocaleString():null,"/",r.a.createElement(ta.a,{type:"bytes",input:e,size:"body"}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),r.a.createElement(T.a,{size:"body"},E?E.toLocaleString():null,"/",r.a.createElement(ta.a,{type:"bytes",input:i,size:"body"}))),m&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_ACTIVITY"})),r.a.createElement(ta.a,{type:"bytes",input:C,options:"bitrate",size:"body"})))};const er=Object(i.c)(y.a)`
  padding: 24px 32px 24px 0 !important;
  flex-shrink: 0;
`,tr=Object(i.c)(T.a)`
  max-width: 150px;
`,ar=Object(i.c)(T.a)`
  max-width: 100px;
`;var nr=r.a.memo(({device:e})=>{const{model:t,mac:a,displayable_version:n,ip:l,type:i,lan_ip:c}=e,o=Object(x.a)(e);return r.a.createElement(er,null,r.a.createElement(y.a,{minWidth:157,maxWidth:157,justifyContent:"center",alignItems:"center"},r.a.createElement(y.a,{minWidth:125,maxWidth:125,height:125,padding:"16px",alignItems:"center",justifyContent:"center"},r.a.createElement(f.c,{device:{model:t,type:i},filesMap:"GRID",width:"100%"}))),r.a.createElement(y.a,{width:211,flexDirection:"column",justifyContent:"center"},o&&r.a.createElement(la,{flexProps:{alignItems:"center"}},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_MODEL"})),r.a.createElement(tr,{size:"body",truncate:!0},o)),a&&r.a.createElement(la,{flexProps:{alignItems:"center"}},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_MAC_ADDRESS"})),r.a.createElement(T.a,{size:"body"},a)),l&&r.a.createElement(la,{flexProps:{alignItems:"center"}},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},c||l)),n&&r.a.createElement(la,{flexProps:{alignItems:"center"}},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_FIRMWARE_VERSION"})),r.a.createElement(ar,{size:"body",truncate:!0},n))))},(e,t)=>e.device.model===t.device.model&&e.device.hostname===t.device.hostname&&e.device.mac===t.device.mac&&e.device.displayable_version===t.device.displayable_version&&e.device.ip===t.device.ip);const lr=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
  .styledAccordionContent {
    padding: 0;
    margin: 0;
  }
`;var rr=({activeItem:e,...t})=>{var a;const n=Object(ve.isAdopted)(e),l=Object(ve.isUltePro)(e);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),n&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ll,Object.assign({device:e},t)),r.a.createElement(xl,{activeItem:e}),r.a.createElement(lr,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(ul,{activeItem:e})},{id:"lte",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_UNIFI_ACCORDION_HEADER_LTE"}),renderContent:()=>r.a.createElement(ql,{activeItem:e,isUltePro:l})},...(null===(a=null==e?void 0:e.uplink)||void 0===a?void 0:a.mac)?[{id:"uplink",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK_WIRED"}),renderContent:()=>r.a.createElement(Ql,Object.assign({activeItem:e,isUltePro:l},t))}]:[]],contentClassName:"styledAccordionContent",renderOnlyExpandedContent:!0,multiOpen:!0})))},ir=a(281),cr=a(2601),or=a(2596),Er=a(2598),sr=a(436),mr=a(335),dr=a(626);const _r=Object(i.c)(T.a)`
  display: block;
  position: relative;
  padding-left: 20px;
  margin-left: 15px;

  ::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1px;
    width: 12px;
    border-bottom: 1px ${e=>`${e.bordertype} ${e.legendcolor}`};
  }
`,br=i.a`
  margin-bottom: 32px;
`,ur=Object(Er.a)(6,e=>({value:e,label:e.toString()})).reverse(),Or=(e,t,a,n,l)=>0!==t&&5!==t?null:r.a.createElement("line",{x1:a,x2:n,y1:0,y2:0,className:l}),pr=e=>i.a`
  fill: ${e.motifPalette.text02};
  font-size: 11px;
`;var Ir=Object(sr.b)(r.a.memo(({gwMac:e,keys:t,pickDatumsWithKey:a,heading:n,forUdm:l,theme:i})=>{const c=Object(o.useSelector)(Object(Kn.selectDeviceStatReport)(e,Kn.fetchDeviceUsageReport,Kn.OBJECT.GW)),E=Object(o.useSelector)(Object(Kn.selectDeviceStatReport)(e,Kn.fetchDeviceUsageReport)),s=Object(o.useSelector)(ze.H),m="ap"===a?"gradientArea":"line",d=Date.now(),_=Object(P.startOfHour)(Object(P.addHours)(d,1)).getTime(),b=s?"H:ss":"ha",u=Object(dr.b)(_,b);u[u.length-1].label="";const O=u[0].value,p={};let I=0,g=c;l&&(g=E.reduce((e,t)=>{const a={...t};return a.gw?e:a.sw?(e[I].num_sta+=a.num_sta,I+=1,e):(e.push(a),e)},[])),a&&(g=E.filter(e=>e[a]));Object(ir.n)(g.filter(e=>e.time>O).map(e=>({...e,x:e.time})),mr.a.MINUTES.grain).forEach(e=>{t.forEach(t=>{p[t]||(p[t]={key:t,isDashed:"mem"===t,variant:"mem"===t?m:"gradientArea",lineColor:"mem"===t?"purple":"blue",maxY:0,data:[]}),p[t].data.push({x:e.x,y:e[t]})})});const v=t.map(e=>p[e]?p[e].data.map(e=>e.y||0):0),C=Math.max(...v.flat(),4);let R=ur;C>5&&(R=Object(dr.e)(Math.ceil(Math.min(100,C+1/3*C)),6));const h=["solid","dotted"],f=[i.colors.blue,i.colors.purple];let S=0;return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{justifyContent:"space-between",className:br,marginTop:"10px"},r.a.createElement(T.a,{size:"body",weight:"bold",color:"primary"},r.a.createElement(D.b,{id:n})),t.length>0&&r.a.createElement(y.a,null,t.includes("cpu")&&r.a.createElement(_r,{legendcolor:f[S],bordertype:h[S++]},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_CPU"}))),t.includes("mem")&&r.a.createElement(_r,{legendcolor:f[S],bordertype:h[S++]},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_MEMORY"}))))),r.a.createElement(cr.a,{xAxis:u,yAxis:R,width:336,height:120,margin:[0,0,20,30],xLabelsBetween:!0,renderYGridLine:Or,labelClassName:pr(i),renderChartElements:(e,a,n)=>r.a.createElement(r.a.Fragment,null,t.map(t=>p[t]&&p[t].data.length&&r.a.createElement(or.a,{key:p[t].key,data:p[t].data,maxY:n,mouseData:a,getCoordinates:e,variant:p[t].variant,lineColor:i.colors[p[t].lineColor],dashed:p[t].isDashed,hideMissingData:!0})))}))},(e,t)=>e.gwMac===t.gwMac));var gr=({activeItem:e})=>{const t=Object(o.useDispatch)();return Object(l.useEffect)(()=>{t(Object(Kn.fetchDeviceUsageReport)(e.mac))},[e.mac,t]),r.a.createElement(Ir,{gwMac:e.mac,keys:["mem","cpu"],pickDatumsWithKey:"ap",heading:"DEVICE_PROPERTIES_LABEL_USAGE_PERCENT"})};const vr=Object(i.c)(y.a)`
  padding: 16px 32px;
`,Cr=Object(i.c)("div")`
  margin-bottom: 16px;
`;var Rr=({activeItem:e})=>r.a.createElement(vr,{flexDirection:"column"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"})),r.a.createElement(Cr,null),r.a.createElement(gr,{activeItem:e}));const Tr=e=>{var t,a;return(null===(a=null===(t=null==e?void 0:e.shared)||void 0===t?void 0:t.propertypanel)||void 0===a?void 0:a.tabGetDataFunction)||{}},hr=e=>{var t,a;return(null===(a=null===(t=null==e?void 0:e.shared)||void 0===t?void 0:t.propertypanel)||void 0===a?void 0:a.tabSubmitFunction)||{}},Dr=e=>{var t,a;return(null===(a=null===(t=null==e?void 0:e.shared)||void 0===t?void 0:t.propertypanel)||void 0===a?void 0:a.tabResetFunction)||{}},Pr=Object(i.c)("div")`
  margin-bottom: 16px;
`,yr=Object(i.c)(h.cb)`
  margin-right: 5px;
  color: ${({theme:e})=>e.motifPalette.info};
`,fr=Object(i.c)("div")`
  margin-top: 10px;
  display: flex;
  align-items: center;
`;var Sr=Object(Ve.f)({mapPropsToValues:({activeItem:{name:e,mac:t}={}})=>({name:e!==t?e:""}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(({activeItem:e,setFormDirty:t,setFormInvalid:a,dirty:n,isValid:i,values:c,resetForm:E,formName:s="general"})=>{const m=Object(o.useDispatch)(),_=Object(o.useSelector)(d.b),b=Object(ve.isUdm)(e);Object(l.useEffect)(()=>(m(Object(v.h)({[s]:()=>b?{}:c})),m(Object(v.j)({[s]:()=>E({values:c})})),m(Object(v.i)({[s]:E})),()=>{m(Object(v.h)({[s]:null})),m(Object(v.j)({[s]:null})),m(Object(v.i)({[s]:null}))}),[m,E,c,b,s]),Object(l.useEffect)(()=>{t(s,n),a(s,!i)},[t,n,a,i,s]);const u=_.replace(/\/network\/?/,wn.a.ucoreSettings);return r.a.createElement(r.a.Fragment,null,r.a.createElement(Pr,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_DEVICE_NAME",name:"name",full:!0,disabled:b}),b&&r.a.createElement(fr,null,r.a.createElement(yr,null),r.a.createElement(D.a,{id:"DEVICE_PROPERTIES_NAME_LINK_UNIFI_OS",values:{link:u}}))))}),Ar=a(208),Nr=a(81);const jr=[...Array(Nr.o.SOFT_LIMIT_MAX_GB)].map((e,t)=>({value:t+1,label:t+1+" GB"})),Lr=Object.values(fe.j).map(e=>({label:e,value:e})),xr=Object(i.c)(y.a,{shouldForwardProp:e=>"marginForError"!==e})`
  margin-bottom: ${({theme:e,marginForError:t})=>t?e.spacing["spacing-xxxl"]:e.spacing["spacing-xl"]};
`,Mr=Object(i.c)(T.a)`
  align-items: center;
  justify-content: center;
  margin-bottom: ${({theme:e})=>e.spacing["spacing-m"]};
`,Vr=Object(i.c)(h.cb)`
  margin-right: ${({theme:e})=>e.spacing["spacing-s"]};
`,wr=Object(i.c)(T.a)`
  margin-top: ${({theme:e})=>e.spacing["spacing-xs"]};
`,Fr=Object(Ve.f)({mapPropsToValues:({isUltePro:e,activeItem:{lte_ext_ant:t,lte_poe:a,lte_apn:n,lte_is_sim_pin_required:l,lte_sim_pin_tries_left:r,lte_sim_pin:i,lte_username:c,lte_password:o,lte_auth_type:E,lte_data_limit_enabled:s,lte_soft_limit:m=(e?0:jr[0].value),lte_data_warning_enabled:d,lte_hard_limit:_=0}})=>({lte_ext_ant:"string"==typeof t?"enabled"===t:t,lte_poe:"string"==typeof a?"enabled"===a:a,lte_apn:n,lte_is_sim_pin_required:l,lte_sim_pin_tries_left:r,lte_sim_pin:i,lte_username:c,lte_password:o,lte_auth_type:E,lte_data_limit_enabled:!e||s,lte_soft_limit:new aa.a(m,"bytes","IEC").value,lte_data_warning_enabled:d,lte_hard_limit:new aa.a(_,"bytes","IEC").value}),validationSchema:({isUltePro:e})=>tn.a.lazy(()=>tn.a.object().shape({lte_ext_ant:tn.a.boolean().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_EXTERNAL_ANTENNA").required(),lte_poe:tn.a.boolean().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_POE_PASSTHROUGH").required(),lte_apn:tn.a.string().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_APN_ADDRESS").matches(rn.q,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_VALID_APN_ADDRESS"})}).required(),lte_sim_pin:tn.a.string().when("lte_is_sim_pin_required",{is:!0,then:tn.a.string().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_PIN").matches(rn.r,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_VALID_PIN"})}).required()}),lte_username:tn.a.string().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_USERNAME"),lte_password:tn.a.string().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_PASSWORD"),lte_auth_type:tn.a.string().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_AUTHENTICATION_TYPE").oneOf([fe.j.Pap,fe.j.Chap,fe.j.PapChap,fe.j.None]),lte_data_limit_enabled:tn.a.boolean().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_LTE_DATA_LIMIT"),lte_soft_limit:tn.a.number().integer(r.a.createElement(D.b,{id:"COMMON_VALIDATION_WHOLE_NUMBER"})).when("lte_data_limit_enabled",{is:!0,then:e?tn.a.number().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_WARNING").min(0).required():tn.a.number().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_WARNING").oneOf(jr.map(({value:e})=>e)).required()}),lte_data_warning_enabled:tn.a.boolean().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_LTE_DATA_WARNING"),lte_hard_limit:tn.a.number().when("lte_data_limit_enabled",{is:!0,then:tn.a.number().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT").min(0).required().integer(r.a.createElement(D.b,{id:"COMMON_VALIDATION_WHOLE_NUMBER"}))}).when(["lte_soft_limit"],(t,a)=>a.min(e?t>=0&&t:0,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT_ERROR"})))})),handleSubmit:()=>null});var Ur=Object(en.compose)(Object(o.connect)(null,{updateDevice:ve.updateDevice}),Fr)(({activeItem:e,isUltePro:t,values:a,dirty:n,isValid:i,errors:c,touched:E,resetForm:s,setFormDirty:m,setFormInvalid:d,setFieldTouched:_,setFieldValue:b,formName:u="lte"})=>{const O=Object(o.useDispatch)();return Object(l.useEffect)(()=>{O(Object(v.h)({[u]:()=>{const e={...a,lte_soft_limit:Object(ve.GiBToBytes)(a.lte_soft_limit),lte_hard_limit:t?Object(ve.GiBToBytes)(a.lte_hard_limit):Object(ve.GiBToBytes)(a.lte_soft_limit+2),lte_data_warning_enabled:a.lte_data_limit_enabled};return a.lte_data_limit_enabled||(e.lte_soft_limit=0,e.lte_hard_limit=0),e}})),O(Object(v.j)({[u]:()=>s({values:a})})),O(Object(v.i)({[u]:s}))},[O,s,a,e._id]),Object(l.useEffect)(()=>{m(u,n),d(u,!i)},[n,m,d,i]),r.a.createElement(r.a.Fragment,null,r.a.createElement(xr,{justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_EXTERNAL_ANTENNA"})),r.a.createElement(He.Field,{type:"checkbox",name:"lte_ext_ant"})),r.a.createElement(xr,{justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_POE_PASSTHROUGH"})),r.a.createElement(He.Field,{type:"checkbox",name:"lte_poe"})),t?r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,null,r.a.createElement(Mr,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_SIM_CARD"}))),r.a.createElement(xr,{flexDirection:"column"},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_APN_ADDRESS",name:"lte_apn",full:!0,autocomplete:"off"})),a.lte_is_sim_pin_required&&r.a.createElement(xr,{flexDirection:"column"},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_PIN",name:"lte_sim_pin",type:"password",autoComplete:"new-password",full:!0}),r.a.createElement(y.a,{alignItems:"center",marginTop:(null==E?void 0:E.lte_sim_pin)&&(null==c?void 0:c.lte_sim_pin)?20:4},r.a.createElement(Vr,{isActive:!0}),r.a.createElement(T.a,{color:"secondary",size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_SIM_CARD_TRIES",values:{count:a.lte_sim_pin_tries_left}})))),r.a.createElement(xr,{flexDirection:"column"},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_USERNAME",name:"lte_username",full:!0})),r.a.createElement(xr,{flexDirection:"column"},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_PASSWORD",name:"lte_password",type:"password",autoComplete:"new-password",passwordToggle:!0,full:!0})),r.a.createElement(xr,{flexDirection:"column"},r.a.createElement(He.Field,{name:"lte_auth_type",type:"dropdown",label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_AUTHENTICATION_TYPE",options:Lr,validated:!0,translateLabel:!0,full:!0})),r.a.createElement(xr,{justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_LTE_DATA_LIMIT"})),r.a.createElement(He.Field,{type:"checkbox",name:"lte_data_limit_enabled"})),a.lte_data_limit_enabled&&r.a.createElement(r.a.Fragment,null,r.a.createElement(xr,{flexDirection:"column",marginForError:!0},r.a.createElement(He.Field,{name:"lte_hard_limit",label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT",type:"number",full:!0})),r.a.createElement(xr,{justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_LTE_DATA_WARNING"}))),r.a.createElement(xr,{flexDirection:"column",marginForError:!0},r.a.createElement(He.Field,{name:"lte_soft_limit",label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_WARNING",type:"number",full:!0,onChange:e=>{b("lte_soft_limit",e.target.value),_("lte_hard_limit")}})))):r.a.createElement(r.a.Fragment,null,r.a.createElement(xr,null,r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_LTE_DATA_LIMIT"}))),r.a.createElement(xr,{flexDirection:"column"},r.a.createElement(He.Field,{label:"DEVICE_ULTE_SETUP_DATA_LIMIT_VALUE_FIELD",translateLabel:!0,full:!0,validated:!0,options:jr,type:"dropdown",name:"lte_soft_limit"}),r.a.createElement(wr,{color:"secondary",size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT_DESCRIPTION"})))))}),zr=a(69);const kr=Fe.a.object().shape({type:Fe.a.string(),ip:Fe.a.string().when("type",{is:"static",then:tn.b.required(r.a.createElement(D.b,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}),netmask:Fe.a.string().when("type",{is:"static",then:tn.c.required(r.a.createElement(D.b,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}).when("ip",(e,t)=>e?t.test("is-valid-subnet-mask",r.a.createElement(D.b,{id:"COMMON_VALIDATION_VALID_IPV4_MASK"}),t=>Object(zr.k)(e,t)):t),gateway:Fe.a.string().when("type",{is:"static",then:tn.b.required(r.a.createElement(D.b,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}),dns1:Fe.a.string().when("type",{is:"static",then:tn.b.required(r.a.createElement(D.b,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}),dns2:tn.b.when("dns1",{is:e=>!!e,then:tn.b}),bonding_enabled:Fe.a.boolean(),dnssuffix:Fe.a.string(),mgmt_network_id:Fe.a.string(),snmp_location:Fe.a.string(),snmp_contact:Fe.a.string()}),Br=Object(i.c)("div")`
  margin-bottom: 24px;
`,Wr=Object(i.c)("div")`
  flex: 1;
  max-width: calc(50% - 6px);
`,Gr=Object(i.c)(T.a)`
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
`;var Hr=Object(Ve.f)({isInitialValid:!0,mapPropsToValues:({activeItem:e})=>{Object(ve.getIsUsl8Mp)(e);const{config_network:t,ip:a,switch_vlan_enabled:n,lte_limit_enabled:l,lte_limit:r}=e,{type:i="dhcp",ip:c=a||"",netmask:o="",gateway:E="",dns1:s="",dns2:m="",dnssuffix:d="",bonding_enabled:_=!1}=t;return{config_network:{type:i,ip:c,netmask:o,gateway:E,dns1:s,dns2:m,dnssuffix:d,bonding_enabled:_},switch_vlan_enabled:n||!1}},handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:tn.a.object().shape({config_network:kr,lte_limit_enabled:tn.a.boolean().label("DEVICE_PROPERTIES_LTE_DATA_LIMIT"),lte_limit:tn.a.number().integer().label("DEVICE_ULTE_PRO_SETUP_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:tn.a.number().min(1).required().label("DEVICE_ULTE_PRO_SETUP_DATA_LIMIT")})})})(({setFormDirty:e,setFormInvalid:t,dirty:a,values:n,resetForm:i,isValid:c,initialValues:E,activeItem:s,formName:m="network"})=>{const d=Object(o.useDispatch)(),_=Object(ve.getIsUapUswHybrid)(s),b=Object(ve.getIsUsl8Mp)(s);Object(l.useEffect)(()=>{e("network",a),t("network",!c)},[e,t,a,c]);const u=Object(ve.isGateway)(s),O=Object(l.useMemo)(()=>[{value:"dhcp",label:"DEVICE_PROPERTIES_VALUES_NETWORK_USING_DHCP"},...u?[]:[{value:"static",label:"DEVICE_PROPERTIES_VALUES_NETWORK_STATIC_IP"}]],[u]);return Object(l.useEffect)(()=>(d(Object(v.h)({[m]:()=>{var e;const t={config_network:"static"===n.config_network.type?n.config_network:{type:"dhcp",bonding_enabled:n.config_network.bonding_enabled}};return _&&(t.switch_vlan_enabled=n.switch_vlan_enabled,E.switch_vlan_enabled&&!n.switch_vlan_enabled&&(null===(e=s.port_overrides)||void 0===e?void 0:e.length)&&(t.port_overrides=s.port_overrides.map(({portconf_id:e,...t})=>t))),t}})),d(Object(v.j)({[m]:()=>i({values:n})})),d(Object(v.i)({[m]:i})),()=>{d(Object(v.h)({[m]:null})),d(Object(v.j)({[m]:null})),d(Object(v.i)({[m]:null}))}),[d,i,n,m,s.port_overrides,E.switch_vlan_enabled,_,b]),r.a.createElement(r.a.Fragment,null,r.a.createElement(Br,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_CONFIGURE_IP",name:"config_network.type",type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:O})),"static"===n.config_network.type&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(Wr,null,r.a.createElement(on.a,{label:"COMMON_IP_ADDRESS",name:"config_network.ip",full:!0})),r.a.createElement(Wr,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_PREFERRED_DNS",name:"config_network.dns1",full:!0}))),r.a.createElement(y.a,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(Wr,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_SUBNET_MASK",name:"config_network.netmask",full:!0})),r.a.createElement(Wr,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ALTERNATE_DNS",name:"config_network.dns2",full:!0}))),r.a.createElement(y.a,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(Wr,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_GATEWAY",name:"config_network.gateway",full:!0})),r.a.createElement(Wr,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_DNS_SUFFIX",name:"config_network.dnssuffix",full:!0})))),(Object(ve.isUapAcHd)(s)||Object(ve.isUapAcShd)(s)||Object(ve.isUapXg)(s)||Object(ve.isUwbXg)(s))&&r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})),r.a.createElement(on.a,{name:"config_network.bonding_enabled",type:"checkbox"})),_&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Gr,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_VLAN"})),r.a.createElement(y.a,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})),r.a.createElement(on.a,{type:"checkbox",name:"switch_vlan_enabled"}))),b&&!1)});const Yr=Object(i.c)(Be.a)`
  padding: 0;
  white-space: nowrap;
`;var $r=({device:e})=>{const{locating:t}=e,a=Object(o.useDispatch)(),n=Object(ve.getDeviceState)(e);return r.a.createElement(Yr,{variant:"link",onClick:t=>{if(t.preventDefault(),t.stopPropagation(),Object(ve.isUBB)(e)){const{peer_ubb:t}=e;t&&a(Object(ve.locateDevice)(t))}a(Object(ve.locateDevice)(e))},disabled:n!==ve.DeviceState.CONNECTED},r.a.createElement(D.b,{id:t?"DEVICE_ACTIONS_LOCATE_STOP":"DEVICE_ACTIONS_LOCATE"}))},Kr=a(330);const Xr=Object(i.c)(Be.a)`
  padding: 0;
`;var qr=({device:e})=>{const t=Object(ve.getDeviceState)(e),a=Object(o.useSelector)(ze.x)("API_DEVICE_RESTART"),n=Object(o.useDispatch)();return a&&r.a.createElement(Xr,{variant:"link",onClick:t=>{t.preventDefault(),t.stopPropagation();const a=Object(ve.isSwitch)(e)&&Object(Kr.isPoeSupported)(e),l=a||Object(ve.isGateway)(e),r=!e.bypassConfirmRestart;n(l||r?Object(ve.confirmDeviceRestart)({name:e.name||e.mac,withHardReboot:a,onConfirm:(t="soft")=>{n(Object(ve.restartDevice)(e,t))},onCancel:()=>{n(Object(Oe.e)())}}):Object(ve.restartDevice)(e))},disabled:t!==ve.DeviceState.CONNECTED},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_RESTART"}))};const Zr=Object(i.c)(Be.a)`
  padding: 0;
`;var Jr=({device:e})=>{const t=Object(ve.getDeviceState)(e),a=Object(o.useDispatch)();return r.a.createElement(Zr,{variant:"link",onClick:t=>{t.preventDefault(),t.stopPropagation(),a(Object(ve.confirmDeviceProvision)({name:e.name||e.mac,onConfirm:()=>{a(Object(ve.forceProvisionDevice)(e))},onCancel:()=>{a(Object(Oe.e)())}}))},loader:t===ve.DeviceState.PROVISIONING?"spinner":null,disabled:t!==ve.DeviceState.CONNECTED},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_PROVISION"}))};const Qr=Object(i.c)(oe.a)`
  padding: 0;
  color: ${({theme:e})=>e.motifPalette.red06};

  &:hover {
    color: ${({theme:e})=>e.motifPalette.red05};
  }

  &:active {
    color: ${({theme:e})=>e.motifPalette.red07};
  }
`,ei=Object(i.c)("div")`
  margin-top: ${({theme:e})=>e.space[4]}px;
  line-height: 1.5;
`,ti=Object(i.c)(f.b)`
  width: auto !important;
  padding: 0 8px;
`,ai=i.a`
  button {
    border-radius: 0;
    font-size: 12px;
  }
`;var ni=Object(D.e)(({device:e,showOnlyIfInactive:t,intl:a})=>{const{mac:n,name:i,adopted:c}=e,E=Object(o.useDispatch)(),[s,m]=Object(l.useState)(!1),d=Object(o.useSelector)(Il.c),_=Object(o.useSelector)(M.a),b=Object(hl.b)(d),u=Object(ve.isUlte)(e),O=Object(ve.isDeactivatedForNonPayment)(e),p=Object(ve.getDeviceState)(e),I=u&&(!t||[ve.DeviceState.UNKNOWN,ve.DeviceState.FIRMWARE_MISMATCH,ve.DeviceState.ADOPTION_FAILED,ve.DeviceState.DISCONNECTED].includes(p)),g=Object(l.useCallback)(async()=>{try{await E(Object(Ue.b)(n,{successToast:{icon:sa.a.success,message:"DEVICE_ULTE_REMOVED_SUCCESS"}})),E(Object(ve.deleteDeviceFromStore)(n)),E(Object(ke.deleteUnifiDeviceFromStore)(n)),E(Object(v.f)()),O||setTimeout(()=>{E(Object(je.a)({duration:0,type:sa.a.warning,title:a.formatMessage({id:"ON_LOAD_WARNING_SUBSCRIPTION_NEEDS_ATTENTION_TITLE"}),message:"ON_LOAD_WARNING_SUBSCRIPTION_NEEDS_ATTENTION_BODY",icon:r.a.createElement(ti,{deviceType:fe.g.AP,deviceModel:fe.e.ULTE,publicImagePath:_,filesMap:"SETUP"}),showStatusBall:!0,primaryButton:{label:a.formatMessage({id:"ON_LOAD_WARNING_PAYMENT_ACTION_CANCEL_SUBSCRIPTIONS"}),onClick:()=>window.open(`https://${b}/subscriptions`,"_blank")},className:ai},"LTE_SUBSCRIPTION_NEEDS_ATTENTION"))},10),E(Object(Oe.e)())}catch(e){m(!1)}},[n,O]),C=Object(l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),m(!0);const t={name:i&&i!==n?i:a.formatMessage({id:"DEVICE_TYPE_ULTE"})};O?g():E(Object(ue.a)({title:"DEVICE_ULTE_REMOVE_HEADER",titleValues:t,message:"DEVICE_ULTE_REMOVE_DETAILS",messageValues:t,confirmButtonProps:{text:r.a.createElement(D.b,{id:"DEVICE_ACTIONS_REMOVE"}),variant:"primary"},children:r.a.createElement(ei,null,r.a.createElement(D.b,{id:"DEVICE_ULTE_REMOVE_INFO"})),onConfirm:g,onCancel:()=>{E(Object(Oe.e)()),m(!1)}}))},[n,i,O]);return I&&c?r.a.createElement(Qr,{variant:"link",onClick:C,loader:s?"spinner":null},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_REMOVE_LABEL"})):null});const li=Object(i.c)(Be.a)`
  padding: 0;
`;var ri=({device:e})=>{const t=Object(o.useDispatch)();return r.a.createElement(li,{variant:"link",onClick:a=>{a.preventDefault(),a.stopPropagation(),t(Object(ve.downloadDeviceInfo)(e))}},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_DOWNLOAD_DEVICE_INFO"}))};const ii=Object(i.c)(Be.a)`
  padding: 0;
`;var ci=({device:e})=>{const t=Object(o.useDispatch)(),[a,n]=Object(l.useState)(!1),i=Object(ve.getDeviceState)(e);return r.a.createElement(ii,{variant:"link",onClick:async()=>{n(!0),await t(Object(ve.openDeviceDebugTerminal)({device:e})),n(!1)},disabled:a||i!==fe.f.CONNECTED},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_DEBUG_LABEL"}))};const oi=Object(i.c)(Be.a)`
  padding: 0;
`;var Ei=({device:e})=>{const t=Object(o.useDispatch)(),a=Object(l.useMemo)(()=>Object(ve.getDeviceState)(e),[e]),[n,i]=Object(l.useState)(!1);return r.a.createElement(oi,{variant:"link",onClick:a=>{a.preventDefault(),a.stopPropagation(),t(Object(ve.confirmDeviceUpgrade)({titleValues:{deviceName:e.name},messageValues:{deviceName:e.name,fromVersion:e.version,toVersion:e.upgrade_to_firmware},onConfirm:()=>{i(!0),t(Object(ve.upgradeDevice)(e,!0)),i(!0)},onCancel:()=>{t(Object(Oe.e)()),i(!1)},isDowngrade:!0}))},disabled:n||a!==ve.DeviceState.CONNECTED},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_DOWNGRADE_DEVICE"}))};var si=e=>{const[t,a]=Object(l.useState)(!1);return Object(l.useEffect)(()=>{fetch(e,{mode:"no-cors"}).then(()=>{a(!0)}).catch(()=>a(!1))},[e]),t};const mi=Object(i.c)(Be.a)`
  padding: 0;
`;function di({device:e}){const{isUbbAlignmentToolModalClosed:t}=Object(o.useSelector)(ze.I),{is_aligning:a}=e,n=Object(o.useDispatch)(),l=Object(ve.getDeviceState)(e),i=si(wn.a.feStaticAssets+"/videos");return r.a.createElement(mi,{variant:"link",onClick:l=>{l.preventDefault(),l.stopPropagation(),a||t||!i||n(Object(Oe.g)({modalType:zt.a.UBB_ALIGNMENT_TOOL,modalProps:{closeModal:()=>{n(Object(ze.h)({isUbbAlignmentToolModalClosed:!0})),n(Object(Oe.e)())}}})),n(Object(ve.alignDevice)(e))},disabled:l!==ve.DeviceState.CONNECTED},r.a.createElement(D.b,{id:a?"DEVICE_ACTIONS_ALIGNMENT_DISABLE":"DEVICE_ACTIONS_ALIGNMENT_ENABLE"}))}var _i=a(16);const bi=Object(i.c)(Be.a)`
  padding: 0;
`,ui=({device:e})=>{const t=Object(o.useDispatch)(),a=Object(l.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),t(Object(ve.confirmDeviceEnable)({device:e,onConfirm:()=>{t(Object(ve.updateDevice)({disabled:!e.disabled},e._id,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}}))},onCancel:()=>{t(Object(Oe.e)())}}))},[]);return r.a.createElement(bi,{variant:"link",onClick:a},r.a.createElement(D.b,{id:e.disabled?"COMMON_ACTION_ENABLE":"COMMON_ACTION_DISABLE"}))},Oi=Object(i.c)(y.a)`
  background-color: ${({theme:e})=>e.colors.whiteoutBackground};
  bottom: 0;
  left: 0;
  top: 0;
  opacity: 0.96;
  padding: 0 24px;
  position: absolute;
  right: 0;
  z-index: 1;
`,pi=Object(i.c)(h.tc)`
  width: 50px;
  height: 50px;
  margin-right: 20px;

  path {
    fill: ${te.k};
  }
`;var Ii=()=>r.a.createElement(Oi,null,r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(pi,null),r.a.createElement(D.b,{id:"DEVICE_STATE_UPGRADING_INFO_WARNING"})));const gi=Object(i.c)("div")`
  position: relative;
`,vi=Object(i.c)(Be.a)`
  padding: 0;
`,Ci=tn.a.object().shape({url:tn.a.string().label("COMMON_LABEL_LOCATION_URL").url(r.a.createElement(D.b,{id:"COMMON_VALIDATION_VALID_URL"})).required()});var Ri=Object(en.compose)(Object(o.connect)(e=>({mgmtSettings:Object(_i.selectMgmtSettings)(e)}),{confirmDeviceCustomUpgrade:ve.confirmDeviceCustomUpgrade,upgradeExternalDevice:ve.upgradeExternalDevice,hideModal:Oe.e}),Object(Ve.f)({validationSchema:Ci,handleSubmit:({url:e},{props:{confirmDeviceCustomUpgrade:t,upgradeExternalDevice:a,device:n,hideModal:l}})=>{t({onConfirm:()=>{a(n,e)},onCancel:()=>{l()}})}}))(({handleSubmit:e,whiteOutActive:t,device:a,mgmtSettings:{auto_upgrade:n}})=>{const l=Object(ve.getDeviceState)(a);return r.a.createElement(gi,null,t&&r.a.createElement(Ii,null),r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(on.a,{full:!0,variant:"secondary",name:"url",helperMessage:"DEVICE_ACTIONS_CUSTOM_UPGRADE_PLACEHOLDER",disabled:!!n,type:"input"}),r.a.createElement(y.a,{marginTop:12,justifyContent:"flex-start"},r.a.createElement(vi,{name:"customUpgrade",variant:"link",type:"submit",onClick:e,disabled:!!n||l!==ve.DeviceState.CONNECTED},r.a.createElement(D.b,{id:"COMMON_ACTION_UPDATE"})))))}),Ti=a(613);const hi=Object(i.c)(oe.a)`
  padding: 0;
`;var Di=({device:e,sourceDevice:t})=>{const a=Object(o.useDispatch)(),[n,i]=Object(l.useState)(!1);return r.a.createElement(hi,{variant:"link",onClick:n=>{n.preventDefault(),n.stopPropagation(),a(Object(ve.confirmDeviceCloneConfig)({name:e.name||e.mac,sourceName:t.name||t.mac,onConfirm:async()=>{i(!0),await a(Object(ve.cloneConfig)(e,t)),i(!1)},onCancel:()=>{i(!1),a(Object(Oe.e)())}}))},disabled:n||!t.mac},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_COPY_CONFIGURATION"}))};const Pi=i.a`
  min-height: 40px;
`,yi=i.a`
  li {
    div {
      display: block !important;
    }
  }
`,fi=Object(i.c)(h.cb)`
  color: ${te.n};
  margin: 4px 0 0 0;
`;var Si=Object(D.e)(({intl:e,device:t})=>{const a=Object(o.useSelector)(ve.selectDevicesData),[n,i]=Object(l.useState)(""),c=a.find(e=>e.mac===n)||{mac:null,name:null},E=a.reduce((e,a)=>(a.adopted&&a.state!==ve.DEVICE_STATE_IDS.ADOPTING&&a.mac!==t.mac&&a.model===t.model&&e.push({label:a.name||a.mac,value:a.mac}),e),[]);return E.length||E.push({image:fi,label:r.a.createElement(D.b,{id:"COMMON_DEVICES_NOT_FOUND"}),value:"notFound",disabled:!0}),r.a.createElement("div",null,r.a.createElement(Ti.a,{searchable:!0,placeholder:e.formatMessage({id:"DEVICE_ACTIONS_COPY_CONFIGURATION_PLACEHOLDER"}),value:n,onChange:e=>{i(e.value)},variant:"secondary",options:E,width:"100%",className:Pi,optionContainerClassName:yi}),r.a.createElement(y.a,{justifyContent:"flex-start",marginTop:"4px"},r.a.createElement(Di,{device:t,sourceDevice:c})))});const Ai=Object(i.c)(y.a)`
  ${({theme:e})=>`\n    border-bottom: 1px solid ${e.motifPalette.neutral02};\n    margin-bottom: 24px;\n    padding-bottom: 12px;\n  `};

  .tooltip-position-fixer {
    margin-right: -16px;
  }
`,Ni=Object(i.c)(Ai)`
  margin-bottom: 12px;
  padding-bottom: 8px;

  &:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
`,ji=Object(i.c)(T.a)`
  margin-right: 6px;
`,Li=({messageId:e,tooltipClassName:t})=>r.a.createElement(cn.a,{message:r.a.createElement(D.b,{id:e}),width:210,tooltipClassName:t},r.a.createElement(h.cb,{isActive:!0,omitSvgMargin:!0}));var xi=({activeItem:e,disableLocate:t,disableRestart:a,disableDebug:n,disableForget:i})=>{const c=Object(o.useSelector)(t=>Object(ve.selectDeviceData)(t,e.mac)),E=Object(o.useSelector)(Object(ve.selectIsUcoreDevice)(e)),s=Object(ve.getRawDeviceState)(c)===fe.f.UPGRADING,m=Object(ve.isUlte)(c),{auto_upgrade:d}=Object(o.useSelector)(_i.selectMgmtSettings),_=Object(ve.isLteWithSubscription)(c),b=Object(o.useSelector)(ze.x)("API_DEVICE_RESTART"),u=Object(l.useMemo)(()=>Object(ve.isDeviceDowngradable)(c),[null==c?void 0:c.version,null==c?void 0:c.upgrade_to_firmware]);return r.a.createElement(r.a.Fragment,null,(c.type===fe.g.AP||c.type===fe.g.SWITCH)&&!m&&r.a.createElement(Ai,{flexDirection:"column",marginTop:"5px"},r.a.createElement(y.a,{alignItems:"center",justifyContent:"flex-start",marginBottom:"12px"},r.a.createElement(ji,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_EXISTING_CONFIG_LABEL"})),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_EXISTING_CONFIG_INFO"})),r.a.createElement(Si,{device:c})),!E&&r.a.createElement(Ai,{flexDirection:"column",marginBottom:"29px"},r.a.createElement(y.a,{alignItems:"center",justifyContent:"flex-start",marginBottom:"12px"},r.a.createElement(ji,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL"})),r.a.createElement(Li,{messageId:d?"DEVICE_ACTIONS_CUSTOM_UPGRADE_NOT_AVAILABLE":"DEVICE_ACTIONS_CUSTOM_UPGRADE_INFO"})),r.a.createElement(Ri,{whiteOutActive:s,device:c})),!t&&r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement($r,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_LOCATE_DEVICE_DESCRIPTION",tooltipClassName:"tooltip-position-fixer"}))),!a&&b&&r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(qr,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_RESTART_INFO",tooltipClassName:"tooltip-position-fixer"}))),c.disabled&&r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(ui,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_ENABLE_INFO",tooltipClassName:"tooltip-position-fixer"}))),c.type===fe.g.UBB&&r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(di,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_ALIGNMENT_INFO",tooltipClassName:"tooltip-position-fixer"}))),u&&r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(Ei,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_DOWNGRADE_DESCRIPTION",tooltipClassName:"tooltip-position-fixer"}))),r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(Jr,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_PROVISION_INFO",tooltipClassName:"tooltip-position-fixer"}))),r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(ri,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_DOWNLOAD_DEVICE_INFO_INFO",tooltipClassName:"tooltip-position-fixer"}))),!n&&r.a.createElement(Ni,{flexDirection:"column"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(ci,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_DEBUG_INFO",tooltipClassName:"tooltip-position-fixer"}))),!i&&r.a.createElement(Ni,{flexDirection:"column",marginTop:"32px"},r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},_?r.a.createElement(ni,{device:c}):r.a.createElement(Ge,{device:c}),r.a.createElement(Li,{messageId:"DEVICE_ACTIONS_FORGET_INFO",tooltipClassName:"tooltip-position-fixer"}))))};const Mi=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
  > li:last-child {
    border-bottom: 0;
  }
`;var Vi;!function(e){e.NAME="name",e.LTE="lte",e.NETWORK="network",e.MANAGE_DEVICE="manage-device"}(Vi||(Vi={}));var wi=Object(en.compose)(Qa([Vi.NAME,Vi.LTE,Vi.NETWORK,Vi.MANAGE_DEVICE]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c})=>{const E=Object(o.useSelector)(hr),s=Object(o.useSelector)(Dr),m=Object(o.useSelector)(Tr),{_id:d,mac:_}=e,b=Object(o.useDispatch)(),u=Object(l.useMemo)(()=>Object(ve.isUltePro)(e),[e.type]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flex:"1"},r.a.createElement(Mi,{variant:"secondary",items:[{id:Vi.NAME,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a,formName:Vi.NAME})},{id:Vi.LTE,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_LTE"}),renderContent:()=>r.a.createElement(Ur,{activeItem:e,setFormDirty:t,setFormInvalid:a,isUltePro:u,formName:Vi.LTE})},{id:Vi.NETWORK,label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a,formName:Vi.NETWORK})},{id:Vi.MANAGE_DEVICE,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:i,onFormSubmit:()=>{const e=Object.entries(m).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});b(Object(ve.updateDeviceWithIdEndpoint)(e,d,_,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(E).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})}}))});var Fi={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:rr},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:Rr},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:wi}}},Ui=a(1153),zi=a(168),ki=a(41);var Bi=({severity:e})=>{const t=["","TM_CONCERNING","TM_UNKNOWN","TM_BLOCKED","TM_KNOWN"][e],a=["secondary","danger","warning","secondary","success"][e];return r.a.createElement(T.a,{color:a,size:"body"},r.a.createElement(D.b,{id:t}))};const Wi=Object(i.c)(y.a)`
  margin-bottom: 4px;
  justify-content: space-between;
  padding: 5px 0;

  span:last-child {
    max-width: 220px;
    text-align: right;
  }
`,Gi=Object(i.c)(Wi)`
  overflow-wrap: break-word;
`,Hi=Object(i.c)(Nn.a)`
  margin-right: 6px;
`;var Yi=({activeItem:e})=>{var t,a,n,i,c,E,s,m,d,_,b;const u=Object(o.useDispatch)(),O=Object(o.useSelector)(I.b),p=Object(o.useSelector)(I.c),g=Object(o.useSelector)(_i.selectIpsSettings),v=Object(o.useSelector)(nn.selectNetworksData),C=Object(o.useSelector)(I.h),R=Object(o.useSelector)(Sn.c),h=Object(o.useSelector)(ze.F),P=Object(o.useSelector)(I.o),f=Object(o.useSelector)(ze.s),S=[(null==e?void 0:e.srcipGeo.country_name)?null==e?void 0:e.srcipGeo.city:null==e?void 0:e.usgipGeo.city,(null==e?void 0:e.srcipGeo.country_name)||(null==e?void 0:e.usgipGeo.country_name)],A=[(null==e?void 0:e.dstipGeo.country_name)?null==e?void 0:e.dstipGeo.city:null==e?void 0:e.usgipGeo.city,(null==e?void 0:e.dstipGeo.country_name)||(null==e?void 0:e.usgipGeo.country_name)],N=S.filter(e=>!!e).join(", "),j=A.filter(e=>!!e).join(", "),L=(null!==(a=null===(t=null==e?void 0:e.flow)||void 0===t?void 0:t.bytes_toclient)&&void 0!==a?a:0)+(null!==(i=null===(n=null==e?void 0:e.flow)||void 0===n?void 0:n.bytes_toserver)&&void 0!==i?i:0),x=p.some(({_id:t})=>t===e._id),[M,V]=Object(l.useState)(x),w=Object(l.useCallback)(()=>{V(!0),u(Object(ki.blockClient)(e.src_ip,e.dest_ip,v))},[u,e.src_ip,null==e?void 0:e.dest_ip,v]),F=O.some(({_id:t})=>t===e._id),[U,z]=Object(l.useState)(F),k=Object(l.useCallback)(()=>{z(!0),u(Object(ki.blacklistClient)(e.src_ip,v))},[u,e.src_ip,v]),B=C.some(({_id:t})=>t===e._id),[W,G]=Object(l.useState)(B),H=Object(l.useCallback)(()=>{G(!0),u(Object(ki.suppressSignature)(g,e))},[u,g,e]),Y=P.some(({_id:t})=>t===e._id),[$,K]=Object(l.useState)(Y),X=Object(l.useCallback)(()=>{K(!0),u(Object(ki.whiteListClient)(g,e.src_ip))},[u,g,null==e?void 0:e.src_ip]);return r.a.createElement(y.a,{height:"100%",flexDirection:"column",justifyContent:"space-between",key:null==e?void 0:e._id},r.a.createElement(y.a,{flexDirection:"column",padding:"26px 32px"},r.a.createElement(T.a,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_OVERVIEW"})),r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_DATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(An.e)(new Date(e.time),R,fn.a))),r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_TIME"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(An.e)(new Date(e.time),R,h))),N===j?r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_TRAFFIC_LOCATION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},N?r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Hi,{countryCode:(null===(c=null==e?void 0:e.srcipGeo)||void 0===c?void 0:c.country_code)||(null===(E=null==e?void 0:e.usgipGeo)||void 0===E?void 0:E.country_code),width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}),N):r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))):r.a.createElement(r.a.Fragment,null,r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_SOURCE_LOCATION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},N?r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Hi,{countryCode:(null===(s=null==e?void 0:e.srcipGeo)||void 0===s?void 0:s.country_code)||(null===(m=null==e?void 0:e.usgipGeo)||void 0===m?void 0:m.country_code),width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}),N):r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))),r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_DESTINATION_LOCATION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},j?r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Hi,{countryCode:(null===(d=null==e?void 0:e.dstipGeo)||void 0===d?void 0:d.country_code)||(null===(_=null==e?void 0:e.usgipGeo)||void 0===_?void 0:_.country_code),width:24,height:24,style:{borderRadius:"50%",objectFit:"cover"}}),j):r.a.createElement(D.b,{id:"COMMON_HYPHEN"})))),r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_SERVICE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},(null===(b=null==e?void 0:e.http)||void 0===b?void 0:b.hostname)||(null==e?void 0:e.inner_alert_signature)||r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))),(null==e?void 0:e.catname)&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_CATEGORY"})),r.a.createElement(T.a,{color:"secondary",size:"body"},zi.a[e.catname]?r.a.createElement(D.b,{id:zi.a[e.catname]}):e.catname)),(null==e?void 0:e.inner_alert_category)&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_TYPE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.inner_alert_category)),(null==e?void 0:e.src_ip)&&r.a.createElement(Gi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_SOURCE_IP"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(zr.b)(e.src_ip,e.src_port))),(null==e?void 0:e.dest_ip)&&r.a.createElement(Gi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_DESTINATION_IP"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(zr.b)(e.dest_ip,e.dest_port))),e.inner_alert_severity>=0&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_SEVERITY"})),r.a.createElement(Bi,{severity:e.inner_alert_severity})),L>=0&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_ACTIVITY"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(Ft.a)(L))),(null==e?void 0:e.in_iface)&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_INTERFACE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.in_iface)),(null==e?void 0:e.proto)&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_PROTOCOL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.proto)),(null==e?void 0:e.dstipASN)&&r.a.createElement(Wi,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"TM_ASN"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.dstipASN))),r.a.createElement(y.a,{flexDirection:"column",padding:"26px 32px"},r.a.createElement(Ui.a,{vertical:!0},r.a.createElement(oe.a,{variant:"primary",color:"danger",disabled:M||f,onClick:w,full:!0},r.a.createElement(D.b,{id:"COMMON_ACTION_BLOCK"})),r.a.createElement(oe.a,{variant:"primary",color:"danger",disabled:U||f,onClick:k,full:!0},r.a.createElement(D.b,{id:"TM_ACTION_ISOLATE"})),r.a.createElement(oe.a,{variant:"secondary",disabled:W||f,onClick:H,full:!0},r.a.createElement(D.b,{id:"TM_ACTION_ALLOW_ALL_IPS"})),r.a.createElement(oe.a,{variant:"primary",disabled:$||f,onClick:X,full:!0},r.a.createElement(D.b,{id:"TM_ACTION_ALLOW_THIS_IP"})))))};var $i=({activeItem:e})=>r.a.createElement(Yi,{activeItem:e,key:null==e?void 0:e._id});var Ki={default:jt.a.OVERVIEW,singlePanel:!0,panels:{details:{path:"/details",component:$i}}},Xi=a(356),qi=a(149),Zi=a(1660),Ji=a(55),Qi=a(428);const ec=Object(i.c)(y.a,{shouldForwardProp:e=>"isDarkMode"!==e})`
  max-width: 140px;
  width: 140px;
  flex: 140;
  height: 100%;
  max-height: 140px;
  padding: 26px;
  position: relative;
  &::after {
    position: absolute;
    content: '';
    border: 7px solid ${({theme:e})=>e.motifPalette.neutral02};
    border-radius: 100%;
    width: 172px;
    height: 172px;
    pointer-events: none;
  }

  & * > text:first-of-type {
    font-size: 28px;
  }
  & * > text:last-of-type {
    font-size: 12px;
  }
  .titleClassNameDown {
    transform: translate(8px, 9px);
    fill: ${({theme:e})=>e.motifPalette.uBlue06};
    font-size: 16px !important;
  }
  .titleClassNameUp {
    transform: translate(8px, 9px);
    fill: ${({theme:e})=>e.motifPalette.purple06};
    font-size: 16px !important;
  }
  .descriptionClassName {
    font-weight: bold;
    transform: translateY(-34px);
  }
`,tc=Object(i.c)(h.fb)`
  position: absolute;
  top: 52%;
  left: 30px;
  color: ${({theme:e})=>{var t;return null===(t=e.motifPalette)||void 0===t?void 0:t.uBlue06}};
`,ac=Object(i.c)(h.gb)`
  position: absolute;
  top: 52%;
  left: 30px;
  color: ${({theme:e})=>{var t;return null===(t=e.motifPalette)||void 0===t?void 0:t.purple06}};
`,nc=Object(i.c)(T.a)`
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui11};
  width: 100%;
`,lc=Object(i.c)(y.a)`
  margin-bottom: 8px;
`,rc=e=>r.a.createElement(r.a.Fragment,null,r.a.createElement(nc,{size:"body",weight:"bold"},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Qi.a,{name:e.name,iconFileName:e.iconFileName}),e.name||r.a.createElement(D.b,{id:"COMMON_UNKNOWN"}))),r.a.createElement(lc,{justifyContent:"space-between"},r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"COMMON_TRAFFIC"})),r.a.createElement(T.a,null,Object(Ft.a)(e.value))));var ic=Object(D.e)(({data:e,intl:t})=>{const{motif:a}=Object(Ji.a)(),n="dark"===a,[i,c]=Object(l.useMemo)(()=>e.reduce(([e,t],{bytes_received:a,bytes_transmitted:n,application:l,category:r})=>65535===l&&255===r?[e,t]:[e+(null!=a?a:0),t+(null!=n?n:0)],[0,0]),[e]),o=Object(l.useMemo)(()=>i?e.filter(({application:e,category:t})=>65535!==e&&255!==t).map(e=>({...e,id:e.application,value:e.bytes_received})):[{...e[0],name:null,iconFileName:null,id:"empty-download",value:100}],[e,i]),E=Object(l.useMemo)(()=>c?e.filter(({application:e,category:t})=>65535!==e&&255!==t).map(e=>({...e,id:e.application,value:e.bytes_transmitted})):[{...e[0],name:null,iconFileName:null,id:"empty-download",value:100}],[e,c]);return r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(ec,{justifyContent:"center",alignItems:"center",isDarkMode:n},r.a.createElement(y.a,{position:"relative"},r.a.createElement(tc,{size:"medium"})),r.a.createElement(Pa.a,{items:o,renderTooltipMessage:rc,tooltipProps:{position:"left"},title:Object(Ft.a)(i),description:t.formatMessage({id:"COMMON_IDENTIFIED_TRAFFIC"}),titleClassName:"titleClassNameDown",descriptionClassName:"descriptionClassName",size:140,thickness:3.5,spacer:.5})),r.a.createElement(ec,{justifyContent:"center",alignItems:"center",isDarkMode:n},r.a.createElement(y.a,{position:"relative"},r.a.createElement(ac,{size:"medium"})),r.a.createElement(Pa.a,{items:E,renderTooltipMessage:rc,tooltipProps:{position:"left"},title:Object(Ft.a)(c),description:t.formatMessage({id:"COMMON_IDENTIFIED_TRAFFIC"}),titleClassName:"titleClassNameUp",descriptionClassName:"descriptionClassName",size:140,thickness:3.5,spacer:.5})))});const cc=Object(i.c)(Ht.a,{shouldForwardProp:e=>"customColor"!==e})`
  background-color: ${({customColor:e})=>e};
  margin-right: 8px;
`,oc=Object(i.c)(T.a)`
  max-width: calc(100% - 18px);
`,Ec=[{id:"name",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"TM_DATA_USAGE"})),sortable:!1,renderCell:({color:e,name:t,iconFileName:a})=>r.a.createElement(r.a.Fragment,null,r.a.createElement(cc,{customColor:e}),r.a.createElement(oc,{size:"body",truncate:!0},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Qi.a,{name:t,iconFileName:a}),t||r.a.createElement(D.b,{id:"COMMON_UNKNOWN"})))),minWidth:140},{id:"clientsCount",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_WORD_BYTES"})),sortable:!1,renderCell:({bytes_received:e,bytes_transmitted:t})=>r.a.createElement(T.a,{color:"inherit",size:"body"},Object(Ft.a)((null!=e?e:0)+(null!=t?t:0))),minWidth:75},{id:"traffic",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_WORD_PACKETS"})),sortable:!1,renderCell:({totalPkts:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},Object(Da.a)(e,{spacer:" "})),minWidth:75}],sc=Object(i.c)("div")`
  margin-top: 36px;
  height: 100%;

  thead tr {
    height: 32px;
  }

  & > div > div > div > div {
    overflow-x: hidden !important;
  }

  & tr {
    background-color: transparent !important;
  }
`,mc=Object(Zi.a)();var dc=({activeItem:e})=>{const t=Object(l.useMemo)(()=>e.usage_by_app.map(e=>{const t=Object(Xi.getCompoundId)({cat:e.category,app:e.application}),{name:a,iconFileName:n}=qi.a[t]||{name:null,iconFileName:null};return{...e,name:a,iconFileName:n,color:mc(t.toString()),total:e.bytes_received+e.bytes_transmitted,totalPkts:e.packets_received+e.packets_transmitted}}).sort((e,t)=>t.total-e.total),[e]),[a,n]=Object(l.useMemo)(()=>t.reduce(([e,t],a)=>[e+a.total,t+a.totalPkts],[0,0]),[t]);return r.a.createElement(y.a,{flexDirection:"column",padding:"26px 32px"},r.a.createElement(ic,{data:t}),r.a.createElement(sc,null,r.a.createElement(ya.a,{items:t,columns:Ec,idField:"application",disableColumnFilters:!0,rowHeight:32,renderFooter:()=>r.a.createElement(y.a,null,r.a.createElement(y.a,{flexGrow:180},r.a.createElement(T.a,{weight:"bold",size:"body",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_TOTAL_TRAFFIC"}))),r.a.createElement(y.a,{flexGrow:87,alignItems:"center"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"secondary"},Object(aa.c)(a))),r.a.createElement(y.a,{flexGrow:82,alignItems:"center"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"secondary"},Object(Da.a)(n,{spacer:" "}))))})))};var _c={default:jt.a.OVERVIEW,singlePanel:!0,panels:{overview:{path:"/overview",component:dc}}};const bc=Object(i.c)(y.a)`
  table {
    th {
      padding-left: 0;
    }
    tr {
      :hover {
        cursor: pointer;
      }
    }
    td {
      padding-left: 0;
      padding-right: 25px;
    }
  }
`,uc=Object(i.c)("div")`
  padding-top: 20px;
`,Oc=Object(i.c)(h.cb)`
  margin-right: 10px;
`,pc=Object(i.c)(h.g)`
  position: absolute;
  right: 0;
`,Ic=Object(i.c)("div")`
  padding-top: 10px;
`,gc=[{id:"hostnameInfo",renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HISTORY_HEADER_NAME"})),renderCell:({client:e,name:t,hostname:a,mac:n})=>r.a.createElement(y.a,{alignItems:"center",justifyContent:"center"},r.a.createElement(y.a,{height:25,minWidth:25,maxWidth:25,justifyContent:"center",alignItems:"center",marginRight:6},e?r.a.createElement(S.a,{client:e}):null),r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body",style:{width:"120px",paddingLeft:"6px",paddingRight:"6px"}},Object(Lt.getClientName)(e)||t||a||n||r.a.createElement(D.b,{id:"COMMON_NA"}))),minWidth:140},{id:"date",renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HISTORY_HEADER_DATE"})),renderCell:({date:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:90},{id:"start",renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HISTORY_HEADER_TIME"})),renderCell:({start:e})=>r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},e),minWidth:70},{id:"experienceInfo",renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_EXP"})),renderCell:({experience:e})=>r.a.createElement(r.a.Fragment,null,e>=0?r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},r.a.createElement("span",{style:{color:Ia.a["color-"+Object(wt.c)(e)]}},e,"%")):r.a.createElement(D.b,{id:"COMMON_NA"}),r.a.createElement(pc,{size:"small"})),minWidth:90}];var vc=({activeItem:e})=>{const t=Object(o.useSelector)(Lt.selectCombinedClientsData),{data:a,isLoading:i,error:c}=Object(o.useSelector)(Object(Ca.selectFormattedSessionData)(e.mac,!0,t||[])),E=Object(n.k)(),s=Object(l.useCallback)(()=>r.a.createElement(Ic,null,a.length>0&&r.a.createElement(D.b,{id:"COMMON_TABLE_FOOTER",values:{length:a.length}})),[a.length]);return Object(Ta.g)([Object(Ca.fetchSession)(e.mac,!0)],r.a.createElement(bc,{justifyContent:"flex-start",alignItems:"center"},!i&&a.length>0&&r.a.createElement(ya.a,{items:a,disableColumnFilters:!0,columns:gc,onRowClick:({id:e})=>E.push("overview/history/"+e),rowHeight:30,renderFooter:s}),(!i||c)&&0===a.length&&r.a.createElement(uc,null,r.a.createElement(Oc,null),r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HISTORY_TAB_EMPTY"}))))};var Cc=({activeItem:e})=>r.a.createElement(r.a.Fragment,null,Object(l.useMemo)(()=>Object(wt.d)(e.satisfaction)&&Object(u.Nc)(e)?r.a.createElement(Qt,{item:e,headerTitle:"DEVICE_HEADER_WIFI_EXPERIENCE",showGraph:!0,itemType:Ut.a.AP,canReport:!0}):null,[e]),r.a.createElement(xl,{activeItem:e})),Rc=a(807),Tc=a(490),hc=a(1045),Dc=a(2630),Pc=a(42),yc=a(60),fc=a(2631);const Sc=Object(i.c)("div")`
  height: 100%;
`,Ac=i.a`
  th {
    padding-right: 0;
  }
`,Nc=i.a`
  :hover {
    cursor: pointer;
  }

  td {
    padding-right: 25px;
  }
`,jc=Object(i.c)("div")`
  margin: 20px 0;
`,Lc=Object(i.c)(Rc.a)`
  justify-content: flex-start;
  margin-top: 8px;

  > div {
    margin: 0;
  }
`;var xc;!function(e){e.GENERAL="General",e.SIGNAL="Signal"}(xc||(xc={}));const Mc=e=>[{id:xc.GENERAL,label:e.formatMessage({id:"DEVICE_PROPERTY_HEADER_GENERAL"})},{id:xc.SIGNAL,label:e.formatMessage({id:"COMMON_SIGNAL"})}];var Vc;!function(e){e.NAME="name",e.CONNECTION="connection",e.EXPERIENCE_INFO="experienceInfo",e.CHANNEL="channel",e.SIGNAL="signal"}(Vc||(Vc={}));const wc=[{id:Vc.NAME,sortable:!0,minWidth:140,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_DOWNLINKS_TABLE_HEADER_NAME"})),renderCell:e=>r.a.createElement(y.a,{alignItems:"center",justifyContent:"center"},r.a.createElement(y.a,{alignItems:"center",justifyContent:"center",minWidth:25,maxWidth:25,height:25},e?r.a.createElement(S.a,{client:e}):null),r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body",style:{width:"150px",paddingLeft:"6px",paddingRight:"6px"}},Object(L.f)(e))),compare:Object(Pc.b)(L.f)},{id:Vc.CONNECTION,sortable:!0,minWidth:80,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_NETWORK"})),renderCell:e=>r.a.createElement(T.a,{size:"body",color:"inherit",truncate:!0},Object(L.i)(e)),compare:Object(Pc.b)(L.i)},{id:Vc.EXPERIENCE_INFO,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_EXP"})),renderCell:e=>r.a.createElement(Dc.a,{activeItem:e}),minWidth:80,sortable:!0,compare:Object(Pc.b)((e,t,a)=>Object(fc.e)(e,a))},{id:Vc.CHANNEL,sortable:!0,minWidth:70,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),renderCell:e=>r.a.createElement(T.a,{size:"body",color:"inherit",truncate:!0},e.type===O.c.WIRELESS&&e.uptime&&e.channel?e.channel:r.a.createElement(D.b,{id:"COMMON_HYPHEN"})),compare:Object(Pc.b)((e,t,a)=>e.type===O.c.WIRELESS&&e.uptime&&e.channel?e.channel:Object(yc.b)(a))},{id:Vc.SIGNAL,sortable:!0,minWidth:90,label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),renderCell:e=>r.a.createElement(r.a.Fragment,null,e.type===O.c.WIRELESS&&e.uptime?r.a.createElement(na.a,{client:e,props:["signal"]},({signal:e})=>e?r.a.createElement(y.a,{alignItems:"center",width:"100%",height:"100%"},r.a.createElement(T.a,{size:"body",color:"inherit"},e," ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"})),r.a.createElement(bn.a,{signal:e})):r.a.createElement(T.a,{size:"body",color:"inherit"},r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))):r.a.createElement(T.a,{size:"body",color:"inherit"},r.a.createElement(D.b,{id:"COMMON_HYPHEN"}))),compare:Object(Pc.b)((e,t,a)=>e.type===O.c.WIRELESS?e.signal:Object(yc.b)(a))}];var Fc=Object(en.compose)(D.e,Object(o.connect)(e=>({clientsExist:Object(Tc.m)(e)}),{fetchClients:Ee.g}),Object(hc.a)(({clientsExist:e,fetchClients:t})=>e||t()))(({activeItem:e,params:{site:t,page:a},path:i,history:c,intl:E,hideSignalTab:s=!1})=>{const[m,d]=Object(l.useState)(xc.GENERAL),[_,u]=Object(l.useState)(!1),p=Object(o.useDispatch)(),I=Object(o.useSelector)(Object(Tc.k)(e)),g=Object(da.a)("/clients/properties/:mac/"+jt.a.OVERVIEW),C=Object(l.useMemo)(()=>m===xc.GENERAL?I:I.filter(e=>e.type===O.c.WIRELESS),[I,m]),R=Object(l.useCallback)(e=>{if("mac"in e){const{mac:l,unifi_device:r}=e;r?(c.push(Object(n.i)(i,{id:l,page:a,panel:jt.a.OVERVIEW,section:"properties",site:t})),p(Object(v.g)({type:b.c.UNIFI_DEVICE_CLIENT,mac:l}))):c.push(g.replace(":mac",l))}},[i,a,t]);return r.a.createElement(Sc,null,!s&&r.a.createElement(Lc,{tabs:Mc(E),onSelectTab:({id:e})=>d(e),selectedTab:m,variant:"tertiary"}),r.a.createElement(ya.a,{items:C,disableColumnFilters:!0,headerRowClassName:Ac,rowClassName:Nc,columns:wc,columnOverride:[Vc.NAME,...m===xc.GENERAL?[Vc.CONNECTION,Vc.EXPERIENCE_INFO]:[Vc.CHANNEL,Vc.SIGNAL]],initialSortBy:"name",renderFooter:()=>I.length>0?r.a.createElement(jc,null,r.a.createElement(D.b,{id:"COMMON_ADV_TABLE_FOOTER",values:{length:C.length>10&&!_?10:C.length,total:C.length}}),C.length>10?r.a.createElement(r.a.Fragment,null," ",r.a.createElement(oe.a,{type:"button",variant:"inline",size:"small",weight:"bold",onClick:()=>u(!_)},r.a.createElement(D.b,{id:"COMMON_SHOW"})," ",r.a.createElement(D.b,{id:_?"COMMON_LESS":"COMMON_ALL"}))):null):r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_DOWNLINKS_TABLE_NO_CLIENTS"}),rowHeight:30,onRowClick:R,rowOffset:0,rowLimit:C.length>10&&!_?10:C.length}))});var Uc=({activeItem:e,flexProps:t})=>{const a=Object(wt.d)(null==e?void 0:e.satisfaction),{na:n,ng:l,naNumSta:i,ngNumSta:c}=Object(ve.getSatisfactionByRadio)(e);return a?r.a.createElement(la,{flexProps:{...t,flexDirection:"column",marginBottom:0}},r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_WIFI_EXPERIENCE_2G"})),c&&0!==l?r.a.createElement(ta.a,{size:"body",type:"percent",input:Math.min(l,100)/100,style:{color:Ia.a["color-"+Object(wt.c)(Math.min(l,100))]}}):r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"}))),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_WIFI_EXPERIENCE_5G"})),i&&0!==n?r.a.createElement(ta.a,{size:"body",type:"percent",input:Math.min(n,100)/100,style:{color:Ia.a["color-"+Object(wt.c)(Math.min(n,100))]}}):r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"})))):null};const zc=Object(i.c)(T.a)`
  white-space: nowrap;
  margin-right: 12px;
`,kc=Object(i.c)(T.a)`
  text-align: right;
`;var Bc=({condition:e,definition:t,hideOnEmpty:a,placeholder:n="...",value:l})=>Object(Ta.g)(e,l||!a?r.a.createElement(r.a.Fragment,null,r.a.createElement(zc,{color:"secondary"},t),r.a.createElement(kc,{color:"secondary"},l)):null,{placeholder:r.a.createElement(r.a.Fragment,null,r.a.createElement(zc,{color:"secondary"},t),r.a.createElement(kc,{color:"secondary"},n))}),Wc=a(30);const Gc=Object(dn.a)(En.selectAPGroupsData,Wc.selectWifiNetworksData,g.c,(e,t,a)=>e.filter(e=>e.device_macs.includes(a)).reduce((e,a)=>[...e,...t.filter(e=>e.ap_group_ids.includes(a._id))],[])),Hc=Object(i.c)(T.a)`
  max-width: 200px;
`;var Yc=()=>{const e=Object(o.useSelector)(Gc),t=Object(Wc.getWifiNetworkNames)(e,!1).sort().join(", ");return t?r.a.createElement(la,null,r.a.createElement(Bc,{value:r.a.createElement(Hc,{size:"body",truncate:!0},t),condition:[Object(En.fetchAPGroups)(void 0,{crudCacheStrategy:{type:me.a.CACHE}}),Object(Wc.fetchWifiNetworks)(void 0,{crudCacheStrategy:{type:me.a.CACHE}})],definition:r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_MEMBERSHIP_WIFI"}))})):null};const $c=Object(i.c)(T.a)`
  max-width: 200px;
`;var Kc=()=>{const e=Object(o.useSelector)(Gc),t=Object(Wc.getWifiNetworkNames)(e,!0).sort().join(", ");return t?r.a.createElement(la,null,r.a.createElement(Bc,{value:r.a.createElement($c,{size:"body",truncate:!0},t),condition:[Object(En.fetchAPGroups)(void 0,{crudCacheStrategy:{type:me.a.CACHE}}),Object(Wc.fetchWifiNetworks)(void 0,{crudCacheStrategy:{type:me.a.CACHE}})],definition:r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_MEMBERSHIP_HOTSPOT"})),hideOnEmpty:!0})):null};const Xc=Object(i.c)(T.a)`
  max-width: 200px;
`;var qc=({activeItem:{mac:e},flexProps:t})=>{const a=Object(o.useSelector)(Object(En.selectAPGroupsByDeviceMac)(e)),n=a&&a.map(({name:e})=>e).sort().join(", ");return n?r.a.createElement(la,{flexProps:t},r.a.createElement(Bc,{value:r.a.createElement(Xc,{size:"body",truncate:!0},n),condition:[Object(En.fetchAPGroups)(void 0,{crudCacheStrategy:{type:me.a.CACHE}})],definition:r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_MEMBERSHIP_AP_GROUP"}))})):null};var Zc=({activeItem:{"user-num_sta":e,satisfaction:t}})=>Object(wt.d)(t)?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e||0)):null;var Jc=({activeItem:{"guest-num_sta":e,satisfaction:t}})=>Object(wt.d)(t)?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_GUESTS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e||0)):null;var Qc=({activeItem:e})=>r.a.createElement(dl,null,[{C:Uc},{C:rl},{C:il},{C:cl},{C:ml},{C:Yc},{C:Kc},{C:qc},{C:Zc},{C:Jc}].map(({C:t})=>r.a.createElement(t,{activeItem:e,key:t.name}))),eo=a(66),to=a(570);var ao=({activeItem:e,radio:t})=>r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(to.a,{device:e,radio:e.radio_table.find(e=>e.radio===t),hidePowerInfo:!0})));var no=Object(D.e)(({activeItem:e,radio:t,intl:a})=>{const n=Object(ve.getRadioStatsTransmitPowerString)(e,null==e?void 0:e.radio_table_stats.find(e=>e.radio===t),a);return n?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TRANSMIT_POWER"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n)):null});var lo=({activeItem:e,radio:t})=>{const{totalPackets:a,totalBytes:n}=Object(ve.getApRadioStats)(e,e.radio_table.find(e=>e.radio===t),"tx");return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},a," / ",n))};var ro=({activeItem:e,radio:t})=>{var a;const{totalPackets:n,totalBytes:l}=Object(ve.getApRadioStats)(e,null===(a=null==e?void 0:e.radio_table)||void 0===a?void 0:a.find(e=>e.radio===t),"rx");return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RX_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n," / ",l))};var io=({activeItem:e,radio:t})=>{const{retryPercentage:a,droppedPercentage:n}=Object(ve.getApRadioStats)(e,e.radio_table.find(e=>e.radio===t),"tx");return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_RETRY_DROPPED"})),r.a.createElement(T.a,{color:"secondary",size:"body"},a,"% / ",n,"%"))};var co=({activeItem:e,radio:t})=>{const{retryPercentage:a,droppedPercentage:n}=Object(ve.getApRadioStats)(e,e.radio_table.find(e=>e.radio===t),"rx");return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RX_RETRY_DROPPED"})),r.a.createElement(T.a,{color:"secondary",size:"body"},a,"% / ",n,"%"))};var oo=({activeItem:e,radio:t,flexProps:a})=>{var n;const l=Object(ve.getRadioChannelUtilization)(e,null===(n=null==e?void 0:e.radio_table_stats)||void 0===n?void 0:n.find(e=>e.radio===t));return l?r.a.createElement(la,{flexProps:a},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CHANNEL_UTILIZATION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},`${l.total}% / ${l.selfRx}% / ${l.selfTx}%`)):null};var Eo=({activeItem:e,radio:t})=>{var a,n;return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null===(n=null===(a=null==e?void 0:e.radio_table_stats)||void 0===a?void 0:a.find(e=>e.radio===t))||void 0===n?void 0:n["user-num_sta"]))};var so=({activeItem:e,radio:t})=>{var a,n;return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_GUESTS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null===(n=null===(a=null==e?void 0:e.radio_table_stats)||void 0===a?void 0:a.find(e=>e.radio===t))||void 0===n?void 0:n["guest-num_sta"]))};const mo=Object(i.c)(T.a)`
  margin-bottom: ${({theme:e})=>e.spacing["spacing-xs"]};
`,_o=Object(i.c)("div")`
  &:not(:last-child) {
    margin-bottom: ${({theme:e})=>e.spacing["spacing-xl"]};
  }
`;var bo=({activeItem:e,radio:t})=>r.a.createElement(_o,null,r.a.createElement(mo,{weight:"bold",size:"body"},r.a.createElement(D.a,{id:(e=>{switch(e){case eo.b.RADIO_NG:return"DEVICE_HEADER_RADIO2G_SHORT";case eo.b.RADIO_NA:return"DEVICE_HEADER_RADIO5G_SHORT";case eo.b.RADIO_AD:return"DEVICE_HEADER_RADIO60G_SHORT";case eo.b.RADIO_6E:return"DEVICE_HEADER_RADIO6G_SHORT";default:return"COMMON_UNKNOWN"}})(t)})),r.a.createElement(dl,null,[{C:ao},{C:no},{C:lo},{C:ro},{C:io},{C:co},{C:oo,flexProps:{}},{C:Eo},{C:so}].map(({C:a,flexProps:n={}})=>r.a.createElement(a,{activeItem:e,radio:t,flexProps:n,key:`${a.name}-${t}`})))),uo=a(2767);const Oo=Object(i.c)("div")`
  table {
    thead {
      tr {
        th {
          &:nth-of-type(2) {
            left: -32px;
          }
        }
      }
    }
  }
`,po=Object(i.c)(y.a)`
  border-bottom: 1px solid ${({theme:e})=>e.colors.dashboardBorder};
`,Io=Object(i.c)(h.Oc)`
  margin-right: 4px;
  margin-top: 6px;
`;var go,vo;!function(e){e.HIERARCHY="hierarchy",e.RADIO_NAME="radio_name",e.ESSID="essid",e.BSSID="bssid"}(go||(go={})),function(e){e.RADIO_GROUP="radio_group",e.BSSID_ESSID="bssid/essid",e.BW="bw",e.CHANNEL="channel"}(vo||(vo={}));var Co=({activeItem:e})=>{var t;return(null===(t=null==e?void 0:e.vap_table)||void 0===t?void 0:t.length)?r.a.createElement(Oo,null,r.a.createElement(ya.a,{hideCellOverflow:!1,items:e.vap_table.reduce((e,t)=>{const a=e.findIndex(({channel:e})=>e===t.channel),n={[go.HIERARCHY]:!0,[go.BSSID]:t.bssid,[go.ESSID]:t.essid};return a>=0?(e[a]={...e[a],children:[...e[a].children,{...n}]},e):(e.push({...t,idField:`${t.id}-${t.essid}-${t.bssid}`,children:[{...n}]}),e)},[]),idField:"idField",disableColumnFilters:!0,columns:[{id:vo.RADIO_GROUP,minWidth:23,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_HEADER_RADIO_GROUP"})),renderCell:({radio:e,channel:t,hierarchy:a,essid:n})=>{var l,i;return a?r.a.createElement(y.a,{width:"100%",alignItems:"center"},r.a.createElement(Io,{isActive:!0}),r.a.createElement(T.a,{size:"body",truncate:!0,color:"inherit"},n)):r.a.createElement(y.a,{justifyContent:"space-between",height:"100%",width:"100%",alignItems:"center"},r.a.createElement(y.a,{marginRight:8,alignItems:"center"},r.a.createElement(T.a,{size:"body",color:"inherit"},r.a.createElement(D.a,{id:`DEVICE_HEADER_RADIO${null===(l=Wc.WlanBand[null==e?void 0:e.toUpperCase()])||void 0===l?void 0:l.toUpperCase()}_SHORT`})),(i=[{label:"DEVICE_PROPERTIES_AP_WLANS_LOW_BANDS_LABEL_SHORT",range:[36,64]},{label:"DEVICE_PROPERTIES_AP_WLANS_MID_BANDS_LABEL_SHORT",range:[100,128]},{label:"DEVICE_PROPERTIES_AP_WLANS_HIGH_BANDS_LABEL_SHORT",range:[149,165]}].find(({range:[e,a]})=>Object(uo.a)(t,e,a)))&&r.a.createElement(T.a,{size:"body",color:"inherit",whiteSpacePreWrap:!0},r.a.createElement(D.b,{id:i.label}))),r.a.createElement(cn.a,{message:r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(po,{paddingBottom:12},r.a.createElement(T.a,{size:"body",weight:"bold",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_HEADER_CHANNELS"}))),r.a.createElement(y.a,{marginTop:12,flexDirection:"column"},r.a.createElement(y.a,{marginBottom:6,justifyContent:"space-between"},r.a.createElement(T.a,{size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_WLANS_LOW_BANDS_LABEL"})),r.a.createElement(T.a,{size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_WLANS_LOW_BANDS_RANGE"}))),r.a.createElement(y.a,{marginBottom:6,justifyContent:"space-between"},r.a.createElement(T.a,{size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_WLANS_MID_BANDS_LABEL"})),r.a.createElement(T.a,{size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_WLANS_MID_BANDS_RANGE"}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_WLANS_HIGH_BANDS_LABEL"})),r.a.createElement(T.a,{size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_WLANS_HIGH_BANDS_RANGE"}))))),width:180,position:"top"},r.a.createElement(h.cb,{isActive:!0})))}},{id:vo.BSSID_ESSID,minWidth:25,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_HEADER_BSSID_ESSID"})),renderCell:({hierarchy:e,bssid:t})=>e&&r.a.createElement(T.a,{size:"body",color:"inherit",truncate:!0},t)},{id:vo.BW,minWidth:20,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_HEADER_BW"})),renderCell:({bw:e})=>e&&r.a.createElement(T.a,{size:"body",color:"inherit"},e," ",r.a.createElement(D.b,{id:"COMMON_UNIT_MHZ"}))},{id:vo.CHANNEL,minWidth:15,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),renderCell:({channel:e})=>r.a.createElement(T.a,{size:"body",color:"inherit"},e)}]})):null};const Ro=Object(i.c)(oe.a)`
  font-weight: normal;
  padding: 0;
  margin: 0;
  height: initial;
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
`,To=()=>r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UPLINK"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_HYPHEN"})));var ho=({uplinkDevice:e,uplinkName:t,params:a,path:i,history:c})=>{const E=Object(o.useDispatch)(),{site:s,page:m,subPage:d}=a,{mac:_}=e,u=Object(l.useCallback)(e=>{e.preventDefault(),e.stopPropagation();const t=Object(n.i)(i,{id:_,site:s,page:m,panel:jt.a.OVERVIEW,subPage:d});c.push(t),E(Object(v.g)({type:b.c.DEVICE,mac:_}))},[]);return r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UPLINK"})),r.a.createElement(Ro,{variant:"link",onClick:u},t))};var Do=({activeItem:e,flexProps:t})=>{const a=Object(o.useSelector)(ve.selectDevicesData),n=Object(ve.getUplinkRemotePort)(a,e);return r.a.createElement(la,{flexProps:t},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_POWER"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:(null==n?void 0:n.poe_power)||0}})))};var Po=({uplink:{rx_packets:e,rx_bytes:t}})=>r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e&&t?r.a.createElement(r.a.Fragment,null,r.a.createElement(ta.a,{size:"body",type:"number",input:e,color:"secondary"})," / ",Object(aa.c)(t)):"- / -"));var yo=({uplink:{tx_packets:e,tx_bytes:t}})=>r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UP_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e&&t?r.a.createElement(r.a.Fragment,null,r.a.createElement(ta.a,{size:"body",type:"number",input:e,color:"secondary"})," / ",Object(aa.c)(t)):"- / -"));var fo=({uplink:{"rx_bytes-r":e,"tx_bytes-r":t}},a=!0)=>a?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_ACTIVITY"})),r.a.createElement(ta.a,{size:"body",color:"secondary",type:"bytes",input:t+e||0,options:"bitrate"})):r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_DOWN_ACTIVITY"})),r.a.createElement(ta.a,{size:"body",type:"bytes",input:e||0,options:"bitrate",color:"secondary"})),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UP_ACTIVITY"})),r.a.createElement(ta.a,{size:"body",type:"bytes",input:t||0,options:"bitrate",color:"secondary"})));var So=function(e){let t=parseFloat(""+e);return t?(t=Math.min(45,Math.max(t,5)),t=(t-5)/40*99,""+(0===t?"0":t.toPrecision(2))):""};var Ao=function(e){return"number"==typeof e?e-95:0};var No=({uplink:{rssi:e}})=>r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},So(e)," (",Ao(e),r.a.createElement(D.b,{id:"COMMON_DEVICE_RADIO_TRANSMIT_POWER_DBM"}),")"));var jo=({uplink:{tx_rate:e}})=>r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_DOWNLINKS_TABLE_HEADER_TX_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(ta.a,{type:"bytes",input:1e3*e/8,options:"bitrate",color:"secondary"})));var Lo=({activeItem:e,flexProps:t})=>r.a.createElement(la,{flexProps:t},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_RX_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(ta.a,{type:"bytes",input:1e3*e.uplink.rx_rate/8,options:"bitrate",color:"secondary"})));var xo=({activeItem:e,params:t,path:a,history:n})=>{const l=Object(o.useSelector)(t=>Object(ve.getUplink)(Object(ve.selectDevicesData)(t),e)),i=Object(ve.getUplinkDisplayName)(e,l),c=Object(ve.getUplinkAttrs)(e)||{},E="wire"===e.uplink.type?[(null==l?void 0:l.mac)?{C:ho,props:{uplinkDevice:l,uplinkName:i,params:t,path:a,history:n}}:{C:To},{C:Zl,props:{uplink:c}},{C:Do,props:{activeItem:e},flexProps:{}},{C:Po,props:{uplink:c}},{C:yo,props:{uplink:c}},{C:fo,props:{uplink:c}}]:[(null==l?void 0:l.mac)?{C:ho,props:{uplinkDevice:l,uplinkName:i,params:t,path:a,history:n}}:{C:To},{C:No,props:{uplink:c}},{C:jo,props:{uplink:c}},{C:Lo,props:{activeItem:e},flexProps:{}},{C:Po,props:{uplink:c}},{C:yo,props:{uplink:c}},{C:fo,props:{uplink:c}}];return r.a.createElement(dl,null,E.map(({C:e,props:t,flexProps:a={}})=>r.a.createElement(e,Object.assign({},t,{flexProps:a,key:e.name}))))};const Mo=Object(i.c)(ga.a)`
  padding: 10px 30px;
`;var Vo=({activeItem:e,params:t,path:a,history:n,...i})=>{var c,o;const E=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(nr,{device:e}),E&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Cc,{activeItem:e}),r.a.createElement(Mo,{variant:"secondary",items:[{id:"clientsGuests",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_CLIENTS_GUESTS"}),renderContent:()=>r.a.createElement(Fc,{activeItem:e,params:t,path:a,history:n})},...E?[{id:"history",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_HISTORY"}),renderContent:()=>r.a.createElement(vc,Object.assign({activeItem:e},i))}]:[],{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),renderContent:()=>r.a.createElement(Qc,{activeItem:e})},...(null===(c=null==e?void 0:e.uplink)||void 0===c?void 0:c.mac)?[{id:"uplinkWired",label:"wire"===(null===(o=null==e?void 0:e.uplink)||void 0===o?void 0:o.type)?r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK_WIRED"}):r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK_WIRELESS"}),renderContent:()=>r.a.createElement(xo,{activeItem:e,params:t,path:a,history:n})}]:[],{id:"airStats",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_AIR_STATS"}),renderContent:()=>((null==e?void 0:e.radio_table)||[]).map(({radio:t})=>r.a.createElement(bo,{activeItem:e,radio:t}))},{id:"wlan",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_WLAN"}),renderContent:()=>r.a.createElement(Co,{activeItem:e})}],renderOnlyExpandedContent:!0,multiOpen:!0})))},wo=a(128),Fo=a(181),Uo=a(94),zo=a(754),ko=a(178),Bo=a(211);const Wo=Object(i.c)(T.a)`
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
`,Go=Object(i.c)(T.a)`
  flex: 1;
  margin-right: 12px;
`,Ho=Object(i.c)("div")`
  margin-bottom: ${e=>e.marginBottom||0}px;
`,Yo=Object(i.c)(y.a)`
  margin-bottom: ${e=>e.marginBottom||0}px;
  justify-content: space-between;
`,$o=Object(i.c)(oe.a)`
  span {
    margin-left: 3px !important;
  }
`,Ko=Object(i.c)(He.Field)`
  margin-right: 18px;
`,Xo=Object(Ve.f)({mapPropsToValues:({switchDeviceData:e,nativeNetworks:t,radiusProfiles:a,radiusSettings:n})=>{const{jumboframe_enabled:l=!1,flowctrl_enabled:r=!1,stp_version:i="rstp",stp_priority:c="32768",dot1x_portctrl_enabled:o=!1,radiusprofile_id:E="",dot1x_fallback_networkconf_id:s="",snmp_location:m="",snmp_contact:d="",outdoor_mode_override:_=ve.OutdoorModeOverride.DEFAULT,power_source_ctrl:b=ve.POWER_SOURCE_OPTIONS.AUTO,power_source_ctrl_enabled:u=!1}=e;return{mgmt_network_id:Object(ve.getDeviceNetworkId)(t,e),jumboframe_enabled:l,flowctrl_enabled:r,stp_version:i,stp_priority:c,dot1x_portctrl_enabled:o,radiusprofile_id:E,radiusProfiles:a,radiusSettings:n,dot1x_fallback_networkconf_id:s,snmp_location:m,snmp_contact:d,outdoor_mode_override:_,power_source_ctrl:b,power_source_ctrl_enabled:u}},validationSchema:tn.a.object().shape({mgmt_network_id:tn.a.string(),flowctrl_enabled:tn.a.boolean(),stp_version:tn.a.string(),stp_priority:tn.a.string(),dot1x_portctrl_enabled:tn.a.boolean(),snmp_contact:tn.a.string(),snmp_location:tn.a.string(),radiusprofile_id:tn.a.string().when("dot1x_portctrl_enabled",{is:!0,then:tn.a.string().isAllowedDefaultRadiusProfile("COMMON_VALIDATION_VALID_DEFAULT_RADIUS_PROFILE").required("COMMON_VALIDATION_FIELD_REQUIRED")}),radiusProfiles:tn.a.array().of(tn.a.object()),radiusSettings:tn.a.object(),dot1x_fallback_networkconf_id:tn.a.string(),outdoor_mode_override:tn.a.string(),power_source_ctrl:tn.a.string(),power_source_ctrl_enabled:tn.a.boolean()}),handleSubmit:()=>null}),qo=[{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_STP",value:"stp"},{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_RSTP",value:"rstp"},{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_DISABLED",value:"disabled"}];var Zo=Object(en.compose)(Object(o.connect)((e,{activeItem:t})=>({nativeNetworks:Object(nn.selectNativeNetworks)(e),switchDeviceData:Object(ve.selectDeviceData)(e,t.mac),radiusOptions:Object(ko.selectRadiusOptions)(e),radiusProfiles:Object(ko.selectRadiusProfiles)(e),radiusSettings:Object(_i.selectRadiusSettings)(e)}),{updateDevice:ve.updateDevice,fetchRadiusProfiles:Bo.fetchRadiusProfiles}),D.e,Xo,Object(zo.b)(({fetchRadiusProfiles:e})=>e()))(({activeItem:e,values:t,errors:a,resetForm:i,dirty:c,setFormDirty:E,setFormInvalid:s,setFieldValue:m,nativeNetworks:_=[],initialValues:b,radiusOptions:u,radiusProfiles:O,isValid:p,hideFlowControl:I,intl:g,formName:C="services"})=>{const R=Object(o.useDispatch)(),P=Object(n.k)(),f=Object(o.useSelector)(oa.b),S=Object(o.useSelector)(d.i),A=Object(n.i)(S,{site:f}),N=Object(Uo.x)(e),j=Object(Uo.r)(e),L=Object(o.useSelector)(pl.e),x=Object(ve.getDeviceModelFeature)(e,"outdoorModeSupport")&&L,M=Object(ve.isGateway)(e),V=Object(Uo.w)(e),w=null==O?void 0:O.length;Object(l.useEffect)(()=>{if((!t.radiusProfiles||!t.radiusProfiles.length)&&w){let{radiusprofile_id:e}=t;t.radiusprofile_id||u.find(e=>e.value===t.radiusprofile_id)||(e=u[0].value),i({values:{...b,radiusprofile_id:e,radiusProfiles:O}})}},[O]),Object(l.useEffect)(()=>{E(C,c),s(C,!p)},[s,E,c,p,C]),Object(l.useEffect)(()=>(R(Object(v.h)({[C]:()=>({snmp_contact:t.snmp_contact,snmp_location:t.snmp_location,...!M&&{mgmt_network_id:t.mgmt_network_id},...!I&&{jumboframe_enabled:t.jumboframe_enabled,flowctrl_enabled:t.flowctrl_enabled},...N&&{stp_version:t.stp_version,stp_priority:t.stp_priority},...j&&{dot1x_portctrl_enabled:t.dot1x_portctrl_enabled},...t.dot1x_portctrl_enabled&&j&&{radiusprofile_id:t.radiusprofile_id,dot1x_fallback_networkconf_id:t.dot1x_fallback_networkconf_id},...x&&{outdoor_mode_override:t.outdoor_mode_override},...V&&{power_source_ctrl:t.power_source_ctrl,power_source_ctrl_enabled:t.power_source_ctrl!==ve.POWER_SOURCE_OPTIONS.AUTO}})})),R(Object(v.j)({[C]:()=>i({values:t})})),R(Object(v.i)({[C]:i})),()=>{R(Object(v.h)({[C]:null})),R(Object(v.j)({[C]:null})),R(Object(v.i)({[C]:null}))}),[e._id,R,i,t,C,j,N,M,I,x,V]);const F=Object(l.useMemo)(()=>_.map(e=>({value:e._id,label:e.name})),[_]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{width:"100%",flexDirection:"column",flex:"1 1 85%"},!M&&r.a.createElement(Ho,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_MGMT_VLAN",name:"mgmt_network_id",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:F,translateLabel:!0})),!I&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Yo,{marginBottom:8},r.a.createElement(Go,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_JUMBO_FRAMES"})),r.a.createElement(He.Field,{name:"jumboframe_enabled",type:"checkbox"})),r.a.createElement(Yo,{marginBottom:16},r.a.createElement(Go,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_FLOW_CONTROL"})),r.a.createElement(He.Field,{name:"flowctrl_enabled",type:"checkbox"}))),N&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ho,{marginBottom:32},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_SPANNING_TREE",name:"stp_version",full:!0,type:"dropdown",variant:"secondary",translateOptions:!0,translateLabel:!0,options:qo})),r.a.createElement(Wo,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_SECURITY"})),"disabled"!==t.stp_version&&r.a.createElement(Ho,{marginBottom:16},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_PRIORITY",name:"stp_priority",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:ve.SPANNING_TREES.map(e=>({label:e,value:e})),translateLabel:!0}))),j&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Yo,{marginBottom:32},r.a.createElement(Go,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_8021X_CONTROL"})),r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_VALUES_ENABLE_8021X_CONTROL",name:"dot1x_portctrl_enabled",type:"checkbox"})),t.dot1x_portctrl_enabled&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ho,{marginBottom:16},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_RADIUS_PROFILE",name:"radiusprofile_id",type:"dropdown",variant:"secondary",full:!0,options:u,invalid:!!a.radiusprofile_id,translateLabel:!0}),!!a.radiusprofile_id&&r.a.createElement(He.ValidationMessage,{align:"left",visible:!0,translation:"COMMON_VALIDATION_VALID_DEFAULT_RADIUS_PROFILE"})),r.a.createElement(Yo,{alignSelf:"flex-end"},r.a.createElement($o,{size:"small",type:"button",variant:"inline",onClick:()=>{P.push(`${A}${wn.a.advancedSettingsRadiusProfileForm}`)}},r.a.createElement(h.p,{height:20,width:20}),r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CREATE_RADIUS_PROFILE"}))),r.a.createElement(Ho,{marginBottom:16},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_FALLBACK_VLAN",name:"dot1x_fallback_networkconf_id",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:[{label:g.formatMessage({id:"COMMON_NONE"}),value:""},...F],translateLabel:!0})),r.a.createElement(Yo,{alignSelf:"flex-end"},r.a.createElement($o,{size:"small",type:"button",variant:"inline",onClick:()=>{P.push(`${A}${wn.a.networkSettingsForm}`)}},r.a.createElement(h.p,{height:20,width:20}),r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_CREATE_FALLBACK_VLAN"}))))),Object(Uo.n)(e)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Wo,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_SNMP"})),r.a.createElement(Ho,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_SNMP_ENTER_LOCATION",name:"snmp_location",full:!0,variant:"secondary"})),r.a.createElement(Ho,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_SNMP_ENTER_CONTACT",name:"snmp_contact",full:!0,variant:"secondary"}))),V&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Wo,{weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_POWER_SOURCE"})),r.a.createElement(Ho,{marginBottom:x?24:0},r.a.createElement(Ko,{type:"radio",name:"power_source_ctrl",value:ve.POWER_SOURCE_OPTIONS.AUTO},r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_AUTO"}))),r.a.createElement(Ko,{type:"radio",name:"power_source_ctrl",value:ve.POWER_SOURCE_OPTIONS.POE_8023AF},r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_8023AF"}))),r.a.createElement(Ko,{type:"radio",name:"power_source_ctrl",value:ve.POWER_SOURCE_OPTIONS.POE_INJECTOR},r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_INJECTOR"}))))),x&&r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"flex-start"},r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(Go,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_DESCRIPTION"}))),r.a.createElement(He.Field,{type:"checkbox",name:"outdoor_mode_override",value:t.outdoor_mode_override===ve.OutdoorModeOverride.ON,afterChange:e=>{m("outdoor_mode_override",e?ve.OutdoorModeOverride.ON:ve.OutdoorModeOverride.OFF)}}))))}),Jo=a(2760),Qo=a(2761),eE=a(852);const tE=Object(i.c)(y.a)`
  margin-bottom: 20px;
`,aE=Object(i.c)(T.a)`
  margin-bottom: 6px;
`,nE=Object(Ve.f)({isInitialValid:!0,mapPropsToValues:({activeItem:e,formName:t="screen"})=>({[t]:{led_override:e.led_override||ve.LedOverride.ON,led_override_color_brightness:e.led_override_color_brightness||ve.DEFAULT_LED_BRIGHTNESS,led_override_color:e.led_override_color||ve.DEFAULT_LED_COLOR}}),validationSchema:tn.a.object().shape({led_override:tn.a.string(),led_override_color_brightness:tn.a.number(),led_override_color:tn.a.string()}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}});var lE=Object(en.compose)(D.e,nE)(({activeItem:e,setFormDirty:t,values:a,dirty:n,resetForm:i,setFieldValue:c,formName:E="screen",disableLedOverrideField:s,disableLedOverrideColor:m,disableLedBrightnessField:d,intl:_})=>{const b=Object(o.useDispatch)(),u=Object(Uo.m)(e);return Object(l.useEffect)(()=>{t(E,n)},[t,n,E]),Object(l.useEffect)(()=>(b(Object(v.h)({[E]:()=>{const e=Object(eE.a)(a,E);return{...a[E],...e}}})),b(Object(v.j)({[E]:()=>{i({values:a})}})),b(Object(v.i)({[E]:i})),()=>{b(Object(v.h)({[E]:null})),b(Object(v.j)({[E]:null})),b(Object(v.i)({[E]:null}))}),[b,E,i,a]),r.a.createElement(r.a.Fragment,null,!s&&r.a.createElement(tE,{justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_LED"}))),r.a.createElement(on.a,{type:"checkbox",name:E+".led_override",value:a[E].led_override===ve.LedOverride.ON,afterChange:e=>{c(E+".led_override",e?ve.LedOverride.ON:ve.LedOverride.OFF)}})),!d&&u&&r.a.createElement(r.a.Fragment,null,r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED_BRIGHTNESS"})),r.a.createElement(tE,null,r.a.createElement(Jo.a,{size:"large",value:a[E].led_override_color_brightness,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:e=>r.a.createElement(T.a,{color:"secondary",size:"body"},e,"%"),onChange:e=>{c(E+".led_override_color_brightness",+e.target.value)}}))),!m&&u&&r.a.createElement(tE,{justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(aE,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_COLOR"})),r.a.createElement(Qo.a,{color:a[E].led_override_color,variant:"block",onChange:e=>{c(E+".led_override_color","hex"in e?e.hex:void 0)},hexLabel:_.formatMessage({id:"DEVICE_PROPERTIES_LABEL_HEX"}),actionButton:r.a.createElement(oe.a,{variant:"inline",onClick:()=>{c(E+".led_override_color",ve.DEFAULT_LED_COLOR)}},r.a.createElement(D.b,{id:"COMMON_VALUE_REVERT_BUTTON"}))}))))}),rE=a(197);const iE=(e,t)=>{if(!t)return Object(Uo.e)(e,ve.WIFI_CAPS.HIDE_CH_WIDTH);const a=null==e?void 0:e.hide_ch_width;return!!a&&("all"===a||a===t)};var cE=a(569);const oE=Object(i.c)("div")`
  height: 100%;
`,EE=i.a`
  th {
    padding-left: 0;
    padding-right: 0;
  }
`,sE=i.a`
  :hover {
    cursor: pointer;
  }
  td {
    padding-left: 0;
    padding-right: 25px;
  }
`,mE=Object(i.c)("div")`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  white-space: pre;
`,dE=Object(i.c)("div")`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  color: ${({theme:e})=>e.colors.primary};
`,_E=Object(i.c)("div")`
  margin-top: 16px;
`,bE=({device:e})=>{const t=Object(o.useDispatch)();return r.a.createElement(dE,{onClick:a=>{a.preventDefault(),a.stopPropagation(),t(Object(v.g)({type:b.c.DEVICE,mac:e.mac}))}},r.a.createElement(cE.a,{device:e}))},uE=[{id:"nameInfo",sortable:!0,minWidth:40,renderLabel:()=>r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_UPLINKS_TABLE_HEADER_AP"})),renderCell:e=>r.a.createElement(bE,{device:e})},{id:"channel",sortable:!0,minWidth:30,maxWidth:90,renderLabel:()=>r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),renderCell:({channel:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},e)},{id:"rssiInfo",sortable:!0,minWidth:40,maxWidth:80,renderLabel:()=>r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),renderCell:({rssi:e})=>r.a.createElement(mE,null,So(e)," (",Ao(e),r.a.createElement(D.b,{id:"COMMON_DEVICE_RADIO_TRANSMIT_POWER_DBM"}),")")}];var OE=function({items:e}){return r.a.createElement(oE,null,r.a.createElement(ya.a,{items:e,disableColumnFilters:!0,disableSelection:!0,disableTextPointer:!0,headerRowClassName:EE,rowClassName:sE,columns:uE,idField:"mac",rowHeight:30}),!e.length&&r.a.createElement(_E,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_UPLINKS_TABLE_EMPTY"}))))};const pE=-67,IE=-77,gE=-90,vE=[{value:"auto",label:"COMMON_VALUE_AUTO"},{value:"manual",label:"COMMON_VALUE_MANUAL"}],CE=[{value:ve.BandsteeringMode.OFF,label:"DEVICE_PROPERTIES_AP_BAND_STEER_OFF"},{value:ve.BandsteeringMode.PREFER_5G,label:"DEVICE_PROPERTIES_AP_BAND_STEER_PREFER_5G"},{value:ve.BandsteeringMode.EQUAL,label:"DEVICE_PROPERTIES_AP_BAND_STEER_BALANCED"}],RE=Object(i.c)(y.a)`
  margin-bottom: 16px;

  > span {
    text-transform: none;
  }
`,TE=Object(i.c)("div",{shouldForwardProp:e=>!["marginBottom","marginTop"].includes(e)})`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
  margin-top: ${({marginTop:e})=>e||0}px;
`,hE=Object(i.c)(T.a)`
  flex: 1;
  margin-right: 12px;
`,DE=Object(i.c)(h.Vb)`
  padding-right: ${({theme:e})=>e.spacing["spacing-xs"]};
  color: ${({theme:e})=>e.motifPalette.aqua08};
`,PE=Object(i.c)(h.Wb)`
  padding-right: ${({theme:e})=>e.spacing["spacing-xs"]};
  color: ${({theme:e})=>e.motifPalette.aqua07};
`,yE=Object(i.c)(h.Xb)`
  padding-right: ${({theme:e})=>e.spacing["spacing-xs"]};
  color: ${Ia.a["purple-1"]};
`,fE=Object(i.c)(h.cb)`
  margin-left: 4px;
`,SE=Object(i.c)(cn.a)`
  width: 100%;
`,AE=Object(i.c)(y.a)`
  > div {
    display: flex;
    align-items: center;
  }
`,NE=[{value:"auto",label:"DEVICE_PROPERTIES_AP_RADIO_POWER_OPTION_AUTO"},{value:"high",label:"DEVICE_PROPERTIES_AP_RADIO_POWER_OPTION_HIGH"},{value:"medium",label:"DEVICE_PROPERTIES_AP_RADIO_POWER_OPTION_MEDIUM"},{value:"low",label:"DEVICE_PROPERTIES_AP_RADIO_POWER_OPTION_LOW"},{value:"custom",label:"DEVICE_PROPERTIES_AP_RADIO_POWER_OPTION_CUSTOM"}],jE=()=>{const e=Object(Le.a)("wifi",!0);return r.a.createElement(hE,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_RADIO_GLOBAL_AP_SETTINGS_INFO",values:{url:e}}))},LE=()=>{const e=Object(Le.a)("wifi",!0);return r.a.createElement(hE,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_RADIO_CHANNEL_OPTIMIZATION_SETTINGS_INFO",values:{url:e}}))};class xE extends l.PureComponent{constructor(e){var t,a,n,l;super(e),this.getRadioSubsection=e=>"DEVICE_PROPERTIES_SECTION_CONFIGURE_RADIOS_SUBSECTION_"+e.toUpperCase(),this.executePriorityUplinkAction=(e,t,a,n)=>{const{setPriorityUplink:l,unsetPriorityUplink:r}=this.props;return"SET"===e?l(t,a,n):r(t)},this.updateUplinkPriorities=e=>{const{resetForm:t,values:a,activeItem:n}=this.props,{meshingEnabled:l,meshingMode:r,uplinkPriority1:i,uplinkPriority2:c}=a,{mesh_uplink_1:o=i,mesh_uplink_2:E=c}=e;if(!((o||"")!==this.state.initialUplinkPriority1||(E||"")!==this.state.initialUplinkPriority2))return;this.setState({initialUplinkPriority1:o||"",initialUplinkPriority2:E||""});const s=l&&"manual"===r&&!(!o&&!E)?"SET":"UNSET";this.executePriorityUplinkAction(s,n,o,E).then(()=>{t({values:{...a,meshingMode:r}})})},this.handlePriorityChange=(e,t)=>{const{values:a,setFieldValue:n}=this.props;let{uplinkPriority1:l,uplinkPriority2:r}=a;if("uplinkPriority1"===e&&!t.value&&r)return l=r,r="",n("uplinkPriority1",l),void n("uplinkPriority2",r);n(e,t.value)},this.handleEnableMeshingChange=()=>{const{setValues:e,values:t}=this.props,a=!t.meshingEnabled;e({...t,meshingEnabled:a,uplinkMeshEnable:a,radios:t.radios.map(e=>e.type===rE.a.NA.type?{...e,vwire_enabled:a}:e)})},this.getSaveData=()=>{const{intl:e,priorityUplinkOptions:t,values:a,activeItem:n,dirty:l,isGlobalApSettingsEnabled:r,isChannelOptimizationEnabled:i,initialValues:c}=this.props;if(!l)return{};const o=Object(ve.getRadios)(n),E=Object(ve.isPureAp)(n),s=Object(ve.doesOnlySupportWireslessUplink)(n),{mesh_uplink_1:m,mesh_uplink_2:d}=(()=>{if("auto"===a.meshingMode)return{mesh_uplink_1:"",mesh_uplink_2:""};const{priorityUplink1:n,priorityUplink2:l}=wE(e,t,a.uplinkPriority1,a.uplinkPriority2);return{mesh_uplink_1:n,mesh_uplink_2:l}})(),_={atf_enabled:a.atf_enabled||!1,mesh_sta_vap_enabled:E&&a.meshingEnabled&&(s||"auto"===a.meshingMode||a.uplinkMeshEnable),radio_table:o.map(e=>{const{name:t,radio:l,antenna_gain:r,antenna_id:c,sens_level:o,sens_level_enabled:E}=e,s=iE(n,l),{type:m,...d}=a.radios.find(e=>e.type===l&&e.name===t),_={...d,antenna_gain:r,antenna_id:c,sens_level_enabled:E,sens_level:o,radio:m};if("custom"!==d.tx_power_mode&&delete _.tx_power,_.antenna_id){const e=Object(ve.getAntennaById)(n,_.antenna_id);e&&(_.antenna_gain=Object(ve.getAntennaGainForRadioName)(e,t))}else delete _.antenna_id;return Object(ve.isMinRssiStrictModeSupported)(e)||_.min_rssi_enabled||delete _.hard_noise_floor_enabled,_.min_rssi_enabled||delete _.min_rssi,_.sens_level_enabled||delete _.sens_level,s&&(delete _.channel,delete _.ht),l===rE.a.NA.type&&(_.vwire_enabled=a.meshingEnabled&&("auto"===a.meshingMode||_.vwire_enabled)),i&&delete _.channel,_}),mesh_uplink_1:m,mesh_uplink_2:d};if(r){const e=_.radio_table.reduce((e,t)=>{const a=c.radios.find(e=>e.type===t.radio&&e.name===t.name);if(!a)return e;const n={};return i||a.channel===t.channel||(n.channel=t.channel),a.min_rssi_enabled!==t.min_rssi_enabled&&(n.min_rssi_enabled=t.min_rssi_enabled),t.min_rssi_enabled&&a.min_rssi!==t.min_rssi&&(n.min_rssi_enabled=t.min_rssi_enabled,n.min_rssi=t.min_rssi),Object.keys(n).length&&e.push({radio:t.radio,name:t.name,...n}),e},[]);return e.length?{radio_table:e}:{}}return _},this.state={initialUplinkPriority1:(null===(a=null===(t=this.props)||void 0===t?void 0:t.activeItem)||void 0===a?void 0:a.mesh_uplink_1)||"",initialUplinkPriority2:(null===(l=null===(n=this.props)||void 0===n?void 0:n.activeItem)||void 0===l?void 0:l.mesh_uplink_2)||""}}componentDidMount(){const{tabGetDataFunction:e,tabSubmitFunction:t,tabResetFunction:a,resetForm:n,priorityUplinkOptions:l,intl:r}=this.props;e({radios:this.getSaveData}),t({radios:e=>{var t,a;if(this.updateUplinkPriorities(e),!(null==e?void 0:e.mac))return;const{atf_enabled:i,mesh_uplink_1:c,mesh_uplink_2:o,mesh_sta_vap_enabled:E}=e,s=Object(ve.getRadios)(e),m=null===(a=null===(t=s.find(({radio:e})=>e===rE.a.NA.type))||void 0===t?void 0:t.vwire_enabled)||void 0===a||a,d=null==E||E,_=m||d,{priorityUplink1:b,priorityUplink2:u}=wE(r,l,c,o),O=_&&m!==d||d&&(b||u)?"manual":"auto",p={radios:s.reduce((e,{name:t,radio:a,ht:n,channel:l,tx_power_mode:r,min_txpower:i,tx_power:c,vwire_enabled:o,min_rssi_enabled:E,min_rssi:s,hard_noise_floor_enabled:m})=>(e.push({name:t,type:a,ht:n||20,channel:l||"auto",tx_power_mode:r||"auto",tx_power:c||i||0,vwire_enabled:null!=o?o:a===rE.a.NA.type,min_rssi_enabled:E||!1,min_rssi:+s||IE,hard_noise_floor_enabled:m||!1}),e),[]),atf_enabled:i||!1,meshingEnabled:_,meshingMode:O,uplinkMeshEnable:d,uplinkPriority1:c||"",uplinkPriority2:o||""};n({values:p})}}),a({radios:n})}componentDidUpdate(){const{dirty:e,setFormDirty:t,setFormInvalid:a,errors:n}=this.props;t("radios",e),a("radios",!!Object.keys(n).length)}componentWillUnmount(){const{tabGetDataFunction:e,tabSubmitFunction:t,tabResetFunction:a}=this.props;e({radios:null}),t({radios:null}),a({radios:null})}getRadioFields(e,t=!1){const{activeItem:a,countryChannels:n,mgmtSettings:l,intl:i,values:c,setFieldValue:o,isGlobalApSettingsEnabled:E,isChannelOptimizationEnabled:s,globalApSettings:m}=this.props,{name:d,radio:_,min_txpower:b,max_txpower:u}=e,O=c.radios.findIndex(e=>e.type===_&&e.name===d),p=c.radios[O],I=Object(ve.getRadioHtOptions)(a,e,n,i),g=iE(a,_),v=l.outdoor_mode_enabled,C=Object(ve.isMinRssiStrictModeSupported)(e)&&p.min_rssi_enabled,R=_===rE.a.NA.type||_===rE.a["6E"].type,h=Object(Uo.f)(a)&&R&&t,P=Object(pl.b)(n,i,a,_,d,p&&p.ht||20,{isOutdoorModeEnabled:v}),f=[{value:"auto",label:i.formatMessage({id:"COMMON_VALUE_AUTO"})},...P];f.some(e=>e.value===p.channel)||o(`radios.${O}.channel`,"auto");const S=E?"custom"===m[_+"_tx_power_mode"]:"custom"===(null==p?void 0:p.tx_power_mode),A=!Object(ve.isUBB)(a);return r.a.createElement(TE,{key:d,marginBottom:24},r.a.createElement(RE,{alignItems:"center"},_===rE.a.NG.type&&r.a.createElement(DE,{height:"20",width:"20"}),_===rE.a.NA.type&&r.a.createElement(PE,{height:"20",width:"23"}),_===rE.a.AD.type&&r.a.createElement(yE,{height:"20",width:"20"}),_===rE.a["6E"].type&&r.a.createElement(yE,{height:"20",width:"20"}),r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:this.getRadioSubsection(_)}))),!g&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(y.a,{width:"50%",marginRight:"8px"},r.a.createElement(vn.a,{condition:E,wrapper:e=>r.a.createElement(SE,{position:"top",width:"208px",portal:!0,isInteractive:!0,message:r.a.createElement(jE,null)},e)},r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_CHANNEL_WIDTH",name:`radios.${O}.ht`,value:E&&m[_+"_channel_size"]||c.radios[O].ht,type:"dropdown",variant:"secondary",options:I,translateLabel:!0,validated:!0,full:!0,disabled:E}))),r.a.createElement(y.a,{width:"50%",marginLeft:"8px"},r.a.createElement(vn.a,{condition:s,wrapper:e=>r.a.createElement(SE,{position:"top",width:"208px",portal:!0,isInteractive:!0,message:r.a.createElement(LE,null)},e)},r.a.createElement(on.a,{label:s||"auto"!==c.radios[O].channel?"COMMON_CHANNEL":r.a.createElement("label",{htmlFor:`radios.${O}.channel`},r.a.createElement(AE,{alignItems:"center"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"}),r.a.createElement(cn.a,{width:208,message:r.a.createElement(D.b,{id:"DEVICE_RADIO_CHANNEL_AUTO"}),portal:!0},r.a.createElement(fE,{isActive:!0,size:"original"})))),name:`radios.${O}.channel`,type:"dropdown",variant:"secondary",options:f,translateLabel:!0,validated:!0,value:c.radios[O].channel,full:!0,disabled:s}))))),r.a.createElement(vn.a,{condition:E,wrapper:e=>r.a.createElement(SE,{position:"top",width:"208px",portal:!0,isInteractive:!0,message:r.a.createElement(jE,null)},e)},r.a.createElement(r.a.Fragment,null,!Object(ve.isUBB)(a)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(y.a,{width:S?"50%":"100%",marginRight:S?"8px":"0"},r.a.createElement(on.a,{label:E||"auto"!==c.radios[O].tx_power_mode?"DEVICE_PROPERTIES_LABEL_TRANSMIT_POWER":r.a.createElement("label",{htmlFor:`radios.${O}.tx_power_mode`},r.a.createElement(AE,{alignItems:"center"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TRANSMIT_POWER"}),r.a.createElement(cn.a,{width:208,message:r.a.createElement(D.b,{id:"DEVICE_RADIO_TRANSMIT_POWER_AUTO"}),portal:!0},r.a.createElement(fE,{isActive:!0,size:"original"})))),name:`radios.${O}.tx_power_mode`,value:E&&m[_+"_tx_power_mode"]||c.radios[O].tx_power_mode,type:"dropdown",variant:"secondary",options:NE,validated:!0,full:!0,translateLabel:!0,translateOptions:!0,disabled:E})),S&&r.a.createElement(y.a,{width:"50%",marginLeft:"8px"},r.a.createElement(on.a,{label:"COMMON_DEVICE_RADIO_TRANSMIT_POWER_DBM",name:`radios.${O}.tx_power`,value:E?m[_+"_tx_power"]:c.radios[O].tx_power,min:b,max:u,type:"number",variant:"secondary",full:!0,disabled:E})))))),A&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between",alignItems:"center"},r.a.createElement(hE,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_MIN_RSSI"})),r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ENABLE_MIN_RSSI",name:`radios.${O}.min_rssi_enabled`,type:"checkbox"})),p.min_rssi_enabled&&r.a.createElement(TE,{marginBottom:16},r.a.createElement(hE,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_MIN_RSSI"})),r.a.createElement(Jo.a,{min:-pE,max:-gE,size:"large",value:-p.min_rssi,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:e=>r.a.createElement(T.a,{color:"secondary"},"-",e),onChange:e=>{o(`radios.${O}.min_rssi`,-e.target.value)}}))),r.a.createElement(vn.a,{condition:E,wrapper:e=>r.a.createElement(SE,{position:"top",width:"208px",portal:!0,isInteractive:!0,message:r.a.createElement(jE,null)},e)},r.a.createElement(r.a.Fragment,null,A&&C&&r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between",alignItems:"center"},r.a.createElement(hE,{size:"body",color:E?"disabled":void 0},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_INTERFERENCE_BLOCKER"})),r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_INTERFERENCE_BLOCKER",name:`radios.${O}.hard_noise_floor_enabled`,type:"checkbox",disabled:E})),h&&r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between",alignItems:"center"},r.a.createElement(hE,{size:"body",color:E?"disabled":void 0},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_AIRTIME_FAIRNESS"})),r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_AIRTIME_FAIRNESS",name:"atf_enabled",type:"checkbox",disabled:Object(ve.getDeviceModelFeature)(a,"atfDisabled")||E})))))}renderWirelessUplinkPriorities(e){const{activeItem:t,isWirelessMeshingEnabled:a,intl:n,values:l,setFieldValue:i,uplinkItems:c,priorityUplinkOptions:o,isGlobalApSettingsEnabled:E}=this.props;if(Object(ve.isGateway)(t)&&Object(ve.isUBB)(t))return null;const{uplinkPriority1:s,uplinkPriority2:m,meshingMode:d,uplinkMeshEnable:_}=l,b=!Object(ve.isGateway)(t),u=Object(ve.isPureAp)(t),O=Object(ve.doesOnlySupportWireslessUplink)(t),{priorityUplinkOptions1:p,priorityUplinkOptions2:I}=VE(n,o,s,m),{priorityUplink1:g,priorityUplink2:v}=wE(n,o,s,m);return a&&r.a.createElement(vn.a,{condition:E,wrapper:e=>r.a.createElement(SE,{position:"top",width:"208px",portal:!0,isInteractive:!0,message:r.a.createElement(jE,null)},e)},r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between",alignItems:"center"},r.a.createElement(hE,{size:"body",color:E?"disabled":void 0},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING"})),r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING",name:"meshingEnabled",type:"checkbox",onChange:this.handleEnableMeshingChange,disabled:O||E})),l.meshingEnabled&&b&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:12},vE.map(({label:e,value:t})=>r.a.createElement(on.a,{name:"meshingMode",key:t,value:t,checked:d===t,type:"radio",onChange:()=>i("meshingMode",t),disabled:E},r.a.createElement(D.b,{id:e})))),"manual"===d&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between",alignItems:"center"},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(T.a,{size:"body",color:E?"disabled":void 0},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING_DOWNLINK"})),r.a.createElement(vn.a,{condition:!E,wrapper:e=>r.a.createElement(cn.a,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING_DOWNLINK_DESC"}),width:200,portal:!0},e)},r.a.createElement(fE,{isActive:!0,size:"original"}))),r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING_DOWNLINK",name:`radios.${e}.vwire_enabled`,type:"checkbox",disabled:E})),u&&r.a.createElement(y.a,{marginBottom:16,justifyContent:"space-between",alignItems:"center"},r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(T.a,{size:"body",color:E?"disabled":void 0},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING_UPLINK"})),r.a.createElement(vn.a,{condition:!E,wrapper:e=>r.a.createElement(cn.a,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING_UPLINK_DESC"}),width:200,portal:!0},e)},r.a.createElement(fE,{isActive:!0,size:"original"}))),r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ENABLE_MESHING_UPLINK",name:"uplinkMeshEnable",type:"checkbox",disabled:O||E})),u&&_&&r.a.createElement(r.a.Fragment,null,r.a.createElement(TE,{marginBottom:24,marginTop:32},r.a.createElement(on.a,{full:!0,label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabel:!0,translateLabelValues:{number:1},name:"uplinkPriority1",type:"dropdown",variant:"secondary",options:p,searchable:!0,value:g,onChange:e=>this.handlePriorityChange("uplinkPriority1",e),placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0,disabled:E})),!!s&&r.a.createElement(TE,{marginBottom:24},r.a.createElement(on.a,{full:!0,label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabel:!0,translateLabelValues:{number:2},name:"uplinkPriority2",type:"dropdown",options:I,searchable:!0,value:v,onChange:e=>this.handlePriorityChange("uplinkPriority2",e),placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0,disabled:E})),c.length>0&&r.a.createElement(TE,{marginBottom:24},r.a.createElement(OE,{items:c})))))))}render(){const{activeItem:e}=this.props,t=Object(ve.getRadios)(e).sort(ve.sortRadios).reverse(),a=t.some(e=>"6e"===e.radio),n=t.map(({radio:e})=>a?e===rE.a["6E"].type:e===rE.a.NA.type).lastIndexOf(!0);return t.map((e,t)=>{const a=t===n;return r.a.createElement(r.a.Fragment,null,this.getRadioFields(e,a),a&&this.renderWirelessUplinkPriorities(t))})}}const ME=e=>({value:"",label:e.formatMessage({id:"COMMON_VALUE_AUTO"})}),VE=(e,t,a,n)=>({priorityUplinkOptions1:[ME(e)].concat(...t.filter(e=>!e.value||e.value!==n)),priorityUplinkOptions2:[ME(e)].concat(...t.filter(e=>!e.value||e.value!==a))}),wE=(e,t,a,n)=>{var l,r;const{priorityUplinkOptions1:i,priorityUplinkOptions2:c}=VE(e,t,a,n);return{priorityUplink1:a&&(null===(l=i.find(e=>(null==e?void 0:e.value)===a))||void 0===l?void 0:l.value)||"",priorityUplink2:n&&(null===(r=c.find(e=>(null==e?void 0:e.value)===n))||void 0===r?void 0:r.value)||""}},FE=Object(Ve.f)({mapPropsToValues:({activeItem:e,intl:t,priorityUplinkOptions:a})=>{var n,l;const{atf_enabled:r,mesh_uplink_1:i,mesh_uplink_2:c,mesh_sta_vap_enabled:o}=e,E=Object(ve.getRadios)(e),s=null===(l=null===(n=E.find(({radio:e})=>e===rE.a.NA.type))||void 0===n?void 0:n.vwire_enabled)||void 0===l||l,m=null==o||o,d=s||m,{priorityUplink1:_,priorityUplink2:b}=wE(t,a,i,c),u=d&&s!==m||m&&(_||b)?"manual":"auto";return{radios:E.reduce((e,{name:t,radio:a,ht:n,channel:l,tx_power_mode:r,tx_power:i,min_txpower:c,vwire_enabled:o,min_rssi_enabled:E,min_rssi:s,hard_noise_floor_enabled:m})=>(e.push({name:t,type:a,ht:+n||ve.DEFAULT_HT[a],channel:Number(l)||"auto",tx_power_mode:r||"auto",tx_power:i||c||0,vwire_enabled:null!=o?o:a===rE.a.NA.type,min_rssi_enabled:E||!1,min_rssi:+s||IE,hard_noise_floor_enabled:m||!1}),e),[]),atf_enabled:r||!1,meshingEnabled:d,meshingMode:u,uplinkMeshEnable:m,uplinkPriority1:i||"",uplinkPriority2:c||""}},validate:(e,{activeItem:{radio_table:t},intl:a})=>{const n={};return e.radios.forEach((e,l)=>{const{tx_power_mode:r,tx_power:i,name:c,type:o}=e;if("custom"===r){const e=t.find(e=>e.radio===o&&e.name===c);if(e){const{min_txpower:t,max_txpower:r}=e;(i<t||i>r)&&(n.radios||(n.radios=[]),n.radios[l]={tx_power:a.formatMessage({id:"DEVICE_VALIDATION_HINT_RANGE"},{min:t,max:r})})}}}),n},handleSubmit:()=>{}}),UE={createToast:je.a,tabGetDataFunction:v.h,tabSubmitFunction:v.j,tabResetFunction:v.i,setPriorityUplink:ve.setPriorityUplink,unsetPriorityUplink:ve.unsetPriorityUplink};var zE=Object(en.compose)(Object(o.connect)((e,{activeItem:t})=>({countryChannels:Object(pl.d)(e),mgmtSettings:Object(_i.selectMgmtSettings)(e),priorityUplinkOptions:Object(g.j)(e),uplinkItems:Object(ve.selectDeviceEnhancedUplinkTable)(e,t),globalApSettings:Object(_i.selectGlobalApSettings)(e)}),UE),D.e,FE)(xE);const kE=Object(i.c)(y.a)`
  margin-bottom: 16px;
`;var BE=Object(Ve.f)({mapPropsToValues:({activeItem:{bandsteering_mode:e}={}})=>({bandsteering_mode:e||fe.c.OFF}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(({setFormDirty:e,dirty:t,values:a,resetForm:n,setFieldValue:i})=>{const c=Object(o.useDispatch)();return Object(l.useEffect)(()=>{e("bandSteering",t)},[e,t]),Object(l.useEffect)(()=>(c(Object(v.h)({bandSteering:()=>a})),c(Object(v.j)({bandSteering:()=>n({values:a})})),c(Object(v.i)({bandSteering:n})),()=>{c(Object(v.h)({bandSteering:null})),c(Object(v.j)({bandSteering:null})),c(Object(v.i)({bandSteering:null}))}),[c,n,a]),r.a.createElement(kE,null,CE.map(({value:e,label:t})=>r.a.createElement(on.a,{name:"bandsteering_mode",key:e,value:e,checked:a.bandsteering_mode===e,type:"radio",onChange:()=>i("bandsteering_mode",e)},r.a.createElement(D.b,{id:t}))))}),WE=a(2600);const GE=Object(i.c)("div")`
  margin-bottom: 16px;
`,HE=Object(i.c)(h.cb)`
  margin-left: 6px;
`;var YE,$E=({isGlobalApSettingsEnabled:e,isChannelOptimizationEnabled:t,setGlobalApSettingsEnabled:a,setChannelOptimizationEnabled:n,disableChannelOptimization:l})=>{const i=Object(Le.a)("wifi",!0);return r.a.createElement(r.a.Fragment,null,r.a.createElement(GE,null,r.a.createElement(WE.a,{full:!0,checked:e,onChange:e=>a(e.target.checked)},r.a.createElement(y.a,{width:"100%",alignItems:"center"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_RADIO_GLOBAL_AP_SETTINGS_TOGGLE"}))))),r.a.createElement(GE,null,r.a.createElement(vn.a,{condition:l,wrapper:e=>r.a.createElement(cn.a,{width:"208px",message:r.a.createElement(D.a,{id:"DEVICE_RADIO_CHANNEL_OPTIMIZATION_DISABLED",values:{url:i}})},e)},r.a.createElement(WE.a,{full:!0,checked:t,onChange:e=>n(e.target.checked),disabled:l},r.a.createElement(y.a,{width:"100%",alignItems:"center"},r.a.createElement(T.a,Object.assign({size:"body"},l?{color:"disabled"}:{}),r.a.createElement(D.b,{id:"DEVICE_RADIO_CHANNEL_OPTIMIZATION_TOGGLE"})),r.a.createElement(cn.a,{width:208,message:r.a.createElement(D.b,{id:"DEVICE_RADIO_CHANNEL_OPTIMIZATION_TOGGLE_DESC"})},r.a.createElement(HE,{isActive:!0,size:"original"})))))))};!function(e){e.NAME="name",e.LED="led",e.SERVICES="services",e.NETWORK="network",e.MANAGE="manage",e.RADIOS="radios"}(YE||(YE={}));var KE=Qa([YE.NAME,YE.RADIOS,YE.LED,YE.SERVICES,YE.NETWORK,YE.MANAGE])(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i})=>{var c,E,s,m;const d=Object(o.useSelector)(Tr),_=Object(o.useSelector)(hr),b=Object(o.useSelector)(Dr),u=Object(o.useSelector)(Fo.o),O=Object(o.useSelector)(Fo.D),p=Object(o.useSelector)(Fo.d),{_id:I,mac:g}=e,[v,C]=Object(l.useState)(!(null===(c=u.ap_exclusions)||void 0===c?void 0:c.includes(g))),[R,T]=Object(l.useState)(O.enabled&&!(null===(E=O.exclude_devices)||void 0===E?void 0:E.includes(g))),h=Object(o.useDispatch)(),P=n||v!==!(null===(s=u.ap_exclusions)||void 0===s?void 0:s.includes(e.mac))||R!==(O.enabled&&!(null===(m=O.exclude_devices)||void 0===m?void 0:m.includes(e.mac))),f=Object(l.useCallback)(async()=>{var e,t;try{const a=[];if(v!==!(null===(e=u.ap_exclusions)||void 0===e?void 0:e.includes(g))){const e=u.ap_exclusions.filter(e=>e!==g);v||e.push(g),a.push({...u,ap_exclusions:e})}if(O.enabled&&R!==!(null===(t=O.exclude_devices)||void 0===t?void 0:t.includes(g))){const e=O.exclude_devices.filter(e=>e!==g);R||e.push(g),a.push({...O,exclude_devices:e,settings_preference:"auto"})}a.length&&await h(Object(wo.k)(a))}catch(r){return void h(Object(je.a)({icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}const a=Object.entries(d).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{led:n,...l}=a;h(Object(ve.updateDeviceWithIdEndpoint)({...l,...n},I,g,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(({data:e=[a]})=>{Object.values(_).forEach(t=>{"function"==typeof t&&t(e[0])})})},[I,h,d,u,v,R,g,_,O]),S=Object(l.useCallback)(()=>{Object.values(b).forEach(e=>{"function"==typeof e&&e()})},[b]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%",padding:"20px 32px 0"},r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a,formName:YE.NAME}),r.a.createElement($E,{isGlobalApSettingsEnabled:v,setGlobalApSettingsEnabled:C,isChannelOptimizationEnabled:R,setChannelOptimizationEnabled:T,disableChannelOptimization:!O.enabled}),r.a.createElement(ga.a,{variant:"secondary",items:[{id:YE.RADIOS,label:r.a.createElement(D.b,{id:"COMMON_RADIOS"}),openByDefault:!0,renderContent:()=>r.a.createElement(zE,{activeItem:e,setFormDirty:t,setFormInvalid:a,isWirelessMeshingEnabled:p,isGlobalApSettingsEnabled:v,isChannelOptimizationEnabled:R})},...Object(Uo.g)(e)?[{id:"bandsteer",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_BAND_STEERING"}),renderContent:()=>r.a.createElement(BE,{activeItem:e,setFormDirty:t})}]:[],{id:YE.LED,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED"}),renderContent:()=>r.a.createElement(lE,{activeItem:e,setFormDirty:t,formName:YE.LED})},{id:YE.SERVICES,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a,hideFlowControl:!0,formName:YE.SERVICES})},{id:YE.NETWORK,label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a,formName:YE.NETWORK})},{id:YE.MANAGE,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:P,isInvalid:i,onFormSubmit:f,onFormCancel:S}))});const XE=e=>Object(me.s)("spectrumScan","/api/s/{site}/stat/spectrum-scan/"+e,e,void 0,{idField:"mac"}),qE=(e,t)=>{var a;return(null===(a=((e,t)=>Object(me.v)(XE(t),e.models))(e,t))||void 0===a?void 0:a.data)||[]};var ZE=a(1048);const JE=[{from:-96,to:-92,color:"#fda839"},{from:-92,to:-88,color:"#fda839"},{from:-88,to:-84,color:"#fda129"},{from:-84,to:-80,color:"#fd9a19"},{from:-80,to:-76,color:"#fd930b"},{from:-76,to:-72,color:"#f87f0c"},{from:-72,to:-68,color:"#f26a13"},{from:-68,to:-64,color:"#f26a13"},{from:-64,to:-60,color:"#ec5619"},{from:-60,to:-56,color:"#d44515"},{from:-56,to:-52,color:"#c64013"},{from:-52,to:0,color:"#bf3d12"}],QE={ng:16,na:42},es={ng:8,na:0},ts={ng:[{from:2400,to:2500}],na:[{from:5170,to:5330},{from:5490,to:5730},{from:5735,to:5850}]},as={domain:[0,23.3,35,46.6,58.3,100],values:["#fda93a","#fda93a","#fd9208","#ea4e1a","#bf3d12","#bf3d12"]},ns={20:{domain:[0,6.2,28.1,49.9,71.9,100],values:as.values},40:{domain:[0,1.6,24.6,47.4,70.5,100],values:as.values},80:{domain:[23.3,35,46.6,58.3,100],values:as.values.slice(1)},160:{domain:[23.3,35,46.6,58.3,100],values:as.values.slice(1)}},ls=Object(i.c)(T.a)`
  margin-bottom: 16px;
  font-weight: bold;
`,rs=Object(i.c)(y.a)`
  margin-bottom: 56px;
`,is=Object(i.c)("div")`
  padding: 21px 0;
  box-shadow: inset 0 0 0 1px ${({theme:e})=>e.colors.legendText};
  position: relative;
  width: ${({width:e})=>e};
  height: ${({height:e})=>e};
`,cs=Object(i.c)("div")`
  padding: 21px 0;
  width: ${({width:e})=>e};
  height: ${({height:e})=>e};
  opacity: 0;
  visibility: hidden;
`,os=(Object(i.c)(y.a)`
  padding: 21px 0;
  box-shadow: inset 0 0 0 1px ${({theme:e})=>e.colors.legendText};
  position: relative;
  width: ${({width:e})=>e};
`,Object(i.c)("div")`
  height: 100%;
  width: 0;
  left: -1px;
  top: 0;
  position: absolute;
  border-left: 1px dashed ${({theme:e})=>e.colors.legendText};
  margin-left: ${({marginLeft:e})=>e}%;
`);var Es=({count:e,offset:t})=>r.a.createElement(r.a.Fragment,null,[...Array(e)].map((e,a)=>r.a.createElement(os,{key:"divider-"+a.toString(),marginLeft:(a+1)*t})));const ss=Object(i.c)("div")`
  height: 100%;
  width: 0;
  left: 0;
  top: calc(100% + 4px);
  position: absolute;
  margin-left: ${({marginLeft:e})=>e};
  font-size: 10px;
`,ms=Object(i.c)("div")`
  transform: rotate(90deg);
`;var ds=({count:e,offset:t,start:a,end:n,step:l})=>r.a.createElement(r.a.Fragment,null,r.a.createElement(ss,{key:"start-legend",marginLeft:"4px"},r.a.createElement(ms,null,a)),[...Array(e)].map((e,n)=>r.a.createElement(ss,{key:"divider-legend-"+n.toString(),marginLeft:(n+1)*t+"%"},r.a.createElement(ms,null,a+(n+1)*l))),r.a.createElement(ss,{key:"end-legend",marginLeft:"calc(100% - 4px)"},r.a.createElement(ms,null,n))),_s=a(210),bs=a.n(_s),us=a(113);const Os=Object(i.c)("div")`
  margin: 16px 0;
`,ps=Object(i.c)(y.a)`
  height: 50px;
`,Is=Object(i.c)("div")`
  margin: 1px 0 4px;
  height: 2px;
`,gs=e=>i.a`
  background: linear-gradient(
    90deg,
    ${ns[e].values.map((t,a)=>`${t} ${ns[e].domain[a]}%`).join(",")}
  );
`,vs=Object(i.c)("div")`
  margin: 0 0.5px;
  width: ${({width:e})=>e};
  position: relative;
  background: ${({motif:e})=>Ia.a["dark"===e?"grey-1":"white-3"]};
`,Cs=Object(i.c)("div")`
  width: 100%;
  height: ${({height:e})=>e};
  background-color: ${({background:e})=>e};
  position: absolute;
  bottom: 0;
  border-radius: 1px;
`;var Rs=Object(us.a)(({data:e,width:t,motif:a})=>{if(!e||!e.length)return null;const n=e.length;return r.a.createElement(Os,null,r.a.createElement(ps,null,e.map((e,l)=>{const i=l/n*100,c=bs.a.scale(ns[t].values).domain(ns[t].domain)(i).css();return r.a.createElement(vs,{width:n+"%",key:"rssi-bar-"+(l+1),motif:a},r.a.createElement(Cs,{height:e+"%",background:c}))})),r.a.createElement(Is,{className:gs(t)}))});const Ts=Object(i.c)(h.mc)`
  margin-top: -4px;
  margin-right: 4px;
`,hs=Object(i.c)("div")`
  text-transform: uppercase;
  font-size: ${({theme:e})=>e.fontSizes[1]}px;
  font-weight: ${({theme:e})=>e.fontWeights.bold};
  padding: 8px 0;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
`,Ds=Object(i.c)("div")`
  text-transform: uppercase;
  margin: 16px 0 8px;
  font-weight: ${({theme:e})=>e.fontWeights.bold};
`,Ps=Object(i.c)(y.a)`
  margin-bottom: 4px;
`,ys=Object(i.c)("div")`
  font-size: ${({theme:e})=>e.fontSizes[0]}px;
  color: ${({theme:e})=>e.motifPalette.text02};
  min-width: 50%;
`,fs=Object(i.c)("div")`
  font-size: ${({theme:e})=>e.fontSizes[0]}px;
  font-weight: ${({theme:e})=>e.fontWeights.bold};
  min-width: 50%;
`;var Ss=Object(D.e)(({isAc:e=!1,spectrumEntry:t,data:a,radioType:n,width:l,intl:i})=>{if(!a)return null;const{interference:c,utilization:o,rssi_histogram:E}=t||{},{lowerFrequency:s,upperFrequency:m,subChannels:d,channel:_}=a,b=`${s} - ${m} ${i.formatMessage({id:"COMMON_UNIT_MHZ"})}`,u=`DEVICE_PROPERTIES_SECTION_RADIOS_SUBSECTION_${n.toUpperCase()}${e&&"na"===n?"_AC":""}`;return r.a.createElement("div",null,r.a.createElement(hs,null,r.a.createElement(Ts,null),r.a.createElement(D.b,{id:"COMMON_CHANNEL"})," ",_),r.a.createElement(Ds,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW"})),r.a.createElement(Ps,null,r.a.createElement(ys,null,r.a.createElement(D.b,{id:"COMMON_RADIO"})),r.a.createElement(fs,null,r.a.createElement(D.b,{id:u}))),r.a.createElement(Ps,null,r.a.createElement(ys,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CHANNEL_WIDTH"})),r.a.createElement(fs,null,l," ",r.a.createElement(D.b,{id:"COMMON_UNIT_MHZ"}))),+l>20&&r.a.createElement(Ps,null,r.a.createElement(ys,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_USED_CHANNELS"})),r.a.createElement(fs,null,d.join(", "))),r.a.createElement(Ps,null,r.a.createElement(ys,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_FREQUENCY_RANGE"})),r.a.createElement(fs,null,b)),!!t&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ds,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_RF_SCAN_DETAILS"})),r.a.createElement(Ps,null,r.a.createElement(ys,null,r.a.createElement(D.b,{id:"DEVICE_HEADER_UTILIZATION"})),r.a.createElement(fs,null,o,"%")),r.a.createElement(Ps,null,r.a.createElement(ys,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_INTERFERENCE"})),r.a.createElement(fs,null,c," ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"}))),E&&E.length&&r.a.createElement(Rs,{data:E,width:l})))});const As=Object(i.c)(cn.a)`
  height: ${({height:e})=>e};
  width: ${({width:e})=>e};
  top: ${({top:e})=>e};
  left: ${({left:e})=>e};
  outline: 1px solid ${({theme:e})=>e.motifPalette.text02};
  border-radius: 3px;
  position: absolute;
  background: ${({theme:e})=>e.motifPalette.hoverUi01};
  z-index: 3;
  overflow: hidden;
`,Ns=Object(i.c)("div")`
  position: absolute;
  bottom: 0;
  width: 100%;
  height: ${({height:e})=>e};
  background-color: ${({background:e})=>e};
`,js=i.a`
  width: 240px !important;
  transform: translateX(18px) !important;
`;var Ls=({spectrumData:e,channels:t,channelWidth:a,rowCount:n,lowerFrequency:l,singleFrqeuencyWidth:i,type:c,className:o=null})=>r.a.createElement(r.a.Fragment,null,t.map((t,E)=>{const s=e&&e.spectrum_table&&(e=>{const t=e.length,a=t&&e.reduce((e,t)=>(e.interference+=t.interference,e.utilization+=t.utilization,e.rssi_histogram&&t.rssi_histogram&&(e.rssi_histogram=e.rssi_histogram.map((e,a)=>e+(t.rssi_histogram&&t.rssi_histogram[a]||0))),e));return a&&a.interference&&(a.interference=Math.round(a.interference/t),a.utilization=Math.round(a.utilization/t),a.rssi_histogram=a.rssi_histogram&&a.rssi_histogram.map(e=>Math.round(e/t))),a})(e.spectrum_table.filter(e=>e.width===parseInt(a,10)&&t.subChannels.includes(e.channel))),m=s&&s.utilization||0,d=s&&s.interference||-96,_=e&&(JE.find(e=>Object(uo.a)(d,e.from,e.to))||{}).color||"transparent",b=t.upperFrequency-t.lowerFrequency,u=21+(QE[c]+es[c])*(E%n),O=(t.lowerFrequency-l)*i;return r.a.createElement(As,{key:`rf-${c}-${a}-channel-${t.subChannels.toString()}`,width:i*b+"%",height:QE[c]+"px",top:u+"px",left:O+"%",className:o,message:r.a.createElement(Ss,{width:a,data:t,spectrumEntry:s,radioType:c}),position:"bottomRight",tooltipClassName:js,portal:!0},r.a.createElement(Ns,{height:m+"%",background:_}))}));var xs=r.a.memo(({spectrumScan:e,countryChannels:t,deviceData:a})=>{const n=e.scans&&e.scans.find(e=>e.radio===rE.a.NG.type),l=[20];Object(ve.isHt40Supported)(t,a,rE.a.NG.type)&&l.push(40);const i=l.reduce((e,n)=>{const l=Object(pl.c)(t,a,rE.a.NG.type,n);return e[n]=Object.entries(ve.WIFI_CHANNELS.ng[n]).reduce((e,[t,a])=>(a.subChannels.some(e=>l.includes(e))&&e.push({...a,channel:+t}),e),[]),e},{}),c=10*Math.floor(Math.min(i[20][0].lowerFrequency,i[40][0].lowerFrequency)/10),o=10*Math.ceil(Math.max(i[20][i[20].length-1].upperFrequency,i[40][i[40].length-1].upperFrequency)/10),E=o-c,s=E/10-1,m=100/(s+1),d=100/E;return r.a.createElement("div",null,Object.keys(i).map(e=>{const t=i[e],a="20"===e?5:10,l=Math.min(a,t.length)*(QE.ng+es.ng)-es.ng+42;return r.a.createElement("div",{key:"channel-width-"+e},r.a.createElement(ls,null,r.a.createElement(T.a,{size:"body",color:"primary",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_MHZ_CHANNELS",values:{frequency:e}}))),r.a.createElement(rs,null,ts.ng.map(i=>r.a.createElement(is,{key:`widths-${i.from}-${i.to}`,width:"100%",height:l+"px"},r.a.createElement(Es,{count:s,offset:m}),r.a.createElement(ds,{count:s,offset:m,start:c,end:o,step:10}),r.a.createElement(Ls,{spectrumData:n,channels:t,channelWidth:e,rowCount:a,lowerFrequency:c,singleFrqeuencyWidth:d,type:rE.a.NG.type})))))}))},(e,t)=>{var a,n,l,r,i,c,o,E;return(null===(l=null===(n=null===(a=e.spectrumScan)||void 0===a?void 0:a.scans)||void 0===n?void 0:n[0])||void 0===l?void 0:l.spectrum_table)===(null===(c=null===(i=null===(r=t.spectrumScan)||void 0===r?void 0:r.scans)||void 0===i?void 0:i[0])||void 0===c?void 0:c.spectrum_table)&&e.countryChannels===t.countryChannels&&(null===(o=e.deviceData)||void 0===o?void 0:o.radio_table)===(null===(E=t.deviceData)||void 0===E?void 0:E.radio_table)}),Ms=a(1651);var Vs=r.a.memo(({spectrumScan:e,countryChannels:t,deviceData:a,intl:n})=>{const l=e.scans&&e.scans.find(e=>e.radio===rE.a.NA.type),i=[20];Object(ve.isHt40Supported)(t,a,rE.a.NA.type)&&i.push(40),Object(ve.isHt80Supported)(t,a)&&i.push(80),Object(ve.isHt160Supported)(t,n,a,"rai0")&&i.push(160);const c=i.reduce((e,n)=>{const l=Object(pl.c)(t,a,rE.a.NA.type,n);return e[n]=Object.entries(ve.WIFI_CHANNELS.na[n]).reduce((e,[t,a])=>(a.subChannels.some(e=>l.includes(e))&&e.push({...a,channel:+t}),e),[]),e},{}),o=Object(Ms.a)(c[20],e=>ts.na.findIndex(t=>Object(uo.a)(e.centerFrequency,t.from,t.to))),E=o[1]&&o[1].length,s=o[2]&&o[2].length,m=100/(Object.keys(o).reduce((e,t)=>{const a=ts.na[t];return e+(a.to-a.from)/20},0)+(E?1:0)+(s?1:0));return r.a.createElement("div",null,Object.keys(c).map(e=>{const t=c[e],a=+e;return r.a.createElement("div",{key:"channel-width-"+e},r.a.createElement(ls,null,r.a.createElement(T.a,{size:"body",color:"primary",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_MHZ_CHANNELS",values:{frequency:a}}))),r.a.createElement(rs,{justifyContent:"space-between"},ts.na.map((a,n)=>{const i=t.filter(({centerFrequency:e})=>Object(uo.a)(e,a.from,a.to)),c=(o[n]&&o[n].length||0)*m,E=100/(a.to-a.from),s=20*E*4,d=Math.floor(((a.to-a.from)/20-1)/4);return i.length?r.a.createElement(is,{key:`widths-${a.from}-${a.to}`,width:c+"%",height:42+QE.na+"px"},r.a.createElement(Es,{count:d,offset:s}),r.a.createElement(ds,{count:d,offset:s,start:a.from,end:a.to,step:80}),r.a.createElement(Ls,{spectrumData:l,channels:i,channelWidth:e,rowCount:1,lowerFrequency:a.from,singleFrqeuencyWidth:E,type:rE.a.NA.type})):r.a.createElement(cs,{key:`widths-${a.from}-${a.to}`,width:c+"%",height:42+QE.na+"px"})})))}))},(e,t)=>{var a,n,l,r,i,c,o,E;return(null===(l=null===(n=null===(a=e.spectrumScan)||void 0===a?void 0:a.scans)||void 0===n?void 0:n[1])||void 0===l?void 0:l.spectrum_table)===(null===(c=null===(i=null===(r=t.spectrumScan)||void 0===r?void 0:r.scans)||void 0===i?void 0:i[1])||void 0===c?void 0:c.spectrum_table)&&e.countryChannels===t.countryChannels&&(null===(o=e.deviceData)||void 0===o?void 0:o.radio_table)===(null===(E=t.deviceData)||void 0===E?void 0:E.radio_table)});const ws=Object(i.c)(Ti.a)`
  width: 100% !important;
  margin-bottom: 16px;
`,Fs=Object(i.c)(y.a)`
  margin-bottom: 32px;
`,Us=Object(i.c)("div")`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  color: ${({theme:e})=>e.motifPalette.text02};
`,zs=Object(i.c)(Be.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  padding: 0 0 0 8px;
`,ks=Object(i.c)(T.a)`
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  display: block;
`,Bs=Object(i.c)("div")`
  width: ${({width:e})=>e}%;
  background-color: ${({background:e})=>e};
  height: 7px;
`,Ws=Object(i.c)("div")`
  position: relative;
  font-size: 10px;
  height: 14px;
`,Gs=Object(i.c)(y.a)`
  margin: 4px 0;
`,Hs=Object(i.c)("div")`
  padding: 4px 0;
  font-size: 10px;
`,Ys=Object(i.c)("div")`
  position: absolute;
  ${({right:e})=>e&&`right: ${e};`}
  ${({left:e})=>e&&`left: ${e};`}
`;var $s=Object(en.compose)(Object(o.connect)((e,{activeItem:{mac:t}})=>({spectrumScan:qE(e,t)}),{fetchCountryChannels:pl.a,fetchSpectrumScan:XE,confirm:ue.a,scanDeviceRFEnvironments:ve.scanDeviceRFEnvironments,hideModal:Oe.e}),Object(zo.b)(({activeItem:{mac:e},fetchSpectrumScan:t,fetchCountryChannels:a})=>Promise.all([t(e),a(void 0,{crudCacheStrategy:{type:me.a.CACHE}})])),D.e)(({activeItem:e,confirm:t,scanDeviceRFEnvironments:a,hideModal:n,spectrumScan:i,intl:c})=>{const E=Object(o.useDispatch)(),s=Object(l.useMemo)(()=>Object(ve.getRadios)(e),[e]),m=Object(l.useMemo)(()=>null==s?void 0:s.find(e=>e.radio===rE.a.NG.type),[s]),d=Object(l.useMemo)(()=>null==s?void 0:s.find(e=>e.radio===rE.a.NA.type),[s]),[_,b]=Object(l.useState)(m?rE.a.NG.type:rE.a.NA.type),u=Object(ZE.a)(null==e?void 0:e.spectrum_scanning),O=Object(o.useSelector)(pl.d);Object(l.useEffect)(()=>{u&&!(null==e?void 0:e.spectrum_scanning)&&E(XE(null==e?void 0:e.mac))},[null==e?void 0:e.mac,null==e?void 0:e.spectrum_scanning,u,E]);const p=Object(l.useCallback)((e,t)=>{b(t)},[b]),I=Object(l.useCallback)(()=>{t({message:"DEVICE_PROPERTIES_RF_ENVIRONMENT_START_SCAN_CONFIRM_MESSAGE",title:"DEVICE_PROPERTIES_RF_ENVIRONMENT_START_SCAN_CONFIRM_TITLE",onConfirm:()=>{a(e),n()}})},[e,t,a,n]),g=Object(l.useMemo)(()=>"wire"===Object(Ol.a)(e,"uplink.type",""),[e]),v=Object(l.useMemo)(()=>{var e;return null===(e=null==i?void 0:i.scans)||void 0===e?void 0:e.find(({radio:e})=>e===_)},[null==i?void 0:i.scans,_]),C=Object(l.useMemo)(()=>[...m?[{label:c.formatMessage({id:"DEVICE_PROPERTIES_RF_2G_RF_ENV"}),value:rE.a.NG.type}]:[],...d?[{label:c.formatMessage({id:"DEVICE_PROPERTIES_RF_5G_RF_ENV"}),value:rE.a.NA.type}]:[]],[m,d,c]),R=Object(l.useMemo)(()=>(null==e?void 0:e.spectrum_scanning)?r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_SCAN_STATUS_IN_PROGRESS"}):(null==v?void 0:v.spectrum_table_time)?r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_SCAN_STATUS_TIME_AGO",values:{time:Object(P.distanceInWordsToNow)(1e3*v.spectrum_table_time)}}):r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_SCAN_STATUS_NEVER_SCANNED"}),[null==e?void 0:e.spectrum_scanning,null==v?void 0:v.spectrum_table_time]);return g&&(null==C?void 0:C.length)?r.a.createElement(r.a.Fragment,null,r.a.createElement(ws,{id:"rf_type",value:_,options:C,onChange:p,variant:"secondary",inputProps:{full:!0}}),r.a.createElement(Fs,{justifyContent:"space-between"},r.a.createElement(Us,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_SCAN_STATUS_LAST_SCAN"})," ",R)),r.a.createElement(zs,{variant:"link",disabled:e.spectrum_scanning,onClick:I},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_ACTION_START_SCAN"}))),_===rE.a.NA.type?r.a.createElement(Vs,{deviceData:e,spectrumScan:i,countryChannels:O,intl:c}):r.a.createElement(xs,{deviceData:e,spectrumScan:i,countryChannels:O}),r.a.createElement(ks,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_RF_LEGEND"})),r.a.createElement(Ws,null,r.a.createElement(Ys,null,"-96"),r.a.createElement(Ys,{left:"30%"},"-80"),r.a.createElement(Ys,{left:"64%"},"-64"),r.a.createElement(Ys,{right:"0"},"-48 ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"}))),r.a.createElement(Gs,{justifyContent:"space-between"},JE.map(({color:e,from:t,to:a})=>r.a.createElement(Bs,{width:7.5,background:e,key:`dbm-${t}-${a}`}))),r.a.createElement(Hs,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_LEGEND_UTILIZATION"})))):r.a.createElement(Fs,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RF_ENVIRONMENT_DISABLED_MESSAGE"})))}),Ks=a(1037);const Xs=Object(i.c)("tr")`
  white-space: nowrap;
  font-size: ${({theme:e})=>e.fontSizes[1]}px;
`,qs=Object(i.c)("td")`
  vertical-align: top;
`,Zs=Object(i.c)("td")`
  padding-left: 12px;
  padding-bottom: 2px;
  text-align: right;
  vertical-align: top;
`;var Js=({device:e,radio:t,channelUtilization:a})=>{const{totalPackets:n,totalBytes:l,droppedPercentage:i,retryPercentage:c}=Object(ve.getApRadioStats)(e,t,"rx"),{totalPackets:o,totalBytes:E,droppedPercentage:s,retryPercentage:m}=Object(ve.getApRadioStats)(e,t,"tx");return r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement(Xs,null,r.a.createElement(qs,null,r.a.createElement(T.a,{color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_PKTS_BYTES"}))),r.a.createElement(Zs,null,r.a.createElement(T.a,{color:"secondary"},o," / ",E))),r.a.createElement(Xs,null,r.a.createElement(qs,null,r.a.createElement(T.a,{color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RX_PKTS_BYTES"}))),r.a.createElement(Zs,null,r.a.createElement(T.a,{color:"secondary"},n," / ",l))),r.a.createElement(Xs,null,r.a.createElement(qs,null,r.a.createElement(T.a,{color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_RETRY_DROPPED"}))),r.a.createElement(Zs,null,r.a.createElement(T.a,{color:"secondary"},m,"% / ",s,"%"))),r.a.createElement(Xs,null,r.a.createElement(qs,null,r.a.createElement(T.a,{color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RX_RETRY_DROPPED"}))),r.a.createElement(Zs,null,r.a.createElement(T.a,{color:"secondary"},c,"% / ",i,"%"))),a&&r.a.createElement(Xs,null,r.a.createElement(qs,null,r.a.createElement(T.a,{color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CHANNEL_UTILIZATION"}))),r.a.createElement(Zs,null,r.a.createElement(T.a,{color:"secondary"},`${a.total}% / ${a.selfRx}% / ${a.selfTx}%`)))))};const Qs=Object(i.c)("div")`
  &:first-child {
    margin-bottom: 24px;
  }
`,em=Object(i.c)("div")`
  flex: 1;
`,tm=Object(i.c)("span")`
  display: inline-block;
  margin: -2px 6px 0;
  width: 8px;
  height: 1px;
  vertical-align: middle;
  background: ${({theme:e})=>e.motifPalette.text02};
`,am=Object(i.c)(T.a)`
  margin-left: 4px;
`,nm=Object(i.c)("div")`
  width: 100%;
  margin-bottom: 16px;
`,lm=(e,t)=>{const{radio:a}=t,n="DEVICE_RADIO_PROTOCOL_"+a.toUpperCase();if(a===eo.b.RADIO_NA){if(Object(ve.isAxRadio)(e,t))return n.concat("_AX");if(Object(ve.isAcRadio)(e,t))return n.concat("_AC")}return n};var rm=e=>((null==e?void 0:e.radio_table)||[]).reduce((t,a)=>{const n=Object(ve.getRadioChannelUtilization)(e,a);if(n){const{selfRx:l,selfTx:i,interference:c,total:o}=n;t.push(r.a.createElement(Qs,{key:a.name},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(em,null,r.a.createElement(to.a,{device:e,radio:a,hideDfsInfo:!0,hideHtInfo:!0,hidePowerInfo:!0,hideChannelTooltip:!0,textColor:"primary",textSize:"body",textWeight:"bold"}),r.a.createElement(tm,null),r.a.createElement(T.a,{color:"primary",weight:"bold",size:"body"},r.a.createElement(D.b,{id:lm(e,a)}))),r.a.createElement(ta.a,{size:"body",color:"secondary",type:"percent",input:Math.min(o,100)/100}),r.a.createElement(am,{color:"secondary"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_UTILIZED"})))),r.a.createElement(nm,null,r.a.createElement(cn.a,{message:r.a.createElement(Js,{device:e,radio:a,channelUtilization:n}),portal:!0},r.a.createElement(Ks.a,{items:[{color:te.l.blue,value:l},{color:te.h,value:i},{color:te.i,value:c}],height:10})))))}return t},[]);const im=Object(i.c)(Ht.a)`
  margin-right: 4px;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 0;
`,cm=e=>i.a`
  background-color: ${e};
`;var om=({ChannelBars:e})=>r.a.createElement(r.a.Fragment,null,e,r.a.createElement(y.a,{justifyContent:"flex-start"},r.a.createElement(y.a,{flex:"0 1 27%"},r.a.createElement(im,{className:cm(te.l.blue)}),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_RX_FRAMES"}))),r.a.createElement(y.a,{flex:"0 1 27%"},r.a.createElement(im,{className:cm(te.h)}),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_TX_FRAMES"}))),r.a.createElement(y.a,{flex:"0 1 27%"},r.a.createElement(im,{className:cm(te.i)}),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_INTERFERENCE"})))));const Em=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`,sm=i.a`
  padding: 0;
  margin: 0;
`;var mm=function({activeItem:e,...t}){const a=rm(e),n=[];return a.length&&n.push({id:"channelUsage",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CHANNEL_USAGE"}),renderContent:()=>r.a.createElement(om,{ChannelBars:a})}),Object(ve.isDeviceConnected)(e)&&Object(Uo.e)(e,ve.WIFI_CAPS.RF_SCAN)&&n.push({id:"rfEvironment",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_RF_ENVIRONMENT"}),renderContent:()=>r.a.createElement($s,{activeItem:e})}),Object(ve.isDeviceConnected)(e)&&n.push({id:"dpi",label:r.a.createElement(D.b,{id:"COMMON_TRAFFIC_ID"}),renderContent:()=>r.a.createElement(Ua,{mac:null==e?void 0:e.mac,contentPaddingX:0})}),r.a.createElement(Em,{variant:"secondary",items:n,contentClassName:sm,multiOpen:!0,renderOnlyExpandedContent:!0})};const dm=Object(i.c)(y.a)`
  button {
    padding: 0;
    position: absolute;
    left: 0;
  }

  span {
    width: 100%;
    padding: 1px 0;
    text-align: center;
  }
`,_m=Object(i.c)(y.a)`
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
`;var bm=({activeItem:{mac:e}})=>{const t=Object(n.k)(),{subPanelId:a,subPanel:l}=Object(n.m)(),i=Object(o.useSelector)(Object(va.b)(a||l)),c=Object(ma.a)((null==i?void 0:i.name)||(null==i?void 0:i.hostname)||(null==i?void 0:i.mac),15);return Object(Ta.g)([Object(Ca.fetchSession)(e,!0)],r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{padding:"15px 30px 0",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},r.a.createElement(dm,{position:"relative",paddingBottom:25,width:"100%"},r.a.createElement(Ra.c,{name:"backButton",onClick:()=>t.push("../../overview")},r.a.createElement(h.f,null)),r.a.createElement(T.a,{size:"body",weight:"bold",color:"primary"},c+" | ",null==i?void 0:i.date)),r.a.createElement(_m,{width:"100%",paddingBottom:10,flexDirection:"column"},r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_START"})),r.a.createElement(T.a,{size:"body"},null==i?void 0:i.start)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_END"})),r.a.createElement(T.a,{size:"body"},null==i?void 0:i.end)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_DURATION"})),r.a.createElement(T.a,{size:"body"},null==i?void 0:i.duration)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},null==i?void 0:i.ip)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"CLIENT_PROPERTY_HISTORY_TAB_MAC_ADDRESS"})),r.a.createElement(T.a,{size:"body"},null==i?void 0:i.mac)),(null==i?void 0:i.is_wired)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_PORT"})),r.a.createElement(T.a,{size:"body"},null==i?void 0:i.port)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:(null==i?void 0:i.is_wired)?"CLIENT_PROPERTY_HISTORY_TAB_CLIENT_EXPERIENCE":"COMMON_WIFI_EXP"})),r.a.createElement(T.a,null,(null==i?void 0:i.experience)>=0?r.a.createElement(T.a,{size:"body"},r.a.createElement("span",{style:{color:Ia.a["color-"+((null==i?void 0:i.is_wired)?Object(wt.b)(null==i?void 0:i.experience):Object(wt.c)(null==i?void 0:i.experience))]}},null==i?void 0:i.experience,"%")):r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"})))))),!!(null==i?void 0:i.mac)&&r.a.createElement(Ua,{mac:null==i?void 0:i.mac,key:null==i?void 0:i.mac})))};var um={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:Vo,subpanel:{path:"/:subPanel/:subPanelId",component:bm}},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:mm},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:KE}}};const Om=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
  .styledAccordionContent {
    padding: 0;
    margin: 0;
  }
`;var pm=function({activeItem:e,...t}){const a=rm(e),n=[];return a.length&&n.push({id:"channelUsage",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CHANNEL_USAGE"}),renderContent:()=>r.a.createElement(om,{ChannelBars:a})}),Object(ve.isDeviceConnected)(e)&&Object(Uo.e)(e,ve.WIFI_CAPS.RF_SCAN)&&n.push({id:"rfEvironment",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_RF_ENVIRONMENT"}),renderContent:()=>r.a.createElement($s,{activeItem:e})}),r.a.createElement(Om,{variant:"secondary",items:n,contentClassName:"styledAccordionContent",multiOpen:!0,renderOnlyExpandedContent:!0})},Im=a(553),gm=a(1017),vm=a(2628);function Cm({activeItem:e,hideDiagramKeys:t,...a}){const[n]=Object(l.useState)("DevicePorts-"+Date.now()),i=Object(o.useDispatch)();return Object(l.useEffect)(()=>{const e={style:gm.a.overflow,styleName:"overflow",dependant:n};return i(Object(Im.c)(e)),()=>{i(Object(Im.b)(e))}},[]),r.a.createElement(vm.a,Object.assign({deviceData:e},a))}var Rm=a(500),Tm=a(2623),hm=a(2792),Dm=a(1041),Pm=a(908);const ym=Object(i.c)(y.a)`
  font-size: ${({theme:e})=>e.fontSizes[0]}px;
`,fm=({spacing:e})=>i.a`
  &:not(:first-child) {
    margin-top: ${e};
  }
`;var Sm=({deviceData:e,portSizeOverride:t,...a})=>{const{diagram:n}=Object(u.G)(e),l=n.length?Object(u.c)(n,e):Object(u.f)(e);if(!l||0===l.length)return r.a.createElement(ym,null,r.a.createElement(h.cb,{isActive:!0,className:"mr-2"}),r.a.createElement(D.b,{id:"DEVICE_DIAGRAM_MISSING"}));const i=Object(hm.a)(l.map(e=>e.length)),c=Object.values(Pm.a).find(e=>i<=e.threshold);return r.a.createElement(r.a.Fragment,null,l.map((n,l)=>r.a.createElement(y.a,{"align-items":"flex-end",key:"PortLayoutRow-"+(l+1),className:fm(c),flex:"1 1 "+(t||c.size)},n.map((n,i)=>{const o=`Port-${l+1}-${i+1}`,E=n&&(null==e?void 0:e.port_table)&&Object(u.u)(n.portNumber,e);return r.a.createElement(Dm.a,Object.assign({cellData:E,deviceData:e,key:o,keyValue:o,portSize:c,portSizeOverride:t},a))}))))};const Am=Object(i.c)("div")`
  position: relative;
  padding: 24px 32px;
  display: flex;
  flex: none;
  flex-direction: column;
`,Nm=Object(i.c)("div")`
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
`,jm=Object(i.c)(y.a)`
  padding: 0 30px;
`,Lm=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
`,xm=Object(i.c)("div")`
  padding: 32px 32px 16px 32px;
`,Mm=Object(i.c)(y.a)`
  &:not(:last-child) {
    padding: 8px 0;
  }
`,Vm=Object(i.c)(h.r)`
  color: ${({theme:e})=>e.motifPalette.success};
  margin-right: 9px;
  width: 17px;
  height: 17px;
`,wm=Object(i.c)(h.a)`
  color: ${({theme:e})=>e.motifPalette.warning};
  margin-right: 9px;
  width: 18px;
  height: 18px;
`,Fm=Object(i.c)(oe.a)`
  margin-left: 2px;
`;function Um({deviceData:e,hideAnomalies:t,showFullScreenDiagramButton:a,...i}){const c=Object(n.k)(),{portAnomalies:o,totalAnomalies:E}=Object(Rm.b)(e.port_table,ve.switchAnomaliesMap),s=1===E,m=Object(l.useCallback)(e=>c.push("ports/"+e.toString()),[c]),d=Object(Ta.a)("/devices/:mac/ports");return r.a.createElement(r.a.Fragment,null,r.a.createElement(Am,null,r.a.createElement(Nm,null,r.a.createElement(Sm,Object.assign({deviceData:e},i))),r.a.createElement(Tm.a,{deviceData:e})),!t&&!!E&&r.a.createElement(xm,null,s?r.a.createElement(r.a.Fragment,null,r.a.createElement(Mm,{alignItems:"center"},r.a.createElement(wm,null),r.a.createElement(T.a,null,r.a.createElement(D.b,{id:o[0].anomalies[0]+"_PROBLEM"}),r.a.createElement(Fm,{variant:"inline",onClick:()=>m(o[0].portNumber)},r.a.createElement(D.b,{id:"COMMON_PORT_NUMBER",values:{portNumber:o[0].portNumber}})))),r.a.createElement(Mm,{alignItems:"center"},r.a.createElement(Vm,null),r.a.createElement(T.a,null,r.a.createElement(D.b,{id:o[0].anomalies[0]+"_SOLUTION"})))):r.a.createElement(Mm,{alignItems:"center"},r.a.createElement(wm,null),r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_MULTIPLE_ANOMALIES",values:{count:E}}),o.map((e,t)=>r.a.createElement(r.a.Fragment,null,r.a.createElement(Fm,{variant:"inline",onClick:()=>m(e.portNumber)},r.a.createElement(D.b,{id:"COMMON_PORT_NUMBER",values:{portNumber:e.portNumber}})),t===o.length-1?".":","))))),a&&r.a.createElement(jm,null,r.a.createElement(Lm,{size:"small",type:"button",variant:"link",onClick:()=>c.push(d.replace(":mac",e.mac))},r.a.createElement(h.eb,{variant:"twoTone",isActive:!0,height:20,width:20}),r.a.createElement(D.b,{id:"DEVICE_PORT_BUTTON_PORTS_INSIGHTS"}))))}var zm=Object(en.compose)(Qa(["general","screen","network","services"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:i,isInvalid:c})=>{var E,s,m,d;const _=Object(o.useSelector)(Tr),b=Object(o.useSelector)(hr),u=Object(o.useSelector)(Dr),O=Object(o.useSelector)(_i.selectGlobalApSettings),p=Object(o.useSelector)(_i.selectRadioAiSettings),I=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),g=Object(o.useSelector)(_i.selectConnectivityMonitorEnabled),{_id:v,mac:C}=e,[R,T]=Object(l.useState)(!(null===(E=O.ap_exclusions)||void 0===E?void 0:E.includes(C))),[h,P]=Object(l.useState)(p.enabled&&!(null===(s=p.exclude_devices)||void 0===s?void 0:s.includes(C))),f=Object(o.useDispatch)(),S=Object(n.k)(),{state:A}=Object(n.l)(),N=null==A?void 0:A.accordion;N&&S.replace({pathname:S.location.pathname,state:Object.assign(S.location.state,{accordion:void 0})});const j=i||R!==!(null===(m=O.ap_exclusions)||void 0===m?void 0:m.includes(e.mac))||h!==(p.enabled&&!(null===(d=p.exclude_devices)||void 0===d?void 0:d.includes(e.mac))),L=Object(l.useCallback)(async()=>{var e,t;try{const a=[];if(R!==!(null===(e=O.ap_exclusions)||void 0===e?void 0:e.includes(C))){const e=O.ap_exclusions.filter(e=>e!==C);R||e.push(C),a.push({...O,ap_exclusions:e})}if(p.enabled&&h!==!(null===(t=p.exclude_devices)||void 0===t?void 0:t.includes(C))){const e=p.exclude_devices.filter(e=>e!==C);h||e.push(C),a.push({...p,exclude_devices:e,settings_preference:"auto"})}a.length&&await f(Object(wo.k)(a))}catch(n){return void f(Object(je.a)({icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}const a=Object.entries(_).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});f(Object(ve.updateDeviceWithIdEndpoint)(a,v,C,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(({data:e=[a]})=>{Object.values(b).forEach(t=>{"function"==typeof t&&t(e[0])})})},[v,f,_,O,R,h,C,b,p]),x=Object(l.useCallback)(()=>{Object.values(u).forEach(e=>{"function"==typeof e&&e()})},[u]);return r.a.createElement(r.a.Fragment,null,I&&r.a.createElement(Um,{deviceData:e}),r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%",padding:(I?"0":"20px")+" 32px 0"},r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a}),r.a.createElement($E,{isGlobalApSettingsEnabled:R,setGlobalApSettingsEnabled:T,isChannelOptimizationEnabled:h,setChannelOptimizationEnabled:P,disableChannelOptimization:!p.enabled}),r.a.createElement(ga.a,{variant:"secondary",items:[{id:"radios",label:r.a.createElement(D.b,{id:"COMMON_RADIOS"}),openByDefault:!N||"radios"===N,renderContent:()=>r.a.createElement(zE,{activeItem:e,setFormDirty:t,setFormInvalid:a,isWirelessMeshingEnabled:g,isGlobalApSettingsEnabled:R,isChannelOptimizationEnabled:h})},{id:"ports",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_PORTS"}),openByDefault:!1,renderContent:()=>r.a.createElement(Cm,{activeItem:e})},{id:"screen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(lE,{activeItem:e,setFormDirty:t})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),openByDefault:"network"===N,renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a,hideFlowControl:!0})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:j,isInvalid:c,onFormSubmit:L,onFormCancel:x}))});const km=Object(i.c)("div")`
  height: 100%;
`,Bm=Object(i.c)("div")`
  margin: ${({theme:e})=>e.spacing["spacing-xl"]} 0;
`,Wm=[{id:"bssid",sortable:!0,minWidth:45,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_HEADER_BSSID"})),renderCell:e=>r.a.createElement(T.a,{size:"body",truncate:!0,color:"inherit"},e.bssid)},{id:"essid",sortable:!0,minWidth:30,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_HEADER_ESSID"})),renderCell:e=>r.a.createElement(T.a,{size:"body",truncate:!0,color:"inherit"},e.essid)},{id:"channel",sortable:!0,minWidth:20,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),renderCell:e=>r.a.createElement(T.a,{size:"body",color:"inherit"},e.channel)},{id:"channelWidth",sortable:!0,minWidth:20,renderLabel:()=>r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_HEADER_WIDTH"})),renderCell:e=>r.a.createElement(T.a,{size:"body",color:"inherit"},e.bw)}];function Gm({activeItem:{vap_table:e}}){return r.a.createElement(km,null,r.a.createElement(ya.a,{items:e||[],disableColumnFilters:!0,disableTextPointer:!0,disableSelection:!0,columns:Wm,renderFooter:()=>e&&e.length?r.a.createElement(Bm,null,r.a.createElement(D.b,{id:"COMMON_TABLE_FOOTER",values:{length:e.length}})):r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_RADIOS_TABLE_NO_WLAN"}),rowHeight:30,idField:"name"}))}const Hm=Object(dn.a)(En.selectAPGroupsData,Wc.selectWifiNetworksData,g.c,(e,t,a)=>e.filter(e=>e.device_macs.includes(a)).map(e=>{const a=[];return((t||[]).filter(t=>{var a;return null===(a=null==t?void 0:t.ap_group_ids)||void 0===a?void 0:a.includes(e._id)})||[]).forEach(t=>{((null==t?void 0:t.wlan_bands)||[]).forEach(n=>{a.push({...t,id:`${t._id}-${e._id}-${n}`,wlan_band:n})}),a.length||a.push({...t,id:t._id+e._id})}),{...e,id:e._id,children:a}})),Ym=Object(i.c)(h.Uc)`
  margin-right: 7px;
  margin-bottom: 2px;
`,$m=[{id:"name",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_GROUP_TABLE_HEADER_NAME"})),renderCell:({name:e,attr_no_delete:t,children:a,wlan_band:n})=>a?r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},t?r.a.createElement(r.a.Fragment,null,e," (",r.a.createElement(D.b,{id:"COMMON_WORD_DEFAULT"}),")"):e):r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body"},n===Wc.WlanBand.NG&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ym,{isActive:!0}),e," (",r.a.createElement(D.b,{id:"COMMON_RADIO_BAND_NG"}),")"),n===Wc.WlanBand.NA&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ym,{isActive:!0}),e," (",r.a.createElement(D.b,{id:"COMMON_RADIO_BAND_NA"}),")"),n===Wc.WlanBand.AX&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Ym,{isActive:!0}),e," (",r.a.createElement(D.b,{id:"COMMON_RADIO_BAND_6E"}),")"))}];var Km=()=>{const e=Object(o.useSelector)(Hm);return Object(Ta.g)([Object(En.fetchAPGroups)(void 0,{crudCacheStrategy:{type:me.a.CACHE}})],r.a.createElement(ya.a,{items:e,columns:$m,disableColumnFilters:!0,disableSelection:!0,disableTextPointer:!0}))};var Xm=a(1107),qm=a(2620);const Zm=Object(i.c)(y.a)`
  th {
    padding-right: 0;

    &:first-child {
      color: ${({theme:e})=>e.motifPalette.text01};
    }
  }
  tr:hover {
    cursor: pointer;
  }
`,Jm=[{id:"name",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK_DEVICE"})),renderCell:e=>r.a.createElement(y.a,{alignItems:"center",justifyContent:"center"},r.a.createElement(y.a,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px"},r.a.createElement(f.c,{device:e.deviceData})),r.a.createElement(T.a,{truncate:!0,color:"inherit",size:"body",style:{width:"120px",paddingLeft:"6px",paddingRight:"6px"}},e.name===e.mac&&e.model?e.model:e.name)),minWidth:100},{id:"port_idx",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK_PORT"})),minWidth:40,renderCell:e=>r.a.createElement(T.a,{color:"inherit",size:"body"},e.port_idx)},{id:"network",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_NETWORK"})),renderCell:e=>r.a.createElement(T.a,{color:"inherit",size:"body"},(()=>{var t,a,n,l,i;switch(null===(a=null===(t=e.deviceData)||void 0===t?void 0:t.uplink)||void 0===a?void 0:a.type){case"wire":return(null===(n=e.deviceData)||void 0===n?void 0:n.connection_network_name)||r.a.createElement(D.b,{id:"COMMON_HYPHEN"});case"wireless":return(null===(i=null===(l=e.deviceData)||void 0===l?void 0:l.uplink)||void 0===i?void 0:i.essid)||r.a.createElement(D.b,{id:"COMMON_HYPHEN"});default:return r.a.createElement(D.b,{id:"COMMON_HYPHEN"})}})()),minWidth:70},{id:"experinence",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_EXP"})),minWidth:60,renderCell:e=>r.a.createElement(Xm.a,{device:e.deviceData,downlink:!0})}];var Qm=({activeItem:{downlink_table:e},params:{site:t,page:a,subPage:i},path:c,history:E})=>{const s=Object(o.useSelector)(qm.c),m=Object(o.useDispatch)(),d=Object(l.useMemo)(()=>{return t=s,(e||[]).map(e=>{const a=t.find(t=>t.mac===(e.mac||e.ap_mac));return a?{...e,id:a._id,name:Object(x.c)(a),deviceData:a,model:Object(x.e)(a.model)}:null}).filter(Boolean);var t},[e,s]);return r.a.createElement(Zm,null,r.a.createElement(ya.a,{items:d,disableColumnFilters:!0,initialSortBy:"port_idx",columns:Jm,renderFooter:()=>r.a.createElement("div",null,(null==d?void 0:d.length)>0?r.a.createElement(D.b,{id:"COMMON_TABLE_FOOTER",values:{length:e.length}}):r.a.createElement(D.b,{id:"COMMON_DEVICES_NOT_FOUND"})),rowHeight:30,onRowClick:({mac:e})=>{E.push(Object(n.i)(c,{id:e,site:t,page:a,panel:jt.a.OVERVIEW,subPage:i})),m(Object(v.g)({type:b.c.DEVICE,mac:e}))}}))};const ed=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var td=function({activeItem:e,...t}){var a,n;const i=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),c=[...null!==(a=null==e?void 0:e.radio_table)&&void 0!==a?a:[]].sort(ve.sortRadios).reverse();return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),i&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Cc,{activeItem:e}),r.a.createElement(ed,{variant:"secondary",items:[{id:"clients",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS_AND_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({activeItem:e},t))},{id:"history",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_HISTORY"}),renderContent:()=>r.a.createElement(vc,Object.assign({activeItem:e},t))},{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),renderContent:()=>r.a.createElement(Qc,{activeItem:e})},...(null===(n=null==e?void 0:e.uplink)||void 0===n?void 0:n.mac)?[{id:"uplink",label:"wire"===e.uplink.type?r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK_WIRED"}):r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK_WIRELESS"}),renderContent:()=>r.a.createElement(xo,Object.assign({activeItem:e},t))}]:[],...(null==c?void 0:c.length)?[{id:"airStats",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_AIR_STATS"}),renderContent:()=>((null==e?void 0:e.radio_table)||[]).map(({radio:t})=>r.a.createElement(bo,{activeItem:e,radio:t,key:t}))}]:[],{id:"downlinks",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_DOWNLINKS"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))},{id:"apGroups",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_AP_GROUP"}),renderContent:()=>r.a.createElement(Km,null)},{id:"wlan",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_WLAN"}),renderContent:()=>r.a.createElement(Gm,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})))},ad=a(2768),nd=a(131),ld=a(90),rd=a(496),id=a(1599),cd=a(391),od=a(425),Ed=a.n(od),sd=a(307),md=a(100),dd=a(2624);const _d=Object(i.c)(y.a)`
  width: 100%;
`,bd=(e,t,a,n)=>Array.from(e,(e,l)=>({id:"port_security_mac_address-"+l,port_security_mac_address:e,port_security_mac_address_name:Object(dd.a)(t,a,e,n)})),ud=[{id:"port_security_mac_address",label:r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_MAC_ADDRESS_LABEL"}),sortable:!1},{id:"port_security_mac_address_name",label:r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_NAME_LABEL"}),sortable:!1}],Od={port_security_mac_addresses:"DEVICE_PORT_FORM_TOPOLOGY_LABEL"};var pd=Object(D.e)(({formValues:e,intl:t,setFieldValue:a})=>{const{port_security_mac_address:n}=e,i=Object(o.useSelector)(ve.selectDevicesData),c=Object(o.useSelector)(Lt.selectCombinedClientsData),E=Object(l.useMemo)(()=>({editActive:!1,port_security_mac_address:bd(n,i,c,t)}),[n,i,c,t]),s=Object(l.useMemo)(()=>bd(n,i,c,t),[n,i,c,t]),m=Object(l.useMemo)(()=>[{name:"new_port_security_mac_address",label:"COMMON_LABEL_MAC_ID",placeholder:"",type:"text"}],[]),d=Object(l.useCallback)(e=>{a("port_security_mac_address",e)},[a]),_=Object(l.useCallback)(({port_security_mac_address:e,new_port_security_mac_address:t})=>{t&&d([...e.map(({port_security_mac_address:e})=>e),t])},[d]),b=Object(l.useCallback)(({port_security_mac_address:t})=>{d(e.port_security_mac_address.filter(e=>e!==t))},[e,d]),u=Object(l.useCallback)(e=>{d([...e.map(({port_security_mac_address:e})=>e)])},[d]);return r.a.createElement(_d,{flexWrap:"wrap"},r.a.createElement(md.c,{fieldName:"port_security_mac_address",items:s,columns:ud,fieldLabels:Od,newFields:m,onAddItem:_,onRemoveItem:b,onEditSubmit:u,initialValues:E,useValuesInSchema:!0,validationSchema:e=>(e=>{const t=()=>Fe.a.string().label("DEVICE_PORT_FORM_MAC_ADDRESS_LABEL").matches(rn.s,{message:r.a.createElement(D.b,{id:"COMMON_VALIDATION_VALID_MAC"})}),a={arrayFieldName:"port_security_mac_address",stringFieldName:"port_security_mac_address",errorMessage:r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_MAC_MUST_BE_UNIQUE"})};return Fe.a.object().shape({editActive:Fe.a.bool(),new_port_security_mac_address:t().isMacUnique({formValues:null,...a}),port_security_mac_address:Fe.a.array().of(Fe.a.object().shape({port_security_mac_address:t().isMacUnique({formValues:e,...a}).required()}))})})(e),addButtonText:"COMMON_ACTION_ADD",fieldVariant:"secondary"}))}),Id=a(2688),gd=a(2807),vd=a(2625),Cd=a(616);const Rd=Object(i.c)(y.a)`
  margin-bottom: ${({marginBottom:e})=>e||16}px;
  justify-content: space-between;
  :last-child {
    margin-bottom: 0;
  }
`,Td=Object(i.c)(T.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  display: flex;
  flex: 1;
  margin-right: 12px;
`,hd=Object(i.c)(h.cb)`
  margin: 0 6px;
`,Dd=i.a`
  margin-left: 11px;
`,Pd=Object(i.c)("div")`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
`,yd=Object(i.c)("div")`
  > div:not(:last-child) {
    margin-bottom: ${({theme:e})=>e.spacing["spacing-xxl"]};
  }
`,fd=Object(i.c)(y.a)`
  width: 100%;
`,Sd=Object(i.c)(He.Field)`
  width: unset !important;
  margin-right: ${({theme:e})=>e.spacing["spacing-m"]};
  input {
    width: 100%;
  }
`,Ad=Object(i.c)(He.Field)`
  width: 20% !important;
  > div > div {
    width: 100% !important;
  }
`,Nd=Object(i.c)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,jd=Object(i.c)(T.a)`
  margin-bottom: 5px;
`,Ld=Object(i.c)("div")`
  padding-bottom: 10px;
  border-bottom: 1px solid ${Ia.a["white-6"]};

  span {
    margin-left: 5px;
  }
`,xd=Object(i.c)(y.a)`
  > * {
    width: 100%;
  }
`;var Md=Object(D.e)((function({activeItem:e,portData:t,formValues:a,setFieldValue:n,setFieldTouched:i,initialValues:c,intl:E}){var s,m,d;const{port_table:_=[]}=e,{lldpmed_enabled:b,stormctrl_enabled:u,op_mode:O,egress_rate_limit_kbps_enabled:p,speed:I}=a,{op_mode:g,port_idx:v,port_poe:C}=t,R=a.poe_mode,P=e.dot1x_portctrl_enabled,f=1===v,S=Object(ve.hasSwitch)(e)||(Object(ve.isInWallHd)(e)||Object(ve.isUaiw6)(e)||Object(ve.isU6EIW)(e))&&(f||P),A=Object(ve.isInWallHd)(e),N=Object(ve.getIsInWallAp)(e),j=Object(ve.isUdm)(e),L=Object(ve.isUdr)(e),x=Object(ve.isSwitch)(e),M=Object(Uo.u)(e),V=Object(Uo.t)(e),w=Object(Uo.s)(e),F=Object(Uo.x)(e),U=Object(ve.getPortPoeAvailability)(t),z=U.isPoePassthroughSupported&&!U.isPoeOffSupported,k="switch"===g&&(C||Object(ve.isUaiw6)(e)||Object(ve.isU6EIW)(e))&&S,B=Object(o.useDispatch)(),W=Object(l.useMemo)(()=>{var e;try{return null===(e=JSON.parse(I))||void 0===e?void 0:e.speed}catch(t){return null}},[I]),G=Object(l.useMemo)(()=>Object(Kr.getSupportedSpeeds)(t).map(({autoneg:e,speed:t=0,full_duplex:a=!1})=>{const{value:n,unit:l}=Object(aa.d)(1e6*t/8,"bitrate"),r=`${Object(Id.a)(n,1)}${l}`;return{full_duplex:a,label:e?"COMMON_DEVICE_AUTONEG_FULL":`COMMON_DEVICE_DUPLEX_${a?"FULL":"HALF"}_STRING`,value:JSON.stringify({speed:t,full_duplex:a}),values:!e&&{speed:r}}}),[t]),H=Object(l.useMemo)(()=>{if(e){const t="mirror"===g;let a=Object(Ol.a)(e,"switch_caps.max_mirror_sessions",void 0);if(a||0===a||(a=1),t||e.port_table.filter(e=>"mirror"===e.op_mode).length<a)return!0}return!1},[e,g]),{isAggregateAllowed:Y,hasMaxAggregateSessionsReached:$,aggregatePortOptions:K}=Object(l.useMemo)(()=>{var a;const n=Object(ve.getPortNumbers)(e),l=Object.keys(n).reduce((e,t)=>n[t].length+e,0)||0,{port_idx:r}=t;let i=null===(a=null==e?void 0:e.switch_caps)||void 0===a?void 0:a.max_aggregate_sessions;i||0===i||(i=4);const c=null==e?void 0:e.port_table.filter(e=>e.aggregate_num_ports>1).length,o=Object(Cd.d)(_,t,vd.a.MAX),E=Object(Cd.b)(r,o),s=E[0],m=E[E.length-1]||s;return{isAggregateAllowed:s<=m&&m<=l,hasMaxAggregateSessionsReached:c>=i,aggregatePortOptions:E.map(e=>({label:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_HYPHEN",value:e,values:{port:e}}))}},[e,t,_]),X=Object(l.useMemo)(()=>{const{isPoeOffSupported:e,isPoePassthroughSupported:t,isPoePassive24Supported:a,isPoeAutoSupported:n,isPoePlusPlusSupported:l,isPoePlusSupported:r}=U,i=[];if(e&&i.push({label:E.formatMessage({id:"COMMON_DEVICE_POE_MODE_OFF"}),value:ld.d.OFF}),t&&i.push({label:E.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSTHROUGH"}),value:ld.d.PASSTHROUGH}),!t&&a&&i.push({label:E.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}),value:ld.d.PASSIVE_24V}),!t&&n){const e=[];l?e.push(E.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"})):r?e.push(E.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE_PLUS"})):e.push(E.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE"})),e.push(E.formatMessage({id:"DEVICE_PORT_FORM_AUTO_DETECT"})),i.push({label:E.formatMessage({id:"COMMON_DEVICE_POE_MODE_AUTO"}),value:ld.d.AUTO})}return i},[E,U]);return r.a.createElement(r.a.Fragment,null,k&&r.a.createElement(Pd,{marginBottom:24},z?r.a.createElement(xd,{alignItems:"center",flexDirection:"column"},r.a.createElement(jd,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_POE_MODE_LABEL"})),r.a.createElement(Ld,null,r.a.createElement(h.cb,{isActive:!0})," ",r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_NOTICE_POE_PASSTHROUGH_ONLY"}))):r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_POE_MODE_LABEL",name:"poe_mode",type:"dropdown",full:!0,translateLabel:!0,options:X,afterChange:e=>{e!==ld.d.PASSIVE_24V&&e!==ld.d.PASSTHROUGH||B(Object(ue.a)({message:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_MESSAGE",messageValues:{ports:r.a.createElement("strong",null,v),portsCount:1,poe_mode:r.a.createElement("strong",null,e===ld.d.PASSIVE_24V?E.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}):e)},title:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{n("poe_mode",e),B(Object(Oe.e)())},onCancel:()=>{n("poe_mode",R),B(Object(Oe.e)())},size:"medium"}))}})),!j&&!N&&r.a.createElement(Pd,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_OPERATIONS_LABEL",name:"op_mode",type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:[{label:"DEVICE_PORT_FORM_SWITCHING_LABEL",value:"switch"},...H?[{label:"DEVICE_PORT_FORM_MIRRORING_LABEL",value:"mirror"}]:[],...Y?[{label:"DEVICE_PORT_FORM_AGGREGATE_LABEL",value:"aggregate"}]:[]]})),"mirror"===O&&r.a.createElement(Pd,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_MIRRORING_PORT",full:!0,type:"number",name:"mirror_port_idx"})),"aggregate"===O&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Rd,{marginBottom:24,alignItems:"baseline"},r.a.createElement(Nd,null,r.a.createElement(He.Field,{full:!0,name:"port_idx",label:"DEVICE_PORT_FORM_AGGREGATE_PORTS_LABEL",value:E.formatMessage({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_HYPHEN"},{port:v}),disabled:!0})),r.a.createElement("div",null,"-"),r.a.createElement(Nd,null,r.a.createElement(He.Field,{full:!0,name:"aggregatePortStop",type:"dropdown",options:K,translateOptions:!0,validated:!0,disabled:$}))),!$&&r.a.createElement(Rd,{marginBottom:24,alignItems:"center"},r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.a,{id:(null===(s=e.downlink_table)||void 0===s?void 0:s.length)?"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_UPLINK":"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_DOWNLINK"})))),$&&r.a.createElement(Rd,{marginBottom:24,alignItems:"center"},r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.a,{id:"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_MAX_SESSION_WARNING"}))))),e.dot1x_portctrl_enabled&&["mirror","aggregate"].includes(O)&&r.a.createElement(Pd,{marginBottom:24}),!N&&t.media&&r.a.createElement(Pd,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_LINK_SPEED_LABEL",name:"speed",type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:G})),x&&W===ld.c.PORTSPEED_FULL_25G.speed&&r.a.createElement(Pd,{marginBottom:24},r.a.createElement(gd.a,{text:E.formatMessage({id:"DEVICE_PORT_FORM_LINK_SPEED_SFP28_ALERT"})})),M&&"aggregate"!==O&&!A&&r.a.createElement(Rd,null,r.a.createElement(Td,null,r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_PORT_ISOLATION_LABEL"}),r.a.createElement(cn.a,{portal:!0,tooltipClassName:Dd,position:"topRight",width:230,message:r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_PORT_ISOLATION_NOTIFICATION"})},r.a.createElement(hd,{isActive:!0}))),r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_PORT_ISOLATION_LABEL",name:"isolation",type:"checkbox"})),"switch"===O&&!N&&!j&&!L&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Rd,{marginBottom:16},r.a.createElement(Td,null,r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_STORM_CONTROL_LABEL"})),r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_STORM_CONTROL_LABEL",name:"stormctrl_enabled",afterChange:e=>{n("stormctrl_enabled",e),e||["stormctrl_ucast_rate","stormctrl_mcast_rate","stormctrl_bcast_rate"].forEach(e=>{n(e,c[e]),i(e,!1)})},type:"checkbox"})),u&&r.a.createElement(yd,null,r.a.createElement(Pd,{marginBottom:10},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_UNKNOWN_UNICAST",placeholder:"COMMON_ENTER_PACKETS_PER_SECOND",full:!0,variant:"secondary",type:"number",min:ld.e.MIN,max:ld.e.MAX,name:"stormctrl_ucast_rate"})),r.a.createElement(Pd,{marginBottom:10},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_UNKNOWN_MULTICAST",placeholder:"COMMON_ENTER_PACKETS_PER_SECOND",full:!0,type:"number",variant:"secondary",name:"stormctrl_mcast_rate",min:ld.e.MIN,max:ld.e.MAX})),r.a.createElement(Pd,{marginBottom:20},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_UNKNOWN_BROADCAST",placeholder:"COMMON_ENTER_PACKETS_PER_SECOND",full:!0,type:"number",variant:"secondary",name:"stormctrl_bcast_rate",min:ld.e.MIN,max:ld.e.MAX})))),V&&"switch"===O&&!A&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Rd,null,r.a.createElement(Td,null,r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_LLDP_MED_LABEL"})),r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_LLDP_MED_LABEL",name:"lldpmed_enabled",afterChange:e=>{n("lldpmed_enabled",e),e||n("lldpmed_notify_enabled",c.lldpmed_notify_enabled)},type:"checkbox"})),b&&r.a.createElement(Rd,null,r.a.createElement(Td,null,r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_TOPOLOGY_LABEL"})),r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_TOPOLOGY_LABEL",name:"lldpmed_notify_enabled",type:"checkbox"}))),F&&"switch"===O&&!A&&r.a.createElement(Rd,null,r.a.createElement(Td,null,r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_STP_LABEL"}),r.a.createElement(cn.a,{portal:!0,tooltipClassName:Dd,position:"topRight",width:230,message:r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_STP_TOOLTIP"})},r.a.createElement(hd,{isActive:!0}))),r.a.createElement(He.Field,{name:"stp_port_mode",type:"checkbox"})),w&&"switch"===O&&!A&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Rd,null,r.a.createElement(Td,null,r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_EGRESS_LABEL"})),r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_EGRESS_LABEL",name:"egress_rate_limit_kbps_enabled",afterChange:e=>{n("egress_rate_limit_kbps_enabled",e),e||(n("egress_rate_limit_kbps",c.egress_rate_limit_kbps),i("egress_rate_limit_kbps",!1))},type:"checkbox"})),p&&r.a.createElement(y.a,{flexDirection:"row",alignItems:"flex-end"},r.a.createElement(fd,{flexDirection:"column"},r.a.createElement(Sd,{full:!0,label:"DEVICE_PORT_FORM_RATE_LIMIT_LABEL",type:"number",variant:"secondary",min:null===(m=ld.b[a.egress_rate_limit_unit])||void 0===m?void 0:m.MIN,max:null===(d=ld.b[a.egress_rate_limit_unit])||void 0===d?void 0:d.MAX,name:"egress_rate_limit_kbps"})),r.a.createElement(Ad,{type:"dropdown",variant:"secondary",options:rd.a.slice(0,2),name:"egress_rate_limit_unit",translateOptions:!0}))))}));const Vd=Object(i.c)("div")`
  padding: 0 0 48px 0;

  li {
    &[aria-expanded='true'] {
      border-bottom: none;
    }
    > div {
      margin-bottom: 0;
    }
  }
`,wd=Object(i.c)("div")`
  &:not(:first-child) {
    border-top: 1px solid ${({theme:e})=>e.motifPalette.ui04};
    padding-top 8px;
    margin-top: 16px;
  }
`,Fd=Object(i.c)(y.a)`
  &:not(:last-child) {
    padding: 8px 0;
  }
`,Ud=Object(i.c)(h.r)`
  color: ${({theme:e})=>e.motifPalette.success};
  margin-right: 9px;
  width: 17px;
  height: 17px;
`,zd=Object(i.c)(h.c)`
  color: ${({theme:e})=>e.motifPalette.warning};
  margin-right: 9px;
  width: 18px;
  height: 18px;
`,kd=({anomalies:e})=>e.map(e=>r.a.createElement(wd,{key:e},r.a.createElement(Fd,{alignItems:"center"},r.a.createElement(zd,null),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:e+"_PROBLEM"}))),r.a.createElement(Fd,{alignItems:"center"},r.a.createElement(Ud,null),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:e+"_SOLUTION"})))));function Bd({port:e}){const t=Object(Rm.a)(e,ve.switchAnomaliesMap),a=t.length;return a?r.a.createElement(Vd,null,a>1?r.a.createElement(ga.a,{variant:"tertiary",items:[{id:"anomalies",openByDefault:!0,label:r.a.createElement(T.a,{size:"body",color:"primary",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_ERRORS",values:{errorCount:a}})),renderContent:()=>r.a.createElement(kd,{anomalies:t})}]}):r.a.createElement(kd,{anomalies:t})):null}const Wd=Object(i.c)(y.a)`
  position: relative;
  margin: -18px -30px 25px;
  padding-bottom: 12px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};

  svg {
    position: absolute;
    left: 24px;
  }
`,Gd=Object(i.c)(T.a)`
  width: 100%;
  text-align: center;
  text-transform: uppercase;
`,Hd=Object(i.c)(ga.a)`
  > li {
    :last-child {
      border-bottom: none;

      > div {
        margin-bottom: 0;
      }
    }
  }
`,Yd=Object(i.c)(y.a)`
  width: 100%;
  padding: 30px;
`,$d=Object(i.c)(y.a)`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
`,Kd=Object(i.c)("li")`
  ${({isGroup:e})=>e?"\n      pointer-events: none;\n      opacity: 0.4;\n    ":"margin-left: 16px;"}
`,Xd=Object(i.c)(y.a)`
  margin-bottom: ${({theme:e})=>e.spacing["spacing-xl"]};
`,qd=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  span {
    margin-left: 5px !important;
    svg {
      margin-right: 0 !important;
    }
  }
`;const Zd=()=>{const e=r.a.createElement(D.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:ld.e.MIN,max:ld.e.MAX}});return tn.a.number().when("stormctrl_enabled",{is:!0,then:tn.a.number().label(e).min(ld.e.MIN,e).max(ld.e.MAX,e).integer(e)})},Jd=Object(Ve.f)({mapPropsToValues:({currentPort:e,currentPortOverride:t})=>{const{port_idx:a,poe_mode:n,portconf_id:l,stormctrl_bcast_enabled:r=!1,stormctrl_bcast_rate:i="",stormctrl_mcast_enabled:c=!1,stormctrl_mcast_rate:o="",stormctrl_ucast_enabled:E=!1,stormctrl_ucast_rate:s="",isolation:m=!1,lldpmed_enabled:d,lldpmed_notify_enabled:_=!1,speed:b,full_duplex:u,op_mode:O,mirror_port_idx:p,port_security_mac_address:I=[],egress_rate_limit_kbps_enabled:g=!1,egress_rate_limit_kbps:v="",stp_port_mode:C=!0,nameOverride:R="",aggregate_num_ports:T=null}=e;return{name:R,speed:(null==t?void 0:t.speed)&&(null==t?void 0:t.full_duplex)?JSON.stringify({speed:b,full_duplex:u}):JSON.stringify({speed:0,full_duplex:!1}),lldpmed_enabled:!1!==d,stormctrl_enabled:r||c||E,aggregatePortStop:T?a+T-1:null,port_idx:a,poe_mode:n,portconf_id:l,stormctrl_bcast_enabled:r,stormctrl_bcast_rate:i,stormctrl_mcast_enabled:c,stormctrl_mcast_rate:o,stormctrl_ucast_enabled:E,stormctrl_ucast_rate:s,isolation:m,lldpmed_notify_enabled:_,full_duplex:u,mirror_port_idx:p,op_mode:O,port_security_mac_address:I,egress_rate_limit_kbps:v,egress_rate_limit_unit:rd.a[0].value,egress_rate_limit_kbps_enabled:g,stp_port_mode:C}},validationSchema:({activeItem:e})=>{const t=Object(ve.getPortNumbers)(e),a=Math.min(t.standard[0]||1,t.sfp[0]||1,t.plus[0]||1),n=Math.max(t.standard[t.standard.length-1]||1,t.sfp[t.sfp.length-1]||1,t.plus[t.plus.length-1]||1),l=r.a.createElement(D.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:a,max:n}}),i=(e=!1)=>r.a.createElement(D.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:ld.b[rd.a[e?1:0].value].MIN,max:ld.b[rd.a[e?1:0].value].MAX}});return tn.a.object().shape({port_idx:tn.a.number(),name:tn.a.string(),poe_mode:tn.a.string(),portconf_id:tn.a.string(),stormctrl_enabled:tn.a.boolean(),stormctrl_bcast_enabled:tn.a.boolean(),stormctrl_bcast_rate:Zd(),stormctrl_mcast_enabled:tn.a.boolean(),stormctrl_mcast_rate:Zd(),stormctrl_ucast_enabled:tn.a.boolean(),stormctrl_ucast_rate:Zd(),isolation:tn.a.boolean(),full_duplex:tn.a.boolean(),lldpmed_enabled:tn.a.boolean(),lldpmed_notify_enabled:tn.a.boolean(),op_mode:tn.a.string(),mirror_port_idx:tn.a.number().when("op_mode",{is:"mirror",then:tn.a.number().required(l).min(a,l).max(n,l)}),aggregatePortStop:tn.a.number().nullable().when("op_mode",{is:"aggregate",then:tn.a.number().required().label("DEVICE_PORT_FORM_AGGREGATE_PORT_LABEL")}),port_security_mac_address:tn.a.array().of(tn.a.string()),egress_rate_limit_kbps_enabled:tn.a.boolean(),stp_port_mode:tn.a.boolean(),egress_rate_limit_kbps:tn.a.number().when(["egress_rate_limit_unit","egress_rate_limit_kbps_enabled"],{is:(e,t)=>e===rd.a[0].value&&t,then:tn.a.number().required(i()).min(ld.b.k.MIN,i()).max(ld.b.k.MAX,i()).integer()}).when(["egress_rate_limit_unit","egress_rate_limit_kbps_enabled"],{is:(e,t)=>e===rd.a[1].value&&t,then:tn.a.number().required(i(!0)).min(ld.b.M.MIN,i(!0)).max(ld.b.M.MAX,i(!0))})})},handleSubmit:(e,{props:{updateDeviceWithIdEndpoint:t,activeItem:{_id:a,port_overrides:n,mac:l},activeItem:r,currentPort:i,intl:c,history:o}})=>{var E;const s=c.formatMessage({id:"DEVICE_PROPERTY_HEADER_PORTS"}),m=Object(ve.getIsPortConfDisabled)(r,i),{stormctrl_enabled:d,stormctrl_bcast_rate:_,stormctrl_mcast_rate:b,lldpmed_enabled:u,lldpmed_notify_enabled:O,stormctrl_ucast_rate:p,egress_rate_limit_kbps:I,egress_rate_limit_kbps_enabled:g,op_mode:v,mirror_port_idx:C,stp_port_mode:R,aggregatePortStop:T}=e,{speed:h,full_duplex:D}=JSON.parse(e.speed);let P=null;g&&(P=e.egress_rate_limit_unit===rd.a[1].value?1e3*I:I),delete e.egress_rate_limit_unit;const y={...e,speed:h,full_duplex:D,stp_port_mode:R,autoneg:!h,lldpmed_notify_enabled:!!u&&O,stormctrl_bcast_enabled:!!d&&!!_,stormctrl_bcast_rate:d?_:null,stormctrl_mcast_enabled:!!d&&!!b,stormctrl_mcast_rate:d?b:null,stormctrl_ucast_enabled:!!d&&!!p,stormctrl_ucast_rate:d?p:null,egress_rate_limit_kbps:P,mirror_port_idx:"mirror"===v?C.toString():null,aggregate_num_ports:"aggregate"===v?T-i.port_idx+1:null},f=Object(ad.a)(y,(e,t)=>"portconf_id"===t?m:"stormctrl_enabled"===t||("op_mode"===t&&"switch"===e||("lldpmed_enabled"===t?e:("full_duplex"!==t||!y.speed)&&("autoneg"!==t&&("poe_mode"===t&&"mirror"===y.op_mode||("stp_port_mode"===t?!("switch"===y.op_mode&&Object(Uo.x)(r)&&!Object(ve.isInWallHd)(r)):"aggregatePortStop"===t||!e))))));f.port_security_enabled=!!(null===(E=f.port_security_mac_address)||void 0===E?void 0:E.length);let S=[f];n&&(S=[f,...n.filter(e=>e.port_idx!==f.port_idx)]),t({port_overrides:S},a,l,{successToast:{icon:sa.a.success,message:"DEVICE_PORT_FORM_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:s}},mergeAndOverrideKeys:["port_overrides"],extend:!0}).then(()=>{o.goBack()})}}),Qd={updateDeviceWithIdEndpoint:ve.updateDeviceWithIdEndpoint};var e_=Object(en.compose)(Object(o.connect)((e,{activeItem:t,params:{subPanel:a,subPanelId:n}})=>({portConfig:Object(nd.selectPortConf)(e),currentPort:Object(ve.getCurrentPortData)(n?+n:+a,t),currentPortOverride:Object(ve.getCurrentPortOverrideData)(n?+n:+a,t)}),Qd),D.e,Jd)((function({portConfig:e,activeItem:t,history:a,currentPort:i,submitForm:c,resetForm:E,setFieldValue:s,setFieldTouched:m,values:_,values:{name:b,op_mode:u,portconf_id:O},intl:p,dirty:I,initialValues:g,setValues:v}){const C=Object(ve.getIsInWallAp)(t),R=Object(ve.getIsSwitchMini)(t),P=Object(ve.getIsUapUswHybrid)(t),f=Object(Uo.v)(t),S=Object(ve.getHasSwitchFullFeatures)(t,i),A=Object(ve.getIsPortConfDisabled)(t,i),N=Object(ve.getPortPoeAvailability)(i),j=Object(Cd.f)(N),L=Object(o.useDispatch)(),x=Object(o.useSelector)(oa.b),M=Object(o.useSelector)(d.i),V=Object(o.useSelector)(ze.s),w=Object(n.i)(M,{site:x}),F="switch"===u&&f&&!C&&!Object(ve.isUdm)(t),U=Object(Ta.a)("/devices/properties/:mac/settings"),{mac:z}=t,k=C?U.replace(":mac",z):"../services",[B,W]=Object(l.useState)(""),[G,H]=Object(l.useState)(!1),[Y,$]=Object(l.useState)(!1),K=Object(l.useMemo)(()=>{const t=e.map(e=>({...e,groupLabel:Object(ve.getPortProfileGroup)(e)})),a=Object(Ms.a)(t,"groupLabel");return Object.entries(a).reduce((e,[t,a])=>{const n=a.filter(e=>P?e.attr_hidden_id!==ve.SWITCH_PROFILE.ALL_ID:!R||"DEVICE_PROPERTIES_VALUES_SWITCH_PORT_PROFILE_GROUP_CUSTOM"!==e.groupLabel).map(({name:e,_id:t})=>({label:e,value:t}));return"undefined"===t||R&&"DEVICE_PROPERTIES_VALUES_SWITCH_PORT_PROFILE_GROUP_CUSTOM"===t?(e.push(...n),e):(e.push({groupLabel:p.formatMessage({id:t}),items:n}),e)},[])},[p,e,P]),X=Object(l.useMemo)(()=>Object(id.a)(K.map(({groupLabel:e,items:t})=>[{isGroup:!0,label:e,value:e},...t])),[K]),q=(Z=t,Object(ve.isAp)(Z)?"DEVICE_TYPE_ACCESS_POINT":Object(ve.isUdm)(Z)?"DEVICE_TYPE_GATEWAY":"DEVICE_TYPE_SWITCH");var Z;const J=Object(l.useCallback)((t,a)=>{const n=j.includes(ld.d.AUTO)?ld.d.AUTO:ld.d.OFF,l=null==e?void 0:e.find(e=>e._id===t),c=Object(ve.getIsNoEditPortProfile)(l),o=(null==i?void 0:i.portconf_id)===(null==l?void 0:l._id),{speed:m=0,full_duplex:d=0}=l,u={lldpmed_enabled:!0,stormctrl_enabled:!1,aggregatePortStop:null,poe_mode:n,stormctrl_bcast_enabled:!1,stormctrl_bcast_rate:"",stormctrl_mcast_enabled:!1,stormctrl_mcast_rate:"",stormctrl_ucast_enabled:!1,stormctrl_ucast_rate:"",isolation:!1,lldpmed_notify_enabled:!1,op_mode:"switch",port_security_mac_address:[],egress_rate_limit_kbps:"",egress_rate_limit_unit:rd.a[0].value,egress_rate_limit_kbps_enabled:!1,stp_port_mode:!0,full_duplex:!1},O={...u,...null==e?void 0:e.find(e=>e._id===(null==i?void 0:i.portconf_id))},I=(null==O?void 0:O.speed)&&(null==O?void 0:O.full_duplex)?{speed:m,full_duplex:d}:{speed:0,full_duplex:!1},g=["name","speed"],C=[Object.keys(_),Object.keys(O)].reduce((e,t)=>e.filter(e=>t.includes(e))).filter(e=>!g.includes(e)),R=!Ed()(Object(cd.a)(O,C),Object(cd.a)(_,C))||!Ed()(I,JSON.parse(_.speed));$(R),o?(E(),s("name",b)):v(c&&!o?{..._,portconf_id:null==l?void 0:l._id,speed:JSON.stringify({speed:0,full_duplex:!1}),...u}:{..._,speed:(null==l?void 0:l.speed)&&(null==l?void 0:l.full_duplex)?JSON.stringify({speed:m,full_duplex:d}):JSON.stringify({speed:0,full_duplex:!1}),lldpmed_enabled:!1!==(null==l?void 0:l.lldpmed_enabled),stormctrl_enabled:(null==l?void 0:l.stormctrl_bcast_enabled)||(null==l?void 0:l.stormctrl_mcast_enabled)||(null==l?void 0:l.stormctrl_ucast_enabled),stormctrl_bcast_enabled:null==l?void 0:l.stormctrl_bcast_enabled,stormctrl_bcast_rate:null==l?void 0:l.stormctrl_bcast_rate,stormctrl_mcast_enabled:null==l?void 0:l.stormctrl_mcast_enabled,stormctrl_mcast_rate:null==l?void 0:l.stormctrl_mcast_rate,stormctrl_ucast_enabled:null==l?void 0:l.stormctrl_ucast_enabled,stormctrl_ucast_rate:null==l?void 0:l.stormctrl_ucast_rate,isolation:null==l?void 0:l.isolation,lldpmed_notify_enabled:null==l?void 0:l.lldpmed_notify_enabled,full_duplex:null==l?void 0:l.full_duplex,op_mode:null==l?void 0:l.op_mode,egress_rate_limit_kbps:null==l?void 0:l.egress_rate_limit_kbps,egress_rate_limit_unit:rd.a[0].value,egress_rate_limit_kbps_enabled:null==l?void 0:l.egress_rate_limit_kbps_enabled,stp_port_mode:null==l?void 0:l.stp_port_mode});const T=(null==l?void 0:l.poe_mode)||n;W(T);const h=j.includes(T);H(h),h?T===ld.d.PASSIVE_24V||T===ld.d.PASSTHROUGH?L(Object(ue.a)({message:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_MESSAGE",messageValues:{ports:r.a.createElement("strong",null,null==i?void 0:i.port_idx),portsCount:1,poe_mode:r.a.createElement("strong",null,T===ld.d.PASSIVE_24V?p.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}):T)},title:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{s("poe_mode",T),L(Object(Oe.e)()),a()},onCancel:()=>{s("poe_mode",null==i?void 0:i.poe_mode),L(Object(Oe.e)())},size:"medium"})):(s("poe_mode",T),a()):a()},[_,null==i?void 0:i.poe_mode,e]),Q=Object(l.useMemo)(()=>r.a.createElement(He.Field,{label:S?"DEVICE_PORT_FORM_PORT_PROFILE_LABEL":"DEVICE_PORT_FORM_PORT_NETWORKS_VLAN_LABEL",name:"portconf_id",type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,options:X,renderOption:({id:e,onClick:t,className:a,isSelected:n,option:{isGroup:l=!1,label:i,value:c}})=>r.a.createElement(Kd,{key:`${e}-${i}`,id:e,onClick:e=>{J(c,()=>t(e))},className:a,"aria-selected":n,role:"option",isGroup:l},i),disabled:A}),[J,S,A,X]),ee=()=>{E(),a.goBack()};return Object(Ta.g)([Object(nd.fetchPortConf)()],r.a.createElement(r.a.Fragment,null,r.a.createElement(Yd,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(Wd,{alignItems:"center"},r.a.createElement(h.f,{onClick:ee,style:{cursor:"pointer"}}),r.a.createElement(Gd,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER",values:{port:Object(ve.getPortIndex)(i)}}))),r.a.createElement(Bd,{port:i}),r.a.createElement($d,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_NAME_LABEL",variant:"secondary",full:!0,name:"name",placeholder:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PORT"})),r.a.createElement($d,{marginBottom:24},Q),r.a.createElement(Xd,{alignSelf:"flex-end"},r.a.createElement(qd,{size:"small",type:"button",variant:"inline",onClick:()=>{a.push(w+"/settings/profiles")}},r.a.createElement(h.p,{height:20,width:20}),r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_MANAGE_PORT_PROFILES"}))),!!i.portconf_id&&O!==i.portconf_id&&Y&&r.a.createElement($d,{marginBottom:24},r.a.createElement(y.a,null,r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_NOTICE_OVERRIDE_RESET"}))))),!!i.portconf_id&&O!==i.portconf_id&&!G&&i.port_poe&&Y&&r.a.createElement($d,{marginBottom:24},r.a.createElement(y.a,null,r.a.createElement(Ye.a,{level:"warning"},r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_NOTICE_OVERRIDE_POE_MODE",values:{profile_poe_mode:r.a.createElement("strong",null,B===ld.d.PASSIVE_24V?p.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}):B===ld.d.AUTO?p.formatMessage({id:"COMMON_DEVICE_POE_MODE_AUTO"}):B)}}))))),A&&r.a.createElement($d,{marginBottom:24},r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(Xd,null,r.a.createElement(h.cb,{isActive:!0,style:{marginRight:8}}),r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_NOTICE_PORT_CONF_DISABLED"})),r.a.createElement(y.a,{alignSelf:"flex-end"},r.a.createElement(sd.a,{name:"configureLink",variant:"link",size:"small",onClick:()=>a.push(k,{accordion:"network"}),style:{marginTop:5}},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_BUTTON_PORT_CONF_CONFIGURE"}))))),i.poe_enable&&r.a.createElement(r.a.Fragment,null,r.a.createElement($d,{flexDirection:"column",marginBottom:12},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_PORT_MANUAL_POWER_CYCLE"})),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_PORT_MANUAL_POWER_CYCLE_DESCRIPTION",values:{deviceType:r.a.createElement(D.a,{id:q})}}))),r.a.createElement(Xd,{alignSelf:"flex-end",marginBottom:24},r.a.createElement(qd,{size:"small",variant:"inline",onClick:()=>{L(Object(ue.a)({message:"DEVICE_ACTIONS_SWITCH_PORT_POWER_CONFIRM_MESSAGE",messageValues:{portName:r.a.createElement("strong",null,i.portName),deviceName:t.name},title:"DEVICE_ACTIONS_SWITCH_PORT_POWER_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{L(Object(ve.powerCyclePort)(t,i.port_idx)),L(Object(Oe.e)())}}))},Icon:r.a.createElement(h.Sb,null),disabled:V},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_PORT_POWER_CYCLE"})))),r.a.createElement(Hd,{variant:"secondary",multiOpen:!0,items:[...F?[{id:"macFilter",label:r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_MAC_FILTER_LABEL"}),renderContent:()=>r.a.createElement(pd,{setFieldValue:s,formValues:_})}]:[],...S?[{id:"advancedPortConfig",label:r.a.createElement(D.b,{id:"DEVICE_PORT_PROFILE_OVERRIDE"}),renderContent:()=>r.a.createElement(Md,{initialValues:g,setFieldValue:s,setFieldTouched:m,portData:i,activeItem:t,formValues:_})}]:[]]})),r.a.createElement(Ar.a,{isDirty:I,onFormSubmit:c,onFormCancel:ee,allowCancel:!0})))}));var t_={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:td,subpanel:{path:"/:subPanel/:subPanelId",component:bm}},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:pm},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:zm,subpanel:{path:"/:subPanel/:subPanelId",component:e_}}}};const a_=Object(i.c)("div")`
  width: 100%;
  margin-bottom: ${e=>e.marginBottom||0}px;

  input {
    width: 100% !important;
  }
`,n_=Object(i.c)(y.a)`
  margin-bottom: 16px;
  width: 100%;
`,l_=Object(Ve.f)({mapPropsToValues:({activeItem:{led_override:e=ve.DEFAULT_LED_ENABLED,led_override_color:t=ve.DEFAULT_LED_COLOR,led_override_color_brightness:a=ve.DEFAULT_LED_BRIGHTNESS}={}})=>({led_override:e,led_override_color:t,led_override_color_brightness:a}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}});var r_=Object(D.e)(l_(({activeItem:e,setFormDirty:t,setFormInvalid:a,dirty:n,isValid:i,values:c,resetForm:E,setFieldValue:s,intl:m,formName:d="led"})=>{const _=Object(o.useDispatch)(),{led_override:b}=e,u=Object(o.useSelector)(_i.selectMgmtSettings),O=Object(Uo.m)(e),p=((u.led_enabled||!1)&&b!==ve.LedOverride.OFF||b===ve.LedOverride.ON)&&O;Object(l.useEffect)(()=>(_(Object(v.h)({[d]:()=>c})),_(Object(v.j)({[d]:()=>E({values:c})})),_(Object(v.i)({[d]:E})),()=>{_(Object(v.h)({[d]:null})),_(Object(v.j)({[d]:null})),_(Object(v.i)({[d]:null}))}),[_,E,c,d]),Object(l.useEffect)(()=>{t(d,n),a(d,!i)},[t,n,a,i,d]);const I=Object(l.useCallback)(()=>[ve.LedOverride.ON,ve.LedOverride.DEFAULT].includes(c.led_override)?s("led_override",ve.LedOverride.OFF):s("led_override",ve.LedOverride.ON),[s,c.led_override]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(n_,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_LED_ENABLE"})),r.a.createElement(on.a,{name:"led_override",type:"checkbox",value:[ve.LedOverride.ON,ve.LedOverride.DEFAULT].includes(c.led_override),onChange:I})),p&&r.a.createElement(r.a.Fragment,null,r.a.createElement(a_,{marginBottom:12},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED_BRIGHTNESS"}))),r.a.createElement(a_,{marginBottom:12},r.a.createElement(Jo.a,{size:"large",value:+c.led_override_color_brightness||100,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:e=>r.a.createElement("span",null,e,"%"),onChange:e=>s("led_override_color_brightness",e.target.value)})),r.a.createElement(a_,{marginBottom:12},r.a.createElement(T.a,{size:"body",color:"primary",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_COLOR"}))),r.a.createElement(a_,{marginBottom:12},r.a.createElement(Qo.a,{color:(null==c?void 0:c.led_override_color)||ve.DEFAULT_LED_COLOR,variant:"block",onChange:e=>{s("led_override_color","hex"in e?e.hex:void 0)},hexLabel:m.formatMessage({id:"DEVICE_PROPERTIES_LABEL_HEX"}),actionButton:r.a.createElement(oe.a,{variant:"inline",onClick:()=>{s("led_override_color",ve.DEFAULT_LED_COLOR)}},r.a.createElement(D.b,{id:"COMMON_VALUE_REVERT_BUTTON"}))}))))}));var i_=Object(en.compose)(Qa(["general","led","services","network"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c})=>{var E,s,m,d;const _=Object(o.useSelector)(Tr),b=Object(o.useSelector)(hr),u=Object(o.useSelector)(Dr),O=Object(o.useSelector)(Fo.o),p=Object(o.useSelector)(Fo.D),I=Object(o.useSelector)(Fo.d),{_id:g,mac:v}=e,[C,R]=Object(l.useState)(!(null===(E=O.ap_exclusions)||void 0===E?void 0:E.includes(v))),[T,h]=Object(l.useState)(p.enabled&&!(null===(s=p.exclude_devices)||void 0===s?void 0:s.includes(v))),P=Object(o.useDispatch)(),f=n||C!==!(null===(m=O.ap_exclusions)||void 0===m?void 0:m.includes(e.mac))||T!==(p.enabled&&!(null===(d=p.exclude_devices)||void 0===d?void 0:d.includes(e.mac))),S=Object(l.useCallback)(async()=>{var e,t;try{const a=[];if(C!==!(null===(e=O.ap_exclusions)||void 0===e?void 0:e.includes(v))){const e=O.ap_exclusions.filter(e=>e!==v);C||e.push(v),a.push({...O,ap_exclusions:e})}if(p.enabled&&T!==!(null===(t=p.exclude_devices)||void 0===t?void 0:t.includes(v))){const e=p.exclude_devices.filter(e=>e!==v);T||e.push(v),a.push({...p,exclude_devices:e,settings_preference:"auto"})}a.length&&await P(Object(wo.k)(a))}catch(n){return void P(Object(je.a)({icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}const a=Object.entries(_).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});P(Object(ve.updateDeviceWithIdEndpoint)(a,g,v,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(({data:e=[a]})=>{Object.values(b).forEach(t=>{"function"==typeof t&&t(e[0])})})},[g,P,_,O,C,T,v,b,p]),A=Object(l.useCallback)(()=>{Object.values(u).forEach(e=>{"function"==typeof e&&e()})},[u]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%",padding:"20px 32px 0"},r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a}),r.a.createElement($E,{isGlobalApSettingsEnabled:C,setGlobalApSettingsEnabled:R,isChannelOptimizationEnabled:T,setChannelOptimizationEnabled:h,disableChannelOptimization:!p.enabled}),r.a.createElement(ga.a,{variant:"secondary",items:[{id:"radios",label:r.a.createElement(D.b,{id:"COMMON_RADIOS"}),openByDefault:!0,renderContent:()=>r.a.createElement(zE,{activeItem:e,setFormDirty:t,setFormInvalid:a,isWirelessMeshingEnabled:I,isGlobalApSettingsEnabled:C,isChannelOptimizationEnabled:T})},...Object(Uo.g)(e)?[{id:"bandsteer",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_BAND_STEERING"}),renderContent:()=>r.a.createElement(BE,{activeItem:e,setFormDirty:t})}]:[],{id:"led",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED"}),renderContent:()=>r.a.createElement(r_,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a,hideFlowControl:!0})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:f,isInvalid:i,onFormSubmit:S,onFormCancel:A}))});var c_={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:td,subpanel:{path:"/:subPanel/:subPanelId",component:bm}},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:mm},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:i_}}};var o_={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_ABOUT",icon:h.Gb,component:td}}};const E_=Object(i.c)("div")`
  height: 100%;
`,s_=Object(i.c)("div")`
  display: table;
  width: 100%;
`,m_=Object(i.c)("div")`
  display: table-row;
`,d_=Object(i.c)("div")`
  display: table-cell;
  vertical-align: top;
`,__=Object(i.c)("span")`
  display: table-cell;
  padding-left: 12px;
  padding-bottom: 8px;
  text-align: right;
  vertical-align: top;
`;var b_=Object(D.e)((function({activeItem:e,radioType:t,radioName:a,intl:n,hideChUtil:l=!1}){const{radio_table:i,radio_table_stats:c,type:o}=e,E=i.find(e=>e.radio===t&&(!a||e.name===a)),s=null==c?void 0:c.find(e=>e.radio===t),m=Object(ve.getRadioChannelUtilization)(e,s),{totalPackets:d,totalBytes:_,droppedPercentage:b,retryPercentage:u}=Object(ve.getApRadioStats)(e,E,"rx"),{totalPackets:O,totalBytes:p,droppedPercentage:I,retryPercentage:g}=Object(ve.getApRadioStats)(e,E,"tx"),v=Object(ve.getRadioStatsTransmitPowerString)(e,s,n);return r.a.createElement(E_,null,r.a.createElement(s_,null,r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(to.a,{device:e,radio:E,hidePowerInfo:!0,textSize:"body"})))),r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TRANSMIT_POWER"}))),r.a.createElement(__,null,v?r.a.createElement(T.a,{size:"body"},v):r.a.createElement(T.a,{size:"body"}," "))),r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_PKTS_BYTES"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},O," / ",p))),r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RX_PKTS_BYTES"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},d," / ",_))),r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_RETRY_DROPPED"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},g,"% / ",I,"%"))),r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RX_RETRY_DROPPED"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},u,"% / ",b,"%"))),!l&&m&&r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CHANNEL_UTILIZATION"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},`${m.total}% / ${m.selfRx}% / ${m.selfTx}%`))),s&&o!==ve.DeviceType.UBB&&r.a.createElement(r.a.Fragment,null,r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},s["user-num_sta"]))),r.a.createElement(m_,null,r.a.createElement(d_,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_HEADER_GUESTS"}))),r.a.createElement(__,null,r.a.createElement(T.a,{size:"body"},s["guest-num_sta"]))))))}));const u_=Object(i.c)("div")`
  &:not(:last-child) {
    margin-bottom: ${({theme:e})=>e.spacing["spacing-l"]};
  }
`,O_=Object(i.c)(T.a)`
  margin-bottom: 4px;
`,p_=Object(i.c)("div")`
  margin-bottom: 16px;
`;function I_({activeItem:e}){return Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e])?r.a.createElement(u_,null,r.a.createElement(O_,{weight:"bold",size:"body"},r.a.createElement(D.a,{id:"DEVICE_HEADER_RADIO5G_SHORT"})),r.a.createElement(b_,{activeItem:e,radioType:eo.b.RADIO_NA}),r.a.createElement(p_,null),r.a.createElement(O_,{weight:"bold",size:"body"},r.a.createElement(D.a,{id:"DEVICE_HEADER_RADIO60G_SHORT"})),r.a.createElement(b_,{activeItem:e,radioType:eo.b.RADIO_AD})):null}var g_=({activeItem:e})=>{var t,a;const n=null!==(t=e.distance)&&void 0!==t?t:Object(ve.isUBB)(e)&&(null===(a=e.peer_ubb)||void 0===a?void 0:a.distance);return void 0!==n?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_DISTANCE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n," ",r.a.createElement(D.b,{id:"COMMON_UNIT_METERS_SHORT"}))):null};var v_=({activeItem:e})=>{var t,a,n,l;const i=null!==(a=null===(t=e.p2p_stats)||void 0===t?void 0:t.throughput)&&void 0!==a?a:Object(ve.isUBB)(e)&&(null===(l=null===(n=e.peer_ubb)||void 0===n?void 0:n.p2p_stats)||void 0===l?void 0:l.throughput);return i>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_SPEED"})),r.a.createElement(ta.a,{size:"body",type:"bytes",color:"secondary",input:i,options:"bitrate"})):null};var C_=({activeItem:e})=>{const t=Object(ve.getLinkQuality)(e);return t>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_QUALITY"})),r.a.createElement(ta.a,{size:"body",type:"percent",input:t/100,style:{color:Mt.a.getGradientColor(t/100)}})):null};function R_({activeItem:e}){return r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(rl,{activeItem:e}),r.a.createElement(g_,{activeItem:e}),r.a.createElement(v_,{activeItem:e}),r.a.createElement(C_,{activeItem:e}),r.a.createElement(il,{activeItem:e}))}const T_=Object(i.c)(T.a)`
  margin-top: 16px; // 16
  margin-bottom: 4px; // 4
`;var h_;!function(e){e.STATION="station",e.ACCESS_POINT="access_point"}(h_||(h_={}));var D_=({deviceData:e,ubbDeviceType:t,pendingAdoption:a})=>{const{mac:n,ip:l,link_capacity:i,uptime:c,has_temperature:o,general_temperature:E,uplink:s}=e,{rssi:m,tx_rate:d,tx_packets:_,rx_rate:b,tx_bytes:u,"tx_bytes-r":O,rx_packets:p,rx_bytes:I,"rx_bytes-r":g,speed:v}=s||{},C=g+O;return r.a.createElement(y.a,{flexDirection:"column"},n&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_MAC"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n)),l&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},l)),!a&&r.a.createElement(r.a.Fragment,null,i>0&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_CAPACITY"})),r.a.createElement(ta.a,{type:"bytes",color:"secondary",size:"body",input:1e6*i/8,options:"bitrate"})),o&&!!E&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_LABEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:E}}))),c&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(ta.a,{type:"uptime",color:"secondary",size:"body",input:c})),r.a.createElement(cl,{activeItem:e}),r.a.createElement(ml,{activeItem:e,withTooltip:!0}),!!s&&r.a.createElement(r.a.Fragment,null,r.a.createElement(T_,{color:"primary",weight:"bold"},r.a.createElement(D.b,{id:Object(ve.isDeviceWireless)(e)?"DEVICE_PROPERTY_UPLINK_WIRELESS":"DEVICE_PROPERTY_UPLINK_WIRED"})),t===h_.STATION&&r.a.createElement(r.a.Fragment,null,m&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},So(m)," (",Ao(m),r.a.createElement(D.b,{id:"COMMON_DEVICE_RADIO_TRANSMIT_POWER_DBM"}),")")),d&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_TX_RATE"})),r.a.createElement(ta.a,{type:"bytes",color:"secondary",size:"body",input:1e3*d/8,options:"bitrate"})),b&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_RX_RATE"})),r.a.createElement(ta.a,{type:"bytes",color:"secondary",size:"body",input:1e3*b/8,options:"bitrate"}))),t===h_.ACCESS_POINT&&r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_SPEED"})),r.a.createElement(T.a,{color:"secondary",size:"body"},v))),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},p&&I?r.a.createElement(r.a.Fragment,null,p.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",input:I,color:"secondary",size:"body"})):"0.00 / 0.00")),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_UP_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},_&&u?r.a.createElement(r.a.Fragment,null,_.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",input:u,color:"secondary",size:"body"})):"0.00 / 0.00")),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ACTIVITY"})),r.a.createElement(ta.a,{type:"bytes",color:"secondary",size:"body",input:C,options:"bitrate"})))))};const P_=Object(i.c)(y.a)`
  width: 100%;
  background: ${({theme:e})=>e.motifPalette.ui12};
  padding: 16px; // 16
`,y_=Object(i.c)(y.a)`
  text-align: center;
  width: 122px;
`,f_=Object(i.c)(y.a)`
  padding-top: 50px;
  width: 100%;
`,S_=i.e`
  0% {
    width: 5%;
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 0;
  }  
`,A_=i.e`
  0% {
    opacity: 1;
  }
  30% {
    opacity: 1;
  }  
  50% {
    opacity: 0;
  }
`,N_=Object(i.c)("div")`
  position: relative;
  width: 100%;
  height: 3px;
  background-color: ${({theme:e})=>e.colors.neutralBackground};
`,j_=Object(i.c)("div")`
  animation: ${S_} 5s infinite;
  width: 100%;
  opacity: 1;
  height: 5px;
  margin-top: -1px;
  position: absolute;
  background-image: linear-gradient(
    to right,
    ${({linkAnimationColor:e})=>e},
    transparent 30%,
    transparent 70%,
    ${({linkAnimationColor:e})=>e}
  );
  left: 50%;
  transform: translateX(-50%);
  border-radius: 3px;

  &:after {
    content: '';
    display: block;
    background-color: ${({linkAnimationColor:e})=>e};
    width: 100%;
    position: absolute;
    border-radius: 3px;
    height: 100%;
    opacity: 0;
    animation: ${A_} 5s infinite;
  }
`,L_=Object(i.c)(y.a)`
  margin-top: auto;
  margin-bottom: 20px;
  text-align: center;
`,x_=Object(i.c)("img")`
  height: 120px;
  transform: scaleX(${({flip:e})=>e?-1:1});
`,M_=Object(i.c)("div")`
  position: absolute;
  ${({left:e})=>e?`left: ${e}px`:""};
  ${({right:e})=>e?`right: ${e}px`:""};
  ${({height:e})=>e?`height: ${e}px`:""};
  width: 3px;
  border-radius: 1px;
  background-image: radial-gradient(transparent 0%, ${({color:e})=>e} 60%, transparent 100%);
  filter: drop-shadow(0px 0px 0.5px ${({color:e})=>e}) opacity(0.6);
`,V_=Object(i.c)(y.a)`
  margin: 0 32px 16px; // 0 32 16 32
  position: relative;
`,w_=Object(i.c)(ta.a)`
  font-size: 34px;
  font-weight: ${({theme:e})=>e.fontWeights.bold};
`,F_=Object(i.c)(T.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px; // 14
  line-height: 17px;
`,U_=Object(i.c)(y.a)`
  border-top: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  padding: 16px 32px 16px 22px;
`,z_=Object(i.c)(h.ab)`
  margin-right: 12px;
`;function k_({activeItem:e,pendingAdoption:t}){var a,n,i,c,E;const{peer_ubb:s={},led_override_color:m}=e,d=Object(u.fb)(e),_=Object(wt.c)(d),b=!t&&Object(u.fe)(e),O=!t&&Object(u.ee)(e),p=Object(l.useMemo)(()=>Object(u.ge)(e),[]),I=null===(E=rE.a[(null!==(c=null!==(n=null===(a=e.uplink)||void 0===a?void 0:a.radio)&&void 0!==n?n:null===(i=null==s?void 0:s.uplink)||void 0===i?void 0:i.radio)&&void 0!==c?c:"").toUpperCase()])||void 0===E?void 0:E.frequency,g=`${Object(o.useSelector)(M.a)}/device/ubb/${e.model}/side.png`;let v;return v=!t&&!b||"danger"===_?Ia.a["color-danger"]:t||"warning"===_?Ia.a["color-warning"]:Ia.a["color-success"],r.a.createElement(r.a.Fragment,null,r.a.createElement(P_,{justifyContent:"space-between"},r.a.createElement(y_,{flexDirection:"column"},r.a.createElement(V_,null,r.a.createElement(x_,{src:g}),r.a.createElement(M_,{color:m||Ia.a["blue-0"],left:p?25:23,height:p?105:107})),r.a.createElement(F_,{color:"secondary",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_TYPE_UBB_AP"})),r.a.createElement(F_,{color:"secondary"},I)),r.a.createElement(f_,{flexDirection:"column",alignItems:"center"},r.a.createElement(N_,null,r.a.createElement(j_,{linkAnimationColor:v})),r.a.createElement(L_,{flexDirection:"column"},b&&r.a.createElement(w_,{type:"percent",input:d/100,style:{color:Mt.a.getGradientColor(d/100)}}),r.a.createElement(F_,{color:"primary",weight:"bold"},b&&r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_QUALITY"}),!b&&t&&r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LINK_INACTIVE"}),!b&&!t&&r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_NO_LINK"})))),r.a.createElement(y_,{flexDirection:"column"},r.a.createElement(V_,null,r.a.createElement(x_,{src:g,flip:!0}),r.a.createElement(M_,{color:s.led_override_color||Ia.a["blue-0"],right:p?25:23,height:p?105:107})),r.a.createElement(F_,{color:"secondary",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_TYPE_UBB_STATION"})),r.a.createElement(F_,{color:"secondary"},I))),(t||O)&&r.a.createElement(U_,{alignItems:"center"},r.a.createElement(z_,{width:24,height:24}),r.a.createElement(T.a,{color:"secondary"},r.a.createElement(D.b,{id:t?"DEVICE_UBB_LINK_INACTIVE_WARNING_MESSAGE":"DEVICE_UBB_LINK_DOWN_WARNING_MESSAGE"}))))}const B_=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var W_=({activeItem:e})=>{const{peer_ubb:t}=e,a=Object(ve.getUplinkAttrs)(e)||{},n=null==t?void 0:t.uplink,i=t&&(!Object(ve.getIsUbbPeerAdopted)(e)||!Object(ve.isAdopted)(e)),c=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(k_,{activeItem:e,pendingAdoption:i}),r.a.createElement(nr,{device:e}),c&&r.a.createElement(r.a.Fragment,null,r.a.createElement(xl,{activeItem:e}),r.a.createElement(B_,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(R_,{activeItem:e})},...t?[{id:"station",label:r.a.createElement(r.a.Fragment,null,r.a.createElement(D.b,{id:"DEVICE_TYPE_UBB_STATION"})," ",!!n&&r.a.createElement(r.a.Fragment,null,"(",r.a.createElement(D.b,{id:Object(ve.isDeviceWireless)(t)?"DEVICE_CONNECTION_WIRELESS":"DEVICE_CONNECTION_WIRED"}),")")),renderContent:()=>r.a.createElement(D_,{deviceData:t,ubbDeviceType:h_.STATION,pendingAdoption:i})}]:[],{id:Object(ve.isUbbAP)(e)?"accessPoint":"station",label:r.a.createElement(r.a.Fragment,null,r.a.createElement(D.b,{id:Object(ve.isUbbAP)(e)?"DEVICE_TYPE_UBB_AP":"DEVICE_TYPE_UBB_STATION"})," ",!!a&&r.a.createElement(r.a.Fragment,null,"(",r.a.createElement(D.b,{id:Object(ve.isDeviceWireless)(e)?"DEVICE_CONNECTION_WIRELESS":"DEVICE_CONNECTION_WIRED"}),")")),renderContent:()=>r.a.createElement(D_,{deviceData:e,ubbDeviceType:h_.ACCESS_POINT,pendingAdoption:i})},...i?[]:[{id:"radios",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_AIR_STATS"}),renderContent:()=>r.a.createElement(I_,{activeItem:e})}]],multiOpen:!0,renderOnlyExpandedContent:!0})))},G_=a(464);const H_=Object(i.c)(T.a)`
  display: block;
  position: relative;
  padding-right: 20px;
  margin-right: 15px;

  ::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 12px;
    border-bottom: 2px solid ${({legendcolor:e})=>e};
  }

  :last-of-type {
    margin-right: 0;
  }
`,Y_=Object(i.c)(T.a)`
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  padding-left: 10px;
  padding-top: 10px;
`,$_=Object(i.c)(y.a)`
  margin-bottom: 20px;
`,K_=Object(Er.a)(6,e=>({value:e,label:String(e)})).reverse(),X_=e=>i.a`
  fill: ${e.motifPalette.text02};
  font-size: 11px;
`;var q_=Object(sr.b)(r.a.memo(e=>{const{mac:t,keys:a,heading:n,theme:l,colors:i,noLegend:c=!1,fetchReport:E,legend:s}=e,m=Object(o.useSelector)(Object(Kn.selectDeviceStatReport)(t,E,Kn.OBJECT.UBB,a)),d=Object(o.useSelector)(ze.H),_={},b=Date.now(),u=Object(P.startOfHour)(Object(P.addHours)(b,1)).getTime(),O=d?"H:ss":"ha",p=Object(dr.b)(u,O),I=p[0].value,g=Object(ir.n)(m.filter(e=>e.time>I).map(e=>({...e,x:e.time})),mr.a.MINUTES.grain);g[0]&&a[0]in g[0]&&g.forEach(e=>{a.forEach((t,a)=>{_[t]||(_[t]={key:t,lineColor:i[a],maxY:0,data:[]}),_[t].data.push({x:e.x,y:e[t]})})});const v=a.map(e=>_[e]?_[e].data.map(e=>e.y||0):0),C=Math.max(...v.flat(),4);let R=K_;return C>5&&(R=Object(dr.e)(C,6)),r.a.createElement(r.a.Fragment,null,!c&&r.a.createElement($_,{justifyContent:"flex-end"},r.a.createElement(y.a,null,s.map((e,t)=>r.a.createElement(H_,{legendcolor:i[t],key:e},r.a.createElement(D.b,{id:e}))))),r.a.createElement(y.a,null,r.a.createElement(Y_,{color:"primary"},r.a.createElement(D.b,{id:n})),r.a.createElement(cr.a,{xAxis:p,yAxis:R,width:305,height:150,margin:[0,0,20,35],labelClassName:X_(l),renderChartElements:(e,t,n)=>r.a.createElement(r.a.Fragment,null,a.map(a=>_[a]&&_[a].data.length&&r.a.createElement(or.a,{key:_[a].key,data:_[a].data,maxY:n,mouseData:t,getCoordinates:e,variant:"line",lineColor:_[a].lineColor,dashed:!1,hideMissingData:!0})))})))},(e,t)=>e.mac===t.mac&&Object(G_.a)(e.keys,t.keys)));const Z_=Object(i.c)("div")`
  padding: 16px 32px 32px 32px;
`,J_=Object(i.c)("div")`
  margin-top: ${({marginTop:e})=>e||0}px;
  margin-bottom: ${({marginBottom:e})=>e||0}px;
`,Q_=[{value:h_.ACCESS_POINT,label:"DEVICE_TYPE_UBB_AP"},{value:h_.STATION,label:"DEVICE_TYPE_UBB_STATION"}],eb=Object(Ve.f)({mapPropsToValues:()=>({device:h_.ACCESS_POINT,channel:"wlan0"}),handleSubmit:null});var tb,ab=Object(en.compose)(D.e,eb)(({activeItem:e,values:{device:t,channel:a},intl:n})=>{const i=Object(o.useDispatch)(),{mac:c,peer_ubb:E={}}=e,s=t===h_.ACCESS_POINT?c:E.mac,m=[a+"-rx_dropped",a+"-tx_dropped"],d=[a+"-tx_retries"],_=Object(l.useMemo)(()=>Object(ve.getRadios)(e).map(e=>({value:e.name,label:`${n.formatMessage({id:"DEVICE_LABEL_RADIO_"+e.radio.toUpperCase()})} (${e.name})`})),[e.radio_table]);return Object(l.useEffect)(()=>{i(Object(Kn.fetchDeviceUsageReport)(s,Kn.OBJECT.UBB))},[t]),Object(l.useEffect)(()=>{i(Object(Kn.fetchDeviceDroppedReport)(s,Kn.OBJECT.UBB,m)),i(Object(Kn.fetchDeviceRetriesReport)(s,Kn.OBJECT.UBB,d))},[a,t]),r.a.createElement(Z_,null,r.a.createElement(J_,{marginTop:9,marginBottom:28},r.a.createElement(on.a,{type:"dropdown",variant:"secondary",name:"device",label:"DEVICE_PROPERTIES_LABEL_SELECT_DEVICE",options:Q_,full:!0,translateLabel:!0,translateOptions:!0})),r.a.createElement(q_,{mac:s,keys:["cpu","mem"],colors:[Ia.a["orange-1"],Ia.a["blue-3"]],heading:"DEVICE_PROPERTIES_LABEL_USAGE_PERCENT",fetchReport:Kn.fetchDeviceUsageReport,legend:["COMMON_WORD_CPU","COMMON_WORD_MEMORY"]}),r.a.createElement(J_,{marginTop:35,marginBottom:30},r.a.createElement(on.a,{type:"dropdown",variant:"secondary",full:!0,name:"channel",translateLabel:!0,label:"DEVICE_PROPERTIES_LABEL_SELECT_CHANNEL",options:_})),r.a.createElement(q_,{mac:s,keys:m,colors:[Ia.a["purple-1"],Ia.a["purple-1"]],noLegend:!0,fetchReport:Kn.fetchDeviceDroppedReport,heading:"DEVICE_PROPERTIES_LABEL_DROPPED"}),r.a.createElement(J_,{marginBottom:30}),r.a.createElement(q_,{mac:s,keys:d,colors:[Ia.a["purple-1"]],noLegend:!0,fetchReport:Kn.fetchDeviceRetriesReport,heading:"DEVICE_PROPERTIES_LABEL_RETRIES"}))}),nb=a(715);!function(e){e.ACCESS_POINT="ap",e.STATION="sta"}(tb||(tb={}));const lb=Object(i.c)("div")`
  margin-bottom: 16px;
`,rb=Object(i.c)("div",{shouldForwardProp:e=>"visible"!==e})`
  ${({visible:e})=>e?"":"display: none;"}
`,ib=Object(i.c)(T.a)`
  margin-left: 10px;
`;var cb=({ap:e,sta:t,formName:a})=>{const[n,i]=Object(l.useState)(tb.ACCESS_POINT),c=e=>i(e);return r.a.createElement(r.a.Fragment,null,r.a.createElement(lb,null,r.a.createElement(y.a,{marginBottom:"12px"},r.a.createElement(T.a,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_UBB_CHOOSE_DEVICE"}))),r.a.createElement(y.a,{marginBottom:"16px"},r.a.createElement(y.a,{marginRight:"18px"},r.a.createElement(nb.a,{checked:n===tb.ACCESS_POINT,name:`ubb-device-select-${a}-${tb.ACCESS_POINT}`,id:`ubb-device-select-${a}-${tb.ACCESS_POINT}`,onChange:()=>c(tb.ACCESS_POINT)}),r.a.createElement("label",{htmlFor:`ubb-device-select-${a}-${tb.ACCESS_POINT}`},r.a.createElement(ib,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_TYPE_UBB_AP"})))),r.a.createElement(y.a,null,r.a.createElement(nb.a,{checked:n===tb.STATION,name:`ubb-device-select-${a}-${tb.STATION}`,id:`ubb-device-select-${a}-${tb.STATION}`,onChange:()=>c(tb.STATION)}),r.a.createElement("label",{htmlFor:`ubb-device-select-${a}-${tb.STATION}`},r.a.createElement(ib,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_TYPE_UBB_STATION"})))))),r.a.createElement(rb,{visible:n===tb.ACCESS_POINT},e),r.a.createElement(rb,{visible:n===tb.STATION},t))};const ob=Object(i.c)("div")`
  margin-bottom: 20px;
`,Eb=Object(i.c)(y.a)`
  margin-bottom: ${({marginBottom:e})=>e}px;
`,sb=Object(i.c)("div")`
  flex: 1;
  max-width: calc(50% - 6px);
`,mb=[{value:"dhcp",label:"DEVICE_PROPERTIES_VALUES_NETWORK_USING_DHCP"},{value:"static",label:"DEVICE_PROPERTIES_VALUES_NETWORK_STATIC_IP"}];var db=Object(Ve.f)({isInitialValid:!0,mapPropsToValues:({activeItem:e})=>{const{config_network:t,peer_ubb:a,ip:n}=e,{type:l="dhcp",ip:r=n||"",netmask:i="",gateway:c="",dns1:o="",dns2:E="",dnssuffix:s=""}=t,{type:m="dhcp",ip:d=a.ip||"",netmask:_="",gateway:b="",dns1:u="",dns2:O="",dnssuffix:p=""}=a.config_network;return{config_network:{type:l,ip:r,netmask:i,gateway:c,dns1:o,dns2:E,dnssuffix:s},peer_ubb:{config_network:{type:m,ip:d,netmask:_,gateway:b,dns1:u,dns2:O,dnssuffix:p}}}},handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:tn.a.object().shape({config_network:kr,peer_ubb:tn.a.object().shape({config_network:kr})})})(({setFormDirty:e,setFormInvalid:t,dirty:a,values:n,resetForm:i,isValid:c})=>{const E=Object(o.useDispatch)();return Object(l.useEffect)(()=>(E(Object(v.h)({network:()=>{const{config_network:e,peer_ubb:{config_network:t}}=n,a={config_network:{type:e.type},peer_ubb:{config_network:{type:t.type}}};return"dhcp"!==e.type&&(a.config_network={...e}),"dhcp"!==t.type&&(a.peer_ubb.config_network={...t}),a}})),E(Object(v.j)({network:()=>i({values:n})})),E(Object(v.i)({network:i})),()=>{E(Object(v.h)({network:null})),E(Object(v.j)({network:null})),E(Object(v.i)({network:null}))}),[E,i,n]),Object(l.useEffect)(()=>{e("network",a),t("network",!c)},[e,t,a,c]),r.a.createElement(cb,{formName:"network",sta:r.a.createElement(r.a.Fragment,null,r.a.createElement(ob,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_CONFIGURE_IP",name:"config_network.type",type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:mb})),"static"===n.config_network.type&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Eb,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(sb,null,r.a.createElement(on.a,{label:"COMMON_IP_ADDRESS",name:"config_network.ip",full:!0})),r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_PREFERRED_DNS",name:"config_network.dns1",full:!0}))),r.a.createElement(Eb,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_SUBNET_MASK",name:"config_network.netmask",full:!0})),r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ALTERNATE_DNS",name:"config_network.dns2",full:!0}))),r.a.createElement(Eb,{marginBottom:20,justifyContent:"space-between"},r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_GATEWAY",name:"config_network.gateway",full:!0})),r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_DNS_SUFFIX",name:"config_network.dnssuffix",full:!0}))))),ap:r.a.createElement(r.a.Fragment,null,r.a.createElement(ob,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_CONFIGURE_IP",name:"peer_ubb.config_network.type",type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:mb})),"static"===n.peer_ubb.config_network.type&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Eb,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(sb,null,r.a.createElement(on.a,{label:"COMMON_IP_ADDRESS",name:"peer_ubb.config_network.ip",full:!0})),r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_PREFERRED_DNS",name:"peer_ubb.config_network.dns1",full:!0}))),r.a.createElement(Eb,{marginBottom:24,justifyContent:"space-between"},r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_SUBNET_MASK",name:"peer_ubb.config_network.netmask",full:!0})),r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_ALTERNATE_DNS",name:"peer_ubb.config_network.dns2",full:!0}))),r.a.createElement(Eb,{marginBottom:20,justifyContent:"space-between"},r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_GATEWAY",name:"peer_ubb.config_network.gateway",full:!0})),r.a.createElement(sb,null,r.a.createElement(on.a,{label:"DEVICE_PROPERTIES_LABEL_DNS_SUFFIX",name:"peer_ubb.config_network.dnssuffix",full:!0})))))})});const _b=Object(Ve.f)({mapPropsToValues:({activeItem:e,nativeNetworks:t})=>({mgmt_network_id:Object(ve.getDeviceNetworkId)(t,e)}),validationSchema:tn.a.object().shape({mgmt_network_id:tn.a.string()}),handleSubmit:()=>null});var bb=Object(en.compose)(Object(o.connect)(e=>({nativeNetworks:Object(nn.selectNativeNetworks)(e)}),{}),_b)(({nativeNetworks:e=[],values:t,resetForm:a,dirty:n,setFormDirty:i,setFormInvalid:c,isValid:E})=>{const s=Object(o.useDispatch)();Object(l.useEffect)(()=>(s(Object(v.h)({vlan:()=>t})),s(Object(v.j)({vlan:()=>a({values:t})})),s(Object(v.i)({vlan:a})),()=>{s(Object(v.h)({vlan:null})),s(Object(v.j)({vlan:null})),s(Object(v.i)({vlan:null}))}),[s,a,t.mgmt_network_id]),Object(l.useEffect)(()=>{i("vlan",n),c("vlan",!E)},[i,c,n,E]);const m=e.map(e=>({value:e._id,label:e.name}));return r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_LABEL_MGMT_VLAN",name:"mgmt_network_id",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:m,translateLabel:!0})});const ub=Object(i.c)(y.a)`
  margin-top: -15px;
`,Ob=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
`,pb=i.a`
  th {
    padding-left: 0;
    padding-right: 10px;
  }
`,Ib=i.a`
  text-align: left;
  padding-left: 0;
  padding-right: 10px;
`,gb=i.a`
  padding: 0;
  margin: 0;
  text-align: left;
`;function vb({activeItem:{downlink_table:e}}){const t=Object(o.useSelector)(ve.selectDevicesData),a=Object(o.useDispatch)(),n=[{id:"mac",sortable:!0,label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_TYPE_UBB_AP_SHORT"})),renderCell:e=>{if(!e)return null;const n=t.find(t=>t.mac===e.mac);return n?r.a.createElement(Ob,{name:"propertyPanelButton",onClick:()=>a(Object(v.g)({type:b.c.DEVICE,mac:e.mac})),size:"small",className:gb,variant:"link"},Object(x.c)(n)):e.mac}},{id:"rssi",sortable:!0,label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),renderCell:e=>r.a.createElement(T.a,{color:"inherit",size:"body"},So(e.rssi)," (",Ao(e.rssi),r.a.createElement(D.b,{id:"COMMON_DEVICE_RADIO_TRANSMIT_POWER_DBM"}),")")}];return r.a.createElement(ub,null,r.a.createElement(ya.a,{items:e||[],idField:"mac",disableColumnFilters:!0,disableSelection:!0,disableTextPointer:!0,headerRowClassName:pb,cellClassName:Ib,columns:n,renderFooter:()=>r.a.createElement("div",null,e&&e.length>0?r.a.createElement(T.a,{color:"inherit",size:"body"},r.a.createElement(D.b,{id:"COMMON_TABLE_FOOTER",values:{length:e.length}})):r.a.createElement(T.a,{color:"inherit",size:"body"},r.a.createElement(D.b,{id:"COMMON_DEVICES_NOT_FOUND"}))),rowHeight:30}))}const Cb=Object(i.c)(ga.a)`
  transition: none;
  flex: 1 1 100%;
`;var Rb=Object(en.compose)(Qa(["general","tags","screen","peerUbbScreen","network","vlan","radios"]))(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,formStates:c})=>{const E=Object(ve.isUbbXg)(e),s=Object(o.useSelector)(Tr),m=Object(o.useSelector)(hr),d=Object(o.useSelector)(Dr),{_id:_,mac:b}=e,u=Object(o.useDispatch)(),O=Object(l.useCallback)(async()=>{const e=Object.entries(s).reduce((e,[t,a])=>{if("function"==typeof a){const n=a();if("object"==typeof n&&Object.keys(n).length&&c[t])return"peerUbbScreen"===t?{peerUbbScreen:n,...e}:{...e,...n}}return e},{}),t=Object(eE.a)(e,"peerUbbScreen"),a={...t,peer_ubb:{name:e.name,...t.peer_ubb,...e.peerUbbScreen,...t.mgmt_network_id?{mgmt_network_id:t.mgmt_network_id}:{}}};u(Object(ve.updateDeviceWithIdEndpoint)(a,_,b,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(({data:e})=>{Object.values(m).forEach(t=>{"function"==typeof t&&t(null==e?void 0:e[0])})})},[_,u,c,s,b,m]),p=Object(l.useCallback)(()=>{Object.values(d).forEach(e=>{"function"==typeof e&&e()})},[d]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%",padding:"20px 32px 0"},r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a}),r.a.createElement(Cb,{variant:"secondary",items:[{id:"radios",label:r.a.createElement(D.b,{id:"COMMON_RADIOS"}),openByDefault:!0,renderContent:()=>r.a.createElement(zE,{activeItem:e,setFormDirty:t,setFormInvalid:a,isWirelessMeshingEnabled:!1,isUbbXg:E,isGlobalApSettingsEnabled:!1,isChannelOptimizationEnabled:!1})},{id:"led",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_LED"}),renderContent:()=>r.a.createElement(cb,{formName:"led",ap:r.a.createElement(lE,{activeItem:e,setFormDirty:t}),sta:r.a.createElement(lE,{activeItem:e.peer_ubb,formName:"peerUbbScreen",setFormDirty:t})})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(db,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"vlan",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_VLAN"}),renderContent:()=>r.a.createElement(bb,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"downlink",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(vb,{activeItem:e})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e,disableDebug:E})}],renderOnlyExpandedContent:!0,multiOpen:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:i,onFormSubmit:O,onFormCancel:p}))});var Tb={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:W_},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:ab},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:Rb}}};const hb=Object(i.c)(y.a)`
  padding: 0px 32px;
`;var Db=({activeItem:e})=>{const t=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,t&&r.a.createElement(Um,{deviceData:e,showFullScreenDiagramButton:!0}),r.a.createElement(hb,{flexDirection:"column"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"ports",openByDefault:!0,renderLabel:()=>null,renderContent:()=>r.a.createElement(Cm,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})))},Pb=a(827),yb=a(234),fb=a(260);const Sb=({networkgroup:e,uplinkAttrs:t})=>{var a,n,l,i,c,E,s;const m=null===(a=Object(o.useSelector)(fb.selectIspInfoItems))||void 0===a?void 0:a.find(t=>t.networkgroup===e),{ip:d,speed:_,rx_packets:b,rx_bytes:u,tx_packets:O,tx_bytes:p,"rx_bytes-r":I,"tx_bytes-r":g}=t;return r.a.createElement(y.a,{height:"100%",flexDirection:"column"},d?r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},d)):null,r.a.createElement(Zl,{portSpeed:_}),(null===(l=null===(n=null==m?void 0:m.details)||void 0===n?void 0:n.service_provider)||void 0===l?void 0:l.name)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_WAN_ISP"})),r.a.createElement(T.a,{size:"body"},m.details.service_provider.name)),((null===(i=null==m?void 0:m.configuration)||void 0===i?void 0:i.wan_dns1)||(null===(c=null==m?void 0:m.configuration)||void 0===c?void 0:c.wan_dns2))&&r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_DNS_SERVER_1"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null===(E=null==m?void 0:m.configuration)||void 0===E?void 0:E.wan_dns1)),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DASHBOARD_ISP_PROPERTY_DNS_SERVER_2"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null===(s=null==m?void 0:m.configuration)||void 0===s?void 0:s.wan_dns2))),b&&u?r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{size:"body"},Object(Da.a)(b,{spacer:" "})," / ",Object(aa.c)(u,"bytes","IEC"))):null,O&&p?r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UP_PKTS_BYTES"})),r.a.createElement(T.a,{size:"body"},Object(Da.a)(O,{spacer:" "})," / ",Object(aa.c)(p,"bytes","IEC"))):null,r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_DOWN_ACTIVITY"})),r.a.createElement(T.a,{size:"body"},void 0!==I?r.a.createElement(ta.a,{type:"bytes",input:I,options:"bitrate",size:"body"}):"-")),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UP_ACTIVITY"})),r.a.createElement(T.a,{size:"body"},void 0!==g?r.a.createElement(ta.a,{type:"bytes",input:g,options:"bitrate",size:"body"}):"-")))};var Ab=e=>Object.values(Pb.a).reduce((t,a)=>{const n=e.port_table&&e.port_table.filter(e=>e.up),l="wan1"===a?"WAN":"WAN2",i="wan1"===a?"WAN":"WAN 2",c=Object(yb.e)(l,e)||"",o=n&&n.find(e=>e.ifname===c),E=Object(u.vc)(e,a);return o&&E&&t.push({id:a,label:r.a.createElement("span",null,i),renderContent:()=>r.a.createElement(Sb,{networkgroup:l,uplinkAttrs:E,activeItem:e})}),t},[]);var Nb=({activeItem:e,hasApCapabilities:t,forUdmPro:a,disableUsageChart:n=!1})=>{const i=Object(o.useDispatch)();return Object(l.useEffect)(()=>{i(Object(Kn.fetchDeviceUsageReport)(e.mac))},[]),r.a.createElement(r.a.Fragment,null,!n&&r.a.createElement(Ir,{gwMac:e.mac,keys:["mem","cpu"],forUdm:t,pickDatumsWithKey:a?"gw":null,heading:"DEVICE_GATEWAY_USAGE_STAT_CHART_HEADER"}),t&&r.a.createElement(Ir,{gwMac:e.mac,keys:["num_sta"],forUdm:t,heading:"DEVICE_GATEWAY_CLIENTS_STAT_CHART_HEADER"}))};var jb=({activeItem:{ip:e,satisfaction:t,uptime:a,lan_ip:n},activeItem:l})=>{var i,c;const o=Object(ve.getDeviceIp)(l),{na:E,ng:s,naNumSta:m,ngNumSta:d}=Object(ve.getSatisfactionByRadio)(l),_=Object(wt.d)(t);return r.a.createElement(y.a,{flexDirection:"column"},_&&r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_WIFI_EXPERIENCE_2G"})),d&&0!==s?r.a.createElement(ta.a,{size:"body",type:"percent",input:Math.min(s,100)/100,style:{color:Ia.a["color-"+Object(wt.c)(Math.min(s||0,100))]}}):r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_WIFI_EXPERIENCE_5G"})),m&&0!==E?r.a.createElement(ta.a,{size:"body",type:"percent",input:Math.min(E,100)/100,style:{color:Ia.a["color-"+Object(wt.c)(Math.min(E||0,100))]}}):r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"})))),Object(ve.isUdmPro)(l)?r.a.createElement(r.a.Fragment,null,(null===(i=null==l?void 0:l.wan1)||void 0===i?void 0:i.ip)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS_INDEXED",values:{wanIndex:1}})),r.a.createElement(T.a,{size:"body"},l.wan1.ip)),(null===(c=null==l?void 0:l.wan2)||void 0===c?void 0:c.ip)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS_INDEXED",values:{wanIndex:2}})),r.a.createElement(T.a,{size:"body"},l.wan2.ip))):r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},e)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LAN_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},o)),a>0&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(T.a,{size:"body"},Object(ll.a)(a))),r.a.createElement(cl,{activeItem:l}),r.a.createElement(ml,{activeItem:l}),!Object(ve.isUdmPro)(l)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Zc,{activeItem:l}),r.a.createElement(Jc,{activeItem:l})))};const Lb=Object(i.c)("div")`
  margin-bottom: 32px;
  th {
    padding-right: 0;

    &:first-child {
      margin-left: 0px;
    }
  }
`,xb=Object(i.c)("div")`
  margin-top: 12px;
`,Mb=[{id:"name",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_NETWORK"})),minWidth:75,renderCell:({name:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},e)},{id:"ip",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_WORD_IP"})),minWidth:90,renderCell:({ip:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},e)},{id:"tx_bytesInfo",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_WORD_SENT"})),renderCell:e=>r.a.createElement(ta.a,{color:"inherit",size:"body",type:"bytes",input:e.tx_bytes}),maxWidth:60},{id:"rx_bytesInfo",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_WORD_RECEIVED"})),renderCell:e=>r.a.createElement(ta.a,{color:"inherit",size:"body",type:"bytes",input:e.rx_bytes}),minWidth:65},{id:"num_sta",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_CLIENTS"})),minWidth:60,renderCell:({num_sta:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},e)}];var Vb=({activeItem:e})=>{const{network_table:t}=e;return r.a.createElement(Lb,null,r.a.createElement(ya.a,{items:t,disableColumnFilters:!0,disableTextPointer:!0,disableSelection:!0,idField:"_id",columns:Mb,renderFooter:()=>t.length>0?r.a.createElement(xb,null,r.a.createElement(D.b,{id:"COMMON_TABLE_FOOTER",values:{length:t.length}})):r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_AP_DOWNLINKS_TABLE_NO_CLIENTS"})}))},wb=a(2793),Fb=a(1617);var Ub=({device:e,isOwner:t,...a})=>{var n,l,i,c;const E=Object(o.useSelector)(Il.c),s=null===(n=null==e?void 0:e.unifi_care)||void 0===n?void 0:n.state;let m,d;if(s===fe.h.REPLACING?(m=null===(l=null==e?void 0:e.unifi_care)||void 0===l?void 0:l.tracking_url,d=t?"DEVICE_ACTIONS_UNIFI_CARE_TRACK":"DEVICE_ACTIONS_UNIFI_CARE_SHIPPED"):s===fe.h.RMA_IN_PROGRESS?(m=null===(i=null==e?void 0:e.unifi_care)||void 0===i?void 0:i.rma_url,d="DEVICE_ACTIONS_UNIFI_CARE_RMA"):t&&(m=null===(c=null==e?void 0:e.unifi_care)||void 0===c?void 0:c.rma_url,d="DEVICE_ACTIONS_UNIFI_CARE_REPLACE"),!t)return d?r.a.createElement(D.b,{id:d}):null;return r.a.createElement(oe.a,Object.assign({size:"small",variant:"link",onClick:e=>{e.preventDefault(),e.stopPropagation(),window.open(m||"https://"+Object(hl.b)(E),"_blank")}},a),r.a.createElement(D.b,{id:d}))},zb=a(1042);var kb=({device:e,...t})=>{const a=Object(o.useDispatch)(),n=Object(o.useSelector)(Il.c),l=Object(o.useSelector)(zb.selectUnifiCareDetails);return Object(Ta.g)(()=>Promise.resolve(a(Object(zb.fetchUnifiCareDetails)())).catch(()=>{}),r.a.createElement(oe.a,Object.assign({size:"small",variant:"link",onClick:e=>{e.preventDefault(),e.stopPropagation(),window.open(Object(Ol.a)(l,"links.covered_devices_url")||"https://"+Object(hl.b)(n))}},t),r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_VIEW"})))};var Bb=({device:e,...t})=>{const a=Object(o.useSelector)(Il.c);return r.a.createElement(oe.a,Object.assign({size:"small",variant:"link",onClick:t=>{t.preventDefault(),t.stopPropagation();const n=Object(Ol.a)(e,"unifi_care.activation_url");window.open(n||"https://"+Object(hl.b)(a))}},t),r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_ACTIVATE"}))},Wb=a(1047),Gb=a(745);const Hb=Object(i.c)("div")`
  margin-top: 8px;
`,Yb=Object(i.c)("div")`
  &:not(:empty) {
    padding-bottom: 12px;
  }
`,$b=Object(i.c)(y.a)`
  margin-left: 18px;
`,Kb=Object(i.c)(y.a)`
  margin-top: 16px;
  margin-left: -8px;
`,Xb=Object(i.c)(y.a)`
  margin-top: 10px;
  margin-left: -8px;
`,qb=Object(i.c)(Wb.a)`
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid ${({theme:e})=>e.motifPalette.ui04};
`,Zb=Object(i.c)(Ub)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  font-weight: normal;
  padding: 0 8px;
`,Jb=Object(i.c)(kb)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  font-weight: normal;
  padding: 0 8px;
`,Qb=Object(i.c)(Bb)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  font-weight: bold;
  padding: 0 8px;
`,eu=Object(i.c)(wb.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  font-weight: bold;
  padding: 0 8px;
  line-height: 1.15;
`,tu=Object(i.c)(y.a)`
  padding: 17px;
  border: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  border-radius: 8px;
  margin: 16px 32px 24px 32px;
`,au=Object(i.c)(A.a)`
  margin-right: 17px;
`,nu=Object(i.c)(y.a)`
  margin-bottom: 15px;
`;var lu=({device:e,hideWarning:t})=>{const a=Object(o.useDispatch)(),n=Object(Gb.c)(e),i=!n&&Object(Gb.d)(e),c=Object(Gb.a)(e),E=null==c?void 0:c.getTime(),s=i&&c||n&&Object(Gb.b)(e),[m,d]=Object(l.useState)(E-(new Date).getTime()),_=Object(o.useSelector)(ze.z);return Object(l.useEffect)(()=>{let e;return m&&(e=setInterval(()=>{d(E-(new Date).getTime())},200)),()=>e&&clearInterval(e)},[E]),Object(Ta.g)(()=>Promise.resolve(a(Object(zb.fetchUnifiCareDetails)())).catch(()=>{}),r.a.createElement(Hb,null,n&&!t&&r.a.createElement(Yb,null,r.a.createElement($l,{activeItem:e,standalone:!0}),r.a.createElement(Hl,{activeItem:e,standalone:!0})),i&&m>0&&r.a.createElement(tu,{flexDirection:"column"},r.a.createElement(nu,{flexDirection:"row"},r.a.createElement("div",null,r.a.createElement(au,{width:44,height:48})),r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_AVAILABLE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_OFFER_ENDS",values:{eligibleExpirationTime:Object(Fb.a)(Math.floor(m/1e3)).join(" ")}})))),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_AVAILABLE_INFO"})),r.a.createElement(Xb,{flexDirection:"row",alignItems:"center"},_&&r.a.createElement(Qb,{device:e}),r.a.createElement(eu,{href:wn.a.unifiCare,target:"_blank"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_LEARN_MORE"})))),n&&r.a.createElement(y.a,{flexDirection:"row",alignItems:"flex-start"},r.a.createElement("div",null,r.a.createElement(A.a,{width:54,height:54})),r.a.createElement($b,{flexDirection:"column"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE_ACTIVE_INFO"})),r.a.createElement(Kb,{flexDirection:"row",alignItems:"center"},r.a.createElement(Jb,{device:e}),r.a.createElement(Zb,{isOwner:_,device:e})),s&&r.a.createElement(qb,{expires:s})))))};const ru=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var iu=({activeItem:e,...t})=>{const a=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),n=!Object(ve.hasActiveUnifiCare)(e)&&Object(ve.isUnifiCareEligible)(e);return r.a.createElement(r.a.Fragment,null,n&&r.a.createElement(lu,{device:e,hideWarning:!0}),r.a.createElement(nr,{device:e}),a&&r.a.createElement(r.a.Fragment,null,r.a.createElement(xl,{activeItem:e}),r.a.createElement(ru,{variant:"secondary",items:[{id:"clients",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS_AND_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({hideSignalTab:!0,activeItem:e},t))},{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),renderContent:()=>r.a.createElement(jb,{activeItem:e})},...Ab(e),{id:"downlinks",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))},{id:"networks",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Vb,{activeItem:e})},...Object(ve.hasActiveUnifiCare)(e)?[{id:"unifiCare",label:r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE"}),renderContent:()=>r.a.createElement(lu,{device:e,hideWarning:!0})}]:[],{id:"statistics",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"}),renderContent:()=>r.a.createElement(Nb,{activeItem:e,forUdmPro:!0})}],multiOpen:!0,renderOnlyExpandedContent:!0})))};const cu=Object(i.c)(y.a)`
  margin-bottom: 24px;
`,ou=Object(i.c)(y.a)`
  margin-bottom: 8px;
`,Eu=Object(i.c)(T.a)`
  display: flex;
  flex: 1;
  margin-right: 12px;
`,su=i.a`
  margin-left: 11px;
`,mu=Object(i.c)(h.cb)`
  margin: 0 6px;
`,du=Object(i.c)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,_u=e=>({hour:Number(e.split(":")[0]),min:Number(e.split(":")[1])}),bu=e=>`${e.hour.toString().padStart(2,"0")}:${e.min.toString().padStart(2,"0")}`,uu=Object(Ve.f)({isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:{lcm_brightness:t=ve.DEFAULT_LCM_BRIGHTNESS,lcm_brightness_override:a=!1,lcm_night_mode_begins:n=ve.DEFAULT_LCM_NIGHT_MODE_BEGINS,lcm_night_mode_ends:l=ve.DEFAULT_LCM_NIGHT_MODE_ENDS}})=>({lcm:e,lcm_brightness:t,lcm_brightness_override:a,lcm_night_mode_begins:_u(n),lcm_night_mode_ends:_u(l)}),validationSchema:Fe.a.object().shape({lcm:Fe.a.object().shape({sync:Fe.a.boolean()}),lcm_brightness_override:Fe.a.boolean(),lcm_brightness:Fe.a.number().label("DEVICE_PROPERTIES_LABEL_SCREEN_BRIGHTNESS").min(0).max(100).required(),lcm_night_mode_begins:Fe.a.object().shape({hour:Fe.a.number(),min:Fe.a.number()}),lcm_night_mode_ends:Fe.a.object().shape({hour:Fe.a.number(),min:Fe.a.number()})}),handleSubmit:()=>null}),Ou={saveSettings:_i.saveSettings};var pu=Object(en.compose)(Object(o.connect)(e=>({lcmSettings:Object(_i.selectLcmSettings)(e)}),Ou),uu)(({values:e,setFieldValue:t,resetForm:a,setFormDirty:n,setFormInvalid:i,dirty:c,isValid:E,initialValues:s})=>{const m=Object(o.useDispatch)(),d=Object(o.useSelector)(ze.s);return Object(l.useEffect)(()=>{n("lcmScreen",c),i("lcmScreen",!E)},[n,i,E,c]),Object(l.useEffect)(()=>(m(Object(v.h)({lcmScreen:()=>({...e,lcm_brightness_override:e.lcm_brightness!==ve.DEFAULT_LCM_BRIGHTNESS,lcm_night_mode_begins:bu(e.lcm_night_mode_begins),lcm_night_mode_ends:bu(e.lcm_night_mode_ends)})})),m(Object(v.j)({lcmScreen:()=>{Object(G_.a)(s.lcm,e.lcm)||m(Object(_i.saveSettings)(e.lcm)),a({values:e})}})),m(Object(v.i)({lcmScreen:a})),()=>{m(Object(v.h)({lcmScreen:null})),m(Object(v.j)({lcmScreen:null})),m(Object(v.i)({lcmScreen:null}))}),[m,a,e]),r.a.createElement(r.a.Fragment,null,r.a.createElement(ou,null,r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_SCREEN_BRIGHTNESS"}))),r.a.createElement(cu,null,r.a.createElement(Jo.a,{size:"large",value:e.lcm_brightness||ve.DEFAULT_LCM_BRIGHTNESS,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:e=>r.a.createElement(T.a,{size:"body"},e,"%"),onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:d})),r.a.createElement(cu,{flexDirection:"column"},r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"}))),r.a.createElement(cu,{justifyContent:"space-between"},r.a.createElement(du,null,r.a.createElement(He.Field,{type:"timeInput",label:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_BEGINS",name:"lcm_night_mode_begins",full:!0})),r.a.createElement(du,null,r.a.createElement(He.Field,{type:"timeInput",label:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_ENDS",name:"lcm_night_mode_ends",full:!0}))),r.a.createElement(cu,{justifyContent:"space-between"},r.a.createElement(Eu,{color:"primary",size:"body"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION"})),r.a.createElement(cn.a,{portal:!0,tooltipClassName:su,position:"topRight",width:200,message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})},r.a.createElement(mu,{isActive:!0}))),r.a.createElement(He.Field,{type:"checkbox",name:"lcm.sync"})))});const Iu=Object(i.c)(y.a,{shouldForwardProp:e=>!["marginTop","marginBottom"].includes(e)})`
  width: 100%;
  margin-top: ${({marginTop:e})=>e||0}px;
  margin-bottom: ${({marginBottom:e})=>e||0}px;
  justify-content: space-between;
  align-items: center;
`,gu=Object(i.c)(h.cb)`
  margin-right: auto;
  margin-left: 5px;
  height: 14px;
  width: 14px;
`,vu=Object(i.c)(cn.a)`
  margin-left: 0 !important;
`,Cu=Object(i.c)("div")`
  display: flex;

  > label:not(:first-child) {
    margin-left: 18px;
  }
`,Ru=r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING_VALIDATION_LABEL",values:{min:_i.USG_DEFAULTS.min_mss_clamp_mss,max:_i.USG_DEFAULTS.mss_clamp_mss}}),Tu=Object(Ve.f)({mapPropsToValues:({usgSettings:{mss_clamp_mss:e,mss_clamp:t,arp_cache_timeout:a,arp_cache_base_reachable:n,echo_server:l},activeItem:{jumboframe_enabled:r=!1,flowctrl_enabled:i=!1}})=>({jumboframe_enabled:r,flowctrl_enabled:i,usgSettings:{mss_clamp:t||_i.USG_DEFAULTS.mss_clamp,mss_clamp_mss:e||_i.USG_DEFAULTS.mss_clamp_mss,arp_cache_timeout:a||"normal",arp_cache_base_reachable:n||_i.USG_DEFAULTS.arp_cache_base_reachable,echo_server:l||_i.USG_DEFAULTS.echo_server}}),validationSchema:tn.a.object().shape({jumboframe_enabled:tn.a.boolean(),flowctrl_enabled:tn.a.boolean(),usgSettings:tn.a.object().shape({mss_clamp:tn.a.string(),mss_clamp_mss:tn.a.number().when("mss_clamp",{is:_i.MssClamp.CUSTOM,then:tn.a.number().label("DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING").required().min(_i.USG_DEFAULTS.min_mss_clamp_mss,Ru).max(_i.USG_DEFAULTS.mss_clamp_mss,Ru)}),arp_cache_timeout:tn.a.string(),arp_cache_base_reachable:tn.a.number().when("arp_cache_timeout",{is:"custom",then:tn.a.number().label("DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT").required().min(1).max(_i.USG_DEFAULTS.max_arp_cache_base_reachable)}),echo_server:tn.a.string().label("DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME").required().matches(rn.g,{message:r.a.createElement(D.b,{id:"COMMON_VALIDATION_HOSTNAME_OR_IPV4",values:{name:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME"})}})}).matches(rn.b,{message:r.a.createElement(D.b,{id:"COMMON_VALIDATION_ECHO_SERVER",values:{name:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ECHO_SERVER"})}})})})}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}});var hu=Object(en.compose)(Object(o.connect)(e=>({usgSettings:Object(_i.selectUsgSettings)(e)})),Tu)(({values:e,dirty:t,isValid:a,setFormInvalid:n,resetForm:i,setFormDirty:c,setFieldValue:E,errors:s,activeItem:m})=>{var d;const _=Object(o.useDispatch)(),b=Object(Uo.h)(m);Object(l.useEffect)(()=>{const{usgSettings:t,...a}=e;_(Object(v.h)({services:()=>a})),_(Object(v.j)({services:()=>{_(Object(_i.saveSettings)({key:_i.USG_DEFAULTS.key,...t})),i({values:e})}})),_(Object(v.i)({services:i}))},[e]),Object(l.useEffect)(()=>{c("services",t),n("services",!a)},[t,a,c,n]);const u=e=>{e.target.checked&&E("usgSettings.mss_clamp",e.target.name)},O=e=>{e.target.checked&&E("usgSettings.arp_cache_timeout",e.target.name)},p=e=>{e.target.checked&&("echoServerIpOrHostname"===e.target.name?E("usgSettings.echo_server",""):E("usgSettings.echo_server",e.target.name))};return r.a.createElement(r.a.Fragment,null,r.a.createElement(Iu,{marginBottom:10},r.a.createElement(T.a,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_MSS_CLAMPING"}))),r.a.createElement(Iu,{marginBottom:24},r.a.createElement(Cu,null,r.a.createElement(nb.a,{id:"mssClampingAuto",checked:e.usgSettings.mss_clamp===_i.MssClamp.AUTO,name:_i.MssClamp.AUTO,onChange:u},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_MSS_CLAMPING_AUTO"})),r.a.createElement(nb.a,{id:"mssClampingCustom",checked:e.usgSettings.mss_clamp===_i.MssClamp.CUSTOM,name:_i.MssClamp.CUSTOM,onChange:u},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_MSS_CLAMPING_CUSTOM"})),r.a.createElement(nb.a,{id:"mssClampingDisabled",checked:e.usgSettings.mss_clamp===_i.MssClamp.DISABLED,name:_i.MssClamp.DISABLED,onChange:u},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_MSS_CLAMPING_DISABLED"})))),e.usgSettings.mss_clamp===_i.MssClamp.CUSTOM&&r.a.createElement(Iu,{marginBottom:24,alignItems:"flex-start",flexDirection:"column"},r.a.createElement(He.Field,{full:!0,variant:"secondary",placeholder:"DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING_PLACEHOLDER",label:"DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING",name:"usgSettings.mss_clamp_mss"})),!!(null===(d=null==s?void 0:s.usgSettings)||void 0===d?void 0:d.mss_clamp_mss)&&r.a.createElement(y.a,{marginBottom:"16px"}),r.a.createElement(Iu,{marginBottom:10},r.a.createElement(T.a,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT"}))),r.a.createElement(Iu,{marginBottom:24},r.a.createElement(Cu,null,r.a.createElement(nb.a,{id:"normal",checked:"normal"===e.usgSettings.arp_cache_timeout,name:"normal",onChange:O},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_NORMAL"})),r.a.createElement(nb.a,{id:"min-dhcp-lease",checked:"min-dhcp-lease"===e.usgSettings.arp_cache_timeout,name:"min-dhcp-lease",onChange:O},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_MIN_DHCP_LEASE"})),r.a.createElement(nb.a,{id:"custom",checked:"custom"===e.usgSettings.arp_cache_timeout,name:"custom",onChange:O},r.a.createElement(D.b,{id:"COMMON_LABEL_CUSTOM"})),r.a.createElement(vu,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT_CUSTOM_TOOLTIP"}),width:180,position:"left"},r.a.createElement(gu,{isActive:!0})))),"custom"===e.usgSettings.arp_cache_timeout&&r.a.createElement(Iu,{marginBottom:24,alignItems:"flex-start",flexDirection:"column"},r.a.createElement(He.Field,{full:!0,variant:"secondary",label:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT_LABEL",placeholder:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT_PLACEHOLDER",name:"usgSettings.arp_cache_base_reachable",type:"number"})),b&&r.a.createElement(Iu,{marginBottom:24},r.a.createElement(T.a,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_JUMBO_FRAME"})),r.a.createElement(He.Field,{label:"DEVICE_PROPERTIES_VALUES_ENABLE_JUMBO_FRAME",name:"jumboframe_enabled",type:"checkbox"})),!1,r.a.createElement(Iu,{marginBottom:10},r.a.createElement(T.a,{weight:"bold",color:"primary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ECHO_SERVER"}))),r.a.createElement(Iu,{marginBottom:0},r.a.createElement(Cu,null,r.a.createElement(nb.a,{id:"echoServerDefault",checked:e.usgSettings.echo_server===_i.USG_DEFAULTS.echo_server,name:_i.USG_DEFAULTS.echo_server,onChange:p},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_DEFAULT"})),r.a.createElement(nb.a,{id:"echoServerIpOrHostname",checked:e.usgSettings.echo_server!==_i.USG_DEFAULTS.echo_server,name:"echoServerIpOrHostname",onChange:p},r.a.createElement(D.b,{id:"COMMON_LABEL_CUSTOM"})),r.a.createElement(vu,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME_TOOLTIP"}),width:180},r.a.createElement(gu,{isActive:!0})))),e.usgSettings.echo_server!==_i.USG_DEFAULTS.echo_server&&r.a.createElement(Iu,{marginBottom:0,marginTop:24,alignItems:"flex-start",flexDirection:"column"},r.a.createElement(He.Field,{full:!0,variant:"secondary",label:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_PLACEHOLDER",name:"usgSettings.echo_server"})))});const Du=Object(i.c)(y.a)`
  padding: 0 32px;
`;var Pu=Object(en.compose)(Qa(["general","lcmScreen","services"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c,...E})=>{Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);const s=Object(o.useSelector)(Tr),m=Object(o.useSelector)(hr),d=Object(o.useSelector)(Dr),{_id:_,mac:b}=e,u=Object(o.useDispatch)(),O=!Object(Uo.a)(e,ve.FIRMWARE_CAPS.UTERM);return r.a.createElement(r.a.Fragment,null,r.a.createElement(Du,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"lcmScreen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(hu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e,disableDebug:O,disableForget:!0})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:i,onFormSubmit:()=>{const e=Object.entries(s).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...a}=e;u(Object(ve.updateDeviceWithIdEndpoint)(a,_,b,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(m).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(d).forEach(e=>{"function"==typeof e&&e()})}}))}),yu=a(734);const fu=Object(i.c)(h.I)`
  margin: 2px;
`;var Su={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:iu},ports:{path:"/ports",title:"DEVICE_PROPERTY_HEADER_PORTS",icon:()=>r.a.createElement(fu,null),component:Db,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,activeItem:t,...a})=>{switch(e.subPanel){case"ports":return e.subPanelId===jt.b.WAN?r.a.createElement(yu.a,Object.assign({params:e,activeItem:t},a)):r.a.createElement(e_,Object.assign({params:e,activeItem:t},a));default:return r.a.createElement(r.a.Fragment,null)}}}},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:Pu}}};const Au=Object(i.c)("div")`
  &:not(:last-child) {
    margin-bottom: ${({theme:e})=>e.spacing["spacing-l"]};
  }
`,Nu=Object(i.c)(T.a)`
  margin-bottom: ${({theme:e})=>e.spacing["spacing-s"]};
`,ju=Object(i.c)("div")`
  margin-bottom: 16px;
`;function Lu({activeItem:e}){return r.a.createElement(Au,null,r.a.createElement(Nu,{color:"primary",weight:"bold",size:"body"},r.a.createElement(D.a,{id:"DEVICE_HEADER_RADIO2G_SHORT"})),r.a.createElement(b_,{activeItem:e,radioType:eo.b.RADIO_NG}),r.a.createElement(ju,null),r.a.createElement(Nu,{color:"primary",weight:"bold",size:"body"},r.a.createElement(D.a,{id:"DEVICE_HEADER_RADIO5G_SHORT"})),r.a.createElement(b_,{activeItem:e,radioType:eo.b.RADIO_NA}))}const xu=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`,Mu=i.a`
  padding: 0;
  margin: 0;
`;var Vu=function({activeItem:e,...t}){const a=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),n=rm(e),i=Object(o.useSelector)(ve.selectIsUdr),c=[{id:"clients",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_CLIENTS_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({activeItem:e},t))},{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(jb,{activeItem:e})},...Ab(e),{id:"radios",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_AIR_STATS"}),renderContent:()=>r.a.createElement(Lu,{activeItem:e})},{id:"apGroups",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_AP_GROUP"}),renderContent:()=>r.a.createElement(Km,null)},{id:"downlinks",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Vb,Object.assign({activeItem:e},t))}];return n.length&&c.push({id:"channelUsage",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CHANNEL_USAGE"}),renderContent:()=>r.a.createElement(om,{ChannelBars:n})}),Object(ve.isDeviceConnected)(e)&&Object(Uo.e)(e,ve.WIFI_CAPS.RF_SCAN)&&c.push({id:"rfEvironment",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_RF_ENVIRONMENT"}),renderContent:()=>r.a.createElement($s,{activeItem:e})}),a&&c.push({id:"statistics",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"}),renderContent:()=>r.a.createElement(Nb,Object.assign({activeItem:e,hasApCapabilities:!0},t,{disableUsageChart:i}))}),r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),a&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Cc,{activeItem:e}),r.a.createElement(xl,{activeItem:e}),r.a.createElement(xu,{variant:"secondary",items:c,contentClassName:Mu,multiOpen:!0,renderOnlyExpandedContent:!0})))};const wu=i.a`
  padding: 0;
  margin: 0;
`;var Fu=Object(en.compose)(Qa(["general","screen","services"]),D.e)((function({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c,...E}){var s,m,d,_;const b=Object(o.useSelector)(Tr),u=Object(o.useSelector)(hr),O=Object(o.useSelector)(Dr),p=Object(o.useSelector)(Fo.o),I=Object(o.useSelector)(Fo.D),g=Object(o.useSelector)(Fo.d),{_id:v,mac:C}=e,[R,T]=Object(l.useState)(!(null===(s=p.ap_exclusions)||void 0===s?void 0:s.includes(C))),[h,P]=Object(l.useState)(I.enabled&&!(null===(m=I.exclude_devices)||void 0===m?void 0:m.includes(C))),f=Object(o.useDispatch)(),S=!Object(Uo.a)(e,ve.FIRMWARE_CAPS.UTERM),A=n||R!==!(null===(d=p.ap_exclusions)||void 0===d?void 0:d.includes(e.mac))||h!==(I.enabled&&!(null===(_=I.exclude_devices)||void 0===_?void 0:_.includes(e.mac))),N=Object(l.useCallback)(async()=>{var e,t;try{const a=[];if(R!==!(null===(e=p.ap_exclusions)||void 0===e?void 0:e.includes(C))){const e=p.ap_exclusions.filter(e=>e!==C);R||e.push(C),a.push({...p,ap_exclusions:e})}if(I.enabled&&h!==!(null===(t=I.exclude_devices)||void 0===t?void 0:t.includes(C))){const e=I.exclude_devices.filter(e=>e!==C);h||e.push(C),a.push({...I,exclude_devices:e,settings_preference:"auto"})}a.length&&await f(Object(wo.k)(a))}catch(n){return void f(Object(je.a)({icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}const a=Object.entries(b).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});f(Object(ve.updateDeviceWithIdEndpoint)(a,v,C,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(({data:e=[a]})=>{Object.values(u).forEach(t=>{"function"==typeof t&&t(e[0])})})},[v,f,b,p,R,h,C,u,I]),j=Object(l.useCallback)(()=>{Object.values(O).forEach(e=>{"function"==typeof e&&e()})},[O]),L=[{id:"radios",label:r.a.createElement(D.b,{id:"COMMON_RADIOS"}),renderContent:()=>r.a.createElement(zE,{activeItem:e,setFormDirty:t,setFormInvalid:a,isWirelessMeshingEnabled:g,isGlobalApSettingsEnabled:R,isChannelOptimizationEnabled:h})},{id:"screen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(lE,{activeItem:e,setFormDirty:t})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(hu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e,disableDebug:S,disableForget:!0})}];return(Object(ve.hasActiveUnifiCare)(e)||Object(ve.isUnifiCareEligible)(e))&&(L.forEach(e=>{e.openByDefault=!1}),L.unshift({id:"unifiCare",label:r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE"}),renderContent:()=>r.a.createElement(lu,{device:e}),openByDefault:!0})),Object(Uo.g)(e)&&"bandsteer"!==L[2].id&&L.splice(2,0,{id:"bandsteer",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_BAND_STEERING"}),renderContent:()=>r.a.createElement(BE,{activeItem:e,setFormDirty:t})}),r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%",padding:"20px 32px 0"},r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a}),r.a.createElement($E,{isGlobalApSettingsEnabled:R,setGlobalApSettingsEnabled:T,isChannelOptimizationEnabled:h,setChannelOptimizationEnabled:P,disableChannelOptimization:!I.enabled}),r.a.createElement(ga.a,{variant:"secondary",renderOnlyExpandedContent:!0,items:L,contentClassName:wu,multiOpen:!0})),r.a.createElement(Ar.a,{isDirty:A,isInvalid:i,onFormSubmit:N,onFormCancel:j}))}));const Uu=Object(i.c)(h.I)`
  margin: 2px;
`;var zu={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:Vu},ports:{path:"/ports",title:"DEVICE_PROPERTY_HEADER_PORTS",icon:()=>r.a.createElement(Uu,null),component:Db,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,activeItem:t,...a})=>{switch(e.subPanel){case"ports":return e.subPanelId===jt.b.WAN?r.a.createElement(yu.a,Object.assign({params:e,activeItem:t},a)):r.a.createElement(e_,Object.assign({params:e,activeItem:t},a));default:return r.a.createElement(r.a.Fragment,null)}}}},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:Fu}}};var ku=({activeItem:{ip:e,satisfaction:t,uptime:a,lan_ip:n},activeItem:l})=>{var i,c;const o=Object(ve.getDeviceIp)(l),{na:E,ng:s,naNumSta:m,ngNumSta:d}=Object(ve.getSatisfactionByRadio)(l),_=Object(wt.d)(t);return r.a.createElement(y.a,{flexDirection:"column"},_&&r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_WIFI_EXPERIENCE_2G"})),d&&0!==s?r.a.createElement(ta.a,{size:"body",type:"percent",input:Math.min(s,100)/100,style:{color:Ia.a["color-"+Object(wt.c)(Math.min(s||0,100))]}}):r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_WIFI_EXPERIENCE_5G"})),m&&0!==E?r.a.createElement(ta.a,{size:"body",type:"percent",input:Math.min(E,100)/100,style:{color:Ia.a["color-"+Object(wt.c)(Math.min(E||0,100))]}}):r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_NA"})))),(null===(i=null==l?void 0:l.wan1)||void 0===i?void 0:i.ip)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS_INDEXED",values:{wanIndex:1}})),r.a.createElement(T.a,{size:"body"},l.wan1.ip)),(null===(c=null==l?void 0:l.wan2)||void 0===c?void 0:c.ip)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS_INDEXED",values:{wanIndex:2}})),r.a.createElement(T.a,{size:"body"},l.wan2.ip)),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LAN_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},o)),a>0&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(T.a,{size:"body"},Object(ll.a)(a))),r.a.createElement(cl,{activeItem:l}),r.a.createElement(ml,{activeItem:l}),r.a.createElement(Zc,{activeItem:l}),r.a.createElement(Jc,{activeItem:l}))};var Bu=({activeItem:e})=>{const t=Object(ve.getPsusStatusText)(e).map(({status:e,statusColor:t,source:a,id:n},l)=>r.a.createElement(la,{key:n},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,Object.assign({id:a},"DEVICE_USW_MC_PSU_AC_POWER"===a&&{values:{psuIndex:l+1}}))),r.a.createElement(T.a,{size:"body",color:t},r.a.createElement(D.b,{id:e}))));return r.a.createElement(r.a.Fragment,null,t)},Wu=a(332),Gu=a.n(Wu);const Hu=Object(i.c)("div")`
  margin-right: 14px;

  > * {
    position: relative;

    &:after {
      position: absolute;
      height: 12px;
      top: 5px;
      right: -8px;
      bottom: 2px;
      width: 1px;
      background: ${({theme:e})=>e.motifPalette.neutral04};
      content: '';
    }
  }
`,Yu=Object(i.c)("div")`
  margin-bottom: 16px;
`;var $u=({psuTable:e})=>{const t=Object(l.useMemo)(()=>e.map(({power:e})=>{const t=Math.ceil(parseFloat(e)/550*100);return{variant:Object(ve.getPsuUtilizationColorVariant)(t),value:t}}),[e]);return r.a.createElement(y.a,{flexDirection:"column",marginBottom:48},t.map((t,a)=>{var n;const l=Gu()(),i=null===(n=null==e?void 0:e[a])||void 0===n?void 0:n.power;return r.a.createElement(Yu,{key:l},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{color:"primary",weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_USW_MC_PSU_AC_POWER",values:{psuIndex:a+1}})),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(Hu,null,r.a.createElement(T.a,{color:"primary",size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Math.ceil(parseFloat(i))+"/550"}}))),r.a.createElement(ta.a,{size:"body",color:e[a].online?t.variant:"disabled",type:"percent",input:t.value/100}))),r.a.createElement(Ks.a,{items:[t],height:10}))}))};const Ku=Object(i.c)("div")`
  margin-top: ${({theme:e})=>e.spacing["spacing-xxxxxl"]};
`;var Xu=function({activeItem:e}){const t=rm(e);return r.a.createElement(r.a.Fragment,null,e.psu_table.length?r.a.createElement($u,{psuTable:e.psu_table}):null,t.length?r.a.createElement(om,{ChannelBars:t}):null,Object(ve.isDeviceConnected)(e)&&Object(Uo.e)(e,ve.WIFI_CAPS.RF_SCAN)?r.a.createElement(Ku,null,r.a.createElement($s,{activeItem:e})):null)};const qu=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`,Zu=i.a`
  padding: 0;
  margin: 0;
`;var Ju=function({activeItem:e,...t}){var a;const n=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),n&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Cc,{activeItem:e}),r.a.createElement(xl,{activeItem:e}),r.a.createElement(qu,{variant:"secondary",items:[{id:"clients",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_CLIENTS_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({hideSignalTab:!0,activeItem:e},t))},{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(ku,{activeItem:e})},...Ab(e),{id:"radios",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_AIR_STATS"}),renderContent:()=>r.a.createElement(Lu,{activeItem:e})},{id:"apGroups",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_AP_GROUP"}),renderContent:()=>r.a.createElement(Km,null)},{id:"downlinks",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))},...(null===(a=e.psu_table)||void 0===a?void 0:a.length)>0&&[{id:"powerSource",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_SOURCE"}),renderContent:()=>r.a.createElement(Bu,{activeItem:e})}],{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Vb,{activeItem:e})},{id:"insights",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_INSIGHTS"}),renderContent:()=>r.a.createElement(Xu,Object.assign({activeItem:e},t))}],contentClassName:Zu,multiOpen:!0,renderOnlyExpandedContent:!0})))};const Qu=i.a`
  padding: 0;
  margin: 0;
`;var eO=Object(en.compose)(Qa(["general","lcmScreen","services"]),D.e)((function({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c,...E}){var s,m,d,_;const b=Object(o.useSelector)(Tr),u=Object(o.useSelector)(hr),O=Object(o.useSelector)(Dr),p=Object(o.useSelector)(Fo.o),I=Object(o.useSelector)(Fo.D),g=Object(o.useSelector)(Fo.d),{_id:v,mac:C}=e,[R,T]=Object(l.useState)(!(null===(s=p.ap_exclusions)||void 0===s?void 0:s.includes(C))),[h,P]=Object(l.useState)(I.enabled&&!(null===(m=I.exclude_devices)||void 0===m?void 0:m.includes(C))),f=Object(o.useDispatch)(),S=!Object(Uo.a)(e,ve.FIRMWARE_CAPS.UTERM),A=n||R!==!(null===(d=p.ap_exclusions)||void 0===d?void 0:d.includes(e.mac))||h!==(I.enabled&&!(null===(_=I.exclude_devices)||void 0===_?void 0:_.includes(e.mac))),N=Object(l.useCallback)(async()=>{var e,t;try{const a=[];if(R!==!(null===(e=p.ap_exclusions)||void 0===e?void 0:e.includes(C))){const e=p.ap_exclusions.filter(e=>e!==C);R||e.push(C),a.push({...p,ap_exclusions:e})}if(I.enabled&&h!==!(null===(t=I.exclude_devices)||void 0===t?void 0:t.includes(C))){const e=I.exclude_devices.filter(e=>e!==C);h||e.push(C),a.push({...I,exclude_devices:e,settings_preference:"auto"})}a.length&&await f(Object(wo.k)(a))}catch(n){return void f(Object(je.a)({icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}const a=Object.entries(b).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});f(Object(ve.updateDeviceWithIdEndpoint)(a,v,C,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(({data:e=[a]})=>{Object.values(u).forEach(t=>{"function"==typeof t&&t(e[0])})})},[v,f,b,p,R,h,C,u,I]),j=Object(l.useCallback)(()=>{Object.values(O).forEach(e=>{"function"==typeof e&&e()})},[O]),L=[{id:"radios",label:r.a.createElement(D.b,{id:"COMMON_RADIOS"}),renderContent:()=>r.a.createElement(zE,{activeItem:e,setFormDirty:t,setFormInvalid:a,isWirelessMeshingEnabled:g,isGlobalApSettingsEnabled:R,isChannelOptimizationEnabled:h})},{id:"lcmScreen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(hu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e,disableDebug:S,disableForget:!0})}];return Object(Uo.g)(e)&&"bandsteer"!==L[2].id&&L.splice(2,0,{id:"bandsteer",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_BAND_STEERING"}),renderContent:()=>r.a.createElement(BE,{activeItem:e,setFormDirty:t})}),r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%",padding:"20px 32px 0"},r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a}),r.a.createElement($E,{isGlobalApSettingsEnabled:R,setGlobalApSettingsEnabled:T,isChannelOptimizationEnabled:h,setChannelOptimizationEnabled:P,disableChannelOptimization:!I.enabled}),r.a.createElement(ga.a,{variant:"secondary",renderOnlyExpandedContent:!0,items:L,contentClassName:Qu,multiOpen:!0})),r.a.createElement(Ar.a,{isDirty:A,isInvalid:i,onFormSubmit:N,onFormCancel:j}))}));const tO=Object(i.c)("div")`
  padding: 0 32px 40px 32px;
`;var aO=({activeItem:e})=>{const t=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,t&&r.a.createElement(Um,{deviceData:e}),r.a.createElement(tO,null,r.a.createElement(Cm,{activeItem:e})))};var nO={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:Ju},ports:{path:"/ports",title:"DEVICE_PROPERTY_HEADER_PORTS",icon:h.I,component:aO,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,activeItem:t,...a})=>"ports"===e.subPanel&&e.subPanelId===jt.b.WAN?r.a.createElement(yu.a,Object.assign({params:e,activeItem:t},a)):r.a.createElement(e_,Object.assign({params:e,activeItem:t},a))}},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:eO}}};var lO=({activeItem:{displayable_version:e},flexProps:t})=>e?r.a.createElement(la,{flexProps:t},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_VERSION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e)):null;const rO=Object(i.c)("div")`
  display: flex;
  height: 100%;
  flex-direction: column;
`;function iO({activeItem:{uptime:e,lan_ip:t,ip:a},activeItem:n}){const l=t||a,i=Object(yb.h)(n);return r.a.createElement(rO,null,r.a.createElement(lO,{activeItem:n}),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_LAN_IP_ADDRESS"})),r.a.createElement(T.a,{size:"body"},l)),e>0&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(T.a,{size:"body"},Object(ll.c)(e,!0))),i.boardPhy&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_GATEWAY_BOARD_PHY"})),r.a.createElement(T.a,{size:"body"},i.boardPhy)),i.boardCpu&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_GATEWAY_BOARD_CPU"})),r.a.createElement(T.a,{size:"body"},i.boardCpu)),i.cpu&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_CPU"})),r.a.createElement(T.a,{size:"body"},i.cpu)),i.phy&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_PHY"})),r.a.createElement(T.a,{size:"body"},i.phy)))}const cO=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;function oO({activeItem:e,...t}){const[a]=Object(l.useState)("SwitchPorts-"+Date.now()),n=Object(o.useDispatch)(),i={style:gm.a.overflow,styleName:"overflow",dependant:a};Object(l.useEffect)(()=>(n(Object(Im.c)(i)),()=>{n(Object(Im.b)(i))}),[]);const c=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),E=Object(ve.isUxg)(e);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),c&&r.a.createElement(r.a.Fragment,null,r.a.createElement(xl,{activeItem:e}),r.a.createElement(cO,{variant:"secondary",items:[...E?[{id:"clients",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS_AND_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({hideSignalTab:!0,activeItem:e},t))}]:[],{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(iO,{activeItem:e})},...Ab(e),...E?[{id:"downlinks",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))}]:[],{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Vb,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})))}var EO=({activeItem:e})=>{const t=Object(o.useDispatch)();return Object(l.useEffect)(()=>{t(Object(Kn.fetchDeviceUsageReport)(e.mac,Kn.OBJECT.GW))},[e.mac,t]),r.a.createElement(Ir,{gwMac:e.mac,keys:["mem","cpu"],heading:"DEVICE_GATEWAY_USAGE_STAT_CHART_HEADER"})};const sO=Object(i.c)(y.a)`
  padding: 16px 32px;
`,mO=Object(i.c)("div")`
  margin-bottom: 16px;
`;var dO=({activeItem:e})=>r.a.createElement(sO,{flexDirection:"column"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"})),r.a.createElement(mO,null),r.a.createElement(EO,{activeItem:e})),_O=a(865);const bO=Object(i.c)("div")`
  position: relative;
  margin: 0 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.neutral02};

  &:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
  }

  .tooltip-position-fixer {
    margin-right: -16px;
  }
`,uO=Object(i.c)(bO)`
  margin: 0 0 12px;
  padding-bottom: 8px;
  width: 100%;
`,OO=({actionName:e,Button:t,whiteOutActive:a})=>r.a.createElement(uO,null,a&&r.a.createElement(Ii,null),r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(y.a,{justifyContent:"flex-end"},t),r.a.createElement(cn.a,{message:r.a.createElement(D.b,{id:`DEVICE_ACTIONS_${e}_INFO`}),width:210,tooltipClassName:"tooltip-position-fixer"},r.a.createElement(h.cb,{isActive:!0,omitSvgMargin:!0}))));var pO=({activeItem:e})=>{const t=Object(o.useSelector)(t=>Object(ve.selectDeviceData)(t,e.mac)),a=Object(ve.getRawDeviceState)(t)===ve.DeviceState.UPGRADING;return r.a.createElement(r.a.Fragment,null,(Object(ve.hasActiveUnifiCare)(t)||Object(ve.isUnifiCareEligible)(t))&&r.a.createElement(bO,null,r.a.createElement(D.b,{id:"DEVICE_ACTIONS_UNIFI_CARE"}),r.a.createElement(lu,{device:t})),r.a.createElement(bO,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_CUSTOM_UPGRADE_LABEL"})),r.a.createElement(Ri,{device:t,whiteOutActive:a})),r.a.createElement(OO,{actionName:"LOCATE",Button:r.a.createElement($r,{device:t})}),r.a.createElement(OO,{actionName:"RESTART",Button:r.a.createElement(qr,{device:t})}),r.a.createElement(OO,{actionName:"PROVISION",Button:r.a.createElement(Jr,{device:t}),whiteOutActive:a}),r.a.createElement(y.a,{marginTop:"32px",marginBottom:"-8px"},r.a.createElement(OO,{actionName:"FORGET",Button:r.a.createElement(Ge,{device:t})})))},IO=a(274),gO=a(2611),vO=a(63);const CO=Object(i.c)("div")`
  width: 100%;
  margin-top: ${e=>e.marginTop||0}px;
  margin-bottom: ${e=>e.marginBottom||0}px;
  display: flex;
  justify-content: space-between;
  align-items: center;
`,RO=Object(i.c)(IO.a)`
  color: ${({theme:e})=>e.motifPalette.text02};
  opacity: 0.4;
  margin-right: auto;
`,TO=Object(i.c)(h.cb)`
  margin-right: auto;
  margin-left: 5px;
  height: 14px;
  width: 14px;
`,hO=Object(i.c)(cn.a)`
  margin-left: 0 !important;
`,DO=i.a`
  flex-direction: column;
  align-items: flex-start;
`,PO=Object(i.c)("div")`
  display: flex;

  > label:not(:first-child) {
    margin-left: 18px;
  }
`,yO=r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING_VALIDATION_LABEL",values:{min:_i.USG_DEFAULTS.min_mss_clamp_mss,max:_i.USG_DEFAULTS.mss_clamp_mss}});var fO=Object(Ve.f)({isInitialValid:!0,mapPropsToValues:({usgSettings:{key:e,mss_clamp_mss:t,mss_clamp:a,offload_accounting:n,echo_server:l,offload_sch:r,offload_l2_blocking:i,lldp_enable_all:c,arp_cache_timeout:o,arp_cache_base_reachable:E}})=>({key:e,mss_clamp:a||_i.USG_DEFAULTS.mss_clamp,mss_clamp_mss:t||_i.USG_DEFAULTS.mss_clamp_mss,offload_accounting:n||_i.USG_DEFAULTS.offload_accounting,offload_sch:r,offload_l2_blocking:i,echo_server:l||_i.USG_DEFAULTS.echo_server,lldp_enable_all:c,arp_cache_timeout:o||"normal",arp_cache_base_reachable:E||_i.USG_DEFAULTS.arp_cache_base_reachable}),validationSchema:tn.a.object().shape({mss_clamp:tn.a.string(),mss_clamp_mss:tn.a.number().when("mss_clamp",{is:vO.u.CUSTOM,then:tn.a.number().label("DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING").required().min(_i.USG_DEFAULTS.min_mss_clamp_mss,yO).max(_i.USG_DEFAULTS.mss_clamp_mss,yO)}),offload_accounting:tn.a.boolean(),offload_sch:tn.a.boolean(),offload_l2_blocking:tn.a.boolean(),arp_cache_timeout:tn.a.string(),arp_cache_base_reachable:tn.a.number().when("arp_cache_timeout",{is:"custom",then:tn.a.number().label("DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT").required().min(1).max(_i.USG_DEFAULTS.max_arp_cache_base_reachable)}),echo_server:tn.a.string().label("DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME").required().matches(rn.g,{message:r.a.createElement(D.b,{id:"COMMON_VALIDATION_HOSTNAME_OR_IPV4",values:{name:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME"})}})}),lldp_enable_all:tn.a.boolean()}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(e=>{const{values:t,initialValues:a,setFieldValue:n,dirty:i,isValid:c,setFormDirty:E,setFormInvalid:s,resetForm:m,usgSettings:d,activeItem:_,errors:b}=e,u=Object(o.useDispatch)(),O=Object(o.useSelector)(gO.a);Object(l.useEffect)(()=>{u(Object(v.j)({services:()=>{Object(G_.a)(a,t)||u(Object(_i.saveSettings)({key:_i.USG_DEFAULTS.key,...t},_._id,void 0)),m({values:t})}})),u(Object(v.i)({services:m}))},[a,t]),Object(l.useEffect)(()=>{E("services",i),s("services",!c)},[t,d,i,c]);const p=e=>{e.target.checked&&n("mss_clamp",e.target.name)},I=e=>{e.target.checked&&n("arp_cache_timeout",e.target.name)},g=e=>{e.target.checked&&("echoServerIpOrHostname"===e.target.name?n("echo_server",""):n("echo_server",e.target.name))};return r.a.createElement(r.a.Fragment,null,r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_MSS_CLAMPING"}))),r.a.createElement(CO,{marginBottom:16},r.a.createElement(PO,null,r.a.createElement(nb.a,{id:"mssClampingAuto",checked:t.mss_clamp===vO.u.AUTO,name:vO.u.AUTO,onChange:p},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_MSS_CLAMPING_AUTO"}))),r.a.createElement(nb.a,{id:"mssClampingCustom",checked:t.mss_clamp===vO.u.CUSTOM,name:vO.u.CUSTOM,onChange:p},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_MSS_CLAMPING_CUSTOM"}))),r.a.createElement(nb.a,{id:"mssClampingDisabled",checked:t.mss_clamp===vO.u.DISABLED,name:vO.u.DISABLED,onChange:p},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_MSS_CLAMPING_DISABLED"}))))),t.mss_clamp===vO.u.CUSTOM&&r.a.createElement(CO,{marginBottom:12,className:DO},r.a.createElement(RO,{htmlFor:"mss_clamp_mss"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING"}))),r.a.createElement(He.Field,{full:!0,placeholder:"DEVICE_PROPERTIES_LABEL_CUSTOM_MSS_CLAMPING_PLACEHOLDER",name:"mss_clamp_mss",id:"mss_clamp_mss"})),!!(null==b?void 0:b.mss_clamp_mss)&&r.a.createElement(y.a,{marginBottom:"24px"}),r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_HARDWARE_OFFLOAD"}))),r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_HARDWARE_OFFLOAD"})),r.a.createElement(WE.a,{id:"offload_accounting",disabled:!O,onChange:()=>{n("offload_accounting",!t.offload_accounting)},checked:!!O&&t.offload_accounting})),r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_HARDWARE_SCHEDULE"})),r.a.createElement(WE.a,{id:"offload_sch",onChange:()=>{n("offload_sch",!t.offload_sch)},checked:t.offload_sch})),r.a.createElement(CO,{marginBottom:28},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_OFFLOAD_L2_BLOCKING"})),r.a.createElement(WE.a,{id:"offload_l2_blocking",onChange:()=>{n("offload_l2_blocking",!t.offload_l2_blocking)},checked:t.offload_l2_blocking})),r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LLDP"}))),r.a.createElement(CO,{marginBottom:28},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_LLDP_ON_ALL_INTERFACES"})),r.a.createElement(WE.a,{id:"lldp_enable_all",onChange:()=>{n("lldp_enable_all",!t.lldp_enable_all)},checked:t.lldp_enable_all})),r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT"}))),r.a.createElement(CO,{marginBottom:24},r.a.createElement(PO,null,r.a.createElement(nb.a,{id:"normal",checked:"normal"===t.arp_cache_timeout,name:"normal",onChange:I},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_NORMAL"})),r.a.createElement(nb.a,{id:"min-dhcp-lease",checked:"min-dhcp-lease"===t.arp_cache_timeout,name:"min-dhcp-lease",onChange:I},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_MIN_DHCP_LEASE"})),r.a.createElement(nb.a,{id:"custom",checked:"custom"===t.arp_cache_timeout,name:"custom",onChange:I},r.a.createElement(D.b,{id:"COMMON_LABEL_CUSTOM"})),r.a.createElement(hO,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT_CUSTOM_TOOLTIP"}),width:180,position:"left"},r.a.createElement(TO,{isActive:!0})))),"custom"===t.arp_cache_timeout&&r.a.createElement(CO,{marginBottom:24},r.a.createElement(He.Field,{full:!0,variant:"secondary",label:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT_LABEL",placeholder:"DEVICE_PROPERTIES_LABEL_ARP_CACHE_TIMEOUT_PLACEHOLDER",name:"arp_cache_base_reachable",type:"number"})),r.a.createElement(CO,{marginBottom:12},r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ECHO_SERVER"}))),r.a.createElement(CO,{marginBottom:0},r.a.createElement(PO,null,r.a.createElement(nb.a,{id:"echoServerDefault",checked:t.echo_server===_i.USG_DEFAULTS.echo_server,name:_i.USG_DEFAULTS.echo_server,onChange:g},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_DEFAULT"}))),r.a.createElement(nb.a,{id:"echoServerIpOrHostname",checked:t.echo_server!==_i.USG_DEFAULTS.echo_server,name:"echoServerIpOrHostname",onChange:g},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME"}))),r.a.createElement(hO,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME_TOOLTIP"}),width:180},r.a.createElement(TO,{isActive:!0})))),t.echo_server!==_i.USG_DEFAULTS.echo_server&&r.a.createElement(CO,{marginBottom:12,marginTop:14,className:DO},r.a.createElement(RO,{htmlFor:"echo_server"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_IP_OR_HOSTNAME"}))),r.a.createElement(He.Field,{full:!0,placeholder:"DEVICE_PROPERTIES_VALUES_ECHO_SERVER_PLACEHOLDER",name:"echo_server",id:"echo_server"})))});const SO=Object(i.c)("div")`
  width: 100%;
  margin-bottom: ${e=>e.marginBottom||0}px;

  input {
    width: 100% !important;
  }
`,AO=Object(i.c)("div")`
  display: flex;

  > label:not(:first-child) {
    margin-left: 18px;
  }
`,NO=Object(i.c)(y.a)`
  margin-bottom: 16px;
  width: 100%;
`,jO=Object(Ve.f)({mapPropsToValues:({activeItem:{led_override:e,led_override_color:t,led_override_color_brightness:a,lcm_brightness_override:n,lcm_brightness:l,lcm_idle_timeout_override:r,lcm_idle_timeout:i,outdoor_mode_override:c,power_source_ctrl:o}={}})=>({led_override:e!==ve.LedOverride.OFF,led_override_color:t||ve.DEFAULT_LED_COLOR,led_override_color_brightness:a>=0?a:ve.DEFAULT_LED_BRIGHTNESS,lcm_brightness_override:n||!1,lcm_brightness:l>=0?l:100,lcm_idle_timeout_override:r||!1,lcm_idle_timeout:i||0,outdoor_mode_override:c||"default",power_source_ctrl:o||"auto"}),validationSchema:tn.a.object().shape({led_override:tn.a.string(),led_override_color:tn.a.string(),led_override_color_brightness:tn.a.number(),lcm_brightness_override:tn.a.boolean(),lcm_brightness:tn.a.number(),lcm_idle_timeout_override:tn.a.boolean(),lcm_idle_timeout:tn.a.number(),outdoor_mode_override:tn.a.string(),power_source_ctrl:tn.a.string()}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}});var LO=Object(en.compose)(D.e,jO)(({activeItem:e,setFormDirty:t,dirty:a,values:n,resetForm:i,setFieldValue:c,disableLedOverrideFields:E,intl:s})=>{var m;const d=Object(o.useDispatch)(),{led_override:_}=e,b=Object(o.useSelector)(_i.selectMgmtSettings),u=Object(Uo.l)(e),O=Object(Uo.m)(e),p=(null!==(m=null==b?void 0:b.led_enabled)&&void 0!==m&&m&&_!==ve.LedOverride.OFF||_===ve.LedOverride.ON)&&O;Object(l.useEffect)(()=>(d(Object(v.h)({screen:()=>{if(!a)return{};const e={...n,led_override:n.led_override?ve.LedOverride.ON:ve.LedOverride.OFF,lcm_brightness_override:u&&n.lcm_brightness_override,lcm_idle_timeout_override:u&&n.lcm_idle_timeout_override};return e.lcm_brightness_override||delete e.lcm_brightness,e.lcm_idle_timeout_override||delete e.lcm_idle_timeout,u||(delete e.lcm_brightness_override,delete e.lcm_idle_timeout_override),e}})),d(Object(v.j)({screen:()=>i({values:n})})),d(Object(v.i)({screen:i})),()=>{d(Object(v.h)({screen:null})),d(Object(v.j)({screen:null})),d(Object(v.i)({screen:null}))}),[d,i,n,a,e.mac,u]),Object(l.useEffect)(()=>{t("screen",a)},[t,a]);const I=Object(l.useCallback)((e,t,a)=>{e.target.checked&&c(t,a?"override"===e.target.name:e.target.name)},[c]),g=Object(l.useCallback)(e=>I(e,"lcm_brightness_override",!0),[I]),C=Object(l.useCallback)(e=>I(e,"lcm_idle_timeout_override",!0),[I]);return r.a.createElement(r.a.Fragment,null,!E&&r.a.createElement(r.a.Fragment,null,r.a.createElement(NO,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED"})),r.a.createElement(on.a,{type:"checkbox",name:"led_override"}))),p&&r.a.createElement(r.a.Fragment,null,r.a.createElement(SO,{marginBottom:12},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED_BRIGHTNESS"}))),r.a.createElement(SO,{marginBottom:12},r.a.createElement(Jo.a,{size:"large",value:+n.led_override_color_brightness,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:e=>r.a.createElement("span",null,e,"%"),onChange:e=>c("led_override_color_brightness",e.target.value)})),r.a.createElement(SO,{marginBottom:12},r.a.createElement(T.a,{color:"primary",weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_COLOR"}))),r.a.createElement(SO,{marginBottom:12},r.a.createElement(Qo.a,{color:n.led_override_color,variant:"block",onChange:e=>{c("led_override_color","hex"in e?e.hex:void 0)},hexLabel:s.formatMessage({id:"DEVICE_PROPERTIES_LABEL_HEX"}),actionButton:r.a.createElement(oe.a,{variant:"inline",onClick:()=>{c("led_override_color",ve.DEFAULT_LED_COLOR)}},r.a.createElement(D.b,{id:"COMMON_VALUE_REVERT_BUTTON"}))}))),u&&r.a.createElement(r.a.Fragment,null,r.a.createElement(SO,{marginBottom:12},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LCM_BRIGHTNESS"}))),r.a.createElement(SO,{marginBottom:16},r.a.createElement(AO,null,r.a.createElement(nb.a,{id:"lcmBrigthnessDefault",checked:!n.lcm_brightness_override,name:"default",onChange:g},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_LED_DEFAULT_SETTINGS"}))),r.a.createElement(nb.a,{id:"lcmBrigthnessOverride",checked:n.lcm_brightness_override,name:"override",onChange:g},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIONS_OVERRIDE"}))))),n.lcm_brightness_override&&r.a.createElement(r.a.Fragment,null,r.a.createElement(SO,{marginBottom:12},r.a.createElement(Jo.a,{size:"large",value:+n.lcm_brightness,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:e=>r.a.createElement("span",null,e,"%"),onChange:e=>c("lcm_brightness",e.target.value)}))),r.a.createElement(SO,{marginBottom:12},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LCM_IDLE_TIMEOUT"}))),r.a.createElement(SO,{marginBottom:16},r.a.createElement(AO,null,r.a.createElement(nb.a,{id:"lcmIdleTimeoutDefault",checked:!n.lcm_idle_timeout_override,name:"default",onChange:C},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_VALUE_LED_DEFAULT_SETTINGS"}))),r.a.createElement(nb.a,{id:"lcmIdleTimeoutOverride",checked:n.lcm_idle_timeout_override,name:"override",onChange:C},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIONS_OVERRIDE"})))))))}),xO=a(495),MO=a(1201);const VO=Object(i.c)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,wO=Object(i.c)(h.g)`
  position: absolute;
  right: 8px;
  color: inherit;
`,FO=Object(i.c)("div")`
  margin-left: 10px;
`,UO=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px !important;
  margin-top: 16px;
  justify-content: flex-end;

  svg {
    height: 14px;
    width: 13px;
  }
`,zO=null,kO="COMMON_DISABLED",BO=[{id:"portName",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_NAME"})),renderCell:({portName:e})=>r.a.createElement(T.a,{size:"body"},e)},{id:"portStatus",label:r.a.createElement(T.a,{color:"inherit",size:"label",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_STATUS"})),renderCell:({portStatus:e})=>r.a.createElement(r.a.Fragment,null,r.a.createElement(T.a,{color:"inherit",size:"body"},e),r.a.createElement(wO,{size:"small"}))}];var WO=Object(D.e)(({activeItem:e,intl:t})=>{const{ethernet_overrides:a,port_overrides:i,port_table:c=[]}=e,E=Object(o.useSelector)(nn.selectNetworkGroups),s=Object(n.k)(),{path:m}=Object(n.n)(),{site:d,page:_,id:b,panel:u}=Object(n.m)(),O=Object(ve.getDeviceSpecs)(e),p=Object(ve.getDeviceState)(e),I=[ve.DeviceState.CONNECTED,ve.DeviceState.PROVISIONING].includes(p),g=Object(l.useMemo)(()=>{const e=c.map(e=>({port_idx:parseInt(e.ifname.replace("eth",""),10)+1,...e}));if(e.length>0)return e;return Object.keys(O.ports).map(e=>({ifname:e,up:!1,enable:!1,port_idx:parseInt(e.replace("eth",""),10)+1}))},[e,O.ports]),v=Object(l.useMemo)(()=>g.sort((e,t)=>e.port_idx-t.port_idx).map(n=>{var l;const{ifname:c}=n,o=n.port_idx,s=a.find(({ifname:e})=>e===c),m=s&&E.find(e=>e.id===s.networkgroup),{nameOverride:d}=Object(ve.getCurrentPortData)(o-1,e),_=Object(yb.c)(e,c),b=i&&i.find(({port_idx:e})=>_.portIdx===e),u=Object.values(MO.a.linkNegotiationOptions).find(({speed:e,full_duplex:t,autoneg:a})=>b&&b.speed&&!b.autoneg?b.speed===e&&b.full_duplex===t:a),{ports:O}=Object(ve.getDeviceSpecs)(e),p=Object(ve.isUsg)(e)?O[c]:o,I=Object(ve.getPortGroupLabel)(e,n,null!==(l=null==m?void 0:m.id)&&void 0!==l?l:t.formatMessage({id:"COMMON_DISABLED"})),g=d||r.a.createElement(D.b,{id:Object(ve.isUGW3)(e)||Object(ve.isUGW4)(e)?"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP_SHORT":"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",values:{port:p,networkGroup:I}}),v={...Object(xO.a)(n),networkGroup:m?m.id:zO,networkGroupLabel:m?m.label:kO,linkNegotiation:u.id,linkNegotiationLabel:u.label,linkNegotiationSpeed:u.speed,portName:g,portStatus:void 0,id:o||c,portIdx:o};return _.supportedValues&&0!==_.supportedValues.length||(v.linkNegotiationLabel="DEVICE_PROPERTIES_LINK_NEGOTIATION_AUTO"),v.portStatus=r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Dm.a,{cellData:v,deviceData:e,style:{minWidth:20}}),r.a.createElement(FO,null,r.a.createElement(D.b,{id:v.networkGroup?v.linkNegotiationLabel:v.networkGroupLabel,values:{speed:Object(aa.c)(1e6*v.linkNegotiationSpeed/8,"bitrate")}}))),v}),[g,e,a,E,i]),C=e=>Object(n.i)(m,{site:d,page:_,id:b,panel:u,subPanel:"ports",subPanelId:e}),R=Object(l.useCallback)(e=>(null==e?void 0:e.dns)?null:s.push(C(e.ifname)),[s]);return r.a.createElement(VO,null,r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(ya.a,{columns:BO,rowHeight:35,disableColumnFilters:!0,items:v,onRowClick:R,hideCellOverflow:!1}),I&&r.a.createElement(UO,{variant:"link",onClick:()=>s.push(C(jt.b.ALL)),Icon:r.a.createElement(h.Kb,{isActive:!0})},r.a.createElement(D.b,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"}))))});const GO=Object(i.c)("div")`
  display: flex;
  height: auto;
  width: 100%;
  align-items: center;
  flex-direction: column;
  padding: 0 32px;
  flex: 1 1 85%;
`,HO=Object(i.c)("div")`
  margin-bottom: ${({theme:e})=>e.spacing["spacing-xl"]};
`;var YO=Object(en.compose)(Qa(["general","screen","services"]))(({activeItem:e,isDirty:t,isInvalid:a,setFormDirty:n,setFormInvalid:i})=>{const{_id:c,mac:E}=e,s=Object(o.useSelector)(hr),m=Object(o.useSelector)(Dr),d=Object(o.useSelector)(Tr),_=Object(o.useSelector)(_i.selectUsgSettings),b=Object(o.useSelector)(ze.o)&&!e.unsupported,u=Object(o.useDispatch)(),O=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,O&&r.a.createElement(Um,{deviceData:e,hideAnomalies:!0}),r.a.createElement(GO,null,b&&r.a.createElement(ga.a,{variant:"secondary",multiOpen:!0,renderOnlyExpandedContent:!0,items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(HO,null,r.a.createElement(Sr,{activeItem:e,setFormDirty:n,setFormInvalid:i}))},{id:"ports",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_PORTS"}),openByDefault:!1,renderContent:()=>r.a.createElement(WO,{activeItem:e})},{id:"screen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(HO,null,r.a.createElement(LO,{activeItem:e,setFormDirty:n}))},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(HO,null,r.a.createElement(fO,{activeItem:e,usgSettings:_,setFormDirty:n,setFormInvalid:i}))},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(pO,{activeItem:e})}]})),r.a.createElement(Ar.a,{isDirty:t,isInvalid:a,onFormSubmit:()=>{const e=Object.entries(d).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});(Object(_O.a)(e)?Promise.resolve():u(Object(ve.updateDeviceWithIdEndpoint)(e,c,E,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0}))).then(()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{var e,t,a;null===(e=m.general)||void 0===e||e.call(m),null===(t=m.screen)||void 0===t||t.call(m),null===(a=m.services)||void 0===a||a.call(m)}}))});const $O=Object(i.c)(y.a)`
  position: relative;
  margin: -18px -30px 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};

  svg {
    position: absolute;
    left: 24px;
  }
`,KO=Object(i.c)(T.a)`
  width: 100%;
  text-align: center;
`,XO=Object(i.c)(y.a)`
  width: 100%;
  padding: 30px;
`,qO=Object(i.c)(T.a)`
  margin-bottom: ${({theme:e})=>e.spacing["spacing-s"]};
`,ZO=Object(i.c)(y.a)`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
`;const JO=Object(Ve.f)({mapPropsToValues:({port:e})=>{const{nameOverride:t,enable:a}=e;return{name:t,enable:null==a||a}},validationSchema:tn.a.object().shape({enable:tn.a.boolean(),name:tn.a.string()}),handleSubmit:(e,{props:{activeItem:{_id:t,port_overrides:a,mac:n},port:l,intl:r,history:i,updateDeviceWithIdEndpoint:c}})=>{const o=r.formatMessage({id:"DEVICE_PROPERTY_HEADER_PORTS"});c({port_overrides:[...(null==a?void 0:a.filter(({port_idx:e})=>e!==l.portIdx))||[],{port_idx:l.portIdx,...e}]},t,n,{successToast:{icon:sa.a.success,message:"DEVICE_PORT_FORM_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:o}},mergeAndOverrideKeys:["port_overrides"],extend:!0}).then(()=>{i.goBack()})}});var QO=Object(en.compose)(Object(o.connect)((e,{activeItem:t,params:{subPanelId:a}})=>({port:Object(ve.getCurrentPortData)(+a.replace(/\D/g,""),t)}),{updateDeviceWithIdEndpoint:ve.updateDeviceWithIdEndpoint}),D.e,JO)((function({activeItem:e,port:t,history:a,submitForm:n,resetForm:i,dirty:c}){const E=Object(l.useCallback)(()=>{i(),a.goBack()},[i,a]),s=Object(o.useSelector)(nn.selectNetworkGroups),m=Object(yb.g)(t.ifname,e,s),d=Object(ve.getDeviceModelFeature)(e,"poe");return r.a.createElement(r.a.Fragment,null,r.a.createElement(XO,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement($O,{alignItems:"center"},r.a.createElement(h.f,{onClick:E,style:{cursor:"pointer"}}),r.a.createElement(KO,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",values:{port:t.portIdx,networkGroup:null==m?void 0:m.label}}))),r.a.createElement(ZO,{marginBottom:24},r.a.createElement(He.Field,{label:"DEVICE_PORT_FORM_NAME_LABEL",full:!0,name:"name"})),d&&r.a.createElement(ZO,{marginBottom:24},r.a.createElement(y.a,{flexDirection:"column",flex:"1"},r.a.createElement(qO,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_PORT_POWER_LABEL"})),r.a.createElement(T.a,{color:"tertiary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PORT_FORM_PORT_POWER_DESCRIPTION"}))),r.a.createElement(He.Field,{name:"enable",type:"checkbox"}))),r.a.createElement(Ar.a,{isDirty:c,onFormSubmit:n,onFormCancel:E,allowCancel:!0}))}));var ep={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:oO},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:dO},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:YO,subpanel:{path:"/:subPanel/:subPanelId",component:({activeItem:e,params:t,...a})=>t.subPanelId===jt.b.ALL?r.a.createElement(yu.a,Object.assign({activeItem:e,params:t},a)):r.a.createElement(QO,Object.assign({activeItem:e,params:t},a))}}}};var tp=({mac:e,props:t,children:a})=>{const n=Object(l.useMemo)(()=>Object(ke.selectUnifiDeviceClientProperties)(e,t),[e,t]);return a(Object(o.useSelector)(n))};const ap=Object(i.c)("img")`
  width: 40px;
  height: 40px;
`,np=Object(i.c)(oe.a)`
  padding: 0;
  margin: 0;
  border: 0;
  font-weight: 400;
  line-height: 1.6;
`,lp=Object(i.c)(oe.a)`
  font-size: ${({theme:e})=>e.fontSize["font-size-caption"]};
`,rp=Object(i.c)(le.f)`
  background-color: ${({theme:e})=>e.motifPalette.neutral02};
  border-radius: 4px;
`,ip=({activeItem:e})=>r.a.createElement(le.f,{flexDirection:"row",marginBottom:24},r.a.createElement(le.f,{maxWidth:"33%",minWidth:"33%",margin:"auto 16px auto 0",alignItems:"center",justifyContent:"center"},r.a.createElement(le.c,{client:e,grid:!0})),r.a.createElement(le.f,{width:"100%",flexDirection:"column"},e.model&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_MODEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.model)),e.mac&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"UNIFI_DEVICE_CLIENT_LABEL_MAC"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.mac)),e.displayable_version&&r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"UNIFI_DEVICE_CLIENT_LABEL_VERSION"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.displayable_version)))),cp=({product_line:e})=>{var t,a;const n=Object(o.useSelector)(d.b),l=Object(o.useSelector)(M.a);return e&&e!==ke.UnifiDeviceProductLine.NETWORK?r.a.createElement(rp,{padding:"12px",alignItems:"center"},r.a.createElement(le.f,{marginRight:16},r.a.createElement(ap,{src:(()=>{switch(e){case ke.UnifiDeviceProductLine.TALK:return l+"/unifiDevices/unifiTalkDevice.png";case ke.UnifiDeviceProductLine.ACCESS:return l+"/unifiDevices/unifiAccessDevice.png";case ke.UnifiDeviceProductLine.PROTECT:return l+"/unifiDevices/unifiProtectDevice.png";case ke.UnifiDeviceProductLine.CONNECT:return l+"/unifiDevices/unifiConnectDevice.png";default:return null}})()})),r.a.createElement(le.f,null,r.a.createElement(lp,{variant:"link",onClick:()=>{window.location.href=n.replace("network",e.toLowerCase())}},r.a.createElement(D.b,{id:"UNIFI_DEVICE_CLIENT_LABEL_VIEW_IN",values:{application:(null===(t=null==e?void 0:e.charAt(0))||void 0===t?void 0:t.toUpperCase())+(null===(a=null==e?void 0:e.slice(1))||void 0===a?void 0:a.toLowerCase())}})))):null},op=({activeItem:e})=>{const t=Object(Lt.getWirelessClientExperience)(e),a=Object(l.useMemo)(()=>e.uplink_mac?Object(ve.selectDeviceRecordProperties)(e.uplink_mac,["type","name","model","mac"]):()=>{},[e.uplink_mac]);return r.a.createElement(Qt,{item:e,clientExperience:t,headerTitle:"COMMON_WIFI_EXP",showGraph:e.connected&&t.known,itemType:Ut.a.UNIFI_CLIENT,canReport:!0,padding:"24px 0 0 0",uplinkDevice:Object(o.useSelector)(a)})},Ep=({activeItem:e,history:t})=>{const{mac:a,ip:n,connected:i,network_name:c,uplink_mac:E,is_wired:s,essid:m}=e,d=Object(Ta.a)("/devices/properties/:mac/"+jt.a.OVERVIEW),_=Object(l.useMemo)(()=>E?Object(ve.selectDeviceRecordProperties)(E,["type","name","model","mac"]):()=>{},[E]),b=Object(o.useSelector)(_),u=Object(l.useMemo)(()=>Object(Lt.getPortName)(b,e),[b,e]),O=Object(l.useMemo)(()=>Object(Lt.getPortNumber)(b,e),[b,e]);return r.a.createElement(le.f,{flexDirection:"column",marginTop:24},n&&i?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n)):null,c?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_NETWORK"})),r.a.createElement(T.a,{color:"secondary",size:"body"},c)):null,u?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:s?"UNIFI_DEVICE_CLIENT_LABEL_WIRED":"UNIFI_DEVICE_CLIENT_LABEL_WIRELESS"})),r.a.createElement(np,{variant:"link",onClick:()=>t.push(d.replace(":mac",E))},u)):null,(()=>{switch(e.type){case Lt.ClientType.WIRED:return O?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"UNIFI_DEVICE_CLIENT_LABEL_PORT"})),r.a.createElement(T.a,{color:"secondary",size:"body"},O)):null;case Lt.ClientType.WIRELESS:return r.a.createElement(r.a.Fragment,null,m?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SSID"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m)):null,e.radio?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_BAND"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(Lt.getWirelessClientRadioBand)(e))):null,e.channel?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.channel)):null,e.signal?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.signal," ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"}))):null,e.radio_proto?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WIFI_STANDARD"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(Lt.getWirelessClientWifiStandard)(e))):null,e.mimo?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_MIMO"})," ",r.a.createElement(D.b,{id:"COMMON_CONF"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(Lt.getWirelessClientMimo)(e))):null,r.a.createElement(tp,{mac:a,props:["tx_rate"]},({tx_rate:e=0})=>e>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_RX_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(aa.c)(1e3*e/8,"bitrate","SI"))):null),r.a.createElement(tp,{mac:a,props:["rx_rate"]},({rx_rate:e=0})=>e>0?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"CLIENT_HEADER_TX_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(aa.c)(1e3*e/8,"bitrate","SI"))):null));default:return null}})(),!s&&m?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WIFI"})),r.a.createElement(T.a,{color:"secondary",size:"body"},m)):null,r.a.createElement(tp,{mac:a,props:["rx_packets","rx_bytes"]},({rx_packets:e=0,rx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null),r.a.createElement(tp,{mac:a,props:["tx_packets","tx_bytes"]},({tx_packets:e=0,tx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null),r.a.createElement(tp,{mac:a,props:["uptime"]},({uptime:e=null})=>e?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(Fb.a)(e))):null),r.a.createElement(tp,{mac:a,props:["usage_bytes"]},({usage_bytes:e=null})=>e?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"UNIFI_DEVICE_CLIENT_LABEL_ACTIVITY_24_HOURS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(ta.a,{size:"body",type:"bytes",input:e}))):null))};var sp=({activeItem:e,history:t})=>r.a.createElement(le.f,{padding:"32px 32px 0",flexDirection:"column",justifyContent:"space-between"},r.a.createElement(ip,{activeItem:e}),r.a.createElement(cp,{product_line:e.product_line}),e.type===Lt.ClientType.WIRELESS&&r.a.createElement(op,{activeItem:e}),r.a.createElement(Ep,{activeItem:e,history:t}));var mp={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"CLIENT_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:sp},insights:{path:"/insights",title:"CLIENT_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:Ja,subpanel:{path:"/:subPanel",component:Ga}},settings:{path:"/settings",title:"CLIENT_PROPERTY_HEADER_SETTINGS",icon:h.S,component:Pn}}};var dp=({activeItem:e})=>r.a.createElement(y.a,{padding:"26px 32px",flexDirection:"column",height:"100%"},e.ip?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_IP_ADDRESS"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.ip)):null,e.assoc_time?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WORD_UPTIME"})),r.a.createElement(Yt.a,{startTimestamp:e.assoc_time})):null,r.a.createElement(na.a,{client:e,props:["tx_packets","tx_bytes"]},({tx_packets:e=0,tx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null),r.a.createElement(na.a,{client:e,props:["rx_packets","rx_bytes"]},({rx_packets:e=0,rx_bytes:t=0})=>e&&t?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_ACTIVITY_UP_PKTS_BYTES"})),r.a.createElement(T.a,{color:"secondary",size:"body"},null==e?void 0:e.toLocaleString()," / ",r.a.createElement(ta.a,{type:"bytes",size:"body",input:t,color:"secondary"}))):null));var _p={default:jt.a.OVERVIEW,singlePanel:!0,panels:{overview:{path:"/overview",component:dp}}};var bp=({activeItem:{has_temperature:e,overheating:t,general_temperature:a}})=>e?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_LABEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(r.a.Fragment,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:a}}),t&&r.a.createElement(cn.a,{message:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_OVERHEATING"}),width:180,position:"left",className:"ml-1",style:{display:"inline-block",verticalAlign:"text-bottom"}},r.a.createElement(h.a,{style:{color:Ia.a["color-danger"]}}))))):null;var up=({activeItem:e})=>{const{has_fan:t,fan_level:a}=e,n=a>=(l=e,"alwayson"===Object(ve.getDeviceModelFeature)(l,"fan")?0:1);var l;return t&&(e=>"simple"===Object(ve.getDeviceModelFeature)(e,"fan"))(e)?r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_LEVEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n?a:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_OFF"}))),r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_STATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},n?r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_ON"}):r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_FAN_OFF"})))):null};var Op=({switchDeviceData:{power_source_voltage:e},switchDeviceData:t})=>{const a=(n=t)&&n.port_table?n.port_table.reduce((e,t)=>e+parseFloat(Object(Ol.a)(t,"poe_power","0.0")),0):0;var n;return r.a.createElement(y.a,{height:"100%",flexDirection:"column"},e&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POE_POWER_SOURCE_VOLTAGE_LABEL"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POE_POWER_SOURCE_VOLTAGE_VALUE",values:{voltage:e}}))),r.a.createElement(bp,{activeItem:t}),r.a.createElement(up,{activeItem:t}),r.a.createElement(rl,{activeItem:t}),r.a.createElement(cl,{activeItem:t}),r.a.createElement(ml,{activeItem:t}),a>0&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POE_POWER_CONSUMPTION_LABEL"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POE_POWER_CONSUMPTION_VALUE",values:{power:a.toFixed(2)}}))))};const pp=Object(i.c)("div")`
  display: flex;
  height: 100%;
  flex-direction: column;
`,Ip=Object(i.c)(oe.a)`
  padding: 0;
  margin: 0;
  height: initial;
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  font-weight: normal;
  line-height: ${({theme:e})=>e.fontSizes[2]}px;
`;function gp({switchDeviceData:e,showSimplifiedActivity:t,params:a,path:l,history:i}){const c=Object(o.useSelector)(ve.selectDevicesData),{site:E,page:s,subPage:m}=a,{speed:d,rx_packets:_,rx_bytes:u,tx_packets:O,tx_bytes:p,port_idx:I,"rx_bytes-r":g,"tx_bytes-r":C}=Object(ve.getUplinkAttrs)(e)||{},R=Object(o.useSelector)(t=>Object(ve.getUplink)(Object(ve.selectDevicesData)(t),e)),h=Object(ve.getUplinkRemotePort)(c,e),P=Object(ve.getUplinkDisplayName)(e,R),y=Object(o.useDispatch)();return r.a.createElement(pp,null,r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UPLINK"})),(null==R?void 0:R.mac)?r.a.createElement(Ip,{variant:"link",onClick:e=>{e.preventDefault(),e.stopPropagation();const t=Object(n.i)(l,{id:R.mac,site:E,page:s,panel:jt.a.OVERVIEW,subPage:m});i.push(t),y(Object(v.g)({type:b.c.DEVICE,mac:R.mac}))}},P):r.a.createElement(D.b,{id:"COMMON_HYPHEN"})),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_PORT"})),r.a.createElement(T.a,{size:"body"},I)),r.a.createElement(Zl,{portSpeed:d}),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_POWER"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:(null==h?void 0:h.poe_power)||0}}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_DOWN_PKTS_BYTES"})),r.a.createElement(T.a,{size:"body"},_&&u?r.a.createElement(r.a.Fragment,null,r.a.createElement(ta.a,{type:"number",input:_,size:"body"})," / ",Object(aa.c)(u)):"- / -")),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UP_PKTS_BYTES"})),r.a.createElement(T.a,{size:"body"},O&&p?r.a.createElement(r.a.Fragment,null,r.a.createElement(ta.a,{type:"number",input:O,size:"body"})," / ",Object(aa.c)(p)):"- / -")),t?r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_ACTIVITY"})),r.a.createElement(ta.a,{size:"body",type:"bytes",input:C+g||0,options:"bitrate"})):r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_DOWN_ACTIVITY"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(ta.a,{type:"bytes",input:g||0,options:"bitrate",size:"body"}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_UP_ACTIVITY"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(ta.a,{type:"bytes",input:C||0,options:"bitrate",size:"body"})))))}const vp=Object(i.c)(T.a)`
  margin-bottom: 8px;
`,Cp=Object(i.c)(T.a)`
  margin-top: 16px;
  margin-bottom: 8px;
`;var Rp=({activeItem:e})=>{const t=Object(ve.getIsUsl8Mp)(e),a=[Object(ve.getPsuInternalBattery)(e),Object(ve.getPsuExternalBattery)(e)];return r.a.createElement(r.a.Fragment,null,a.map(e=>r.a.createElement("div",{key:e.index},Object(ve.getIsPsuInternalBattery)(e)?r.a.createElement(vp,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_BATTERY_TYPE_INTERNAL"})):r.a.createElement(Cp,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_STATUS"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:e.charge_status?"DEVICE_BATTERY_STATE_"+e.charge_status.replace(" ","_").toUpperCase():"DEVICE_STATE_UNKNOWN"}))),e.capacity&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_CAPACITY"})),r.a.createElement(T.a,{size:"body"},r.a.createElement("span",{style:{color:Mt.a.getGradientColor(e.capacity/100)}},e.capacity,"%"))),!t&&e.technology&&"Unknown"!==e.technology&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_TYPE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_USW_MC_PSU_BATTERY_TYPE_"+e.technology.replace("-","_").toUpperCase()}))),(e.energy_full_design||e.charge_full_design)&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_STORAGE"})),r.a.createElement(T.a,{size:"body"},e.energy_full_design?r.a.createElement(D.b,{id:"COMMON_UNIT_WATT_HOURS",values:{value:e.energy_full_design}}):r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERE_HOURS",values:{value:e.charge_full_design}}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_POWER_USAGE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(e.power).toFixed(1)}}))),!t&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_CURRENT"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(e.current).toFixed(1)}}))),!t&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_VOLTAGE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(e.voltage).toFixed(1)}}))),!!e.time_to_empty_avg&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_TIME"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(ta.a,{type:"uptime",size:"body",input:e.time_to_empty_avg}))),e.installation_time&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_INSTALLATION_DATE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(ta.a,{type:"uptime",size:"body",input:e.installation_time}))),e.health&&r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY_HEALTH_STATUS"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_USW_MC_PSU_HEALTH_"+e.health.replace(" ","_").toUpperCase()}))))))};const Tp=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
`;var hp=r.a.memo(({activeItem:e,...t})=>{var a,n;const i=null===(a=null==e?void 0:e.uplink)||void 0===a?void 0:a.type,c=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),o=i&&(i===ve.UplinkType.WIRE?"DEVICE_CONNECTION_WIRED":"DEVICE_CONNECTION_WIRELESS");return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),c&&r.a.createElement(Tp,{variant:"secondary",items:[{id:"clients",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_HEADER_CLIENTS_AND_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({hideSignalTab:!0,activeItem:e},t))},{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),renderContent:()=>r.a.createElement(Op,{switchDeviceData:e})},...(null===(n=e.psu_table)||void 0===n?void 0:n.length)?[{id:"powerSource",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_SOURCE"}),renderContent:()=>r.a.createElement(Bu,{activeItem:e})},{id:"battery",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_BATTERY"}),renderContent:()=>r.a.createElement(Rp,{activeItem:e})}]:[],{id:"uplink",label:r.a.createElement(r.a.Fragment,null,r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK"}),o&&r.a.createElement(r.a.Fragment,null,"(",r.a.createElement(D.b,{id:o}),")")),renderContent:()=>r.a.createElement(gp,Object.assign({switchDeviceData:e,showSimplifiedActivity:!0},t))},{id:"downlink",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))}],multiOpen:!0,renderOnlyExpandedContent:!0}))});const Dp=Object(i.c)(y.a)`
  position: relative;
  border-bottom: 4px;
`,Pp=Object(i.c)(y.a)`
  margin-bottom: 16px;
  svg g:nth-child(2) {
    transform: translate(58px, 53px) !important;
  }
  g {
    > circle {
      transform: rotateX(180deg) rotateY(180deg);
    }
    text:nth-child(1) {
      font-size: 24px;
    }
    text:nth-child(2) {
      font-weight: 900;
    }
    circle:nth-child(2) {
      stroke: ${({theme:e})=>e.motifPalette.ui03};
    }
  }
`,yp=Object(i.c)("div")`
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: ${({theme:e})=>e.motifPalette.ui04};
`,fp=Object(i.c)("div")`
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: ${({theme:e})=>e.motifPalette.ui04};
`,Sp=Object(i.c)(T.a)`
  margin: 14px 0px;
`;var Ap=({activeItem:e})=>{const{total:t,outlets:a,internalBattery:n,externalBattery:l}=Object(ve.getPsuUtilization)(e);return r.a.createElement(Dp,{flexFlow:"wrap"},r.a.createElement(yp,null),r.a.createElement(fp,null),r.a.createElement(Pp,{flexDirection:"column",flex:"1 1 50%",alignItems:"center"},r.a.createElement(Sp,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_TOTAL"})),r.a.createElement(Pa.a,{title:t.usedPowerPercentage+"%",description:`${t.usedPower}/${t.maxPower}W`,size:116,items:[{id:"free",color:t.statusColor,value:t.usedPowerPercentage},{id:"used",color:Ia.a["white-6"],value:100-t.usedPowerPercentage}]})),r.a.createElement(Pp,{flexDirection:"column",flex:"1 1 50%",alignItems:"center"},r.a.createElement(Sp,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_UTILIZATION_OUTLETS"})),r.a.createElement(Pa.a,{title:a.usedPowerPercentage+"%",description:`${a.usedPower}/${a.maxPower}W`,size:116,items:[{id:"free",color:a.statusColor,value:a.usedPowerPercentage},{id:"used",color:Ia.a["white-6"],value:100-a.usedPowerPercentage}]})),r.a.createElement(Pp,{flexDirection:"column",flex:"1 1 50%",alignItems:"center"},r.a.createElement(Sp,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_BATTERY_TYPE_INTERNAL"})),r.a.createElement(Pa.a,{title:n.usedPowerPercentage+"%",description:`${n.usedPower}/${n.maxPower}W`,size:116,items:[{id:"used",color:n.statusColor,value:n.usedPowerPercentage},{id:"free",color:Ia.a["white-6"],value:100-n.usedPowerPercentage}]})),r.a.createElement(Pp,{flexDirection:"column",flex:"1 1 50%",alignItems:"center"},r.a.createElement(Sp,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})),r.a.createElement(Pa.a,{title:l.usedPowerPercentage+"%",description:`${l.usedPower}/${l.maxPower}W`,size:116,items:[{id:"used",color:l.statusColor,value:l.usedPowerPercentage},{id:"free",color:Ia.a["white-6"],value:100-n.usedPowerPercentage}]})))};var Np=({activeItem:e})=>{const t=Object(o.useDispatch)();return Object(l.useEffect)(()=>{t(Object(Kn.fetchDeviceUsageReport)(e.mac))},[e.mac,t]),r.a.createElement(Ir,{gwMac:e.mac,keys:["mem","cpu"],pickDatumsWithKey:"sw",heading:"DEVICE_GATEWAY_USAGE_STAT_CHART_HEADER"})};const jp=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var Lp=function({activeItem:e}){var t;const a=!!(null===(t=e.psu_table)||void 0===t?void 0:t.length);return r.a.createElement(jp,{variant:"secondary",items:[...a?[{id:"powerUtilization",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>r.a.createElement(Ap,{activeItem:e}),openByDefault:a}]:[],{id:"stats",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"}),renderContent:()=>r.a.createElement(Np,{activeItem:e}),openByDefault:!a}],multiOpen:!0,renderOnlyExpandedContent:!0})};const xp=Object(i.c)("div")`
  display: grid;
  grid-template-columns: repeat(4, minmax(min-content, 1fr));
  grid-gap: 0 15px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid ${({theme:e})=>e.motifPalette.ui04};
`,Mp=Object(i.c)("div")`
  padding-bottom: 6px;
  padding-top: 6px;
  font-size: 9px;
  color: ${({theme:e})=>e.motifPalette.text02};
  display: flex;
  align-items: center;
  flex: 0 0 25%;
  max-width: 25%;

  > span {
    white-space: nowrap;
    margin-left: 4px;
  }
`,Vp=Object(i.c)(Ht.a,{shouldForwardProp:e=>"background"!==e})`
  background-color: ${e=>e.background};
  border-radius: 1px;
`;var wp=r.a.memo(({isForDiagram:e,deviceData:t})=>{const a=Object(u.Be)(t),n=Object(u.eb)(t),l=Object(u.Ce)(t),i=Object(Ta.n)();return r.a.createElement(xp,null,r.a.createElement(Mp,null,r.a.createElement(Vp,{variant:"success"}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_ENABLED"}))),r.a.createElement(Mp,null,r.a.createElement(Vp,{background:i.motifPalette.neutral04}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_OUTLET_STATE_DISABLED"}))),(a||l)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Mp,null,r.a.createElement(Vp,{variant:"warning"}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PORT_STATE_MBPS",values:{speed:"100/10"}})))),(n||l)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Mp,null,r.a.createElement(h.Tb,{width:12,height:12}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_OUTLET_STATE_DELIVERING"}))),r.a.createElement(Mp,null,r.a.createElement(h.a,{width:12,height:12}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_OUTLET_STATE_WARNING"}))),r.a.createElement(Mp,null,r.a.createElement(Vp,{variant:"danger"}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_OUTLET_STATE_ERROR"})))),l&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Mp,null,r.a.createElement(h.Ub,{width:16,height:16}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_OUTLET_STATE_HIGH_PRIORITY"})))),(a||n||l)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(Mp,null,r.a.createElement(Vp,{background:i.motifPalette.neutral07}),r.a.createElement(T.a,{size:"label",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PORT_STATE_DISCONNECTED"})))))});const Fp=Object(i.c)(cn.a,{shouldForwardProp:e=>!["cellSize","isEnabled","marginSize"].includes(e)})`
  width: ${({cellSize:e})=>e||"20px"};
  height: ${({cellSize:e})=>e||"20px"};
  align-items: center;
  background-color: ${({isEnabled:e,theme:t})=>e?t.motifPalette.success:Ia.a["grey-4"]};
  border-radius: 2px;
  color: #fff;
  justify-content: center;
  display: flex;
  position: relative;

  &:not(:first-child) {
    margin-left: ${({marginSize:e})=>e||"10px"};
  }

  div:last-child {
    right: -15px;
  }
`,Up=i.a`
  margin-left: 15px;
`,zp=Object(i.c)("div",{shouldForwardProp:e=>"rotateIcon"!==e})`
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    transform: rotate(${({rotateIcon:e})=>e?"-90deg":0});
    max-width: 70%;
    max-height: 70%;
  }
`,kp=Object(i.c)(h.Gc)`
  max-width: 100% !important;
  max-height: 100% !important;
`,Bp=Object(i.c)(T.a)`
  margin-left: 6px;
`;var Wp=({cellData:e,marginSize:t,cellSize:a,rotateIcon:l,tooltipPosition:i="bottomRight"})=>{const c=Object(n.k)(),{path:o}=Object(n.n)(),{site:E,page:s,id:m,panel:d}=Object(n.m)(),_=Object(Uo.q)(e,"POWER_METER");return r.a.createElement(Fp,{isEnabled:e.relay_state,tooltipClassName:Up,marginSize:t,cellSize:a,onClick:t=>{var a,l;null===(a=null==t?void 0:t.preventDefault)||void 0===a||a.call(t),null===(l=null==t?void 0:t.stopPropagation)||void 0===l||l.call(t),c.push(Object(n.i)(o,{site:E,page:s,id:m,panel:d,subPanel:"outlets",subPanelId:e.index}))},message:_&&e.outletType===ve.OutletType.STANDARD?r.a.createElement(y.a,{flexDirection:"column",justifyContent:"space-between"},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},e.index)),r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_NAME"})),r.a.createElement(Bp,{size:"caption",color:"secondary",truncate:!0},e.name)),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(e.outlet_power||0).toFixed(2)}}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_ENERGY"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},"0.00 ",r.a.createElement(D.b,{id:"COMMON_UNIT_KWH"}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_CURRENT"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(e.outlet_current||0).toFixed(2)}}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_VOLTAGE"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(e.outlet_voltage||0).toFixed(2)}}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_FACTOR"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},Number(e.outlet_power_factor||0).toFixed(2)))):r.a.createElement(y.a,{flexDirection:"column",justifyContent:"space-between"},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},e.index)),r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_NAME"})),r.a.createElement(Bp,{size:"caption",color:"secondary",truncate:!0},e.name)),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE_ENABLED"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},e.cycle_enabled?r.a.createElement(h.t,null):r.a.createElement(h.A,null))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},e.relay_state?r.a.createElement(h.t,null):r.a.createElement(h.A,null)))),position:i,portal:!0,width:150},r.a.createElement(zp,{rotateIcon:l},"usb"===e.outletType?r.a.createElement(kp,null):r.a.createElement(h.Fb,null)))};const Gp=Object(i.c)(y.a)`
  font-size: ${({theme:e})=>e.fontSizes[0]}px;
`,Hp=Object(i.c)(y.a)`
  &:not(:first-child) {
    margin-top: 10px;
  }
`,Yp=Object(i.c)(h.cb)`
  margin-right: 12px;
`,$p=Object(i.c)("div")`
  width: 5px;
`;var Kp=r.a.memo(({deviceData:e})=>{const{outletsDiagram:t,primaryOutletGroupCount:a}=Object(ve.getDeviceSpecs)(e),n=Object(ve.isUspPduPro)(e),l=t.length?Object(ve.determineRowLayoutsFromOutletDiagramConfig)(t,e):Object(ve.determineRowLayoutsFromOutletConfig)(a,e),i=Object(hm.a)(l.map(e=>e.length));let c=i>10?"3px":"10px";const o=i>10?"19px":"20px";return l&&0!==l.length?r.a.createElement(r.a.Fragment,null,l.map((t,a)=>r.a.createElement(Hp,{"align-items":"flex-end",key:"OutletLayoutRow-"+(a+1)},t.map((t,l)=>{if(!t)return r.a.createElement($p,{key:`OutletSpacer-${a+1}-${l+1}`});const i=`Outlet-${a+1}-${l+1}`,E=Object(ve.getActiveOutletInfo)(e,void 0,t.outletNumber),s=t&&E&&{outletType:t.outletType,...E};return n&&1===a&&l>2&&(c="16px"),n&&1===a&&l>3&&(c="54px"),r.a.createElement(Wp,{cellData:s,key:i,marginSize:c,cellSize:o,rotateIcon:t.rotateIcon})})))):r.a.createElement(Gp,null,r.a.createElement(Yp,{isActive:!0}),r.a.createElement(D.b,{id:"DEVICE_DIAGRAM_MISSING"}))},({deviceData:e},{deviceData:t})=>e.model===t.model&&e.outlet_table===t.outlet_table&&e.outlet_overrides===t.outlet_overrides);const Xp=Object(i.c)("div")`
  padding: 24px 32px;
  display: flex;
  flex: none;
  flex-direction: column;
`,qp=Object(i.c)("div")`
  margin-top: 1px;
  margin-left: 10px;
`,Zp=Object(i.c)("div")`
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid ${({theme:e})=>e.motifPalette.ui04};

  div:first-child {
    margin-bottom: 12px;
  }
`,Jp=Object(i.c)(h.a)`
  color: ${({theme:e})=>e.motifPalette.warning};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,Qp=Object(i.c)(h.r)`
  color: ${({theme:e})=>e.motifPalette.success};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`;var eI=({deviceData:e,hidePorts:t})=>{const{usedPower:a,maxPower:l}=Object(ve.getUspPduOutletUtilization)(e),i=Object(n.k)();return r.a.createElement(Xp,null,r.a.createElement(y.a,{justifyContent:"center"},r.a.createElement("div",null,r.a.createElement(Kp,{deviceData:e})),e.port_table&&!t&&r.a.createElement(qp,null,r.a.createElement(Sm,{deviceData:e,portSizeOverride:"19px",history:i}))),r.a.createElement(wp,{isForDiagram:!0,deviceData:e}),a>l&&r.a.createElement(Zp,null,r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(Jp,null),r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_WARNING"}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(Qp,null),r.a.createElement(T.a,{size:"caption"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_INFO"})))))};const tI=Object(i.c)("div")`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  padding-left: 10px;
`,aI=Object(i.c)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,nI=Object(i.c)(h.g)`
  position: absolute;
  right: 8px;
  color: inherit;
`;var lI=r.a.memo(({deviceData:e,deviceData:{outlet_table:t},hidePorts:a})=>{const i=Object(n.k)(),{path:c}=Object(n.n)(),{site:o,page:E,id:s,panel:m}=Object(n.m)(),d=Object(ve.getOutletNumbers)(e),{outletsDiagram:_,primaryOutletGroupCount:b}=Object(ve.getDeviceSpecs)(e),u=null==t?void 0:t.some(e=>Object(Uo.q)(e,"POWER_METER")),O=Object(l.useMemo)(()=>(e=>[{id:"name",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_NAME"})),renderCell:({name:e})=>r.a.createElement(T.a,{color:"inherit",size:"body",truncate:!0},e)},...e?[{id:"power",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_POWER"})),renderCell:({outlet_power:e})=>r.a.createElement(T.a,{color:"inherit",size:"body"},e?Number(e).toFixed(2):"-")}]:[],{id:"outletStatus",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_STATUS"})),renderCell:e=>r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{alignItems:"center"},e.portStatus?r.a.createElement(T.a,{color:"inherit",size:"body"},e.portStatus):r.a.createElement(r.a.Fragment,null,r.a.createElement(Wp,{cellData:e,rotateIcon:e.rotateIcon,tooltipPosition:"topRight"}),r.a.createElement(tI,null,r.a.createElement(D.b,{id:e.relay_state?"DEVICE_OUTLET_STATE_ENABLED":"DEVICE_OUTLET_STATE_DISABLED"})))),r.a.createElement(nI,{size:"small"}))}])(u),[u]),p=_.length?Object(ve.determineRowLayoutsFromOutletDiagramConfig)(_,e):Object(ve.determineRowLayoutsFromOutletConfig)(b,e),I=Object(l.useMemo)(()=>Object(Cd.c)(e,[],{position:"topRight"}),[e]),g=Object(l.useMemo)(()=>[...p.flat().filter(e=>!!e).sort(({outletNumber:e},{outletNumber:t})=>e-t),...a?[]:I],[a,I,p]).map((t,a)=>{const n=Object(ve.getActiveOutletInfo)(e,t.outletNumber-1);return{...t.portStatus?t:n,id:t.portStatus?"port-"+t.id:t.outletNumber+a,outletType:t.portStatus?null:Object(ve.getOutletTypeByNumber)(d,t.outletNumber),rotateIcon:null==t?void 0:t.rotateIcon}});return r.a.createElement(aI,null,r.a.createElement(ya.a,{columns:O,rowHeight:35,disableColumnFilters:!0,items:g,hideCellOverflow:!1,onRowClick:e=>i.push(Object(n.i)(c,{site:o,page:E,id:s,panel:m,subPanel:e.index?"outlets":"ports",subPanelId:e.index?e.index:e.port_idx}))}))},({deviceData:e},{deviceData:t})=>e.model===t.model&&e.outlet_table===t.outlet_table&&e.outlet_overrides===t.outlet_overrides);var rI=({activeItem:e,hidePorts:t,...a})=>r.a.createElement(r.a.Fragment,null,r.a.createElement(lI,Object.assign({deviceData:e,hidePorts:t},a)));const iI=Object(i.c)(y.a)`
  padding: 0 32px;
  li:nth-child(3) {
    > div:last-child {
      margin: 0 -32px; // allow outlet diagram overflow accordion
    }
  }
`,cI=Object(i.c)("div")`
  margin-bottom: 16px;
`,oI=Object(i.c)("div")`
  padding: 0 32px;
  margin-bottom: 32px;
`;var EI=Object(en.compose)(Qa(["general","lcmScreen","services","network"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c,...E})=>{const s=Object(o.useSelector)(Tr),m=Object(o.useSelector)(hr),d=Object(o.useSelector)(Dr),{_id:_,mac:b}=e,u=Object(o.useDispatch)(),O=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,O&&r.a.createElement(Um,{deviceData:e}),r.a.createElement(iI,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"ports",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_PORTS"}),renderContent:()=>r.a.createElement(Cm,{activeItem:e})},{id:"outlets",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_OUTLETS"}),renderContent:()=>r.a.createElement(r.a.Fragment,null,r.a.createElement(cI,null,r.a.createElement(eI,{hidePorts:!0,deviceData:e})),r.a.createElement(oI,null,r.a.createElement(rI,{hidePorts:!0,activeItem:e})))},{id:"lcmScreen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:i,onFormSubmit:()=>{const e=Object.entries(s).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...a}=e;u(Object(ve.updateDeviceWithIdEndpoint)(a,_,b,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(m).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(d).forEach(e=>{"function"==typeof e&&e()})}}))});const sI=Object(i.c)(y.a)`
  position: relative;
  margin: -18px -30px 25px;
  padding-bottom: 12px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};

  svg {
    position: absolute;
    left: 24px;
  }
`,mI=Object(i.c)(T.a)`
  width: 100%;
  text-align: center;
  padding: 0 50px;
`,dI=Object(i.c)(y.a)`
  padding: 30px;
`,_I=Object(i.c)(y.a)`
  margin-bottom: 24px;
`,bI=Object(i.c)(T.a)`
  display: flex;
`,uI=Object(i.c)(T.a)`
  margin-bottom: 3px;
`,OI=Object(i.c)(cn.a)`
  margin-left: 8px;
  margin-top: -2px;
`,pI=i.a`
  margin-left: 15px;
`,II=Object(i.c)(oe.a)`
  margin-top: 12px;
  justify-content: flex-end;
`,gI=Object(Ve.f)({mapPropsToValues:({outletInfo:{name:e,cycle_enabled:t,relay_state:a}})=>({name:e||"",cycle_enabled:t,relay_state:a}),validationSchema:tn.a.object().shape({name:tn.a.string().label("DEVICE_PROPERTIES_LABEL_NAME"),cycle_enabled:tn.a.boolean(),relay_state:tn.a.boolean()}),handleSubmit:(e,{props:{outletInfo:t,updateDeviceWithIdEndpoint:a,history:n,activeItem:l,activeItem:{mac:r,_id:i,outlet_overrides:c}}})=>{const o=Object(ve.isUspPduPro)(l);a({outlet_overrides:[...c.filter(e=>e.index!==t.index),{index:t.index,...e}].map(a=>t.index===Object(ve.getTwinOutletIndex)(a,o)?{...a,relay_state:e.relay_state}:a).sort((e,t)=>e.index-t.index)},i,r,{successToast:{icon:sa.a.success,message:"DEVICE_OUTLET_FORM_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_OUTLET_FORM_SAVE_ERROR"},mergeAndOverrideKeys:["outlet_overrides"],extend:!0}).then(()=>{n.goBack()})}}),vI={updateDeviceWithIdEndpoint:ve.updateDeviceWithIdEndpoint};var CI=Object(en.compose)(Object(o.connect)((e,{activeItem:t,params:{subPanelId:a}})=>({outletInfo:Object(ve.getActiveOutletInfo)(t,void 0,+a)}),vI),gI)(({dirty:e,submitForm:t,outletInfo:a,resetForm:n,history:l,activeItem:i})=>{const c=Object(o.useDispatch)(),E=()=>{n(),l.goBack()},s=Object(ve.isUspPduPro)(i),m=Object(ve.getTwinOutletIndex)(a,s),d=Object(Uo.q)(a,"POWER_METER");return r.a.createElement(r.a.Fragment,null,r.a.createElement(dI,{flexDirection:"column",width:"100%",height:"100%"},r.a.createElement(sI,{alignItems:"center"},r.a.createElement(h.f,{onClick:E,style:{cursor:"pointer"}}),r.a.createElement(mI,{color:"primary",size:"body",weight:"bold",truncate:!0},a.name)),r.a.createElement(_I,{flexDirection:"column",justifyContent:"space-between"},r.a.createElement(on.a,{full:!0,name:"name",label:"DEVICE_PROPERTIES_LABEL_NAME"})),r.a.createElement(_I,{alignItems:"flex-start",justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column",flex:"0 1 65%"},r.a.createElement(bI,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL"}),m&&r.a.createElement(OI,{position:"topRight",portal:!0,width:150,tooltipClassName:pI,message:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_TOOLTIP_LABEL_TWIN_RELAY_STATE",values:{index:m}})},r.a.createElement(h.cb,{isActive:!0}))),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"}))),r.a.createElement(on.a,{type:"checkbox",name:"relay_state"})),r.a.createElement(_I,null,d&&r.a.createElement(y.a,{flexDirection:"column",align:"space-around",width:"100%",paddingLeft:"24px",paddingRight:"24px"},a.outlet_power&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(uI,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER"})),r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:Number(a.outlet_power).toFixed(2)}}))),!1,a.outlet_current&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(uI,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_CURRENT"})),r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(a.outlet_current||0).toFixed(2)}}))),a.outlet_voltage&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(uI,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_VOLTAGE"})),r.a.createElement(T.a,null,r.a.createElement(D.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(a.outlet_voltage).toFixed(2)}}))),a.outlet_power_factor&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(uI,null,r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER_FACTOR"})),r.a.createElement(T.a,null,Number(a.outlet_power_factor).toFixed(2))))),r.a.createElement(_I,{alignItems:"flex-start",justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column",flex:"0 1 65%"},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE_DESCRIPTION"}))),r.a.createElement(on.a,{type:"checkbox",name:"cycle_enabled"})),r.a.createElement(_I,{flexDirection:"column"},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE_DESCRIPTION"})),r.a.createElement(II,{variant:"link",onClick:()=>c(Object(ve.powerCycleOutlet)(i,a)),Icon:r.a.createElement(h.Sb,null)},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_POWER_CYCLE"})))),r.a.createElement(Ar.a,{isDirty:e,onFormSubmit:t,onFormCancel:E,allowCancel:!0}))});var RI={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:hp},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:Lp},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:EI,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,activeItem:t,...a})=>"ports"===e.subPanel?r.a.createElement(e_,Object.assign({params:e,activeItem:t},a)):r.a.createElement(CI,Object.assign({params:e,activeItem:t},a))}}}};function TI({activeItem:e}){const{usedPower:t,totalCurrent:a}=Object(ve.getUspPduOutletUtilization)(e),n=[{messageId:"DEVICE_HEADER_POWER_USAGE",value:r.a.createElement(r.a.Fragment,null,r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t}}))},{messageId:"DEVICE_PROPERTY_OVERVIEW_ENERGY",value:r.a.createElement(r.a.Fragment,null,"0 ",r.a.createElement(D.b,{id:"COMMON_UNIT_KWH"}))},{messageId:"DEVICE_PROPERTY_OVERVIEW_CURRENT",value:r.a.createElement(r.a.Fragment,null,r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:a}}))}];return r.a.createElement(y.a,{flexDirection:"column"},[rl,cl].map(t=>r.a.createElement(t,{key:t.name,activeItem:e})),n.map(({messageId:e,value:t})=>r.a.createElement(la,{key:e},r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:e})),r.a.createElement(T.a,{size:"body"},t))))}const hI=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
`;var DI=r.a.memo(({activeItem:e,...t})=>{const a=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),a&&r.a.createElement(hI,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(TI,{activeItem:e})},{id:"uplink",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_UPLINK"}),renderContent:()=>r.a.createElement(gp,Object.assign({switchDeviceData:e,showSimplifiedActivity:!0},t))}],multiOpen:!0,renderOnlyExpandedContent:!0}))});const PI=Object(i.c)(h.b)`
  color: ${({theme:e})=>e.motifPalette.warning};
  margin-right: ${({theme:e})=>e.spacing["spacing-s"]};
  margin-bottom: 2px;
`;var yI=({activeItem:e})=>{const{usedPower:t,maxPower:a,usedPowerPercentage:n,barVariant:l}=Object(ve.getUspPduOutletUtilization)(e),i="warning"===l;return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TOTAL_WATTS"})),r.a.createElement(T.a,{size:"body",color:i?"warning":"secondary"},i&&r.a.createElement(PI,{size:"medium"}),r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TOTAL_WATTS_VALUE",values:{sum:t,max:a}}))),r.a.createElement(Ks.a,{items:[{value:n,variant:l}]}))};const fI=Object(i.c)(y.a)`
  padding: 16px 32px;
`,SI=Object(i.c)("div")`
  margin-bottom: 16px;
`;var AI=({activeItem:e})=>r.a.createElement(fI,{flexDirection:"column"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_HEADER_POWER_UTILIZATION"})),r.a.createElement(SI,null),r.a.createElement(yI,{activeItem:e}));const NI=Object(i.c)(y.a)`
  padding: 16px 32px;
`;var jI=Object(en.compose)(Qa(["general","outlets","lcmScreen","network","services","manage"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:l,intl:i,...c})=>{const E=Object(o.useSelector)(Tr),s=Object(o.useSelector)(hr),m=Object(o.useSelector)(Dr),{_id:d,mac:_}=e,b=Object(o.useDispatch)();return r.a.createElement(r.a.Fragment,null,r.a.createElement(eI,{deviceData:e}),r.a.createElement(NI,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"outlets",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_OUTLETS"}),renderContent:()=>r.a.createElement(rI,{activeItem:e})},{id:"lcmScreen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a,hideFlowControl:!0})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:l,onFormSubmit:()=>{const e=Object.entries(E).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...a}=e;b(Object(ve.updateDeviceWithIdEndpoint)(a,d,_,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(m).forEach(e=>{"function"==typeof e&&e()})}}))});var LI={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:DI},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:AI},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:jI,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,...t})=>"ports"===e.subPanel?r.a.createElement(e_,Object.assign({params:e},t)):r.a.createElement(CI,Object.assign({params:e},t))}}}};const xI=Object(i.c)(cn.a,{shouldForwardProp:e=>"itemCount"!==e})`
  > div {
    height: ${({itemCount:e})=>`calc(24px + ${14*e}px)`};
    padding: 8px 0 8px 8px;
    max-height: 108px;
  }
`,MI=Object(i.c)(y.a)`
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  &::-webkit-scrollbar-thumb {
    background-color: ${({theme:e})=>e.motifPalette.ui11};
  }
`;var VI=({wifiNetworkNames:e})=>e.length?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WIFI_NETWORK"})),r.a.createElement(T.a,{color:"secondary",size:"body"},e.length>1?r.a.createElement(xI,{itemCount:e.length,message:r.a.createElement(MI,{flexDirection:"column"},e.map(e=>r.a.createElement(T.a,{key:e},e))),position:"top",width:146,isInteractive:!0},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_WIFI_NETWORK_COUNT",values:{count:e.length}})):e[0])):null;function wI({activeItem:e}){const t=Object(o.useSelector)(Gc),a=Object(Wc.getWifiNetworkNames)(t,!1),n=Object(l.useMemo)(()=>[{Comp:rl,key:"Uptime"},{Comp:cl,key:"MemoryUsage"},{Comp:VI,props:{wifiNetworkNames:a},key:"WiFiNetwork"}],[a]);return r.a.createElement(y.a,{flexDirection:"column"},n.map(({Comp:t,props:a={},key:n})=>r.a.createElement(t,Object.assign({key:n,activeItem:e},a))))}const FI=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var UI=({activeItem:e})=>{const t=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),t&&r.a.createElement(FI,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(wI,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0}))};var zI=({activeItem:e})=>{const t=Object(o.useDispatch)();return Object(l.useEffect)(()=>{t(Object(Kn.fetchDeviceUsageReport)(e.mac))},[e.mac,t]),r.a.createElement(Ir,{gwMac:e.mac,keys:["mem"],pickDatumsWithKey:"ap",heading:"DEVICE_GATEWAY_USAGE_STAT_CHART_HEADER"})};const kI=Object(i.c)(y.a)`
  padding: 16px 32px;
`,BI=Object(i.c)("div")`
  margin-bottom: 16px;
`;var WI=({activeItem:e})=>r.a.createElement(kI,{flexDirection:"column"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"})),r.a.createElement(BI,null),r.a.createElement(zI,{activeItem:e}));const GI=Object(i.c)(y.a)`
  margin-bottom: 24px;
  justify-content: space-between;
`,HI=Object(i.c)(oe.a)`
  margin-top: 12px;
  justify-content: flex-end;
`;var YI=Object(Ve.f)({mapPropsToValues:({activeItem:{name:e,mac:t,outlet_table:a=[],outlet_overrides:n=[]}})=>({name:e!==t?e:"",outlet_overrides:[{...a[0],...n[0]}]}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(({activeItem:e,submitForm:t,values:a,dirty:n,isValid:i,resetForm:c,setFormDirty:E,setFormInvalid:s})=>{const m=Object(o.useDispatch)();return Object(l.useEffect)(()=>{E("general",n),s("general",!i)},[E,s,n,i]),Object(l.useEffect)(()=>(m(Object(v.h)({general:()=>a})),m(Object(v.j)({general:t})),m(Object(v.i)({general:c})),()=>{m(Object(v.h)({general:null})),m(Object(v.j)({general:null})),m(Object(v.i)({general:null}))}),[m,c,t,a]),r.a.createElement(y.a,{flexDirection:"column"},r.a.createElement(GI,{flexDirection:"column"},r.a.createElement(on.a,{full:!0,name:"name",label:"DEVICE_PROPERTIES_LABEL_DEVICE_NAME"})),r.a.createElement(GI,{alignItems:"flex-start",justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column",flex:"0 1 65%"},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL"})),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"}))),r.a.createElement(on.a,{type:"checkbox",name:"outlet_overrides[0].relay_state"})),r.a.createElement(GI,{alignItems:"flex-start",justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column",flex:"0 1 65%"},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE"})),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE_DESCRIPTION"}))),r.a.createElement(on.a,{type:"checkbox",name:"outlet_overrides[0].cycle_enabled"})),r.a.createElement(GI,{flexDirection:"column"},r.a.createElement(y.a,{flexDirection:"column",width:"65%"},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE"})),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE_DESCRIPTION"}))),r.a.createElement(HI,{variant:"link",onClick:()=>m(Object(ve.powerCycleOutlet)(e,a.outlet_overrides[0])),Icon:r.a.createElement(h.Sb,null)},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_POWER_CYCLE"}))))});const $I=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;var KI=Object(en.compose)(Qa(["general","network","screen","manage"]),D.e)(({activeItem:{mac:e,_id:t},activeItem:a,setFormDirty:n,setFormInvalid:l,isDirty:i,isInvalid:c,intl:E})=>{const s=Object(o.useDispatch)(),m=Object(o.useSelector)(Tr),d=Object(o.useSelector)(hr),_=Object(o.useSelector)(Dr);return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement($I,{variant:"secondary",items:[{id:"general",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),renderContent:()=>r.a.createElement(YI,{activeItem:a,setFormDirty:n,setFormInvalid:l})},{id:"screen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED"}),renderContent:()=>r.a.createElement(lE,{activeItem:a,setFormDirty:n,disableLedBrightnessField:!0,disableLedOverrideColor:!0})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:a,setFormDirty:n,setFormInvalid:l})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:a,disableDebug:!0})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:i,isInvalid:c,onFormSubmit:()=>{const a=Object.entries(m).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});s(Object(ve.updateDeviceWithIdEndpoint)(a,t,e,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(d).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(_).forEach(e=>{"function"==typeof e&&e()})}}))});var XI={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:UI},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:WI},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:KI}}};const qI=Object(i.c)(y.a)`
  position: relative;
  margin: -18px -30px 25px;
  padding-bottom: 12px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  svg {
    position: absolute;
    left: 24px;
  }
`,ZI=Object(i.c)(T.a)`
  width: 100%;
  text-align: center;
  text-transform: uppercase;
`,JI=Object(i.c)(y.a)`
  padding: 30px;
`,QI=Object(i.c)(y.a)`
  margin-bottom: 24px;
`,eg=Object(i.c)(T.a)`
  display: flex;
`,tg=Object(i.c)(Be.a)`
  margin-top: 12px;
  justify-content: flex-end;
`,ag=Object(Ve.f)({mapPropsToValues:({outletInfo:{name:e,port_mode:t}})=>({name:e||"",portModeAuto:t===ve.RpsPortMode.AUTO}),validationSchema:tn.a.object().shape({name:tn.a.string().label("DEVICE_PROPERTIES_LABEL_NAME"),portModeAuto:tn.a.boolean()}),handleSubmit:({portModeAuto:e,...t},{props:{outletInfo:a,updateDeviceWithIdEndpoint:n,history:l,activeItem:{rps_override:r,mac:i,_id:c}}})=>{var o;const E=[{port_idx:a.port_idx,port_mode:e?ve.RpsPortMode.AUTO:ve.RpsPortMode.DISABLED,...t},...null!==(o=null==r?void 0:r.rps_port_table.filter(e=>e.port_idx!==a.port_idx))&&void 0!==o?o:[]];n({rps_override:{...r,rps_port_table:E}},c,i,{successToast:{icon:sa.a.success,message:"DEVICE_OUTLET_FORM_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_OUTLET_FORM_SAVE_ERROR"},mergeAndOverrideKeys:["rps_override"],extend:!0}).then(()=>{l.goBack()})}}),ng={updateDeviceWithIdEndpoint:ve.updateDeviceWithIdEndpoint};var lg=Object(en.compose)(Object(o.connect)((e,{activeItem:t,params:{subPanelId:a}})=>({outletInfo:Object(ve.getActiveRpsOutletInfo)(t,+a)}),ng),ag)(({activeItem:e,dirty:t,submitForm:a,outletInfo:n,resetForm:l,history:i,setFieldValue:c,values:E})=>{const s=Object(o.useDispatch)(),m=()=>{l(),i.goBack()};return r.a.createElement(r.a.Fragment,null,r.a.createElement(JI,{flexDirection:"column",width:"100%",height:"100%"},r.a.createElement(qI,{alignItems:"center"},r.a.createElement(h.f,{onClick:m,style:{cursor:"pointer"}}),r.a.createElement(ZI,{weight:"bold"},n.name)),r.a.createElement(QI,{flexDirection:"column",justifyContent:"space-between"},r.a.createElement(on.a,{full:!0,name:"name",label:"DEVICE_PROPERTIES_LABEL_NAME"})),r.a.createElement(QI,{alignItems:"flex-start",justifyContent:"space-between"},r.a.createElement(y.a,{flexDirection:"column",flex:"0 1 65%"},r.a.createElement(eg,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL"})),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"}))),r.a.createElement(on.a,{type:"checkbox",name:"portModeAuto"})),r.a.createElement(QI,{flexDirection:"column"},r.a.createElement(T.a,{color:"primary",size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_PORT_RECOVERY"})),r.a.createElement(T.a,{size:"body",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_PORT_RECOVERY_DESCRIPTION"})),r.a.createElement(tg,{variant:"link",disabled:!n.port_error_disabled,onClick:()=>s(Object(ve.rpsPortRecovery)(e,n)),Icon:r.a.createElement(h.Sb,null)},r.a.createElement(D.b,{id:"DEVICE_ACTIONS_PORT_RECOVERY"})))),r.a.createElement(Ar.a,{isDirty:t,onFormSubmit:a,onFormCancel:m,allowCancel:!0}))});function rg({activeItem:e}){const t=[{Comp:bp,key:"Temperature"},{Comp:up,key:"FanLevel"},{Comp:rl,key:"Uptime"},{Comp:cl,key:"MemoryUsage"},{Comp:ml,key:"LoadAverage"}];return r.a.createElement(y.a,{flexDirection:"column"},t.map(({Comp:t,key:a})=>r.a.createElement(t,{key:a,activeItem:e})))}const ig=Object(i.c)("div")`
  margin-bottom: 12px;
`,cg=["backup","delivering"];var og=({activeItem:e})=>{const t=Object(ve.getRpsPortUtilization)(null==e?void 0:e.rps);return r.a.createElement(r.a.Fragment,null,t.map(e=>r.a.createElement(l.Fragment,{key:e.voltage},cg.map(t=>r.a.createElement(l.Fragment,{key:t},e[t].ports.map(a=>r.a.createElement(ig,{key:a.id},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"body",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_UTILIZATION_BAR_HEADING_"+t.toUpperCase(),values:{voltage:e.voltage,portId:a.id}})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_TOTAL_WATTS_VALUE",values:{sum:a.powerRequired,max:e[t].total}}))),r.a.createElement(Ks.a,{items:[{variant:"primary",value:a.powerRequired/e[t].total*100}]}))))))))};const Eg=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
`;var sg=r.a.memo(({activeItem:e})=>{const t=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),t&&r.a.createElement(Eg,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(rg,{activeItem:e})},{id:"powerUtilization",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>r.a.createElement(og,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0}))});const mg=Object(i.c)(y.a)`
  padding: 0 32px;
`;var dg=Object(en.compose)(Qa(["general","outlets","screen","services","network","manage"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:l,intl:i})=>{const c=Object(o.useSelector)(Tr),E=Object(o.useSelector)(hr),s=Object(o.useSelector)(Dr),{_id:m,mac:d}=(Object(ve.isAdopted)(e),e),_=Object(o.useDispatch)(),b=Object(Uo.l)(e),u=b?"lcmScreen":"screen";return r.a.createElement(r.a.Fragment,null,r.a.createElement(mg,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:u,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>b?r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a}):r.a.createElement(lE,{activeItem:e,setFormDirty:t})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a,hideFlowControl:!0})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:l,onFormSubmit:()=>{const e=Object.entries(c).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...a}=e;_(Object(ve.updateDeviceWithIdEndpoint)(a,m,d,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(E).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})}}))});const _g=(e,t)=>Object.keys(t).filter(t=>parseInt(t,10)&e).map(e=>t[e]),bg={1:"RPS_PORT_12V_OUT_OF_BUDGET",2:"RPS_PORT_54V_OUT_OF_BUDGET",4:"RPS_PORT_12V_OVERLOAD",8:"RPS_PORT_54V_OVERLOAD",16:"RPS_PORT_POWER_DENIED_PSU_12V_OVERLOAD",32:"RPS_PORT_POWER_DENIED_PSU_54V_OVERLOAD",64:"RPS_PORT_BLOCKED"},ug={RPS_PORT_OUT_OF_BUDGET_SOLUTION:["RPS_PORT_12V_OUT_OF_BUDGET","RPS_PORT_54V_OUT_OF_BUDGET"],RPS_PORT_OVERLOAD_SOLUTION:["RPS_PORT_12V_OVERLOAD","RPS_PORT_54V_OVERLOAD"],RPS_PORT_POWER_DENIED_PSU_OVERLOAD_SOLUTION:["RPS_PORT_POWER_DENIED_PSU_12V_OVERLOAD","RPS_PORT_POWER_DENIED_PSU_54V_OVERLOAD"],RPS_PORT_BLOCKED_SOLUTION:["RPS_PORT_BLOCKED"]};var Og=a(2773);const pg=Object(i.c)(y.a)`
  padding: 10px 0;
`,Ig=Object(i.c)("ul")`
  padding-left: 22px;
  margin-top: 6px;
  margin-bottom: 0;
  li {
    margin-bottom: ${({theme:e})=>e.spacing["spacing-xs"]};
    span {
      line-height: 16px;
    }
  }

  li:last-child {
    margin-bottom: 0;
  }
`,gg=Object(i.c)(h.r)`
  color: ${({theme:e})=>e.motifPalette.success};
  margin-right: 9px;
  width: 18px;
  height: 18px;
`,vg=Object(i.c)(h.a)`
  color: ${({theme:e})=>e.motifPalette.danger};
  margin-right: 9px;
  width: 18px;
  height: 18px;
`,Cg=Object(i.c)("div")`
  margin: 20px 0;
`;var Rg=Object(D.e)(({anomalies:e,intl:t})=>{const[a,n]=Object(l.useState)(!1),i=Object(l.useMemo)(()=>t.formatMessage({id:"COMMON_AND"}),[]),c=Object.keys(e).filter(t=>e[t].length),o=c.length;return r.a.createElement(r.a.Fragment,null,c.slice(0,a?o:2).map(t=>{const a=e[t];return r.a.createElement(y.a,{marginTop:4,flexDirection:"column"},r.a.createElement(pg,{flexDirection:"column"},r.a.createElement(y.a,{alignItems:"flex-start"},r.a.createElement(vg,null),r.a.createElement(T.a,null,r.a.createElement(Og.a,{weight:"bold",color:"danger"},r.a.createElement(D.b,{id:"RPS_ANOMALY_PROBLEM"})))),r.a.createElement(Ig,null,a.map((e,t)=>{const a={ports:(n=e.values.ports,[n.slice(0,-1).join(", "),n.slice(-1)].filter(Boolean).join(` ${i} `)),count:e.values.ports.length};var n;return r.a.createElement("li",{key:`rps-problem-${e.problem}-${a.count}`},r.a.createElement(D.b,{id:e.problem+"_PROBLEM",values:a}))}))),r.a.createElement(pg,{flexDirection:"column"},r.a.createElement(y.a,{alignItems:"flex-start"},r.a.createElement(gg,null),r.a.createElement(T.a,null,r.a.createElement(Og.a,{weight:"bold",color:"success"},r.a.createElement(D.b,{id:"RPS_ANOMALY_SOLUTION"})))),r.a.createElement(Ig,null,r.a.createElement("li",{key:"rps-solution-"+t},r.a.createElement(D.a,{id:t})))))}),r.a.createElement(Cg,null,r.a.createElement(D.b,{id:"RPS_ANOMALY_FOOTER_RECORDS",values:{length:o>2&&!a?2:o,total:o}}),o>2?r.a.createElement(r.a.Fragment,null," ",r.a.createElement(oe.a,{type:"button",variant:"inline",size:"small",weight:"bold",onClick:()=>n(!a)},r.a.createElement(D.b,{id:"COMMON_SHOW"})," ",r.a.createElement(D.b,{id:a?"COMMON_LESS":"COMMON_ALL"}))):null))});const Tg=Object(i.c)("div")`
  padding-top: 16px;
`;function hg({deviceData:e}){const t=((e,t,a)=>{var n,l;const r=Object.keys(a);return((null===(l=null===(n=null==e?void 0:e.rps)||void 0===n?void 0:n.anomalies_details)||void 0===l?void 0:l.map(e=>({problem:_g(e.anomaly,t)[0],values:{ports:e.ports}})))||[]).reduce((e,t)=>{const n=r.find(e=>a[e].includes(t.problem));return e[n]=e[n]||[],e[n].push(t),e},{})})(e,bg,ug);return Object.keys(t).length?r.a.createElement(Tg,null,r.a.createElement(Rg,{anomalies:t})):null}var Dg=a(1657);const Pg=Object(i.c)(cn.a,{shouldForwardProp:e=>"color"!==e&&"isTableItem"!==e})`
  width: ${({isTableItem:e})=>e?"20px":"90px"};
  height: 20px;
  align-items: center;
  background-color: ${({color:e,theme:t})=>t.motifPalette[e]};
  border-radius: 2px;
  color: #fff;
  justify-content: center;
  display: flex;
  position: relative;
  ${({isTableItem:e})=>e&&"margin-right: 8px;"}

  &:not(:first-child) {
    margin-left: 8px;
  }

  div:last-child {
    right: -15px;
  }
`,yg=i.a`
  margin-left: 15px;
`,fg=Object(i.c)("div")`
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    max-width: 70%;
    max-height: 70%;
  }
`,Sg=Object(i.c)(T.a)`
  max-width: 140px;
`;var Ag=({cellData:e,isTableItem:t=!1,tooltipPosition:a="bottomRight"})=>{const l=Object(n.k)(),{path:i}=Object(n.n)(),{site:c,page:E,id:s,panel:m}=Object(n.m)(),d=Object(o.useSelector)(ve.selectDevicesData),{peer:_}=e,b=d.find(e=>e.mac===(null==_?void 0:_.mac)),u=Object(x.c)(b),O=Object(x.a)(b)||(null==_?void 0:_.model),p=Object(ve.getRspOutletIcons)(e),I=Object(ve.getRspOutletColor)(e);return r.a.createElement(Pg,{color:I,tooltipClassName:yg,onClick:t=>{var a,r;null===(a=null==t?void 0:t.preventDefault)||void 0===a||a.call(t),null===(r=null==t?void 0:t.stopPropagation)||void 0===r||r.call(t),l.push(Object(n.i)(i,{site:c,page:E,id:s,panel:m,subPanel:"rps_outlets",subPanelId:e.port_idx}))},width:b?240:200,isTableItem:t,message:r.a.createElement(y.a,{flexDirection:"column",justifyContent:"space-between",width:"100%"},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_OUTLET"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},e.port_idx)),r.a.createElement(y.a,{justifyContent:"space-between",alignItems:"center"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_NAME"})),r.a.createElement(T.a,{size:"caption",color:"secondary",truncate:!0},null==e?void 0:e.name)),(null==e?void 0:e.port_mode)&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_MODE"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},Object(Kl.a)(e.port_mode))),(null==e?void 0:e.port_state)&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_STATE"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_"+e.port_state.toUpperCase()}))),(null==e?void 0:e.up)&&ve.RPS_VOLTAGES.map(t=>r.a.createElement("div",{key:t},r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary",weight:"bold"},r.a.createElement(D.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:t}}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_CURRENT"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:e[`power_${t}v_current`]}}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_VOLTAGE"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:e[`power_${t}v_voltage`]}}))),r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_POWER"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e[`power_${t}v_power`]}}))))),(_||b)&&r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER"}))),(u||(null==_?void 0:_.hostname))&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_NAME"})),r.a.createElement(Sg,{size:"caption",color:"secondary",truncate:!0},u||(null==_?void 0:_.hostname))),_.mac&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_MAC"})),r.a.createElement(T.a,{size:"caption",color:"secondary"},_.mac)),O&&r.a.createElement(y.a,{justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_MODEL"})),r.a.createElement(Sg,{size:"caption",color:"secondary",truncate:!0},O)),ve.RPS_VOLTAGES.map(e=>r.a.createElement(y.a,{key:e,justifyContent:"space-between"},r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER_POWER_REQUIRED",values:{voltage:e}})),r.a.createElement(T.a,{size:"caption",color:"secondary"},r.a.createElement(D.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:null==_?void 0:_[`power_required_${e}v`]}})))))),position:a,portal:!0},r.a.createElement(fg,null,e.port_mode!==ve.RpsPortMode.DISABLED&&r.a.createElement(Dg.a,{icons:p})))};const Ng=Object(i.c)(h.g)`
  position: absolute;
  right: 8px;
  color: inherit;
`,jg=Object(i.c)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,Lg=[{id:"name",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_NAME"})),renderCell:e=>r.a.createElement(T.a,{color:"inherit",size:"body"},e.name)},{id:"outletStatus",label:r.a.createElement(T.a,{size:"label",color:"inherit",weight:"bold"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_STATUS"})),renderCell:e=>{var t,a;const n="disabled"===e.port_mode?null===(t=null==e?void 0:e.port_mode)||void 0===t?void 0:t.toUpperCase():null===(a=null==e?void 0:e.port_state)||void 0===a?void 0:a.toUpperCase();return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Ag,{cellData:e,isTableItem:!0}),r.a.createElement(T.a,{color:"inherit",size:"body"},r.a.createElement(D.b,{id:n?"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_"+n:"COMMON_WORD_INITIALIZING"}),!n&&r.a.createElement(T.a,{color:"inherit",size:"body"},"..."))),r.a.createElement(Ng,{size:"small"}))}}];var xg=({deviceData:e,deviceData:{rps:t}})=>{const a=Object(n.k)(),{path:i}=Object(n.n)(),{site:c,page:o,id:E,panel:s}=Object(n.m)(),m=Object(l.useMemo)(()=>{var a;return null===(a=t.rps_port_table)||void 0===a?void 0:a.map(t=>{const a=Object(ve.getActiveRpsOutletInfo)(e,t.port_idx);return{id:t.port_idx,...a}})},[t.rps_port_table,e]);return r.a.createElement(jg,null,r.a.createElement(ya.a,{columns:Lg,rowHeight:35,items:m,disableColumnFilters:!0,hideCellOverflow:!1,onRowClick:e=>m.some(e=>e.port_state)&&a.push(Object(n.i)(i,{site:c,page:o,id:E,panel:s,subPanel:"rps_outlets",subPanelId:e.id}))}))};const Mg=Object(i.c)(y.a)`
  font-size: ${({theme:e})=>e.fontSizes[0]}px;
`,Vg=Object(i.c)(y.a)`
  &:not(:first-child) {
    margin-top: 8px;
  }
`,wg=Object(i.c)(h.cb)`
  margin-right: 12px;
`,Fg=Object(i.c)("div")`
  width: 5px;
`;var Ug=({deviceData:e})=>{const{rps:{diagram:t,primaryPortGroupCount:a}}=Object(ve.getDeviceSpecs)(e),n=t.length?Object(ve.determineRowLayoutsFromOutletDiagramConfig)(t,e):Object(ve.determineRowLayoutsFromOutletConfig)(a,e);return n&&0!==n.length?r.a.createElement(r.a.Fragment,null,n.map((t,a)=>r.a.createElement(Vg,{justifyContent:"center",width:"100%",key:"RpsOutletLayoutRow-"+(a+1)},t.map((t,n)=>{if(!t)return r.a.createElement(Fg,{key:`RpsOutletSpacer-${a+1}-${n+1}`});const l=`RpsOutlet-${a+1}-${n+1}`,i=Object(ve.getActiveRpsOutletInfo)(e,t.outletNumber);return r.a.createElement(Ag,{cellData:i,key:l})})))):r.a.createElement(Mg,null,r.a.createElement(wg,{isActive:!0}),r.a.createElement(D.b,{id:"DEVICE_DIAGRAM_MISSING"}))};const zg=Object(i.c)(y.a)`
  padding: 0 32px;
`,kg=Object(i.c)("div")`
  padding: 24px 32px;
  display: flex;
  flex: none;
  flex-direction: column;
`;var Bg=({activeItem:e})=>r.a.createElement(r.a.Fragment,null,r.a.createElement(kg,null,r.a.createElement(y.a,{flexDirection:"column",alignItems:"center"},r.a.createElement(Ug,{deviceData:e})),r.a.createElement(wp,{isForDiagram:!0,deviceData:e}),r.a.createElement(hg,{deviceData:e})),r.a.createElement(zg,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(xg,{deviceData:e})));var Wg={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:sg},ports:{path:"/ports",title:"DEVICE_PROPERTY_HEADER_PORTS",icon:h.I,component:Bg,subpanel:{path:"/:subPanel",component:lg}},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:dg,subpanel:{path:"/:subPanel/:subPanelId",component:lg}}}};function Gg({activeItem:e}){const t=[{Comp:bp,key:"Temperature"},{Comp:up,key:"FanLevel"},{Comp:rl,key:"Uptime"},{Comp:cl,key:"MemoryUsage"},{Comp:ml,key:"LoadAverage"}];return r.a.createElement(y.a,{flexDirection:"column"},t.map(({Comp:t,key:a})=>r.a.createElement(t,{key:a,activeItem:e})))}const Hg=Object(i.c)(Ht.a)`
  margin-right: 15px;
`;var Yg=({activeItem:e})=>{const t=Object(ve.getPsuExternalBattery)(e),a=Object(l.useMemo)(()=>(null==t?void 0:t.present)?(null==t?void 0:t.charge_status)?"DEVICE_BATTERY_STATE_"+t.charge_status.replace(" ","_").toUpperCase():"DEVICE_BATTERY_STATE_UNKNOWN":"DEVICE_BATTERY_STATE_NO_BATTERY",[null==t?void 0:t.charge_status,null==t?void 0:t.present]),n=Object(l.useMemo)(()=>{var e;return["charging","discharging"].includes(null===(e=null==t?void 0:t.charge_status)||void 0===e?void 0:e.toLowerCase().trim())},[null==t?void 0:t.charge_status]),i=Object(l.useMemo)(()=>{const e=null==t?void 0:t.charge_status;return e===ve.PsuChargeStatus.FULL?"success":e===ve.PsuChargeStatus.CHARGING||e===ve.PsuChargeStatus.DISCHARGING?"warning":void 0},[null==t?void 0:t.charge_status]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_CHARGE_STATUS"})),r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Hg,{variant:i,pulsating:n}),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:a})))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_VOLTAGE"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:Number(t.voltage).toFixed(1)}}))),r.a.createElement(la,null,r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_OVERVIEW_CURRENT"})),r.a.createElement(T.a,{size:"body"},r.a.createElement(D.b,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:Number(t.current).toFixed(1)}}))))};const $g=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
`;var Kg=r.a.memo(({activeItem:e})=>{const t=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),t&&r.a.createElement($g,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(Gg,{activeItem:e})},{id:"powerUtilization",label:r.a.createElement(D.b,{id:"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>r.a.createElement(og,{activeItem:e})},{id:"externalBattery",label:r.a.createElement(D.b,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"}),renderContent:()=>r.a.createElement(Yg,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0}))});const Xg=Object(i.c)(y.a)`
  padding: 0 32px;
`,qg=Object(i.c)("div")`
  padding: 24px 32px;
  background: ${({theme:e})=>e.motifPalette.ui11};
  display: flex;
  flex: none;
  flex-direction: column;
`,Zg=Object(i.c)(T.a)`
  align-items: center;
  justify-content: center;
  margin: 16px 0 8px;
`,Jg=Object(i.c)("div")`
  margin-top: 1px;
  margin-left: 10px;
`;var Qg=({activeItem:e})=>{const t=Object(n.k)(),a=Object(ve.isAdopted)(e);return r.a.createElement(r.a.Fragment,null,a&&r.a.createElement(qg,null,r.a.createElement(y.a,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-evenly"},r.a.createElement(y.a,{flexDirection:"column",alignItems:"center"},r.a.createElement(Ug,{deviceData:e})),r.a.createElement(y.a,{justifyContent:"center"},r.a.createElement("div",null,r.a.createElement(Kp,{deviceData:e})),e.port_table&&r.a.createElement(Jg,null,r.a.createElement(Sm,{deviceData:e,portSizeOverride:"19px",history:t})))),r.a.createElement(wp,{isForDiagram:!0,deviceData:e}),r.a.createElement(hg,{deviceData:e})),r.a.createElement(Xg,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(xg,{deviceData:e}),r.a.createElement(Zg,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_ETHERNET_PORT"})),r.a.createElement(Cm,{activeItem:e}),r.a.createElement(Zg,{weight:"bold",size:"body"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_OUTLETS"})),r.a.createElement(rI,{hidePorts:!0,activeItem:e})))};const ev=Object(i.c)(y.a)`
  padding: 0 32px;
`;var tv=Object(en.compose)(Qa(["general","screen","services","network","manage"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c})=>{const E=Object(o.useSelector)(Tr),s=Object(o.useSelector)(hr),m=Object(o.useSelector)(Dr),{_id:d,mac:_}=e,b=Object(o.useDispatch)(),u=Object(Uo.l)(e),O=u?"lcmScreen":"screen",p=Object(l.useCallback)(()=>{const e=Object.entries(E).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...a}=e;b(Object(ve.updateDeviceWithIdEndpoint)(a,d,_,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})})},[E]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(ev,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:O,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>u?r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a}):r.a.createElement(lE,{activeItem:e,setFormDirty:t})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a,hideFlowControl:!0})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:i,onFormSubmit:p,onFormCancel:()=>{Object.values(m).forEach(e=>{"function"==typeof e&&e()})}}))});var av={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:Kg},ports:{path:"/ports",title:"DEVICE_PROPERTY_HEADER_PORTS",icon:h.I,component:Qg,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,...t})=>{switch(e.subPanel){case"ports":return r.a.createElement(e_,Object.assign({params:e},t));case"outlets":return r.a.createElement(CI,Object.assign({params:e},t));default:return r.a.createElement(lg,Object.assign({params:e},t))}}}},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:tv}}};var nv=({activeItem:e,wan:t=!1,lan:a=!1})=>{const n=Object(l.useMemo)(()=>e.lan_ip||e.ip,[e]),i=Object(l.useMemo)(()=>{let e="COMMON_IP_ADDRESS";return t?e="DEVICE_PROPERTY_OVERVIEW_WAN_IP_ADDRESS":a&&(e="DEVICE_PROPERTY_OVERVIEW_LAN_IP_ADDRESS"),r.a.createElement(D.b,{id:e})},[t,a]);return n?r.a.createElement(la,null,r.a.createElement(T.a,{color:"secondary",size:"body"},i),r.a.createElement(T.a,{color:"secondary",size:"body"},n)):null};var lv=({activeItem:e})=>{const t=Object(o.useSelector)(Gc),a=Object(Wc.getWifiNetworkNames)(t,!1),n=Object(l.useMemo)(()=>[{Comp:nv,props:{wan:!0},key:"IpAddress"},{Comp:rl,key:"Uptime"},{Comp:cl,key:"MemoryUsage"},{Comp:VI,props:{wifiNetworkNames:a},key:"WiFiNetwork"}],[a]);return r.a.createElement(y.a,{height:"100%",flexDirection:"column"},n.map(({Comp:t,props:a={},key:n})=>r.a.createElement(t,Object.assign({key:n,activeItem:e},a))))};const rv=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
`;var iv=({activeItem:e})=>{const t=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),t&&r.a.createElement(rv,{variant:"secondary",items:[{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(lv,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0}))};var cv=({activeItem:e})=>{const t=Object(o.useDispatch)();return Object(l.useEffect)(()=>{t(Object(Kn.fetchDeviceUsageReport)(e.mac))},[e.mac,t]),r.a.createElement(Ir,{gwMac:e.mac,keys:["mem"],pickDatumsWithKey:"ap",heading:"DEVICE_GATEWAY_USAGE_STAT_CHART_HEADER"})};const ov=Object(i.c)(y.a)`
  padding: 16px 32px;
`,Ev=Object(i.c)("div")`
  margin-bottom: 16px;
`;var sv=({activeItem:e})=>r.a.createElement(ov,{flexDirection:"column"},r.a.createElement(T.a,{weight:"bold",size:"body",color:"primary"},r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"})),r.a.createElement(Ev,null),r.a.createElement(cv,{activeItem:e}));const mv=Object(i.c)(y.a)`
  padding: 0 32px;
`;var dv=Object(en.compose)(Qa(["general","led","network","manage"]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:l,intl:i})=>{const c=Object(o.useSelector)(Tr),E=Object(o.useSelector)(hr),s=Object(o.useSelector)(Dr),{_id:m,mac:d}=e,_=Object(o.useDispatch)();return r.a.createElement(r.a.Fragment,null,r.a.createElement(eI,{deviceData:e,hidePorts:!0}),r.a.createElement(mv,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"outlets",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_OUTLETS"}),renderContent:()=>r.a.createElement(rI,{hidePorts:!0,activeItem:e})},{id:"led",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_LED"}),renderContent:()=>r.a.createElement(r_,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],renderOnlyExpandedContent:!0,multiOpen:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:l,onFormSubmit:()=>{const e=Object.entries(c).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});_(Object(ve.updateDeviceWithIdEndpoint)(e,m,d,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(E).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})}}))});var _v={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:iv},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:sv},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:dv,subpanel:{path:"/:subPanel/:subPanelId",component:CI}}}};var bv=({activeItem:e})=>{const t=Object(o.useDispatch)();return Object(l.useEffect)(()=>{t(Object(Kn.fetchDeviceUsageReport)(e.mac))},[e.mac,t]),r.a.createElement(Ir,{gwMac:e.mac,keys:["mem","cpu"],pickDatumsWithKey:"sw",heading:"DEVICE_GATEWAY_USAGE_STAT_CHART_HEADER"})};const uv=Object(i.c)(ga.a)`
  transition: none;
  padding: 0 ${({theme:e})=>e.space[5]+"px"};
`;const Ov=Object(i.c)(y.a)`
  padding: 0 32px;
`;var pv=Object(en.compose)(Qa(["general","lcmScreen","screen","services","network"]))(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:l})=>{const i=Object(o.useSelector)(Tr),c=Object(o.useSelector)(hr),E=Object(o.useSelector)(Dr),{_id:s,mac:m}=e,d=Object(o.useDispatch)(),_=Object(Uo.l)(e),b=_?"lcmScreen":"screen";return r.a.createElement(r.a.Fragment,null,r.a.createElement(Ov,{flexDirection:"column",flex:"1 1 85%"},r.a.createElement(ga.a,{variant:"secondary",items:[{id:"general",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),openByDefault:!0,renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:b,label:_?r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}):r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_LED"}),renderContent:()=>_?r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a}):r.a.createElement(lE,{activeItem:e,setFormDirty:t})},{id:"network",label:r.a.createElement(D.b,{id:"COMMON_NETWORK"}),renderContent:()=>r.a.createElement(Hr,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(Zo,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"manage",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e})}],multiOpen:!0,renderOnlyExpandedContent:!0})),r.a.createElement(Ar.a,{isDirty:n,isInvalid:l,onFormSubmit:()=>{const e=Object.entries(i).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...a}=e;d(Object(ve.updateDeviceWithIdEndpoint)(a,s,m,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(c).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(E).forEach(e=>{"function"==typeof e&&e()})}}))});const Iv=Object(i.c)(h.I)`
  margin: 2px;
`;var gv={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:function({activeItem:e,...t}){const[a]=Object(l.useState)("SwitchAbout-"+Date.now()),n=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),i=Object(o.useDispatch)(),c={style:gm.a.overflow,styleName:"overflow",dependant:a};return Object(l.useEffect)(()=>(i(Object(Im.c)(c)),()=>{i(Object(Im.b)(c))}),[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(nr,{device:e}),n&&r.a.createElement(r.a.Fragment,null,r.a.createElement(xl,{activeItem:e}),r.a.createElement(uv,{variant:"secondary",items:[{id:"clientsGuests",openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_CLIENTS_GUESTS"}),renderContent:()=>r.a.createElement(Fc,Object.assign({hideSignalTab:!0,activeItem:e},t))},{id:"overview",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_GENERAL"}),openByDefault:!0,renderContent:()=>r.a.createElement(Op,{switchDeviceData:e})},{id:"uplink",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_UPLINK_WIRED"}),renderContent:()=>r.a.createElement(gp,Object.assign({switchDeviceData:e,showSimplifiedActivity:!0},t))},{id:"downlink",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_DOWNLINK"}),renderContent:()=>r.a.createElement(Qm,Object.assign({activeItem:e},t))},{id:"statistics",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_STATS"}),renderContent:()=>r.a.createElement(bv,Object.assign({activeItem:e},t))}],multiOpen:!0,renderOnlyExpandedContent:!0})))}},ports:{path:"/ports",title:"DEVICE_PROPERTY_HEADER_PORTS",icon:()=>r.a.createElement(Iv,null),component:Db,subpanel:{path:"/:subPanel/:subPanelId",component:({params:e,activeItem:t,...a})=>{switch(e.subPanel){case"ports":return e.subPanelId===jt.b.WAN?r.a.createElement(yu.a,Object.assign({params:e,activeItem:t},a)):r.a.createElement(e_,Object.assign({params:e,activeItem:t},a));default:return r.a.createElement(r.a.Fragment,null)}}}},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:pv}}};const vv=Object(i.c)(ga.a)`
  padding: 0 ${({theme:e})=>e.spacing["spacing-xxxxl"]};
  li:last-child {
    border-bottom: none;
  }
`,Cv=Object(i.c)("div")`
  margin-bottom: 16px;
`,Rv=Object(i.c)("div")`
  padding: 0 32px;
  margin-bottom: 32px;
`;var Tv;!function(e){e.NAME="name",e.PORTS="ports",e.MANAGE="manage"}(Tv||(Tv={}));var hv=Object(en.compose)(Qa([Tv.NAME,"lcmScreen","services",Tv.MANAGE]),D.e)(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:n,isInvalid:i,intl:c})=>{const E=Object(o.useSelector)(hr),s=Object(o.useSelector)(Dr),m=Object(o.useSelector)(Tr),d=Object(l.useMemo)(()=>Object(ve.isAdopted)(e),[e]),_=Object(o.useDispatch)(),b=!Object(Uo.a)(e,ve.FIRMWARE_CAPS.UTERM),{_id:u,mac:O}=e;return r.a.createElement(r.a.Fragment,null,d&&r.a.createElement(Um,{deviceData:e}),r.a.createElement(vv,{variant:"secondary",items:[{id:Tv.NAME,openByDefault:!0,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_NAME"}),renderContent:()=>r.a.createElement(Sr,{activeItem:e,setFormDirty:t,setFormInvalid:a,formName:Tv.NAME})},{id:Tv.PORTS,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_PORTS"}),openByDefault:!1,renderContent:()=>r.a.createElement(WO,{activeItem:e})},{id:"outlets",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_OUTLETS"}),renderContent:()=>r.a.createElement(r.a.Fragment,null,r.a.createElement(Cv,null,r.a.createElement(eI,{hidePorts:!0,deviceData:e})),r.a.createElement(Rv,null,r.a.createElement(rI,{hidePorts:!0,activeItem:e})))},{id:"lcmScreen",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SCREEN"}),renderContent:()=>r.a.createElement(pu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:"services",label:r.a.createElement(D.b,{id:"DEVICE_PROPERTY_HEADER_SERVICES"}),renderContent:()=>r.a.createElement(hu,{activeItem:e,setFormDirty:t,setFormInvalid:a})},{id:Tv.MANAGE,label:r.a.createElement(D.b,{id:"DEVICE_PROPERTIES_LABEL_MANAGE"}),renderContent:()=>r.a.createElement(xi,{activeItem:e,disableDebug:b})}],multiOpen:!0,renderOnlyExpandedContent:!0}),r.a.createElement(Ar.a,{isDirty:n,isInvalid:i,onFormSubmit:()=>{const e=Object.entries(m).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&Object.keys(t).length)return{...e,...t}}return e},{});_(Object(ve.updateDeviceWithIdEndpoint)(e,u,O,{successToast:{icon:sa.a.success,message:"DEVICE_NOTICE_SAVE_SUCCESS"},failureToast:{icon:sa.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR"},extend:!0})).then(()=>{Object.values(E).forEach(e=>{"function"==typeof e&&e()})})},onFormCancel:()=>{Object.values(s).forEach(e=>{"function"==typeof e&&e()})}}))});var Dv={default:jt.a.OVERVIEW,panels:{overview:{path:"/overview",title:"DEVICE_PROPERTY_HEADER_OVERVIEW",icon:h.Gb,component:oO},insights:{path:"/insights",title:"DEVICE_PROPERTY_HEADER_INSIGHTS",icon:h.nc,component:dO},settings:{path:"/settings",title:"DEVICE_PROPERTY_HEADER_SETTINGS",icon:h.S,component:hv,subpanel:{path:"/:subPanel/:subPanelId",component:({activeItem:e,params:t,...a})=>"ports"===t.subPanel?t.subPanelId===jt.b.ALL?r.a.createElement(yu.a,Object.assign({activeItem:e,params:t},a)):r.a.createElement(QO,Object.assign({activeItem:e,params:t},a)):r.a.createElement(CI,Object.assign({params:t,activeItem:e},a))}}}},Pv=a(2626);const yv={width:25,height:25},fv=Object(i.c)(y.a)`
  margin-top: 10px;
  ${({bordered:e})=>e&&`box-shadow: 0px 24px 2px -24px ${Ia.a["white-8"]};`}
`,Sv=Object(i.c)("div")`
  display: block;
  position: absolute;
  border-bottom: ${({theme:e,wired:t})=>`2px ${t?"solid":"dotted"} ${e.motifPalette.uBlue06}`};
  width: 100%;
  top: 37px;
  left: -50%;
  z-index: 0;
  padding: 0 25px;
`,Av=Object(i.c)("div")`
  position: relative;
  width: 100%;
  max-width: 70px;
`,Nv=Object(i.c)(y.a)`
  height: 100px;
  > * {
    &:not(:last-child) {
      margin-bottom: ${({theme:e})=>e.spacing["spacing-xs"]};
    }
  }
`,jv=Object(i.c)(y.a)`
  width: 35px;
  min-height: ${yv.height}px;
  height: ${yv.height}px;
  position: relative;
  z-index: 1;
`,Lv=Object(i.c)(T.a)`
  width: 70px;
`,xv=Object(i.c)(h.v)`
  margin-right: ${({theme:e})=>e.spacing["spacing-xs"]};
`,Mv=Object(i.c)(y.a)`
  > * {
    color: ${Ia.a["grey-2"]};
  }
`,Vv=Object(i.c)(y.a)`
  overflow: auto hidden;
  padding-bottom: ${({theme:e})=>e.spacing["spacing-s"]};
  padding: 20px 0 20px 20px;
`,wv=Object(i.c)(oe.a)`
  border: 2px solid ${({theme:e})=>e.motifPalette.uBlue06};
  background: ${({theme:e})=>e.colors.navBackground};
  border-radius: 50%;
  color: ${({theme:e})=>e.motifPalette.uBlue06};
  font-weight: bold;
  width: 36px;
  z-index: 999;
  :hover {
    color: ${({theme:e})=>e.motifPalette.uBlue06};
    background-color: ${({theme:e})=>e.motifPalette.uBlue01};
  }
`,Fv=e=>{const{isInternet:t,isClient:a,client_wifi_experience:n,number_of_clients:l,wireless_uplink:i=!1,expandButton:c,devicesCount:o,onClick:E}=e,s=!!t||!a&&!i;return r.a.createElement(Av,null,!t&&r.a.createElement(Sv,{wired:s}),r.a.createElement(Nv,{flexDirection:"column",alignItems:"center",justifyContent:"center"},t||a||!l?r.a.createElement(y.a,{flex:"1"}):r.a.createElement(Mv,{flex:"1",alignItems:"center",justifyContent:"space-between"},r.a.createElement(xv,null),r.a.createElement(T.a,null,l)),!c&&r.a.createElement(jv,{flex:"1",alignItems:"center",justifyContent:"center"},(e=>{const{isInternet:t,isClient:a,model:n}=e;return t?r.a.createElement(h.H,{size:"large"}):a?r.a.createElement(j,Object.assign({data:e},yv)):r.a.createElement(Pv.a,{model:n,name:n})})(e)),c&&E&&o&&r.a.createElement(wv,{iconSize:"logo",onClick:E},o),r.a.createElement(y.a,{flex:"1",alignItems:"center",justifyContent:"center"},r.a.createElement(Lv,{centered:!0,truncate:!0},(e=>{var t;const{isInternet:a,isClient:n,client_model:l,client_name:i,model:c}=e;return a?r.a.createElement(D.b,{id:"COMMON_WORD_INTERNET"}):n?l||i:(null===(t=_.deviceModels[c])||void 0===t?void 0:t.name)||c})(e))),r.a.createElement(y.a,{flex:"1",alignItems:"center",justifyContent:"center"},a&&r.a.createElement(T.a,{color:Object(wt.c)(n)},n,"%"))))};var Uv=({item:e,variant:t})=>{const[a,n]=Object(l.useState)(!1),{uplink_devices:i=[],report_timestamp:c,...o}=e,E=[...i].reverse(),s=E[0],m=E[(null==E?void 0:E.length)-1],d=E.slice(1,(null==E?void 0:E.length)-1),_=Object(l.useCallback)(()=>{n(!a)},[a]),b=a?E.map(e=>r.a.createElement(Fv,Object.assign({key:e.mac},e))):r.a.createElement(r.a.Fragment,null,r.a.createElement(Fv,Object.assign({key:s.mac},s)),d.length>1?r.a.createElement(Fv,{expandButton:!0,onClick:_,devicesCount:(null==E?void 0:E.length)-2}):d.map(e=>r.a.createElement(Fv,Object.assign({key:e.mac},e))),(null==E?void 0:E.length)>1&&r.a.createElement(Fv,Object.assign({key:m.mac},m)));return r.a.createElement(fv,{flexDirection:"column",flex:"0 0 auto",bordered:"secondary"===t},r.a.createElement(Vv,null,r.a.createElement(Fv,{isInternet:!0}),b,r.a.createElement(Fv,Object.assign({isClient:!0},o))))},zv=a(2616),kv=a(2617),Bv=a(2627);var Wv=({item:e})=>{const{client_signal:t,client_wifi_experience:a,device_model:n,device_name:i,speed_tests:c,wlan_channel:o,wlan_channel_width:E,wlan_essid:s}=e,m=Object(l.useMemo)(()=>Object(wt.d)(a),[a]),d=Object(l.useMemo)(()=>c.reduce((e,t)=>{const{test_server_name:a}=t;return a&&!e.includes(a)&&e.push(a),e},[]),[c]),b=Object(l.useMemo)(()=>(null==d?void 0:d.length)?d.join(", "):"-",[null==d?void 0:d.length]),u=Object(l.useMemo)(()=>{var e;return(null===(e=_.deviceModels[n])||void 0===e?void 0:e.name)||n},[n]);return r.a.createElement(y.a,{flexDirection:"column",padding:"26px 32px 0"},m&&r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_WIFI_EXP"})),r.a.createElement(ta.a,{size:"body",type:"percent",input:a/100,style:{color:Ia.a["color-"+Object(wt.c)(a)]}})),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"WIFI_MAN_OVERVIEW_AP_MODEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(cE.a,{width:20,height:20,device:{model:n,type:fe.g.AP,name:u}}))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"WIFI_MAN_OVERVIEW_AP_NAME"})),r.a.createElement(T.a,{color:"secondary",size:"body"},Object(ma.a)(i))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SSID"})),r.a.createElement(T.a,{color:"secondary",size:"body"},s)),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_SIGNAL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},t," ",r.a.createElement(D.b,{id:"COMMON_UNIT_DBM"}))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"COMMON_CHANNEL"})),r.a.createElement(T.a,{color:"secondary",size:"body"},""+o," ",E&&r.a.createElement(T.a,{size:"body",color:"inherit"},"(",""+E," ",r.a.createElement(D.b,{id:"COMMON_UNIT_MHZ"}),")"))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(y.a,{justifyContent:"flex-start",alignItems:"center"},r.a.createElement(D.b,{id:"WIFI_MAN_OVERVIEW_DOWN"}))),r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(zv.a,{item:e}))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(y.a,{justifyContent:"flex-start",alignItems:"center"},r.a.createElement(D.b,{id:"WIFI_MAN_OVERVIEW_UP"}))),r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(kv.a,{item:e}))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"WIFI_MAN_OVERVIEW_RATE"})),r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(Bv.a,{item:e}))),r.a.createElement(y.a,{width:"100%",marginBottom:8,justifyContent:"space-between"},r.a.createElement(T.a,{color:"secondary",size:"body"},r.a.createElement(D.b,{id:"WIFI_MAN_OVERVIEW_TEST_SERVER"})),r.a.createElement(T.a,{color:"secondary",size:"body"},b)))};const Gv=Object(i.c)(T.a)`
  margin-right: 4px;
`,Hv=Object(i.c)("div")`
  width: 18px;
  border: 1px solid ${({theme:e})=>e.motifPalette.uBlue06};
  margin: 0 8px;
`,Yv=Object(i.c)("div")`
  width: 18px;
  margin: 0 8px;
  border: 1px dashed ${({theme:e})=>e.motifPalette.uBlue06};
`,$v=Object(i.c)(y.a)`
  border-top: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  padding: 16px 8px;
`;var Kv=({timestamp:e})=>r.a.createElement($v,{alignItems:"center",justifyContent:"space-around"},r.a.createElement(y.a,{alignItems:"center",justifyContent:"space-around"},r.a.createElement(Gv,{weight:"bold"},r.a.createElement(D.b,{id:"WIFI_MAN_LATEST_SPEED_OVERVIEW_TEST"})),r.a.createElement(Xn.a,{date:new Date(1e3*e),spacer:" "})),r.a.createElement(y.a,{alignItems:"center"},r.a.createElement(Hv,null),r.a.createElement(D.b,{id:"WIFI_MAN_LATEST_SPEED_OVERVIEW_WIRED"}),r.a.createElement(Yv,null),r.a.createElement(D.b,{id:"WIFI_MAN_LATEST_SPEED_OVERVIEW_WIRELESS"})));const Xv=Object(i.c)("div")`
  width: 100%;
  background: ${({theme:e})=>e.colors.navBackground};
`;var qv=function({activeItem:e}){return r.a.createElement(r.a.Fragment,null,r.a.createElement(Xv,null,r.a.createElement(Uv,{item:e,variant:"primary"}),r.a.createElement(Kv,{timestamp:e.report_timestamp})),r.a.createElement(Wv,{item:e}))},Zv=a(1016);const Jv=Object(i.c)(y.a)`
  position: relative;
  width: 100%;
  margin: ${({theme:e})=>e.spacing["spacing-l"]} 0 ${({theme:e})=>e.spacing["spacing-xxl"]};

  button {
    padding: 0;
    position: absolute;
    left: ${({theme:e})=>e.spacing["spacing-xxxxl"]};
  }
`,Qv=Object(i.c)(T.a)`
  width: 100%;
  letter-spacing: 0.55px;
  line-height: ${({theme:e})=>e.spacing["spacing-xl"]};
`;var eC=({timestamp:e,onBack:t})=>r.a.createElement(Jv,null,r.a.createElement(Ra.c,{name:"backButton",onClick:t},r.a.createElement(h.f,null)),r.a.createElement(Qv,{size:"body",weight:"bold",centered:!0},r.a.createElement(Xn.a,{date:new Date(1e3*e)})));var tC=()=>{const e=Object(n.k)(),t=Object(n.n)(),a=Object(Ol.a)(t,"params.subPanel"),l=Object(o.useSelector)(Object(Zv.d)(a));return a&&l?r.a.createElement(r.a.Fragment,null,r.a.createElement(eC,{timestamp:l.report_timestamp,onBack:()=>e.push("../history")}),r.a.createElement(Uv,{item:l,variant:"secondary"}),r.a.createElement(Wv,{item:l})):null};var aC={default:jt.a.TESTS,singlePanel:!0,panels:{tests:{path:"/tests",component:qv,subpanel:{path:"/:subPanel",component:tC}}}};var nC={[b.c.ISP_DETAILS]:nl,[b.c.THREAT_EVENT]:Ki,[b.c.TRAFFIC_STATS]:_c,[b.c.HONEYPOT_ALERT]:Mn,[b.c.WIFI_MAN]:aC,[b.c.UNIFI_DEVICE_CLIENT]:mp,[b.a.CLIENT]:yn,[b.a.TELEPORT]:_p,[b.b.UGW]:ep,[b.b.USW]:gv,[b.b.UAP]:c_,[b.b.UAP6MP]:um,[b.b.UDM]:zu,[b.b.UDW]:nO,[b.b.UDMPRO]:Su,[b.b.UAP_USW]:o_,[b.b.UBB]:Tb,[b.b.UBBXG]:Tb,[b.b.USPP]:XI,[b.b.USPS]:_v,[b.b.USPPDUP]:LI,[b.b.USAGGPRO]:gv,[b.b.LTE]:Fi,[b.b.UXG]:Dv,[b.b.UAP_IW]:t_,[b.b.USL8MP]:RI,[b.b.USPRPS]:Wg,[b.b.USPRPSP]:av};const lC=i.a`
  & > div {
    overflow: hidden;
  }
`;var rC=({location:e,history:t,match:{path:a,params:{site:i,id:_}},panelType:u})=>{var O;const T=Object(o.useSelector)(d.i),[h,D]=Object(l.useState)(!1),P=Object(o.useSelector)(g.b),y=Object(o.useSelector)(g.d),f=Object(o.useDispatch)(),S=u||y,A=Object(l.useMemo)(()=>{if(_)switch(S){case b.c.DEVICE:return Object(g.f)(_);case b.c.UNIFI_DEVICE:return Object(g.h)(_);case b.c.CLIENT:return Object(g.e)(_);case b.c.UNIFI_DEVICE_CLIENT:return Object(g.g)(_);case b.c.WIFI_MAN:return Object(g.i)(_);case b.c.ISP_DETAILS:return Object(g.a)(_);case b.c.THREAT_EVENT:return Object(E.g)(_);case b.c.TRAFFIC_STATS:return Object(I.m)(_);case b.c.HONEYPOT_ALERT:return Object(E.c)(_);default:return null}return null},[_,S])||function(){return null},N=Object(o.useSelector)(A);let j=N||{},L=S;S===b.c.UNIFI_DEVICE&&N&&"activeItemPayload"in N&&"panel"in N&&({activeItemPayload:j,panel:L}=N);const x={type:L,data:P||h?j:{}},M=()=>{D(!0),t.push(e.pathname.split("/properties")[0]),f(Object(v.f)())};Object(m.a)(()=>P&&M(),[P]),Object(l.useEffect)(()=>{P&&!e.pathname.includes("/properties")&&f(Object(v.f)())},[e]),Object(l.useEffect)(()=>{P&&!x.type&&M()},[P,x]);const V=Object(l.useCallback)(()=>{D(!1)},[]);Object(l.useEffect)(()=>{var l,r;if(L&&(null===(l=null==e?void 0:e.pathname)||void 0===l?void 0:l.includes("properties/")))if(null===(r=Object.keys(j||{}))||void 0===r?void 0:r.length)f(Object(v.g)({type:S,mac:_,id:_}));else{let e=a;["/:site/ips/properties/:id","/:site/ips/:threatPage/properties/:id"].some(e=>a.includes(e))&&(e=e.replace("/properties/:id","")),t.push(Object(n.i)(e,{site:i}))}},[]);const w=x.type&&(null===(O=Object.keys((null==x?void 0:x.data)||{}))||void 0===O?void 0:O.length)?null==nC?void 0:nC[p(x.data,x.type)]:void 0;return Object(C.a)([Object(R.c)("devices")],w?r.a.createElement(c.a,{in:P,header:r.a.createElement(Z,{activeItem:x}),onClose:M,onEntered:V,onExited:V,className:lC,style:{border:"none"}},(P||h)&&r.a.createElement(s.a,{path:T+"/:page/:subPage?/:subPageId?/:subSubPageId?/properties/:id/:panel?/:subPanel?/:subPanelId?"},e=>r.a.createElement(Nt,Object.assign({content:w,activeItem:x,dispatch:f},e)))):null)};t.a=Object(n.o)(rC)},2610:function(e,t,a){"use strict";a.d(t,"a",(function(){return c})),a.d(t,"b",(function(){return o}));var n=a(285),l=a(194),r=a(123),i=a(235);const c={[i.c.ELEMENTS]:Object.values(i.a),[i.c.STATUS]:Object.values(i.b)},o=Object(n.b)(l.a.DEVICES,r.a.DEVICE,c)},2611:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(15),l=a(16);const r=e=>{const t=Object(l.selectIsIpsDisabled)(e),a=Object(n.selectWanNetworks)(e).every(({wan_smartq_enabled:e})=>!e);return t&&a}},2612:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(165),l=a(8),r=a(1653);const i=e=>Object(n.a)(Object(l.v)(Object(r.b)(),e.models),"data",{})},2613:function(e,t){},2614:function(e,t){},2615:function(e,t){},2619:function(e,t,a){"use strict";a.d(t,"a",(function(){return R}));var n=a(0),l=a.n(n),r=a(1),i=a(53),c=a(132),o=a(2788),E=a(9),s=a(1655),m=a(1194),d=a(495),_=a(1640),b=a(1651);const u=(e,t,a)=>(t&&t.constructor===Object&&Object.keys(t).forEach(n=>{void 0===e[n]||a&&a.includes(n)?e[n]=t[n]:Number.isFinite(e[n])?e[n]=(e[n]||0)+t[n]:Array.isArray(e[n])?e[n]=e[n].concat(t[n]):e[n]&&e[n].constructor===Object&&u(e[n],t[n])}),e),O=(e,t)=>Object(d.a)(e).reduce((e,a)=>e?u(e,a,t):a,void 0);class p{constructor(e){this.data=e}dedeuplicatedBy(e,t){return this.data=((e,t,a)=>Object(_.a)(Object(b.a)(e,t)).map(e=>O(e,a)))(this.data,e,t),this}sortedBy(e,t){return this.data.sort((a,n)=>{const l=a[e]-n[e];return t?-l:l}),this}withLimit(e,t){let a=e;return this.data.length>=a&&(a-=1,this.other=O(this.data.slice(a),t),this.other.generated=!0),this.data=this.data.splice(0,a),this}countTotal(e){const t=this.other?[...this.data,this.other]:this.data;return this.total=O(t,e)||{},this}withMap(e,t){return this.mapFunction=a=>{const n=t?a:{};return Object.keys(e).forEach(t=>{n[t]=e[t](a)}),n},this}withOtherDefaults(e){return this.other={...this.other,...e},this}getData(e=!1){let t;return t=this.other.generated?[...this.data,this.other].map(this.mapFunction):this.data.map(this.mapFunction),t=t.map((t,a)=>({index:a,...e?{id:a.toString()}:[],...t})),{data:t,total:this.total}}}var I=a(27),g=a(54),v=a(755);const C=Object(i.a)(e=>{if(0===e.length)return{data:[],total:{}};const t=e.map(e=>({label:Object(m.a)(Object(m.b)(e.cat,e.app))||l.a.createElement(r.b,{id:"CLIENT_PROPERTY_DPI_UNKNOWN_LABEL"}),packets:e.rx_packets+e.tx_packets,bytes:e.rx_bytes+e.tx_bytes,...e})),a={bytesParsed:e=>Object(c.c)(e.bytes),pkts:e=>Object(o.a)(e.packets,{spacer:" "})};return new p(t).dedeuplicatedBy("label").sortedBy("bytes",!0).withLimit(v.a).countTotal().withMap(a,!0).withOtherDefaults({label:l.a.createElement(r.b,{id:"CLIENT_PROPERTY_DPI_OTHER"})}).getData(!0)}),R=(e,t)=>Object(g.b)()(Object(E.a)(((e,t)=>Object(g.b)()(Object(E.a)(Object(s.b)(e,t),e=>{var t;return(null===(t=Object(I.c)(e))||void 0===t?void 0:t.by_app)||[]}),e=>e))(e,t),e=>C(e)),e=>e)},2620:function(e,t,a){"use strict";a.d(t,"c",(function(){return h})),a.d(t,"b",(function(){return D})),a.d(t,"a",(function(){return P}));var n=a(9),l=a(127),r=a(304),i=a(6),c=a(46),o=a(1046),E=a(30),s=a(66),m=a(751),d=a(2610),_=a(665),b=a(84),u=a(235),O=a(183);const p=(e,t)=>{switch(!0){case _.a[u.c.ELEMENTS][u.a.GATEWAY](e):return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_GATEWAY"});case _.a[u.c.ELEMENTS][u.a.SWITCH](e):return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_SWITCH"});case _.a[u.c.ELEMENTS][u.a.ACCESS_POINT](e):return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_ACCESS_POINT"});case _.a[u.c.ELEMENTS][u.a.SMART_POWER](e):return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_SMART_POWER"});case _.a[u.c.ELEMENTS][u.a.BUILDING_BRIDGE](e):return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_BUILDING_BRIDGE"});case _.a[u.c.ELEMENTS][u.a.ULTE](e):return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_ULTE"});default:return t.formatMessage({id:"DEVICE_FILTER_ELEMENT_NON_NETWORK_DEVICES"})}},I=(e,t)=>{switch(!0){case _.a[u.c.STATUS][u.b.ONLINE](e):return t.formatMessage({id:"DEVICE_FILTER_STATUS_ONLINE"});case _.a[u.c.STATUS][u.b.OFFLINE](e):return t.formatMessage({id:"DEVICE_FILTER_STATUS_OFFLINE"});case _.a[u.c.STATUS][u.b.ISOLATED](e):return t.formatMessage({id:"DEVICE_FILTER_STATUS_ISOLATED"});case _.a[u.c.STATUS][u.b.PENDING_ADOPTION](e):return t.formatMessage({id:"DEVICE_FILTER_STATUS_PENDING_ADOPTION"});default:return t.formatMessage({id:"DEVICE_FILTER_STATUS_MANAGED_BY_ANOTHER_CONSOLE_SEARCH"})}},g=(e,t,a)=>{const n=Object(i.getUplink)(t,e),l=Object(i.getConnectionName)(e,n);return"wired"===l?a.formatMessage({id:"COMMON_WORD_WIRED"}):"-"===l?"":l},v=e=>{var t,a,n;return"wire"===(null===(t=null==e?void 0:e.uplink)||void 0===t?void 0:t.type)?(null==e?void 0:e.connection_network_name)||"":"wireless"===(null===(a=null==e?void 0:e.uplink)||void 0===a?void 0:a.type)&&(null===(n=null==e?void 0:e.uplink)||void 0===n?void 0:n.essid)||""},C=e=>{if(!b.deviceModels[e.model])return"";const{deviceCapabilities:t}=b.deviceModels[e.model];switch(!0){case t.includes(b.DeviceCapability.GATEWAY):case t.includes(b.DeviceCapability.SWITCH):{const{speed:t=0}=Object(i.getUplinkAttrs)(e)||{};return t>0?Object(O.b)(t):""}default:return""}},R=e=>e["bytes-r"],T=Object(m.a)("devices"),h=Object(n.a)(r.d,i.selectDevicesData,o.c,E.selectWifiNetworksData,l.selectAPGroupsData,d.b,T,(e,t,a,n,r,o,m)=>{const d=t.some(e=>{var t;return null===(t=e.radio_table)||void 0===t?void 0:t.some(e=>e.radio===s.b.RADIO_6E)});return t.reduce((s,b)=>{var u,O,p,I,g,v;if(Object(i.isUlte)(b)&&!b.lte_imei)return s;if(m&&!m.has(b.mac))return s;if(Object(_.c)(o,b))return s;const C=Object(i.getWarningsCount)(e,b),T=Object(i.getUplink)(t,b),h=Object(i.getDeviceSpecs)(b),D=b.uplink_table&&b.uplink_table.map(e=>{const{mac:a}=e,n=t.find(e=>e.mac===a);return{...e,model:(null==n?void 0:n.model)||""}}),P=Object(l.getDeviceWlanStats)(b,n,r,d),y=Object(i.getDeviceStatus)(b),f=Object(i.getDeviceState)(b)===i.DeviceState.PENDING||"success"===y;return s.push({...b,id:b._id||b.mac,name:Object(c.c)(b),modelName:Object(c.a)(b),activity:R(b),deviceState:Object(i.getDeviceState)(b),statusPulse:Object(i.getDeviceStatusPulse)(b),status:y,warningCount:C,hasWarning:C>0,specs:h,loadAvg:Object(i.getDeviceLoadAverage)(b),uplinkName:Object(i.getUplinkDisplayName)(b,T),connection:Object(i.getConnectionName)(b,T),uplinkDevice:T,uplinkId:T&&T.device_id,wlan2g:b.adopted?null===(O=null===(u=P.wlanNames)||void 0===u?void 0:u[E.WlanBand.NG])||void 0===O?void 0:O.join("\n"):"",wlan5g:b.adopted?null===(I=null===(p=P.wlanNames)||void 0===p?void 0:p[E.WlanBand.NA])||void 0===I?void 0:I.join("\n"):"",wlan6g:b.adopted?null===(v=null===(g=P.wlanNames)||void 0===g?void 0:g[E.WlanBand.AX])||void 0===v?void 0:v.join("\n"):"",satisfactionByRadio:Object(i.getSatisfactionByRadio)(b),problemPorts:Object(i.getProblemPorts)(b),portsUtilization:Object(i.getPortsUtilization)(b),pendingAdoption:Object(i.getPendingAdoption)(b),uplinkTable:D,bssid:Object(i.getDeviceBssid)(b),deviceUsageReport:Object(i.getDeviceUsageReport)(b,a),showRowPopover:f}),s},[])}),D=e=>Object(n.a)(i.selectDevicesData,t=>t.reduce((a,n)=>(Object(i.isUlte)(n)&&!n.lte_imei||a.push(((e,t,a)=>({mac:e.mac,search_type:p(e,a),search_status:I(e,a),search_name:Object(c.d)(e),search_model_name:Object(c.a)(e),search_ip:Object(i.getDeviceIp)(e),search_connection:g(e,t,a),search_network:v(e),search_experience:C(e)}))(n,t,e)),a),[])),P=Object(n.a)(i.selectDevicesData,e=>e.map(({mac:e})=>e))},2621:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(4),i=a(126);t.a=({type:e})=>l.a.createElement("img",{style:{width:"100%",height:"100%",padding:`0 ${"teleport"===e?4:2}px`},src:`${Object(r.useSelector)(i.a)}/${e}.svg`,alt:e})},2623:function(e,t,a){"use strict";a.d(t,"a",(function(){return R}));var n=a(0),l=a.n(n),r=a(3),i=a(1),c=a(10),o=a(481),E=a(47),s=a(474),m=a(6),d=a(183),_=a(1658),b=a(500);const u=Object(r.c)("div",{shouldForwardProp:e=>"portsTable"!==e})`
  display: grid;
  grid-template-columns: repeat(4, minmax(min-content, 1fr));
  grid-gap: 0 15px;
  ${({theme:e,portsTable:t})=>t?`\n  border-bottom: 1px solid ${e.motifPalette.ui04};\n  padding-bottom: 15px;\n  margin: 15px 0 20px;\n  `:`\n  margin-top: 20px;\n  padding-top: 16px;\n  border-top: 1px solid ${e.motifPalette.ui04};\n  `}
`,O=Object(r.c)("div",{shouldForwardProp:e=>"portsTable"!==e})`
  float: left;
  clear: both;

  & > span {
    float: left;
    margin-right: 14px;

    &.spacer {
      margin-right: 28px;
    }
  }
`,p=Object(r.c)(o.a)`
  white-space: normal;
`,I=Object(r.c)(E.a)`
  padding-bottom: 6px;
  padding-top: 6px;
  color: ${({theme:e})=>e.motifPalette.text02};
  display: flex;
  align-items: center;
  white-space: nowrap;

  > :not(:nth-child(1)) {
    margin-left: 4px;
  }

  svg {
    vertical-align: text-bottom;
  }
`,g=Object(r.c)(s.a,{shouldForwardProp:e=>!["background","color"].includes(e)})`
  background-color: ${e=>"transparent"!==e.background?e.theme.motifPalette[e.background]:e.background};
  border-radius: 2px;
  border: ${({color:e,theme:t})=>e&&"1px solid "+t.motifPalette[e]};
`,v={width:9,height:9};function C({stp_version:e}){switch(e){case"rstp":return l.a.createElement(I,{size:"label"},l.a.createElement(c.u,{style:v}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_RSTP_DISCARDING"}),l.a.createElement(p,{width:260,message:l.a.createElement(E.a,null,l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_RSTP_DISCARDING_TOOLTIP"}))},l.a.createElement(c.cb,{size:"small",isActive:!0})));case"stp":return l.a.createElement(I,{size:"label"},l.a.createElement(c.u,{style:v}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_STP_BLOCKING"}));case"disabled":return l.a.createElement(I,{size:"label"},l.a.createElement(c.u,{style:v}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_DISABLED"}));default:return""}}function R({deviceData:e,portsTable:t=!1,singleLine:a=!1,hideLabelStp:r=!1}){const{model:o,port_table:s,stp_version:R}=e;return Object(n.useMemo)(()=>{const n=Object(m.getPortSpeeds)(e),{isPoePlusPlusSupported:o,isPoePlusSupported:T,isPoeAutoSupported:h,isPoePassthroughSupported:D,isPoePassive24Supported:P}=Object(m.getDevicePoeAvailability)(e),y=Object(m.getIsInWallAp)(e),f=e=>m.SWITCH_PORT_SPEED_COLORS[e]||"transparent",S=Object(m.getCanBePoweredByPoe)(e),A=Object(m.isUdmBase)(e)||Object(m.isUdr)(e),N=a?O:u,j=null==s?void 0:s.some(e=>{const t=Object(b.a)(e,m.switchAnomaliesMap);return e.sfp_txfault||e.sfp_rxfault||(null==t?void 0:t.length)});return l.a.createElement(N,{portsTable:t},n.sort((e,t)=>t-e).map(e=>l.a.createElement(I,{size:"label",key:e},l.a.createElement(g,{background:f(e)}),l.a.createElement("span",null,Object(d.b)(e)))),l.a.createElement(I,{size:"label"},l.a.createElement(g,{background:m.SWITCH_PORT_SPEED_COLORS.DEFAULT}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_DISCONNECTED"})),l.a.createElement(I,{size:"label",className:a&&"spacer"},l.a.createElement(g,{background:"transparent",color:m.SWITCH_PORT_SPEED_COLORS.DEFAULT}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_DISABLED"})),(y||Object(m.isPoeSupported)(e)||S)&&l.a.createElement(l.a.Fragment,null,l.a.createElement(I,{size:"label"},l.a.createElement(c.Tb,{style:v,viewBox:"6 3 10 14"}),(h||D)&&l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_POE"}),P&&l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_POE_PASSIVE"})),(T||S)&&l.a.createElement(I,{size:"label"},l.a.createElement(c.Pb,{style:v,viewBox:"6 4 16 15"}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_POE_PLUS"})),o&&l.a.createElement(I,{size:"label"},l.a.createElement(c.Qb,{style:v,viewBox:"6 4 16 15"}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_POE_PLUS_PLUS"}))),Object(m.hasSwitch)(e)&&l.a.createElement(l.a.Fragment,null,l.a.createElement(I,{size:"label"},l.a.createElement(_.a,Object.assign({},v)),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_AGGREGATE"})),l.a.createElement(I,{size:"label"},l.a.createElement(c.L,{style:v}),l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_MIRROR"}),l.a.createElement(p,{width:260,message:l.a.createElement(E.a,null,l.a.createElement(i.b,{id:"DEVICE_PORT_STATE_MIRROR_TOOLTIP"}))},l.a.createElement(c.cb,{size:"small",isActive:!0})))),!r&&!A&&l.a.createElement(C,{stp_version:R}),j&&l.a.createElement(I,null,l.a.createElement(c.a,{width:12,height:12}),l.a.createElement(E.a,{size:"label",color:"secondary"},l.a.createElement(i.b,{id:"DEVICE_OUTLET_STATE_WARNING"}))))},[s,o,R])}},2624:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(89),l=a(46);const r=(e,t,a,r)=>{const i=e.find(e=>e.mac===a),c=Object(l.c)(i),o=Object(l.a)(i);if(c&&c!==a)return c;if(o)return o;const E=t.find(e=>"mac"in e&&e.mac===a),s=Object(n.getClientName)(E);return s&&s!==a?s:r.formatMessage({id:"DEVICE_UNKNOWN_HOSTNAME"})}},2625:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n={MAX:8}},2628:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(25),c=a(1),o=a(173),E=a(47),s=a(1670),m=a(10),d=a(4),_=a(5),b=a(15),u=a(6),O=a(94),p=a(131),I=a(22),g=a(107),v=a(481),C=a(1037),R=a(132),T=a(183),h=a(42),D=a(118);const P=({id:e})=>l.a.createElement(E.a,{size:"body",color:"inherit",weight:"bold"},l.a.createElement(c.b,{id:e})),y=({value:e,color:t})=>l.a.createElement(E.a,{size:"body",color:"inherit",style:{color:t},truncate:!0},e);var f=({intl:e,portConfig:t,txColor:a,rxColor:n})=>[{id:D.b.PORT_SYMBOL,minWidth:85,label:l.a.createElement(P,{id:D.c[D.b.PORT_SYMBOL]}),renderCell:({portSymbol:e})=>l.a.createElement(y,{value:e}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.port_idx)},{id:D.b.PORT_NAME,minWidth:140,label:l.a.createElement(P,{id:D.c[D.b.PORT_NAME]}),renderCell:({portName:e})=>l.a.createElement(y,{value:e}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.name)},{id:D.b.PORT_POE_MODE,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_POE_MODE]}),renderCell:e=>l.a.createElement(y,{value:Object(u.getPortPoeModeText)(e)})},{id:D.b.PORT_POE_DETECTION,minWidth:130,label:l.a.createElement(P,{id:D.c[D.b.PORT_POE_DETECTION]}),renderCell:e=>l.a.createElement(y,{value:Object(u.getPortPoeDetection)(e)})},{id:D.b.PORT_POE_CLASS,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_POE_CLASS]}),renderCell:({poe_class:e,...t})=>Object(u.isPowerDeviceDetected)(t)&&l.a.createElement(y,{value:e}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.poe_class)},{id:D.b.PORT_POE_POWER,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_POE_POWER]}),renderCell:({poe_power:e,...t})=>{const a=l.a.createElement(c.b,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e}});return Object(u.isPowerDeviceDetected)(t)&&l.a.createElement(y,{value:a})},sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.poe_power)},{id:D.b.PORT_POE_VOLTAGE,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_POE_VOLTAGE]}),renderCell:({poe_voltage:e,...t})=>{const a=l.a.createElement(c.b,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:e}});return(Object(u.isPowerDeviceDetected)(t)||Object(u.isPortPoeModePassive24)(t))&&l.a.createElement(y,{value:a})},sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.poe_voltage)},{id:D.b.PORT_POE_CURRENT,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_POE_CURRENT]}),renderCell:({poe_current:e,...t})=>{const a=l.a.createElement(c.b,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:e}});return Object(u.isPowerDeviceDetected)(t)&&l.a.createElement(y,{value:a})},sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.poe_current)},{id:D.b.PORT_OPERATION_MODE,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_OPERATION_MODE]}),renderCell:t=>l.a.createElement(y,{value:Object(u.getPortOperationMode)(t,e)})},{id:D.b.PORT_PROFILE,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_PROFILE]}),renderCell:a=>l.a.createElement(y,{value:Object(u.getPortProfile)(a,e,t)})},{id:D.b.SPEED,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.SPEED]}),renderCell:({speed:e})=>!!e&&l.a.createElement(y,{value:Object(T.b)(e)}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.speed)},{id:D.b.PORT_LINK_STATUS,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_LINK_STATUS]}),renderCell:t=>l.a.createElement(y,{value:Object(u.getPortStatus)(t,e)}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.speed)},{id:"portStp",minWidth:110,label:l.a.createElement(P,{id:"DEVICE_PROPERTIES_LABEL_STP"}),renderCell:e=>l.a.createElement(y,{value:Object(u.getPortStpStatus)(e)})},{id:D.b.PORT_ACTIVITY,minWidth:160,label:l.a.createElement(P,{id:D.c[D.b.PORT_ACTIVITY]}),renderCell:({up:e,...t})=>{const r=Object(u.getTxLinkUsage)({up:e,...t}),i=Object(u.getRxLinkUsage)({up:e,...t});return e&&l.a.createElement(_.a,{flexDirection:"column",flex:1,paddingRight:10},l.a.createElement(v.a,{width:100,message:l.a.createElement(_.a,{flexDirection:"column"},l.a.createElement(c.b,{id:"DEVICE_PROPERTIES_VALUE_ACTIVITY_TX",values:{value:Object(u.formatLinkUsage)(r)}}),l.a.createElement(c.b,{id:"DEVICE_PROPERTIES_VALUE_ACTIVITY_RX",values:{value:Object(u.formatLinkUsage)(i)}}))},l.a.createElement(C.a,{items:[{color:a,value:Object(u.thresholdLinkUsage)(r)}],height:4,style:{borderRadius:"2px"}}),l.a.createElement(C.a,{items:[{color:n,value:Object(u.thresholdLinkUsage)(i)}],height:4,style:{borderRadius:"2px"}})))}},{id:D.b.PORT_TX,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX]}),renderCell:({tx_bytes:e})=>l.a.createElement(y,{value:Object(R.c)(e,"bytes","JEDEC"),color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.tx_bytes)},{id:D.b.PORT_RX,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX]}),renderCell:({rx_bytes:e})=>l.a.createElement(y,{value:Object(R.c)(e,"bytes","JEDEC"),color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.rx_bytes)},{id:D.b.PORT_TX_BYTES,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX_BYTES]}),renderCell:({tx_bytes:e})=>l.a.createElement(y,{value:e,color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.tx_bytes)},{id:D.b.PORT_RX_BYTES,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX_BYTES]}),renderCell:({rx_bytes:e})=>l.a.createElement(y,{value:e,color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.rx_bytes)},{id:D.b.PORT_TX_PACKETS,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX_PACKETS]}),renderCell:({tx_packets:e})=>l.a.createElement(y,{value:e,color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.tx_packets)},{id:D.b.PORT_RX_PACKETS,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX_PACKETS]}),renderCell:({rx_packets:e})=>l.a.createElement(y,{value:e,color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.rx_packets)},{id:D.b.PORT_TX_MULTICAST,minWidth:120,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX_MULTICAST]}),renderCell:({tx_multicast:e})=>l.a.createElement(y,{value:e,color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.tx_multicast)},{id:D.b.PORT_RX_MULTICAST,minWidth:120,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX_MULTICAST]}),renderCell:({rx_multicast:e})=>l.a.createElement(y,{value:e,color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.rx_multicast)},{id:D.b.PORT_TX_BROADCAST,minWidth:120,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX_BROADCAST]}),renderCell:({tx_broadcast:e})=>l.a.createElement(y,{value:e,color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.tx_broadcast)},{id:D.b.PORT_RX_BROADCAST,minWidth:120,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX_BROADCAST]}),renderCell:({rx_broadcast:e})=>l.a.createElement(y,{value:e,color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.rx_broadcast)},{id:D.b.PORT_TX_ERRORS,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX_ERRORS]}),renderCell:({tx_errors:e})=>l.a.createElement(y,{value:e,color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.tx_errors)},{id:D.b.PORT_RX_ERRORS,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX_ERRORS]}),renderCell:({rx_errors:e})=>l.a.createElement(y,{value:e,color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e.rx_errors)},{id:D.b.PORT_TX_RATE,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_TX_RATE]}),renderCell:({"tx_bytes-r":e})=>l.a.createElement(y,{value:Object(R.c)(e,"bitrate"),color:a}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e["tx_bytes-r"])},{id:D.b.PORT_RX_RATE,minWidth:110,label:l.a.createElement(P,{id:D.c[D.b.PORT_RX_RATE]}),renderCell:({"rx_bytes-r":e})=>l.a.createElement(y,{value:Object(R.c)(e,"bitrate"),color:n}),sortable:!0,compare:Object(h.b)(e=>null==e?void 0:e["rx_bytes-r"])}];const S=Object(r.c)(m.g)`
  margin-right: 8px;
  color: inherit;
`;var A=e=>[{id:"portName",minWidth:100,label:l.a.createElement(E.a,{size:"label",color:"inherit",weight:"bold"},l.a.createElement(c.b,{id:"DEVICE_PROPERTIES_LABEL_NAME"})),renderCell:({portName:e})=>l.a.createElement(E.a,{size:"body",color:"inherit",truncate:!0},e)},{id:"portStatus",minWidth:100,label:l.a.createElement(E.a,{size:"label",color:"inherit",weight:"bold"},l.a.createElement(c.b,{id:"DEVICE_PROPERTIES_LABEL_STATUS"})),renderCell:({portStatus:t})=>l.a.createElement(_.a,{justifyContent:"space-between",width:"100%",alignItems:"center"},l.a.createElement(E.a,{color:"inherit",size:"body",truncate:!0},t),!e&&l.a.createElement(S,{size:"small"}))}],N=a(616);const j=Object(r.c)("div")`
  width: 100%;
  overflow-x: auto;
`,L=Object(r.c)(o.a)`
  font-size: ${({theme:e})=>e.fontSizes[2]}px;
  margin-top: 16px;
  justify-content: flex-end;
  svg {
    height: 14px;
    width: 13px;
  }
`,x=Object(r.c)("div")`
  margin-bottom: 32px;
`,M=Object(r.c)(_.a)`
  position: sticky;
  left: 0;
  align-items: center;
  margin-bottom: ${({fullData:e})=>e?16:0}px;
`,V=Object(r.c)(E.a)`
  margin-left: ${({theme:e})=>e.spacing["spacing-s"]};
`;t.a=Object(c.e)((function({deviceData:e,fullData:t=!1,columnOverride:a=[],onPortOpen:r,intl:o,...E}){const _=Object(i.k)(),v=Object(O.j)(e),C=Object(u.isUdm)(e),R=Object(d.useSelector)(b.selectNetworkGroups),T=Object(d.useSelector)(p.selectPortConf),{path:h}=Object(i.n)(),{site:D,page:P,id:y,panel:S}=Object(i.m)(),w=e=>Object(i.i)(h,{site:D,page:P,id:y,panel:S,subPanel:"ports",subPanelId:e}),F=Object(I.n)(),U={txColor:F.motifPalette.purple06,rxColor:F.motifPalette.green06},z=Object(n.useCallback)(({port_idx:e,masked:t})=>{r?r(e,!0):!t&&_.push(w(null==e?void 0:e.toString()))},[_]),k=Object(n.useCallback)(({port_idx:e})=>{r?r(e,!0):_.push(w(g.b.WAN))},[_]),B=Object(n.useMemo)(()=>t?f({intl:o,portConfig:T,...U}):A(),[]),W=Object(n.useMemo)(()=>Object(N.c)(e,R,E),[e,R,E]);if(C){const n=Object(N.a)(e,R,E),r=Object(N.e)(e,R,E),i=t?f({intl:o,portConfig:T,...U}):A(v);return l.a.createElement(j,null,!t&&l.a.createElement(x,null),l.a.createElement(M,{fullData:t},l.a.createElement(m.kb,{omitSvgMargin:!0}),l.a.createElement(V,{weight:"bold",color:"primary",size:"body"},l.a.createElement(c.b,{id:"DEVICE_PORTS_TABLE_LAN_PORTS"}))),l.a.createElement(s.a,{hideCellOverflow:!1,columns:B,columnOverride:a,rowHeight:t?49:35,disableColumnFilters:!0,items:n,onRowClick:z}),l.a.createElement(x,null),l.a.createElement(M,{fullData:t},l.a.createElement(m.Lc,{omitSvgMargin:!0}),l.a.createElement(V,{weight:"bold",color:"primary",size:"body"},l.a.createElement(c.b,{id:"DEVICE_PORTS_TABLE_WAN_PORTS"}))),l.a.createElement(s.a,{hideCellOverflow:!1,columns:i,columnOverride:a,rowHeight:t?49:35,disableColumnFilters:!0,disableTextPointer:v,disableSelection:v,items:r,onRowClick:!v||t?k:null}),v&&!t&&l.a.createElement(L,{variant:"link",onClick:k,Icon:l.a.createElement(m.Kb,{isActive:!0})},l.a.createElement(c.b,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"})))}return l.a.createElement(j,null,l.a.createElement(s.a,{hideCellOverflow:!1,columns:B,columnOverride:a,rowHeight:t?49:35,disableColumnFilters:!0,items:W,onRowClick:z}))}))},2629:function(e,t,a){"use strict";var n=a(10),l=a(173),r=a(47),i=a(623),c=a(1035),o=a(0),E=a.n(o),s=a(3),m=a(1),d=a(4),_=a(25),b=a(76),u=a(5),O=a(107),p=a(92),I=a(22);const g=Object(s.c)(l.a)`
  padding: 0;
  font-size: ${({theme:e})=>e.fontSize["font-size-m"]};
  border: 0;
  line-height: 1.6;
`,v=Object(s.c)(r.a)`
  max-width: 220px;
`;t.a=({uplinkMac:e,uplinkName:t,uplinkPort:a,clientFixedApEnabled:s,clientMac:C})=>{const R=Object(_.k)(),T=Object(d.useDispatch)(),h=Object(I.a)("/devices/properties/:mac/"+O.a.OVERVIEW),D=Object(I.a)("/clients/properties/:mac/settings"),[P,y]=Object(o.useState)(!1),f=Object(o.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),R.push(h.replace(":mac",e)),T(Object(b.g)({type:p.c.DEVICE,mac:e}))},[T,R,h,e]);return E.a.createElement(u.a,null,t?E.a.createElement(E.a.Fragment,null,E.a.createElement(g,{size:"small",variant:"link",onClick:f},E.a.createElement(v,{size:"body",color:"info",truncate:!0,weight:"bold"},t," ",a?"#"+a:"")),s?E.a.createElement(i.a,{openOnMouseEnter:!0,renderToggle:()=>E.a.createElement(u.a,{marginLeft:4},E.a.createElement(n.pb,{isActive:!0,size:"original"})),align:"topCenter",toggleOffset:-10,open:P,onChange:e=>y(e),renderCard:({open:e})=>e&&E.a.createElement(c.a,{isInteractive:!0,width:208,message:E.a.createElement(r.a,null,E.a.createElement(m.b,{id:"CLIENT_LOCK_AP_ICON_TOOLTIP",values:{here:E.a.createElement(l.a,{variant:"inline",onClick:e=>{var t,a;null===(t=null==e?void 0:e.stopPropagation)||void 0===t||t.call(e),null===(a=null==e?void 0:e.preventDefault)||void 0===a||a.call(e),R.push(D.replace(":mac",C)),T(Object(b.g)({type:p.c.CLIENT,mac:C})),y(!1)}},E.a.createElement("span",{style:{textTransform:"lowercase"}},E.a.createElement(m.b,{id:"COMMON_WORD_HERE"})))}}))})}):null):E.a.createElement(r.a,{size:"body",color:"secondary"},E.a.createElement(m.b,{id:"COMMON_HYPHEN"})))}},2630:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(1),i=a(47),c=a(104),o=a(5),E=a(89),s=a(183);t.a=({activeItem:e})=>{const t="is_wired"in e?e.is_wired:void 0,{satisfaction:a,known:n}=Object(E.getClientExperienceFromPort)(void 0,e);if(!t&&a>0&&n)return l.a.createElement(o.a,{alignItems:"center",whiteSpace:"nowrap"},l.a.createElement(i.a,{color:Object(c.c)(a),size:"body"},a+"%"));const m="wired_rate_mbps"in e?e.wired_rate_mbps:void 0;return t&&m?l.a.createElement(o.a,{alignItems:"center",whiteSpace:"nowrap"},l.a.createElement(i.a,{color:"inherit",size:"body"},m>0?Object(s.b)(m):l.a.createElement(r.b,{id:"COMMON_HYPHEN"}))):l.a.createElement(i.a,{color:"inherit",size:"body"},l.a.createElement(r.b,{id:"COMMON_HYPHEN"}))}},2631:function(e,t,a){"use strict";a.d(t,"c",(function(){return _})),a.d(t,"a",(function(){return u})),a.d(t,"d",(function(){return p})),a.d(t,"b",(function(){return I})),a.d(t,"e",(function(){return g}));var n=a(2688),l=a(72),r=a(116),i=a(59),c=a(162),o=a(60);const E={[r.a.ACTIVE]:1,[r.a.OFFLINE]:2,[r.a.BLOCKED]:3,unknown:4},s=e=>Object(c.r)(e)?r.a.ACTIVE:e.type!==i.c.VPN&&e.type!==i.c.TELEPORT&&e.blocked||e.isUp?e.type!==i.c.VPN&&e.type!==i.c.TELEPORT&&e.blocked?r.a.BLOCKED:"unknown":r.a.OFFLINE,m=(e,t)=>Object(l.d)(E[s(e)],E[s(t)]),d=(e,t)=>{if(e.type!==i.c.VPN&&e.type!==i.c.TELEPORT){const{uplinkName:a}=e,n=e.type===i.c.WIRED?e.sw_port:null;return a?[a,n]:[Object(o.d)(t),null]}return[Object(o.c)(t),null]},_=(e,t,a,n,r)=>{const[i,c]=d(a,r),[o,E]=d(n,r);return Object(l.d)(i,o)||Object(l.d)(c,E)||m(a,n)},b=(e,t)=>{let a=null;switch(e.type){case i.c.WIRED:a="wired";break;case i.c.WIRELESS:a=Object(c.B)(e);break;case i.c.VPN:a="vpn";break;case i.c.TELEPORT:a="teleport"}return a||Object(o.c)(t)},u=(e,t,a,n,r)=>Object(l.d)(b(a,r),b(n,r))||m(a,n),O=(e,t)=>e.type===i.c.VPN||e.type===i.c.TELEPORT?Object(o.c)(t):e.vendor||Object(o.c)(t),p=(e,t,a,n,r)=>Object(l.d)(O(a,r),O(n,r))||u(e,t,a,n,r),I=e=>(t,a,n,r,i)=>Object(l.d)(e(n,t,i),e(r,a,i))||m(n,r),g=(e,t)=>{const a="is_wired"in e?e.is_wired:void 0,l="wired_rate_mbps"in e?e.wired_rate_mbps:void 0,{satisfaction:r,known:i}=Object(c.e)(void 0,e);switch(!0){case!a&&r>0&&i:return r*o.i;case a&&!!l:return l>0?Object(n.a)(l,1)*o.h:Object(o.a)(o.f,t);default:return Object(o.a)(o.f,t)}}},2776:function(e,t,a){"use strict";a.r(t);var n=a(0),l=a.n(n),r=a(4),i=a(25),c=a(16),o=a(867),E=a(22),s=a(1016),m=a(8),d=a(18),_=a(17),b=a(92),u=a(2604),O=a(362),p=a(3),I=a(1),g=a(2757),v=a(1670),C=a(236),R=a(76),T=a(5),h=a(2841),D=a(20),P=a(2833),y=a(2851),f=a(2608),S=a(1193),A=a(2898),N=a(47),j=a(101),L=a(1431),x=a(2976),M=a.n(x),V=a(2977),w=a.n(V),F=a(55);var U=({width:e,height:t})=>{const{motif:a}=Object(F.a)();return l.a.createElement("svg",{width:e||"100%",height:t||"100%",viewBox:"0 0 1317 425",version:"1.1"},l.a.createElement("defs",null,l.a.createElement("linearGradient",{x1:"23.5625587%",y1:"37.1171737%",x2:"26.4590015%",y2:"63.4956711%",id:"linearGradient-1"},l.a.createElement("stop",{stopColor:"dark"===a?"#0B0B0B":"#FFFFFF",offset:"0%"}),l.a.createElement("stop",{stopColor:"dark"===a?"#0B0B0B":"#F1F2F4",offset:"100%"})),l.a.createElement("linearGradient",{x1:"74.7817639%",y1:"60.5160014%",x2:"74.7817639%",y2:"23.2381834%",id:"linearGradient-2"},l.a.createElement("stop",{stopColor:"dark"===a?"#0B0B0B":"#FFFFFF",offset:"0%"}),l.a.createElement("stop",{stopColor:"dark"===a?"#191919":"#EDEFF3",offset:"100%"})),l.a.createElement("linearGradient",{x1:"74.7817639%",y1:"50.9880975%",x2:"73.8702022%",y2:"49.4726834%",id:"linearGradient-3"},l.a.createElement("stop",{stopColor:"dark"===a?"#0B0B0B":"#FFFFFF",offset:"0%"}),l.a.createElement("stop",{stopColor:"dark"===a?"#191919":"#F1F2F4",offset:"100%"}))),l.a.createElement("g",{transform:"translate(-49.000000, -343.000000)"},l.a.createElement("rect",{fill:"url(#linearGradient-1)",x:"50.0104776",y:"100.517643",width:"1316",height:"668"}),l.a.createElement("g",{transform:"translate(49.729539, 343.988832)"},l.a.createElement("path",{d:"M0.280938469,426 L0.280938469,139.489155 C128.341662,94.029445 266.054671,80.067102 413.419966,97.6021263 C671.171543,135.059306 932.365857,97.807556 1007.58296,64.2636961 C1082.80007,30.7198362 1138.87801,0 1316.55899,0 C1316.47584,0 1316.38315,142 1316.28094,426 L0.280938469,426 Z",fill:"url(#linearGradient-2)"}),l.a.createElement("path",{d:"M0,426.528811 L0,322.951008 C120.91524,293.898501 280.459401,283.248156 478.63248,290.999974 C720.759053,305.925398 822.554415,297.739613 927.443097,283.625496 C1001.95235,273.599321 1053.95747,263.122015 1114.89107,254.158398 C1167.45634,246.4258 1233.71461,241.528811 1316.00288,241.528811 C1316.01854,241.528811 1315.92839,302.773619 1315.73242,425.263235 L0,426.528811 Z",fill:"url(#linearGradient-3)",transform:"translate(658.001441, 334.028811) scale(-1, 1) translate(-658.001441, -334.028811) "}))))};const z=Object(p.c)("div")`
  margin-bottom: 34px;
  margin-top: 20px;
  max-width: 450px;
  text-align: center;
`,k=Object(p.c)("a")`
  margin: 8px 16px;
`,B=Object(p.c)(N.a)`
  font-size: 16px;
  margin-top: 4px;
`,W=Object(p.c)("div")`
  position: absolute;
  width: 100%;
  height: 100%;
`,G=Object(p.c)(T.a)`
  position: relative;
  width: 100%;
  height: 70%;
  z-index: 1;
`,H=Object(p.c)(T.a)`
  position: absolute;
  bottom: 0;
  min-height: 425px;
  width: 100%;
`;var Y=()=>l.a.createElement(W,null,l.a.createElement(G,{flexDirection:"column",alignItems:"center",justifyContent:"center"},l.a.createElement(L.a,{width:50,height:50}),l.a.createElement(z,null,l.a.createElement(N.a,{size:"header-s",weight:"bold"},l.a.createElement(I.b,{id:"WIFI_MAN_NO_CONTENT_TITLE"})),l.a.createElement(B,{size:"header-s",color:"tertiary"},l.a.createElement(I.b,{id:"WIFI_MAN_NO_CONTENT_SUBTITLE"}))),l.a.createElement(T.a,{alignItems:"center",justifyContent:"center"},l.a.createElement(k,{href:j.a.wifiManAppStore,target:"_blank",rel:"noopener noreferrer"},l.a.createElement("img",{src:w.a,alt:"View in Apple App Store",width:"103",height:"32"})),l.a.createElement(k,{href:j.a.wifiManGooglePlay,target:"_blank",rel:"noopener noreferrer"},l.a.createElement("img",{src:M.a,alt:"View in Google Play Store",width:"103",height:"32"})))),l.a.createElement(H,{alignItems:"flex-end",justifyContent:"flex-start"},l.a.createElement(U,null))),$=a(2824),K=a(753),X=a(2616),q=a(2617);const Z=Object(p.c)(T.a)`
  height: 100%;
  padding: 0 16px;
  align-items: flex-start;
`,J=(Object(p.c)(N.a)`
  margin-right: 4px;
  font-size: 14px;
`,Object(p.c)(N.a)`
  font-size: 14px;
`,Object(p.c)($.d)`
  height: 90%;
`),Q=Object(p.c)(T.a,{shouldForwardProp:e=>"withRightMargin"!==e})`
  ${({withRightMargin:e})=>e&&"margin-right: 28px;"}
`,ee=Object(p.c)(N.a)`
  line-height: 1 !important;
  margin-left: 4px;
`,te=Object(p.c)(N.a)`
  line-height: 1 !important;
  margin-top: 6px;
  margin-left: 2px;
`;var ae=({...e})=>{const t=Object(r.useSelector)(s.c),{isp_name:a,public_ip:n,report_timestamp:i}=t||{};return t?l.a.createElement(T.a,Object.assign({justifyContent:"center",alignItems:"center"},e),l.a.createElement(Z,{alignItems:"center"},l.a.createElement(Q,{flexDirection:"column"},l.a.createElement(ee,{heading:"primary"},l.a.createElement(I.b,{id:"WIFI_MAN_CONTROL_PANEL_ISP"})),l.a.createElement(te,{color:"secondary",size:"body"},a))),l.a.createElement(J,null),l.a.createElement(Z,{alignItems:"center"},l.a.createElement(Q,{flexDirection:"column"},l.a.createElement(ee,{heading:"primary"},l.a.createElement(I.b,{id:"WIFI_MAN_CONTROL_PANEL_PUBLIC_IP"})),l.a.createElement(te,{color:"secondary",size:"body"},n))),l.a.createElement(J,null),l.a.createElement(Z,{alignItems:"center"},l.a.createElement(T.a,{height:"100%",alignItems:"flex-start"},l.a.createElement(Q,{withRightMargin:!0,flexDirection:"column"},l.a.createElement(T.a,{alignItems:"center"},l.a.createElement(ee,{heading:"primary"},l.a.createElement(I.b,{id:"COMMON_WORD_DOWN"}))),l.a.createElement(T.a,{alignItems:"center"},l.a.createElement(X.a,{item:t}))),l.a.createElement(Q,{flexDirection:"column"},l.a.createElement(T.a,{alignItems:"center"},l.a.createElement(ee,{heading:"primary"},l.a.createElement(I.b,{id:"COMMON_WORD_UP"}))," "),l.a.createElement(T.a,{alignItems:"center"},l.a.createElement(q.a,{item:t}))))),l.a.createElement(J,null),l.a.createElement(Z,{alignItems:"center"},l.a.createElement(Q,{flexDirection:"column"},l.a.createElement(ee,{heading:"primary"},l.a.createElement(I.b,{id:"COMMON_DATE_TIME"})),l.a.createElement(te,{color:"secondary",size:"body"},l.a.createElement(K.a,{date:new Date(1e3*i)}))))):null},ne=a(173),le=a(10),re=a(3045),ie=a.n(re),ce=a(3046),oe=a.n(ce),Ee=a(261),se=a(34),me=a(217);const de=Object(p.c)(T.a,{shouldForwardProp:e=>"motif"!==e})`
  background: url(${({motif:e})=>e===me.a.LIGHT?ie.a:oe.a}) center;
  background-size: cover;
  position: relative;
  overflow: hidden;
  padding: 0 37px;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04} !important;
`,_e=Object(p.c)("a")`
  margin: 8px 16px;
`,be=Object(p.c)(N.a)`
  margin-left: 12px;
`,ue=Object(p.c)(N.a)`
  margin-left: 12px;
  @media ${se.a.VIEWPORT_M_DOWN} {
    display: none;
  }
`,Oe=Object(p.c)(ne.a)`
  width: 30px;
  height: 30px;
  margin-left: 55px;
`;var pe=()=>{const e=Object(r.useDispatch)(),{motif:t}=Object(F.a)(),a=Object(n.useCallback)(()=>{e(Object(Ee.g)({showWifimanAppsBanner:!1}))},[]);return l.a.createElement(de,{height:60,width:"100%",alignItems:"center",justifyContent:"space-between",motif:t},l.a.createElement(T.a,{alignItems:"center",zIndex:25},l.a.createElement(L.a,{width:32,height:32}),l.a.createElement(be,{color:t===me.a.LIGHT?"secondary":"primary",size:"body",weight:"bold",truncate:!0},l.a.createElement(I.b,{id:"WIFI_MAN_NO_CONTENT_TITLE"})),l.a.createElement(ue,{color:t===me.a.LIGHT?"secondary":"primary",truncate:!0},l.a.createElement(I.b,{id:"WIFI_MAN_NO_CONTENT_SUBTITLE"}))),l.a.createElement(T.a,{alignItems:"center",justifyContent:"center",zIndex:25},l.a.createElement(_e,{href:j.a.wifiManAppStore,target:"_blank",rel:"noopener noreferrer"},l.a.createElement("img",{src:w.a,alt:"View in Apple App Store",width:"103",height:"32"})),l.a.createElement(_e,{href:j.a.wifiManGooglePlay,target:"_blank",rel:"noopener noreferrer"},l.a.createElement("img",{src:M.a,alt:"View in Google Play Store",width:"103",height:"32"})),l.a.createElement(Oe,{onClick:a,role:"button",Icon:l.a.createElement(le.z,{width:20,height:20})})))};const Ie=Object(p.c)(T.a)`
  height: 100%;
  overflow: auto;
  padding: 32px;
`,ge=Object(p.c)(T.a)`
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  overflow: auto;
`,ve=p.a`
  cursor: pointer;
`,Ce=Object(p.c)(g.a)`
  max-width: 310px !important;
  > svg {
    visibility: hidden;
  }
  > div {
    left: auto !important;
    background: transparent !important;
  }
  > h3 {
    color: ${({theme:e})=>e.motifPalette.text01} !important;
  }
  > p {
    font-size: ${({theme:e})=>e.fontSize["font-size-l2"]};
    letter-spacing: 0.27px;
    color: ${({theme:e})=>e.motifPalette.text03};
  }
`,Re=Object(p.c)(ae)`
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  display: flex;
  justify-content: center;

  padding-bottom: 16px;
  padding-top: 16px;
`;var Te=()=>{const e=Object(i.k)(),{site:t}=Object(i.m)(),a=Object(r.useDispatch)(),c=Object(r.useSelector)(f.a),o=!!Object(r.useSelector)(s.c),E=Object(r.useSelector)(S.c),m=Object(r.useSelector)(D.I),d=Object(n.useMemo)(()=>Object(P.a)(E,S.a),[E]),_=!(null==c?void 0:c.length)&&d,u=Object(n.useCallback)(({id:n})=>{e.push(Object(i.i)("/:site/insights/wifiman/properties/:id?/:panel?/:subPanel?/:subPanelId?",{id:n,site:t,panel:"tests"})),a(Object(R.g)({type:b.c.WIFI_MAN,id:n}))},[a,e,t]),{sortBy:O,isAscending:p,initialColumns:g}=Object(r.useSelector)(Object(D.B)(C.a.WIFI_MAN));return l.a.createElement(l.a.Fragment,null,_?l.a.createElement(ge,null,l.a.createElement(Y,null)):l.a.createElement(l.a.Fragment,null,o&&l.a.createElement(Re,null),m.showWifimanAppsBanner&&l.a.createElement(pe,null),c.length&&(null==g?void 0:g.length)?l.a.createElement(Ie,{hasSpeedTest:o,flexDirection:"column"},l.a.createElement(h.a,null,l.a.createElement(v.a,{items:c,columns:A.a,onColumnFilterChanged:({visibleColumns:e})=>{a(Object(D.L)(C.a.WIFI_MAN,{initialColumns:e.map(({id:e})=>e)}))},onRowClick:u,onSort:(e,t)=>{a(Object(D.L)(C.a.WIFI_MAN,{sortBy:e.id,isAscending:t}))},initialSortBy:O,initiallySortAscending:p,rowHeight:32,rowClassName:ve,columnOverride:g,disableColumnFilters:!0,headerRowClassName:y.a}))):l.a.createElement(l.a.Fragment,null,l.a.createElement(Ce,{icon:"noSpeedTests",title:l.a.createElement(I.b,{id:"WIFI_MAN_EMPTY_HEADER"}),details:l.a.createElement(I.b,{id:"WIFI_MAN_EMPTY_DESCRIPTION"}),button:null}))))};t.default=function(){const e=Object(r.useDispatch)();return Object(n.useEffect)(()=>()=>{e(Object(m.c)(s.b))},[]),Object(E.g)(()=>Promise.all([{action:Object(c.fetchSettings)({type:m.a.CACHE})},{action:s.b,onError:()=>{e(Object(d.a)({icon:_.a.danger,message:"WIFI_MAN_FETCH_ERROR"}))}}].map(({action:t,onError:a=(()=>{})})=>e(t).catch(a))),l.a.createElement(o.a,null,l.a.createElement(Te,null),l.a.createElement(i.g,null,l.a.createElement(O.a,{path:"/:site/insights/wifiman/properties/:id?/:panel?/:subPanel?/:subPanelId?"},l.a.createElement(u.a,{panelType:b.c.WIFI_MAN})))),{trackingName:"wifiman"})}},2821:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(1671),c=a(5),o=a(34);const E=Object(r.c)(c.a)`
  border-bottom: 1px ${({theme:e})=>e.colors.border} solid;
  box-sizing: border-box;

  @media ${o.a.VIEWPORT_M_UP} {
    padding: 0 ${({theme:e})=>e.space[4]}px;
  }
`,s=Object(r.c)(i.a)`
  bottom: -1px;
`;t.a=({isLoading:e,children:t,...a})=>l.a.createElement(E,Object.assign({},a,{flex:"none",className:"base-control-panel",position:"relative",alignItems:"center",justifyContent:"space-between",height:50}),t,l.a.createElement(s,{isLoading:e,placement:"bottom"}))},2822:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(5),c=a(1),o=a(47),E=a(481),s=a(2821),m=a(2823),d=a(2832),_=a(31),b=a(179);const u=Object(r.c)(o.a,{shouldForwardProp:e=>"addMargin"!==e})`
  font-size: 14px;
  ${({addMargin:e})=>e&&"margin-left: 50%;"}
  position: absolute;
  transform: translateX(-50%);
  left: 50%;
`;t.a=({routes:e=[],hideFilterButton:t=!1,isLoading:a,children:n,filterTitleLabel:r,filtersActive:o,title:O,leftContent:p,isDisplayOptionsDisabled:I})=>{const g=(null==e?void 0:e.length)>1,v=!g&&1===e.length;return l.a.createElement(s.a,{isLoading:a},p&&p,g&&l.a.createElement(m.a,{routes:e}),v&&l.a.createElement(u,{weight:"bold"},e[0].label),O&&l.a.createElement(u,{weight:"bold",addMargin:t&&!p},l.a.createElement(c.b,{id:O})),l.a.createElement(i.a,{height:"100%",flex:g||O||v?"none":1,alignItems:"center",justifyContent:"flex-end",marginLeft:"auto"},n,!t&&l.a.createElement(b.a,{condition:I,wrapper:e=>l.a.createElement(E.a,{position:"bottom",width:"208px",portal:!0,message:l.a.createElement(_.p,null,l.a.createElement(c.b,{id:"COMMON_DISPLAY_OPTS_DISABLED"}))},e)},l.a.createElement(d.a,{disabled:I,filterTitleLabel:r,filtersActive:o}))))}},2823:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(25),c=a(807);var o=({items:e,...t})=>{const{params:a,path:n}=Object(i.n)(),r=Object(i.l)(),o=Object(i.k)(),E=e.find(({path:e})=>e===n)||((e,{pathname:t})=>e.find(({path:e})=>new RegExp(e.replace(/\/:\w+\?.*/g,"/?.*").replace(/:\w+/g,"\\w+").replace(/\//g,"\\$&")).test(t)))(e,r);return l.a.createElement(c.a,Object.assign({tabs:e,selectedTab:null==E?void 0:E.id,onSelectTab:({path:e,params:t={}})=>o.push(Object(i.i)(e,{...a,...t}))},t))};const E=Object(r.c)(o)`
  height: 100%;
  position: absolute;
  left: 0;
  right: 0;
  div,
  button {
    height: 100% !important;
  }
`;t.a=({routes:e})=>{const t=Object(n.useMemo)(()=>e&&e.map(({id:e,label:t,disabled:a,path:n,...l})=>({id:e,label:t,disabled:"function"==typeof a?a(l):a,path:n})),[e]);return t?l.a.createElement(E,{selectedTabBold:!0,items:t}):null}},2824:function(e,t,a){"use strict";a.d(t,"b",(function(){return n.a})),a.d(t,"a",(function(){return i})),a.d(t,"d",(function(){return c})),a.d(t,"e",(function(){return d})),a.d(t,"c",(function(){return _.a}));a(2821);var n=a(2828),l=a(3),r=a(173);var i=Object(l.c)(r.a)`
  padding-left: ${({theme:e})=>e.space[3]}px;
  padding-right: ${({theme:e})=>e.space[3]}px;
  color: ${({theme:e})=>e.colors.subtlerText};
  &:hover {
    color: ${({theme:e})=>e.colors.mediumText};
  }
`;var c=Object(l.c)("span")`
  border-right: 1px ${({theme:e})=>e.colors.border} solid;
  margin: 0 ${({theme:e})=>e.space[4]}px;
  position: relative;
  height: 100%;
  display: block;
`,o=a(0),E=a.n(o),s=a(807);const m=l.a`
  align-items: center;
  display: flex;
  height: 100%;
  width: auto;
  justify-content: flex-end;
  overflow-x: unset;

  > div {
    margin: initial;
  }
`;function d(e){return E.a.createElement(s.a,Object.assign({className:m},e))}a(2823),a(2822);var _=a(2826)},2826:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(1),c=a(47),o=a(2600);const E=Object(r.c)(c.a)`
  line-height: 24px;
  color: ${({theme:e})=>e.motifPalette.text01};
`,s=Object(r.c)("div",{shouldForwardProp:e=>"toggleStyle"!==e})`
  justify-content: space-between;
  margin-top: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginTop)&&void 0!==t?t:8}}px;
  margin-right: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginRight)&&void 0!==t?t:0}}px;
  margin-bottom: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginBottom)&&void 0!==t?t:0}}px;
  margin-left: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginLeft)&&void 0!==t?t:0}}px;
  width: auto !important;

  label {
    margin-left: 0;
  }
`;t.a=({checked:e,disabled:t,id:a,onChange:n,text:r,toggleStyle:c})=>l.a.createElement(s,{toggleStyle:c},l.a.createElement(o.a,{checked:e,id:a,onChange:n,disabled:t},"string"==typeof r?l.a.createElement(E,{size:"body"},l.a.createElement(i.b,{id:r})):r))},2828:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(1),i=a(4),c=a(20);const o=e=>{var t;return null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.isFilterOpen};var E=a(1192),s=a(3),m=a(2769),d=a(3116),_=a(3108),b=a(464),u=a(3059);const O=Object(s.c)(u.a)`
  padding: 24px;
`;var p=({columns:e,columnLabels:t,tableType:a,hidden:o=[]})=>{var E;const s=Object(i.useDispatch)(),m=(null===(E=Object(i.useSelector)(Object(c.B)(a)))||void 0===E?void 0:E.initialColumns)||[],d=Object(n.useMemo)(()=>Object.values(e).every(e=>m.includes(e)),[m]),_=Object(n.useCallback)(()=>{const t=d||(null==m?void 0:m.length)?[]:Object.values(e);s(Object(c.L)(a,{initialColumns:t},!0))},[s,d,a,m]),b=Object(n.useMemo)(()=>[{full:!0,id:"showAllFields",checked:d||!!(null==m?void 0:m.length)&&"mixed",children:l.a.createElement(r.b,{id:"COMMON_ALL"}),onChange:_}].concat(Object.values(e).filter(e=>!o.includes(e)).map(e=>({full:!0,id:e,checked:m.includes(e),children:(null==t?void 0:t[e])?l.a.createElement(r.a,{id:t[e]}):e,onChange:({target:{checked:t}})=>{const n=t?[...m,e]:m.filter(t=>t!==e);s(Object(c.L)(a,{initialColumns:n},!0))}}))),[m,a]);return l.a.createElement(O,{spacing:"flush",items:b,variant:"list"})};const I=Object(s.c)(m.a)`
  width: 258px !important;
`;var g;!function(e){e.COLUMNS="columns",e.FILTERS="filters"}(g||(g={}));var v=({filterTitleLabel:e,isOpen:t,onClose:a,columnTabProps:o,renderFilterDrawerContent:E,footerProps:s,side:m="left"})=>{var u;const[O,v]=Object(n.useState)(g.FILTERS),{tableType:C}=o||{tableType:null},R=Object(i.useDispatch)(),T=(null===(u=Object(i.useSelector)(Object(c.B)(C)))||void 0===u?void 0:u.initialColumns)||[],h=s&&O===g.COLUMNS,D=Object(n.useMemo)(()=>{var e,t;return h&&Object(b.a)(null===(t=null===(e=null===c.c||void 0===c.c?void 0:c.c.tables)||void 0===e?void 0:e[C])||void 0===t?void 0:t.initialColumns,T)},[h,C,T]),P=Object(n.useCallback)(()=>{var e,t,a;const n=[...null!==(a=null===(t=null===(e=null===c.c||void 0===c.c?void 0:c.c.tables)||void 0===e?void 0:e[C])||void 0===t?void 0:t.initialColumns)&&void 0!==a?a:[]];R(Object(c.L)(C,{initialColumns:n},!0))},[R,C]),y=Object(n.useCallback)(({id:e})=>v(e),[v]),f=o?l.a.createElement(d.a,{onSelectTab:y,tabs:[{id:g.FILTERS,label:l.a.createElement(r.b,{id:"COMMON_CONTROL_PANEL_FILTERS"}),render:E},{id:g.COLUMNS,label:l.a.createElement(r.b,{id:"COMMON_CONTROL_PANEL_COLUMNS"}),render:()=>l.a.createElement(p,{columns:o.columns,hidden:o.hidden,columnLabels:o.columnLabels,tableType:C})}]}):E(),S=Object(n.useMemo)(()=>h?{label:l.a.createElement(r.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_COLUMNS"}),onClick:P,disabled:D}:s,[h,s,D,P]),A=Object(n.useCallback)(()=>{a(),v(g.FILTERS)},[a,v]);return l.a.createElement(I,{in:t,renderHeader:()=>null,onClose:a,side:m},t&&l.a.createElement(_.a,{footerProps:S,headerProps:{label:e},onClose:A},f))},C=a(2822);t.a=Object(r.e)(({routes:e=[],hideFilterButton:t=!1,isLoading:a,children:r,filterFooterProps:s,columnTabProps:m,renderFilterDrawerContent:d,filterTitleLabel:_,filtersActive:b,title:u,onClose:O,intl:p,leftContent:I,isDisplayOptionsDisabled:g})=>{var R;const T=Object(i.useDispatch)(),h=Object(i.useSelector)(o),D=(null===(R=Object(i.useSelector)(Object(c.B)(null==m?void 0:m.tableType)))||void 0===R?void 0:R.initialColumns)||[],P=p.formatMessage({id:_||"COMMON_CONTROL_PANEL_FILTER_TITLE"});Object(n.useEffect)(()=>()=>{T(Object(E.b)(!1))},[]);const y=Object(n.useCallback)(()=>{T(Object(E.b)(!1)),null==O||O(),(null==m?void 0:m.tableType)&&T(Object(c.L)(m.tableType,{initialColumns:D}))},[T,O,null==m?void 0:m.tableType,D]);return l.a.createElement(l.a.Fragment,null,l.a.createElement(v,{isOpen:h,filterTitleLabel:P,onClose:y,columnTabProps:m,renderFilterDrawerContent:()=>h&&d,footerProps:s,side:"right"}),l.a.createElement(C.a,{leftContent:I,routes:e,hideFilterButton:t,isLoading:a,filterTitleLabel:P,filtersActive:b,title:u,isDisplayOptionsDisabled:g},r))})},2832:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(4),c=a(3117),o=a(34),E=a(5),s=a(1192);const m=Object(r.c)(c.a,{shouldForwardProp:e=>"disabled"!==e})`
  pointer-events: ${({disabled:e})=>e?"none":"auto"};
  opacity: ${({disabled:e})=>e?.45:1};
  cursor: ${({disabled:e})=>e?"default":"pointer"};
  padding: 0 8px 0 0;
  z-index: 5;

  // Hides the text element on smaller screens
  button div > span {
    display: none;
  }

  button svg {
    margin-right: 0;
  }

  button {
    padding: 0 8px;
  }

  @media ${o.a.VIEWPORT_M_UP} {
    button {
      padding: 0 16px;
    }

    button svg {
      margin-right: 4px;
    }

    button div > span {
      display: inline-block;
    }
  }
`;t.a=({filterTitleLabel:e,filtersActive:t,items:a,disabled:n})=>{const r=Object(i.useDispatch)();return l.a.createElement(E.a,{height:"100%"},l.a.createElement(m,{disabled:n,title:e,onClick:()=>!n&&r(Object(s.b)(!0)),filtersActive:t}),a)}},2833:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n=(e,t)=>{const a=Object.keys(e||{}),n=Object.keys(t||{});return a.length===n.length&&n.every(a=>e[a]&&e[a].length===t[a].length&&t[a].every(t=>e[a].includes(t)))}},2841:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3);const i=Object(r.c)("div")`
  width: 100%;
  table:after {
    content: '';
    display: block;
    position: absolute;
    right: -32px;
    width: 32px;
    height: 1px;
  }
`;t.a=({children:e})=>l.a.createElement(i,null,e)},2851:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n=a(3).a`
  th {
    span {
      font-size: 14px;
      font-weight: 700;
    }
    svg {
      width: 16px;
      height: 16px;
    }
  }
`},2854:function(e,t,a){"use strict";var n,l;a.d(t,"a",(function(){return i})),function(e){e[e.START=0]="START",e[e.CLOSE=60]="CLOSE",e[e.FAR=75]="FAR",e[e.END=100]="END"}(n||(n={})),function(e){e[e.START=1]="START",e[e.CLOSE=.9]="CLOSE",e[e.NEAR=.6]="NEAR",e[e.FAR=.3]="FAR",e[e.END=0]="END"}(l||(l={}));const r=(e,t,a,n,l)=>Number(((a-t)/(n-l)*(n-e)+t).toFixed(2)),i=e=>{const t=(e=>e<=n.CLOSE?r(e,l.CLOSE,l.START,n.CLOSE,n.START):e>=n.CLOSE&&e<=n.FAR?r(e,l.NEAR,l.CLOSE,n.FAR,n.CLOSE):r(e,l.END,l.FAR,n.END,n.FAR))(e),a=0,i=93,c=53;return`hsl(${(99-a)*t+a}, ${(100-i)*t+i}%, ${(41-c)*t+c}%)`}},2898:function(e,t,a){"use strict";a.d(t,"a",(function(){return y}));var n=a(0),l=a.n(n),r=a(1),i=a(47),c=a(1154),o=a(851),E=a(3),s=a(48),m=a(5),d=a(954),_=a(753),b=a(104),u=a(2626),O=a(1016),p=a(4),I=a(6);var g=({mac:e,props:t,children:a})=>{const l=Object(n.useMemo)(()=>Object(I.selectDeviceRecordProperties)(e,t),[e,t]);return a(Object(p.useSelector)(l))},v=a(2854),C=a(42),R=a(2616),T=a(2617),h=a(2627);const D=Object(E.c)(i.a)`
  max-width: 90%;
`,P=Object(E.c)(c.a)`
  width: 24px;
  margin-left: 7px;
`,y=[{id:d.b.NAME,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.NAME]}),renderCell:({client_name:e})=>l.a.createElement(D,{size:"body",color:"inherit",truncate:!0},e),compare:Object(C.b)(e=>e.client_name)},{id:d.b.WIFI_EXPERIENCE,sortable:!0,label:l.a.createElement(r.b,{id:d.c[d.b.WIFI_EXPERIENCE]}),minWidth:120,renderCell:({client_wifi_experience:e})=>l.a.createElement(o.a,{type:"percent",size:"body",input:e/100,style:{color:s.a["color-"+Object(b.c)(e)]}}),compare:Object(C.b)(e=>e.client_wifi_experience)},{id:d.b.AP_MODEL,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.AP_MODEL]}),renderCell:({device_model:e})=>l.a.createElement(i.a,{size:"body",color:"inherit"},l.a.createElement(u.a,{model:e,withName:!0,width:20,height:20})),compare:Object(C.b)(e=>e.device_model)},{id:d.b.AP_NAME,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.AP_NAME]}),renderCell:({device_name:e})=>l.a.createElement(D,{size:"body",color:"inherit",truncate:!0},e),compare:Object(C.b)(e=>e.device_name)},{id:d.b.SSID,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.SSID]}),renderCell:e=>l.a.createElement(i.a,{size:"body",color:"inherit"},e.wlan_essid),compare:Object(C.b)(e=>e.wlan_essid)},{id:d.b.SIGNAL,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.SIGNAL]}),renderCell:({client_signal:e})=>l.a.createElement(i.a,{color:"inherit",size:"body"},l.a.createElement(m.a,{alignItems:"center"},e," ",l.a.createElement(r.b,{id:"COMMON_UNIT_DBM"}),l.a.createElement(P,{variant:"gradient",size:"medium",color:Object(v.a)(Math.abs(e)),value:100-Math.abs(e)}))),compare:Object(C.b)(e=>e.client_signal)},{id:d.b.CHANNEL,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.CHANNEL]}),renderCell:({wlan_channel_width:e,wlan_channel:t})=>l.a.createElement(i.a,{size:"body",color:"inherit"},""+t," ",e&&l.a.createElement(i.a,{size:"body",color:"inherit"},"(",""+e," ",l.a.createElement(r.b,{id:"COMMON_UNIT_MHZ"}),")")),compare:Object(C.b)(e=>e.wlan_channel_width)},{id:d.b.DOWN,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.DOWN]}),renderCell:e=>l.a.createElement(R.a,{item:e}),compare:Object(C.b)(e=>((null==e?void 0:e.speed_tests)||[]).reduce((e,{download_speed_bytes:t})=>e+t,0))},{id:d.b.UP,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.UP]}),renderCell:e=>l.a.createElement(T.a,{item:e}),compare:Object(C.b)(e=>((null==e?void 0:e.speed_tests)||[]).reduce((e,{upload_speed_bytes:t})=>e+t,0))},{id:d.b.END_POINT,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.END_POINT]}),renderCell:e=>l.a.createElement(i.a,{color:"inherit",size:"body"},(()=>{var t,a,n;const{mac:i}=(null===(t=null==e?void 0:e.speed_tests)||void 0===t?void 0:t[0])||{mac:null};switch(null===(n=null===(a=null==e?void 0:e.speed_tests)||void 0===a?void 0:a[0])||void 0===n?void 0:n.type){case O.a.INTERNET:return l.a.createElement(r.b,{id:"COMMON_WORD_INTERNET"});case O.a.LOCAL_DEVICE:return i?l.a.createElement(g,{mac:i,props:["name"]},({name:e=i})=>e):l.a.createElement(r.b,{id:"COMMON_HYPHEN"});case O.a.LOCAL_CLIENT:return l.a.createElement(r.b,{id:"WIFI_MAN_ANOTHER_WIFI_MAN_APP_INSTANCE"});default:return l.a.createElement(r.b,{id:"COMMON_HYPHEN"})}})()),compare:Object(C.b)(e=>{var t,a;return null===(a=null===(t=null==e?void 0:e.speed_tests)||void 0===t?void 0:t[0])||void 0===a?void 0:a.type})},{id:d.b.RATE,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.RATE]}),renderCell:e=>l.a.createElement(i.a,{color:"inherit",size:"body"},l.a.createElement(h.a,{item:e})),compare:Object(C.b)(e=>((null==e?void 0:e.client_link_download_rate_kbps)||0)+((null==e?void 0:e.client_link_upload_rate_kbps)||0))},{id:d.b.DATE,sortable:!0,minWidth:120,label:l.a.createElement(r.b,{id:d.c[d.b.DATE]}),renderCell:e=>l.a.createElement(i.a,{color:"inherit",size:"body"},l.a.createElement(_.a,{date:e.date})),compare:Object(C.b)(e=>e.date)}]},2976:function(e,t,a){e.exports=a.p+"../images/e3ea015c98c4f1809ad62d0ef9c14a88.svg"},2977:function(e,t,a){e.exports=a.p+"../images/1cfd5dba4a9210bcf77f5dbe48ec2e66.svg"},3045:function(e,t,a){e.exports=a.p+"../images/85dfe74479aaa9914379f54c551a108f.svg"},3046:function(e,t,a){e.exports=a.p+"../images/7e7ded544b957a31a27e8aed8d6af047.svg"},325:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(3),i=a(210),c=a.n(i),o=a(10),E=a(5),s=a(22);const m=Object(r.c)(E.a,{shouldForwardProp:e=>!["borderColor","backgroundColor","dividerColor","standalone"].includes(e)})`
  background-color: ${({backgroundColor:e})=>e};
  border-left: 2px solid ${({borderColor:e})=>e};
  padding: ${({standalone:e})=>e?"6px 18px 0 0":"16px 16px 16px 0"};

  & + & {
    border-top: 1px solid ${({dividerColor:e})=>e};
  }

  ${({standalone:e,dividerColor:t})=>e&&`\n    border: 1px solid ${t};\n    margin-bottom: 4px;\n  `}
`,d=Object(r.c)(E.a)`
  min-width: 36px;
  max-width: 36px;
`;t.a=({level:e,children:t,standalone:a})=>{const n=Object(s.n)(),{icon:r,backgroundColor:i,borderColor:_,dividerColor:b}=((e,t)=>{switch(e){case"warning":return{icon:l.a.createElement(o.a,{size:"medium",color:t.motifPalette.warning,variant:"fill"}),backgroundColor:t.motifPalette.neutral01,borderColor:t.motifPalette.warning,dividerColor:c()(t.motifPalette.warning).alpha(.2).css()};case"danger":return{icon:l.a.createElement(o.w,{size:"medium",color:t.motifPalette.danger,variant:"fill"}),backgroundColor:t.motifPalette.neutral01,borderColor:t.motifPalette.danger,dividerColor:c()(t.motifPalette.danger).alpha(.2).css()};default:return{icon:l.a.createElement(o.cb,{isActive:!0,size:"original",variant:"fill"}),backgroundColor:t.motifPalette.neutral01,borderColor:t.motifPalette.info,dividerColor:c()(t.motifPalette.info).alpha(.2).css()}}})(e,n);return l.a.createElement(m,{flexDirection:"row",width:"100%",backgroundColor:i,borderColor:_,dividerColor:b,standalone:a},l.a.createElement(d,{justifyContent:"center"},r),l.a.createElement(E.a,{flexDirection:"column",justifyContent:"center"},t))}},435:function(e,t,a){"use strict";a.d(t,"i",(function(){return d})),a.d(t,"l",(function(){return _})),a.d(t,"c",(function(){return b})),a.d(t,"j",(function(){return O})),a.d(t,"f",(function(){return p})),a.d(t,"d",(function(){return I})),a.d(t,"h",(function(){return g})),a.d(t,"e",(function(){return v})),a.d(t,"b",(function(){return C})),a.d(t,"g",(function(){return R})),a.d(t,"k",(function(){return T})),a.d(t,"a",(function(){return h}));var n=a(10),l=a(1671),r=a(1037),i=a(48),c=a(173),o=a(3),E=a(5),s=a(11),m=a(208);const d=Object(o.c)(l.a)`
  position: relative;
  margin-left: 8px;
  max-width: 17px;
  border-radius: 8;
  height: 4px;
`,_=Object(o.c)(r.a)`
  margin-left: 8px;
  max-width: 17px;
  border-radius: 8px;
`,b=Object(o.c)("div")`
  width: 100%;
  margin-bottom: ${e=>e.marginBottom||0}px;

  > div {
    align-items: baseline;
  }

  > label {
    &:active {
      top: 30px;
    }
  }

  input {
    width: 100% !important;
  }
`,u=Object(o.c)(s.Field)`
  .labelClassName {
    margin-top: 10px;
  }
`,O=Object(o.c)(u)`
  padding-bottom: 8px;
  .validationMessageClassName {
    display: none;
  }
`,p=Object(o.c)(s.Field)`
  div > div > div {
    [for='usergroup_id'] {
      font-size: ${({theme:e})=>e.fontSize["font-size-caption"]};
    }
    > div {
      font-size: ${({theme:e})=>e.fontSize["font-size-body"]};
    }
  }
`,I=Object(o.c)(n.v)`
  color: ${i.a["neutral-8"]};
`,g=Object(o.c)(n.cb)`
  margin: 2px 8px 0 0;
`,v=Object(o.c)(g)`
  path {
    fill: ${({theme:e})=>e.motifPalette.danger};
  }
`,C=Object(o.c)(c.a)`
  font-size: ${({theme:e})=>e.fontSize["font-size-body"]};
  font-weight: 700;
`,R=Object(o.c)(m.a)`
  border-top: 0;
`,T=Object(o.c)(E.a)`
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};
  button {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
  }
`,h=Object(o.c)(n.f)`
  color: ${({theme:e})=>e.motifPalette.neutral08};
`},491:function(e,t,a){"use strict";a.d(t,"b",(function(){return g})),a.d(t,"c",(function(){return C})),a.d(t,"d",(function(){return R})),a.d(t,"f",(function(){return h})),a.d(t,"j",(function(){return D})),a.d(t,"e",(function(){return y})),a.d(t,"g",(function(){return S})),a.d(t,"h",(function(){return A})),a.d(t,"i",(function(){return N})),a.d(t,"a",(function(){return j}));var n=a(9),l=a(425),r=a.n(l),i=a(852),c=a(81),o=a(124),E=a(96),s=a(260),m=a(54),d=a(853),_=a(59),b=a(162);const u=e=>{switch(e.type){case _.c.WIRED:case _.c.WIRELESS:return(e=>{if(!e.id)return null;const t={_id:e.id,id:e.id,name:e.name,type:e.type,connected:Object(b.r)(e),connection:Object(b.i)(e),mac:e.mac,display_name:e.display_name,hostname:e.hostname,fingerprint:e.fingerprint,rx_bytes:e.rx_bytes,tx_bytes:e.tx_bytes,rx_packets:e.rx_packets,tx_packets:e.tx_packets,"tx_bytes-r":e["tx_bytes-r"],"rx_bytes-r":e["rx_bytes-r"],ip:e.ip,uptime:e.uptime,oui:e.oui,blocked:e.blocked,is_wired:e.is_wired,tx_rate:e.tx_rate,rx_rate:e.rx_rate,authorized:e.authorized,gw_mac:e.gw_mac,is_guest:e.is_guest,fixed_ip:e.fixed_ip,network_id:e.network_id,network_name:e.network_name,usergroup_id:e.usergroup_id,note:e.note,use_fixedip:e.use_fixedip,user_id:e.user_id,uplink_mac:e.uplink_mac,unifi_device_info:e.unifi_device_info,assoc_time:e.assoc_time};switch(t.type){case _.c.WIRED:e.type===_.c.WIRED&&(t.sw_port=e.sw_port,t.wired_rate_mbps=e.wired_rate_mbps);break;case _.c.WIRELESS:e.type===_.c.WIRELESS&&(t.eagerly_discovered=e.eagerly_discovered,t.powersave_enabled=e.powersave_enabled,t.last_seen=e.last_seen,t.rssi=e.rssi,t.essid=e.essid,t.radio=e.radio,t.radio_proto=e.radio_proto,t.mimo=e.mimo,t.signal=e.signal,t.fixed_ap_enabled=e.fixed_ap_enabled,t.fixed_ap_mac=e.fixed_ap_mac,t.wifi_experience_score=e.wifi_experience_score,t.channel=e.channel)}return t})(e);case _.c.TELEPORT:return{_id:(t=e).id,id:t.id,ip:t.ip,type:t.type,display_name:t.display_name,assoc_time:t.assoc_time,connected:Object(b.r)(t)};default:return null}var t};var O=a(2605),p=a(89);var I=a(92);const g=e=>{var t,a,n;return null!==(n=null===(a=null===(t=null==e?void 0:e.shared)||void 0===t?void 0:t.propertypanel)||void 0===a?void 0:a.showing)&&void 0!==n&&n},v=e=>{var t,a,n;return null!==(n=null===(a=null===(t=null==e?void 0:e.shared)||void 0===t?void 0:t.propertypanel)||void 0===a?void 0:a.activeItem)&&void 0!==n?n:{}},C=Object(n.a)(v,({mac:e})=>e),R=(Object(n.a)(v,({id:e})=>e),Object(n.a)(v,({type:e})=>e)),T=[],h=e=>Object(n.b)(n.c,(e,t)=>r()(Object(i.a)(e,T),Object(i.a)(t,T)))(Object(n.a)(t=>{var a,n,l,r;return(null===(r=null===(l=null===(n=null===(a=t.models)||void 0===a?void 0:a[c.B])||void 0===n?void 0:n.byId)||void 0===l?void 0:l[e])||void 0===r?void 0:r.record)||{}},e=>e),e=>e),D=Object(n.a)(o.u,C,(e,t)=>{const a=e.find(e=>e.mac===t);return e.reduce((e,t)=>{var n;return a&&(null===(n=a.uplink_table)||void 0===n?void 0:n.find(e=>e.mac===t.mac))&&e.push({value:t.mac,label:t.name||t.mac}),e},[])}),P=["uptime","rx_bytes","tx_bytes","rx_packets","tx_packets","rx_bytes-r","tx_bytes-r"],y=e=>Object(n.b)(n.c,(e,t)=>r()(Object(i.a)(e,P),Object(i.a)(t,P)))(Object(n.a)(t=>{var a,n,l,r,i,c,o;return(null===(o=(null===(n=null===(a=t.models[E.i])||void 0===a?void 0:a.byId)||void 0===n?void 0:n[e])||(null===(r=null===(l=t.models[E.j])||void 0===l?void 0:l.byId)||void 0===r?void 0:r[e])||(null===(c=null===(i=t.models[E.k])||void 0===i?void 0:i.byId)||void 0===c?void 0:c[e]))||void 0===o?void 0:o.record)||{}},u),e=>e),f=["uptime"],S=e=>Object(n.b)(n.c,(e,t)=>r()(Object(i.a)(e,f),Object(i.a)(t,f)))(Object(n.a)(t=>{var a,n,l;return(null===(l=null===(n=null===(a=t.models[E.i])||void 0===a?void 0:a.byId)||void 0===n?void 0:n[e])||void 0===l?void 0:l.record)||{}},Object(d.o)(e),(e,t)=>((e,t)=>{if(!e.id&&!t.id)return null;const a=Object.assign({},e,t),n={id:a.id,mac:a.mac,model:a.model,oui:a.oui,fingerprint:a.fingerprint,unifi_device_info:a.unifi_device_info,displayable_version:a.displayable_version,product_line:a.product_line,ip:a.ip,network_name:a.network_name,uplink_mac:a.uplink_mac,is_wired:a.is_wired,name:a.name,hostname:a.hostname,display_name:a.display_name,note:a.note,usergroup_id:a.usergroup_id,fixed_ip:a.fixed_ip,use_fixedip:a.use_fixedip,user_id:a.user_id,network_id:a.network_id,type:a.type,uptime:a.uptime,connected:Object(p.getIsClientConnected)(a),blocked:a.blocked,assoc_time:a.assoc_time};switch(n.type){case p.ClientType.WIRED:a.type===p.ClientType.WIRED&&(n.sw_port=a.sw_port);break;case p.ClientType.WIRELESS:a.type===p.ClientType.WIRELESS&&(n.wifi_experience_score=a.wifi_experience_score,n.signal=a.signal,n.radio=a.radio,n.essid=a.essid,n.fixed_ap_enabled=a.fixed_ap_enabled,n.fixed_ap_mac=a.fixed_ap_mac,n.radio=a.radio,n.radio_proto=a.radio_proto,n.channel=a.channel,n.mimo=a.mimo)}return n})(e,t)),e=>e),A=e=>Object(m.b)()(Object(n.a)(d.e,h(e),S(e),(e,t,a)=>{if(e){if(t&&"mac"in t)return{panel:I.c.DEVICE,activeItemPayload:t};if(a&&"mac"in a)return{panel:I.c.UNIFI_DEVICE_CLIENT,activeItemPayload:a}}return null}),e=>e),N=e=>Object(m.b)()(Object(n.a)(O.d,t=>t.find(t=>t.id===e)),e=>e),j=e=>Object(m.b)()(Object(n.a)(s.selectIspInfoItems,t=>t.find(({networkgroup:t})=>t===e)),e=>e)},571:function(e,t,a){"use strict";var n=a(0),l=a(4),r=a(59),i=a(490);t.a=({client:e,props:t,children:a})=>{const{id:c}=e,o="uptime"in e&&e.uptime||"isUp"in e&&e.isUp;let E=r.a.ACTIVE;e.type===r.c.VPN?E=r.a.VPN:e.type===r.c.TELEPORT?E=r.a.TELEPORT:o||(E="blocked"in e&&e.blocked?r.a.BLOCKED:r.a.OFFLINE);const s=Object(n.useMemo)(()=>Object(i.i)(c,t,E),[c,E]);return a(Object(l.useSelector)(s))}},616:function(e,t,a){"use strict";a.d(t,"c",(function(){return p})),a.d(t,"e",(function(){return I})),a.d(t,"a",(function(){return g})),a.d(t,"d",(function(){return v})),a.d(t,"b",(function(){return C})),a.d(t,"f",(function(){return R}));var n=a(0),l=a.n(n),r=a(865),i=a(3),c=a(1),o=a(47),E=a(132),s=a(500),m=a(234),d=a(6),_=a(5),b=a(90),u=a(1041);const O=Object(i.c)(o.a)`
  padding-left: 10px;
  color: inherit;
  font-size: inherit;
`,p=(e,t,a)=>{const{diagram:n}=Object(d.getDeviceSpecs)(e),i=[Object(d.isUdm)(e),Object(d.isUsAggPro)(e),Object(d.getIsInWallAp)(e)],o=n.length?Object(d.determineRowLayoutsFromDiagramConfig)(n,e):Object(d.determineRowLayoutsFromPortConfig)(e);return o?o.flat().reduce((n,o)=>{var b,p,I,g;if(!o)return n;const v=Object(d.getCurrentPortData)(o.portNumber,e);if(Object(r.a)(v))return n;const C=l.a.createElement(_.a,{alignItems:"center"},l.a.createElement(u.a,Object.assign({cellData:v,deviceData:e,style:{minWidth:20}},a)),l.a.createElement(O,{truncate:!0},v.port_idx)),R=l.a.createElement(_.a,{alignItems:"center"},l.a.createElement(u.a,Object.assign({cellData:v,deviceData:e,style:{minWidth:20}},a)),l.a.createElement(O,{truncate:!0},((e,t)=>{const a=Object(s.a)(t,d.switchAnomaliesMap),n=a.length;return n>1?l.a.createElement(c.b,{id:"COMMON_ERRORS",values:{errorCount:n}}):n?l.a.createElement(c.b,{id:a[0]+"_PROBLEM"}):t.poe_caps&&!Object(d.getIsUsl8Mp)(e)?Object(d.getPortPoeModeText)(t):t.up?Object(E.c)(1e3*(null==t?void 0:t.speed)*1e3/8,"bitrate")||l.a.createElement(c.b,{id:"DEVICE_PORT_STATE_CONNECTED"}):t.enable?l.a.createElement(c.b,{id:"DEVICE_PORT_STATE_DISCONNECTED"}):l.a.createElement(c.b,{id:"DEVICE_PORT_STATE_DISABLED"})})(e,v))),T=Object(m.g)(v.ifname,e,t),h={...v,id:(null===(b=v.port_idx)||void 0===b?void 0:b.toString())||v.ifname,isWanPort:!(null===(p=null==T?void 0:T.id)||void 0===p?void 0:p.startsWith("LAN")),isLanPort:null===(I=null==T?void 0:T.id)||void 0===I?void 0:I.startsWith("LAN"),defaultNetworkGroupLabel:Object(d.getPortGroupLabel)(e,v),networkGroup:null==T?void 0:T.id,portSymbol:C,portStatus:R,disabled:v.masked};return i.every(e=>!e)&&(h.macFilters=null===(g=v.port_security_mac_address)||void 0===g?void 0:g.length),n.push(h),n},[]).sort(({port_idx:e},{port_idx:t})=>e-t):[]},I=(e,t,a)=>p(e,t,a).filter(e=>e.isWanPort),g=(e,t,a)=>p(e,t,a).filter(e=>e.isLanPort),v=(e,t,a)=>{const n=e.findIndex(e=>e.port_idx===t.port_idx),l=-1!==n?e.slice(n+1,n+a):[],r=(null==t?void 0:t.speed_caps)&~d.SPEED_CAPS.PORTSPEED_AUTO_NEG;return l.filter(({speed_caps:e,op_mode:t})=>e&r&&"switch"===t)},C=(e,t)=>t.map(e=>e.port_idx).filter((t,a)=>e+a+1===t),R=e=>{const{isPoeOffSupported:t,isPoePassthroughSupported:a,isPoePassive24Supported:n,isPoeAutoSupported:l}=e,r=[];return t&&r.push(b.d.OFF),a&&r.push(b.d.PASSTHROUGH),!a&&n&&r.push(b.d.PASSIVE_24V),!a&&l&&r.push(b.d.AUTO),r}},626:function(e,t,a){"use strict";a.d(t,"d",(function(){return s})),a.d(t,"c",(function(){return m})),a.d(t,"b",(function(){return d})),a.d(t,"f",(function(){return _})),a.d(t,"g",(function(){return b})),a.d(t,"e",(function(){return u})),a.d(t,"a",(function(){return O}));var n=a(29),l=a(2598),r=a(99);const i=(e,t)=>Object(r.i)(Object(n.startOfMonth)(Object(n.addMonths)(e,1)),t),c=(e,t)=>Object(n.differenceInMinutes)(e,t)/5,o=(e,t)=>Object(n.subMinutes)(e,5*t),E=(e,t)=>new Date(e-1e3*t*60*60*24);function s(e,t,a,l,s=!1){function m(t,n,l,i){const c=Math.ceil(n(t,e))||0,o=c>8,E=c>32?c/32:1;return Array(Math.min(32,c)+1).fill(t).map((e,t)=>{const n=l(e,t*E);return{value:n.getTime(),label:o&&t%2==1?null:Object(r.e)(n,a,i)}}).reverse()}if(Object(n.differenceInYears)(t,e)>1)return m(i(t,a),n.differenceInMonths,n.subMonths,"MMM YYYY");if(Object(n.differenceInMonths)(t,e)>2)return m(i(t,a),n.differenceInMonths,n.subMonths,"MMM");if(Object(n.differenceInDays)(t,e)>10){const e=Date.now(),a=t.getTime()>e,i=Object(r.i)(new Date,"UTC"),c=l>i.getTime()?new Date(l):i;return m(a?c:t,n.differenceInDays,E,"MMM D")}if(Object(n.differenceInDays)(t,e)>2){const e=m(t,n.differenceInDays,n.subDays,"ddd"),i=Date.now(),c=t.getTime()>i,o=Object(r.i)(new Date,a);return c&&l>o.getTime()&&(e[e.length-1]={value:l,label:null}),e}return Object(n.differenceInHours)(t,e)>1?m(t,n.differenceInHours,n.subHours,s?"H:mm":"hA"):m(t,c,o,"h:mma")}function m(e,t){function a(a,l,r,i,c=null){const o=a(t,e)||0,E=o>8;return Array(o+1).fill(e).map((t,a)=>{const o=r(l(e),a);return{value:o.getTime(),label:E&&a%2==1?null:Object(n.format)(o,i),tooltipLabel:Object(n.format)(o,c||i)}})}return Object(n.differenceInYears)(t,e)>1?a(n.differenceInMonths,n.startOfMonth,n.addMonths,"MMM YYYY"):Object(n.differenceInMonths)(t,e)>2?a(n.differenceInMonths,n.startOfMonth,n.addMonths,"MMM"):Object(n.differenceInDays)(t,e)>10?a(n.differenceInDays,n.startOfDay,n.addDays,"MMM D"):Object(n.differenceInDays)(t,e)>2?a(n.differenceInDays,n.startOfDay,n.addDays,"ddd","ddd ha"):Object(n.differenceInHours)(t,e)>1?a(n.differenceInHours,n.startOfHour,n.addHours,"ha","ddd ha"):a(n.differenceInMinutes,n.startOfMinute,n.addMinutes,"h:ma","ddd h:ma")}function d(e,t){return[{label:Object(n.format)(e,t),value:e},{label:Object(n.format)(Object(n.subHours)(e,4),t),value:Object(n.subHours)(e,4).getTime()},{label:Object(n.format)(Object(n.subHours)(e,8),t),value:Object(n.subHours)(e,8).getTime()},{label:Object(n.format)(Object(n.subHours)(e,12),t),value:Object(n.subHours)(e,12).getTime()},{label:Object(n.format)(Object(n.subHours)(e,16),t),value:Object(n.subHours)(e,16).getTime()},{label:Object(n.format)(Object(n.subHours)(e,20),t),value:Object(n.subHours)(e,20).getTime()},{label:Object(n.format)(Object(n.subHours)(e,24),t),value:Object(n.subHours)(e,24).getTime()}].reverse()}const _=(e,t,a,i=!1)=>{const c=i?"H:mm":"h:mm A",o=Object(n.startOfHour)(Object(n.addMinutes)(t,55));return Object(l.a)(25,t=>{const l=Object(n.subHours)(o,t).getTime(),i=0===t?e.formatMessage({id:"COMMON_GRANUALITY_0"}):Object(r.e)(l,a,c);return{label:t%6==0?i:null,value:l}}).reverse()};function b(e,t,a){const n=(l=10,r=t-e,Math.log(r)/Math.log(l)-1);var l,r;const i=n>0?Math.ceil(n):Math.floor(n),c=10**i,o=Math.ceil((t-e)/c)/(a-2)*c,E=Math.abs(i),s=[];let m=Math.round(e/c)*c;for(;m<t+2*o;m+=o)s.push({label:0===m?"0":m.toFixed(E),value:m});return s.reverse()}const u=(e,t)=>{const a=t-1;let n=Math.ceil(e);for(;n%a!=0;)n+=1;return Object(l.a)(t,e=>{const t=e?Math.ceil(e*(n/a)):0;return{value:t,label:String(t)}}).reverse()},O=(e,t)=>{let a=e;return t?a=a.replace(/a/i,""):(a=a.replace(/H/g,"h"),a.search(/a/i)<0&&(a+="A")),a}},665:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return c})),a.d(t,"c",(function(){return o}));var n=a(6),l=a(641),r=a(235);const i={[r.c.ELEMENTS]:{[r.a.GATEWAY]:e=>Object(n.isGateway)(e),[r.a.SWITCH]:e=>Object(n.isSwitch)(e)&&!Object(n.isSmartPower)(e),[r.a.ACCESS_POINT]:e=>Object(n.isAp)(e)&&!Object(n.isSmartPower)(e)&&!Object(n.isUlte)(e),[r.a.SMART_POWER]:e=>Object(n.isSmartPower)(e),[r.a.BUILDING_BRIDGE]:e=>Object(n.isUBB)(e),[r.a.ULTE]:e=>Object(n.isUlte)(e)},[r.c.STATUS]:{[r.b.ONLINE]:e=>{const t=Object(n.getDeviceState)(e);return[n.DeviceState.CONNECTED,n.DeviceState.UPGRADING,n.DeviceState.PROVISIONING,n.DeviceState.ADOPTING,n.DeviceState.DELETING,n.DeviceState.RESTARTING,n.DeviceState.RFSCANNING,n.DeviceState.HEARTBEAT_MISSED].some(e=>e===t)},[r.b.OFFLINE]:e=>{const t=Object(n.getDeviceState)(e);return[n.DeviceState.DISCONNECTED,n.DeviceState.INFORM_ERROR].some(e=>e===t)},[r.b.PENDING_ADOPTION]:e=>{const t=Object(n.getDeviceState)(e);return[n.DeviceState.PENDING,n.DeviceState.ADOPTION_REQUIRED,n.DeviceState.ADOPTION_FAILED,n.DeviceState.FIRMWARE_MISMATCH].some(e=>e===t)},[r.b.MANAGED_BY_ANOTHER_CONSOLE]:e=>Object(n.getDeviceState)(e)===n.DeviceState.MANAGED_BY_OTHER,[r.b.ISOLATED]:e=>Object(n.getDeviceState)(e)===n.DeviceState.ISOLATED}},c=(e,t)=>{const a={};return Object.entries(e).forEach(([e,n])=>{var l;a[e]=null===(l=null==n?void 0:n.some)||void 0===l?void 0:l.call(n,a=>{var n,l,r;return null!==(r=null===(l=null===(n=i[e])||void 0===n?void 0:n[a])||void 0===l?void 0:l.call(n,t))&&void 0!==r&&r})}),Object.values(a)},o=(e,t)=>{const a=Object(l.b)(e);return!Object.values(a).length||!c(a,t).every(Boolean)}},734:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(4),i=a(61),c=a(1),o=a(14),E=a(10),s=a(47),m=a(3),d=a(7),_=a(6),b=a(95),u=a(15),O=a(17),p=a(5),I=a(234),g=a(107),v=a(1644),C=a(1648),R=a(208),T=a(25),h=a(132),D=a(1201),P=a(94),y=a(11);const f=Object(m.c)(p.a,{shouldForwardProp:e=>"omitSpacing"!==e})`
  margin-bottom: 24px;
  ${({omitSpacing:e})=>!e&&"&:nth-of-type(3) {\n    padding-top: 24px;\n  }"}
`,S=Object(m.c)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`;var A=({activeItem:e,port:t,groupOptions:a,speedOptions:n,group:r,omitSpacing:i})=>{const c=!Object(_.isUsg)(e)&&!Object(_.isUxg)(e)&&!Object(P.j)(e),{ifname:o,portIdx:E}=t,{bindWith:s}=Object(I.c)(e,o),m=!!s&&s!==o,{ports:d}=Object(_.getDeviceSpecs)(e),b=Object(_.isUsg)(e)?d[o]:E;return l.a.createElement(f,{justifyContent:"space-between",omitSpacing:i},l.a.createElement(S,null,l.a.createElement(y.Field,{type:"dropdown",variant:"secondary",name:`ports[${E-1}].networkGroup`,label:Object(_.isUGW3)(e)||Object(_.isUGW4)(e)?"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP_SHORT":"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",translateLabel:!0,translateLabelValues:{port:b,networkGroup:r},options:a,readOnly:c,validated:!0,full:!0})),n.length>0&&l.a.createElement(S,null,l.a.createElement(y.Field,{label:"DEVICE_PROPERTIES_GATEWAY_PORTS_SPEED_DUPLEX",name:`ports[${E-1}].speed`,type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:n,disabled:m})))};const N=(e,t,a)=>!t.some(({networkGroup:t})=>t===e)||e===a.networkGroup;var j=Object(c.e)(({activeItem:e,ports:t,intl:a})=>{const{subPanelId:i}=Object(T.m)(),c=Object(r.useSelector)(u.selectNetworkGroups),o=Object(_.isUdmPro)(e)||Object(_.isUdmProSe)(e),E=Object(P.i)(e),s=Object(_.isUGW3)(e),m=Object(_.isUsg)(e),d=t=>{const{supportedValues:a=[]}=Object(I.c)(e,t.ifname);return a.filter(e=>!!D.a.linkNegotiationOptions[e]).map(e=>{const{speed:t=0,full_duplex:a=!1,autoneg:n}=D.a.linkNegotiationOptions[e],{value:l,unit:r}=Object(h.d)(1e6*t/8,"bitrate"),i=`${l}${r}`;return{label:n?"COMMON_DEVICE_AUTONEG_FULL":`COMMON_DEVICE_DUPLEX_${a?"FULL":"HALF"}_STRING`,value:JSON.stringify({speed:t,full_duplex:a}),values:!n&&{speed:i}}})},b=Object(n.useMemo)(()=>i!==g.b.WAN||E?c.filter(({id:e})=>e.startsWith("LAN")):[],[i,E,c]),O=e=>[...[...c.filter(({id:e})=>e.startsWith("WAN")&&e!==u.NetworkHiddenId.WAN_LTE_FAILOVER),...b].filter(({id:a})=>E&&!m&&!!a.startsWith("LAN")||N(a,t,e)).map(({id:e})=>({value:e,label:e})),{value:_.DISABLED_PORT,label:a.formatMessage({id:"COMMON_DISABLED"})}],p=t.filter(({isWanPort:e,media:t})=>i!==g.b.WAN&&E?!_.SFP_MEDIA_TYPES.includes(t):e).sort((e,t)=>e.portIdx-t.portIdx),v=t.filter(({media:e})=>!(i===g.b.WAN&&!o||!E)&&_.SFP_MEDIA_TYPES.includes(e)),C=t.filter(e=>[8,9,10,11].includes(e.portIdx)),R=a.formatMessage({id:"COMMON_DISABLED"});return o&&E?l.a.createElement(l.a.Fragment,null,C.map(t=>l.a.createElement(A,{activeItem:e,port:t,groupOptions:O(t),speedOptions:d(t),group:t.media||t.defaultNetworkGroupLabel,key:t.portIdx,omitSpacing:!0}))):l.a.createElement(l.a.Fragment,null,p.map(t=>l.a.createElement(A,{activeItem:e,port:t,groupOptions:O(t),speedOptions:d(t),group:t.defaultNetworkGroupLabel||R,key:t.portIdx,omitSpacing:!s})),v.map(t=>l.a.createElement(A,{activeItem:e,port:t,groupOptions:O(t),speedOptions:d(t),group:t.media||t.defaultNetworkGroupLabel,key:t.portIdx,omitSpacing:!s})))});const L=Object(m.c)(p.a)`
  position: relative;
  margin: -18px -30px 40px;
  padding: 12px 0;
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.ui04};

  svg {
    position: absolute;
    left: 24px;
  }
`,x=Object(m.c)(R.a,{shouldForwardProp:e=>!["isFullPage"].includes(e)})`
  ${({isFullPage:e})=>e&&"\n    width: 100%;\n    justify-content: flex-end;  \n    gap:10px;\n  "};
`,M=Object(m.c)(v.a)`
  & > div > span {
    flex: 1;
  }
`,V=Object(m.c)(s.a)`
  width: 100%;
  text-align: center;
`,w=Object(m.c)(p.a)`
  width: 100%;
  padding: 16px 30px;
`,F=Object(m.c)(p.a)`
  margin-bottom: 24px;
`,U=Object(m.c)(E.b)`
  margin-right: 8px;
  color: ${({theme:e})=>e.motifPalette.warning};
`;var z=a(616);const k=Object(m.c)(p.a)`
  margin-bottom: 24px;
`,B=Object(m.c)(E.b)`
  margin-right: 8px;
  color: ${({theme:e})=>e.motifPalette.danger};
`,W=Object(o.f)({mapPropsToValues:e=>{const{networkGroups:t,activeItem:a}=e,n=Object(z.c)(a,t);return{ports:n.sort((e,t)=>e.portIdx-t.portIdx).map((e,t)=>{const{supportedValues:l=[],bindWith:r}=Object(I.c)(a,e.ifname),i=!e.autoneg&&e.speed&&e.full_duplex?{speed:e.speed,full_duplex:e.full_duplex}:{speed:0,full_duplex:!1};if(r){const e=n.find(e=>e.ifname===r);i.speed=e.speed,i.full_duplex=e.full_duplex}const c=JSON.stringify(i);return{...e,networkGroup:e.networkGroup||_.DISABLED_PORT,...l.length?{speed:c}:{},itemIndex:t}})}},validationSchema:({intl:e,activeItem:t,params:a})=>{const n=(null==a?void 0:a.subPanelId)===g.b.ALL;return d.a.object().shape({ports:d.a.array().of(d.a.object().shape({networkGroup:d.a.string().label(e.formatMessage({id:"COMMON_WORD_INTERFACE"})).oneOf([b.a.WAN,b.a.WAN2,_.DISABLED_PORT,...Object(I.a)(t)]).required()})).test("has-default-network-groups",l.a.createElement(k,null,l.a.createElement(B,{width:19,height:19}),l.a.createElement(s.a,null,l.a.createElement(c.b,{id:n?"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_OR_LAN_WARNING":"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_WARNING"}))),e=>e.some(e=>e.networkGroup===b.a.WAN)&&(!n||e.some(e=>e.networkGroup===u.NetworkHiddenId.LAN)))})},handleSubmit:({ports:e},{props:{networkGroups:t,updateDeviceWithIdEndpoint:a,activeItem:{_id:n,port_overrides:l=[],ethernet_table:r,mac:i},activeItem:c,history:o,intl:E}})=>{const s=Object(z.c)(c,t),m=E.formatMessage({id:"DEVICE_PROPERTY_HEADER_PORTS"}),d=[...e.map(e=>{const{speed:t,full_duplex:a}=JSON.parse(e.speed),{speed:n,full_duplex:r,...i}=(null==l?void 0:l.find(t=>t.port_idx===e.portIdx))||{};return{...i,...t?{speed:t,full_duplex:a}:{},port_idx:e.portIdx,autoneg:!t}}),...null==l?void 0:l.filter(t=>!e.some(e=>e.portIdx===t.port_idx))],b=[];s.forEach(t=>{const a=e.find(e=>e.ifname===t.ifname);if(a){if(a.networkGroup===_.DISABLED_PORT)return;b.push({ifname:a.ifname,networkgroup:a.networkGroup})}else b.push({ifname:t.ifname,networkgroup:t.networkGroup})}),a({port_overrides:d,ethernet_overrides:b},n,i,{successToast:{icon:O.a.success,message:"DEVICE_PORT_FORM_SAVE_SUCCESS"},failureToast:{icon:O.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:m}},mergeAndOverrideKeys:["port_overrides","ethernet_overrides"],extend:!0}).then(()=>{o.goBack()})}}),G={updateDeviceWithIdEndpoint:_.updateDeviceWithIdEndpoint};t.a=Object(i.compose)(Object(r.connect)(e=>({networkGroups:Object(u.selectNetworkGroups)(e)}),G),c.e,W)((function({activeItem:e,history:t,submitForm:a,resetForm:i,values:o,dirty:m,setFieldValue:d,errors:b,isFullPage:O}){const p=Object(r.useSelector)(u.selectNetworkGroups),{networkGroups:I}=Object(_.getDeviceSpecs)(e),g=()=>{i(),t.goBack()},v=Object(n.useMemo)(()=>o.ports.some(e=>JSON.parse(e.speed||"{}").speed),[o.ports]);return l.a.createElement(l.a.Fragment,null,l.a.createElement(w,{flexDirection:"column",flex:"1 1 85%"},O?l.a.createElement(C.a,{padding:"none"},l.a.createElement(M,{title:l.a.createElement(c.b,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"}),hideUnderline:!0})):l.a.createElement(L,{alignItems:"center"},l.a.createElement(E.f,{onClick:g,style:{cursor:"pointer"}}),l.a.createElement(V,{size:"body",weight:"bold"},l.a.createElement(c.b,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"}))),l.a.createElement(j,{activeItem:e,ports:o.ports}),l.a.isValidElement(b.ports)&&b.ports,v&&l.a.createElement(F,null,l.a.createElement(U,{width:19,height:19}),l.a.createElement(s.a,{size:"body"},l.a.createElement(c.b,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_SPEED_WARNING"})))),l.a.createElement(x,{isDirty:m,onFormSubmit:a,onFormCancel:g,onFormReset:()=>{d("ports",o.ports.map(e=>{const t=p.find(t=>t.id===I[e.ifname]);return{...e,networkGroup:(null==t?void 0:t.id)||_.DISABLED_PORT,autoneg:!0,speed:JSON.stringify({speed:0,full_duplex:!1})}}))},submitButtonText:O?null:"COMMON_ACTION_APPLY",allowCancel:!0,isFullPage:!!O}))}))},736:function(e,t,a){"use strict";var n=a(1654);a.d(t,"fetchSession",(function(){return n.a}));var l=a(1172);a.d(t,"MODEL",(function(){return l.b}));var r=a(1169);a.d(t,"selectFormattedSessionData",(function(){return r.a}));a(2614)},755:function(e,t,a){"use strict";a.d(t,"c",(function(){return n})),a.d(t,"e",(function(){return l})),a.d(t,"d",(function(){return r})),a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return c})),a.d(t,"f",(function(){return o}));const n="stadpi",l="stadpi",r="/api/s/{site}/stat/stadpi",i="by_app",c=8,o=65535},854:function(e,t,a){"use strict";a.d(t,"c",(function(){return n})),a.d(t,"d",(function(){return l})),a.d(t,"e",(function(){return r})),a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return c})),a.d(t,"f",(function(){return o}));const n="unifiCare",l="/v2/api/unifi-care/details",r="unifiCare",i="/v2/api/unifi-care/device/{mac}/dismiss-activation-notice",c="put",o={DISMISS_UNIFI_CARE_ACTIVATION_SUCCESS:"ace/DISMISS_UNIFI_CARE_ACTIVATION_SUCCESS",DISMISS_UNIFI_CARE_ACTIVATION_ERROR:"ace/DISMISS_UNIFI_CARE_ACTIVATION_ERROR"};var E;!function(e){e.ASSIGNED="ASSIGNED",e.AVAILABLE="AVAILABLE",e.NOT_AVAILABLE="NOT_AVAILABLE",e.RMA_IN_PROGRESS="RMA_IN_PROGRESS",e.REPLACING="REPLACING",e.REVOKED="REVOKED"}(E||(E={}))},866:function(e,t,a){"use strict";a.d(t,"d",(function(){return h})),a.d(t,"n",(function(){return D})),a.d(t,"l",(function(){return P})),a.d(t,"i",(function(){return y})),a.d(t,"k",(function(){return S})),a.d(t,"e",(function(){return A})),a.d(t,"j",(function(){return j})),a.d(t,"f",(function(){return L})),a.d(t,"g",(function(){return x})),a.d(t,"a",(function(){return M})),a.d(t,"m",(function(){return V})),a.d(t,"c",(function(){return w})),a.d(t,"b",(function(){return F})),a.d(t,"o",(function(){return U})),a.d(t,"h",(function(){return z}));var n=a(29),l=a(9),r=a(1651),i=a(288),c=a(169),o=a(947),E=a(8),s=a(168),m=a(41),d=a(69),_=a(356),b=a(89),u=a(20),O=a(285),p=a(194),I=a(123),g=a(54),v=a(16),C=a(1675),R=a(1677),T=a(1672);const h=Object(l.a)(e=>e.threat,e=>({startDate:e.startDate,endDate:e.endDate,preset:e.preset})),D=Object(l.a)(i.b,e=>[e["24_HOURS"],e["1W"]]),P=(Object(l.a)(h,D,(e,t)=>{const{startDate:a,endDate:l}=e;return t.map(e=>{const t=e.getRange(new Date);return{...e,range:t,selected:Object(n.isEqual)(a,t.startDate)&&Object(n.isEqual)(l,t.endDate)}})}),Object(O.b)(p.a.THREAT_MANAGEMENT,I.a.THREAT_MANAGEMENT_EVENT_TIMELINE,T.d,!0)),y=e=>{var t;return(null===(t=null==e?void 0:e.threat)||void 0===t?void 0:t.eventTimelinePageNumber)||1},f=Object(l.a)(s.j,h,(e,t)=>{const a=new Date(t.startDate).getTime(),n=new Date(t.endDate).getTime();return e.filter(({time:e})=>!(e<a||e>n))}),S=Object(l.a)(f,P,v.selectIpsSettings,(e,t,a)=>a.ips_mode!==v.IpsMode.DISABLED&&t.threats?e.filter(({time:e,flow:a,dst_mac:n,src_mac:l,inner_alert_severity:r})=>{var i,c;if(!t.severity[r])return!1;const o=(null!==(i=null==a?void 0:a.bytes_toclient)&&void 0!==i?i:0)+(null!==(c=null==a?void 0:a.bytes_toserver)&&void 0!==c?c:0);return!(t.transferSizeEnabled&&t.transferSizeMin>T.d.transferSizeMin&&(t.transferSizeMin>o||t.transferSizeMax<o))&&!(t.client&&![n,l].includes(t.client))}):[]),A=Object(l.a)(s.i,h,P,(e,t,a)=>{if(a.client||!a.threats)return[];const n=Math.round(new Date(t.startDate).getTime()/1e3),l=Math.round(new Date(t.endDate).getTime()/1e3);return e.filter(({timestamp:e})=>!(e<n||e>l))}),N=(Object(g.b)()(Object(l.a)(f,v.selectIpsSettings,(e,t)=>t.ips_mode===v.IpsMode.DISABLED?[]:e),e=>e),Object(n.subDays)(Object(n.startOfDay)(new Date),7).getTime()/1e3),j=Object(g.b)()(Object(l.a)(b.selectCombinedClientsData,e=>{const t={};return e.filter(e=>e.type!==b.ClientType.VPN&&e.type!==b.ClientType.TELEPORT&&!e.unifi_device&&e.last_seen>N).forEach(e=>{t[e.mac]={mac:e.mac,name:Object(b.getClientName)(e),fingerprint:null==e?void 0:e.fingerprint,ip:(null==e?void 0:e.ip)||(null==e?void 0:e.fixed_ip)||"-",oui:null==e?void 0:e.oui,type:null==e?void 0:e.type}}),Object.values(t)}),e=>e),L=Object(l.a)(P,j,(e,t)=>{var a;return(null==e?void 0:e.client)&&(null===(a=t.find(({mac:t})=>e.client===t))||void 0===a?void 0:a.type)===b.ClientType.WIRELESS||!1}),x=(Object(l.a)(f,e=>{const t=Object(C.a)(Object(r.a)(e,"src_mac")).sort((e,t)=>t.count-e.count),a=t.findIndex(e=>!e.mac);if(a>=0&&a<4){const[e]=t.splice(a,1);t.push(e)}const n=t.length>4?4:t.length-Number(a>=0);return{top:t.slice(0,n).map((e,t)=>Object.assign(e,{color:Object(_.getColorFromScheme)(Object(_.getIndexColorScheme)(t),5)})),others:t.slice(n).reduce((e,t)=>{var a,n;return{mac:"",count:e.count+(null!==(a=null==t?void 0:t.count)&&void 0!==a?a:0),activity:e.activity+(null!==(n=null==t?void 0:t.activity)&&void 0!==n?n:0),color:e.color}},{mac:"",count:0,activity:0,color:Object(_.getColorFromScheme)(Object(_.getIndexColorScheme)(0),9)}),total:e.length}}),Object(l.a)(f,e=>{const t=Object(C.b)(Object(r.a)(e,({http:e})=>null==e?void 0:e.hostname)).sort((e,t)=>t.count-e.count),a=t.findIndex(e=>"Unknown"===e.domain);if(a>=0&&a<4){const[e]=t.splice(a,1);t.push(e)}const n=t.length>4?4:t.length-Number(a>=0);return t.slice(0,n||4)}),Object(l.a)(u.q,e=>e?R.c.STYLE_URL_DARK:R.c.STYLE_URL)),M=()=>(e,t)=>{const a=t(),n=P(a),{preset:l}=h(a),r=l===c.a["24_HOURS"]?o.c.DAY:o.c.WEEK;return n.client?e(Object(o.d)({queryParams:{period:r,clientMac:n.client}},{crudCacheStrategy:{type:E.a.CACHE}})):e(Object(o.e)({queryParams:{period:r}},{crudCacheStrategy:{type:E.a.CACHE}}))},V=e=>Object(g.b)()(Object(l.a)(t=>{var a,l,r,i,c,E;const s=P(t),m=null==s?void 0:s.client,d=Number(e);if(m){const e=`${Object(n.subHours)(new Date,24).getTime()<d?o.c.DAY:o.c.WEEK}_${m}`,c=(null===(i=null===(r=null===(l=null===(a=t.models[o.a])||void 0===a?void 0:a.byId)||void 0===l?void 0:l[e])||void 0===r?void 0:r.record)||void 0===i?void 0:i.data)||{};return Object.values(c).find(e=>Number(null==e?void 0:e.start_timestamp)===d)}const _=(null===(c=t.models[o.b])||void 0===c?void 0:c.byId)||{};return null===(E=Object.values(_).find(e=>{var t;return Number(null===(t=null==e?void 0:e.record)||void 0===t?void 0:t.start_timestamp)===d}))||void 0===E?void 0:E.record},e=>e),e=>e),w=(Object(l.a)(s.k,h,s.j,(e,{startDate:t,endDate:a},l)=>{let r=Object(E.v)(Object(s.f)(t,a),e).data;Object(n.isAfter)(a,Date.now())&&(r=r.concat(l));return r.map(e=>{const{catname:t,dstipCountry:a,dstipGeo:n,src_ip:l,inner_alert_severity:r}=e;return{...e,category:t,countryCode:a,countryName:n&&(null==n?void 0:n.country_name)||"Unknown",ip:l,severity:s.l[r]}}).sort((e,t)=>e.time-t.time)}),Object(l.a)(f,m.selectFirewallRulesData,(e,t)=>{const a=[];return e.forEach(e=>{const{src_ip:n,dest_ip:l}=e;if(Object(d.f)(n)&&Object(d.f)(l)){t.some(e=>{const{src_address:t,dst_address:a}=e;return t===n&&a===l||t===l&&a===n})&&a.push(e)}else{t.some(e=>{const{src_address_ipv6:t,dst_address_ipv6:a}=e;return t===n&&a===l||t===l&&a===n})&&a.push(e)}}),a})),F=Object(l.a)(f,m.selectFirewallRulesData,(e,t)=>{const a=[];return e.forEach(e=>{const{src_ip:n,dest_ip:l}=e;if(Object(d.f)(n)&&Object(d.f)(l)){t.some(e=>{const{src_address:t,dst_address:a}=e;return t===n&&!a||a===n&&!t})&&a.push(e)}else{t.some(e=>{const{src_address_ipv6:t,dst_address_ipv6:a}=e;return t===n&&a===l||t===l&&a===n})&&a.push(e)}}),a}),U=Object(l.a)(f,v.selectIpsSettings,(e,t)=>{const a=[],{suppression:{whitelist:n}}=t;return e.forEach(e=>{const{src_ip:t}=e;n.some(({value:e,mode:a})=>e===t&&"ip"===a)&&a.push(e)}),a}),z=Object(l.a)(f,v.selectIpsSettings,(e,t)=>{const a=[],{suppression:{alerts:n}}=t;return e.forEach(e=>{const{src_ip:t}=e;n.some(({tracking:e})=>e.some(({value:e,mode:a})=>e===t&&"ip"===a))&&a.push(e)}),a})},908:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n={large:{threshold:12,size:"20px",spacing:"8px",tooltipOffset:"15px"},medium:{threshold:15,size:"16px",spacing:"6px",tooltipOffset:"17px"},small:{threshold:20,size:"12px",spacing:"4px",tooltipOffset:"19px"},xsmall:{threshold:28,size:"10px",spacing:"2px",tooltipOffset:"20px"}}},947:function(e,t,a){"use strict";a.d(t,"e",(function(){return o})),a.d(t,"d",(function(){return E})),a.d(t,"b",(function(){return r})),a.d(t,"a",(function(){return i})),a.d(t,"h",(function(){return _})),a.d(t,"i",(function(){return u})),a.d(t,"g",(function(){return O})),a.d(t,"f",(function(){return p})),a.d(t,"c",(function(){return c}));var n=a(8);const l="trafficStats",r="trafficStatsDpi",i="clientTrafficStatsDpi";var c;!function(e){e.DAY="DAY",e.WEEK="WEEK"}(c||(c={}));const o=(e={queryParams:{period:c.DAY}},t)=>Object(n.q)([{model:l,payload:e=>e},{model:r,payload:e=>e.flatMap(({traffic_breakdown:e})=>e)}],"/v2/api/site/{site}/latest-traffic",e,{idField:({start_timestamp:e,end_timestamp:t,usage_by_app:a})=>a?e:`${e}_${t}`,...t}),E=(e,t)=>Object(n.q)([{model:"clientTrafficStats",payload:t=>[{data:t.reduce((e,t)=>(e[`${t.start_timestamp}_${t.end_timestamp}`]=t,e),{})||{},mac:e.queryParams.clientMac}]},{model:i,payload:t=>[{data:t.flatMap(({traffic_breakdown:e})=>e).reduce((e,t)=>(e[""+t.start_timestamp]=t,e),{}),mac:e.queryParams.clientMac}]}],"/v2/api/site/{site}/latest-client-traffic",e,{idField:({mac:t})=>`${e.queryParams.period}_${t}`,...t});var s=a(9),m=a(27),d=a(54);const _=(e=c.DAY)=>Object(s.a)(((e=c.DAY)=>Object(d.b)((e,t)=>(null==e?void 0:e.lastFetchTime)===(null==t?void 0:t.lastFetchTime))(({models:t})=>Object(n.w)(l,t,{queryParams:{period:e}}),e=>e))(e),m.c),b=({models:e})=>Object(n.w)(l,e,{queryParams:{period:c.WEEK}}),u=e=>Object(s.a)(b,t=>Object(m.c)(t).filter(t=>t.start_timestamp===e)),O=(e,t=c.DAY)=>Object(s.a)(((e,t=c.DAY)=>({models:a})=>Object(n.w)("clientTrafficStats",a,{queryParams:{period:t,clientMac:e}},{idField:({mac:e})=>`${t}_${e}`}))(e,t),e=>{var t,a,n;return Object.values(null!==(n=null===(a=null===(t=Object(m.c)(e))||void 0===t?void 0:t[0])||void 0===a?void 0:a.data)&&void 0!==n?n:[])}),p=(e,t)=>Object(s.a)((e=>({models:t})=>Object(n.w)("clientTrafficStats",t,{queryParams:{period:c.WEEK,clientMac:e}},{idField:({mac:e})=>`${c.WEEK}_${e}`}))(e),e=>{var a,n,l;return Object.values(null!==(l=null===(n=null===(a=Object(m.c)(e))||void 0===a?void 0:a[0])||void 0===n?void 0:n.data)&&void 0!==l?l:[]).filter(e=>e.start_timestamp===t)})}}]);