"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[18800],{740848(e,t,n){n.d(t,{X:()=>i,o:()=>d});var a=n(159469),o=n(653159);const i=()=>({icon:a.C.danger,message:"COMMON_LOG_API_ERROR"}),d={[o.DU.RISK]:[],[o.DU.ACTION]:[],[o.DU.DIRECTION]:[],[o.DU.PROTOCOL]:[],[o.DU.POLICY]:[],[o.DU.POLICY_TYPE]:[],[o.DU.SERVICE]:[],[o.DU.SOURCE_HOST]:[],[o.DU.SOURCE_MAC]:[],[o.DU.SOURCE_IP]:[],[o.DU.SOURCE_PORT]:[],[o.DU.SOURCE_NETWORK_ID]:[],[o.DU.SOURCE_DOMAIN]:[],[o.DU.SOURCE_ZONE_ID]:[],[o.DU.SOURCE_REGION]:[],[o.DU.DESTINATION_HOST]:[],[o.DU.DESTINATION_MAC]:[],[o.DU.DESTINATION_IP]:[],[o.DU.DESTINATION_PORT]:[],[o.DU.DESTINATION_NETWORK_ID]:[],[o.DU.DESTINATION_DOMAIN]:[],[o.DU.DESTINATION_ZONE_ID]:[],[o.DU.DESTINATION_REGION]:[],[o.DU.IN_NETWORK_ID]:[],[o.DU.OUT_NETWORK_ID]:[],[o.DU.NEXT_AI_QUERY]:[],[o.DU.EXCEPT_FOR]:[],[o.DU.SEARCH_TEXT]:"",[o.DU.TIMESTAMP_FROM]:0,[o.DU.TIMESTAMP_TO]:0,[o.DU.PAGE_NUMBER]:0,[o.DU.PAGE_SIZE]:0,[o.DU.SKIP_COUNT]:!1}},612389(e,t,n){n.d(t,{A:()=>m});var a=n(274934),o=n(814557),i=n(938984),d=n(247816),r=n(263705),l=n(309130),s=n(100978);const c=(0,d.A)(i.A)`
  line-height: 20px;
`,m=({icon:e,description:t,action:n,footer:i,background:d,...m})=>{const{themeName:A}=(0,r.u)();return(0,a.jsxs)(s.A,{flexGrow:1,borderRadius:l.YC,padding:l.kc,background:d||o.Ay[`desktop-color-neutral-01-${A}`],gap:l.kc,flexDirection:"column",...m,children:[(0,a.jsxs)(s.A,{flexGrow:1,gap:l.kc,children:[e,t?(0,a.jsx)(c,{size:"medium",children:t}):null,n?(0,a.jsx)(s.A,{marginLeft:"auto",children:(0,a.jsx)(c,{size:"medium",children:n})}):null]}),i]})}},535322(e,t,n){n.d(t,{A:()=>h,I:()=>a});var a,o=n(274934),i=n(814557),d=n(158885),r=n(247816),l=n(565527),s=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const A=(0,r.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${s.Ln}`:s.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||s.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,r.A)(d.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||i.Ay[t===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${s.Ln} ${s.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:i,flex:d,width:r,nested:l,...s})=>"items"in s?(0,o.jsx)(u,{marginBottom:t,margin:n,padding:i,flex:d,nested:l,...s}):(0,o.jsx)(A,{nested:l,width:r,marginBottom:t,margin:n,padding:i,flex:d,isButtonList:e===a.BUTTON_LIST,...s,children:s.children})},18800(e,t,n){n.r(t),n.d(t,{default:()=>Q});var a,o=n(274934),i=n(977872),d=n(602086),r=n(775113);!function(e){e.ALL="ALL",e.FILTERED="FILTERED"}(a||(a={}));var l=n(356823),s=n(487763),c=n(599110),m=n(264570),A=n(820633),u=n(205521),h=n(470070),D=n(450734),g=n(897166),T=n(570801),O=n(653159),p=n(571766),E=n(29472),x=n(159469),I=n(774366);const C=`${n(93344).gI}/export`;var L=n(740848),_=n(247816),U=n(309130),R=n(100978);const f=(0,_.A)(R.A)`
  gap: ${U.kc};
  width: 100%;
  justify-content: flex-end;
  padding: ${U.S2} ${U.Ln};
`,N=(0,d.memo)(({calendarValue:e,flowsDownloadMode:t})=>{const n=(0,i.wA)(),r=(0,i.d4)(l.uK),_=(0,i.d4)(l.cd),U=(0,d.useCallback)(()=>{n((0,u.K5)())},[n]),R=(0,i.d4)(A.zi),N=(0,i.d4)(T.BQ),S=(0,i.d4)(g.hq),$=(0,d.useMemo)(()=>new Intl.DateTimeFormat(R,{hourCycle:N,timeZone:S,month:"short",day:"numeric",year:"numeric"}),[N,S,R]),{timestampFrom:k,timestampTo:b}=(0,d.useMemo)(()=>({timestampFrom:new Date(e?.start.toString()).getTime(),timestampTo:new Date(e?.end.toString()).getTime()}),[e?.start,e?.end]),j=(0,d.useCallback)(()=>{n(((e={},t={})=>(0,E.vB)(p.aC,null,null,I.A.POST,C,e,e.data,{failureToast:{icon:x.C.danger,message:"COMMON_NOTICE_REQUEST_ERROR"},fetchConfig:{headers:{"Content-Type":"application/json"},getAllPostData:!0},...t}))({data:{...(0,s.A)(t===a.FILTERED?r:L.o,[O.DU.PAGE_NUMBER,O.DU.PAGE_SIZE]),[O.DU.TIMESTAMP_FROM]:k,[O.DU.TIMESTAMP_TO]:b}},{onBeforeCall:()=>{n((0,D.mh)(!0))}})).then(e=>{(0,m.P)(`${$.format(k)}_${$.format(b)}.csv`,e)}).finally(()=>{n((0,D.mh)(!1))})},[n,k,b,r,$,t]);return(0,o.jsxs)(f,{children:[(0,o.jsx)(c.A,{type:"button",variant:"default",size:"medium",onClick:U,children:(0,o.jsx)(h.sA,{id:"COMMON_ACTION_CANCEL"})}),(0,o.jsx)(c.A,{type:"button",variant:"primary",size:"medium",onClick:j,disabled:!k||!b||_,loader:_?"spinner":void 0,children:(0,o.jsx)(h.sA,{id:"COMMON_DOWNLOAD"})})]})});var S=n(496253),$=n.n(S),k=n(956976),b=n(938984),j=n(642687),w=n(387447),M=n(853777),y=n(846371),v=n(491396),P=n(535322),F=n(612389),B=n(474515),K=n(67407),G=n(908270),V=n(814557);const z=(0,_.A)(R.A)`
  width: 100%;
  flex-direction: column;
  padding-top: ${U.YC};
  gap: ${U.xO};
`,W=(0,_.A)(R.A)`
  gap: ${U.Ln};
`,Y=(0,_.A)(R.A)`
  flex-direction: column;
  gap: ${U.YC};
`,H=(0,_.A)(R.A)`
  width: 100%;
  align-items: center;
  gap: ${U.xO};
  background-color: ${({theme:{themeName:e}})=>V.Ay[`desktop-color-neutral-02-${e}`]};
  height: 32px;
  padding: 0 ${U.kc};
  border-radius: ${V.Ay["desktop-radius-base"]};
  > :last-child {
    margin-left: auto;
  }
  color: ${({theme:{themeName:e}})=>V.Ay[`desktop-color-text-1-${e}`]};
  font-size: 14px;
`,Z=({calendarValue:e,setCalendarValue:t,flowsDownloadMode:n,setFlowsDownloadMode:s,flowsInInitialState:c})=>{const[m,A]=(0,d.useState)(!1),u=(0,i.d4)(l.cd),D=(0,d.useCallback)(e=>{A(e)},[]),g=(0,d.useCallback)(e=>{e&&t(e)},[t]),T=(0,G.A)(),O=(0,K.A)(),{maxValue:p,minValue:E}=(0,d.useMemo)(()=>({maxValue:(0,r.A)($()(new Date),"CalendarDateTime"),minValue:(0,r.A)(new Date(0),"CalendarDateTime")}),[]),x=(0,d.useMemo)(()=>[{id:a.ALL,children:(0,o.jsx)(h.sA,{id:"FLOWS_ALL_FLOWS"}),onChange:()=>{s(a.ALL)},checked:n===a.ALL},{id:a.FILTERED,children:(0,o.jsx)(h.sA,{id:"FLOWS_FILTERED_FLOWS"}),onChange:()=>{s(a.FILTERED)},checked:n===a.FILTERED}],[n,s]),I=(0,d.useMemo)(()=>[[e?.start.day,e?.start.month,e?.start.year].filter(Boolean).join(" / "),[e?.end.day,e?.end.month,e?.end.year].filter(Boolean).join(" / ")].join(" - "),[e?.start.day,e?.start.month,e?.start.year,e?.end.day,e?.end.month,e?.end.year]);return(0,o.jsx)(P.A,{children:(0,o.jsxs)(z,{children:[(0,o.jsxs)(Y,{children:[(0,o.jsx)(b.A,{size:"small",color:u?"disabled":"text-3",children:(0,o.jsx)(h.sA,{id:"COMMON_DATE_RANGE"})}),(0,o.jsx)(w.X,{isDisabled:u,isOpen:m,value:e,"aria-label":"Flows Download Date Range Picker",localizationTexts:O,onChange:g,onOpenChange:D,presets:T,maxValue:p,minValue:E,children:(0,o.jsx)(j.A,{style:{width:"100%",...B.e,...u?{pointerEvents:"none",opacity:.3}:{}},children:(0,o.jsxs)(H,{children:[(0,o.jsx)(y.A,{size:"original"}),I,(0,o.jsx)(v.A,{size:"original"})]})})})]}),c?null:(0,o.jsx)(W,{children:x.map(({id:e,children:t,checked:n,onChange:a})=>(0,o.jsx)(k.A,{id:e,checked:n,disabled:u,onChange:a,children:t},e))}),u?(0,o.jsx)(F.A,{icon:(0,o.jsx)(M.A,{size:"original",variant:"fill",isActive:!0}),description:(0,o.jsx)(h.sA,{id:"FLOWS_DOWNLOAD_ALERT"})}):null]})})},X=(0,_.A)(R.A)`
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
`,Q=()=>{const e=(0,i.d4)(l._S),{startDate:t,endDate:n}=(0,i.d4)(l.tT),[s,c]=(0,d.useState)({start:(0,r.A)(t,"CalendarDateTime"),end:(0,r.A)(n,"CalendarDateTime")}),[m,A]=(0,d.useState)(e?a.ALL:a.FILTERED);return(0,d.useEffect)(()=>{A(e?a.ALL:a.FILTERED)},[e]),(0,o.jsxs)(X,{children:[(0,o.jsx)(Z,{calendarValue:s,setCalendarValue:c,flowsDownloadMode:m,setFlowsDownloadMode:A,flowsInInitialState:e}),(0,o.jsx)(N,{calendarValue:s,flowsDownloadMode:m})]})}},264570(e,t,n){n.d(t,{P:()=>o});var a=n(635187);function o(e,t,n){const o=URL.createObjectURL(t),i=document.createElement("a");i.id=n,i.href=o,i.download=e.replaceAll(/[^A-Za-z0-9_\-.]/g,a.jr),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}}}]);