"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[11340],{376892(e,t,s){s.d(t,{A:()=>a});var i=s(274934),r=s(179102),n=s(470070);const a=({id:e,children:t,values:s})=>(0,i.jsxs)(r.A,{color:"text-1",weight:"bold",size:"medium",children:[e?(0,i.jsx)(n.sA,{id:e,values:s}):null,t]})},216082(e,t,s){s.d(t,{A:()=>j});var i,r=s(274934),n=s(266824),a=s(602086),o=s(977872),l=s(179102),d=s(976458),c=s(470070),m=s(535322),u=s(376892),p=s(222102);!function(e){e.OPEN_MODAL="openModal"}(i||(i={}));const _=(0,p.Mz)(d.zn,e=>void 0!==e[i.OPEN_MODAL]);var A=s(828373),x=s(367821);const h=({uidbDevice:e})=>{const t=(0,o.d4)(d.zn),s=t?.[i.OPEN_MODAL];return s?(0,r.jsx)(n.A,{onClick:()=>s(e),children:(0,r.jsx)(l.A,{size:"medium",color:"inherit",children:(0,r.jsx)(c.sA,{id:"DEVICE_SHOW_DETAILS"})})}):null},v=({shortname:e})=>{(0,x.A)();const t=(0,o.d4)((0,a.useMemo)(()=>(0,A.$E)(e),[e]));return t?.compliance?(0,r.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:"compliance",label:(0,r.jsx)(u.A,{id:"COMMON_COMPLIANCE"}),renderContent:()=>(0,r.jsx)(h,{uidbDevice:t}),openByDefault:!0}]}):null},j=({shortname:e})=>(0,o.d4)(_)?(0,r.jsx)(v,{shortname:e}):null},643334(e,t,s){s.d(t,{A:()=>ee});var i=s(274934),r=s(602086),n=s(179102),a=s(266824),o=s(228032),l=s(409844),d=s(263705),c=s(977872),m=s(505817),u=s(87449),p=s(470070),_=s(100978),A=s(309130),x=s(968021),h=s(29472),v=s(430986),j=s(401042);const E=(0,j.T7)("device/{mac}/fw-revert-options"),b=(e,t={},s={})=>(0,h.Kd)("firmwareRevertOptions",(0,v.P)(E,{mac:e}),e,t,{idField:"mac",...s});var C=s(222102),f=s(15989);var g=s(45978),O=s(724081),w=s(517640),M=s(83985),N=s(247816),I=s(669439),y=(s(232087),s(129402)),k=s(347625),T=s(807811),D=s(224012),S=s(743178),R=s(591256),H=s(594633),L=s(976458),z=s(696916),U=s(795206),V=s(898809),$=s(146215),G=s(877268);const P=(0,N.A)(G.A)`
  border-radius: 50%;
  padding: 1px;
  border: ${({theme:{themeName:e}})=>m.Ay[`desktop-border-divider-${e}`]};
  color: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-08-${e}`]};
`,F=({model:e,version:t})=>{const s=(0,c.d4)(L.qf),n=(0,u.coerce)(t)?.version||t,a=(0,r.useCallback)(()=>{n&&s?.(e,n)},[s,e,n]);return(0,i.jsx)(I.A,{description:(0,i.jsx)(p.sA,{id:"COMMON_RELEASE_NOTES"}),children:(0,i.jsx)("span",{children:(0,i.jsx)(P,{actionable:!0,onClick:a,size:"original"})})})},B=()=>{const{themeName:e}=(0,d.u)();return(0,i.jsx)("svg",{viewBox:"0 0 93 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M92.3536 4.03715C92.5488 3.84189 92.5488 3.5253 92.3536 3.33004L89.1716 0.14806C88.9763 -0.0472023 88.6597 -0.0472023 88.4645 0.14806C88.2692 0.343322 88.2692 0.659904 88.4645 0.855167L91.2929 3.68359L88.4645 6.51202C88.2692 6.70728 88.2692 7.02387 88.4645 7.21913C88.6597 7.41439 88.9763 7.41439 89.1716 7.21913L92.3536 4.03715ZM0 3.68359V4.18359H92V3.68359V3.18359H0V3.68359Z",fill:m.Ay[`desktop-color-purple-06-${e}`]})})},q=(0,N.A)(_.A)`
  padding: ${A.xO};
  border: ${({theme:{themeName:e}})=>m.Ay[`desktop-border-divider-${e}`]};
  border-radius: 8px;
  margin-bottom: ${A.kc};
`,W=(0,N.A)(_.A)`
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background-color: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-purple-06-${e}`]};
  z-index: 1;
`,Y=(0,N.A)(_.A)`
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  align-items: center;
`,K=(0,N.A)(_.A)`
  background-color: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-02-${e}`]};
  border-radius: 4px;

  textarea {
    background-color: transparent;
    resize: none;
  }
`,X=({onCancel:e,onSubmitSuccess:t,name:s,model:a,mac:x,displayable_version:h,uptime:v,revertOptions:j})=>{const E=(0,c.wA)(),{themeName:b}=(0,d.u)(),{formatMessage:C}=(0,p.tz)(),[f,g]=(0,r.useState)(""),O=(0,c.d4)(R.Eh),N=(0,c.d4)(H.S$),G=(0,S.GO)(N),P=(0,c.d4)(L.ap),X=(0,c.d4)(L.YL),Z=(0,z.A)("firmware_downgrade_feedback"),J=(0,k.Lm)(a),Q=(0,u.coerce)(h)?.version,ee=(0,u.coerce)(j.previous_firmware_version)?.version,te=(0,r.useCallback)(async(e,t)=>{const s=await Z(),i=`${T.DU}${D.Fx[G]}/v1/firmware-downgrade`;try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","X-Captcha":s},mode:"cors",body:JSON.stringify({message:e,applicationName:"Network",applicationVersion:O,deviceModel:J,deviceFirmwareCurrentVersion:(0,y._)(h),deviceFirmwareNewVersion:t,anonymousId:P})})}catch(e){}},[Z,G,O,h,P,J]),se=(0,r.useCallback)(()=>{if(E((0,U._1)({name:s,model:a,mac:x},j.previous_firmware_url)),X)return t();f&&te(f,j.previous_firmware_version),t()},[E,s,a,x,j.previous_firmware_url,j.previous_firmware_version,X,f,t,te]);return(0,i.jsxs)(q,{flexDirection:"column",gap:A.Ln,children:[(0,i.jsxs)(_.A,{gap:A.kc,width:"100%",children:[(0,i.jsxs)(_.A,{flexDirection:"column",alignItems:"center",width:"110px",flex:"0 0 110px",children:[(0,i.jsxs)(n.A,{color:"text-3",size:"small",children:[(0,i.jsx)(p.sA,{id:"COMMON_CURRENT_VERSION"}),":"]}),(0,i.jsxs)(_.A,{gap:A.YC,children:[(0,i.jsx)(I.A,{description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.sA,{id:"DEVICE_TIME_RUNNING"}),": ",(0,V.Ay)(v).join("").trim()]}),children:(0,i.jsx)(n.A,{color:"text-2",size:"medium",children:Q})}),(0,i.jsx)(F,{model:a,version:h})]})]}),(0,i.jsxs)(_.A,{flex:1,alignItems:"center",justifyContent:"center",position:"relative",children:[(0,i.jsx)(Y,{children:(0,i.jsx)(B,{})}),(0,i.jsx)(W,{children:(0,i.jsx)(o.A,{size:"original",variant:"twoTone",color:"white",twoTonedClassname:l.AH`
                fill: ${m.Ay[`desktop-color-purple-06-${b}`]};
              `})})]}),(0,i.jsxs)(_.A,{flexDirection:"column",alignItems:"center",width:"110px",flex:"0 0 110px",children:[(0,i.jsxs)(n.A,{color:"text-3",size:"small",children:[(0,i.jsx)(p.sA,{id:"COMMON_REVERT_TO"}),":"]}),(0,i.jsxs)(_.A,{gap:A.YC,children:[(0,i.jsx)(n.A,{color:"text-2",size:"medium",children:ee}),(0,i.jsx)(F,{model:a,version:ee||""})]})]})]}),X?null:(0,i.jsx)(K,{flexDirection:"column",gap:A.YC,children:(0,i.jsx)(w.A,{resize:!1,style:{width:"100%"},placeholder:C({id:"COMMON_HELP_UNIFI_UNDERSTAND_REVERT_DESCRIPTION"}),value:f,onChange:e=>{g(e)}})}),(0,i.jsxs)(_.A,{gap:A.YC,width:"100%",children:[(0,i.jsx)($.A,{title:(0,i.jsx)(p.sA,{id:"DEVICE_REVERT_NOW_CONFIRM_TITLE",values:{model:J}}),message:(0,i.jsx)(p.sA,{id:"DEVICE_REVERT_NOW_CONFIRM_MESSAGE",values:{model:J,version:ee||""}}),confirmButtonVariant:"emphasis",onConfirm:se,trigger:(0,i.jsx)(M.A,{size:"small",children:(0,i.jsx)(p.sA,{id:"COMMON_ACTION_REVERT_NOW"})})}),(0,i.jsx)(M.A,{size:"small",variant:"neutral",onClick:e,children:(0,i.jsx)(p.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})};var Z=s(664092),J=s(857780);const Q=[J.bq.USW,J.bq.UAP,J.bq.UDB,J.bq.UBB,J.bq.UXG,J.bq.UBLE,J.bq.UAV,J.bq.UCI,J.bq.UACC],ee=({name:e,model:t,mac:s,displayable_version:h,uptime:v,type:E,flexProps:w,deviceState:M})=>{const N=(0,c.wA)(),[I,y]=(0,r.useState)(!1),{themeName:k}=(0,d.u)(),T=(0,c.d4)((0,r.useMemo)(()=>(e=>(0,C.Mz)((e=>(0,f.uh)(b(e)))(e),j.i6))(s),[s])),D=(0,x.A)(M);(0,r.useEffect)(()=>{D===g.g.UPGRADING&&M!==g.g.UPGRADING&&N(b(s))},[M,D,N,s]);const S=(0,r.useMemo)(()=>{const e=T.previous_firmware_version&&T.previous_firmware_url,t=h!==(0,u.coerce)(T.previous_firmware_version)?.version,s=M===g.g.UPGRADING;return Boolean(e)&&!s&&t&&Q.includes(E)},[T.previous_firmware_version,T.previous_firmware_url,h,M,E]),R=(0,O.A)(Q.includes(E)?[b(s,{},void 0)]:[],S?(0,i.jsxs)(a.A,{onPress:()=>{y(!0)},fontSize:"medium",children:[(0,i.jsx)(o.A,{size:"original",variant:"twoTone",color:m.Ay[`desktop-color-ublue-06-${k}`],twoTonedClassname:l.AH`
            fill: ${m.Ay[`desktop-color-ublue-01-${k}`]};
          `}),(0,i.jsx)(p.sA,{id:"COMMON_REVERT"})]}):null);return(0,i.jsxs)(i.Fragment,{children:[h?(0,i.jsxs)(Z.A,{flexProps:w,children:[(0,i.jsx)(n.A,{color:"text-2",size:"medium",children:(0,i.jsx)(p.sA,{id:"COMMON_DEVICE_VERSION"})}),(0,i.jsxs)(_.A,{gap:A.kc,alignItems:"flex-start",children:[(0,i.jsx)(n.A,{color:"text-3",size:"medium",children:h}),R]})]}):null,I?(0,i.jsx)(X,{onCancel:()=>{y(!1)},onSubmitSuccess:()=>{y(!1)},name:e,model:t,mac:s,displayable_version:h,uptime:v,revertOptions:T}):null]})}},129126(e,t,s){s.r(t),s.d(t,{default:()=>R});var i=s(274934),r=s(602086),n=s(309130),a=s(100978),o=s(956978),l=s(853109),d=s(843910),c=s(830257),m=s(17534),u=s(551803),p=s(383550),_=s(260067),A=s(326084),x=s(686318),h=s(241615),v=s(187801),j=s(956021),E=s(893762),b=s(948803),C=s(725870),f=s(924453),g=s(382583),O=s(664613),w=s(597377),M=s(425381),N=s(643334),I=s(223232),y=s(906701),k=s(535322);const T=({name:e,model:t,ip:s,ipv6:r,lan_ip:n,mac:a,connection_network_id:o,displayable_version:l,uptime:d,systemStatsMem:c,sys_stats:m,satisfaction:u,vap_table:p,radio_table:_,radio_table_stats:A,type:x,deviceState:h,ethernet_overrides:T,port_table:D,uplink:S,device_mode_override:R})=>(0,i.jsxs)(k.A,{children:[(0,i.jsx)(b.A,{model:t}),(0,i.jsx)(w.A,{ip:s,lan_ip:n,type:x,ethernet_overrides:T,port_table:D,uplink:S,device_mode_override:R}),(0,i.jsx)(y.A,{ipv6_address:r}),(0,i.jsx)(g.A,{connection_network_id:o}),(0,i.jsx)(f.A,{mac:a}),(0,i.jsx)(N.A,{name:e,model:t,mac:a,type:x,displayable_version:l,uptime:d,deviceState:h}),(0,i.jsx)(v.A,{}),(0,i.jsx)(j.A,{satisfaction:u,vap_table:p,radio_table:_,radio_table_stats:A}),(0,i.jsx)(E.A,{uptime:d}),(0,i.jsx)(C.A,{systemStatsMem:c}),(0,i.jsx)(O.A,{sys_stats:m}),(0,i.jsx)(I.A,{mac:a}),(0,i.jsx)(M.A,{})]});var D=s(352879),S=s(216082);const R=({activeItem:e,activeItem:{name:t,model:s,mac:v,type:j,uplink:E,satisfaction:b,adopted:C,uptime:f,last_seen:g,radio_table:O,radio_table_stats:w,vap_table:M,stat:N,detailed_states:I,lan_ip:y,ip:k,ipv6:R,displayable_version:H,sys_stats:L,"system-stats":z,support_wifi6e:U,deviceState:V,shortname:$,ethernet_overrides:G,port_table:P,device_mode_override:F}})=>{const B=(0,r.useMemo)(()=>(0,l.Uj)({type:E?.type,mlo_links:E?.mlo_links}),[E?.type,E?.mlo_links]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.A,{activeItem:e,hidePortsButton:!0,overviewChildren:(0,i.jsx)(_.A,{uplink:E,type:j,mac:v,radio_table:O,radio_table_stats:w,vap_table:M,support_wifi6e:U,deviceState:V,paddingBottom:n.kc,isMloUplinkConnection:B}),badge:B?(0,i.jsx)(d.g,{children:(0,i.jsx)(d.A,{})}):null,children:C&&O?.length?(0,i.jsx)(a.A,{marginTop:n.kc,children:(0,i.jsx)(u.A,{mac:v})}):null}),(0,i.jsx)(c.i,{uplink:E,mac:v,detailed_states:I}),(0,i.jsx)(D.A,{mac:v}),(0,i.jsx)(A.A,{stat:N,mac:v,uplink:E,uptime:f,last_seen:g,deviceState:V}),(0,i.jsx)(T,{name:t,model:s,type:j,ip:k,ipv6:R,lan_ip:y,mac:v,connection_network_id:e.connection_network_id,displayable_version:H,uptime:f,systemStatsMem:z?.mem,sys_stats:L,satisfaction:b,vap_table:M,radio_table:O,radio_table_stats:w,ethernet_overrides:G,port_table:P,uplink:E,device_mode_override:F}),(0,o.aK8)(V)?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.A,{radio_table:O,radio_table_stats:w,type:j,stat:N,support_wifi6e:U}),(0,i.jsx)(m.A,{activeItem:e}),(0,i.jsx)(x.S,{vap_table:M,radio_table:O})]}),(0,i.jsx)(S.A,{shortname:$})]})}},61322(e,t,s){s.d(t,{I:()=>i});const i={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,s,i){return Math.min((i||this.ROW_HEIGHT)*e+(s??this.HEADER_HEIGHT),(i||this.ROW_HEIGHT)*t+(s??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,s){return Math.min((s||this.EDIT_FIELD_HEIGHT)*e,(s||this.EDIT_FIELD_HEIGHT)*t)}}},112104(e,t,s){s.d(t,{A:()=>c});var i=s(274934),r=s(602086),n=s(179102),a=s(526744),o=s(309130),l=s(100978),d=s(470070);const c=(e,t={})=>{const{formatMessage:s}=(0,d.tz)(),[c,m]=(0,r.useState)(!1),{defaultCount:u,label:{singular:p,plural:_}}=(0,r.useMemo)(()=>({defaultCount:t.defaultCount||6,label:{singular:s({id:t.label?.singular||"COMMON_DEVICE"}),plural:s({id:t.label?.plural||"COMMON_DEVICES"})}}),[t,s]),A=(0,r.useCallback)(()=>{m(e=>!e)},[]);return{rowLimit:e>u&&!c?u:e,renderFooter:e>u?(0,i.jsx)(l.A,{marginTop:o.kc,children:(0,i.jsxs)(n.A,{size:"medium",children:[(0,i.jsx)(d.sA,{id:"COMMON_ADV_TABLE_FOOTER",values:{length:e>u&&!c?u:e,total:e,singular:p,plural:_}}),(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)(a.A,{type:"button",variant:"inline",onClick:A,children:[(0,i.jsx)(d.sA,{id:"COMMON_SHOW"})," ",(0,i.jsx)(d.sA,{id:c?"COMMON_LESS":"COMMON_ALL"})]})]})]})}):null,setExpand:m}}},968021(e,t,s){s.d(t,{A:()=>r});var i=s(602086);const r=e=>{const t=(0,i.useRef)(void 0);return(0,i.useEffect)(()=>{t.current=e},[e]),t.current}},367821(e,t,s){s.d(t,{A:()=>l});var i=s(602086),r=s(977872),n=s(726831),a=s(575478),o=s(828373);const l=()=>{const e=(0,r.wA)(),t=(0,r.d4)(o.eo);return(0,i.useEffect)(()=>{t||(async()=>{const t=await fetch(n.A.fingerprintPublicDatabasePath),s=await t.json();e((0,a.$)(s))})()},[t,e]),t}},828373(e,t,s){s.d(t,{$E:()=>c,eo:()=>l});var i=s(222102),r=s(271656),n=s(720770),a=s(172205);const o=e=>e[a.U.UIDB]||(0,r.A)(),l=(0,i.Mz)(o,({version:e})=>Boolean(e)),d=(0,i.Mz)(o,({devices:e})=>e||(0,n.A)()),c=e=>(0,i.Mz)(d,t=>t.find(({shortnames:t})=>e&&(t||[]).includes(e))||(0,r.A)());(0,i.Mz)(d,e=>{const t=new Map;for(let s=0;s<e.length;s+=1){const i=e[s].power?.baseConsumption;if(void 0!==i){const{shortnames:r}=e[s];for(let e=0;e<(r||[]).length;e+=1)t.set(r[e],i)}}return t})},696916(e,t,s){s.d(t,{A:()=>d});var i=s(602086),r=s(977872),n=s(232087),a=s(594633),o=s(743178);const l={[n.OH.PRD]:"6Ld47OUpAAAAALQ4AgR1gfk-hnSw27y3zIMKLOSw",[n.OH.STG]:"6LeKc-UpAAAAAN6YqRab29cPCbU-cfe7_EvchSvc",[n.OH.DEV]:"6LeocOUpAAAAANmIju4N9DzlkK4UNYdYThrUkK3y"},d=e=>{const[t,s]=(0,i.useState)(),n=(0,i.useRef)(void 0),d=(0,r.d4)(a.S$),c=(0,o.GO)(d);return(0,i.useEffect)(()=>{const t=()=>{const{grecaptcha:i}=window;i?.enterprise.ready(()=>s(()=>()=>i.enterprise.execute(l[c],{action:e}))),n.current?.removeEventListener("load",t)};return"grecaptcha"in window?t():(n.current=document.createElement("script"),n.current.src=(e=>`https://www.google.com/recaptcha/enterprise.js?render=${l[e]}`)(c),n.current.addEventListener("load",t),document.body.appendChild(n.current),(()=>{const e="hide-grecaptcha-badge";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.innerText=".grecaptcha-badge { visibility: hidden; }",document.head.appendChild(t)})()),()=>{n.current?.removeEventListener("load",t)}},[]),t}}}]);