"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[39187],{46119:(e,t,_)=>{_.d(t,{A:()=>N});const N={open:(e,t="_blank",_="noopener,noreferrer")=>window.open(e,t,_)}},937045:(e,t,_)=>{_.r(t),_.d(t,{default:()=>k});var N=_(956347),i=_(469733),s=_(296540),o=_(132196),l=_(778851),a=_(742920),n=_(46119),E=_(130851),I=_(928085),r=_(6176),A=_(675359),O=_(699784),u=_(811569),T=_(187483),C=_(417378),c=_(198494),S=_(789768),R=_(532419),d=_(573363),L=_(231226),m=_(727270),D=_(959341);const W=o.AH`
  width: auto !important;
  padding: 0 8px;
`,p=o.AH`
  button {
    border-radius: 0;
    font-size: 12px;
  }
`,g="LTE_PAYMENT_EXPIRED",P="LTE_SUBSCRIPTION_CANCELLED",M="LTE_SUBSCRIPTION_CHECK",h="HAS_WLAN_OVERRIDES",f="HAS_NETWORKS_LIMIT_REACHED",U="HAS_MDNS_NETWORKS_LIMIT",k=()=>{const{formatMessage:e}=(0,O.tz)(),t=(0,i.useDispatch)(),_=(0,N.W6)(),o=(0,i.useSelector)(c.GP),k=(0,i.useSelector)(c.Pk),G=(0,i.useSelector)(c.tg),w=(0,i.useSelector)(C.S$),y=(0,i.useSelector)(E.p),b=(0,i.useSelector)(T.ub),B=(0,i.useSelector)(R.hp),K=(0,i.useSelector)(R.$x),x=(0,i.useSelector)(d.A),H=(0,i.useSelector)(c.ay),Y=(0,i.useSelector)(R.gj),v=(0,i.useSelector)(L.xj),V=(0,i.useSelector)(L.EF),$=(0,i.useSelector)((0,s.useMemo)(()=>(0,L.wI)(k),[k])),j=(0,i.useSelector)(L.bx),X=(0,i.useSelector)(L.gj),z=(0,i.useSelector)(L.Ji),F=(0,l.Qh)(w),J=(0,I.A)(D._L),Q=(0,I.A)(D.Cs);(0,s.useEffect)(()=>{o&&v.length&&t((0,A.ox)({onClose:()=>t((0,A.uU)(g)),type:a.C.warning,title:e({id:"ON_LOAD_WARNING_PAYMENT_EXPIRED_TITLE"}),message:"ON_LOAD_WARNING_PAYMENT_EXPIRED_BODY",icon:s.createElement(r.C,{className:W,model:Y,imagePath:y,theme:H,deviceModelMap:x}),stateIndicator:a.C.info,primaryButton:{label:e({id:"ON_LOAD_WARNING_PAYMENT_ACTION_UPDATE_PAYMENT"}),onClick:()=>n.A.open(`${m.DU}${F}/payments`)},className:p},g))},[F,t,e,Y,o,v.length,H,y,x]),(0,s.useEffect)(()=>{o&&V.length&&t((0,A.ox)({onClose:()=>t((0,A.uU)(P)),type:a.C.danger,title:e({id:"ON_LOAD_WARNING_SUBSCRIPTION_CANCELLED_TITLE"}),message:"ON_LOAD_WARNING_SUBSCRIPTION_CANCELLED_BODY",icon:s.createElement(r.C,{className:W,model:Y,imagePath:y,theme:H,deviceModelMap:x}),stateIndicator:a.C.info,primaryButton:{label:e({id:"ON_LOAD_WARNING_PAYMENT_ACTION_UPDATE_PAYMENT"}),onClick:()=>n.A.open(`${m.DU}${F}/payments`)},className:p},P))},[F,t,e,o,H,Y,V.length,y,x]);const Z=(0,s.useCallback)(()=>{t((0,A.uU)(M)),t((0,u.ZS)($,e))},[t,e,$]);return(0,s.useEffect)(()=>{o&&$.length&&t((0,A.ox)({duration:0,onClose:()=>t((0,A.uU)(M)),type:a.C.warning,title:e({id:"ON_LOAD_WARNING_VERIFY_ACCOUNT_TITLE"}),message:"LTE_ACTIONS_SUBSCRIPTION_CHECK_TOOLTIP",icon:s.createElement(r.C,{className:W,model:Y,imagePath:y,theme:H,deviceModelMap:x}),stateIndicator:a.C.info,primaryButton:{label:e({id:"LTE_ACTIONS_SUBSCRIPTION_CHECK"}),onClick:Z},className:p},M))},[t,Z,e,Y,o,$.length,y,x,H]),(0,s.useEffect)(()=>{o&&X&&!b&&!G.dismissWlanOverrides&&t((0,A.ox)({duration:0,type:a.C.warning,title:e({id:"ON_LOAD_WARNING_WLAN_OVERRIDES_TITLE"}),message:"ON_LOAD_WARNING_WLAN_OVERRIDES_DESCRIPTION",primaryButton:{label:e({id:"ON_LOAD_WARNING_WLAN_OVERRIDES_CTA"}),onClick:()=>{t((0,A.uU)(h)),t((0,S.i4)({dismissWlanOverrides:!0})).then(()=>_.push(J))}},onClose:()=>{t((0,S.i4)({dismissWlanOverrides:!0}))}},h))},[t,e,o,X,G,b,J,_]),(0,s.useEffect)(()=>{o&&j?.limit_reached&&!b&&t((0,A.ox)({duration:0,onClose:()=>t((0,A.uU)(f)),type:a.C.warning,title:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REACHED_TITLE"}),message:"ON_LOAD_WARNING_NETWORKS_LIMIT_REACHED_DESCRIPTION",values:{networksLimit:j.network_limit},primaryButton:{label:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REVIEW_NETWORKS"}),onClick:()=>{t((0,A.uU)(f)),_.push(Q)}}},f))},[t,e,o,j,G,b,Q,_]),(0,s.useEffect)(()=>{o&&z?.exceeded&&!b&&t((0,A.ox)({duration:0,type:a.C.warning,title:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REACHED_TITLE"}),details:e({id:"ON_LOAD_WARNING_MDNS_NETWORKS_LIMIT"},{gatewayName:B||K,limit:z?.limit}),primaryButton:{label:e({id:"ON_LOAD_WARNING_NETWORKS_LIMIT_REVIEW_NETWORKS"}),onClick:()=>{t((0,A.uU)(U)),_.push(Q)}},onClose:()=>t((0,A.uU)(U))},U))},[o,z,B,b,e,_,Q,t,K]),null}}}]);