"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[52668],{688684(e,i,t){t.d(i,{A:()=>r});var n=t(602086),s=t(141992);const r=(0,t(272338).w)(e=>(0,n.createElement)("svg",(0,s.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("rect",{x:3,y:5,width:12,height:12,rx:1,fill:"currentColor",className:e.twotonedclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 4H16v9.5a.5.5 0 0 0 1 0V4a1 1 0 0 0-1-1H6.5a.5.5 0 0 0 0 1ZM4 6h10v10H4V6ZM3 6a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 4H16v9.5a.5.5 0 0 0 1 0V4a1 1 0 0 0-1-1H6.5a.5.5 0 0 0 0 1ZM4 5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H4Z",fill:"currentColor",className:e.fillclassname})))},347500(e,i,t){t.d(i,{A:()=>o});var n=t(274934),s=t(602086),r=t(898809),l=t(254590);const o=({startTimestamp:e,uptimeParams:i})=>{const t=(0,s.useRef)(null),o=(0,s.useRef)(null),d=(0,s.useCallback)(i=>{t.current&&(t.current.innerText=e?(0,r.Ay)(Math.floor(Date.now()/1e3)-e,i).join(" "):l.L,o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{d(i)},1e3))},[e]);return(0,s.useEffect)(()=>(e&&d(i),()=>{o.current&&clearTimeout(o.current)}),[e,i,d]),(0,n.jsx)("span",{ref:t})}},535322(e,i,t){t.d(i,{A:()=>u,I:()=>n});var n,s=t(274934),r=t(814557),l=t(158885),o=t(247816),d=t(565527),a=t(309130),c=t(100978),m=t(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const h=(0,o.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:i,theme:{themeName:t}})=>e||r.Ay[t===d.S.DARK?`desktop-color-neutral-${i?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${i?"01":"00"}-${d.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:i})=>i||(e?`0 ${a.Ln}`:a.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||a.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>r.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,x=(0,o.A)(l.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:i,theme:{themeName:t}})=>e||r.Ay[t===d.S.DARK?`desktop-color-neutral-${i?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${i?"01":"00"}-${d.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:i})=>i||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:i}})=>e||r.Ay[i===d.S.DARK?`desktop-color-neutral-01-${d.S.DARK}`:`desktop-color-neutral-00-${d.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${a.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${a.Ln} ${a.Ln};
      }
    }
  }
`,u=({type:e,marginBottom:i,margin:t,padding:r,flex:l,width:o,nested:d,...a})=>"items"in a?(0,s.jsx)(x,{marginBottom:i,margin:t,padding:r,flex:l,nested:d,...a}):(0,s.jsx)(h,{nested:d,width:o,marginBottom:i,margin:t,padding:r,flex:l,isButtonList:e===n.BUTTON_LIST,...a,children:a.children})},652668(e,i,t){t.r(i),t.d(i,{default:()=>I});var n=t(274934),s=t(602086),r=t(938984),l=t(977872),o=t(954702),d=t(853777),a=t(878151),c=t(237725),m=t(688684),h=t(669439),x=t(535322),u=t(664092),A=t(470070),g=t(43506),p=t(969288),j=t(223597),N=t(712874),C=t(449339),b=t(205521),k=t(86635),f=t(347500),M=t(119425),O=t(898809),_=t(309130),T=t(421314),$=t(100978),E=t(316628),v=t(247816);const R=(0,v.A)($.A)`
  flex-direction: column;
`,S=(0,v.A)($.A)`
  flex-direction: column;
`,w=(0,v.A)($.A)`
  flex-direction: column;
  gap: ${_.YC};
`,I=({activeItem:{vpn_type:e,network_name:i,network_id:t,ip:v,remote_ip:I,ipv6:L,usage_bytes:y,country_code:z,assoc_time:P,last_seen:D,status:V}})=>{const B=(0,c.W6)(),H=(0,l.wA)(),W=(0,g.A)(p.Hp),G=(0,s.useCallback)(()=>{H((0,b.XP)({type:C.H.VPN_SERVER,id:t}))},[H,t]),U=(0,s.useCallback)(()=>{B.push(W),setTimeout(G,250)},[B,W,G]),K=(0,E.A)(),Y=(0,s.useCallback)(()=>{K(I)},[K,I]),Z=(0,s.useCallback)(()=>{K(v)},[K,v]),F=(0,s.useCallback)(e=>()=>{K(e)},[K]);return(0,n.jsxs)(R,{children:[(0,n.jsx)(x.A,{children:(0,n.jsxs)(S,{children:[(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_CONNECTION"})}),(0,n.jsx)(r.A,{color:"text-3",size:"medium",children:(0,n.jsx)(A.sA,{id:e&&N.k[e]||"COMMON_VPN"})})]}),v?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_IPV4_ADDRESS"})}),(0,n.jsxs)($.A,{alignItems:"center",children:[(0,n.jsx)(r.A,{color:"text-3",size:"medium",isTruncated:!0,children:v}),(0,n.jsx)(m.A,{size:"original",actionable:!0,onClick:Z})]})]}):null,L.length?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_IPV6_ADDRESS"})}),(0,n.jsx)(r.A,{color:"text-3",size:"medium",isTruncated:!0,children:1===L.length?(0,n.jsxs)($.A,{alignItems:"center",children:[(0,n.jsx)(r.A,{color:"inherit",size:"medium",children:L[0]}),(0,n.jsx)(m.A,{size:"original",actionable:!0,onClick:F(L[0])})]}):(0,n.jsx)(h.A,{description:(0,n.jsx)(w,{children:L.map(e=>(0,n.jsxs)($.A,{alignItems:"center",gap:_.YC,children:[e,(0,n.jsx)(m.A,{size:"original",actionable:!0,onClick:F(e)})]},e))}),children:(0,n.jsx)("span",{children:(0,n.jsx)(d.A,{isActive:!0,size:"original"})})})})]}):null,I?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"CLIENTS_REMOTE_ADDRESS"})}),(0,n.jsxs)($.A,{children:[(0,n.jsxs)($.A,{alignItems:"center",maxWidth:"100%",children:[(0,n.jsx)(T.A,{color:"text-3",size:"medium",children:I}),(0,n.jsx)(m.A,{size:"original",actionable:!0,onClick:Y})]}),z?(0,n.jsx)(h.A,{description:(0,n.jsx)(A.sA,{id:`COUNTRY_${z.toUpperCase()}`}),children:(0,n.jsx)("span",{children:(0,n.jsx)(k.A,{style:{marginLeft:_.YC},countryCode:z,width:16,height:16})})}):null]})]}):null,i?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_NETWORK"})}),(0,n.jsx)(o.A,{style:{whiteSpace:"nowrap"},type:"button",fontSize:"medium",onClick:G,children:(0,n.jsx)(r.A,{color:"inherit",size:"inherit",isTruncated:!0,children:i})})]}):null,Number.isFinite(y)?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_24H_INTERNET_ACTIVITY"})}),(0,n.jsx)(r.A,{color:"text-3",size:"medium",children:(0,n.jsx)(a.A,{color:"inherit",size:"body",type:"bytes",input:y})})]}):null,V===j.S2.ONLINE&&Number.isInteger(P)?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_UPTIME"})}),(0,n.jsx)(r.A,{color:"text-3",size:"medium",children:(0,n.jsx)(f.A,{startTimestamp:P})})]}):V===j.S2.OFFLINE&&Number.isInteger(D)?(0,n.jsxs)(u.A,{children:[(0,n.jsx)(r.A,{color:"text-2",size:"medium",children:(0,n.jsx)(A.sA,{id:"COMMON_LAST_SEEN"})}),(0,n.jsx)(r.A,{color:"text-3",size:"medium",children:(0,n.jsx)(M.A,{date:(0,O.gH)(D)})})]}):null]})}),(0,n.jsx)(x.A,{children:(0,n.jsx)(u.A,{flexProps:{alignItems:"center"},children:(0,n.jsx)(o.A,{fontSize:"medium",type:"button",onClick:U,children:(0,n.jsx)(A.sA,{id:"CLIENTS_VPN_SETTINGS"})})})})]})}},664092(e,i,t){t.d(i,{A:()=>a});var n=t(274934),s=t(247816),r=t(309130),l=t(100978),o=t(291508);const d=(0,s.A)(l.A,(0,o.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${r.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,a=({children:e,valueMaxWidth:i=215,keyMinWidth:t=0,flexProps:s={},compact:l=!1})=>(0,n.jsx)(d,{width:"100%",justifyContent:"space-between",gap:r.kc,height:l?void 0:24,valueMaxWidth:i,keyMinWidth:t,compact:l,...s,children:e})},316628(e,i,t){t.d(i,{A:()=>o});var n=t(602086),s=t(977872),r=t(700444),l=t(159469);const o=()=>{const e=(0,s.wA)();return(0,n.useCallback)(i=>null!=i?navigator.clipboard.writeText(i.toString()).then(()=>{e((0,r.ox)({icon:l.C.success,message:"COMMON_COPIED_TO_CLIPBOARD",duration:1e3}))}):Promise.resolve(),[e])}},712874(e,i,t){t.d(i,{k:()=>s});var n=t(794721);const s={[n.G.PPTP_SERVER]:"COMMON_PPTP",[n.G.L2TP_SERVER]:"COMMON_L2TP",[n.G.WIREGUARD_SERVER]:"COMMON_WIREGUARD",[n.G.OPEN_VPN_SERVER]:"COMMON_OPEN_VPN"}}}]);