"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[93393],{287654(e,t,n){n.d(t,{A:()=>i});const i=(0,n(602086).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},964795(e,t,n){n.d(t,{O:()=>a,g:()=>o});var i=n(45978);var s=n(434521);const a=e=>[i.g.PENDING,i.g.ADOPTION_REQUIRED,i.g.ADOPTING].includes((0,s.S9)(e))&&(!e.unsupported||(e.adoptable_when_upgraded??!1)),o=e=>{const t=!e.unsupported||(e.adoptable_when_upgraded??(e.unsupported&&2===e.unsupported_reason));return[i.g.ADOPTION_FAILED].includes((0,s.S9)(e))&&t}},889702(e,t,n){var i;n.d(t,{S:()=>i}),function(e){e.API_DEVICE_ADOPT="API_DEVICE_ADOPT",e.API_DEVICE_RESTART="API_DEVICE_RESTART",e.API_WIDGET_OS_STATS="API_WIDGET_OS_STATS"}(i||(i={}))},952566(e,t,n){n.d(t,{p:()=>r});var i=n(222102),s=n(591256),a=n(897166),o=n(570801),l=n(889702);const r=e=>(0,i.Mz)(a.ah,s.pw,a.dK,o.fR,(t,n,i,s)=>{switch(e){case l.S.API_DEVICE_ADOPT:case l.S.API_DEVICE_RESTART:return i||t.includes(e);case l.S.API_WIDGET_OS_STATS:return s||n.includes(e);default:return i}})},88945(e,t,n){n.d(t,{A:()=>r});var i=n(274934),s=n(607381),a=n(108894),o=n(83985),l=n(470070);const r=({onCancel:e,onConfirm:t,style:n={},cancelButtonLabelId:r="COMMON_UNSAVED_CHANGES_STAY",confirmButtonLabelId:c="COMMON_UNSAVED_CHANGES_LEAVE",titleId:d="COMMON_UNSAVED_CHANGES_TITLE",contentId:A="COMMON_UNSAVED_CHANGES_CONTENT"})=>(0,i.jsx)(a.aF.Root,{isOpen:!0,children:(0,i.jsx)(s.A,{actionButtons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.A,{type:"button",variant:"neutral",onPress:e,children:(0,i.jsx)(l.sA,{id:r})}),(0,i.jsx)(o.A,{type:"button",variant:"destructive",onPress:t,children:(0,i.jsx)(l.sA,{id:c})})]}),title:(0,l.tz)().formatMessage({id:d}),width:"small",isDismissable:!1,onClose:e,style:n,children:(0,i.jsx)(l.sA,{id:A})})})},626404(e,t,n){n.d(t,{A:()=>r});var i=n(274934),s=n(602086),a=n(290190),o=n.n(a);var l=n(88945);const r=({ignoredPaths:e,onLeave:t,beforeOnLeave:n,cancelButtonLabelId:a,confirmButtonLabelId:r,titleId:c,contentId:d})=>{const A=(e=>(t,n)=>null==e||!t||!n||![].concat(e).some(e=>"string"==typeof e?n.pathname===e&&t.pathname===e:e instanceof RegExp&&(e.test(n.pathname)||e.test(t.pathname))))(e),m=(0,s.useMemo)(()=>(e,t)=>A(e,t)&&((e,t)=>t?.pathname!==e.pathname)(e,t),[A]),u=(0,s.useCallback)(e=>{n?.(),e()},[n]);return(0,i.jsx)(o(),{when:m,afterConfirm:t,beforeConfirm:u,children:({onCancel:e,onConfirm:t})=>(0,i.jsx)(l.A,{onCancel:e,onConfirm:t,cancelButtonLabelId:a,confirmButtonLabelId:r,titleId:c,contentId:d})})}},45216(e,t,n){n.d(t,{A:()=>r});var i=n(274934),s=n(179102),a=n(309130),o=n(100978),l=n(254193);const r=({groupSize:e=4,maxWidth:t,value:n})=>{return(0,i.jsxs)(o.A,{alignItems:"flex-start",children:[(0,i.jsx)(o.A,{gap:a.YC,rowGap:0,flexFlow:"row wrap",maxWidth:t,justifyContent:"space-between",children:(r=n,c=e,r.match(new RegExp(`.{1,${c}}`,"g"))??[]).map(e=>(0,i.jsx)(s.A,{color:"text-3",size:"medium",children:e}))}),(0,i.jsx)(l.A,{value:n})]});var r,c}},620627(e,t,n){n.d(t,{A:()=>A});var i=n(274934),s=n(179102),a=n(247816),o=n(309130),l=n(100978),r=n(535322);const c=(0,a.A)("div")`
  margin-right: ${o.kc};
`,d=(0,a.A)("div")`
  margin-left: ${o.kc};
`,A=({icon:e,closeIcon:t,nested:n,children:a,...o})=>(0,i.jsx)(r.A,{nested:n,...o,children:(0,i.jsxs)(l.A,{children:[(0,i.jsx)(c,{children:e}),(0,i.jsx)(s.A,{size:"medium",children:a}),t?(0,i.jsx)(d,{children:t}):null]})})},54849(e,t,n){n.d(t,{A:()=>R});var i=n(274934),s=n(505817),a=n(602086),o=n(977872),l=n(179102),r=n(247816),c=n(263705),d=n(409844),A=n(669439),m=n(347625),u=n(250266),E=n(205521),_=n(470070),C=n(20049),I=n(177173),h=n(212635),x=n(251905),p=n(10695),T=n(393629),O=n(561500),j=n(598990),v=n(897166),D=n(434521),N=n(45978),S=n(795206),g=n(427714),f=n(648576),P=n(291508);const b=(0,r.A)(f.Ay,(0,P.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:n})=>n?t:s.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,M=d.AH`
  flex: 1;
  width: 100%;
`,R=({device:e,disabled:t,variant:n})=>{const s=(0,o.wA)(),r=(0,c.u)(),[d,P]=(0,a.useState)(!1),[R,L]=(0,a.useState)(!1),y=(0,o.d4)(v.EL),U=(0,o.d4)(C.OA),k=(0,D.S9)(e),{isDeviceDisconnected:V,isDeviceAdoptionFailed:w,deviceBusy:B}=(0,a.useMemo)(()=>({isDeviceDisconnected:k===N.g.DISCONNECTED,isDeviceAdoptionFailed:k===N.g.ADOPTION_FAILED,deviceBusy:(0,D.C1)(k)}),[k]),$=(0,a.useMemo)(()=>t||B||y,[t,B,y]),z=(0,a.useMemo)(()=>(0,m.Q)({name:e.name,model:e.model,mac:e.mac}),[e.name,e.model,e.mac]),G=(0,a.useCallback)(()=>{const{id:t,type:n}=(0,x.Se)(U);n===h.F7.DEVICE&&t===e.mac&&(s((0,p.U)(I.Zt)),s((0,p.Ao)([])))},[e.mac,s,U]),W=(0,a.useCallback)(async()=>{P(!0),s((0,O.Yl)(e.mac)).then(()=>{G(),s((0,T.W)(e.mac)),s((0,S.XL)(e.mac)),P(!1),L(!1),s((0,E.K5)()),s((0,j.Uc)()),s((0,g.O)())}).finally(()=>{P(!1),L(!1)})},[e.mac,s,G]),H=(0,a.useCallback)(()=>{P(!1),L(!1)},[]),F=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),L(!0)},[]);return(0,i.jsx)(A.A,{description:B?(0,i.jsx)(_.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"}):void 0,children:(0,i.jsx)("span",{className:"tertiary"===n?M:void 0,children:(0,i.jsx)(u.A,{isOpen:R,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:z},message:V||w?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:z},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:W,handleClose:H,className:"tertiary"===n?M:"",children:(0,i.jsx)(b,{disabled:$,variant:"tertiary"===n?void 0:"link",className:"tertiary"===n?(0,f.sC)(r):"",onClick:F,loader:d?"spinner":null,type:"button",children:(0,i.jsx)(l.A,{color:"red-06",size:"medium",children:(0,i.jsx)(_.sA,{id:"COMMON_ACTION_REMOVE"})})})})})})}},748094(e,t,n){n.d(t,{A:()=>C});var i=n(274934),s=n(505817),a=n(602086),o=n(526744),l=n(179102),r=n(247368),c=n(711950),d=n(517300),A=n(263705),m=n(613842),u=n(470070),E=n(620627),_=n(100978);const C=(0,a.memo)(({children:e,customIcon:t,link:n,nested:C,extra:I,variant:h="warning",...x})=>{const{themeName:p}=(0,A.u)(),T=(0,a.useMemo)(()=>{switch(h){case"warning":return(0,i.jsx)(c.A,{size:"original",color:s.Ay[`desktop-color-orange-06-${p}`],variant:"fill"});case"info":return(0,i.jsx)(r.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return(0,i.jsx)(d.A,{size:"medium",color:s.Ay[`desktop-color-red-06-${p}`],variant:"fill"})}},[h,p,t]),O=(0,a.useCallback)(()=>{m.A.open(n)},[n]);return(0,i.jsx)(E.A,{icon:T,nested:C,...x,children:(0,i.jsxs)(_.A,{flexDirection:"column",alignItems:"flex-start",children:[(0,i.jsx)(l.A,{children:e}),(0,i.jsx)(l.A,{children:n?(0,i.jsx)(o.A,{type:"button",variant:"inline",onClick:O,children:(0,i.jsx)(u.sA,{id:"COMMON_LEARN_MORE"})}):null}),I]})})})},374402(e,t,n){n.d(t,{X:()=>i,c:()=>s});const i="PROPERTY_PANEL_CLASSNAME",s=[]},279279(e,t,n){n.d(t,{A:()=>r});var i=n(977872),s=n(602086),a=n(820633),o=n(897166),l=n(570801);const r=()=>{const e=(0,i.d4)(a.zi),t=(0,i.d4)(l.BQ),n=(0,i.d4)(o.hq),r=(0,s.useMemo)(()=>new Intl.DateTimeFormat(e,{hourCycle:t,month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZone:n}),[e,t,n]);return(0,s.useCallback)(e=>r.format(e),[r])}},208583(e,t,n){n.d(t,{Z:()=>s,z:()=>a});var i=n(347625);const s=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,a=(e,t,n,s,a)=>{const o=!a&&t?` ${s({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${o}`:n?`${(0,i.Q)(n)}${o}`:s({id:"COMMON_FALLBACK"})}},721398(e,t,n){n.d(t,{A:()=>l});var i=n(274934),s=n(548941),a=n(247368),o=n(470070);const l=({messageId:e,tooltipClassName:t,values:n,isInteractive:l,portal:r,variant:c="twoTone",size:d="medium"})=>(0,i.jsx)(s.A,{description:(0,i.jsx)(o.sA,{id:e,values:n}),width:210,isInteractive:l,portal:r,tooltipClassName:t,children:(0,i.jsx)(a.A,{isActive:!0,omitSvgMargin:!0,variant:c,size:d})})},667758(e,t,n){n.d(t,{A:()=>r});var i=n(274934),s=n(179102),a=n(664092),o=n(470070),l=n(45216);const r=({eid:e})=>e?(0,i.jsxs)(a.A,{flexProps:{height:"auto"},children:[(0,i.jsx)(s.A,{color:"text-2",size:"medium",children:(0,i.jsx)(o.sA,{id:"DEVICE_ESIM_EID"})}),(0,i.jsx)(l.A,{maxWidth:145,value:e})]}):null},303008(e,t,n){n.d(t,{A:()=>r});var i=n(274934),s=n(179102),a=n(470070),o=n(45216),l=n(664092);const r=({imei:e})=>(0,i.jsxs)(l.A,{flexProps:{height:"auto"},children:[(0,i.jsx)(s.A,{color:"text-2",size:"medium",children:(0,i.jsx)(a.sA,{id:"DEVICE_IMEI"})}),(0,i.jsx)(o.A,{maxWidth:141,value:e})]})},956731(e,t,n){n.d(t,{A:()=>m,R:()=>A});var i=n(274934),s=n(505817),a=n(247816),o=n(669439),l=n(309130),r=n(100978),c=n(721398);const d=(0,a.A)(r.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};
  padding: ${l.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${l.Ln};
  }
`,A=({tooltipId:e,disabledTooltip:t,children:n,tooltipProps:s={},...a})=>(0,i.jsx)(d,{...a,children:(0,i.jsxs)(r.A,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(o.A,{description:t,placement:"left",children:(0,i.jsx)("span",{children:n})}),e?(0,i.jsx)(c.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...s}):null]})}),m=A},254193(e,t,n){n.d(t,{A:()=>r});var i=n(274934),s=n(602086),a=n(266824),o=n(244183),l=n(316628);const r=({value:e})=>{const t=(0,l.A)(),n=(0,s.useCallback)(()=>t(e),[e,t]);return(0,i.jsx)(a.A,{onPress:n,variant:"neutral",children:(0,i.jsx)(o.A,{size:"original"})})}},664092(e,t,n){n.d(t,{A:()=>c});var i=n(274934),s=n(247816),a=n(309130),o=n(100978),l=n(291508);const r=(0,s.A)(o.A,(0,l.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${a.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,c=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:s={},compact:o=!1})=>(0,i.jsx)(r,{width:"100%",justifyContent:"space-between",gap:a.kc,height:o?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:o,...s,children:e})},633797(e,t,n){n.d(t,{A:()=>I});var i=n(274934),s=n(903736),a=n.n(s),o=n(247368),l=n(711950),r=n(517300),c=n(247816),d=n(263705),A=n(309130),m=n(100978),u=n(291508);const E=(0,c.A)(m.A,(0,u.A)("borderColor","backgroundColor","dividerColor"))`
  background-color: ${({backgroundColor:e})=>e};
  border-left: 2px solid ${({borderColor:e})=>e};
  padding: ${A.Ln} ${A.Ln} ${A.Ln} 0;

  & + & {
    border-top: 1px solid ${({dividerColor:e})=>e};
  }
`,_=(0,c.A)(m.A)`
  min-width: 36px;
  max-width: 36px;
`,C=(e,{warning:t,neutral01:n,danger:s,info:c})=>{switch(e){case"warning":return{icon:(0,i.jsx)(l.A,{size:"medium",color:t,variant:"fill"}),backgroundColor:n,borderColor:t,dividerColor:a()(t).alpha(.2).css()};case"danger":return{icon:(0,i.jsx)(r.A,{size:"medium",color:s,variant:"fill"}),backgroundColor:n,borderColor:s,dividerColor:a()(s).alpha(.2).css()};default:return{icon:(0,i.jsx)(o.A,{isActive:!0,size:"original"}),backgroundColor:n,borderColor:c,dividerColor:a()(c).alpha(.2).css()}}},I=({level:e,children:t,overrideLevel:n})=>{const{motifPalette:s}=(0,d.u)(),{icon:a,backgroundColor:o,borderColor:l,dividerColor:r}={...C(e,s),...n};return(0,i.jsxs)(E,{flexDirection:"row",width:"100%",backgroundColor:o,borderColor:l,dividerColor:r,children:[(0,i.jsx)(_,{justifyContent:"center",children:a}),(0,i.jsx)(m.A,{flexDirection:"column",justifyContent:"center",children:t})]})}},769778(e,t,n){n.d(t,{R:()=>E,n:()=>u});var i=n(274934),s=n(855890),a=n(309130),o=n(156007),l=n(579902),r=n(100978),c=n(726831),d=n(244398);const A={width:"auto",maxWidth:"80px",height:"20px"},m=`${c.A.asnPath}65534${d.m1}`,u={ATT:7018,TMOBILE:21928,VERIZON:701},E=({carrier:e,asn:t})=>e?(0,i.jsxs)(r.A,{gap:a.YC,flex:"0 1 auto",overflow:"hidden",children:[(0,i.jsx)(r.A,{flex:"0 0 auto",children:void 0!==t?(0,i.jsx)(l.A,{asn:t,style:A,useFallback:!0,customFallback:m}):(0,i.jsx)(s.A,{size:"original"})}),(0,i.jsx)(o.A,{color:"text-2",size:"medium",children:e})]}):null},463872(e,t,n){n.d(t,{A:()=>v});var i=n(274934),s=n(977872),a=n(798282),o=n(535322),l=n(309130),r=n(100978),c=n(887481),d=n(291935),A=n(956978),m=n(179102),u=n(470070),E=n(769778);const _=({children:e})=>(0,i.jsx)(m.A,{color:"text-3",size:"small",children:e}),C=({children:e,reference:t})=>(0,i.jsxs)(r.A,{gap:l.YC,children:[(0,i.jsx)(r.A,{width:12,children:(0,i.jsx)(_,{children:t})}),(0,i.jsx)(r.A,{children:(0,i.jsx)(m.A,{color:"text-3",size:"small",children:e})})]}),I=({children:e,reference:t})=>(0,i.jsxs)(r.A,{children:[e,(0,i.jsx)(_,{children:t})]}),h=()=>(0,i.jsxs)(r.A,{flexDirection:"column",gap:l.YC,children:[(0,i.jsxs)(r.A,{children:[(0,i.jsxs)(m.A,{color:"text-2",size:"medium",children:[(0,i.jsx)(u.sA,{id:"DEVICE_CERTIFIED_WITH"})," "]}),(0,i.jsxs)(r.A,{gap:l.kc,children:[(0,i.jsx)(E.R,{carrier:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_ATT"}),asn:E.n.ATT}),(0,i.jsx)(I,{reference:"*",children:(0,i.jsx)(E.R,{carrier:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_TMOBILE"}),asn:E.n.TMOBILE})})]})]}),(0,i.jsx)(C,{reference:"*",children:(0,i.jsx)(u.sA,{id:"DEVICE_TMOBILE_NOT_SUPPORTED",values:{br:(0,i.jsx)("br",{})}})}),(0,i.jsx)(C,{reference:"**",children:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_NOT_SUPPORTED",values:{carrier:(0,i.jsx)(u.sA,{id:"DEVICE_CARRIER_VERIZON"})}})})]});var x=n(303008),p=n(667758),T=n(262768);const O=({networkScanOperators:e=[]})=>e.length?(0,i.jsxs)(r.A,{gap:l.kc,children:[(0,i.jsxs)(m.A,{color:"text-2",size:"medium",children:[(0,i.jsx)(u.sA,{id:"DEVICE_MBB_LOCAL_CARRIERS"}),":"]}),e.map(e=>(0,i.jsx)(E.R,{carrier:(0,T.ap)(e.name),asn:e.asn},e.name))]}):null,j=({children:e})=>(0,i.jsxs)(r.A,{flexDirection:"column",gap:l.kc,paddingBottom:l.YC,children:[e,(0,i.jsx)(a.A,{})]}),v=({imei:e,eId:t,networkScanOperators:n=[],model:a})=>{const m=(0,s.d4)(d.AP),u=(0,A.uMn)({model:a})||(0,A.KLl)({model:a})||(0,A.evX)({model:a})||(0,A.ocB)({model:a}),E=(0,c.Kq)(m)&&u;return e||t||n?.length||E?(0,i.jsx)(o.A,{children:(0,i.jsxs)(r.A,{flexDirection:"column",gap:l.kc,children:[E?(0,i.jsx)(j,{children:(0,i.jsx)(h,{})}):n?.length>0?(0,i.jsx)(j,{children:(0,i.jsx)(O,{networkScanOperators:n})}):null,e?(0,i.jsx)(x.A,{imei:e}):null,t?(0,i.jsx)(p.A,{eid:t}):null]})}):null}},286462(e,t,n){n.d(t,{A:()=>P});var i=n(274934),s=n(956731),a=n(505817),o=n(977872),l=n(602086),r=n(179102),c=n(247816),d=n(263705),A=n(409844),m=n(250266),u=n(669439),E=n(648576),_=n(205521),C=n(470070),I=n(29472),h=n(193730);const x=(0,n(401042).C1)("cmd/devmgr/ubb-unpair");var p=n(393629),T=n(897166),O=n(434521),j=n(45978),v=n(795206),D=n(427714),N=n(291508);const S=(0,c.A)(E.Ay,(0,N.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:n})=>n?t:a.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,g=A.AH`
  flex: 1;
  width: 100%;
`,f=({device:e,disabled:t,variant:n})=>{const s=(0,o.wA)(),a=(0,d.u)(),[c,A]=(0,l.useState)(!1),[N,f]=(0,l.useState)(!1),P=(0,o.d4)(T.EL),b=(0,O.S9)(e),{isDeviceDisconnected:M,isDeviceAdoptionFailed:R,deviceBusy:L}=(0,l.useMemo)(()=>({isDeviceDisconnected:b===j.g.DISCONNECTED,isDeviceAdoptionFailed:b===j.g.ADOPTION_FAILED,deviceBusy:(0,O.C1)(b)}),[b]),y=(0,l.useMemo)(()=>t||L||P||M||R,[t,L,P,M,R]),U=(0,l.useMemo)(()=>"tertiary"===n,[n]);return(0,i.jsx)(u.A,{description:L?(0,i.jsx)(C.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"}):void 0,children:(0,i.jsx)("span",{className:U?g:void 0,children:(0,i.jsx)(m.A,{isOpen:N,title:"DEVICE_ACTIONS_UNPAIR_CONFIRM_TITLE",message:"DEVICE_ACTIONS_UNPAIR_CONFIRM_MESSAGE",buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",handleConfirm:async()=>{var t;A(!0),s((t=e.mac,(0,I.Xj)(h.A.UBB_UNPAIR,x,{mac:t}))).then(()=>{s((0,p.W)(e.mac)),s((0,v.XL)(e.mac)),A(!1),f(!1),s((0,_.K5)()),s((0,D.O)())}).finally(()=>{A(!1),f(!1)})},handleClose:()=>{A(!1),f(!1)},className:U?g:"",children:(0,i.jsx)(S,{disabled:y,variant:U?void 0:"link",className:U?(0,E.sC)(a):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),f(!0)},loader:c?"spinner":null,type:"button",children:(0,i.jsx)(r.A,{color:"red-06",size:"medium",children:(0,i.jsx)(C.sA,{id:"COMMON_ACTION_UNPAIR"})})})})})})},P=({activeItem:e})=>(0,i.jsx)(s.R,{tooltipId:"DEVICE_ACTIONS_UNPAIR_INFO",tooltipProps:{tooltipClassName:"tooltip-position-fixer",variant:"outline"},children:(0,i.jsx)(f,{device:e})})},17696(e,t,n){n.r(t),n.d(t,{default:()=>Dt});var i=n(274934),s=n(602086),a=n(977872),o=n(254585),l=n(720770),r=n(724081),c=n(237725),d=n(199805),A=n(105472),m=n(279740),u=n(205521),E=n(570801),_=n(626404),C=n(909924),I=n(271656);const h=({propertyPanelNavigationPrompt:{[C.J4.TITLE_ID]:e,[C.J4.CONTENT_ID]:t,[C.J4.CANCEL_BUTTON_LABEL_ID]:n,[C.J4.CONFIRM_BUTTON_LABEL_ID]:o,[C.J4.ON_LEAVE]:l}=(0,I.A)()})=>{const r=(0,a.wA)(),c=(0,s.useCallback)(()=>{r((0,u.SQ)(!1)),l?.()},[r,l]);return(0,i.jsx)(_.A,{onLeave:c,titleId:e,contentId:t,cancelButtonLabelId:n,confirmButtonLabelId:o})};var x=n(88945);const p=()=>{const e=(0,a.wA)(),{[C.J4.TITLE_ID]:t,[C.J4.CONTENT_ID]:n,[C.J4.CANCEL_BUTTON_LABEL_ID]:l,[C.J4.CONFIRM_BUTTON_LABEL_ID]:r,[C.J4.ON_LEAVE]:c}=(0,a.d4)(o.om),d=(0,s.useCallback)(()=>{e((0,u.Fr)())},[e]),A=(0,s.useCallback)(()=>{c?.(),e((0,u.nw)())},[e,c]);return(0,i.jsx)(x.A,{onCancel:d,onConfirm:A,titleId:t,contentId:n,cancelButtonLabelId:l,confirmButtonLabelId:r})};var T=n(449339),O=n(470070),j=n(434521),v=n(241833),D=n(247816),N=n(309130);const S=(0,D.A)(v.A)`
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: ${N.Ln};
`,g=(0,s.memo)(({tabs:e,currentTab:t})=>{const n=(0,a.wA)(),o=(0,s.useCallback)(e=>{n((0,u.X2)(e))},[n]);return e?.length?(0,i.jsx)(S,{tabs:e,value:t,iconOnly:!0,onChange:o,tooltipProps:{animate:!1}}):null});var f=n(505817),P=n(443502),b=n(225211),M=n(956978),R=n(100978);const L=(0,D.A)(R.A)`
  background-color: ${P.PA.success};
  color: ${P.N0};
  font-size: 11px;
`,y=(0,D.A)("div")`
  font-weight: ${f.Ay["desktop-font-weight-semibold"]};
  margin-bottom: ${N.YC};
`,U=({activeItem:e})=>(e=>Object(e)===e&&"type"in e&&"model"in e&&"adopted"in e&&!("product_line"in e))(e)&&(0,M.tNJ)(e)&&(0,M.Vly)(e)?(0,i.jsxs)(L,{flex:"none",height:50,minHeight:50,padding:`${N.kc} ${N.fS}`,position:"relative",children:[(0,i.jsx)(R.A,{alignItems:"center",justifyContent:"center",marginRight:N.Ln,children:(0,i.jsx)(b.A,{width:18,height:18,strength:(0,M.KwR)(e),color:"currentColor",inactiveColor:P.kv})}),(0,i.jsxs)(R.A,{flexDirection:"column",justifyContent:"center",flex:1,children:[(0,i.jsx)(y,{children:(0,i.jsx)(O.sA,{id:"DEVICE_ULTE_IS_ACTIVE_TITLE"})}),(0,i.jsx)(O.sA,{id:"DEVICE_ULTE_IS_ACTIVE_DETAILS"})]})]}):null;var k=n(896743),V=n(179102),w=n(247368),B=n(263705),$=n(409844),z=n(347625),G=n(586566),W=n(620627),H=n(793442),F=n(754924),Y=n(726831),K=n(208583);const X=({last_uplink:e={}})=>{const{formatMessage:t}=(0,O.tz)(),n=(0,a.d4)(F.CC),s=(0,K.Z)(e.uplink_mac,n),o=(0,K.z)(e.uplink_device_name,e.uplink_remote_port,s,t);return(0,i.jsx)(W.A,{icon:(0,i.jsx)(w.A,{size:"original",isActive:!0,variant:"fill"}),children:(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:"COMMON_DEVICE_CONNECTION_INTERRUPTED_WARNING",values:{strong:O.ko,uplinkDeviceName:o||(0,i.jsx)(O.sA,{id:"COMMON_UNKNOWN"}),link:(0,i.jsx)(H.A,{href:Y.A.offlineArticle,id:"COMMON_HERE",noWrap:!0})}})})})};var Q=n(251263),J=n(748094),Z=n(541819),q=n(974390),ee=n(54849),te=n(425040),ne=n(87449),ie=n(526744),se=n(244081),ae=n(871808),oe=n(815436),le=n(988757),re=n(700444),ce=n(869332),de=n(771927),Ae=n(355108),me=n(910577),ue=n(301940),Ee=n(68105),_e=n(652236),Ce=n(952566),Ie=n(889702),he=n(34725),xe=n(961603),pe=n(95857),Te=n(651561),Oe=n(964795),je=n(45978),ve=n(795206),De=n(228502),Ne=n(291935),Se=n(544691),ge=n(393482),fe=n(969288),Pe=n(112340),be=n(711950);const Me=()=>(0,i.jsxs)(R.A,{gap:N.kc,marginTop:N.kc,children:[(0,i.jsx)(be.A,{size:"original",color:P.PA.warning,variant:"fill"}),(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:"DEVICE_UBB_ADOPT_WARNING_MESSAGE",values:{b:O.b}})})]}),Re=(0,s.memo)(({name:e,model:t,mac:n})=>(0,i.jsxs)(R.A,{gap:N.kc,marginTop:N.kc,children:[(0,i.jsx)(be.A,{size:"original",color:P.PA.warning,variant:"fill"}),(0,i.jsx)(V.A,{size:"small",children:(0,i.jsx)(O.sA,{id:(0,M.P1n)(t)?"DEVICE_ADOPT_SECOND_GATEWAY_WHEN_UDM_USED_INFO":"DEVICE_ADOPT_SECOND_GATEWAY_INFO",values:{gateway:(0,z.Q)({name:e,model:t,mac:n}),b:O.b,br:O.br}})})]})),Le=()=>(0,i.jsxs)(R.A,{gap:N.kc,marginTop:N.kc,children:[(0,i.jsx)(be.A,{size:"original",color:P.PA.warning,variant:"fill"}),(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:"DEVICE_ULTE_PRO_SETUP_SIM_INCOMPATIBLE",values:{strong:O.ko}})})]}),ye=()=>(0,i.jsxs)(R.A,{gap:N.kc,marginTop:N.kc,children:[(0,i.jsx)(be.A,{size:"original",color:P.PA.warning,variant:"fill"}),(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:"DEVICE_ULTE_USG_REQUIRED"})})]});var Ue=n(633797);const ke=(0,D.A)(V.A)`
  line-height: 20px;
  margin-bottom: 10px;
`,Ve=()=>(0,i.jsx)(Ue.A,{level:"warning",children:(0,i.jsx)(ke,{size:"small",children:(0,i.jsx)(O.sA,{id:"DEVICE_ACTIONS_ADOPT_WARNING_MESSAGE",values:{b:O.b}})})});var we=n(685925);const Be=$.AH`
  flex: 1;
`,$e=({device:e,onAdoptionInitiated:t,disabled:n})=>{const{formatMessage:o}=(0,O.tz)(),l=(0,a.wA)(),r=(0,j.S9)(e),[c,d]=(0,s.useState)(!0),[A,m]=(0,s.useState)(r===je.g.ADOPTING),E=(0,a.d4)((0,Ce.p)(Ie.S.API_DEVICE_ADOPT)),_=(0,a.d4)(F.ID),C=(0,a.d4)(F.U$),I=(0,a.d4)(he.fV),h=(0,a.d4)(me.hX),x=(0,a.d4)(Se.Xs),p=(0,a.d4)(De.A),v=(0,a.d4)(Ee.Z9),D=(0,ae.A)(pe.Xj.MANAGED_SHADOW_MODE),S=(0,a.d4)(Ne.jE),g=S?.cloud_template,f=r===je.g.ADOPTION_FAILED,P=(0,j.YP)(e),b=(0,Oe.O)(e),L=(0,Oe.g)(e),y=!!e?.adoptable_when_upgraded,U=(0,M.moU)(e)&&!(0,M.DBW)(_,e,v,D),k=(0,M.tNJ)(e),V=k&&!(0,M.nKo)(_,e),w=k&&!e?.lte_imei,B=!!e?.lte_sim_incompatible,$=!P&&(b||L)&&E&&!(V||U)&&!w,z=k&&!I,G=(0,M.YdF)(e)&&!(0,Te.Ck)(e)&&!(0,M.IOl)(e),W=n||A||c||z||G||B;(0,s.useEffect)(()=>{m(r===je.g.ADOPTING)},[r,e.mac]),(0,s.useEffect)(()=>{Promise.all([l((0,ge.Yo)(void 0,{crudCacheStrategy:{type:se.e.CACHE}})),l((0,ue.uy)(void 0,{crudCacheStrategy:{type:se.e.CACHE}})),...D?[l((0,_e.V9)(void 0,{crudCacheStrategy:{type:se.e.CACHE}}))]:[]]).then(()=>d(!1))},[l,D]),(0,s.useEffect)(()=>{l((0,xe.T)(void 0,{crudCacheStrategy:{type:se.e.CACHE}}))},[l]);return $?(0,i.jsxs)(R.A,{flexDirection:"column",children:[z?(0,i.jsx)(ye,{}):null,B?(0,i.jsx)(Le,{}):null,G?(0,i.jsx)(Me,{}):null,f&&!L?(0,i.jsx)(Ve,{}):null,f&&L?(0,i.jsx)(ee.A,{device:e,variant:"tertiary"}):null,b?(0,i.jsx)(R.A,{gap:N.kc,alignItems:"center",marginTop:N.kc,children:(0,i.jsx)(we.e,{device:e,children:(0,i.jsx)(ie.A,{variant:"primary",onClick:n=>{n?.preventDefault(),n?.stopPropagation(),(n=>{function i(){k?(l((0,Ae.ji)(e.mac,(0,M.mHb)(e)?"LTE_PRO_ADOPTION":"LTE_ADOPTION")),m(!1)):function(){if(e.discovered_by===Pe.A.PROTOCOL_V2_ID)m(!1);else if(L?l((0,ve.T3)(e,n.values)).catch(()=>m(!1)):l((0,ve.Hk)(e)).catch(()=>m(!1)),(0,M.G5G)(e)){const t=(0,te.A)();h||(q.C.getRemoteImagePath(p[e?.model]),l((0,re.ox)({iconUrl:q.C.getRemoteImagePath(p[e?.model]),title:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_TITLE",message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_MESSAGE",primaryButton:{label:o({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{l((0,re.uU)(t)),l((0,u.XP)({type:T.H.WIFI,id:fe.R6}))}},translateTitle:!0},t))),x||(0,M.r$V)(e)||l((0,re.ox)({iconUrl:q.C.getRemoteImagePath(p[e?.model]),title:o({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_TITLE"},{deviceName:e?.hostname}),message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_MESSAGE",primaryButton:{label:o({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{l((0,re.uU)(t)),l((0,u.XP)({type:T.H.WIFI,id:fe.R6}))}}},t))}}()}function s(){if(e.elite&&e.elite.replacement_for_mac){const t=_.find(t=>t.mac===e.elite.replacement_for_mac);l((0,de.E)({title:"DEVICE_APPLY_CONFIGURATION_HEADER",titleValues:{deviceName:t.name},message:"DEVICE_APPLY_CONFIGURATION_MESSAGE",messageValues:{deviceName:t.name},size:"small",onConfirm:()=>{l((0,ce.AS)())},onCancel:()=>{l((0,ce.AS)()),L?i():(0,le.A)([e.mac],{dispatch:l,cloudTemplate:g}).then(i).catch(()=>m(!1))}}))}else(0,M.m_j)({type:e.type})?l((0,ce.to)({modalType:oe.A.REGISTER_ISP_GUIDE,modalProps:{onConfirm:i,onCancel:()=>m(!1)}})):L?i():(0,le.A)([e.mac],{dispatch:l,cloudTemplate:g}).then(i).catch(()=>m(!1))}y?l((0,de.E)({title:"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_TITLE",titleValues:{deviceName:e.name},message:e.upgrade_to_firmware?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_VERSION_MESSAGE":"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_MESSAGE",messageValues:{fromVersion:(0,ne.coerce)(e.version)?.version,toVersion:(0,ne.coerce)(e.upgrade_to_firmware)?.version},size:"small",onConfirm:()=>{l((0,ce.AS)()),s()},onCancel:()=>{l((0,ce.AS)()),m(!1)}})):s(),m(!0),t?.()})()},disabled:W,wrapClassName:Be,children:(0,i.jsx)(O.sA,A?{id:"COMMON_DEVICE_STATE_ADOPTING"}:{id:y?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE":"DEVICE_ACTIONS_ADOPT"})})})}):null]}):(0,i.jsx)(R.A,{flexDirection:"column",children:!U||D&&C.model===e.model?null:(0,i.jsx)(Re,{name:C.name,model:C.model,mac:C.mac})})};var ze,Ge=n(976458),We=n(591256),He=n(313369),Fe=n(369343),Ye=n(570866),Ke=n(286462),Xe=n(535322),Qe=n(713035),Je=n(890932),Ze=n(857780);!function(e){e[e.AP=0]="AP",e[e.SWITCH=1]="SWITCH",e[e.DEFAULT=2]="DEFAULT"}(ze||(ze={}));const qe={[ze.AP]:()=>{const e=(0,a.d4)(Je.p),{motif:t}=(0,Qe.A)();return(0,i.jsx)(R.A,{justifyContent:"center",children:(0,i.jsx)("video",{height:226,loop:!0,muted:!0,autoPlay:!0,src:`${e}/resetButton/reset-AP_${t}.mp4`})})},[ze.SWITCH]:()=>{const e=(0,a.d4)(Je.p);return(0,i.jsx)(R.A,{justifyContent:"end",children:(0,i.jsx)("img",{width:326,height:226,src:`${e}/resetButton/switch.png`,alt:"reset"})})},[ze.DEFAULT]:()=>{const e=(0,a.d4)(Je.p);return(0,i.jsx)(R.A,{justifyContent:"center",children:(0,i.jsx)("img",{width:"100%",height:152,src:`${e}/resetButton/other.png`,alt:"reset"})})}},et={[Ze.W4.U5GMAX]:"DEVICE_RESET_DESC_LCM"},tt=["U7HD","U7NHD","UCXG","U7SHD","U7PG2","U7LR","U7LT","UAL6","UAP6","UALR6","UALR6v2","UALR6v3","UAP6MP","UAPL6","UALRPL6","U6ENT"],nt=["US24P250","S224250","US48P500","S248500","US8P150","S28150","USC8P150","US16P150","S216150","USL24P","USL24PB","US24PRO2","US24PRO","USLP24P","USL48","USL48B","USL48P","USL48PB","US48PRO","USLP48P","US48PRO2","USL16P","USL16PB","USXG","US6XG150","US624P","US648P","USXG24","USL8A","USAGGPRO","USL8MP"],it=({model:e})=>{const t=(0,s.useMemo)(()=>{const t=tt.includes(e),n=nt.includes(e);let i=ze.DEFAULT;return t?i=ze.AP:n&&(i=ze.SWITCH),i},[e]),n=qe[t];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(R.A,{marginTop:N.kc,children:[(0,i.jsx)(R.A,{marginRight:N.kc,children:(0,i.jsx)(w.A,{isActive:!0,variant:"fill",size:"original"})}),(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:et[e]||"DEVICE_PROPERTIES_RESET_DESC"})})]}),(0,i.jsx)(n,{})]})};var st=n(664092),at=n(463872);const ot=$.AH`
  margin-bottom: ${N.Ln};
`,lt=(0,D.A)("div")`
  align-self: center;
`,rt=({activeItem:e,activeItem:{mac:t,model:n,ip:o,state:l,last_uplink:r,mbb:c,type:d,wan_networkgroup:A}})=>{const m=(0,a.d4)(Fe.IN),u=(0,a.d4)(F.k4),E=(0,a.d4)(F.pV),_=(0,a.d4)(Fe.Eo),C=(0,a.d4)(F.YS),I=(0,a.d4)(We.C7),h=(0,a.d4)(Ge.TP),{motifPalette:{orange01:x}}=(0,B.u)(),p=(0,M.R30)({type:d,model:n})&&E&&!A,T=(0,j.S9)(e),v=T===je.g.MANAGED_BY_OTHER,D=T===je.g.ADOPTION_FAILED,[S,g]=(0,s.useState)(T===je.g.ADOPTING),f=(0,M.X6b)(e),P=(0,G.UA)(e);(0,s.useEffect)(()=>{g(T===je.g.ADOPTING)},[t,T]);let b=null;m&&_&&(I&&(b=(0,i.jsxs)(R.A,{flexDirection:"column",children:[(0,i.jsx)(O.sA,{id:"DEVICE_ADOPTION_LIMIT_REACHED_CLOUD_CONSOLE",values:{limit:_.limit}}),(0,i.jsx)(H.A,{id:"DEVICE_ADOPTION_MANAGE_CLOUD_CONSOLE_SUBSCRIPTION",href:h.replace(Ye.pG,"/console-settings")})]})),C&&(b=(0,i.jsx)(O.sA,{id:"DEVICE_ADOPTION_UNIFI_EXPRESS",values:{limit:_.limit,link:(0,i.jsx)(H.A,{href:Y.A.unifiConsoles,id:"DEVICE_ADOPTION_HIGHER_CAPACITY_CONSOLE"})}})));const L=b&&!S;return(0,i.jsxs)(i.Fragment,{children:[(0,M.JWq)(e)||(0,M.R$Q)(e)?(0,i.jsx)(J.A,{variant:"warning",children:(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:"DEVICE_POE_PASSTHROUGH_WARNING",values:{port:(0,M.R$Q)(e)?1:2}})})}):null,(0,i.jsx)(k.A,{className:ot,sections:[(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(R.A,{gap:N.kc,children:[(0,i.jsx)(q.A,{model:e.model,size:Z.Xh.MEDIUM,width:40,height:40}),(0,i.jsx)(lt,{children:(0,i.jsx)("div",{children:(0,i.jsx)(V.A,{weight:"bold",children:(0,z.Lm)(e.model)})})})]}),m?null:(0,i.jsx)($e,{device:e,onAdoptionInitiated:()=>g(!0),disabled:p}),v?(0,i.jsx)(it,{model:n}):null,L&&C&&D?(0,i.jsx)(ee.A,{device:e,variant:"tertiary"}):null]})]}),He.q[l]===je.g.ADOPTION_FAILED?(0,i.jsx)(X,{last_uplink:r}):null,L?(0,i.jsx)(W.A,{icon:(0,i.jsx)(w.A,{size:"original",isActive:!0,variant:"fill"}),children:(0,i.jsx)(V.A,{children:b})}):null,p?(0,i.jsx)(W.A,{icon:(0,i.jsx)(Q.k0,{size:"original",variant:"fill",color:x}),children:(0,i.jsx)(V.A,{children:(0,i.jsx)(O.sA,{id:"DEVICE_RESTRICT_ADOPTION_ONE_CELLULAR_DEVICE",values:{deviceName:u,model:(0,z.Lm)(e.model)}})})}):null,(0,M.zqY)({mbb:c})?(0,i.jsx)(at.A,{imei:c?.imei,eId:c?.esim?.eid,networkScanOperators:c?.network_scan?.operators||[],model:n}):null,(0,i.jsxs)(Xe.A,{children:[t?(0,i.jsxs)(st.A,{children:[(0,i.jsx)(V.A,{color:"text-2",size:"medium",children:(0,i.jsx)(O.sA,{id:"COMMON_MAC_ADDRESS"})}),(0,i.jsx)(V.A,{color:"text-3",size:"medium",children:t})]}):null,o?(0,i.jsxs)(st.A,{children:[(0,i.jsx)(V.A,{color:"text-2",size:"medium",children:(0,i.jsx)(O.sA,{id:"COMMON_IP_ADDRESS"})}),(0,i.jsx)(V.A,{color:"text-3",size:"medium",children:o})]}):null]}),f&&P&&!I?(0,i.jsx)(Xe.A,{type:Xe.I.BUTTON_LIST,children:(0,i.jsx)(Ke.A,{activeItem:e})}):null]})};var ct=n(374402);const dt=(0,s.memo)(e=>{const{activeItem:{type:t,data:n},content:l}=e,r=(0,a.d4)(o.oI),c=(0,a.d4)(o.Oh),d=(0,a.d4)(o.n6),A=r&&r in l.panels?r:l.defaultId,{formatMessage:m}=(0,O.tz)(),u=t===T.H.DEVICE&&!(0,j.YP)(n),E=(0,s.useMemo)(()=>{if(l.singlePanel)return ct.c;const t=Object.keys(l.panels).reduce((t,n)=>{const{disabled:i,title:s,icon:a}=l.panels[n];return i?.({...e})||t.push({value:n,label:s&&m({id:s}),icon:a}),t},[]);return t.length<2?ct.c:u?[{value:l.defaultId,label:m({id:l.panels[l.defaultId].title}),icon:l.panels[l.defaultId].icon}]:t},[e,l,u,m]),_=(0,s.useMemo)(()=>{if(u)return(0,i.jsx)(rt,{activeItem:n},"adopt-panel");if((d||c)&&l.subComponent)return(0,i.jsx)(l.subComponent,{activeItem:n,subPanel:d,subId:c});const{component:e}=l.panels[A];return(0,i.jsx)(e,{activeItem:n,subPanel:r})},[l,n,u,A,c,r,d]);return(0,i.jsxs)(s.Suspense,{fallback:null,children:[!l.singlePanel&&E.length>1&&!u?(0,i.jsx)(g,{tabs:E,currentTab:A}):null,(0,i.jsx)(U,{activeItem:n}),_]})});var At=n(929568),mt=n(847944),ut=n(279279);var Et=n(179060),_t=n(947414);const Ct=({activeItem:{data:e,type:t}})=>{const{formatMessage:n}=(0,O.tz)(),i=(0,ut.A)(),s=(0,At.B)(t);return s?.renderTitle(s?.getLabel(e,{formatMessage:n,formatDateTime:i})||"",e)||null},It=({id:e,panelType:t})=>{const n=(0,s.useRef)(null),r=(0,a.wA)(),{pathname:_}=(0,c.zy)(),C=(0,a.d4)(o.WS),I=(0,a.d4)(o.Em),x=(0,a.d4)(o.aK),T=(0,a.d4)(o.om),j=(0,a.d4)(o.gm),v=(0,a.d4)(o.LK),D=(0,a.d4)(o.oI),N=(0,a.d4)(o.S5),S=(0,a.d4)(E.P),g=(({id:e,type:t})=>{const{formatMessage:n}=(0,O.tz)(),i=(0,a.d4)((0,s.useMemo)(()=>e&&(0,At.B)(t)?.selectData(e,{formatMessage:n})||_t.P1,[e,t,n]))||{};return{type:t,data:i}})({id:e,type:t||v});((e,t)=>{const n=(0,a.wA)(),i=(0,s.useMemo)(()=>(0,mt.Tl)(t.type,e)?(0,mt.iy)(t.type,e):void 0,[t.type,e]),o=(0,mt.As)(t),l=(0,ut.A)(),r=(0,mt.Zs)(t,(0,O.tz)().formatMessage,l);(0,s.useEffect)(()=>{i&&n(void 0!==o.imageId&&void 0!==r?(0,u.WN)({id:i,element:o.image,label:r,closable:!0}):(0,u.CY)(i))},[n,i,r,o.imageId])})(e,g),(0,m.A)(e);const{views:f,currentViewId:P}=(0,s.useMemo)(()=>({views:S&&N.length>1?N:(0,l.A)(),currentViewId:N.find(({id:e})=>Boolean(j)&&Boolean(v)&&e.includes(j)&&e.includes(v))?.id}),[S,N,v,j]),b=(0,s.useCallback)(e=>{if(e===P){const t=f.filter(({id:t})=>t!==e).pop();if(t?.id){const[e,n]=t.id.split(Et._H);r((0,u.XP)({type:e,id:n}))}}r((0,u.CY)(e))},[r,f,P]),M=(0,s.useCallback)(()=>{P&&r((0,u.CY)(P)),r((0,u.DW)(_)),r((0,u.K5)())},[r,P,_]);(0,A.A)(()=>{C&&M()},[C]),(0,s.useEffect)(()=>{C&&!g.type&&M()},[C,g.type,M]);const R=(0,At.B)(g.type),L=g&&g.type&&Object.keys(g?.data||{})?.length?R?.content:void 0,y="function"==typeof L?L(g.data):L,U=R?.getContentRoot?.(e,g.data);(0,s.useEffect)(()=>{n.current&&(n.current.scrollTop=0)},[D]);const k=(0,s.useCallback)(e=>{const[t,n]=e.split(Et._H);r((0,u.XP)({type:t,id:n}))},[r]);return(0,s.useEffect)(()=>{C&&!y&&M()},[M,C,y]),y?(0,i.jsxs)(d.A,{in:C,header:(0,i.jsx)(Ct,{activeItem:g}),onClose:M,scrollableRef:n,views:f,currentViewId:P,onViewClick:k,onViewClose:b,className:ct.X,children:[U,C?(0,i.jsx)(dt,{content:y,activeItem:g}):null,I?(0,i.jsx)(p,{}):null,x||Object.keys(T).length&&!I?(0,i.jsx)(h,{propertyPanelNavigationPrompt:T}):null]},P||`${g.type}${Et._H}${e}`):null};var ht;!function(e){e.TYPE="type",e.ID="id",e.SUB_ID="subId"}(ht||(ht={}));const xt=Object.values(T.H);var pt=n(968021);var Tt=n(104997);const Ot=new RegExp(`/${Tt.VO.DEVICES}/properties/(.*)`);var jt=n(864099);const vt=({id:e,type:t})=>{const n=(0,s.useMemo)(()=>(0,At.B)(t)?.getDependencies(e)||(0,l.A)(),[t,e]);return(0,r.A)(n,e&&t?(0,i.jsx)(It,{id:e,panelType:t}):null)},Dt=(0,s.memo)(()=>{const{pathname:e,search:t}=(0,jt.A)(),n=(0,a.d4)(o.gm),l=(0,a.d4)(o.LK);((e,t,n)=>{const i=(0,a.wA)(),{pathname:l}=(0,c.zy)(),r=(0,pt.A)(l),d=(0,pt.A)(e),A=(0,a.d4)(o.oI),m=(0,a.d4)(o.SP),E=(0,a.d4)(o.RJ);(0,s.useEffect)(()=>{if(l!==r||e!==d){t&&n&&(r||d)&&!m&&i((0,u.mn)({[r||d]:{[C.QK.ID]:t,[C.QK.TYPE]:n,[C.QK.TAB]:A}}));const s=E[l||e];i(s&&!m?(0,u.XP)({[C.QK.ID]:s[C.QK.ID],[C.QK.TYPE]:s[C.QK.TYPE],[C.QK.TAB]:s[C.QK.TAB]}):(0,u.K5)())}},[i,l,r,e,d,t,n,A,E,m])})(e,n,l),(e=>{const t=(0,a.wA)();(0,s.useEffect)(()=>{const n=e.match(Ot)?.[1]?.split("/")?.[0];n&&t((0,u.XP)({type:T.H.DEVICE,id:n}))},[t,e])})(e),(e=>{const t=(0,a.wA)();(0,s.useEffect)(()=>{const n=new URLSearchParams(e),i=n.get(ht.TYPE),s=n.get(ht.ID),a=n.get(ht.SUB_ID);s&&xt.includes(i)&&t((0,u.XP)({type:i,id:s,subId:a}))},[t,e])})(t);const r=(0,s.useMemo)(()=>[n,l].join(),[n,l]);return n&&l?(0,i.jsx)(vt,{id:n,type:l},r):null})},864099(e,t,n){n.d(t,{A:()=>a});var i=n(602086),s=n(237725);const a=()=>{const e=(0,s.zy)(),[t,n]=(0,i.useState)(e.search),[a,o]=(0,i.useState)(e.pathname),l=(0,i.useCallback)(e=>{const{search:t,pathname:i}=e.target.location;n(t),o(i)},[]);return(0,i.useEffect)(()=>(window.addEventListener("replacestate",l),()=>{window.removeEventListener("replacestate",l)})),{search:t,pathname:a}}},279740(e,t,n){n.d(t,{A:()=>f});var i=n(602086),s=n(977872),a=n(244081),o=n(653547),l=n(348185),r=n(747922),c=n(79777),d=n(648552),A=n(795206),m=n(239627),u=n(45978),E=n(648126),_=n(223597);const C=new Map,I="device-watch-mode-listener",h=["mac","state"],x=["uplink_mac","type","unifi_device"],p=({mac:e,state:t},n)=>Boolean(e&&n)&&e!==n&&t===E.A[u.g.CONNECTED],T=e=>e.type!==_.sK.WIRELESS&&e.type!==_.sK.WIRED||e.unifi_device?void 0:e.uplink_mac;var O,j,v=n(222102),D=n(430328),N=n(897166),S=n(754924),g=n(34118);!function(e){e.DEVICE_MAC="device_mac",e.IS_WATCHED="is_watched",e.WATCHED_TIMEOUT="watched_timeout",e.UPDATE_INTERVAL_SECONDS="update_interval_seconds"}(O||(O={})),function(e){e.INSTANCES="instances",e.TIMEOUT="timeout"}(j||(j={}));const f=e=>{const t=(0,s.wA)(),n=(0,s.d4)((0,i.useMemo)(()=>{return t=e,(0,D.WY)()((0,v.Mz)((0,g.kV)(t,x),T),e=>e);var t},[e])),u=(0,i.useMemo)(()=>n||e,[n,e]),E=(0,s.d4)((0,i.useMemo)(()=>{return e=u,(0,D.WY)()((0,v.Mz)((0,S.bw)(e,h),N.vc,p),e=>e);var e},[u])),_=(0,s.d4)(c.a),f=(0,i.useMemo)(()=>_[d.Uz],[_]),P=(0,i.useCallback)(e=>{f.send({type:l.E.WATCH_DEVICE,device_mac:e})},[f]),b=(0,i.useCallback)(({[O.IS_WATCHED]:e,[O.WATCHED_TIMEOUT]:t,[O.DEVICE_MAC]:n})=>{if(e){const e=1e3*t;if(e>Date.now()){const t=C.get(n);t&&(t[j.TIMEOUT]=setTimeout(()=>{P(n)},(e=>Math.max(e-Date.now()-5e3,5e3))(e)))}}},[P]),M=(0,i.useCallback)(e=>(0,o.K6)(e,b,!1,(e=>`${I}::${e}`)(e)),[b]);(0,i.useEffect)(()=>{if(E){Object.keys((0,o.WM)()).some(e=>e.startsWith(I))||r._[l.E.WATCH_DEVICE].map(M);const e=C.get(u);e?e[j.INSTANCES]+=1:(P(u),C.set(u,{[j.INSTANCES]:1,[j.TIMEOUT]:void 0}))}return()=>{const e=C.get(u);e&&(e[j.INSTANCES]>1?e[j.INSTANCES]-=1:(clearTimeout(e[j.TIMEOUT]),C.delete(u)),C.size||Object.keys((0,o.WM)()).filter(e=>e.startsWith(I)).forEach(o.$N))}},[P,M,u,E]),(0,i.useEffect)(()=>{t((0,A.Uc)(void 0,{crudCacheStrategy:{type:a.e.CACHE}})),t((0,m.$3)(void 0,{crudCacheStrategy:{type:a.e.CACHE}}))},[t])}},105472(e,t,n){n.d(t,{A:()=>s});var i=n(602086);const s=(e,t=[])=>{const n=t=>{27===t.keyCode&&e(t)};(0,i.useEffect)(()=>(document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}),t)}},871808(e,t,n){n.d(t,{A:()=>o});var i=n(602086),s=n(977872),a=n(167933);const o=e=>(0,s.d4)((0,i.useMemo)(()=>(0,a.jN)(e),[e]))}}]);