"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[75328],{784465(e,t,a){a.d(t,{$5:()=>E,gT:()=>A,kW:()=>u,uK:()=>m,uu:()=>o});var n=a(165126),l=a(516693),r=a(691189),i=a(887831),c=a(33453),s=a(801156);const o=(e={},t={})=>(0,r.t9)(c.A2,c.lT,e,{...t,idField:c.RR}),E=e=>(0,r.vB)(l.aC,null,null,i.A.POST,c.FC,{},e,{fetchConfig:{getAllPostData:!0}}),u=e=>(0,r.vB)(l.aC,null,null,i.A.PUT,c.AU.replace(c.w4,e[s.d5.ID]),{},(0,n.A)(e,[s.d5.ID]),{fetchConfig:{getAllPostData:!0}}),m=e=>(0,r.vB)(l.aC,null,null,i.A.DELETE,c._U.replace(c.w4,e[s.Xs.ID]),{},(0,n.A)(e,[s.Xs.ID]),{}),A=e=>(0,r.vB)(l.aC,null,null,i.A.POST,c.Qw.replace(c.w4,e[s.nr.MAC]),{},(0,n.A)(e,[s.nr.MAC]),{})},801156(e,t,a){var n,l,r,i,c;a.d(t,{Ko:()=>n,Xs:()=>i,d5:()=>r,iV:()=>l,nr:()=>c}),function(e){e._ID="_id",e.NAME="name",e.MEMBER_DEVICE_MACS="member_device_macs"}(n||(n={})),function(e){e.NAME="name",e.MEMBER_DEVICE_MACS="member_device_macs"}(l||(l={})),function(e){e.ID="id",e.NAME="name",e.DEVICE_MAC_ADDITIONS="device_mac_additions",e.DEVICE_MAC_REMOVALS="device_mac_removals"}(r||(r={})),function(e){e.ID="id"}(i||(i={})),function(e){e.MAC="mac",e.DEVICE_TAG_ADDITIONS="device_tag_additions",e.DEVICE_TAG_REMOVALS="device_tag_removals"}(c||(c={}))},33453(e,t,a){a.d(t,{A2:()=>l,AU:()=>u,FC:()=>o,Qw:()=>E,RR:()=>r,_U:()=>m,lT:()=>s,w4:()=>i});var n=a(771805);const l="deviceTags",r="_id",i=`:${r}:`,c=`${n.w}/device-tags`,s=c,o=c,E=`${c}/device-tag-assignment/${i}`,u=`${c}/${i}`,m=`/v2/api/device-tags/${i}`},659552(e,t,a){a.d(t,{_:()=>s});var n=a(801081),l=a(25553),r=a(87485),i=a(784465);const c=(0,l.uh)((0,i.uu)()),s=(0,n.Mz)(c,r.kh)},55983(e,t,a){a.d(t,{Ai:()=>i,Ar:()=>c,Qv:()=>s,ZP:()=>o,aY:()=>r,p6:()=>l});var n=a(448547);const l="alarm-manager",r="control-plane",i=`${r}/integrations`,c=`${r}/backups`,s="admins",o=Object.values(n.Kr)},556456(e,t,a){a.d(t,{XU:()=>A,YQ:()=>d,aB:()=>m,g0:()=>v,jO:()=>_,tx:()=>u,yB:()=>E,yE:()=>M,zn:()=>I});var n=a(801081),l=a(874807),r=a(187483),i=a(448547),c=a(524332),s=a(55983);const o=(0,n.Mz)(r.kb,e=>e[i.C2.SWAI_ROUTES]||[]),E=(0,n.Mz)(o,e=>e.filter(e=>s.ZP.every(t=>!e[c.rR.PATH].startsWith(t)))),u=(0,n.Mz)(E,e=>e.filter(e=>!e[c.rR.IS_HIDDEN])),m=(0,n.Mz)(o,e=>e.filter(e=>e[c.rR.PATH].startsWith(i.Kr.SETTINGS))),A=(0,n.Mz)(m,e=>e.filter(e=>!e[c.rR.IS_HIDDEN])),d=(0,n.Mz)(o,e=>e.filter(e=>e[c.rR.PATH].startsWith(i.Kr.SYSLOG))),_=(0,n.Mz)(d,e=>e.filter(e=>!e[c.rR.IS_HIDDEN])),C=e=>(0,n.Mz)(o,t=>t.some(t=>t[c.rR.PATH].includes(e)&&!t[c.rR.IS_HIDDEN])),M=(0,n.Mz)(C(s.aY),e=>e),I=(0,n.Mz)(C(s.p6),e=>e),v=(0,n.Mz)(r.nx,e=>e[i.Y7.ROUTES_ADAPTER]||{[c.bh.ROUTES]:[],[c.bh.ADD_ROUTES_LISTENER]:l.P1,[c.bh.REMOVE_ROUTES_LISTENER]:l.P1,[c.bh.ON_ROUTE_CONTAINER_ADDED]:l.P1,[c.bh.ON_ROUTE_CONTAINER_REMOVED]:l.P1})},175522(e,t,a){a.d(t,{A:()=>l,Q:()=>r});var n=a(416348);const l="_",r=[n.ZM,n.Je]},906619(e,t,a){a.d(t,{A:()=>u});var n=a(296540),l=a(71479),r=a(822336),i=a(566723),c=a(939703),s=a(294303),o=a(311785);const E=(0,l.A)(s.A,(0,o.A)("color"))`
  border-radius: ${r.Ay["desktop-radius-infinity"]};
  background: ${({color:e,theme:{themeName:t}})=>(0,c.b_)(e||r.Ay[`desktop-color-ublue-06-${t}`],.1)};
  padding: 2px ${i.kc};
`,u=({children:e,color:t})=>n.createElement(E,{color:t},e)},821580(e,t,a){a.d(t,{A:()=>c});var n=a(296540),l=a(454195),r=a(566723),i=a(294303);const c=e=>n.createElement(i.A,{paddingTop:r.YC,paddingBottom:r.YC,gap:r.Ln,rowGap:r.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})},242366(e,t,a){a.d(t,{A:()=>i});var n=a(296540),l=a(566723),r=a(294303);const i=(0,n.forwardRef)((e,t)=>n.createElement(r.A,{ref:t,flexDirection:"column",gap:l.kc,width:"100%",...e}))},86571(e,t,a){a.d(t,{A:()=>i});var n=a(296540),l=a(217439),r=a(916537);const i=({id:e,children:t,values:a})=>n.createElement(l.A,{color:"text-1",weight:"bold",size:"medium"},e?n.createElement(r.sA,{id:e,values:a}):null,t)},89124(e,t,a){a.d(t,{qF:()=>H,UH:()=>w,Ay:()=>x});var n=a(469733),l=a(296540),r=a(951272),i=a(71479),c=a(217439),s=a(870443),o=a(60519),E=a(566723),u=a(143811),m=a(294303),A=a(689965),d=a(845030),_=a(916537),C=a(780811),M=a(906619),I=a(198494),v=a(255212),O=a(438628),p=a(732881),N=a(117982),S=a(900956),D=a(592563),T=a(74750),b=a(592510),f=a(516693),h=a(370333),g=a(422969),R=a(662297),y=a(242366),k=a(659552),B=a(33453),P=a(801156),U=a(784465);const z=(0,i.A)(m.A)`
  flex-direction: column;
  > button {
    justify-content: flex-start;
    width: fit-content;
  }
  gap: ${E.kc};
`,L=(0,i.A)(m.A)`
  align-items: center;
  gap: ${E.kc};
`,V=({mac:e})=>{const t=(0,n.useDispatch)(),[a,r]=(0,l.useState)(!1),[i,c]=(0,l.useState)(""),[s,E]=(0,l.useState)(!1),[u,m]=(0,l.useState)(!1),A=(0,n.useSelector)(k._),d=(0,l.useMemo)(()=>A.map(({[P.Ko.NAME]:e})=>e),[A]),C=(0,n.useSelector)(o.Qu),M=(0,l.useMemo)(()=>A.map(e=>({value:e[P.Ko._ID],label:e[P.Ko.NAME]})),[A]),I=(0,l.useMemo)(()=>A.reduce((t,a)=>(a[P.Ko.MEMBER_DEVICE_MACS].includes(e)&&t.push(a[P.Ko._ID]),t),[]),[A,e]),v=(0,l.useCallback)(a=>{t((0,U.gT)({[P.nr.MAC]:e,...(({added:e,removed:t})=>({[P.nr.DEVICE_TAG_ADDITIONS]:e,[P.nr.DEVICE_TAG_REMOVALS]:t}))((0,h.qk)(I,a))})).then(()=>{t((0,U.uu)()),r(!1)})},[t,I,e]),V=(0,l.useCallback)(e=>{r(e)},[]),w=(0,l.useCallback)(e=>()=>{e(),c("")},[]),$=(0,l.useCallback)(()=>{t((0,U.$5)({[P.iV.NAME]:i,[P.iV.MEMBER_DEVICE_MACS]:[e]})).then(e=>{t({type:f.xk,meta:{model:B.A2,extend:!0,fetchTime:Date.now(),id:e[P.Ko._ID],idField:B.RR},payload:{data:e}}),r(!1),c("")})},[t,e,i]),F=(0,l.useCallback)(({close:e})=>l.createElement(L,null,l.createElement(T.A,{variant:"tertiary-neutral",onPress:w(e)},l.createElement(_.sA,{id:"COMMON_ACTION_CANCEL"})),l.createElement(T.A,{onPress:$,isDisabled:!i||s||u},l.createElement(_.sA,{id:"COMMON_ACTION_SAVE"}))),[w,$,i,s,u]),K=(0,l.useCallback)(({target:{value:e}})=>{c(e)},[]);return(0,l.useEffect)(()=>{E(d.includes(i)),m(i.startsWith(" ")||i.endsWith(" "))},[d,i]),(0,g.A)([(0,U.uu)(void 0,{crudCacheStrategy:{type:b.e.CACHE}})],l.createElement(z,null,A.length?l.createElement(R.A,{options:M,label:I.length?l.createElement(_.sA,{id:"COMMON_DEVICE_TAGS"}):void 0,triggerButtonText:"COMMON_ACTION_EDIT",isFullWidth:!0,onChange:v,value:I}):null,C?l.createElement(S.A,{isOpen:a,onOpenChange:V},l.createElement(N.A,null,l.createElement(D.A,{type:"button",fontSize:"medium"},l.createElement(_.sA,{id:"DEVICE_CREATE_TAG"}))),l.createElement(p.A,{actionButtons:F,placement:"bottom left"},l.createElement(y.A,{width:300},l.createElement(O.A,{value:i,label:l.createElement(_.sA,{id:"DEVICE_TAG_NAME"}),variant:"secondary",width:"100%",onChange:K,invalid:s?l.createElement(_.sA,{id:"COMMON_PLEASE_ENTER_UNIQUE_NAME"}):u?l.createElement(_.sA,{id:"COMMON_VALIDATION_NO_LEADING_TRAILING_SPACES"}):void 0})))):null))},w="general",$=(0,i.A)(m.A)`
  flex-direction: column;
`,F=(0,i.A)("div")`
  margin-bottom: ${E.Ln};
`,K=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{name:e,mac:t}={}})=>({name:e!==t?e:""}),validationSchema:s.A.object().shape({name:s.A.string().label("COMMON_NAME").max(128)}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),H=({isUdmDevice:e,label:t="COMMON_NAME",hideBubbleWrapper:a=!1,hideDeviceTags:r=!1,mac:i})=>{const s=(0,n.useSelector)(o.JQ),d=(0,n.useSelector)(o.H2),C=(0,n.useSelector)(I.Io);return l.createElement($,null,l.createElement(a?l.Fragment:A.A,null,l.createElement(F,null,l.createElement(v.A,{isUdmDevice:e},l.createElement(u.A,{label:t,variant:"secondary",name:"name",full:!0,disabled:e})))),s&&d&&!r?l.createElement(A.A,{type:A.I.ACCORDION,items:[{id:"device-tags",label:l.createElement(m.A,{gap:E.YC,alignItems:"center"},l.createElement(_.sA,{id:"COMMON_DEVICE_TAGS"}),C?l.createElement(M.A,null,l.createElement(c.A,{size:"medium",color:"ublue-06"},l.createElement(_.sA,{id:"COMMON_FABRIC"}))):null),openByDefault:!0,renderContent:()=>l.createElement(V,{mac:i})}]}):null)},x=K(function({activeItem:e,setFormDirty:t,setFormInvalid:a,dirty:r,isValid:i,values:c,resetForm:s,label:o="COMMON_NAME",formName:E=w,hideBubbleWrapper:u=!1,hideDeviceTags:m=!1}){const A=(0,n.useDispatch)(),_=(0,C.D6h)(e);return(0,l.useEffect)(()=>(A((0,d.uo)({[E]:()=>_?{}:c})),A((0,d.Oo)({[E]:()=>s({values:c})})),A((0,d.rW)({[E]:s})),()=>{A((0,d.uo)({[E]:null})),A((0,d.Oo)({[E]:null})),A((0,d.rW)({[E]:null}))}),[A,s,c,_,E]),(0,l.useEffect)(()=>{t(E,r),a(E,!i)},[t,r,a,i,E]),l.createElement(H,{isUdmDevice:_,label:o,hideBubbleWrapper:u,hideDeviceTags:m,mac:e.mac})})},373229(e,t,a){a.d(t,{A:()=>E});var n=a(296540),l=a(758649),r=a(71479),i=a(566723),c=a(916537),s=a(311785);const o=(0,r.A)("footer",(0,s.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${i.S2} ${i.fS};
  gap: ${i.kc};
`,E=({allowCancel:e,isDirty:t,isInvalid:a,isSubmitting:r,onFormSubmit:i,onFormReset:s,onFormCancel:E,className:u,submitButtonText:m,customButton:A,applyButton:d,applyButtonFirst:_,hideCancelButton:C,form:M})=>{const I=(0,n.useMemo)(()=>d||n.createElement(l.A,{name:"submit",variant:"primary",type:"submit",onClick:i,disabled:!t||a||r,form:M},n.createElement(c.sA,{id:m||"COMMON_ACTION_APPLY_CHANGES"})),[d,M,t,a,r,i,m]);return n.createElement(o,{className:u,hasFormResetButton:!!s},_?I:A,C?null:n.createElement(l.A,{name:"cancel",variant:"default",type:"button",onClick:E,disabled:!e&&!t},n.createElement(c.sA,{id:"COMMON_ACTION_CANCEL"})),s?n.createElement(l.A,{name:"reset",variant:"default",type:"button",onClick:s,disabled:!t},n.createElement(c.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})):null,_?A:I)}},329109(e,t,a){a.d(t,{A:()=>E});var n=a(296540),l=a(691441),r=a(71479),i=a(132196),c=a(373229);const s=(0,r.A)("div")`
  height: 66px;
`,o=i.AH`
  padding: 0px !important;
`,E=({isDirty:e,onFormSubmit:t,onFormCancel:a,isInvalid:r,...i})=>e?n.createElement(l.A,null,n.createElement(c.A,{isDirty:e,onFormCancel:a,onFormSubmit:t,isInvalid:r,className:o,...i})):n.createElement(s,null)},255212(e,t,a){a.d(t,{A:()=>d});var n=a(469733),l=a(296540),r=a(271856),i=a(834316),c=a(928085),s=a(196010),o=a(349107),E=a(916537),u=a(187483),m=a(556456),A=a(55983);const d=({children:e,isUdmDevice:t})=>{const a=(0,n.useSelector)(m.yE),d=(0,c.A)(A.aY),_=(0,n.useSelector)(u.TP);return l.createElement(r.A,{portal:!0,isInteractive:!0,description:t?l.createElement(E.sA,{id:"DEVICE_PROPERTIES_NAME_LINK_CONTROL_PLANE",values:{link:a?l.createElement(s.A,{to:d},l.createElement(E.sA,{id:"COMMON_CONTROL_PLANE"})):l.createElement(o.A,{href:(0,i.ec)(_),id:"COMMON_CONTROL_PLANE"})}}):null},l.createElement("span",null,e))}},280258(e,t,a){a.d(t,{H:()=>n});const n=""},963169(e,t,a){a.d(t,{A:()=>m});var n=a(296540),l=a(469733),r=a(525512),i=a(687573),c=a(648092),s=a(523275),o=a(874807),E=a(906593),u=a(802125);const m=(e,t=o.P1,a=(0,s.A)(),m=!1)=>{const A=(0,l.useDispatch)(),d=(0,n.useMemo)(()=>JSON.stringify(a),[a]),_=(0,l.useSelector)(c.a),C=(0,n.useMemo)(()=>[_[E.Uz],...m?[_[E.o4]]:[]].filter(Boolean),[_,m]),M=(0,n.useCallback)(e=>(0,r.K6)(e,t),[t]),I=(0,n.useCallback)(e=>{(0,r.$N)(e)},[]);(0,n.useEffect)(()=>(C.forEach(t=>{t.send((0,u.f)(e,!0,JSON.parse(d)))}),()=>{C.forEach(t=>{t.send((0,u.f)(e,!1,JSON.parse(d)))})}),[A,e,d,C]),(0,n.useEffect)(()=>{const t=i._[e].map(M);return()=>{t.forEach(I)}},[A,e,M,I])}},802125(e,t,a){a.d(t,{f:()=>r});var n,l=a(434008);!function(e){e.TYPE="type",e.SUBSCRIPTION="subscription",e.ENABLED="enabled",e.META="meta"}(n||(n={}));const r=(e,t,a)=>({[n.TYPE]:l.uw.SUBSCRIBE,[n.SUBSCRIPTION]:e,[n.ENABLED]:t,[n.META]:a})},834316(e,t,a){a.d(t,{$H:()=>l,SK:()=>n,ec:()=>r});const n=e=>e.replace("network","ADMINS"),l=e=>e.replace("network","applications"),r=e=>e.replace("network","console-settings")},60519(e,t,a){a.d(t,{As:()=>_,H2:()=>u,JQ:()=>c,Jc:()=>m,Qu:()=>s,cW:()=>A,lQ:()=>o,m7:()=>E,vs:()=>C,zp:()=>d});var n=a(801081),l=a(198494),r=a(792072),i=a(602021);const c=(0,n.Mz)(r.Y8,e=>e),s=(0,n.Mz)(l.Io,l.mn,l.aK,i.dK,i.IX,(e,t,a,n,l)=>e?t||a:n||l),o=(0,n.Mz)(l.Io,l.mn,l.aK,i.dK,i.IX,(e,t,a,n,l)=>e?t||a:n||l),E=(0,n.Mz)(l.Io,l.mn,l.aK,i.dK,i.IX,(e,t,a,n,l)=>e?t||a:n||l),u=(0,n.Mz)(l.Io,l.mn,l.aK,l.$7,i.dK,i.IX,(e,t,a,n,l,r)=>e?t||a||n:l||r),m=(0,n.Mz)(i.EL,e=>!e),A=m,d=m,_=m,C=m},648092(e,t,a){a.d(t,{a:()=>s,m:()=>o});var n=a(801081),l=a(386234),r=a(276907),i=a(919952),c=a(434008);const s=(0,n.Mz)(e=>e[i.U.SHARED][r.N.WEB_SOCKET],e=>e?.[c.SC.POOL]||{}),o=(0,n.Mz)(s,e=>(0,l.UI)(t=>e[t]))},525512(e,t,a){a.d(t,{$N:()=>c,K6:()=>i,WM:()=>r});var n=a(300477);const l={},r=()=>l,i=(e,t,a=!1,r=null)=>{const i=r||(0,n.A)();return l[i]||(l[i]={eventKeys:Array.isArray(e)?e:[e],id:i,action:t,forSuperSite:a}),i},c=e=>{delete l[e]}},362412(e,t,a){a.d(t,{A:()=>u});var n=a(296540),l=a(469733),r=a(436331),i=a(805837),c=a(282556),s=a(71265);const o=e=>n.createElement(r.A,{renderOption:i.q,...e}),E=e=>n.createElement(o,{...e});E.Sorted=e=>{const t=(0,l.useSelector)(c.zi),a=(0,n.useMemo)(()=>(0,s.k)(t),[t]);return n.createElement(o,{...e,sortBy:a})};const u=E},71265(e,t,a){a.d(t,{R:()=>u,k:()=>m});var n=a(280258),l=a(190497),r=a(953048),i=a(175522),c=a(936621),s=a(742525);const o=[...new Set([n.H,i.Q.join(i.A),r.Zt,c.F,l.nc,s.Vr])],E={numeric:!0,sensitivity:"base"},u=(e,t)=>{const a=[];for(let n=e;n<=t;n+=1)a.push({value:n,label:String(n)});return a},m=e=>({value:t,label:a},{value:n,label:l})=>o.includes(t?.toString())||o.includes(n?.toString())?1/0:a?.toString().localeCompare(l?.toString(),e,E)??-1}}]);