"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[88208],{537417(e,t,a){a.d(t,{A:()=>n});var i=a(938984);const n=(0,a(247816).A)(i.A)`
  white-space: nowrap;
`},787481(e,t,a){a.d(t,{A:()=>d});var i=a(274934),n=a(833466),s=a(309130),l=a(100978);const d=e=>(0,i.jsx)(l.A,{paddingTop:s.YC,paddingBottom:s.YC,gap:s.Ln,rowGap:s.YC,flexWrap:"wrap",minHeight:n.b,alignItems:"center",...e})},88208(e,t,a){a.r(t),a.d(t,{default:()=>Z});var i=a(274934),n=a(602086),s=a(977872),l=a(956976),d=a(937843),r=a(762705),o=a(938984),c=a(409844),u=a(347625),_=a(159469),A=a(630849),E=a(586566),m=a(309130),O=a(721398),p=a(159911),h=a(451336),C=a(420610),x=a(787481),N=a(100978),v=a(541819),g=a(869332),D=a(470070),I=a(561614),b=a(291935),f=a(956978),T=a(857780),j=a(754924),k=a(795206),L=a(479964),M=a(793442),S=a(974390),R=a(726831),w=a(860606),y=a(42041),H=a(464693);const G=({searchText:e,setSearchText:t})=>{const a=(0,n.useCallback)((e,a)=>{t((0,y.Zx)(a.toLowerCase()))},[t]),s=(0,n.useCallback)(()=>{t("")},[t]);return(0,i.jsx)(w.A,{iconBefore:(0,i.jsx)(H.A,{size:"small"}),full:!0,onChange:a,onClear:s,value:e,variant:"secondary",placeholder:(0,D.tz)().formatMessage({id:"COMMON_SEARCH"}),keepRefOnClear:!0})};var V=a(814557),B=a(832162),F=a(247816),U=a(291508);const P=(0,F.A)(B.A,(0,U.A)("haveOptions"))`
  width: 460px;
  ${({haveOptions:e})=>e?"min-height: 200px;":""}
`,W=(0,F.A)("div")`
  padding: ${m.kc} ${m.kc} 0 ${m.kc};
  border-radius: ${V.Ay["desktop-radius-base"]};
  border: 1px solid
    ${({theme:{themeName:e}})=>V.Ay[`desktop-color-neutral-03-${e}`]};
`,$=c.AH`
  padding-left: 0;
`,z=c.AH`
  overflow-y: auto;
  height: 100%;
  min-height: 150px;
  max-height: 275px;
  padding: ${m.kc} 0 0 0;
`,Z=(0,n.memo)(({activeMacs:e})=>{const[t,a]=(0,n.useState)(e),c=(0,s.wA)(),w=(0,A.I)(),y=(0,s.d4)(b.ZZ),H=y===L.A.US.numericCode,V=y===L.A.CA.numericCode,B=(0,s.d4)((0,j.nH)(t)).filter(e=>(0,f.ioy)(e)&&(0,E.X5)(e,y)),F=B.filter(e=>(0,f.KKO)(e.model,"outdoorModeSupport")),U=1===B.length||1===F.length,Z=F?.[0],K=U&&Z&&(0,f.KKO)(Z?.model,"outdoorModeSupport"),Y=U&&B?.[0]&&(0,f.J2F)(B[0]),X=U&&Z&&!((0,f.ERA)(Z)||(0,f.Ume)(Z)),[J,q]=(0,n.useState)(""),[Q,ee]=(0,n.useState)(1===B.length?t:[]),[te,ae]=(0,n.useState)(!1),[ie,ne]=(0,n.useState)(!1),[se,le]=(0,n.useState)(!1),[de,re]=(0,n.useState)(K?T.Dd.OUTDOOR:T.Dd.INDOOR),oe=(e=>e.filter(({mac:e})=>Boolean(e)).map(({model:e,mac:t})=>({label:(0,u.Lm)(e),value:t,image:(0,i.jsx)(N.A,{maxWidth:20,maxHeight:20,children:(0,i.jsx)(S.A,{model:e,width:20,height:20})}),additionalInfo:t})))(F.length?F:B),ce=(0,n.useMemo)(()=>((e,t)=>e.filter(e=>"string"==typeof e.value&&e?.value&&e.value.toLowerCase()?.includes(t)||e.label.toLowerCase()?.includes(t)))(oe,J),[oe,J]);(0,n.useEffect)(()=>{re(K?T.Dd.OUTDOOR:T.Dd.INDOOR)},[K]);const ue=(0,n.useCallback)(()=>{c((0,g.AS)())},[c]),_e=(0,n.useCallback)(()=>{const e=ce.map(({value:e})=>e);if(te){const t=[...Q];ee(t.filter(t=>!e.includes(t)))}else ee([...new Set([...Q,...e])])},[te,ce,Q]),Ae=(0,n.useCallback)((e,{value:t})=>{const a=Q.includes(t);ee(a?Q.filter(e=>e!==t):[...Q,t])},[Q]),Ee=(0,n.useCallback)(()=>{ne(!0);const e=[];B.forEach(t=>{if(!Q.includes(t.mac))return;const a=(0,f.KKO)(t?.model,"outdoorModeSupport"),i=(0,E.X5)(t,y)?{afc_enabled:!0}:{},n=!a||de!==T.Dd.OUTDOOR&&U?{outdoor_mode_override:T.Gi.OFF}:{outdoor_mode_override:T.Gi.ON},s={radio_table:[]};t?.radio_table.forEach(e=>{const t={radio:e.radio,name:e.name};s.radio_table.push(e.radio===I.sx.RADIO_6E&&e?.tx_power_mode===I.PB.DISABLED?{...t,tx_power_mode:I.PB.AUTO}:t)}),e.push(c((0,k.ex)({...i,...n,...s},t._id,t.mac,{failureToast:{icon:_.C.danger,message:"COMMON_AFC_ENABLING_ERROR_TOAST"},mergeAndOverrideKeys:["radio_table"],extend:!0})))}),Promise.all(e).catch(w).finally(()=>{ne(!1),ue()})},[Q,w,B,y,de,c,ue,U]),me=(0,n.useMemo)(()=>{const e=[];e.push(U?{type:"button",variant:"link",target:"_blank",text:(0,i.jsx)(D.sA,{id:"COMMON_LEARN_MORE"}),href:R.A.afcArticle,className:$}:{type:"button",variant:"link",text:(0,i.jsxs)(r.A,{checked:te,id:"isSelectAllChecked",onChange:()=>ae(!te),children:[(0,i.jsx)(D.sA,{id:"COMMON_ACTION_SELECT_ALL"}),` (${ce.length})`]}),onClick:_e,className:$});const t=[[{type:"button",text:(0,i.jsx)(D.sA,{id:"COMMON_ACTION_CANCEL"}),autoFocus:!1,onClick:ue},{type:"button",variant:"primary",text:(0,i.jsx)(D.sA,{id:"COMMON_ACTION_SAVE"}),autoFocus:!0,onClick:Ee,disabled:0===Q.length||!se,loader:ie?"loading":void 0}]];return[...e,...t]},[U,ue,Ee,Q.length,se,ie,te,ce.length,_e]),Oe=(0,n.useMemo)(()=>H?"DEVICE_ENABLE_AFC_MODAL_HEADER_US":V?"DEVICE_ENABLE_AFC_MODAL_HEADER_CA":"DEVICE_EXTEND_6GHZ_RANGE",[H,V]),pe=(0,n.useMemo)(()=>{return e=Q,ce.every(t=>e.includes(t.value));var e},[ce,Q]);return(0,n.useEffect)(()=>{te!==pe&&ae(pe)},[pe,te]),(0,n.useEffect)(()=>{1===B.length&&0===Q.length&&ee(t)},[t,B.length,Q.length]),(0,n.useEffect)(()=>{if(1===e.length&&!t.includes(e[0])){const i=[...new Set([...t,...e])];a(i),ee(i)}},[e,t]),(0,i.jsx)(P,{title:(0,i.jsx)(D.sA,{id:!K&&U?Oe:"DEVICE_ENABLE_6GHZ"}),isOpen:B.length>0,shouldCloseOnOverlayClick:!1,onRequestClose:ue,actions:me,haveOptions:!!oe.length,children:(0,i.jsxs)(N.A,{flexDirection:"column",gap:m.kc,children:[U?(0,i.jsxs)(N.A,{flexDirection:"column",alignItems:"center",children:[(0,i.jsx)(S.A,{model:B[0].model,width:120,height:120,size:v.Xh.LARGE}),(0,i.jsxs)(N.A,{alignItems:"center",gap:m.YC,children:[(0,i.jsx)(o.A,{size:"medium",variant:"body-primary",weight:"bold",children:(0,u.Q)(B[0])}),(0,i.jsx)(o.A,{size:"medium",variant:"body-primary",children:(0,u.oT)(B[0])})]}),B[0]?.uplink?.uplink_device_name?(0,i.jsx)(N.A,{alignItems:"center",children:(0,i.jsx)(h.A,{activeItem:B[0],connectionStatus:(0,p.H)(B[0].deviceState,B[0].uplink.type)})}):null]}):null,U&&K&&X?(0,i.jsx)(x.A,{children:[T.Dd.INDOOR,T.Dd.OUTDOOR].map(e=>(0,i.jsx)(l.A,{id:e,value:e,checked:de===e,onChange:()=>re(e),children:(0,i.jsxs)(N.A,{alignItems:"center",gap:m.YC,children:[(0,i.jsx)(D.sA,{id:C.J[e]}),e===T.Dd.OUTDOOR?(0,i.jsx)(O.A,{messageId:Y?"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_6GHZ_TOOLTIP":"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_TOOLTIP",values:{link:(0,i.jsx)(M.A,{id:"COMMON_LEARN_MORE",href:R.A.afcArticle})},variant:"outline",isInteractive:!0,portal:!0}):null]})},e))}):null,U?null:(0,i.jsxs)(W,{children:[(0,i.jsx)(G,{searchText:J,setSearchText:q}),(0,i.jsx)(d.A,{options:ce,handleOptionChange:Ae,isChecked:e=>Q.includes(e.value),isDisabled:()=>!1,within:"popover",createOptionText:()=>null,handleCreateOption:()=>null,searchValue:J,showCreateOption:!1,isWindowed:!0,className:z})]}),(0,i.jsx)(N.A,{flexDirection:"column",children:(0,i.jsx)(r.A,{id:"tos_agreement",checked:se,onChange:()=>le(!se),children:(0,i.jsxs)(o.A,{size:"medium",variant:"body-primary",children:[(0,i.jsx)(D.sA,{id:K?"DEVICE_ENABLE_6GHZ":V?"DEVICE_ENABLE_AFC_MODAL_HEADER_CA":"DEVICE_EXTEND_6GHZ_RANGE",values:{link:(0,i.jsx)(M.A,{noWrap:!0,id:"COMMON_TOS",href:R.A.termsOfServiceUrl})}}),(0,i.jsx)("br",{}),(0,i.jsx)(D.sA,{id:K?"DEVICE_ENABLE_6GHZ_TOS_AGREE":V?"DEVICE_INCREASE_SPECTRUM_INDOOR_TOS_AGREE":"DEVICE_ENABLE_EXTEND_6GHZ_RANGE_TOS_AGREE",values:{link:(0,i.jsx)(M.A,{noWrap:!0,id:"COMMON_TOS",href:R.A.termsOfServiceUrl})}})]})})})]})})})},420610(e,t,a){a.d(t,{J:()=>n});var i=a(857780);const n={[i.Dd.INDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_INDOOR",[i.Dd.OUTDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR"}},698950(e,t,a){a.d(t,{A:()=>E});var i=a(274934),n=a(247816),s=a(409844),l=a(291508),d=a(470070),r=a(309130),o=a(100978),c=a(537417);const u=(0,n.A)(o.A,(0,l.A)("alignLeft"))`
  ${({alignLeft:e})=>e?"max-width: 288px;":"max-width: 100%; justify-content: center;"}
  gap: ${r.YC};
  align-items: center;
`,_=s.AH`
  max-width: 50%;
`,A=s.AH`
  flex: 0 1 auto;
  min-width: 0;
`,E=({messageId:e,messageValues:t,buttonEl:a,alignLeft:n=!0,color:s="text-3",variant:l="body-primary"})=>(0,i.jsxs)(u,{alignLeft:n,children:[(0,i.jsx)(c.A,{variant:l,color:s,children:t?(0,i.jsx)(o.A,{maxWidth:288,whiteSpace:"nowrap",paddingRight:r.YC,children:(0,i.jsx)(d.sA,{id:e,values:t})}):(0,i.jsx)(d.sA,{id:e})}),a?(0,i.jsx)(o.A,{className:n?A:_,children:a}):null]})},488287(e,t,a){a.d(t,{A:()=>C});var i=a(274934),n=a(977872),s=a(602086),l=a(938984),d=a(590979),r=a(898809),o=a(309130),c=a(100978),u=a(449339),_=a(785068),A=a(205521),E=a(470070),m=a(754924),O=a(119425),p=a(698950),h=a(208583);const C=({last_uplink_mac:e,last_uplink_name:t,last_uplink_remote_port:a,disconnected_at:C,disabled:x,separatePortNumber:N,maxWidth:v})=>{const{formatMessage:g}=(0,E.tz)(),D=(0,n.wA)(),I=(0,n.d4)(m.CC),b=(0,h.Z)(e,I),f=(0,h.z)(t,a,b,g,N),T=(0,s.useCallback)(()=>{x||D((0,A.XP)({type:u.H.DEVICE,id:e}))},[x,D,e]);return(0,i.jsxs)(i.Fragment,{children:[b?(0,i.jsx)(p.A,{messageId:"COMMON_DEVICE_LAST_CONNECTED_TO",messageValues:{deviceWithPort:(0,i.jsx)(c.A,{width:"100%",overflow:"hidden",paddingLeft:o.YC,children:(0,i.jsx)(_.A,{onClick:T,disabled:x,...d.A.addDataTestId(d.A.TestId.SIDE_PANEL_TRIGGER),name:f,port:a,separatePortNumber:N,maxWidth:v})})}}):null,C?(0,i.jsx)("div",{children:(0,i.jsx)(l.A,{color:"text-3",children:(0,i.jsx)(O.A,{date:(0,r.gH)(C)})})}):null]})}},208583(e,t,a){a.d(t,{Z:()=>n,z:()=>s});var i=a(347625);const n=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,s=(e,t,a,n,s)=>{const l=!s&&t?` ${n({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${l}`:a?`${(0,i.Q)(a)}${l}`:n({id:"COMMON_FALLBACK"})}},783706(e,t,a){a.d(t,{A:()=>r});var i=a(274934),n=a(205240),s=a(956978),l=a(698950),d=a(949283);const r=({type:e,name:t,mac:a,uplink:r,state:o,model:c,disabled:u,alignLeft:_})=>(0,d.n)(o,r)?(0,i.jsx)(l.A,{messageId:(0,s.E4T)({model:c})?"COMMON_CONNECTED_TO":"DEVICE_MESHING_TO",alignLeft:_,buttonEl:(0,i.jsx)(n.E,{device:{type:e,name:t,mac:a,uplink:r},size:"medium",disabled:u})}):null},949283(e,t,a){a.d(t,{n:()=>d});var i=a(977872),n=a(45978),s=a(754924),l=a(313369);const d=(e,t)=>{const a=(0,i.d4)(s.CC),d=t.uplink_mac?a.find(({mac:e})=>e===t.uplink_mac):void 0,r=Boolean(t.signal);return l.q[e]===n.g.CONNECTED&&d&&r?d:void 0}},721398(e,t,a){a.d(t,{A:()=>d});var i=a(274934),n=a(125799),s=a(853777),l=a(470070);const d=({messageId:e,tooltipClassName:t,values:a,isInteractive:d,portal:r,variant:o="twoTone",size:c="medium"})=>(0,i.jsx)(n.A,{description:(0,i.jsx)(l.sA,{id:e,values:a}),width:210,isInteractive:d,portal:r,tooltipClassName:t,children:(0,i.jsx)(s.A,{isActive:!0,omitSvgMargin:!0,variant:o,size:c})})},451336(e,t,a){a.d(t,{A:()=>c});var i=a(274934),n=a(783706),s=a(562896),l=a(488287),d=a(205240),r=a(698950);const o=({type:e,name:t,mac:a,uplink:n,disabled:s,maxWidth:l,peer_ubb:o,deviceState:c,ubb_pairing_state:u})=>(0,i.jsx)(r.A,{messageId:"COMMON_CONNECTED_TO",buttonEl:(0,i.jsx)(d.E,{device:{type:e,name:t,mac:a,uplink:n,peer_ubb:o,deviceState:c,ubb_pairing_state:u},maxWidth:l,disabled:s,separatePortNumber:!0})}),c=({connectionStatus:e,activeItem:{type:t,last_uplink:a,uplink:d,state:r,name:c,mac:u,model:_,disconnected_at:A,peer_ubb:E,deviceState:m,ubb_pairing_state:O},disabled:p,uplinkNameMaxWidth:h=195})=>{switch(e){case s.v.OFFLINE:return(0,i.jsx)(l.A,{last_uplink_mac:a?.uplink_mac,last_uplink_name:a?.uplink_device_name,last_uplink_remote_port:a?.uplink_remote_port,disconnected_at:A,disabled:p,separatePortNumber:!0,maxWidth:h});case s.v.MESHING:return(0,i.jsx)(n.A,{type:t,name:c,model:_,mac:u,uplink:d,state:r,disabled:p});case s.v.CONNECTED:return(0,i.jsx)(o,{type:t,name:c,mac:u,uplink:d,disabled:p,maxWidth:h,peer_ubb:E,deviceState:m,ubb_pairing_state:O});default:return null}}},562896(e,t,a){var i;a.d(t,{v:()=>i}),function(e){e.OFFLINE="offline",e.MESHING="meshing",e.CONNECTED_INTERRUPTED="connected-interrupted",e.CONNECTED="connected"}(i||(i={}))},159911(e,t,a){a.d(t,{H:()=>l});var i=a(956978),n=a(857780),s=a(562896);const l=(e,t)=>(0,i.aK8)(e)?s.v.OFFLINE:t===n.au.WIRELESS?s.v.MESHING:s.v.CONNECTED}}]);