"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[86304],{151061:(e,t,a)=>{a.d(t,{m:()=>_});var n=a(469733),l=a(296540),i=a(217439),r=a(90757),c=a(398300),o=a(340813),s=a(413146),d=a(845030),E=a(699784),m=a(532419),u=a(675845);const _=({last_uplink_mac:e,last_uplink_name:t,last_uplink_remote_port:a,disconnected_at:_,disabled:A,textSize:O,maxWidth:p})=>{const{formatMessage:C}=(0,E.tz)(),h=(0,n.useDispatch)(),N=(0,n.useSelector)(m.CC),v=(0,u.Z)(e,N),D=(0,u.z)(t,a,v,C);return l.createElement(l.Fragment,null,v?l.createElement("div",null,l.createElement(i.A,{color:"text-3",size:O},l.createElement(E.sA,{id:"COMMON_DEVICE_LAST_CONNECTED_TO",values:{deviceWithPort:l.createElement(o.A,{isFullWidth:!1,disabled:A,maxWidth:p||200,onClick:()=>{A||h((0,d.XP)({type:c.H.DEVICE,id:e}))},size:O},D)}}))):null,_?l.createElement("div",null,l.createElement(i.A,{color:"text-3",size:O},l.createElement(s.A,{date:(0,r.gH)(_)}))):null)}},186304:(e,t,a)=>{a.r(t),a.d(t,{default:()=>P});var n=a(469733),l=a(296540),i=a(54227),r=a(48598),c=a(314714),o=a(217439),s=a(132196),d=a(6510),E=a(742920),m=a(96512),u=a(860631),_=a(566723),A=a(252093),O=a(281884),p=a(188912),C=a(515219),h=a(553432),N=a(294303),v=a(876250),D=a(126457),g=a(699784),f=a(564985),I=a(302167),T=a(780811),k=a(768195),L=a(532419),M=a(171073),S=a(213583),x=a(349107),R=a(6176),b=a(765562),w=a(892145),y=a(261847),H=a(985370);const F=({searchText:e,setSearchText:t})=>{const a=(0,l.useCallback)((e,a)=>{t((0,y.Zx)(a.toLowerCase()))},[t]),n=(0,l.useCallback)(()=>{t("")},[t]);return l.createElement(w.A,{iconBefore:l.createElement(H.A,{size:"small"}),full:!0,onChange:a,onClear:n,value:e,variant:"secondary",placeholder:(0,g.tz)().formatMessage({id:"COMMON_SEARCH"}),keepRefOnClear:!0})};var G=a(822336),B=a(617147),U=a(71479);const V=(0,U.A)(B.A,{shouldForwardProp:e=>"haveOptions"!==e})`
  width: 460px;
  ${({haveOptions:e})=>e?"min-height: 200px;":""}
`,z=(0,U.A)("div")`
  padding: ${_.kc} ${_.kc} 0 ${_.kc};
  border-radius: ${G.Ay["desktop-radius-base"]};
  border: 1px solid ${({theme:{themeName:e}})=>G.Ay[`desktop-color-neutral-03-${e}`]};
`,W=s.AH`
  padding-left: 0;
`,$=s.AH`
  overflow-y: auto;
  height: 100%;
  min-height: 150px;
  max-height: 275px;
  padding: ${_.kc} 0 0 0;
`,P=(0,l.memo)(({activeMacs:e})=>{const[t,a]=(0,l.useState)(e),s=(0,n.useDispatch)(),w=(0,m.I)(),y=(0,n.useSelector)(I.ZZ),H=y===S.A.US.numericCode,G=y===S.A.CA.numericCode,B=(0,n.useSelector)((0,L.nH)(t)).filter(e=>(0,T.ioy)(e)&&(0,u.X5)(e,y)),U=B.filter(e=>(0,T.KKO)(e.model,"outdoorModeSupport")),P=1===B.length||1===U.length,Z=U?.[0],K=P&&Z&&(0,T.KKO)(Z?.model,"outdoorModeSupport"),X=P&&B?.[0]&&(0,T.J2F)(B[0]),Y=P&&Z&&!((0,T.ERA)(Z)||(0,T.Ume)(Z)),[J,q]=(0,l.useState)(""),[Q,j]=(0,l.useState)(1===B.length?t:[]),[ee,te]=(0,l.useState)(!1),[ae,ne]=(0,l.useState)(!1),[le,ie]=(0,l.useState)(!1),[re,ce]=(0,l.useState)(K?k.Dd.OUTDOOR:k.Dd.INDOOR),oe=(e=>e.filter(({mac:e})=>Boolean(e)).map(({model:e,mac:t})=>({label:(0,d.Lm)(e),value:t,image:l.createElement(N.A,{maxWidth:20,maxHeight:20},l.createElement(R.A,{model:e,width:20,height:20})),additionalInfo:t})))(U.length?U:B),se=(0,l.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,l.useEffect)(()=>{ce(K?k.Dd.OUTDOOR:k.Dd.INDOOR)},[K]);const de=(0,l.useCallback)(()=>{s((0,D.AS)())},[s]),Ee=(0,l.useCallback)(()=>{const e=se.map(({value:e})=>e);if(ee){const t=[...Q];j(t.filter(t=>!e.includes(t)))}else j([...new Set([...Q,...e])])},[ee,se,Q]),me=(0,l.useCallback)((e,{value:t})=>{const a=Q.some(e=>e===t);j(a?Q.filter(e=>e!==t):[...Q,t])},[Q]),ue=(0,l.useCallback)(()=>{ne(!0);const e=[];B.forEach(t=>{if(!Q.includes(t.mac))return;const a=(0,T.KKO)(t?.model,"outdoorModeSupport"),n=(0,u.X5)(t,y)?{afc_enabled:!0}:{},l=!a||re!==k.Dd.OUTDOOR&&P?{outdoor_mode_override:k.Gi.OFF}:{outdoor_mode_override:k.Gi.ON},i={radio_table:[]};t?.radio_table.forEach(e=>{const t={radio:e.radio,name:e.name};i.radio_table.push(e.radio===f.sx.RADIO_6E&&e?.tx_power_mode===f.PB.DISABLED?{...t,tx_power_mode:f.PB.AUTO}:t)}),e.push(s((0,M.ex)({...n,...l,...i},t._id,t.mac,{failureToast:{icon:E.C.danger,message:"COMMON_AFC_ENABLING_ERROR_TOAST"},mergeAndOverrideKeys:["radio_table"],extend:!0})))}),Promise.all(e).catch(w).finally(()=>{ne(!1),de()})},[Q,w,B,y,re,s,de,P]),_e=(0,l.useMemo)(()=>{const e=[];P?e.push({type:"button",variant:"link",target:"_blank",text:l.createElement(g.sA,{id:"COMMON_LEARN_MORE"}),href:b.A.afcArticle,className:W}):e.push({type:"button",variant:"link",text:l.createElement(c.A,{checked:ee,id:"isSelectAllChecked",onChange:()=>te(!ee)},l.createElement(g.sA,{id:"COMMON_ACTION_SELECT_ALL"}),` (${se.length})`),onClick:Ee,className:W});const t=[[{type:"button",text:l.createElement(g.sA,{id:"COMMON_ACTION_CANCEL"}),autoFocus:!1,onClick:de},{type:"button",variant:"primary",text:l.createElement(g.sA,{id:"COMMON_ACTION_SAVE"}),autoFocus:!0,onClick:ue,disabled:0===Q.length||!le,loader:ae?"loading":void 0}]];return[...e,...t]},[P,de,ue,Q.length,le,ae,ee,se.length,Ee]),Ae=(0,l.useMemo)(()=>H?"DEVICE_ENABLE_AFC_MODAL_HEADER_US":G?"DEVICE_ENABLE_AFC_MODAL_HEADER_CA":"DEVICE_EXTEND_6GHZ_RANGE",[H,G]);return(0,l.useEffect)(()=>{var e;te((e=Q,se.every(t=>e.includes(t.value))))},[se,Q]),(0,l.useEffect)(()=>{1===B.length&&0===Q.length&&j(t)},[t,B.length,Q.length]),(0,l.useEffect)(()=>{if(1===e.length&&!t.includes(e[0])){const n=[...new Set([...t,...e])];a(n),j(n)}},[e,t]),l.createElement(V,{title:l.createElement(g.sA,{id:!K&&P?Ae:"DEVICE_ENABLE_6GHZ"}),isOpen:B.length>0,shouldCloseOnOverlayClick:!1,onRequestClose:de,actions:_e,haveOptions:!!oe.length},l.createElement(N.A,{flexDirection:"column",gap:_.kc},P?l.createElement(N.A,{flexDirection:"column",alignItems:"center"},l.createElement(R.A,{model:B[0].model,width:120,height:120,size:v.Xh.LARGE}),l.createElement(N.A,{alignItems:"center",gap:_.YC},l.createElement(o.A,{size:"medium",variant:"body-primary",weight:"bold"},(0,d.Q)(B[0])),l.createElement(o.A,{size:"medium",variant:"body-primary"},(0,d.oT)(B[0]))),B[0]?.uplink?.uplink_device_name?l.createElement(N.A,{alignItems:"center"},l.createElement(p.A,{activeItem:B[0],connectionStatus:(0,O.H)(B[0].deviceState,B[0].uplink.type)})):null):null,P&&K&&Y?l.createElement(h.A,null,[k.Dd.INDOOR,k.Dd.OUTDOOR].map(e=>l.createElement(i.A,{key:e,id:e,value:e,checked:re===e,onChange:()=>ce(e)},l.createElement(N.A,{alignItems:"center",gap:_.YC},l.createElement(g.sA,{id:C.J[e]}),e===k.Dd.OUTDOOR?l.createElement(A.A,{messageId:X?"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_6GHZ_TOOLTIP":"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_TOOLTIP",values:{link:l.createElement(x.A,{id:"COMMON_LEARN_MORE",href:b.A.afcArticle})},variant:"outline",isInteractive:!0,portal:!0}):null)))):null,P?null:l.createElement(z,null,l.createElement(F,{searchText:J,setSearchText:q}),l.createElement(r.A,{options:se,handleOptionChange:me,isChecked:e=>Q.some(t=>t===e.value),isDisabled:()=>!1,within:"popover",createOptionText:()=>null,handleCreateOption:()=>null,searchValue:J,showCreateOption:!1,isWindowed:!0,className:$})),l.createElement(N.A,{flexDirection:"column"},l.createElement(c.A,{id:"tos_agreement",checked:le,onChange:()=>ie(!le)},l.createElement(o.A,{size:"medium",variant:"body-primary"},l.createElement(g.sA,{id:K?"DEVICE_ENABLE_6GHZ":G?"DEVICE_ENABLE_AFC_MODAL_HEADER_CA":"DEVICE_EXTEND_6GHZ_RANGE",values:{link:l.createElement(x.A,{noWrap:!0,id:"COMMON_TOS",href:b.A.termsOfServiceUrl})}}),l.createElement("br",null),l.createElement(g.sA,{id:K?"DEVICE_ENABLE_6GHZ_TOS_AGREE":G?"DEVICE_INCREASE_SPECTRUM_INDOOR_TOS_AGREE":"DEVICE_ENABLE_EXTEND_6GHZ_RANGE_TOS_AGREE",values:{link:l.createElement(x.A,{noWrap:!0,id:"COMMON_TOS",href:b.A.termsOfServiceUrl})}}))))))})},188912:(e,t,a)=>{a.d(t,{A:()=>E});var n=a(296540),l=a(370969),i=a(243322),r=a(294303),c=a(699784),o=a(151061),s=a(770804),d=a(392699);const E=({connectionStatus:e,activeItem:t,disabled:a,uplinkNameMaxWidth:E=195})=>{const{type:m,last_uplink:u,uplink:_,state:A,name:O,mac:p,disconnected_at:C}=t;switch(e){case d.v.OFFLINE:return n.createElement(o.m,{last_uplink_mac:u?.uplink_mac,last_uplink_name:u?.uplink_device_name,last_uplink_remote_port:u?.uplink_remote_port,disconnected_at:C,disabled:a,maxWidth:E});case d.v.MESHING:return n.createElement(s.A,{type:m,name:O,mac:p,uplink:_,state:A,alignLeft:!0,disabled:a});case d.v.CONNECTED:return n.createElement(r.A,{alignItems:"flex-bottom",flexWrap:"wrap"},n.createElement(i.A,{color:"text-3"},n.createElement(c.sA,{id:"COMMON_CONNECTED_TO"}))," ",n.createElement(l.E,{device:t,maxWidth:E,disabled:a,separatePortNumber:!0}));default:return null}}},243322:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(217439);const l=(0,a(71479).A)(n.A)`
  white-space: nowrap;
`},252093:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(296540),l=a(271856),i=a(162420),r=a(699784);const c=({messageId:e,tooltipClassName:t,values:a,isInteractive:c,portal:o,variant:s="twoTone",size:d="medium"})=>n.createElement(l.A,{description:n.createElement(r.sA,{id:e,values:a}),width:210,isInteractive:c,portal:o,tooltipClassName:t},n.createElement(i.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:d}))},269611:(e,t,a)=>{a.d(t,{n:()=>c});var n=a(469733),l=a(602197),i=a(532419),r=a(211368);const c=(e,t)=>{const a=(0,n.useSelector)(i.CC),c=t.uplink_mac?a.find(({mac:e})=>e===t.uplink_mac):void 0,o=Boolean(t.signal);return r.q[e]===l.g.CONNECTED&&c&&o?c:void 0}},281884:(e,t,a)=>{a.d(t,{H:()=>r});var n=a(780811),l=a(768195),i=a(392699);const r=(e,t)=>(0,n.aK8)(e)?i.v.OFFLINE:t===l.au.WIRELESS?i.v.MESHING:i.v.CONNECTED},392699:(e,t,a)=>{var n;a.d(t,{v:()=>n}),function(e){e.OFFLINE="offline",e.MESHING="meshing",e.CONNECTED_INTERRUPTED="connected-interrupted",e.CONNECTED="connected"}(n||(n={}))},515219:(e,t,a)=>{a.d(t,{J:()=>l});var n=a(768195);const l={[n.Dd.INDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_INDOOR",[n.Dd.OUTDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR"}},553432:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(296540),l=a(454195),i=a(566723),r=a(294303);const c=e=>n.createElement(r.A,{paddingTop:i.YC,paddingBottom:i.YC,gap:i.Ln,rowGap:i.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})},675845:(e,t,a)=>{a.d(t,{Z:()=>l,z:()=>i});var n=a(6510);const l=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,i=(e,t,a,l)=>{const i=t?` ${l({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${i}`:a?`${(0,n.Q)(a)}${i}`:l({id:"COMMON_FALLBACK"})}},770804:(e,t,a)=>{a.d(t,{A:()=>A});var n=a(296540),l=a(217439),i=a(71479),r=a(132196),c=a(566723),o=a(370969),s=a(294303),d=a(699784),E=a(269611);const m=(0,i.A)(s.A,{shouldForwardProp:e=>"alignLeft"!==e})`
  ${({alignLeft:e})=>e?"max-width: 288px;":"max-width: 100%; justify-content: center;"}
  gap: ${c.kc};
  align-items: center;
`,u=r.AH`
  max-width: 50%;
`,_=r.AH`
  flex: 0 1 auto;
  min-width: 0;
`,A=({type:e,name:t,mac:a,uplink:i,state:r,alignLeft:c,smallText:A,disabled:O})=>(0,E.n)(r,i)?n.createElement(m,{alignLeft:c},n.createElement(l.A,{size:A?"small":"medium",color:"text-2"},n.createElement(d.sA,{id:"DEVICE_MESHING_TO"})),n.createElement(s.A,{className:c?_:u},n.createElement(o.E,{device:{type:e,name:t,mac:a,uplink:i},size:A?"small":"medium",disabled:O,maxWidth:120}))):null}}]);