"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[40947],{756093(e,t,n){var r;n.d(t,{d:()=>r}),function(e){e.DOMAIN="DOMAIN",e.INTERNET="INTERNET",e.IP="IP",e.REGION="REGION"}(r||(r={}))},430329(e,t,n){n.d(t,{DP:()=>o,XD:()=>a,kY:()=>l,mH:()=>_,vt:()=>A});var r=n(959207),i=n(233187),s=n(348466);const l=(e,t)=>!(!(0,r.jp)(e)&&(!t.isOpenVpnTrafficRoutesSupported||!(0,r.MY)(e))&&(!t.isSiteToSiteOpenVpnTrafficRoutesSupported||!(0,r.qf)(e))&&(!t.isSiteToSiteWireguardTrafficRoutesSupported||!(0,r.$p)(e))&&!(t.isSiteToSiteIpsecTrafficRoutesSupported&&(0,r.Mc)(e)&&e.ipsec_dynamic_routing&&e.ipsec_tunnel_ip_enabled)&&(!(0,r.ok)(e)||!(0,r.o1)(e)||(0,r.sp)(e))),a=(e,t)=>t.isSiteToSiteIpsecTrafficRoutesSupported&&(0,r.Mc)(e)&&e.ipsec_dynamic_routing&&!e.ipsec_tunnel_ip_enabled?"SETTINGS_TRAFFIC_ROUTES_INTERFACE_DISABLED_TUNNEL_IP":t.isSiteToSiteIpsecTrafficRoutesSupported&&(0,r.Mc)(e)&&!e.ipsec_dynamic_routing?"SETTINGS_TRAFFIC_ROUTES_INTERFACE_DISABLED_POLICY_BASED":e.routing_table_id||(0,r.JJ)(t.networks).size?null:"SETTINGS_ROUTING_TABLES_EXCEEDED_POLICY_BASED_ROUTES",_=e=>(0,r.ok)(e)&&(0,r.o1)(e)&&e.purpose!==i.rR.VLAN_ONLY,o=e=>{const[t,n=""]=e.split(s.oH),r=n.split(s.KE).filter(Boolean),i=r.filter(e=>!e.includes(s.jr)),l=r.filter(e=>e.includes(s.jr));return{domain:t,ports:i.map(Number),port_ranges:l.map(e=>{const[t,n]=e.split(s.jr).map(Number);return{port_start:t,port_stop:n}})}},A=e=>{const t=e.port_ranges.map(({port_start:e,port_stop:t})=>`${e}${s.jr}${t}`),n=[...e.ports,...t].join(s.KE);return[e.domain,n].filter(Boolean).join(s.oH)}},837867(e,t,n){n.d(t,{A:()=>O});var r=n(296540),i=n(469733),s=n(951272),l=n(588915),a=n(23835),_=n(86838),o=n(725508),A=n(71479),E=n(742920),d=n(566723),c=n(705426),p=n(294303),I=n(675359),m=n(916537);const T=(0,A.A)(p.A)`
  padding: ${d.fS} 0;
  margin: 0 ${d.kc};

  textarea {
    line-height: 20px;
    padding: 10px ${d.Ln} 18px ${d.Ln};
    resize: none;
  }
`,R=(0,A.A)(l.A)`
  margin-top: ${d.S2};
  svg {
    margin-right: 6px;
  }
`,S=(0,A.A)(c.A)`
  width: 431px;
  header {
    height: ${d.nf};
    align-items: center;
    display: flex;

    > div {
      font-size: 16px;
      line-height: 20px;
    }
  }
  footer {
    padding: ${d.fS} ${d.Yc};
    button {
      height: ${d.fS};
    }
    > div {
      div:last-child button {
        width: 137px;
      }
    }
  }
`,N=({onClose:e,title:t,placeholder:n})=>{const{formatMessage:l}=(0,m.tz)(),A=(0,i.useDispatch)(),{values:d,errors:c,setFieldValue:p,submitCount:N,handleSubmit:u}=(0,s.j7)(),O=(0,r.useMemo)(()=>[{text:r.createElement(m.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",variant:"default",onClick:e},{text:r.createElement(m.sA,{id:"COMMON_ACTION_ADD"}),type:"button",variant:"primary",onClick:()=>u()}],[e,u]);return r.createElement(S,{size:"small",isOpen:!0,title:r.createElement(m.sA,{id:t}),actions:O},r.createElement(T,{flexDirection:"column"},r.createElement(a.A,{rows:7,name:"text",value:d.text,onChange:(e,t)=>p("text",t),placeholder:n&&l({id:n}),full:!0}),c?.text&&N>0?r.createElement(_.A,{isInvalid:!0,label:c?.text}):null,r.createElement(R,{accept:"text/plain",variant:"inline",Icon:o.A,onChange:async(e,t)=>{const n=await((e,t)=>new Promise((n,r)=>{const i=new FileReader;i.onerror=function(){r(),t((0,I.ox)({icon:E.C.warning,message:"COMMON_NOTICE_UPLOAD_ERROR"}))},i.onload=function(){n(i.result)},i.readAsText(e)}))(!!t&&"current"in t&&t.current?.files?.[0],A);p("text",n)}},r.createElement(m.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_BATCH_ADD_MODAL_IMPORT_BUTTON"}))))},u={text:""},O=({onClose:e,onSubmit:t,validationSchema:n,title:i,placeholder:l})=>{const a=(0,r.useCallback)(n=>{t(n.text),e()},[e,t]);return r.createElement(s.l1,{enableReinitialize:!0,initialValues:u,validationSchema:n,onSubmit:a},r.createElement(N,{onClose:e,title:i,placeholder:l}))}},65755(e,t,n){n.d(t,{f:()=>f,A:()=>F});var r,i=n(296540),s=n(951272),l=n(54227),a=n(758649),_=n(383653),o=n(79760),A=n(870443),E=n(573531),d=n(566723),c=n(553432),p=n(242366),I=n(294303),m=n(657781),T=n(916537),R=n(369596),S=n(837867),N=n(620637),u=n(68783),O=n(149133),M=n(901371),C=n(546391);!function(e){e.SINGLE="single",e.RANGE="range"}(r||(r={}));const h=(0,M.jp)(!1),g=e=>e?.split(C.Mi)?.map(e=>e.trim()).filter(Boolean).map(e=>(e=>{let t,n=e;return e.includes("[")&&e.includes("]")&&(n=e.split("]")[0].replace("[",""),[,t]=e.split("]")),(0,u.or)([C.zF,C.wK]).test(e.split(":")[0])&&([n,t]=e.split(":")),{ip:n,port:t||""}})(e)),b=()=>A.A.string().label("COMMON_IP_ADDRESS").test("isValidIpOrSubnet",i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_IP"}),e=>!e||[N.isValidIpv4,O.N7,(0,_.es)()].some(t=>t(e))).test("isValidSubnetV4",i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_IP_SUBNET_FORMAT"}),e=>!e||!C.wK.test(e)||(0,O.nX)(e)===e).test("isValidSubnetV6",i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_IPV6_SUBNET_FORMAT"}),e=>!e||!C.QD.test(e)||(0,_.dS)(e)).test("isNotIpv4MappedIpv6Address",i.createElement(T.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>!(0,_.m0)(e)).test("isNotIPv6MulticastAddress",i.createElement(T.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>!(0,_.aN)(e)),D=()=>A.A.string().label("COMMON_IP_ADDRESS").test("isValidIp",i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_IP"}),e=>!e||[N.isValidIpv4,N.isValidIpv6].some(t=>t(e))).test("isNotIpv4MappedIpv6Address",i.createElement(T.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>!(0,_.m0)(e)).test("isNotIPv6MulticastAddress",i.createElement(T.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>!(0,_.aN)(e)),P=[{id:"id",label:i.createElement(T.sA,{id:"COMMON_IP_ADDRESS"}),sortable:!1,renderCell:e=>(0,m.ef)(e),minWidth:160},{id:"all_ports",label:i.createElement(T.sA,{id:"COMMON_PORT"}),sortable:!1,renderCell:e=>e.type===r.SINGLE&&(0,m.J)(e)||E.L,minWidth:120}],G=[{id:r.SINGLE,label:i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_IP_TAB"})},{id:r.RANGE,label:i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_IP_RANGE_TAB"})}],L=[{id:"first",getFieldType:()=>"text",getFieldName:e=>e.type===r.SINGLE?"ip_or_subnet":"ip_start",getFieldLabel:e=>e.type===r.SINGLE?"COMMON_IP_ADDRESS":"COMMON_START"},{id:"second",getFieldType:()=>"text",getFieldName:e=>e.type===r.SINGLE?"all_ports":"ip_stop",getFieldLabel:e=>e.type===r.SINGLE?"COMMON_PORT":"COMMON_STOP"}],f=({value:e,onChange:t,invalid:n})=>{const[s,o]=(0,i.useState)(r.SINGLE),[E,u]=(0,i.useState)(!1),M=(0,i.useMemo)(()=>({editActive:!1,combinedIpAddresses:e.map(e=>"ip_or_subnet"in e?{...e,id:(0,m.rK)(e),type:r.SINGLE,all_ports:(0,m.J)(e)}:{...e,id:(0,m.rK)(e),type:r.RANGE,all_ports:""}),new_ip_or_subnet_address:"",new_ports:"",new_ip_or_subnet_address_start:"",new_ip_or_subnet_address_stop:""}),[e]),C=(0,i.useMemo)(()=>s===r.SINGLE?[{name:"new_ip_or_subnet_address",label:"COMMON_IP_ADDRESS",inline:!0},{name:"new_ports",label:"COMMON_PORT",inline:!0,hideMainFormInvalidState:!0}]:[{name:"new_ip_or_subnet_address_start",label:"COMMON_START",placeholder:"COMMON_IP_ADDRESS",inline:!0},{name:"new_ip_or_subnet_address_stop",label:"COMMON_STOP",placeholder:"COMMON_IP_ADDRESS",inline:!0}],[s]),f=(0,i.useCallback)(e=>t(e),[t]),F=(0,i.useCallback)(t=>{const{new_ip_or_subnet_address:n,new_ports:i,new_ip_or_subnet_address_start:l,new_ip_or_subnet_address_stop:a}=t;if(s===r.SINGLE){const t=i.split(",").filter(Boolean),r=t.filter(e=>!e.includes("-")),s=t.filter(e=>e.includes("-"));f([...e,{ip_or_subnet:n,ports:r.length?r.map(Number):[],port_ranges:s.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])})),ip_version:[(0,_.wt)(),(0,_.vS)()].some(e=>e(n))?"v6":"v4"}])}else f([...e,{ip_start:l,ip_stop:a,ip_version:[(0,_.wt)(),(0,_.vS)()].some(e=>e(l))?"v6":"v4"}])},[s,e,f]),v=(0,i.useCallback)(e=>{f(e.map(e=>{if(e.type===r.SINGLE){const t=e.all_ports?.split(",").filter(Boolean),n=t?.filter(e=>!e.includes("-"))||[],r=t?.filter(e=>e.includes("-"))||[];return{ip_or_subnet:e.ip_or_subnet,ports:n.length?n.map(Number):[],port_ranges:r.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])})),ip_version:e.ip_version}}return{ip_start:e.ip_start,ip_stop:e.ip_stop,ip_version:e.ip_version}}))},[f]),U=(0,i.useCallback)(({id:t})=>f(e.filter(e=>(0,m.rK)(e)!==t)),[f,e]);return i.createElement(p.A,null,E?i.createElement(S.A,{onClose:()=>u(!1),onSubmit:n=>{const r=g(n);t([...e,...r.map(e=>{const t=e.port?.split(",").filter(Boolean)||[],n=t.filter(e=>!e.includes("-")),r=t.filter(e=>e.includes("-"));return{ip_or_subnet:e.ip,ports:n.map(Number),port_ranges:r.map(e=>({port_start:Number(e.split("-")[0]),port_stop:Number(e.split("-")[1])}))}})])},validationSchema:(w=e.map(e=>"ip_or_subnet"in e?e.ip_or_subnet:""),A.A.object().shape({text:A.A.string().label("SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_BATCH_ADD_MODAL_THIS_FIELD").required().test("isValidIpv6-NotIpv4Mapped",i.createElement(T.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID"}),e=>{if(!e)return!0;const t=g(e).filter(e=>(0,_.es)()(e.ip));return t?.every(e=>(0,_.es)({excludeIpv4Mapped:!0})(e.ip))}).test("isValidIpv6-NotMulticast",i.createElement(T.sA,{id:"SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID"}),e=>{if(!e)return!0;const t=g(e).filter(e=>(0,_.es)()(e.ip));return t?.every(e=>(0,_.es)({excludeMulticast:!0})(e.ip))}).test("isValidList",i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}),e=>{if(!e)return!0;const t=g(e);return t?.every(e=>(!e.port||h(e.port))&&[N.isValidIpv4,O.N7,(0,_.es)()].some(t=>t(e.ip)))}).test("hasDuplicates",i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_UNIQUE_ERROR"}),e=>{if(!e)return!0;const t=g(e),n=[...w,...(t||[])?.map(e=>e.ip)||[]];return n.length===new Set(n).size}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"}))})),title:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_BATCH_ADD_MODAL_HEADER",placeholder:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_BATCH_ADD_MODAL_PLACEHOLDER"}):null,i.createElement(c.A,null,G.map(({id:e,label:t})=>i.createElement(l.A,{key:e,id:e,onChange:()=>o(e),checked:s===e},t))),i.createElement(I.A,{width:"100%",flexDirection:"column",gap:d.YC},i.createElement(R.A,{fieldName:"combinedIpAddresses",columns:P,newFields:C,onAddItem:F,onRemoveItem:U,onEditSubmit:v,initialValues:M,invalid:n,validationSchema:A.A.lazy(e=>((e,t)=>{const n={arrayFieldName:"combinedIpAddresses",stringFieldName:"ip_or_subnet",errorMessage:i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_UNIQUE_ERROR"})};return A.A.object().shape({...t===r.RANGE?{new_ip_or_subnet_address_start:e.editActive?A.A.string():D().isIPUnique({formValues:null,...n}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required(),new_ip_or_subnet_address_stop:e.editActive?A.A.string():D().isIPUnique({formValues:null,...n}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).test("isGreaterThanStart",i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_STOP_AFTER_START"}),t=>!t||!e.new_ip_or_subnet_address_start||((0,N.isValidIpv4)(t)&&(0,N.isValidIpv4)(e.new_ip_or_subnet_address_start)?(0,O.GQ)(t)>(0,O.GQ)(e.new_ip_or_subnet_address_start):!(0,N.isValidIpv6)(t)||!(0,N.isValidIpv6)(e.new_ip_or_subnet_address_start)||(0,_.zt)(e.new_ip_or_subnet_address_start,t))).required()}:{new_ip_or_subnet_address:e.editActive?A.A.string():b().isIPUnique({formValues:null,...n}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required(),new_ports:e.editActive?A.A.string():A.A.string().label("COMMON_PORT").unifiPortRange(i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}))},combinedIpAddresses:A.A.array().of(A.A.object().shape({type:A.A.string().oneOf([r.SINGLE,r.RANGE]),ip_or_subnet:A.A.string().when("type",{is:r.SINGLE,then:b().isIPUnique({formValues:null,...n}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()}),all_ports:A.A.string().when("type",{is:r.SINGLE,then:A.A.string().label("COMMON_PORT").unifiPortRange(i.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_PORT_RANGE"}))}),ip_start:A.A.string().when("type",{is:r.RANGE,then:D().isIPUnique({formValues:null,...n}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()}),ip_stop:A.A.string().when("type",{is:r.RANGE,then:D().isIPUnique({formValues:null,...n}).isNotWildcardIP(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).isNotPrefixLengthZero(i.createElement(T.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_IP_ADDRESS_COMMON_ERROR"})).required()})})),editActive:A.A.bool()})})(e,s)),editColumns:L,isWindowTable:!0}),s===r.SINGLE?i.createElement(I.A,null,i.createElement(a.A,{type:"button",variant:"inline",size:"medium",onClick:()=>u(!0)},i.createElement(T.sA,{id:"COMMON_ADD_MULTIPLE"}))):null));var w},F=({name:e})=>{const{values:t,setFieldValue:n,errors:r,submitCount:l,touched:a}=(0,s.j7)();return i.createElement(f,{value:(0,s.O6)(t,e),onChange:t=>n(e,t),invalid:(0,o.t$)(e,r,a,l)})}},113658(e,t,n){n.d(t,{v:()=>_});var r=n(296540),i=n(271856),s=n(217439);const l={size:"inherit",color:"inherit"},a={portal:!0,maxWidth:"unset",width:"auto",style:{display:"flex",alignItems:"center"}},_=({text:e,textElement:t,textProps:n,tooltipProps:_,isTooltipDisabled:o=!1})=>{const A=t||r.createElement(s.A,{...l,...n},e);return o?A:r.createElement(i.A,{...a,description:e,..._},A)}},657781(e,t,n){n.d(t,{GJ:()=>g,J:()=>C,PI:()=>M,Q$:()=>O,ef:()=>h,rK:()=>b});var r=n(296540),i=n(217439),s=n(412933),l=n(948177),a=n(601242),_=n(411502),o=(n(28694),n(566723)),A=n(884740),E=n(916537),d=n(848576),c=n(814356),p=n(348466),I=n(455155),m=n(524803),T=n(269889),R=n(802123),S=n(294303),N=n(323030),u=n(212545);const O=(e=[],t=!1)=>(t?e.length===u._O.length:e.length===_.hS.length)?[s.n_]:e,M=e=>{const{domain:t,ports:n=[],port_ranges:r=[]}=e,i=[...n,...r.map(({port_start:e,port_stop:t})=>`${e}${p.jr}${t}`)].join(",");return i.length?`${t}:${i}`:t},C=e=>{const{ports:t=[],port_ranges:n=[]}=e;return[t.length>0?`${t.map((e,n)=>`${e}${n===t.length?",":""}`)}`:"",n.length>0?`${n.map((e,t)=>`${e.port_start}-${e.port_stop}${t===n.length?",":""}`)}`:""].filter(Boolean).join(",")},h=(e,t)=>e.ip_or_subnet?`${e.ip_or_subnet}${t&&C(e)?`:${C(e)}`:""}`:`${e.ip_start}-${e.ip_stop}`,g=({matching_target:e,app_ids:t=[],enabled:n,app_category_ids:s=[],domains:_=[],ip_addresses:p=[],ip_ranges:C=[],regions:g=[],network_ids:b=[]},D)=>{switch(e){case d.Kl.APP:if(t.length>1)return r.createElement(R.A,{enabled:n,label:r.createElement(E.sA,{id:"COMMON_APP_COUNT",values:{count:t.length}}),tooltipItems:(P=t.map(e=>(0,a.HH)(e)),P.sort(({name:e=""},{name:t=""})=>e.localeCompare(t))).filter(e=>e.name&&e.iconFileName).map(e=>r.createElement(i.A,{key:e.name,size:"inherit",color:"inherit"},r.createElement(S.A,{alignItems:"center",gap:o.kc},r.createElement(I.A,{iconFileName:e.iconFileName}),r.createElement("span",null,e.name)))),neverShowListMarkers:!0});if(1===t.length){const{name:e,iconFileName:i}=(0,a.HH)(t[0]);if(e&&i)return r.createElement(S.A,{alignItems:"center",gap:o.kc},r.createElement(I.A,{iconFileName:i}),r.createElement(T.A,{enabled:n,size:"medium"},e))}return r.createElement(T.A,{enabled:n},r.createElement(E.sA,{id:"COMMON_FALLBACK"}));case d.Kl.APP_CATEGORY:{const e=O(s,!0);if("string"==typeof e[0])return r.createElement(E.sA,{id:"SETTINGS_SECURITY_TRAFFIC_RULES_FORM_MATCHING_TARGET_APP_CATEGORY_OPTION_ALL"});const t=e.map(e=>r.createElement(E.sA,{key:e,id:u.QK[e]||u.QK[255]}));if(s.length>1)return r.createElement(R.A,{enabled:n,label:r.createElement(E.sA,{id:"COMMON_CATEGORY_COUNT",values:{count:s.length}}),tooltipItems:t});if(1===s.length){const e=r.createElement(E.sA,{id:u.QK[s[0]]||u.QK[255]});return(0,m.Po)(e,n,"pointer")}return r.createElement(T.A,{enabled:n},r.createElement(E.sA,{id:"COMMON_FALLBACK"}))}case d.Kl.DOMAIN:if(_.length>1){const e=_.map(e=>M(e));return r.createElement(R.A,{enabled:n,label:r.createElement(E.sA,{id:"COMMON_DOMAIN_COUNT",values:{count:_.length}}),tooltipItems:e})}return 1===_.length?(0,m.Po)(M(_[0]),n,"pointer"):r.createElement(T.A,{enabled:n},r.createElement(E.sA,{id:"COMMON_FALLBACK"}));case d.Kl.IP:{const e=[...p,...C];if(e.length>1){const t=e.map(e=>h(e,!0));return r.createElement(R.A,{enabled:n,label:r.createElement(E.sA,{id:"COMMON_IP_COUNT",values:{count:e.length}}),tooltipItems:t})}return 1===e.length?r.createElement(T.A,{size:"medium",enabled:n},h(e[0],!0)):r.createElement(T.A,{enabled:n},r.createElement(E.sA,{id:"COMMON_FALLBACK"}))}case d.Kl.REGION:if(g.length>1){const e=g.map(e=>r.createElement(S.A,{key:e,gap:o.kc,alignItems:"center"},r.createElement(N.A,{countryCode:e,width:16,height:16,style:{borderRadius:2,objectFit:"cover"}}),(0,c.qQ)(e.toUpperCase())));return r.createElement(R.A,{enabled:n,label:r.createElement(E.sA,{id:"COMMON_REGION_COUNT",values:{count:g.length}}),tooltipItems:e,neverShowListMarkers:!0})}if(1===g.length){const e=g[0];return(0,m.Po)(r.createElement(r.Fragment,null,r.createElement(N.A,{countryCode:e,width:16,height:16,style:{borderRadius:2,objectFit:"cover"}}),r.createElement("span",{style:{marginLeft:o.kc}},(0,c.qQ)(e.toUpperCase()))),n,"pointer")}return r.createElement(T.A,{enabled:n},r.createElement(E.sA,{id:"COMMON_FALLBACK"}));case d.Kl.INTERNET:return r.createElement(T.A,{size:"medium",enabled:n},r.createElement(E.sA,{id:"COMMON_ANY"}));case d.Kl.LOCAL_NETWORK:{const e=b.filter(e=>D.find(t=>t._id===e));if(e.length>1){const t=e.map(e=>{const t=D.find(t=>t._id===e);return r.createElement(S.A,{key:e,alignItems:"center",gap:o.kc},r.createElement(l.A,{size:"original"})," ",t?.name||e)});return r.createElement(R.A,{enabled:n,label:r.createElement(E.sA,{id:"COMMON_NETWORK_COUNT",values:{count:e.length}}),tooltipItems:t,neverShowListMarkers:!0})}if(1===e.length){const t=D.find(t=>t._id===e[0]);return(0,m.Po)(r.createElement(r.Fragment,null,r.createElement(l.A,{width:u.qj,height:u.qj}),r.createElement("span",{style:{marginLeft:o.kc}},t?.name||e[0])),n,"pointer")}return r.createElement(T.A,{enabled:n},r.createElement(A.A,null))}default:return r.createElement(T.A,{enabled:n},r.createElement(E.sA,{id:"COMMON_FALLBACK"}))}var P},b=e=>e.ip_or_subnet||`${e.ip_start}-${e.ip_stop}`},802123(e,t,n){n.d(t,{A:()=>d});var r=n(296540),i=n(758649),s=n(566723),l=n(203157),a=n(294303),_=n(916537),o=n(115829),A=n(424135),E=n(819127);const d=({enabled:e,label:t,tooltipItems:n,neverShowListMarkers:d,limit:c=20,seeMoreCallback:p,isInteractive:I,title:m,showMatchOppositeIcon:T,listGap:R,iconProps:S})=>r.createElement(a.A,{flex:1,overflow:"hidden",gap:s.YC},T?r.createElement(l.A,{enabled:e}):null,r.createElement(A.A,{tooltip:r.createElement(E.A,{title:m,position:"top",isInteractive:Boolean(p)||I,items:n,showListMarkers:!d,maxItemCount:c,getItemKey:(e,t)=>t,renderItem:e=>e,listGap:R,renderShowMore:p?()=>r.createElement(i.A,{variant:"inline",onClick:p},r.createElement(_.sA,{id:"COMMON_SEE_MORE"})):void 0,iconProps:S})},t?r.createElement(o.A,{color:e?"inherit":"disabled"},t):null))},819127(e,t,n){n.d(t,{A:()=>l});var r=n(296540),i=n(766624),s=n(530813);const l=function({items:e,getItemKey:t,renderItem:n,maxItemCount:l,renderShowMore:a,showListMarkers:_,title:o,position:A,isInteractive:E,cursorType:d,listGap:c,iconProps:p}){return r.createElement(i.A,{title:o,position:A,isInteractive:E,cursorType:d,description:r.createElement(s.A,{items:e,getItemKey:t,renderItem:n,maxItemCount:l,listGap:c,renderShowMore:a,showListMarkers:_}),iconProps:p})}},203157(e,t,n){n.d(t,{A:()=>o});var r=n(296540),i=n(271856),s=n(400270),l=n(566723),a=n(294303),_=n(916537);const o=({enabled:e})=>r.createElement(a.A,{opacity:e?void 0:l.xN},r.createElement(i.A,{description:r.createElement(_.sA,{id:"COMMON_MATCH_OPPOSITE"}),portal:!0},r.createElement(s.A,{size:"original"})))},424135(e,t,n){n.d(t,{A:()=>l});var r=n(296540),i=n(566723),s=n(294303);const l=({children:e,tooltip:t})=>r.createElement(s.A,{maxWidth:"100%",overflow:"hidden",gap:i.YC,alignItems:"center"},e?r.createElement(s.A,{flex:1,overflow:"hidden"},e):null,t)},884740(e,t,n){n.d(t,{A:()=>o});var r=n(822336),i=n(296540),s=n(271856),l=n(823858),a=n(382389),_=n(916537);const o=(0,i.memo)(()=>{const{themeName:e}=(0,a.u)();return i.createElement(s.A,{portal:!0,description:i.createElement(_.sA,{id:"SETTINGS_FIREWALL_RULES_MISSING_NETWORK_TOOLTIP"})},i.createElement(l.A,{color:r.Ay[`desktop-color-orange-06-${e}`],size:"original"}))})},269889(e,t,n){n.d(t,{A:()=>s});var r=n(296540),i=n(217439);const s=({enabled:e,color:t,children:n,...s})=>r.createElement(i.A,{color:!1===e?"disabled":t||"inherit",size:"inherit",...s},n)},506538(e,t,n){n.d(t,{p:()=>i});var r=n(71479);n(132196).AH`
  th {
    span {
      font-size: 14px;
      font-weight: 600;
    }
    svg {
      width: 16px;
      height: 16px;
    }
  }
`;const i=(0,r.A)("div")`
  width: 100%;
  .${"truncate-text-tooltip"} {
    display: flex;
  }
`},524803(e,t,n){n.d(t,{Po:()=>d,eX:()=>E,rR:()=>A});var r=n(296540),i=n(271856),s=n(916537),l=n(113658),a=n(506538),_=n(269889),o=n(802123);const A=(e,t,n={},l={})=>a=>r.createElement(i.A,{portal:!0,description:e?r.createElement(s.sA,{id:e,values:l}):t,...n},a),E=(e,t,n,i="default",s=!1)=>{const A=r.createElement(l.v,{text:t,textElement:r.createElement(_.A,{enabled:n,isTruncated:!0},t),tooltipProps:{cursorType:i}});return r.createElement(a.p,null,r.createElement(o.A,{label:A,tooltipItems:e,enabled:n,showMatchOppositeIcon:s}))},d=(e,t,n="default")=>r.createElement(l.v,{text:e,tooltipProps:{cursorType:n,style:{display:"grid"}},textProps:{isTruncated:!0,color:t?"inherit":"disabled",size:"inherit"}})},28694(e,t,n){n.d(t,{g:()=>i});var r=n(756093);const i={ALL:"COMMON_ALL",[r.d.DOMAIN]:"COMMON_DOMAIN_NAME",[r.d.IP]:"COMMON_IP_ADDRESS",[r.d.INTERNET]:"COMMON_INTERNET",[r.d.REGION]:"COMMON_REGION"}},68783(e,t,n){n.d(t,{or:()=>r});const r=(e,t)=>{if(!Array.isArray(e)||e.length<2)throw new Error("Unable to combine - missing source regexes");const n=e.map(e=>`(${(e=>e.toString().substring(1).split(/\/([^/]*)$/))(e)[0]})`).join("|");return new RegExp(n,t)}}}]);