"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[59599],{949330(e,t,a){function o(e){return Object.keys(e).filter(t=>Number.isNaN(Number(e[t])))}a.d(t,{XB:()=>A,TH:()=>_,e8:()=>i,a$:()=>c,iL:()=>d,HH:()=>m,Y$:()=>s,Dc:()=>l,BR:()=>E,aW:()=>C,kB:()=>r,Lp:()=>O});var n=a(204751);const c={qos_policies:[],qos_profile_mode:n.If.CUSTOM},r={[n.ev.DSCP]:"PORTS_DSCP",[n.ev.IP_PRECEDENCE]:"PORTS_IP_PRECEDENCE",[n.ev.COS]:"PORTS_COS"},i={[n.hQ.BACKGROUND]:"BK",[n.hQ.BEST_EFFORT]:"BE",[n.hQ.EXCELLENT_EFFORT]:"EE",[n.hQ.CRITICAL_APPLICATIONS]:"CA",[n.hQ.VIDEO]:"VI",[n.hQ.VOICE]:"VO",[n.hQ.INTERNETWORK_CONTROL]:"IC",[n.hQ.NETWORK_CONTROL]:"NC"},_=o(n.hQ).map(e=>({label:`${e} (${i[e]})`,value:+e})),l={[n.lF.ROUTINE]:"RO",[n.lF.PRIORITY]:"PR",[n.lF.IMMEDIATE]:"IM",[n.lF.FLASH]:"FL",[n.lF.FLASH_OVERRIDE]:"FO",[n.lF.CRITIC_ECP]:"CR",[n.lF.INTERNETWORK_CONTROL]:"IC",[n.lF.NETWORK_CONTROL]:"NC"},s=o(n.lF).map(e=>({label:`${e} (${l[e]})`,value:+e})),m={[n.ee.DEFAULT]:"DF",[n.ee.AF11]:"AF11",[n.ee.AF12]:"AF12",[n.ee.AF13]:"AF13",[n.ee.AF21]:"AF21",[n.ee.AF22]:"AF22",[n.ee.AF23]:"AF23",[n.ee.AF31]:"AF31",[n.ee.AF32]:"AF32",[n.ee.AF33]:"AF33",[n.ee.AF41]:"AF41",[n.ee.AF42]:"AF42",[n.ee.AF43]:"AF43",[n.ee.CS1]:"CS1",[n.ee.CS2]:"CS2",[n.ee.CS3]:"CS3",[n.ee.CS4]:"CS4",[n.ee.CS5]:"CS5",[n.ee.CS6]:"CS6",[n.ee.CS7]:"CS7",[n.ee.EF]:"EF"},d=o(n.ee).map(e=>({label:`${e} (${m[e]})`,value:+e})),E={[n.CC.UNIFI]:[n.If.UNIFI_PLAY],[n.CC.DANTE]:[n.If.DANTE_AUDIO],[n.CC.QSYS]:[n.If.QSYS_AUDIO_VIDEO,n.If.QSYS_VIDEO_DANTE_AUDIO],[n.CC.NDI]:[n.If.NDI_AES67_AUDIO,n.If.NDI_DANTE_AUDIO],[n.CC.SDVOE]:[n.If.SDVOE_AES67_AUDIO,n.If.SDVOE_DANTE_AUDIO],[n.CC.SHURE]:[n.If.SHURE_AUDIO],[n.CC.AES67]:[n.If.AES67_AUDIO],[n.CC.CRESTON]:[n.If.CRESTRON_AUDIO_VIDEO],[n.CC.SMPTE]:[n.If.SMPTE_AUDIO]},O=e=>{switch(e){case n.If.UNIFI_PLAY:return n.CC.UNIFI;case n.If.DANTE_AUDIO:return n.CC.DANTE;case n.If.QSYS_AUDIO_VIDEO:case n.If.QSYS_VIDEO_DANTE_AUDIO:return n.CC.QSYS;case n.If.NDI_AES67_AUDIO:case n.If.NDI_DANTE_AUDIO:return n.CC.NDI;case n.If.SDVOE_AES67_AUDIO:case n.If.SDVOE_DANTE_AUDIO:return n.CC.SDVOE;case n.If.SHURE_AUDIO:return n.CC.SHURE;case n.If.AES67_AUDIO:return n.CC.AES67;case n.If.CRESTRON_AUDIO_VIDEO:return n.CC.CRESTON;case n.If.SMPTE_AUDIO:return n.CC.SMPTE;default:return n.CC.UNIFI}},A={[n.If.UNIFI_PLAY]:"-",[n.If.DANTE_AUDIO]:"-",[n.If.QSYS_AUDIO_VIDEO]:"COMMON_QSYS_AUDIO_VIDEO",[n.If.QSYS_VIDEO_DANTE_AUDIO]:"COMMON_QSYS_VIDEO_DANTE_AUDIO",[n.If.NDI_AES67_AUDIO]:"COMMON_NDI_AES67_AUDIO",[n.If.NDI_DANTE_AUDIO]:"COMMON_NDI_DANTE_AUDIO",[n.If.SDVOE_AES67_AUDIO]:"COMMON_SDVOE_AES67_AUDIO",[n.If.SDVOE_DANTE_AUDIO]:"COMMON_SDVOE_DANTE_AUDIO",[n.If.SHURE_AUDIO]:"-",[n.If.AES67_AUDIO]:"-",[n.If.CRESTRON_AUDIO_VIDEO]:"-",[n.If.SMPTE_AUDIO]:"-",[n.If.CUSTOM]:"-"},C=32},349665(e,t,a){a.d(t,{A:()=>r});var o=a(296540),n=a(705228),c=a(294303);const r=({maxWidth:e,label:t,children:a,...r})=>o.createElement(c.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?n.ng:e,...r},t,a)},553432(e,t,a){a.d(t,{A:()=>i});var o=a(296540),n=a(454195),c=a(566723),r=a(294303);const i=e=>o.createElement(r.A,{paddingTop:c.YC,paddingBottom:c.YC,gap:c.Ln,rowGap:c.YC,flexWrap:"wrap",minHeight:n.b,alignItems:"center",...e})},459599(e,t,a){a.r(t),a.d(t,{default:()=>F});var o=a(296540),n=a(951272),c=a(870443),r=a(916537),i=a(204751),_=a(822336),l=a(617147),s=a(709690),m=a(71479),d=a(132196),E=a(189643),O=a(814680),A=a(566723),C=a(553432),p=a(317672),I=a(349665),S=a(143811),D=a(294303),N=a(949330),g=a(987588);const u=(0,m.A)(D.A)`
  gap: ${A.kc};
  border-radius: ${A.kc};
  padding: ${A.kc};
  background-color: ${({theme:{themeName:e}})=>_.Ay[`desktop-color-neutral-01-${e}`]};
  align-items: start;
`,T=(0,m.A)(s.A)`
  margin-top: 2px;
`,h=d.AH`
  z-index: 100001 !important;
`,P=150,b=8*O.k,f=d.AH`
  max-width: 150px;
  width: 150px;
`,M=Array.from({length:64},(e,t)=>t).map(e=>({label:N.iL.find(t=>t.value===e)?.label||e.toString(),value:e})),R=E.iK.filter(e=>![E.aS.TCP_UDP,E.aS.ICMPV6].includes(e)).map(e=>({label:(0,E.Wi)(e),value:e})),q=({isExistingItem:e})=>{const{values:t,resetForm:a,submitForm:c,isSubmitting:_,setFieldValue:s}=(0,n.j7)(),{formatMessage:m}=(0,r.tz)(),d=(0,o.useCallback)(()=>{c()},[c]),O=(0,o.useCallback)(e=>{e.value!==E.aS.NUMBER&&s("protocolNumber",0),e.value!==E.aS.TCP&&e.value!==E.aS.UDP&&(s("enableSourcePort",!1),s("enableDestinationPort",!1),s("qos_matching.src_port",void 0),s("qos_matching.dst_port",void 0)),s("qos_matching.protocol",e.value)},[s]),q=t.qos_matching?.protocol,v="number"!=typeof q&&[E.aS.TCP,E.aS.UDP,E.aS.TCP_UDP].includes(q);return o.createElement(l.A,{onRequestClose:()=>a(),isOpen:!0,title:o.createElement(r.sA,{id:e?"PORTS_EDIT_QOS_PROFILE":"PORTS_CREATE_NEW_QOS_PROFILE"}),size:"small",actions:[{disabled:_,text:o.createElement(r.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",variant:"default",onClick:()=>a()},{disabled:_,text:o.createElement(r.sA,{id:"COMMON_ACTION_SAVE"}),type:"button",variant:"primary",onClick:d}]},o.createElement(D.A,{flexDirection:"column",gap:A.kc},o.createElement(u,null,o.createElement(T,{isActive:!0,variant:"fill"}),o.createElement(r.sA,{id:"PORTS_QOS_POLICY_INFO"})),o.createElement(S.A,{label:"COMMON_PROTOCOL",name:"qos_matching.protocol",options:R,translateLabel:!0,translateOptions:!0,type:"dropdown",isOpen:!0,portal:!0,optionContainerClassName:h,variant:"secondary",maxHeight:b,onChange:O}),q===E.aS.NUMBER?o.createElement(S.A,{className:f,max:255,min:0,name:"protocolNumber",width:80,type:"number",variant:"secondary",label:"COMMON_NUMBER",translateLabel:!0}):null,v?o.createElement(I.A,{gap:A.kc},o.createElement(p.A,{tooltip:o.createElement(r.sA,{id:"PORTS_QOS_POLICY_MATCH_PORT_DESC"})},o.createElement(r.sA,{id:"PORTS_QOS_POLICY_MATCH_PORT"})),o.createElement(D.A,{gap:A.Ln,justifyContent:"space-between"},o.createElement(g.l2,null,o.createElement(S.A,{name:"enableSourcePort",type:"realCheckbox"},o.createElement(r.sA,{id:"COMMON_SOURCE_PORT"}))),t.enableSourcePort?o.createElement(S.A,{className:f,full:!0,max:65535,min:1,name:"qos_matching.src_port",type:"number",variant:"secondary",width:80,placeholderValues:{value:10},placeholder:"COMMON_PLACEHOLDER_EG"}):null),o.createElement(D.A,{gap:A.Ln,justifyContent:"space-between"},o.createElement(g.l2,null,o.createElement(S.A,{name:"enableDestinationPort",type:"realCheckbox"},o.createElement(r.sA,{id:"COMMON_DESTINATION_PORT"}))),t.enableDestinationPort?o.createElement(S.A,{className:f,full:!0,max:65535,min:1,name:"qos_matching.dst_port",type:"number",variant:"secondary",width:80,placeholderValues:{value:10},placeholder:"COMMON_PLACEHOLDER_EG"}):null)):null,o.createElement(I.A,null,o.createElement(p.A,{tooltip:o.createElement(r.sA,{id:"PORTS_FORM_FIELD_QOS_MATCHING_DESC"})},o.createElement(r.sA,{id:"PORTS_FORM_FIELD_QOS_MATCHING"})),o.createElement(C.A,null,o.createElement(S.A,{value:i.ev.DSCP,type:"radio",name:"matchingTrafficType"},o.createElement(r.sA,{id:N.kB[i.ev.DSCP]})),o.createElement(S.A,{value:i.ev.IP_PRECEDENCE,type:"radio",name:"matchingTrafficType"},o.createElement(r.sA,{id:N.kB[i.ev.IP_PRECEDENCE]})),o.createElement(S.A,{value:i.AC,type:"radio",name:"matchingTrafficType"},o.createElement(r.sA,{id:"COMMON_NONE"}))),t.matchingTrafficType===i.ev.DSCP?o.createElement(S.A,{name:"qos_matching.dscp_code",type:"dropdown",portal:!0,optionContainerClassName:h,variant:"secondary",options:M,label:"COMMON_CODE",translateLabel:!0,width:P,maxHeight:b}):null,t.matchingTrafficType===i.ev.IP_PRECEDENCE?o.createElement(S.A,{name:"qos_matching.ip_precedence_code",type:"dropdown",portal:!0,optionContainerClassName:h,variant:"secondary",options:N.Y$,label:"COMMON_CODE",translateLabel:!0,width:P,maxHeight:b}):null),o.createElement(g.l2,null,o.createElement(S.A,{name:"enableQosMarking",type:"realCheckbox",tooltipMessage:o.createElement(r.sA,{id:"PORTS_FORM_FIELD_QOS_MARKING_DESC"})},o.createElement(r.sA,{id:"PORTS_FORM_FIELD_QOS_MARKING"}))),t.enableQosMarking?o.createElement(I.A,null,o.createElement(p.A,null,o.createElement(r.sA,{id:"COMMON_TYPE"})),o.createElement(C.A,null,o.createElement(S.A,{value:i.ev.DSCP,type:"radio",name:"markingTrafficType"},o.createElement(r.sA,{id:N.kB[i.ev.DSCP]})),o.createElement(S.A,{value:i.ev.COS,type:"radio",name:"markingTrafficType"},o.createElement(r.sA,{id:N.kB[i.ev.COS]}))),t.markingTrafficType===i.ev.DSCP?o.createElement(S.A,{name:"qos_marking.dscp_code",type:"dropdown",portal:!0,optionContainerClassName:h,variant:"secondary",options:N.iL,label:"COMMON_CODE",translateLabel:!0,width:P,maxHeight:b}):null,t.markingTrafficType===i.ev.COS?o.createElement(S.A,{name:"qos_marking.cos_code",type:"dropdown",portal:!0,optionContainerClassName:h,variant:"secondary",options:N.TH,label:"COMMON_CODE",translateLabel:!0,width:P,maxHeight:b}):null):null,o.createElement(S.A,{className:f,max:7,min:0,name:"qos_marking.queue",type:"number",variant:"secondary",label:"COMMON_QUEUE",labelTooltip:m({id:"PORTS_QOS_POLICY_QUEUE_DESC"}),translateLabel:!0})))};var v=a(205975),U=a(877995);const L=65535,k=e=>{const t=o.createElement(r.sA,{id:"COMMON_VALIDATION_INVALID_RANGE_WITH_FIELD_NAME",values:{min:0,max:7,name:e({id:"COMMON_QUEUES"}).toLocaleLowerCase()}}),a=o.createElement(r.sA,{id:"COMMON_VALIDATION_INVALID_RANGE_WITH_FIELD_NAME",values:{min:1,max:L,name:e({id:"COMMON_PORTS"}).toLocaleLowerCase()}}),n=o.createElement(r.sA,{id:"COMMON_VALIDATION_INVALID_RANGE",values:{min:0,max:255}});return c.A.object().shape({qos_marking:c.A.object().shape({cos_code:c.A.number().min(0).max(7).integer(),dscp_code:c.A.number().min(0).max(63),ip_precedence_code:c.A.number().min(0).max(7),queue:c.A.number().integer().required(t).label("COMMON_QUEUE").min(0,t).max(7,t)}),qos_matching:c.A.object().shape({cos_code:c.A.number().min(0).max(7),dscp_code:c.A.number().min(0).max(63),dst_port:c.A.number().integer().label("COMMON_DESTINATION_PORT").min(1,a).max(L,a).test({name:"dstPortRequired",test:(e,t)=>void 0!==e||!t.options.context.enableDestinationPort||t.createError({message:a})}),ip_precedence_code:c.A.number().min(0).max(7),protocol:c.A.string().label("COMMON_PROTOCOL"),src_port:c.A.number().integer().label("COMMON_SOURCE_PORT").min(1,a).max(L,a).test({name:"srcPortRequired",test:(e,t)=>void 0!==e||!t.options.context.enableSourcePort||t.createError({message:a})})}),enableDestinationPort:c.A.boolean(),enableSourcePort:c.A.boolean(),enableQosMarking:c.A.boolean(),matchingTrafficType:c.A.string().oneOf([i.ev.DSCP,i.ev.IP_PRECEDENCE,i.AC]),markingTrafficType:c.A.string().oneOf([i.ev.DSCP,i.ev.COS]),protocolNumber:c.A.number().label("COMMON_NUMBER").integer().min(0,n).max(255,n).required(n)})},F=({addCallback:e,hideModal:t,existingItem:a,existingItemIndex:c})=>{const{formatMessage:i}=(0,r.tz)(),_=(0,o.useCallback)(a=>{e(a,c),t()},[e,t,c]),l=(0,o.useMemo)(()=>a?(0,v.zN)(a):U.L,[a]);return o.createElement(n.l1,{initialValues:l,validationSchema:k(i),onSubmit:_,onReset:()=>{t()}},o.createElement(q,{isExistingItem:Boolean(a)}))}},877995(e,t,a){a.d(t,{L:()=>c});var o=a(189643),n=a(204751);const c={qos_marking:{cos_code:n.hQ.BACKGROUND,dscp_code:n.ee.DEFAULT,ip_precedence_code:n.lF.ROUTINE,queue:0},qos_matching:{cos_code:n.hQ.BACKGROUND,dscp_code:n.ee.DEFAULT,ip_precedence_code:n.lF.ROUTINE,protocol:o.aS.ALL},enableDestinationPort:!1,enableSourcePort:!1,enableQosMarking:!1,matchingTrafficType:n.ev.DSCP,markingTrafficType:n.ev.DSCP,protocolNumber:0}},205975(e,t,a){a.d(t,{Dz:()=>s,JS:()=>l,zN:()=>m});var o=a(189643),n=a(573531),c=a(204751),r=a(949330),i=a(877995);const _=e=>void 0!==e.cos_code?`CoS ${e.cos_code} (${r.e8[e.cos_code]})`:void 0!==e.dscp_code?`DSCP ${e.dscp_code}${r.HH[e.dscp_code]?` (${r.HH[e.dscp_code]})`:""}`:void 0!==e.ip_precedence_code?`IPP ${e.ip_precedence_code} (${r.Dc[e.ip_precedence_code]})`:n.L,l=e=>e.map((e,t)=>({matchProtocol:e.qos_matching.protocol??o.aS.ALL,matchType:_(e.qos_matching),remark:_(e.qos_marking),queue:e.qos_marking.queue,id:t})),s=e=>{const t={qos_marking:{...e.qos_marking},qos_matching:{...e.qos_matching}};switch(e.qos_matching.protocol===o.aS.ALL&&(delete t.qos_matching.src_port,delete t.qos_matching.dst_port,delete t.qos_matching.protocol),e.qos_matching.protocol===o.aS.NUMBER&&(t.qos_matching.protocol=e.protocolNumber),e.enableDestinationPort||delete t.qos_matching.dst_port,e.enableSourcePort||delete t.qos_matching.src_port,e.markingTrafficType){case c.ev.DSCP:delete t.qos_marking.cos_code,delete t.qos_marking.ip_precedence_code;break;case c.ev.COS:delete t.qos_marking.dscp_code,delete t.qos_marking.ip_precedence_code}switch(e.matchingTrafficType){case c.ev.DSCP:delete t.qos_matching.cos_code,delete t.qos_matching.ip_precedence_code;break;case c.ev.IP_PRECEDENCE:delete t.qos_matching.dscp_code,delete t.qos_matching.cos_code;break;case c.AC:delete t.qos_matching.dscp_code,delete t.qos_matching.cos_code,delete t.qos_matching.ip_precedence_code}return e.enableQosMarking||(delete t.qos_marking.cos_code,delete t.qos_marking.dscp_code,delete t.qos_marking.ip_precedence_code),t},m=e=>{const t={qos_marking:{cos_code:e.qos_marking.cos_code||i.L.qos_marking.cos_code,dscp_code:e.qos_marking.dscp_code||i.L.qos_marking.dscp_code,ip_precedence_code:e.qos_marking.ip_precedence_code||i.L.qos_marking.ip_precedence_code,queue:e.qos_marking.queue||i.L.qos_marking.queue},qos_matching:{protocol:"number"==typeof e?.qos_matching?.protocol?o.aS.NUMBER:e.qos_matching.protocol||i.L.qos_matching.protocol,cos_code:e.qos_matching.cos_code||i.L.qos_matching.cos_code,dscp_code:e.qos_matching.dscp_code||i.L.qos_matching.dscp_code,ip_precedence_code:e.qos_matching.ip_precedence_code||i.L.qos_matching.ip_precedence_code,dst_port:e.qos_matching.dst_port||i.L.qos_matching.dst_port,src_port:e.qos_matching.src_port||i.L.qos_matching.src_port}};return t.enableDestinationPort=void 0!==e.qos_matching.dst_port,t.enableSourcePort=void 0!==e.qos_matching.src_port,t.enableQosMarking=void 0!==e.qos_marking.cos_code||void 0!==e.qos_marking.dscp_code||void 0!==e.qos_marking.ip_precedence_code,t.markingTrafficType=void 0!==e.qos_marking.cos_code?c.ev.COS:c.ev.DSCP,t.matchingTrafficType=void 0!==e.qos_matching.dscp_code?c.ev.DSCP:void 0!==e.qos_matching.ip_precedence_code?c.ev.IP_PRECEDENCE:c.AC,t.protocolNumber="number"==typeof e.qos_matching.protocol?e.qos_matching.protocol:0,t}},987588(e,t,a){a.d(t,{EV:()=>l,l2:()=>i,rH:()=>_});var o=a(71479),n=a(132196),c=a(566723),r=a(294303);const i=(0,o.A)(r.A)`
  min-height: ${c.fS};
  align-items: center;
  align-self: flex-start;
`,_=n.AH`
  max-width: 130px;
  width: 130px;
`,l=n.AH`
  > div {
    margin: 0 !important;
  }
`},814680(e,t,a){a.d(t,{W:()=>n,k:()=>o});const o=34,n=12*o}}]);