"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[96168],{169568:(e,t,n)=>{var a;n.d(t,{v:()=>a}),function(e){e.SETTINGS_WIFI="settingsWifi",e.SETTINGS_NETWORKS="settingsNetworks",e.SETTINGS_INTERNET="settingsInternet",e.SETTINGS_TELEPORT="settingsTeleport",e.SETTINGS_VPN="settingsVpn",e.SETTINGS_UID_VPN="settingsUidVpn",e.SETTING_ROUTING="settingsRouting",e.SETTINGS_SECURITY="settingsSecurity",e.SETTINGS_ETHERNET_PORTS="settingsEthernetPorts",e.SETTINGS_WIFI_SPEED_LIMIT_PROFILES="settingsWifiSpeedLimitProfiles",e.SETTINGS_RADIUS="settingsRadius",e.NETWORK_OBJECTS="settingsNetworkObjects",e.SETTINGS_PROFILES="settingsProfiles",e.SETTINGS_VPN_CLIENT="vpnClient",e.SETTINGS_CONTENT_FILTER="settingsContentFilter",e.SETTINGS_POLICY="settingsPolicy",e.SETTINGS_POLICY_ACL="settingsPolicyAcl",e.SETTINGS_POLICY_QOS="settingsPolicyQos",e.SETTINGS_POLICY_NAT="settingsPolicyNat",e.SETTINGS_POLICY_DNS="settingsPolicyDns",e.SETTINGS_POLICY_PORT_FORWARDING="settingsPolicyPortForwarding",e.SETTINGS_POLICY_FIREWALL="settingsPolicyFirewall",e.SETTINGS_POLICY_ROUTE="settingsPolicyRoute"}(a||(a={}))},176716:(e,t,n)=>{n.d(t,{X:()=>E});var a,l=n(469733),i=n(296540),o=n(699784),r=n(490454),s=n(522373),d=n(867609),c=n(198494);!function(e){e.IS_SUBSCRIBED="isSubscribed",e.IS_AVAILABLE="isAvailable",e.UNAVAILABILITY_REASON="unavailabilityReason",e.REDIRECT="redirect"}(a||(a={}));const E=()=>{const{formatMessage:e}=(0,o.tz)(),t=(0,l.useSelector)(r.AF),n=(0,l.useSelector)(s.N),E=n?.subscriptionState?.status,S=E?n?.subscriptionState?.status===d.xN.SUBSCRIBED:!!t,u=n?.[d.Ov.SUBSCRIPTION_STATE]?.[d.mE.STATUS],A=n?.[d.Ov.SUBSCRIPTION_STATE]?.[d.mE.MESSAGE],T=(0,l.useSelector)(c.IG),m=(0,i.useMemo)(()=>n?.[d.Ov.OPEN_MODAL],[n]);return(0,i.useMemo)(()=>u?{[a.IS_SUBSCRIBED]:S,[a.IS_AVAILABLE]:u===d.xN.AVAILABLE,[a.UNAVAILABILITY_REASON]:A,[a.REDIRECT]:m}:{[a.IS_SUBSCRIBED]:S,[a.IS_AVAILABLE]:T,[a.UNAVAILABILITY_REASON]:T?void 0:e({id:"SETTINGS_WAN_MAGIC_NOT_OWNER_DESCRIPTION"}),[a.REDIRECT]:m},[u,S,A,m,T,e])}},263130:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(296540),l=n(927099),i=n(71479),o=n(998837),r=n(566723),s=n(294303);const d=(0,i.A)(l.A)`
  line-height: 20px;
`,c=({icon:e,description:t,action:n,footer:l,background:i,...c})=>{const E=(0,o.u)().motifPalette.neutral01;return a.createElement(s.A,{flexGrow:1,borderRadius:r.YC,padding:r.kc,background:i||E,gap:r.kc,flexDirection:"column",...c},a.createElement(s.A,{flexGrow:1,gap:r.kc},e,t?a.createElement(d,{size:"body"},t):null,n?a.createElement(s.A,{marginLeft:"auto"},a.createElement(d,{size:"body"},n)):null),l)}},464729:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ie});var a=n(469733),l=n(296540),i=n(720903),o=n(255905),r=n(963070),s=n(758649),d=n(217439),c=n(915462),E=n(71479),S=n(367032),u=n(176716),A=n(566723),T=n(823084),m=n(294303),I=n(126457),p=n(699784),N=n(273640),_=n(490454),g=n(439141),O=n(617147),h=n(130851),C=n(765562);const f=(0,E.A)("img")`
  width: 100%;
  height: 100%;
  object-fit: cover;
`,P=(0,E.A)("div")`
  position: absolute;

  /* ensure positioning regardless of parent flex settings */
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;

  /* prevent interaction */
  pointer-events: none;

  /* important */
  container-type: size;

  /* cut off overflowing video */
  overflow: hidden;

  & > video {
    position: absolute;
    /* keep video centered both vertically and horizontally */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    height: 100%;

    /* force aspect ratio based on parent container */
    @container (min-aspect-ratio: 16/9) {
      height: 56.25cqw;
    }

    @container (max-aspect-ratio: 16/9) {
      width: 177.78cqh;
    }

    /* prevent interaction */
    pointer-events: none;
  }
`,w=({useVideo:e=!1})=>{const t=(0,a.useSelector)(h.p);return e?l.createElement(P,null,l.createElement("video",{autoPlay:!0,muted:!0,loop:!0,src:C.A.wanMagicSpeedtestBackgroundClip})):l.createElement(f,{src:`${t}/wanMagicSpeedtestBackground.jpg`,alt:"WanMagic Speedtest Background Image"})},R=({children:e})=>l.createElement(O.A,{isOpen:!0,flushContent:!0,size:"full",style:{overlay:{alignItems:"flex-start",justifyContent:"flex-start",background:"none",top:"50px",left:"270px"},content:{height:"100%",maxHeight:"100%",borderRadius:0,boxShadow:"none",width:"100%",maxWidth:"unset"}}},l.createElement(m.A,{width:"100%",height:"100%",position:"absolute",overflow:"hidden"},l.createElement(w,{useVideo:!0})),e);var L=n(822336),G=n(994374),v=n(543678),M=n(53509),k=n(137298),b=n(121942),D=n(573531);const y=(0,E.A)(m.A)`
  color: ${({theme:{themeName:e}})=>L.Ay[`desktop-color-aqua-06-${e}`]};
  align-items: center;
`,x=(0,E.A)(m.A)`
  color: ${({theme:{themeName:e}})=>L.Ay[`desktop-color-purple-06-${e}`]};
  align-items: center;
`,B=({upload:e,download:t,size:n,isBold:a,isCompleted:i})=>{const o=(0,b.A)(e),r=(0,b.A)(t),s=i||e?t:r,c=i?e:o;return l.createElement(m.A,{alignItems:"center",justifyContent:"center",gap:"large"===n?A.Er:A.YC,inline:!0},l.createElement(y,null,l.createElement(M.A,null),l.createElement(d.A,{size:n,color:"inherit",weight:a?"bold":"regular"},s?(0,k.zX)(s).toString():D.L)),l.createElement(x,null,l.createElement(v.A,null),l.createElement(d.A,{size:n,color:"inherit",weight:a?"bold":"regular"},c?(0,k.zX)(c).toString():D.L)))};var F=n(429252),U=n.n(F),W=n(371715),V=n(254292),Y=n(255292),z=n(299423),j=n(769385),$=n(631863);var H;!function(e){e.INITIAL="initial",e.IN_PROGRESS="inProgress",e.FINISHED="finished"}(H||(H={}));var K;!function(e){e.STEP_1="testing",e.STEP_2="evaluating",e.STEP_3="finished"}(K||(K={}));const q={[K.STEP_1]:"SETTINGS_WAN_MAGIC_SPEEDTEST_TESTING_TITLE",[K.STEP_2]:"SETTINGS_WAN_MAGIC_SPEEDTEST_TESTING_TITLE",[K.STEP_3]:"SPEED_TEST_FINISHED"},X=[{id:"ispName",label:l.createElement(p.sA,{id:"COMMON_ISP"}),renderCell:({ispAsn:e,ispName:t})=>l.createElement($.A,{ispAsn:e,ispName:t}),minWidth:126,maxWidth:126},{id:"download",label:l.createElement(p.sA,{id:"COMMON_SPEED"}),renderCell:({download:e,upload:t,isCompleted:n,hasStarted:a,isBeingProcessed:i,hasFailed:o})=>{if(!i&&n){if(o)return l.createElement("span",null,l.createElement(p.sA,{id:"COMMON_FAILED"}));if(!e||!t)return l.createElement("span",null,l.createElement(p.sA,{id:"COMMON_SKIPPED"}))}return!i||a||e||t?l.createElement(B,{isCompleted:n,download:e,upload:t,size:"medium",isBold:!0}):l.createElement("span",null,l.createElement(p.sA,{id:"COMMON_CONNECTING"}),"...")},minWidth:180},{id:"latency",label:l.createElement(p.sA,{id:"COMMON_LATENCY"}),minWidth:70,maxWidth:70,renderCell:({latency:e})=>Number.isFinite(e)||e>=0?l.createElement(p.sA,{id:"COMMON_UNIT_MILLISECONDS_SHORT",values:{value:e>0?e:"<1"}}):l.createElement(p.sA,{id:"COMMON_FALLBACK"})}],J=({onUpdate:e,delayStart:t,wanNetworkGroups:n})=>{const i=(0,a.useSelector)(V.mi),o=(0,a.useSelector)(V.xc),r=(0,a.useSelector)(V.oE),s=(0,a.useDispatch)(),[d,c]=(0,l.useState)(H.INITIAL),[E,S]=(0,l.useState)(),[u,A]=(0,l.useState)(0),[T,m]=(0,l.useState)(0),[I,p]=(0,l.useState)(0),[N,_]=(0,l.useState)(!1),[g,O]=(0,l.useState)(null),h=(0,l.useCallback)(()=>{c(H.INITIAL),_(!1),S(void 0),A(0),m(0),p(0),O(null)},[]),C=(0,l.useCallback)(()=>{n&&s((0,Y.D1)(n)),c(H.IN_PROGRESS)},[s,n]);(0,l.useEffect)(()=>{if(t)return;const n={download:T,upload:I,latency:u,hasStarted:d!==H.INITIAL&&!!u,isFinished:d===H.FINISHED,hasFailed:N};U()(n,E)||(S(n),e(n))},[t,T,N,e,u,E,d,I]);const f=(0,l.useCallback)(()=>{t||(r?.ping&&A(r.ping),r?.download&&m(r.download),r?.upload&&p(r.upload),!g&&i?.server&&O(i.server))},[t,r,i.server,g]),P=(0,l.useCallback)(()=>{o!==j.H$.FAILED&&o!==j.H$.TIMEOUT||(s((0,W.lB)(z.MODEL)),_(!0),N||setTimeout(()=>{c(H.FINISHED)},1e3)),o!==j.H$.IN_PROGRESS&&i.xput_download&&i.xput_upload&&d===H.IN_PROGRESS&&(s((0,W.lB)(z.MODEL)),setTimeout(()=>{c(H.FINISHED)},1e3))},[s,i.xput_download,i.xput_upload,o,d,N]);return(0,l.useEffect)(()=>{t||(d===H.INITIAL&&o!==j.H$.IN_PROGRESS?C():d===H.IN_PROGRESS&&(f(),P()))},[f,C,d,t,P,o]),{state:d,ping:u,downloadSpeed:T,uploadSpeed:I,downloadData:r,server:g,onReset:h}},Q=(0,E.A)(m.A)`
  flex-direction: column;
  width: 100%;

  [class*='container'] {
    min-height: unset;
  }

  [class*='speedValue'] {
    display: none;
  }
`;var Z;!function(e){e.SPEEDTEST="speedtest",e.SKIP="skipped",e.ERROR="error"}(Z||(Z={}));const ee=({onUpdate:e,delayStart:t,wanNetworkGroups:n,isFinished:a})=>{const[i,o]=(0,l.useState)(null),r=(0,l.useCallback)(t=>{e(t),o(t)},[e]),s=t||a,{ping:c,uploadSpeed:E,downloadSpeed:S,downloadData:u,state:T}=J({wanNetworkGroups:n,onUpdate:r,delayStart:s}),I=T===H.FINISHED||a,N=(0,l.useMemo)(()=>I&&i?.hasFailed?Z.ERROR:!I||i?.download&&i?.upload?Z.SPEEDTEST:Z.SKIP,[I,i?.hasFailed,i?.download,i?.upload]);return l.createElement(Q,{gap:A.Ln,justifyContent:"flex-end",flex:1},l.createElement(m.A,{flexDirection:"column",alignItems:"center",gap:A.kc,flex:1,justifyContent:"center"},l.createElement(m.A,{flexDirection:"column",gap:A.Ln,alignItems:"center"},l.createElement(d.A,{color:"text-2"},l.createElement(p.sA,{id:a?"SETTINGS_WAN_MAGIC_SPEEDTEST_AGGREGATED_SPEEDS":"SETTINGS_WAN_MAGIC_SPEEDTEST_AGGREGATING_DOWNLOAD_SPEEDS"})),l.createElement(m.A,{flexDirection:"column",justifyContent:"center",alignItems:"center",gap:A.YC},N===Z.SPEEDTEST?l.createElement(B,{isCompleted:I,upload:E,download:S,size:"medium",isBold:!0}):null,N===Z.SKIP?l.createElement(d.A,{color:"text-2",size:"medium"},l.createElement(p.sA,{id:"COMMON_SKIPPED"})):null,N===Z.ERROR?l.createElement(d.A,{color:"text-2",size:"medium"},l.createElement(p.sA,{id:"COMMON_FAILED"})):null,l.createElement(m.A,{justifyContent:"center",gap:A.YC},l.createElement(d.A,{color:"text-3",size:"small"},l.createElement(p.sA,{id:"COMMON_LATENCY"}),":"),l.createElement(d.A,{weight:"bold",size:"small",motif:"dark"},l.createElement(p.sA,{id:"COMMON_UNIT_MILLISECONDS_SHORT",values:{value:c}})))),I?l.createElement(m.A,{justifyContent:"center",textAlign:"center",maxWidth:"80%"},l.createElement(d.A,{color:"text-2",motif:"dark"},l.createElement(p.sA,{id:"SETTINGS_WAN_MAGIC_SPEEDTEST_TEST_RESULT_MESSAGE"}))):null)),l.createElement(m.A,{position:"relative",height:"120px",width:"100%",marginBottom:A.fS},l.createElement(G.A,{speedTestData:!s&&u||{download:null,upload:null,ping:null},xDuration:5e3,animationBuffer:500,lineStyle:{download:{alpha:1,color:{dark:L.Ay["desktop-color-aqua-06-dark"],light:L.Ay["desktop-color-aqua-06-light"]},isVisible:!0,width:1},upload:{alpha:1,color:{dark:L.Ay["desktop-color-purple-06-dark"],light:L.Ay["desktop-color-purple-06-light"]},isVisible:!0,width:1}},gradientColor:{upload:[{offset:0,color:{light:"hsla(273,72%,61%,0.5)",dark:"hsla(273,72%,61%,0.5)"}},{offset:1,color:{light:"hsla(198,98%,61%,0)",dark:"hsla(198,98%,61%,0)"}}],download:[{offset:0,color:{light:"hsla(198,98%,61%,0.5)",dark:"hsla(198,98%,61%,0.5)"}},{offset:1,color:{light:"hsla(198,98%,61%,0)",dark:"hsla(198,98%,61%,0)"}}]},motif:"dark"})))},te=({onUpdate:e,wansToSpeedTest:t,delayStart:n=!1})=>{const a=(0,l.useMemo)(()=>t.find(e=>!e.isCompleted)?.wanNetworkGroup||t[t.length-1]?.wanNetworkGroup,[t]),{onReset:i}=J({delayStart:n||t.every(e=>e.isCompleted),wanNetworkGroups:a?[a]:[],onUpdate:t=>{e(a,t),t.isFinished&&i()}})},ne="rgba(0,0,0,0.5)",ae=(0,E.A)(m.A)`
  flex-direction: column;
  overflow-y: hidden;
  backdrop-filter: blur(32px);
  width: ${429}px;
  border-right: 1px solid hsla(214, 8%, 34%, 0.5);
  background: hsla(0, 0%, 0%, 0.6);
  height: 100%;
  padding: 18px ${A.Er} ${A.xO} ${A.Er};
  gap: ${A.Ln};
`,le=(0,E.A)(m.A)`
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
`,ie=({wanNetworkGroups:e})=>{const t=(0,a.useSelector)(_.AF),n=(0,a.useSelector)(N.Cy),E=(0,a.useSelector)(N.jb),[O,h]=(0,l.useState)({}),[C,f]=(0,l.useState)(t?K.STEP_2:K.STEP_1),[P,w]=(0,l.useState)(!1),L=(0,a.useDispatch)(),{redirect:G,isSubscribed:v}=(0,u.X)(),M=(0,a.useSelector)(_.Sl),[k]=(0,l.useState)((0,i.A)(t?E:n)),b=(0,l.useMemo)(()=>Object.values(O).filter(e=>e.isFinished).length,[O]),D=(0,l.useMemo)(()=>k.filter(n=>!e||t&&e.includes(n.wanNetworkGroup)).map(({id:e,name:n,ispName:a,ispAsn:l,wanNetworkGroup:i},o)=>{const r=O[i];return{id:e,name:n,ispName:a,ispAsn:l,wanNetworkGroup:i,download:r?.hasStarted?r?.download:void 0,upload:r?.hasStarted?r?.upload:void 0,latency:r?.hasStarted?r?.latency:void 0,isBeingProcessed:b===o,isCompleted:t||r?.isFinished,hasStarted:!!r?.hasStarted,hasFailed:!!r?.hasFailed}}),[k,e,t,O,b]),y=(0,l.useCallback)((e,t)=>{P||h(n=>({...n,[e]:t}))},[P]),x=b===D.length;te({wansToSpeedTest:D,onUpdate:y,delayStart:t}),(0,l.useEffect)(()=>{t&&D.forEach(e=>{y(e.id,{isFinished:!0})})},[t,y,D]),(0,l.useEffect)(()=>{P?f(K.STEP_3):b===D.length?f(K.STEP_2):f(K.STEP_1)},[b,P,t,y,O,D,D.length]);const B=(0,l.useCallback)(()=>{w(!0),h(e=>Object.fromEntries(D.map(({wanNetworkGroup:t})=>{const n=e[t]||{};return n.isFinished?[t,n]:[t,{...n,isFinished:!0}]})))},[D]);return D.length>0?l.createElement(R,null,l.createElement(ae,null,l.createElement(o.A.Provider,{value:S.J},l.createElement(c.A.Provider,{value:S.J},l.createElement(m.A,{flexDirection:"column",gap:A.kc},l.createElement(d.A,{weight:"bold",color:"text-1"},l.createElement(p.sA,{id:q[C]})),l.createElement(T.A,{background:ne},l.createElement(p.sA,{id:"SETTINGS_WAN_MAGIC_CONTINUOUSLY_IMPROVING"})),t?null:l.createElement(m.A,{flex:"1",background:ne,borderRadius:6,padding:`0 ${A.YC}`},l.createElement(r.A,{idField:"id",disableColumnFilters:!0,items:D,columns:X}))),l.createElement(le,null,x?l.createElement(ee,{wanNetworkGroups:D.map(({wanNetworkGroup:e})=>e),ispNames:D.map(({ispName:e})=>e),onUpdate:e=>{e?.isFinished&&w(!0)},isFinished:P}):null),l.createElement(m.A,{justifyContent:"space-between",alignItems:"center"},P||v?l.createElement("div",null):l.createElement(s.A,{onClick:B,variant:"link"},l.createElement(p.sA,{id:"COMMON_ACTION_SKIP"})),l.createElement(m.A,{gap:A.kc},l.createElement(s.A,{type:"button",variant:"tertiary",onClick:()=>{L((0,I.AS)())}},P?l.createElement(p.sA,{id:"COMMON_ACTION_CLOSE"}):l.createElement(p.sA,{id:"COMMON_ACTION_CANCEL"})),v?null:l.createElement(s.A,{type:"button",variant:"primary",disabled:!P,onClick:()=>{G(),L((0,I.AS)()),L((0,g.Zy)({...M,enabled:!1,wan_networkgroup:D.map(({wanNetworkGroup:e})=>e)}))}},l.createElement(p.sA,{id:"COMMON_SUBSCRIBE"})))))))):null}},522373:(e,t,n)=>{n.d(t,{N:()=>s});var a=n(801081),l=n(874807),i=n(187483),o=n(448547),r=n(867609);const s=(0,a.Mz)(i.nx,e=>e[o.Y7.WAN_MAGIC_ADAPTER]||{[r.Ov.SUBSCRIPTION_STATE]:{[r.mE.STATUS]:void 0,[r.mE.MESSAGE]:void 0},[r.Ov.ADD_SUBSCRIPTION_STATE_LISTENER]:l.P1,[r.Ov.REMOVE_SUBSCRIPTION_STATE_LISTENER]:l.P1,[r.Ov.OPEN_MODAL]:l.P1,[r.Ov.CLOSE_MODAL]:l.P1})},631863:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(296540),l=n(566723),i=n(115829),o=n(568777),r=n(294303),s=n(699784);const d=({ispAsn:e,ispName:t})=>t?a.createElement(r.A,{gap:l.YC,width:"100%",alignItems:"center"},a.createElement(o.A,{asn:e,name:t,useFallback:!0,style:{userSelect:"none",objectFit:"contain",width:"20px",height:"20px"}}),a.createElement(i.A,{flexProps:{alignItems:"center"}},t)):a.createElement(s.sA,{id:"COMMON_FALLBACK"})},823084:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(296540),l=n(162420),i=n(998837),o=n(263130);const r=({children:e,icon:t,background:n,...r})=>{const{motifPalette:{uBlue06:s}}=(0,i.u)();return a.createElement(o.A,{icon:t||a.createElement(l.A,{variant:"fill",size:"original",color:s}),description:e,background:n,...r})}},867609:(e,t,n)=>{var a,l,i;n.d(t,{Ov:()=>i,mE:()=>a,xN:()=>l}),function(e){e.STATUS="status",e.MESSAGE="message"}(a||(a={})),function(e){e.AVAILABLE="available",e.NOT_AVAILABLE="not_available",e.SUBSCRIBED="subscribed"}(l||(l={})),function(e){e.SUBSCRIPTION_STATE="subscriptionState",e.ADD_SUBSCRIPTION_STATE_LISTENER="addSubscriptionStateListener",e.REMOVE_SUBSCRIPTION_STATE_LISTENER="removeSubscriptionStateListener",e.OPEN_MODAL="openModal",e.CLOSE_MODAL="closeModal"}(i||(i={}))}}]);