"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[23405,49810],{55896:(e,t,a)=>{a.d(t,{A:()=>u});var l=a(469733),n=a(296540),i=a(758649),s=a(458833),r=a(592510),o=a(566723),d=a(294303),m=a(699784),c=a(784998),_=a(638310),E=a(602021),A=a(727270);const u=(0,n.memo)(()=>{const e=(0,l.useDispatch)(),t=(0,l.useSelector)(E.LF),a=(0,l.useSelector)(c.F_),u=(0,l.useSelector)(c.K2),S=(0,n.useMemo)(()=>a.length&&u?`${A.DU}${a[0]}:${u}/manage/hotspot-manager/account/login/${t}`:void 0,[a,u,t]),p=(0,n.useCallback)(async()=>navigator.clipboard.writeText(S),[S]);return(0,n.useEffect)(()=>{e((0,_.E)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[e]),S?n.createElement(d.A,{marginTop:o.YC,gap:o.kc,alignItems:"center"},n.createElement(s.A,{isActive:!0,variant:"fill"}),n.createElement(i.A,{type:"button",variant:"inline",onClick:p},n.createElement(m.sA,{id:"ADMINS_HOTSPOT_MANAGER_COPY_URL"}))):null})},121e3:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(296540),n=a(951272),i=a(847883),s=a(143811),r=a(699784),o=a(740244),d=a(947089);const m=({disabled:e,permissions:t})=>{const{setFieldValue:a}=(0,n.j7)();return l.createElement(i.A,{style:{alignItems:"center"}},l.createElement(s.A,{name:"permissions",type:"realCheckbox",disabled:e,onChange:()=>a("permissions",t.includes(d.aX.ADOPT_DEVICES)?t.filter(e=>e!==d.aX.ADOPT_DEVICES):[...t,d.aX.ADOPT_DEVICES]),checked:t.includes(d.aX.ADOPT_DEVICES)},l.createElement(r.sA,{id:"ADMINS_ALLOW_ADOPTION"})))},c=({role:e,...t})=>e===o.e.READ_ONLY?l.createElement(m,{...t}):null},133337:(e,t,a)=>{a.d(t,{w:()=>n});var l=a(691189);const n=(e={},t={})=>(0,l.t9)("allSiteAdmins","/api/stat/admin",e,t)},151360:(e,t,a)=>{a.d(t,{A:()=>l});const l=(0,a(71479).A)("div",{shouldForwardProp:e=>"hidden"!==e&&"height"!==e})`
  /* Height animation from UIC <Accordion/> */
  transition:
    height 300ms cubic-bezier(0.7, 0, 0.3, 1),
    opacity 100ms ease-in;
  height: ${e=>e.height}px; // cannot animate to height: auto
  opacity: 1;
  ${e=>e.hidden&&"\n    visibility: hidden;\n    height: 0;\n    min-height: unset;\n    opacity: 0;\n  "}
`},175886:(e,t,a)=>{a.d(t,{c:()=>n,v:()=>i});var l=a(740244);const n=({is_super:e,role:t})=>{if(e&&t===l.e.ADMIN)return"ADMINS_ROLE_ADMINISTRATOR";switch(t){case l.e.ADMIN:case l.e.SUPER_ADMIN:return"ADMINS_ROLE_SITE_ADMINISTRATOR";case l.e.READ_ONLY:return"ADMINS_ROLE_VIEW_ONLY";case l.e.HOTSPOT:return"COMMON_SIDE_NAV_HOTSPOT";case l.e.MULTIPLE:return"COMMON_MULTIPLE";default:return"COMMON_FALLBACK"}},i=({name:e,email:t})=>e||t},186745:(e,t,a)=>{a.d(t,{f:()=>o,p:()=>d});var l=a(801081),n=a(25553),i=a(87485),s=a(133337);const r=(0,n.uh)((0,s.w)()),o=(0,l.Mz)(r,i.kh),d=e=>(0,l.Mz)(o,t=>t.find(({_id:t})=>t===e))},197562:(e,t,a)=>{a.d(t,{A:()=>i});var l=a(71479),n=a(566723);const i=(0,l.A)("div")`
  height: 100%;
  flex: 1;
  overflow: scroll;
  margin-left: ${n.Ln};
  padding: ${n.Ln} 0 0 0;
`},329109:(e,t,a)=>{a.d(t,{A:()=>m});var l=a(296540),n=a(691441),i=a(71479),s=a(132196),r=a(373229);const o=(0,i.A)("div")`
  height: 66px;
`,d=s.AH`
  padding: 0px !important;
`,m=({isDirty:e,onFormSubmit:t,onFormCancel:a,isInvalid:i,...s})=>e?l.createElement(n.A,null,l.createElement(r.A,{isDirty:e,onFormCancel:a,onFormSubmit:t,isInvalid:i,className:d,...s})):l.createElement(o,null)},373229:(e,t,a)=>{a.d(t,{A:()=>d});var l=a(296540),n=a(758649),i=a(71479),s=a(566723),r=a(699784);const o=(0,i.A)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${s.S2} ${s.fS};
  gap: ${s.kc};
`,d=({allowCancel:e,isDirty:t,isInvalid:a,isSubmitting:i,onFormSubmit:s,onFormReset:d,onFormCancel:m,className:c,submitButtonText:_,customButton:E,applyButton:A,applyButtonFirst:u,hideCancelButton:S,form:p})=>{const I=(0,l.useMemo)(()=>A||l.createElement(n.A,{name:"submit",variant:"primary",type:"submit",onClick:s,disabled:!t||a||i,form:p},l.createElement(r.sA,{id:_||"COMMON_ACTION_APPLY_CHANGES"})),[A,p,t,a,i,s,_]);return l.createElement(o,{className:c,hasFormResetButton:!!d},u?I:E,S?null:l.createElement(n.A,{name:"cancel",variant:"default",type:"button",onClick:m,disabled:!e&&!t},l.createElement(r.sA,{id:"COMMON_ACTION_CANCEL"})),d?l.createElement(n.A,{name:"reset",variant:"default",type:"button",onClick:d,disabled:!t},l.createElement(r.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULTS"})):null,u?E:I)}},526075:(e,t,a)=>{a.d(t,{Ag:()=>h,ic:()=>p,VF:()=>A,Gg:()=>E,t7:()=>I,qg:()=>O,T7:()=>N,rz:()=>S,Rr:()=>M});var l=a(429252),n=a.n(l),i=a(691189),s=a(294201),r=a(887831),o=a(776309),d=a(126457),m=a(740244);const c="/api/s/{site}/cmd/sitemgr",_=e=>e?c.replace("{site}",e):c,E=(e,t)=>(0,i.Xj)(s.A.GRANT_ADMIN,_(t),e),A=(e={},t={})=>(0,i.t9)("admins",c,{data:{cmd:s.A.GET_ADMINS},...e},{method:r.A.POST,...t}),u=(e,t)=>(0,i.Xj)(s.A.GRANT_SUPER_ADMIN,_(t),e),S=(e,t)=>(0,i.Xj)(s.A.REVOKE_SUPER_ADMIN,_(t),{admin:e}),p=({name:e,email:t,requires_new_password:a,role:l,x_password:n,permissions:r,super_site_permissions:o})=>async d=>{const _=await d((0,i.Xj)(s.A.CREATE_ADMIN,c,{name:e,email:t,requires_new_password:a,x_password:n,permissions:r,role:l===m.e.SUPER_ADMIN?m.e.READ_ONLY:l})),E=_?.data[0]||{};return l===m.e.ADMIN?await d(u({admin:E._id,role:"nobody",permissions:o})):l===m.e.SUPER_ADMIN&&await d(u({admin:E._id})),_},I=({name:e,email:t,role:a,for_sso:l,permissions:n,super_site_permissions:r})=>async o=>o((0,i.Xj)(s.A.INVITE_ADMIN,c,{name:e,email:t,role:a,for_sso:l,permissions:n,super_site_permissions:r})),N=(e,t)=>(0,i.Xj)(s.A.REVOKE_ADMIN,_(t),{admin:e}),O=(e,t,a)=>async l=>(t&&await l(S(e,a)),l(N(e,a))),M=(e,t,a=void 0)=>async l=>{const r=e.role===m.e.SUPER_ADMIN,o=!r&&t.is_super,d=r&&!t.is_super,c=!n()(e.permissions,t.permissions),p=e.role!==t.role&&[m.e.READ_ONLY,m.e.ADMIN].includes(e.role),I=!(0===e.super_site_permissions?.length&&!t.super_site_permissions||n()(e.super_site_permissions,t.super_site_permissions));return await l(((e,t)=>(0,i.Xj)(s.A.UPDATE_ADMIN,_(t),{...e,role:e.role===m.e.SUPER_ADMIN?m.e.READ_ONLY:e.role}))(e,a)),o&&await l(S(e.admin,a)),d&&await l(u({admin:e.admin},a)),r||((p||c)&&await l(E({admin:e.admin,role:e.role,permissions:e.permissions},a)),I&&await l(u({admin:e.admin,permissions:e.super_site_permissions,role:"nobody"},a))),l(A())},h=({name:e,onConfirm:t,withRemoveGlobalPermissions:a})=>l=>l((0,d.to)({modalType:o.A.CONFIRM_ADMIN_REMOVE,modalProps:{name:e,onConfirm:t,withRemoveGlobalPermissions:a}}))},563715:(e,t,a)=>{a.d(t,{Hq:()=>r,T_:()=>d,gH:()=>m,dt:()=>o});var l=a(516693),n=a(691189),i=a(887831);const s="/api/s/{site}/rest/hotspotop",r=(e={},t={})=>(0,n.t9)("hotspotOperators",s,e,{idField:"_id",...t}),o=(e,t={},a={})=>(0,n.vB)(l.aC,null,null,i.A.PUT,`${s}/${e}`,t,t.data,a),d=(e={},t={})=>a=>a((0,n.vB)(l.aC,null,null,i.A.POST,s,e,e.data,t)).then(()=>a(r())),m=(e,t={},a={})=>o=>o((0,n.vB)(l.aC,null,null,i.A.DELETE,`${s}/${e}`,t,a)).then(()=>o(r()))},615509:(e,t,a)=>{a.r(t),a.d(t,{default:()=>kt});var l=a(956347),n=a(296540),i=a(136048),s=a(592510),r=a(834959),o=a(413357),d=a(582724),m=a(860923),c=a(627440),_=a(469733),E=a(415331),A=a(801081),u=a(189601),S=a(83604),p=a(249304),I=a(197562),N=a(566723),O=a(905410),M=a(699784),h=a(740244),T=a(951272),C=a(742920),g=a(675359),b=a(25553),D=a(87485),R=a(563715);const f=(0,b.uh)((0,R.Hq)()),v=(0,A.Mz)(f,D.kh);var L=a(870443),w=a(546391);const y=L.A.object().shape({name:L.A.string().label("COMMON_LABEL_USERNAME").required().matches(w.mJ,{message:n.createElement(M.sA,{id:"ADMINS_ADMIN_USERNAME_REGEX"})}),x_password:L.A.string().label("COMMON_PASSWORD").required()});var P=a(847883),x=a(81126),H=a(71479),k=a(776309),V=a(705426),B=a(143811),F=a(126457),z=a(55896);const U=(0,H.A)(V.A)`
  background-color: ${({theme:{motifPalette:{neutral01:e}}})=>e};
  > div {
    overflow: hidden !important;
  }
`,$=({hotspotOperatorId:e,closeModal:t})=>{const a=(0,_.useDispatch)(),{isSubmitting:l,handleSubmit:i,values:{name:s}}=(0,T.j7)(),r=(0,n.useCallback)(()=>a((0,R.gH)(e)).then(()=>{t()}).catch(()=>a((0,g.ox)({icon:C.C.danger,message:"COMMON_NOTICE_REMOVE_ERROR",values:{name:s}}))),[a,t,s,e]),o=(0,n.useCallback)(()=>a((0,F.to)({modalType:k.A.CONFIRM_HOTSPOT_OPERATOR_REMOVE,modalProps:{name:s,onConfirm:r}})),[a,r,s]),d=(0,n.useMemo)(()=>[{disabled:l,text:n.createElement(M.sA,{id:"COMMON_ACTION_REMOVE"}),type:"button",variant:"default",onClick:o},{disabled:l,text:n.createElement(M.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",variant:"default",onClick:t},{disabled:l,text:n.createElement(M.sA,{id:"COMMON_ACTION_SAVE_CHANGES"}),type:"button",variant:"primary",onClick:()=>i()}].filter(Boolean),[t,o,i,l]);return n.createElement(U,{size:"small",isOpen:Boolean(e),onRequestClose:t,title:n.createElement(M.sA,{id:"ADMINS_EDIT_ACCOUNT"}),actions:d},n.createElement(P.A,null,n.createElement(x.A,{column:!0,unlimitedWidth:!0},n.createElement(B.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME"}))),n.createElement(P.A,null,n.createElement(x.A,{column:!0,unlimitedWidth:!0},n.createElement(B.A,{full:!0,name:"x_password",type:"password",variant:"secondary",label:"COMMON_PASSWORD",autoComplete:"new-password",passwordToggle:!0}))),n.createElement(z.A,null))},G=({hotspotOperatorId:e,closeModal:t})=>{const a=(0,_.useDispatch)(),{_id:l,name:i,x_password:s}=(0,_.useSelector)((0,n.useMemo)(()=>{return t=e,(0,A.Mz)(v,e=>e.find(({_id:e})=>t===e)||{});var t},[e])),r=(0,n.useCallback)(({name:e,x_password:n},{resetForm:i,setSubmitting:s})=>a((0,R.dt)(l,{data:{name:e,x_password:n}})).then(()=>{a((0,R.Hq)()),t(),i()}).catch(({msg:t})=>a((0,g.ox)({icon:C.C.danger,message:"ADMINS_EDIT_ADMIN_ERROR",values:{name:e},errorMessage:t}))).finally(()=>{s(!1)}),[l,a,t]),o=(0,n.useMemo)(()=>({name:i,x_password:s}),[i,s]);return n.createElement(T.l1,{enableReinitialize:!0,initialValues:o,validationSchema:y,onSubmit:r},n.createElement($,{closeModal:t,hotspotOperatorId:e}))};var W,Y=a(271856),j=a(927099),K=a(822336),q=a(538205),X=a(396660),J=a(294303),Z=a(362156),Q=a(175886);!function(e){e.NAME="name",e.STATUS="is_verified",e.EMAIL="email",e.SITES="sites",e.ROLE="role",e.LAST_LOGIN="last_login",e.LAST_SITE="last_site_name"}(W||(W={}));const ee={[W.NAME]:312,[W.STATUS]:132,[W.EMAIL]:312,[W.SITES]:126,[W.ROLE]:394,[W.LAST_SITE]:126,[W.LAST_LOGIN]:312},te={[W.NAME]:n.createElement(M.sA,{id:"COMMON_NAME"}),[W.STATUS]:n.createElement(M.sA,{id:"COMMON_STATUS"}),[W.EMAIL]:n.createElement(M.sA,{id:"COMMON_EMAIL"}),[W.SITES]:n.createElement(M.sA,{id:"COMMON_SITES"}),[W.ROLE]:n.createElement(M.sA,{id:"ADMINS_ROLE_LABEL"}),[W.LAST_SITE]:n.createElement(M.sA,{id:"ADMINS_LAST_SITE"}),[W.LAST_LOGIN]:n.createElement(M.sA,{id:"ADMINS_LAST_LOGIN"})};var ae=a(616009),le=a(758649),ne=a(602021),ie=a(489949);const se=({siteName:e})=>{const t=(0,_.useDispatch)(),a=(0,_.useSelector)(ne.Gd),l=(0,_.useSelector)(ne.n),i=(0,n.useMemo)(()=>l.reduce((e,{name:t,desc:a})=>(e[t]=a,e),{}),[l]);return n.createElement(le.A,{variant:"inline",onClick:l=>{l.stopPropagation(),t((0,ie.h)(e)).then(()=>{window.location.href=`${window.location.href.substring(0,window.location.href.indexOf(a.name))}${e}/dashboard${window.location.search}`})}},n.createElement(j.A,{color:"inherit",size:"body"},i[e]||e))},re=({verified:e,verifiedMessage:t})=>n.createElement(j.A,{color:e?"success":"warning",size:"body"},e&&t||n.createElement(M.sA,{id:e?"COMMON_ACTIVE":"ADMINS_PENDING"})),oe=({header:{id:e}})=>te[e],de=(0,H.A)(J.A)`
  margin-left: ${N.YC}; // align with the header label padding
`,me=({sites:e})=>n.createElement(J.A,{flexDirection:"column",gap:N.YC},e.map(e=>n.createElement("div",{key:e},e))),ce=(0,H.A)(J.A)`
  background: ${({theme:{motifPalette:{uBlue01:e}}})=>e};
  color: ${({theme:{motifPalette:{uBlue06:e}}})=>e};
  border-radius: ${K.Ay["desktop-radius-base"]};
  text-transform: uppercase;
  padding: 0 ${N.kc};
  height: 16px;
`,_e=()=>n.createElement(ce,{justifyContent:"center",alignItems:"center"},n.createElement(j.A,{weight:"bold",size:"label",color:"info"},n.createElement(M.sA,{id:"COMMON_YOU"})));var Ee=a(967431),Ae=a(840124),ue=a(314714),Se=a(162420),pe=a(329109),Ie=a(689965),Ne=a(151360),Oe=a(198494),Me=a(789768),he=a(186745),Te=a(133337),Ce=a(526075);const ge=(0,b.uh)((0,Ce.VF)()),be=(0,A.Mz)(ge,D.kh);var De=a(695415),Re=a(947089);const fe=L.A.object().shape({name:L.A.string().label("COMMON_LABEL_USERNAME").required().matches(w.mJ,{message:n.createElement(M.sA,{id:"ADMINS_ADMIN_USERNAME_REGEX"})}),email:L.A.string().when("requires_new_password",{is:!1,then:L.A.string().label("COMMON_EMAIL").email().required()}),email_alert_grouping_enabled:L.A.boolean().label("COMMON_GROUP_SIMILAR_NOTIFICATIONS"),email_alert_grouping_delay:L.A.number().when("email_alert_grouping_enabled",{is:!0,then:L.A.number().label("COMMON_GROUP_WITHIN").required().min(1).max(60)}),x_password:L.A.string().when(["isSelf","requires_new_password"],{is:(e,t)=>e&&t,then:L.A.string().label("ADMINS_CURRENT_PASSWORD_LABEL").required()}),x_oldpassword:L.A.string().when(["isSelf"],{is:!0,then:L.A.string().when(["requires_new_password"],{is:!1,then:L.A.string().label("ADMINS_CURRENT_PASSWORD_LABEL").required()})})});var ve;!function(e){e.HTML="html_email_enabled",e.PROF="is_professional_installer"}(ve||(ve={}));const Le=[{value:ve.HTML,label:"COMMON_ENABLE_HTML_EMAIL_TEMPLATE"},{value:ve.PROF,label:"COMMON_ENABLE_OPTIONS_FOR_PROF_INST"}];var we=a(734707);const ye=({siteAdmin:{name:e,_id:t,super_roles:a},onRemove:l})=>{const i=(0,_.useDispatch)(),[s,r]=(0,n.useState)(!1);return n.createElement(we.Ay,{variant:"link",onClick:()=>{i((0,Ce.Ag)({name:e,withRemoveGlobalPermissions:!1,onConfirm:()=>(r(!0),i(a?.length?(0,Ce.rz)(t):(0,Ce.T7)(t)).then(l).catch(()=>i((0,g.ox)({icon:C.C.danger,message:"COMMON_NOTICE_REMOVE_ERROR",values:{name:e}}))).finally(()=>r(!1)))}))},loader:s?"spinner":null,type:"button"},n.createElement(J.A,{alignItems:"center",justifyContent:"flex-start"},n.createElement(j.A,{size:"inherit",color:"danger"},n.createElement(M.sA,{id:"COMMON_ACTION_REMOVE"}))))};var Pe=a(649810);const xe=({onConfirm:e,isValid:t,...a})=>{const l=(0,_.useDispatch)();return n.createElement(Pe.default,{message:"ADMINS_CONFIRM_CHANGES_PASSWORD_DESCRIPTION",title:"ADMINS_CONFIRM_CHANGES",confirmButtonProps:{disabled:!t},onConfirm:()=>{e(),l((0,F.AS)())},...a})};var He=a(963070),ke=a(617147),Ve=a(616093),Be=a(121e3);const Fe=(0,H.A)("footer")`
  padding: 0 ${N.Er} ${N.Er} ${N.Er};
`,ze=({children:e})=>n.createElement(Fe,null,e),Ue=(0,H.A)("div")`
  margin-right: auto;
`,$e=(0,H.A)(x.A)`
  align-items: center;
  gap: ${N.Ln};
`,Ge=(0,H.A)(le.A)`
  margin-top: ${N.Ln};
`,We=({siteRole:e,closeModal:t,onRemoveSiteAdmin:a,invite:l})=>{const{formatMessage:i}=(0,M.tz)(),s=(0,_.useDispatch)(),[r,o]=(0,n.useState)(!1),{values:{role:d,permissions:m},isSubmitting:c,handleSubmit:E}=(0,T.j7)(),A=()=>{l&&!r&&(o(!0),s((0,Ce.t7)({name:l.name,email:l.email,for_sso:l.for_sso,super_site_permissions:l.super_site_permissions,role:d,permissions:m})).catch(({msg:e})=>s((0,g.ox)({icon:C.C.danger,message:"ADMINS_INVITE_ERROR",values:{name:l.name},errorMessage:e}))).then(()=>{s((0,Te.w)()),s((0,Ce.VF)()),t()}).finally(()=>o(!1)))},u=c||r;return n.createElement(ke.A,{isOpen:!0,size:"small",allowOverflow:!0,onRequestClose:t,title:`${e.site_desc} ${i({id:"ADMINS_PERMISSIONS_LABEL"})}`,footer:n.createElement(ze,null,n.createElement(J.A,{alignItems:"center",justifyContent:"flex-end",gap:N.kc},n.createElement(Ue,null,n.createElement(le.A,{type:"button",disabled:u,variant:"tertiary",onClick:a},n.createElement(j.A,{size:"inherit",color:"danger"},n.createElement(M.sA,{id:"COMMON_ACTION_REMOVE"})))),n.createElement(le.A,{type:"button",disabled:u,variant:"default",onClick:t},n.createElement(M.sA,{id:"COMMON_ACTION_CANCEL"})),n.createElement(le.A,{type:"button",disabled:u,variant:"primary",onClick:()=>l?A():E()},n.createElement(M.sA,{id:"COMMON_ACTION_APPLY_CHANGES"}))))},n.createElement(J.A,{paddingLeft:N.xO,flexDirection:"column"},n.createElement(Be.A,{role:d,permissions:m,disabled:u}),n.createElement(P.A,null,n.createElement($e,{column:!1,unlimitedWidth:!0},n.createElement(B.A,{type:"dropdown",sortedDropdown:!0,variant:"secondary",name:"role",options:(S=!!l,Ve.A.filter(({value:e})=>e!==h.e.HOTSPOT&&(!S||e!==h.e.SUPER_ADMIN))),translateOptions:!0,validated:!0,full:!0,label:"ADMINS_ROLE_LABEL",translateLabel:!0,placeholder:"COMMON_CHOOSE_AN_OPTION",translatePlaceholder:!0,disabled:u}),l?n.createElement(Ge,{disabled:u,variant:"inline",onClick:A},n.createElement(M.sA,{id:"ADMINS_RE_INVITE"})):null))));var S},Ye=({adminId:e,adminName:t,invite:a,siteRole:l,closeModal:i})=>{const s=(0,_.useDispatch)(),r=(0,_.useSelector)(Oe.fR),o=(0,n.useMemo)(()=>({role:l.is_super&&l.role===h.e.ADMIN?h.e.SUPER_ADMIN:l.role,permissions:l.permissions}),[l]),d=()=>{s((0,Te.w)()),s((0,Ce.VF)()),i()};return n.createElement(T.l1,{enableReinitialize:!0,initialValues:o,onSubmit:({role:t,permissions:a},{setSubmitting:n,resetForm:i})=>{s((0,Ce.Rr)({admin:e,role:t,permissions:a,is_super:t===h.e.SUPER_ADMIN},{admin:e,role:l.role,permissions:l.permissions,is_super:l.is_super},l.site_name)).then(d).finally(()=>{n(!1),i()})}},n.createElement(We,{siteRole:l,onRemoveSiteAdmin:()=>{i(),s((0,Ce.Ag)({name:t,withRemoveGlobalPermissions:r&&l.is_super,onConfirm:a=>s((0,Ce.qg)(e,a,l.site_name)).then(d).catch(()=>s((0,g.ox)({icon:C.C.danger,message:"COMMON_NOTICE_REMOVE_ERROR",values:{name:t}})))}))},invite:a,closeModal:i}))},je=(0,H.A)("div")`
  margin-right: ${N.YC};
  pointer-events: none;
`,Ke=[{id:"site_desc",label:n.createElement(M.sA,{id:"COMMON_SITE"}),sortable:!0,minWidth:100,renderCell:({site_desc:e})=>n.createElement(j.A,{size:"body",color:"secondary"},e)},{id:"role",label:n.createElement(M.sA,{id:"ADMINS_ROLE_LABEL"}),sortable:!0,minWidth:150,renderCell:({role:e,is_super:t},a,l,{rowHovered:i})=>n.createElement(J.A,{width:"100%",justifyContent:"space-between"},n.createElement(j.A,{size:"body",color:"secondary"},n.createElement(M.sA,{id:(0,Q.c)({role:e,is_super:t})})),i?n.createElement(je,null,n.createElement(j.A,{size:"inherit",color:"info"},n.createElement(M.sA,{id:"COMMON_ACTION_EDIT"}))):null)}],qe=({adminId:e,adminName:t,invite:a,roles:l,isSuper:i})=>{const s=(0,_.useDispatch)(),r=(0,_.useSelector)(ne.n),o=(0,n.useMemo)(()=>r.every(({name:e})=>l.some(({site_name:t})=>t===e)),[r,l]),[d,m]=(0,n.useState)(null),c=(0,n.useCallback)(()=>{s((0,F.to)({modalType:k.A.ADD_ADMIN_MODAL,modalProps:{adminId:e}}))},[s,e]),E=(0,n.useMemo)(()=>l.map(e=>({...e,is_super:i})),[l,i]),A=(0,n.useCallback)(()=>{m(null)},[]);return n.createElement(J.A,{alignItems:"flex-start",flexDirection:"column",gap:N.kc},o||a?null:n.createElement(le.A,{variant:"link",type:"submit",onClick:c},n.createElement(j.A,{size:"body",color:"inherit"},n.createElement(M.sA,{id:"ADMINS_ADD_SITE_PERMISSION"}))),n.createElement(He.A,{truncateHeaderCells:!0,columns:Ke,items:E,idField:"site_id",onRowClick:m,disableColumnFilters:!0,disableTextPointer:!0,disableSelection:!0}),d?n.createElement(Ye,{siteRole:d,invite:a,adminId:e,adminName:t,closeModal:A}):null)},Xe=({id:e,value:t,children:a})=>t||a?n.createElement(J.A,{justifyContent:"space-between"},n.createElement(j.A,{size:"body"},n.createElement(M.sA,{id:e})),t?n.createElement(j.A,{color:"tertiary",size:"body"},t):null,a):null,Je=({labelId:e,field:t,tooltipMessageId:a,children:l,disabled:i,allowReadOnly:s})=>n.createElement(J.A,{alignItems:"center",height:De.I.ROW_HEIGHT},l??n.createElement(B.A,{name:t,type:"realCheckbox",disabled:i,allowReadOnly:s}),n.createElement(j.A,{size:"body",color:i?"disabled":"inherit"},n.createElement(J.A,{alignContent:"center",gap:N.YC},n.createElement(M.sA,{id:e}),a?n.createElement(Y.A,{description:n.createElement(M.sA,{id:a}),portal:!0},n.createElement(Se.A,{style:{marginBottom:"2px"},isActive:!0,size:"original"})):null))),Ze=({labelId:e,field:t,permission:a,disabled:l})=>{const{values:i,setFieldValue:s}=(0,T.j7)(),r=i[t];return r?n.createElement(Je,{labelId:e,field:t,disabled:l},n.createElement(ue.A,{id:"adoption",checked:r.includes(a),disabled:l,onChange:({target:{checked:e}})=>s(t,e?[...r,a].sort():r.filter(e=>e!==a))})):null},Qe=({headingId:e,children:t,...a})=>n.createElement(Ie.A,{flex:"1 1 100%"},e&&n.createElement(j.A,{size:"header-xs",weight:"bold"},n.createElement(M.sA,{id:e})),n.createElement(J.A,{gap:N.kc,marginTop:e?N.Ln:void 0,flexDirection:"column",...a},t)),et=(e,t,a,l)=>{if(a){const{email_alert_grouping_delay:e}=l||{};return{...l||{},x_oldpassword:"",x_password:"",isSelf:a,...e?{email_alert_grouping_delay:(0,Ee.A)(e/60,2)}:{}}}return{push_alert_enabled:t?.push_alert_enabled,email_alert_enabled:t?.email_alert_enabled,super_site_permissions:[],...e||{},x_password:"",role:e?.is_super?h.e.SUPER_ADMIN:e?.role,isSelf:a,email_alert_grouping_delay:e?.email_alert_grouping_delay?(0,Ee.A)(e.email_alert_grouping_delay/60,2):1}},tt=({adminId:e,adminName:t,close:a})=>{const l=(0,_.useDispatch)(),i=(0,_.useSelector)(Oe.fR),s=(0,_.useSelector)(Oe.rK),r=(0,_.useSelector)(Oe.lt),o=(0,_.useSelector)((0,n.useMemo)(()=>{return t=e,(0,A.Mz)(be,e=>e.find(({_id:e})=>e===t));var t},[e])),d=(0,_.useSelector)((0,n.useMemo)(()=>(0,he.p)(e),[e])),m=(0,_.useSelector)(ne.Gd),c=o&&!o.is_verified&&m?.name,[E,u]=(0,n.useState)(!1),S=s===e,p=(0,_.useSelector)(ne.EL),I=!o||!o.is_verified,N=!I&&(S||!p),O=!(i||s===e),b=(0,n.useCallback)(()=>{l((0,Ce.VF)()),l((0,Te.w)())},[l]),D=(0,n.useCallback)((e,{resetForm:t,setSubmitting:a})=>{const{name:n,email:i,x_password:s,x_oldpassword:r,email_alert_enabled:d,push_alert_enabled:m,html_email_enabled:c,is_professional_installer:_,email_alert_grouping_enabled:E,email_alert_grouping_delay:A,_id:u,is_super:p,is_verified:I,role:N,super_site_permissions:O,super_site_role:M,permissions:T}=e,D=d&&E?(0,Ee.A)(60*A):0,R=d&&E;if(S){const e={email:i,name:n,x_oldpassword:r,x_password:s,email_alert_enabled:d,email_alert_grouping_enabled:R,email_alert_grouping_delay:D,push_alert_enabled:m,html_email_enabled:c,is_professional_installer:_};l((0,Me.yf)(e)).then(b).catch(({msg:e})=>l((0,g.ox)({icon:C.C.danger,message:"ADMINS_EDIT_SELF_ERROR",errorMessage:e}))).finally(()=>{a(!1),t()})}else{let e=[];N===h.e.ADMIN?e=O:N===h.e.SUPER_ADMIN&&(e=Re.CY.map(({value:e})=>e));const r={admin:u,email:i,email_alert_enabled:d,email_alert_grouping_enabled:R,email_alert_grouping_delay:D,html_email_enabled:c,is_professional_installer:_,is_super:p,is_verified:I,name:n,permissions:N!==h.e.READ_ONLY?Re.zi.map(({value:e})=>e):T,push_alert_enabled:m,role:N,super_site_permissions:e,super_site_role:M,x_password:s};l((0,Ce.Rr)(r,o)).then(b).catch(({msg:e})=>l((0,g.ox)({icon:C.C.danger,message:"ADMINS_EDIT_ADMIN_ERROR",values:{name:n},errorMessage:e}))).finally(()=>{a(!1),t()})}},[S,o,b,l]);return n.createElement(T.l1,{initialValues:et(o,d,S,r),enableReinitialize:!0,onSubmit:D,validationSchema:fe},({values:l,handleSubmit:i,handleReset:s,dirty:r,isValid:_})=>n.createElement(n.Fragment,null,n.createElement(J.A,{flexDirection:"column"},n.createElement(Qe,null,n.createElement(Xe,{id:"COMMON_EMAIL",value:l.email}),n.createElement(Xe,{id:"COMMON_STATUS"},n.createElement(re,{verified:!!(o?.is_verified??d?.is_verified),verifiedMessage:n.createElement(M.sA,{id:"ADMINS_VERIFIED"})})),d?.last_site_name?n.createElement(Xe,{id:"ADMINS_LAST_SITE"},n.createElement(se,{siteName:d.last_site_name})):null,n.createElement(Xe,{id:"ADMINS_LAST_LOGIN_IP",value:o?.last_login_ip})),O?null:n.createElement(n.Fragment,null,n.createElement(Qe,null,n.createElement(B.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_LABEL_USERNAME",allowReadOnly:N,disabled:I}),n.createElement(B.A,{full:!0,name:"x_password",type:"password",variant:"secondary",label:"ADMINS_EDIT_PASSWORD_LABEL",autoComplete:"new-password",passwordToggle:!0,allowReadOnly:N,disabled:I})),n.createElement(Qe,null,n.createElement(Je,{labelId:"COMMON_ACTIONS_REMOTE_ACCESS",tooltipMessageId:"ADMINS_ADMIN_REMOTE_DESCRIPTION",disabled:!0},n.createElement(ue.A,{id:"remoteAccess",readOnly:!0,disabled:!0,checked:!!(d?.ubic_uuid??o?.for_sso)})),l.role!==h.e.READ_ONLY||S?null:n.createElement(n.Fragment,null,n.createElement(Ze,{labelId:"ADMINS_PERMISSION_DEVICE_ADOPTION",field:"permissions",disabled:I,permission:Re.aX.ADOPT_DEVICES}),n.createElement(Ze,{labelId:"ADMINS_PERMISSION_DEVICE_RESTART",field:"permissions",disabled:I,permission:Re.aX.RESTART_DEVICES})),l.role===h.e.ADMIN?n.createElement(n.Fragment,null,n.createElement(Ze,{labelId:"ADMINS_PERMISSION_DASHBOARD_EDITING",field:"super_site_permissions",disabled:I,permission:Re.pl.EDIT_DASHBOARD}),n.createElement(Ze,{labelId:"ADMINS_PERMISSION_SYSTEM_STATS",field:"super_site_permissions",disabled:I,permission:Re.pl.ACCESS_SYSTEM_STATS}),n.createElement(Ze,{labelId:"ADMINS_PERMISSION_READ_ONLY_ACCESS_TO_ALL_SITES",field:"super_site_permissions",disabled:I,permission:Re.pl.READ_ONLY_ALL_SITES}),n.createElement(Ze,{labelId:"ADMINS_PERMISSION_SHOW_PENDING_DEVICES",field:"super_site_permissions",disabled:I,permission:Re.pl.SHOW_PENDING_DEVICES})):null),d?.roles?.length||c?n.createElement(Qe,{headingId:"ADMINS_ADMIN_SITE_PERMISSIONS"},n.createElement(qe,{roles:[...d?.roles||[],...c?[{site_id:m._id,site_name:m.name,site_desc:m.desc,permissions:o.permissions,role:o.role}]:[]],isSuper:o?.is_super??d?.is_super,invite:c?{name:l.name,email:l.email,super_site_permissions:l.super_site_permissions,for_sso:o.for_sso}:null,adminId:e,adminName:t})):null,n.createElement(Qe,{headingId:"ADMINS_PUSH_NOTIFICATION_SETTINGS"},n.createElement(Je,{labelId:"COMMON_MOBILE",disabled:I,field:"push_alert_enabled"}),n.createElement(Je,{labelId:"COMMON_EMAIL",disabled:I,field:"email_alert_enabled"}),n.createElement(Ne.A,{hidden:!l.email_alert_enabled,height:De.I.ROW_HEIGHT},n.createElement(J.A,{justifyContent:"space-between",alignItems:"center"},n.createElement(B.A,{type:"realCheckbox",name:"email_alert_grouping_enabled",allowReadOnly:N,disabled:I},n.createElement(M.sA,{id:"COMMON_GROUP_SIMILAR_NOTIFICATIONS"})),l.email_alert_grouping_enabled&&n.createElement(J.A,{width:120},n.createElement(B.A,{name:"email_alert_grouping_delay",type:"number",variant:"secondary",allowReadOnly:N,disabled:I,min:1,full:!0}))))),l.role!==h.e.READ_ONLY&&S?n.createElement(Qe,{headingId:"ADMINS_ADMIN_ADVANCED_OPTIONS"},Le.map(({label:e,value:t})=>n.createElement(Je,{field:t,labelId:e,allowReadOnly:N,key:t}))):null)),!d||d.roles?.length||c?null:n.createElement(Qe,{alignItems:"flex-start"},n.createElement(ye,{siteAdmin:d,onRemove:()=>{b(),a()}})),n.createElement(xe,{isOpen:E,isValid:_,onConfirm:()=>{u(!1),i()},onCancel:()=>{s(),u(!1)}},n.createElement(B.A,{full:!0,name:"x_oldpassword",type:"password",autoComplete:"new-password",variant:"secondary",passwordToggle:!0,allowReadOnly:N})),n.createElement(pe.A,{isDirty:r,onFormSubmit:_?i:()=>u(!0),onFormCancel:s})))},at=({adminId:e,adminName:t,close:a,...l})=>n.createElement(Ae.A,{in:!!e,side:"right",header:n.createElement(j.A,{weight:"bold",size:"body"},t),onClose:a},e?n.createElement(tt,{adminId:e,adminName:t,close:a,...l}):null);var lt=a(59308),nt=a(269672);const it=e=>(0,A.Mz)(be,he.f,v,Oe.rK,(t,a,l,n)=>e===ae.h.CURRENT_SITE?[...t.map(({_id:e,avatar_url:t,name:a,role:l,email:i,is_super:s,is_verified:r,last_login_timestamp:o})=>({_id:e,name:a,avatar_url:t,isSelf:e===n,role:l,email:i,is_super:s,is_verified:r,last_login_timestamp:1e3*o})),...l.map(e=>({_id:e._id,isSelf:e._id===n,name:e.name,role:h.e.HOTSPOT,email:void 0,is_super:!1,is_verified:!0}))]:[...a.map(({_id:e,avatar_url:t,name:a,email:l,is_super:i,is_verified:s,roles:r,last_site_name:o,last_login_timestamp:d})=>({_id:e,avatar_url:t,name:a,isSelf:e===n,email:l,is_super:i,is_verified:s,last_site_name:o,last_login_timestamp:1e3*d,role:r.every(e=>e.role===r[0]?.role)?r[0]?.role:h.e.MULTIPLE,sites:r.map(({site_desc:e})=>e)}))]),st=e=>(0,A.Mz)(it(e),e=>e.map(({_id:e,name:t,email:a})=>({id:e,name:t,email:a}))),rt=({section:e})=>{const{formatMessage:t}=(0,M.tz)(),a=(0,_.useSelector)((0,n.useMemo)(()=>(e=>(0,A.Mz)(it(e),(0,lt.U)(nt.U4.ADMINS),(e,t)=>e.filter(({_id:e})=>!t||t.has(e))))(e),[e])),{editAdminModalId:i=null}=(0,l.g)(),[s,r]=(0,n.useState)(i),[o,d]=(0,n.useState)(null),[m,c]=(0,n.useState)(0),E=(0,n.useMemo)(()=>((e,t)=>[{id:W.NAME,header:oe,size:ee[W.NAME],cell:({row:{original:{avatar_url:e,name:t,isSelf:a}}})=>n.createElement(de,{alignItems:"center",gap:N.YC},n.createElement(q.A,{image:e}),n.createElement(j.A,{size:"body",color:"secondary"},t),a?n.createElement(_e,null):null)},{id:W.STATUS,header:oe,size:ee[W.STATUS],cell:({row:{original:{is_verified:e}}})=>n.createElement(re,{verified:e})},{id:W.EMAIL,header:oe,size:ee[W.EMAIL],cell:({row:{original:{email:e}}})=>n.createElement(j.A,{size:"body",color:"secondary"},e||n.createElement(M.sA,{id:"COMMON_FALLBACK"}))},...e===ae.h.ALL_SITES?[{id:W.SITES,header:oe,size:ee[W.SITES],cell:({row:{original:{sites:e=[]}}})=>e.length?n.createElement(J.A,null,n.createElement(Y.A,{description:n.createElement(me,{sites:e}),portal:!0},e.length)):0}]:[],{compare:(0,X.l0)(({role:e,is_super:a})=>t({id:(0,Q.c)({is_super:a,role:e})})),id:W.ROLE,header:oe,size:ee[W.ROLE],cell:({row:{original:{is_super:e,role:t}}})=>n.createElement(M.sA,{id:(0,Q.c)({is_super:e,role:t})})},...e===ae.h.ALL_SITES?[{id:W.LAST_SITE,header:oe,size:ee[W.LAST_SITE],cell:({row:{original:{last_site_name:e}}})=>e?n.createElement(se,{siteName:e}):n.createElement(M.sA,{id:"COMMON_FALLBACK"})}]:[],{id:W.LAST_LOGIN,header:oe,size:ee[W.LAST_LOGIN],cell:({row:{original:{last_login_timestamp:e}}})=>e?n.createElement(j.A,{size:"body",color:"secondary",truncate:!0},n.createElement(Z.A,{timestamp:e})):n.createElement(M.sA,{id:"COMMON_FALLBACK"})}])(e,t),[e,t]),u=(0,n.useCallback)(({_id:e,role:t,name:a})=>{t!==h.e.HOTSPOT?d({adminId:e,adminName:a}):r(e)},[d]),T=(0,n.useCallback)(()=>{r(void 0)},[]),C=(0,n.useCallback)(({rowsPerPage:e,pageNumber:t})=>n.createElement(S.A,{columns:E,data:a,rowStyle:N.gc,width:"100%",onRowClick:u,pageIndex:t,pageSize:e}),[E,a,u]);return n.createElement(I.A,null,n.createElement(O.A,{itemCount:a.length,tableType:p.l.ADMINS,onRenderTable:C,onPageChanged:c,pageNumber:m}),s?n.createElement(G,{closeModal:T,hotspotOperatorId:s}):null,n.createElement(at,{...o,close:()=>{d(null)}}))},ot=(0,u.WY)()((0,A.Mz)(()=>({[ae.h.CURRENT_SITE]:{[c.o9.ROUTE_COMPONENT]:rt,[c.o9.SIDE_NAVIGATION]:void 0,[c.o9.ROUTE]:{[c.Fm.AVAILABLE]:!0},[c.o9.NAVIGATION]:{[c.mx.AVAILABLE]:!0},[c.o9.DEPENDENCIES]:void 0},[ae.h.ALL_SITES]:{[c.o9.ROUTE_COMPONENT]:rt,[c.o9.SIDE_NAVIGATION]:void 0,[c.o9.ROUTE]:{[c.Fm.AVAILABLE]:!0},[c.o9.NAVIGATION]:{[c.mx.AVAILABLE]:!0},[c.o9.DEPENDENCIES]:void 0}})),e=>e),dt=e=>{const t=(0,_.useSelector)(ot);return n.createElement(E.A,{routes:t,...e})};var mt=a(596731);const ct={[ae.h.CURRENT_SITE]:`${mt.Si[c.VO.ADMINS]}/${ae.h.CURRENT_SITE}`,[ae.h.ALL_SITES]:`${mt.Si[c.VO.ADMINS]}/${ae.h.ALL_SITES}`};var _t=a(457311),Et=a(75585),At=a(874807),ut=a(366702),St=a(979106);const pt=(0,H.A)(St.A,{shouldForwardProp:e=>"height"!==e})`
  position: absolute;
  left: 0;
  right: 0;
  ${({height:e})=>e?`height: ${e};`:""}
`,It=({routes:e,currentRoute:t,handleSectionChange:a,variant:l,className:i})=>{const{formatMessage:s}=(0,M.tz)(),r=(0,n.useMemo)(()=>e.map(({id:e,intlKey:t,disabled:a,badge:l})=>({id:e,label:s({id:t,defaultMessage:void 0}),disabled:"function"==typeof a?a():a,badge:l})),[e,s]),o=(0,n.useCallback)(({id:e})=>a(e),[a]);return n.createElement(pt,{tabs:r,fullHeightTabs:!0,selectedTab:t,onSelectTab:o,variant:l,height:"capsule"===l?"":"100%",className:i})};const Nt=a(132196).AH`
  height: 32px;
`;var Ot=a(362412);const Mt=(0,H.A)(Ot.A)`
  white-space: nowrap;
  margin-right: auto;
  > div > div {
    box-shadow: none !important;
    padding-left: ${N.xO};
  }
  z-index: 2;
`,ht=({routes:e,currentRoute:t,handleSectionChange:a,className:l})=>{const{formatMessage:i}=(0,M.tz)(),s=(0,n.useMemo)(()=>e.map(({id:e,intlKey:t="COMMON_UNKNOWN",disabled:a})=>({value:e,label:i({id:t,defaultMessage:void 0}),disabled:"function"==typeof a?a():a})),[e,i]),r=(0,n.useCallback)(({value:e})=>{a(e)},[a]);return n.createElement(Mt,{options:s,value:t,onChange:r,inputContainerClassName:Nt,width:180,arrowSize:"small",portal:!0,className:l})},Tt=(0,H.A)(j.A)`
  position: absolute;
  transform: translateX(-50%);
  left: 50%;
`,Ct=({currentRoute:e,breakPointWidth:t,routes:a,paramKey:i,variant:s,handleSectionChangePath:r=At.P1,className:o,dropdownClassName:d})=>{const{path:m,params:c}=(0,l.W5)(),_=(0,l.W6)(),{width:E}=(0,ut.A)(),A=(0,n.useCallback)(e=>_.push(r({id:e,path:m,params:c})||(0,l.tW)(m,{...c,[i]:e})),[m,c,i,_,r]);return E>=t?n.createElement(It,{routes:a,currentRoute:e,handleSectionChange:A,variant:s,className:o}):n.createElement(ht,{routes:a,currentRoute:e,handleSectionChange:A,className:d})},gt=({routes:e,...t})=>1===e.length?n.createElement(Tt,{size:"body",weight:"bold"},n.createElement(M.sA,{id:e[0].intlKey,defaultMessage:void 0})):n.createElement(Ct,{routes:e,...t});var bt=a(852182),Dt=a(572112),Rt=a(974546),ft=a(451919),vt=a(639775),Lt=a(879077);const wt=["id","name","email"],yt=new Rt.A.Document({tokenize:"forward",cache:500,encode:vt.Rd,document:{store:wt,id:"id",index:wt}}),Pt=({section:e})=>n.createElement(Lt.A,{lsKey:ft.UZ.ADMIN_SEARCH,searchModelName:nt.U4.ADMINS,searchIndex:yt,enabledColumns:wt,records:(0,_.useSelector)(st(e)),recordIdKey:"id"}),xt=[{id:ae.h.CURRENT_SITE,intlKey:"ADMINS_CURRENT_SITE",label:n.createElement(M.sA,{id:"ADMINS_CURRENT_SITE"})},{id:ae.h.ALL_SITES,intlKey:"ADMINS_ALL_SITES",label:n.createElement(M.sA,{id:"ADMINS_ALL_SITES"})}],Ht=({section:e})=>{const t=(0,_.useDispatch)(),a=(0,_.useSelector)(ne.EL),l=(0,_.useSelector)(Oe.fR);return n.createElement(bt.A,{showBorderBottom:!1,hideFilterButton:!0,rightContent:a?null:n.createElement(le.A,{type:"button",name:"add-new-admin",variant:"inline",size:"medium",onClick:()=>{t((0,F.to)({modalType:k.A.ADD_ADMIN_MODAL}))},Icon:n.createElement(Et.A,null)}),leftContent:n.createElement(Pt,{section:e})},l?n.createElement(gt,{routes:xt,currentRoute:e,breakPointWidth:Dt.A.ML.TO,paramKey:mt.On,variant:"capsule"}):null)},kt=(0,l.y)(({match:{params:e}})=>(0,d.A)([(0,o.Zi)(r.B.ADMINS),(0,Ce.VF)(void 0,{crudCacheStrategy:{type:s.e.CACHE}}),(0,Te.w)(void 0,{crudCacheStrategy:{type:s.e.CACHE}}),(0,R.Hq)(void 0,{crudCacheStrategy:{type:s.e.CACHE}}),(0,_t.Uc)(void 0,{crudCacheStrategy:{type:s.e.CACHE}})],n.createElement(m.A,null,n.createElement(Ht,{section:e.section}),n.createElement(n.Suspense,{fallback:null},n.createElement(l.dO,null,n.createElement(i.F,{path:ct[ae.h.CURRENT_SITE],render:t=>n.createElement(dt,{id:ae.h.CURRENT_SITE,section:e.section,...t})}),n.createElement(i.F,{path:ct[ae.h.ALL_SITES],render:t=>n.createElement(dt,{id:ae.h.ALL_SITES,section:e.section,...t})})))),{trackingName:c.VO.ADMINS}))},616093:(e,t,a)=>{a.d(t,{A:()=>n});var l=a(740244);const n=[{value:l.e.READ_ONLY,label:"COMMON_ADMIN_ROLE_VIEW_ONLY"},{value:l.e.ADMIN,label:"COMMON_ADMIN_ROLE_SITE_ADMINISTRATOR"},{value:l.e.SUPER_ADMIN,label:"COMMON_ADMIN_ROLE_ADMINISTRATOR"},{value:l.e.HOTSPOT,label:"COMMON_SIDE_NAV_HOTSPOT"}]},638310:(e,t,a)=>{a.d(t,{E:()=>i});var l=a(691189);const n="sysInfo",i=(e={},t={})=>(0,l.Kd)(n,"/api/s/{site}/stat/sysinfo",n,e,t)},649810:(e,t,a)=>{a.r(t),a.d(t,{default:()=>E});var l=a(469733),n=a(296540),i=a(927099),s=a(71479),r=a(372737),o=a(126457),d=a(699784),m=a(705426);const c=(0,s.A)("div")`
  line-height: 1.5;
  word-break: break-word;
`,_=(0,s.A)(i.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,E=({message:e,title:t,onConfirm:a,children:s=null,messageValues:E={},size:A="small",titleValues:u={},onCancel:S=null,confirmButtonProps:p={},confirmButtonText:I,...N})=>{const O=(0,l.useDispatch)(),M=(0,n.useCallback)(()=>{S?S():O((0,o.AS)())},[S,O]);return(0,n.useEffect)(()=>{function e(e){e.stopPropagation(),e.key===r.U.ENTER?a():e.key===r.U.ESCAPE&&M()}return window.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0)}},[M,a]),n.createElement(m.A,{actions:[{text:n.createElement(d.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:M},{text:n.createElement(d.sA,{id:I??"COMMON_ACTION_CONFIRM"}),type:"button",variant:"primary",onClick:()=>a(),...p}],size:A,title:n.createElement(_,{size:"header-xs",truncate:!0},n.createElement(d.sA,{id:t,values:u})),...N},n.createElement(c,null,n.createElement(i.A,{size:"body"},n.createElement(d.sA,{id:e,values:E}))),s)}},695415:(e,t,a)=>{a.d(t,{I:()=>l});const l={HEADER_HEIGHT:49,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:84,getHeight(e,t,a,l){return Math.min((l||this.ROW_HEIGHT)*e+(a??this.HEADER_HEIGHT),(l||this.ROW_HEIGHT)*t+(a??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,a){return Math.min((a||this.EDIT_FIELD_HEIGHT)*e,(a||this.EDIT_FIELD_HEIGHT)*t)}}},784998:(e,t,a)=>{a.d(t,{K2:()=>m,F_:()=>d});var l,n=a(801081),i=a(25553),s=a(87485);!function(e){e.IP_ADDRS="ip_addrs",e.HTTPS_PORT="https_port",e.VERSION="version"}(l||(l={}));var r=a(638310);const o=(0,n.Mz)((0,i.uh)((0,r.E)()),s.i6),d=(0,n.Mz)(o,e=>e[l.IP_ADDRS]||[]),m=(0,n.Mz)(o,e=>e[l.HTTPS_PORT]);(0,n.Mz)(o,e=>e[l.VERSION])},852182:(e,t,a)=>{a.d(t,{A:()=>f});var l=a(296540),n=a(271856),i=a(927099),s=a(71479),r=a(294303),o=a(699784),d=a(955161),m=a(956347),c=a(979106);const _=({items:e,...t})=>{const{params:a,path:n}=(0,m.W5)(),i=(0,m.zy)(),s=(0,m.W6)(),r=e.find(({path:e})=>e===n)||((e,{pathname:t})=>e.find(({path:e})=>new RegExp(e.replace(/\/:\w+\?.*/g,"/?.*").replace(/:\w+/g,"\\w+").replace(/\//g,"\\$&")).test(t)))(e,i);return l.createElement(c.A,{tabs:e,selectedTab:r?.id,onSelectTab:({path:e,params:t={}})=>s.push((0,m.tW)(e,{...a,...t})),...t})},E=(0,s.A)(_)`
  height: 100%;
  position: absolute;
  left: 0;
  right: 0;
  div,
  button {
    height: 100% !important;
  }
`,A=({routes:e})=>{const t=(0,l.useMemo)(()=>e&&e.map(({id:e,label:t,disabled:a,path:l,...n})=>({id:e,label:t,disabled:"function"==typeof a?a(n):a,path:l})),[e]);return t?l.createElement(E,{selectedTabBold:!0,items:t}):null};var u=a(469733),S=a(889954),p=a(566723),I=a(601021),N=a(968906);const O=(0,s.A)(S.A,{shouldForwardProp:e=>"disabled"!==e})`
  pointer-events: ${({disabled:e})=>e?"none":"auto"};
  opacity: ${({disabled:e})=>e?.45:1};
  cursor: ${({disabled:e})=>e?"default":"pointer"};
  & button {
    width: ${p.fS};
    height: ${p.fS};
  }
`,M=({filtersActive:e,disabled:t})=>{const a=(0,u.useDispatch)();return l.createElement(O,{disabled:t,onClick:()=>{!t&&a((0,I.p)(!0))},filtersActive:e,...N.A.addDataTestId(N.A.TestId.CONTROL_PANEL_HEADER_FILTER_BUTTON)})};var h=a(311785);const T=(0,s.A)(r.A,(0,h.A)("showBorderBottom","noPadding"))`
  border-bottom: ${({showBorderBottom:e,theme:{motifPalette:{neutral03:t}}})=>e?`1px solid ${t}`:"none"};
  box-sizing: border-box;
  padding: ${({noPadding:e})=>e?0:`${p.Ln} ${p.Ln} 0 ${p.Ln}`};
  z-index: 1;
`,C=({showBorderBottom:e=!0,height:t=48,children:a,noPadding:n})=>l.createElement(T,{...N.A.addDataTestId(N.A.TestId.CONTROL_PANEL_HEADER),flex:"none",className:"base-control-panel-classname",position:"relative",alignItems:"center",justifyContent:"space-between",height:t,showBorderBottom:e,noPadding:n},a),g=(0,s.A)("div")`
  padding: 0 ${({theme:{spacing:e}})=>e["spacing-m"]};
  white-space: normal;
`,b=(0,s.A)(r.A)`
  svg {
    color: ${({theme:{motifPalette:{neutral08:e}}})=>e};
  }
`,D=(0,s.A)(i.A,{shouldForwardProp:e=>"addMargin"!==e})`
  ${({addMargin:e})=>e&&"margin-left: 50%;"}
  position: absolute;
  transform: translateX(-50%);
  left: 50%;
`,R=e=>l.createElement(n.A,{position:"bottom",width:"208px",portal:!0,description:l.createElement(g,null,l.createElement(o.sA,{id:"COMMON_DISPLAY_OPTS_DISABLED"}))},e),f=({routes:e=[],hideFilterButton:t=!1,children:a,filtersActive:n,leftContent:i,rightContent:s,areDisplayOptionsDisabled:r,showDisabledTooltip:o,showBorderBottom:m,height:c,noPadding:_})=>{const E=e?.length>1,u=!E&&1===e.length;return l.createElement(C,{showBorderBottom:m,height:c,noPadding:_},i||null,E?l.createElement(A,{routes:e}):null,u?l.createElement(D,{size:"body",weight:"bold"},e[0].label):null,l.createElement(b,{height:"100%",flex:E||u?"none":1,alignItems:"center",justifyContent:"flex-end",marginLeft:"auto",className:"base-control-panel-right-content-classname"},a,s||null,t?null:l.createElement(d.A,{condition:r&&o,wrapper:R},l.createElement(M,{disabled:r,filtersActive:n}))))}},947089:(e,t,a)=>{var l,n;a.d(t,{CY:()=>r,N$:()=>o,aX:()=>l,cS:()=>s,pl:()=>n,zi:()=>i}),function(e){e.ADOPT_DEVICES="API_DEVICE_ADOPT",e.RESTART_DEVICES="API_DEVICE_RESTART"}(l||(l={})),function(e){e.EDIT_DASHBOARD="API_DASHBOARD_EDIT",e.ACCESS_SYSTEM_STATS="API_WIDGET_OS_STATS",e.READ_ONLY_ALL_SITES="GLOBAL_READONLY_ADMIN_ACCESS",e.SHOW_PENDING_DEVICES="API_STAT_DEVICE_ACCESS_SUPER_SITE_PENDING"}(n||(n={}));const i=[{label:"ADMINS_PERMISSION_DEVICE_ADOPTION",value:l.ADOPT_DEVICES},{label:"ADMINS_PERMISSION_DEVICE_RESTART",value:l.RESTART_DEVICES}],s=i.map(({value:e})=>e),r=[{label:"ADMINS_PERMISSION_DASHBOARD_EDITING",value:n.EDIT_DASHBOARD},{label:"ADMINS_PERMISSION_SYSTEM_STATS",value:n.ACCESS_SYSTEM_STATS},{label:"ADMINS_PERMISSION_READ_ONLY_ACCESS_TO_ALL_SITES",value:n.READ_ONLY_ALL_SITES},{label:"ADMINS_PERMISSION_SHOW_PENDING_DEVICES",value:n.SHOW_PENDING_DEVICES}],o=[n.EDIT_DASHBOARD,n.ACCESS_SYSTEM_STATS,n.SHOW_PENDING_DEVICES]}}]);