"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[60579],{203035:(e,t,a)=>{a.d(t,{JT:()=>o,Uv:()=>E,_O:()=>d,cl:()=>s});var i=a(801081),n=a(25553),l=a(87485),r=a(932767);const o=e=>(0,i.Mz)((0,n.uh)((0,r.RU)(e)),l.kh),_=(0,i.Mz)((0,n.uh)((0,r.UC)()),l.i6),s=(0,i.Mz)(_,e=>e.available_ports||[]),d=(0,i.Mz)((0,n.uh)((0,r.WV)()),l.i6),c=(0,i.Mz)((0,n.uh)((0,r.go)()),l.kh),E=(0,i.Mz)(c,e=>e.map(e=>({_id:e._id,name:e.name,interface_ip:e.interface_ip,network_id:e.network_id})))},252093:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(296540),n=a(271856),l=a(162420),r=a(699784);const o=({messageId:e,tooltipClassName:t,values:a,isInteractive:o,portal:_,variant:s="twoTone",size:d="medium"})=>i.createElement(n.A,{description:i.createElement(r.sA,{id:e,values:a}),width:210,isInteractive:o,portal:_,tooltipClassName:t},i.createElement(l.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:d}))},391855:(e,t,a)=>{a.d(t,{A:()=>d});var i=a(296540),n=a(271856),l=a(858931),r=a(823858),o=a(71479),_=a(699784);const s=(0,o.A)(r.A)`
  color: #ffffff;
`,d=(0,i.memo)(({isDisabled:e,showLoader:t,showWarning:a,showWarningIcon:r,warning:o,label:d="COMMON_ACTION_APPLY_CHANGES",onSubmit:c,form:E})=>i.createElement(n.A,{description:a?o??i.createElement(_.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,portal:!0,width:240},i.createElement(l.A,{disabled:e,type:"submit",onClick:c,variant:"primary",Icon:a||r?i.createElement(s,{variant:"fill"}):null,loader:t?"loading":void 0,form:E},i.createElement(_.sA,{id:d}))))},400261:(e,t,a)=>{a.d(t,{Z:()=>n});var i=a(546391);const n=e=>e?e.replace(i.SD,"").replace(i.fA,"$&:").substring(0,17).toLowerCase():e},405349:(e,t,a)=>{a.d(t,{F:()=>i});const i=a(132196).AH`
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
`},813040:(e,t,a)=>{a.d(t,{A:()=>E,R:()=>c});var i=a(296540),n=a(822336),l=a(718073),r=a(71479),o=a(566723),_=a(294303),s=a(252093);const d=(0,r.A)(_.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>n.Ay[`desktop-border-divider-${e}`]};
  padding: ${o.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${o.Ln};
  }
`,c=({tooltipId:e,disabledTooltip:t,children:a,tooltipProps:n={},...r})=>i.createElement(d,{...r},i.createElement(_.A,{justifyContent:"space-between",alignItems:"center"},i.createElement(l.A,{description:t,placement:"left"},i.createElement("span",null,a)),e?i.createElement(s.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...n}):null)),E=c},854925:(e,t,a)=>{a.d(t,{B:()=>n});var i=a(16914);const n=e=>[i.$P.APP,i.$P.APP_CATEGORY].includes(e)},860579:(e,t,a)=>{a.d(t,{A:()=>Mt});var i=a(469733),n=a(296540),l=a(951272),r=a(592510),o=a(742920),_=a(38671),s=a(335928),d=a(464265),c=a(398300),E=a(845030),m=a(675359),A=a(699784),I=a(175165),T=a(366188),u=a(602021),O=a(589681),S=a(714610),p=a(707362),N=a(319797),C=a(414783),R=a(598796),M=a(959341),P=a(624461),g=a(703599),b=a(271856),h=a(566723),L=a(48925),v=a(349107),f=a(294303),y=a(689965),D=a(854925),G=a(302167),Y=a(765562),w=a(813040),F=a(352466),U=a(137625),k=a(391855),V=a(16914),W=a(482579),z=a(145520);const x=({isDisabled:e,isLoading:t,isExistingRecord:a,values:l,submitForm:r,form:o})=>{const _=(0,i.useSelector)(S.Cw),s=(0,n.useMemo)(()=>_.find(e=>e.zone_key===O.o.GATEWAY),[_]),d=(0,n.useMemo)(()=>_.find(e=>e.zone_key===O.o.EXTERNAL),[_]),c=l.action===V.Dl.BLOCK||l.action===V.Dl.REJECT,E=c&&l.source_matching_target===W.y.ANY&&l.destination_matching_target===z.f.ANY&&l.source_port_matching_type===V.rl.ANY&&l.destination_port_matching_type===V.rl.ANY,m=c&&l.source_matching_target===W.y.ANY&&l.destination_matching_target===z.f.ANY&&!!l.destination_zone_id&&l.destination_zone_id===s?._id,I=E&&!!l.destination_zone_id&&l.destination_zone_id===d?._id,T=m||E||I,u=(0,n.useMemo)(()=>{let e="";return m?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_TITLE":I?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_TITLE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_TITLE"),e},[m,I,E]),p=(0,n.useMemo)(()=>{let e="";return m?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_MESSAGE":I?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_MESSAGE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_MESSAGE"),e},[m,I,E]),[N,C]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{N&&!T&&C(!1)},[N,T]),n.createElement(U.A,{isOpen:N,handleConfirm:()=>{C(!1),r()},handleCancel:()=>C(!1),handleClose:()=>C(!1),rootClose:!0,buttonVariant:"danger",buttonMessage:"COMMON_ACTION_PROCEED",title:u,body:n.createElement("div",null,n.createElement(A.sA,{id:p,values:{link:n.createElement(v.A,{id:"COMMON_LEARN_MORE",noWrap:!0,href:Y.A.firewallPolicies})}}))},n.createElement(k.A,{isDisabled:e,showLoader:t,showWarningIcon:T,label:a?"COMMON_ACTION_APPLY_CHANGES":"SETTINGS_SECURITY_ADD_POLICY",form:o,onSubmit:e=>{T&&(e.preventDefault(),e.stopPropagation(),C(!0))}}))};var H=a(709690),B=a(928085),K=a(454195),j=a(143811),q=a(196010);const $=({disabled:e})=>{const t=(0,B.A)(`${M.bB}/${M.Uy.TRAFFIC_LOGGING}`);return n.createElement(f.A,{alignItems:"center",minHeight:K.b},n.createElement(f.A,{alignItems:"center",gap:h.YC},n.createElement(j.A,{type:"realCheckbox",name:"logging",disabled:e},n.createElement(A.sA,{id:"COMMON_SYSLOG_LOGGING"})),n.createElement(b.A,{isInteractive:!0,portal:!0,description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION",values:{link:n.createElement(q.A,{to:t,style:{whiteSpace:"nowrap"}},n.createElement(A.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION_LINK_TEXT"}))}})},n.createElement(H.A,{size:"original",isActive:!0}))))};var Z=a(400261),X=a(405349),J=a(902146),Q=a(958979),ee=a(64449),te=a(324697),ae=a(74805),ie=a(203035),ne=a(277517),le=a(867955),re=a(546391);const oe=({disabled:e,fieldName:t,options:a,onFieldChange:i})=>{const{setFieldValue:r}=(0,l.j7)(),o=(0,n.useCallback)(e=>{r(t,e.value),i()},[r,t,i]);return n.createElement(j.A,{type:"dropdown",variant:"secondary",name:t,options:a,disabled:e,onChange:o,full:!0})};var _e=a(217439),se=a(162420);const de=({disabled:e,fieldName:t,radioOptions:a})=>n.createElement(f.A,{flexDirection:"column"},n.createElement(f.A,{alignItems:"center",gap:h.YC},n.createElement(_e.A,{size:"small",color:"text-3"},n.createElement(A.sA,{id:"COMMON_PORT"})),n.createElement(b.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_PORT_DESCRIPTION"}),portal:!0,style:{display:"flex",alignItems:"center"}},n.createElement(se.A,{size:"original",isActive:!0}))),n.createElement(f.A,{gap:h.Ln,height:K.b,alignItems:"center"},a.map(a=>n.createElement(j.A,{key:`${t}_${a.value}`,type:"radio",name:t,value:a.value,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:a.label}))))));var ce=a(718073),Ee=a(553432);const me=({disabled:e,fieldName:t})=>{const{values:a}=(0,l.j7)(),i=a.ip_version===V.oi.IPV6,r=(0,d.A)(R.Xj.IPV6_INTERFACE_IDENTIFIER_FOR_FIREWALL_FILTER);return n.createElement(Ee.A,null,n.createElement(j.A,{type:"radio",name:t,value:V.qv.SPECIFIC,disabled:e},n.createElement(A.sA,{id:"COMMON_SPECIFIC"})),n.createElement(j.A,{type:"radio",name:t,value:V.qv.OBJECT,disabled:e},n.createElement(A.sA,{id:"SETTINGS_LIST"})),r?n.createElement(ce.A,{description:i?void 0:n.createElement(A.sA,{id:"SETTINGS_IPV6_INTERFACE_ID_DISABLED_TOOLTIP"})},n.createElement("div",null,n.createElement(j.A,{type:"radio",name:t,value:V.qv.IID,disabled:e||!i,tooltipMessage:n.createElement(A.sA,{id:"SETTINGS_SECURITY_ZONE_IPV6_INTERFACE_ID_TOOLTIP"})},n.createElement(A.sA,{id:"SETTINGS_IPV6_INTERFACE_ID"})))):null)};var Ae=a(379509),Ie=a(823858),Te=a(998837),ue=a(823084);const Oe=()=>n.createElement(ue.A,{icon:n.createElement(Ie.A,{variant:"fill",size:"original",color:(0,Te.u)().motifPalette.warning})},n.createElement(A.sA,{id:"SETTINGS_POLICY_WILL_NOT_APPLY_WITH_SSL_INSPECTION",values:{link:n.createElement(v.A,{id:"COMMON_LEARN_MORE",href:Y.A.firewallPolicies,noWrap:!0})}})),Se=({disabled:e,name:t,labelId:a,descriptionId:i})=>n.createElement(f.A,{minHeight:K.b,alignItems:"center"},n.createElement(j.A,{disabled:e,type:"realCheckbox",name:t,tooltipMessage:n.createElement(A.sA,{id:i}),tooltipProps:{portal:!0,style:{display:"flex",alignItems:"center"}}},n.createElement(f.A,{alignItems:"center",gap:h.YC},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:a})))));var pe=a(836349),Ne=a(594827),Ce=a(524936);const Re=({disabled:e})=>{const{formatMessage:t}=(0,A.tz)(),{values:{source_zone_id:a,source_vpn_site_to_site_id:r}}=(0,l.j7)(),o=(0,i.useSelector)(S.Av),_=(0,i.useSelector)(S.Cw),s=(0,n.useMemo)(()=>_.find(({_id:e})=>e===a),[a,_]),d=(0,n.useMemo)(()=>o.filter(e=>r===e._id||s&&(0,g.c8)(e,s)&&(0,Ce.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Ne.qY)(e.sdwan_hub_spoke_local_wan_id,t):e.ip})),[o,t,s,r]);return n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(j.A,{disabled:e,name:"source_vpn_site_to_site_id",validated:!0,options:d,type:"dropdown",full:!0,variant:"secondary"}))},Me=({disabled:e,name:t})=>{const{formatMessage:a}=(0,A.tz)(),{values:r}=(0,l.j7)(),o=(0,i.useSelector)(S.Av),_=(0,i.useSelector)(S.Cw),s=(0,n.useMemo)(()=>_.find(({_id:e})=>e===r.source_zone_id),[r.source_zone_id,_]),d=(0,l.O6)(r,t),c=(0,n.useMemo)(()=>o.filter(e=>d.includes(e._id)||s&&(0,g.c8)(e,s)&&!(0,Ce.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Ne.qY)(e.sdwan_hub_spoke_local_wan_id,a):e.ip})),[d,o,a,s]);return n.createElement(j.A,{disabled:e,name:t,options:c,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0})},Pe={[W.y.ANY]:"COMMON_ANY",[W.y.CLIENT]:"COMMON_DEVICE",[W.y.NETWORK]:"COMMON_NETWORK",[W.y.VPN_SERVER]:"COMMON_SERVER",[W.y.VPN_SITE_TO_SITE]:"SETTINGS_NETWORKS_FORM_FIELD_VPN_TYPE_SITE_TO_SITE",[W.y.IP]:"COMMON_IP",[W.y.MAC]:"COMMON_MAC",[W.y.VPN_USER]:"COMMON_USER",[W.y.REGION]:"COMMON_REGION"},ge=[W.y.ANY,W.y.VPN_SERVER,W.y.VPN_SITE_TO_SITE,W.y.IP],be=[W.y.ANY,W.y.IP,W.y.MAC,W.y.REGION],he=[W.y.ANY,W.y.CLIENT,W.y.NETWORK,W.y.IP,W.y.MAC],Le=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,i.useSelector)(S.Cw),r=(0,i.useSelector)(S.Av),o=(0,n.useMemo)(()=>a.find(e=>e._id===t.source_zone_id),[t.source_zone_id,a]),_=(0,n.useMemo)(()=>o?o.zone_key===O.o.GATEWAY?[]:o.zone_key===O.o.VPN?ge:o.zone_key===O.o.EXTERNAL?be:he:[W.y.ANY],[o]);return n.createElement(f.A,{gap:h.xO,rowGap:h.YC,paddingTop:h.YC,paddingBottom:h.YC,alignItems:"center",flexWrap:"wrap"},_.map(t=>{const a=t===W.y.NETWORK&&o&&!r.some(e=>(0,g.c8)(e,o)),i=t===W.y.VPN_SERVER&&o&&!r.some(e=>(0,g.c8)(e,o)&&!(0,Ce.u0)(e)),l=t===W.y.VPN_SITE_TO_SITE&&o&&!r.some(e=>(0,g.c8)(e,o)&&(0,Ce.u0)(e));return n.createElement(b.A,{portal:!0,description:a||i||l?n.createElement(A.sA,{id:"SETTINGS_SECURITY_NO_NETWORKS_FOR_ZONE_TOOLTIP"}):null,key:`source_matching_target_${t}`},n.createElement(j.A,{type:"radio",name:"source_matching_target",value:t,disabled:e||a||i||l},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:Pe[t]}))))}))};var ve=a(712050),fe=a(784045),ye=a(852866),De=a(573531),Ge=a(703447),Ye=a(618721),we=a(951106);const Fe=e=>({label:(0,ye.c)((0,we.tn)(e)||e.mac,35)||De.L,value:e.mac,image:n.createElement(f.A,{alignItems:"center",justifyContent:"center",width:24,height:24},n.createElement(Ge.A,{client:e})),additionalInfo:e.mac}),Ue=({id:e})=>n.createElement(f.A,{alignItems:"center",height:K.b},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:e})));var ke;!function(e){e.ZONE_DEVICES="zone-devices",e.OTHER_DEVICES="other-devices"}(ke||(ke={}));const Ve=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,i.useSelector)(S.Cw),r=(0,i.useSelector)(Ye.g),o=a.find(e=>e._id===t.source_zone_id),_=(0,n.useMemo)(()=>{const e=t.source_client_macs.filter(e=>!r.some(t=>t.mac===e)),[a,i]=(0,ve.A)((0,fe.A)(r,[e=>(0,we.tn)(e),e=>e.mac]),e=>e.network_id&&o?.network_ids.includes(e.network_id));return[...a.length?[{label:n.createElement(Ue,{id:"SETTINGS_FIREWALL_RULE_ZONE_DEVICES"}),value:ke.ZONE_DEVICES,group:ke.ZONE_DEVICES,groupTitle:!0}]:[],...a.map(e=>({...Fe(e),group:ke.ZONE_DEVICES})),...i.length?[{label:n.createElement(Ue,{id:"SETTINGS_FIREWALL_RULE_OTHER_DEVICES"}),value:ke.OTHER_DEVICES,group:ke.OTHER_DEVICES,groupTitle:!0}]:[],...i.map(e=>({...Fe(e),group:ke.OTHER_DEVICES})),...e.map(e=>({...Fe({mac:e}),group:ke.OTHER_DEVICES}))]},[o?.network_ids,r,t.source_client_macs]);return n.createElement(j.A,{type:"picklist",options:_,name:"source_client_macs",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0,isWindowed:!0,disabled:e})},We=({disabled:e})=>{const t=(0,i.useSelector)(S.Cw),a=(0,i.useSelector)(S.Av),r=(0,i.useSelector)(N.xK),o=(0,i.useSelector)(ie.Uv),_=(0,i.useSelector)(ne.YX),{formatMessage:s}=(0,A.tz)(),{values:{ip_version:d,source_zone_id:c,source_matching_target:E,source_matching_target_type:m,source_port_matching_type:I,source_ip_match_mac:T},setFieldValue:u}=(0,l.j7)(),p=(0,n.useMemo)(()=>t.filter(e=>e.zone_key!==O.o.GATEWAY).map(({_id:e,name:t,zone_key:a})=>({label:a?s({id:J.F[a]}):t,value:e,labelClassName:X.F})),[t,s]),C=t.find(({_id:e})=>e===c),R=(0,n.useMemo)(()=>(0,g.SH)(o,a),[o,a]),M=(0,n.useCallback)(e=>{u("source_ip_mac",(0,Z.Z)(e.currentTarget?.value))},[u]);return n.createElement(n.Fragment,null,n.createElement(f.A,{flexDirection:"column",gap:h.kc,width:"100%"},n.createElement(oe,{disabled:e,fieldName:"source_zone_id",options:p,onFieldChange:()=>{u("source_matching_target",r.source.matching_target),u("source_matching_target_type",r.source.matching_target_type),u("source_network_ids",[])}}),n.createElement(Le,{disabled:e}),C?.zone_key===O.o.VPN&&E!==W.y.VPN_SERVER&&_?n.createElement(Oe,null):null,E===W.y.CLIENT?n.createElement(Ve,{disabled:e}):null,E===W.y.VPN_USER?n.createElement(j.A,{disabled:e,name:"source_wireguard_user_ids",options:R,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,E===W.y.NETWORK?n.createElement(Me,{name:"source_network_ids",disabled:e}):null,E===W.y.VPN_SERVER?n.createElement(Me,{name:"source_vpn_server_ids",disabled:e}):null,E===W.y.VPN_SITE_TO_SITE?n.createElement(Re,{disabled:e}):null,[W.y.NETWORK,W.y.VPN_SERVER].includes(E)?n.createElement(Se,{disabled:e,name:"source_match_opposite_networks",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_NETWORKS_DESCRIPTION"}):null,E===W.y.IP?n.createElement(n.Fragment,null,n.createElement(me,{disabled:e,fieldName:"source_matching_target_type"}),m===V.qv.SPECIFIC?n.createElement(n.Fragment,null,n.createElement(ae.A,{disabled:e,fieldName:"source_ips",labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:s({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>s({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),validate:e=>(0,g.GH)(d,e,!0)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:d}}})):null,m===V.qv.OBJECT?n.createElement(te.A,{disabled:e,name:"source_ip_group_id",types:pe.$d,getDisabledReason:(0,g.Xe)(d)}):null,m===V.qv.IID?n.createElement(n.Fragment,null,n.createElement(Ae.A,{disabled:e,name:"source_iid"}),n.createElement(Se,{disabled:e,name:"source_match_opposite_iid",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):n.createElement(Se,{disabled:e,name:"source_match_opposite_ips",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):null,[W.y.IP,W.y.NETWORK].includes(E)&&C?.zone_key!==O.o.VPN?n.createElement(f.A,{flexDirection:"column",width:"100%",gap:h.kc},n.createElement(Se,{disabled:e,name:"source_ip_match_mac",labelId:"SETTINGS_MATCH_MAC_ADDRESS",descriptionId:"SETTINGS_MATCH_MAC_ADDRESS_DESCRIPTION"}),T?n.createElement(j.A,{disabled:e,type:"text",name:"source_ip_mac",variant:"secondary",placeholder:"COMMON_PLACEHOLDER_EG",placeholderValues:{value:"ab:cd:ef:12:34:56"},translatePlaceholder:!0,onChange:M}):null):null,E===W.y.MAC?n.createElement(ae.A,{disabled:e,fieldName:"source_macs",labels:{fieldLabel:"COMMON_MAC_ADDRESS",modalTitle:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS",modalFieldPlaceholder:s({id:"SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>s({id:"SETTINGS_SECURITY_VALIDATION_DUPLICATE_MACS"}),validate:e=>!!e?.match(re.b8)||n.createElement(A.sA,{id:"COMMON_VALIDATION_VALID_MAC"})},extraFieldConfig:{parser:(...e)=>(0,Z.Z)(e?.[0]?.[0].target?.value),placeholder:"COMMON_PLACEHOLDER_EG",placeholderValues:{value:"ab:cd:ef:12:34:56"}}}):null,E===W.y.REGION?n.createElement(j.A,{type:"picklist",name:"source_regions",options:Q.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:Q.xn}):null,n.createElement(de,{disabled:e,fieldName:"source_port_matching_type",radioOptions:pe.o5}),I===V.rl.SPECIFIC?n.createElement(ee.A,{customPortFieldName:"source_port",serviceFieldName:"source_port_service"}):null,I===V.rl.OBJECT?n.createElement(te.A,{disabled:e,name:"source_port_group_id",types:[le.B.PORT_GROUP]}):null,I!==V.rl.ANY?n.createElement(Se,{disabled:e,name:"source_match_opposite_ports",labelId:"SETTINGS_MATCH_OPPOSITE_PORT",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_PORTS_DESCRIPTION"}):null))};var ze=a(189643),xe=a(705228),He=a(679783);const Be=({disabled:e})=>{const{values:{protocol:t,ip_version:a}}=(0,l.j7)(),{formatMessage:i}=(0,A.tz)(),r=(0,n.useMemo)(()=>(0,g.uj)(a,i,e,t),[a,i,e,t]),o=pe.Fb.map(e=>({label:(0,g.EH)(e),value:e})),_=pe.DT.map(e=>({label:(0,g.EH)(e),value:e})),s=!pe.vm.includes(t);return n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(He.A,{label:n.createElement(A.sA,{id:"COMMON_PROTOCOL"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_PROTOCOL_DESCRIPTION"})}),n.createElement(f.A,{flexDirection:"column",gap:h.kc,width:"100%"},n.createElement(f.A,{gap:h.Ln,rowGap:h.YC,paddingTop:h.YC,paddingBottom:h.YC,alignItems:"center",flexWrap:"wrap"},n.createElement(j.A,{type:"radio",name:"protocol",value:ze.aS.ALL,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_ALL"}))),n.createElement(j.A,{type:"radio",name:"protocol",value:ze.aS.TCP_UDP,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_TCP_AND_UDP"}))),n.createElement(j.A,{type:"radio",name:"protocol",value:ze.aS.TCP,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_TCP"}))),n.createElement(j.A,{type:"radio",name:"protocol",value:ze.aS.UDP,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_UDP"}))),n.createElement(j.A,{type:"radio",name:"protocol",value:"",disabled:e,checked:s},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_CUSTOM"})))),s?n.createElement(f.A,{flexDirection:"column",width:xe.ng},n.createElement(j.A,{type:"dropdown",variant:"secondary",name:"protocol",options:r,disabled:e,renderOption:g.in,full:!0,sortedDropdown:!0,searchable:!0,validated:!0,value:t})):null,t===ze.aS.ICMP?n.createElement(f.A,{flexDirection:"column",width:xe.ng},n.createElement(j.A,{type:"dropdown",variant:"secondary",label:n.createElement(A.sA,{id:"COMMON_IPV4_ICMP_TYPE_NAME"}),name:"icmp_typename",options:o,disabled:e,full:!0,sortedDropdown:!0,searchable:!0,translateOptions:!0,validated:!0})):null,t===ze.aS.ICMPV6?n.createElement(f.A,{flexDirection:"column",width:xe.ng},n.createElement(j.A,{type:"dropdown",variant:"secondary",label:n.createElement(A.sA,{id:"COMMON_IPV6_ICMP_TYPE_NAME"}),name:"icmp_v6_typename",options:_,disabled:e,full:!0,sortedDropdown:!0,searchable:!0,translateOptions:!0,validated:!0})):null,pe.hA.includes(t)?null:n.createElement(f.A,{alignItems:"center",gap:h.YC,minHeight:K.b},n.createElement(j.A,{type:"realCheckbox",name:"match_opposite_protocol",disabled:e},n.createElement(A.sA,{id:"COMMON_MATCH_OPPOSITE"})),n.createElement(b.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_MATCH_OPPOSITE_PROTOCOL_DESCRIPTION"}),portal:!0,isInteractive:!0,style:{display:"flex",alignItems:"center"}},n.createElement(se.A,{size:"original",isActive:!0}))),t===ze.aS.NUMBER?n.createElement(j.A,{type:"number",width:168,variant:"secondary",name:"protocol_number",min:pe.uY,max:pe.yz,disabled:e,placeholder:"SETTINGS_SECURITY_PROTOCOL_NUMBER_PLACEHOLDER",translatePlaceholder:!0}):null))},Ke=({disabled:e})=>{const{setSharedName:t}=(0,P.H5)(),{setFieldValue:a}=(0,l.j7)();return n.createElement(j.A,{full:!0,maxLength:pe.aC,name:"name",variant:"secondary",disabled:e,label:n.createElement(A.sA,{id:"COMMON_NAME"}),onChange:e=>{t(e.target.value),a("name",e.target.value)}})},je=({disabled:e})=>{const{values:{match_ip_sec:t}}=(0,l.j7)();return n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(f.A,{alignItems:"center",gap:h.YC,minHeight:K.b},n.createElement(j.A,{type:"realCheckbox",name:"match_ip_sec",disabled:e},n.createElement(A.sA,{id:"COMMON_MATCH_IPSEC"})),n.createElement(b.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_MATCH_IPSEC_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0},n.createElement(H.A,{isActive:!0,size:"original"}))),t?n.createElement(f.A,{gap:h.Ln,rowGap:h.YC,flexWrap:"wrap",alignItems:"center",paddingTop:h.YC,paddingBottom:h.YC},n.createElement(j.A,{type:"radio",name:"match_ip_sec_type",value:V.kz.MATCH_IPSEC,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"SETTINGS_SECURITY_ENCRYPTED"}))),n.createElement(j.A,{type:"radio",name:"match_ip_sec_type",value:V.kz.MATCH_NON_IPSEC,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"SETTINGS_SECURITY_NOT_ENCRYPTED"})))):null)};var qe=a(711748);const $e=({disabled:e})=>{const{values:{ip_version:t,protocol:a,source_matching_target:r,source_matching_target_type:o,source_ip_group_id:_,source_ips:s,destination_matching_target:d,destination_matching_target_type:c,destination_ip_group_id:E,destination_ips:m},setFieldValue:I}=(0,l.j7)(),T=(0,i.useSelector)(qe.O9),u=(0,n.useMemo)(()=>(0,g.Ry)({ip_version:t,protocol:a,source_matching_target:r,source_matching_target_type:o,source_ip_group_id:_,source_ips:s,destination_matching_target:d,destination_matching_target_type:c,destination_ip_group_id:E,destination_ips:m},T,e),[e,T,t,a,r,o,_,s,d,c,E,m]),O=(0,n.useCallback)(e=>{I("ip_version",e),e!==V.oi.IPV6&&(d===z.f.IP&&c===V.qv.IID&&I("destination_matching_target_type",V.qv.SPECIFIC),r===W.y.IP&&o===V.qv.IID&&I("source_matching_target_type",V.qv.SPECIFIC))},[d,c,r,o,I]);return n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(He.A,{label:n.createElement(A.sA,{id:"COMMON_IP_VERSION"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_IP_VERSION_DESCRIPTION"})}),n.createElement(f.A,{gap:h.Ln,paddingTop:h.YC,paddingBottom:h.YC,flexWrap:"wrap",rowGap:h.YC},u.map(e=>n.createElement(b.A,{description:e.disabled?e.tooltipDescription:void 0,portal:!0,key:e.value},n.createElement(j.A,{type:"radio",name:"ip_version",value:e.value,disabled:e.disabled,onChange:()=>O(e.value)},n.createElement(f.A,{alignItems:"center",gap:h.kc},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:e.label})),e.invalidProtocolWarning))))))};var Ze=a(305721),Xe=a(915752),Je=a(854318);const Qe=({disabled:e})=>{const{formatMessage:t}=(0,A.tz)(),{values:{destination_zone_id:a,destination_vpn_site_to_site_id:r}}=(0,l.j7)(),o=(0,i.useSelector)(S.Cw),_=(0,i.useSelector)(S.Av),s=(0,n.useMemo)(()=>o.find(({_id:e})=>e===a),[o,a]),d=(0,n.useMemo)(()=>_.filter(e=>e._id===r||s&&(0,g.c8)(e,s)&&(0,Ce.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Ne.qY)(e.sdwan_hub_spoke_local_wan_id,t):e.ip})),[_,r,s,t]);return n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(j.A,{disabled:e,name:"destination_vpn_site_to_site_id",validated:!0,options:d,type:"dropdown",full:!0,variant:"secondary"}))},et={[z.f.ANY]:"COMMON_ANY",[z.f.NETWORK]:"COMMON_NETWORK",[z.f.VPN_SERVER]:"COMMON_SERVER",[z.f.VPN_SITE_TO_SITE]:"SETTINGS_NETWORKS_FORM_FIELD_VPN_TYPE_SITE_TO_SITE",[z.f.IP]:"COMMON_IP",[z.f.APP]:"COMMON_APP",[z.f.REGION]:"COMMON_REGION",[z.f.WEB]:"COMMON_DOMAIN",[z.f.APP_CATEGORY]:"COMMON_CATEGORY",[z.f.VPN_USER]:"COMMON_USER"},tt=[z.f.ANY,z.f.IP],at=[z.f.ANY,z.f.APP,z.f.IP,z.f.WEB,z.f.REGION],it=[z.f.ANY,z.f.VPN_SERVER,z.f.VPN_SITE_TO_SITE,z.f.IP],nt=[z.f.ANY,z.f.NETWORK,z.f.IP],lt=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,i.useSelector)(S.Cw),r=(0,i.useSelector)(S.Av),o=(0,n.useMemo)(()=>a.find(e=>e._id===t.destination_zone_id),[t.destination_zone_id,a]),_=(0,n.useMemo)(()=>o?o.zone_key===O.o.GATEWAY?tt:o.zone_key===O.o.EXTERNAL?at:o.zone_key===O.o.VPN?it:nt:[z.f.ANY],[o]);return n.createElement(Ee.A,null,_.map(t=>{const a=t===z.f.NETWORK&&o&&!r.some(e=>(0,g.c8)(e,o)),i=t===z.f.VPN_SERVER&&o&&!r.some(e=>(0,g.c8)(e,o)&&!(0,Ce.u0)(e)),l=t===z.f.VPN_SITE_TO_SITE&&o&&!r.some(e=>(0,g.c8)(e,o)&&(0,Ce.u0)(e));let _;return a||l||i?_=n.createElement(A.sA,{id:"SETTINGS_SECURITY_NO_NETWORKS_FOR_ZONE_TOOLTIP"}):t===z.f.NETWORK?_=n.createElement(A.sA,{id:"SETTINGS_SECURITY_DESTINATION_NETWORK_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}):t===z.f.IP&&(_=n.createElement(A.sA,{id:"SETTINGS_SECURITY_DESTINATION_IP_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})),n.createElement(b.A,{key:`destination_matching_target_${t}`,portal:!0,description:_},n.createElement(j.A,{type:"radio",name:"destination_matching_target",value:t,disabled:e||a||i||l},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:et[t]}))))}))},rt=({disabled:e,name:t})=>{const{formatMessage:a}=(0,A.tz)(),{values:r}=(0,l.j7)(),o=(0,i.useSelector)(S.Cw),_=(0,i.useSelector)(S.Av),s=o.find(({_id:e})=>e===r.destination_zone_id),d=(0,l.O6)(r,t),c=(0,n.useMemo)(()=>_.filter(e=>d.includes(e._id)||s&&(0,g.c8)(e,s)&&!(0,Ce.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Ne.qY)(e.sdwan_hub_spoke_local_wan_id,a):e.ip})),[_,d,s,a]);return n.createElement(j.A,{disabled:e,name:t,options:c,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0})},ot=({disabled:e})=>n.createElement(f.A,{gap:h.Ln,height:K.b,alignItems:"center"},n.createElement(j.A,{type:"radio",name:"destination_app_type",value:z.f.APP,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_SPECIFIC"}))),n.createElement(j.A,{type:"radio",name:"destination_app_type",value:z.f.APP_CATEGORY,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_CATEGORY"})))),_t=({disabled:e})=>{const t=(0,i.useSelector)(S.Cw),a=(0,i.useSelector)(ne.YX),r=(0,i.useSelector)(S.Av),o=(0,i.useSelector)(N.xK),_=(0,i.useSelector)(ie.Uv),{formatMessage:s}=(0,A.tz)(),{values:{ip_version:d,destination_matching_target:c,destination_matching_target_type:E,destination_port_matching_type:m,destination_app_type:I,destination_zone_id:T},setFieldValue:u}=(0,l.j7)(),p=(0,n.useMemo)(()=>t.map(({_id:e,name:t,zone_key:a})=>({label:a?s({id:J.F[a]}):t,value:e,labelClassName:X.F})),[t,s]),C=(0,n.useMemo)(()=>(0,g.SH)(_,r),[_,r]),R=(0,n.useMemo)(()=>t.find(e=>e._id===T),[T,t]);return n.createElement(n.Fragment,null,n.createElement(f.A,{flexDirection:"column",gap:h.kc,width:"100%"},n.createElement(oe,{disabled:e,fieldName:"destination_zone_id",options:p,onFieldChange:()=>{u("destination_matching_target",o.destination.matching_target),u("destination_matching_target_type",o.destination.matching_target_type),u("destination_network_ids",[])}}),n.createElement(lt,{disabled:e}),R?.zone_key===O.o.VPN&&c!==z.f.VPN_SERVER&&a?n.createElement(Oe,null):null,c===z.f.APP?n.createElement(n.Fragment,null,n.createElement(ot,{disabled:e}),I===z.f.APP?n.createElement(Ze.A,{fieldName:"destination_app_ids"}):n.createElement(Xe.A,{fieldName:"destination_app_category_ids"})):null,c===z.f.VPN_USER?n.createElement(j.A,{disabled:e,name:"destination_wireguard_user_ids",options:C,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,c===z.f.NETWORK?n.createElement(rt,{disabled:e,name:"destination_network_ids"}):null,c===z.f.VPN_SERVER?n.createElement(rt,{disabled:e,name:"destination_vpn_server_ids"}):null,c===z.f.VPN_SITE_TO_SITE?n.createElement(Qe,{disabled:e}):null,[z.f.NETWORK,z.f.VPN_SERVER].includes(c)?n.createElement(Se,{disabled:e,name:"destination_match_opposite_networks",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_NETWORKS_DESCRIPTION"}):null,c===z.f.IP?n.createElement(n.Fragment,null,n.createElement(me,{disabled:e,fieldName:"destination_matching_target_type"}),E===V.qv.SPECIFIC?n.createElement(ae.A,{disabled:e,fieldName:"destination_ips",labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:s({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>s({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),validate:e=>(0,g.GH)(d,e,!0)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:d}}}):null,E===V.qv.OBJECT?n.createElement(te.A,{disabled:e,name:"destination_ip_group_id",types:pe.$d,getDisabledReason:(0,g.Xe)(d)}):null,E===V.qv.IID?n.createElement(n.Fragment,null,n.createElement(Ae.A,{disabled:e,name:"destination_iid"}),n.createElement(Se,{disabled:e,name:"destination_match_opposite_iid",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):n.createElement(Se,{disabled:e,name:"destination_match_opposite_ips",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):null,c===z.f.REGION?n.createElement(j.A,{type:"picklist",name:"destination_regions",options:Q.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:Q.xn}):null,c===z.f.WEB?n.createElement(ae.A,{disabled:e,fieldName:"destination_web_domains",labels:{fieldLabel:"COMMON_DOMAIN",modalTitle:"SETTINGS_ADD_MULTIPLE_DOMAINS",modalFieldPlaceholder:s({id:"SETTINGS_ADD_MULTIPLE_DOMAINS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>s({id:"SETTINGS_SECURITY_DOMAINS_VALIDATION"}),validate:e=>!!e?.match(re.yA)||(e?.startsWith(Je.n4)?n.createElement(A.sA,{id:"SETTINGS_SECURITY_DOMAINS_WILDCARD_VALIDATION"}):n.createElement(A.sA,{id:"COMMON_DOMAIN_VALIDATION"}))},extraFieldConfig:{placeholder:"SETTINGS_SECURITY_DOMAINS_PLACEHOLDER"}}):null,c!==z.f.APP?n.createElement(n.Fragment,null,n.createElement(de,{disabled:e,fieldName:"destination_port_matching_type",radioOptions:pe.o5}),m===V.rl.SPECIFIC?n.createElement(ee.A,{customPortFieldName:"destination_port",serviceFieldName:"destination_port_service"}):null,m===V.rl.OBJECT?n.createElement(te.A,{disabled:e,name:"destination_port_group_id",types:[le.B.PORT_GROUP]}):null,m!==V.rl.ANY?n.createElement(Se,{disabled:e,name:"destination_match_opposite_ports",labelId:"SETTINGS_MATCH_OPPOSITE_PORT",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_PORTS_DESCRIPTION"}):null):null))};const st=a(132196).AH`
  flex-direction: column;
  > span {
    position: static;
    transform: none;
  }
`,dt=({disabled:e})=>n.createElement(j.A,{type:"textarea",name:"description",variant:"secondary",disabled:e,resize:!1,className:st,rows:3,full:!0,label:n.createElement(He.A,{label:n.createElement(A.sA,{id:"COMMON_DESCRIPTION"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_FIREWALL_DESCRIPTION"})})});var ct=a(86838),Et=a(79760),mt=a(418543);const At=[V.KN.NEW,V.KN.INVALID,V.KN.ESTABLISHED,V.KN.RELATED],It=({disabled:e})=>{const{values:{connection_state_type:t,connection_states:a},setFieldValue:i,errors:r,touched:o,submitCount:_}=(0,l.j7)(),s=(0,n.useCallback)(({currentTarget:{id:e,checked:t}})=>{i("connection_states",t?[...a,e]:a.filter(t=>t!==e))},[a,i]),d=(0,Et.t$)("connection_states",r,o,_);return n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(He.A,{label:n.createElement(A.sA,{id:"COMMON_CONNECTION_STATE"}),tooltipProps:{isInteractive:!0},tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_CONNECTION_STATE_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})}),n.createElement(f.A,{flexDirection:"column"},n.createElement(f.A,{gap:h.Ln,rowGap:h.YC,paddingTop:h.YC,paddingBottom:h.YC,minHeight:K.b,alignItems:"center",flexWrap:"wrap"},n.createElement(j.A,{type:"radio",name:"connection_state_type",value:V.kU.ALL,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:mt.ER[V.kU.ALL]}))),n.createElement(j.A,{type:"radio",name:"connection_state_type",value:V.kU.RESPOND_ONLY,disabled:e},n.createElement(f.A,{alignItems:"center",gap:h.YC},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:mt.ER[V.kU.RESPOND_ONLY]})),n.createElement(b.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_RETURN_TRAFFIC_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),portal:!0,isInteractive:!0,style:{display:"flex",alignItems:"center"}},n.createElement(se.A,{size:"original",isActive:!0})))),n.createElement(j.A,{type:"radio",name:"connection_state_type",value:V.kU.CUSTOM,disabled:e},n.createElement(_e.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:mt.ER[V.kU.CUSTOM]})))),t===V.kU.CUSTOM?n.createElement(f.A,{flexDirection:"column",width:"100%"},n.createElement(f.A,{gap:h.Ln,rowGap:h.YC,paddingTop:h.YC,paddingBottom:h.YC,minHeight:K.b,alignItems:"center",flexWrap:"wrap"},At.map(e=>n.createElement(j.A,{key:e,name:e,type:"realCheckbox",checked:a.includes(e),onChange:s},n.createElement(A.sA,{id:mt.VE[e]})))),d?n.createElement(ct.A,{style:{padding:0},isInvalid:!0,label:d}):null):null))},Tt=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,i.useSelector)(S.Cw),r=!(0,g.oS)(t,a),o=a.find(e=>e._id===t.destination_zone_id);return n.createElement(f.A,{flexDirection:"column",width:"100%",gap:h.kc},n.createElement(f.A,{flexDirection:"row",gap:h.Ln,minHeight:K.b,alignItems:"center"},n.createElement(j.A,{type:"radio",name:"action",value:V.Dl.BLOCK,disabled:e},n.createElement(A.sA,{id:"COMMON_ACTION_BLOCK"})),n.createElement(j.A,{type:"radio",name:"action",value:V.Dl.ALLOW,disabled:e},n.createElement(A.sA,{id:"COMMON_ACTION_ALLOW"})),n.createElement(f.A,{alignItems:"center",gap:h.YC},n.createElement(j.A,{type:"radio",name:"action",value:V.Dl.REJECT,disabled:e},n.createElement(A.sA,{id:"SETTINGS_SECURITY_REJECT"})),n.createElement(b.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_FIREWALL_REJECT_DESCRIPTION"}),portal:!0,style:{display:"flex",alignItems:"center"}},n.createElement(se.A,{size:"original",isActive:!0})))),t.action===V.Dl.ALLOW?n.createElement(f.A,{minHeight:K.b,alignItems:"center",gap:h.YC},n.createElement(b.A,{description:r?n.createElement(A.sA,{id:o?.zone_key===O.o.EXTERNAL?"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED_EXTERNAL":o?.zone_key===O.o.GATEWAY?"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED_GATEWAY":"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED",values:{link:n.createElement(v.A,{id:"COMMON_LEARN_MORE",noWrap:!0,href:Y.A.firewallPolicies})}}):null,isInteractive:!0,portal:!0},n.createElement(j.A,{type:"realCheckbox",name:"create_allow_respond",disabled:r,checked:!r&&void 0},n.createElement(A.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC"}))),n.createElement(b.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0},n.createElement(se.A,{size:"original",isActive:!0}))):null)};var ut=a(329109),Ot=a(734707);const St=({id:e,disabled:t})=>{const a=(0,i.useDispatch)();return n.createElement(Ot.Ay,{disabled:t,type:"button",variant:"link",size:"medium",onClick:async()=>{await a((0,C.Ad)([{_id:e,enabled:!0}])),a((0,C.fn)())}},n.createElement(A.sA,{id:"COMMON_ACTION_RESUME"}))},pt=({name:e,id:t})=>{const a=(0,i.useDispatch)(),[l,r]=(0,n.useState)(!1);return n.createElement(U.A,{isOpen:l,title:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_TITLE",titleValues:{count:1},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",body:n.createElement(A.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:e}}),handleCancel:()=>r(!1),handleConfirm:async()=>{await a((0,C.Ee)([t])),a((0,C.fn)()),a((0,p.WO)()),r(!1),a((0,E.K5)())},handleClose:()=>r(!1),rootClose:!0},n.createElement(Ot.Ay,{type:"button",variant:"link",size:"medium",onClick:()=>r(!0)},n.createElement(_e.A,{variant:"inherit",color:"destructive"},n.createElement(A.sA,{id:"COMMON_ACTION_REMOVE"}))))},Nt=({name:e,id:t})=>{const a=(0,i.useDispatch)(),[l,r]=(0,n.useState)(!1);return n.createElement(U.A,{isOpen:l,title:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_TITLE",titleValues:{count:1},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",body:n.createElement(A.sA,{id:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_MESSAGE_SINGLE",values:{name:e}}),handleCancel:()=>{r(!1)},handleConfirm:async()=>{await a((0,C.Ad)([{_id:t,enabled:!1}])),a((0,C.fn)()),r(!1)},handleClose:()=>{r(!1)},rootClose:!0},n.createElement(Ot.Ay,{type:"button",variant:"link",onClick:()=>r(!0)},n.createElement(A.sA,{id:"COMMON_ACTION_PAUSE"})))},Ct="firewallPolicyForm",Rt=({disabled:e,existingRecord:t,typeSelector:a})=>{const{resetForm:r,handleSubmit:o,dirty:_,isSubmitting:s,submitForm:d,values:c,isValid:E}=(0,l.j7)(),m=!(!(0,i.useSelector)(G.kD)||!(0,D.B)(c.destination_matching_target)),{sharedName:I}=(0,P.H5)();return n.createElement("form",{onSubmit:o,style:{height:"100%"},id:Ct},n.createElement(f.A,{flexDirection:"column",gap:h.xO,width:"100%",overflow:"hidden"},n.createElement(L.A,null,a,n.createElement(Ke,{disabled:e})),n.createElement(L.A,{title:n.createElement(A.sA,{id:"COMMON_SOURCE_ZONE"}),tooltipProps:{isInteractive:!0},tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_SOURCE_ZONE_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})},n.createElement(We,{disabled:e})),n.createElement(L.A,{title:n.createElement(A.sA,{id:"COMMON_ACTION"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_FIREWALL_ACTION_DESCRIPTION"})},n.createElement(Tt,{disabled:e})),n.createElement(L.A,{title:n.createElement(A.sA,{id:"COMMON_DESTINATION_ZONE"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_DESTINATION_ZONE_DESCRIPTION",values:{link:n.createElement(v.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),tooltipProps:{isInteractive:!0}},n.createElement(_t,{disabled:e})),n.createElement(L.A,null,n.createElement($e,{disabled:e}),n.createElement(Be,{disabled:e}),n.createElement(It,{disabled:e}),n.createElement(je,{disabled:e}),n.createElement($,{disabled:e}),n.createElement(F.A,{disabled:e}),n.createElement(dt,{disabled:e})),!e&&t?n.createElement(y.A,{type:y.I.BUTTON_LIST},!t.enabled||m?n.createElement(w.R,null,n.createElement(b.A,{portal:!0,description:m?n.createElement(A.sA,{id:"SETTINGS_APP_BLOCKING_IDENTIFICATION_DISABLED_ROW_DESCRIPTION"}):null},n.createElement(St,{id:t._id,disabled:m}))):n.createElement(w.R,null,n.createElement(Nt,{name:t.name,id:t._id})),n.createElement(w.R,null,n.createElement(pt,{name:t.name,id:t._id}))):null),n.createElement(ut.A,{onFormCancel:r,allowCancel:_,applyButton:n.createElement(x,{isDisabled:e,isExistingRecord:!!t,isLoading:s,submitForm:d,values:c,form:Ct},n.createElement(A.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})),isDirty:_||Boolean(I),isSubmitting:s,isInvalid:!E}))},Mt=({activeItem:e,typeSelector:t})=>{const a=e?._id===M.R6?void 0:e,{formatMessage:b}=(0,A.tz)(),h=(0,i.useDispatch)(),L=(0,i.useSelector)(u.EL),v=(0,i.useSelector)(S.Cw),f=(0,i.useSelector)(T.Ct),y=(0,i.useSelector)(N.xK),D=(0,d.A)(R.Xj.FIREWALL_SCHEDULING_AFTER_2038),{sharedName:G}=(0,P.H5)(),Y=(0,n.useMemo)(()=>a?.source?.zone_id||e?.source?.zone_id||v.find(e=>e.zone_key===O.o.INTERNAL)?._id||"",[e?.source?.zone_id,a?.source?.zone_id,v]),w=(0,n.useMemo)(()=>a?.destination?.zone_id||e?.destination?.zone_id||v.find(e=>e.zone_key===O.o.EXTERNAL)?._id||"",[e?.destination?.zone_id,a?.destination?.zone_id,v]),F=(0,n.useMemo)(()=>new Date,[]),U=(0,n.useMemo)(()=>(0,g.xE)(y,Y,w,a,v,f,F,G),[y,Y,w,a,v,f,F,G]),k=(0,n.useMemo)(()=>(0,g.tH)(v,b,D),[b,v,D]),V=(0,n.useCallback)((e,{setSubmitting:t,resetForm:i})=>(t(!0),h((0,C.Vh)((0,g.GJ)(a,e,v),void 0,{fetchConfig:{getAllPostData:!0}})).then(async e=>(await h((0,C.fn)(void 0,{resolveWithExisting:!1})),e)).then(t=>{h((0,E.SQ)(!1)),h((0,E.XP)({type:c.H.CUSTOM_FIREWALL_POLICY,id:t._id})),h((0,p.WO)()),i({values:e})}).catch(e=>{const t=(0,_.F)(e)?e:void 0;h((0,m.ox)({icon:o.C.danger,message:"SETTINGS_UNABLE_TO_APPLY_CHANGES",errorMessage:t?.msg}))}).finally(()=>t(!1))),[h,a,v]);return(0,n.useEffect)(()=>{a?._id&&a?._id!==M.R6&&h((0,C.L9)(a?._id))},[h,a?._id]),(0,n.useEffect)(()=>{h((0,I.mW)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[h]),n.createElement(l.l1,{initialValues:U,onSubmit:V,validationSchema:k},n.createElement(n.Fragment,null,n.createElement(s.A,null),n.createElement(Rt,{existingRecord:a,disabled:L,typeSelector:t})))}}}]);