"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[16324],{889702(s,e,i){var r;i.d(e,{S:()=>r}),function(s){s.API_DEVICE_ADOPT="API_DEVICE_ADOPT",s.API_DEVICE_RESTART="API_DEVICE_RESTART",s.API_WIDGET_OS_STATS="API_WIDGET_OS_STATS"}(r||(r={}))},952566(s,e,i){i.d(e,{p:()=>c});var r=i(222102),t=i(591256),a=i(897166),n=i(570801),d=i(889702);const c=s=>(0,r.Mz)(a.ah,t.pw,a.dK,n.fR,(e,i,r,t)=>{switch(s){case d.S.API_DEVICE_ADOPT:case d.S.API_DEVICE_RESTART:return r||e.includes(s);case d.S.API_WIDGET_OS_STATS:return t||i.includes(s);default:return r}})},496953(s,e,i){i.d(e,{A:()=>C});var r=i(274934),t=i(602086),a=i(977872),n=i(762705),d=i(309130),c=i(470070),l=i(952566),o=i(889702),m=i(469890),x=i(956978),_=i(434521),I=i(45978),A=i(795206),j=i(963428),E=i(146215),N=i(100978);const p=({device:s,disabled:e,confirmTitle:i,confirmMessage:p,confirmButtonMessage:C,hidePoe:S,customName:T,unit_id:h})=>{const u=(0,a.wA)(),R=(0,a.d4)((0,l.p)(o.S.API_DEVICE_RESTART)),[O,D]=(0,t.useState)(!1),g=T||s.name||s.mac,M=(0,x.Tbi)(s)&&(0,m.b0)(s.port_table),G=(0,_.S9)(s),y=G!==I.g.CONNECTED&&G!==I.g.RFSCANNING,U=M||(0,x.moU)(s)||!s.bypassConfirmRestart,v=(0,t.useCallback)(()=>{u((0,A.CP)(s,O?"hard":"soft",h))},[u,s,O,h]);return R?(0,r.jsx)(E.A,{title:(0,r.jsx)(c.sA,{id:i||"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",values:{deviceName:g}}),message:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.sA,{id:p||"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",values:{deviceName:g}}),M&&!S?(0,r.jsx)(N.A,{paddingTop:d.kc,children:(0,r.jsx)(n.A,{checked:O,id:"hardReboot",onChange:()=>{D(s=>!s)},children:(0,r.jsx)(c.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"})})}):null]}),confirmButtonLabel:C||"DEVICE_ACTIONS_RESTART",confirmButtonVariant:"destructive",onConfirm:v,trigger:U?(0,r.jsx)(j.A,{isDisabled:y||e,children:(0,r.jsx)(c.sA,{id:"DEVICE_ACTIONS_RESTART"})}):null}):null},C=(0,t.memo)(({device:s,disabled:e,confirmTitle:i,confirmMessage:t,confirmButtonMessage:a,hidePoe:n,customName:d,unit_id:c})=>(0,r.jsx)(p,{device:s,disabled:e,confirmTitle:i,confirmMessage:t,confirmButtonMessage:a,hidePoe:n,customName:d,unit_id:c}))},728380(s,e,i){i.d(e,{i:()=>h,A:()=>u});var r=i(274934),t=i(602086),a=i(977872),n=i(762705),d=i(309130),c=i(250266),l=i(100978),o=i(470070),m=i(952566),x=i(889702),_=i(469890),I=i(956978),A=i(45978),j=i(795206),E=i(347625),N=i(496953),p=i(247816),C=i(648576);const S=(0,p.A)(C.Ay)`
  padding: 0;
`,T=({device:s,isConfirmOpen:e,setIsConfirmOpen:i,disabled:m})=>{const x=(0,a.wA)(),[N,p]=(0,t.useState)(!1),C=(0,t.useMemo)(()=>(0,E.Q)({name:s.name,model:s.model,mac:s.mac}),[s.name,s.model,s.mac]),T=(0,t.useMemo)(()=>(0,I.Tbi)({type:s.type})&&(0,_.b0)(s.port_table),[s.type,s.port_table]),h=(0,t.useMemo)(()=>s.deviceState!==A.g.CONNECTED&&s.deviceState!==A.g.RFSCANNING,[s.deviceState]),u=(0,t.useCallback)(()=>{x((0,j.CP)({name:s.name,model:s.model,mac:s.mac},N?"hard":"soft"))},[x,s.name,s.model,s.mac,N]),R=(0,t.useCallback)(()=>{i(!1)},[i]),O=(0,t.useCallback)(()=>{p(s=>!s)},[]),D=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),T||(0,I.moU)({type:s.type,model:s.model,device_mode_override:s.device_mode_override})||!s.bypassConfirmRestart?i(!0):x((0,j.CP)({name:s.name,model:s.model,mac:s.mac}))},[x,T,s.bypassConfirmRestart,i,s.type,s.model,s.device_mode_override,s.name,s.mac]);return(0,r.jsx)(c.A,{isOpen:e,title:"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",titleValues:{deviceName:C},message:"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",messageValues:{deviceName:C},...T?{body:(0,r.jsx)(l.A,{paddingTop:d.kc,children:(0,r.jsx)(n.A,{checked:N,id:"hardReboot",onChange:O,children:(0,r.jsx)(o.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"})})})}:{},buttonMessage:"DEVICE_ACTIONS_RESTART",buttonVariant:"danger",handleConfirm:u,handleClose:R,offset:-1,children:(0,r.jsx)(S,{variant:"link",onClick:D,disabled:h||m,children:(0,r.jsx)(o.sA,{id:"DEVICE_ACTIONS_RESTART"})})})},h=s=>(0,a.d4)((0,t.useMemo)(()=>(0,m.p)(x.S.API_DEVICE_RESTART),[]))?(0,r.jsx)(T,{...s}):null,u=(0,t.memo)(({device:s,disabled:e})=>(0,r.jsx)(N.A,{device:s,disabled:e}))},963428(s,e,i){i.d(e,{A:()=>o});var r=i(274934),t=i(977872),a=i(602086),n=i(954702),d=i(669439),c=i(897166),l=i(100978);const o=(0,a.forwardRef)(({allowReadOnly:s,disabledReason:e,...i},a)=>{const o=(0,t.d4)(c.EL)&&!s;return(0,r.jsx)(l.A,{alignItems:"center",children:(0,r.jsx)(d.A,{description:e,placement:"left",children:(0,r.jsx)(n.A,{fontSize:"medium",type:"button",...i,isDisabled:o||i.isDisabled||!!e,ref:a})})})})},309675(s,e,i){i.d(e,{A:()=>d});var r=i(274934),t=i(814557),a=i(600191),n=i(263705);const d=s=>{const{themeName:e}=(0,n.u)();return(0,r.jsx)(a.A,{size:"original",variant:"fill",color:t.Ay[`desktop-color-orange-06-${e}`],...s})}},956350(s,e,i){i.d(e,{A:()=>l});var r=i(274934),t=i(729736),a=i(814557),n=i(263705),d=i(421314),c=i(453007);const l=({softLimit:s=0,threshold:e,used:i=0,dataFormat:l,inactive:o=!1})=>{const m=a.Ay[`desktop-color-${((s,e,i,r)=>{switch(!0){case r:return"text-4";case!s:return"text-3";case e>=s:return"red-06";case i&&e>=.01*i*s:return"orange-06";default:return"green-06"}})(s,i,e,o)}-${(0,n.u)().themeName}`];return(0,r.jsxs)(d.A,{color:o?"text-4":"text-3",size:"medium",children:[(0,r.jsx)(c.A,{colorOverride:m,children:(0,t.Ay)(i,"bytes",l)}),s>0?(0,r.jsxs)("span",{children:[" / ",(0,t.Ay)(s,"bytes",l)]}):null]})}},716324(s,e,i){i.d(e,{A:()=>ws});var r=i(274934),t=i(602086),a=i(938984),n=i(669439),d=i(309130),c=i(820510),l=i(304151),o=i(100978),m=i(470070),x=i(796282),_=i(956978),I=i(262768),A=i(687362),j=i(45978),E=i(419151),N=i(920492),p=i(814557),C=i(263705),S=i(981838),T=i(567572),h=i(769778),u=i(977872),R=i(187503),O=i(247816),D=i(513458),g=(i(421314),i(527153)),M=i(309675);const G=()=>(0,r.jsx)(r.Fragment,{children:" · "});var y=i(453007),U=i(690320),v=i(728380),V=i(754924),b=i(954702),f=i(590979),L=i(449339),P=i(589650),F=i(205521),B=i(37584);const Y=({mac:s,slot:e=A.td.SLOT_1,children:i,disabled:t})=>{const a=(0,u.wA)();return(0,r.jsx)(b.A,{...f.A.addDataTestId(f.A.TestId.SIDE_PANEL_TRIGGER),onPress:()=>{a((0,F.XP)({type:L.H.DEVICE,id:s,tab:P.BC.SETTINGS,subId:e.toString(),customData:{scrollIntoViewId:B.Bu}}))},isDisabled:t,children:i})};var W=i(811799),q=i(244081),k=i(213920),w=i(401004),H=i(724081),z=i(539453),K=i(434521);const $=({mac:s,disabled:e})=>{const i=(0,u.d4)((0,t.useMemo)(()=>(0,V.tG)(s),[s])),d=(0,K.S9)(i)===j.g.CONNECTED,c=(0,_.uod)(i)&&Boolean(i.wan_networkgroup);return(0,H.A)([(0,w.Zi)(k.B.DEVICES),(0,z.hh)(void 0,{crudCacheStrategy:{type:q.e.CACHE}})],(0,r.jsx)(n.A,{description:c?(0,r.jsx)(m.sA,{id:"DEVICE_ESIM_NOT_SUPPORTED_ON_WAN_ADOPTED_DEVICES"}):i.can_activate_esim?void 0:(0,r.jsx)(m.sA,{id:"DEVICE_ESIM_MUST_HAVE_INTERNET"}),children:(0,r.jsx)("span",{children:(0,r.jsx)(Y,{mac:s,slot:A.HY.ESIM,disabled:e||!d||!i.can_activate_esim,children:(0,r.jsx)(a.A,{size:"inherit",color:"inherit",children:(0,r.jsx)(m.sA,{id:"DEVICE_ACTIVATE_ESIM"})})})})}))};var Q;!function(s){s.DEFAULT="default",s.METERED="metered",s.WARNING="warning",s.LIMITED="limited"}(Q||(Q={}));const Z=A.G_.OPERATIONAL,J={[E.qU.SUCCESS]:"green-06",[E.qU.WARNING]:"orange-06",[E.qU.DANGER]:"red-06",[E.qU.MISSING]:"neutral-06"},X=(0,O.A)("div")`
  position: absolute;
  top: 0;
  left: -${d.YC};
  right: -${d.YC};
  bottom: 0;
  pointer-events: auto;
`,ss=(0,O.A)(o.A)`
  flex: 0 0 ${86}px;
  align-items: center;
  gap: ${d.YC};
`,es=((0,O.A)(o.A)`
  flex-direction: row;
  align-items: center;
`,(0,O.A)(o.A)`
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
`),is=(0,O.A)(o.A)`
  justify-content: end;
  flex: 1 0 auto;
  align-items: center;
  gap: ${d.YC};
`,rs=({code:s,tooltip:e})=>(0,r.jsxs)(o.A,{justifyContent:"center",alignItems:"center",position:"relative",pointerEvents:"none",flex:0,marginRight:d.kc,children:[(0,r.jsx)(D.A,{color:p.Ay[`desktop-color-${J[s]}-${(0,C.u)().themeName}`]}),(0,r.jsx)(n.A,{description:e,placement:"top start",children:(0,r.jsx)(X,{})})]}),ts=()=>(0,r.jsx)(o.A,{padding:`0 ${d.YC}`,height:16,alignItems:"center",justifyContent:"center",borderRadius:p.Ay["desktop-radius-infinity"],background:p.Ay[`desktop-color-neutral-03-${(0,C.u)().themeName}`],children:(0,r.jsx)(a.A,{color:"text-2",size:"xsmall",children:(0,r.jsx)(m.sA,{id:"COMMON_PRIMARY"})})}),as=({slot:s=A.HY.SLOT_1,disabled:e=!1,primary:i})=>(0,r.jsxs)(ss,{children:[(0,r.jsx)(T.m$,{slot:(0,I.Ff)(s),esim:s===A.HY.ESIM,weight:"bold",color:e?"text-4":"text-1"}),i?(0,r.jsx)(ts,{}):null]}),ns=({disabled:s=!1})=>(0,r.jsx)(is,{children:(0,r.jsx)(a.A,{color:s?"text-4":"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:"DEVICE_NO_SIM"})})}),ds=({signal_percent:s=0})=>(0,r.jsx)(g.A,{width:N.Rx,height:N.KN,signal_percent:s}),cs=({tooltip:s})=>(0,r.jsxs)(is,{gap:d.YC,children:[(0,r.jsx)(a.A,{color:"text-4",size:"medium",children:(0,r.jsx)(m.sA,{id:"COMMON_DISABLED"})}),s?(0,r.jsx)(l.A,{description:s}):null]}),ls=()=>(0,r.jsx)(a.A,{color:"text-2",size:"medium",children:(0,r.jsx)(m.sA,{id:"DEVICE_MBB_FAILOVER_STANDBY"})}),os=({mac:s,disabled:e=!1})=>(0,r.jsxs)(is,{gap:d.YC,children:[(0,r.jsx)($,{mac:s,disabled:e}),(0,r.jsx)(l.A,{description:(0,r.jsx)(m.sA,{id:"DEVICE_ESIM_ACTIVATION_TOOLTIP"}),disabled:e})]}),ms=({mac:s,slot:e=A.HY.SLOT_1})=>(0,r.jsx)(is,{children:(0,r.jsx)(Y,{mac:s,slot:e,children:(0,r.jsx)(m.sA,{id:"DEVICE_MBB_SETUP_REQUIRED"})})}),xs=({mac:s,slot:e=A.HY.SLOT_1,children:i})=>(0,r.jsx)(Y,{mac:s,slot:e,children:i||(0,r.jsx)(m.sA,{id:"COMMON_SETTINGS"})}),_s=({mac:s})=>{const e=(0,u.d4)((0,t.useMemo)(()=>(0,V.tG)(s),[s]));return(0,r.jsx)(v.A,{device:e})},Is=({radio:s})=>(0,r.jsxs)(is,{gap:d.YC,children:[(0,r.jsx)(a.A,{color:"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:"COMMON_CONNECTING"})}),(0,r.jsx)(ds,{signal_percent:s?.signal_percent})]}),As=({sim:s,isRemoving:e,tooltip:i,messageId:t})=>(0,r.jsxs)(is,{children:[t?(0,r.jsx)(a.A,{color:"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:t})}):null,(0,r.jsx)(n.A,{description:i,children:(0,r.jsx)("span",{children:(0,r.jsx)(W.J,{initialTime:s.display_state_elapsed,duration:(0,I.gX)(s.display_state),isRemoving:e})})})]}),js=({messageId:s,children:e,values:i})=>(0,r.jsxs)(is,{alignItems:"center",gap:d.YC,children:[(0,r.jsx)(M.A,{}),(0,r.jsxs)(o.A,{alignItems:"baseline",children:[(0,r.jsx)(a.A,{color:"text-2",size:"medium",children:(0,r.jsx)(m.sA,{id:s,values:i})}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G,{}),e]}):null]})]}),Es=({messageId:s,tooltip:e,mac:i,slot:t,children:a})=>(0,r.jsxs)(is,{alignItems:"center",gap:d.YC,children:[(0,r.jsx)(M.A,{}),(0,r.jsx)(o.A,{alignItems:"baseline",gap:d.YC,children:(0,r.jsx)(n.A,{description:e,children:(0,r.jsx)("span",{children:(0,r.jsx)(xs,{mac:i,slot:t,children:(0,r.jsx)(m.sA,{id:s})})})})}),a]}),Ns=({mac:s,slot:e=A.HY.SLOT_1})=>(0,r.jsx)(is,{alignItems:"center",gap:d.YC,children:(0,r.jsx)(Y,{mac:s,slot:e,children:(0,r.jsxs)(o.A,{gap:d.YC,children:[(0,r.jsx)(M.A,{}),(0,r.jsx)(m.sA,{id:"DEVICE_ESIM_ACTIVATION_FAILED"})]})})}),ps=()=>(0,r.jsxs)(is,{gap:d.YC,children:[(0,r.jsx)(R.A,{size:"original",color:p.Ay[`desktop-color-red-06-${(0,C.u)().themeName}`]}),(0,r.jsx)(a.A,{color:"text-2",size:"medium",children:(0,r.jsx)(m.sA,{id:"COMMON_BLOCKED"})})]}),Cs=({radio:s})=>(0,r.jsx)(N.A3,{signal_percent:s?.signal_percent,dBm:s?.rsrp??s?.rscp}),Ss=({radio:s})=>(0,r.jsxs)(is,{gap:d.YC,children:[(0,r.jsx)(a.A,{color:"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:"DEVICE_ULTE_PRO_SETUP_SEARCHING_INFO"})}),(0,r.jsx)(ds,{signal_percent:s?.signal_percent})]}),Ts=({messageId:s,sim:e})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:A.HY.ESIM}),(0,r.jsx)(As,{sim:e,messageId:s})]}),hs=({mac:s,carrier:e})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.DANGER}),(0,r.jsx)(as,{slot:A.HY.ESIM}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:e}),(0,r.jsx)(Ns,{mac:s,slot:A.HY.ESIM})]})]}),us=({slot:s})=>(0,r.jsx)(n.A,{description:(0,r.jsx)("span",{children:(0,r.jsx)(U.Gh,{slot:s})}),children:(0,r.jsx)("span",{children:(0,r.jsx)(M.A,{size:"original",color:p.Ay[`desktop-color-red-06-${(0,C.u)().themeName}`]})})}),Rs=({slot:s,resetPolicy:e,usage:i=0,softLimit:t=0})=>(0,r.jsx)(n.A,{description:(0,r.jsx)("span",{children:(0,r.jsx)(U.Tk,{slot:s,resetPolicy:e,usage:i,softLimit:t,dataFormat:"SI"})}),children:(0,r.jsx)("span",{children:(0,r.jsx)(M.A,{size:"original",color:p.Ay[`desktop-color-orange-06-${(0,C.u)().themeName}`]})})}),Os=({slot:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.MISSING}),(0,r.jsx)(as,{slot:A.HY.ESIM,disabled:!0}),(0,r.jsx)(cs,{tooltip:(0,r.jsx)(m.sA,{id:"DEVICE_MBB_ESIM_SLOT_DISABLED_TOOLTIP",values:{sim:(0,r.jsx)(T.pF,{slot:s})}})})]}),Ds=({slot:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.MISSING}),(0,r.jsx)(as,{slot:s,disabled:!0}),(0,r.jsx)(cs,{tooltip:(0,r.jsx)(m.sA,{id:"DEVICE_MBB_SLOT_N_DISABLED_TOOLTIP",values:{sim:(0,r.jsx)(T.pF,{slot:s})}})})]}),gs=({slot:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.MISSING}),(0,r.jsx)(as,{slot:s}),(0,r.jsx)(ns,{})]}),Ms=({slot:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.MISSING}),(0,r.jsx)(as,{slot:s,disabled:!0}),(0,r.jsx)(is,{})]}),Gs=({slot:s,mac:e,carrierName:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s}),(0,r.jsx)(Es,{messageId:"DEVICE_MBB_NETWORK_NOT_AUTHORIZED",tooltip:(0,r.jsxs)("span",{children:[(0,r.jsx)(m.sA,{id:"DEVICE_MBB_NETWORK_NOT_AUTHORIZED"}),". ",(0,r.jsx)(m.sA,{id:"DEVICE_MBB_NETWORK_NOT_AUTHORIZED_EXPLANATION",values:{carrier:i}})]}),mac:e,slot:s})]}),ys={[A.G_.NO_SIM]:({slot:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.MISSING}),(0,r.jsx)(as,{slot:s}),(0,r.jsx)(ns,{})]}),[A.G_.ESIM_READY_TO_ACTIVATE]:({mac:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.MISSING}),(0,r.jsx)(as,{slot:A.HY.ESIM}),(0,r.jsx)(os,{mac:s})]}),[A.G_.OPERATIONAL_METERED]:({radio:s,slot:e,primary:i,sim:{spn:t,asn:a}})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.SUCCESS}),(0,r.jsx)(as,{slot:e,primary:i}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(t),asn:a}),(0,r.jsx)(is,{children:(0,r.jsx)(Cs,{radio:s})})]})]}),[A.G_.OPERATIONAL_WARNING]:({radio:s,slot:e,sim:{spn:i,asn:t,txbytes:a,rxbytes:n},overrides:{reset_policy:d,data_soft_limit_bytes:c}})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:e}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(i),asn:t}),(0,r.jsxs)(is,{children:[(0,r.jsx)(Rs,{slot:e,resetPolicy:d,usage:(0,I.rB)({txbytes:a,rxbytes:n}),softLimit:c}),(0,r.jsx)(Cs,{radio:s})]})]})]}),[A.G_.OPERATIONAL_LIMITED]:({radio:s,slot:e,primary:i,sim:{spn:t,asn:a}})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:e,primary:i}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(t),asn:a}),(0,r.jsxs)(is,{children:[(0,r.jsx)(us,{slot:e}),(0,r.jsx)(Cs,{radio:s})]})]})]}),[A.G_.OPERATIONAL]:({sim:{spn:s,asn:e},radio:i,slot:t,primary:a})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.SUCCESS}),(0,r.jsx)(as,{slot:t,primary:a}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(s),asn:e}),(0,r.jsx)(is,{children:(0,r.jsx)(Cs,{radio:i})})]})]}),[A.G_.FAILOVER_READY_METERED]:({slot:s,sim:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s,primary:i}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(e.spn),asn:e.asn}),(0,r.jsx)(is,{children:(0,r.jsx)(ls,{})})]})]}),[A.G_.FAILOVER_READY_WARNING]:({slot:s,sim:{spn:e,asn:i,txbytes:t,rxbytes:a},primary:n,overrides:{reset_policy:d,data_soft_limit_bytes:c}})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s,primary:n}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(e),asn:i}),(0,r.jsxs)(is,{children:[(0,r.jsx)(Rs,{slot:s,resetPolicy:d,usage:(0,I.rB)({txbytes:t,rxbytes:a}),softLimit:c}),(0,r.jsx)(ls,{})]})]})]}),[A.G_.FAILOVER_READY_LIMITED]:({slot:s,sim:{spn:e,asn:i},primary:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s,primary:t}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(e),asn:i}),(0,r.jsxs)(is,{children:[(0,r.jsx)(us,{slot:s}),(0,r.jsx)(ls,{})]})]})]}),[A.G_.FAILOVER_READY]:({slot:s,sim:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.SUCCESS}),(0,r.jsx)(as,{slot:s,primary:i}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(e.spn),asn:e.asn}),(0,r.jsx)(is,{children:(0,r.jsx)(ls,{})})]})]}),[A.G_.SEARCHING]:({slot:s,primary:e,radio:i,sim:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s,primary:e}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(t.spn),asn:t.asn}),(0,r.jsx)(Ss,{radio:i})]})]}),[A.G_.SETUP_REQUIRED]:({mac:s,slot:e,sim:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:e}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(i.spn),asn:i.asn}),(0,r.jsx)(is,{children:(0,r.jsx)(ms,{mac:s,slot:e})})]})]}),[A.G_.ROAMING_FORBIDDEN]:({mac:s,sim:e,slot:i,primary:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:i,primary:t}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(e.spn),asn:e.asn}),(0,r.jsx)(Es,{messageId:"COMMON_ROAMING",mac:s,slot:i})]})]}),[A.G_.CONNECTING]:({slot:s,radio:e,primary:i,sim:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s,primary:i}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(t.spn),asn:t.asn}),(0,r.jsx)(Is,{radio:e})]})]}),[A.G_.READING_SIM_DATA]:({slot:s,sim:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:s,primary:i}),(0,r.jsxs)(es,{children:[(0,r.jsx)(h.R,{carrier:(0,I.ap)(e.spn),asn:e.asn}),(0,r.jsx)(is,{children:(0,r.jsx)(As,{sim:e,tooltip:(0,r.jsxs)(o.A,{flexDirection:"column",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)(m.sA,{id:"COMMON_SETTING_UP"})," ",(0,r.jsx)(T.pF,{slot:s}),"."]}),(0,r.jsx)(m.sA,{id:"DEVICE_IN_PROGRESS_MESSAGE"})]})})})]})]}),[A.G_.ESIM_INITIALIZING]:({sim:s})=>(0,r.jsx)(Ts,{messageId:"DEVICE_PREPARING_ESIM",sim:s}),[A.G_.ESIM_DOWNLOADING]:({sim:s})=>(0,r.jsx)(Ts,{messageId:"DEVICE_DOWNLOADING_PROFILE",sim:s}),[A.G_.ESIM_ACTIVATING]:({sim:s})=>(0,r.jsx)(Ts,{messageId:"DEVICE_ACTIVATING_ESIM",sim:s}),[A.G_.ESIM_FINALIZING]:({sim:s})=>(0,r.jsx)(Ts,{messageId:"DEVICE_FINALIZING_SETUP",sim:s}),[A.G_.ESIM_FINALIZING_DOWNLOAD_FAILED]:({sim:s})=>(0,r.jsx)(Ts,{messageId:"DEVICE_CLEANING_UP",sim:s}),[A.G_.ESIM_FINALIZING_ACTIVATION_FAILED]:({sim:s})=>(0,r.jsx)(Ts,{messageId:"DEVICE_CLEANING_UP",sim:s}),[A.G_.ESIM_DEACTIVATING]:({sim:s})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.WARNING}),(0,r.jsx)(as,{slot:A.HY.ESIM}),(0,r.jsx)(As,{sim:s,isRemoving:!0,tooltip:(0,r.jsxs)("span",{children:[(0,r.jsx)(m.sA,{id:"COMMON_REMOVING"})," ",(0,r.jsx)(T.pF,{slot:A.HY.ESIM})]})})]}),[A.G_.PIN_INCORRECT]:({mac:s,slot:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.DANGER}),(0,r.jsx)(as,{slot:e,primary:i}),(0,r.jsx)(Es,{messageId:"DEVICE_MBB_STATUS_INCORRECT_PIN_CODE",mac:s,slot:e})]}),[A.G_.PIN_REQUIRED]:({mac:s,slot:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.DANGER}),(0,r.jsx)(as,{slot:e,primary:i}),(0,r.jsx)(Es,{messageId:"DEVICE_PIN_CODE_REQUIRED",mac:s,slot:e})]}),[A.G_.ERROR]:({mac:s,slot:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.DANGER}),(0,r.jsx)(as,{slot:e,primary:i}),(0,r.jsx)(js,{messageId:"DEVICE_ERROR_OCCURRED",children:(0,r.jsx)(_s,{mac:s})})]}),[A.G_.ESIM_INITIALIZATION_FAILED]:({mac:s,sim:e})=>(0,r.jsx)(hs,{mac:s,carrier:(0,I.ap)(e.spn)}),[A.G_.ESIM_ACTIVATION_FAILED]:({mac:s,sim:e})=>(0,r.jsx)(hs,{mac:s,carrier:(0,I.ap)(e.spn)}),[A.G_.ESIM_DOWNLOAD_FAILED]:({mac:s,sim:e})=>(0,r.jsx)(hs,{mac:s,carrier:(0,I.ap)(e.spn)}),[A.G_.BLOCKED]:({slot:s,primary:e})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.DANGER}),(0,r.jsx)(as,{slot:s,primary:e}),(0,r.jsx)(ps,{})]}),[A.G_.PUK_REQUIRED]:({mac:s,slot:e,primary:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rs,{code:E.qU.DANGER}),(0,r.jsx)(as,{slot:e,primary:i}),(0,r.jsx)(Es,{messageId:"DEVICE_PUK_REQUIRED",mac:s,slot:e})]})},Us=({mac:s,sim:e,overrides:i,displaySlot:t,displayState:a,primary:n,radio:d})=>(0,r.jsx)(r.Fragment,{children:ys[a]?.({mac:s,overrides:i,sim:e,radio:d,slot:t,primary:n})}),vs=({offline:s=!1,isCompact:e=!1,slotCount:i=0,...t})=>{const a=p.Ay[`desktop-border-divider-${(0,C.u)().themeName}`],n=(({displayState:s,displaySlot:e,slotCount:i,sim:t,offline:a,radio:n={},mac:d})=>{const c=(0,I.Qi)(e,i);return e===A.HY.ESIM&&(0,S.J)(s,t.esim)?(0,r.jsx)(Os,{slot:(0,I.WW)(i)}):c&&(0,S._)(s,t.esim)?(0,r.jsx)(Ds,{slot:e}):a?(0,r.jsx)(Ms,{slot:e}):c&&(0,I.k3)(s)||c&&(0,I.k3)(s)?(0,r.jsx)(gs,{slot:e}):(0,I.Ub)(n,t)?(0,r.jsx)(Gs,{slot:e,mac:d,carrierName:(0,I.ap)(t?.spn)}):void 0})({displayState:t.displayState,displaySlot:t.displaySlot,slotCount:i,sim:t.sim,offline:s,radio:t.radio,mac:t.mac});return(0,r.jsx)(o.A,{borderBottom:e?void 0:a,padding:e?void 0:d.YC,height:e?27:32,alignItems:"center",justifyContent:"space-between",children:n||(0,r.jsx)(Us,{...t})})};var Vs=i(808571);const bs=({mac:s,slot:e,isInvalid:i})=>(0,r.jsxs)(o.A,{gap:d.YC,children:[(0,r.jsx)(Vs.A,{size:"original",variant:"fill",color:p.Ay[`desktop-color-orange-06-${(0,C.u)().themeName}`]}),(0,r.jsxs)("span",{children:[(0,r.jsxs)(a.A,{size:"medium",color:"text-1",children:[(0,r.jsx)(m.sA,{id:i?"DEVICE_PIN_CODE_INVALID":"DEVICE_PIN_CODE_REQUIRED"})," · "]}),(0,r.jsx)(Y,{mac:s,slot:(0,I.CJ)(e),children:(0,r.jsx)(m.sA,{id:"COMMON_SETTINGS"})})]})]});var fs=i(939940);const Ls=({radio:{signal_percent:s,rsrp:e,rscp:i}={}})=>{const t=(0,fs._i)(s,(0,C.u)().themeName),a=e??i;return(0,r.jsx)(c.Y,{id:"COMMON_SIGNAL",children:(0,r.jsx)(y.A,{colorOverride:t,size:"inherit",children:a?(0,r.jsxs)(r.Fragment,{children:[a," ",(0,r.jsx)(m.sA,{id:"COMMON_UNIT_DBM"})]}):(0,r.jsx)(m.sA,{id:"COMMON_FALLBACK"})})})};var Ps=i(956350);const Fs=(s,e={},i,r,t)=>{switch(!0){case!s.card_present:case(0,_.aK8)(t||j.g.UNKNOWN):return E.qU.MISSING;case(0,I.Gv)(s):return E.qU.DANGER;case r===E.Gu.MODEM_INIT&&s.active:case r===E.Gu.SIM_ACTIVATION&&s.active:case r===E.Gu.SEARCHING&&s.active:case r===E.Gu.CONNECTING&&s.active:case(0,I.Ao)(s):case(0,I.cN)(s,e):case(0,I.d)(s.current_apn,i):case s.data_limited:return E.qU.WARNING;case s.connection_info?.inet_state===A.uQ.DISCONNECTED:case i?.signal===E.OP.NO_SIGNAL:return E.qU.DANGER;case(0,I.nP)(s,r):return E.qU.SUCCESS;default:return E.qU.MISSING}},Bs=(s,e={},i={},t,a)=>{switch(!0){case!s.card_present:case(0,I.cN)(s,e):case(0,I.kV)(s):case(0,I.Ao)(s):return null;default:return(0,r.jsx)(Ps.A,{softLimit:i.data_limit_enabled?i.data_soft_limit_bytes:0,threshold:i.data_limit_enabled?i.data_warning_threshold:void 0,dataFormat:"SI",used:(0,I.rB)(s),inactive:(0,_.aK8)(a||j.g.UNKNOWN)})}},Ys=(s,e,i,t,c={},A)=>{switch(!0){case(0,_.aK8)(e||j.g.UNKNOWN):return(0,r.jsx)(a.A,{color:"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:"COMMON_OFFLINE"})});case(0,I.cN)(t,c):return(0,r.jsx)(W.A,{initialTime:t.display_state_elapsed,duration:(0,I.gX)(t.display_state)});case!t.card_present&&t.slot===x.QB:return(0,r.jsxs)(o.A,{gap:d.YC,children:[(0,r.jsx)($,{mac:s}),(0,r.jsx)(l.A,{description:(0,r.jsx)(m.sA,{id:"DEVICE_ESIM_ACTIVATION_TOOLTIP"})})]});case!t.card_present:return(0,r.jsx)(a.A,{color:"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:"DEVICE_NO_SIM"})});case(0,I.kV)(t):return(0,r.jsx)(Y,{mac:s,slot:(0,I.CJ)(t.slot),children:(0,r.jsx)(m.sA,{id:"DEVICE_MBB_SETUP_REQUIRED"})});case(0,I.Ao)(t):return(0,r.jsx)(bs,{mac:s,slot:t.slot,isInvalid:(0,I.Gv)(t)});case i===E.Gu.READY&&(0,I.vc)(t)&&!t.active:return(0,r.jsx)(a.A,{color:"text-3",size:"medium",children:(0,r.jsx)(m.sA,{id:"COMMON_READY"})});default:return(0,r.jsxs)(r.Fragment,{children:[t.active?(0,r.jsx)(n.A,{description:i===E.Gu.READY?(0,r.jsx)(Ls,{radio:A}):void 0,placement:"top start",children:(0,r.jsx)("span",{children:(0,r.jsx)(N.A3,{signal_percent:A?.signal_percent,children:i===E.Gu.SEARCHING?(0,r.jsx)(m.sA,{id:"DEVICE_ULTE_PRO_SETUP_SEARCHING_INFO"}):(0,I.mR)(A?.rat)?A?.rat:0===A?.signal_percent?(0,r.jsx)(m.sA,{id:"COMMON_NO_SIGNAL"}):null})})}):null,t.slot===x.QB&&!c&&t.card_present?(0,r.jsx)(l.A,{description:(0,r.jsx)(m.sA,{id:"DEVICE_ESIM_TOOLTIP"})}):null]})}},Ws=(s={},e={},i=void 0,t=void 0)=>{switch(!0){case!s.card_present:case(0,_.aK8)(t||j.g.UNKNOWN):return;case i===E.Gu.MODEM_INIT&&s.card_present:case i===E.Gu.SIM_ACTIVATION&&s.card_present:case i===E.Gu.CONNECTING&&s.active:case(0,I.cN)(s,e.esim):return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_SETTING_UP"});case i===E.Gu.SEARCHING&&s.active:return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_SEARCHING"});case(0,I.Gv)(s):return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_INCORRECT_PIN_CODE"});case(0,I.Ao)(s):return(0,r.jsx)(m.sA,{id:"DEVICE_PIN_CODE_REQUIRED"});case s.data_limited:return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_DATA_LIMIT_REACHED"});case(0,I.FT)(s):return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_INTERNET_UNREACHABLE"});case e?.radio?.signal===E.OP.NO_SIGNAL&&s.active:return(0,r.jsx)(m.sA,{id:"DEVICE_ULTE_PRO_SETUP_NO_SIGNAL"});case e?.radio&&(0,I.mr)(e.radio)&&s.active:return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_CANNOT_REGISTER"});case s.esim&&e.esim?.last_operation?.state===A.hM.FAILURE:return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_UNABLE_TO_ACTIVATE_ESIM"});case(0,I.d)(s.current_apn,e.radio):return(0,r.jsx)(m.sA,{id:"DEVICE_MBB_STATUS_ROAMING_UNAVAILABLE"});case(0,I.nP)(s,e.state)&&!!e.radio:return(0,r.jsx)(c.m,{minWidth:120,children:(0,r.jsx)(Ls,{radio:e.radio})});default:return}},qs=({mac:s,deviceState:e,mbb:i,mbb_overrides:t,isCompact:a})=>(0,r.jsx)(o.A,{flexDirection:"column",gap:a?void 0:d.kc,width:"100%",children:(i?.sim||[]).map((n={})=>{const d=(t?.sim||[]).find(s=>s.slot===n.slot)||{};return(0,r.jsx)(N.Ay,{slot:n.slot,esim:n.esim,card_present:n.card_present,statusCode:Fs(n,i.esim,i.radio,i.state,e),message:Bs(n,i.esim,d,0,e),status:Ys(s,e,i.state,n,i.esim,i.radio),statusBallTooltip:Ws(n,i,i.state,e),isCompact:a},n.slot)})}),ks=({mac:s,mbb:e,mbb_overrides:i,isCompact:t,deviceState:a})=>(0,r.jsx)(o.A,{flexDirection:"column",width:"100%",children:(0,I.Vl)(e.sim||[]).map(n=>{const d=e.sim?.find(s=>s.slot===(0,I.Ff)(n,e.sim?.length))||{},c=(i?.sim||[]).find(s=>s.slot===d.slot)||{};return(0,r.jsx)(vs,{displaySlot:n,mac:s,sim:d,displayState:d.display_state||Z,primary:i?.primary_slot===d.slot,overrides:c,radio:e.radio,isCompact:t,offline:(0,_.aK8)(a||j.g.UNKNOWN),slotCount:e.sim?.length},n)})}),ws=s=>{const e=(0,t.useMemo)(()=>s.mbb.sim?.some(({display_state:s})=>Boolean(s)),[s.mbb.sim]);return(0,r.jsx)(e?ks:qs,{...s})}}}]);