"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[65108],{243:(e,t,a)=>{a.d(t,{F:()=>I});var n=a(296540),l=a(217439),i=a(170121),r=a(566723),s=a(766624),c=a(294303),o=a(864635),m=a(689965),d=a(699784),E=a(569299),u=a(702549),A=a(360113),_=a(190492),p=a(546343),v=a(595053);const O=({slot:e,isESim:t,primary_slot:a,data_limit_enabled:m,data_soft_limit_bytes:O,data_warning_threshold:I,data_soft_limit_display_unit:C,reset_policy:N,dataUsage:b,displayState:D,...y})=>{const S=(0,E.CJ)(e,t);return n.createElement(c.A,{gap:r.kc,flexDirection:"column"},n.createElement(i.D,{size:"medium"},n.createElement(p.pF,{slot:S})),n.createElement("div",null,n.createElement(_.A,{...y}),void 0!==b?n.createElement(A.A,null,n.createElement(l.A,{color:"text-2"},n.createElement(d.sA,{id:"COMMON_DATA_USAGE"})),n.createElement(c.A,{alignItems:"center",gap:r.YC},n.createElement(v.A,{softLimit:m?O:0,threshold:m?I:void 0,dataFormat:"SI",used:+b}),m?n.createElement(s.A,{description:n.createElement("span",null,n.createElement(o.Ay,{slot:S,displayState:D,resetPolicy:N||u.Hb.DAY,softLimit:O||0,usage:b,dataFormat:"SI"}))}):null)):null))},I=({sim:e=[],radio:t={},mbb_overrides:a={}})=>{const l=(e||[]).filter(({card_present:e,operation_in_progress:t}={})=>e&&!t);return l.length?n.createElement(m.A,null,n.createElement(c.A,{flexDirection:"column",gap:r.Ln},l.map(({slot:e,active:l,spn:i,current_apn:r,rxbytes:s,txbytes:c,iccid:o,display_state:m,esim:d})=>{const A=a.sim?.find(t=>t.slot===e);return n.createElement(O,{key:e,slot:e,primary_slot:a?.primary_slot||u.td.SLOT_1,status:l?_.H.ACTIVE:_.H.STANDBY,networkoperator:(0,E.ap)(l?t.networkoperator:i),apn:r?.apn,rat:t.rat,rxbytes:void 0!==s?+s:void 0,txbytes:void 0!==c?+c:void 0,iccid:o,data_limit_enabled:A?.data_limit_enabled,data_soft_limit_bytes:A?.data_soft_limit_bytes,data_warning_threshold:A?.data_warning_threshold,data_soft_limit_display_unit:A?.data_soft_limit_display_unit,reset_policy:A?.reset_policy,dataUsage:(0,E.rB)({rxbytes:s,txbytes:c}),displayState:m,isESim:d})}))):null}},137625:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(296540),l=a(353899),i=a(132196),r=a(372737),s=a(566723),c=a(699784);const o=({children:e=null,title:t,titleValues:a,message:o,messageValues:m,handleConfirm:d=()=>null,handleClose:E=()=>null,handleCancel:u,isOpen:A,buttonVariant:_="primary",cancelButtonVariant:p="tertiary",cancelButtonMessage:v="COMMON_ACTION_CANCEL",buttonMessage:O="COMMON_ACTION_CONFIRM",buttonDisabled:I=!1,position:C="top",showHeaderClose:N=!1,contentClassName:b="",body:D,titleBody:y,className:S,rootClose:M=!1,footerActions:T})=>{const g=(0,n.useCallback)(e=>{A&&(e.stopPropagation(),e.key===r.U.ENTER?d():e.key===r.U.ESCAPE&&E(!1))},[A,d,E]);(0,n.useEffect)(()=>(window.addEventListener("keydown",g,!0),()=>{window.removeEventListener("keydown",g,!0)}),[g]);const f=(0,n.useCallback)(()=>{E(!1),u?.()},[E,u]),R=(0,n.useCallback)(()=>{E(!1),d()},[E,d]),w=(0,n.useMemo)(()=>[{text:n.createElement(c.sA,{id:v}),variant:p,onClick:f},{text:n.createElement(c.sA,{id:O}),disabled:I,variant:_,onClick:R}],[O,_,v,p,f,R,I]),h=(0,n.useCallback)(()=>{E(!1)},[E]),k=i.AH`
    ${t?"":`margin-top: ${s.xO}`}
  `;return n.createElement(l.A,{title:t?n.createElement(c.sA,{id:t,values:a}):y||null,...o?{body:n.createElement(n.Fragment,null,n.createElement(c.sA,{id:o,values:m}),D)}:{body:D},position:C,portal:!0,actions:T||w,showHeaderClose:N,contentClassName:i.AH`
        ${k}
        ${b}
      `,onRequestClose:h,isOpen:A,allowOverflow:!0,rootClose:M,className:S},e)}},142208:(e,t,a)=>{a.d(t,{A:()=>B});var n=a(469733),l=a(296540),i=a(271856),r=a(927099),s=a(71479),c=a(998837),o=a(132196),m=a(6510),d=a(249304),E=a(280258),u=a(137625),A=a(845030),_=a(699784),p=a(267509),v=a(600446),O=a(656883),I=a(290480),C=a(814803),N=a(157766),b=a(994791),D=a(953048),y=a(293016),S=a(649413),M=a(497470),T=a(83344),g=a(323572),f=a(457311),R=a(602021),w=a(789768),h=a(837612),k=a(602197),V=a(171073),P=a(765268),L=a(190497),x=a(955161),F=a(734707);const U=(0,s.A)(F.Ay,{shouldForwardProp:e=>"disabled"!==e})`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{motifPalette:{red05:e,red06:t}},disabled:a})=>a?e:t};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:a})=>a?e:t};
  }
`,X=o.AH`
  flex: 1;
  width: 100%;
`,j=e=>l.createElement(i.A,{portal:!0,width:180,description:l.createElement(r.A,{whiteSpacePreWrap:!0},l.createElement(_.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:X},e),B=({device:e,disabled:t,variant:a})=>{const i=(0,n.useDispatch)(),s=(0,c.u)(),[o,B]=(0,l.useState)(!1),[W,z]=(0,l.useState)(!1),H=(0,n.useSelector)(R.EL),G=(0,n.useSelector)(b.OA),Y=(0,n.useSelector)(v.W),$=(0,n.useSelector)(C.yD),K=(0,h.S9)(e),{isDeviceDisconnected:Q,isDeviceAdoptionFailed:Z,deviceBusy:q}=(0,l.useMemo)(()=>({isDeviceDisconnected:K===k.g.DISCONNECTED,isDeviceAdoptionFailed:K===k.g.ADOPTION_FAILED,deviceBusy:(0,h.C1)(K)}),[K]),J=(0,l.useMemo)(()=>t||q||H,[t,q,H]),ee=(0,l.useCallback)(()=>{const{id:t,type:a}=(0,S.Se)(G);if(a===y.F7.DEVICE&&t===e?.mac&&(i((0,M.U)(D.Zt)),i((0,M.Ao)([]))),$===e?.mac){const e={...Y,[p.dp.DEVICE]:E.H,[p.dp.MACS]:L.oA};i((0,O.n)(e)),i((0,w.yT)(d.l.RADIOS,{filters:e})),i((0,N.OI)(I.TE.ALL))}},[e?.mac,i,Y,G,$]);return l.createElement(x.A,{condition:q,wrapper:j},l.createElement(u.A,{isOpen:W,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:(0,m.Q)(e)},message:Q||Z?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:(0,m.Q)(e)},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:async()=>{B(!0),i((0,g.Yl)(e.mac)).then(()=>{ee(),i((0,T.W)(e.mac)),i((0,V.XL)(e.mac)),B(!1),z(!1),i((0,A.K5)()),i((0,f.Uc)()),i((0,P.O)())}).finally(()=>{B(!1),z(!1)})},handleClose:()=>{B(!1),z(!1)},className:"tertiary"===a?X:""},l.createElement(U,{disabled:J,variant:"tertiary"===a?void 0:"link",className:"tertiary"===a?(0,F.sC)(s):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),z(!0)},loader:o?"spinner":null,type:"button"},l.createElement(r.A,{color:"danger",size:"body"},l.createElement(_.sA,{id:"COMMON_ACTION_REMOVE"})))))}},242366:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(296540),l=a(566723),i=a(294303);const r=(0,n.forwardRef)((e,t)=>n.createElement(i.A,{ref:t,flexDirection:"column",gap:l.kc,width:"100%",...e}))},323572:(e,t,a)=>{a.d(t,{TG:()=>d,Ve:()=>o,Yl:()=>I,x_:()=>A,zK:()=>_,us:()=>v,jk:()=>p,p5:()=>u,RZ:()=>c,rA:()=>E,gM:()=>C,NA:()=>m,_F:()=>O});var n=a(691189),l=a(736318),i=a(294201),r=a(87485);const s="/api/s/{site}/cmd/sitemgr",c=(e={},t={})=>(0,n.t9)("autoIpsec","/v2/api/vpn/auto/sites",e,{idField:"id",...t}),o=e=>(0,n.Xj)(i.A.ADD_SITE_VPN,s,e),m=e=>(0,n.Xj)(i.A.REBUILD_SITE_VPN,s,e),d=e=>(0,n.Xj)(i.A.ADD_SITE,s,{desc:e}),E=e=>(0,n.Xj)(i.A.IMPORT_SITE,l.g1,{site_desc:e.newSiteName,backup_id:e.importedSiteId}),u=()=>(0,n.Xj)(i.A.EXPORT_SITE,l.g1),A=e=>(0,n.Xj)(i.A.DELETE_SITE,s,{site:e}),_=(e,t={})=>(0,n.Xj)(i.A.DELETE_SITE_VPN,s,{site:e.remote_site_id,name:e.name},t),p=(e,t={})=>(0,n.Xj)(i.A.ENABLE_SITE_VPN,s,{site:e.site,name:e.name},t),v=(e,t={})=>(0,n.Xj)(i.A.DISABLE_SITE_VPN,s,{site:e.site,name:e.name},t),O=e=>(0,n.Xj)(i.A.UPDATE_SITE,s,{desc:e}),I=(e,t={})=>(0,n.Xj)(i.A.DELETE_DEVICE,s,{macs:[].concat(e)},{...(0,r.rk)("COMMON_COMMAND_DELETE_DEVICE_TOAST_ERROR",{count:[].concat(e).length}),...t}),C=(e,t,a={})=>(0,n.Xj)(i.A.MOVE_DEVICE,s,{mac:e,site:t},a)},372737:(e,t,a)=>{var n;a.d(t,{U:()=>n}),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape"}(n||(n={}))},455643:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(296540),l=a(930662);const i=({duration:e,value:t,renderLabel:a,onComplete:i,maxValue:r=100,initialTime:s=0,...c})=>{const[o,m]=(0,n.useState)(0),d=(0,n.useRef)(null),E=(0,n.useRef)(0),u=(0,n.useCallback)(()=>{E.current+=.5;const t=Math.min(Math.round(100*E.current/e),r);t>=100&&(window.clearInterval(d.current),d.current=null,i?.()),m(t)},[e,r,i]);return(0,n.useEffect)(()=>{const a=()=>{d.current&&window.clearInterval(d.current)};if(t)return d.current&&window.clearInterval(d.current),a;E.current=s;const n=Math.min(Math.round(100*s/e),r);return m(n),s>=e?(i?.(),a):(d.current=window.setInterval(u,500),a)},[u,t,s,e,r,i]),n.createElement(l.A,{value:void 0!==t?t:o,label:a?a(e-E.current):void 0,...c})}},656883:(e,t,a)=>{a.d(t,{n:()=>i});var n=a(458112),l=a(744742);const i=e=>(0,l.pb)({name:n.T.RADIOS,value:e})},986446:(e,t,a)=>{a.r(t),a.d(t,{default:()=>X});var n=a(296540),l=a(837612),i=a(962926),r=a(217439),s=a(170121),c=a(162420),o=a(6510),m=a(566723),d=a(242366),E=a(294303),u=a(876250),A=a(6176),_=a(142208),p=a(699784),v=a(996734),O=a(689965),I=a(360113),C=a(777741);const N=n.createElement(p.sA,{id:"COMMON_NETWORK_PURPOSE_WAN"}),b=n.createElement(p.sA,{id:"COMMON_NETWORK_PURPOSE_LANX",values:{number:""}}),D=({activeItem:e,activeItem:{mac:t,model:a,ip:l,mbb:D}})=>{const y=D?.mode===v.c9.PRIMARY_INTERNET,S=y?N:b,M=y?b:N;return n.createElement(d.A,null,n.createElement(i.A,{sections:[n.createElement(E.A,{flexDirection:"column",gap:m.Ln},n.createElement(E.A,{gap:m.kc,alignItems:"center"},n.createElement(A.A,{model:a,size:u.Xh.MEDIUM,width:40,height:40}),n.createElement(s.A,{variant:"medium"},(0,o.Lm)(a))),n.createElement(E.A,{marginTop:m.kc},n.createElement(E.A,{marginRight:m.kc},n.createElement(c.A,{isActive:!0,variant:"fill",size:"original"})),n.createElement(E.A,{flexDirection:"column",gap:m.kc},n.createElement(s.A,{variant:"medium"},n.createElement(p.sA,{id:"DEVICE_INCORRECT_TOPOLOGY_WARNING_TITLE",values:{currentPort:M}})),n.createElement(r.A,null,n.createElement(p.sA,{id:"DEVICE_INCORRECT_TOPOLOGY_WARNING",values:{b:p.b,currentPort:M,adoptedPort:S}})))),n.createElement(_.A,{device:e,variant:"tertiary"}))]}),n.createElement(O.A,null,t?n.createElement(I.A,null,n.createElement(r.A,{color:"text-2",size:"medium"},n.createElement(p.sA,{id:"COMMON_MAC_ADDRESS"})),n.createElement(r.A,{color:"text-3",size:"medium"},t)):null,l?n.createElement(I.A,null,n.createElement(r.A,{color:"text-2",size:"medium"},n.createElement(p.sA,{id:"COMMON_IP_ADDRESS"})),n.createElement(r.A,{color:"text-3",size:"medium"},l)):null,D?.imei?n.createElement(I.A,null,n.createElement(r.A,{color:"text-2",size:"medium"},n.createElement(p.sA,{id:"DEVICE_IMEI"})),n.createElement(r.A,{color:"text-3",size:"medium"},D.imei)):null,D?.esim?.eid?n.createElement(C.A,{eid:D.esim.eid}):null))};var y=a(86571),S=a(328787),M=a(932832),T=a(673283),g=a(243),f=a(281884),R=a(392699),w=a(124092),h=a(470962),k=a(602197),V=a(188912),P=a(937491),L=a(236037);const x=({activeItem:e,activeItem:{mac:t,deviceState:a,uplink:l,mbb:i,mbb_overrides:r,wan_networkgroup:s}})=>{const c=(0,n.useMemo)(()=>(0,f.H)(a||k.g.UNKNOWN,l?.type),[a,l?.type]),o=c===R.v.OFFLINE,d=Boolean(s)||Boolean(l?.uplink_device_name);return n.createElement(n.Fragment,null,n.createElement(w.A,{activeItem:e,isOffline:o,description:d?n.createElement(V.A,{activeItem:e,connectionStatus:c}):null,style:{flex:1}},i?.sim&&!o?n.createElement(E.A,{marginTop:m.xO},n.createElement(P.A,{mac:t,deviceState:a,mbb:i,mbb_overrides:r})):null,n.createElement(L.A,{activeItem:e})),o?n.createElement(h.A,null):null)};var F=a(772317);const U=({activeItem:e,activeItem:{adopted:t,ip:a,ipv6:l,mac:i,config_network:r,uplink:s,sys_stats:c,displayable_version:o,uptime:m,mbb:d={},mbb_overrides:E={},wan_networkgroup:u,shortname:A}})=>n.createElement(n.Fragment,null,n.createElement(x,{activeItem:e}),u?null:n.createElement(S.A,{ip:a,adopted:t,config_network:r}),n.createElement(T.A,{sys_stats:c,ip:a,ipv6:l,mac:i,imei:d?.imei,displayable_version:o,uptime:m,eSimEid:d?.esim?.eid}),n.createElement(g.F,{sim:d?.sim,radio:d?.radio,mbb_overrides:E}),s?.mac?n.createElement(O.A,{type:O.I.ACCORDION,items:[{id:"uplink",openByDefault:!0,label:n.createElement(y.A,{id:"COMMON_PARENT_DEVICE"}),renderContent:()=>n.createElement(M.A,{activeItem:e})}]}):null,n.createElement(F.A,{shortname:A})),X=({activeItem:e})=>(0,l.RS)(e)?n.createElement(D,{activeItem:e}):n.createElement(U,{activeItem:e})}}]);